diff --git a/.agents/skills/apm-integrations/SKILL.md b/.agents/skills/apm-integrations/SKILL.md new file mode 100644 index 00000000000..0975cdd38c5 --- /dev/null +++ b/.agents/skills/apm-integrations/SKILL.md @@ -0,0 +1,195 @@ +--- +name: apm-integrations +description: Write a new library instrumentation end-to-end. Use when the user ask to add a new APM integration or a library instrumentation. +context: fork +allowed-tools: + - Bash + - Read + - Write + - Edit + - Glob + - Grep +--- + +Write a new APM end-to-end integration for dd-trace-java, based on library instrumentations, following all project conventions. + +## Step 1 – Read the authoritative docs and sync this skill (mandatory, always first) + +Before writing any code, read all three files in full: + +1. [`docs/how_instrumentations_work.md`](docs/how_instrumentations_work.md) — full reference (types, methods, advice, helpers, context stores, decorators) +2. [`docs/add_new_instrumentation.md`](docs/add_new_instrumentation.md) — step-by-step walkthrough +3. [`docs/how_to_test.md`](docs/how_to_test.md) — test types and how to run them + +These files are the single source of truth. Reference them while implementing. + +## Step 2 – Clarify the task + +If the user has not already provided all of the following, ask before proceeding: + +- **Framework name** and **minimum supported version** (e.g. `okhttp-3.0`) +- **Target class(es) and method(s)** to instrument (fully qualified class names preferred) +- **Target system**: one of `Tracing`, `Profiling`, `AppSec`, `Iast`, `CiVisibility`, `Usm`, `ContextTracking` +- **Whether this is a bootstrap instrumentation** (affects allowed imports) + +## Step 3 – Find a reference instrumentation + +Search `dd-java-agent/instrumentation/` for a structurally similar integration: +- Same target system +- Comparable type-matching strategy (single type, hierarchy, known types) + +Read the reference integration's `InstrumenterModule`, Advice, Decorator, and test files to understand the established +pattern before writing new code. Use it as a template. + +## Step 4 – Set up the module + +1. Create directory: `dd-java-agent/instrumentation/$framework/$framework-$minVersion/` +2. Under it, create the standard Maven source layout: + - `src/main/java/` — instrumentation code + - `src/test/groovy/` — Groovy/Spock instrumentation tests (see Step 9.1) +3. Create `build.gradle` with: + - `compileOnly` dependencies for the target framework + - `testImplementation` dependencies for tests + - `muzzle { pass { } }` directives (see Step 9.2) +4. Register the new module in `settings.gradle.kts` in **alphabetical order** +5. Register all integration names in `metadata/supported-configurations.json` — **read [Supported Configurations](references/supported-configurations.md)** for the exact key shapes and CI checks involved. Declaring several names (`super("a", "b")`) means one entry each. + +**See [Naming Conventions](references/naming-conventions.md) — module directory name must end with a version or an allowed suffix (`-common`, `-stubs`, `-iast`). Java filename and `public class` name MUST match character-for-character including acronym casing (CRITICAL — see § "Java naming consistency").** + +## Step 4.1 – Span-creating vs context-tracking instrumentation + +Read [Context-Tracking Instrumentation](references/context-tracking.md) and decide whether the library needs `InstrumenterModule.Tracing` (I/O operations that create spans) or `InstrumenterModule.ContextTracking` (async-boundary bridging, no spans). + +## Step 5 – Write the InstrumenterModule + +**Read [InstrumenterModule Guidance](references/instrumenter-module.md).** + +## Step 6 – Write the Decorator + +- Extend the most specific available base decorator: + - `HttpClientDecorator`, `DatabaseClientDecorator`, `ServerDecorator`, `MessagingClientDecorator`, etc. +- One `public static final DECORATE` instance +- Define `UTF8BytesString` constants for the component name and operation name +- Keep all tag/naming/error logic here — not in the Advice class +- Override `spanType()`, `component()`, `spanKind()` as appropriate +- Override `instrumentationNames()` to return the primary integration name without a version suffix: `return new String[] {"jedis"};` not `"jedis-3.0"`. +- `BaseDecorator` uses those names to resolve analytics settings (`DD_TRACE__ANALYTICS_ENABLED`, `DD_TRACE__ANALYTICS_SAMPLE_RATE`). Search `metadata/supported-configurations.json` for each returned name — if analytics keys are absent, add them (see [Supported Configurations](references/supported-configurations.md) for the JSON shape). + +## Step 7 – Write the Advice class (highest-risk step) + +**Read [Writing the Advice Class](references/advice-class.md) — the highest-risk step.** Pay particular attention to: `@Advice.OnMethodEnter/Exit` annotations; `CallDepthThreadLocalMap` reentrancy guarding; span lifecycle order; and the "Must NOT do" list. + +## Step 8 – Add SETTER/GETTER adapters (if applicable) + +For context propagation to and from upstream services, like HTTP headers, +implement `AgentPropagation.Setter` / `AgentPropagation.Getter` adapters that wrap the framework's specific header API. +Place them in the helpers package, declare them in `helperClassNames()`. + +## Step 9 – Write tests + +Cover all mandatory test types: + +### 1. Instrumentation test (mandatory) + +**Read [Writing Tests](references/tests.md).** Instrumentation tests are Groovy/Spock (`src/test/groovy/`) — add the `tag: override groovy enforcement` label to suppress the `Enforce Groovy Migration` CI check (which blocks new `.groovy` files by default — instrumentation tests are intentionally Groovy/Spock). Must cover error/exception scenarios. When adding new integration names, register them per [Supported Configurations](references/supported-configurations.md). When `compileOnly` and `testImplementation` use different versions, comment the specific class that requires the higher version. Include sibling version modules as `testImplementation` dependencies for mutual-exclusion tests. + +### 2. Muzzle directives (mandatory) + +**Read [Muzzle Directives](references/muzzle.md)** — it covers all three valid patterns and their `assertInverse` rules. Search adjacent module `build.gradle` files for `skipVersions` before declaring a new version-bounded module's muzzle directives. + +### 3. Latest dependency test (mandatory) + +Use `latestDepTestImplementation` in `build.gradle` to pin the latest available version. Run with: +```bash +./gradlew :dd-java-agent:instrumentation:$framework:$framework-$version:latestDepTest +``` + +**`latestDepTestImplementation` version range must match the instrumented range.** If your module instruments version `2.x`, use `2.+` as the version constraint, not `3.+`: + +```groovy +// WRONG — latestDep tests against 3.x but the module only instruments 2.x +latestDepTestImplementation group: 'commons-httpclient', name: 'commons-httpclient', version: '3.+' + +// CORRECT — latestDep tests against the highest 2.x release +latestDepTestImplementation group: 'commons-httpclient', name: 'commons-httpclient', version: '2.+' +``` + +Using `3.+` for a `2.x` instrumentation means `latestDepTest` runs against an incompatible API version and will either fail or silently test nothing. + +### 4. Smoke test (optional) + +Add a smoke test in `dd-smoke-tests/` only if the framework warrants a full end-to-end demo-app test. + +## Step 10 – Build and verify + +Run these commands in order and fix any failures before proceeding: + +```bash +./gradlew :dd-java-agent:instrumentation:$framework:$framework-$version:muzzle +./gradlew :dd-java-agent:instrumentation:$framework:$framework-$version:test +./gradlew :dd-java-agent:instrumentation:$framework:$framework-$version:latestDepTest +./gradlew checkInstrumenterModuleConfigurations +./gradlew checkDecoratorAnalyticsConfigurations +./gradlew spotlessApply +./gradlew :dd-java-agent:updateAgentJarIntegrationsGoldenFile +``` + +After `updateAgentJarIntegrationsGoldenFile` runs, commit the updated `metadata/agent-jar-checks.properties` file alongside your instrumentation changes. The `verifyAgentJarIntegrations` check runs automatically in CI and fails if this file is out of date. + +**If muzzle fails:** +- Missing helper class names in `helperClassNames()` — the most common cause; add any missing inner, anonymous, or enum synthetic classes. +- Wrong version range — the declared `versions` in `build.gradle` doesn't cover the versions actually used by tests; adjust the bounds. +- API mismatch — the instrumented class or method doesn't exist in the declared version; check the library's changelog and narrow the `compileOnly` version or the muzzle range. + +**If `checkInstrumenterModuleConfigurations` fails:** an integration name from `super(...)` is missing +(or mismatched) in `metadata/supported-configurations.json` — see [Supported Configurations](references/supported-configurations.md). + +**If `checkDecoratorAnalyticsConfigurations` fails:** a name returned by the decorator's `instrumentationNames()` is missing `DD_TRACE__ANALYTICS_ENABLED` / `DD_TRACE__ANALYTICS_SAMPLE_RATE` entries in `metadata/supported-configurations.json` — add them per [Supported Configurations](references/supported-configurations.md). + +**If tests fail:** verify span lifecycle order (start → activate → error → close → finish), helper registration, +and `contextStore()` map entries match actual usage. + +## Step 11 – Checklist before finishing + +Output this checklist and confirm each item is satisfied: + +- [ ] `settings.gradle.kts` entry added in alphabetical order +- [ ] `metadata/supported-configurations.json` has a `DD_TRACE__ENABLED` entry (+ the two aliases) for every name passed to `super(...)` +- [ ] `metadata/supported-configurations.json` has `DD_TRACE__ANALYTICS_ENABLED` and `DD_TRACE__ANALYTICS_SAMPLE_RATE` entries for every name returned by the decorator's `instrumentationNames()` +- [ ] `build.gradle` has `compileOnly` deps and `muzzle` directives +- [ ] Muzzle pattern is correct (see [Muzzle Directives](references/muzzle.md)) +- [ ] `latestDepTestImplementation` version range matches the instrumented version range (e.g. `2+` not `3+` for a `2.x` module) +- [ ] `@AutoService(InstrumenterModule.class)` annotation present on the module class +- [ ] `helperClassNames()` lists ALL referenced helpers (including inner, anonymous, and enum synthetic classes) +- [ ] Advice methods are `static` with `@Advice.OnMethodEnter` / `@Advice.OnMethodExit` annotations +- [ ] `@Advice.OnMethodEnter(suppress = Throwable.class)` on enter; `@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)` on exit (omit `onThrowable` when hooking a constructor) +- [ ] No static constants holding return values of one-shot instrumenter methods (`triggerClasses()`, `contextStore()`, etc.) +- [ ] No logger field in the Advice class or InstrumenterModule class +- [ ] No `inline=false` left in production code +- [ ] No `java.util.logging.*` / `java.nio.file.*` / `javax.management.*` in bootstrap path +- [ ] `metadata/agent-jar-checks.properties` updated via `./gradlew :dd-java-agent:updateAgentJarIntegrationsGoldenFile` and committed +- [ ] Span lifecycle order is correct: startSpan → afterStart → activateSpan (enter); onError → beforeFinish → close → finish (exit) +- [ ] All Step 10 verification commands passed with no failures + +## Step 12 – Retrospective: update this skill with what was learned + +After the instrumentation is complete (or abandoned), review the full session and improve this skill for future use. + +**Collect lessons from four sources:** + +1. **Build/test failures** — did any Gradle task fail with an error that this skill did not anticipate or gave wrong + guidance for? (e.g. a muzzle failure that wasn't caused by missing helpers, a test pattern that didn't work) +2. **Docs vs. skill gaps** — did Step 1's sync miss anything? Did you consult the docs for something not captured here? +3. **Reference instrumentation insights** — did the reference integration use a pattern, API, or convention not + reflected in any step of this skill? +4. **User corrections** — did the user correct an output, override a decision, or point out a mistake? + +**For each lesson identified**, edit this file (`.agents/skills/apm-integrations/SKILL.md`) or its referenced files +using the `Edit` tool: +- Wrong rule → fix it in place +- Missing rule → add it to the most relevant step +- Wrong failure guidance → update the relevant "If X fails" section in Step 10 +- Misleading or obsolete content → remove it + +Keep each change minimal and targeted. Do not rewrite sections that worked correctly. +After editing, confirm to the user which improvements were made to the skill. diff --git a/.agents/skills/apm-integrations/references/advice-class.md b/.agents/skills/apm-integrations/references/advice-class.md new file mode 100644 index 00000000000..b75cde27623 --- /dev/null +++ b/.agents/skills/apm-integrations/references/advice-class.md @@ -0,0 +1,154 @@ +# Writing the Advice Class + +> Referenced from `SKILL.md` Step 7. The highest-risk step — every rule in this file exists because someone's PR broke on it. + +## Must do + +- Advice methods **must** be `static` +- Annotate enter: `@Advice.OnMethodEnter(suppress = Throwable.class)` +- Annotate exit: `@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)` + - **Exception**: do NOT use `onThrowable` when hooking a constructor — if the constructor throws, `@Advice.This` is a partially initialized object +- Use `@Advice.Local("...")` for values shared between enter and exit (span, scope) +- Use the correct parameter annotations: + - `@Advice.This` — the receiver object + - `@Advice.Argument(N)` — a method argument by index + - `@Advice.Return` — the return value (exit only) + - `@Advice.Thrown` — the thrown exception (exit only) + - `@Advice.Enter` — the return value of the enter method (exit only) +- Use `CallDepthThreadLocalMap` to guard against recursive instrumentation of the same method +- **Instrument the single delegate method, not all overloads**: when a library has multiple overloads of the same operation (e.g. `executeMethod(String)`, `executeMethod(HostConfig)`, `executeMethod(HostConfig, HttpMethod)`), check if they all delegate to a single internal method. If yes, instrument ONLY the delegate — not each overload. Instrumenting all overloads without a proper reentrancy guard creates **duplicate spans per request** (one per overload in the call chain) and injects context propagation headers multiple times. Use `CallDepthThreadLocalMap` when you must instrument at a higher level. + +## Span lifecycle (in order) + +Enter method: +1. `AgentSpan span = startSpan(DECORATE.operationName(), ...)` +2. `DECORATE.afterStart(span)` + set domain-specific tags +3. `AgentScope scope = activateSpan(span)` — return or store via `@Advice.Local` + +Exit method: +4. `DECORATE.onError(span, throwable)` — only if throwable is non-null +5. `DECORATE.beforeFinish(span)` +6. `scope.close()` +7. `span.finish()` + +### onExit handling when the target method throws + +The `onThrowable = Throwable.class` attribute on `@Advice.OnMethodExit` controls whether the exit advice fires when the **instrumented target method** throws. You **must** set it explicitly to `Throwable.class` for any exit advice that closes a scope or finishes a span — the default skips exceptional termination, which leaks active scopes when the instrumented method throws. + +```java +// Standard pattern — exit fires whether the target method returned or threw +@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) +public static void exit( + @Advice.Enter final AgentScope scope, + @Advice.Thrown final Throwable thrown) { + if (scope != null) { + AgentSpan span = scope.span(); + DECORATE.onError(span, thrown); + DECORATE.beforeFinish(span); + scope.close(); + span.finish(); + } +} +``` + +**`onThrowable` does NOT compensate for `onEnter` throwing.** Per `docs/how_instrumentations_work.md`: "If the `Advice.OnMethodEnter` method throws an exception, the `Advice.OnMethodExit` method is not invoked" — this is unconditional. To keep `onEnter` from throwing in the first place, use `suppress = Throwable.class` on the enter advice. + +When using `CallDepthThreadLocalMap`, only the outermost call (the one where `incrementCallDepth` returned 0) should reset the counter. Recursive inner calls that returned early on enter must also return early on exit without resetting — otherwise an inner exit clears the counter while the outer call is still active, allowing subsequent nested calls to create duplicate spans. The exit guard must mirror the enter guard exactly. + +### Specify charset explicitly when converting byte[] to String + +```java +// WRONG — uses platform default charset +String cmd = new String(commandBytes); + +// CORRECT — explicit charset +import java.nio.charset.StandardCharsets; +String cmd = new String(commandBytes, StandardCharsets.UTF_8); +``` + +### Do NOT catch `NullPointerException`; use null-check guards instead + +Catching `NullPointerException` is always a sign of an unguarded precondition — fix the root cause with an explicit null check instead. dd-trace-java enforces this via SpotBugs rule `DCN_NULLPOINTER_EXCEPTION`; violations fail `:spotbugsMain` and block the PR. + +```java +// WRONG — SpotBugs DCN_NULLPOINTER_EXCEPTION +@Override +protected int status(final HttpMethod httpMethod) { + try { + return httpMethod.getStatusCode(); + } catch (NullPointerException e) { + // getStatusCode() throws NPE when statusLine is null + return 0; + } +} + +// CORRECT — null-check guard (this is the canonical master pattern) +@Override +protected int status(final HttpMethod httpMethod) { + final StatusLine statusLine = httpMethod.getStatusLine(); + return statusLine == null ? 0 : statusLine.getStatusCode(); +} +``` + +**How to discover**: when implementing a method that calls library code which may NPE on null internal state, READ the master module's analogous method for the canonical null-check pattern. The master typically exposes the nullable intermediate (e.g. `getStatusLine()`) so you can guard it. + +### Do not double-span async HTTP clients + +If the target method delegates to a sync client that is already instrumented (common in async-wrapper classes like `AsyncFeignClient`, `AsyncHttpClient`, etc.), do NOT open a second span in the async wrapper. The sync client's advice already opens the client span; wrapping again produces two spans per request, with the outer span holding no additional context. + +Before adding advice to an async wrapper, trace the call path to the sync delegate. If the delegate is already instrumented for span emission, the async wrapper only needs context-propagation advice — not a second span. But note that "context-propagation only" is more nuanced than a completion-callback: + +**If the sync delegate runs on a worker/executor thread** (the common shape for `AsyncXxxClient`), completion-only propagation is insufficient. The sync client's advice creates its HTTP span while the worker executes — BEFORE the future completes — so a "restore context on completion" callback runs too late; the sync span would emit as a root or under the wrong context. The wrapper's propagation advice needs to either: + +1. **Rely on executor instrumentation** — if the worker is scheduled via a `java.util.concurrent.Executor`/`ExecutorService` and the toolkit's `java-concurrent-1.8` module wraps it, context propagates automatically. No additional wrapper advice needed. Verify by reading the wrapper's submission code and confirming the executor is one the toolkit instruments. + +2. **Reactivate around the delegate submission** — wrap the `Runnable`/`Callable` submitted to the worker so it opens a scope with the captured context before invoking the sync call. This is the pattern used by `java-concurrent-1.8`'s wrappers. Do NOT reinvent this per client — factor into a shared helper. + +The completion callback advice (whenComplete-style) is still useful for span-close cleanup on the caller's future, but it does not by itself guarantee the sync client's advice sees the right parent. See `context-tracking.md` for the propagation patterns and the specific `readOnly`/lambda constraints. + +## Multiple advice classes and `@AppliesOn` + +If your instrumentation needs to apply multiple advices to the same method (e.g. separate context-tracking from tracing logic), use `applyAdvices()` inside `methodAdvice()`. Use the `@AppliesOn` annotation to control which target systems each advice applies to. + +See the `@AppliesOn Annotation` section of `docs/how_instrumentations_work.md` for the full API and examples. + +## Must NOT do + +- **No logger fields** in the Advice class or the Instrumentation class (loggers only in helpers/decorators) +- **No code in the Advice constructor** — it is never called +- **Do not use lambdas in advice methods** — they create synthetic classes that will be missing from helper declarations +- **No references** to other methods in the same Advice class or in the InstrumenterModule class +- **No `InstrumentationContext.get()`** outside of Advice code +- **No `inline=false`** in production code (only for debugging; must be removed before committing) +- **No `java.util.logging.*`, `java.nio.file.*`, or `javax.management.*`** in bootstrap instrumentations +- **Do not extract advice logic into a helper class just to shorten the advice body.** Advice methods are inlined by ByteBuddy; extracting into `SomethingHelper.doTheThing(...)` adds a static-method hop, an extra file, and misleads reviewers into thinking the helper is shared when it is used by exactly one advice. Keep advice inline unless the same logic is genuinely shared across multiple advice classes. When it IS shared, the helper belongs in `helperClassNames()` and named accordingly (e.g. `TracingUtils`, not `FooBarHelper`). The CallDepth helper-class carveout (see `instrumenter-module.md`) is a separate case for multi-type instrumentations. + +### Route-only enrichers: enrich the outer span, do not replace it + +**Scope:** this rule applies specifically to instrumentations that only observe **route matching / dispatch decisions** inside an outer HTTP server — the SparkJava case. It does NOT apply to frameworks that own a handler/controller span in addition to the outer server span. + +**Applies to (route-only enrichers):** +- SparkJava — see `dd-java-agent/instrumentation/spark/sparkjava-2.3/.../RoutesInstrumentation.java` + +**Does NOT apply to (frameworks that own a handler/controller span):** +- JAX-RS annotations — `dd-java-agent/instrumentation/rs/jax-rs/jax-rs-annotations/jax-rs-annotations-2.0/.../JaxRsAnnotationsInstrumentation.java:128` legitimately calls `startSpan(JAX_RS_CONTROLLER.toString(), ...)` +- Ratpack — `dd-java-agent/instrumentation/ratpack-1.5/.../TracingHandler.java:41` legitimately calls `startSpan("ratpack", ...)` and relies on executor instrumentation to keep the outer Netty span as its parent +- Any other framework that owns a per-handler span (Spring MVC controllers, Vert.x routes, Micronaut route handlers, etc.) + +**How to tell:** if the framework's expected trace shape has a per-request/per-handler span in addition to the outer HTTP server span, it OWNS that span — do not apply this rule. If the framework only decorates the outer span with a matched-route tag, it is a route-only enricher — apply this rule. + +**For route-only enrichers only:** the outer server's instrumentation already opened the request span (typically `servlet.request` or `jetty-server`). Do NOT create a new `Decorator`, rename the active span, or overwrite its component tag from inside the route-matcher's advice. Enrich the active span with the matched route only. `HTTP_RESOURCE_DECORATOR.withRoute(...)` does NOT guard against a null span, so you MUST null-check before calling it — otherwise the advice NPEs when there is no active span (rare but possible under certain execution paths): + +```java +// CORRECT — matches the pattern in dd-java-agent/instrumentation/spark/sparkjava-2.3/.../RoutesInstrumentation.java +final AgentSpan span = activeSpan(); +if (span != null && routeMatch != null) { + HTTP_RESOURCE_DECORATOR.withRoute(span, method.name(), routeMatch.getMatchUri()); +} +``` + +For route-only enrichers: no `AgentScope`, no `startSpan()`, no `decorator.afterStart()`. This rule does NOT apply to standalone HTTP clients (which own their own span identity) or to handler-owning frameworks like JAX-RS / Ratpack (which legitimately create controller spans). + +### Advice classes must not declare non-constant static fields + +`*Advice.java` classes are inlined at instrumentation sites; non-constant static fields (fields that aren't `static final` primitives or string literals) get pulled into every instrumented callsite and violate muzzle's assumptions. Keep only `static final` constants — no logger references, no cached decorators, no state. If you need shared state, put it on a helper class registered via `helperClassNames()`, not on the advice. diff --git a/.agents/skills/apm-integrations/references/context-tracking.md b/.agents/skills/apm-integrations/references/context-tracking.md new file mode 100644 index 00000000000..697cfb13afd --- /dev/null +++ b/.agents/skills/apm-integrations/references/context-tracking.md @@ -0,0 +1,122 @@ +# Context-Tracking Instrumentation + +> Referenced from `SKILL.md` Step 4.1. Read this BEFORE picking instrumentation targets. + +## Which kind of instrumentation to write + +Before picking instrumentation targets, decide which kind of instrumentation the library needs. dd-trace-java has two: + +**Span-creating instrumentation** — the module extends `InstrumenterModule.Tracing`. Advice creates spans around the library's operations. This is the common case: HTTP clients/servers, DB clients, messaging clients, RPC frameworks. Targets are methods that perform the I/O (e.g. `Connection.sendCommand`, `Client.execute`). Tests assert spans exist with correct tags. + +**Context-tracking instrumentation** — the module extends `InstrumenterModule.ContextTracking`. Advice captures the active trace context at a boundary and restores it when work crosses that boundary. The module creates **no spans** itself; it only bridges trace context for spans created by other instrumentations or by user code. This is the case for reactive libraries (RxJava, Reactor), async/executor libraries (`CompletableFuture`, `ListenableFuture`, executors), coroutine/actor libraries (Kotlin coroutines, pekko/akka), and any code that schedules a callback to run later or on another thread. + +- Typical libraries: RxJava, Reactor, Mutiny, CompletableFuture, ListenableFuture, executors, pekko/akka, lettuce async-command queue, ZIO, virtual threads +- Typical targets: the boundary-crossing type's constructor (capture context) + its subscribe/execute/schedule method (restore context around the callback) +- For RxJava-shaped libraries, one instrumentation per reactive type (e.g. `Observable`, `Flowable`, `Single`, `Maybe`, `Completable`) +- For executor-shaped libraries, one instrumentation for the executor's submit/execute methods wrapping `Runnable`/`Callable` + +## Reference implementation + +**`dd-java-agent/instrumentation/rxjava/rxjava-2.0/`** — the canonical context-tracking module. It uses `InstrumenterModule.ContextTracking`. Contents: 5 type-instrumenters (`ObservableInstrumentation`, `FlowableInstrumentation`, `SingleInstrumentation`, `MaybeInstrumentation`, `CompletableInstrumentation`), 5 wrapper classes (`TracingObserver`, `TracingSubscriber`, `TracingSingleObserver`, `TracingMaybeObserver`, `TracingCompletableObserver`), 1 `RxJavaModule.java`, 1 `RxJavaAsyncResultExtension.java`. Read this before writing a new context-tracking module. + +## What a context-tracking instrumentation captures + +For each boundary-crossing type in the library, the instrumentation needs to identify: + +- **The boundary type** — the FQN of the type that gets subscribed to / executed / scheduled (e.g. `io.reactivex.rxjava3.core.Observable`). +- **The capture point** — where to grab the active trace context. Usually the constructor (`` or `isConstructor()`). +- **The restore point** — where the captured context needs to be reactivated. Usually the `subscribe(...)` / `execute(...)` / `schedule(...)` method that runs the user-provided callback. +- **The wrapped argument type** — the user's callback interface that must be wrapped in a tracing wrapper (e.g. `io.reactivex.rxjava3.core.Observer`, `java.lang.Runnable`). +- **The context store key class** — the FQN used to key the `contextStore` (almost always the boundary type itself). +- **The tracing wrapper** — a new class implementing the callback interface that reattaches the captured context before delegating (e.g. `TracingObserver` implements `Observer`). +- **The wrapper's methods to guard** — the callback methods that must reattach context before running user code (e.g. `onNext`, `onError`, `onComplete` for RxJava observers). + +## Tests for context-tracking instrumentations + +Context-tracking tests assert that **a span created by user code inside the wrapped callback becomes a child of the parent span active when the boundary was created**: + +```groovy +runUnderTrace("parent") { + constructBoundary() // capture happens here + .subscribe({ item -> userCodeStartsAChildSpan() }) // restore happens around the closure +} +// Assert: 1 trace, 2 spans — child has parent's spanId as parentId. +``` + +Do NOT assert span kinds, operation names, span tags, or span types on the *target* methods — there are no spans on those methods. + +## Choosing between method overloads + +When a boundary type exposes multiple overloads of the subscribe / invoke method — e.g. `Flowable.subscribe(Subscriber)` vs `Flowable.subscribe(FlowableSubscriber)`, or `Mono.subscribe(Subscriber)` vs `Mono.subscribe(CoreSubscriber)` — hook the **most specific framework-internal interface**, not the public wrapper. + +**Why:** the public overload typically delegates to the internal one. Hooking the public overload causes double-wrapping (every subscription flows through the wrapper twice) and the internal overload sees a wrapped argument of the wrong runtime type. + +**How to identify the right overload:** read the framework source. The public method usually calls a `subscribeActual(...)` or similar protected method that takes the framework-internal interface. If the framework documents one of the overloads as "for internal use only" or marks it `public final`, that's the implementation method — hook it. + +**Reference:** dd-trace-java's `rxjava-2.0` module hooks the single-argument `subscribe(...)` method (matcher: `named("subscribe").and(takesArguments(1))`) with the argument typed as the base callback interface (e.g. `Observer` for `Observable`, `Subscriber` for `Flowable`). Read the module source to see the exact matcher — pattern-match on this rather than copying overload names. + +## When NOT to write a context-tracking instrumentation + +If the library DOES perform I/O — sends HTTP requests, runs DB queries, makes RPC calls, talks to a broker, reads/writes a cache — write a **span-creating instrumentation** (`InstrumenterModule.Tracing`) instead. Context-tracking is only for libraries that coordinate work; the moment there's actual I/O to observe, you want spans around it. + +Hybrid libraries that BOTH coordinate work AND perform I/O usually get one span-creating instrumentation for the I/O path and (optionally) one context-tracking instrumentation for the coordination path. `lettuce-5.0` is an example: there is a span-creating instrumentation for Redis commands and a separate context-tracking instrumentation for the async command queue. + +## Preserving cancellation on `CompletableFuture` / `CompletionStage` returns + +When advice attaches a completion callback to a `CompletableFuture` returned from an async client, do NOT reassign the return with `future = future.whenComplete(...)`. `whenComplete` produces a **dependent stage**; cancelling that stage does not cancel the original request. The caller's `future.cancel(true)` then only cancels the dependent stage and leaves the underlying I/O running. + +The correct pattern attaches the callback for side-effects only, without reassigning the return — so `@Advice.Return` does NOT need `readOnly = false`. It also declares `onThrowable = Throwable.class` so the exit runs even when the instrumented method throws before returning its future (otherwise ByteBuddy skips exit advice on thrown paths and any span/scope started on enter leaks). And per the "no lambdas in advice methods" rule in `advice-class.md`, the completion callback must be a named helper class, not a lambda — lambdas compile to synthetic classes that muzzle does not helper-inject and ByteBuddy cannot resolve at the instrumentation site. + +```java +// WRONG — three issues in one: +// (a) reassigning `future = ...` severs cancellation from the caller +// (b) unnecessary readOnly = false +// (c) lambda body compiles to a synthetic class that isn't helper-injected +@Advice.OnMethodExit(suppress = Throwable.class) +public static void exit(@Advice.Return(readOnly = false) CompletableFuture future, + @Advice.Enter AgentSpan span) { + future = future.whenComplete((result, error) -> finishSpan(span, result, error)); +} + +// CORRECT — attach a named callback for its side-effect; keep the return read-only; +// run on both normal and throwable exit so the caller-thrown case still cleans up. +@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) +public static void exit(@Advice.Return CompletableFuture future, + @Advice.Enter AgentSpan span, + @Advice.Thrown Throwable thrown) { + if (thrown != null) { + // The instrumented method threw before returning a future — no future to attach to. + // Finish the span here directly. + ClientCompletionCallback.finishOnThrow(span, thrown); + return; + } + if (future != null) { + future.whenComplete(new ClientCompletionCallback(span)); + } +} +``` + +where `ClientCompletionCallback` is a named `BiConsumer` in a separate helper file listed in `helperClassNames()`: + +```java +public final class ClientCompletionCallback implements BiConsumer { + private final AgentSpan span; + + public ClientCompletionCallback(AgentSpan span) { + this.span = span; + } + + @Override + public void accept(Response result, Throwable error) { + // finish the span with the observed outcome + } + + public static void finishOnThrow(AgentSpan span, Throwable thrown) { + // handle the enter-but-no-future case + } +} +``` + +Only add `readOnly = false` if you have a documented reason to substitute the return value. If your goal is just to observe completion, the read-only + named-callback pattern is safer (preserves cancellation), obeys the no-lambdas-in-advice rule, and handles the thrown-before-return case. + +If the wrapper genuinely needs to return a different `CompletionStage` (rare), forward `cancel(...)` to the original future explicitly. diff --git a/.agents/skills/apm-integrations/references/instrumenter-module.md b/.agents/skills/apm-integrations/references/instrumenter-module.md new file mode 100644 index 00000000000..c6ecda9fd0c --- /dev/null +++ b/.agents/skills/apm-integrations/references/instrumenter-module.md @@ -0,0 +1,138 @@ +# InstrumenterModule Guidance + +> Referenced from `SKILL.md` Step 5. Everything needed to write the `InstrumenterModule` class correctly. + +## Conventions to enforce + +- Add `@AutoService(InstrumenterModule.class)` annotation — required for auto-discovery +- Extend the correct `InstrumenterModule.*` subclass (never the bare abstract class) +- Implement the **narrowest** `Instrumenter` interface possible: + - Prefer `ForSingleType` > `ForKnownTypes` > `ForTypeHierarchy` + - **EXCEPTION — API specification / interface-only libraries**: when the target library is a specification JAR containing only interfaces (no concrete classes), `ForSingleType` does not work because there are no concrete types to instrument directly. You MUST use `ForTypeHierarchy` with `implementsInterface(named("the.interface.Fqn"))`. This is how vendor implementations of the specification (ActiveMQ, IBM MQ, EclipseLink, Hibernate, etc.) get instrumented through the common interface contract. + - Common API JARs that REQUIRE `ForTypeHierarchy` + `implementsInterface`: + - **JMS**: `javax.jms:javax.jms-api`, `jakarta.jms:jakarta.jms-api` — see `dd-java-agent/instrumentation/jms/javax-jms-1.1/` for the canonical example. Targets `MessageProducer`, `MessageConsumer`, `Message`, `MessageListener` interfaces. + - **JPA**: `javax.persistence:javax.persistence-api`, `jakarta.persistence:jakarta.persistence-api` + - **JDBC**: `java.sql.*` — interfaces like `Driver`, `Connection`, `Statement`, `PreparedStatement` + - **JCache**: `javax.cache:cache-api` + - **Bean Validation**: `jakarta.validation:jakarta.validation-api` + - **JAX-RS**: `jakarta.ws.rs:jakarta.ws.rs-api` + - **JAX-WS**: `jakarta.xml.ws:jakarta.xml.ws-api` + - **Servlet**: `jakarta.servlet:jakarta.servlet-api` + - **DO NOT classify interface-only API JARs as not_applicable.** They ARE instrumentable via `implementsInterface()`. +- Add `classLoaderMatcher()` if a sentinel class identifies the framework on the classpath +- Declare **all** helper class names in `helperClassNames()`: + - Include inner classes (`Foo$Bar`), anonymous classes (`Foo$1`), and enum synthetic classes — for enums, each constant with an anonymous body generates its own synthetic class (`MyEnum$1`, `MyEnum$2`, …), each must be listed individually +- Declare `contextStore()` entries if context stores are needed (key class → value class) +- **Null-check before every `ContextStore` key** — `ContextStore` does not support null keys. Always guard with a null check before calling `store.put(obj, ...)` or `store.get(obj)`. Passing null throws at runtime; with `suppress = Throwable.class` this silently drops the span. +- Keep method matchers as narrow as possible (name, parameter types, visibility) + +## Must NOT do in InstrumenterModule + +- **Do not extract one-shot method return values into static constants.** + Methods like `triggerClasses()`, `contextStore()`, `classLoaderMatcher()`, and `methodAdvice()` + are called **once** by `AgentInstaller` / the framework wiring. Extracting their return value + into a `private static final` constant provides no performance benefit and needlessly bloats + the constant pool of the instrumentation class. + + ❌ `private static final String[] TRIGGER_CLASSES = new String[]{"com.example.Foo"};` + `public String[] triggerClasses() { return TRIGGER_CLASSES; }` + + ✅ `public String[] triggerClasses() { return new String[]{"com.example.Foo"}; }` + +### Before writing a new module, scan for an existing one + +Before creating `dd-java-agent/instrumentation/$framework/$framework-$version/`, check whether `dd-java-agent/instrumentation/$framework/` already exists and what's in it. + +If an existing module covers the same framework at a compatible version, **modify it in place** — do NOT create a parallel `$framework-2.0-generated/` or nested `$framework/$framework-2.0/` copy. Duplicate modules cause muzzle to match twice, double the CI cost, and create reviewer confusion (see PR #10941's "the more I read about it, the less I understand what was done" — a duplicate module that the reviewer could not disentangle from the original). + +If the existing module targets a genuinely different version range (e.g. existing `foo-1.0/` and you're adding `foo-3.0/`), a version-sibling is correct — but confirm by reading the existing module's muzzle range first. + +### Module constructor: choose names based on sibling structure + +Each name passed to `super(...)` becomes a distinct `DD_TRACE__ENABLED` flag. Choose the number of names based on whether version-specific siblings exist (or are imminent): + +**Single module, no version siblings, no imminent sibling planned** — pass ONE name: + +```java +// CORRECT — single-module framework (freemarker lives in freemarker-2.3.9/ +// and freemarker-2.3.24/ sibling directories yet still passes ONE name because +// the two directories share the same integration name) +public DollarVariableInstrumentation() { + super("freemarker"); +} +``` + +Adding a version alias here mints a `DD_TRACE___ENABLED` flag that has no counterpart to gate against; it doubles the config surface for no operator benefit. Empirically, single-name-only frameworks in dd-trace-java include `freemarker` (across `freemarker-2.3.9/` and `freemarker-2.3.24/`), `liberty` (across `liberty-20.0/` and `liberty-23.0/`), and most other framework directories with a single integration name. + +**Counter-example — `sparkjava`:** the `sparkjava-2.3/` module uses `super("sparkjava", "sparkjava-2.4")` (note the `-2.4`, not `-2.3`) because the module compiles against Spark 2.3 but tests against 2.4 (Spark's `JettyHandler` is available from 2.4). The versioned alias here reflects the version the code EXERCISES, not the compile-time minimum. This is intentional; do NOT invent a `-2.3` alias just because the directory is named `sparkjava-2.3/`. If in doubt, read the master `super(...)` and copy it verbatim. + +**Multiple version siblings exist** (`okhttp-2.0/` AND `okhttp-3.0/`, `jedis-1.4/` AND `jedis-3.0/` AND `jedis-4.0/`) — pass a shared group name PLUS a version-qualified alias so each version has an independent toggle sharing one group flag: + +```java +// CORRECT — okhttp has real siblings (okhttp-2.0 and okhttp-3.0) +public OkHttp3Instrumentation() { + super("okhttp", "okhttp-3"); +} +``` + +Users can then set `DD_TRACE_OKHTTP_ENABLED=false` (group off) OR `DD_TRACE_OKHTTP_3_ENABLED=false` (this version only). + +**New module you expect will soon have a sibling** — add the alias upfront and document why in the commit message. If no sibling appears, drop the alias in a follow-up. + +**Existing module** (modifying, refactoring, or splitting): read the existing module's `super(...)` and copy it verbatim. Integration names are public config API — renaming one silently breaks customer `DD_TRACE_*_ENABLED` settings. + +Before choosing, list the `dd-java-agent/instrumentation/$framework/` directory — the contents are the ground truth for whether siblings exist. + +Do NOT add version aliases to the decorator's `instrumentationNames()` — that method is for analytics keys only. + +**When rewriting or refactoring an existing module, preserve every override the master version has.** Not just `super(...)` — also `defaultEnabled()`, `helperClassNames()`, `contextStore()`, `orderPriority()`, `muzzleDirective()`, and any other overridden method. Read the current file on master before writing; carry each override forward verbatim unless there's a documented reason to change it. Silent loss of `defaultEnabled() = false` (or similar opt-in flags) ships an integration with a different default than users expected. + +### Do not create a helper class just for CallDepthThreadLocalMap when only one type is instrumented + +When only one type is being instrumented, use `CallDepthThreadLocalMap` directly in the Advice class. A separate helper class that just wraps `CallDepthThreadLocalMap.incrementCallDepth` / `decrementCallDepth` adds indirection without value: + +```java +// WRONG — pointless wrapper when only one type is instrumented +public class GsonHelper { + public static boolean shouldSkip() { + return CallDepthThreadLocalMap.incrementCallDepth(GsonHelper.class) > 0; + } + public static void reset() { + CallDepthThreadLocalMap.reset(GsonHelper.class); + } +} + +// CORRECT — use a target library class as key (instrumentation/module classes are not +// helper-injected and must not appear as literals in inlined advice) +if (CallDepthThreadLocalMap.incrementCallDepth(Gson.class) > 0) return; +// ... in exit: +CallDepthThreadLocalMap.reset(Gson.class); +``` + +A helper class is appropriate when multiple instrumentation classes share the same depth counter — use the shared sentinel class as the key in that case. + +## Advanced: Grouping multiple instrumentations under one module + +For complex frameworks with multiple version-specific or feature-specific instrumentations, you can group them under a single `InstrumenterModule` (file ending in `Module.java`). The module class: + +- Must extend a `TargetSystem` subclass and have `@AutoService(InstrumenterModule.class)` +- Must implement `typeInstrumentations()` returning a `List` +- Must **not** implement an `Instrumenter` interface +- Member instrumentations must **not** carry `@AutoService` and must **not** extend `TargetSystem` subclasses + +See `docs/how_instrumentations_work.md` section "Grouping Instrumentations" for details. + +## Enrichment helpers must be declared in `helperClassNames()` + +If your advice delegates to a helper class (e.g. `SparkJavaRouteEnricher.enrich(...)` from inside `RoutesAdvice`), the helper's fully-qualified class name MUST be listed in `helperClassNames()` on the `InstrumenterModule` — unless the helper is supplied on the boot-class-path (e.g. from `agent-bootstrap`), in which case it is already available without injection: + +```java +@Override +public String[] helperClassNames() { + return new String[] { + packageName + ".SparkJavaRouteEnricher", + }; +} +``` + +Without this, the helper class is not loaded into the target application's classloader at instrumentation time, and the advice will `NoClassDefFoundError` at runtime. This is checked by muzzle; a missing helper reference is a common failure mode when refactoring advice. diff --git a/.agents/skills/apm-integrations/references/muzzle.md b/.agents/skills/apm-integrations/references/muzzle.md new file mode 100644 index 00000000000..e1f281630cd --- /dev/null +++ b/.agents/skills/apm-integrations/references/muzzle.md @@ -0,0 +1,174 @@ +# Muzzle Directives + +> Referenced from `SKILL.md` Step 9.2. Everything about `muzzle { pass { … } fail { … } }` blocks and the traps that fail CI. + +## Muzzle directives (mandatory) + +In `build.gradle`, add `muzzle` blocks. **There are three valid patterns** — choose based on whether your version range is open-ended or bounded, and if bounded, why. + +**Pattern A — Open-ended range** (your instrumentation supports `[minVersion, ∞)` with no upper bound). Use `assertInverse = true` — the plugin auto-asserts that versions below `minVersion` fail muzzle: + +```groovy +muzzle { + pass { + group = "com.example" + module = "framework" + versions = "[$minVersion,)" + assertInverse = true + } +} +``` + +**Pattern B — Bounded range, sibling module takes over at `maxVersion`** (a separate module in `dd-java-agent/instrumentation/` covers `[maxVersion, ∞)`). **Do NOT use `assertInverse = true`** — the plugin can pick sibling-covered versions as inverse-test targets, causing unexpected failures: + +``` +> Task :muzzle-AssertFail-redis.clients-jedis-jedis-3.6.2 FAILED +MUZZLE PASSED JedisInstrumentation BUT FAILURE WAS EXPECTED +``` + +To avoid this, declare the pass range AND an explicit fail range below `$minVersion` (the sibling module covers versions above `$maxVersion`): + +```groovy +muzzle { + pass { + group = "com.example" + module = "framework" + versions = "[$minVersion,$maxVersion)" + } + fail { + group = "com.example" + module = "framework" + versions = "[,$minVersion)" + } +} +``` + +**Pattern C — Bounded range, incompatible major version above `maxVersion`** (the same `group:module` coordinates republish a completely different API at `maxVersion`). Use `assertInverse = true` — versions above `maxVersion` genuinely fail muzzle because the API is incompatible: + +```groovy +muzzle { + pass { + group = "commons-httpclient" + module = "commons-httpclient" + versions = "[2.0,4.0)" + assertInverse = true + } +} +``` + +## Test dependencies should default to the module's declared minimum version + +**Default:** the base `testImplementation` dep version in `build.gradle` should match the module's declared minimum version (from the module directory suffix and the muzzle `versions = "[X.Y,)"` range). Pinning `testImplementation` to a newer version than the module claims to support silently exercises a version the module wasn't declared to work with, and `muzzle` won't catch it because muzzle checks classpath compatibility, not test behavior. + +```groovy +// WRONG — module is jedis-3.0 (min = 3.0.0) but tests run against 4.0 with no justification +muzzle { + pass { group = "redis.clients"; module = "jedis"; versions = "[3.0,)" } +} +dependencies { + testImplementation("redis.clients:jedis:4.0.0") // ← breaks the min-version guarantee +} + +// DEFAULT — testImplementation at the declared min; latestDepTestImplementation for the newest +dependencies { + testImplementation("redis.clients:jedis:3.0.0") + latestDepTestImplementation("redis.clients:jedis:+") +} +``` + +**Justified deviation:** a module may `compileOnly` against the declared minimum and `testImplementation` against a higher version when the test genuinely requires a class/API that only exists in the higher version. In that case: + +- Document the reason with a comment at the top of `build.gradle` (a reviewer must be able to see why immediately) +- The `super(...)` alias should reflect the version the code exercises, not the compile-time minimum + +Example — `dd-java-agent/instrumentation/spark/sparkjava-2.3/build.gradle`: + +```groovy +// building against 2.3 and testing against 2.4 because JettyHandler is available since 2.4 only +dependencies { + compileOnly group: 'com.sparkjava', name: 'spark-core', version: '2.3' + testImplementation group: 'com.sparkjava', name: 'spark-core', version: '2.4' +} +``` + +Without a written justification, prefer the default (test-at-min). This is a stricter form of the `latestDep` range rule (see Step 9.3 of the main SKILL.md) — it applies to the *base* test dependency too, not just latestDep. + +## Do NOT use `assertInverse = true` unless the declared min is the actual minimum compatible version + +The `assertInverse = true` directive tells muzzle to auto-test versions below the declared minimum and assert they fail. If your instrumentation is actually compatible with versions below the declared minimum (a common case when only ONE of several instrumentation classes requires the new feature), this auto-assertion will fail with: + +``` +> Task :module:muzzle-AssertFail-group-module-X.Y.Z FAILED +MUZZLE PASSED FeignClientInstrumentation BUT FAILURE WAS EXPECTED +``` + +**Rule**: If you can't verify (via running `./gradlew muzzle` against a sweep of older versions) that the declared min version is truly the minimum compatible version, **omit `assertInverse = true`**: + +```groovy +// Conservative — passes muzzle without asserting unprovable inverse claims +muzzle { + pass { + group = "io.github.openfeign" + module = "feign-core" + versions = "[10.8,)" + // NO assertInverse here — we don't know the true minimum + } +} +``` + +Add `assertInverse = true` only when you've empirically verified the min via local muzzle sweep. Otherwise, leaving it off is correct. + +This is common whenever any instrumentation class in the module is compatible with versions below the declared min — `assertInverse` then contradicts that class's compatibility. + +## Muzzle range must exclude incompatible major versions + +If the library you are instrumenting has a major version break where a newer major version +is published under the **same** `group:module` coordinates but with a completely different API, +your muzzle `pass` range must have an explicit upper bound to exclude the incompatible major: + +```groovy +// WRONG — open range accidentally covers 4.x (different API, same coordinates) +muzzle { + pass { + group = "com.example" + module = "framework" + versions = "[2.0,)" // 4.x would also match but has completely different API + assertInverse = true + } +} + +// CORRECT — bounded range excludes 4.x +muzzle { + pass { + group = "com.example" + module = "framework" + versions = "[2.0,4.0)" + assertInverse = true + } +} +``` + +**How to check**: search Maven Central for the `group:module` coordinates and look for versions +that are clearly a different generation (major API rewrites). Look at the existing dd-trace-java +module for the same library to see how it bounds its range. + +## Library-specific muzzle quirks: skipVersions + +Some libraries have **malformed release versions** in Maven Central (e.g., a version literally named `jedis-3.6.2` with a `jedis-` prefix). These break the muzzle plugin's version-resolution algorithm — the task name becomes `muzzle-AssertFail-redis.clients-jedis-jedis-3.6.2` (doubled "jedis") and the muzzle plan can include them in the wrong directive. + +The fix is `skipVersions` in the affected directive: + +```groovy +muzzle { + fail { + group = "redis.clients" + module = "jedis" + versions = "[,3.0.0)" + skipVersions += "jedis-3.6.2" // bad release version ("jedis-" prefix) + } +} +``` + +**How to discover these**: when verify fails with a task name that has a doubled module name (e.g., `redis.clients-jedis-jedis-3.6.2`), check the existing production module for the same library at another version. If it has `skipVersions` entries, copy them. This is library-specific tribal knowledge that lives in the existing modules. + +When in doubt, **search adjacent module build.gradle files for `skipVersions`** before declaring a new version-bounded module's muzzle directives. diff --git a/.agents/skills/apm-integrations/references/naming-conventions.md b/.agents/skills/apm-integrations/references/naming-conventions.md new file mode 100644 index 00000000000..ef089b9c147 --- /dev/null +++ b/.agents/skills/apm-integrations/references/naming-conventions.md @@ -0,0 +1,27 @@ +# Naming Conventions + +> Referenced from `SKILL.md` Step 4 (module directory name and Java class/file naming). + +## Module directory name must end with a version OR an allowed suffix + +dd-trace-java's `dd-gitlab/check-instrumentation-naming` plugin +(`buildSrc/.../naming/InstrumentationNamingPlugin.kt`) enforces: + +> Module name must end with a version (e.g., `2.0`, `3.1`) OR one of: `-common`, `-stubs`, `-iast` + +Pick a directory name like `$framework-$minVersion` (e.g. `okhttp-3.0`, `jedis-3.0`). For shared +helpers/stubs/iast support code factored out across version-specific modules, use the documented +suffixes above. + +## Java naming consistency (CRITICAL — non-negotiable) + +The filename and the declared `public class` name MUST match exactly, character-for-character including case. Java will not compile a file where they differ. + +**Pick one canonical name per class, then use that exact string everywhere:** + +- The filename (e.g., `JMSDecorator.java`) +- The class declaration inside (e.g., `public class JMSDecorator`) +- Every `import static ..` across all other files in the module +- Every reference in the form `.` or `.class` + +**Convention in dd-trace-java**: acronym casing is NOT uniform across the codebase. Some libraries use uppercase acronyms (`JMSDecorator`, `JDBCDecorator`) and others use title case (`GrpcClientDecorator`, `HttpServletDecorator`). **When in doubt, match a reference instrumentation's casing exactly** (see Step 3) — do not invent a casing convention. diff --git a/.agents/skills/apm-integrations/references/supported-configurations.md b/.agents/skills/apm-integrations/references/supported-configurations.md new file mode 100644 index 00000000000..e5a856716a1 --- /dev/null +++ b/.agents/skills/apm-integrations/references/supported-configurations.md @@ -0,0 +1,66 @@ +# Supported Configurations Registry + +> Referenced from `SKILL.md` Steps 4, 6, and 9.1. How to register integration names in `metadata/supported-configurations.json` so CI linters pass. + +## Two distinct CI checks — different names, different key shapes + +- **`super(...)` args in `InstrumenterModule`** → validated by `dd-gitlab/config-inversion-linter` as `DD_TRACE__ENABLED` entries. Every name passed to the constructor must have a `_ENABLED` entry. +- **`instrumentationNames()` in the decorator** → validated by `checkDecoratorAnalyticsConfigurations` as `DD_TRACE__ANALYTICS_ENABLED` / `DD_TRACE__ANALYTICS_SAMPLE_RATE` entries. + +## `_ENABLED` entry (for each `super(...)` arg) + +For each new integration name `` (uppercase, dashes/dots replaced with underscores — `couchbase-3` → `DD_TRACE_COUCHBASE_3_ENABLED`), add: + +```json +"DD_TRACE__ENABLED": [ + { + "version": "A", + "type": "boolean", + "default": "true", + "aliases": ["DD_TRACE_INTEGRATION__ENABLED", "DD_INTEGRATION__ENABLED"] + } +], +``` + +**Default value:** the `_ENABLED` default mirrors the module's `defaultEnabled()` return value — `"true"` for typical integrations. Set `"default": "false"` only if the module overrides `defaultEnabled()` to return `false` (e.g. OpenTelemetry, Hazelcast, sparkjava). For new integrations this is always `"true"`; when modifying an existing module, verify with: `grep -A2 "defaultEnabled" dd-java-agent/instrumentation/*`. + +## Analytics entries (for each decorator `instrumentationNames()` return value) + +```json +"DD_TRACE__ANALYTICS_ENABLED": [ + { + "version": "A", + "type": "boolean", + "default": "false", + "aliases": ["DD__ANALYTICS_ENABLED"] + } +], +"DD_TRACE__ANALYTICS_SAMPLE_RATE": [ + { + "version": "A", + "type": "decimal", + "default": "1.0", + "aliases": ["DD__ANALYTICS_SAMPLE_RATE"] + } +], +``` + +## Rules + +**Place entries alphabetically** in the JSON file. + +**Type names — match existing conventions**: use `"boolean"`, `"string"`, `"int"`, `"decimal"` (for floating-point — NOT `"double"`). The `dd-gitlab/validate_supported_configurations_v2_local_file` CI job will fail with non-canonical type names. + +The Gradle checks (`checkInstrumenterModuleConfigurations`, `checkDecoratorAnalyticsConfigurations`) validate the JSON automatically — they will fail with a parse error if the file is malformed. + +**How to discover whether entries are missing**: after writing the instrumentation, search `metadata/supported-configurations.json` for each name used in `super(...)` and decorator `instrumentationNames()`. If any is absent, add it. Do not assume master already has it — version-specific integration names (e.g. `sparkjava-2.3` vs `sparkjava-2.4`) are not interchangeable. + +## Populating new entries — common mistakes + +When adding a new tracer configuration to `metadata/supported-configurations.json`: + +- Every new `super(...)` name needs a corresponding `_ENABLED` entry — omitting entries causes `checkInstrumenterModuleConfigurations` to fail. +- Use the registry-canonical `type` field: `boolean` for `_ENABLED`, `decimal` for ratio/rate values (NOT `double`), `int` for counts (NOT `integer`), `string` for enumerations, `array` and `map` where applicable. The `dd-gitlab/validate_supported_configurations_v2_local_file` CI job will fail on non-canonical type names. Consult `metadata/supported-configurations.json` for existing examples of each. +- Every new `_ANALYTICS_SAMPLE_RATE` needs both an `_ANALYTICS_ENABLED` (`boolean`) and an `_ANALYTICS_SAMPLE_RATE` (`decimal`) entry. + +Run `./gradlew checkInstrumenterModuleConfigurations` locally before pushing to catch registration mismatches. diff --git a/.agents/skills/apm-integrations/references/tests.md b/.agents/skills/apm-integrations/references/tests.md new file mode 100644 index 00000000000..2aad929bfe8 --- /dev/null +++ b/.agents/skills/apm-integrations/references/tests.md @@ -0,0 +1,115 @@ +# Writing Tests + +> Referenced from `SKILL.md` Step 9.1 (Instrumentation test). For muzzle directives (Step 9.2), see `muzzle.md` in this directory. + +## 1. Instrumentation test (mandatory) + +**Write Groovy/Spock tests for instrumentation tests** (per `AGENTS.md`: "Only use Groovy / Spock tests for instrumentation and smoke tests"). Full Java instrumentation test support is not yet available. Adding new `.groovy` files to a PR will trigger the `Enforce Groovy Migration` bot — add the `tag: override groovy enforcement` label to bypass it. + +- Groovy/Spock test class in `src/test/groovy/datadog/trace/instrumentation//` +- Verify: spans created, tags set, errors propagated, resource names correct +- Use `assertTraces(N) { trace(N) { span { ... } } }` for span assertions (Spock DSL from `InstrumentationSpecification`) +- Use `TEST_WRITER.waitForTraces(N)` for setup/teardown flushing (not for assertions) +- Use `runUnderTrace("root") { ... }` from `TraceUtils` for synchronous code (trailing Groovy closure) + +**Tests must cover error/exception scenarios, not just the happy path.** At minimum, add a test that exercises an exception or error condition and asserts the span's error tags (`error.type`, `error.message`, `error.stack`) are set correctly: + +```groovy +// Example error test (Groovy/Spock) +def "exception sets error tags"() { + when: + client.execute(badRequest) + + then: + thrown(SomeException) + assertTraces(1) { + trace(1) { + span { + errored true + errorTags(SomeException, "expected error message") + } + } + } +} +``` + +For tests that need a separate JVM, suffix the test class with `ForkedTest` and run via the `forkedTest` task. + +### Register new integration names in `metadata/supported-configurations.json` + +See [Supported Configurations](supported-configurations.md) for the key shapes, CI checks, and JSON format. + +### compileOnly and testImplementation may use different versions — explain why + +When `compileOnly` and `testImplementation` use different versions of the same library, add a +comment that explains the specific API or class that requires the higher version, and why. +Do not just state the fact — state the reason. + +```groovy +// WRONG — states the fact without explaining why +// compileOnly=2.3, testImplementation=2.4 +compileOnly group: 'com.sparkjava', name: 'spark-core', version: '2.3' +testImplementation group: 'com.sparkjava', name: 'spark-core', version: '2.4' + +// CORRECT — explains the specific class and why it requires the higher version +// compileOnly=2.3 (module targets this version) but testImplementation=2.4: +// JettyHandler, which Spark uses internally to dispatch HTTP requests to route handlers, +// is not accessible as a public class in 2.3 — it was exposed starting in 2.4. +// The instrumentation hooks into JettyHandler via Jetty's existing instrumentation, +// so tests require 2.4 at minimum to exercise the code path. +compileOnly group: 'com.sparkjava', name: 'spark-core', version: '2.3' +testImplementation group: 'com.sparkjava', name: 'spark-core', version: '2.4' +``` + +**How to discover this during development**: install the library at the `compileOnly` version and run +your instrumentation test. If a specific class raises `ClassNotFoundException` or is inaccessible, that +class is the reason — check when it became public and use that version for `testImplementation`. +Name the class in the comment. + +### Include sibling version modules in testImplementation for mutual exclusion + +When two modules instrument the same library at non-overlapping version ranges, each module should include the other as a `testImplementation` dependency to confirm they don't double-instrument. The rule is symmetric — both the older and the newer module should carry this dependency: + +```groovy +// jedis-3.0/build.gradle +dependencies { + testImplementation project(':dd-java-agent:instrumentation:jedis:jedis-1.4') +} + +// jedis-1.4/build.gradle +dependencies { + testImplementation project(':dd-java-agent:instrumentation:jedis:jedis-3.0') +} +``` + +This ensures `:test` in each module validates that only the correct module fires for its version range. + +## Test hygiene + +### No `Thread.sleep()` in tests — use deterministic waits + +`Thread.sleep(...)` is a recipe for flake. Use a deterministic mechanism instead: + +- `TEST_WRITER.waitForTraces(N)` — waits until at least N traces have been recorded (`traceCount >= N`), with a bounded timeout of 20s (see `dd-trace-core/src/main/java/datadog/trace/common/writer/ListWriter.java`). Use `TEST_WRITER.size()` afterwards to assert the exact count you expect. +- `CountDownLatch` / `CompletableFuture.get(timeout, TimeUnit)` — for signalling from async callbacks +- Spock's `PollingConditions` — for polling an assertion until it holds + +If you catch yourself writing `Thread.sleep(...)`, name the specific signal you're waiting for and wait on that signal directly. + +### Embedded servers use a static field — do not recreate per test + +For tests that start an embedded server (Jetty, Netty, Undertow, Spark, etc.), initialize the server once as a `@Shared` or `static` field and reuse it across test methods. Do NOT construct a new server in each `setup:` / `@Before` unless you have a concrete reason (e.g. per-test configuration). Recreating the server per test multiplies test wall-time and adds a startup-race surface for no benefit. Follow the pattern of existing server-instrumentation tests in the same framework family. + +### Factor shared test scaffolding into a base class + +If two sibling test classes (e.g. `FooTest` and `FooForkedTest`) need the same setup, request builder, or assertion helpers, extract them into a shared abstract base — do NOT copy-paste between the two files. Duplicated helper code across a handful of test classes is how bespoke JUnit scaffolding metastasizes across the codebase. + +### `ForkedTest` variants must have a concrete isolation reason + +The `ForkedTest` suffix runs a test in its own JVM via the `forkedTest` task. Only add a `ForkedTest` variant when the test genuinely needs JVM isolation — e.g. a system property that must be set before class-loading, an agent-level configuration that cannot be reset between tests, or a class-loader state that leaks. Do NOT mechanically add a `ForkedTest` alongside every `Test` class; each fork adds JVM startup cost to CI. + +State the isolation reason in a comment on the `ForkedTest` class. + +### Do not add default jvmArgs to test tasks + +`dd.trace.enabled=true` is the default; adding `jvmArgs '-Ddd.trace.enabled=true'` to a `Test` task in `build.gradle` is noise. Only add jvmArgs that meaningfully diverge from defaults (e.g. enabling a specific integration that's off by default, or a debug flag). If you're tempted to copy a `jvmArgs` block from a sibling module, check whether each flag is actually needed for this module. diff --git a/.agents/skills/migrate-groovy-to-java/QUALITY_RULES.md b/.agents/skills/migrate-groovy-to-java/QUALITY_RULES.md new file mode 100644 index 00000000000..0f5aefa8cb9 --- /dev/null +++ b/.agents/skills/migrate-groovy-to-java/QUALITY_RULES.md @@ -0,0 +1,479 @@ +# Groovy-to-Java Migration Quality Rules + +Rules extracted from post-migration cleanup. Apply during initial generation and use as a review checklist. + +## Severity levels + +- **BLOCKER** — wrong semantics; test may pass by luck but is objectively incorrect. Always fix. +- **WARNING** — correctness risk or missed guarantee. Fix unless a utility class does not yet exist. +- **STYLE** — convention, readability, project standard. Fix where it improves clarity without added complexity. + +BLOCKER rules include a grep pattern for mechanical detection. + +--- + +## Category A: Imports & Static Imports + +### RULE-A01: Static-import constants used 2+ times +- **Severity**: STYLE +- **Detection**: `ClassName.CONSTANT` repeated in the same file +- **Before**: + ```java + import datadog.trace.api.sampling.PrioritySampling; + ... + protected int priority = PrioritySampling.SAMPLER_KEEP; + // ... + assertEquals(PrioritySampling.UNSET, result); + ``` +- **After**: + ```java + import static datadog.trace.api.sampling.PrioritySampling.SAMPLER_KEEP; + import static datadog.trace.api.sampling.PrioritySampling.UNSET; + ... + protected int priority = SAMPLER_KEEP; + // ... + assertEquals(UNSET, result); + ``` +- **Notes**: Apply when the same `ClassName.MEMBER` appears 2 or more times. Single-use qualified references are fine. + +--- + +### RULE-A02: Use named constants for @WithConfig keys +- **Severity**: WARNING +- **Detection**: `@WithConfig(key = "` with a literal string +- **Before**: + ```java + @WithConfig(key = "propagation.extract.log_header_names.enabled", value = "true") + ``` +- **After**: + ```java + import static datadog.trace.api.config.TracerConfig.PROPAGATION_EXTRACT_LOG_HEADER_NAMES_ENABLED; + ... + @WithConfig(key = PROPAGATION_EXTRACT_LOG_HEADER_NAMES_ENABLED, value = "true") + ``` +- **Notes**: Config key constants live in `datadog.trace.api.config.*`. Grep the constants classes for the matching field. + +--- + +## Category B: Collection Simplification + +### RULE-B01: Prefer HashMap over LinkedHashMap in tests +- **Severity**: STYLE +- **Detection**: `new LinkedHashMap<>()` in test files +- **Before**: + ```java + Map headers = new LinkedHashMap<>(); + headers.put("x-trace-id", traceIdHex); + headers.put("x-span-id", spanIdHex); + ``` +- **After**: + ```java + Map headers = new HashMap<>(); + headers.put("x-trace-id", traceIdHex); + headers.put("x-span-id", spanIdHex); + ``` +- **Notes**: Groovy's `[k: v]` literal uses `LinkedHashMap` but tests rarely need insertion-order guarantees. Use `LinkedHashMap` only when order is explicitly tested. + +--- + +### RULE-B02: Use headers() helper for multi-entry header maps +- **Severity**: STYLE +- **Detection**: `new HashMap<>()` followed by 2+ `.put()` calls in test code (HTTP codec tests) +- **Before**: + ```java + Map headers = new HashMap<>(); + headers.put(TRACE_ID_KEY.toUpperCase(), traceIdHex); + headers.put(SPAN_ID_KEY.toUpperCase(), spanIdHex); + headers.put(SAMPLING_PRIORITY_KEY, samplingPriority.toString()); + ``` +- **After**: + ```java + // spotless:off + Map headers = headers( + TRACE_ID_KEY, traceIdHex, + SPAN_ID_KEY, spanIdHex, + SAMPLING_PRIORITY_KEY, samplingPriority.toString()); + // spotless:on + ``` +- **Notes**: The `headers()` helper from `HttpCodecTestHelper` uppercases keys automatically. Remove manual `.toUpperCase()` calls. Pass `null` values to skip that entry. Only applicable when `HttpCodecTestHelper` is already in scope. + +--- + +### RULE-B03: Use headers() instead of singletonMap +- **Severity**: STYLE +- **Detection**: `Collections.singletonMap(` or `singletonMap(` in test files +- **Before**: + ```java + Map tagOnlyCtx = singletonMap("Forwarded", forwarded); + ``` +- **After**: + ```java + Map tagOnlyCtx = headers("Forwarded", forwarded); + ``` +- **Notes**: Only when `HttpCodecTestHelper.headers()` is already used in the class. Otherwise `singletonMap` is fine. + +--- + +## Category C: Assertion Modernization + +### RULE-C01: Use assertInstanceOf instead of assertTrue + instanceof +- **Severity**: BLOCKER +- **Detection**: `assertTrue\(.*instanceof` +- **Before**: + ```java + assertTrue(context instanceof ExtractedContext); + ``` +- **After**: + ```java + assertInstanceOf(ExtractedContext.class, context); + ``` +- **Notes**: `assertInstanceOf` reports the actual type on failure; `assertTrue` only says "expected: true but was: false". Import: `org.junit.jupiter.api.Assertions.assertInstanceOf`. + +--- + +### RULE-C02: Split compound instanceof-null assertions +- **Severity**: BLOCKER +- **Detection**: `assertTrue\(.*==\s*null.*instanceof` +- **Before**: + ```java + assertTrue(context == null || !(context instanceof ExtractedContext)); + ``` +- **After**: + ```java + // If null is the expected outcome: + assertNull(context); + // If "not an ExtractedContext" is the intent: + assertFalse(context instanceof ExtractedContext); + // Or with a specific expected type: + assertInstanceOf(TagContext.class, context); + ``` +- **Notes**: Compound boolean assertions hide which condition actually fired. Split so JUnit reports the exact failure. Read the Groovy original to determine the intent. + +--- + +### RULE-C03: Add size assertion after map content assertions +- **Severity**: WARNING +- **Detection**: structural — file has 2+ `assertEquals(expected, carrier.get(` or `assertEquals(expected, map.get(` with no `assertEquals(N, *.size())` +- **Before**: + ```java + assertEquals("1", carrier.get("x-datadog-trace-id")); + assertEquals("2", carrier.get("x-datadog-span-id")); + ``` +- **After**: + ```java + assertEquals("1", carrier.get("x-datadog-trace-id")); + assertEquals("2", carrier.get("x-datadog-span-id")); + assertEquals(2, carrier.size()); + ``` +- **Notes**: Without a size check, injecting extra headers silently passes. Add at the end of each assertion block. + +--- + +### RULE-C04: Use typed tag getters +- **Severity**: WARNING +- **Detection**: `\.getTags\(\)\.get\(` +- **Before**: + ```java + assertEquals("value", context.getTags().get(B3_TRACE_ID)); + ``` +- **After**: + ```java + assertEquals("value", context.getTags().getString(B3_TRACE_ID)); + ``` +- **Notes**: `getString()`, `getBoolean()`, `getLong()` avoid unsafe casts and produce better failure messages. + +--- + +### RULE-C05: Preserve the original assertion's specificity — never relax to a matcher +- **Severity**: BLOCKER +- **Detection**: `any\(\)`, `anyInt\(\)`, `anyLong\(\)`, `anyString\(\)`, `anyByte\(\)`, `anyBoolean\(\)`, `atLeastOnce\(\)` — flag any that stand in for a literal value or exact cardinality the Groovy original pinned. Verify context (see Notes). +- **Before**: + ```java + // Groovy original: 1 * carrier.put(TRACE_ID_KEY, traceId) + verify(carrier, atLeastOnce()).put(eq(TRACE_ID_KEY), anyString()); + ``` +- **After**: + ```java + verify(carrier).put(TRACE_ID_KEY, traceId); + // or, when the mock is replaced by a real carrier (RULE-D01): + assertEquals(traceId, carrier.get(TRACE_ID_KEY)); + ``` +- **Notes**: This is the highest-risk migration error: a relaxed assertion still compiles and passes, so the regression is invisible. A Spock interaction `N * mock.method(value)` pins **both** the cardinality and the exact argument. Port `1 * mock.m(v)` to `verify(mock).m(v)` (or `verify(mock, times(N)).m(v)` for `N *`), never `verify(mock, atLeastOnce()).m(any())`. Likewise never weaken a concrete `assertEquals(expected, actual)` into `assertTrue(actual != null)` or similar. The only legitimate matcher is a value that is genuinely non-deterministic at assertion time (e.g. a timestamp-derived id) — and even then prefer `assertNotNull(captured)` over `any()`. Cross-check every matcher against the Groovy original before accepting it. + +--- + +## Category D: Mock Elimination + +### RULE-D01: Replace Map mock + verify with concrete HashMap +- **Severity**: WARNING +- **Detection**: `mock\(.*Map.*\.class\)` +- **Before**: + ```java + Map carrier = mock(Map.class); + injector.inject(context, carrier, setter); + verify(carrier).put("x-datadog-trace-id", "1"); + verify(carrier).put("x-datadog-span-id", "2"); + ``` +- **After**: + ```java + Map carrier = new HashMap<>(); + injector.inject(context, carrier, setter); + assertEquals("1", carrier.get("x-datadog-trace-id")); + assertEquals("2", carrier.get("x-datadog-span-id")); + assertEquals(2, carrier.size()); // RULE-C03 + ``` +- **Notes**: Mocking a Map tests the mock interactions, not the actual injected data. Use a real `HashMap`. Remove Mockito imports if no other mocks remain. + +--- + +## Category E: Test Structure + +### RULE-E01: Flatten lazy initialization into @BeforeEach +- **Severity**: STYLE +- **Detection**: structural — private field set to null + private method that checks null and initializes it +- **Before**: + ```java + private HttpCodec.Extractor lazyExtractor; + + private HttpCodec.Extractor extractor() { + if (lazyExtractor == null) { + lazyExtractor = W3CHttpCodec.newExtractor(config); + } + return lazyExtractor; + } + ``` +- **After**: + ```java + private HttpCodec.Extractor extractor; + + @BeforeEach + void setup() { + this.extractor = W3CHttpCodec.newExtractor(config); + } + ``` +- **Notes**: `@BeforeEach` is clearer and avoids the risk of stale state across tests if lazy init is skipped. + +--- + +### RULE-E02: Replace abstract-class + single-boolean-override with concrete class + constant +- **Severity**: STYLE +- **Detection**: structural — abstract class whose subclasses only override one method returning a boolean +- **Before**: + ```java + abstract class B3HttpInjectorTest { + protected abstract boolean tracePropagationB3Padding(); + } + static class B3HttpInjectorPaddedTest extends B3HttpInjectorTest { + @Override + protected boolean tracePropagationB3Padding() { return true; } + } + ``` +- **After**: + ```java + class B3HttpInjectorTest { + protected boolean tracePropagationB3Padding() { + return DEFAULT_PROPAGATION_B3_PADDING_ENABLED; + } + } + ``` +- **Notes**: The subclass that only flips a boolean adds noise. Use the config default as the base value. When the non-default variant matters, use `@WithConfig` on that test method. + +--- + +### RULE-E03: Extract repeated helper methods to a utility class +- **Severity**: STYLE +- **Detection**: structural — same private helper method body appears in 2+ test files +- **Notes**: Create a `*TestHelper.java` in the same test package. Make methods `static`. Add overloads for common input types (`long`, `String`, `DDTraceId`) rather than casting at call sites. + +--- + +## Category F: Type Correctness + +### RULE-F01: Use byte for sampling priority and mechanism +- **Severity**: BLOCKER +- **Detection**: three separate greps (do not merge — `\b` plus `|` alternation misbehaves on some grep builds): `\bint\b.*[Ss]ampling[Pp]riority`, then `\bint\b.*\bpriority\b`, then `\bint\b.*\bmechanism\b` +- **Before**: + ```java + int expectedSamplingPriority = PrioritySampling.SAMPLER_KEEP; + int mechanism = SamplingMechanism.DEFAULT; + ``` +- **After**: + ```java + byte expectedSamplingPriority = PrioritySampling.SAMPLER_KEEP; + byte mechanism = SamplingMechanism.DEFAULT; + ``` +- **Notes**: `PrioritySampling` and `SamplingMechanism` constants are `byte`. Using `int` silently widens/narrows and can mask sign-extension bugs on comparisons. + Apply **only** when the value is assigned from, or compared against, a `PrioritySampling.*`/`SamplingMechanism.*` constant — a plain `int` counter, loop index, or unrelated field that happens to contain the word "priority"/"mechanism" is a false positive. + The detection pattern is broad; verify context before changing (and before auto-fixing, since `int` → `byte` can break compilation). + +--- + +## Category G: Code Style + +### RULE-G01: Remove inline parameter-name comments +- **Severity**: STYLE +- **Detection**: `/\* [a-z]` +- **Before**: + ```java + OrgGuardEnforcer.enforce(/* origin */ null, /* httpHeaders */ null); + ``` +- **After**: + ```java + OrgGuardEnforcer.enforce(null, null); + ``` +- **Notes**: AI-generated artifact. These drift silently when parameters are renamed or reordered. Remove unconditionally. + +--- + +### RULE-G02: Use method references for zero-arg lambdas +- **Severity**: STYLE +- **Detection**: `\(\) -> [a-zA-Z]+\.[a-zA-Z]+\(\)` +- **Before**: + ```java + scheduler.schedule(() -> dynamicConfig.captureTraceConfig(), 1, TimeUnit.SECONDS); + ``` +- **After**: + ```java + scheduler.schedule(dynamicConfig::captureTraceConfig, 1, TimeUnit.SECONDS); + ``` +- **Notes**: Apply only when the lambda body is a single no-arg method call with no surrounding logic. + +--- + +### RULE-G04: Trim trailing whitespace padding in @TableTest tables +- **Severity**: STYLE +- **Detection**: `".*\s\s+\|` or trailing spaces before closing `"` in `@TableTest` strings +- **Notes**: Trailing spaces added by formatters or LLMs for alignment serve no purpose and cause noisy diffs. Each cell value should be trimmed to its natural width; column alignment should come from the `|` delimiters only. + +--- + +### RULE-G05: Use try-with-resources instead of close() in a finally block +- **Severity**: STYLE +- **Detection**: `\} finally \{` whose block body is a single `.close()` call. Verify context (see Notes). +- **Before**: + ```java + AnnotationConfigApplicationContext context = + new AnnotationConfigApplicationContext(IntervalTaskConfig.class, SchedulingConfig.class); + try { + IntervalTask task = context.getBean(IntervalTask.class); + task.blockUntilExecute(); + assertScheduledTraces("IntervalTask.run"); + } finally { + context.close(); + } + ``` +- **After**: + ```java + try (AnnotationConfigApplicationContext context = + new AnnotationConfigApplicationContext(IntervalTaskConfig.class, SchedulingConfig.class)) { + IntervalTask task = context.getBean(IntervalTask.class); + task.blockUntilExecute(); + assertScheduledTraces("IntervalTask.run"); + } + ``` +- **Notes**: Spock's `cleanup:` block is commonly ported to `try { ... } finally { resource.close(); }`. When the resource type is `Closeable`/`AutoCloseable` and the `finally` only closes it, use try-with-resources — it is shorter, scopes the resource to the block, and reports `close()` failures as suppressed exceptions. **Only when `close()` is the finally's sole statement and there is no surrounding logic.** Do not convert when the resource must be closed at a specific earlier point (e.g. `SpringSchedulingTest.scheduleTriggerTestAccordingToCronExpression` closes the context mid-test to stop further scheduled traces before asserting), nor when the `finally` does more than close (e.g. `reset()` plus buffer bookkeeping). + +--- + +## Category H: @TableTest Data Quality + +### RULE-H01: Replace magic trace ID strings with symbolic names +- **Severity**: WARNING +- **Detection**: `'18446744073709551[0-9]+'` in `@TableTest` strings +- **Before**: + ```java + @TableTest({ + "scenario | traceId ", + "uint64 max | '18446744073709551615' ", + "uint64 max-1 | '18446744073709551614' " + }) + void extractHeaders(@ConvertWith(TraceIdConverter.class) String traceId) { ... } + ``` +- **After**: + ```java + @TableTest({ + "scenario | traceId ", + "uint64 max | 'TRACE_ID_MAX' ", + "uint64 max-1 | 'TRACE_ID_MAX-1'" + }) + void extractHeaders(@ConvertWith(TraceIdConverter.class) String traceId) { ... } + ``` +- **Notes**: `TraceIdConverter` (in `datadog.trace.junit.utils.tabletest`) resolves `TRACE_ID_MAX`, `TRACE_ID_MAX-1`, and `TRACE_ID_MAX+1`. Add `@ConvertWith(TraceIdConverter.class)` to the parameter. + +--- + +### RULE-H02: Use unqualified enum names in table strings with a TypeConvertor +- **Severity**: STYLE +- **Detection**: structural — `@TableTest` rows containing `ClassName.CONSTANT` strings where a `TypeConvertor` for that class exists +- **Before**: + ```java + "no priority | PrioritySampling.UNSET ", + "keep | PrioritySampling.SAMPLER_KEEP ", + ``` +- **After**: + ```java + "no priority | UNSET ", + "keep | SAMPLER_KEEP", + ``` +- **Notes**: Requires a `TypeConvertor` (e.g., `PrioritySamplingConverter`) registered or passed via `@ConvertWith`. Check whether the converter already exists before applying. + +--- + +## Category I: Visibility & Annotations + +### RULE-I01: Annotate production constants exposed for tests +- **Severity**: STYLE +- **Detection**: structural — production class constant changed from `private` to `public` or package-private without annotation +- **Before**: + ```java + // In production class + private static final int MAX_MEMBER_COUNT = 32; + ``` +- **After**: + ```java + // In production class + @VisibleForTesting + public static final int MAX_MEMBER_COUNT = 32; + ``` +- **Notes**: Import: `datadog.trace.api.internal.VisibleForTesting`. Do not apply to constants that are genuinely public API. + +--- + +### RULE-I02: Remove unnecessary private modifier from test constants +- **Severity**: STYLE +- **Detection**: `private static final` in test files where the constant is used in other test files in the same package +- **Before**: + ```java + private static final String B3_TRACE_ID = "b3.traceid"; + ``` +- **After**: + ```java + static final String B3_TRACE_ID = "b3.traceid"; + ``` +- **Notes**: Package-private visibility is sufficient for test-internal sharing. Only upgrade to `public` if the constant is needed across packages. + +--- + +## Category J: API Correctness + +### RULE-J02: Use ContextVisitors.stringValuesMap() for Map carriers +- **Severity**: WARNING +- **Detection**: `CarrierVisitor\|forEachKeyValue` +- **Before**: + ```java + private static final CarrierVisitor> VISITOR = + new CarrierVisitor>() { + @Override + public void forEachKeyValue(Map carrier, BiConsumer c) { + carrier.forEach(c); + } + }; + propagator.extract(ctx, headers, VISITOR); + ``` +- **After**: + ```java + import static datadog.trace.bootstrap.instrumentation.api.ContextVisitors.stringValuesMap; + ... + propagator.extract(ctx, headers, stringValuesMap()); + ``` +- **Notes**: `ContextVisitors.stringValuesMap()` is the canonical visitor for `Map`. Check existing usages in `HttpExtractorTest`, `W3CHttpExtractorTest`, `HaystackHttpExtractorTest` for reference. diff --git a/.agents/skills/migrate-groovy-to-java/SKILL.md b/.agents/skills/migrate-groovy-to-java/SKILL.md new file mode 100644 index 00000000000..7c8b4842ef5 --- /dev/null +++ b/.agents/skills/migrate-groovy-to-java/SKILL.md @@ -0,0 +1,72 @@ +--- +name: migrate-groovy-to-java +description: > + Converts Spock/Groovy test files in a Gradle module to equivalent JUnit 5 Java tests. + Use when asked to "migrate groovy", "convert groovy to java", "g2j", or when a module + has .groovy test files that need to be replaced with .java equivalents. +--- + +Migrate test Groovy files to Java using JUnit 5 + +1. List all Groovy files of the current Gradle module +2. Convert Groovy files to Java using JUnit 5 +3. Make sure the tests are still passing after migration and that the test count has not changed +4. Remove Groovy files + +When converting Groovy code to Java code, make sure that: +- The Java code generated is compatible with JDK 8 +- When translating Spock tests, prefer `@TableTest` for data rows that are naturally tabular. See detailed guidance in the "TableTest usage" section. +- `@TableTest` and `@MethodSource` may be combined on the same `@ParameterizedTest` when most cases are tabular but a few cases require programmatic setup. +- In combined mode, keep table-friendly cases in `@TableTest`, and put only non-tabular/complex cases in `@MethodSource`. +- If `@TableTest` is not viable for the test at all, use `@MethodSource` only. +- If `@TableTest` was successfully used and if the `@ParameterizedTest` is not used to specify the test name, `@ParameterizedTest` can then be removed as `@TableTest` replace it fully. +- For `@MethodSource`, name the arguments method `Arguments` (camelCase, e.g. `testMethodArguments`) and return `Stream` using `Stream.of(...)` and `arguments(...)` with static import. +- Ensure parameterized test names are human-readable (i.e. no hashcodes); instead add a description string as the first `Arguments.arguments(...)` value or index the test case +- When converting tuples, create a light dedicated structure instead to keep the typing system +- Instead of checking a state and throwing an exception, use JUnit asserts +- Instead of using `assertTrue(a.equals(b))` or `assertFalse(a.equals(b))`, use `assertEquals(expected, actual)` and `assertNotEquals(unexpected, actual)` +- Import frequently used types rather than using fully-qualified names inline, to improve readability +- Do not wrap checked exceptions and throw a Runtime exception; prefer adding a throws clause at method declaration +- Do not mark local variables `final` +- Ensure variables are human-readable; avoid single-letter names and pre-define variables that are referenced multiple times +- When translating Spock `Mock(...)` usage, use `libs.bundles.mockito` instead of writing manual recording/stub implementations +- Replace `injectSysConfig(key, value)` calls with `@WithConfig` when the key and value are static literals. Put it on the test method for per-test config, or on the class when every test needs it. The `dd.` prefix is added automatically — use the bare key (e.g. `"trace.scope.strict.mode"`, not `"dd.trace.scope.strict.mode"`). For dynamic or parameterized values, keep the imperative `WithConfigExtension.injectSysConfig(key, value)` call. +- Keep inline comments +- Migrate the named Spock clauses if they exist as inline comments in the Java unit test +- When Groovy tests navigate a JSON request body through helpers like `asMap()` / `asLong()` / `asList()`, check whether `json-unit-assertj` (`libs.json.unit.assertj`) is already in the module's build file. If it is, add a method that returns the raw JSON string and use `assertThatJson(json).node("some.nested.field").isEqualTo(value)` directly instead of the map traversal. +- Groovy's `[key: val]` map literals use a `LinkedHashMap`. When the test doesn't care about insertion order, use `singletonMap` for a single entry or `HashMap` for two or more. If a helper method builds these maps, add a two-arg overload rather than scattering `new LinkedHashMap<>()` constructions through test bodies. + +TableTest usage + Import: `import org.tabletest.junit.TableTest;` + + JDK 8 rules: + - No text blocks. + - @TableTest must use String[] annotation array syntax: + ``` + @TableTest({ + "a | b", + "1 | 2" + }) + ``` + + Spock `where:` → @TableTest: + - First row = header (column names = method parameters). + - Add `scenario` column as first column (display name, not a method parameter). + - Use `|` delimiter; align columns so pipes line up vertically. + - Prefer single quotes for strings with special chars (e.g., `'a|b'`, `'[]'`). + - Blank cell = null (object types); `''` = empty string. + - Collections: `[a, b]` = List/array, `{a, b}` = Set, `[k: v]` = Map. + + Mixed eligibility: + - Prefer combining `@TableTest` + `@MethodSource` on one `@ParameterizedTest` when only some cases are complex. + - Use `@MethodSource` only when tabular representation is not practical for the test. + + Do NOT use @TableTest when: + - Majority of rows require complex objects or custom converters. + +## Quality rules (apply during generation) + +Before writing any Java output, read `.claude/skills/migrate-groovy-to-java/QUALITY_RULES.md` in full. +Apply all BLOCKER rules unconditionally. +Apply WARNING rules unless they require creating utility classes that do not yet exist. +Apply STYLE rules where they improve clarity without added complexity. diff --git a/.claude/skills/migrate-junit-source-to-tabletest/SKILL.md b/.agents/skills/migrate-junit-source-to-tabletest/SKILL.md similarity index 100% rename from .claude/skills/migrate-junit-source-to-tabletest/SKILL.md rename to .agents/skills/migrate-junit-source-to-tabletest/SKILL.md diff --git a/.agents/skills/perf-review/SKILL.md b/.agents/skills/perf-review/SKILL.md new file mode 100644 index 00000000000..5102008ac19 --- /dev/null +++ b/.agents/skills/perf-review/SKILL.md @@ -0,0 +1,245 @@ +--- +name: perf-review +description: >- + Performance-overhead review of a code diff / branch / PR for the dd-trace-java + tracer. Flags hot-path allocation, unbounded memory, repeated work, escaping + objects, native-boundary crossings, and JVM-specific pitfalls (escape analysis, + JNI / virtual-thread pinning, backtracking-regex ReDoS, varargs/boxing hashing, + String.format, ByteBuddy-Advice anti-patterns) using the tracer performance + rubric. Use whenever the user wants a performance / overhead / hot-path review, + asks to check a diff or PR for allocation / GC / memory / latency / startup cost, + or mentions the "perf rubric" or the "do no harm / assume hot" tracer posture — + even if they just say "review this for perf" without naming the rubric. Advisory and READ-ONLY: it reports ranked, + verify-first findings; it never edits code. +user-invocable: true +context: fork +allowed-tools: + - Bash + - Read + - Grep + - Glob +--- + +# Performance Review + +Review the current branch's changes for performance overhead in the dd-trace-java +tracer, using the tracer performance rubric bundled in `references/`. This is a +**low-friction advisory nudge**, not a gate: it reports findings and stops. It +never edits code. + +## Why this exists (read first — it sets the whole posture) + +The tracer shares the customer's process, heap, and latency budget. **Do no harm**: +overhead is a form of incorrect behavior that can escalate to real customer harm — +missed SLAs, OOM kills, container restarts, cold-start churn. So the review's job is +to catch overhead the customer would feel, and to do it *without becoming noise*. + +Two forces are in tension, and the resolution defines everything below: + +- **Assume hot.** We don't know what's on a customer's critical path. Absent positive + evidence of cold, assume the code runs on every request, under load, at full + concurrency. The burden of proof runs toward *cold*: ask "is there evidence this is + cold or guarded?" — not "is there evidence this is hot?" (that rationalizes itself + into "probably not"). +- **Precision over recall — be silent when unsure.** A false-positive-prone review + dies of being ignored. Over-flagging kills it faster than under-flagging. This + actively fights your default to be comprehensive and helpful: here, *not* flagging + a borderline case is the correct, skilled move — not a miss. + +You reconcile them with the **confidence axis** and **verify-don't-verdict** (below): +assume-hot makes you *look* everywhere; precision makes you *speak* only when the +mechanism is certain or the severity is catastrophic. + +## Core rules + +- **Findings are prompts to *verify*, not verdicts.** You reason statically; you + cannot render a performance verdict from a code read. Every finding routes into + **Benchmark → Profile → Improve → Guard**. Phrase each as *"this looks like X; + verify with Y"* — never "this is slow." +- **Confidence axis on every finding:** + - **flag-with-confidence** — the cost is *mechanism-determined* and visible in the + code: allocation, boxing, copying, unbounded growth, a native crossing. State it + plainly. + - **flag-as-measure** — the cost depends on JIT/GC/optimizer decisions you can't + see from source: escape elision, inlining/devirtualization, GC impact. Phrase as + "may X; verify with a profiler/benchmark," never as a certainty. +- **Predicate-with-default, not a banned-API list.** Don't flag "you called + `String.format`." Flag *"an eager, unconditional expensive call on a hot, + instrumentation-reachable path."* The same API is fine on a cold path. Two failure + shapes, different fixes: result usually **discarded** → gate/defer; result always + **needed but costly** → cheapen/cache. +- **Resolve interprocedurally — this is the review's whole reason to exist.** A + peephole lint can't answer "reachable from a hot entry, unconditional along the + way." Trace *up* (who calls this? is it reachable from an `@Advice` root / per-span + callback / request handler?) and *down* (follow callbacks, hooks, and listeners to + their **sink** before flagging). If a per-span hook's every reachable sink is an + atomic counter (`LongAdder`, `AtomicLong`) or a no-op-when-disabled, stay silent — a + "verify contention" nudge there is noise. +- **Make the reachability path the headline.** The reachability claim is the most + valuable *and* least reliable part of a finding — residual false positives cluster + in "called it unconditional, missed an upstream guard." Say *"reachable from + `Foo.onEnter` via A→B→C, no guard on that path"* so the reader can check the + shakiest link at a glance. +- **Only flag toward a fix that exists.** A finding must be actionable *now*. Route to + a mechanism that has landed (see the toolkit note in `checks.md` — cite only what + exists; name "coming" primitives as coming). Don't flag a pattern whose only fix is + a mechanism that isn't built yet. +- **Triage by severity.** Flag SEV-1 (unbounded memory / OOM, cardinality blowups) + *aggressively* — a false positive there is cheap insurance against a container kill. + Flag low-severity CPU-micro *conservatively or not at all* — false positives there + only erode trust. +- **Never flag the *absence* of a cache on high-cardinality input.** For open-cardinality + data (raw SQL with literals, per-request strings), *not* caching is the correct + choice — caching it would be the worse SEV-1. Flag a cache *keyed by* high-cardinality + data; never flag the decision not to cache. +- **A *visibly contestable* perf tradeoff shipped without data → one soft flag-as-measure.** + The trigger is narrow: the change makes a **visible tradeoff that could itself regress** — + it removes a lock / guard / synchronization, swaps in a hand-rolled cache or data + structure, or explicitly claims "faster / optimized" — **and** ships no benchmark or + profile. There a static read genuinely can't tell a win from a regression, so raise one + soft *flag-as-measure* nudge: *"this trades ; verify with a JMH benchmark / JFR."* + Do **not** fire it otherwise — if nothing in the diff could plausibly regress, there is + nothing to measure, so stay silent. Specifically not for: a **mechanically-obvious win** + (hoisting an invariant out of a loop, a denser data structure, removing an allocation); + **routine adoption of a known-better idiom** (migrating to a lower-overhead builder / API / + toolkit primitive — no visible downside); or a change that **ships a benchmark/JFR** + (well-evidenced — recognize it). One line; a nudge, not a code-pattern finding. + +## Workflow + +### Step 1 — Get the code to review + +**If the user points you at specific files or pasted code** ("review this class / this +method for perf"), review those directly — skip the diff and go to Step 2 with the same +hot-path mapping and checks. + +**Otherwise, review the branch changes.** Find the merge-base against the DataDog +upstream `master` and diff against it: + +```bash +UPSTREAM=$(git remote -v | grep -E 'DataDog/[^/]+(\.git)?\s' | head -1 | awk '{print $1}') +[ -z "$UPSTREAM" ] && UPSTREAM="origin" +MERGE_BASE=$(git merge-base HEAD ${UPSTREAM}/master) +echo "Reviewing changes since $MERGE_BASE" +git diff $MERGE_BASE --stat +git diff $MERGE_BASE --name-status +``` + +If there are no changes, say so and stop. Otherwise read the diff **and the full +content of the modified source files** (not just the hunks) — the interprocedural +condition (who calls this, what a helper does, where a hook's sink lands) lives +outside the diff window. Ignore the PR description if the user asks for an +independent review. + +### Step 2 — Map the changed code onto hot paths + +For each changed method, decide *which multiplier applies* before flagging anything. + +**Hot anchors** (reachable ⇒ assume hot): `@Advice.OnMethodEnter`/`OnMethodExit`, +per-span / per-trace callbacks, request / message handlers, streaming chunk handlers. +**Hot-path map** (where cost is multiplied per-span × spans/request × requests/sec): +span lifecycle (create / setTag / finish), tag-map ops, serialization/encoding, the +metrics/stats path, decorators, propagation (header read/write). + +**Cold only with positive evidence:** one-time init, startup-only path, a genuinely +rare error branch, or behind a guard that provably fires rarely. Watch the +**interprocedural trap** — a method three helpers deep from an `@Advice` entry is +still hot. And note **domain adjustment**: large-denominator domains (LLMObs, CI +Visibility, DSM) absorb per-call CPU/alloc cost, but the risk *inverts* to payload +memory (SEV-1); streaming handlers fire per-chunk, so the large-denominator relief +suspends inside them. See `guide.md` §6. + +### Step 3 — Apply the checks + +Run the changed hot-path code against the rubric. Keep the check index below in mind; +open the references for the precise conditions, confidence, severity, and fix: + +- **`references/guide.md`** — the narrative "how": severity model, hotness rubric, + the 6 categories with worked examples, and the false-positive traps. Read this first + if you're calibrating judgment. +- **`references/checks.md`** — the precise cost-model: 7 universal checks + the Java + addendum (J1–J11) + the ByteBuddy-Advice fix idioms + the toolkit-availability note. + Read this for the exact confidence/severity/fix of a specific pattern. + +### Step 4 — Resolve, then emit + +Before writing a finding: confirm the reachability path, confirm it's unconditional +along that path (check for upstream guards), and follow any hook/callback to its sink. +Drop anything that resolves to benign. Then report in the format below. + +**How many findings to report — scale with diff size:** +- **Small, focused diff** (one method, a handful of files): report *every* genuinely + high-confidence finding, ranked by severity. A tight diff with four real allocation + smells should list all four (as the worked example does). +- **Large PR:** lead with the 1–3 highest-severity findings and note that lower-severity + ones may exist — don't bury the important one under a wall of CPU-micro nits. +- Either way, the gate is *confidence*, not a count: silence on the uncertain ones is + what earns the review its credibility. + +## Output format + +Follow this structure (see `references/example-review.md` for a full worked instance — +). Showing your suppressed lookalikes and what you cleared is not +filler: it demonstrates the precision that makes the findings trustworthy. + +When providing suggestions as code review comments, prefix the comments with "perf: " +```markdown +# Perf Review — + +**Scope reviewed:** + +## Confirmed findings + +### 1. + +- **Confidence:** flag-with-confidence | flag-as-measure +- **Reachability:** +- **Rubric check:** <#N / JN> +- **Severity:** SEV- +- **Fix / verify-with:** + +## Correctly suppressed (not flagged) + + +## Checked, no issue + + +## Summary + +``` + +If nothing survives the confidence bar, say so plainly — "No high-confidence hot-path +findings; here's what I checked and cleared." A clean review is a valid, valuable +result, not a failure to find something. + +## Check index (the map — details in the references) + +**Universal (language-agnostic):** +1. Per-span/per-call allocation on a hot path (retained/escaping) — SEV-2/3 +2. Repeat work across calls (regex compile / format / parse / concat recomputed) — SEV-2/3 +3. Unbounded memory / collection, or keyed by high-cardinality input — **SEV-1** +4. Expensive work on the critical path that could be deferred — SEV-1/2 +5. Polymorphic dispatch defeating inlining/devirt — flag-as-measure — SEV-2/3 +6. FFI / native-boundary crossing per-item (not batched) — SEV-1/2 +7. Escape / allocation-elision defeated by a refactor — flag-as-measure — SEV-2/3 + +**Java addendum (JVM-specific — full text + mechanism in `checks.md`):** +- **J1** escaping allocation defeats Escape Analysis · **J3** JNI crossing + virtual-thread + pinning · **J4** GC pressure → tail latency · **J5** cardinality-sensitive aggregator + (**SEV-1**) · **J6** `WeakReference.get()` in a probe loop strengthens the ref · + **J7** `substring` → `SubSequence` zero-copy view · **J8** backtracking regex on + external input → RE2J (ReDoS) · **J9** `Objects.hash(...)` varargs/boxing → + `HashingUtils` · **J10** hot-path `String.format` → `Strings` · **J11** composite-key + maps → `Hashtable`. +- **J2** megamorphic dispatch is **PARKED** — do *not* raise megamorphism findings in + review yet (kept as author reference only; it needs a standing audit, not per-PR + flagging). See `checks.md` for why. +- ByteBuddy-Advice idioms (`Config.get()` hoisting, `@Advice.AllArguments` → + `@Advice.Argument`, `@Advice.SkipOn`+cached-boolean, `@Advice.Local`, `switch(String)` + three-tier) — in `checks.md`. + +J7–J11 route an *existing* #1/#2/#3 finding to a landed reusable fix — they are not new +triggers. Don't raise a finding you wouldn't have raised anyway. diff --git a/.agents/skills/perf-review/references/.gitignore b/.agents/skills/perf-review/references/.gitignore new file mode 100644 index 00000000000..a9f260ab1a9 --- /dev/null +++ b/.agents/skills/perf-review/references/.gitignore @@ -0,0 +1,3 @@ +# Local rubric-maintenance lab file — the delta-since-last-roll-up changelog. +# Kept local (not shipped): folded into the local rubric + rolled up to the published copies periodically. +unpublished.md diff --git a/.agents/skills/perf-review/references/checks.md b/.agents/skills/perf-review/references/checks.md new file mode 100644 index 00000000000..cdf601f4083 --- /dev/null +++ b/.agents/skills/perf-review/references/checks.md @@ -0,0 +1,65 @@ +# Performance Review Checks — AI-review cost model + +Operationalizes the narrative **Performance Review Guide** (`guide.md`) into diff-applicable checks for AI PR review. Complements benchmark-based regression-blocking: benchmarks catch *measured* regressions on *covered* ops; this catches *un-benchmarked* pattern-smells in *any* diff. Grounded in the guide's **Tracer Principles** (do-no-harm, assume-hot) and its severity model. Read this alongside `guide.md` — the guide is the narrative "how"; this is the precise confidence/severity cost-model. + +## Posture (read first) +- **Advisory, not blocking** initially. A nondeterministic, false-positive-prone check that blocks merges dies of being ignored (false positives) or gives false confidence (false negatives). Earn blocking only after precision is proven, and likely only on the deterministic-lint subset. +- **Precision over recall — silent when unsure.** Only flag high-confidence issues on real hot paths. Over-flagging kills the check. (This fights the model's default to be comprehensive/helpful — state it explicitly in the prompt.) +- **Resolve-via-sink before flagging callbacks and hooks.** A per-span callback or scope hook registration *looks* like a hot-path cost but may be safe once you follow into the registered listener. If every reachable sink is an atomic counter (`LongAdder`, `AtomicLong`) or no-op-when-disabled, stay silent — a "verify contention" nudge there is noise. Follow the full listener chain before emitting a finding. +- **Findings are prompts to *verify*, not verdicts.** The AI reasons statically — by the doc's own "Don't Assume; Measure," it *cannot* render a perf verdict. Every finding routes into Benchmark → Profile → Improve → Guard. Phrase as "this looks like X; verify with Y." +- **Triage by severity** (from the doc): flag SEV-1 (memory/OOM) patterns *aggressively* (a false positive is worth catching a container-kill); flag low-severity CPU-micro *conservatively or not at all* (false positives there only erode trust). +- **Scope**: the diff × known hot paths. Don't review the world. +- **Confidence axis** on every finding: **flag-with-confidence** (mechanism-determined: allocation, dispatch, copying, crossing, unboundedness) vs **flag-as-measure** (opaque: depends on JIT/GC/optimizer decisions — escape elision, inlining, GC impact). +- **Visibly-contestable perf tradeoff without data → soft flag-as-measure.** Narrow trigger: the change makes a **visible tradeoff that could itself regress** — removes a lock/guard/synchronization, swaps in a hand-rolled cache/structure, or explicitly claims "faster/optimized" — **and** ships no benchmark/profile. Then a static read can't tell win from regression → one soft flag-as-measure nudge ("trades X for Y — verify with a JMH benchmark / JFR"). If nothing in the diff could plausibly regress, there's nothing to measure → stay silent. Explicitly NOT fired for: a mechanically-obvious win (hoist-invariant, denser structure, removed allocation); routine adoption of a known-better idiom (lower-overhead builder/API/toolkit primitive, no visible downside); or a change that ships a benchmark/JFR (well-evidenced). One line, a nudge not a code-pattern finding. + +## Hot-path map (where cost matters — and the multiplier) +Span lifecycle (create / setTag / finish), tag map ops, serialization/encoding, the metrics/stats path, decorators, propagation (header read/write). **Multiplier: per-span × spans/request × requests/sec.** A per-span cost is multiplied massively; a per-process/once cost is negligible. The AI must reason about *which multiplier applies* before flagging. + +## Universal checks (language-agnostic) +Format: **pattern** — *expensive when (the interprocedural condition to trace)* — confidence — severity — fix. + +1. **Per-span/per-call allocation on a hot path** — *per-span (or hotter) AND the object isn't trivially short-lived (it's retained, returned, captured, or passed across a boundary)* — flag-with-confidence if clearly per-span + retained; flag-as-measure if lifetime/escape is borderline — SEV-2/3 (→SEV-1 if unbounded) — fix: reuse, pool, dense/positional storage, defer out of the hot path. +2. **Repeat work across calls/traces** — *string concat / case-conversion / regex *compile* / format / parse recomputed each hot-path call, on a recurring (low-cardinality) input or allocating each time* — flag-with-confidence — SEV-2/3 — fix: memoize (bounded — see #3) or compile-once (hoist regex to static). +3. **Unbounded memory / collection** — *a cache/map/collection with no size+byte bound, or keyed by a high-cardinality input (per-request data, raw strings)* — flag-with-confidence (unboundedness is structurally visible) — **SEV-1 (OOM / container-kill — top severity)** — fix: bound by count *and* bytes; or don't cache high-cardinality inputs (opt out). +4. **Expensive work on the critical path that could be deferred** — *heavy compute / parse / normalize / serialize / I/O / lock on the synchronous request or span-finish path, that could be moved* — flag-as-*consider* (deferability is contextual) — SEV-1/2 — fix: defer to background/writer thread, lazy-compute, batch. +5. **Polymorphic dispatch on a hot path** — *a hot call site becomes polymorphic enough to defeat the runtime's inlining/devirtualization (real for JIT runtimes — JVM/.NET/V8; AOT/interpreted differ)* — **flag-as-measure** ("may defeat devirtualization; verify on the target runtime") — SEV-2/3 — fix: keep hot call sites mono/bi-morphic; specialize. +6. **FFI / native-boundary crossing on a hot path** *(central to the shared-core effort)* — *a native crossing per-span/per-item (not batched), or transporting strings/objects rather than primitives/IDs* — flag-with-confidence (boundary cost is mechanism-determined; runtime-specific pinning → addendum) — SEV-1/2 (SEV-1 if it blocks/pins under concurrency) — fix: batch (one per flush, not per item); transport interned IDs not strings; keep crossings off the hot/concurrency path. +7. **Escape / allocation-elision defeated** *(Java/Go/.NET/V8 all have a version)* — *a refactor makes a previously-local object escape (stored, returned, captured by a closure, passed to a virtual/non-inlined call) → silent heap allocation on a hot path* — **flag-as-measure** ("may now escape and allocate; verify with an allocation profiler") — SEV-2/3 — fix: keep it local; avoid the escaping store/capture. + +## Deterministic-lint candidates (DON'T spend AI budget — make these real lints) +Fixed-signature, mechanically checkable: +- per-call cache / regex / expensive-object creation that should be static/once +- boxing in specific hot APIs +- using a string-API where an id-API exists on a hot decorator +- the existing convention rules (e.g. don't extract one-shot instrumentation methods to constants) +- *(grows as patterns prove mechanically checkable — migrate them off the AI as they stabilize)* + +## Java addendum (JVM-specific — mechanism authored with JIT-developer authority; **calibrate production-priority against your own escalation history**) +Refines the universal checks with JVM mechanics. Quarantined here, for the Java audience that has the substrate. + +**Scope (2026-07-08):** the primary optimization target is **C2 / Java 11+ (HotSpot)** — the mechanisms below are stated in those terms (inline-cache/`TypeProfileWidth` model, C2 speculative inlining, EA). C1-only, OpenJ9/J9, GraalVM, and Java 8 should still benefit but are the minority case we don't *tune* for. Pairs with the benchmark JVM standardization (Java 17 HotSpot). + +- **J1 — Escaping allocation defeats Escape Analysis** *(refines #1, #7)*. The JVM scalar-replaces only *non-escaping* short-lived objects. An object stored in the tag map / span / a collection, iterated at serialization, or passed to a virtual/megamorphic call **escapes** → EA can't elide it → real heap allocation. The trap: *"the JIT will scalar-replace it" is false for escaping objects* — the dense-store −48% came from removing exactly the escaping per-tag wrappers; an earlier no-Entry change measured ~0 because *those* entries were transient/EA-eligible. **Verify in JFR — EA'd objects don't appear in alloc profiles, so a surviving `Entry` in the profile *proves* it escapes.** +- **J2 — Megamorphic dispatch** *(refines #5)*. **Status — PARKED for PR-review flagging (2026-07-08): do NOT raise megamorphism findings in review yet.** Kept as author-reference + the standing-audit target described below, not as an active review idiom. Rationale: it's too in-the-weeds to land with most devs, and the rubric must first bank *legible* wins (allocation, unbounded memory, regex — what anyone can see in a profiler) to earn trust before deploying the subtle JIT checks. Revisit once the rubric has a track record. (Mechanism below stands; it's the flagging that's held.) A hot call site seeing **≥3 receiver types with no dominant one** goes megamorphic. **Do not frame this as "the virtual call is slow" — a well-predicted indirect branch is a couple of cycles; the dispatch is a rounding error.** The cost is the **optimization fence the un-inlinable call erects on *both* sides**: caller-side, the args escape into an opaque callee → no scalar-replacement/EA on them, no constant-propagation *into* the call, caller-saved registers spilled across it, no hoist/reorder across the boundary; callee-side, it's never specialized to *this* caller, so the arg types/constants that would have collapsed its internal branches and devirtualized its *own* downstream calls stay invisible. Inlining is what lets the two bodies optimize as **one unit**; the megamorphic call severs that — on the hottest paths that is the whole bill. **C2 rescue conditions (the primary target):** ≤2 types stays **bimorphic** (inlinable); a **dominant receiver** (≥`TypeProfileMajorReceiverPercent`, default 90%) still gets guarded mono-inline + uncommon-trap fallback, so a *skewed* site is usually fine — but watch **bimodal oscillation** (a recurring rare type → deopt thrash). The danger zone is the **flat ≥3 distribution** (`TypeProfileWidth`=2 → profile overflow → itable v-call, no inline). Fixes, cheapest first: keep the site to ≤2 types; **gate-when-empty** so the common case skips the fan-out (a default-empty listener array); **collapse N impls into one** `final` class with an internal state/size-class switch (e.g. retire a legacy map impl so the optimized one is the sole impl → every `TagMap` site monomorphic); or **call-site-split/unroll** a stable-order fan-out (catalog #7). **flag-as-measure** — opaque; whether it bites depends on which impls actually load + the runtime receiver mix. Confirm with `-XX:+PrintInlining` (`not inlined (megamorphic)`) / JITWatch, not a code read. **Diff-review blind spot → needs a standing audit.** The worst megamorphic sites *accumulate*: no single PR introduces them (each only nudges the type count by one), so a per-PR check catches only a PR that *widens* a site — the pre-existing hazards are invisible to it. The heaviest is `Context.get`/`with` dispatching across `Empty`/`Singleton`/`Indexed`(+wrapper) impls — the hottest path in the system (catalog #11). These want a **periodic PrintInlining census of the known hot sites**, run independent of any PR, not diff review. +- **J3 — JNI / native crossing: overhead + virtual-thread pinning** *(refines #6)*. JNI call ≈ 100ns–1µs (state transition, arg pin/copy, no inlining across); string args via `GetStringUTFChars` = UTF-16→UTF-8 copy. **A JNI call from a virtual thread pins the carrier** → no other vthreads on that carrier run while pinned → concurrency collapse for vthread-reliant apps. Fix: batch at flush on the **writer (platform) thread**, keep the app-vthread path pure-Java, transport interned IDs not strings; `@CriticalNative` only for short primitive ops (no `JNIEnv`, no object args, no GC-safe state — severe constraints). Flag the crossing + pinning risk (mechanism); overhead magnitude → measure. +- **J4 — GC pressure → *tail* latency** *(refines #1)*. Hot-path allocation → more GC → STW pauses → app **tail** latency, not just throughput (the tracer shares the app heap). ZGC has short pauses but isn't common — assume G1/Parallel. flag-as-measure ("may raise tail latency; verify under load at a realistic heap"). +- **J6 — Reference strengthening in weak-cache scans** *(refines #1, #2)*. Calling `WeakReference.get()` (or `SoftReference.get()`) inside a cache-probe loop to identify the referent **strengthens** the reference — the returned strong ref keeps the object alive until it goes out of scope, defeating the purpose of the weak reference. Pattern to flag: a loop over a weak-ref cache that calls `.get()` for identity/equality comparison on every slot probed. Fix: store a stable key (e.g. `System.identityHashCode(context)`) in the wrapper at construction time; compare the key first (plain int, no strengthening); call `.get()` only on a key match (the right moment — you're about to use the referent anyway) or to detect eviction (`get() == null`). **flag-with-confidence** when `.get()` appears inside a probe loop on a hot path — SEV-2/3. + +- **J7 — `substring`/slice → `SubSequence` zero-copy view** *(refines #1, #7)*. `String.substring`/`subSequence` allocates a fresh backing array per call. On a hot parse path (headers, tags, query strings, SQL/DBM, propagation) where the slice is **transient** — compared (`equals`/`startsWith`/`contains`/`indexOf`), parsed, or appended, then discarded — a `SubSequence` (offset+length view) is zero-copy and EA-elided **iff** the consumer takes a `CharSequence`/range (else the boundary `toString()` erases the win → add the overload or skip). **flag-as-measure** for the transient case (EA-dependent). The retention trap is **flag-with-confidence**: a `SubSequence` stored in a field/tag/collection/cache pins its *entire* backing String — a small window over a large string is a net memory loss — so a retained view must be materialized or `compact()`'d. Discriminator = transient (view, measure) vs retained (must detach). +- **J8 — Backtracking regex on external input → RE2J / bounded input** *(distinct from #2 compile-per-call)*. `java.util.regex` backtracks → exponential worst-case (ReDoS) on adversarial input — a CPU / tail-latency / DoS hazard, **not** an allocation one. Flag the **conjunction**: (a) input is user/external-controllable AND (b) the pattern is backtracking-prone (nested/overlapping quantifiers, `(a+)+`, unanchored `.*` around a quantified group). **flag-with-confidence** when both hold — SEV-2 (tail latency), **SEV-1** on a per-request AppSec/security-scan path (IAST Reporter / WAF run regex on untrusted input every request). Fix: RE2J (`com.google.re2j`, guaranteed linear; no backrefs/lookaround), anchor/de-nest, or hard-cap input length. +- **J9 — `Objects.hash(...)` varargs / boxing hash on a hot path → `HashingUtils`** *(refines #1)*. The allocation is specific to the **varargs/boxing forms**: `Objects.hash(a, b, …)` allocates an `Object[]` per call and **boxes every primitive** arg; same for boxing primitives into a `new Object[]{…}` (or `Arrays.hashCode` over such an array). Per-span tag/key building, or a hot value object's `hashCode()` built this way, → a guaranteed per-call allocation + boxing. Fix: `datadog.trace.util.HashingUtils` — primitive `hash(long/int/boolean/char/…)` overloads (no boxing), `hash(Object,Object)` and `hash(int,int)` combiners (no array); for >2 fields fold pairwise through `hash(int,int)` (there is no varargs form, by design). flag-with-confidence for the varargs/boxing form — SEV-2/3. **Do NOT flag allocation-free combines** — a hand-rolled `31*h + Long.hashCode(x)` / `31*h + intField`, or `Arrays.hashCode` over an *existing primitive array*, allocates nothing (`HashingUtils` is itself 31-based); flagging them would recommend replacing already-correct code. +- **J10 — hot-path `String.format` / string munging → `Strings` (+ `SubSequence`)** *(refines #2)*. `String.format` parses the format string, boxes its args, and allocates on every call — never on a hot path; hand-rolled case-conversion, class/resource-name munging, blank-checks, and truncation recomputed per call qualify too. Fix: `datadog.trace.util.Strings` — allocation-aware `replace`/`truncate(CharSequence)`/`isBlank`/`getResourceName`/`getClassName`/…; for **transient substring compares** prefer a `SubSequence` view (J7); for plain assembly, direct concatenation beats `format`. flag-with-confidence for `String.format` on a hot path; flag-as-measure for borderline munging — SEV-2/3. +- **J11 — composite / multi-dimensional key maps on a hot path → `Hashtable` / `ConcurrentHashtable`** *(refines #1, #3)*. `Map>` nesting, or a `HashMap` keyed by a composite key (client-side stats, per-`(service, operation, …)` aggregation), allocates nested maps + `Entry` objects + boxes keys on the hot aggregation path. Fix: `datadog.trace.util.Hashtable` (single-threaded, composite-key D1/D2 tables — landed) or `datadog.trace.util.ConcurrentHashtable` (lock-free concurrent, **coming**) — positional composite keys, fewer allocations. flag-as-measure — SEV-2/3. +- **Toolkit availability — cite only what exists.** Available today: `Strings`, `SubSequence`, `HashingUtils`, `Hashtable` (all `datadog.trace.util`), `RE2J` (`com.google.re2j`). Coming (name as "coming", don't imply it's present): `ConcurrentHashtable`, `StringIndex` (immutable string set/map), `UTF8BytesString.Cache` (recurring-string interner), wider `IntegerCache` (http-status/port boxing), `DDCache` inlining. **J7–J11 route an *existing* #1/#2/#3 finding to a reusable fix — they are not new flag-triggers. Don't raise a finding you wouldn't have raised anyway; the posture (precision, silent-when-unsure, findings-cap-scales-with-diff — see `SKILL.md`) is unchanged.** +- **J5 — Cardinality-sensitive aggregator** *(domain-specialized #3)*. Some structures are invisible to the generic "unbounded collection" check because the risk is *cardinality*, not raw size: a config- or user-driven value (tag key, resource name, HTTP URL) feeding a **cardinality-sensitive aggregator** (e.g. the conflating metrics aggregator — each unique label combination = one aggregate; a `maxAggregates` cap bounds OOM but high-cardinality input *thrashes* it: constant eviction, garbled metrics). flag-with-confidence when config/user-driven values reach an aggregator with a per-key budget — **SEV-1** (same class as unbounded memory: correctness + heap impact). Fix: bound the source cardinality before it enters the aggregator, or use sentinel substitution for over-cap values. This surfaced on merged production code more than once in back-test calibration — the capstone pattern where the bot's value concentrates. + +## Instrumentation (ByteBuddy Advice) idioms — dd-trace-java-specific fixes +The core rule is a **predicate-with-default, not a banned-API list**: don't flag "you called `String.format`"; flag *"an eager, unconditional expensive call on an instrumentation-reachable path."* Two failure shapes, different fixes: (1) the result is usually **discarded** → **gate/defer** (parameterized logging, `isEnabled()` guard) — the cost is avoidable; (2) the result is always **needed but costly** → **cheapen/cache** — gating does nothing. The discriminator (eager? unconditional? guarded? result-needed?) is interprocedural — that's the review's job (§ workflow). These idioms are the actionable fixes when a universal/Java finding lands on an `@Advice` path: + +- **`Config.get()` / `InstrumenterConfig.get()` on a hot path — flag-with-confidence.** Walks a config-resolution chain; not a free read. Fix: hoist to a `static final` field, or compute once in the constructor. Common trap: the call is buried in a helper invisible at the advice site — grep transitively. (The single most recurring finding in calibration — five independent occurrences.) +- **`@Advice.AllArguments()` — deterministic lint.** Materializes a new `Object[]` boxing all arguments on every advised call; always escapes, EA cannot elide it. Fix: `@Advice.Argument(value=N)` for the one argument and type needed. +- **`@Advice.SkipOn(OnDefaultValue.class)` + cached boolean — the preferred feature-flag pattern.** Compute a `static final boolean` once, return it from `@Advice.OnMethodEnter`, suppress exit advice when disabled. Residual cost: one JIT-hoistable field read per call. Recommend this whenever a `Config.get()` shows up in advice. +- **`@Advice.Local` — prefer over `ThreadLocal`.** Carries per-invocation state from `OnMethodEnter` to `OnMethodExit` with no map lookup. +- **Reflective `@Advice.Origin Method` / `Constructor` on a hot advice.** The reflective origin object is the costly form (per-access reflective lookup). A **String** origin (`@Advice.Origin("#m") String`) is injected as a compile-time constant — no per-call allocation, **don't flag it** (it's the intended cheap form, widely used). Flag only reflective `Method`/`Constructor`/`Executable` origins on a hot advice path; fix: pass the constant String pattern (`#m`, `#t`) instead of the reflective object. +- **Java Stream API on an advice/hot path — flag-with-confidence.** `stream()`/`IntStream` allocate `Spliterator` + pipeline objects per call; JIT elision is fragile. Fix: a plain `for` loop (`cstyleFor`/`enhancedFor`/`forEach`/`iterator` are all on par, ≈0 alloc). See guide §2 for the benchmark numbers and the three silencing exceptions (cache-miss body, length-guarded error path, cold/startup). +- **`switch(String)` — three-tier fix ranking.** (1) resolve to a constant `long` id (folds on any JIT); (2) open-addressed table (never folds but always inlinable, low-variance); (3) plain `switch` (fine for small, inlinable dispatch). Flag *large* switches (inline-budget exhaustion is mechanism-certain); flag *small* switches on hot constant-arg paths only as a version-conditional soft-alert. diff --git a/.agents/skills/perf-review/references/example-review.md b/.agents/skills/perf-review/references/example-review.md new file mode 100644 index 00000000000..de17100768c --- /dev/null +++ b/.agents/skills/perf-review/references/example-review.md @@ -0,0 +1,59 @@ +# Perf Review — PR #11903 (Bucket4j instrumentation, demo) + +**PR:** https://github.com/DataDog/dd-trace-java/pull/11903 +**Rubric:** `checks.md` + `guide.md` (this skill's references) +**Scope reviewed:** `Bucket4jDecorator.onConsume` — runs on every `Bucket#tryConsume` call (tracing hot path; multiplier = per-call × calls/sec). +**Method:** Diff reviewed independently of the PR description (description ignored per request). + +## Confirmed findings + +### 1. Per-call config lookup + Set allocation +```java +InstrumenterConfig.get().isIntegrationEnabled(singleton("bucket4j-tier"), true) +``` +`Collections.singleton(...)` allocates a new `SingletonSet` every call, plus a config lookup, for a value that doesn't change per-call. +- **Confidence:** flag-with-confidence +- **Rubric check:** #2 (repeat work on invariant input) +- **Severity:** SEV-2/3 +- **Fix:** hoist to a `static final boolean` (or cache in a field) computed once; eliminate the per-call allocation. + +### 2. `Arrays.stream(...).filter(...).findFirst()` in the hot path +Builds a Stream pipeline (Stream + Spliterator + pipeline stages + captured lambda) every call just to find the first threshold ≥ tokens. +- **Confidence:** flag-with-confidence +- **Rubric check:** #1 / #5 (per-call allocation + unnecessary indirection) +- **Severity:** SEV-3 +- **Fix:** plain `for` loop over `TIER_THRESHOLDS`, no Stream. + +### 3. `Objects.hash(bucket, tokens, consumed)` in `onConsume` +Varargs `Object[]` allocation + boxing of `tokens` (long) and `consumed` (boolean) on every call. Runs unconditionally, not gated behind the tier flag. +- **Confidence:** flag-with-confidence +- **Rubric check:** J9 +- **Severity:** SEV-2/3 +- **Fix:** `datadog.trace.util.HashingUtils` (no boxing, no array). + +### 4. Eager string concatenation in `LOGGER.debug(...)` +```java +LOGGER.debug("bucket4j tryConsume tokens=" + tokens + " consumed=" + consumed + " bucket=" + bucket); +``` +Builds the string (StringBuilder + `bucket.toString()`) unconditionally, even when debug logging is disabled. +- **Confidence:** flag-with-confidence +- **Rubric check:** #2 / J10 +- **Severity:** SEV-2/3 +- **Fix:** SLF4J parameterized form `LOGGER.debug("bucket4j tryConsume tokens={} consumed={} bucket={}", tokens, consumed, bucket)`, or guard with `isDebugEnabled()`. + +## Correctly suppressed (not flagged) + +`private static final int DEFAULT_LIMIT_KEY = Objects.hash("default", 100L);` + +Textually the same `Objects.hash` pattern as finding #3, but this one runs once at class-init (cold path), not per-call. Per the rubric's precision-over-recall posture (silent when unsure / don't erode trust with lookalike false positives), this is correctly **not** flagged. + +## Checked, no issue + +- No unbounded memory / cardinality-sensitive aggregator (check #3, J5) — nothing cached. +- No FFI/native-boundary crossing (check #6, J3). +- No megamorphic-dispatch finding raised — J2 is explicitly parked in the rubric, not an active review idiom. +- String-literal tag keys (`"bucket4j.tier"`, etc.) — JVM interns literals automatically, no per-call allocation cost. + +## Summary + +4 confirmed hot-path findings, all SEV-2/3 (allocation/CPU — none unbounded or OOM-adjacent). 1 lookalike correctly suppressed as cold-path. diff --git a/.agents/skills/perf-review/references/guide.md b/.agents/skills/perf-review/references/guide.md new file mode 100644 index 00000000000..6f847ef39d0 --- /dev/null +++ b/.agents/skills/perf-review/references/guide.md @@ -0,0 +1,276 @@ +# Java Tracer Performance Review Guide + +--- + +## Tracer Principles + +Two lines establish everything that follows. + +**Do no harm.** The tracer shares the customer's process, heap, and latency budget. Harm is +ordered by severity: crashes first, then security, then incorrect behavior, then adverse +performance. Performance overhead is a form of incorrect behavior — a non-directly-observable +side effect that can rise to directly observable customer harm: missed SLAs, OOM kills, container +restarts, cold-start churn. + +**Assume hot.** We don't know a priori what will be on the critical path in a customer's +application. In the absence of evidence, assume the code runs on every request, under load, at +full concurrency. There are exceptions — schedulers, startup code, I/O-heavy paths — but the +default is: *assume hot unless there is positive evidence of cold*. + +**Advisory, not blocking.** The rubric is a low-friction nudge alongside the developer's path — +not a wall across it. Flag the 1–2 highest-severity findings per PR. Stay silent when unsure. +Over-flagging kills the check faster than under-flagging. + +--- + +## Severity Guidelines + +| Severity | Type | Usual Cause | +|---|---|---| +| **SEV-1** | OOM / container kill | Unbounded memory growth | +| **SEV-1/2** | Response time — median | Expensive work on the critical path | +| **SEV-1/2** | Response time — tail latency | Allocation rate → GC pauses (shared heap) | +| **SEV-2** | Startup latency | Eager class loading, init, transformation | +| **SEV-2/3** | CPU overhead | General tracer activity, background work | + +CPU overhead alone is the lowest priority — it's a cost issue, not a correctness one, and +escalates only when it causes latency. + +**The denominator matters.** Severity is cost relative to the instrumented operation. A 2 µs tag +op on a sub-millisecond HTTP span is a large fraction of the operation. The same 2 µs on a 500 ms +LLM call is negligible. Large-denominator domains (LLMObs, CI Visibility, DSM) get lower +CPU/alloc severity — but the risk *inverts*: payload memory (large prompts, job metadata, +accumulated output) becomes SEV-1. + +**Default-state changes multiply severity.** A one-line `DEFAULT_X_ENABLED = true` flip applies +the enabled-path cost to every user. Scrutinize heavily regardless of diff size. + +--- + +## Hotness Rubric + +The key question when reviewing any code: *is this on a hot path?* + +The default answer is yes. The burden of proof runs toward cold. Ask "is there evidence this is +cold or guarded?" — not "is there evidence this is hot?" (that rationalizes itself into "probably +not"). + +**Hot anchors.** Paths are hot when reachable from: +- `@Advice.OnMethodEnter` / `@Advice.OnMethodExit` (per-advised-call) +- Per-span or per-trace callbacks +- Request or message handlers +- Streaming chunk handlers (even if the overall stream is slow — see §6) + +**Cold only with positive evidence.** A path is cold if it is: a one-time init, a startup-only +path, a genuinely rare error branch, or behind a guard that provably fires rarely. + +**Watch for the interprocedural trap.** Hot entry points are often indirect. A method buried +three helpers deep from an `@Advice` entry is still hot. Trace up before assuming cold. + +--- + +## Categories of Issues + +In approximate order of severity and frequency: + +1. **Unbounded Memory** — collections or aggregators that grow without a bound +2. **Repeated Allocation on Hot Paths** — regex compile, format strings, streams per call +3. **Per-span Escaping Allocation** — wrapper objects, defensive copies, capturing lambdas +4. **Wrong Collection Type** — heavier type than needed, missing pre-sizing +5. **Startup Latency** — eager work on the premain critical path +6. **Domain-Adjusted Severity** — large-denominator domains, streaming handlers + +--- + +## 1. Unbounded Memory (SEV-1 — flag aggressively) + +A collection that grows without a bound can kill the customer's container. The tracer shares the +application heap — there is no isolation. A false positive here is cheap insurance against a +container kill. Flag aggressively. + +**Raw unbounded cache.** No size or byte bound, keyed by data that grows with load (URL, SQL, +resource names). Fix: `DDCaches.newFixedSizeWeightedCache(n, weigher, maxBytes)`. + +**Cardinality-sensitive aggregator.** A collection with a nominal size bound, but keyed by data +that explodes in cardinality (tag combinations, user-supplied dimensions). High-cardinality input +thrashes the eviction policy — the nominal cap doesn't help. Flag when config or user-driven +values feed such an aggregator without a key-space constraint. + +**Open-cardinality keys.** Any field that varies per-message — timestamp, offset, correlation ID +— used as a key component makes the aggregator grow without bound. Fix: remove the +open-cardinality dimension, or replace raw timestamps with time-buckets. + +**Externally-driven caps.** Any collection grown by Remote Config, user input, or an external +control plane has its growth controlled by the external source. When a PR removes an existing cap +with no replacement bound, flag and ask — the decision may be intentional but must be explicit. + +> **False-positive trap.** Flagging the *absence* of a cache on open-cardinality input (raw SQL +> with inline literals, per-request strings) is wrong. Not caching high-cardinality data *is* the +> correct choice — caching it would be the worse SEV-1. Flag a cache *keyed by* high-cardinality +> data; never flag the decision not to cache. + +*Examples (patterns from back-test calibration):* +- A `LoadingCache` keyed by URL and SQL text with no size or byte limit — the capstone + pattern: unbounded growth tied directly to traffic volume. +- A DSM pathway hash that included a timestamp field, making the aggregator's slot count + grow without bound. Removing the timestamp from the key is a SEV-1 prevention. + +--- + +## 2. Repeated Allocation on Hot Paths (SEV-2/3) + +Tracing is repetitive. Work repeated per-span or per-trace compounds quickly. The focus is on +*allocating* repeat work — patterns that produce garbage the GC must collect — not pure CPU-micro +work like an `.equals()` call. + +**Regex compile per call.** `Pattern.compile(...)` at a non-static site allocates and compiles on +every call. Fix: `static final Pattern`. + +**`String.format` / format-string parsing.** Re-parses and allocates per call. Fix: direct +concatenation, or pre-compute the result. Also watch for locale-dependent formatting crossing the +wire — a correctness issue on top of the perf one. + +**`Config.get()` per call.** Walks a config-resolution chain; not a free read. Fix: hoist to a +`static final` field at class initialization. This is the single most recurring DBM finding — +surfaced independently in five separate PRs. + +**Java Streams on hot paths.** `stream()` and `parallelStream()` always allocate `Spliterator` +and pipeline objects. JIT elision is fragile — small changes to the pipeline or surrounding code +break it silently. Fix: plain `for` loop. Any of `cstyleFor`, `enhancedFor`, `forEach`, or +`iterator` are equivalent and zero-allocation. Benchmark evidence (Java 17, M1, 8 threads, +@Fork(2)): plain loops allocate ≈ 10⁻⁷ B/op; `stream()` always allocates 56–88 B/op; +`parallelStream()` scales from 128 B/op (empty list) to 5 200 B/op (100-element list). + +**`@Advice.AllArguments()`.** Materializes a new `Object[]` boxing all method arguments on every +advised call — always escapes, EA cannot elide it. Fix: `@Advice.Argument(value=N)` for the +specific argument and type needed. + +*Examples (patterns from back-test calibration):* +- A per-trace path with regex compile per call + `String.format` + a locale-dependent formatting + bug — the clearest recall case for mechanism-certain patterns. +- A `StringBuilder(1024)` per query for a ~200-character result. Two-sided error: + under-size causes realloc, over-size wastes memory. Target accurate, not generous. + +--- + +## 3. Per-span Escaping Allocation (SEV-2/3, can reach SEV-1 via tail latency) + +The tracer shares the application heap. Additional allocation contributes to GC and raises +stop-the-world pauses — directly increasing tail latency for the customer's application. The JVM's +escape analysis eliminates *local* short-lived allocations, but only when the object stays local. +Stored in a map, returned, captured by a lambda, or passed to a non-inlined virtual call: it +escapes, and it's real. + +**EA claims for scope/wrapper objects spanning I/O — treat as unverified.** A microbenchmark +tight-loop can show zero allocation for a scope or wrapper object because C2 inlines through +everything and scalar-replaces it. In production, scopes almost always wrap I/O — and C2 cannot +inline through native/blocking I/O boundaries. The object's lifetime extends across the call, it +escapes, and it allocates. A benchmark without I/O-wrapping is not a credible check. Treat EA +claims about per-span scope objects as unverified unless the benchmark explicitly includes +realistic I/O usage. + +**Defensive copies at internal boundaries.** `array.clone()`, `new ArrayList<>(other)` — justified +at real trust boundaries (public API, genuinely mutable external input); wasteful +internal-to-internal where we control all callers. Fix: return a read-only view, or establish a +"don't mutate" contract. + +**Capturing lambda on a hot path.** A non-capturing lambda is a cached singleton — zero alloc. A +capturing lambda (closes over a local or `this`) is a new instance per evaluation. Common trap: +`map.computeIfAbsent(k, k -> compute())` allocates the lambda on *every* call including cache hits +where it is never invoked. Fix: `get` first, `computeIfAbsent` only on miss. + +**`Optional` and primitive boxing.** Any `Optional*` construction allocates per call and escapes. +Autoboxing outside the JVM cache range ([-128, 127] for `Integer`/`Long`) likewise. Fix: null +checks, primitive return values, or fixed-arity overloads. + +*Examples (patterns from back-test calibration):* +- Capturing lambdas allocated per-span to register per-request callbacks. Allocation + accepted: it buys correctness (fixes a span leak). Cost nominates; the do-no-harm hierarchy + adjudicates. +- A per-instance `TagValue` on a per-trace path — the same shape as the regex and format-string + cases above. + +--- + +## 4. Wrong Collection Type (SEV-2/3) + +Three-step ladder: `LinkedHashMap → HashMap → POJO/record`. Lighter wins. + +**`LinkedHashMap` when order isn't relied on.** ~16 B extra per entry + doubly-linked list +maintenance on every put/remove. Only justified when iteration order is required (insertion-order) +or for LRU (`accessOrder` + `removeEldestEntry`). Fix: `HashMap`. + +**`HashMap` for a fixed, small, known key set.** Pays hashing, boxing, and `Entry` object overhead +per lookup. Fix: a plain record or value class — denser, EA-scalar-replaceable when non-escaping, +type-safe. A 5-line record is often *easier* to write than a map. + +**Mis-sized collections.** `ArrayList` grows 1.5×; `HashMap` doubles and rehashes. Both pay +allocation + copy on growth. Fix: pre-size accurately at construction. Note: `new HashMap<>(n)` +still rehashes at 75% fill — pre-size with `new HashMap<>((int) (n / 0.75f) + 1)` (Java 8-safe); `HashMap.newHashMap(n)` is cleaner but only where the source set is known JDK 19+. + +**Concurrency choice — nominate, don't prescribe.** Replacing `ConcurrentHashMap` with `HashMap` +on a wrong concurrency judgment introduces a data race — trading a performance overhead for a +correctness bug, descending the do-no-harm hierarchy. Frame as a question ("if this map is +thread-confined, a plain collection is cheaper — verify the access pattern"), never a directive. + +*Examples (patterns from back-test calibration):* +- A per-checkpoint `LinkedHashMap` collapsed to a record-like value type. The full + three-step collapse: eliminated per-entry `Entry` overhead, boxing, and linked-list maintenance. + ~20% throughput improvement. +- An oversized `StringBuilder(1024)` is the collection-sizing anti-pattern in a + different form. Accurate sizing, not generous sizing, is the target. + +--- + +## 5. Startup Latency (SEV-2) + +"Once per process" treats startup costs as negligible — but that breaks for serverless (cold starts +are routine), short-lived CI jobs, and deployments that track startup time. + +Flag in premain-reachable code: eager class loading, native library loads (`Native.load`), +reflection setup, config-regex compilation, eager file/network I/O, and thread creation. Fix: +defer to first-use off the hot path, or a background thread post-startup. + +Startup latency and bootstrap correctness share a lens. The bootstrap constraints (no +`java.util.logging` / `java.nio` / `javax.management` in premain) are the correctness side; +startup latency is the performance side. Both route to the platform team — not as contributor +nudges. + +*Examples:* +- `Native.load` inside a `write()` method. If reached on the startup path, it's a + present startup-latency cost (loading libc + building the JNA proxy), not just a latent one. +- **Instrumentation static initializers** — any static field initialization in an `Instrumenter` + subclass that triggers class loading or I/O on first reference is premain-reachable. + +--- + +## 6. Domain-Adjusted Severity + +**Large-denominator domains.** LLMObs, CI Visibility, DSM instrument large units of work (LLM +calls 500 ms+, Spark jobs seconds–minutes, CI test steps milliseconds–minutes). Per-"span" +CPU/alloc severity collapses. But the risk *inverts*: payload memory (large prompts, job metadata, +accumulated output) becomes SEV-1. A CPU-weighted reviewer flags the wrong things and misses the +real one. + +**Streaming handlers — large-denominator rule suspends at the chunk level.** The per-call +denominator applies to costs that fire once per call. Costs inside a streaming handler fire +per-chunk — SSE, chunked HTTP, gRPC streaming can produce hundreds of events per response. An +unbounded accumulator inside a streaming handler (buffering all chunks until stream close) is +SEV-1 regardless of how slow the overall stream is. + +**AppSec sub-domain split.** The WAF blocking path fires only when a block action is triggered — +genuinely cold, SILENT. The IAST taint/sink Reporter can fire frequently during an active security +scan. Treat stream usage and per-call allocations on the IAST Reporter path as SOFT-ALERT, not +cold. Do not apply "AppSec = cold" uniformly across AppSec sub-products. + +*Examples:* +- An LLMObs 5 MB mapper buffer. Same "big buffer" shape as the oversized `StringBuilder` + above, *opposite verdict*: the large-denominator (500 ms+ LLM call) absorbs the cost. + The right call was to accept it. +- An LLMObs streaming helper that accumulated all SSE chunks into an `ArrayList` held + until stream close. The large-denominator rule would have suppressed this; the chunk-level + carve-out catches it: SEV-1, regardless of stream duration. + +--- + +*Companion references in this skill: `checks.md` (the full check list + confidence/severity cost-model + Java addendum) · `example-review.md` (a worked review to calibrate output).* diff --git a/.agents/skills/review-groovy-migration/SKILL.md b/.agents/skills/review-groovy-migration/SKILL.md new file mode 100644 index 00000000000..31f5682fdcb --- /dev/null +++ b/.agents/skills/review-groovy-migration/SKILL.md @@ -0,0 +1,124 @@ +--- +name: review-groovy-migration +description: > + Post-migration quality review. Checks Java test files produced by migrate-groovy-to-java + against the shared quality rules. Use after migration, or on any branch with recently + migrated .java test files. Produces structured FINDING blocks grouped by severity, + then offers to auto-fix BLOCKERs and WARNINGs. +--- + +Review migrated Java test files against the quality rules. + +## Step 1 — Load rules + +Read `.claude/skills/migrate-groovy-to-java/QUALITY_RULES.md` in full before proceeding. + +## Step 2 — Identify target files + +If the user specified files or a module path, use those. Otherwise, find files added on the current branch: + +```bash +MERGE_BASE=$(git merge-base HEAD origin/master 2>/dev/null || git merge-base HEAD master) +git diff "$MERGE_BASE" --name-only --diff-filter=A | grep 'src/test/java.*\.java$' +``` + +If no files are found, fall back to modified test files: + +```bash +git diff "$MERGE_BASE" --name-only | grep 'src/test/java.*\.java$' +``` + +## Step 3 — Run grep-based detection + +For each rule with a grep `Detection` pattern, run it over the target files. Use the patterns from the rules file. The patterns below assume GNU/`ugrep`-compatible regex (`\b`, `\.`); alternation uses `grep -E "...|..."` so it also works under BSD grep — adapt if your `grep` differs. + +```bash +# RULE-C01 (also fires on RULE-C02 lines — see dedup note below) +grep -rn "assertTrue(.*instanceof" + +# RULE-C02 (more specific than C01) +grep -rEn "assertTrue\(.*== *null.*instanceof|assertTrue\(.*instanceof.*== *null" + +# RULE-F01 (BLOCKER, but verify context — see note below) +# Run as three separate greps: word boundaries (\b) combined with | alternation +# misbehave under some grep builds, so do not merge these into one alternation. +grep -rEn "\bint\b.*[Ss]ampling[Pp]riority" +grep -rEn "\bint\b.*\bpriority\b" +grep -rEn "\bint\b.*\bmechanism\b" + +# RULE-A02 +grep -rn '@WithConfig(key = "' + +# RULE-B01 +grep -rn "new LinkedHashMap<>()" + +# RULE-C04 +grep -rn "\.getTags()\.get(" + +# RULE-C05 (BLOCKER, but verify context — see note below) +# A matcher is only legitimate for genuinely non-deterministic values; otherwise it +# silently relaxes an assertion the Groovy original pinned. Cross-check the Groovy source. +grep -rEn "any\(\)|anyInt\(\)|anyLong\(\)|anyString\(\)|anyByte\(\)|anyBoolean\(\)|atLeastOnce\(\)" + +# RULE-D01 +grep -rn "mock(.*Map.*\.class)" + +# RULE-G01 +grep -rn "/\* [a-z]" + +# RULE-G02 +grep -rEn "\(\) -> [a-zA-Z]+\.[a-zA-Z]+\(\)" + +# RULE-G05 (verify context — only when close() is the finally's sole statement and there +# is no surrounding logic requiring an explicit close; read the block before flagging) +grep -rEn "\} finally \{" + +# RULE-H01 +grep -rEn "'18446744073709551[0-9]+'" + +# RULE-J02 +grep -rEn "CarrierVisitor|forEachKeyValue" +``` + +Read the full content of any file that has at least one hit, to understand the context. + +## Step 4 — Structural detection (LLM-based) + +For rules without grep patterns (RULE-A01, RULE-B02, RULE-B03, RULE-C03, RULE-E01, RULE-E02, RULE-E03, RULE-G04, RULE-H02, RULE-I01, RULE-I02), read all target files and identify violations based on the Before/After examples in the rules. + +## Step 5 — Emit structured findings + +For each issue found, emit one finding block: + +``` +FINDING + file: + line: + rule: + severity: + excerpt: + fix: +``` + +Group all findings by severity: BLOCKERs first, then WARNINGs, then STYLEs. + +At the end, print a one-line summary: + +``` +Summary: N blocker(s), M warning(s), K style issue(s) across F file(s). +``` + +If no issues are found: + +``` +No findings. All rules pass. +``` + +## Step 6 — Offer to fix + +After the summary, ask: "Fix all BLOCKERs and WARNINGs automatically? (yes / no / select rules)" + +If the user agrees: +1. Apply each fix. For each file changed, run `./gradlew spotlessApply` on its module after editing. +2. Re-run the grep checks to confirm the findings are resolved. +3. Report which findings were fixed and which (if any) require manual attention. diff --git a/.agents/skills/techdebt/SKILL.md b/.agents/skills/techdebt/SKILL.md new file mode 100644 index 00000000000..f371490b9e3 --- /dev/null +++ b/.agents/skills/techdebt/SKILL.md @@ -0,0 +1,73 @@ +--- +name: techdebt +description: >- + Review a code diff / branch / PR for technical debt — code duplication, + unnecessary complexity / over-engineering, and redundant or dead code. Use + whenever the user wants a tech-debt, cleanup, or refactor review, asks to check + a branch or PR for duplication / complexity / dead code before opening a PR, or + mentions "techdebt". Refactor-only: it reports issues and offers + behavior-preserving fixes; it never changes behavior. +user-invocable: true +context: fork +allowed-tools: + - Bash + - Read + - Grep + - Glob +--- + +# Techdebt Cleanup Skill + +Analyze changes on the current branch to identify and fix technical debt, code duplication, and unnecessary complexity. + +## Instructions + +### Step 1: Get Branch Changes + +Find the merge-base (where this branch diverged from master) and compare against it: + +```bash +# Find upstream (DataDog org repo) +UPSTREAM=$(git remote -v | grep -E 'DataDog/[^/]+(.git)?\s' | head -1 | awk '{print $1}') +if [ -z "$UPSTREAM" ]; then + echo "No DataDog upstream found, using origin" + UPSTREAM="origin" +fi + +# Find the merge-base (commit where this branch diverged from master) +MERGE_BASE=$(git merge-base HEAD ${UPSTREAM}/master) +echo "Comparing changes introduced on this branch since diverging from master using base commit: $MERGE_BASE" + +git diff $MERGE_BASE --stat +git diff $MERGE_BASE --name-status +``` + +If no changes exist, inform the user and stop. + +If changes exist, read the diff and the full content of modified source files (not test files) to understand context. + +### Step 2: Analyze for Issues + +Look for: + +**Code Duplication** +- Similar code blocks that should be extracted into shared functions +- Copy-pasted logic with minor variations + +**Unnecessary Complexity** +- Over-engineered solutions (abstractions used only once) +- Excessive indirection or layers +- Backward compatibility shims that aren't needed + +**Redundant Code** +- Dead code paths +- Overly defensive checks for impossible scenarios + +### Step 3: Report and Fix + +Present a concise summary of issues found with file:line references. + +Then ask the user if they want you to fix the issues. When fixing: +- Make one logical change at a time +- Do NOT change behavior, only refactor +- Skip trivial or stylistic issues diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index 2fd0b938e40..330db3d7fcc 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -2,5 +2,6 @@ ## Claude Code workflow -- Before creating a pull request, run `/techdebt` to check for technical debt, code duplication, and unnecessary complexity in the branch changes. +- Before creating a pull request, run the [Review Guidelines](../AGENTS.md#review-guidelines) checks over the branch changes. +- After running `/migrate-groovy-to-java`, run `/review-groovy-migration` on the migrated files before opening a PR. - Always write new unit tests using JUnit 5 and Java. If the target test file is `.groovy`, run the `/migrate-groovy-to-java` skill on it first. diff --git a/.claude/skills/add-apm-integrations/SKILL.md b/.claude/skills/add-apm-integrations/SKILL.md deleted file mode 100644 index 2b8b79486ce..00000000000 --- a/.claude/skills/add-apm-integrations/SKILL.md +++ /dev/null @@ -1,246 +0,0 @@ ---- -name: add-apm-integrations -description: Write a new library instrumentation end-to-end. Use when the user ask to add a new APM integration or a library instrumentation. -context: fork -allowed-tools: - - Bash - - Read - - Write - - Edit - - Glob - - Grep ---- - -Write a new APM end-to-end integration for dd-trace-java, based on library instrumentations, following all project conventions. - -## Step 1 – Read the authoritative docs and sync this skill (mandatory, always first) - -Before writing any code, read all three files in full: - -1. [`docs/how_instrumentations_work.md`](docs/how_instrumentations_work.md) — full reference (types, methods, advice, helpers, context stores, decorators) -2. [`docs/add_new_instrumentation.md`](docs/add_new_instrumentation.md) — step-by-step walkthrough -3. [`docs/how_to_test.md`](docs/how_to_test.md) — test types and how to run them - -These files are the single source of truth. Reference them while implementing. - -**After reading the docs, sync this skill with them:** - -Compare the content of the three docs against the rules encoded in Steps 2–11 of this skill file. Look for: -- Patterns, APIs, or conventions described in the docs but absent or incorrect here -- Steps that are out of date relative to the current docs (e.g. renamed methods, new base classes) -- Advice constraints or test requirements that have changed - -For every discrepancy found, edit this file (`.claude/skills/apm-integrations/SKILL.md`) to correct it using the -`Edit` tool before continuing. Keep changes targeted: fix what diverged, add what is missing, remove what is wrong. -Do not touch content that already matches the docs. - -## Step 2 – Clarify the task - -If the user has not already provided all of the following, ask before proceeding: - -- **Framework name** and **minimum supported version** (e.g. `okhttp-3.0`) -- **Target class(es) and method(s)** to instrument (fully qualified class names preferred) -- **Target system**: one of `Tracing`, `Profiling`, `AppSec`, `Iast`, `CiVisibility`, `Usm`, `ContextTracking` -- **Whether this is a bootstrap instrumentation** (affects allowed imports) - -## Step 3 – Find a reference instrumentation - -Search `dd-java-agent/instrumentation/` for a structurally similar integration: -- Same target system -- Comparable type-matching strategy (single type, hierarchy, known types) - -Read the reference integration's `InstrumenterModule`, Advice, Decorator, and test files to understand the established -pattern before writing new code. Use it as a template. - -## Step 4 – Set up the module - -1. Create directory: `dd-java-agent/instrumentation/$framework/$framework-$minVersion/` -2. Under it, create the standard Maven source layout: - - `src/main/java/` — instrumentation code - - `src/test/groovy/` — Spock tests -3. Create `build.gradle` with: - - `compileOnly` dependencies for the target framework - - `testImplementation` dependencies for tests - - `muzzle { pass { } }` directives (see Step 9) -4. Register the new module in `settings.gradle.kts` in **alphabetical order** - -## Step 5 – Write the InstrumenterModule - -Conventions to enforce: - -- Add `@AutoService(InstrumenterModule.class)` annotation — required for auto-discovery -- Extend the correct `InstrumenterModule.*` subclass (never the bare abstract class) -- Implement the **narrowest** `Instrumenter` interface possible: - - Prefer `ForSingleType` > `ForKnownTypes` > `ForTypeHierarchy` -- Add `classLoaderMatcher()` if a sentinel class identifies the framework on the classpath -- Declare **all** helper class names in `helperClassNames()`: - - Include inner classes (`Foo$Bar`), anonymous classes (`Foo$1`), and enum synthetic classes -- Declare `contextStore()` entries if context stores are needed (key class → value class) -- Keep method matchers as narrow as possible (name, parameter types, visibility) - -### Must NOT do in InstrumenterModule - -- **Do not extract one-shot method return values into static constants.** - Methods like `triggerClasses()`, `contextStore()`, `classLoaderMatcher()`, and `methodAdvice()` - are called **once** by `AgentInstaller` / the framework wiring. Extracting their return value - into a `private static final` constant provides no performance benefit and needlessly bloats - the constant pool of the instrumentation class. - - ❌ `private static final String[] TRIGGER_CLASSES = new String[]{"com.example.Foo"};` - `public String[] triggerClasses() { return TRIGGER_CLASSES; }` - - ✅ `public String[] triggerClasses() { return new String[]{"com.example.Foo"}; }` - -## Step 6 – Write the Decorator - -- Extend the most specific available base decorator: - - `HttpClientDecorator`, `DatabaseClientDecorator`, `ServerDecorator`, `MessagingClientDecorator`, etc. -- One `public static final DECORATE` instance -- Define `UTF8BytesString` constants for the component name and operation name -- Keep all tag/naming/error logic here — not in the Advice class -- Override `spanType()`, `component()`, `spanKind()` as appropriate - -## Step 7 – Write the Advice class (highest-risk step) - -### Must do - -- Advice methods **must** be `static` -- Annotate enter: `@Advice.OnMethodEnter(suppress = Throwable.class)` -- Annotate exit: `@Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)` - - **Exception**: do NOT use `suppress` when hooking a constructor -- Use `@Advice.Local("...")` for values shared between enter and exit (span, scope) -- Use the correct parameter annotations: - - `@Advice.This` — the receiver object - - `@Advice.Argument(N)` — a method argument by index - - `@Advice.Return` — the return value (exit only) - - `@Advice.Thrown` — the thrown exception (exit only) - - `@Advice.Enter` — the return value of the enter method (exit only) -- Use `CallDepthThreadLocalMap` to guard against recursive instrumentation of the same method - -### Span lifecycle (in order) - -Enter method: -1. `AgentSpan span = startSpan(DECORATE.operationName(), ...)` -2. `DECORATE.afterStart(span)` + set domain-specific tags -3. `AgentScope scope = activateSpan(span)` — return or store via `@Advice.Local` - -Exit method: -4. `DECORATE.onError(span, throwable)` — only if throwable is non-null -5. `DECORATE.beforeFinish(span)` -6. `span.finish()` -7. `scope.close()` - -### Must NOT do - -- **No logger fields** in the Advice class or the Instrumentation class (loggers only in helpers/decorators) -- **No code in the Advice constructor** — it is never called -- **Do not use lambdas in advice methods** — they create synthetic classes that will be missing from helper declarations -- **No references** to other methods in the same Advice class or in the InstrumenterModule class -- **No `InstrumentationContext.get()`** outside of Advice code -- **No `inline=false`** in production code (only for debugging; must be removed before committing) -- **No `java.util.logging.*`, `java.nio.*`, or `javax.management.*`** in bootstrap instrumentations - -## Step 8 – Add SETTER/GETTER adapters (if applicable) - -For context propagation to and from upstream services, like HTTP headers, -implement `AgentPropagation.Setter` / `AgentPropagation.Getter` adapters that wrap the framework's specific header API. -Place them in the helpers package, declare them in `helperClassNames()`. - -## Step 9 – Write tests - -Cover all mandatory test types: - -### 1. Instrumentation test (mandatory) - -- Spock spec extending `InstrumentationSpecification` -- Place in `src/test/groovy/` -- Verify: spans created, tags set, errors propagated, resource names correct -- Use `TEST_WRITER.waitForTraces(N)` for assertions -- Use `runUnderTrace("root") { ... }` for synchronous code - -For tests that need a separate JVM, suffix the test class with `ForkedTest` and run via the `forkedTest` task. - -### 2. Muzzle directives (mandatory) - -In `build.gradle`, add `muzzle` blocks: -```groovy -muzzle { - pass { - group = "com.example" - module = "framework" - versions = "[$minVersion,)" - assertInverse = true // ensures versions below $minVersion fail muzzle - } -} -``` - -### 3. Latest dependency test (mandatory) - -Use the `latestDepTestLibrary` helper in `build.gradle` to pin the latest available version. Run with: -```bash -./gradlew :dd-java-agent:instrumentation:$framework-$version:latestDepTest -``` - -### 4. Smoke test (optional) - -Add a smoke test in `dd-smoke-tests/` only if the framework warrants a full end-to-end demo-app test. - -## Step 10 – Build and verify - -Run these commands in order and fix any failures before proceeding: - -```bash -./gradlew :dd-java-agent:instrumentation:$framework-$version:muzzle -./gradlew :dd-java-agent:instrumentation:$framework-$version:test -./gradlew :dd-java-agent:instrumentation:$framework-$version:latestDepTest -./gradlew spotlessCheck -``` - -**If muzzle fails:** check for missing helper class names in `helperClassNames()`. - -**If tests fail:** verify span lifecycle order (start → activate → error → finish → close), helper registration, -and `contextStore()` map entries match actual usage. - -**If spotlessCheck fails:** run `./gradlew spotlessApply` to auto-format, then re-check. - -## Step 11 – Checklist before finishing - -Output this checklist and confirm each item is satisfied: - -- [ ] `settings.gradle.kts` entry added in alphabetical order -- [ ] `build.gradle` has `compileOnly` deps and `muzzle` directives with `assertInverse = true` -- [ ] `@AutoService(InstrumenterModule.class)` annotation present on the module class -- [ ] `helperClassNames()` lists ALL referenced helpers (including inner, anonymous, and enum synthetic classes) -- [ ] Advice methods are `static` with `@Advice.OnMethodEnter` / `@Advice.OnMethodExit` annotations -- [ ] `suppress = Throwable.class` on enter/exit (unless the hooked method is a constructor) -- [ ] No static constants holding return values of one-shot instrumenter methods (`triggerClasses()`, `contextStore()`, etc.) -- [ ] No logger field in the Advice class or InstrumenterModule class -- [ ] No `inline=false` left in production code -- [ ] No `java.util.logging.*` / `java.nio.*` / `javax.management.*` in bootstrap path -- [ ] Span lifecycle order is correct: startSpan → afterStart → activateSpan (enter); onError → beforeFinish → finish → close (exit) -- [ ] Muzzle passes -- [ ] Instrumentation tests pass -- [ ] `latestDepTest` passes -- [ ] `spotlessCheck` passes - -## Step 12 – Retrospective: update this skill with what was learned - -After the instrumentation is complete (or abandoned), review the full session and improve this skill for future use. - -**Collect lessons from four sources:** - -1. **Build/test failures** — did any Gradle task fail with an error that this skill did not anticipate or gave wrong - guidance for? (e.g. a muzzle failure that wasn't caused by missing helpers, a test pattern that didn't work) -2. **Docs vs. skill gaps** — did Step 1's sync miss anything? Did you consult the docs for something not captured here? -3. **Reference instrumentation insights** — did the reference integration use a pattern, API, or convention not - reflected in any step of this skill? -4. **User corrections** — did the user correct an output, override a decision, or point out a mistake? - -**For each lesson identified**, edit this file (`.claude/skills/apm-integrations/SKILL.md`) using the `Edit` tool: -- Wrong rule → fix it in place -- Missing rule → add it to the most relevant step -- Wrong failure guidance → update the relevant "If X fails" section in Step 10 -- Misleading or obsolete content → remove it - -Keep each change minimal and targeted. Do not rewrite sections that worked correctly. -After editing, confirm to the user which improvements were made to the skill. diff --git a/.claude/skills/apm-integrations b/.claude/skills/apm-integrations new file mode 120000 index 00000000000..89f300ce53a --- /dev/null +++ b/.claude/skills/apm-integrations @@ -0,0 +1 @@ +../../.agents/skills/apm-integrations \ No newline at end of file diff --git a/.claude/skills/migrate-groovy-to-java b/.claude/skills/migrate-groovy-to-java new file mode 120000 index 00000000000..9c9cfbe3f62 --- /dev/null +++ b/.claude/skills/migrate-groovy-to-java @@ -0,0 +1 @@ +../../.agents/skills/migrate-groovy-to-java \ No newline at end of file diff --git a/.claude/skills/migrate-groovy-to-java/SKILL.md b/.claude/skills/migrate-groovy-to-java/SKILL.md deleted file mode 100644 index 71a197a5413..00000000000 --- a/.claude/skills/migrate-groovy-to-java/SKILL.md +++ /dev/null @@ -1,60 +0,0 @@ ---- -name: migrate-groovy-to-java -description: > - Converts Spock/Groovy test files in a Gradle module to equivalent JUnit 5 Java tests. - Use when asked to "migrate groovy", "convert groovy to java", "g2j", or when a module - has .groovy test files that need to be replaced with .java equivalents. ---- - -Migrate test Groovy files to Java using JUnit 5 - -1. List all Groovy files of the current Gradle module -2. Convert Groovy files to Java using JUnit 5 -3. Make sure the tests are still passing after migration and that the test count has not changed -4. Remove Groovy files - -When converting Groovy code to Java code, make sure that: -- The Java code generated is compatible with JDK 8 -- When translating Spock tests, prefer `@TableTest` for data rows that are naturally tabular. See detailed guidance in the "TableTest usage" section. -- `@TableTest` and `@MethodSource` may be combined on the same `@ParameterizedTest` when most cases are tabular but a few cases require programmatic setup. -- In combined mode, keep table-friendly cases in `@TableTest`, and put only non-tabular/complex cases in `@MethodSource`. -- If `@TableTest` is not viable for the test at all, use `@MethodSource` only. -- If `@TableTest` was successfully used and if the `@ParameterizedTest` is not used to specify the test name, `@ParameterizedTest` can then be removed as `@TableTest` replace it fully. -- For `@MethodSource`, name the arguments method `Arguments` (camelCase, e.g. `testMethodArguments`) and return `Stream` using `Stream.of(...)` and `arguments(...)` with static import. -- Ensure parameterized test names are human-readable (i.e. no hashcodes); instead add a description string as the first `Arguments.arguments(...)` value or index the test case -- When converting tuples, create a light dedicated structure instead to keep the typing system -- Instead of checking a state and throwing an exception, use JUnit asserts -- Instead of using `assertTrue(a.equals(b))` or `assertFalse(a.equals(b))`, use `assertEquals(expected, actual)` and `assertNotEquals(unexpected, actual)` -- Import frequently used types rather than using fully-qualified names inline, to improve readability -- Do not wrap checked exceptions and throw a Runtime exception; prefer adding a throws clause at method declaration -- Do not mark local variables `final` -- Ensure variables are human-readable; avoid single-letter names and pre-define variables that are referenced multiple times -- When translating Spock `Mock(...)` usage, use `libs.bundles.mockito` instead of writing manual recording/stub implementations - -TableTest usage - Import: `import org.tabletest.junit.TableTest;` - - JDK 8 rules: - - No text blocks. - - @TableTest must use String[] annotation array syntax: - ``` - @TableTest({ - "a | b", - "1 | 2" - }) - ``` - - Spock `where:` → @TableTest: - - First row = header (column names = method parameters). - - Add `scenario` column as first column (display name, not a method parameter). - - Use `|` delimiter; align columns so pipes line up vertically. - - Prefer single quotes for strings with special chars (e.g., `'a|b'`, `'[]'`). - - Blank cell = null (object types); `''` = empty string. - - Collections: `[a, b]` = List/array, `{a, b}` = Set, `[k: v]` = Map. - - Mixed eligibility: - - Prefer combining `@TableTest` + `@MethodSource` on one `@ParameterizedTest` when only some cases are complex. - - Use `@MethodSource` only when tabular representation is not practical for the test. - - Do NOT use @TableTest when: - - Majority of rows require complex objects or custom converters. diff --git a/.claude/skills/migrate-junit-source-to-tabletest b/.claude/skills/migrate-junit-source-to-tabletest new file mode 120000 index 00000000000..e6e828679b7 --- /dev/null +++ b/.claude/skills/migrate-junit-source-to-tabletest @@ -0,0 +1 @@ +../../.agents/skills/migrate-junit-source-to-tabletest \ No newline at end of file diff --git a/.claude/skills/perf-review b/.claude/skills/perf-review new file mode 120000 index 00000000000..60946879935 --- /dev/null +++ b/.claude/skills/perf-review @@ -0,0 +1 @@ +../../.agents/skills/perf-review \ No newline at end of file diff --git a/.claude/skills/review-groovy-migration b/.claude/skills/review-groovy-migration new file mode 120000 index 00000000000..12d03bb6ebc --- /dev/null +++ b/.claude/skills/review-groovy-migration @@ -0,0 +1 @@ +../../.agents/skills/review-groovy-migration \ No newline at end of file diff --git a/.claude/skills/techdebt b/.claude/skills/techdebt new file mode 120000 index 00000000000..673cef85d58 --- /dev/null +++ b/.claude/skills/techdebt @@ -0,0 +1 @@ +../../.agents/skills/techdebt \ No newline at end of file diff --git a/.claude/skills/techdebt/SKILL.md b/.claude/skills/techdebt/SKILL.md deleted file mode 100644 index 6929e6e2240..00000000000 --- a/.claude/skills/techdebt/SKILL.md +++ /dev/null @@ -1,67 +0,0 @@ ---- -name: techdebt -description: Analyze branch changes for technical debt, code duplication, and unnecessary complexity -user-invocable: true -context: fork -allowed-tools: - - Bash - - Read - - Grep - - Glob ---- - -# Techdebt Cleanup Skill - -Analyze changes on the current branch to identify and fix technical debt, code duplication, and unnecessary complexity. - -## Instructions - -### Step 1: Get Branch Changes - -Find the merge-base (where this branch diverged from master) and compare against it: - -```bash -# Find upstream (DataDog org repo) -UPSTREAM=$(git remote -v | grep -E 'DataDog/[^/]+(.git)?\s' | head -1 | awk '{print $1}') -if [ -z "$UPSTREAM" ]; then - echo "No DataDog upstream found, using origin" - UPSTREAM="origin" -fi - -# Find the merge-base (commit where this branch diverged from master) -MERGE_BASE=$(git merge-base HEAD ${UPSTREAM}/master) -echo "Comparing changes introduced on this branch since diverging from master using base commit: $MERGE_BASE" - -git diff $MERGE_BASE --stat -git diff $MERGE_BASE --name-status -``` - -If no changes exist, inform the user and stop. - -If changes exist, read the diff and the full content of modified source files (not test files) to understand context. - -### Step 2: Analyze for Issues - -Look for: - -**Code Duplication** -- Similar code blocks that should be extracted into shared functions -- Copy-pasted logic with minor variations - -**Unnecessary Complexity** -- Over-engineered solutions (abstractions used only once) -- Excessive indirection or layers -- Backward compatibility shims that aren't needed - -**Redundant Code** -- Dead code paths -- Overly defensive checks for impossible scenarios - -### Step 3: Report and Fix - -Present a concise summary of issues found with file:line references. - -Then ask the user if they want you to fix the issues. When fixing: -- Make one logical change at a time -- Do NOT change behavior, only refactor -- Skip trivial or stylistic issues diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 8efd03d9498..23754123bce 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -21,6 +21,10 @@ /dd-smoke-tests/vertx-*/ @DataDog/apm-idm-java /dd-smoke-tests/wildfly/ @DataDog/apm-idm-java +# @DataDog/apm-release-platform +/.gitlab/ @DataDog/apm-release-platform @DataDog/apm-lang-platform-java +/.gitlab-ci.yml @DataDog/apm-release-platform @DataDog/apm-lang-platform-java + # @DataDog/apm-sdk-capabilities-java /dd-java-agent/agent-otel @DataDog/apm-sdk-capabilities-java /dd-smoke-tests/log-injection @DataDog/apm-sdk-capabilities-java @@ -52,8 +56,6 @@ # @DataDog/apm-lang-platform-java /.github/ @DataDog/apm-lang-platform-java -/.gitlab/ @DataDog/apm-lang-platform-java -/.gitlab-ci.yml @DataDog/apm-lang-platform-java /benchmark/ @DataDog/apm-lang-platform-java /components/ @DataDog/apm-lang-platform-java /dd-java-agent/instrumentation/java/ @DataDog/apm-lang-platform-java @@ -63,6 +65,7 @@ /remote-config/ @DataDog/apm-lang-platform-java /telemetry/ @DataDog/apm-lang-platform-java /test-published-dependencies/ @DataDog/apm-lang-platform-java +/repository.datadog.yaml @DataDog/apm-lang-platform-java # @DataDog/asm-java (AppSec/IAST) /buildSrc/call-site-instrumentation-plugin/ @DataDog/asm-java @@ -87,6 +90,8 @@ /dd-trace-api/src/main/java/datadog/trace/api/EventTracker.java @DataDog/asm-java /internal-api/src/main/java/datadog/trace/api/gateway/ @DataDog/asm-java /internal-api/src/main/java/datadog/trace/api/http/ @DataDog/asm-java +/internal-api/src/main/java/datadog/trace/api/telemetry/ScaReachability* @DataDog/asm-java +/telemetry/src/main/java/datadog/telemetry/sca/ @DataDog/asm-java **/appsec/ @DataDog/asm-java **/*CallSite*.java @DataDog/asm-java **/*CallSite*.groovy @DataDog/asm-java @@ -105,7 +110,8 @@ /dd-java-agent/instrumentation/cucumber-5.4/ @DataDog/ci-app-libraries /dd-java-agent/instrumentation/jacoco-0.8.9/ @DataDog/ci-app-libraries /dd-java-agent/instrumentation/junit @DataDog/ci-app-libraries -/dd-java-agent/instrumentation/karate-1.0/ @DataDog/ci-app-libraries +/dd-java-agent/instrumentation/karate/ @DataDog/ci-app-libraries +/dd-java-agent/instrumentation/robolectric-4.13/ @DataDog/ci-app-libraries /dd-java-agent/instrumentation/scalatest-3.0.8/ @DataDog/ci-app-libraries /dd-java-agent/instrumentation/selenium-3.13/ @DataDog/ci-app-libraries /dd-java-agent/instrumentation/testng/ @DataDog/ci-app-libraries diff --git a/.github/ISSUE_TEMPLATE/bug_report.yaml b/.github/ISSUE_TEMPLATE/bug_report.yaml index d52534af831..f3802086e3f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -1,6 +1,6 @@ name: "Bug Report (Low Priority)" -description: "Create a public Bug Report. Note that these may not be addressed as it depeonds on capacity and that looking up account information will be difficult." -labels: "type: bug" +description: "Create a public Bug Report. Note that these may not be addressed, as it depends on capacity and that looking up account information may be difficult." +labels: "type: bug report" body: - type: input attributes: diff --git a/.github/chainguard/self.check-pull-request-labels.sts.yaml b/.github/chainguard/self.check-pull-request-labels.sts.yaml new file mode 100644 index 00000000000..03edc6a9a7d --- /dev/null +++ b/.github/chainguard/self.check-pull-request-labels.sts.yaml @@ -0,0 +1,11 @@ +issuer: https://token.actions.githubusercontent.com + +subject: repo:DataDog/dd-trace-java:pull_request + +claim_pattern: + event_name: pull_request + job_workflow_ref: DataDog/dd-trace-java/\.github/workflows/check-pull-request-labels\.yaml@refs/(pull/[0-9]+/merge|heads/.+) + +permissions: + issues: write + pull_requests: write diff --git a/.github/chainguard/self.check-pull-requests.sts.yaml b/.github/chainguard/self.check-pull-requests.sts.yaml new file mode 100644 index 00000000000..4a3a695040f --- /dev/null +++ b/.github/chainguard/self.check-pull-requests.sts.yaml @@ -0,0 +1,11 @@ +issuer: https://token.actions.githubusercontent.com + +subject: repo:DataDog/dd-trace-java:pull_request + +claim_pattern: + event_name: pull_request + job_workflow_ref: DataDog/dd-trace-java/\.github/workflows/check-pull-requests\.yaml@refs/(pull/[0-9]+/merge|heads/.+) + +permissions: + issues: write + pull_requests: write diff --git a/.github/chainguard/self.comment-on-submodule-update.sts.yaml b/.github/chainguard/self.comment-on-submodule-update.sts.yaml new file mode 100644 index 00000000000..0834b81b012 --- /dev/null +++ b/.github/chainguard/self.comment-on-submodule-update.sts.yaml @@ -0,0 +1,11 @@ +issuer: https://token.actions.githubusercontent.com + +subject: repo:DataDog/dd-trace-java:pull_request + +claim_pattern: + event_name: pull_request + job_workflow_ref: DataDog/dd-trace-java/\.github/workflows/comment-on-submodule-update\.yaml@refs/(pull/[0-9]+/merge|heads/.+) + +permissions: + issues: write + pull_requests: write diff --git a/.github/chainguard/self.enforce-groovy-migration.sts.yaml b/.github/chainguard/self.enforce-groovy-migration.sts.yaml new file mode 100644 index 00000000000..2eb01b85b91 --- /dev/null +++ b/.github/chainguard/self.enforce-groovy-migration.sts.yaml @@ -0,0 +1,12 @@ +issuer: https://token.actions.githubusercontent.com + +subject: repo:DataDog/dd-trace-java:pull_request + +claim_pattern: + event_name: pull_request + job_workflow_ref: DataDog/dd-trace-java/\.github/workflows/enforce-groovy-migration\.yaml@refs/(pull/[0-9]+/merge|heads/.+) + +permissions: + contents: read + issues: write + pull_requests: write diff --git a/.github/chainguard/self.gitlab.release.sts.yaml b/.github/chainguard/self.gitlab.release.sts.yaml index 74ee1b28899..fcf34ec47aa 100644 --- a/.github/chainguard/self.gitlab.release.sts.yaml +++ b/.github/chainguard/self.gitlab.release.sts.yaml @@ -1,11 +1,11 @@ issuer: https://gitlab.ddbuild.io -subject_pattern: "project_path:DataDog/apm-reliability/dd-trace-java:ref_type:tag:ref:v.*" +subject_pattern: 'project_path:DataDog/apm-reliability/dd-trace-java:ref_type:tag:ref:v\d+\.\d+\.\d+' claim_pattern: project_path: "DataDog/apm-reliability/dd-trace-java" ref_type: "tag" - ref: "v.*" + ref: 'v\d+\.\d+\.\d+' permissions: contents: "write" diff --git a/.github/chainguard/self.update-issues-on-release.sts.yaml b/.github/chainguard/self.update-issues-on-release.sts.yaml new file mode 100644 index 00000000000..b35039044d8 --- /dev/null +++ b/.github/chainguard/self.update-issues-on-release.sts.yaml @@ -0,0 +1,10 @@ +issuer: https://token.actions.githubusercontent.com + +subject_pattern: "repo:DataDog/dd-trace-java:ref:refs/(heads|tags)/.*" + +claim_pattern: + event_name: (release|workflow_dispatch) + job_workflow_ref: DataDog/dd-trace-java/\.github/workflows/update-issues-on-release\.yaml@refs/(heads/.*|tags/.*) + +permissions: + issues: write diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 143febaaeb0..d610f967de5 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -36,3 +36,14 @@ updates: prefix: 'chore(build): ' cooldown: default-days: 2 + + - package-ecosystem: gitsubmodule + directory: / + schedule: + interval: weekly + allow: + - dependency-name: dd-smoke-tests/openfeature/src/test/resources/ffe-system-test-data + labels: + - 'comp: openfeature' + - 'tag: dependencies' + - 'tag: no release notes' diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index c4c494c58b1..9072d07510d 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -12,11 +12,10 @@ Use `solves` instead, and assign the PR [milestone](https://github.com/DataDog/dd-trace-java/milestones) to the issue - Update the [CODEOWNERS](https://github.com/DataDog/dd-trace-java/blob/master/.github/CODEOWNERS) file on source file addition, migration, or deletion - Update [public documentation](https://docs.datadoghq.com/tracing/trace_collection/library_config/java/) with any new configuration flags or behaviors +- Once approved, [use merge queue](https://github.com/DataDog/dd-trace-java/blob/master/CONTRIBUTING#merge-queue) to merge the PR Jira ticket: [PROJ-IDENT] -***Note:*** **Once your PR is ready to merge, add it to the merge queue by commenting `/merge`.** `/merge -c` cancels the queue request. `/merge -f --reason "reason"` skips all merge queue checks; please use this judiciously, as some checks do not run at the PR-level. For more information, see [this doc](https://datadoghq.atlassian.net/wiki/spaces/DEVX/pages/3121612126/MergeQueue). - ' @@ -47,9 +54,9 @@ jobs: // Check for override label — skip all checks if label present const labels = context.payload.pull_request.labels.map(l => l.name) - if (labels.includes('tag: override-groovy-enforcement')) { + if (labels.includes('tag: override groovy enforcement')) { await deleteManagedComment() - console.log('tag: override-groovy-enforcement label detected — skipping all checks.') + console.log('tag: override groovy enforcement label detected — skipping all checks.') return } @@ -92,7 +99,7 @@ jobs: `Please avoid introducing new \`.groovy\` files to this repository.\n\n` + `${fileList}\n\n` + `Instead, rewrite the new file(s) in Java / JUnit. See the [How to Test With JUnit Guide](https://github.com/DataDog/dd-trace-java/blob/master/docs/how_to_test_with_junit.md) for more details.\n\n` + - `If this PR needs an exception, add the \`tag: override-groovy-enforcement\` label to bypass this workflow.\n\n` + + `If this PR needs an exception, add the \`tag: override groovy enforcement\` label to bypass this workflow.\n\n` + managedMarker if (existingComment) { await github.rest.issues.updateComment({ @@ -118,5 +125,5 @@ jobs: } if (introducedGroovy.length > 0) { - core.setFailed(`${introducedGroovy.length} new Groovy file(s) detected. See PR comment for details. To bypass this workflow, add the 'tag: override-groovy-enforcement' label.`) + core.setFailed(`${introducedGroovy.length} new Groovy file(s) detected. See PR comment for details. To bypass this workflow, add the 'tag: override groovy enforcement' label.`) } diff --git a/.github/workflows/prune-old-pull-requests.yaml b/.github/workflows/prune-old-pull-requests.yaml index e5633a39415..db92774ea0c 100644 --- a/.github/workflows/prune-old-pull-requests.yaml +++ b/.github/workflows/prune-old-pull-requests.yaml @@ -13,7 +13,7 @@ jobs: pull-requests: write steps: - name: Prune old pull requests - uses: actions/stale@b5d41d4e1d5dceea10e7104786b73624c18a190f # v10.2.0 + uses: actions/stale@eb5cf3af3ac0a1aa4c9c45633dd1ae542a27a899 # v10.3.0 with: days-before-stale: -1 # Disable general stale bot days-before-pr-stale: 90 # Only enable stale bot for PRs with no activity for 90 days diff --git a/.github/workflows/run-system-tests.yaml b/.github/workflows/run-system-tests.yaml index 2c441f495de..26160736564 100644 --- a/.github/workflows/run-system-tests.yaml +++ b/.github/workflows/run-system-tests.yaml @@ -24,13 +24,13 @@ jobs: group: APM Larger Runners steps: - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # 7.0.0 with: submodules: 'recursive' fetch-depth: 0 - name: Cache Gradle dependencies - uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5 + uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: | ~/.gradle/caches diff --git a/.github/workflows/tests/check-pull-requests/payload-pull-request-instrumentation.json b/.github/workflows/tests/check-pull-requests/payload-pull-request-instrumentation.json index 9ea97e145c6..456af8fbecc 100644 --- a/.github/workflows/tests/check-pull-requests/payload-pull-request-instrumentation.json +++ b/.github/workflows/tests/check-pull-requests/payload-pull-request-instrumentation.json @@ -7,7 +7,7 @@ "name": "inst: java" }, { - "name": "type: bug" + "name": "type: bug fix" } ], "title": "Adding some new features", diff --git a/.github/workflows/tests/check-pull-requests/payload-pull-request-linking-issue.json b/.github/workflows/tests/check-pull-requests/payload-pull-request-linking-issue.json index 1d4b389883b..f3cba15977a 100644 --- a/.github/workflows/tests/check-pull-requests/payload-pull-request-linking-issue.json +++ b/.github/workflows/tests/check-pull-requests/payload-pull-request-linking-issue.json @@ -7,7 +7,7 @@ "name": "comp: api" }, { - "name": "type: enhancement" + "name": "type: feature" } ], "title": "Adding some new features", diff --git a/.github/workflows/tests/check-pull-requests/payload-pull-request-title-tag.json b/.github/workflows/tests/check-pull-requests/payload-pull-request-title-tag.json index 0ba19508205..0a493bb2c9e 100644 --- a/.github/workflows/tests/check-pull-requests/payload-pull-request-title-tag.json +++ b/.github/workflows/tests/check-pull-requests/payload-pull-request-title-tag.json @@ -7,7 +7,7 @@ "name": "comp: api" }, { - "name": "type: enhancement" + "name": "type: feature" } ], "title": "[API] Adding some new features", diff --git a/.github/workflows/tests/check-pull-requests/payload-pull-request.json b/.github/workflows/tests/check-pull-requests/payload-pull-request.json index 38c55efb94e..a6a3c98f545 100644 --- a/.github/workflows/tests/check-pull-requests/payload-pull-request.json +++ b/.github/workflows/tests/check-pull-requests/payload-pull-request.json @@ -7,7 +7,7 @@ "name": "comp: api" }, { - "name": "type: enhancement" + "name": "type: feature" } ], "title": "Adding some new features", diff --git a/.github/workflows/update-gradle-dependencies.yaml b/.github/workflows/update-gradle-dependencies.yaml index 001c5b38d4e..6e8f80f983b 100644 --- a/.github/workflows/update-gradle-dependencies.yaml +++ b/.github/workflows/update-gradle-dependencies.yaml @@ -8,6 +8,8 @@ jobs: update-gradle-dependencies: runs-on: ubuntu-latest name: Update Gradle dependencies + env: + MIN_DEPENDENCY_AGE_HOURS: 48 permissions: contents: read id-token: write # Required for OIDC token federation @@ -19,11 +21,11 @@ jobs: policy: self.update-gradle-dependencies.create-pr - name: Checkout repository - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # 6.0.2 + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # 7.0.0 with: submodules: "recursive" - - uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0 + - uses: actions/setup-java@1bcf9fb12cf4aa7d266a90ae39939e61372fe520 # v5.4.0 with: distribution: 'temurin' java-version: '21' @@ -41,6 +43,12 @@ jobs: echo "core_branch=ci/update-gradle-dependencies-${DATE}" >> $GITHUB_OUTPUT echo "instrumentation_branch=ci/update-gradle-dependencies-instrumentation-${DATE}" >> $GITHUB_OUTPUT + - name: Snapshot current Gradle lock files + run: | + rm -rf /tmp/gradle-lockfiles-before + mkdir -p /tmp/gradle-lockfiles-before + find . -name 'gradle.lockfile' -print0 | xargs -0 -r cp --parents -t /tmp/gradle-lockfiles-before/ + - name: Update Gradle dependencies env: ORG_GRADLE_PROJECT_akkaRepositoryToken: ${{ secrets.AKKA_REPO_TOKEN }} @@ -49,12 +57,33 @@ jobs: GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xms2G -Xmx3G'" \ ./gradlew resolveAndLockAll --write-locks --parallel --stacktrace --no-daemon --max-workers=4 + - name: Validate changed lock files meet dependency age policy + id: validate-lockfiles + env: + AKKA_REPO_TOKEN: ${{ secrets.AKKA_REPO_TOKEN }} + run: | + python3 .github/scripts/dependency_age.py validate-lockfiles \ + --baseline-dir /tmp/gradle-lockfiles-before \ + --current-dir . \ + --min-age-hours "${MIN_DEPENDENCY_AGE_HOURS}" \ + --repo-url "https://repo1.maven.org/maven2" \ + --repo-url "https://repo.akka.io/${AKKA_REPO_TOKEN}/secure" \ + --repo-url "https://packages.confluent.io/maven" \ + --repo-url "https://repository.mulesoft.org/releases" \ + --repo-url "https://repository.mulesoft.org/nexus/content/repositories/public" \ + --github-output "$GITHUB_OUTPUT" + - name: Save instrumentation lock files run: | mkdir -p /tmp/instrumentation-lockfiles find dd-smoke-tests dd-java-agent/instrumentation -name 'gradle.lockfile' -exec cp --parents {} /tmp/instrumentation-lockfiles/ \; - # Restore instrumentation dirs to original state (keep only core changes) + # Restore instrumentation dirs to original state (keep only core changes). + # git restore only reverts tracked files; brand-new lock files are untracked + # and would otherwise leak into the core PR, so delete the untracked ones too. git restore -- 'dd-smoke-tests/' 'dd-java-agent/instrumentation/' + git ls-files --others --exclude-standard -- \ + 'dd-smoke-tests/*gradle.lockfile' 'dd-java-agent/instrumentation/*gradle.lockfile' \ + | xargs -r rm -f # ==================== Core modules PR ==================== - name: Check if core changes exist @@ -75,7 +104,7 @@ jobs: - name: Push core changes if: steps.check-core-changes.outputs.commit_changes == 'true' - uses: DataDog/commit-headless@ad3668640012ec69186398f43d61923f6878bbbe # action/v3.2.0 + uses: DataDog/commit-headless@567f7eedac58750aa573f48fd60cfe478abc65bd # action/v3.3.0 with: token: "${{ steps.octo-sts.outputs.token }}" branch: "${{ steps.define-branches.outputs.core_branch }}" @@ -87,13 +116,14 @@ jobs: if: steps.check-core-changes.outputs.commit_changes == 'true' env: GH_TOKEN: ${{ steps.octo-sts.outputs.token }} + PR_SUMMARY: ${{ steps.validate-lockfiles.outputs.summary_core }} run: | gh pr create --title "Update Gradle dependencies" \ --base master \ --head ${{ steps.define-branches.outputs.core_branch }} \ --label "tag: dependencies" \ --label "tag: no release notes" \ - --body "$(cat <<'EOF' + --body "$(cat </dev/null | cut -d= -f2 || true; } - echo "gradle_version=$(get_prop gradle.version "$gradle_props")" >> "$GITHUB_OUTPUT" - echo "maven_version=$(get_prop maven.version "$maven_props")" >> "$GITHUB_OUTPUT" - echo "surefire_version=$(get_prop maven-surefire.version "$maven_props")" >> "$GITHUB_OUTPUT" + echo "gradle_version=$(get_prop gradle.latest "$gradle_props")" >> "$GITHUB_OUTPUT" + echo "maven_version=$(get_prop maven.latest "$maven_props")" >> "$GITHUB_OUTPUT" + echo "surefire_version=$(get_prop maven-surefire.latest "$maven_props")" >> "$GITHUB_OUTPUT" - name: Resolve latest eligible Gradle version id: gradle @@ -68,6 +68,8 @@ jobs: --artifact-id maven-surefire-plugin \ --prerelease-pattern alpha \ --prerelease-pattern beta \ + --prerelease-pattern rc \ + --prerelease-pattern='-m\d' \ --min-age-hours "${MIN_DEPENDENCY_AGE_HOURS}" \ --current-version "${{ steps.current.outputs.surefire_version }}" \ --github-output "$GITHUB_OUTPUT" @@ -77,6 +79,7 @@ jobs: env: GRADLE_VERSION: ${{ steps.gradle.outputs.version }} GRADLE_PUBLISHED: ${{ steps.gradle.outputs.published_at }} + GRADLE_LATEST_BY_MAJOR: ${{ steps.gradle.outputs.latest_by_major }} MAVEN_VERSION: ${{ steps.maven.outputs.version }} MAVEN_PUBLISHED: ${{ steps.maven.outputs.published_at }} SUREFIRE_VERSION: ${{ steps.surefire.outputs.version }} @@ -96,16 +99,25 @@ jobs: printf '%s\n' \ "# Pinned latest eligible stable versions (>=${MIN_DEPENDENCY_AGE_HOURS}h old) for CI Visibility Gradle smoke tests." \ "# Updated automatically by the update-smoke-test-latest-versions workflow." \ - "gradle.version=${GRADLE_VERSION}" \ + "gradle.latest=${GRADLE_VERSION}" \ + "# Latest eligible stable patch per Gradle major release. Used to resolve the \"oldest\" smoke-test" \ + "# Gradle version (the latest patch of the oldest major the current TestKit supports)." \ + "${GRADLE_LATEST_BY_MAJOR}" \ > dd-smoke-tests/gradle/src/test/resources/latest-tool-versions.properties printf '%s\n' \ "# Pinned latest eligible stable versions (>=${MIN_DEPENDENCY_AGE_HOURS}h old) for CI Visibility Maven smoke tests." \ "# Updated automatically by the update-smoke-test-latest-versions workflow." \ - "maven.version=${MAVEN_VERSION}" \ - "maven-surefire.version=${SUREFIRE_VERSION}" \ + "maven.latest=${MAVEN_VERSION}" \ + "maven-surefire.latest=${SUREFIRE_VERSION}" \ > dd-smoke-tests/maven/src/test/resources/latest-tool-versions.properties + printf '%s\n' \ + "# Pinned latest eligible stable version (>=${MIN_DEPENDENCY_AGE_HOURS}h old) for the Maven instrumentation latestDepTest." \ + "# Updated automatically by the update-smoke-test-latest-versions workflow." \ + "maven-surefire.latest=${SUREFIRE_VERSION}" \ + > dd-java-agent/instrumentation/maven/maven-3.2.1/src/test/resources/latest-tool-versions.properties + - name: Check for changes id: check-changes run: | @@ -131,12 +143,13 @@ jobs: if: steps.check-changes.outputs.has_changes == 'true' run: | git add dd-smoke-tests/gradle/src/test/resources/latest-tool-versions.properties \ - dd-smoke-tests/maven/src/test/resources/latest-tool-versions.properties + dd-smoke-tests/maven/src/test/resources/latest-tool-versions.properties \ + dd-java-agent/instrumentation/maven/maven-3.2.1/src/test/resources/latest-tool-versions.properties git commit -m "chore: Update smoke test latest tool versions" - name: Push changes if: steps.check-changes.outputs.has_changes == 'true' - uses: DataDog/commit-headless@ad3668640012ec69186398f43d61923f6878bbbe # action/v3.2.0 + uses: DataDog/commit-headless@567f7eedac58750aa573f48fd60cfe478abc65bd # action/v3.3.0 with: token: "${{ steps.octo-sts.outputs.token }}" branch: "${{ steps.define-branch.outputs.branch }}" @@ -157,7 +170,8 @@ jobs: --body "$(cat <<'EOF' # What Does This Do - This PR updates the pinned latest eligible stable tool versions used by CI Visibility smoke tests. + This PR updates the pinned latest eligible stable tool versions used by CI Visibility smoke tests + and by the Maven instrumentation latestDepTest. Only releases at least ${{ env.MIN_DEPENDENCY_AGE_HOURS }} hours old are eligible. - Gradle: ${{ steps.update.outputs.gradle_line }} diff --git a/.gitignore b/.gitignore index efe0ddbf28b..54ae092deba 100644 --- a/.gitignore +++ b/.gitignore @@ -8,7 +8,7 @@ target ######### !**/gradle/wrapper/* /.gradle -*/.gradle +**/.gradle **/build/ examples/**/build/ @@ -53,6 +53,8 @@ out/ # Claude Code local custom settings # ##################################### .claude/*.local.* +.claude-invariants.md +.claude-status.md # Vim # ####### diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 369aa9b69c7..df44494734c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,7 +1,6 @@ include: - local: ".gitlab/one-pipeline.locked.yml" - local: ".gitlab/benchmarks.yml" - - local: ".gitlab/macrobenchmarks.yml" - local: ".gitlab/exploration-tests.yml" - local: ".gitlab/ci-visibility-tests.yml" - project: 'DataDog/apm-reliability/apm-sdks-benchmarks' @@ -24,7 +23,6 @@ include: stages: - build - publish - # These benchmarks are intended to replace the legacy benchmarks in the future - java-spring-petclinic-parallel - java-spring-petclinic-parallel-slo - java-startup-parallel @@ -34,10 +32,13 @@ stages: - java-dacapo-parallel - java-dacapo-parallel-slo - java-post-pr-comment - - shared-pipeline + - shared-pipeline-build + - shared-pipeline-test + - publish-release-artifacts + - shared-pipeline-publish - benchmarks - - macrobenchmarks - tests + - tests-arm64 - test-summary - exploration-tests - ci-visibility-tests @@ -51,11 +52,13 @@ variables: BUILD_JOB_NAME: "build" DEPENDENCY_CACHE_POLICY: pull BUILD_CACHE_POLICY: pull - GRADLE_VERSION: "8.14.4" # must match gradle-wrapper.properties + GRADLE_VERSION: "9.6.1" # must match gradle-wrapper.properties + MASS_READ_URL: "https://mass-read.us1.ddbuild.io" MAVEN_REPOSITORY_PROXY: "https://depot-read-api-java.us1.ddbuild.io/magicmirror/magicmirror/@current/" GRADLE_PLUGIN_PROXY: "https://depot-read-api-java.us1.ddbuild.io/magicmirror/magicmirror/@current/" BUILDER_IMAGE_REPO: "registry.ddbuild.io/images/mirror/dd-trace-java-docker-build" # images are pinned in images/mirror.lock.yaml in the DataDog/images repo BUILDER_IMAGE_VERSION_PREFIX: "ci-" # use either an empty string (e.g. "") for latest images or a version followed by a hyphen (e.g. "ci-" or "123_merge-") + TEST_COUNTS_S3_BUCKET: "dd-trace-java-ci-test-reports" REPO_NOTIFICATION_CHANNEL: "#apm-java-escalations" DEFAULT_TEST_JVMS: /^(8|11|17|21|25|tip)$/ # the latest "tip" version is 26 PROFILE_TESTS: @@ -81,6 +84,8 @@ workflow: - if: '$CI_COMMIT_BRANCH =~ /^gh-readonly-queue\//' when: never - if: '$CI_COMMIT_BRANCH == "master"' + variables: + SYSTEM_TESTS_RUN_ALL_VMS: "true" auto_cancel: on_new_commit: none - if: '$CI_COMMIT_BRANCH =~ /^v[0-9]+\.[0-9]+\.[0-9]+$/' @@ -95,6 +100,7 @@ workflow: - "17" - "21" - "25" + - "27" # JDK 27 TODO: remove after GA (tip will move to 27) - "semeru11" - "oracle8" - "zulu8" @@ -162,8 +168,26 @@ default: fi echo -e "${TEXT_BOLD}${TEXT_YELLOW}Runner dashboard, these are live (limited to a 1-hour window, and expire after 36 hours)${TEXT_CLEAR}" - echo -e "${TEXT_BOLD}${TEXT_YELLOW} Containers:${TEXT_CLEAR} https://app.datadoghq.com/containers?${TIME_PARAMS}query=image_name%3A%2A%2Fdatadog%2Fdd-trace-java-docker-build%20AND%20pod_name%3A${POD_NAME}&live=false" - echo -e "${TEXT_BOLD}${TEXT_YELLOW} Processes:${TEXT_CLEAR} https://app.datadoghq.com/process?${TIME_PARAMS}query=image_name%3A%2A%2Fdatadog%2Fdd-trace-java-docker-build%20AND%20pod_name%3A${POD_NAME}&live=false" + echo -e "${TEXT_BOLD}${TEXT_YELLOW} Containers:${TEXT_CLEAR} https://app.datadoghq.com/containers?${TIME_PARAMS}query=image_name%3A%2A%2Fdd-trace-java-docker-build%20AND%20pod_name%3A${POD_NAME}&live=false" + echo -e "${TEXT_BOLD}${TEXT_YELLOW} Processes:${TEXT_CLEAR} https://app.datadoghq.com/process?${TIME_PARAMS}query=image_name%3A%2A%2Fdd-trace-java-docker-build%20AND%20pod_name%3A${POD_NAME}&live=false" + +.tier_m: + variables: &tier_m_variables + GRADLE_WORKERS: 4 + GRADLE_MEMORY_MIN: 1G + GRADLE_MEMORY_MAX: 5G + KUBERNETES_CPU_REQUEST: 6 + KUBERNETES_MEMORY_REQUEST: 16Gi + KUBERNETES_MEMORY_LIMIT: 16Gi + +.tier_l: + variables: &tier_l_variables + GRADLE_WORKERS: 6 + GRADLE_MEMORY_MIN: 1G + GRADLE_MEMORY_MAX: 6G + KUBERNETES_CPU_REQUEST: 10 + KUBERNETES_MEMORY_REQUEST: 20Gi + KUBERNETES_MEMORY_LIMIT: 20Gi .gitlab_base_ref_params: &gitlab_base_ref_params - | @@ -178,13 +202,8 @@ default: image: ${BUILDER_IMAGE_REPO}:${BUILDER_IMAGE_VERSION_PREFIX}base stage: build variables: + <<: *tier_m_variables MAVEN_OPTS: "-Xms256M -Xmx1024M" - GRADLE_WORKERS: 6 - GRADLE_MEMORY_MIN: 1G - GRADLE_MEMORY_MAX: 4G - KUBERNETES_CPU_REQUEST: 10 - KUBERNETES_MEMORY_REQUEST: 20Gi - KUBERNETES_MEMORY_LIMIT: 20Gi CACHE_TYPE: "lib" #default FF_USE_FASTZIP: "true" CACHE_COMPRESSION_LEVEL: "slowest" @@ -225,12 +244,27 @@ default: org.gradle.java.installations.auto-detect=false org.gradle.java.installations.auto-download=false org.gradle.java.installations.fromEnv=$JAVA_HOMES + org.gradle.console=colored EOF - mkdir -p .gradle - export GRADLE_USER_HOME=$(pwd)/.gradle - # replace maven central part by MAVEN_REPOSITORY_PROXY in .mvn/wrapper/maven-wrapper.properties - - sed -i "s|https://repo.maven.apache.org/maven2/|$MAVEN_REPOSITORY_PROXY|g" .mvn/wrapper/maven-wrapper.properties + # Apache Maven Wrapper supports MVNW_REPOURL for repository-manager downloads: + # https://maven.apache.org/tools/wrapper/#Using_a_Maven_Repository_Manager + - export MVNW_REPOURL=${MAVEN_REPOSITORY_PROXY%/} + # Route Gradle distribution download through MASS pull-through cache + - | + mass_read_host="${MASS_READ_URL#https://}" + mass_read_host="${mass_read_host%/}" + sed -i "/^distributionUrl=/ s|services.gradle.org|${mass_read_host}/internal/artifact/services.gradle.org|" gradle/wrapper/gradle-wrapper.properties - mkdir -p .mvn/caches + # Redirect Spotless's Equo/Solstice P2 cache into the project tree so it is captured by the GitLab cache. + # Solstice (https://github.com/equodev/equo-ide) defaults to ~/.m2/repository/dev/equo/p2-data, which is outside $CI_PROJECT_DIR. + - | + mkdir -p .mvn/caches/equo "$HOME/.m2/repository/dev" + if [ ! -L "$HOME/.m2/repository/dev/equo" ]; then + rm -rf "$HOME/.m2/repository/dev/equo" + ln -s "$(pwd)/.mvn/caches/equo" "$HOME/.m2/repository/dev/equo" + fi - export GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xms$GRADLE_MEMORY_MIN -Xmx$GRADLE_MEMORY_MAX -XX:ErrorFile=/tmp/hs_err_pid%p.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp'" - export GRADLE_ARGS=" --build-cache --stacktrace --no-daemon --parallel --max-workers=$GRADLE_WORKERS" - *normalize_node_index @@ -309,7 +343,7 @@ build: script: - if [ $CI_PIPELINE_SOURCE == "schedule" ] ; then ./gradlew resolveAndLockAll --write-locks $GRADLE_ARGS; fi - ./gradlew --version - - ./gradlew clean :dd-java-agent:shadowJar :dd-trace-api:jar :dd-trace-ot:shadowJar -PskipTests $GRADLE_ARGS + - ./gradlew clean :dd-java-agent:shadowJar :dd-java-agent:check :dd-trace-api:jar :dd-trace-ot:shadowJar -PskipTests -x spotlessCheck $GRADLE_ARGS - echo UPSTREAM_TRACER_VERSION=$(java -jar workspace/dd-java-agent/build/libs/*.jar) >> upstream.env - echo "BUILD_JOB_NAME=$CI_JOB_NAME" >> build.env - echo "BUILD_JOB_ID=$CI_JOB_ID" >> build.env @@ -327,6 +361,7 @@ build: build_tests: extends: .gradle_build variables: + <<: *tier_l_variables BUILD_CACHE_POLICY: push DEPENDENCY_CACHE_POLICY: pull parallel: @@ -355,8 +390,6 @@ populate_dep_cache: rules: - if: '$POPULATE_CACHE' when: on_success - - when: manual - allow_failure: true parallel: matrix: - GRADLE_TARGET: ":dd-java-agent:shadowJar :dd-trace-api:jar :dd-trace-ot:shadowJar" @@ -371,6 +404,9 @@ populate_dep_cache: CACHE_TYPE: "latestdep" - GRADLE_TARGET: ":smokeTest" CACHE_TYPE: "smoke" + - GRADLE_TARGET: "spotlessCheck" + CACHE_TYPE: "spotless" + GRADLE_MEMORY_MAX: "6G" publish-artifacts-to-s3: image: registry.ddbuild.io/images/mirror/amazon/aws-cli:2.4.29 @@ -410,9 +446,12 @@ spotless: needs: [] variables: GRADLE_MEMORY_MAX: 6G + CACHE_TYPE: "spotless" script: - ./gradlew --version - - ./gradlew spotlessCheck $GRADLE_ARGS + # test-published-dependencies's build file needs main version file + - ./gradlew spotlessCheck writeMainVersionFile $GRADLE_ARGS + - cd test-published-dependencies && ./gradlew spotlessCheck $GRADLE_ARGS check-instrumentation-naming: extends: .gradle_build @@ -445,6 +484,7 @@ test_published_artifacts: - export GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xms2G -Xmx2G -XX:ErrorFile=/tmp/hs_err_pid%p.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp'" - ./gradlew publishToMavenLocal $GRADLE_ARGS - cd test-published-dependencies + - printf '\norg.gradle.console=colored\n' >> gradle.properties - export GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xms1G -Xmx1G -XX:ErrorFile=/tmp/hs_err_pid%p.log -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp'" - ./gradlew --version - ./gradlew check --info $GRADLE_ARGS @@ -459,6 +499,33 @@ test_published_artifacts: paths: - ./check_reports +validate_build: + extends: .gradle_build + stage: tests + needs: [ build ] + variables: + CACHE_TYPE: "lib" + script: + # Preserve the `build` job artifacts before Gradle rebuilds and overwrites them under + # workspace/**/build/libs, so jardiff can compare the rebuilt jars against them. + - mkdir -p reference-artifacts + - cp workspace/dd-java-agent/build/libs/*.jar reference-artifacts/ + - cp workspace/dd-trace-api/build/libs/*.jar reference-artifacts/ + - cp workspace/dd-trace-ot/build/libs/*.jar reference-artifacts/ + - ./gradlew --version + # This will run the shadowJar task and exercise the build cache, allowing to identify build-cache issues + - ./gradlew compareToReferenceJar -PjardiffReferenceDir="$CI_PROJECT_DIR/reference-artifacts" -PskipTests $GRADLE_ARGS + after_script: + - source .gitlab/gitlab-utils.sh + - gitlab_section_start "collect-reports" "Collecting reports" + - .gitlab/collect_reports.sh --destination ./check_reports + - gitlab_section_end "collect-reports" + artifacts: + when: always + paths: + - ./check_reports + - '.gradle/daemon/*/*.out.log' + .check_job: extends: .gradle_build needs: [ build ] @@ -532,7 +599,15 @@ check_debugger: muzzle: extends: .gradle_build - needs: [ build_tests ] + # needs:parallel:matrix limits this job to a specific build_tests combination. + # Keep matrix vars exact and in build_tests declaration order: + # https://docs.gitlab.com/ci/yaml/#needsparallelmatrix + needs: &needs_build_tests_inst + - job: build_tests + parallel: + matrix: + - GRADLE_TARGET: ":instrumentationTest" + CACHE_TYPE: "inst" stage: tests rules: - if: '$CI_COMMIT_BRANCH =~ /^mq-working-branch-/' @@ -570,7 +645,7 @@ muzzle: muzzle-dep-report: extends: .gradle_build - needs: [ build_tests ] + needs: *needs_build_tests_inst stage: tests rules: - if: '$CI_COMMIT_BRANCH =~ /^mq-working-branch-/' @@ -616,6 +691,7 @@ muzzle-dep-report: needs: [ build_tests ] stage: tests variables: + <<: *tier_m_variables GRADLE_PARAMS: "-PskipFlakyTests" CONTINUE_ON_FAILURE: "false" TESTCONTAINERS_CHECKS_DISABLE: "true" @@ -661,6 +737,133 @@ muzzle-dep-report: - .gitlab/upload_ciapp.sh $CACHE_TYPE $testJvm - gitlab_section_end "collect-reports" - .gitlab/count_tests.sh "$GRADLE_TARGET" "$testJvm" "./results" "./test_counts_${CI_JOB_ID}.json" + - export TEST_COUNTS_S3_PREFIX="test-counts/${CI_PIPELINE_ID}" + - export TEST_COUNTS_FILE="./test_counts_${CI_JOB_ID}.json" + # Use logical job identity in S3 so retried jobs overwrite stale attempts. + - export TEST_COUNTS_S3_FILE="test_counts_${CI_JOB_NAME_SLUG}_${CI_NODE_INDEX}-${CI_NODE_TOTAL}.json" + - export TEST_COUNTS_S3_URI="s3://${TEST_COUNTS_S3_BUCKET}/${TEST_COUNTS_S3_PREFIX}/${TEST_COUNTS_S3_FILE}" + - echo "Uploading ${TEST_COUNTS_FILE} to ${TEST_COUNTS_S3_URI}" + - aws s3 cp "$TEST_COUNTS_FILE" "$TEST_COUNTS_S3_URI" --only-show-errors + - URL_ENCODED_JOB_NAME=$(jq -rn --arg x "$CI_JOB_NAME" '$x|@uri') + - echo -e "${TEXT_BOLD}${TEXT_YELLOW}See test results in Datadog:${TEXT_CLEAR} https://app.datadoghq.com/ci/test/runs?query=test_level%3Atest%20%40test.service%3Add-trace-java%20%40ci.pipeline.id%3A${CI_PIPELINE_ID}%20%40ci.job.name%3A%22${URL_ENCODED_JOB_NAME}%22" + artifacts: + when: always + paths: + - ./reports.tar + - ./profiles.tar + - ./results + - './test_counts_*.json' + - '.gradle/daemon/*/*.out.log' + reports: + junit: results/*.xml + retry: + max: 2 + when: + - unknown_failure + - stuck_or_timeout_failure + - runner_system_failure + - unmet_prerequisites + - scheduler_failure + - data_integrity_failure + +.test_job_arm64: + image: ${BUILDER_IMAGE_REPO}:${BUILDER_IMAGE_VERSION_PREFIX}$testJvm + tags: [ "docker-in-docker:arm64" ] + stage: tests-arm64 + needs: [] + variables: + <<: *tier_m_variables + DEFAULT_TEST_JVMS: /^(8|11|17|21|25|27|tip)$/ # Java 27 TODO: remove 27 after GA (tip will move to 27) + GRADLE_PARAMS: "-PskipFlakyTests" + TESTCONTAINERS_CHECKS_DISABLE: "true" + TESTCONTAINERS_RYUK_DISABLED: "true" + TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX: "registry.ddbuild.io/images/mirror/" + JETTY_AVAILABLE_PROCESSORS: 4 + GIT_SUBMODULE_STRATEGY: normal + GIT_SUBMODULE_DEPTH: 1 + rules: + # `ibm8`/`oracle8` have no arm64 images published upstream — never run them on arm64. + - if: '$testJvm == "ibm8" || $testJvm == "oracle8"' + when: never + # arm64 tests are newly introduced to the merge queue and master. Keep them + # non-blocking (allow_failure) for now so we can collect stability stats and + # fix flaky/failing jobs without blocking the whole team. Remove allow_failure + # once the arm64 suite is proven stable. + - if: '$CI_COMMIT_BRANCH =~ /^mq-working-branch-/' + when: on_success + allow_failure: true + - if: '$CI_COMMIT_BRANCH == "master"' + when: on_success + allow_failure: true + # Enable non-default JVMs on demand. + - if: '$NON_DEFAULT_JVMS == "true"' + when: on_success + allow_failure: true + - if: '$CI_COMMIT_MESSAGE =~ /\[ci: NON_DEFAULT_JVMS\]/' + when: on_success + allow_failure: true + - if: '$testJvm =~ $DEFAULT_TEST_JVMS' + when: manual + allow_failure: true + cache: + - key: dependency-$CACHE_TYPE + paths: + - .gradle/wrapper + - .gradle/caches + - .gradle/notifications + - .mvn/caches + policy: pull + fallback_keys: + - dependency-base + - dependency-lib + unprotect: true + before_script: + - git config --global --add safe.directory "$CI_PROJECT_DIR" + # Akka token added to SSM from https://account.akka.io/token + - export ORG_GRADLE_PROJECT_akkaRepositoryToken=$(aws ssm get-parameter --region us-east-1 --name ci.dd-trace-java.akka_repo_token --with-decryption --query "Parameter.Value" --out text) + - export ORG_GRADLE_PROJECT_mavenRepositoryProxy=$MAVEN_REPOSITORY_PROXY + - export ORG_GRADLE_PROJECT_gradlePluginProxy=$GRADLE_PLUGIN_PROXY + - | + JAVA_HOMES=$(env | grep -E '^JAVA_[A-Z0-9_]+_HOME=' | sed 's/=.*//' | paste -sd,) + cat >> gradle.properties < -/// -/// ``` -/// -/// After (only the intermediate attempt is tagged; the last entry is left untouched): -/// -/// ``` -/// -/// -/// -/// -/// -/// -/// ``` -/// -/// Usage (Java 25): `java TagSyntheticFailures.java junit-report.xml` - -class TagSyntheticFailures { - public static void main(String[] args) throws Exception { - if (args.length == 0) { - System.err.println("Usage: java TagSyntheticFailures.java "); - System.exit(1); - } - var xmlFile = new File(args[0]); - if (!xmlFile.exists()) { - System.err.println("File not found: " + xmlFile); - System.exit(1); - } - var dbf = DocumentBuilderFactory.newInstance(); - dbf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); - dbf.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); - dbf.setFeature("http://xml.org/sax/features/external-general-entities", false); - dbf.setFeature("http://xml.org/sax/features/external-parameter-entities", false); - dbf.setExpandEntityReferences(false); - var doc = dbf.newDocumentBuilder().parse(xmlFile); - var testcases = doc.getElementsByTagName("testcase"); - Map> byClassname = new LinkedHashMap<>(); - boolean modified = false; - for (int i = 0; i < testcases.getLength(); i++) { - var e = (Element) testcases.item(i); - var name = e.getAttribute("name"); - if ("initializationError".equals(name)) { - byClassname.computeIfAbsent(e.getAttribute("classname"), k -> new ArrayList<>()).add(e); - } else if ("executionError".equals(name) || "test exception".equals(name)) { - if (tagSkip(doc, e)) modified = true; - } - } - for (var group : byClassname.values()) { - for (int i = 0; i < group.size() - 1; i++) { - if (tagSkip(doc, group.get(i))) { - modified = true; - } - } - } - if (!modified) { - return; - } - var tmpFile = File.createTempFile("TagSyntheticFailures", ".xml", xmlFile.getParentFile()); - try { - var transformer = TransformerFactory.newInstance().newTransformer(); - transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); - transformer.transform(new DOMSource(doc), new StreamResult(tmpFile)); - Files.move( - tmpFile.toPath(), xmlFile.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING); - } catch (Exception e) { - tmpFile.delete(); - throw e; - } - } - - static Element firstChildElement(Element parent, String tagName) { - var children = parent.getChildNodes(); - for (int i = 0; i < children.getLength(); i++) { - var child = children.item(i); - if (child instanceof Element e && tagName.equals(e.getTagName())) { - return e; - } - } - return null; - } - - static boolean tagSkip(Document doc, Element testcase) { - var props = firstChildElement(testcase, "properties"); - if (props != null) { - var children = props.getChildNodes(); - for (int j = 0; j < children.getLength(); j++) { - if (children.item(j) instanceof Element e - && "property".equals(e.getTagName()) - && "dd_tags[test.final_status]".equals(e.getAttribute("name"))) { - return false; - } - } - var property = doc.createElement("property"); - property.setAttribute("name", "dd_tags[test.final_status]"); - property.setAttribute("value", "skip"); - props.appendChild(property); - } else { - var properties = doc.createElement("properties"); - var property = doc.createElement("property"); - property.setAttribute("name", "dd_tags[test.final_status]"); - property.setAttribute("value", "skip"); - properties.appendChild(property); - testcase.appendChild(properties); - } - return true; - } -} diff --git a/.gitlab/add_final_status.xsl b/.gitlab/add_final_status.xsl deleted file mode 100644 index 4b4c0da17fd..00000000000 --- a/.gitlab/add_final_status.xsl +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - fail - skip - pass - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/.gitlab/aggregate_test_counts.sh b/.gitlab/aggregate_test_counts.sh index 57f271313bb..07560cfb821 100755 --- a/.gitlab/aggregate_test_counts.sh +++ b/.gitlab/aggregate_test_counts.sh @@ -471,7 +471,7 @@ done <<-EOF # <<- strips leading tabs EOF # Find and validate test count files -mapfile -t VALID_FILES < <(find_and_validate_test_files "." "$OUTPUT_FILE") +mapfile -t VALID_FILES < <(find_and_validate_test_files "$AGGREGATE_DIR" "$OUTPUT_FILE") if [ ${#VALID_FILES[@]} -eq 0 ]; then exit 0 fi diff --git a/.gitlab/benchmarks.yml b/.gitlab/benchmarks.yml index 8145f3588c0..2247a5b4aa3 100644 --- a/.gitlab/benchmarks.yml +++ b/.gitlab/benchmarks.yml @@ -1,124 +1,3 @@ -.benchmarks: - stage: benchmarks - timeout: 1h - tags: ["runner:apm-k8s-tweaked-metal"] - image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/benchmarking-platform:dd-trace-java-benchmarks - needs: [ "build", "publish-artifacts-to-s3" ] - rules: - - if: '$POPULATE_CACHE' - when: never - - if: '$CI_COMMIT_TAG =~ /^v?[0-9]+\.[0-9]+\.[0-9]+$/' - when: manual - allow_failure: true - - if: '$CI_COMMIT_BRANCH == "master"' - when: on_success - interruptible: false - - if: '$CI_COMMIT_BRANCH =~ /^mq-working-branch-/' - when: on_success - interruptible: false - - if: '$CI_COMMIT_BRANCH =~ /^gh-readonly-queue\//' - when: on_success - interruptible: false - - when: manual - allow_failure: true - interruptible: true - script: - - export ARTIFACTS_DIR="$(pwd)/reports" && mkdir -p "${ARTIFACTS_DIR}" - - git config --global url."https://gitlab-ci-token:${CI_JOB_TOKEN}@gitlab.ddbuild.io/DataDog/".insteadOf "https://github.com/DataDog/" - - git clone --branch dd-trace-java/tracer-benchmarks-parallel https://github.com/DataDog/benchmarking-platform.git /platform && cd /platform - artifacts: - name: "reports" - paths: - - reports/ - expire_in: 3 months - variables: - UPSTREAM_PROJECT_ID: $CI_PROJECT_ID # The ID of the current project. This ID is unique across all projects on the GitLab instance. - UPSTREAM_PROJECT_NAME: $CI_PROJECT_NAME # "dd-trace-java" - UPSTREAM_BRANCH: $CI_COMMIT_REF_NAME # The branch or tag name for which project is built. - UPSTREAM_COMMIT_SHA: $CI_COMMIT_SHA # The commit revision the project is built for. - -benchmarks-startup: - extends: .benchmarks - script: - - !reference [ .benchmarks, script ] - - ./steps/capture-hardware-software-info.sh - - ./steps/run-benchmarks.sh startup - - ./steps/analyze-results.sh startup - -benchmarks-load: - extends: .benchmarks - script: - - !reference [ .benchmarks, script ] - - ./steps/capture-hardware-software-info.sh - - ./steps/run-benchmarks.sh load - - ./steps/analyze-results.sh load - -benchmarks-dacapo: - extends: .benchmarks - script: - - !reference [ .benchmarks, script ] - - ./steps/capture-hardware-software-info.sh - - ./steps/run-benchmarks.sh dacapo - - ./steps/analyze-results.sh dacapo - -benchmarks-post-results: - extends: .benchmarks - tags: ["arch:amd64"] - script: - - !reference [ .benchmarks, script ] - - ./steps/upload-results-to-s3.sh - - ./steps/post-pr-comment.sh - needs: - - job: benchmarks-startup - artifacts: true - - job: benchmarks-load - artifacts: true - - job: benchmarks-dacapo - artifacts: true - -check-big-regressions: - extends: .benchmarks - needs: - - job: benchmarks-startup - artifacts: true - - job: benchmarks-dacapo - artifacts: true - when: on_success - tags: ["arch:amd64"] - rules: - - if: '$POPULATE_CACHE' - when: never - - if: '$CI_COMMIT_BRANCH =~ /backport-pr-/' - when: never - - if: '$CI_COMMIT_BRANCH =~ /^(master|release\/)/' - when: never - - if: '$CI_COMMIT_BRANCH =~ /^mq-working-branch-/' - when: on_success - - if: '$CI_COMMIT_BRANCH =~ /^gh-readonly-queue\//' - when: on_success - - when: manual - allow_failure: true - # ARTIFACTS_DIR /go/src/github.com/DataDog/apm-reliability/dd-trace-java/reports/ - # need to convert them - script: - - !reference [ .benchmarks, script ] - - | - for benchmarkType in startup dacapo; do - find "$ARTIFACTS_DIR/$benchmarkType" -name "benchmark-baseline.json" -o -name "benchmark-candidate.json" | while read file; do - relpath="${file#$ARTIFACTS_DIR/$benchmarkType/}" - prefix="${relpath%/benchmark-*}" # Remove the trailing /benchmark-(baseline|candidate).json - prefix="${prefix#./}" # Remove any leading ./ - prefix="${prefix//\//-}" # Replace / with - - case "$file" in - *benchmark-baseline.json) type="baseline" ;; - *benchmark-candidate.json) type="candidate" ;; - esac - echo "Moving $file to $ARTIFACTS_DIR/${type}-${prefix}.converted.json" - cp "$file" "$ARTIFACTS_DIR/${type}-${prefix}.converted.json" - done - done - - bp-runner $CI_PROJECT_DIR/.gitlab/benchmarks/bp-runner.fail-on-regression.yml --debug - .dsm-kafka-benchmarks: stage: benchmarks rules: diff --git a/.gitlab/benchmarks/bp-runner.fail-on-breach.yml b/.gitlab/benchmarks/bp-runner.fail-on-breach.yml deleted file mode 100644 index cef01aad922..00000000000 --- a/.gitlab/benchmarks/bp-runner.fail-on-breach.yml +++ /dev/null @@ -1,61 +0,0 @@ -# Auto-generated SLO Thresholds -# Generated: 2026-03-31 -# -# Generation Strategy: tight -# Formula: CI_bound / (1 ± T) (T = 10.0%) -# -# SLO Checking: -# - BREACH: 90% CI boundary crosses threshold -# - WARNING: 90% CI boundary crosses warning_threshold (constant) -# -# DO NOT EDIT MANUALLY - Regenerate using: -# benchmark_analyzer generate slos --help -# -# link to documentation on autogenerated thresholds https://github.com/DataDog/relenv-benchmark-analyzer/blob/main/README.md#generate-slo-thresholds - -experiments: - - name: Run SLO breach check - steps: - - name: SLO breach check - run: fail_on_breach - # https://datadoghq.atlassian.net/wiki/x/LgI1LgE#How-to-choose-a-warning-range-for-pre-release-gates%3F - warning_range: 10 - # File spec - # https://datadoghq.atlassian.net/wiki/x/LgI1LgE#Specification - # Measurements - # https://benchmarking.us1.prod.dog/trends?projectId=4&branch=master&trendsTab=per_scenario - scenarios: - # Note that thresholds there are choosen based the confidence interval with a 10% adjustment. - - # Standard macrobenchmarks - # https://benchmarking.us1.prod.dog/trends?projectId=4&branch=master&trendsTab=per_scenario&scenario=normal_operation%2Fonly-tracing&trendsType=scenario - - name: normal_operation/only-tracing - thresholds: - - agg_http_req_duration_p50 < 2.526 ms - - agg_http_req_duration_p99 < 8.5 ms - # https://benchmarking.us1.prod.dog/trends?projectId=4&branch=master&trendsTab=per_scenario&scenario=normal_operation%2Fotel-latest&trendsType=scenario - - name: normal_operation/otel-latest - thresholds: - - agg_http_req_duration_p50 < 2.5 ms - - agg_http_req_duration_p99 < 10 ms - - # https://benchmarking.us1.prod.dog/trends?projectId=4&branch=master&trendsTab=per_scenario&scenario=high_load%2Fonly-tracing&trendsType=scenario - - name: high_load/only-tracing - thresholds: - - throughput > 1100.0 op/s - # https://benchmarking.us1.prod.dog/trends?projectId=4&branch=master&trendsTab=per_scenario&scenario=high_load%2Fotel-latest&trendsType=scenario - - name: high_load/otel-latest - thresholds: - - throughput > 1100.0 op/s - - # Startup macrobenchmarks - # https://benchmarking.us1.prod.dog/trends?projectId=4&branch=master&trendsTab=per_scenario&scenario=startup%3Apetclinic%3Atracing%3AAgent.start&trendsType=scenario - - name: "startup:petclinic:tracing:Agent.start" - thresholds: - - execution_time < 1255.96 ms # generated with --significant-impact-threshold 0.15 - # https://benchmarking.us1.prod.dog/trends?projectId=4&branch=master&trendsTab=per_scenario&scenario=startup%3Apetclinic%3Aprofiling%3AAgent.start&trendsType=scenario - # https://benchmarking.us1.prod.dog/trends?projectId=4&branch=master&trendsTab=per_scenario&scenario=startup%3Apetclinic%3Aappsec%3AAgent.start&trendsType=scenario - # https://benchmarking.us1.prod.dog/trends?projectId=4&branch=master&trendsTab=per_scenario&scenario=startup%3Apetclinic%3Aiast%3AAgent.start&trendsType=scenario - - name: "startup:petclinic:(profiling|appsec|iast):Agent.start" - thresholds: - - execution_time < 1483.46 ms # generated with --significant-impact-threshold 0.15 diff --git a/.gitlab/benchmarks/bp-runner.fail-on-regression.yml b/.gitlab/benchmarks/bp-runner.fail-on-regression.yml deleted file mode 100644 index e5c43e8194f..00000000000 --- a/.gitlab/benchmarks/bp-runner.fail-on-regression.yml +++ /dev/null @@ -1,7 +0,0 @@ -experiments: - - name: Run regression check - steps: - - name: Regression Check - run: fail_on_regression - # Applies on all scenarios - regression_threshold: 10.0 # percents diff --git a/.gitlab/collect-result/CollectResults.java b/.gitlab/collect-result/CollectResults.java new file mode 100644 index 00000000000..ac8d1cea04a --- /dev/null +++ b/.gitlab/collect-result/CollectResults.java @@ -0,0 +1,17 @@ +import java.nio.file.Path; +import java.util.List; + +class CollectResults { + public static void main(String[] args) throws Exception { + // Detect flaky jobs + var continueOnFailure = Boolean.parseBoolean(System.getenv("CONTINUE_ON_FAILURE")); + // Run collector + var collector = + new ResultCollector( + Path.of("results"), + Path.of("workspace"), + List.of(Path.of("workspace"), Path.of("buildSrc")), + continueOnFailure); + collector.collect(); + } +} diff --git a/.gitlab/collect-result/JUnitReport.java b/.gitlab/collect-result/JUnitReport.java new file mode 100644 index 00000000000..a77a54af4b3 --- /dev/null +++ b/.gitlab/collect-result/JUnitReport.java @@ -0,0 +1,292 @@ +import java.io.OutputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; +import javax.xml.XMLConstants; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.transform.OutputKeys; +import javax.xml.transform.TransformerFactory; +import javax.xml.transform.dom.DOMSource; +import javax.xml.transform.stream.StreamResult; +import org.w3c.dom.Document; +import org.w3c.dom.Element; + +final class JUnitReport { + private static final String FINAL_STATUS_PROPERTY = "dd_tags[test.final_status]"; + private static final Pattern HASH_CODE = Pattern.compile("@[0-9a-f]{5,}"); + private static final Pattern LOCALHOST_PORT = Pattern.compile("localhost:[0-9]{2,5}"); + private static final DocumentBuilderFactory DOCUMENT_BUILDER_FACTORY = + newDocumentBuilderFactory(); + private static final TransformerFactory TRANSFORMER_FACTORY = newTransformerFactory(); + + private final Document document; + + private JUnitReport(Document document) { + this.document = document; + } + + static JUnitReport parse(Path xmlFile) throws Exception { + var document = DOCUMENT_BUILDER_FACTORY.newDocumentBuilder().parse(xmlFile.toFile()); + return new JUnitReport(document); + } + + boolean addFileAttribute(String sourceFile) { + var changed = false; + for (var testcase : testcases()) { + if (testcase.hasAttribute("time")) { + changed |= !sourceFile.equals(testcase.getAttribute("file")); + testcase.setAttribute("file", sourceFile); + } + } + return changed; + } + + boolean normalizeStableTestNames() { + var changed = false; + for (var testcase : testcases()) { + var attributes = testcase.getAttributes(); + for (var i = 0; i < attributes.getLength(); i++) { + var attribute = attributes.item(i); + var value = attribute.getNodeValue(); + var normalized = + LOCALHOST_PORT + .matcher(HASH_CODE.matcher(value).replaceAll("@HASHCODE")) + .replaceAll("localhost:PORT"); + if (!value.equals(normalized)) { + attribute.setNodeValue(normalized); + changed = true; + } + } + } + return changed; + } + + /// Tags framework-emitted synthetic testcases so Test Optimization does not treat them as + /// real failures. + /// + /// **Criteria for new entries:** + /// - Must be a name the framework/runner emits itself — never use a name that a user-authored test + /// could legitimately have. + /// - Must link to the source that emits the literal, pinned to a release tag (not a commit + /// hash). + /// + /// **Frameworks/libraries to audit before adding a name:** JUnit 4, JUnit Platform engines + /// (Vintage / Jupiter), Gradle's JUnit and JUnit Platform adapters, TestNG, Spock, Kotest, + /// Maven Surefire/Failsafe. JUnit 5's main sources do not define these literals — Vintage + /// forwards `"initializationError"` from JUnit 4 as-is, and `"executionError"` is + /// Gradle-specific. + /// + /// **Do not add** generic English names such as `"test exception"`. Spock feature methods + /// (`def "..."()`), JUnit 5 `@DisplayName`, and Kotest specs can all produce them, so the + /// tagger would silently mask real pass/fail outcomes. + void tagSyntheticFailures() { + Map> initializationErrorsByClassname = new LinkedHashMap<>(); + for (var testcase : testcases()) { + switch (testcase.getAttribute("name")) { + // JUnit 4 ErrorReportingRunner — initializationError + // https://github.com/junit-team/junit4/blob/r4.13.2/src/main/java/org/junit/internal/runners/ErrorReportingRunner.java#L83 + // Gradle JUnit Platform listener — reuses the same name for synthetic container failures + // https://github.com/gradle/gradle/blob/v8.14.5/platforms/jvm/testing-junit-platform/src/main/java/org/gradle/api/internal/tasks/testing/junitplatform/JUnitPlatformTestExecutionListener.java#L248 + // https://github.com/gradle/gradle/blob/v9.5.0/platforms/jvm/testing-jvm-infrastructure/src/main/java/org/gradle/api/internal/tasks/testing/junitplatform/JUnitPlatformTestExecutionListener.java#L426 + case "initializationError" -> + initializationErrorsByClassname + .computeIfAbsent(testcase.getAttribute("classname"), ignored -> new ArrayList<>()) + .add(testcase); + // Gradle JUnit Platform listener — executionError, used when descendants already started + // https://github.com/gradle/gradle/blob/v8.14.5/platforms/jvm/testing-junit-platform/src/main/java/org/gradle/api/internal/tasks/testing/junitplatform/JUnitPlatformTestExecutionListener.java#L248 + // https://github.com/gradle/gradle/blob/v9.5.0/platforms/jvm/testing-jvm-infrastructure/src/main/java/org/gradle/api/internal/tasks/testing/junitplatform/JUnitPlatformTestExecutionListener.java#L426 + case "executionError" -> + addFinalStatusProperty(testcase, "skip", MissingPropertiesPlacement.APPEND_TO_TESTCASE); + default -> {} + } + } + + for (var group : initializationErrorsByClassname.values()) { + for (var i = 0; i < group.size() - 1; i++) { + addFinalStatusProperty( + group.get(i), "skip", MissingPropertiesPlacement.APPEND_TO_TESTCASE); + } + } + } + + /// Tags every attempt of a retried test except the final one with `skip`, so Test Optimization + /// counts only the decisive (last) attempt and ignores intermediate retries. + /// + /// Gradle's Develocity test-retry plugin re-runs a failing test and appends each attempt to the + /// same per-class JUnit report as another `` with an identical `classname#name`. The + /// plugin stops retrying once a test passes or retries are exhausted, so the last such element in + /// document order is the decisive attempt and every earlier duplicate is tagged `skip`. + /// + /// **Must run before {@link #normalizeStableTestNames()}.** Keys are matched on raw names so two + /// genuinely distinct tests whose names differ only in an unstable token (e.g. `localhost:12345` + /// vs `localhost:23456`, which normalization collapses to `localhost:PORT`) are not mistaken for + /// retries of each other. + /// + /// Tagging uses the same `addFinalStatusProperty` path as {@link #tagFinalStatuses()}, which then + /// leaves the already-tagged earlier attempts untouched and assigns the natural pass/fail status + /// only to the final attempt. + void tagRetriedAttempts() { + var attemptsByKey = new LinkedHashMap>(); + for (var testcase : testcases()) { + var key = testcase.getAttribute("classname") + "#" + testcase.getAttribute("name"); + attemptsByKey.computeIfAbsent(key, ignored -> new ArrayList<>()).add(testcase); + } + for (var attempts : attemptsByKey.values()) { + for (var i = 0; i < attempts.size() - 1; i++) { + addFinalStatusProperty(attempts.get(i), "skip", MissingPropertiesPlacement.FIRST_CHILD); + } + } + } + + void tagFinalStatuses() { + for (var testcase : testcases()) { + if (hasFinalStatusProperty(testcase)) { + continue; + } + addFinalStatusProperty( + testcase, finalStatus(testcase), MissingPropertiesPlacement.FIRST_CHILD); + } + } + + /// Marks every testcase as `test.final_status=skip` for jobs that tolerate failures. + /// + /// The flaky test jobs (`test_flaky`, `test_flaky_inst`) run with `CONTINUE_ON_FAILURE=true`, so + /// their result never gates the pipeline: it runs to completion regardless of pass or fail. + /// `test.final_status` records that CI impact rather than the raw outcome, so every test in these + /// jobs is `skip` — a failure is a non-blocking failure and a pass is a non-blocking pass. This + /// keeps flaky failures from creating false-positive notifications and skewing SLIs, while the + /// real per-test outcome stays available in `test.status` (derived from the ``, + /// ``, and `` children, which are left in place). Always-green tests that could + /// leave the flaky pipeline are then found with `@test.status:pass @test.final_status:skip`. + /// + /// **Must run before {@link #tagFinalStatuses()}** so the natural pass/fail status is never + /// assigned. Testcases already tagged by {@link #tagRetriedAttempts()} or + /// {@link #tagSyntheticFailures()} are left untouched (already `skip`). + void tagAllAsSkipped() { + for (var testcase : testcases()) { + if (hasFinalStatusProperty(testcase)) { + continue; + } + addFinalStatusProperty(testcase, "skip", MissingPropertiesPlacement.FIRST_CHILD); + } + } + + void write(Path xmlFile) throws Exception { + Files.createDirectories(xmlFile.getParent()); + var tmpFile = Files.createTempFile(xmlFile.getParent(), "collect-results-", ".xml"); + try (OutputStream output = Files.newOutputStream(tmpFile)) { + var transformer = TRANSFORMER_FACTORY.newTransformer(); + transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8"); + transformer.transform(new DOMSource(document), new StreamResult(output)); + } catch (Exception e) { + Files.deleteIfExists(tmpFile); + throw e; + } + Files.move(tmpFile, xmlFile, StandardCopyOption.REPLACE_EXISTING); + } + + private static DocumentBuilderFactory newDocumentBuilderFactory() { + try { + var factory = DocumentBuilderFactory.newInstance(); + factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); + factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); + factory.setFeature("http://xml.org/sax/features/external-general-entities", false); + factory.setFeature("http://xml.org/sax/features/external-parameter-entities", false); + factory.setXIncludeAware(false); + factory.setExpandEntityReferences(false); + return factory; + } catch (Exception e) { + throw new ExceptionInInitializerError(e); + } + } + + private static TransformerFactory newTransformerFactory() { + var factory = TransformerFactory.newInstance(); + factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""); + factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_STYLESHEET, ""); + return factory; + } + + private List testcases() { + var testcases = document.getElementsByTagName("testcase"); + var elements = new ArrayList(testcases.getLength()); + for (var i = 0; i < testcases.getLength(); i++) { + elements.add((Element) testcases.item(i)); + } + return elements; + } + + private boolean addFinalStatusProperty( + Element testcase, String status, MissingPropertiesPlacement missingPropertiesPlacement) { + var properties = firstChildElement(testcase, "properties"); + if (properties != null) { + if (propertiesHasFinalStatusProperty(properties)) { + return false; + } + } else { + properties = document.createElement("properties"); + if (missingPropertiesPlacement == MissingPropertiesPlacement.FIRST_CHILD) { + testcase.insertBefore(properties, testcase.getFirstChild()); + } else { + testcase.appendChild(properties); + } + } + + var property = document.createElement("property"); + property.setAttribute("name", FINAL_STATUS_PROPERTY); + property.setAttribute("value", status); + properties.appendChild(property); + return true; + } + + private static boolean hasFinalStatusProperty(Element testcase) { + var properties = firstChildElement(testcase, "properties"); + return properties != null && propertiesHasFinalStatusProperty(properties); + } + + private static boolean propertiesHasFinalStatusProperty(Element properties) { + var children = properties.getChildNodes(); + for (var i = 0; i < children.getLength(); i++) { + if (children.item(i) instanceof Element element + && "property".equals(element.getTagName()) + && FINAL_STATUS_PROPERTY.equals(element.getAttribute("name"))) { + return true; + } + } + return false; + } + + private static String finalStatus(Element testcase) { + if (hasChildElement(testcase, "failure") || hasChildElement(testcase, "error")) { + return "fail"; + } + if (hasChildElement(testcase, "skipped")) { + return "skip"; + } + return "pass"; + } + + private static Element firstChildElement(Element parent, String tagName) { + var children = parent.getChildNodes(); + for (var i = 0; i < children.getLength(); i++) { + if (children.item(i) instanceof Element element && tagName.equals(element.getTagName())) { + return element; + } + } + return null; + } + + private static boolean hasChildElement(Element parent, String tagName) { + return firstChildElement(parent, tagName) != null; + } + + private enum MissingPropertiesPlacement { + APPEND_TO_TESTCASE, + FIRST_CHILD + } +} diff --git a/.gitlab/collect-result/ResultCollector.java b/.gitlab/collect-result/ResultCollector.java new file mode 100644 index 00000000000..c851e95cdc2 --- /dev/null +++ b/.gitlab/collect-result/ResultCollector.java @@ -0,0 +1,129 @@ +import java.io.IOException; +import java.io.UncheckedIOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.stream.Stream; + +final class ResultCollector { + private static final int[] AGGREGATED_NAME_FIELDS_FROM_END = {5, 2, 1}; + + private final Path resultsDir; + private final Path workspaceDir; + private final List searchDirs; + private final boolean continueOnFailure; + private final SourceFileResolver sourceFileResolver; + + ResultCollector( + Path resultsDir, Path workspaceDir, List searchDirs, boolean continueOnFailure) { + this.resultsDir = resultsDir; + this.workspaceDir = workspaceDir; + this.searchDirs = searchDirs; + this.continueOnFailure = continueOnFailure; + this.sourceFileResolver = new SourceFileResolver(workspaceDir); + } + + void collect() throws Exception { + Files.createDirectories(resultsDir); + Files.createDirectories(workspaceDir); + + var testResultDirs = findTestResultDirs(); + if (testResultDirs.isEmpty()) { + System.out.println("No test results found"); + return; + } + + if (continueOnFailure) { + System.out.println("CONTINUE_ON_FAILURE=true: reporting all tests as skip"); + } + + System.out.println("Saving test results:"); + for (var sourceXml : findXmlFiles(testResultDirs)) { + collect(sourceXml); + } + } + + private void collect(Path sourceXml) throws Exception { + var aggregatedName = aggregatedFileName(sourceXml); + var targetXml = resultsDir.resolve(aggregatedName); + System.out.print("- " + toUnixString(sourceXml) + " as " + aggregatedName); + + var sourceFile = sourceFileResolver.resolve(sourceXml); + var report = JUnitReport.parse(sourceXml); + var reportChangedBeforeFinalStatus = report.addFileAttribute(sourceFile); + // Before normalization: retried attempts are matched on raw classname#name (see + // JUnitReport#tagRetriedAttempts) so distinct tests sharing a normalized name are not collapsed. + report.tagRetriedAttempts(); + reportChangedBeforeFinalStatus |= report.normalizeStableTestNames(); + report.tagSyntheticFailures(); + // Flaky jobs (CONTINUE_ON_FAILURE=true) never gate CI, so record every test as skip before + // assigning natural statuses (APMLP-1267). + if (continueOnFailure) { + report.tagAllAsSkipped(); + } + report.tagFinalStatuses(); + report.write(targetXml); + + if (reportChangedBeforeFinalStatus) { + System.out.print(" (non-stable test names detected)"); + } + System.out.println(); + } + + private List findTestResultDirs() throws IOException { + var found = new ArrayList(); + for (var searchDir : searchDirs) { + if (!Files.isDirectory(searchDir)) { + continue; + } + try (var paths = Files.walk(searchDir)) { + paths + .filter(Files::isDirectory) + .filter(path -> "test-results".equals(fileName(path))) + .forEach(found::add); + } + } + found.sort(Comparator.comparing(ResultCollector::toUnixString)); + return found; + } + + private static List findXmlFiles(List testResultDirs) throws IOException { + var found = new ArrayList(); + for (var testResultDir : testResultDirs) { + try (Stream paths = Files.walk(testResultDir)) { + paths + .filter(Files::isRegularFile) + .filter(path -> fileName(path).endsWith(".xml")) + .forEach(found::add); + } catch (UncheckedIOException e) { + throw e.getCause(); + } + } + found.sort(Comparator.comparing(ResultCollector::toUnixString)); + return found; + } + + private static String aggregatedFileName(Path sourceXml) { + var normalized = sourceXml.normalize(); + var parts = new ArrayList(AGGREGATED_NAME_FIELDS_FROM_END.length); + var nameCount = normalized.getNameCount(); + for (var fieldFromEnd : AGGREGATED_NAME_FIELDS_FROM_END) { + var index = nameCount - fieldFromEnd; + if (index >= 0) { + parts.add(normalized.getName(index).toString()); + } + } + return String.join("_", parts); + } + + private static String fileName(Path path) { + var fileName = path.getFileName(); + return fileName == null ? "" : fileName.toString(); + } + + static String toUnixString(Path path) { + return path.toString().replace(path.getFileSystem().getSeparator(), "/"); + } +} diff --git a/.gitlab/collect-result/SourceFileResolver.java b/.gitlab/collect-result/SourceFileResolver.java new file mode 100644 index 00000000000..bf35fc842be --- /dev/null +++ b/.gitlab/collect-result/SourceFileResolver.java @@ -0,0 +1,177 @@ +import java.io.BufferedReader; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; + +final class SourceFileResolver { + private static final String UNKNOWN = "UNKNOWN"; + private static final Pattern CLASS_DECLARATION = + Pattern.compile("\\b(?:static\\s+)?class\\s+([A-Za-z_$][A-Za-z0-9_$]*)\\b"); + + private final String workspacePrefix; + private final Map indexes = new HashMap<>(); + + SourceFileResolver(Path workspaceDir) { + this.workspacePrefix = ResultCollector.toUnixString(workspaceDir) + "/"; + } + + String resolve(Path resultXml) throws IOException { + var resultXmlPath = ResultCollector.toUnixString(resultXml); + var sourceRoot = sourceRoot(resultXmlPath); + if (resultXmlPath.contains("#")) { + return sourceRoot; + } + + var className = className(resultXml); + if (className.isEmpty()) { + return UNKNOWN; + } + + return indexes.computeIfAbsent(sourceRoot, SourceIndex::new).resolve(className); + } + + private String sourceRoot(String resultXmlPath) { + var buildIndex = resultXmlPath.indexOf("/build"); + var projectPath = buildIndex >= 0 ? resultXmlPath.substring(0, buildIndex) : resultXmlPath; + if (projectPath.startsWith(workspacePrefix)) { + projectPath = projectPath.substring(workspacePrefix.length()); + } + return projectPath + "/src"; + } + + private static String className(Path resultXml) { + var fileName = resultXml.getFileName(); + if (fileName == null) { + return ""; + } + + var name = fileName.toString(); + if (name.endsWith(".xml")) { + name = name.substring(0, name.length() - ".xml".length()); + } + + var testPrefix = name.lastIndexOf("TEST-"); + if (testPrefix >= 0) { + name = name.substring(testPrefix + "TEST-".length()); + } + + var packageSeparator = name.lastIndexOf('.'); + if (packageSeparator >= 0) { + name = name.substring(packageSeparator + 1); + } + + var innerClassSeparator = name.lastIndexOf('$'); + if (innerClassSeparator >= 0) { + name = name.substring(innerClassSeparator + 1); + } + return name; + } + + private static final class SourceIndex { + private final String sourceRoot; + private final Map> classLocations = new HashMap<>(); + private boolean indexed; + + private SourceIndex(String sourceRoot) { + this.sourceRoot = sourceRoot; + } + + private String resolve(String className) { + try { + indexIfNecessary(); + } catch (IOException e) { + return UNKNOWN; + } + + var locations = locations(className); + if (locations.isEmpty()) { + return UNKNOWN; + } + + var commonRoot = commonRoot(locations); + if (commonRoot == null) { + return UNKNOWN; + } + return "/" + ResultCollector.toUnixString(commonRoot); + } + + private List locations(String className) { + var locations = new ArrayList(); + for (var entry : classLocations.entrySet()) { + if (entry.getKey().startsWith(className)) { + locations.addAll(entry.getValue()); + } + } + return locations; + } + + private void indexIfNecessary() throws IOException { + if (indexed) { + return; + } + indexed = true; + + var root = Path.of(sourceRoot); + if (!Files.isDirectory(root)) { + return; + } + + try (var paths = Files.walk(root)) { + var iterator = + paths.filter(Files::isRegularFile).filter(SourceIndex::isSourceFile).iterator(); + while (iterator.hasNext()) { + try { + index(iterator.next()); + } catch (IOException ignored) { + // Match grep's best-effort behavior from the old shell implementation. + } + } + } + } + + private static boolean isSourceFile(Path path) { + var fileName = path.getFileName(); + if (fileName == null) { + return false; + } + var name = fileName.toString(); + return name.endsWith(".java") + || name.endsWith(".groovy") + || name.endsWith(".kt") + || name.endsWith(".scala"); + } + + private void index(Path sourceFile) throws IOException { + try (BufferedReader reader = Files.newBufferedReader(sourceFile, StandardCharsets.UTF_8)) { + String line; + while ((line = reader.readLine()) != null) { + var matcher = CLASS_DECLARATION.matcher(line); + while (matcher.find()) { + classLocations + .computeIfAbsent(matcher.group(1), ignored -> new ArrayList<>()) + .add(sourceFile); + } + } + } + } + + private static Path commonRoot(List locations) { + var commonRoot = locations.get(0); + for (var location : locations) { + while (commonRoot != null && !location.startsWith(commonRoot)) { + commonRoot = commonRoot.getParent(); + } + if (commonRoot == null) { + return null; + } + } + return commonRoot.getNameCount() == 0 ? null : commonRoot; + } + } +} diff --git a/.gitlab/collect_results.sh b/.gitlab/collect_results.sh index 36614632481..de404f48513 100755 --- a/.gitlab/collect_results.sh +++ b/.gitlab/collect_results.sh @@ -3,100 +3,13 @@ # Save all important reports and artifacts into (project-root)/results # This folder will be saved by gitlab and available after test runs. -set -e -# Enable '**' support -shopt -s globstar +set -euo pipefail -TEST_RESULTS_DIR=results -WORKSPACE_DIR=workspace -mkdir -p $TEST_RESULTS_DIR -mkdir -p $WORKSPACE_DIR - -# Main project modules redirect their build directory to workspace//build/ in CI -# (see build.gradle.kts layout.buildDirectory override). buildSrc is a separate Gradle build -# that runs before the main build is configured, so this redirect never applies to it; -# its test results always land in buildSrc/**/build/test-results/, not under workspace/. -SEARCH_DIRS=($WORKSPACE_DIR buildSrc) - -mapfile -t TEST_RESULT_DIRS < <(find "${SEARCH_DIRS[@]}" -name test-results -type d) - -if [[ ${#TEST_RESULT_DIRS[@]} -eq 0 ]]; then - echo "No test results found" - exit 0 +java_bin="${JAVA_25_HOME:-}" +if [[ -n "$java_bin" ]]; then + java_bin="$java_bin/bin/java" +else + java_bin="java" fi -function get_source_file () { - file_path="${RESULT_XML_FILE%%"/build"*}" - file_path="${file_path/#"$WORKSPACE_DIR"\//}/src" - if ! [[ $RESULT_XML_FILE == *"#"* ]]; then - class="${RESULT_XML_FILE%.xml}" - class="${class##*"TEST-"}" - class="${class##*"."}" - class="${class##*"$"}" # remove inner class name if it exists - set +e # allow grep to fail - common_root=$(grep -rl "class $class\|static class $class" "$file_path" 2>/dev/null | head -n 1) - set -e - - if [[ -n "$common_root" ]]; then - while IFS= read -r line; do - while [[ $line != "$common_root"* ]]; do - common_root=$(dirname "$common_root") - if [[ "$common_root" == "$common_root/.." ]] || [[ "$common_root" == "/" ]]; then - common_root="" - break - fi - done - done < <(grep -rl "class $class\|static class $class" "$file_path" 2>/dev/null) - - if [[ -n "$common_root" && "$common_root" != "/" ]]; then - file_path="/$common_root" - else - file_path="UNKNOWN" - fi - else - file_path="UNKNOWN" - fi - fi -} - -echo "Saving test results:" -while IFS= read -r -d '' RESULT_XML_FILE -do - echo -n "- $RESULT_XML_FILE" - # Assuming the path looks like that: dd-java-agent/instrumentation/tomcat/tomcat-5.5/build/test-results/forkedTest/TEST-TomcatServletV1ForkedTest.xml - # it will extracts 3 components from the path (counting from the end), to form the new name AGGREGATED_FILE_NAME: - # - # 1. Field 1 (from end): The XML filename itself - # 2. Field 2 (from end): The test suite type (test, forkedTest, etc.) - # 3. Field 5 (from end): The module/subproject name - # - # E.g. for the example path: tomcat-5.5_forkedTest_TEST-TomcatServletV1ForkedTest.xml - AGGREGATED_FILE_NAME=$(echo "$RESULT_XML_FILE" | rev | cut -d "/" -f 1,2,5 | rev | tr "/" "_") - echo -n " as $AGGREGATED_FILE_NAME" - TARGET_DIR="$TEST_RESULTS_DIR" - mkdir -p "$TARGET_DIR" - cp "$RESULT_XML_FILE" "$TARGET_DIR/$AGGREGATED_FILE_NAME" - # Insert file attribute to testcase XML nodes - get_source_file - sed -i "//dev/null; then MAX_VER="$ver" fi diff --git a/.gitmodules b/.gitmodules index 27fc232a993..18769cc41ae 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "dd-java-agent/agent-jmxfetch/integrations-core"] path = dd-java-agent/agent-jmxfetch/integrations-core url = https://github.com/DataDog/integrations-core.git +[submodule "dd-smoke-tests/openfeature/src/test/resources/ffe-system-test-data"] + path = dd-smoke-tests/openfeature/src/test/resources/ffe-system-test-data + url = https://github.com/DataDog/ffe-system-test-data.git diff --git a/AGENTS.md b/AGENTS.md index e09dff0d473..d9852d96b43 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -38,6 +38,7 @@ docs/ Developer documentation (see below) | Testing guide (6 test types) | [docs/how_to_test.md](docs/how_to_test.md) | | Working with Gradle | [docs/how_to_work_with_gradle.md](docs/how_to_work_with_gradle.md) | | Bootstrap/premain constraints | [docs/bootstrap_design_guidelines.md](docs/bootstrap_design_guidelines.md) | +| Instrumentation/advice constraints | [docs/instrumentation_design_guidelines.md](docs/instrumentation_design_guidelines.md) | | CI/CD workflows | [.github/workflows/README.md](.github/workflows/README.md) | **When working on a topic above, read the linked file first** — they are the source of truth maintained by humans. @@ -56,27 +57,26 @@ docs/ Developer documentation (see below) ## Code conventions - **Formatting**: google-java-format enforced via Spotless. Run `./gradlew spotlessApply` before committing. -- **Static imports**: Prefer static imports over class-qualified calls for call-style helpers — JUnit `Assertions`, Mockito (`mock`, `when`, `verify`, `anyString`, `RETURNS_DEFAULTS`, ...), Hamcrest/AssertJ matchers, internal test DSLs, and similar. Same goes for production code: `Collections.emptyList()` is fine, but if you find yourself repeatedly writing `Foo.bar(...)` where `Foo` adds no information at the call site, static-import `bar`. Wildcard `import static x.*` is disallowed (enforced by IDE config in CONTRIBUTING.md). +- **Static imports**: Prefer static imports over class-qualified calls for call-style helpers, in both test (Assertions.assertEquals, Mockito.mock) and production code (Collections.emptyList). Wildcard imports disallowed — see CONTRIBUTING.md. - **Instrumentation layout**: `dd-java-agent/instrumentation/{framework}/{framework}-{minVersion}/` - **Instrumentation pattern**: Type matching → Method matching → Advice class (bytecode advice, not AOP) -- **Test frameworks**: Always use JUnit 5. **Do not write new Groovy / Spock tests** and migrate the existing one to JUnit 5 if it is written in Groovy. +- **Test frameworks**: Always use JUnit 5 for unit tests. Only use Groovy / Spock tests for instrumentation and smoke tests. - **Forked tests**: Use `ForkedTest` suffix when tests need a separate JVM - **Flaky tests**: Annotate with `@Flaky` — they are skipped in CI by default -- **Instrumentation one-shot methods**: Never extract the return values of `triggerClasses()`, `contextStore()`, `classLoaderMatcher()`, or `methodAdvice()` into static constants. These are called once by the framework — extracting to a constant adds constant-pool bloat with no benefit. ## PR conventions - Title: imperative verb sentence describing user-visible change (e.g. "Fix span sampling rule parsing") -- Labels: at least one `comp:` or `inst:` label + one `type:` label -- Use `tag: no release note` for internal/refactoring changes -- Use `tag: ai generated` for AI generated code +- Labels: always add `tag: ai generated` and at least one `comp:` or `inst:` label + one `type:` label +- Use `tag: no release notes` for internal/refactoring changes - Open as draft first, convert to ready when reviewable -## Bootstrap constraints (critical) +## Review Guidelines -Code running in the agent's `premain` phase must **not** use: -- `java.util.logging.*` — locks in log manager before app configures it -- `java.nio.*` — triggers premature provider initialization -- `javax.management.*` — causes class loading issues +- **Technical debt**: run `/techdebt` over branch changes before marking a PR ready to catch code duplication, unnecessary complexity, and dead code (refactor-only, never changes behavior) — see [.agents/skills/techdebt/SKILL.md](.agents/skills/techdebt/SKILL.md). +- **Performance**: run `/perf-review` over branch changes before marking a PR ready (advisory, not a merge gate) — see [.agents/skills/perf-review/SKILL.md](.agents/skills/perf-review/SKILL.md). -See [docs/bootstrap_design_guidelines.md](docs/bootstrap_design_guidelines.md) for details and alternatives. +## Critical constraints + +- **Bootstrap**: never use `java.util.logging.*`, `java.nio.file.*`, or `javax.management.*` in `premain` code — see [docs/bootstrap_design_guidelines.md](docs/bootstrap_design_guidelines.md). +- **Advice**: never call a static interface method from advice — can cause a `VerifyError` — see [docs/instrumentation_design_guidelines.md](docs/instrumentation_design_guidelines.md). diff --git a/BUILDING.md b/BUILDING.md index 5a557933b54..0ea6bfcec8a 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -179,7 +179,8 @@ winget install --id Docker.DockerDesktop > Without this configuration, you will need to remember to add `--recurse-submodules` to `git checkout` when switching to old branches. > [!TIP] -> This will keep the submodule in `dd-java-agent/agent-jmxfetch/integrations-core` up-to-date. +> This will keep the submodules in `dd-java-agent/agent-jmxfetch/integrations-core` and +> `dd-smoke-tests/openfeature/src/test/resources/ffe-system-test-data` up-to-date. > There is also an automated check when opening a pull request if you are trying to submit a module version change (usually an outdated version). > [!NOTE] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1399caf947a..c023a09af5e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -63,6 +63,16 @@ For IntelliJ IDEA, we suggest the following settings and plugin. * To run test in a specific JDK use the `testJvm` property, e.g. `-PtestJvm=11` * Install the [Google Java Format](https://plugins.jetbrains.com/plugin/8527-google-java-format) plugin +### Static imports + +Prefer static imports over class-qualified calls for call-style helpers — JUnit `Assertions`, Mockito (`mock`, +`when`, `verify`, `anyString`, `RETURNS_DEFAULTS`, ...), Hamcrest/AssertJ matchers, internal test DSLs, and similar. + +Same goes for production code: `Collections.emptyList()` is fine, but if you find yourself repeatedly writing +`Foo.bar(...)` where `Foo` adds no information at the call site, static-import `bar`. + +Wildcard imports (`import x.*` or `import static x.*`) are disallowed — see the IntelliJ IDEA settings above. + ### Troubleshooting * Gradle fails with a "too many open files" error. @@ -118,7 +128,7 @@ Both pull requests and issues should be labelled with at least a component or an Labels are used to not only categorize but also alter the continuous integration behavior: -* `tag: no release note` to exclude a pull request from the next release changelog. Use it when changes are not relevant to the users like: +* `tag: no release notes` to exclude a pull request from the next release changelog. Use it when changes are not relevant to the users like: * Internal features changes * Refactoring pull requests * CI and build tools improvements @@ -130,6 +140,21 @@ Labels are used to not only categorize but also alter the continuous integration > For reference, the [full list of all labels available](https://github.com/DataDog/dd-trace-java/labels). > If you feel one is missing, let [the maintainer team](https://github.com/orgs/DataDog/teams/apm-java) know! +### Merge Queue + +Pull requests are merged into the protected branches using [the Datadog GitLab merge queue system](https://datadoghq.atlassian.net/wiki/spaces/DEVX/pages/3121612126/MergeQueue). +Once approved, pull requests can be added to merge queue using the `Merge when ready` button at the bottom of the page, or by commenting `/merge`. +The merge queue will run more tests than the pull request checks, meaning having test failures on merge queue while having pull request checks passing is an expected behavior - the pull request checks are lighter to provide quick feedback during development iterations. + +By default, the merge commit message uses the pull request title as its subject and the squashed pull request commit messages as its body. +A custom commit message can be specified by commenting `/merge --commit-message "custom message"`. + +Pull requests can be force-merged by commenting: `/merge -f --reason "reason"`. + +>[!WARNING] +> By-passing merge queue will effectively merge pull request content without running all continuous integration tests and checks. +> Only by-pass the merge queue to fix the build or help restore the continuous integration status. + ## Pull request reviews ### Review expectations diff --git a/README.md b/README.md index 4c9e32ff166..2eb760e369c 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,10 @@ -![Datadog logo](https://imgix.datadoghq.com/img/about/presskit/logo-h/dd_horizontal_white.png) +

+ + + + Datadog logo + +

# Datadog Java APM diff --git a/benchmark/Dockerfile b/benchmark/Dockerfile deleted file mode 100644 index 0279186478a..00000000000 --- a/benchmark/Dockerfile +++ /dev/null @@ -1,103 +0,0 @@ -# Petclinic download and compilation stage -FROM eclipse-temurin:17-jammy as petclinic - -ARG SPRING_PETCLINIC_COMMIT=cefaf55dd124d0635abfe857c3c99a3d3ea62017 - -RUN apt-get update \ - && apt-get -y install git \ - && apt-get -y clean \ - && rm -rf /var/lib/apt/lists/* - -RUN set -eux;\ - git init spring-petclinic;\ - cd spring-petclinic;\ - git remote add origin https://github.com/spring-projects/spring-petclinic.git;\ - git fetch --depth 1 origin ${SPRING_PETCLINIC_COMMIT};\ - git checkout ${SPRING_PETCLINIC_COMMIT};\ - ./mvnw dependency:go-offline - -RUN cd spring-petclinic \ - && ./mvnw package -Dmaven.test.skip=true \ - && cp target/*.jar /spring-petclinic.jar - - -# Insecure bank download and compilation stage -FROM eclipse-temurin:17-jammy as insecure-bank - -RUN apt-get update \ - && apt-get -y install git \ - && apt-get -y clean \ - && rm -rf /var/lib/apt/lists/* - -RUN git clone --depth 1 --branch malvarez/spring-boot --single-branch https://github.com/hdiv/insecure-bank.git \ - && cd insecure-bank \ - && ./gradlew -q dependencies - -RUN cd insecure-bank \ - && ./gradlew bootWar \ - && cp build/libs/*.war /insecure-bank.war - -# Dacapo download -FROM debian:bookworm-slim as dacapo -RUN apt-get update \ - && apt-get -y install wget unzip \ - && apt-get -y clean \ - && rm -rf /var/lib/apt/lists/* - -ARG DACAPO_VERSION=23.11-chopin -# The data for the big benchmarks is removed too ensure the final docker image is not too big -RUN wget -nv -O dacapo.zip https://download.dacapobench.org/chopin/dacapo-$DACAPO_VERSION.zip \ - && mkdir /dacapo \ - && unzip dacapo.zip -d /dacapo/ \ - && rm -rf /dacapo/dacapo-$DACAPO_VERSION/dat/luindex \ - && rm -rf /dacapo/dacapo-$DACAPO_VERSION/dat/lusearch \ - && rm -rf /dacapo/dacapo-$DACAPO_VERSION/dat/graphchi \ - && rm dacapo.zip - -FROM debian:bookworm-slim - -RUN apt-get update \ - && apt-get -y install git curl wget procps gettext-base \ - && apt-get -y clean \ - && rm -rf /var/lib/apt/lists/* - -COPY --from=eclipse-temurin:8-jammy /opt/java/openjdk /usr/lib/jvm/8 -COPY --from=eclipse-temurin:11-jammy /opt/java/openjdk /usr/lib/jvm/11 -COPY --from=eclipse-temurin:17-jammy /opt/java/openjdk /usr/lib/jvm/17 - -RUN rm -rf \ - /usr/lib/jvm/*/man \ - /usr/lib/jvm/*/src.zip \ - /usr/lib/jvm/*/lib/src.zip \ - /usr/lib/jvm/*/demo \ - /usr/lib/jvm/*/sample - -ENV JAVA_8_HOME=/usr/lib/jvm/8 -ENV JAVA_11_HOME=/usr/lib/jvm/11 -ENV JAVA_17_HOME=/usr/lib/jvm/17 -ENV JAVA_HOME=${JAVA_8_HOME} -ENV PATH=${PATH}:${JAVA_HOME}/bin - -ARG SIRUN_VERSION=0.1.11 -RUN wget -O sirun.tar.gz https://github.com/DataDog/sirun/releases/download/v$SIRUN_VERSION/sirun-v$SIRUN_VERSION-x86_64-unknown-linux-musl.tar.gz \ - && tar -xzf sirun.tar.gz \ - && rm sirun.tar.gz \ - && mv sirun /usr/bin/sirun - -ARG K6_VERSION=0.45.1 -RUN wget -O k6.tar.gz https://github.com/grafana/k6/releases/download/v$K6_VERSION/k6-v$K6_VERSION-linux-amd64.tar.gz \ - && tar --strip-components=1 -xzf k6.tar.gz \ - && rm k6.tar.gz \ - && mv k6 /usr/bin/k6 - -RUN mkdir -p /app - -COPY --from=petclinic /spring-petclinic.jar /app/spring-petclinic.jar -ENV PETCLINIC=/app/spring-petclinic.jar - -COPY --from=insecure-bank /insecure-bank.war /app/insecure-bank.war -ENV INSECURE_BANK=/app/insecure-bank.war - -COPY --from=dacapo /dacapo/ /app/ -ARG DACAPO_VERSION=23.11-chopin -ENV DACAPO=/app/dacapo-$DACAPO_VERSION.jar diff --git a/benchmark/README.MD b/benchmark/README.MD deleted file mode 100644 index 30f3bbcf864..00000000000 --- a/benchmark/README.MD +++ /dev/null @@ -1,29 +0,0 @@ -# Benchmarks - -This directory contains different types of benchmarks. - -## Running Benchmarks via Docker - -Docker allows the execution of benchmarks without needing to install and configure your development environment. For example, package installation and installation of sirun are performed automatically. - -In order to run benchmarks using Docker, issue the following command from the `benchmark/` folder of this project: - -```sh -./run.sh -``` - -If you run into storage errors (e.g. running out of disk space), try removing all unused Docker containers, networks, and images with `docker system prune -af` before running the script again. Once finished, the reports will be available in the `benchmark/reports/` folder. Note that the script can take ~40 minutes to run. - -### Running specific benchmarks - -If you want to run only a specific category of benchmarks, you can do so via arguments: - -1. Run startup benchmarks -```sh -./run.sh startup [application]? -``` - -2. Run load benchmarks -```sh -./run.sh load [application]? -``` diff --git a/benchmark/benchmarks.sh b/benchmark/benchmarks.sh deleted file mode 100755 index 0b245038afa..00000000000 --- a/benchmark/benchmarks.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash -set -eu - -readonly SCRIPT_DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd) -export TRACER_DIR="${SCRIPT_DIR}/.." -export REPORTS_DIR="${SCRIPT_DIR}/reports" -export UTILS_DIR="${SCRIPT_DIR}/utils" -export SHELL_UTILS_DIR="${UTILS_DIR}/shell" -export K6_UTILS_DIR="${UTILS_DIR}/k6" -export TRACER="${SCRIPT_DIR}/tracer/dd-java-agent.jar" -export NO_AGENT_VARIANT="no_agent" - -run_benchmarks() { - local type=$1 - if [[ -d "${type}" ]] && [[ -f "${type}/run.sh" ]]; then - cd "${type}" - ./run.sh "$@" - cd "${SCRIPT_DIR}" - fi -} - -# Find or rebuild tracer to be used in the benchmarks -if [[ ! -f "${TRACER}" ]]; then - mkdir -p "${SCRIPT_DIR}/tracer" - cd "${TRACER_DIR}" - readonly TRACER_VERSION=$(./gradlew properties -q | grep "version:" | awk '{print $2}') - readonly TRACER_COMPILED="${SCRIPT_DIR}/../dd-java-agent/build/libs/dd-java-agent-${TRACER_VERSION}.jar" - if [[ ! -f "${TRACER_COMPILED}" ]]; then - echo "Tracer not found, starting gradle compile ..." - ./gradlew assemble - fi - cp "${TRACER_COMPILED}" "${TRACER}" - cd "${SCRIPT_DIR}" -fi - -if [[ "$#" == '0' ]]; then - for type in 'startup' 'load' 'dacapo'; do - run_benchmarks "$type" - done -else - run_benchmarks "$@" -fi diff --git a/benchmark/dacapo/benchmark.json b/benchmark/dacapo/benchmark.json deleted file mode 100644 index ec0ca767f43..00000000000 --- a/benchmark/dacapo/benchmark.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "name": "dacapo_${BENCHMARK}", - "setup": "bash -c \"mkdir -p ${OUTPUT_DIR}/${VARIANT}\"", - "run": "bash -c \"java ${JAVA_OPTS} -jar ${DACAPO} --converge --scratch-directory=${OUTPUT_DIR}/${VARIANT}/scratch --latency-csv ${BENCHMARK} &> ${OUTPUT_DIR}/${VARIANT}/dacapo.log\"", - "timeout": 150, - "iterations": 1, - "variants": { - "${NO_AGENT_VARIANT}": { - "env": { - "VARIANT": "${NO_AGENT_VARIANT}", - "JAVA_OPTS": "" - } - }, - "tracing": { - "env": { - "VARIANT": "tracing", - "JAVA_OPTS": "-javaagent:${TRACER}" - } - }, - "profiling": { - "env": { - "VARIANT": "profiling", - "JAVA_OPTS": "-javaagent:${TRACER} -Ddd.profiling.enabled=true" - } - }, - "appsec": { - "env": { - "VARIANT": "appsec", - "JAVA_OPTS": "-javaagent:${TRACER} -Ddd.appsec.enabled=true -Ddd.iast.enabled=false" - } - }, - "iast": { - "env": { - "VARIANT": "iast", - "JAVA_OPTS": "-javaagent:${TRACER} -Ddd.iast.enabled=true" - } - }, - "iast_GLOBAL": { - "env": { - "VARIANT": "iast_GLOBAL", - "JAVA_OPTS": "-javaagent:${TRACER} -Ddd.iast.enabled=true -Ddd.iast.context.mode=GLOBAL" - } - } - } -} diff --git a/benchmark/dacapo/run.sh b/benchmark/dacapo/run.sh deleted file mode 100755 index ece44f9e5f0..00000000000 --- a/benchmark/dacapo/run.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash -set -eu - -source "${UTILS_DIR}/update-java-version.sh" 11 - -function message() { - echo "$(date +"%T"): $1" -} - -run_benchmark() { - local type=$1 - - message "dacapo benchmark: ${type} started" - - # export the benchmark - export BENCHMARK="${type}" - - # create output folder for the test - export OUTPUT_DIR="${REPORTS_DIR}/dacapo/${type}" - mkdir -p "${OUTPUT_DIR}" - - # substitute environment variables in the json file - benchmark=$(mktemp) - # shellcheck disable=SC2046 - # shellcheck disable=SC2016 - envsubst "$(printf '${%s} ' $(env | cut -d'=' -f1))" "${benchmark}" - - # run the sirun test - sirun "${benchmark}" &>"${OUTPUT_DIR}/${type}.json" - - message "dacapo benchmark: ${type} finished" -} - -if [ "$#" == '2' ]; then - run_benchmark "$2" -else - for benchmark in biojava tomcat ; do - run_benchmark "${benchmark}" - done -fi - diff --git a/benchmark/load/insecure-bank/k6.js b/benchmark/load/insecure-bank/k6.js deleted file mode 100644 index 2dd800fa7e5..00000000000 --- a/benchmark/load/insecure-bank/k6.js +++ /dev/null @@ -1,76 +0,0 @@ -import http from 'k6/http'; -import {checkResponse, isOk, isRedirect} from "../../utils/k6.js"; - -const variants = { - "no_agent": { - "APP_URL": 'http://localhost:8080', - }, - "tracing": { - "APP_URL": 'http://localhost:8081', - }, - "profiling": { - "APP_URL": 'http://localhost:8082', - }, - "iast": { - "APP_URL": 'http://localhost:8083', - }, - "iast_GLOBAL": { - "APP_URL": 'http://localhost:8084', - }, - "iast_FULL": { - "APP_URL": 'http://localhost:8085', - }, -} - -export const options = function (variants) { - let scenarios = {}; - for (const variant of Object.keys(variants)) { - scenarios[`load--insecure-bank--${variant}--warmup`] = { - executor: 'constant-vus', // https://grafana.com/docs/k6/latest/using-k6/scenarios/executors/#all-executors - vus: 5, - duration: '165s', - gracefulStop: '2s', - env: { - "APP_URL": variants[variant]["APP_URL"] - } - }; - - scenarios[`load--insecure-bank--${variant}--high_load`] = { - executor: 'constant-vus', - vus: 5, - startTime: '167s', - duration: '15s', - gracefulStop: '2s', - env: { - "APP_URL": variants[variant]["APP_URL"] - } - }; - } - - return { - discardResponseBodies: true, - scenarios, - } -}(variants); - -export default function () { - - // login form - const loginResponse = http.post(`${__ENV.APP_URL}/login`, { - username: 'john', - password: 'test' - }, { - redirects: 0 - }); - checkResponse(loginResponse, isRedirect); - - // dashboard - const dashboard = http.get(`${__ENV.APP_URL}/dashboard`); - checkResponse(dashboard, isOk); - - // logout - const logout = http.get(`${__ENV.APP_URL}/j_spring_security_logout`, { - redirects: 0 - }); - checkResponse(logout, isRedirect); -} diff --git a/benchmark/load/insecure-bank/start-servers.sh b/benchmark/load/insecure-bank/start-servers.sh deleted file mode 100755 index 4cae95567f2..00000000000 --- a/benchmark/load/insecure-bank/start-servers.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash - -set -e - -start_server() { - local VARIANT=$1 - local JAVA_OPTS=$2 - - if [ -n "$CI_JOB_TOKEN" ]; then - # Inside BP, so we can assume 24 CPU cores available and set CPU affinity - CPU_AFFINITY_APP=$3 - else - CPU_AFFINITY_APP="" - fi - - mkdir -p "${LOGS_DIR}/${VARIANT}" - ${CPU_AFFINITY_APP}java ${JAVA_OPTS} -Xms3G -Xmx3G -jar ${INSECURE_BANK} &> ${LOGS_DIR}/${VARIANT}/insecure-bank.log &PID=$! - echo "${CPU_AFFINITY_APP}java ${JAVA_OPTS} -Xms3G -Xmx3G -jar ${INSECURE_BANK} &> ${LOGS_DIR}/${VARIANT}/insecure-bank.log [PID=$PID]" -} - -start_server "no_agent" "-Dserver.port=8080" "taskset -c 47 " & -start_server "tracing" "-javaagent:${TRACER} -Dserver.port=8081" "taskset -c 46 " & -start_server "profiling" "-javaagent:${TRACER} -Ddd.profiling.enabled=true -Dserver.port=8082" "taskset -c 45 " & -start_server "iast" "-javaagent:${TRACER} -Ddd.iast.enabled=true -Dserver.port=8083" "taskset -c 44 " & -start_server "iast_GLOBAL" "-javaagent:${TRACER} -Ddd.iast.enabled=true -Ddd.iast.context.mode=GLOBAL -Dserver.port=8084" "taskset -c 43 " & -start_server "iast_FULL" "-javaagent:${TRACER} -Ddd.iast.enabled=true -Ddd.iast.detection.mode=FULL -Dserver.port=8085" "taskset -c 42 " & - -wait diff --git a/benchmark/load/petclinic/k6.js b/benchmark/load/petclinic/k6.js deleted file mode 100644 index debeab10a8e..00000000000 --- a/benchmark/load/petclinic/k6.js +++ /dev/null @@ -1,61 +0,0 @@ -import http from 'k6/http'; -import {checkResponse, isOk} from "../../utils/k6.js"; - -const variants = { - "no_agent": { - "APP_URL": 'http://localhost:8080', - }, - "tracing": { - "APP_URL": 'http://localhost:8081', - }, - "profiling": { - "APP_URL": 'http://localhost:8082', - }, - "appsec": { - "APP_URL": 'http://localhost:8083', - }, - "iast": { - "APP_URL": 'http://localhost:8084', - }, - "code_origins": { - "APP_URL": 'http://localhost:8085', - } -} - -export const options = function (variants) { - const scenarios = {}; - for (const variant of Object.keys(variants)) { - scenarios[`load--petclinic--${variant}--warmup`] = { - executor: 'constant-vus', // https://grafana.com/docs/k6/latest/using-k6/scenarios/executors/#all-executors - vus: 5, - duration: '165s', - gracefulStop: '2s', - env: { - "APP_URL": variants[variant]["APP_URL"] - } - }; - - scenarios[`load--petclinic--${variant}--high_load`] = { - executor: 'constant-vus', - vus: 5, - startTime: '167s', - duration: '15s', - gracefulStop: '2s', - env: { - "APP_URL": variants[variant]["APP_URL"] - } - }; - } - - return { - discardResponseBodies: true, - scenarios, - } -}(variants); - -export default function () { - - // find owner - const ownersList = http.get(`${__ENV.APP_URL}/owners?lastName=`); - checkResponse(ownersList, isOk); -} diff --git a/benchmark/load/petclinic/start-servers.sh b/benchmark/load/petclinic/start-servers.sh deleted file mode 100755 index 1ebbb4e0418..00000000000 --- a/benchmark/load/petclinic/start-servers.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env bash - -set -e - -start_server() { - local VARIANT=$1 - local JAVA_OPTS=$2 - - if [ -n "$CI_JOB_TOKEN" ]; then - # Inside BP, so we can assume 24 CPU cores available and set CPU affinity - CPU_AFFINITY_APP=$3 - else - CPU_AFFINITY_APP="" - fi - - mkdir -p "${LOGS_DIR}/${VARIANT}" - ${CPU_AFFINITY_APP}java ${JAVA_OPTS} -Xms2G -Xmx2G -jar ${PETCLINIC} &> ${LOGS_DIR}/${VARIANT}/petclinic.log &PID=$! - echo "${CPU_AFFINITY_APP}java ${JAVA_OPTS} -Xms2G -Xmx2G -jar ${PETCLINIC} &> ${LOGS_DIR}/${VARIANT}/petclinic.log [PID=$!]" -} - -start_server "no_agent" "-Dserver.port=8080" "taskset -c 31-32 " & -start_server "tracing" "-javaagent:${TRACER} -Dserver.port=8081" "taskset -c 33-34 " & -start_server "profiling" "-javaagent:${TRACER} -Ddd.profiling.enabled=true -Dserver.port=8082" "taskset -c 35-36 " & -start_server "appsec" "-javaagent:${TRACER} -Ddd.appsec.enabled=true -Dserver.port=8083" "taskset -c 37-38 " & -start_server "iast" "-javaagent:${TRACER} -Ddd.iast.enabled=true -Dserver.port=8084" "taskset -c 39-40 " & -start_server "code_origins" "-javaagent:${TRACER} -Ddd.code.origin.for.spans.enabled=true -Dserver.port=8085" "taskset -c 41-42 " & - -wait diff --git a/benchmark/load/run.sh b/benchmark/load/run.sh deleted file mode 100755 index 5f2f265b045..00000000000 --- a/benchmark/load/run.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/usr/bin/env bash - -set -e - -function message() { - echo "$(date +"%T"): $1" -} - -function healthcheck() { - local url=$1 - - while true; do - if [[ $(curl -fso /dev/null -w "%{http_code}" "${url}") = 200 ]]; then - break - fi - done -} - -type=$1 - -if [ -n "$CI_JOB_TOKEN" ]; then - # Inside BP, so we can assume 24 CPU cores on the second socket available and set CPU affinity - export CPU_AFFINITY_K6="taskset -c 24-27 " -else - export CPU_AFFINITY_K6="" -fi - -source "${UTILS_DIR}/update-java-version.sh" 17 - -for app in *; do - if [[ ! -d "${app}" ]]; then - continue - fi - - message "${type} benchmark: ${app} started" - - export OUTPUT_DIR="${REPORTS_DIR}/${type}/${app}" - mkdir -p ${OUTPUT_DIR} - - export LOGS_DIR="${ARTIFACTS_DIR}/${type}/${app}" - mkdir -p ${LOGS_DIR} - - # Using profiler variants for healthcheck as they are the slowest - if [ "${app}" == "petclinic" ]; then - HEALTHCHECK_URL=http://localhost:8082 - REPETITIONS_COUNT=2 - elif [ "${app}" == "insecure-bank" ]; then - HEALTHCHECK_URL=http://localhost:8082/login - REPETITIONS_COUNT=2 - else - echo "Unknown app ${app}" - exit 1 - fi - - for i in $(seq 1 $REPETITIONS_COUNT); do - bash -c "${UTILS_DIR}/../${type}/${app}/start-servers.sh" & - - echo "Waiting for serves to start..." - if [ "${app}" == "petclinic" ]; then - for port in $(seq 8080 8085); do - healthcheck http://localhost:$port - done - elif [ "${app}" == "insecure-bank" ]; then - for port in $(seq 8080 8085); do - healthcheck http://localhost:$port/login - done - fi - echo "Servers are up!" - - ( - cd ${app} && - bash -c "${CPU_AFFINITY_K6}${UTILS_DIR}/run-k6-load-test.sh 'pkill java'" - ) - done - - message "${type} benchmark: ${app} finished" -done diff --git a/benchmark/run.sh b/benchmark/run.sh deleted file mode 100755 index bcd3649e9a0..00000000000 --- a/benchmark/run.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/usr/bin/env bash -set -eu - -readonly SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" -readonly INITIAL_DIR="$(pwd)" -readonly TRACER="${SCRIPT_DIR}/tracer/dd-java-agent.jar" - -cd "${SCRIPT_DIR}" - -# Build container image -echo "Building base image ..." -docker build \ - -t dd-trace-java/benchmark \ - . - -# Find or rebuild tracer to be used in the benchmarks -if [[ ! -f "${TRACER}" ]]; then - mkdir -p "${SCRIPT_DIR}/tracer" - cd "${SCRIPT_DIR}/.." - readonly TRACER_VERSION=$(./gradlew properties -q | grep "version:" | awk '{print $2}') - readonly TRACER_COMPILED="${SCRIPT_DIR}/../dd-java-agent/build/libs/dd-java-agent-${TRACER_VERSION}.jar" - if [ ! -f "${TRACER_COMPILED}" ]; then - echo "Tracer not found, starting gradle compile ..." - ./gradlew assemble - fi - cp "${TRACER_COMPILED}" "${TRACER}" - cd "${SCRIPT_DIR}" -fi - -# Trigger benchmarks -echo "Running benchmarks ..." -docker run --rm \ - -v "${HOME}/.gradle":/home/benchmark/.gradle:delegated \ - -v "${PWD}/..":/tracer:delegated \ - -w /tracer/benchmark \ - -e GRADLE_OPTS="-Dorg.gradle.daemon=false" \ - --entrypoint=./benchmarks.sh \ - --name dd-trace-java-benchmark \ - --cap-add SYS_ADMIN \ - dd-trace-java/benchmark \ - "$@" - -cd "${INITIAL_DIR}" diff --git a/benchmark/startup/insecure-bank/benchmark.json b/benchmark/startup/insecure-bank/benchmark.json deleted file mode 100644 index 17c69a50847..00000000000 --- a/benchmark/startup/insecure-bank/benchmark.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "startup_insecure-bank", - "setup": "bash -c \"mkdir -p ${OUTPUT_DIR}/${VARIANT}\"", - "service": "bash -c \"${UTILS_DIR}/run-on-server-ready.sh http://localhost:8080/login 'pkill java'\"", - "run": "bash -c \"java -javaagent:${TRACER} -Ddd.benchmark.enabled=true -Ddd.benchmark.output.dir=${OUTPUT_DIR}/${VARIANT} ${JAVA_OPTS} -jar ${INSECURE_BANK} &> ${OUTPUT_DIR}/${VARIANT}/insecure-bank.log\"", - "iterations": 10, - "timeout": 60, - "variants": { - "tracing": { - "env": { - "VARIANT": "tracing", - "JAVA_OPTS": "" - } - }, - "iast": { - "env": { - "VARIANT": "iast", - "JAVA_OPTS": "-Ddd.iast.enabled=true" - } - } - } -} diff --git a/benchmark/startup/petclinic/benchmark.json b/benchmark/startup/petclinic/benchmark.json deleted file mode 100644 index 23713c38469..00000000000 --- a/benchmark/startup/petclinic/benchmark.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "startup_petclinic", - "setup": "bash -c \"mkdir -p ${OUTPUT_DIR}/${VARIANT}\"", - "service": "bash -c \"${UTILS_DIR}/run-on-server-ready.sh http://localhost:8080 'pkill java'\"", - "run": "bash -c \"java -javaagent:${TRACER} -Ddd.benchmark.enabled=true -Ddd.benchmark.output.dir=${OUTPUT_DIR}/${VARIANT} ${JAVA_OPTS} -jar ${PETCLINIC} &> ${OUTPUT_DIR}/${VARIANT}/petclinic.log\"", - "iterations": 10, - "timeout": 60, - "variants": { - "tracing": { - "env": { - "VARIANT": "tracing", - "JAVA_OPTS": "" - } - }, - "profiling": { - "env": { - "VARIANT": "profiling", - "JAVA_OPTS": "-Ddd.profiling.enabled=true" - } - }, - "appsec": { - "env": { - "VARIANT": "appsec", - "JAVA_OPTS": "-Ddd.appsec.enabled=true" - } - }, - "iast": { - "env": { - "VARIANT": "iast", - "JAVA_OPTS": "-Ddd.iast.enabled=true" - } - } - } -} diff --git a/benchmark/startup/run.sh b/benchmark/startup/run.sh deleted file mode 100755 index 432c65d3fd5..00000000000 --- a/benchmark/startup/run.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -set -eu - -source "${UTILS_DIR}/update-java-version.sh" 17 -"${UTILS_DIR}/run-sirun-benchmarks.sh" "$@" diff --git a/benchmark/utils/k6.js b/benchmark/utils/k6.js deleted file mode 100644 index aa5147ae3c8..00000000000 --- a/benchmark/utils/k6.js +++ /dev/null @@ -1,21 +0,0 @@ -import {check} from 'k6'; - -export function checkResponse(response) { - const checks = Array.prototype.slice.call(arguments, 1); - const reduced = checks.reduce((result, current) => Object.assign(result, current), {}); - check(response, reduced); -} - -export const isOk = { - 'is OK': r => r.status === 200 -}; - -export const isRedirect = { - 'is redirect': r => r.status >= 300 && r.status < 400 -}; - -export function bodyContains(text) { - return { - 'body contains': r => r.body.includes(text) - } -} diff --git a/benchmark/utils/run-k6-load-test.sh b/benchmark/utils/run-k6-load-test.sh deleted file mode 100755 index d3415f54eef..00000000000 --- a/benchmark/utils/run-k6-load-test.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env bash -set -eu - -command=$1 -exit_code=0 - -cleanup() { - # run the exit command - bash -c "${command}" - exit $exit_code -} - -trap cleanup EXIT ERR INT TERM - -echo "Starting k6 load test, logs are recorded into ${LOGS_DIR}/k6.log..." - -# run the k6 benchmark and store the result as JSON -k6 run k6.js --out "json=${OUTPUT_DIR}/k6_$(date +%s).json" > "${LOGS_DIR}/k6.log" 2>&1 -exit_code=$? - -echo "k6 load test done !!!" diff --git a/benchmark/utils/run-on-server-ready.sh b/benchmark/utils/run-on-server-ready.sh deleted file mode 100755 index 2aad5aa9f70..00000000000 --- a/benchmark/utils/run-on-server-ready.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -set -eu - -url=$1 -command=$2 -# wait for an HTTP server to come up and runs the selected command -while true; do - if [[ $(curl -fso /dev/null -w "%{http_code}" "${url}") = 200 ]]; then - bash -c "${command}" - fi -done diff --git a/benchmark/utils/run-sirun-benchmarks.sh b/benchmark/utils/run-sirun-benchmarks.sh deleted file mode 100755 index c0bc732dcfa..00000000000 --- a/benchmark/utils/run-sirun-benchmarks.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash -set -eu - -function message() { - echo "$(date +"%T"): $1" -} - -run_benchmark() { - local type=$1 - local app=$2 - if [[ -d "${app}" ]] && [[ -f "${app}/benchmark.json" ]]; then - - message "${type} benchmark: ${app} started" - cd "${app}" - - # create output folder for the test - export OUTPUT_DIR="${REPORTS_DIR}/${type}/${app}" - mkdir -p "${OUTPUT_DIR}" - - # substitute environment variables in the json file - benchmark=$(mktemp) - # shellcheck disable=SC2046 - # shellcheck disable=SC2016 - envsubst "$(printf '${%s} ' $(env | cut -d'=' -f1))" "${benchmark}" - - # run the sirun test - sirun "${benchmark}" &>"${OUTPUT_DIR}/${app}.json" - - message "${type} benchmark: ${app} finished" - - cd .. - fi -} - -if [ "$#" == '2' ]; then - run_benchmark "$@" -else - for folder in *; do - run_benchmark "$1" "${folder}" - done -fi diff --git a/benchmark/utils/update-java-version.sh b/benchmark/utils/update-java-version.sh deleted file mode 100755 index 3d76603e0ef..00000000000 --- a/benchmark/utils/update-java-version.sh +++ /dev/null @@ -1,5 +0,0 @@ -readonly target=$1 -readonly NEW_PATH=$(echo "${PATH}" | sed -e "s@/usr/lib/jvm/[[:digit:]]\+@/usr/lib/jvm/${target}@g") -export PATH="${NEW_PATH}" - -java --version diff --git a/build-logic/conventions/build.gradle.kts b/build-logic/conventions/build.gradle.kts new file mode 100644 index 00000000000..a31634bb8ec --- /dev/null +++ b/build-logic/conventions/build.gradle.kts @@ -0,0 +1,14 @@ +plugins { + `kotlin-dsl` +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + +kotlin { + compilerOptions { + jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8) + } +} diff --git a/build-logic/conventions/src/main/kotlin/datadog/buildlogic/mass/MassExtension.kt b/build-logic/conventions/src/main/kotlin/datadog/buildlogic/mass/MassExtension.kt new file mode 100644 index 00000000000..2dcb90a9c7b --- /dev/null +++ b/build-logic/conventions/src/main/kotlin/datadog/buildlogic/mass/MassExtension.kt @@ -0,0 +1,19 @@ +package datadog.buildlogic.mass + +import javax.inject.Inject +import org.gradle.api.model.ObjectFactory +import org.gradle.api.provider.Property +import org.gradle.api.provider.ProviderFactory + +open class MassExtension +@Inject +constructor(objects: ObjectFactory, providers: ProviderFactory) { + val readUrl: Property = + objects.property(String::class.java).convention(providers.environmentVariable("MASS_READ_URL")) + + fun artifactUrl(upstreamArtifactUrl: String): String { + val massReadUrl = readUrl.orNull ?: return "https://$upstreamArtifactUrl" + val baseUrl = if (massReadUrl.endsWith("/")) massReadUrl else "$massReadUrl/" + return "${baseUrl}internal/artifact/$upstreamArtifactUrl" + } +} diff --git a/build-logic/conventions/src/main/kotlin/dd-trace-java.mass.gradle.kts b/build-logic/conventions/src/main/kotlin/dd-trace-java.mass.gradle.kts new file mode 100644 index 00000000000..147bff69ab7 --- /dev/null +++ b/build-logic/conventions/src/main/kotlin/dd-trace-java.mass.gradle.kts @@ -0,0 +1,4 @@ +import datadog.buildlogic.mass.MassExtension +import org.gradle.kotlin.dsl.create + +extensions.create("mass") diff --git a/build-logic/settings.gradle.kts b/build-logic/settings.gradle.kts new file mode 100644 index 00000000000..c218e2cd34c --- /dev/null +++ b/build-logic/settings.gradle.kts @@ -0,0 +1,51 @@ +pluginManagement { + repositories { + mavenLocal() + if (settings.extra.has("gradlePluginProxy")) { + maven { + url = uri(settings.extra["gradlePluginProxy"] as String) + isAllowInsecureProtocol = true + } + } + if (settings.extra.has("mavenRepositoryProxy")) { + maven { + url = uri(settings.extra["mavenRepositoryProxy"] as String) + isAllowInsecureProtocol = true + } + } + gradlePluginPortal() + mavenCentral() + } +} + +dependencyResolutionManagement { + versionCatalogs { + create("libs") { + from(files("../gradle/libs.versions.toml")) + } + } + repositories { + mavenLocal() + if (settings.extra.has("mavenRepositoryProxy")) { + maven { + url = uri(settings.extra["mavenRepositoryProxy"] as String) + isAllowInsecureProtocol = true + } + } + gradlePluginPortal() + mavenCentral() + // Hosts gradle-tooling-api; used by the smoke-test plugin to run nested Gradle builds + // pinned to older Gradle versions. + maven { + url = uri("https://repo.gradle.org/gradle/libs-releases") + content { + includeGroup("org.gradle") + } + } + } +} + +rootProject.name = "build-logic" + +include(":conventions") +include(":smoke-test") diff --git a/build-logic/smoke-test/build.gradle.kts b/build-logic/smoke-test/build.gradle.kts new file mode 100644 index 00000000000..fc57c9cf0e0 --- /dev/null +++ b/build-logic/smoke-test/build.gradle.kts @@ -0,0 +1,56 @@ +plugins { + `java-gradle-plugin` + `kotlin-dsl` + `jvm-test-suite` +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + +kotlin { + compilerOptions { + jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8) + } +} + +dependencies { + implementation(libs.gradle.tooling.api) + runtimeOnly("org.slf4j:slf4j-simple:1.7.36") +} + +gradlePlugin { + plugins { + create("smoke-test-app") { + id = "dd-trace-java.smoke-test-app" + implementationClass = "datadog.buildlogic.smoketest.SmokeTestAppPlugin" + } + } +} + +@Suppress("UnstableApiUsage") +testing { + suites { + named("test") { + useJUnitJupiter(libs.versions.junit5) + dependencies { + implementation(libs.junit.jupiter) + implementation(libs.junit.jupiter.params) + implementation(libs.junit.jupiter.engine) + implementation(libs.assertj.core) + implementation(gradleTestKit()) + } + targets.configureEach { + testTask.configure { + // The gradle-test-kit runner shells out to a Gradle daemon, which can be slow on a + // cold cache. Surface stdout/stderr to make CI failures debuggable. + testLogging { + showStandardStreams = true + events("failed", "skipped") + } + } + } + } + } +} diff --git a/build-logic/smoke-test/src/main/kotlin/datadog/buildlogic/smoketest/GradleDistribution.kt b/build-logic/smoke-test/src/main/kotlin/datadog/buildlogic/smoketest/GradleDistribution.kt new file mode 100644 index 00000000000..9e5f3a0672d --- /dev/null +++ b/build-logic/smoke-test/src/main/kotlin/datadog/buildlogic/smoketest/GradleDistribution.kt @@ -0,0 +1,12 @@ +package datadog.buildlogic.smoketest + +import java.net.URI + +internal const val MASS_READ_URL_ENV = "MASS_READ_URL" + +internal fun gradleDistributionUri(massReadUrl: String, gradleVersion: String): URI { + val baseUrl = if (massReadUrl.endsWith("/")) massReadUrl else "$massReadUrl/" + return URI.create( + "${baseUrl}internal/artifact/services.gradle.org/distributions/gradle-$gradleVersion-bin.zip", + ) +} diff --git a/build-logic/smoke-test/src/main/kotlin/datadog/buildlogic/smoketest/NestedBuildProjectJar.kt b/build-logic/smoke-test/src/main/kotlin/datadog/buildlogic/smoketest/NestedBuildProjectJar.kt new file mode 100644 index 00000000000..503f78c47b4 --- /dev/null +++ b/build-logic/smoke-test/src/main/kotlin/datadog/buildlogic/smoketest/NestedBuildProjectJar.kt @@ -0,0 +1,24 @@ +package datadog.buildlogic.smoketest + +import org.gradle.api.file.RegularFileProperty +import org.gradle.api.provider.Property +import org.gradle.api.tasks.Input +import org.gradle.api.tasks.InputFile +import org.gradle.api.tasks.PathSensitive +import org.gradle.api.tasks.PathSensitivity + +/** + * A jar produced by the root build that needs to be forwarded into a [NestedGradleBuild]. + * + * At execution time the task adds `-P${propertyName}=` to the nested + * Gradle invocation, so the inner build script can pick it up via `findProperty(...)`. + */ +abstract class NestedBuildProjectJar { + + @get:Input + abstract val propertyName: Property + + @get:InputFile + @get:PathSensitive(PathSensitivity.NONE) + abstract val file: RegularFileProperty +} diff --git a/build-logic/smoke-test/src/main/kotlin/datadog/buildlogic/smoketest/NestedGradleBuild.kt b/build-logic/smoke-test/src/main/kotlin/datadog/buildlogic/smoketest/NestedGradleBuild.kt new file mode 100644 index 00000000000..33da53475d1 --- /dev/null +++ b/build-logic/smoke-test/src/main/kotlin/datadog/buildlogic/smoketest/NestedGradleBuild.kt @@ -0,0 +1,322 @@ +package datadog.buildlogic.smoketest + +import org.gradle.api.Action +import org.gradle.api.DefaultTask +import org.gradle.api.GradleException +import org.gradle.api.file.DirectoryProperty +import org.gradle.api.file.FileTree +import org.gradle.api.file.RegularFile +import org.gradle.api.model.ObjectFactory +import org.gradle.api.provider.ListProperty +import org.gradle.api.provider.MapProperty +import org.gradle.api.provider.Property +import org.gradle.api.provider.Provider +import org.gradle.api.tasks.IgnoreEmptyDirectories +import org.gradle.api.tasks.Input +import org.gradle.api.tasks.InputFiles +import org.gradle.api.tasks.Internal +import org.gradle.api.tasks.CacheableTask +import org.gradle.api.tasks.Nested +import org.gradle.api.tasks.Optional +import org.gradle.api.tasks.OutputDirectory +import org.gradle.api.tasks.PathSensitive +import org.gradle.api.tasks.PathSensitivity +import org.gradle.api.tasks.TaskAction +import org.gradle.jvm.toolchain.JavaLanguageVersion +import org.gradle.jvm.toolchain.JavaLauncher +import org.gradle.jvm.toolchain.JavaToolchainService +import org.gradle.kotlin.dsl.newInstance +import org.gradle.tooling.GradleConnector +import java.io.File +import java.util.concurrent.TimeUnit +import javax.inject.Inject + +/** + * Runs a nested Gradle build inside [applicationDir] via the Gradle Tooling API. + * + * Lets a smoke test pin a Gradle version (typically older than the root build) and a Java + * toolchain for the nested daemon, without committing per-application `gradlew` wrappers. + * + * The nested build script is expected to honour `-PappBuildDir=` and redirect its + * `buildDir` to that path so the artifact lands in [applicationBuildDir]. Project artifacts + * from the root build can be forwarded via [projectJar]; each entry is passed as + * `-P=` and tracked as a task input so the nested build re-runs + * when the upstream jar changes. + */ +@CacheableTask +abstract class NestedGradleBuild @Inject constructor( + private val objects: ObjectFactory, + javaToolchains: JavaToolchainService, +) : DefaultTask() { + + init { + gradleVersion.convention(DEFAULT_NESTED_GRADLE_VERSION) + gradleDistributionBaseUrl.convention( + project.providers.environmentVariable(MASS_READ_URL_ENV), + ) + initScripts.convention(emptyList()) + gradleProperties.convention(emptyMap()) + javaLauncher.convention( + javaToolchains.launcherFor { + languageVersion.set(JavaLanguageVersion.of(DEFAULT_NESTED_JAVA_VERSION)) + }, + ) + buildCacheEnabled.convention(false) + } + + @get:Internal + abstract val applicationDir: DirectoryProperty + + @get:InputFiles + @get:IgnoreEmptyDirectories + @get:PathSensitive(PathSensitivity.RELATIVE) + val applicationSources: FileTree = + objects.fileTree().from(applicationDir).matching { + exclude(".gradle/**", "build/**") + } + + @get:Input + abstract val gradleVersion: Property + + /** + * Optional base URL for Gradle distribution downloads. CI sets this to MASS so nested builds + * download through the pull-through cache instead of directly from services.gradle.org. + */ + @get:Input + @get:Optional + abstract val gradleDistributionBaseUrl: Property + + @get:Input + abstract val initScripts: ListProperty + + @get:Input + abstract val gradleProperties: MapProperty + + @get:Nested + abstract val javaLauncher: Property + + @get:Input + abstract val tasksToRun: ListProperty + + @get:Input + abstract val buildArguments: ListProperty + + /** + * Whether to enable the build cache in the nested Gradle invocation. + * Gradle's org.gradle.caching flag is resolved from many sources (project, + * init, gradle user home, environment, command line) and any of them silently + * enables the build cache for nested builds. For this reasons it defaults to `false`. + * Opt in only when the inner plugin chain keys its cached outputs on everything that + * varies between runs (e.g. Quarkus's native-image does not track `GRAALVM_HOME`). + * `--build-cache` / `--no-build-cache` is passed explicitly either way. + */ + @get:Input + abstract val buildCacheEnabled: Property + + /** Timeout, in seconds, for stopping the nested Gradle daemon after the build. */ + @get:Input + @get:Optional + abstract val stopTimeoutSeconds: Property + + /** + * Extra environment variables for the nested Gradle daemon. Merged on top of the outer process + * environment; Gradle launcher variables are reserved by this task so nested builds do not + * inherit incompatible outer-build settings. The nested build script sees these via + * `System.getenv()` like any normal environment variable. + */ + @get:Input + abstract val environment: MapProperty + + @get:Nested + abstract val projectJars: ListProperty + + @get:OutputDirectory + abstract val applicationBuildDir: DirectoryProperty + + /** Forward a root-build jar as `-P=` into the nested build. */ + fun projectJar(name: String, file: Provider) { + projectJars.add( + objects.newInstance().apply { + propertyName.set(name) + this.file.set(file) + }, + ) + } + + /** Configure additional aspects of the nested build via a typed action. */ + fun projectJar(action: Action) { + projectJars.add( + objects.newInstance().also(action::execute), + ) + } + + @TaskAction + fun runNestedBuild() { + val appDir = applicationDir.get().asFile + val appBuildDirFile = applicationBuildDir.get().asFile + val daemonJavaHome = javaLauncher.get().metadata.installationPath.asFile + val gradleUserHomeDir = createGradleUserHome() + val initScriptFiles = writeInitScripts() + + val args = buildList { + initScriptFiles.forEach { script -> + add("--init-script") + add(script.absolutePath) + } + add(if (buildCacheEnabled.get()) "--build-cache" else "--no-build-cache") + add("-PappBuildDir=${appBuildDirFile.absolutePath}") + gradleProperties.get().forEach { (name, value) -> + addGradleProperty(name, value) + } + projectJars.get().forEach { entry -> + add("-P${entry.propertyName.get()}=${entry.file.get().asFile.absolutePath}") + } + addAll(buildArguments.get()) + } + + val connector = GradleConnector.newConnector() + .forProjectDirectory(appDir) + .useGradleUserHomeDir(gradleUserHomeDir) + .apply { + val distributionBaseUrl = gradleDistributionBaseUrl.orNull + if (distributionBaseUrl.isNullOrBlank()) { + useGradleVersion(gradleVersion.get()) + } else { + useDistribution( + gradleDistributionUri(distributionBaseUrl, gradleVersion.get()), + ) + } + } + + val mergedEnv = + System.getenv() + + environment.get() + + mapOf( + "GRADLE_ARGS" to "", + "GRADLE_OPTS" to "", + "GRADLE_USER_HOME" to gradleUserHomeDir.absolutePath, + ) + + try { + connector.connect().use { connection -> + connection.newBuild() + .forTasks(*tasksToRun.get().toTypedArray()) + .withArguments(args) + .setJavaHome(daemonJavaHome) + .setEnvironmentVariables(mergedEnv) + .setStandardOutput(System.out) + .setStandardError(System.err) + .run() + } + } finally { + stopGradleDaemon(appDir, gradleUserHomeDir, daemonJavaHome, mergedEnv) + deleteGradleUserHome(gradleUserHomeDir) + } + } + + private fun stopGradleDaemon( + appDir: File, + gradleUserHomeDir: File, + daemonJavaHome: File, + environment: Map, + ) { + val gradleExecutable = findGradleExecutable(gradleUserHomeDir) + if (gradleExecutable == null) { + logger.warn( + "Could not find nested Gradle executable under {} to stop its daemon", + gradleUserHomeDir.absolutePath, + ) + return + } + + try { + val processBuilder = ProcessBuilder(gradleExecutable.absolutePath, "--stop") + .directory(appDir) + .redirectOutput(ProcessBuilder.Redirect.INHERIT) + .redirectError(ProcessBuilder.Redirect.INHERIT) + processBuilder.environment().apply { + clear() + putAll(environment) + put("JAVA_HOME", daemonJavaHome.absolutePath) + } + + val process = processBuilder.start() + val timeoutSeconds = stopTimeoutSeconds.orNull + val completed = + if (timeoutSeconds == null) { + process.waitFor() + true + } else { + process.waitFor(timeoutSeconds, TimeUnit.SECONDS) + } + if (!completed) { + process.destroyForcibly() + logger.warn("Timed out after {} seconds while stopping nested Gradle daemon", timeoutSeconds) + return + } + val exitCode = process.exitValue() + if (exitCode != 0) { + logger.warn("Nested Gradle daemon stop exited with code {}", exitCode) + } + } catch (e: InterruptedException) { + Thread.currentThread().interrupt() + logger.warn( + "Interrupted while stopping nested Gradle daemon before deleting its user home", + e, + ) + } catch (e: Exception) { + logger.warn("Could not stop nested Gradle daemon before deleting its user home", e) + } + } + + private fun writeInitScripts(): List = + initScripts.get().mapIndexed { index, script -> + temporaryDir.resolve("init-$index.init.gradle.kts").also { file -> + file.writeText(script) + } + } + + private fun findGradleExecutable(gradleUserHomeDir: File): File? = + gradleUserHomeDir.walkTopDown().firstOrNull { file -> + file.isFile && + file.name == gradleExecutableName() && + file.parentFile?.name == "bin" + } + + private fun createGradleUserHome(): File { + val directory = temporaryDir.resolve("gradle-user-home") + deleteGradleUserHome(directory) + if (!directory.mkdirs()) { + throw GradleException( + "Could not create nested Gradle user home: ${directory.absolutePath}", + ) + } + return directory + } + + private fun deleteGradleUserHome(directory: File) { + if (directory.exists() && !directory.deleteRecursively()) { + logger.warn("Could not delete nested Gradle user home: {}", directory.absolutePath) + } + } + + companion object { + internal fun gradleExecutableName(osName: String = System.getProperty("os.name")): String = + if (isWindows(osName)) { + "gradle.bat" + } else { + "gradle" + } + } +} + +private fun MutableList.addGradleProperty(name: String, value: String?) { + if (!value.isNullOrBlank()) { + add("-P$name=$value") + } +} + +internal val PROXY_REPOSITORIES_INIT_SCRIPT: String = + NestedGradleBuild::class.java.getResource("proxy-repositories.init.gradle.kts") + ?.readText() + ?: error("Missing proxy-repositories.init.gradle.kts resource") diff --git a/build-logic/smoke-test/src/main/kotlin/datadog/buildlogic/smoketest/NestedMavenBuild.kt b/build-logic/smoke-test/src/main/kotlin/datadog/buildlogic/smoketest/NestedMavenBuild.kt new file mode 100644 index 00000000000..28234528be2 --- /dev/null +++ b/build-logic/smoke-test/src/main/kotlin/datadog/buildlogic/smoketest/NestedMavenBuild.kt @@ -0,0 +1,201 @@ +package datadog.buildlogic.smoketest + +import org.gradle.api.DefaultTask +import org.gradle.api.GradleException +import org.gradle.api.file.DirectoryProperty +import org.gradle.api.file.FileTree +import org.gradle.api.file.RegularFileProperty +import org.gradle.api.model.ObjectFactory +import org.gradle.api.provider.ListProperty +import org.gradle.api.provider.MapProperty +import org.gradle.api.provider.Property +import org.gradle.api.tasks.CacheableTask +import org.gradle.api.tasks.IgnoreEmptyDirectories +import org.gradle.api.tasks.Input +import org.gradle.api.tasks.InputFile +import org.gradle.api.tasks.InputFiles +import org.gradle.api.tasks.Internal +import org.gradle.api.tasks.Nested +import org.gradle.api.tasks.Optional +import org.gradle.api.tasks.OutputDirectory +import org.gradle.api.tasks.PathSensitive +import org.gradle.api.tasks.PathSensitivity +import org.gradle.api.tasks.TaskAction +import org.gradle.jvm.toolchain.JavaLanguageVersion +import org.gradle.jvm.toolchain.JavaLauncher +import org.gradle.jvm.toolchain.JavaToolchainService +import java.io.File +import java.util.concurrent.TimeUnit +import javax.inject.Inject + +/** + * Runs a nested Maven build inside [applicationDir] via the root Maven wrapper. + * + * The nested build is expected to honour `-Dtarget.dir=` and write outputs under that + * directory so Gradle can track the artifact under [applicationBuildDir]. + */ +@CacheableTask +abstract class NestedMavenBuild @Inject constructor( + private val objects: ObjectFactory, + javaToolchains: JavaToolchainService, +) : DefaultTask() { + + init { + javaLauncher.convention( + javaToolchains.launcherFor { + languageVersion.set(JavaLanguageVersion.of(DEFAULT_NESTED_JAVA_VERSION)) + }, + ) + goals.convention(listOf("package")) + arguments.convention(emptyList()) + environment.convention(emptyMap()) + mavenOpts.convention("") + useMavenLocalRepository.convention(false) + } + + @get:Internal + abstract val applicationDir: DirectoryProperty + + @get:InputFiles + @get:IgnoreEmptyDirectories + @get:PathSensitive(PathSensitivity.RELATIVE) + val applicationSources: FileTree = + objects.fileTree().from(applicationDir).matching { + exclude("target/**") + } + + @get:OutputDirectory + abstract val applicationBuildDir: DirectoryProperty + + @get:InputFile + @get:PathSensitive(PathSensitivity.RELATIVE) + abstract val mavenExecutable: RegularFileProperty + + @get:InputFiles + @get:IgnoreEmptyDirectories + @get:PathSensitive(PathSensitivity.RELATIVE) + val mavenWrapperFiles: FileTree = + objects.fileTree().from(project.rootProject.layout.projectDirectory.dir(".mvn/wrapper")).matching { + include("maven-wrapper.properties", "maven-wrapper.jar") + } + + @get:Nested + abstract val javaLauncher: Property + + @get:Input + abstract val goals: ListProperty + + @get:Input + abstract val arguments: ListProperty + + @get:Input + abstract val environment: MapProperty + + @get:Input + @get:Optional + abstract val mavenOpts: Property + + @get:Input + @get:Optional + abstract val mavenRepositoryProxy: Property + + @get:Input + abstract val useMavenLocalRepository: Property + + /** Timeout, in seconds, for the nested Maven build process. */ + @get:Input + @get:Optional + abstract val buildTimeoutSeconds: Property + + @get:Internal + abstract val mavenLocalRepository: DirectoryProperty + + @TaskAction + fun runNestedBuild() { + val appDir = applicationDir.get().asFile + val appBuildDirFile = applicationBuildDir.get().asFile + val targetDir = appBuildDirFile.resolve("target") + val daemonJavaHome = javaLauncher.get().metadata.installationPath.asFile + val command = mavenCommand(mavenExecutable.get().asFile).apply { + add("-Dtarget.dir=${targetDir.absolutePath}") + if (useMavenLocalRepository.get()) { + add("-Dmaven.repo.local=${mavenLocalRepository.get().asFile.absolutePath}") + } + addAll(arguments.get()) + addAll(goals.get()) + } + + val process = ProcessBuilder(command) + .directory(appDir) + .redirectOutput(ProcessBuilder.Redirect.INHERIT) + .redirectError(ProcessBuilder.Redirect.INHERIT) + .apply { + environment().apply { + clear() + putAll(nestedEnvironment(daemonJavaHome)) + } + } + .start() + + try { + val timeoutSeconds = buildTimeoutSeconds.orNull + val completed = + if (timeoutSeconds == null) { + process.waitFor() + true + } else { + process.waitFor(timeoutSeconds, TimeUnit.SECONDS) + } + if (!completed) { + process.destroyForcibly() + throw GradleException( + "Nested Maven build timed out after $timeoutSeconds seconds: " + + command.joinToString(" "), + ) + } + } catch (e: InterruptedException) { + process.destroyForcibly() + Thread.currentThread().interrupt() + throw GradleException("Interrupted while running nested Maven build", e) + } + val exitCode = process.exitValue() + if (exitCode != 0) { + throw GradleException( + "Nested Maven build failed with exit code $exitCode: ${command.joinToString(" ")}", + ) + } + } + + private fun nestedEnvironment(daemonJavaHome: File): Map { + val env = System.getenv().toMutableMap() + val repositoryProxy = mavenRepositoryProxy.orNull?.takeIf { it.isNotBlank() } + if (repositoryProxy != null) { + env["MAVEN_REPOSITORY_PROXY"] = repositoryProxy + env.putIfAbsent("MVNW_REPOURL", repositoryProxy.trimEnd('/')) + } + val opts = mavenOpts.orNull + if (!opts.isNullOrBlank()) { + env["MAVEN_OPTS"] = opts + } + env["JAVA_HOME"] = daemonJavaHome.absolutePath + env.putAll(environment.get()) + return env + } + + private fun mavenCommand(executable: File): MutableList = + if (isWindows()) { + mutableListOf("cmd", "/c", executable.absolutePath) + } else { + mutableListOf(executable.absolutePath) + } + + companion object { + internal fun mavenWrapperName(osName: String = System.getProperty("os.name")): String = + if (isWindows(osName)) { + "mvnw.cmd" + } else { + "mvnw" + } + + } +} diff --git a/build-logic/smoke-test/src/main/kotlin/datadog/buildlogic/smoketest/OperatingSystem.kt b/build-logic/smoke-test/src/main/kotlin/datadog/buildlogic/smoketest/OperatingSystem.kt new file mode 100644 index 00000000000..a7e46fc640e --- /dev/null +++ b/build-logic/smoke-test/src/main/kotlin/datadog/buildlogic/smoketest/OperatingSystem.kt @@ -0,0 +1,7 @@ +package datadog.buildlogic.smoketest + +import java.util.Locale + +internal fun isWindows(osName: String = System.getProperty("os.name")): Boolean = + osName.lowercase(Locale.ROOT).contains("windows") + diff --git a/build-logic/smoke-test/src/main/kotlin/datadog/buildlogic/smoketest/SmokeTestAppExtension.kt b/build-logic/smoke-test/src/main/kotlin/datadog/buildlogic/smoketest/SmokeTestAppExtension.kt new file mode 100644 index 00000000000..a34ee321cbc --- /dev/null +++ b/build-logic/smoke-test/src/main/kotlin/datadog/buildlogic/smoketest/SmokeTestAppExtension.kt @@ -0,0 +1,423 @@ +package datadog.buildlogic.smoketest + +import org.gradle.api.Action +import org.gradle.api.Project +import org.gradle.api.artifacts.Configuration +import org.gradle.api.file.DirectoryProperty +import org.gradle.api.file.RegularFile +import org.gradle.api.file.RegularFileProperty +import org.gradle.api.provider.ListProperty +import org.gradle.api.provider.MapProperty +import org.gradle.api.provider.Property +import org.gradle.api.provider.Provider +import org.gradle.api.tasks.TaskProvider +import org.gradle.api.tasks.testing.Test +import org.gradle.jvm.toolchain.JavaLanguageVersion +import org.gradle.jvm.toolchain.JavaLauncher +import org.gradle.jvm.toolchain.JavaToolchainService +import org.gradle.kotlin.dsl.newInstance +import org.gradle.kotlin.dsl.register +import org.gradle.kotlin.dsl.withType +import org.gradle.process.CommandLineArgumentProvider +import java.util.Locale +import javax.inject.Inject + +/** + * Project extension that wires a nested build task for a smoke-test application. + * + * The plugin only contributes a task when the consumer calls [gradleApp] or [mavenApp]; if + * the extension stays unconfigured, the plugin is a no-op and consumers can register tasks + * directly. + */ +abstract class SmokeTestAppExtension @Inject constructor( + private val project: Project, + javaToolchains: JavaToolchainService, +) { + + /** + * Gradle version used by the nested daemon. Defaults to [DEFAULT_NESTED_GRADLE_VERSION] — + * the version pinned for smoke-test applications whose Spring Boot plugin is incompatible + * with Gradle 9. + */ + abstract val gradleVersion: Property + + /** + * Optional base URL for Gradle distribution downloads. Defaults to the CI-provided MASS read + * URL when present, so Tooling API downloads go through the pull-through cache. + */ + abstract val gradleDistributionBaseUrl: Property + + /** + * JDK used by the nested build. Defaults to a [DEFAULT_NESTED_JAVA_VERSION] toolchain; + * override to pin a different JDK if the nested application's build chain requires it. + * The inner build script is responsible for pinning the produced bytecode level (e.g. + * `java { sourceCompatibility = JavaVersion.VERSION_1_8 }`). + */ + abstract val javaLauncher: Property + + /** Directory containing the nested project's `settings.gradle` + sources. */ + abstract val applicationDir: DirectoryProperty + + /** + * Directory the nested build writes its outputs to. Gradle applications are expected to + * honour `-PappBuildDir=`; Maven applications are expected to honour + * `-Dtarget.dir=`. + */ + abstract val applicationBuildDir: DirectoryProperty + + internal abstract val projectJars: ListProperty + + internal abstract val initScripts: ListProperty + + internal abstract val gradleProperties: MapProperty + + init { + applicationDir.convention(project.layout.projectDirectory.dir("application")) + applicationBuildDir.convention(project.layout.buildDirectory.dir("application")) + gradleVersion.convention(DEFAULT_NESTED_GRADLE_VERSION) + gradleDistributionBaseUrl.convention( + project.providers.environmentVariable(MASS_READ_URL_ENV), + ) + javaLauncher.convention( + javaToolchains.launcherFor { + languageVersion.set(JavaLanguageVersion.of(DEFAULT_NESTED_JAVA_VERSION)) + }, + ) + + val isCi = project.providers.environmentVariable("CI") + .map { it.equals("true", ignoreCase = true) } + .orElse(false) + initScripts.convention( + isCi.map { + if (it) { + listOf(PROXY_REPOSITORIES_INIT_SCRIPT) + } else { + emptyList() + } + }, + ) + gradleProperties.convention( + isCi.map { + if (it) { + proxyGradleProperties() + } else { + emptyMap() + } + }, + ) + } + + /** + * Register the nested-build task and wire the produced artifact into every `Test` task as + * a system property. Calling this triggers task registration; consumers that prefer to + * register [NestedGradleBuild] manually can leave [gradleApp] uncalled. + */ + fun gradleApp(action: Action) { + val spec = project.objects.newInstance() + action.execute(spec) + val taskName = requireNotNull(spec.taskName.orNull) { + "smokeTestApp.gradleApp { taskName = ... } is required" + } + val artifactPath = requireNotNull(spec.artifactPath.orNull) { + "smokeTestApp.gradleApp { artifactPath = ... } is required" + } + val sysProperty = requireNotNull(spec.sysProperty.orNull) { + "smokeTestApp.gradleApp { sysProperty = ... } is required" + } + val nestedTasks = spec.nestedTasks.orNull?.takeIf { it.isNotEmpty() } ?: listOf(taskName) + + val taskProvider: TaskProvider = + project.tasks.register(taskName) { + applicationDir.set(this@SmokeTestAppExtension.applicationDir) + applicationBuildDir.set(this@SmokeTestAppExtension.applicationBuildDir) + gradleVersion.set(this@SmokeTestAppExtension.gradleVersion) + gradleDistributionBaseUrl.set(this@SmokeTestAppExtension.gradleDistributionBaseUrl) + javaLauncher.set(this@SmokeTestAppExtension.javaLauncher) + tasksToRun.set(nestedTasks) + buildArguments.set(spec.buildArguments) + environment.set(spec.environment) + buildCacheEnabled.set(spec.buildCacheEnabled) + spec.stopTimeoutSeconds.orNull?.let(stopTimeoutSeconds::set) + projectJars.set(this@SmokeTestAppExtension.projectJars) + } + + wireTestTasks(taskProvider, artifactPath, sysProperty, spec.additionalSystemProperties) + } + + /** Register a Maven nested-build task and expose its artifact to every `Test` task. */ + fun mavenApp(action: Action) { + val spec = project.objects.newInstance() + spec.mavenExecutable.convention(rootMavenExecutable()) + spec.mavenRepositoryProxy.convention( + project.providers.environmentVariable("MAVEN_REPOSITORY_PROXY"), + ) + spec.mavenLocalRepository.convention(project.rootProject.layout.projectDirectory.dir(".mvn/caches")) + spec.useMavenLocalRepository.convention(isCiProvider()) + action.execute(spec) + + val taskName = requireNotNull(spec.taskName.orNull) { + "smokeTestApp.mavenApp { taskName = ... } is required" + } + val artifactPath = requireNotNull(spec.artifactPath.orNull) { + "smokeTestApp.mavenApp { artifactPath = ... } is required" + } + val sysProperty = requireNotNull(spec.sysProperty.orNull) { + "smokeTestApp.mavenApp { sysProperty = ... } is required" + } + + val taskProvider: TaskProvider = + project.tasks.register(taskName) { + applicationDir.set(this@SmokeTestAppExtension.applicationDir) + applicationBuildDir.set(this@SmokeTestAppExtension.applicationBuildDir) + javaLauncher.set(this@SmokeTestAppExtension.javaLauncher) + mavenExecutable.set(spec.mavenExecutable) + goals.set(spec.goals) + arguments.set(spec.arguments) + environment.set(spec.environment) + mavenOpts.set(spec.mavenOpts) + mavenRepositoryProxy.set(spec.mavenRepositoryProxy) + useMavenLocalRepository.set(spec.useMavenLocalRepository) + mavenLocalRepository.set(spec.mavenLocalRepository) + spec.buildTimeoutSeconds.orNull?.let(buildTimeoutSeconds::set) + } + + wireTestTasks(taskProvider, artifactPath, sysProperty, spec.additionalSystemProperties) + } + + private fun wireTestTasks( + taskProvider: TaskProvider<*>, + artifactPath: String, + sysProperty: String, + additionalSystemProperties: MapProperty, + ) { + val artifactProvider: Provider = applicationBuildDir.file(artifactPath) + val extras = additionalSystemProperties.get().mapValues { (_, relativePath) -> + applicationBuildDir.file(relativePath) + } + project.tasks.withType().configureEach { + dependsOn(taskProvider) + jvmArgumentProviders.add(SmokeTestArgProvider(sysProperty, artifactProvider, extras)) + } + } + + /** + * Forward the default `jar` artifact from [sourceProject] into the nested build as + * `-P=`. The jar is consumed via a resolvable [Configuration], + * which both establishes the correct task dependency and lets Gradle resolve the artifact + * lazily — no `evaluationDependsOn` is needed. + */ + fun projectJar(propertyName: String, sourceProject: Project) { + val cfg = createExtraJarConfiguration(propertyName) + project.dependencies.add(cfg.name, sourceProject) + addProjectJarFromConfiguration(propertyName, cfg) + } + + /** + * Forward a non-default artifact configuration from [sourceProject]. Use this when the + * upstream project exposes its build output under a configuration other than the default + * (e.g. `shadowJar`). + */ + fun projectJar(propertyName: String, sourceProject: Project, configuration: String) { + val cfg = createExtraJarConfiguration(propertyName) + project.dependencies.add( + cfg.name, + project.dependencies.project( + mapOf("path" to sourceProject.path, "configuration" to configuration), + ), + ) + addProjectJarFromConfiguration(propertyName, cfg) + } + + private fun createExtraJarConfiguration(propertyName: String): Configuration { + val configurationName = "smokeTestAppExtraJar" + + propertyName.replaceFirstChar { it.titlecase(Locale.ROOT) } + return project.configurations.maybeCreate(configurationName).apply { + isCanBeConsumed = false + isCanBeResolved = true + isTransitive = false + description = "Jar artifact forwarded as -P$propertyName into the smoke-test nested build" + } + } + + /** + * Lower-level overload for the rare case where the caller already has a provider of the + * file. The caller is responsible for the upstream task dependency. + */ + fun projectJar(propertyName: String, file: Provider) { + projectJars.add( + project.objects.newInstance().apply { + this.propertyName.set(propertyName) + this.file.set(file) + }, + ) + } + + private fun addProjectJarFromConfiguration(propertyName: String, cfg: Configuration) { + projectJars.add( + project.objects.newInstance().apply { + this.propertyName.set(propertyName) + // Configuration.elements yields a Provider that carries the producing task dependency, + // so wiring it into the task's @InputFile both tracks file contents and arranges build + // order. + this.file.set( + cfg.elements.map { files -> + project.objects.fileProperty().fileValue(files.single().asFile).get() + }, + ) + }, + ) + } + + private fun proxyGradleProperties(): Map { + val properties = mutableMapOf() + addGradleProperty(properties, "gradlePluginProxy") + addGradleProperty(properties, "mavenRepositoryProxy") + return properties + } + + private fun addGradleProperty(properties: MutableMap, name: String) { + val value = project.providers.gradleProperty(name).orNull + if (!value.isNullOrBlank()) { + properties[name] = value + } + } + + private fun rootMavenExecutable(): Provider = + project.providers.provider { + project.rootProject.layout.projectDirectory.file(NestedMavenBuild.mavenWrapperName()) + } + + private fun isCiProvider(): Provider = + project.providers.environmentVariable("CI") + .map { it.equals("true", ignoreCase = true) } + .orElse(false) +} + +/** Common DSL for a smoke-test application artifact. */ +abstract class ApplicationSpec @Inject constructor() { + + init { + additionalSystemProperties.convention(emptyMap()) + } + + /** Outer task name registered by the smoke-test plugin. */ + abstract val taskName: Property + + /** Path to the produced artifact, relative to `applicationBuildDir`. */ + abstract val artifactPath: Property + + /** System property name set on Test tasks to point them at the produced artifact. */ + abstract val sysProperty: Property + + /** + * Additional system properties to forward to every `Test` task, keyed by property name with + * values resolved against `applicationBuildDir`. Use this for smoke tests that need more + * than the single primary artifact path (e.g. a separately unpacked server install). + */ + abstract val additionalSystemProperties: MapProperty +} + +/** DSL describing a nested Gradle invocation for one smoke-test application. */ +abstract class GradleAppSpec @Inject constructor() : ApplicationSpec() { + + init { + buildCacheEnabled.convention(false) + buildArguments.convention(emptyList()) + environment.convention(emptyMap()) + } + + /** Tasks run inside the nested build. Defaults to `[taskName]`. */ + abstract val nestedTasks: ListProperty + + /** Extra arguments passed to the nested Gradle invocation. */ + abstract val buildArguments: ListProperty + + /** + * Extra environment variables exposed to the nested Gradle daemon. Merged on top of the outer + * process environment; Gradle launcher variables are reserved by the nested build task so CI + * settings do not leak into pinned Gradle versions. Use this for nested tooling that reads + * `JAVA_HOME`, `GRAALVM_HOME`, etc. from the env. + */ + abstract val environment: MapProperty + + /** + * Whether to enable the build cache in the nested Gradle invocation. + * Gradle's org.gradle.caching flag is resolved from many sources (project, + * init, gradle user home, environment, command line) and any of them silently + * enables the build cache for nested builds. For this reasons it defaults to `false`. + * Opt in only when the inner plugin chain keys its cached outputs on everything that + * varies between runs (e.g. Quarkus's native-image does not track `GRAALVM_HOME`). + * `--build-cache` / `--no-build-cache` is passed explicitly either way. + */ + abstract val buildCacheEnabled: Property + + /** Timeout, in seconds, for stopping the nested Gradle daemon after the build. */ + abstract val stopTimeoutSeconds: Property +} + +/** DSL describing a nested Maven invocation for one smoke-test application. */ +abstract class MavenAppSpec @Inject constructor() : ApplicationSpec() { + + init { + goals.convention(listOf("package")) + arguments.convention(emptyList()) + environment.convention(emptyMap()) + mavenOpts.convention("") + } + + /** Goals run inside the nested Maven build. Defaults to `package`. */ + abstract val goals: ListProperty + + /** Extra arguments passed to the nested Maven invocation before [goals]. */ + abstract val arguments: ListProperty + + /** Extra environment variables exposed to the nested Maven process. */ + abstract val environment: MapProperty + + /** Optional `MAVEN_OPTS` value for the nested Maven process. */ + abstract val mavenOpts: Property + + /** Root Maven wrapper executable used to launch the nested build. */ + abstract val mavenExecutable: RegularFileProperty + + /** Maven repository proxy used by the wrapper and by Maven builds that read the env var. */ + abstract val mavenRepositoryProxy: Property + + /** Whether to pass [mavenLocalRepository] as `-Dmaven.repo.local`. Defaults to CI only. */ + abstract val useMavenLocalRepository: Property + + /** Local repository path used when [useMavenLocalRepository] is enabled. */ + abstract val mavenLocalRepository: DirectoryProperty + + /** Timeout, in seconds, for the nested Maven build process. */ + abstract val buildTimeoutSeconds: Property +} + +/** + * Default Gradle distribution version for the nested daemon. Pinned to a Gradle 8 release + * because the Spring Boot Gradle plugin pre-3.5.0 calls `Configuration.getUploadTaskName()`, + * removed in Gradle 9. + */ +const val DEFAULT_NESTED_GRADLE_VERSION = "8.14.5" + +/** + * Default JDK language version for the nested build. JDK 21 is the version the root build + * requires for Gradle 9; standardising nested builds on the same JDK avoids pulling a + * second toolchain onto dev machines and CI runners. Inner build scripts cross-compile down + * to their actual bytecode target via `java { sourceCompatibility = ... }`. + */ +const val DEFAULT_NESTED_JAVA_VERSION = 21 + +private class SmokeTestArgProvider( + private val sysProperty: String, + private val artifact: Provider, + private val extras: Map>, +) : CommandLineArgumentProvider { + override fun asArguments(): Iterable = + buildList { + add("-D$sysProperty=${artifact.get().asFile.absolutePath}") + extras.forEach { (key, value) -> + add("-D$key=${value.get().asFile.absolutePath}") + } + } +} diff --git a/build-logic/smoke-test/src/main/kotlin/datadog/buildlogic/smoketest/SmokeTestAppPlugin.kt b/build-logic/smoke-test/src/main/kotlin/datadog/buildlogic/smoketest/SmokeTestAppPlugin.kt new file mode 100644 index 00000000000..30f2476debd --- /dev/null +++ b/build-logic/smoke-test/src/main/kotlin/datadog/buildlogic/smoketest/SmokeTestAppPlugin.kt @@ -0,0 +1,25 @@ +package datadog.buildlogic.smoketest + +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.create +import org.gradle.kotlin.dsl.withType + +/** + * Exposes nested build task types plus a `smokeTestApp` extension that wires a smoke-test + * application build and Test-side system properties. + * + * Consumers can either: + * - configure `smokeTestApp { gradleApp { ... } }` or `smokeTestApp { mavenApp { ... } }` to + * let the plugin register the task and wire it into every `Test` task, or + * - leave the extension untouched and register a task manually for cases that need more control. + */ +class SmokeTestAppPlugin : Plugin { + override fun apply(project: Project) { + val extension = project.extensions.create("smokeTestApp") + project.tasks.withType().configureEach { + initScripts.convention(extension.initScripts) + gradleProperties.convention(extension.gradleProperties) + } + } +} diff --git a/build-logic/smoke-test/src/main/resources/datadog/buildlogic/smoketest/proxy-repositories.init.gradle.kts b/build-logic/smoke-test/src/main/resources/datadog/buildlogic/smoketest/proxy-repositories.init.gradle.kts new file mode 100644 index 00000000000..70fe8054b90 --- /dev/null +++ b/build-logic/smoke-test/src/main/resources/datadog/buildlogic/smoketest/proxy-repositories.init.gradle.kts @@ -0,0 +1,41 @@ +import org.gradle.api.Action +import org.gradle.api.Project +import org.gradle.api.initialization.Settings + +gradle.beforeSettings(Action { + val gradlePluginProxy = providers.gradleProperty("gradlePluginProxy").orNull + val mavenRepositoryProxy = providers.gradleProperty("mavenRepositoryProxy").orNull + + pluginManagement { + repositories { + mavenLocal() + gradlePluginProxy?.takeIf { it.isNotBlank() }?.let { proxy -> + maven { + url = java.net.URI(proxy) + isAllowInsecureProtocol = true + } + } + mavenRepositoryProxy?.takeIf { it.isNotBlank() }?.let { proxy -> + maven { + url = java.net.URI(proxy) + isAllowInsecureProtocol = true + } + } + gradlePluginPortal() + mavenCentral() + } + } + + gradle.beforeProject(Action { + repositories { + mavenLocal() + mavenRepositoryProxy?.takeIf { it.isNotBlank() }?.let { proxy -> + maven { + url = java.net.URI(proxy) + isAllowInsecureProtocol = true + } + } + mavenCentral() + } + }) +}) diff --git a/build-logic/smoke-test/src/test/kotlin/datadog/buildlogic/smoketest/SmokeTestAppEndToEndTest.kt b/build-logic/smoke-test/src/test/kotlin/datadog/buildlogic/smoketest/SmokeTestAppEndToEndTest.kt new file mode 100644 index 00000000000..086accd5ce3 --- /dev/null +++ b/build-logic/smoke-test/src/test/kotlin/datadog/buildlogic/smoketest/SmokeTestAppEndToEndTest.kt @@ -0,0 +1,689 @@ +package datadog.buildlogic.smoketest + +import org.assertj.core.api.Assertions.assertThat +import org.gradle.testkit.runner.GradleRunner +import org.gradle.testkit.runner.TaskOutcome +import org.gradle.tooling.internal.consumer.DefaultGradleConnector +import org.junit.jupiter.api.BeforeEach +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.io.TempDir +import org.junit.jupiter.params.ParameterizedTest +import org.junit.jupiter.params.provider.Arguments +import org.junit.jupiter.params.provider.MethodSource +import java.io.File +import java.nio.file.Files +import java.nio.file.Path + +/** + * End-to-end tests that drive the plugin through the Gradle Test Kit and a temporary, + * self-contained Kotlin-DSL test project. The inner "smoke-test application" is itself a + * minimal Kotlin-DSL Gradle build; the outer build wires it through the `smokeTestApp` DSL. + * + * These tests are slow (each test spins up a Gradle daemon) but they are the only way to + * exercise the Tooling API path end-to-end. + */ +class SmokeTestAppEndToEndTest { + + @TempDir + lateinit var projectDir: Path + + private val outerSettings get() = projectDir.resolve("settings.gradle.kts").toFile() + private val outerBuild get() = projectDir.resolve("build.gradle.kts").toFile() + private val applicationDir get() = projectDir.resolve("application").toFile() + private val applicationBuildDir get() = projectDir.resolve("build/application").toFile() + + @BeforeEach + fun setUp() { + applicationDir.mkdirs() + } + + @Test + fun `nested build produces the configured artifact`() { + writeOuterSettings() + writeSmokeTestAppBuild( + smokeTestGradleApplication( + taskName = "buildJar", + artifactPath = "libs/sample.jar", + sysProperty = "sample.path", + ), + ) + writeInnerSettings() + writeInnerBuild( + """ + tasks.register("buildJar") { + archiveFileName.set("sample.jar") + from(file("src")) + } + """.trimIndent(), + ) + File(applicationDir, "src").mkdir() + File(applicationDir, "src/hello.txt").writeText("hi") + + val result = runner("buildJar").build() + + assertThat(result.task(":buildJar")?.outcome).isEqualTo(TaskOutcome.SUCCESS) + assertThat(applicationOutput("libs/sample.jar")).exists() + } + + @Test + fun `nested Maven build produces the configured artifact`() { + writeOuterSettings() + writeFakeMavenWrapper() + writeSmokeTestAppBuild( + smokeTestMavenApplication( + taskName = "packageApp", + artifactPath = "target/sample.jar", + sysProperty = "sample.path", + additionalConfig = """ + mavenExecutable.set(layout.projectDirectory.file("${fakeMavenWrapperName()}")) + mavenOpts.set("-Xmx512M") + """, + ), + ) + File(applicationDir, "pom.xml").writeText("") + + val result = runner( + "packageApp", + environment = mapOf("MAVEN_REPOSITORY_PROXY" to "https://repo.example/maven2/"), + ).build() + + assertThat(result.task(":packageApp")?.outcome).isEqualTo(TaskOutcome.SUCCESS) + assertThat(applicationOutput("target/sample.jar")).exists() + assertThat(applicationOutput("target/maven-env.txt").readLines()).contains( + "MAVEN_OPTS=-Xmx512M", + "MVNW_REPOURL=https://repo.example/maven2", + ) + } + + @Test + fun `nested Maven build output is restored from the outer build cache`() { + writeOuterSettings(withLocalBuildCache = true) + writeFakeMavenWrapper() + writeSmokeTestAppBuild( + smokeTestMavenApplication( + taskName = "packageApp", + artifactPath = "target/sample.jar", + sysProperty = "sample.path", + additionalConfig = """ + mavenExecutable.set(layout.projectDirectory.file("${fakeMavenWrapperName()}")) + """, + ), + ) + File(applicationDir, "pom.xml").writeText("") + + val first = runner("packageApp", "--build-cache").build() + assertThat(first.task(":packageApp")?.outcome).isEqualTo(TaskOutcome.SUCCESS) + assertThat(applicationOutput("target/sample.jar")).exists() + + applicationBuildDir.deleteRecursively() + + val second = runner("packageApp", "--build-cache").build() + assertThat(second.task(":packageApp")?.outcome).isEqualTo(TaskOutcome.FROM_CACHE) + assertThat(applicationOutput("target/sample.jar")).exists() + } + + @Test + fun `nested build clears inherited Gradle launcher environment`() { + writeOuterSettings() + val inheritedGradleUserHome = projectDir.resolve("inherited-gradle-user-home").toFile() + inheritedGradleUserHome.mkdirs() + writeSmokeTestAppBuild( + smokeTestGradleApplication( + taskName = "recordGradleEnvironment", + artifactPath = "gradle-env.txt", + sysProperty = "gradle.env.path", + ), + ) + writeInnerSettings() + writeInnerBuild( + """ + tasks.register("recordGradleEnvironment") { + val out = layout.buildDirectory.file("gradle-env.txt") + outputs.file(out) + doLast { + out.get().asFile.writeText( + listOf( + "GRADLE_ARGS=${'$'}{System.getenv("GRADLE_ARGS") ?: ""}", + "GRADLE_OPTS=${'$'}{System.getenv("GRADLE_OPTS") ?: ""}", + "GRADLE_USER_HOME=${'$'}{System.getenv("GRADLE_USER_HOME") ?: ""}", + "gradleUserHomeDir=${'$'}{gradle.gradleUserHomeDir.absolutePath}", + ).joinToString(System.lineSeparator()) + ) + } + } + """.trimIndent(), + ) + + val result = runner( + "recordGradleEnvironment", + environment = mapOf( + "GRADLE_ARGS" to "--info", + "GRADLE_OPTS" to "-Ddd.test.gradle.opts=inherited", + "GRADLE_USER_HOME" to inheritedGradleUserHome.absolutePath, + ), + ).build() + + assertThat(result.task(":recordGradleEnvironment")?.outcome).isEqualTo(TaskOutcome.SUCCESS) + val envFile = applicationOutput("gradle-env.txt") + assertThat(envFile).exists() + val lines = envFile.readLines() + assertThat(lines).contains( + "GRADLE_ARGS=", + "GRADLE_OPTS=", + ) + val gradleUserHomeEnv = lines.single { it.startsWith("GRADLE_USER_HOME=") } + .substringAfter("=") + val gradleUserHomeDir = lines.single { it.startsWith("gradleUserHomeDir=") } + .substringAfter("=") + assertThat(gradleUserHomeEnv).isEqualTo(gradleUserHomeDir) + assertThat(gradleUserHomeDir).isNotEqualTo(inheritedGradleUserHome.absolutePath) + assertThat(File(gradleUserHomeDir)).doesNotExist() + } + + @Test + fun `nested build receives native app environment and provider backed file inputs`() { + writeOuterSettings() + File(projectDir.toFile(), "agent.jar").writeText("agent") + writeSmokeTestAppBuild( + """ + ${smokeTestGradleApplication( + taskName = "recordNativeInputs", + artifactPath = "native-inputs.txt", + sysProperty = "native.inputs.path", + additionalConfig = """ + buildArguments.add("-Dnative.enabled=true") + environment.put("GRAALVM_HOME", providers.provider { "test-graalvm" }) + """, + )} + projectJar("agentPath", providers.provider { layout.projectDirectory.file("agent.jar") }) + """, + ) + writeInnerSettings() + writeInnerBuild( + """ + tasks.register("recordNativeInputs") { + val out = layout.buildDirectory.file("native-inputs.txt") + outputs.file(out) + doLast { + out.get().asFile.writeText( + listOf( + "graalvm=" + System.getenv("GRAALVM_HOME"), + "agentPath=" + project.findProperty("agentPath"), + "nativeEnabled=" + System.getProperty("native.enabled"), + ).joinToString(System.lineSeparator()) + ) + } + } + """.trimIndent(), + ) + + val result = runner("recordNativeInputs").build() + + assertThat(result.task(":recordNativeInputs")?.outcome).isEqualTo(TaskOutcome.SUCCESS) + val inputsFile = applicationOutput("native-inputs.txt") + assertThat(inputsFile).exists() + assertThat(inputsFile.readLines()).contains( + "graalvm=test-graalvm", + "agentPath=${projectDir.resolve("agent.jar").toFile().canonicalPath}", + "nativeEnabled=true", + ) + } + + @Test + fun `init scripts are not added outside CI`() { + writeOuterSettings() + writeSmokeTestAppBuild( + smokeTestGradleApplication( + taskName = "recordInitScripts", + artifactPath = "init-script-count.txt", + sysProperty = "init.script.count.path", + ), + ) + writeInnerSettings() + writeInnerBuild( + """ + tasks.register("recordInitScripts") { + val out = layout.buildDirectory.file("init-script-count.txt") + outputs.file(out) + val initScriptCount = gradle.startParameter.initScripts.size + doLast { + out.get().asFile.writeText(initScriptCount.toString()) + } + } + """.trimIndent(), + ) + + val result = runner( + "recordInitScripts", + environment = mapOf("CI" to "false"), + ).build() + + assertThat(result.task(":recordInitScripts")?.outcome).isEqualTo(TaskOutcome.SUCCESS) + val countFile = applicationOutput("init-script-count.txt") + assertThat(countFile).exists() + assertThat(countFile.readText()).isEqualTo("0") + } + + @Test + fun `init script prepends Maven proxy repositories without overriding project repositories`() { + writeOuterSettings() + val proxyRepository = projectDir.resolve("proxy-maven-repo").toFile() + val projectRepository = projectDir.resolve("project-maven-repo").toFile() + writeMavenArtifact(proxyRepository, "com.example", "shared", "1.0", "proxy") + writeMavenArtifact(projectRepository, "com.example", "shared", "1.0", "project") + writeMavenArtifact(projectRepository, "com.example", "project-only", "1.0", "project-only") + writeSmokeTestAppBuild( + smokeTestGradleApplication( + taskName = "resolveRepositories", + artifactPath = "resolved-repositories.txt", + sysProperty = "resolved.repositories.path", + ), + ) + writeInnerSettings() + writeInnerBuild( + """ + repositories { + maven { + url = uri("${projectRepository.toURI()}") + } + } + + dependencies { + implementation("com.example:shared:1.0") + implementation("com.example:project-only:1.0") + } + + tasks.register("resolveRepositories") { + val resolved = layout.buildDirectory.file("resolved-repositories.txt") + inputs.files(configurations.compileClasspath) + outputs.file(resolved) + doLast { + resolved.get().asFile.writeText( + configurations.compileClasspath.get() + .sortedBy { it.name } + .joinToString(System.lineSeparator()) { it.name + "=" + it.readText() } + ) + } + } + """.trimIndent(), + ) + + val result = runner( + "resolveRepositories", + "-PmavenRepositoryProxy=${proxyRepository.toURI()}", + environment = mapOf("CI" to "true"), + ).build() + + assertThat(result.task(":resolveRepositories")?.outcome).isEqualTo(TaskOutcome.SUCCESS) + val resolvedFile = applicationOutput("resolved-repositories.txt") + assertThat(resolvedFile).exists() + assertThat(resolvedFile.readLines()).containsExactly( + "project-only-1.0.jar=project-only", + "shared-1.0.jar=proxy", + ) + } + + /** + * `buildCacheEnabled` defaults to `false` and is plumbed through to the nested daemon as + * an explicit `--no-build-cache` / `--build-cache` argument. The inner build records + * `gradle.startParameter.isBuildCacheEnabled` so we can assert the value the daemon + * actually received, regardless of any inner `gradle.properties`. + */ + @ParameterizedTest(name = "{0}") + @MethodSource("buildCacheFlagCases") + fun `buildCacheEnabled controls the inner --build-cache flag`( + scenario: String, + dslLine: String, + expectedFlag: String, + ) { + writeOuterSettings() + writeSmokeTestAppBuild( + smokeTestGradleApplication( + taskName = "recordCacheFlag", + artifactPath = "cache-flag.txt", + sysProperty = "cache.flag.path", + additionalConfig = dslLine, + ), + ) + writeInnerSettings() + writeInnerBuild( + """ + tasks.register("recordCacheFlag") { + val out = layout.buildDirectory.file("cache-flag.txt") + outputs.file(out) + val flag = gradle.startParameter.isBuildCacheEnabled + doLast { + out.get().asFile.writeText(flag.toString()) + } + } + """.trimIndent(), + ) + + val result = runner("recordCacheFlag").build() + + assertThat(result.task(":recordCacheFlag")?.outcome).isEqualTo(TaskOutcome.SUCCESS) + val flagFile = applicationOutput("cache-flag.txt") + assertThat(flagFile).exists() + assertThat(flagFile.readText().trim()).isEqualTo(expectedFlag) + } + + /** + * Exercises the outer `NestedGradleBuild` `@CacheableTask` end-to-end. The `identical` + * case verifies the task is actually cacheable (FROM_CACHE on a re-run with a wiped + * output dir). The two `env-change` cases verify that the resolved value of an + * `environment` Provider participates in the cache key — covering both first-class + * `providers.gradleProperty(...)` and the closure-based `providers.provider(Callable { … })` + * pattern used by `quarkus-native` for `GRAALVM_HOME`. + */ + @ParameterizedTest(name = "{0}") + @MethodSource("envCacheKeyCases") + fun `outer cache key reflects environment changes`( + scenario: String, + extraOuterImports: String, + extraOuterPreamble: String, + envDslLine: String, + firstRunPropertyValue: String, + secondRunPropertyValue: String, + expectedSecondOutcome: TaskOutcome, + ) { + writeOuterSettings(withLocalBuildCache = true) + writeSmokeTestAppBuild( + smokeTestGradleApplication( + taskName = "buildJar", + artifactPath = "libs/sample.jar", + sysProperty = "sample.path", + additionalConfig = envDslLine, + ), + extraImports = extraOuterImports, + extraPreamble = extraOuterPreamble, + ) + writeInnerSettings() + writeInnerBuild( + """ + tasks.register("buildJar") { + archiveFileName.set("sample.jar") + from(file("src")) + } + """.trimIndent(), + ) + File(applicationDir, "src").mkdir() + File(applicationDir, "src/hello.txt").writeText("hi") + + val firstArgs = listOfNotNull( + "buildJar", + "--build-cache", + firstRunPropertyValue.takeIf { it.isNotEmpty() }?.let { "-PenvValue=$it" }, + ).toTypedArray() + val first = runner(*firstArgs).build() + assertThat(first.task(":buildJar")?.outcome).isEqualTo(TaskOutcome.SUCCESS) + + // Wipe the output dir so the cache must serve it on the next run. + applicationBuildDir.deleteRecursively() + + val secondArgs = listOfNotNull( + "buildJar", + "--build-cache", + secondRunPropertyValue.takeIf { it.isNotEmpty() }?.let { "-PenvValue=$it" }, + ).toTypedArray() + val second = runner(*secondArgs).build() + assertThat(second.task(":buildJar")?.outcome).isEqualTo(expectedSecondOutcome) + assertThat(applicationOutput("libs/sample.jar")).exists() + } + + private fun writeOuterSettings(withLocalBuildCache: Boolean = false) { + val cacheBlock = if (withLocalBuildCache) { + """ + buildCache { + local { + directory = file("${'$'}{rootDir}/build-cache") + } + } + """.trimIndent() + } else { + "" + } + outerSettings.writeText( + """ + rootProject.name = "smoke-test-app-fixture" + $cacheBlock + """.trimIndent(), + ) + } + + private fun writeOuterBuild(buildScript: String) { + outerBuild.writeText(buildScript.trimIndent()) + } + + private fun writeSmokeTestAppBuild( + smokeTestAppBody: String, + extraImports: String = "", + extraPreamble: String = "", + ) { + val imports = extraImports.trimIndent() + val preamble = extraPreamble.trimIndent() + val body = smokeTestAppBody.trimIndent() + writeOuterBuild( + buildString { + if (imports.isNotBlank()) { + appendLine(imports) + appendLine() + } + appendLine("plugins {") + appendLine(" java") + appendLine(" id(\"dd-trace-java.smoke-test-app\")") + appendLine("}") + appendLine() + if (preamble.isNotBlank()) { + appendLine(preamble) + appendLine() + } + appendLine("smokeTestApp {") + appendLine(" javaLauncher.set(") + appendLine(" javaToolchains.launcherFor {") + appendLine(" languageVersion.set(JavaLanguageVersion.of(${currentMajorJdk()}))") + appendLine(" }") + appendLine(" )") + if (body.isNotBlank()) { + appendLine(body.prependIndent(" ")) + } + appendLine("}") + }, + ) + } + + private fun smokeTestGradleApplication( + taskName: String, + artifactPath: String, + sysProperty: String, + additionalConfig: String = "", + ): String { + val config = additionalConfig.trimIndent() + return listOfNotNull( + """ + gradleApp { + taskName.set("$taskName") + artifactPath.set("$artifactPath") + sysProperty.set("$sysProperty") + """.trimIndent(), + config.takeIf { it.isNotBlank() }?.prependIndent(" "), + "}", + ).joinToString(System.lineSeparator()) + } + + private fun smokeTestMavenApplication( + taskName: String, + artifactPath: String, + sysProperty: String, + additionalConfig: String = "", + ): String { + val config = additionalConfig.trimIndent() + return listOfNotNull( + """ + mavenApp { + taskName.set("$taskName") + artifactPath.set("$artifactPath") + sysProperty.set("$sysProperty") + """.trimIndent(), + config.takeIf { it.isNotBlank() }?.prependIndent(" "), + "}", + ).joinToString(System.lineSeparator()) + } + + private fun writeFakeMavenWrapper() { + val wrapper = File(projectDir.toFile(), fakeMavenWrapperName()) + val resource = + requireNotNull(javaClass.getResource(fakeMavenWrapperName())) { + "Missing fake Maven wrapper test resource" + } + wrapper.writeBytes(resource.readBytes()) + if (!isWindows()) { + wrapper.setExecutable(true) + } + } + + private fun fakeMavenWrapperName(): String = + if (isWindows()) { + "fake-mvnw.cmd" + } else { + "fake-mvnw" + } + + private fun writeInnerSettings() { + File(applicationDir, "settings.gradle.kts").writeText( + """ + rootProject.name = "smoke-test-app-fixture-application" + """.trimIndent(), + ) + } + + private fun writeInnerBuild(taskBlock: String) { + File(applicationDir, "build.gradle.kts").writeText( + """ + plugins { + java + } + if (hasProperty("appBuildDir")) { + layout.buildDirectory.set(file(property("appBuildDir") as String)) + } + $taskBlock + """.trimIndent(), + ) + } + + private fun applicationOutput(relativePath: String): File = + applicationBuildDir.resolve(relativePath) + + private fun writeMavenArtifact( + repository: File, + groupId: String, + artifactId: String, + version: String, + jarContent: String, + ) { + val artifactDir = File(repository, "${groupId.replace('.', '/')}/$artifactId/$version") + artifactDir.mkdirs() + File(artifactDir, "$artifactId-$version.pom").writeText( + """ + + 4.0.0 + $groupId + $artifactId + $version + + """.trimIndent(), + ) + File(artifactDir, "$artifactId-$version.jar").writeText(jarContent) + } + + private fun runner( + vararg args: String, + environment: Map? = null, + ): GradleRunner = + GradleRunner.create() + .withProjectDir(projectDir.toFile()) + .withPluginClasspath() + .withArguments(*args, "--stacktrace") + .withEnvironment(sanitizedGradleEnvironment(environment)) + .forwardOutput() + + private fun sanitizedGradleEnvironment( + overrides: Map? = null, + ): Map = + System.getenv() + + mapOf( + "GRADLE_ARGS" to "", + "GRADLE_OPTS" to "", + "GRADLE_USER_HOME" to outerGradleUserHome.absolutePath, + ) + + (overrides ?: emptyMap()) + + private fun currentMajorJdk(): Int = + System.getProperty("java.specification.version").let { + if (it.startsWith("1.")) it.substring(2).toInt() else it.toInt() + } + + companion object { + private val outerGradleUserHome: File by lazy { + Files.createTempDirectory("smoke-test-app-gradle-user-home-").toFile().also { dir -> + Runtime.getRuntime().addShutdownHook(Thread { + try { + DefaultGradleConnector.close() + } catch (_: Exception) { + // best effort + } + dir.deleteRecursively() + }) + } + } + + @JvmStatic + fun buildCacheFlagCases(): List = listOf( + // (scenario name, DSL line added to the `gradleApp { … }` block, expected + // `gradle.startParameter.isBuildCacheEnabled` value seen by the nested daemon) + Arguments.of("default off", "", "false"), + Arguments.of("explicit true", "buildCacheEnabled.set(true)", "true"), + ) + + @JvmStatic + fun envCacheKeyCases(): List = listOf( + // (scenario, extra imports, extra preamble before smokeTestApp, env DSL line, + // first-run -PenvValue, second-run -PenvValue, expected outcome of second run) + Arguments.of( + "identical inputs hit the cache", + "", + "", + "", + "", + "", + TaskOutcome.FROM_CACHE, + ), + Arguments.of( + "gradleProperty env change misses the cache", + "", + "", + """environment.put("MARKER_VAR", providers.gradleProperty("envValue"))""", + "alpha", + "beta", + TaskOutcome.SUCCESS, + ), + Arguments.of( + // Mirrors the `quarkus-native` wiring: an eagerly-resolved script-level value + // flows into `providers.provider(Callable { … })` before being put into the + // `environment` MapProperty. + "Provider-Callable env change misses the cache", + """ + import java.util.concurrent.Callable + import org.gradle.api.provider.Provider + """.trimIndent(), + """ + val envValue: String = (project.findProperty("envValue") as String?) ?: "default" + val markerProvider: Provider = providers.provider(Callable { "resolved-${'$'}envValue" }) + """.trimIndent(), + """environment.put("MARKER_VAR", markerProvider)""", + "alpha", + "beta", + TaskOutcome.SUCCESS, + ), + ) + } +} diff --git a/build-logic/smoke-test/src/test/kotlin/datadog/buildlogic/smoketest/SmokeTestAppPluginTest.kt b/build-logic/smoke-test/src/test/kotlin/datadog/buildlogic/smoketest/SmokeTestAppPluginTest.kt new file mode 100644 index 00000000000..010af208667 --- /dev/null +++ b/build-logic/smoke-test/src/test/kotlin/datadog/buildlogic/smoketest/SmokeTestAppPluginTest.kt @@ -0,0 +1,234 @@ +package datadog.buildlogic.smoketest + +import datadog.buildlogic.smoketest.NestedGradleBuild.Companion.gradleExecutableName +import datadog.buildlogic.smoketest.NestedMavenBuild.Companion.mavenWrapperName +import org.assertj.core.api.Assertions.assertThat +import org.gradle.api.plugins.JavaPlugin +import org.gradle.jvm.toolchain.JavaLanguageVersion +import org.gradle.kotlin.dsl.apply +import org.gradle.kotlin.dsl.findByType +import org.gradle.kotlin.dsl.getByType +import org.gradle.kotlin.dsl.withType +import org.gradle.testfixtures.ProjectBuilder +import org.junit.jupiter.api.Test + +/** + * Fast in-process tests that exercise plugin application and extension wiring through + * [ProjectBuilder]. End-to-end task execution lives in [SmokeTestAppEndToEndTest]. + */ +class SmokeTestAppPluginTest { + + @Test + fun `applying the plugin creates the smokeTestApp extension`() { + val project = ProjectBuilder.builder().build() + + project.plugins.apply("dd-trace-java.smoke-test-app") + + assertThat(project.extensions.findByType()).isNotNull + } + + @Test + fun `plugin is a no-op when no smokeTestApp application is configured`() { + val project = ProjectBuilder.builder().build() + + project.plugins.apply("dd-trace-java.smoke-test-app") + + // No nested build task should be registered until `gradleApp { }` or `mavenApp { }` is invoked. + assertThat(project.tasks.withType()).isEmpty() + assertThat(project.tasks.withType()).isEmpty() + } + + @Test + fun `extension defaults applicationDir to projectDir slash application`() { + val project = ProjectBuilder.builder().build() + project.plugins.apply("dd-trace-java.smoke-test-app") + + val extension = project.extensions.getByType() + + assertThat(extension.applicationDir.get().asFile) + .isEqualTo(project.layout.projectDirectory.dir("application").asFile) + } + + @Test + fun `extension defaults applicationBuildDir to buildDir slash application`() { + val project = ProjectBuilder.builder().build() + project.plugins.apply("dd-trace-java.smoke-test-app") + + val extension = project.extensions.getByType() + + assertThat(extension.applicationBuildDir.get().asFile) + .isEqualTo(project.layout.buildDirectory.dir("application").get().asFile) + } + + @Test + fun `extension defaults gradleVersion to the smoke-test pinned version`() { + val project = ProjectBuilder.builder().build() + project.plugins.apply("dd-trace-java.smoke-test-app") + + val extension = project.extensions.getByType() + + assertThat(extension.gradleVersion.get()).isEqualTo(DEFAULT_NESTED_GRADLE_VERSION) + } + + @Test + fun `gradleApp block registers NestedGradleBuild task with configured inputs`() { + val project = ProjectBuilder.builder().build() + project.apply() + project.plugins.apply("dd-trace-java.smoke-test-app") + + val extension = project.extensions.getByType() + extension.gradleVersion.set("8.14.5") + extension.gradleDistributionBaseUrl.set("https://mass.example") + extension.gradleApp { + taskName.set("packageApp") + artifactPath.set("libs/test.jar") + sysProperty.set("test.path") + nestedTasks.set(listOf("assemble", "check")) + buildArguments.add("-Ddemo=true") + environment.put("DEMO_ENV", "true") + buildCacheEnabled.set(true) + } + + val task = project.tasks.getByName("packageApp") as NestedGradleBuild + + assertThat(task.applicationDir.get().asFile) + .isEqualTo(project.layout.projectDirectory.dir("application").asFile) + assertThat(task.applicationBuildDir.get().asFile) + .isEqualTo(project.layout.buildDirectory.dir("application").get().asFile) + assertThat(task.gradleVersion.get()).isEqualTo("8.14.5") + assertThat(task.gradleDistributionBaseUrl.get()).isEqualTo("https://mass.example") + assertThat(task.tasksToRun.get()).containsExactly("assemble", "check") + assertThat(task.buildArguments.get()).containsExactly("-Ddemo=true") + assertThat(task.environment.get()).containsEntry("DEMO_ENV", "true") + assertThat(task.buildCacheEnabled.get()).isTrue() + assertThat(task.stopTimeoutSeconds.isPresent).isFalse() + } + + @Test + fun `mavenApp block registers NestedMavenBuild task with configured inputs`() { + val project = ProjectBuilder.builder().build() + val wrapperProperties = project.file(".mvn/wrapper/maven-wrapper.properties") + wrapperProperties.parentFile.mkdirs() + wrapperProperties.writeText("distributionUrl=https://repo.example/maven2/test.zip") + project.apply() + project.plugins.apply("dd-trace-java.smoke-test-app") + + val extension = project.extensions.getByType() + extension.mavenApp { + taskName.set("packageApp") + artifactPath.set("target/test.jar") + sysProperty.set("test.path") + goals.set(listOf("verify")) + arguments.add("-Ddemo=true") + environment.put("DEMO_ENV", "true") + mavenOpts.set("-Xmx512M") + mavenExecutable.set(project.layout.projectDirectory.file("mvnw")) + mavenRepositoryProxy.set("https://repo.example") + useMavenLocalRepository.set(true) + mavenLocalRepository.set(project.layout.projectDirectory.dir("m2")) + } + + val task = project.tasks.getByName("packageApp") as NestedMavenBuild + + assertThat(task.applicationDir.get().asFile) + .isEqualTo(project.layout.projectDirectory.dir("application").asFile) + assertThat(task.applicationBuildDir.get().asFile) + .isEqualTo(project.layout.buildDirectory.dir("application").get().asFile) + assertThat(task.goals.get()).containsExactly("verify") + assertThat(task.arguments.get()).containsExactly("-Ddemo=true") + assertThat(task.environment.get()).containsEntry("DEMO_ENV", "true") + assertThat(task.mavenOpts.get()).isEqualTo("-Xmx512M") + assertThat(task.mavenExecutable.get().asFile) + .isEqualTo(project.layout.projectDirectory.file("mvnw").asFile) + assertThat(task.mavenWrapperFiles.files).containsExactly(wrapperProperties) + assertThat(task.mavenRepositoryProxy.get()).isEqualTo("https://repo.example") + assertThat(task.useMavenLocalRepository.get()).isTrue() + assertThat(task.mavenLocalRepository.get().asFile) + .isEqualTo(project.layout.projectDirectory.dir("m2").asFile) + assertThat(task.buildTimeoutSeconds.isPresent).isFalse() + } + + @Test + fun `nested build timeouts can be overridden`() { + val project = ProjectBuilder.builder().build() + project.apply() + project.plugins.apply("dd-trace-java.smoke-test-app") + + val extension = project.extensions.getByType() + extension.gradleApp { + taskName.set("packageGradleApp") + artifactPath.set("libs/test.jar") + sysProperty.set("test.gradle.path") + stopTimeoutSeconds.set(45L) + } + extension.mavenApp { + taskName.set("packageMavenApp") + artifactPath.set("target/test.jar") + sysProperty.set("test.maven.path") + buildTimeoutSeconds.set(60L) + } + + val gradleTask = project.tasks.getByName("packageGradleApp") as NestedGradleBuild + val mavenTask = project.tasks.getByName("packageMavenApp") as NestedMavenBuild + + assertThat(gradleTask.stopTimeoutSeconds.get()).isEqualTo(45L) + assertThat(mavenTask.buildTimeoutSeconds.get()).isEqualTo(60L) + } + + @Test + fun `wrapper executable names follow the host operating system`() { + assertThat(mavenWrapperName("Windows 11")).isEqualTo("mvnw.cmd") + assertThat(mavenWrapperName("Mac OS X")).isEqualTo("mvnw") + assertThat(gradleExecutableName("Windows Server 2022")).isEqualTo("gradle.bat") + assertThat(gradleExecutableName("Linux")).isEqualTo("gradle") + } + + @Test + fun `manual NestedGradleBuild task receives smokeTestApp conventions`() { + val project = ProjectBuilder.builder().build() + project.apply() + project.plugins.apply("dd-trace-java.smoke-test-app") + + val extension = project.extensions.getByType() + extension.initScripts.set(listOf("init-script")) + extension.gradleProperties.set( + mapOf("mavenRepositoryProxy" to "https://repo.example"), + ) + + val task = project.tasks.register("customBuild", NestedGradleBuild::class.java) { + applicationDir.set(project.layout.projectDirectory.dir("application")) + applicationBuildDir.set(project.layout.buildDirectory.dir("application")) + tasksToRun.set(listOf("buildJar")) + }.get() + + assertThat(task.initScripts.get()).containsExactly("init-script") + assertThat(task.gradleProperties.get()) + .containsEntry("mavenRepositoryProxy", "https://repo.example") + } + + @Test + fun `Gradle distribution URI routes through MASS artifact path`() { + assertThat(gradleDistributionUri("https://mass.example", "8.14.5").toString()) + .isEqualTo( + "https://mass.example/internal/artifact/services.gradle.org/distributions/gradle-8.14.5-bin.zip", + ) + assertThat(gradleDistributionUri("https://mass.example/", "8.14.5").toString()) + .isEqualTo( + "https://mass.example/internal/artifact/services.gradle.org/distributions/gradle-8.14.5-bin.zip", + ) + } + + @Test + fun `extension defaults javaLauncher to a JDK 21 toolchain`() { + // JavaToolchainService is contributed by the `java-base` plugin; apply something that + // pulls it in so ProjectBuilder can resolve the convention. + val project = ProjectBuilder.builder().build() + project.apply() + project.plugins.apply("dd-trace-java.smoke-test-app") + + val extension = project.extensions.getByType() + + assertThat(extension.javaLauncher.get().metadata.languageVersion) + .isEqualTo(JavaLanguageVersion.of(DEFAULT_NESTED_JAVA_VERSION)) + } +} diff --git a/build-logic/smoke-test/src/test/resources/datadog/buildlogic/smoketest/fake-mvnw b/build-logic/smoke-test/src/test/resources/datadog/buildlogic/smoketest/fake-mvnw new file mode 100644 index 00000000000..7eaa9c6feae --- /dev/null +++ b/build-logic/smoke-test/src/test/resources/datadog/buildlogic/smoketest/fake-mvnw @@ -0,0 +1,18 @@ +#!/bin/sh +set -eu + +target="" +while [ "$#" -gt 0 ]; do + case "$1" in + -Dtarget.dir=*) target="${1#-Dtarget.dir=}" ;; + esac + shift +done + +[ -n "$target" ] || exit 2 +mkdir -p "$target" +printf "jar" > "$target/sample.jar" +{ + printf "MAVEN_OPTS=%s\n" "${MAVEN_OPTS:-}" + printf "MVNW_REPOURL=%s\n" "${MVNW_REPOURL:-}" +} > "$target/maven-env.txt" diff --git a/build-logic/smoke-test/src/test/resources/datadog/buildlogic/smoketest/fake-mvnw.cmd b/build-logic/smoke-test/src/test/resources/datadog/buildlogic/smoketest/fake-mvnw.cmd new file mode 100644 index 00000000000..0a1c101024c --- /dev/null +++ b/build-logic/smoke-test/src/test/resources/datadog/buildlogic/smoketest/fake-mvnw.cmd @@ -0,0 +1,19 @@ +@echo off +setlocal enabledelayedexpansion + +set "target=" +:parse +if "%~1"=="" goto run +set "arg=%~1" +if "!arg:~0,13!"=="-Dtarget.dir=" set "target=!arg:~13!" +shift +goto parse + +:run +if "%target%"=="" exit /b 2 +mkdir "%target%" 2>nul +echo jar>"%target%\sample.jar" +( + echo MAVEN_OPTS=%MAVEN_OPTS% + echo MVNW_REPOURL=%MVNW_REPOURL% +) > "%target%\maven-env.txt" diff --git a/build.gradle.kts b/build.gradle.kts index 38169896069..254d9927817 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,5 @@ import com.diffplug.gradle.spotless.SpotlessExtension +import datadog.gradle.plugin.HostPlatform import datadog.gradle.plugin.ci.testAggregate plugins { @@ -13,10 +14,10 @@ plugins { id("com.diffplug.spotless") version "8.4.0" id("me.champeau.gradle.japicmp") version "0.4.3" - id("com.github.spotbugs") version "6.5.0" + id("com.github.spotbugs") version "6.5.5" id("de.thetaphi.forbiddenapis") version "3.10" id("io.github.gradle-nexus.publish-plugin") version "2.0.0" - id("com.gradleup.shadow") version "8.3.9" apply false + alias(libs.plugins.shadow) apply false id("me.champeau.jmh") version "0.7.3" apply false id("org.gradle.playframework") version "0.16.0" apply false } @@ -65,6 +66,13 @@ val compileTask = tasks.register("compile") allprojects { group = "com.datadoghq" + normalization { + runtimeClasspath { + // Let's ignore only version files generated by dd-trace-java.version-file + ignore("**/*.version") + } + } + if (isCI.isPresent) { layout.buildDirectory = providers.provider { val newProjectCIPath = projectDir.path.replace( @@ -82,6 +90,8 @@ allprojects { dependsOn(tasks.withType()) } + val isLinuxArm64 = HostPlatform.isLinuxArm64() + tasks.configureEach { if (this is JavaForkOptions) { maxHeapSize = System.getProperty("datadog.forkedMaxHeapSize") @@ -91,6 +101,20 @@ allprojects { "-XX:+HeapDumpOnOutOfMemoryError", "-XX:HeapDumpPath=/tmp" ) + if (isLinuxArm64) { + // Disable CDS to avoid SIGSEGVs on Linux arm64. + jvmArgs("-Xshare:off") + } + } + } + + // Disable CDS to avoid SIGSEGVs on Linux arm64. + if (isLinuxArm64) { + tasks.withType().configureEach { + options.forkOptions.jvmArgs?.add("-Xshare:off") + } + tasks.withType().configureEach { + groovyOptions.forkOptions.jvmArgs?.add("-Xshare:off") } } } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 8083b423297..991ca899596 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -39,11 +39,21 @@ gradlePlugin { implementationClass = "datadog.gradle.plugin.version.TracerVersionPlugin" } + create("version-file-plugin") { + id = "dd-trace-java.version-file" + implementationClass = "datadog.gradle.plugin.version.WriteVersionFilePlugin" + } + create("dump-hanged-test-plugin") { id = "dd-trace-java.dump-hanged-test" implementationClass = "datadog.gradle.plugin.dump.DumpHangedTestPlugin" } + create("test-jvm-constraints-plugin") { + id = "dd-trace-java.test-jvm-constraints" + implementationClass = "datadog.gradle.plugin.testJvmConstraints.TestJvmConstraintsPlugin" + } + create("supported-config-generation") { id = "dd-trace-java.supported-config-generator" implementationClass = "datadog.gradle.plugin.config.SupportedConfigPlugin" @@ -58,12 +68,20 @@ gradlePlugin { id = "dd-trace-java.instrumentation-naming" implementationClass = "datadog.gradle.plugin.naming.InstrumentationNamingPlugin" } + + create("sca-enrichments-plugin") { + id = "dd-trace-java.sca-enrichments" + implementationClass = "datadog.gradle.plugin.sca.ScaEnrichmentsPlugin" + } + + create("jardiff-plugin") { + id = "dd-trace-java.jardiff" + implementationClass = "datadog.gradle.plugin.jardiff.JardiffPlugin" + } } } -apply { - from("$rootDir/../gradle/repositories.gradle") -} +apply(from = "$rootDir/../gradle/repositories.gradle") repositories { gradlePluginPortal() @@ -72,7 +90,7 @@ repositories { dependencies { implementation(gradleApi()) - implementation("net.bytebuddy", "byte-buddy-gradle-plugin", "1.18.8") + implementation("net.bytebuddy", "byte-buddy-gradle-plugin", "1.18.10") implementation("org.eclipse.aether", "aether-connector-basic", "1.1.0") implementation("org.eclipse.aether", "aether-transport-http", "1.1.0") @@ -80,9 +98,8 @@ dependencies { implementation("org.apache.maven", "maven-aether-provider", "3.3.9") implementation("com.github.zafarkhaja:java-semver:0.10.2") - implementation("com.github.javaparser", "javaparser-symbol-solver-core", "3.24.4") + implementation(libs.javaparser.symbol.solver) - implementation("com.google.guava", "guava", "20.0") implementation(libs.asm) implementation(libs.asm.tree) @@ -96,12 +113,13 @@ dependencies { tasks.compileKotlin { dependsOn(":call-site-instrumentation-plugin:build") + dependsOn(":modifiable-config-agent:build") } testing { @Suppress("UnstableApiUsage") suites { - val test by getting(JvmTestSuite::class) { + named("test") { dependencies { implementation(libs.assertj.core) } diff --git a/buildSrc/call-site-instrumentation-plugin/build.gradle.kts b/buildSrc/call-site-instrumentation-plugin/build.gradle.kts index 562ab980e91..80097f55629 100644 --- a/buildSrc/call-site-instrumentation-plugin/build.gradle.kts +++ b/buildSrc/call-site-instrumentation-plugin/build.gradle.kts @@ -1,7 +1,11 @@ +import com.github.jengelman.gradle.plugins.shadow.transformers.ApacheLicenseResourceTransformer +import com.github.jengelman.gradle.plugins.shadow.transformers.ApacheNoticeResourceTransformer +import org.gradle.api.file.DuplicatesStrategy.INCLUDE + plugins { java id("com.diffplug.spotless") version "8.4.0" - id("com.gradleup.shadow") version "8.3.9" + alias(libs.plugins.shadow) } java { @@ -25,19 +29,19 @@ apply { } dependencies { - compileOnly("com.google.code.findbugs", "jsr305", "3.0.2") + compileOnly(libs.jsr305) implementation("org.freemarker", "freemarker", "2.3.30") implementation(libs.asm) implementation(libs.asm.tree) implementation(libs.javaparser.symbol.solver) + testCompileOnly(libs.jsr305) testImplementation(libs.bytebuddy) testImplementation(libs.bundles.junit5) testRuntimeOnly(libs.junit.platform.launcher) testImplementation(libs.bundles.mockito) testImplementation("javax.servlet", "javax.servlet-api", "3.0.1") - testImplementation(libs.spotbugs.annotations) } sourceSets { @@ -69,7 +73,11 @@ tasks { } shadowJar { - mergeServiceFiles() + duplicatesStrategy = INCLUDE + transform() + transform() + failOnDuplicateEntries = true + manifest { attributes(mapOf("Main-Class" to "datadog.trace.plugin.csi.PluginApplication")) } diff --git a/buildSrc/call-site-instrumentation-plugin/src/main/java/datadog/trace/plugin/csi/TypeResolver.java b/buildSrc/call-site-instrumentation-plugin/src/main/java/datadog/trace/plugin/csi/TypeResolver.java index 44b32c3bf87..666a460a3d1 100644 --- a/buildSrc/call-site-instrumentation-plugin/src/main/java/datadog/trace/plugin/csi/TypeResolver.java +++ b/buildSrc/call-site-instrumentation-plugin/src/main/java/datadog/trace/plugin/csi/TypeResolver.java @@ -1,6 +1,6 @@ package datadog.trace.plugin.csi; -import com.github.javaparser.symbolsolver.model.resolution.TypeSolver; +import com.github.javaparser.resolution.TypeSolver; import datadog.trace.plugin.csi.HasErrors.HasErrorsException; import datadog.trace.plugin.csi.util.MethodType; import java.lang.reflect.Executable; diff --git a/buildSrc/call-site-instrumentation-plugin/src/main/java/datadog/trace/plugin/csi/impl/TypeResolverPool.java b/buildSrc/call-site-instrumentation-plugin/src/main/java/datadog/trace/plugin/csi/impl/TypeResolverPool.java index 0cfa4eadf9b..f1d5159a46a 100644 --- a/buildSrc/call-site-instrumentation-plugin/src/main/java/datadog/trace/plugin/csi/impl/TypeResolverPool.java +++ b/buildSrc/call-site-instrumentation-plugin/src/main/java/datadog/trace/plugin/csi/impl/TypeResolverPool.java @@ -3,9 +3,9 @@ import static datadog.trace.plugin.csi.util.CallSiteUtils.classNameToType; import static datadog.trace.plugin.csi.util.CallSiteUtils.repeat; +import com.github.javaparser.resolution.TypeSolver; import com.github.javaparser.resolution.declarations.ResolvedReferenceTypeDeclaration; -import com.github.javaparser.symbolsolver.model.resolution.SymbolReference; -import com.github.javaparser.symbolsolver.model.resolution.TypeSolver; +import com.github.javaparser.resolution.model.SymbolReference; import com.github.javaparser.symbolsolver.reflectionmodel.ReflectionFactory; import datadog.trace.plugin.csi.HasErrors.Failure; import datadog.trace.plugin.csi.TypeResolver; @@ -147,7 +147,13 @@ public SymbolReference tryToSolveType(final St final Class clazz = resolveType(type); return SymbolReference.solved(ReflectionFactory.typeDeclarationFor(clazz, getRoot())); } catch (final Throwable e) { - return SymbolReference.unsolved(ResolvedReferenceTypeDeclaration.class); + return SymbolReference.unsolved(); } } + + @Override + public SymbolReference tryToSolveTypeInModule( + String qualifiedModuleName, String simpleTypeName) { + return tryToSolveType(simpleTypeName); + } } diff --git a/buildSrc/call-site-instrumentation-plugin/src/test/java/datadog/trace/plugin/csi/impl/AsmSpecificationBuilderTest.java b/buildSrc/call-site-instrumentation-plugin/src/test/java/datadog/trace/plugin/csi/impl/AsmSpecificationBuilderTest.java index ec37662ff58..14ad65bfb0b 100644 --- a/buildSrc/call-site-instrumentation-plugin/src/test/java/datadog/trace/plugin/csi/impl/AsmSpecificationBuilderTest.java +++ b/buildSrc/call-site-instrumentation-plugin/src/test/java/datadog/trace/plugin/csi/impl/AsmSpecificationBuilderTest.java @@ -15,7 +15,6 @@ import datadog.trace.plugin.csi.impl.CallSiteSpecification.AroundSpecification; import datadog.trace.plugin.csi.impl.CallSiteSpecification.BeforeSpecification; import datadog.trace.plugin.csi.util.Types; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.io.File; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; @@ -558,7 +557,6 @@ static class TestWithOtherAnnotations { @CallSite.Around("java.lang.StringBuilder java.lang.StringBuilder.append(java.lang.Object)") @CallSite.Around("java.lang.StringBuffer java.lang.StringBuffer.append(java.lang.Object)") @Nonnull - @SuppressFBWarnings("NP_PARAMETER_MUST_BE_NONNULL_BUT_MARKED_AS_NULLABLE") static Appendable aroundAppend( @CallSite.This @Nullable Appendable self, @CallSite.Argument(0) @Nullable Object param) throws Throwable { diff --git a/buildSrc/modifiable-config-agent/build.gradle.kts b/buildSrc/modifiable-config-agent/build.gradle.kts new file mode 100644 index 00000000000..baecb9b269b --- /dev/null +++ b/buildSrc/modifiable-config-agent/build.gradle.kts @@ -0,0 +1,41 @@ +plugins { + java + alias(libs.plugins.shadow) +} + +java { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 +} + +apply { + from("$rootDir/../gradle/repositories.gradle") +} + +dependencies { + implementation(libs.asm) +} + +tasks { + shadowJar { + archiveClassifier.set("") + relocate("org.objectweb.asm", "datadog.trace.agent.test.config.shaded.asm") + manifest { + attributes( + mapOf( + "Premain-Class" to "datadog.trace.agent.test.config.ModifiableConfigAgent", + "Can-Retransform-Classes" to "false", + "Can-Redefine-Classes" to "false", + ), + ) + } + } + + jar { + enabled = false + } + + build { + dependsOn(shadowJar) + } +} diff --git a/buildSrc/modifiable-config-agent/src/main/java/datadog/trace/agent/test/config/ModifiableConfigAgent.java b/buildSrc/modifiable-config-agent/src/main/java/datadog/trace/agent/test/config/ModifiableConfigAgent.java new file mode 100644 index 00000000000..08c216fb905 --- /dev/null +++ b/buildSrc/modifiable-config-agent/src/main/java/datadog/trace/agent/test/config/ModifiableConfigAgent.java @@ -0,0 +1,80 @@ +package datadog.trace.agent.test.config; + +import java.lang.instrument.ClassFileTransformer; +import java.lang.instrument.IllegalClassFormatException; +import java.lang.instrument.Instrumentation; +import java.security.ProtectionDomain; +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.FieldVisitor; +import org.objectweb.asm.Opcodes; + +/** + * Test-only Java agent that rewrites the {@code INSTANCE} field of {@code + * datadog.trace.api.Config} and {@code datadog.trace.api.InstrumenterConfig} to be public, + * volatile, and non-final, so tests can swap the singleton with a freshly-built instance. + * + *

Unlike a JUnit 5 extension that uses ByteBuddy to retransform the classes, this agent runs + * before any class is loaded, so the rewrite is guaranteed regardless of which class touches the + * config first. + */ +public final class ModifiableConfigAgent { + + private static final String CONFIG = "datadog/trace/api/Config"; + private static final String INST_CONFIG = "datadog/trace/api/InstrumenterConfig"; + private static final String INSTANCE = "INSTANCE"; + + private ModifiableConfigAgent() {} + + public static void premain(String args, Instrumentation inst) { + inst.addTransformer(new InstanceFieldRewriter(), false); + } + + static final class InstanceFieldRewriter implements ClassFileTransformer { + @Override + public byte[] transform( + ClassLoader loader, + String className, + Class classBeingRedefined, + ProtectionDomain protectionDomain, + byte[] classfileBuffer) + throws IllegalClassFormatException { + if (className == null) { + return null; + } + if (!CONFIG.equals(className) && !INST_CONFIG.equals(className)) { + return null; + } + try { + ClassReader reader = new ClassReader(classfileBuffer); + ClassWriter writer = new ClassWriter(reader, 0); + reader.accept(new InstanceFieldClassVisitor(writer), 0); + return writer.toByteArray(); + } catch (Throwable t) { + System.err.println( + "[modifiable-config-agent] failed to rewrite " + className + ": " + t); + return null; + } + } + } + + static final class InstanceFieldClassVisitor extends ClassVisitor { + InstanceFieldClassVisitor(ClassVisitor cv) { + super(Opcodes.ASM9, cv); + } + + @Override + public FieldVisitor visitField( + int access, String name, String descriptor, String signature, Object value) { + if (INSTANCE.equals(name)) { + int rewritten = + (access & ~(Opcodes.ACC_PRIVATE | Opcodes.ACC_PROTECTED | Opcodes.ACC_FINAL)) + | Opcodes.ACC_PUBLIC + | Opcodes.ACC_VOLATILE; + return super.visitField(rewritten, name, descriptor, signature, value); + } + return super.visitField(access, name, descriptor, signature, value); + } + } +} diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts index a59a99083c0..0e2e0c39655 100644 --- a/buildSrc/settings.gradle.kts +++ b/buildSrc/settings.gradle.kts @@ -1,4 +1,5 @@ include(":call-site-instrumentation-plugin") +include(":modifiable-config-agent") dependencyResolutionManagement { versionCatalogs { diff --git a/buildSrc/src/main/kotlin/datadog/gradle/plugin/HostPlatform.kt b/buildSrc/src/main/kotlin/datadog/gradle/plugin/HostPlatform.kt new file mode 100644 index 00000000000..40837194ecd --- /dev/null +++ b/buildSrc/src/main/kotlin/datadog/gradle/plugin/HostPlatform.kt @@ -0,0 +1,21 @@ +package datadog.gradle.plugin + +import java.util.Locale + +object HostPlatform { + @JvmStatic + fun isLinuxArm64(): Boolean = isExpectedOs("linux") && isArm64() + + @JvmStatic + fun isMacArm64(): Boolean = isExpectedOs("mac") && isArm64() + + private fun isExpectedOs(expectedOs: String): Boolean { + val osName = System.getProperty("os.name", "").lowercase(Locale.ROOT) + return osName.contains(expectedOs) + } + + private fun isArm64(): Boolean { + val osArch = System.getProperty("os.arch", "").lowercase(Locale.ROOT) + return osArch.contains("aarch64") || osArch.contains("arm64") + } +} diff --git a/buildSrc/src/main/kotlin/datadog/gradle/plugin/config/ParseV2SupportedConfigurationsTask.kt b/buildSrc/src/main/kotlin/datadog/gradle/plugin/config/ParseV2SupportedConfigurationsTask.kt index 17fb4f07106..0715d43a8cc 100644 --- a/buildSrc/src/main/kotlin/datadog/gradle/plugin/config/ParseV2SupportedConfigurationsTask.kt +++ b/buildSrc/src/main/kotlin/datadog/gradle/plugin/config/ParseV2SupportedConfigurationsTask.kt @@ -117,7 +117,14 @@ abstract class ParseV2SupportedConfigurationsTask @Inject constructor( PrintWriter(outFile).use { out -> out.println("package $packageName;") out.println() - out.println("import java.util.*;") + out.println("import java.util.HashMap;") + out.println("import java.util.List;") + out.println("import java.util.Map;") + out.println("import static java.util.Arrays.asList;") + out.println("import static java.util.Collections.emptyList;") + out.println("import static java.util.Collections.singletonList;") + out.println("import static java.util.Collections.unmodifiableList;") + out.println("import static java.util.Collections.unmodifiableMap;") out.println() out.println("public final class $className {") out.println() @@ -145,7 +152,7 @@ abstract class ParseV2SupportedConfigurationsTask @Inject constructor( out.println(" Map> supportedMap = new HashMap<>();") out.println(" initSupported1(supportedMap);") out.println(" initSupported2(supportedMap);") - out.println(" return Collections.unmodifiableMap(supportedMap);") + out.println(" return unmodifiableMap(supportedMap);") out.println(" }") out.println() @@ -155,20 +162,7 @@ abstract class ParseV2SupportedConfigurationsTask @Inject constructor( // initSupported1() - first half out.println(" private static void initSupported1(Map> supportedMap) {") for ((key, configList) in sortedSupported.take(midpoint)) { - out.print(" supportedMap.put(\"${esc(key)}\", Collections.unmodifiableList(Arrays.asList(") - val configIter = configList.iterator() - while (configIter.hasNext()) { - val config = configIter.next() - out.print("new SupportedConfiguration(") - out.print("${escNullableString(config.version)}, ") - out.print("${escNullableString(config.type)}, ") - out.print("${escNullableString(config.default)}, ") - out.print("Arrays.asList(${quoteList(config.aliases)}), ") - out.print("Arrays.asList(${quoteList(config.propertyKeys)})") - out.print(")") - if (configIter.hasNext()) out.print(", ") - } - out.println(")));") + out.println(" supportedMap.put(\"${esc(key)}\", ${supportedConfigListLiteral(configList)});") } out.println(" }") out.println() @@ -176,20 +170,7 @@ abstract class ParseV2SupportedConfigurationsTask @Inject constructor( // initSupported2() - second half out.println(" private static void initSupported2(Map> supportedMap) {") for ((key, configList) in sortedSupported.drop(midpoint)) { - out.print(" supportedMap.put(\"${esc(key)}\", Collections.unmodifiableList(Arrays.asList(") - val configIter = configList.iterator() - while (configIter.hasNext()) { - val config = configIter.next() - out.print("new SupportedConfiguration(") - out.print("${escNullableString(config.version)}, ") - out.print("${escNullableString(config.type)}, ") - out.print("${escNullableString(config.default)}, ") - out.print("Arrays.asList(${quoteList(config.aliases)}), ") - out.print("Arrays.asList(${quoteList(config.propertyKeys)})") - out.print(")") - if (configIter.hasNext()) out.print(", ") - } - out.println(")));") + out.println(" supportedMap.put(\"${esc(key)}\", ${supportedConfigListLiteral(configList)});") } out.println(" }") out.println() @@ -200,12 +181,12 @@ abstract class ParseV2SupportedConfigurationsTask @Inject constructor( out.println(" Map> aliasesMap = new HashMap<>();") for ((canonical, list) in aliases.toSortedMap()) { out.printf( - " aliasesMap.put(\"%s\", Collections.unmodifiableList(Arrays.asList(%s)));\n", + " aliasesMap.put(\"%s\", %s);\n", esc(canonical), - quoteList(list) + unmodifiableListLiteral(list) ) } - out.println(" return Collections.unmodifiableMap(aliasesMap);") + out.println(" return unmodifiableMap(aliasesMap);") out.println(" }") out.println() @@ -215,7 +196,7 @@ abstract class ParseV2SupportedConfigurationsTask @Inject constructor( for ((alias, target) in aliasMapping.toSortedMap()) { out.printf(" aliasMappingMap.put(\"%s\", \"%s\");\n", esc(alias), esc(target)) } - out.println(" return Collections.unmodifiableMap(aliasMappingMap);") + out.println(" return unmodifiableMap(aliasMappingMap);") out.println(" }") out.println() @@ -225,7 +206,7 @@ abstract class ParseV2SupportedConfigurationsTask @Inject constructor( for ((oldKey, note) in deprecated.toSortedMap()) { out.printf(" deprecatedMap.put(\"%s\", \"%s\");\n", esc(oldKey), esc(note)) } - out.println(" return Collections.unmodifiableMap(deprecatedMap);") + out.println(" return unmodifiableMap(deprecatedMap);") out.println(" }") out.println() @@ -235,15 +216,36 @@ abstract class ParseV2SupportedConfigurationsTask @Inject constructor( for ((propertyKey, config) in reversePropertyKeysMap.toSortedMap()) { out.printf(" reversePropertyKeysMapping.put(\"%s\", \"%s\");\n", esc(propertyKey), esc(config)) } - out.println(" return Collections.unmodifiableMap(reversePropertyKeysMapping);") + out.println(" return unmodifiableMap(reversePropertyKeysMapping);") out.println(" }") out.println("}") } } + private fun supportedConfigLiteral(config: SupportedConfigurationItem): String = + "new SupportedConfiguration(${escNullableString(config.version)}, ${escNullableString(config.type)}, ${escNullableString(config.default)}, ${listLiteral(config.aliases)}, ${listLiteral(config.propertyKeys)})" + + private fun supportedConfigListLiteral(configList: List): String = when (configList.size) { + 0 -> "emptyList()" + 1 -> "singletonList(${supportedConfigLiteral(configList[0])})" + else -> "unmodifiableList(asList(${configList.joinToString(", ") { supportedConfigLiteral(it) }}))" + } + private fun quoteList(list: List): String = list.joinToString(", ") { "\"${esc(it)}\"" } + private fun listLiteral(list: List): String = when (list.size) { + 0 -> "emptyList()" + 1 -> "singletonList(${quoteList(list)})" + else -> "asList(${quoteList(list)})" + } + + private fun unmodifiableListLiteral(list: List): String = when (list.size) { + 0 -> "emptyList()" + 1 -> "singletonList(${quoteList(list)})" + else -> "unmodifiableList(asList(${quoteList(list)}))" + } + private fun esc(s: String): String = s.replace("\\", "\\\\").replace("\"", "\\\"") diff --git a/buildSrc/src/main/kotlin/datadog/gradle/plugin/instrument/BuildTimeInstrumentationPlugin.kt b/buildSrc/src/main/kotlin/datadog/gradle/plugin/instrument/BuildTimeInstrumentationPlugin.kt index eb8c0358e04..e89a7f13ea0 100644 --- a/buildSrc/src/main/kotlin/datadog/gradle/plugin/instrument/BuildTimeInstrumentationPlugin.kt +++ b/buildSrc/src/main/kotlin/datadog/gradle/plugin/instrument/BuildTimeInstrumentationPlugin.kt @@ -3,6 +3,7 @@ package datadog.gradle.plugin.instrument import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.logging.Logging +import org.gradle.api.tasks.ClasspathNormalizer import org.gradle.api.tasks.SourceSet import org.gradle.api.tasks.SourceSetContainer import org.gradle.api.tasks.compile.AbstractCompile @@ -55,7 +56,6 @@ class BuildTimeInstrumentationPlugin : Plugin { project.extensions.create("buildTimeInstrumentation") project.configurations.register(BUILD_TIME_INSTRUMENTATION_PLUGIN_CONFIGURATION) { - isVisible = false isCanBeConsumed = false isCanBeResolved = true } @@ -115,6 +115,8 @@ class BuildTimeInstrumentationPlugin : Plugin { BUILD_TIME_INSTRUMENTATION_PLUGIN_CONFIGURATION ) inputs.files(project.configurations.named(BUILD_TIME_INSTRUMENTATION_PLUGIN_CONFIGURATION)) + .withPropertyName(BUILD_TIME_INSTRUMENTATION_PLUGIN_CONFIGURATION) + .withNormalizer(ClasspathNormalizer::class.java) // Compute optional Java version. val match = Regex("compileMain_(.+)Java").matchEntire(compileTaskName) diff --git a/buildSrc/src/main/kotlin/datadog/gradle/plugin/instrument/InstrumentPostProcessingAction.kt b/buildSrc/src/main/kotlin/datadog/gradle/plugin/instrument/InstrumentPostProcessingAction.kt index b8c3e300afd..839b41e0960 100644 --- a/buildSrc/src/main/kotlin/datadog/gradle/plugin/instrument/InstrumentPostProcessingAction.kt +++ b/buildSrc/src/main/kotlin/datadog/gradle/plugin/instrument/InstrumentPostProcessingAction.kt @@ -1,5 +1,6 @@ package datadog.gradle.plugin.instrument +import datadog.gradle.plugin.HostPlatform import datadog.gradle.plugin.instrument.BuildTimeInstrumentationPlugin.Companion.BUILD_TIME_INSTRUMENTATION_PLUGIN_CONFIGURATION import org.gradle.api.Action import org.gradle.api.Project @@ -73,6 +74,10 @@ abstract class InstrumentPostProcessingAction @Inject constructor( return workerExecutor.processIsolation { forkOptions { setExecutable(javaLauncher.executablePath.asFile.absolutePath) + if (HostPlatform.isLinuxArm64()) { + // Disable CDS to avoid SIGSEGVs on Linux arm64. + jvmArgs("-Xshare:off") + } } } } diff --git a/buildSrc/src/main/kotlin/datadog/gradle/plugin/jardiff/JardiffComparison.kt b/buildSrc/src/main/kotlin/datadog/gradle/plugin/jardiff/JardiffComparison.kt new file mode 100644 index 00000000000..4be130aabe0 --- /dev/null +++ b/buildSrc/src/main/kotlin/datadog/gradle/plugin/jardiff/JardiffComparison.kt @@ -0,0 +1,84 @@ +package datadog.gradle.plugin.jardiff + +import java.io.File + +/** + * Pure, Gradle-free helpers for driving the [jardiff](https://github.com/bric3/jardiff) CLI. + * + * Kept separate from [JardiffTask] so the argument construction and exit-code interpretation can + * be unit-tested without spinning up a Gradle build or resolving the jardiff jar. + */ +object JardiffComparison { + /** Outcome of a jardiff run, derived from its process exit value. */ + enum class Outcome { + /** Exit 0 — the two jars are identical (for the selected include/exclude set). */ + IDENTICAL, + + /** Exit 1 — jardiff reported differences (behaves like `diff(1)` under `--exit-code`). */ + DIFFERENT, + + /** Any other exit value — jardiff itself failed (bad arguments, unreadable jar, ...). */ + ERROR, + } + + /** + * Builds the jardiff argument list comparing [reference] (left) against [candidate] (right). + * + * [mode] selects the output mode (e.g. `--stat` for a `git diff --stat`-like summary, `--status`, + * or blank for the default full diff). `--exit-code` is always added. + * The [JardiffTask] relies on the process exit value. + * [includes]/[excludes] are comma-joined glob patterns (empty means comparing every entry), and + * [additionalOptions] are passed through verbatim, right before the two jars. + */ + fun buildArguments( + reference: File, + candidate: File, + mode: String, + includes: List = emptyList(), + excludes: List = emptyList(), + additionalOptions: List = emptyList(), + ): List = buildList { + if (mode.isNotBlank()) { + add(mode) + } + add("--exit-code") + add("--color=never") + if (includes.isNotEmpty()) { + add("--include=" + includes.joinToString(",")) + } + if (excludes.isNotEmpty()) { + add("--exclude=" + excludes.joinToString(",")) + } + addAll(additionalOptions) + // jardiff positional arguments: . + // The reference (the artifact validated by the build job) is the left/baseline side, + // the freshly built candidate is the right side. + add(reference.absolutePath) + add(candidate.absolutePath) + } + + /** Maps a jardiff process exit value to an [Outcome]. */ + fun outcomeOf(exitValue: Int): Outcome = when (exitValue) { + 0 -> Outcome.IDENTICAL + 1 -> Outcome.DIFFERENT + else -> Outcome.ERROR + } + + /** + * Renders the equivalent `java -cp … ` shell command, so the comparison + * can be copy-pasted and reproduced outside Gradle. Tokens containing shell-significant + * characters (spaces, globs, commas, ...) are single-quoted. + */ + fun shellCommandLine(classpath: Iterable, mainClass: String, arguments: List): String { + val classpathValue = classpath.joinToString(File.pathSeparator) { it.absolutePath } + return (listOf("java", "-cp", classpathValue, mainClass) + arguments) + .joinToString(" ", transform = ::shellQuote) + } + + private fun shellQuote(token: String): String = + if (token.isNotEmpty() && token.all { it.isLetterOrDigit() || it in "/._-=:" }) { + token + } else { + "'" + token.replace("'", "'\\''") + "'" + } +} diff --git a/buildSrc/src/main/kotlin/datadog/gradle/plugin/jardiff/JardiffExtension.kt b/buildSrc/src/main/kotlin/datadog/gradle/plugin/jardiff/JardiffExtension.kt new file mode 100644 index 00000000000..ea30caede98 --- /dev/null +++ b/buildSrc/src/main/kotlin/datadog/gradle/plugin/jardiff/JardiffExtension.kt @@ -0,0 +1,43 @@ +package datadog.gradle.plugin.jardiff + +import org.gradle.api.file.DirectoryProperty +import org.gradle.api.provider.ListProperty +import org.gradle.api.provider.Property + +/** Configuration for the [JardiffPlugin]. */ +interface JardiffExtension { + /** + * Maven coordinate of the jardiff CLI resolved to run the comparison. + * Defaults to [JardiffPlugin.DEFAULT_TOOL_COORDINATE]. + */ + val toolCoordinate: Property + + /** + * Fully qualified main class of the jardiff CLI. + * Defaults to [JardiffPlugin.DEFAULT_MAIN_CLASS]. + */ + val mainClass: Property + + /** + * jardiff output mode flag, e.g. `--stat` or `--status`; blank selects the default full diff. + * Defaults to [JardiffPlugin.DEFAULT_MODE]. + */ + val mode: Property + + /** + * Extra jardiff options passed verbatim, right before the two jars (e.g. `--ignore-member-order` + * or `--class-text-producer=javap`). Empty by default. + */ + val additionalOptions: ListProperty + + /** + * Directory receiving jardiff reports. Defaults to `build/reports/jardiff` in the target project. + */ + val reportDir: DirectoryProperty + + /** + * When true, tolerate mismatching candidate and reference jar hashes if jardiff reports no + * differences. Defaults to false. + */ + val ignoreHashCheck: Property +} diff --git a/buildSrc/src/main/kotlin/datadog/gradle/plugin/jardiff/JardiffPlugin.kt b/buildSrc/src/main/kotlin/datadog/gradle/plugin/jardiff/JardiffPlugin.kt new file mode 100644 index 00000000000..d73fdd7a4c8 --- /dev/null +++ b/buildSrc/src/main/kotlin/datadog/gradle/plugin/jardiff/JardiffPlugin.kt @@ -0,0 +1,100 @@ +package datadog.gradle.plugin.jardiff + +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.api.tasks.bundling.AbstractArchiveTask +import org.gradle.kotlin.dsl.create +import org.gradle.kotlin.dsl.named +import org.gradle.kotlin.dsl.register + +/** + * Registers the `compareToReferenceJar` task ([JardiffTask]) and wires its reusable inputs: + * - the jardiff CLI classpath (resolved from [JardiffExtension.toolCoordinate]), + * - the candidate archive — the module's main publishable jar (the shadow jar when the shadow + * plugin is applied, otherwise the plain jar), + * - the reference jar, resolved from the `-PjardiffReferenceDir` project property by matching the + * candidate's file name inside that directory. + * + * Apply it with `id("dd-trace-java.jardiff")`. + */ +class JardiffPlugin : Plugin { + override fun apply(project: Project) { + val extension = project.extensions.create("jardiff") + extension.toolCoordinate.convention(DEFAULT_TOOL_COORDINATE) + extension.mainClass.convention(DEFAULT_MAIN_CLASS) + extension.mode.convention(DEFAULT_MODE) + extension.additionalOptions.convention(emptyList()) + extension.reportDir.convention(project.layout.buildDirectory.dir("reports/jardiff")) + extension.ignoreHashCheck.convention(false) + + // Use a detached configuration (created here, resolved only when the task runs) + // + // This keeps the jardiff artifact out of `lockAllConfigurations()` dependency locking. + // The dependency is added lazily, so overriding `jardiff.toolCoordinate` still takes effect. + // The `@jar` requests the artifact only, because jardiff ships a self-contained "fat" CLI jar + // under a non-default Gradle Module Metadata variant, the default resolution misses it. + // Appending `@jar` ignores metadata and fetches that jar. + val toolClasspath = project.configurations.detachedConfiguration().apply { + dependencies.addLater( + extension.toolCoordinate.map { coordinate -> + val artifactOnly = if ('@' in coordinate) coordinate else "$coordinate@jar" + project.dependencies.create(artifactOnly) + }, + ) + } + + val projectDirectory = project.layout.projectDirectory + val referenceDirProperty = + project.providers.gradleProperty("jardiffReferenceDir").filter { it.isNotBlank() } + + val compare = project.tasks.register(COMPARE_TASK_NAME) { + group = "verification" + description = "Compares the built jar against a reference jar (typically the CI `build` " + + "job artifact) using jardiff, failing if they differ. Set the reference with " + + "--reference-jar= or -PjardiffReferenceDir=

." + jardiffClasspath.convention(toolClasspath) + mainClass.convention(extension.mainClass) + mode.convention(extension.mode) + additionalOptions.convention(extension.additionalOptions) + reportDir.convention(extension.reportDir) + ignoreHashCheck.convention(extension.ignoreHashCheck) + // Ignore **/*.version by default, except under CI where the build and deploy + // jobs share the same commit. + ignoreVersionFiles.convention( + project.providers.environmentVariable("CI").map { false }.orElse(true), + ) + referenceJar.convention( + // Use the same name as the candidate jar + referenceDirProperty.flatMap { dir -> + candidateJar.map { candidate -> projectDirectory.dir(dir).file(candidate.asFile.name) } + }, + ) + } + + // candidateJar = the module's main publishable archive + project.pluginManager.withPlugin("java") { + compare.configure { + candidateJar.convention( + project.tasks.named("jar").flatMap { it.archiveFile }, + ) + } + } + project.pluginManager.withPlugin("com.gradleup.shadow") { + compare.configure { + candidateJar.set( + project.tasks.named("shadowJar").flatMap { it.archiveFile }, + ) + } + } + } + + companion object { + const val DEFAULT_TOOL_COORDINATE = "io.github.bric3.jardiff:jardiff-cli:0.2.0" + + const val DEFAULT_MAIN_CLASS = "io.github.bric3.jardiff.app.Main" + + const val DEFAULT_MODE = "--stat" + + const val COMPARE_TASK_NAME = "compareToReferenceJar" + } +} diff --git a/buildSrc/src/main/kotlin/datadog/gradle/plugin/jardiff/JardiffTask.kt b/buildSrc/src/main/kotlin/datadog/gradle/plugin/jardiff/JardiffTask.kt new file mode 100644 index 00000000000..bf81ba2da93 --- /dev/null +++ b/buildSrc/src/main/kotlin/datadog/gradle/plugin/jardiff/JardiffTask.kt @@ -0,0 +1,324 @@ +package datadog.gradle.plugin.jardiff + +import java.io.ByteArrayOutputStream +import java.io.File +import java.security.MessageDigest +import javax.inject.Inject +import org.gradle.api.DefaultTask +import org.gradle.api.GradleException +import org.gradle.api.file.ConfigurableFileCollection +import org.gradle.api.file.DirectoryProperty +import org.gradle.api.file.RegularFileProperty +import org.gradle.api.provider.ListProperty +import org.gradle.api.provider.Property +import org.gradle.api.tasks.Classpath +import org.gradle.api.tasks.Input +import org.gradle.api.tasks.InputFile +import org.gradle.api.tasks.Internal +import org.gradle.api.tasks.Optional +import org.gradle.api.tasks.OutputDirectory +import org.gradle.api.tasks.PathSensitive +import org.gradle.api.tasks.PathSensitivity +import org.gradle.api.tasks.TaskAction +import org.gradle.api.tasks.options.Option +import org.gradle.process.ExecOperations + +/** + * Compares a candidate jar against a reference jar using the + * [jardiff](https://github.com/bric3/jardiff) CLI and fails the build if they differ. + * + * The same task class supports two plugin-configured modes: + * - `compareToReferenceJar` wires [candidateJar] to the project's archive output, so Gradle builds + * that archive before comparing it. + * - `compareJarFiles` leaves [candidateJar] unset and expects `--candidate-jar=`, so it can + * compare an already-produced artifact without depending on `jar` or `shadowJar`. + * + * The reference jar is resolved, in order of precedence, from: + * 1. the `--reference-jar=` command-line option, then + * 2. the [referenceJar] property (wired by the `dd-trace-java.jardiff` plugin from the + * `-PjardiffReferenceDir` project property by matching the built jar's file name in that + * directory). + */ +abstract class JardiffTask @Inject constructor( + private val execOperations: ExecOperations, +) : DefaultTask() { + + /** + * The project archive to validate. Optional so the same task class can also compare explicit + * file paths without depending on the archive-producing task. + */ + @get:InputFile + @get:Optional + @get:PathSensitive(PathSensitivity.NONE) + abstract val candidateJar: RegularFileProperty + + /** + * Command-line override for the candidate jar path; takes precedence over [candidateJar]. + * A relative path is resolved against the current working directory (the Gradle invocation + * directory), matching how CLI users expect paths to behave. + */ + @get:Input + @get:Optional + @get:Option( + option = "candidate-jar", + description = "Path to the candidate jar to compare against the reference jar.", + ) + abstract val candidateJarPath: Property + + /** + * The reference jar to compare against. Optional; usually wired from `-PjardiffReferenceDir`. + * Kept [Internal] (the task always re-runs, see the `upToDateWhen { false }` below) so a missing + * reference produces a clear error message rather than a generic input-validation failure. + */ + @get:Internal + abstract val referenceJar: RegularFileProperty + + /** + * Command-line override for the reference jar path; takes precedence over [referenceJar]. + * A relative path is resolved against the current working directory (the Gradle invocation + * directory), matching how CLI users expect paths to behave. + */ + @get:Input + @get:Optional + @get:Option( + option = "reference-jar", + description = "Path to the reference jar to compare the candidate jar against.", + ) + abstract val referenceJarPath: Property + + /** Runtime classpath hosting the jardiff CLI ([mainClass]). */ + @get:Classpath + abstract val jardiffClasspath: ConfigurableFileCollection + + /** Glob patterns of entries to include in the comparison; empty means compare everything. */ + @get:Input + abstract val includes: ListProperty + + /** Glob patterns of entries to exclude from the comparison. */ + @get:Input + abstract val excludes: ListProperty + + /** + * jardiff output mode flag (e.g. `--stat`, `--status`); blank selects the default full diff. + * Defaulted by the plugin; overridable on the command line. + */ + @get:Input + @get:Option( + option = "mode", + description = "jardiff output mode flag, e.g. --mode=--status (blank selects the default full " + + "diff). Overrides the jardiff extension.", + ) + abstract val mode: Property + + /** + * Extra jardiff options passed verbatim, right before the two jars (e.g. `--ignore-member-order`). + * Defaulted by the plugin; overridable on the command line (repeatable). + */ + @get:Input + @get:Option( + option = "jardiff-option", + description = "Additional jardiff option passed verbatim; repeatable, e.g. " + + "--jardiff-option=--ignore-member-order. Overrides the jardiff extension.", + ) + abstract val additionalOptions: ListProperty + + /** + * When true, tolerate mismatching candidate and reference jar hashes if jardiff reports no + * differences. Matching hashes still skip the more expensive jardiff process. + */ + @get:Input + @get:Option( + option = "ignore-hash-check", + description = "Do not fail when jar hashes differ but jardiff detects no differences.", + ) + abstract val ignoreHashCheck: Property + + /** + * When true, the `.version` files entries are excluded from the comparison. + * This is useful in particular as those files can be part of runtimeClasspath normalization + * which ignores them too. `false` under CI, and true otherwise; overridable on the command line. + */ + @get:Input + @get:Option( + option = "ignore-version-files", + description = "Exclude **/*.version entries (volatile git-hash stamps) from the comparison.", + ) + abstract val ignoreVersionFiles: Property + + /** Fully qualified main class of the jardiff CLI (defaulted by the plugin). Overridable for testing. */ + @get:Input + abstract val mainClass: Property + + /** Directory receiving captured jardiff reports. */ + @get:OutputDirectory + abstract val reportDir: DirectoryProperty + + /** Optional exact destination for the captured jardiff report. Prefer [reportDir]. */ + @get:Internal + abstract val reportFile: RegularFileProperty + + init { + includes.convention(emptyList()) + excludes.convention(emptyList()) + reportDir.convention(project.layout.buildDirectory.dir("reports/jardiff")) + ignoreHashCheck.convention(false) + // These comparisons are explicit verification gates and must never be skipped as up-to-date. + outputs.upToDateWhen { false } + } + + @TaskAction + fun compare() { + val reference = resolveReferenceJar() + val candidate = resolveCandidateJar() + val reportDestination = reportDestination(candidate) + val hashesMatch = sameHash(reference, candidate) + + if (hashesMatch) { + val message = "SHA-256 hashes match for ${candidate.name} and ${reference.name}." + writeReport(reportDestination, "$message\n") + logger.info("Skipping jardiff for ${candidate.name} because SHA-256 hashes match.") + return + } + + val effectiveExcludes = buildList { + addAll(excludes.get()) + if (ignoreVersionFiles.get()) { + add("**/*.version") + } + } + val arguments = JardiffComparison.buildArguments( + reference = reference, + candidate = candidate, + mode = mode.get(), + includes = includes.get(), + excludes = effectiveExcludes, + additionalOptions = additionalOptions.get(), + ) + + val toolClasspath = jardiffClasspath + val mainClassName = mainClass.get() + logger.info( + "jardiff command: {}", + JardiffComparison.shellCommandLine(toolClasspath.files, mainClassName, arguments), + ) + val captured = ByteArrayOutputStream() + val execResult = execOperations.javaexec { + classpath = toolClasspath + mainClass.set(mainClassName) + args(arguments) + standardOutput = captured + errorOutput = captured + isIgnoreExitValue = true + } + + val report = captured.toString("UTF-8") + writeReport(reportDestination, report) + + when (JardiffComparison.outcomeOf(execResult.exitValue)) { + JardiffComparison.Outcome.IDENTICAL -> { + if (!hashesMatch) { + val message = + "SHA-256 hashes differ for ${candidate.name} (candidate) and ${reference.name} (reference), " + + "but jardiff detected no differences." + logger.warn(message) + if (!ignoreHashCheck.get()) { + throw GradleException( + buildString { + appendLine(message) + appendLine() + appendLine(" candidate : ${candidate.absolutePath}") + appendLine(" reference : ${reference.absolutePath}") + appendLine(" report : ${reportDestination.absolutePath}") + }, + ) + } + } + logger.lifecycle( + "Jardiff comparison passed for ${candidate.name} (candidate) against ${reference.name} (reference).", + ) + } + + JardiffComparison.Outcome.DIFFERENT -> + throw GradleException( + buildString { + appendLine("Candidate jar differs from the reference jar.") + appendLine("TODO: inspect gradle build scripts") + appendLine() + appendLine(" candidate : ${candidate.absolutePath}") + appendLine(" reference : ${reference.absolutePath}") + appendLine(" report : ${reportDestination.absolutePath}") + appendLine() + appendLine("jardiff report:") + append(report.ifBlank { "(no output captured)" }) + }, + ) + + JardiffComparison.Outcome.ERROR -> + throw GradleException( + "jardiff failed with exit code ${execResult.exitValue} while comparing " + + "${candidate.name} (candidate) against ${reference.name} (reference)." + + "Output:\n" + + report.ifBlank { "(no output captured)" }, + ) + } + } + + private fun resolveReferenceJar(): File = + referenceJarPath.orNull?.takeIf { it.isNotBlank() }?.let(::File)?.let { + requireExistingJar(it, "Reference jar") + } ?: when { + referenceJar.isPresent -> requireExistingJar(referenceJar.get().asFile, "Reference jar") + else -> throw GradleException( + "No reference jar configured to compare the candidate jar against.\n" + + "Provide one via --reference-jar= or -PjardiffReferenceDir= (the directory " + + "holding the `build` job artifacts), or disable this task for modules with no reference.", + ) + } + + private fun resolveCandidateJar(): File = + candidateJarPath.orNull?.takeIf { it.isNotBlank() }?.let(::File)?.let { + requireExistingJar(it, "Candidate jar") + } ?: when { + candidateJar.isPresent -> requireExistingJar(candidateJar.get().asFile, "Candidate jar") + else -> throw GradleException( + "No candidate jar configured to compare against the reference jar.\n" + + "Pass an existing jar via --candidate-jar= or configure the task's candidateJar.", + ) + } + + private fun requireExistingJar(jar: File, role: String): File { + if (!jar.isFile) { + throw GradleException("$role does not exist: ${jar.absolutePath}") + } + return jar + } + + private fun reportDestination(candidate: File): File = + when { + reportFile.isPresent -> reportFile.get().asFile + else -> reportDir.file("${candidate.name}.txt").get().asFile + } + + private fun sameHash(left: File, right: File): Boolean = + left.length() == right.length() && sha256(left).contentEquals(sha256(right)) + + private fun sha256(file: File): ByteArray { + val digest = MessageDigest.getInstance("SHA-256") + file.inputStream().use { input -> + val buffer = ByteArray(DEFAULT_BUFFER_SIZE) + while (true) { + val read = input.read(buffer) + if (read < 0) { + break + } + digest.update(buffer, 0, read) + } + } + return digest.digest() + } + + private fun writeReport(reportDestination: File, report: String) { + reportDestination.parentFile?.mkdirs() + reportDestination.writeText(report) + } +} diff --git a/buildSrc/src/main/kotlin/datadog/gradle/plugin/muzzle/MuzzleMavenRepoUtils.kt b/buildSrc/src/main/kotlin/datadog/gradle/plugin/muzzle/MuzzleMavenRepoUtils.kt index 998e0357b18..b4f672b4d25 100644 --- a/buildSrc/src/main/kotlin/datadog/gradle/plugin/muzzle/MuzzleMavenRepoUtils.kt +++ b/buildSrc/src/main/kotlin/datadog/gradle/plugin/muzzle/MuzzleMavenRepoUtils.kt @@ -9,6 +9,7 @@ import org.eclipse.aether.connector.basic.BasicRepositoryConnectorFactory import org.eclipse.aether.repository.LocalRepository import org.eclipse.aether.repository.RemoteRepository import org.eclipse.aether.resolution.VersionRangeRequest +import org.eclipse.aether.resolution.VersionRangeResolutionException import org.eclipse.aether.resolution.VersionRangeResult import org.eclipse.aether.spi.connector.RepositoryConnectorFactory import org.eclipse.aether.spi.connector.transport.TransporterFactory @@ -16,17 +17,24 @@ import org.eclipse.aether.transport.file.FileTransporterFactory import org.eclipse.aether.transport.http.HttpTransporterFactory import org.eclipse.aether.version.Version import org.gradle.api.GradleException +import org.gradle.api.logging.Logging import java.nio.file.Files internal object MuzzleMavenRepoUtils { + private val log = Logging.getLogger(MuzzleMavenRepoUtils::class.java) + private val backoffDelaysSeconds = listOf(5L, 10L, 30L) + /** - * Remote repositories used to query version ranges and fetch dependencies + * Remote repositories used to query version ranges and fetch dependencies. + * + * This intentionally reads the environment on each access: Gradle daemons can + * be reused across builds with different MAVEN_REPOSITORY_PROXY values. */ @JvmStatic - val MUZZLE_REPOS: List by lazy { + fun defaultMuzzleRepos(): List { val central = RemoteRepository.Builder("central", "default", "https://repo1.maven.org/maven2/").build() val mavenProxyUrl = System.getenv("MAVEN_REPOSITORY_PROXY") - if (mavenProxyUrl == null) { + return if (mavenProxyUrl == null) { listOf(central) } else { val proxy = RemoteRepository.Builder("central-proxy", "default", mavenProxyUrl).build() @@ -70,7 +78,7 @@ internal object MuzzleMavenRepoUtils { muzzleDirective: MuzzleDirective, system: RepositorySystem, session: RepositorySystemSession, - defaultRepos: List = MUZZLE_REPOS + defaultRepos: List = defaultMuzzleRepos() ): Set { val allVersionsArtifact = DefaultArtifact( muzzleDirective.group, @@ -119,12 +127,15 @@ internal object MuzzleMavenRepoUtils { /** * Resolves the version range for a given MuzzleDirective using the provided RepositorySystem and RepositorySystemSession. * Equivalent to the Groovy implementation in MuzzlePlugin. + * + * @param enableBackoffRetries if true, waits 5s, 10s, and 30s after the first three immediate retries */ fun resolveVersionRange( muzzleDirective: MuzzleDirective, system: RepositorySystem, session: RepositorySystemSession, - defaultRepos: List = MUZZLE_REPOS + defaultRepos: List = defaultMuzzleRepos(), + enableBackoffRetries: Boolean = true ): VersionRangeResult { val directiveArtifact: Artifact = DefaultArtifact( muzzleDirective.group, @@ -139,16 +150,56 @@ internal object MuzzleMavenRepoUtils { } // In rare cases, the version resolution range silently failed with the maven proxy, - // retries 3 times at most then suggest to restart the job later. - var range = system.resolveVersionRange(session, rangeRequest) - for (i in 0..3) { - if (range.lowestVersion != null && range.highestVersion != null) { + // retries 3 times immediately, then backs off before suggesting to restart the job later. + var attemptCount = 0 + var range: VersionRangeResult? = null + var failure: VersionRangeResolutionException? = null + fun attemptResolve(): VersionRangeResult? { + attemptCount++ + return try { + range = system.resolveVersionRange(session, rangeRequest) + failure = null + range?.takeIf { it.hasBounds() } + } catch (e: VersionRangeResolutionException) { + failure = e + range = e.result ?: range + null + } + } + + repeat(4) { + attemptResolve()?.let { range -> return range } - range = system.resolveVersionRange(session, rangeRequest) } - throw IllegalStateException("The version range resolution failed during report, this is not expected. Advised course of action: Restart the job later.") + var waitedSeconds = 0L + if (enableBackoffRetries) { + for (delaySeconds in backoffDelaysSeconds) { + sleepBeforeBackoffRetry(delaySeconds, directiveArtifact) + waitedSeconds += delaySeconds + attemptResolve()?.let { resolvedRange -> + log.warn( + "Muzzle version range resolution for ${artifactCoordinates(directiveArtifact)} " + + "succeeded after waiting ${waitedSeconds}s across $attemptCount attempts" + ) + return resolvedRange + } + } + } + + throw IllegalStateException( + versionRangeFailureMessage( + directiveArtifact, + rangeRequest.repositories, + range, + failure, + attemptCount, + waitedSeconds, + enableBackoffRetries + ), + failure + ) } /** @@ -202,6 +253,76 @@ internal object MuzzleMavenRepoUtils { */ fun lowest(a: Version, b: Version): Version = if (a < b) a else b + private fun VersionRangeResult.hasBounds(): Boolean = + lowestVersion != null && highestVersion != null + + private fun sleepBeforeBackoffRetry(delaySeconds: Long, artifact: Artifact) { + try { + Thread.sleep(delaySeconds * 1000L) + } catch (e: InterruptedException) { + Thread.currentThread().interrupt() + throw IllegalStateException( + "Interrupted while waiting ${delaySeconds}s before retrying version range resolution for " + + artifactCoordinates(artifact), + e + ) + } + } + + private fun versionRangeFailureMessage( + artifact: Artifact, + repositories: List, + range: VersionRangeResult?, + failure: VersionRangeResolutionException?, + attemptCount: Int, + waitedSeconds: Long, + enableBackoffRetries: Boolean + ): String { + val backoffDetails = + if (enableBackoffRetries) { + "enabled; waited ${waitedSeconds}s using delays ${backoffDelaysSeconds.joinToString(", ") { "${it}s" }}" + } else { + "disabled" + } + return buildString { + appendLine("Muzzle version range resolution failed.") + appendLine("Artifact:") + appendLine(" ${artifactCoordinates(artifact)}") + appendLine("Repositories:") + repositories.forEach { appendLine(" - ${it.id}: ${it.url}") } + appendLine("Attempts:") + appendLine(" $attemptCount") + appendLine("Backoff:") + appendLine(" $backoffDetails") + appendLine("Last resolution result:") + if (range == null) { + appendLine(" ") + } else { + appendLine(" lowestVersion=${range.lowestVersion ?: ""}") + appendLine(" highestVersion=${range.highestVersion ?: ""}") + appendLine(" versionCount=${range.versions.size}") + } + if (failure != null) { + appendLine("Last resolution failure:") + appendLine(" ${failure.javaClass.name}: ${failure.message ?: ""}") + } + appendLine() + appendLine("Maven metadata resolution may have returned an incomplete range, especially through a proxy.") + appendLine("Restart the job later if the repositories above are reachable.") + }.trimEnd() + } + + private fun artifactCoordinates(artifact: Artifact): String { + val classifier = artifact.classifier?.takeUnless { it.isEmpty() } + return listOfNotNull( + artifact.groupId, + artifact.artifactId, + classifier, + artifact.extension, + artifact.version + ).joinToString(":") + } + /** * Convert a muzzle directive to a set of artifacts for all filtered versions. * Throws GradleException if no artifacts are found. diff --git a/buildSrc/src/main/kotlin/datadog/gradle/plugin/muzzle/tasks/MuzzleTask.kt b/buildSrc/src/main/kotlin/datadog/gradle/plugin/muzzle/tasks/MuzzleTask.kt index 2d5d830ea3b..b338e096456 100644 --- a/buildSrc/src/main/kotlin/datadog/gradle/plugin/muzzle/tasks/MuzzleTask.kt +++ b/buildSrc/src/main/kotlin/datadog/gradle/plugin/muzzle/tasks/MuzzleTask.kt @@ -1,11 +1,13 @@ package datadog.gradle.plugin.muzzle.tasks +import datadog.gradle.plugin.HostPlatform import datadog.gradle.plugin.muzzle.MuzzleAction import datadog.gradle.plugin.muzzle.MuzzleDirective import datadog.gradle.plugin.muzzle.MuzzleExtension import datadog.gradle.plugin.muzzle.allMainSourceSet import org.gradle.api.Project import org.gradle.api.artifacts.Configuration +import org.gradle.api.file.ConfigurableFileCollection import org.gradle.api.file.FileCollection import org.gradle.api.file.RegularFileProperty import org.gradle.api.invocation.BuildInvocationDetails @@ -58,6 +60,10 @@ abstract class MuzzleTask @Inject constructor( @get:Classpath protected val agentClassPath = providers.provider { createAgentClassPath(project) } + @get:InputFiles + @get:Classpath + abstract val extraAgentClasspath: ConfigurableFileCollection + @get:InputFiles @get:Classpath protected val muzzleClassPath = providers.provider { createMuzzleClassPath(project, name) } @@ -102,6 +108,10 @@ abstract class MuzzleTask @Inject constructor( if(javaLauncher.metadata.languageVersion > JavaLanguageVersion.of(9)) { jvmArgs("--add-opens=java.base/java.lang=ALL-UNNAMED") } + if (HostPlatform.isLinuxArm64()) { + // Disable CDS to avoid SIGSEGVs on Linux arm64. + jvmArgs("-Xshare:off") + } executable(javaLauncher.executablePath) } } @@ -114,7 +124,7 @@ abstract class MuzzleTask @Inject constructor( buildStartedTime.set(invocationDetails.buildStartedTime) bootstrapClassPath.setFrom(muzzleBootstrap) toolingClassPath.setFrom(muzzleTooling) - instrumentationClassPath.setFrom(agentClassPath.get()) + instrumentationClassPath.setFrom(agentClassPath.get(), extraAgentClasspath) testApplicationClassPath.setFrom(muzzleClassPath.get()) if (muzzleDirective != null) { assertPass.set(muzzleDirective.assertPass) diff --git a/buildSrc/src/main/kotlin/datadog/gradle/plugin/sca/ScaEnrichmentsPlugin.kt b/buildSrc/src/main/kotlin/datadog/gradle/plugin/sca/ScaEnrichmentsPlugin.kt new file mode 100644 index 00000000000..c0812cb895d --- /dev/null +++ b/buildSrc/src/main/kotlin/datadog/gradle/plugin/sca/ScaEnrichmentsPlugin.kt @@ -0,0 +1,126 @@ +package datadog.gradle.plugin.sca + +import datadog.gradle.sca.GhsaEnrichmentParser +import groovy.json.JsonOutput +import groovy.json.JsonSlurper +import java.net.HttpURLConnection +import java.net.URI +import org.gradle.api.GradleException +import org.gradle.api.Plugin +import org.gradle.api.Project + +/** + * Registers the [generateScaCvesJson] task that downloads GHSA symbol files from + * `sca-reachability-symbols` and generates `sca_cves.json` bundled in the appsec JAR. + * + * This is a **temporary** build-time approach. The symbol database will be delivered + * via Remote Config in a future iteration, at which point this plugin and the committed + * `sca_cves.json` file will be removed. + * + * Usage: `apply plugin: 'dd-trace-java.sca-enrichments'`. The task runs only when + * `-PrefreshSca` is passed or the output file is absent; CI uses the committed copy. + */ +@Suppress("unused") +class ScaEnrichmentsPlugin : Plugin { + + companion object { + private const val SCA_ENRICHMENTS_API_DEFAULT = + "https://api.github.com/repos/DataDog/sca-reachability-symbols/contents/jvm" + } + + override fun apply(project: Project) { + val outputFile = project.file("src/main/resources/sca_cves.json") + + val generateTask = + project.tasks.register("generateScaCvesJson") { + description = + "Downloads GHSA symbol files from sca-reachability-symbols and updates " + + "src/main/resources/sca_cves.json. Run with -PrefreshSca to force a refresh. " + + "Override the source URL with -PscaEnrichmentsUrl=. " + + "sca_cves.json is committed to the repo so CI does not need network access." + group = "build" + outputs.file(outputFile) + // upToDateWhen: when -PrefreshSca is set, always consider outputs stale (force re-run). + outputs.upToDateWhen { !project.hasProperty("refreshSca") } + // onlyIf: skip entirely when the file already exists and no refresh was requested, + // so that normal builds (no network, no -PrefreshSca) never touch GitHub. + onlyIf { project.hasProperty("refreshSca") || !outputFile.exists() } + + doLast { + val token = System.getenv("GITHUB_TOKEN") + val apiUrl = + project.findProperty("scaEnrichmentsUrl")?.toString() ?: SCA_ENRICHMENTS_API_DEFAULT + + logger.lifecycle("Fetching GHSA symbol index from $apiUrl ...") + @Suppress("UNCHECKED_CAST") + val fileList = githubFetch(apiUrl, token) as List> + val ghsaFiles = + fileList.filter { + it["name"]?.toString()?.endsWith(".json") == true && it["type"] == "file" + } + logger.lifecycle("Found ${ghsaFiles.size} symbol files") + + val entries = mutableListOf() + ghsaFiles.forEach { fileInfo -> + val rawContent = githubFetchRaw(fileInfo["download_url"]!!.toString(), token) + entries.addAll(GhsaEnrichmentParser.parse(rawContent)) + } + + outputFile.writeText(JsonOutput.toJson(mapOf("version" to 1, "entries" to entries))) + logger.lifecycle( + "sca_cves.json: ${entries.size} entries from ${ghsaFiles.size} GHSA files") + logger.lifecycle( + "Remember to commit src/main/resources/sca_cves.json after updating the symbols.") + } + } + + // Defer wiring until after the java plugin adds processResources. + project.pluginManager.withPlugin("java") { + project.tasks.named("processResources") { + dependsOn(generateTask) + doLast { + // Minify only sca_cves.json — not all JSON files in the module output. + project + .fileTree(mapOf("dir" to outputs.files.asPath, "includes" to listOf("**/sca_cves.json"))) + .forEach { f -> f.writeText(JsonOutput.toJson(JsonSlurper().parse(f))) } + } + } + } + } + + private fun githubConnect(url: String, token: String?): HttpURLConnection { + val connection = URI.create(url).toURL().openConnection() as HttpURLConnection + connection.setRequestProperty("Accept", "application/vnd.github+json") + connection.setRequestProperty("X-GitHub-Api-Version", "2022-11-28") + if (!token.isNullOrEmpty()) { + connection.setRequestProperty("Authorization", "Bearer $token") + } + connection.connectTimeout = 10_000 + connection.readTimeout = 30_000 + val code = connection.responseCode + if (code != 200) { + throw GradleException( + "GitHub API returned HTTP $code for $url.\n" + + "Unauthenticated rate limit is 60 req/hr. Set GITHUB_TOKEN to raise it.") + } + return connection + } + + private fun githubFetch(url: String, token: String?): Any { + val conn = githubConnect(url, token) + return try { + JsonSlurper().parse(conn.inputStream) + } finally { + conn.disconnect() + } + } + + private fun githubFetchRaw(url: String, token: String?): String { + val conn = githubConnect(url, token) + return try { + conn.inputStream.bufferedReader().readText() + } finally { + conn.disconnect() + } + } +} diff --git a/buildSrc/src/main/kotlin/datadog/gradle/plugin/testJvmConstraints/TestJvmConstraintsExtension.kt b/buildSrc/src/main/kotlin/datadog/gradle/plugin/testJvmConstraints/TestJvmConstraintsExtension.kt index 03b8c533d61..a5575eb77f2 100644 --- a/buildSrc/src/main/kotlin/datadog/gradle/plugin/testJvmConstraints/TestJvmConstraintsExtension.kt +++ b/buildSrc/src/main/kotlin/datadog/gradle/plugin/testJvmConstraints/TestJvmConstraintsExtension.kt @@ -37,6 +37,15 @@ interface TestJvmConstraintsExtension { */ val allowReflectiveAccessToJdk: Property + /** + * Require the JDK running the test (or the daemon JVM, when no `testJvm` is selected) to + * be `native-image` capable — i.e. a GraalVM-flavoured distribution that ships + * `lib/svm/bin/native-image`. Tasks running on JDKs that don't satisfy this requirement + * are skipped via `onlyIf`, matching the gating model used by [minJavaVersion] and + * [includeJdk]. Defaults to `false` (no native-image requirement). + */ + val nativeImageCapable: Property + companion object { const val TEST_JVM_CONSTRAINTS = "testJvmConstraints" } diff --git a/buildSrc/src/main/kotlin/datadog/gradle/plugin/testJvmConstraints/TestJvmConstraintsPlugin.kt b/buildSrc/src/main/kotlin/datadog/gradle/plugin/testJvmConstraints/TestJvmConstraintsPlugin.kt new file mode 100644 index 00000000000..02d1c0d0a9a --- /dev/null +++ b/buildSrc/src/main/kotlin/datadog/gradle/plugin/testJvmConstraints/TestJvmConstraintsPlugin.kt @@ -0,0 +1,165 @@ +package datadog.gradle.plugin.testJvmConstraints + +import datadog.gradle.plugin.HostPlatform +import datadog.gradle.plugin.testJvmConstraints.TestJvmConstraintsExtension.Companion.TEST_JVM_CONSTRAINTS +import org.gradle.api.JavaVersion +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.api.plugins.JavaPlugin +import org.gradle.api.provider.Provider +import org.gradle.api.tasks.testing.Test +import org.gradle.kotlin.dsl.* +import org.gradle.testing.jacoco.plugins.JacocoTaskExtension + +class TestJvmConstraintsPlugin : Plugin { + override fun apply(project: Project) { + project.pluginManager.apply(JavaPlugin::class.java) + + val projectExtension = project.extensions.create(TEST_JVM_CONSTRAINTS) + val testJvmSpec = TestJvmSpec(project) + + project.tasks.withType().configureEach { + if (extensions.findByName(TEST_JVM_CONSTRAINTS) != null) { + return@configureEach + } + + inputs.property("testJvm", testJvmSpec.testJvmProperty).optional(true) + + val taskExtension = project.objects.newInstance().also { + configureConventions(it, projectExtension) + } + + inputs.property("$TEST_JVM_CONSTRAINTS.allowReflectiveAccessToJdk", taskExtension.allowReflectiveAccessToJdk).optional(true) + inputs.property("$TEST_JVM_CONSTRAINTS.excludeJdk", taskExtension.excludeJdk) + inputs.property("$TEST_JVM_CONSTRAINTS.includeJdk", taskExtension.includeJdk) + inputs.property("$TEST_JVM_CONSTRAINTS.forceJdk", taskExtension.forceJdk) + inputs.property("$TEST_JVM_CONSTRAINTS.minJavaVersion", taskExtension.minJavaVersion).optional(true) + inputs.property("$TEST_JVM_CONSTRAINTS.maxJavaVersion", taskExtension.maxJavaVersion).optional(true) + inputs.property("$TEST_JVM_CONSTRAINTS.nativeImageCapable", taskExtension.nativeImageCapable).optional(true) + + extensions.add(TEST_JVM_CONSTRAINTS, taskExtension) + + configureTestJvm(testJvmSpec, taskExtension) + } + + // Jacoco plugin is not applied on every project + project.pluginManager.withPlugin("org.gradle.jacoco") { + project.tasks.withType().configureEach { + configureJacocoForAdditionalTestJvm( + testJvmSpec.javaTestLauncher.isPresent, + project.rootProject.providers.gradleProperty("checkCoverage").isPresent + ) + } + } + } + + /** + * Configure the jvm launcher of the test task and ensure the test task can be run with the + * test task launcher. + */ + private fun Test.configureTestJvm( + testJvmSpec: TestJvmSpec, + extension: TestJvmConstraintsExtension + ) { + if (testJvmSpec.javaTestLauncher.isPresent) { + javaLauncher.set(testJvmSpec.javaTestLauncher) + onlyIf("Test JDK is allowed or forced JDK") { + extension.isTestJvmAllowed(testJvmSpec) + } + onlyIf("Test JDK is native-image capable") { + extension.isNativeImageCapableTestJvm(testJvmSpec.javaTestLauncher.get()) + } + } else { + onlyIf("Current Daemon JVM within allowed version range") { + extension.isJavaVersionAllowed(JavaVersion.current()) + } + onlyIf("Current Daemon JVM is native-image capable") { + extension.isNativeImageCapableDaemon() + } + } + + // temporary workaround when using Java16+: some tests require reflective access to java.lang/java.util + conditionalJvmArgs( + JavaVersion.VERSION_16, + listOf( + "--add-opens=java.base/java.lang=ALL-UNNAMED", + "--add-opens=java.base/java.util=ALL-UNNAMED" + ), + extension.allowReflectiveAccessToJdk + ) + + // Fix for Linux arm64 ByteBuddy error: + // "Could not self-attach to current VM using external process" + if (HostPlatform.isLinuxArm64()) { + conditionalJvmArgs( + JavaVersion.VERSION_1_9, + listOf("-Djdk.attach.allowAttachSelf=true") + ) + } + } + + /** + * Provide arguments if condition is met. + */ + private fun Test.conditionalJvmArgs( + applyFromVersion: JavaVersion, + jvmArgsToApply: List, + additionalCondition: Provider = project.providers.provider { true } + ) { + jvmArgumentProviders.add( + ProvideJvmArgsOnJvmLauncherVersion( + this, + applyFromVersion, + jvmArgsToApply, + additionalCondition + ) + ) + } + + /** + * Configures the convention, this tells Gradle where to look for values. + * + * Currently, the extension is still configured to look at project's _extra_ properties. + */ + private fun Test.configureConventions( + taskExtension: TestJvmConstraintsExtension, + projectExtension: TestJvmConstraintsExtension + ) { + taskExtension.minJavaVersion.convention(projectExtension.minJavaVersion + .orElse(project.providers.provider { project.findProperty("${name}MinJavaVersionForTests") as? JavaVersion }) + .orElse(project.providers.provider { project.findProperty("minJavaVersion") as? JavaVersion }) + ) + taskExtension.maxJavaVersion.convention(projectExtension.maxJavaVersion + .orElse(project.providers.provider { project.findProperty("${name}MaxJavaVersionForTests") as? JavaVersion }) + .orElse(project.providers.provider { project.findProperty("maxJavaVersion") as? JavaVersion }) + ) + taskExtension.forceJdk.convention(projectExtension.forceJdk + .orElse(project.providers.provider { + @Suppress("UNCHECKED_CAST") + project.findProperty("forceJdk") as? List ?: emptyList() + }) + ) + taskExtension.excludeJdk.convention(projectExtension.excludeJdk + .orElse(project.providers.provider { + @Suppress("UNCHECKED_CAST") + project.findProperty("excludeJdk") as? List ?: emptyList() + }) + ) + taskExtension.allowReflectiveAccessToJdk.convention(projectExtension.allowReflectiveAccessToJdk + .orElse(project.providers.provider { project.findProperty("allowReflectiveAccessToJdk") as? Boolean }) + ) + taskExtension.nativeImageCapable.convention(projectExtension.nativeImageCapable) + } +} + +internal fun Test.configureJacocoForAdditionalTestJvm( + hasAdditionalTestJvmLauncher: Boolean, + checkCoverage: Boolean +) { + // Disable jacoco for additional 'testJvm' tests unless coverage was explicitly requested. + if (hasAdditionalTestJvmLauncher && !checkCoverage) { + extensions.configure { + isEnabled = false + } + } +} diff --git a/buildSrc/src/main/kotlin/datadog/gradle/plugin/testJvmConstraints/TestJvmConstraintsUtils.kt b/buildSrc/src/main/kotlin/datadog/gradle/plugin/testJvmConstraints/TestJvmConstraintsUtils.kt index a8c5ddf69f6..efdc3662f6d 100644 --- a/buildSrc/src/main/kotlin/datadog/gradle/plugin/testJvmConstraints/TestJvmConstraintsUtils.kt +++ b/buildSrc/src/main/kotlin/datadog/gradle/plugin/testJvmConstraints/TestJvmConstraintsUtils.kt @@ -2,6 +2,10 @@ package datadog.gradle.plugin.testJvmConstraints import org.gradle.api.JavaVersion import org.gradle.api.logging.Logging +import org.gradle.jvm.toolchain.JavaLauncher +import java.io.File +import java.nio.file.Files +import java.nio.file.Path private val logger = Logging.getLogger("TestJvmConstraintsUtils") @@ -28,6 +32,32 @@ internal fun TestJvmConstraintsExtension.isTestJvmAllowed(testJvmSpec: TestJvmSp return true } +/** + * When [TestJvmConstraintsExtension.nativeImageCapable] is `true`, verify the chosen test + * launcher ships the `native-image` tool. The actual binary lives under `lib/svm/bin/` on + * a GraalVM distribution; `bin/native-image` may be a symlink to it (or a `.cmd` shim on + * Windows), so probe all three. Returns `true` when the requirement is unset or satisfied, + * so the check is a safe no-op for tasks that haven't opted in. + */ +internal fun TestJvmConstraintsExtension.isNativeImageCapableTestJvm(launcher: JavaLauncher): Boolean { + if (!nativeImageCapable.getOrElse(false)) return true + return hasNativeImage(launcher.metadata.installationPath.asFile.toPath()) +} + +/** + * Daemon-side counterpart to [isNativeImageCapableTestJvm], used when no `testJvm` was + * selected — checks the running daemon's `java.home`. Same no-op semantics. + */ +internal fun TestJvmConstraintsExtension.isNativeImageCapableDaemon(): Boolean { + if (!nativeImageCapable.getOrElse(false)) return true + return hasNativeImage(File(System.getProperty("java.home")).toPath()) +} + +private fun hasNativeImage(installPath: Path): Boolean = + Files.exists(installPath.resolve("lib/svm/bin/native-image")) || + Files.exists(installPath.resolve("bin/native-image")) || + Files.exists(installPath.resolve("bin/native-image.cmd")) + private fun TestJvmConstraintsExtension.withinAllowedRange(currentJvmVersion: JavaVersion): Boolean { val definedMin = minJavaVersion.isPresent val definedMax = maxJavaVersion.isPresent diff --git a/buildSrc/src/main/kotlin/datadog/gradle/plugin/testJvmConstraints/TestJvmSpec.kt b/buildSrc/src/main/kotlin/datadog/gradle/plugin/testJvmConstraints/TestJvmSpec.kt index da9663f247a..b9dad16bd1a 100644 --- a/buildSrc/src/main/kotlin/datadog/gradle/plugin/testJvmConstraints/TestJvmSpec.kt +++ b/buildSrc/src/main/kotlin/datadog/gradle/plugin/testJvmConstraints/TestJvmSpec.kt @@ -14,6 +14,7 @@ import org.gradle.jvm.toolchain.JvmImplementation import org.gradle.jvm.toolchain.JvmVendorSpec import org.gradle.jvm.toolchain.internal.DefaultToolchainSpec import org.gradle.jvm.toolchain.internal.SpecificInstallationToolchainSpec +import org.gradle.kotlin.dsl.property import org.gradle.kotlin.dsl.support.serviceOf import java.nio.file.Files import java.nio.file.Path @@ -36,6 +37,16 @@ import java.nio.file.Paths class TestJvmSpec(val project: Project) { companion object { const val TEST_JVM = "testJvm" + + // JDK 27 TODO: remove after GA (tip will move to 27) + internal fun resolveTipJavaVersion(javaVersions: List): String { + val tipJavaVersions = javaVersions.filterNot { it == 27 } + if (tipJavaVersions.isEmpty()) { + throw GradleException("No Java installations found for tip after excluding Java 27.") + } + + return tipJavaVersions.max().toString() + } } private val currentJavaHomePath = project.providers.systemProperty("java.home").map { it.normalizeToJDKJavaHome() } @@ -62,7 +73,7 @@ class TestJvmSpec(val project: Project) { throw GradleException("No Java installations found via toolchains or JAVA_X_HOME environment variables.") } - javaVersions.max().toString() + resolveTipJavaVersion(javaVersions) // JDK 27 TODO: revert back to "javaVersions.max().toString()" after GA } else -> testJvm @@ -151,7 +162,7 @@ class TestJvmSpec(val project: Project) { project.providers.zip(testJvmSpec, normalizedTestJvm) { jvmSpec, testJvm -> // Only change test JVM if it's not the one we are running the gradle build with if ((jvmSpec as? SpecificInstallationToolchainSpec)?.javaHome == currentJavaHomePath.get()) { - project.providers.provider { null } + project.objects.property() } else { // The provider always says that a value is present so we need to wrap it for proper error messages project.javaToolchains.launcherFor(jvmSpec).orElse(project.providers.provider { diff --git a/buildSrc/src/main/kotlin/datadog/gradle/plugin/version/TracerVersionPlugin.kt b/buildSrc/src/main/kotlin/datadog/gradle/plugin/version/TracerVersionPlugin.kt index 1250e96d907..4cd8669c389 100644 --- a/buildSrc/src/main/kotlin/datadog/gradle/plugin/version/TracerVersionPlugin.kt +++ b/buildSrc/src/main/kotlin/datadog/gradle/plugin/version/TracerVersionPlugin.kt @@ -32,9 +32,9 @@ class TracerVersionPlugin @Inject constructor( providerFactory.gradleProperty("tracerVersion.qualifier") ) - val versionProvider = versionProvider(targetProject, extension) + val theVersion = versionProvider(targetProject, extension) targetProject.allprojects { - version = versionProvider + version = theVersion } } @@ -48,9 +48,18 @@ class TracerVersionPlugin @Inject constructor( // Not a git repository extension.defaultVersion.get() } else { + val currentBranchProvider = gitCurrentBranchProvider(repoWorkingDirectory) providerFactory.zip( - gitDescribeProvider(extension, repoWorkingDirectory), - gitCurrentBranchProvider(repoWorkingDirectory) + currentBranchProvider.flatMap { currentBranch -> + // Use --first-parent only on release branches so they stay anchored to their own + // version line; feature branches pick up newer tags merged in from main. + gitDescribeProvider( + extension, + repoWorkingDirectory, + firstParent = currentBranch.startsWith("release/v") + ) + }, + currentBranchProvider ) { describeString, currentBranch -> toTracerVersion(describeString, extension) { when { @@ -87,7 +96,8 @@ class TracerVersionPlugin @Inject constructor( private fun gitDescribeProvider( extension: TracerVersionExtension, - repoWorkingDirectory: File + repoWorkingDirectory: File, + firstParent: Boolean, ) = providerFactory.of(GitCommandValueSource::class.java) { parameters { val tagPrefix = extension.tagVersionPrefix.get() @@ -96,10 +106,13 @@ class TracerVersionPlugin @Inject constructor( "describe", "--abbrev=8", "--tags", - "--first-parent", "--match=$tagPrefix[0-9].[0-9]*.[0-9]*", ) + if (firstParent) { + gitCommand.add("--first-parent") + } + if (extension.detectDirty.get()) { gitCommand.add("--dirty") } diff --git a/buildSrc/src/main/kotlin/datadog/gradle/plugin/version/WriteVersionFile.kt b/buildSrc/src/main/kotlin/datadog/gradle/plugin/version/WriteVersionFile.kt new file mode 100644 index 00000000000..5f50f4b5ed0 --- /dev/null +++ b/buildSrc/src/main/kotlin/datadog/gradle/plugin/version/WriteVersionFile.kt @@ -0,0 +1,57 @@ +package datadog.gradle.plugin.version + +import org.checkerframework.checker.units.qual.g +import org.gradle.api.DefaultTask +import org.gradle.api.file.DirectoryProperty +import org.gradle.api.file.ProjectLayout +import org.gradle.api.model.ObjectFactory +import org.gradle.api.provider.Property +import org.gradle.api.provider.ProviderFactory +import org.gradle.api.tasks.Input +import org.gradle.api.tasks.Internal +import org.gradle.api.tasks.Optional +import org.gradle.api.tasks.OutputDirectory +import org.gradle.api.tasks.TaskAction +import org.gradle.kotlin.dsl.property +import javax.inject.Inject + +abstract class WriteVersionFile @Inject constructor( + providerFactory: ProviderFactory, + layout: ProjectLayout, + objects: ObjectFactory, +) : DefaultTask() { + + @get:Input + val version: Property = objects.property() + .convention(providerFactory.provider { project.version.toString() }) + + @get:Input + val gitHash: Property = objects.property() + .convention( + providerFactory.of(GitCommandValueSource::class.java) { + parameters { + gitCommand.addAll("git", "rev-parse", "HEAD") + workingDirectory.set(layout.projectDirectory) + } + } + ) + + @get:Input + val gitHashTruncation: Property = objects.property() + .convention(10) + + @get:Input + val projectName: Property = objects.property() + .convention(project.name) + + @get:OutputDirectory + val outputDirectory: DirectoryProperty = objects.directoryProperty() + .convention(layout.buildDirectory.dir("generated/version")) + + @TaskAction + fun writeVersionFile() { + val versionFile = outputDirectory.file("${projectName.get()}.version").get().asFile + versionFile.parentFile.mkdirs() + versionFile.writeText("${version.get()}~${gitHash.get().take(gitHashTruncation.get())}") + } +} diff --git a/buildSrc/src/main/kotlin/datadog/gradle/plugin/version/WriteVersionFilePlugin.kt b/buildSrc/src/main/kotlin/datadog/gradle/plugin/version/WriteVersionFilePlugin.kt new file mode 100644 index 00000000000..84b7b9a3ade --- /dev/null +++ b/buildSrc/src/main/kotlin/datadog/gradle/plugin/version/WriteVersionFilePlugin.kt @@ -0,0 +1,19 @@ +package datadog.gradle.plugin.version + +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.api.plugins.JavaPluginExtension +import org.gradle.kotlin.dsl.register +import org.gradle.kotlin.dsl.the + +class WriteVersionFilePlugin : Plugin { + override fun apply(target: Project) { + target.pluginManager.apply("java") + + val writeVersionFile = target.tasks.register("writeVersionNumberFile") + + target.the().sourceSets.named("main") { + resources.srcDir(writeVersionFile) + } + } +} diff --git a/buildSrc/src/main/kotlin/datadog/gradle/sca/GhsaEnrichmentParser.kt b/buildSrc/src/main/kotlin/datadog/gradle/sca/GhsaEnrichmentParser.kt new file mode 100644 index 00000000000..1af8f891d74 --- /dev/null +++ b/buildSrc/src/main/kotlin/datadog/gradle/sca/GhsaEnrichmentParser.kt @@ -0,0 +1,95 @@ +package datadog.gradle.sca + +import com.fasterxml.jackson.databind.JsonNode +import com.fasterxml.jackson.databind.ObjectMapper + +/** + * Parses GHSA symbol JSON files from the sca-reachability-symbols repository into the internal + * sca_cves.json format consumed by SCA Reachability at runtime. + * + * Key transformations: + * - Filters entries to Maven ecosystem only (lang == "maven") + * - Each array entry maps 1:1 to one sca_cves.json record (one dependency_name per entry) + * - Parses target strings "package:ClassName.method" using lastIndexOf to split at the colon + * and lastIndexOf on the class+method part to split class from method + * - Converts class FQNs to JVM internal format (slashes) so the ClassFileTransformer + * can do O(1) map lookups without per-class string conversion at runtime + */ +object GhsaEnrichmentParser { + + private val mapper = ObjectMapper() + + /** + * Parses a single GHSA symbols file. + * + * @param jsonContent the raw JSON content of the symbols file + * @return list of sca_cves.json entry maps, one per affected Maven artifact + */ + fun parse(jsonContent: String): List> { + val root = mapper.readTree(jsonContent) + require(root.isArray) { "GHSA enrichment file must be a JSON array, got ${root.nodeType}" } + + val entries = mutableListOf>() + + for (entry in root) { + if (entry.path("lang").asText() != "maven") continue + + val ghsaId = + entry.path("vulnerability").path("id").asText().takeIf { it.isNotEmpty() } ?: continue + val artifact = entry.path("dependency_name").asText().takeIf { it.isNotEmpty() } ?: continue + val versionRanges = entry.path("package_versions").map { it.asText() } + + val symbols = extractTargets(entry) + if (symbols.isEmpty()) continue + + entries += + mapOf( + "vuln_id" to ghsaId, + "artifact" to artifact, + "version_ranges" to versionRanges, + "symbols" to symbols, + ) + } + + return entries + } + + /** + * Parses the targets array from a GHSA entry. + * + * Each target string has the format "package:ClassName.method". Parsing uses + * lastIndexOf(':') to split package from class+method, then lastIndexOf('.') on the + * class+method part to split class name from method name. Malformed targets (missing ':' + * or missing '.' after ':') are silently skipped. + * + * Targets within one entry may come from different packages; no assumption is made that + * all targets share a common package prefix. + * + * TODO(APPSEC-62260): if the database adds inner-class targets (e.g. "pkg:Outer.Inner.method"), + * the current replace('.', '/') will produce pkg/Outer/Inner instead of the correct + * pkg/Outer$Inner. Update when the database team defines the inner-class format. + */ + private fun extractTargets(entry: JsonNode): List> { + val symbols = mutableListOf>() + val targets = entry.path("targets") + if (targets.isMissingNode || !targets.isArray) return symbols + + for (target in targets) { + val t = target.asText().takeIf { it.isNotEmpty() } ?: continue + val colonIdx = t.lastIndexOf(':') + if (colonIdx < 0) continue + val pkg = t.substring(0, colonIdx) + val classAndMethod = t.substring(colonIdx + 1) + val dotIdx = classAndMethod.lastIndexOf('.') + if (dotIdx < 0) continue + val simpleClass = classAndMethod.substring(0, dotIdx) + val method = classAndMethod.substring(dotIdx + 1) + if (pkg.isEmpty() || simpleClass.isEmpty() || method.isEmpty()) continue + + val internalName = "$pkg.$simpleClass".replace('.', '/') + symbols += mapOf("class" to internalName, "method" to method) + } + + return symbols + } +} diff --git a/buildSrc/src/main/kotlin/dd-trace-java.configure-tests.gradle.kts b/buildSrc/src/main/kotlin/dd-trace-java.configure-tests.gradle.kts index ad1d0a2d6ab..04862485528 100644 --- a/buildSrc/src/main/kotlin/dd-trace-java.configure-tests.gradle.kts +++ b/buildSrc/src/main/kotlin/dd-trace-java.configure-tests.gradle.kts @@ -10,6 +10,10 @@ import org.gradle.testing.base.TestingExtension import java.time.Duration import java.time.temporal.ChronoUnit +plugins { + id("dd-trace-java.modifiable-config") +} + // Need concrete implementation of BuildService in Kotlin abstract class ForkedTestLimit : BuildService // Forked tests will fail with OOM if the memory is set too high. Gitlab allows at least a limit of 3. @@ -59,6 +63,17 @@ tasks.withType().configureEach { onlyIf("skipForkedTests are undefined or false") { !skipForkedTestsProvider.isPresent } } else { exclude("**/*ForkedTest*") + // Starting from Gradle 9.3, Gradle will fail if a test task has no discovered tests. + // While this can be a misconfiguration, dd-trace-java test suite conventions allow suites + // to contain abstract base classes that are extended by concrete forked test suites. + // + // Many instrumentation suites indeed only ship *ForkedTest concrete classes + // (the non-forked peer task created by `addTestSuiteExtendingForDir` exists only + // to host shared configurations/sources). Those test tasks won't have executable tests + // by design under the `**/*ForkedTest*` exclude rule above. So let's allow them. + // + // Related but not the issue here https://github.com/gradle/gradle/issues/36508 + failOnNoDiscoveredTests = false } // Set test timeout for 20 minutes. Default job timeout is 1h (configured on CI level). diff --git a/buildSrc/src/main/kotlin/dd-trace-java.gradle-debug.gradle.kts b/buildSrc/src/main/kotlin/dd-trace-java.gradle-debug.gradle.kts index 2e50d9ee687..86e8f463ff9 100644 --- a/buildSrc/src/main/kotlin/dd-trace-java.gradle-debug.gradle.kts +++ b/buildSrc/src/main/kotlin/dd-trace-java.gradle-debug.gradle.kts @@ -1,7 +1,27 @@ /* * Gradle debugging plugin for dd-trace-java builds. + * + * Logs the JDK used by each scheduled task to diagnose unexpected Java versions. + * + * Usage: + * ./gradlew -PddGradleDebug e.g. ./gradlew assemble -PddGradleDebug + * + * Only tasks in the execution graph of the requested command are reported, so run it + * against a real task (e.g. `build`, `:module:test`); `help` reports almost nothing. + * + * Output: build/datadog.gradle-debug.log (one JSON object per task), e.g. + * {"task":":dd-trace-api:compileJava", "jdk":"8"} + * {"task":":dd-trace-api:test", "jdk":"11"} + * + * "jdk":"unknown" means the task type carries no JVM (e.g. lifecycle/aggregate tasks like + * `classes` or `assemble`, copy/`Sync` tasks); only Java/Groovy/Scala compile, Test, JavaExec, + * Javadoc and Exec tasks report a version. */ +import org.gradle.api.Action +import org.gradle.api.Task +import org.gradle.api.execution.TaskExecutionGraph + val ddGradleDebugEnabled = project.hasProperty("ddGradleDebug") val logPath = rootProject.layout.buildDirectory.file("datadog.gradle-debug.log") @@ -38,10 +58,10 @@ fun getJdkFromCompilerOptions(co: CompileOptions): String? { return null } -fun printJdkForProjectTasks(project: Project, logFile: File) { - project.tasks.forEach { task -> +fun printJdkForTasks(tasks: Iterable, logFile: File) { + tasks.forEach { task -> val data = mutableMapOf() - data["task"] = task.path.toString() + data["task"] = task.path if (task is JavaExec) { val launcher = task.javaLauncher.get() data["jdk"] = launcher.metadata.languageVersion.toString() @@ -83,23 +103,12 @@ fun printJdkForProjectTasks(project: Project, logFile: File) { } } -class DebugBuildListener : org.gradle.BuildListener { - override fun settingsEvaluated(settings: Settings) = Unit - - override fun projectsLoaded(gradle: Gradle) = Unit - - override fun buildFinished(result: BuildResult) = Unit - - override fun projectsEvaluated(gradle: Gradle) { - val logFile = logPath.get().asFile - logFile.writeText("") - gradle.rootProject.allprojects.forEach { project -> - printJdkForProjectTasks(project, logFile) - } - } -} - if (ddGradleDebugEnabled) { logger.lifecycle("datadog.gradle-debug plugin is enabled") - gradle.addListener(DebugBuildListener()) + // Inspect tasks once the execution graph is ready, when scheduled tasks are fully configured. + gradle.taskGraph.whenReady(Action { + val logFile = logPath.get().asFile + logFile.writeText("") + printJdkForTasks(allTasks, logFile) + }) } diff --git a/buildSrc/src/main/kotlin/dd-trace-java.instrumentation.testing-framework-tests.gradle.kts b/buildSrc/src/main/kotlin/dd-trace-java.instrumentation.testing-framework-tests.gradle.kts index 0f2af6fb44a..ab92a96baac 100644 --- a/buildSrc/src/main/kotlin/dd-trace-java.instrumentation.testing-framework-tests.gradle.kts +++ b/buildSrc/src/main/kotlin/dd-trace-java.instrumentation.testing-framework-tests.gradle.kts @@ -6,6 +6,7 @@ logger.info("Avoid executing classes used to test testing frameworks instrumenta tasks.withType().configureEach { exclude("**/TestAssumption*", "**/TestSuiteSetUpAssumption*") + exclude("**/TestContinueOnStepFailure*") exclude("**/TestDisableTestTrace*") exclude("**/TestError*") exclude("**/TestFactory*") diff --git a/buildSrc/src/main/kotlin/dd-trace-java.modifiable-config.gradle.kts b/buildSrc/src/main/kotlin/dd-trace-java.modifiable-config.gradle.kts new file mode 100644 index 00000000000..047b64d326d --- /dev/null +++ b/buildSrc/src/main/kotlin/dd-trace-java.modifiable-config.gradle.kts @@ -0,0 +1,42 @@ +import org.gradle.api.tasks.testing.Test +import org.gradle.kotlin.dsl.withType + +/** + * Attaches the modifiable-config Java agent to every Test task so that + * `datadog.trace.api.Config` and `datadog.trace.api.InstrumenterConfig` have + * their `INSTANCE` field rewritten as public/volatile/non-final at load time. + * + * This is the load-time counterpart to + * `datadog.trace.junit.utils.config.WithConfigExtension`, which uses ByteBuddy + * to retransform the same classes at runtime. Retransformation does not always + * succeed when the class has been touched before the JUnit lifecycle starts + * (e.g. through `CoreTracer`); the agent guarantees the rewrite by intercepting + * the class before it is defined. + * + * The agent jar is built by the `:modifiable-config-agent` buildSrc subproject + * and is produced eagerly because the parent `buildSrc` compilation depends on + * it. + */ +val agentJar = rootProject.layout.projectDirectory + .file("buildSrc/modifiable-config-agent/build/libs/modifiable-config-agent.jar") + .asFile + +tasks.withType().configureEach { + inputs.file(agentJar).withPathSensitivity(org.gradle.api.tasks.PathSensitivity.NONE) + // Attach lazily so we can skip when the Test JVM already has another -javaagent. + // doFirst prepends, so this runs after any -javaagent registered later via doFirst. + doFirst { + val foreignAgent = allJvmArgs.firstOrNull { + it.startsWith("-javaagent:") && !it.contains("modifiable-config-agent") + } + if (foreignAgent != null) { + logger.info( + "[modifiable-config] skipping attach for {} — another -javaagent already present: {}", + path, + foreignAgent, + ) + } else { + jvmArgs("-javaagent:${agentJar.absolutePath}") + } + } +} diff --git a/buildSrc/src/main/kotlin/dd-trace-java.test-jvm-constraints.gradle.kts b/buildSrc/src/main/kotlin/dd-trace-java.test-jvm-constraints.gradle.kts deleted file mode 100644 index aa4724183b0..00000000000 --- a/buildSrc/src/main/kotlin/dd-trace-java.test-jvm-constraints.gradle.kts +++ /dev/null @@ -1,128 +0,0 @@ -import datadog.gradle.plugin.testJvmConstraints.ProvideJvmArgsOnJvmLauncherVersion -import datadog.gradle.plugin.testJvmConstraints.TestJvmConstraintsExtension -import datadog.gradle.plugin.testJvmConstraints.TestJvmConstraintsExtension.Companion.TEST_JVM_CONSTRAINTS -import datadog.gradle.plugin.testJvmConstraints.TestJvmSpec -import datadog.gradle.plugin.testJvmConstraints.isJavaVersionAllowed -import datadog.gradle.plugin.testJvmConstraints.isTestJvmAllowed - -plugins { - java -} - -val projectExtension = extensions.create(TEST_JVM_CONSTRAINTS) - -val testJvmSpec = TestJvmSpec(project) - -tasks.withType().configureEach { - if (extensions.findByName(TEST_JVM_CONSTRAINTS) != null) { - return@configureEach - } - - inputs.property("testJvm", testJvmSpec.testJvmProperty).optional(true) - - val taskExtension = project.objects.newInstance().also { - configureConventions(it, projectExtension) - } - - inputs.property("$TEST_JVM_CONSTRAINTS.allowReflectiveAccessToJdk", taskExtension.allowReflectiveAccessToJdk).optional(true) - inputs.property("$TEST_JVM_CONSTRAINTS.excludeJdk", taskExtension.excludeJdk) - inputs.property("$TEST_JVM_CONSTRAINTS.includeJdk", taskExtension.includeJdk) - inputs.property("$TEST_JVM_CONSTRAINTS.forceJdk", taskExtension.forceJdk) - inputs.property("$TEST_JVM_CONSTRAINTS.minJavaVersion", taskExtension.minJavaVersion).optional(true) - inputs.property("$TEST_JVM_CONSTRAINTS.maxJavaVersion", taskExtension.maxJavaVersion).optional(true) - - extensions.add(TEST_JVM_CONSTRAINTS, taskExtension) - - configureTestJvm(taskExtension) -} - -/** - * Provide arguments if condition is met. - */ -fun Test.conditionalJvmArgs( - applyFromVersion: JavaVersion, - jvmArgsToApply: List, - additionalCondition: Provider = project.providers.provider { true } -) { - jvmArgumentProviders.add( - ProvideJvmArgsOnJvmLauncherVersion( - this, - applyFromVersion, - jvmArgsToApply, - additionalCondition - ) - ) -} - -/** - * Configure the jvm launcher of the test task and ensure the test task - * can be run with the test task launcher. - */ -private fun Test.configureTestJvm(extension: TestJvmConstraintsExtension) { - if (testJvmSpec.javaTestLauncher.isPresent) { - javaLauncher = testJvmSpec.javaTestLauncher - onlyIf("Allowed or forced JDK") { - extension.isTestJvmAllowed(testJvmSpec) - } - } else { - onlyIf("Is current Daemon JVM allowed") { - extension.isJavaVersionAllowed(JavaVersion.current()) - } - } - - // temporary workaround when using Java16+: some tests require reflective access to java.lang/java.util - conditionalJvmArgs( - JavaVersion.VERSION_16, - listOf( - "--add-opens=java.base/java.lang=ALL-UNNAMED", - "--add-opens=java.base/java.util=ALL-UNNAMED" - ), - extension.allowReflectiveAccessToJdk - ) -} - -// Jacoco plugin is not applied on every project -pluginManager.withPlugin("org.gradle.jacoco") { - tasks.withType().configureEach { - // Disable jacoco for additional 'testJvm' tests to speed things up a bit - if (testJvmSpec.javaTestLauncher.isPresent) { - extensions.configure { - isEnabled = false - } - } - } -} - -/** - * Configures the convention, this tells Gradle where to look for values. - * - * Currently, the extension is still configured to look at project's _extra_ properties. - */ -private fun Test.configureConventions( - taskExtension: TestJvmConstraintsExtension, - projectExtension: TestJvmConstraintsExtension -) { - taskExtension.minJavaVersion.convention(projectExtension.minJavaVersion - .orElse(providers.provider { project.findProperty("${name}MinJavaVersionForTests") as? JavaVersion }) - .orElse(providers.provider { project.findProperty("minJavaVersion") as? JavaVersion }) - ) - taskExtension.maxJavaVersion.convention(projectExtension.maxJavaVersion - .orElse(providers.provider { project.findProperty("${name}MaxJavaVersionForTests") as? JavaVersion }) - .orElse(providers.provider { project.findProperty("maxJavaVersion") as? JavaVersion }) - ) - taskExtension.forceJdk.convention(projectExtension.forceJdk - .orElse(providers.provider { - @Suppress("UNCHECKED_CAST") - project.findProperty("forceJdk") as? List ?: emptyList() - }) - ) - taskExtension.excludeJdk.convention(projectExtension.excludeJdk - .orElse(providers.provider { - @Suppress("UNCHECKED_CAST") - project.findProperty("excludeJdk") as? List ?: emptyList() - }) - ) - taskExtension.allowReflectiveAccessToJdk.convention(projectExtension.allowReflectiveAccessToJdk - .orElse(providers.provider { project.findProperty("allowReflectiveAccessToJdk") as? Boolean }) - ) -} diff --git a/buildSrc/src/test/kotlin/datadog/gradle/plugin/GradleFixture.kt b/buildSrc/src/test/kotlin/datadog/gradle/plugin/GradleFixture.kt index 5d6ca45b6fd..b89ee5937a9 100644 --- a/buildSrc/src/test/kotlin/datadog/gradle/plugin/GradleFixture.kt +++ b/buildSrc/src/test/kotlin/datadog/gradle/plugin/GradleFixture.kt @@ -1,9 +1,11 @@ package datadog.gradle.plugin +import datadog.gradle.plugin.GradleFixture.Companion.sharedTestKitDir import org.gradle.testkit.runner.BuildResult import org.gradle.testkit.runner.GradleRunner import org.gradle.testkit.runner.UnexpectedBuildResultException import org.intellij.lang.annotations.Language +import org.junit.jupiter.api.io.TempDir import org.w3c.dom.Document import java.io.File import java.nio.file.Files @@ -13,132 +15,207 @@ import javax.xml.parsers.DocumentBuilderFactory * Base fixture for Gradle plugin integration tests. * Provides common functionality for setting up test projects and running Gradle builds. */ -internal open class GradleFixture(protected val projectDir: File) { - // Each fixture gets its own testkit dir in the system temp directory (NOT under - // projectDir) so that JUnit's @TempDir cleanup doesn't race with daemon file locks. - // See https://github.com/gradle/gradle/issues/12535 - // A fresh daemon is started per test — ensuring withEnvironment() vars (e.g. - // MAVEN_REPOSITORY_PROXY) are correctly set on the daemon JVM and not inherited - // from a previously-started daemon with a different test's environment. - // A JVM shutdown hook removes the directory after all tests have run (and daemons - // have been stopped), so file locks are guaranteed to be released by then. - private val testKitDir: File by lazy { - Files.createTempDirectory("gradle-testkit-").toFile().also { dir -> - Runtime.getRuntime().addShutdownHook(Thread { dir.deleteRecursively() }) +open class GradleFixture { + @TempDir + protected lateinit var projectDir: File + + private val testKitDir: File get() = sharedTestKitDir + + companion object { + // JVM-wide testkit dir shared across all GradleFixture instances. One daemon + // pool serves every test method, so kotlinc work on .gradle.kts scripts is + // amortized instead of re-paid per test (recovers the +77 % wall-time + // regression introduced by the Groovy→Kotlin DSL conversion). + // + // Lives outside any @TempDir so JUnit cleanup never races with daemon file + // locks. See https://github.com/gradle/gradle/issues/12535 + // + // TestKit may reuse the same daemon for builds with different withEnvironment() + // values, so build logic must not cache environment-derived state in daemon-static + // fields. + private val sharedTestKitDir: File by lazy { + Files.createTempDirectory("gradle-testkit-").toFile().also { dir -> + Runtime.getRuntime().addShutdownHook(Thread { + stopDaemonsIn(dir) + dir.deleteRecursively() + }) + } + } + + /** + * Kills Gradle daemons started by TestKit under the given testkit dir. + * + * The Gradle Tooling API (used by [GradleRunner]) always spawns a daemon and + * provides no public API to stop it (https://github.com/gradle/gradle/issues/12535). + * We replicate the strategy Gradle uses in its own integration tests + * ([DaemonLogsAnalyzer.killAll()][1]): + * + * 1. Scan `/daemon//` for log files matching + * `DaemonLogConstants.DAEMON_LOG_PREFIX + pid + DaemonLogConstants.DAEMON_LOG_SUFFIX`, + * i.e. `daemon-.out.log`. + * 2. Extract the PID from the filename and kill the process. + * + * Trade-offs of the PID-from-filename approach: + * - **PID recycling**: between the build finishing and `kill` being sent, the OS + * could theoretically recycle the PID. Now that this only runs at JVM exit + * (no longer per-test), the window is short — when called from the shutdown + * hook all daemons we own are still alive — so the risk remains negligible. + * - **Filename convention is internal**: Gradle's `DaemonLogConstants.DAEMON_LOG_PREFIX` + * (`"daemon-"`) / `DAEMON_LOG_SUFFIX` (`".out.log"`) are not public API; a future + * Gradle version could change them. The `toLongOrNull()` guard safely skips entries + * that don't parse as a PID (including the UUID fallback Gradle uses when the PID + * is unavailable). + * - **Java 8 compatible**: uses `kill`/`taskkill` via [ProcessBuilder] instead of + * `ProcessHandle` (Java 9+) because build logic targets JVM 1.8. + * + * [1]: https://github.com/gradle/gradle/blob/43b381d88/testing/internal-distribution-testing/src/main/groovy/org/gradle/integtests/fixtures/daemon/DaemonLogsAnalyzer.groovy + */ + private fun stopDaemonsIn(testKitDir: File) { + val daemonDir = File(testKitDir, "daemon") + if (!daemonDir.exists()) return + + daemonDir.walkTopDown() + .filter { it.isFile && it.name.endsWith(".out.log") && !it.name.startsWith("hs_err") } + .forEach { logFile -> + val pid = logFile.nameWithoutExtension // daemon-12345.out + .removeSuffix(".out") // daemon-12345 + .removePrefix("daemon-") // 12345 + .toLongOrNull() ?: return@forEach // skip UUIDs / unparseable names + + val isWindows = System.getProperty("os.name").lowercase().contains("win") + val killProcess = if (isWindows) { + ProcessBuilder("taskkill", "/F", "/PID", pid.toString()) + } else { + ProcessBuilder("kill", pid.toString()) + } + try { + val process = killProcess.redirectErrorStream(true).start() + process.waitFor(5, java.util.concurrent.TimeUnit.SECONDS) + } catch (_: Exception) { + // best effort — daemon may already be stopped + } + } } } /** * Runs Gradle with the specified arguments. * - * After the build completes, any Gradle daemons started by TestKit are killed - * so their file locks on the testkit cache are released before JUnit `@TempDir` - * cleanup. See https://github.com/gradle/gradle/issues/12535 + * The TestKit daemon spawned by the first call and reused for every subsequent + * call in the JVM (shared [testKitDir]) so Kotlin compilation of `.gradle.kts` + * scripts amortizes across tests instead of being re-paid per test. + * Daemons are reaped at JVM shutdown by the hook registered when + * [sharedTestKitDir] is created. * * @param args Gradle task names and arguments * @param expectFailure Whether the build is expected to fail * @param env Environment variables to set (merged with system environment) + * @param forwardOutput Forward the build's stdout/stderr to the test's output + * @param gradleProjectDir Override the project directory used by Gradle (useful for git worktree tests); + * defaults to the fixture's project directory. * @return The build result */ - fun run(vararg args: String, expectFailure: Boolean = false, env: Map = emptyMap()): BuildResult { + fun run( + vararg args: String, + expectFailure: Boolean = false, + env: Map = emptyMap(), + forwardOutput: Boolean = false, + gradleProjectDir: File = projectDir, + ): BuildResult { val runner = GradleRunner.create() .withTestKitDir(testKitDir) .withPluginClasspath() - .withProjectDir(projectDir) + .withProjectDir(gradleProjectDir) // Using withDebug prevents starting a daemon, but it doesn't work with withEnvironment .withEnvironment(System.getenv() + env) .withArguments(*args) + if (forwardOutput) { + runner.forwardOutput() + } return try { if (expectFailure) runner.buildAndFail() else runner.build() } catch (e: UnexpectedBuildResultException) { e.buildResult - } finally { - stopDaemons() } } /** - * Kills Gradle daemons started by TestKit for this fixture's testkit dir. - * - * The Gradle Tooling API (used by [GradleRunner]) always spawns a daemon and - * provides no public API to stop it (https://github.com/gradle/gradle/issues/12535). - * We replicate the strategy Gradle uses in its own integration tests - * ([DaemonLogsAnalyzer.killAll()][1]): - * - * 1. Scan `/daemon//` for log files matching - * `DaemonLogConstants.DAEMON_LOG_PREFIX + pid + DaemonLogConstants.DAEMON_LOG_SUFFIX`, - * i.e. `daemon-.out.log`. - * 2. Extract the PID from the filename and kill the process. + * Writes a file under the project directory, creating parent dirs as needed. * - * Trade-offs of the PID-from-filename approach: - * - **PID recycling**: between the build finishing and `kill` being sent, the OS - * could theoretically recycle the PID. In practice the window is short - * (the `finally` block runs immediately after the build) so the risk is negligible. - * - **Filename convention is internal**: Gradle's `DaemonLogConstants.DAEMON_LOG_PREFIX` - * (`"daemon-"`) / `DAEMON_LOG_SUFFIX` (`".out.log"`) are not public API; a future - * Gradle version could change them. The `toLongOrNull()` guard safely skips entries - * that don't parse as a PID (including the UUID fallback Gradle uses when the PID - * is unavailable). - * - **Java 8 compatible**: uses `kill`/`taskkill` via [ProcessBuilder] instead of - * `ProcessHandle` (Java 9+) because build logic targets JVM 1.8. - * - * [1]: https://github.com/gradle/gradle/blob/43b381d88/testing/internal-distribution-testing/src/main/groovy/org/gradle/integtests/fixtures/daemon/DaemonLogsAnalyzer.groovy + * @param path Path relative to the project directory + * @param content File contents; passed through [String.trimIndent] before writing, + * and a trailing newline is appended. + * @param append If true, appends to any existing file instead of overwriting it. + * Safe to call repeatedly to build content up across steps. */ - private fun stopDaemons() { - val daemonDir = File(testKitDir, "daemon") - if (!daemonDir.exists()) return - - daemonDir.walkTopDown() - .filter { it.isFile && it.name.endsWith(".out.log") && !it.name.startsWith("hs_err") } - .forEach { logFile -> - val pid = logFile.nameWithoutExtension // daemon-12345.out - .removeSuffix(".out") // daemon-12345 - .removePrefix("daemon-") // 12345 - .toLongOrNull() ?: return@forEach // skip UUIDs / unparseable names - - val isWindows = System.getProperty("os.name").lowercase().contains("win") - val killProcess = if (isWindows) { - ProcessBuilder("taskkill", "/F", "/PID", pid.toString()) - } else { - ProcessBuilder("kill", pid.toString()) - } - try { - val process = killProcess.redirectErrorStream(true).start() - process.waitFor(5, java.util.concurrent.TimeUnit.SECONDS) - } catch (_: Exception) { - // best effort — daemon may already be stopped - } - } - } + fun writeFile(path: String, content: String, append: Boolean = false): File = + file(path).also { + it.parentFile?.mkdirs() + val text = content.trimIndent() + "\n" + if (append) it.appendText(text) else it.writeText(text) + } /** - * Adds a subproject to the build. - * Updates settings.gradle and creates the build script for the subproject. + * Adds a subproject to the build by appending an `include` line to settings.gradle.kts + * and writing the subproject's build.gradle.kts. * * @param projectPath The project path (e.g., "dd-java-agent:instrumentation:other") * @param buildScript The build script content for the subproject */ - fun addSubproject(projectPath: String, @Language("Groovy") buildScript: String) { - // Add to settings.gradle - val settingsFile = file("settings.gradle") - if (settingsFile.exists()) { - settingsFile.appendText("\ninclude ':$projectPath'") - } else { - settingsFile.writeText("include ':$projectPath'") - } + fun addSubproject(projectPath: String, @Language("kotlin") buildScript: String) { + writeFile("settings.gradle.kts", """include(":$projectPath")""", append = true) + writeFile("${projectPath.replace(':', '/')}/build.gradle.kts", buildScript) + } - file("${projectPath.replace(':', '/')}/build.gradle") - .writeText(buildScript.trimIndent()) + /** + * Writes a Java source file under src//java. + * + * @param classNameOrPath Simple class name, fully qualified class name, or source path + * @param sourceCode The Java source content + * @param sourceSet The Gradle source set to write to + * @param projectPath Optional Gradle project path; defaults to the root project + */ + fun writeJavaSource( + classNameOrPath: String, + @Language("JAVA") sourceCode: String, + sourceSet: String = "main", + projectPath: String? = null, + ) { + val sourcePath = classNameOrPath.removeSuffix(".java").replace('.', '/') + ".java" + val projectPrefix = projectPath + ?.removePrefix(":") + ?.replace(':', '/') + ?.let { "$it/" } + .orEmpty() + writeFile("${projectPrefix}src/$sourceSet/java/$sourcePath", sourceCode) } /** - * Writes the root project's build.gradle file. + * Writes gradle.properties at the project root. + * + * @param content Properties content (trimIndent applied, trailing newline added) + * @param append If true, appends to any existing file instead of overwriting + */ + fun writeGradleProperties(content: String, append: Boolean = false): File = + writeFile("gradle.properties", content, append) + + /** + * Writes the root project's build.gradle.kts file. * * @param buildScript The build script content for the root project + * @param append If true, appends to any existing file instead of overwriting */ - fun writeRootProject(@Language("Groovy") buildScript: String) { - file("build.gradle").writeText(buildScript.trimIndent()) - } + fun writeRootProject(@Language("kotlin") buildScript: String, append: Boolean = false): File = + writeFile("build.gradle.kts", buildScript, append) + + /** + * Writes the root project's settings.gradle.kts file. + * + * @param settingsScript The settings script content + * @param append If true, appends to any existing file instead of overwriting + */ + fun writeSettings(@Language("kotlin") settingsScript: String, append: Boolean = false): File = + writeFile("settings.gradle.kts", settingsScript, append) /** * Parses an XML file into a DOM Document. @@ -149,10 +226,26 @@ internal open class GradleFixture(protected val projectDir: File) { } /** - * Creates or gets a file in the project directory, ensuring parent directories exist. + * Returns a File handle under the project directory. + * Does not touch the filesystem. */ - protected fun file(path: String): File = - File(projectDir, path).also { file -> - file.parentFile?.mkdirs() - } + fun file(path: String): File = File(projectDir, path) + + /** + * Creates a directory under the project directory (including any missing parents) + * and returns it. + */ + fun dir(path: String): File = file(path).also { it.mkdirs() } + + /** + * The Gradle build output directory (`projectDir/build`). Not created — Gradle + * produces it during a build. + */ + val buildDir: File get() = File(projectDir, "build") + + /** + * Returns a File under the Gradle build output directory (`projectDir/build/...`). + * Does NOT create parent dirs — these paths are read after a Gradle build produces them. + */ + fun buildFile(path: String): File = File(buildDir, path) } diff --git a/buildSrc/src/test/kotlin/datadog/gradle/plugin/config/ParseV2SupportedConfigurationsTest.kt b/buildSrc/src/test/kotlin/datadog/gradle/plugin/config/ParseV2SupportedConfigurationsTest.kt index bb6a04d52f1..f6583d4cdba 100644 --- a/buildSrc/src/test/kotlin/datadog/gradle/plugin/config/ParseV2SupportedConfigurationsTest.kt +++ b/buildSrc/src/test/kotlin/datadog/gradle/plugin/config/ParseV2SupportedConfigurationsTest.kt @@ -1,19 +1,17 @@ package datadog.gradle.plugin.config +import datadog.gradle.plugin.GradleFixture import org.gradle.testkit.runner.BuildResult -import org.gradle.testkit.runner.GradleRunner import org.gradle.testkit.runner.TaskOutcome import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Assertions.assertTrue import org.junit.jupiter.api.Test -import org.junit.jupiter.api.io.TempDir import java.io.File -import java.nio.file.Paths -class ParseV2SupportedConfigurationsTest { +class ParseV2SupportedConfigurationsTest : GradleFixture() { @Test - fun `should generate Java file from JSON configuration`(@TempDir projectDir: File) { - val (buildResult, generatedFile) = runGradleTask(projectDir) + fun `should generate Java file from JSON configuration`() { + val (buildResult, generatedFile) = runGradleTask() assertEquals(TaskOutcome.SUCCESS, buildResult.task(":generateSupportedConfigurations")?.outcome) @@ -65,8 +63,8 @@ class ParseV2SupportedConfigurationsTest { aliases = listOf("DD_ALIAS") ) - assertTrue(content.contains("""aliasesMap.put("DD_ACTION_EXECUTION_ID", Collections.unmodifiableList(Arrays.asList()))""")) - assertTrue(content.contains("""aliasesMap.put("DD_AGENTLESS_LOG_SUBMISSION_ENABLED", Collections.unmodifiableList(Arrays.asList("DD_ALIAS")))""")) + assertTrue(content.contains("""aliasesMap.put("DD_ACTION_EXECUTION_ID", emptyList())""")) + assertTrue(content.contains("""aliasesMap.put("DD_AGENTLESS_LOG_SUBMISSION_ENABLED", singletonList("DD_ALIAS"))""")) assertTrue(content.contains("""aliasMappingMap.put("DD_ALIAS", "DD_AGENTLESS_LOG_SUBMISSION_ENABLED")""")) @@ -76,9 +74,9 @@ class ParseV2SupportedConfigurationsTest { assertTrue(content.contains("""reversePropertyKeysMapping.put("property.key", "DD_ACTION_EXECUTION_ID")""")) } - private fun runGradleTask(projectDir: File): Pair { - val jsonFile = file(projectDir, "test-supported-configurations.json") - jsonFile.writeText( + private fun runGradleTask(): Pair { + writeFile( + "test-supported-configurations.json", """ { "supportedConfigurations": { @@ -88,7 +86,7 @@ class ParseV2SupportedConfigurationsTest { "type": "string", "default": null, "aliases": [], - "propertyKeys": ["property.key"] + "propertyKeys": ["property.key"] } ], "DD_AGENTLESS_LOG_SUBMISSION_ENABLED": [ @@ -111,57 +109,45 @@ class ParseV2SupportedConfigurationsTest { "legacy.setting": "No longer supported" } } - """.trimIndent() + """ ) - setupGradleProject(projectDir) + setupGradleProject() - val buildResult = GradleRunner.create() - .forwardOutput() - .withPluginClasspath() - .withArguments("generateSupportedConfigurations") - .withProjectDir(projectDir) - .build() + val buildResult = run( + "generateSupportedConfigurations", + forwardOutput = true + ) - val generatedFile = file(projectDir, "build", "generated", "supportedConfigurations", "datadog", "test", "TestGeneratedSupportedConfigurations.java") + val generatedFile = file("build/generated/supportedConfigurations/datadog/test/TestGeneratedSupportedConfigurations.java") return Pair(buildResult, generatedFile) } - private fun setupGradleProject(projectDir: File) { - file(projectDir, "settings.gradle.kts").writeText( + private fun setupGradleProject() { + writeSettings( """ rootProject.name = "test-config-project" - """.trimIndent() + """ ) - file(projectDir, "build.gradle.kts").writeText( + writeRootProject( """ plugins { id("java") id("dd-trace-java.supported-config-generator") } - + group = "datadog.config.test" - + supportedTracerConfigurations { jsonFile.set(file("test-supported-configurations.json")) destinationDirectory.set(file("build/generated/supportedConfigurations")) className.set("datadog.test.TestGeneratedSupportedConfigurations") } - """.trimIndent() + """ ) } - private fun file(projectDir: File, vararg parts: String, makeDirectory: Boolean = false): File { - val f = Paths.get(projectDir.absolutePath, *parts).toFile() - - if (makeDirectory) { - f.parentFile.mkdirs() - } - - return f - } - private fun assertContainsSupportedConfig( content: String, key: String, @@ -171,9 +157,6 @@ class ParseV2SupportedConfigurationsTest { aliases: List, propertyKeys: List = emptyList() ) { - val aliasesArray = aliases.joinToString(", ") { "\"$it\"" } - val propertyKeysArray = propertyKeys.joinToString(", ") { "\"$it\"" } - assertTrue( content.contains("""supportedMap.put("$key""""), "Should contain supportedMap.put for key: $key" @@ -185,9 +168,9 @@ class ParseV2SupportedConfigurationsTest { append("\"$type\", ") append(if (default == "null") "null" else "\"$default\"") append(", ") - append("Arrays.asList($aliasesArray)") + append(listExpr(aliases)) append(", ") - append("Arrays.asList($propertyKeysArray)") + append(listExpr(propertyKeys)) append(")") } @@ -196,4 +179,10 @@ class ParseV2SupportedConfigurationsTest { "Should contain SupportedConfiguration: $expectedPattern" ) } + + private fun listExpr(items: List): String = when (items.size) { + 0 -> "emptyList()" + 1 -> """singletonList("${items[0]}")""" + else -> """asList(${items.joinToString(", ") { "\"$it\"" }})""" + } } diff --git a/buildSrc/src/test/kotlin/datadog/gradle/plugin/csi/CallSiteInstrumentationPluginTest.kt b/buildSrc/src/test/kotlin/datadog/gradle/plugin/csi/CallSiteInstrumentationPluginTest.kt index deba44a3a08..087db26fd69 100644 --- a/buildSrc/src/test/kotlin/datadog/gradle/plugin/csi/CallSiteInstrumentationPluginTest.kt +++ b/buildSrc/src/test/kotlin/datadog/gradle/plugin/csi/CallSiteInstrumentationPluginTest.kt @@ -1,21 +1,18 @@ package datadog.gradle.plugin.csi +import datadog.gradle.plugin.GradleFixture import org.gradle.testkit.runner.BuildResult -import org.gradle.testkit.runner.GradleRunner -import org.gradle.testkit.runner.UnexpectedBuildFailure import org.junit.jupiter.api.Assertions.assertFalse -import org.junit.jupiter.api.Assertions.assertThrows import org.junit.jupiter.api.Assertions.assertTrue import org.junit.jupiter.api.Test -import org.junit.jupiter.api.io.TempDir import java.io.File import java.nio.file.Files -class CallSiteInstrumentationPluginTest { +class CallSiteInstrumentationPluginTest : GradleFixture() { private val buildGradle = """ plugins { - id 'java' - id 'dd-trace-java.call-site-instrumentation' + id("java") + id("dd-trace-java.call-site-instrumentation") } java { @@ -24,43 +21,39 @@ class CallSiteInstrumentationPluginTest { } csi { - suffix = 'CallSite' - targetFolder = project.layout.buildDirectory.dir('csi') - rootFolder = file('__ROOT_FOLDER__') + suffix.set("CallSite") + targetFolder.set(project.layout.buildDirectory.dir("csi")) } - + repositories { mavenCentral() } - + dependencies { - implementation group: 'net.bytebuddy', name: 'byte-buddy', version: '1.18.8' - implementation group: 'com.google.auto.service', name: 'auto-service-annotations', version: '1.1.1' + implementation("net.bytebuddy:byte-buddy:1.18.10") + implementation("com.google.auto.service:auto-service-annotations:1.1.1") } - """.trimIndent() - - @TempDir - lateinit var buildDir: File + """ @Test fun `test call site instrumentation plugin`() { createGradleProject( - buildDir, buildGradle, + buildGradle, """ import datadog.trace.agent.tooling.csi.*; - + @CallSite(spi = CallSites.class) public class BeforeAdviceCallSite { @CallSite.Before("java.lang.StringBuilder java.lang.StringBuilder.append(java.lang.String)") public static void beforeAppend(@CallSite.This final StringBuilder self, @CallSite.Argument final String param) { } } - """.trimIndent() + """ ) - val result = buildGradleProject(buildDir) + val result = buildGradleProject() - val generated = resolve(buildDir, "build", "csi", "BeforeAdviceCallSites.java") + val generated = buildFile("csi/BeforeAdviceCallSites.java") assertTrue(generated.exists()) val output = result.output @@ -71,67 +64,58 @@ class CallSiteInstrumentationPluginTest { @Test fun `test call site instrumentation plugin with error`() { createGradleProject( - buildDir, buildGradle, + buildGradle, """ import datadog.trace.agent.tooling.csi.*; - + @CallSite(spi = CallSites.class) public class BeforeAdviceCallSite { @CallSite.Before("java.lang.StringBuilder java.lang.StringBuilder.append(java.lang.String)") private void beforeAppend(@CallSite.This final StringBuilder self, @CallSite.Argument final String param) { } } - """.trimIndent() + """ ) - val error = assertThrows(UnexpectedBuildFailure::class.java) { - buildGradleProject(buildDir) - } + val result = run("build", "--info", "--stacktrace", forwardOutput = true, expectFailure = true) - val generated = resolve(buildDir, "build", "csi", "BeforeAdviceCallSites.java") + val generated = buildFile("csi/BeforeAdviceCallSites.java") assertFalse(generated.exists()) - val output = error.message ?: "" + val output = result.output assertFalse(output.contains("[✓]")) assertTrue(output.contains("ADVICE_METHOD_NOT_STATIC_AND_PUBLIC")) } - private fun createGradleProject(buildDir: File, gradleFile: String, advice: String) { + private fun createGradleProject(gradleFile: String, advice: String) { val projectFolder = File(System.getProperty("user.dir")).parentFile - val callSiteJar = resolve(projectFolder, "buildSrc", "call-site-instrumentation-plugin", "build", "libs", "call-site-instrumentation-plugin-all.jar") - val testCallSiteJarDir = resolve(buildDir, "buildSrc", "call-site-instrumentation-plugin", "build", "libs", makeDirs = true) + val callSiteJar = File(projectFolder, "buildSrc/call-site-instrumentation-plugin/build/libs/call-site-instrumentation-plugin-all.jar") + val testCallSiteJarDir = dir("buildSrc/call-site-instrumentation-plugin/build/libs") Files.copy( callSiteJar.toPath(), testCallSiteJarDir.toPath().resolve(callSiteJar.name) ) - val gradleFileContent = gradleFile.replace("__ROOT_FOLDER__", projectFolder.toString().replace("\\", "\\\\")) - writeText(resolve(buildDir, "build.gradle"), gradleFileContent) + writeRootProject(gradleFile) - val javaFolder = resolve(buildDir, "src", "main", "java", makeDirs = true) val advicePackage = parsePackage(advice) val adviceClassName = parseClassName(advice) - val adviceFolder = resolve(javaFolder, *advicePackage.split("\\.").toTypedArray(), makeDirs = true) - writeText(resolve(adviceFolder, "$adviceClassName.java"), advice) + val adviceSourceName = if (advicePackage.isEmpty()) { + adviceClassName + } else { + "$advicePackage.$adviceClassName" + } + writeJavaSource(adviceSourceName, advice) - val csiSource = resolve(projectFolder, "dd-java-agent", "agent-tooling", "src", "main", "java", "datadog", "trace", "agent", "tooling", "csi") - val csiTarget = resolve(javaFolder, "datadog", "trace", "agent", "tooling", "csi", makeDirs = true) - csiSource.listFiles()?.forEach { - writeText(File(csiTarget, it.name), it.readText()) + val csiSource = File(projectFolder, "dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/csi") + csiSource.listFiles()?.forEach { src -> + writeJavaSource("datadog.trace.agent.tooling.csi.${src.nameWithoutExtension}", src.readText()) } } - private fun buildGradleProject(buildDir: File): BuildResult { - return GradleRunner.create() - .withTestKitDir(File(buildDir, ".gradle-test-kit")) // workaround in case the global test-kit cache becomes corrupted - .withDebug(true) // avoids starting daemon which can leave undeleted files post-cleanup - .withProjectDir(buildDir) - .withArguments("build", "--info", "--stacktrace") - .withPluginClasspath() - .forwardOutput() - .build() - } + private fun buildGradleProject(): BuildResult = + run("build", "--info", "--stacktrace", forwardOutput = true) private fun parsePackage(advice: String): String { val regex = Regex("package\\s+([\\w.]+)\\s*;", RegexOption.DOT_MATCHES_ALL) @@ -144,14 +128,4 @@ class CallSiteInstrumentationPluginTest { val match = regex.find(advice) return match?.groupValues?.getOrNull(1) ?: "" } - - private fun resolve(parent: File, vararg path: String, makeDirs: Boolean = false): File { - return path.fold(parent) { acc, next -> File(acc, next) }.apply { - if (makeDirs) { - mkdirs() - } - } - } - - private fun writeText(file: File, content: String) = file.writeText(content) } diff --git a/buildSrc/src/test/kotlin/datadog/gradle/plugin/dump/DumpHangedTestIntegrationTest.kt b/buildSrc/src/test/kotlin/datadog/gradle/plugin/dump/DumpHangedTestIntegrationTest.kt index d0a8279c85d..78279142b40 100644 --- a/buildSrc/src/test/kotlin/datadog/gradle/plugin/dump/DumpHangedTestIntegrationTest.kt +++ b/buildSrc/src/test/kotlin/datadog/gradle/plugin/dump/DumpHangedTestIntegrationTest.kt @@ -1,39 +1,34 @@ package datadog.gradle.plugin.dump -import org.gradle.testkit.runner.GradleRunner -import org.gradle.testkit.runner.UnexpectedBuildFailure +import datadog.gradle.plugin.GradleFixture import org.junit.jupiter.api.Assertions.assertFalse import org.junit.jupiter.api.Assertions.assertTrue import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertNotNull -import org.junit.jupiter.api.io.TempDir -import java.io.File -import java.nio.file.Paths -class DumpHangedTestIntegrationTest { +class DumpHangedTestIntegrationTest : GradleFixture() { @Test - fun `should not take dumps`(@TempDir projectDir: File) { - val output = runGradleTest(projectDir, testSleep = 1000) + fun `should not take dumps`() { + val output = runGradleTest(testSleepMillis = 1000) // Assert Gradle output has no evidence of taking dumps. assertFalse(output.contains("Taking dumps after 15 seconds delay for :test")) assertFalse(output.contains("Requesting stop of task ':test' as it has exceeded its configured timeout of 20s.")) - assertTrue(file(projectDir, "build").exists()) // Assert build happened. - assertFalse(file(projectDir, "build", "dumps").exists()) // Assert no dumps created. + assertTrue(buildDir.exists()) // Assert build happened. + assertFalse(buildFile("dumps").exists()) // Assert no dumps created. } @Test - fun `should take dumps`(@TempDir projectDir: File) { - val output = runGradleTest(projectDir, testSleep = 25_0000) + fun `should take dumps`() { + val output = runGradleTest(testSleepMillis = 25_0000) // Assert Gradle output has evidence of taking dumps. assertTrue(output.contains("Taking dumps after 15 seconds delay for :test")) assertTrue(output.contains("Requesting stop of task ':test' as it has exceeded its configured timeout of 20s.")) + assertTrue(buildDir.exists()) // Assert build happened. - assertTrue(file(projectDir, "build").exists()) // Assert build happened. - - val dumps = file(projectDir, "build", "dumps") + val dumps = buildFile("dumps") assertTrue(dumps.exists()) // Assert dumps created. // Assert actual dumps created. @@ -42,82 +37,60 @@ class DumpHangedTestIntegrationTest { assertNotNull(dumpFiles.find { it.startsWith("all-thread-dumps") }) } - private fun runGradleTest(projectDir: File, testSleep: Long): List { - file(projectDir, "settings.gradle.kts").writeText( - """ - rootProject.name = "test-project" - """.trimIndent() - ) + private fun runGradleTest(testSleepMillis: Long): List { + writeSettings("""rootProject.name = "test-project"""") - file(projectDir, "build.gradle.kts").writeText( + writeRootProject( """ import java.time.Duration - + import org.gradle.api.tasks.testing.Test + plugins { id("java") id("dd-trace-java.dump-hanged-test") } - + group = "datadog.dump.test" - + repositories { mavenCentral() } - + dependencies { testImplementation(platform("org.junit:junit-bom:5.10.0")) testImplementation("org.junit.jupiter:junit-jupiter") testRuntimeOnly("org.junit.platform:junit-platform-launcher") } - + dumpHangedTest { // Set the dump offset for 5 seconds to trigger taking dumps after 15 seconds. dumpOffset.set(5) } - + tasks.withType().configureEach { // Set test timeout after 20 seconds. timeout.set(Duration.ofSeconds(20)) - + useJUnitPlatform() } - """.trimIndent() + """ ) - file(projectDir, "src", "test", "java", "SimpleTest.java", makeDirectory = true).writeText( + writeJavaSource( + "SimpleTest", """ import org.junit.jupiter.api.Test; - + public class SimpleTest { @Test public void test() throws InterruptedException { - Thread.sleep($testSleep); + Thread.sleep($testSleepMillis); } } - """.trimIndent() + """, + sourceSet = "test" ) - try { - val buildResult = GradleRunner.create() - .forwardOutput() - .withPluginClasspath() - .withArguments("test") - .withProjectDir(projectDir) - .build() - - return buildResult.output.lines() - } catch (e: UnexpectedBuildFailure) { - return e.buildResult.output.lines() - } - } - - private fun file(projectDir: File, vararg parts: String, makeDirectory: Boolean = false): File { - val f = Paths.get(projectDir.absolutePath, *parts).toFile() - - if (makeDirectory) { - f.parentFile.mkdirs() - } - - return f + return run("test", forwardOutput = true).output.lines() } } diff --git a/buildSrc/src/test/kotlin/datadog/gradle/plugin/instrument/BuildTimeInstrumentationPluginTest.kt b/buildSrc/src/test/kotlin/datadog/gradle/plugin/instrument/BuildTimeInstrumentationPluginTest.kt index 017f6e6041d..1fef4354b2c 100644 --- a/buildSrc/src/test/kotlin/datadog/gradle/plugin/instrument/BuildTimeInstrumentationPluginTest.kt +++ b/buildSrc/src/test/kotlin/datadog/gradle/plugin/instrument/BuildTimeInstrumentationPluginTest.kt @@ -1,10 +1,9 @@ package datadog.gradle.plugin.instrument +import datadog.gradle.plugin.GradleFixture import net.bytebuddy.utility.OpenedClassReader -import org.gradle.testkit.runner.GradleRunner import org.junit.jupiter.api.Assertions.assertTrue import org.junit.jupiter.api.Test -import org.junit.jupiter.api.io.TempDir import org.objectweb.asm.ClassReader import org.objectweb.asm.ClassVisitor import org.objectweb.asm.ClassWriter @@ -13,12 +12,12 @@ import org.objectweb.asm.Opcodes import java.io.File import java.io.FileInputStream -class BuildTimeInstrumentationPluginTest { +class BuildTimeInstrumentationPluginTest : GradleFixture() { private val buildGradle = """ plugins { - id 'java' - id 'dd-trace-java.build-time-instrumentation' + id("java") + id("dd-trace-java.build-time-instrumentation") } java { @@ -31,51 +30,35 @@ class BuildTimeInstrumentationPluginTest { } dependencies { - compileOnly group: 'net.bytebuddy', name: 'byte-buddy', version: '1.18.8' // just to build TestPlugin + compileOnly("net.bytebuddy:byte-buddy:1.18.10") // just to build TestPlugin } - buildTimeInstrumentation.plugins = [ - 'TestPlugin' - ] - """.trimIndent() + buildTimeInstrumentation.plugins.set(listOf("TestPlugin")) + """ private val exampleCode = """ package example; public class ExampleCode {} - """.trimIndent() - - @TempDir - lateinit var buildDir: File + """ @Test fun `test instrument plugin`() { - val buildFile = File(buildDir, "build.gradle") - buildFile.writeText(buildGradle) - - val srcMainJava = testPlugin("src/main/java", "ExampleCode") - - val examplePackageDir = File(srcMainJava, "example").apply { mkdirs() } - File(examplePackageDir, "ExampleCode.java").writeText(exampleCode) + writeRootProject(buildGradle) + writeTestPlugin("ExampleCode") + writeJavaSource("example.ExampleCode", exampleCode) - // Run Gradle build with TestKit - GradleRunner.create().withTestKitDir(File(buildDir, ".gradle-test-kit")) // workaround in case the global test-kit cache becomes corrupted - .withDebug(true) // avoids starting daemon which can leave undeleted files post-cleanup - .withProjectDir(buildDir) - .withArguments("build", "--stacktrace") - .withPluginClasspath() - .forwardOutput() - .build() + run("build", "--stacktrace", forwardOutput = true) - assertInstrumented(File(buildDir, "build/classes/java/main/example/ExampleCode.class")) + assertInstrumented(buildFile("classes/java/main/example/ExampleCode.class")) } @Test fun `test instrument plugin processes includeClassDirectories`() { - val buildFile = File(buildDir, "build.gradle") - buildFile.writeText(""" + writeRootProject( + """ plugins { - id 'java' - id 'dd-trace-java.build-time-instrumentation' + id("java") + id("dd-trace-java.build-time-instrumentation") } java { @@ -88,41 +71,35 @@ class BuildTimeInstrumentationPluginTest { } dependencies { - compileOnly group: 'net.bytebuddy', name: 'byte-buddy', version: '1.18.8' + compileOnly("net.bytebuddy:byte-buddy:1.18.10") } buildTimeInstrumentation { - plugins = ['TestPlugin'] - includeClassDirectories.from(file('external-classes')) + plugins.set(listOf("TestPlugin")) + includeClassDirectories.from(file("external-classes")) } - """.trimIndent()) + """ + ) - testPlugin("src/main/java", "ExternalCode") + writeTestPlugin("ExternalCode") // Pre-compile ExternalCode using ASM and place it in the external-classes directory - val externalClassesDir = File(buildDir, "external-classes").apply { mkdirs() } + val externalClassesDir = dir("external-classes") precompiledClass("ExternalCode", externalClassesDir) - GradleRunner.create() - .withTestKitDir(File(buildDir, ".gradle-test-kit")) - .withDebug(true) - .withProjectDir(buildDir) - .withArguments("build", "--stacktrace") - .withPluginClasspath() - .forwardOutput() - .build() + run("build", "--stacktrace", forwardOutput = true) // ExternalCode.class should have been copied from external-classes, instrumented, and placed in the output - assertInstrumented(File(buildDir, "build/classes/java/main/ExternalCode.class")) + assertInstrumented(buildFile("classes/java/main/ExternalCode.class")) } @Test fun `test rerun-tasks does not lose includeClassDirectories classes`() { - val buildFile = File(buildDir, "build.gradle") - buildFile.writeText(""" + writeRootProject( + """ plugins { - id 'java' - id 'dd-trace-java.build-time-instrumentation' + id("java") + id("dd-trace-java.build-time-instrumentation") } java { @@ -135,44 +112,38 @@ class BuildTimeInstrumentationPluginTest { } dependencies { - compileOnly group: 'net.bytebuddy', name: 'byte-buddy', version: '1.18.8' + compileOnly("net.bytebuddy:byte-buddy:1.18.10") } buildTimeInstrumentation { - plugins = ['TestPlugin'] - includeClassDirectories.from(file('external-classes')) + plugins.set(listOf("TestPlugin")) + includeClassDirectories.from(file("external-classes")) } - """.trimIndent()) + """ + ) - val srcMainJava = testPlugin("src/main/java", "ExampleCode", "ExternalCode") - val examplePackageDir = File(srcMainJava, "example").apply { mkdirs() } - File(examplePackageDir, "ExampleCode.java").writeText("package example; public class ExampleCode {}") + writeTestPlugin("ExampleCode", "ExternalCode") + writeJavaSource("example.ExampleCode", "package example; public class ExampleCode {}") - val externalClassesDir = File(buildDir, "external-classes").apply { mkdirs() } + val externalClassesDir = dir("external-classes") precompiledClass("ExternalCode", externalClassesDir) - val runner = GradleRunner.create() - .withTestKitDir(File(buildDir, ".gradle-test-kit")) - .withDebug(true) - .withProjectDir(buildDir) - .withPluginClasspath() - .forwardOutput() - // First build - runner.withArguments("build", "--stacktrace").build() + run("build", "--stacktrace", forwardOutput = true) // Second build with --rerun-tasks: compileJava wipes classesDirectory, so without // the fix InstrumentAction would only sync freshly-compiled classes and lose ExternalCode.class - runner.withArguments("build", "--rerun-tasks", "--stacktrace").build() + run("build", "--rerun-tasks", "--stacktrace", forwardOutput = true) - assertInstrumented(File(buildDir, "build/classes/java/main/example/ExampleCode.class")) - assertInstrumented(File(buildDir, "build/classes/java/main/ExternalCode.class")) + assertInstrumented(buildFile("classes/java/main/example/ExampleCode.class")) + assertInstrumented(buildFile("classes/java/main/ExternalCode.class")) } - private fun testPlugin(srcDir: String, vararg classNames: String): File { - val dir = File(buildDir, srcDir).apply { mkdirs() } + private fun writeTestPlugin(vararg classNames: String) { val conditions = classNames.joinToString(" || ") { "\"$it\".equals(name)" } - File(dir, "TestPlugin.java").writeText(""" + writeJavaSource( + "TestPlugin", + """ import java.io.File; import java.io.IOException; import net.bytebuddy.build.Plugin; @@ -202,12 +173,12 @@ class BuildTimeInstrumentationPluginTest { } @Override - public void close() throws IOException { - // no-op - } + public void close() throws IOException { + // no-op } - """.trimIndent()) - return dir + } + """ + ) } private fun precompiledClass(className: String, targetDir: File) { diff --git a/buildSrc/src/test/kotlin/datadog/gradle/plugin/jardiff/JardiffComparisonTest.kt b/buildSrc/src/test/kotlin/datadog/gradle/plugin/jardiff/JardiffComparisonTest.kt new file mode 100644 index 00000000000..fded087aefd --- /dev/null +++ b/buildSrc/src/test/kotlin/datadog/gradle/plugin/jardiff/JardiffComparisonTest.kt @@ -0,0 +1,95 @@ +package datadog.gradle.plugin.jardiff + +import java.io.File +import org.assertj.core.api.Assertions.assertThat +import org.junit.jupiter.api.Test + +class JardiffComparisonTest { + + private val reference = File("/tmp/reference/dd-java-agent-1.0.0.jar") + private val candidate = File("/tmp/candidate/dd-java-agent-1.0.0.jar") + + @Test + fun `builds stat comparison arguments with the reference on the left`() { + val arguments = JardiffComparison.buildArguments(reference, candidate, mode = "--stat") + + assertThat(arguments).containsExactly( + "--stat", + "--exit-code", + "--color=never", + reference.absolutePath, + candidate.absolutePath, + ) + } + + @Test + fun `joins include patterns with commas before the positional arguments`() { + val arguments = JardiffComparison.buildArguments( + reference, + candidate, + mode = "--stat", + includes = listOf("**/*.class", "META-INF/**"), + ) + + assertThat(arguments).containsExactly( + "--stat", + "--exit-code", + "--color=never", + "--include=**/*.class,META-INF/**", + reference.absolutePath, + candidate.absolutePath, + ) + } + + @Test + fun `joins exclude patterns with commas`() { + val arguments = JardiffComparison.buildArguments( + reference, + candidate, + mode = "--stat", + excludes = listOf("**/*.txt"), + ) + + assertThat(arguments).contains("--exclude=**/*.txt") + // Both filter flags precede the two jars. + assertThat(arguments.indexOf("--exclude=**/*.txt")) + .isLessThan(arguments.indexOf(reference.absolutePath)) + } + + @Test + fun `omits filter flags when no patterns are given`() { + val arguments = JardiffComparison.buildArguments(reference, candidate, mode = "--stat") + + assertThat(arguments).noneMatch { it.startsWith("--include") || it.startsWith("--exclude") } + } + + @Test + fun `uses the given mode, and omits it when blank`() { + assertThat(JardiffComparison.buildArguments(reference, candidate, mode = "--status")) + .startsWith("--status") + assertThat(JardiffComparison.buildArguments(reference, candidate, mode = "")) + .startsWith("--exit-code") + } + + @Test + fun `appends additional options before the positional arguments`() { + val arguments = JardiffComparison.buildArguments( + reference, + candidate, + mode = "--stat", + additionalOptions = listOf("--ignore-member-order", "--class-text-producer=javap"), + ) + + assertThat(arguments).contains("--ignore-member-order", "--class-text-producer=javap") + assertThat(arguments.indexOf("--ignore-member-order")) + .isLessThan(arguments.indexOf(reference.absolutePath)) + } + + @Test + fun `maps exit values to outcomes like diff`() { + assertThat(JardiffComparison.outcomeOf(0)).isEqualTo(JardiffComparison.Outcome.IDENTICAL) + assertThat(JardiffComparison.outcomeOf(1)).isEqualTo(JardiffComparison.Outcome.DIFFERENT) + assertThat(JardiffComparison.outcomeOf(2)).isEqualTo(JardiffComparison.Outcome.ERROR) + assertThat(JardiffComparison.outcomeOf(137)).isEqualTo(JardiffComparison.Outcome.ERROR) + } +} diff --git a/buildSrc/src/test/kotlin/datadog/gradle/plugin/jardiff/JardiffTaskIntegrationTest.kt b/buildSrc/src/test/kotlin/datadog/gradle/plugin/jardiff/JardiffTaskIntegrationTest.kt new file mode 100644 index 00000000000..d2fe632d7a4 --- /dev/null +++ b/buildSrc/src/test/kotlin/datadog/gradle/plugin/jardiff/JardiffTaskIntegrationTest.kt @@ -0,0 +1,282 @@ +package datadog.gradle.plugin.jardiff + +import datadog.gradle.plugin.GradleFixture +import org.assertj.core.api.Assertions.assertThat +import org.gradle.testkit.runner.TaskOutcome +import org.junit.jupiter.api.Test + +/** + * Exercises the `dd-trace-java.jardiff` plugin and its `compareToReferenceJar` task end-to-end. + */ +class JardiffTaskIntegrationTest : GradleFixture() { + + @Test + fun `reference-jar option takes precedence over the referenceJar property`() { + writeProject() + writeJar("candidate.jar", "shared-bytes") + // The wired reference would match (identical bytes) and pass... + writeJar("reference.jar", "shared-bytes") + // ...but the command-line override points at a diverging jar, so the build must fail. + writeJar("override.jar", "diverging-bytes") + + val result = run( + "compareToReferenceJar", + "--reference-jar=${file("override.jar").absolutePath}", + expectFailure = true, + ) + + assertThat(result.task(":compareToReferenceJar")?.outcome).isEqualTo(TaskOutcome.FAILED) + assertThat(result.output).contains("Candidate jar differs from the reference jar") + } + + @Test + fun `resolves the reference from jardiffReferenceDir by matching the candidate file name`() { + writeProject(referenceJarLine = "") + writeJar("candidate.jar", "dir-bytes") + // A directory holding a jar with the SAME file name as the candidate (as across CI jobs). + dir("refs") + writeJar("refs/candidate.jar", "dir-bytes") + + val result = run("compareToReferenceJar", "-PjardiffReferenceDir=${file("refs").absolutePath}") + + assertThat(result.task(":compareToReferenceJar")?.outcome).isEqualTo(TaskOutcome.SUCCESS) + assertThat(jardiffReport()).exists().content() + .contains("SHA-256 hashes match for candidate.jar and candidate.jar") + } + + @Test + fun `skips comparison when the task is disabled`() { + writeProject( + referenceJarLine = "", + taskBody = "enabled = false", + ) + writeJar("candidate.jar", "candidate-bytes") + + val result = run("compareToReferenceJar") + + assertThat(result.task(":compareToReferenceJar")?.outcome).isEqualTo(TaskOutcome.SKIPPED) + assertThat(result.output).doesNotContain("No reference jar configured") + assertThat(jardiffReport()).doesNotExist() + } + + @Test + fun `passes include and exclude patterns to jardiff`() { + writeProject( + taskBody = """ + includes.set(listOf("**/*.class", "META-INF/**")) + excludes.set(listOf("**/*.txt")) + ignoreHashCheck.set(true) + """, + compareBytes = false, + ) + writeJar("candidate.jar", "candidate-bytes") + writeJar("reference.jar", "reference-bytes") + + val result = run("compareToReferenceJar") + + assertThat(result.task(":compareToReferenceJar")?.outcome).isEqualTo(TaskOutcome.SUCCESS) + assertThat(jardiffReport()).content() + .contains("--include=**/*.class,META-INF/**") + .contains("--exclude=**/*.txt") + } + + @Test + fun `applies main class, mode and additional options from the jardiff extension`() { + writeSettings("""rootProject.name = "jardiff-ext-test"""") + writeJavaSource("fake.jardiff.Main", stubMainSource("fake.jardiff", compareBytes = false)) + writeRootProject( + """ + import datadog.gradle.plugin.jardiff.JardiffTask + + plugins { + java + id("dd-trace-java.jardiff") + } + + jardiff { + mainClass.set("fake.jardiff.Main") + mode.set("--status") + additionalOptions.set(listOf("--ignore-member-order")) + ignoreHashCheck.set(true) + } + + tasks.named("compareToReferenceJar") { + dependsOn("classes") + jardiffClasspath.setFrom(sourceSets["main"].output) + candidateJar.set(layout.projectDirectory.file("candidate.jar")) + referenceJar.set(layout.projectDirectory.file("reference.jar")) + } + """, + ) + writeJar("candidate.jar", "candidate-bytes") + writeJar("reference.jar", "reference-bytes") + + val result = run("compareToReferenceJar") + + // SUCCESS proves the extension's mainClass reached the task (the stub Main is 'fake.jardiff.Main', + // not the default), and the report echoes the mode + additional option from the extension. + assertThat(result.task(":compareToReferenceJar")?.outcome).isEqualTo(TaskOutcome.SUCCESS) + assertThat(jardiffReport()).content() + .contains("--status") + .contains("--ignore-member-order") + } + + @Test + fun `applies mode additional options and ignoreHashCheck passed as command-line options`() { + writeProject(compareBytes = false) + writeJar("candidate.jar", "candidate-bytes") + writeJar("reference.jar", "reference-bytes") + + val result = run( + "compareToReferenceJar", + "--mode=--status", + "--jardiff-option=--ignore-member-order", + "--jardiff-option=--class-text-producer=javap", + "--ignore-hash-check", + ) + + assertThat(result.task(":compareToReferenceJar")?.outcome).isEqualTo(TaskOutcome.SUCCESS) + assertThat(jardiffReport()).content() + .contains("--status") + .contains("--ignore-member-order") + .contains("--class-text-producer=javap") + } + + @Test + fun `ignoreVersionFiles excludes version stamps from the comparison`() { + writeProject( + taskBody = """ + ignoreVersionFiles.set(true) + ignoreHashCheck.set(true) + """, + compareBytes = false, + ) + writeJar("candidate.jar", "candidate-bytes") + writeJar("reference.jar", "reference-bytes") + + val result = run("compareToReferenceJar") + + assertThat(result.task(":compareToReferenceJar")?.outcome).isEqualTo(TaskOutcome.SUCCESS) + assertThat(jardiffReport()).content() + .contains("--exclude=**/*.version") + } + + @Test + fun `compares version stamps under CI (ignoreVersionFiles defaults to false)`() { + // No explicit ignoreVersionFiles: the plugin's CI-aware convention drives it. With CI set, the + // build and deploy jobs share a commit, so the stamps are compared (not excluded). + writeProject(taskBody = "ignoreHashCheck.set(true)", compareBytes = false) + writeJar("candidate.jar", "candidate-bytes") + writeJar("reference.jar", "reference-bytes") + + val result = run("compareToReferenceJar", env = mapOf("CI" to "true")) + + assertThat(result.task(":compareToReferenceJar")?.outcome).isEqualTo(TaskOutcome.SUCCESS) + assertThat(jardiffReport()).content() + .doesNotContain("**/*.version") + } + + @Test + fun `writes reports under the configured reportDir`() { + writeSettings("""rootProject.name = "jardiff-report-dir-test"""") + writeJavaSource("fake.jardiff.Main", stubMainSource("fake.jardiff")) + writeRootProject( + """ + import datadog.gradle.plugin.jardiff.JardiffTask + + plugins { + java + id("dd-trace-java.jardiff") + } + + jardiff { + reportDir.set(layout.buildDirectory.dir("custom-jardiff-reports")) + } + + tasks.named("compareToReferenceJar") { + dependsOn("classes") + jardiffClasspath.setFrom(sourceSets["main"].output) + mainClass.set("fake.jardiff.Main") + candidateJar.set(layout.projectDirectory.file("candidate.jar")) + referenceJar.set(layout.projectDirectory.file("reference.jar")) + } + """, + ) + writeJar("candidate.jar", "same-bytes") + writeJar("reference.jar", "same-bytes") + + val result = run("compareToReferenceJar") + + assertThat(result.task(":compareToReferenceJar")?.outcome).isEqualTo(TaskOutcome.SUCCESS) + assertThat(buildFile("custom-jardiff-reports/candidate.jar.txt")).exists().content() + .contains("SHA-256 hashes match for candidate.jar and reference.jar") + } + + private fun writeJar(name: String, content: String) { + file(name).also { it.parentFile?.mkdirs() }.writeBytes(content.toByteArray()) + } + + private fun jardiffReport(candidateName: String = "candidate.jar") = + buildFile("reports/jardiff/$candidateName.txt") + + private fun writeProject( + taskBody: String = "", + referenceJarLine: String = + """referenceJar.set(layout.projectDirectory.file("reference.jar"))""", + compareBytes: Boolean = true, + ) { + writeSettings("""rootProject.name = "jardiff-stub-test"""") + writeJavaSource("fake.jardiff.Main", stubMainSource("fake.jardiff", compareBytes)) + // The task's classpath and main class point at the compiled stub instead of the real jardiff CLI. + writeRootProject( + """ + import datadog.gradle.plugin.jardiff.JardiffTask + + plugins { + java + id("dd-trace-java.jardiff") + } + + tasks.named("compareToReferenceJar") { + dependsOn("classes") + jardiffClasspath.setFrom(sourceSets["main"].output) + mainClass.set("fake.jardiff.Main") + candidateJar.set(layout.projectDirectory.file("candidate.jar")) + $referenceJarLine + $taskBody + } + """, + ) + } + + companion object { + /** + * Minimal stand-in for the jardiff CLI in the given package: prints the received arguments, + * byte-compares the last two positional arguments (left/right jars) and mirrors jardiff's + * `--exit-code` semantics. + */ + private fun stubMainSource(packageName: String, compareBytes: Boolean = true): String = """ + package $packageName; + + import java.nio.file.Files; + import java.nio.file.Paths; + import java.util.Arrays; + + public class Main { + public static void main(String[] args) throws Exception { + System.out.println("jardiff-stub args: " + Arrays.toString(args)); + String left = args[args.length - 2]; + String right = args[args.length - 1]; + byte[] leftBytes = Files.readAllBytes(Paths.get(left)); + byte[] rightBytes = Files.readAllBytes(Paths.get(right)); + if (${if (compareBytes) "Arrays.equals(leftBytes, rightBytes)" else "true"}) { + System.out.println("no differences"); + System.exit(0); + } + System.out.println(" 1 file changed, 1 insertion(+)"); + System.exit(Arrays.asList(args).contains("--exit-code") ? 1 : 0); + } + } + """.trimIndent() + } +} diff --git a/buildSrc/src/test/kotlin/datadog/gradle/plugin/jardiff/JardiffTaskTest.kt b/buildSrc/src/test/kotlin/datadog/gradle/plugin/jardiff/JardiffTaskTest.kt new file mode 100644 index 00000000000..ea06e336526 --- /dev/null +++ b/buildSrc/src/test/kotlin/datadog/gradle/plugin/jardiff/JardiffTaskTest.kt @@ -0,0 +1,151 @@ +package datadog.gradle.plugin.jardiff + +import datadog.gradle.plugin.GradleFixture +import org.assertj.core.api.Assertions.assertThat +import org.gradle.testkit.runner.TaskOutcome +import org.junit.jupiter.api.Test + +/** Exercises [JardiffTask] behavior without the plugin's archive/reference-dir wiring. */ +class JardiffTaskTest : GradleFixture() { + + @Test + fun `passes without running jardiff when the candidate hash matches the reference hash`() { + writeProject() + writeJar("candidate.jar", "same-bytes") + writeJar("reference.jar", "same-bytes") + + val result = run("jardiffTask") + + assertThat(result.task(":jardiffTask")?.outcome).isEqualTo(TaskOutcome.SUCCESS) + assertThat(jardiffReport()).exists().content() + .contains("SHA-256 hashes match for candidate.jar and reference.jar") + } + + @Test + fun `fails and reports the diff when jardiff finds differences`() { + writeProject() + writeJar("candidate.jar", "candidate-bytes") + writeJar("reference.jar", "reference-bytes") + + val result = run("jardiffTask", expectFailure = true) + + assertThat(result.task(":jardiffTask")?.outcome).isEqualTo(TaskOutcome.FAILED) + assertThat(result.output) + .contains("Candidate jar differs from the reference jar") + .contains("1 file changed") + .doesNotContain("SHA-256 hashes differ") + assertThat(jardiffReport()).exists().content() + .contains("1 file changed") + } + + @Test + fun `fails when no reference is configured`() { + writeProject(referenceJarLine = "") + writeJar("candidate.jar", "candidate-bytes") + + val result = run("jardiffTask", expectFailure = true) + + assertThat(result.task(":jardiffTask")?.outcome).isEqualTo(TaskOutcome.FAILED) + assertThat(result.output).contains("No reference jar configured") + assertThat(jardiffReport()).doesNotExist() + } + + @Test + fun `fails when hashes differ but jardiff reports no differences and ignoreHashCheck is false`() { + writeProject(compareBytes = false) + writeJar("candidate.jar", "candidate-bytes") + writeJar("reference.jar", "reference-bytes") + + val result = run("jardiffTask", expectFailure = true) + + assertThat(result.task(":jardiffTask")?.outcome).isEqualTo(TaskOutcome.FAILED) + assertThat(result.output) + .contains("SHA-256 hashes differ for candidate.jar (candidate) and reference.jar (reference)") + .contains("but jardiff detected no differences") + assertThat(jardiffReport()).exists().content() + .contains("no differences") + } + + @Test + fun `warns when hashes differ but jardiff reports no differences and ignoreHashCheck is true`() { + writeProject( + taskBody = "ignoreHashCheck.set(true)", + compareBytes = false, + ) + writeJar("candidate.jar", "candidate-bytes") + writeJar("reference.jar", "reference-bytes") + + val result = run("jardiffTask") + + assertThat(result.task(":jardiffTask")?.outcome).isEqualTo(TaskOutcome.SUCCESS) + assertThat(result.output) + .contains("SHA-256 hashes differ for candidate.jar (candidate) and reference.jar (reference)") + .contains("but jardiff detected no differences") + assertThat(jardiffReport()).exists().content() + .contains("no differences") + } + + private fun writeJar(name: String, content: String) { + file(name).also { it.parentFile?.mkdirs() }.writeBytes(content.toByteArray()) + } + + private fun jardiffReport(candidateName: String = "candidate.jar") = + buildFile("reports/jardiff/$candidateName.txt") + + private fun writeProject( + taskBody: String = "", + referenceJarLine: String = + """referenceJar.set(layout.projectDirectory.file("reference.jar"))""", + compareBytes: Boolean = true, + ) { + writeSettings("""rootProject.name = "jardiff-task-test"""") + writeJavaSource("fake.jardiff.Main", stubMainSource("fake.jardiff", compareBytes)) + writeRootProject( + """ + import datadog.gradle.plugin.jardiff.JardiffTask + + plugins { + java + id("dd-trace-java.jardiff") + } + + tasks.register("jardiffTask") { + dependsOn("classes") + jardiffClasspath.setFrom(sourceSets["main"].output) + mainClass.set("fake.jardiff.Main") + mode.set("--stat") + ignoreVersionFiles.set(true) + candidateJar.set(layout.projectDirectory.file("candidate.jar")) + $referenceJarLine + $taskBody + } + """, + ) + } + + companion object { + private fun stubMainSource(packageName: String, compareBytes: Boolean = true): String = """ + package $packageName; + + import java.nio.file.Files; + import java.nio.file.Paths; + import java.util.Arrays; + + public class Main { + public static void main(String[] args) throws Exception { + System.out.println("jardiff-stub args: " + Arrays.toString(args)); + String left = args[args.length - 2]; + String right = args[args.length - 1]; + byte[] leftBytes = Files.readAllBytes(Paths.get(left)); + byte[] rightBytes = Files.readAllBytes(Paths.get(right)); + if (${if (compareBytes) "Arrays.equals(leftBytes, rightBytes)" else "true"}) { + System.out.println("no differences"); + System.exit(0); + } + System.out.println(" 1 file changed, 1 insertion(+)"); + System.exit(Arrays.asList(args).contains("--exit-code") ? 1 : 0); + } + } + """.trimIndent() + } +} diff --git a/buildSrc/src/test/kotlin/datadog/gradle/plugin/muzzle/MuzzleMavenRepoUtilsTest.kt b/buildSrc/src/test/kotlin/datadog/gradle/plugin/muzzle/MuzzleMavenRepoUtilsTest.kt index 8c500a42f43..97d4576d098 100644 --- a/buildSrc/src/test/kotlin/datadog/gradle/plugin/muzzle/MuzzleMavenRepoUtilsTest.kt +++ b/buildSrc/src/test/kotlin/datadog/gradle/plugin/muzzle/MuzzleMavenRepoUtilsTest.kt @@ -1,9 +1,11 @@ package datadog.gradle.plugin.muzzle import datadog.gradle.plugin.MavenRepoFixture +import org.eclipse.aether.RepositorySystem import org.eclipse.aether.artifact.DefaultArtifact import org.eclipse.aether.repository.RemoteRepository import org.eclipse.aether.resolution.VersionRangeRequest +import org.eclipse.aether.resolution.VersionRangeResolutionException import org.eclipse.aether.resolution.VersionRangeResult import org.eclipse.aether.util.version.GenericVersionScheme import org.gradle.api.GradleException @@ -12,6 +14,8 @@ import org.junit.jupiter.api.io.TempDir import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.CsvSource import java.io.File +import java.lang.reflect.Proxy +import java.util.concurrent.atomic.AtomicInteger import org.assertj.core.api.Assertions.assertThat import org.assertj.core.api.Assertions.assertThatThrownBy @@ -54,6 +58,32 @@ class MuzzleMavenRepoUtilsTest { assertThat(resolvedVersions).containsExactly("2.0.0", "3.0.0") } + @Test + fun `resolveVersionRange retries thrown resolution failures`() { + val directive = MuzzleDirective().apply { + group = "com.example" + module = "mylib" + versions = "[1.0,)" + } + val attempts = AtomicInteger() + val retryingSystem = repositorySystemThrowingThenResolving( + failuresBeforeSuccess = 3, + result = createVersionRangeResult("1.0.0"), + attempts = attempts + ) + + val result = MuzzleMavenRepoUtils.resolveVersionRange( + directive, + retryingSystem, + newSession(), + emptyList(), + enableBackoffRetries = false + ) + + assertThat(result.versions.map { it.toString() }).containsExactly("1.0.0") + assertThat(attempts).hasValue(4) + } + @Test fun `resolveVersionRange throws IllegalStateException when resolution consistently fails`() { val emptyRepo = RemoteRepository.Builder("empty", "default", File(tempDir, "empty").apply { mkdirs() }.toURI().toString()).build() @@ -64,8 +94,49 @@ class MuzzleMavenRepoUtilsTest { } assertThatThrownBy { - MuzzleMavenRepoUtils.resolveVersionRange(directive, system, newSession(), listOf(emptyRepo)) + MuzzleMavenRepoUtils.resolveVersionRange( + directive, + system, + newSession(), + listOf(emptyRepo), + enableBackoffRetries = false + ) }.isInstanceOf(IllegalStateException::class.java) + .hasMessageContaining("Muzzle version range resolution failed") + .hasMessageContaining("com.example:nonexistent:jar:[1.0,)") + .hasMessageContaining("empty:") + .hasMessageContaining("Attempts:\n 4") + .hasMessageContaining("Backoff:\n disabled") + } + + @Test + fun `resolveVersionRange failure includes thrown resolution failure details`() { + val directive = MuzzleDirective().apply { + group = "com.example" + module = "mylib" + versions = "[1.0,)" + } + val attempts = AtomicInteger() + val throwingSystem = repositorySystemThrowingThenResolving( + failuresBeforeSuccess = 4, + result = createVersionRangeResult("1.0.0"), + attempts = attempts + ) + + assertThatThrownBy { + MuzzleMavenRepoUtils.resolveVersionRange( + directive, + throwingSystem, + newSession(), + emptyList(), + enableBackoffRetries = false + ) + }.isInstanceOf(IllegalStateException::class.java) + .hasCauseInstanceOf(VersionRangeResolutionException::class.java) + .hasMessageContaining("Attempts:\n 4") + .hasMessageContaining("Last resolution failure:") + .hasMessageContaining("transient version range failure 4") + assertThat(attempts).hasValue(4) } @Test @@ -224,4 +295,30 @@ class MuzzleMavenRepoUtilsTest { // lowestVersion/highestVersion are computed as versions[0] and versions[last] return VersionRangeResult(request).apply { this.versions = versions } } + + private fun repositorySystemThrowingThenResolving( + failuresBeforeSuccess: Int, + result: VersionRangeResult, + attempts: AtomicInteger + ): RepositorySystem = + Proxy.newProxyInstance( + RepositorySystem::class.java.classLoader, + arrayOf(RepositorySystem::class.java) + ) { _, method, args -> + when (method.name) { + "resolveVersionRange" -> { + val attempt = attempts.incrementAndGet() + if (attempt <= failuresBeforeSuccess) { + val request = args?.get(1) as VersionRangeRequest + throw VersionRangeResolutionException( + VersionRangeResult(request), + "transient version range failure $attempt" + ) + } + result + } + "toString" -> "repositorySystemThrowingThenResolving" + else -> throw UnsupportedOperationException(method.name) + } + } as RepositorySystem } diff --git a/buildSrc/src/test/kotlin/datadog/gradle/plugin/muzzle/MuzzlePluginFunctionalTest.kt b/buildSrc/src/test/kotlin/datadog/gradle/plugin/muzzle/MuzzlePluginFunctionalTest.kt index 00eb2514db0..ac30e3ae447 100644 --- a/buildSrc/src/test/kotlin/datadog/gradle/plugin/muzzle/MuzzlePluginFunctionalTest.kt +++ b/buildSrc/src/test/kotlin/datadog/gradle/plugin/muzzle/MuzzlePluginFunctionalTest.kt @@ -1,30 +1,21 @@ package datadog.gradle.plugin.muzzle -import datadog.gradle.plugin.GradleFixture -import datadog.gradle.plugin.MavenRepoFixture import org.assertj.core.api.Assertions.assertThat import org.gradle.testkit.runner.TaskOutcome.SUCCESS import org.junit.jupiter.api.Test -import org.junit.jupiter.api.io.TempDir import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.ValueSource -import java.io.File import kotlin.io.path.readText -class MuzzlePluginFunctionalTest { +class MuzzlePluginFunctionalTest : MuzzlePluginTestFixture() { @ParameterizedTest @ValueSource(strings = ["muzzle", ":dd-java-agent:instrumentation:demo:muzzle", "runMuzzle"]) - fun `detects muzzle invocation with various task names`( - taskName: String, - @TempDir projectDir: File - ) { - val fixture = MuzzlePluginTestFixture(projectDir) - - fixture.writeProject( + fun `detects muzzle invocation with various task names`(taskName: String) { + writeProject( """ plugins { - id 'java' - id 'dd-trace-java.muzzle' + id("java") + id("dd-trace-java.muzzle") } muzzle { @@ -36,17 +27,17 @@ class MuzzlePluginFunctionalTest { ) // Add runMuzzle aggregator task at root level (like in dd-trace-java.ci-jobs.gradle.kts) - fixture.writeRootProject( + writeRootProject( """ - tasks.register('runMuzzle') { - dependsOn(':dd-java-agent:instrumentation:demo:muzzle') + tasks.register("runMuzzle") { + dependsOn(":dd-java-agent:instrumentation:demo:muzzle") } """ ) - fixture.writeNoopScanPlugin() + writeNoopScanPlugin() - val result = fixture.run(taskName, "--stacktrace") + val result = run(taskName, "--stacktrace") assertThat(result.tasks) .withFailMessage("Should create muzzle tasks when '$taskName' is requested") @@ -59,24 +50,23 @@ class MuzzlePluginFunctionalTest { } @Test - fun `muzzle with pass directive writes junit report`(@TempDir projectDir: File) { - val fixture = MuzzlePluginTestFixture(projectDir) - fixture.writeProject( + fun `muzzle with pass directive writes junit report`() { + writeProject( """ plugins { - id 'java' - id 'dd-trace-java.muzzle' + id("java") + id("dd-trace-java.muzzle") } muzzle { pass { - name = 'expected-pass' + name = "expected-pass" coreJdk() } } """ ) - fixture.writeScanPlugin( + writeScanPlugin( """ if (!assertPass) { throw new IllegalStateException("unexpected fail assertion for " + muzzleDirective); @@ -84,14 +74,14 @@ class MuzzlePluginFunctionalTest { """ ) - val buildResult = fixture.run(":dd-java-agent:instrumentation:demo:muzzle", "--stacktrace") + val buildResult = run(":dd-java-agent:instrumentation:demo:muzzle", "--stacktrace") assertThat(buildResult.task(":dd-java-agent:instrumentation:demo:muzzle")?.outcome).isEqualTo(SUCCESS) assertThat(buildResult.task(":dd-java-agent:instrumentation:demo:muzzle-AssertPass-core-jdk")?.outcome) .isEqualTo(SUCCESS) assertThat(buildResult.task(":dd-java-agent:instrumentation:demo:muzzle-end")?.outcome).isEqualTo(SUCCESS) - val reportFile = fixture.findSingleMuzzleJUnitReport() - val report = fixture.parseXml(reportFile) + val reportFile = findSingleMuzzleJUnitReport() + val report = parseXml(reportFile) val suite = report.documentElement assertThat(suite.tagName).isEqualTo("testsuite") assertThat(suite.getAttribute("name")).isEqualTo(":dd-java-agent:instrumentation:demo") @@ -103,17 +93,16 @@ class MuzzlePluginFunctionalTest { } @Test - fun `muzzle without directives writes default junit report`(@TempDir projectDir: File) { - val fixture = MuzzlePluginTestFixture(projectDir) - fixture.writeProject( + fun `muzzle without directives writes default junit report`() { + writeProject( """ plugins { - id 'java' - id 'dd-trace-java.muzzle' + id("java") + id("dd-trace-java.muzzle") } """ ) - fixture.writeScanPlugin( + writeScanPlugin( """ if (!assertPass) { throw new IllegalStateException("unexpected fail assertion for " + muzzleDirective); @@ -121,11 +110,11 @@ class MuzzlePluginFunctionalTest { """ ) - val result = fixture.run(":dd-java-agent:instrumentation:demo:muzzle", "--stacktrace") + val result = run(":dd-java-agent:instrumentation:demo:muzzle", "--stacktrace") assertThat(result.task(":dd-java-agent:instrumentation:demo:muzzle")?.outcome).isEqualTo(SUCCESS) - val reportFile = fixture.findSingleMuzzleJUnitReport() - val report = fixture.parseXml(reportFile) + val reportFile = findSingleMuzzleJUnitReport() + val report = parseXml(reportFile) val suite = report.documentElement assertThat(suite.getAttribute("name")).isEqualTo(":dd-java-agent:instrumentation:demo") assertThat(suite.getAttribute("tests")).isEqualTo("1") @@ -136,13 +125,12 @@ class MuzzlePluginFunctionalTest { } @Test - fun `non muzzle invocation does not register muzzle end task`(@TempDir projectDir: File) { - val fixture = MuzzlePluginTestFixture(projectDir) - fixture.writeProject( + fun `non muzzle invocation does not register muzzle end task`() { + writeProject( """ plugins { - id 'java' - id 'dd-trace-java.muzzle' + id("java") + id("dd-trace-java.muzzle") } muzzle { @@ -153,46 +141,44 @@ class MuzzlePluginFunctionalTest { """ ) - val buildResult = fixture.run(":dd-java-agent:instrumentation:demo:tasks", "--all") + val buildResult = run(":dd-java-agent:instrumentation:demo:tasks", "--all") assertThat(buildResult.output).doesNotContain("muzzle-end") } @Test - fun `muzzle plugin wires bootstrap and tooling project classpaths`(@TempDir projectDir: File) { - val fixture = MuzzlePluginTestFixture(projectDir) - fixture.writeProject( + fun `muzzle plugin wires bootstrap and tooling project classpaths`() { + writeProject( """ plugins { - id 'java' - id 'dd-trace-java.muzzle' + id("java") + id("dd-trace-java.muzzle") } """ ) - val bootstrapDependencies = fixture.run( + val bootstrapDependencies = run( ":dd-java-agent:instrumentation:demo:dependencies", "--configuration", "muzzleBootstrap" ) - assertThat(bootstrapDependencies.output).contains("project :dd-java-agent:agent-bootstrap") + assertThat(bootstrapDependencies.output).contains(":dd-java-agent:agent-bootstrap") - val toolingDependencies = fixture.run( + val toolingDependencies = run( ":dd-java-agent:instrumentation:demo:dependencies", "--configuration", "muzzleTooling" ) - assertThat(toolingDependencies.output).contains("project :dd-java-agent:agent-tooling") + assertThat(toolingDependencies.output).contains(":dd-java-agent:agent-tooling") } @Test - fun `muzzle executes exactly planned core-jdk tasks and writes task results`(@TempDir projectDir: File) { - val fixture = MuzzlePluginTestFixture(projectDir) - fixture.writeProject( + fun `muzzle executes exactly planned core-jdk tasks and writes task results`() { + writeProject( """ plugins { - id 'java' - id 'dd-trace-java.muzzle' + id("java") + id("dd-trace-java.muzzle") } muzzle { @@ -201,13 +187,13 @@ class MuzzlePluginFunctionalTest { } """ ) - fixture.writeScanPlugin( + writeScanPlugin( """ // pass """ ) - val result = fixture.run(":dd-java-agent:instrumentation:demo:muzzle", "--stacktrace") + val result = run(":dd-java-agent:instrumentation:demo:muzzle", "--stacktrace") val muzzleTaskPath = ":dd-java-agent:instrumentation:demo:muzzle" val passDirectiveTaskPath = ":dd-java-agent:instrumentation:demo:muzzle-AssertPass-core-jdk" val failDirectiveTaskPath = ":dd-java-agent:instrumentation:demo:muzzle-AssertFail-core-jdk" @@ -229,8 +215,8 @@ class MuzzlePluginFunctionalTest { assertThat(muzzleChainInOrder) .containsExactly(muzzleTaskPath, passDirectiveTaskPath, failDirectiveTaskPath, endTaskPath) - val passDirectiveResult = fixture.resultFile("muzzle-AssertPass-core-jdk") - val failDirectiveResult = fixture.resultFile("muzzle-AssertFail-core-jdk") + val passDirectiveResult = resultFile("muzzle-AssertPass-core-jdk") + val failDirectiveResult = resultFile("muzzle-AssertFail-core-jdk") assertThat(passDirectiveResult).isRegularFile() assertThat(failDirectiveResult).isRegularFile() assertThat(passDirectiveResult.readText()).isEqualTo("PASSING") @@ -238,26 +224,25 @@ class MuzzlePluginFunctionalTest { } @Test - fun `artifact directive resolves multiple versions from version range`(@TempDir projectDir: File) { - val fixture = MuzzlePluginTestFixture(projectDir) - val mavenRepoFixture = MavenRepoFixture(projectDir) + fun `artifact directive resolves multiple versions from version range`() { + val mavenRepoFixture = createMavenRepoFixture() mavenRepoFixture.publishVersions( group = "com.example.test", module = "demo-lib", versions = listOf("1.0.0", "1.1.0", "1.2.0", "2.0.0") ) - fixture.writeProject( + writeProject( """ plugins { - id 'java' - id 'dd-trace-java.muzzle' + id("java") + id("dd-trace-java.muzzle") } // Gradle repositories for artifact download repositories { maven { - url = uri('${mavenRepoFixture.repoUrl}') + url = uri("${mavenRepoFixture.repoUrl}") metadataSources { mavenPom() artifact() @@ -268,17 +253,17 @@ class MuzzlePluginFunctionalTest { muzzle { pass { - group = 'com.example.test' - module = 'demo-lib' - versions = '[1.0.0,2.0.0)' // Should resolve 1.0.0, 1.1.0, 1.2.0 but NOT 2.0.0 + group = "com.example.test" + module = "demo-lib" + versions = "[1.0.0,2.0.0)" // Should resolve 1.0.0, 1.1.0, 1.2.0 but NOT 2.0.0 } } """ ) - fixture.writeNoopScanPlugin() + writeNoopScanPlugin() // Leveraging MAVEN_REPOSITORY_PROXY to point to our fake repo over maven central - val result = fixture.run( + val result = run( ":dd-java-agent:instrumentation:demo:muzzle", "--stacktrace", env = mapOf("MAVEN_REPOSITORY_PROXY" to mavenRepoFixture.repoUrl) @@ -301,8 +286,8 @@ class MuzzlePluginFunctionalTest { .withFailMessage("Should not check against test-demo-lib:2.0.0") .isNull() - val reportFile = fixture.findSingleMuzzleJUnitReport() - val report = fixture.parseXml(reportFile) + val reportFile = findSingleMuzzleJUnitReport() + val report = parseXml(reportFile) val suite = report.documentElement val testCount = suite.getAttribute("tests").toInt() assertThat(testCount) @@ -318,18 +303,17 @@ class MuzzlePluginFunctionalTest { } @Test - fun `named directive is passed to scan plugin`(@TempDir projectDir: File) { - val fixture = MuzzlePluginTestFixture(projectDir) - fixture.writeProject( + fun `named directive is passed to scan plugin`() { + writeProject( """ plugins { - id 'java' - id 'dd-trace-java.muzzle' + id("java") + id("dd-trace-java.muzzle") } muzzle { pass { - name = 'my-custom-check' + name = "my-custom-check" coreJdk() } } @@ -337,7 +321,7 @@ class MuzzlePluginFunctionalTest { ) // The real MuzzleVersionScanPlugin uses the directive name to filter InstrumenterModules - fixture.writeScanPlugin( + writeScanPlugin( """ if (!"my-custom-check".equals(muzzleDirective)) { throw new IllegalStateException( @@ -349,7 +333,7 @@ class MuzzlePluginFunctionalTest { """ ) - val result = fixture.run(":dd-java-agent:instrumentation:demo:muzzle", "--stacktrace") + val result = run(":dd-java-agent:instrumentation:demo:muzzle", "--stacktrace") assertThat(result.task(":dd-java-agent:instrumentation:demo:muzzle-AssertPass-core-jdk")?.outcome) .isEqualTo(SUCCESS) @@ -358,27 +342,26 @@ class MuzzlePluginFunctionalTest { } @Test - fun `non-existent artifact fails with clear error message`(@TempDir projectDir: File) { - val fixture = MuzzlePluginTestFixture(projectDir) - fixture.writeProject( + fun `non-existent artifact fails with clear error message`() { + writeProject( """ plugins { - id 'java' - id 'dd-trace-java.muzzle' + id("java") + id("dd-trace-java.muzzle") } muzzle { pass { - group = 'com.example.nonexistent' - module = 'does-not-exist' - versions = '[1.0.0,2.0.0)' + group = "com.example.nonexistent" + module = "does-not-exist" + versions = "[1.0.0,2.0.0)" } } """ ) - fixture.writeNoopScanPlugin() + writeNoopScanPlugin() - val result = fixture.run( + val result = run( ":dd-java-agent:instrumentation:demo:muzzle", "--stacktrace", env = mapOf("MAVEN_REPOSITORY_PROXY" to "https://repo1.maven.org/maven2/") @@ -395,13 +378,12 @@ class MuzzlePluginFunctionalTest { } @Test - fun `pass directive that fails validation causes build failure`(@TempDir projectDir: File) { - val fixture = MuzzlePluginTestFixture(projectDir) - fixture.writeProject( + fun `pass directive that fails validation causes build failure`() { + writeProject( """ plugins { - id 'java' - id 'dd-trace-java.muzzle' + id("java") + id("dd-trace-java.muzzle") } muzzle { @@ -413,7 +395,7 @@ class MuzzlePluginFunctionalTest { ) // Real implementation throws RuntimeException when !passed && assertPass (line 70 of MuzzleVersionScanPlugin) - fixture.writeScanPlugin( + writeScanPlugin( """ if (assertPass) { System.err.println("FAILED MUZZLE VALIDATION: mismatches:"); @@ -423,7 +405,7 @@ class MuzzlePluginFunctionalTest { """ ) - val result = fixture.run( + val result = run( ":dd-java-agent:instrumentation:demo:muzzle", "--stacktrace" ) @@ -435,13 +417,12 @@ class MuzzlePluginFunctionalTest { } @Test - fun `fail directive that passes validation causes build failure`(@TempDir projectDir: File) { - val fixture = MuzzlePluginTestFixture(projectDir) - fixture.writeProject( + fun `fail directive that passes validation causes build failure`() { + writeProject( """ plugins { - id 'java' - id 'dd-trace-java.muzzle' + id("java") + id("dd-trace-java.muzzle") } muzzle { @@ -454,7 +435,7 @@ class MuzzlePluginFunctionalTest { // Scan plugin simulates successful validation when it should fail // Real MuzzleVersionScanPlugin throws RuntimeException when passed && !assertPass - fixture.writeScanPlugin( + writeScanPlugin( """ if (!assertPass) { System.err.println("MUZZLE PASSED BUT FAILURE WAS EXPECTED"); @@ -463,7 +444,7 @@ class MuzzlePluginFunctionalTest { """ ) - val result = fixture.run( + val result = run( ":dd-java-agent:instrumentation:demo:muzzle", "--stacktrace" ) @@ -477,9 +458,8 @@ class MuzzlePluginFunctionalTest { } @Test - fun `additional dependencies are added to muzzle test classpath`(@TempDir projectDir: File) { - val fixture = MuzzlePluginTestFixture(projectDir) - val mavenRepoFixture = MavenRepoFixture(projectDir) + fun `additional dependencies are added to muzzle test classpath`() { + val mavenRepoFixture = createMavenRepoFixture() // Create a fake Maven repo with a fake additional dependency // The JAR will automatically include standard Maven metadata @@ -488,16 +468,16 @@ class MuzzlePluginFunctionalTest { module = "extra-lib", versions = listOf("1.0.0") ) - fixture.writeProject( + writeProject( """ plugins { - id 'java' - id 'dd-trace-java.muzzle' + id("java") + id("dd-trace-java.muzzle") } repositories { maven { - url = uri('${mavenRepoFixture.repoUrl}') + url = uri("${mavenRepoFixture.repoUrl}") metadataSources { mavenPom() artifact() @@ -508,14 +488,14 @@ class MuzzlePluginFunctionalTest { muzzle { pass { coreJdk() - extraDependency('com.example.extra:extra-lib:1.0.0') + extraDependency("com.example.extra:extra-lib:1.0.0") } } """ ) // Scan plugin verifies that the additional dependency JAR is in the classpath - fixture.writeScanPlugin( + writeScanPlugin( """ java.io.InputStream resource = testApplicationClassLoader.getResourceAsStream("META-INF/maven/com.example.extra/extra-lib/pom.properties"); if (resource != null) { @@ -531,7 +511,7 @@ class MuzzlePluginFunctionalTest { """ ) - val result = fixture.run( + val result = run( ":dd-java-agent:instrumentation:demo:muzzle", "--stacktrace", env = mapOf("MAVEN_REPOSITORY_PROXY" to mavenRepoFixture.repoUrl) @@ -548,9 +528,8 @@ class MuzzlePluginFunctionalTest { } @Test - fun `excluded dependencies are removed from muzzle test classpath`(@TempDir projectDir: File) { - val fixture = MuzzlePluginTestFixture(projectDir) - val mavenRepoFixture = MavenRepoFixture(projectDir) + fun `excluded dependencies are removed from muzzle test classpath`() { + val mavenRepoFixture = createMavenRepoFixture() // Create a fake repo with an artifact that has transitive dependencies mavenRepoFixture.publishVersions( @@ -560,6 +539,7 @@ class MuzzlePluginFunctionalTest { ) // Manually create a POM with a transitive dependency + // Write into MavenRepoFixture's repoDir, not GradleFixture's projectDir. val pomFile = mavenRepoFixture.repoDir.resolve("com/example/test/with-transitive/1.0.0/with-transitive-1.0.0.pom") pomFile.writeText( """ @@ -579,16 +559,16 @@ class MuzzlePluginFunctionalTest { """.trimIndent() ) - fixture.writeProject( + writeProject( """ plugins { - id 'java' - id 'dd-trace-java.muzzle' + id("java") + id("dd-trace-java.muzzle") } repositories { maven { - url = uri('${mavenRepoFixture.repoUrl}') + url = uri("${mavenRepoFixture.repoUrl}") metadataSources { mavenPom() artifact() @@ -599,17 +579,17 @@ class MuzzlePluginFunctionalTest { muzzle { pass { - group = 'com.example.test' - module = 'with-transitive' - versions = '1.0.0' - excludeDependency('com.google.guava:guava') + group = "com.example.test" + module = "with-transitive" + versions = "1.0.0" + excludeDependency("com.google.guava:guava") } } """ ) // Scan plugin verifies that guava is NOT in the classpath (it was excluded) - fixture.writeScanPlugin( + writeScanPlugin( """ try { testApplicationClassLoader.loadClass("com.google.common.collect.ImmutableList"); @@ -620,7 +600,7 @@ class MuzzlePluginFunctionalTest { """ ) - val result = fixture.run( + val result = run( ":dd-java-agent:instrumentation:demo:muzzle", "--stacktrace", env = mapOf("MAVEN_REPOSITORY_PROXY" to mavenRepoFixture.repoUrl) @@ -635,17 +615,15 @@ class MuzzlePluginFunctionalTest { } @Test - fun `java plugin applied after muzzle plugin`(@TempDir projectDir: File) { - val fixture = MuzzlePluginTestFixture(projectDir) - - fixture.writeProject( + fun `java plugin applied after muzzle plugin`() { + writeProject( """ plugins { - id 'dd-trace-java.muzzle' + id("dd-trace-java.muzzle") } // applied after muzzle plugin - apply plugin: 'java' + apply(plugin = "java") muzzle { pass { @@ -654,9 +632,9 @@ class MuzzlePluginFunctionalTest { } """ ) - fixture.writeNoopScanPlugin() + writeNoopScanPlugin() - val result = fixture.run( + val result = run( ":dd-java-agent:instrumentation:demo:muzzle", "--stacktrace" ) @@ -667,29 +645,27 @@ class MuzzlePluginFunctionalTest { } @Test - fun `java plugin applied before muzzle plugin`(@TempDir projectDir: File) { - val fixture = MuzzlePluginTestFixture(projectDir) - - fixture.writeProject( + fun `java plugin applied before muzzle plugin`() { + writeProject( """ plugins { - id 'java' - id 'dd-trace-java.muzzle' apply false // Declared but not applied + id("java") + id("dd-trace-java.muzzle") apply false // Declared but not applied } // Apply muzzle plugin after java using imperative syntax - apply plugin: 'dd-trace-java.muzzle' + apply(plugin = "dd-trace-java.muzzle") - muzzle { + extensions.configure("muzzle") { pass { coreJdk() } } """ ) - fixture.writeNoopScanPlugin() + writeNoopScanPlugin() - val result = fixture.run( + val result = run( ":dd-java-agent:instrumentation:demo:muzzle", "--stacktrace" ) @@ -700,13 +676,11 @@ class MuzzlePluginFunctionalTest { } @Test - fun `plugin behavior without java plugin should no-op`(@TempDir projectDir: File) { - val fixture = MuzzlePluginTestFixture(projectDir) - - fixture.writeProject( + fun `plugin behavior without java plugin should no-op`() { + writeProject( """ plugins { - id 'dd-trace-java.muzzle' + id("dd-trace-java.muzzle") // NO java plugin applied } @@ -717,9 +691,9 @@ class MuzzlePluginFunctionalTest { } """ ) - fixture.writeNoopScanPlugin() + writeNoopScanPlugin() - val result = fixture.run( + val result = run( ":dd-java-agent:instrumentation:demo:tasks", "--all" ) @@ -730,20 +704,21 @@ class MuzzlePluginFunctionalTest { } @Test - fun `missing dd-java-agent projects error handling`(@TempDir projectDir: File) { - // Create a minimal settings.gradle without the dd-java-agent structure - File(projectDir, "settings.gradle").also { it.parentFile?.mkdirs() }.writeText( + fun `missing dd-java-agent projects error handling`() { + // Create a minimal settings.gradle.kts without the dd-java-agent structure + writeSettings( + """ + rootProject.name = "muzzle-test" + include(":instrumentation:demo") """ - rootProject.name = 'muzzle-test' - include ':instrumentation:demo' - """.trimIndent() ) - File(projectDir, "instrumentation/demo/build.gradle").also { it.parentFile?.mkdirs() }.writeText( + addSubproject( + "instrumentation:demo", """ plugins { - id 'java' - id 'dd-trace-java.muzzle' + id("java") + id("dd-trace-java.muzzle") } muzzle { @@ -751,13 +726,13 @@ class MuzzlePluginFunctionalTest { coreJdk() } } - """.trimIndent() + """ ) // No need to create MuzzleVersionScanPlugin - the error happens during configuration // phase before any task execution, so the scan plugin is never invoked - val result = GradleFixture(projectDir).run( + val result = run( ":instrumentation:demo:tasks", "--stacktrace" ) @@ -771,26 +746,25 @@ class MuzzlePluginFunctionalTest { } @Test - fun `assertInverse creates pass and fail tasks for in-range and out-of-range versions`(@TempDir projectDir: File) { - val fixture = MuzzlePluginTestFixture(projectDir) - val mavenRepoFixture = MavenRepoFixture(projectDir) + fun `assertInverse creates pass and fail tasks for in-range and out-of-range versions`() { + val mavenRepoFixture = createMavenRepoFixture() mavenRepoFixture.publishVersions( group = "com.example.test", module = "inverse-lib", versions = listOf("1.0.0", "2.0.0", "3.0.0", "4.0.0") ) - fixture.writeProject( + writeProject( """ plugins { - id 'java' - id 'dd-trace-java.muzzle' + id("java") + id("dd-trace-java.muzzle") } // Gradle repositories for artifact download repositories { maven { - url = uri('${mavenRepoFixture.repoUrl}') + url = uri("${mavenRepoFixture.repoUrl}") metadataSources { mavenPom() artifact() @@ -800,21 +774,21 @@ class MuzzlePluginFunctionalTest { muzzle { pass { - group = 'com.example.test' - module = 'inverse-lib' - versions = '[2.0.0,3.0.0]' + group = "com.example.test" + module = "inverse-lib" + versions = "[2.0.0,3.0.0]" assertInverse = true } } """ ) - fixture.writeScanPlugin( + writeScanPlugin( """ System.out.println("MUZZLE_CHECK assertPass=" + assertPass); """ ) - val result = fixture.run( + val result = run( ":dd-java-agent:instrumentation:demo:muzzle", "--stacktrace", env = mapOf("MAVEN_REPOSITORY_PROXY" to mavenRepoFixture.repoUrl) @@ -848,8 +822,8 @@ class MuzzlePluginFunctionalTest { .contains("MUZZLE_CHECK assertPass=false") // Verify JUnit report contains all 4 test cases with no failures - val reportFile = fixture.findSingleMuzzleJUnitReport() - val report = fixture.parseXml(reportFile) + val reportFile = findSingleMuzzleJUnitReport() + val report = parseXml(reportFile) val suite = report.documentElement assertThat(suite.getAttribute("tests")) .withFailMessage("Should have 4 test cases (2 pass + 2 inverse fail)") diff --git a/buildSrc/src/test/kotlin/datadog/gradle/plugin/muzzle/MuzzlePluginPerformanceTest.kt b/buildSrc/src/test/kotlin/datadog/gradle/plugin/muzzle/MuzzlePluginPerformanceTest.kt index 79aaf409b7c..2e43b0b3d38 100644 --- a/buildSrc/src/test/kotlin/datadog/gradle/plugin/muzzle/MuzzlePluginPerformanceTest.kt +++ b/buildSrc/src/test/kotlin/datadog/gradle/plugin/muzzle/MuzzlePluginPerformanceTest.kt @@ -1,38 +1,33 @@ package datadog.gradle.plugin.muzzle -import datadog.gradle.plugin.MavenRepoFixture import org.gradle.testkit.runner.TaskOutcome.SUCCESS import org.gradle.testkit.runner.TaskOutcome.UP_TO_DATE import org.junit.jupiter.api.Test -import org.junit.jupiter.api.io.TempDir -import java.io.File import org.assertj.core.api.Assertions.assertThat -class MuzzlePluginPerformanceTest { +class MuzzlePluginPerformanceTest : MuzzlePluginTestFixture() { @Test - fun `task graph does not include muzzle tasks when not requested`(@TempDir projectDir: File) { - val fixture = MuzzlePluginTestFixture(projectDir) - - fixture.writeProject( + fun `task graph does not include muzzle tasks when not requested`() { + writeProject( """ plugins { - id 'java' - id 'dd-trace-java.muzzle' + id("java") + id("dd-trace-java.muzzle") } muzzle { pass { - group = 'com.example.test' - module = 'some-lib' - versions = '[1.0.0,2.0.0)' + group = "com.example.test" + module = "some-lib" + versions = "[1.0.0,2.0.0)" } } """ ) - fixture.writeNoopScanPlugin() + writeNoopScanPlugin() - val result = fixture.run( + val result = run( ":dd-java-agent:instrumentation:demo:tasks", "--all", "--info" @@ -49,26 +44,24 @@ class MuzzlePluginPerformanceTest { } @Test - fun `does not configure muzzle when other project muzzle task is requested`(@TempDir projectDir: File) { - val fixture = MuzzlePluginTestFixture(projectDir) - - fixture.writeProject( + fun `does not configure muzzle when other project muzzle task is requested`() { + writeProject( """ plugins { - id 'java' - id 'dd-trace-java.muzzle' + id("java") + id("dd-trace-java.muzzle") } muzzle { pass { coreJdk() } } """ ) - fixture.writeNoopScanPlugin() - fixture.addSubproject("dd-java-agent:instrumentation:other", + writeNoopScanPlugin() + addSubproject("dd-java-agent:instrumentation:other", """ plugins { - id 'java' - id 'dd-trace-java.muzzle' + id("java") + id("dd-trace-java.muzzle") } muzzle { pass { coreJdk() } @@ -76,7 +69,7 @@ class MuzzlePluginPerformanceTest { """ ) - val result = fixture.run( + val result = run( ":dd-java-agent:instrumentation:demo:muzzle", "--stacktrace", "--info" @@ -94,9 +87,8 @@ class MuzzlePluginPerformanceTest { } @Test - fun `muzzle tasks are up-to-date when nothing changes`(@TempDir projectDir: File) { - val fixture = MuzzlePluginTestFixture(projectDir) - val mavenRepoFixture = MavenRepoFixture(projectDir) + fun `muzzle tasks are up-to-date when nothing changes`() { + val mavenRepoFixture = createMavenRepoFixture() mavenRepoFixture.publishVersions( group = "com.example.test", @@ -104,16 +96,16 @@ class MuzzlePluginPerformanceTest { versions = listOf("1.0.0", "1.1.0") ) - fixture.writeProject( + writeProject( """ plugins { - id 'java' - id 'dd-trace-java.muzzle' + id("java") + id("dd-trace-java.muzzle") } repositories { maven { - url = uri('${mavenRepoFixture.repoUrl}') + url = uri("${mavenRepoFixture.repoUrl}") metadataSources { mavenPom() artifact() @@ -123,18 +115,18 @@ class MuzzlePluginPerformanceTest { muzzle { pass { - group = 'com.example.test' - module = 'example-lib' - versions = '[1.0.0,2.0.0)' + group = "com.example.test" + module = "example-lib" + versions = "[1.0.0,2.0.0)" } } """ ) - fixture.writeNoopScanPlugin() + writeNoopScanPlugin() // First run - should execute the tasks run { - val firstRun = fixture.run( + val firstRun = run( ":dd-java-agent:instrumentation:demo:muzzle", env = mapOf("MAVEN_REPOSITORY_PROXY" to mavenRepoFixture.repoUrl) ) @@ -153,7 +145,7 @@ class MuzzlePluginPerformanceTest { // Second run without changes - assertion tasks should be up-to-date run { - val secondRun = fixture.run( + val secondRun = run( ":dd-java-agent:instrumentation:demo:muzzle", env = mapOf("MAVEN_REPOSITORY_PROXY" to mavenRepoFixture.repoUrl) ) @@ -181,7 +173,7 @@ class MuzzlePluginPerformanceTest { versions = listOf("1.2.0") ) - val thirdRun = fixture.run( + val thirdRun = run( ":dd-java-agent:instrumentation:demo:muzzle", env = mapOf("MAVEN_REPOSITORY_PROXY" to mavenRepoFixture.repoUrl) ) @@ -205,14 +197,12 @@ class MuzzlePluginPerformanceTest { } @Test - fun `muzzle tasks invalidated when instrumentation code changes`(@TempDir projectDir: File) { - val fixture = MuzzlePluginTestFixture(projectDir) - - fixture.writeProject( + fun `muzzle tasks invalidated when instrumentation code changes`() { + writeProject( """ plugins { - id 'java' - id 'dd-trace-java.muzzle' + id("java") + id("dd-trace-java.muzzle") } muzzle { @@ -220,11 +210,11 @@ class MuzzlePluginPerformanceTest { } """ ) - fixture.writeNoopScanPlugin() + writeNoopScanPlugin() // First run - should execute the tasks run { - val firstRun = fixture.run(":dd-java-agent:instrumentation:demo:muzzle") + val firstRun = run(":dd-java-agent:instrumentation:demo:muzzle") assertThat(firstRun.task(":dd-java-agent:instrumentation:demo:muzzle")?.outcome) .withFailMessage("First run should execute muzzle task") @@ -236,7 +226,7 @@ class MuzzlePluginPerformanceTest { // Second run without changes - assertion tasks should be up-to-date run { - val secondRun = fixture.run(":dd-java-agent:instrumentation:demo:muzzle") + val secondRun = run(":dd-java-agent:instrumentation:demo:muzzle") assertThat(secondRun.task(":dd-java-agent:instrumentation:demo:muzzle")?.outcome) .withFailMessage("Second run should be up-to-date") @@ -248,19 +238,18 @@ class MuzzlePluginPerformanceTest { // Third run after changing instrumentation code - should be invalidated run { - val demoSourceDir = File(projectDir, "dd-java-agent/instrumentation/demo/src/main/java/com/example") - demoSourceDir.mkdirs() - File(demoSourceDir, "Demo.java").writeText( + writeFile( + "dd-java-agent/instrumentation/demo/src/main/java/com/example/Demo.java", """ package com.example; public class Demo { public void doSomething() {} } - """.trimIndent() + """ ) - val thirdRun = fixture.run(":dd-java-agent:instrumentation:demo:muzzle") + val thirdRun = run(":dd-java-agent:instrumentation:demo:muzzle") assertThat(thirdRun.task(":dd-java-agent:instrumentation:demo:muzzle")?.outcome) .withFailMessage("Third run should execute after instrumentation code change") @@ -272,14 +261,12 @@ class MuzzlePluginPerformanceTest { } @Test - fun `muzzle tasks invalidated when tooling classpath changes`(@TempDir projectDir: File) { - val fixture = MuzzlePluginTestFixture(projectDir) - - fixture.writeProject( + fun `muzzle tasks invalidated when tooling classpath changes`() { + writeProject( """ plugins { - id 'java' - id 'dd-trace-java.muzzle' + id("java") + id("dd-trace-java.muzzle") } muzzle { @@ -287,11 +274,11 @@ class MuzzlePluginPerformanceTest { } """ ) - fixture.writeNoopScanPlugin() + writeNoopScanPlugin() // First run - should execute the tasks run { - val firstRun = fixture.run(":dd-java-agent:instrumentation:demo:muzzle") + val firstRun = run(":dd-java-agent:instrumentation:demo:muzzle") assertThat(firstRun.task(":dd-java-agent:instrumentation:demo:muzzle")?.outcome) .withFailMessage("First run should execute muzzle task") @@ -303,7 +290,7 @@ class MuzzlePluginPerformanceTest { // Second run without changes - assertion tasks should be up-to-date run { - val secondRun = fixture.run(":dd-java-agent:instrumentation:demo:muzzle") + val secondRun = run(":dd-java-agent:instrumentation:demo:muzzle") assertThat(secondRun.task(":dd-java-agent:instrumentation:demo:muzzle")?.outcome) .withFailMessage("Second run should be up-to-date") @@ -315,19 +302,18 @@ class MuzzlePluginPerformanceTest { // Third run after changing agent-tooling code - should be invalidated run { - val toolingSourceDir = File(projectDir, "dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling") - toolingSourceDir.mkdirs() - File(toolingSourceDir, "Extra.java").writeText( + writeFile( + "dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/Extra.java", """ package datadog.trace.agent.tooling; public class Extra { public void extraMethod() {} } - """.trimIndent() + """ ) - val thirdRun = fixture.run(":dd-java-agent:instrumentation:demo:muzzle") + val thirdRun = run(":dd-java-agent:instrumentation:demo:muzzle") assertThat(thirdRun.task(":dd-java-agent:instrumentation:demo:muzzle")?.outcome) .withFailMessage("Third run should execute after tooling classpath change") @@ -339,14 +325,12 @@ class MuzzlePluginPerformanceTest { } @Test - fun `muzzle tasks invalidated when bootstrap classpath changes`(@TempDir projectDir: File) { - val fixture = MuzzlePluginTestFixture(projectDir) - - fixture.writeProject( + fun `muzzle tasks invalidated when bootstrap classpath changes`() { + writeProject( """ plugins { - id 'java' - id 'dd-trace-java.muzzle' + id("java") + id("dd-trace-java.muzzle") } muzzle { @@ -354,11 +338,11 @@ class MuzzlePluginPerformanceTest { } """ ) - fixture.writeNoopScanPlugin() + writeNoopScanPlugin() // First run - should execute the tasks run { - val firstRun = fixture.run(":dd-java-agent:instrumentation:demo:muzzle") + val firstRun = run(":dd-java-agent:instrumentation:demo:muzzle") assertThat(firstRun.task(":dd-java-agent:instrumentation:demo:muzzle")?.outcome) .withFailMessage("First run should execute muzzle task") @@ -370,7 +354,7 @@ class MuzzlePluginPerformanceTest { // Second run without changes - assertion tasks should be up-to-date run { - val secondRun = fixture.run(":dd-java-agent:instrumentation:demo:muzzle") + val secondRun = run(":dd-java-agent:instrumentation:demo:muzzle") assertThat(secondRun.task(":dd-java-agent:instrumentation:demo:muzzle")?.outcome) .withFailMessage("Second run should be up-to-date") @@ -382,19 +366,18 @@ class MuzzlePluginPerformanceTest { // Third run after changing agent-bootstrap code - should be invalidated run { - val bootstrapSourceDir = File(projectDir, "dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap") - bootstrapSourceDir.mkdirs() - File(bootstrapSourceDir, "Helper.java").writeText( + writeFile( + "dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/Helper.java", """ package datadog.trace.bootstrap; public class Helper { public void help() {} } - """.trimIndent() + """ ) - val thirdRun = fixture.run(":dd-java-agent:instrumentation:demo:muzzle") + val thirdRun = run(":dd-java-agent:instrumentation:demo:muzzle") assertThat(thirdRun.task(":dd-java-agent:instrumentation:demo:muzzle")?.outcome) .withFailMessage("Third run should execute after bootstrap classpath change") diff --git a/buildSrc/src/test/kotlin/datadog/gradle/plugin/muzzle/MuzzlePluginTestFixture.kt b/buildSrc/src/test/kotlin/datadog/gradle/plugin/muzzle/MuzzlePluginTestFixture.kt index 026ef5b0d9d..ba9945cbe4a 100644 --- a/buildSrc/src/test/kotlin/datadog/gradle/plugin/muzzle/MuzzlePluginTestFixture.kt +++ b/buildSrc/src/test/kotlin/datadog/gradle/plugin/muzzle/MuzzlePluginTestFixture.kt @@ -1,6 +1,7 @@ package datadog.gradle.plugin.muzzle import datadog.gradle.plugin.GradleFixture +import datadog.gradle.plugin.MavenRepoFixture import org.intellij.lang.annotations.Language import java.io.File @@ -8,34 +9,34 @@ import java.io.File * Test fixture for muzzle plugin integration tests. * Extends GradleFixture with muzzle-specific functionality. */ -internal class MuzzlePluginTestFixture(projectDir: File) : GradleFixture(projectDir) { +open class MuzzlePluginTestFixture : GradleFixture() { + fun createMavenRepoFixture(): MavenRepoFixture = MavenRepoFixture(projectDir) /** * Writes the basic Gradle project structure for muzzle testing. * Creates a multi-project build with agent-bootstrap, agent-tooling, and instrumentation modules. */ - fun writeProject(@Language("Groovy") instrumentationBuildScript: String) { - file("settings.gradle").writeText( - // language=Groovy + fun writeProject(@Language("kotlin") instrumentationBuildScript: String) { + writeSettings( + """ + rootProject.name = "muzzle-e2e" """ - rootProject.name = 'muzzle-e2e' - """.trimIndent() ) addSubproject("dd-java-agent:agent-bootstrap", """ plugins { - id 'java' + id("java") } - tasks.register('compileMain_java11Java') + tasks.register("compileMain_java11Java") """ ) addSubproject("dd-java-agent:agent-tooling", """ plugins { - id 'java' + id("java") } """ ) @@ -57,25 +58,26 @@ internal class MuzzlePluginTestFixture(projectDir: File) : GradleFixture(project * @param assertionBody Java code to execute in the assertion method */ fun writeScanPlugin(@Language("JAVA") assertionBody: String) { - file("dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/muzzle/MuzzleVersionScanPlugin.java") - .writeText( - // language=JAVA - """ - package datadog.trace.agent.tooling.muzzle; + writeJavaSource( + "datadog.trace.agent.tooling.muzzle.MuzzleVersionScanPlugin", + // language=JAVA + """ + package datadog.trace.agent.tooling.muzzle; - public final class MuzzleVersionScanPlugin { - private MuzzleVersionScanPlugin() {} + public final class MuzzleVersionScanPlugin { + private MuzzleVersionScanPlugin() {} - public static void assertInstrumentationMuzzled( - ClassLoader instrumentationClassLoader, - ClassLoader testApplicationClassLoader, - boolean assertPass, - String muzzleDirective) { - $assertionBody - } + public static void assertInstrumentationMuzzled( + ClassLoader instrumentationClassLoader, + ClassLoader testApplicationClassLoader, + boolean assertPass, + String muzzleDirective) { + $assertionBody } - """.trimIndent() - ) + } + """, + projectPath = "dd-java-agent:agent-tooling", + ) } /** diff --git a/buildSrc/src/test/kotlin/datadog/gradle/plugin/muzzle/RangeQueryTest.kt b/buildSrc/src/test/kotlin/datadog/gradle/plugin/muzzle/RangeQueryTest.kt index 5ced9ed1032..2c47645bdc7 100644 --- a/buildSrc/src/test/kotlin/datadog/gradle/plugin/muzzle/RangeQueryTest.kt +++ b/buildSrc/src/test/kotlin/datadog/gradle/plugin/muzzle/RangeQueryTest.kt @@ -15,7 +15,7 @@ class RangeQueryTest { // compile group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.5.0', ext: 'pom' val directiveArtifact: Artifact = DefaultArtifact("org.codehaus.groovy", "groovy-all", "jar", "[2.5.0,2.5.8)") val rangeRequest = VersionRangeRequest().apply { - repositories = MuzzleMavenRepoUtils.MUZZLE_REPOS + repositories = MuzzleMavenRepoUtils.defaultMuzzleRepos() artifact = directiveArtifact } diff --git a/buildSrc/src/test/kotlin/datadog/gradle/plugin/sca/ScaEnrichmentsPluginTest.kt b/buildSrc/src/test/kotlin/datadog/gradle/plugin/sca/ScaEnrichmentsPluginTest.kt new file mode 100644 index 00000000000..8d469109a33 --- /dev/null +++ b/buildSrc/src/test/kotlin/datadog/gradle/plugin/sca/ScaEnrichmentsPluginTest.kt @@ -0,0 +1,75 @@ +package datadog.gradle.plugin.sca + +import datadog.gradle.plugin.GradleFixture +import org.assertj.core.api.Assertions.assertThat +import org.gradle.testkit.runner.TaskOutcome +import org.junit.jupiter.api.BeforeEach +import org.junit.jupiter.api.Test + +class ScaEnrichmentsPluginTest : GradleFixture() { + + @BeforeEach + fun setup() { + writeSettings("""rootProject.name = "test-appsec"""") + writeRootProject( + """ + plugins { + java + id("dd-trace-java.sca-enrichments") + } + """ + ) + } + + @Test + fun `generateScaCvesJson is SKIPPED when file exists and refreshSca is not set`() { + file("src/main/resources/sca_cves.json").also { + it.parentFile.mkdirs() + it.writeText("{\"version\":1,\"entries\":[]}") + } + + val result = run("generateScaCvesJson") + + assertThat(result.task(":generateScaCvesJson")?.outcome).isEqualTo(TaskOutcome.SKIPPED) + } + + @Test + fun `generateScaCvesJson attempts to run when refreshSca is set even if file exists`() { + file("src/main/resources/sca_cves.json").also { + it.parentFile.mkdirs() + it.writeText("{}") + } + + // With -PrefreshSca the onlyIf condition is true; task will fail at the GitHub fetch + // (no network in tests) but must NOT be SKIPPED + val result = run("generateScaCvesJson", "-PrefreshSca", expectFailure = true) + + assertThat(result.task(":generateScaCvesJson")?.outcome) + .isNotNull + .isNotEqualTo(TaskOutcome.SKIPPED) + } + + @Test + fun `generateScaCvesJson attempts to run when output file does not exist`() { + // File absent: onlyIf returns true; task will fail at GitHub fetch but must not be SKIPPED + val result = run("generateScaCvesJson", expectFailure = true) + + assertThat(result.task(":generateScaCvesJson")?.outcome) + .isNotNull + .isNotEqualTo(TaskOutcome.SKIPPED) + } + + @Test + fun `processResources depends on generateScaCvesJson`() { + file("src/main/resources/sca_cves.json").also { + it.parentFile.mkdirs() + it.writeText("{\"version\":1,\"entries\":[]}") + } + + val result = run("processResources") + + // generateScaCvesJson must appear as SKIPPED (file exists, no -PrefreshSca) + assertThat(result.task(":generateScaCvesJson")?.outcome).isEqualTo(TaskOutcome.SKIPPED) + assertThat(result.task(":processResources")?.outcome).isEqualTo(TaskOutcome.SUCCESS) + } +} diff --git a/buildSrc/src/test/kotlin/datadog/gradle/plugin/testJvmConstraints/TestJvmConstraintsPluginTest.kt b/buildSrc/src/test/kotlin/datadog/gradle/plugin/testJvmConstraints/TestJvmConstraintsPluginTest.kt new file mode 100644 index 00000000000..438da18f92b --- /dev/null +++ b/buildSrc/src/test/kotlin/datadog/gradle/plugin/testJvmConstraints/TestJvmConstraintsPluginTest.kt @@ -0,0 +1,71 @@ +package datadog.gradle.plugin.testJvmConstraints + +import datadog.gradle.plugin.testJvmConstraints.TestJvmConstraintsExtension.Companion.TEST_JVM_CONSTRAINTS +import org.assertj.core.api.Assertions.assertThat +import org.gradle.api.tasks.testing.Test as GradleTest +import org.gradle.testfixtures.ProjectBuilder +import org.gradle.testing.jacoco.plugins.JacocoTaskExtension +import org.junit.jupiter.api.Test + +class TestJvmConstraintsPluginTest { + @Test + fun `plugin configures project and test task extensions`() { + val project = ProjectBuilder.builder().build() + + project.pluginManager.apply("dd-trace-java.test-jvm-constraints") + + val testTask = project.tasks.named("test", GradleTest::class.java).get() + + assertThat(project.plugins.hasPlugin("java")).isTrue() + assertThat(project.extensions.findByName(TEST_JVM_CONSTRAINTS)).isInstanceOf(TestJvmConstraintsExtension::class.java) + assertThat(testTask.extensions.findByName(TEST_JVM_CONSTRAINTS)).isInstanceOf(TestJvmConstraintsExtension::class.java) + } + + @Test + fun `jacoco is disabled for additional test jvm when coverage is not checked`() { + val testTask = testTaskWithJacoco() + + testTask.configureJacocoForAdditionalTestJvm( + hasAdditionalTestJvmLauncher = true, + checkCoverage = false + ) + + assertThat(jacocoExtension(testTask).isEnabled).isFalse() + } + + @Test + fun `jacoco remains enabled for additional test jvm when coverage is checked`() { + val testTask = testTaskWithJacoco() + + testTask.configureJacocoForAdditionalTestJvm( + hasAdditionalTestJvmLauncher = true, + checkCoverage = true + ) + + assertThat(jacocoExtension(testTask).isEnabled).isTrue() + } + + @Test + fun `jacoco remains enabled when using the daemon jvm`() { + val testTask = testTaskWithJacoco() + + testTask.configureJacocoForAdditionalTestJvm( + hasAdditionalTestJvmLauncher = false, + checkCoverage = false + ) + + assertThat(jacocoExtension(testTask).isEnabled).isTrue() + } + + private fun testTaskWithJacoco(): GradleTest { + val project = ProjectBuilder.builder().build() + + project.pluginManager.apply("java") + project.pluginManager.apply("jacoco") + + return project.tasks.named("test", GradleTest::class.java).get() + } + + private fun jacocoExtension(testTask: GradleTest): JacocoTaskExtension = + testTask.extensions.getByType(JacocoTaskExtension::class.java) +} diff --git a/buildSrc/src/test/kotlin/datadog/gradle/plugin/version/TracerVersionIntegrationTest.kt b/buildSrc/src/test/kotlin/datadog/gradle/plugin/version/TracerVersionIntegrationTest.kt index ac65bdf0910..eb909d71862 100644 --- a/buildSrc/src/test/kotlin/datadog/gradle/plugin/version/TracerVersionIntegrationTest.kt +++ b/buildSrc/src/test/kotlin/datadog/gradle/plugin/version/TracerVersionIntegrationTest.kt @@ -1,319 +1,222 @@ package datadog.gradle.plugin.version -import org.gradle.testkit.runner.GradleRunner -import org.junit.jupiter.api.Assertions.assertEquals +import org.assertj.core.api.Assertions.assertThat import org.junit.jupiter.api.Test import org.junit.jupiter.api.io.TempDir import java.io.File -import java.io.IOException -class TracerVersionIntegrationTest { +class TracerVersionIntegrationTest : VersionPluginsFixture() { @Test - fun `should use default version when not under a git clone`(@TempDir projectDir: File) { - assertTracerVersion(projectDir, "0.1.0-SNAPSHOT") + fun `should use default version when not under a git clone`() { + assertTracerVersion(expectedVersion = "0.1.0-SNAPSHOT") } @Test - fun `should use default version when no git tags`(@TempDir projectDir: File) { + fun `should use default version when no git tags`() { assertTracerVersion( - projectDir, - "0.1.0-SNAPSHOT", + expectedVersion = "0.1.0-SNAPSHOT", beforeGradle = { - exec(projectDir, "git", "init", "--initial-branch", "main") - exec(projectDir, "git", "config", "user.email", "test@datadoghq.com") - exec(projectDir, "git", "config", "user.name", "Test") - exec(projectDir, "git", "add", "-A") - exec(projectDir, "git", "commit", "-m", "A commit") - } + initGitRepo() + }, ) } @Test - fun `should ignore dirtiness when no git tags`(@TempDir projectDir: File) { + fun `should ignore dirtiness when no git tags`() { assertTracerVersion( - projectDir, - "0.1.0-SNAPSHOT", + expectedVersion = "0.1.0-SNAPSHOT", beforeGradle = { - exec(projectDir, "git", "init", "--initial-branch", "main") - exec(projectDir, "git", "config", "user.email", "test@datadoghq.com") - exec(projectDir, "git", "config", "user.name", "Test") - exec(projectDir, "git", "add", "-A") - exec(projectDir, "git", "commit", "-m", "A commit") - - File(projectDir, "settings.gradle.kts").appendText( - """ - - // uncommitted change this file, - """.trimIndent() - ) - } + initGitRepo() + writeSettings("// uncommitted change this file, ", append = true) + }, ) } @Test - fun `should use default version when unmatching git tags`(@TempDir projectDir: File) { + fun `should use default version when unmatching git tags`() { assertTracerVersion( - projectDir, - "0.1.0-SNAPSHOT", + expectedVersion = "0.1.0-SNAPSHOT", beforeGradle = { - exec(projectDir, "git", "init", "--initial-branch", "main") - exec(projectDir, "git", "config", "user.email", "test@datadoghq.com") - exec(projectDir, "git", "config", "user.name", "Test") - exec(projectDir, "git", "add", "-A") - exec(projectDir, "git", "commit", "-m", "A commit") - exec(projectDir, "git", "tag", "something1.40.1", "-m", "Not our tag") - } + initGitRepo() + exec("git", "tag", "something1.40.1", "-m", "Not our tag") + }, ) } @Test - fun `should use exact version when on tag`(@TempDir projectDir: File) { + fun `should use exact version when on tag`() { assertTracerVersion( - projectDir, - "1.52.0", + expectedVersion = "1.52.0", beforeGradle = { - exec(projectDir, "git", "init", "--initial-branch", "main") - exec(projectDir, "git", "config", "user.email", "test@datadoghq.com") - exec(projectDir, "git", "config", "user.name", "Test") - exec(projectDir, "git", "add", "-A") - exec(projectDir, "git", "commit", "-m", "A commit") - exec(projectDir, "git", "tag", "v1.52.0", "-m", "") - } + initGitRepo() + exec("git", "tag", "v1.52.0", "-m", "") + }, ) } @Test - fun `should increment minor and mark dirtiness`(@TempDir projectDir: File) { + fun `should increment minor and mark dirtiness`() { assertTracerVersion( - projectDir, - "1.53.0-SNAPSHOT-DIRTY", + expectedVersion = "1.53.0-SNAPSHOT-DIRTY", beforeGradle = { - println("Setting up git repository in $projectDir") - File(projectDir, "gradle.properties").writeText( - """ - tracerVersion.dirtiness=true - """.trimIndent() - ) - - exec(projectDir, "git", "init", "--initial-branch", "main") - exec(projectDir, "git", "config", "user.email", "test@datadoghq.com") - exec(projectDir, "git", "config", "user.name", "Test") - exec(projectDir, "git", "add", "-A") - exec(projectDir, "git", "commit", "-m", "A commit") - exec(projectDir, "git", "tag", "v1.52.0", "-m", "") - - File(projectDir, "settings.gradle.kts").appendText( - """ - - // uncommitted change this file, - """.trimIndent() - ) - } + writeGradleProperties("tracerVersion.dirtiness=true") + initGitRepo() + exec("git", "tag", "v1.52.0", "-m", "") + writeSettings("// uncommitted change this file, ", append = true) + }, ) } @Test - fun `should increment minor with added commits after version tag`(@TempDir projectDir: File) { + fun `should increment minor with added commits after version tag`() { assertTracerVersion( - projectDir, - "1.53.0-SNAPSHOT", + expectedVersion = "1.53.0-SNAPSHOT", beforeGradle = { - exec(projectDir, "git", "init", "--initial-branch", "main") - exec(projectDir, "git", "config", "user.email", "test@datadoghq.com") - exec(projectDir, "git", "config", "user.name", "Test") - exec(projectDir, "git", "add", "-A") - exec(projectDir, "git", "commit", "-m", "A commit") - exec(projectDir, "git", "tag", "v1.52.0", "-m", "") - - File(projectDir, "settings.gradle.kts").appendText( - """ - - // Committed change this file, - """.trimIndent() - ) - exec(projectDir, "git", "commit", "-am", "Another commit") - } + initGitRepo() + exec("git", "tag", "v1.52.0", "-m", "") + writeSettings("// Committed change this file, ", append = true) + exec("git", "commit", "-am", "Another commit") + }, ) } @Test - fun `should increment minor with snapshot and dirtiness with added commits after version tag and dirty`(@TempDir projectDir: File) { + fun `should increment minor with snapshot and dirtiness with added commits after version tag and dirty`() { assertTracerVersion( - projectDir, - "1.53.0-SNAPSHOT-DIRTY", + expectedVersion = "1.53.0-SNAPSHOT-DIRTY", beforeGradle = { - File(projectDir, "gradle.properties").writeText( - """ - tracerVersion.dirtiness=true - """.trimIndent() - ) - - exec(projectDir, "git", "init", "--initial-branch", "main") - exec(projectDir, "git", "config", "user.email", "test@datadoghq.com") - exec(projectDir, "git", "config", "user.name", "Test") - exec(projectDir, "git", "add", "-A") - exec(projectDir, "git", "commit", "-m", "A commit") - exec(projectDir, "git", "tag", "v1.52.0", "-m", "") - - val settingsFile = File(projectDir, "settings.gradle.kts") - settingsFile.appendText( - """ - - // uncommitted change - """.trimIndent() - ) - - exec(projectDir, "git", "commit", "-am", "Another commit") - - settingsFile.appendText( - """ - // An uncommitted modification - """.trimIndent() - ) - } + writeGradleProperties("tracerVersion.dirtiness=true") + initGitRepo() + exec("git", "tag", "v1.52.0", "-m", "") + writeSettings("// uncommitted change ", append = true) + exec("git", "commit", "-am", "Another commit") + writeSettings("// An uncommitted modification", append = true) + }, ) } @Test - fun `should increment patch on release branch and no patch release tag`(@TempDir projectDir: File) { + fun `should increment patch on release branch and no patch release tag`() { assertTracerVersion( - projectDir, - "1.52.1-SNAPSHOT", + expectedVersion = "1.52.1-SNAPSHOT", beforeGradle = { - exec(projectDir, "git", "init", "--initial-branch", "main") - exec(projectDir, "git", "config", "user.email", "test@datadoghq.com") - exec(projectDir, "git", "config", "user.name", "Test") - exec(projectDir, "git", "add", "-A") - exec(projectDir, "git", "commit", "-m", "A commit") - exec(projectDir, "git", "tag", "v1.52.0", "-m", "") - - val settingsFile = File(projectDir, "settings.gradle.kts") - settingsFile.appendText( - """ - - // Committed change - """.trimIndent() - ) - - exec(projectDir, "git", "commit", "-am", "Another commit") - exec(projectDir, "git", "switch", "-c", "release/v1.52.x") - } + initGitRepo() + exec("git", "tag", "v1.52.0", "-m", "") + writeSettings("// Committed change ", append = true) + exec("git", "commit", "-am", "Another commit") + exec("git", "switch", "-c", "release/v1.52.x") + }, ) } @Test - fun `should increment patch on release branch and with previous patch release tag`(@TempDir projectDir: File) { + fun `should increment patch on release branch and with previous patch release tag`() { assertTracerVersion( - projectDir, - "1.52.2-SNAPSHOT", + expectedVersion = "1.52.2-SNAPSHOT", beforeGradle = { - exec(projectDir, "git", "init", "--initial-branch", "main") - exec(projectDir, "git", "config", "user.email", "test@datadoghq.com") - exec(projectDir, "git", "config", "user.name", "Test") - exec(projectDir, "git", "add", "-A") - exec(projectDir, "git", "commit", "-m", "A commit") - exec(projectDir, "git", "tag", "v1.52.0", "-m", "") - exec(projectDir, "git", "switch", "-c", "release/v1.52.x") - - val settingsFile = File(projectDir, "settings.gradle.kts") - settingsFile.appendText( - """ - - // Committed change - """.trimIndent() - ) - exec(projectDir, "git", "commit", "-am", "Another commit") - exec(projectDir, "git", "tag", "v1.52.1", "-m", "") + initGitRepo() + exec("git", "tag", "v1.52.0", "-m", "") + exec("git", "switch", "-c", "release/v1.52.x") + writeSettings("// Committed change ", append = true) + exec("git", "commit", "-am", "Another commit") + exec("git", "tag", "v1.52.1", "-m", "") + writeSettings("// Another committed change ", append = true) + exec("git", "commit", "-am", "Another commit") + }, + ) + } - settingsFile.appendText( - """ - - // Another committed change - """.trimIndent() - ) - exec(projectDir, "git", "commit", "-am", "Another commit") - } + @Test + fun `should compute version on worktrees`(@TempDir workTreeDir: File) { + assertTracerVersion( + expectedVersion = "1.53.0-SNAPSHOT", + workingDirectory = workTreeDir, + beforeGradle = { + initGitRepo() + exec("git", "tag", "v1.52.0", "-m", "") + exec("git", "commit", "-m", "Initial commit", "--allow-empty") + exec("git", "worktree", "add", workTreeDir.absolutePath) + // Write into workTreeDir, not projectDir, so the next commit has changes to pick up. + File(workTreeDir, "settings.gradle.kts").appendText("\n// Committed change this file, ") + exec(workTreeDir, "git", "commit", "-am", "Another commit") + }, ) } @Test - fun `should compute version on worktrees`(@TempDir projectDir: File, @TempDir workTreeDir: File) { + fun `should increment minor from merged main version tag on feature branch`() { assertTracerVersion( - projectDir, - "1.53.0-SNAPSHOT", + expectedVersion = "1.53.0-SNAPSHOT", beforeGradle = { - exec(projectDir, "git", "init", "--initial-branch", "main") - exec(projectDir, "git", "config", "user.email", "test@datadoghq.com") - exec(projectDir, "git", "config", "user.name", "Test") - exec(projectDir, "git", "add", "-A") - exec(projectDir, "git", "commit", "-m", "A commit") - exec(projectDir, "git", "tag", "v1.52.0", "-m", "") + initGitRepo() + exec("git", "tag", "v1.50.0", "-m", "") + exec("git", "switch", "-c", "feature") + writeFile("feature.txt", "feature") + exec("git", "add", "feature.txt") + exec("git", "commit", "-m", "Feature commit") + exec("git", "switch", "main") + writeFile("main.txt", "main") + exec("git", "add", "main.txt") + exec("git", "commit", "-m", "Main commit") + exec("git", "tag", "v1.52.0", "-m", "") + exec("git", "switch", "feature") + exec("git", "merge", "main", "--no-edit") + }, + ) + } - exec(projectDir, "git", "commit", "-m", "Initial commit", "--allow-empty") - exec(projectDir, "git", "worktree", "add", workTreeDir.absolutePath) - // happening on the worktree - File(workTreeDir, "settings.gradle.kts").appendText( - """ - - // Committed change this file, - """.trimIndent() - ) - exec(workTreeDir, "git", "commit", "-am", "Another commit") + @Test + fun `should increment patch from first parent on release branch after main merge`() { + assertTracerVersion( + expectedVersion = "1.52.1-SNAPSHOT", + beforeGradle = { + initGitRepo() + exec("git", "tag", "v1.52.0", "-m", "") + exec("git", "switch", "-c", "release/v1.52.x") + writeFile("release.txt", "release") + exec("git", "add", "release.txt") + exec("git", "commit", "-m", "Release commit") + exec("git", "switch", "main") + writeFile("main.txt", "main") + exec("git", "add", "main.txt") + exec("git", "commit", "-m", "Main commit") + exec("git", "tag", "v1.53.0", "-m", "") + exec("git", "switch", "release/v1.52.x") + exec("git", "merge", "main", "--no-edit") }, - workingDirectory = workTreeDir ) } private fun assertTracerVersion( - projectDir: File, expectedVersion: String, - beforeGradle: () -> Unit = {}, workingDirectory: File = projectDir, + beforeGradle: VersionPluginsFixture.() -> Unit = {}, ) { - File(projectDir, "settings.gradle.kts").writeText( + writeSettings( """ rootProject.name = "test-project" - """.trimIndent() + """ ) - File(projectDir, "build.gradle.kts").writeText( + + writeRootProject( """ plugins { id("dd-trace-java.tracer-version") } - + tasks.register("printVersion") { logger.quiet(project.version.toString()) } group = "datadog.tracer.version.test" - """.trimIndent() + """ ) beforeGradle() - val buildResult = GradleRunner.create() - .forwardOutput() - // .withGradleVersion(gradleVersion) // Use current gradle version - .withPluginClasspath() - .withArguments("printVersion", "--quiet") - .withProjectDir(workingDirectory) - // .withDebug(true) - .build() - - assertEquals(expectedVersion, buildResult.output.lines().first()) - } - - private fun exec(workingDirectory: File, vararg args: String) { - val exitCode = ProcessBuilder() - .command(*args) - .directory(workingDirectory) - .inheritIO() - .start() - .waitFor() + val buildResult = run("printVersion", "--quiet", gradleProjectDir = workingDirectory) - if (exitCode != 0) { - throw IOException(String.format("Process failed: %s Exit code %d", args.joinToString(" "), exitCode)) - } + assertThat(buildResult.output.lines().first()).isEqualTo(expectedVersion) } } diff --git a/buildSrc/src/test/kotlin/datadog/gradle/plugin/version/VersionPluginsFixture.kt b/buildSrc/src/test/kotlin/datadog/gradle/plugin/version/VersionPluginsFixture.kt new file mode 100644 index 00000000000..e33bc75cf40 --- /dev/null +++ b/buildSrc/src/test/kotlin/datadog/gradle/plugin/version/VersionPluginsFixture.kt @@ -0,0 +1,33 @@ +package datadog.gradle.plugin.version + +import datadog.gradle.plugin.GradleFixture +import java.io.File +import java.io.IOException + +open class VersionPluginsFixture : GradleFixture() { + fun exec(workingDirectory: File, vararg args: String) { + val exitCode = ProcessBuilder() + .command(*args) + .directory(workingDirectory) + .inheritIO() + .start() + .waitFor() + if (exitCode != 0) { + throw IOException("Process failed: ${args.joinToString(" ")} (exit code $exitCode)") + } + } + + fun exec(vararg args: String) = exec(projectDir, *args) + + fun initGitRepo(workingDirectory: File = projectDir) { + exec(workingDirectory, "git", "init", "--initial-branch", "main") + exec(workingDirectory, "git", "config", "user.email", "test@datadoghq.com") + exec(workingDirectory, "git", "config", "user.name", "Test") + exec(workingDirectory, "git", "add", "-A") + exec(workingDirectory, "git", "commit", "-m", "A commit") + } + + val generatedVersionFile: File get() = file("build/generated/version/my-lib.version") + + val builtResourceVersionFile: File get() = file("build/resources/main/my-lib.version") +} diff --git a/buildSrc/src/test/kotlin/datadog/gradle/plugin/version/WriteVersionFilePluginTest.kt b/buildSrc/src/test/kotlin/datadog/gradle/plugin/version/WriteVersionFilePluginTest.kt new file mode 100644 index 00000000000..f7194d83f6c --- /dev/null +++ b/buildSrc/src/test/kotlin/datadog/gradle/plugin/version/WriteVersionFilePluginTest.kt @@ -0,0 +1,158 @@ +package datadog.gradle.plugin.version + +import org.assertj.core.api.Assertions.assertThat +import org.gradle.testkit.runner.BuildResult +import org.gradle.testkit.runner.TaskOutcome +import org.junit.jupiter.api.Test + +class WriteVersionFilePluginTest : VersionPluginsFixture() { + + @Test + fun `writes version file in version~hash format`() { + // task truncation convention is 10 + assertVersionFile( + expectedContentRegex = "1\\.2\\.3~[0-9a-f]{10}", + beforeGradle = { + initGitRepo() + }, + ) + } + + @Test + fun `version and gitHash properties can be overridden`() { + assertVersionFile( + expectedContentRegex = "9.9.9~deadbeef", + beforeGradle = { + writeRootProject( + """ + + tasks.named("writeVersionNumberFile") { + version.set("9.9.9") + gitHash.set("deadbeef") + } + """, + append = true, + ) + }, + ) + } + + @Test + fun `task overwrites existing version file`() { + assertVersionFile( + expectedContentRegex = "1.2.3~abc12345", + beforeGradle = { + writeRootProject( + """ + + tasks.named("writeVersionNumberFile") { + gitHash.set("abc12345") + } + """, + append = true, + ) + generatedVersionFile.run { + parentFile.mkdirs() + writeText("stale-version") + } + }, + ) + } + + @Test + fun `version file generation is wired into main resources`() { + assertVersionFile( + expectedContentRegex = "1.2.3~abc12345", + task = "processResources", + beforeGradle = { + writeRootProject( + """ + + tasks.named("writeVersionNumberFile") { + gitHash.set("abc12345") + } + """, + append = true, + ) + }, + ) + + assertThat(builtResourceVersionFile).exists() + } + + @Test + fun `task is up-to-date on second run`() { + assertVersionFile( + expectedContentRegex = "1.2.3~abc12345", + beforeGradle = { + writeRootProject( + """ + + tasks.named("writeVersionNumberFile") { + gitHash.set("abc12345") + } + """, + append = true, + ) + }, + ) + + val result = run("writeVersionNumberFile") + + assertThat(result.task(":writeVersionNumberFile")?.outcome).isEqualTo(TaskOutcome.UP_TO_DATE) + } + + @Test + fun `clean deletes version file`() { + assertVersionFile( + expectedContentRegex = "1.2.3~abc12345", + beforeGradle = { + writeRootProject( + """ + + tasks.named("writeVersionNumberFile") { + gitHash.set("abc12345") + } + """, + append = true, + ) + }, + ) + val versionFile = generatedVersionFile + + val result = run("clean") + + assertThat(result.task(":clean")?.outcome).isEqualTo(TaskOutcome.SUCCESS) + assertThat(versionFile).doesNotExist() + } + + private fun assertVersionFile( + expectedContentRegex: String, + task: String = ":writeVersionNumberFile", + beforeGradle: VersionPluginsFixture.() -> Unit = {}, + ): BuildResult { + writeSettings( + """ + rootProject.name = "my-lib" + """ + ) + writeRootProject( + """ + plugins { + id("dd-trace-java.version-file") + } + + version = "1.2.3" + """ + ) + beforeGradle() + + val buildResult = run(task) + val taskPath = if (task.startsWith(":")) task else ":$task" + + assertThat(buildResult.task(taskPath)?.outcome).isEqualTo(TaskOutcome.SUCCESS) + assertThat(generatedVersionFile).exists().isFile() + assertThat(generatedVersionFile.readText()).matches(expectedContentRegex) + return buildResult + } +} diff --git a/buildSrc/src/test/kotlin/datadog/gradle/sca/GhsaEnrichmentParserTest.kt b/buildSrc/src/test/kotlin/datadog/gradle/sca/GhsaEnrichmentParserTest.kt new file mode 100644 index 00000000000..79ff7255556 --- /dev/null +++ b/buildSrc/src/test/kotlin/datadog/gradle/sca/GhsaEnrichmentParserTest.kt @@ -0,0 +1,203 @@ +package datadog.gradle.sca + +import org.assertj.core.api.Assertions.assertThat +import org.assertj.core.api.Assertions.assertThatThrownBy +import org.junit.jupiter.api.Test + +class GhsaEnrichmentParserTest { + + private fun fixture(name: String): String = + GhsaEnrichmentParserTest::class.java + .getResourceAsStream("/sca/fixtures/$name")!! + .bufferedReader() + .readText() + + @Test + fun `single package entry produces one record`() { + val entries = GhsaEnrichmentParser.parse(fixture("GHSA-single-package.json")) + + assertThat(entries).hasSize(1) + val entry = entries[0] + assertThat(entry["vuln_id"]).isEqualTo("GHSA-single-package") + assertThat(entry["artifact"]).isEqualTo("com.fasterxml.jackson.core:jackson-databind") + assertThat(entry["version_ranges"]).isEqualTo(listOf("< 2.6.7.3", ">= 2.7.0, < 2.7.9.5")) + } + + @Test + fun `ghsa id is read from vulnerability id field in json`() { + val entries = GhsaEnrichmentParser.parse(fixture("GHSA-single-package.json")) + + assertThat(entries[0]["vuln_id"]).isEqualTo("GHSA-single-package") + } + + @Test + fun `class names are converted to JVM internal format with slashes`() { + val entries = GhsaEnrichmentParser.parse(fixture("GHSA-single-package.json")) + + @Suppress("UNCHECKED_CAST") + val symbols = entries[0]["symbols"] as List> + assertThat(symbols).hasSize(2) + assertThat(symbols.map { it["class"] }) + .containsExactly( + "com/fasterxml/jackson/databind/ObjectMapper", + "com/fasterxml/jackson/databind/ObjectReader", + ) + } + + @Test + fun `method field is always non-null`() { + val entries = GhsaEnrichmentParser.parse(fixture("GHSA-single-package.json")) + + @Suppress("UNCHECKED_CAST") + val symbols = entries[0]["symbols"] as List> + assertThat(symbols).allSatisfy { symbol -> assertThat(symbol["method"]).isNotNull() } + } + + @Test + fun `method name is extracted from target string`() { + val entries = GhsaEnrichmentParser.parse(fixture("GHSA-single-package.json")) + + @Suppress("UNCHECKED_CAST") + val symbols = entries[0]["symbols"] as List> + assertThat(symbols.map { it["method"] }).containsExactly("readValue", "readValue") + } + + @Test + fun `multi-package entry produces one record per artifact`() { + val entries = GhsaEnrichmentParser.parse(fixture("GHSA-multi-package.json")) + + assertThat(entries).hasSize(2) + assertThat(entries.map { it["artifact"] }) + .containsExactlyInAnyOrder( + "org.springframework.boot:spring-boot-starter-web", + "org.springframework:spring-webmvc", + ) + } + + @Test + fun `multi-package entries each have their own version ranges`() { + val entries = GhsaEnrichmentParser.parse(fixture("GHSA-multi-package.json")) + + val webEntry = + entries.first { it["artifact"] == "org.springframework.boot:spring-boot-starter-web" } + assertThat(webEntry["version_ranges"]).isEqualTo(listOf("< 2.5.12", ">= 2.6.0, < 2.6.6")) + + val mvcEntry = entries.first { it["artifact"] == "org.springframework:spring-webmvc" } + assertThat(mvcEntry["version_ranges"]) + .isEqualTo(listOf(">= 5.3.0, < 5.3.18", "< 5.2.20.RELEASE")) + } + + @Test + fun `multi-package entries can share the same symbols`() { + // In the new format each artifact entry is independent and may have its own targets. + // This fixture has two entries with identical targets; verifying that each parses them correctly. + val entries = GhsaEnrichmentParser.parse(fixture("GHSA-multi-package.json")) + + @Suppress("UNCHECKED_CAST") + val symbols0 = entries[0]["symbols"] as List> + @Suppress("UNCHECKED_CAST") + val symbols1 = entries[1]["symbols"] as List> + assertThat(symbols0.map { it["class"] }) + .containsExactlyInAnyOrder( + "org/springframework/stereotype/Controller", + "org/springframework/web/bind/annotation/RestController", + ) + assertThat(symbols0.map { it["class"] }).isEqualTo(symbols1.map { it["class"] }) + } + + @Test + fun `targets from different packages within one entry produce independent symbol entries`() { + // Models GHSA-cwq5-8pvq-j65j (Zserio): a single entry has targets from zserio.runtime.array + // and zserio.runtime.io (two different packages under the same artifact). + val entries = GhsaEnrichmentParser.parse(fixture("GHSA-cross-package.json")) + + assertThat(entries).hasSize(1) + assertThat(entries[0]["artifact"]).isEqualTo("io.github.ndsev:zserio-runtime") + + @Suppress("UNCHECKED_CAST") + val symbols = entries[0]["symbols"] as List> + assertThat(symbols).hasSize(2) + assertThat(symbols.map { it["class"] }) + .containsExactlyInAnyOrder( + "zserio/runtime/array/Array", + "zserio/runtime/io/ByteArrayBitStreamReader", + ) + assertThat(symbols.map { it["method"] }).containsExactlyInAnyOrder("read", "readBitBuffer") + } + + @Test + fun `non-maven language entries are ignored`() { + val entries = GhsaEnrichmentParser.parse(fixture("GHSA-mixed-languages.json")) + + assertThat(entries).hasSize(1) + assertThat(entries[0]["artifact"]).isEqualTo("com.thoughtworks.xstream:xstream") + } + + @Test + fun `entries with empty targets produce no output`() { + val entries = GhsaEnrichmentParser.parse(fixture("GHSA-empty-symbols.json")) + + assertThat(entries).isEmpty() + } + + @Test + fun `targets without colon separator are silently skipped`() { + val json = + """[{ + "targets": ["noColonHere", "valid.pkg:Class.method"], + "lang": "maven", + "dependency_name": "com.example:lib", + "package_versions": ["< 1.0.0"], + "vulnerability": {"id": "GHSA-malformed-1", "severity": "LOW", "description": ""} + }]""" + val entries = GhsaEnrichmentParser.parse(json) + + assertThat(entries).hasSize(1) + @Suppress("UNCHECKED_CAST") + val symbols = entries[0]["symbols"] as List> + assertThat(symbols).hasSize(1) + assertThat(symbols[0]["class"]).isEqualTo("valid/pkg/Class") + assertThat(symbols[0]["method"]).isEqualTo("method") + } + + @Test + fun `targets without dot after colon are silently skipped`() { + val json = + """[{ + "targets": ["pkg:ClassWithNoMethod", "pkg:Class.method"], + "lang": "maven", + "dependency_name": "com.example:lib", + "package_versions": ["< 1.0.0"], + "vulnerability": {"id": "GHSA-malformed-2", "severity": "LOW", "description": ""} + }]""" + val entries = GhsaEnrichmentParser.parse(json) + + assertThat(entries).hasSize(1) + @Suppress("UNCHECKED_CAST") + val symbols = entries[0]["symbols"] as List> + assertThat(symbols).hasSize(1) + assertThat(symbols[0]["method"]).isEqualTo("method") + } + + @Test + fun `entry with all malformed targets produces no output`() { + val json = + """[{ + "targets": ["noColon", "alsoNoColon"], + "lang": "maven", + "dependency_name": "com.example:lib", + "package_versions": ["< 1.0.0"], + "vulnerability": {"id": "GHSA-all-malformed", "severity": "LOW", "description": ""} + }]""" + val entries = GhsaEnrichmentParser.parse(json) + + assertThat(entries).isEmpty() + } + + @Test + fun `non-json-array input throws IllegalArgumentException`() { + assertThatThrownBy { GhsaEnrichmentParser.parse("""{"lang": "maven"}""") } + .isInstanceOf(IllegalArgumentException::class.java) + .hasMessageContaining("must be a JSON array") + } +} diff --git a/buildSrc/src/test/resources/sca/fixtures/GHSA-cross-package.json b/buildSrc/src/test/resources/sca/fixtures/GHSA-cross-package.json new file mode 100644 index 00000000000..c824f22b3cc --- /dev/null +++ b/buildSrc/src/test/resources/sca/fixtures/GHSA-cross-package.json @@ -0,0 +1,18 @@ +[ + { + "targets": [ + "zserio.runtime.array:Array.read", + "zserio.runtime.io:ByteArrayBitStreamReader.readBitBuffer" + ], + "lang": "maven", + "dependency_name": "io.github.ndsev:zserio-runtime", + "package_versions": [ + "< 2.18.1" + ], + "vulnerability": { + "id": "GHSA-cross-package", + "severity": "HIGH", + "description": "Entry with targets from different packages within the same artifact" + } + } +] diff --git a/buildSrc/src/test/resources/sca/fixtures/GHSA-empty-symbols.json b/buildSrc/src/test/resources/sca/fixtures/GHSA-empty-symbols.json new file mode 100644 index 00000000000..b4bba16c93e --- /dev/null +++ b/buildSrc/src/test/resources/sca/fixtures/GHSA-empty-symbols.json @@ -0,0 +1,15 @@ +[ + { + "targets": [], + "lang": "maven", + "dependency_name": "org.example:some-lib", + "package_versions": [ + "< 1.0.0" + ], + "vulnerability": { + "id": "GHSA-empty-symbols", + "severity": "LOW", + "description": "Entry with empty targets — should produce no output" + } + } +] diff --git a/buildSrc/src/test/resources/sca/fixtures/GHSA-mixed-languages.json b/buildSrc/src/test/resources/sca/fixtures/GHSA-mixed-languages.json new file mode 100644 index 00000000000..a065e497e43 --- /dev/null +++ b/buildSrc/src/test/resources/sca/fixtures/GHSA-mixed-languages.json @@ -0,0 +1,32 @@ +[ + { + "targets": [ + "requests.api:get.get" + ], + "lang": "python", + "dependency_name": "requests", + "package_versions": [ + "< 2.28.0" + ], + "vulnerability": { + "id": "GHSA-mixed-languages", + "severity": "LOW", + "description": "Python entry — should be ignored by the Maven filter" + } + }, + { + "targets": [ + "com.thoughtworks.xstream:XStream.fromXML" + ], + "lang": "maven", + "dependency_name": "com.thoughtworks.xstream:xstream", + "package_versions": [ + "< 1.4.16" + ], + "vulnerability": { + "id": "GHSA-mixed-languages", + "severity": "HIGH", + "description": "JVM Maven entry — should be parsed" + } + } +] diff --git a/buildSrc/src/test/resources/sca/fixtures/GHSA-multi-package.json b/buildSrc/src/test/resources/sca/fixtures/GHSA-multi-package.json new file mode 100644 index 00000000000..7d681a3d63c --- /dev/null +++ b/buildSrc/src/test/resources/sca/fixtures/GHSA-multi-package.json @@ -0,0 +1,36 @@ +[ + { + "targets": [ + "org.springframework.stereotype:Controller.handleRequest", + "org.springframework.web.bind.annotation:RestController.handleRequest" + ], + "lang": "maven", + "dependency_name": "org.springframework.boot:spring-boot-starter-web", + "package_versions": [ + "< 2.5.12", + ">= 2.6.0, < 2.6.6" + ], + "vulnerability": { + "id": "GHSA-multi-package", + "severity": "HIGH", + "description": "Test fixture for multi-artifact GHSA entry (two separate array items)" + } + }, + { + "targets": [ + "org.springframework.stereotype:Controller.handleRequest", + "org.springframework.web.bind.annotation:RestController.handleRequest" + ], + "lang": "maven", + "dependency_name": "org.springframework:spring-webmvc", + "package_versions": [ + ">= 5.3.0, < 5.3.18", + "< 5.2.20.RELEASE" + ], + "vulnerability": { + "id": "GHSA-multi-package", + "severity": "HIGH", + "description": "Test fixture for multi-artifact GHSA entry (two separate array items)" + } + } +] diff --git a/buildSrc/src/test/resources/sca/fixtures/GHSA-single-package.json b/buildSrc/src/test/resources/sca/fixtures/GHSA-single-package.json new file mode 100644 index 00000000000..3e1e13af95e --- /dev/null +++ b/buildSrc/src/test/resources/sca/fixtures/GHSA-single-package.json @@ -0,0 +1,19 @@ +[ + { + "targets": [ + "com.fasterxml.jackson.databind:ObjectMapper.readValue", + "com.fasterxml.jackson.databind:ObjectReader.readValue" + ], + "lang": "maven", + "dependency_name": "com.fasterxml.jackson.core:jackson-databind", + "package_versions": [ + "< 2.6.7.3", + ">= 2.7.0, < 2.7.9.5" + ], + "vulnerability": { + "id": "GHSA-single-package", + "severity": "HIGH", + "description": "Test fixture for single-package GHSA entry" + } + } +] diff --git a/communication/build.gradle.kts b/communication/build.gradle.kts index b5f31fadb68..afa25ef5a99 100644 --- a/communication/build.gradle.kts +++ b/communication/build.gradle.kts @@ -36,48 +36,48 @@ dependencies { ) } -val minimumBranchCoverage by extra(0.5) -val minimumInstructionCoverage by extra(0.8) -val excludedClassesCoverage by extra( - listOf( - "datadog.communication.ddagent.ExternalAgentLauncher", - "datadog.communication.ddagent.ExternalAgentLauncher.NamedPipeHealthCheck", - "datadog.communication.ddagent.SharedCommunicationObjects.FixedConfigUrlSupplier", - "datadog.communication.ddagent.SharedCommunicationObjects.RetryConfigUrlSupplier", - "datadog.communication.http.OkHttpUtils", - "datadog.communication.http.OkHttpUtils.1", - "datadog.communication.http.OkHttpUtils.ByteBufferRequestBody", - "datadog.communication.http.OkHttpUtils.CustomListener", - "datadog.communication.http.OkHttpUtils.GZipByteBufferRequestBody", - "datadog.communication.http.OkHttpUtils.GZipRequestBodyDecorator", - "datadog.communication.http.OkHttpUtils.JsonRequestBody", - "datadog.communication.BackendApiFactory", - "datadog.communication.BackendApiFactory.Intake", - "datadog.communication.EvpProxyApi", - "datadog.communication.IntakeApi", - "datadog.communication.util.IOUtils", - "datadog.communication.util.IOUtils.1", - ) +extra["minimumBranchCoverage"] = 0.5 +extra["minimumInstructionCoverage"] = 0.8 +extra["excludedClassesCoverage"] = listOf( + "okhttp3.internal.PatchUtil", + "okhttp3.internal.PatchUtil.1", + "okhttp3.internal.PatchUtil.2", + "okhttp3.internal.platform.PatchPlatform", + "datadog.communication.ddagent.ExternalAgentLauncher", + "datadog.communication.ddagent.NoopFeaturesDiscovery", + "datadog.communication.ddagent.ExternalAgentLauncher.NamedPipeHealthCheck", + "datadog.communication.ddagent.SharedCommunicationObjects.FixedConfigUrlSupplier", + "datadog.communication.ddagent.SharedCommunicationObjects.RetryConfigUrlSupplier", + "datadog.communication.http.OkHttpUtils", + "datadog.communication.http.OkHttpUtils.1", + "datadog.communication.http.OkHttpUtils.ByteBufferRequestBody", + "datadog.communication.http.OkHttpUtils.CustomListener", + "datadog.communication.http.OkHttpUtils.GZipByteBufferRequestBody", + "datadog.communication.http.OkHttpUtils.GZipRequestBodyDecorator", + "datadog.communication.http.OkHttpUtils.JsonRequestBody", + "datadog.communication.BackendApiFactory", + "datadog.communication.BackendApiFactory.Intake", + "datadog.communication.EvpProxyApi", + "datadog.communication.IntakeApi", + "datadog.communication.util.IOUtils", + "datadog.communication.util.IOUtils.1", + "datadog.communication.http.SocketUtils", ) -val excludedClassesBranchCoverage by extra( - listOf( - "datadog.communication.ddagent.TracerVersion", - "datadog.communication.BackendApiFactory", - "datadog.communication.EvpProxyApi", - "datadog.communication.IntakeApi", - ) +extra["excludedClassesBranchCoverage"] = listOf( + "datadog.communication.ddagent.TracerVersion", + "datadog.communication.BackendApiFactory", + "datadog.communication.EvpProxyApi", + "datadog.communication.IntakeApi", ) -val excludedClassesInstructionCoverage by extra( - listOf( - // can't reach the error condition now - "datadog.communication.fleet.FleetServiceImpl", - "datadog.communication.ddagent.SharedCommunicationObjects", - "datadog.communication.ddagent.TracerVersion", - "datadog.communication.BackendApiFactory", - "datadog.communication.BackendApiFactory.Intake", - "datadog.communication.EvpProxyApi", - "datadog.communication.IntakeApi", - "datadog.communication.util.IOUtils", - "datadog.communication.util.IOUtils.1", - ) +extra["excludedClassesInstructionCoverage"] = listOf( + // can't reach the error condition now + "datadog.communication.fleet.FleetServiceImpl", + "datadog.communication.ddagent.SharedCommunicationObjects", + "datadog.communication.ddagent.TracerVersion", + "datadog.communication.BackendApiFactory", + "datadog.communication.BackendApiFactory.Intake", + "datadog.communication.EvpProxyApi", + "datadog.communication.IntakeApi", + "datadog.communication.util.IOUtils", + "datadog.communication.util.IOUtils.1", ) diff --git a/communication/gradle.lockfile b/communication/gradle.lockfile index b8c84ea04db..02db739f842 100644 --- a/communication/gradle.lockfile +++ b/communication/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :communication:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -14,15 +15,15 @@ com.fasterxml.jackson.core:jackson-annotations:2.9.0=testCompileClasspath,testRu com.fasterxml.jackson.core:jackson-core:2.9.9=testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-databind:2.9.9.3=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -40,8 +41,8 @@ de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntime io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.12=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -65,10 +66,10 @@ org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testCompileClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -85,14 +86,17 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt org.ow2.asm:asm-commons:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt org.ow2.asm:asm-tree:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt org.ow2.asm:asm:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/communication/src/main/java/datadog/communication/ddagent/DDAgentFeaturesDiscovery.java b/communication/src/main/java/datadog/communication/ddagent/DDAgentFeaturesDiscovery.java index 10c1e57efd7..16be2e84b98 100644 --- a/communication/src/main/java/datadog/communication/ddagent/DDAgentFeaturesDiscovery.java +++ b/communication/src/main/java/datadog/communication/ddagent/DDAgentFeaturesDiscovery.java @@ -101,6 +101,7 @@ private static class State { String version; String telemetryProxyEndpoint; Set peerTags = emptySet(); + String orgPropagationMarker; long lastTimeDiscovered; } @@ -184,10 +185,11 @@ private void doDiscovery(State newState) { if (log.isDebugEnabled()) { log.debug( - "discovered traceEndpoint={}, metricsEndpoint={}, supportsDropping={}, supportsLongRunning={}, dataStreamsEndpoint={}, configEndpoint={}, logEndpoint={}, snapshotEndpoint={}, diagnosticsEndpoint={}, evpProxyEndpoint={}, telemetryProxyEndpoint={}", + "discovered traceEndpoint={}, metricsEndpoint={}, supportsDropping={}, supportsClientSideStats={}, supportsLongRunning={}, dataStreamsEndpoint={}, configEndpoint={}, logEndpoint={}, snapshotEndpoint={}, diagnosticsEndpoint={}, evpProxyEndpoint={}, telemetryProxyEndpoint={}", newState.traceEndpoint, newState.metricsEndpoint, newState.supportsDropping, + newState.supportsClientSideStats, newState.supportsLongRunning, newState.dataStreamsEndpoint, newState.configEndpoint, @@ -316,6 +318,8 @@ private boolean processInfoResponse(State newState, String response) { ? unmodifiableSet(new HashSet<>((List) peer_tags)) : emptySet(); } + Object opm = map.get("org_prop_marker"); + newState.orgPropagationMarker = (opm instanceof String) ? (String) opm : null; try { newState.state = Strings.sha256(response); } catch (Throwable ex) { @@ -453,6 +457,10 @@ public String state() { return discoveryState.state; } + public String getOrgPropagationMarker() { + return discoveryState.orgPropagationMarker; + } + @Override public boolean active() { return supportsMetrics(); diff --git a/communication/src/main/java/datadog/communication/serialization/FlushingBuffer.java b/communication/src/main/java/datadog/communication/serialization/FlushingBuffer.java index 332434ad46a..e3087bd5f27 100644 --- a/communication/src/main/java/datadog/communication/serialization/FlushingBuffer.java +++ b/communication/src/main/java/datadog/communication/serialization/FlushingBuffer.java @@ -1,5 +1,6 @@ package datadog.communication.serialization; +import datadog.trace.api.internal.VisibleForTesting; import java.nio.ByteBuffer; public final class FlushingBuffer implements StreamingBuffer { @@ -106,7 +107,7 @@ public void reset() { mark = 0; } - // for tests only + @VisibleForTesting int getMessageCount() { return messageCount; } diff --git a/communication/src/main/java/datadog/communication/serialization/GenerationalUtf8Cache.java b/communication/src/main/java/datadog/communication/serialization/GenerationalUtf8Cache.java index 036abfe6e79..099ff56e0e0 100644 --- a/communication/src/main/java/datadog/communication/serialization/GenerationalUtf8Cache.java +++ b/communication/src/main/java/datadog/communication/serialization/GenerationalUtf8Cache.java @@ -2,6 +2,7 @@ import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.nio.charset.StandardCharsets; +import javax.annotation.concurrent.ThreadSafe; /** * 2-level generational cache of UTF8 values - primarily intended to be used for tag values @@ -62,6 +63,7 @@ * calling ValueUtf8Cache#reclibrate will adjust promotion thresholds to * provide better cache utilization. */ +@ThreadSafe @SuppressFBWarnings( value = "IS2_INCONSISTENT_SYNC", justification = @@ -85,10 +87,10 @@ public final class GenerationalUtf8Cache implements EncodingCache { static final int MAX_ENTRY_LEN = 256; - private final CacheEntry[] edenEntries; + final CacheEntry[] edenEntries; private final int[] edenMarkers; - private final CacheEntry[] tenuredEntries; + final CacheEntry[] tenuredEntries; private long accessTimeMs; private double promotionThreshold = INITIAL_PROMOTION_THRESHOLD; @@ -120,7 +122,7 @@ public GenerationalUtf8Cache(int capacity) { public GenerationalUtf8Cache(int edenCapacity, int tenuredCapacity) { this.accessTimeMs = System.currentTimeMillis(); - int edenSize = Caching.cacheSizeFor(Math.min(tenuredCapacity, MAX_EDEN_CAPACITY)); + int edenSize = Caching.cacheSizeFor(Math.min(edenCapacity, MAX_EDEN_CAPACITY)); this.edenEntries = new CacheEntry[edenSize]; this.edenMarkers = new int[edenSize]; @@ -136,14 +138,14 @@ public int tenuredCapacity() { return this.tenuredEntries.length; } - /** Updates access time used @link {@link #getUtf8(String, String)} to the provided value */ + /** Updates the access time used by {@link #getUtf8(String)} to the provided value. */ @SuppressFBWarnings("AT_NONATOMIC_64BIT_PRIMITIVE") public void updateAccessTime(long accessTimeMs) { this.accessTimeMs = accessTimeMs; } /** Updates access time to the @link {@link System#currentTimeMillis()} */ - public void refreshAcessTime() { + public void refreshAccessTime() { this.updateAccessTime(System.currentTimeMillis()); } @@ -215,37 +217,46 @@ public final byte[] getUtf8(String value, long accessTimeMs) { if (value.length() > MAX_ENTRY_LEN) return CacheEntry.utf8(value); int adjHash = Caching.adjHash(value); - long lookupTimeMs = this.accessTimeMs; CacheEntry[] tenuredEntries = this.tenuredEntries; int matchingTenuredIndex = lookupEntryIndex(tenuredEntries, MAX_TENURED_PROBES, adjHash, value); if (matchingTenuredIndex != -1) { + // The slot can be mutated concurrently between the lookup and this read: nulled (recalibrate + // purge / eviction) or reassigned to a *different* value. CacheEntry identity is immutable + // (adjHash/value/valueUtf8 are final), so re-validate the loaded reference against the + // request; anything but a match means the slot moved out from under us, so fall through and + // treat it as a miss rather than NPE'ing (null) or returning another value's bytes + // (reassigned). CacheEntry tenuredEntry = tenuredEntries[matchingTenuredIndex]; + if (tenuredEntry != null && tenuredEntry.matches(adjHash, value)) { + tenuredEntry.hit(accessTimeMs); - tenuredEntry.hit(lookupTimeMs); - - this.tenuredHits += 1; - return tenuredEntry.utf8(); + this.tenuredHits += 1; + return tenuredEntry.utf8(); + } } CacheEntry[] edenEntries = this.edenEntries; int matchingEdenIndex = lookupEntryIndex(edenEntries, MAX_EDEN_PROBES, adjHash, value); if (matchingEdenIndex != -1) { + // Same lookup-then-read race as tenured, plus concurrent promotion nulls the slot (line + // below); re-validate the loaded reference and treat null-or-mismatch as a miss. CacheEntry edenEntry = edenEntries[matchingEdenIndex]; + if (edenEntry != null && edenEntry.matches(adjHash, value)) { + double hits = edenEntry.hit(accessTimeMs); + if (hits > this.promotionThreshold) { + // mark promoted first - to avoid racy insertions + this.promotions += 1; - double hits = edenEntry.hit(lookupTimeMs); - if (hits > this.promotionThreshold) { - // mark promoted first - to avoid racy insertions - this.promotions += 1; + boolean evicted = lruInsert(this.tenuredEntries, MAX_TENURED_PROBES, edenEntry); + if (evicted) this.tenuredEvictions += 1; - boolean evicted = lruInsert(this.tenuredEntries, MAX_TENURED_PROBES, edenEntry); - if (evicted) this.tenuredEvictions += 1; + edenEntries[matchingEdenIndex] = null; + } - edenEntries[matchingEdenIndex] = null; + this.edenHits += 1; + return edenEntry.utf8(); } - - this.edenHits += 1; - return edenEntry.utf8(); } boolean wasMarked = Caching.mark(this.edenMarkers, adjHash); @@ -256,8 +267,8 @@ public final byte[] getUtf8(String value, long accessTimeMs) { CacheEntry newEntry = new CacheEntry(adjHash, value); // First request was swallowed by marking, so double hit - newEntry.hit(lookupTimeMs); - newEntry.hit(lookupTimeMs); + newEntry.hit(accessTimeMs); + newEntry.hit(accessTimeMs); // search for empty slot or failing that the MFU entry int edenMfuIndex = findFirstAvailableOrMfuIndex(edenEntries, MAX_EDEN_PROBES, adjHash); @@ -346,7 +357,7 @@ static final boolean lfuInsert(CacheEntry[] entries, int numProbes, CacheEntry n } } - // If we get here, then we're evicted the LRU + // If we get here, then we're evicting the LFU entries[lfuIndex] = newEntry; return true; } diff --git a/communication/src/main/java/datadog/communication/serialization/SimpleUtf8Cache.java b/communication/src/main/java/datadog/communication/serialization/SimpleUtf8Cache.java index bb2dcf11f5d..8eb12d48465 100644 --- a/communication/src/main/java/datadog/communication/serialization/SimpleUtf8Cache.java +++ b/communication/src/main/java/datadog/communication/serialization/SimpleUtf8Cache.java @@ -1,6 +1,7 @@ package datadog.communication.serialization; import java.nio.charset.StandardCharsets; +import javax.annotation.concurrent.ThreadSafe; /** * A simple UTF8 cache - primarily intended for tag names @@ -41,6 +42,7 @@ * If there are no available slots in entries for a newly created CacheEntry, * a LFU: least frequently used eviction policy is used to free up a slot. */ +@ThreadSafe public final class SimpleUtf8Cache implements EncodingCache { static final int MAX_CAPACITY = 1024; @@ -160,7 +162,7 @@ static final boolean lfuInsert(CacheEntry[] entries, CacheEntry newEntry) { } } - // If we get here, then we're evicting the LRU + // If we get here, then we're evicting the LFU entries[lfuIndex] = newEntry; return true; } @@ -179,10 +181,6 @@ public CacheEntry(int adjHash, String value) { this.valueUtf8 = utf8(value); } - boolean matches(CacheEntry thatEntry) { - return (this == thatEntry) || this.matches(thatEntry.adjHash, thatEntry.value); - } - boolean matches(int adjHash, String value) { return (this.adjHash == adjHash) && value.equals(this.value); } diff --git a/communication/src/main/java/datadog/communication/util/IOUtils.java b/communication/src/main/java/datadog/communication/util/IOUtils.java index 23b41fd6c4d..819e4bb3e18 100644 --- a/communication/src/main/java/datadog/communication/util/IOUtils.java +++ b/communication/src/main/java/datadog/communication/util/IOUtils.java @@ -1,6 +1,5 @@ package datadog.communication.util; -import edu.umd.cs.findbugs.annotations.NonNull; import java.io.BufferedReader; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -16,6 +15,7 @@ import java.nio.file.attribute.BasicFileAttributes; import java.util.ArrayList; import java.util.List; +import javax.annotation.Nonnull; public abstract class IOUtils { @@ -23,11 +23,11 @@ public abstract class IOUtils { private IOUtils() {} - public static @NonNull String readFully(InputStream input) throws IOException { + public static @Nonnull String readFully(InputStream input) throws IOException { return readFully(input, Charset.defaultCharset()); } - public static @NonNull String readFully(InputStream input, Charset charset) throws IOException { + public static @Nonnull String readFully(InputStream input, Charset charset) throws IOException { ByteArrayOutputStream output = new ByteArrayOutputStream(); readFully(input, output); return new String(output.toByteArray(), charset); @@ -41,17 +41,17 @@ public static void readFully(InputStream input, OutputStream output) throws IOEx } } - public static @NonNull List readLines(final InputStream input) throws IOException { + public static @Nonnull List readLines(final InputStream input) throws IOException { return readLines(input, Charset.defaultCharset()); } - public static @NonNull List readLines(final InputStream input, final Charset charset) + public static @Nonnull List readLines(final InputStream input, final Charset charset) throws IOException { final InputStreamReader reader = new InputStreamReader(input, charset); return readLines(reader); } - public static @NonNull List readLines(final Reader input) throws IOException { + public static @Nonnull List readLines(final Reader input) throws IOException { final BufferedReader reader = new BufferedReader(input, DEFAULT_BUFFER_SIZE); final List list = new ArrayList<>(); String line = reader.readLine(); diff --git a/communication/src/test/java/datadog/communication/serialization/GenerationalUtf8CacheTest.java b/communication/src/test/java/datadog/communication/serialization/GenerationalUtf8CacheTest.java index b8fb3fde316..f7f9ff502dc 100644 --- a/communication/src/test/java/datadog/communication/serialization/GenerationalUtf8CacheTest.java +++ b/communication/src/test/java/datadog/communication/serialization/GenerationalUtf8CacheTest.java @@ -7,8 +7,12 @@ import static org.junit.jupiter.api.Assertions.assertSame; import java.nio.charset.StandardCharsets; +import java.util.Arrays; import java.util.Random; +import java.util.concurrent.CountDownLatch; import java.util.concurrent.ThreadLocalRandom; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -36,6 +40,13 @@ public void capacity() { assertEquals(128, cache.tenuredCapacity()); } + @Test + public void capacity_twoArg() { + GenerationalUtf8Cache cache = new GenerationalUtf8Cache(64, 256); + assertEquals(64, cache.edenCapacity()); + assertEquals(256, cache.tenuredCapacity()); + } + @Test public void maxCapacity() { GenerationalUtf8Cache cache = @@ -82,6 +93,29 @@ public void caching() { assertNotEquals(0, cache.edenHits); } + @Test + public void getUtf8_perCallAccessTime_overridesField() { + GenerationalUtf8Cache cache = create(); + // The field value should not leak into the entry when an explicit time is supplied. + cache.updateAccessTime(0L); + + String value = "bar"; + long callTime = 12345L; + + // First call only marks; the second call creates the entry. + cache.getUtf8(value, callTime); + cache.getUtf8(value, callTime); + + assertEquals(callTime, lookupEdenLastUsedMs(cache, value)); + + // Drive enough hits to promote into tenured. + while (cache.promotions == 0) { + cache.getUtf8(value, callTime); + } + + assertEquals(callTime, lookupTenuredLastUsedMs(cache, value)); + } + @Test public void promotion() { GenerationalUtf8Cache cache = create(); @@ -145,6 +179,88 @@ public void fuzz() { assertNotEquals(0, promotedHits); } + @Test + public void concurrentAccess_neverThrowsOrReturnsWrongBytes() throws InterruptedException { + // Regression test for a lookup-then-read race in getUtf8(): a slot can be nulled (recalibrate + // purge / eviction) or reassigned to a *different* value between lookupEntryIndex() and the + // array read. Before the fix this either NPE'd (null slot) or, worse, silently returned another + // value's bytes (reassigned slot). Serialization is single-threaded today, but the cache is + // built to allow concurrent use, so this exercises that contract. + final GenerationalUtf8Cache cache = create(); + + // More distinct values than the cache can hold, so promotions/evictions churn slots hard. + final String[] values = new String[256]; + for (int i = 0; i < values.length; ++i) { + values[i] = "value-" + i; + } + + final int threadCount = 8; + final int iterationsPerThread = 200_000; + final CountDownLatch start = new CountDownLatch(1); + final AtomicReference failure = new AtomicReference<>(); + final AtomicInteger readersRunning = new AtomicInteger(threadCount); + + Thread[] readers = new Thread[threadCount]; + for (int t = 0; t < threadCount; ++t) { + readers[t] = + new Thread( + () -> { + try { + start.await(); + ThreadLocalRandom random = ThreadLocalRandom.current(); + for (int i = 0; i < iterationsPerThread && failure.get() == null; ++i) { + String value = values[random.nextInt(values.length)]; + byte[] result = cache.getUtf8(value); + if (!Arrays.equals(value.getBytes(StandardCharsets.UTF_8), result)) { + failure.compareAndSet( + null, + new AssertionError( + "getUtf8(\"" + + value + + "\") returned bytes for \"" + + new String(result, StandardCharsets.UTF_8) + + "\"")); + return; + } + } + } catch (Throwable e) { + failure.compareAndSet(null, e); + } finally { + readersRunning.decrementAndGet(); + } + }); + } + + // Recalibrate in a tight loop for the duration, nulling decayed slots concurrently with reads. + Thread recalibrator = + new Thread( + () -> { + try { + start.await(); + while (readersRunning.get() > 0 && failure.get() == null) { + cache.recalibrate(); + } + } catch (Throwable e) { + failure.compareAndSet(null, e); + } + }); + + for (Thread reader : readers) { + reader.start(); + } + recalibrator.start(); + start.countDown(); + + for (Thread reader : readers) { + reader.join(); + } + recalibrator.join(); + + if (failure.get() != null) { + throw new AssertionError("concurrent getUtf8() failed", failure.get()); + } + } + @Test public void bigString_dont_cache() { String lorem = "Lorem ipsum dolor sit amet"; @@ -205,6 +321,24 @@ static final String nextValue() { return baseString + valueSuffix; } + static long lookupEdenLastUsedMs(GenerationalUtf8Cache cache, String value) { + return lookupLastUsedMs(cache.edenEntries, "edenEntries", value); + } + + static long lookupTenuredLastUsedMs(GenerationalUtf8Cache cache, String value) { + return lookupLastUsedMs(cache.tenuredEntries, "tenuredEntries", value); + } + + private static long lookupLastUsedMs( + GenerationalUtf8Cache.CacheEntry[] entries, String arrayName, String value) { + for (GenerationalUtf8Cache.CacheEntry entry : entries) { + if (entry != null && value.equals(entry.value)) { + return entry.lastUsedMs(); + } + } + throw new AssertionError("entry for value '" + value + "' not found in " + arrayName); + } + static final void printStats(GenerationalUtf8Cache cache) { System.out.printf( "eden hits: %5d\tpromotion hits: %5d\tpromotions: %5d\tearly: %5d\tlocal evictions: %5d\tglobal evictions: %5d%n", diff --git a/communication/src/test/java/datadog/communication/serialization/msgpack/MsgPackWriterTest.java b/communication/src/test/java/datadog/communication/serialization/msgpack/MsgPackWriterTest.java index 4a3f773fdc5..fca302dd3d1 100644 --- a/communication/src/test/java/datadog/communication/serialization/msgpack/MsgPackWriterTest.java +++ b/communication/src/test/java/datadog/communication/serialization/msgpack/MsgPackWriterTest.java @@ -33,8 +33,7 @@ import org.msgpack.core.MessageUnpacker; public class MsgPackWriterTest { - // Explicit escapes for non-ASCII chars to make test independent of container settings. - private static final String NON_ASCII_STRING = "foob\u00E1r_\u263a"; // foobár_☺ + private static final String NON_ASCII_STRING = "foobár_☺"; private static final byte[] NON_ASCII_BYTES = NON_ASCII_STRING.getBytes(UTF_8); private static final int NON_ASCII_BUFFER_CAPACITY = NON_ASCII_BYTES.length + 1; diff --git a/communication/src/test/resources/agent-features/agent-info-with-opm.json b/communication/src/test/resources/agent-features/agent-info-with-opm.json new file mode 100644 index 00000000000..1496f8b6fbc --- /dev/null +++ b/communication/src/test/resources/agent-features/agent-info-with-opm.json @@ -0,0 +1,20 @@ +{ + "version": "7.67.0", + "git_commit": "bdf863ccc9", + "endpoints": [ + "/v0.3/traces", + "/v0.4/traces", + "/v0.5/traces", + "/v0.6/stats", + "/v0.1/pipeline_stats", + "/telemetry/proxy/", + "/evp_proxy/v4/", + "/debugger/v1/input" + ], + "client_drop_p0s": true, + "long_running_spans": true, + "config": { + "statsd_port": 8125 + }, + "org_prop_marker": "abc123def0" +} diff --git a/components/annotations/build.gradle.kts b/components/annotations/build.gradle.kts new file mode 100644 index 00000000000..b8314ee7f33 --- /dev/null +++ b/components/annotations/build.gradle.kts @@ -0,0 +1 @@ +apply(from = "$rootDir/gradle/java.gradle") diff --git a/components/annotations/gradle.lockfile b/components/annotations/gradle.lockfile new file mode 100644 index 00000000000..d92a606fe20 --- /dev/null +++ b/components/annotations/gradle.lockfile @@ -0,0 +1,78 @@ +# This is a Gradle generated file for dependency locking. +# Manual edits can break the build and are not advised. +# This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :components:annotations:dependencies --write-locks +ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath +com.github.javaparser:javaparser-core:3.25.6=codenarc +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs +com.github.spotbugs:spotbugs:4.9.8=spotbugs +com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs +com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.google.code.gson:gson:2.13.2=spotbugs +com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.thoughtworks.qdox:qdox:1.12.1=codenarc +commons-io:commons-io:2.20.0=spotbugs +de.thetaphi:forbiddenapis:3.10=compileClasspath +io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath +jaxen:jaxen:2.0.0=spotbugs +net.bytebuddy:byte-buddy-agent:1.12.8=testRuntimeClasspath +net.bytebuddy:byte-buddy:1.12.8=testRuntimeClasspath +net.sf.saxon:Saxon-HE:12.9=spotbugs +org.apache.ant:ant-antlr:1.10.14=codenarc +org.apache.ant:ant-junit:1.10.14=codenarc +org.apache.bcel:bcel:6.11.0=spotbugs +org.apache.commons:commons-lang3:3.19.0=spotbugs +org.apache.commons:commons-text:1.14.0=spotbugs +org.apache.logging.log4j:log4j-api:2.25.2=spotbugs +org.apache.logging.log4j:log4j-core:2.25.2=spotbugs +org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath +org.codehaus.groovy:groovy-ant:3.0.23=codenarc +org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc +org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.25=testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-templates:3.0.23=codenarc +org.codehaus.groovy:groovy-xml:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath +org.codenarc:CodeNarc:3.7.0=codenarc +org.dom4j:dom4j:2.2.0=spotbugs +org.gmetrics:GMetrics:2.1.0=codenarc +org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt +org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath +org.junit:junit-bom:5.14.0=spotbugs +org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-core:4.4.0=testRuntimeClasspath +org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath +org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs +org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs +org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath +org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath +org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j +org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j +org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath +org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath +org.xmlresolver:xmlresolver:5.3.3=spotbugs +empty=annotationProcessor,runtimeClasspath,spotbugsPlugins,testAnnotationProcessor diff --git a/components/annotations/src/main/java/datadog/trace/api/internal/VisibleForTesting.java b/components/annotations/src/main/java/datadog/trace/api/internal/VisibleForTesting.java new file mode 100644 index 00000000000..60e3cd2c33a --- /dev/null +++ b/components/annotations/src/main/java/datadog/trace/api/internal/VisibleForTesting.java @@ -0,0 +1,10 @@ +package datadog.trace.api.internal; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +@Retention(RetentionPolicy.SOURCE) +@Target({ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.METHOD, ElementType.TYPE}) +public @interface VisibleForTesting {} diff --git a/components/context/build.gradle.kts b/components/context/build.gradle.kts index cda16b4cb17..9889bf0a86a 100644 --- a/components/context/build.gradle.kts +++ b/components/context/build.gradle.kts @@ -1,5 +1,22 @@ apply(from = "$rootDir/gradle/java.gradle") -val excludedClassesInstructionCoverage by extra { +extra["excludedClassesInstructionCoverage"] = listOf("datadog.context.ContextProviders") // covered by forked test + +// excluded from the default 90% rule so the relaxed 80% rule below can apply instead +// (couple of branches involve a nanosecond CAS race that can't be reliably reproduced) +extra["excludedClassesBranchCoverage"] = + listOf("datadog.context.ThreadLocalContextManager.ContextContinuationImpl") + +tasks.named("jacocoTestCoverageVerification") { + violationRules { + rule { + element = "CLASS" + includes = listOf("datadog.context.ThreadLocalContextManager.ContextContinuationImpl") + limit { + counter = "BRANCH" + minimum = "0.8".toBigDecimal() + } + } + } } diff --git a/components/context/gradle.lockfile b/components/context/gradle.lockfile index e7ab997a313..5def4c1f8df 100644 --- a/components/context/gradle.lockfile +++ b/components/context/gradle.lockfile @@ -1,10 +1,11 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :components:context:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -39,10 +40,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -56,10 +57,13 @@ org.mockito:mockito-core:4.4.0=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/components/context/src/main/java/datadog/context/Context.java b/components/context/src/main/java/datadog/context/Context.java index 046713291ae..34a07524de8 100644 --- a/components/context/src/main/java/datadog/context/Context.java +++ b/components/context/src/main/java/datadog/context/Context.java @@ -101,6 +101,15 @@ static Context detachFrom(Object carrier) { return binder().detachFrom(carrier); } + /** + * Captures this (attached) context so it can be resumed in another execution unit. + * + * @return continuation capturing this context. + */ + default ContextContinuation capture() { + return manager().capture(this); + } + /** * Gets the value stored in this context under the given key. * @@ -155,8 +164,17 @@ default Context with( */ default Context with(@Nullable ImplicitContextKeyed value) { if (value == null) { - return root(); + return this; } return value.storeInto(this); } + + /** + * Wraps context as a scope without attaching it to the current execution unit. + * + * @return a scope that has no effect on execution units. + */ + default ContextScope asScope() { + return new NoopContextScope(this); + } } diff --git a/components/context/src/main/java/datadog/context/ContextContinuation.java b/components/context/src/main/java/datadog/context/ContextContinuation.java new file mode 100644 index 00000000000..c516a7b35bf --- /dev/null +++ b/components/context/src/main/java/datadog/context/ContextContinuation.java @@ -0,0 +1,79 @@ +package datadog.context; + +/** + * Captures a context attached to one execution unit so it can be resumed in another. + * + *

To propagate context to a single background task: + * + *

{@code
+ * ContextContinuation continuation = Context.current().capture();
+ * executor.execute(() -> {
+ *   try (ContextScope scope = continuation.resume()) {
+ *     // ... Context.current() here returns the captured context
+ *   }
+ *   // context implicitly released from continuation when resumed scope closes
+ * });
+ * }
+ * + *

If a continuation is never resumed (e.g. a task is cancelled before it runs), you must release + * it explicitly to avoid resource leaks: + * + *

{@code
+ * ContextContinuation continuation = Context.current().capture();
+ * Future future = executor.submit(() -> {
+ *   try (ContextScope scope = continuation.resume()) {
+ *     // ...
+ *   }
+ * });
+ * // ...
+ * if (future.cancel(false)) {
+ *   continuation.release(); // task will never resume, so release manually
+ * }
+ * }
+ * + *

When the same context is resumed concurrently across multiple threads, call {@link #hold()} + * immediately after capture to prevent the first {@link #resume()} from releasing the context: + * + *

{@code
+ * ContextContinuation continuation = Context.current().capture().hold();
+ * for (int i = 0; i < N; i++) {
+ *   executor.execute(() -> {
+ *     try (ContextScope scope = continuation.resume()) {
+ *       // ...
+ *     }
+ *   });
+ * }
+ * // ...
+ * continuation.release(); // remember to release the hold once all tasks are resumed/done
+ * }
+ */ +public interface ContextContinuation { + + /** + * Optional builder method to stop {@link #resume()} from implicitly releasing the captured + * context. This is useful when multiple threads may concurrently resume the context. You must + * then explicitly {@link #release() release} the context once all threads are resumed/done. + * + * @return this continuation, but with implicit release-after-resume turned off. + */ + ContextContinuation hold(); + + /** + * Returns the context captured by this continuation. + * + * @return the captured context. + */ + Context context(); + + /** + * Resumes the context captured by this continuation by attaching it to the current execution + * unit. Implicitly {@link #release() releases} the captured context at the end of the resumed + * scope, unless {@link #hold()} was called when creating the continuation. + * + * @return a scope to be closed when the resumed context is invalid. + */ + ContextScope resume(); + + /** Explicitly releases the context captured by this continuation. */ + void release(); +} diff --git a/components/context/src/main/java/datadog/context/ContextKey.java b/components/context/src/main/java/datadog/context/ContextKey.java index cc1cd6d8cb0..2576fec4a50 100644 --- a/components/context/src/main/java/datadog/context/ContextKey.java +++ b/components/context/src/main/java/datadog/context/ContextKey.java @@ -3,7 +3,7 @@ import java.util.concurrent.atomic.AtomicInteger; /** - * {@link Context} key that maps to a value of type {@link T}. + * {@link Context} key that maps to a value of type {@code T}. * *

Keys are compared by identity rather than by name. Each stored context type should either * share its key for re-use or implement {@link ImplicitContextKeyed} to keep its key private. diff --git a/components/context/src/main/java/datadog/context/ContextListener.java b/components/context/src/main/java/datadog/context/ContextListener.java new file mode 100644 index 00000000000..f657fb769aa --- /dev/null +++ b/components/context/src/main/java/datadog/context/ContextListener.java @@ -0,0 +1,27 @@ +package datadog.context; + +/** Listener of context events. */ +public interface ContextListener { + + /** + * Notifies that the context has been updated for the current execution unit. + * + * @param before the context before. + * @param after the context after. + */ + default void onUpdate(Context before, Context after) {} + + /** + * Notifies that the given context has been captured by a continuation. + * + * @param context the captured context. + */ + default void onCapture(Context context) {} + + /** + * Notifies that the given context has been released from a continuation. + * + * @param context the released context. + */ + default void onRelease(Context context) {} +} diff --git a/components/context/src/main/java/datadog/context/ContextManager.java b/components/context/src/main/java/datadog/context/ContextManager.java index af0a2b9289a..6828352d1d4 100644 --- a/components/context/src/main/java/datadog/context/ContextManager.java +++ b/components/context/src/main/java/datadog/context/ContextManager.java @@ -1,5 +1,7 @@ package datadog.context; +import static datadog.context.ContextProviders.manager; + /** Manages context across execution units. */ public interface ContextManager { /** @@ -25,6 +27,29 @@ public interface ContextManager { */ Context swap(Context context); + /** + * Captures the given (attached) context so it can be resumed in another execution unit. + * + * @return continuation capturing the context. + */ + ContextContinuation capture(Context context); + + /** + * Registers the given listener to receive context events. + * + * @param listener the listener to register + */ + void addListener(ContextListener listener); + + /** + * Registers the given listener to receive context events. + * + * @param listener the listener to register. + */ + static void register(ContextListener listener) { + manager().addListener(listener); + } + /** * Requests use of a custom {@link ContextManager}. * diff --git a/components/context/src/main/java/datadog/context/EmptyContext.java b/components/context/src/main/java/datadog/context/EmptyContext.java index 20023482647..e9fee391373 100644 --- a/components/context/src/main/java/datadog/context/EmptyContext.java +++ b/components/context/src/main/java/datadog/context/EmptyContext.java @@ -3,13 +3,13 @@ import static java.util.Objects.requireNonNull; import javax.annotation.Nullable; -import javax.annotation.ParametersAreNonnullByDefault; /** {@link Context} containing no values. */ -@ParametersAreNonnullByDefault -final class EmptyContext implements Context { +final class EmptyContext implements SelfScopedContext { static final Context INSTANCE = new EmptyContext(); + private EmptyContext() {} + @Override @Nullable public T get(ContextKey key) { diff --git a/components/context/src/main/java/datadog/context/ImplicitContextKeyed.java b/components/context/src/main/java/datadog/context/ImplicitContextKeyed.java index a852a19c01b..cdc4107d01a 100644 --- a/components/context/src/main/java/datadog/context/ImplicitContextKeyed.java +++ b/components/context/src/main/java/datadog/context/ImplicitContextKeyed.java @@ -1,9 +1,6 @@ package datadog.context; -import javax.annotation.ParametersAreNonnullByDefault; - /** {@link Context} value that has its own implicit {@link ContextKey}. */ -@ParametersAreNonnullByDefault public interface ImplicitContextKeyed { /** * Creates a new context with this value under its chosen key. diff --git a/components/context/src/main/java/datadog/context/IndexedContext.java b/components/context/src/main/java/datadog/context/IndexedContext.java index e2c520fffdb..d4590b6f859 100644 --- a/components/context/src/main/java/datadog/context/IndexedContext.java +++ b/components/context/src/main/java/datadog/context/IndexedContext.java @@ -6,11 +6,9 @@ import java.util.Arrays; import javax.annotation.Nullable; -import javax.annotation.ParametersAreNonnullByDefault; /** {@link Context} containing many values. */ -@ParametersAreNonnullByDefault -final class IndexedContext implements Context { +final class IndexedContext implements SelfScopedContext { final Object[] store; IndexedContext(Object[] store) { @@ -30,6 +28,9 @@ public T get(ContextKey key) { public Context with(ContextKey key, @Nullable T value) { requireNonNull(key, "Context key cannot be null"); int index = key.index; + if (index < this.store.length && this.store[index] == value) { + return this; + } Object[] newStore = copyOfRange(this.store, 0, max(this.store.length, index + 1)); newStore[index] = value; return new IndexedContext(newStore); diff --git a/components/context/src/main/java/datadog/context/NoopContextContinuation.java b/components/context/src/main/java/datadog/context/NoopContextContinuation.java new file mode 100644 index 00000000000..02ede9b862d --- /dev/null +++ b/components/context/src/main/java/datadog/context/NoopContextContinuation.java @@ -0,0 +1,31 @@ +package datadog.context; + +/** {@link ContextContinuation} that has no effect on execution units. */ +final class NoopContextContinuation implements ContextContinuation, ContextScope { + private final Context context; + + NoopContextContinuation(Context context) { + this.context = context; + } + + @Override + public ContextContinuation hold() { + return this; + } + + @Override + public Context context() { + return context; + } + + @Override + public ContextScope resume() { + return this; // acts as no-op scope, avoiding allocation + } + + @Override + public void release() {} + + @Override + public void close() {} +} diff --git a/components/context/src/main/java/datadog/context/NoopContextScope.java b/components/context/src/main/java/datadog/context/NoopContextScope.java new file mode 100644 index 00000000000..648221036c5 --- /dev/null +++ b/components/context/src/main/java/datadog/context/NoopContextScope.java @@ -0,0 +1,18 @@ +package datadog.context; + +/** {@link ContextScope} that has no effect on execution units. */ +final class NoopContextScope implements ContextScope { + private final Context context; + + NoopContextScope(Context context) { + this.context = context; + } + + @Override + public Context context() { + return context; + } + + @Override + public void close() {} +} diff --git a/components/context/src/main/java/datadog/context/SelfScopedContext.java b/components/context/src/main/java/datadog/context/SelfScopedContext.java new file mode 100644 index 00000000000..f19dbf98b73 --- /dev/null +++ b/components/context/src/main/java/datadog/context/SelfScopedContext.java @@ -0,0 +1,17 @@ +package datadog.context; + +/** Context that acts as its own unattached scope. */ +public interface SelfScopedContext extends Context, ContextScope { + @Override + default ContextScope asScope() { + return this; // acts as no-op scope, avoiding allocation + } + + @Override + default Context context() { + return this; + } + + @Override + default void close() {} +} diff --git a/components/context/src/main/java/datadog/context/SingletonContext.java b/components/context/src/main/java/datadog/context/SingletonContext.java index 94c9ff091fc..300c9247798 100644 --- a/components/context/src/main/java/datadog/context/SingletonContext.java +++ b/components/context/src/main/java/datadog/context/SingletonContext.java @@ -5,11 +5,9 @@ import java.util.Objects; import javax.annotation.Nullable; -import javax.annotation.ParametersAreNonnullByDefault; /** {@link Context} containing a single value. */ -@ParametersAreNonnullByDefault -final class SingletonContext implements Context { +final class SingletonContext implements SelfScopedContext { final int index; final Object value; @@ -31,9 +29,13 @@ public Context with(ContextKey secondKey, @Nullable V secondValue) { requireNonNull(secondKey, "Context key cannot be null"); int secondIndex = secondKey.index; if (this.index == secondIndex) { - return secondValue == null - ? EmptyContext.INSTANCE - : new SingletonContext(this.index, secondValue); + if (secondValue == null) { + return EmptyContext.INSTANCE; + } else if (secondValue != this.value) { + return new SingletonContext(this.index, secondValue); + } else { + return this; + } } else { Object[] store = new Object[max(this.index, secondIndex) + 1]; store[this.index] = this.value; diff --git a/components/context/src/main/java/datadog/context/TestContextManager.java b/components/context/src/main/java/datadog/context/TestContextManager.java index 9c60f4dc2e0..a0b1302653c 100644 --- a/components/context/src/main/java/datadog/context/TestContextManager.java +++ b/components/context/src/main/java/datadog/context/TestContextManager.java @@ -27,6 +27,20 @@ public Context swap(Context context) { return delegate().swap(context); } + @Override + public ContextContinuation capture(Context context) { + return delegate().capture(context); + } + + @Override + public void addListener(ContextListener listener) { + delegate().addListener(listener); + } + + static void clearListeners() { + ThreadLocalContextManager.INSTANCE.clearListeners(); + } + private static ContextManager delegate() { ContextManager delegate = ContextProviders.customManager; if (delegate == TEST_INSTANCE) { diff --git a/components/context/src/main/java/datadog/context/ThreadLocalContextManager.java b/components/context/src/main/java/datadog/context/ThreadLocalContextManager.java index 0d652868e52..ccb3a641565 100644 --- a/components/context/src/main/java/datadog/context/ThreadLocalContextManager.java +++ b/components/context/src/main/java/datadog/context/ThreadLocalContextManager.java @@ -1,45 +1,268 @@ package datadog.context; +import java.util.Arrays; +import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; +import javax.annotation.Nullable; + /** {@link ContextManager} that uses a {@link ThreadLocal} to track context per thread. */ final class ThreadLocalContextManager implements ContextManager { - static final ContextManager INSTANCE = new ThreadLocalContextManager(); + static final ThreadLocalContextManager INSTANCE = new ThreadLocalContextManager(); + + private static final ThreadLocal CONTEXT_HOLDER = + ThreadLocal.withInitial(ContextHolder::new); - private static final ThreadLocal CURRENT_HOLDER = - ThreadLocal.withInitial(() -> new Context[] {EmptyContext.INSTANCE}); + private static final NoopContextContinuation ROOT_CONTINUATION = + new NoopContextContinuation(Context.root()); + + private final Object listenersWriteLock = new Object(); + volatile ContextListener[] listeners = {}; @Override public Context current() { - return CURRENT_HOLDER.get()[0]; + return CONTEXT_HOLDER.get().current; } @Override public ContextScope attach(Context context) { - Context[] holder = CURRENT_HOLDER.get(); - Context previous = holder[0]; - holder[0] = context; - return new ContextScope() { - private boolean closed; - - @Override - public Context context() { - return context; - } - - @Override - public void close() { - if (!closed && context == holder[0]) { - holder[0] = previous; - closed = true; - } + return doAttach(context, null); + } + + ContextScope doAttach(Context context, @Nullable ContextContinuationImpl continuation) { + ContextHolder holder = CONTEXT_HOLDER.get(); + + Context beforeAttach = holder.current; + if (context == beforeAttach) { + if (continuation != null) { + // already attached, safe to release early to avoid resource leak + continuation.releaseOnScopeClose(); + return continuation; // acts as no-op scope, avoiding allocation } - }; + return context.asScope(); // convert to scope without attaching + } + + holder.current = context; + notifyUpdate(listeners, beforeAttach, context); + return continuation == null + ? new ContextScopeImpl(context, holder, beforeAttach) + : new ResumedScopeImpl(context, holder, beforeAttach, continuation); } @Override public Context swap(Context context) { - Context[] holder = CURRENT_HOLDER.get(); - Context previous = holder[0]; - holder[0] = context; - return previous; + ContextHolder holder = CONTEXT_HOLDER.get(); + + Context beforeSwap = holder.current; + if (context == beforeSwap) { + return beforeSwap; + } + + holder.current = context; + notifyUpdate(listeners, beforeSwap, context); + return beforeSwap; + } + + @Override + public ContextContinuation capture(Context context) { + return context == Context.root() ? ROOT_CONTINUATION : new ContextContinuationImpl(context); + } + + @Override + public void addListener(ContextListener listener) { + synchronized (listenersWriteLock) { + for (ContextListener l : listeners) { + if (l == listener) { + return; + } + } + int oldLength = listeners.length; + ContextListener[] update = Arrays.copyOf(listeners, oldLength + 1); + update[oldLength] = listener; + listeners = update; + } + } + + void clearListeners() { + synchronized (listenersWriteLock) { + listeners = new ContextListener[] {}; + } + } + + static void notifyUpdate(ContextListener[] listeners, Context before, Context after) { + for (ContextListener l : listeners) { + try { + l.onUpdate(before, after); + } catch (Throwable ignore) { + } + } + } + + static void notifyCapture(ContextListener[] listeners, Context context) { + // only called for non-empty continuations + for (ContextListener l : listeners) { + try { + l.onCapture(context); + } catch (Throwable ignore) { + } + } + } + + static void notifyRelease(ContextListener[] listeners, Context context) { + // only called for non-empty continuations + for (ContextListener l : listeners) { + try { + l.onRelease(context); + } catch (Throwable ignore) { + } + } + } + + private static class ContextScopeImpl implements ContextScope { + + private final Context context; + private final ContextHolder holder; + private final Context beforeAttach; + + private boolean closed; + + ContextScopeImpl(Context context, ContextHolder holder, Context beforeAttach) { + this.context = context; + this.holder = holder; + this.beforeAttach = beforeAttach; + } + + @Override + public final Context context() { + return context; + } + + @Override + public void close() { + // check for out-of-order close to avoid corrupting the current state + if (!closed && context == holder.current) { + holder.current = beforeAttach; + notifyUpdate(INSTANCE.listeners, context, beforeAttach); + closed = true; + } + } + } + + private static final class ResumedScopeImpl extends ContextScopeImpl { + @Nullable private ContextContinuationImpl continuation; + + ResumedScopeImpl( + Context context, + ContextHolder holder, + Context beforeAttach, + @Nullable ContextContinuationImpl continuation) { + super(context, holder, beforeAttach); + this.continuation = continuation; + } + + @Override + public void close() { + if (continuation != null) { + // release first to avoid resource leak, even on out-of-order close + continuation.releaseOnScopeClose(); + continuation = null; + } + super.close(); // proceed to try and update the current execution unit + } + } + + private static final class ContextContinuationImpl implements ContextContinuation, ContextScope { + + private static final AtomicIntegerFieldUpdater COUNT = + AtomicIntegerFieldUpdater.newUpdater(ContextContinuationImpl.class, "count"); + + // these boundaries were selected to allow for speculative counting and fuzzy checks + private static final int RELEASED = Integer.MIN_VALUE >> 1; + private static final int HELD = (Integer.MAX_VALUE >> 1) + 1; + + private final Context context; + + /** + * When positive this reflects the number of outstanding resumed scopes as well as whether there + * is an active hold on the continuation: + * + * + * + * + * + * + * + *
Value Meaning
0Not held or resumed
1..HELD-1Resumed, not held
HELDHeld, not yet resumed
HELD..MAX_INTResumed and held
+ * + * where HELD is at the mid-point between 1 and MAX_INT. + * + *

A negative value of RELEASED reflects that the continuation has either been resumed and + * all associated scopes are now closed, or it has been explicitly released. This value was + * chosen to be half the size of MIN_INT to avoid speculative additions in {@link #resume()} + * from overflowing to a positive count. + */ + private volatile int count = 0; + + ContextContinuationImpl(Context context) { + this.context = context; + notifyCapture(INSTANCE.listeners, context); + } + + @Override + public ContextContinuation hold() { + // update initial count to record that this continuation has a hold + COUNT.compareAndSet(this, 0, HELD); + return this; + } + + @Override + public Context context() { + return context; + } + + @Override + public ContextScope resume() { + if (COUNT.incrementAndGet(this) > 0) { + // speculative update succeeded, continuation can be resumed + return INSTANCE.doAttach(context, this); + } else { + // continuation released or too many resumes; rollback count + COUNT.decrementAndGet(this); + return this; // acts as no-op scope, avoiding allocation + } + } + + @Override + public void release() { + int current = count; + while (current >= HELD) { + // remove the hold on this continuation by removing the offset + COUNT.compareAndSet(this, current, current - HELD); + current = count; + } + while (current == 0) { + // no outstanding resumes and hold has been removed + if (COUNT.compareAndSet(this, current, RELEASED)) { + notifyRelease(INSTANCE.listeners, context); + return; + } + current = count; + } + } + + void releaseOnScopeClose() { + if (COUNT.compareAndSet(this, 1, RELEASED)) { + // fast path: only one resume of the continuation (no hold) + notifyRelease(INSTANCE.listeners, context); + } else if (COUNT.decrementAndGet(this) == 0) { + // slow path: multiple resumes, all scopes now closed (no hold) + release(); + } /* else there are outstanding resumes or hold is in place */ + } + + @Override + public void close() {} + } + + private static final class ContextHolder { + Context current = Context.root(); } } diff --git a/components/context/src/main/java/datadog/context/WeakMapContextBinder.java b/components/context/src/main/java/datadog/context/WeakMapContextBinder.java index 9b5fd24299e..15e0154f25a 100644 --- a/components/context/src/main/java/datadog/context/WeakMapContextBinder.java +++ b/components/context/src/main/java/datadog/context/WeakMapContextBinder.java @@ -6,10 +6,8 @@ import java.util.Map; import java.util.WeakHashMap; -import javax.annotation.ParametersAreNonnullByDefault; /** {@link ContextBinder} that uses a global weak map of carriers to contexts. */ -@ParametersAreNonnullByDefault final class WeakMapContextBinder implements ContextBinder { static final ContextBinder INSTANCE = new WeakMapContextBinder(); diff --git a/components/context/src/test/java/datadog/context/ContextBinderTest.java b/components/context/src/test/java/datadog/context/ContextBinderTest.java index 9af265fea50..eb2bb35563e 100644 --- a/components/context/src/test/java/datadog/context/ContextBinderTest.java +++ b/components/context/src/test/java/datadog/context/ContextBinderTest.java @@ -8,15 +8,9 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -class ContextBinderTest { - @BeforeEach - void setUp() { - assertEquals(root(), current(), "No context is expected to be set"); - } - +class ContextBinderTest extends ContextTestBase { @Test void testAttachAndDetach() { // Setting up test diff --git a/components/context/src/test/java/datadog/context/ContextContinuationTest.java b/components/context/src/test/java/datadog/context/ContextContinuationTest.java new file mode 100644 index 00000000000..5f818332c89 --- /dev/null +++ b/components/context/src/test/java/datadog/context/ContextContinuationTest.java @@ -0,0 +1,366 @@ +package datadog.context; + +import static datadog.context.Context.current; +import static datadog.context.Context.root; +import static java.util.Collections.singletonList; +import static java.util.Collections.synchronizedList; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import javax.annotation.ParametersAreNonnullByDefault; +import org.junit.jupiter.api.Test; + +@ParametersAreNonnullByDefault +class ContextContinuationTest extends ContextTestBase { + + @Test + void testCaptureRootContextIsNoop() { + ContextContinuation continuation = root().capture(); + assertEquals(root(), continuation.context()); + assertSame(continuation, continuation.hold()); // hold is a no-op, returns self + try (ContextScope scope = continuation.resume()) { + assertEquals(root(), current()); // nothing changes for root + } + assertEquals(root(), current()); + continuation.release(); // no-op + } + + @Test + void testCaptureStoresContext() { + Context context = root().with(TEST_KEY, "captured"); + try (ContextScope scope = context.attach()) { + ContextContinuation continuation = context.capture(); + assertEquals(context, continuation.context()); + continuation.release(); + } + } + + @Test + void testCaptureFiresOnCaptureEvent() { + TrackingListener listener = trackingListener(); + ContextManager.register(listener); + Context context = root().with(TEST_KEY, "value"); + try (ContextScope scope = context.attach()) { + ContextContinuation continuation = + context.capture(); // capture while active (recommended pattern) + listener.assertNewEvents("update:{root}->value", "capture:value"); + continuation.release(); + } + listener.assertNewEvents("release:value", "update:value->{root}"); + } + + @Test + void testResumeAttachesContextAndRestoresPreviousOnClose() { + Context context = root().with(TEST_KEY, "value"); + ContextContinuation continuation; + try (ContextScope scope = context.attach()) { + continuation = context.capture(); // capture while active (recommended pattern) + } + // original scope is closed; resume the continuation here (same or different thread) + try (ContextScope scope = continuation.resume()) { + assertEquals(context, current()); + assertEquals(context, scope.context()); + } + assertEquals(root(), current()); + } + + @Test + void testResumeAndScopeCloseFiresLifecycleEvents() { + TrackingListener listener = trackingListener(); + ContextManager.register(listener); + Context context = root().with(TEST_KEY, "value"); + ContextContinuation continuation; + try (ContextScope scope = context.attach()) { + continuation = context.capture(); // capture while active + } + listener.assertNewEvents("update:{root}->value", "capture:value", "update:value->{root}"); + try (ContextScope scope = continuation.resume()) { + listener.assertNewEvents("update:{root}->value"); + } + // release fires before update (continuation is released first inside ContextScopeImpl.close) + listener.assertNewEvents("release:value", "update:value->{root}"); + } + + @Test + void testHoldPreventsAutoReleaseOnScopeClose() { + TrackingListener listener = trackingListener(); + ContextManager.register(listener); + Context context = root().with(TEST_KEY, "value"); + ContextContinuation continuation; + try (ContextScope scope = context.attach()) { + continuation = context.capture(); // capture while active + continuation.hold(); + listener.assertNewEvents("update:{root}->value", "capture:value"); + } + listener.assertNewEvents("update:value->{root}"); + try (ContextScope scope = continuation.resume()) { + assertEquals(context, current()); + listener.assertNewEvents("update:{root}->value"); + } + assertEquals(root(), current()); + listener.assertNewEvents( + "update:value->{root}"); // release should not fire while hold is active + continuation.release(); + listener.assertNewEvents("release:value"); + } + + @Test + void testExplicitReleaseWithoutResumeFiresReleaseEvent() { + TrackingListener listener = trackingListener(); + ContextManager.register(listener); + Context context = root().with(TEST_KEY, "value"); + ContextContinuation continuation; + try (ContextScope scope = context.attach()) { + continuation = context.capture(); // capture while active + } + listener.assertNewEvents("update:{root}->value", "capture:value", "update:value->{root}"); + continuation.release(); + listener.assertNewEvents("release:value"); + } + + @Test + void testResumeAfterReleaseIsNoop() { + Context context = root().with(TEST_KEY, "value"); + ContextContinuation continuation; + try (ContextScope scope = context.attach()) { + continuation = context.capture(); // capture while active + } + continuation.release(); + // Resuming a released continuation should not attach the context + try (ContextScope scope = continuation.resume()) { + assertEquals(root(), current()); + } + assertEquals(root(), current()); + } + + @Test + void testResumeOnDifferentThread() { + Context context = root().with(TEST_KEY, "value"); + ContextContinuation continuation; + try (ContextScope scope = context.attach()) { + continuation = context.capture(); // capture while active (recommended pattern) + } + // original scope is closed; resume the context on another thread + ExecutorService executor = Executors.newSingleThreadExecutor(); + try { + Future future = + executor.submit( + () -> { + assertEquals(root(), current()); // thread starts with root context + try (ContextScope scope = continuation.resume()) { + assertEquals(context, current()); + } + assertEquals(root(), current()); // restored after scope close + }); + assertDoesNotThrow(() -> future.get()); + } finally { + executor.shutdown(); + } + } + + @Test + void testMultipleResumesReleaseAfterLastScopeCloses() throws InterruptedException { + List events = synchronizedList(new ArrayList<>()); + ContextManager.register( + new ContextListener() { + @Override + public void onRelease(Context c) { + events.add("release"); + } + }); + Context context = root().with(TEST_KEY, "value"); + ContextContinuation continuation; + try (ContextScope scope = context.attach()) { + continuation = context.capture(); // capture while active + } + CountDownLatch bothResumed = new CountDownLatch(2); + CountDownLatch closeFirst = new CountDownLatch(1); + CountDownLatch firstClosed = new CountDownLatch(1); + CountDownLatch closeSecond = new CountDownLatch(1); + ExecutorService executor = Executors.newFixedThreadPool(2); + try { + Future f1 = + executor.submit( + () -> { + try (ContextScope scope = continuation.resume()) { + bothResumed.countDown(); + closeFirst.await(); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } finally { + firstClosed.countDown(); + } + }); + Future f2 = + executor.submit( + () -> { + try (ContextScope scope = continuation.resume()) { + bothResumed.countDown(); + closeSecond.await(); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + }); + bothResumed.await(); + assertTrue(events.isEmpty(), "release should not fire while scopes are open"); + closeFirst.countDown(); + firstClosed.await(); // wait for f1's scope to fully close + assertTrue(events.isEmpty(), "release should not fire after first scope closes"); + closeSecond.countDown(); + assertDoesNotThrow(() -> f1.get()); + assertDoesNotThrow(() -> f2.get()); + assertEquals(singletonList("release"), events); + } finally { + executor.shutdown(); + } + } + + @Test + void testSameContextResumeReleasesImmediately() { + TrackingListener listener = trackingListener(); + ContextManager.register(listener); + Context context = root().with(TEST_KEY, "value"); + try (ContextScope outer = context.attach()) { + // Context is already current; resume is a noop and continuation is released immediately + ContextContinuation continuation = context.capture(); + try (ContextScope noop = continuation.resume()) { + assertEquals(context, current()); + listener.assertNewEvents( + "update:{root}->value", "capture:value", "release:value"); // released synchronously + } + assertEquals(context, current()); // outer scope still holds context + } + listener.assertNewEvents("update:value->{root}"); + } + + @Test + void testOutOfOrderScopeCloseReleasesImmediately() { + // Recommended pattern: attach C, capture, close original scope + Context contextC = root().with(TEST_KEY, "C"); + ContextContinuation continuation; + try (ContextScope scope = contextC.attach()) { + continuation = contextC.capture(); + } + + TrackingListener listener = trackingListener(); + ContextManager.register(listener); + + Context contextD = root().with(TEST_KEY, "D"); + try (ContextScope scopeR = continuation.resume()) { + assertEquals(contextC, current()); + try (ContextScope scopeD = contextD.attach()) { // attaching D fires update:C->D + assertEquals(contextD, current()); + + // close the resume scope out-of-order while D is still nested on top; + // release fires immediately, but update:C->{root} does not (C is not current) + scopeR.close(); + listener.assertNewEvents("update:{root}->C", "update:C->D", "release:C"); + assertEquals(contextD, current()); // D is still current + } // scopeD closes here: unwind D normally, restores C + listener.assertNewEvents("update:D->C"); + } // try-with-resources closes scopeR again; no second release, C unwinds to root + + assertEquals(root(), current()); + listener.assertNewEvents("update:C->{root}"); + } + + @Test + void testHoldWithOutOfOrderScopeCloseFiresReleaseOnExplicitRelease() { + // Regression test: hold() + out-of-order close must not corrupt the count, + // which would cause release() to silently no-op and lose the release event. + Context contextC = root().with(TEST_KEY, "C"); + ContextContinuation continuation; + try (ContextScope scope = contextC.attach()) { + continuation = contextC.capture(); + continuation.hold(); + } + + TrackingListener listener = trackingListener(); + ContextManager.register(listener); + + Context contextD = root().with(TEST_KEY, "D"); + try (ContextScope scopeR = continuation.resume()) { + assertEquals(contextC, current()); + try (ContextScope scopeD = contextD.attach()) { // attaching D fires update:C->D + assertEquals(contextD, current()); + + scopeR.close(); // out-of-order close while D is still on top; hold prevents auto-release + listener.assertNewEvents("update:{root}->C", "update:C->D"); + assertEquals(contextD, current()); + } // scopeD closes here: unwind D, restores C + } // TWR closes scopeR again (now in-order); update:C->{root}, no release yet (hold is active) + + assertEquals(root(), current()); + listener.assertNewEvents("update:D->C", "update:C->{root}"); + + continuation.release(); // explicit release must fire release:C + listener.assertNewEvents("release:C"); + } + + @Test + void testMultipleHoldCallsAreIdempotent() { + // Calling hold() more than once should not require more than one explicit release(). + TrackingListener listener = trackingListener(); + ContextManager.register(listener); + Context context = root().with(TEST_KEY, "value"); + ContextContinuation continuation; + try (ContextScope scope = context.attach()) { + continuation = context.capture(); + continuation.hold(); + continuation.hold(); // second hold must be a no-op + } + // One explicit release() is enough — no extra releases needed for the second hold(). + continuation.release(); + listener.assertNewEvents( + "update:{root}->value", "capture:value", "update:value->{root}", "release:value"); + continuation.release(); // still idempotent after the final release + listener.assertNoNewEvents(); + } + + @Test + void testHoldAfterReleaseIsIgnored() { + // hold() on an already-released continuation must not resurrect it. + TrackingListener listener = trackingListener(); + ContextManager.register(listener); + Context context = root().with(TEST_KEY, "value"); + ContextContinuation continuation; + try (ContextScope scope = context.attach()) { + continuation = context.capture(); + } + continuation.release(); + listener.assertNewEvents( + "update:{root}->value", "capture:value", "update:value->{root}", "release:value"); + continuation.hold(); // must be silently ignored + // resume() after release is already a noop, even with the spurious hold() + try (ContextScope scope = continuation.resume()) { + assertEquals(root(), current()); + } + continuation.release(); // must not fire a second release event + listener.assertNoNewEvents(); + } + + @Test + void testHoldAllowsMultipleReleaseCalls() { + TrackingListener listener = trackingListener(); + ContextManager.register(listener); + Context context = root().with(TEST_KEY, "value"); + ContextContinuation continuation; + try (ContextScope scope = context.attach()) { + continuation = context.capture(); // capture while active + continuation.hold(); + } + continuation.release(); + listener.assertNewEvents( + "update:{root}->value", "capture:value", "update:value->{root}", "release:value"); + continuation.release(); // second release is a no-op + listener.assertNoNewEvents(); + } +} diff --git a/components/context/src/test/java/datadog/context/ContextListenerEventTest.java b/components/context/src/test/java/datadog/context/ContextListenerEventTest.java new file mode 100644 index 00000000000..db71cc8438f --- /dev/null +++ b/components/context/src/test/java/datadog/context/ContextListenerEventTest.java @@ -0,0 +1,98 @@ +package datadog.context; + +import static datadog.context.Context.current; +import static datadog.context.Context.root; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; + +import org.junit.jupiter.api.Test; + +class ContextListenerEventTest extends ContextTestBase { + @Test + void testListenersNotifiedOnAttachAndDetach() { + TrackingListener listener = trackingListener(); + ContextManager.register(listener); + Context context = root().with(TEST_KEY, "value"); + try (ContextScope scope = context.attach()) { + listener.assertNewEvents("update:{root}->value"); + } + listener.assertNewEvents("update:value->{root}"); + } + + @Test + void testListenersNotNotifiedForSameContextAttachOrSwap() { + TrackingListener listener = trackingListener(); + ContextManager.register(listener); + root().attach(); // current is already root, no events + listener.assertNoEvents(); + root().swap(); // current is already root, no events + listener.assertNoEvents(); + Context context = root().with(TEST_KEY, "value"); + try (ContextScope scope = context.attach()) { + listener.assertNewEvents("update:{root}->value"); + } + listener.assertNewEvents("update:value->{root}"); + } + + @Test + void testListenersNotNotifiedOnSameContextAttach() { + TrackingListener listener = trackingListener(); + ContextManager.register(listener); + Context context = root().with(TEST_KEY, "same"); + try (ContextScope outer = context.attach()) { + listener.assertNewEvents("update:{root}->same"); + try (ContextScope noop = context.attach()) { + assertEquals(context, current()); + listener.assertNoNewEvents(); // no new events on same-context attach + } + listener.assertNoNewEvents(); // noop close fires no events either + } + listener.assertNewEvents("update:same->{root}"); + } + + @Test + void testListenersNotNotifiedOnSameContextSwap() { + TrackingListener listener = trackingListener(); + ContextManager.register(listener); + Context context = root().with(TEST_KEY, "same"); + context.swap(); + listener.assertNewEvents("update:{root}->same"); + context.swap(); // same context again, no events + listener.assertNoNewEvents(); + root().swap(); + listener.assertNewEvents("update:same->{root}"); + } + + @Test + void testDuplicateListenerIgnored() { + TrackingListener listener = trackingListener(); + ContextManager.register(listener); + ContextManager.register(listener); // should be ignored + try (ContextScope scope = root().with(TEST_KEY, "value").attach()) {} + listener.assertEvents("update:{root}->value", "update:value->{root}"); + } + + @Test + void testMultipleListenersAllNotified() { + TrackingListener listener1 = trackingListener(); + TrackingListener listener2 = trackingListener(); + ContextManager.register(listener1); + ContextManager.register(listener2); + try (ContextScope scope = root().with(TEST_KEY, "value").attach()) {} + listener1.assertEvents("update:{root}->value", "update:value->{root}"); + listener2.assertEvents("update:{root}->value", "update:value->{root}"); + } + + @Test + void testSwapNotifiesListeners() { + TrackingListener listener = trackingListener(); + ContextManager.register(listener); + Context context = root().with(TEST_KEY, "value"); + Context previous = context.swap(); + assertSame(root(), previous); + listener.assertNewEvents("update:{root}->value"); + previous = root().swap(); + assertSame(context, previous); + listener.assertNewEvents("update:value->{root}"); + } +} diff --git a/components/context/src/test/java/datadog/context/ContextListenerExceptionTest.java b/components/context/src/test/java/datadog/context/ContextListenerExceptionTest.java new file mode 100644 index 00000000000..160873e7103 --- /dev/null +++ b/components/context/src/test/java/datadog/context/ContextListenerExceptionTest.java @@ -0,0 +1,68 @@ +package datadog.context; + +import static datadog.context.Context.current; +import static datadog.context.Context.root; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import javax.annotation.ParametersAreNonnullByDefault; +import org.junit.jupiter.api.Test; + +@ParametersAreNonnullByDefault +class ContextListenerExceptionTest extends ContextTestBase { + @Test + void testListenerExceptionSwallowed() { + ContextManager.register( + new ContextListener() { + @Override + public void onUpdate(Context before, Context after) { + throw new RuntimeException("listener failure"); + } + }); + Context context = root().with(TEST_KEY, "value"); + assertDoesNotThrow( + () -> { + try (ContextScope scope = context.attach()) { + assertEquals(context, current()); + } + }); + } + + @Test + void testListenerExceptionSwallowedOnCapture() { + ContextManager.register( + new ContextListener() { + @Override + public void onCapture(Context c) { + throw new RuntimeException("listener failure on capture"); + } + }); + Context context = root().with(TEST_KEY, "value"); + try (ContextScope scope = context.attach()) { + assertDoesNotThrow( + () -> { + ContextContinuation continuation = context.capture(); + assertNotNull(continuation); + assertEquals(context, continuation.context()); + continuation.release(); + }); + } + } + + @Test + void testListenerExceptionSwallowedOnRelease() { + ContextManager.register( + new ContextListener() { + @Override + public void onRelease(Context c) { + throw new RuntimeException("listener failure on release"); + } + }); + Context context = root().with(TEST_KEY, "value"); + try (ContextScope scope = context.attach()) { + ContextContinuation continuation = context.capture(); + assertDoesNotThrow(continuation::release); + } + } +} diff --git a/components/context/src/test/java/datadog/context/ContextManagerTest.java b/components/context/src/test/java/datadog/context/ContextManagerTest.java index d8927abf76d..789f6fc6eaf 100644 --- a/components/context/src/test/java/datadog/context/ContextManagerTest.java +++ b/components/context/src/test/java/datadog/context/ContextManagerTest.java @@ -10,17 +10,9 @@ import java.util.concurrent.Executors; import java.util.concurrent.Future; import java.util.concurrent.Phaser; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -class ContextManagerTest { - @BeforeEach - void init() { - // Ensure no current context prior starting test - assertEquals(root(), current()); - } - +class ContextManagerTest extends ContextTestBase { @Test void testContextAttachment() { Context context1 = root().with(STRING_KEY, "value1"); @@ -57,22 +49,57 @@ void testContextSwapping() { assertEquals(root(), current()); } + @Test + void testNoopScopeContextReturnsAttachedContext() { + Context context = root().with(STRING_KEY, "value"); + try (ContextScope outer = context.attach()) { + // second attach returns a noop scope; verify context() reflects the attached context + try (ContextScope noop = context.attach()) { + assertEquals(context, noop.context()); + } + } + } + + @Test + void testNoopScopeReturnsCorrectContext() { + Context context = root().with(STRING_KEY, "value"); + try (ContextScope outer = context.attach()) { + try (ContextScope noop1 = context.attach(); + ContextScope noop2 = context.attach()) { + assertEquals(context, noop1.context()); + assertEquals(context, noop2.context()); + } + } + } + + @Test + void testNoopScopeCorrectContextAcrossManyContexts() { + for (int i = 0; i < 200; i++) { + Context ctx = root().with(STRING_KEY, "ctx-" + i); + try (ContextScope outer = ctx.attach()) { + try (ContextScope noop = ctx.attach()) { + assertEquals(ctx, noop.context()); + } + } + } + } + @Test void testAttachSameContextMultipleTimes() { Context context = root().with(STRING_KEY, "value1"); - try (ContextScope ignored1 = context.attach()) { + try (ContextScope scope1 = context.attach()) { assertEquals(context, current()); - try (ContextScope ignored2 = context.attach()) { - try (ContextScope ignored3 = context.attach()) { - assertEquals(context, current()); + // re-attaching an already-active context returns a noop scope + try (ContextScope noop2 = context.attach()) { + assertEquals(context, noop2.context()); + try (ContextScope noop3 = context.attach()) { + assertEquals(context, noop3.context()); } - // Test closing a scope on the current context should not deactivate it if activated - // multiple times - assertEquals(context, current()); + assertEquals(context, current()); // noop close: context remains active } + assertEquals(context, current()); // still active after all noop closes } - // Test closing the same number of scope as activation should deactivate the context - assertEquals(root(), current()); + assertEquals(root(), current()); // only the original scope deactivates on close } @Test @@ -96,15 +123,16 @@ void testClosingMultipleTimes() { Context context1 = root().with(STRING_KEY, "value1"); try (ContextScope ignored = context1.attach()) { Context context2 = context1.with(STRING_KEY, "value2"); - ContextScope scope = context2.attach(); - // Test current context - assertEquals(context2, current()); - // Test current context deactivation - scope.close(); - assertEquals(context1, current()); - // Test multiple context deactivations don’t change current context - scope.close(); - assertEquals(context1, current()); + try (ContextScope scope = context2.attach()) { + // Test current context + assertEquals(context2, current()); + // Test current context deactivation + scope.close(); + assertEquals(context1, current()); + // Test multiple context deactivations don’t change current context + scope.close(); + assertEquals(context1, current()); + } } } @@ -208,10 +236,4 @@ void testNonThreadInheritance() { assertDoesNotThrow(() -> future.get()); } } - - @AfterEach - void tearDown() { - // Ensure no current context after ending test - assertEquals(root(), current()); - } } diff --git a/components/context/src/test/java/datadog/context/ContextProvidersForkedTest.java b/components/context/src/test/java/datadog/context/ContextProvidersForkedTest.java index 915186554a6..73c55a28c6f 100644 --- a/components/context/src/test/java/datadog/context/ContextProvidersForkedTest.java +++ b/components/context/src/test/java/datadog/context/ContextProvidersForkedTest.java @@ -2,8 +2,9 @@ import static datadog.context.Context.root; import static datadog.context.ContextTest.STRING_KEY; -import static org.junit.jupiter.api.Assertions.assertEquals; +import static datadog.context.ContextTestBase.trackingListener; import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertTrue; import javax.annotation.Nonnull; @@ -15,13 +16,15 @@ void testCustomBinder() { assertTrue(ContextBinder.allowTesting()); Context context = root().with(STRING_KEY, "value"); + assertNotEquals(root(), context); + Object carrier = new Object(); // should delegate to the default binder context.attachTo(carrier); - assertNotEquals(root(), Context.from(carrier)); - assertEquals(context, Context.detachFrom(carrier)); - assertEquals(root(), Context.from(carrier)); + assertSame(context, Context.from(carrier)); + assertSame(context, Context.detachFrom(carrier)); + assertSame(root(), Context.from(carrier)); // now register a NOOP context binder ContextBinder.register( @@ -44,8 +47,9 @@ public Context detachFrom(@Nonnull Object carrier) { // NOOP binder, context will always be root context.attachTo(carrier); - assertEquals(root(), Context.from(carrier)); - assertEquals(root(), Context.detachFrom(carrier)); + assertSame(root(), Context.from(carrier)); + assertSame(root(), Context.detachFrom(carrier)); + assertSame(root(), Context.from(carrier)); } @Test @@ -53,15 +57,22 @@ void testCustomManager() { assertTrue(ContextManager.allowTesting()); Context context = root().with(STRING_KEY, "value"); + assertNotEquals(root(), context); // should delegate to the default manager - try (ContextScope ignored = context.attach()) { - assertNotEquals(root(), Context.current()); + try (ContextScope scope = context.attach()) { + assertSame(context, scope.context()); + assertSame(context, Context.current()); + ContextContinuation cont = context.capture(); + assertSame(context, cont.context()); + cont.release(); } Context swapped = context.swap(); - assertNotEquals(root(), Context.current()); - swapped.swap(); + assertSame(root(), swapped); + assertSame(context, Context.current()); + assertSame(context, swapped.swap()); + assertSame(root(), Context.current()); // now register a NOOP context manager ContextManager.register( @@ -72,34 +83,44 @@ public Context current() { } @Override - public ContextScope attach(Context context) { - return new ContextScope() { - @Override - public Context context() { - return root(); - } - - @Override - public void close() { - // no-op - } - }; + public ContextScope attach(@Nonnull Context context) { + return new NoopContextScope(root()); } @Override - public Context swap(Context context) { + public Context swap(@Nonnull Context context) { return root(); } + + @Override + public ContextContinuation capture(@Nonnull Context context) { + return new NoopContextContinuation(root()); + } + + @Override + public void addListener(@Nonnull ContextListener listener) {} }); + ContextTestBase.TrackingListener listener = trackingListener(); + ContextManager.register(listener); + // NOOP manager, context will always be root - try (ContextScope ignored = context.attach()) { - assertEquals(root(), Context.current()); + try (ContextScope scope = context.attach()) { + assertSame(root(), scope.context()); + assertSame(root(), Context.current()); + ContextContinuation cont = context.capture(); + assertSame(root(), cont.context()); + cont.release(); } // NOOP manager, context will always be root swapped = context.swap(); - assertEquals(root(), Context.current()); - swapped.swap(); + assertSame(root(), swapped); + assertSame(root(), Context.current()); + assertSame(root(), swapped.swap()); + assertSame(root(), Context.current()); + + // NOOP manager, no events emitted + listener.assertNoEvents(); } } diff --git a/components/context/src/test/java/datadog/context/ContextTest.java b/components/context/src/test/java/datadog/context/ContextTest.java index 8bf69b645cb..d8f50a00df3 100644 --- a/components/context/src/test/java/datadog/context/ContextTest.java +++ b/components/context/src/test/java/datadog/context/ContextTest.java @@ -7,6 +7,7 @@ import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -60,8 +61,10 @@ void testWith(Context context) { // Test null value handling assertDoesNotThrow( () -> context.with(BOOLEAN_KEY, null), "Null value should not throw exception"); - // Test null implicitly keyed value handling - assertDoesNotThrow(() -> context.with(null), "Null implicitly keyed value not throw exception"); + // Test null implicitly keyed value handling - should preserve existing context, not discard it + Context withNull = context1.with((ImplicitContextKeyed) null); + assertEquals( + context1, withNull, "Null implicitly keyed value should preserve existing context"); } @ParameterizedTest @@ -165,6 +168,17 @@ void testToString(Context context) { "Context string representation should contain implementation name"); } + @ParameterizedTest + @MethodSource("contextImplementations") + void testWithSameValueReturnsThis(Context context) { + String value = "value"; + Context context1 = context.with(STRING_KEY, value); + // storing the same value again should return the same instance + assertSame(context1, context1.with(STRING_KEY, value)); + // storing a different value should return a new instance + assertNotEquals(context1, context1.with(STRING_KEY, "other")); + } + @SuppressWarnings({"SimplifiableAssertion"}) @Test void testInflation() { diff --git a/components/context/src/test/java/datadog/context/ContextTestBase.java b/components/context/src/test/java/datadog/context/ContextTestBase.java new file mode 100644 index 00000000000..ac4c76f2482 --- /dev/null +++ b/components/context/src/test/java/datadog/context/ContextTestBase.java @@ -0,0 +1,90 @@ +package datadog.context; + +import static datadog.context.Context.current; +import static datadog.context.Context.root; +import static java.util.Arrays.asList; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.util.ArrayList; +import java.util.List; +import javax.annotation.ParametersAreNonnullByDefault; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; + +@ParametersAreNonnullByDefault +abstract class ContextTestBase { + static final ContextKey TEST_KEY = ContextKey.named("test-key"); + + @BeforeEach + void verifyNoContextBefore() { + assertEquals(root(), current()); + } + + @AfterEach + void verifyNoContextAfter() { + TestContextManager.clearListeners(); + assertEquals(root(), current()); + } + + static TrackingListener trackingListener() { + return new TrackingListener(); + } + + /** + * A {@link ContextListener} that records events suffixed with {@link #TEST_KEY} context values. + * Uses {@code {root}} when the key is absent from the context. + */ + static final class TrackingListener implements ContextListener { + private final List events = new ArrayList<>(); + private int checkpoint; + + @Override + public void onUpdate(Context before, Context after) { + this.events.add("update:" + label(before) + "->" + label(after)); + } + + @Override + public void onCapture(Context context) { + this.events.add("capture:" + label(context)); + } + + @Override + public void onRelease(Context context) { + this.events.add("release:" + label(context)); + } + + private static String label(Context context) { + String value = context.get(TEST_KEY); + return value != null ? value : "{root}"; + } + + /** Asserts the full sequence of recorded events equals {@code expected}. */ + void assertEvents(String... expected) { + assertEquals(asList(expected), new ArrayList<>(this.events)); + } + + /** Asserts that no events have been recorded at all. */ + void assertNoEvents() { + assertEvents(); + } + + /** + * Asserts the events recorded since the previous {@link #assertNewEvents} call equal {@code + * expected}, then advances the checkpoint past them. + */ + void assertNewEvents(String... expected) { + List snapshot = new ArrayList<>(this.events); + List newEvents = new ArrayList<>(snapshot.subList(this.checkpoint, snapshot.size())); + assertEquals(asList(expected), newEvents); + this.checkpoint = snapshot.size(); + } + + /** + * Asserts that no events have been recorded since the previous {@link #assertNewEvents} or + * {@link #assertNoNewEvents} call. + */ + void assertNoNewEvents() { + assertNewEvents(); + } + } +} diff --git a/components/environment/build.gradle.kts b/components/environment/build.gradle.kts index 7818fef2463..f921a6774a2 100644 --- a/components/environment/build.gradle.kts +++ b/components/environment/build.gradle.kts @@ -5,6 +5,10 @@ plugins { apply(from = "$rootDir/gradle/java.gradle") +dependencies { + compileOnly(project(":components:annotations")) +} + /* * Add an addition gradle configuration to be consumed by bootstrap only. * "datadog.trace." prefix is required to be excluded from Jacoco instrumentation. @@ -18,15 +22,11 @@ tasks.shadowJar { * Configure test coverage. */ extra.set("minimumInstructionCoverage", 0.7) -val excludedClassesCoverage by extra { - listOf( - "datadog.environment.JavaVirtualMachine", // depends on OS and JVM vendor - "datadog.environment.JavaVirtualMachine.JvmOptionsHolder", // depends on OS and JVM vendor - "datadog.environment.JvmOptions", // depends on OS and JVM vendor - "datadog.environment.OperatingSystem**", // depends on OS - "datadog.environment.ThreadSupport", // requires Java 21 - ) -} -val excludedClassesBranchCoverage by extra { - listOf("datadog.environment.CommandLine") // tested using forked process -} +extra["excludedClassesCoverage"] = listOf( + "datadog.environment.JavaVirtualMachine", // depends on OS and JVM vendor + "datadog.environment.JavaVirtualMachine.JvmOptionsHolder", // depends on OS and JVM vendor + "datadog.environment.JvmOptions", // depends on OS and JVM vendor + "datadog.environment.OperatingSystem**", // depends on OS + "datadog.environment.ThreadSupport", // requires Java 21 +) +extra["excludedClassesBranchCoverage"] = listOf("datadog.environment.CommandLine") // tested using forked process diff --git a/components/environment/gradle.lockfile b/components/environment/gradle.lockfile index ec6c88c69ae..1222cc58dba 100644 --- a/components/environment/gradle.lockfile +++ b/components/environment/gradle.lockfile @@ -1,10 +1,11 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :components:environment:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -39,10 +40,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -56,10 +57,13 @@ org.mockito:mockito-core:4.4.0=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/components/environment/src/main/java/datadog/environment/JavaVirtualMachine.java b/components/environment/src/main/java/datadog/environment/JavaVirtualMachine.java index ed1ec0ae215..d6fe120c98b 100644 --- a/components/environment/src/main/java/datadog/environment/JavaVirtualMachine.java +++ b/components/environment/src/main/java/datadog/environment/JavaVirtualMachine.java @@ -1,5 +1,6 @@ package datadog.environment; +import datadog.trace.api.internal.VisibleForTesting; import java.util.List; import java.util.Locale; import javax.annotation.Nullable; @@ -116,6 +117,10 @@ public static boolean isIbm8() { return isIbm() && isJavaVersion(8); } + public static boolean isZulu8() { + return runtime.vendor.contains("Azul") && isJavaVersion(8); + } + public static boolean isGraalVM() { return runtime.vendorVersion.toLowerCase().contains("graalvm"); } @@ -208,7 +213,7 @@ public Runtime() { SystemProperties.get("java.vendor.version")); } - // Only visible for testing + @VisibleForTesting Runtime(String javaVer, String rtVer, String name, String vendor, String vendorVersion) { this.name = name == null ? "" : name; this.vendor = vendor == null ? "" : vendor; diff --git a/components/environment/src/main/java/datadog/environment/JvmOptions.java b/components/environment/src/main/java/datadog/environment/JvmOptions.java index ef549bc4d73..7dd77e29ff9 100644 --- a/components/environment/src/main/java/datadog/environment/JvmOptions.java +++ b/components/environment/src/main/java/datadog/environment/JvmOptions.java @@ -5,6 +5,7 @@ import static java.util.Collections.emptyList; import static java.util.Collections.singletonList; +import datadog.trace.api.internal.VisibleForTesting; import de.thetaphi.forbiddenapis.SuppressForbidden; import java.io.BufferedReader; import java.io.IOException; @@ -93,7 +94,7 @@ private List findVmOptions() { // Be aware that when running a native image, the command line in /proc/self/cmdline is just the // executable - // Visible for testing + @VisibleForTesting List findVmOptionsFromProcFs(String[] procfsCmdline) { // Create the list of VM options List vmOptions = new ArrayList<>(); diff --git a/components/environment/src/main/java/datadog/environment/OperatingSystem.java b/components/environment/src/main/java/datadog/environment/OperatingSystem.java index 1d24d7680c9..7e64e6bdb33 100644 --- a/components/environment/src/main/java/datadog/environment/OperatingSystem.java +++ b/components/environment/src/main/java/datadog/environment/OperatingSystem.java @@ -213,5 +213,14 @@ static Architecture current() { String property = SystemProperties.getOrDefault(OS_ARCH_PROPERTY, "").toLowerCase(ROOT); return Architecture.of(property); } + + /** + * Checks whether the architecture is arm64. + * + * @return {@code true} if architecture is arm64, {@code false} otherwise. + */ + public boolean isArm64() { + return this == ARM64; + } } } diff --git a/components/environment/src/main/java/datadog/environment/ThreadSupport.java b/components/environment/src/main/java/datadog/environment/ThreadSupport.java index 861215ca837..4c3221ceca1 100644 --- a/components/environment/src/main/java/datadog/environment/ThreadSupport.java +++ b/components/environment/src/main/java/datadog/environment/ThreadSupport.java @@ -24,8 +24,8 @@ public final class ThreadSupport { private ThreadSupport() {} /** - * Provides the best identifier available for the current {@link Thread}. Uses {@link - * Thread#threadId()} on 19+ or {@link Thread#getId()} on older JVMs. + * Provides the best identifier available for the current {@link Thread}. Uses {@code + * Thread.threadId()} on 19+ or {@link Thread#getId()} on older JVMs. * * @return The best identifier available for the current {@link Thread}. */ @@ -34,8 +34,8 @@ public static long threadId() { } /** - * Provides the best identifier available for the given {@link Thread}. Uses {@link - * Thread#threadId()} on 19+ or {@link Thread#getId()} on older JVMs. + * Provides the best identifier available for the given {@link Thread}. Uses {@code + * Thread.threadId()} on 19+ or {@link Thread#getId()} on older JVMs. * * @return The best identifier available for the given {@link Thread}. */ diff --git a/components/environment/src/test/java/datadog/environment/JavaVirtualMachineTest.java b/components/environment/src/test/java/datadog/environment/JavaVirtualMachineTest.java index 7d540045205..a81c83456f9 100644 --- a/components/environment/src/test/java/datadog/environment/JavaVirtualMachineTest.java +++ b/components/environment/src/test/java/datadog/environment/JavaVirtualMachineTest.java @@ -138,6 +138,16 @@ void onlyOnOracleJDK8() { assertTrue(JavaVirtualMachine.isOracleJDK8()); } + @Test + @EnabledIfSystemProperty(named = "java.vm.vendor", matches = ".*Azul.*") + @EnabledOnJre(JAVA_8) + void onlyOnZulu8() { + assertFalse(JavaVirtualMachine.isGraalVM()); + assertFalse(JavaVirtualMachine.isIbm8()); + assertFalse(JavaVirtualMachine.isOracleJDK8()); + assertTrue(JavaVirtualMachine.isZulu8()); + } + @ParameterizedTest @CsvSource( value = { diff --git a/components/http/http-api/build.gradle.kts b/components/http/http-api/build.gradle.kts index 314579b64db..3175c919318 100644 --- a/components/http/http-api/build.gradle.kts +++ b/components/http/http-api/build.gradle.kts @@ -7,23 +7,21 @@ apply(from = "$rootDir/gradle/java.gradle") description = "HTTP Client API" -val minimumBranchCoverage by extra(0) // extra(0.7) -- need a library implementation -val minimumInstructionCoverage by extra(0) // extra(0.7) -- need a library implementation +extra["minimumBranchCoverage"] = 0 // extra(0.7) -- need a library implementation +extra["minimumInstructionCoverage"] = 0 // extra(0.7) -- need a library implementation // Exclude interfaces for test coverage -val excludedClassesCoverage by extra( - listOf( - "datadog.http.client.HttpClient", - "datadog.http.client.HttpClient.Builder", - "datadog.http.client.HttpRequest", - "datadog.http.client.HttpRequest.Builder", - "datadog.http.client.HttpRequestBody", - "datadog.http.client.HttpRequestBody.MultipartBuilder", - "datadog.http.client.HttpRequestListener", - "datadog.http.client.HttpResponse", - "datadog.http.client.HttpUrl", - "datadog.http.client.HttpUrl.Builder", - ) +extra["excludedClassesCoverage"] = listOf( + "datadog.http.client.HttpClient", + "datadog.http.client.HttpClient.Builder", + "datadog.http.client.HttpRequest", + "datadog.http.client.HttpRequest.Builder", + "datadog.http.client.HttpRequestBody", + "datadog.http.client.HttpRequestBody.MultipartBuilder", + "datadog.http.client.HttpRequestListener", + "datadog.http.client.HttpResponse", + "datadog.http.client.HttpUrl", + "datadog.http.client.HttpUrl.Builder", ) dependencies { diff --git a/components/http/http-api/gradle.lockfile b/components/http/http-api/gradle.lockfile index 3a2aadfa4d8..04076e37ad3 100644 --- a/components/http/http-api/gradle.lockfile +++ b/components/http/http-api/gradle.lockfile @@ -1,10 +1,11 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :components:http:http-api:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -39,10 +40,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -57,10 +58,13 @@ org.mockito:mockito-core:4.4.0=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/components/json/gradle.lockfile b/components/json/gradle.lockfile index 7e798424d36..92e8585d4db 100644 --- a/components/json/gradle.lockfile +++ b/components/json/gradle.lockfile @@ -1,10 +1,11 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :components:json:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,jmhCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -41,10 +42,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=jmhRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -62,11 +63,14 @@ org.openjdk.jmh:jmh-generator-bytecode:1.37=jmh,jmhCompileClasspath,jmhRuntimeCl org.openjdk.jmh:jmh-generator-reflection:1.37=jmh,jmhCompileClasspath,jmhRuntimeClasspath org.opentest4j:opentest4j:1.3.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs org.ow2.asm:asm:9.0=jmh,jmhCompileClasspath,jmhRuntimeClasspath -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/components/json/src/main/java/datadog/json/JsonMapper.java b/components/json/src/main/java/datadog/json/JsonMapper.java index 4a69b7d7d93..1233f7ebde6 100644 --- a/components/json/src/main/java/datadog/json/JsonMapper.java +++ b/components/json/src/main/java/datadog/json/JsonMapper.java @@ -69,7 +69,7 @@ public static String toJson(Map map) { } /** - * Converts a {@link Iterable} to a JSON array. + * Converts a {@code Iterable} to a JSON array. * * @param items The iterable to convert. * @return The converted JSON array as Java string. @@ -132,10 +132,10 @@ public static Map fromJsonToMap(String json) throws IOException } /** - * Parses a JSON string array into a {@link List}. + * Parses a JSON string array into a {@code List}. * * @param json The JSON string array to parse. - * @return A {@link List} containing the parsed JSON strings. + * @return A {@code List} containing the parsed JSON strings. * @throws IOException If the JSON is invalid or a reader error occurs. */ public static List fromJsonToList(String json) throws IOException { diff --git a/components/json/src/main/java/datadog/json/JsonWriter.java b/components/json/src/main/java/datadog/json/JsonWriter.java index 7e09b800717..0fcde05a629 100644 --- a/components/json/src/main/java/datadog/json/JsonWriter.java +++ b/components/json/src/main/java/datadog/json/JsonWriter.java @@ -1,7 +1,6 @@ package datadog.json; import static java.nio.charset.StandardCharsets.UTF_8; -import static java.util.Locale.ROOT; import java.io.ByteArrayOutputStream; import java.io.Flushable; @@ -14,6 +13,7 @@ */ public final class JsonWriter implements Flushable, AutoCloseable { private static final int INITIAL_CAPACITY = 256; + private static final char[] HEX_DIGITS = "0123456789ABCDEF".toCharArray(); private final ByteArrayOutputStream outputStream; private final OutputStreamWriter writer; private final JsonStructure structure; @@ -282,14 +282,10 @@ private void writeStringLiteral(String str) { if (c > 127) { this.writer.write('\\'); this.writer.write('u'); - String hexCharacter = Integer.toHexString(c).toUpperCase(ROOT); - if (c < 4096) { - this.writer.write('0'); - if (c < 256) { - this.writer.write('0'); - } - } - this.writer.append(hexCharacter); + this.writer.write(HEX_DIGITS[(c >>> 12) & 0xF]); + this.writer.write(HEX_DIGITS[(c >>> 8) & 0xF]); + this.writer.write(HEX_DIGITS[(c >>> 4) & 0xF]); + this.writer.write(HEX_DIGITS[c & 0xF]); } else { switch (c) { case '"': // Quotation mark @@ -319,7 +315,16 @@ private void writeStringLiteral(String str) { this.writer.write('t'); break; default: - this.writer.write(c); + if (c < 0x20) { + this.writer.write('\\'); + this.writer.write('u'); + this.writer.write('0'); + this.writer.write('0'); + this.writer.write(HEX_DIGITS[(c >>> 4) & 0xF]); + this.writer.write(HEX_DIGITS[c & 0xF]); + } else { + this.writer.write(c); + } break; } } diff --git a/components/json/src/test/java/datadog/json/JsonReaderTest.java b/components/json/src/test/java/datadog/json/JsonReaderTest.java index 15a635c148a..e716a625103 100644 --- a/components/json/src/test/java/datadog/json/JsonReaderTest.java +++ b/components/json/src/test/java/datadog/json/JsonReaderTest.java @@ -215,8 +215,7 @@ void testStringEscaping() { assertEquals("\n", reader.nextString()); assertEquals("\r", reader.nextString()); assertEquals("\t", reader.nextString()); - // Explicit escape for non-ASCII `É` to make test independent of container settings. - assertEquals("\u00C9", reader.nextString()); + assertEquals("É", reader.nextString()); reader.endArray(); } catch (IOException e) { fail("Failed to read escaped JSON strings", e); diff --git a/components/json/src/test/java/datadog/json/JsonWriterTest.java b/components/json/src/test/java/datadog/json/JsonWriterTest.java index ac22095d801..d6239a053cc 100644 --- a/components/json/src/test/java/datadog/json/JsonWriterTest.java +++ b/components/json/src/test/java/datadog/json/JsonWriterTest.java @@ -100,6 +100,16 @@ void testStringEscaping() { } } + @Test + void testControlCharacterEscaping() { + try (JsonWriter writer = new JsonWriter()) { + writer.beginArray().value("\u0001").value("\u001F").endArray(); + + assertEquals( + "[\"\\u0001\",\"\\u001F\"]", writer.toString(), "Check control character escaping"); + } + } + @Test void testArrayObjectNesting() { try (JsonWriter writer = new JsonWriter()) { diff --git a/components/native-loader/gradle.lockfile b/components/native-loader/gradle.lockfile index e7ab997a313..bd0a3b93a8a 100644 --- a/components/native-loader/gradle.lockfile +++ b/components/native-loader/gradle.lockfile @@ -1,10 +1,11 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :components:native-loader:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -39,10 +40,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -56,10 +57,13 @@ org.mockito:mockito-core:4.4.0=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/agent-aiguard/build.gradle b/dd-java-agent/agent-aiguard/build.gradle index 5e4841dbf3c..40d7d7d8d1f 100644 --- a/dd-java-agent/agent-aiguard/build.gradle +++ b/dd-java-agent/agent-aiguard/build.gradle @@ -2,10 +2,10 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar plugins { id 'com.gradleup.shadow' + id 'dd-trace-java.version-file' } apply from: "$rootDir/gradle/java.gradle" -apply from: "$rootDir/gradle/version.gradle" java { sourceCompatibility = JavaVersion.VERSION_1_8 @@ -34,4 +34,3 @@ tasks.named("shadowJar", ShadowJar) { tasks.named("jar", Jar) { archiveClassifier = 'unbundled' } - diff --git a/dd-java-agent/agent-aiguard/gradle.lockfile b/dd-java-agent/agent-aiguard/gradle.lockfile index 4f3827b2a8b..95e79c0717b 100644 --- a/dd-java-agent/agent-aiguard/gradle.lockfile +++ b/dd-java-agent/agent-aiguard/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-aiguard:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -15,15 +16,15 @@ com.fasterxml.jackson.core:jackson-core:2.20.0=testCompileClasspath,testRuntimeC com.fasterxml.jackson.core:jackson-databind:2.20.0=testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.20.0=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -39,8 +40,8 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -63,10 +64,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -81,14 +82,17 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt org.ow2.asm:asm-commons:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt org.ow2.asm:asm-tree:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt org.ow2.asm:asm:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.9=spotbugs org.skyscreamer:jsonassert:1.5.3=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/agent-aiguard/src/main/java/com/datadog/aiguard/AIGuardInternal.java b/dd-java-agent/agent-aiguard/src/main/java/com/datadog/aiguard/AIGuardInternal.java index 1aabdff4598..d921be448d8 100644 --- a/dd-java-agent/agent-aiguard/src/main/java/com/datadog/aiguard/AIGuardInternal.java +++ b/dd-java-agent/agent-aiguard/src/main/java/com/datadog/aiguard/AIGuardInternal.java @@ -11,7 +11,9 @@ import com.squareup.moshi.Moshi; import com.squareup.moshi.Types; import datadog.communication.http.OkHttpUtils; +import datadog.context.ContextScope; import datadog.trace.api.Config; +import datadog.trace.api.ProductTraceSource; import datadog.trace.api.aiguard.AIGuard; import datadog.trace.api.aiguard.AIGuard.AIGuardAbortError; import datadog.trace.api.aiguard.AIGuard.AIGuardClientError; @@ -26,7 +28,6 @@ import datadog.trace.api.aiguard.noop.NoOpEvaluator; import datadog.trace.api.gateway.RequestContext; import datadog.trace.api.telemetry.WafMetricCollector; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; import datadog.trace.bootstrap.instrumentation.api.ClientIpAddressData; @@ -71,7 +72,7 @@ public BadConfigurationException(final String message) { static final String ACTION_TAG = "ai_guard.action"; static final String REASON_TAG = "ai_guard.reason"; static final String BLOCKED_TAG = "ai_guard.blocked"; - static final String EVENT_TAG = "ai_guard.event"; + static final String META_STRUCT_TAG = "ai_guard"; static final String META_STRUCT_MESSAGES = "messages"; static final String META_STRUCT_CATEGORIES = "attack_categories"; @@ -269,19 +270,20 @@ public Evaluation evaluate(final List messages, final Options options) final AgentTracer.SpanBuilder builder = tracer.buildSpan(SPAN_NAME, SPAN_NAME); final AgentSpan parent = AgentTracer.activeSpan(); if (parent != null) { - builder.asChildOf(parent.context()); + builder.asChildOf(parent.spanContext()); } final AgentSpan span = builder.start(); final AgentSpan localRootSpan = span.getLocalRootSpan(); if (localRootSpan != null) { localRootSpan.setTag(Tags.AI_GUARD_KEEP, true); - localRootSpan.setTag(EVENT_TAG, true); + localRootSpan.setTag(Tags.AI_GUARD_EVENT, true); + localRootSpan.setTag(Tags.PROPAGATED_TRACE_SOURCE, ProductTraceSource.AI_GUARD); applyClientIpTags(localRootSpan); // copyAnomalyDetectionTags MUST run after applyClientIpTags, to make // sure client IP tags were populated. copyAnomalyDetectionTags(span, localRootSpan); } - try (final AgentScope scope = tracer.activateSpan(span)) { + try (final ContextScope scope = tracer.activateSpan(span)) { final Message last = messages.get(messages.size() - 1); if (isToolCall(last)) { span.setTag(TARGET_TAG, "tool"); diff --git a/dd-java-agent/agent-aiguard/src/test/groovy/com/datadog/aiguard/AIGuardInternalTests.groovy b/dd-java-agent/agent-aiguard/src/test/groovy/com/datadog/aiguard/AIGuardInternalTests.groovy index 406b16c7025..114e83da3f1 100644 --- a/dd-java-agent/agent-aiguard/src/test/groovy/com/datadog/aiguard/AIGuardInternalTests.groovy +++ b/dd-java-agent/agent-aiguard/src/test/groovy/com/datadog/aiguard/AIGuardInternalTests.groovy @@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.PropertyNamingStrategies import com.squareup.moshi.Moshi import datadog.common.version.VersionInfo import datadog.trace.api.Config +import datadog.trace.api.ProductTraceSource import datadog.trace.api.aiguard.AIGuard import datadog.trace.api.gateway.RequestContext import datadog.trace.api.telemetry.WafMetricCollector @@ -192,7 +193,8 @@ class AIGuardInternalTests extends DDSpecification { then: 1 * span.setTag(AIGuardInternal.TARGET_TAG, suite.target) 1 * localRootSpan.setTag(Tags.AI_GUARD_KEEP, true) - 1 * localRootSpan.setTag(AIGuardInternal.EVENT_TAG, true) + 1 * localRootSpan.setTag(Tags.AI_GUARD_EVENT, true) + 1 * localRootSpan.setTag(Tags.PROPAGATED_TRACE_SOURCE, ProductTraceSource.AI_GUARD) if (suite.target == 'tool') { 1 * span.setTag(AIGuardInternal.TOOL_TAG, 'calc') } @@ -861,6 +863,28 @@ class AIGuardInternalTests extends DDSpecification { } } + void 'test adapter serializes content parts'() { + given: + final adapter = new Moshi.Builder().add(new AIGuardInternal.AIGuardFactory()).build() + .adapter(AIGuard.Message) + + expect: + // STRICT enforces array element ordering (object key order is always ignored), so a regression + // that serialized the content parts out of sequence would be caught here + JSONAssert.assertEquals(expected, adapter.toJson(message), JSONCompareMode.STRICT) + + where: + message | expected + AIGuard.Message.message('user', [] as List) | '{"role": "user", "content": []}' + AIGuard.Message.message('user', [AIGuard.ContentPart.text('Hello world')]) | '{"role": "user", "content": [{"type": "text", "text": "Hello world"}]}' + AIGuard.Message.message('user', [AIGuard.ContentPart.imageUrl('https://example.com/image.jpg')]) | '{"role": "user", "content": [{"type": "image_url", "image_url": {"url": "https://example.com/image.jpg"}}]}' + AIGuard.Message.message('user', [ + AIGuard.ContentPart.text('Describe this image:'), + AIGuard.ContentPart.imageUrl('https://example.com/image.jpg'), + AIGuard.ContentPart.text('What do you see?') + ]) | '{"role": "user", "content": [{"type": "text", "text": "Describe this image:"}, {"type": "image_url", "image_url": {"url": "https://example.com/image.jpg"}}, {"type": "text", "text": "What do you see?"}]}' + } + void 'test backward compatibility with string content'() { given: final aiguard = mockClient(200, [data: [attributes: [action: 'ALLOW', reason: 'Good']]]) diff --git a/dd-java-agent/agent-bootstrap/build.gradle b/dd-java-agent/agent-bootstrap/build.gradle index de0d326341e..398c9ad1351 100644 --- a/dd-java-agent/agent-bootstrap/build.gradle +++ b/dd-java-agent/agent-bootstrap/build.gradle @@ -23,6 +23,7 @@ dependencies { api project(':dd-java-agent:agent-debugger:debugger-bootstrap') api project(':components:environment') api project(':components:json') + api project(':products:feature-flagging:feature-flagging-config') api project(':products:metrics:metrics-agent') api libs.instrument.java api libs.slf4j @@ -30,6 +31,8 @@ dependencies { testImplementation project(':dd-java-agent:testing') testImplementation group: 'com.google.guava', name: 'guava-testlib', version: '20.0' + testImplementation libs.bundles.junit5 + testImplementation libs.bundles.mockito } // Must use Java 11 to build JFR enabled code - there is no JFR in OpenJDK 8 (revisit once JFR in Java 8 is available) @@ -69,4 +72,9 @@ tasks.withType(Test).configureEach { JavaVersion.VERSION_16, ['--add-opens', 'java.base/java.net=ALL-UNNAMED'] // for HostNameResolverForkedTest ) + conditionalJvmArgs( + it, + JavaVersion.VERSION_11, + ['--add-opens', 'jdk.jfr/jdk.jfr.events=ALL-UNNAMED'] // for JfrEventHolderInitForkedTest + ) } diff --git a/dd-java-agent/agent-bootstrap/gradle.lockfile b/dd-java-agent/agent-bootstrap/gradle.lockfile index 0ba47412aa0..e4c577137eb 100644 --- a/dd-java-agent/agent-bootstrap/gradle.lockfile +++ b/dd-java-agent/agent-bootstrap/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-bootstrap:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=jmhRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=jmhRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,29 +9,32 @@ ch.qos.logback:logback-core:1.2.13=jmhRuntimeClasspath,testCompileClasspath,test com.blogspot.mydailyjava:weak-lock-free:0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,main_java11CompileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=jmhRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=jmhRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=jmhRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=jmhRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=jmhRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=jmhRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=jmhRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=jmhRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=jmhRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=jmhRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=jmhRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=jmhRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=jmhRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=jmhRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=jmhRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,jmhCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs -com.google.errorprone:error_prone_annotations:2.0.12=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava-testlib:20.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.guava:guava:20.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=jmhRuntimeClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=jmhRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -41,13 +45,13 @@ commons-io:commons-io:2.11.0=jmhRuntimeClasspath,testCompileClasspath,testRuntim commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=jmhRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=jmhRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=jmhRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=jmhRuntimeClasspath,testRuntimeClasspath junit:junit:4.8.2=testCompileClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=jmhRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=jmhRuntimeClasspath,testRuntimeClasspath net.sf.jopt-simple:jopt-simple:5.0.4=jmh,jmhCompileClasspath,jmhRuntimeClasspath @@ -75,12 +79,13 @@ org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=jmhRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.jctools:jctools-core-jdk11:4.0.6=jmhRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=jmhRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=jmhRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -93,7 +98,8 @@ org.junit.platform:junit-platform-suite-api:1.14.1=jmhRuntimeClasspath,testRunti org.junit.platform:junit-platform-suite-commons:1.14.1=jmhRuntimeClasspath,testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.mockito:mockito-core:4.4.0=jmhRuntimeClasspath,testRuntimeClasspath +org.mockito:mockito-core:4.4.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-junit-jupiter:4.4.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.openjdk.jmh:jmh-core:1.37=jmh,jmhCompileClasspath,jmhRuntimeClasspath org.openjdk.jmh:jmh-generator-asm:1.37=jmh,jmhCompileClasspath,jmhRuntimeClasspath @@ -102,15 +108,17 @@ org.openjdk.jmh:jmh-generator-reflection:1.37=jmh,jmhCompileClasspath,jmhRuntime org.opentest4j:opentest4j:1.3.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=jmhRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt org.ow2.asm:asm-commons:9.7.1=jmhRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt org.ow2.asm:asm-tree:9.7.1=jmhRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=jmhRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs org.ow2.asm:asm:9.0=jmh,jmhCompileClasspath -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm:9.9.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.10.1=jacocoAnt,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/agent-bootstrap/src/jmh/java/datadog/trace/bootstrap/instrumentation/dbm/SharedDBCommenterBenchmark.java b/dd-java-agent/agent-bootstrap/src/jmh/java/datadog/trace/bootstrap/instrumentation/dbm/SharedDBCommenterBenchmark.java new file mode 100644 index 00000000000..1919dab923c --- /dev/null +++ b/dd-java-agent/agent-bootstrap/src/jmh/java/datadog/trace/bootstrap/instrumentation/dbm/SharedDBCommenterBenchmark.java @@ -0,0 +1,86 @@ +package datadog.trace.bootstrap.instrumentation.dbm; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.annotations.Warmup; + +/** + * Benchmark for {@link SharedDBCommenter#containsTraceComment(String)} — the per-query check run + * during inject (via {@code hasDDComment}) to avoid double-commenting an already-tagged statement. + * + *

What we're measuring. {@code containsTraceComment} currently does {@code + * commentContent.contains(KEY + "=")} for nine keys. The keys are {@code static final} but assigned + * via {@code encode(...)}, so they are not compile-time constants — each {@code KEY + "="} + * is a fresh {@code StringBuilder} concat on every call. A non-matching comment runs all nine + * checks = nine throwaway Strings per call. The proposed fix precomputes nine {@code KEY_EQ} + * constants once. + * + *

How we make the win visible (our usual approach). Run at {@code @Threads(8)} so the + * allocation churn manifests as a throughput delta — GC is a shared-heap tax, so a + * single-threaded run (cheap TLAB bumps) hides it, while concurrent allocation across threads + * drives GC pauses that every thread pays. Read the ops/s delta as the headline win. Corroborate + * the mechanism with the GC profiler: {@code -prof gc} → {@code gc.alloc.rate.norm} (B/op) should + * drop by ~nine small Strings per call on the non-matching path. + * + *

Protocol. Run this on the current code (baseline), then after the {@code + * KEY_EQ}-constant fix, and compare. The input mix is mostly non-DD comments (the common case — + * they run all nine checks, the exact all-nine-concats path the fix removes); the DD comment + * short-circuits on the first check. + * + *

+ *   # agent-bootstrap has no -Pjmh.includes wiring yet (a generalization is in flight), so for now
+ *   # either run the whole module (only a handful of benchmarks) ...
+ *   ./gradlew :dd-java-agent:agent-bootstrap:jmh
+ *   # ... or hack a temporary filter into agent-bootstrap/build.gradle: jmh { includes = ['SharedDBCommenter.*'] }
+ *   # add -prof gc (gc.alloc.rate.norm) to corroborate the allocation delta.
+ * 
+ * + *

Results (JDK 17, MacBook M-series, {@code @Threads(8)}, {@code @Fork(5)}, {@code -prof + * gc}): + * + *

+ *                    throughput            gc.alloc.rate.norm
+ *   before (concat)  33.5M ± 2.0M ops/s    156 B/op
+ *   after  (*_EQ)    62.1M ± 3.8M ops/s    ~0  B/op  (10^-5)
+ * 
+ * + * Removing the per-call concatenation drops allocation to ~0 and lifts throughput ~1.9x at + * {@code @Threads(8)} — the allocation win surfacing as throughput, exactly as intended; {@code + * -prof gc} confirms the mechanism (156 -> 0 B/op). + */ +@Fork(5) +@Warmup(iterations = 2) +@Measurement(iterations = 5) +@Threads(8) +public class SharedDBCommenterBenchmark { + + // Inner comment content (the surrounding "/*" "*/" already stripped by extractCommentContent), + // as a realistic mix: most queries carry a non-DD comment (or none); some already have ours. + static final String[] COMMENT_CONTENTS = { + "app generated comment", // non-DD -> all 9 contains checks (9 concats) + "route='/api/v1/users',batch=true", // non-DD + "framework='hibernate',layer='orm'", // non-DD + "ddps='web',dddbs='orders',traceparent='00-abc-def-01'", // DD -> short-circuits on 1st check + }; + + /** Per-thread cursor so threads don't contend on a shared index under {@code @Threads(8)}. */ + @State(Scope.Thread) + public static class Cursor { + int index = 0; + + String next() { + int i = index; + index = (i + 1) % COMMENT_CONTENTS.length; + return COMMENT_CONTENTS[i]; + } + } + + @Benchmark + public boolean containsTraceComment(Cursor cursor) { + return SharedDBCommenter.containsTraceComment(cursor.next()); + } +} diff --git a/dd-java-agent/agent-bootstrap/src/jmh/java/datadog/trace/bootstrap/instrumentation/decorator/HttpServerDecoratorBenchmark.java b/dd-java-agent/agent-bootstrap/src/jmh/java/datadog/trace/bootstrap/instrumentation/decorator/HttpServerDecoratorBenchmark.java index f29efc9251a..e655c3213cd 100644 --- a/dd-java-agent/agent-bootstrap/src/jmh/java/datadog/trace/bootstrap/instrumentation/decorator/HttpServerDecoratorBenchmark.java +++ b/dd-java-agent/agent-bootstrap/src/jmh/java/datadog/trace/bootstrap/instrumentation/decorator/HttpServerDecoratorBenchmark.java @@ -32,6 +32,7 @@ import org.openjdk.jmh.annotations.Setup; import org.openjdk.jmh.annotations.State; import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; @State(Scope.Benchmark) @Warmup(iterations = 4, time = 30, timeUnit = SECONDS) @@ -64,8 +65,9 @@ public void setUp() { } @Benchmark - public AgentSpan onRequest() { - return decorator.onRequest(span, null, request, root()); + public void onRequest(Blackhole bh) { + decorator.onRequest(span, null, request, root()); + bh.consume(span); } public static class Request { diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/Agent.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/Agent.java index 5288f92dbe3..555e027d498 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/Agent.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/Agent.java @@ -1,5 +1,6 @@ package datadog.trace.bootstrap; +import static datadog.environment.JavaVirtualMachine.isHotspot; import static datadog.environment.JavaVirtualMachine.isJavaVersionAtLeast; import static datadog.environment.JavaVirtualMachine.isOracleJDK8; import static datadog.trace.api.Config.isExplicitlyDisabled; @@ -34,7 +35,6 @@ import datadog.trace.api.config.CrashTrackingConfig; import datadog.trace.api.config.CwsConfig; import datadog.trace.api.config.DebuggerConfig; -import datadog.trace.api.config.FeatureFlaggingConfig; import datadog.trace.api.config.GeneralConfig; import datadog.trace.api.config.IastConfig; import datadog.trace.api.config.JmxFetchConfig; @@ -44,6 +44,7 @@ import datadog.trace.api.config.TraceInstrumentationConfig; import datadog.trace.api.config.TracerConfig; import datadog.trace.api.config.UsmConfig; +import datadog.trace.api.featureflag.config.FeatureFlaggingConfig; import datadog.trace.api.gateway.RequestContextSlot; import datadog.trace.api.gateway.SubscriptionService; import datadog.trace.api.git.EmbeddedGitInfoBuilder; @@ -60,6 +61,7 @@ import datadog.trace.bootstrap.instrumentation.jfr.InstrumentationBasedProfiling; import datadog.trace.util.AgentTaskScheduler; import datadog.trace.util.AgentThreadFactory.AgentThread; +import datadog.trace.util.JDK9ModuleAccess; import datadog.trace.util.throwable.FatalAgentMisconfigurationError; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.lang.instrument.Instrumentation; @@ -336,6 +338,8 @@ public static void start( StaticEventLogger.end("crashtracking"); } + AgentTracer.maybeInstallLegacyContextManager(); + startDatadogAgent(initTelemetry, inst); final EnumSet libraries = detectLibraries(log); @@ -442,12 +446,6 @@ private static boolean configureDataJobsMonitoring() { propertyNameToSystemPropertyName("integration.spark.enabled"), "true"); setSystemPropertyDefault( propertyNameToSystemPropertyName("integration.spark-executor.enabled"), "true"); - // needed for e2e pipeline - setSystemPropertyDefault(propertyNameToSystemPropertyName("data.streams.enabled"), "true"); - setSystemPropertyDefault( - propertyNameToSystemPropertyName("integration.aws-sdk.enabled"), "true"); - setSystemPropertyDefault( - propertyNameToSystemPropertyName("integration.kafka.enabled"), "true"); if ("true".equals(ddGetProperty(propertyNameToSystemPropertyName(DATA_JOBS_ENABLED)))) { setSystemPropertyDefault( @@ -665,6 +663,8 @@ public InstallDatadogTracerCallback( } installDatadogMeter(initTelemetry); + // Must run before installDatadogTracer, which triggers the ddprof profiler load. + prepareDatadogProfilerContextStorage(instrumentation); installDatadogTracer(initTelemetry, scoClass, sco); maybeInstallLogsIntake(scoClass, sco); maybeStartIast(instrumentation); @@ -682,13 +682,15 @@ public void execute() { } maybeStartAppSec(scoClass, sco); + maybeStartScaReachability(instrumentation); maybeStartCiVisibility(instrumentation, scoClass, sco); maybeStartLLMObs(instrumentation, scoClass, sco); - // start debugger before remote config to subscribe to it before starting to poll + // Start RC-backed products before remote config so their products and capabilities are + // included in the first poll. maybeStartDebugger(instrumentation, scoClass, sco); + maybeStartFeatureFlagging(scoClass, sco); maybeStartRemoteConfig(scoClass, sco); maybeStartAiGuard(); - maybeStartFeatureFlagging(scoClass, sco); if (telemetryEnabled) { startTelemetry(instrumentation, scoClass, sco); @@ -907,6 +909,8 @@ private static synchronized void startJmx() { } } if (profilingEnabled) { + // Both of these register JFR events through registerJfrEvents(), which force-initializes the + // JDK's JFR event-holder class first (see initializeJfrEventHolderClass) to avoid a deadlock. registerDeadlockDetectionEvent(); registerSmapEntryEvent(); if (PROFILER_INIT_AFTER_JMX != null) { @@ -936,40 +940,143 @@ When getJmxStartDelay() is set to 0 we will attempt to initialize the JMX subsys private static synchronized void registerDeadlockDetectionEvent() { log.debug("Initializing JMX thread deadlock detector"); + registerJfrEvents( + "com.datadog.profiling.controller.openjdk.events.DeadlockEventFactory", + "JMX thread deadlock detection"); + } + + private static void initializeJfrEventHolderClass() { + initializeJfrEventHolderClass(AGENT_CLASSLOADER); + } + + /** + * Force-initializes the JDK's JFR event-holder class early to avoid an ABBA deadlock between + * {@code jdk.jfr.internal.Utils}'s monitor and the holder class's initialization lock. See JDK-8371889 and the SCP-1278 thread + * dump. + * + *

The holder's {@code } looks up the JDK's built-in event handlers through {@code + * jdk.jfr.internal.Utils} (taking its monitor); conversely, JFR event registration initializes + * the holder while holding that same monitor. The deadlock forms when one thread holds the {@code + * Utils} monitor and wants the holder's class-init lock, while another thread holds the + * class-init lock (running {@code }) and wants the {@code Utils} monitor. In SCP-1278 + * this was the profiler's smap-event registration (holding {@code Utils}) against a concurrent + * JMXFetch ByteBuddy transform that had triggered the holder {@code }. Running the {@code + * } here, on this thread, before we register our own JFR events, means the holder is + * already initialized by then, so the cycle cannot form. + * + *

Ordering matters twice over: + * + *

    + *
  • We force {@code FlightRecorder} initialization first, which registers the JDK's built-in + * events (via {@code JDKEvents.initialize()}). The holder's fields are {@code static final} + * and are populated from {@code Utils} at {@code } time; running {@code } + * before the events are registered would cache {@code null} into those fields permanently + * and silently disable the built-in socket/file/exception JFR events (verified on JDK + * 17.0.17 and 21.0.9). This mirrors the JDK's own fix, which initializes the holder only + * after {@code JDKEvents.initialize()}. The event registration below would trigger the same + * {@code FlightRecorder} initialization anyway; we merely order it ahead of the holder + * {@code }. If {@code FlightRecorder} init fails, JFR is unavailable and there is + * nothing to protect against, so we skip the holder init entirely. + *
  • {@link Class#forName(String, boolean, ClassLoader)} with {@code initialize=true} is + * required: {@link ClassLoader#loadClass(String)} would only load the class without running + * {@code }, so it would neither take the class-init lock early nor prevent the + * deadlock. + *
+ * + *

The holder class was renamed across JDK versions, so it is selected by version (see {@link + * #jfrEventHolderClassName()}): {@code jdk.jfr.events.Handlers} on JDK 15-18, {@code + * jdk.jfr.events.EventConfigurations} on JDK 19-22. Earlier JDKs (including 11 LTS) predate the + * holder and JDK 23+ removed the eager-init pattern; on those this method does nothing. On + * patched JDKs (the JDK-8371889 fix was backported to 21.0.11) the JDK already initializes the + * holder safely during {@code FlightRecorder} startup, so forcing it here is a harmless no-op. + * + * @param loader class loader used to resolve the JFR classes (package-private for testing; see + * JfrEventHolderInitForkedTest) + */ + static void initializeJfrEventHolderClass(final ClassLoader loader) { + final String holderClassName = jfrEventHolderClassName(); + if (holderClassName == null) { + return; // no eager-init holder on this JDK, so there is no deadlock to prevent + } try { - final Class deadlockFactoryClass = - AGENT_CLASSLOADER.loadClass( - "com.datadog.profiling.controller.openjdk.events.DeadlockEventFactory"); - final Method registerMethod = deadlockFactoryClass.getMethod("registerEvents"); - registerMethod.invoke(null); - } catch (final NoClassDefFoundError - | ClassNotFoundException - | UnsupportedClassVersionError ignored) { - log.debug("JMX deadlock detection not supported"); - } catch (final Throwable ex) { - log.error("Unable to initialize JMX thread deadlock detector", ex); + // Register the JDK's built-in JFR events first, so the holder's below sees non-null + // handlers instead of caching null. + Class.forName("jdk.jfr.FlightRecorder", true, loader) + .getMethod("getFlightRecorder") + .invoke(null); + // Force the holder's . + Class.forName(holderClassName, true, loader); + } catch (final Throwable ignored) { + // JFR unavailable/disabled or initialization failed: nothing (left) to do. We catch Throwable + // rather than Exception because forcing initialization can surface Errors such as + // ExceptionInInitializerError, NoClassDefFoundError or LinkageError. + } + } + + /** + * Returns the fully-qualified name of the JDK's JFR event-holder class for the running JVM, or + * {@code null} if this JDK has no such class. The class is selected by JDK version rather than by + * probing with {@link ClassNotFoundException} so the mapping is explicit: + * + *

    + *
  • JDK 15-18: {@code jdk.jfr.events.Handlers} + *
  • JDK 19-22: {@code jdk.jfr.events.EventConfigurations} + *
  • otherwise (JDK 14 and earlier predate the holder; JDK 23+ removed the eager-init + * pattern): {@code null} + *
+ * + *

Also returns {@code null} on non-HotSpot VMs: JDK-8371889 is a HotSpot JFR bug, and other + * VMs (e.g. Eclipse OpenJ9 / IBM Semeru) ship a different JFR implementation where this holder / + * {@code Utils} mechanism does not apply. + */ + static String jfrEventHolderClassName() { + if (!isHotspot()) { + return null; + } + if (isJavaVersionAtLeast(15) && !isJavaVersionAtLeast(19)) { + return "jdk.jfr.events.Handlers"; } + if (isJavaVersionAtLeast(19) && !isJavaVersionAtLeast(23)) { + return "jdk.jfr.events.EventConfigurations"; + } + return null; } private static synchronized void registerSmapEntryEvent() { log.debug("Initializing smap entry scraping"); + registerJfrEvents( + "com.datadog.profiling.controller.openjdk.events.SmapEntryFactory", "Smap entry scraping"); + } - // Load JFR Handlers class early, if present (it has been moved and renamed in JDK23+). - // This prevents a deadlock. See https://bugs.openjdk.org/browse/JDK-8371889. - try { - AGENT_CLASSLOADER.loadClass("jdk.jfr.events.Handlers"); - } catch (Exception e) { - // Ignore when the class is not found or anything else goes wrong. - } - + /** + * Registers a profiling JFR event factory's events, after force-initializing the JDK's JFR + * event-holder class (see {@link #initializeJfrEventHolderClass(ClassLoader)}). + * + *

All JFR event registration during agent startup must go through this + * method. Registering a JFR event triggers the holder class's initialization while + * holding the {@code jdk.jfr.internal.Utils} monitor; unless the holder has already been fully + * initialized, that can deadlock (JDK-8371889). Routing every registration through here + * guarantees the holder is initialized first, so future event registrations cannot reintroduce + * the deadlock by running before it. + * + * @param factoryClassName fully-qualified name of the event factory with a static {@code + * registerEvents()} method + * @param description human-readable name used in log messages + */ + private static void registerJfrEvents(final String factoryClassName, final String description) { + // Enforce the ordering invariant: the holder must be initialized before any JFR event is + // registered. Idempotent and cheap once done, so it is safe to call before every registration. + initializeJfrEventHolderClass(); try { - final Class smapFactoryClass = - AGENT_CLASSLOADER.loadClass( - "com.datadog.profiling.controller.openjdk.events.SmapEntryFactory"); - final Method registerMethod = smapFactoryClass.getMethod("registerEvents"); - registerMethod.invoke(null); - } catch (final Exception ignored) { - log.debug("Smap entry scraping not supported"); + final Class factoryClass = AGENT_CLASSLOADER.loadClass(factoryClassName); + factoryClass.getMethod("registerEvents").invoke(null); + } catch (final NoClassDefFoundError + | ClassNotFoundException + | UnsupportedClassVersionError ignored) { + log.debug("{} not supported", description); + } catch (final Throwable ex) { + log.error("Unable to initialize {}", description, ex); } } @@ -1079,6 +1186,27 @@ private static boolean isSupportedAppSecArch() { return true; } + private static void maybeStartScaReachability(Instrumentation instrumentation) { + if (!Config.get().isAppSecScaEnabled()) { + return; + } + if (!telemetryEnabled || !Config.get().isTelemetryDependencyServiceEnabled()) { + log.warn( + "Not starting SCA Reachability subsystem: telemetry or dependency collection disabled"); + return; + } + StaticEventLogger.begin("ScaReachability"); + try { + final Class scaClass = + AGENT_CLASSLOADER.loadClass("com.datadog.appsec.sca.ScaReachabilitySystem"); + final Method startMethod = scaClass.getMethod("start", Instrumentation.class); + startMethod.invoke(null, instrumentation); + } catch (final Throwable ex) { + log.warn("Not starting SCA Reachability subsystem: {}", ex.getMessage()); + } + StaticEventLogger.end("ScaReachability"); + } + private static void maybeStartIast(Instrumentation instrumentation) { if (iastEnabled || !iastFullyDisabled) { @@ -1339,6 +1467,33 @@ public void withTracer(TracerAPI tracer) { }); } + /** + * Exports {@code jdk.internal.misc} to the classloader that loads {@code + * com.datadoghq.profiler.*} before the Datadog profiler is loaded. + * + *

On JDK 21+, the profiler scopes its context {@code ThreadContext} storage to the carrier + * thread using {@code jdk.internal.misc.CarrierThreadLocal}, so a mounted virtual thread resolves + * to its current carrier's record — fixing a virtual-thread context use-after-free. That type + * lives in a non-exported package, hence the export. Must run before {@code + * installDatadogTracer}, which loads the profiler via {@link + * #createProfilingContextIntegration()}. + */ + private static void prepareDatadogProfilerContextStorage(Instrumentation inst) { + try { + if (inst == null + || !Config.get().isProfilingEnabled() + || !Config.get().isDatadogProfilerEnabled() + || OperatingSystem.isWindows() + || !isJavaVersionAtLeast(21)) { + return; + } + JDK9ModuleAccess.exportModuleToUnnamedModule( + inst, "java.base", new String[] {"jdk.internal.misc"}, AGENT_CLASSLOADER); + } catch (Throwable t) { + log.debug("Unable to export jdk.internal.misc for the Datadog profiler", t); + } + } + /** * {@see com.datadog.profiling.ddprof.DatadogProfilingIntegration} must not be modified to depend * on JFR. diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/AgentJarIndex.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/AgentJarIndex.java index 5b0daa95995..5350933897c 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/AgentJarIndex.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/AgentJarIndex.java @@ -7,20 +7,17 @@ import java.io.DataOutputStream; import java.io.File; import java.io.IOException; -import java.nio.file.FileVisitResult; import java.nio.file.Files; +import java.nio.file.LinkOption; import java.nio.file.Path; import java.nio.file.Paths; -import java.nio.file.SimpleFileVisitor; -import java.nio.file.attribute.BasicFileAttributes; import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; import java.util.HashSet; import java.util.List; -import java.util.Map; import java.util.Set; import java.util.jar.JarFile; +import java.util.stream.Stream; import java.util.zip.ZipEntry; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -67,7 +64,7 @@ public String classEntryName(String name) { /** For testing purposes only. */ public static AgentJarIndex emptyIndex() { - return new AgentJarIndex(new String[0], ClassNameTrie.Builder.EMPTY_TRIE); + return new AgentJarIndex(new String[0], ClassNameTrie.EMPTY_TRIE); } public static AgentJarIndex readIndex(JarFile agentJar) { @@ -92,7 +89,7 @@ public static AgentJarIndex readIndex(JarFile agentJar) { * Generates an index from the contents of the 'build/resources' directory that makes up the agent * jar. */ - static class IndexGenerator extends SimpleFileVisitor { + static class IndexGenerator { private static final Set ignoredFileNames = new HashSet<>(Arrays.asList("MANIFEST.MF", "NOTICE", "LICENSE.renamed")); @@ -101,9 +98,8 @@ static class IndexGenerator extends SimpleFileVisitor { private final List prefixes = new ArrayList<>(); private final ClassNameTrie.Builder prefixTrie = new ClassNameTrie.Builder(); - private Path prefixRoot; - private int prefixId; - private Map prefixMappings = new HashMap<>(); + private final List collectedEntryKeys = new ArrayList<>(); + private final List collectedPrefixIds = new ArrayList<>(); IndexGenerator(Path resourcesDir) { this.resourcesDir = resourcesDir; @@ -111,7 +107,50 @@ static class IndexGenerator extends SimpleFileVisitor { prefixTrie.put("datadog.*", 0); } - public void writeIndex(Path indexFile) throws IOException { + void buildIndex() throws IOException { + Set seen = new HashSet<>(); + try (Stream paths = Files.walk(resourcesDir)) { + paths + .filter(path -> Files.isRegularFile(path, LinkOption.NOFOLLOW_LINKS)) + .map(resourcesDir::relativize) + .sorted() + .filter(entry -> entry.getNameCount() >= 2) + .forEach( + entry -> { + String prefix = entry.getName(0) + "/"; + int prefixId = prefixIdFor(prefix); + String entryKey = computeEntryKey(entry.subpath(1, entry.getNameCount())); + if (null != entryKey && seen.add(prefixId + "\0" + entryKey)) { + collectedEntryKeys.add(entryKey); + collectedPrefixIds.add(prefixId); + } + }); + } + + for (int i = 0; i < collectedEntryKeys.size(); i++) { + prefixTrie.put(collectedEntryKeys.get(i), collectedPrefixIds.get(i)); + } + + // warn if two subsections contain content under the same package prefix + // because we're then unable to redirect requests to the right submodule + for (int i = 0; i < collectedEntryKeys.size(); i++) { + String entryKey = collectedEntryKeys.get(i); + int expectedPrefixId = collectedPrefixIds.get(i); + int indexedPrefixId = prefixTrie.apply(entryKey); + if (indexedPrefixId != expectedPrefixId) { + log.warn( + "Detected duplicate content '{}' under '{}', already seen in {}. Ensure your content is under a distinct directory.", + entryKey, + getPrefix(expectedPrefixId), + getPrefix(indexedPrefixId)); + } + } + + collectedEntryKeys.clear(); + collectedPrefixIds.clear(); + } + + void writeIndex(Path indexFile) throws IOException { try (DataOutputStream out = new DataOutputStream(new BufferedOutputStream(Files.newOutputStream(indexFile)))) { out.writeInt(prefixes.size()); @@ -122,53 +161,20 @@ public void writeIndex(Path indexFile) throws IOException { } } - @Override - public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) { - if (dir.getParent().equals(resourcesDir)) { - prefixRoot = dir; - prefixes.add(dir.getFileName() + "/"); - prefixId = prefixes.size(); - prefixMappings.put(prefixId, dir.getFileName().toString()); - } - return FileVisitResult.CONTINUE; - } - - @Override - public FileVisitResult postVisitDirectory(Path dir, IOException exc) { - if (dir.equals(prefixRoot)) { - prefixRoot = null; - } - return FileVisitResult.CONTINUE; + private String getPrefix(int prefixId) { + return prefixes.get(prefixId - 1); } - @Override - public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) { - if (null != prefixRoot) { - String entryKey = computeEntryKey(prefixRoot.relativize(file)); - if (null != entryKey) { - int existingPrefixId = prefixTrie.apply(entryKey); - // warn if two subsections contain content under the same package prefix - // because we're then unable to redirect requests to the right submodule - // (ignore the two 'datadog.compiler' packages which allow duplication) - if (existingPrefixId > 0 && prefixId != existingPrefixId) { - log.warn( - "Detected duplicate content '{}' under '{}', already seen in {}. Ensure your content is under a distinct directory.", - entryKey, - resourcesDir.relativize(file).getName(0), // prefix - prefixMappings.get(existingPrefixId) // previous prefix - ); - } - prefixTrie.put(entryKey, prefixId); - if (entryKey.endsWith("*")) { - // optimization: wildcard will match everything under here so can skip - return FileVisitResult.SKIP_SIBLINGS; - } - } + private int prefixIdFor(String prefix) { + int prefixId = 1 + prefixes.indexOf(prefix); + if (prefixId < 1) { + prefixes.add(prefix); + prefixId = prefixes.size(); } - return FileVisitResult.CONTINUE; + return prefixId; } - private static String computeEntryKey(Path path) { + static String computeEntryKey(Path path) { if (ignoredFileNames.contains(path.getFileName().toString())) { return null; } @@ -205,7 +211,7 @@ public static void main(String[] args) throws IOException { indexDir = Paths.get(args[1]).toAbsolutePath(); } IndexGenerator indexGenerator = new IndexGenerator(resourcesDir); - Files.walkFileTree(resourcesDir, indexGenerator); + indexGenerator.buildIndex(); indexGenerator.writeIndex(indexDir.resolve(AGENT_INDEX_FILE_NAME)); } } diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/Constants.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/Constants.java index c756d45a654..41b6e925cc8 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/Constants.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/Constants.java @@ -15,6 +15,7 @@ public final class Constants { */ public static final String[] BOOTSTRAP_PACKAGE_PREFIXES = { "datadog.slf4j", + "datadog.common.filesystem", "datadog.context", "datadog.environment", "datadog.json", diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/DatadogClassLoader.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/DatadogClassLoader.java index 7ac89dfafb5..aaf263901ff 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/DatadogClassLoader.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/DatadogClassLoader.java @@ -41,7 +41,11 @@ public DatadogClassLoader(final URL agentJarURL, final ClassLoader parent) throw agentJarFile = new JarFile(new File(agentJarURL.toURI()), false); agentCodeSource = new CodeSource(agentJarURL, (Certificate[]) null); - agentResourcePrefix = "jar:file:" + agentJarFile.getName() + "!/"; + // Build the resource prefix from the agent jar URL rather than JarFile.getName(). + // JarFile.getName() returns the OS-native path, which on Windows looks like + // "C:\Datadog\dd-java-agent.jar" — producing a malformed URL ("jar:file:C:\..."), so + // findResource() returns URLs that openStream() cannot read. See APMS-19624 / #6398. + agentResourcePrefix = "jar:" + agentJarURL + "!/"; agentJarIndex = AgentJarIndex.readIndex(agentJarFile); } diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/InstrumentationContext.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/InstrumentationContext.java index 5a7dda111d2..5768cff4d3f 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/InstrumentationContext.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/InstrumentationContext.java @@ -24,7 +24,10 @@ private InstrumentationContext() {} public static ContextStore get( final Class keyClass, final Class contextClass) { throw new RuntimeException( - "Calls to this method will be rewritten by Instrumentation Context Provider (e.g. FieldBackedProvider)"); + "Calls to this method will be rewritten by Instrumentation Context Provider (e.g. FieldBackedProvider)." + + " If you get this exception, this method has not been rewritten." + + " Ensure instrumentation class has a contextStore method and the call to InstrumentationContext.get happens directly in an instrumentation Advice class." + + " See how_instrumentations_work.md for details."); } /** @@ -35,6 +38,9 @@ public static ContextStore get( */ public static ContextStore get(final String keyClass, final String contextClass) { throw new RuntimeException( - "Calls to this method will be rewritten by Instrumentation Context Provider (e.g. FieldBackedProvider)"); + "Calls to this method will be rewritten by Instrumentation Context Provider (e.g. FieldBackedProvider)." + + " If you get this exception, this method has not been rewritten." + + " Ensure instrumentation class has a contextStore method and the call to InstrumentationContext.get happens directly in an instrumentation Advice class." + + " See how_instrumentations_work.md for details."); } } diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/InstrumentationErrors.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/InstrumentationErrors.java index 580b1557f3c..b2bc1702805 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/InstrumentationErrors.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/InstrumentationErrors.java @@ -1,21 +1,62 @@ package datadog.trace.bootstrap; +import datadog.trace.api.internal.VisibleForTesting; +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.atomic.AtomicLong; public class InstrumentationErrors { private static final AtomicLong COUNTER = new AtomicLong(); - public static long getErrorCount() { - return COUNTER.get(); + private static final class Detailed { + static final List ERRORS = new CopyOnWriteArrayList<>(); } - @SuppressWarnings("unused") - public static void incrementErrorCount() { + private static volatile boolean detailed; + + /** Record an error occurred without any detail about it. */ + public static void recordError() { + COUNTER.incrementAndGet(); + } + + /** Record an error occurred, including its stack trace. */ + public static Throwable recordError(Throwable error) { COUNTER.incrementAndGet(); + StringWriter detail = new StringWriter(); + error.printStackTrace(new PrintWriter(detail)); + Detailed.ERRORS.add(detail.toString()); + detailed = true; + return error; // keep throwable at top of the stack } - // Visible for testing - public static void resetErrorCount() { + @VisibleForTesting + public static void resetErrors() { COUNTER.set(0); + if (detailed) { + Detailed.ERRORS.clear(); + detailed = false; + } + } + + /** + * @return {@code true} if no errors were recorded; otherwise {@code false} + */ + public static boolean noErrors() { + return COUNTER.get() == 0; + } + + /** + * @return a human-readable description of the errors recorded so far + */ + public static String describeErrors() { + StringBuilder buf = new StringBuilder().append(COUNTER.get()).append(" instrumentation errors"); + if (detailed) { + for (String error : Detailed.ERRORS) { + buf.append("\n---\n").append(error); + } + } + return buf.toString(); } } diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/WeakMapContextStore.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/WeakMapContextStore.java index a3926412889..1750b7f2b9c 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/WeakMapContextStore.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/WeakMapContextStore.java @@ -1,5 +1,7 @@ package datadog.trace.bootstrap; +import datadog.trace.api.internal.VisibleForTesting; + /** * Weak {@link ContextStore} that acts as a fall-back when field-injection isn't possible. * @@ -85,7 +87,7 @@ public V remove(final K key) { return (V) map.remove(key); } - // Package reachable for testing + @VisibleForTesting int size() { return map.size(); } diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/appsec/sca/ScaReachabilityCallback.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/appsec/sca/ScaReachabilityCallback.java new file mode 100644 index 00000000000..966b1251ca6 --- /dev/null +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/appsec/sca/ScaReachabilityCallback.java @@ -0,0 +1,82 @@ +package datadog.trace.bootstrap.appsec.sca; + +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Bootstrap-classloader callback for SCA Reachability method-level detection. + * + *

Bytecode injected into application classes by {@code ScaReachabilityTransformer} calls {@link + * #onMethodHit} statically. Because this class lives in the bootstrap classloader, it is visible + * from any application class regardless of classloader hierarchy. + * + *

The actual handler is registered at agent startup by {@code ScaReachabilitySystem.start()}. + */ +public final class ScaReachabilityCallback { + + private static final Logger log = LoggerFactory.getLogger(ScaReachabilityCallback.class); + + /** Receives method-level reachability hits from instrumented application code. */ + public interface Handler { + void onMethodHit( + String vulnId, + String artifact, + String version, + String dotClassName, + String methodName, + int line); + } + + private static volatile Handler handler; + + /** Runtime dedup: "vulnId|artifact|dotClassName|methodName" tuples already reported. */ + private static final Set reported = ConcurrentHashMap.newKeySet(); + + /** + * Called by {@code ScaReachabilitySystem} to wire up the real reporting implementation. Passing + * {@code null} clears both the handler and the dedup set (used in tests). + */ + public static void register(Handler h) { + handler = h; + if (h == null) { + reported.clear(); + } + } + + /** + * Called from bytecode injected into the entry point of a vulnerable method. Deduplicates at + * runtime so the handler is called at most once per (vulnId, artifact, methodName) triple. + * + *

The {@code dotClassName} and {@code methodName} parameters identify the VULNERABLE SYMBOL + * (baked in at transform time) and are used for deduplication. The handler (registered by {@code + * ScaReachabilitySystem}) is responsible for capturing the callsite from the current thread stack + * and reporting it to telemetry - keeping this class minimal as required for bootstrap. + */ + public static void onMethodHit( + String vulnId, + String artifact, + String version, + String dotClassName, + String methodName, + int line) { + try { + Handler h = handler; + if (h == null) { + return; + } + // Include version and dotClassName: version isolates hits across artifact versions loaded + // in separate classloaders; dotClassName distinguishes classes with the same method name. + String key = vulnId + "|" + artifact + "|" + version + "|" + dotClassName + "|" + methodName; + if (reported.add(key)) { + h.onMethodHit(vulnId, artifact, version, dotClassName, methodName, line); + } + } catch (Exception t) { + // Never propagate to application code - SCA detection is observation-only + log.debug("SCA Reachability: error in onMethodHit for {}#{}", dotClassName, methodName, t); + } + } + + private ScaReachabilityCallback() {} +} diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/blocking/BlockingActionHelper.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/blocking/BlockingActionHelper.java index fbe5e150367..e72a86a7098 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/blocking/BlockingActionHelper.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/blocking/BlockingActionHelper.java @@ -6,6 +6,7 @@ import datadog.appsec.api.blocking.BlockingContentType; import datadog.trace.api.Config; +import datadog.trace.api.internal.VisibleForTesting; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; @@ -187,7 +188,7 @@ private static String nextMediaRange(String s, int[] pos, float[] quality) { return mediaRangeMatcher.group(1); } - // public for testing + @VisibleForTesting public static void reset(Config config) { TEMPLATE_HTML = null; TEMPLATE_JSON = null; diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/api/Java8BytecodeBridge.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/api/Java8BytecodeBridge.java index 6d3f43b5139..99c7cb700e1 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/api/Java8BytecodeBridge.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/api/Java8BytecodeBridge.java @@ -13,35 +13,37 @@ public class Java8BytecodeBridge { /** * @see Context#root() */ - public static Context getRootContext() { + public static Context rootContext() { return Context.root(); } /** * @see Context#current() */ - public static Context getCurrentContext() { + public static Context currentContext() { return Context.current(); } /** - * @see Context#from(Object) + * @see AgentSpan#current() */ - public static Context getContextFrom(Object carrier) { - return Context.from(carrier); + public static AgentSpan currentSpan() { + return AgentSpan.current(); } /** - * @see Context#detachFrom(Object) + * @see AgentSpan#fromContext(Context) */ - public static Context detachContextFrom(Object carrier) { - return Context.detachFrom(carrier); + public static AgentSpan spanFromContext(Context context) { + return AgentSpan.fromContext(context); } /** - * @see AgentSpan#fromContext(Context) + * @see Baggage#fromContext(Context) */ - public static AgentSpan spanFromContext(Context context) { - return AgentSpan.fromContext(context); + public static Baggage baggageFromContext(Context context) { + return Baggage.fromContext(context); } + + private Java8BytecodeBridge() {} } diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/buffer/InjectingPipeOutputStream.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/buffer/InjectingPipeOutputStream.java index 7221a85d007..9d49166bd1b 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/buffer/InjectingPipeOutputStream.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/buffer/InjectingPipeOutputStream.java @@ -118,6 +118,7 @@ public void write(int b) throws IOException { @Override public void write(byte[] array, int off, int len) throws IOException { + final int end = off + len; if (!filter) { if (wasDraining) { // needs drain @@ -129,15 +130,25 @@ public void write(byte[] array, int off, int len) throws IOException { } if (len > bulkWriteThreshold) { + // A match that started in the previous write precedes every match wholly in this array. + if (matchingPos > 0 && arrayCompletesPendingMatch(array, off, end)) { + int pendingMatchLength = marker.length - matchingPos; + for (int i = off; i < off + pendingMatchLength; i++) { + write(array[i]); + } + write(array, off + pendingMatchLength, len - pendingMatchLength); + return; + } + // if the content is large enough, we can bulk write everything but the N trail and tail. // This because the buffer can already contain some byte from a previous single write. // Also we need to fill the buffer with the tail since we don't know about the next write. - int idx = arrayContains(array, off, len, marker); + int idx = arrayContains(array, off, end, marker); if (idx >= 0) { // we have a full match. just write everything filter = false; drain(); - int bytesToWrite = idx; + int bytesToWrite = idx - off; downstream.write(array, off, bytesToWrite); bytesWritten += bytesToWrite; long injectionStart = System.nanoTime(); @@ -149,8 +160,8 @@ public void write(byte[] array, int off, int len) throws IOException { if (onContentInjected != null) { onContentInjected.run(); } - bytesToWrite = len - idx; - downstream.write(array, off + idx, bytesToWrite); + bytesToWrite = end - idx; + downstream.write(array, idx, bytesToWrite); bytesWritten += bytesToWrite; } else { // we don't have a full match. write everything in a bulk except the lookbehind buffer @@ -167,20 +178,33 @@ public void write(byte[] array, int off, int len) throws IOException { downstream.write(array, off + marker.length - 1, bytesToWrite); bytesWritten += bytesToWrite; filter = wasFiltering; - for (int i = len - marker.length + 1; i < len; i++) { + for (int i = end - marker.length + 1; i < end; i++) { write(array[i]); } } } else { // use slow path because the length to write is small and within the lookbehind buffer size - for (int i = off; i < off + len; i++) { + for (int i = off; i < end; i++) { write(array[i]); } } } - private int arrayContains(byte[] array, int off, int len, byte[] search) { - for (int i = off; i < len - search.length; i++) { + private boolean arrayCompletesPendingMatch(byte[] array, int off, int end) { + int pendingMatchLength = marker.length - matchingPos; + if (off + pendingMatchLength > end) { + return false; + } + for (int i = 0; i < pendingMatchLength; i++) { + if (array[off + i] != marker[matchingPos + i]) { + return false; + } + } + return true; + } + + private int arrayContains(byte[] array, int off, int end, byte[] search) { + for (int i = off; i <= end - search.length; i++) { if (array[i] == search[0]) { boolean found = true; int k = i; diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/buffer/InjectingPipeWriter.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/buffer/InjectingPipeWriter.java index 8d2c222d924..a7439abaacf 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/buffer/InjectingPipeWriter.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/buffer/InjectingPipeWriter.java @@ -118,6 +118,7 @@ public void write(int c) throws IOException { @Override public void write(char[] array, int off, int len) throws IOException { + final int end = off + len; if (!filter) { if (wasDraining) { // needs drain @@ -129,15 +130,25 @@ public void write(char[] array, int off, int len) throws IOException { } if (len > bulkWriteThreshold) { + // A match that started in the previous write precedes every match wholly in this array. + if (matchingPos > 0 && arrayCompletesPendingMatch(array, off, end)) { + int pendingMatchLength = marker.length - matchingPos; + for (int i = off; i < off + pendingMatchLength; i++) { + write(array[i]); + } + write(array, off + pendingMatchLength, len - pendingMatchLength); + return; + } + // if the content is large enough, we can bulk write everything but the N trail and tail. // This because the buffer can already contain some byte from a previous single write. // Also we need to fill the buffer with the tail since we don't know about the next write. - int idx = arrayContains(array, off, len, marker); + int idx = arrayContains(array, off, end, marker); if (idx >= 0) { // we have a full match. just write everything filter = false; drain(); - int bytesToWrite = idx; + int bytesToWrite = idx - off; downstream.write(array, off, bytesToWrite); bytesWritten += bytesToWrite; long injectionStart = System.nanoTime(); @@ -149,8 +160,8 @@ public void write(char[] array, int off, int len) throws IOException { if (onContentInjected != null) { onContentInjected.run(); } - bytesToWrite = len - idx; - downstream.write(array, off + idx, bytesToWrite); + bytesToWrite = end - idx; + downstream.write(array, idx, bytesToWrite); bytesWritten += bytesToWrite; } else { // we don't have a full match. write everything in a bulk except the lookbehind buffer @@ -168,20 +179,33 @@ public void write(char[] array, int off, int len) throws IOException { bytesWritten += bytesToWrite; filter = wasFiltering; - for (int i = len - marker.length + 1; i < len; i++) { + for (int i = end - marker.length + 1; i < end; i++) { write(array[i]); } } } else { // use slow path because the length to write is small and within the lookbehind buffer size - for (int i = off; i < off + len; i++) { + for (int i = off; i < end; i++) { write(array[i]); } } } - private int arrayContains(char[] array, int off, int len, char[] search) { - for (int i = off; i < len - search.length; i++) { + private boolean arrayCompletesPendingMatch(char[] array, int off, int end) { + int pendingMatchLength = marker.length - matchingPos; + if (off + pendingMatchLength > end) { + return false; + } + for (int i = 0; i < pendingMatchLength; i++) { + if (array[off + i] != marker[matchingPos + i]) { + return false; + } + } + return true; + } + + private int arrayContains(char[] array, int off, int end, char[] search) { + for (int i = off; i <= end - search.length; i++) { if (array[i] == search[0]) { boolean found = true; int k = i; diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/classloading/ClassDefining.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/classloading/ClassDefining.java index 727737720d9..23ec54e1cdd 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/classloading/ClassDefining.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/classloading/ClassDefining.java @@ -1,12 +1,17 @@ package datadog.trace.bootstrap.instrumentation.classloading; +import java.util.concurrent.atomic.AtomicBoolean; + /** Provides a way for a single optional observer to be notified before a class is defined. */ public final class ClassDefining { + private static final AtomicBoolean HAS_OBSERVER = new AtomicBoolean(); private static volatile Observer OBSERVER = (loader, bytecode, offset, length) -> {}; /** Registers the given observer to get notifications about class definitions. */ public static void observe(Observer observer) { - OBSERVER = observer; + if (HAS_OBSERVER.compareAndSet(false, true)) { + OBSERVER = observer; // set once in premain + } } /** Called from advice added to j.l.ClassLoader by DefineClassInstrumentation. */ diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/dbm/SharedDBCommenter.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/dbm/SharedDBCommenter.java index 83604a017bd..ccd3bad8505 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/dbm/SharedDBCommenter.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/dbm/SharedDBCommenter.java @@ -4,8 +4,10 @@ import datadog.trace.api.BaseHash; import datadog.trace.api.Config; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.Tags; +import datadog.trace.util.SubSequence; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.charset.StandardCharsets; @@ -32,36 +34,65 @@ public class SharedDBCommenter { private static final String TRACEPARENT = encode("traceparent"); private static final String DD_SERVICE_HASH = encode("ddsh"); - // Used by SQLCommenter and MongoCommentInjector to avoid duplicate comment injection + // Pre-built "=" needles for containsTraceComment, computed once at class init. The keys + // are assigned via encode(...), so "KEY + =" is a runtime concat, not a compile-time constant; + // doing it per call allocated nine throwaway Strings on every non-matching check. + private static final String PARENT_SERVICE_EQ = PARENT_SERVICE + "="; + private static final String DATABASE_SERVICE_EQ = DATABASE_SERVICE + "="; + private static final String DD_HOSTNAME_EQ = DD_HOSTNAME + "="; + private static final String DD_DB_NAME_EQ = DD_DB_NAME + "="; + private static final String DD_PEER_SERVICE_EQ = DD_PEER_SERVICE + "="; + private static final String DD_ENV_EQ = DD_ENV + "="; + private static final String DD_VERSION_EQ = DD_VERSION + "="; + private static final String TRACEPARENT_EQ = TRACEPARENT + "="; + private static final String DD_SERVICE_HASH_EQ = DD_SERVICE_HASH + "="; + + // Pre-encoded "key='encoded_value'" fragments for the invariant fields (the values + // come from Config are effectively immutable post-init in production). + // Note about the visibility: needs to be visible but can tolerate races (reason why it's not + // atomic) + private static volatile boolean staticPrefixComputed = false; + private static volatile String staticPrefix; + + // Used by SQLCommenter and MongoCommentInjector to avoid duplicate comment injection. Mongo + // passes the already-extracted comment body; SQLCommenter uses the range overload to check it + // in place. Both run the same nine "=" needle checks. public static boolean containsTraceComment(String commentContent) { - return commentContent.contains(PARENT_SERVICE + "=") - || commentContent.contains(DATABASE_SERVICE + "=") - || commentContent.contains(DD_HOSTNAME + "=") - || commentContent.contains(DD_DB_NAME + "=") - || commentContent.contains(DD_PEER_SERVICE + "=") - || commentContent.contains(DD_ENV + "=") - || commentContent.contains(DD_VERSION + "=") - || commentContent.contains(TRACEPARENT + "=") - || commentContent.contains(DD_SERVICE_HASH + "="); + return containsTraceComment(commentContent, 0, commentContent.length()); + } + + /** + * Range overload: true if {@code sql} contains a trace-comment needle fully within {@code [from, + * to)} -- checks the comment body in place, with no substring allocation of the region. + */ + public static boolean containsTraceComment(String sql, int from, int to) { + // Zero-copy view of the comment body; reads like ordinary String.contains, no substring. + SubSequence comment = SubSequence.of(sql, from, to); + return comment.contains(PARENT_SERVICE_EQ) + || comment.contains(DATABASE_SERVICE_EQ) + || comment.contains(DD_HOSTNAME_EQ) + || comment.contains(DD_DB_NAME_EQ) + || comment.contains(DD_PEER_SERVICE_EQ) + || comment.contains(DD_ENV_EQ) + || comment.contains(DD_VERSION_EQ) + || comment.contains(TRACEPARENT_EQ) + || comment.contains(DD_SERVICE_HASH_EQ); } // Build database comment content without comment delimiters such as /* */ public static String buildComment( String dbService, String dbType, String hostname, String dbName, String traceParent) { + ensureStaticPrefixComputed(); - Config config = Config.get(); - StringBuilder sb = new StringBuilder(); - + // we can calculate the precise size - having a rough estimation is perhaps faster + StringBuilder sb = new StringBuilder(1024).append(staticPrefix); int initSize = 0; // No initial content for pure comment - append(sb, PARENT_SERVICE, config.getServiceName(), initSize); append(sb, DATABASE_SERVICE, dbService, initSize); append(sb, DD_HOSTNAME, hostname, initSize); append(sb, DD_DB_NAME, dbName, initSize); append(sb, DD_PEER_SERVICE, getPeerService(), initSize); - append(sb, DD_ENV, config.getEnv(), initSize); - append(sb, DD_VERSION, config.getVersion(), initSize); append(sb, TRACEPARENT, traceParent, initSize); - + final Config config = Config.get(); if (config.isDbmInjectSqlBaseHash() && config.isExperimentalPropagateProcessTagsEnabled()) { append(sb, DD_SERVICE_HASH, BaseHash.getBaseHashStr(), initSize); } @@ -69,10 +100,30 @@ public static String buildComment( return sb.length() > 0 ? sb.toString() : null; } + private static void ensureStaticPrefixComputed() { + if (staticPrefixComputed) { + return; + } + Config config = Config.get(); + final StringBuilder sb = new StringBuilder(512); // big enough not to be resized + + append(sb, PARENT_SERVICE, config.getServiceName(), 0); + append(sb, DD_ENV, config.getEnv(), 0); + append(sb, DD_VERSION, config.getVersion(), 0); + staticPrefix = sb.toString(); + staticPrefixComputed = true; + } + + @VisibleForTesting + public static void resetStaticPrefixForTesting() { + staticPrefixComputed = false; + } + private static String getPeerService() { AgentSpan span = activeSpan(); Object peerService = null; if (span != null) { + // FIXME: this will never work since peer service is computed later if enabled peerService = span.getTag(Tags.PEER_SERVICE); } return peerService != null ? peerService.toString() : null; diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/BaseDecorator.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/BaseDecorator.java index 6a8767e523f..b52de4fa192 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/BaseDecorator.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/BaseDecorator.java @@ -90,7 +90,7 @@ protected boolean traceAnalyticsDefault() { return false; } - public AgentSpan afterStart(final AgentSpan span) { + public void afterStart(final AgentSpan span) { if (spanType() != null) { span.setSpanType(spanType()); } @@ -100,68 +100,56 @@ public AgentSpan afterStart(final AgentSpan span) { // DQH - Could retrieve the value from componentEntry and cast to avoid the virtual call, // unclear which option is better here final CharSequence component = component(); - span.context().setIntegrationName(component); + span.spanContext().setIntegrationName(component); // null handled by setMetric span.setMetric(traceAnalyticsEntry); - - return span; } - public ContextScope beforeFinish(final ContextScope scope) { + public void beforeFinish(final ContextScope scope) { beforeFinish(scope.context()); - return scope; } - public AgentSpan beforeFinish(final AgentSpan span) { - return span; - } + public void beforeFinish(final AgentSpan span) {} - public Context beforeFinish(final Context context) { - return context; - } + public void beforeFinish(final Context context) {} - public AgentScope onError(final AgentScope scope, final Throwable throwable) { + public void onError(final AgentScope scope, final Throwable throwable) { if (scope != null) { onError(scope.span(), throwable); } - return scope; } - public AgentSpan onError(final AgentSpan span, final Throwable throwable) { - return onError(span, throwable, ErrorPriorities.DEFAULT); + public void onError(final AgentSpan span, final Throwable throwable) { + onError(span, throwable, ErrorPriorities.DEFAULT); } - public AgentSpan onError(final AgentSpan span, final Throwable throwable, byte errorPriority) { + public void onError(final AgentSpan span, final Throwable throwable, byte errorPriority) { if (throwable != null && span != null) { span.addThrowable( throwable instanceof ExecutionException ? throwable.getCause() : throwable, errorPriority); } - return span; } - public ContextScope onError(final ContextScope scope, final Throwable throwable) { + public void onError(final ContextScope scope, final Throwable throwable) { if (scope != null) { onError(AgentSpan.fromContext(scope.context()), throwable); } - return scope; } - public AgentSpan onPeerConnection( - final AgentSpan span, final InetSocketAddress remoteConnection) { + public void onPeerConnection(final AgentSpan span, final InetSocketAddress remoteConnection) { if (remoteConnection != null) { onPeerConnection(span, remoteConnection.getAddress(), !remoteConnection.isUnresolved()); setPeerPort(span, remoteConnection.getPort()); } - return span; } - public AgentSpan onPeerConnection(final AgentSpan span, final InetAddress remoteAddress) { - return onPeerConnection(span, remoteAddress, true); + public void onPeerConnection(final AgentSpan span, final InetAddress remoteAddress) { + onPeerConnection(span, remoteAddress, true); } - public AgentSpan onPeerConnection(AgentSpan span, InetAddress remoteAddress, boolean resolved) { + public void onPeerConnection(AgentSpan span, InetAddress remoteAddress, boolean resolved) { if (remoteAddress != null) { String ip = remoteAddress.getHostAddress(); if (resolved && Config.get().isPeerHostNameEnabled()) { @@ -173,20 +161,16 @@ public AgentSpan onPeerConnection(AgentSpan span, InetAddress remoteAddress, boo span.setTag(Tags.PEER_HOST_IPV6, ip); } } - return span; } - public AgentSpan setPeerPort(AgentSpan span, String port) { + public void setPeerPort(AgentSpan span, String port) { span.setTag(Tags.PEER_PORT, port); - - return span; } - public AgentSpan setPeerPort(AgentSpan span, int port) { + public void setPeerPort(AgentSpan span, int port) { if (port > UNSET_PORT) { span.setTag(Tags.PEER_PORT, port); } - return span; } /** diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/ClientDecorator.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/ClientDecorator.java index 99dec2dbc08..681a0e7a9d8 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/ClientDecorator.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/ClientDecorator.java @@ -32,7 +32,7 @@ protected String spanKind() { } @Override - public AgentSpan afterStart(final AgentSpan span) { + public void afterStart(final AgentSpan span) { final String service = service(); if (service != null) { span.setServiceName(service, component()); @@ -41,6 +41,6 @@ public AgentSpan afterStart(final AgentSpan span) { // Generate metrics for all client spans. span.setMeasured(true); - return super.afterStart(span); + super.afterStart(span); } } diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/DBTypeProcessingDatabaseClientDecorator.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/DBTypeProcessingDatabaseClientDecorator.java index f1d5588c49f..cc99851b5e7 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/DBTypeProcessingDatabaseClientDecorator.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/DBTypeProcessingDatabaseClientDecorator.java @@ -6,8 +6,8 @@ public abstract class DBTypeProcessingDatabaseClientDecorator extends DatabaseClientDecorator { @Override - public AgentSpan afterStart(AgentSpan span) { + public void afterStart(AgentSpan span) { processDatabaseType(span, dbType()); - return super.afterStart(span); + super.afterStart(span); } } diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/DatabaseClientDecorator.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/DatabaseClientDecorator.java index 7336a059bdc..fa105776113 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/DatabaseClientDecorator.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/DatabaseClientDecorator.java @@ -66,9 +66,8 @@ public String getDbType() { * * @param span * @param connection - * @return */ - public AgentSpan onConnection(final AgentSpan span, final CONNECTION connection) { + public void onConnection(final AgentSpan span, final CONNECTION connection) { if (connection != null) { span.setTag(Tags.DB_USER, dbUser(connection)); onInstance(span, dbInstance(connection)); @@ -81,10 +80,9 @@ public AgentSpan onConnection(final AgentSpan span, final CONNECTION connection) } } } - return span; } - protected AgentSpan onInstance(final AgentSpan span, final String dbInstance) { + protected void onInstance(final AgentSpan span, final String dbInstance) { if (dbInstance != null) { span.setTag(Tags.DB_INSTANCE, dbInstance); String serviceName = dbClientService(dbInstance); @@ -92,7 +90,6 @@ protected AgentSpan onInstance(final AgentSpan span, final String dbInstance) { span.setServiceName(serviceName, component()); } } - return span; } public String dbService(final String dbType, final String instanceName) { @@ -114,9 +111,8 @@ public String dbClientService(final String instanceName) { return service; } - public AgentSpan onStatement(final AgentSpan span, final CharSequence statement) { + public void onStatement(final AgentSpan span, final CharSequence statement) { span.setResourceName(statement); - return span; } /** diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/HttpClientDecorator.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/HttpClientDecorator.java index 42214929571..d446064c2fb 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/HttpClientDecorator.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/HttpClientDecorator.java @@ -92,7 +92,7 @@ protected boolean shouldSetResourceName() { } }; - public AgentSpan onRequest(final AgentSpan span, final REQUEST request) { + public void onRequest(final AgentSpan span, final REQUEST request) { if (request != null) { AgentTracer.get() .getDataStreamsMonitoring() @@ -143,10 +143,9 @@ public AgentSpan onRequest(final AgentSpan span, final REQUEST request) { ssrfIastCheck(request); } } - return span; } - public AgentSpan onResponse(final AgentSpan span, final RESPONSE response) { + public void onResponse(final AgentSpan span, final RESPONSE response) { if (response != null) { final int status = status(response); if (status > UNSET_STATUS) { @@ -166,7 +165,6 @@ public AgentSpan onResponse(final AgentSpan span, final RESPONSE response) { } } } - return span; } public String operationName() { diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/HttpServerDecorator.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/HttpServerDecorator.java index a60401f5811..8baad084784 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/HttpServerDecorator.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/HttpServerDecorator.java @@ -166,7 +166,7 @@ public Context extract(REQUEST_CARRIER carrier) { * @param parentContext The parent context of the span to create. * @return A new context bundling the span, child of the given parent context. */ - public Context startSpan(REQUEST_CARRIER carrier, Context parentContext) { + public Context startSpan(REQUEST_CARRIER carrier, @Nonnull Context parentContext) { String instrumentationName = component().toString(); AgentSpanContext extracted = getExtractedSpanContext(parentContext); // Call IG callbacks @@ -188,11 +188,22 @@ public Context startSpan(REQUEST_CARRIER carrier, Context parentContext) { if (flow.getAction() instanceof RequestBlockingAction) { span.setRequestBlockingAction((RequestBlockingAction) flow.getAction()); } + // Tag Datadog scan/test markers unconditionally so the API endpoint reducer + // can distinguish scan/test traffic from real user traffic. + tagSecurityTestingHeaders(span, carrier); // DSM Checkpoint tracer().getDataStreamsMonitoring().setCheckpoint(span, forHttpServer()); return parentContext.with(span); } + private void tagSecurityTestingHeaders(AgentSpan span, REQUEST_CARRIER carrier) { + AgentPropagation.ContextVisitor getter = getter(); + if (carrier == null || getter == null) { + return; + } + getter.forEachKey(carrier, new SecurityTestingHeaderTagClassifier(span)); + } + protected AgentSpanContext startInferredProxySpan(Context context, AgentSpanContext extracted) { InferredProxySpan span; if (!Config.get().isInferredProxyPropagationEnabled() @@ -226,7 +237,7 @@ private void resetServiceNameIfUnderInferredProxy(Context parentContext, AgentSp } }; - public AgentSpan onRequest( + public void onRequest( final AgentSpan span, final CONNECTION connection, final REQUEST request, @@ -417,13 +428,12 @@ public AgentSpan onRequest( DataStreamsTransactionExtractor.Type.HTTP_IN_HEADERS, request, DSM_TRANSACTION_SOURCE_READER); - return span; } protected static AgentSpanContext.Extracted getExtractedSpanContext(Context parentContext) { AgentSpan extractedSpan = AgentSpan.fromContext(parentContext); if (extractedSpan != null) { - AgentSpanContext extractedSpanContext = extractedSpan.context(); + AgentSpanContext extractedSpanContext = extractedSpan.spanContext(); if (extractedSpanContext instanceof AgentSpanContext.Extracted) { return (AgentSpanContext.Extracted) extractedSpanContext; } else { @@ -438,7 +448,7 @@ protected BlockResponseFunction createBlockResponseFunction( return null; } - public AgentSpan onResponseStatus(final AgentSpan span, final int status) { + public void onResponseStatus(final AgentSpan span, final int status) { if (status > UNSET_STATUS) { span.setHttpStatusCode(status); // explicitly set here because some other decorators might already set an error without @@ -454,7 +464,6 @@ public AgentSpan onResponseStatus(final AgentSpan span, final int status) { if (SHOULD_SET_404_RESOURCE_NAME && status == 404) { span.setResourceName(NOT_FOUND_RESOURCE_NAME, ResourceNamePriorities.HTTP_404); } - return span; } /** @@ -472,7 +481,7 @@ protected boolean isAppSecOnResponseSeparate() { return false; } - public AgentSpan onResponse(final AgentSpan span, final RESPONSE response) { + public void onResponse(final AgentSpan span, final RESPONSE response) { if (response != null) { final int status = status(response); onResponseStatus(span, status); @@ -490,7 +499,6 @@ public AgentSpan onResponse(final AgentSpan span, final RESPONSE response) { callIGCallbackResponseAndHeaders(span, response, status); } } - return span; } private AgentSpanContext callIGCallbackStart(@Nullable final AgentSpanContext extracted) { @@ -525,13 +533,12 @@ private AgentSpanContext callIGCallbackStart(@Nullable final AgentSpanContext ex } @Override - public AgentSpan onError(final AgentSpan span, final Throwable throwable) { + public void onError(final AgentSpan span, final Throwable throwable) { if (throwable != null) { span.addThrowable( throwable instanceof ExecutionException ? throwable.getCause() : throwable, ErrorPriorities.HTTP_SERVER_DECORATOR); } - return span; } private Flow callIGCallbackRequestHeaders(AgentSpan span, REQUEST_CARRIER carrier) { @@ -628,7 +635,7 @@ private Flow callIGCallbackURI( } @Override - public Context beforeFinish(Context context) { + public void beforeFinish(Context context) { AgentSpan span = AgentSpan.fromContext(context); if (span != null) { onRequestEndForInstrumentationGateway(span); @@ -637,7 +644,7 @@ public Context beforeFinish(Context context) { // Close Serverless Gateway Inferred Span if any finishInferredProxySpan(context); - return super.beforeFinish(context); + super.beforeFinish(context); } protected void finishInferredProxySpan(Context context) { @@ -742,6 +749,36 @@ public Flow done() { } } + private static final class SecurityTestingHeaderTagClassifier + implements AgentPropagation.KeyClassifier { + private static final String HEADER_ENDPOINT_SCAN = "x-datadog-endpoint-scan"; + private static final String HEADER_SECURITY_TEST = "x-datadog-security-test"; + + private final AgentSpan span; + private boolean endpointScanSeen; + private boolean securityTestSeen; + + SecurityTestingHeaderTagClassifier(AgentSpan span) { + this.span = span; + } + + @Override + public boolean accept(String key, String value) { + if (key == null || value == null) { + return true; + } + if (!endpointScanSeen && HEADER_ENDPOINT_SCAN.equalsIgnoreCase(key)) { + span.setTag(Tags.HTTP_REQUEST_HEADERS_X_DATADOG_ENDPOINT_SCAN, value); + endpointScanSeen = true; + } else if (!securityTestSeen && HEADER_SECURITY_TEST.equalsIgnoreCase(key)) { + span.setTag(Tags.HTTP_REQUEST_HEADERS_X_DATADOG_SECURITY_TEST, value); + securityTestSeen = true; + } + // Stop iteration once both markers found, capping work on pathological header counts. + return !(endpointScanSeen && securityTestSeen); + } + } + private static final class ResponseHeaderTagClassifier implements AgentPropagation.KeyClassifier { static ResponseHeaderTagClassifier create(AgentSpan span, Map headerTags) { if (span == null || headerTags == null || headerTags.isEmpty()) { diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/MessagingClientDecorator.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/MessagingClientDecorator.java index 2431575a378..23d15297249 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/MessagingClientDecorator.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/MessagingClientDecorator.java @@ -20,10 +20,10 @@ protected boolean endToEndDurationsDefault() { } @Override - public AgentSpan afterStart(final AgentSpan span) { + public void afterStart(final AgentSpan span) { if (endToEndDurationsEnabled) { span.beginEndToEnd(); } - return super.afterStart(span); + super.afterStart(span); } } diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/OrmClientDecorator.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/OrmClientDecorator.java index 092c6d385c1..478525c3072 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/OrmClientDecorator.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/OrmClientDecorator.java @@ -6,13 +6,12 @@ public abstract class OrmClientDecorator extends DatabaseClientDecorator { public abstract CharSequence entityName(final Object entity); - public AgentSpan onOperation(final AgentSpan span, final Object entity) { + public void onOperation(final AgentSpan span, final Object entity) { if (entity != null) { final CharSequence name = entityName(entity); if (name != null) { span.setResourceName(name); } // else we keep any existing resource. } - return span; } } diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/ServerDecorator.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/ServerDecorator.java index 20b11038ffd..cb0fcfe1f64 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/ServerDecorator.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/ServerDecorator.java @@ -12,10 +12,10 @@ public abstract class ServerDecorator extends BaseDecorator { TagMap.Entry.create(DDTags.LANGUAGE_TAG_KEY, DDTags.LANGUAGE_TAG_VALUE); @Override - public AgentSpan afterStart(final AgentSpan span) { + public void afterStart(final AgentSpan span) { span.setTag(SPAN_KIND_ENTRY); span.setTag(LANG_ENTRY); - return super.afterStart(span); + super.afterStart(span); } } diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/WebsocketDecorator.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/WebsocketDecorator.java index 2123caa395d..c539a71e1f1 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/WebsocketDecorator.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/WebsocketDecorator.java @@ -57,12 +57,13 @@ protected CharSequence component() { } @Override - public AgentSpan afterStart(AgentSpan span) { - return super.afterStart(span).setMeasured(true); + public void afterStart(AgentSpan span) { + super.afterStart(span); + span.setMeasured(true); } @Nonnull - public AgentSpan onReceiveFrameStart( + public AgentSpan startInboundFrameSpan( final HandlerContext.Receiver handlerContext, final Object data, boolean partialDelivery) { handlerContext.recordChunkData(data, partialDelivery); return onFrameStart( @@ -70,7 +71,7 @@ public AgentSpan onReceiveFrameStart( } @Nonnull - public AgentSpan onSessionCloseIssued( + public AgentSpan startOutboundCloseSpan( final HandlerContext.Sender handlerContext, CharSequence closeReason, int closeCode) { return onFrameStart( WEBSOCKET_CLOSE, SPAN_KIND_PRODUCER, handlerContext, SPAN_ATTRIBUTES_SEND, false) @@ -79,7 +80,7 @@ public AgentSpan onSessionCloseIssued( } @Nonnull - public AgentSpan onSessionCloseReceived( + public AgentSpan startInboundCloseSpan( final HandlerContext.Receiver handlerContext, CharSequence closeReason, int closeCode) { return onFrameStart( WEBSOCKET_CLOSE, SPAN_KIND_CONSUMER, handlerContext, SPAN_ATTRIBUTES_RECEIVE, true) @@ -88,7 +89,7 @@ public AgentSpan onSessionCloseReceived( } @Nonnull - public AgentSpan onSendFrameStart( + public AgentSpan startOutboundFrameSpan( final HandlerContext.Sender handlerContext, final CharSequence msgType, final int msgSize) { handlerContext.recordChunkData(msgType, msgSize); return onFrameStart( @@ -116,7 +117,8 @@ public void onFrameEnd(final HandlerContext handlerContext) { wsSpan.setTag(WEBSOCKET_MESSAGE_LENGTH, handlerContext.getMsgSize()); wsSpan.setTag(WEBSOCKET_MESSAGE_TYPE, handlerContext.getMessageType()); } - (beforeFinish(wsSpan)).finish(); + beforeFinish(wsSpan); + wsSpan.finish(); } finally { handlerContext.reset(); } @@ -144,7 +146,7 @@ private AgentSpan onFrameStart( wsSpan.setTag(DECISION_MAKER_RESOURCE, handshakeSpan.getResourceName()); } } else { - wsSpan = startSpan(WEBSOCKET.toString(), operationName, handshakeSpan.context()); + wsSpan = startSpan(WEBSOCKET.toString(), operationName, handshakeSpan.spanContext()); } } else { wsSpan = startSpan(WEBSOCKET.toString(), operationName); @@ -167,8 +169,8 @@ private AgentSpan onFrameStart( wsSpan.addLink( SpanLink.from( inheritSampling - ? handshakeSpan.context() - : new NotSampledSpanContext(handshakeSpan.context()), + ? handshakeSpan.spanContext() + : new NotSampledSpanContext(handshakeSpan.spanContext()), SpanLink.DEFAULT_FLAGS, "", linkAttributes)); diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/http/HttpResourceDecorator.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/http/HttpResourceDecorator.java index 1458bd04eb1..72ca66a520f 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/http/HttpResourceDecorator.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/decorator/http/HttpResourceDecorator.java @@ -18,25 +18,26 @@ public class HttpResourceDecorator { private HttpResourceDecorator() {} - public final AgentSpan withClientPath(AgentSpan span, CharSequence method, CharSequence path) { - return HttpResourceNames.setForClient(span, method, path, false); + public final void withClientPath(AgentSpan span, CharSequence method, CharSequence path) { + HttpResourceNames.setForClient(span, method, path, false); } - public final AgentSpan withServerPath( + public final void withServerPath( AgentSpan span, CharSequence method, CharSequence path, boolean encoded) { if (!shouldSetUrlResourceName) { - return span.setResourceName(DEFAULT_RESOURCE_NAME); + span.setResourceName(DEFAULT_RESOURCE_NAME); + return; } - return HttpResourceNames.setForServer(span, method, path, encoded); + HttpResourceNames.setForServer(span, method, path, encoded); } - public final AgentSpan withRoute( + public final void withRoute( final AgentSpan span, final CharSequence method, final CharSequence route) { - return withRoute(span, method, route, false); + withRoute(span, method, route, false); } - public final AgentSpan withRoute( + public final void withRoute( final AgentSpan span, final CharSequence method, final CharSequence route, boolean encoded) { CharSequence routeTag = route; if (encoded) { @@ -47,6 +48,5 @@ public final AgentSpan withRoute( final CharSequence resourceName = HttpResourceNames.join(method, route); span.setResourceName(resourceName, ResourceNamePriorities.HTTP_FRAMEWORK_ROUTE); } - return span; } } diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/httpurlconnection/HttpUrlState.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/httpurlconnection/HttpUrlState.java index c0871f847b0..71e4f076a62 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/httpurlconnection/HttpUrlState.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/httpurlconnection/HttpUrlState.java @@ -5,8 +5,8 @@ import static datadog.trace.bootstrap.instrumentation.httpurlconnection.HttpUrlConnectionDecorator.DECORATE; import static datadog.trace.bootstrap.instrumentation.httpurlconnection.HttpUrlConnectionDecorator.HTTP_URL_CONNECTION; +import datadog.context.ContextScope; import datadog.trace.bootstrap.ContextStore; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.net.HttpURLConnection; @@ -18,7 +18,7 @@ public class HttpUrlState { public AgentSpan start(final HttpURLConnection connection) { span = startSpan(HTTP_URL_CONNECTION.toString(), DECORATE.operationName()); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { DECORATE.afterStart(span); DECORATE.onRequest(span, connection); return span; @@ -39,7 +39,7 @@ public void finish() { public void finishSpan( final HttpURLConnection connection, final int responseCode, final Throwable throwable) { - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { if (responseCode > 0) { // safe to access response data as 'responseCode' is set DECORATE.onResponse(span, connection); @@ -62,7 +62,7 @@ public void finishSpan(final HttpURLConnection connection, final int responseCod * (e.g. breaks getOutputStream). */ if (responseCode > 0) { - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { // safe to access response data as 'responseCode' is set DECORATE.onResponse(span, connection); DECORATE.beforeFinish(span); diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/AdviceUtils.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/AdviceUtils.java index b6d4ebe4f6b..81d6a6abd1f 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/AdviceUtils.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/AdviceUtils.java @@ -3,8 +3,9 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.isAsyncPropagationEnabled; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; import datadog.trace.bootstrap.ContextStore; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; /** Helper utils for Runnable/Callable instrumentation */ @@ -18,16 +19,16 @@ public class AdviceUtils { * @param task's type * @return scope if scope was started, or null */ - public static AgentScope startTaskScope( + public static ContextScope startTaskScope( final ContextStore contextStore, final T task) { return startTaskScope(contextStore.get(task)); } - public static AgentScope startTaskScope(State state) { + public static ContextScope startTaskScope(State state) { if (state != null) { - final AgentScope.Continuation continuation = state.getAndResetContinuation(); + final ContextContinuation continuation = state.getAndResetContinuation(); if (continuation != null) { - final AgentScope scope = continuation.activate(); + final ContextScope scope = continuation.resume(); // important - stop timing after the scope has been activated so the time in the queue can // be attributed to the correct context without duplicating the propagated information state.stopTiming(); @@ -37,7 +38,7 @@ public static AgentScope startTaskScope(State state) { return null; } - public static void endTaskScope(final AgentScope scope) { + public static void endTaskScope(final ContextScope scope) { if (null != scope) { scope.close(); } diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/ComparableRunnable.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/ComparableRunnable.java index a623d22ec48..b2b279a8ce1 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/ComparableRunnable.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/ComparableRunnable.java @@ -1,11 +1,11 @@ package datadog.trace.bootstrap.instrumentation.java.concurrent; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextContinuation; public final class ComparableRunnable> extends Wrapper implements Comparable> { - public ComparableRunnable(T delegate, AgentScope.Continuation continuation) { + public ComparableRunnable(T delegate, ContextContinuation continuation) { super(delegate, continuation); } diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/ConcurrentState.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/ConcurrentState.java index 03cd040ea64..50113054443 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/ConcurrentState.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/ConcurrentState.java @@ -4,8 +4,9 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.isAsyncPropagationEnabled; import static datadog.trace.bootstrap.instrumentation.java.concurrent.ContinuationClaim.CLAIMED; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; import datadog.trace.bootstrap.ContextStore; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; import org.slf4j.Logger; @@ -22,12 +23,12 @@ public final class ConcurrentState { public static ContextStore.Factory FACTORY = ConcurrentState::new; - private volatile AgentScope.Continuation continuation = null; + private volatile ContextContinuation continuation = null; - private static final AtomicReferenceFieldUpdater + private static final AtomicReferenceFieldUpdater CONTINUATION = AtomicReferenceFieldUpdater.newUpdater( - ConcurrentState.class, AgentScope.Continuation.class, "continuation"); + ConcurrentState.class, ContextContinuation.class, "continuation"); private ConcurrentState() {} @@ -44,7 +45,7 @@ public static ConcurrentState captureContinuation( return state; } - public static AgentScope activateAndContinueContinuation( + public static ContextScope activateAndContinueContinuation( ContextStore contextStore, K key) { final ConcurrentState state = contextStore.get(key); if (state == null) { @@ -54,7 +55,10 @@ public static AgentScope activateAndContinueContinuation( } public static void closeScope( - ContextStore contextStore, K key, AgentScope scope, Throwable throwable) { + ContextStore contextStore, + K key, + ContextScope scope, + Throwable throwable) { final ConcurrentState state = contextStore.get(key); if (scope != null) { scope.close(); @@ -88,27 +92,27 @@ private boolean captureAndSetContinuation(final AgentSpan span) { return false; } - private AgentScope activateAndContinueContinuation() { - final AgentScope.Continuation continuation = CONTINUATION.get(this); + private ContextScope activateAndContinueContinuation() { + final ContextContinuation continuation = CONTINUATION.get(this); if (continuation != null && continuation != CLAIMED) { - return continuation.activate(); + return continuation.resume(); } return null; } private void cancelContinuation() { - final AgentScope.Continuation continuation = CONTINUATION.get(this); + final ContextContinuation continuation = CONTINUATION.get(this); if (continuation != null && continuation != CLAIMED) { - continuation.cancel(); + continuation.release(); } } private void cancelAndClearContinuation() { - final AgentScope.Continuation continuation = CONTINUATION.get(this); + final ContextContinuation continuation = CONTINUATION.get(this); if (continuation != null && continuation != CLAIMED) { // We should never be able to reuse this state CONTINUATION.compareAndSet(this, continuation, CLAIMED); - continuation.cancel(); + continuation.release(); } } } diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/ContinuationClaim.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/ContinuationClaim.java index b9d90791b50..d7498489519 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/ContinuationClaim.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/ContinuationClaim.java @@ -1,29 +1,30 @@ package datadog.trace.bootstrap.instrumentation.java.concurrent; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; -import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.context.Context; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; -final class ContinuationClaim implements AgentScope.Continuation { +final class ContinuationClaim implements ContextContinuation { public static final ContinuationClaim CLAIMED = new ContinuationClaim(); @Override - public AgentScope.Continuation hold() { + public ContextContinuation hold() { throw new IllegalStateException(); } @Override - public AgentScope activate() { + public ContextScope resume() { throw new IllegalStateException(); } @Override - public AgentSpan span() { + public Context context() { throw new IllegalStateException(); } @Override - public void cancel() { + public void release() { throw new IllegalStateException(); } } diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/State.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/State.java index dea983b37da..122c1f090e0 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/State.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/State.java @@ -3,9 +3,9 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.captureSpan; import static datadog.trace.bootstrap.instrumentation.java.concurrent.ContinuationClaim.CLAIMED; +import datadog.context.ContextContinuation; import datadog.trace.api.profiling.Timing; import datadog.trace.bootstrap.ContextStore; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; @@ -13,11 +13,11 @@ public final class State { public static ContextStore.Factory FACTORY = State::new; - private static final AtomicReferenceFieldUpdater CONTINUATION = + private static final AtomicReferenceFieldUpdater CONTINUATION = AtomicReferenceFieldUpdater.newUpdater( - State.class, AgentScope.Continuation.class, "continuation"); + State.class, ContextContinuation.class, "continuation"); - private volatile AgentScope.Continuation continuation = null; + private volatile ContextContinuation continuation = null; private static final AtomicReferenceFieldUpdater TIMING = AtomicReferenceFieldUpdater.newUpdater(State.class, Timing.class, "timing"); @@ -40,34 +40,34 @@ public boolean captureAndSetContinuation(final AgentSpan span) { return false; } - public boolean setOrCancelContinuation(final AgentScope.Continuation continuation) { + public boolean setOrCancelContinuation(final ContextContinuation continuation) { if (CONTINUATION.compareAndSet(this, null, CLAIMED)) { // lazy write is guaranteed to be seen by getAndSet CONTINUATION.lazySet(this, continuation); return true; } else { - continuation.cancel(); + continuation.release(); return false; } } public void closeContinuation() { - AgentScope.Continuation continuation = getAndResetContinuation(); + ContextContinuation continuation = getAndResetContinuation(); if (null != continuation) { - continuation.cancel(); + continuation.release(); } } public AgentSpan getSpan() { - AgentScope.Continuation continuation = CONTINUATION.get(this); - if (null != continuation) { - return continuation.span(); + ContextContinuation continuation = CONTINUATION.get(this); + if (null == continuation || CLAIMED == continuation) { + return null; } - return null; + return AgentSpan.fromContext(continuation.context()); } - public AgentScope.Continuation getAndResetContinuation() { - AgentScope.Continuation continuation = CONTINUATION.get(this); + public ContextContinuation getAndResetContinuation() { + ContextContinuation continuation = CONTINUATION.get(this); if (null == continuation || CLAIMED == continuation) { return null; } diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/TPEHelper.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/TPEHelper.java index 12c4498fe6e..4e20cc0536e 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/TPEHelper.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/TPEHelper.java @@ -3,10 +3,10 @@ import static datadog.trace.bootstrap.instrumentation.java.concurrent.ExcludeFilter.ExcludeType.RUNNABLE; import static datadog.trace.bootstrap.instrumentation.java.concurrent.ExcludeFilter.exclude; +import datadog.context.ContextScope; import datadog.trace.api.GenericClassValue; import datadog.trace.api.InstrumenterConfig; import datadog.trace.bootstrap.ContextStore; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import java.util.Set; import java.util.concurrent.ThreadPoolExecutor; @@ -14,7 +14,7 @@ * This class is a helper for the ThreadPoolExecutorInstrumentation. The instrumentation has two * modes, where the legacy mode uses wrapping of the Runnable and the new mode uses the State * context store field in the actual Runnable. The ThreadLocal below is needed to transport the - * AgentScope between two methods when using the context store approach. More details can be found + * ContextScope between two methods when using the context store approach. More details can be found * in the ThreadPoolExecutorInstrumentation. */ public final class TPEHelper { @@ -24,7 +24,7 @@ public final class TPEHelper { // A ThreadPoolExecutor with one of these types will newer be propagated/wrapped private static final Set excludedClasses; // A ThreadLocal to store the Scope between beforeExecute and afterExecute if wrapping is not used - private static final ThreadLocal threadLocalScope; + private static final ThreadLocal threadLocalScope; private static final ClassValue WRAP = GenericClassValue.of( @@ -78,29 +78,29 @@ public static void capture(ContextStore contextStore, Runnable } } - public static AgentScope startScope(ContextStore contextStore, Runnable task) { + public static ContextScope startScope(ContextStore contextStore, Runnable task) { if (task == null || exclude(RUNNABLE, task)) { return null; } return AdviceUtils.startTaskScope(contextStore, task); } - public static void setThreadLocalScope(AgentScope scope, Runnable task) { + public static void setThreadLocalScope(ContextScope scope, Runnable task) { if (scope == null || task == null || exclude(RUNNABLE, task)) { return; } - AgentScope current = threadLocalScope.get(); + ContextScope current = threadLocalScope.get(); if (current != null) { current.close(); } threadLocalScope.set(scope); } - public static AgentScope getAndClearThreadLocalScope(Runnable task) { + public static ContextScope getAndClearThreadLocalScope(Runnable task) { if (task == null || exclude(RUNNABLE, task)) { return null; } - AgentScope scope = threadLocalScope.get(); + ContextScope scope = threadLocalScope.get(); // Intentionally use `.set(null)` instead of `.remove()` for performance reasons. // For details see: https://github.com/DataDog/dd-trace-java/pull/9856#discussion_r2527729963 // noinspection ThreadLocalSetWithNull @@ -108,7 +108,7 @@ public static AgentScope getAndClearThreadLocalScope(Runnable task) { return scope; } - public static void endScope(AgentScope scope, Runnable task) { + public static void endScope(ContextScope scope, Runnable task) { if (task == null || exclude(RUNNABLE, task)) { return; } diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/Wrapper.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/Wrapper.java index 5945ac4742f..a26cc0c4535 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/Wrapper.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/concurrent/Wrapper.java @@ -1,11 +1,12 @@ package datadog.trace.bootstrap.instrumentation.java.concurrent; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.captureActiveSpan; -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopContinuation; import static datadog.trace.bootstrap.instrumentation.java.concurrent.ExcludeFilter.ExcludeType.RUNNABLE; import static datadog.trace.bootstrap.instrumentation.java.concurrent.ExcludeFilter.exclude; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.Context; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; import java.util.concurrent.RunnableFuture; public class Wrapper implements Runnable, AutoCloseable { @@ -18,8 +19,8 @@ public static Runnable wrap(T task) { || exclude(RUNNABLE, task)) { return task; } - AgentScope.Continuation continuation = captureActiveSpan(); - if (continuation != noopContinuation()) { + ContextContinuation continuation = captureActiveSpan(); + if (continuation.context() != Context.root()) { if (task instanceof Comparable) { return new ComparableRunnable(task, continuation); } @@ -34,23 +35,23 @@ public static Runnable unwrap(Runnable task) { } protected final T delegate; - private final AgentScope.Continuation continuation; + private final ContextContinuation continuation; - public Wrapper(T delegate, AgentScope.Continuation continuation) { + public Wrapper(T delegate, ContextContinuation continuation) { this.delegate = delegate; this.continuation = continuation; } @Override public void run() { - try (AgentScope scope = activate()) { + try (ContextScope scope = activate()) { delegate.run(); } } public void cancel() { if (null != continuation) { - continuation.cancel(); + continuation.release(); } } @@ -58,8 +59,8 @@ public T unwrap() { return delegate; } - private AgentScope activate() { - return null == continuation ? null : continuation.activate(); + private ContextScope activate() { + return null == continuation ? null : continuation.resume(); } @Override diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/lang/VirtualThreadState.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/lang/VirtualThreadState.java index 0a1eec7573c..658988bce94 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/lang/VirtualThreadState.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/java/lang/VirtualThreadState.java @@ -1,7 +1,7 @@ package datadog.trace.bootstrap.instrumentation.java.lang; import datadog.context.Context; -import datadog.trace.bootstrap.instrumentation.api.AgentScope.Continuation; +import datadog.context.ContextContinuation; /** * This class holds the saved context and scope continuation for a virtual thread. @@ -14,12 +14,12 @@ public final class VirtualThreadState { private Context context; /** Prevents the enclosing context scope from completing before the virtual thread finishes. */ - private final Continuation continuation; + private final ContextContinuation continuation; /** The carrier thread's saved context, set between mount and unmount. */ private Context previousContext; - public VirtualThreadState(Context context, Continuation continuation) { + public VirtualThreadState(Context context, ContextContinuation continuation) { this.context = context; this.continuation = continuation; } @@ -40,7 +40,7 @@ public void onUnmount() { /** Called on termination: releases the trace continuation. */ public void onTerminate() { if (this.continuation != null) { - this.continuation.cancel(); + this.continuation.release(); } } } diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/jdbc/JDBCConnectionUrlParser.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/jdbc/JDBCConnectionUrlParser.java index ce2c5bf77f4..0f08e5019b7 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/jdbc/JDBCConnectionUrlParser.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/jdbc/JDBCConnectionUrlParser.java @@ -36,9 +36,16 @@ DBInfo.Builder doParse(final String jdbcUrl, final DBInfo.Builder builder) { populateStandardProperties(builder, splitQuery(uri.getQuery(), '&')); - final String user = uri.getUserInfo(); - if (user != null) { - builder.user(user); + final String rawUserInfo = uri.getRawUserInfo(); + if (rawUserInfo != null) { + // rawUserInfo keeps %3A encoded, so indexOf(':') only matches the password separator + final int colonLoc = rawUserInfo.indexOf(':'); + final String rawUser = colonLoc >= 0 ? rawUserInfo.substring(0, colonLoc) : rawUserInfo; + try { + builder.user(URLDecoder.decode(rawUser, "UTF-8")); + } catch (final UnsupportedEncodingException e) { + builder.user(rawUser); + } } String path = uri.getPath(); @@ -81,13 +88,26 @@ DBInfo.Builder doParse(final String jdbcUrl, final DBInfo.Builder builder) { final String urlPart1; final String urlPart2; final int paramLoc; + char paramSeparator = ';'; if (type.equals("db2") || type.equals("as400")) { if (jdbcUrl.contains("=")) { paramLoc = jdbcUrl.lastIndexOf(':'); - urlPart1 = jdbcUrl.substring(0, paramLoc); - urlPart2 = jdbcUrl.substring(paramLoc + 1); - + if (paramLoc > hostIndex + 2) { + urlPart1 = jdbcUrl.substring(0, paramLoc); + urlPart2 = jdbcUrl.substring(paramLoc + 1); + } else { + // No ':' past '://': fall back to '?' query-string params + final int queryLoc = jdbcUrl.indexOf('?'); + if (queryLoc >= 0) { + urlPart1 = jdbcUrl.substring(0, queryLoc); + urlPart2 = jdbcUrl.substring(queryLoc + 1); + paramSeparator = '&'; + } else { + urlPart1 = jdbcUrl; + urlPart2 = null; + } + } } else { urlPart1 = jdbcUrl; urlPart2 = null; @@ -99,7 +119,7 @@ DBInfo.Builder doParse(final String jdbcUrl, final DBInfo.Builder builder) { } if (urlPart2 != null) { - final Map props = splitQuery(urlPart2, ';'); + final Map props = splitQuery(urlPart2, paramSeparator); populateStandardProperties(builder, props); if (props.containsKey("servername")) { serverName = props.get("servername"); diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/reactivestreams/HandoffContext.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/reactivestreams/HandoffContext.java new file mode 100644 index 00000000000..353c8345423 --- /dev/null +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/reactivestreams/HandoffContext.java @@ -0,0 +1,41 @@ +package datadog.trace.bootstrap.instrumentation.reactivestreams; + +import datadog.context.Context; + +/** + * Value of the {@code (Publisher, HandoffContext)} store used to hand a context from a publisher's + * subscribe to that publisher's own subscriber (or a blocking call). + * + *

{@link #threadConfined} deposits are only adopted on the producing thread. The reactor-core + * bridge uses them because a shared publisher — a multicast/replay {@code Sinks.Many} with several + * consumers — is subscribed concurrently, and keying by publisher identity alone would let one + * consumer adopt another's context. This is safe because a subscribe chain runs synchronously on + * one thread. {@link #anyThread} deposits are adopted anywhere, for producers (resilience4j, + * spring-webflux, spring-messaging) that attach to a unique publisher subscribed later, possibly on + * another thread. + */ +public final class HandoffContext { + + private static final long ANY_THREAD = 0L; + + private final long threadId; + private final Context context; + + private HandoffContext(final Context context, final long threadId) { + this.context = context; + this.threadId = threadId; + } + + public static HandoffContext anyThread(final Context context) { + return new HandoffContext(context, ANY_THREAD); + } + + public static HandoffContext threadConfined(final Context context) { + return new HandoffContext(context, Thread.currentThread().getId()); + } + + /** The context, or {@code null} if this is a thread-confined deposit read on another thread. */ + public Context contextForCurrentThread() { + return threadId == ANY_THREAD || threadId == Thread.currentThread().getId() ? context : null; + } +} diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/rmi/RmiClientDecorator.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/rmi/RmiClientDecorator.java index 6d2a47b75f0..d89ddfb80b3 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/rmi/RmiClientDecorator.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/rmi/RmiClientDecorator.java @@ -40,11 +40,10 @@ protected String service() { return null; } - public AgentSpan onMethodInvocation(final AgentSpan span, final Method method) { + public void onMethodInvocation(final AgentSpan span, final Method method) { span.setResourceName(spanNameForMethod(method)); span.setTag( Tags.RPC_SERVICE, METHOD_CACHE.computeIfAbsent(method, m -> m.getDeclaringClass().getName())); - return span; } } diff --git a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/rmi/RmiServerDecorator.java b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/rmi/RmiServerDecorator.java index 33d6b780ed6..b1900b03e43 100644 --- a/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/rmi/RmiServerDecorator.java +++ b/dd-java-agent/agent-bootstrap/src/main/java/datadog/trace/bootstrap/instrumentation/rmi/RmiServerDecorator.java @@ -29,8 +29,8 @@ protected CharSequence component() { } @Override - public AgentSpan afterStart(final AgentSpan span) { + public void afterStart(final AgentSpan span) { span.setMeasured(true); - return super.afterStart(span); + super.afterStart(span); } } diff --git a/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/DatadogClassLoaderTest.groovy b/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/DatadogClassLoaderTest.groovy deleted file mode 100644 index 9b09d0f41c5..00000000000 --- a/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/DatadogClassLoaderTest.groovy +++ /dev/null @@ -1,107 +0,0 @@ -package datadog.trace.bootstrap - -import datadog.trace.test.util.DDSpecification -import spock.lang.Shared -import spock.lang.Timeout - -import java.util.concurrent.Callable -import java.util.concurrent.ExecutionException -import java.util.concurrent.ExecutorService -import java.util.concurrent.Executors -import java.util.concurrent.Future -import java.util.concurrent.Phaser -import java.util.concurrent.TimeUnit - -class DatadogClassLoaderTest extends DDSpecification { - @Shared - URL testJarLocation = new File("src/test/resources/classloader-test-jar/testjar-jdk8").toURI().toURL() - - @Shared - URL nestedTestJarLocation = new File("src/test/resources/classloader-test-jar/jar-with-nested-classes-jdk8").toURI().toURL() - - @Timeout(value = 60, unit = TimeUnit.SECONDS) - def "agent classloader does not lock classloading around instance"() { - setup: - def className1 = 'some/class/Name1' - def className2 = 'some/class/Name2' - final DatadogClassLoader ddLoader = new DatadogClassLoader() - final Phaser threadHoldLockPhase = new Phaser(2) - final Phaser acquireLockFromMainThreadPhase = new Phaser(2) - - when: - final Thread thread1 = new Thread() { - @Override - void run() { - synchronized (ddLoader.getClassLoadingLock(className1)) { - threadHoldLockPhase.arrive() - acquireLockFromMainThreadPhase.arriveAndAwaitAdvance() - } - } - } - thread1.start() - - final Thread thread2 = new Thread() { - @Override - void run() { - threadHoldLockPhase.arriveAndAwaitAdvance() - synchronized (ddLoader.getClassLoadingLock(className2)) { - acquireLockFromMainThreadPhase.arrive() - } - } - } - thread2.start() - thread1.join() - thread2.join() - boolean applicationDidNotDeadlock = true - - then: - applicationDidNotDeadlock - } - - def "agent classloader successfully loads classes concurrently"() { - given: - DatadogClassLoader ddLoader = new DatadogClassLoader(testJarLocation, null) - - when: - ExecutorService executorService = Executors.newCachedThreadPool() - List> futures = new ArrayList<>() - - for (int i = 0; i < 100; i++) { - futures.add(executorService.submit(new Callable() { - Void call() { - ddLoader.loadClass("a.A") - return null - } - })) - } - - for (Future callable : futures) { - try { - callable.get() - } catch (ExecutionException ex) { - throw ex.getCause() - } - } - - then: - noExceptionThrown() - } - - def "test load nested classes and call getEnclosingClass"() { - given: - DatadogClassLoader ddLoader = new DatadogClassLoader(nestedTestJarLocation, null) - - when: - Class klass = ddLoader.loadClass("p.EnclosingClass\$StaticInnerClass") - String simpleName = klass.getSimpleName() - - then: - simpleName == "StaticInnerClass" - - when: - Class enclosing = klass.getEnclosingClass() - - then: - enclosing.getSimpleName() == "EnclosingClass" - } -} diff --git a/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/buffer/InjectingPipeOutputStreamTest.groovy b/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/buffer/InjectingPipeOutputStreamTest.groovy index fcf4699075d..ed5525bbb4e 100644 --- a/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/buffer/InjectingPipeOutputStreamTest.groovy +++ b/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/buffer/InjectingPipeOutputStreamTest.groovy @@ -1,6 +1,7 @@ package datadog.trace.bootstrap.instrumentation.buffer import datadog.trace.test.util.DDSpecification +import java.util.concurrent.atomic.AtomicInteger import java.util.function.LongConsumer class InjectingPipeOutputStreamTest extends DDSpecification { @@ -152,6 +153,49 @@ class InjectingPipeOutputStreamTest extends DDSpecification { downstream.toByteArray() == testBytes.getBytes("UTF-8") } + def 'should honor non-zero offsets in bulk writes: #scenario'() { + setup: + def prefix = "ignored-prefix" + def payloadBytes = payload.getBytes("UTF-8") + def source = (prefix + payload + "ignored-suffix").getBytes("UTF-8") + def downstream = new ByteArrayOutputStream() + def counter = new Counter() + def injections = new AtomicInteger() + def piped = new InjectingPipeOutputStream(downstream, MARKER_BYTES, CONTEXT_BYTES, injections.&incrementAndGet, { long bytes -> counter.incr(bytes) }, null) + + when: + piped.write(source, prefix.getBytes("UTF-8").length, payloadBytes.length) + piped.close() + + then: + downstream.toByteArray() == expected.getBytes("UTF-8") + injections.get() == expectedInjections + counter.value == payloadBytes.length + + where: + scenario | payload | expected | expectedInjections + "without a marker" | "safe" | "safe" | 0 + "with a marker" | "dynamicsafe" | "dynamicsafe" | 1 + "with a marker at the end" | "dynamic-content" | "dynamic-content" | 1 + } + + def 'should prioritize a marker spanning a bulk write boundary'() { + setup: + def prefix = "ignored-prefix" + def payload = ">0123456789" + def source = (prefix + payload + "ignored-suffix").getBytes("UTF-8") + def downstream = new ByteArrayOutputStream() + def piped = new InjectingPipeOutputStream(downstream, MARKER_BYTES, CONTEXT_BYTES) + + when: + piped.write("abc0123456789".getBytes("UTF-8") + } + def 'should be resilient to exceptions when onBytesWritten callback is null'() { setup: def testBytes = "test content".getBytes("UTF-8") diff --git a/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/buffer/InjectingPipeWriterTest.groovy b/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/buffer/InjectingPipeWriterTest.groovy index 7466839f7c8..19307f61c2b 100644 --- a/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/buffer/InjectingPipeWriterTest.groovy +++ b/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/buffer/InjectingPipeWriterTest.groovy @@ -1,6 +1,7 @@ package datadog.trace.bootstrap.instrumentation.buffer import datadog.trace.test.util.DDSpecification +import java.util.concurrent.atomic.AtomicInteger import java.util.function.LongConsumer class InjectingPipeWriterTest extends DDSpecification { @@ -168,6 +169,48 @@ class InjectingPipeWriterTest extends DDSpecification { downstream.toString() == testBytes } + def 'should honor non-zero offsets in bulk writes: #scenario'() { + setup: + def prefix = "ignored-prefix" + def source = (prefix + payload + "ignored-suffix").toCharArray() + def downstream = new StringWriter() + def counter = new Counter() + def injections = new AtomicInteger() + def piped = new InjectingPipeWriter(downstream, MARKER_CHARS, CONTEXT_CHARS, injections.&incrementAndGet, { long bytes -> counter.incr(bytes) }, null) + + when: + piped.write(source, prefix.length(), payload.length()) + piped.close() + + then: + downstream.toString() == expected + injections.get() == expectedInjections + counter.value == payload.length() + + where: + scenario | payload | expected | expectedInjections + "without a marker" | "safe" | "safe" | 0 + "with a marker" | "dynamicsafe" | "dynamicsafe" | 1 + "with a marker at the end" | "dynamic-content" | "dynamic-content" | 1 + } + + def 'should prioritize a marker spanning a bulk write boundary'() { + setup: + def prefix = "ignored-prefix" + def payload = ">0123456789" + def source = (prefix + payload + "ignored-suffix").toCharArray() + def downstream = new StringWriter() + def piped = new InjectingPipeWriter(downstream, MARKER_CHARS, CONTEXT_CHARS) + + when: + piped.write("abc0123456789" + } + def 'should be resilient to exceptions when onBytesWritten callback is null'() { setup: def downstream = new StringWriter() diff --git a/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/dbm/SharedDBCommenterForkedTest.groovy b/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/dbm/SharedDBCommenterForkedTest.groovy index c655b5c1f97..5af48a0f5a0 100644 --- a/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/dbm/SharedDBCommenterForkedTest.groovy +++ b/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/dbm/SharedDBCommenterForkedTest.groovy @@ -7,12 +7,14 @@ class SharedDBCommenterForkedTest extends Specification { System.setProperty("dd.service.name", "test-service") System.setProperty("dd.env", "test-env") System.setProperty("dd.version", "1.0.0") + SharedDBCommenter.resetStaticPrefixForTesting() } def cleanup() { System.clearProperty("dd.service.name") System.clearProperty("dd.env") System.clearProperty("dd.version") + SharedDBCommenter.resetStaticPrefixForTesting() } def "buildComment generates expected format for MongoDB"() { diff --git a/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/BaseDecoratorTest.groovy b/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/BaseDecoratorTest.groovy index 354a9c6bc4f..5b70cba2085 100644 --- a/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/BaseDecoratorTest.groovy +++ b/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/BaseDecoratorTest.groovy @@ -31,7 +31,7 @@ class BaseDecoratorTest extends DDSpecification { then: 1 * span.setSpanType(decorator.spanType()) 1 * span.setTag(TagMap.Entry.create(Tags.COMPONENT, "test-component")) - 1 * span.context() >> spanContext + 1 * span.spanContext() >> spanContext 1 * spanContext.setIntegrationName("test-component") _ * span.setTag(_) _ * span.setTag(_, _) // Want to allow other calls from child implementations. diff --git a/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/ClientDecoratorTest.groovy b/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/ClientDecoratorTest.groovy index 3b40a04a9bb..fec5748f089 100644 --- a/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/ClientDecoratorTest.groovy +++ b/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/ClientDecoratorTest.groovy @@ -24,7 +24,7 @@ class ClientDecoratorTest extends BaseDecoratorTest { } 1 * span.setMeasured(true) 1 * span.setTag(TagMap.Entry.create(Tags.COMPONENT, "test-component")) - 1 * span.context() >> spanContext + 1 * span.spanContext() >> spanContext 1 * spanContext.setIntegrationName("test-component") 1 * span.setTag(TagMap.Entry.create(Tags.SPAN_KIND, "client")) 1 * span.setSpanType(decorator.spanType()) diff --git a/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/DBTypeProcessingDatabaseClientDecoratorTest.groovy b/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/DBTypeProcessingDatabaseClientDecoratorTest.groovy index 85b9d6fd66a..624100fcc50 100644 --- a/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/DBTypeProcessingDatabaseClientDecoratorTest.groovy +++ b/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/DBTypeProcessingDatabaseClientDecoratorTest.groovy @@ -25,7 +25,7 @@ class DBTypeProcessingDatabaseClientDecoratorTest extends ClientDecoratorTest { } 1 * span.setMeasured(true) 1 * span.setTag(Tags.COMPONENT, "test-component") - 1 * span.context() >> spanContext + 1 * span.spanContext() >> spanContext 1 * spanContext.setIntegrationName("test-component") 1 * span.setTag(TagMap.Entry.create(Tags.SPAN_KIND, "client")) 1 * span.setSpanType("test-type") diff --git a/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/DatabaseClientDecoratorTest.groovy b/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/DatabaseClientDecoratorTest.groovy index 164138cbe0f..93852ccc88c 100644 --- a/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/DatabaseClientDecoratorTest.groovy +++ b/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/DatabaseClientDecoratorTest.groovy @@ -28,7 +28,7 @@ class DatabaseClientDecoratorTest extends ClientDecoratorTest { } 1 * span.setMeasured(true) 1 * span.setTag(TagMap.Entry.create(Tags.COMPONENT, "test-component")) - 1 * span.context() >> spanContext + 1 * span.spanContext() >> spanContext 1 * spanContext.setIntegrationName("test-component") 1 * span.setTag(TagMap.Entry.create(Tags.SPAN_KIND, "client")) 1 * span.setSpanType("test-type") diff --git a/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/SampleJavaClass.java b/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/SampleJavaClass.java index 7a2f61f2923..7897cd83037 100644 --- a/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/SampleJavaClass.java +++ b/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/SampleJavaClass.java @@ -1,13 +1,10 @@ package datadog.trace.bootstrap.instrumentation.decorator; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; - /** * Used by {@link BaseDecoratorTest}. Groovy with Java 10+ doesn't seem to treat it properly as an * anonymous class, so use a Java class instead. */ public class SampleJavaClass { - @SuppressFBWarnings("DM_NEW_FOR_GETCLASS") public static Class anonymousClass = new Runnable() { diff --git a/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/ServerDecoratorTest.groovy b/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/ServerDecoratorTest.groovy index ae41a1f523b..d60c1534627 100644 --- a/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/ServerDecoratorTest.groovy +++ b/dd-java-agent/agent-bootstrap/src/test/groovy/datadog/trace/bootstrap/instrumentation/decorator/ServerDecoratorTest.groovy @@ -24,7 +24,7 @@ class ServerDecoratorTest extends BaseDecoratorTest { then: 1 * span.setTag(TagMap.Entry.create(LANGUAGE_TAG_KEY, LANGUAGE_TAG_VALUE)) 1 * span.setTag(TagMap.Entry.create(COMPONENT, "test-component")) - 1 * span.context() >> spanContext + 1 * span.spanContext() >> spanContext 1 * spanContext.setIntegrationName("test-component") 1 * span.setTag(TagMap.Entry.create(SPAN_KIND, "server")) 1 * span.setSpanType(decorator.spanType()) diff --git a/dd-java-agent/agent-bootstrap/src/test/java/datadog/trace/bootstrap/AgentJarIndexTest.java b/dd-java-agent/agent-bootstrap/src/test/java/datadog/trace/bootstrap/AgentJarIndexTest.java new file mode 100644 index 00000000000..7ff3028b9cf --- /dev/null +++ b/dd-java-agent/agent-bootstrap/src/test/java/datadog/trace/bootstrap/AgentJarIndexTest.java @@ -0,0 +1,313 @@ +package datadog.trace.bootstrap; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; + +import java.io.BufferedInputStream; +import java.io.DataInputStream; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Arrays; +import java.util.List; +import java.util.jar.JarFile; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +class AgentJarIndexTest { + + // --- computeEntryKey tests --- + + private static String computeEntryKey(String pathStr) { + return AgentJarIndex.IndexGenerator.computeEntryKey(Paths.get(pathStr)); + } + + @Test + void computeEntryKeyReturnsNullForIgnoredFiles() { + assertNull(computeEntryKey("MANIFEST.MF")); + assertNull(computeEntryKey("NOTICE")); + assertNull(computeEntryKey("LICENSE.renamed")); + } + + @Test + void computeEntryKeyReturnsWildcardForInstrumentationSubtree() { + assertEquals( + "datadog.trace.instrumentation.*", + computeEntryKey("datadog/trace/instrumentation/servlet/ServletAdvice.classdata")); + assertEquals( + "datadog.trace.instrumentation.*", + computeEntryKey("datadog/trace/instrumentation/SomeAdvice.classdata")); + } + + @Test + void computeEntryKeyReturnsWildcardForDeepPaths() { + // 3+ path elements → wildcard on parent directory, regardless of file extension + assertEquals("com.example.*", computeEntryKey("com/example/Foo.classdata")); + assertEquals("com.example.*", computeEntryKey("com/example/Foo.xml")); + assertEquals("com.example.sub.*", computeEntryKey("com/example/sub/Foo.classdata")); + } + + @Test + void computeEntryKeyReturnsFullPathForSingleElementPaths() { + // nameCount == 1 skips the wildcard block entirely + assertEquals("Foo.classdata", computeEntryKey("Foo.classdata")); + assertEquals("some-lib.jar", computeEntryKey("some-lib.jar")); + } + + @Test + void computeEntryKeyReturnsWildcardForClassdataAtTwoLevels() { + // 2-level .classdata files are deep enough to use a wildcard + assertEquals("com.*", computeEntryKey("com/Foo.classdata")); + } + + @Test + void computeEntryKeyReturnsFullPathForShallowNonClassdataFiles() { + // 2-level non-.classdata files keep their full dot-separated name + assertEquals("com.Foo.class", computeEntryKey("com/Foo.class")); + assertEquals("META-INF.services.Foo", computeEntryKey("META-INF/services/Foo")); + } + + @Test + void computeEntryKeyDoesNotCountMetaInfAsUniqueElement() { + // META-INF/x/y → nameCount effectively 2 → no wildcard + assertEquals("META-INF.services.SomeService", computeEntryKey("META-INF/services/SomeService")); + // META-INF/x/y/z → nameCount effectively 3 → wildcard + assertEquals("META-INF.services.com.*", computeEntryKey("META-INF/services/com/SomeService")); + } + + // --- buildIndex / writeIndex / readIndex round-trip --- + + /** Creates a temp JAR containing only the index file written by the generator. */ + private static AgentJarIndex buildAndReadIndex(Path resourcesDir, Path tempDir) throws Exception { + AgentJarIndex.IndexGenerator generator = new AgentJarIndex.IndexGenerator(resourcesDir); + generator.buildIndex(); + + Path indexFile = tempDir.resolve("dd-java-agent.index"); + generator.writeIndex(indexFile); + + Path jarFile = tempDir.resolve("test-agent.jar"); + try (ZipOutputStream zip = new ZipOutputStream(Files.newOutputStream(jarFile))) { + zip.putNextEntry(new ZipEntry("dd-java-agent.index")); + Files.copy(indexFile, zip); + zip.closeEntry(); + } + + try (JarFile jar = new JarFile(jarFile.toFile())) { + return AgentJarIndex.readIndex(jar); + } + } + + private static void createFile(Path root, String relativePath) throws IOException { + Path file = root.resolve(relativePath.replace('/', java.io.File.separatorChar)); + Files.createDirectories(file.getParent()); + Files.createFile(file); + } + + private static Path writeIndex(Path resourcesDir, Path indexFile) throws IOException { + AgentJarIndex.IndexGenerator generator = new AgentJarIndex.IndexGenerator(resourcesDir); + generator.buildIndex(); + generator.writeIndex(indexFile); + return indexFile; + } + + private static List readPrefixes(Path indexFile) throws IOException { + try (DataInputStream in = + new DataInputStream(new BufferedInputStream(Files.newInputStream(indexFile)))) { + int prefixCount = in.readInt(); + String[] prefixes = new String[prefixCount]; + for (int i = 0; i < prefixCount; i++) { + prefixes[i] = in.readUTF(); + } + return Arrays.asList(prefixes); + } + } + + @Test + void classEntryNameResolvesBootstrapClassToTopLevel(@TempDir Path tempDir) throws Exception { + Path resources = tempDir.resolve("resources"); + // Only the inst/ prefix exists; datadog.* falls back to main jar (prefixId == 0) + createFile(resources, "inst/datadog/trace/instrumentation/servlet/ServletAdvice.classdata"); + + AgentJarIndex index = buildAndReadIndex(resources, tempDir); + + assertNotNull(index); + assertEquals( + "datadog/trace/bootstrap/Bootstrap.class", + index.classEntryName("datadog.trace.bootstrap.Bootstrap")); + } + + @Test + void classEntryNameResolvesInstrumentationClassToInstPrefix(@TempDir Path tempDir) + throws Exception { + Path resources = tempDir.resolve("resources"); + createFile(resources, "inst/datadog/trace/instrumentation/servlet/ServletAdvice.classdata"); + + AgentJarIndex index = buildAndReadIndex(resources, tempDir); + + assertNotNull(index); + assertEquals( + "inst/datadog/trace/instrumentation/servlet/ServletAdvice.classdata", + index.classEntryName("datadog.trace.instrumentation.servlet.ServletAdvice")); + } + + @Test + void classEntryNameReturnsNullForUnknownPackage(@TempDir Path tempDir) throws Exception { + Path resources = tempDir.resolve("resources"); + createFile(resources, "inst/datadog/trace/instrumentation/servlet/ServletAdvice.classdata"); + + AgentJarIndex index = buildAndReadIndex(resources, tempDir); + + assertNotNull(index); + // com.example.* is not indexed → null + assertNull(index.classEntryName("com.example.Unknown")); + } + + @Test + void classEntryNameResolvesDeepNestedClassToCorrectPrefix(@TempDir Path tempDir) + throws Exception { + Path resources = tempDir.resolve("resources"); + createFile(resources, "metrics/com/datadoghq/stats/StatsClient.classdata"); + + AgentJarIndex index = buildAndReadIndex(resources, tempDir); + + assertNotNull(index); + assertEquals( + "metrics/com/datadoghq/stats/StatsClient.classdata", + index.classEntryName("com.datadoghq.stats.StatsClient")); + } + + @Test + void resourceEntryNamePassesThroughTopLevelResources(@TempDir Path tempDir) throws Exception { + Path resources = tempDir.resolve("resources"); + createFile(resources, "inst/datadog/trace/instrumentation/servlet/ServletAdvice.classdata"); + + AgentJarIndex index = buildAndReadIndex(resources, tempDir); + + assertNotNull(index); + String resourceName = "datadog/trace/bootstrap/Bootstrap.class"; + assertEquals(resourceName, index.resourceEntryName(resourceName)); + } + + @Test + void resourceEntryNameAppendsDataSuffixForClassResource(@TempDir Path tempDir) throws Exception { + Path resources = tempDir.resolve("resources"); + createFile(resources, "inst/datadog/trace/instrumentation/servlet/ServletAdvice.classdata"); + + AgentJarIndex index = buildAndReadIndex(resources, tempDir); + + assertNotNull(index); + assertEquals( + "inst/datadog/trace/instrumentation/servlet/ServletAdvice.classdata", + index.resourceEntryName("datadog/trace/instrumentation/servlet/ServletAdvice.class")); + } + + @Test + void multiplePrefixesAreIndexedIndependently(@TempDir Path tempDir) throws Exception { + Path resources = tempDir.resolve("resources"); + createFile(resources, "inst/datadog/trace/instrumentation/servlet/ServletAdvice.classdata"); + createFile(resources, "metrics/com/datadoghq/stats/StatsClient.classdata"); + + AgentJarIndex index = buildAndReadIndex(resources, tempDir); + + assertNotNull(index); + assertEquals( + "inst/datadog/trace/instrumentation/servlet/ServletAdvice.classdata", + index.classEntryName("datadog.trace.instrumentation.servlet.ServletAdvice")); + assertEquals( + "metrics/com/datadoghq/stats/StatsClient.classdata", + index.classEntryName("com.datadoghq.stats.StatsClient")); + } + + @Test + void buildIndexWritesPrefixesInSortedOrder(@TempDir Path tempDir) throws Exception { + Path resources = tempDir.resolve("resources"); + createFile(resources, "metrics/com/datadoghq/stats/StatsClient.classdata"); + createFile(resources, "inst/datadog/trace/instrumentation/servlet/ServletAdvice.classdata"); + createFile(resources, "appsec/com/datadog/appsec/Event.classdata"); + + Path indexFile = writeIndex(resources, tempDir.resolve("dd-java-agent.index")); + + assertEquals(Arrays.asList("appsec/", "inst/", "metrics/"), readPrefixes(indexFile)); + } + + @Test + void buildIndexIgnoresTopLevelFilesWhenCollectingPrefixes(@TempDir Path tempDir) + throws Exception { + Path resources = tempDir.resolve("resources"); + createFile(resources, "root-resource.properties"); + createFile(resources, "inst/datadog/trace/instrumentation/servlet/ServletAdvice.classdata"); + + Path indexFile = writeIndex(resources, tempDir.resolve("dd-java-agent.index")); + + assertEquals(Arrays.asList("inst/"), readPrefixes(indexFile)); + } + + @Test + void buildIndexIsIndependentOfDirectoryCreationOrder(@TempDir Path tempDir) throws Exception { + Path buildResources = tempDir.resolve("build-resources"); + createFile(buildResources, "appsec/com/datadog/appsec/Event.classdata"); + createFile(buildResources, "ci-visibility/com/datadog/ci/Visibility.classdata"); + createFile(buildResources, "cws-tls/com/datadog/cws/Tls.classdata"); + createFile( + buildResources, "inst/datadog/trace/instrumentation/servlet/ServletAdvice.classdata"); + + Path deployResources = tempDir.resolve("deploy-resources"); + createFile(deployResources, "cws-tls/com/datadog/cws/Tls.classdata"); + createFile(deployResources, "ci-visibility/com/datadog/ci/Visibility.classdata"); + createFile(deployResources, "appsec/com/datadog/appsec/Event.classdata"); + createFile( + deployResources, "inst/datadog/trace/instrumentation/servlet/ServletAdvice.classdata"); + + Path buildIndex = writeIndex(buildResources, tempDir.resolve("build-dd-java-agent.index")); + Path deployIndex = writeIndex(deployResources, tempDir.resolve("deploy-dd-java-agent.index")); + + assertArrayEquals(Files.readAllBytes(buildIndex), Files.readAllBytes(deployIndex)); + } + + @Test + void buildIndexWithEmptyResourcesDirProducesWorkingIndex(@TempDir Path tempDir) throws Exception { + Path resources = tempDir.resolve("resources"); + Files.createDirectories(resources); + + AgentJarIndex index = buildAndReadIndex(resources, tempDir); + + assertNotNull(index); + // All lookups fall through to main jar (prefixId == 0) or null + String name = "datadog/trace/bootstrap/Bootstrap.class"; + assertEquals(name, index.resourceEntryName(name)); + } + + @Test + void resourceEntryNameReturnsNullForResourceOutsideAnyIndexedPrefix(@TempDir Path tempDir) + throws Exception { + Path resources = tempDir.resolve("resources"); + createFile(resources, "inst/datadog/trace/instrumentation/servlet/ServletAdvice.classdata"); + + AgentJarIndex index = buildAndReadIndex(resources, tempDir); + + assertNotNull(index); + // com.* is not indexed → null (symmetric with classEntryNameReturnsNullForUnknownPackage) + assertNull(index.resourceEntryName("com/example/Foo.class")); + } + + @Test + void resourceEntryNameDoesNotAppendDataSuffixForNonClassResources(@TempDir Path tempDir) + throws Exception { + Path resources = tempDir.resolve("resources"); + createFile(resources, "inst/datadog/trace/instrumentation/servlet/ServletAdvice.classdata"); + + AgentJarIndex index = buildAndReadIndex(resources, tempDir); + + assertNotNull(index); + // A non-.class resource under an indexed prefix is returned with the prefix prepended + // but without the "data" suffix (only .class resources get "data" appended) + assertEquals( + "inst/datadog/trace/instrumentation/servlet/services", + index.resourceEntryName("datadog/trace/instrumentation/servlet/services")); + } +} diff --git a/dd-java-agent/agent-bootstrap/src/test/java/datadog/trace/bootstrap/DatadogClassLoaderTest.java b/dd-java-agent/agent-bootstrap/src/test/java/datadog/trace/bootstrap/DatadogClassLoaderTest.java new file mode 100644 index 00000000000..376b035a043 --- /dev/null +++ b/dd-java-agent/agent-bootstrap/src/test/java/datadog/trace/bootstrap/DatadogClassLoaderTest.java @@ -0,0 +1,171 @@ +package datadog.trace.bootstrap; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.File; +import java.lang.reflect.Method; +import java.net.URL; +import java.nio.file.Files; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.Phaser; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; + +class DatadogClassLoaderTest { + private static final URL testJarLocation = + toUrl(new File("src/test/resources/classloader-test-jar/testjar-jdk8")); + private static final URL nestedTestJarLocation = + toUrl(new File("src/test/resources/classloader-test-jar/jar-with-nested-classes-jdk8")); + + private static URL toUrl(File file) { + try { + return file.toURI().toURL(); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + // ClassLoader.getClassLoadingLock is protected; reach it via reflection, matching what the + // original Groovy test did implicitly. + private static Object classLoadingLock(ClassLoader cl, String name) throws Exception { + Method m = ClassLoader.class.getDeclaredMethod("getClassLoadingLock", String.class); + m.setAccessible(true); + return m.invoke(cl, name); + } + + @Test + @Timeout(60) + void agentClassloaderDoesNotLockClassloadingAroundInstance() throws Exception { + // setup + String className1 = "some/class/Name1"; + String className2 = "some/class/Name2"; + DatadogClassLoader ddLoader = new DatadogClassLoader(); + Object lock1 = classLoadingLock(ddLoader, className1); + Object lock2 = classLoadingLock(ddLoader, className2); + Phaser threadHoldLockPhase = new Phaser(2); + Phaser acquireLockFromMainThreadPhase = new Phaser(2); + + // when + Thread thread1 = + new Thread() { + @Override + public void run() { + synchronized (lock1) { + threadHoldLockPhase.arrive(); + acquireLockFromMainThreadPhase.arriveAndAwaitAdvance(); + } + } + }; + thread1.start(); + + Thread thread2 = + new Thread() { + @Override + public void run() { + threadHoldLockPhase.arriveAndAwaitAdvance(); + synchronized (lock2) { + acquireLockFromMainThreadPhase.arrive(); + } + } + }; + thread2.start(); + thread1.join(); + thread2.join(); + + // then — reaching this point means no deadlock occurred + } + + @Test + void agentClassloaderSuccessfullyLoadsClassesConcurrently() throws Exception { + // given + DatadogClassLoader ddLoader = new DatadogClassLoader(testJarLocation, null); + + // when + ExecutorService executorService = Executors.newCachedThreadPool(); + List> futures = new ArrayList<>(); + for (int i = 0; i < 100; i++) { + futures.add( + executorService.submit( + () -> { + ddLoader.loadClass("a.A"); + return null; + })); + } + for (Future future : futures) { + try { + future.get(); + } catch (Exception ex) { + if (ex.getCause() instanceof Throwable) { + throw (Exception) ex.getCause(); + } + throw ex; + } + } + + // then — no exception thrown + } + + @Test + void loadNestedClassesAndCallGetEnclosingClass() throws Exception { + // given + DatadogClassLoader ddLoader = new DatadogClassLoader(nestedTestJarLocation, null); + + // when + Class klass = ddLoader.loadClass("p.EnclosingClass$StaticInnerClass"); + + // then + assertEquals("StaticInnerClass", klass.getSimpleName()); + + // when + Class enclosing = klass.getEnclosingClass(); + + // then + assertEquals("EnclosingClass", enclosing.getSimpleName()); + } + + /** + * Regression test for APMS-19624 / DataDog/dd-trace-java#6398. The resource URL must be built + * from the agent jar URL (a properly-formed {@code file:} URL), not from {@code + * JarFile.getName()} (an OS-native path). On Windows the OS-native form is {@code + * C:\Datadog\dd-java-agent.jar}, which produces the malformed URL {@code + * jar:file:C:\Datadog\dd-java-agent.jar!/...} and breaks helper-class injection on Spring Boot + * 1.3.5 {@code LaunchedURLClassLoader}. + * + *

We exercise the divergence cross-platform by copying the test jar into a directory whose + * name contains a space: {@code URL.toString()} percent-encodes it, {@code JarFile.getName()} + * does not. + */ + @Test + void findResourceUsesAgentJarUrlAsPrefix(@org.junit.jupiter.api.io.TempDir File tempDir) + throws Exception { + File spacedDir = new File(tempDir, "dir with spaces"); + assertTrue(spacedDir.mkdirs()); + File spacedJar = new File(spacedDir, "testjar-jdk8"); + Files.copy( + new File("src/test/resources/classloader-test-jar/testjar-jdk8").toPath(), + spacedJar.toPath()); + + URL spacedJarUrl = spacedJar.toURI().toURL(); + DatadogClassLoader ddLoader = new DatadogClassLoader(spacedJarUrl, null); + + URL resource = ddLoader.findResource("a/A.class"); + assertNotNull(resource, "findResource should locate a/A.class in the test jar"); + + String expectedPrefix = "jar:" + spacedJarUrl + "!/"; + assertTrue( + resource.toString().startsWith(expectedPrefix), + () -> + "resource URL (" + + resource + + ") should start with the agent jar URL prefix (" + + expectedPrefix + + ") — pre-fix code derives the prefix from JarFile.getName()," + + " which leaves the space unencoded and on Windows produces a malformed URL."); + } +} diff --git a/dd-java-agent/agent-bootstrap/src/test/java/datadog/trace/bootstrap/JfrEventHolderInitForkedTest.java b/dd-java-agent/agent-bootstrap/src/test/java/datadog/trace/bootstrap/JfrEventHolderInitForkedTest.java new file mode 100644 index 00000000000..ebe9e8443da --- /dev/null +++ b/dd-java-agent/agent-bootstrap/src/test/java/datadog/trace/bootstrap/JfrEventHolderInitForkedTest.java @@ -0,0 +1,81 @@ +package datadog.trace.bootstrap; + +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assumptions.assumeTrue; + +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Test; + +/** + * Regression test for the JFR startup-deadlock workaround in {@link Agent}. + * + *

{@link Agent#initializeJfrEventHolderClass(ClassLoader)} force-initializes the JDK's JFR + * event-holder class ({@code jdk.jfr.events.Handlers} on JDK 15-18, {@code + * jdk.jfr.events.EventConfigurations} on JDK 19-22) to avoid an ABBA deadlock. Its static-final + * handler fields are populated from {@code jdk.jfr.internal.Utils} at {@code } time and + * stay {@code null} forever if the class is initialized before the JDK's built-in events are + * registered (i.e. before {@code FlightRecorder} initialization). A null-poisoned holder silently + * disables the built-in socket/file/exception JFR events. + * + *

This test runs the production initialization path and asserts none of the handler fields were + * poisoned. It is a {@code ForkedTest} because JFR/class initialization happens once per JVM, so + * the ordering under test is only exercised in a fresh JVM that has not yet touched JFR. + * + *

Scope and limitations: + * + *

    + *
  • It verifies the ordering invariant (non-null handler fields), not end-to-end event + * emission. That keeps it fast and non-flaky; the deadlock itself is timing-dependent and is + * defended structurally (see {@code Agent#registerJfrEvents}) rather than reproduced here. + *
  • It assumes the forked JVM has not initialized JFR before the test runs. If the test JVM is + * ever launched with JFR already started (e.g. {@code -XX:StartFlightRecording} or an + * attached JFR profiler), the holder would already hold valid handlers and the test would + * pass without exercising the ordering. In the standard forked test JVM nothing touches JFR + * first, so the test is meaningful (confirmed: it fails if the FlightRecorder-before-holder + * ordering is reversed). + *
+ * + *

Requires {@code --add-opens jdk.jfr/jdk.jfr.events=ALL-UNNAMED} (configured in build.gradle) + * to read the holder's fields reflectively. Automatically skipped where there is no holder to + * initialize: JDK 14 and earlier, JDK 23+ (eager-init pattern removed), and non-HotSpot VMs such as + * Eclipse OpenJ9 / IBM Semeru (different JFR implementation). + */ +public class JfrEventHolderInitForkedTest { + + @Test + public void productionInitOrderingDoesNotPoisonHandlers() throws Exception { + final ClassLoader loader = getClass().getClassLoader(); + + // The holder class (if any) is selected by JDK version; skip when this JDK has none (JDK 8, + // 23+). + final String holderName = Agent.jfrEventHolderClassName(); + assumeTrue(holderName != null, "No JFR event-holder class on this JDK; nothing to test"); + + // Exercise the exact production path: FlightRecorder init first, then holder . + Agent.initializeJfrEventHolderClass(loader); + + // The holder is now initialized; read its static handler fields and check none are null. + final Class holder = Class.forName(holderName, false, loader); + final List nullFields = new ArrayList<>(); + int handlerFields = 0; + for (final Field field : holder.getDeclaredFields()) { + if (!Modifier.isStatic(field.getModifiers()) || field.getType().isPrimitive()) { + continue; + } + handlerFields++; + field.setAccessible(true); + if (field.get(null) == null) { + nullFields.add(field.getName()); + } + } + + assertTrue(handlerFields > 0, "expected " + holderName + " to declare handler fields"); + assertTrue( + nullFields.isEmpty(), + "JFR handler fields were poisoned to null (holder initialized before FlightRecorder): " + + nullFields); + } +} diff --git a/dd-java-agent/agent-bootstrap/src/test/java/datadog/trace/bootstrap/instrumentation/classloading/ClassDefiningTest.java b/dd-java-agent/agent-bootstrap/src/test/java/datadog/trace/bootstrap/instrumentation/classloading/ClassDefiningTest.java new file mode 100644 index 00000000000..b3941727472 --- /dev/null +++ b/dd-java-agent/agent-bootstrap/src/test/java/datadog/trace/bootstrap/instrumentation/classloading/ClassDefiningTest.java @@ -0,0 +1,95 @@ +package datadog.trace.bootstrap.instrumentation.classloading; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; + +import java.lang.reflect.Field; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class ClassDefiningTest { + + @BeforeEach + void resetStaticState() throws Exception { + Field hasObserver = ClassDefining.class.getDeclaredField("HAS_OBSERVER"); + hasObserver.setAccessible(true); + ((AtomicBoolean) hasObserver.get(null)).set(false); + + Field observer = ClassDefining.class.getDeclaredField("OBSERVER"); + observer.setAccessible(true); + observer.set(null, (ClassDefining.Observer) (loader, bytecode, offset, length) -> {}); + } + + @Test + void beginWithNoObserverIsNoOp() { + assertDoesNotThrow(() -> ClassDefining.begin(null, new byte[10], 0, 10)); + } + + @Test + void beginCallsRegisteredObserverOnEachInvocation() { + AtomicInteger calls = new AtomicInteger(); + ClassDefining.observe((loader, bytecode, offset, length) -> calls.incrementAndGet()); + + ClassDefining.begin(null, new byte[4], 0, 4); + ClassDefining.begin(null, new byte[4], 0, 4); + + assertEquals(2, calls.get()); + } + + @Test + void observerReceivesCorrectArguments() { + ClassLoader loader = ClassLoader.getSystemClassLoader(); + byte[] bytecode = {1, 2, 3, 4, 5}; + + ClassLoader[] capturedLoader = new ClassLoader[1]; + byte[][] capturedBytecode = new byte[1][]; + int[] capturedOffset = new int[1]; + int[] capturedLength = new int[1]; + + ClassDefining.observe( + (l, b, o, len) -> { + capturedLoader[0] = l; + capturedBytecode[0] = b; + capturedOffset[0] = o; + capturedLength[0] = len; + }); + + ClassDefining.begin(loader, bytecode, 1, 3); + + assertSame(loader, capturedLoader[0]); + assertSame(bytecode, capturedBytecode[0]); + assertEquals(1, capturedOffset[0]); + assertEquals(3, capturedLength[0]); + } + + @Test + void secondObserveCallIsIgnoredFirstObserverRemains() { + AtomicInteger firstCalls = new AtomicInteger(); + AtomicInteger secondCalls = new AtomicInteger(); + + ClassDefining.observe((loader, bytecode, offset, length) -> firstCalls.incrementAndGet()); + ClassDefining.observe((loader, bytecode, offset, length) -> secondCalls.incrementAndGet()); + + ClassDefining.begin(null, new byte[4], 0, 4); + + assertEquals(1, firstCalls.get()); + assertEquals(0, secondCalls.get()); + } + + @Test + void observeIsIdempotentWhenCalledWithSameObserverRepeatedly() { + AtomicInteger calls = new AtomicInteger(); + ClassDefining.Observer observer = (l, b, o, len) -> calls.incrementAndGet(); + + for (int i = 0; i < 5; i++) { + ClassDefining.observe(observer); + } + + ClassDefining.begin(null, new byte[1], 0, 1); + + assertEquals(1, calls.get()); + } +} diff --git a/dd-java-agent/agent-bootstrap/src/test/java/datadog/trace/bootstrap/instrumentation/dbm/SharedDBCommenterContainsTraceCommentTest.java b/dd-java-agent/agent-bootstrap/src/test/java/datadog/trace/bootstrap/instrumentation/dbm/SharedDBCommenterContainsTraceCommentTest.java new file mode 100644 index 00000000000..8a1e8edcb99 --- /dev/null +++ b/dd-java-agent/agent-bootstrap/src/test/java/datadog/trace/bootstrap/instrumentation/dbm/SharedDBCommenterContainsTraceCommentTest.java @@ -0,0 +1,48 @@ +package datadog.trace.bootstrap.instrumentation.dbm; + +import static datadog.trace.bootstrap.instrumentation.dbm.SharedDBCommenter.containsTraceComment; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; + +/** + * DB-level behavior of {@link SharedDBCommenter#containsTraceComment}: the nine "=" needle + * set, the {@code String} delegate, and the range overload checking the comment body in place. (The + * {@code [from, to)} boundary semantics are unit-tested on {@code Strings.regionContains}.) + */ +class SharedDBCommenterContainsTraceCommentTest { + + @Test + void delegate_wholeString() { + assertTrue(containsTraceComment("ddps='svc',dde='test'")); + assertFalse(containsTraceComment("just a plain comment")); + assertFalse(containsTraceComment("")); + } + + @Test + void range_needleInsideCommentBody() { + String sql = "SELECT 1 /*ddps='svc',dde='test'*/"; + int from = sql.indexOf("/*") + 2; + int to = sql.indexOf("*/"); + assertTrue(containsTraceComment(sql, from, to)); + } + + @Test + void range_nonDdCommentBody() { + String sql = "SELECT 1 /* just a customer comment */"; + int from = sql.indexOf("/*") + 2; + int to = sql.indexOf("*/"); + assertFalse(containsTraceComment(sql, from, to)); + } + + @Test + void range_ddNeedleOutsideCommentRegionNotMatched() { + // The DD needle sits in the statement body, not the comment region we pass -- a whole-string + // contains would false-positive; the range check must scope to [from, to). + String sql = "ddps='x' /* clean */"; + int from = sql.indexOf("/*") + 2; + int to = sql.indexOf("*/"); + assertFalse(containsTraceComment(sql, from, to)); + } +} diff --git a/dd-java-agent/agent-bootstrap/src/test/java/datadog/trace/bootstrap/instrumentation/decorator/HttpServerDecoratorSecurityTestingHeadersTest.java b/dd-java-agent/agent-bootstrap/src/test/java/datadog/trace/bootstrap/instrumentation/decorator/HttpServerDecoratorSecurityTestingHeadersTest.java new file mode 100644 index 00000000000..c9435f11843 --- /dev/null +++ b/dd-java-agent/agent-bootstrap/src/test/java/datadog/trace/bootstrap/instrumentation/decorator/HttpServerDecoratorSecurityTestingHeadersTest.java @@ -0,0 +1,268 @@ +package datadog.trace.bootstrap.instrumentation.decorator; + +import static datadog.context.Context.root; +import static datadog.trace.bootstrap.instrumentation.api.Tags.HTTP_REQUEST_HEADERS_X_DATADOG_ENDPOINT_SCAN; +import static datadog.trace.bootstrap.instrumentation.api.Tags.HTTP_REQUEST_HEADERS_X_DATADOG_SECURITY_TEST; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import datadog.trace.api.TraceConfig; +import datadog.trace.api.gateway.RequestContext; +import datadog.trace.bootstrap.instrumentation.api.AgentPropagation; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer.TracerAPI; +import datadog.trace.bootstrap.instrumentation.api.ContextVisitors; +import datadog.trace.bootstrap.instrumentation.api.URIDataAdapter; +import datadog.trace.core.datastreams.DataStreamsMonitoring; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.invocation.InvocationOnMock; + +class HttpServerDecoratorSecurityTestingHeadersTest { + + private AgentSpan span; + private Map tags; + private HttpServerDecorator, ?, ?, Map> decorator; + + @BeforeEach + void setup() { + tags = new HashMap<>(); + span = mock(AgentSpan.class); + when(span.setTag(anyString(), anyString())).thenAnswer(this::recordTag); + when(span.getRequestContext()).thenReturn(mock(RequestContext.class)); + when(span.setMeasured(true)).thenReturn(span); + + decorator = newDecorator(ContextVisitors.stringValuesMap()); + } + + private Object recordTag(InvocationOnMock invocation) { + tags.put(invocation.getArgument(0), invocation.getArgument(1)); + return span; + } + + @Test + void tagsBothMarkersWhenPresentAndIgnoresUnrelatedHeaders() { + Map headers = new LinkedHashMap<>(); + headers.put("x-datadog-endpoint-scan", "scan-uuid-1"); + headers.put("x-datadog-security-test", "test-uuid-2"); + headers.put("x-other-header", "ignored"); + + decorator.startSpan(headers, root()); + + assertEquals("scan-uuid-1", tags.get(HTTP_REQUEST_HEADERS_X_DATADOG_ENDPOINT_SCAN)); + assertEquals("test-uuid-2", tags.get(HTTP_REQUEST_HEADERS_X_DATADOG_SECURITY_TEST)); + verify(span, never()).setTag(eq("http.request.headers.x-other-header"), anyString()); + } + + @Test + void doesNotTagWhenHeadersAreAbsent() { + Map headers = new HashMap<>(); + headers.put("content-type", "application/json"); + + decorator.startSpan(headers, root()); + + verify(span, never()).setTag(eq(HTTP_REQUEST_HEADERS_X_DATADOG_ENDPOINT_SCAN), anyString()); + verify(span, never()).setTag(eq(HTTP_REQUEST_HEADERS_X_DATADOG_SECURITY_TEST), anyString()); + } + + @Test + void matchesHeaderNamesCaseInsensitively() { + Map headers = new LinkedHashMap<>(); + headers.put("X-Datadog-Endpoint-Scan", "scan-uuid-3"); + headers.put("X-DATADOG-SECURITY-TEST", "test-uuid-4"); + + decorator.startSpan(headers, root()); + + assertEquals("scan-uuid-3", tags.get(HTTP_REQUEST_HEADERS_X_DATADOG_ENDPOINT_SCAN)); + assertEquals("test-uuid-4", tags.get(HTTP_REQUEST_HEADERS_X_DATADOG_SECURITY_TEST)); + } + + @Test + void tagsHeadersEvenWhenValueIsEmptyString() { + Map headers = new LinkedHashMap<>(); + headers.put("x-datadog-endpoint-scan", ""); + headers.put("x-datadog-security-test", "ok"); + + decorator.startSpan(headers, root()); + + assertEquals("", tags.get(HTTP_REQUEST_HEADERS_X_DATADOG_ENDPOINT_SCAN)); + assertEquals("ok", tags.get(HTTP_REQUEST_HEADERS_X_DATADOG_SECURITY_TEST)); + } + + @Test + void tagsHeadersUnconditionallyEvenWhenTraceConfigHasOtherHeaderTags() { + // RFC contract: tag regardless of DD_TRACE_HEADER_TAGS. Stub the trace config with an + // unrelated header-tag mapping; the markers must still be tagged. + TraceConfig traceConfig = mock(TraceConfig.class); + when(span.traceConfig()).thenReturn(traceConfig); + when(traceConfig.getRequestHeaderTags()) + .thenReturn(Collections.singletonMap("x-other", "http.request.headers.x-other")); + + Map headers = new LinkedHashMap<>(); + headers.put("x-datadog-endpoint-scan", "scan-uuid"); + headers.put("x-datadog-security-test", "test-uuid"); + + decorator.startSpan(headers, root()); + + assertEquals("scan-uuid", tags.get(HTTP_REQUEST_HEADERS_X_DATADOG_ENDPOINT_SCAN)); + assertEquals("test-uuid", tags.get(HTTP_REQUEST_HEADERS_X_DATADOG_SECURITY_TEST)); + } + + @Test + void stopsIteratingAfterBothMarkersFound() { + // Custom visitor that records which keys it offered to the classifier, so we can prove + // the classifier short-circuits via `return false` once both markers are seen. + List visitedKeys = new ArrayList<>(); + AgentPropagation.ContextVisitor> trackingVisitor = + (carrier, classifier) -> { + for (Map.Entry e : carrier.entrySet()) { + visitedKeys.add(e.getKey()); + if (!classifier.accept(e.getKey(), e.getValue())) { + return; + } + } + }; + decorator = newDecorator(trackingVisitor); + + Map headers = new LinkedHashMap<>(); + headers.put("x-datadog-endpoint-scan", "scan-uuid"); + headers.put("x-datadog-security-test", "test-uuid"); + headers.put("trailing-header-after-both-markers", "should-not-be-visited"); + + decorator.startSpan(headers, root()); + + assertEquals("scan-uuid", tags.get(HTTP_REQUEST_HEADERS_X_DATADOG_ENDPOINT_SCAN)); + assertEquals("test-uuid", tags.get(HTTP_REQUEST_HEADERS_X_DATADOG_SECURITY_TEST)); + // Once both markers have been seen the classifier returns false, so iteration must stop + // before the trailing header is offered. + assertEquals(Arrays.asList("x-datadog-endpoint-scan", "x-datadog-security-test"), visitedKeys); + } + + @Test + void doesNotCrashOnNullHeaderValue() { + Map headers = new LinkedHashMap<>(); + headers.put("x-datadog-endpoint-scan", "scan-uuid"); + headers.put("x-datadog-security-test", "test-uuid"); + + AgentPropagation.ContextVisitor> visitorWithNullValue = + (carrier, classifier) -> { + classifier.accept("x-datadog-endpoint-scan", null); + for (Map.Entry e : carrier.entrySet()) { + if (!classifier.accept(e.getKey(), e.getValue())) { + return; + } + } + }; + decorator = newDecorator(visitorWithNullValue); + + decorator.startSpan(headers, root()); + + // Null value is skipped; carrier still surfaces the marker with its real value next. + assertEquals("scan-uuid", tags.get(HTTP_REQUEST_HEADERS_X_DATADOG_ENDPOINT_SCAN)); + assertEquals("test-uuid", tags.get(HTTP_REQUEST_HEADERS_X_DATADOG_SECURITY_TEST)); + } + + @Test + void doesNotCrashOnNullHeaderKey() { + Map headers = new LinkedHashMap<>(); + headers.put("x-datadog-endpoint-scan", "scan-uuid"); + headers.put("x-datadog-security-test", "test-uuid"); + + AgentPropagation.ContextVisitor> visitorWithNullKey = + (carrier, classifier) -> { + classifier.accept(null, "should-be-ignored"); + for (Map.Entry e : carrier.entrySet()) { + if (!classifier.accept(e.getKey(), e.getValue())) { + return; + } + } + }; + decorator = newDecorator(visitorWithNullKey); + + decorator.startSpan(headers, root()); + + assertEquals("scan-uuid", tags.get(HTTP_REQUEST_HEADERS_X_DATADOG_ENDPOINT_SCAN)); + assertEquals("test-uuid", tags.get(HTTP_REQUEST_HEADERS_X_DATADOG_SECURITY_TEST)); + } + + private HttpServerDecorator, ?, ?, Map> newDecorator( + AgentPropagation.ContextVisitor> visitor) { + TracerAPI tracer = mock(TracerAPI.class); + when(tracer.startSpan(any(), any(), any())).thenReturn(span); + when(tracer.getDataStreamsMonitoring()).thenReturn(mock(DataStreamsMonitoring.class)); + when(tracer.getUniversalCallbackProvider()) + .thenReturn(AgentTracer.NOOP_TRACER.getUniversalCallbackProvider()); + when(tracer.getCallbackProvider(any())) + .thenReturn(AgentTracer.NOOP_TRACER.getUniversalCallbackProvider()); + return new HttpServerDecorator, Object, Object, Map>() { + @Override + protected TracerAPI tracer() { + return tracer; + } + + @Override + protected String[] instrumentationNames() { + return new String[] {"test"}; + } + + @Override + protected CharSequence component() { + return "test-component"; + } + + @Override + public CharSequence spanName() { + return "http-test-span"; + } + + @Override + protected AgentPropagation.ContextVisitor> getter() { + return visitor; + } + + @Override + protected AgentPropagation.ContextVisitor responseGetter() { + return null; + } + + @Override + protected String method(Map request) { + return null; + } + + @Override + protected URIDataAdapter url(Map request) { + return null; + } + + @Override + protected String peerHostIP(Object connection) { + return null; + } + + @Override + protected int peerPort(Object connection) { + return 0; + } + + @Override + protected int status(Object response) { + return 0; + } + }; + } +} diff --git a/dd-java-agent/agent-bootstrap/src/test/java/datadog/trace/bootstrap/instrumentation/jdbc/JDBCConnectionUrlParserDB2Test.java b/dd-java-agent/agent-bootstrap/src/test/java/datadog/trace/bootstrap/instrumentation/jdbc/JDBCConnectionUrlParserDB2Test.java new file mode 100644 index 00000000000..091c1e2b02f --- /dev/null +++ b/dd-java-agent/agent-bootstrap/src/test/java/datadog/trace/bootstrap/instrumentation/jdbc/JDBCConnectionUrlParserDB2Test.java @@ -0,0 +1,35 @@ +package datadog.trace.bootstrap.instrumentation.jdbc; + +import static datadog.trace.bootstrap.instrumentation.jdbc.JDBCConnectionUrlParser.extractDBInfo; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.tabletest.junit.TableTest; + +/** + * Tests for DB2/AS400 JDBC URL parsing when the URL contains '=' but no explicit port. + * + *

Without a port, {@code lastIndexOf(':')} returns the scheme colon, making {@code urlPart1} too + * short for the subsequent {@code substring()} call and causing a {@code + * StringIndexOutOfBoundsException}. + */ +class JDBCConnectionUrlParserDB2Test { + + @TableTest({ + "scenario | url | type | host | instance | user | db ", + "DB2 with user param, no port | jdbc:db2://db2.host/mydb?user=db2user | db2 | db2.host | mydb | db2user | mydb ", + "AS400 with user param, no port | jdbc:as400://ashost/asdb?user=asuser | as400 | ashost | asdb | asuser | asdb ", + "DB2 with multiple params, no port | jdbc:db2://db2.host/mydb?user=db2user&connectionTimeout=30 | db2 | db2.host | mydb | db2user | mydb ", + "DB2 with databasename param, no port | jdbc:db2://db2.host/mydb?user=db2user&databasename=otherdb | db2 | db2.host | mydb | db2user | otherdb", + "DB2 with port and colon params | jdbc:db2://db2.host:50000/mydb:user=db2user | db2 | db2.host | mydb | db2user | mydb ", + "DB2 no params | jdbc:db2://db2.host/mydb | db2 | db2.host | mydb | | mydb " + }) + void db2UrlWithEqualsAndNoPortShouldParseCorrectly( + String url, String type, String host, String instance, String user, String db) { + DBInfo info = extractDBInfo(url, null); + assertEquals(type, info.getType()); + assertEquals(host, info.getHost()); + assertEquals(instance, info.getInstance()); + assertEquals(user, info.getUser()); + assertEquals(db, info.getDb()); + } +} diff --git a/dd-java-agent/agent-bootstrap/src/test/java/datadog/trace/bootstrap/instrumentation/jdbc/JDBCConnectionUrlParserPasswordLeakTest.java b/dd-java-agent/agent-bootstrap/src/test/java/datadog/trace/bootstrap/instrumentation/jdbc/JDBCConnectionUrlParserPasswordLeakTest.java new file mode 100644 index 00000000000..2da05fd7846 --- /dev/null +++ b/dd-java-agent/agent-bootstrap/src/test/java/datadog/trace/bootstrap/instrumentation/jdbc/JDBCConnectionUrlParserPasswordLeakTest.java @@ -0,0 +1,23 @@ +package datadog.trace.bootstrap.instrumentation.jdbc; + +import static datadog.trace.bootstrap.instrumentation.jdbc.JDBCConnectionUrlParser.extractDBInfo; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.tabletest.junit.TableTest; + +class JDBCConnectionUrlParserPasswordLeakTest { + + @TableTest({ + "scenario | url | type | host | user ", + "PostgreSQL userinfo with password | jdbc:postgresql://myuser:secret123@pg.host/mydb | postgresql | pg.host | myuser ", + "PostgreSQL userinfo without password | jdbc:postgresql://myuser@pg.host/mydb | postgresql | pg.host | myuser ", + "PostgreSQL userinfo with percent-encoded colon | jdbc:postgresql://tenant%3Aalice@pg.host/mydb | postgresql | pg.host | tenant:alice", + "SAP userinfo with password | jdbc:sap://myuser:secret@sap.host/sapdb | sap | sap.host | myuser " + }) + void passwordShouldNotLeakIntoUserTag(String url, String type, String host, String user) { + DBInfo info = extractDBInfo(url, null); + assertEquals(type, info.getType()); + assertEquals(host, info.getHost()); + assertEquals(user, info.getUser()); + } +} diff --git a/dd-java-agent/agent-ci-visibility/build.gradle b/dd-java-agent/agent-ci-visibility/build.gradle index 323553b8c03..ccb50e0b97b 100644 --- a/dd-java-agent/agent-ci-visibility/build.gradle +++ b/dd-java-agent/agent-ci-visibility/build.gradle @@ -5,10 +5,10 @@ import org.jetbrains.kotlin.gradle.dsl.KotlinVersion plugins { id 'com.gradleup.shadow' id 'org.jetbrains.kotlin.jvm' + id 'dd-trace-java.version-file' } apply from: "$rootDir/gradle/java.gradle" -apply from: "$rootDir/gradle/version.gradle" apply from: "$rootDir/gradle/test-with-kotlin.gradle" apply from: "$rootDir/gradle/test-with-scala.gradle" @@ -20,8 +20,8 @@ dependencies { implementation libs.bundles.asm implementation libs.instrument.java - implementation group: 'org.jacoco', name: 'org.jacoco.core', version: '0.8.14' - implementation group: 'org.jacoco', name: 'org.jacoco.report', version: '0.8.14' + implementation group: 'org.jacoco', name: 'org.jacoco.core', version: '0.8.15' + implementation group: 'org.jacoco', name: 'org.jacoco.report', version: '0.8.15' implementation project(':communication') implementation project(':components:json') diff --git a/dd-java-agent/agent-ci-visibility/civisibility-instrumentation-test-fixtures/build.gradle b/dd-java-agent/agent-ci-visibility/civisibility-instrumentation-test-fixtures/build.gradle index 01f83345bfe..51b7b0ecfdc 100644 --- a/dd-java-agent/agent-ci-visibility/civisibility-instrumentation-test-fixtures/build.gradle +++ b/dd-java-agent/agent-ci-visibility/civisibility-instrumentation-test-fixtures/build.gradle @@ -1,5 +1,8 @@ +plugins { + id 'dd-trace-java.version-file' +} + apply from: "$rootDir/gradle/java.gradle" -apply from: "$rootDir/gradle/version.gradle" dependencies { api project(':dd-java-agent:instrumentation-testing') diff --git a/dd-java-agent/agent-ci-visibility/civisibility-instrumentation-test-fixtures/gradle.lockfile b/dd-java-agent/agent-ci-visibility/civisibility-instrumentation-test-fixtures/gradle.lockfile index 77b5710aa81..2ba6eaff7a3 100644 --- a/dd-java-agent/agent-ci-visibility/civisibility-instrumentation-test-fixtures/gradle.lockfile +++ b/dd-java-agent/agent-ci-visibility/civisibility-instrumentation-test-fixtures/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-ci-visibility:civisibility-instrumentation-test-fixtures:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=compileClasspath,runtimeClasspath,testCompile com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testRuntimeClasspath @@ -17,22 +18,26 @@ com.fasterxml.jackson.core:jackson-core:2.20.0=compileClasspath,runtimeClasspath com.fasterxml.jackson.core:jackson-databind:2.20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=runtimeClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=runtimeClasspath,testRuntimeClasspath com.jayway.jsonpath:json-path:2.8.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -45,12 +50,12 @@ commons-io:commons-io:2.11.0=compileClasspath,runtimeClasspath,testCompileClassp commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=runtimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=runtimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=runtimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=runtimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=runtimeClasspath,testRuntimeClasspath net.minidev:accessors-smart:2.4.9=runtimeClasspath,testRuntimeClasspath @@ -79,16 +84,17 @@ org.freemarker:freemarker:2.3.31=compileClasspath,runtimeClasspath,testCompileCl org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=runtimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt,runtimeClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt,runtimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt,runtimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt,runtimeClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=runtimeClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-api:5.14.1=runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:5.14.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=runtimeClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-params:5.14.1=runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter:5.14.1=runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.14.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-commons:1.14.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-engine:1.14.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-launcher:1.14.1=runtimeClasspath,testRuntimeClasspath @@ -104,14 +110,14 @@ org.objenesis:objenesis:3.3=compileClasspath,testCompileClasspath,testRuntimeCla org.opentest4j:opentest4j:1.3.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-commons:9.9.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9.1=runtimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-commons:9.10.1=jacocoAnt,runtimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt,runtimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.10.1=compileClasspath,jacocoAnt,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs org.skyscreamer:jsonassert:1.5.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -123,8 +129,8 @@ org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.snakeyaml:snakeyaml-engine:2.9=runtimeClasspath,testRuntimeClasspath org.spockframework:spock-bom:2.4-groovy-3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-junit:1.2.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-parser:1.2.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs org.xmlunit:xmlunit-core:2.10.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath empty=annotationProcessor,spotbugsPlugins,testAnnotationProcessor diff --git a/dd-java-agent/agent-ci-visibility/civisibility-test-fixtures/build.gradle b/dd-java-agent/agent-ci-visibility/civisibility-test-fixtures/build.gradle index 2e2d7a6c16a..a8a35e05a8a 100644 --- a/dd-java-agent/agent-ci-visibility/civisibility-test-fixtures/build.gradle +++ b/dd-java-agent/agent-ci-visibility/civisibility-test-fixtures/build.gradle @@ -1,5 +1,8 @@ +plugins { + id 'dd-trace-java.version-file' +} + apply from: "$rootDir/gradle/java.gradle" -apply from: "$rootDir/gradle/version.gradle" dependencies { api project(':dd-java-agent:agent-ci-visibility') @@ -12,8 +15,11 @@ dependencies { api group: 'org.msgpack', name: 'jackson-dataformat-msgpack', version: '0.9.6' api group: 'org.xmlunit', name: 'xmlunit-core', version: '2.10.3' - compileOnly(libs.junit.jupiter) - compileOnly(libs.bundles.groovy) - compileOnly(libs.bundles.spock) + api(libs.bundles.junit5) + api(libs.tabletest) } +// civisibility-test-fixtures is a test-support module — every consumer pulls it on their test +// classpath. Production-code-quality gates like forbidden APIs don't apply here. +tasks.named('forbiddenApisMain').configure { enabled = false } + diff --git a/dd-java-agent/agent-ci-visibility/civisibility-test-fixtures/gradle.lockfile b/dd-java-agent/agent-ci-visibility/civisibility-test-fixtures/gradle.lockfile index 7f232d926ab..8bf301b54bd 100644 --- a/dd-java-agent/agent-ci-visibility/civisibility-test-fixtures/gradle.lockfile +++ b/dd-java-agent/agent-ci-visibility/civisibility-test-fixtures/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-ci-visibility:civisibility-test-fixtures:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=compileClasspath,runtimeClasspath,testCompile com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testRuntimeClasspath @@ -17,22 +18,26 @@ com.fasterxml.jackson.core:jackson-core:2.20.0=compileClasspath,runtimeClasspath com.fasterxml.jackson.core:jackson-databind:2.20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=runtimeClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=runtimeClasspath,testRuntimeClasspath com.jayway.jsonpath:json-path:2.8.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -45,12 +50,12 @@ commons-io:commons-io:2.11.0=compileClasspath,runtimeClasspath,testCompileClassp commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=runtimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=runtimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=runtimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=runtimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=runtimeClasspath,testRuntimeClasspath net.minidev:accessors-smart:2.4.9=runtimeClasspath,testRuntimeClasspath @@ -68,29 +73,30 @@ org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc org.codehaus.groovy:groovy-json:3.0.23=codenarc -org.codehaus.groovy:groovy-json:3.0.25=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-json:3.0.25=testCompileClasspath,testRuntimeClasspath org.codehaus.groovy:groovy-templates:3.0.23=codenarc org.codehaus.groovy:groovy-xml:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.23=codenarc -org.codehaus.groovy:groovy:3.0.25=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.freemarker:freemarker:2.3.31=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=runtimeClasspath,testRuntimeClasspath -org.hamcrest:hamcrest:3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt,runtimeClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt,runtimeClasspath,testRuntimeClasspath +org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt,runtimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt,runtimeClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=runtimeClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-api:5.14.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath -org.junit.jupiter:junit-jupiter-params:5.14.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter:5.14.1=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:5.14.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.14.1=runtimeClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.14.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-commons:1.14.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-engine:1.14.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.14.1=runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-launcher:1.14.1=runtimeClasspath,testRuntimeClasspath org.junit.platform:junit-platform-runner:1.14.1=runtimeClasspath,testRuntimeClasspath org.junit.platform:junit-platform-suite-api:1.14.1=runtimeClasspath,testRuntimeClasspath @@ -100,18 +106,18 @@ org.junit:junit-bom:5.14.1=compileClasspath,runtimeClasspath,testCompileClasspat org.mockito:mockito-core:4.4.0=testRuntimeClasspath org.msgpack:jackson-dataformat-msgpack:0.9.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.msgpack:msgpack-core:0.9.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.objenesis:objenesis:3.3=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-commons:9.9.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9.1=runtimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-commons:9.10.1=jacocoAnt,runtimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt,runtimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.10.1=compileClasspath,jacocoAnt,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs org.skyscreamer:jsonassert:1.5.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -121,10 +127,10 @@ org.slf4j:slf4j-api:1.7.36=runtimeClasspath,testRuntimeClasspath org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.snakeyaml:snakeyaml-engine:2.9=runtimeClasspath,testRuntimeClasspath -org.spockframework:spock-bom:2.4-groovy-3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.spockframework:spock-core:2.4-groovy-3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath +org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath +org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-junit:1.2.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-parser:1.2.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs org.xmlunit:xmlunit-core:2.10.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath empty=annotationProcessor,spotbugsPlugins,testAnnotationProcessor diff --git a/dd-java-agent/agent-ci-visibility/civisibility-test-fixtures/src/main/groovy/datadog/trace/civisibility/CiVisibilitySmokeTest.groovy b/dd-java-agent/agent-ci-visibility/civisibility-test-fixtures/src/main/groovy/datadog/trace/civisibility/CiVisibilitySmokeTest.groovy deleted file mode 100644 index 0eaeb2e755a..00000000000 --- a/dd-java-agent/agent-ci-visibility/civisibility-test-fixtures/src/main/groovy/datadog/trace/civisibility/CiVisibilitySmokeTest.groovy +++ /dev/null @@ -1,214 +0,0 @@ -package datadog.trace.civisibility - -import datadog.trace.api.Config -import datadog.trace.api.civisibility.config.TestFQN -import datadog.trace.api.config.CiVisibilityConfig -import datadog.trace.api.config.GeneralConfig -import datadog.trace.api.config.TraceInstrumentationConfig -import datadog.trace.api.config.TracerConfig -import java.nio.file.Paths -import spock.lang.Specification -import spock.lang.TempDir - -import java.nio.file.Path - -import static datadog.trace.util.ConfigStrings.propertyNameToSystemPropertyName - -abstract class CiVisibilitySmokeTest extends Specification { - static final List SMOKE_IGNORED_TAGS = ["content.meta.['_dd.integration']", "content.meta.['_dd.svc_src']"] - - protected static final String AGENT_JAR = System.getProperty("datadog.smoketest.agent.shadowJar.path") - protected static final String TEST_ENVIRONMENT_NAME = "integration-test" - protected static final String JAVAC_PLUGIN_VERSION = Config.get().ciVisibilityCompilerPluginVersion - protected static final String JACOCO_PLUGIN_VERSION = Config.get().ciVisibilityJacocoPluginVersion - - private static final Map DEFAULT_TRACER_CONFIG = defaultJvmArguments() - - @TempDir - protected Path prefsDir - - protected static String buildJavaHome() { - def javaHome = System.getProperty("java.home") - def javacPath = Paths.get(javaHome, "bin", "javac").toFile() - if (javacPath.exists()) { - return javaHome - } - // In CI for JDK 8, java.home may point to the JRE directory (e.g., /usr/lib/jvm/8/jre) - // The JDK with javac is in the parent directory - def parentDir = new File(javaHome).getParentFile() - def parentJavacPath = new File(parentDir, Paths.get("bin", "javac").toString()) - if (parentJavacPath.exists()) { - return parentDir.getAbsolutePath() - } - // Fallback to java.home and let callers handle the error if javac is not found - return javaHome - } - - protected static String javaPath() { - final String separator = System.getProperty("file.separator") - return "${buildJavaHome()}${separator}bin${separator}java" - } - - protected static String javacPath() { - final String separator = System.getProperty("file.separator") - return "${buildJavaHome()}${separator}bin${separator}javac" - } - - private static Map defaultJvmArguments() { - Map argMap = new HashMap<>() - argMap.put(GeneralConfig.TRACE_DEBUG, "true") - argMap.put(GeneralConfig.ENV, TEST_ENVIRONMENT_NAME) - argMap.put(CiVisibilityConfig.CIVISIBILITY_ENABLED, "true") - argMap.put(CiVisibilityConfig.CIVISIBILITY_AGENTLESS_ENABLED, "true") - argMap.put(CiVisibilityConfig.CIVISIBILITY_CIPROVIDER_INTEGRATION_ENABLED, "false") - argMap.put(CiVisibilityConfig.CIVISIBILITY_GIT_UPLOAD_ENABLED, "false") - argMap.put(CiVisibilityConfig.CIVISIBILITY_GIT_CLIENT_ENABLED, "false") - argMap.put(CiVisibilityConfig.CIVISIBILITY_FLAKY_RETRY_ONLY_KNOWN_FLAKES, "true") - argMap.put(CiVisibilityConfig.CIVISIBILITY_COMPILER_PLUGIN_VERSION, JAVAC_PLUGIN_VERSION) - argMap.put(TraceInstrumentationConfig.CODE_ORIGIN_FOR_SPANS_ENABLED, "false") - return argMap - } - - private static Map buildJvmArgMap(String mockBackendIntakeUrl, String serviceName, Map additionalArgs) { - Map argMap = new HashMap<>(DEFAULT_TRACER_CONFIG) - argMap.put(CiVisibilityConfig.CIVISIBILITY_AGENTLESS_URL, mockBackendIntakeUrl) - argMap.put(CiVisibilityConfig.CIVISIBILITY_INTAKE_AGENTLESS_URL, mockBackendIntakeUrl) - argMap.put(TracerConfig.TRACE_AGENT_URL, mockBackendIntakeUrl) - argMap.putAll(additionalArgs) - - if (serviceName != null) { - argMap.put(GeneralConfig.SERVICE_NAME, serviceName) - } - - return argMap - } - - protected List buildJvmArguments(String mockBackendIntakeUrl, String serviceName, Map additionalArgs) { - List arguments = ["-Xms256m", "-Xmx256m"] - - arguments += preventJulPrefsFileLock() - - Map argMap = buildJvmArgMap(mockBackendIntakeUrl, serviceName, additionalArgs) - - // for convenience when debugging locally - if (System.getenv("DD_CIVISIBILITY_SMOKETEST_DEBUG_PARENT") != null) { - arguments += "-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005" - } - if (System.getenv("DD_CIVISIBILITY_SMOKETEST_DEBUG_CHILD") != null) { - argMap.put(CiVisibilityConfig.CIVISIBILITY_DEBUG_PORT, "5055") - } - - String agentArgs = argMap.collect { k, v -> "${propertyNameToSystemPropertyName(k)}=${v}" }.join(",") - arguments += "-javaagent:${AGENT_JAR}=${agentArgs}".toString() - - return arguments - } - - /** - * Trick to prevent jul Prefs file lock issue on forked processes, in particular in CI which - * runs on Linux and have competing processes trying to write to it, including the Gradle daemon. - * - *


-   * Couldn't flush user prefs: java.util.prefs.BackingStoreException: Couldn't get file lock.
-   * 
- * - * Note, some tests can setup arguments on spec level, so `prefsDir` will be `null` during - * `setupSpec()`. - */ - protected String preventJulPrefsFileLock() { - String prefsPath = (prefsDir ?: tempUserPrefsPath()).toAbsolutePath() - return "-Djava.util.prefs.userRoot=$prefsPath".toString() - } - - private static Path tempUserPrefsPath() { - String uniqueId = "${System.currentTimeMillis()}_${System.nanoTime()}_${Thread.currentThread().id}" - Path prefsPath = Paths.get(System.getProperty("java.io.tmpdir"), "gradle-test-userPrefs", uniqueId) - return prefsPath - } - - protected verifyEventsAndCoverages(String projectName, String toolchain, String toolchainVersion, List> events, List> coverages, List additionalDynamicTags = []) { - def additionalReplacements = ["content.meta.['test.toolchain']": "$toolchain:$toolchainVersion"] - - if (System.getenv("GENERATE_TEST_FIXTURES") != null) { - def baseTemplatesPath = CiVisibilitySmokeTest.classLoader.getResource(projectName).toURI().schemeSpecificPart.replace('build/resources/test', 'src/test/resources') - CiVisibilityTestUtils.generateTemplates(baseTemplatesPath, events, coverages, additionalReplacements.keySet() + additionalDynamicTags, SMOKE_IGNORED_TAGS) - } else { - CiVisibilityTestUtils.assertData(projectName, events, coverages, additionalReplacements, SMOKE_IGNORED_TAGS, additionalDynamicTags) - } - } - - protected test(String suiteName, String testName) { - return new TestFQN(suiteName, testName) - } - - protected verifyTestOrder(List> events, List expectedOrder) { - CiVisibilityTestUtils.assertTestsOrder(events, expectedOrder) - } - - /** - * This is a basic sanity check for telemetry metrics. - * It only checks that the reported number of events created and finished is as expected. - *

- * Currently the check is not performed for Gradle builds: - * Gradle daemon started with Gradle TestKit outlives the test, so the final telemetry flush happens after the assertions. - */ - protected verifyTelemetryMetrics(List> receivedTelemetryMetrics, List> receivedTelemetryDistributions, int expectedEventsCount) { - int eventsCreated = 0, eventsFinished = 0 - for (Map metric : receivedTelemetryMetrics) { - if (metric["metric"] == "event_created") { - for (def point : metric["points"]) { - eventsCreated += point[1] - } - } - if (metric["metric"] == "event_finished") { - for (def point : metric["points"]) { - eventsFinished += point[1] - } - } - } - assert eventsCreated == expectedEventsCount - assert eventsFinished == expectedEventsCount - - // an even more basic smoke check for distributions: assert that we received some - assert !receivedTelemetryDistributions.isEmpty() - } - - protected verifyCoverageReports(String projectName, List reports, Map replacements) { - CiVisibilityTestUtils.assertData(projectName, reports, replacements) - } - - protected static verifySnapshotLogs(List> receivedLogs, int expectedProbes, int expectedSnapshots) { - def logsPerProbe = 3 // 3 probe statuses per probe -> received, installed, emitting - - assert receivedLogs.size() == logsPerProbe * expectedProbes + expectedSnapshots - - def probeStatusLogs = receivedLogs.findAll { it.containsKey("message") } - def snapshotLogs = receivedLogs.findAll { !it.containsKey("message") } - - verifyProbeStatuses(probeStatusLogs, expectedProbes) - verifySnapshots(snapshotLogs, expectedSnapshots) - } - - private static verifyProbeStatuses(List> logs, int expectedCount) { - assert logs.findAll { log -> ((String) log.message).startsWith("Received probe") }.size() == expectedCount - assert logs.findAll { log -> ((String) log.message).startsWith("Installed probe") }.size() == expectedCount - assert logs.findAll { log -> ((String) log.message).endsWith("is emitting.") }.size() == expectedCount - } - - protected static verifySnapshots(List> logs, expectedCount) { - assert logs.size() == expectedCount - - def requiredLogFields = ["logger.name", "logger.method", "dd.spanid", "dd.traceid"] - def requiredSnapshotFields = ["captures", "exceptionId", "probe", "stack"] - - logs.each { log -> - requiredLogFields.each { field -> log.containsKey(field) } - - Map debuggerMap = log.debugger as Map - Map snapshotContent = debuggerMap.snapshot as Map - - assert snapshotContent != null - requiredSnapshotFields.each { field -> snapshotContent.containsKey(field) } - } - } -} diff --git a/dd-java-agent/agent-ci-visibility/civisibility-test-fixtures/src/main/groovy/datadog/trace/civisibility/CiVisibilityTestUtils.groovy b/dd-java-agent/agent-ci-visibility/civisibility-test-fixtures/src/main/groovy/datadog/trace/civisibility/CiVisibilityTestUtils.groovy deleted file mode 100644 index c12ae929675..00000000000 --- a/dd-java-agent/agent-ci-visibility/civisibility-test-fixtures/src/main/groovy/datadog/trace/civisibility/CiVisibilityTestUtils.groovy +++ /dev/null @@ -1,397 +0,0 @@ -package datadog.trace.civisibility - -import com.fasterxml.jackson.databind.ObjectMapper -import com.fasterxml.jackson.databind.SerializationFeature -import com.jayway.jsonpath.Configuration -import com.jayway.jsonpath.JsonPath -import com.jayway.jsonpath.Option -import com.jayway.jsonpath.ReadContext -import com.jayway.jsonpath.WriteContext -import datadog.trace.api.DDSpanTypes -import datadog.trace.api.civisibility.config.LibraryCapability -import datadog.trace.api.civisibility.config.TestFQN -import datadog.trace.core.DDSpan -import freemarker.core.Environment -import freemarker.core.InvalidReferenceException -import freemarker.template.Template -import freemarker.template.TemplateException -import freemarker.template.TemplateExceptionHandler -import org.opentest4j.AssertionFailedError -import org.skyscreamer.jsonassert.JSONAssert -import org.skyscreamer.jsonassert.JSONCompareMode -import org.w3c.dom.Document -import org.xmlunit.builder.DiffBuilder -import org.xmlunit.builder.Input -import org.xmlunit.diff.Diff -import org.xmlunit.util.Convert - -import javax.xml.parsers.DocumentBuilderFactory -import java.nio.file.Files -import java.nio.file.Paths -import java.util.regex.Pattern -import java.util.stream.Collectors - -import static org.junit.jupiter.api.Assertions.assertEquals - -abstract class CiVisibilityTestUtils { - - static final List EVENT_DYNAMIC_PATHS = [ - path("content.trace_id"), - path("content.span_id"), - path("content.parent_id"), - path("content.test_session_id"), - path("content.test_module_id"), - path("content.test_suite_id"), - path("content.metrics.process_id"), - path("content.meta.['os.architecture']"), - path("content.meta.['os.platform']"), - path("content.meta.['os.version']"), - path("content.meta.['runtime.name']"), - path("content.meta.['runtime.vendor']"), - path("content.meta.['runtime.version']"), - path("content.meta.['ci.workspace_path']"), - path("content.meta.['error.message']"), - path("content.meta.library_version"), - path("content.meta.runtime-id"), - path("content.meta.['_dd.tracer_host']"), - // Different events might or might not have the same start or duration. - // Regardless, the values of these fields should be treated as different - path("content.start", false), - path("content.duration", false), - path("content.metrics.['_dd.host.vcpu_count']", false), - path("content.meta.['_dd.p.tid']", false), - path("content.meta.['error.stack']", false), - ] - - // ignored tags on assertion and fixture build - static final List IGNORED_TAGS = LibraryCapability.values().toList().stream().map(c -> "content.meta.['${c.asTag()}']").collect(Collectors.toList()) + - ["content.meta.['_dd.integration']", "content.meta.['_dd.svc_src']"] - - static final List COVERAGE_DYNAMIC_PATHS = [path("test_session_id"), path("test_suite_id"), path("span_id"),] - - private static final Comparator> EVENT_RESOURCE_COMPARATOR = Comparator., String> comparing((Map m) -> { - def content = (Map) m.get("content") - return content.get("resource") - }).thenComparing(Comparator., String> comparing((Map m) -> { - // module and session have the same resource name in headless mode - return m.get("type") - }).reversed()) - - /** - * Use this method to generate expected data templates - */ - static void generateTemplates(String baseTemplatesPath, List> events, List> coverages, Collection additionalDynamicPaths, List ignoredTags = []) { - if (!ignoredTags.empty) { - events = removeTags(events, ignoredTags) - } - events.sort(EVENT_RESOURCE_COMPARATOR) - - def templateGenerator = new TemplateGenerator(new LabelGenerator()) - def compiledAdditionalReplacements = compile(additionalDynamicPaths) - - Files.createDirectories(Paths.get(baseTemplatesPath)) - Files.write(Paths.get(baseTemplatesPath, "events.ftl"), templateGenerator.generateTemplate(events, EVENT_DYNAMIC_PATHS + compiledAdditionalReplacements).bytes) - Files.write(Paths.get(baseTemplatesPath, "coverages.ftl"), templateGenerator.generateTemplate(coverages, COVERAGE_DYNAMIC_PATHS + compiledAdditionalReplacements).bytes) - } - - static void assertData(String baseTemplatesPath, List reports, Map replacements) { - def expectedReportEvent = getFreemarkerTemplate(baseTemplatesPath + "/coverage_report_event.ftl", replacements) - def actualReportEvent = JSON_MAPPER.writeValueAsString(reports[0].event) - - compareJson(expectedReportEvent, actualReportEvent) - - def expectedReport = getFreemarkerTemplate(baseTemplatesPath + "/coverage_report.ftl", replacements) - def actualReport = reports[0].report - - if (expectedReport.contains(" assertData(String baseTemplatesPath, List> events, List> coverages, Map additionalReplacements, List ignoredTags, List additionalDynamicPaths = []) { - events.sort(EVENT_RESOURCE_COMPARATOR) - - def labelGenerator = new LabelGenerator() - def templateGenerator = new TemplateGenerator(labelGenerator) - - def replacementMap - replacementMap = templateGenerator.generateReplacementMap(events, EVENT_DYNAMIC_PATHS + compile(additionalDynamicPaths)) - replacementMap = templateGenerator.generateReplacementMap(coverages, COVERAGE_DYNAMIC_PATHS) - - for (Map.Entry e : additionalReplacements.entrySet()) { - replacementMap.put(labelGenerator.forKey(e.key), "\"$e.value\"") - } - - // ignore provided tags - events = removeTags(events, ignoredTags) - - def expectedEvents = getFreemarkerTemplate(baseTemplatesPath + "/events.ftl", replacementMap, events) - def actualEvents = JSON_MAPPER.writeValueAsString(events) - - compareJson(expectedEvents, actualEvents) - - def expectedCoverages = getFreemarkerTemplate(baseTemplatesPath + "/coverages.ftl", replacementMap, coverages) - def actualCoverages = JSON_MAPPER.writeValueAsString(coverages) - compareJson(expectedCoverages, actualCoverages) - - return replacementMap - } - - private static void compareJson(String expectedJson, String actualJson) { - def environment = System.getenv() - def ciRun = environment.get("GITHUB_ACTION") != null || environment.get("GITLAB_CI") != null - def comparisonMode = ciRun ? JSONCompareMode.LENIENT : JSONCompareMode.NON_EXTENSIBLE - - try { - JSONAssert.assertEquals(expectedJson, actualJson, comparisonMode) - } catch (AssertionError e) { - if (ciRun) { - // When running in CI the assertion error message does not contain the actual diff, - // so we print the events to the console to help debug the issue - println "Expected JSON: $expectedJson" - println "Actual JSON: $actualJson" - } - throw new AssertionFailedError("Expected and actual JSON mismatch", expectedJson, actualJson, e) - } - } - - static boolean assertTestsOrder(List> events, List expectedOrder) { - def identifiers = getTestIdentifiers(events) - if (identifiers != expectedOrder) { - throw new AssertionError("Expected order: $expectedOrder, but got: $identifiers") - } - return true - } - - static List getTestIdentifiers(List> events) { - events.sort(Comparator.comparing { - it['content']['start'] as Long - }) - def testIdentifiers = [] - for (Map event : events) { - if (event['content']['meta']['test.name']) { - testIdentifiers.add(new TestFQN(event['content']['meta']['test.suite'] as String, event['content']['meta']['test.name'] as String)) - } - } - return testIdentifiers - } - - static List> removeTags(List> events, List tags) { - def filteredEvents = [] - - for (Map event : events) { - ReadContext ctx = JsonPath.parse(event, JSON_PATH_CONFIG) - for (String tag : tags) { - ctx.delete(path(tag).path) - } - filteredEvents.add(ctx.json()) - } - - return filteredEvents - } - - // Will sort traces in the following order: TEST -> SUITE -> MODULE -> SESSION - static class SortTracesByType implements Comparator> { - @Override - int compare(List o1, List o2) { - return Integer.compare(rootSpanTypeToVal(o1), rootSpanTypeToVal(o2)) - } - - int rootSpanTypeToVal(List trace) { - assert !trace.isEmpty() - def spanType = trace.get(0).getSpanType() - switch (spanType) { - case DDSpanTypes.TEST: - return 0 - case DDSpanTypes.TEST_SUITE_END: - return 1 - case DDSpanTypes.TEST_MODULE_END: - return 2 - case DDSpanTypes.TEST_SESSION_END: - return 3 - default: - return 4 - } - } - } - - static final Configuration JSON_PATH_CONFIG = Configuration.builder() - .options(Option.SUPPRESS_EXCEPTIONS) - .build() - - static final ObjectMapper JSON_MAPPER = new ObjectMapper() { { - enable(SerializationFeature.INDENT_OUTPUT) - enable(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS) - } - } - - static final TemplateExceptionHandler SUPPRESS_EXCEPTION_HANDLER = new TemplateExceptionHandler() { - @Override - void handleTemplateException(TemplateException e, Environment environment, Writer writer) throws TemplateException { - if (e instanceof InvalidReferenceException) { - writer.write('""') - } else { - throw e - } - } - } - - static final freemarker.template.Configuration FREEMARKER = new freemarker.template.Configuration(freemarker.template.Configuration.VERSION_2_3_30) { { - setClassLoaderForTemplateLoading(CiVisibilityTestUtils.classLoader, "") - setDefaultEncoding("UTF-8") - setTemplateExceptionHandler(SUPPRESS_EXCEPTION_HANDLER) - setLogTemplateExceptions(false) - setWrapUncheckedExceptions(true) - setFallbackOnNullLoopVariable(false) - setNumberFormat("0.######") - } - } - - static String getFreemarkerTemplate(String templatePath, Map replacements, List> replacementsSource = []) { - try { - Template coveragesTemplate = FREEMARKER.getTemplate(templatePath) - StringWriter coveragesOut = new StringWriter() - coveragesTemplate.process(replacements, coveragesOut) - return coveragesOut.toString() - } catch (Exception e) { - throw new RuntimeException("Could not get Freemarker template " + templatePath + "; replacements map: " + replacements + "; replacements source: " + replacementsSource, e) - } - } - - private static final class TemplateGenerator { - private static final Pattern PLACEHOLDER_PATTERN = Pattern.compile("\"(\\\$\\{.*?\\})\"") - - private final Map uniqueValues = new HashMap<>() - private final Map nonUniqueValues = new HashMap<>() - private final LabelGenerator label - - TemplateGenerator(LabelGenerator label) { - this.label = label - } - - String generateTemplate(Collection> objects, List dynamicPaths) { - for (Map object : objects) { - WriteContext ctx = JsonPath.parse(object, JSON_PATH_CONFIG) - for (DynamicPath dynamicPath : dynamicPaths) { - ctx.map(dynamicPath.path, (currentValue, config) -> { - if (dynamicPath.unique) { - return uniqueValues.computeIfAbsent(currentValue, (k) -> label.forTemplateKey(dynamicPath.rawPath)) - } - - return label.forTemplateKey(dynamicPath.rawPath) - }) - } - } - return JSON_MAPPER - .writeValueAsString(objects) - .replaceAll(PLACEHOLDER_PATTERN, "\$1") // remove quotes around placeholders - } - - Map generateReplacementMap(Collection> objects, List dynamicPaths) { - for (Map object : objects) { - ReadContext ctx = JsonPath.parse(object, JSON_PATH_CONFIG) - for (DynamicPath dynamicPath : dynamicPaths) { - def value = ctx.read(dynamicPath.path) - if (value != null) { - if (value instanceof String) { - value = '"' + // restore quotes around string values - value.replace('"', '\\"') + // escape quotes inside string values - '"' // restore quotes around string values - } - if (dynamicPath.unique) { - uniqueValues.computeIfAbsent(value, (k) -> label.forKey(dynamicPath.rawPath)) - } else { - nonUniqueValues.put(label.forKey(dynamicPath.rawPath), value) - } - } - } - } - return invert(uniqueValues) + nonUniqueValues - } - } - - private static final class LabelGenerator { - private static final Pattern ERASED_CHARS = Pattern.compile("[\\[\\]']") - private static final Pattern REPLACED_CHARS = Pattern.compile("[.-]") - - private final Map usageCounters = new HashMap<>() - - String forTemplateKey(String key) { - return "\${" + forKey(key) + "}" - } - - String forKey(String key) { - def usages = usageCounters.merge(key, 1, Integer::sum) - def sanitizedKey = key.replaceAll(ERASED_CHARS, "").replaceAll(REPLACED_CHARS, "_") - return sanitizedKey + (usages == 1 ? "" : "_${usages}") - } - } - - private static Map invert(Map map) { - Map inverted = new HashMap(map.size()) - for (Map.Entry e : map.entrySet()) { - inverted.put(e.value, e.key) - } - return inverted - } - - private static List compile(Iterable rawPaths) { - def compiledPaths = [] - for (String rawPath : rawPaths) { - compiledPaths += path(rawPath) - } - return compiledPaths - } - - private static DynamicPath path(String rawPath, boolean unique = true) { - return new DynamicPath(rawPath, JsonPath.compile(rawPath), unique) - } - - private static final class DynamicPath { - private final String rawPath - private final JsonPath path - // if true, same values are replaced with same placeholders; - // otherwise every path gets its own placeholder, even if its value is non-unique - private final boolean unique - - DynamicPath(String rawPath, JsonPath path, boolean unique) { - this.rawPath = rawPath - this.path = path - this.unique = unique - } - } - - static final class CoverageReport { - final Map event - final String report - - CoverageReport(Map event, String report) { - this.event = event - this.report = report - } - } -} diff --git a/dd-java-agent/agent-ci-visibility/civisibility-test-fixtures/src/main/java/datadog/trace/civisibility/CiVisibilitySmokeTest.java b/dd-java-agent/agent-ci-visibility/civisibility-test-fixtures/src/main/java/datadog/trace/civisibility/CiVisibilitySmokeTest.java new file mode 100644 index 00000000000..859f95c917c --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/civisibility-test-fixtures/src/main/java/datadog/trace/civisibility/CiVisibilitySmokeTest.java @@ -0,0 +1,314 @@ +package datadog.trace.civisibility; + +import static datadog.trace.util.ConfigStrings.propertyNameToSystemPropertyName; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.api.Config; +import datadog.trace.api.civisibility.config.TestFQN; +import datadog.trace.api.config.CiVisibilityConfig; +import datadog.trace.api.config.GeneralConfig; +import datadog.trace.api.config.TraceInstrumentationConfig; +import datadog.trace.api.config.TracerConfig; +import java.io.File; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import org.junit.jupiter.api.io.TempDir; + +public abstract class CiVisibilitySmokeTest { + + public static final List SMOKE_IGNORED_TAGS = + Collections.unmodifiableList( + Arrays.asList("content.meta.['_dd.integration']", "content.meta.['_dd.svc_src']")); + + protected static final String AGENT_JAR = + System.getProperty("datadog.smoketest.agent.shadowJar.path"); + protected static final String TEST_ENVIRONMENT_NAME = "integration-test"; + protected static final String JAVAC_PLUGIN_VERSION = + Config.get().getCiVisibilityCompilerPluginVersion(); + protected static final String JACOCO_PLUGIN_VERSION = + Config.get().getCiVisibilityJacocoPluginVersion(); + + private static final Map DEFAULT_TRACER_CONFIG = defaultJvmArguments(); + + @TempDir protected Path prefsDir; + + protected static String buildJavaHome() { + String javaHome = System.getProperty("java.home"); + File javacPath = Paths.get(javaHome, "bin", "javac").toFile(); + if (javacPath.exists()) { + return javaHome; + } + // In CI for JDK 8, java.home may point to the JRE directory (e.g., /usr/lib/jvm/8/jre). + // The JDK with javac is in the parent directory. + File parentDir = new File(javaHome).getParentFile(); + File parentJavacPath = new File(parentDir, Paths.get("bin", "javac").toString()); + if (parentJavacPath.exists()) { + return parentDir.getAbsolutePath(); + } + // Fallback to java.home and let callers handle the error if javac is not found. + return javaHome; + } + + protected static String javaPath() { + String separator = System.getProperty("file.separator"); + return buildJavaHome() + separator + "bin" + separator + "java"; + } + + protected static String javacPath() { + String separator = System.getProperty("file.separator"); + return buildJavaHome() + separator + "bin" + separator + "javac"; + } + + private static Map defaultJvmArguments() { + Map argMap = new HashMap<>(); + argMap.put(GeneralConfig.ENV, TEST_ENVIRONMENT_NAME); + argMap.put(CiVisibilityConfig.CIVISIBILITY_ENABLED, "true"); + argMap.put(CiVisibilityConfig.CIVISIBILITY_AGENTLESS_ENABLED, "true"); + argMap.put(CiVisibilityConfig.CIVISIBILITY_CIPROVIDER_INTEGRATION_ENABLED, "false"); + argMap.put(CiVisibilityConfig.CIVISIBILITY_GIT_UPLOAD_ENABLED, "false"); + argMap.put(CiVisibilityConfig.CIVISIBILITY_GIT_CLIENT_ENABLED, "false"); + argMap.put(CiVisibilityConfig.CIVISIBILITY_FLAKY_RETRY_ONLY_KNOWN_FLAKES, "true"); + argMap.put(CiVisibilityConfig.CIVISIBILITY_COMPILER_PLUGIN_VERSION, JAVAC_PLUGIN_VERSION); + argMap.put(TraceInstrumentationConfig.CODE_ORIGIN_FOR_SPANS_ENABLED, "false"); + return argMap; + } + + private static Map buildJvmArgMap( + String mockBackendIntakeUrl, String serviceName, Map additionalArgs) { + Map argMap = new HashMap<>(DEFAULT_TRACER_CONFIG); + argMap.put(CiVisibilityConfig.CIVISIBILITY_AGENTLESS_URL, mockBackendIntakeUrl); + argMap.put(CiVisibilityConfig.CIVISIBILITY_INTAKE_AGENTLESS_URL, mockBackendIntakeUrl); + argMap.put(TracerConfig.TRACE_AGENT_URL, mockBackendIntakeUrl); + argMap.putAll(additionalArgs); + + if (serviceName != null) { + argMap.put(GeneralConfig.SERVICE_NAME, serviceName); + } + + return argMap; + } + + protected List buildJvmArguments( + String mockBackendIntakeUrl, String serviceName, Map additionalArgs) { + List arguments = new ArrayList<>(Arrays.asList("-Xms256m", "-Xmx512m")); + + arguments.add(preventJulPrefsFileLock()); + + Map argMap = buildJvmArgMap(mockBackendIntakeUrl, serviceName, additionalArgs); + + // Convenience switches for local debugging. Set as JVM system properties (e.g. via + // `-Ddatadog.civisibility.smoketest.debug.parent=1`) rather than env vars, to keep the + // config-inversion-linter happy (it forbids unregistered `DD_…` env-var literals in + // `src/main/java`) and to avoid `System.getenv` in main sources. + if (System.getProperty("datadog.civisibility.smoketest.debug.parent") != null) { + arguments.add("-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005"); + } + if (System.getProperty("datadog.civisibility.smoketest.debug.child") != null) { + argMap.put(CiVisibilityConfig.CIVISIBILITY_DEBUG_PORT, "5055"); + } + + // CI-Vis smoke tests produce a lot of logs in debug mode, so it is disabled by default. + // Note: GitLab capacity for job logs at 32 MB and truncates the rest, which can fail the job. + // Enable full debug via `-Ddatadog.civisibility.smoketest.debug.enabled=true`. + if (System.getProperty("datadog.civisibility.smoketest.debug.enabled") != null) { + argMap.put(GeneralConfig.TRACE_DEBUG, "true"); + } + + String agentArgs = + argMap.entrySet().stream() + .map(e -> propertyNameToSystemPropertyName(e.getKey()) + "=" + e.getValue()) + .collect(Collectors.joining(",")); + arguments.add("-javaagent:" + AGENT_JAR + "=" + agentArgs); + + return arguments; + } + + /** + * Trick to prevent jul Prefs file lock issue on forked processes, in particular in CI which runs + * on Linux and have competing processes trying to write to it, including the Gradle daemon. + * + *

{@code
+   * Couldn't flush user prefs: java.util.prefs.BackingStoreException: Couldn't get file lock.
+   * }
+ * + * Note, some tests can setup arguments on spec level, so {@code prefsDir} will be {@code null} + * during {@code @BeforeAll}. + */ + protected String preventJulPrefsFileLock() { + Path resolved = prefsDir != null ? prefsDir : tempUserPrefsPath(); + return "-Djava.util.prefs.userRoot=" + resolved.toAbsolutePath(); + } + + private static Path tempUserPrefsPath() { + String uniqueId = + System.currentTimeMillis() + "_" + System.nanoTime() + "_" + Thread.currentThread().getId(); + return Paths.get(System.getProperty("java.io.tmpdir"), "gradle-test-userPrefs", uniqueId); + } + + protected void verifyEventsAndCoverages( + String projectName, + String toolchain, + String toolchainVersion, + List> events, + List> coverages) { + verifyEventsAndCoverages( + projectName, toolchain, toolchainVersion, events, coverages, Collections.emptyList()); + } + + protected void verifyEventsAndCoverages( + String projectName, + String toolchain, + String toolchainVersion, + List> events, + List> coverages, + List additionalDynamicTags) { + Map additionalReplacements = new HashMap<>(); + additionalReplacements.put( + "content.meta.['test.toolchain']", toolchain + ":" + toolchainVersion); + + if (System.getenv("GENERATE_TEST_FIXTURES") != null) { + String baseTemplatesPath; + try { + baseTemplatesPath = + CiVisibilitySmokeTest.class + .getClassLoader() + .getResource(projectName) + .toURI() + .getSchemeSpecificPart() + .replace("build/resources/test", "src/test/resources"); + } catch (Exception e) { + throw new RuntimeException(e); + } + List dynamicPaths = new ArrayList<>(additionalReplacements.keySet()); + dynamicPaths.addAll(additionalDynamicTags); + CiVisibilityTestUtils.generateTemplates( + baseTemplatesPath, events, coverages, dynamicPaths, SMOKE_IGNORED_TAGS); + } else { + CiVisibilityTestUtils.assertData( + projectName, + events, + coverages, + additionalReplacements, + SMOKE_IGNORED_TAGS, + additionalDynamicTags); + } + } + + protected TestFQN test(String suiteName, String testName) { + return new TestFQN(suiteName, testName); + } + + protected void verifyTestOrder(List> events, List expectedOrder) { + CiVisibilityTestUtils.assertTestsOrder(events, expectedOrder); + } + + /** + * This is a basic sanity check for telemetry metrics. It only checks that the reported number of + * events created and finished is as expected. + * + *

Currently the check is not performed for Gradle builds: Gradle daemon started with Gradle + * TestKit outlives the test, so the final telemetry flush happens after the assertions. + */ + protected void verifyTelemetryMetrics( + List> receivedTelemetryMetrics, + List> receivedTelemetryDistributions, + int expectedEventsCount) { + int eventsCreated = 0; + int eventsFinished = 0; + for (Map metric : receivedTelemetryMetrics) { + if ("event_created".equals(metric.get("metric"))) { + for (Object point : (List) metric.get("points")) { + eventsCreated += ((Number) ((List) point).get(1)).intValue(); + } + } + if ("event_finished".equals(metric.get("metric"))) { + for (Object point : (List) metric.get("points")) { + eventsFinished += ((Number) ((List) point).get(1)).intValue(); + } + } + } + assertEquals(expectedEventsCount, eventsCreated); + assertEquals(expectedEventsCount, eventsFinished); + + // an even more basic smoke check for distributions: assert that we received some + assertFalse(receivedTelemetryDistributions.isEmpty()); + } + + protected void verifyCoverageReports( + String projectName, + List reports, + Map replacements) { + CiVisibilityTestUtils.assertData(projectName, reports, replacements); + } + + protected static void verifySnapshotLogs( + List> receivedLogs, int expectedProbes, int expectedSnapshots) { + int logsPerProbe = 3; // 3 probe statuses per probe -> received, installed, emitting + + assertEquals(logsPerProbe * expectedProbes + expectedSnapshots, receivedLogs.size()); + + List> probeStatusLogs = new ArrayList<>(); + List> snapshotLogs = new ArrayList<>(); + for (Map log : receivedLogs) { + if (log.containsKey("message")) { + probeStatusLogs.add(log); + } else { + snapshotLogs.add(log); + } + } + + verifyProbeStatuses(probeStatusLogs, expectedProbes); + verifySnapshots(snapshotLogs, expectedSnapshots); + } + + private static void verifyProbeStatuses(List> logs, int expectedCount) { + long received = + logs.stream() + .filter(log -> ((String) log.get("message")).startsWith("Received probe")) + .count(); + long installed = + logs.stream() + .filter(log -> ((String) log.get("message")).startsWith("Installed probe")) + .count(); + long emitting = + logs.stream().filter(log -> ((String) log.get("message")).endsWith("is emitting.")).count(); + assertEquals(expectedCount, received); + assertEquals(expectedCount, installed); + assertEquals(expectedCount, emitting); + } + + protected static void verifySnapshots(List> logs, int expectedCount) { + assertEquals(expectedCount, logs.size()); + + List requiredLogFields = + Arrays.asList("logger.name", "logger.method", "dd.span_id", "dd.trace_id"); + List requiredSnapshotFields = + Arrays.asList("captures", "exceptionId", "probe", "stack"); + + for (Map log : logs) { + requiredLogFields.forEach( + field -> assertTrue(log.containsKey(field), "log must contain field: " + field)); + + @SuppressWarnings("unchecked") + Map debuggerMap = (Map) log.get("debugger"); + @SuppressWarnings("unchecked") + Map snapshotContent = (Map) debuggerMap.get("snapshot"); + + assertNotNull(snapshotContent, "snapshot must not be null"); + requiredSnapshotFields.forEach( + field -> + assertTrue( + snapshotContent.containsKey(field), "snapshot must contain field: " + field)); + } + } +} diff --git a/dd-java-agent/agent-ci-visibility/civisibility-test-fixtures/src/main/java/datadog/trace/civisibility/CiVisibilityTableTestConverters.java b/dd-java-agent/agent-ci-visibility/civisibility-test-fixtures/src/main/java/datadog/trace/civisibility/CiVisibilityTableTestConverters.java new file mode 100644 index 00000000000..d4a1bfc567c --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/civisibility-test-fixtures/src/main/java/datadog/trace/civisibility/CiVisibilityTableTestConverters.java @@ -0,0 +1,17 @@ +package datadog.trace.civisibility; + +import datadog.trace.api.civisibility.config.TestFQN; +import org.tabletest.junit.TypeConverter; + +/** Shared {@code @TableTest} converters for CiVisibility smoke tests. */ +public final class CiVisibilityTableTestConverters { + + private CiVisibilityTableTestConverters() {} + + /** Parses a {@code suite:name} string into a {@link TestFQN}. */ + @TypeConverter + public static TestFQN toTestFQN(String value) { + int colon = value.indexOf(':'); + return new TestFQN(value.substring(0, colon), value.substring(colon + 1)); + } +} diff --git a/dd-java-agent/agent-ci-visibility/civisibility-test-fixtures/src/main/java/datadog/trace/civisibility/CiVisibilityTestUtils.java b/dd-java-agent/agent-ci-visibility/civisibility-test-fixtures/src/main/java/datadog/trace/civisibility/CiVisibilityTestUtils.java new file mode 100644 index 00000000000..fb9ff951a88 --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/civisibility-test-fixtures/src/main/java/datadog/trace/civisibility/CiVisibilityTestUtils.java @@ -0,0 +1,546 @@ +package datadog.trace.civisibility; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.databind.SerializationFeature; +import com.jayway.jsonpath.Configuration; +import com.jayway.jsonpath.DocumentContext; +import com.jayway.jsonpath.JsonPath; +import com.jayway.jsonpath.Option; +import com.jayway.jsonpath.ReadContext; +import datadog.trace.api.DDSpanTypes; +import datadog.trace.api.civisibility.config.LibraryCapability; +import datadog.trace.api.civisibility.config.TestFQN; +import datadog.trace.core.DDSpan; +import freemarker.core.Environment; +import freemarker.core.InvalidReferenceException; +import freemarker.template.Template; +import freemarker.template.TemplateException; +import freemarker.template.TemplateExceptionHandler; +import java.io.Serializable; +import java.io.StringWriter; +import java.io.Writer; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.regex.Pattern; +import java.util.stream.Collectors; +import javax.xml.parsers.DocumentBuilderFactory; +import org.junit.jupiter.api.Assertions; +import org.opentest4j.AssertionFailedError; +import org.skyscreamer.jsonassert.JSONAssert; +import org.skyscreamer.jsonassert.JSONCompareMode; +import org.w3c.dom.Document; +import org.xmlunit.builder.DiffBuilder; +import org.xmlunit.builder.Input; +import org.xmlunit.diff.Diff; +import org.xmlunit.util.Convert; + +public abstract class CiVisibilityTestUtils { + + public static final List EVENT_DYNAMIC_PATHS = + Collections.unmodifiableList( + Arrays.asList( + path("content.trace_id"), + path("content.span_id"), + path("content.parent_id"), + path("content.test_session_id"), + path("content.test_module_id"), + path("content.test_suite_id"), + path("content.metrics.process_id"), + path("content.meta.['os.architecture']"), + path("content.meta.['os.platform']"), + path("content.meta.['os.version']"), + path("content.meta.['runtime.name']"), + path("content.meta.['runtime.vendor']"), + path("content.meta.['runtime.version']"), + path("content.meta.['ci.workspace_path']"), + path("content.meta.['error.message']"), + path("content.meta.library_version"), + path("content.meta.runtime-id"), + path("content.meta.['_dd.tracer_host']"), + // Different events might or might not have the same start or duration. Regardless, + // the values of these fields should be treated as different. + path("content.start", false), + path("content.duration", false), + path("content.metrics.['_dd.host.vcpu_count']", false), + path("content.meta.['_dd.p.tid']", false), + path("content.meta.['error.stack']", false))); + + // ignored tags on assertion and fixture build + public static final List IGNORED_TAGS; + + static { + List ignored = + Arrays.stream(LibraryCapability.values()) + .map(c -> "content.meta.['" + c.asTag() + "']") + .collect(Collectors.toList()); + ignored.add("content.meta.['_dd.integration']"); + ignored.add("content.meta.['_dd.svc_src']"); + IGNORED_TAGS = Collections.unmodifiableList(ignored); + } + + public static final List COVERAGE_DYNAMIC_PATHS = + Collections.unmodifiableList( + Arrays.asList(path("test_session_id"), path("test_suite_id"), path("span_id"))); + + private static final Comparator> EVENT_RESOURCE_COMPARATOR = + Comparator., String>comparing( + m -> { + Map content = (Map) m.get("content"); + return (String) content.get("resource"); + }) + .thenComparing( + Comparator., String>comparing( + // module and session have the same resource name in headless mode + m -> (String) m.get("type")) + .reversed()); + + /** Use this method to generate expected data templates. */ + public static void generateTemplates( + String baseTemplatesPath, + List> events, + List> coverages, + Collection additionalDynamicPaths) { + generateTemplates( + baseTemplatesPath, events, coverages, additionalDynamicPaths, Collections.emptyList()); + } + + public static void generateTemplates( + String baseTemplatesPath, + List> events, + List> coverages, + Collection additionalDynamicPaths, + List ignoredTags) { + List> mutableEvents = new ArrayList<>(events); + if (!ignoredTags.isEmpty()) { + mutableEvents = removeTags(mutableEvents, ignoredTags); + } + mutableEvents.sort(EVENT_RESOURCE_COMPARATOR); + + TemplateGenerator templateGenerator = new TemplateGenerator(new LabelGenerator()); + List compiledAdditionalReplacements = compile(additionalDynamicPaths); + + try { + Files.createDirectories(Paths.get(baseTemplatesPath)); + List eventPaths = new ArrayList<>(EVENT_DYNAMIC_PATHS); + eventPaths.addAll(compiledAdditionalReplacements); + Files.write( + Paths.get(baseTemplatesPath, "events.ftl"), + templateGenerator + .generateTemplate(mutableEvents, eventPaths) + .getBytes(StandardCharsets.UTF_8)); + + List coveragePaths = new ArrayList<>(COVERAGE_DYNAMIC_PATHS); + coveragePaths.addAll(compiledAdditionalReplacements); + Files.write( + Paths.get(baseTemplatesPath, "coverages.ftl"), + templateGenerator + .generateTemplate(coverages, coveragePaths) + .getBytes(StandardCharsets.UTF_8)); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + public static void assertData( + String baseTemplatesPath, List reports, Map replacements) { + try { + String expectedReportEvent = + getFreemarkerTemplate(baseTemplatesPath + "/coverage_report_event.ftl", replacements); + String actualReportEvent = JSON_MAPPER.writeValueAsString(reports.get(0).event); + + compareJson(expectedReportEvent, actualReportEvent); + + String expectedReport = + getFreemarkerTemplate(baseTemplatesPath + "/coverage_report.ftl", replacements); + String actualReport = reports.get(0).report; + + if (expectedReport.contains(" assertData( + String baseTemplatesPath, + List> events, + List> coverages, + Map additionalReplacements, + List ignoredTags) { + return assertData( + baseTemplatesPath, + events, + coverages, + additionalReplacements, + ignoredTags, + Collections.emptyList()); + } + + public static Map assertData( + String baseTemplatesPath, + List> events, + List> coverages, + Map additionalReplacements, + List ignoredTags, + List additionalDynamicPaths) { + List> mutableEvents = new ArrayList<>(events); + mutableEvents.sort(EVENT_RESOURCE_COMPARATOR); + + LabelGenerator labelGenerator = new LabelGenerator(); + TemplateGenerator templateGenerator = new TemplateGenerator(labelGenerator); + + List eventPaths = new ArrayList<>(EVENT_DYNAMIC_PATHS); + eventPaths.addAll(compile(additionalDynamicPaths)); + templateGenerator.generateReplacementMap(mutableEvents, eventPaths); + Map replacementMap = + templateGenerator.generateReplacementMap(coverages, COVERAGE_DYNAMIC_PATHS); + + // Tolerate Groovy callers passing GString values: convert each value to String via + // String.valueOf before storing it in the replacement map. + for (Map.Entry e : additionalReplacements.entrySet()) { + replacementMap.put( + labelGenerator.forKey(e.getKey()), "\"" + String.valueOf(e.getValue()) + "\""); + } + + // ignore provided tags + mutableEvents = removeTags(mutableEvents, ignoredTags); + + try { + String expectedEvents = + getFreemarkerTemplate(baseTemplatesPath + "/events.ftl", replacementMap, mutableEvents); + String actualEvents = JSON_MAPPER.writeValueAsString(mutableEvents); + + compareJson(expectedEvents, actualEvents); + + String expectedCoverages = + getFreemarkerTemplate(baseTemplatesPath + "/coverages.ftl", replacementMap, coverages); + String actualCoverages = JSON_MAPPER.writeValueAsString(coverages); + compareJson(expectedCoverages, actualCoverages); + } catch (Exception e) { + throw new RuntimeException(e); + } + + return replacementMap; + } + + private static void compareJson(String expectedJson, String actualJson) { + Map environment = System.getenv(); + boolean ciRun = + environment.get("GITHUB_ACTION") != null || environment.get("GITLAB_CI") != null; + JSONCompareMode comparisonMode = + ciRun ? JSONCompareMode.LENIENT : JSONCompareMode.NON_EXTENSIBLE; + + try { + JSONAssert.assertEquals(expectedJson, actualJson, comparisonMode); + } catch (org.json.JSONException jsonException) { + throw new RuntimeException(jsonException); + } catch (AssertionError e) { + if (ciRun) { + // When running in CI the assertion error message does not contain the actual diff, + // so we print the events to the console to help debug the issue. + System.out.println("Expected JSON: " + expectedJson); + System.out.println("Actual JSON: " + actualJson); + } + throw new AssertionFailedError( + "Expected and actual JSON mismatch", expectedJson, actualJson, e); + } + } + + public static boolean assertTestsOrder( + List> events, List expectedOrder) { + List identifiers = getTestIdentifiers(events); + if (!identifiers.equals(expectedOrder)) { + throw new AssertionError("Expected order: " + expectedOrder + ", but got: " + identifiers); + } + return true; + } + + public static List getTestIdentifiers(List> events) { + List> sorted = new ArrayList<>(events); + sorted.sort( + Comparator.comparing( + it -> ((Number) ((Map) it.get("content")).get("start")).longValue())); + List testIdentifiers = new ArrayList<>(); + for (Map event : sorted) { + Map content = (Map) event.get("content"); + Map meta = (Map) content.get("meta"); + Object testName = meta.get("test.name"); + if (testName != null) { + testIdentifiers.add(new TestFQN((String) meta.get("test.suite"), (String) testName)); + } + } + return testIdentifiers; + } + + public static List> removeTags(List> events, List tags) { + List> filteredEvents = new ArrayList<>(); + for (Map event : events) { + DocumentContext ctx = JsonPath.parse(event, JSON_PATH_CONFIG); + for (String tag : tags) { + ctx.delete(path(tag).path); + } + filteredEvents.add(ctx.json()); + } + return filteredEvents; + } + + // Sort traces in the following order: TEST -> SUITE -> MODULE -> SESSION + public static class SortTracesByType implements Comparator>, Serializable { + private static final long serialVersionUID = 1L; + + @Override + public int compare(List o1, List o2) { + return Integer.compare(rootSpanTypeToVal(o1), rootSpanTypeToVal(o2)); + } + + public int rootSpanTypeToVal(List trace) { + assert !trace.isEmpty(); + CharSequence spanType = trace.get(0).getSpanType(); + if (spanType == null) { + return 4; + } + if (DDSpanTypes.TEST.contentEquals(spanType)) { + return 0; + } + if (DDSpanTypes.TEST_SUITE_END.contentEquals(spanType)) { + return 1; + } + if (DDSpanTypes.TEST_MODULE_END.contentEquals(spanType)) { + return 2; + } + if (DDSpanTypes.TEST_SESSION_END.contentEquals(spanType)) { + return 3; + } + return 4; + } + } + + public static final Configuration JSON_PATH_CONFIG = + Configuration.builder().options(Option.SUPPRESS_EXCEPTIONS).build(); + + public static final ObjectMapper JSON_MAPPER = createJsonMapper(); + + private static ObjectMapper createJsonMapper() { + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationFeature.INDENT_OUTPUT); + mapper.enable(SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS); + return mapper; + } + + public static final TemplateExceptionHandler SUPPRESS_EXCEPTION_HANDLER = + new TemplateExceptionHandler() { + @Override + public void handleTemplateException( + TemplateException e, Environment environment, Writer writer) throws TemplateException { + if (e instanceof InvalidReferenceException) { + try { + writer.write("\"\""); + } catch (java.io.IOException ioe) { + throw new TemplateException(ioe, environment); + } + } else { + throw e; + } + } + }; + + public static final freemarker.template.Configuration FREEMARKER = createFreemarker(); + + private static freemarker.template.Configuration createFreemarker() { + freemarker.template.Configuration config = + new freemarker.template.Configuration(freemarker.template.Configuration.VERSION_2_3_30); + config.setClassLoaderForTemplateLoading(CiVisibilityTestUtils.class.getClassLoader(), ""); + config.setDefaultEncoding("UTF-8"); + config.setTemplateExceptionHandler(SUPPRESS_EXCEPTION_HANDLER); + config.setLogTemplateExceptions(false); + config.setWrapUncheckedExceptions(true); + config.setFallbackOnNullLoopVariable(false); + config.setNumberFormat("0.######"); + return config; + } + + public static String getFreemarkerTemplate(String templatePath, Map replacements) { + return getFreemarkerTemplate(templatePath, replacements, Collections.emptyList()); + } + + public static String getFreemarkerTemplate( + String templatePath, + Map replacements, + List> replacementsSource) { + try { + Template template = FREEMARKER.getTemplate(templatePath); + StringWriter out = new StringWriter(); + template.process(replacements, out); + return out.toString(); + } catch (Exception e) { + throw new RuntimeException( + "Could not get Freemarker template " + + templatePath + + "; replacements map: " + + replacements + + "; replacements source: " + + replacementsSource, + e); + } + } + + private static final class TemplateGenerator { + private static final Pattern PLACEHOLDER_PATTERN = Pattern.compile("\"(\\$\\{.*?\\})\""); + + private final Map uniqueValues = new HashMap<>(); + private final Map nonUniqueValues = new HashMap<>(); + private final LabelGenerator label; + + TemplateGenerator(LabelGenerator label) { + this.label = label; + } + + String generateTemplate(Collection> objects, List dynamicPaths) + throws Exception { + for (Map object : objects) { + DocumentContext ctx = JsonPath.parse(object, JSON_PATH_CONFIG); + for (DynamicPath dynamicPath : dynamicPaths) { + ctx.map( + dynamicPath.path, + (currentValue, config) -> { + if (dynamicPath.unique) { + return uniqueValues.computeIfAbsent( + String.valueOf(currentValue), k -> label.forTemplateKey(dynamicPath.rawPath)); + } + return label.forTemplateKey(dynamicPath.rawPath); + }); + } + } + // remove quotes around placeholders + return PLACEHOLDER_PATTERN.matcher(JSON_MAPPER.writeValueAsString(objects)).replaceAll("$1"); + } + + Map generateReplacementMap( + Collection> objects, List dynamicPaths) { + for (Map object : objects) { + ReadContext ctx = JsonPath.parse(object, JSON_PATH_CONFIG); + for (DynamicPath dynamicPath : dynamicPaths) { + Object value = ctx.read(dynamicPath.path); + if (value != null) { + String stringValue; + if (value instanceof String) { + stringValue = "\"" + ((String) value).replace("\"", "\\\"") + "\""; + } else { + stringValue = String.valueOf(value); + } + if (dynamicPath.unique) { + uniqueValues.computeIfAbsent(stringValue, k -> label.forKey(dynamicPath.rawPath)); + } else { + nonUniqueValues.put(label.forKey(dynamicPath.rawPath), stringValue); + } + } + } + } + Map result = new LinkedHashMap<>(invert(uniqueValues)); + result.putAll(nonUniqueValues); + return result; + } + } + + private static final class LabelGenerator { + private static final Pattern ERASED_CHARS = Pattern.compile("[\\[\\]']"); + private static final Pattern REPLACED_CHARS = Pattern.compile("[.-]"); + + private final Map usageCounters = new HashMap<>(); + + String forTemplateKey(String key) { + return "${" + forKey(key) + "}"; + } + + String forKey(String key) { + int usages = usageCounters.merge(key, 1, Integer::sum); + String sanitizedKey = ERASED_CHARS.matcher(key).replaceAll(""); + sanitizedKey = REPLACED_CHARS.matcher(sanitizedKey).replaceAll("_"); + return sanitizedKey + (usages == 1 ? "" : "_" + usages); + } + } + + private static Map invert(Map map) { + Map inverted = new HashMap<>(map.size()); + for (Map.Entry e : map.entrySet()) { + inverted.put(e.getValue(), e.getKey()); + } + return inverted; + } + + private static List compile(Iterable rawPaths) { + List compiledPaths = new ArrayList<>(); + for (String rawPath : rawPaths) { + compiledPaths.add(path(rawPath)); + } + return compiledPaths; + } + + private static DynamicPath path(String rawPath) { + return path(rawPath, true); + } + + private static DynamicPath path(String rawPath, boolean unique) { + return new DynamicPath(rawPath, JsonPath.compile(rawPath), unique); + } + + public static final class DynamicPath { + private final String rawPath; + private final JsonPath path; + // if true, same values are replaced with same placeholders; + // otherwise every path gets its own placeholder, even if its value is non-unique + private final boolean unique; + + DynamicPath(String rawPath, JsonPath path, boolean unique) { + this.rawPath = rawPath; + this.path = path; + this.unique = unique; + } + } + + public static final class CoverageReport { + public final Map event; + public final String report; + + public CoverageReport(Map event, String report) { + this.event = event; + this.report = report; + } + } +} diff --git a/dd-java-agent/agent-ci-visibility/gradle.lockfile b/dd-java-agent/agent-ci-visibility/gradle.lockfile index 4cc47dbe841..3ddf2d817a9 100644 --- a/dd-java-agent/agent-ci-visibility/gradle.lockfile +++ b/dd-java-agent/agent-ci-visibility/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-ci-visibility:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testImplementationDepend com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testRuntimeClasspath @@ -21,23 +22,27 @@ com.fasterxml.jackson.core:jackson-core:2.15.2=testCompileClasspath,testImplemen com.fasterxml.jackson.core:jackson-databind:2.15.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.15.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,compileOnlyDependenciesMetadata,spotbugs,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,compileOnlyDependenciesMetadata,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,compileOnlyDependenciesMetadata,spotbugs,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:18.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.google.jimfs:jimfs:1.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.squareup.moshi:moshi:1.11.0=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath @@ -50,16 +55,15 @@ commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testImplementatio commons-io:commons-io:2.11.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.openhft:zero-allocation-hashing:0.16=zinc net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -85,41 +89,40 @@ org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testImplementationDepende org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.freemarker:freemarker:2.3.31=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=compileClasspath,implementationDependenciesMetadata,jacocoAnt,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.jacoco:org.jacoco.report:0.8.14=compileClasspath,implementationDependenciesMetadata,jacocoAnt,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=compileClasspath,implementationDependenciesMetadata,jacocoAnt,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.jacoco:org.jacoco.report:0.8.15=compileClasspath,implementationDependenciesMetadata,jacocoAnt,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-build-common:2.0.21=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-build-tools-api:2.0.21=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-build-tools-impl:2.0.21=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-compiler-embeddable:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-compiler-runner:2.0.21=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-daemon-client:2.0.21=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-daemon-embeddable:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:2.0.21=kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-native-prebuilt:2.0.21=kotlinNativeBundleConfiguration +org.jetbrains.kotlin:kotlin-build-tools-api:2.1.20=kotlinBuildToolsApiClasspath +org.jetbrains.kotlin:kotlin-build-tools-impl:2.1.20=kotlinBuildToolsApiClasspath +org.jetbrains.kotlin:kotlin-compiler-embeddable:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath +org.jetbrains.kotlin:kotlin-compiler-runner:2.1.20=kotlinBuildToolsApiClasspath +org.jetbrains.kotlin:kotlin-daemon-client:2.1.20=kotlinBuildToolsApiClasspath +org.jetbrains.kotlin:kotlin-daemon-embeddable:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath +org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:2.1.20=kotlinKlibCommonizerClasspath org.jetbrains.kotlin:kotlin-reflect:1.6.10=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-script-runtime:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-scripting-common:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest -org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest -org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest -org.jetbrains.kotlin:kotlin-scripting-jvm:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest +org.jetbrains.kotlin:kotlin-script-runtime:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath +org.jetbrains.kotlin:kotlin-scripting-common:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest +org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest +org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest +org.jetbrains.kotlin:kotlin-scripting-jvm:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.jetbrains.kotlin:kotlin-stdlib:1.6.21=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath -org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath +org.jetbrains.kotlin:kotlin-stdlib:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath +org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.8.0=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath org.jetbrains:annotations:13.0=compileClasspath,compileOnlyDependenciesMetadata,kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc +org.jspecify:jspecify:1.0.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath @@ -140,42 +143,42 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testImplementationDependenciesM org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-commons:9.9.1=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9.1=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.ow2.asm:asm-commons:9.10.1=compileClasspath,implementationDependenciesMetadata,jacocoAnt,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=compileClasspath,implementationDependenciesMetadata,jacocoAnt,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.ow2.asm:asm:9.10.1=compileClasspath,implementationDependenciesMetadata,jacocoAnt,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=zinc org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.11.12=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.scala-lang:scala-library:2.13.15=zinc -org.scala-lang:scala-reflect:2.13.15=zinc -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-lang:scala-library:2.13.16=zinc +org.scala-lang:scala-reflect:2.13.16=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.skyscreamer:jsonassert:1.5.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/CiVisibilityCoverageServices.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/CiVisibilityCoverageServices.java index c83beb14283..205dba8ae72 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/CiVisibilityCoverageServices.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/CiVisibilityCoverageServices.java @@ -37,7 +37,10 @@ static class Parent { CoverageReportUploader coverageReportUploader = executionSettings.isCodeCoverageReportUploadEnabled() ? new CoverageReportUploader( - services.ciIntake, repoServices.ciTags, services.metricCollector) + services.ciIntake, + repoServices.ciTags, + services.config.getCodeCoverageFlags(), + services.metricCollector) : null; coverageProcessorFactory = diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/ci/JenkinsInfo.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/ci/JenkinsInfo.java index b187170c7ef..eb6e859ac81 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/ci/JenkinsInfo.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/ci/JenkinsInfo.java @@ -34,6 +34,7 @@ class JenkinsInfo implements CIProviderInfo { public static final String JENKINS_GIT_COMMIT = "GIT_COMMIT"; public static final String JENKINS_GIT_BRANCH = "GIT_BRANCH"; public static final String JENKINS_DD_CUSTOM_TRACE_ID = "DD_CUSTOM_TRACE_ID"; + public static final String JENKINS_DD_CUSTOM_PARENT_ID = "DD_CUSTOM_PARENT_ID"; public static final String JENKINS_NODE_NAME = "NODE_NAME"; public static final String JENKINS_NODE_LABELS = "NODE_LABELS"; public static final String JENKINS_PR_NUMBER = "CHANGE_ID"; @@ -67,7 +68,7 @@ public CIInfo buildCIInfo() { .ciWorkspace(expandTilde(environment.get(JENKINS_WORKSPACE_PATH))) .ciNodeName(environment.get(JENKINS_NODE_NAME)) .ciNodeLabels(buildCiNodeLabels()) - .ciEnvVars(JENKINS_DD_CUSTOM_TRACE_ID) + .ciEnvVars(JENKINS_DD_CUSTOM_TRACE_ID, JENKINS_DD_CUSTOM_PARENT_ID) .build(); } diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/codeowners/CodeownersImpl.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/codeowners/CodeownersImpl.java index a22a63ab252..7035c90a128 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/codeowners/CodeownersImpl.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/codeowners/CodeownersImpl.java @@ -5,17 +5,25 @@ import java.io.IOException; import java.io.Reader; import java.util.ArrayDeque; +import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.Deque; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; import javax.annotation.Nonnull; import javax.annotation.Nullable; public class CodeownersImpl implements Codeowners { - private final Iterable entries; + private final Collection

sections; - private CodeownersImpl(Iterable entries) { - this.entries = entries; + private CodeownersImpl(Collection
sections) { + this.sections = sections; } /** @@ -25,12 +33,24 @@ private CodeownersImpl(Iterable entries) { @Override public @Nullable Collection getOwners(@Nonnull String path) { char[] pathCharacters = path.toCharArray(); - for (Entry entry : entries) { - if (entry.getMatcher().consume(pathCharacters, 0) >= 0) { - return entry.getOwners(); + Set owners = null; + for (Section section : sections) { + if (section.isExcluded(pathCharacters)) { + if (owners == null) { + owners = new LinkedHashSet<>(); + } + continue; + } + + Entry entry = section.findMatchingEntry(pathCharacters); + if (entry != null) { + if (owners == null) { + owners = new LinkedHashSet<>(); + } + owners.addAll(entry.getOwners()); } } - return null; + return owners != null ? new ArrayList<>(owners) : null; } @Override @@ -39,20 +59,67 @@ public boolean exist() { } public static Codeowners parse(Reader r) throws IOException { - Deque entries = new ArrayDeque<>(); + Section defaultSection = new Section(); + Map namedSections = new LinkedHashMap<>(); + Section currentSection = defaultSection; CharacterMatcher.Factory characterMatcherFactory = new CharacterMatcher.Factory(); BufferedReader br = new BufferedReader(r); - String s; - while ((s = br.readLine()) != null) { - EntryBuilder entryBuilder = new EntryBuilder(characterMatcherFactory, s); - Entry entry = entryBuilder.parse(); + String line; + // Entries without owners inherit the current section's default owners + Collection sectionDefaultOwners = Collections.emptyList(); + while ((line = br.readLine()) != null) { + EntryBuilder entryBuilder = new EntryBuilder(characterMatcherFactory, line); + + SectionHeader header = entryBuilder.parseSectionHeader(); + if (header != null) { + sectionDefaultOwners = header.getDefaultOwners(); + String key = header.getName().trim().toLowerCase(Locale.ROOT); + currentSection = namedSections.computeIfAbsent(key, k -> new Section()); + continue; + } + + Entry entry = entryBuilder.parse(sectionDefaultOwners); if (entry != null) { - // place last parsed entry in the beginning of the list, since it has the highest priority + currentSection.add(entry); + } + } + + List
sections = new ArrayList<>(namedSections.size() + 1); + sections.add(defaultSection); + sections.addAll(namedSections.values()); + return new CodeownersImpl(sections); + } + + private static final class Section { + + private final Deque entries = new ArrayDeque<>(); + private final Collection exclusions = new ArrayList<>(); + + private void add(Entry entry) { + if (entry.isExclusion()) { + exclusions.add(entry); + } else { entries.offerFirst(entry); } } - return new CodeownersImpl(entries); + private boolean isExcluded(char[] path) { + for (Entry exclusion : exclusions) { + if (exclusion.getMatcher().consume(path, 0) >= 0) { + return true; + } + } + return false; + } + + private @Nullable Entry findMatchingEntry(char[] path) { + for (Entry entry : entries) { + if (entry.getMatcher().consume(path, 0) >= 0) { + return entry; + } + } + return null; + } } } diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/codeowners/Entry.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/codeowners/Entry.java index 4b6ab112e52..e35f13c93b6 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/codeowners/Entry.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/codeowners/Entry.java @@ -7,10 +7,12 @@ public class Entry { private final Matcher matcher; private final Collection owners; + private final boolean exclusion; - public Entry(Matcher matcher, Collection owners) { + public Entry(Matcher matcher, Collection owners, boolean exclusion) { this.matcher = matcher; this.owners = owners; + this.exclusion = exclusion; } public Matcher getMatcher() { @@ -20,4 +22,8 @@ public Matcher getMatcher() { public Collection getOwners() { return owners; } + + public boolean isExclusion() { + return exclusion; + } } diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/codeowners/EntryBuilder.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/codeowners/EntryBuilder.java index 0483909c2e5..3f2d88c3e27 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/codeowners/EntryBuilder.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/codeowners/EntryBuilder.java @@ -7,13 +7,12 @@ import datadog.trace.civisibility.codeowners.matcher.EndOfLineMatcher; import datadog.trace.civisibility.codeowners.matcher.EndOfSegmentMatcher; import datadog.trace.civisibility.codeowners.matcher.Matcher; -import datadog.trace.civisibility.codeowners.matcher.NegatingMatcher; import datadog.trace.civisibility.codeowners.matcher.QuestionMarkMatcher; import datadog.trace.civisibility.codeowners.matcher.RangeMatcher; import java.util.ArrayDeque; import java.util.ArrayList; -import java.util.Arrays; import java.util.Collection; +import java.util.Collections; import java.util.Deque; import javax.annotation.Nullable; import org.slf4j.Logger; @@ -46,34 +45,124 @@ public EntryBuilder(CharacterMatcher.Factory characterMatcherFactory, String s) } public @Nullable Entry parse() { + return parse(Collections.emptyList()); + } + + /** + * Parses the line as a CODEOWNERS entry: a path pattern optionally followed by one or more + * owners. + * + * @param sectionDefaultOwners default owners declared on the enclosing GitLab section header, + * used when the entry declares no owners of its own. Pass an empty collection for entries + * that do not belong to a section (e.g. GitHub CODEOWNERS files). + * @return the parsed entry, or {@code null} for blank lines, comments, section headers, or lines + * that cannot be parsed. + */ + public @Nullable Entry parse(Collection sectionDefaultOwners) { try { - // skip trailing whitespace - while (offset < c.length && Character.isWhitespace(c[offset])) { - offset++; - } + skipWhitespace(); if (offset == c.length // empty line || c[offset] == '#' // comment - || c[offset] == '[') { // section header + || isSectionHeader()) { // GitLab section header (including optional '^[') return null; } + boolean exclusion = c[offset] == '!'; + if (exclusion) { + offset++; + } + Matcher matcher = parseMatcher(); - Collection owners = parseOwners(); - return new Entry(matcher, owners); + Collection owners = exclusion ? Collections.emptyList() : parseOwners(); + if (!exclusion && owners.isEmpty()) { + owners = sectionDefaultOwners; + } + return new Entry(matcher, owners, exclusion); } catch (Exception e) { - log.error("error parsing CODEOWNERS pattern: {}", Arrays.toString(c), e); + log.warn("Skipping malformed CODEOWNERS entry: {}", new String(c), e); return null; } } - private Matcher parseMatcher() { - if (c[offset] == '!') { + /** + * If the line is a GitLab section header, consumes it and returns the parsed {@link + * SectionHeader} (its name and default owners). Returns {@code null} when the line is not a + * section header, leaving the cursor at the start of the pattern so the line can be parsed with + * {@link #parse(Collection)}. + * + *

Supports the GitLab header syntax {@code ^[Section name][N] @owner}: an optional leading + * {@code ^} (optional section), a bracketed name that may contain spaces, an optional {@code [N]} + * required-approvals count, and trailing default owners. + * + * @see GitLab Code Owners + * reference + */ + public @Nullable SectionHeader parseSectionHeader() { + skipWhitespace(); + if (!isSectionHeader()) { + return null; + } + if (c[offset] == '^') { + offset++; // consume the optional-section marker + } + offset++; // consume the opening '[' + int nameStart = offset; + while (offset < c.length && c[offset] != ']') { + offset++; // consume the section name (which may contain spaces) + } + String name = new String(c, nameStart, offset - nameStart); + if (offset < c.length) { + offset++; // consume the closing ']' + } + // skip the optional [N] required-approvals count that may immediately follow the name + if (offset < c.length && c[offset] == '[') { + while (offset < c.length && c[offset] != ']') { + offset++; + } + if (offset < c.length) { + offset++; // consume the closing ']' + } + } + return new SectionHeader(name, parseOwners()); + } + + private void skipWhitespace() { + while (offset < c.length && Character.isWhitespace(c[offset])) { offset++; - return new NegatingMatcher(parseMatcher()); } + } + /** + * Determines whether the line, starting at the current cursor (with leading whitespace already + * skipped), is a section header. Does not move the cursor. + * + *

A section header begins with {@code [} — or the GitLab optional-section marker {@code ^[} — + * and the section name's closing {@code ]} is followed by end-of-line, whitespace, a comment + * ({@code #}), or the optional {@code [N]} approvals count. Requiring that trailing context + * distinguishes a section header from a path pattern that merely begins with a character class + * such as {@code [a-z]*.txt}. + */ + private boolean isSectionHeader() { + int i = offset; + if (i < c.length && c[i] == '^') { + i++; // optional-section marker + } + if (i >= c.length || c[i] != '[') { + return false; + } + while (i < c.length && c[i] != ']') { + i++; // scan to the section name's closing ']' + } + if (i >= c.length) { + return false; // unterminated brackets: not a well-formed section header + } + i++; // move past ']' + return i >= c.length || Character.isWhitespace(c[i]) || c[i] == '[' || c[i] == '#'; + } + + private Matcher parseMatcher() { boolean patternContainsSlashes = false; if (c[offset] == '/') { // opening slash gets special treatment diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/codeowners/SectionHeader.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/codeowners/SectionHeader.java new file mode 100644 index 00000000000..1e45b01ecc6 --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/codeowners/SectionHeader.java @@ -0,0 +1,27 @@ +package datadog.trace.civisibility.codeowners; + +import java.util.Collection; + +/** + * A parsed GitLab CODEOWNERS section header, holding the section {@code name} (used to combine + * blocks that repeat a name) and the {@code defaultOwners} it declares (inherited by entries in the + * section that do not declare their own). + */ +public class SectionHeader { + + private final String name; + private final Collection defaultOwners; + + public SectionHeader(String name, Collection defaultOwners) { + this.name = name; + this.defaultOwners = defaultOwners; + } + + public String getName() { + return name; + } + + public Collection getDefaultOwners() { + return defaultOwners; + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/codeowners/matcher/NegatingMatcher.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/codeowners/matcher/NegatingMatcher.java deleted file mode 100644 index 19e5b7efe45..00000000000 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/codeowners/matcher/NegatingMatcher.java +++ /dev/null @@ -1,20 +0,0 @@ -package datadog.trace.civisibility.codeowners.matcher; - -public class NegatingMatcher implements Matcher { - - private final Matcher delegate; - - public NegatingMatcher(Matcher delegate) { - this.delegate = delegate; - } - - @Override - public int consume(char[] line, int offset) { - return -delegate.consume(line, offset) - 1; - } - - @Override - public boolean multi() { - return false; - } -} diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ConfigurationApi.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ConfigurationApi.java index 6648f90c5fd..ba174b60ffb 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ConfigurationApi.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ConfigurationApi.java @@ -1,6 +1,7 @@ package datadog.trace.civisibility.config; import datadog.trace.api.civisibility.config.TestFQN; +import datadog.trace.civisibility.config.api.dto.request.TracerEnvironment; import java.io.IOException; import java.util.Collection; import java.util.Collections; diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ConfigurationApiImpl.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ConfigurationApiImpl.java index 9dcc6d65f10..49665328c12 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ConfigurationApiImpl.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ConfigurationApiImpl.java @@ -1,15 +1,11 @@ package datadog.trace.civisibility.config; -import com.squareup.moshi.Json; import com.squareup.moshi.JsonAdapter; import com.squareup.moshi.Moshi; import com.squareup.moshi.Types; import datadog.communication.BackendApi; import datadog.communication.http.OkHttpUtils; -import datadog.trace.api.civisibility.config.Configurations; import datadog.trace.api.civisibility.config.TestFQN; -import datadog.trace.api.civisibility.config.TestIdentifier; -import datadog.trace.api.civisibility.config.TestMetadata; import datadog.trace.api.civisibility.telemetry.CiVisibilityCountMetric; import datadog.trace.api.civisibility.telemetry.CiVisibilityDistributionMetric; import datadog.trace.api.civisibility.telemetry.CiVisibilityMetricCollector; @@ -24,14 +20,21 @@ import datadog.trace.api.civisibility.telemetry.tag.RequireGit; import datadog.trace.api.civisibility.telemetry.tag.TestManagementEnabled; import datadog.trace.civisibility.communication.TelemetryListener; +import datadog.trace.civisibility.config.api.dto.ConfigurationApiMoshi; +import datadog.trace.civisibility.config.api.dto.Data; +import datadog.trace.civisibility.config.api.dto.Envelope; +import datadog.trace.civisibility.config.api.dto.MultiEnvelope; +import datadog.trace.civisibility.config.api.dto.request.KnownTestsRequest; +import datadog.trace.civisibility.config.api.dto.request.TestManagementRequest; +import datadog.trace.civisibility.config.api.dto.request.TracerEnvironment; +import datadog.trace.civisibility.config.api.dto.response.KnownTestsResponse; +import datadog.trace.civisibility.config.api.dto.response.TestIdentifierJson; +import datadog.trace.civisibility.config.api.dto.response.TestManagementTestsResponse; import datadog.trace.util.RandomUtils; import java.io.IOException; import java.lang.reflect.ParameterizedType; -import java.util.BitSet; import java.util.Collection; -import java.util.Collections; import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.function.Supplier; @@ -58,13 +61,14 @@ public class ConfigurationApiImpl implements ConfigurationApi { private final CiVisibilityMetricCollector metricCollector; private final Supplier uuidGenerator; - private final JsonAdapter> requestAdapter; - private final JsonAdapter> settingsResponseAdapter; - private final JsonAdapter> testIdentifiersResponseAdapter; - private final JsonAdapter> knownTestsRequestAdapter; - private final JsonAdapter> testFullNamesResponseAdapter; - private final JsonAdapter> testManagementRequestAdapter; - private final JsonAdapter> testManagementTestsResponseAdapter; + private final JsonAdapter> requestAdapter; + private final JsonAdapter> settingsResponseAdapter; + private final JsonAdapter> testIdentifiersResponseAdapter; + private final JsonAdapter> knownTestsRequestAdapter; + private final JsonAdapter> testFullNamesResponseAdapter; + private final JsonAdapter> testManagementRequestAdapter; + private final JsonAdapter> + testManagementTestsResponseAdapter; public ConfigurationApiImpl(BackendApi backendApi, CiVisibilityMetricCollector metricCollector) { this(backendApi, metricCollector, () -> RandomUtils.randomUUID().toString()); @@ -78,56 +82,31 @@ public ConfigurationApiImpl(BackendApi backendApi, CiVisibilityMetricCollector m this.metricCollector = metricCollector; this.uuidGenerator = uuidGenerator; - Moshi moshi = - new Moshi.Builder() - .add(ConfigurationsJsonAdapter.INSTANCE) - .add(CiVisibilitySettings.JsonAdapter.INSTANCE) - .add(EarlyFlakeDetectionSettings.JsonAdapter.INSTANCE) - .add(MetaDto.JsonAdapter.INSTANCE) - .build(); + Moshi moshi = ConfigurationApiMoshi.create(); + requestAdapter = moshi.adapter(envelopeOf(TracerEnvironment.class)); + settingsResponseAdapter = moshi.adapter(envelopeOf(CiVisibilitySettings.class)); + testIdentifiersResponseAdapter = moshi.adapter(multiEnvelopeOf(TestIdentifierJson.class)); + knownTestsRequestAdapter = moshi.adapter(envelopeOf(KnownTestsRequest.class)); + testFullNamesResponseAdapter = moshi.adapter(envelopeOf(KnownTestsResponse.class)); + testManagementRequestAdapter = moshi.adapter(envelopeOf(TestManagementRequest.class)); + testManagementTestsResponseAdapter = + moshi.adapter(envelopeOf(TestManagementTestsResponse.class)); + } - ParameterizedType requestType = - Types.newParameterizedTypeWithOwner( - ConfigurationApiImpl.class, EnvelopeDto.class, TracerEnvironment.class); - requestAdapter = moshi.adapter(requestType); - - ParameterizedType settingsResponseType = - Types.newParameterizedTypeWithOwner( - ConfigurationApiImpl.class, EnvelopeDto.class, CiVisibilitySettings.class); - settingsResponseAdapter = moshi.adapter(settingsResponseType); - - ParameterizedType testIdentifiersResponseType = - Types.newParameterizedTypeWithOwner( - ConfigurationApiImpl.class, MultiEnvelopeDto.class, TestIdentifierJson.class); - testIdentifiersResponseAdapter = moshi.adapter(testIdentifiersResponseType); - - ParameterizedType knownTestsRequestType = - Types.newParameterizedTypeWithOwner( - ConfigurationApiImpl.class, EnvelopeDto.class, KnownTestsRequestDto.class); - knownTestsRequestAdapter = moshi.adapter(knownTestsRequestType); - - ParameterizedType testFullNamesResponseType = - Types.newParameterizedTypeWithOwner( - ConfigurationApiImpl.class, EnvelopeDto.class, KnownTestsDto.class); - testFullNamesResponseAdapter = moshi.adapter(testFullNamesResponseType); - - ParameterizedType testManagementRequestType = - Types.newParameterizedTypeWithOwner( - ConfigurationApiImpl.class, EnvelopeDto.class, TestManagementDto.class); - testManagementRequestAdapter = moshi.adapter(testManagementRequestType); - - ParameterizedType testManagementTestsResponseType = - Types.newParameterizedTypeWithOwner( - ConfigurationApiImpl.class, EnvelopeDto.class, TestManagementTestsDto.class); - testManagementTestsResponseAdapter = moshi.adapter(testManagementTestsResponseType); + private static ParameterizedType envelopeOf(Class attributesType) { + return Types.newParameterizedType(Envelope.class, attributesType); + } + + private static ParameterizedType multiEnvelopeOf(Class attributesType) { + return Types.newParameterizedType(MultiEnvelope.class, attributesType); } @Override public CiVisibilitySettings getSettings(TracerEnvironment tracerEnvironment) throws IOException { String uuid = uuidGenerator.get(); - EnvelopeDto settingsRequest = - new EnvelopeDto<>( - new DataDto<>(uuid, "ci_app_test_service_libraries_settings", tracerEnvironment)); + Envelope settingsRequest = + new Envelope<>( + new Data<>(uuid, "ci_app_test_service_libraries_settings", tracerEnvironment)); String json = requestAdapter.toJson(settingsRequest); RequestBody requestBody = RequestBody.create(JSON, json); @@ -176,11 +155,11 @@ public SkippableTests getSkippableTests(TracerEnvironment tracerEnvironment) thr .build(); String uuid = uuidGenerator.get(); - EnvelopeDto request = - new EnvelopeDto<>(new DataDto<>(uuid, "test_params", tracerEnvironment)); + Envelope request = + new Envelope<>(new Data<>(uuid, "test_params", tracerEnvironment)); String json = requestAdapter.toJson(request); RequestBody requestBody = RequestBody.create(JSON, json); - MultiEnvelopeDto response = + MultiEnvelope response = backendApi.post( SKIPPABLE_TESTS_URI, requestBody, @@ -188,29 +167,10 @@ public SkippableTests getSkippableTests(TracerEnvironment tracerEnvironment) thr telemetryListener, false); - Configurations requestConf = tracerEnvironment.getConfigurations(); - - Map> testIdentifiersByModule = new HashMap<>(); - for (DataDto dataDto : response.data) { - TestIdentifierJson testIdentifierJson = dataDto.getAttributes(); - Configurations conf = testIdentifierJson.getConfigurations(); - String moduleName = - (conf != null && conf.getTestBundle() != null ? conf : requestConf).getTestBundle(); - testIdentifiersByModule - .computeIfAbsent(moduleName, k -> new HashMap<>()) - .put(testIdentifierJson.toTestIdentifier(), testIdentifierJson.toTestMetadata()); - } - metricCollector.add( CiVisibilityCountMetric.ITR_SKIPPABLE_TESTS_RESPONSE_TESTS, response.data.size()); - String correlationId = response.meta != null ? response.meta.correlationId : null; - Map coveredLinesByRelativeSourcePath = - response.meta != null && response.meta.coverage != null - ? response.meta.coverage - : Collections.emptyMap(); - return new SkippableTests( - correlationId, testIdentifiersByModule, coveredLinesByRelativeSourcePath); + return SkippableTests.from(response, tracerEnvironment); } @Override @@ -225,12 +185,11 @@ public Map> getFlakyTestsByModule(TracerEnvironment .build(); String uuid = uuidGenerator.get(); - EnvelopeDto request = - new EnvelopeDto<>( - new DataDto<>(uuid, "flaky_test_from_libraries_params", tracerEnvironment)); + Envelope request = + new Envelope<>(new Data<>(uuid, "flaky_test_from_libraries_params", tracerEnvironment)); String json = requestAdapter.toJson(request); RequestBody requestBody = RequestBody.create(JSON, json); - Collection> response = + Collection> response = backendApi.post( FLAKY_TESTS_URI, requestBody, @@ -240,23 +199,11 @@ public Map> getFlakyTestsByModule(TracerEnvironment LOGGER.debug("Received {} flaky tests in total", response.size()); - Configurations requestConf = tracerEnvironment.getConfigurations(); - - int flakyTestsCount = 0; - Map> testIdentifiers = new HashMap<>(); - for (DataDto dataDto : response) { - TestIdentifierJson testIdentifierJson = dataDto.getAttributes(); - Configurations conf = testIdentifierJson.getConfigurations(); - String moduleName = - (conf != null && conf.getTestBundle() != null ? conf : requestConf).getTestBundle(); - testIdentifiers - .computeIfAbsent(moduleName, k -> new HashSet<>()) - .add(testIdentifierJson.toTestIdentifier().toFQN()); - flakyTestsCount++; - } - + Map> testsByModule = + TestIdentifierJson.toTestFQNsByModule(response, tracerEnvironment); + int flakyTestsCount = testsByModule.values().stream().mapToInt(Collection::size).sum(); metricCollector.add(CiVisibilityDistributionMetric.FLAKY_TESTS_RESPONSE_TESTS, flakyTestsCount); - return testIdentifiers; + return testsByModule; } @Nullable @@ -281,12 +228,12 @@ public Map> getKnownTestsByModule(TracerEnvironment LOGGER.debug( "Fetching known tests page #{}{}", pageNumber, pageState != null ? " with cursor" : ""); String uuid = uuidGenerator.get(); - KnownTestsRequestDto requestDto = new KnownTestsRequestDto(tracerEnvironment, pageState); - EnvelopeDto request = - new EnvelopeDto<>(new DataDto<>(uuid, "ci_app_libraries_tests_request", requestDto)); + KnownTestsRequest requestDto = new KnownTestsRequest(tracerEnvironment, pageState); + Envelope request = + new Envelope<>(new Data<>(uuid, "ci_app_libraries_tests_request", requestDto)); String json = knownTestsRequestAdapter.toJson(request); RequestBody requestBody = RequestBody.create(JSON, json); - KnownTestsDto knownTests = + KnownTestsResponse knownTests = backendApi.post( KNOWN_TESTS_URI, requestBody, @@ -297,7 +244,6 @@ public Map> getKnownTestsByModule(TracerEnvironment telemetryListener, false); - // Merge page's tests into aggregate mergeKnownTests(aggregateTests, knownTests.tests); Integer pageSize = knownTests.getPageSize(); @@ -307,17 +253,22 @@ public Map> getKnownTestsByModule(TracerEnvironment LOGGER.debug("Received page #{} for known tests", pageNumber); } - // Get cursor for next page (if any) - if (knownTests.hasNextPage()) { - pageState = knownTests.getNextPageCursor(); - } else { - pageState = null; - } + pageState = knownTests.hasNextPage() ? knownTests.getNextPageCursor() : null; } while (pageState != null); LOGGER.debug("Finished fetching known tests after {} page(s)", pageNumber); - return parseTestIdentifiers(aggregateTests); + Map> testsByModule = + KnownTestsResponse.toTestFQNsByModule(aggregateTests); + int knownTestsCount = + testsByModule != null + ? testsByModule.values().stream().mapToInt(Collection::size).sum() + : 0; + LOGGER.debug("Received {} known tests in total", knownTestsCount); + metricCollector.add(CiVisibilityDistributionMetric.KNOWN_TESTS_RESPONSE_TESTS, knownTestsCount); + // returning null disables features that rely on known tests; this is intentional on the very + // first execution for a repository, when we want to seed the backend with the initial set. + return testsByModule; } private void mergeKnownTests( @@ -348,40 +299,6 @@ private void mergeKnownTests( } } - private Map> parseTestIdentifiers( - Map>> testsMap) { - int knownTestsCount = 0; - - Map> testIdentifiers = new HashMap<>(); - for (Map.Entry>> e : testsMap.entrySet()) { - String moduleName = e.getKey(); - Map> testsBySuiteName = e.getValue(); - - for (Map.Entry> se : testsBySuiteName.entrySet()) { - String suiteName = se.getKey(); - List testNames = se.getValue(); - knownTestsCount += testNames.size(); - - for (String testName : testNames) { - testIdentifiers - .computeIfAbsent(moduleName, k -> new HashSet<>()) - .add(new TestFQN(suiteName, testName)); - } - } - } - - LOGGER.debug("Received {} known tests in total", knownTestsCount); - metricCollector.add(CiVisibilityDistributionMetric.KNOWN_TESTS_RESPONSE_TESTS, knownTestsCount); - return knownTestsCount > 0 - ? testIdentifiers - // returning null if there are no known tests: - // this will disable the features that are reliant on known tests - // and is done on purpose: - // if no tests are known, this is likely the first execution for this repository, - // and we want to fill the backend with the initial set of tests - : null; - } - @Override public Map>> getTestManagementTestsByModule( TracerEnvironment tracerEnvironment, String commitSha, String commitMessage) @@ -395,12 +312,12 @@ public Map>> getTestManagementTests .build(); String uuid = uuidGenerator.get(); - EnvelopeDto request = - new EnvelopeDto<>( - new DataDto<>( + Envelope request = + new Envelope<>( + new Data<>( uuid, "ci_app_libraries_tests_request", - new TestManagementDto( + new TestManagementRequest( tracerEnvironment.getRepositoryUrl(), commitMessage, tracerEnvironment.getConfigurations().getTestBundle(), @@ -408,7 +325,7 @@ public Map>> getTestManagementTests tracerEnvironment.getBranch()))); String json = testManagementRequestAdapter.toJson(request); RequestBody requestBody = RequestBody.create(JSON, json); - TestManagementTestsDto testManagementTestsDto = + TestManagementTestsResponse response = backendApi.post( TEST_MANAGEMENT_TESTS_URI, requestBody, @@ -419,184 +336,11 @@ public Map>> getTestManagementTests telemetryListener, false); - return parseTestManagementTests(testManagementTestsDto); - } - - private Map>> parseTestManagementTests( - TestManagementTestsDto testsManagementTestsDto) { - int testManagementTestsCount = 0; - - Map> quarantinedTestsByModule = new HashMap<>(); - Map> disabledTestsByModule = new HashMap<>(); - Map> attemptToFixTestsByModule = new HashMap<>(); - - for (Map.Entry e : - testsManagementTestsDto.getModules().entrySet()) { - String moduleName = e.getKey(); - Map testsBySuiteName = e.getValue().getSuites(); - - for (Map.Entry se : testsBySuiteName.entrySet()) { - String suiteName = se.getKey(); - Map tests = se.getValue().getTests(); - - testManagementTestsCount += tests.size(); - - for (Map.Entry te : tests.entrySet()) { - String testName = te.getKey(); - TestManagementTestsDto.Properties properties = te.getValue(); - if (properties.isQuarantined()) { - quarantinedTestsByModule - .computeIfAbsent(moduleName, k -> new HashSet<>()) - .add(new TestFQN(suiteName, testName)); - } - if (properties.isDisabled()) { - disabledTestsByModule - .computeIfAbsent(moduleName, k -> new HashSet<>()) - .add(new TestFQN(suiteName, testName)); - } - if (properties.isAttemptToFix()) { - attemptToFixTestsByModule - .computeIfAbsent(moduleName, k -> new HashSet<>()) - .add(new TestFQN(suiteName, testName)); - } - } - } - } - - Map>> testsByTypeByModule = new HashMap<>(); - testsByTypeByModule.put(TestSetting.QUARANTINED, quarantinedTestsByModule); - testsByTypeByModule.put(TestSetting.DISABLED, disabledTestsByModule); - testsByTypeByModule.put(TestSetting.ATTEMPT_TO_FIX, attemptToFixTestsByModule); - - LOGGER.debug("Received {} test management tests in total", testManagementTestsCount); + int testsCount = response.totalTestsCount(); + LOGGER.debug("Received {} test management tests in total", testsCount); metricCollector.add( - CiVisibilityDistributionMetric.TEST_MANAGEMENT_TESTS_RESPONSE_TESTS, - testManagementTestsCount); - - return testsByTypeByModule; - } - - private static final class EnvelopeDto { - private final DataDto data; - - private EnvelopeDto(DataDto data) { - this.data = data; - } - } - - private static final class MultiEnvelopeDto { - private final Collection> data; - private final @Nullable MetaDto meta; - - private MultiEnvelopeDto(Collection> data, MetaDto meta) { - this.data = data; - this.meta = meta; - } - } - - private static final class DataDto { - // TODO: extract all DTO logic to common utilities - private final String id; - private final String type; - private final T attributes; + CiVisibilityDistributionMetric.TEST_MANAGEMENT_TESTS_RESPONSE_TESTS, testsCount); - private DataDto(String id, String type, T attributes) { - this.id = id; - this.type = type; - this.attributes = attributes; - } - - public T getAttributes() { - return attributes; - } - } - - private static final class KnownTestsDto { - private final Map>> tests; - - @Json(name = "page_info") - private final PageInfoResponse pageInfo; - - private KnownTestsDto(Map>> tests, PageInfoResponse pageInfo) { - this.tests = tests; - this.pageInfo = pageInfo; - } - - public boolean hasNextPage() { - return pageInfo != null && pageInfo.hasNext; - } - - @Nullable - public Integer getPageSize() { - return pageInfo != null ? pageInfo.size : null; - } - - @Nullable - public String getNextPageCursor() { - return pageInfo != null ? pageInfo.cursor : null; - } - } - - private static final class PageInfoResponse { - private final String cursor; - private final int size; - - @Json(name = "has_next") - private final boolean hasNext; - - private PageInfoResponse(String cursor, int size, boolean hasNext) { - this.cursor = cursor; - this.size = size; - this.hasNext = hasNext; - } - } - - private static final class KnownTestsRequestDto { - @Json(name = "repository_url") - private final String repositoryUrl; - - private final String service; - private final String env; - - @Json(name = "page_info") - private final PageInfoRequest pageInfo; - - private KnownTestsRequestDto(TracerEnvironment tracerEnvironment, @Nullable String pageState) { - this.repositoryUrl = tracerEnvironment.getRepositoryUrl(); - this.service = tracerEnvironment.getService(); - this.env = tracerEnvironment.getEnv(); - this.pageInfo = new PageInfoRequest(pageState); - } - - private static final class PageInfoRequest { - @Json(name = "page_state") - @Nullable - private final String pageState; - - private PageInfoRequest(@Nullable String pageState) { - this.pageState = pageState; - } - } - } - - private static final class TestManagementDto { - @Json(name = "repository_url") - private final String repositoryUrl; - - @Json(name = "commit_message") - private final String commitMessage; - - private final String module; - private final String sha; - private final String branch; - - private TestManagementDto( - String repositoryUrl, String commitMessage, String module, String sha, String branch) { - this.repositoryUrl = repositoryUrl; - this.commitMessage = commitMessage; - this.module = module; - this.sha = sha; - this.branch = branch; - } + return response.toTestFQNsBySetting(); } } diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ExecutionSettingsFactoryImpl.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ExecutionSettingsFactoryImpl.java index 46ecb133ff3..b5ff526b2c4 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ExecutionSettingsFactoryImpl.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/ExecutionSettingsFactoryImpl.java @@ -7,6 +7,7 @@ import datadog.trace.api.git.GitInfo; import datadog.trace.api.git.GitInfoProvider; import datadog.trace.civisibility.ci.PullRequestInfo; +import datadog.trace.civisibility.config.api.dto.request.TracerEnvironment; import datadog.trace.civisibility.diff.Diff; import datadog.trace.civisibility.diff.LineDiff; import datadog.trace.civisibility.git.tree.GitClient; diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/FileBasedConfigurationApi.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/FileBasedConfigurationApi.java index 701180157bf..9e28ea35c35 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/FileBasedConfigurationApi.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/FileBasedConfigurationApi.java @@ -2,18 +2,20 @@ import com.squareup.moshi.JsonAdapter; import com.squareup.moshi.Moshi; -import datadog.trace.api.civisibility.config.Configurations; +import com.squareup.moshi.Types; import datadog.trace.api.civisibility.config.TestFQN; -import datadog.trace.api.civisibility.config.TestIdentifier; -import datadog.trace.api.civisibility.config.TestMetadata; +import datadog.trace.civisibility.config.api.dto.ConfigurationApiMoshi; +import datadog.trace.civisibility.config.api.dto.Envelope; +import datadog.trace.civisibility.config.api.dto.MultiEnvelope; +import datadog.trace.civisibility.config.api.dto.request.TracerEnvironment; +import datadog.trace.civisibility.config.api.dto.response.KnownTestsResponse; +import datadog.trace.civisibility.config.api.dto.response.TestIdentifierJson; +import datadog.trace.civisibility.config.api.dto.response.TestManagementTestsResponse; import java.io.IOException; +import java.lang.reflect.ParameterizedType; import java.nio.file.Path; -import java.util.BitSet; import java.util.Collection; import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; import java.util.Map; import javax.annotation.Nullable; import okio.BufferedSource; @@ -36,10 +38,10 @@ public class FileBasedConfigurationApi implements ConfigurationApi { @Nullable private final Path knownTestsPath; @Nullable private final Path testManagementPath; - private final JsonAdapter settingsAdapter; - private final JsonAdapter knownTestsAdapter; - private final JsonAdapter testManagementAdapter; - private final JsonAdapter testIdentifiersAdapter; + private final JsonAdapter> settingsAdapter; + private final JsonAdapter> knownTestsAdapter; + private final JsonAdapter> testManagementAdapter; + private final JsonAdapter> testIdentifiersAdapter; public FileBasedConfigurationApi( @Nullable Path settingsPath, @@ -53,19 +55,19 @@ public FileBasedConfigurationApi( this.knownTestsPath = knownTestsPath; this.testManagementPath = testManagementPath; - Moshi moshi = - new Moshi.Builder() - .add(ConfigurationsJsonAdapter.INSTANCE) - .add(CiVisibilitySettings.JsonAdapter.INSTANCE) - .add(EarlyFlakeDetectionSettings.JsonAdapter.INSTANCE) - .add(TestManagementSettings.JsonAdapter.INSTANCE) - .add(MetaDto.JsonAdapter.INSTANCE) - .build(); + Moshi moshi = ConfigurationApiMoshi.create(); + settingsAdapter = moshi.adapter(envelopeOf(CiVisibilitySettings.class)); + knownTestsAdapter = moshi.adapter(envelopeOf(KnownTestsResponse.class)); + testManagementAdapter = moshi.adapter(envelopeOf(TestManagementTestsResponse.class)); + testIdentifiersAdapter = moshi.adapter(multiEnvelopeOf(TestIdentifierJson.class)); + } + + private static ParameterizedType envelopeOf(Class attributesType) { + return Types.newParameterizedType(Envelope.class, attributesType); + } - settingsAdapter = moshi.adapter(SettingsEnvelope.class); - knownTestsAdapter = moshi.adapter(KnownTestsEnvelope.class); - testManagementAdapter = moshi.adapter(TestManagementEnvelope.class); - testIdentifiersAdapter = moshi.adapter(TestIdentifiersEnvelope.class); + private static ParameterizedType multiEnvelopeOf(Class attributesType) { + return Types.newParameterizedType(MultiEnvelope.class, attributesType); } @Override @@ -74,15 +76,11 @@ public CiVisibilitySettings getSettings(TracerEnvironment tracerEnvironment) thr LOGGER.debug("Settings file path not provided, returning defaults"); return CiVisibilitySettings.DEFAULT; } - LOGGER.debug("Reading settings from {}", settingsPath); - try (BufferedSource source = Okio.buffer(Okio.source(settingsPath))) { - SettingsEnvelope envelope = settingsAdapter.fromJson(source); - if (envelope != null && envelope.data != null && envelope.data.attributes != null) { - return envelope.data.attributes; - } - } - return CiVisibilitySettings.DEFAULT; + Envelope envelope = readEnvelope(settingsPath, settingsAdapter); + return envelope != null && envelope.data != null && envelope.data.attributes != null + ? envelope.data.attributes + : CiVisibilitySettings.DEFAULT; } @Override @@ -91,41 +89,13 @@ public SkippableTests getSkippableTests(TracerEnvironment tracerEnvironment) thr LOGGER.debug("Skippable tests file path not provided, returning empty"); return SkippableTests.EMPTY; } - LOGGER.debug("Reading skippable tests from {}", skippableTestsPath); - try (BufferedSource source = Okio.buffer(Okio.source(skippableTestsPath))) { - TestIdentifiersEnvelope envelope = testIdentifiersAdapter.fromJson(source); - if (envelope != null && envelope.data != null) { - return toSkippableTests(envelope, tracerEnvironment); - } - } - return SkippableTests.EMPTY; - } - - private SkippableTests toSkippableTests( - TestIdentifiersEnvelope envelope, TracerEnvironment tracerEnvironment) { - Configurations requestConf = tracerEnvironment.getConfigurations(); - - Map> identifiersByModule = new HashMap<>(); - for (TestIdentifierDataDto dataDto : envelope.data) { - TestIdentifierJson testIdJson = dataDto.attributes; - if (testIdJson == null) { - continue; - } - Configurations conf = testIdJson.getConfigurations(); - String moduleName = - (conf != null && conf.getTestBundle() != null ? conf : requestConf).getTestBundle(); - identifiersByModule - .computeIfAbsent(moduleName, k -> new HashMap<>()) - .put(testIdJson.toTestIdentifier(), testIdJson.toTestMetadata()); + MultiEnvelope envelope = + readEnvelope(skippableTestsPath, testIdentifiersAdapter); + if (envelope == null || envelope.data == null) { + return SkippableTests.EMPTY; } - - String correlationId = envelope.meta != null ? envelope.meta.correlationId : null; - Map coverage = - envelope.meta != null && envelope.meta.coverage != null - ? envelope.meta.coverage - : Collections.emptyMap(); - return new SkippableTests(correlationId, identifiersByModule, coverage); + return SkippableTests.from(envelope, tracerEnvironment); } @Override @@ -135,34 +105,14 @@ public Map> getFlakyTestsByModule(TracerEnvironment LOGGER.debug("Flaky tests file path not provided, returning empty"); return Collections.emptyMap(); } - LOGGER.debug("Reading flaky tests from {}", flakyTestsPath); - try (BufferedSource source = Okio.buffer(Okio.source(flakyTestsPath))) { - TestIdentifiersEnvelope envelope = testIdentifiersAdapter.fromJson(source); - if (envelope != null && envelope.data != null) { - return toFlakyTestsByModule(envelope, tracerEnvironment); - } - } - return Collections.emptyMap(); - } - - private Map> toFlakyTestsByModule( - TestIdentifiersEnvelope envelope, TracerEnvironment tracerEnvironment) { - Configurations requestConf = tracerEnvironment.getConfigurations(); - - Map> result = new HashMap<>(); - for (TestIdentifierDataDto dataDto : envelope.data) { - TestIdentifierJson testIdJson = dataDto.attributes; - if (testIdJson == null) { - continue; - } - Configurations conf = testIdJson.getConfigurations(); - String moduleName = - (conf != null && conf.getTestBundle() != null ? conf : requestConf).getTestBundle(); - result - .computeIfAbsent(moduleName, k -> new HashSet<>()) - .add(testIdJson.toTestIdentifier().toFQN()); + MultiEnvelope envelope = + readEnvelope(flakyTestsPath, testIdentifiersAdapter); + if (envelope == null || envelope.data == null) { + return Collections.emptyMap(); } + Map> result = + TestIdentifierJson.toTestFQNsByModule(envelope.data, tracerEnvironment); LOGGER.debug( "Read {} flaky tests from file", result.values().stream().mapToInt(Collection::size).sum()); return result; @@ -176,38 +126,20 @@ public Map> getKnownTestsByModule(TracerEnvironment LOGGER.debug("Known tests file path not provided, returning empty"); return Collections.emptyMap(); } - LOGGER.debug("Reading known tests from {}", knownTestsPath); - try (BufferedSource source = Okio.buffer(Okio.source(knownTestsPath))) { - KnownTestsEnvelope envelope = knownTestsAdapter.fromJson(source); - if (envelope != null - && envelope.data != null - && envelope.data.attributes != null - && envelope.data.attributes.tests != null) { - return parseKnownTests(envelope.data.attributes.tests); - } - } - return Collections.emptyMap(); - } - - private Map> parseKnownTests( - Map>> testsMap) { - int count = 0; - Map> result = new HashMap<>(); - for (Map.Entry>> moduleEntry : testsMap.entrySet()) { - String moduleName = moduleEntry.getKey(); - for (Map.Entry> suiteEntry : moduleEntry.getValue().entrySet()) { - String suiteName = suiteEntry.getKey(); - for (String testName : suiteEntry.getValue()) { - result - .computeIfAbsent(moduleName, k -> new HashSet<>()) - .add(new TestFQN(suiteName, testName)); - count++; - } - } + Envelope envelope = readEnvelope(knownTestsPath, knownTestsAdapter); + if (envelope == null + || envelope.data == null + || envelope.data.attributes == null + || envelope.data.attributes.tests == null) { + return Collections.emptyMap(); } - LOGGER.debug("Read {} known tests from file", count); - return count > 0 ? result : null; + Map> result = + KnownTestsResponse.toTestFQNsByModule(envelope.data.attributes.tests); + LOGGER.debug( + "Read {} known tests from file", + result != null ? result.values().stream().mapToInt(Collection::size).sum() : 0); + return result; } @Override @@ -218,91 +150,19 @@ public Map>> getTestManagementTests LOGGER.debug("Test management file path not provided, returning empty"); return Collections.emptyMap(); } - LOGGER.debug("Reading test management data from {}", testManagementPath); - try (BufferedSource source = Okio.buffer(Okio.source(testManagementPath))) { - TestManagementEnvelope envelope = testManagementAdapter.fromJson(source); - if (envelope != null && envelope.data != null && envelope.data.attributes != null) { - return parseTestManagementTests(envelope.data.attributes); - } + Envelope envelope = + readEnvelope(testManagementPath, testManagementAdapter); + if (envelope == null || envelope.data == null || envelope.data.attributes == null) { + return Collections.emptyMap(); } - return Collections.emptyMap(); + return envelope.data.attributes.toTestFQNsBySetting(); } - private Map>> parseTestManagementTests( - TestManagementTestsDto dto) { - Map> quarantined = new HashMap<>(); - Map> disabled = new HashMap<>(); - Map> attemptToFix = new HashMap<>(); - - for (Map.Entry moduleEntry : - dto.getModules().entrySet()) { - String moduleName = moduleEntry.getKey(); - Map suites = moduleEntry.getValue().getSuites(); - - for (Map.Entry suiteEntry : suites.entrySet()) { - String suiteName = suiteEntry.getKey(); - Map tests = suiteEntry.getValue().getTests(); - - for (Map.Entry testEntry : tests.entrySet()) { - String testName = testEntry.getKey(); - TestManagementTestsDto.Properties props = testEntry.getValue(); - TestFQN fqn = new TestFQN(suiteName, testName); - - if (props.isQuarantined()) { - quarantined.computeIfAbsent(moduleName, k -> new HashSet<>()).add(fqn); - } - if (props.isDisabled()) { - disabled.computeIfAbsent(moduleName, k -> new HashSet<>()).add(fqn); - } - if (props.isAttemptToFix()) { - attemptToFix.computeIfAbsent(moduleName, k -> new HashSet<>()).add(fqn); - } - } - } + @Nullable + private static T readEnvelope(Path path, JsonAdapter adapter) throws IOException { + try (BufferedSource source = Okio.buffer(Okio.source(path))) { + return adapter.fromJson(source); } - - Map>> result = new HashMap<>(); - result.put(TestSetting.QUARANTINED, quarantined); - result.put(TestSetting.DISABLED, disabled); - result.put(TestSetting.ATTEMPT_TO_FIX, attemptToFix); - return result; - } - - // Settings envelope: { "data": { "attributes": CiVisibilitySettings } } - static final class SettingsEnvelope { - DataDto data; - } - - // Known tests envelope: { "data": { "attributes": { "tests": ... } } } - static final class KnownTestsEnvelope { - DataDto data; - } - - // Test management envelope: { "data": { "attributes": TestManagementTestsDto } } - static final class TestManagementEnvelope { - DataDto data; - } - - static final class DataDto { - String id; - String type; - T attributes; - } - - static final class KnownTestsAttributes { - Map>> tests; - } - - // Skippable/flaky tests envelope: { "data": [...], "meta": { ... } } - static final class TestIdentifiersEnvelope { - Collection data; - @Nullable MetaDto meta; - } - - static final class TestIdentifierDataDto { - String id; - String type; - TestIdentifierJson attributes; } } diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/MetaDto.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/MetaDto.java deleted file mode 100644 index ace87a71941..00000000000 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/MetaDto.java +++ /dev/null @@ -1,58 +0,0 @@ -package datadog.trace.civisibility.config; - -import com.squareup.moshi.FromJson; -import com.squareup.moshi.ToJson; -import java.io.File; -import java.util.Base64; -import java.util.BitSet; -import java.util.HashMap; -import java.util.Map; -import javax.annotation.Nullable; - -final class MetaDto { - - @Nullable final String correlationId; - @Nullable final Map coverage; - - MetaDto(@Nullable String correlationId, @Nullable Map coverage) { - this.correlationId = correlationId; - this.coverage = coverage; - } - - static final class JsonAdapter { - - static final JsonAdapter INSTANCE = new JsonAdapter(); - - @SuppressWarnings("unchecked") - @FromJson - public MetaDto fromJson(Map json) { - if (json == null) { - return null; - } - - Map coverage; - Map encodedCoverage = (Map) json.get("coverage"); - if (encodedCoverage != null) { - coverage = new HashMap<>(); - for (Map.Entry e : encodedCoverage.entrySet()) { - String relativeSourceFilePath = e.getKey(); - String normalizedPath = - relativeSourceFilePath.startsWith(File.separator) - ? relativeSourceFilePath.substring(1) - : relativeSourceFilePath; - byte[] decodedLines = Base64.getDecoder().decode(e.getValue()); - coverage.put(normalizedPath, BitSet.valueOf(decodedLines)); - } - } else { - coverage = null; - } - - return new MetaDto((String) json.get("correlation_id"), coverage); - } - - @ToJson - public Map toJson(MetaDto metaDto) { - throw new UnsupportedOperationException(); - } - } -} diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/SkippableTests.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/SkippableTests.java index 861bcfde0a0..9e146766d6f 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/SkippableTests.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/SkippableTests.java @@ -2,8 +2,13 @@ import datadog.trace.api.civisibility.config.TestIdentifier; import datadog.trace.api.civisibility.config.TestMetadata; +import datadog.trace.civisibility.config.api.dto.Data; +import datadog.trace.civisibility.config.api.dto.MultiEnvelope; +import datadog.trace.civisibility.config.api.dto.request.TracerEnvironment; +import datadog.trace.civisibility.config.api.dto.response.TestIdentifierJson; import java.util.BitSet; import java.util.Collections; +import java.util.HashMap; import java.util.Map; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -40,4 +45,30 @@ public Map> getIdentifiersByModule() { public Map getCoveredLinesByRelativeSourcePath() { return coveredLinesByRelativeSourcePath; } + + /** + * Builds a {@code SkippableTests} from the backend response envelope (or its file-based + * equivalent), grouping identifiers by module and pulling correlation id and coverage from the + * envelope meta. + */ + public static SkippableTests from( + MultiEnvelope envelope, TracerEnvironment tracerEnvironment) { + Map> identifiersByModule = new HashMap<>(); + for (Data entry : envelope.data) { + TestIdentifierJson identifier = entry.attributes; + if (identifier == null) { + continue; + } + identifiersByModule + .computeIfAbsent(identifier.resolveModuleName(tracerEnvironment), k -> new HashMap<>()) + .put(identifier.toTestIdentifier(), identifier.toTestMetadata()); + } + + String correlationId = envelope.meta != null ? envelope.meta.correlationId : null; + Map coverage = + envelope.meta != null && envelope.meta.coverage != null + ? envelope.meta.coverage + : Collections.emptyMap(); + return new SkippableTests(correlationId, identifiersByModule, coverage); + } } diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/TestIdentifierJson.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/TestIdentifierJson.java deleted file mode 100644 index a6a7b8f932b..00000000000 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/TestIdentifierJson.java +++ /dev/null @@ -1,58 +0,0 @@ -package datadog.trace.civisibility.config; - -import com.squareup.moshi.Json; -import datadog.trace.api.civisibility.config.Configurations; -import datadog.trace.api.civisibility.config.TestIdentifier; -import datadog.trace.api.civisibility.config.TestMetadata; - -public final class TestIdentifierJson { - - private final String suite; - private final String name; - private final String parameters; - private final Configurations configurations; - - @Json(name = "_missing_line_code_coverage") - private final boolean missingLineCodeCoverage; - - public TestIdentifierJson( - String suite, - String name, - String parameters, - Configurations configurations, - boolean missingLineCodeCoverage) { - this.suite = suite; - this.name = name; - this.parameters = parameters; - this.configurations = configurations; - this.missingLineCodeCoverage = missingLineCodeCoverage; - } - - public Configurations getConfigurations() { - return configurations; - } - - public boolean isMissingLineCodeCoverage() { - return missingLineCodeCoverage; - } - - public String getName() { - return name; - } - - public String getParameters() { - return parameters; - } - - public String getSuite() { - return suite; - } - - public TestIdentifier toTestIdentifier() { - return new TestIdentifier(suite, name, parameters); - } - - public TestMetadata toTestMetadata() { - return new TestMetadata(missingLineCodeCoverage); - } -} diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/TestManagementTestsDto.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/TestManagementTestsDto.java deleted file mode 100644 index 54293b436b4..00000000000 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/TestManagementTestsDto.java +++ /dev/null @@ -1,48 +0,0 @@ -package datadog.trace.civisibility.config; - -import java.util.Collections; -import java.util.Map; -import javax.annotation.Nullable; - -final class TestManagementTestsDto { - - @Nullable Map modules; - - Map getModules() { - return modules != null ? modules : Collections.emptyMap(); - } - - static final class Properties { - @Nullable Map properties; - - boolean isQuarantined() { - return properties != null - && properties.getOrDefault(TestSetting.QUARANTINED.asString(), false); - } - - boolean isDisabled() { - return properties != null && properties.getOrDefault(TestSetting.DISABLED.asString(), false); - } - - boolean isAttemptToFix() { - return properties != null - && properties.getOrDefault(TestSetting.ATTEMPT_TO_FIX.asString(), false); - } - } - - static final class Tests { - @Nullable Map tests; - - Map getTests() { - return tests != null ? tests : Collections.emptyMap(); - } - } - - static final class Suites { - @Nullable Map suites; - - Map getSuites() { - return suites != null ? suites : Collections.emptyMap(); - } - } -} diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/ConfigurationApiMoshi.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/ConfigurationApiMoshi.java new file mode 100644 index 00000000000..7cc2efcb749 --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/ConfigurationApiMoshi.java @@ -0,0 +1,28 @@ +package datadog.trace.civisibility.config.api.dto; + +import com.squareup.moshi.Moshi; +import datadog.trace.civisibility.config.CiVisibilitySettings; +import datadog.trace.civisibility.config.ConfigurationsJsonAdapter; +import datadog.trace.civisibility.config.EarlyFlakeDetectionSettings; +import datadog.trace.civisibility.config.TestManagementSettings; +import datadog.trace.civisibility.config.api.dto.response.Meta; + +/** + * Builds the shared Moshi instance used to (de)serialize the Configuration API wire DTOs. Both the + * HTTP and file-based implementations rely on the same envelope structure, so they share the same + * set of registered adapters. + */ +public final class ConfigurationApiMoshi { + + private ConfigurationApiMoshi() {} + + public static Moshi create() { + return new Moshi.Builder() + .add(ConfigurationsJsonAdapter.INSTANCE) + .add(CiVisibilitySettings.JsonAdapter.INSTANCE) + .add(EarlyFlakeDetectionSettings.JsonAdapter.INSTANCE) + .add(TestManagementSettings.JsonAdapter.INSTANCE) + .add(Meta.JsonAdapter.INSTANCE) + .build(); + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/Data.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/Data.java new file mode 100644 index 00000000000..840be14aa85 --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/Data.java @@ -0,0 +1,13 @@ +package datadog.trace.civisibility.config.api.dto; + +public final class Data { + public final String id; + public final String type; + public final T attributes; + + public Data(String id, String type, T attributes) { + this.id = id; + this.type = type; + this.attributes = attributes; + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/Envelope.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/Envelope.java new file mode 100644 index 00000000000..956dc61df2f --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/Envelope.java @@ -0,0 +1,9 @@ +package datadog.trace.civisibility.config.api.dto; + +public final class Envelope { + public final Data data; + + public Envelope(Data data) { + this.data = data; + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/MultiEnvelope.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/MultiEnvelope.java new file mode 100644 index 00000000000..2138be6960a --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/MultiEnvelope.java @@ -0,0 +1,15 @@ +package datadog.trace.civisibility.config.api.dto; + +import datadog.trace.civisibility.config.api.dto.response.Meta; +import java.util.Collection; +import javax.annotation.Nullable; + +public final class MultiEnvelope { + public final Collection> data; + @Nullable public final Meta meta; + + public MultiEnvelope(Collection> data, @Nullable Meta meta) { + this.data = data; + this.meta = meta; + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/PageInfo.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/PageInfo.java new file mode 100644 index 00000000000..045190cf7fb --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/PageInfo.java @@ -0,0 +1,33 @@ +package datadog.trace.civisibility.config.api.dto; + +import com.squareup.moshi.Json; +import javax.annotation.Nullable; + +public final class PageInfo { + + private PageInfo() {} + + public static final class Request { + @Json(name = "page_state") + @Nullable + public final String pageState; + + public Request(@Nullable String pageState) { + this.pageState = pageState; + } + } + + public static final class Response { + public final String cursor; + public final int size; + + @Json(name = "has_next") + public final boolean hasNext; + + public Response(String cursor, int size, boolean hasNext) { + this.cursor = cursor; + this.size = size; + this.hasNext = hasNext; + } + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/request/KnownTestsRequest.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/request/KnownTestsRequest.java new file mode 100644 index 00000000000..df86c7c76f9 --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/request/KnownTestsRequest.java @@ -0,0 +1,23 @@ +package datadog.trace.civisibility.config.api.dto.request; + +import com.squareup.moshi.Json; +import datadog.trace.civisibility.config.api.dto.PageInfo; +import javax.annotation.Nullable; + +public final class KnownTestsRequest { + @Json(name = "repository_url") + public final String repositoryUrl; + + public final String service; + public final String env; + + @Json(name = "page_info") + public final PageInfo.Request pageInfo; + + public KnownTestsRequest(TracerEnvironment tracerEnvironment, @Nullable String pageState) { + this.repositoryUrl = tracerEnvironment.getRepositoryUrl(); + this.service = tracerEnvironment.getService(); + this.env = tracerEnvironment.getEnv(); + this.pageInfo = new PageInfo.Request(pageState); + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/request/TestManagementRequest.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/request/TestManagementRequest.java new file mode 100644 index 00000000000..b6d411d66ab --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/request/TestManagementRequest.java @@ -0,0 +1,24 @@ +package datadog.trace.civisibility.config.api.dto.request; + +import com.squareup.moshi.Json; + +public final class TestManagementRequest { + @Json(name = "repository_url") + public final String repositoryUrl; + + @Json(name = "commit_message") + public final String commitMessage; + + public final String module; + public final String sha; + public final String branch; + + public TestManagementRequest( + String repositoryUrl, String commitMessage, String module, String sha, String branch) { + this.repositoryUrl = repositoryUrl; + this.commitMessage = commitMessage; + this.module = module; + this.sha = sha; + this.branch = branch; + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/TracerEnvironment.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/request/TracerEnvironment.java similarity index 98% rename from dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/TracerEnvironment.java rename to dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/request/TracerEnvironment.java index c06210123a9..b609279c909 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/TracerEnvironment.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/request/TracerEnvironment.java @@ -1,4 +1,4 @@ -package datadog.trace.civisibility.config; +package datadog.trace.civisibility.config.api.dto.request; import com.squareup.moshi.Json; import datadog.trace.api.civisibility.config.Configurations; diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/response/KnownTestsResponse.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/response/KnownTestsResponse.java new file mode 100644 index 00000000000..c6d4bdb22f4 --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/response/KnownTestsResponse.java @@ -0,0 +1,64 @@ +package datadog.trace.civisibility.config.api.dto.response; + +import com.squareup.moshi.Json; +import datadog.trace.api.civisibility.config.TestFQN; +import datadog.trace.civisibility.config.api.dto.PageInfo; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import javax.annotation.Nullable; + +public final class KnownTestsResponse { + public final Map>> tests; + + @Json(name = "page_info") + public final PageInfo.Response pageInfo; + + public KnownTestsResponse( + Map>> tests, PageInfo.Response pageInfo) { + this.tests = tests; + this.pageInfo = pageInfo; + } + + public boolean hasNextPage() { + return pageInfo != null && pageInfo.hasNext; + } + + @Nullable + public Integer getPageSize() { + return pageInfo != null ? pageInfo.size : null; + } + + @Nullable + public String getNextPageCursor() { + return pageInfo != null ? pageInfo.cursor : null; + } + + /** + * Flattens a {@code module -> suite -> [testName]} map into {@code module -> Set}. + * Returns {@code null} when the input contains no tests so that callers can disable downstream + * features that rely on known tests being available. + */ + @Nullable + public static Map> toTestFQNsByModule( + Map>> tests) { + int totalTests = 0; + Map> testsByModule = new HashMap<>(); + for (Map.Entry>> moduleEntry : tests.entrySet()) { + String moduleName = moduleEntry.getKey(); + for (Map.Entry> suiteEntry : moduleEntry.getValue().entrySet()) { + String suiteName = suiteEntry.getKey(); + List testNames = suiteEntry.getValue(); + totalTests += testNames.size(); + for (String testName : testNames) { + testsByModule + .computeIfAbsent(moduleName, k -> new HashSet<>()) + .add(new TestFQN(suiteName, testName)); + } + } + } + return totalTests > 0 ? testsByModule : null; + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/response/Meta.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/response/Meta.java new file mode 100644 index 00000000000..db52634ebb7 --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/response/Meta.java @@ -0,0 +1,58 @@ +package datadog.trace.civisibility.config.api.dto.response; + +import com.squareup.moshi.FromJson; +import com.squareup.moshi.ToJson; +import java.io.File; +import java.util.Base64; +import java.util.BitSet; +import java.util.HashMap; +import java.util.Map; +import javax.annotation.Nullable; + +public final class Meta { + + @Nullable public final String correlationId; + @Nullable public final Map coverage; + + public Meta(@Nullable String correlationId, @Nullable Map coverage) { + this.correlationId = correlationId; + this.coverage = coverage; + } + + public static final class JsonAdapter { + + public static final JsonAdapter INSTANCE = new JsonAdapter(); + + @SuppressWarnings("unchecked") + @FromJson + public Meta fromJson(Map json) { + if (json == null) { + return null; + } + + Map coverage; + Map encodedCoverage = (Map) json.get("coverage"); + if (encodedCoverage != null) { + coverage = new HashMap<>(); + for (Map.Entry e : encodedCoverage.entrySet()) { + String relativeSourceFilePath = e.getKey(); + String normalizedPath = + relativeSourceFilePath.startsWith(File.separator) + ? relativeSourceFilePath.substring(1) + : relativeSourceFilePath; + byte[] decodedLines = Base64.getDecoder().decode(e.getValue()); + coverage.put(normalizedPath, BitSet.valueOf(decodedLines)); + } + } else { + coverage = null; + } + + return new Meta((String) json.get("correlation_id"), coverage); + } + + @ToJson + public Map toJson(Meta meta) { + throw new UnsupportedOperationException(); + } + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/response/TestIdentifierJson.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/response/TestIdentifierJson.java new file mode 100644 index 00000000000..072acd021ab --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/response/TestIdentifierJson.java @@ -0,0 +1,93 @@ +package datadog.trace.civisibility.config.api.dto.response; + +import com.squareup.moshi.Json; +import datadog.trace.api.civisibility.config.Configurations; +import datadog.trace.api.civisibility.config.TestFQN; +import datadog.trace.api.civisibility.config.TestIdentifier; +import datadog.trace.api.civisibility.config.TestMetadata; +import datadog.trace.civisibility.config.api.dto.Data; +import datadog.trace.civisibility.config.api.dto.request.TracerEnvironment; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; + +public final class TestIdentifierJson { + + private final String suite; + private final String name; + private final String parameters; + private final Configurations configurations; + + @Json(name = "_missing_line_code_coverage") + private final boolean missingLineCodeCoverage; + + public TestIdentifierJson( + String suite, + String name, + String parameters, + Configurations configurations, + boolean missingLineCodeCoverage) { + this.suite = suite; + this.name = name; + this.parameters = parameters; + this.configurations = configurations; + this.missingLineCodeCoverage = missingLineCodeCoverage; + } + + public Configurations getConfigurations() { + return configurations; + } + + public boolean isMissingLineCodeCoverage() { + return missingLineCodeCoverage; + } + + public String getName() { + return name; + } + + public String getParameters() { + return parameters; + } + + public String getSuite() { + return suite; + } + + public TestIdentifier toTestIdentifier() { + return new TestIdentifier(suite, name, parameters); + } + + public TestMetadata toTestMetadata() { + return new TestMetadata(missingLineCodeCoverage); + } + + /** + * Returns the module (test bundle) this identifier belongs to, preferring its own configurations + * when they specify a test bundle and otherwise falling back to the request-level configurations. + */ + public String resolveModuleName(TracerEnvironment tracerEnvironment) { + Configurations requestConf = tracerEnvironment.getConfigurations(); + return (configurations != null && configurations.getTestBundle() != null + ? configurations + : requestConf) + .getTestBundle(); + } + + /** Groups the given test identifiers into a {@code module -> Set} map. */ + public static Map> toTestFQNsByModule( + Collection> data, TracerEnvironment tracerEnvironment) { + Map> testsByModule = new HashMap<>(); + for (Data entry : data) { + TestIdentifierJson identifier = entry.attributes; + if (identifier == null) { + continue; + } + testsByModule + .computeIfAbsent(identifier.resolveModuleName(tracerEnvironment), k -> new HashSet<>()) + .add(identifier.toTestIdentifier().toFQN()); + } + return testsByModule; + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/response/TestManagementTestsResponse.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/response/TestManagementTestsResponse.java new file mode 100644 index 00000000000..1370f9de162 --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/config/api/dto/response/TestManagementTestsResponse.java @@ -0,0 +1,109 @@ +package datadog.trace.civisibility.config.api.dto.response; + +import datadog.trace.api.civisibility.config.TestFQN; +import datadog.trace.civisibility.config.TestSetting; +import java.util.Collection; +import java.util.Collections; +import java.util.EnumMap; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import javax.annotation.Nullable; + +public final class TestManagementTestsResponse { + + @Nullable public Map modules; + + public Map getModules() { + return modules != null ? modules : Collections.emptyMap(); + } + + /** + * Returns the contained tests grouped by {@link TestSetting} and module. The result always + * contains an entry for {@link TestSetting#QUARANTINED}, {@link TestSetting#DISABLED} and {@link + * TestSetting#ATTEMPT_TO_FIX} (the inner map may be empty for any of them). + */ + public Map>> toTestFQNsBySetting() { + Map>> result = new EnumMap<>(TestSetting.class); + result.put(TestSetting.QUARANTINED, new HashMap<>()); + result.put(TestSetting.DISABLED, new HashMap<>()); + result.put(TestSetting.ATTEMPT_TO_FIX, new HashMap<>()); + + for (Map.Entry moduleEntry : getModules().entrySet()) { + String moduleName = moduleEntry.getKey(); + for (Map.Entry suiteEntry : moduleEntry.getValue().getSuites().entrySet()) { + String suiteName = suiteEntry.getKey(); + for (Map.Entry testEntry : + suiteEntry.getValue().getTests().entrySet()) { + String testName = testEntry.getKey(); + Properties properties = testEntry.getValue(); + TestFQN fqn = new TestFQN(suiteName, testName); + if (properties.isQuarantined()) { + result + .get(TestSetting.QUARANTINED) + .computeIfAbsent(moduleName, k -> new HashSet<>()) + .add(fqn); + } + if (properties.isDisabled()) { + result + .get(TestSetting.DISABLED) + .computeIfAbsent(moduleName, k -> new HashSet<>()) + .add(fqn); + } + if (properties.isAttemptToFix()) { + result + .get(TestSetting.ATTEMPT_TO_FIX) + .computeIfAbsent(moduleName, k -> new HashSet<>()) + .add(fqn); + } + } + } + } + + return result; + } + + public int totalTestsCount() { + int count = 0; + for (Suites suites : getModules().values()) { + for (Tests tests : suites.getSuites().values()) { + count += tests.getTests().size(); + } + } + return count; + } + + public static final class Properties { + @Nullable public Map properties; + + public boolean isQuarantined() { + return properties != null + && properties.getOrDefault(TestSetting.QUARANTINED.asString(), false); + } + + public boolean isDisabled() { + return properties != null && properties.getOrDefault(TestSetting.DISABLED.asString(), false); + } + + public boolean isAttemptToFix() { + return properties != null + && properties.getOrDefault(TestSetting.ATTEMPT_TO_FIX.asString(), false); + } + } + + public static final class Tests { + @Nullable public Map tests; + + public Map getTests() { + return tests != null ? tests : Collections.emptyMap(); + } + } + + public static final class Suites { + @Nullable public Map suites; + + public Map getSuites() { + return suites != null ? suites : Collections.emptyMap(); + } + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/coverage/line/ExecutionDataAdapter.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/coverage/line/ExecutionDataAdapter.java index 6441eb8ded3..75c9b81fe89 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/coverage/line/ExecutionDataAdapter.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/coverage/line/ExecutionDataAdapter.java @@ -1,7 +1,5 @@ package datadog.trace.civisibility.coverage.line; -import org.jacoco.core.data.ExecutionData; - public class ExecutionDataAdapter { private final long classId; private final String className; @@ -18,6 +16,14 @@ public String getClassName() { return className; } + long getClassId() { + return classId; + } + + boolean[] getProbeActivations() { + return probeActivations; + } + void record(int probeId) { probeActivations[probeId] = true; } @@ -28,8 +34,4 @@ ExecutionDataAdapter merge(ExecutionDataAdapter other) { } return this; } - - ExecutionData toExecutionData() { - return new ExecutionData(classId, className, probeActivations); - } } diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/coverage/line/LineCoverageStore.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/coverage/line/LineCoverageStore.java index 647f28ca181..bde89521dd5 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/coverage/line/LineCoverageStore.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/coverage/line/LineCoverageStore.java @@ -22,9 +22,11 @@ import java.util.List; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicLong; import java.util.function.Function; import javax.annotation.Nullable; import org.jacoco.core.analysis.Analyzer; +import org.jacoco.core.data.ExecutionData; import org.jacoco.core.data.ExecutionDataStore; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -37,16 +39,41 @@ public class LineCoverageStore extends ConcurrentCoverageStore { private static final Logger log = LoggerFactory.getLogger(LineCoverageStore.class); + /** + * Upper bound on the approximate memory retained by the analysis cache. Coverage stays correct + * beyond it (analysis just isn't cached), this only guards memory for pathologically large + * suites. Bounding by bytes (rather than entry count) is what keeps a class with many probes, + * covered by many distinct probe sets, from retaining large arrays for the whole module lifetime. + */ + private static final long MAX_ANALYSIS_CACHE_BYTES = 64L * 1024 * 1024; + + /** + * Approximate fixed cost of one cache entry beyond its variable bit data: the {@link + * AnalysisCacheKey} and both {@link BitSet} objects (with their {@code long[]} + array headers) + * plus the {@code ConcurrentHashMap} node. Deliberately generous so small entries aren't + * undercounted and the byte bound stays a real ceiling. + */ + private static final int APPROX_ENTRY_OVERHEAD_BYTES = 160; + private final CiVisibilityMetricCollector metrics; private final SourcePathResolver sourcePathResolver; + // Module-wide cache: (class id + probe set) -> covered lines, shared across tests so a class + // covered identically by many tests is parsed by Jacoco's Analyzer only once. + private final Map analysisCache; + // Approximate bytes retained by analysisCache, so the cache is bounded by size, not entry count. + private final AtomicLong analysisCacheBytes; private LineCoverageStore( Function probesFactory, CiVisibilityMetricCollector metrics, - SourcePathResolver sourcePathResolver) { + SourcePathResolver sourcePathResolver, + Map analysisCache, + AtomicLong analysisCacheBytes) { super(probesFactory); this.metrics = metrics; this.sourcePathResolver = sourcePathResolver; + this.analysisCache = analysisCache; + this.analysisCacheBytes = analysisCacheBytes; } @Nullable @@ -83,24 +110,9 @@ protected TestReport report( } String sourcePath = sourcePaths.iterator().next(); - try (InputStream is = Utils.getClassStream(clazz)) { - BitSet coveredLines = - coveredLinesBySourcePath.computeIfAbsent(sourcePath, key -> new BitSet()); - ExecutionDataStore store = new ExecutionDataStore(); - store.put(executionDataAdapter.toExecutionData()); - - // TODO optimize this part to avoid parsing - // the same class multiple times for different test cases - Analyzer analyzer = new Analyzer(store, new SourceAnalyzer(coveredLines)); - analyzer.analyzeClass(is, null); - - } catch (Exception exception) { - log.debug( - "Skipping coverage reporting for {} ({}) because of error", - className, - sourcePath, - exception); - metrics.add(CiVisibilityCountMetric.CODE_COVERAGE_ERRORS, 1); + BitSet coveredLines = analyzeClass(clazz, executionDataAdapter); + if (coveredLines != null) { + coveredLinesBySourcePath.computeIfAbsent(sourcePath, key -> new BitSet()).or(coveredLines); } } @@ -132,9 +144,110 @@ protected TestReport report( return report; } + /** + * Resolves the covered lines for a class given a test's probe activations. Parsing the class with + * Jacoco's {@link Analyzer} is the dominant cost of reporting, and the result depends only on the + * class bytecode and the probe set, so it is memoized: the same class covered identically by + * different tests is parsed once. + * + * @return the covered lines, or {@code null} if the class could not be analyzed + */ + @Nullable + private BitSet analyzeClass(Class clazz, ExecutionDataAdapter executionDataAdapter) { + long classId = executionDataAdapter.getClassId(); + // Snapshot the activations once and use the same snapshot for both the cache key and the + // analysis. The per-test array is mutable and a propagated/background thread may record a late + // probe while report() runs; sharing one snapshot ensures the cached covered lines always match + // the key's probe set, so a late activation can't poison the entry for later tests. + boolean[] probes = executionDataAdapter.getProbeActivations().clone(); + AnalysisCacheKey key = new AnalysisCacheKey(classId, probes); + BitSet cached = analysisCache.get(key); + if (cached != null) { + return cached; + } + + try (InputStream is = Utils.getClassStream(clazz)) { + BitSet coveredLines = new BitSet(); + ExecutionDataStore store = new ExecutionDataStore(); + store.put(new ExecutionData(classId, executionDataAdapter.getClassName(), probes)); + Analyzer analyzer = new Analyzer(store, new SourceAnalyzer(coveredLines)); + analyzer.analyzeClass(is, null); + + // Reserve the entry's weight before inserting so concurrent inserts near the limit can't + // collectively overshoot the bound; release the reservation if we exceed it or another thread + // cached the class first. + long entryBytes = + APPROX_ENTRY_OVERHEAD_BYTES + key.packedBytes() + (coveredLines.size() >>> 3); + if (analysisCacheBytes.addAndGet(entryBytes) <= MAX_ANALYSIS_CACHE_BYTES) { + if (analysisCache.putIfAbsent(key, coveredLines) != null) { + analysisCacheBytes.addAndGet(-entryBytes); + } + } else { + analysisCacheBytes.addAndGet(-entryBytes); + } + return coveredLines; + + } catch (Exception exception) { + log.debug( + "Skipping coverage reporting for {} because of error", + executionDataAdapter.getClassName(), + exception); + metrics.add(CiVisibilityCountMetric.CODE_COVERAGE_ERRORS, 1); + return null; + } + } + + /** + * Cache key identifying a class (by Jacoco class id) covered by a specific set of probes. The + * probe activations are bit-packed into a {@link BitSet} rather than retaining the test's full + * {@code boolean[]} (1 byte/element), so a cached key uses ~8x less memory. Equality is exact: + * two keys match iff the same class was covered by the same set of probe ids. + */ + static final class AnalysisCacheKey { + private final long classId; + private final BitSet probes; + private final int hash; + + AnalysisCacheKey(long classId, boolean[] probeActivations) { + this.classId = classId; + BitSet bits = new BitSet(probeActivations.length); + for (int i = 0; i < probeActivations.length; i++) { + if (probeActivations[i]) { + bits.set(i); + } + } + this.probes = bits; + this.hash = 31 * Long.hashCode(classId) + bits.hashCode(); + } + + /** Bytes of the packed probe bits (the variable part of the retained key). */ + int packedBytes() { + return probes.size() >>> 3; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof AnalysisCacheKey)) { + return false; + } + AnalysisCacheKey other = (AnalysisCacheKey) o; + return classId == other.classId && hash == other.hash && probes.equals(other.probes); + } + + @Override + public int hashCode() { + return hash; + } + } + public static final class Factory implements CoverageStore.Factory { private final Map probeCounts = new ConcurrentHashMap<>(); + private final Map analysisCache = new ConcurrentHashMap<>(); + private final AtomicLong analysisCacheBytes = new AtomicLong(); private final CiVisibilityMetricCollector metrics; private final SourcePathResolver sourcePathResolver; @@ -146,7 +259,8 @@ public Factory(CiVisibilityMetricCollector metrics, SourcePathResolver sourcePat @Override public CoverageStore create(@Nullable TestIdentifier testIdentifier) { - return new LineCoverageStore(this::createProbes, metrics, sourcePathResolver); + return new LineCoverageStore( + this::createProbes, metrics, sourcePathResolver, analysisCache, analysisCacheBytes); } private LineProbes createProbes(boolean isTestThread) { diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/coverage/report/CoverageReportUploader.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/coverage/report/CoverageReportUploader.java index 0d0ffef37c9..7777a972a2a 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/coverage/report/CoverageReportUploader.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/coverage/report/CoverageReportUploader.java @@ -16,7 +16,10 @@ import java.io.InputStream; import java.lang.reflect.Type; import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.zip.GZIPOutputStream; import okhttp3.MediaType; @@ -28,26 +31,32 @@ public class CoverageReportUploader { private final BackendApi backendApi; private final Map ciTags; + private final List flags; private final CiVisibilityMetricCollector metricCollector; - private final JsonAdapter> eventAdapter; + private final JsonAdapter> eventAdapter; public CoverageReportUploader( BackendApi backendApi, Map ciTags, + List flags, CiVisibilityMetricCollector metricCollector) { this.backendApi = backendApi; this.ciTags = ciTags; + this.flags = Collections.unmodifiableList(new ArrayList<>(flags)); this.metricCollector = metricCollector; Moshi moshi = new Moshi.Builder().build(); - Type type = Types.newParameterizedType(Map.class, String.class, String.class); + Type type = Types.newParameterizedType(Map.class, String.class, Object.class); eventAdapter = moshi.adapter(type); } public void upload(String format, InputStream reportStream) throws IOException { - Map event = new HashMap<>(ciTags); + Map event = new HashMap<>(ciTags); event.put("format", format); event.put("type", "coverage_report"); + if (!flags.isEmpty()) { + event.put("report.flags", flags); + } String eventJson = eventAdapter.toJson(event); RequestBody eventBody = jsonRequestBodyOf(eventJson.getBytes(StandardCharsets.UTF_8)); diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/decorator/TestDecoratorImpl.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/decorator/TestDecoratorImpl.java index de2ab526728..26b278e0587 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/decorator/TestDecoratorImpl.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/decorator/TestDecoratorImpl.java @@ -51,7 +51,7 @@ public AgentSpan afterStart(final AgentSpan span) { span.setTag(DDTags.HOST_VCPU_COUNT, cpuCount); span.setTag(Tags.TEST_TYPE, testType()); span.setTag(Tags.COMPONENT, component()); - span.context().setIntegrationName(component()); + span.spanContext().setIntegrationName(component()); span.setTag(Tags.TEST_SESSION_NAME, sessionName); for (final Map.Entry ciTag : ciTags.entrySet()) { diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/AbstractTestModule.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/AbstractTestModule.java index 6dfc5137337..9fa24c5be17 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/AbstractTestModule.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/AbstractTestModule.java @@ -7,6 +7,7 @@ import datadog.trace.api.civisibility.telemetry.CiVisibilityCountMetric; import datadog.trace.api.civisibility.telemetry.CiVisibilityMetricCollector; import datadog.trace.api.civisibility.telemetry.tag.EventType; +import datadog.trace.api.civisibility.telemetry.tag.IsAndroid; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; @@ -114,6 +115,10 @@ public void end(@Nullable Long endTime) { span.finish(); } - metricCollector.add(CiVisibilityCountMetric.EVENT_FINISHED, 1, EventType.MODULE); + metricCollector.add( + CiVisibilityCountMetric.EVENT_FINISHED, + 1, + EventType.MODULE, + span.getTag(Tags.TEST_IS_ANDROID) != null ? IsAndroid.TRUE : null); } } diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/AbstractTestSession.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/AbstractTestSession.java index cb17381f420..d5758b74be3 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/AbstractTestSession.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/AbstractTestSession.java @@ -19,6 +19,7 @@ import datadog.trace.api.civisibility.telemetry.tag.FailFastTestOrderEnabled; import datadog.trace.api.civisibility.telemetry.tag.FailedTestReplayEnabled; import datadog.trace.api.civisibility.telemetry.tag.HasCodeowner; +import datadog.trace.api.civisibility.telemetry.tag.IsAndroid; import datadog.trace.api.civisibility.telemetry.tag.IsHeadless; import datadog.trace.api.civisibility.telemetry.tag.IsUnsupportedCI; import datadog.trace.api.civisibility.telemetry.tag.Provider; @@ -200,6 +201,9 @@ protected Collection additionalTelemetryTags() { if (span.getTag(DDTags.TEST_HAS_FAILED_TEST_REPLAY) != null) { tags.add(FailedTestReplayEnabled.SessionMetric.TRUE); } + if (span.getTag(Tags.TEST_IS_ANDROID) != null) { + tags.add(IsAndroid.TRUE); + } return tags; } } diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/TestImpl.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/TestImpl.java index 5266de922af..e8f4aaf9f69 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/TestImpl.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/TestImpl.java @@ -22,6 +22,7 @@ import datadog.trace.api.civisibility.telemetry.tag.EventType; import datadog.trace.api.civisibility.telemetry.tag.FailedTestReplayEnabled; import datadog.trace.api.civisibility.telemetry.tag.HasFailedAllRetries; +import datadog.trace.api.civisibility.telemetry.tag.IsAndroidEmulated; import datadog.trace.api.civisibility.telemetry.tag.IsAttemptToFix; import datadog.trace.api.civisibility.telemetry.tag.IsDisabled; import datadog.trace.api.civisibility.telemetry.tag.IsModified; @@ -323,7 +324,8 @@ public void end(@Nullable Long endTime) { span.getTag(Tags.TEST_IS_RUM_ACTIVE) != null ? IsRum.TRUE : null, CIConstants.SELENIUM_BROWSER_DRIVER.equals(span.getTag(Tags.TEST_BROWSER_DRIVER)) ? BrowserDriver.SELENIUM - : null); + : null, + span.getTag(Tags.TEST_ANDROID_API_LEVEL) != null ? IsAndroidEmulated.TRUE : null); } /** diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/buildsystem/BuildSystemSessionImpl.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/buildsystem/BuildSystemSessionImpl.java index de116acf05c..5d050036e9b 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/buildsystem/BuildSystemSessionImpl.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/buildsystem/BuildSystemSessionImpl.java @@ -154,7 +154,7 @@ public BuildSystemModuleImpl testModuleStart( @Nullable JavaAgent jacocoAgent) { ExecutionSettings executionSettings = executionSettingsFactory.create(jvmInfo, moduleName); return new BuildSystemModuleImpl( - span.context(), + span.spanContext(), moduleName, startCommand, startTime, @@ -178,7 +178,7 @@ public BuildSystemModuleImpl testModuleStart( @Override public AgentSpan testTaskStart(String taskName) { - return startSpan("ci_visibility", taskName, span.context()); + return startSpan("ci_visibility", taskName, span.spanContext()); } private void onModuleFinish(AgentSpan moduleSpan) { @@ -194,6 +194,7 @@ private void onModuleFinish(AgentSpan moduleSpan) { TagMergeSpec.of(Tags.TEST_ITR_TESTS_SKIPPING_COUNT, Long::sum), TagMergeSpec.of(DDTags.CI_ITR_TESTS_SKIPPED, Boolean::logicalOr), TagMergeSpec.of(Tags.TEST_TEST_MANAGEMENT_ENABLED, Boolean::logicalOr), + TagMergeSpec.of(Tags.TEST_IS_ANDROID, Boolean::logicalOr), TagMergeSpec.of(DDTags.TEST_HAS_FAILED_TEST_REPLAY, Boolean::logicalOr), TagMergeSpec.of(DDTags.CI_LIBRARY_CONFIGURATION_ERROR_SETTINGS, Boolean::logicalOr), TagMergeSpec.of(DDTags.CI_LIBRARY_CONFIGURATION_ERROR_SKIPPABLE_TESTS, Boolean::logicalOr), diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/headless/HeadlessTestModule.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/headless/HeadlessTestModule.java index 1c111bba967..f17fcd2a4c6 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/headless/HeadlessTestModule.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/headless/HeadlessTestModule.java @@ -170,7 +170,7 @@ public TestSuiteImpl testSuiteStart( boolean parallelized, TestFrameworkInstrumentation instrumentation) { return new TestSuiteImpl( - span.context(), + span.spanContext(), moduleName, testSuiteName, executionStrategy.getExecutionSettings().getItrCorrelationId(), diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/headless/HeadlessTestSession.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/headless/HeadlessTestSession.java index 1024104361c..41edbef64cf 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/headless/HeadlessTestSession.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/headless/HeadlessTestSession.java @@ -67,7 +67,7 @@ public HeadlessTestSession( @Override public HeadlessTestModule testModuleStart(String moduleName, @Nullable Long startTime) { return new HeadlessTestModule( - span.context(), + span.spanContext(), moduleName, startTime, config, diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/manualapi/ManualApiTestModule.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/manualapi/ManualApiTestModule.java index 4b4fb8e8f1f..8ca29a07079 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/manualapi/ManualApiTestModule.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/manualapi/ManualApiTestModule.java @@ -65,7 +65,7 @@ public ManualApiTestSuite testSuiteStart( boolean parallelized) { TestSuiteImpl suite = new TestSuiteImpl( - span.context(), + span.spanContext(), moduleName, testSuiteName, null, diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/manualapi/ManualApiTestSession.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/manualapi/ManualApiTestSession.java index 917bf9ddbc0..728b7d09b21 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/manualapi/ManualApiTestSession.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/domain/manualapi/ManualApiTestSession.java @@ -49,7 +49,7 @@ public ManualApiTestSession( @Override public ManualApiTestModule testModuleStart(String moduleName, @Nullable Long startTime) { return new ManualApiTestModule( - span.context(), + span.spanContext(), moduleName, startTime, config, diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/git/tree/GitDiffParser.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/git/tree/GitDiffParser.java index 374e3a75f6b..e1f8aefdb73 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/git/tree/GitDiffParser.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/git/tree/GitDiffParser.java @@ -1,7 +1,6 @@ package datadog.trace.civisibility.git.tree; import datadog.trace.civisibility.diff.LineDiff; -import edu.umd.cs.findbugs.annotations.NonNull; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -12,6 +11,7 @@ import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; +import javax.annotation.Nonnull; public class GitDiffParser { @@ -20,7 +20,7 @@ public class GitDiffParser { private static final Pattern CHANGED_LINES_PATTERN = Pattern.compile("^@@ -\\d+(,\\d+)? \\+(?\\d+)(,(?\\d+))? @@"); - public static @NonNull LineDiff parse(InputStream input) throws IOException { + public static @Nonnull LineDiff parse(InputStream input) throws IOException { Map linesByRelativePath = new HashMap<>(); BufferedReader bufferedReader = diff --git a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/source/index/RepoIndex.java b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/source/index/RepoIndex.java index 86f47c55eed..76a758d3af6 100644 --- a/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/source/index/RepoIndex.java +++ b/dd-java-agent/agent-ci-visibility/src/main/java/datadog/trace/civisibility/source/index/RepoIndex.java @@ -26,7 +26,7 @@ public class RepoIndex { static final RepoIndex EMPTY = new RepoIndex( - ClassNameTrie.Builder.EMPTY_TRIE, + ClassNameTrie.EMPTY_TRIE, Collections.emptyMap(), Collections.emptyList(), Collections.emptyList()); diff --git a/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/codeowners/CodeownersTest.groovy b/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/codeowners/CodeownersTest.groovy deleted file mode 100644 index b30070f5a1d..00000000000 --- a/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/codeowners/CodeownersTest.groovy +++ /dev/null @@ -1,43 +0,0 @@ -package datadog.trace.civisibility.codeowners - -import com.google.common.base.Charsets -import spock.lang.Specification - -class CodeownersTest extends Specification { - - def "test codeowners matching: #path"() { - setup: - def codeowners = new InputStreamReader(CodeownersTest.getClassLoader().getResourceAsStream("ci/codeowners/CODEOWNERS_sample"), Charsets.UTF_8).withCloseable { reader -> - CodeownersImpl.parse(reader) - } - - when: - def owners = codeowners.getOwners(path) - - then: - owners == expectedOwners - - where: - path | expectedOwners - "MyClass.java" | ["@global-owner1", "@global-owner2"] - "folder/MyClass.java" | ["@global-owner1", "@global-owner2"] - "script.js" | ["@js-owner"] - "inner/folder/script.js" | ["@js-owner"] - "scripts/script.js" | ["@doctocat", "@octocat"] - "scripts/inner/script.js" | ["@doctocat", "@octocat"] - "build/logs/current.log" | ["@doctocat"] - "build/logs/inner/current.log" | ["@doctocat"] - "module/build/logs/current.log" | ["@global-owner1", "@global-owner2"] - "apps/app1.exe" | ["@octocat"] - "apps/inner/app2.exe" | ["@octocat"] - "module/apps/app3.exe" | ["@octocat"] - "docs/intro.doc" | ["@doctocat"] - "docs/important/doc.doc" | ["@doctocat"] - "applications/application" | ["@appowner"] - "applications/module/application" | ["@appowner"] - "applications/github/githubApplication" | [] - "documentation/doc.md" | ["docs@example.com"] - "documentation/inner/doc.md" | ["@global-owner1", "@global-owner2"] - "documentation/inner/doc.txt" | ["@octo-org/octocats"] - } -} diff --git a/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/codeowners/EntryBuilderTest.groovy b/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/codeowners/EntryBuilderTest.groovy deleted file mode 100644 index 28d260b8240..00000000000 --- a/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/codeowners/EntryBuilderTest.groovy +++ /dev/null @@ -1,178 +0,0 @@ -package datadog.trace.civisibility.codeowners - - -import datadog.trace.civisibility.codeowners.matcher.CharacterMatcher -import spock.lang.Specification - -class EntryBuilderTest extends Specification { - - def "test entry #pattern match against #path is #expectedResult"() { - setup: - def matcherFactory = new CharacterMatcher.Factory() - def entry = new EntryBuilder(matcherFactory, pattern + " " + ownersToString(owners)).parse() - def negatedEntry = new EntryBuilder(matcherFactory, "!" + pattern + " " + ownersToString(owners)).parse() - - when: - def result = entry.matcher.consume(path.toCharArray(), 0) >= 0 - def negatedResult = negatedEntry.matcher.consume(path.toCharArray(), 0) >= 0 - - then: - entry.owners == owners - result == expectedResult - negatedResult == !expectedResult - - where: - pattern | owners | path | expectedResult - "someToken" | ["owner"] | "someToken" | true - "someToken" | ["owner"] | "sometoken" | false - "someToken" | ["owner"] | "anotherToken" | false - "someToken" | ["owner"] | "parent/someToken" | true - "someToken" | ["owner"] | "grandparent/parent/someToken" | true - "/someToken" | ["owner"] | "someToken" | true - "/someToken" | ["owner"] | "sometoken" | false - "/someToken" | ["owner"] | "anotherToken" | false - "/someToken" | ["owner"] | "parent/someToken" | false - "/someToken" | ["owner"] | "grandparent/parent/someToken" | false - "someTok?n" | ["owner"] | "someTokkn" | true - "someTok?n" | ["owner"] | "someTok/n" | false - "someTok?n" | ["owner"] | "parent/someTokkn" | true - "someTok?n" | ["owner"] | "grandparent/parent/someTokkn" | true - "/someTok?n" | ["owner"] | "someTokkn" | true - "someTok*n" | ["owner"] | "someTokkn" | true - "someTok*n" | ["owner"] | "someTok/n" | false - "someTok*n" | ["owner"] | "someTokkkkn" | true - "someTok*n" | ["owner"] | "someTokenToken" | true - "someTok*n" | ["owner"] | "someTokenTokkk" | false - "s*meTok*n" | ["owner"] | "someToken" | true - "s*meTok*n" | ["owner"] | "sabcdefghmeTokabcdefgn" | true - "s*meTok*n" | ["owner"] | "sabcdefghmeTokabcdefg" | false - "someTok*n" | ["owner"] | "parent/someTokkn" | true - "someTok*n" | ["owner"] | "grandparent/parent/someTokkn" | true - "/someTok*n" | ["owner"] | "someTokkn" | true - "someTok[a-b]n" | ["owner"] | "someToken" | false - "someTok[a-z]n" | ["owner"] | "someToken" | true - "someTok[a-z]n" | ["owner"] | "someTokEn" | false - "someTok[a-z]n" | ["owner"] | "someTok9n" | false - "someTok[a-zA-Z]n" | ["owner"] | "someToken" | true - "someTok[a-zA-Z]n" | ["owner"] | "someTokEn" | true - "someTok[a-zA-Z]n" | ["owner"] | "someTok9n" | false - "someTok[a-zA-Z0-9]n" | ["owner"] | "someToken" | true - "someTok[a-zA-Z0-9]n" | ["owner"] | "someTokEn" | true - "someTok[a-zA-Z0-9]n" | ["owner"] | "someTok9n" | true - "s*meTok[a-zA-Z0-9]n" | ["owner"] | "smeToken" | true - "s*meTok[a-zA-Z0-9]n" | ["owner"] | "smeTokEn" | true - "s*meTok[a-zA-Z0-9]n" | ["owner"] | "smeTok9n" | true - "s*meTok[a-zA-Z0-9]n" | ["owner"] | "sabcdmeToken" | true - "s*meTok[a-zA-Z0-9]n" | ["owner"] | "sabcdmeTokEn" | true - "s*meTok[a-zA-Z0-9]n" | ["owner"] | "sabcdmeTok9n" | true - "someToken/" | ["owner"] | "someToken" | true - "someToken/" | ["owner"] | "someToken/child" | true - "someToken/" | ["owner"] | "someToken/child/grandChild" | true - "someToken/" | ["owner"] | "parent/someToken" | true - "someToken/" | ["owner"] | "parent/someToken/child" | true - "someToken/" | ["owner"] | "parent/grandParent/someToken/child/grandChild" | true - "/someToken/" | ["owner"] | "someToken" | true - "/someToken/" | ["owner"] | "someToken/child" | true - "/someToken/" | ["owner"] | "someToken/child/grandChild" | true - "/someToken/" | ["owner"] | "parent/someToken" | false - "/someToken/" | ["owner"] | "parent/someToken/child" | false - "/someToken/" | ["owner"] | "parent/grandParent/someToken/child/grandChild" | false - "some/token" | ["owner"] | "some/token" | true - "some/token" | ["owner"] | "parent/some/token" | false - "some/token" | ["owner"] | "some/token/child" | true - "some/token" | ["owner"] | "some/tokenSuffix" | false - "some/token/" | ["owner"] | "some/token/child" | true - "some/token/" | ["owner"] | "parent/some/token/child" | false - "some\\ Token" | ["owner"] | "some Token" | true - "\\#someToken" | ["owner"] | "#someToken" | true - "**/someToken" | ["owner"] | "someToken" | true - "**/someToken" | ["owner"] | "parent/someToken" | true - "**/someToken" | ["owner"] | "grandparent/parent/someToken" | true - "**/someToken" | ["owner"] | "anotherToken" | false - "**/some/token" | ["owner"] | "some/token" | true - "**/some/token" | ["owner"] | "parent/some/token" | true - "**/some/token" | ["owner"] | "grandparent/parent/some/token" | true - "**/some/token/" | ["owner"] | "some/token" | true - "**/some/token/" | ["owner"] | "some/token/child" | true - "**/some/token/" | ["owner"] | "some/token/child/grandchild" | true - "**/some/token/" | ["owner"] | "parent/some/token/child" | true - "**/some/token/" | ["owner"] | "parent/some/different/token" | false - "someToken/**" | ["owner"] | "someToken" | true - "someToken/**" | ["owner"] | "someToken/child" | true - "someToken/**" | ["owner"] | "someToken/child/grandChild" | true - "someToken/**" | ["owner"] | "parent/someToken" | false - "someToken/**" | ["owner"] | "parent/someToken/child" | false - "someToken/**" | ["owner"] | "parent/grandParent/someToken/child/grandChild" | false - "/someToken/**" | ["owner"] | "someToken" | true - "/someToken/**" | ["owner"] | "someToken/child" | true - "/someToken/**" | ["owner"] | "someToken/child/grandChild" | true - "/someToken/**" | ["owner"] | "parent/someToken" | false - "/someToken/**" | ["owner"] | "parent/someToken/child" | false - "/someToken/**" | ["owner"] | "parent/grandParent/someToken/child/grandChild" | false - "some/**/token" | ["owner"] | "some/token" | true - "some/**/token" | ["owner"] | "some/other/token" | true - "some/**/token" | ["owner"] | "some/yet/another/token" | true - "some/**/token" | ["owner"] | "some/yet/another" | false - "some/**/token" | ["owner"] | "yet/another/token" | false - "someToken" | ["owner", "anotherOwner"] | "someToken" | true - "*" | ["owner"] | "someToken" | true - "*" | ["owner"] | "parent/someToken" | true - "*" | ["owner"] | "parent/someToken/child" | true - "*" | ["owner"] | "someFile.java" | true - "**" | ["owner"] | "someToken" | true - "**" | ["owner"] | "parent/someToken" | true - "**" | ["owner"] | "parent/someToken/child" | true - "**" | ["owner"] | "someFile.java" | true - "*.java" | ["owner"] | "someFile.java" | true - "*.java" | ["owner"] | "parent/someFile.java" | true - "*.java" | ["owner"] | "grandparent/parent/someFile.java" | true - "*.java" | ["owner"] | "someFile.js" | false - "*.java" | ["owner"] | "someFile.java17" | false - "readme.md" | ["owner"] | "readme.md" | true - "readme.md" | ["owner"] | "parent/readme.md" | true - "readme.md" | ["owner"] | "readme.md5" | false - "some/*" | ["owner"] | "some/token" | true - "some/*" | ["owner"] | "some/other/token" | false - "some/*" | ["owner"] | "parent/some/token" | false - "some/*" | ["owner"] | "parent/some/other/token" | false - "**/test*.java" | ["owner"] | "test.java" | true - "**/test*.java" | ["owner"] | "testFile.java" | true - "**/test*.java" | ["owner"] | "parent/test.java" | true - "**/test*.java" | ["owner"] | "parent/testFile.java" | true - "**/test*.java" | ["owner"] | "grandparent/parent/test.java" | true - "**/test*.java" | ["owner"] | "grandparent/parent/testFile.java" | true - "\\#someToken" | ["owner"] | "#someToken" | true - } - - private static String ownersToString(Collection owners) { - def result = new StringBuilder() - - for (String owner : owners) { - result += owner + " " // trailing spaces will be ignored by the matcher - } - - return result.toString() - } - - def "test invalid entry parsing: #entry"() { - setup: - def matcherFactory = new CharacterMatcher.Factory() - - when: - def parsedEntry = new EntryBuilder(matcherFactory, entry).parse() - - then: - parsedEntry == null - - where: - entry << [ - "token[z-a] owner", - "# comment", - " # comment with a leading space", - "[section header]", - " [section header with a leading space]", - "", - " ", - ] - } -} diff --git a/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/config/ConfigurationApiImplTest.groovy b/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/config/ConfigurationApiImplTest.groovy deleted file mode 100644 index d37abda8f52..00000000000 --- a/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/config/ConfigurationApiImplTest.groovy +++ /dev/null @@ -1,412 +0,0 @@ -package datadog.trace.civisibility.config - -import datadog.communication.BackendApi -import datadog.communication.EvpProxyApi -import datadog.communication.IntakeApi -import datadog.communication.http.HttpRetryPolicy -import datadog.communication.http.OkHttpUtils -import datadog.trace.agent.test.server.http.TestHttpServer -import datadog.trace.api.civisibility.config.TestFQN -import datadog.trace.api.civisibility.config.TestIdentifier -import datadog.trace.api.civisibility.config.TestMetadata -import datadog.trace.api.civisibility.telemetry.CiVisibilityMetricCollector -import datadog.trace.api.intake.Intake -import freemarker.core.Environment -import freemarker.core.InvalidReferenceException -import freemarker.template.Template -import freemarker.template.TemplateException -import freemarker.template.TemplateExceptionHandler -import java.util.concurrent.atomic.AtomicInteger -import okhttp3.HttpUrl -import okhttp3.OkHttpClient -import org.apache.commons.io.IOUtils -import org.skyscreamer.jsonassert.JSONAssert -import org.skyscreamer.jsonassert.JSONCompareMode -import spock.lang.Specification - -import java.util.function.Function -import java.util.zip.GZIPOutputStream - -import static datadog.trace.agent.test.server.http.TestHttpServer.httpServer - -class ConfigurationApiImplTest extends Specification { - - private static final int REQUEST_TIMEOUT_MILLIS = 15_000 - - private static final String REQUEST_UID = "1234" - - def "test settings request"() { - given: - def tracerEnvironment = givenTracerEnvironment() - - def intakeServer = givenBackendEndpoint( - "/api/v2/libraries/tests/services/setting", - "/datadog/trace/civisibility/config/settings-request.ftl", - [uid: REQUEST_UID, tracerEnvironment: tracerEnvironment], - "/datadog/trace/civisibility/config/settings-response.ftl", - [settings: expectedSettings] - ) - - def configurationApi = givenConfigurationApi(intakeServer, agentless, compression) - - when: - def settings = configurationApi.getSettings(tracerEnvironment) - - then: - settings == expectedSettings - - cleanup: - intakeServer.close() - - where: - agentless | compression | expectedSettings - false | false | new CiVisibilitySettings(false, false, false, false, false, false, false, false, false, EarlyFlakeDetectionSettings.DEFAULT, TestManagementSettings.DEFAULT, null, false) - false | true | new CiVisibilitySettings(true, true, true, true, true, true, true, true, true, EarlyFlakeDetectionSettings.DEFAULT, TestManagementSettings.DEFAULT, "main", false) - true | false | new CiVisibilitySettings(false, true, false, true, false, true, false, false, true, new EarlyFlakeDetectionSettings(true, [new ExecutionsByDuration(1000, 3)], 10), new TestManagementSettings(true, 10), "master", false) - true | true | new CiVisibilitySettings(false, false, true, true, false, false, true, true, false, new EarlyFlakeDetectionSettings(true, [new ExecutionsByDuration(5000, 3), new ExecutionsByDuration(120000, 2)], 10), new TestManagementSettings(true, 20), "prod", false) - } - - def "test skippable tests request"() { - given: - def tracerEnvironment = givenTracerEnvironment(testBundle) - - def intakeServer = givenBackendEndpoint( - "/api/v2/ci/tests/skippable", - "/datadog/trace/civisibility/config/${request}", - [uid: REQUEST_UID, tracerEnvironment: tracerEnvironment], - "/datadog/trace/civisibility/config/${response}", - [:] - ) - - def configurationApi = givenConfigurationApi(intakeServer) - - when: - def skippableTests = configurationApi.getSkippableTests(tracerEnvironment) - - then: - skippableTests.identifiersByModule == expectedTests - - skippableTests.correlationId == "11223344" - - skippableTests.coveredLinesByRelativeSourcePath.size() == 3 - skippableTests.coveredLinesByRelativeSourcePath["src/main/java/Calculator.java"] == bits(0, 1, 2, 3, 4, 5, 6, 7, 14, 15, 24, 25, 26, 27, 28, 29, 30, 31) - skippableTests.coveredLinesByRelativeSourcePath["src/test/java/CalculatorTest.java"] == bits(0, 1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 27, 28, 29, 30, 50, 51, 52, 53, 54, 55) - skippableTests.coveredLinesByRelativeSourcePath["src/main/java/utils/Math.java"] == bits(24, 25, 26, 27, 28, 29, 30, 37, 38, 39, 50, 51, 52, 53, 54, 55) - - cleanup: - intakeServer.close() - - where: - testBundle | request | response | expectedTests - null | "skippable-request.ftl" | "skippable-response.ftl" | [ - "testBundle-a": [(new TestIdentifier("suite-a", "name-a", "parameters-a")): new TestMetadata(true)], - "testBundle-b": [(new TestIdentifier("suite-b", "name-b", null)): new TestMetadata(false)] - ] - "testBundle-a" | "skippable-request-one-module.ftl" | "skippable-response-one-module.ftl" | [ - "testBundle-a": [ - (new TestIdentifier("suite-a", "name-a", "parameters-a")): new TestMetadata(true), - (new TestIdentifier("suite-b", "name-b", null)) : new TestMetadata(true) - ], - ] - } - - def "test flaky tests request"() { - given: - def tracerEnvironment = givenTracerEnvironment(testBundle) - - def intakeServer = givenBackendEndpoint( - "/api/v2/ci/libraries/tests/flaky", - "/datadog/trace/civisibility/config/${request}", - [uid: REQUEST_UID, tracerEnvironment: tracerEnvironment], - "/datadog/trace/civisibility/config/${response}", - [:] - ) - - def configurationApi = givenConfigurationApi(intakeServer) - - when: - def flakyTests = configurationApi.getFlakyTestsByModule(tracerEnvironment) - - then: - flakyTests == expectedTests - - cleanup: - intakeServer.close() - - where: - testBundle | request | response | expectedTests - null | "flaky-request.ftl" | "flaky-response.ftl" | [ - "testBundle-a": new HashSet<>([new TestFQN("suite-a", "name-a")]), - "testBundle-b": new HashSet<>([new TestFQN("suite-b", "name-b")]), - ] - "testBundle-a" | "flaky-request-one-module.ftl" | "flaky-response-one-module.ftl" | [ - "testBundle-a": new HashSet<>([new TestFQN("suite-a", "name-a")]) - ] - } - - def "test known tests request"() { - given: - def tracerEnvironment = givenTracerEnvironment() - def pageInfo = [:] - - def intakeServer = givenBackendEndpoint( - "/api/v2/ci/libraries/tests", - "/datadog/trace/civisibility/config/known-tests-request.ftl", - [uid: REQUEST_UID, tracerEnvironment: tracerEnvironment, pageInfo: pageInfo], - "/datadog/trace/civisibility/config/known-tests-response.ftl", - [:] - ) - - def configurationApi = givenConfigurationApi(intakeServer) - - when: - def knownTests = configurationApi.getKnownTestsByModule(tracerEnvironment) - - for (Map.Entry> e : knownTests.entrySet()) { - def sortedTests = new ArrayList<>(e.value) - Collections.sort(sortedTests, Comparator.comparing(TestFQN::getSuite).thenComparing((Function)TestFQN::getName)) - e.value = sortedTests - } - - then: - knownTests == [ - "test-bundle-a": [ - new TestFQN("test-suite-a", "test-name-1"), - new TestFQN("test-suite-a", "test-name-2"), - new TestFQN("test-suite-b", "another-test-name-1"), - new TestFQN("test-suite-b", "test-name-2") - ], - "test-bundle-N": [ - new TestFQN("test-suite-M", "test-name-1"), - new TestFQN("test-suite-M", "test-name-2") - ] - ] - - cleanup: - intakeServer.close() - } - - def "test known tests request with pagination"() { - given: - def tracerEnvironment = givenTracerEnvironment() - def requestCount = new AtomicInteger(0) - - // Define page responses - def page1 = '{"data":{"id":"page1","type":"ci_app_libraries_tests","attributes":{"tests":{"module-a":{"suite-a":["test-1","test-2"]}},"page_info":{"size":2,"has_next":true,"cursor":"cursor-page-2"}}}}' - def page2 = '{"data":{"id":"page2","type":"ci_app_libraries_tests","attributes":{"tests":{"module-b":{"suite-b":["test-3","test-4"]}},"page_info":{"size":2,"has_next":true,"cursor":"cursor-page-3"}}}}' - def page3 = '{"data":{"id":"page3","type":"ci_app_libraries_tests","attributes":{"tests":{"module-c":{"suite-c":["test-5","test-6"]}},"page_info":{"size":2,"has_next":false}}}}' - def responses = [page1, page2, page3] - - def intakeServer = httpServer { - handlers { - prefix("/api/v2/ci/libraries/tests") { - def currentRequest = requestCount.incrementAndGet() - def responseBody = responses[currentRequest - 1].bytes - - def response = response - def header = request.getHeader("Accept-Encoding") - def gzipSupported = header != null && header.contains("gzip") - if (gzipSupported) { - response.addHeader("Content-Encoding", "gzip") - responseBody = gzip(responseBody) - } - - response.status(200).send(responseBody) - } - } - } - def configurationApi = givenConfigurationApi(intakeServer) - - when: - def knownTests = configurationApi.getKnownTestsByModule(tracerEnvironment) - - for (Map.Entry> e : knownTests.entrySet()) { - def sortedTests = new ArrayList<>(e.value) - Collections.sort(sortedTests, Comparator.comparing(TestFQN::getSuite).thenComparing((Function)TestFQN::getName)) - e.value = sortedTests - } - - then: - // Verify 3 requests were made (3 pages) - requestCount.get() == 3 - - // Verify merged results from all 3 pages - knownTests == [ - "module-a": [new TestFQN("suite-a", "test-1"), new TestFQN("suite-a", "test-2")], - "module-b": [new TestFQN("suite-b", "test-3"), new TestFQN("suite-b", "test-4")], - "module-c": [new TestFQN("suite-c", "test-5"), new TestFQN("suite-c", "test-6")] - ] - - cleanup: - intakeServer.close() - } - - def "test test management tests request"() { - given: - def tracerEnvironment = givenTracerEnvironment() - - def intakeServer = givenBackendEndpoint( - "/api/v2/test/libraries/test-management/tests", - "/datadog/trace/civisibility/config/test-management-tests-request.ftl", - [uid: REQUEST_UID, tracerEnvironment: tracerEnvironment], - "/datadog/trace/civisibility/config/test-management-tests-response.ftl", - [:] - ) - - def configurationApi = givenConfigurationApi(intakeServer) - - when: - def testManagementTests = configurationApi.getTestManagementTestsByModule(tracerEnvironment, tracerEnvironment.getSha(), tracerEnvironment.getCommitMessage()) - def quarantinedTests = testManagementTests.get(TestSetting.QUARANTINED) - def disabledTests = testManagementTests.get(TestSetting.DISABLED) - def attemptToFixTests = testManagementTests.get(TestSetting.ATTEMPT_TO_FIX) - - then: - quarantinedTests == [ - "module-a": new HashSet<>([new TestFQN("suite-a", "test-a"), new TestFQN("suite-b", "test-c")]), - "module-b": new HashSet<>([new TestFQN("suite-c", "test-e")]) - ] - disabledTests == [ - "module-a": new HashSet<>([new TestFQN("suite-a", "test-b")]), - "module-b": new HashSet<>([new TestFQN("suite-c", "test-d"), new TestFQN("suite-c", "test-f")]) - ] - attemptToFixTests == [ - "module-a": new HashSet<>([new TestFQN("suite-b", "test-c")]), - "module-b": new HashSet<>([new TestFQN("suite-c", "test-d"), new TestFQN("suite-c", "test-e")]) - ] - - cleanup: - intakeServer.close() - } - - private ConfigurationApi givenConfigurationApi(TestHttpServer intakeServer, boolean agentless = true, boolean compression = true) { - def api = agentless - ? givenIntakeApi(intakeServer.address, compression) - : givenEvpProxy(intakeServer.address, compression) - return new ConfigurationApiImpl(api, Stub(CiVisibilityMetricCollector), () -> REQUEST_UID) - } - - private TestHttpServer givenBackendEndpoint(String path, - String requestTemplate, - Map requestData, - String responseTemplate, - Map responseData) { - httpServer { - handlers { - prefix(path) { - def expectedRequestBody = getFreemarkerTemplate(requestTemplate, requestData) - - def response = response - try { - JSONAssert.assertEquals(expectedRequestBody, new String(request.body), JSONCompareMode.LENIENT) - } catch (AssertionError error) { - response.status(400).send(error.getMessage().bytes) - } - - def responseBody = getFreemarkerTemplate(responseTemplate, responseData).bytes - def header = request.getHeader("Accept-Encoding") - def gzipSupported = header != null && header.contains("gzip") - if (gzipSupported) { - response.addHeader("Content-Encoding", "gzip") - responseBody = gzip(responseBody) - } - - response.status(200).send(responseBody) - } - } - } - } - - private static byte[] gzip(byte[] payload) { - def baos = new ByteArrayOutputStream() - try (GZIPOutputStream zip = new GZIPOutputStream(baos)) { - IOUtils.copy(new ByteArrayInputStream(payload), zip) - } - return baos.toByteArray() - } - - private BackendApi givenEvpProxy(URI address, boolean responseCompression) { - String traceId = "a-trace-id" - HttpUrl proxyUrl = HttpUrl.get(address) - HttpRetryPolicy.Factory retryPolicyFactory = new HttpRetryPolicy.Factory(5, 100, 2.0) - OkHttpClient client = OkHttpUtils.buildHttpClient(proxyUrl, REQUEST_TIMEOUT_MILLIS) - return new EvpProxyApi(traceId, proxyUrl, "api", retryPolicyFactory, client, responseCompression) - } - - private BackendApi givenIntakeApi(URI address, boolean responseCompression) { - HttpUrl intakeUrl = HttpUrl.get(String.format("%s/api/%s/", address.toString(), Intake.API.getVersion())) - - String apiKey = "api-key" - String traceId = "a-trace-id" - - HttpRetryPolicy retryPolicy = Stub(HttpRetryPolicy) - retryPolicy.shouldRetry(_) >> false - - HttpRetryPolicy.Factory retryPolicyFactory = Stub(HttpRetryPolicy.Factory) - retryPolicyFactory.create() >> retryPolicy - - OkHttpClient client = OkHttpUtils.buildHttpClient(intakeUrl, REQUEST_TIMEOUT_MILLIS) - return new IntakeApi(intakeUrl, apiKey, traceId, retryPolicyFactory, client, responseCompression) - } - - private static TracerEnvironment givenTracerEnvironment(String testBundle = null) { - return TracerEnvironment.builder() - .service("foo") - .env("foo_env") - .repositoryUrl("https://github.com/DataDog/foo") - .branch("prod") - .sha("d64185e45d1722ab3a53c45be47accae") - .commitMessage("full commit message") - .osPlatform("linux") - .osArchitecture("amd64") - .osVersion("bionic") - .runtimeName("runtimeName") - .runtimeVersion("runtimeVersion") - .runtimeVendor("vendor") - .runtimeArchitecture("amd64") - .customTag("customTag", "customValue") - .testBundle(testBundle) - .build() - } - - private static BitSet bits(int ... bits) { - BitSet bitSet = new BitSet() - for (int bit : bits) { - bitSet.set(bit) - } - return bitSet - } - - static final TemplateExceptionHandler SUPPRESS_EXCEPTION_HANDLER = new TemplateExceptionHandler() { - @Override - void handleTemplateException(TemplateException e, Environment environment, Writer writer) throws TemplateException { - if (e instanceof InvalidReferenceException) { - writer.write('""') - } else { - throw e - } - } - } - - static final freemarker.template.Configuration FREEMARKER = new freemarker.template.Configuration(freemarker.template.Configuration.VERSION_2_3_30) { { - setClassLoaderForTemplateLoading(ConfigurationApiImplTest.classLoader, "") - setDefaultEncoding("UTF-8") - setTemplateExceptionHandler(SUPPRESS_EXCEPTION_HANDLER) - setLogTemplateExceptions(false) - setWrapUncheckedExceptions(true) - setFallbackOnNullLoopVariable(false) - setNumberFormat("0.######") - } - } - - static String getFreemarkerTemplate(String templatePath, Map replacements, List> replacementsSource = []) { - try { - Template coveragesTemplate = FREEMARKER.getTemplate(templatePath) - StringWriter coveragesOut = new StringWriter() - coveragesTemplate.process(replacements, coveragesOut) - return coveragesOut.toString() - } catch (Exception e) { - throw new RuntimeException("Could not get Freemarker template " + templatePath + "; replacements map: " + replacements + "; replacements source: " + replacementsSource, e) - } - } -} diff --git a/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/config/TracerEnvironmentTest.groovy b/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/config/TracerEnvironmentTest.groovy index 8145bf4adbb..43bba19e6f0 100644 --- a/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/config/TracerEnvironmentTest.groovy +++ b/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/config/TracerEnvironmentTest.groovy @@ -1,5 +1,6 @@ package datadog.trace.civisibility.config +import datadog.trace.civisibility.config.api.dto.request.TracerEnvironment import spock.lang.Specification class TracerEnvironmentTest extends Specification { diff --git a/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/coverage/report/CoverageReportUploaderTest.groovy b/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/coverage/report/CoverageReportUploaderTest.groovy deleted file mode 100644 index d1322d91c3b..00000000000 --- a/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/coverage/report/CoverageReportUploaderTest.groovy +++ /dev/null @@ -1,96 +0,0 @@ -package datadog.trace.civisibility.coverage.report - -import com.fasterxml.jackson.databind.ObjectMapper -import datadog.communication.BackendApi -import datadog.communication.IntakeApi -import datadog.communication.http.HttpRetryPolicy -import datadog.communication.http.OkHttpUtils -import datadog.trace.api.civisibility.telemetry.CiVisibilityMetricCollector -import datadog.trace.api.intake.Intake -import datadog.trace.test.util.MultipartRequestParser -import okhttp3.HttpUrl -import okhttp3.OkHttpClient -import spock.lang.AutoCleanup -import spock.lang.Shared -import spock.lang.Specification - -import java.util.zip.GZIPInputStream - -import static datadog.trace.agent.test.server.http.TestHttpServer.httpServer - -class CoverageReportUploaderTest extends Specification { - - private static final int REQUEST_TIMEOUT_MILLIS = 15_000 - - private static final ObjectMapper JSON_MAPPER = new ObjectMapper() - - private static final String COVERAGE_REPORT_BODY = "report-body" - private static final String JACOCO_FORMAT = "jacoco" - private static final String CI_TAG_KEY = "ci-tag-key" - private static final String CI_TAG_VALUE = "ci-tag-value" - - @AutoCleanup - @Shared - def server = httpServer { - handlers { - prefix('/api/v2/cicovreprt') { - def parsed = MultipartRequestParser.parseRequest(request.body, request.headers.get("Content-Type")) - - def event = JSON_MAPPER.readValue(parsed["event"].get(0).get(), Map) - if (event.size() != 3 || event["format"] != JACOCO_FORMAT || event["type"] != "coverage_report" || event[CI_TAG_KEY] != CI_TAG_VALUE) { - response.status(400).send("Incorrect event $event") - return - } - - def coverage = new String(gunzip(parsed["coverage"].get(0).get())) - if (coverage != COVERAGE_REPORT_BODY) { - response.status(400).send("Incorrect coverage $coverage") - return - } - - response.status(200).send() - } - } - } - - static byte[] gunzip(byte[] compressed) throws IOException { - try (ByteArrayInputStream bais = new ByteArrayInputStream(compressed) - GZIPInputStream gis = new GZIPInputStream(bais) - ByteArrayOutputStream baos = new ByteArrayOutputStream()) { - - byte[] buffer = new byte[8192] - int len - while ((len = gis.read(buffer)) != -1) { - baos.write(buffer, 0, len) - } - return baos.toByteArray() - } - } - - def "test upload coverage report"() { - setup: - def backendApi = givenIntakeApi() - def metricCollector = Stub(CiVisibilityMetricCollector) - def uploader = new CoverageReportUploader(backendApi, [(CI_TAG_KEY):CI_TAG_VALUE], metricCollector) - def report = new ByteArrayInputStream(COVERAGE_REPORT_BODY.getBytes()) - - expect: - uploader.upload(JACOCO_FORMAT, report) - } - - private BackendApi givenIntakeApi() { - HttpUrl intakeUrl = HttpUrl.get(String.format("%s/api/%s/", server.address.toString(), Intake.CI_INTAKE.version)) - - String apiKey = "api-key" - String traceId = "a-trace-id" - - HttpRetryPolicy retryPolicy = Stub(HttpRetryPolicy) - retryPolicy.shouldRetry(_) >> false - - HttpRetryPolicy.Factory retryPolicyFactory = Stub(HttpRetryPolicy.Factory) - retryPolicyFactory.create() >> retryPolicy - - OkHttpClient client = OkHttpUtils.buildHttpClient(intakeUrl, REQUEST_TIMEOUT_MILLIS) - return new IntakeApi(intakeUrl, apiKey, traceId, retryPolicyFactory, client, false) - } -} diff --git a/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/decorator/TestDecoratorImplTest.groovy b/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/decorator/TestDecoratorImplTest.groovy index d1d415428df..1f7de97d672 100644 --- a/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/decorator/TestDecoratorImplTest.groovy +++ b/dd-java-agent/agent-ci-visibility/src/test/groovy/datadog/trace/civisibility/decorator/TestDecoratorImplTest.groovy @@ -22,7 +22,7 @@ class TestDecoratorImplTest extends Specification { then: 1 * span.setTag(Tags.TEST_SESSION_NAME, "session-name") 1 * span.setTag(Tags.COMPONENT, "test-component") - 1 * span.context() >> context + 1 * span.spanContext() >> context 1 * context.setIntegrationName("test-component") 1 * span.setTag(Tags.TEST_TYPE, decorator.testType()) 1 * span.setSamplingPriority(PrioritySampling.SAMPLER_KEEP) @@ -48,7 +48,7 @@ class TestDecoratorImplTest extends Specification { decorator.afterStart(span) then: - 1 * span.context() >> context + 1 * span.spanContext() >> context 1 * context.setIntegrationName("test-component") 1 * span.setTag(Tags.TEST_SESSION_NAME, expectedSessionName) diff --git a/dd-java-agent/agent-ci-visibility/src/test/java/datadog/trace/civisibility/codeowners/CodeownersTest.java b/dd-java-agent/agent-ci-visibility/src/test/java/datadog/trace/civisibility/codeowners/CodeownersTest.java new file mode 100644 index 00000000000..72d59b996a4 --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/test/java/datadog/trace/civisibility/codeowners/CodeownersTest.java @@ -0,0 +1,111 @@ +package datadog.trace.civisibility.codeowners; + +import static java.nio.charset.StandardCharsets.UTF_8; +import static java.util.Arrays.asList; +import static java.util.Collections.emptyList; +import static java.util.Collections.singletonList; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.params.provider.Arguments.arguments; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.util.List; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +class CodeownersTest { + + private static final String GITHUB_SAMPLE = "ci/codeowners/CODEOWNERS_sample"; + private static final String GITLAB_SAMPLE = "ci/codeowners/CODEOWNERS_gitlab_sample"; + + @ParameterizedTest(name = "[{0}] owners of {1} are {2}") + @MethodSource("testCodeownersMatchingArguments") + void testCodeownersMatching(String resource, String path, List expectedOwners) + throws IOException { + Codeowners codeowners = parse(resource); + assertEquals(expectedOwners, codeowners.getOwners(path)); + } + + static Stream testCodeownersMatchingArguments() { + List globalOwners = asList("@global-owner1", "@global-owner2"); + return Stream.of( + // --- GitHub baseline: behavior must remain unchanged --- + arguments(GITHUB_SAMPLE, "MyClass.java", globalOwners), + arguments(GITHUB_SAMPLE, "folder/MyClass.java", globalOwners), + arguments(GITHUB_SAMPLE, "script.js", singletonList("@js-owner")), + arguments(GITHUB_SAMPLE, "inner/folder/script.js", singletonList("@js-owner")), + arguments(GITHUB_SAMPLE, "scripts/script.js", asList("@doctocat", "@octocat")), + arguments(GITHUB_SAMPLE, "scripts/inner/script.js", asList("@doctocat", "@octocat")), + arguments(GITHUB_SAMPLE, "build/logs/current.log", singletonList("@doctocat")), + arguments(GITHUB_SAMPLE, "build/logs/inner/current.log", singletonList("@doctocat")), + arguments(GITHUB_SAMPLE, "module/build/logs/current.log", globalOwners), + arguments(GITHUB_SAMPLE, "apps/app1.exe", singletonList("@octocat")), + arguments(GITHUB_SAMPLE, "apps/inner/app2.exe", singletonList("@octocat")), + arguments(GITHUB_SAMPLE, "module/apps/app3.exe", singletonList("@octocat")), + arguments(GITHUB_SAMPLE, "docs/intro.doc", singletonList("@doctocat")), + arguments(GITHUB_SAMPLE, "docs/important/doc.doc", singletonList("@doctocat")), + arguments(GITHUB_SAMPLE, "applications/application", singletonList("@appowner")), + arguments(GITHUB_SAMPLE, "applications/module/application", singletonList("@appowner")), + arguments(GITHUB_SAMPLE, "applications/github/githubApplication", emptyList()), + arguments(GITHUB_SAMPLE, "documentation/doc.md", singletonList("docs@example.com")), + arguments(GITHUB_SAMPLE, "documentation/inner/doc.md", globalOwners), + arguments( + GITHUB_SAMPLE, "documentation/inner/doc.txt", singletonList("@octo-org/octocats")), + // --- GitLab sections: a path's owners combine the winning match from every section, + // including the unnamed section (the leading "* @global-owner") --- + arguments(GITLAB_SAMPLE, "random/file.txt", singletonList("@global-owner")), + // exclusions also apply to the unnamed section + arguments(GITLAB_SAMPLE, "unowned.txt", emptyList()), + // section default owners are inherited and combined with the global owner + arguments(GITLAB_SAMPLE, "docs/guide.md", asList("@global-owner", "@docs-team")), + arguments(GITLAB_SAMPLE, "README.md", asList("@global-owner", "@docs-team")), + arguments( + GITLAB_SAMPLE, + "model/db/users.sql", + asList("@global-owner", "@database-team", "@dba-lead")), + // per-entry owners override the section default within that section + arguments( + GITLAB_SAMPLE, + "config/db/setup.sql", + asList("@global-owner", "@special-owner", "@config-team")), + // optional section (^[...]) defaults are inherited just like required ones + arguments(GITLAB_SAMPLE, "src/app.js", asList("@global-owner", "@frontend-team")), + arguments(GITLAB_SAMPLE, "src/styles.css", asList("@global-owner", "@css-owner")), + // a section without default owners keeps each entry's own owners + arguments(GITLAB_SAMPLE, "scripts/deploy.sh", asList("@global-owner", "@scripts-team")), + // the required-approvals count in the header is ignored for ownership + arguments(GITLAB_SAMPLE, "secrets/key.txt", asList("@global-owner", "@security-team")), + // a header immediately followed by a comment is a valid header with no default owners, so + // this entry does not inherit the previous section's owners (only the global owner applies) + arguments(GITLAB_SAMPLE, "generated/report.txt", singletonList("@global-owner")), + // duplicate section names (case-insensitive) are combined into one section: a path matching + // entries in both blocks resolves to the last matching entry's owners, not both + arguments(GITLAB_SAMPLE, "service/util.go", asList("@global-owner", "@backend-team-a")), + arguments( + GITLAB_SAMPLE, "service/api/handler.go", asList("@global-owner", "@backend-team-b")), + // exclusions suppress only their section and cannot be overridden by a later entry + arguments( + GITLAB_SAMPLE, + "generated-assets/output.txt", + asList("@global-owner", "@generated-files-team")), + arguments( + GITLAB_SAMPLE, + "generated-assets/excluded/output.txt", + asList("@global-owner", "@other-generated-files-team")), + arguments( + GITLAB_SAMPLE, + "generated-assets/excluded/special.txt", + asList("@global-owner", "@other-generated-files-team"))); + } + + private static Codeowners parse(String resource) throws IOException { + try (InputStream stream = CodeownersTest.class.getClassLoader().getResourceAsStream(resource); + Reader reader = new InputStreamReader(stream, UTF_8)) { + return CodeownersImpl.parse(reader); + } + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/test/java/datadog/trace/civisibility/codeowners/EntryBuilderTest.java b/dd-java-agent/agent-ci-visibility/src/test/java/datadog/trace/civisibility/codeowners/EntryBuilderTest.java new file mode 100644 index 00000000000..a6b915c612f --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/test/java/datadog/trace/civisibility/codeowners/EntryBuilderTest.java @@ -0,0 +1,293 @@ +package datadog.trace.civisibility.codeowners; + +import static java.util.Arrays.asList; +import static java.util.Collections.emptyList; +import static java.util.Collections.singletonList; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.params.provider.Arguments.arguments; + +import datadog.trace.civisibility.codeowners.matcher.CharacterMatcher; +import java.util.Collection; +import java.util.List; +import java.util.stream.Stream; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +class EntryBuilderTest { + + @ParameterizedTest(name = "entry {0} match against {2} is {3}") + @MethodSource("testEntryMatchArguments") + void testEntryMatch(String pattern, List owners, String path, boolean expectedResult) { + CharacterMatcher.Factory matcherFactory = new CharacterMatcher.Factory(); + Entry entry = new EntryBuilder(matcherFactory, pattern + " " + ownersToString(owners)).parse(); + Entry exclusionEntry = + new EntryBuilder(matcherFactory, "!" + pattern + " " + ownersToString(owners)).parse(); + + boolean result = entry.getMatcher().consume(path.toCharArray(), 0) >= 0; + boolean exclusionResult = exclusionEntry.getMatcher().consume(path.toCharArray(), 0) >= 0; + + assertEquals(owners, entry.getOwners()); + assertFalse(entry.isExclusion()); + assertEquals(emptyList(), exclusionEntry.getOwners()); + assertTrue(exclusionEntry.isExclusion()); + assertEquals(expectedResult, result); + assertEquals(expectedResult, exclusionResult); + } + + static Stream testEntryMatchArguments() { + List owner = singletonList("owner"); + return Stream.of( + arguments("someToken", owner, "someToken", true), + arguments("someToken", owner, "sometoken", false), + arguments("someToken", owner, "anotherToken", false), + arguments("someToken", owner, "parent/someToken", true), + arguments("someToken", owner, "grandparent/parent/someToken", true), + arguments("/someToken", owner, "someToken", true), + arguments("/someToken", owner, "sometoken", false), + arguments("/someToken", owner, "anotherToken", false), + arguments("/someToken", owner, "parent/someToken", false), + arguments("/someToken", owner, "grandparent/parent/someToken", false), + arguments("someTok?n", owner, "someTokkn", true), + arguments("someTok?n", owner, "someTok/n", false), + arguments("someTok?n", owner, "parent/someTokkn", true), + arguments("someTok?n", owner, "grandparent/parent/someTokkn", true), + arguments("/someTok?n", owner, "someTokkn", true), + arguments("someTok*n", owner, "someTokkn", true), + arguments("someTok*n", owner, "someTok/n", false), + arguments("someTok*n", owner, "someTokkkkn", true), + arguments("someTok*n", owner, "someTokenToken", true), + arguments("someTok*n", owner, "someTokenTokkk", false), + arguments("s*meTok*n", owner, "someToken", true), + arguments("s*meTok*n", owner, "sabcdefghmeTokabcdefgn", true), + arguments("s*meTok*n", owner, "sabcdefghmeTokabcdefg", false), + arguments("someTok*n", owner, "parent/someTokkn", true), + arguments("someTok*n", owner, "grandparent/parent/someTokkn", true), + arguments("/someTok*n", owner, "someTokkn", true), + arguments("someTok[a-b]n", owner, "someToken", false), + arguments("someTok[a-z]n", owner, "someToken", true), + arguments("someTok[a-z]n", owner, "someTokEn", false), + arguments("someTok[a-z]n", owner, "someTok9n", false), + arguments("someTok[a-zA-Z]n", owner, "someToken", true), + arguments("someTok[a-zA-Z]n", owner, "someTokEn", true), + arguments("someTok[a-zA-Z]n", owner, "someTok9n", false), + arguments("someTok[a-zA-Z0-9]n", owner, "someToken", true), + arguments("someTok[a-zA-Z0-9]n", owner, "someTokEn", true), + arguments("someTok[a-zA-Z0-9]n", owner, "someTok9n", true), + arguments("s*meTok[a-zA-Z0-9]n", owner, "smeToken", true), + arguments("s*meTok[a-zA-Z0-9]n", owner, "smeTokEn", true), + arguments("s*meTok[a-zA-Z0-9]n", owner, "smeTok9n", true), + arguments("s*meTok[a-zA-Z0-9]n", owner, "sabcdmeToken", true), + arguments("s*meTok[a-zA-Z0-9]n", owner, "sabcdmeTokEn", true), + arguments("s*meTok[a-zA-Z0-9]n", owner, "sabcdmeTok9n", true), + arguments("someToken/", owner, "someToken", true), + arguments("someToken/", owner, "someToken/child", true), + arguments("someToken/", owner, "someToken/child/grandChild", true), + arguments("someToken/", owner, "parent/someToken", true), + arguments("someToken/", owner, "parent/someToken/child", true), + arguments("someToken/", owner, "parent/grandParent/someToken/child/grandChild", true), + arguments("/someToken/", owner, "someToken", true), + arguments("/someToken/", owner, "someToken/child", true), + arguments("/someToken/", owner, "someToken/child/grandChild", true), + arguments("/someToken/", owner, "parent/someToken", false), + arguments("/someToken/", owner, "parent/someToken/child", false), + arguments("/someToken/", owner, "parent/grandParent/someToken/child/grandChild", false), + arguments("some/token", owner, "some/token", true), + arguments("some/token", owner, "parent/some/token", false), + arguments("some/token", owner, "some/token/child", true), + arguments("some/token", owner, "some/tokenSuffix", false), + arguments("some/token/", owner, "some/token/child", true), + arguments("some/token/", owner, "parent/some/token/child", false), + arguments("some\\ Token", owner, "some Token", true), + arguments("\\#someToken", owner, "#someToken", true), + arguments("**/someToken", owner, "someToken", true), + arguments("**/someToken", owner, "parent/someToken", true), + arguments("**/someToken", owner, "grandparent/parent/someToken", true), + arguments("**/someToken", owner, "anotherToken", false), + arguments("**/some/token", owner, "some/token", true), + arguments("**/some/token", owner, "parent/some/token", true), + arguments("**/some/token", owner, "grandparent/parent/some/token", true), + arguments("**/some/token/", owner, "some/token", true), + arguments("**/some/token/", owner, "some/token/child", true), + arguments("**/some/token/", owner, "some/token/child/grandchild", true), + arguments("**/some/token/", owner, "parent/some/token/child", true), + arguments("**/some/token/", owner, "parent/some/different/token", false), + arguments("someToken/**", owner, "someToken", true), + arguments("someToken/**", owner, "someToken/child", true), + arguments("someToken/**", owner, "someToken/child/grandChild", true), + arguments("someToken/**", owner, "parent/someToken", false), + arguments("someToken/**", owner, "parent/someToken/child", false), + arguments("someToken/**", owner, "parent/grandParent/someToken/child/grandChild", false), + arguments("/someToken/**", owner, "someToken", true), + arguments("/someToken/**", owner, "someToken/child", true), + arguments("/someToken/**", owner, "someToken/child/grandChild", true), + arguments("/someToken/**", owner, "parent/someToken", false), + arguments("/someToken/**", owner, "parent/someToken/child", false), + arguments("/someToken/**", owner, "parent/grandParent/someToken/child/grandChild", false), + arguments("some/**/token", owner, "some/token", true), + arguments("some/**/token", owner, "some/other/token", true), + arguments("some/**/token", owner, "some/yet/another/token", true), + arguments("some/**/token", owner, "some/yet/another", false), + arguments("some/**/token", owner, "yet/another/token", false), + arguments("someToken", asList("owner", "anotherOwner"), "someToken", true), + arguments("*", owner, "someToken", true), + arguments("*", owner, "parent/someToken", true), + arguments("*", owner, "parent/someToken/child", true), + arguments("*", owner, "someFile.java", true), + arguments("**", owner, "someToken", true), + arguments("**", owner, "parent/someToken", true), + arguments("**", owner, "parent/someToken/child", true), + arguments("**", owner, "someFile.java", true), + arguments("*.java", owner, "someFile.java", true), + arguments("*.java", owner, "parent/someFile.java", true), + arguments("*.java", owner, "grandparent/parent/someFile.java", true), + arguments("*.java", owner, "someFile.js", false), + arguments("*.java", owner, "someFile.java17", false), + arguments("readme.md", owner, "readme.md", true), + arguments("readme.md", owner, "parent/readme.md", true), + arguments("readme.md", owner, "readme.md5", false), + arguments("some/*", owner, "some/token", true), + arguments("some/*", owner, "some/other/token", false), + arguments("some/*", owner, "parent/some/token", false), + arguments("some/*", owner, "parent/some/other/token", false), + arguments("**/test*.java", owner, "test.java", true), + arguments("**/test*.java", owner, "testFile.java", true), + arguments("**/test*.java", owner, "parent/test.java", true), + arguments("**/test*.java", owner, "parent/testFile.java", true), + arguments("**/test*.java", owner, "grandparent/parent/test.java", true), + arguments("**/test*.java", owner, "grandparent/parent/testFile.java", true), + arguments("\\#someToken", owner, "#someToken", true)); + } + + private static String ownersToString(Collection owners) { + StringBuilder result = new StringBuilder(); + for (String owner : owners) { + result.append(owner).append(" "); // trailing spaces will be ignored by the matcher + } + return result.toString(); + } + + @ParameterizedTest(name = "invalid entry parsing: \"{0}\"") + @MethodSource("testInvalidEntryParsingArguments") + void testInvalidEntryParsing(String entry) { + CharacterMatcher.Factory matcherFactory = new CharacterMatcher.Factory(); + Entry parsedEntry = new EntryBuilder(matcherFactory, entry).parse(); + assertNull(parsedEntry); + } + + static Stream testInvalidEntryParsingArguments() { + return Stream.of( + arguments("token[z-a] owner"), + arguments("# comment"), + arguments(" # comment with a leading space"), + arguments("[section header]"), + arguments(" [section header with a leading space]"), + arguments(""), + arguments(" "), + arguments("^[section header]"), + arguments("^[section header with] @default/owner"), + arguments(" ^[section header with a leading space]")); + } + + @ParameterizedTest(name = "section header \"{0}\" declares default owners {1}") + @MethodSource("testSectionHeaderParsingArguments") + void testSectionHeaderParsing(String line, List expectedDefaultOwners) { + CharacterMatcher.Factory matcherFactory = new CharacterMatcher.Factory(); + SectionHeader header = new EntryBuilder(matcherFactory, line).parseSectionHeader(); + assertEquals(expectedDefaultOwners, header.getDefaultOwners()); + } + + static Stream testSectionHeaderParsingArguments() { + return Stream.of( + // section headers without default owners + arguments("[Documentation]", emptyList()), + arguments("^[Optional]", emptyList()), + arguments("[Section name with spaces]", emptyList()), + arguments(" [Indented section]", emptyList()), + arguments("[Requires approvals][2]", emptyList()), + arguments("^[Optional with approvals][3]", emptyList()), + arguments("[Documentation] # only a comment", emptyList()), + arguments("[Generated]# comment with no leading space", emptyList()), + // section headers with default owners + arguments("[Documentation] @docs-team", singletonList("@docs-team")), + arguments("[Database] @database-team @dba-lead", asList("@database-team", "@dba-lead")), + arguments("^[Optional] @go-team", singletonList("@go-team")), + arguments("[Requires approvals][2] @team @lead", asList("@team", "@lead")), + arguments("^[Optional with approvals][2] @team", singletonList("@team")), + arguments("[Docs] docs@example.com", singletonList("docs@example.com")), + arguments("[Docs] @org/team", singletonList("@org/team")), + arguments("[Docs] @docs-team # trailing comment", singletonList("@docs-team")), + arguments("[Section] @a @b", asList("@a", "@b"))); + } + + @ParameterizedTest(name = "section header \"{0}\" has name \"{1}\"") + @MethodSource("testSectionHeaderNameArguments") + void testSectionHeaderName(String line, String expectedName) { + CharacterMatcher.Factory matcherFactory = new CharacterMatcher.Factory(); + SectionHeader header = new EntryBuilder(matcherFactory, line).parseSectionHeader(); + assertEquals(expectedName, header.getName()); + } + + static Stream testSectionHeaderNameArguments() { + return Stream.of( + arguments("[Documentation]", "Documentation"), + arguments("[Documentation] @docs-team", "Documentation"), + arguments("^[Optional Frontend] @team", "Optional Frontend"), + arguments("[Requires approvals][2] @team", "Requires approvals"), + arguments("[Generated]# comment", "Generated"), + arguments(" [Indented]", "Indented")); + } + + @ParameterizedTest(name = "\"{0}\" is not a section header") + @MethodSource("testNonSectionHeaderArguments") + void testNonSectionHeaderReturnsNull(String line) { + CharacterMatcher.Factory matcherFactory = new CharacterMatcher.Factory(); + assertNull(new EntryBuilder(matcherFactory, line).parseSectionHeader()); + } + + static Stream testNonSectionHeaderArguments() { + return Stream.of( + arguments("*.js @owner"), + arguments("/path/to/file @owner"), + arguments("# comment"), + arguments(""), + arguments(" "), + arguments("[a-z]*.txt @owner"), // character-class range, not a section header + arguments("[Bb]uild/ @owner"), // character-class set, not a section header + arguments("^caret-file @owner")); // '^' not followed by '[' + } + + @Test + void testEntryInheritsSectionDefaultOwners() { + CharacterMatcher.Factory matcherFactory = new CharacterMatcher.Factory(); + List sectionDefaultOwners = singletonList("@docs-team"); + + // an entry without its own owners inherits the section's default owners + Entry inherited = new EntryBuilder(matcherFactory, "docs/").parse(sectionDefaultOwners); + assertEquals(sectionDefaultOwners, inherited.getOwners()); + + // an entry with its own owners overrides the section's default owners + Entry overridden = + new EntryBuilder(matcherFactory, "docs/setup.md @override").parse(sectionDefaultOwners); + assertEquals(singletonList("@override"), overridden.getOwners()); + + // with no section defaults, owners stay empty (GitHub "unset ownership" semantics) + Entry noOwners = new EntryBuilder(matcherFactory, "generated/").parse(emptyList()); + assertEquals(emptyList(), noOwners.getOwners()); + } + + @Test + void testExclusionDoesNotInheritSectionDefaultOwners() { + CharacterMatcher.Factory matcherFactory = new CharacterMatcher.Factory(); + + Entry exclusion = + new EntryBuilder(matcherFactory, "!generated/").parse(singletonList("@docs-team")); + + assertTrue(exclusion.isExclusion()); + assertEquals(emptyList(), exclusion.getOwners()); + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/test/java/datadog/trace/civisibility/config/AbstractConfigurationApiContractTest.java b/dd-java-agent/agent-ci-visibility/src/test/java/datadog/trace/civisibility/config/AbstractConfigurationApiContractTest.java new file mode 100644 index 00000000000..3066f83efbb --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/test/java/datadog/trace/civisibility/config/AbstractConfigurationApiContractTest.java @@ -0,0 +1,327 @@ +package datadog.trace.civisibility.config; + +import static java.util.Collections.singletonList; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.params.provider.Arguments.arguments; + +import datadog.trace.api.civisibility.config.TestFQN; +import datadog.trace.api.civisibility.config.TestIdentifier; +import datadog.trace.api.civisibility.config.TestMetadata; +import datadog.trace.civisibility.config.api.dto.request.TracerEnvironment; +import freemarker.template.Configuration; +import freemarker.template.Template; +import freemarker.template.TemplateException; +import java.io.IOException; +import java.io.StringWriter; +import java.util.Arrays; +import java.util.BitSet; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.stream.Stream; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +/** + * Parse-and-shape contract tests that every {@link ConfigurationApi} implementation must satisfy. + * + *

Subclasses wire fixtures (HTTP server, files on disk, ...) and assert that the configured + * implementation produces the expected domain object for each canonical response shape. + */ +abstract class AbstractConfigurationApiContractTest { + + protected static final String FIXTURE_DIR = "/datadog/trace/civisibility/config/"; + + protected static final TracerEnvironment ENV = envWithBundle(null); + + protected static TracerEnvironment envWithBundle(String testBundle) { + return TracerEnvironment.builder() + .service("foo") + .env("foo_env") + .repositoryUrl("https://github.com/DataDog/foo") + .branch("prod") + .sha("d64185e45d1722ab3a53c45be47accae") + .commitMessage("full commit message") + .testBundle(testBundle) + .build(); + } + + protected enum Endpoint { + SETTINGS, + SKIPPABLE_TESTS, + FLAKY_TESTS, + KNOWN_TESTS, + TEST_MANAGEMENT + } + + /** + * Build a {@link ConfigurationApi} that responds to a call against {@code endpoint} with {@code + * responseBody}. The other endpoints are not exercised in the contract tests and need not be + * wired by the subclass. + */ + protected abstract ConfigurationApi apiReturning(Endpoint endpoint, String responseBody) + throws IOException; + + static Stream parsesSettingsArguments() { + return Stream.of( + arguments( + "all flags off, default branch unset", + new CiVisibilitySettings( + false, + false, + false, + false, + false, + false, + false, + false, + false, + EarlyFlakeDetectionSettings.DEFAULT, + TestManagementSettings.DEFAULT, + null, + false)), + arguments( + "all flags on, default branch set", + new CiVisibilitySettings( + true, + true, + true, + true, + true, + true, + true, + true, + true, + EarlyFlakeDetectionSettings.DEFAULT, + TestManagementSettings.DEFAULT, + "main", + false)), + arguments( + "mixed flags, single execution-by-duration", + new CiVisibilitySettings( + false, + true, + false, + true, + false, + true, + false, + false, + true, + new EarlyFlakeDetectionSettings( + true, singletonList(new ExecutionsByDuration(1000, 3)), 10), + new TestManagementSettings(true, 10), + "master", + false)), + arguments( + "mixed flags, multiple executions-by-duration spanning the 60s boundary", + new CiVisibilitySettings( + false, + false, + true, + true, + false, + false, + true, + true, + false, + new EarlyFlakeDetectionSettings( + true, + Arrays.asList( + new ExecutionsByDuration(5000, 3), new ExecutionsByDuration(120000, 2)), + 10), + new TestManagementSettings(true, 20), + "prod", + false))); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("parsesSettingsArguments") + void parsesSettings(String scenario, CiVisibilitySettings expected) throws IOException { + Map data = new HashMap<>(); + data.put("settings", expected); + String body = render("settings-response.ftl", data); + + ConfigurationApi api = apiReturning(Endpoint.SETTINGS, body); + + assertEquals(expected, api.getSettings(ENV)); + } + + static Stream parsesSkippableTestsArguments() { + Map> twoModules = new HashMap<>(); + Map bundleA = new HashMap<>(); + bundleA.put(new TestIdentifier("suite-a", "name-a", "parameters-a"), new TestMetadata(true)); + twoModules.put("testBundle-a", bundleA); + Map bundleB = new HashMap<>(); + bundleB.put(new TestIdentifier("suite-b", "name-b", null), new TestMetadata(false)); + twoModules.put("testBundle-b", bundleB); + + // Tests in the "one module" fixture omit test.bundle from configurations; the parser falls + // back to the tracer environment's testBundle to determine module assignment. + Map> oneModule = new HashMap<>(); + Map singleBundle = new HashMap<>(); + singleBundle.put( + new TestIdentifier("suite-a", "name-a", "parameters-a"), new TestMetadata(true)); + singleBundle.put(new TestIdentifier("suite-b", "name-b", null), new TestMetadata(true)); + oneModule.put("testBundle-a", singleBundle); + + return Stream.of( + arguments("two modules", ENV, "skippable-response.ftl", twoModules), + arguments( + "one module", + envWithBundle("testBundle-a"), + "skippable-response-one-module.ftl", + oneModule)); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("parsesSkippableTestsArguments") + void parsesSkippableTests( + String scenario, + TracerEnvironment env, + String fixture, + Map> expectedTests) + throws IOException { + String body = render(fixture, Collections.emptyMap()); + + ConfigurationApi api = apiReturning(Endpoint.SKIPPABLE_TESTS, body); + SkippableTests result = api.getSkippableTests(env); + + assertEquals(expectedTests, result.getIdentifiersByModule()); + assertEquals("11223344", result.getCorrelationId()); + Map coverage = result.getCoveredLinesByRelativeSourcePath(); + assertEquals(3, coverage.size()); + assertEquals( + bits(0, 1, 2, 3, 4, 5, 6, 7, 14, 15, 24, 25, 26, 27, 28, 29, 30, 31), + coverage.get("src/main/java/Calculator.java")); + assertEquals( + bits(24, 25, 26, 27, 28, 29, 30, 37, 38, 39, 50, 51, 52, 53, 54, 55), + coverage.get("src/main/java/utils/Math.java")); + assertEquals( + bits(0, 1, 2, 3, 4, 5, 6, 7, 12, 13, 14, 15, 27, 28, 29, 30, 50, 51, 52, 53, 54, 55), + coverage.get("src/test/java/CalculatorTest.java")); + } + + private static BitSet bits(int... positions) { + BitSet b = new BitSet(); + for (int p : positions) { + b.set(p); + } + return b; + } + + static Stream parsesFlakyTestsArguments() { + Map> twoModules = new HashMap<>(); + twoModules.put("testBundle-a", new HashSet<>(singletonList(new TestFQN("suite-a", "name-a")))); + twoModules.put("testBundle-b", new HashSet<>(singletonList(new TestFQN("suite-b", "name-b")))); + + Map> oneModule = new HashMap<>(); + oneModule.put("testBundle-a", new HashSet<>(singletonList(new TestFQN("suite-a", "name-a")))); + + return Stream.of( + arguments("two modules", ENV, "flaky-response.ftl", twoModules), + arguments( + "one module", + envWithBundle("testBundle-a"), + "flaky-response-one-module.ftl", + oneModule)); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("parsesFlakyTestsArguments") + void parsesFlakyTests( + String scenario, + TracerEnvironment env, + String fixture, + Map> expectedTests) + throws IOException { + String body = render(fixture, Collections.emptyMap()); + + ConfigurationApi api = apiReturning(Endpoint.FLAKY_TESTS, body); + Map> result = api.getFlakyTestsByModule(env); + + assertEquals(expectedTests, result); + } + + @Test + void parsesKnownTests() throws IOException { + String body = render("known-tests-response.ftl", Collections.emptyMap()); + + ConfigurationApi api = apiReturning(Endpoint.KNOWN_TESTS, body); + Map> result = api.getKnownTestsByModule(ENV); + + assertNotNull(result); + assertEquals(2, result.size()); + Collection bundleA = result.get("test-bundle-a"); + assertTrue(bundleA.contains(new TestFQN("test-suite-a", "test-name-1"))); + assertTrue(bundleA.contains(new TestFQN("test-suite-a", "test-name-2"))); + assertTrue(bundleA.contains(new TestFQN("test-suite-b", "another-test-name-1"))); + assertTrue(bundleA.contains(new TestFQN("test-suite-b", "test-name-2"))); + Collection bundleN = result.get("test-bundle-N"); + assertTrue(bundleN.contains(new TestFQN("test-suite-M", "test-name-1"))); + assertTrue(bundleN.contains(new TestFQN("test-suite-M", "test-name-2"))); + } + + @Test + void parsesTestManagement() throws IOException { + String body = render("test-management-tests-response.ftl", Collections.emptyMap()); + + ConfigurationApi api = apiReturning(Endpoint.TEST_MANAGEMENT, body); + Map>> result = + api.getTestManagementTestsByModule(ENV, ENV.getSha(), ENV.getCommitMessage()); + + Map> quarantined = new HashMap<>(); + quarantined.put( + "module-a", + new HashSet<>( + Arrays.asList(new TestFQN("suite-a", "test-a"), new TestFQN("suite-b", "test-c")))); + quarantined.put("module-b", new HashSet<>(singletonList(new TestFQN("suite-c", "test-e")))); + assertEquals(quarantined, result.get(TestSetting.QUARANTINED)); + + Map> disabled = new HashMap<>(); + disabled.put("module-a", new HashSet<>(singletonList(new TestFQN("suite-a", "test-b")))); + disabled.put( + "module-b", + new HashSet<>( + Arrays.asList(new TestFQN("suite-c", "test-d"), new TestFQN("suite-c", "test-f")))); + assertEquals(disabled, result.get(TestSetting.DISABLED)); + + Map> attemptToFix = new HashMap<>(); + attemptToFix.put("module-a", new HashSet<>(singletonList(new TestFQN("suite-b", "test-c")))); + attemptToFix.put( + "module-b", + new HashSet<>( + Arrays.asList(new TestFQN("suite-c", "test-d"), new TestFQN("suite-c", "test-e")))); + assertEquals(attemptToFix, result.get(TestSetting.ATTEMPT_TO_FIX)); + } + + protected static String render(String templateName, Map data) throws IOException { + Template template = FREEMARKER.getTemplate(FIXTURE_DIR + templateName); + StringWriter out = new StringWriter(); + try { + template.process(data, out); + } catch (TemplateException e) { + throw new IOException("Failed to render template " + templateName, e); + } + return out.toString(); + } + + private static final Configuration FREEMARKER; + + static { + FREEMARKER = new Configuration(Configuration.VERSION_2_3_30); + FREEMARKER.setClassLoaderForTemplateLoading( + AbstractConfigurationApiContractTest.class.getClassLoader(), ""); + FREEMARKER.setDefaultEncoding("UTF-8"); + FREEMARKER.setLogTemplateExceptions(false); + FREEMARKER.setWrapUncheckedExceptions(true); + FREEMARKER.setFallbackOnNullLoopVariable(false); + FREEMARKER.setNumberFormat("0.######"); + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/test/java/datadog/trace/civisibility/config/ConfigurationApiImplTest.java b/dd-java-agent/agent-ci-visibility/src/test/java/datadog/trace/civisibility/config/ConfigurationApiImplTest.java new file mode 100644 index 00000000000..117e4e4e48c --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/test/java/datadog/trace/civisibility/config/ConfigurationApiImplTest.java @@ -0,0 +1,357 @@ +package datadog.trace.civisibility.config; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.params.provider.Arguments.arguments; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import datadog.communication.BackendApi; +import datadog.communication.EvpProxyApi; +import datadog.communication.IntakeApi; +import datadog.communication.http.HttpRetryPolicy; +import datadog.communication.http.OkHttpUtils; +import datadog.trace.agent.test.server.http.JavaTestHttpServer; +import datadog.trace.api.civisibility.config.TestFQN; +import datadog.trace.api.civisibility.telemetry.NoOpMetricCollector; +import datadog.trace.api.intake.Intake; +import datadog.trace.civisibility.config.api.dto.request.TracerEnvironment; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.net.URI; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Comparator; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.stream.Stream; +import java.util.zip.GZIPOutputStream; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import org.apache.commons.io.IOUtils; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import org.skyscreamer.jsonassert.JSONAssert; +import org.skyscreamer.jsonassert.JSONCompareMode; + +class ConfigurationApiImplTest extends AbstractConfigurationApiContractTest { + + private static final int REQUEST_TIMEOUT_MILLIS = 15_000; + + private static final String REQUEST_UID = "1234"; + + // Backend path each endpoint listens on (relative to /api/v2/). + private static final Map ENDPOINT_PATHS = new HashMap<>(); + + static { + ENDPOINT_PATHS.put(Endpoint.SETTINGS, "/api/v2/libraries/tests/services/setting"); + ENDPOINT_PATHS.put(Endpoint.SKIPPABLE_TESTS, "/api/v2/ci/tests/skippable"); + ENDPOINT_PATHS.put(Endpoint.FLAKY_TESTS, "/api/v2/ci/libraries/tests/flaky"); + ENDPOINT_PATHS.put(Endpoint.KNOWN_TESTS, "/api/v2/ci/libraries/tests"); + ENDPOINT_PATHS.put(Endpoint.TEST_MANAGEMENT, "/api/v2/test/libraries/test-management/tests"); + } + + private final List servers = new ArrayList<>(); + + @AfterEach + void closeServers() { + for (JavaTestHttpServer server : servers) { + server.close(); + } + servers.clear(); + } + + @Override + protected ConfigurationApi apiReturning(Endpoint endpoint, String responseBody) { + JavaTestHttpServer server = + JavaTestHttpServer.httpServer( + s -> + s.handlers( + h -> + h.prefix( + ENDPOINT_PATHS.get(endpoint), + api -> sendResponseBody(api, responseBody.getBytes())))); + servers.add(server); + return givenConfigurationApi(server, true, true); + } + + // A response payload that exists only to keep the round-trip happy: parse correctness for the + // settings endpoint is covered by AbstractConfigurationApiContractTest#parsesSettings. + private static final CiVisibilitySettings CANONICAL_SETTINGS_RESPONSE = + new CiVisibilitySettings( + false, + false, + false, + false, + false, + false, + false, + false, + false, + EarlyFlakeDetectionSettings.DEFAULT, + TestManagementSettings.DEFAULT, + null, + false); + + static Stream testSettingsRequestArguments() { + return Stream.of( + arguments("agentless=false, compression=false", false, false), + arguments("agentless=false, compression=true", false, true), + arguments("agentless=true, compression=false", true, false), + arguments("agentless=true, compression=true", true, true)); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("testSettingsRequestArguments") + void testSettingsRequest(String scenario, boolean agentless, boolean compression) + throws IOException { + TracerEnvironment tracerEnvironment = givenTracerEnvironment(null); + + Map requestData = new HashMap<>(); + requestData.put("uid", REQUEST_UID); + requestData.put("tracerEnvironment", tracerEnvironment); + Map responseData = new HashMap<>(); + responseData.put("settings", CANONICAL_SETTINGS_RESPONSE); + + JavaTestHttpServer intakeServer = + givenBackendEndpoint( + "/api/v2/libraries/tests/services/setting", + "settings-request.ftl", + requestData, + "settings-response.ftl", + responseData); + ConfigurationApi configurationApi = givenConfigurationApi(intakeServer, agentless, compression); + + configurationApi.getSettings(tracerEnvironment); + } + + static Stream testSkippableTestsRequestArguments() { + return Stream.of( + arguments("no test bundle", null, "skippable-request.ftl"), + arguments("with test bundle", "testBundle-a", "skippable-request-one-module.ftl")); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("testSkippableTestsRequestArguments") + void testSkippableTestsRequest(String scenario, String testBundle, String requestTemplate) + throws IOException { + TracerEnvironment tracerEnvironment = givenTracerEnvironment(testBundle); + + Map requestData = new HashMap<>(); + requestData.put("uid", REQUEST_UID); + requestData.put("tracerEnvironment", tracerEnvironment); + + JavaTestHttpServer intakeServer = + givenBackendEndpoint( + "/api/v2/ci/tests/skippable", + requestTemplate, + requestData, + "skippable-response.ftl", + new HashMap<>()); + ConfigurationApi configurationApi = givenConfigurationApi(intakeServer, true, true); + + configurationApi.getSkippableTests(tracerEnvironment); + } + + static Stream testFlakyTestsRequestArguments() { + return Stream.of( + arguments("no test bundle", null, "flaky-request.ftl"), + arguments("with test bundle", "testBundle-a", "flaky-request-one-module.ftl")); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("testFlakyTestsRequestArguments") + void testFlakyTestsRequest(String scenario, String testBundle, String requestTemplate) + throws IOException { + TracerEnvironment tracerEnvironment = givenTracerEnvironment(testBundle); + + Map requestData = new HashMap<>(); + requestData.put("uid", REQUEST_UID); + requestData.put("tracerEnvironment", tracerEnvironment); + + JavaTestHttpServer intakeServer = + givenBackendEndpoint( + "/api/v2/ci/libraries/tests/flaky", + requestTemplate, + requestData, + "flaky-response.ftl", + new HashMap<>()); + ConfigurationApi configurationApi = givenConfigurationApi(intakeServer, true, true); + + configurationApi.getFlakyTestsByModule(tracerEnvironment); + } + + @Test + void testKnownTestsRequestWithPagination() throws IOException { + TracerEnvironment tracerEnvironment = givenTracerEnvironment(null); + AtomicInteger requestCount = new AtomicInteger(0); + + String page1 = + "{\"data\":{\"id\":\"page1\",\"type\":\"ci_app_libraries_tests\",\"attributes\":{\"tests\":{\"module-a\":{\"suite-a\":[\"test-1\",\"test-2\"]}},\"page_info\":{\"size\":2,\"has_next\":true,\"cursor\":\"cursor-page-2\"}}}}"; + String page2 = + "{\"data\":{\"id\":\"page2\",\"type\":\"ci_app_libraries_tests\",\"attributes\":{\"tests\":{\"module-b\":{\"suite-b\":[\"test-3\",\"test-4\"]}},\"page_info\":{\"size\":2,\"has_next\":true,\"cursor\":\"cursor-page-3\"}}}}"; + String page3 = + "{\"data\":{\"id\":\"page3\",\"type\":\"ci_app_libraries_tests\",\"attributes\":{\"tests\":{\"module-c\":{\"suite-c\":[\"test-5\",\"test-6\"]}},\"page_info\":{\"size\":2,\"has_next\":false}}}}"; + List responses = Arrays.asList(page1, page2, page3); + + JavaTestHttpServer intakeServer = + JavaTestHttpServer.httpServer( + s -> + s.handlers( + h -> + h.prefix( + "/api/v2/ci/libraries/tests", + api -> { + int current = requestCount.incrementAndGet(); + sendResponseBody(api, responses.get(current - 1).getBytes()); + }))); + servers.add(intakeServer); + ConfigurationApi configurationApi = givenConfigurationApi(intakeServer, true, true); + + Map> knownTests = + configurationApi.getKnownTestsByModule(tracerEnvironment); + sortValues(knownTests); + + assertEquals(3, requestCount.get()); + + Map> expected = new LinkedHashMap<>(); + expected.put( + "module-a", + Arrays.asList(new TestFQN("suite-a", "test-1"), new TestFQN("suite-a", "test-2"))); + expected.put( + "module-b", + Arrays.asList(new TestFQN("suite-b", "test-3"), new TestFQN("suite-b", "test-4"))); + expected.put( + "module-c", + Arrays.asList(new TestFQN("suite-c", "test-5"), new TestFQN("suite-c", "test-6"))); + assertEquals(expected, knownTests); + } + + private ConfigurationApi givenConfigurationApi( + JavaTestHttpServer intakeServer, boolean agentless, boolean compression) { + BackendApi api = + agentless + ? givenIntakeApi(intakeServer.getAddress(), compression) + : givenEvpProxy(intakeServer.getAddress(), compression); + return new ConfigurationApiImpl(api, NoOpMetricCollector.INSTANCE, () -> REQUEST_UID); + } + + private JavaTestHttpServer givenBackendEndpoint( + String path, + String requestTemplate, + Map requestData, + String responseTemplate, + Map responseData) + throws IOException { + String expectedRequestBody = render(requestTemplate, requestData); + byte[] responseBody = render(responseTemplate, responseData).getBytes(); + JavaTestHttpServer server = + JavaTestHttpServer.httpServer( + s -> + s.handlers( + h -> + h.prefix( + path, + api -> { + JavaTestHttpServer.HandlerApi.ResponseApi response = + api.getResponse(); + try { + JSONAssert.assertEquals( + expectedRequestBody, + new String(api.getRequest().getBody()), + JSONCompareMode.LENIENT); + } catch (AssertionError error) { + response.status(400).send(error.getMessage().getBytes()); + return; + } + sendResponseBody(api, responseBody); + }))); + servers.add(server); + return server; + } + + private static void sendResponseBody(JavaTestHttpServer.HandlerApi api, byte[] body) { + JavaTestHttpServer.HandlerApi.ResponseApi response = api.getResponse(); + String header = api.getRequest().getHeader("Accept-Encoding"); + if (header != null && header.contains("gzip")) { + response.addHeader("Content-Encoding", "gzip"); + body = gzip(body); + } + response.status(200).send(body); + } + + private static byte[] gzip(byte[] payload) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try (GZIPOutputStream zip = new GZIPOutputStream(baos)) { + IOUtils.copy(new ByteArrayInputStream(payload), zip); + } catch (IOException e) { + throw new IllegalStateException(e); + } + return baos.toByteArray(); + } + + private BackendApi givenEvpProxy(URI address, boolean responseCompression) { + String traceId = "a-trace-id"; + HttpUrl proxyUrl = HttpUrl.get(address); + HttpRetryPolicy.Factory retryPolicyFactory = new HttpRetryPolicy.Factory(5, 100, 2.0); + OkHttpClient client = OkHttpUtils.buildHttpClient(proxyUrl, REQUEST_TIMEOUT_MILLIS); + return new EvpProxyApi( + traceId, proxyUrl, "api", retryPolicyFactory, client, responseCompression); + } + + private BackendApi givenIntakeApi(URI address, boolean responseCompression) { + HttpUrl intakeUrl = + HttpUrl.get(String.format("%s/api/%s/", address.toString(), Intake.API.getVersion())); + + String apiKey = "api-key"; + String traceId = "a-trace-id"; + + HttpRetryPolicy retryPolicy = mock(HttpRetryPolicy.class); + when(retryPolicy.shouldRetry(any(okhttp3.Response.class))).thenReturn(false); + + HttpRetryPolicy.Factory retryPolicyFactory = mock(HttpRetryPolicy.Factory.class); + when(retryPolicyFactory.create()).thenReturn(retryPolicy); + + OkHttpClient client = OkHttpUtils.buildHttpClient(intakeUrl, REQUEST_TIMEOUT_MILLIS); + return new IntakeApi( + intakeUrl, apiKey, traceId, retryPolicyFactory, client, responseCompression); + } + + private static TracerEnvironment givenTracerEnvironment(String testBundle) { + return TracerEnvironment.builder() + .service("foo") + .env("foo_env") + .repositoryUrl("https://github.com/DataDog/foo") + .branch("prod") + .sha("d64185e45d1722ab3a53c45be47accae") + .commitMessage("full commit message") + .osPlatform("linux") + .osArchitecture("amd64") + .osVersion("bionic") + .runtimeName("runtimeName") + .runtimeVersion("runtimeVersion") + .runtimeVendor("vendor") + .runtimeArchitecture("amd64") + .customTag("customTag", "customValue") + .testBundle(testBundle) + .build(); + } + + private static void sortValues(Map> tests) { + Comparator bySuiteThenName = + Comparator.comparing(TestFQN::getSuite).thenComparing(TestFQN::getName); + for (Map.Entry> e : tests.entrySet()) { + List sorted = new ArrayList<>(e.getValue()); + sorted.sort(bySuiteThenName); + e.setValue(sorted); + } + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/test/java/datadog/trace/civisibility/config/FileBasedConfigurationApiTest.java b/dd-java-agent/agent-ci-visibility/src/test/java/datadog/trace/civisibility/config/FileBasedConfigurationApiTest.java index 81d492590df..3aa3df05763 100644 --- a/dd-java-agent/agent-ci-visibility/src/test/java/datadog/trace/civisibility/config/FileBasedConfigurationApiTest.java +++ b/dd-java-agent/agent-ci-visibility/src/test/java/datadog/trace/civisibility/config/FileBasedConfigurationApiTest.java @@ -1,43 +1,39 @@ package datadog.trace.civisibility.config; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertSame; -import static org.junit.jupiter.api.Assertions.assertTrue; -import datadog.trace.api.civisibility.config.TestFQN; -import datadog.trace.api.civisibility.config.TestIdentifier; -import datadog.trace.api.civisibility.config.TestMetadata; -import freemarker.template.Configuration; -import freemarker.template.Template; import java.io.IOException; -import java.io.StringWriter; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -class FileBasedConfigurationApiTest { +class FileBasedConfigurationApiTest extends AbstractConfigurationApiContractTest { - private static final String FIXTURE_DIR = "/datadog/trace/civisibility/config/"; + @TempDir Path tmp; - private static final TracerEnvironment ENV = - TracerEnvironment.builder() - .service("foo") - .env("foo_env") - .repositoryUrl("https://github.com/DataDog/foo") - .branch("prod") - .sha("d64185e45d1722ab3a53c45be47accae") - .commitMessage("full commit message") - .build(); + @Override + protected ConfigurationApi apiReturning(Endpoint endpoint, String responseBody) + throws IOException { + Path file = writeText("payload.json", responseBody); + switch (endpoint) { + case SETTINGS: + return new FileBasedConfigurationApi(file, null, null, null, null); + case SKIPPABLE_TESTS: + return new FileBasedConfigurationApi(null, file, null, null, null); + case FLAKY_TESTS: + return new FileBasedConfigurationApi(null, null, file, null, null); + case KNOWN_TESTS: + return new FileBasedConfigurationApi(null, null, null, file, null); + case TEST_MANAGEMENT: + return new FileBasedConfigurationApi(null, null, null, null, file); + default: + throw new IllegalArgumentException("Unsupported endpoint: " + endpoint); + } + } @Test void returnsDefaultsWhenAllPathsAreNull() throws IOException { @@ -51,125 +47,9 @@ void returnsDefaultsWhenAllPathsAreNull() throws IOException { } @Test - void parsesSettings(@TempDir Path tmp) throws IOException { - CiVisibilitySettings expected = - new CiVisibilitySettings( - true, - true, - true, - true, - true, - true, - true, - true, - true, - EarlyFlakeDetectionSettings.DEFAULT, - TestManagementSettings.DEFAULT, - "main", - false); - Map data = new HashMap<>(); - data.put("settings", expected); - Path file = renderToFile(tmp, "settings-response.ftl", "settings.json", data); - - FileBasedConfigurationApi api = new FileBasedConfigurationApi(file, null, null, null, null); - - assertEquals(expected, api.getSettings(ENV)); - } - - @Test - void parsesSettingsWithEarlyFlakeDetectionAndTestManagement(@TempDir Path tmp) - throws IOException { - CiVisibilitySettings expected = - new CiVisibilitySettings( - false, - true, - false, - true, - false, - true, - false, - false, - true, - new EarlyFlakeDetectionSettings( - true, Arrays.asList(new ExecutionsByDuration(1000, 3)), 10), - new TestManagementSettings(true, 10), - "master", - false); - Map data = new HashMap<>(); - data.put("settings", expected); - Path file = renderToFile(tmp, "settings-response.ftl", "settings.json", data); - - FileBasedConfigurationApi api = new FileBasedConfigurationApi(file, null, null, null, null); - - assertEquals(expected, api.getSettings(ENV)); - } - - @Test - void parsesSkippableTests(@TempDir Path tmp) throws IOException { - Path file = - renderToFile(tmp, "skippable-response.ftl", "skippable.json", Collections.emptyMap()); - - FileBasedConfigurationApi api = new FileBasedConfigurationApi(null, file, null, null, null); - SkippableTests result = api.getSkippableTests(ENV); - - Map> expected = new HashMap<>(); - Map bundleA = new HashMap<>(); - bundleA.put(new TestIdentifier("suite-a", "name-a", "parameters-a"), new TestMetadata(true)); - expected.put("testBundle-a", bundleA); - Map bundleB = new HashMap<>(); - bundleB.put(new TestIdentifier("suite-b", "name-b", null), new TestMetadata(false)); - expected.put("testBundle-b", bundleB); - - assertEquals(expected, result.getIdentifiersByModule()); - assertEquals("11223344", result.getCorrelationId()); - // coverage bitmaps encoded in the template - assertEquals(3, result.getCoveredLinesByRelativeSourcePath().size()); - assertTrue( - result.getCoveredLinesByRelativeSourcePath().containsKey("src/main/java/Calculator.java")); - assertTrue( - result.getCoveredLinesByRelativeSourcePath().containsKey("src/main/java/utils/Math.java")); - assertTrue( - result - .getCoveredLinesByRelativeSourcePath() - .containsKey("src/test/java/CalculatorTest.java")); - } - - @Test - void parsesFlakyTests(@TempDir Path tmp) throws IOException { - Path file = renderToFile(tmp, "flaky-response.ftl", "flaky.json", Collections.emptyMap()); - - FileBasedConfigurationApi api = new FileBasedConfigurationApi(null, null, file, null, null); - Map> result = api.getFlakyTestsByModule(ENV); - - Map> expected = new HashMap<>(); - expected.put("testBundle-a", new HashSet<>(Arrays.asList(new TestFQN("suite-a", "name-a")))); - expected.put("testBundle-b", new HashSet<>(Arrays.asList(new TestFQN("suite-b", "name-b")))); - assertEquals(expected, result); - } - - @Test - void parsesKnownTests(@TempDir Path tmp) throws IOException { - Path file = renderToFile(tmp, "known-tests-response.ftl", "known.json", Collections.emptyMap()); - - FileBasedConfigurationApi api = new FileBasedConfigurationApi(null, null, null, file, null); - Map> result = api.getKnownTestsByModule(ENV); - - assertNotNull(result); - assertEquals(2, result.size()); - Collection bundleA = result.get("test-bundle-a"); - assertTrue(bundleA.contains(new TestFQN("test-suite-a", "test-name-1"))); - assertTrue(bundleA.contains(new TestFQN("test-suite-a", "test-name-2"))); - assertTrue(bundleA.contains(new TestFQN("test-suite-b", "another-test-name-1"))); - assertTrue(bundleA.contains(new TestFQN("test-suite-b", "test-name-2"))); - Collection bundleN = result.get("test-bundle-N"); - assertTrue(bundleN.contains(new TestFQN("test-suite-M", "test-name-1"))); - assertTrue(bundleN.contains(new TestFQN("test-suite-M", "test-name-2"))); - } - - @Test - void knownTestsReturnsNullWhenResponseHasNoTests(@TempDir Path tmp) throws IOException { + void knownTestsReturnsNullWhenResponseHasNoTests() throws IOException { // Matches the backend API contract: empty-but-present known-tests payload → null - Path file = writeText(tmp, "empty-known.json", "{\"data\":{\"attributes\":{\"tests\":{}}}}"); + Path file = writeText("empty-known.json", "{\"data\":{\"attributes\":{\"tests\":{}}}}"); FileBasedConfigurationApi api = new FileBasedConfigurationApi(null, null, null, file, null); @@ -177,85 +57,19 @@ void knownTestsReturnsNullWhenResponseHasNoTests(@TempDir Path tmp) throws IOExc } @Test - void parsesTestManagement(@TempDir Path tmp) throws IOException { - Path file = - renderToFile( - tmp, "test-management-tests-response.ftl", "mgmt.json", Collections.emptyMap()); - - FileBasedConfigurationApi api = new FileBasedConfigurationApi(null, null, null, null, file); - Map>> result = - api.getTestManagementTestsByModule(ENV, ENV.getSha(), ENV.getCommitMessage()); - - Map> quarantined = new HashMap<>(); - quarantined.put( - "module-a", - new HashSet<>( - Arrays.asList(new TestFQN("suite-a", "test-a"), new TestFQN("suite-b", "test-c")))); - quarantined.put("module-b", new HashSet<>(Arrays.asList(new TestFQN("suite-c", "test-e")))); - assertEquals(quarantined, result.get(TestSetting.QUARANTINED)); - - Map> disabled = new HashMap<>(); - disabled.put("module-a", new HashSet<>(Arrays.asList(new TestFQN("suite-a", "test-b")))); - disabled.put( - "module-b", - new HashSet<>( - Arrays.asList(new TestFQN("suite-c", "test-d"), new TestFQN("suite-c", "test-f")))); - assertEquals(disabled, result.get(TestSetting.DISABLED)); - - Map> attemptToFix = new HashMap<>(); - attemptToFix.put("module-a", new HashSet<>(Arrays.asList(new TestFQN("suite-b", "test-c")))); - attemptToFix.put( - "module-b", - new HashSet<>( - Arrays.asList(new TestFQN("suite-c", "test-d"), new TestFQN("suite-c", "test-e")))); - assertEquals(attemptToFix, result.get(TestSetting.ATTEMPT_TO_FIX)); - } - - @Test - void propagatesIOExceptionForMissingFile(@TempDir Path tmp) { + void propagatesIOExceptionForMissingFile() { Path missing = tmp.resolve("does-not-exist.json"); FileBasedConfigurationApi api = new FileBasedConfigurationApi(missing, null, null, null, null); assertThrowsIO(() -> api.getSettings(ENV)); } - private static Path renderToFile( - Path dir, String templateName, String outputName, Map data) - throws IOException { - String content = render(templateName, data); - return writeText(dir, outputName, content); - } - - private static Path writeText(Path dir, String name, String content) throws IOException { - Path p = dir.resolve(name); + private Path writeText(String name, String content) throws IOException { + Path p = tmp.resolve(name); Files.write(p, content.getBytes(StandardCharsets.UTF_8)); return p; } - private static final Configuration FREEMARKER; - - static { - FREEMARKER = new Configuration(Configuration.VERSION_2_3_30); - FREEMARKER.setClassLoaderForTemplateLoading( - FileBasedConfigurationApiTest.class.getClassLoader(), ""); - FREEMARKER.setDefaultEncoding("UTF-8"); - FREEMARKER.setLogTemplateExceptions(false); - FREEMARKER.setWrapUncheckedExceptions(true); - FREEMARKER.setFallbackOnNullLoopVariable(false); - FREEMARKER.setNumberFormat("0.######"); - } - - private static String render(String templateName, Map data) throws IOException { - Template template = FREEMARKER.getTemplate(FIXTURE_DIR + templateName); - StringWriter out = new StringWriter(); - try { - template.process(data, out); - } catch (freemarker.template.TemplateException e) { - throw new IOException("Failed to render template " + templateName, e); - } - return out.toString(); - } - private static void assertThrowsIO(ThrowingRunnable runnable) { try { runnable.run(); diff --git a/dd-java-agent/agent-ci-visibility/src/test/java/datadog/trace/civisibility/coverage/line/LineCoverageStoreTest.java b/dd-java-agent/agent-ci-visibility/src/test/java/datadog/trace/civisibility/coverage/line/LineCoverageStoreTest.java new file mode 100644 index 00000000000..fe719cdc78d --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/test/java/datadog/trace/civisibility/coverage/line/LineCoverageStoreTest.java @@ -0,0 +1,38 @@ +package datadog.trace.civisibility.coverage.line; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; + +import datadog.trace.civisibility.coverage.line.LineCoverageStore.AnalysisCacheKey; +import org.junit.jupiter.api.Test; + +class LineCoverageStoreTest { + + @Test + void cacheKeyReusesAnalysisForSameClassAndProbes() { + AnalysisCacheKey key = new AnalysisCacheKey(1L, new boolean[] {true, false, true, false}); + AnalysisCacheKey same = new AnalysisCacheKey(1L, new boolean[] {true, false, true, false}); + // identical class id + probe set must collide so the analysis is reused + assertEquals(key, same); + assertEquals(key.hashCode(), same.hashCode()); + } + + @Test + void cacheKeyDistinguishesClassesAndProbeSets() { + AnalysisCacheKey key = new AnalysisCacheKey(1L, new boolean[] {true, false, true}); + // a different class or a different probe set must NOT hit the same cache entry + assertNotEquals(key, new AnalysisCacheKey(2L, new boolean[] {true, false, true})); + assertNotEquals(key, new AnalysisCacheKey(1L, new boolean[] {true, true, true})); + } + + @Test + void cacheKeyIgnoresTrailingUnsetProbes() { + // The key bit-packs the activated probe set; trailing probes that never fire don't change + // coverage, so padding differences must not create distinct entries. + AnalysisCacheKey shortKey = new AnalysisCacheKey(1L, new boolean[] {true, false, true}); + AnalysisCacheKey padded = + new AnalysisCacheKey(1L, new boolean[] {true, false, true, false, false}); + assertEquals(shortKey, padded); + assertEquals(shortKey.hashCode(), padded.hashCode()); + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/test/java/datadog/trace/civisibility/coverage/report/CoverageReportUploaderTest.java b/dd-java-agent/agent-ci-visibility/src/test/java/datadog/trace/civisibility/coverage/report/CoverageReportUploaderTest.java new file mode 100644 index 00000000000..0a2c82c18dc --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/test/java/datadog/trace/civisibility/coverage/report/CoverageReportUploaderTest.java @@ -0,0 +1,131 @@ +package datadog.trace.civisibility.coverage.report; + +import static datadog.trace.agent.test.server.http.JavaTestHttpServer.httpServer; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import datadog.communication.BackendApi; +import datadog.communication.IntakeApi; +import datadog.communication.http.HttpRetryPolicy; +import datadog.communication.http.OkHttpUtils; +import datadog.trace.agent.test.server.http.JavaTestHttpServer; +import datadog.trace.api.civisibility.telemetry.NoOpMetricCollector; +import datadog.trace.api.intake.Intake; +import datadog.trace.test.util.MultipartRequestParser; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.zip.GZIPInputStream; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import org.apache.commons.fileupload.FileItem; +import org.junit.jupiter.api.Test; + +class CoverageReportUploaderTest { + + private static final int REQUEST_TIMEOUT_MILLIS = 15_000; + + private static final ObjectMapper JSON_MAPPER = new ObjectMapper(); + private static final TypeReference> EVENT_TYPE = + new TypeReference>() {}; + + private static final String COVERAGE_REPORT_BODY = "report-body"; + private static final String JACOCO_FORMAT = "jacoco"; + private static final String CI_TAG_KEY = "ci-tag-key"; + private static final String CI_TAG_VALUE = "ci-tag-value"; + + @Test + void uploadsCoverageReportWithoutFlags() throws IOException { + CapturedRequest request = uploadCoverageReport(Collections.emptyList()); + + assertEquals(3, request.event.size()); + assertEquals(JACOCO_FORMAT, request.event.get("format")); + assertEquals("coverage_report", request.event.get("type")); + assertEquals(CI_TAG_VALUE, request.event.get(CI_TAG_KEY)); + assertFalse(request.event.containsKey("report.flags")); + assertEquals(COVERAGE_REPORT_BODY, new String(request.coverage, StandardCharsets.UTF_8)); + } + + @Test + void uploadsCoverageReportWithOrderedDuplicateFlags() throws IOException { + List flags = Arrays.asList("type:unit-tests", "jvm-21", "jvm-21"); + + CapturedRequest request = uploadCoverageReport(flags); + + assertEquals(4, request.event.size()); + assertEquals(JACOCO_FORMAT, request.event.get("format")); + assertEquals("coverage_report", request.event.get("type")); + assertEquals(CI_TAG_VALUE, request.event.get(CI_TAG_KEY)); + assertEquals(flags, request.event.get("report.flags")); + assertEquals(COVERAGE_REPORT_BODY, new String(request.coverage, StandardCharsets.UTF_8)); + } + + private static CapturedRequest uploadCoverageReport(List flags) throws IOException { + CapturedRequest capturedRequest = new CapturedRequest(); + try (JavaTestHttpServer server = + httpServer( + s -> + s.handlers( + h -> + h.prefix( + "/api/v2/cicovreprt", + api -> { + Map> multipart = + MultipartRequestParser.parseRequest( + api.getRequest().getBody(), + api.getRequest().getHeader("Content-Type")); + capturedRequest.event = + JSON_MAPPER.readValue( + multipart.get("event").get(0).get(), EVENT_TYPE); + capturedRequest.coverage = + gunzip(multipart.get("coverage").get(0).get()); + api.getResponse().status(200).send(); + })))) { + BackendApi backendApi = givenIntakeApi(server.getAddress()); + CoverageReportUploader uploader = + new CoverageReportUploader( + backendApi, + Collections.singletonMap(CI_TAG_KEY, CI_TAG_VALUE), + flags, + NoOpMetricCollector.INSTANCE); + + uploader.upload( + JACOCO_FORMAT, + new ByteArrayInputStream(COVERAGE_REPORT_BODY.getBytes(StandardCharsets.UTF_8))); + } + return capturedRequest; + } + + private static byte[] gunzip(byte[] compressed) throws IOException { + try (ByteArrayInputStream input = new ByteArrayInputStream(compressed); + GZIPInputStream gzip = new GZIPInputStream(input); + ByteArrayOutputStream output = new ByteArrayOutputStream()) { + byte[] buffer = new byte[8192]; + for (int readCount; (readCount = gzip.read(buffer)) != -1; ) { + output.write(buffer, 0, readCount); + } + return output.toByteArray(); + } + } + + private static BackendApi givenIntakeApi(URI address) { + HttpUrl intakeUrl = + HttpUrl.get(String.format("%s/api/%s/", address, Intake.CI_INTAKE.getVersion())); + HttpRetryPolicy.Factory retryPolicyFactory = new HttpRetryPolicy.Factory(5, 100, 2.0); + OkHttpClient client = OkHttpUtils.buildHttpClient(intakeUrl, REQUEST_TIMEOUT_MILLIS); + return new IntakeApi(intakeUrl, "api-key", "a-trace-id", retryPolicyFactory, client, false); + } + + private static final class CapturedRequest { + private Map event; + private byte[] coverage; + } +} diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/ci/codeowners/CODEOWNERS_gitlab_sample b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/codeowners/CODEOWNERS_gitlab_sample new file mode 100644 index 00000000000..fbb90556778 --- /dev/null +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/codeowners/CODEOWNERS_gitlab_sample @@ -0,0 +1,58 @@ +# GitLab CODEOWNERS file exercising sections and default owners. +# https://docs.gitlab.com/user/project/codeowners/reference/ + +# Entries before any section behave like a plain (GitHub-style) CODEOWNERS file. They form an +# unnamed section whose owners are combined with those of every other matching section. +* @global-owner +# Exclusions can also apply to the unnamed section. +!unowned.txt + +# A section with default owners: every entry inherits them unless it declares its own. +[Documentation] @docs-team +docs/ +README.md + +# Default owners can be a list; a specific entry can override them. +[Database] @database-team @dba-lead +model/db/ +config/db/setup.sql @special-owner + +# Optional sections (prefixed with '^') are parsed exactly like required ones for ownership. +^[Optional Frontend] @frontend-team +*.js +*.css @css-owner + +# A section with no default owners: entries keep whatever owners they declare. +[Tooling] +scripts/ @scripts-team + +# The required-approvals count in the header ([N]) is accepted and ignored for ownership. +[Requires Approvals][2] @security-team +secrets/ + +# A header immediately followed by a comment (no whitespace) is still a valid header, here with no +# default owners; entries below must not inherit the previous section's owners. +[Generated]# generated files, no specific owners +generated/ + +# A later section can match a path already owned elsewhere; owners from every section are combined. +[Shared Config] @config-team +config/ + +# A section name repeated later (here with different capitalization) is combined into a single +# case-insensitive section, with last-match precedence applied across all of its entries. +[Backend] @backend-team-a +service/ + +[BACKEND] @backend-team-b +service/api/ + +# An exclusion suppresses its section even if a later entry matches the same path. +[Generated Files] @generated-files-team +generated-assets/ +!generated-assets/excluded/ +generated-assets/excluded/special.txt @special-owner + +# Exclusions do not suppress ownership from other sections. +[Other Generated Files] @other-generated-files-team +generated-assets/excluded/ diff --git a/dd-java-agent/agent-ci-visibility/src/test/resources/ci/jenkins.json b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/jenkins.json index 722a1a90d0d..7a771c311e0 100644 --- a/dd-java-agent/agent-ci-visibility/src/test/resources/ci/jenkins.json +++ b/dd-java-agent/agent-ci-visibility/src/test/resources/ci/jenkins.json @@ -5,6 +5,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_BRANCH": "origin/master", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL_1": "https://jenkins.com/repo/sample.git", @@ -14,7 +15,7 @@ "JOB_URL": "https://jenkins.com/job" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.name": "jobName", "ci.pipeline.number": "jenkins-pipeline-number", @@ -31,6 +32,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_BRANCH": "origin/master", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "https://jenkins.com/repo/sample.git", @@ -39,7 +41,7 @@ "JOB_URL": "https://jenkins.com/job" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.name": "jobName", "ci.pipeline.number": "jenkins-pipeline-number", @@ -56,6 +58,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_BRANCH": "origin/master", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "https://jenkins.com/repo/sample.git", @@ -64,7 +67,7 @@ "JOB_URL": "https://jenkins.com/job" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.name": "jobName", "ci.pipeline.number": "jenkins-pipeline-number", @@ -81,6 +84,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_BRANCH": "origin/master", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "https://jenkins.com/repo/sample.git", @@ -90,7 +94,7 @@ "WORKSPACE": "foo/bar" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.name": "jobName", "ci.pipeline.number": "jenkins-pipeline-number", @@ -108,6 +112,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_BRANCH": "origin/master", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "https://jenkins.com/repo/sample.git", @@ -117,7 +122,7 @@ "WORKSPACE": "/foo/bar~" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.name": "jobName", "ci.pipeline.number": "jenkins-pipeline-number", @@ -135,6 +140,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_BRANCH": "origin/master", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "https://jenkins.com/repo/sample.git", @@ -144,7 +150,7 @@ "WORKSPACE": "/foo/~/bar" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.name": "jobName", "ci.pipeline.number": "jenkins-pipeline-number", @@ -162,6 +168,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_BRANCH": "origin/master", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "https://jenkins.com/repo/sample.git", @@ -173,7 +180,7 @@ "WORKSPACE": "~/foo/bar" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.name": "jobName", "ci.pipeline.number": "jenkins-pipeline-number", @@ -191,6 +198,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_BRANCH": "origin/master", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "https://jenkins.com/repo/sample.git", @@ -202,7 +210,7 @@ "WORKSPACE": "~foo/bar" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.name": "jobName", "ci.pipeline.number": "jenkins-pipeline-number", @@ -220,6 +228,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_BRANCH": "origin/master", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "https://jenkins.com/repo/sample.git", @@ -231,7 +240,7 @@ "WORKSPACE": "~" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.name": "jobName", "ci.pipeline.number": "jenkins-pipeline-number", @@ -249,6 +258,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_BRANCH": "origin/master", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "https://jenkins.com/repo/sample.git", @@ -258,7 +268,7 @@ "WORKSPACE": "/foo/bar" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.name": "jobName", "ci.pipeline.number": "jenkins-pipeline-number", @@ -276,6 +286,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_BRANCH": "refs/heads/master", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "https://jenkins.com/repo/sample.git", @@ -285,7 +296,7 @@ "WORKSPACE": "/foo/bar" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.name": "jobName", "ci.pipeline.number": "jenkins-pipeline-number", @@ -303,6 +314,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_BRANCH": "refs/heads/master", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "https://jenkins.com/repo/sample.git", @@ -312,7 +324,7 @@ "WORKSPACE": "/foo/bar" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.name": "jobName/another", "ci.pipeline.number": "jenkins-pipeline-number", @@ -330,6 +342,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_BRANCH": "refs/heads/feature/one", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "https://jenkins.com/repo/sample.git", @@ -339,7 +352,7 @@ "WORKSPACE": "/foo/bar" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.name": "jobName", "ci.pipeline.number": "jenkins-pipeline-number", @@ -357,6 +370,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_BRANCH": "refs/heads/master", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "https://jenkins.com/repo/sample.git", @@ -366,7 +380,7 @@ "WORKSPACE": "/foo/bar" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.name": "jobName", "ci.pipeline.number": "jenkins-pipeline-number", @@ -384,6 +398,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_BRANCH": "refs/heads/master", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "https://jenkins.com/repo/sample.git", @@ -393,7 +408,7 @@ "WORKSPACE": "/foo/bar" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.name": "jobName", "ci.pipeline.number": "jenkins-pipeline-number", @@ -411,6 +426,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_BRANCH": "origin/tags/0.1.0", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "https://jenkins.com/repo/sample.git", @@ -419,7 +435,7 @@ "WORKSPACE": "/foo/bar" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.number": "jenkins-pipeline-number", "ci.pipeline.url": "https://jenkins.com/pipeline", @@ -436,6 +452,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_BRANCH": "refs/heads/tags/0.1.0", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "https://jenkins.com/repo/sample.git", @@ -444,7 +461,7 @@ "WORKSPACE": "/foo/bar" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.number": "jenkins-pipeline-number", "ci.pipeline.url": "https://jenkins.com/pipeline", @@ -461,6 +478,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_BRANCH": "origin/master", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "http://hostname.com/repo.git", @@ -470,7 +488,7 @@ "WORKSPACE": "/foo/bar" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.name": "jobName", "ci.pipeline.number": "jenkins-pipeline-number", @@ -488,6 +506,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_BRANCH": "origin/master", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "http://user@hostname.com/repo.git", @@ -497,7 +516,7 @@ "WORKSPACE": "/foo/bar" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.name": "jobName", "ci.pipeline.number": "jenkins-pipeline-number", @@ -515,6 +534,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_BRANCH": "origin/master", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "http://user%E2%82%AC@hostname.com/repo.git", @@ -524,7 +544,7 @@ "WORKSPACE": "/foo/bar" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.name": "jobName", "ci.pipeline.number": "jenkins-pipeline-number", @@ -542,6 +562,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_BRANCH": "origin/master", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "http://user:pwd@hostname.com/repo.git", @@ -551,7 +572,7 @@ "WORKSPACE": "/foo/bar" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.name": "jobName", "ci.pipeline.number": "jenkins-pipeline-number", @@ -569,6 +590,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_BRANCH": "origin/master", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL": "git@hostname.com:org/repo.git", @@ -578,7 +600,7 @@ "WORKSPACE": "/foo/bar" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.name": "jobName", "ci.pipeline.number": "jenkins-pipeline-number", @@ -596,6 +618,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "DD_GIT_BRANCH": "user-supplied-branch", "DD_GIT_COMMIT_AUTHOR_DATE": "usersupplied-authordate", "DD_GIT_COMMIT_AUTHOR_EMAIL": "usersupplied-authoremail", @@ -611,7 +634,7 @@ "JOB_URL": "https://jenkins.com/job" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.number": "jenkins-pipeline-number", "ci.pipeline.url": "https://jenkins.com/pipeline", @@ -634,6 +657,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "DD_GIT_COMMIT_AUTHOR_DATE": "usersupplied-authordate", "DD_GIT_COMMIT_AUTHOR_EMAIL": "usersupplied-authoremail", "DD_GIT_COMMIT_AUTHOR_NAME": "usersupplied-authorname", @@ -649,7 +673,7 @@ "JOB_URL": "https://jenkins.com/job" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.number": "jenkins-pipeline-number", "ci.pipeline.url": "https://jenkins.com/pipeline", @@ -672,6 +696,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "DD_TEST_CASE_NAME": "http-repository-url-no-git-suffix", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL_1": "https://github.com/DataDog/dogweb", @@ -679,7 +704,7 @@ "JOB_URL": "https://jenkins.com/job" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.number": "jenkins-pipeline-number", "ci.pipeline.url": "https://jenkins.com/pipeline", @@ -694,6 +719,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "DD_TEST_CASE_NAME": "ssh-repository-url-no-git-suffix", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL_1": "ssh://host.xz:54321/path/to/repo/", @@ -701,7 +727,7 @@ "JOB_URL": "https://jenkins.com/job" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.number": "jenkins-pipeline-number", "ci.pipeline.url": "https://jenkins.com/pipeline", @@ -716,13 +742,14 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL_1": "https://user:password@github.com/DataDog/dogweb.git", "JENKINS_URL": "jenkins", "JOB_URL": "https://jenkins.com/job" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.number": "jenkins-pipeline-number", "ci.pipeline.url": "https://jenkins.com/pipeline", @@ -737,13 +764,14 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL_1": "https://user@github.com/DataDog/dogweb.git", "JENKINS_URL": "jenkins", "JOB_URL": "https://jenkins.com/job" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.number": "jenkins-pipeline-number", "ci.pipeline.url": "https://jenkins.com/pipeline", @@ -758,13 +786,14 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL_1": "https://user:password@github.com:1234/DataDog/dogweb.git", "JENKINS_URL": "jenkins", "JOB_URL": "https://jenkins.com/job" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.number": "jenkins-pipeline-number", "ci.pipeline.url": "https://jenkins.com/pipeline", @@ -779,13 +808,14 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL_1": "https://user:password@1.1.1.1/DataDog/dogweb.git", "JENKINS_URL": "jenkins", "JOB_URL": "https://jenkins.com/job" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.number": "jenkins-pipeline-number", "ci.pipeline.url": "https://jenkins.com/pipeline", @@ -800,13 +830,14 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL_1": "https://user:password@1.1.1.1:1234/DataDog/dogweb.git", "JENKINS_URL": "jenkins", "JOB_URL": "https://jenkins.com/job" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.number": "jenkins-pipeline-number", "ci.pipeline.url": "https://jenkins.com/pipeline", @@ -821,13 +852,14 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL_1": "https://user:password@1.1.1.1:1234/DataDog/dogweb_with_@_yeah.git", "JENKINS_URL": "jenkins", "JOB_URL": "https://jenkins.com/job" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.number": "jenkins-pipeline-number", "ci.pipeline.url": "https://jenkins.com/pipeline", @@ -842,13 +874,14 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL_1": "ssh://user@host.xz:54321/path/to/repo.git/", "JENKINS_URL": "jenkins", "JOB_URL": "https://jenkins.com/job" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.number": "jenkins-pipeline-number", "ci.pipeline.url": "https://jenkins.com/pipeline", @@ -863,13 +896,14 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "GIT_URL_1": "ssh://user:password@host.xz:54321/path/to/repo.git/", "JENKINS_URL": "jenkins", "JOB_URL": "https://jenkins.com/job" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.number": "jenkins-pipeline-number", "ci.pipeline.url": "https://jenkins.com/pipeline", @@ -884,6 +918,7 @@ "BUILD_TAG": "jenkins-pipeline-id", "BUILD_URL": "https://jenkins.com/pipeline", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "JENKINS_URL": "jenkins", "JOB_URL": "https://jenkins.com/job", @@ -891,7 +926,7 @@ "NODE_NAME": "my-node" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.node.labels": "[\"built-in\",\"linux\"]", "ci.node.name": "my-node", "ci.pipeline.id": "jenkins-pipeline-id", @@ -909,12 +944,13 @@ "CHANGE_ID": 42, "CHANGE_TARGET": "target-branch", "DD_CUSTOM_TRACE_ID": "jenkins-custom-trace-id", + "DD_CUSTOM_PARENT_ID": "jenkins-custom-parent-id", "GIT_COMMIT": "b9f0fb3fdbb94c9d24b2c75b49663122a529e123", "JENKINS_URL": "jenkins", "JOB_URL": "https://jenkins.com/job" }, { - "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\"}", + "_dd.ci.env_vars": "{\"DD_CUSTOM_TRACE_ID\":\"jenkins-custom-trace-id\",\"DD_CUSTOM_PARENT_ID\":\"jenkins-custom-parent-id\"}", "ci.pipeline.id": "jenkins-pipeline-id", "ci.pipeline.number": "jenkins-pipeline-number", "ci.pipeline.url": "https://jenkins.com/pipeline", diff --git a/dd-java-agent/agent-crashtracking/build.gradle b/dd-java-agent/agent-crashtracking/build.gradle index af93daaeb0a..663611c6cf3 100644 --- a/dd-java-agent/agent-crashtracking/build.gradle +++ b/dd-java-agent/agent-crashtracking/build.gradle @@ -28,7 +28,6 @@ dependencies { testImplementation libs.assertj.core testImplementation libs.json.unit.assertj testImplementation libs.jackson.databind - testImplementation libs.testcontainers testImplementation group: 'com.squareup.okhttp3', name: 'mockwebserver', version: libs.versions.okhttp.legacy.get() } diff --git a/dd-java-agent/agent-crashtracking/gradle.lockfile b/dd-java-agent/agent-crashtracking/gradle.lockfile index 2761bba8443..56861864506 100644 --- a/dd-java-agent/agent-crashtracking/gradle.lockfile +++ b/dd-java-agent/agent-crashtracking/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-crashtracking:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -14,19 +15,16 @@ com.fasterxml.jackson.core:jackson-annotations:2.20=testCompileClasspath,testRun com.fasterxml.jackson.core:jackson-core:2.20.0=testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-databind:2.20.0=testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.20.0=testCompileClasspath,testRuntimeClasspath -com.github.docker-java:docker-java-api:3.4.2=testCompileClasspath,testRuntimeClasspath -com.github.docker-java:docker-java-transport-zerodep:3.4.2=testCompileClasspath,testRuntimeClasspath -com.github.docker-java:docker-java-transport:3.4.2=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -42,10 +40,9 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -junit:junit:4.13.2=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.13.0=testCompileClasspath,testRuntimeClasspath +junit:junit:4.12=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.javacrumbs.json-unit:json-unit-assertj:2.40.1=testCompileClasspath,testRuntimeClasspath net.javacrumbs.json-unit:json-unit-core:2.40.1=testCompileClasspath,testRuntimeClasspath net.javacrumbs.json-unit:json-unit-json-path:2.40.1=testCompileClasspath,testRuntimeClasspath @@ -55,7 +52,6 @@ net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc org.apache.bcel:bcel:6.11.0=spotbugs -org.apache.commons:commons-compress:1.24.0=testCompileClasspath,testRuntimeClasspath org.apache.commons:commons-lang3:3.19.0=spotbugs org.apache.commons:commons-text:1.14.0=spotbugs org.apache.logging.log4j:log4j-api:2.25.2=spotbugs @@ -76,13 +72,12 @@ org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:2.2=testCompileClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.jctools:jctools-core-jdk11:4.0.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jetbrains:annotations:17.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -98,20 +93,23 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt org.ow2.asm:asm-commons:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt org.ow2.asm:asm-tree:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt org.ow2.asm:asm:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs -org.rnorth.duct-tape:duct-tape:1.0.8=testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:1.7.30=compileClasspath,runtimeClasspath -org.slf4j:slf4j-api:1.7.36=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.32=testCompileClasspath +org.slf4j:slf4j-api:1.7.36=testRuntimeClasspath org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.snakeyaml:snakeyaml-engine:2.9=runtimeClasspath,testRuntimeClasspath @@ -119,6 +117,5 @@ org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClas org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath -org.testcontainers:testcontainers:1.21.4=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs empty=annotationProcessor,spotbugsPlugins,testAnnotationProcessor diff --git a/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/ConfigManager.java b/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/ConfigManager.java index 02c10016d83..99e6235a6b2 100644 --- a/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/ConfigManager.java +++ b/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/ConfigManager.java @@ -8,6 +8,7 @@ import datadog.trace.api.Config; import datadog.trace.api.ProcessTags; import datadog.trace.api.WellKnownTags; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.util.PidHelper; import datadog.trace.util.RandomUtils; import java.io.BufferedReader; @@ -137,7 +138,7 @@ public Builder extendedInfoEnabled(boolean extendedInfoEnabled) { return this; } - // @VisibleForTesting + @VisibleForTesting Builder reportUUID(String reportUUID) { this.reportUUID = reportUUID; return this; @@ -170,7 +171,7 @@ private static String getBaseName(File file) { return filename.substring(0, dotIndex); } - // @VisibleForTesting + @VisibleForTesting static String getMergedTagsForSerialization(Config config) { return config.getMergedCrashTrackingTags().entrySet().stream() .filter(e -> e.getValue() != null) @@ -195,7 +196,7 @@ public static void writeConfigToPath(File scriptFile, String... additionalEntrie writeConfigToFile(Config.get(), cfgFile, additionalEntries); } - // @VisibleForTesting + @VisibleForTesting static void writeConfigToFile(Config config, File cfgFile, String... additionalEntries) { final WellKnownTags wellKnownTags = config.getWellKnownTags(); diff --git a/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/CrashUploader.java b/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/CrashUploader.java index 76fd0e45f8c..7a838523993 100644 --- a/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/CrashUploader.java +++ b/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/CrashUploader.java @@ -24,12 +24,13 @@ import datadog.environment.SystemProperties; import datadog.trace.api.Config; import datadog.trace.api.DDTags; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.bootstrap.config.provider.ConfigProvider; import datadog.trace.util.AgentThreadFactory; import datadog.trace.util.PidHelper; import de.thetaphi.forbiddenapis.SuppressForbidden; -import edu.umd.cs.findbugs.annotations.NonNull; -import java.io.*; +import java.io.IOException; +import java.io.PrintStream; import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; @@ -129,7 +130,7 @@ public CrashUploader(@Nonnull final ConfigManager.StoredConfig storedConfig) { } CrashUploader( - @NonNull final Config config, @Nonnull final ConfigManager.StoredConfig storedConfig) { + @Nonnull final Config config, @Nonnull final ConfigManager.StoredConfig storedConfig) { this.config = config; this.storedConfig = storedConfig; this.uploaderSettings = storedConfig.toCrashUploaderSettings(); @@ -187,7 +188,7 @@ public void notifyCrashStarted(String error) { } } - // @VisibleForTesting + @VisibleForTesting void sendPingToTelemetry(String error) { // send a ping message to the telemetry to notify that the crash report started try (Buffer buf = new Buffer(); @@ -207,7 +208,7 @@ void sendPingToTelemetry(String error) { } } - // @VisibleForTesting + @VisibleForTesting void sendPingToErrorTracking(String error) { try { final CrashLog ping = @@ -253,7 +254,7 @@ public void upload(@Nonnull Path file) { } } - // @VisibleForTesting + @VisibleForTesting void remoteUpload( @Nonnull String fileContent, boolean sendToTelemetry, boolean sendToErrorTracking) { final String uuid = storedConfig.reportUUID; @@ -316,7 +317,7 @@ void uploadToLogs(@Nonnull String message, @Nonnull PrintStream out) throws IOEx } } - // @VisibleForTesting + @VisibleForTesting @SuppressForbidden static String extractErrorKind(String fileContent) { Matcher matcher = ERROR_MESSAGE_PATTERN.matcher(fileContent); @@ -348,7 +349,7 @@ static String extractErrorKind(String fileContent) { "$"), Pattern.DOTALL | Pattern.MULTILINE); - // @VisibleForTesting + @VisibleForTesting @SuppressForbidden static String extractErrorMessage(String fileContent) { Matcher matcher = ERROR_MESSAGE_PATTERN.matcher(fileContent); @@ -580,7 +581,8 @@ private RequestBody makeErrorTrackingRequestBody(@Nonnull CrashLog payload, bool if (payload.experimental != null && (payload.experimental.ucontext != null || payload.experimental.registerToMemoryMapping != null - || payload.experimental.runtimeArgs != null)) { + || payload.experimental.runtimeArgs != null + || payload.experimental.runtimeInfo != null)) { writer.name("experimental"); writer.beginObject(); if (payload.experimental.ucontext != null) { @@ -610,6 +612,20 @@ private RequestBody makeErrorTrackingRequestBody(@Nonnull CrashLog payload, bool } writer.endArray(); } + if (payload.experimental.runtimeInfo != null) { + writer.name("runtime_info"); + writer.beginObject(); + if (payload.experimental.runtimeInfo.jreVersion != null) { + writer.name("jre_version").value(payload.experimental.runtimeInfo.jreVersion); + } + if (payload.experimental.runtimeInfo.javaVm != null) { + writer.name("java_vm").value(payload.experimental.runtimeInfo.javaVm); + } + if (payload.experimental.runtimeInfo.vmInfo != null) { + writer.name("vm_info").value(payload.experimental.runtimeInfo.vmInfo); + } + writer.endObject(); + } writer.endObject(); } // files (e.g. /proc/self/maps or dynamic_libraries) diff --git a/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/CrashUploaderScriptInitializer.java b/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/CrashUploaderScriptInitializer.java index 0e810694be1..f2e7ac706bb 100644 --- a/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/CrashUploaderScriptInitializer.java +++ b/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/CrashUploaderScriptInitializer.java @@ -4,10 +4,12 @@ import static datadog.crashtracking.Initializer.LOG; import static datadog.crashtracking.Initializer.findAgentJar; import static datadog.crashtracking.Initializer.getCrashUploaderTemplate; +import static datadog.crashtracking.Initializer.isOwnedAndPrivate; import static datadog.trace.api.telemetry.LogCollector.SEND_TELEMETRY; import static java.util.Locale.ROOT; import datadog.environment.SystemProperties; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.util.PidHelper; import datadog.trace.util.Strings; import java.io.BufferedReader; @@ -25,17 +27,17 @@ public final class CrashUploaderScriptInitializer { private CrashUploaderScriptInitializer() {} - // @VisibleForTests - static void initialize(String onErrorVal, String onErrorFile) { - initialize(onErrorVal, onErrorFile, null); + @VisibleForTesting + static boolean initialize(String onErrorVal, String onErrorFile) { + return initialize(onErrorVal, onErrorFile, null); } - // @VisibleForTests - static void initialize(String onErrorVal, String onErrorFile, String javacorePath) { + @VisibleForTesting + static boolean initialize(String onErrorVal, String onErrorFile, String javacorePath) { if (onErrorVal == null || onErrorVal.isEmpty()) { LOG.debug( SEND_TELEMETRY, "'-XX:OnError' argument was not provided. Crash tracking is disabled."); - return; + return false; } if (onErrorFile == null || onErrorFile.isEmpty()) { onErrorFile = SystemProperties.get("user.dir") + "/hs_err_pid" + PidHelper.getPid() + ".log"; @@ -47,14 +49,14 @@ static void initialize(String onErrorVal, String onErrorFile, String javacorePat String agentJar = findAgentJar(); if (agentJar == null) { LOG.warn(SEND_TELEMETRY, "Unable to locate the agent jar. " + SETUP_FAILURE_MESSAGE); - return; + return false; } File scriptFile = new File(onErrorVal.replace(" %p", "")); boolean isDDCrashUploader = scriptFile.getName().toLowerCase(ROOT).contains("dd_crash_uploader"); if (isDDCrashUploader && !copyCrashUploaderScript(scriptFile, onErrorFile, agentJar)) { - return; + return false; } if (javacorePath != null && !javacorePath.isEmpty()) { @@ -62,6 +64,7 @@ static void initialize(String onErrorVal, String onErrorFile, String javacorePat } else { writeConfigToPath(scriptFile, "agent", agentJar, "hs_err", onErrorFile); } + return true; } private static boolean copyCrashUploaderScript( @@ -75,16 +78,17 @@ private static boolean copyCrashUploaderScript( scriptDirectory); return false; } - boolean permissionFailure = false; - permissionFailure |= !scriptDirectory.setReadable(true, false); - permissionFailure |= !scriptDirectory.setWritable(true, false); - permissionFailure |= !scriptDirectory.setExecutable(true, false); - if (permissionFailure) { + scriptDirectory.setReadable(true, true); + scriptDirectory.setWritable(true, true); + scriptDirectory.setExecutable(true, true); + } else { + if (!isOwnedAndPrivate(scriptDirectory)) { LOG.warn( SEND_TELEMETRY, - "Failed to set permissions on crash tracking script folder {}. {}", - scriptDirectory, - SETUP_FAILURE_MESSAGE); + "Untrusted crash tracking script folder {} (wrong owner or group/world bits set). " + + SETUP_FAILURE_MESSAGE, + scriptDirectory); + return false; } } if (!scriptDirectory.canWrite()) { @@ -94,6 +98,13 @@ private static boolean copyCrashUploaderScript( try { LOG.debug("Writing crash uploader script: {}", scriptFile); writeCrashUploaderScript(getCrashUploaderTemplate(), scriptFile, agentJar, onErrorFile); + } catch (UntrustedScriptException e) { + LOG.warn( + SEND_TELEMETRY, + "Untrusted crash uploader script {} (wrong owner or group/world-writable). " + + SETUP_FAILURE_MESSAGE, + scriptFile); + return false; } catch (IOException e) { LOG.warn( SEND_TELEMETRY, @@ -104,6 +115,13 @@ private static boolean copyCrashUploaderScript( return true; } + static class UntrustedScriptException extends IOException {} + + /** + * Writes the crash uploader script if it does not already exist. When the script already exists + * it is validated for POSIX ownership and permissions before reuse; an untrusted script causes + * this method to throw {@link UntrustedScriptException} so the caller can return {@code false}. + */ private static void writeCrashUploaderScript( InputStream template, File scriptFile, String execClass, String crashFile) throws IOException { @@ -119,9 +137,13 @@ private static void writeCrashUploaderScript( bw.newLine(); } } - scriptFile.setReadable(true, false); + scriptFile.setReadable(true, true); scriptFile.setWritable(false, false); - scriptFile.setExecutable(true, false); + scriptFile.setExecutable(true, true); + } else { + if (!isOwnedAndPrivate(scriptFile)) { + throw new UntrustedScriptException(); + } } } diff --git a/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/Initializer.java b/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/Initializer.java index 0aeca69ed00..8e1ba25f423 100644 --- a/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/Initializer.java +++ b/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/Initializer.java @@ -12,11 +12,18 @@ import datadog.trace.api.Platform; import datadog.trace.util.TempLocationManager; import java.io.File; +import java.io.IOException; import java.io.InputStream; import java.lang.management.ManagementFactory; import java.net.URL; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.attribute.PosixFilePermission; +import java.nio.file.attribute.UserPrincipal; import java.util.Arrays; +import java.util.EnumSet; import java.util.List; +import java.util.Set; import java.util.StringTokenizer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -154,7 +161,8 @@ private static boolean initializeJ9() { return false; } } catch (Throwable t) { - logInitializationError( + LOG.warn( + SEND_TELEMETRY, "Unexpected exception while initializing J9 crash tracking. Crash tracking will not work.", t); } @@ -361,18 +369,19 @@ private static void initializeCrashUploader(FlagAccess flags) { } } - // set the JVM flag - boolean rslt = flags.setValue("OnError", onErrorVal); - if (!rslt && LOG.isDebugEnabled()) { - LOG.debug( - SEND_TELEMETRY, - "Unable to set OnError flag to {}. Crash-tracking may not work.", - onErrorVal); + if (CrashUploaderScriptInitializer.initialize(uploadScript, onErrorFile)) { + // set the JVM flag only if the script was successfully initialized + boolean rslt = flags.setValue("OnError", onErrorVal); + if (!rslt && LOG.isDebugEnabled()) { + LOG.debug( + SEND_TELEMETRY, + "Unable to set OnError flag to {}. Crash-tracking may not work.", + onErrorVal); + } } - - CrashUploaderScriptInitializer.initialize(uploadScript, onErrorFile); } catch (Throwable t) { - logInitializationError( + LOG.warn( + SEND_TELEMETRY, "Unexpected exception while creating custom crash upload script. Crash tracking will not work properly.", t); } @@ -401,19 +410,21 @@ private static void initializeOOMENotifier(FlagAccess flags) { } } - // set the JVM flag - boolean rslt = flags.setValue("OnOutOfMemoryError", onOutOfMemoryVal); - if (!rslt && LOG.isDebugEnabled()) { - LOG.debug( - SEND_TELEMETRY, - "Unable to set OnOutOfMemoryError flag to {}. OOME tracking may not work.", - onOutOfMemoryVal); + if (OOMENotifierScriptInitializer.initialize(notifierScript)) { + // set the JVM flag only if the script was successfully initialized + boolean rslt = flags.setValue("OnOutOfMemoryError", onOutOfMemoryVal); + if (!rslt && LOG.isDebugEnabled()) { + LOG.debug( + SEND_TELEMETRY, + "Unable to set OnOutOfMemoryError flag to {}. OOME tracking may not work.", + onOutOfMemoryVal); + } } - - OOMENotifierScriptInitializer.initialize(notifierScript); } catch (Throwable t) { - logInitializationError( - "Unexpected exception while initializing OOME notifier. OOMEs will not be tracked.", t); + LOG.warn( + SEND_TELEMETRY, + "Unexpected exception while initializing OOME notifier. OOMEs will not be tracked.", + t); } } @@ -428,15 +439,37 @@ private static String getScriptFileName(String scriptName) { return scriptName + "." + (OperatingSystem.isWindows() ? "bat" : "sh"); } - private static void logInitializationError(String msg, Throwable t) { - if (LOG.isDebugEnabled()) { - LOG.warn(SEND_TELEMETRY, msg, t); - } else { - LOG.warn( - SEND_TELEMETRY, - "{} [{}] (Change the logging level to debug to see the full stacktrace)", - msg, - t.getMessage()); + private static final Set GROUP_WORLD_BITS = + EnumSet.of( + PosixFilePermission.GROUP_READ, + PosixFilePermission.GROUP_WRITE, + PosixFilePermission.GROUP_EXECUTE, + PosixFilePermission.OTHERS_READ, + PosixFilePermission.OTHERS_WRITE, + PosixFilePermission.OTHERS_EXECUTE); + + /** + * Returns {@code true} when {@code f} is safe to trust: on non-POSIX file systems always returns + * {@code true}; on POSIX returns {@code true} only when the path is owned by the current JVM user + * and has no group or world permission bits set (effective {@code 0700} for dirs, {@code 0600} or + * stricter for files). + */ + static boolean isOwnedAndPrivate(File f) { + if (OperatingSystem.isWindows()) { + return true; + } + try { + Path path = f.toPath(); + UserPrincipal owner = Files.getOwner(path); + UserPrincipal jvmUser = Files.getOwner(TempLocationManager.getInstance().getTempDir()); + if (!jvmUser.equals(owner)) { + return false; + } + Set perms = Files.getPosixFilePermissions(path); + return perms.stream().noneMatch(GROUP_WORLD_BITS::contains); + } catch (IOException | IllegalStateException e) { + LOG.debug("Unable to check ownership/permissions for {}: {}", f, e.getMessage()); + return false; } } } diff --git a/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/OOMENotifierScriptInitializer.java b/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/OOMENotifierScriptInitializer.java index c558d3a83a5..91420eda112 100644 --- a/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/OOMENotifierScriptInitializer.java +++ b/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/OOMENotifierScriptInitializer.java @@ -5,9 +5,11 @@ import static datadog.crashtracking.Initializer.findAgentJar; import static datadog.crashtracking.Initializer.getOomeNotifierTemplate; import static datadog.crashtracking.Initializer.getScriptPathFromArg; +import static datadog.crashtracking.Initializer.isOwnedAndPrivate; import static datadog.crashtracking.Initializer.pidFromSpecialFileName; import static datadog.trace.api.telemetry.LogCollector.SEND_TELEMETRY; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.util.PidHelper; import java.io.File; import java.io.FileOutputStream; @@ -20,13 +22,13 @@ public final class OOMENotifierScriptInitializer { private OOMENotifierScriptInitializer() {} - // @VisibleForTests - static void initialize(String onOutOfMemoryVal) { + @VisibleForTesting + static boolean initialize(String onOutOfMemoryVal) { if (onOutOfMemoryVal == null || onOutOfMemoryVal.isEmpty()) { LOG.debug( SEND_TELEMETRY, "'-XX:OnOutOfMemoryError' argument was not provided. OOME tracking is disabled."); - return; + return false; } File scriptFile = getOOMEScriptFile(onOutOfMemoryVal); if (scriptFile == null) { @@ -34,19 +36,20 @@ static void initialize(String onOutOfMemoryVal) { SEND_TELEMETRY, "OOME notifier script value ({}) does not follow the expected format: /dd_oome_notifier.(sh|bat) %p. OOME tracking is disabled.", onOutOfMemoryVal); - return; + return false; } String agentJar = findAgentJar(); if (agentJar == null) { LOG.warn( SEND_TELEMETRY, "Unable to locate the agent jar. OOME notification will not work properly."); - return; + return false; } if (!copyOOMEscript(scriptFile)) { - return; + return false; } writeConfigToPath(scriptFile, "agent", agentJar); + return true; } private static File getOOMEScriptFile(String onOutOfMemoryVal) { @@ -57,12 +60,17 @@ private static File getOOMEScriptFile(String onOutOfMemoryVal) { private static boolean copyOOMEscript(File scriptFile) { File scriptDirectory = scriptFile.getParentFile(); - // cleanup all stale process-specific generated files in the parent folder of the given OOME - // notifier script - runScriptCleanup(scriptDirectory); - if (scriptDirectory.exists()) { - // can be safely ignored; if the folder exists we will just reuse it + if (!isOwnedAndPrivate(scriptDirectory)) { + LOG.warn( + SEND_TELEMETRY, + "Untrusted OOME script folder {} (wrong owner or group/world bits set). OOME notification will not work properly.", + scriptDirectory); + return false; + } + // cleanup all stale process-specific generated files in the parent folder of the given OOME + // notifier script + runScriptCleanup(scriptDirectory); if (!scriptDirectory.canWrite()) { LOG.warn( SEND_TELEMETRY, @@ -78,19 +86,27 @@ private static boolean copyOOMEscript(File scriptFile) { scriptDirectory); return false; } - scriptDirectory.setReadable(true, false); - scriptDirectory.setWritable(true, false); - scriptDirectory.setExecutable(true, false); + scriptDirectory.setReadable(true, true); + scriptDirectory.setWritable(true, true); + scriptDirectory.setExecutable(true, true); } try { // do not overwrite existing if (!scriptFile.exists()) { copyStream(getOomeNotifierTemplate(), scriptFile); + scriptFile.setReadable(true, true); + scriptFile.setWritable(false, false); + scriptFile.setExecutable(true, true); + } else { + if (!isOwnedAndPrivate(scriptFile)) { + LOG.warn( + SEND_TELEMETRY, + "Untrusted OOME script {} (wrong owner or group/world-writable). OOME notification will not work properly.", + scriptFile); + return false; + } } - scriptFile.setReadable(true, false); - scriptFile.setWritable(false, false); - scriptFile.setExecutable(true, false); } catch (IOException e) { LOG.warn( SEND_TELEMETRY, diff --git a/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/dto/Experimental.java b/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/dto/Experimental.java index 30d04bc3f76..449bdd93156 100644 --- a/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/dto/Experimental.java +++ b/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/dto/Experimental.java @@ -14,21 +14,33 @@ public final class Experimental { @Json(name = "runtime_args") public final List runtimeArgs; + @Json(name = "runtime_info") + public final RuntimeInfo runtimeInfo; + public Experimental(Map ucontext) { - this(ucontext, null, null); + this(ucontext, null, null, null); } public Experimental(Map ucontext, List runtimeArgs) { - this(ucontext, null, runtimeArgs); + this(ucontext, null, runtimeArgs, null); } public Experimental( Map ucontext, Map registerToMemoryMapping, List runtimeArgs) { + this(ucontext, registerToMemoryMapping, runtimeArgs, null); + } + + public Experimental( + Map ucontext, + Map registerToMemoryMapping, + List runtimeArgs, + RuntimeInfo runtimeInfo) { this.ucontext = ucontext; this.registerToMemoryMapping = registerToMemoryMapping; this.runtimeArgs = runtimeArgs; + this.runtimeInfo = runtimeInfo; } @Override @@ -37,11 +49,12 @@ public boolean equals(Object o) { Experimental that = (Experimental) o; return Objects.equals(ucontext, that.ucontext) && Objects.equals(registerToMemoryMapping, that.registerToMemoryMapping) - && Objects.equals(runtimeArgs, that.runtimeArgs); + && Objects.equals(runtimeArgs, that.runtimeArgs) + && Objects.equals(runtimeInfo, that.runtimeInfo); } @Override public int hashCode() { - return Objects.hash(ucontext, registerToMemoryMapping, runtimeArgs); + return Objects.hash(ucontext, registerToMemoryMapping, runtimeArgs, runtimeInfo); } } diff --git a/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/dto/RuntimeInfo.java b/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/dto/RuntimeInfo.java new file mode 100644 index 00000000000..b103960158c --- /dev/null +++ b/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/dto/RuntimeInfo.java @@ -0,0 +1,45 @@ +package datadog.crashtracking.dto; + +import com.squareup.moshi.Json; +import java.util.Objects; + +/** + * JDK runtime information extracted from the hs_err crash log header and vm_info line. This + * captures the exact JDK vendor and build so crash reports can be correlated with the specific + * binaries in use. + */ +public final class RuntimeInfo { + @Json(name = "jre_version") + public final String jreVersion; + + @Json(name = "java_vm") + public final String javaVm; + + @Json(name = "vm_info") + public final String vmInfo; + + public RuntimeInfo(String jreVersion, String javaVm, String vmInfo) { + this.jreVersion = jreVersion; + this.javaVm = javaVm; + this.vmInfo = vmInfo; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RuntimeInfo that = (RuntimeInfo) o; + return Objects.equals(jreVersion, that.jreVersion) + && Objects.equals(javaVm, that.javaVm) + && Objects.equals(vmInfo, that.vmInfo); + } + + @Override + public int hashCode() { + return Objects.hash(jreVersion, javaVm, vmInfo); + } +} diff --git a/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/parsers/HotspotCrashLogParser.java b/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/parsers/HotspotCrashLogParser.java index 33985ebc65c..f4cc8e6874f 100644 --- a/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/parsers/HotspotCrashLogParser.java +++ b/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/parsers/HotspotCrashLogParser.java @@ -12,6 +12,7 @@ import datadog.crashtracking.dto.Metadata; import datadog.crashtracking.dto.OSInfo; import datadog.crashtracking.dto.ProcInfo; +import datadog.crashtracking.dto.RuntimeInfo; import datadog.crashtracking.dto.SigInfo; import datadog.crashtracking.dto.StackFrame; import datadog.crashtracking.dto.StackTrace; @@ -44,6 +45,9 @@ */ public final class HotspotCrashLogParser { private static final String HOTSPOT_JVM_ARGS_PREFIX = "jvm_args:"; + private static final String JRE_VERSION_PREFIX = "# JRE version: "; + private static final String JAVA_VM_PREFIX = "# Java VM: "; + private static final String VM_INFO_PREFIX = "vm_info: "; private static final DateTimeFormatter ZONED_DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("EEE MMM ppd HH:mm:ss yyyy zzz", Locale.getDefault()); private static final DateTimeFormatter OFFSET_DATE_TIME_FORMATTER = @@ -362,6 +366,9 @@ public CrashLog parse(String uuid, String crashLog) { String dynamicLibraryKey = null; boolean previousLineBlank = false; State nextThreadSectionState = null; + String jreVersion = null; + String javaVm = null; + String vmInfo = null; String[] lines = NEWLINE_SPLITTER.split(crashLog); outer: @@ -392,6 +399,11 @@ public CrashLog parse(String uuid, String crashLog) { } } } + if (jreVersion == null && line.startsWith(JRE_VERSION_PREFIX)) { + jreVersion = line.substring(JRE_VERSION_PREFIX.length()).trim(); + } else if (javaVm == null && line.startsWith(JAVA_VM_PREFIX)) { + javaVm = line.substring(JAVA_VM_PREFIX.length()).trim(); + } break; case HEADER: if (line.contains("S U M M A R Y")) { @@ -486,6 +498,8 @@ public CrashLog parse(String uuid, String crashLog) { state = State.DYNAMIC_LIBRARIES; } else if (line.contains("S Y S T E M")) { state = State.SYSTEM; + } else if (vmInfo == null && line.startsWith(VM_INFO_PREFIX)) { + vmInfo = line.substring(VM_INFO_PREFIX.length()).trim(); } else if (line.equals("END.")) { state = State.DONE; } @@ -527,6 +541,8 @@ public CrashLog parse(String uuid, String crashLog) { datetimeRaw = line.substring(6).trim(); } else if (datetime == null && datetimeRaw != null && line.startsWith("timezone: ")) { datetime = dateTimeToISO(datetimeRaw + " " + line.substring(10).trim()); + } else if (vmInfo == null && line.startsWith(VM_INFO_PREFIX)) { + vmInfo = line.substring(VM_INFO_PREFIX.length()).trim(); } break; case DONE: @@ -550,9 +566,12 @@ public CrashLog parse(String uuid, String crashLog) { if (oomMessage != null) { kind = "OutOfMemory"; message = oomMessage; - } else { - kind = sigInfo != null && sigInfo.name != null ? sigInfo.name : "UNKNOWN"; + } else if (sigInfo != null && sigInfo.name != null) { + kind = sigInfo.name; message = "Process terminated by signal " + kind; + } else { + kind = "InternalError"; + message = "Process terminated by Internal error"; } final List enrichedFrames = new ArrayList<>(frames.size()); @@ -606,11 +625,16 @@ public CrashLog parse(String uuid, String crashLog) { registerToMemoryMapping.replaceAll((k, v) -> RedactUtils.redactRegisterToMemoryMapping(v)); resolvedMapping = registerToMemoryMapping; } + RuntimeInfo runtimeInfo = + (jreVersion != null || javaVm != null || vmInfo != null) + ? new RuntimeInfo(jreVersion, javaVm, vmInfo) + : null; Experimental experimental = !registers.isEmpty() || resolvedMapping != null || (runtimeArgs != null && !runtimeArgs.isEmpty()) - ? new Experimental(registers, resolvedMapping, runtimeArgs) + || runtimeInfo != null + ? new Experimental(registers, resolvedMapping, runtimeArgs, runtimeInfo) : null; DynamicLibs files = (dynamicLibraryLines != null && !dynamicLibraryLines.isEmpty()) diff --git a/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/parsers/J9JavacoreParser.java b/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/parsers/J9JavacoreParser.java index 1d7214dde6d..cb5dc5ed8f5 100644 --- a/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/parsers/J9JavacoreParser.java +++ b/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/parsers/J9JavacoreParser.java @@ -11,6 +11,7 @@ import datadog.crashtracking.dto.Metadata; import datadog.crashtracking.dto.OSInfo; import datadog.crashtracking.dto.ProcInfo; +import datadog.crashtracking.dto.RuntimeInfo; import datadog.crashtracking.dto.SigInfo; import datadog.crashtracking.dto.StackFrame; import datadog.crashtracking.dto.StackTrace; @@ -46,6 +47,8 @@ */ public final class J9JavacoreParser { private static final String J9_USER_ARG_PREFIX = "2CIUSERARG"; + private static final String J9_JAVA_VERSION_PREFIX = "1CIJAVAVERSION "; + private static final String J9_VM_VERSION_PREFIX = "1CIVMVERSION"; private final BuildIdCollector buildIdCollector; @@ -119,6 +122,8 @@ public CrashLog parse(String uuid, String javacoreContent) { Map registers = null; RuntimeArgs j9UserArgs = new RuntimeArgs(); + String j9JavaVersion = null; + String j9VmVersion = null; String[] lines = NEWLINE_SPLITTER.split(javacoreContent); @@ -179,6 +184,11 @@ public CrashLog parse(String uuid, String javacoreContent) { if (pidMatcher.matches()) { pid = pidMatcher.group(1); } + if (j9JavaVersion == null && line.startsWith(J9_JAVA_VERSION_PREFIX)) { + j9JavaVersion = line.substring(J9_JAVA_VERSION_PREFIX.length()).trim(); + } else if (j9VmVersion == null && line.startsWith(J9_VM_VERSION_PREFIX)) { + j9VmVersion = line.substring(J9_VM_VERSION_PREFIX.length()).trim(); + } break; case THREADS: @@ -257,8 +267,8 @@ public CrashLog parse(String uuid, String javacoreContent) { : eventType.toUpperCase(Locale.ROOT); message = "Process terminated by signal " + kind; } else { - kind = "UNKNOWN"; - message = "Unknown crash event"; + kind = "InternalError"; + message = "Process terminated by Internal error"; } // Enrich frames with build IDs (best effort) @@ -299,10 +309,15 @@ public CrashLog parse(String uuid, String javacoreContent) { Integer parsedPid = safelyParseInt(pid); ProcInfo procInfo = parsedPid != null ? new ProcInfo(parsedPid) : null; List runtimeArgs = j9UserArgs.build(); + RuntimeInfo runtimeInfo = + (j9JavaVersion != null || j9VmVersion != null) + ? new RuntimeInfo(j9JavaVersion, null, j9VmVersion) + : null; Experimental experimental = (registers != null && !registers.isEmpty()) || (runtimeArgs != null && !runtimeArgs.isEmpty()) - ? new Experimental(registers, runtimeArgs) + || runtimeInfo != null + ? new Experimental(registers, null, runtimeArgs, runtimeInfo) : null; return new CrashLog( diff --git a/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/parsers/RedactUtils.java b/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/parsers/RedactUtils.java index 7be12817525..6665d0f412d 100644 --- a/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/parsers/RedactUtils.java +++ b/dd-java-agent/agent-crashtracking/src/main/java/datadog/crashtracking/parsers/RedactUtils.java @@ -1,5 +1,6 @@ package datadog.crashtracking.parsers; +import datadog.trace.api.internal.VisibleForTesting; import de.thetaphi.forbiddenapis.SuppressForbidden; import java.util.function.Function; import java.util.regex.Matcher; @@ -215,7 +216,7 @@ static String redactNmethodClass(String line) { * java.lang.Class} oop) use {@link #redactRegisterToMemoryMapping} which detects the oop type * automatically. */ - // @VisibleForTesting + @VisibleForTesting static String redactDottedClassOopRef(String line) { return redactStringOopRef(line, false); } diff --git a/dd-java-agent/agent-crashtracking/src/test/java/datadog/crashtracking/ScriptInitializerSecurityTest.java b/dd-java-agent/agent-crashtracking/src/test/java/datadog/crashtracking/ScriptInitializerSecurityTest.java new file mode 100644 index 00000000000..8f0cc003948 --- /dev/null +++ b/dd-java-agent/agent-crashtracking/src/test/java/datadog/crashtracking/ScriptInitializerSecurityTest.java @@ -0,0 +1,190 @@ +package datadog.crashtracking; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assumptions.assumeTrue; + +import java.io.IOException; +import java.nio.file.FileSystems; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.attribute.PosixFilePermission; +import java.nio.file.attribute.PosixFilePermissions; +import java.util.Comparator; +import java.util.Set; +import java.util.stream.Stream; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** + * Security tests for crashtracking script initializer ownership and permission validation. + * + *

POSIX-only (skipped automatically on non-POSIX). + */ +public class ScriptInitializerSecurityTest { + + private Path tempDir; + + @BeforeEach + void setup() throws IOException { + requirePosix(); + tempDir = Files.createTempDirectory("dd-security-test-"); + } + + private static void requirePosix() { + assumeTrue( + FileSystems.getDefault().supportedFileAttributeViews().contains("posix"), + "Skipping POSIX-only security tests on non-POSIX file system"); + } + + @AfterEach + void teardown() throws IOException { + if (tempDir == null || !Files.exists(tempDir)) { + return; + } + try (Stream stream = Files.walk(tempDir)) { + stream + .sorted(Comparator.reverseOrder()) + .map(Path::toFile) + .forEach( + f -> { + // Restore write permission before delete to handle read-only test artefacts + f.setWritable(true, false); + f.delete(); + }); + } + } + + @Test + void crashUploaderFreshDirIsOwnerRestricted() throws Exception { + Path scriptFile = tempDir.resolve("dd_crash_uploader.sh"); + CrashUploaderScriptInitializer.initialize(scriptFile.toString(), "/tmp/hs_err.log"); + + assertTrue(Files.exists(scriptFile), "Script should have been created"); + assertNoGroupWorldWriteBit(scriptFile); + assertNoGroupWorldWriteBit(tempDir); + } + + @Test + void crashUploaderHijackedScriptIsRefused() throws Exception { + Path scriptFile = tempDir.resolve("dd_crash_uploader.sh"); + // Plant an attacker-writable script + Files.createFile(scriptFile); + Files.setPosixFilePermissions(scriptFile, PosixFilePermissions.fromString("rwxrwxrwx")); + + long sizeBefore = Files.size(scriptFile); + + // Initializer must not proceed to write config (it returns false internally) + assertDoesNotThrow( + () -> CrashUploaderScriptInitializer.initialize(scriptFile.toString(), "/tmp/hs_err.log")); + + // The config file must NOT have been written (init refused) + String cfgName = scriptFile.getFileName().toString().replace(".sh", "") + "_pid*.cfg"; + boolean configWritten = + Files.list(tempDir).anyMatch(p -> p.getFileName().toString().endsWith(".cfg")); + assertFalse(configWritten, "Config must not be written when the script is hijacked"); + + // The script content must remain unchanged (empty file planted by attacker) + long sizeAfter = Files.size(scriptFile); + assertTrue( + sizeAfter == sizeBefore, + "Hijacked script must not be overwritten by the initializer (size changed)"); + } + + @Test + void crashUploaderHijackedDirectoryIsRefused() throws Exception { + // Create the script dir with world-writable perms to simulate hijack + Path scriptDir = tempDir.resolve("hijacked_crash_dir"); + Files.createDirectories(scriptDir); + Files.setPosixFilePermissions(scriptDir, PosixFilePermissions.fromString("rwxrwxrwx")); + + Path scriptFile = scriptDir.resolve("dd_crash_uploader.sh"); + assertDoesNotThrow( + () -> CrashUploaderScriptInitializer.initialize(scriptFile.toString(), "/tmp/hs_err.log")); + + // Script must not have been written into the untrusted dir + assertFalse(Files.exists(scriptFile), "Script must not be written into a hijacked directory"); + } + + @Test + void oomeNotifierFreshDirIsOwnerRestricted() throws Exception { + Path scriptFile = tempDir.resolve("dd_oome_notifier.sh"); + OOMENotifierScriptInitializer.initialize(scriptFile + " %p"); + + assertTrue(Files.exists(scriptFile), "OOME notifier script should have been created"); + assertNoGroupWorldWriteBit(scriptFile); + assertNoGroupWorldWriteBit(tempDir); + } + + @Test + void oomeNotifierHijackedScriptIsRefused() throws Exception { + Path scriptFile = tempDir.resolve("dd_oome_notifier.sh"); + // Plant an attacker-writable script + Files.createFile(scriptFile); + Files.setPosixFilePermissions(scriptFile, PosixFilePermissions.fromString("rwxrwxrwx")); + + long sizeBefore = Files.size(scriptFile); + + assertDoesNotThrow(() -> OOMENotifierScriptInitializer.initialize(scriptFile + " %p")); + + // Config must not be written when initializer refuses + boolean configWritten = + Files.list(tempDir).anyMatch(p -> p.getFileName().toString().endsWith(".cfg")); + assertFalse(configWritten, "Config must not be written when the OOME script is hijacked"); + + // Script content must be unchanged + long sizeAfter = Files.size(scriptFile); + assertTrue( + sizeAfter == sizeBefore, "Hijacked OOME script must not be overwritten by the initializer"); + } + + @Test + void oomeNotifierHijackedDirectoryIsRefused() throws Exception { + Path scriptDir = tempDir.resolve("hijacked_oome_dir"); + Files.createDirectories(scriptDir); + Files.setPosixFilePermissions(scriptDir, PosixFilePermissions.fromString("rwxrwxrwx")); + + Path scriptFile = scriptDir.resolve("dd_oome_notifier.sh"); + assertDoesNotThrow(() -> OOMENotifierScriptInitializer.initialize(scriptFile + " %p")); + + assertFalse(Files.exists(scriptFile), "Script must not be written into a hijacked directory"); + } + + @Test + void cleanPosixTreeEndToEndInitProducesScriptsAndConfigs() throws Exception { + Path crashScript = tempDir.resolve("dd_crash_uploader.sh"); + Path oomeScript = tempDir.resolve("dd_oome_notifier.sh"); + + // Initialise crash uploader + assertDoesNotThrow( + () -> CrashUploaderScriptInitializer.initialize(crashScript.toString(), "/tmp/hs_err.log")); + + // Initialise OOME notifier + assertDoesNotThrow(() -> OOMENotifierScriptInitializer.initialize(oomeScript + " %p")); + + // Both scripts must exist and be non-empty + assertTrue(Files.exists(crashScript), "dd_crash_uploader.sh must exist"); + assertTrue(Files.size(crashScript) > 0, "dd_crash_uploader.sh must be non-empty"); + assertTrue(Files.exists(oomeScript), "dd_oome_notifier.sh must exist"); + assertTrue(Files.size(oomeScript) > 0, "dd_oome_notifier.sh must be non-empty"); + + // At least one .cfg file must have been written (crash uploader config) + boolean crashCfgWritten = + Files.list(tempDir).anyMatch(p -> p.getFileName().toString().endsWith(".cfg")); + assertTrue(crashCfgWritten, "Crash uploader .cfg file must be written in the clean flow"); + } + + private static void assertNoGroupWorldWriteBit(Path path) throws IOException { + Set perms = Files.getPosixFilePermissions(path); + for (PosixFilePermission bit : + new PosixFilePermission[] { + PosixFilePermission.GROUP_WRITE, PosixFilePermission.OTHERS_WRITE + }) { + assertFalse( + perms.contains(bit), + "Expected no group/world write bit but found " + bit + " on " + path); + } + } +} diff --git a/dd-java-agent/agent-crashtracking/src/test/java/datadog/crashtracking/buildid/BuildIdExtractorIntegrationTest.java b/dd-java-agent/agent-crashtracking/src/test/java/datadog/crashtracking/buildid/BuildIdExtractorIntegrationTest.java index a0cf46ea89b..27a34360b0a 100644 --- a/dd-java-agent/agent-crashtracking/src/test/java/datadog/crashtracking/buildid/BuildIdExtractorIntegrationTest.java +++ b/dd-java-agent/agent-crashtracking/src/test/java/datadog/crashtracking/buildid/BuildIdExtractorIntegrationTest.java @@ -1,205 +1,58 @@ package datadog.crashtracking.buildid; -import static datadog.environment.OperatingSystem.Architecture.ARM64; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.junit.jupiter.api.Assumptions.assumeFalse; -import datadog.environment.OperatingSystem; -import java.io.IOException; -import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.time.Duration; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import java.util.stream.Stream; -import org.junit.jupiter.api.AfterAll; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.io.TempDir; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.Arguments; -import org.junit.jupiter.params.provider.MethodSource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.testcontainers.containers.Container.ExecResult; -import org.testcontainers.containers.GenericContainer; -import org.testcontainers.utility.DockerImageName; +import org.tabletest.junit.TableTest; /** - * Integration tests for BuildIdExtractor implementations using Docker containers. Tests validate - * build ID extraction from real ELF (Unix/Linux) and PE (Windows) binaries. + * Tests for BuildIdExtractor implementations using synthetic minimal fixture files committed to + * test resources. Fixtures cover ELF64/ELF32, little/big-endian, and PE32/PE32+ formats. */ public class BuildIdExtractorIntegrationTest { - private static final String DOTNET_SDK_MAJOR_VERSION = "8.0"; - private static GenericContainer linuxContainer; - private static GenericContainer dotnetContainer; - @TempDir private static Path tempDir; private static final Logger logger = LoggerFactory.getLogger(BuildIdExtractorIntegrationTest.class); - private static String dotnetVersion; - @BeforeAll - static void startContainers() throws IOException { - // Start Ubuntu container for ELF testing - // Use linux/amd64 platform to ensure x86_64 binaries are available - linuxContainer = - new GenericContainer<>( - DockerImageName.parse("ubuntu:22.04").asCompatibleSubstituteFor("ubuntu")) - .withCommand("sleep", "infinity") - .withStartupTimeout(Duration.ofMinutes(2)); - linuxContainer.start(); - - // Start dotnet SDK container for PE testing - // Use linux/amd64 platform to ensure consistent binary format - dotnetContainer = - new GenericContainer<>( - DockerImageName.parse("mcr.microsoft.com/dotnet/sdk:" + DOTNET_SDK_MAJOR_VERSION) - .asCompatibleSubstituteFor("dotnet")) - .withCommand("sleep", "infinity") - .withStartupTimeout(Duration.ofMinutes(2)); - dotnetContainer.start(); - - dotnetVersion = discoverExactDotnetVersionFrom(dotnetContainer); - } - - /** - * Discovers the .NET Core runtime version installed in the container by listing available - * versions. - * - * @param dotnetContainer the dotNet SDK container - * @return the discovered .NET version string - */ - private static String discoverExactDotnetVersionFrom(GenericContainer dotnetContainer) - throws IOException { - try { - ExecResult execResult = - dotnetContainer.execInContainer("ls", "/usr/share/dotnet/shared/Microsoft.NETCore.App"); - if (execResult.getExitCode() == 0) { - Pattern pattern = - Pattern.compile( - "^" + Pattern.quote(DOTNET_SDK_MAJOR_VERSION) + "\\.\\d+$", Pattern.MULTILINE); - Matcher matcher = pattern.matcher(execResult.getStdout()); - if (matcher.find()) { - return matcher.group(); - } - throw new IOException( - "No .NET " + DOTNET_SDK_MAJOR_VERSION + " version found in container"); - } - } catch (InterruptedException e) { - Thread.currentThread().interrupt(); - throw new IOException("Interrupted while discovering .NET version", e); - } - - throw new IOException("Failed to list .NET versions in container"); - } - - @AfterAll - static void stopContainers() throws IOException { - // Stop containers - if (linuxContainer != null) { - linuxContainer.stop(); - } - if (dotnetContainer != null) { - dotnetContainer.stop(); - } - } - - /** - * Copy a binary file from a container to the local temp directory. - * - * @param container The container to copy from - * @param containerPath Path to the binary inside the container - * @return Path to the copied binary in the local temp directory - */ - private Path copyFromContainer(GenericContainer container, String containerPath) - throws IOException { - String filename = Paths.get(containerPath).getFileName().toString(); - Path localPath = tempDir.resolve(filename + "-" + System.nanoTime()); - - container.copyFileFromContainer(containerPath, localPath.toString()); - - if (!Files.exists(localPath) || Files.size(localPath) == 0) { - throw new IOException("Failed to copy binary: " + containerPath); - } - - return localPath; - } - - private static Stream elfBinaries() { - return Stream.of( - Arguments.of("/lib/x86_64-linux-gnu/libc.so.6", "GNU C Library"), - Arguments.of("/lib/x86_64-linux-gnu/libm.so.6", "Math library"), - Arguments.of("/lib/x86_64-linux-gnu/libpthread.so.0", "POSIX threads library")); - } - - @ParameterizedTest(name = "ELF: {1}") - @MethodSource("elfBinaries") - void testElfBuildIdExtraction(String containerPath, String description) throws Exception { - // TODO: check if arm64 can be supported too. - assumeFalse(OperatingSystem.architecture() == ARM64, "Skipping for arm64"); - Path localBinary = copyFromContainer(linuxContainer, containerPath); + @TableTest({ + "scenario | resource | expectedBuildId ", + "ELF64 little-endian | buildid/elf/elf64-le.so | 0123456789abcdef0123456789abcdefdeadbeef", + "ELF32 little-endian | buildid/elf/elf32-le.so | deadbeefcafebabe123456789abcdef0 ", + "ELF64 big-endian | buildid/elf/elf64-be.so | ff00112233445566778899aabbccddeeff000102" + }) + void testElfBuildIdExtraction(String resource, String expectedBuildId) throws Exception { + Path file = Paths.get(getClass().getClassLoader().getResource(resource).toURI()); ElfBuildIdExtractor extractor = new ElfBuildIdExtractor(); - String buildId = extractor.extractBuildId(localBinary); + String buildId = extractor.extractBuildId(file); - logger.info("Found build ID: {} for library {}", buildId, localBinary); + logger.info("Found build ID: {} for {}", buildId, resource); - assertNotNull(buildId, "Build ID should be found for " + description); - assertTrue( - buildId.matches("^[0-9a-f]{32,40}$"), "Build ID should be 32-40 hex chars: " + buildId); + assertNotNull(buildId, "Build ID should be found for " + resource); + assertEquals(expectedBuildId, buildId, "Build ID mismatch for " + resource); assertEquals(BuildInfo.FileType.ELF, extractor.fileType()); assertEquals(BuildInfo.BuildIdType.GNU, extractor.buildIdType()); } - private static Stream peBinaries() { - String basePath = "/usr/share/dotnet/shared/Microsoft.NETCore.App/" + dotnetVersion; - return Stream.of( - Arguments.of(basePath + "/System.Private.CoreLib.dll", "Core .NET Library"), - Arguments.of(basePath + "/System.Runtime.dll", ".NET Runtime"), - Arguments.of(basePath + "/System.Console.dll", "Console Library"), - Arguments.of(basePath + "/Microsoft.CSharp.dll", "C# Compiler Library")); - } - - @ParameterizedTest(name = "PE: {1}") - @MethodSource("peBinaries") - void testPeBuildIdExtraction(String containerPath, String description) throws Exception { - Path localBinary = copyFromContainer(dotnetContainer, containerPath); + @TableTest({ + "scenario | resource | expectedBuildId ", + "PE32+ single debug entry | buildid/pe/pe32plus-single-entry.dll | 12345678ABCDEF0123456789ABCDEF011 ", + "PE32 single debug entry | buildid/pe/pe32-single-entry.dll | DEADBEEF12345678DEADBEEF123456782 ", + "PE32+ multiple debug entries, CodeView is second | buildid/pe/pe32plus-multi-entry.dll | CAFEBABEBEEFDEADCAFEBABEBEEFDEADff" + }) + void testPeBuildIdExtraction(String resource, String expectedBuildId) throws Exception { + Path file = Paths.get(getClass().getClassLoader().getResource(resource).toURI()); PeBuildIdExtractor extractor = new PeBuildIdExtractor(); - String buildId = extractor.extractBuildId(localBinary); - - logger.info("Found build ID: {} for library {}", buildId, localBinary); - - assertNotNull(buildId, "GUID+Age should be found for " + description); - - // Build ID format: GUID (32 uppercase hex chars) + Age (lowercase hex, variable length) - assertTrue( - buildId.length() >= 33, - "Build ID should be at least 33 hex chars (GUID + Age): " + buildId); - - // Verify format: GUID part (32 chars) should be uppercase, Age part should be lowercase - String guidPart = buildId.substring(0, 32); - String agePart = buildId.substring(32); - - assertTrue( - guidPart.matches("^[0-9A-F]{32}$"), - "GUID part (first 32 chars) should be uppercase hex: " + guidPart); - assertTrue( - agePart.matches("^[0-9a-f]+$"), - "Age part (remaining chars) should be lowercase hex: " + agePart); - - // Verify both parts parse correctly as hex - try { - new java.math.BigInteger(guidPart, 16); - Long.parseLong(agePart, 16); - } catch (NumberFormatException e) { - throw new AssertionError("Build ID should be valid hex: " + buildId, e); - } + String buildId = extractor.extractBuildId(file); - logger.info("Build ID format verified: GUID={}, Age={}", guidPart, agePart); + logger.info("Found build ID: {} for {}", buildId, resource); + assertNotNull(buildId, "Build ID should be found for " + resource); + assertEquals(expectedBuildId, buildId, "Build ID mismatch for " + resource); assertEquals(BuildInfo.FileType.PE, extractor.fileType()); assertEquals(BuildInfo.BuildIdType.PDB, extractor.buildIdType()); } diff --git a/dd-java-agent/agent-crashtracking/src/test/java/datadog/crashtracking/parsers/HotspotCrashLogParserTest.java b/dd-java-agent/agent-crashtracking/src/test/java/datadog/crashtracking/parsers/HotspotCrashLogParserTest.java index 0abe9c8921d..28bcda39e7f 100644 --- a/dd-java-agent/agent-crashtracking/src/test/java/datadog/crashtracking/parsers/HotspotCrashLogParserTest.java +++ b/dd-java-agent/agent-crashtracking/src/test/java/datadog/crashtracking/parsers/HotspotCrashLogParserTest.java @@ -49,6 +49,8 @@ public void testIncompleteParsing() throws Exception { assertNotNull(crashLog.error.stack); assertNotNull(crashLog.error.stack.frames); assertEquals(0, crashLog.error.stack.frames.length); + assertEquals("InternalError", crashLog.error.kind); + assertEquals("Process terminated by Internal error", crashLog.error.message); } /** macOS aarch64 uses lowercase register names: x0-x28, fp, lr, sp, pc, cpsr */ @@ -335,6 +337,47 @@ public void testParseCurrentThreadName(String line, String expected) { HotspotCrashLogParser.parseCurrentThreadName(line)); } + @TableTest({ + "scenario | filename | expectedJreVersion | expectedVmInfo ", + "Zulu 17 | sample-crash-for-telemetry.txt | OpenJDK Runtime Environment Zulu17.42+20-SA (17.0.7+7) (build 17.0.7+7-LTS) | OpenJDK 64-Bit Server VM (17.0.7+7-LTS) for linux-amd64 JRE (17.0.7+7-LTS) (Zulu17.42+20-SA), built on Apr 11 2023 11:39:51 by \"zulu_re\" with gcc 8.3.0 ", + "Temurin 22 | sample-crash-for-telemetry-2.txt | OpenJDK Runtime Environment Temurin-22.0.1+8 (22.0.1+8) (build 22.0.1+8) | OpenJDK 64-Bit Server VM (22.0.1+8) for linux-amd64 JRE (22.0.1+8), built on 2024-04-16T00:00:00Z by \"admin\" with gcc 11.3.0 ", + "Zulu 8 | sample-crash-for-telemetry-3.txt | OpenJDK Runtime Environment (Zulu 8.70.0.23-CA-macos-aarch64) (8.0_372-b07) (build 1.8.0_372-b07) | OpenJDK 64-Bit Server VM (25.372-b07) for bsd-aarch64 JRE (Zulu 8.70.0.23-CA-macos-aarch64) (1.8.0_372-b07), built on Apr 18 2023 01:36:20 by \"zulu_re\" with gcc Apple LLVM 12.0.0 (clang-1200.0.32.28)", + "Corretto 21 | sample-crash-linux-aarch64.txt | OpenJDK Runtime Environment Corretto-21.0.7.6.1 (21.0.7+6) (build 21.0.7+6-LTS) | OpenJDK 64-Bit Server VM (21.0.7+6-LTS) for linux-aarch64-musl JRE (21.0.7+6-LTS), built on 2025-04-09T23:34:45Z by \"jenkins\" with gcc 12.2.1 20220924 ", + "OpenJDK 25 | sample-crash-macos-aarch64.txt | OpenJDK Runtime Environment (25.0.2+10) (build 25.0.2+10-69) | OpenJDK 64-Bit Server VM (25.0.2+10-69) for bsd-aarch64 JRE (25.0.2+10-69), built on 2025-12-18T11:36:35Z with clang Apple LLVM 15.0.0 (clang-1500.3.9.4) " + }) + public void testRuntimeInfoParsing( + String filename, String expectedJreVersion, String expectedVmInfo) throws Exception { + CrashLog crashLog = + new HotspotCrashLogParser().parse(UUID.randomUUID().toString(), readFileAsString(filename)); + + assertNotNull(crashLog.experimental, "experimental should be populated"); + assertNotNull(crashLog.experimental.runtimeInfo, "runtimeInfo should be populated"); + assertNotNull(crashLog.experimental.runtimeInfo.jreVersion, "jreVersion should be populated"); + assertNotNull(crashLog.experimental.runtimeInfo.javaVm, "javaVm should be populated"); + assertNotNull(crashLog.experimental.runtimeInfo.vmInfo, "vmInfo should be populated"); + assertEquals(expectedJreVersion, crashLog.experimental.runtimeInfo.jreVersion); + assertEquals(expectedVmInfo, crashLog.experimental.runtimeInfo.vmInfo); + } + + @Test + public void testNoSignalProducesInternalError() throws Exception { + // A crash log that reaches the PROCESS section but has no siginfo line + String crashLog = + "# A fatal error has been detected by the Java Runtime Environment:\n" + + "#\n" + + "# Core dump will be written.\n" + + "--------------- T H R E A D ---------------\n" + + "Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)\n" + + "--------------- P R O C E S S ---------------\n"; + + CrashLog result = new HotspotCrashLogParser().parse(UUID.randomUUID().toString(), crashLog); + + assertNotNull(result); + assertFalse(result.incomplete); + assertEquals("InternalError", result.error.kind); + assertEquals("Process terminated by Internal error", result.error.message); + } + private String readFileAsString(String resource) throws IOException { try (InputStream stream = getClass().getClassLoader().getResourceAsStream(resource)) { return new BufferedReader( diff --git a/dd-java-agent/agent-crashtracking/src/test/java/datadog/crashtracking/parsers/J9JavacoreParserTest.java b/dd-java-agent/agent-crashtracking/src/test/java/datadog/crashtracking/parsers/J9JavacoreParserTest.java index 63ffe0fbe10..bfa122b0f2e 100644 --- a/dd-java-agent/agent-crashtracking/src/test/java/datadog/crashtracking/parsers/J9JavacoreParserTest.java +++ b/dd-java-agent/agent-crashtracking/src/test/java/datadog/crashtracking/parsers/J9JavacoreParserTest.java @@ -212,6 +212,41 @@ public void testDateTimeParsing() throws Exception { "Expected ISO-8601 format, got: " + crashLog.timestamp); } + @TableTest({ + "scenario | filename | expectedJreVersion ", + "OpenJ9 11 GPF | sample-j9-javacore-gpf.txt | JRE 11.0.12 Linux amd64-64 ", + "OpenJ9 17 OOM | sample-j9-javacore-oom.txt | JRE 17.0.6 Linux amd64-64 ", + "OpenJ9 11 aarch | sample-openj9-11-javacore-gpf.txt | JRE 11 Linux aarch64-64 (build 11.0.28+6) ", + "IBM J9 8 | sample-ibmj9-8-javacore-gpf.txt | JRE 1.8.0 Linux amd64-64 (build 8.0.8.51 - pxa6480sr8fp51-20250819_01(SR8 FP51))" + }) + public void testRuntimeInfoParsing(String filename, String expectedJreVersion) throws Exception { + CrashLog crashLog = + new J9JavacoreParser().parse(UUID.randomUUID().toString(), readFileAsString(filename)); + + assertNotNull(crashLog.experimental, "experimental should be populated"); + assertNotNull(crashLog.experimental.runtimeInfo, "runtimeInfo should be populated"); + assertNotNull(crashLog.experimental.runtimeInfo.jreVersion, "jreVersion should be populated"); + assertEquals(expectedJreVersion, crashLog.experimental.runtimeInfo.jreVersion); + } + + @Test + public void testNoSignalProducesInternalError() throws Exception { + // A javacore with a THREADS section but no 1TISIGINFO line + String javacoreContent = + "0SECTION TITLE subcomponent dump routine\n" + + "NULL ===============================\n" + + "1TICHARSET UTF-8\n" + + "NULL ------------------------------------------------------------------------\n" + + "0SECTION THREADS subcomponent dump routine\n" + + "NULL =================================\n"; + + CrashLog result = new J9JavacoreParser().parse(UUID.randomUUID().toString(), javacoreContent); + + assertNotNull(result); + assertEquals("InternalError", result.error.kind); + assertEquals("Process terminated by Internal error", result.error.message); + } + private String readFileAsString(String resource) throws IOException { try (InputStream stream = getClass().getClassLoader().getResourceAsStream(resource)) { return new BufferedReader( diff --git a/dd-java-agent/agent-crashtracking/src/test/resources/buildid/elf/elf32-le.so b/dd-java-agent/agent-crashtracking/src/test/resources/buildid/elf/elf32-le.so new file mode 100644 index 00000000000..f6c759a5e13 Binary files /dev/null and b/dd-java-agent/agent-crashtracking/src/test/resources/buildid/elf/elf32-le.so differ diff --git a/dd-java-agent/agent-crashtracking/src/test/resources/buildid/elf/elf64-be.so b/dd-java-agent/agent-crashtracking/src/test/resources/buildid/elf/elf64-be.so new file mode 100644 index 00000000000..79c5b55a3cb Binary files /dev/null and b/dd-java-agent/agent-crashtracking/src/test/resources/buildid/elf/elf64-be.so differ diff --git a/dd-java-agent/agent-crashtracking/src/test/resources/buildid/elf/elf64-le.so b/dd-java-agent/agent-crashtracking/src/test/resources/buildid/elf/elf64-le.so new file mode 100644 index 00000000000..1dbb9579c53 Binary files /dev/null and b/dd-java-agent/agent-crashtracking/src/test/resources/buildid/elf/elf64-le.so differ diff --git a/dd-java-agent/agent-crashtracking/src/test/resources/buildid/pe/pe32-single-entry.dll b/dd-java-agent/agent-crashtracking/src/test/resources/buildid/pe/pe32-single-entry.dll new file mode 100644 index 00000000000..54c207b4248 Binary files /dev/null and b/dd-java-agent/agent-crashtracking/src/test/resources/buildid/pe/pe32-single-entry.dll differ diff --git a/dd-java-agent/agent-crashtracking/src/test/resources/buildid/pe/pe32plus-multi-entry.dll b/dd-java-agent/agent-crashtracking/src/test/resources/buildid/pe/pe32plus-multi-entry.dll new file mode 100644 index 00000000000..db0ea05d17e Binary files /dev/null and b/dd-java-agent/agent-crashtracking/src/test/resources/buildid/pe/pe32plus-multi-entry.dll differ diff --git a/dd-java-agent/agent-crashtracking/src/test/resources/buildid/pe/pe32plus-single-entry.dll b/dd-java-agent/agent-crashtracking/src/test/resources/buildid/pe/pe32plus-single-entry.dll new file mode 100644 index 00000000000..aec22ab8eee Binary files /dev/null and b/dd-java-agent/agent-crashtracking/src/test/resources/buildid/pe/pe32plus-single-entry.dll differ diff --git a/dd-java-agent/agent-debugger/build.gradle b/dd-java-agent/agent-debugger/build.gradle index 3d26d031024..47bbce94548 100644 --- a/dd-java-agent/agent-debugger/build.gradle +++ b/dd-java-agent/agent-debugger/build.gradle @@ -2,11 +2,11 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar plugins { id 'com.gradleup.shadow' + id 'dd-trace-java.version-file' + id 'java-test-fixtures' } apply from: "$rootDir/gradle/java.gradle" -// We do not publish separate jar, but having version file is useful -apply from: "$rootDir/gradle/version.gradle" minimumInstructionCoverage = 0.1 minimumBranchCoverage = 0.6 @@ -27,7 +27,11 @@ excludedClassesCoverage += [ // tested through smoke tests 'com.datadog.debugger.exception.FailedTestReplayExceptionDebugger', // dynamically compiled test classes - exclude to prevent Jacoco instrumentation interference - 'com.datadog.debugger.symboltest.SymbolExtraction*' + 'com.datadog.debugger.symboltest.SymbolExtraction*', + // Depends on multiple versions of Spring to be tested while we have dep lockfiles + 'com.datadog.debugger.util.SpringHelper*', + // Used for helper methods that are JDK version specific + 'com.datadog.debugger.agent.ConfigurationUpdater.JDKVersionSpecificHelper' ] dependencies { @@ -48,6 +52,14 @@ dependencies { implementation libs.okhttp implementation libs.slf4j + // Dependencies needed to compile the test-fixture helpers (LogProbeTestHelper, + // MoshiSnapshotTestHelper); they reference siblings + Moshi + internal-api. + testFixturesImplementation project(':dd-java-agent:agent-debugger:debugger-bootstrap') + testFixturesImplementation project(':dd-java-agent:agent-debugger:debugger-el') + testFixturesImplementation project(':internal-api') + testFixturesImplementation libs.moshi + testFixturesImplementation libs.junit.jupiter + testImplementation libs.asm.util testImplementation libs.bundles.junit5 testImplementation libs.junit.jupiter.params diff --git a/dd-java-agent/agent-debugger/debugger-bootstrap/build.gradle b/dd-java-agent/agent-debugger/debugger-bootstrap/build.gradle index 265b35de54c..272c7b26f6f 100644 --- a/dd-java-agent/agent-debugger/debugger-bootstrap/build.gradle +++ b/dd-java-agent/agent-debugger/debugger-bootstrap/build.gradle @@ -1,6 +1,8 @@ +plugins { + id 'dd-trace-java.version-file' +} + apply from: "$rootDir/gradle/java.gradle" -// We do not publish separate jar, but having version file is useful -apply from: "$rootDir/gradle/version.gradle" // Most of the classes are just object model // Those which needs test coverage, test classes are in agent-debugger project @@ -12,4 +14,5 @@ dependencies { implementation libs.slf4j implementation libs.instrument.java implementation project(':internal-api') + testImplementation libs.bundles.mockito } diff --git a/dd-java-agent/agent-debugger/debugger-bootstrap/gradle.lockfile b/dd-java-agent/agent-debugger/debugger-bootstrap/gradle.lockfile index 27911b48114..6346b77661d 100644 --- a/dd-java-agent/agent-debugger/debugger-bootstrap/gradle.lockfile +++ b/dd-java-agent/agent-debugger/debugger-bootstrap/gradle.lockfile @@ -1,12 +1,13 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-debugger:debugger-bootstrap:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -17,8 +18,8 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.12.8=testRuntimeClasspath -net.bytebuddy:byte-buddy:1.12.8=testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -41,10 +42,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -54,14 +55,18 @@ org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntime org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath -org.mockito:mockito-core:4.4.0=testRuntimeClasspath +org.mockito:mockito-core:4.4.0=testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/DebuggerContext.java b/dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/DebuggerContext.java index 70f1f8c0347..77ad82b864a 100644 --- a/dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/DebuggerContext.java +++ b/dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/DebuggerContext.java @@ -6,7 +6,6 @@ import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.lang.reflect.Method; import java.time.Duration; -import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -324,8 +323,8 @@ public static void evalContext( // snapshot if (needFreeze) { Duration timeout = - Duration.of(Config.get().getDynamicInstrumentationCaptureTimeout(), ChronoUnit.MILLIS); - context.freeze(new TimeoutChecker(timeout)); + Duration.ofMillis(Config.get().getDynamicInstrumentationCaptureTimeout()); + context.freeze(TimeoutChecker.create(Config.get(), timeout)); } } catch (Exception ex) { LOGGER.debug("Error in evalContext: ", ex); @@ -359,8 +358,8 @@ public static void evalContext( // snapshot if (needFreeze) { Duration timeout = - Duration.of(Config.get().getDynamicInstrumentationCaptureTimeout(), ChronoUnit.MILLIS); - context.freeze(new TimeoutChecker(timeout)); + Duration.ofMillis(Config.get().getDynamicInstrumentationCaptureTimeout()); + context.freeze(TimeoutChecker.create(Config.get(), timeout)); } } catch (Exception ex) { LOGGER.debug("Error in evalContext: ", ex); diff --git a/dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/el/DebuggerScript.java b/dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/el/DebuggerScript.java index c4949ef0cb6..b248b440ba4 100644 --- a/dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/el/DebuggerScript.java +++ b/dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/el/DebuggerScript.java @@ -1,10 +1,12 @@ package datadog.trace.bootstrap.debugger.el; +import datadog.trace.bootstrap.debugger.util.TimeoutChecker; + /** * A debugger EL script interface used for communication between the instrumented code and the * debugger EL.
* Because it must be reachable from the instrumented code it must be placed in bootstrap. */ public interface DebuggerScript { - R execute(ValueReferenceResolver valueRefResolver); + R execute(ValueReferenceResolver valueRefResolver, TimeoutChecker timeoutChecker); } diff --git a/dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/util/CpuTimeoutChecker.java b/dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/util/CpuTimeoutChecker.java new file mode 100644 index 00000000000..42d082ee675 --- /dev/null +++ b/dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/util/CpuTimeoutChecker.java @@ -0,0 +1,26 @@ +package datadog.trace.bootstrap.debugger.util; + +import java.lang.management.ManagementFactory; +import java.lang.management.ThreadMXBean; +import java.time.Duration; + +public class CpuTimeoutChecker implements TimeoutChecker { + private final Duration timeOut; + private final ThreadMXBean threadMXBean = ManagementFactory.getThreadMXBean(); + private final long startCpuTime; + + public CpuTimeoutChecker(Duration timeout) { + this.timeOut = timeout; + startCpuTime = threadMXBean.getCurrentThreadCpuTime(); + } + + @Override + public boolean isTimedOut() { + return threadMXBean.getCurrentThreadCpuTime() - startCpuTime >= timeOut.toNanos(); + } + + @Override + public Duration getTimeOut() { + return timeOut; + } +} diff --git a/dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/util/Redaction.java b/dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/util/Redaction.java index bea68325982..d67886afd05 100644 --- a/dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/util/Redaction.java +++ b/dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/util/Redaction.java @@ -104,7 +104,7 @@ public class Redaction { "xsrf", "xsrftoken"); private static final Set KEYWORDS = ConcurrentHashMap.newKeySet(); - private static ClassNameTrie typeTrie = ClassNameTrie.Builder.EMPTY_TRIE; + private static ClassNameTrie typeTrie = ClassNameTrie.EMPTY_TRIE; private static List redactedClasses; private static List redactedPackages; @@ -190,7 +190,7 @@ public static List getRedactedClasses() { } public static void clearUserDefinedTypes() { - typeTrie = ClassNameTrie.Builder.EMPTY_TRIE; + typeTrie = ClassNameTrie.EMPTY_TRIE; } public static void resetUserDefinedKeywords() { diff --git a/dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/util/TimeoutChecker.java b/dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/util/TimeoutChecker.java index f6451afe8c0..a49bb9d3208 100644 --- a/dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/util/TimeoutChecker.java +++ b/dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/util/TimeoutChecker.java @@ -1,33 +1,21 @@ package datadog.trace.bootstrap.debugger.util; +import datadog.trace.api.Config; import java.time.Duration; -import java.time.temporal.ChronoUnit; -public class TimeoutChecker { - public static final Duration DEFAULT_TIME_OUT = Duration.of(100, ChronoUnit.MILLIS); +public interface TimeoutChecker { - private final long start; - private final Duration timeOut; + String CPU = "CPU"; + String WALL = "WALL"; - public TimeoutChecker(Duration timeOut) { - this.start = System.currentTimeMillis(); - this.timeOut = timeOut; - } - - public TimeoutChecker(long start, Duration timeOut) { - this.start = start; - this.timeOut = timeOut; - } + boolean isTimedOut(); - public boolean isTimedOut(long currentTimeMillis) { - return (currentTimeMillis - start) > timeOut.toMillis(); - } - - public long getStart() { - return start; - } + Duration getTimeOut(); - public Duration getTimeOut() { - return timeOut; + static TimeoutChecker create(Config config, Duration timeout) { + if (config.getDynamicInstrumentationTimeoutCheckerMode().equals(CPU)) { + return new CpuTimeoutChecker(timeout); + } + return new WallTimeoutChecker(timeout); } } diff --git a/dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/util/WallTimeoutChecker.java b/dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/util/WallTimeoutChecker.java new file mode 100644 index 00000000000..1bc72b69c45 --- /dev/null +++ b/dd-java-agent/agent-debugger/debugger-bootstrap/src/main/java/datadog/trace/bootstrap/debugger/util/WallTimeoutChecker.java @@ -0,0 +1,37 @@ +package datadog.trace.bootstrap.debugger.util; + +import java.time.Duration; + +public class WallTimeoutChecker implements TimeoutChecker { + + private final long start; + private final Duration timeOut; + + public WallTimeoutChecker(Duration timeOut) { + this.start = System.currentTimeMillis(); + this.timeOut = timeOut; + } + + public WallTimeoutChecker(long start, Duration timeOut) { + this.start = start; + this.timeOut = timeOut; + } + + public boolean isTimedOut(long currentTimeMillis) { + return (currentTimeMillis - start) > timeOut.toMillis(); + } + + @Override + public boolean isTimedOut() { + return isTimedOut(System.currentTimeMillis()); + } + + public long getStart() { + return start; + } + + @Override + public Duration getTimeOut() { + return timeOut; + } +} diff --git a/dd-java-agent/agent-debugger/debugger-bootstrap/src/test/java/datadog/trace/bootstrap/debugger/util/TimeoutCheckerTest.java b/dd-java-agent/agent-debugger/debugger-bootstrap/src/test/java/datadog/trace/bootstrap/debugger/util/TimeoutCheckerTest.java index 10cd94f9042..c3d23678da6 100644 --- a/dd-java-agent/agent-debugger/debugger-bootstrap/src/test/java/datadog/trace/bootstrap/debugger/util/TimeoutCheckerTest.java +++ b/dd-java-agent/agent-debugger/debugger-bootstrap/src/test/java/datadog/trace/bootstrap/debugger/util/TimeoutCheckerTest.java @@ -1,20 +1,55 @@ package datadog.trace.bootstrap.debugger.util; -import static datadog.trace.bootstrap.debugger.util.TimeoutChecker.DEFAULT_TIME_OUT; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; -import org.junit.jupiter.api.Assertions; +import datadog.trace.api.Config; +import java.time.Duration; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.locks.LockSupport; import org.junit.jupiter.api.Test; public class TimeoutCheckerTest { @Test - public void timedOut() { + public void wallTimedOut() { long start = System.currentTimeMillis(); + Duration timeout = Duration.ofMillis(100); // assume that start & timestamp captured in instance below are very close - TimeoutChecker timeoutChecker = new TimeoutChecker(DEFAULT_TIME_OUT); - Assertions.assertFalse(timeoutChecker.isTimedOut(start + 1)); - Assertions.assertTrue(timeoutChecker.isTimedOut(start + DEFAULT_TIME_OUT.toMillis() * 2)); - timeoutChecker = new TimeoutChecker(start, DEFAULT_TIME_OUT); - Assertions.assertFalse(timeoutChecker.isTimedOut(start + 1)); - Assertions.assertTrue(timeoutChecker.isTimedOut(start + DEFAULT_TIME_OUT.toMillis() * 2)); + WallTimeoutChecker timeoutChecker = new WallTimeoutChecker(timeout); + assertFalse(timeoutChecker.isTimedOut(start + 1)); + assertTrue(timeoutChecker.isTimedOut(start + timeout.toMillis() * 2)); + timeoutChecker = new WallTimeoutChecker(start, timeout); + assertFalse(timeoutChecker.isTimedOut(start + 1)); + assertTrue(timeoutChecker.isTimedOut(start + timeout.toMillis() * 2)); + } + + @Test + public void cpuTimedOut() { + CpuTimeoutChecker cpuTimeoutChecker = new CpuTimeoutChecker(Duration.ofMillis(1)); + LockSupport.parkNanos(TimeUnit.MILLISECONDS.toNanos(10)); // not consume cpu + assertFalse(cpuTimeoutChecker.isTimedOut()); + burnCpu(5_000_000); + assertTrue(cpuTimeoutChecker.isTimedOut()); + } + + static volatile int counter; + + private static void burnCpu(int iterations) { + for (int i = 0; i < iterations; i++) { + counter++; + } + } + + @Test + public void configTimeout() { + Config config = mock(Config.class); + when(config.getDynamicInstrumentationTimeoutCheckerMode()).thenReturn(TimeoutChecker.CPU); + assertInstanceOf(CpuTimeoutChecker.class, TimeoutChecker.create(config, Duration.ofMillis(50))); + when(config.getDynamicInstrumentationTimeoutCheckerMode()).thenReturn(TimeoutChecker.WALL); + assertInstanceOf( + WallTimeoutChecker.class, TimeoutChecker.create(config, Duration.ofMillis(50))); } } diff --git a/dd-java-agent/agent-debugger/debugger-el/build.gradle b/dd-java-agent/agent-debugger/debugger-el/build.gradle index ff9d5d44187..e1b92a20af9 100644 --- a/dd-java-agent/agent-debugger/debugger-el/build.gradle +++ b/dd-java-agent/agent-debugger/debugger-el/build.gradle @@ -1,6 +1,8 @@ +plugins { + id 'dd-trace-java.version-file' +} + apply from: "$rootDir/gradle/java.gradle" -// We do not publish separate jar, but having version file is useful -apply from: "$rootDir/gradle/version.gradle" minimumInstructionCoverage = 0.1 minimumBranchCoverage = 0.6 diff --git a/dd-java-agent/agent-debugger/debugger-el/gradle.lockfile b/dd-java-agent/agent-debugger/debugger-el/gradle.lockfile index 80c58fe5e2d..d1d6d318347 100644 --- a/dd-java-agent/agent-debugger/debugger-el/gradle.lockfile +++ b/dd-java-agent/agent-debugger/debugger-el/gradle.lockfile @@ -1,12 +1,13 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-debugger:debugger-el:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=runtimeClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=runtimeClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -19,8 +20,8 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -43,10 +44,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -61,10 +62,13 @@ org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspat org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/BooleanValueExpressionAdapter.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/BooleanValueExpressionAdapter.java index c71c1b9b8de..e7986715e24 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/BooleanValueExpressionAdapter.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/BooleanValueExpressionAdapter.java @@ -3,7 +3,6 @@ import com.datadog.debugger.el.expressions.BooleanExpression; import com.datadog.debugger.el.expressions.ValueExpression; import com.datadog.debugger.el.values.BooleanValue; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; public class BooleanValueExpressionAdapter implements ValueExpression { @@ -14,8 +13,8 @@ public BooleanValueExpressionAdapter(BooleanExpression booleanExpression) { } @Override - public BooleanValue evaluate(ValueReferenceResolver valueRefResolver) { - Boolean result = booleanExpression.evaluate(valueRefResolver); + public BooleanValue evaluate(EvalContext evalContext) { + Boolean result = booleanExpression.evaluate(evalContext); if (result == null) { throw new EvaluationException( "Boolean expression returning null", PrettyPrintVisitor.print(this)); diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/EvalContext.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/EvalContext.java new file mode 100644 index 00000000000..bd0ece583f2 --- /dev/null +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/EvalContext.java @@ -0,0 +1,23 @@ +package com.datadog.debugger.el; + +import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; +import datadog.trace.bootstrap.debugger.util.TimeoutChecker; + +public class EvalContext { + private final ValueReferenceResolver valueRefResolver; + private final TimeoutChecker timeoutChecker; + + public EvalContext( + final ValueReferenceResolver valueRefResolver, final TimeoutChecker timeoutChecker) { + this.valueRefResolver = valueRefResolver; + this.timeoutChecker = timeoutChecker; + } + + public ValueReferenceResolver getValueRefResolver() { + return valueRefResolver; + } + + public TimeoutChecker getTimeoutChecker() { + return timeoutChecker; + } +} diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/Expression.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/Expression.java index f9d29f0687a..d9b7b2e766f 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/Expression.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/Expression.java @@ -1,11 +1,9 @@ package com.datadog.debugger.el; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; - /** Represents any evaluable expression */ @FunctionalInterface public interface Expression { - ReturnType evaluate(ValueReferenceResolver valueRefResolver); + ReturnType evaluate(EvalContext evalContext); default R accept(Visitor visitor) { return null; diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/Literal.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/Literal.java index 6d5c8d2fca1..cfc3b9971d9 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/Literal.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/Literal.java @@ -1,7 +1,6 @@ package com.datadog.debugger.el; import com.datadog.debugger.el.expressions.ValueExpression; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; import datadog.trace.bootstrap.debugger.el.Values; import java.util.Objects; @@ -27,7 +26,7 @@ public boolean isUndefined() { } @Override - public Value evaluate(ValueReferenceResolver valueRefResolver) { + public Value evaluate(EvalContext evalContext) { return this; } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/ProbeCondition.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/ProbeCondition.java index 8ded283ec93..7ca052c2cab 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/ProbeCondition.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/ProbeCondition.java @@ -9,8 +9,9 @@ import com.squareup.moshi.JsonWriter; import datadog.trace.bootstrap.debugger.el.DebuggerScript; import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; -import edu.umd.cs.findbugs.annotations.NonNull; +import datadog.trace.bootstrap.debugger.util.TimeoutChecker; import java.io.IOException; +import javax.annotation.Nonnull; /** Implements expression language for probe condition */ public final class ProbeCondition implements DebuggerScript { @@ -48,7 +49,7 @@ public ProbeCondition fromJson(JsonReader reader) throws IOException { } @Override - public void toJson(@NonNull JsonWriter jsonWriter, ProbeCondition value) throws IOException { + public void toJson(@Nonnull JsonWriter jsonWriter, ProbeCondition value) throws IOException { if (value == null) { jsonWriter.nullValue(); return; @@ -99,12 +100,12 @@ public static ProbeCondition load(JsonReader reader) throws IOException { } @Override - public Boolean execute(ValueReferenceResolver valueRefResolver) { + public Boolean execute(ValueReferenceResolver valueRefResolver, TimeoutChecker timeoutChecker) { if (when == null) { return true; } - if (when.evaluate(valueRefResolver)) { - then.evaluate(valueRefResolver); + if (when.evaluate(new EvalContext(valueRefResolver, timeoutChecker))) { + then.evaluate(new EvalContext(valueRefResolver, timeoutChecker)); return true; } return false; diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/ValueScript.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/ValueScript.java index bcc940e1d5d..c446e0b12e5 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/ValueScript.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/ValueScript.java @@ -1,16 +1,43 @@ package com.datadog.debugger.el; +import com.datadog.debugger.el.expressions.BinaryExpression; +import com.datadog.debugger.el.expressions.BinaryOperator; +import com.datadog.debugger.el.expressions.BooleanExpression; +import com.datadog.debugger.el.expressions.ComparisonExpression; +import com.datadog.debugger.el.expressions.ComparisonOperator; +import com.datadog.debugger.el.expressions.ContainsExpression; +import com.datadog.debugger.el.expressions.EndsWithExpression; +import com.datadog.debugger.el.expressions.FilterCollectionExpression; import com.datadog.debugger.el.expressions.GetMemberExpression; +import com.datadog.debugger.el.expressions.HasAllExpression; +import com.datadog.debugger.el.expressions.HasAnyExpression; +import com.datadog.debugger.el.expressions.IfElseExpression; +import com.datadog.debugger.el.expressions.IfExpression; import com.datadog.debugger.el.expressions.IndexExpression; +import com.datadog.debugger.el.expressions.IsDefinedExpression; +import com.datadog.debugger.el.expressions.IsEmptyExpression; import com.datadog.debugger.el.expressions.LenExpression; +import com.datadog.debugger.el.expressions.MatchesExpression; +import com.datadog.debugger.el.expressions.NotExpression; +import com.datadog.debugger.el.expressions.StartsWithExpression; +import com.datadog.debugger.el.expressions.SubStringExpression; import com.datadog.debugger.el.expressions.ValueExpression; import com.datadog.debugger.el.expressions.ValueRefExpression; +import com.datadog.debugger.el.expressions.WhenExpression; +import com.datadog.debugger.el.values.BooleanValue; +import com.datadog.debugger.el.values.ListValue; +import com.datadog.debugger.el.values.MapValue; +import com.datadog.debugger.el.values.NullValue; +import com.datadog.debugger.el.values.NumericValue; +import com.datadog.debugger.el.values.ObjectValue; +import com.datadog.debugger.el.values.SetValue; import com.datadog.debugger.el.values.StringValue; import com.squareup.moshi.JsonAdapter; import com.squareup.moshi.JsonReader; import com.squareup.moshi.JsonWriter; import datadog.trace.bootstrap.debugger.el.DebuggerScript; import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; +import datadog.trace.bootstrap.debugger.util.TimeoutChecker; import java.io.IOException; import java.util.Objects; import java.util.regex.Matcher; @@ -37,8 +64,8 @@ public ValueExpression getExpr() { } @Override - public Value execute(ValueReferenceResolver valueRefResolver) { - return expr.evaluate(valueRefResolver); + public Value execute(ValueReferenceResolver valueRefResolver, TimeoutChecker timeoutChecker) { + return expr.evaluate(new EvalContext(valueRefResolver, timeoutChecker)); } @Override @@ -127,46 +154,248 @@ public void toJson(JsonWriter jsonWriter, ValueScript value) throws IOException jsonWriter.name("dsl"); jsonWriter.value(value.dsl); jsonWriter.name("json"); - writeValueExpression(jsonWriter, value.expr); + ToJsonVisitor toJsonVisitor = new ToJsonVisitor(jsonWriter); + value.expr.accept(toJsonVisitor); jsonWriter.endObject(); } - private void writeValueExpression(JsonWriter jsonWriter, ValueExpression expr) - throws IOException { - if (expr instanceof Value) { - if (expr instanceof StringValue) { - jsonWriter.value(((StringValue) expr).getValue()); - } else { - throw new IOException("Unsupported operation: " + expr.getClass().getTypeName()); + private static class ToJsonVisitor implements Visitor { + private final JsonWriter jsonWriter; + + public ToJsonVisitor(JsonWriter jsonWriter) { + this.jsonWriter = jsonWriter; + } + + @Override + public Void visit(BinaryExpression binaryExpression) { + throw new UnsupportedOperationException("BinaryExpression is not supported"); + } + + @Override + public Void visit(BinaryOperator operator) { + throw new UnsupportedOperationException("BinaryOperator is not supported"); + } + + @Override + public Void visit(ComparisonExpression comparisonExpression) { + try { + jsonWriter.beginObject(); + comparisonExpression.getOperator().accept(this); + jsonWriter.beginArray(); + comparisonExpression.getLeft().accept(this); + comparisonExpression.getRight().accept(this); + jsonWriter.endArray(); + jsonWriter.endObject(); + } catch (IOException e) { + throw new RuntimeException(e); } - return; + return null; } - jsonWriter.beginObject(); - if (expr instanceof ValueRefExpression) { - ValueRefExpression valueRefExpr = (ValueRefExpression) expr; - jsonWriter.name("ref"); - jsonWriter.value(valueRefExpr.getSymbolName()); - } else if (expr instanceof GetMemberExpression) { - GetMemberExpression getMemberExpr = (GetMemberExpression) expr; - jsonWriter.name("getmember"); - jsonWriter.beginArray(); - writeValueExpression(jsonWriter, getMemberExpr.getTarget()); - jsonWriter.value(getMemberExpr.getMemberName()); - jsonWriter.endArray(); - } else if (expr instanceof LenExpression) { - jsonWriter.name("count"); - writeValueExpression(jsonWriter, ((LenExpression) expr).getSource()); - } else if (expr instanceof IndexExpression) { - IndexExpression idxExpr = (IndexExpression) expr; - jsonWriter.name("index"); - jsonWriter.beginArray(); - writeValueExpression(jsonWriter, idxExpr.getTarget()); - writeValueExpression(jsonWriter, idxExpr.getKey()); - jsonWriter.endArray(); - } else { - throw new IOException("Unsupported operation: " + expr.getClass().getTypeName()); + + @Override + public Void visit(ComparisonOperator operator) { + try { + jsonWriter.name(operator.name().toLowerCase()); + } catch (IOException e) { + throw new RuntimeException(e); + } + return null; + } + + @Override + public Void visit(ContainsExpression containsExpression) { + throw new UnsupportedOperationException("ContainsExpression is not supported"); + } + + @Override + public Void visit(EndsWithExpression endsWithExpression) { + throw new UnsupportedOperationException("EndsWithExpression is not supported"); + } + + @Override + public Void visit(FilterCollectionExpression filterCollectionExpression) { + try { + jsonWriter.beginObject(); + jsonWriter.name("filter"); + jsonWriter.beginArray(); + filterCollectionExpression.getSource().accept(this); + filterCollectionExpression.getFilterExpression().accept(this); + jsonWriter.endArray(); + jsonWriter.endObject(); + } catch (IOException e) { + throw new RuntimeException(e); + } + return null; + } + + @Override + public Void visit(HasAllExpression hasAllExpression) { + throw new UnsupportedOperationException("HasAllExpression is not supported"); + } + + @Override + public Void visit(HasAnyExpression hasAnyExpression) { + throw new UnsupportedOperationException("HasAnyExpression is not supported"); + } + + @Override + public Void visit(IfElseExpression ifElseExpression) { + throw new UnsupportedOperationException("IfElseExpression is not supported"); + } + + @Override + public Void visit(IfExpression ifExpression) { + throw new UnsupportedOperationException("IfExpression is not supported"); + } + + @Override + public Void visit(IsEmptyExpression isEmptyExpression) { + throw new UnsupportedOperationException("IsEmptyExpression is not supported"); + } + + @Override + public Void visit(IsDefinedExpression isDefinedExpression) { + throw new UnsupportedOperationException("IsDefinedExpression is not supported"); + } + + @Override + public Void visit(LenExpression lenExpression) { + try { + jsonWriter.beginObject(); + jsonWriter.name("count"); + lenExpression.getSource().accept(this); + jsonWriter.endObject(); + } catch (IOException e) { + throw new RuntimeException(e); + } + return null; + } + + @Override + public Void visit(MatchesExpression matchesExpression) { + throw new UnsupportedOperationException("MatchesExpression is not supported"); + } + + @Override + public Void visit(NotExpression notExpression) { + throw new UnsupportedOperationException("NotExpression is not supported"); + } + + @Override + public Void visit(StartsWithExpression startsWithExpression) { + throw new UnsupportedOperationException("StartsWithExpression is not supported"); + } + + @Override + public Void visit(SubStringExpression subStringExpression) { + throw new UnsupportedOperationException("SubStringExpression is not supported"); + } + + @Override + public Void visit(ValueRefExpression valueRefExpression) { + try { + jsonWriter.beginObject(); + jsonWriter.name("ref"); + jsonWriter.value(valueRefExpression.getSymbolName()); + jsonWriter.endObject(); + } catch (IOException e) { + throw new RuntimeException(e); + } + return null; + } + + @Override + public Void visit(GetMemberExpression getMemberExpression) { + try { + jsonWriter.beginObject(); + jsonWriter.name("getmember"); + jsonWriter.beginArray(); + getMemberExpression.getTarget().accept(this); + jsonWriter.value(getMemberExpression.getMemberName()); + jsonWriter.endArray(); + jsonWriter.endObject(); + } catch (IOException e) { + throw new RuntimeException(e); + } + return null; + } + + @Override + public Void visit(IndexExpression indexExpression) { + try { + jsonWriter.beginObject(); + jsonWriter.name("index"); + jsonWriter.beginArray(); + indexExpression.getTarget().accept(this); + indexExpression.getKey().accept(this); + jsonWriter.endArray(); + jsonWriter.endObject(); + } catch (IOException e) { + throw new RuntimeException(e); + } + return null; + } + + @Override + public Void visit(WhenExpression whenExpression) { + throw new UnsupportedOperationException("WhenExpression is not supported"); + } + + @Override + public Void visit(BooleanExpression booleanExpression) { + throw new UnsupportedOperationException("BooleanExpression is not supported"); + } + + @Override + public Void visit(ObjectValue objectValue) { + throw new UnsupportedOperationException("ObjectValue is not supported"); + } + + @Override + public Void visit(StringValue stringValue) { + try { + jsonWriter.value(stringValue.getValue()); + } catch (IOException e) { + throw new RuntimeException(e); + } + return null; + } + + @Override + public Void visit(NumericValue numericValue) { + try { + // TODO handle double + jsonWriter.value(numericValue.getValue().longValue()); + } catch (IOException e) { + throw new RuntimeException(e); + } + return null; + } + + @Override + public Void visit(BooleanValue booleanValue) { + throw new UnsupportedOperationException("BooleanValue is not supported"); + } + + @Override + public Void visit(NullValue nullValue) { + throw new UnsupportedOperationException("NullValue is not supported"); + } + + @Override + public Void visit(ListValue listValue) { + throw new UnsupportedOperationException("ListValue is not supported"); + } + + @Override + public Void visit(MapValue mapValue) { + throw new UnsupportedOperationException("MapValue is not supported"); + } + + @Override + public Void visit(SetValue setValue) { + throw new UnsupportedOperationException("SetValue is not supported"); } - jsonWriter.endObject(); } } } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/BinaryExpression.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/BinaryExpression.java index d4063ec5cd2..3c955d21b74 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/BinaryExpression.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/BinaryExpression.java @@ -1,7 +1,7 @@ package com.datadog.debugger.el.expressions; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.Visitor; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; /** * Takes two {@linkplain BooleanExpression} instances and combines them with the given {@link @@ -20,8 +20,8 @@ public BinaryExpression( } @Override - public Boolean evaluate(ValueReferenceResolver valueRefResolver) { - return operator.apply(left, right, valueRefResolver); + public Boolean evaluate(EvalContext evalContext) { + return operator.apply(left, right, evalContext); } @Override diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/BinaryOperator.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/BinaryOperator.java index ce5784b918b..3a1a7391d17 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/BinaryOperator.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/BinaryOperator.java @@ -1,21 +1,19 @@ package com.datadog.debugger.el.expressions; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.Visitor; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; public enum BinaryOperator { AND("&&") { @Override - public Boolean apply( - BooleanExpression left, BooleanExpression right, ValueReferenceResolver resolver) { - return left.evaluate(resolver) && right.evaluate(resolver); + public Boolean apply(BooleanExpression left, BooleanExpression right, EvalContext evalContext) { + return left.evaluate(evalContext) && right.evaluate(evalContext); } }, OR("||") { @Override - public Boolean apply( - BooleanExpression left, BooleanExpression right, ValueReferenceResolver resolver) { - return left.evaluate(resolver) || right.evaluate(resolver); + public Boolean apply(BooleanExpression left, BooleanExpression right, EvalContext evalContext) { + return left.evaluate(evalContext) || right.evaluate(evalContext); } }; @@ -26,7 +24,7 @@ public Boolean apply( } public abstract Boolean apply( - BooleanExpression left, BooleanExpression right, ValueReferenceResolver resolver); + BooleanExpression left, BooleanExpression right, EvalContext evalContext); public R accept(Visitor visitor) { return visitor.visit(this); diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/BooleanExpression.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/BooleanExpression.java index 3ff97e2d890..2f98571f03b 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/BooleanExpression.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/BooleanExpression.java @@ -1,15 +1,15 @@ package com.datadog.debugger.el.expressions; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.Expression; import com.datadog.debugger.el.Visitor; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; /** A generic interface for expressions resolving to {@linkplain Boolean} */ public interface BooleanExpression extends Expression { BooleanExpression TRUE = new BooleanExpression() { @Override - public Boolean evaluate(ValueReferenceResolver valueRefResolver) { + public Boolean evaluate(EvalContext evalContext) { return Boolean.TRUE; } @@ -26,7 +26,7 @@ public R accept(Visitor visitor) { BooleanExpression FALSE = new BooleanExpression() { @Override - public Boolean evaluate(ValueReferenceResolver valueRefResolver) { + public Boolean evaluate(EvalContext evalContext) { return Boolean.FALSE; } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/CollectionExpressionHelper.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/CollectionExpressionHelper.java index c811c82fa73..540008c6ea1 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/CollectionExpressionHelper.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/CollectionExpressionHelper.java @@ -2,13 +2,13 @@ import static com.datadog.debugger.el.PrettyPrintVisitor.print; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; import com.datadog.debugger.el.Expression; import com.datadog.debugger.el.Value; import com.datadog.debugger.el.values.ListValue; import com.datadog.debugger.el.values.MapValue; import com.datadog.debugger.el.values.SetValue; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; import datadog.trace.bootstrap.debugger.util.WellKnownClasses; import java.util.List; import java.util.Map; @@ -34,14 +34,12 @@ public static void checkSupportedList(ListValue collection, Expression expres } public static Value evaluateTargetCollection( - ValueExpression collectionTarget, - Expression expression, - ValueReferenceResolver valueRefResolver) { + ValueExpression collectionTarget, Expression expression, EvalContext evalContext) { if (collectionTarget == null) { throw new EvaluationException( "Cannot evaluate the expression for null value", print(expression)); } - Value value = collectionTarget.evaluate(valueRefResolver); + Value value = collectionTarget.evaluate(evalContext); if (value.isUndefined()) { throw new EvaluationException( "Cannot evaluate the expression for undefined value", print(expression)); diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/ComparisonExpression.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/ComparisonExpression.java index b595921d928..8a13febaad2 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/ComparisonExpression.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/ComparisonExpression.java @@ -1,10 +1,12 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.expressions.ExpressionHelper.checkTimeout; + +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; import com.datadog.debugger.el.PrettyPrintVisitor; import com.datadog.debugger.el.Value; import com.datadog.debugger.el.Visitor; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; /** * Takes two {@linkplain ValueExpression} instances and compares them using the given {@link @@ -23,17 +25,19 @@ public ComparisonExpression( } @Override - public Boolean evaluate(ValueReferenceResolver valueRefResolver) { - Value leftValue = left.evaluate(valueRefResolver); + public Boolean evaluate(EvalContext evalContext) { + Value leftValue = left.evaluate(evalContext); if (leftValue.isUndefined()) { return Boolean.FALSE; } - Value rightValue = right.evaluate(valueRefResolver); + Value rightValue = right.evaluate(evalContext); if (rightValue.isUndefined()) { return Boolean.FALSE; } try { - return operator.apply(leftValue, rightValue); + boolean result = operator.apply(leftValue, rightValue); + checkTimeout(evalContext.getTimeoutChecker(), this); + return result; } catch (EvaluationException e) { throw new EvaluationException(e.getMessage(), PrettyPrintVisitor.print(this)); } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/ContainsExpression.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/ContainsExpression.java index d2fc6a62bbf..bde8654b551 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/ContainsExpression.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/ContainsExpression.java @@ -1,11 +1,14 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.expressions.ExpressionHelper.checkStringLength; +import static com.datadog.debugger.el.expressions.ExpressionHelper.checkTimeout; + +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; import com.datadog.debugger.el.PrettyPrintVisitor; import com.datadog.debugger.el.Value; import com.datadog.debugger.el.Visitor; import com.datadog.debugger.el.values.CollectionValue; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; public class ContainsExpression implements BooleanExpression { private final ValueExpression target; @@ -17,8 +20,8 @@ public ContainsExpression(ValueExpression target, ValueExpression value) { } @Override - public Boolean evaluate(ValueReferenceResolver valueRefResolver) { - Value targetValue = target.evaluate(valueRefResolver); + public Boolean evaluate(EvalContext evalContext) { + Value targetValue = target.evaluate(evalContext); if (targetValue.isUndefined()) { throw new EvaluationException( "Cannot evaluate the expression for undefined value", PrettyPrintVisitor.print(this)); @@ -27,22 +30,28 @@ public Boolean evaluate(ValueReferenceResolver valueRefResolver) { throw new EvaluationException( "Cannot evaluate the expression for null value", PrettyPrintVisitor.print(this)); } - Value val = value.evaluate(valueRefResolver); + Value val = value.evaluate(evalContext); if (val.isUndefined()) { return false; } + boolean result; if (targetValue.getValue() instanceof String) { String targetStr = (String) targetValue.getValue(); if (val.getValue() instanceof String) { String valStr = (String) val.getValue(); - return targetStr.contains(valStr); + checkStringLength(valStr, this); + result = targetStr.contains(valStr); + checkTimeout(evalContext.getTimeoutChecker(), this); + return result; } throw new EvaluationException( "Cannot evaluate the expression for non-string value", PrettyPrintVisitor.print(this)); } if (targetValue instanceof CollectionValue) { try { - return ((CollectionValue) targetValue).contains(val); + result = ((CollectionValue) targetValue).contains(val); + checkTimeout(evalContext.getTimeoutChecker(), this); + return result; } catch (RuntimeException ex) { throw new EvaluationException(ex.getMessage(), PrettyPrintVisitor.print(this)); } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/ExpressionHelper.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/ExpressionHelper.java index 43d5930dcb6..10b7a73911c 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/ExpressionHelper.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/ExpressionHelper.java @@ -1,13 +1,54 @@ package com.datadog.debugger.el.expressions; +import com.datadog.debugger.el.EvaluationException; import com.datadog.debugger.el.Expression; import com.datadog.debugger.el.PrettyPrintVisitor; import com.datadog.debugger.el.RedactedException; +import datadog.trace.bootstrap.debugger.util.TimeoutChecker; +import java.util.Collection; public class ExpressionHelper { + public static final int MAX_COLLECTION_ITEMS = 1_000_000; + public static final int MAX_ARRAY_ITEMS = 1_000_000; + public static final int MAX_STRING_LENGTH = 100_000_000; + public static void throwRedactedException(Expression expr) { String strExpr = PrettyPrintVisitor.print(expr); throw new RedactedException( "Could not evaluate the expression because '" + strExpr + "' was redacted", strExpr); } + + public static void checkTimeout(TimeoutChecker checker, Expression expr) { + if (checker.isTimedOut()) { + throw new EvaluationException( + "timeout (" + checker.getTimeOut().toMillis() + "ms)", PrettyPrintVisitor.print(expr)); + } + } + + public static void checkStringLength(String val, Expression expr) { + if (val == null) { + return; + } + if (val.length() > MAX_STRING_LENGTH) { + throw new EvaluationException( + "string too large (>" + MAX_STRING_LENGTH + ")", PrettyPrintVisitor.print(expr)); + } + } + + public static void checkCollectionSize(Collection collection, Expression expr) { + if (collection == null) { + return; + } + if (collection.size() > MAX_COLLECTION_ITEMS) { + throw new EvaluationException( + "Collection too large (>" + MAX_COLLECTION_ITEMS + ")", PrettyPrintVisitor.print(expr)); + } + } + + public static void checkArrayLength(int arrayLength, Expression expr) { + if (arrayLength > MAX_ARRAY_ITEMS) { + throw new EvaluationException( + "Array too large (>" + MAX_ARRAY_ITEMS + ")", PrettyPrintVisitor.print(expr)); + } + } } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/FilterCollectionExpression.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/FilterCollectionExpression.java index 5c3e27ee173..cd4c8ef1c89 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/FilterCollectionExpression.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/FilterCollectionExpression.java @@ -5,7 +5,9 @@ import static com.datadog.debugger.el.expressions.CollectionExpressionHelper.checkSupportedMap; import static com.datadog.debugger.el.expressions.CollectionExpressionHelper.checkSupportedSet; import static com.datadog.debugger.el.expressions.CollectionExpressionHelper.evaluateTargetCollection; +import static com.datadog.debugger.el.expressions.ExpressionHelper.checkTimeout; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; import com.datadog.debugger.el.Value; import com.datadog.debugger.el.Visitor; @@ -41,8 +43,9 @@ public FilterCollectionExpression(ValueExpression source, BooleanExpression f } @Override - public CollectionValue evaluate(ValueReferenceResolver valueRefResolver) { - Value collectionValue = evaluateTargetCollection(source, filterExpression, valueRefResolver); + public CollectionValue evaluate(EvalContext evalContext) { + Value collectionValue = evaluateTargetCollection(source, filterExpression, evalContext); + ValueReferenceResolver valueRefResolver = evalContext.getValueRefResolver(); if (collectionValue instanceof ListValue) { ListValue materialized = (ListValue) collectionValue; checkSupportedList(materialized, this); @@ -53,9 +56,10 @@ public CollectionValue evaluate(ValueReferenceResolver valueRefResolver) { Object value = materialized.get(i).getValue(); valueRefResolver.addExtension( ValueReferences.ITERATOR_EXTENSION_NAME, CapturedValue.of(value)); - if (filterExpression.evaluate(valueRefResolver)) { + if (filterExpression.evaluate(evalContext)) { filtered.add(value); } + checkTimeout(evalContext.getTimeoutChecker(), this); } } finally { valueRefResolver.removeExtension(ValueReferences.ITERATOR_EXTENSION_NAME); @@ -74,9 +78,10 @@ public CollectionValue evaluate(ValueReferenceResolver valueRefResolver) { valueRefResolver.addExtension( ValueReferences.ITERATOR_EXTENSION_NAME, CapturedValue.of(new MapValue.Entry(key, value))); - if (filterExpression.evaluate(valueRefResolver)) { + if (filterExpression.evaluate(evalContext)) { filtered.put(key.getValue(), value.getValue()); } + checkTimeout(evalContext.getTimeoutChecker(), this); } } finally { valueRefResolver.removeExtension(ValueReferences.KEY_EXTENSION_NAME); @@ -92,9 +97,10 @@ public CollectionValue evaluate(ValueReferenceResolver valueRefResolver) { for (Object value : setHolder) { valueRefResolver.addExtension( ValueReferences.ITERATOR_EXTENSION_NAME, CapturedValue.of(value)); - if (filterExpression.evaluate(valueRefResolver)) { + if (filterExpression.evaluate(evalContext)) { filtered.add(value); } + checkTimeout(evalContext.getTimeoutChecker(), this); } } finally { valueRefResolver.removeExtension(ValueReferences.ITERATOR_EXTENSION_NAME); diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/GetMemberExpression.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/GetMemberExpression.java index 45609979894..bfcfe6ee826 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/GetMemberExpression.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/GetMemberExpression.java @@ -1,5 +1,8 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.expressions.ExpressionHelper.checkTimeout; + +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; import com.datadog.debugger.el.Generated; import com.datadog.debugger.el.PrettyPrintVisitor; @@ -7,7 +10,6 @@ import com.datadog.debugger.el.ValueType; import com.datadog.debugger.el.Visitor; import datadog.trace.bootstrap.debugger.CapturedContext; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; import datadog.trace.bootstrap.debugger.util.Redaction; import java.util.Objects; @@ -21,14 +23,14 @@ public GetMemberExpression(ValueExpression target, String memberName) { } @Override - public Value evaluate(ValueReferenceResolver valueRefResolver) { - Value targetValue = target.evaluate(valueRefResolver); + public Value evaluate(EvalContext evalContext) { + Value targetValue = target.evaluate(evalContext); if (targetValue == Value.undefined()) { return targetValue; } CapturedContext.CapturedValue member; try { - member = valueRefResolver.getMember(targetValue.getValue(), memberName); + member = evalContext.getValueRefResolver().getMember(targetValue.getValue(), memberName); } catch (RuntimeException ex) { throw new EvaluationException(ex.getMessage(), PrettyPrintVisitor.print(this), ex); } @@ -41,6 +43,7 @@ public Value evaluate(ValueReferenceResolver valueRefResolver) { || Redaction.isRedactedType(memberValue.getClass().getTypeName()))) { ExpressionHelper.throwRedactedException(this); } + checkTimeout(evalContext.getTimeoutChecker(), this); return Value.of(member.getValue(), ValueType.of(member.getType())); } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/HasAllExpression.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/HasAllExpression.java index 6e2c449343f..90bba2f6165 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/HasAllExpression.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/HasAllExpression.java @@ -5,7 +5,9 @@ import static com.datadog.debugger.el.expressions.CollectionExpressionHelper.checkSupportedMap; import static com.datadog.debugger.el.expressions.CollectionExpressionHelper.checkSupportedSet; import static com.datadog.debugger.el.expressions.CollectionExpressionHelper.evaluateTargetCollection; +import static com.datadog.debugger.el.expressions.ExpressionHelper.checkTimeout; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; import com.datadog.debugger.el.Value; import com.datadog.debugger.el.Visitor; @@ -30,8 +32,9 @@ public HasAllExpression(ValueExpression valueExpression, BooleanExpression fi } @Override - public Boolean evaluate(ValueReferenceResolver valueRefResolver) { - Value value = evaluateTargetCollection(valueExpression, this, valueRefResolver); + public Boolean evaluate(EvalContext evalContext) { + Value value = evaluateTargetCollection(valueExpression, this, evalContext); + ValueReferenceResolver valueRefResolver = evalContext.getValueRefResolver(); if (value instanceof ListValue) { ListValue collection = (ListValue) value; checkSupportedList(collection, this); @@ -44,9 +47,10 @@ public Boolean evaluate(ValueReferenceResolver valueRefResolver) { for (int i = 0; i < len; i++) { valueRefResolver.addExtension( ValueReferences.ITERATOR_EXTENSION_NAME, CapturedValue.of(collection.get(i))); - if (!filterPredicateExpression.evaluate(valueRefResolver)) { + if (!filterPredicateExpression.evaluate(evalContext)) { return Boolean.FALSE; } + checkTimeout(evalContext.getTimeoutChecker(), this); } return Boolean.TRUE; } finally { @@ -69,9 +73,10 @@ public Boolean evaluate(ValueReferenceResolver valueRefResolver) { valueRefResolver.addExtension( ValueReferences.ITERATOR_EXTENSION_NAME, CapturedValue.of(new MapValue.Entry(key, val))); - if (!filterPredicateExpression.evaluate(valueRefResolver)) { + if (!filterPredicateExpression.evaluate(evalContext)) { return Boolean.FALSE; } + checkTimeout(evalContext.getTimeoutChecker(), this); } return Boolean.TRUE; } finally { @@ -91,9 +96,10 @@ public Boolean evaluate(ValueReferenceResolver valueRefResolver) { for (Object val : setHolder) { valueRefResolver.addExtension( ValueReferences.ITERATOR_EXTENSION_NAME, CapturedValue.of(val)); - if (!filterPredicateExpression.evaluate(valueRefResolver)) { + if (!filterPredicateExpression.evaluate(evalContext)) { return Boolean.FALSE; } + checkTimeout(evalContext.getTimeoutChecker(), this); } return Boolean.TRUE; } finally { diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/HasAnyExpression.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/HasAnyExpression.java index 23c3dea831f..7de0e110dfa 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/HasAnyExpression.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/HasAnyExpression.java @@ -5,7 +5,9 @@ import static com.datadog.debugger.el.expressions.CollectionExpressionHelper.checkSupportedMap; import static com.datadog.debugger.el.expressions.CollectionExpressionHelper.checkSupportedSet; import static com.datadog.debugger.el.expressions.CollectionExpressionHelper.evaluateTargetCollection; +import static com.datadog.debugger.el.expressions.ExpressionHelper.checkTimeout; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; import com.datadog.debugger.el.Value; import com.datadog.debugger.el.Visitor; @@ -31,8 +33,9 @@ public HasAnyExpression( } @Override - public Boolean evaluate(ValueReferenceResolver valueRefResolver) { - Value value = evaluateTargetCollection(valueExpression, this, valueRefResolver); + public Boolean evaluate(EvalContext evalContext) { + Value value = evaluateTargetCollection(valueExpression, this, evalContext); + ValueReferenceResolver valueRefResolver = evalContext.getValueRefResolver(); if (value instanceof ListValue) { ListValue collection = (ListValue) value; checkSupportedList(collection, this); @@ -45,9 +48,10 @@ public Boolean evaluate(ValueReferenceResolver valueRefResolver) { for (int i = 0; i < len; i++) { valueRefResolver.addExtension( ValueReferences.ITERATOR_EXTENSION_NAME, CapturedValue.of(collection.get(i))); - if (filterPredicateExpression.evaluate(valueRefResolver)) { + if (filterPredicateExpression.evaluate(evalContext)) { return Boolean.TRUE; } + checkTimeout(evalContext.getTimeoutChecker(), this); } return Boolean.FALSE; @@ -72,9 +76,10 @@ public Boolean evaluate(ValueReferenceResolver valueRefResolver) { valueRefResolver.addExtension( ValueReferences.ITERATOR_EXTENSION_NAME, CapturedValue.of(new MapValue.Entry(key, val))); - if (filterPredicateExpression.evaluate(valueRefResolver)) { + if (filterPredicateExpression.evaluate(evalContext)) { return Boolean.TRUE; } + checkTimeout(evalContext.getTimeoutChecker(), this); } return Boolean.FALSE; } catch (IllegalArgumentException | UnsupportedOperationException ex) { @@ -95,9 +100,10 @@ public Boolean evaluate(ValueReferenceResolver valueRefResolver) { for (Object val : setHolder) { valueRefResolver.addExtension( ValueReferences.ITERATOR_EXTENSION_NAME, CapturedValue.of(val)); - if (filterPredicateExpression.evaluate(valueRefResolver)) { + if (filterPredicateExpression.evaluate(evalContext)) { return Boolean.TRUE; } + checkTimeout(evalContext.getTimeoutChecker(), this); } return Boolean.FALSE; } catch (IllegalArgumentException | UnsupportedOperationException ex) { diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/IfElseExpression.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/IfElseExpression.java index cdd18689b11..1914b3a9a47 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/IfElseExpression.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/IfElseExpression.java @@ -1,8 +1,10 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.expressions.ExpressionHelper.checkTimeout; + +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.Expression; import com.datadog.debugger.el.Visitor; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; /** TODO: Primordial support for 'debugger watches' support */ public final class IfElseExpression implements Expression { @@ -18,12 +20,13 @@ public IfElseExpression( } @Override - public Void evaluate(ValueReferenceResolver valueRefResolver) { - if (test.evaluate(valueRefResolver)) { - thenExpression.evaluate(valueRefResolver); + public Void evaluate(EvalContext evalContext) { + if (test.evaluate(evalContext)) { + thenExpression.evaluate(evalContext); } else { - elseExpression.evaluate(valueRefResolver); + elseExpression.evaluate(evalContext); } + checkTimeout(evalContext.getTimeoutChecker(), this); return null; } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/IfExpression.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/IfExpression.java index d799b01c3b5..cce1e53aedd 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/IfExpression.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/IfExpression.java @@ -1,8 +1,10 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.expressions.ExpressionHelper.checkTimeout; + +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.Expression; import com.datadog.debugger.el.Visitor; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; /** TODO: Primordial support for 'debugger watches' support */ public final class IfExpression implements Expression { @@ -15,10 +17,11 @@ public IfExpression(BooleanExpression test, Expression expression) { } @Override - public Void evaluate(ValueReferenceResolver valueRefResolver) { - if (test.evaluate(valueRefResolver)) { - expression.evaluate(valueRefResolver); + public Void evaluate(EvalContext evalContext) { + if (test.evaluate(evalContext)) { + expression.evaluate(evalContext); } + checkTimeout(evalContext.getTimeoutChecker(), this); return null; } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/IndexExpression.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/IndexExpression.java index 9992286b0fa..8c718eb282d 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/IndexExpression.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/IndexExpression.java @@ -2,14 +2,15 @@ import static com.datadog.debugger.el.expressions.CollectionExpressionHelper.checkSupportedList; import static com.datadog.debugger.el.expressions.CollectionExpressionHelper.checkSupportedMap; +import static com.datadog.debugger.el.expressions.ExpressionHelper.checkTimeout; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; import com.datadog.debugger.el.PrettyPrintVisitor; import com.datadog.debugger.el.Value; import com.datadog.debugger.el.Visitor; import com.datadog.debugger.el.values.ListValue; import com.datadog.debugger.el.values.MapValue; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; import datadog.trace.bootstrap.debugger.util.Redaction; public class IndexExpression implements ValueExpression> { @@ -23,8 +24,8 @@ public IndexExpression(ValueExpression target, ValueExpression key) { } @Override - public Value evaluate(ValueReferenceResolver valueRefResolver) { - Value targetValue = target.evaluate(valueRefResolver); + public Value evaluate(EvalContext evalContext) { + Value targetValue = target.evaluate(evalContext); if (targetValue.isUndefined()) { throw new EvaluationException( "Cannot evaluate the expression for undefined value", PrettyPrintVisitor.print(this)); @@ -34,7 +35,7 @@ public Value evaluate(ValueReferenceResolver valueRefResolver) { "Cannot evaluate the expression for null value", PrettyPrintVisitor.print(this)); } Value result = Value.undefinedValue(); - Value keyValue = key.evaluate(valueRefResolver); + Value keyValue = key.evaluate(evalContext); if (keyValue == Value.undefined()) { return result; } @@ -65,6 +66,7 @@ public Value evaluate(ValueReferenceResolver valueRefResolver) { if (obj != null && Redaction.isRedactedType(obj.getClass().getTypeName())) { ExpressionHelper.throwRedactedException(this); } + checkTimeout(evalContext.getTimeoutChecker(), this); return Value.of(result.getValue(), result.getType()); } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/IsDefinedExpression.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/IsDefinedExpression.java index 5bada175eb4..27da03e06ae 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/IsDefinedExpression.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/IsDefinedExpression.java @@ -1,9 +1,11 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.expressions.ExpressionHelper.checkTimeout; + +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; import com.datadog.debugger.el.Value; import com.datadog.debugger.el.Visitor; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; /** Check whether a {@linkplain Value} was resolved correctly or symbol exists.
*/ public class IsDefinedExpression implements BooleanExpression { @@ -14,15 +16,17 @@ public IsDefinedExpression(ValueExpression valueExpression) { } @Override - public Boolean evaluate(ValueReferenceResolver valueRefResolver) { + public Boolean evaluate(EvalContext evalContext) { if (valueExpression == null) { return Boolean.FALSE; } try { - Value value = valueExpression.evaluate(valueRefResolver); + Value value = valueExpression.evaluate(evalContext); return value.isUndefined() ? Boolean.FALSE : Boolean.TRUE; } catch (EvaluationException ex) { return Boolean.FALSE; + } finally { + checkTimeout(evalContext.getTimeoutChecker(), this); } } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/IsEmptyExpression.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/IsEmptyExpression.java index 066aee72abc..1c4b43eef51 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/IsEmptyExpression.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/IsEmptyExpression.java @@ -1,12 +1,14 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.expressions.ExpressionHelper.checkTimeout; + +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; import com.datadog.debugger.el.PrettyPrintVisitor; import com.datadog.debugger.el.Value; import com.datadog.debugger.el.Visitor; import com.datadog.debugger.el.values.CollectionValue; import com.datadog.debugger.el.values.StringValue; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; /** * Checks whether a {@linkplain Value} is empty.
@@ -20,8 +22,8 @@ public IsEmptyExpression(ValueExpression valueExpression) { } @Override - public Boolean evaluate(ValueReferenceResolver valueRefResolver) { - Value value = valueExpression.evaluate(valueRefResolver); + public Boolean evaluate(EvalContext evalContext) { + Value value = valueExpression.evaluate(evalContext); if (value.isUndefined()) { throw new EvaluationException( "Cannot evaluate the expression for undefined value", PrettyPrintVisitor.print(this)); @@ -30,12 +32,14 @@ public Boolean evaluate(ValueReferenceResolver valueRefResolver) { throw new EvaluationException( "Cannot evaluate the expression for null value", PrettyPrintVisitor.print(this)); } + boolean result = false; if (value instanceof CollectionValue) { - return ((CollectionValue) value).isEmpty(); + result = ((CollectionValue) value).isEmpty(); } else if (value instanceof StringValue) { - return ((StringValue) value).isEmpty(); + result = ((StringValue) value).isEmpty(); } - return Boolean.FALSE; + checkTimeout(evalContext.getTimeoutChecker(), this); + return result; } @Override diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/LenExpression.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/LenExpression.java index aee603c4779..3033d693cf1 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/LenExpression.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/LenExpression.java @@ -1,5 +1,8 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.expressions.ExpressionHelper.checkTimeout; + +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; import com.datadog.debugger.el.PrettyPrintVisitor; import com.datadog.debugger.el.Value; @@ -8,7 +11,6 @@ import com.datadog.debugger.el.values.CollectionValue; import com.datadog.debugger.el.values.NumericValue; import com.datadog.debugger.el.values.StringValue; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -28,23 +30,27 @@ public LenExpression(ValueExpression source) { } @Override - public Value evaluate(ValueReferenceResolver valueRefResolver) { - Value materialized = source == null ? Value.nullValue() : source.evaluate(valueRefResolver); + public Value evaluate(EvalContext evalContext) { + Value materialized = source == null ? Value.nullValue() : source.evaluate(evalContext); + Value result = Value.undefined(); try { if (materialized.isNull()) { throw new RuntimeException("Cannot evaluate the expression for null value"); } else if (materialized.isUndefined()) { throw new RuntimeException("Cannot evaluate the expression for undefined value"); } else if (materialized instanceof StringValue) { - return (NumericValue) Value.of(((StringValue) materialized).length(), ValueType.INT); + result = (NumericValue) Value.of(((StringValue) materialized).length(), ValueType.INT); } else if (materialized instanceof CollectionValue) { - return (NumericValue) Value.of(((CollectionValue) materialized).count(), ValueType.INT); + result = (NumericValue) Value.of(((CollectionValue) materialized).count(), ValueType.INT); + } else { + throw new RuntimeException( + "Cannot evaluate the expression for " + materialized.getClass().getTypeName()); } } catch (RuntimeException ex) { throw new EvaluationException(ex.getMessage(), PrettyPrintVisitor.print(this)); } - log.warn("Can not compute length for {}", materialized); - return Value.undefined(); + checkTimeout(evalContext.getTimeoutChecker(), this); + return result; } public ValueExpression getSource() { diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/NotExpression.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/NotExpression.java index 6c71a7cc240..5cf8fad7607 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/NotExpression.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/NotExpression.java @@ -1,7 +1,9 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.expressions.ExpressionHelper.checkTimeout; + +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.Visitor; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; /** Will negate the resolved {@linkplain BooleanExpression} */ public final class NotExpression implements BooleanExpression { @@ -12,8 +14,10 @@ public NotExpression(BooleanExpression predicate) { } @Override - public Boolean evaluate(ValueReferenceResolver valueRefResolver) { - return !predicate.evaluate(valueRefResolver); + public Boolean evaluate(EvalContext evalContext) { + boolean result = !predicate.evaluate(evalContext); + checkTimeout(evalContext.getTimeoutChecker(), this); + return result; } @Override diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/StringPredicateExpression.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/StringPredicateExpression.java index 05d59b50b3c..efb1a4f3269 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/StringPredicateExpression.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/StringPredicateExpression.java @@ -1,10 +1,10 @@ package com.datadog.debugger.el.expressions; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; import com.datadog.debugger.el.PrettyPrintVisitor; import com.datadog.debugger.el.Value; import com.datadog.debugger.el.values.StringValue; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; import java.util.function.BiPredicate; public class StringPredicateExpression implements BooleanExpression { @@ -25,9 +25,9 @@ public StringPredicateExpression( } @Override - public Boolean evaluate(ValueReferenceResolver valueRefResolver) { + public Boolean evaluate(EvalContext evalContext) { Value sourceValue = - sourceString != null ? sourceString.evaluate(valueRefResolver) : Value.nullValue(); + sourceString != null ? sourceString.evaluate(evalContext) : Value.nullValue(); if (sourceValue.isUndefined()) { throw new EvaluationException( "Cannot evaluate the expression for undefined value", PrettyPrintVisitor.print(this)); @@ -38,7 +38,9 @@ public Boolean evaluate(ValueReferenceResolver valueRefResolver) { } if (sourceValue.getValue() instanceof String) { String sourceStr = (String) sourceValue.getValue(); - return predicate.test(sourceStr, str.getValue()); + boolean result = predicate.test(sourceStr, str.getValue()); + ExpressionHelper.checkTimeout(evalContext.getTimeoutChecker(), this); + return result; } return Boolean.FALSE; } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/SubStringExpression.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/SubStringExpression.java index c50e01271c9..40e7d258e33 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/SubStringExpression.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/SubStringExpression.java @@ -1,11 +1,13 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.expressions.ExpressionHelper.checkTimeout; + +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; import com.datadog.debugger.el.PrettyPrintVisitor; import com.datadog.debugger.el.Value; import com.datadog.debugger.el.ValueType; import com.datadog.debugger.el.Visitor; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; public class SubStringExpression implements ValueExpression> { private final ValueExpression source; @@ -19,8 +21,8 @@ public SubStringExpression(ValueExpression source, int startIndex, int endInd } @Override - public Value evaluate(ValueReferenceResolver valueRefResolver) { - Value sourceValue = source != null ? source.evaluate(valueRefResolver) : Value.nullValue(); + public Value evaluate(EvalContext evalContext) { + Value sourceValue = source != null ? source.evaluate(evalContext) : Value.nullValue(); if (sourceValue.isUndefined()) { throw new EvaluationException( "Cannot evaluate the expression for undefined value", PrettyPrintVisitor.print(this)); @@ -31,7 +33,9 @@ public Value evaluate(ValueReferenceResolver valueRefResolver) { } if (sourceValue.getValue() instanceof String) { String sourceStr = (String) sourceValue.getValue(); - return internalEvaluate(sourceStr); + Value result = internalEvaluate(sourceStr); + checkTimeout(evalContext.getTimeoutChecker(), this); + return result; } return Value.undefined(); } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/ThenExpression.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/ThenExpression.java index 024109a5f58..e75b02fc701 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/ThenExpression.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/ThenExpression.java @@ -1,12 +1,12 @@ package com.datadog.debugger.el.expressions; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.Value; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; /** TODO: Primordial support for 'debugger watches' support */ public final class ThenExpression implements ValueExpression> { @Override - public Value evaluate(ValueReferenceResolver valueRefResolver) { + public Value evaluate(EvalContext evalContext) { // TODO: This can be used to implement 'add watch' functionality where the script can amend the // collected snapshot return null; diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/ValueExpression.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/ValueExpression.java index 22d8e782a7d..5c43935555c 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/ValueExpression.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/ValueExpression.java @@ -1,8 +1,8 @@ package com.datadog.debugger.el.expressions; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.Expression; import com.datadog.debugger.el.Value; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; /** * A generic interface for expressions resolving to {@linkplain Value} @@ -13,7 +13,7 @@ public interface ValueExpression> extends Expression { ValueExpression NULL = new ValueExpression>() { @Override - public Value evaluate(ValueReferenceResolver valueRefResolver) { + public Value evaluate(EvalContext evalContext) { return Value.nullValue(); } @@ -26,7 +26,7 @@ public String toString() { ValueExpression UNDEFINED = new ValueExpression>() { @Override - public Value evaluate(ValueReferenceResolver valueRefResolver) { + public Value evaluate(EvalContext evalContext) { return Value.undefinedValue(); } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/ValueRefExpression.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/ValueRefExpression.java index fa36ef9f15f..1b14838e167 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/ValueRefExpression.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/ValueRefExpression.java @@ -1,7 +1,10 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.expressions.ExpressionHelper.checkTimeout; +import static com.datadog.debugger.el.expressions.ExpressionHelper.throwRedactedException; import static datadog.trace.bootstrap.debugger.util.Redaction.REDACTED_VALUE; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; import com.datadog.debugger.el.Generated; import com.datadog.debugger.el.PrettyPrintVisitor; @@ -9,7 +12,6 @@ import com.datadog.debugger.el.ValueType; import com.datadog.debugger.el.Visitor; import datadog.trace.bootstrap.debugger.CapturedContext; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; import datadog.trace.bootstrap.debugger.util.Redaction; import java.util.Objects; @@ -22,18 +24,19 @@ public ValueRefExpression(String symbolName) { } @Override - public Value evaluate(ValueReferenceResolver valueRefResolver) { + public Value evaluate(EvalContext evalContext) { CapturedContext.CapturedValue symbol; try { - symbol = valueRefResolver.lookup(symbolName); + symbol = evalContext.getValueRefResolver().lookup(symbolName); } catch (RuntimeException ex) { throw new EvaluationException(ex.getMessage(), PrettyPrintVisitor.print(this)); } if (symbol != null) { String typeName = symbol.getType(); if (symbol.getValue() == REDACTED_VALUE || (Redaction.isRedactedType(typeName))) { - ExpressionHelper.throwRedactedException(this); + throwRedactedException(this); } + checkTimeout(evalContext.getTimeoutChecker(), this); return Value.of(symbol.getValue(), ValueType.of(symbol.getType())); } return Value.nullValue(); diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/WhenExpression.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/WhenExpression.java index 8ad9b0ad491..60f0b3cfb77 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/WhenExpression.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/expressions/WhenExpression.java @@ -1,7 +1,7 @@ package com.datadog.debugger.el.expressions; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.Visitor; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; /** The entry-point expression for the debugger EL */ public final class WhenExpression implements BooleanExpression { @@ -12,8 +12,8 @@ public WhenExpression(BooleanExpression expression) { } @Override - public Boolean evaluate(ValueReferenceResolver valueRefResolver) { - return expression.evaluate(valueRefResolver); + public Boolean evaluate(EvalContext evalContext) { + return expression.evaluate(evalContext); } @Override diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/values/ListValue.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/values/ListValue.java index d0c3dcffc63..8c9ce5fbb87 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/values/ListValue.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/values/ListValue.java @@ -1,10 +1,13 @@ package com.datadog.debugger.el.values; +import static com.datadog.debugger.el.expressions.ExpressionHelper.checkArrayLength; +import static com.datadog.debugger.el.expressions.ExpressionHelper.checkCollectionSize; + +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.Value; import com.datadog.debugger.el.ValueType; import com.datadog.debugger.el.Visitor; import com.datadog.debugger.el.expressions.ValueExpression; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; import datadog.trace.bootstrap.debugger.el.Values; import datadog.trace.bootstrap.debugger.util.WellKnownClasses; import java.lang.reflect.Array; @@ -134,14 +137,17 @@ public Value get(int index) { @Override public boolean contains(Value val) { if (listHolder instanceof Collection) { - if (WellKnownClasses.isSafe((Collection) listHolder)) { - return ((Collection) listHolder).contains(val.isNull() ? null : val.getValue()); + Collection collection = (Collection) listHolder; + if (WellKnownClasses.isSafe(collection)) { + checkCollectionSize(collection, this); + return collection.contains(val.isNull() ? null : val.getValue()); } throw new UnsupportedOperationException( "Unsupported Collection class: " + listHolder.getClass().getTypeName()); } if (arrayHolder != null) { int count = Array.getLength(arrayHolder); + checkArrayLength(count, this); if (arrayType.isPrimitive()) { if (val.getValue() == null || val.isNull()) { throw new IllegalArgumentException("Cannot compare null with primitive array"); @@ -255,7 +261,7 @@ public Object getValue() { } @Override - public ListValue evaluate(ValueReferenceResolver valueRefResolver) { + public ListValue evaluate(EvalContext evalContext) { return this; } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/values/MapValue.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/values/MapValue.java index c06680aa56e..05778531c82 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/values/MapValue.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/values/MapValue.java @@ -1,10 +1,10 @@ package com.datadog.debugger.el.values; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.Value; import com.datadog.debugger.el.ValueType; import com.datadog.debugger.el.Visitor; import com.datadog.debugger.el.expressions.ValueExpression; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; import datadog.trace.bootstrap.debugger.el.Values; import datadog.trace.bootstrap.debugger.util.WellKnownClasses; import java.util.Collections; @@ -144,7 +144,7 @@ public Object getValue() { } @Override - public MapValue evaluate(ValueReferenceResolver valueRefResolver) { + public MapValue evaluate(EvalContext evalContext) { return this; } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/values/SetValue.java b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/values/SetValue.java index 07651471858..9654c1b99c8 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/values/SetValue.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/main/java/com/datadog/debugger/el/values/SetValue.java @@ -1,10 +1,10 @@ package com.datadog.debugger.el.values; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.Value; import com.datadog.debugger.el.ValueType; import com.datadog.debugger.el.Visitor; import com.datadog.debugger.el.expressions.ValueExpression; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; import datadog.trace.bootstrap.debugger.el.Values; import datadog.trace.bootstrap.debugger.util.WellKnownClasses; import java.util.Collection; @@ -25,7 +25,7 @@ public SetValue(Object object) { } @Override - public SetValue evaluate(ValueReferenceResolver valueRefResolver) { + public SetValue evaluate(EvalContext evalContext) { return this; } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/BooleanValueExpressionAdapterTest.java b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/BooleanValueExpressionAdapterTest.java index 3b793ecb1d6..01a09dd6569 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/BooleanValueExpressionAdapterTest.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/BooleanValueExpressionAdapterTest.java @@ -1,10 +1,10 @@ package com.datadog.debugger.el; +import static com.datadog.debugger.el.EvalContextHelper.createEvalContext; import static org.junit.jupiter.api.Assertions.*; import com.datadog.debugger.el.expressions.BooleanExpression; import com.datadog.debugger.el.values.BooleanValue; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; import org.junit.jupiter.api.Test; class BooleanValueExpressionAdapterTest { @@ -29,20 +29,14 @@ public void testLiteral() { public void testExpression() { BooleanValueExpressionAdapter booleanValueExpressionAdapter = new BooleanValueExpressionAdapter(DSL.eq(DSL.value(1), DSL.value(1))); - BooleanValue resultValue = booleanValueExpressionAdapter.evaluate(null); + BooleanValue resultValue = booleanValueExpressionAdapter.evaluate(createEvalContext(this)); assertTrue(resultValue.getValue()); } @Test public void testNull() { BooleanValueExpressionAdapter booleanValueExpressionAdapter = - new BooleanValueExpressionAdapter( - new BooleanExpression() { - @Override - public Boolean evaluate(ValueReferenceResolver valueRefResolver) { - return null; - } - }); + new BooleanValueExpressionAdapter(evalContext -> null); EvaluationException ex = assertThrows(EvaluationException.class, () -> booleanValueExpressionAdapter.evaluate(null)); assertEquals("Boolean expression returning null", ex.getMessage()); diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/EvalContextHelper.java b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/EvalContextHelper.java new file mode 100644 index 00000000000..9df06537c7e --- /dev/null +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/EvalContextHelper.java @@ -0,0 +1,66 @@ +package com.datadog.debugger.el; + +import datadog.trace.api.Config; +import datadog.trace.bootstrap.debugger.CapturedContext; +import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; +import datadog.trace.bootstrap.debugger.util.Redaction; +import datadog.trace.bootstrap.debugger.util.TimeoutChecker; +import java.time.Duration; +import java.util.*; + +public class EvalContextHelper { + + public static final Duration TEST_TIMEOUT = Duration.ofMillis(1000); + + public static EvalContext createEvalContext(Object instance) { + // create a higher timeout for test to avoid flakiness + return new EvalContext( + createResolver(instance), TimeoutChecker.create(Config.get(), TEST_TIMEOUT)); + } + + // specify lower timeout to test timeout checker + public static EvalContext createEvalContext(Object instance, Duration timeout) { + return new EvalContext(createResolver(instance), TimeoutChecker.create(Config.get(), timeout)); + } + + public static ValueReferenceResolver createResolver(Object instance) { + CapturedContext.CapturedValue thisValue = + CapturedContext.CapturedValue.of("this", instance.getClass().getTypeName(), instance); + return new CapturedContext(new CapturedContext.CapturedValue[] {thisValue}, null, null, null); + } + + public static ValueReferenceResolver createResolver( + Map args, Map locals) { + CapturedContext.CapturedValue[] argValues = null; + if (args != null) { + argValues = new CapturedContext.CapturedValue[args.size()]; + fillValues(args, argValues); + } + CapturedContext.CapturedValue[] localValues = null; + if (locals != null) { + localValues = new CapturedContext.CapturedValue[locals.size()]; + fillValues(locals, localValues); + } + return new CapturedContext(argValues, localValues, null, null); + } + + private static void fillValues( + Map fields, CapturedContext.CapturedValue[] fieldValues) { + int index = 0; + for (Map.Entry entry : fields.entrySet()) { + Object value = entry.getValue(); + if (Redaction.isRedactedKeyword(entry.getKey())) { + fieldValues[index++] = + CapturedContext.CapturedValue.redacted( + entry.getKey(), + value != null ? value.getClass().getTypeName() : Object.class.getTypeName()); + } else { + fieldValues[index++] = + CapturedContext.CapturedValue.of( + entry.getKey(), + value != null ? value.getClass().getTypeName() : Object.class.getTypeName(), + value); + } + } + } +} diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/ExpressionTest.java b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/ExpressionTest.java index f88cf81e472..de75a00713f 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/ExpressionTest.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/ExpressionTest.java @@ -1,6 +1,7 @@ package com.datadog.debugger.el; import static com.datadog.debugger.el.DSL.*; +import static com.datadog.debugger.el.EvalContextHelper.createEvalContext; import static com.datadog.debugger.el.PrettyPrintVisitor.print; import static org.junit.jupiter.api.Assertions.*; @@ -9,7 +10,6 @@ import com.datadog.debugger.el.values.NumericValue; import com.datadog.debugger.el.values.StringValue; import datadog.trace.bootstrap.debugger.CapturedContext; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; import java.util.stream.Stream; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; @@ -21,7 +21,7 @@ class ExpressionTest { @MethodSource("literalExpressions") void testLiteralExpressions(Literal literal, Object expectedValue) { Value value1 = literal.evaluate(null); - Value value2 = literal.evaluate(new CapturedContext()); + Value value2 = literal.evaluate(new EvalContext(new CapturedContext(), null)); assertNotNull(value1); assertNotNull(value2); @@ -43,16 +43,16 @@ void testPredicateExpression() { StringValue string = new StringValue("Hello World"); StringValue emptyString = new StringValue(""); - ValueReferenceResolver resolver = new CapturedContext(); + EvalContext evalContext = createEvalContext(this); IsEmptyExpression isEmpty1 = new IsEmptyExpression(string); IsEmptyExpression isEmpty2 = new IsEmptyExpression(emptyString); - assertFalse(isEmpty1.evaluate(resolver)); - assertTrue(isEmpty2.evaluate(resolver)); + assertFalse(isEmpty1.evaluate(evalContext)); + assertTrue(isEmpty2.evaluate(evalContext)); - assertTrue(not(isEmpty1).evaluate(resolver)); - assertTrue(or(isEmpty1, isEmpty2).evaluate(resolver)); - assertFalse(and(isEmpty1, isEmpty2).evaluate(resolver)); + assertTrue(not(isEmpty1).evaluate(evalContext)); + assertTrue(or(isEmpty1, isEmpty2).evaluate(evalContext)); + assertFalse(and(isEmpty1, isEmpty2).evaluate(evalContext)); } @Test diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/ProbeConditionTest.java b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/ProbeConditionTest.java index 8d6f8a3eae3..50ba2590b2a 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/ProbeConditionTest.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/ProbeConditionTest.java @@ -10,7 +10,11 @@ import com.squareup.moshi.JsonAdapter; import com.squareup.moshi.Moshi; +import datadog.trace.api.Config; +import datadog.trace.bootstrap.debugger.el.ReflectiveFieldValueResolver; import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; +import datadog.trace.bootstrap.debugger.util.Redaction; +import datadog.trace.bootstrap.debugger.util.TimeoutChecker; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -28,12 +32,22 @@ import java.util.UUID; import java.util.stream.Collectors; import okio.Okio; +import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; public class ProbeConditionTest { + private static final Duration TEST_TIMEOUT = Duration.ofMillis(500); // used in testExecuteCondition private int field = 10; + @BeforeAll + static void beforeAll() { + // Warming up here for first call, to avoid reaching timeout when evaluating + Redaction.isRedactedKeyword("strList"); + ReflectiveFieldValueResolver.getFieldAsCapturedValue( + ProbeConditionTest.class, new ProbeConditionTest(), "field"); + } + @Test void testExecuteCondition() throws Exception { ProbeCondition probeCondition = loadFromResource("/test_conditional_01.json"); @@ -42,17 +56,17 @@ class Obj1 { private int field = 10; List field2 = new ArrayList<>(); } - ValueReferenceResolver ctx = RefResolverHelper.createResolver(new Obj1()); + ValueReferenceResolver ctx = EvalContextHelper.createResolver(new Obj1()); - assertTrue(probeCondition.execute(ctx)); + assertTrue(probeCondition.execute(ctx, TimeoutChecker.create(Config.get(), TEST_TIMEOUT))); class Obj2 { Collection tags = Arrays.asList("hey", "world", "ko"); private int field = 10; List field2 = new ArrayList<>(); } - ValueReferenceResolver ctx2 = RefResolverHelper.createResolver(new Obj2()); - assertFalse(probeCondition.execute(ctx2)); + ValueReferenceResolver ctx2 = EvalContextHelper.createResolver(new Obj2()); + assertFalse(probeCondition.execute(ctx2, TimeoutChecker.create(Config.get(), TEST_TIMEOUT))); } @Test @@ -62,18 +76,20 @@ class Obj { Container container = new Container("hello"); } ValueReferenceResolver ctx = - RefResolverHelper.createResolver( + EvalContextHelper.createResolver( singletonMap("this", new Obj()), singletonMap("container", new Container("world"))); - assertTrue(probeCondition.execute(ctx)); + assertTrue(probeCondition.execute(ctx, TimeoutChecker.create(Config.get(), TEST_TIMEOUT))); class Obj2 { Container obj = new Container("hello"); } ValueReferenceResolver ctx2 = - RefResolverHelper.createResolver( + EvalContextHelper.createResolver( singletonMap("this", new Obj2()), singletonMap("container", new Container("world"))); RuntimeException runtimeException = - assertThrows(RuntimeException.class, () -> probeCondition.execute(ctx2)); + assertThrows( + RuntimeException.class, + () -> probeCondition.execute(ctx2, TimeoutChecker.create(Config.get(), TEST_TIMEOUT))); assertEquals("Cannot dereference field: container", runtimeException.getMessage()); } @@ -84,8 +100,8 @@ class Obj { int intField1 = 42; String strField = "foo"; } - ValueReferenceResolver ctx = RefResolverHelper.createResolver(new Obj()); - assertTrue(probeCondition.execute(ctx)); + ValueReferenceResolver ctx = EvalContextHelper.createResolver(new Obj()); + assertTrue(probeCondition.execute(ctx, TimeoutChecker.create(Config.get(), TEST_TIMEOUT))); } @Test @@ -95,9 +111,9 @@ class Obj { Object objField = new Object(); } ValueReferenceResolver ctx = - RefResolverHelper.createResolver( + EvalContextHelper.createResolver( singletonMap("this", new Obj()), singletonMap("nullField", null)); - assertTrue(probeCondition.execute(ctx)); + assertTrue(probeCondition.execute(ctx, TimeoutChecker.create(Config.get(), TEST_TIMEOUT))); } @Test @@ -116,8 +132,8 @@ class Obj { int idx = 1; } - ValueReferenceResolver ctx = RefResolverHelper.createResolver(new Obj()); - assertTrue(probeCondition.execute(ctx)); + ValueReferenceResolver ctx = EvalContextHelper.createResolver(new Obj()); + assertTrue(probeCondition.execute(ctx, TimeoutChecker.create(Config.get(), TEST_TIMEOUT))); } @Test @@ -126,8 +142,8 @@ void testStringOperation() throws Exception { class Obj { String strField = "foobar"; } - ValueReferenceResolver ctx = RefResolverHelper.createResolver(new Obj()); - assertTrue(probeCondition.execute(ctx)); + ValueReferenceResolver ctx = EvalContextHelper.createResolver(new Obj()); + assertTrue(probeCondition.execute(ctx, TimeoutChecker.create(Config.get(), TEST_TIMEOUT))); } @Test @@ -148,10 +164,10 @@ void testJsonParsing() throws IOException { class Obj { Collection vets = Arrays.asList("vet1", "vet2", "vet3"); } - ValueReferenceResolver ctx = RefResolverHelper.createResolver(new Obj()); + ValueReferenceResolver ctx = EvalContextHelper.createResolver(new Obj()); // the condition checks if length of vets > 2 - assertTrue(probeCondition.execute(ctx)); + assertTrue(probeCondition.execute(ctx, TimeoutChecker.create(Config.get(), TEST_TIMEOUT))); } @Test @@ -191,9 +207,11 @@ void redaction() throws IOException { ProbeCondition probeCondition = loadFromResource("/test_conditional_09.json"); Map args = new HashMap<>(); args.put("password", "secret123"); - ValueReferenceResolver ctx = RefResolverHelper.createResolver(args, null); + ValueReferenceResolver ctx = EvalContextHelper.createResolver(args, null); EvaluationException evaluationException = - assertThrows(EvaluationException.class, () -> probeCondition.execute(ctx)); + assertThrows( + EvaluationException.class, + () -> probeCondition.execute(ctx, TimeoutChecker.create(Config.get(), TEST_TIMEOUT))); assertEquals( "Could not evaluate the expression because 'password' was redacted", evaluationException.getMessage()); @@ -207,8 +225,8 @@ void primitives() throws IOException { args.put("duration", Duration.ofSeconds(42)); args.put("clazz", "foo".getClass()); args.put("now", new Date(1700000000000L)); // 2023-11-14T00:00:00Z - ValueReferenceResolver ctx = RefResolverHelper.createResolver(args, null); - assertTrue(probeCondition.execute(ctx)); + ValueReferenceResolver ctx = EvalContextHelper.createResolver(args, null); + assertTrue(probeCondition.execute(ctx, TimeoutChecker.create(Config.get(), TEST_TIMEOUT))); } @Test @@ -222,8 +240,8 @@ class Obj { Set emptySet = new HashSet<>(); Object[] emptyArray = new Object[0]; } - ValueReferenceResolver ctx = RefResolverHelper.createResolver(new Obj()); - assertTrue(probeCondition.execute(ctx)); + ValueReferenceResolver ctx = EvalContextHelper.createResolver(new Obj()); + assertTrue(probeCondition.execute(ctx, TimeoutChecker.create(Config.get(), TEST_TIMEOUT))); } @Test @@ -238,16 +256,24 @@ class Obj { Object objVal = null; char charVal = 'a'; } - ValueReferenceResolver ctx = RefResolverHelper.createResolver(new Obj()); - assertTrue(probeCondition.execute(ctx)); + ValueReferenceResolver ctx = EvalContextHelper.createResolver(new Obj()); + assertTrue(probeCondition.execute(ctx, TimeoutChecker.create(Config.get(), TEST_TIMEOUT))); } @Test - void testLenCount() throws Exception { + void testTimeoutAndLenCount() throws Exception { ProbeCondition probeCondition = loadFromResource("/test_conditional_14.json"); class Obj { int[] intArray = new int[] {1, 1, 1}; String[] strArray = new String[] {"foo", "bar"}; + List largeList = new ArrayList<>(); + + { + for (int i = 0; i < 1_000; i++) { + largeList.add("foobar" + i); + } + } + Map strMap = new HashMap<>(); { @@ -267,8 +293,18 @@ class Obj { strList.add("foo"); } } - ValueReferenceResolver ctx = RefResolverHelper.createResolver(new Obj()); - assertTrue(probeCondition.execute(ctx)); + Obj obj = new Obj(); + ValueReferenceResolver ctx = EvalContextHelper.createResolver(obj); + // first call is longer so ideal to test timeout + EvaluationException evaluationException = + assertThrows( + EvaluationException.class, + () -> + probeCondition.execute( + ctx, TimeoutChecker.create(Config.get(), Duration.ofMillis(1)))); + assertEquals("timeout (1ms)", evaluationException.getMessage()); + // test good execution + assertTrue(probeCondition.execute(ctx, TimeoutChecker.create(Config.get(), TEST_TIMEOUT))); } @Test @@ -278,9 +314,11 @@ class Obj { } List lines = loadLinesFromResource("/null_expressions.txt"); for (String line : lines) { - ValueReferenceResolver ctx = RefResolverHelper.createResolver(new Obj()); + ValueReferenceResolver ctx = EvalContextHelper.createResolver(new Obj()); EvaluationException ex = - assertThrows(EvaluationException.class, () -> load(line).execute(ctx)); + assertThrows( + EvaluationException.class, + () -> load(line).execute(ctx, TimeoutChecker.create(Config.get(), TEST_TIMEOUT))); assertEquals("Cannot evaluate the expression for null value", ex.getMessage(), line); } } @@ -299,11 +337,14 @@ class Obj { } List lines = loadLinesFromResource("/contains_expressions.txt"); for (String line : lines) { - ValueReferenceResolver ctx = RefResolverHelper.createResolver(new Obj()); - assertTrue(load(line).execute(ctx)); + ValueReferenceResolver ctx = EvalContextHelper.createResolver(new Obj()); + assertTrue(load(line).execute(ctx, TimeoutChecker.create(Config.get(), TEST_TIMEOUT))); } } + @Test + public void timeoutExpressions() {} + private static ProbeCondition loadFromResource(String resourcePath) throws IOException { InputStream input = ProbeConditionTest.class.getResourceAsStream(resourcePath); Moshi moshi = diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/RefResolverHelper.java b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/RefResolverHelper.java deleted file mode 100644 index 88b33231c3f..00000000000 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/RefResolverHelper.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.datadog.debugger.el; - -import datadog.trace.bootstrap.debugger.CapturedContext; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; -import datadog.trace.bootstrap.debugger.util.Redaction; -import java.util.*; - -public class RefResolverHelper { - - public static ValueReferenceResolver createResolver(Object instance) { - CapturedContext.CapturedValue thisValue = - CapturedContext.CapturedValue.of("this", instance.getClass().getTypeName(), instance); - return new CapturedContext(new CapturedContext.CapturedValue[] {thisValue}, null, null, null); - } - - public static ValueReferenceResolver createResolver( - Map args, Map locals) { - CapturedContext.CapturedValue[] argValues = null; - if (args != null) { - argValues = new CapturedContext.CapturedValue[args.size()]; - fillValues(args, argValues); - } - CapturedContext.CapturedValue[] localValues = null; - if (locals != null) { - localValues = new CapturedContext.CapturedValue[locals.size()]; - fillValues(locals, localValues); - } - return new CapturedContext(argValues, localValues, null, null); - } - - private static void fillValues( - Map fields, CapturedContext.CapturedValue[] fieldValues) { - int index = 0; - for (Map.Entry entry : fields.entrySet()) { - Object value = entry.getValue(); - if (Redaction.isRedactedKeyword(entry.getKey())) { - fieldValues[index++] = - CapturedContext.CapturedValue.redacted( - entry.getKey(), - value != null ? value.getClass().getTypeName() : Object.class.getTypeName()); - } else { - fieldValues[index++] = - CapturedContext.CapturedValue.of( - entry.getKey(), - value != null ? value.getClass().getTypeName() : Object.class.getTypeName(), - value); - } - } - } -} diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/ValueScriptTest.java b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/ValueScriptTest.java index eefbca9956a..fccf05ffeb7 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/ValueScriptTest.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/ValueScriptTest.java @@ -1,13 +1,19 @@ package com.datadog.debugger.el; +import static com.datadog.debugger.el.EvalContextHelper.createResolver; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; import com.squareup.moshi.Moshi; +import datadog.trace.api.Config; import datadog.trace.bootstrap.debugger.el.Values; +import datadog.trace.bootstrap.debugger.util.TimeoutChecker; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.time.Duration; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.stream.Collectors; @@ -15,22 +21,43 @@ import org.junit.jupiter.api.Test; public class ValueScriptTest { + private static final Duration TEST_TIMEOUT = Duration.ofMinutes(500); static class Obj { String str = "hello"; int i = 10; List list = Arrays.asList("a", "b", "c"); + List largeList = new ArrayList<>(); long l = 100_000_000_000L; float f = 2.5F; double d = 3.14D; char c = 'a'; + + { + for (int i = 0; i < 5_000; i++) { + largeList.add("hello" + i); + } + } } @Test public void predicates() { ValueScript valueScript = loadFromResource("/test_value_expr_01.json"); + // first call is longer so ideal to test timeout + EvaluationException evaluationException = + assertThrows( + EvaluationException.class, + () -> + valueScript.execute( + createResolver(new Obj()), + TimeoutChecker.create(Config.get(), Duration.ofMillis(1)))); + assertEquals("timeout (1ms)", evaluationException.getMessage()); + // test good execution assertEquals( - Boolean.TRUE, valueScript.execute(RefResolverHelper.createResolver(new Obj())).getValue()); + Boolean.TRUE, + valueScript + .execute(createResolver(new Obj()), TimeoutChecker.create(Config.get(), TEST_TIMEOUT)) + .getValue()); } @Test @@ -40,7 +67,9 @@ public void topLevelPredicates() { ValueScript valueScript = load(line); assertEquals( Boolean.TRUE, - valueScript.execute(RefResolverHelper.createResolver(new Obj())).getValue(), + valueScript + .execute(createResolver(new Obj()), TimeoutChecker.create(Config.get(), TEST_TIMEOUT)) + .getValue(), line); } } @@ -77,7 +106,9 @@ public void topLevelPrimitives() { ValueScript valueScript = load(line); assertEquals( expectedValues[i], - valueScript.execute(RefResolverHelper.createResolver(new Obj())).getValue(), + valueScript + .execute(createResolver(new Obj()), TimeoutChecker.create(Config.get(), TEST_TIMEOUT)) + .getValue(), line); i++; } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/BinaryExpressionTest.java b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/BinaryExpressionTest.java index 8faaf61d48a..ef6de51409f 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/BinaryExpressionTest.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/BinaryExpressionTest.java @@ -1,20 +1,23 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.EvalContextHelper.createEvalContext; import static com.datadog.debugger.el.PrettyPrintVisitor.print; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; -import com.datadog.debugger.el.RefResolverHelper; +import com.datadog.debugger.el.EvalContext; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; class BinaryExpressionTest { + EvalContext evalContext = createEvalContext(this); + @Test void testLeftNull() { BinaryExpression expression = new BinaryExpression(null, BooleanExpression.TRUE, BinaryOperator.AND); - assertFalse(expression.evaluate(RefResolverHelper.createResolver(this))); + assertFalse(expression.evaluate(evalContext)); assertEquals("false && true", print(expression)); } @@ -22,7 +25,7 @@ void testLeftNull() { void testRightNull() { BinaryExpression expression = new BinaryExpression(BooleanExpression.TRUE, null, BinaryOperator.AND); - assertFalse(expression.evaluate(RefResolverHelper.createResolver(this))); + assertFalse(expression.evaluate(evalContext)); assertEquals("true && false", print(expression)); } @@ -33,7 +36,7 @@ void testShortCircuitAnd() { BooleanExpression.FALSE, valueRefResolver -> Assertions.fail("should not reach"), BinaryOperator.AND); - assertFalse(expression.evaluate(RefResolverHelper.createResolver(this))); + assertFalse(expression.evaluate(evalContext)); assertEquals("false && null", print(expression)); } @@ -44,7 +47,7 @@ void testShortCircuitOr() { BooleanExpression.TRUE, valueRefResolver -> Assertions.fail("should not reach"), BinaryOperator.OR); - assertTrue(expression.evaluate(RefResolverHelper.createResolver(this))); + assertTrue(expression.evaluate(evalContext)); assertEquals("true || null", print(expression)); } } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/ComparisonExpressionTest.java b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/ComparisonExpressionTest.java index d2b2e1cd8c4..28ac3425f3e 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/ComparisonExpressionTest.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/ComparisonExpressionTest.java @@ -1,5 +1,6 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.EvalContextHelper.createEvalContext; import static com.datadog.debugger.el.PrettyPrintVisitor.print; import static com.datadog.debugger.el.ValueType.DOUBLE; import static com.datadog.debugger.el.ValueType.FLOAT; @@ -14,6 +15,7 @@ import static com.datadog.debugger.el.expressions.ComparisonOperator.LT; import static org.junit.jupiter.api.Assertions.*; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; import com.datadog.debugger.el.values.NumericValue; import com.datadog.debugger.el.values.ObjectValue; @@ -41,7 +43,7 @@ void evaluateOperator( boolean expected, String prettyPrint) { ComparisonExpression expression = new ComparisonExpression(left, right, operator); - assertEquals(expected, expression.evaluate(NoopResolver.INSTANCE)); + assertEquals(expected, expression.evaluate(createEvalContext(NoopResolver.INSTANCE))); assertEquals(prettyPrint, print(expression)); } @@ -243,7 +245,7 @@ void evaluateOperatorStrings( boolean expected, String prettyPrint) { ComparisonExpression expression = new ComparisonExpression(left, right, operator); - assertEquals(expected, expression.evaluate(NoopResolver.INSTANCE)); + assertEquals(expected, expression.evaluate(createEvalContext(NoopResolver.INSTANCE))); assertEquals(prettyPrint, print(expression)); } @@ -273,35 +275,35 @@ private static Stream expressionStrs() { void evaluateSecondUndefined() { ComparisonExpression expression = new ComparisonExpression(new NumericValue(1, INT), ValueExpression.UNDEFINED, EQ); - assertFalse(expression.evaluate(NoopResolver.INSTANCE)); + assertFalse(expression.evaluate(new EvalContext(NoopResolver.INSTANCE, null))); } @Test void evaluateBothUndefined() { ComparisonExpression expression = new ComparisonExpression(ValueExpression.UNDEFINED, ValueExpression.UNDEFINED, EQ); - assertFalse(expression.evaluate(NoopResolver.INSTANCE)); + assertFalse(expression.evaluate(new EvalContext(NoopResolver.INSTANCE, null))); } @Test void evaluateFirstNull() { ComparisonExpression expression = new ComparisonExpression(ValueExpression.NULL, new NumericValue(2, INT), EQ); - assertFalse(expression.evaluate(NoopResolver.INSTANCE)); + assertFalse(expression.evaluate(createEvalContext(NoopResolver.INSTANCE))); } @Test void evaluateSecondNull() { ComparisonExpression expression = new ComparisonExpression(new NumericValue(1, INT), ValueExpression.NULL, EQ); - assertFalse(expression.evaluate(NoopResolver.INSTANCE)); + assertFalse(expression.evaluate(createEvalContext(NoopResolver.INSTANCE))); } @Test void evaluateBothNull() { ComparisonExpression expression = new ComparisonExpression(ValueExpression.NULL, ValueExpression.NULL, EQ); - assertTrue(expression.evaluate(NoopResolver.INSTANCE)); + assertTrue(expression.evaluate(createEvalContext(NoopResolver.INSTANCE))); } @Test @@ -309,7 +311,9 @@ void invalidInstanceofOperand() { ComparisonExpression expression = new ComparisonExpression(new StringValue("foo"), new NumericValue(1, INT), INSTANCEOF); EvaluationException evaluationException = - assertThrows(EvaluationException.class, () -> expression.evaluate(NoopResolver.INSTANCE)); + assertThrows( + EvaluationException.class, + () -> expression.evaluate(createEvalContext(NoopResolver.INSTANCE))); assertEquals( "Right operand of instanceof operator must be a string literal", evaluationException.getMessage()); @@ -321,7 +325,9 @@ void invalidInstanceofClassName() { ComparisonExpression expression = new ComparisonExpression(new StringValue("foo"), new StringValue("String"), INSTANCEOF); EvaluationException evaluationException = - assertThrows(EvaluationException.class, () -> expression.evaluate(NoopResolver.INSTANCE)); + assertThrows( + EvaluationException.class, + () -> expression.evaluate(createEvalContext(NoopResolver.INSTANCE))); assertEquals("Class not found: String", evaluationException.getMessage()); assertEquals("\"foo\" instanceof \"String\"", evaluationException.getExpr()); } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/ContainsExpressionTest.java b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/ContainsExpressionTest.java index 88b08a94c3f..60cd3d9f5c6 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/ContainsExpressionTest.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/ContainsExpressionTest.java @@ -1,27 +1,46 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.EvalContextHelper.createEvalContext; import static com.datadog.debugger.el.PrettyPrintVisitor.print; import static org.junit.jupiter.api.Assertions.*; import com.datadog.debugger.el.DSL; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; -import com.datadog.debugger.el.RefResolverHelper; import com.datadog.debugger.el.values.StringValue; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; import datadog.trace.bootstrap.debugger.el.Values; +import java.time.Duration; +import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; +import java.util.concurrent.locks.LockSupport; import org.junit.jupiter.api.Test; class ContainsExpressionTest { - private final ValueReferenceResolver resolver = RefResolverHelper.createResolver(this); + private final EvalContext evalContext = createEvalContext(this); private List list = Arrays.asList("foo", "bar", "baz"); private List listWithNull = Arrays.asList("foo", null, "baz"); + private List largeList = new ArrayList<>(); + + { + for (int i = 0; i < 1_000_001; i++) { + largeList.add(i); + } + } + + private List slowList = new ArrayList<>(); + + { + for (int i = 0; i < 10_000; i++) { + slowList.add(String.valueOf(i)); + } + } + private String[] arrayStr = new String[] {"foo", "bar", "baz"}; private String[] arrayStrWithNull = new String[] {"foo", null, "bar"}; private int[] arrayInt = new int[] {1, 2, 3}; @@ -60,7 +79,7 @@ class ContainsExpressionTest { void nullExpression() { ContainsExpression expression = new ContainsExpression(null, null); EvaluationException exception = - assertThrows(EvaluationException.class, () -> expression.evaluate(resolver)); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("contains(null, null)", print(expression)); } @@ -70,7 +89,7 @@ void undefinedExpression() { ContainsExpression expression = new ContainsExpression(DSL.value(Values.UNDEFINED_OBJECT), new StringValue(null)); EvaluationException exception = - assertThrows(EvaluationException.class, () -> expression.evaluate(resolver)); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for undefined value", exception.getMessage()); assertEquals("contains(UNDEFINED, \"null\")", print(expression)); } @@ -79,16 +98,16 @@ void undefinedExpression() { void stringExpression() { ContainsExpression expression = new ContainsExpression(DSL.value("abcd"), new StringValue("bc")); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("contains(\"abcd\", \"bc\")", print(expression)); expression = new ContainsExpression(DSL.value("abc"), new StringValue("dc")); - assertFalse(expression.evaluate(resolver)); + assertFalse(expression.evaluate(evalContext)); assertEquals("contains(\"abc\", \"dc\")", print(expression)); ContainsExpression nullValExpression = new ContainsExpression(DSL.value("abcd"), null); EvaluationException exception = - assertThrows(EvaluationException.class, () -> nullValExpression.evaluate(resolver)); + assertThrows(EvaluationException.class, () -> nullValExpression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for non-string value", exception.getMessage()); assertEquals("contains(\"abcd\", null)", print(nullValExpression)); } @@ -96,43 +115,55 @@ void stringExpression() { @Test void listExpression() { ContainsExpression expression = new ContainsExpression(DSL.ref("list"), DSL.value("bar")); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("contains(list, \"bar\")", print(expression)); expression = new ContainsExpression(DSL.ref("listWithNull"), null); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("contains(listWithNull, null)", print(expression)); + + ContainsExpression largeExpression = new ContainsExpression(DSL.ref("largeList"), DSL.value(1)); + EvaluationException evaluationException = + assertThrows(EvaluationException.class, () -> largeExpression.evaluate(evalContext)); + assertEquals("Collection too large (>1000000)", evaluationException.getMessage()); + + ContainsExpression slowListExpression = + new ContainsExpression(DSL.ref("slowList"), DSL.value(new SlowObject())); + assertThrows( + EvaluationException.class, + () -> slowListExpression.evaluate(createEvalContext(this, Duration.ofMillis(1)))); } @Test void arrayExpression() { ContainsExpression expression = new ContainsExpression(DSL.ref("arrayStr"), DSL.value("bar")); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("contains(arrayStr, \"bar\")", print(expression)); expression = new ContainsExpression(DSL.ref("arrayInt"), DSL.value(2)); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("contains(arrayInt, 2)", print(expression)); expression = new ContainsExpression(DSL.ref("arrayChar"), DSL.value("b")); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("contains(arrayChar, \"b\")", print(expression)); expression = new ContainsExpression(DSL.ref("arrayLong"), DSL.value(2)); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("contains(arrayLong, 2)", print(expression)); expression = new ContainsExpression(DSL.ref("arrayDouble"), DSL.value(2.0)); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("contains(arrayDouble, 2.0)", print(expression)); expression = new ContainsExpression(DSL.ref("arrayStrWithNull"), null); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("contains(arrayStrWithNull, null)", print(expression)); ContainsExpression primitiveNullExpression = new ContainsExpression(DSL.ref("arrayInt"), null); EvaluationException exception = - assertThrows(EvaluationException.class, () -> primitiveNullExpression.evaluate(resolver)); + assertThrows( + EvaluationException.class, () -> primitiveNullExpression.evaluate(evalContext)); assertEquals("Cannot compare null with primitive array", exception.getMessage()); assertEquals("contains(arrayInt, null)", print(primitiveNullExpression)); } @@ -140,22 +171,30 @@ void arrayExpression() { @Test void mapExpression() { ContainsExpression expression = new ContainsExpression(DSL.ref("mapStr"), DSL.value("bar")); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("contains(mapStr, \"bar\")", print(expression)); expression = new ContainsExpression(DSL.ref("mapStrWithNull"), null); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("contains(mapStrWithNull, null)", print(expression)); } @Test void setExpression() { ContainsExpression expression = new ContainsExpression(DSL.ref("setStr"), DSL.value("bar")); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("contains(setStr, \"bar\")", print(expression)); expression = new ContainsExpression(DSL.ref("setStrWithNull"), null); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("contains(setStrWithNull, null)", print(expression)); } + + static class SlowObject { + @Override + public boolean equals(Object obj) { + LockSupport.parkNanos(1000); + return super.equals(obj); + } + } } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/EndsWithExpressionTest.java b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/EndsWithExpressionTest.java index 17a6b1c07f1..1ac730564a7 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/EndsWithExpressionTest.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/EndsWithExpressionTest.java @@ -1,5 +1,6 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.EvalContextHelper.createEvalContext; import static com.datadog.debugger.el.PrettyPrintVisitor.print; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; @@ -7,16 +8,15 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import com.datadog.debugger.el.DSL; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; -import com.datadog.debugger.el.RefResolverHelper; import com.datadog.debugger.el.values.StringValue; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; import datadog.trace.bootstrap.debugger.el.Values; import java.net.URI; import org.junit.jupiter.api.Test; class EndsWithExpressionTest { - private final ValueReferenceResolver resolver = RefResolverHelper.createResolver(this); + private final EvalContext evalContext = createEvalContext(this); // used to ref lookup URI uri = URI.create("https://www.datadoghq.com"); @@ -24,7 +24,7 @@ class EndsWithExpressionTest { void nullExpression() { EndsWithExpression expression = new EndsWithExpression(null, null); EvaluationException exception = - assertThrows(EvaluationException.class, () -> expression.evaluate(resolver)); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("endsWith(null, null)", print(expression)); } @@ -34,7 +34,7 @@ void undefinedExpression() { EndsWithExpression expression = new EndsWithExpression(DSL.value(Values.UNDEFINED_OBJECT), new StringValue(null)); EvaluationException exception = - assertThrows(EvaluationException.class, () -> expression.evaluate(resolver)); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for undefined value", exception.getMessage()); assertEquals("endsWith(UNDEFINED, \"null\")", print(expression)); } @@ -42,18 +42,18 @@ void undefinedExpression() { @Test void stringExpression() { EndsWithExpression expression = new EndsWithExpression(DSL.value("abc"), new StringValue("bc")); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("endsWith(\"abc\", \"bc\")", print(expression)); expression = new EndsWithExpression(DSL.value("abc"), new StringValue("ab")); - assertFalse(expression.evaluate(resolver)); + assertFalse(expression.evaluate(evalContext)); assertEquals("endsWith(\"abc\", \"ab\")", print(expression)); } @Test void stringPrimitives() { EndsWithExpression expression = new EndsWithExpression(DSL.ref("uri"), new StringValue(".com")); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("endsWith(uri, \".com\")", print(expression)); } } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/FilterCollectionExpressionTest.java b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/FilterCollectionExpressionTest.java index 38b0ea7e692..6d2e80cebda 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/FilterCollectionExpressionTest.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/FilterCollectionExpressionTest.java @@ -1,32 +1,40 @@ package com.datadog.debugger.el.expressions; import static com.datadog.debugger.el.DSL.*; +import static com.datadog.debugger.el.EvalContextHelper.createEvalContext; import static com.datadog.debugger.el.PrettyPrintVisitor.print; import static org.junit.jupiter.api.Assertions.*; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; -import com.datadog.debugger.el.RefResolverHelper; import com.datadog.debugger.el.values.CollectionValue; import com.datadog.debugger.el.values.ListValue; import com.datadog.debugger.el.values.MapValue; import com.datadog.debugger.el.values.SetValue; import datadog.trace.bootstrap.debugger.el.ValueReferences; import datadog.trace.bootstrap.debugger.el.Values; +import java.time.Duration; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; +import java.util.Set; import org.junit.jupiter.api.Test; class FilterCollectionExpressionTest { + + private final EvalContext evalContext = createEvalContext(this); + @Test void testMatchingList() { ListValue collection = new ListValue(new int[] {1, 2, 3}); FilterCollectionExpression expression = new FilterCollectionExpression(collection, lt(ref(ValueReferences.ITERATOR_REF), value(2))); - CollectionValue filtered = expression.evaluate(RefResolverHelper.createResolver(this)); + CollectionValue filtered = expression.evaluate(evalContext); assertNotEquals(collection, filtered); assertEquals(1, filtered.count()); assertFalse(filtered.isEmpty()); @@ -40,7 +48,7 @@ void testEmptyList() { ListValue collection = new ListValue(new int[0]); FilterCollectionExpression expression = new FilterCollectionExpression(collection, lt(ref(ValueReferences.ITERATOR_REF), value(2))); - CollectionValue filtered = expression.evaluate(RefResolverHelper.createResolver(this)); + CollectionValue filtered = expression.evaluate(evalContext); assertNotEquals(collection, filtered); assertTrue(filtered.isEmpty()); assertFalse(filtered.isNull()); @@ -54,9 +62,7 @@ void testNullList() { FilterCollectionExpression expression = new FilterCollectionExpression(collection, lt(ref(ValueReferences.ITERATOR_REF), value(2))); EvaluationException exception = - assertThrows( - EvaluationException.class, - () -> expression.evaluate(RefResolverHelper.createResolver(this))); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("filter(null, {@it < 2})", print(expression)); } @@ -67,9 +73,7 @@ void testNullObjectList() { FilterCollectionExpression expression = new FilterCollectionExpression(collection, lt(ref(ValueReferences.ITERATOR_REF), value(2))); EvaluationException exception = - assertThrows( - EvaluationException.class, - () -> expression.evaluate(RefResolverHelper.createResolver(this))); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("filter(null, {@it < 2})", print(expression)); } @@ -80,13 +84,27 @@ void testUndefinedList() { FilterCollectionExpression expression = new FilterCollectionExpression(collection, lt(ref(ValueReferences.ITERATOR_REF), value(2))); EvaluationException exception = - assertThrows( - EvaluationException.class, - () -> expression.evaluate(RefResolverHelper.createResolver(this))); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for undefined value", exception.getMessage()); assertEquals("filter(null, {@it < 2})", print(expression)); } + @Test + void testLargeList() { + List largeList = new ArrayList<>(); + for (int i = 0; i < 1_000_000; i++) { + largeList.add(i); + } + ListValue collection = new ListValue(largeList); + FilterCollectionExpression expression = + new FilterCollectionExpression(collection, lt(ref(ValueReferences.ITERATOR_REF), value(0))); + EvalContext timeoutEvalContext = createEvalContext(this, Duration.ofMillis(1)); + EvaluationException exception = + assertThrows(EvaluationException.class, () -> expression.evaluate(timeoutEvalContext)); + assertEquals("timeout (1ms)", exception.getMessage()); + assertEquals("filter(List, {@it < 0})", print(expression)); + } + @Test void testMatchingMap() { Map map = new HashMap<>(); @@ -98,7 +116,7 @@ void testMatchingMap() { FilterCollectionExpression expression = new FilterCollectionExpression( collection, eq(getMember(ref(ValueReferences.ITERATOR_REF), "key"), value("b"))); - CollectionValue filtered = expression.evaluate(RefResolverHelper.createResolver(this)); + CollectionValue filtered = expression.evaluate(evalContext); assertNotEquals(collection, filtered); assertEquals(1, filtered.count()); assertFalse(filtered.isEmpty()); @@ -108,7 +126,7 @@ void testMatchingMap() { expression = new FilterCollectionExpression( collection, lt(getMember(ref(ValueReferences.ITERATOR_REF), "value"), value(2))); - filtered = expression.evaluate(RefResolverHelper.createResolver(this)); + filtered = expression.evaluate(evalContext); assertNotEquals(collection, filtered); assertEquals(1, filtered.count()); assertFalse(filtered.isEmpty()); @@ -122,7 +140,7 @@ void testEmptyMap() { MapValue collection = new MapValue(Collections.emptyMap()); FilterCollectionExpression expression = new FilterCollectionExpression(collection, lt(ref(ValueReferences.ITERATOR_REF), value(2))); - CollectionValue filtered = expression.evaluate(RefResolverHelper.createResolver(this)); + CollectionValue filtered = expression.evaluate(evalContext); assertNotEquals(collection, filtered); assertTrue(filtered.isEmpty()); assertFalse(filtered.isNull()); @@ -136,9 +154,7 @@ void testNullMap() { FilterCollectionExpression expression = new FilterCollectionExpression(collection, lt(ref(ValueReferences.ITERATOR_REF), value(2))); EvaluationException exception = - assertThrows( - EvaluationException.class, - () -> expression.evaluate(RefResolverHelper.createResolver(this))); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("filter(null, {@it < 2})", print(expression)); } @@ -149,9 +165,7 @@ void testNullObjectMap() { FilterCollectionExpression expression = new FilterCollectionExpression(collection, lt(ref(ValueReferences.ITERATOR_REF), value(2))); EvaluationException exception = - assertThrows( - EvaluationException.class, - () -> expression.evaluate(RefResolverHelper.createResolver(this))); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("filter(null, {@it < 2})", print(expression)); } @@ -162,9 +176,7 @@ void testUndefinedMap() { FilterCollectionExpression expression = new FilterCollectionExpression(collection, lt(ref(ValueReferences.ITERATOR_REF), value(2))); EvaluationException exception = - assertThrows( - EvaluationException.class, - () -> expression.evaluate(RefResolverHelper.createResolver(this))); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for undefined value", exception.getMessage()); assertEquals("filter(null, {@it < 2})", print(expression)); } @@ -179,25 +191,42 @@ void keyValueMap() { FilterCollectionExpression expression = new FilterCollectionExpression(collection, eq(ref(ValueReferences.KEY_REF), value("b"))); - CollectionValue filtered = expression.evaluate(RefResolverHelper.createResolver(this)); + CollectionValue filtered = expression.evaluate(evalContext); assertNotEquals(collection, filtered); assertEquals(1, filtered.count()); assertEquals("filter(Map, {@key == \"b\"})", print(expression)); expression = new FilterCollectionExpression(collection, eq(ref(ValueReferences.VALUE_REF), value(2))); - filtered = expression.evaluate(RefResolverHelper.createResolver(this)); + filtered = expression.evaluate(evalContext); assertNotEquals(collection, filtered); assertEquals(1, filtered.count()); assertEquals("filter(Map, {@value == 2})", print(expression)); } + @Test + void testLargeMap() { + Map map = new HashMap<>(); + for (int i = 0; i <= 1_000_000; i++) { + map.put(i, i); + } + MapValue collection = new MapValue(map); + + FilterCollectionExpression expression = + new FilterCollectionExpression(collection, lt(ref(ValueReferences.ITERATOR_REF), value(0))); + EvalContext timeoutEvalContext = createEvalContext(this, Duration.ofMillis(1)); + EvaluationException exception = + assertThrows(EvaluationException.class, () -> expression.evaluate(timeoutEvalContext)); + assertEquals("timeout (1ms)", exception.getMessage()); + assertEquals("filter(Map, {@it < 0})", print(expression)); + } + @Test void testMatchingSet() { SetValue collection = new SetValue(new HashSet<>(Arrays.asList(1, 2, 3))); FilterCollectionExpression expression = new FilterCollectionExpression(collection, lt(ref(ValueReferences.ITERATOR_REF), value(2))); - CollectionValue filtered = expression.evaluate(RefResolverHelper.createResolver(this)); + CollectionValue filtered = expression.evaluate(evalContext); assertNotEquals(collection, filtered); assertEquals(1, filtered.count()); assertFalse(filtered.isEmpty()); @@ -211,7 +240,7 @@ void testEmptySet() { SetValue collection = new SetValue(new HashSet<>()); FilterCollectionExpression expression = new FilterCollectionExpression(collection, lt(ref(ValueReferences.ITERATOR_REF), value(2))); - CollectionValue filtered = expression.evaluate(RefResolverHelper.createResolver(this)); + CollectionValue filtered = expression.evaluate(evalContext); assertNotEquals(collection, filtered); assertTrue(filtered.isEmpty()); assertFalse(filtered.isNull()); @@ -225,9 +254,7 @@ void testNullSet() { FilterCollectionExpression expression = new FilterCollectionExpression(collection, lt(ref(ValueReferences.ITERATOR_REF), value(2))); EvaluationException exception = - assertThrows( - EvaluationException.class, - () -> expression.evaluate(RefResolverHelper.createResolver(this))); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("filter(null, {@it < 2})", print(expression)); } @@ -238,9 +265,7 @@ void testNullObjectSet() { FilterCollectionExpression expression = new FilterCollectionExpression(collection, lt(ref(ValueReferences.ITERATOR_REF), value(2))); EvaluationException exception = - assertThrows( - EvaluationException.class, - () -> expression.evaluate(RefResolverHelper.createResolver(this))); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("filter(null, {@it < 2})", print(expression)); } @@ -251,13 +276,28 @@ void testUndefinedSet() { FilterCollectionExpression expression = new FilterCollectionExpression(collection, lt(ref(ValueReferences.ITERATOR_REF), value(2))); EvaluationException exception = - assertThrows( - EvaluationException.class, - () -> expression.evaluate(RefResolverHelper.createResolver(this))); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for undefined value", exception.getMessage()); assertEquals("filter(null, {@it < 2})", print(expression)); } + @Test + void testLargeSet() { + Set set = new HashSet<>(); + for (int i = 0; i <= 1_000_000; i++) { + set.add(i); + } + SetValue collection = new SetValue(set); + + FilterCollectionExpression expression = + new FilterCollectionExpression(collection, lt(ref(ValueReferences.ITERATOR_REF), value(0))); + EvalContext timeoutEvalContext = createEvalContext(this, Duration.ofMillis(1)); + EvaluationException exception = + assertThrows(EvaluationException.class, () -> expression.evaluate(timeoutEvalContext)); + assertEquals("timeout (1ms)", exception.getMessage()); + assertEquals("filter(Set, {@it < 0})", print(expression)); + } + @Test void testUnsupportedList() { ListValue collection = new ListValue(new CustomList()); @@ -265,9 +305,7 @@ void testUnsupportedList() { new FilterCollectionExpression( collection, eq(ref(ValueReferences.ITERATOR_REF), value("foo"))); EvaluationException exception = - assertThrows( - EvaluationException.class, - () -> expression.evaluate(RefResolverHelper.createResolver(this))); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals( "Unsupported List class: com.datadog.debugger.el.expressions.FilterCollectionExpressionTest$CustomList", exception.getMessage()); @@ -280,9 +318,7 @@ void testUnsupportedMap() { FilterCollectionExpression expression = new FilterCollectionExpression(collection, eq(ref(ValueReferences.VALUE_REF), value(2))); EvaluationException exception = - assertThrows( - EvaluationException.class, - () -> expression.evaluate(RefResolverHelper.createResolver(this))); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals( "Unsupported Map class: com.datadog.debugger.el.expressions.FilterCollectionExpressionTest$CustomMap", exception.getMessage()); @@ -296,9 +332,7 @@ void testUnsupportedSet() { new FilterCollectionExpression( collection, eq(ref(ValueReferences.ITERATOR_REF), value("foo"))); EvaluationException exception = - assertThrows( - EvaluationException.class, - () -> expression.evaluate(RefResolverHelper.createResolver(this))); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals( "Unsupported Set class: com.datadog.debugger.el.expressions.FilterCollectionExpressionTest$CustomSet", exception.getMessage()); diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/GetMemberExpressionTest.java b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/GetMemberExpressionTest.java index 088c6b7bae4..6d2263b67da 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/GetMemberExpressionTest.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/GetMemberExpressionTest.java @@ -1,5 +1,6 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.EvalContextHelper.createEvalContext; import static com.datadog.debugger.el.PrettyPrintVisitor.print; import static com.datadog.debugger.el.TestHelper.setFieldInConfig; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -8,7 +9,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import com.datadog.debugger.el.RedactedException; -import com.datadog.debugger.el.RefResolverHelper; import com.datadog.debugger.el.Value; import datadog.trace.api.Config; import datadog.trace.bootstrap.debugger.util.Redaction; @@ -16,13 +16,12 @@ import org.junit.jupiter.api.Test; class GetMemberExpressionTest { - @Test void getMemberLevel1() { GetMemberExpression expr = new GetMemberExpression(new ValueRefExpression("ref"), "b"); ObjectWithRefAndValue parent = new ObjectWithRefAndValue(null, "hello"); ExObjectWithRefAndValue instance = new ExObjectWithRefAndValue(parent, "world"); - Value val = expr.evaluate(RefResolverHelper.createResolver(instance)); + Value val = expr.evaluate(createEvalContext(instance)); assertNotNull(val); assertFalse(val.isUndefined()); assertEquals(parent.getB(), val.getValue()); @@ -37,7 +36,7 @@ void getMemberLevel2() { ObjectWithRefAndValue root = new ObjectWithRefAndValue(null, "hello"); ObjectWithRefAndValue parent = new ObjectWithRefAndValue(root, ""); ExObjectWithRefAndValue instance = new ExObjectWithRefAndValue(parent, "world"); - Value val = expr.evaluate(RefResolverHelper.createResolver(instance)); + Value val = expr.evaluate(createEvalContext(instance)); assertNotNull(val); assertFalse(val.isUndefined()); assertEquals(root.getB(), val.getValue()); @@ -47,7 +46,7 @@ void getMemberLevel2() { @Test void getMemberUndefined() { GetMemberExpression expr = new GetMemberExpression(ValueExpression.UNDEFINED, "size"); - assertEquals(Value.undefined(), expr.evaluate(RefResolverHelper.createResolver(this))); + assertEquals(Value.undefined(), expr.evaluate(createEvalContext(this))); } class StoreSecret { @@ -73,9 +72,7 @@ void redacted() { GetMemberExpression expr = new GetMemberExpression(new ValueRefExpression("store"), "password"); Holder instance = new Holder(new StoreSecret("secret123")); RedactedException redactedException = - assertThrows( - RedactedException.class, - () -> expr.evaluate(RefResolverHelper.createResolver(instance))); + assertThrows(RedactedException.class, () -> expr.evaluate(createEvalContext(instance))); assertEquals( "Could not evaluate the expression because 'store.password' was redacted", redactedException.getMessage()); @@ -93,9 +90,7 @@ void redactedType() { GetMemberExpression expr = new GetMemberExpression(new ValueRefExpression("store"), "str"); Holder instance = new Holder(new StoreSecret("secret123")); RedactedException redactedException = - assertThrows( - RedactedException.class, - () -> expr.evaluate(RefResolverHelper.createResolver(instance))); + assertThrows(RedactedException.class, () -> expr.evaluate(createEvalContext(instance))); assertEquals( "Could not evaluate the expression because 'store' was redacted", redactedException.getMessage()); @@ -115,13 +110,13 @@ class Holder { } GetMemberExpression expr = new GetMemberExpression(new ValueRefExpression("strPrimitive"), "uuid"); - Value val = expr.evaluate(RefResolverHelper.createResolver(new Holder())); + Value val = expr.evaluate(createEvalContext(new Holder())); assertNotNull(val); assertFalse(val.isUndefined()); assertEquals("123e4567-e89b-12d3-a456-426655440000", val.getValue()); assertEquals("strPrimitive.uuid", print(expr)); expr = new GetMemberExpression(new ValueRefExpression("strPrimitive"), "clazz"); - val = expr.evaluate(RefResolverHelper.createResolver(new Holder())); + val = expr.evaluate(createEvalContext(new Holder())); assertNotNull(val); assertFalse(val.isUndefined()); assertEquals("java.lang.String", val.getValue()); diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/HasAllExpressionTest.java b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/HasAllExpressionTest.java index 3b4f69ef0b8..0566d3537aa 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/HasAllExpressionTest.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/HasAllExpressionTest.java @@ -1,24 +1,27 @@ package com.datadog.debugger.el.expressions; import static com.datadog.debugger.el.DSL.*; +import static com.datadog.debugger.el.EvalContextHelper.createEvalContext; import static com.datadog.debugger.el.PrettyPrintVisitor.print; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; -import com.datadog.debugger.el.RefResolverHelper; import com.datadog.debugger.el.values.ListValue; import com.datadog.debugger.el.values.MapValue; import com.datadog.debugger.el.values.SetValue; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; import datadog.trace.bootstrap.debugger.el.ValueReferences; import datadog.trace.bootstrap.debugger.el.Values; +import java.time.Duration; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; import java.util.Set; import org.junit.jupiter.api.Test; @@ -26,83 +29,83 @@ class HasAllExpressionTest { private final int testField = 10; + EvalContext evalContext = createEvalContext(this); + @Test void testNullPredicate() { - ValueReferenceResolver resolver = RefResolverHelper.createResolver(this); HasAllExpression nullExpression = new HasAllExpression(null, null); EvaluationException exception = - assertThrows(EvaluationException.class, () -> nullExpression.evaluate(resolver)); + assertThrows(EvaluationException.class, () -> nullExpression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("all(null, {true})", print(nullExpression)); HasAllExpression undefinedExpression = new HasAllExpression(value(Values.UNDEFINED_OBJECT), null); exception = - assertThrows(EvaluationException.class, () -> undefinedExpression.evaluate(resolver)); + assertThrows(EvaluationException.class, () -> undefinedExpression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for undefined value", exception.getMessage()); assertEquals("all(UNDEFINED, {true})", print(undefinedExpression)); HasAllExpression expression = new HasAllExpression(value(new Object[] {this}), null); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("all(java.lang.Object[], {true})", print(expression)); expression = new HasAllExpression(value(Collections.singletonList(this)), null); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("all(List, {true})", print(expression)); expression = new HasAllExpression(value(Collections.singletonMap(this, this)), null); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("all(Map, {true})", print(expression)); } @Test void testNullHasAll() { - ValueReferenceResolver ctx = RefResolverHelper.createResolver(this); HasAllExpression nullExpression1 = all(null, TRUE); EvaluationException exception = - assertThrows(EvaluationException.class, () -> nullExpression1.evaluate(ctx)); + assertThrows(EvaluationException.class, () -> nullExpression1.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("all(null, {true})", print(nullExpression1)); HasAllExpression nullExpression2 = all(null, FALSE); - exception = assertThrows(EvaluationException.class, () -> nullExpression2.evaluate(ctx)); + exception = + assertThrows(EvaluationException.class, () -> nullExpression2.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("all(null, {false})", print(nullExpression2)); HasAllExpression nullExpression3 = all(null, eq(ref("testField"), value(10))); - exception = assertThrows(EvaluationException.class, () -> nullExpression3.evaluate(ctx)); + exception = + assertThrows(EvaluationException.class, () -> nullExpression3.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("all(null, {testField == 10})", print(nullExpression3)); } @Test void testUndefinedHasAll() { - ValueReferenceResolver ctx = RefResolverHelper.createResolver(this); HasAllExpression undefinedExpression = all(value(Values.UNDEFINED_OBJECT), TRUE); EvaluationException exception = - assertThrows(EvaluationException.class, () -> undefinedExpression.evaluate(ctx)); + assertThrows(EvaluationException.class, () -> undefinedExpression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for undefined value", exception.getMessage()); assertEquals("all(UNDEFINED, {true})", print(undefinedExpression)); HasAllExpression nullExpression = all(null, FALSE); - exception = assertThrows(EvaluationException.class, () -> nullExpression.evaluate(ctx)); + exception = assertThrows(EvaluationException.class, () -> nullExpression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("all(null, {false})", print(nullExpression)); HasAllExpression expression = all(value(Values.UNDEFINED_OBJECT), eq(ref("testField"), value(10))); - exception = assertThrows(EvaluationException.class, () -> expression.evaluate(ctx)); + exception = assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for undefined value", exception.getMessage()); assertEquals("all(UNDEFINED, {testField == 10})", print(expression)); } @Test void testArrayHasAll() { - ValueReferenceResolver ctx = RefResolverHelper.createResolver(this); ValueExpression targetExpression = value(new Object[] {this, "hello"}); HasAllExpression expression = all(targetExpression, TRUE); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); assertEquals("all(java.lang.Object[], {true})", print(expression)); expression = all(targetExpression, FALSE); - assertFalse(expression.evaluate(ctx)); + assertFalse(expression.evaluate(evalContext)); assertEquals("all(java.lang.Object[], {false})", print(expression)); GetMemberExpression fldRef = getMember(ref(ValueReferences.ITERATOR_REF), "testField"); @@ -111,29 +114,28 @@ void testArrayHasAll() { RuntimeException runtimeException = assertThrows( RuntimeException.class, - () -> all(targetExpression, eq(fldRef, value(10))).evaluate(ctx)); + () -> all(targetExpression, eq(fldRef, value(10))).evaluate(evalContext)); assertEquals("Cannot dereference field: testField", runtimeException.getMessage()); expression = all(targetExpression, eq(itRef, value("hello"))); - assertFalse(expression.evaluate(ctx)); + assertFalse(expression.evaluate(evalContext)); assertEquals("all(java.lang.Object[], {@it == \"hello\"})", print(expression)); expression = all(targetExpression, not(isEmpty(itRef))); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); assertEquals("all(java.lang.Object[], {not(isEmpty(@it))})", print(expression)); } @Test void testListHasAll() { - ValueReferenceResolver ctx = RefResolverHelper.createResolver(this); ValueExpression targetExpression = value(Arrays.asList(this, "hello")); HasAllExpression expression = all(targetExpression, TRUE); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); assertEquals("all(List, {true})", print(expression)); expression = all(targetExpression, FALSE); - assertFalse(expression.evaluate(ctx)); + assertFalse(expression.evaluate(evalContext)); assertEquals("all(List, {false})", print(expression)); ValueRefExpression fldRef = ref(ValueReferences.ITERATOR_REF + "testField"); @@ -142,21 +144,36 @@ void testListHasAll() { RuntimeException runtimeException = assertThrows( RuntimeException.class, - () -> all(targetExpression, eq(fldRef, value(10))).evaluate(ctx)); + () -> all(targetExpression, eq(fldRef, value(10))).evaluate(evalContext)); assertEquals("Cannot find synthetic var: ittestField", runtimeException.getMessage()); expression = all(targetExpression, eq(itRef, value("hello"))); - assertFalse(expression.evaluate(ctx)); + assertFalse(expression.evaluate(evalContext)); assertEquals("all(List, {@it == \"hello\"})", print(expression)); expression = all(targetExpression, not(isEmpty(itRef))); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); assertEquals("all(List, {not(isEmpty(@it))})", print(expression)); } + @Test + void testLargeListHasAll() { + List largeList = new ArrayList<>(); + for (int i = 0; i < 1_000_000; i++) { + largeList.add(i); + } + ValueExpression targetExpression = value(largeList); + + HasAllExpression expression = all(targetExpression, TRUE); + EvalContext timeoutEvalContext = createEvalContext(this, Duration.ofMillis(1)); + EvaluationException evaluationException = + assertThrows(EvaluationException.class, () -> expression.evaluate(timeoutEvalContext)); + assertEquals("timeout (1ms)", evaluationException.getMessage()); + assertEquals("all(List, {true})", print(expression)); + } + @Test void testMapHasAll() { - ValueReferenceResolver ctx = RefResolverHelper.createResolver(null, null); Map valueMap = new HashMap<>(); valueMap.put("a", "a"); valueMap.put("b", "a"); @@ -164,29 +181,44 @@ void testMapHasAll() { ValueExpression targetExpression = value(valueMap); HasAllExpression expression = all(targetExpression, TRUE); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); assertEquals("all(Map, {true})", print(expression)); expression = all(targetExpression, FALSE); - assertFalse(expression.evaluate(ctx)); + assertFalse(expression.evaluate(evalContext)); assertEquals("all(Map, {false})", print(expression)); expression = all(targetExpression, eq(getMember(ref(ValueReferences.ITERATOR_REF), "key"), value("a"))); - assertFalse(expression.evaluate(ctx)); + assertFalse(expression.evaluate(evalContext)); assertEquals("all(Map, {@it.key == \"a\"})", print(expression)); expression = all( targetExpression, eq(getMember(ref(ValueReferences.ITERATOR_REF), "value"), value("a"))); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); assertEquals("all(Map, {@it.value == \"a\"})", print(expression)); } + @Test + void testLargeMapHasAll() { + Map largeMap = new HashMap<>(); + for (int i = 0; i < 1_000_000; i++) { + largeMap.put(i, i); + } + ValueExpression targetExpression = value(largeMap); + + HasAllExpression expression = all(targetExpression, TRUE); + EvalContext timeoutEvalContext = createEvalContext(this, Duration.ofMillis(1)); + EvaluationException evaluationException = + assertThrows(EvaluationException.class, () -> expression.evaluate(timeoutEvalContext)); + assertEquals("timeout (1ms)", evaluationException.getMessage()); + assertEquals("all(Map, {true})", print(expression)); + } + @Test void testSetHasAll() { - ValueReferenceResolver ctx = RefResolverHelper.createResolver(null, null); Set valueSet = new HashSet<>(); valueSet.add("foo"); valueSet.add("bar"); @@ -194,15 +226,15 @@ void testSetHasAll() { ValueExpression targetExpression = value(valueSet); HasAllExpression expression = all(targetExpression, TRUE); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); assertEquals("all(Set, {true})", print(expression)); expression = all(targetExpression, FALSE); - assertFalse(expression.evaluate(ctx)); + assertFalse(expression.evaluate(evalContext)); assertEquals("all(Set, {false})", print(expression)); expression = all(targetExpression, eq(ref(ValueReferences.ITERATOR_REF), value("key"))); - assertFalse(expression.evaluate(ctx)); + assertFalse(expression.evaluate(evalContext)); assertEquals("all(Set, {@it == \"key\"})", print(expression)); expression = @@ -211,48 +243,61 @@ void testSetHasAll() { or( eq(ref(ValueReferences.ITERATOR_REF), value("foo")), eq(ref(ValueReferences.ITERATOR_REF), value("bar")))); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); assertEquals("all(Set, {@it == \"foo\" || @it == \"bar\"})", print(expression)); } + @Test + void testLargeSetHasAll() { + Set largeSet = new HashSet<>(); + for (int i = 0; i < 1_000_000; i++) { + largeSet.add(i); + } + ValueExpression targetExpression = value(largeSet); + + HasAllExpression expression = all(targetExpression, TRUE); + EvalContext timeoutEvalContext = createEvalContext(this, Duration.ofMillis(1)); + EvaluationException evaluationException = + assertThrows(EvaluationException.class, () -> expression.evaluate(timeoutEvalContext)); + assertEquals("timeout (1ms)", evaluationException.getMessage()); + assertEquals("all(Set, {true})", print(expression)); + } + @Test void emptiness() { - ValueReferenceResolver ctx = RefResolverHelper.createResolver(null, null); HasAllExpression expression = all(value(new String[] {}), TRUE); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); expression = all(value(Collections.emptyList()), TRUE); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); expression = all(value(Collections.emptyMap()), TRUE); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); expression = all(value(Collections.emptySet()), TRUE); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); } @Test void keyValueMap() { - ValueReferenceResolver ctx = RefResolverHelper.createResolver(null, null); Map valueMap = new HashMap<>(); valueMap.put("a", "a"); valueMap.put("b", "a"); ValueExpression targetExpression = value(valueMap); HasAllExpression expression = all(targetExpression, eq(ref(ValueReferences.KEY_REF), value("a"))); - assertFalse(expression.evaluate(ctx)); + assertFalse(expression.evaluate(evalContext)); assertEquals("all(Map, {@key == \"a\"})", print(expression)); expression = all(targetExpression, eq(ref(ValueReferences.VALUE_REF), value("a"))); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); assertEquals("all(Map, {@value == \"a\"})", print(expression)); } @Test void testUnsupportedList() { - ValueReferenceResolver ctx = RefResolverHelper.createResolver(null, null); ListValue collection = new ListValue(new CustomList()); HasAllExpression expression = all(collection, eq(ref(ValueReferences.ITERATOR_REF), value("foo"))); EvaluationException exception = - assertThrows(EvaluationException.class, () -> expression.evaluate(ctx)); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals( "Unsupported List class: com.datadog.debugger.el.expressions.HasAllExpressionTest$CustomList", exception.getMessage()); @@ -261,11 +306,10 @@ void testUnsupportedList() { @Test void testUnsupportedMap() { - ValueReferenceResolver ctx = RefResolverHelper.createResolver(null, null); MapValue collection = new MapValue(new CustomMap()); HasAllExpression expression = all(collection, eq(ref(ValueReferences.VALUE_REF), value("foo"))); EvaluationException exception = - assertThrows(EvaluationException.class, () -> expression.evaluate(ctx)); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals( "Unsupported Map class: com.datadog.debugger.el.expressions.HasAllExpressionTest$CustomMap", exception.getMessage()); @@ -274,12 +318,11 @@ void testUnsupportedMap() { @Test void testUnsupportedSet() { - ValueReferenceResolver ctx = RefResolverHelper.createResolver(null, null); SetValue collection = new SetValue(new CustomSet()); HasAllExpression expression = all(collection, eq(ref(ValueReferences.ITERATOR_REF), value("foo"))); EvaluationException exception = - assertThrows(EvaluationException.class, () -> expression.evaluate(ctx)); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals( "Unsupported Set class: com.datadog.debugger.el.expressions.HasAllExpressionTest$CustomSet", exception.getMessage()); diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/HasAnyExpressionTest.java b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/HasAnyExpressionTest.java index 8a5ca4fa9cf..8d706b7b326 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/HasAnyExpressionTest.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/HasAnyExpressionTest.java @@ -1,255 +1,300 @@ package com.datadog.debugger.el.expressions; import static com.datadog.debugger.el.DSL.*; +import static com.datadog.debugger.el.DSL.value; +import static com.datadog.debugger.el.EvalContextHelper.createEvalContext; import static com.datadog.debugger.el.PrettyPrintVisitor.print; import static org.junit.jupiter.api.Assertions.*; -import com.datadog.debugger.el.DSL; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; -import com.datadog.debugger.el.RefResolverHelper; import com.datadog.debugger.el.values.ListValue; import com.datadog.debugger.el.values.MapValue; import com.datadog.debugger.el.values.SetValue; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; import datadog.trace.bootstrap.debugger.el.ValueReferences; import datadog.trace.bootstrap.debugger.el.Values; +import java.time.Duration; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; +import java.util.List; import java.util.Map; import java.util.Set; import org.junit.jupiter.api.Test; class HasAnyExpressionTest { private final int testField = 10; + EvalContext evalContext = createEvalContext(this); @Test void testNullPredicate() { - ValueReferenceResolver resolver = RefResolverHelper.createResolver(this); HasAnyExpression nullExpression = new HasAnyExpression(null, null); EvaluationException exception = - assertThrows(EvaluationException.class, () -> nullExpression.evaluate(resolver)); + assertThrows(EvaluationException.class, () -> nullExpression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("any(null, {true})", print(nullExpression)); HasAnyExpression undefinedExpression = new HasAnyExpression(value(Values.UNDEFINED_OBJECT), null); exception = - assertThrows(EvaluationException.class, () -> undefinedExpression.evaluate(resolver)); + assertThrows(EvaluationException.class, () -> undefinedExpression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for undefined value", exception.getMessage()); assertEquals("any(UNDEFINED, {true})", print(undefinedExpression)); HasAnyExpression expression = new HasAnyExpression(value(new Object[] {this}), null); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("any(java.lang.Object[], {true})", print(expression)); expression = new HasAnyExpression(value(Collections.singletonList(this)), null); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("any(List, {true})", print(expression)); expression = new HasAnyExpression(value(Collections.singletonMap(this, this)), null); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("any(Map, {true})", print(expression)); } @Test void testNullHasAny() { - ValueReferenceResolver ctx = RefResolverHelper.createResolver(this); HasAnyExpression nullExpression1 = any(null, BooleanExpression.TRUE); EvaluationException exception = - assertThrows(EvaluationException.class, () -> nullExpression1.evaluate(ctx)); + assertThrows(EvaluationException.class, () -> nullExpression1.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("any(null, {true})", print(nullExpression1)); HasAnyExpression nullExpression2 = any(null, BooleanExpression.FALSE); - exception = assertThrows(EvaluationException.class, () -> nullExpression2.evaluate(ctx)); + exception = + assertThrows(EvaluationException.class, () -> nullExpression2.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("any(null, {false})", print(nullExpression2)); HasAnyExpression nullExpression3 = any(null, eq(ref("testField"), value(10))); - exception = assertThrows(EvaluationException.class, () -> nullExpression3.evaluate(ctx)); + exception = + assertThrows(EvaluationException.class, () -> nullExpression3.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("any(null, {testField == 10})", print(nullExpression3)); } @Test void testUndefinedHasAny() { - ValueReferenceResolver ctx = RefResolverHelper.createResolver(this); HasAnyExpression undefinedExpression = any(value(Values.UNDEFINED_OBJECT), TRUE); EvaluationException exception = - assertThrows(EvaluationException.class, () -> undefinedExpression.evaluate(ctx)); + assertThrows(EvaluationException.class, () -> undefinedExpression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for undefined value", exception.getMessage()); assertEquals("any(UNDEFINED, {true})", print(undefinedExpression)); HasAnyExpression nullExpression = any(null, FALSE); - exception = assertThrows(EvaluationException.class, () -> nullExpression.evaluate(ctx)); + exception = assertThrows(EvaluationException.class, () -> nullExpression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("any(null, {false})", print(nullExpression)); HasAnyExpression undefinedExpression2 = any(value(Values.UNDEFINED_OBJECT), eq(ref("testField"), value(10))); - exception = assertThrows(EvaluationException.class, () -> undefinedExpression2.evaluate(ctx)); + exception = + assertThrows(EvaluationException.class, () -> undefinedExpression2.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for undefined value", exception.getMessage()); assertEquals("any(UNDEFINED, {testField == 10})", print(undefinedExpression2)); } @Test void testArrayHasAny() { - ValueReferenceResolver ctx = RefResolverHelper.createResolver(null, null); - ValueExpression targetExpression = DSL.value(new Object[] {this, "hello"}); + ValueExpression targetExpression = value(new Object[] {this, "hello"}); HasAnyExpression expression = any(targetExpression, TRUE); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); assertEquals("any(java.lang.Object[], {true})", print(expression)); expression = any(targetExpression, FALSE); - assertFalse(expression.evaluate(ctx)); + assertFalse(expression.evaluate(evalContext)); assertEquals("any(java.lang.Object[], {false})", print(expression)); expression = any( targetExpression, eq(getMember(ref(ValueReferences.ITERATOR_REF), "testField"), value(10))); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); assertEquals("any(java.lang.Object[], {@it.testField == 10})", print(expression)); expression = any(targetExpression, eq(ref(ValueReferences.ITERATOR_REF), value("hello"))); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); assertEquals("any(java.lang.Object[], {@it == \"hello\"})", print(expression)); } @Test void testListHasAny() { - ValueReferenceResolver ctx = RefResolverHelper.createResolver(null, null); - ValueExpression targetExpression = DSL.value(Arrays.asList(this, "hello")); + ValueExpression targetExpression = value(Arrays.asList(this, "hello")); HasAnyExpression expression = any(targetExpression, TRUE); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); assertEquals("any(List, {true})", print(expression)); expression = any(targetExpression, FALSE); - assertFalse(expression.evaluate(ctx)); + assertFalse(expression.evaluate(evalContext)); assertEquals("any(List, {false})", print(expression)); expression = any( targetExpression, eq(getMember(ref(ValueReferences.ITERATOR_REF), "testField"), value(10))); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); assertEquals("any(List, {@it.testField == 10})", print(expression)); expression = any(targetExpression, eq(ref(ValueReferences.ITERATOR_REF), value("hello"))); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); assertEquals("any(List, {@it == \"hello\"})", print(expression)); } + @Test + void testLargeListHasAny() { + List largeList = new ArrayList<>(); + for (int i = 0; i < 1_000_000; i++) { + largeList.add(i); + } + ValueExpression targetExpression = value(largeList); + + HasAnyExpression expression = any(targetExpression, FALSE); + EvalContext timeoutEvalContext = createEvalContext(this, Duration.ofMillis(1)); + EvaluationException evaluationException = + assertThrows(EvaluationException.class, () -> expression.evaluate(timeoutEvalContext)); + assertEquals("timeout (1ms)", evaluationException.getMessage()); + assertEquals("any(List, {false})", print(expression)); + } + @Test void testMapHasAny() { - ValueReferenceResolver ctx = RefResolverHelper.createResolver(null, null); Map valueMap = new HashMap<>(); valueMap.put("a", "a"); valueMap.put("b", null); - ValueExpression targetExpression = DSL.value(valueMap); + ValueExpression targetExpression = value(valueMap); HasAnyExpression expression = any(targetExpression, TRUE); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); assertEquals("any(Map, {true})", print(expression)); expression = any(targetExpression, FALSE); - assertFalse(expression.evaluate(ctx)); + assertFalse(expression.evaluate(evalContext)); assertEquals("any(Map, {false})", print(expression)); expression = any(targetExpression, eq(getMember(ref(ValueReferences.ITERATOR_REF), "key"), value("b"))); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); assertEquals("any(Map, {@it.key == \"b\"})", print(expression)); expression = any( targetExpression, eq(getMember(ref(ValueReferences.ITERATOR_REF), "value"), value("a"))); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); assertEquals("any(Map, {@it.value == \"a\"})", print(expression)); expression = any(targetExpression, eq(getMember(ref(ValueReferences.ITERATOR_REF), "key"), value("c"))); - assertFalse(expression.evaluate(ctx)); + assertFalse(expression.evaluate(evalContext)); assertEquals("any(Map, {@it.key == \"c\"})", print(expression)); expression = any( targetExpression, eq(getMember(ref(ValueReferences.ITERATOR_REF), "value"), value("c"))); - assertFalse(expression.evaluate(ctx)); + assertFalse(expression.evaluate(evalContext)); assertEquals("any(Map, {@it.value == \"c\"})", print(expression)); } + @Test + void testLargeMapHasAny() { + Map largeMap = new HashMap<>(); + for (int i = 0; i < 1_000_000; i++) { + largeMap.put(i, i); + } + ValueExpression targetExpression = value(largeMap); + + HasAnyExpression expression = any(targetExpression, FALSE); + EvalContext timeoutEvalContext = createEvalContext(this, Duration.ofMillis(1)); + EvaluationException evaluationException = + assertThrows(EvaluationException.class, () -> expression.evaluate(timeoutEvalContext)); + assertEquals("timeout (1ms)", evaluationException.getMessage()); + assertEquals("any(Map, {false})", print(expression)); + } + @Test void testSetHasAny() { - ValueReferenceResolver ctx = RefResolverHelper.createResolver(null, null); Set valueSet = new HashSet<>(); valueSet.add("foo"); valueSet.add("bar"); - ValueExpression targetExpression = DSL.value(valueSet); + ValueExpression targetExpression = value(valueSet); HasAnyExpression expression = any(targetExpression, TRUE); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); assertEquals("any(Set, {true})", print(expression)); - targetExpression = DSL.value(valueSet); + targetExpression = value(valueSet); expression = any(targetExpression, FALSE); - assertFalse(expression.evaluate(ctx)); + assertFalse(expression.evaluate(evalContext)); assertEquals("any(Set, {false})", print(expression)); expression = any(targetExpression, eq(ref(ValueReferences.ITERATOR_REF), value("foo"))); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); assertEquals("any(Set, {@it == \"foo\"})", print(expression)); expression = any(targetExpression, eq(ref(ValueReferences.ITERATOR_REF), value("key"))); - assertFalse(expression.evaluate(ctx)); + assertFalse(expression.evaluate(evalContext)); assertEquals("any(Set, {@it == \"key\"})", print(expression)); } + @Test + void testLargeSetHasAny() { + Set largeSet = new HashSet<>(); + for (int i = 0; i < 1_000_000; i++) { + largeSet.add(i); + } + ValueExpression targetExpression = value(largeSet); + + HasAnyExpression expression = any(targetExpression, FALSE); + EvalContext timeoutEvalContext = createEvalContext(this, Duration.ofMillis(1)); + EvaluationException evaluationException = + assertThrows(EvaluationException.class, () -> expression.evaluate(timeoutEvalContext)); + assertEquals("timeout (1ms)", evaluationException.getMessage()); + assertEquals("any(Set, {false})", print(expression)); + } + @Test void emptiness() { - ValueReferenceResolver ctx = RefResolverHelper.createResolver(null, null); HasAnyExpression expression = any(value(Collections.emptyList()), TRUE); - assertFalse(expression.evaluate(ctx)); + assertFalse(expression.evaluate(evalContext)); assertEquals("any(List, {true})", print(expression)); expression = any(value(Collections.emptyMap()), TRUE); - assertFalse(expression.evaluate(ctx)); + assertFalse(expression.evaluate(evalContext)); assertEquals("any(Map, {true})", print(expression)); expression = any(value(Collections.emptySet()), TRUE); - assertFalse(expression.evaluate(ctx)); + assertFalse(expression.evaluate(evalContext)); assertEquals("any(Set, {true})", print(expression)); } @Test void keyValueMap() { - ValueReferenceResolver ctx = RefResolverHelper.createResolver(null, null); Map valueMap = new HashMap<>(); valueMap.put("a", "a"); valueMap.put("b", null); - ValueExpression targetExpression = DSL.value(valueMap); + ValueExpression targetExpression = value(valueMap); HasAnyExpression expression = any(targetExpression, eq(ref(ValueReferences.KEY_REF), value("b"))); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); assertEquals("any(Map, {@key == \"b\"})", print(expression)); expression = any(targetExpression, eq(ref(ValueReferences.VALUE_REF), value("a"))); - assertTrue(expression.evaluate(ctx)); + assertTrue(expression.evaluate(evalContext)); assertEquals("any(Map, {@value == \"a\"})", print(expression)); } @Test void testUnsupportedList() { - ValueReferenceResolver ctx = RefResolverHelper.createResolver(null, null); ListValue collection = new ListValue(new CustomList()); HasAnyExpression expression = any(collection, eq(ref(ValueReferences.ITERATOR_REF), value("foo"))); EvaluationException exception = - assertThrows(EvaluationException.class, () -> expression.evaluate(ctx)); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals( "Unsupported List class: com.datadog.debugger.el.expressions.HasAnyExpressionTest$CustomList", exception.getMessage()); @@ -258,11 +303,10 @@ void testUnsupportedList() { @Test void testUnsupportedMap() { - ValueReferenceResolver ctx = RefResolverHelper.createResolver(null, null); MapValue collection = new MapValue(new CustomMap()); HasAnyExpression expression = any(collection, eq(ref(ValueReferences.VALUE_REF), value("foo"))); EvaluationException exception = - assertThrows(EvaluationException.class, () -> expression.evaluate(ctx)); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals( "Unsupported Map class: com.datadog.debugger.el.expressions.HasAnyExpressionTest$CustomMap", exception.getMessage()); @@ -271,12 +315,11 @@ void testUnsupportedMap() { @Test void testUnsupportedSet() { - ValueReferenceResolver ctx = RefResolverHelper.createResolver(null, null); SetValue collection = new SetValue(new CustomSet()); HasAnyExpression expression = any(collection, eq(ref(ValueReferences.ITERATOR_REF), value("foo"))); EvaluationException exception = - assertThrows(EvaluationException.class, () -> expression.evaluate(ctx)); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals( "Unsupported Set class: com.datadog.debugger.el.expressions.HasAnyExpressionTest$CustomSet", exception.getMessage()); diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/IfElseExpressionTest.java b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/IfElseExpressionTest.java index f71cd714ee5..04492d597ac 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/IfElseExpressionTest.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/IfElseExpressionTest.java @@ -1,15 +1,17 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.EvalContextHelper.createEvalContext; import static org.junit.jupiter.api.Assertions.*; import com.datadog.debugger.el.DSL; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.Expression; -import com.datadog.debugger.el.RefResolverHelper; import com.datadog.debugger.el.values.BooleanValue; import org.junit.jupiter.api.Test; class IfElseExpressionTest { private boolean guardFlag = false; + private EvalContext evalContext = createEvalContext(this); @Test void testIfTrue() { @@ -26,7 +28,7 @@ void testIfTrue() { return null; }; IfElseExpression expression = DSL.doif(test, thenExpression, elseExpression); - expression.evaluate(RefResolverHelper.createResolver(this)); + expression.evaluate(evalContext); assertTrue(executed[0]); assertFalse(executed[1]); } @@ -45,7 +47,7 @@ void testIfFalse() { executed[1] = true; return null; }; - DSL.doif(test, thenExpression, elseExpression).evaluate(RefResolverHelper.createResolver(this)); + DSL.doif(test, thenExpression, elseExpression).evaluate(evalContext); assertFalse(executed[0]); assertTrue(executed[1]); } @@ -65,14 +67,14 @@ void testFromContext() { return null; }; guardFlag = false; - DSL.doif(test, thenExpression, elseExpression).evaluate(RefResolverHelper.createResolver(this)); + DSL.doif(test, thenExpression, elseExpression).evaluate(evalContext); assertFalse(executed[0]); assertTrue(executed[1]); executed[1] = false; guardFlag = true; - DSL.doif(test, thenExpression, elseExpression).evaluate(RefResolverHelper.createResolver(this)); + DSL.doif(test, thenExpression, elseExpression).evaluate(evalContext); assertTrue(executed[0]); assertFalse(executed[1]); } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/IfExpressionTest.java b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/IfExpressionTest.java index 59685f59690..cc009684627 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/IfExpressionTest.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/IfExpressionTest.java @@ -1,16 +1,19 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.EvalContextHelper.createEvalContext; import static org.junit.jupiter.api.Assertions.*; import com.datadog.debugger.el.DSL; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.Expression; -import com.datadog.debugger.el.RefResolverHelper; import com.datadog.debugger.el.values.BooleanValue; import org.junit.jupiter.api.Test; class IfExpressionTest { private boolean guardFlag = false; + private EvalContext evalContext = createEvalContext(this); + @Test void testIfTrue() { boolean[] executed = new boolean[] {false}; @@ -20,7 +23,7 @@ void testIfTrue() { executed[0] = true; return null; }; - DSL.doif(test, expression).evaluate(RefResolverHelper.createResolver(this)); + DSL.doif(test, expression).evaluate(evalContext); assertTrue(executed[0]); } @@ -33,7 +36,7 @@ void testIfFalse() { executed[0] = true; return null; }; - DSL.doif(test, expression).evaluate(RefResolverHelper.createResolver(this)); + DSL.doif(test, expression).evaluate(evalContext); assertFalse(executed[0]); } @@ -47,11 +50,11 @@ void testFromContext() { return null; }; guardFlag = false; - DSL.doif(test, expression).evaluate(RefResolverHelper.createResolver(this)); + DSL.doif(test, expression).evaluate(evalContext); assertFalse(executed[0]); guardFlag = true; - DSL.doif(test, expression).evaluate(RefResolverHelper.createResolver(this)); + DSL.doif(test, expression).evaluate(evalContext); assertTrue(executed[0]); } } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/IndexExpressionTest.java b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/IndexExpressionTest.java index 4a6ea9ab2dd..9a36d2d054c 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/IndexExpressionTest.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/IndexExpressionTest.java @@ -1,12 +1,13 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.EvalContextHelper.createEvalContext; import static com.datadog.debugger.el.PrettyPrintVisitor.print; import static com.datadog.debugger.el.TestHelper.setFieldInConfig; import static org.junit.jupiter.api.Assertions.*; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; import com.datadog.debugger.el.RedactedException; -import com.datadog.debugger.el.RefResolverHelper; import com.datadog.debugger.el.Value; import com.datadog.debugger.el.ValueType; import com.datadog.debugger.el.values.ListValue; @@ -46,11 +47,13 @@ class IndexExpressionTest { secretMap.put("foo", new StoreSecret("secret123")); } + EvalContext evalContext = createEvalContext(this); + @Test void testArray() { IndexExpression expr = new IndexExpression(new ValueRefExpression("strArray"), new NumericValue(1, ValueType.INT)); - Value val = expr.evaluate(RefResolverHelper.createResolver(this)); + Value val = expr.evaluate(evalContext); assertNotNull(val); assertFalse(val.isUndefined()); assertEquals("bar", val.getValue()); @@ -61,7 +64,7 @@ void testArray() { void testList() { IndexExpression expr = new IndexExpression(new ValueRefExpression("strList"), new NumericValue(1, ValueType.INT)); - Value val = expr.evaluate(RefResolverHelper.createResolver(this)); + Value val = expr.evaluate(evalContext); assertNotNull(val); assertFalse(val.isUndefined()); assertEquals("bar", val.getValue()); @@ -72,7 +75,7 @@ void testList() { void testMap() { IndexExpression expr = new IndexExpression(new ValueRefExpression("strMap"), new StringValue("foo")); - Value val = expr.evaluate(RefResolverHelper.createResolver(this)); + Value val = expr.evaluate(evalContext); assertNotNull(val); assertFalse(val.isUndefined()); assertEquals("bar", val.getValue()); @@ -84,8 +87,7 @@ void testUnsupportedSet() { IndexExpression expr = new IndexExpression(new SetValue(new HashSet<>()), new StringValue("foo")); EvaluationException evaluationException = - assertThrows( - EvaluationException.class, () -> expr.evaluate(RefResolverHelper.createResolver(this))); + assertThrows(EvaluationException.class, () -> expr.evaluate(evalContext)); assertEquals( "Cannot evaluate the expression for unsupported type: com.datadog.debugger.el.values.SetValue", evaluationException.getMessage()); @@ -97,8 +99,7 @@ void testUnsupportedList() { new IndexExpression( new ListValue(new ArrayList() {}), new NumericValue(0, ValueType.INT)); EvaluationException evaluationException = - assertThrows( - EvaluationException.class, () -> expr.evaluate(RefResolverHelper.createResolver(this))); + assertThrows(EvaluationException.class, () -> expr.evaluate(evalContext)); assertEquals( "Unsupported List class: com.datadog.debugger.el.expressions.IndexExpressionTest$1", evaluationException.getMessage()); @@ -110,8 +111,7 @@ void testOutOfBoundsList() { new IndexExpression( new ListValue(new ArrayList()), new NumericValue(42, ValueType.INT)); EvaluationException evaluationException = - assertThrows( - EvaluationException.class, () -> expr.evaluate(RefResolverHelper.createResolver(this))); + assertThrows(EvaluationException.class, () -> expr.evaluate(evalContext)); assertEquals("index[42] out of bounds: [0-0]", evaluationException.getMessage()); } @@ -120,8 +120,7 @@ void testUnsupportedMap() { IndexExpression expr = new IndexExpression(new MapValue(new HashMap() {}), new StringValue("foo")); EvaluationException evaluationException = - assertThrows( - EvaluationException.class, () -> expr.evaluate(RefResolverHelper.createResolver(this))); + assertThrows(EvaluationException.class, () -> expr.evaluate(evalContext)); assertEquals( "Unsupported Map class: com.datadog.debugger.el.expressions.IndexExpressionTest$2", evaluationException.getMessage()); @@ -132,8 +131,7 @@ void undefined() { IndexExpression expr = new IndexExpression(ValueExpression.UNDEFINED, new NumericValue(1, ValueType.INT)); EvaluationException exception = - assertThrows( - EvaluationException.class, () -> expr.evaluate(RefResolverHelper.createResolver(this))); + assertThrows(EvaluationException.class, () -> expr.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for undefined value", exception.getMessage()); } @@ -142,18 +140,14 @@ void redacted() { IndexExpression expr1 = new IndexExpression(new ValueRefExpression("strMap"), new StringValue("password")); RedactedException redactedException = - assertThrows( - RedactedException.class, - () -> expr1.evaluate(RefResolverHelper.createResolver(this)).getValue()); + assertThrows(RedactedException.class, () -> expr1.evaluate(evalContext).getValue()); assertEquals( "Could not evaluate the expression because 'strMap[\"password\"]' was redacted", redactedException.getMessage()); IndexExpression expr2 = new IndexExpression(new ValueRefExpression("strMap"), new ValueRefExpression("str")); redactedException = - assertThrows( - RedactedException.class, - () -> expr2.evaluate(RefResolverHelper.createResolver(this)).getValue()); + assertThrows(RedactedException.class, () -> expr2.evaluate(evalContext).getValue()); assertEquals( "Could not evaluate the expression because 'strMap[str]' was redacted", redactedException.getMessage()); @@ -172,9 +166,7 @@ void redactedType() { new IndexExpression( new ValueRefExpression("secretArray"), new NumericValue(0, ValueType.INT)); RedactedException redactedException = - assertThrows( - RedactedException.class, - () -> exprArray.evaluate(RefResolverHelper.createResolver(this)).getValue()); + assertThrows(RedactedException.class, () -> exprArray.evaluate(evalContext).getValue()); assertEquals( "Could not evaluate the expression because 'secretArray[0]' was redacted", redactedException.getMessage()); @@ -182,18 +174,14 @@ void redactedType() { new IndexExpression( new ValueRefExpression("secretList"), new NumericValue(0, ValueType.INT)); redactedException = - assertThrows( - RedactedException.class, - () -> exprList.evaluate(RefResolverHelper.createResolver(this)).getValue()); + assertThrows(RedactedException.class, () -> exprList.evaluate(evalContext).getValue()); assertEquals( "Could not evaluate the expression because 'secretList[0]' was redacted", redactedException.getMessage()); IndexExpression exprMap = new IndexExpression(new ValueRefExpression("secretMap"), new StringValue("foo")); redactedException = - assertThrows( - RedactedException.class, - () -> exprMap.evaluate(RefResolverHelper.createResolver(this)).getValue()); + assertThrows(RedactedException.class, () -> exprMap.evaluate(evalContext).getValue()); assertEquals( "Could not evaluate the expression because 'secretMap[\"foo\"]' was redacted", redactedException.getMessage()); @@ -207,12 +195,12 @@ void stringPrimitives() { IndexExpression expr = new IndexExpression( new ValueRefExpression("uuidArray"), new NumericValue(1, ValueType.INT)); - assertEquals(UUID_2, expr.evaluate(RefResolverHelper.createResolver(this)).getValue()); + assertEquals(UUID_2, expr.evaluate(evalContext).getValue()); expr = new IndexExpression(new ValueRefExpression("uuidList"), new NumericValue(1, ValueType.INT)); - assertEquals(UUID_2, expr.evaluate(RefResolverHelper.createResolver(this)).getValue()); + assertEquals(UUID_2, expr.evaluate(evalContext).getValue()); expr = new IndexExpression(new ValueRefExpression("uuidMap"), new StringValue("foo")); - assertEquals(UUID_1, expr.evaluate(RefResolverHelper.createResolver(this)).getValue()); + assertEquals(UUID_1, expr.evaluate(evalContext).getValue()); } private static class StoreSecret { diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/IsDefinedExpressionTest.java b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/IsDefinedExpressionTest.java index b8911c90826..53f672cd724 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/IsDefinedExpressionTest.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/IsDefinedExpressionTest.java @@ -1,12 +1,13 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.EvalContextHelper.createEvalContext; import static com.datadog.debugger.el.PrettyPrintVisitor.print; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import com.datadog.debugger.el.DSL; -import com.datadog.debugger.el.RefResolverHelper; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.Value; import com.datadog.debugger.el.ValueType; import com.datadog.debugger.el.values.BooleanValue; @@ -14,35 +15,34 @@ import com.datadog.debugger.el.values.MapValue; import com.datadog.debugger.el.values.NumericValue; import com.datadog.debugger.el.values.StringValue; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; import datadog.trace.bootstrap.debugger.el.Values; import java.util.Arrays; import java.util.Collections; import org.junit.jupiter.api.Test; class IsDefinedExpressionTest { - private final ValueReferenceResolver resolver = RefResolverHelper.createResolver(this); + private final EvalContext evalContext = createEvalContext(this); @Test void testNullValue() { IsDefinedExpression expression = new IsDefinedExpression(null); - assertFalse(expression.evaluate(resolver)); + assertFalse(expression.evaluate(evalContext)); assertEquals("isDefined(null)", print(expression)); expression = new IsDefinedExpression(DSL.value(Values.NULL_OBJECT)); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("isDefined(null)", print(expression)); expression = new IsDefinedExpression(DSL.value(Value.nullValue())); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("isDefined(com.datadog.debugger.el.values.NullValue)", print(expression)); } @Test void testUndefinedValue() { IsDefinedExpression expression = new IsDefinedExpression(DSL.value(Values.UNDEFINED_OBJECT)); - assertFalse(expression.evaluate(resolver)); + assertFalse(expression.evaluate(evalContext)); assertEquals("isDefined(UNDEFINED)", print(expression)); expression = new IsDefinedExpression(DSL.ref("undefinedvar")); - assertFalse(expression.evaluate(resolver)); + assertFalse(expression.evaluate(evalContext)); } @Test @@ -52,13 +52,13 @@ void testNumericLiteral() { NumericValue none = new NumericValue(null, ValueType.OBJECT); IsDefinedExpression expression = new IsDefinedExpression(zero); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("isDefined(0)", print(expression)); expression = new IsDefinedExpression(one); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("isDefined(1)", print(expression)); expression = new IsDefinedExpression(none); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("isDefined(null)", print(expression)); } @@ -69,13 +69,13 @@ void testBooleanLiteral() { BooleanValue none = new BooleanValue(null, ValueType.OBJECT); IsDefinedExpression expression = new IsDefinedExpression(yes); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("isDefined(true)", print(expression)); expression = new IsDefinedExpression(no); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("isDefined(false)", print(expression)); expression = new IsDefinedExpression(none); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("isDefined(null)", print(expression)); } @@ -89,11 +89,11 @@ void testStringLiteral() { IsDefinedExpression isDefined2 = new IsDefinedExpression(emptyString); IsDefinedExpression isDefined3 = new IsDefinedExpression(nullString); - assertTrue(isDefined1.evaluate(resolver)); + assertTrue(isDefined1.evaluate(evalContext)); assertEquals("isDefined(\"Hello World\")", print(isDefined1)); - assertTrue(isDefined2.evaluate(resolver)); + assertTrue(isDefined2.evaluate(evalContext)); assertEquals("isDefined(\"\")", print(isDefined2)); - assertTrue(isDefined3.evaluate(resolver)); + assertTrue(isDefined3.evaluate(evalContext)); assertEquals("isDefined(\"null\")", print(isDefined3)); } @@ -109,13 +109,13 @@ void testListValue() { IsDefinedExpression isDefined3 = new IsDefinedExpression(nullList); IsDefinedExpression isDefined4 = new IsDefinedExpression(undefinedList); - assertTrue(isDefined1.evaluate(resolver)); + assertTrue(isDefined1.evaluate(evalContext)); assertEquals("isDefined(List)", print(isDefined1)); - assertTrue(isDefined2.evaluate(resolver)); + assertTrue(isDefined2.evaluate(evalContext)); assertEquals("isDefined(List)", print(isDefined2)); - assertTrue(isDefined3.evaluate(resolver)); + assertTrue(isDefined3.evaluate(evalContext)); assertEquals("isDefined(null)", print(isDefined3)); - assertFalse(isDefined4.evaluate(resolver)); + assertFalse(isDefined4.evaluate(evalContext)); assertEquals("isDefined(null)", print(isDefined4)); } @@ -126,19 +126,18 @@ void testMapValue() { MapValue nullMao = new MapValue(null); MapValue undefinedMap = new MapValue(Values.UNDEFINED_OBJECT); - ValueReferenceResolver resolver = RefResolverHelper.createResolver(this); IsDefinedExpression isDefined1 = new IsDefinedExpression(map); IsDefinedExpression isDefined2 = new IsDefinedExpression(emptyMap); IsDefinedExpression isDefined3 = new IsDefinedExpression(nullMao); IsDefinedExpression isDefined4 = new IsDefinedExpression(undefinedMap); - assertTrue(isDefined1.evaluate(resolver)); + assertTrue(isDefined1.evaluate(evalContext)); assertEquals("isDefined(Map)", print(isDefined1)); - assertTrue(isDefined2.evaluate(resolver)); + assertTrue(isDefined2.evaluate(evalContext)); assertEquals("isDefined(Map)", print(isDefined2)); - assertTrue(isDefined3.evaluate(resolver)); + assertTrue(isDefined3.evaluate(evalContext)); assertEquals("isDefined(null)", print(isDefined3)); - assertFalse(isDefined4.evaluate(resolver)); + assertFalse(isDefined4.evaluate(evalContext)); assertEquals("isDefined(null)", print(isDefined4)); } } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/IsEmptyExpressionTest.java b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/IsEmptyExpressionTest.java index d9bb0f4ecd7..3581fd96907 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/IsEmptyExpressionTest.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/IsEmptyExpressionTest.java @@ -1,11 +1,12 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.EvalContextHelper.createEvalContext; import static com.datadog.debugger.el.PrettyPrintVisitor.print; import static org.junit.jupiter.api.Assertions.*; import com.datadog.debugger.el.DSL; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; -import com.datadog.debugger.el.RefResolverHelper; import com.datadog.debugger.el.Value; import com.datadog.debugger.el.ValueType; import com.datadog.debugger.el.values.BooleanValue; @@ -13,7 +14,6 @@ import com.datadog.debugger.el.values.MapValue; import com.datadog.debugger.el.values.NumericValue; import com.datadog.debugger.el.values.StringValue; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; import datadog.trace.bootstrap.debugger.el.Values; import java.util.Arrays; import java.util.Collections; @@ -21,30 +21,30 @@ import org.junit.jupiter.api.Test; class IsEmptyExpressionTest { + EvalContext evalContext = createEvalContext(this); + @Test void testNullValue() { - ValueReferenceResolver resolver = RefResolverHelper.createResolver(this); IsEmptyExpression expression1 = new IsEmptyExpression(null); EvaluationException exception = - assertThrows(EvaluationException.class, () -> expression1.evaluate(resolver)); + assertThrows(EvaluationException.class, () -> expression1.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("isEmpty(null)", print(expression1)); IsEmptyExpression expression2 = new IsEmptyExpression(DSL.value(Values.NULL_OBJECT)); - exception = assertThrows(EvaluationException.class, () -> expression2.evaluate(resolver)); + exception = assertThrows(EvaluationException.class, () -> expression2.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("isEmpty(null)", print(expression2)); IsEmptyExpression expression3 = new IsEmptyExpression(DSL.value(Value.nullValue())); - exception = assertThrows(EvaluationException.class, () -> expression3.evaluate(resolver)); + exception = assertThrows(EvaluationException.class, () -> expression3.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("isEmpty(com.datadog.debugger.el.values.NullValue)", print(expression3)); } @Test void testUndefinedValue() { - ValueReferenceResolver resolver = RefResolverHelper.createResolver(this); IsEmptyExpression expression = new IsEmptyExpression(DSL.value(Values.UNDEFINED_OBJECT)); EvaluationException exception = - assertThrows(EvaluationException.class, () -> expression.evaluate(resolver)); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for undefined value", exception.getMessage()); assertEquals("isEmpty(UNDEFINED)", print(expression)); } @@ -55,15 +55,14 @@ void testNumericLiteral() { NumericValue one = new NumericValue(1, ValueType.INT); NumericValue none = new NumericValue(null, ValueType.OBJECT); - ValueReferenceResolver resolver = RefResolverHelper.createResolver(this); IsEmptyExpression expression = new IsEmptyExpression(zero); - assertFalse(expression.evaluate(resolver)); + assertFalse(expression.evaluate(evalContext)); assertEquals("isEmpty(0)", print(expression)); expression = new IsEmptyExpression(one); - assertFalse(expression.evaluate(resolver)); + assertFalse(expression.evaluate(evalContext)); assertEquals("isEmpty(1)", print(expression)); IsEmptyExpression nullExpression = new IsEmptyExpression(none); - assertThrows(EvaluationException.class, () -> nullExpression.evaluate(resolver)); + assertThrows(EvaluationException.class, () -> nullExpression.evaluate(evalContext)); assertEquals("isEmpty(null)", print(nullExpression)); } @@ -73,16 +72,15 @@ void testBooleanLiteral() { BooleanValue no = BooleanValue.FALSE; BooleanValue none = new BooleanValue(null, ValueType.OBJECT); - ValueReferenceResolver resolver = RefResolverHelper.createResolver(this); IsEmptyExpression expression = new IsEmptyExpression(yes); - assertFalse(expression.evaluate(resolver)); + assertFalse(expression.evaluate(evalContext)); assertEquals("isEmpty(true)", print(expression)); expression = new IsEmptyExpression(no); - assertFalse(expression.evaluate(resolver)); + assertFalse(expression.evaluate(evalContext)); assertEquals("isEmpty(false)", print(expression)); IsEmptyExpression nullExpression = new IsEmptyExpression(none); EvaluationException exception = - assertThrows(EvaluationException.class, () -> nullExpression.evaluate(resolver)); + assertThrows(EvaluationException.class, () -> nullExpression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("isEmpty(null)", print(nullExpression)); } @@ -93,17 +91,16 @@ void testStringLiteral() { StringValue emptyString = new StringValue(""); StringValue nullString = new StringValue(null); - ValueReferenceResolver resolver = RefResolverHelper.createResolver(this); IsEmptyExpression isEmpty1 = new IsEmptyExpression(string); IsEmptyExpression isEmpty2 = new IsEmptyExpression(emptyString); IsEmptyExpression isEmpty3 = new IsEmptyExpression(nullString); - assertFalse(isEmpty1.evaluate(resolver)); + assertFalse(isEmpty1.evaluate(evalContext)); assertEquals("isEmpty(\"Hello World\")", print(isEmpty1)); - assertTrue(isEmpty2.evaluate(resolver)); + assertTrue(isEmpty2.evaluate(evalContext)); assertEquals("isEmpty(\"\")", print(isEmpty2)); EvaluationException exception = - assertThrows(EvaluationException.class, () -> isEmpty3.evaluate(resolver)); + assertThrows(EvaluationException.class, () -> isEmpty3.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("isEmpty(\"null\")", print(isEmpty3)); } @@ -117,7 +114,6 @@ void testCollectionLiteral() { ListValue set = new ListValue(new HashSet<>(Arrays.asList("a", "b"))); ListValue emptySet = new ListValue(Collections.emptySet()); - ValueReferenceResolver resolver = RefResolverHelper.createResolver(this); IsEmptyExpression isEmpty1 = new IsEmptyExpression(list); IsEmptyExpression isEmpty2 = new IsEmptyExpression(emptyList); IsEmptyExpression isEmpty3 = new IsEmptyExpression(nullList); @@ -125,20 +121,20 @@ void testCollectionLiteral() { IsEmptyExpression isEmpty5 = new IsEmptyExpression(set); IsEmptyExpression isEmpty6 = new IsEmptyExpression(emptySet); - assertFalse(isEmpty1.evaluate(resolver)); + assertFalse(isEmpty1.evaluate(evalContext)); assertEquals("isEmpty(List)", print(isEmpty1)); - assertTrue(isEmpty2.evaluate(resolver)); + assertTrue(isEmpty2.evaluate(evalContext)); assertEquals("isEmpty(List)", print(isEmpty2)); EvaluationException exception = - assertThrows(EvaluationException.class, () -> isEmpty3.evaluate(resolver)); + assertThrows(EvaluationException.class, () -> isEmpty3.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("isEmpty(null)", print(isEmpty3)); - exception = assertThrows(EvaluationException.class, () -> isEmpty4.evaluate(resolver)); + exception = assertThrows(EvaluationException.class, () -> isEmpty4.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for undefined value", exception.getMessage()); assertEquals("isEmpty(null)", print(isEmpty4)); - assertFalse(isEmpty5.evaluate(resolver)); + assertFalse(isEmpty5.evaluate(evalContext)); assertEquals("isEmpty(Set)", print(isEmpty5)); - assertTrue(isEmpty6.evaluate(resolver)); + assertTrue(isEmpty6.evaluate(evalContext)); assertEquals("isEmpty(Set)", print(isEmpty6)); } @@ -149,21 +145,20 @@ void testMapValue() { MapValue nullMao = new MapValue(null); MapValue undefinedMap = new MapValue(Values.UNDEFINED_OBJECT); - ValueReferenceResolver resolver = RefResolverHelper.createResolver(this); IsEmptyExpression isEmpty1 = new IsEmptyExpression(map); IsEmptyExpression isEmpty2 = new IsEmptyExpression(emptyMap); IsEmptyExpression isEmpty3 = new IsEmptyExpression(nullMao); IsEmptyExpression isEmpty4 = new IsEmptyExpression(undefinedMap); - assertFalse(isEmpty1.evaluate(resolver)); + assertFalse(isEmpty1.evaluate(evalContext)); assertEquals("isEmpty(Map)", print(isEmpty1)); - assertTrue(isEmpty2.evaluate(resolver)); + assertTrue(isEmpty2.evaluate(evalContext)); assertEquals("isEmpty(Map)", print(isEmpty2)); EvaluationException exception = - assertThrows(EvaluationException.class, () -> isEmpty3.evaluate(resolver)); + assertThrows(EvaluationException.class, () -> isEmpty3.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("isEmpty(null)", print(isEmpty3)); - exception = assertThrows(EvaluationException.class, () -> isEmpty4.evaluate(resolver)); + exception = assertThrows(EvaluationException.class, () -> isEmpty4.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for undefined value", exception.getMessage()); assertEquals("isEmpty(null)", print(isEmpty4)); } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/LenExpressionTest.java b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/LenExpressionTest.java index a978e6a8a42..5c9d150141c 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/LenExpressionTest.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/LenExpressionTest.java @@ -1,12 +1,12 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.EvalContextHelper.createEvalContext; import static com.datadog.debugger.el.PrettyPrintVisitor.print; import static org.junit.jupiter.api.Assertions.*; import com.datadog.debugger.el.DSL; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; -import com.datadog.debugger.el.RefResolverHelper; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; import datadog.trace.bootstrap.debugger.el.Values; import java.util.Arrays; import java.util.Collections; @@ -14,13 +14,13 @@ import org.junit.jupiter.api.Test; class LenExpressionTest { - private final ValueReferenceResolver resolver = RefResolverHelper.createResolver(this); + private final EvalContext evalContext = createEvalContext(this); @Test void nullExpression() { LenExpression expression = new LenExpression(null); EvaluationException exception = - assertThrows(EvaluationException.class, () -> expression.evaluate(resolver).getValue()); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext).getValue()); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("len(null)", print(expression)); } @@ -29,7 +29,7 @@ void nullExpression() { void undefinedExpression() { LenExpression expression = new LenExpression(DSL.value(Values.UNDEFINED_OBJECT)); EvaluationException exception = - assertThrows(EvaluationException.class, () -> expression.evaluate(resolver).getValue()); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext).getValue()); assertEquals("Cannot evaluate the expression for undefined value", exception.getMessage()); assertEquals("len(UNDEFINED)", print(expression)); } @@ -37,24 +37,24 @@ void undefinedExpression() { @Test void stringExpression() { LenExpression expression = new LenExpression(DSL.value("a")); - assertEquals(1, expression.evaluate(resolver).getValue()); + assertEquals(1, expression.evaluate(evalContext).getValue()); assertEquals("len(\"a\")", print(expression)); } @Test void collectionExpression() { LenExpression expression = new LenExpression(DSL.value(Arrays.asList("a", "b"))); - assertEquals(2, expression.evaluate(resolver).getValue()); + assertEquals(2, expression.evaluate(evalContext).getValue()); assertEquals("len(List)", print(expression)); expression = new LenExpression(DSL.value(new HashSet<>(Arrays.asList("a", "b")))); - assertEquals(2, expression.evaluate(resolver).getValue()); + assertEquals(2, expression.evaluate(evalContext).getValue()); assertEquals("len(Set)", print(expression)); } @Test void mapExpression() { LenExpression expression = new LenExpression(DSL.value(Collections.singletonMap("a", "b"))); - assertEquals(1, expression.evaluate(resolver).getValue()); + assertEquals(1, expression.evaluate(evalContext).getValue()); assertEquals("len(Map)", print(expression)); } } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/MatchesExpressionTest.java b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/MatchesExpressionTest.java index 23cfc0c7c66..7e33d745532 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/MatchesExpressionTest.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/MatchesExpressionTest.java @@ -1,19 +1,19 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.EvalContextHelper.createEvalContext; import static com.datadog.debugger.el.PrettyPrintVisitor.print; import static org.junit.jupiter.api.Assertions.*; import com.datadog.debugger.el.DSL; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; -import com.datadog.debugger.el.RefResolverHelper; import com.datadog.debugger.el.values.StringValue; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; import datadog.trace.bootstrap.debugger.el.Values; import java.net.URI; import org.junit.jupiter.api.Test; class MatchesExpressionTest { - private final ValueReferenceResolver resolver = RefResolverHelper.createResolver(this); + private final EvalContext evalContext = createEvalContext(this); // used to ref lookup URI uri = URI.create("https://www.datadoghq.com"); @@ -21,7 +21,7 @@ class MatchesExpressionTest { void nullExpression() { MatchesExpression expression = new MatchesExpression(null, null); EvaluationException exception = - assertThrows(EvaluationException.class, () -> expression.evaluate(resolver)); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("matches(null, null)", print(expression)); } @@ -31,7 +31,7 @@ void undefinedExpression() { MatchesExpression expression = new MatchesExpression(DSL.value(Values.UNDEFINED_OBJECT), new StringValue(null)); EvaluationException exception = - assertThrows(EvaluationException.class, () -> expression.evaluate(resolver)); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for undefined value", exception.getMessage()); assertEquals("matches(UNDEFINED, \"null\")", print(expression)); } @@ -39,17 +39,17 @@ void undefinedExpression() { @Test void stringExpression() { MatchesExpression expression = new MatchesExpression(DSL.value("abc"), new StringValue("abc")); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("matches(\"abc\", \"abc\")", print(expression)); expression = new MatchesExpression(DSL.value("abc"), new StringValue("^ab.*")); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("matches(\"abc\", \"^ab.*\")", print(expression)); expression = new MatchesExpression(DSL.value("abc"), new StringValue("bc")); - assertFalse(expression.evaluate(resolver)); + assertFalse(expression.evaluate(evalContext)); assertEquals("matches(\"abc\", \"bc\")", print(expression)); expression = new MatchesExpression(DSL.value("abc"), new StringValue("[def]+")); - assertFalse(expression.evaluate(resolver)); + assertFalse(expression.evaluate(evalContext)); assertEquals("matches(\"abc\", \"[def]+\")", print(expression)); } @@ -57,7 +57,7 @@ void stringExpression() { void stringPrimitives() { MatchesExpression expression = new MatchesExpression(DSL.ref("uri"), new StringValue("^https?://w{3}\\.datadoghq\\.com$")); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("matches(uri, \"^https?://w{3}\\.datadoghq\\.com$\")", print(expression)); } } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/NotExpressionTest.java b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/NotExpressionTest.java index ac6d251134c..bad4a9f4c0e 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/NotExpressionTest.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/NotExpressionTest.java @@ -1,9 +1,9 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.EvalContextHelper.createEvalContext; import static com.datadog.debugger.el.PrettyPrintVisitor.print; import static org.junit.jupiter.api.Assertions.*; -import com.datadog.debugger.el.RefResolverHelper; import java.util.stream.Stream; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; @@ -14,7 +14,7 @@ class NotExpressionTest { @MethodSource("expressions") void testNullPredicate(BooleanExpression expression, boolean expected, String prettyPrint) { NotExpression expr = new NotExpression(expression); - assertEquals(expected, expr.evaluate(RefResolverHelper.createResolver(this))); + assertEquals(expected, expr.evaluate(createEvalContext(this))); assertEquals(prettyPrint, print(expr)); } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/StartsWithExpressionTest.java b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/StartsWithExpressionTest.java index 0626dc1d6ff..f17a11a7946 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/StartsWithExpressionTest.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/StartsWithExpressionTest.java @@ -1,19 +1,19 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.EvalContextHelper.createEvalContext; import static com.datadog.debugger.el.PrettyPrintVisitor.print; import static org.junit.jupiter.api.Assertions.*; import com.datadog.debugger.el.DSL; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; -import com.datadog.debugger.el.RefResolverHelper; import com.datadog.debugger.el.values.StringValue; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; import datadog.trace.bootstrap.debugger.el.Values; import java.net.URI; import org.junit.jupiter.api.Test; class StartsWithExpressionTest { - private final ValueReferenceResolver resolver = RefResolverHelper.createResolver(this); + private final EvalContext evalContext = createEvalContext(this); // used to ref lookup URI uri = URI.create("https://www.datadoghq.com"); @@ -21,7 +21,7 @@ class StartsWithExpressionTest { void nullExpression() { StartsWithExpression expression = new StartsWithExpression(null, null); EvaluationException exception = - assertThrows(EvaluationException.class, () -> expression.evaluate(resolver)); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for null value", exception.getMessage()); assertEquals("startsWith(null, null)", print(expression)); } @@ -31,7 +31,7 @@ void undefinedExpression() { StartsWithExpression expression = new StartsWithExpression(DSL.value(Values.UNDEFINED_OBJECT), new StringValue(null)); EvaluationException exception = - assertThrows(EvaluationException.class, () -> expression.evaluate(resolver)); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals("Cannot evaluate the expression for undefined value", exception.getMessage()); assertEquals("startsWith(UNDEFINED, \"null\")", print(expression)); } @@ -40,11 +40,11 @@ void undefinedExpression() { void stringExpression() { StartsWithExpression expression = new StartsWithExpression(DSL.value("abc"), new StringValue("ab")); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("startsWith(\"abc\", \"ab\")", print(expression)); expression = new StartsWithExpression(DSL.value("abc"), new StringValue("bc")); - assertFalse(expression.evaluate(resolver)); + assertFalse(expression.evaluate(evalContext)); assertEquals("startsWith(\"abc\", \"bc\")", print(expression)); } @@ -52,7 +52,7 @@ void stringExpression() { void stringPrimitives() { StartsWithExpression expression = new StartsWithExpression(DSL.ref("uri"), new StringValue("https")); - assertTrue(expression.evaluate(resolver)); + assertTrue(expression.evaluate(evalContext)); assertEquals("startsWith(uri, \"https\")", print(expression)); } } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/SubStringExpressionTest.java b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/SubStringExpressionTest.java index 57c2ddb8291..3e2479cdd42 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/SubStringExpressionTest.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/SubStringExpressionTest.java @@ -1,19 +1,19 @@ package com.datadog.debugger.el.expressions; +import static com.datadog.debugger.el.EvalContextHelper.createEvalContext; import static com.datadog.debugger.el.PrettyPrintVisitor.print; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; import com.datadog.debugger.el.DSL; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.EvaluationException; -import com.datadog.debugger.el.RefResolverHelper; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; import datadog.trace.bootstrap.debugger.el.Values; import java.net.URI; import org.junit.jupiter.api.Test; public class SubStringExpressionTest { - private final ValueReferenceResolver resolver = RefResolverHelper.createResolver(this); + private final EvalContext evalContext = createEvalContext(this); // used to ref lookup URI uri = URI.create("https://www.datadoghq.com"); Object nullValue = null; @@ -22,11 +22,11 @@ public class SubStringExpressionTest { void nullExpression() { SubStringExpression expression1 = new SubStringExpression(null, 0, 0); EvaluationException evaluationException = - assertThrows(EvaluationException.class, () -> expression1.evaluate(resolver)); + assertThrows(EvaluationException.class, () -> expression1.evaluate(evalContext)); assertEquals("substring(null, 0, 0)", evaluationException.getExpr()); SubStringExpression expression2 = new SubStringExpression(DSL.ref("nullValue"), 0, 0); evaluationException = - assertThrows(EvaluationException.class, () -> expression2.evaluate(resolver)); + assertThrows(EvaluationException.class, () -> expression2.evaluate(evalContext)); assertEquals("substring(nullValue, 0, 0)", evaluationException.getExpr()); } @@ -35,14 +35,14 @@ void undefinedExpression() { SubStringExpression expression = new SubStringExpression(DSL.value(Values.UNDEFINED_OBJECT), 0, 0); EvaluationException evaluationException = - assertThrows(EvaluationException.class, () -> expression.evaluate(resolver)); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals("substring(UNDEFINED, 0, 0)", evaluationException.getExpr()); } @Test void stringExpression() { SubStringExpression expression = new SubStringExpression(DSL.value("abc"), 0, 1); - assertEquals("a", expression.evaluate(resolver).getValue()); + assertEquals("a", expression.evaluate(evalContext).getValue()); assertEquals("substring(\"abc\", 0, 1)", print(expression)); } @@ -50,14 +50,14 @@ void stringExpression() { void stringOutOfBoundsExpression() { SubStringExpression expression = new SubStringExpression(DSL.value("abc"), 0, 10); EvaluationException evaluationException = - assertThrows(EvaluationException.class, () -> expression.evaluate(resolver)); + assertThrows(EvaluationException.class, () -> expression.evaluate(evalContext)); assertEquals("substring(\"abc\", 0, 10)", evaluationException.getExpr()); } @Test void stringPrimitives() { SubStringExpression expression = new SubStringExpression(DSL.ref("uri"), 0, 5); - assertEquals("https", expression.evaluate(resolver).getValue()); + assertEquals("https", expression.evaluate(evalContext).getValue()); assertEquals("substring(uri, 0, 5)", print(expression)); } } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/ValueRefExpressionTest.java b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/ValueRefExpressionTest.java index c5501252962..7bc26b1540e 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/ValueRefExpressionTest.java +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/java/com/datadog/debugger/el/expressions/ValueRefExpressionTest.java @@ -1,19 +1,22 @@ package com.datadog.debugger.el.expressions; import static com.datadog.debugger.el.DSL.*; +import static com.datadog.debugger.el.EvalContextHelper.TEST_TIMEOUT; +import static com.datadog.debugger.el.EvalContextHelper.createEvalContext; +import static com.datadog.debugger.el.EvalContextHelper.createResolver; import static com.datadog.debugger.el.PrettyPrintVisitor.print; import static com.datadog.debugger.el.TestHelper.setFieldInConfig; import static org.junit.jupiter.api.Assertions.*; import com.datadog.debugger.el.DSL; +import com.datadog.debugger.el.EvalContext; import com.datadog.debugger.el.RedactedException; -import com.datadog.debugger.el.RefResolverHelper; import com.datadog.debugger.el.Value; import datadog.trace.api.Config; import datadog.trace.bootstrap.debugger.CapturedContext.CapturedValue; -import datadog.trace.bootstrap.debugger.el.ValueReferenceResolver; import datadog.trace.bootstrap.debugger.el.ValueReferences; import datadog.trace.bootstrap.debugger.util.Redaction; +import datadog.trace.bootstrap.debugger.util.TimeoutChecker; import java.util.HashMap; import java.util.Map; import java.util.UUID; @@ -26,7 +29,7 @@ class ValueRefExpressionTest { void testRef() { ValueRefExpression valueRef = new ValueRefExpression("b"); ExObjectWithRefAndValue instance = new ExObjectWithRefAndValue(null, "hello"); - Value val = valueRef.evaluate(RefResolverHelper.createResolver(instance)); + Value val = valueRef.evaluate(createEvalContext(instance)); assertNotNull(val); assertFalse(val.isUndefined()); assertEquals(instance.getB(), val.getValue()); @@ -42,19 +45,21 @@ void testPredicatedRef() { IsEmptyExpression isEmptyInvalid = new IsEmptyExpression(invalidValueRef); ExObjectWithRefAndValue instance = new ExObjectWithRefAndValue(null, "hello"); - ValueReferenceResolver ctx = RefResolverHelper.createResolver(instance); + EvalContext evalContext = createEvalContext(instance); - assertFalse(isEmpty.evaluate(ctx)); + assertFalse(isEmpty.evaluate(evalContext)); assertEquals("isEmpty(b)", print(isEmpty)); RuntimeException runtimeException = - assertThrows(RuntimeException.class, () -> isEmptyInvalid.evaluate(ctx)); + assertThrows(RuntimeException.class, () -> isEmptyInvalid.evaluate(evalContext)); assertEquals("Cannot dereference field: x", runtimeException.getMessage()); runtimeException = - assertThrows(RuntimeException.class, () -> and(isEmptyInvalid, isEmpty).evaluate(ctx)); + assertThrows( + RuntimeException.class, () -> and(isEmptyInvalid, isEmpty).evaluate(evalContext)); assertEquals("Cannot dereference field: x", runtimeException.getMessage()); runtimeException = - assertThrows(RuntimeException.class, () -> or(isEmptyInvalid, isEmpty).evaluate(ctx)); + assertThrows( + RuntimeException.class, () -> or(isEmptyInvalid, isEmpty).evaluate(evalContext)); assertEquals("Cannot dereference field: x", runtimeException.getMessage()); assertEquals("isEmpty(x)", print(isEmptyInvalid)); } @@ -74,30 +79,33 @@ class Obj { exts.put(ValueReferences.RETURN_EXTENSION_NAME, CapturedValue.of(returnVal)); exts.put(ValueReferences.DURATION_EXTENSION_NAME, CapturedValue.of(duration)); exts.put(ValueReferences.EXCEPTION_EXTENSION_NAME, CapturedValue.of(exception)); - ValueReferenceResolver resolver = - RefResolverHelper.createResolver(new Obj()).withExtensions(exts); + EvalContext evalContext = + new EvalContext( + createResolver(new Obj()).withExtensions(exts), + TimeoutChecker.create(Config.get(), TEST_TIMEOUT)); ValueRefExpression expression = DSL.ref(ValueReferences.DURATION_REF); - assertEquals(duration, expression.evaluate(resolver).getValue()); + assertEquals(duration, expression.evaluate(evalContext).getValue()); assertEquals("@duration", print(expression)); expression = DSL.ref(ValueReferences.RETURN_REF); - assertEquals(returnVal, expression.evaluate(resolver).getValue()); + assertEquals(returnVal, expression.evaluate(evalContext).getValue()); assertEquals("@return", print(expression)); expression = DSL.ref(ValueReferences.EXCEPTION_REF); - assertEquals(exception, expression.evaluate(resolver).getValue()); + assertEquals(exception, expression.evaluate(evalContext).getValue()); assertEquals("@exception", print(expression)); expression = DSL.ref("limit"); - assertEquals(511L, expression.evaluate(resolver).getValue()); + assertEquals(511L, expression.evaluate(evalContext).getValue()); assertEquals("limit", print(expression)); expression = DSL.ref("msg"); - assertEquals("Hello there", expression.evaluate(resolver).getValue()); + assertEquals("Hello there", expression.evaluate(evalContext).getValue()); assertEquals("msg", print(expression)); expression = DSL.ref("i"); - assertEquals(6, expression.evaluate(resolver).getValue()); // int value is widened to long + assertEquals(6, expression.evaluate(evalContext).getValue()); // int value is widened to long assertEquals("i", print(expression)); ValueRefExpression invalidExpression = ref(ValueReferences.synthetic("invalid")); RuntimeException runtimeException = - assertThrows(RuntimeException.class, () -> invalidExpression.evaluate(resolver).getValue()); + assertThrows( + RuntimeException.class, () -> invalidExpression.evaluate(evalContext).getValue()); assertEquals("Cannot find synthetic var: invalid", runtimeException.getMessage()); assertEquals("@invalid", print(invalidExpression)); } @@ -115,9 +123,7 @@ public void redacted() { ValueRefExpression valueRef = new ValueRefExpression("password"); StoreSecret instance = new StoreSecret("secret123"); RedactedException redactedException = - assertThrows( - RedactedException.class, - () -> valueRef.evaluate(RefResolverHelper.createResolver(instance))); + assertThrows(RedactedException.class, () -> valueRef.evaluate(createEvalContext(instance))); assertEquals( "Could not evaluate the expression because 'password' was redacted", redactedException.getMessage()); @@ -136,8 +142,7 @@ class Holder { } RedactedException redactedException = assertThrows( - RedactedException.class, - () -> valueRef.evaluate(RefResolverHelper.createResolver(new Holder()))); + RedactedException.class, () -> valueRef.evaluate(createEvalContext(new Holder()))); assertEquals( "Could not evaluate the expression because 'store' was redacted", redactedException.getMessage()); @@ -153,13 +158,13 @@ class StrPrimitive { Class clazz = String.class; } ValueRefExpression valueRef = new ValueRefExpression("uuid"); - Value val = valueRef.evaluate(RefResolverHelper.createResolver(new StrPrimitive())); + Value val = valueRef.evaluate(createEvalContext(new StrPrimitive())); assertNotNull(val); assertFalse(val.isUndefined()); assertEquals("123e4567-e89b-12d3-a456-426655440000", val.getValue()); assertEquals("uuid", print(valueRef)); valueRef = new ValueRefExpression("clazz"); - val = valueRef.evaluate(RefResolverHelper.createResolver(new StrPrimitive())); + val = valueRef.evaluate(createEvalContext(new StrPrimitive())); assertNotNull(val); assertFalse(val.isUndefined()); assertEquals("java.lang.String", val.getValue()); diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/resources/test_conditional_14.json b/dd-java-agent/agent-debugger/debugger-el/src/test/resources/test_conditional_14.json index 69577b9e305..787c7f74691 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/resources/test_conditional_14.json +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/resources/test_conditional_14.json @@ -7,7 +7,8 @@ {"eq": [{"count": {"ref": "strArray"}}, 2]}, {"eq": [{"count": {"ref": "strMap"}}, 2]}, {"eq": [{"count": {"ref": "strSet"}}, 1]}, - {"eq": [{"count": {"ref": "strList"}}, 1]} + {"eq": [{"count": {"ref": "strList"}}, 1]}, + {"all": [{"ref": "largeList"}, {"neq": [{"ref": "@it"}, "d"]}]} ] } } diff --git a/dd-java-agent/agent-debugger/debugger-el/src/test/resources/test_value_expr_01.json b/dd-java-agent/agent-debugger/debugger-el/src/test/resources/test_value_expr_01.json index f19b01f7f57..4c8ec9294cb 100644 --- a/dd-java-agent/agent-debugger/debugger-el/src/test/resources/test_value_expr_01.json +++ b/dd-java-agent/agent-debugger/debugger-el/src/test/resources/test_value_expr_01.json @@ -1,9 +1,9 @@ { "dsl": "", "json": { - "and": [ + "or": [ { - "or": [ + "and": [ {"eq": [{"ref": "i"}, 10]}, {"==": [{"ref": "i"}, 10]}, {"lt": [{"ref": "i"}, 11]}, @@ -20,6 +20,7 @@ {"not": {"isEmpty": {"ref": "list"}}}, {"any": [{"ref": "list"}, {"eq": [{"ref": "@it"}, "a"]}]}, {"all": [{"ref": "list"}, {"neq": [{"ref": "@it"}, "d"]}]}, + {"all": [{"ref": "largeList"}, {"neq": [{"ref": "@it"}, "d"]}]}, {"startsWith": [{"ref": "str"}, "hel"]}, {"endsWith": [{"ref": "str"}, "llo"]}, {"contains": [{"ref": "str"}, "ll"]}, diff --git a/dd-java-agent/agent-debugger/debugger-test-scala/gradle.lockfile b/dd-java-agent/agent-debugger/debugger-test-scala/gradle.lockfile index 3fd39b39f05..afeae789d4e 100644 --- a/dd-java-agent/agent-debugger/debugger-test-scala/gradle.lockfile +++ b/dd-java-agent/agent-debugger/debugger-test-scala/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-debugger:debugger-test-scala:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.eed3si9n:shaded-jawn-parser_2.13:1.3.2=zinc @@ -8,7 +9,7 @@ com.eed3si9n:shaded-scalajson_2.13:1.0.0-M4=zinc com.eed3si9n:sjson-new-core_2.13:0.10.1=zinc com.eed3si9n:sjson-new-scalajson_2.13:0.10.1=zinc com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -19,12 +20,11 @@ com.swoval:file-tree-views:2.1.12=zinc com.thoughtworks.qdox:qdox:1.12.1=codenarc commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs net.bytebuddy:byte-buddy-agent:1.12.8=testRuntimeClasspath net.bytebuddy:byte-buddy:1.12.8=testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.3.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.openhft:zero-allocation-hashing:0.16=zinc net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -49,18 +49,18 @@ org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc org.jline:jline:3.15.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -74,40 +74,43 @@ org.mockito:mockito-core:4.4.0=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=zinc org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-compiler:2.13.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-lang:scala-library:2.13.15=zinc +org.scala-lang:scala-library:2.13.16=zinc org.scala-lang:scala-library:2.13.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-lang:scala-reflect:2.13.15=zinc +org.scala-lang:scala-reflect:2.13.16=zinc org.scala-lang:scala-reflect:2.13.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/agent-debugger/exploration-tests/Dockerfile.exploration-tests b/dd-java-agent/agent-debugger/exploration-tests/Dockerfile.exploration-tests index 7c890262858..ca275269422 100644 --- a/dd-java-agent/agent-debugger/exploration-tests/Dockerfile.exploration-tests +++ b/dd-java-agent/agent-debugger/exploration-tests/Dockerfile.exploration-tests @@ -10,6 +10,7 @@ COPY .sdkmanrc . RUN curl -s "https://get.sdkman.io" | bash RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && \ sdk env install && \ + sdk install java 17.0.10-tem && \ sdk flush" RUN mkdir exploration-tests @@ -30,7 +31,7 @@ RUN cd jackson-core && git apply /exploration-tests/jackson-core_exploration-tes RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && cd jackson-core && mvn verify -DskipTests=true" RUN git clone -b 2.16 https://github.com/FasterXML/jackson-databind.git COPY jackson-databind_exploration-tests.patch . -# fix tests that are failing because too deep recrursion +# fix tests that are failing because too deep recursion RUN cd jackson-databind && git apply /exploration-tests/jackson-databind_exploration-tests.patch RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && cd jackson-databind && mvn verify -DskipTests=true" @@ -42,3 +43,8 @@ RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && cd jackson-databind && m #RUN git clone https://github.com/google/guava.git #RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && cd guava && mvn -B -P!standard-with-extra-repos verify -U -Dmaven.javadoc.skip=true -DskipTests=true" +# okhttp +RUN git clone -b okhttp_5.3.x https://github.com/square/okhttp.git +COPY okhttp_exploration-tests.patch . +RUN cd okhttp && git apply /exploration-tests/okhttp_exploration-tests.patch +RUN bash -c "source $HOME/.sdkman/bin/sdkman-init.sh && sdk use java 17.0.10-tem && cd okhttp && ./gradlew dependencies" diff --git a/dd-java-agent/agent-debugger/exploration-tests/include_okhttp.txt b/dd-java-agent/agent-debugger/exploration-tests/include_okhttp.txt new file mode 100644 index 00000000000..875f907d01b --- /dev/null +++ b/dd-java-agent/agent-debugger/exploration-tests/include_okhttp.txt @@ -0,0 +1 @@ +okhttp3/* diff --git a/dd-java-agent/agent-debugger/exploration-tests/okhttp_exploration-tests.patch b/dd-java-agent/agent-debugger/exploration-tests/okhttp_exploration-tests.patch new file mode 100644 index 00000000000..3d8d0a9aa4a --- /dev/null +++ b/dd-java-agent/agent-debugger/exploration-tests/okhttp_exploration-tests.patch @@ -0,0 +1,86 @@ +diff --git a/okhttp/src/jvmTest/kotlin/okhttp3/FastFallbackTest.kt b/okhttp/src/jvmTest/kotlin/okhttp3/FastFallbackTest.kt +index e50aa9820..f36561b03 100644 +--- a/okhttp/src/jvmTest/kotlin/okhttp3/FastFallbackTest.kt ++++ b/okhttp/src/jvmTest/kotlin/okhttp3/FastFallbackTest.kt +@@ -38,6 +38,7 @@ import okhttp3.internal.http2.ErrorCode + import okhttp3.testing.Flaky + import org.junit.jupiter.api.AfterEach + import org.junit.jupiter.api.BeforeEach ++import org.junit.jupiter.api.Disabled + import org.junit.jupiter.api.Test + import org.junit.jupiter.api.Timeout + import org.junit.jupiter.api.extension.RegisterExtension +@@ -55,6 +56,7 @@ import org.opentest4j.TestAbortedException + * This test only runs on host machines that have both IPv4 and IPv6 addresses for localhost. + */ + @Timeout(30) ++@Disabled + class FastFallbackTest { + @RegisterExtension + val clientTestRule = OkHttpClientTestRule() +diff --git a/okhttp/src/jvmTest/kotlin/okhttp3/InterceptorTest.kt b/okhttp/src/jvmTest/kotlin/okhttp3/InterceptorTest.kt +index 22f1ceaf5..3df72113b 100644 +--- a/okhttp/src/jvmTest/kotlin/okhttp3/InterceptorTest.kt ++++ b/okhttp/src/jvmTest/kotlin/okhttp3/InterceptorTest.kt +@@ -50,6 +50,7 @@ import okio.GzipSink + import okio.Sink + import okio.Source + import okio.buffer ++import org.junit.jupiter.api.Disabled + import org.junit.jupiter.api.Tag + import org.junit.jupiter.api.Test + import org.junit.jupiter.api.extension.RegisterExtension +@@ -608,11 +609,13 @@ class InterceptorTest { + ) + } + ++ @Disabled + @Test + fun applicationInterceptorThrowsRuntimeExceptionAsynchronous() { + interceptorThrowsRuntimeExceptionAsynchronous(false) + } + ++ @Disabled + @Test + fun networkInterceptorThrowsRuntimeExceptionAsynchronous() { + interceptorThrowsRuntimeExceptionAsynchronous(true) +diff --git a/okhttp/src/jvmTest/kotlin/okhttp3/internal/tls/ClientAuthTest.kt b/okhttp/src/jvmTest/kotlin/okhttp3/internal/tls/ClientAuthTest.kt +index d78fd43e1..5a3429050 100644 +--- a/okhttp/src/jvmTest/kotlin/okhttp3/internal/tls/ClientAuthTest.kt ++++ b/okhttp/src/jvmTest/kotlin/okhttp3/internal/tls/ClientAuthTest.kt +@@ -57,6 +57,7 @@ import okhttp3.tls.HeldCertificate + import okhttp3.tls.internal.TlsUtil.newKeyManager + import okhttp3.tls.internal.TlsUtil.newTrustManager + import org.junit.jupiter.api.BeforeEach ++import org.junit.jupiter.api.Disabled + import org.junit.jupiter.api.Tag + import org.junit.jupiter.api.Test + import org.junit.jupiter.api.extension.RegisterExtension +@@ -310,6 +311,7 @@ class ClientAuthTest { + } + } + ++ @Disabled + @Test + fun invalidClientAuthEvents() { + server.enqueue( +diff --git a/okhttp/src/jvmTest/kotlin/okhttp3/internal/ws/WebSocketReaderTest.kt b/okhttp/src/jvmTest/kotlin/okhttp3/internal/ws/WebSocketReaderTest.kt +index d3f264333..22d709282 100644 +--- a/okhttp/src/jvmTest/kotlin/okhttp3/internal/ws/WebSocketReaderTest.kt ++++ b/okhttp/src/jvmTest/kotlin/okhttp3/internal/ws/WebSocketReaderTest.kt +@@ -32,6 +32,7 @@ import okio.ByteString.Companion.decodeHex + import okio.ByteString.Companion.encodeUtf8 + import okio.ByteString.Companion.toByteString + import org.junit.jupiter.api.AfterEach ++import org.junit.jupiter.api.Disabled + import org.junit.jupiter.api.Test + + class WebSocketReaderTest { +@@ -431,6 +432,7 @@ class WebSocketReaderTest { + assertThat(count).isEqualTo(1988) + } + ++ @Disabled + @Test fun clientWithCompressionCannotBeUsedAfterClose() { + data.write("c107f248cdc9c90700".decodeHex()) // Hello + clientReaderWithCompression.processNextFrame() diff --git a/dd-java-agent/agent-debugger/gradle.lockfile b/dd-java-agent/agent-debugger/gradle.lockfile index 8d75bc9581e..9c405706e46 100644 --- a/dd-java-agent/agent-debugger/gradle.lockfile +++ b/dd-java-agent/agent-debugger/gradle.lockfile @@ -1,18 +1,19 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-debugger:dependencies --write-locks antlr:antlr:2.7.7=testRuntimeClasspath -cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath -cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath +cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq.okio:okio:1.17.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:java-dogstatsd-client:4.4.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testRuntimeClasspath +com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.datadoghq.okio:okio:1.17.6=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.datadoghq:java-dogstatsd-client:4.4.5=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-annotations:2.11.3=testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-core:2.11.3=testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-databind:2.11.3=testCompileClasspath,testRuntimeClasspath @@ -21,30 +22,30 @@ com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.3=testCompileClasspa com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.3=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc com.github.jnr:jffi:1.2.23=compileClasspath,testCompileClasspath -com.github.jnr:jffi:1.3.14=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-a64asm:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-a64asm:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.9.17=compileClasspath,testCompileClasspath com.github.jnr:jnr-enxio:0.30=compileClasspath,testCompileClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-ffi:2.1.16=compileClasspath,testCompileClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-posix:3.0.61=compileClasspath,testCompileClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-unixsocket:0.36=compileClasspath,testCompileClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-x86asm:1.0.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-x86asm:1.0.2=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.re2j:re2j:1.7=testRuntimeClasspath -com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath +com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.okhttp3:mockwebserver:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath -com.squareup.okio:okio:1.17.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.okio:okio:1.17.5=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath @@ -57,8 +58,8 @@ io.micrometer:micrometer-observation:1.12.0=testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.12=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=compileClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=compileClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.13.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -73,7 +74,7 @@ org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apache.logging.log4j:log4j-to-slf4j:2.13.3=testCompileClasspath,testRuntimeClasspath org.apache.tomcat.embed:tomcat-embed-core:9.0.39=testCompileClasspath,testRuntimeClasspath org.apache.tomcat.embed:tomcat-embed-websocket:9.0.39=testCompileClasspath,testRuntimeClasspath -org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath +org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath,testFixturesCompileClasspath org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc @@ -90,10 +91,10 @@ org.glassfish:jakarta.el:3.0.3=testCompileClasspath,testRuntimeClasspath org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testCompileClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath org.jetbrains.intellij.deps:trove4j:1.0.20200330=testRuntimeClasspath @@ -111,44 +112,44 @@ org.jetbrains.kotlinx:kotlinx-coroutines-core:1.0.0=testCompileClasspath,testRun org.jetbrains:annotations:13.0=testCompileClasspath,testRuntimeClasspath org.jline:jline:3.22.0=testRuntimeClasspath org.jooq:joor-java-8:0.9.13=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath -org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.14.1=testFixturesRuntimeClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs -org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit:junit-bom:5.14.1=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.mockito:mockito-core:4.4.0=testCompileClasspath,testRuntimeClasspath org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath -org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath +org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:7.1=compileClasspath -org.ow2.asm:asm-analysis:9.7.1=runtimeClasspath +org.ow2.asm:asm-analysis:9.10.1=testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-analysis:9.7.1=runtimeClasspath,testFixturesRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-analysis:9.9.1=testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-commons:9.9.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-commons:9.10.1=compileClasspath,jacocoAnt,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=compileClasspath,jacocoAnt,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:7.1=compileClasspath -org.ow2.asm:asm-util:9.7.1=runtimeClasspath +org.ow2.asm:asm-util:9.10.1=testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testFixturesRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm-util:9.9.1=testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.10.1=compileClasspath,jacocoAnt,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs org.scala-lang:scala-compiler:2.13.11=testRuntimeClasspath org.scala-lang:scala-library:2.13.11=testRuntimeClasspath org.scala-lang:scala-reflect:2.13.11=testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.30=compileClasspath,runtimeClasspath +org.slf4j:slf4j-api:1.7.30=compileClasspath,runtimeClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j -org.snakeyaml:snakeyaml-engine:2.9=runtimeClasspath,testRuntimeClasspath +org.snakeyaml:snakeyaml-engine:2.9=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath org.springframework.boot:spring-boot-autoconfigure:2.3.5.RELEASE=testCompileClasspath,testRuntimeClasspath @@ -174,4 +175,4 @@ org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs org.yaml:snakeyaml:1.26=testCompileClasspath,testRuntimeClasspath -empty=annotationProcessor,shadow,spotbugsPlugins,testAnnotationProcessor +empty=annotationProcessor,shadow,spotbugsPlugins,testAnnotationProcessor,testFixturesAnnotationProcessor diff --git a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/agent/ConfigurationUpdater.java b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/agent/ConfigurationUpdater.java index c392ab3c663..342a47076f7 100644 --- a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/agent/ConfigurationUpdater.java +++ b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/agent/ConfigurationUpdater.java @@ -15,6 +15,7 @@ import datadog.environment.JavaVirtualMachine; import datadog.logging.RatelimitedLogger; import datadog.trace.api.Config; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.bootstrap.debugger.DebuggerContext; import datadog.trace.bootstrap.debugger.ProbeId; import datadog.trace.bootstrap.debugger.ProbeImplementation; @@ -40,6 +41,7 @@ import java.util.concurrent.TimeUnit; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; +import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; import java.util.stream.Collectors; @@ -55,6 +57,8 @@ public class ConfigurationUpdater implements DebuggerContext.ProbeResolver, Conf private static final int MINUTES_BETWEEN_ERROR_LOG = 5; private static final boolean JAVA_AT_LEAST_19 = JavaVirtualMachine.isJavaVersionAtLeast(19); private static final boolean JAVA_AT_LEAST_16 = JavaVirtualMachine.isJavaVersionAtLeast(16); + private static final boolean JAVA_AT_LEAST_25_0_4 = + JavaVirtualMachine.isJavaVersionAtLeast(25, 0, 4); private static final Method GET_RECORD_COMPONENTS_METHOD; private static final Method GET_ANNOTATED_TYPES_METHOD; @@ -93,6 +97,7 @@ DebuggerTransformer supply( private volatile Configuration currentConfiguration; private DebuggerTransformer currentTransformer; private final ProbeMetadata probeMetadata = new ProbeMetadata(); + private final Config config; private final DebuggerSink sink; private final ClassesToRetransformFinder finder; private final String serviceName; @@ -110,6 +115,7 @@ public ConfigurationUpdater( this.instrumentation = instrumentation; this.transformerSupplier = transformerSupplier; this.serviceName = TagsHelper.sanitize(config.getServiceName()); + this.config = config; this.sink = sink; this.finder = finder; } @@ -209,8 +215,12 @@ private void handleProbesChanges(ConfigurationComparer changes, Configuration ne } List> changedClasses = finder.getAllLoadedChangedClasses(instrumentation.getAllLoadedClasses(), changes); - changedClasses = detectMethodParameters(changes, changedClasses); - changedClasses = detectRecordWithTypeAnnotation(changes, changedClasses); + changedClasses = + JDKVersionSpecificHelper.detectMethodParameters( + errorMsg -> reportError(changes, errorMsg), instrumentation, changedClasses); + changedClasses = + JDKVersionSpecificHelper.detectRecordWithTypeAnnotation( + errorMsg -> reportError(changes, errorMsg), changedClasses); retransformClasses(changedClasses); // ensures that we have at least re-transformed 1 class if (changedClasses.size() > 0) { @@ -218,122 +228,6 @@ private void handleProbesChanges(ConfigurationComparer changes, Configuration ne } } - /* - * Because of this bug (https://bugs.openjdk.org/browse/JDK-8240908), classes compiled with - * method parameters (javac -parameters) strip this attribute once retransformed - * Spring 6/Spring boot 3 rely exclusively on this attribute and may throw an exception - * if no attribute found. - */ - private List> detectMethodParameters( - ConfigurationComparer changes, List> changedClasses) { - if (JAVA_AT_LEAST_19) { - // bug is fixed since JDK19, no need to perform detection - return changedClasses; - } - List> result = new ArrayList<>(); - for (Class changedClass : changedClasses) { - boolean addClass = true; - try { - Method[] declaredMethods = changedClass.getDeclaredMethods(); - // capping scanning of methods to 100 to avoid generated class with thousand of methods - // assuming that in those first 100 methods there is at least one with at least one - // parameter - for (int methodIdx = 0; - methodIdx < declaredMethods.length && methodIdx < 100; - methodIdx++) { - Method method = declaredMethods[methodIdx]; - Parameter[] parameters = method.getParameters(); - if (parameters.length == 0) { - continue; - } - if (parameters[0].isNamePresent()) { - if (!SpringHelper.isSpringUsingOnlyMethodParameters(instrumentation)) { - return changedClasses; - } - LOGGER.debug( - "Detecting method parameter: method={} param={}, Skipping retransforming this class", - method.getName(), - parameters[0].getName()); - // skip the class: compiled with -parameters - reportError( - changes, - "Method Parameters detected, instrumentation not supported for " - + changedClass.getTypeName()); - addClass = false; - } - // we found at leat a method with one parameter if name is not present we can stop there - break; - } - } catch (Exception e) { - LOGGER.debug("Exception scanning method parameters", e); - } - if (addClass) { - result.add(changedClass); - } - } - return result; - } - - private List> detectRecordWithTypeAnnotation( - ConfigurationComparer changes, List> changedClasses) { - if (!JAVA_AT_LEAST_16) { - // records introduced in JDK 16 (final version) - return changedClasses; - } - List> result = new ArrayList<>(); - for (Class changedClass : changedClasses) { - boolean addClass = true; - try { - if (changedClass.getSuperclass() != null - && changedClass.getSuperclass().getTypeName().equals("java.lang.Record") - && Modifier.isFinal(changedClass.getModifiers())) { - if (hasTypeAnnotationOnRecordComponent(changedClass)) { - LOGGER.debug( - "Record with type annotation detected, instrumentation not supported for {}", - changedClass.getTypeName()); - reportError( - changes, - "Record with type annotation detected, instrumentation not supported for " - + changedClass.getTypeName()); - addClass = false; - } - } - } catch (Exception e) { - LOGGER.debug("Exception detecting record with type annotation", e); - } - if (addClass) { - result.add(changedClass); - } - } - return result; - } - - private boolean hasTypeAnnotationOnRecordComponent(Class recordClass) { - if (GET_RECORD_COMPONENTS_METHOD == null || GET_ANNOTATED_TYPES_METHOD == null) { - return false; - } - try { - Object recordComponentsArray = GET_RECORD_COMPONENTS_METHOD.invoke(recordClass); - int len = Array.getLength(recordComponentsArray); - for (int i = 0; i < len; i++) { - Object recordComponent = Array.get(recordComponentsArray, i); - AnnotatedType annotatedType = - (AnnotatedType) GET_ANNOTATED_TYPES_METHOD.invoke(recordComponent); - for (Annotation annotation : annotatedType.getAnnotations()) { - Target annotationTarget = annotation.annotationType().getAnnotation(Target.class); - if (annotationTarget != null - && Arrays.stream(annotationTarget.value()) - .anyMatch(it -> it == ElementType.TYPE_USE)) { - return true; - } - } - } - return false; - } catch (Exception ex) { - return false; - } - } - private void reportReceived(ConfigurationComparer changes) { for (ProbeDefinition def : changes.getAddedDefinitions()) { if (def instanceof ExceptionProbe) { @@ -365,11 +259,7 @@ private void installNewDefinitions(Configuration newConfiguration) { // install new probe definitions DebuggerTransformer newTransformer = transformerSupplier.supply( - Config.get(), - newConfiguration, - this::recordInstrumentationProgress, - probeMetadata, - sink); + config, newConfiguration, this::recordInstrumentationProgress, probeMetadata, sink); instrumentation.addTransformer(newTransformer, true); currentTransformer = newTransformer; LOGGER.debug("New transformer installed with probes: {}", newConfiguration.getDefinitions()); @@ -445,7 +335,7 @@ private void removeCurrentTransformer() { currentTransformer = null; } - // only visible for tests + @VisibleForTesting Map getAppliedDefinitions() { if (currentTransformer == null) { return Collections.emptyMap(); @@ -460,4 +350,124 @@ Map getAppliedDefinitions() { Map getInstrumentationResults() { return instrumentationResults; } + + private static class JDKVersionSpecificHelper { + + public static List> detectRecordWithTypeAnnotation( + Consumer reportError, List> changedClasses) { + if (!JAVA_AT_LEAST_16 || JAVA_AT_LEAST_25_0_4) { + // records introduced in JDK 16 (final version) + // JDK-8376185 fixed since JDK 25.0.4 + return changedClasses; + } + List> result = new ArrayList<>(); + for (Class changedClass : changedClasses) { + boolean addClass = true; + try { + if (changedClass.getSuperclass() != null + && changedClass.getSuperclass().getTypeName().equals("java.lang.Record") + && Modifier.isFinal(changedClass.getModifiers())) { + if (hasTypeAnnotationOnRecordComponent(changedClass)) { + LOGGER.debug( + "Record with type annotation detected, instrumentation not supported for {}", + changedClass.getTypeName()); + reportError.accept( + "Record with type annotation detected, instrumentation not supported for " + + changedClass.getTypeName()); + addClass = false; + } + } + } catch (Exception e) { + LOGGER.debug("Exception detecting record with type annotation", e); + } + if (addClass) { + result.add(changedClass); + } + } + return result; + } + + private static boolean hasTypeAnnotationOnRecordComponent(Class recordClass) { + if (GET_RECORD_COMPONENTS_METHOD == null || GET_ANNOTATED_TYPES_METHOD == null) { + return false; + } + try { + Object recordComponentsArray = GET_RECORD_COMPONENTS_METHOD.invoke(recordClass); + int len = Array.getLength(recordComponentsArray); + for (int i = 0; i < len; i++) { + Object recordComponent = Array.get(recordComponentsArray, i); + AnnotatedType annotatedType = + (AnnotatedType) GET_ANNOTATED_TYPES_METHOD.invoke(recordComponent); + for (Annotation annotation : annotatedType.getAnnotations()) { + Target annotationTarget = annotation.annotationType().getAnnotation(Target.class); + if (annotationTarget != null + && Arrays.stream(annotationTarget.value()) + .anyMatch(it -> it == ElementType.TYPE_USE)) { + return true; + } + } + } + return false; + } catch (Exception ex) { + return false; + } + } + + /* + * Because of this bug (https://bugs.openjdk.org/browse/JDK-8240908), classes compiled with + * method parameters (javac -parameters) strip this attribute once retransformed + * Spring 6/Spring boot 3 rely exclusively on this attribute and may throw an exception + * if no attribute found. + */ + public static List> detectMethodParameters( + Consumer reportError, + Instrumentation instrumentation, + List> changedClasses) { + if (JAVA_AT_LEAST_19) { + // bug is fixed since JDK19, no need to perform detection + return changedClasses; + } + List> result = new ArrayList<>(); + for (Class changedClass : changedClasses) { + boolean addClass = true; + try { + Method[] declaredMethods = changedClass.getDeclaredMethods(); + // capping scanning of methods to 100 to avoid generated class with thousand of methods + // assuming that in those first 100 methods there is at least one with at least one + // parameter + for (int methodIdx = 0; + methodIdx < declaredMethods.length && methodIdx < 100; + methodIdx++) { + Method method = declaredMethods[methodIdx]; + Parameter[] parameters = method.getParameters(); + if (parameters.length == 0) { + continue; + } + if (parameters[0].isNamePresent()) { + if (!SpringHelper.isSpringUsingOnlyMethodParameters(instrumentation)) { + return changedClasses; + } + LOGGER.debug( + "Detecting method parameter: method={} param={}, Skipping retransforming this class", + method.getName(), + parameters[0].getName()); + // skip the class: compiled with -parameters + reportError.accept( + "Method Parameters detected, instrumentation not supported for " + + changedClass.getTypeName()); + addClass = false; + } + // we found at leat a method with one parameter if name is not present we can stop there + break; + } + } catch (Exception e) { + LOGGER.debug("Exception scanning method parameters", e); + } + if (addClass) { + result.add(changedClass); + } + } + return result; + } + } } diff --git a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/agent/DebuggerTracer.java b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/agent/DebuggerTracer.java index 92df0d5a654..a00a93d268e 100644 --- a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/agent/DebuggerTracer.java +++ b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/agent/DebuggerTracer.java @@ -25,7 +25,10 @@ public DebuggerSpan createSpan(String encodedProbeId, String resourceName, Strin return DebuggerSpan.NOOP_SPAN; } AgentSpan dynamicSpan = - tracerAPI.buildSpan(OPERATION_NAME).withResourceName(resourceName).start(); + tracerAPI + .buildSpan("dynamic-instrumentation", OPERATION_NAME) + .withResourceName(resourceName) + .start(); if (tags != null) { for (String tag : tags) { int idx = tag.indexOf(':'); diff --git a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/agent/DebuggerTransformer.java b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/agent/DebuggerTransformer.java index 3f883b0bba2..a4bb42a6cd5 100644 --- a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/agent/DebuggerTransformer.java +++ b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/agent/DebuggerTransformer.java @@ -95,6 +95,8 @@ public class DebuggerTransformer implements ClassFileTransformer { SpanProbe.class); private static final String JAVA_IO_TMPDIR = "java.io.tmpdir"; private static final boolean JAVA_AT_LEAST_19 = JavaVirtualMachine.isJavaVersionAtLeast(19); + private static final boolean JAVA_AT_LEAST_25_0_4 = + JavaVirtualMachine.isJavaVersionAtLeast(25, 0, 4); public static Path DUMP_PATH = Paths.get(SystemProperties.get(JAVA_IO_TMPDIR), "debugger"); private static final String[] SKIPPED_PACKAGES = new String[] { @@ -353,6 +355,9 @@ private boolean checkMethodParameters( */ private boolean checkRecordTypeAnnotation( ClassNode classNode, List definitions, String fullyQualifiedClassName) { + if (JAVA_AT_LEAST_25_0_4) { + return true; + } if (!ASMHelper.isRecord(classNode)) { return true; } diff --git a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/agent/JsonSnapshotSerializer.java b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/agent/JsonSnapshotSerializer.java index f3971f0d331..4acfef797f9 100644 --- a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/agent/JsonSnapshotSerializer.java +++ b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/agent/JsonSnapshotSerializer.java @@ -10,14 +10,12 @@ import datadog.trace.bootstrap.debugger.CapturedContext; import datadog.trace.bootstrap.debugger.DebuggerContext; import java.time.Duration; -import java.time.temporal.ChronoUnit; /** Serializes snapshots in Json using Moshi */ public class JsonSnapshotSerializer implements DebuggerContext.ValueSerializer { private static final JsonAdapter ADAPTER = MoshiHelper.createMoshiSnapshot( - Duration.of( - Config.get().getDynamicInstrumentationCaptureTimeout(), ChronoUnit.MILLIS)) + Duration.ofMillis(Config.get().getDynamicInstrumentationCaptureTimeout())) .adapter(IntakeRequest.class); private static final JsonAdapter VALUE_ADAPTER = new MoshiSnapshotHelper.CapturedValueAdapter(); diff --git a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/agent/StringTemplateBuilder.java b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/agent/StringTemplateBuilder.java index 8bd75149e39..cb06f95958e 100644 --- a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/agent/StringTemplateBuilder.java +++ b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/agent/StringTemplateBuilder.java @@ -7,10 +7,13 @@ import com.datadog.debugger.el.Value; import com.datadog.debugger.el.ValueScript; import com.datadog.debugger.probe.LogProbe; +import datadog.trace.api.Config; import datadog.trace.bootstrap.debugger.CapturedContext; import datadog.trace.bootstrap.debugger.EvaluationError; import datadog.trace.bootstrap.debugger.Limits; import datadog.trace.bootstrap.debugger.util.Redaction; +import datadog.trace.bootstrap.debugger.util.TimeoutChecker; +import java.time.Duration; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -26,10 +29,12 @@ public class StringTemplateBuilder { private final List segments; private final Limits limits; + private final Duration timeout; - public StringTemplateBuilder(List segments, Limits limits) { + public StringTemplateBuilder(List segments, Limits limits, Duration timeout) { this.segments = segments; this.limits = limits; + this.timeout = timeout; } public String evaluate(CapturedContext context, LogProbe.LogStatus status) { @@ -37,6 +42,8 @@ public String evaluate(CapturedContext context, LogProbe.LogStatus status) { return null; } StringBuilder sb = new StringBuilder(); + // Only one timeout for all expressions + TimeoutChecker timeoutChecker = TimeoutChecker.create(Config.get(), timeout); for (LogProbe.Segment segment : segments) { ValueScript parsedExr = segment.getParsedExpr(); if (segment.getStr() != null) { @@ -44,7 +51,7 @@ public String evaluate(CapturedContext context, LogProbe.LogStatus status) { } else { if (parsedExr != null) { try { - Value result = parsedExr.execute(context); + Value result = parsedExr.execute(context, timeoutChecker); if (result.isUndefined()) { sb.append(result.getValue()); } else if (result.isNull()) { diff --git a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/exception/AbstractExceptionDebugger.java b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/exception/AbstractExceptionDebugger.java index fe789d43329..26b9973fd8c 100644 --- a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/exception/AbstractExceptionDebugger.java +++ b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/exception/AbstractExceptionDebugger.java @@ -197,6 +197,10 @@ private static boolean sanityCheckSnapshotAssignment( Snapshot snapshot, StackTraceElement[] innerTrace, int currentIdx) { String className = snapshot.getProbe().getLocation().getType(); String methodName = snapshot.getProbe().getLocation().getMethod(); + if (innerTrace.length == 0) { + LOGGER.debug("innerTrace is empty"); + return false; + } if (currentIdx < 0 || currentIdx >= innerTrace.length) { LOGGER.warn( "currentIdx={} out of bounds of innerTrace array length={}", diff --git a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/exception/ExceptionProbeManager.java b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/exception/ExceptionProbeManager.java index 3aeb7d05237..71b80c1d02f 100644 --- a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/exception/ExceptionProbeManager.java +++ b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/exception/ExceptionProbeManager.java @@ -197,10 +197,6 @@ public List getSnapshots() { return snapshots; } - public boolean isSampling() { - return !snapshots.isEmpty(); - } - public void addSnapshot(Snapshot snapshot) { snapshots.add(snapshot); } diff --git a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/instrumentation/CapturedContextInstrumenter.java b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/instrumentation/CapturedContextInstrumenter.java index f51ea26dac1..5cbbfedb083 100644 --- a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/instrumentation/CapturedContextInstrumenter.java +++ b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/instrumentation/CapturedContextInstrumenter.java @@ -40,6 +40,7 @@ import java.util.Collection; import java.util.Collections; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.stream.Collectors; import org.objectweb.asm.Opcodes; @@ -58,6 +59,8 @@ import org.objectweb.asm.tree.TryCatchBlockNode; import org.objectweb.asm.tree.TypeInsnNode; import org.objectweb.asm.tree.VarInsnNode; +import org.objectweb.asm.tree.analysis.BasicValue; +import org.objectweb.asm.tree.analysis.Frame; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -71,7 +74,7 @@ public class CapturedContextInstrumenter extends Instrumenter { private int exitContextVar = -1; private int timestampStartVar = -1; private int throwableListVar = -1; - private Collection hoistedLocalVars = Collections.emptyList(); + protected Collection hoistedLocalVars = Collections.emptyList(); public CapturedContextInstrumenter( ProbeDefinition definition, @@ -96,9 +99,10 @@ public InstrumentationResult.Status instrument() { installFinallyBlocks(); return InstrumentationResult.Status.INSTALLED; } + Map> frames = computeFrames(classNode.name, methodNode); instrumentMethodEnter(); instrumentTryCatchHandlers(); - processInstructions(); + processInstructions(frames); addFinallyHandler(contextInitLabel, returnHandlerLabel); installFinallyBlocks(); return InstrumentationResult.Status.INSTALLED; @@ -265,7 +269,8 @@ private boolean isExceptionLocalDeclared(TryCatchBlockNode catchHandler, MethodN } @Override - protected InsnList getBeforeReturnInsnList(AbstractInsnNode node) { + protected InsnList getBeforeReturnInsnList( + AbstractInsnNode node, Map> frames) { InsnList insnList = new InsnList(); // stack [ret_value] insnList.add(new VarInsnNode(Opcodes.ALOAD, entryContextVar)); @@ -465,7 +470,7 @@ protected void addIsReadyToCaptureCall(InsnList insnList) { // Initialize and hoist local variables to the top of the method // if there is name/slot conflict, do nothing for the conflicting local variable - private Collection initAndHoistLocalVars(MethodNode methodNode) { + protected Collection initAndHoistLocalVars(MethodNode methodNode) { int hoistingLevel = Config.get().getDynamicInstrumentationLocalVarHoistingLevel(); if (hoistingLevel == 0 || language != JvmLanguage.JAVA) { // for now, only hoist local vars for Java diff --git a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/instrumentation/ExceptionInstrumenter.java b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/instrumentation/ExceptionInstrumenter.java index bfc056e0de3..34c9e0cd1ca 100644 --- a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/instrumentation/ExceptionInstrumenter.java +++ b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/instrumentation/ExceptionInstrumenter.java @@ -3,8 +3,11 @@ import com.datadog.debugger.probe.ProbeDefinition; import datadog.trace.bootstrap.debugger.Limits; import java.util.List; +import java.util.Map; import org.objectweb.asm.tree.AbstractInsnNode; import org.objectweb.asm.tree.InsnList; +import org.objectweb.asm.tree.analysis.BasicValue; +import org.objectweb.asm.tree.analysis.Frame; public class ExceptionInstrumenter extends CapturedContextInstrumenter { @@ -18,14 +21,20 @@ public ExceptionInstrumenter( @Override public InstrumentationResult.Status instrument() { - processInstructions(); // fill returnHandlerLabel + // hoisting is required because exception instrumentation is wrapping the whole method body in + // a try/catch that create a subscobe and even level method local vars are not accessible + // in the catch clause for capture + hoistedLocalVars = initAndHoistLocalVars(methodNode); + Map> frames = computeFrames(classNode.name, methodNode); + processInstructions(frames); // fill returnHandlerLabel addFinallyHandler(methodEnterLabel, returnHandlerLabel); installFinallyBlocks(); return InstrumentationResult.Status.INSTALLED; } @Override - protected InsnList getBeforeReturnInsnList(AbstractInsnNode node) { + protected InsnList getBeforeReturnInsnList( + AbstractInsnNode node, Map> frames) { return null; } diff --git a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/instrumentation/Instrumenter.java b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/instrumentation/Instrumenter.java index 67146ec6561..a1549bac9a5 100644 --- a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/instrumentation/Instrumenter.java +++ b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/instrumentation/Instrumenter.java @@ -13,6 +13,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; +import java.util.IdentityHashMap; import java.util.List; import java.util.Map; import org.objectweb.asm.Opcodes; @@ -28,9 +29,17 @@ import org.objectweb.asm.tree.MethodNode; import org.objectweb.asm.tree.TryCatchBlockNode; import org.objectweb.asm.tree.TypeInsnNode; +import org.objectweb.asm.tree.analysis.Analyzer; +import org.objectweb.asm.tree.analysis.AnalyzerException; +import org.objectweb.asm.tree.analysis.BasicInterpreter; +import org.objectweb.asm.tree.analysis.BasicValue; +import org.objectweb.asm.tree.analysis.Frame; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; /** Common class for generating instrumentation */ public abstract class Instrumenter { + private static final Logger LOGGER = LoggerFactory.getLogger(Instrumenter.class); protected static final String CONSTRUCTOR_NAME = ""; protected static final String PROBEID_TAG_NAME = "debugger.probeid"; @@ -150,13 +159,13 @@ private AbstractInsnNode findFirstInsnForConstructor(AbstractInsnNode first) { return lastInvokeSpecial; } - protected void processInstructions() { + protected void processInstructions(Map> frames) { AbstractInsnNode node = methodNode.instructions.getFirst(); LabelNode sentinelNode = new LabelNode(); methodNode.instructions.add(sentinelNode); while (node != null && !node.equals(sentinelNode)) { if (node.getType() != AbstractInsnNode.LINE) { - node = processInstruction(node); + node = processInstruction(node, frames); } node = node.getNext(); } @@ -168,7 +177,47 @@ protected void processInstructions() { } } - protected AbstractInsnNode processInstruction(AbstractInsnNode node) { + // returns the extra values sitting *below* `valuesToKeep` values already + // accounted for at the top of the stack (e.g. the return value), as POP/POP2 insns + protected InsnList stackCleanupInsnList( + AbstractInsnNode node, int valuesToKeep, Map> frames) { + InsnList result = new InsnList(); + Frame frame = frames.get(node); + if (frame == null) { + return result; + } + for (int i = frame.getStackSize() - valuesToKeep - 1; i >= 0; i--) { + BasicValue value = frame.getStack(i); + result.add(new InsnNode(value.getSize() == 2 ? Opcodes.POP2 : Opcodes.POP)); + } + return result; + } + + protected static Map> computeFrames( + String owner, MethodNode methodNode) { + Map> frames = new IdentityHashMap<>(); + try { + Frame[] frameArray = + new Analyzer<>(new BasicInterpreter()).analyze(owner, methodNode); + AbstractInsnNode current = methodNode.instructions.getFirst(); + int idx = 0; + while (current != null) { + frames.put(current, frameArray[idx++]); + current = current.getNext(); + } + } catch (AnalyzerException ex) { + LOGGER.debug( + "Failed to analyze method[{}::{}{}] instructions", + owner, + methodNode.name, + methodNode.desc, + ex); + } + return frames; + } + + protected AbstractInsnNode processInstruction( + AbstractInsnNode node, Map> frames) { switch (node.getOpcode()) { case Opcodes.RET: case Opcodes.RETURN: @@ -179,7 +228,7 @@ protected AbstractInsnNode processInstruction(AbstractInsnNode node) { case Opcodes.ARETURN: { // stack [ret_value] - InsnList beforeReturnInsnList = getBeforeReturnInsnList(node); + InsnList beforeReturnInsnList = getBeforeReturnInsnList(node, frames); if (beforeReturnInsnList != null) { methodNode.instructions.insertBefore(node, beforeReturnInsnList); } @@ -193,7 +242,8 @@ protected AbstractInsnNode processInstruction(AbstractInsnNode node) { return node; } - protected InsnList getBeforeReturnInsnList(AbstractInsnNode node) { + protected InsnList getBeforeReturnInsnList( + AbstractInsnNode node, Map> frames) { return null; } diff --git a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/instrumentation/MetricInstrumenter.java b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/instrumentation/MetricInstrumenter.java index a3c02a4f365..d08e8eb1874 100644 --- a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/instrumentation/MetricInstrumenter.java +++ b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/instrumentation/MetricInstrumenter.java @@ -56,6 +56,7 @@ import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; +import java.util.Map; import java.util.stream.Collectors; import org.objectweb.asm.Opcodes; import org.objectweb.asm.Type; @@ -71,6 +72,8 @@ import org.objectweb.asm.tree.TryCatchBlockNode; import org.objectweb.asm.tree.TypeInsnNode; import org.objectweb.asm.tree.VarInsnNode; +import org.objectweb.asm.tree.analysis.BasicValue; +import org.objectweb.asm.tree.analysis.Frame; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -108,7 +111,9 @@ public InstrumentationResult.Status instrument() { } case EXIT: { - processInstructions(); + Map> frames = + computeFrames(classNode.name, methodNode); + processInstructions(frames); addFinallyHandler(returnHandlerLabel); installFinallyBlocks(); break; @@ -158,7 +163,8 @@ private InsnList wrapTryCatch(InsnList insnList) { } @Override - protected InsnList getBeforeReturnInsnList(AbstractInsnNode node) { + protected InsnList getBeforeReturnInsnList( + AbstractInsnNode node, Map> frames) { int size = 1; int storeOpCode = 0; int loadOpCode = 0; @@ -166,7 +172,9 @@ protected InsnList getBeforeReturnInsnList(AbstractInsnNode node) { switch (node.getOpcode()) { case Opcodes.RET: case Opcodes.RETURN: - return wrapTryCatch(callMetric(metricProbe, node)); + InsnList insnList = wrapTryCatch(callMetric(metricProbe, node)); + insnList.insert(stackCleanupInsnList(node, 0, frames)); // void return: nothing to keep + return insnList; case Opcodes.LRETURN: storeOpCode = Opcodes.LSTORE; loadOpCode = Opcodes.LLOAD; @@ -202,7 +210,10 @@ protected InsnList getBeforeReturnInsnList(AbstractInsnNode node) { wrapTryCatch( callMetric(metricProbe, node, new ReturnContext(tmpIdx, loadOpCode, returnType))); // store return value from the stack to local before wrapped call - insnList.insert(new VarInsnNode(storeOpCode, tmpIdx)); + InsnList prefixInsns = new InsnList(); + prefixInsns.add(new VarInsnNode(storeOpCode, tmpIdx)); + prefixInsns.add(stackCleanupInsnList(node, 1, frames)); // keep 1 value (the one we just stored) + insnList.insert(prefixInsns); // restore return value to the stack after wrapped call insnList.add(new VarInsnNode(loadOpCode, tmpIdx)); return insnList; diff --git a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/instrumentation/SpanInstrumenter.java b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/instrumentation/SpanInstrumenter.java index 2bb9a21f3c1..b50eedfec1d 100644 --- a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/instrumentation/SpanInstrumenter.java +++ b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/instrumentation/SpanInstrumenter.java @@ -13,13 +13,17 @@ import com.datadog.debugger.probe.Where; import com.datadog.debugger.util.ClassFileLines; import java.util.List; +import java.util.Map; import org.objectweb.asm.Opcodes; import org.objectweb.asm.Type; +import org.objectweb.asm.tree.AbstractInsnNode; import org.objectweb.asm.tree.InsnList; import org.objectweb.asm.tree.InsnNode; import org.objectweb.asm.tree.LabelNode; import org.objectweb.asm.tree.TryCatchBlockNode; import org.objectweb.asm.tree.VarInsnNode; +import org.objectweb.asm.tree.analysis.BasicValue; +import org.objectweb.asm.tree.analysis.Frame; public class SpanInstrumenter extends Instrumenter { private int spanVar; @@ -38,7 +42,8 @@ public InstrumentationResult.Status instrument() { return addRangeSpan(classFileLines); } spanVar = newVar(DEBUGGER_SPAN_TYPE); - processInstructions(); + Map> frames = computeFrames(classNode.name, methodNode); + processInstructions(frames); LabelNode initSpanLabel = new LabelNode(); InsnList insnList = createSpan(initSpanLabel); LabelNode endLabel = new LabelNode(); diff --git a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/probe/ExceptionProbe.java b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/probe/ExceptionProbe.java index c1e2b67ca8a..50eeaa1b230 100644 --- a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/probe/ExceptionProbe.java +++ b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/probe/ExceptionProbe.java @@ -12,12 +12,14 @@ import com.datadog.debugger.instrumentation.InstrumentationResult; import com.datadog.debugger.instrumentation.MethodInfo; import com.datadog.debugger.sink.Snapshot; +import datadog.trace.api.Config; import datadog.trace.bootstrap.debugger.CapturedContext; import datadog.trace.bootstrap.debugger.MethodLocation; import datadog.trace.bootstrap.debugger.ProbeId; import datadog.trace.bootstrap.debugger.ProbeImplementation; import datadog.trace.bootstrap.debugger.ProbeLocation; import datadog.trace.bootstrap.debugger.el.ValueReferences; +import java.time.Duration; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -47,7 +49,8 @@ public ExceptionProbe( new ProbeCondition(DSL.when(DSL.TRUE), "true"), capture, sampling, - null); + null, + Duration.ofMillis(Config.get().getDynamicInstrumentationEvalTimeout())); this.exceptionProbeManager = exceptionProbeManager; this.chainedExceptionIdx = chainedExceptionIdx; initSamplers(); @@ -101,6 +104,10 @@ public void evaluate( } String fingerprint = Fingerprinter.fingerprint(innerMostThrowable, exceptionProbeManager.getClassNameFilter()); + if (fingerprint == null) { + // Fingerprinter.fingerprint already logged why in debug + return; + } if (exceptionProbeManager.shouldCaptureException(fingerprint)) { LOGGER.debug("Capturing exception matching fingerprint: {}", fingerprint); // capture only on uncaught exception matching the fingerprint @@ -108,7 +115,7 @@ public void evaluate( exceptionProbeManager.getStateByThrowable(innerMostThrowable); if (state != null) { // Already unwinding the exception - if (!state.isSampling()) { + if (state.getSnapshots().isEmpty()) { // skip snapshot because no snapshot from previous stack level return; } diff --git a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/probe/LogProbe.java b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/probe/LogProbe.java index 5647cb371b1..9695e511520 100644 --- a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/probe/LogProbe.java +++ b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/probe/LogProbe.java @@ -44,7 +44,6 @@ import de.thetaphi.forbiddenapis.SuppressForbidden; import java.io.IOException; import java.time.Duration; -import java.time.temporal.ChronoUnit; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; @@ -326,6 +325,7 @@ public String toString() { Collections.synchronizedMap(new WeakIdentityHashMap<>()); protected transient Sampler sampler; protected transient Sampler errorSampler; + protected final transient Duration evalTimeout; // no-arg constructor is required by Moshi to avoid creating instance with unsafe and by-passing // constructors, including field initializers. @@ -342,7 +342,8 @@ public LogProbe() { null, null, null, - null); + null, + Duration.ofMillis(Config.get().getDynamicInstrumentationEvalTimeout())); } public LogProbe( @@ -357,7 +358,8 @@ public LogProbe( ProbeCondition probeCondition, Capture capture, Sampling sampling, - List captureExpressions) { + List captureExpressions, + Duration evalTimeout) { this( language, probeId, @@ -370,7 +372,8 @@ public LogProbe( probeCondition, capture, sampling, - captureExpressions); + captureExpressions, + evalTimeout); } private LogProbe( @@ -385,7 +388,8 @@ private LogProbe( ProbeCondition probeCondition, Capture capture, Sampling sampling, - List captureExpressions) { + List captureExpressions, + Duration evalTimeout) { super(language, probeId, tags, where, evaluateAt); this.template = template; this.segments = segments; @@ -394,6 +398,7 @@ private LogProbe( this.capture = capture; this.sampling = sampling; this.captureExpressions = captureExpressions; + this.evalTimeout = evalTimeout; } public LogProbe(LogProbe.Builder builder) { @@ -409,7 +414,8 @@ public LogProbe(LogProbe.Builder builder) { builder.probeCondition, builder.capture, builder.sampling, - builder.captureExpressions); + builder.captureExpressions, + builder.evalTimeout); this.snapshotProcessor = builder.snapshotProcessor; initSamplers(); } @@ -427,7 +433,8 @@ public LogProbe copy() { probeCondition, capture, sampling, - captureExpressions); + captureExpressions, + evalTimeout); } public String getTemplate() { @@ -458,7 +465,7 @@ public void initSamplers() { double rate = sampling != null ? sampling.getEventsPerSecond() - : (isCaptureSnapshot() + : (isFullSnapshot() ? ProbeRateLimiter.DEFAULT_SNAPSHOT_RATE : ProbeRateLimiter.DEFAULT_LOG_RATE); sampler = ProbeRateLimiter.createSampler(rate); @@ -502,7 +509,7 @@ public InstrumentationResult.Status instrument( public boolean isReadyToCapture() { if (!hasCondition()) { // we are sampling here to avoid creating CapturedContext when the sampling result is negative - return ProbeRateLimiter.tryProbe(sampler, isCaptureSnapshot()); + return ProbeRateLimiter.tryProbe(sampler, isFullSnapshot()); } return true; } @@ -548,7 +555,8 @@ private void processMsgTemplate(CapturedContext context, LogStatus logStatus) { if (!logStatus.isSampled() || !logStatus.getCondition()) { return; } - StringTemplateBuilder logMessageBuilder = new StringTemplateBuilder(segments, LIMITS); + StringTemplateBuilder logMessageBuilder = + new StringTemplateBuilder(segments, LIMITS, evalTimeout); String msg = logMessageBuilder.evaluate(context, logStatus); if (msg != null && msg.length() > LOG_MSG_LIMIT) { StringBuilder sb = new StringBuilder(LOG_MSG_LIMIT + 3); @@ -570,10 +578,10 @@ private void sample(LogStatus logStatus, MethodLocation methodLocation) { // if condition has error and no capture Snapshot, the error is reported using errorSampler // at 1/s rate instead of the log template one Sampler localSampler = - logStatus.hasConditionErrors && !isCaptureSnapshot() ? errorSampler : sampler; + logStatus.hasConditionErrors && !isFullSnapshot() ? errorSampler : sampler; boolean sampled = !logStatus.getDebugSessionStatus().isDisabled() - && ProbeRateLimiter.tryProbe(localSampler, isCaptureSnapshot()); + && ProbeRateLimiter.tryProbe(localSampler, isFullSnapshot()); logStatus.setSampled(sampled); if (!sampled) { DebuggerAgent.getSink() @@ -590,7 +598,9 @@ private boolean evaluateCondition(CapturedContext capture, LogStatus status) { return true; } try { - if (!probeCondition.execute(capture)) { + Duration timeout = Duration.ofMillis(Config.get().getDynamicInstrumentationEvalTimeout()); + TimeoutChecker timeoutChecker = TimeoutChecker.create(Config.get(), timeout); + if (!probeCondition.execute(capture, timeoutChecker)) { return false; } } catch (EvaluationException ex) { @@ -720,7 +730,9 @@ private void processCaptureExpressions(CapturedContext context, LogStatus logSta } for (CaptureExpression captureExpression : captureExpressions) { try { - Value result = captureExpression.expr.execute(context); + Duration timeout = Duration.ofMillis(Config.get().getDynamicInstrumentationEvalTimeout()); + TimeoutChecker timeoutChecker = TimeoutChecker.create(Config.get(), timeout); + Value result = captureExpression.expr.execute(context, timeoutChecker); if (result.isUndefined()) { throw new EvaluationException("UNDEFINED", captureExpression.getExpr().getDsl()); } @@ -822,6 +834,13 @@ public void commit(CapturedContext lineContext, int line) { Snapshot snapshot = createSnapshot(); boolean shouldCommit = false; if (status.shouldSend()) { + if (isFullSnapshot()) { + // freeze context just before commit because line probes have only one context + Duration timeout = + Duration.ofMillis(Config.get().getDynamicInstrumentationCaptureTimeout()); + lineContext.freeze(TimeoutChecker.create(Config.get(), timeout)); + snapshot.addLine(lineContext, line); + } snapshot.setTraceId(CorrelationIdentifier.getTraceId()); snapshot.setSpanId(CorrelationIdentifier.getSpanId()); snapshot.setMessage(status.getMessage()); @@ -834,14 +853,6 @@ public void commit(CapturedContext lineContext, int line) { if (shouldCommit) { incrementBudget(); if (inBudget()) { - if (isFullSnapshot()) { - // freeze context just before commit because line probes have only one context - Duration timeout = - Duration.of( - Config.get().getDynamicInstrumentationCaptureTimeout(), ChronoUnit.MILLIS); - lineContext.freeze(new TimeoutChecker(timeout)); - snapshot.addLine(lineContext, line); - } commitSnapshot(snapshot, sink); return; } @@ -1121,6 +1132,8 @@ public static class Builder extends ProbeDefinition.Builder { private Sampling sampling; private List captureExpressions; private Consumer snapshotProcessor; + private Duration evalTimeout = + Duration.ofMillis(Config.get().getDynamicInstrumentationEvalTimeout()); public Builder snapshotProcessor(Consumer processor) { this.snapshotProcessor = processor; @@ -1167,6 +1180,11 @@ public Builder captureExpressions(List captureExpressions) { return this; } + public Builder evalTimeout(Duration evalTimeout) { + this.evalTimeout = evalTimeout; + return this; + } + public LogProbe build() { return new LogProbe(this); } @@ -1179,8 +1197,8 @@ private static Map getDebugSessions() { if (tracer != null) { AgentSpan span = tracer.activeSpan(); if (span instanceof DDSpan) { - DDSpanContext context = (DDSpanContext) span.context(); - String debug = context.getPropagationTags().getDebugPropagation(); + DDSpanContext spanContext = (DDSpanContext) span.spanContext(); + String debug = spanContext.getPropagationTags().getDebugPropagation(); if (debug != null) { String[] entries = debug.split(","); for (String entry : entries) { diff --git a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/probe/SpanDecorationProbe.java b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/probe/SpanDecorationProbe.java index af9354429d1..942f1265a49 100644 --- a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/probe/SpanDecorationProbe.java +++ b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/probe/SpanDecorationProbe.java @@ -10,6 +10,7 @@ import com.datadog.debugger.instrumentation.InstrumentationResult; import com.datadog.debugger.instrumentation.MethodInfo; import com.datadog.debugger.sink.Snapshot; +import datadog.trace.api.Config; import datadog.trace.api.Pair; import datadog.trace.api.sampling.Sampler; import datadog.trace.bootstrap.debugger.CapturedContext; @@ -20,9 +21,11 @@ import datadog.trace.bootstrap.debugger.ProbeId; import datadog.trace.bootstrap.debugger.ProbeImplementation; import datadog.trace.bootstrap.debugger.ProbeRateLimiter; +import datadog.trace.bootstrap.debugger.util.TimeoutChecker; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; import datadog.trace.util.TagsHelper; +import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -159,11 +162,20 @@ public int hashCode() { private final TargetSpan targetSpan; private final List decorations; private transient Sampler errorSampler; + private final transient Duration evalTimeout; // no-arg constructor is required by Moshi to avoid creating instance with unsafe and by-passing // constructors, including field initializers. public SpanDecorationProbe() { - this(LANGUAGE, null, null, null, MethodLocation.DEFAULT, TargetSpan.ACTIVE, null); + this( + LANGUAGE, + null, + null, + null, + MethodLocation.DEFAULT, + TargetSpan.ACTIVE, + null, + Duration.ofMillis(Config.get().getDynamicInstrumentationEvalTimeout())); } public SpanDecorationProbe( @@ -173,10 +185,12 @@ public SpanDecorationProbe( Where where, MethodLocation methodLocation, TargetSpan targetSpan, - List decorations) { + List decorations, + Duration evalTimeout) { super(language, probeId, tagStrs, where, methodLocation); this.targetSpan = targetSpan; this.decorations = decorations; + this.evalTimeout = evalTimeout; } public SpanDecorationProbe(SpanDecorationProbe.Builder builder) { @@ -187,7 +201,8 @@ public SpanDecorationProbe(SpanDecorationProbe.Builder builder) { builder.where, builder.evaluateAt, builder.targetSpan, - builder.decorations); + builder.decorations, + builder.evalTimeout); initSamplers(); } @@ -206,10 +221,12 @@ public void evaluate( CapturedContext.Status status, MethodLocation methodLocation, boolean singleProbe) { + // Only one timeout for all conditions + TimeoutChecker timeoutChecker = TimeoutChecker.create(Config.get(), evalTimeout); for (Decoration decoration : decorations) { if (decoration.when != null) { try { - boolean condition = decoration.when.execute(context); + boolean condition = decoration.when.execute(context, timeoutChecker); if (!condition) { continue; } @@ -228,7 +245,8 @@ public void evaluate( SpanDecorationStatus spanStatus = (SpanDecorationStatus) status; for (Tag tag : decoration.tags) { String tagName = sanitize(tag.name); - StringTemplateBuilder builder = new StringTemplateBuilder(tag.value.getSegments(), LIMITS); + StringTemplateBuilder builder = + new StringTemplateBuilder(tag.value.getSegments(), LIMITS, evalTimeout); LogProbe.LogStatus logStatus = new LogProbe.LogStatus(this); String tagValue = builder.evaluate(context, logStatus); if (logStatus.hasLogTemplateErrors()) { @@ -412,6 +430,8 @@ public static SpanDecorationProbe.Builder builder() { public static class Builder extends ProbeDefinition.Builder { private TargetSpan targetSpan; private List decorations; + private Duration evalTimeout = + Duration.ofMillis(Config.get().getDynamicInstrumentationEvalTimeout()); public Builder targetSpan(TargetSpan targetSpan) { this.targetSpan = targetSpan; @@ -428,6 +448,11 @@ public Builder decorations(Decoration decoration) { return this; } + public Builder evalTimeout(Duration evalTimeout) { + this.evalTimeout = evalTimeout; + return this; + } + public SpanDecorationProbe build() { return new SpanDecorationProbe(this); } diff --git a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/probe/TriggerProbe.java b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/probe/TriggerProbe.java index f890df1d8e9..945b2a052dc 100644 --- a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/probe/TriggerProbe.java +++ b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/probe/TriggerProbe.java @@ -9,15 +9,18 @@ import com.datadog.debugger.instrumentation.DiagnosticMessage; import com.datadog.debugger.instrumentation.InstrumentationResult; import com.datadog.debugger.instrumentation.MethodInfo; +import datadog.trace.api.Config; import datadog.trace.api.sampling.Sampler; import datadog.trace.bootstrap.debugger.CapturedContext; import datadog.trace.bootstrap.debugger.CapturedContextProbe; import datadog.trace.bootstrap.debugger.MethodLocation; import datadog.trace.bootstrap.debugger.ProbeId; import datadog.trace.bootstrap.debugger.ProbeRateLimiter; +import datadog.trace.bootstrap.debugger.util.TimeoutChecker; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; import datadog.trace.bootstrap.instrumentation.api.Tags; +import java.time.Duration; import java.util.Arrays; import java.util.List; import java.util.Objects; @@ -134,7 +137,8 @@ private boolean evaluateCondition(CapturedContext capture) { } long start = System.nanoTime(); try { - return probeCondition.execute(capture); + Duration timeout = Duration.ofMillis(Config.get().getDynamicInstrumentationEvalTimeout()); + return probeCondition.execute(capture, TimeoutChecker.create(Config.get(), timeout)); } catch (Exception ex) { DebuggerAgent.getSink().getProbeStatusSink().addError(probeId, ex); return false; diff --git a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/sink/DebuggerSink.java b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/sink/DebuggerSink.java index 5c91e110acb..becf47b0337 100644 --- a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/sink/DebuggerSink.java +++ b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/sink/DebuggerSink.java @@ -5,6 +5,7 @@ import com.datadog.debugger.uploader.BatchUploader; import com.datadog.debugger.util.DebuggerMetrics; import datadog.trace.api.Config; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.bootstrap.debugger.DebuggerContext.SkipCause; import datadog.trace.bootstrap.debugger.ProbeId; import datadog.trace.util.AgentTaskScheduler; @@ -159,7 +160,7 @@ private void lowRateReschedule() { TimeUnit.MILLISECONDS); } - // visible for testing + @VisibleForTesting void lowRateFlush(DebuggerSink ignored) { symbolSink.flush(); probeStatusSink.flush(tags); diff --git a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/sink/SymbolSink.java b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/sink/SymbolSink.java index a18cd2d3df5..ecb064ac251 100644 --- a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/sink/SymbolSink.java +++ b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/sink/SymbolSink.java @@ -10,6 +10,7 @@ import com.datadog.debugger.util.MoshiHelper; import com.squareup.moshi.JsonAdapter; import datadog.trace.api.Config; +import datadog.trace.util.RandomUtils; import datadog.trace.util.TagsHelper; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -21,6 +22,7 @@ import java.util.List; import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.BlockingQueue; +import java.util.concurrent.atomic.AtomicLong; import java.util.zip.GZIPOutputStream; import okhttp3.HttpUrl; import okhttp3.MediaType; @@ -36,21 +38,34 @@ public class SymbolSink { public static final BatchUploader.RetryPolicy RETRY_POLICY = new BatchUploader.RetryPolicy(10); private static final JsonAdapter SERVICE_VERSION_ADAPTER = MoshiHelper.createMoshiSymbol().adapter(ServiceVersion.class); + // The upload event message JSON. The "final" field is hard-coded to false: + // the Java tracer continuously uploads new code as classes get loaded, so + // there is no defined end-of-upload point. private static final String EVENT_FORMAT = "{%n" + "\"ddsource\": \"dd_debugger\",%n" + "\"service\": \"%s\",%n" + + "\"version\": \"%s\",%n" + + "\"language\": \"java\",%n" + "\"runtimeId\": \"%s\",%n" - + "\"type\": \"symdb\"%n" + + "\"type\": \"symdb\",%n" + + "\"uploadId\": \"%s\",%n" + + "\"batchNum\": %d,%n" + + "\"final\": false,%n" + + "\"attachmentSize\": %d%n" + "}"; static final int MAX_SYMDB_UPLOAD_SIZE = 50 * 1024 * 1024; private final String serviceName; private final String env; private final String version; + private final String runtimeId; private final BatchUploader symbolUploader; private final int maxPayloadSize; - private final BatchUploader.MultiPartContent event; + // uploadId is shared by all batches uploaded by this sink. The backend uses + // it to group batches belonging to the same logical upload. + private final String uploadId = RandomUtils.randomUUID().toString(); + private final AtomicLong batchNum = new AtomicLong(0); private final BlockingQueue scopes = new ArrayBlockingQueue<>(CAPACITY); private final Stats stats = new Stats(); private final boolean isCompressed; @@ -66,15 +81,10 @@ public SymbolSink(Config config) { this.serviceName = TagsHelper.sanitize(config.getServiceName()); this.env = TagsHelper.sanitize(config.getEnv()); this.version = TagsHelper.sanitize(config.getVersion()); + this.runtimeId = config.getRuntimeId(); this.symbolUploader = symbolUploader; this.maxPayloadSize = maxPayloadSize; this.isCompressed = config.isSymbolDatabaseCompressed(); - byte[] eventContent = - String.format( - EVENT_FORMAT, TagsHelper.sanitize(config.getServiceName()), config.getRuntimeId()) - .getBytes(StandardCharsets.UTF_8); - this.event = - new BatchUploader.MultiPartContent(eventContent, "event", "event.json", APPLICATION_JSON); } public void stop() { @@ -111,22 +121,35 @@ public void flush() { } private void serializeAndUpload(List scopesToSerialize) { + // Determine the batch number once so the attachment body and the EvP event + // message agree on it. + long currentBatch = batchNum.incrementAndGet(); try { ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(2 * 1024 * 1024); try (OutputStream outputStream = isCompressed ? new GZIPOutputStream(byteArrayOutputStream) : byteArrayOutputStream) { BufferedSink sink = Okio.buffer(Okio.sink(outputStream)); SERVICE_VERSION_ADAPTER.toJson( - sink, new ServiceVersion(serviceName, env, version, "JAVA", scopesToSerialize)); + sink, + new ServiceVersion( + serviceName, + env, + version, + "JAVA", + scopesToSerialize, + uploadId, + currentBatch, + false /* isFinal */)); sink.flush(); } - doUpload(scopesToSerialize, byteArrayOutputStream.toByteArray(), isCompressed); + doUpload(scopesToSerialize, byteArrayOutputStream.toByteArray(), isCompressed, currentBatch); } catch (IOException e) { LOGGER.debug("Error serializing scopes", e); } } - private void doUpload(List scopesToSerialize, byte[] payload, boolean isCompressed) { + private void doUpload( + List scopesToSerialize, byte[] payload, boolean isCompressed, long currentBatch) { if (payload.length > maxPayloadSize) { LOGGER.warn( "Payload is too big: {}/{} isCompressed={}", @@ -138,20 +161,38 @@ private void doUpload(List scopesToSerialize, byte[] payload, boolean isC } updateStats(scopesToSerialize, payload.length); LOGGER.debug( - "Sending {} jar scopes size={} isCompressed={}", + "Sending {} jar scopes size={} isCompressed={} uploadId={} batchNum={}", scopesToSerialize.size(), payload.length, - isCompressed); + isCompressed, + uploadId, + currentBatch); String fileName = "file.json"; MediaType mediaType = APPLICATION_JSON; if (isCompressed) { fileName = "file.gz"; mediaType = APPLICATION_GZIP; } + BatchUploader.MultiPartContent event = buildEvent(currentBatch, payload.length); symbolUploader.uploadAsMultipart( "", event, new BatchUploader.MultiPartContent(payload, "file", fileName, mediaType)); } + private BatchUploader.MultiPartContent buildEvent(long currentBatch, int attachmentSize) { + byte[] eventContent = + String.format( + EVENT_FORMAT, + serviceName, + version, + runtimeId, + uploadId.toString(), + currentBatch, + attachmentSize) + .getBytes(StandardCharsets.UTF_8); + return new BatchUploader.MultiPartContent( + eventContent, "event", "event.json", APPLICATION_JSON); + } + private static byte[] compressPayload(byte[] jsonBytes) { // usual compression factor 40:1 for those json payload, so we are preallocating 1/40 ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(jsonBytes.length / 40); diff --git a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/symbol/ServiceVersion.java b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/symbol/ServiceVersion.java index a88fc25da63..fd1efaaac04 100644 --- a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/symbol/ServiceVersion.java +++ b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/symbol/ServiceVersion.java @@ -1,5 +1,6 @@ package com.datadog.debugger.symbol; +import com.squareup.moshi.Json; import java.util.List; public class ServiceVersion { @@ -10,13 +11,32 @@ public class ServiceVersion { private final String language; private final List scopes; + @Json(name = "upload_id") + private final String uploadId; + + @Json(name = "batch_num") + private final long batchNum; + + @Json(name = "final") + private final boolean isFinal; + public ServiceVersion( - String service, String env, String version, String language, List scopes) { + String service, + String env, + String version, + String language, + List scopes, + String uploadId, + long batchNum, + boolean isFinal) { this.service = service; this.env = env; this.version = version; this.language = language; this.scopes = scopes; + this.uploadId = uploadId; + this.batchNum = batchNum; + this.isFinal = isFinal; } public List getScopes() { diff --git a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/symbol/SourceRemapper.java b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/symbol/SourceRemapper.java index 161b5517534..022956ba322 100644 --- a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/symbol/SourceRemapper.java +++ b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/symbol/SourceRemapper.java @@ -22,7 +22,7 @@ static SourceRemapper getSourceRemapper(String sourceFile, SourceMap sourceMap) } StratumExt stratumDebug = sourceMap.getStratum("KotlinDebug"); if (stratumDebug == null) { - throw new IllegalArgumentException("No stratumDebug found for KotlinDebug"); + stratumDebug = new StratumExt("KotlinDebug"); } return new KotlinSourceRemapper(stratumMain, stratumDebug); default: diff --git a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/uploader/BatchUploader.java b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/uploader/BatchUploader.java index 63ff0ef8dcc..993d8194668 100644 --- a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/uploader/BatchUploader.java +++ b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/uploader/BatchUploader.java @@ -7,6 +7,7 @@ import datadog.communication.http.OkHttpUtils; import datadog.logging.RatelimitedLogger; import datadog.trace.api.Config; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.util.AgentThreadFactory; import java.io.IOException; import java.time.Duration; @@ -124,7 +125,7 @@ public BatchUploader(String name, Config config, String endpoint, RetryPolicy re ContainerInfo.getEntityId()); } - // Visible for testing + @VisibleForTesting BatchUploader( String name, Config config, @@ -220,10 +221,7 @@ private void doUpload(Runnable makeRequest) { } } - /** - * Note that this method is only visible for testing and should not be used from outside this - * class. - */ + @VisibleForTesting OkHttpClient getClient() { return client; } diff --git a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/util/MoshiSnapshotHelper.java b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/util/MoshiSnapshotHelper.java index 68cbb430c3e..b9aa67c28bf 100644 --- a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/util/MoshiSnapshotHelper.java +++ b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/util/MoshiSnapshotHelper.java @@ -21,7 +21,6 @@ import java.lang.reflect.Type; import java.nio.charset.StandardCharsets; import java.time.Duration; -import java.time.temporal.ChronoUnit; import java.util.List; import java.util.Map; import java.util.Set; @@ -118,8 +117,7 @@ public void toJson(JsonWriter jsonWriter, Snapshot.Captures captures) throws IOE jsonWriter.nullValue(); return; } - jsonWriter.setTag( - TimeoutChecker.class, new TimeoutChecker(System.currentTimeMillis(), captureTimeOut)); + jsonWriter.setTag(TimeoutChecker.class, TimeoutChecker.create(Config.get(), captureTimeOut)); jsonWriter.beginObject(); jsonWriter.name(ENTRY); capturedContextAdapter.toJson(jsonWriter, captures.getEntry()); @@ -160,12 +158,12 @@ public void toJson(JsonWriter jsonWriter, CapturedContext capturedContext) throw TimeoutChecker timeoutChecker = jsonWriter.tag(TimeoutChecker.class); if (timeoutChecker == null) { Duration timeout = - Duration.of(Config.get().getDynamicInstrumentationCaptureTimeout(), ChronoUnit.MILLIS); - timeoutChecker = new TimeoutChecker(timeout); + Duration.ofMillis(Config.get().getDynamicInstrumentationCaptureTimeout()); + timeoutChecker = TimeoutChecker.create(Config.get(), timeout); } // need to 'freeze' the context before serializing it capturedContext.freeze(timeoutChecker); - if (timeoutChecker.isTimedOut(System.currentTimeMillis())) { + if (timeoutChecker.isTimedOut()) { jsonWriter.beginObject(); jsonWriter.name(NOT_CAPTURED_REASON); jsonWriter.value(TIMEOUT_REASON); @@ -273,7 +271,7 @@ private SerializationResult toJsonCapturedValues( if (count >= limits.maxFieldCount) { return SerializationResult.FIELD_COUNT; } - if (timeoutChecker.isTimedOut(System.currentTimeMillis())) { + if (timeoutChecker.isTimedOut()) { return SerializationResult.TIMEOUT; } jsonWriter.name(entry.getKey()); @@ -305,7 +303,7 @@ public void toJson(JsonWriter jsonWriter, CapturedContext.CapturedValue captured } TimeoutChecker timeoutChecker = capturedValue.getTimeoutChecker(); if (timeoutChecker == null) { - timeoutChecker = new TimeoutChecker(Duration.of(10, ChronoUnit.MILLIS)); + timeoutChecker = TimeoutChecker.create(Config.get(), Duration.ofMillis(10)); } Object value = capturedValue.getValue(); String type = capturedValue.getType(); diff --git a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/util/SerializerWithLimits.java b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/util/SerializerWithLimits.java index 0ee03a7f52a..211543efa14 100644 --- a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/util/SerializerWithLimits.java +++ b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/util/SerializerWithLimits.java @@ -137,7 +137,7 @@ public void serialize(Object value, String type, Limits limits) throws Exception tokenWriter.epilogue(value); return; } - if (timeoutChecker.isTimedOut(System.currentTimeMillis())) { + if (timeoutChecker.isTimedOut()) { tokenWriter.notCaptured(NotCapturedReason.TIMEOUT); tokenWriter.epilogue(value); return; diff --git a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/util/SpringHelper.java b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/util/SpringHelper.java index f8826efb16a..dbcb2f1a477 100644 --- a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/util/SpringHelper.java +++ b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/util/SpringHelper.java @@ -10,17 +10,25 @@ public class SpringHelper { private static final Logger LOGGER = LoggerFactory.getLogger(SpringHelper.class); + private enum DetectionResult { + UNKNOWN, + USE_METHOD_PARAMETERS, + USE_LOCAL_VARS + } + public static boolean isSpringUsingOnlyMethodParameters(Instrumentation inst) { - try { - return isSpringUsingOnlyMethodParametersSpringVersion(inst); - } catch (Exception e) { - LOGGER.debug("isSpringUsingOnlyMethodParameters failed for SpringVersion", e); + DetectionResult detectionResult = isSpringUsingOnlyMethodParametersSpringVersion(inst); + if (detectionResult == DetectionResult.UNKNOWN) { + LOGGER.debug( + "isSpringUsingOnlyMethodParameters failed for SpringVersion, trying to detect specific class"); // fallback to lookup for specific class return isSpringUsingOnlyMethodParametersSpecificClass(inst); } + return detectionResult == DetectionResult.USE_METHOD_PARAMETERS; } - private static boolean isSpringUsingOnlyMethodParametersSpringVersion(Instrumentation inst) { + private static DetectionResult isSpringUsingOnlyMethodParametersSpringVersion( + Instrumentation inst) { try { // scan for getting an already loaded class and get the classloader ClassLoader springClassLoader = null; @@ -30,7 +38,7 @@ private static boolean isSpringUsingOnlyMethodParametersSpringVersion(Instrument } } if (springClassLoader == null) { - throw new IllegalStateException("Cannot find Spring classloader"); + return DetectionResult.UNKNOWN; } Class springVersionClass = Class.forName("org.springframework.core.SpringVersion", true, springClassLoader); @@ -38,25 +46,37 @@ private static boolean isSpringUsingOnlyMethodParametersSpringVersion(Instrument String version = (String) m.invoke(null); ParsedSpringVersion springVersion = new ParsedSpringVersion(version); // if Spring version is 6.1+ only using MethodParameters - return springVersion.major > 6 || (springVersion.major == 6 && springVersion.minor >= 1); - } catch (Exception e) { - throw new RuntimeException(e); + return springVersion.major > 6 || (springVersion.major == 6 && springVersion.minor >= 1) + ? DetectionResult.USE_METHOD_PARAMETERS + : DetectionResult.USE_LOCAL_VARS; + } catch (Exception ex) { + LOGGER.debug("isSpringUsingOnlyMethodParametersSpringVersion failed", ex); + return DetectionResult.UNKNOWN; } } private static boolean isSpringUsingOnlyMethodParametersSpecificClass(Instrumentation inst) { - for (Class clazz : inst.getAllLoadedClasses()) { - if ("org.springframework.web.client.RestClient".equals(clazz.getName())) { - // If this class (coming from Spring web since version 6.1) is found loaded it means Spring - // supports only getting parameter names from the MethodParameter attribute - return true; + try { + for (Class clazz : inst.getAllLoadedClasses()) { + if (clazz == null) { + // class unloaded + continue; + } + if ("org.springframework.web.client.RestClient".equals(clazz.getName())) { + // If this class (coming from Spring web since version 6.1) is found loaded it means + // Spring + // supports only getting parameter names from the MethodParameter attribute + return true; + } } + } catch (Exception ex) { + LOGGER.debug("isSpringUsingOnlyMethodParametersSpecificClass failed: ", ex); } - // class not found, probably no Spring + // class not found, probably no Spring or failed return false; } - private static class ParsedSpringVersion { + static class ParsedSpringVersion { private static final Pattern VERSION_PATTERN = Pattern.compile("(\\d+)\\.(\\d+)\\.(\\d+)"); final int major; diff --git a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/util/ValueScriptHelper.java b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/util/ValueScriptHelper.java index bdbbacec81d..1ae9d5079d2 100644 --- a/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/util/ValueScriptHelper.java +++ b/dd-java-agent/agent-debugger/src/main/java/com/datadog/debugger/util/ValueScriptHelper.java @@ -6,14 +6,12 @@ import datadog.trace.bootstrap.debugger.Limits; import datadog.trace.bootstrap.debugger.util.TimeoutChecker; import java.time.Duration; -import java.time.temporal.ChronoUnit; public class ValueScriptHelper { public static void serializeValue( StringBuilder sb, String expr, Object value, CapturedContext.Status status, Limits limits) { - Duration timeout = - Duration.of(Config.get().getDynamicInstrumentationCaptureTimeout(), ChronoUnit.MILLIS); - TimeoutChecker timeoutChecker = new TimeoutChecker(timeout); + Duration timeout = Duration.ofMillis(Config.get().getDynamicInstrumentationCaptureTimeout()); + TimeoutChecker timeoutChecker = TimeoutChecker.create(Config.get(), timeout); SerializerWithLimits serializer = new SerializerWithLimits(new StringTokenWriter(sb, status.getErrors()), timeoutChecker); try { diff --git a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/CapturedSnapshotTest.java b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/CapturedSnapshotTest.java index d40fe6659d1..92cae81ff10 100644 --- a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/CapturedSnapshotTest.java +++ b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/CapturedSnapshotTest.java @@ -1,5 +1,8 @@ package com.datadog.debugger.agent; +import static com.datadog.debugger.el.DSL.not; +import static com.datadog.debugger.el.DSL.nullValue; +import static com.datadog.debugger.el.DSL.ref; import static com.datadog.debugger.util.LogProbeTestHelper.parseTemplate; import static com.datadog.debugger.util.MoshiSnapshotHelper.DEPTH_REASON; import static com.datadog.debugger.util.MoshiSnapshotHelper.FIELD_COUNT_REASON; @@ -172,8 +175,7 @@ public void methodProbeAtExitWithCondition() throws IOException, URISyntaxExcept final String CLASS_NAME = "CapturedSnapshot01"; LogProbe probe = createProbeBuilder(PROBE_ID, CLASS_NAME, "main", "int (java.lang.String)") - .when( - new ProbeCondition(DSL.when(DSL.eq(DSL.ref("arg"), DSL.value("1"))), "arg == '1'")) + .when(new ProbeCondition(DSL.when(DSL.eq(ref("arg"), DSL.value("1"))), "arg == '1'")) .evaluateAt(MethodLocation.EXIT) .build(); TestSnapshotListener listener = installProbes(probe); @@ -1029,13 +1031,12 @@ public void uncaughtExceptionCondition() throws IOException, URISyntaxException DSL.when( DSL.and( DSL.instanceOf( - DSL.ref("@exception"), - DSL.value("CapturedSnapshot05$CustomException")), + ref("@exception"), DSL.value("CapturedSnapshot05$CustomException")), DSL.eq( - DSL.getMember(DSL.ref("@exception"), "detailMessage"), + DSL.getMember(ref("@exception"), "detailMessage"), DSL.value("oops")), DSL.eq( - DSL.getMember(DSL.ref("@exception"), "additionalMsg"), + DSL.getMember(ref("@exception"), "additionalMsg"), DSL.value("I did it again")))), "@exception instanceof \"CapturedSnapshot05$CustomException\" and @exception.detailMessage == 'oops' and @exception.additionalMsg == 'I did it again'")) .template(LOG_TEMPLATE, parseTemplate(LOG_TEMPLATE)) @@ -1125,8 +1126,7 @@ public void noUncaughtExceptionCondition() throws IOException, URISyntaxExceptio .evaluateAt(MethodLocation.EXIT) .when( new ProbeCondition( - DSL.when(DSL.not(DSL.isDefined(DSL.ref("@exception")))), - "not(isDefined(@exception))")) + DSL.when(not(DSL.isDefined(ref("@exception")))), "not(isDefined(@exception))")) .template(LOG_TEMPLATE, parseTemplate(LOG_TEMPLATE)) .build(); TestSnapshotListener listener = installProbes(probe); @@ -1188,17 +1188,16 @@ public void simpleConditionTest() throws IOException, URISyntaxException { // this is always true DSL.and( // this reference is resolved directly from the snapshot - DSL.eq(DSL.ref("fld"), DSL.value(11)), + DSL.eq(ref("fld"), DSL.value(11)), // this reference chain needs to use reflection DSL.eq( DSL.getMember( - DSL.getMember( - DSL.getMember(DSL.ref("typed"), "fld"), "fld"), + DSL.getMember(DSL.getMember(ref("typed"), "fld"), "fld"), "msg"), DSL.value("hello"))), DSL.and( - DSL.eq(DSL.ref("arg"), DSL.value("5")), - DSL.ge(DSL.ref(ValueReferences.DURATION_REF), DSL.value(0L))))), + DSL.eq(ref("arg"), DSL.value("5")), + DSL.ge(ref(ValueReferences.DURATION_REF), DSL.value(0L))))), "(fld == 11 && typed.fld.fld.msg == \"hello\") && (arg == '5' && @duration >= 0)")) .evaluateAt(MethodLocation.EXIT) .build(); @@ -1226,15 +1225,14 @@ public void lineProbeCondition() throws IOException, URISyntaxException { // this is always true DSL.and( // this reference is resolved directly from the snapshot - DSL.eq(DSL.ref("fld"), DSL.value(11)), + DSL.eq(ref("fld"), DSL.value(11)), // this reference chain needs to use reflection DSL.eq( DSL.getMember( - DSL.getMember( - DSL.getMember(DSL.ref("typed"), "fld"), "fld"), + DSL.getMember(DSL.getMember(ref("typed"), "fld"), "fld"), "msg"), DSL.value("hello"))), - DSL.eq(DSL.ref("arg"), DSL.value("5")))), + DSL.eq(ref("arg"), DSL.value("5")))), "(fld == 11 && typed.fld.fld.msg == \"hello\") && arg == '5'")) .build(); TestSnapshotListener listener = installProbes(logProbe); @@ -1251,6 +1249,26 @@ public void lineProbeCondition() throws IOException, URISyntaxException { "5"); } + @Test + public void lineProbeConditionFailed() throws IOException, URISyntaxException { + final String CLASS_NAME = "CapturedSnapshot08"; + int line = getLineForLineProbe(CLASS_NAME, LINE_PROBE_ID1); + LogProbe logProbe = + createProbeBuilder(LINE_PROBE_ID1, CLASS_NAME, line) + .when( + new ProbeCondition(DSL.when(DSL.eq(ref("foobar"), nullValue())), "foobar == null")) + .build(); + TestSnapshotListener listener = installProbes(logProbe); + Class testClass = compileAndLoadClass(CLASS_NAME); + int result = Reflect.onClass(testClass).call("main", "0").get(); + assertEquals(3, result); + Snapshot snapshot = assertOneSnapshot(LINE_PROBE_ID1, listener); + assertNull(snapshot.getCaptures().getLines()); + assertEquals(1, snapshot.getEvaluationErrors().size()); + assertEquals( + "Cannot dereference field: foobar", snapshot.getEvaluationErrors().get(0).getMessage()); + } + @Test public void staticFieldCondition() throws IOException, URISyntaxException { final String CLASS_NAME = "com.datadog.debugger.CapturedSnapshot19"; @@ -1258,7 +1276,7 @@ public void staticFieldCondition() throws IOException, URISyntaxException { createProbeBuilder(PROBE_ID, CLASS_NAME, "process", "int (java.lang.String)") .when( new ProbeCondition( - DSL.when(DSL.eq(DSL.ref("strField"), DSL.value("foo"))), "strField == 'foo'")) + DSL.when(DSL.eq(ref("strField"), DSL.value("foo"))), "strField == 'foo'")) .evaluateAt(MethodLocation.EXIT) .build(); TestSnapshotListener listener = installProbes(logProbe); @@ -1282,8 +1300,7 @@ public void simpleFalseConditionTest() throws IOException, URISyntaxException { int line = getLineForLineProbe(CLASS_NAME, LINE_PROBE_ID2); LogProbe logProbe = createProbeBuilder(LINE_PROBE_ID2, CLASS_NAME, line) - .when( - new ProbeCondition(DSL.when(DSL.eq(DSL.ref("arg"), DSL.value("5"))), "arg == '5'")) + .when(new ProbeCondition(DSL.when(DSL.eq(ref("arg"), DSL.value("5"))), "arg == '5'")) .evaluateAt(MethodLocation.EXIT) .build(); TestSnapshotListener listener = installProbes(logProbe); @@ -1303,7 +1320,7 @@ public void nullCondition() throws IOException, URISyntaxException { DSL.when( DSL.eq( DSL.getMember( - DSL.getMember(DSL.getMember(DSL.ref("nullTyped"), "fld"), "fld"), + DSL.getMember(DSL.getMember(ref("nullTyped"), "fld"), "fld"), "msg"), DSL.value("hello"))), "nullTyped.fld.fld.msg == 'hello'")) @@ -1329,7 +1346,7 @@ public void nullConditionTemplateOnly() throws IOException, URISyntaxException { DSL.when( DSL.eq( DSL.getMember( - DSL.getMember(DSL.getMember(DSL.ref("nullTyped"), "fld"), "fld"), + DSL.getMember(DSL.getMember(ref("nullTyped"), "fld"), "fld"), "msg"), DSL.value("hello"))), "nullTyped.fld.fld.msg == 'hello'")) @@ -1357,9 +1374,9 @@ public void shortCircuitingCondition() throws IOException, URISyntaxException { new ProbeCondition( DSL.when( DSL.and( - DSL.isDefined(DSL.ref("@exception")), + DSL.isDefined(ref("@exception")), DSL.contains( - DSL.getMember(DSL.ref("@exception"), "detailMessage"), + DSL.getMember(ref("@exception"), "detailMessage"), new StringValue("closed")))), "isDefined(@exception) && contains(@exception.detailMessage, 'closed')")) .build(); @@ -1379,8 +1396,7 @@ public void wellKnownClassesCondition() throws IOException, URISyntaxException { .when( new ProbeCondition( DSL.when( - DSL.eq( - DSL.getMember(DSL.ref("maybeStr"), "value"), DSL.value("maybe foo"))), + DSL.eq(DSL.getMember(ref("maybeStr"), "value"), DSL.value("maybe foo"))), "maybeStr.value == 'maybe foo'")) .build(); TestSnapshotListener listener = installProbes(logProbes); @@ -1463,7 +1479,7 @@ public void mergedProbesConditionMainErrorAdditionalFalse() DSL.when( DSL.eq( DSL.getMember( - DSL.getMember(DSL.getMember(DSL.ref("nullTyped"), "fld"), "fld"), "msg"), + DSL.getMember(DSL.getMember(ref("nullTyped"), "fld"), "fld"), "msg"), DSL.value("hello"))), "nullTyped.fld.fld.msg == 'hello'"); ProbeCondition condition2 = new ProbeCondition(DSL.when(DSL.FALSE), "false"); @@ -1482,7 +1498,7 @@ public void mergedProbesConditionMainErrorAdditionalTrue() DSL.when( DSL.eq( DSL.getMember( - DSL.getMember(DSL.getMember(DSL.ref("nullTyped"), "fld"), "fld"), "msg"), + DSL.getMember(DSL.getMember(ref("nullTyped"), "fld"), "fld"), "msg"), DSL.value("hello"))), "nullTyped.fld.fld.msg == 'hello'"); ProbeCondition condition2 = new ProbeCondition(DSL.when(DSL.TRUE), "true"); @@ -1503,7 +1519,7 @@ public void mergedProbesConditionMainFalseAdditionalError() DSL.when( DSL.eq( DSL.getMember( - DSL.getMember(DSL.getMember(DSL.ref("nullTyped"), "fld"), "fld"), "msg"), + DSL.getMember(DSL.getMember(ref("nullTyped"), "fld"), "fld"), "msg"), DSL.value("hello"))), "nullTyped.fld.fld.msg == 'hello'"); List snapshots = doMergedProbeConditions(condition1, condition2, 1); @@ -1522,7 +1538,7 @@ public void mergedProbesConditionMainTrueAdditionalError() DSL.when( DSL.eq( DSL.getMember( - DSL.getMember(DSL.getMember(DSL.ref("nullTyped"), "fld"), "fld"), "msg"), + DSL.getMember(DSL.getMember(ref("nullTyped"), "fld"), "fld"), "msg"), DSL.value("hello"))), "nullTyped.fld.fld.msg == 'hello'"); List snapshots = doMergedProbeConditions(condition1, condition2, 2); @@ -1545,7 +1561,7 @@ public void mergedProbesConditionMixedLocation() throws IOException, URISyntaxEx createProbeBuilder(PROBE_ID2, CLASS_NAME, "doit", "int (java.lang.String)") .when( new ProbeCondition( - DSL.when(DSL.ge(DSL.ref("@duration"), DSL.value(0))), "@duration >= 0")) + DSL.when(DSL.ge(ref("@duration"), DSL.value(0))), "@duration >= 0")) .evaluateAt(MethodLocation.EXIT) .build(); TestSnapshotListener listener = installProbes(probe1, probe2); @@ -1587,14 +1603,12 @@ public void mergedProbesWithCaptureExpressionsMixed() throws IOException, URISyn "typed_fld_fld_msg", new ValueScript( DSL.getMember( - DSL.getMember(DSL.getMember(DSL.ref("typed"), "fld"), "fld"), - "msg"), + DSL.getMember(DSL.getMember(ref("typed"), "fld"), "fld"), "msg"), "typed.fld.fld.msg"), null), new LogProbe.CaptureExpression( "nullTyped_fld", - new ValueScript( - DSL.getMember(DSL.ref("nullTyped"), "fld"), "nullTyped.fld"), + new ValueScript(DSL.getMember(ref("nullTyped"), "fld"), "nullTyped.fld"), null))) .build(); LogProbe probe2 = createMethodProbeAtExit(PROBE_ID2, CLASS_NAME, "doit", null); @@ -1638,14 +1652,12 @@ public void mergedProbesWithDifferentCaptureExpressions() throws IOException, UR "typed_fld_fld_msg", new ValueScript( DSL.getMember( - DSL.getMember(DSL.getMember(DSL.ref("typed"), "fld"), "fld"), - "msg"), + DSL.getMember(DSL.getMember(ref("typed"), "fld"), "fld"), "msg"), "typed.fld.fld.msg"), null), new LogProbe.CaptureExpression( "nullTyped_fld", - new ValueScript( - DSL.getMember(DSL.ref("nullTyped"), "fld"), "nullTyped.fld"), + new ValueScript(DSL.getMember(ref("nullTyped"), "fld"), "nullTyped.fld"), null))) .build(); LogProbe probe2 = @@ -1655,10 +1667,10 @@ public void mergedProbesWithDifferentCaptureExpressions() throws IOException, UR .captureExpressions( Arrays.asList( new LogProbe.CaptureExpression( - "var1", new ValueScript(DSL.ref("var1"), "var1"), null), + "var1", new ValueScript(ref("var1"), "var1"), null), new LogProbe.CaptureExpression( "this_fld", - new ValueScript(DSL.getMember(DSL.ref("this"), "fld"), "this.fld"), + new ValueScript(DSL.getMember(ref("this"), "fld"), "this.fld"), null))) .build(); TestSnapshotListener listener = installProbes(probe1, probe2); @@ -1729,7 +1741,7 @@ public void inheritedFields() throws IOException, URISyntaxException { createProbeBuilder(PROBE_ID, INHERITED_CLASS_NAME, "f", "()") .when( new ProbeCondition( - DSL.when(DSL.eq(DSL.ref("intValue"), DSL.value(24))), "intValue == 24")) + DSL.when(DSL.eq(ref("intValue"), DSL.value(24))), "intValue == 24")) .evaluateAt(MethodLocation.ENTRY) .build(); TestSnapshotListener listener = installProbes(probe); @@ -1772,7 +1784,7 @@ public void staticInheritedFields() throws IOException, URISyntaxException { createProbeBuilder(PROBE_ID, INHERITED_CLASS_NAME, "f", "()") .when( new ProbeCondition( - DSL.when(DSL.eq(DSL.ref("intValue"), DSL.value(48))), "intValue == 48")) + DSL.when(DSL.eq(ref("intValue"), DSL.value(48))), "intValue == 48")) .evaluateAt(MethodLocation.EXIT) .build(); TestSnapshotListener listener = installProbes(logProbe); @@ -1997,8 +2009,7 @@ public void evaluateAtEntry() throws IOException, URISyntaxException { final String CLASS_NAME = "CapturedSnapshot01"; LogProbe logProbes = createProbeBuilder(PROBE_ID, CLASS_NAME, "main", "int (java.lang.String)") - .when( - new ProbeCondition(DSL.when(DSL.eq(DSL.ref("arg"), DSL.value("1"))), "arg == '1'")) + .when(new ProbeCondition(DSL.when(DSL.eq(ref("arg"), DSL.value("1"))), "arg == '1'")) .evaluateAt(MethodLocation.ENTRY) .build(); TestSnapshotListener listener = installProbes(logProbes); @@ -2014,8 +2025,7 @@ public void evaluateAtExit() throws IOException, URISyntaxException { LogProbe logProbes = createProbeBuilder(PROBE_ID, CLASS_NAME, "main", "int (java.lang.String)") .when( - new ProbeCondition( - DSL.when(DSL.eq(DSL.ref("@return"), DSL.value(3))), "@return == 3")) + new ProbeCondition(DSL.when(DSL.eq(ref("@return"), DSL.value(3))), "@return == 3")) .evaluateAt(MethodLocation.EXIT) .build(); TestSnapshotListener listener = installProbes(logProbes); @@ -2031,8 +2041,7 @@ public void evaluateAtExitFalse() throws IOException, URISyntaxException { LogProbe logProbes = createProbeBuilder(PROBE_ID, CLASS_NAME, "main", "int (java.lang.String)") .when( - new ProbeCondition( - DSL.when(DSL.eq(DSL.ref("@return"), DSL.value(0))), "@return == 0")) + new ProbeCondition(DSL.when(DSL.eq(ref("@return"), DSL.value(0))), "@return == 0")) .evaluateAt(MethodLocation.EXIT) .build(); TestSnapshotListener listener = installProbes(logProbes); @@ -2057,8 +2066,7 @@ public void uncaughtExceptionConditionLocalVar() throws IOException, URISyntaxEx final String CLASS_NAME = "CapturedSnapshot05"; LogProbe probe = createProbeBuilder(PROBE_ID, CLASS_NAME, "main", "(String)") - .when( - new ProbeCondition(DSL.when(DSL.ge(DSL.ref("after"), DSL.value(0))), "after >= 0")) + .when(new ProbeCondition(DSL.when(DSL.ge(ref("after"), DSL.value(0))), "after >= 0")) .evaluateAt(MethodLocation.EXIT) .build(); TestSnapshotListener listener = installProbes(probe); @@ -2370,10 +2378,10 @@ public void enumCondition() throws IOException, URISyntaxException { new ProbeCondition( DSL.when( DSL.and( - DSL.eq(DSL.ref("@return"), DSL.value("TWO")), - DSL.eq(DSL.ref("@return"), DSL.value("MyEnum.TWO")), + DSL.eq(ref("@return"), DSL.value("TWO")), + DSL.eq(ref("@return"), DSL.value("MyEnum.TWO")), DSL.eq( - DSL.ref("@return"), + ref("@return"), DSL.value("com.datadog.debugger.CapturedSnapshot23$MyEnum.TWO")))), "@return == 'TWO' && @return == 'MyEnum.TWO' && @return == 'com.datadog.debugger.CapturedSnapshot23$MyEnum.TWO'")) .build(); @@ -2437,7 +2445,7 @@ private Snapshot doUnknownCount(String CLASS_NAME) throws IOException, URISyntax createProbeBuilder(PROBE_ID, CLASS_NAME, "doit", null) .when( new ProbeCondition( - DSL.when(DSL.ge(DSL.len(DSL.ref("holder")), DSL.value(0))), "len(holder) >= 0")) + DSL.when(DSL.ge(DSL.len(ref("holder")), DSL.value(0))), "len(holder) >= 0")) .build(); TestSnapshotListener listener = installProbes(logProbe); Class testClass = compileAndLoadClass(CLASS_NAME); @@ -2535,7 +2543,7 @@ public void keywordRedactionConditions() throws IOException, URISyntaxException new ProbeCondition( DSL.when( DSL.contains( - DSL.getMember(DSL.ref("this"), "password"), new StringValue("123"))), + DSL.getMember(ref("this"), "password"), new StringValue("123"))), "contains(this.password, '123')")) .captureSnapshot(true) .evaluateAt(MethodLocation.EXIT) @@ -2544,7 +2552,7 @@ public void keywordRedactionConditions() throws IOException, URISyntaxException createProbeBuilder(PROBE_ID2, CLASS_NAME, "doit", null) .when( new ProbeCondition( - DSL.when(DSL.eq(DSL.ref("password"), DSL.value("123"))), "password == '123'")) + DSL.when(DSL.eq(ref("password"), DSL.value("123"))), "password == '123'")) .captureSnapshot(true) .evaluateAt(MethodLocation.EXIT) .build(); @@ -2553,8 +2561,7 @@ public void keywordRedactionConditions() throws IOException, URISyntaxException .when( new ProbeCondition( DSL.when( - DSL.eq( - DSL.index(DSL.ref("strMap"), DSL.value("password")), DSL.value("123"))), + DSL.eq(DSL.index(ref("strMap"), DSL.value("password")), DSL.value("123"))), "strMap['password'] == '123'")) .captureSnapshot(true) .evaluateAt(MethodLocation.EXIT) @@ -2652,7 +2659,7 @@ public void typeRedactionCondition() throws IOException, URISyntaxException { new ProbeCondition( DSL.when( DSL.contains( - DSL.getMember(DSL.getMember(DSL.ref("this"), "creds"), "secretCode"), + DSL.getMember(DSL.getMember(ref("this"), "creds"), "secretCode"), new StringValue("123"))), "contains(this.creds.secretCode, '123')")) .captureSnapshot(true) @@ -2662,8 +2669,7 @@ public void typeRedactionCondition() throws IOException, URISyntaxException { createProbeBuilder(PROBE_ID2, CLASS_NAME, "doit", null) .when( new ProbeCondition( - DSL.when( - DSL.eq(DSL.getMember(DSL.ref("creds"), "secretCode"), DSL.value("123"))), + DSL.when(DSL.eq(DSL.getMember(ref("creds"), "secretCode"), DSL.value("123"))), "creds.secretCode == '123'")) .captureSnapshot(true) .evaluateAt(MethodLocation.EXIT) @@ -2673,7 +2679,7 @@ public void typeRedactionCondition() throws IOException, URISyntaxException { .when( new ProbeCondition( DSL.when( - DSL.eq(DSL.index(DSL.ref("credMap"), DSL.value("dave")), DSL.value("123"))), + DSL.eq(DSL.index(ref("credMap"), DSL.value("dave")), DSL.value("123"))), "credMap['dave'] == '123'")) .captureSnapshot(true) .evaluateAt(MethodLocation.EXIT) @@ -2734,6 +2740,28 @@ public void ensureCallingSamplingLogTemplateOnlyConditionError() doSamplingTest(this::nullConditionTemplateOnly, ProbeRateLimiter::setGlobalLogRate, 1, 0, 1); } + @Test + public void ensureCallingSamplingCaptureExpression() throws IOException, URISyntaxException { + doSamplingTest(this::captureExpressions, 1, 1); + } + + @Test + public void ensureCallingSamplingCaptureExpressionWithCondition() + throws IOException, URISyntaxException { + doSamplingTest(this::captureExpressionsWithCondition, 1, 1); + } + + @Test + public void ensureCallingSamplingCaptureExpressionWithNullCondition() + throws IOException, URISyntaxException { + doSamplingTest( + this::captureExpressionsWithNullCondition, + ProbeRateLimiter::setGlobalSnapshotRate, + 1, + 1, + 0); + } + private void doSamplingTest(TestMethod testRun, int expectedGlobalCount, int expectedProbeCount) throws IOException, URISyntaxException { doSamplingTest( @@ -2900,15 +2928,52 @@ public void captureExpressions() throws IOException, URISyntaxException { "typed_fld_fld_msg", new ValueScript( DSL.getMember( - DSL.getMember(DSL.getMember(DSL.ref("typed"), "fld"), "fld"), - "msg"), + DSL.getMember(DSL.getMember(ref("typed"), "fld"), "fld"), "msg"), "typed.fld.fld.msg"), null), new LogProbe.CaptureExpression( "nullTyped_fld", + new ValueScript(DSL.getMember(ref("nullTyped"), "fld"), "nullTyped.fld"), + null))) + .build(); + TestSnapshotListener listener = installProbes(probe); + Class testClass = compileAndLoadClass(CLASS_NAME); + int result = Reflect.onClass(testClass).call("main", "1").get(); + assertEquals(3, result); + Snapshot snapshot = assertOneSnapshot(listener); + assertEquals(2, snapshot.getCaptures().getReturn().getCaptureExpressions().size()); + assertCaptureExpressions( + snapshot.getCaptures().getReturn(), + "typed_fld_fld_msg", + String.class.getTypeName(), + "hello"); + assertCaptureExpressions( + snapshot.getCaptures().getReturn(), "nullTyped_fld", Object.class.getTypeName(), null); + } + + @Test + public void captureExpressionsWithCondition() throws IOException, URISyntaxException { + final String CLASS_NAME = "CapturedSnapshot08"; + LogProbe probe = + createProbeBuilder(PROBE_ID, CLASS_NAME, "doit", null) + .evaluateAt(MethodLocation.EXIT) + .captureSnapshot(false) + .captureExpressions( + Arrays.asList( + new LogProbe.CaptureExpression( + "typed_fld_fld_msg", new ValueScript( - DSL.getMember(DSL.ref("nullTyped"), "fld"), "nullTyped.fld"), + DSL.getMember( + DSL.getMember(DSL.getMember(ref("typed"), "fld"), "fld"), "msg"), + "typed.fld.fld.msg"), + null), + new LogProbe.CaptureExpression( + "nullTyped_fld", + new ValueScript(DSL.getMember(ref("nullTyped"), "fld"), "nullTyped.fld"), null))) + .when( + new ProbeCondition( + DSL.when(not(DSL.eq(ref("typed"), nullValue()))), "typed != null")) .build(); TestSnapshotListener listener = installProbes(probe); Class testClass = compileAndLoadClass(CLASS_NAME); @@ -2925,6 +2990,44 @@ public void captureExpressions() throws IOException, URISyntaxException { snapshot.getCaptures().getReturn(), "nullTyped_fld", Object.class.getTypeName(), null); } + @Test + public void captureExpressionsWithNullCondition() throws IOException, URISyntaxException { + final String CLASS_NAME = "CapturedSnapshot08"; + LogProbe logProbes = + createProbeBuilder(PROBE_ID, CLASS_NAME, "doit", "int (java.lang.String)") + .when( + new ProbeCondition( + DSL.when( + DSL.eq( + DSL.getMember( + DSL.getMember(DSL.getMember(ref("nullTyped"), "fld"), "fld"), + "msg"), + DSL.value("hello"))), + "nullTyped.fld.fld.msg == 'hello'")) + .captureSnapshot(false) + .template("plain log", Collections.emptyList()) + .captureExpressions( + Arrays.asList( + new LogProbe.CaptureExpression( + "typed_fld_fld_msg", + new ValueScript( + DSL.getMember( + DSL.getMember(DSL.getMember(ref("typed"), "fld"), "fld"), "msg"), + "typed.fld.fld.msg"), + null))) + .build(); + TestSnapshotListener listener = installProbes(logProbes); + Class testClass = compileAndLoadClass(CLASS_NAME); + int result = Reflect.onClass(testClass).call("main", "1").get(); + assertEquals(3, result); + Snapshot snapshot = assertOneSnapshot(listener); + assertEquals("Cannot dereference field: fld", snapshot.getMessage()); + List evaluationErrors = snapshot.getEvaluationErrors(); + assertEquals(1, evaluationErrors.size()); + assertEquals("nullTyped.fld.fld", evaluationErrors.get(0).getExpr()); + assertEquals("Cannot dereference field: fld", evaluationErrors.get(0).getMessage()); + } + @Test public void captureExpressionsPrimitives() throws IOException, URISyntaxException { final String CLASS_NAME = "CapturedSnapshot08"; @@ -2936,10 +3039,10 @@ public void captureExpressionsPrimitives() throws IOException, URISyntaxExceptio Arrays.asList( new LogProbe.CaptureExpression( "this_fld", - new ValueScript(DSL.getMember(DSL.ref("this"), "fld"), "this.fld"), + new ValueScript(DSL.getMember(ref("this"), "fld"), "this.fld"), null), new LogProbe.CaptureExpression( - "var1", new ValueScript(DSL.ref("var1"), "var1"), null))) + "var1", new ValueScript(ref("var1"), "var1"), null))) .build(); TestSnapshotListener listener = installProbes(probe); Class testClass = compileAndLoadClass(CLASS_NAME); @@ -2965,14 +3068,12 @@ public void captureExpressionsLineProbe() throws IOException, URISyntaxException "typed_fld_fld_msg", new ValueScript( DSL.getMember( - DSL.getMember(DSL.getMember(DSL.ref("typed"), "fld"), "fld"), - "msg"), + DSL.getMember(DSL.getMember(ref("typed"), "fld"), "fld"), "msg"), "typed.fld.fld.msg"), null), new LogProbe.CaptureExpression( "nullTyped_fld", - new ValueScript( - DSL.getMember(DSL.ref("nullTyped"), "fld"), "nullTyped.fld"), + new ValueScript(DSL.getMember(ref("nullTyped"), "fld"), "nullTyped.fld"), null))) .build(); TestSnapshotListener listener = installProbes(probe); @@ -3000,13 +3101,12 @@ public void captureExpressionsWithCaptureLimits() throws IOException, URISyntaxE "typed_fld_fld_msg", new ValueScript( DSL.getMember( - DSL.getMember(DSL.getMember(DSL.ref("typed"), "fld"), "fld"), - "msg"), + DSL.getMember(DSL.getMember(ref("typed"), "fld"), "fld"), "msg"), "typed.fld.fld.msg"), new LogProbe.Capture(3, 100, 3, 20)), new LogProbe.CaptureExpression( "typed", - new ValueScript(DSL.ref("typed"), "typed"), + new ValueScript(ref("typed"), "typed"), new LogProbe.Capture(1, 1, 3, 20)))) .build(); TestSnapshotListener listener = installProbes(probe); @@ -3043,12 +3143,11 @@ public void captureExpressionsWithInheritedCaptureLimits() "typed_fld_fld_msg", new ValueScript( DSL.getMember( - DSL.getMember(DSL.getMember(DSL.ref("typed"), "fld"), "fld"), - "msg"), + DSL.getMember(DSL.getMember(ref("typed"), "fld"), "fld"), "msg"), "typed.fld.fld.msg"), null), new LogProbe.CaptureExpression( - "typed", new ValueScript(DSL.ref("typed"), "typed"), null))) + "typed", new ValueScript(ref("typed"), "typed"), null))) .build(); TestSnapshotListener listener = installProbes(probe); Class testClass = compileAndLoadClass(CLASS_NAME); @@ -3184,6 +3283,10 @@ public void noInstrumentationForAgentClasses() throws Exception { @Test @EnabledForJreRange(min = JRE.JAVA_17) public void recordWithTypeAnnotation() throws IOException, URISyntaxException { + if (JavaVirtualMachine.isJavaVersionAtLeast(25, 0, 4)) { + // Fixed since JDK 25.0.4 + return; + } final String CLASS_NAME = "com.datadog.debugger.CapturedSnapshot33"; LogProbe probe1 = createMethodProbeAtExit(PROBE_ID1, CLASS_NAME, "parse", null); TestSnapshotListener listener = installProbes(probe1); diff --git a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/ConfigurationUpdaterTest.java b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/ConfigurationUpdaterTest.java index 0ec8e1622e1..46566536eac 100644 --- a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/ConfigurationUpdaterTest.java +++ b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/ConfigurationUpdaterTest.java @@ -2,6 +2,9 @@ import static com.datadog.debugger.agent.ConfigurationAcceptor.Source.REMOTE_CONFIG; import static com.datadog.debugger.agent.DebuggerProductChangesListener.LOG_PROBE_PREFIX; +import static com.datadog.debugger.agent.DebuggerProductChangesListener.METRIC_PROBE_PREFIX; +import static com.datadog.debugger.agent.DebuggerProductChangesListener.SPAN_DECORATION_PROBE_PREFIX; +import static com.datadog.debugger.agent.DebuggerProductChangesListener.SPAN_PROBE_PREFIX; import static com.datadog.debugger.probe.ProbeDefinitionDeserializer.deserializeLogProbe; import static com.datadog.debugger.probe.ProbeDefinitionDeserializer.deserializeSpanDecorationProbe; import static com.datadog.debugger.probe.ProbeDefinitionDeserializer.deserializeTriggerProbe; @@ -643,7 +646,10 @@ public void handleException() { ConfigurationUpdater configurationUpdater = createConfigUpdater(debuggerSinkWithMockStatusSink); Exception ex = new Exception("oops"); configurationUpdater.handleException(LOG_PROBE_PREFIX + PROBE_ID.getId(), ex); - verify(probeStatusSink).addError(eq(ProbeId.from(PROBE_ID.getId() + ":0")), eq(ex)); + configurationUpdater.handleException(METRIC_PROBE_PREFIX + PROBE_ID.getId(), ex); + configurationUpdater.handleException(SPAN_PROBE_PREFIX + PROBE_ID.getId(), ex); + configurationUpdater.handleException(SPAN_DECORATION_PROBE_PREFIX + PROBE_ID.getId(), ex); + verify(probeStatusSink, times(4)).addError(eq(ProbeId.from(PROBE_ID.getId() + ":0")), eq(ex)); } @Test @@ -709,9 +715,10 @@ public void methodParametersAttributeRecord() @EnabledForJreRange(min = JRE.JAVA_17) public void recordWithTypeAnnotation() throws IOException, URISyntaxException, UnmodifiableClassException { - // make sure record method are not detected as having methodParameters attribute. - // /!\ record canonical constructor has the MethodParameters attribute, - // but not returned by Class::getDeclaredMethods() + if (JavaVirtualMachine.isJavaVersionAtLeast(25, 0, 4)) { + // Fixed since JDK 25.0.4 + return; + } final String CLASS_NAME = "com.datadog.debugger.CapturedSnapshot33"; Map buffers = compile(CLASS_NAME, SourceCompiler.DebugInfo.ALL, "17"); Class testClass = loadClass(CLASS_NAME, buffers); diff --git a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/DebuggerTracerTest.java b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/DebuggerTracerTest.java index 00cc4a76de8..df303939e4b 100644 --- a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/DebuggerTracerTest.java +++ b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/DebuggerTracerTest.java @@ -20,7 +20,7 @@ class DebuggerTracerTest { @AfterEach public void after() { - AgentTracer.forceRegister(null); + AgentTracer.forceRegister(AgentTracer.NOOP_TRACER); } @Test @@ -60,7 +60,7 @@ public void setError() { @Test public void noApi() { - AgentTracer.forceRegister(null); + AgentTracer.forceRegister(AgentTracer.NOOP_TRACER); ProbeStatusSink probeStatusSink = mock(ProbeStatusSink.class); DebuggerTracer debuggerTracer = new DebuggerTracer(probeStatusSink); DebuggerSpan span = diff --git a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/LogProbesInstrumentationTest.java b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/LogProbesInstrumentationTest.java index 6858a40f40f..1066f3d269d 100644 --- a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/LogProbesInstrumentationTest.java +++ b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/LogProbesInstrumentationTest.java @@ -28,6 +28,7 @@ import java.lang.instrument.ClassFileTransformer; import java.lang.instrument.Instrumentation; import java.net.URISyntaxException; +import java.time.Duration; import java.util.Collection; import java.util.List; import net.bytebuddy.agent.ByteBuddyAgent; @@ -550,12 +551,16 @@ private static LogProbe.Builder createProbeBuilder( private static LogProbe createMethodProbe( ProbeId id, String template, String typeName, String methodName, String signature) { - return createProbeBuilder(id, template, typeName, methodName, signature).build(); + return createProbeBuilder(id, template, typeName, methodName, signature) + .evalTimeout(Duration.ofMillis(1000)) + .build(); } private static LogProbe createLineProbe( ProbeId id, String template, String sourceFile, int line) { - return createProbeBuilder(id, template, sourceFile, line).build(); + return createProbeBuilder(id, template, sourceFile, line) + .evalTimeout(Duration.ofMillis(1000)) + .build(); } private TestSnapshotListener installProbes(Configuration configuration) { diff --git a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/MetricProbesInstrumentationTest.java b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/MetricProbesInstrumentationTest.java index 83f5a81e5bb..413fa216cb9 100644 --- a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/MetricProbesInstrumentationTest.java +++ b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/MetricProbesInstrumentationTest.java @@ -31,10 +31,12 @@ import datadog.trace.bootstrap.debugger.DebuggerContext; import datadog.trace.bootstrap.debugger.MethodLocation; import datadog.trace.bootstrap.debugger.ProbeId; +import java.io.File; import java.io.IOException; import java.lang.instrument.ClassFileTransformer; import java.lang.instrument.Instrumentation; import java.net.URISyntaxException; +import java.net.URL; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -456,6 +458,33 @@ public void methodSyntheticDurationGaugeMetric() throws IOException, URISyntaxEx assertArrayEquals(new String[] {METRIC_PROBEID_TAG}, listener.lastTags); } + @Test + public void methodSyntheticDurationKotlinDist() { + final String CLASS_NAME = "CapturedSnapshot302"; + String METRIC_NAME = "syn_dist"; + MetricProbe metricProbe = + createMetricBuilder(METRIC_ID, METRIC_NAME, DISTRIBUTION) + .where(CLASS_NAME, "download", null) + .valueScript(new ValueScript(DSL.ref("@duration"), "@duration")) + .evaluateAt(MethodLocation.EXIT) + .build(); + MetricForwarderListener listener = installMetricProbes(metricProbe); + URL resource = CapturedSnapshotTest.class.getResource("/" + CLASS_NAME + ".kt"); + List filesToDelete = new ArrayList<>(); + try { + Class testClass = + KotlinHelper.compileAndLoad(CLASS_NAME, resource.getFile(), filesToDelete); + Object companion = Reflect.onClass(testClass).get("Companion"); + int result = Reflect.on(companion).call("main", "1").get(); + assertEquals(1, result); + assertTrue(listener.doubleDistributions.containsKey(METRIC_NAME)); + assertTrue(listener.doubleDistributions.get(METRIC_NAME).doubleValue() > 0); + assertArrayEquals(new String[] {METRIC_PROBEID_TAG}, listener.lastTags); + } finally { + filesToDelete.forEach(File::delete); + } + } + @Test public void methodSyntheticDurationExceptionGaugeMetric() throws IOException, URISyntaxException { final String CLASS_NAME = "CapturedSnapshot05"; diff --git a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/SnapshotSerializationTest.java b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/SnapshotSerializationTest.java index 539a123b52d..0018c6d182b 100644 --- a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/SnapshotSerializationTest.java +++ b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/SnapshotSerializationTest.java @@ -31,6 +31,7 @@ import com.datadog.debugger.util.MoshiSnapshotTestHelper; import com.squareup.moshi.JsonAdapter; import datadog.environment.JavaVirtualMachine; +import datadog.trace.api.Config; import datadog.trace.bootstrap.debugger.CapturedContext; import datadog.trace.bootstrap.debugger.CapturedStackFrame; import datadog.trace.bootstrap.debugger.DebuggerContext; @@ -922,11 +923,9 @@ public void fieldCount20() throws IOException { @Test @Flaky public void timeOut() throws IOException { - DebuggerContext.initValueSerializer( - new TimeoutSnapshotSerializer(Duration.of(150, ChronoUnit.MILLIS))); + DebuggerContext.initValueSerializer(new TimeoutSnapshotSerializer(Duration.ofMillis(150))); JsonAdapter adapter = - MoshiHelper.createMoshiSnapshot(Duration.of(100, ChronoUnit.MILLIS)) - .adapter(Snapshot.class); + MoshiHelper.createMoshiSnapshot(Duration.ofMillis(100)).adapter(Snapshot.class); Snapshot snapshot = createSnapshot(); CapturedContext context = new CapturedContext(); CapturedContext.CapturedValue arg1 = CapturedContext.CapturedValue.of("arg1", "int", 42); @@ -949,7 +948,7 @@ public void valueTimeout() throws IOException { new TimeoutSnapshotSerializer(Duration.of(20, ChronoUnit.MILLIS))); CapturedContext.CapturedValue arg1 = CapturedContext.CapturedValue.of("arg1", Random.class.getTypeName(), new Random(0)); - arg1.freeze(new TimeoutChecker(Duration.ofMillis(10))); + arg1.freeze(TimeoutChecker.create(Config.get(), Duration.ofMillis(10))); String buffer = arg1.getStrValue(); System.out.println(buffer); Map json = MoshiHelper.createGenericAdapter().fromJson(buffer); diff --git a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/StringTemplateBuilderTest.java b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/StringTemplateBuilderTest.java index 3b704d38381..24b6ca671cb 100644 --- a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/StringTemplateBuilderTest.java +++ b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/agent/StringTemplateBuilderTest.java @@ -13,6 +13,7 @@ import datadog.trace.bootstrap.debugger.EvaluationError; import datadog.trace.bootstrap.debugger.Limits; import java.lang.management.ManagementFactory; +import java.time.Duration; import java.util.ArrayList; import java.util.Arrays; import java.util.LinkedHashMap; @@ -26,11 +27,13 @@ class StringTemplateBuilderTest { private static final Limits LIMITS = new Limits(1, 3, 255, 5); + private static final Duration TIMEOUT = Duration.ofSeconds(1); @Test public void emptyProbe() { LogProbe probe = LogProbe.builder().build(); - StringTemplateBuilder summaryBuilder = new StringTemplateBuilder(probe.getSegments(), LIMITS); + StringTemplateBuilder summaryBuilder = + new StringTemplateBuilder(probe.getSegments(), LIMITS, TIMEOUT); String message = summaryBuilder.evaluate(new CapturedContext(), new LogProbe.LogStatus(probe)); assertNull(message); } @@ -38,7 +41,8 @@ public void emptyProbe() { @Test public void emptyTemplate() { LogProbe probe = createLogProbe(""); - StringTemplateBuilder summaryBuilder = new StringTemplateBuilder(probe.getSegments(), LIMITS); + StringTemplateBuilder summaryBuilder = + new StringTemplateBuilder(probe.getSegments(), LIMITS, TIMEOUT); String message = summaryBuilder.evaluate(new CapturedContext(), new LogProbe.LogStatus(probe)); assertEquals("", message); } @@ -46,7 +50,8 @@ public void emptyTemplate() { @Test public void onlyStringTemplate() { LogProbe probe = createLogProbe("this is a simple string"); - StringTemplateBuilder summaryBuilder = new StringTemplateBuilder(probe.getSegments(), LIMITS); + StringTemplateBuilder summaryBuilder = + new StringTemplateBuilder(probe.getSegments(), LIMITS, TIMEOUT); String message = summaryBuilder.evaluate(new CapturedContext(), new LogProbe.LogStatus(probe)); assertEquals("this is a simple string", message); } @@ -54,7 +59,8 @@ public void onlyStringTemplate() { @Test public void undefinedArgTemplate() { LogProbe probe = createLogProbe("{arg}"); - StringTemplateBuilder summaryBuilder = new StringTemplateBuilder(probe.getSegments(), LIMITS); + StringTemplateBuilder summaryBuilder = + new StringTemplateBuilder(probe.getSegments(), LIMITS, TIMEOUT); String message = summaryBuilder.evaluate(new CapturedContext(), new LogProbe.LogStatus(probe)); assertEquals("{Cannot find symbol: arg}", message); } @@ -62,7 +68,8 @@ public void undefinedArgTemplate() { @Test public void argTemplate() { LogProbe probe = createLogProbe("{arg}"); - StringTemplateBuilder summaryBuilder = new StringTemplateBuilder(probe.getSegments(), LIMITS); + StringTemplateBuilder summaryBuilder = + new StringTemplateBuilder(probe.getSegments(), LIMITS, TIMEOUT); CapturedContext capturedContext = new CapturedContext(); capturedContext.addArguments( new CapturedContext.CapturedValue[] { @@ -80,7 +87,8 @@ public void booleanArgTemplate() { new ValueScript( DSL.bool(DSL.contains(DSL.ref("arg"), new StringValue("o"))), "{arg}"))); LogProbe probe = LogProbe.builder().template("{contains(arg, 'o')}", segments).build(); - StringTemplateBuilder summaryBuilder = new StringTemplateBuilder(probe.getSegments(), LIMITS); + StringTemplateBuilder summaryBuilder = + new StringTemplateBuilder(probe.getSegments(), LIMITS, TIMEOUT); CapturedContext capturedContext = new CapturedContext(); capturedContext.addArguments( new CapturedContext.CapturedValue[] { @@ -93,14 +101,16 @@ public void booleanArgTemplate() { @Test public void argMultipleInFlightTemplate() { LogProbe probe = createLogProbe("{arg}"); - StringTemplateBuilder summaryBuilder = new StringTemplateBuilder(probe.getSegments(), LIMITS); + StringTemplateBuilder summaryBuilder = + new StringTemplateBuilder(probe.getSegments(), LIMITS, TIMEOUT); CapturedContext capturedContext = new CapturedContext(); capturedContext.addArguments( new CapturedContext.CapturedValue[] { CapturedContext.CapturedValue.of("arg", String.class.getTypeName(), "foo") }); String message = summaryBuilder.evaluate(capturedContext, new LogProbe.LogStatus(probe)); - StringTemplateBuilder summaryBuilder2 = new StringTemplateBuilder(probe.getSegments(), LIMITS); + StringTemplateBuilder summaryBuilder2 = + new StringTemplateBuilder(probe.getSegments(), LIMITS, TIMEOUT); CapturedContext capturedContext2 = new CapturedContext(); capturedContext2.addArguments( new CapturedContext.CapturedValue[] { @@ -114,7 +124,8 @@ public void argMultipleInFlightTemplate() { @Test public void argNullTemplate() { LogProbe probe = createLogProbe("{nullObject}"); - StringTemplateBuilder summaryBuilder = new StringTemplateBuilder(probe.getSegments(), LIMITS); + StringTemplateBuilder summaryBuilder = + new StringTemplateBuilder(probe.getSegments(), LIMITS, TIMEOUT); CapturedContext capturedContext = new CapturedContext(); capturedContext.addArguments( new CapturedContext.CapturedValue[] { @@ -127,7 +138,8 @@ public void argNullTemplate() { @Test public void argArrayTemplate() { LogProbe probe = createLogProbe("{primArray} {strArray}"); - StringTemplateBuilder summaryBuilder = new StringTemplateBuilder(probe.getSegments(), LIMITS); + StringTemplateBuilder summaryBuilder = + new StringTemplateBuilder(probe.getSegments(), LIMITS, TIMEOUT); CapturedContext capturedContext = new CapturedContext(); capturedContext.addArguments( new CapturedContext.CapturedValue[] { @@ -147,7 +159,8 @@ public void argArrayTemplate() { @Test public void argCollectionTemplate() { LogProbe probe = createLogProbe("{strList} {strSet}"); - StringTemplateBuilder summaryBuilder = new StringTemplateBuilder(probe.getSegments(), LIMITS); + StringTemplateBuilder summaryBuilder = + new StringTemplateBuilder(probe.getSegments(), LIMITS, TIMEOUT); CapturedContext capturedContext = new CapturedContext(); capturedContext.addArguments( new CapturedContext.CapturedValue[] { @@ -173,7 +186,8 @@ public void argCollectionTemplate() { @Test public void argMapTemplate() { LogProbe probe = createLogProbe("{strMap}"); - StringTemplateBuilder summaryBuilder = new StringTemplateBuilder(probe.getSegments(), LIMITS); + StringTemplateBuilder summaryBuilder = + new StringTemplateBuilder(probe.getSegments(), LIMITS, TIMEOUT); CapturedContext capturedContext = new CapturedContext(); Map map = new LinkedHashMap<>(); for (int i = 0; i < 10; i++) { @@ -201,7 +215,8 @@ static class Level1 { @Test public void argComplexObjectTemplate() { LogProbe probe = createLogProbe("{obj}"); - StringTemplateBuilder summaryBuilder = new StringTemplateBuilder(probe.getSegments(), LIMITS); + StringTemplateBuilder summaryBuilder = + new StringTemplateBuilder(probe.getSegments(), LIMITS, TIMEOUT); CapturedContext capturedContext = new CapturedContext(); capturedContext.addArguments( new CapturedContext.CapturedValue[] { @@ -214,7 +229,8 @@ public void argComplexObjectTemplate() { @Test public void argComplexObjectArrayTemplate() { LogProbe probe = createLogProbe("{array}"); - StringTemplateBuilder summaryBuilder = new StringTemplateBuilder(probe.getSegments(), LIMITS); + StringTemplateBuilder summaryBuilder = + new StringTemplateBuilder(probe.getSegments(), LIMITS, TIMEOUT); CapturedContext capturedContext = new CapturedContext(); capturedContext.addArguments( new CapturedContext.CapturedValue[] { @@ -230,7 +246,8 @@ public void argComplexObjectArrayTemplate() { @DisabledIf("datadog.environment.JavaVirtualMachine#isJ9") public void argInaccessibleFieldTemplate() { LogProbe probe = createLogProbe("{obj}"); - StringTemplateBuilder summaryBuilder = new StringTemplateBuilder(probe.getSegments(), LIMITS); + StringTemplateBuilder summaryBuilder = + new StringTemplateBuilder(probe.getSegments(), LIMITS, TIMEOUT); CapturedContext capturedContext = new CapturedContext(); capturedContext.addArguments( new CapturedContext.CapturedValue[] { diff --git a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/el/ELIntegrationSanityTest.java b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/el/ELIntegrationSanityTest.java index 9ac26df3239..7b6382cae21 100644 --- a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/el/ELIntegrationSanityTest.java +++ b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/el/ELIntegrationSanityTest.java @@ -4,6 +4,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import com.datadog.debugger.agent.JsonSnapshotSerializer; +import datadog.trace.api.Config; import datadog.trace.bootstrap.debugger.CapturedContext; import datadog.trace.bootstrap.debugger.DebuggerContext; import datadog.trace.bootstrap.debugger.Limits; @@ -59,12 +60,16 @@ void extractAfterEl() throws IllegalAccessException { capturedContext.addArguments(new CapturedContext.CapturedValue[] {thisValue}); // '.name.value' is not present in the snapshot - it needs to be retrieved via reflection - Value val = DSL.getMember(DSL.ref("name"), "value").evaluate(capturedContext); + Value val = + DSL.getMember(DSL.ref("name"), "value") + .evaluate( + new EvalContext( + capturedContext, TimeoutChecker.create(Config.get(), Duration.ofMillis(1000)))); // make sure the nested field was properly resolved assertEquals(p.name.value, val.getValue()); // freeze the captured context - capturedContext.freeze(new TimeoutChecker(Duration.of(1, ChronoUnit.SECONDS))); + capturedContext.freeze(TimeoutChecker.create(Config.get(), Duration.of(1, ChronoUnit.SECONDS))); // after freezing the original value is removed and only the serialized json representation // remains diff --git a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/exception/ExceptionProbeInstrumentationTest.java b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/exception/ExceptionProbeInstrumentationTest.java index e72e14c4201..64709cc54ee 100644 --- a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/exception/ExceptionProbeInstrumentationTest.java +++ b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/exception/ExceptionProbeInstrumentationTest.java @@ -135,6 +135,9 @@ public void onlyInstrument() throws Exception { } @Test + @DisabledIf( + value = "datadog.environment.JavaVirtualMachine#isJ9", + disabledReason = "Bug in J9: no LocalVariableTable for ClassFileTransformer") public void instrumentAndCaptureSnapshots() throws Exception { Config config = createConfig(); ExceptionProbeManager exceptionProbeManager = new ExceptionProbeManager(classNameFiltering); @@ -162,6 +165,8 @@ public void instrumentAndCaptureSnapshots() throws Exception { assertEquals(fingerprint, span.getTags().get(DD_DEBUG_ERROR_EXCEPTION_HASH)); assertEquals(Boolean.TRUE, span.getTags().get(Tags.ERROR_DEBUG_INFO_CAPTURED)); assertEquals(snapshot0.getId(), span.getTags().get(String.format(SNAPSHOT_ID_TAG_FMT, 0))); + assertTrue(snapshot0.getCaptures().getReturn().getArguments().containsKey("arg")); + assertTrue(snapshot0.getCaptures().getReturn().getLocals().containsKey("intLocal")); assertEquals(1, probeSampler.getCallCount()); assertEquals(1, globalSampler.getCallCount()); } diff --git a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/probe/LogProbeTest.java b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/probe/LogProbeTest.java index 07b7ae05185..a3c25c48021 100644 --- a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/probe/LogProbeTest.java +++ b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/probe/LogProbeTest.java @@ -16,6 +16,7 @@ import com.datadog.debugger.sink.DebuggerSink; import com.datadog.debugger.sink.ProbeStatusSink; import com.datadog.debugger.sink.Snapshot; +import datadog.context.ContextScope; import datadog.trace.api.Config; import datadog.trace.api.IdGenerationStrategy; import datadog.trace.bootstrap.debugger.CapturedContext; @@ -23,7 +24,6 @@ import datadog.trace.bootstrap.debugger.MethodLocation; import datadog.trace.bootstrap.debugger.ProbeId; import datadog.trace.bootstrap.debugger.ProbeRateLimiter; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; import datadog.trace.bootstrap.instrumentation.api.AgentTracer.TracerAPI; @@ -136,7 +136,7 @@ private int runTrace(TracerAPI tracer, boolean captureSnapshot, Integer line, St if (sessionId != null) { span.setTag(Tags.PROPAGATED_DEBUG, sessionId + ":1"); } - try (AgentScope scope = tracer.activateManualSpan(span)) { + try (ContextScope scope = tracer.activateManualSpan(span)) { Builder builder = createLog("Budget testing").probeId(ProbeId.newId()).captureSnapshot(captureSnapshot); if (sessionId != null) { @@ -177,7 +177,7 @@ private boolean fillSnapshot(DebugSessionStatus status) { CoreTracer.builder().idGenerationStrategy(IdGenerationStrategy.fromName("random")).build(); AgentTracer.registerIfAbsent(tracer); AgentSpan span = tracer.startSpan("log probe debug session testing", "test span"); - try (AgentScope scope = tracer.activateManualSpan(span)) { + try (ContextScope scope = tracer.activateManualSpan(span)) { if (status == DebugSessionStatus.ACTIVE) { span.setTag(Tags.PROPAGATED_DEBUG, DEBUG_SESSION_ID + ":1"); } else if (status == DebugSessionStatus.DISABLED) { diff --git a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/sink/SymbolSinkTest.java b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/sink/SymbolSinkTest.java index 91a5743d2a0..5ec1471f92a 100644 --- a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/sink/SymbolSinkTest.java +++ b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/sink/SymbolSinkTest.java @@ -24,6 +24,8 @@ public void testSimpleFlush() { SymbolUploaderMock symbolUploaderMock = new SymbolUploaderMock(); Config config = mock(Config.class); when(config.getServiceName()).thenReturn("service1"); + when(config.getVersion()).thenReturn("1.0.0"); + when(config.getRuntimeId()).thenReturn("test-runtime"); when(config.isSymbolDatabaseCompressed()).thenReturn(false); SymbolSink symbolSink = new SymbolSink(config, symbolUploaderMock, MAX_SYMDB_UPLOAD_SIZE); symbolSink.addScope(Scope.builder(ScopeType.JAR, null, 0, 0).build()); @@ -35,13 +37,25 @@ public void testSimpleFlush() { String strEventContent = new String(eventContent.getContent()); assertTrue(strEventContent.contains("\"ddsource\": \"dd_debugger\"")); assertTrue(strEventContent.contains("\"service\": \"service1\"")); + assertTrue(strEventContent.contains("\"version\": \"1.0.0\"")); + assertTrue(strEventContent.contains("\"language\": \"java\"")); + assertTrue(strEventContent.contains("\"runtimeId\": \"test-runtime\"")); assertTrue(strEventContent.contains("\"type\": \"symdb\"")); + assertTrue(strEventContent.contains("\"uploadId\":")); + assertTrue(strEventContent.contains("\"batchNum\": 1")); + assertTrue(strEventContent.contains("\"final\": false")); + assertTrue(strEventContent.contains("\"attachmentSize\":")); BatchUploader.MultiPartContent symbolContent = symbolUploaderMock.multiPartContents.get(1); assertEquals("file", symbolContent.getPartName()); assertEquals("file.json", symbolContent.getFileName()); - assertEquals( - "{\"language\":\"JAVA\",\"scopes\":[{\"end_line\":0,\"has_injectible_lines\":false,\"scope_type\":\"JAR\",\"start_line\":0}],\"service\":\"service1\"}", - new String(symbolContent.getContent())); + String fileContent = new String(symbolContent.getContent()); + assertTrue(fileContent.contains("\"language\":\"JAVA\"")); + assertTrue(fileContent.contains("\"scopes\":[")); + assertTrue(fileContent.contains("\"service\":\"service1\"")); + assertTrue(fileContent.contains("\"version\":\"1.0.0\"")); + assertTrue(fileContent.contains("\"upload_id\":")); + assertTrue(fileContent.contains("\"batch_num\":1")); + assertTrue(fileContent.contains("\"final\":false")); } @Test @@ -219,8 +233,13 @@ public void maxCompressedAndSplit() { .build()); } symbolSink.flush(); - assertEquals(4, symbolUploaderMock.multiPartContents.size()); - for (int i = 0; i < 4; i += 2) { + int total = symbolUploaderMock.multiPartContents.size(); + assertTrue( + total >= 4, "expected at least 4 multipart entries (2+ event/file pairs), got " + total); + assertTrue( + total % 2 == 0, + "expected an even number of multipart entries (event/file pairs), got " + total); + for (int i = 0; i < total; i += 2) { BatchUploader.MultiPartContent eventContent = symbolUploaderMock.multiPartContents.get(i); assertEquals("event", eventContent.getPartName()); BatchUploader.MultiPartContent symbolContent = diff --git a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/symbol/SourceRemapperTest.java b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/symbol/SourceRemapperTest.java index 891338d7674..4ec263429bb 100644 --- a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/symbol/SourceRemapperTest.java +++ b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/symbol/SourceRemapperTest.java @@ -30,4 +30,15 @@ public void kotlinSourceRemapper() { assertTrue(sourceRemapper instanceof SourceRemapper.KotlinSourceRemapper); assertEquals(24, sourceRemapper.remapSourceLine(42)); } + + @Test + public void noKotlinDebug() { + SourceMap sourceMapMock = mock(SourceMap.class); + when(sourceMapMock.getDefaultStratumName()).thenReturn("Main"); + StratumExt stratumMainMock = mock(StratumExt.class); + when(sourceMapMock.getStratum(eq("Kotlin"))).thenReturn(stratumMainMock); + when(sourceMapMock.getStratum(eq("KotlinDebug"))).thenReturn(null); + SourceRemapper sourceRemapper = SourceRemapper.getSourceRemapper("foo.kt", sourceMapMock); + assertNotNull(sourceRemapper); + } } diff --git a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/symbol/SymbolExtractionTransformerTest.java b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/symbol/SymbolExtractionTransformerTest.java index c6e488752c4..cef56569746 100644 --- a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/symbol/SymbolExtractionTransformerTest.java +++ b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/symbol/SymbolExtractionTransformerTest.java @@ -968,7 +968,6 @@ public void symbolExtraction15() throws IOException, URISyntaxException { } @Test - @EnabledForJreRange(max = JRE.JAVA_25) @DisabledIf( value = "datadog.environment.JavaVirtualMachine#isJ9", disabledReason = "Flaky on J9 JVMs") @@ -996,13 +995,13 @@ public void symbolExtraction16() throws IOException, URISyntaxException { KotlinHelper.compileAndLoad(CLASS_NAME, resource.getFile(), filesToDelete); Object companion = Reflect.onClass(testClass).get("Companion"); int result = Reflect.on(companion).call("main", "").get(); - assertEquals(48, result); + assertEquals(73, result); } finally { filesToDelete.forEach(File::delete); } - assertEquals(2, symbolSinkMock.jarScopes.size()); + assertEquals(4, symbolSinkMock.jarScopes.size()); Scope classScope = symbolSinkMock.jarScopes.get(0).getScopes().get(0); - assertScope(classScope, ScopeType.CLASS, CLASS_NAME, 6, 23, SOURCE_FILE, 5, 1); + assertScope(classScope, ScopeType.CLASS, CLASS_NAME, 6, 28, SOURCE_FILE, 6, 1); assertLangSpecifics( classScope.getLanguageSpecifics(), asList("public", "final"), @@ -1027,12 +1026,15 @@ public void symbolExtraction16() throws IOException, URISyntaxException { Scope f3MethodScope = classScope.getScopes().get(3); assertScope(f3MethodScope, ScopeType.METHOD, "f3", 21, 23, SOURCE_FILE, 1, 1); assertLineRanges(f3MethodScope, "21-23"); + Scope f4MethodScope = classScope.getScopes().get(4); + assertScope(f4MethodScope, ScopeType.METHOD, "f4", 27, 28, SOURCE_FILE, 1, 1); + assertLineRanges(f4MethodScope, "27-28"); assertScope( - classScope.getScopes().get(4), ScopeType.METHOD, "", 0, 0, SOURCE_FILE, 0, 0); + classScope.getScopes().get(5), ScopeType.METHOD, "", 0, 0, SOURCE_FILE, 0, 0); Scope companionClassScope = symbolSinkMock.jarScopes.get(1).getScopes().get(0); assertScope( - companionClassScope, ScopeType.CLASS, CLASS_NAME + "$Companion", 28, 29, SOURCE_FILE, 3, 0); + companionClassScope, ScopeType.CLASS, CLASS_NAME + "$Companion", 33, 34, SOURCE_FILE, 3, 0); assertLangSpecifics( classScope.getLanguageSpecifics(), asList("public", "final"), @@ -1050,8 +1052,8 @@ public void symbolExtraction16() throws IOException, URISyntaxException { 0, 0); Scope mainMethodScope = companionClassScope.getScopes().get(1); - assertScope(mainMethodScope, ScopeType.METHOD, "main", 28, 29, SOURCE_FILE, 1, 1); - assertLineRanges(mainMethodScope, "28-29"); + assertScope(mainMethodScope, ScopeType.METHOD, "main", 33, 34, SOURCE_FILE, 1, 1); + assertLineRanges(mainMethodScope, "33-34"); } @Test diff --git a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/trigger/TriggerProbeTest.java b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/trigger/TriggerProbeTest.java index 6b895a9dc13..ea6f181b4d1 100644 --- a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/trigger/TriggerProbeTest.java +++ b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/trigger/TriggerProbeTest.java @@ -79,7 +79,7 @@ public void conditions() throws IOException, URISyntaxException { .filter( span -> { DDSpan ddSpan = (DDSpan) span; - PropagationTags tags = ddSpan.context().getPropagationTags(); + PropagationTags tags = ddSpan.spanContext().getPropagationTags(); return (TRIGGER_PROBE_SESSION_ID + ":1").equals(tags.getDebugPropagation()); }) .count(); @@ -137,7 +137,7 @@ public void cooldown() throws IOException, URISyntaxException { .filter( span -> { DDSpan ddSpan = (DDSpan) span; - PropagationTags tags = ddSpan.context().getPropagationTags(); + PropagationTags tags = ddSpan.spanContext().getPropagationTags(); return (TRIGGER_PROBE_SESSION_ID + ":1").equals(tags.getDebugPropagation()); }) .count(); diff --git a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/util/SpringHelperTest.java b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/util/SpringHelperTest.java index 526ecdd2adf..3381dfe71e6 100644 --- a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/util/SpringHelperTest.java +++ b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/util/SpringHelperTest.java @@ -35,4 +35,12 @@ void isSpringUsingOnlyMethodParametersFalseFallback() throws Exception { when(inst.getAllLoadedClasses()).thenReturn(new Class[0]); assertFalse(SpringHelper.isSpringUsingOnlyMethodParameters(inst)); } + + @Test + void invalidSpringVersion() { + IllegalArgumentException illegalArgumentException = + assertThrows( + IllegalArgumentException.class, () -> new SpringHelper.ParsedSpringVersion("foo")); + assertEquals("Cannot parse SpringVersion: foo", illegalArgumentException.getMessage()); + } } diff --git a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/util/StringTokenWriterTest.java b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/util/StringTokenWriterTest.java index 2480ca2004c..3009ff735d6 100644 --- a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/util/StringTokenWriterTest.java +++ b/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/util/StringTokenWriterTest.java @@ -7,10 +7,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; +import datadog.trace.api.Config; import datadog.trace.bootstrap.debugger.Limits; import datadog.trace.bootstrap.debugger.util.TimeoutChecker; import java.time.Duration; -import java.time.temporal.ChronoUnit; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -175,7 +175,7 @@ private String serializeValue(Object value, Limits limits) throws Exception { SerializerWithLimits serializer = new SerializerWithLimits( new StringTokenWriter(sb, new ArrayList<>()), - new TimeoutChecker(Duration.of(300, ChronoUnit.SECONDS))); + TimeoutChecker.create(Config.get(), Duration.ofSeconds(300))); serializer.serialize( value, value != null ? value.getClass().getTypeName() : Object.class.getTypeName(), limits); return sb.toString(); diff --git a/dd-java-agent/agent-debugger/src/test/resources/com/datadog/debugger/CapturedSnapshot20.java b/dd-java-agent/agent-debugger/src/test/resources/com/datadog/debugger/CapturedSnapshot20.java index 7dd2f39552c..d133f975073 100644 --- a/dd-java-agent/agent-debugger/src/test/resources/com/datadog/debugger/CapturedSnapshot20.java +++ b/dd-java-agent/agent-debugger/src/test/resources/com/datadog/debugger/CapturedSnapshot20.java @@ -1,7 +1,7 @@ package com.datadog.debugger; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.TracerInstaller; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; import datadog.trace.core.CoreTracer; @@ -24,8 +24,8 @@ public class CapturedSnapshot20 { public static int main(String arg) { AgentTracer.TracerAPI tracerAPI = AgentTracer.get(); - AgentSpan span = tracerAPI.buildSpan("process").start(); - try (AgentScope scope = tracerAPI.activateManualSpan(span)) { + AgentSpan span = tracerAPI.buildSpan("dynamic-instrumentation", "process").start(); + try (ContextScope scope = tracerAPI.activateManualSpan(span)) { if (arg.equals("exception") || arg.equals("illegal")) { return new CapturedSnapshot20().processWithException(arg); } diff --git a/dd-java-agent/agent-debugger/src/test/resources/com/datadog/debugger/CapturedSnapshot21.java b/dd-java-agent/agent-debugger/src/test/resources/com/datadog/debugger/CapturedSnapshot21.java index 0423fae5fc7..3f79b2e81f5 100644 --- a/dd-java-agent/agent-debugger/src/test/resources/com/datadog/debugger/CapturedSnapshot21.java +++ b/dd-java-agent/agent-debugger/src/test/resources/com/datadog/debugger/CapturedSnapshot21.java @@ -1,7 +1,7 @@ package com.datadog.debugger; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.TracerInstaller; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; import datadog.trace.core.CoreTracer; @@ -24,8 +24,8 @@ public class CapturedSnapshot21 { public static int main(String arg) { AgentTracer.TracerAPI tracerAPI = AgentTracer.get(); - AgentSpan span = tracerAPI.buildSpan("rootProcess").start(); - try (AgentScope scope = tracerAPI.activateManualSpan(span)) { + AgentSpan span = tracerAPI.buildSpan("dynamic-instrumentation", "rootProcess").start(); + try (ContextScope scope = tracerAPI.activateManualSpan(span)) { return new CapturedSnapshot21().rootProcess(arg); } finally { span.finish(); @@ -34,8 +34,8 @@ public static int main(String arg) { private int rootProcess(String arg) { AgentTracer.TracerAPI tracerAPI = AgentTracer.get(); - AgentSpan span = tracerAPI.buildSpan("process1").start(); - try (AgentScope scope = tracerAPI.activateManualSpan(span)) { + AgentSpan span = tracerAPI.buildSpan("dynamic-instrumentation", "process1").start(); + try (ContextScope scope = tracerAPI.activateManualSpan(span)) { return process1(arg) + 1; } finally { span.finish(); @@ -44,8 +44,8 @@ private int rootProcess(String arg) { private int process1(String arg) { AgentTracer.TracerAPI tracerAPI = AgentTracer.get(); - AgentSpan span = tracerAPI.buildSpan("process2").start(); - try (AgentScope scope = tracerAPI.activateManualSpan(span)) { + AgentSpan span = tracerAPI.buildSpan("dynamic-instrumentation", "process2").start(); + try (ContextScope scope = tracerAPI.activateManualSpan(span)) { return process2(arg) + 1; } finally { span.finish(); @@ -54,8 +54,8 @@ private int process1(String arg) { private int process2(String arg) { AgentTracer.TracerAPI tracerAPI = AgentTracer.get(); - AgentSpan span = tracerAPI.buildSpan("process3").start(); - try (AgentScope scope = tracerAPI.activateManualSpan(span)) { + AgentSpan span = tracerAPI.buildSpan("dynamic-instrumentation", "process3").start(); + try (ContextScope scope = tracerAPI.activateManualSpan(span)) { return process3(arg) + 1; } finally { span.finish(); diff --git a/dd-java-agent/agent-debugger/src/test/resources/com/datadog/debugger/CapturedSnapshot28.java b/dd-java-agent/agent-debugger/src/test/resources/com/datadog/debugger/CapturedSnapshot28.java index c1d5212e2d8..a756ffd10c1 100644 --- a/dd-java-agent/agent-debugger/src/test/resources/com/datadog/debugger/CapturedSnapshot28.java +++ b/dd-java-agent/agent-debugger/src/test/resources/com/datadog/debugger/CapturedSnapshot28.java @@ -1,7 +1,7 @@ package com.datadog.debugger; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.TracerInstaller; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; import datadog.trace.core.CoreTracer; @@ -25,8 +25,8 @@ public class CapturedSnapshot28 { public static int main(String arg) { AgentTracer.TracerAPI tracerAPI = AgentTracer.get(); - AgentSpan span = tracerAPI.buildSpan("process").start(); - try (AgentScope scope = tracerAPI.activateManualSpan(span)) { + AgentSpan span = tracerAPI.buildSpan("dynamic-instrumentation", "process").start(); + try (ContextScope scope = tracerAPI.activateManualSpan(span)) { return new CapturedSnapshot28().process(arg); } finally { span.finish(); diff --git a/dd-java-agent/agent-debugger/src/test/resources/com/datadog/debugger/symboltest/SymbolExtraction16.kt b/dd-java-agent/agent-debugger/src/test/resources/com/datadog/debugger/symboltest/SymbolExtraction16.kt index b3f73b84773..e13757d0814 100644 --- a/dd-java-agent/agent-debugger/src/test/resources/com/datadog/debugger/symboltest/SymbolExtraction16.kt +++ b/dd-java-agent/agent-debugger/src/test/resources/com/datadog/debugger/symboltest/SymbolExtraction16.kt @@ -23,10 +23,17 @@ class SymbolExtraction16 { return value } + fun f4(value: Int): Int { + val set = setOf(Person("john", "doe"), Person("agent", "smith")) + return set.groupingBy { it.firstName }.eachCount().toMutableMap().size + } + companion object { fun main(arg: String): Int { val c = SymbolExtraction16() - return c.f1(31) + c.f2(17) + return c.f1(31) + c.f2(17) + c.f3(23) + c.f4(0) } } } + +data class Person(val firstName: String, val lastName: String) diff --git a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/util/LogProbeTestHelper.java b/dd-java-agent/agent-debugger/src/testFixtures/java/com/datadog/debugger/util/LogProbeTestHelper.java similarity index 100% rename from dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/util/LogProbeTestHelper.java rename to dd-java-agent/agent-debugger/src/testFixtures/java/com/datadog/debugger/util/LogProbeTestHelper.java diff --git a/dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/util/MoshiSnapshotTestHelper.java b/dd-java-agent/agent-debugger/src/testFixtures/java/com/datadog/debugger/util/MoshiSnapshotTestHelper.java similarity index 100% rename from dd-java-agent/agent-debugger/src/test/java/com/datadog/debugger/util/MoshiSnapshotTestHelper.java rename to dd-java-agent/agent-debugger/src/testFixtures/java/com/datadog/debugger/util/MoshiSnapshotTestHelper.java diff --git a/dd-java-agent/agent-iast/build.gradle b/dd-java-agent/agent-iast/build.gradle index 70eabe4b74d..1909cf4bdc2 100644 --- a/dd-java-agent/agent-iast/build.gradle +++ b/dd-java-agent/agent-iast/build.gradle @@ -6,10 +6,10 @@ plugins { id 'me.champeau.jmh' id 'com.google.protobuf' version '0.10.0' id 'net.ltgt.errorprone' version '3.1.0' + id 'dd-trace-java.version-file' } apply from: "$rootDir/gradle/java.gradle" -apply from: "$rootDir/gradle/version.gradle" tasks.withType(AbstractCompile).configureEach { configureCompiler(it, 11, JavaVersion.VERSION_1_8, "Ensure no APIs beyond JDK8 are used") @@ -45,12 +45,12 @@ dependencies { implementation libs.moshi implementation libs.bundles.asm implementation libs.instrument.java + implementation libs.re2j testImplementation project(':utils:test-utils') testImplementation project(':dd-java-agent:agent-bootstrap') testImplementation('org.skyscreamer:jsonassert:1.5.1') testImplementation(libs.bytebuddy) - testImplementation(libs.guava) testImplementation(libs.groovy.yaml) diff --git a/dd-java-agent/agent-iast/gradle.lockfile b/dd-java-agent/agent-iast/gradle.lockfile index aa7587f3c9a..09eae496dcd 100644 --- a/dd-java-agent/agent-iast/gradle.lockfile +++ b/dd-java-agent/agent-iast/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-iast:dependencies --write-locks aopalliance:aopalliance:1.0=annotationProcessor,errorprone,jmhAnnotationProcessor,testAnnotationProcessor cafe.cryptography:curve25519-elisabeth:0.1.0=jmh,jmhCompileProtoPath,jmhRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=jmh,jmhCompileProtoPath,jmhRuntimeClasspath @@ -9,7 +10,7 @@ ch.qos.logback:logback-core:1.2.13=jmhRuntimeClasspath,testCompileClasspath,test com.blogspot.mydailyjava:weak-lock-free:0.17=compileProtoPath,jmh,jmhCompileClasspath,jmhCompileProtoPath,jmhRuntimeClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=jmh,jmhCompileClasspath,jmhCompileProtoPath,jmhRuntimeClasspath com.datadoghq.okio:okio:1.17.6=jmh,jmhCompileClasspath,jmhCompileProtoPath,jmhRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,compileProtoPath,jmh,jmhCompileClasspath,jmhCompileProtoPath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,compileProtoPath,jmh,jmhCompileClasspath,jmhCompileProtoPath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,compileProtoPath,jmh,jmhCompileClasspath,jmhCompileProtoPath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=jmh,jmhCompileProtoPath,jmhRuntimeClasspath com.datadoghq:sketches-java:0.8.3=jmh,jmhCompileProtoPath,jmhRuntimeClasspath @@ -20,16 +21,16 @@ com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.16.0=jmhRuntimeClassp com.fasterxml.jackson:jackson-bom:2.16.0=jmhRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath com.github.ben-manes.caffeine:caffeine:3.0.5=annotationProcessor,errorprone,jmhAnnotationProcessor,testAnnotationProcessor com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=jmh,jmhCompileProtoPath,jmhRuntimeClasspath +com.github.jnr:jffi:1.3.15=jmh,jmhCompileProtoPath,jmhRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=jmh,jmhCompileProtoPath,jmhRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=jmh,jmhCompileProtoPath,jmhRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=jmh,jmhCompileProtoPath,jmhRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=jmh,jmhCompileProtoPath,jmhRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=jmh,jmhCompileProtoPath,jmhRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=jmh,jmhCompileProtoPath,jmhRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=jmh,jmhCompileProtoPath,jmhRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=jmh,jmhCompileProtoPath,jmhRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=jmh,jmhCompileProtoPath,jmhRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=jmh,jmhCompileProtoPath,jmhRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=jmh,jmhCompileProtoPath,jmhRuntimeClasspath com.github.kevinstern:software-and-algorithms:1.0=annotationProcessor,errorprone,jmhAnnotationProcessor,testAnnotationProcessor -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,compileProtoPath,jmhCompileClasspath,jmhRuntimeClasspath,spotbugs,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,compileProtoPath,jmhCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.android:annotations:4.1.1.4=jmhRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath @@ -50,7 +51,6 @@ com.google.errorprone:error_prone_type_annotations:2.23.0=annotationProcessor,er com.google.errorprone:javac:9+181-r4173-1=errorproneJavac com.google.guava:failureaccess:1.0.1=annotationProcessor,errorprone,jmhAnnotationProcessor,jmhRuntimeClasspath,testAnnotationProcessor,testCompileProtoPath,testRuntimeClasspath com.google.guava:guava-parent:32.1.1-jre=annotationProcessor,errorprone,jmhAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath com.google.guava:guava:30.1.1-android=jmhRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath com.google.guava:guava:32.1.1-jre=annotationProcessor,errorprone,jmhAnnotationProcessor,testAnnotationProcessor com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=jmhRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath @@ -59,7 +59,7 @@ com.google.j2objc:j2objc-annotations:1.3=jmhRuntimeClasspath,testCompileProtoPat com.google.protobuf:protobuf-java:3.18.2=jmhRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.protobuf:protobuf-java:3.19.6=annotationProcessor,errorprone,jmhAnnotationProcessor,testAnnotationProcessor com.google.protobuf:protoc:3.17.3=protobufToolsLocator_protoc -com.google.re2j:re2j:1.7=jmh,jmhCompileProtoPath,jmhRuntimeClasspath +com.google.re2j:re2j:1.8=compileClasspath,compileProtoPath,jmh,jmhCompileClasspath,jmhCompileProtoPath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,compileProtoPath,jmh,jmhCompileClasspath,jmhCompileProtoPath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.squareup.okio:okio:1.17.5=compileClasspath,compileProtoPath,jmh,jmhCompileClasspath,jmhCompileProtoPath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc @@ -81,8 +81,8 @@ io.leangen.geantyref:geantyref:1.3.16=jmhRuntimeClasspath,testCompileProtoPath,t io.perfmark:perfmark-api:0.23.0=jmhRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath javax.inject:javax.inject:1=annotationProcessor,errorprone,jmhAnnotationProcessor,testAnnotationProcessor jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=compileProtoPath,jmh,jmhCompileClasspath,jmhCompileProtoPath,jmhRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileProtoPath,jmh,jmhCompileClasspath,jmhCompileProtoPath,jmhRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=compileProtoPath,jmh,jmhCompileClasspath,jmhCompileProtoPath,jmhRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileProtoPath,jmh,jmhCompileClasspath,jmhCompileProtoPath,jmhRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=jmh,jmhCompileProtoPath,jmhRuntimeClasspath net.java.dev.jna:jna:5.8.0=jmh,jmhCompileProtoPath,jmhRuntimeClasspath net.sf.jopt-simple:jopt-simple:5.0.4=jmh,jmhCompileClasspath,jmhCompileProtoPath,jmhRuntimeClasspath @@ -114,10 +114,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=jmhRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.jctools:jctools-core-jdk11:4.0.6=jmh,jmhCompileProtoPath,jmhRuntimeClasspath org.jctools:jctools-core:4.0.6=jmh,jmhCompileProtoPath,jmhRuntimeClasspath org.jetbrains:annotations:24.0.0=compileClasspath,compileProtoPath,jmhCompileClasspath @@ -139,16 +139,16 @@ org.openjdk.jmh:jmh-generator-reflection:1.37=jmh,jmhCompileClasspath,jmhCompile org.opentest4j:opentest4j:1.3.0=jmhRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=jmh,jmhCompileProtoPath,jmhRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=compileClasspath,compileProtoPath,jacocoAnt,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-commons:9.7.1=jmh,jmhCompileProtoPath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-commons:9.9.1=compileClasspath,compileProtoPath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=compileClasspath,compileProtoPath,jacocoAnt,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-tree:9.7.1=jmh,jmhCompileProtoPath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9.1=compileClasspath,compileProtoPath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=jmh,jmhCompileProtoPath,jmhRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,compileProtoPath,jmh,jmhCompileClasspath,jmhCompileProtoPath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +org.ow2.asm:asm:9.10.1=compileClasspath,compileProtoPath,jacocoAnt,jmh,jmhCompileClasspath,jmhCompileProtoPath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs org.pcollections:pcollections:3.1.4=annotationProcessor,errorprone,jmhAnnotationProcessor,testAnnotationProcessor org.skyscreamer:jsonassert:1.5.1=jmhRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath diff --git a/dd-java-agent/agent-iast/iast-test-fixtures/build.gradle b/dd-java-agent/agent-iast/iast-test-fixtures/build.gradle index 248d7a9e008..bf1a59d1b83 100644 --- a/dd-java-agent/agent-iast/iast-test-fixtures/build.gradle +++ b/dd-java-agent/agent-iast/iast-test-fixtures/build.gradle @@ -1,5 +1,8 @@ +plugins { + id 'dd-trace-java.version-file' +} + apply from: "$rootDir/gradle/java.gradle" -apply from: "$rootDir/gradle/version.gradle" dependencies { api project(':dd-java-agent:agent-iast') diff --git a/dd-java-agent/agent-iast/iast-test-fixtures/gradle.lockfile b/dd-java-agent/agent-iast/iast-test-fixtures/gradle.lockfile index 85806ecd6d4..46bee54c205 100644 --- a/dd-java-agent/agent-iast/iast-test-fixtures/gradle.lockfile +++ b/dd-java-agent/agent-iast/iast-test-fixtures/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-iast:iast-test-fixtures:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=compileClasspath,runtimeClasspath,testCompile com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=runtimeClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=runtimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=compileClasspath,runtimeClasspath,testCompileClassp commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=runtimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=runtimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=runtimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=runtimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=runtimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -70,12 +75,13 @@ org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=runtimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=runtimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=runtimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -93,14 +99,14 @@ org.objenesis:objenesis:3.3=compileClasspath,testCompileClasspath,testRuntimeCla org.opentest4j:opentest4j:1.3.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-commons:9.9.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9.1=runtimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-commons:9.10.1=jacocoAnt,runtimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt,runtimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.10.1=compileClasspath,jacocoAnt,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/agent-iast/src/jmh/java/com/datadog/iast/sensitive/SensitiveTokenizerBenchmark.java b/dd-java-agent/agent-iast/src/jmh/java/com/datadog/iast/sensitive/SensitiveTokenizerBenchmark.java new file mode 100644 index 00000000000..c3d86674e09 --- /dev/null +++ b/dd-java-agent/agent-iast/src/jmh/java/com/datadog/iast/sensitive/SensitiveTokenizerBenchmark.java @@ -0,0 +1,231 @@ +package com.datadog.iast.sensitive; + +import static datadog.trace.api.iast.sink.SqlInjectionModule.DATABASE_PARAMETER; +import static java.util.concurrent.TimeUnit.MICROSECONDS; +import static java.util.concurrent.TimeUnit.MILLISECONDS; + +import com.datadog.iast.model.Evidence; +import com.datadog.iast.sensitive.SensitiveHandler.Tokenizer; +import java.util.Arrays; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Param; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Warmup; + +/** Tracks the cost of the IAST evidence-redaction "sensitive analyzer" tokenizers. */ +@Warmup(iterations = 2, time = 250, timeUnit = MILLISECONDS) +@Measurement(iterations = 3, time = 250, timeUnit = MILLISECONDS) +@Fork(1) +@OutputTimeUnit(MICROSECONDS) +@BenchmarkMode(Mode.AverageTime) +@State(Scope.Benchmark) +public class SensitiveTokenizerBenchmark { + + /** Each scenario pairs a malformed payload shape with the tokenizer that processes it. */ + public enum Scenario { + /** LDAP filter opened, never closed, packed with operators — quadratic: {@code "(" + "="*n}. */ + LDAP_UNCLOSED_FILTER { + @Override + String payload(final int n) { + return "(" + repeat('=', n - 1); + } + + @Override + Tokenizer tokenizer(final String payload) { + return new LdapRegexTokenizer(new Evidence(payload)); + } + }, + /** Repeated open-group + operator — CUBIC, the worst found: {@code "(="*n}. */ + LDAP_NESTED_OPEN_EQ { + @Override + String payload(final int n) { + return repeatUnit("(=", n); + } + + @Override + Tokenizer tokenizer(final String payload) { + return new LdapRegexTokenizer(new Evidence(payload)); + } + }, + /** ANSI SQL string literal opened but never closed — stack overflow: {@code "'" + "a"*n}. */ + SQL_ANSI_UNTERMINATED_STRING { + @Override + String payload(final int n) { + return "'" + repeat('a', n - 1); + } + + @Override + Tokenizer tokenizer(final String payload) { + return sql(payload, null); + } + }, + /** Oracle {@code q' ...} escaped literal with no matching close — stack overflow. */ + SQL_ORACLE_ESCAPED_LITERAL { + @Override + String payload(final int n) { + return "q'~" + repeat('a', n - 3); + } + + @Override + Tokenizer tokenizer(final String payload) { + return sql(payload, "oracle"); + } + }, + /** MySQL double-quoted string literal opened but never closed — stack overflow. */ + SQL_MYSQL_UNTERMINATED_STRING { + @Override + String payload(final int n) { + return "\"" + repeat('a', n - 1); + } + + @Override + Tokenizer tokenizer(final String payload) { + return sql(payload, "mysql"); + } + }, + /** URL query separator + long key, no {@code =} value — linear baseline. */ + URL_QUERY { + @Override + String payload(final int n) { + return "http://h/p?" + repeat('a', n - 11); + } + + @Override + Tokenizer tokenizer(final String payload) { + return new UrlRegexpTokenizer(new Evidence(payload)); + } + }, + /** Run of {@code ?} (also matched by {@code [^=&;]}) — quadratic: {@code "?"*n}. */ + URL_QUESTION_RUN { + @Override + String payload(final int n) { + return repeat('?', n); + } + + @Override + Tokenizer tokenizer(final String payload) { + return new UrlRegexpTokenizer(new Evidence(payload)); + } + }, + /** URL authority started with {@code //}, no {@code @} terminator — linear baseline. */ + URL_AUTHORITY { + @Override + String payload(final int n) { + return "//" + repeat('a', n - 2); + } + + @Override + Tokenizer tokenizer(final String payload) { + return new UrlRegexpTokenizer(new Evidence(payload)); + } + }, + /** Single command + long argument — linear baseline. */ + COMMAND_SINGLE_TOKEN { + @Override + String payload(final int n) { + return "cmd " + repeat('a', n - 4); + } + + @Override + Tokenizer tokenizer(final String payload) { + return new CommandRegexpTokenizer(new Evidence(payload)); + } + }, + /** + * Blank lines exploit MULTILINE {@code ^} + {@code \s*} backtracking — quadratic: {@code + * "\n"*n}. + */ + COMMAND_BLANK_LINES { + @Override + String payload(final int n) { + return repeat('\n', n); + } + + @Override + Tokenizer tokenizer(final String payload) { + return new CommandRegexpTokenizer(new Evidence(payload)); + } + }; + + abstract String payload(int sizeBytes); + + abstract Tokenizer tokenizer(String payload); + + static Tokenizer sql(final String payload, final String dialect) { + final Evidence evidence = new Evidence(payload); + if (dialect != null) { + evidence.getContext().put(DATABASE_PARAMETER, dialect); + } + return new SqlRegexpTokenizer(evidence); + } + + static String repeat(final char c, final int count) { + final int n = Math.max(count, 0); + final char[] chars = new char[n]; + Arrays.fill(chars, c); + return new String(chars); + } + + static String repeatUnit(final String unit, final int totalLen) { + final int n = Math.max(totalLen, 0); + final StringBuilder sb = new StringBuilder(n); + while (sb.length() < n) { + sb.append(unit); + } + sb.setLength(n); + return sb.toString(); + } + } + + @Param({ + "LDAP_UNCLOSED_FILTER", + "LDAP_NESTED_OPEN_EQ", + "SQL_ANSI_UNTERMINATED_STRING", + "SQL_ORACLE_ESCAPED_LITERAL", + "SQL_MYSQL_UNTERMINATED_STRING", + "URL_QUERY", + "URL_QUESTION_RUN", + "URL_AUTHORITY", + "COMMAND_SINGLE_TOKEN", + "COMMAND_BLANK_LINES" + }) + Scenario scenario; + + @Param({"512", "1024", "2048"}) + int sizeBytes; + + private String payload; + + @Setup(Level.Trial) + public void setup() { + payload = scenario.payload(sizeBytes); + } + + /** + * Builds the tokenizer and fully drains it, exactly as evidence redaction does. Returns the + * number of tokens (consumed by JMH). A pathological pattern may overflow the stack; we catch it + * so the run stays stable and report {@code -1} — see the class javadoc. + */ + @Benchmark + public long tokenize() { + try { + final Tokenizer tokenizer = scenario.tokenizer(payload); + long count = 0; + while (tokenizer.next()) { + tokenizer.current(); + count++; + } + return count; + } catch (final Throwable pathological) { + return -1; + } + } +} diff --git a/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/Reporter.java b/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/Reporter.java index f5b9a16ff00..2a8ecd671b2 100644 --- a/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/Reporter.java +++ b/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/Reporter.java @@ -7,6 +7,7 @@ import com.datadog.iast.model.Vulnerability; import com.datadog.iast.model.VulnerabilityBatch; import com.datadog.iast.taint.TaintedObjects; +import datadog.context.ContextScope; import datadog.trace.api.Config; import datadog.trace.api.ProductTraceSource; import datadog.trace.api.gateway.RequestContext; @@ -61,7 +62,7 @@ public void report(@Nullable final AgentSpan span, @Nonnull final Vulnerability } if (span == null) { final AgentSpan newSpan = startNewSpan(); - try (final AgentScope autoClosed = tracer().activateManualSpan(newSpan)) { + try (final ContextScope autoClosed = tracer().activateManualSpan(newSpan)) { vulnerability.updateSpan(newSpan); reportVulnerability(newSpan, vulnerability); } finally { diff --git a/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/model/json/EvidenceAdapter.java b/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/model/json/EvidenceAdapter.java index 9aa13db2e56..666d5c7c0c8 100644 --- a/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/model/json/EvidenceAdapter.java +++ b/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/model/json/EvidenceAdapter.java @@ -446,9 +446,12 @@ public void write(final Context ctx, final JsonWriter writer) throws IOException private List split(final RedactionContext redaction) { final List parts = new ArrayList<>(); + // Identical sensitive chunks redact to the same pattern (the first occurrence in the source), + // so cache chunk -> offset to avoid an O(sourceLength) indexOf per repeated occurrence. + final Map matchingOffsets = new HashMap<>(); if (redaction.isSensitive()) { // redact the full tainted value as the source is sensitive (password, certificate, ...) - addValuePart(0, value.length(), redaction, true, parts); + addValuePart(0, value.length(), redaction, matchingOffsets, true, parts); } else { // redact only sensitive parts int index = 0; @@ -456,13 +459,13 @@ private List split(final RedactionContext redaction) { final int start = sensitive.getStart(); final int end = sensitive.getStart() + sensitive.getLength(); // append previous tainted chunk (if any) - addValuePart(index, start, redaction, false, parts); + addValuePart(index, start, redaction, matchingOffsets, false, parts); // append current sensitive tainted chunk - addValuePart(start, end, redaction, true, parts); + addValuePart(start, end, redaction, matchingOffsets, true, parts); index = end; } // append last tainted chunk (if any) - addValuePart(index, value.length(), redaction, false, parts); + addValuePart(index, value.length(), redaction, matchingOffsets, false, parts); } return parts; } @@ -471,6 +474,7 @@ private void addValuePart( final int start, final int end, final RedactionContext ctx, + final Map matchingOffsets, final boolean redact, final List valueParts) { if (start < end) { @@ -484,7 +488,9 @@ private void addValuePart( final int length = chunk.length(); final String sourceValue = source.getValue(); final String redactedValue = ctx.getRedactedValue(); - final int matching = (sourceValue == null) ? -1 : sourceValue.indexOf(chunk); + final int matching = + matchingOffsets.computeIfAbsent( + chunk, c -> sourceValue == null ? -1 : sourceValue.indexOf(c)); final String pattern; if (matching >= 0 && redactedValue != null) { // if matches append the matching part from the redacted value diff --git a/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/AbstractRegexTokenizer.java b/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/AbstractRegexTokenizer.java index 54c73669be3..f43f00df26f 100644 --- a/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/AbstractRegexTokenizer.java +++ b/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/AbstractRegexTokenizer.java @@ -1,9 +1,9 @@ package com.datadog.iast.sensitive; import com.datadog.iast.util.Ranged; +import com.google.re2j.Matcher; +import com.google.re2j.Pattern; import java.util.NoSuchElementException; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import javax.annotation.Nullable; public abstract class AbstractRegexTokenizer implements SensitiveHandler.Tokenizer { diff --git a/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/CommandRegexpTokenizer.java b/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/CommandRegexpTokenizer.java index 970239e0207..b9108d103e8 100644 --- a/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/CommandRegexpTokenizer.java +++ b/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/CommandRegexpTokenizer.java @@ -2,7 +2,7 @@ import com.datadog.iast.model.Evidence; import com.datadog.iast.util.Ranged; -import java.util.regex.Pattern; +import com.google.re2j.Pattern; public class CommandRegexpTokenizer extends AbstractRegexTokenizer { diff --git a/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/HeaderRegexpTokenizer.java b/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/HeaderRegexpTokenizer.java index dd2f1921365..ae3645879b3 100644 --- a/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/HeaderRegexpTokenizer.java +++ b/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/HeaderRegexpTokenizer.java @@ -2,8 +2,8 @@ import com.datadog.iast.model.Evidence; import com.datadog.iast.util.Ranged; +import com.google.re2j.Pattern; import java.util.NoSuchElementException; -import java.util.regex.Pattern; import javax.annotation.Nullable; public class HeaderRegexpTokenizer implements SensitiveHandler.Tokenizer { diff --git a/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/LdapRegexTokenizer.java b/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/LdapRegexTokenizer.java index 72ec3e70d86..5e3f84adafa 100644 --- a/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/LdapRegexTokenizer.java +++ b/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/LdapRegexTokenizer.java @@ -2,7 +2,7 @@ import com.datadog.iast.model.Evidence; import com.datadog.iast.util.Ranged; -import java.util.regex.Pattern; +import com.google.re2j.Pattern; /** * @see Lightweight Directory Access Protocol @@ -14,7 +14,7 @@ public class LdapRegexTokenizer extends AbstractRegexTokenizer { private static final Pattern LDAP_PATTERN = Pattern.compile( - String.format("\\(.*?(?:~=|=|<=|>=)(?<%s>[^)]+)\\)", LITERAL_GROUP), Pattern.MULTILINE); + String.format("\\(.*?(?:~=|=|<=|>=)(?P<%s>[^)]+)\\)", LITERAL_GROUP), Pattern.MULTILINE); public LdapRegexTokenizer(final Evidence evidence) { super(LDAP_PATTERN, evidence.getValue()); diff --git a/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/SensitiveHandlerImpl.java b/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/SensitiveHandlerImpl.java index c0a500e9de6..3aaaa67a775 100644 --- a/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/SensitiveHandlerImpl.java +++ b/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/SensitiveHandlerImpl.java @@ -3,21 +3,28 @@ import static com.datadog.iast.util.CharUtils.fillCharArray; import static com.datadog.iast.util.CharUtils.newCharArray; import static com.datadog.iast.util.CharUtils.newString; -import static java.util.regex.Pattern.CASE_INSENSITIVE; -import static java.util.regex.Pattern.MULTILINE; +import static com.google.re2j.Pattern.CASE_INSENSITIVE; +import static com.google.re2j.Pattern.MULTILINE; +import static datadog.trace.api.ConfigDefaults.DEFAULT_IAST_REDACTION_NAME_PATTERN; +import static datadog.trace.api.ConfigDefaults.DEFAULT_IAST_REDACTION_VALUE_PATTERN; import com.datadog.iast.model.Evidence; import com.datadog.iast.model.Source; import com.datadog.iast.model.VulnerabilityType; +import com.google.re2j.Pattern; +import com.google.re2j.PatternSyntaxException; import datadog.trace.api.Config; import java.util.HashMap; import java.util.Map; -import java.util.regex.Pattern; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class SensitiveHandlerImpl implements SensitiveHandler { + private static final Logger LOG = LoggerFactory.getLogger(SensitiveHandlerImpl.class); + static final SensitiveHandler INSTANCE = new SensitiveHandlerImpl(); private static final char[] REDACTED_SENSITIVE_BUFFER = newCharArray(16, '*'); @@ -35,10 +42,17 @@ public class SensitiveHandlerImpl implements SensitiveHandler { private final Map tokenizers; public SensitiveHandlerImpl() { - final Config config = Config.get(); - namePattern = Pattern.compile(config.getIastRedactionNamePattern(), CASE_INSENSITIVE); + this(Config.get().getIastRedactionNamePattern(), Config.get().getIastRedactionValuePattern()); + } + + SensitiveHandlerImpl(final String configuredNamePattern, final String configuredValuePattern) { + namePattern = + safeCompile(configuredNamePattern, DEFAULT_IAST_REDACTION_NAME_PATTERN, CASE_INSENSITIVE); valuePattern = - Pattern.compile(config.getIastRedactionValuePattern(), CASE_INSENSITIVE | MULTILINE); + safeCompile( + configuredValuePattern, + DEFAULT_IAST_REDACTION_VALUE_PATTERN, + CASE_INSENSITIVE | MULTILINE); tokenizers = new HashMap<>(); tokenizers.put(VulnerabilityType.SQL_INJECTION, SqlRegexpTokenizer::new); tokenizers.put(VulnerabilityType.LDAP_INJECTION, LdapRegexTokenizer::new); @@ -75,8 +89,8 @@ public String redactString(final String value) { @Override public Tokenizer tokenizeEvidence( @Nonnull final VulnerabilityType type, @Nonnull final Evidence evidence) { - final TokenizerSupplier supplier = tokenizers.computeIfAbsent(type, t -> emptyTokenizer()); - return supplier.tokenizerFor(evidence); + final TokenizerSupplier supplier = tokenizers.get(type); + return supplier == null ? Tokenizer.EMPTY : supplier.tokenizerFor(evidence); } private int computeLength(@Nullable final String value) { @@ -93,8 +107,18 @@ private int computeLength(@Nullable final String value) { return size; } - private TokenizerSupplier emptyTokenizer() { - return evidence -> Tokenizer.EMPTY; + private static Pattern safeCompile( + final String configured, final String fallback, final int flags) { + try { + return Pattern.compile(configured, flags); + } catch (final PatternSyntaxException e) { + LOG.error( + "Could not compile IAST redaction pattern with RE2J, falling back to the default: {} (configured: {})", + fallback, + configured, + e); + return Pattern.compile(fallback, flags); + } } private interface TokenizerSupplier { diff --git a/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/SqlRegexpTokenizer.java b/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/SqlRegexpTokenizer.java index 6c87aaf7a87..a52eedb402a 100644 --- a/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/SqlRegexpTokenizer.java +++ b/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/SqlRegexpTokenizer.java @@ -4,23 +4,25 @@ import com.datadog.iast.model.Evidence; import com.datadog.iast.util.Ranged; +import com.google.re2j.Matcher; +import com.google.re2j.Pattern; import java.util.*; +import java.util.concurrent.ConcurrentHashMap; import java.util.function.Predicate; import java.util.function.Supplier; -import java.util.regex.Pattern; +import javax.annotation.Nullable; -public class SqlRegexpTokenizer extends AbstractRegexTokenizer { +public class SqlRegexpTokenizer implements SensitiveHandler.Tokenizer { private static final String STRING_LITERAL = "'(?:''|[^'])*'"; - private static final String ORACLE_ESCAPED_LITERAL = - "q'<.*?>'|q'\\(.*?\\)'|q'\\{.*?\\}'|q'\\[.*?\\]'|q'(?.).*?\\k'"; - private static final String POSTGRESQL_ESCAPED_LITERAL = - "\\$(?[^$]*?)\\$.*?\\$\\k\\$"; + private static final String ORACLE_ESCAPED_LITERAL = buildOracleEscapedLiteral(); + // $$ or $tag$ where tag is a SQL identifier + private static final String POSTGRESQL_ESCAPED_LITERAL = "\\$(?:[a-zA-Z_]\\w*)?\\$"; private static final String MYSQL_STRING_LITERAL = "\"(?:\\\"|[^\"])*\"|'(?:\\'|[^'])*'"; private static final String LINE_COMMENT = "--.*$"; private static final String BLOCK_COMMENT = "/\\*[\\s\\S]*\\*/"; private static final String EXPONENT = "(?:E[-+]?\\d+[fd]?)?"; - private static final String INTEGER_NUMBER = "(? PATTERNS = new EnumMap<>(Dialect.class); + private static final Map PATTERNS = new ConcurrentHashMap<>(); private final String sql; + private final Matcher matcher; + private int searchFrom; + @Nullable private Ranged current; + // Lazily built (Postgres only): every "$tag$" occurrence indexed by tag, so the matching close + // can be located with a binary search instead of an O(n) scan per opener. + @Nullable private Map dollarTagPositions; public SqlRegexpTokenizer(final Evidence evidence) { - super( - PATTERNS.computeIfAbsent(Dialect.fromEvidence(evidence), Dialect::buildPattern), - evidence.getValue()); this.sql = evidence.getValue(); + this.matcher = + PATTERNS + .computeIfAbsent(Dialect.fromEvidence(evidence), Dialect::buildPattern) + .matcher(sql); } @Override - protected Ranged buildNext() { - int start = matcher.start(); - int end = matcher.end(); - final char startChar = sql.charAt(start); - if (startChar == '\'' || startChar == '"') { - start++; - end--; - } else if (end > start + 1) { - final char nextChar = sql.charAt(start + 1); - if (startChar == '/' && nextChar == '*') { - start += 2; - end -= 2; - } else if (startChar == '-' && startChar == nextChar) { - start += 2; - } else if (Character.toLowerCase(startChar) == 'q' && nextChar == '\'') { - start += 3; - end -= 2; - } else if (startChar == '$') { - final String match = matcher.group(); - final int size = match.indexOf('$', 1) + 1; - if (size > 1) { - start += size; - end -= size; + public boolean next() { + while (matcher.find(searchFrom)) { + final int start = matcher.start(); + int end = matcher.end(); + int rangeStart = start; + int rangeEnd = end; + final char startChar = sql.charAt(start); + if (startChar == '$') { + // Postgres dollar-quoting: the regex matched the opening "$tag$"; find the matching close. + final String tag = sql.substring(start, end); + final int close = nextDollarTag(tag, end); + if (close < 0) { + // No matching close tag: not a dollar-quoted literal. Skip past the whole opener we + // already matched (not just one char) so find() does not re-scan it. + searchFrom = end; + continue; } + end = close + tag.length(); + rangeStart = start + tag.length(); + rangeEnd = close; + } else if (startChar == '\'' || startChar == '"') { + rangeStart++; + rangeEnd--; + } else if (end > start + 1) { + final char nextChar = sql.charAt(start + 1); + if (startChar == '/' && nextChar == '*') { + rangeStart += 2; + rangeEnd -= 2; + } else if (startChar == '-' && startChar == nextChar) { + rangeStart += 2; + } else if (Character.toLowerCase(startChar) == 'q' && nextChar == '\'') { + rangeStart += 3; + rangeEnd -= 2; + } + } + searchFrom = end; + current = Ranged.build(rangeStart, rangeEnd - rangeStart); + return true; + } + current = null; + return false; + } + + @Override + public Ranged current() { + if (current == null) { + throw new NoSuchElementException(); + } + return current; + } + + /** + * Returns the start offset of the first {@code "$tag$"} occurrence at or after {@code from}, or + * {@code -1} if there is none. Equivalent to {@code sql.indexOf(tag, from)} for dollar-quote tags + * but backed by a precomputed index so the whole tokenization stays near-linear instead of + * scanning to end-of-string once per opener. + */ + private int nextDollarTag(final String tag, final int from) { + final int[] positions = dollarTagPositions().get(tag); + if (positions == null) { + return -1; + } + // first position >= from + int lo = 0; + int hi = positions.length; + while (lo < hi) { + final int mid = (lo + hi) >>> 1; + if (positions[mid] < from) { + lo = mid + 1; + } else { + hi = mid; + } + } + return lo < positions.length ? positions[lo] : -1; + } + + private Map dollarTagPositions() { + if (dollarTagPositions == null) { + dollarTagPositions = buildDollarTagPositions(sql); + } + return dollarTagPositions; + } + + /** + * Single left-to-right pass collecting the start offset of every {@code "$tag$"} token (empty tag + * or a SQL identifier), keyed by the token text. Each character is visited once: the optional + * identifier run after a {@code '$'} contains no {@code '$'}, so runs from distinct openers never + * overlap, making the scan O(n). + */ + private static Map buildDollarTagPositions(final String sql) { + final Map> positions = new HashMap<>(); + final int length = sql.length(); + for (int i = 0; i < length; i++) { + if (sql.charAt(i) != '$') { + continue; + } + int end = i + 1; + if (end < length && isIdentifierStart(sql.charAt(end))) { + end++; + while (end < length && isIdentifierPart(sql.charAt(end))) { + end++; + } + } + if (end < length && sql.charAt(end) == '$') { + final String tag = sql.substring(i, end + 1); + positions.computeIfAbsent(tag, k -> new ArrayList<>()).add(i); + } + } + final Map result = new HashMap<>(positions.size() * 2); + for (final Map.Entry> entry : positions.entrySet()) { + final List list = entry.getValue(); + final int[] array = new int[list.size()]; + for (int i = 0; i < array.length; i++) { + array[i] = list.get(i); + } + result.put(entry.getKey(), array); + } + return result; + } + + private static boolean isIdentifierStart(final char c) { + return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_'; + } + + private static boolean isIdentifierPart(final char c) { + return isIdentifierStart(c) || (c >= '0' && c <= '9'); + } + + /** + * Builds the Oracle {@code q'…'} alternation: the four bracket-paired delimiters plus one branch + * per other printable single-character delimiter (RE2J has no back-reference to require the same + * closing char, so the finite delimiter alphabet is enumerated). + * + *

The enumeration is intentionally restricted to the printable ASCII range {@code 0x21..0x7e}. + * Oracle forbids whitespace (space, tab, carriage return) as a {@code q'} delimiter, so excluding + * those characters matches Oracle's own rules rather than dropping valid literals. Multi-byte + * (non-ASCII) delimiters, which Oracle does allow, are not enumerated; such literals fall back to + * being tokenized by the generic {@code STRING_LITERAL} branch. + */ + private static String buildOracleEscapedLiteral() { + final List alternatives = new ArrayList<>(); + alternatives.add("q'<.*?>'"); + alternatives.add("q'\\(.*?\\)'"); + alternatives.add("q'\\{.*?\\}'"); + alternatives.add("q'\\[.*?\\]'"); + for (char delim = 0x21; delim <= 0x7e; delim++) { + // brackets handled above; ' is ambiguous with the surrounding quotes. + if ("<>(){}[]'".indexOf(delim) >= 0) { + continue; } + final String escaped = escapeDelimiter(delim); + alternatives.add("q'" + escaped + ".*?" + escaped + "'"); } - return Ranged.build(start, end - start); + return String.join("|", alternatives); + } + + private static String escapeDelimiter(final char delim) { + return "\\.+*?^$|".indexOf(delim) >= 0 ? "\\" + delim : String.valueOf(delim); } private enum Dialect { diff --git a/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/UrlRegexpTokenizer.java b/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/UrlRegexpTokenizer.java index 30371a6d0b5..06e1001a637 100644 --- a/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/UrlRegexpTokenizer.java +++ b/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sensitive/UrlRegexpTokenizer.java @@ -2,7 +2,7 @@ import com.datadog.iast.model.Evidence; import com.datadog.iast.util.Ranged; -import java.util.regex.Pattern; +import com.google.re2j.Pattern; /** * @see [^@]+)@", AUTHORITY_GROUP); + String.format("^(?:[^:]+:)?//(?P<%s>[^@]+)@", AUTHORITY_GROUP); private static final String QUERY_FRAGMENT = - String.format("[?#&]([^=&;]+)=(?<%s>[^?#&]+)", QUERY_FRAGMENT_GROUP); + String.format("[?#&]([^=&;]+)=(?P<%s>[^?#&]+)", QUERY_FRAGMENT_GROUP); private static final Pattern PATTERN = Pattern.compile(String.join("|", AUTHORITY, QUERY_FRAGMENT)); diff --git a/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sink/HstsMissingHeaderModuleImpl.java b/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sink/HstsMissingHeaderModuleImpl.java index a09e20895be..c96247c8870 100644 --- a/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sink/HstsMissingHeaderModuleImpl.java +++ b/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sink/HstsMissingHeaderModuleImpl.java @@ -9,7 +9,6 @@ import datadog.trace.api.iast.IastContext; import datadog.trace.api.iast.sink.HstsMissingHeaderModule; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; -import datadog.trace.bootstrap.instrumentation.api.AgentTracer; import java.util.Locale; import java.util.Map; import java.util.regex.Matcher; @@ -49,7 +48,7 @@ public void onRequestEnd(final IastContext ctx, final IGSpanInfo igSpanInfo) { if (!isHttps(urlString, iastRequestContext.getxForwardedProto())) { return; } - final AgentSpan span = AgentTracer.activeSpan(); + final AgentSpan span = (AgentSpan) igSpanInfo; report( span, new Vulnerability(VulnerabilityType.HSTS_HEADER_MISSING, Location.forSpan(span))); } catch (Throwable e) { diff --git a/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sink/XContentTypeModuleImpl.java b/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sink/XContentTypeModuleImpl.java index 8bc416b91f1..d9815bfd5e6 100644 --- a/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sink/XContentTypeModuleImpl.java +++ b/dd-java-agent/agent-iast/src/main/java/com/datadog/iast/sink/XContentTypeModuleImpl.java @@ -9,7 +9,6 @@ import datadog.trace.api.iast.IastContext; import datadog.trace.api.iast.sink.XContentTypeModule; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; -import datadog.trace.bootstrap.instrumentation.api.AgentTracer; import java.util.Locale; import java.util.Map; import javax.annotation.Nullable; @@ -38,7 +37,7 @@ public void onRequestEnd(final IastContext ctx, final IGSpanInfo igSpanInfo) { if (isIgnorableResponseCode((Integer) tags.get("http.status_code"))) { return; } - final AgentSpan span = AgentTracer.activeSpan(); + final AgentSpan span = (AgentSpan) igSpanInfo; report( span, new Vulnerability( diff --git a/dd-java-agent/agent-iast/src/test/groovy/com/datadog/iast/sensitive/SensitiveHandlerTest.groovy b/dd-java-agent/agent-iast/src/test/groovy/com/datadog/iast/sensitive/SensitiveHandlerTest.groovy deleted file mode 100644 index 19dfdf1999e..00000000000 --- a/dd-java-agent/agent-iast/src/test/groovy/com/datadog/iast/sensitive/SensitiveHandlerTest.groovy +++ /dev/null @@ -1,34 +0,0 @@ -package com.datadog.iast.sensitive - -import datadog.trace.test.util.DDSpecification - -/** - * Most of the testing is done via {@link com.datadog.iast.model.json.EvidenceRedactionTest} - */ -class SensitiveHandlerTest extends DDSpecification { - - void 'test that empty tokenizer returns nothing'() { - given: - final tokenizer = SensitiveHandler.Tokenizer.EMPTY - - when: - final next = tokenizer.next() - - then: - !next - - when: - tokenizer.current() - - then: - thrown(NoSuchElementException) - } - - void 'test that current instance has a value'() { - when: - final current = SensitiveHandler.get() - - then: - current != null - } -} diff --git a/dd-java-agent/agent-iast/src/test/groovy/com/datadog/iast/util/ObjectVisitorTest.groovy b/dd-java-agent/agent-iast/src/test/groovy/com/datadog/iast/util/ObjectVisitorTest.groovy index 9e66caabc0f..d0c36aaf8f4 100644 --- a/dd-java-agent/agent-iast/src/test/groovy/com/datadog/iast/util/ObjectVisitorTest.groovy +++ b/dd-java-agent/agent-iast/src/test/groovy/com/datadog/iast/util/ObjectVisitorTest.groovy @@ -1,6 +1,5 @@ package com.datadog.iast.util -import com.google.common.collect.Iterables import foo.bar.VisitableClass import spock.lang.Specification @@ -40,7 +39,7 @@ class ObjectVisitorTest extends Specification { given: final visitor = Mock(ObjectVisitor.Visitor) final wrapped = ['1', '2', '3'] - final target = Iterables.unmodifiableIterable(wrapped) + final Iterable target = wrapped.&iterator as Iterable when: ObjectVisitor.visit(target, visitor) { Iterable.isAssignableFrom(it) } diff --git a/dd-java-agent/agent-iast/src/test/java/com/datadog/iast/model/json/EvidenceAdapterTest.java b/dd-java-agent/agent-iast/src/test/java/com/datadog/iast/model/json/EvidenceAdapterTest.java new file mode 100644 index 00000000000..a3189181c7f --- /dev/null +++ b/dd-java-agent/agent-iast/src/test/java/com/datadog/iast/model/json/EvidenceAdapterTest.java @@ -0,0 +1,62 @@ +package com.datadog.iast.model.json; + +import static org.junit.jupiter.api.Assumptions.assumeTrue; + +import com.datadog.iast.model.Evidence; +import com.datadog.iast.model.Location; +import com.datadog.iast.model.Range; +import com.datadog.iast.model.Source; +import com.datadog.iast.model.Vulnerability; +import com.datadog.iast.model.VulnerabilityBatch; +import com.datadog.iast.model.VulnerabilityType; +import datadog.trace.api.Config; +import datadog.trace.api.iast.SourceTypes; +import datadog.trace.api.iast.VulnerabilityMarks; +import org.junit.jupiter.api.Test; +import org.skyscreamer.jsonassert.JSONAssert; +import org.skyscreamer.jsonassert.JSONCompareMode; + +class EvidenceAdapterTest { + + @Test + void repeatedSensitiveLiteralsRedactToTheSamePattern() throws Exception { + assumeTrue(Config.get().isIastRedactionEnabled(), "redaction must be enabled"); + + // The two 'abc' string literals are detected as sensitive ranges within the same tainted value. + // Both must map to the first occurrence of "abc" in the source (index 8 -> "ijk"), so they + // render with an identical pattern. This is the behavior preserved by the chunk -> offset + // memoization in EvidenceAdapter#addValuePart. + final String sql = "select 'abc' or 'abc'"; + final Source source = new Source(SourceTypes.REQUEST_PARAMETER_VALUE, "query", sql); + final Range range = new Range(0, sql.length(), source, VulnerabilityMarks.NOT_MARKED); + final Evidence evidence = new Evidence(sql, new Range[] {range}); + final Vulnerability vulnerability = + new Vulnerability( + VulnerabilityType.SQL_INJECTION, + Location.forClassAndMethodAndLine("Test", "test", 1), + evidence); + final VulnerabilityBatch batch = new VulnerabilityBatch(); + batch.add(vulnerability); + + final String json = VulnerabilityEncoding.toJson(batch); + + final String expected = + "{" + + " \"sources\": [" + + " { \"origin\": \"http.request.parameter\", \"name\": \"query\"," + + " \"redacted\": true, \"pattern\": \"abcdefghijklmnopqrstu\" }" + + " ]," + + " \"vulnerabilities\": [" + + " { \"type\": \"SQL_INJECTION\", \"evidence\": { \"valueParts\": [" + + " { \"source\": 0, \"value\": \"select '\" }," + + " { \"source\": 0, \"redacted\": true, \"pattern\": \"ijk\" }," + + " { \"source\": 0, \"value\": \"' or '\" }," + + " { \"source\": 0, \"redacted\": true, \"pattern\": \"ijk\" }," + + " { \"source\": 0, \"value\": \"'\" }" + + " ] } }" + + " ]" + + "}"; + + JSONAssert.assertEquals(expected, json, JSONCompareMode.LENIENT); + } +} diff --git a/dd-java-agent/agent-iast/src/test/java/com/datadog/iast/sensitive/CommandRegexpTokenizerTest.java b/dd-java-agent/agent-iast/src/test/java/com/datadog/iast/sensitive/CommandRegexpTokenizerTest.java new file mode 100644 index 00000000000..d43b3495713 --- /dev/null +++ b/dd-java-agent/agent-iast/src/test/java/com/datadog/iast/sensitive/CommandRegexpTokenizerTest.java @@ -0,0 +1,44 @@ +package com.datadog.iast.sensitive; + +import static java.util.Arrays.asList; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.params.provider.Arguments.arguments; + +import com.datadog.iast.model.Evidence; +import com.datadog.iast.sensitive.SensitiveHandler.Tokenizer; +import com.datadog.iast.util.Ranged; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +class CommandRegexpTokenizerTest { + + @ParameterizedTest(name = "{0}") + @MethodSource("redactsCommandArgumentsArguments") + void redactsCommandArguments( + final String description, final String command, final List expected) { + assertEquals(expected, tokenize(command)); + } + + static Stream redactsCommandArgumentsArguments() { + return Stream.of( + arguments("plain command keeps its arguments", "ls -la /tmp", asList("-la /tmp")), + arguments("sudo prefix is skipped", "sudo rm -rf /", asList("-rf /")), + arguments("doas prefix is skipped", "doas cat /etc/passwd", asList("/etc/passwd")), + arguments( + "everything after the binary is captured", "echo hello world", asList("hello world"))); + } + + private static List tokenize(String command) { + Tokenizer tokenizer = new CommandRegexpTokenizer(new Evidence(command)); + List tokens = new ArrayList<>(); + while (tokenizer.next()) { + Ranged range = tokenizer.current(); + tokens.add(command.substring(range.getStart(), range.getStart() + range.getLength())); + } + return tokens; + } +} diff --git a/dd-java-agent/agent-iast/src/test/java/com/datadog/iast/sensitive/HeaderRegexpTokenizerTest.java b/dd-java-agent/agent-iast/src/test/java/com/datadog/iast/sensitive/HeaderRegexpTokenizerTest.java new file mode 100644 index 00000000000..c24a2d4dd61 --- /dev/null +++ b/dd-java-agent/agent-iast/src/test/java/com/datadog/iast/sensitive/HeaderRegexpTokenizerTest.java @@ -0,0 +1,58 @@ +package com.datadog.iast.sensitive; + +import static com.google.re2j.Pattern.CASE_INSENSITIVE; +import static java.util.Collections.emptyList; +import static java.util.Collections.singletonList; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.params.provider.Arguments.arguments; + +import com.datadog.iast.model.Evidence; +import com.datadog.iast.sensitive.SensitiveHandler.Tokenizer; +import com.datadog.iast.util.Ranged; +import com.google.re2j.Pattern; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +class HeaderRegexpTokenizerTest { + + private static final Pattern NAME_PATTERN = + Pattern.compile("password|authorization", CASE_INSENSITIVE); + private static final Pattern VALUE_PATTERN = Pattern.compile("bearer\\s", CASE_INSENSITIVE); + + @ParameterizedTest(name = "{0}") + @MethodSource("redactsSensitiveHeadersArguments") + void redactsSensitiveHeaders( + final String description, final String header, final List expected) { + assertEquals(expected, tokenize(header)); + } + + static Stream redactsSensitiveHeadersArguments() { + return Stream.of( + arguments( + "sensitive name redacts the value", + "Authorization: Bearer xyz", + singletonList("Bearer xyz")), + arguments( + "sensitive value redacts the value", + "X-Auth: Bearer secret", + singletonList("Bearer secret")), + arguments("non-sensitive header is ignored", "Accept: text/html", emptyList()), + arguments("missing separator is ignored", "NoColonHeader", emptyList()), + arguments("missing value is ignored", "Empty:", emptyList())); + } + + private static List tokenize(String header) { + Tokenizer tokenizer = + new HeaderRegexpTokenizer(new Evidence(header), NAME_PATTERN, VALUE_PATTERN); + List tokens = new ArrayList<>(); + while (tokenizer.next()) { + Ranged range = tokenizer.current(); + tokens.add(header.substring(range.getStart(), range.getStart() + range.getLength())); + } + return tokens; + } +} diff --git a/dd-java-agent/agent-iast/src/test/java/com/datadog/iast/sensitive/LdapRegexTokenizerTest.java b/dd-java-agent/agent-iast/src/test/java/com/datadog/iast/sensitive/LdapRegexTokenizerTest.java new file mode 100644 index 00000000000..4060e00eca1 --- /dev/null +++ b/dd-java-agent/agent-iast/src/test/java/com/datadog/iast/sensitive/LdapRegexTokenizerTest.java @@ -0,0 +1,45 @@ +package com.datadog.iast.sensitive; + +import static java.util.Arrays.asList; +import static java.util.Collections.singletonList; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.params.provider.Arguments.arguments; + +import com.datadog.iast.model.Evidence; +import com.datadog.iast.sensitive.SensitiveHandler.Tokenizer; +import com.datadog.iast.util.Ranged; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +class LdapRegexTokenizerTest { + + @ParameterizedTest(name = "{0}") + @MethodSource("redactsFilterLiteralsArguments") + void redactsFilterLiterals( + final String description, final String filter, final List expected) { + assertEquals(expected, tokenize(filter)); + } + + static Stream redactsFilterLiteralsArguments() { + return Stream.of( + arguments("equality literal", "(cn=John Doe)", singletonList("John Doe")), + arguments("nested filter literals", "(&(uid=bob)(role=admin))", asList("bob", "admin")), + arguments("greater-or-equal operator", "(age>=21)", singletonList("21")), + arguments("less-or-equal operator", "(score<=100)", singletonList("100")), + arguments("approximate operator", "(attr~=approx)", singletonList("approx"))); + } + + private static List tokenize(String filter) { + Tokenizer tokenizer = new LdapRegexTokenizer(new Evidence(filter)); + List tokens = new ArrayList<>(); + while (tokenizer.next()) { + Ranged range = tokenizer.current(); + tokens.add(filter.substring(range.getStart(), range.getStart() + range.getLength())); + } + return tokens; + } +} diff --git a/dd-java-agent/agent-iast/src/test/java/com/datadog/iast/sensitive/SensitiveHandlerTest.java b/dd-java-agent/agent-iast/src/test/java/com/datadog/iast/sensitive/SensitiveHandlerTest.java new file mode 100644 index 00000000000..6f296eafb4e --- /dev/null +++ b/dd-java-agent/agent-iast/src/test/java/com/datadog/iast/sensitive/SensitiveHandlerTest.java @@ -0,0 +1,52 @@ +package com.datadog.iast.sensitive; + +import static datadog.trace.api.ConfigDefaults.DEFAULT_IAST_REDACTION_NAME_PATTERN; +import static datadog.trace.api.ConfigDefaults.DEFAULT_IAST_REDACTION_VALUE_PATTERN; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.datadog.iast.sensitive.SensitiveHandler.Tokenizer; +import java.util.NoSuchElementException; +import org.junit.jupiter.api.Test; + +/** Most of the testing is done via {@link com.datadog.iast.model.json.EvidenceRedactionTest}. */ +class SensitiveHandlerTest { + + // Valid under java.util.regex (named group + backreference) but rejected by RE2J, so + // SensitiveHandlerImpl must fall back to the default pattern instead of failing to compile. + private static final String RE2J_INCOMPATIBLE_PATTERN = "(?secret)\\k"; + + @Test + void emptyTokenizerReturnsNothing() { + final Tokenizer tokenizer = Tokenizer.EMPTY; + assertFalse(tokenizer.next()); + assertThrows(NoSuchElementException.class, tokenizer::current); + } + + @Test + void currentInstanceHasValue() { + assertNotNull(SensitiveHandler.get()); + } + + @Test + void incompatibleNamePatternFallsBackToDefault() { + final SensitiveHandlerImpl handler = + new SensitiveHandlerImpl(RE2J_INCOMPATIBLE_PATTERN, DEFAULT_IAST_REDACTION_VALUE_PATTERN); + + // the default name pattern is used instead of failing to compile + assertTrue(handler.isSensitiveName("password")); + assertFalse(handler.isSensitiveName("username")); + } + + @Test + void incompatibleValuePatternFallsBackToDefault() { + final SensitiveHandlerImpl handler = + new SensitiveHandlerImpl(DEFAULT_IAST_REDACTION_NAME_PATTERN, RE2J_INCOMPATIBLE_PATTERN); + + // the default value pattern is used instead of failing to compile + assertTrue(handler.isSensitiveValue("bearer abc123def456")); + assertFalse(handler.isSensitiveValue("not a secret value")); + } +} diff --git a/dd-java-agent/agent-iast/src/test/java/com/datadog/iast/sensitive/SqlRegexpTokenizerTest.java b/dd-java-agent/agent-iast/src/test/java/com/datadog/iast/sensitive/SqlRegexpTokenizerTest.java new file mode 100644 index 00000000000..4268b95539b --- /dev/null +++ b/dd-java-agent/agent-iast/src/test/java/com/datadog/iast/sensitive/SqlRegexpTokenizerTest.java @@ -0,0 +1,160 @@ +package com.datadog.iast.sensitive; + +import static datadog.trace.api.iast.sink.SqlInjectionModule.DATABASE_PARAMETER; +import static java.util.Arrays.asList; +import static java.util.Collections.emptyList; +import static java.util.Collections.singletonList; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTimeoutPreemptively; +import static org.junit.jupiter.params.provider.Arguments.arguments; + +import com.datadog.iast.model.Evidence; +import com.datadog.iast.sensitive.SensitiveHandler.Tokenizer; +import com.datadog.iast.util.Ranged; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Stream; +import javax.annotation.Nullable; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +class SqlRegexpTokenizerTest { + + @ParameterizedTest(name = "{0}") + @MethodSource("tokenizesSqlLiteralsArguments") + void tokenizesSqlLiterals( + final String description, + @Nullable final String dialect, + final String sql, + final List expected) { + assertEquals(expected, tokenize(dialect, sql)); + } + + static Stream tokenizesSqlLiteralsArguments() { + return Stream.of( + // ANSI (default dialect when no database is provided) + arguments( + "ansi single-quoted string", + null, + "SELECT name FROM u WHERE name = 'john'", + singletonList("john")), + arguments( + "ansi escaped single quote", null, "SELECT 'O''Brien'", singletonList("O''Brien")), + arguments("ansi integer literal", null, "SELECT 12345", singletonList("12345")), + arguments("ansi decimal literal", null, "SELECT 3.14", singletonList("3.14")), + arguments("ansi hex literal", null, "SELECT 0x1aF", singletonList("0x1aF")), + arguments("ansi line comment", null, "SELECT a -- bye", singletonList(" bye")), + arguments("ansi block comment", null, "SELECT /* hidden */ a", singletonList(" hidden ")), + arguments("ansi ignores double quotes", null, "SELECT \"x\" FROM t", emptyList()), + // MySQL family treats double-quoted strings as literals + arguments( + "mysql double-quoted string", + "mysql", + "SELECT \"secret\" FROM t", + singletonList("secret")), + // Oracle q'...' escaped literals (bracket pairs + enumerated single-char delimiters) + arguments( + "oracle q bracket literal", + "oracle", + "SELECT q'[hello]' FROM dual", + singletonList("hello")), + arguments( + "oracle q paren literal", + "oracle", + "SELECT q'(hello)' FROM dual", + singletonList("hello")), + arguments( + "oracle q custom delimiter", + "oracle", + "SELECT q'#hello#' FROM dual", + singletonList("hello")), + // Oracle forbids whitespace as a q' delimiter, so a space-delimited q' is intentionally + // NOT recognized as a q-literal; its content is still captured by the generic + // single-quoted-string branch (so the secret is still redacted, just not q-unwrapped). + arguments( + "oracle q whitespace delimiter is not a q-literal", + "oracle", + "SELECT q' secret ' FROM dual", + singletonList(" secret ")), + // PostgreSQL dollar-quoting + arguments( + "postgres dollar quote", + "postgresql", + "SELECT $tag$secret$tag$", + singletonList("secret")), + arguments( + "postgres empty-tag dollar quote", + "postgresql", + "SELECT $$secret$$", + singletonList("secret")), + arguments("postgres overlapping tags", "postgresql", "SELECT $a$x$a$", singletonList("x")), + arguments( + "postgres unterminated tag is skipped", "postgresql", "SELECT $tag$value", emptyList()), + // Boundary cases around buildDollarTagPositions: the scan must not read past end-of-string. + arguments("postgres lone dollar at end of string", "postgresql", "SELECT a$", emptyList()), + arguments( + "postgres identifier tag without closing dollar at end of string", + "postgresql", + "SELECT $tag", + emptyList()), + arguments( + "postgres empty-tag opener without close at end of string", + "postgresql", + "SELECT $$secret", + emptyList()), + // Parameter placeholders ($1, $2) must NOT be treated as dollar-quote openers; only their + // digits are tokenized as numeric literals. + arguments( + "postgres placeholders are not dollar quotes", + "postgresql", + "SELECT * FROM t WHERE a = $1 AND b = $2", + asList("1", "2"))); + } + + @Test + void manyUnterminatedDollarTagsRunInLinearTime() { + // Each "$tN$" is a distinct, valid but unterminated dollar-quote opener. The previous + // indexOf-per-opener implementation scanned to end-of-string once per opener (O(n^2)) and would + // not finish anywhere near this budget; the precomputed tag index keeps it near-linear. + StringBuilder builder = new StringBuilder(); + for (int i = 0; i < 60_000; i++) { + builder.append('$').append('t').append(i).append('$'); + } + String sql = builder.toString(); + + assertTimeoutPreemptively( + Duration.ofSeconds(10), + () -> { + Tokenizer tokenizer = new SqlRegexpTokenizer(postgresEvidence(sql)); + // None of the openers has a matching close, so tokenization yields nothing and must + // simply terminate quickly. + assertFalse(tokenizer.next()); + }); + } + + private static Evidence postgresEvidence(String sql) { + return evidence("postgresql", sql); + } + + private static Evidence evidence(@Nullable String dialect, String sql) { + Evidence evidence = new Evidence(sql); + if (dialect != null) { + evidence.getContext().put(DATABASE_PARAMETER, dialect); + } + return evidence; + } + + private static List tokenize(@Nullable String dialect, String sql) { + Tokenizer tokenizer = new SqlRegexpTokenizer(evidence(dialect, sql)); + List tokens = new ArrayList<>(); + while (tokenizer.next()) { + Ranged range = tokenizer.current(); + tokens.add(sql.substring(range.getStart(), range.getStart() + range.getLength())); + } + return tokens; + } +} diff --git a/dd-java-agent/agent-iast/src/test/java/com/datadog/iast/sensitive/UrlRegexpTokenizerTest.java b/dd-java-agent/agent-iast/src/test/java/com/datadog/iast/sensitive/UrlRegexpTokenizerTest.java new file mode 100644 index 00000000000..1e5fd780fd8 --- /dev/null +++ b/dd-java-agent/agent-iast/src/test/java/com/datadog/iast/sensitive/UrlRegexpTokenizerTest.java @@ -0,0 +1,44 @@ +package com.datadog.iast.sensitive; + +import static java.util.Arrays.asList; +import static java.util.Collections.singletonList; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.params.provider.Arguments.arguments; + +import com.datadog.iast.model.Evidence; +import com.datadog.iast.sensitive.SensitiveHandler.Tokenizer; +import com.datadog.iast.util.Ranged; +import java.util.ArrayList; +import java.util.List; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +class UrlRegexpTokenizerTest { + + @ParameterizedTest(name = "{0}") + @MethodSource("redactsUrlSecretsArguments") + void redactsUrlSecrets(final String description, final String url, final List expected) { + assertEquals(expected, tokenize(url)); + } + + static Stream redactsUrlSecretsArguments() { + return Stream.of( + arguments("userinfo authority", "https://user:pass@host/path", singletonList("user:pass")), + arguments("single user authority", "ftp://bob@server/file", singletonList("bob")), + arguments( + "query parameter values", "http://h/p?token=secret&id=42", asList("secret", "42")), + arguments("authority and query together", "https://user@host/p?q=v", asList("user", "v"))); + } + + private static List tokenize(String url) { + Tokenizer tokenizer = new UrlRegexpTokenizer(new Evidence(url)); + List tokens = new ArrayList<>(); + while (tokenizer.next()) { + Ranged range = tokenizer.current(); + tokens.add(url.substring(range.getStart(), range.getStart() + range.getLength())); + } + return tokens; + } +} diff --git a/dd-java-agent/agent-installer/build.gradle b/dd-java-agent/agent-installer/build.gradle index b8c8aac5460..766e55af799 100644 --- a/dd-java-agent/agent-installer/build.gradle +++ b/dd-java-agent/agent-installer/build.gradle @@ -42,12 +42,26 @@ tasks.named("compileMain_java25Java", JavaCompile) { } dependencies { + // Wire the Java-version-specific source sets into this project without publishing + // their raw output: + // + // - each additional source set compiles against the main output and only the + // dependencies it needs + // - their compiled outputs stay visible to tests through `testImplementation` + // - their compiled outputs are folded into this project's jar by the jar task below + // + // Main code loads these classes reflectively at agent runtime, so downstream + // consumers should get them from the agent-installer jar. Do not add these + // outputs to `runtimeOnly`: `runtimeElements` publishes both the jar artifact + // and runtime dependencies. Publishing the raw outputs there would expose the + // same classes twice, once from the jar and once from the class directories. main_java11CompileOnly project(':dd-java-agent:agent-tooling') main_java11CompileOnly sourceSets.main.output + testImplementation sourceSets.main_java11.output + main_java25CompileOnly project(':dd-trace-core') main_java25CompileOnly sourceSets.main.output - runtimeOnly sourceSets.main_java11.output - runtimeOnly sourceSets.main_java25.output + testImplementation sourceSets.main_java25.output } tasks.named("jar", Jar) { diff --git a/dd-java-agent/agent-installer/gradle.lockfile b/dd-java-agent/agent-installer/gradle.lockfile index f2a4adeece1..4e2e00d4ef5 100644 --- a/dd-java-agent/agent-installer/gradle.lockfile +++ b/dd-java-agent/agent-installer/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-installer:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,main_java11CompileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,main_java25CompileClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,main_java25CompileClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,main_java11CompileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,main_java11CompileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,main_java11CompileClasspath,main_java25CompileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:2.10.5=compileClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath @@ -16,27 +17,31 @@ com.datadoghq:jmxfetch:0.52.0=compileClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc com.github.jnr:jffi:1.2.23=compileClasspath -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=compileClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath com.github.jnr:jnr-constants:0.9.15=compileClasspath com.github.jnr:jnr-enxio:0.25=compileClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath com.github.jnr:jnr-ffi:2.1.12=compileClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath com.github.jnr:jnr-posix:3.0.53=compileClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath com.github.jnr:jnr-unixsocket:0.27=compileClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=compileClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,main_java25CompileClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +52,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=compileClasspath,main_java11CompileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileClasspath,main_java11CompileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=compileClasspath,main_java11CompileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileClasspath,main_java11CompileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -78,12 +83,13 @@ org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -103,16 +109,18 @@ org.ow2.asm:asm-analysis:7.1=compileClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs org.ow2.asm:asm-commons:7.1=compileClasspath +org.ow2.asm:asm-commons:9.10.1=jacocoAnt org.ow2.asm:asm-commons:9.7.1=testRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.9=spotbugs org.ow2.asm:asm-tree:7.1=compileClasspath +org.ow2.asm:asm-tree:9.10.1=jacocoAnt org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:7.1=compileClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,main_java11CompileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.10.1=compileClasspath,jacocoAnt,main_java11CompileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/agent-installer/src/main/java/datadog/trace/agent/tooling/CombiningTransformerBuilder.java b/dd-java-agent/agent-installer/src/main/java/datadog/trace/agent/tooling/CombiningTransformerBuilder.java index 1990b692092..5a7e4b9c3df 100644 --- a/dd-java-agent/agent-installer/src/main/java/datadog/trace/agent/tooling/CombiningTransformerBuilder.java +++ b/dd-java-agent/agent-installer/src/main/java/datadog/trace/agent/tooling/CombiningTransformerBuilder.java @@ -274,7 +274,7 @@ private void addAdviceIfEnabled( } AgentBuilder.Transformer.ForAdvice forAdvice = new AgentBuilder.Transformer.ForAdvice(customMapping) - .withExceptionHandler(ExceptionHandlers.defaultExceptionHandler()) + .withExceptionHandler(ExceptionHandlers.exceptionHandlerFor(adviceClass)) .include(Utils.getBootstrapProxy()); ClassLoader adviceLoader = Utils.getExtendedClassLoader(); if (adviceShader != null) { diff --git a/dd-java-agent/agent-installer/src/main/java/datadog/trace/agent/tooling/nativeimage/TracerActivation.java b/dd-java-agent/agent-installer/src/main/java/datadog/trace/agent/tooling/nativeimage/TracerActivation.java index e6ff1031faa..682ceb9115e 100644 --- a/dd-java-agent/agent-installer/src/main/java/datadog/trace/agent/tooling/nativeimage/TracerActivation.java +++ b/dd-java-agent/agent-installer/src/main/java/datadog/trace/agent/tooling/nativeimage/TracerActivation.java @@ -8,6 +8,7 @@ import datadog.trace.agent.tooling.MeterInstaller; import datadog.trace.agent.tooling.ProfilerInstaller; import datadog.trace.agent.tooling.TracerInstaller; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; import datadog.trace.bootstrap.instrumentation.api.ProfilingContextIntegration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -18,6 +19,7 @@ public final class TracerActivation { public static void activate() { try { + AgentTracer.maybeInstallLegacyContextManager(); // Initialize meter MeterInstaller.installMeter(); // Initialize tracer diff --git a/dd-java-agent/agent-jmxfetch/build.gradle b/dd-java-agent/agent-jmxfetch/build.gradle index b65d3a110f5..e1eb54102a4 100644 --- a/dd-java-agent/agent-jmxfetch/build.gradle +++ b/dd-java-agent/agent-jmxfetch/build.gradle @@ -25,6 +25,11 @@ dependencies { api libs.slf4j api project(':internal-api') api project(':dd-java-agent:agent-bootstrap') + + // JvmOtlpRuntimeMetrics registers JVM runtime instruments directly against the + // bootstrap-level OTel metric registry. otel-bootstrap vendors and repackages the + // OTel API at build time so this won't conflict with anything in the customer app. + compileOnly project(path: ':dd-java-agent:agent-otel:otel-bootstrap', configuration: 'shadow') } tasks.named("shadowJar", ShadowJar) { diff --git a/dd-java-agent/agent-jmxfetch/gradle.lockfile b/dd-java-agent/agent-jmxfetch/gradle.lockfile index 39d86f12391..0a4d55eb5e0 100644 --- a/dd-java-agent/agent-jmxfetch/gradle.lockfile +++ b/dd-java-agent/agent-jmxfetch/gradle.lockfile @@ -1,9 +1,10 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-jmxfetch:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:2.10.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:jmxfetch:0.52.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -16,7 +17,7 @@ com.github.jnr:jnr-ffi:2.1.12=compileClasspath,runtimeClasspath,testCompileClass com.github.jnr:jnr-posix:3.0.53=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.jnr:jnr-unixsocket:0.27=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -51,10 +52,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -70,13 +71,16 @@ org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:7.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs org.ow2.asm:asm-commons:7.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs org.ow2.asm:asm-tree:7.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:7.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs org.ow2.asm:asm:7.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/agent-jmxfetch/src/main/java/datadog/trace/agent/jmxfetch/JMXFetch.java b/dd-java-agent/agent-jmxfetch/src/main/java/datadog/trace/agent/jmxfetch/JMXFetch.java index f0a2a5541f8..a46b1cb81a1 100644 --- a/dd-java-agent/agent-jmxfetch/src/main/java/datadog/trace/agent/jmxfetch/JMXFetch.java +++ b/dd-java-agent/agent-jmxfetch/src/main/java/datadog/trace/agent/jmxfetch/JMXFetch.java @@ -9,6 +9,7 @@ import datadog.metrics.api.statsd.StatsDClientManager; import datadog.trace.api.Config; import datadog.trace.api.GlobalTracer; +import datadog.trace.api.InstrumenterConfig; import datadog.trace.api.flare.TracerFlare; import datadog.trace.api.telemetry.LogCollector; import de.thetaphi.forbiddenapis.SuppressForbidden; @@ -32,6 +33,7 @@ public class JMXFetch { private static final Logger log = LoggerFactory.getLogger(JMXFetch.class); private static final String DEFAULT_CONFIG = "jmxfetch-config.yaml"; + private static final String OTLP_JMX_CONFIG = "jmxfetch-config-no-jvm-defaults.yaml"; private static final String WEBSPHERE_CONFIG = "jmxfetch-websphere-config.yaml"; private static final int DELAY_BETWEEN_RUN_ATTEMPTS = 5000; @@ -93,9 +95,22 @@ private static void run(final StatsDClientManager statsDClientManager, final Con final StatsDClient statsd = statsDClientManager.statsDClient(host, port, namedPipe, null, null); final AgentStatsdReporter reporter = new AgentStatsdReporter(statsd); + final boolean otlpRuntimeMetricsEnabled = + InstrumenterConfig.get().isMetricsOtelEnabled() && config.isMetricsOtlpExporterEnabled(); + TracerFlare.addReporter(reporter); final List defaultConfigs = new ArrayList<>(); - defaultConfigs.add(DEFAULT_CONFIG); + if (otlpRuntimeMetricsEnabled) { + // Register JVM runtime metric callbacks against the OtelMeterProvider so the OTLP + // exporter started by CoreTracer collects them. Started here so it rides the same + // delayed-start path as JMXFetch itself. + JvmOtlpRuntimeMetrics.start(config.isMetricsOtelExperimentalEnabled()); + // When the OTLP exporter is collecting JVM runtime metrics, skip the default JMXFetch + // JVM config to avoid double-reporting. + defaultConfigs.add(OTLP_JMX_CONFIG); + } else { + defaultConfigs.add(DEFAULT_CONFIG); + } if (config.isJmxFetchIntegrationEnabled(Collections.singletonList("websphere"), false)) { defaultConfigs.add(WEBSPHERE_CONFIG); } diff --git a/dd-java-agent/agent-jmxfetch/src/main/java/datadog/trace/agent/jmxfetch/JvmOtlpRuntimeMetrics.java b/dd-java-agent/agent-jmxfetch/src/main/java/datadog/trace/agent/jmxfetch/JvmOtlpRuntimeMetrics.java new file mode 100644 index 00000000000..5f26cdb2206 --- /dev/null +++ b/dd-java-agent/agent-jmxfetch/src/main/java/datadog/trace/agent/jmxfetch/JvmOtlpRuntimeMetrics.java @@ -0,0 +1,726 @@ +package datadog.trace.agent.jmxfetch; + +import static datadog.trace.bootstrap.otel.metrics.OtelInstrumentType.COUNTER; +import static datadog.trace.bootstrap.otel.metrics.OtelInstrumentType.GAUGE; +import static datadog.trace.bootstrap.otel.metrics.OtelInstrumentType.HISTOGRAM; +import static datadog.trace.bootstrap.otel.metrics.OtelInstrumentType.UP_DOWN_COUNTER; + +import com.sun.management.GarbageCollectionNotificationInfo; +import com.sun.management.OperatingSystemMXBean; +import com.sun.management.UnixOperatingSystemMXBean; +import datadog.trace.bootstrap.otel.api.common.AttributeKey; +import datadog.trace.bootstrap.otel.api.common.Attributes; +import datadog.trace.bootstrap.otel.common.OtelInstrumentationScope; +import datadog.trace.bootstrap.otel.metrics.OtelInstrumentBuilder; +import datadog.trace.bootstrap.otel.metrics.OtelInstrumentDescriptor; +import datadog.trace.bootstrap.otel.metrics.OtelInstrumentType; +import datadog.trace.bootstrap.otel.metrics.data.OtelMetricRegistry; +import datadog.trace.bootstrap.otel.metrics.data.OtelMetricStorage; +import datadog.trace.bootstrap.otel.metrics.data.OtelRunnableObservable; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import java.lang.management.BufferPoolMXBean; +import java.lang.management.ClassLoadingMXBean; +import java.lang.management.GarbageCollectorMXBean; +import java.lang.management.ManagementFactory; +import java.lang.management.MemoryMXBean; +import java.lang.management.MemoryPoolMXBean; +import java.lang.management.MemoryUsage; +import java.lang.management.ThreadInfo; +import java.lang.management.ThreadMXBean; +import java.util.Arrays; +import java.util.EnumMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.ToLongFunction; +import javax.management.Notification; +import javax.management.NotificationEmitter; +import javax.management.NotificationFilter; +import javax.management.NotificationListener; +import javax.management.openmbean.CompositeData; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Registers JVM runtime metrics with OTel-native names against the agent's bootstrap-level metric + * registry. + */ +public final class JvmOtlpRuntimeMetrics { + private static final Logger log = LoggerFactory.getLogger(JvmOtlpRuntimeMetrics.class); + + private static final OtelInstrumentationScope JVM_SCOPE = + new OtelInstrumentationScope("datadog.jvm.runtime", null, null); + + private static final AttributeKey MEMORY_TYPE = AttributeKey.stringKey("jvm.memory.type"); + private static final AttributeKey MEMORY_POOL = + AttributeKey.stringKey("jvm.memory.pool.name"); + private static final AttributeKey BUFFER_POOL = + AttributeKey.stringKey("jvm.buffer.pool.name"); + private static final AttributeKey GC_NAME = AttributeKey.stringKey("jvm.gc.name"); + private static final AttributeKey GC_ACTION = AttributeKey.stringKey("jvm.gc.action"); + private static final AttributeKey GC_CAUSE = AttributeKey.stringKey("jvm.gc.cause"); + private static final AttributeKey THREAD_DAEMON = + AttributeKey.booleanKey("jvm.thread.daemon"); + private static final AttributeKey THREAD_STATE = + AttributeKey.stringKey("jvm.thread.state"); + private static final Attributes HEAP_ATTRS = Attributes.of(MEMORY_TYPE, "heap"); + private static final Attributes NON_HEAP_ATTRS = Attributes.of(MEMORY_TYPE, "non_heap"); + + /** + * Precomputed Attributes for each (daemon, Thread.State) pair, used by jvm.thread.count. There + * are only 12 combinations, so caching avoids per-poll allocation of identical Attribute objects. + */ + private static final Attributes[] DAEMON_THREAD_STATE_ATTRS = buildThreadStateAttrs(true); + + private static final Attributes[] NON_DAEMON_THREAD_STATE_ATTRS = buildThreadStateAttrs(false); + + private static Attributes[] buildThreadStateAttrs(boolean daemon) { + Thread.State[] states = Thread.State.values(); + Attributes[] result = new Attributes[states.length]; + for (Thread.State state : states) { + result[state.ordinal()] = + Attributes.of(THREAD_DAEMON, daemon, THREAD_STATE, state.name().toLowerCase(Locale.ROOT)); + } + return result; + } + + /** + * MethodHandle for {@code ThreadInfo#isDaemon()}: non-null on Java 9+, null on Java 8. Doubles as + * the Java-version probe since this code is compiled against Java 8 and cannot reference the + * symbol directly. + */ + private static final MethodHandle THREAD_INFO_IS_DAEMON = resolveThreadInfoIsDaemon(); + + private static final ThreadMXBean THREAD_BEAN = ManagementFactory.getThreadMXBean(); + + /** + * jvm.thread.count collector, chosen once at class load. Java 9+ uses {@link + * ThreadMXBean#getThreadInfo(long[])} (the single-arg overload omits stack-trace capture); Java 8 + * (and GraalVM native image, where ThreadMXBean is unsupported) walks the root {@link + * ThreadGroup}. Avoids {@link Thread#getAllStackTraces()}, which forces a safepoint and allocates + * a {@code StackTraceElement[]} per thread on every poll. + */ + private static final Consumer THREAD_COUNT_COLLECTOR = + chooseThreadCountCollector(); + + private static MethodHandle resolveThreadInfoIsDaemon() { + try { + return MethodHandles.publicLookup() + .findVirtual(ThreadInfo.class, "isDaemon", MethodType.methodType(boolean.class)); + } catch (NoSuchMethodException | IllegalAccessException e) { + return null; // Java 8 — fall back to ThreadGroup walk + } + } + + private static Consumer chooseThreadCountCollector() { + boolean isJava9OrNewer = THREAD_INFO_IS_DAEMON != null; + boolean isNativeImage = System.getProperty("org.graalvm.nativeimage.imagecode") != null; + if (isJava9OrNewer && !isNativeImage) { + return JvmOtlpRuntimeMetrics::collectThreadCountsViaThreadMXBean; + } + return JvmOtlpRuntimeMetrics::collectThreadCountsViaThreadGroup; + } + + /** Explicit bucket advice for jvm.gc.duration in seconds (matches OTel runtime-telemetry). */ + private static final List GC_DURATION_BUCKETS = Arrays.asList(0.01, 0.1, 1.0, 10.0); + + private static final String GC_NOTIFICATION_TYPE = "com.sun.management.gc.notification"; + + private static final AtomicBoolean started = new AtomicBoolean(false); + + /** + * Registers all JVM runtime metric instruments on the bootstrap-level metric registry. + * + * @param emitExperimentalMetrics when {@code true} (the spec-aligned default), metrics marked as + * Development in the OTel semantic conventions are also registered. When {@code + * false}, only metrics with stable status are emitted. + */ + public static void start(boolean emitExperimentalMetrics) { + if (!started.compareAndSet(false, true)) { + return; + } + + try { + // Ensure OtelMetricStorage can serialize io.opentelemetry.api Attributes recorded below; + // the otel-shim registers an equivalent reader on its own class-loader, but agent-jmxfetch + // does not depend on the shim — so we register one here for our Attributes class-loader. + OtelMetricStorage.registerAttributeReader( + Attributes.class.getClassLoader(), + (attributes, visitor) -> + ((Attributes) attributes) + .forEach((a, v) -> visitor.visitAttribute(a.getType().ordinal(), a.getKey(), v))); + + // Stable metrics — always registered. + registerMemoryMetrics(); + registerThreadMetrics(); + registerClassLoadingMetrics(); + registerCpuMetrics(); + registerGcDurationMetric(emitExperimentalMetrics); + + // Development-status metrics — gated by the experimental flag. + if (emitExperimentalMetrics) { + registerMemoryInitMetric(); + registerBufferMetrics(); + registerSystemCpuMetrics(); + registerFileDescriptorMetrics(); + } + log.debug( + "Started OTLP runtime metrics with OTel-native naming (jvm.*), experimental={}", + emitExperimentalMetrics); + } catch (Exception e) { + log.error("Failed to start JVM OTLP runtime metrics", e); + } + } + + /** + * jvm.memory.used, jvm.memory.committed, jvm.memory.limit, jvm.memory.used_after_last_gc — all + * Stable per spec. All UpDownCounter. + */ + private static void registerMemoryMetrics() { + MemoryMXBean memoryBean = ManagementFactory.getMemoryMXBean(); + List pools = ManagementFactory.getMemoryPoolMXBeans(); + + registerLongObservable( + "jvm.memory.used", + "Measure of memory used.", + "By", + UP_DOWN_COUNTER, + storage -> { + storage.recordLong(memoryBean.getHeapMemoryUsage().getUsed(), HEAP_ATTRS); + storage.recordLong(memoryBean.getNonHeapMemoryUsage().getUsed(), NON_HEAP_ATTRS); + for (MemoryPoolMXBean pool : pools) { + storage.recordLong(pool.getUsage().getUsed(), poolAttributes(pool)); + } + }); + + registerLongObservable( + "jvm.memory.committed", + "Measure of memory committed.", + "By", + UP_DOWN_COUNTER, + storage -> { + storage.recordLong(memoryBean.getHeapMemoryUsage().getCommitted(), HEAP_ATTRS); + storage.recordLong(memoryBean.getNonHeapMemoryUsage().getCommitted(), NON_HEAP_ATTRS); + for (MemoryPoolMXBean pool : pools) { + storage.recordLong(pool.getUsage().getCommitted(), poolAttributes(pool)); + } + }); + + registerLongObservable( + "jvm.memory.limit", + "Measure of max obtainable memory.", + "By", + UP_DOWN_COUNTER, + storage -> { + long heapMax = memoryBean.getHeapMemoryUsage().getMax(); + if (heapMax != -1) { + storage.recordLong(heapMax, HEAP_ATTRS); + } + long nonHeapMax = memoryBean.getNonHeapMemoryUsage().getMax(); + if (nonHeapMax != -1) { + storage.recordLong(nonHeapMax, NON_HEAP_ATTRS); + } + for (MemoryPoolMXBean pool : pools) { + long max = pool.getUsage().getMax(); + if (max != -1) { + storage.recordLong(max, poolAttributes(pool)); + } + } + }); + + registerLongObservable( + "jvm.memory.used_after_last_gc", + "Measure of memory used after the most recent garbage collection event.", + "By", + UP_DOWN_COUNTER, + storage -> { + for (MemoryPoolMXBean pool : pools) { + MemoryUsage collectionUsage = pool.getCollectionUsage(); + if (collectionUsage != null && collectionUsage.getUsed() >= 0) { + storage.recordLong(collectionUsage.getUsed(), poolAttributes(pool)); + } + } + }); + } + + /** jvm.memory.init (UpDownCounter, Development). */ + private static void registerMemoryInitMetric() { + MemoryMXBean memoryBean = ManagementFactory.getMemoryMXBean(); + List pools = ManagementFactory.getMemoryPoolMXBeans(); + registerLongObservable( + "jvm.memory.init", + "Measure of initial memory requested.", + "By", + UP_DOWN_COUNTER, + storage -> { + long heapInit = memoryBean.getHeapMemoryUsage().getInit(); + if (heapInit != -1) { + storage.recordLong(heapInit, HEAP_ATTRS); + } + long nonHeapInit = memoryBean.getNonHeapMemoryUsage().getInit(); + if (nonHeapInit != -1) { + storage.recordLong(nonHeapInit, NON_HEAP_ATTRS); + } + for (MemoryPoolMXBean pool : pools) { + long init = pool.getUsage().getInit(); + if (init != -1) { + storage.recordLong(init, poolAttributes(pool)); + } + } + }); + } + + /** jvm.buffer.* (UpDownCounter, Development) — direct + mapped pool metrics. */ + private static void registerBufferMetrics() { + List bufferPools = + ManagementFactory.getPlatformMXBeans(BufferPoolMXBean.class); + bufferPoolMetric( + "jvm.buffer.memory.used", + "Measure of memory used by buffers.", + "By", + bufferPools, + BufferPoolMXBean::getMemoryUsed); + bufferPoolMetric( + "jvm.buffer.memory.limit", + "Measure of total memory capacity of buffers.", + "By", + bufferPools, + BufferPoolMXBean::getTotalCapacity); + bufferPoolMetric( + "jvm.buffer.count", + "Number of buffers in the pool.", + "{buffer}", + bufferPools, + BufferPoolMXBean::getCount); + } + + /** + * jvm.thread.count (UpDownCounter, Stable). Bucketed by {@code jvm.thread.daemon} and {@code + * jvm.thread.state} per the OTel JVM semantic conventions. + */ + private static void registerThreadMetrics() { + registerLongObservable( + "jvm.thread.count", + "Number of executing platform threads.", + "{thread}", + UP_DOWN_COUNTER, + THREAD_COUNT_COLLECTOR); + } + + /** + * Java 9+ path. Enumerates threads via {@link ThreadMXBean#getThreadInfo(long[])}; the single-arg + * overload omits stack-trace capture, avoiding the safepoint and per-frame allocation incurred by + * {@link Thread#getAllStackTraces()}. + */ + private static void collectThreadCountsViaThreadMXBean(OtelMetricStorage storage) { + Map daemonCounts = new EnumMap<>(Thread.State.class); + Map nonDaemonCounts = new EnumMap<>(Thread.State.class); + long[] ids = THREAD_BEAN.getAllThreadIds(); + for (ThreadInfo info : THREAD_BEAN.getThreadInfo(ids)) { + if (info == null) { + continue; // thread terminated between getAllThreadIds and getThreadInfo + } + Map bucket = threadInfoIsDaemon(info) ? daemonCounts : nonDaemonCounts; + bucket.computeIfAbsent(info.getThreadState(), k -> new long[1])[0]++; + } + recordThreadStateCounts(storage, daemonCounts, DAEMON_THREAD_STATE_ATTRS); + recordThreadStateCounts(storage, nonDaemonCounts, NON_DAEMON_THREAD_STATE_ATTRS); + } + + /** + * Java 8 / GraalVM fallback. Walks the root {@link ThreadGroup} because {@code + * ThreadInfo.isDaemon()} was added in Java 9 and {@link ThreadMXBean} is not supported on GraalVM + * native images. + */ + private static void collectThreadCountsViaThreadGroup(OtelMetricStorage storage) { + Map daemonCounts = new EnumMap<>(Thread.State.class); + Map nonDaemonCounts = new EnumMap<>(Thread.State.class); + for (Thread thread : enumerateAllThreads()) { + Map bucket = thread.isDaemon() ? daemonCounts : nonDaemonCounts; + bucket.computeIfAbsent(thread.getState(), k -> new long[1])[0]++; + } + recordThreadStateCounts(storage, daemonCounts, DAEMON_THREAD_STATE_ATTRS); + recordThreadStateCounts(storage, nonDaemonCounts, NON_DAEMON_THREAD_STATE_ATTRS); + } + + /** Invokes {@code ThreadInfo#isDaemon()} via {@link #THREAD_INFO_IS_DAEMON} (Java 9+ only). */ + private static boolean threadInfoIsDaemon(ThreadInfo info) { + try { + return (boolean) THREAD_INFO_IS_DAEMON.invoke(info); + } catch (Throwable t) { + throw new IllegalStateException("Unexpected error invoking ThreadInfo#isDaemon()", t); + } + } + + /** + * Walks the root {@link ThreadGroup} and returns a snapshot of active threads. Allocates a + * slightly oversized buffer to absorb threads created between {@code activeCount()} and {@code + * enumerate()}; if the buffer is still too small the returned array may be truncated. + */ + private static Thread[] enumerateAllThreads() { + ThreadGroup group = Thread.currentThread().getThreadGroup(); + // ThreadGroup.enumerate() recursively descends through children by default, so enumerating from + // the root gives every live thread in the JVM. + while (group.getParent() != null) { + group = group.getParent(); + } + Thread[] buffer = new Thread[group.activeCount() + 10]; + int n = group.enumerate(buffer); + if (n == buffer.length) { + return buffer; + } + Thread[] trimmed = new Thread[n]; + System.arraycopy(buffer, 0, trimmed, 0, n); + return trimmed; + } + + private static void recordThreadStateCounts( + OtelMetricStorage storage, Map counts, Attributes[] attrsByState) { + for (Map.Entry entry : counts.entrySet()) { + storage.recordLong(entry.getValue()[0], attrsByState[entry.getKey().ordinal()]); + } + } + + /** + * jvm.class.loaded (Counter), jvm.class.unloaded (Counter), jvm.class.count (UpDownCounter) — all + * Stable per spec. + */ + private static void registerClassLoadingMetrics() { + ClassLoadingMXBean classLoadingBean = ManagementFactory.getClassLoadingMXBean(); + registerLongObservable( + "jvm.class.loaded", + "Number of classes loaded since JVM start.", + "{class}", + COUNTER, + storage -> + storage.recordLong(classLoadingBean.getTotalLoadedClassCount(), Attributes.empty())); + + registerLongObservable( + "jvm.class.count", + "Number of classes currently loaded.", + "{class}", + UP_DOWN_COUNTER, + storage -> storage.recordLong(classLoadingBean.getLoadedClassCount(), Attributes.empty())); + + registerLongObservable( + "jvm.class.unloaded", + "Number of classes unloaded since JVM start.", + "{class}", + COUNTER, + storage -> + storage.recordLong(classLoadingBean.getUnloadedClassCount(), Attributes.empty())); + } + + /** + * jvm.cpu.time (Counter), jvm.cpu.count (UpDownCounter), jvm.cpu.recent_utilization (Gauge) — all + * Stable per spec. + */ + private static void registerCpuMetrics() { + java.lang.management.OperatingSystemMXBean rawOsBean = + ManagementFactory.getOperatingSystemMXBean(); + if (rawOsBean instanceof OperatingSystemMXBean) { + OperatingSystemMXBean sunOsBean = (OperatingSystemMXBean) rawOsBean; + registerDoubleObservable( + "jvm.cpu.time", + "CPU time used by the process as reported by the JVM.", + "s", + COUNTER, + storage -> { + long nanos = sunOsBean.getProcessCpuTime(); + if (nanos >= 0) { + storage.recordDouble(nanos / 1e9, Attributes.empty()); + } + }); + + registerDoubleObservable( + "jvm.cpu.recent_utilization", + "Recent CPU utilization for the process as reported by the JVM.", + "1", + GAUGE, + storage -> { + double cpuLoad = sunOsBean.getProcessCpuLoad(); + if (cpuLoad >= 0) { + storage.recordDouble(cpuLoad, Attributes.empty()); + } + }); + } else { + log.debug( + "com.sun.management.OperatingSystemMXBean not available; skipping jvm.cpu.time and jvm.cpu.recent_utilization"); + } + + registerLongObservable( + "jvm.cpu.count", + "Number of processors available to the JVM.", + "{cpu}", + UP_DOWN_COUNTER, + storage -> + storage.recordLong(Runtime.getRuntime().availableProcessors(), Attributes.empty())); + } + + /** + * jvm.gc.duration (Histogram, Stable) — synchronous; recorded from a JMX notification listener + * attached to each {@link GarbageCollectorMXBean} when the JVM completes a GC. + * + *

The {@code jvm.gc.cause} attribute is gated on {@code captureGcCause} because cause is not + * part of the stable attribute set in the OTel semantic conventions. + */ + private static void registerGcDurationMetric(boolean captureGcCause) { + if (!isGcNotificationInfoAvailable()) { + log.debug( + "com.sun.management.GarbageCollectionNotificationInfo not available; skipping jvm.gc.duration"); + return; + } + OtelMetricStorage storage = + registerDoubleHistogramStorage( + "jvm.gc.duration", + "Duration of JVM garbage collection actions.", + "s", + GC_DURATION_BUCKETS); + NotificationFilter filter = n -> GC_NOTIFICATION_TYPE.equals(n.getType()); + GcNotificationListener listener = new GcNotificationListener(storage, captureGcCause); + for (GarbageCollectorMXBean bean : ManagementFactory.getGarbageCollectorMXBeans()) { + if (bean instanceof NotificationEmitter) { + ((NotificationEmitter) bean).addNotificationListener(listener, filter, null); + } + } + } + + private static boolean isGcNotificationInfoAvailable() { + try { + Class.forName( + "com.sun.management.GarbageCollectionNotificationInfo", + false, + GarbageCollectorMXBean.class.getClassLoader()); + return true; + } catch (Exception e) { + return false; + } + } + + private static void recordGcDuration( + OtelMetricStorage storage, GarbageCollectionNotificationInfo info, boolean captureGcCause) { + double durationSeconds = info.getGcInfo().getDuration() / 1000d; + Attributes attrs = + captureGcCause + ? Attributes.of( + GC_NAME, info.getGcName(), + GC_ACTION, info.getGcAction(), + GC_CAUSE, info.getGcCause()) + : Attributes.of( + GC_NAME, info.getGcName(), + GC_ACTION, info.getGcAction()); + storage.recordDouble(durationSeconds, attrs); + } + + /** Listener fired by the JVM on the JMX notification thread when a GC completes. */ + static final class GcNotificationListener implements NotificationListener { + private final OtelMetricStorage storage; + private final boolean captureGcCause; + + GcNotificationListener(OtelMetricStorage storage, boolean captureGcCause) { + this.storage = storage; + this.captureGcCause = captureGcCause; + } + + @Override + public void handleNotification(Notification notification, Object handback) { + GarbageCollectionNotificationInfo info = + GarbageCollectionNotificationInfo.from((CompositeData) notification.getUserData()); + if (info == null) { + log.debug("Skipping jvm.gc.duration record: GC notification carried no info payload"); + return; + } + recordGcDuration(storage, info, captureGcCause); + } + } + + /** + * jvm.system.cpu.utilization (Gauge) and jvm.system.cpu.load_1m (Gauge) — both Development per + * spec. + */ + private static void registerSystemCpuMetrics() { + java.lang.management.OperatingSystemMXBean rawOsBean = + ManagementFactory.getOperatingSystemMXBean(); + if (rawOsBean instanceof OperatingSystemMXBean) { + OperatingSystemMXBean sunOsBean = (OperatingSystemMXBean) rawOsBean; + registerDoubleObservable( + "jvm.system.cpu.utilization", + "Recent CPU utilization for the whole system as reported by the JVM.", + "1", + GAUGE, + storage -> { + double load = sunOsBean.getSystemCpuLoad(); + if (load >= 0) { + storage.recordDouble(load, Attributes.empty()); + } + }); + } else { + log.debug( + "com.sun.management.OperatingSystemMXBean not available; skipping jvm.system.cpu.utilization"); + } + + registerDoubleObservable( + "jvm.system.cpu.load_1m", + "Average CPU load of the whole system for the last minute as reported by the JVM.", + "{run_queue_item}", + GAUGE, + storage -> { + double load = rawOsBean.getSystemLoadAverage(); + if (load >= 0) { + storage.recordDouble(load, Attributes.empty()); + } + }); + } + + /** + * jvm.file_descriptor.count (UpDownCounter) and jvm.file_descriptor.limit (UpDownCounter) — both + * Development per spec. Only registered when the underlying JVM exposes {@link + * UnixOperatingSystemMXBean} (Unix-like platforms). + */ + private static void registerFileDescriptorMetrics() { + java.lang.management.OperatingSystemMXBean rawOsBean = + ManagementFactory.getOperatingSystemMXBean(); + if (!(rawOsBean instanceof UnixOperatingSystemMXBean)) { + log.debug( + "com.sun.management.UnixOperatingSystemMXBean not available (non-Unix JVM); skipping jvm.file_descriptor.count and jvm.file_descriptor.limit"); + return; + } + UnixOperatingSystemMXBean unixOsBean = (UnixOperatingSystemMXBean) rawOsBean; + + registerLongObservable( + "jvm.file_descriptor.count", + "Number of open file descriptors as reported by the JVM.", + "{file_descriptor}", + UP_DOWN_COUNTER, + storage -> { + long count = unixOsBean.getOpenFileDescriptorCount(); + if (count >= 0) { + storage.recordLong(count, Attributes.empty()); + } + }); + + registerLongObservable( + "jvm.file_descriptor.limit", + "Measure of max open file descriptors as reported by the JVM.", + "{file_descriptor}", + UP_DOWN_COUNTER, + storage -> { + long limit = unixOsBean.getMaxFileDescriptorCount(); + if (limit >= 0) { + storage.recordLong(limit, Attributes.empty()); + } + }); + } + + /** + * Registers an UpDownCounter that iterates each platform buffer pool and records {@code getter} + * with the {@code jvm.buffer.pool.name} attribute. Skips negative readings. + */ + private static void bufferPoolMetric( + String name, + String description, + String unit, + List bufferPools, + ToLongFunction getter) { + registerLongObservable( + name, + description, + unit, + UP_DOWN_COUNTER, + storage -> { + for (BufferPoolMXBean pool : bufferPools) { + long value = getter.applyAsLong(pool); + if (value >= 0) { + storage.recordLong(value, Attributes.of(BUFFER_POOL, pool.getName())); + } + } + }); + } + + /** Registers a long observable instrument and its callback against the bootstrap registry. */ + private static void registerLongObservable( + String name, + String description, + String unit, + OtelInstrumentType type, + Consumer callback) { + registerObservable(OtelInstrumentBuilder.ofLongs(name, type), description, unit, callback); + } + + /** Registers a double observable instrument and its callback against the bootstrap registry. */ + private static void registerDoubleObservable( + String name, + String description, + String unit, + OtelInstrumentType type, + Consumer callback) { + registerObservable(OtelInstrumentBuilder.ofDoubles(name, type), description, unit, callback); + } + + /** Registers an observable instrument and its callback against the bootstrap registry. */ + private static void registerObservable( + OtelInstrumentBuilder builder, + String description, + String unit, + Consumer callback) { + builder.setDescription(description); + builder.setUnit(unit); + OtelMetricStorage storage = registerStorage(builder.observableDescriptor()); + OtelMetricRegistry.INSTANCE.registerObservable( + JVM_SCOPE, new OtelRunnableObservable(() -> callback.accept(storage))); + } + + /** + * Registers a synchronous double histogram against the bootstrap registry and returns its storage + * so callers can record values directly (e.g. from a JMX notification listener). + */ + private static OtelMetricStorage registerDoubleHistogramStorage( + String name, String description, String unit, List bucketBoundaries) { + OtelInstrumentBuilder builder = OtelInstrumentBuilder.ofDoubles(name, HISTOGRAM); + builder.setDescription(description); + builder.setUnit(unit); + return OtelMetricRegistry.INSTANCE.registerStorage( + JVM_SCOPE, + builder.descriptor(), + descriptor -> OtelMetricStorage.newHistogramStorage(descriptor, bucketBoundaries)); + } + + /** Registers metric storage for the instrument against the bootstrap registry. */ + private static OtelMetricStorage registerStorage(OtelInstrumentDescriptor descriptor) { + Function storageFactory; + switch (descriptor.getType()) { + case OBSERVABLE_GAUGE: + // observable gauges always use last-value + storageFactory = + descriptor.hasLongValues() + ? OtelMetricStorage::newLongValueStorage + : OtelMetricStorage::newDoubleValueStorage; + break; + case OBSERVABLE_COUNTER: + case OBSERVABLE_UP_DOWN_COUNTER: + // observable counters use delta value since last reset + storageFactory = + descriptor.hasLongValues() + ? OtelMetricStorage::newLongDeltaStorage + : OtelMetricStorage::newDoubleDeltaStorage; + break; + default: + throw new IllegalStateException("Unexpected value: " + descriptor.getType()); + } + return OtelMetricRegistry.INSTANCE.registerStorage(JVM_SCOPE, descriptor, storageFactory); + } + + /** Returns Attributes carrying jvm.memory.type and jvm.memory.pool.name for the given pool. */ + private static Attributes poolAttributes(MemoryPoolMXBean pool) { + return Attributes.of( + MEMORY_TYPE, pool.getType().name().toLowerCase(Locale.ROOT), + MEMORY_POOL, pool.getName()); + } + + private JvmOtlpRuntimeMetrics() {} +} diff --git a/dd-java-agent/agent-jmxfetch/src/main/resources/jmxfetch-config-no-jvm-defaults.yaml b/dd-java-agent/agent-jmxfetch/src/main/resources/jmxfetch-config-no-jvm-defaults.yaml new file mode 100644 index 00000000000..9cb727267e7 --- /dev/null +++ b/dd-java-agent/agent-jmxfetch/src/main/resources/jmxfetch-config-no-jvm-defaults.yaml @@ -0,0 +1,9 @@ +init_config: + is_jmx: true + new_gc_metrics: true + +instances: + - jvm_direct: true + name: dd-java-agent default + collect_default_jvm_metrics: false + conf: [] # Intentionally left empty for now diff --git a/dd-java-agent/agent-llmobs/build.gradle b/dd-java-agent/agent-llmobs/build.gradle index faea293da33..55d3258fa0c 100644 --- a/dd-java-agent/agent-llmobs/build.gradle +++ b/dd-java-agent/agent-llmobs/build.gradle @@ -2,10 +2,10 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar plugins { id 'com.gradleup.shadow' + id 'dd-trace-java.version-file' } apply from: "$rootDir/gradle/java.gradle" -apply from: "$rootDir/gradle/version.gradle" minimumBranchCoverage = 0.0 minimumInstructionCoverage = 0.0 diff --git a/dd-java-agent/agent-llmobs/gradle.lockfile b/dd-java-agent/agent-llmobs/gradle.lockfile index ec1903e484b..0d2621a54d4 100644 --- a/dd-java-agent/agent-llmobs/gradle.lockfile +++ b/dd-java-agent/agent-llmobs/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-llmobs:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -70,12 +75,13 @@ org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.jctools:jctools-core-jdk11:4.0.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -93,15 +99,17 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt org.ow2.asm:asm-commons:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt org.ow2.asm:asm-tree:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.7.1=runtimeClasspath -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/agent-llmobs/src/main/java/datadog/trace/llmobs/domain/DDLLMObsSpan.java b/dd-java-agent/agent-llmobs/src/main/java/datadog/trace/llmobs/domain/DDLLMObsSpan.java index 6532829cfa6..ac304698652 100644 --- a/dd-java-agent/agent-llmobs/src/main/java/datadog/trace/llmobs/domain/DDLLMObsSpan.java +++ b/dd-java-agent/agent-llmobs/src/main/java/datadog/trace/llmobs/domain/DDLLMObsSpan.java @@ -89,11 +89,9 @@ public DDLLMObsSpan( span.setTag(SPAN_KIND, kind); spanKind = kind; span.setTag(LLMOBS_TAG_PREFIX + LLMObsTags.ML_APP, mlApp); - this.hasSessionId = sessionId != null && !sessionId.isEmpty(); - if (this.hasSessionId) { - span.setTag(LLMOBS_TAG_PREFIX + LLMObsTags.SESSION_ID, sessionId); - } - + // Resolve effective parent_id and session_id from the LLMObs context, both gated on + // trace-id consistency. A stale context from a different trace (e.g. async boundary + // leakage) must not contribute either tag. AgentSpanContext parent = LLMObsContext.current(); String parentSpanID = LLMObsContext.ROOT_SPAN_ID; if (null != parent) { @@ -106,19 +104,34 @@ public DDLLMObsSpan( span.getSpanId()); } else { parentSpanID = String.valueOf(parent.getSpanId()); + // Inherit session_id from parent context only when it belongs to the same trace. + // Matches dd-trace-py and dd-trace-js: session_id need only be set on the root + // span; descendants inherit transitively via context propagation. + if (sessionId == null || sessionId.isEmpty()) { + String inherited = LLMObsContext.currentSessionId(); + if (inherited != null && !inherited.isEmpty()) { + sessionId = inherited; + } + } } } + + this.hasSessionId = sessionId != null && !sessionId.isEmpty(); + if (this.hasSessionId) { + span.setTag(LLMOBS_TAG_PREFIX + LLMObsTags.SESSION_ID, sessionId); + } span.setTag(LLMOBS_TAG_PREFIX + PARENT_ID_TAG_INTERNAL, parentSpanID); - scope = LLMObsContext.attach(span.context()); + // Propagate the effective sessionId to descendant LLMObs spans via the context. + scope = LLMObsContext.attach(span.spanContext(), sessionId); } @Override public String toString() { return super.toString() + ", trace_id=" - + span.context().getTraceId() + + span.spanContext().getTraceId() + ", span_id=" - + span.context().getSpanId() + + span.spanContext().getSpanId() + ", ml_app=" + span.getTag(LLMObsTags.ML_APP) + ", service=" diff --git a/dd-java-agent/agent-llmobs/src/test/groovy/datadog/trace/llmobs/domain/DDLLMObsSpanTest.groovy b/dd-java-agent/agent-llmobs/src/test/groovy/datadog/trace/llmobs/domain/DDLLMObsSpanTest.groovy index 0deb4e99a19..34832914089 100644 --- a/dd-java-agent/agent-llmobs/src/test/groovy/datadog/trace/llmobs/domain/DDLLMObsSpanTest.groovy +++ b/dd-java-agent/agent-llmobs/src/test/groovy/datadog/trace/llmobs/domain/DDLLMObsSpanTest.groovy @@ -411,6 +411,96 @@ class DDLLMObsSpanTest extends DDSpecification{ null | "has_session_id:0" } + def "child LLMObs span inherits session_id from parent context when none is passed"() { + setup: + def expectedSessionId = "session-abc-123" + def parent = llmObsSpan(Tags.LLMOBS_WORKFLOW_SPAN_KIND, "parent-workflow", expectedSessionId) + // Activate the parent's AgentScope so the child span is created in the same trace. + // Without this, the child gets a fresh trace_id and the trace-consistency gate in + // DDLLMObsSpan would (correctly) skip session_id inheritance. + def parentScope = AgentTracer.activateSpan((AgentSpan) parent.span) + + when: + // Child created with null sessionId — should inherit from the parent's LLMObsContext. + def child = llmObsSpan(Tags.LLMOBS_LLM_SPAN_KIND, "child-llm", null) + + then: + def innerChild = (AgentSpan) child.span + expectedSessionId == innerChild.getTag(LLMOBS_TAG_PREFIX + LLMObsTags.SESSION_ID) + + cleanup: + child.finish() + parentScope.close() + parent.finish() + } + + def "child LLMObs span has no session_id when neither parent nor child passes one"() { + setup: + def parent = llmObsSpan(Tags.LLMOBS_WORKFLOW_SPAN_KIND, "parent-workflow", null) + + when: + def child = llmObsSpan(Tags.LLMOBS_LLM_SPAN_KIND, "child-llm", null) + + then: + def innerChild = (AgentSpan) child.span + null == innerChild.getTag(LLMOBS_TAG_PREFIX + LLMObsTags.SESSION_ID) + + cleanup: + child.finish() + parent.finish() + } + + def "grandchild LLMObs span transitively inherits session_id through intermediate span"() { + setup: + def expectedSessionId = "session-grandparent-xyz" + def grandparent = llmObsSpan(Tags.LLMOBS_WORKFLOW_SPAN_KIND, "grandparent-workflow", expectedSessionId) + // Activate each ancestor's AgentScope so descendants stay in the same trace — + // session_id inheritance is gated on trace-id consistency in DDLLMObsSpan. + def grandparentScope = AgentTracer.activateSpan((AgentSpan) grandparent.span) + def parent = llmObsSpan(Tags.LLMOBS_WORKFLOW_SPAN_KIND, "parent-workflow", null) + def parentScope = AgentTracer.activateSpan((AgentSpan) parent.span) + + when: + // Grandchild created with null sessionId — should inherit transitively + // through parent's re-attached LLMObsContext (which itself inherited from grandparent). + def grandchild = llmObsSpan(Tags.LLMOBS_LLM_SPAN_KIND, "grandchild-llm", null) + + then: + def innerGrandchild = (AgentSpan) grandchild.span + expectedSessionId == innerGrandchild.getTag(LLMOBS_TAG_PREFIX + LLMObsTags.SESSION_ID) + + cleanup: + grandchild.finish() + parentScope.close() + parent.finish() + grandparentScope.close() + grandparent.finish() + } + + def "child does NOT inherit session_id when stale LLMObsContext is from a different trace (e.g. async boundary leak)"() { + setup: + // Simulates a stale LLMObsContext (e.g. leaked across an async boundary). The parent's + // LLMObsContext is attached, but its AgentScope is deliberately NOT activated — so the + // next span we create starts a fresh trace and the trace-consistency gate must skip + // session_id inheritance. + def parent = llmObsSpan(Tags.LLMOBS_WORKFLOW_SPAN_KIND, "stale-workflow", "stale-session-id") + + when: + def child = llmObsSpan(Tags.LLMOBS_LLM_SPAN_KIND, "child-llm", null) + + then: + def innerParent = (AgentSpan) parent.span + def innerChild = (AgentSpan) child.span + // Sanity: traces differ — confirms the scenario is set up correctly. + innerParent.getTraceId() != innerChild.getTraceId() + // Session_id from the stale-trace context must NOT leak into the new span. + null == innerChild.getTag(LLMOBS_TAG_PREFIX + LLMObsTags.SESSION_ID) + + cleanup: + child.finish() + parent.finish() + } + def "global dd_tags are included in LLMObs span tags"() { setup: injectSysConfig("trace.global.tags", "team:backend,owner:ml-platform") diff --git a/dd-java-agent/agent-logging/gradle.lockfile b/dd-java-agent/agent-logging/gradle.lockfile index 10134996f5d..aaee1ae32c1 100644 --- a/dd-java-agent/agent-logging/gradle.lockfile +++ b/dd-java-agent/agent-logging/gradle.lockfile @@ -1,11 +1,12 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-logging:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -40,10 +41,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -57,10 +58,13 @@ org.mockito:mockito-core:4.4.0=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/agent-logging/src/main/java/datadog/trace/logging/PrintStreamWrapper.java b/dd-java-agent/agent-logging/src/main/java/datadog/trace/logging/PrintStreamWrapper.java index cd1e1b4a9c9..c71390a8e23 100644 --- a/dd-java-agent/agent-logging/src/main/java/datadog/trace/logging/PrintStreamWrapper.java +++ b/dd-java-agent/agent-logging/src/main/java/datadog/trace/logging/PrintStreamWrapper.java @@ -1,6 +1,7 @@ package datadog.trace.logging; import datadog.environment.OperatingSystem; +import datadog.trace.api.internal.VisibleForTesting; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.OutputStream; @@ -17,7 +18,7 @@ public PrintStreamWrapper(PrintStream ps) { super(ps); } - // use for tests only + @VisibleForTesting public OutputStream getOriginalPrintStream() { return super.out; } diff --git a/dd-java-agent/agent-logs-intake/build.gradle b/dd-java-agent/agent-logs-intake/build.gradle index 6d3fd48da68..20d4f3d3ee1 100644 --- a/dd-java-agent/agent-logs-intake/build.gradle +++ b/dd-java-agent/agent-logs-intake/build.gradle @@ -2,10 +2,10 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar plugins { id 'com.gradleup.shadow' + id 'dd-trace-java.version-file' } apply from: "$rootDir/gradle/java.gradle" -apply from: "$rootDir/gradle/version.gradle" excludedClassesCoverage += [ "datadog.trace.logging.intake.LogsWriterImpl", diff --git a/dd-java-agent/agent-logs-intake/gradle.lockfile b/dd-java-agent/agent-logs-intake/gradle.lockfile index 461132dab91..f4c7e63e59d 100644 --- a/dd-java-agent/agent-logs-intake/gradle.lockfile +++ b/dd-java-agent/agent-logs-intake/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-logs-intake:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -11,15 +12,15 @@ com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,tes com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -56,10 +57,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -74,14 +75,17 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt org.ow2.asm:asm-commons:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt org.ow2.asm:asm-tree:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt org.ow2.asm:asm:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/agent-otel/otel-bootstrap/gradle.lockfile b/dd-java-agent/agent-otel/otel-bootstrap/gradle.lockfile index fa68ebf003a..968f3407d0a 100644 --- a/dd-java-agent/agent-otel/otel-bootstrap/gradle.lockfile +++ b/dd-java-agent/agent-otel/otel-bootstrap/gradle.lockfile @@ -1,12 +1,13 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-otel:otel-bootstrap:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -33,10 +34,10 @@ io.opentelemetry:opentelemetry-sdk-trace:1.38.0=compileClasspath,embeddedClasspa io.opentelemetry:opentelemetry-sdk:1.38.0=compileClasspath,embeddedClasspath jaxen:jaxen:2.0.0=spotbugs net.bytebuddy:byte-buddy-agent:1.12.8=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin net.bytebuddy:byte-buddy-dep:1.14.15=compileClasspath,embeddedClasspath net.bytebuddy:byte-buddy:1.12.8=testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -59,10 +60,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -76,12 +77,15 @@ org.mockito:mockito-core:4.4.0=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt org.ow2.asm:asm-commons:9.6=compileClasspath,embeddedClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt org.ow2.asm:asm:9.6=compileClasspath,embeddedClasspath -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/OtelInstrumentType.java b/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/OtelInstrumentType.java index 9a072c95e57..d8b7ea9ac22 100644 --- a/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/OtelInstrumentType.java +++ b/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/OtelInstrumentType.java @@ -2,11 +2,21 @@ public enum OtelInstrumentType { // same order as io.opentelemetry.sdk.metrics.InstrumentType - COUNTER, - UP_DOWN_COUNTER, - HISTOGRAM, - OBSERVABLE_COUNTER, - OBSERVABLE_UP_DOWN_COUNTER, - OBSERVABLE_GAUGE, - GAUGE, + COUNTER(false), + UP_DOWN_COUNTER(false), + HISTOGRAM(false), + OBSERVABLE_COUNTER(true), + OBSERVABLE_UP_DOWN_COUNTER(true), + OBSERVABLE_GAUGE(true), + GAUGE(false); + + private final boolean observable; + + OtelInstrumentType(boolean observable) { + this.observable = observable; + } + + public boolean isObservable() { + return observable; + } } diff --git a/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelDoubleDelta.java b/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelDoubleDelta.java new file mode 100644 index 00000000000..9544fe44f04 --- /dev/null +++ b/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelDoubleDelta.java @@ -0,0 +1,25 @@ +package datadog.trace.bootstrap.otel.metrics.data; + +import datadog.trace.bootstrap.otlp.metrics.OtlpDataPoint; +import datadog.trace.bootstrap.otlp.metrics.OtlpDoublePoint; + +/** Reports the delta value since the last reset. */ +final class OtelDoubleDelta extends OtelAggregator { + private volatile double value; + private double lastValue; + + @Override + void doRecordDouble(double value) { + this.value = value; + } + + @Override + OtlpDataPoint doCollect(boolean reset) { + double collectedValue = value; + double delta = collectedValue - lastValue; + if (reset) { + lastValue = collectedValue; + } + return new OtlpDoublePoint(delta); + } +} diff --git a/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelDoubleSum.java b/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelDoubleSum.java index 602cdad0a87..7e5bd48bc6a 100644 --- a/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelDoubleSum.java +++ b/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelDoubleSum.java @@ -4,6 +4,7 @@ import datadog.trace.bootstrap.otlp.metrics.OtlpDoublePoint; import java.util.concurrent.atomic.DoubleAdder; +/** Reports the sum of values since the last reset. */ final class OtelDoubleSum extends OtelAggregator { private final DoubleAdder total = new DoubleAdder(); diff --git a/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelDoubleValue.java b/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelDoubleValue.java index 509516b62db..6e1269e73a5 100644 --- a/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelDoubleValue.java +++ b/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelDoubleValue.java @@ -3,6 +3,7 @@ import datadog.trace.bootstrap.otlp.metrics.OtlpDataPoint; import datadog.trace.bootstrap.otlp.metrics.OtlpDoublePoint; +/** Always reports the latest value. */ final class OtelDoubleValue extends OtelAggregator { private volatile double value; diff --git a/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelHistogramSketch.java b/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelHistogramSketch.java index b322d3f75e5..35092bc55a0 100644 --- a/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelHistogramSketch.java +++ b/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelHistogramSketch.java @@ -6,6 +6,7 @@ import datadog.trace.bootstrap.otlp.metrics.OtlpHistogramPoint; import java.util.List; +/** Reports the histogram of values since the last reset. */ final class OtelHistogramSketch extends OtelAggregator { private final HistogramWithSum histogram; diff --git a/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelLongDelta.java b/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelLongDelta.java new file mode 100644 index 00000000000..a644ee6085d --- /dev/null +++ b/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelLongDelta.java @@ -0,0 +1,25 @@ +package datadog.trace.bootstrap.otel.metrics.data; + +import datadog.trace.bootstrap.otlp.metrics.OtlpDataPoint; +import datadog.trace.bootstrap.otlp.metrics.OtlpLongPoint; + +/** Reports the delta value since the last reset. */ +final class OtelLongDelta extends OtelAggregator { + private volatile long value; + private long lastValue; + + @Override + void doRecordLong(long value) { + this.value = value; + } + + @Override + OtlpDataPoint doCollect(boolean reset) { + long collectedValue = value; + long delta = collectedValue - lastValue; + if (reset) { + lastValue = collectedValue; + } + return new OtlpLongPoint(delta); + } +} diff --git a/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelLongSum.java b/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelLongSum.java index d4693954ba4..773e107a613 100644 --- a/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelLongSum.java +++ b/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelLongSum.java @@ -4,6 +4,7 @@ import datadog.trace.bootstrap.otlp.metrics.OtlpLongPoint; import java.util.concurrent.atomic.LongAdder; +/** Reports the sum of values since the last reset. */ final class OtelLongSum extends OtelAggregator { private final LongAdder total = new LongAdder(); diff --git a/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelLongValue.java b/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelLongValue.java index 790ce640364..5f6967fca84 100644 --- a/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelLongValue.java +++ b/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelLongValue.java @@ -3,6 +3,7 @@ import datadog.trace.bootstrap.otlp.metrics.OtlpDataPoint; import datadog.trace.bootstrap.otlp.metrics.OtlpLongPoint; +/** Always reports the latest value. */ final class OtelLongValue extends OtelAggregator { private volatile long value; diff --git a/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelMetricStorage.java b/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelMetricStorage.java index 8863b21bd1b..15e953016bf 100644 --- a/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelMetricStorage.java +++ b/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelMetricStorage.java @@ -11,6 +11,7 @@ import datadog.trace.bootstrap.otel.metrics.OtelInstrumentDescriptor; import datadog.trace.bootstrap.otel.metrics.OtelInstrumentType; import datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor; +import datadog.trace.bootstrap.otlp.metrics.OtlpDataPoint; import datadog.trace.bootstrap.otlp.metrics.OtlpMetricVisitor; import io.opentelemetry.api.common.Attributes; import java.util.Collections; @@ -46,6 +47,7 @@ public final class OtelMetricStorage { private final OtelInstrumentDescriptor descriptor; private final boolean resetOnCollect; + private final boolean toggleRecordings; private final Function aggregatorSupplier; private volatile Recording currentRecording; @@ -56,9 +58,12 @@ private OtelMetricStorage( OtelInstrumentDescriptor descriptor, Supplier aggregatorSupplier) { this.descriptor = descriptor; this.resetOnCollect = shouldResetOnCollect(descriptor.getType()); + // no need to toggle if not resetting on collect, or if it's an observable instrument + // (observables are always invoked within the collect cycle, so no concurrent writers) + this.toggleRecordings = resetOnCollect && !descriptor.getType().isObservable(); this.aggregatorSupplier = unused -> aggregatorSupplier.get(); this.currentRecording = new Recording(); - if (resetOnCollect) { + if (toggleRecordings) { this.previousRecording = new Recording(); } } @@ -86,6 +91,10 @@ public static OtelMetricStorage newDoubleValueStorage(OtelInstrumentDescriptor d return new OtelMetricStorage(descriptor, OtelDoubleValue::new); } + public static OtelMetricStorage newDoubleDeltaStorage(OtelInstrumentDescriptor descriptor) { + return new OtelMetricStorage(descriptor, OtelDoubleDelta::new); + } + public static OtelMetricStorage newLongSumStorage(OtelInstrumentDescriptor descriptor) { return new OtelMetricStorage(descriptor, OtelLongSum::new); } @@ -94,6 +103,10 @@ public static OtelMetricStorage newLongValueStorage(OtelInstrumentDescriptor des return new OtelMetricStorage(descriptor, OtelLongValue::new); } + public static OtelMetricStorage newLongDeltaStorage(OtelInstrumentDescriptor descriptor) { + return new OtelMetricStorage(descriptor, OtelLongDelta::new); + } + public static OtelMetricStorage newHistogramStorage( OtelInstrumentDescriptor descriptor, List bucketBoundaries) { return new OtelMetricStorage(descriptor, () -> new OtelHistogramSketch(bucketBoundaries)); @@ -108,7 +121,7 @@ public OtelInstrumentDescriptor getDescriptor() { } public void recordLong(long value, Object attributes) { - if (resetOnCollect) { + if (toggleRecordings) { Recording recording = acquireRecordingForWrite(); try { aggregator(recording.aggregators, attributes).recordLong(value); @@ -129,7 +142,7 @@ public void recordDouble(double value, Object attributes) { attributes); return; } - if (resetOnCollect) { + if (toggleRecordings) { Recording recording = acquireRecordingForWrite(); try { aggregator(recording.aggregators, attributes).recordDouble(value); @@ -173,26 +186,8 @@ public static void registerAttributeReader( /** Collect data for CUMULATIVE temporality, keeping aggregators for future writes. */ private void doCollect(OtlpMetricVisitor visitor) { - BiConsumer attributesReader = null; - ClassLoader attributesClassLoader = null; - // no need to hold writers back if we are not resetting metrics on collect - for (Map.Entry entry : currentRecording.aggregators.entrySet()) { - OtelAggregator aggregator = entry.getValue(); - if (!aggregator.isEmpty()) { - Object attributes = entry.getKey(); - ClassLoader cl = attributes.getClass().getClassLoader(); - // avoid repeated lookups when attribute class-loader is same for all records - if (attributesReader == null || cl != attributesClassLoader) { - attributesReader = ATTRIBUTE_READERS.get(cl); - attributesClassLoader = cl; - } - if (attributesReader != null) { - attributesReader.accept(attributes, visitor); - } - visitor.visitDataPoint(aggregator.collect()); - } - } + collectDataPoints(currentRecording.aggregators, visitor, OtelAggregator::collect); } /** @@ -205,13 +200,15 @@ private void doCollectAndReset(OtlpMetricVisitor visitor) { // capture _current_ recording for collection, its aggregators will be reset at the end final Recording recording = currentRecording; - // publish fresh recording for new writers, using aggregators from _previous_ recording - currentRecording = new Recording(previousRecording); + if (toggleRecordings) { + // publish fresh recording for new writers, using aggregators from _previous_ recording + currentRecording = new Recording(previousRecording); - // notify writers that the captured recording is about to be reset - ACTIVITY.addAndGet(recording, RESET_PENDING); - while (recording.activity > 1) { - Thread.yield(); // other threads are still writing to this recording + // notify writers that the captured recording is about to be reset + ACTIVITY.addAndGet(recording, RESET_PENDING); + while (recording.activity > 1) { + Thread.yield(); // other threads are still writing to this recording + } } Map aggregators = recording.aggregators; @@ -221,6 +218,17 @@ private void doCollectAndReset(OtlpMetricVisitor visitor) { aggregators.values().removeIf(OtelAggregator::isEmpty); } + collectDataPoints(aggregators, visitor, OtelAggregator::collectAndReset); + + if (toggleRecordings) { + previousRecording = recording; + } + } + + private void collectDataPoints( + Map aggregators, + OtlpMetricVisitor visitor, + Function collect) { BiConsumer attributesReader = null; ClassLoader attributesClassLoader = null; @@ -237,11 +245,9 @@ private void doCollectAndReset(OtlpMetricVisitor visitor) { if (attributesReader != null) { attributesReader.accept(attributes, visitor); } - visitor.visitDataPoint(aggregator.collectAndReset()); + visitor.visitDataPoint(collect.apply(aggregator)); } } - - previousRecording = recording; } private Recording acquireRecordingForWrite() { diff --git a/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelRunnableObservable.java b/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelRunnableObservable.java new file mode 100644 index 00000000000..975d59f8826 --- /dev/null +++ b/dd-java-agent/agent-otel/otel-bootstrap/src/main/java/datadog/trace/bootstrap/otel/metrics/data/OtelRunnableObservable.java @@ -0,0 +1,28 @@ +package datadog.trace.bootstrap.otel.metrics.data; + +import datadog.logging.RatelimitedLogger; +import java.util.concurrent.TimeUnit; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** {@link OtelObservable} backed by a {@link Runnable}, for call sites that prefer a lambda. */ +public final class OtelRunnableObservable extends OtelObservable { + private static final Logger LOGGER = LoggerFactory.getLogger(OtelRunnableObservable.class); + private static final RatelimitedLogger RATELIMITED_LOGGER = + new RatelimitedLogger(LOGGER, 5, TimeUnit.MINUTES); + + private final Runnable callback; + + public OtelRunnableObservable(Runnable callback) { + this.callback = callback; + } + + @Override + protected void observeMeasurements() { + try { + callback.run(); + } catch (Throwable e) { + RATELIMITED_LOGGER.warn("An exception occurred invoking observable callback.", e); + } + } +} diff --git a/dd-java-agent/agent-otel/otel-shim/gradle.lockfile b/dd-java-agent/agent-otel/otel-shim/gradle.lockfile index 044c7c14d0a..7e7e956a60b 100644 --- a/dd-java-agent/agent-otel/otel-shim/gradle.lockfile +++ b/dd-java-agent/agent-otel/otel-shim/gradle.lockfile @@ -1,11 +1,12 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-otel:otel-shim:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -42,10 +43,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -59,10 +60,13 @@ org.mockito:mockito-core:4.4.0=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/logs/OtelLogRecordBuilder.java b/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/logs/OtelLogRecordBuilder.java index 93554fdc8c5..81cfb7c875e 100644 --- a/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/logs/OtelLogRecordBuilder.java +++ b/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/logs/OtelLogRecordBuilder.java @@ -3,6 +3,7 @@ import static datadog.opentelemetry.shim.trace.OtelExtractedContext.extract; import static io.opentelemetry.api.common.AttributeKey.stringKey; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.api.time.SystemTimeSource; import datadog.trace.api.time.TimeSource; import datadog.trace.bootstrap.otel.logs.data.OtelLogRecordProcessor; @@ -23,8 +24,7 @@ @ParametersAreNonnullByDefault final class OtelLogRecordBuilder implements LogRecordBuilder { - // package-visible for testing - static TimeSource TIME_SOURCE = SystemTimeSource.INSTANCE; + @VisibleForTesting static TimeSource TIME_SOURCE = SystemTimeSource.INSTANCE; private static final AttributeKey EXCEPTION_TYPE_KEY = stringKey("exception.type"); private static final AttributeKey EXCEPTION_MESSAGE_KEY = stringKey("exception.message"); diff --git a/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/metrics/OtelDoubleCounter.java b/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/metrics/OtelDoubleCounter.java index d2ab4dedbc2..1395dbbe8ad 100644 --- a/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/metrics/OtelDoubleCounter.java +++ b/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/metrics/OtelDoubleCounter.java @@ -79,7 +79,7 @@ public DoubleCounter build() { @Override public ObservableDoubleMeasurement buildObserver() { - return meter.registerObservableStorage(builder, OtelMetricStorage::newDoubleSumStorage); + return meter.registerObservableStorage(builder, OtelMetricStorage::newDoubleDeltaStorage); } @Override diff --git a/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/metrics/OtelDoubleUpDownCounter.java b/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/metrics/OtelDoubleUpDownCounter.java index 4a25c3f095a..f66a09d2d69 100644 --- a/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/metrics/OtelDoubleUpDownCounter.java +++ b/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/metrics/OtelDoubleUpDownCounter.java @@ -65,7 +65,7 @@ public DoubleUpDownCounter build() { @Override public ObservableDoubleMeasurement buildObserver() { - return meter.registerObservableStorage(builder, OtelMetricStorage::newDoubleSumStorage); + return meter.registerObservableStorage(builder, OtelMetricStorage::newDoubleDeltaStorage); } @Override diff --git a/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/metrics/OtelLongCounter.java b/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/metrics/OtelLongCounter.java index 949c10733c4..76507eed9d8 100644 --- a/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/metrics/OtelLongCounter.java +++ b/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/metrics/OtelLongCounter.java @@ -85,7 +85,7 @@ public LongCounter build() { @Override public ObservableLongMeasurement buildObserver() { - return meter.registerObservableStorage(builder, OtelMetricStorage::newLongSumStorage); + return meter.registerObservableStorage(builder, OtelMetricStorage::newLongDeltaStorage); } @Override diff --git a/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/metrics/OtelLongUpDownCounter.java b/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/metrics/OtelLongUpDownCounter.java index 209b9e7265d..2bd9833a6bd 100644 --- a/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/metrics/OtelLongUpDownCounter.java +++ b/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/metrics/OtelLongUpDownCounter.java @@ -71,7 +71,7 @@ public LongUpDownCounter build() { @Override public ObservableLongMeasurement buildObserver() { - return meter.registerObservableStorage(builder, OtelMetricStorage::newLongSumStorage); + return meter.registerObservableStorage(builder, OtelMetricStorage::newLongDeltaStorage); } @Override diff --git a/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/trace/OtelSpan.java b/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/trace/OtelSpan.java index ffe6cce4ea6..34bf7f2a486 100644 --- a/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/trace/OtelSpan.java +++ b/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/trace/OtelSpan.java @@ -47,7 +47,7 @@ public OtelSpan(AgentSpan delegate) { } this.statusCode = UNSET; this.recording = true; - delegate.context().setIntegrationName("otel"); + delegate.spanContext().setIntegrationName("otel"); } public static Span invalid() { @@ -168,7 +168,7 @@ public AgentScope activate() { } public AgentSpanContext getAgentSpanContext() { - return this.delegate.context(); + return this.delegate.spanContext(); } @Override diff --git a/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/trace/OtelSpanContext.java b/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/trace/OtelSpanContext.java index 759e3ac4910..8a39a88b1dd 100644 --- a/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/trace/OtelSpanContext.java +++ b/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/trace/OtelSpanContext.java @@ -24,7 +24,7 @@ public OtelSpanContext( } public static SpanContext fromLocalSpan(AgentSpan span) { - AgentSpanContext delegate = span.context(); + AgentSpanContext delegate = span.spanContext(); AgentSpan localRootSpan = span.getLocalRootSpan(); Integer samplingPriority = localRootSpan.getSamplingPriority(); boolean sampled = samplingPriority != null && samplingPriority > 0; diff --git a/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/trace/OtelSpanEvent.java b/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/trace/OtelSpanEvent.java index 6bd1802aebb..a49cab4b877 100644 --- a/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/trace/OtelSpanEvent.java +++ b/dd-java-agent/agent-otel/otel-shim/src/main/java/datadog/opentelemetry/shim/trace/OtelSpanEvent.java @@ -2,7 +2,6 @@ import datadog.trace.api.time.SystemTimeSource; import datadog.trace.api.time.TimeSource; -import edu.umd.cs.findbugs.annotations.NonNull; import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; @@ -12,6 +11,7 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.TimeUnit; +import javax.annotation.Nonnull; public class OtelSpanEvent { public static final String EXCEPTION_SPAN_EVENT_NAME = "exception"; @@ -43,7 +43,7 @@ public OtelSpanEvent(String name, Attributes attributes, long timestamp, TimeUni this.timestamp = unit.toNanos(timestamp); } - @NonNull + @Nonnull public static String toTag(List events) { StringBuilder builder = new StringBuilder("["); for (OtelSpanEvent event : events) { diff --git a/dd-java-agent/agent-otel/otel-tooling/gradle.lockfile b/dd-java-agent/agent-otel/otel-tooling/gradle.lockfile index 45be92c086f..64bd1184f5f 100644 --- a/dd-java-agent/agent-otel/otel-tooling/gradle.lockfile +++ b/dd-java-agent/agent-otel/otel-tooling/gradle.lockfile @@ -1,13 +1,14 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-otel:otel-tooling:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -18,8 +19,8 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -42,10 +43,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -59,11 +60,13 @@ org.mockito:mockito-core:4.4.0=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath +org.ow2.asm:asm:9.10.1=compileClasspath,jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/agent-profiling/gradle.lockfile b/dd-java-agent/agent-profiling/gradle.lockfile index 4ac7b77ffb3..9dbabd78ca8 100644 --- a/dd-java-agent/agent-profiling/gradle.lockfile +++ b/dd-java-agent/agent-profiling/gradle.lockfile @@ -1,26 +1,28 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-profiling:dependencies --write-locks +at.yawk.lz4:lz4-java:1.11.0=runtimeClasspath,testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=runtimeClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=runtimeClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -35,8 +37,8 @@ io.airlift:aircompressor:2.0.3=runtimeClasspath,testRuntimeClasspath io.btrace:jafar-tools:0.16.0=runtimeClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -59,10 +61,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=runtimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -74,21 +76,23 @@ org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntime org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath -org.lz4:lz4-java:1.7.1=runtimeClasspath,testRuntimeClasspath org.mockito:mockito-core:4.4.0=testCompileClasspath,testRuntimeClasspath org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt org.ow2.asm:asm-commons:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt org.ow2.asm:asm-tree:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt org.ow2.asm:asm:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/agent-profiling/profiling-controller-ddprof/gradle.lockfile b/dd-java-agent/agent-profiling/profiling-controller-ddprof/gradle.lockfile index 642d2b47786..a4929dd27f4 100644 --- a/dd-java-agent/agent-profiling/profiling-controller-ddprof/gradle.lockfile +++ b/dd-java-agent/agent-profiling/profiling-controller-ddprof/gradle.lockfile @@ -1,26 +1,28 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-profiling:profiling-controller-ddprof:dependencies --write-locks +at.yawk.lz4:lz4-java:1.11.0=testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -35,8 +37,8 @@ io.airlift:aircompressor:2.0.3=testRuntimeClasspath io.btrace:jafar-tools:0.16.0=testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -59,10 +61,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -74,21 +76,23 @@ org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntime org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath -org.lz4:lz4-java:1.7.1=testRuntimeClasspath org.mockito:mockito-core:4.4.0=testCompileClasspath,testRuntimeClasspath org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt org.ow2.asm:asm-commons:9.7.1=testRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt org.ow2.asm:asm:9.7.1=testRuntimeClasspath -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/agent-profiling/profiling-controller-ddprof/src/main/java/com/datadog/profiling/controller/ddprof/DatadogProfilerOngoingRecording.java b/dd-java-agent/agent-profiling/profiling-controller-ddprof/src/main/java/com/datadog/profiling/controller/ddprof/DatadogProfilerOngoingRecording.java index 7976f7f81a9..26ffc13e972 100644 --- a/dd-java-agent/agent-profiling/profiling-controller-ddprof/src/main/java/com/datadog/profiling/controller/ddprof/DatadogProfilerOngoingRecording.java +++ b/dd-java-agent/agent-profiling/profiling-controller-ddprof/src/main/java/com/datadog/profiling/controller/ddprof/DatadogProfilerOngoingRecording.java @@ -20,6 +20,7 @@ import com.datadog.profiling.controller.UnsupportedEnvironmentException; import com.datadog.profiling.ddprof.DatadogProfiler; import datadog.environment.JavaVirtualMachine; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.api.profiling.ProfilingSnapshot; import datadog.trace.api.profiling.RecordingData; import java.time.Instant; @@ -52,7 +53,7 @@ public RecordingData stop() { return recording.stop(); } - // @VisibleForTesting + @VisibleForTesting final RecordingData snapshot(final Instant start) { return snapshot(start, ProfilingSnapshot.Kind.PERIODIC); } diff --git a/dd-java-agent/agent-profiling/profiling-controller-jfr/build.gradle b/dd-java-agent/agent-profiling/profiling-controller-jfr/build.gradle index 132d7eb3aa4..de211639c87 100644 --- a/dd-java-agent/agent-profiling/profiling-controller-jfr/build.gradle +++ b/dd-java-agent/agent-profiling/profiling-controller-jfr/build.gradle @@ -1,3 +1,7 @@ +plugins { + id 'java-test-fixtures' +} + apply from: "$rootDir/gradle/java.gradle" apply plugin: 'idea' diff --git a/dd-java-agent/agent-profiling/profiling-controller-jfr/gradle.lockfile b/dd-java-agent/agent-profiling/profiling-controller-jfr/gradle.lockfile index 8db69e946db..f26709398b1 100644 --- a/dd-java-agent/agent-profiling/profiling-controller-jfr/gradle.lockfile +++ b/dd-java-agent/agent-profiling/profiling-controller-jfr/gradle.lockfile @@ -1,11 +1,12 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-profiling:profiling-controller-jfr:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath @@ -24,8 +25,8 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -49,12 +50,12 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt -org.jctools:jctools-core-jdk11:4.0.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jctools:jctools-core:4.0.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt +org.jctools:jctools-core-jdk11:4.0.6=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.jctools:jctools-core:4.0.6=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -72,22 +73,25 @@ org.openjdk.jmc:common:8.1.0=testCompileClasspath,testRuntimeClasspath org.openjdk.jmc:flightrecorder.writer:8.1.0=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.owasp.encoder:encoder:1.2.3=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.30=compileClasspath,runtimeClasspath +org.slf4j:slf4j-api:1.7.30=compileClasspath,runtimeClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j -org.snakeyaml:snakeyaml-engine:2.9=runtimeClasspath,testRuntimeClasspath +org.snakeyaml:snakeyaml-engine:2.9=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -empty=spotbugsPlugins,testAnnotationProcessor +empty=spotbugsPlugins,testAnnotationProcessor,testFixturesAnnotationProcessor diff --git a/dd-java-agent/agent-profiling/profiling-controller-jfr/implementation/gradle.lockfile b/dd-java-agent/agent-profiling/profiling-controller-jfr/implementation/gradle.lockfile index c9a35389d37..797cff0d4d5 100644 --- a/dd-java-agent/agent-profiling/profiling-controller-jfr/implementation/gradle.lockfile +++ b/dd-java-agent/agent-profiling/profiling-controller-jfr/implementation/gradle.lockfile @@ -1,11 +1,12 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-profiling:profiling-controller-jfr:implementation:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,main_java11CompileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -16,8 +17,8 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -40,10 +41,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=runtimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -60,10 +61,13 @@ org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspat org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/agent-profiling/profiling-controller-jfr/src/test/java/com/datadog/profiling/controller/jfr/JfpUtilsTest.java b/dd-java-agent/agent-profiling/profiling-controller-jfr/src/test/java/com/datadog/profiling/controller/jfr/JfpUtilsTest.java index 00655fd9545..9e4e7c4e5b9 100644 --- a/dd-java-agent/agent-profiling/profiling-controller-jfr/src/test/java/com/datadog/profiling/controller/jfr/JfpUtilsTest.java +++ b/dd-java-agent/agent-profiling/profiling-controller-jfr/src/test/java/com/datadog/profiling/controller/jfr/JfpUtilsTest.java @@ -16,15 +16,6 @@ public class JfpUtilsTest { private static final String CONFIG_ENTRY = "jdk.ThreadAllocationStatistics#enabled"; private static final String CONFIG_OVERRIDE_ENTRY = "test.continuous.override#value"; - public static final String OVERRIDES = - JfpUtilsTest.class.getClassLoader().getResource("overrides.jfp").getFile(); - public static final String OVERRIDES_OLD_OBJECT_SAMPLE = - JfpUtilsTest.class.getClassLoader().getResource("overrides-oldobjectsample.jfp").getFile(); - public static final String OVERRIDES_OBJECT_ALLOCATION = - JfpUtilsTest.class.getClassLoader().getResource("overrides-objectallocation.jfp").getFile(); - public static final String OVERRIDES_NATIVE_METHOD_SAMPLE = - JfpUtilsTest.class.getClassLoader().getResource("overrides-nativemethodsample.jfp").getFile(); - @Test public void testLoadingInvalidOverride() throws IOException { final String INVALID_OVERRIDE = "really_non_existent_file.jfp"; @@ -42,7 +33,8 @@ public void testLoadingContinuousConfig() throws IOException { @Test public void testLoadingContinuousConfigWithOverride() throws IOException { - final Map config = JfpUtils.readJfpResources(JfpUtils.DEFAULT_JFP, OVERRIDES); + final Map config = + JfpUtils.readJfpResources(JfpUtils.DEFAULT_JFP, JfpTestResources.overrides()); assertEquals("true", config.get(CONFIG_ENTRY)); assertEquals("200", config.get(CONFIG_OVERRIDE_ENTRY)); } diff --git a/dd-java-agent/agent-profiling/profiling-controller-jfr/src/testFixtures/java/com/datadog/profiling/controller/jfr/JfpTestResources.java b/dd-java-agent/agent-profiling/profiling-controller-jfr/src/testFixtures/java/com/datadog/profiling/controller/jfr/JfpTestResources.java new file mode 100644 index 00000000000..88cd0b6bca7 --- /dev/null +++ b/dd-java-agent/agent-profiling/profiling-controller-jfr/src/testFixtures/java/com/datadog/profiling/controller/jfr/JfpTestResources.java @@ -0,0 +1,62 @@ +package com.datadog.profiling.controller.jfr; + +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardCopyOption; +import java.util.concurrent.atomic.AtomicReference; + +public final class JfpTestResources { + private static final AtomicReference overrides = new AtomicReference<>(); + private static final AtomicReference overridesOldObjectSample = new AtomicReference<>(); + private static final AtomicReference overridesObjectAllocation = new AtomicReference<>(); + private static final AtomicReference overridesNativeMethodSample = + new AtomicReference<>(); + + private JfpTestResources() {} + + public static String overrides() { + return get(overrides, "overrides.jfp"); + } + + public static String overridesOldObjectSample() { + return get(overridesOldObjectSample, "overrides-oldobjectsample.jfp"); + } + + public static String overridesObjectAllocation() { + return get(overridesObjectAllocation, "overrides-objectallocation.jfp"); + } + + public static String overridesNativeMethodSample() { + return get(overridesNativeMethodSample, "overrides-nativemethodsample.jfp"); + } + + private static String get(AtomicReference ref, String resourceName) { + String v = ref.get(); + if (v != null) { + return v; + } + String computed = extract(resourceName); + return ref.compareAndSet(null, computed) ? computed : ref.get(); + } + + // Resources packaged in the testFixtures jar are not directly accessible as filesystem paths. + // Extract to a temp file so callers can use the path with java.io.File. + private static String extract(String resourceName) { + try { + Path temp = Files.createTempFile(resourceName.replace('.', '_'), ".jfp"); + temp.toFile().deleteOnExit(); + try (InputStream is = + JfpTestResources.class.getClassLoader().getResourceAsStream(resourceName)) { + if (is == null) { + throw new IllegalStateException("Test resource not found on classpath: " + resourceName); + } + Files.copy(is, temp, StandardCopyOption.REPLACE_EXISTING); + } + return temp.toAbsolutePath().toString(); + } catch (IOException e) { + throw new RuntimeException("Failed to extract test resource: " + resourceName, e); + } + } +} diff --git a/dd-java-agent/agent-profiling/profiling-controller-jfr/src/test/resources/overrides-nativemethodsample.jfp b/dd-java-agent/agent-profiling/profiling-controller-jfr/src/testFixtures/resources/overrides-nativemethodsample.jfp similarity index 100% rename from dd-java-agent/agent-profiling/profiling-controller-jfr/src/test/resources/overrides-nativemethodsample.jfp rename to dd-java-agent/agent-profiling/profiling-controller-jfr/src/testFixtures/resources/overrides-nativemethodsample.jfp diff --git a/dd-java-agent/agent-profiling/profiling-controller-jfr/src/test/resources/overrides-objectallocation.jfp b/dd-java-agent/agent-profiling/profiling-controller-jfr/src/testFixtures/resources/overrides-objectallocation.jfp similarity index 100% rename from dd-java-agent/agent-profiling/profiling-controller-jfr/src/test/resources/overrides-objectallocation.jfp rename to dd-java-agent/agent-profiling/profiling-controller-jfr/src/testFixtures/resources/overrides-objectallocation.jfp diff --git a/dd-java-agent/agent-profiling/profiling-controller-jfr/src/test/resources/overrides-oldobjectsample.jfp b/dd-java-agent/agent-profiling/profiling-controller-jfr/src/testFixtures/resources/overrides-oldobjectsample.jfp similarity index 100% rename from dd-java-agent/agent-profiling/profiling-controller-jfr/src/test/resources/overrides-oldobjectsample.jfp rename to dd-java-agent/agent-profiling/profiling-controller-jfr/src/testFixtures/resources/overrides-oldobjectsample.jfp diff --git a/dd-java-agent/agent-profiling/profiling-controller-jfr/src/test/resources/overrides.jfp b/dd-java-agent/agent-profiling/profiling-controller-jfr/src/testFixtures/resources/overrides.jfp similarity index 100% rename from dd-java-agent/agent-profiling/profiling-controller-jfr/src/test/resources/overrides.jfp rename to dd-java-agent/agent-profiling/profiling-controller-jfr/src/testFixtures/resources/overrides.jfp diff --git a/dd-java-agent/agent-profiling/profiling-controller-openjdk/build.gradle b/dd-java-agent/agent-profiling/profiling-controller-openjdk/build.gradle index 5de63a998cb..ebe645ce175 100644 --- a/dd-java-agent/agent-profiling/profiling-controller-openjdk/build.gradle +++ b/dd-java-agent/agent-profiling/profiling-controller-openjdk/build.gradle @@ -28,7 +28,7 @@ dependencies { testImplementation libs.bundles.junit5 testImplementation libs.bundles.mockito - testImplementation files(project(':dd-java-agent:agent-profiling:profiling-controller-jfr').sourceSets.test.output) + testImplementation(testFixtures(project(':dd-java-agent:agent-profiling:profiling-controller-jfr'))) testImplementation project(':dd-java-agent:agent-profiling') } diff --git a/dd-java-agent/agent-profiling/profiling-controller-openjdk/gradle.lockfile b/dd-java-agent/agent-profiling/profiling-controller-openjdk/gradle.lockfile index 036e69731db..eef72957a96 100644 --- a/dd-java-agent/agent-profiling/profiling-controller-openjdk/gradle.lockfile +++ b/dd-java-agent/agent-profiling/profiling-controller-openjdk/gradle.lockfile @@ -1,26 +1,28 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-profiling:profiling-controller-openjdk:dependencies --write-locks +at.yawk.lz4:lz4-java:1.11.0=testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -35,8 +37,8 @@ io.airlift:aircompressor:2.0.3=testRuntimeClasspath io.btrace:jafar-tools:0.16.0=testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -59,10 +61,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=runtimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -74,21 +76,23 @@ org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntime org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath -org.lz4:lz4-java:1.7.1=testRuntimeClasspath org.mockito:mockito-core:4.4.0=testCompileClasspath,testRuntimeClasspath org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt org.ow2.asm:asm-commons:9.7.1=testRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt org.ow2.asm:asm:9.7.1=testRuntimeClasspath -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/agent-profiling/profiling-controller-openjdk/src/main/java/com/datadog/profiling/controller/openjdk/OpenJdkOngoingRecording.java b/dd-java-agent/agent-profiling/profiling-controller-openjdk/src/main/java/com/datadog/profiling/controller/openjdk/OpenJdkOngoingRecording.java index ddac86e663f..4b9d71e3a26 100644 --- a/dd-java-agent/agent-profiling/profiling-controller-openjdk/src/main/java/com/datadog/profiling/controller/openjdk/OpenJdkOngoingRecording.java +++ b/dd-java-agent/agent-profiling/profiling-controller-openjdk/src/main/java/com/datadog/profiling/controller/openjdk/OpenJdkOngoingRecording.java @@ -3,6 +3,7 @@ import com.datadog.profiling.controller.ControllerContext; import com.datadog.profiling.controller.OngoingRecording; import com.datadog.profiling.utils.ProfilingMode; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.api.profiling.ProfilingSnapshot; import datadog.trace.api.profiling.RecordingData; import datadog.trace.bootstrap.config.provider.ConfigProvider; @@ -135,7 +136,7 @@ public RecordingData stop() { return new OpenJdkRecordingData(recording, ProfilingSnapshot.Kind.PERIODIC); } - // @VisibleForTesting + @VisibleForTesting final RecordingData snapshot(@Nonnull final Instant start) { return snapshot(start, ProfilingSnapshot.Kind.PERIODIC); } diff --git a/dd-java-agent/agent-profiling/profiling-controller-openjdk/src/main/java/com/datadog/profiling/controller/openjdk/OpenJdkRecordingData.java b/dd-java-agent/agent-profiling/profiling-controller-openjdk/src/main/java/com/datadog/profiling/controller/openjdk/OpenJdkRecordingData.java index 6cedf96691b..da022c226ed 100644 --- a/dd-java-agent/agent-profiling/profiling-controller-openjdk/src/main/java/com/datadog/profiling/controller/openjdk/OpenJdkRecordingData.java +++ b/dd-java-agent/agent-profiling/profiling-controller-openjdk/src/main/java/com/datadog/profiling/controller/openjdk/OpenJdkRecordingData.java @@ -15,6 +15,7 @@ */ package com.datadog.profiling.controller.openjdk; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.api.profiling.RecordingData; import datadog.trace.api.profiling.RecordingInputStream; import java.io.IOException; @@ -54,7 +55,7 @@ public String getName() { return recording.getName(); } - // Visible for testing + @VisibleForTesting Recording getRecording() { return recording; } diff --git a/dd-java-agent/agent-profiling/profiling-controller-openjdk/src/main/java/com/datadog/profiling/controller/openjdk/events/SmapEntryCache.java b/dd-java-agent/agent-profiling/profiling-controller-openjdk/src/main/java/com/datadog/profiling/controller/openjdk/events/SmapEntryCache.java index 4b03fff0396..b890904a461 100644 --- a/dd-java-agent/agent-profiling/profiling-controller-openjdk/src/main/java/com/datadog/profiling/controller/openjdk/events/SmapEntryCache.java +++ b/dd-java-agent/agent-profiling/profiling-controller-openjdk/src/main/java/com/datadog/profiling/controller/openjdk/events/SmapEntryCache.java @@ -1,6 +1,7 @@ package com.datadog.profiling.controller.openjdk.events; import datadog.environment.JavaVirtualMachine; +import datadog.trace.api.internal.VisibleForTesting; import de.thetaphi.forbiddenapis.SuppressForbidden; import java.io.BufferedReader; import java.io.IOException; @@ -60,7 +61,7 @@ static class AnnotatedRegion { this.smapsPath = smapsPath; } - // @VisibleForTesting + @VisibleForTesting void invalidate() { UPDATER.getAndSet(this, System.nanoTime() - (2 * ttl)); } @@ -81,7 +82,7 @@ public List getEvents() { return (List) events[index]; } - // accessible for testing + @VisibleForTesting static AnnotatedRegion fromAnnotatedEntry(String line, int javaVersion) { boolean isRegion = line.startsWith("0x"); if (isRegion) { @@ -149,7 +150,7 @@ private static boolean isSmapHeader(String line) { return ((firstChar >= '0' && firstChar <= '9') || (firstChar >= 'a' && firstChar <= 'f')); } - // accessible for testing + @VisibleForTesting static void readEvents(BufferedReader br, List events) throws IOException { String line = br.readLine(); while (line != null) { diff --git a/dd-java-agent/agent-profiling/profiling-controller-openjdk/src/test/java/com/datadog/profiling/controller/openjdk/OpenJdkControllerTest.java b/dd-java-agent/agent-profiling/profiling-controller-openjdk/src/test/java/com/datadog/profiling/controller/openjdk/OpenJdkControllerTest.java index ef853d07b9a..eee7a2f9638 100644 --- a/dd-java-agent/agent-profiling/profiling-controller-openjdk/src/test/java/com/datadog/profiling/controller/openjdk/OpenJdkControllerTest.java +++ b/dd-java-agent/agent-profiling/profiling-controller-openjdk/src/test/java/com/datadog/profiling/controller/openjdk/OpenJdkControllerTest.java @@ -15,7 +15,7 @@ import static org.junit.jupiter.api.Assumptions.assumeFalse; import com.datadog.profiling.controller.ControllerContext; -import com.datadog.profiling.controller.jfr.JfpUtilsTest; +import com.datadog.profiling.controller.jfr.JfpTestResources; import com.datadog.profiling.utils.ProfilingMode; import datadog.environment.JavaVirtualMachine; import datadog.trace.api.profiling.RecordingData; @@ -76,7 +76,7 @@ public void testHeapProfilerIsDisabledOnUnsupportedVersion() throws Exception { @Test public void testHeapProfilerIsStillOverriddenOnUnsupportedVersion() throws Exception { Properties props = getConfigProperties(); - props.put(PROFILING_TEMPLATE_OVERRIDE_FILE, JfpUtilsTest.OVERRIDES_OLD_OBJECT_SAMPLE); + props.put(PROFILING_TEMPLATE_OVERRIDE_FILE, JfpTestResources.overridesOldObjectSample()); ConfigProvider configProvider = ConfigProvider.withPropertiesOverride(props); @@ -158,7 +158,7 @@ public void testAllocationProfilerIsDisabledOnUnsupportedVersion() throws Except @Test public void testAllocationProfilerIsStillOverriddenOnUnsupportedVersion() throws Exception { Properties props = getConfigProperties(); - props.put(PROFILING_TEMPLATE_OVERRIDE_FILE, JfpUtilsTest.OVERRIDES_OBJECT_ALLOCATION); + props.put(PROFILING_TEMPLATE_OVERRIDE_FILE, JfpTestResources.overridesObjectAllocation()); ConfigProvider configProvider = ConfigProvider.withPropertiesOverride(props); OpenJdkController controller = new OpenJdkController(configProvider); diff --git a/dd-java-agent/agent-profiling/profiling-controller-oracle/build.gradle b/dd-java-agent/agent-profiling/profiling-controller-oracle/build.gradle index 8b6d7725eff..1b18f6015ae 100644 --- a/dd-java-agent/agent-profiling/profiling-controller-oracle/build.gradle +++ b/dd-java-agent/agent-profiling/profiling-controller-oracle/build.gradle @@ -21,7 +21,6 @@ dependencies { testImplementation libs.bundles.junit5 testImplementation libs.bundles.mockito - testImplementation files(project(':dd-java-agent:agent-profiling:profiling-controller-jfr').sourceSets.test.output) testImplementation project(':dd-java-agent:agent-profiling') } diff --git a/dd-java-agent/agent-profiling/profiling-controller-oracle/gradle.lockfile b/dd-java-agent/agent-profiling/profiling-controller-oracle/gradle.lockfile index 572f4573ac4..638dc1bf7df 100644 --- a/dd-java-agent/agent-profiling/profiling-controller-oracle/gradle.lockfile +++ b/dd-java-agent/agent-profiling/profiling-controller-oracle/gradle.lockfile @@ -1,26 +1,28 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-profiling:profiling-controller-oracle:dependencies --write-locks +at.yawk.lz4:lz4-java:1.11.0=testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -35,8 +37,8 @@ io.airlift:aircompressor:2.0.3=testRuntimeClasspath io.btrace:jafar-tools:0.16.0=testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -59,10 +61,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=runtimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -74,21 +76,23 @@ org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntime org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath -org.lz4:lz4-java:1.7.1=testRuntimeClasspath org.mockito:mockito-core:4.4.0=testCompileClasspath,testRuntimeClasspath org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt org.ow2.asm:asm-commons:9.7.1=testRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt org.ow2.asm:asm:9.7.1=testRuntimeClasspath -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/agent-profiling/profiling-controller-oracle/src/main/java/com/datadog/profiling/controller/oracle/OracleJdkOngoingRecording.java b/dd-java-agent/agent-profiling/profiling-controller-oracle/src/main/java/com/datadog/profiling/controller/oracle/OracleJdkOngoingRecording.java index 18f104e4e6f..2edbc1a369e 100644 --- a/dd-java-agent/agent-profiling/profiling-controller-oracle/src/main/java/com/datadog/profiling/controller/oracle/OracleJdkOngoingRecording.java +++ b/dd-java-agent/agent-profiling/profiling-controller-oracle/src/main/java/com/datadog/profiling/controller/oracle/OracleJdkOngoingRecording.java @@ -1,6 +1,7 @@ package com.datadog.profiling.controller.oracle; import com.datadog.profiling.controller.OngoingRecording; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.api.profiling.ProfilingSnapshot; import java.io.IOException; import java.time.Duration; @@ -52,7 +53,7 @@ public OracleJdkRecordingData stop() { } } - // @VisibleForTesting + @VisibleForTesting final OracleJdkRecordingData snapshot(@Nonnull final Instant start) { return snapshot(start, ProfilingSnapshot.Kind.PERIODIC); } diff --git a/dd-java-agent/agent-profiling/profiling-controller/gradle.lockfile b/dd-java-agent/agent-profiling/profiling-controller/gradle.lockfile index 0912200a254..bced3e0cbd1 100644 --- a/dd-java-agent/agent-profiling/profiling-controller/gradle.lockfile +++ b/dd-java-agent/agent-profiling/profiling-controller/gradle.lockfile @@ -1,24 +1,29 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-profiling:profiling-controller:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -42,10 +47,11 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -60,10 +66,13 @@ org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspat org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/agent-profiling/profiling-controller/src/main/java/com/datadog/profiling/controller/EnvironmentChecker.java b/dd-java-agent/agent-profiling/profiling-controller/src/main/java/com/datadog/profiling/controller/EnvironmentChecker.java index 62ca9ea29fe..666aa0029f5 100644 --- a/dd-java-agent/agent-profiling/profiling-controller/src/main/java/com/datadog/profiling/controller/EnvironmentChecker.java +++ b/dd-java-agent/agent-profiling/profiling-controller/src/main/java/com/datadog/profiling/controller/EnvironmentChecker.java @@ -1,7 +1,5 @@ package com.datadog.profiling.controller; -import static datadog.environment.OperatingSystem.Architecture.ARM64; - import datadog.environment.JavaVirtualMachine; import datadog.environment.OperatingSystem; import datadog.environment.SystemProperties; @@ -238,16 +236,14 @@ private static boolean checkLoadLibrary(Path target, StringBuilder sb) { @SuppressForbidden private static boolean extractSoFromJar(Path target, StringBuilder sb) throws Exception { URL jarUrl = EnvironmentChecker.class.getProtectionDomain().getCodeSource().getLocation(); + String linuxArchFolder = + OperatingSystem.architecture().isArm64() ? "/linux-arm64/" : "/linux-x64/"; try (JarFile jarFile = new JarFile(new File(jarUrl.toURI()))) { return jarFile.stream() .filter(e -> e.getName().contains("libjavaProfiler.so")) .filter( e -> - e.getName() - .contains( - OperatingSystem.architecture() == ARM64 - ? "/linux-arm64/" - : "/linux-x64/") + e.getName().contains(linuxArchFolder) && (!OperatingSystem.isMusl() || e.getName().contains("-musl"))) .findFirst() .map( diff --git a/dd-java-agent/agent-profiling/profiling-controller/src/main/java/com/datadog/profiling/controller/ProfilerFlareReporter.java b/dd-java-agent/agent-profiling/profiling-controller/src/main/java/com/datadog/profiling/controller/ProfilerFlareReporter.java index 95f538a715c..5bbc9997f71 100644 --- a/dd-java-agent/agent-profiling/profiling-controller/src/main/java/com/datadog/profiling/controller/ProfilerFlareReporter.java +++ b/dd-java-agent/agent-profiling/profiling-controller/src/main/java/com/datadog/profiling/controller/ProfilerFlareReporter.java @@ -352,6 +352,13 @@ private String getProfilerConfig() { ProfilingConfig.PROFILING_DATADOG_PROFILER_WALL_CONTEXT_FILTER, ProfilingConfig.PROFILING_DATADOG_PROFILER_WALL_CONTEXT_FILTER_DEFAULT), ProfilingConfig.PROFILING_DATADOG_PROFILER_WALL_CONTEXT_FILTER_DEFAULT); + appendConfig( + sb, + "DDProf Force Preload jmethodIDs", + configProvider.getBoolean( + ProfilingConfig.PROFILING_DATADOG_PROFILER_JMETHODID_OPTIM_ENABLED, + ProfilingConfig.PROFILING_DATADOG_PROFILER_JMETHODID_OPTIM_ENABLED_DEFAULT), + ProfilingConfig.PROFILING_DATADOG_PROFILER_JMETHODID_OPTIM_ENABLED_DEFAULT); sb.append("\n=== DDProf Allocation Profiling ===\n"); appendConfig( sb, diff --git a/dd-java-agent/agent-profiling/profiling-controller/src/main/java/com/datadog/profiling/controller/ProfilingSystem.java b/dd-java-agent/agent-profiling/profiling-controller/src/main/java/com/datadog/profiling/controller/ProfilingSystem.java index 7f57b356d99..bfb3df0f333 100644 --- a/dd-java-agent/agent-profiling/profiling-controller/src/main/java/com/datadog/profiling/controller/ProfilingSystem.java +++ b/dd-java-agent/agent-profiling/profiling-controller/src/main/java/com/datadog/profiling/controller/ProfilingSystem.java @@ -22,6 +22,7 @@ import static datadog.trace.util.AgentThreadFactory.AgentThread.PROFILER_RECORDING_SCHEDULER; import datadog.environment.JavaVirtualMachine; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.api.profiling.ProfilerFlareLogger; import datadog.trace.api.profiling.ProfilingSnapshot; import datadog.trace.api.profiling.RecordingData; @@ -238,7 +239,7 @@ public boolean isStarted() { return started; } - /** VisibleForTesting */ + @VisibleForTesting final Duration getStartupDelay() { return startupDelay; } diff --git a/dd-java-agent/agent-profiling/profiling-ddprof/build.gradle b/dd-java-agent/agent-profiling/profiling-ddprof/build.gradle index 2fa61e6d34b..fe99122c3fc 100644 --- a/dd-java-agent/agent-profiling/profiling-ddprof/build.gradle +++ b/dd-java-agent/agent-profiling/profiling-ddprof/build.gradle @@ -1,5 +1,6 @@ plugins { id 'com.gradleup.shadow' + id 'me.champeau.jmh' } ext { @@ -41,6 +42,19 @@ dependencies { } +jmh { + jmhVersion = libs.versions.jmh.get() + duplicateClassesStrategy = DuplicatesStrategy.EXCLUDE + failOnError = false + forceGC = true + if (project.hasProperty('jmhIncludes')) { + includes = [project.jmhIncludes] + } + if (project.hasProperty('jmhProf')) { + profilers = [project.jmhProf] + } +} + configurations.configureEach { resolutionStrategy.cacheChangingModulesFor 0, 'seconds' } diff --git a/dd-java-agent/agent-profiling/profiling-ddprof/gradle.lockfile b/dd-java-agent/agent-profiling/profiling-ddprof/gradle.lockfile index 29786782947..50e53e02236 100644 --- a/dd-java-agent/agent-profiling/profiling-ddprof/gradle.lockfile +++ b/dd-java-agent/agent-profiling/profiling-ddprof/gradle.lockfile @@ -1,17 +1,18 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. -ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-profiling:profiling-ddprof:dependencies --write-locks +ch.qos.logback:logback-classic:1.2.13=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,jmhCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs -com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath +com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,jmhCompileClasspath com.google.auto.service:auto-service:1.1.1=annotationProcessor com.google.auto:auto-common:1.2.1=annotationProcessor -com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs @@ -21,16 +22,18 @@ com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=anno com.google.j2objc:j2objc-annotations:2.8=annotationProcessor com.thoughtworks.qdox:qdox:1.12.1=codenarc commons-io:commons-io:2.20.0=spotbugs -de.thetaphi:forbiddenapis:3.10=compileClasspath -io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath +de.thetaphi:forbiddenapis:3.10=compileClasspath,jmhCompileClasspath +io.leangen.geantyref:geantyref:1.3.16=jmhRuntimeClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.12.8=testRuntimeClasspath -net.bytebuddy:byte-buddy:1.12.8=testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.12.8=jmhRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.12.8=jmhRuntimeClasspath,testRuntimeClasspath +net.sf.jopt-simple:jopt-simple:5.0.4=jmh,jmhCompileClasspath,jmhRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc org.apache.bcel:bcel:6.11.0=spotbugs org.apache.commons:commons-lang3:3.19.0=spotbugs +org.apache.commons:commons-math3:3.6.1=jmh,jmhCompileClasspath,jmhRuntimeClasspath org.apache.commons:commons-text:1.14.0=spotbugs org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs @@ -40,51 +43,59 @@ org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc org.codehaus.groovy:groovy-json:3.0.23=codenarc -org.codehaus.groovy:groovy-json:3.0.25=testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-json:3.0.25=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codehaus.groovy:groovy-templates:3.0.23=codenarc org.codehaus.groovy:groovy-xml:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.23=codenarc -org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy:3.0.25=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc -org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt -org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath -org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath +org.hamcrest:hamcrest:3.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt +org.junit.jupiter:junit-jupiter-api:5.14.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.14.1=jmhRuntimeClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.14.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.14.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.14.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.14.1=jmhRuntimeClasspath,testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs -org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath -org.lz4:lz4-java:1.7.1=testCompileClasspath,testRuntimeClasspath -org.mockito:mockito-core:4.4.0=testRuntimeClasspath -org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath -org.openjdk.jmc:common:8.1.0=testCompileClasspath,testRuntimeClasspath -org.openjdk.jmc:flightrecorder:8.1.0=testCompileClasspath,testRuntimeClasspath -org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath +org.junit:junit-bom:5.14.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.lz4:lz4-java:1.7.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-core:4.4.0=jmhRuntimeClasspath,testRuntimeClasspath +org.objenesis:objenesis:3.3=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.openjdk.jmc:common:8.1.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.openjdk.jmc:flightrecorder:8.1.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.openjdk.jmh:jmh-core:1.37=jmh,jmhCompileClasspath,jmhRuntimeClasspath +org.openjdk.jmh:jmh-generator-asm:1.37=jmh,jmhCompileClasspath,jmhRuntimeClasspath +org.openjdk.jmh:jmh-generator-bytecode:1.37=jmh,jmhCompileClasspath,jmhRuntimeClasspath +org.openjdk.jmh:jmh-generator-reflection:1.37=jmh,jmhCompileClasspath,jmhRuntimeClasspath +org.opentest4j:opentest4j:1.3.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs -org.owasp.encoder:encoder:1.2.3=testCompileClasspath,testRuntimeClasspath -org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.30=compileClasspath,runtimeClasspath -org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.0=jmh,jmhCompileClasspath,jmhRuntimeClasspath +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs +org.owasp.encoder:encoder:1.2.3=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:jcl-over-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:jul-to-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:log4j-over-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.30=compileClasspath,jmhCompileClasspath,runtimeClasspath +org.slf4j:slf4j-api:1.7.32=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j -org.snakeyaml:snakeyaml-engine:2.9=runtimeClasspath,testRuntimeClasspath -org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath -org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath +org.snakeyaml:snakeyaml-engine:2.9=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath +org.spockframework:spock-bom:2.4-groovy-3.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.spockframework:spock-core:2.4-groovy-3.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-junit:1.2.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-parser:1.2.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -empty=shadow,spotbugsPlugins,testAnnotationProcessor +empty=jmhAnnotationProcessor,shadow,spotbugsPlugins,testAnnotationProcessor diff --git a/dd-java-agent/agent-profiling/profiling-ddprof/src/jmh/java/com/datadog/profiling/ddprof/AppContextSnapshotBenchmark.java b/dd-java-agent/agent-profiling/profiling-ddprof/src/jmh/java/com/datadog/profiling/ddprof/AppContextSnapshotBenchmark.java new file mode 100644 index 00000000000..53dd2ed9932 --- /dev/null +++ b/dd-java-agent/agent-profiling/profiling-ddprof/src/jmh/java/com/datadog/profiling/ddprof/AppContextSnapshotBenchmark.java @@ -0,0 +1,87 @@ +package com.datadog.profiling.ddprof; + +import java.nio.charset.StandardCharsets; +import java.util.concurrent.TimeUnit; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Param; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Warmup; + +/** + * Verifies that the ScopeStack pool approach (AppContextSnapshot.copyFrom into a pre-allocated + * slot) is allocation-free on the save/restore hot path. + * + *

The {@code deepStack} benchmark uses {@code stackDepth=16} to trigger a one-time resize + * (default pool size is 8) and confirm that subsequent iterations at that depth are still + * allocation-free once the pool has grown. + * + *

Run with: ./gradlew :dd-java-agent:agent-profiling:profiling-ddprof:jmh + * -PjmhIncludes=AppContextSnapshotBenchmark -PjmhProf=gc + * + *

Expected: gc.alloc.rate.norm ≈ 0 B/op for save, restore, and deepStack (steady state). + */ +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(TimeUnit.NANOSECONDS) +@Warmup(iterations = 3, time = 1) +@Measurement(iterations = 5, time = 1) +@Fork(1) +@State(Scope.Thread) +public class AppContextSnapshotBenchmark { + + @Param({"2", "8"}) + int attrCount; + + /** + * Stack depth for the deepStack benchmark — 16 forces one resize past the default 8-slot pool. + */ + @Param({"8", "16"}) + int stackDepth; + + private DatadogProfiler.AppContextSnapshot source; + private DatadogProfiler.AppContextSnapshot slot; + private DatadogProfiler.ScopeStack stack; + + @Setup + public void setup() { + source = new DatadogProfiler.AppContextSnapshot(attrCount); + for (int i = 0; i < attrCount; i++) { + byte[] utf8 = ("value-" + i).getBytes(StandardCharsets.UTF_8); + source.record(i, i + 1, utf8, "value-" + i); + } + slot = new DatadogProfiler.AppContextSnapshot(attrCount); + stack = new DatadogProfiler.ScopeStack(attrCount); + } + + /** ScopeStack save: copies current snapshot into a pre-allocated pool slot (zero alloc). */ + @Benchmark + public void save() { + slot.copyFrom(source); + } + + /** ScopeStack restore: copies pool slot back into the live snapshot (zero alloc). */ + @Benchmark + public void restore() { + source.copyFrom(slot); + } + + /** + * Borrow {@code stackDepth} slots then release them all. At {@code stackDepth=16} the pool + * resizes during warmup; steady-state measurement confirms zero allocation after growth. + */ + @Benchmark + public void deepStack() { + for (int i = 0; i < stackDepth; i++) { + stack.borrow().copyFrom(source); + } + for (int i = 0; i < stackDepth; i++) { + stack.release(); + } + } +} diff --git a/dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfiler.java b/dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfiler.java index b1e07b08c32..df1b75789db 100644 --- a/dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfiler.java +++ b/dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfiler.java @@ -1,5 +1,6 @@ package com.datadog.profiling.ddprof; +import static com.datadog.profiling.ddprof.DatadogProfilerConfig.enableJMethodIDOptim; import static com.datadog.profiling.ddprof.DatadogProfilerConfig.getAllocationInterval; import static com.datadog.profiling.ddprof.DatadogProfilerConfig.getCStack; import static com.datadog.profiling.ddprof.DatadogProfilerConfig.getContextAttributes; @@ -43,10 +44,12 @@ import datadog.trace.bootstrap.instrumentation.api.TaskWrapper; import datadog.trace.util.TempLocationManager; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.attribute.PosixFilePermissions; import java.util.ArrayList; +import java.util.Arrays; import java.util.EnumSet; import java.util.List; import java.util.Set; @@ -107,16 +110,138 @@ public static DatadogProfiler newInstance(ConfigProvider configProvider) { private final List orderedContextAttributes; + // True for each attribute slot that was configured by the application (e.g. foo, bar). + // ddprof wipes all custom slots on setContext; these slots are re-applied via + // reapplyAppContext() on span activation. + private final boolean[] isAppOffset; + + private final boolean hasAppContext; + + /** + * Per-thread snapshot of application attribute values. Lazily allocated; only threads that call + * setContextValue for an app attribute ever allocate. Holds the ddprof constant ID and + * pre-encoded UTF-8 bytes for each slot, ready for a zero-allocation reapply via + * setContextValuesByIdAndBytes. + */ + private final ThreadLocal appContextValues = new ThreadLocal<>(); + + private final ThreadLocal scopeStack = new ThreadLocal<>(); + // Scratch buffer for snapshotTags in recordAppContextValue; per-thread, sized to context slots. + // Lives here rather than on AppContextSnapshot so save-slots in ScopeStack don't carry it. + private final ThreadLocal contextScratch = + new ThreadLocal() { + @Override + protected int[] initialValue() { + return new int[isAppOffset.length]; + } + }; + + /** Per-thread stack of pre-allocated save slots for {@link DatadogProfilingScope}. */ + static final class ScopeStack { + private final int attrCount; + AppContextSnapshot[] slots; + int depth; + + ScopeStack(int attrCount) { + this.attrCount = attrCount; + slots = new AppContextSnapshot[8]; + for (int i = 0; i < slots.length; i++) { + slots[i] = new AppContextSnapshot(attrCount); + } + } + + AppContextSnapshot borrow() { + if (depth >= slots.length) { + AppContextSnapshot[] grown = new AppContextSnapshot[slots.length * 2]; + System.arraycopy(slots, 0, grown, 0, slots.length); + // Eagerly fill the newly added slots so every index is non-null. + for (int i = slots.length; i < grown.length; i++) { + grown[i] = new AppContextSnapshot(attrCount); + } + slots = grown; + } + return slots[depth++]; + } + + void release() { + if (depth > 0) slots[--depth].reset(); + } + } + + // Package-private so DatadogProfilingScope can hold a typed reference for save/restore. + static final class AppContextSnapshot { + private final int[] ids; + private final byte[][] utf8; + // Cached string values for change detection — avoids re-encoding and re-snapshotting + // the constant ID when the same value is set again on the same thread. + private final String[] strings; + // Count of slots with a non-zero constant ID; allows O(1) isEmpty(). + private int nonZeroCount; + + AppContextSnapshot(int size) { + ids = new int[size]; + utf8 = new byte[size][]; + strings = new String[size]; + } + + void record(int offset, int constantId, byte[] utf8Bytes, String value) { + if (ids[offset] == 0 && constantId != 0) { + nonZeroCount++; + } else if (ids[offset] != 0 && constantId == 0) { + nonZeroCount--; + } + ids[offset] = constantId; + utf8[offset] = utf8Bytes; + strings[offset] = value; + } + + void clear(int offset) { + if (ids[offset] != 0) nonZeroCount--; + ids[offset] = 0; + utf8[offset] = null; + strings[offset] = null; + } + + boolean isEmpty() { + return nonZeroCount == 0; + } + + int nonZeroCount() { + return nonZeroCount; + } + + String stringAt(int offset) { + return strings[offset]; + } + + int[] ids() { + return ids; + } + + byte[][] utf8() { + return utf8; + } + + void copyFrom(AppContextSnapshot src) { + System.arraycopy(src.ids, 0, ids, 0, ids.length); + System.arraycopy(src.utf8, 0, utf8, 0, utf8.length); + System.arraycopy(src.strings, 0, strings, 0, strings.length); + nonZeroCount = src.nonZeroCount; + } + + void reset() { + Arrays.fill(ids, 0); + Arrays.fill(utf8, null); + Arrays.fill(strings, null); + nonZeroCount = 0; + } + } + private final long queueTimeThresholdMillis; private final Path recordingsPath; private DatadogProfiler(ConfigProvider configProvider) { - this(configProvider, getContextAttributes(configProvider)); - } - - // visible for testing - DatadogProfiler(ConfigProvider configProvider, Set contextAttributes) { this.configProvider = configProvider; this.profiler = DdprofLibraryLoader.javaProfiler().getComponent(); this.detailedDebugLogging = @@ -142,14 +267,22 @@ private DatadogProfiler(ConfigProvider configProvider) { if (isWallClockProfilerEnabled(configProvider)) { profilingModes.add(WALL); } - this.orderedContextAttributes = new ArrayList<>(contextAttributes); - if (isSpanNameContextAttributeEnabled(configProvider)) { - orderedContextAttributes.add(OPERATION); - } - if (isResourceNameContextAttributeEnabled(configProvider)) { - orderedContextAttributes.add(RESOURCE); - } + Set contextAttributes = getContextAttributes(configProvider); + this.orderedContextAttributes = getOrderedContextAttributes(contextAttributes, configProvider); this.contextSetter = new ContextSetter(profiler, orderedContextAttributes); + // ContextSetter deduplicates and truncates to 10 internally; size arrays to its actual size. + int contextSize = contextSetter.snapshotTags().length; + boolean[] appOffsets = new boolean[contextSize]; + boolean anyApp = false; + for (String attribute : contextAttributes) { + int idx = contextSetter.offsetOf(attribute); + if (idx >= 0) { + appOffsets[idx] = true; + anyApp = true; + } + } + this.isAppOffset = appOffsets; + this.hasAppContext = anyApp; this.queueTimeThresholdMillis = configProvider.getLong( PROFILING_QUEUEING_TIME_THRESHOLD_MILLIS, @@ -169,6 +302,28 @@ private DatadogProfiler(ConfigProvider configProvider) { } } + /** + * Computes the ordered context-attribute list (base attributes from config, then the optional + * span-name and resource-name attributes) in the exact order used for the per-thread {@link + * ContextSetter} and the native profiler's {@code attributes=} argument. Exposed so the OTel + * process context can publish the same {@code attribute_key_map} before the profiler starts. + */ + public static List getOrderedContextAttributes(ConfigProvider configProvider) { + return getOrderedContextAttributes(getContextAttributes(configProvider), configProvider); + } + + private static List getOrderedContextAttributes( + Set contextAttributes, ConfigProvider configProvider) { + List ordered = new ArrayList<>(contextAttributes); + if (isSpanNameContextAttributeEnabled(configProvider)) { + ordered.add(OPERATION); + } + if (isResourceNameContextAttributeEnabled(configProvider)) { + ordered.add(RESOURCE); + } + return ordered; + } + void addThread() { profiler.addThread(); } @@ -275,6 +430,12 @@ String cmdStartProfiling(Path file) throws IllegalStateException { if (omitLineNumbers(configProvider)) { cmd.append(",linenumbers=f"); } + + // Default is true + if (enableJMethodIDOptim(configProvider)) { + cmd.append(",fjmethodid=false"); + } + if (profilingModes.contains(CPU)) { // cpu profiling is enabled. String schedulingEvent = getSchedulingEvent(configProvider); @@ -360,6 +521,7 @@ public void setSpanContext(long rootSpanId, long spanId, long traceIdHigh, long } catch (Throwable e) { log.debug("Failed to clear context", e); } + reapplyAppContext(); } public void clearSpanContext() { @@ -369,20 +531,26 @@ public void clearSpanContext() { } catch (Throwable e) { log.debug("Failed to set context", e); } + reapplyAppContext(); } - public boolean setContextValue(int offset, CharSequence value) { + public boolean setContextValue(int offset, String value) { if (contextSetter != null && offset >= 0 && value != null) { try { - return contextSetter.setContextValue(offset, value.toString()); + // Native call first; snapshot updated only on success so Java and ddprof state stay in + // sync. + if (contextSetter.setContextValue(offset, value)) { + recordAppContextValue(offset, value); + return true; + } } catch (Throwable e) { - log.debug("Failed to set context", e); + log.debug("Failed to set context value", e); } } return false; } - public boolean setContextValue(String attribute, CharSequence value) { + public boolean setContextValue(String attribute, String value) { if (contextSetter != null) { return setContextValue(contextSetter.offsetOf(attribute), value); } @@ -399,14 +567,168 @@ public boolean clearContextValue(String attribute) { public boolean clearContextValue(int offset) { if (contextSetter != null && offset >= 0) { try { - return contextSetter.clearContextValue(offset); + // Native call first; snapshot updated only after it returns so a throw leaves both sides + // consistent. + boolean cleared = contextSetter.clearContextValue(offset); + recordAppContextValue(offset, null); + return cleared; } catch (Throwable t) { - log.debug("Failed to clear context", t); + log.debug("Failed to clear context value", t); } } return false; } + /** + * Re-applies this thread's application-managed context attributes after a span activation or + * deactivation. ddprof's {@code setContext} clears all custom attribute slots; this restores only + * the app-owned ones so they remain visible during the new span's lifetime (or after the last + * span closes). No-op when no application attributes are configured or none have been set on this + * thread. + * + *

Fast path (span activation): uses the pre-computed constant IDs and UTF-8 bytes from {@link + * #recordAppContextValue} in a single {@code setContextValuesByIdAndBytes} call — no String + * allocation, no hash lookup. + * + *

Fallback (span deactivation via {@code setContext(0,0,0,0)}): {@code clearContextDirect} + * calls {@code detach()} but not {@code attach()}, leaving the thread's {@code validOffset=0}. + * {@code setContextValuesByIdAndBytes} returns {@code false} in that state, so we fall back to + * individual {@code setContextValue} calls which go through the proper detach/attach cycle. + */ + public void reapplyAppContext() { + if (!hasAppContext) { + return; + } + AppContextSnapshot snapshot = appContextValues.get(); + if (snapshot == null) { + return; + } + try { + if (!contextSetter.setContextValuesByIdAndBytes(snapshot.ids(), snapshot.utf8())) { + // validOffset=0 after clearContextDirect (setContext(0,0,0,0) path) — fall back to + // individual writes which go through the proper detach/attach cycle. + int remaining = snapshot.nonZeroCount(); + for (int i = 0; i < isAppOffset.length && remaining > 0; i++) { + String s = snapshot.stringAt(i); + if (s != null) { + contextSetter.setContextValue(i, s); + remaining--; + } + } + } + } catch (Throwable e) { + log.debug("Failed to reapply context", e); + } + } + + /** Clears the per-thread app-context snapshot. Used in tests and internally. */ + void clearAppContextSnapshot() { + appContextValues.remove(); + scopeStack.remove(); + contextScratch.remove(); + } + + /** + * Immediately writes {@code snapshot} into the ddprof native slots for every app-context offset, + * clearing any offset not present in the snapshot. Reads the restored state from the per-thread + * {@code appContextValues} TL (already updated by {@link #restoreAppContext}) rather than from + * the saved slot directly, because {@link ScopeStack#release()} resets the slot before this + * method is called. Called by {@link DatadogProfilingScope#close} so that native state matches + * the restored Java-side snapshot right away, without waiting for the next span activation. + */ + void syncNativeAppContext() { + if (!hasAppContext || contextSetter == null) { + return; + } + AppContextSnapshot snapshot = appContextValues.get(); + try { + for (int i = 0; i < isAppOffset.length; i++) { + if (!isAppOffset[i]) { + continue; + } + String value = snapshot != null ? snapshot.stringAt(i) : null; + if (value != null) { + contextSetter.setContextValue(i, value); + } else { + contextSetter.clearContextValue(i); + } + } + } catch (Throwable e) { + log.debug("Failed to sync native app context on scope close", e); + } + } + + /** + * Returns a copy of the current app-context snapshot for later restoration, or {@code null} if + * nothing is set. Called by {@link DatadogProfilingScope} on construction to implement + * save/restore across scope boundaries. + */ + AppContextSnapshot saveAppContext() { + AppContextSnapshot current = appContextValues.get(); + if (current == null || current.isEmpty()) { + return null; + } + ScopeStack stack = scopeStack.get(); + if (stack == null) { + stack = new ScopeStack(isAppOffset.length); + scopeStack.set(stack); + } + AppContextSnapshot slot = stack.borrow(); + slot.copyFrom(current); + return slot; + } + + /** + * Restores a previously saved app-context snapshot. If {@code saved} is {@code null} the + * ThreadLocal is removed, otherwise the current snapshot is overwritten with {@code saved}. + * Called by {@link DatadogProfilingScope#close()}. + */ + void restoreAppContext(AppContextSnapshot saved) { + if (saved == null) { + appContextValues.remove(); + } else { + AppContextSnapshot current = appContextValues.get(); + if (current == null) { + current = new AppContextSnapshot(isAppOffset.length); + appContextValues.set(current); + } + current.copyFrom(saved); + ScopeStack stack = scopeStack.get(); + if (stack != null) { + stack.release(); + } + } + } + + private void recordAppContextValue(int offset, String value) { + if (!hasAppContext || offset < 0 || offset >= isAppOffset.length || !isAppOffset[offset]) { + return; + } + AppContextSnapshot snapshot = appContextValues.get(); + if (value == null) { + if (snapshot == null) { + return; + } + snapshot.clear(offset); + if (snapshot.isEmpty()) { + appContextValues.remove(); + } + return; + } + if (snapshot == null) { + snapshot = new AppContextSnapshot(isAppOffset.length); + appContextValues.set(snapshot); + } + if (!value.equals(snapshot.stringAt(offset))) { + byte[] utf8Bytes = value.getBytes(StandardCharsets.UTF_8); + // ContextSetter has no single-slot readback API; snapshotTags fills all slots at once. + // The scratch array is per-thread and reused across calls, so this is allocation-free. + int[] scratch = contextScratch.get(); + contextSetter.snapshotTags(scratch); + snapshot.record(offset, scratch[offset], utf8Bytes, value); + } + } + private void debugLogging(long localRootSpanId) { if (detailedDebugLogging && log.isDebugEnabled()) { log.debug("localRootSpanId={}", localRootSpanId, new Throwable()); diff --git a/dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfilerConfig.java b/dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfilerConfig.java index 60c0d5c2e60..8582e27c853 100644 --- a/dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfilerConfig.java +++ b/dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfilerConfig.java @@ -15,6 +15,8 @@ import static datadog.trace.api.config.ProfilingConfig.PROFILING_DATADOG_PROFILER_CPU_INTERVAL_DEFAULT; import static datadog.trace.api.config.ProfilingConfig.PROFILING_DATADOG_PROFILER_CSTACK; import static datadog.trace.api.config.ProfilingConfig.PROFILING_DATADOG_PROFILER_CSTACK_DEFAULT; +import static datadog.trace.api.config.ProfilingConfig.PROFILING_DATADOG_PROFILER_JMETHODID_OPTIM_ENABLED; +import static datadog.trace.api.config.ProfilingConfig.PROFILING_DATADOG_PROFILER_JMETHODID_OPTIM_ENABLED_DEFAULT; import static datadog.trace.api.config.ProfilingConfig.PROFILING_DATADOG_PROFILER_LIBPATH; import static datadog.trace.api.config.ProfilingConfig.PROFILING_DATADOG_PROFILER_LINE_NUMBERS; import static datadog.trace.api.config.ProfilingConfig.PROFILING_DATADOG_PROFILER_LINE_NUMBERS_DEFAULT; @@ -439,6 +441,13 @@ public static long getLong(ConfigProvider configProvider, String key) { return configProvider.getLong(key, configProvider.getLong(normalizeKey(key), -1)); } + public static boolean enableJMethodIDOptim(ConfigProvider configProvider) { + return getBoolean( + configProvider, + PROFILING_DATADOG_PROFILER_JMETHODID_OPTIM_ENABLED, + PROFILING_DATADOG_PROFILER_JMETHODID_OPTIM_ENABLED_DEFAULT); + } + private static String normalizeKey(String key) { return key.replace(".ddprof.", ".async."); } diff --git a/dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfilerContextSetter.java b/dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfilerContextSetter.java index 58c9fbfd9cb..4bde713bcb6 100644 --- a/dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfilerContextSetter.java +++ b/dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfilerContextSetter.java @@ -11,7 +11,7 @@ public DatadogProfilerContextSetter(String attribute, DatadogProfiler profiler) this.profiler = profiler; } - public void set(CharSequence value) { + public void set(String value) { profiler.setContextValue(offset, value); } diff --git a/dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfilerRecording.java b/dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfilerRecording.java index 8154a8a444e..82bf3d5b868 100644 --- a/dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfilerRecording.java +++ b/dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfilerRecording.java @@ -1,6 +1,7 @@ package com.datadog.profiling.ddprof; import com.datadog.profiling.controller.OngoingRecording; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.api.profiling.ProfilingSnapshot; import datadog.trace.api.profiling.RecordingData; import java.io.IOException; @@ -37,7 +38,7 @@ public RecordingData stop() { recordingFile, started, Instant.now(), ProfilingSnapshot.Kind.ON_SHUTDOWN); } - // @VisibleForTesting + @VisibleForTesting final RecordingData snapshot(@Nonnull Instant start) { return snapshot(start, ProfilingSnapshot.Kind.PERIODIC); } @@ -62,7 +63,7 @@ public void close() { } } - // used for tests only + @VisibleForTesting Path getRecordingFile() { return recordingFile; } diff --git a/dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfilingIntegration.java b/dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfilingIntegration.java index 00a0358d346..65462a46bce 100644 --- a/dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfilingIntegration.java +++ b/dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfilingIntegration.java @@ -41,13 +41,15 @@ public void close() { public void activate(Object context) { if (context instanceof ProfilerContext) { ProfilerContext profilerContext = (ProfilerContext) context; + // setSpanContext() calls reapplyAppContext() internally, so no explicit call is needed. DDPROF.setSpanContext( profilerContext.getRootSpanId(), profilerContext.getSpanId(), profilerContext.getTraceIdHigh(), profilerContext.getTraceIdLow()); - DDPROF.setContextValue(SPAN_NAME_INDEX, profilerContext.getOperationName()); - DDPROF.setContextValue(RESOURCE_NAME_INDEX, profilerContext.getResourceName()); + DDPROF.setContextValue(SPAN_NAME_INDEX, profilerContext.getOperationName().toString()); + DDPROF.setContextValue( + RESOURCE_NAME_INDEX, profilerContext.getResourceName().toString()); } } }; diff --git a/dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfilingScope.java b/dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfilingScope.java index 848769cb091..27454cdc851 100644 --- a/dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfilingScope.java +++ b/dd-java-agent/agent-profiling/profiling-ddprof/src/main/java/com/datadog/profiling/ddprof/DatadogProfilingScope.java @@ -5,9 +5,16 @@ public class DatadogProfilingScope implements ProfilingScope { private final DatadogProfiler profiler; + // Snapshot of the app-managed context slots at scope creation (those registered via + // ProfilingContextAttribute). Restored on close() so ambient values set before this + // scope are not lost when the scope exits. + // Span context slots (managed by DatadogProfilingIntegration) are not snapshotted + // here; their lifecycle is controlled by the tracer's activate/deactivate path. + private final DatadogProfiler.AppContextSnapshot savedAppContext; public DatadogProfilingScope(DatadogProfiler profiler) { this.profiler = profiler; + this.savedAppContext = profiler.saveAppContext(); } @Override @@ -36,7 +43,15 @@ public void clearContextValue(ProfilingContextAttribute attribute) { @Override public void close() { - // ddprof 1.41.0 removed the int-encoding setter; snapshot/restore of tag - // context across nested scopes is no longer supported by the library. + // Restores the app-managed context slots that were active when this scope opened. + // Span context slots are NOT touched here; they are managed independently by the + // tracer via DatadogProfilingIntegration.activate()/close(). + // + // Prior to ddprof 1.45.0 this method was a no-op: ddprof 1.41.0 removed the + // int-encoding setter that the previous snapshot/restore relied on, leaving no + // supported API for restoring context. The new setContextValuesByIdAndBytes API + // (1.45.0) makes targeted per-slot restore possible again — for app slots only. + profiler.restoreAppContext(savedAppContext); + profiler.syncNativeAppContext(); } } diff --git a/dd-java-agent/agent-profiling/profiling-ddprof/src/test/java/com/datadog/profiling/ddprof/DatadogProfilerTest.java b/dd-java-agent/agent-profiling/profiling-ddprof/src/test/java/com/datadog/profiling/ddprof/DatadogProfilerTest.java index 55d39ba52a0..6dcb3e9d231 100644 --- a/dd-java-agent/agent-profiling/profiling-ddprof/src/test/java/com/datadog/profiling/ddprof/DatadogProfilerTest.java +++ b/dd-java-agent/agent-profiling/profiling-ddprof/src/test/java/com/datadog/profiling/ddprof/DatadogProfilerTest.java @@ -1,7 +1,9 @@ package com.datadog.profiling.ddprof; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -14,10 +16,10 @@ import datadog.trace.api.profiling.ProfilingScope; import datadog.trace.api.profiling.RecordingData; import datadog.trace.bootstrap.config.provider.ConfigProvider; +import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Arrays; -import java.util.HashSet; import java.util.Properties; import java.util.UUID; import java.util.stream.IntStream; @@ -106,6 +108,23 @@ private static Stream profilingModes() { Arguments.of((x & 0x1000) != 0, (x & 0x100) != 0, (x & 0x10) != 0, (x & 0x1) != 0)); } + @Test + void testStartCmdEnableJMethodIDOptim() throws Exception { + assertDoesNotThrow( + () -> DdprofLibraryLoader.jvmAccess().getReasonNotLoaded(), "Profiler not available"); + + Properties props = new Properties(); + props.put(ProfilingConfig.PROFILING_DATADOG_PROFILER_JMETHODID_OPTIM_ENABLED, "true"); + DatadogProfiler profiler = + DatadogProfiler.newInstance(ConfigProvider.withPropertiesOverride(props)); + + Path dir = Paths.get("/tmp"); + Path targetFile = Files.createTempFile(dir, "target_", ".jfr"); + String cmd = profiler.cmdStartProfiling(targetFile); + + assertTrue(cmd.contains(",fjmethodid=false"), cmd); + } + @ParameterizedTest @MethodSource("wallContextFilterModes") void testWallContextFilter(boolean tracingEnabled, boolean contextFilterEnabled) @@ -169,9 +188,14 @@ public void testContextRegistration() { // so there is only one shot to test it here, 'foo,bar' need to be kept in the same // order whether in the list or the enum, and any other test which tries to register // context attributes will fail + Properties props = new Properties(); + props.put(ProfilingConfig.PROFILING_DATADOG_PROFILER_CPU_ENABLED, "true"); + props.put(ProfilingConfig.PROFILING_DATADOG_PROFILER_WALL_ENABLED, "true"); + props.put(ProfilingConfig.PROFILING_DATADOG_PROFILER_ALLOC_ENABLED, "true"); + props.put(ProfilingConfig.PROFILING_DATADOG_PROFILER_LIVEHEAP_ENABLED, "true"); + props.put(ProfilingConfig.PROFILING_CONTEXT_ATTRIBUTES, "foo,bar"); DatadogProfiler profiler = - new DatadogProfiler( - configProvider(true, true, true, true), new HashSet<>(Arrays.asList("foo", "bar"))); + DatadogProfiler.newInstance(ConfigProvider.withPropertiesOverride(props)); assertTrue(profiler.setContextValue("foo", "abc")); assertTrue(profiler.setContextValue("bar", "abc")); assertTrue(profiler.setContextValue("foo", "xyz")); @@ -193,6 +217,244 @@ public void testContextRegistration() { assertFalse(Arrays.equals(snapshot2, profiler.snapshot())); } } + + // setSpanContext wipes all custom slots and automatically calls reapplyAppContext() to restore + // them. + int fooOffset = profiler.offsetOf("foo"); + fooSetter.set("reapply-me"); + assertNotEquals(0, profiler.snapshot()[fooOffset]); + + profiler.setSpanContext(1L, 1L, 0L, 1L); + assertNotEquals(0, profiler.snapshot()[fooOffset]); + + profiler.reapplyAppContext(); + assertNotEquals(0, profiler.snapshot()[fooOffset]); + + // Scenario A: clearContextValue must clear the snapshot so reapply has nothing to restore + profiler.clearContextValue("foo"); + assertEquals(0, profiler.snapshot()[fooOffset], "clearContextValue must clear ddprof slot"); + profiler.reapplyAppContext(); + assertEquals( + 0, + profiler.snapshot()[fooOffset], + "after clearContextValue, reapplyAppContext must not restore foo"); + + // Scenario B: scope opened when snapshot is null — close() restores null (pre-scope state) + { + DatadogProfilingScope scope = new DatadogProfilingScope(profiler); + scope.setContextValue("foo", "scope-val"); + assertNotEquals(0, profiler.snapshot()[fooOffset], "foo must be live inside scope"); + scope.close(); + } + profiler.setSpanContext(1L, 1L, 0L, 1L); + profiler.reapplyAppContext(); + assertEquals( + 0, + profiler.snapshot()[fooOffset], + "scope.close() restores pre-scope snapshot (null here), so reapply has nothing to restore"); + + // Scenario B2: scope.close() immediately clears native slot — no span re-activation needed + { + DatadogProfilingScope scope = new DatadogProfilingScope(profiler); + scope.setContextValue("foo", "immediate-clear-val"); + assertNotEquals(0, profiler.snapshot()[fooOffset], "foo must be live inside scope"); + scope.close(); + assertEquals( + 0, + profiler.snapshot()[fooOffset], + "scope.close() must immediately clear native slot without waiting for reapplyAppContext"); + } + + // Scenario B3: scope.close() immediately restores prior context to native slot + fooSetter.set("outer-val"); + int outerEncoding = profiler.snapshot()[fooOffset]; + assertNotEquals(0, outerEncoding, "outer foo must be live before inner scope"); + { + DatadogProfilingScope scope = new DatadogProfilingScope(profiler); + scope.setContextValue("foo", "inner-val"); + int innerEncoding = profiler.snapshot()[fooOffset]; + assertNotEquals(outerEncoding, innerEncoding, "inner scope must change native slot"); + scope.close(); + assertEquals( + outerEncoding, + profiler.snapshot()[fooOffset], + "scope.close() must immediately restore prior native slot value"); + } + profiler.clearContextValue("foo"); + + // Scenario C: reapplyAppContext is idempotent + fooSetter.set("idempotent-value"); + profiler.setSpanContext(1L, 1L, 0L, 1L); + profiler.reapplyAppContext(); + int afterFirst = profiler.snapshot()[fooOffset]; + assertNotEquals(0, afterFirst, "reapplyAppContext must restore foo"); + profiler.reapplyAppContext(); + assertEquals( + afterFirst, + profiler.snapshot()[fooOffset], + "calling reapplyAppContext twice must produce the same result"); + + // Scenario D: re-activation after child activation restores app attr + int parentEncoding = profiler.snapshot()[fooOffset]; + assertNotEquals(0, parentEncoding, "foo must be set before child activation"); + profiler.setSpanContext(2L, 2L, 0L, 2L); + assertEquals( + parentEncoding, + profiler.snapshot()[fooOffset], + "setSpanContext auto-reapplies app context on child activation"); + profiler.setSpanContext(1L, 1L, 0L, 1L); + profiler.reapplyAppContext(); + assertEquals( + parentEncoding, + profiler.snapshot()[fooOffset], + "re-activation + reapply must restore parent app attr"); + + // Scenario E: app attr set in child survives into next activation + profiler.setSpanContext(2L, 2L, 0L, 2L); + fooSetter.set("child-val"); + int childEncoding = profiler.snapshot()[fooOffset]; + assertNotEquals(0, childEncoding, "foo must be set in child context"); + profiler.setSpanContext(1L, 1L, 0L, 1L); + assertEquals( + childEncoding, + profiler.snapshot()[fooOffset], + "setSpanContext auto-reapplies app context (child-val) on re-activation"); + profiler.reapplyAppContext(); + assertEquals( + childEncoding, + profiler.snapshot()[fooOffset], + "ThreadLocal ambient value must survive into the next activation"); + + // Scenario F: app attributes are visible after the last span scope closes. + // clearSpanContext() wipes all custom slots and automatically calls reapplyAppContext(), + // restoring app attrs immediately. + fooSetter.set("pre-close-val"); + assertNotEquals(0, profiler.snapshot()[fooOffset], "foo must be live before clearSpanContext"); + profiler.clearSpanContext(); + assertNotEquals( + 0, profiler.snapshot()[fooOffset], "clearSpanContext must auto-reapply app context"); + profiler.reapplyAppContext(); + assertNotEquals( + 0, + profiler.snapshot()[fooOffset], + "reapplyAppContext after clearSpanContext must restore foo"); + + // Scenario G: no app value set — clearSpanContext + reapplyAppContext leaves slot empty + profiler.clearContextValue("foo"); + profiler.clearAppContextSnapshot(); + profiler.clearSpanContext(); + profiler.reapplyAppContext(); + assertEquals( + 0, + profiler.snapshot()[fooOffset], + "reapplyAppContext with no snapshot must leave foo at 0"); + + // Scenario H: scope.close() restores ambient context set before scope was opened + fooSetter.set("ambient-val"); + // Activate a span so reapplyAppContext can write the value (validOffset=1 after + // setSpanContext). + profiler.setSpanContext(1L, 1L, 0L, 1L); + profiler.reapplyAppContext(); + int ambientEncoding = profiler.snapshot()[fooOffset]; + assertNotEquals(0, ambientEncoding, "ambient foo must be live"); + { + DatadogProfilingScope scope = new DatadogProfilingScope(profiler); + scope.setContextValue("foo", "scope-override"); + assertNotEquals( + ambientEncoding, profiler.snapshot()[fooOffset], "scope must override ambient"); + scope.close(); // must restore ambient snapshot, not nuke it + } + profiler.setSpanContext(1L, 1L, 0L, 1L); + profiler.reapplyAppContext(); + assertEquals( + ambientEncoding, + profiler.snapshot()[fooOffset], + "scope.close() must restore ambient context, not clear it"); + + // Clean up after Scenario H so Acceptance tests start from a neutral state. + profiler.clearContextValue("foo"); + profiler.clearSpanContext(); + + // Acceptance 1: reapply happens automatically inside setSpanContext — no manual call needed. + fooSetter.set("auto-reapply-val"); + assertNotEquals(0, profiler.snapshot()[fooOffset], "foo must be live before setSpanContext"); + profiler.setSpanContext(1L, 1L, 0L, 1L); + // Deliberately NO profiler.reapplyAppContext() here. + assertNotEquals( + 0, + profiler.snapshot()[fooOffset], + "Acceptance 1: setSpanContext must auto-restore app slot without explicit reapplyAppContext"); + profiler.clearContextValue("foo"); + + // Acceptance 2: reapply happens automatically inside clearSpanContext — no manual call needed. + fooSetter.set("clear-reapply-val"); + assertNotEquals(0, profiler.snapshot()[fooOffset], "foo must be live before clearSpanContext"); + profiler.clearSpanContext(); + // Deliberately NO profiler.reapplyAppContext() here. + assertNotEquals( + 0, + profiler.snapshot()[fooOffset], + "Acceptance 2: clearSpanContext must auto-restore app slot without explicit reapplyAppContext"); + profiler.clearContextValue("foo"); + + // Acceptance 3: no app value set — clearSpanContext leaves slot empty. + profiler.clearContextValue("foo"); + profiler.clearAppContextSnapshot(); + profiler.clearSpanContext(); + // Deliberately NO profiler.reapplyAppContext() here. + assertEquals( + 0, + profiler.snapshot()[fooOffset], + "Acceptance 3: clearSpanContext with no app value must leave foo at 0"); + + // Acceptance 4: nonZeroCount accuracy — cleared snapshot is considered empty so a new + // scope's save/restore does not leak a stale entry. + fooSetter.set("v1"); + assertNotEquals(0, profiler.snapshot()[fooOffset], "foo must be live after set"); + profiler.clearContextValue("foo"); + assertEquals(0, profiler.snapshot()[fooOffset], "foo must be 0 after clearContextValue"); + { + DatadogProfilingScope scope4 = new DatadogProfilingScope(profiler); + scope4.setContextValue("foo", "v2"); + assertNotEquals(0, profiler.snapshot()[fooOffset], "foo must be live inside scope4"); + scope4.close(); + } + assertEquals( + 0, + profiler.snapshot()[fooOffset], + "Acceptance 4: scope.close() must restore pre-scope empty state; nonZeroCount must not drift"); + + // Acceptance 5: clearAppContextSnapshot() fully resets per-thread state so no stale value + // leaks through. + fooSetter.set("leak-check"); + assertNotEquals(0, profiler.snapshot()[fooOffset], "foo must be live before reset"); + profiler.clearContextValue("foo"); + profiler.clearAppContextSnapshot(); + { + DatadogProfilingScope scope5 = new DatadogProfilingScope(profiler); + scope5.setContextValue("foo", "after-reset"); + assertNotEquals(0, profiler.snapshot()[fooOffset], "foo must be live inside scope5"); + scope5.close(); + } + profiler.setSpanContext(1L, 1L, 0L, 1L); + // Deliberately NO profiler.reapplyAppContext() here — fold-in suffices. + assertEquals( + 0, + profiler.snapshot()[fooOffset], + "Acceptance 5: after clearAppContextSnapshot, scope.close() restores empty state; no stale value leaks"); + + // Acceptance 6: restoreAppContext does not throw when scope stack is absent on the restoring + // thread. The guard is verified by the absence of an exception on the normal close path. + profiler.clearSpanContext(); + profiler.clearContextValue("foo"); + profiler.clearAppContextSnapshot(); + assertDoesNotThrow( + () -> { + DatadogProfilingScope scope6 = new DatadogProfilingScope(profiler); + scope6.setContextValue("foo", "guard-val"); + scope6.close(); + }, + "Acceptance 6: DatadogProfilingScope.close() must not throw even when scopeStack is absent"); } private static ConfigProvider configProvider( diff --git a/dd-java-agent/agent-profiling/profiling-scrubber/gradle.lockfile b/dd-java-agent/agent-profiling/profiling-scrubber/gradle.lockfile index c32048b6d86..f599a29cb8b 100644 --- a/dd-java-agent/agent-profiling/profiling-scrubber/gradle.lockfile +++ b/dd-java-agent/agent-profiling/profiling-scrubber/gradle.lockfile @@ -1,10 +1,11 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-profiling:profiling-scrubber:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -16,8 +17,8 @@ de.thetaphi:forbiddenapis:3.10=compileClasspath io.btrace:jafar-tools:0.16.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -40,10 +41,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -61,10 +62,13 @@ org.openjdk.jmc:common:8.1.0=testCompileClasspath,testRuntimeClasspath org.openjdk.jmc:flightrecorder:8.1.0=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.owasp.encoder:encoder:1.2.3=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/agent-profiling/profiling-testing/gradle.lockfile b/dd-java-agent/agent-profiling/profiling-testing/gradle.lockfile index 3b18266c411..c55dfd1c09c 100644 --- a/dd-java-agent/agent-profiling/profiling-testing/gradle.lockfile +++ b/dd-java-agent/agent-profiling/profiling-testing/gradle.lockfile @@ -1,17 +1,22 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-profiling:profiling-testing:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:mockwebserver:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okio:okio:1.15.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -49,11 +54,12 @@ org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.javadelight:delight-fileupload:0.0.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -67,10 +73,13 @@ org.mockito:mockito-core:4.4.0=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/agent-profiling/profiling-uploader/gradle.lockfile b/dd-java-agent/agent-profiling/profiling-uploader/gradle.lockfile index 033be6e0071..1cff37f122c 100644 --- a/dd-java-agent/agent-profiling/profiling-uploader/gradle.lockfile +++ b/dd-java-agent/agent-profiling/profiling-uploader/gradle.lockfile @@ -1,6 +1,8 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-profiling:profiling-uploader:dependencies --write-locks +at.yawk.lz4:lz4-java:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -15,21 +17,25 @@ com.fasterxml.jackson.core:jackson-core:2.20.0=testCompileClasspath,testRuntimeC com.fasterxml.jackson.core:jackson-databind:2.20.0=testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.20.0=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:mockwebserver:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -44,8 +50,8 @@ io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath javax.servlet:javax.servlet-api:4.0.1=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.12=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -69,11 +75,12 @@ org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testCompileClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.javadelight:delight-fileupload:0.0.5=testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -83,21 +90,23 @@ org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntime org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath -org.lz4:lz4-java:1.7.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.mockito:mockito-core:4.4.0=testCompileClasspath,testRuntimeClasspath org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt org.ow2.asm:asm-commons:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt org.ow2.asm:asm-tree:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt org.ow2.asm:asm:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/agent-profiling/profiling-uploader/src/main/java/com/datadog/profiling/uploader/ProfileUploader.java b/dd-java-agent/agent-profiling/profiling-uploader/src/main/java/com/datadog/profiling/uploader/ProfileUploader.java index 80afc760feb..86ea3f6e3e0 100644 --- a/dd-java-agent/agent-profiling/profiling-uploader/src/main/java/com/datadog/profiling/uploader/ProfileUploader.java +++ b/dd-java-agent/agent-profiling/profiling-uploader/src/main/java/com/datadog/profiling/uploader/ProfileUploader.java @@ -31,6 +31,7 @@ import datadog.trace.api.ProcessTags; import datadog.trace.api.git.GitInfo; import datadog.trace.api.git.GitInfoProvider; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.api.profiling.RecordingData; import datadog.trace.api.profiling.RecordingType; import datadog.trace.bootstrap.config.provider.ConfigProvider; @@ -134,10 +135,7 @@ public ProfileUploader(final Config config, final ConfigProvider configProvider) this(config, configProvider, new IOLogger(log), TERMINATION_TIMEOUT_SEC); } - /** - * Note that this method is only visible for testing and should not be used from outside this - * class. - */ + @VisibleForTesting ProfileUploader( final Config config, final ConfigProvider configProvider, @@ -443,10 +441,7 @@ private List tagsToList(final Map tags) { .collect(Collectors.toList()); } - /** - * Note that this method is only visible for testing and should not be used from outside this - * class. - */ + @VisibleForTesting OkHttpClient getClient() { return client; } diff --git a/dd-java-agent/agent-profiling/profiling-utils/gradle.lockfile b/dd-java-agent/agent-profiling/profiling-utils/gradle.lockfile index 104766c5945..6f259bccef4 100644 --- a/dd-java-agent/agent-profiling/profiling-utils/gradle.lockfile +++ b/dd-java-agent/agent-profiling/profiling-utils/gradle.lockfile @@ -1,10 +1,11 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-profiling:profiling-utils:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -15,8 +16,8 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -39,10 +40,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -57,10 +58,13 @@ org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspat org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/agent-profiling/src/main/java/com/datadog/profiling/agent/CompositeController.java b/dd-java-agent/agent-profiling/src/main/java/com/datadog/profiling/agent/CompositeController.java index 5cec160a754..236bf52b1ae 100644 --- a/dd-java-agent/agent-profiling/src/main/java/com/datadog/profiling/agent/CompositeController.java +++ b/dd-java-agent/agent-profiling/src/main/java/com/datadog/profiling/agent/CompositeController.java @@ -17,6 +17,7 @@ import datadog.trace.api.Config; import datadog.trace.api.Platform; import datadog.trace.api.config.ProfilingConfig; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.api.profiling.ProfilerFlareLogger; import datadog.trace.api.profiling.ProfilingSnapshot; import datadog.trace.api.profiling.RecordingData; @@ -50,7 +51,7 @@ public CompositeController(List controllers) { this.controllers = controllers; } - // visible for testing + @VisibleForTesting public List getControllers() { return Collections.unmodifiableList(controllers); } diff --git a/dd-java-agent/agent-profiling/src/main/java/com/datadog/profiling/agent/ProcessContext.java b/dd-java-agent/agent-profiling/src/main/java/com/datadog/profiling/agent/ProcessContext.java index 7eaf7f857e7..cb8fa303ad7 100644 --- a/dd-java-agent/agent-profiling/src/main/java/com/datadog/profiling/agent/ProcessContext.java +++ b/dd-java-agent/agent-profiling/src/main/java/com/datadog/profiling/agent/ProcessContext.java @@ -1,9 +1,11 @@ package com.datadog.profiling.agent; +import com.datadog.profiling.ddprof.DatadogProfiler; import datadog.libs.ddprof.DdprofLibraryLoader; import datadog.trace.api.Config; import datadog.trace.api.config.ProfilingConfig; import datadog.trace.bootstrap.config.provider.ConfigProvider; +import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -19,15 +21,21 @@ public static void register(ConfigProvider configProvider) { Throwable err = holder.getReasonNotLoaded(); if (err == null) { Config cfg = Config.get(); + // Publish the thread-context attribute keys together with the process context so the + // very first published context already carries the attribute_key_map. The order must + // match what DatadogProfiler passes to the native attributes= argument and the + // per-thread ContextSetter, so external readers can decode the thread-local record. + List attributeKeys = DatadogProfiler.getOrderedContextAttributes(configProvider); holder .getComponent() - .setProcessContext( + .initializeAllContext( cfg.getEnv(), cfg.getHostName(), cfg.getRuntimeId(), cfg.getServiceName(), cfg.getRuntimeVersion(), - cfg.getVersion()); + cfg.getVersion(), + attributeKeys.toArray(new String[0])); } else { log.warn("Failed to register process context for OTel profiler", err); } diff --git a/dd-java-agent/agent-profiling/src/main/java/com/datadog/profiling/agent/ScrubRecordingDataListener.java b/dd-java-agent/agent-profiling/src/main/java/com/datadog/profiling/agent/ScrubRecordingDataListener.java index 6e195a0b7a7..211d0e23c64 100644 --- a/dd-java-agent/agent-profiling/src/main/java/com/datadog/profiling/agent/ScrubRecordingDataListener.java +++ b/dd-java-agent/agent-profiling/src/main/java/com/datadog/profiling/agent/ScrubRecordingDataListener.java @@ -4,6 +4,7 @@ import com.datadog.profiling.scrubber.DefaultScrubDefinition; import com.datadog.profiling.scrubber.JfrScrubber; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.api.profiling.RecordingData; import datadog.trace.api.profiling.RecordingDataListener; import datadog.trace.api.profiling.RecordingInputStream; @@ -45,7 +46,7 @@ static RecordingDataListener wrap( this(delegate, scrubber, failOpen, null); } - // visible for testing + @VisibleForTesting ScrubRecordingDataListener( RecordingDataListener delegate, JfrScrubber scrubber, boolean failOpen, Path tempDir) { this.delegate = delegate; diff --git a/dd-java-agent/agent-profiling/src/test/java/com/datadog/profiling/agent/ProcessContextTest.java b/dd-java-agent/agent-profiling/src/test/java/com/datadog/profiling/agent/ProcessContextTest.java index 960a8da60bc..da718cf0a4e 100644 --- a/dd-java-agent/agent-profiling/src/test/java/com/datadog/profiling/agent/ProcessContextTest.java +++ b/dd-java-agent/agent-profiling/src/test/java/com/datadog/profiling/agent/ProcessContextTest.java @@ -1,6 +1,8 @@ package com.datadog.profiling.agent; import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.AdditionalMatchers.aryEq; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mockStatic; @@ -12,6 +14,8 @@ import datadog.trace.api.Config; import datadog.trace.api.config.ProfilingConfig; import datadog.trace.bootstrap.config.provider.ConfigProvider; +import java.util.Arrays; +import java.util.LinkedHashSet; import org.junit.jupiter.api.Test; import org.mockito.MockedStatic; @@ -24,6 +28,8 @@ void testRegisterSetsProcessContextValues() { eq(ProfilingConfig.PROFILING_PROCESS_CONTEXT_ENABLED), eq(ProfilingConfig.PROFILING_PROCESS_CONTEXT_ENABLED_DEFAULT))) .thenReturn(true); + when(configProvider.getSet(eq(ProfilingConfig.PROFILING_CONTEXT_ATTRIBUTES), any())) + .thenReturn(new LinkedHashSet<>(Arrays.asList("http.route", "db.system"))); Config config = mock(Config.class); when(config.getEnv()).thenReturn("test-env"); @@ -48,13 +54,14 @@ void testRegisterSetsProcessContextValues() { ProcessContext.register(configProvider); verify(otelContext) - .setProcessContext( + .initializeAllContext( eq("test-env"), eq("test-host"), eq("test-runtime-id"), eq("test-service"), eq("test-runtime-version"), - eq("test-version")); + eq("test-version"), + aryEq(new String[] {"http.route", "db.system"})); } } diff --git a/dd-java-agent/agent-tooling/gradle.lockfile b/dd-java-agent/agent-tooling/gradle.lockfile index 0cf6c9d0244..39cd2c185f3 100644 --- a/dd-java-agent/agent-tooling/gradle.lockfile +++ b/dd-java-agent/agent-tooling/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:agent-tooling:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath ch.qos.logback:logback-classic:1.2.13=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath @@ -10,7 +11,7 @@ ch.qos.logback:logback-core:1.2.3=jmhCompileClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath com.datadoghq.okio:okio:1.17.6=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath com.datadoghq:sketches-java:0.8.3=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath @@ -21,24 +22,27 @@ com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.3=jmhCompileClasspath, com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.3=jmhCompileClasspath,jmhRuntimeClasspath com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.3=jmhCompileClasspath,jmhRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath +com.github.jnr:jffi:1.3.15=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath com.github.jnr:jnr-constants:0.10.4=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,jmhCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs -com.google.errorprone:error_prone_annotations:2.0.12=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath +com.google.guava:failureaccess:1.0.3=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath com.google.guava:guava-testlib:20.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath -com.google.guava:guava:20.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath -com.google.re2j:re2j:1.7=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath +com.google.guava:guava:33.6.0-jre=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath +com.google.re2j:re2j:1.8=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath com.squareup.moshi:moshi:1.11.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath @@ -49,14 +53,14 @@ commons-io:commons-io:2.11.0=jmhRuntimeClasspath,testCompileClasspath,testRuntim commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath -io.sqreen:libsqreen:17.3.0=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath +io.sqreen:libsqreen:17.4.0=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=jmhCompileClasspath,jmhRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath junit:junit:4.8.2=testCompileClasspath,test_java11CompileClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath net.java.dev.jna:jna:5.8.0=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath net.sf.jopt-simple:jopt-simple:5.0.4=jmh,jmhCompileClasspath,jmhRuntimeClasspath @@ -89,12 +93,13 @@ org.glassfish:jakarta.el:3.0.3=jmhCompileClasspath,jmhRuntimeClasspath org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath org.hamcrest:hamcrest:3.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.jctools:jctools-core-jdk11:4.0.6=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath org.jctools:jctools-core:4.0.6=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath +org.jspecify:jspecify:1.0.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath @@ -116,15 +121,17 @@ org.openjdk.jmh:jmh-generator-reflection:1.37=jmh,jmhCompileClasspath,jmhRuntime org.opentest4j:opentest4j:1.3.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt org.ow2.asm:asm-commons:9.7.1=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt org.ow2.asm:asm-tree:9.7.1=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=jmhRuntimeClasspath,testRuntimeClasspath,test_java11RuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs org.ow2.asm:asm:9.0=jmh -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath +org.ow2.asm:asm:9.10.1=compileClasspath,jacocoAnt,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_java11CompileClasspath,test_java11RuntimeClasspath diff --git a/dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/bytebuddy/ExceptionHandlers.java b/dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/bytebuddy/ExceptionHandlers.java index 20099d76a37..5de9c8630ca 100644 --- a/dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/bytebuddy/ExceptionHandlers.java +++ b/dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/bytebuddy/ExceptionHandlers.java @@ -7,6 +7,7 @@ import net.bytebuddy.asm.Advice.ExceptionHandler; import net.bytebuddy.implementation.Implementation; import net.bytebuddy.implementation.bytecode.StackManipulation; +import net.bytebuddy.implementation.bytecode.constant.TextConstant; import net.bytebuddy.jar.asm.Label; import net.bytebuddy.jar.asm.MethodVisitor; import net.bytebuddy.jar.asm.Opcodes; @@ -20,118 +21,155 @@ public class ExceptionHandlers { // Bootstrap ExceptionHandler.class will always be resolvable, so we'll use it in the log name private static final String HANDLER_NAME = ExceptionLogger.class.getName().replace('.', '/'); - private static final ExceptionHandler EXCEPTION_STACK_HANDLER = - new ExceptionHandler.Simple( - new StackManipulation() { - // Pops one Throwable off the stack. Maxes the stack to at least 3. - private final Size size = new StackManipulation.Size(-1, 3); - private final boolean appSecEnabled = - InstrumenterConfig.get().getAppSecActivation() != ProductActivation.FULLY_DISABLED; - - @Override - public boolean isValid() { - return true; - } - - @Override - public Size apply(final MethodVisitor mv, final Implementation.Context context) { - final String name = context.getInstrumentedType().getName(); - final boolean exitOnFailure = InstrumenterConfig.get().isInternalExitOnFailure(); - final String logMethod = exitOnFailure ? "error" : "debug"; - - // Writes the following bytecode if exitOnFailure is false: - // - // BlockingExceptionHandler.rethrowIfBlockingException(t); - // try { - // InstrumentationErrors.incrementErrorCount(); - // org.slf4j.LoggerFactory.getLogger((Class)ExceptionLogger.class) - // .debug("Failed to handle exception in instrumentation for ...", t); - // } catch (Throwable t2) { - // } - // - // And the following bytecode if exitOnFailure is true: - // - // BlockingExceptionHandler.rethrowIfBlockingException(t); - // try { - // InstrumentationErrors.incrementErrorCount(); - // org.slf4j.LoggerFactory.getLogger((Class)ExceptionLogger.class) - // .error("Failed to handle exception in instrumentation for ...", t); - // System.exit(1); - // } catch (Throwable t2) { - // } - // - final Label logStart = new Label(); - final Label logEnd = new Label(); - final Label eatException = new Label(); - final Label handlerExit = new Label(); - - // Frames are only meaningful for class files in version 6 or later. - final boolean frames = - context.getClassFileVersion().isAtLeast(ClassFileVersion.JAVA_V6); - - if (appSecEnabled) { - // rethrow blocking exceptions - // stack: (top) throwable - mv.visitMethodInsn( - Opcodes.INVOKESTATIC, - "datadog/trace/bootstrap/blocking/BlockingExceptionHandler", - "rethrowIfBlockingException", - "(Ljava/lang/Throwable;)Ljava/lang/Throwable;"); - } - - mv.visitTryCatchBlock(logStart, logEnd, eatException, "java/lang/Throwable"); - mv.visitLabel(logStart); - // invoke incrementAndGet on our exception counter - mv.visitMethodInsn( - Opcodes.INVOKESTATIC, - "datadog/trace/bootstrap/InstrumentationErrors", - "incrementErrorCount", - "()V"); - // stack: (top) throwable - mv.visitLdcInsn(Type.getType("L" + HANDLER_NAME + ";")); - mv.visitMethodInsn( - Opcodes.INVOKESTATIC, - LOG_FACTORY_NAME, - "getLogger", - "(Ljava/lang/Class;)L" + LOGGER_NAME + ";", - false); - mv.visitInsn(Opcodes.SWAP); // stack: (top) throwable,logger - mv.visitLdcInsn("Failed to handle exception in instrumentation for " + name); - mv.visitInsn(Opcodes.SWAP); // stack: (top) throwable,string,logger - mv.visitMethodInsn( - Opcodes.INVOKEINTERFACE, - LOGGER_NAME, - logMethod, - "(Ljava/lang/String;Ljava/lang/Throwable;)V", - true); - - if (exitOnFailure) { - mv.visitInsn(Opcodes.ICONST_1); - mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/System", "exit", "(I)V", false); - } - mv.visitLabel(logEnd); - mv.visitJumpInsn(Opcodes.GOTO, handlerExit); - - // if the runtime can't reach our ExceptionHandler or logger, - // silently eat the exception - mv.visitLabel(eatException); - if (frames) { - mv.visitFrame(Opcodes.F_SAME1, 0, null, 1, new Object[] {"java/lang/Throwable"}); - } - mv.visitInsn(Opcodes.POP); - // mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/lang/Throwable", - // "printStackTrace", "()V", false); - - mv.visitLabel(handlerExit); - if (frames) { - mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null); - } - - return size; - } - }); - - public static ExceptionHandler defaultExceptionHandler() { - return EXCEPTION_STACK_HANDLER; + // Shared bytecode that turns the [throwable, adviceName] stack left by the TextConstant + // prefix into a logged + optionally swallowed exception. + private static final StackManipulation EXCEPTION_STACK_MANIPULATION = + new StackManipulation() { + // Pops the throwable and the advice-name String off the stack. + // Peak growth above the pair on entry is +2 (during message-building LDCs). + private final Size size = new StackManipulation.Size(-2, 2); + private final boolean appSecEnabled = + InstrumenterConfig.get().getAppSecActivation() != ProductActivation.FULLY_DISABLED; + private final boolean detailedErrors = + InstrumenterConfig.get().isDetailedInstrumentationErrors(); + + @Override + public boolean isValid() { + return true; + } + + @Override + public Size apply(final MethodVisitor mv, final Implementation.Context context) { + final String instrumentedTypeName = context.getInstrumentedType().getName(); + final boolean exitOnFailure = InstrumenterConfig.get().isInternalExitOnFailure(); + final String logMethod = exitOnFailure ? "error" : "debug"; + + // On entry the stack is: (bottom) throwable, adviceName (top) + // — adviceName was pushed by the preceding TextConstant. + // + // Emits the following Java-equivalent code when exitOnFailure is false: + // + // BlockingExceptionHandler.rethrowIfBlockingException(t); + // try { + // InstrumentationErrors.recordError(); + // org.slf4j.LoggerFactory.getLogger((Class) ExceptionLogger.class) + // .debug("Failed to handle exception in instrumentation for (" + adviceName + + // ")", t); + // } catch (Throwable t2) { + // } + // + // and the same with .error(...) followed by System.exit(1) when exitOnFailure is true. + final Label logStart = new Label(); + final Label logEnd = new Label(); + final Label eatException = new Label(); + final Label handlerExit = new Label(); + + // Frames are only meaningful for class files in version 6 or later. + final boolean frames = context.getClassFileVersion().isAtLeast(ClassFileVersion.JAVA_V6); + + if (appSecEnabled) { + // Need throwable on top for rethrowIfBlockingException. + // stack: (top) adviceName, throwable -> top throwable + mv.visitInsn(Opcodes.SWAP); + mv.visitMethodInsn( + Opcodes.INVOKESTATIC, + "datadog/trace/bootstrap/blocking/BlockingExceptionHandler", + "rethrowIfBlockingException", + "(Ljava/lang/Throwable;)Ljava/lang/Throwable;", + false); + // restore: (top) throwable, adviceName -> top adviceName + mv.visitInsn(Opcodes.SWAP); + } + + mv.visitTryCatchBlock(logStart, logEnd, eatException, "java/lang/Throwable"); + mv.visitLabel(logStart); + // record instrumentation error + if (detailedErrors) { + // recordError(Throwable) needs throwable on top, then we restore. + mv.visitInsn(Opcodes.SWAP); + mv.visitMethodInsn( + Opcodes.INVOKESTATIC, + "datadog/trace/bootstrap/InstrumentationErrors", + "recordError", + "(Ljava/lang/Throwable;)Ljava/lang/Throwable;", + false); + mv.visitInsn(Opcodes.SWAP); + } else { + mv.visitMethodInsn( + Opcodes.INVOKESTATIC, + "datadog/trace/bootstrap/InstrumentationErrors", + "recordError", + "()V", + false); + } + + // Build the log message: + // "Failed to handle exception in instrumentation for - " + adviceName + // is a generation-time constant baked into the prefix LDC. + // stack: (top) adviceName, throwable + mv.visitLdcInsn( + "Failed to handle exception in instrumentation for " + instrumentedTypeName + " - "); + // stack: prefix (top), adviceName, throwable + mv.visitInsn(Opcodes.SWAP); + // stack: adviceName (top), prefix, throwable + mv.visitMethodInsn( + Opcodes.INVOKEVIRTUAL, + "java/lang/String", + "concat", + "(Ljava/lang/String;)Ljava/lang/String;", + false); + // stack: message (top), throwable + mv.visitInsn(Opcodes.SWAP); + // stack: throwable(top), message + + mv.visitLdcInsn(Type.getType("L" + HANDLER_NAME + ";")); + mv.visitMethodInsn( + Opcodes.INVOKESTATIC, + LOG_FACTORY_NAME, + "getLogger", + "(Ljava/lang/Class;)L" + LOGGER_NAME + ";", + false); + // stack: logger (top), throwable, message + mv.visitInsn(Opcodes.DUP_X2); + // stack: logger (top), throwable, message, logger + mv.visitInsn(Opcodes.POP); + // stack: throwable (top), message, logger + mv.visitMethodInsn( + Opcodes.INVOKEINTERFACE, + LOGGER_NAME, + logMethod, + "(Ljava/lang/String;Ljava/lang/Throwable;)V", + true); + + if (exitOnFailure) { + mv.visitInsn(Opcodes.ICONST_1); + mv.visitMethodInsn(Opcodes.INVOKESTATIC, "java/lang/System", "exit", "(I)V", false); + } + mv.visitLabel(logEnd); + mv.visitJumpInsn(Opcodes.GOTO, handlerExit); + + // if the runtime can't reach our ExceptionHandler or logger, + // silently eat the exception + mv.visitLabel(eatException); + if (frames) { + mv.visitFrame(Opcodes.F_SAME1, 0, null, 1, new Object[] {"java/lang/Throwable"}); + } + mv.visitInsn(Opcodes.POP); + // mv.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "java/lang/Throwable", + // "printStackTrace", "()V", false); + + mv.visitLabel(handlerExit); + if (frames) { + mv.visitFrame(Opcodes.F_SAME, 0, null, 0, null); + } + + return size; + } + }; + + public static ExceptionHandler exceptionHandlerFor(final String adviceClassName) { + return new ExceptionHandler.Simple( + new StackManipulation.Compound( + new TextConstant(adviceClassName), EXCEPTION_STACK_MANIPULATION)); } } diff --git a/dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/iast/TaintableEnumeration.java b/dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/iast/TaintableEnumeration.java index f1d67e3a8a0..bf53c00c341 100644 --- a/dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/iast/TaintableEnumeration.java +++ b/dd-java-agent/agent-tooling/src/main/java/datadog/trace/agent/tooling/iast/TaintableEnumeration.java @@ -3,8 +3,8 @@ import datadog.trace.api.iast.IastContext; import datadog.trace.api.iast.propagation.PropagationModule; import datadog.trace.util.stacktrace.StackUtils; -import edu.umd.cs.findbugs.annotations.NonNull; import java.util.Enumeration; +import javax.annotation.Nonnull; import javax.annotation.Nullable; public class TaintableEnumeration implements Enumeration { @@ -25,8 +25,8 @@ public class TaintableEnumeration implements Enumeration { private TaintableEnumeration( final IastContext ctx, - @NonNull final Enumeration delegate, - @NonNull final PropagationModule module, + @Nonnull final Enumeration delegate, + @Nonnull final PropagationModule module, final byte origin, @Nullable final CharSequence name, final boolean useValueAsName) { @@ -78,8 +78,8 @@ private static boolean nonTaintableEnumerationStack(final StackTraceElement elem public static Enumeration wrap( final IastContext ctx, - @NonNull final Enumeration delegate, - @NonNull final PropagationModule module, + @Nonnull final Enumeration delegate, + @Nonnull final PropagationModule module, final byte origin, @Nullable final CharSequence name) { return new TaintableEnumeration(ctx, delegate, module, origin, name, false); @@ -87,8 +87,8 @@ public static Enumeration wrap( public static Enumeration wrap( final IastContext ctx, - @NonNull final Enumeration delegate, - @NonNull final PropagationModule module, + @Nonnull final Enumeration delegate, + @Nonnull final PropagationModule module, final byte origin, boolean useValueAsName) { return new TaintableEnumeration(ctx, delegate, module, origin, null, useValueAsName); diff --git a/dd-java-agent/agent-tooling/src/test/groovy/datadog/trace/agent/test/BaseExceptionHandlerTest.groovy b/dd-java-agent/agent-tooling/src/test/groovy/datadog/trace/agent/test/BaseExceptionHandlerTest.groovy index 0c040e3b8f9..5f6980e40d1 100644 --- a/dd-java-agent/agent-tooling/src/test/groovy/datadog/trace/agent/test/BaseExceptionHandlerTest.groovy +++ b/dd-java-agent/agent-tooling/src/test/groovy/datadog/trace/agent/test/BaseExceptionHandlerTest.groovy @@ -51,21 +51,21 @@ abstract class BaseExceptionHandlerTest extends DDSpecification { .transform( new AgentBuilder.Transformer.ForAdvice() .with(new AgentBuilder.LocationStrategy.Simple(ClassFileLocator.ForClassLoader.of(BadAdvice.getClassLoader()))) - .withExceptionHandler(ExceptionHandlers.defaultExceptionHandler()) + .withExceptionHandler(ExceptionHandlers.exceptionHandlerFor(BadAdvice.getName())) .advice( isMethod().and(named("isInstrumented")), BadAdvice.getName())) .transform( new AgentBuilder.Transformer.ForAdvice() .with(new AgentBuilder.LocationStrategy.Simple(ClassFileLocator.ForClassLoader.of(BadAdvice.getClassLoader()))) - .withExceptionHandler(ExceptionHandlers.defaultExceptionHandler()) + .withExceptionHandler(ExceptionHandlers.exceptionHandlerFor(BadAdvice.NoOpAdvice.getName())) .advice( isMethod().and(namedOneOf("smallStack", "largeStack")), BadAdvice.NoOpAdvice.getName())) .transform( new AgentBuilder.Transformer.ForAdvice() .with(new AgentBuilder.LocationStrategy.Simple(ClassFileLocator.ForClassLoader.of(BadAdvice.getClassLoader()))) - .withExceptionHandler(ExceptionHandlers.defaultExceptionHandler()) + .withExceptionHandler(ExceptionHandlers.exceptionHandlerFor(BlockingExceptionAdvice.getName())) .advice( isMethod().and(named("blockingException")), BlockingExceptionAdvice.getName())) @@ -117,7 +117,7 @@ abstract class BaseExceptionHandlerTest extends DDSpecification { // Make sure the log event came from our error handler. // If the log message changes in the future, it's fine to just // update the test's hardcoded message - testAppender.list.get(testAppender.list.size() - 1).getMessage().startsWith("Failed to handle exception in instrumentation for") + testAppender.list.get(testAppender.list.size() - 1).getMessage() == "Failed to handle exception in instrumentation for ${SomeClass.getName()} - ${BadAdvice.getName()}" exitStatus.get() == expectedFailureExitStatus() } diff --git a/dd-java-agent/agent-tooling/src/test/groovy/datadog/trace/agent/tooling/csi/CallSiteInstrumentationTest.groovy b/dd-java-agent/agent-tooling/src/test/groovy/datadog/trace/agent/tooling/csi/CallSiteInstrumentationTest.groovy index 661d532966e..f76c9dff98e 100644 --- a/dd-java-agent/agent-tooling/src/test/groovy/datadog/trace/agent/tooling/csi/CallSiteInstrumentationTest.groovy +++ b/dd-java-agent/agent-tooling/src/test/groovy/datadog/trace/agent/tooling/csi/CallSiteInstrumentationTest.groovy @@ -162,7 +162,7 @@ class CallSiteInstrumentationTest extends BaseCallSiteTest { }) ) .make() - .load(Thread.currentThread().contextClassLoader, ClassLoadingStrategy.Default.INJECTION) + .load(Thread.currentThread().contextClassLoader, ClassLoadingStrategy.Default.WRAPPER) return Tuple.tuple(newType.loaded, newType.bytes) } diff --git a/dd-java-agent/appsec/appsec-test-fixtures/build.gradle b/dd-java-agent/appsec/appsec-test-fixtures/build.gradle index a7f64623b36..f053f31b066 100644 --- a/dd-java-agent/appsec/appsec-test-fixtures/build.gradle +++ b/dd-java-agent/appsec/appsec-test-fixtures/build.gradle @@ -1,5 +1,8 @@ +plugins { + id 'dd-trace-java.version-file' +} + apply from: "$rootDir/gradle/java.gradle" -apply from: "$rootDir/gradle/version.gradle" dependencies { api project(':dd-java-agent:appsec') diff --git a/dd-java-agent/appsec/appsec-test-fixtures/gradle.lockfile b/dd-java-agent/appsec/appsec-test-fixtures/gradle.lockfile index 7cd9762e156..67caafc7977 100644 --- a/dd-java-agent/appsec/appsec-test-fixtures/gradle.lockfile +++ b/dd-java-agent/appsec/appsec-test-fixtures/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:appsec:appsec-test-fixtures:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=compileClasspath,runtimeClasspath,testCompile com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=runtimeClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=runtimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=compileClasspath,runtimeClasspath,testCompileClassp commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=runtimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=runtimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=runtimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=runtimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=runtimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -70,12 +75,13 @@ org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=runtimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=runtimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=runtimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -93,14 +99,14 @@ org.objenesis:objenesis:3.3=compileClasspath,testCompileClasspath,testRuntimeCla org.opentest4j:opentest4j:1.3.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-commons:9.9.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9.1=runtimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-commons:9.10.1=jacocoAnt,runtimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt,runtimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.10.1=compileClasspath,jacocoAnt,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/appsec/appsec-test-fixtures/src/main/groovy/com/datadog/appsec/AppSecInactiveHttpServerTest.groovy b/dd-java-agent/appsec/appsec-test-fixtures/src/main/groovy/com/datadog/appsec/AppSecInactiveHttpServerTest.groovy index 140893ec525..37a0d56f7fa 100644 --- a/dd-java-agent/appsec/appsec-test-fixtures/src/main/groovy/com/datadog/appsec/AppSecInactiveHttpServerTest.groovy +++ b/dd-java-agent/appsec/appsec-test-fixtures/src/main/groovy/com/datadog/appsec/AppSecInactiveHttpServerTest.groovy @@ -139,8 +139,13 @@ abstract class AppSecInactiveHttpServerTest extends WithHttpServer { } } + protected boolean supportsMultipart() { + true + } + void multipart() { setup: + assumeTrue supportsMultipart() def body = new MultipartBody.Builder() .setType(MultipartBody.FORM) .addFormDataPart('a', 'x') diff --git a/dd-java-agent/appsec/build.gradle b/dd-java-agent/appsec/build.gradle index 2d1fb0abffc..e7428aa1b12 100644 --- a/dd-java-agent/appsec/build.gradle +++ b/dd-java-agent/appsec/build.gradle @@ -1,14 +1,12 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar -import groovy.json.JsonOutput -import groovy.json.JsonSlurper plugins { id 'com.gradleup.shadow' id 'me.champeau.jmh' + id 'dd-trace-java.version-file' } apply from: "$rootDir/gradle/java.gradle" -apply from: "$rootDir/gradle/version.gradle" apply from: "$rootDir/gradle/tries.gradle" dependencies { @@ -17,10 +15,11 @@ dependencies { implementation project(':communication') implementation project(':products:metrics:metrics-api') implementation project(':telemetry') - implementation group: 'io.sqreen', name: 'libsqreen', version: '17.3.0' + implementation group: 'io.sqreen', name: 'libsqreen', version: '17.4.0' implementation libs.moshi compileOnly project(':dd-java-agent:agent-bootstrap') + compileOnly libs.bytebuddy // for net.bytebuddy.jar.asm.* used by ScaReachabilityTransformer testImplementation project(':dd-java-agent:agent-bootstrap') testImplementation libs.bytebuddy testImplementation project(':remote-config:remote-config-core') @@ -28,6 +27,9 @@ dependencies { testImplementation group: 'com.flipkart.zjsonpatch', name: 'zjsonpatch', version: '0.4.11' testImplementation libs.logback.classic testImplementation libs.jackson.databind + + + testImplementation libs.bundles.mockito } tasks.named("compileJava", JavaCompile) { @@ -47,13 +49,9 @@ tasks.named("jar", Jar) { archiveClassifier = 'unbundled' } -tasks.named("processResources", ProcessResources) { - doLast { - fileTree(dir: outputs.files.asPath, includes: ['**/*.json']).each { - it.text = JsonOutput.toJson(new JsonSlurper().parse(it)) - } - } -} +// SCA Reachability: symbol database download is handled by the sca-enrichments plugin. +// This is a temporary approach; symbols will be delivered via Remote Config in the future. +apply plugin: 'dd-trace-java.sca-enrichments' jmh { jmhVersion = libs.versions.jmh.get() @@ -91,7 +89,9 @@ ext { 'com.datadog.appsec.config.AppSecFeatures.AutoUserInstrum', 'com.datadog.appsec.AppSecModule.AppSecModuleActivationException', 'com.datadog.appsec.event.ReplaceableEventProducerService', + 'com.datadog.appsec.event.data.IntrospectionExcludedTypesTrie', 'com.datadog.appsec.api.security.ApiSecuritySampler.NoOp', + 'com.datadog.appsec.sca.ScaStackExclusionTrie', ] excludedClassesBranchCoverage = [ 'com.datadog.appsec.gateway.GatewayBridge', diff --git a/dd-java-agent/appsec/gradle.lockfile b/dd-java-agent/appsec/gradle.lockfile index a6173973c48..dd57722ea27 100644 --- a/dd-java-agent/appsec/gradle.lockfile +++ b/dd-java-agent/appsec/gradle.lockfile @@ -1,13 +1,14 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:appsec:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.fasterxml.jackson.core:jackson-databind:2.20.0=jmhRuntimeClasspath,testCompi com.fasterxml.jackson:jackson-bom:2.20.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.flipkart.zjsonpatch:zjsonpatch:0.4.11=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,jmhCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -39,10 +40,10 @@ commons-io:commons-io:2.11.0=jmhRuntimeClasspath,testCompileClasspath,testRuntim commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=jmhRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.jopt-simple:jopt-simple:5.0.4=jmh,jmhCompileClasspath,jmhRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc @@ -68,10 +69,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=jmhRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -81,7 +82,8 @@ org.junit.platform:junit-platform-engine:1.14.1=jmhRuntimeClasspath,testCompileC org.junit.platform:junit-platform-launcher:1.14.1=jmhRuntimeClasspath,testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.mockito:mockito-core:4.4.0=jmhRuntimeClasspath,testRuntimeClasspath +org.mockito:mockito-core:4.4.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-junit-jupiter:4.4.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.openjdk.jmh:jmh-core:1.37=jmh,jmhCompileClasspath,jmhRuntimeClasspath org.openjdk.jmh:jmh-generator-asm:1.37=jmh,jmhCompileClasspath,jmhRuntimeClasspath @@ -90,15 +92,18 @@ org.openjdk.jmh:jmh-generator-reflection:1.37=jmh,jmhCompileClasspath,jmhRuntime org.opentest4j:opentest4j:1.3.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt org.ow2.asm:asm-commons:9.7.1=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt org.ow2.asm:asm-tree:9.7.1=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs org.ow2.asm:asm:9.0=jmh,jmhCompileClasspath +org.ow2.asm:asm:9.10.1=jacocoAnt org.ow2.asm:asm:9.7.1=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/appsec/src/main/java/com/datadog/appsec/config/AppSecConfigServiceImpl.java b/dd-java-agent/appsec/src/main/java/com/datadog/appsec/config/AppSecConfigServiceImpl.java index aaa177335a7..dc450baeff1 100644 --- a/dd-java-agent/appsec/src/main/java/com/datadog/appsec/config/AppSecConfigServiceImpl.java +++ b/dd-java-agent/appsec/src/main/java/com/datadog/appsec/config/AppSecConfigServiceImpl.java @@ -320,15 +320,25 @@ private void handleWafUpdateResultReport(String configKey, Map r } } } catch (InvalidRuleSetException e) { - log.debug( + log.warn( "Invalid rule during waf config update for config key {}: {}", configKey, e.wafDiagnostics); if (e.wafDiagnostics.getNumConfigError() > 0) { WafMetricCollector.get().addWafConfigError(e.wafDiagnostics.getNumConfigError()); } - // TODO: Propagate diagostics back to remote config apply_error - + // TODO: Propagate diagnostics back to remote config apply_error + if (e.wafDiagnostics.rulesetVersion != null + && !e.wafDiagnostics.rulesetVersion.isEmpty() + && (!defaultConfigActivated || currentRuleVersion == null)) { + currentRuleVersion = e.wafDiagnostics.rulesetVersion; + if (!e.wafDiagnostics.rules.getLoaded().isEmpty()) { + statsReporter.setRulesVersion(currentRuleVersion); + } + if (modulesToUpdateVersionIn != null) { + modulesToUpdateVersionIn.forEach(module -> module.setRuleVersion(currentRuleVersion)); + } + } initReporter.setReportForPublication(e.wafDiagnostics); throw new RuntimeException(e); } catch (UnclassifiedWafException e) { diff --git a/dd-java-agent/appsec/src/main/java/com/datadog/appsec/ddwaf/WAFModule.java b/dd-java-agent/appsec/src/main/java/com/datadog/appsec/ddwaf/WAFModule.java index 00295e0a64c..a7aac0a6f98 100644 --- a/dd-java-agent/appsec/src/main/java/com/datadog/appsec/ddwaf/WAFModule.java +++ b/dd-java-agent/appsec/src/main/java/com/datadog/appsec/ddwaf/WAFModule.java @@ -360,7 +360,6 @@ public void onDataAvailable( if (gwCtx.isRasp) { reqCtx.setRaspMatched(true); - WafMetricCollector.get().raspRuleMatch(gwCtx.raspRuleType); } String securityResponseId = null; @@ -375,13 +374,17 @@ public void onDataAvailable( securityResponseId = (String) actionInfo.parameters.get("security_response_id"); Flow.Action.RequestBlockingAction rba = createBlockRequestAction(actionInfo, reqCtx, gwCtx.isRasp, securityResponseId); - flow.setAction(rba); + if (rba != null) { + flow.setAction(rba); + } } else if ("redirect_request".equals(actionInfo.type)) { // Extract security_response_id from action parameters for use in triggers securityResponseId = (String) actionInfo.parameters.get("security_response_id"); Flow.Action.RequestBlockingAction rba = createRedirectRequestAction(actionInfo, reqCtx, gwCtx.isRasp, securityResponseId); - flow.setAction(rba); + if (rba != null) { + flow.setAction(rba); + } } else if ("generate_stack".equals(actionInfo.type)) { if (Config.get().isAppSecStackTraceEnabled()) { String stackId = (String) actionInfo.parameters.get("stack_id"); @@ -417,6 +420,9 @@ public void onDataAvailable( } } } + if (gwCtx.isRasp) { + WafMetricCollector.get().raspRuleMatch(gwCtx.raspRuleType, flow.isBlocking()); + } Collection events = buildEvents(resultWithData, securityResponseId); boolean isThrottled = reqCtx.isThrottled(rateLimiter); diff --git a/dd-java-agent/appsec/src/main/java/com/datadog/appsec/gateway/AppSecRequestContext.java b/dd-java-agent/appsec/src/main/java/com/datadog/appsec/gateway/AppSecRequestContext.java index 860f3119ae4..3639ce80c5e 100644 --- a/dd-java-agent/appsec/src/main/java/com/datadog/appsec/gateway/AppSecRequestContext.java +++ b/dd-java-agent/appsec/src/main/java/com/datadog/appsec/gateway/AppSecRequestContext.java @@ -11,6 +11,7 @@ import com.datadog.ddwaf.WafHandle; import com.datadog.ddwaf.WafMetrics; import datadog.trace.api.Config; +import datadog.trace.api.appsec.AppSecContext; import datadog.trace.api.endpoint.EndpointResolver; import datadog.trace.api.http.StoredBodySupplier; import datadog.trace.api.internal.TraceSegment; @@ -45,7 +46,7 @@ // TODO: different methods to be called by different parts perhaps splitting it would make sense // or at least create separate interfaces @SuppressFBWarnings("AT_STALE_THREAD_WRITE_OF_PRIMITIVE") -public class AppSecRequestContext implements DataBundle, Closeable { +public class AppSecRequestContext implements DataBundle, Closeable, AppSecContext { private static final Logger log = LoggerFactory.getLogger(AppSecRequestContext.class); public static final int DEFAULT_EXTENDED_DATA_COLLECTION_MAX_HEADERS = 50; @@ -168,6 +169,7 @@ public class AppSecRequestContext implements DataBundle, Closeable { private volatile boolean wafTruncated; private volatile boolean wafRequestBlockFailure; private volatile boolean wafRateLimited; + private volatile boolean wafRequestExcluded; private volatile int wafTimeouts; private volatile int raspTimeouts; @@ -287,6 +289,15 @@ public boolean isWafRateLimited() { return wafRateLimited; } + // placeholder: libddwaf does not yet expose exclusion filter results + public void setWafRequestExcluded() { + wafRequestExcluded = true; + } + + public boolean isWafRequestExcluded() { + return wafRequestExcluded; + } + public void increaseWafTimeouts() { WAF_TIMEOUTS_UPDATER.incrementAndGet(this); } diff --git a/dd-java-agent/appsec/src/main/java/com/datadog/appsec/gateway/GatewayBridge.java b/dd-java-agent/appsec/src/main/java/com/datadog/appsec/gateway/GatewayBridge.java index 22b1b09d1db..a7b04c017e2 100644 --- a/dd-java-agent/appsec/src/main/java/com/datadog/appsec/gateway/GatewayBridge.java +++ b/dd-java-agent/appsec/src/main/java/com/datadog/appsec/gateway/GatewayBridge.java @@ -1057,7 +1057,8 @@ private NoopFlow onRequestEnded(RequestContext ctx_, IGSpanInfo spanInfo) { ctx.getWafTimeouts() > 0, // wafTimeout, ctx.isWafRequestBlockFailure(), // blockFailure, ctx.isWafRateLimited(), // rateLimited, - ctx.isWafTruncated() // inputTruncated + ctx.isWafTruncated(), // inputTruncated + ctx.isWafRequestExcluded() // requestExcluded ); } diff --git a/dd-java-agent/appsec/src/main/java/com/datadog/appsec/sca/ScaCveDatabase.java b/dd-java-agent/appsec/src/main/java/com/datadog/appsec/sca/ScaCveDatabase.java new file mode 100644 index 00000000000..2c0446e888d --- /dev/null +++ b/dd-java-agent/appsec/src/main/java/com/datadog/appsec/sca/ScaCveDatabase.java @@ -0,0 +1,186 @@ +package com.datadog.appsec.sca; + +import com.squareup.moshi.Json; +import com.squareup.moshi.JsonAdapter; +import com.squareup.moshi.Moshi; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.Reader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.annotation.Nullable; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Loads {@code sca_cves.json} from the classpath and builds the runtime index used by {@link + * ScaReachabilityTransformer}. + * + *

The primary index maps JVM internal class names (slashes) to the list of {@link ScaEntry} + * objects that reference them. The transformer does an O(1) lookup on every class load using this + * map. + */ +public final class ScaCveDatabase { + + private static final Logger log = LoggerFactory.getLogger(ScaCveDatabase.class); + private static final String RESOURCE_PATH = "/sca_cves.json"; + private static final int READ_BUFFER_SIZE = 8192; + + private final Map> index; + + private ScaCveDatabase(Map> index) { + this.index = index; + } + + /** + * Loads and parses {@code sca_cves.json} from the classpath. + * + * @return a populated database, or an empty one if the resource is missing or malformed + */ + public static ScaCveDatabase load() { + InputStream stream = ScaCveDatabase.class.getResourceAsStream(RESOURCE_PATH); + if (stream == null) { + log.info( + "SCA Reachability: {} not found on classpath - no vulnerabilities will be tracked", + RESOURCE_PATH); + return new ScaCveDatabase(Collections.emptyMap()); + } + // "UTF-8" string literal - java.nio.* is forbidden during premain + try (InputStreamReader reader = new InputStreamReader(stream, "UTF-8")) { + return parse(reader); + } catch (Exception e) { + log.error( + "SCA Reachability: failed to parse {} - no vulnerabilities will be tracked", + RESOURCE_PATH, + e); + return new ScaCveDatabase(Collections.emptyMap()); + } + } + + static ScaCveDatabase parse(Reader reader) throws IOException { + Moshi moshi = new Moshi.Builder().build(); + JsonAdapter adapter = moshi.adapter(DatabaseJson.class); + + String content = readAll(reader); + DatabaseJson root = adapter.fromJson(content); + if (root == null || root.entries == null) { + return new ScaCveDatabase(Collections.emptyMap()); + } + + Map> index = new HashMap<>(); + int entryCount = 0; + + for (EntryJson e : root.entries) { + ScaEntry entry = toScaEntry(e); + if (entry == null) { + continue; + } + entryCount++; + // Index once per unique class name: an entry with multiple symbols for the same class + // (e.g. Yaml.load + Yaml.loadAll) must appear only once in the list, otherwise + // processClass iterates it twice and injects duplicate bytecode callbacks. + Set seen = new HashSet<>(); + for (ScaSymbol symbol : entry.symbols()) { + if (seen.add(symbol.className())) { + index.computeIfAbsent(symbol.className(), k -> new ArrayList<>()).add(entry); + } + } + } + + log.debug( + "SCA Reachability: loaded {} entries, {} unique class symbols", entryCount, index.size()); + return new ScaCveDatabase(Collections.unmodifiableMap(index)); + } + + @Nullable + private static ScaEntry toScaEntry(EntryJson e) { + if (e.vulnId == null || e.artifact == null || e.versionRanges == null || e.symbols == null) { + log.debug("SCA Reachability: skipping malformed entry: {}", e); + return null; + } + List symbols = new ArrayList<>(e.symbols.size()); + for (SymbolJson s : e.symbols) { + if (s.className == null) { + continue; + } + if (s.method == null) { + log.debug("SCA Reachability: skipping symbol with null method in entry {}", e.vulnId); + continue; + } + symbols.add(new ScaSymbol(s.className, s.method)); + } + if (symbols.isEmpty()) return null; + return new ScaEntry(e.vulnId, e.artifact, e.versionRanges, symbols); + } + + /** + * Returns the entries associated with the given JVM internal class name, or null if none. + * + *

TODO: consider replacing this HashMap with a trie (e.g. {@code ClassNameTrie.Builder}) if + * the database grows significantly. {@code HashMap} lookup for {@code String} keys is O(length) + * on the first call for a new instance because {@code String.hashCode()} is not yet cached; a + * trie is also O(length) but can exit early on a prefix mismatch, which is the common case (most + * loaded classes are not in the CVE database). The project already has a runtime-constructable + * {@code ClassNameTrie.Builder} used by the debugger, so the infrastructure exists. Note that the + * current trie infrastructure uses prefix/glob patterns, so exact-match semantics would need to + * be verified before adopting it here. + */ + public List entriesForClass(String internalClassName) { + return index.get(internalClassName); + } + + public boolean isEmpty() { + return index.isEmpty(); + } + + public int size() { + return index.size(); + } + + private static String readAll(Reader reader) throws IOException { + StringBuilder sb = new StringBuilder(); + char[] buf = new char[READ_BUFFER_SIZE]; + int n; + while ((n = reader.read(buf)) != -1) { + sb.append(buf, 0, n); + } + return sb.toString(); + } + + // --------------------------------------------------------------------------- + // JSON DTOs - only used during parsing, never exposed outside this class + // --------------------------------------------------------------------------- + + static final class DatabaseJson { + int version; + @Nullable List entries; + } + + static final class EntryJson { + @Json(name = "vuln_id") + @Nullable + String vulnId; + + @Nullable String artifact; + + @Json(name = "version_ranges") + @Nullable + List versionRanges; + + @Nullable List symbols; + } + + static final class SymbolJson { + @Json(name = "class") + @Nullable + String className; + + @Nullable String method; + } +} diff --git a/dd-java-agent/appsec/src/main/java/com/datadog/appsec/sca/ScaEntry.java b/dd-java-agent/appsec/src/main/java/com/datadog/appsec/sca/ScaEntry.java new file mode 100644 index 00000000000..f1fc2382640 --- /dev/null +++ b/dd-java-agent/appsec/src/main/java/com/datadog/appsec/sca/ScaEntry.java @@ -0,0 +1,47 @@ +package com.datadog.appsec.sca; + +import java.util.Collections; +import java.util.List; + +/** One entry from sca_cves.json: a vulnerability affecting a specific Maven artifact. */ +public final class ScaEntry { + + private final String vulnId; + private final String artifact; + private final List versionRanges; + private final List symbols; + + public ScaEntry( + String vulnId, String artifact, List versionRanges, List symbols) { + this.vulnId = vulnId; + this.artifact = artifact; + this.versionRanges = Collections.unmodifiableList(versionRanges); + this.symbols = Collections.unmodifiableList(symbols); + } + + /** GHSA identifier, e.g. {@code "GHSA-645p-88qh-w398"}. */ + public String vulnId() { + return vulnId; + } + + /** Maven coordinate, e.g. {@code "com.fasterxml.jackson.core:jackson-databind"}. */ + public String artifact() { + return artifact; + } + + /** + * Version range strings from sca_cves.json, e.g. {@code ["< 2.6.7.3", ">= 2.7.0, < 2.7.9.5"]}. + */ + public List versionRanges() { + return versionRanges; + } + + public List symbols() { + return symbols; + } + + /** Returns true if the given version falls within any of this entry's version ranges. */ + public boolean isVersionVulnerable(String version) { + return VersionRangeParser.matchesAny(version, versionRanges); + } +} diff --git a/dd-java-agent/appsec/src/main/java/com/datadog/appsec/sca/ScaMethodCallbackInjector.java b/dd-java-agent/appsec/src/main/java/com/datadog/appsec/sca/ScaMethodCallbackInjector.java new file mode 100644 index 00000000000..1432e9f27bf --- /dev/null +++ b/dd-java-agent/appsec/src/main/java/com/datadog/appsec/sca/ScaMethodCallbackInjector.java @@ -0,0 +1,146 @@ +package com.datadog.appsec.sca; + +import datadog.trace.api.internal.VisibleForTesting; +import java.util.List; +import java.util.Map; +import net.bytebuddy.jar.asm.ClassReader; +import net.bytebuddy.jar.asm.ClassVisitor; +import net.bytebuddy.jar.asm.ClassWriter; +import net.bytebuddy.jar.asm.Label; +import net.bytebuddy.jar.asm.MethodVisitor; +import net.bytebuddy.jar.asm.Opcodes; +import net.bytebuddy.utility.OpenedClassReader; + +/** + * Injects SCA reachability callbacks at method entry points via ASM bytecode manipulation. + * + *

Given a map of method name to callback specs, modifies class bytecode to call {@code + * ScaReachabilityCallback.onMethodHit} at the entry point of each watched method. + */ +final class ScaMethodCallbackInjector { + + private static final String CALLBACK_OWNER = + "datadog/trace/bootstrap/appsec/sca/ScaReachabilityCallback"; + private static final String CALLBACK_METHOD = "onMethodHit"; + private static final String CALLBACK_DESC = + "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)V"; + + private ScaMethodCallbackInjector() {} + + @VisibleForTesting + static byte[] inject( + byte[] classfileBuffer, Map> callbacksPerMethod) { + ClassReader cr = new ClassReader(classfileBuffer); + ClassWriter cw = new ClassWriter(cr, ClassWriter.COMPUTE_MAXS); + cr.accept(new MethodCallbackClassVisitor(cw, callbacksPerMethod), ClassReader.EXPAND_FRAMES); + return cw.toByteArray(); + } + + private static class MethodCallbackClassVisitor extends ClassVisitor { + private final Map> callbacksPerMethod; + + MethodCallbackClassVisitor( + ClassVisitor cv, Map> callbacksPerMethod) { + super(OpenedClassReader.ASM_API, cv); + this.callbacksPerMethod = callbacksPerMethod; + } + + @Override + public MethodVisitor visitMethod( + int access, String name, String descriptor, String signature, String[] exceptions) { + MethodVisitor mv = super.visitMethod(access, name, descriptor, signature, exceptions); + List specs = callbacksPerMethod.get(name); + if (specs == null || specs.isEmpty()) { + return mv; + } + return new MethodEntryInjector(mv, specs); + } + } + + private static class MethodEntryInjector extends MethodVisitor { + private final List specs; + private boolean injected = false; + + MethodEntryInjector(MethodVisitor mv, List specs) { + super(OpenedClassReader.ASM_API, mv); + this.specs = specs; + } + + @Override + public void visitLineNumber(int line, Label start) { + if (!injected) { + injected = true; + injectCallbacks(line); + } + super.visitLineNumber(line, start); + } + + @Override + public void visitInsn(int opcode) { + ensureInjected(); + super.visitInsn(opcode); + } + + @Override + public void visitVarInsn(int opcode, int varIndex) { + ensureInjected(); + super.visitVarInsn(opcode, varIndex); + } + + @Override + public void visitMethodInsn( + int opcode, String owner, String name, String descriptor, boolean isInterface) { + ensureInjected(); + super.visitMethodInsn(opcode, owner, name, descriptor, isInterface); + } + + @Override + public void visitFieldInsn(int opcode, String owner, String name, String descriptor) { + ensureInjected(); + super.visitFieldInsn(opcode, owner, name, descriptor); + } + + private void ensureInjected() { + if (!injected) { + injected = true; + injectCallbacks(1); // no debug info — use line 1 as placeholder + } + } + + private void injectCallbacks(int line) { + // No dedup check here: retransformClasses() always starts from the original class bytes, + // so the callback must be re-injected on every transformation pass. Deduplication of + // actual runtime reports is handled by ScaReachabilityCallback.reported (bootstrap-side), + // which persists across retransformations and prevents duplicate hits regardless of how + // many times the class is retransformed. + for (MethodCallbackSpec spec : specs) { + mv.visitLdcInsn(spec.vulnId); + mv.visitLdcInsn(spec.artifact); + mv.visitLdcInsn(spec.version); + mv.visitLdcInsn(spec.dotClassName); + mv.visitLdcInsn(spec.methodName); + mv.visitLdcInsn(line); // LDC handles the full int range; SIPUSH is limited to -32768..32767 + mv.visitMethodInsn( + Opcodes.INVOKESTATIC, CALLBACK_OWNER, CALLBACK_METHOD, CALLBACK_DESC, false); + } + } + } + + /** Immutable spec for a single method-level callback to inject. */ + static final class MethodCallbackSpec { + final String vulnId; + final String artifact; + final String version; + final String dotClassName; + final String methodName; + + MethodCallbackSpec( + String vulnId, String artifact, String version, String dotClassName, String methodName) { + this.vulnId = vulnId; + this.artifact = artifact; + this.version = version; + this.dotClassName = dotClassName; + this.methodName = methodName; + } + } +} diff --git a/dd-java-agent/appsec/src/main/java/com/datadog/appsec/sca/ScaReachabilitySystem.java b/dd-java-agent/appsec/src/main/java/com/datadog/appsec/sca/ScaReachabilitySystem.java new file mode 100644 index 00000000000..28a7fe176e6 --- /dev/null +++ b/dd-java-agent/appsec/src/main/java/com/datadog/appsec/sca/ScaReachabilitySystem.java @@ -0,0 +1,149 @@ +package com.datadog.appsec.sca; + +import datadog.trace.api.telemetry.ScaReachabilityDependencyRegistry; +import datadog.trace.bootstrap.appsec.sca.ScaReachabilityCallback; +import datadog.trace.util.stacktrace.AbstractStackWalker; +import datadog.trace.util.stacktrace.StackWalkerFactory; +import java.lang.instrument.Instrumentation; +import java.util.Arrays; +import java.util.stream.Stream; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Entry point for the SCA Reachability subsystem. Called from {@code Agent.java} via reflection + * (same pattern as {@code AppSecSystem} and {@code IastSystem}). + * + *

Responsibilities: + * + *

    + *
  1. Load {@code sca_cves.json} from the classpath. + *
  2. Build the class-name index. + *
  3. Register {@link ScaReachabilityTransformer} with the JVM. + *
  4. Scan already-loaded classes so that libraries loaded before agent startup are detected. + *
+ */ +public final class ScaReachabilitySystem { + + private static final Logger log = LoggerFactory.getLogger(ScaReachabilitySystem.class); + + private ScaReachabilitySystem() {} + + /** + * Starts the SCA Reachability subsystem. + * + *

Called by reflection from {@code Agent.maybeStartScaReachability()} - the method signature + * must remain {@code public static void start(Instrumentation)}. + */ + public static void start(Instrumentation instrumentation) { + ScaCveDatabase database = ScaCveDatabase.load(); + if (database.isEmpty()) { + log.info("SCA Reachability: no vulnerability data found - subsystem inactive"); + return; + } + log.info("SCA Reachability: loaded {} vulnerable class symbols", database.size()); + + // Register the method-level callback. When called synchronously from the injected bytecode, + // the current thread stack still contains the full call chain: + // this handler lambda + // ScaReachabilityCallback.onMethodHit + // (dotClassName.methodName) + // [optional intermediate library frames] + // ← what we report + // Agent frames are filtered by AbstractStackWalker.isNotDatadogTraceStackElement; intermediate + // library frames are filtered by ScaStackExclusionTrie so we skip past them to client code. + ScaReachabilityCallback.register( + (vulnId, artifact, version, dotClassName, methodName, line) -> { + StackTraceElement callsite = findCallsite(dotClassName); + if (callsite != null) { + ScaReachabilityDependencyRegistry.INSTANCE.recordHit( + artifact, + version, + vulnId, + callsite.getClassName(), + callsite.getMethodName(), + callsite.getLineNumber()); + } else { + // Fallback: no application frame found - report the vulnerable symbol so the + // backend at least knows the method was reached. + ScaReachabilityDependencyRegistry.INSTANCE.recordHit( + artifact, version, vulnId, dotClassName, methodName, line); + } + }); + + ScaReachabilityTransformer transformer = + new ScaReachabilityTransformer(database, instrumentation); + + // canRetransform=true is required so that already-loaded classes can be retransformed to inject + // method-level callbacks when they were loaded before the agent started. + instrumentation.addTransformer(transformer, true); + + transformer.checkAlreadyLoadedClasses(); + log.debug("SCA Reachability: startup scan complete"); + + // performPendingRetransforms injects method-level callbacks into classes whose names were + // added to pendingRetransformNames by transform() on first load or by processClass() when + // version resolution previously failed and needs a retry. + ScaReachabilityDependencyRegistry.INSTANCE.setPeriodicWorkCallback( + transformer::performPendingRetransforms); + } + + /** + * Walks the current thread stack to find the first application frame that called the vulnerable + * method. Uses {@link StackWalkerFactory#INSTANCE} for lazy stack evaluation on JDK9+ (avoids + * materializing the full stack array). Agent frames are pre-filtered by the walker; intermediate + * library frames are skipped via {@link ScaStackExclusionTrie}. + * + *

The stack at call time is: + * + *

+   *   ScaReachabilitySystem handler lambda  (skip - agent, filtered by walker)
+   *   ScaReachabilityCallback.onMethodHit   (skip - agent, filtered by walker)
+   *   <vulnerableClass>.<method>           (skip - the instrumented library class)
+   *   [intermediate library frames]         (skip - trie-excluded)
+   *   <application callsite>               ← return this
+   * 
+ * + * @param vulnerableClass dot-notation FQN of the instrumented class + * @return first application callsite frame, or {@code null} if not found + */ + static StackTraceElement findCallsite(String vulnerableClass) { + return StackWalkerFactory.INSTANCE.walk( + stream -> findCallsiteInStream(vulnerableClass, stream)); + } + + /** + * Overload that accepts an explicit stack for testing. + * + * @see #findCallsite(String) + */ + static StackTraceElement findCallsite(String vulnerableClass, StackTraceElement[] stack) { + return findCallsiteInStream( + vulnerableClass, + Arrays.stream(stack).filter(AbstractStackWalker::isNotDatadogTraceStackElement)); + } + + private static StackTraceElement findCallsiteInStream( + String vulnerableClass, Stream stream) { + boolean[] pastVulnerableClass = {false}; + return stream + .filter( + frame -> { + String cls = frame.getClassName(); + if (!pastVulnerableClass[0]) { + if (cls.equals(vulnerableClass)) { + pastVulnerableClass[0] = true; + } + return false; + } + // Skip remaining frames from the vulnerable class itself + if (cls.equals(vulnerableClass)) { + return false; + } + // Skip intermediate library frames so we report client code, not a wrapper library + return ScaStackExclusionTrie.apply(cls) < 1; + }) + .findFirst() + .orElse(null); + } +} diff --git a/dd-java-agent/appsec/src/main/java/com/datadog/appsec/sca/ScaReachabilityTransformer.java b/dd-java-agent/appsec/src/main/java/com/datadog/appsec/sca/ScaReachabilityTransformer.java new file mode 100644 index 00000000000..1e21cecad46 --- /dev/null +++ b/dd-java-agent/appsec/src/main/java/com/datadog/appsec/sca/ScaReachabilityTransformer.java @@ -0,0 +1,528 @@ +package com.datadog.appsec.sca; + +import com.datadog.appsec.sca.ScaMethodCallbackInjector.MethodCallbackSpec; +import datadog.telemetry.dependency.Dependency; +import datadog.telemetry.dependency.DependencyResolver; +import datadog.trace.api.internal.VisibleForTesting; +import datadog.trace.api.telemetry.ScaReachabilityDependencyRegistry; +import datadog.trace.util.Strings; +import java.io.File; +import java.lang.instrument.ClassFileTransformer; +import java.lang.instrument.Instrumentation; +import java.net.URI; +import java.net.URL; +import java.security.CodeSource; +import java.security.ProtectionDomain; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.regex.Pattern; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * {@link ClassFileTransformer} that detects when classes from vulnerable libraries are loaded and + * reports reachability hits via {@link ScaReachabilityDependencyRegistry}. + * + *

Design principles (see APPSEC-62260): + * + *

    + *
  • Two-phase processing: on first class load ({@code classBeingRedefined == null}), + * {@link #transform} adds the class name to {@link #pendingRetransformNames} and returns + * {@code null} — no JAR I/O on the class-loading thread. {@link #performPendingRetransforms} + * runs on the telemetry thread each heartbeat, calls {@link + * Instrumentation#retransformClasses}, and fires {@link #transform} again with {@code + * classBeingRedefined != null} to inject method-level callbacks. + *
  • Never throws: any error in {@link #transform} is caught silently to avoid breaking + * class loading. + *
  • Concurrent: all shared state uses concurrent collections — {@link #transform} is + * called from multiple class-loading threads simultaneously. + *
  • Version cache: each JAR is read at most once; non-empty results are cached in {@link + * #jarCache}. + *
  • Single occurrence: each (vulnId, artifact, symbolName) tuple is reported at most + * once per RFC requirement. Dedup lives in {@code ScaReachabilityCallback.reported} + * (bootstrap-side, persists across retransforms). + *
+ */ +public final class ScaReachabilityTransformer implements ClassFileTransformer { + + private static final Logger log = LoggerFactory.getLogger(ScaReachabilityTransformer.class); + private static final Pattern PATH_SEPARATOR = Pattern.compile(Pattern.quote(File.pathSeparator)); + + private final ScaCveDatabase database; + private final Instrumentation instrumentation; + + /** + * Cache: JAR URI → resolved dependencies. URI is used instead of URL to avoid DNS lookups in + * equals/hashCode (DMI_COLLECTION_OF_URLS). Only non-empty results are cached to allow retries. + */ + @VisibleForTesting + final ConcurrentHashMap> jarCache = new ConcurrentHashMap<>(); + + /** + * Cache: artifact name → classpath-resolved {@link Dependency}. Stores the full dependency (name + * + version) so that the resolved {@code dep.name} — which may be an artifactId-only name like + * {@code "junrar"} for JARs without pom.properties — is propagated to {@code registerCve} and + * kept consistent with the name that {@link datadog.telemetry.dependency.DependencyService} will + * report. Only non-null results are cached; null means "not yet found" and will be retried on the + * next periodic retransform. + */ + @VisibleForTesting + final ConcurrentHashMap classpathArtifactCache = new ConcurrentHashMap<>(); + + /** + * Classes whose bytecode needs (re)transformation for method-level symbol injection: + * + *
    + *
  • Classes already loaded at startup before this transformer was registered. + *
  • Classes where JAR version resolution returned no results at load time and needs a retry. + *
+ * + * Drained and processed by {@link #performPendingRetransforms()} on each telemetry heartbeat. + */ + @VisibleForTesting + final ConcurrentLinkedQueue> pendingRetransform = new ConcurrentLinkedQueue<>(); + + /** Class names (internal format) queued for deferred retransformation by name lookup. */ + @VisibleForTesting final Set pendingRetransformNames = ConcurrentHashMap.newKeySet(); + + public ScaReachabilityTransformer(ScaCveDatabase database, Instrumentation instrumentation) { + this.database = database; + this.instrumentation = instrumentation; + } + + // --------------------------------------------------------------------------- + // ClassFileTransformer + // --------------------------------------------------------------------------- + + @Override + public byte[] transform( + ClassLoader loader, + String className, + Class classBeingRedefined, + ProtectionDomain protectionDomain, + byte[] classfileBuffer) { + try { + // Filter array types (e.g. "[Ljava/sql/PreparedStatement;"). + if (className == null || className.charAt(0) == '[') { + return null; + } + + // JDK/bootstrap classes (protectionDomain == null) are skipped - they are loaded regardless + // of which library is present and are not reliable reachability indicators. + if (protectionDomain == null) { + return null; + } + + List entries = database.entriesForClass(className); + if (entries == null) { + return null; + } + + CodeSource codeSource = protectionDomain.getCodeSource(); + if (codeSource == null) { + return null; // runtime-generated class (dynamic proxy, lambda, etc.) + } + URL location = codeSource.getLocation(); + if (location == null) { + return null; + } + + if (classBeingRedefined == null) { + // First load: schedule a retransform for the next telemetry heartbeat so that JAR I/O + // (DependencyResolver.resolve) does not run on the class-loading thread. + pendingRetransformNames.add(className); + return null; + } + + // Retransform triggered by performPendingRetransforms() after version resolution succeeds: + // inject method-level callbacks into the bytecode and return the modified bytes. + return processClass(className, location, entries, classfileBuffer); + } catch (Throwable t) { + // Never propagate from transform() - it would break the class being loaded. + log.debug("SCA Reachability: error processing class {}", className, t); + } + return null; + } + + /** + * Injects method-level callbacks into the bytecode of a class being retransformed. + * + *

Called only on retransformation ({@code classBeingRedefined != null}), triggered by {@link + * #performPendingRetransforms}. + * + *

Returns modified bytecode if method-level callbacks were injected, or {@code null} if + * version resolution failed (no bytecode change needed; will be retried on the next heartbeat). + */ + private byte[] processClass( + String className, URL jarUrl, List entries, byte[] classfileBuffer) { + // Cache-only: processClass() runs under JVM retransform locks; no fresh JAR I/O here. + List classJarDeps = resolveDependenciesFromCache(jarUrl); + + // Collect method-level callbacks to inject, keyed by method name + Map> methodCallbacks = new HashMap<>(); + boolean hasUnresolvedMethodLevelSymbols = false; + // Computed lazily: only needed for method-level symbol injection. + String dotClassName = null; + + for (ScaEntry entry : entries) { + // Resolve the dependency for this artifact: first check the class's own JAR, then fall back + // to a full classpath scan. The fallback handles aggregator/starter POM artifacts whose + // watched classes actually live in a transitive dependency JAR (e.g., spring-boot-starter-web + // watches @Controller, but @Controller is in spring-context.jar). + // + // We use the resolved dep's name (not entry.artifact()) for registerCve and + // MethodCallbackSpec + // to ensure that the registry key matches the name that DependencyService will later report. + // For JARs without pom.properties, DependencyResolver.guessFallbackNoPom produces an + // artifactId-only name (e.g. "junrar" instead of "com.github.junrar:junrar"). Using + // entry.artifact() as the registry key would cause a mismatch with DependencyService's name, + // causing the CVE telemetry event to lose its source/hash or appear under the wrong name. + Dependency resolvedDep = resolveArtifactDep(entry.artifact(), classJarDeps); + if (resolvedDep == null) { + hasUnresolvedMethodLevelSymbols = true; + continue; + } + String version = resolvedDep.version; + String depName = resolvedDep.name != null ? resolvedDep.name : entry.artifact(); + + if (!entry.isVersionVulnerable(version)) { + continue; + } + + for (ScaSymbol symbol : entry.symbols()) { + if (!symbol.className().equals(className)) { + continue; + } + // Register the CVE now (at class load time) with reached=[] so the next heartbeat + // signals the backend that SCA is monitoring this CVE. The callsite will be added + // later when the method is actually called (via ScaReachabilityCallback). + ScaReachabilityDependencyRegistry.INSTANCE.registerCve(depName, version, entry.vulnId()); + if (dotClassName == null) { + dotClassName = Strings.getClassName(className); + } + methodCallbacks + .computeIfAbsent(symbol.method(), k -> new ArrayList<>()) + .add( + new MethodCallbackSpec( + entry.vulnId(), depName, version, dotClassName, symbol.method())); + } + } + + if (hasUnresolvedMethodLevelSymbols) { + // Schedule retransformation for a later attempt. In transform(), classBeingRedefined is + // null (first class load), so we don't have a Class handle to put directly into + // pendingRetransform. Instead we queue the internal class name; performPendingRetransforms() + // will resolve it back to a Class via instrumentation.getAllLoadedClasses() and + // retransform. + pendingRetransformNames.add(className); + } + + if (methodCallbacks.isEmpty()) { + return null; + } + return ScaMethodCallbackInjector.inject(classfileBuffer, methodCallbacks); + } + + // --------------------------------------------------------------------------- + // Startup scan for already-loaded classes + // --------------------------------------------------------------------------- + + /** + * Checks classes already loaded before this transformer was registered. + * + *

Only processes 3rd-party classes (non-null {@link ProtectionDomain} with a code source). JDK + * classes are skipped: they are always loaded regardless of which library is in the classpath and + * would produce false positives if used as reachability proxies. See APPSEC-62260. + */ + public void checkAlreadyLoadedClasses() { + for (Class clazz : instrumentation.getAllLoadedClasses()) { + if (clazz == null) { + continue; + } + String internalName = clazz.getName().replace('.', '/'); + if (internalName.charAt(0) == '[') { + continue; + } + List entries = database.entriesForClass(internalName); + if (entries == null) { + continue; + } + + ProtectionDomain pd = clazz.getProtectionDomain(); + URL location = locationOf(pd); + if (location == null) { + // JDK/bootstrap class (no code source): skip - false positive, see class Javadoc. + continue; + } + // All symbols are method-level: always schedule retransformation so the bytecode + // callback can be injected. We can't modify bytecode during the startup scan; deferred + // to performPendingRetransforms(). + pendingRetransform.add(clazz); + } + } + + /** + * Retransforms classes scheduled for method-level bytecode injection: + * + *

    + *
  1. Classes detected on first load ({@link #transform} adds them to {@link + * #pendingRetransformNames}). + *
  2. Classes already loaded before the transformer was registered ({@link + * #checkAlreadyLoadedClasses}). + *
  3. Classes whose JAR version could not be resolved (will be retried). + *
+ * + *

Called by {@code ScaReachabilityPeriodicAction} on each telemetry heartbeat via the {@code + * periodicWorkCallback} registered in {@link ScaReachabilityDependencyRegistry}. + */ + public void performPendingRetransforms() { + if (instrumentation == null) { + return; // no-op when instrumentation is unavailable (e.g. in unit tests) + } + // Drain the direct Class queue (from checkAlreadyLoadedClasses) + List> toRetransform = new ArrayList<>(); + Class clazz; + while ((clazz = pendingRetransform.poll()) != null) { + if (instrumentation.isModifiableClass(clazz)) { + toRetransform.add(clazz); + } + } + + // Resolve any classes queued by name (from processClass timing failures). + // Use contains+removeAll instead of remove inside the loop: the same class may be loaded + // by multiple classloaders (e.g. Spring Boot LaunchedURLClassLoader creates more than one + // instance), and we must retransform ALL of them, not just the first one found. + if (!pendingRetransformNames.isEmpty()) { + Set matched = new HashSet<>(); + for (Class loaded : instrumentation.getAllLoadedClasses()) { + if (loaded == null) { + continue; + } + String name = loaded.getName().replace('.', '/'); + if (pendingRetransformNames.contains(name)) { + // Always add to matched to drain the pending set; only retransform if modifiable. + matched.add(name); + if (instrumentation.isModifiableClass(loaded)) { + toRetransform.add(loaded); + } + } + } + pendingRetransformNames.removeAll(matched); + } + + if (toRetransform.isEmpty()) { + return; + } + + // Pre-warm caches before retransformClasses() acquires JVM locks — no JAR I/O inside the + // callback. + // Two paths in processClass() can trigger fresh JAR I/O under locks: + // 1. resolveDependenciesFromCache() — safe only if jarCache is already populated. + // 2. resolveArtifactDep() → findArtifactInClasspath() for aggregator artifacts (e.g., + // spring-boot-starter-web) whose pom.properties is not in the class's own JAR. + // Without pre-warming classpathArtifactCache, this scans all java.class.path JARs via + // resolveDependencies() under JVM locks, reintroducing the snakeyaml deadlock. + for (Class c : toRetransform) { + ProtectionDomain pd = c.getProtectionDomain(); + if (pd == null) { + continue; + } + CodeSource cs = pd.getCodeSource(); + if (cs == null) { + continue; + } + URL loc = cs.getLocation(); + if (loc == null) { + continue; + } + resolveDependencies(loc); + String internalName = c.getName().replace('.', '/'); + List dbEntries = database.entriesForClass(internalName); + if (dbEntries != null) { + List classJarDeps = resolveDependenciesFromCache(loc); + for (ScaEntry entry : dbEntries) { + resolveVersionForArtifact(entry.artifact(), classJarDeps); + } + } + } + + try { + instrumentation.retransformClasses(toRetransform.toArray(new Class[0])); + log.debug( + "SCA Reachability: retransformed {} class(es) for method-level detection", + toRetransform.size()); + } catch (Throwable t) { + log.debug("SCA Reachability: retransformClasses failed", t); + // Re-queue on failure so the next heartbeat can retry + pendingRetransform.addAll(toRetransform); + } + } + + // --------------------------------------------------------------------------- + // Internal matching logic + // --------------------------------------------------------------------------- + + /** + * Resolves the {@link Dependency} for {@code artifactName} (groupId:artifactId format), returning + * the matched dependency object — which may have an artifactId-only {@code name} for JARs without + * {@code pom.properties}. Returns {@code null} if the artifact cannot be found. + * + *

Use this method (not {@link #resolveVersionForArtifact}) whenever the resolved dependency + * name needs to be propagated (e.g., for {@code registerCve} and {@code MethodCallbackSpec}), so + * that registry keys stay consistent with the names that {@link + * datadog.telemetry.dependency.DependencyService} will report. + */ + @VisibleForTesting + Dependency resolveArtifactDep(String artifactName, List classJarDeps) { + Dependency dep = matchDep(artifactName, classJarDeps); + if (dep != null) { + return dep; + } + // Classpath fallback: check cache first, then scan. + Dependency cached = classpathArtifactCache.get(artifactName); + if (cached != null) { + return cached; + } + dep = findArtifactInClasspath(artifactName); + if (dep != null) { + classpathArtifactCache.put(artifactName, dep); // only cache hits; misses are retried + } + return dep; + } + + @VisibleForTesting + String resolveVersionForArtifact(String artifactName, List classJarDeps) { + Dependency dep = resolveArtifactDep(artifactName, classJarDeps); + return dep != null ? dep.version : null; + } + + /** + * Matches {@code artifactName} (groupId:artifactId format) against a list of dependencies, + * returning the matched {@link Dependency} object (not just the version). + * + *

First tries an exact name match. If that fails, falls back to matching by artifact ID only. + * The fallback handles JARs without {@code pom.properties}: {@code Dependency.guessFallbackNoPom} + * can only extract the artifact ID from the filename (no group ID), producing names like {@code + * "junrar"} for {@code com.github.junrar:junrar}. The returned dependency's {@code name} reflects + * what {@link datadog.telemetry.dependency.DependencyService} will report for that JAR. + */ + @VisibleForTesting + static Dependency matchDep(String artifactName, List deps) { + for (Dependency dep : deps) { + if (artifactName.equals(dep.name)) { + return dep; + } + } + int colonIdx = artifactName.lastIndexOf(':'); + if (colonIdx < 0) { + return null; + } + String artifactId = artifactName.substring(colonIdx + 1); + for (Dependency dep : deps) { + if (dep.name != null + && !dep.name.contains(":") + && artifactId.equals(dep.name) + && dep.version != null) { + return dep; + } + } + return null; + } + + /** + * Matches {@code artifactName} against a list of dependencies, returning the resolved version + * string. Delegates to {@link #matchDep} — use that method when the full dependency object is + * needed. + */ + @VisibleForTesting + static String matchVersion(String artifactName, List deps) { + Dependency dep = matchDep(artifactName, deps); + return dep != null ? dep.version : null; + } + + private Dependency findArtifactInClasspath(String artifactName) { + // Use URI (not URL) to avoid DNS lookups in equals/hashCode (DMI_COLLECTION_OF_URLS) + Set scanned = new HashSet<>(); + + // AgentThreadFactory sets context classloader to null on agent threads, so a URLClassLoader + // chain walk would never execute here. Scan java.class.path directly — this covers both Java 8 + // and Java 9+ for standard deployments. OSGi / multi-tenant apps and Spring Boot fat JARs with + // dynamically loaded bundle classloaders are a known limitation: version resolution for + // aggregator artifacts may fail in those environments, falling back to retrying on the next + // heartbeat. + String classpath = System.getProperty("java.class.path", ""); + for (String entry : PATH_SEPARATOR.split(classpath)) { + if (entry.isEmpty()) { + continue; + } + try { + URI uri = new File(entry).toURI(); + if (scanned.add(uri)) { + Dependency dep = matchDep(artifactName, resolveDependencies(uri.toURL())); + if (dep != null) { + return dep; + } + } + } catch (Exception e) { + log.debug("SCA Reachability: could not scan classpath entry {}", entry, e); + } + } + return null; + } + + @VisibleForTesting + String findArtifactVersionInClasspath(String artifactName) { + Dependency dep = findArtifactInClasspath(artifactName); + return dep != null ? dep.version : null; + } + + private List resolveDependenciesFromCache(URL url) { + try { + List cached = jarCache.get(url.toURI()); + return cached != null ? cached : Collections.emptyList(); + } catch (Exception e) { + // URISyntaxException from url.toURI() — should not happen for JAR URLs from protection domain + log.debug("SCA Reachability: could not read jarCache for {}", url, e); + return Collections.emptyList(); + } + } + + @VisibleForTesting + List resolveDependencies(URL url) { + try { + URI uri = url.toURI(); + List cached = jarCache.get(uri); + if (cached != null) { + return cached; + } + List resolved = DependencyResolver.resolve(uri); + if (resolved == null) { + resolved = Collections.emptyList(); + } + // Only cache non-empty results: empty means the JAR had no pom.properties, which may be + // a transient failure. Not caching allows the periodic retransform to retry successfully. + if (!resolved.isEmpty()) { + List existing = jarCache.putIfAbsent(uri, resolved); + return existing != null ? existing : resolved; + } + return resolved; + } catch (Exception e) { + log.debug("SCA Reachability: could not resolve {}", url, e); + return Collections.emptyList(); + } + } + + private static URL locationOf(ProtectionDomain pd) { + if (pd == null) return null; + CodeSource cs = pd.getCodeSource(); + if (cs == null) return null; + return cs.getLocation(); + } +} diff --git a/dd-java-agent/appsec/src/main/java/com/datadog/appsec/sca/ScaSymbol.java b/dd-java-agent/appsec/src/main/java/com/datadog/appsec/sca/ScaSymbol.java new file mode 100644 index 00000000000..e2185125118 --- /dev/null +++ b/dd-java-agent/appsec/src/main/java/com/datadog/appsec/sca/ScaSymbol.java @@ -0,0 +1,23 @@ +package com.datadog.appsec.sca; + +/** A single method-level symbol from sca_cves.json: a class and method to watch for. */ +public final class ScaSymbol { + + private final String className; // JVM internal format: "com/foo/Bar" + private final String method; + + public ScaSymbol(String className, String method) { + this.className = className; + this.method = method; + } + + /** JVM internal class name with slashes, e.g. {@code "com/foo/Bar"}. */ + public String className() { + return className; + } + + /** Method name for method-level tracking, e.g. {@code "readValue"}. */ + public String method() { + return method; + } +} diff --git a/dd-java-agent/appsec/src/main/java/com/datadog/appsec/sca/VersionRangeParser.java b/dd-java-agent/appsec/src/main/java/com/datadog/appsec/sca/VersionRangeParser.java new file mode 100644 index 00000000000..f95e11d6064 --- /dev/null +++ b/dd-java-agent/appsec/src/main/java/com/datadog/appsec/sca/VersionRangeParser.java @@ -0,0 +1,85 @@ +package com.datadog.appsec.sca; + +import datadog.trace.util.ComparableVersion; +import java.util.List; +import java.util.regex.Pattern; + +/** + * Checks whether a version string matches GHSA version range expressions. + * + *

Range string format (per sca-reachability-database enrichments): + * + *

    + *
  • {@code "< 2.6.7.3"} - strictly less than + *
  • {@code "<= 2.6.7.3"} - less than or equal + *
  • {@code "> 2.6.7.3"} - strictly greater than + *
  • {@code ">= 2.6.7.3"} - greater than or equal + *
  • {@code "= 2.6.7.3"} - exact match + *
  • {@code ">= 2.7.0, < 2.7.9.5"} - AND of two conditions (comma-separated) + *
+ * + *

Multiple range strings in a list are evaluated as OR: a version is affected if it matches ANY + * of the ranges. + * + *

Version comparison uses {@link ComparableVersion} (Maven 3.9.9 semantics), which correctly + * handles qualifiers such as {@code .RELEASE}, {@code .GA}, {@code .FINAL}, and 4-part versions. + */ +public final class VersionRangeParser { + + private static final Pattern COMMA = Pattern.compile(","); + + private VersionRangeParser() {} + + /** + * Returns true if {@code version} matches at least one of the provided range strings. + * + * @param version the version to test (e.g. {@code "2.8.5"} or {@code "5.2.19.RELEASE"}) + * @param versionRanges list of range strings from sca_cves.json + * @return true if the version falls within any range + */ + public static boolean matchesAny(String version, List versionRanges) { + if (version == null || version.isEmpty() || versionRanges == null || versionRanges.isEmpty()) { + return false; + } + ComparableVersion v = new ComparableVersion(version); + for (String range : versionRanges) { + if (matchesRange(v, range)) { + return true; + } + } + return false; + } + + /** + * Returns true if {@code version} matches a single range string. Multiple conditions within a + * single string (comma-separated) are evaluated as AND. + */ + static boolean matchesRange(ComparableVersion version, String versionRange) { + String[] conditions = COMMA.split(versionRange); + for (String condition : conditions) { + if (!matchesCondition(version, condition.trim())) { + return false; + } + } + return true; + } + + private static boolean matchesCondition(ComparableVersion version, String condition) { + if (condition.startsWith(">=")) { + return version.compareTo(new ComparableVersion(condition.substring(2).trim())) >= 0; + } + if (condition.startsWith("<=")) { + return version.compareTo(new ComparableVersion(condition.substring(2).trim())) <= 0; + } + if (condition.startsWith(">")) { + return version.compareTo(new ComparableVersion(condition.substring(1).trim())) > 0; + } + if (condition.startsWith("<")) { + return version.compareTo(new ComparableVersion(condition.substring(1).trim())) < 0; + } + if (condition.startsWith("=")) { + return version.compareTo(new ComparableVersion(condition.substring(1).trim())) == 0; + } + throw new IllegalArgumentException("Unrecognised version condition: '" + condition + "'"); + } +} diff --git a/dd-java-agent/appsec/src/main/resources/com/datadog/appsec/sca/sca_stack_exclusion.trie b/dd-java-agent/appsec/src/main/resources/com/datadog/appsec/sca/sca_stack_exclusion.trie new file mode 100644 index 00000000000..3cd56444b2c --- /dev/null +++ b/dd-java-agent/appsec/src/main/resources/com/datadog/appsec/sca/sca_stack_exclusion.trie @@ -0,0 +1,289 @@ +# Stack frame exclusion trie for SCA Reachability callsite detection. +# Generated class: com.datadog.appsec.sca.ScaStackExclusionTrie +# +# 1 = known library/framework frame — skip when walking the call stack +# 0 = application code within an otherwise-excluded package — allow as callsite + +# -------- JDK -------- +1 com.azul.* +1 com.sun.* +1 java.* +1 javafx.* +1 javax.* +1 jdk.* +1 openj9.* +1 org.omg.* +1 org.w3c.* +1 org.xml.* +1 $Proxy* +1 sun.* + +# -------- Groovy -------- +1 groovy* +1 org.groovy.* + +# -------- Scala -------- +1 scala.* + +# -------- Kotlin -------- +1 kotlin.* + +# -------- DataDog -------- +1 com.datadog.* +0 com.datadog.demo.* +1 datadog.* +0 datadog.smoketest.* +1 com.timgroup.statsd.* + +# -------- Agents ----------- +1 com.instana.* + +# -------- Libraries -------- +1 aj.org.objectweb.* +1 akka.* +1 antlr.* +1 brave.* +1 bsh.* +1 ch.qos.* +1 coldfusion.* +1 com.adobe.* +1 com.amazonaws.* +1 com.apple.java.* +1 com.apple.crypto.* +1 com.arjuna.* +1 com.atlassian.jira.* +1 com.azure.* +1 com.bea.* +1 com.blogspot.* +1 com.certicom.* +1 com.codahale.* +1 com.cognos.* +1 com.couchbase.* +1 com.ctc.* +1 com.cystaldecisions.* +1 com.datastax.* +1 com.datical.liquibase.* +1 com.denodo.vdb.jdbcdriver.* +1 com.dwr.* +1 com.ecwid.consul.* +1 org.egothor.* +1 com.esotericsoftware.kryo.* +1 com.fasterxml.* +1 com.filenet.* +1 com.github.benmanes.caffeine.* +1 com.github.jknack.handlebars.* +1 com.google.* +1 com.googlecode.* +1 com.hazelcast.* +1 com.hdivsecurity.* +1 com.ibm.* +0 com.ibm._jsp.* +1 com.intellij.* +1 com.itext.* +1 com.itextpdf.* +1 com.jcraft.* +1 com.jhlabs.* +1 com.jprofiler.* +1 com.launchdarkly.* +1 com.liferay.* +1 com.lowagie.* +1 com.mchange.* +1 com.microsoft.* +1 com.mongodb.* +1 com.mysql.* +1 com.neo4j.* +1 com.netscape.* +1 com.ning.* +1 com.novell.* +1 com.ocpsoft.* +1 com.octetstring.* +1 com.opencsv.* +1 com.opensymphony.* +1 com.octo.captcha.* +1 com.oracle.* +1 com.rabbitmq.* +1 com.rsa.* +1 com.safelayer.* +1 com.solarmetric.* +1 com.squareup.* +1 com.stripe.* +1 com.tangosol.* +1 com.thoughtworks.* +1 com.typesafe.* +1 com.zaxxer.* +1 com.facebook.presto.* +1 commonj.work.* +1 cryptix.* +1 dev.failsafe.* +1 edu.emory.* +1 edu.oswego.* +1 freemarker.* +1 gnu.* +1 graphql.* +1 ibm.security.* +1 io.confluent.* +1 io.dropwizard.* +1 io.fabric8.* +1 io.github.lukehutch.fastclasspathscanner.* +1 io.grpc.* +1 io.leangen.geantyref.* +1 io.jsonwebtoken.* +1 io.ktor.* +1 io.prometheus.* +1 io.quarkus.* +1 io.micrometer.* +1 io.micronaut.* +1 io.netty.* +1 io.r2dbc.* +1 io.reactivex.* +1 io.smallrye.* +1 io.springfox.* +1 io.swagger.* +1 io.trino.* +1 io.undertow.* +1 io.vertx.* +0 io.vertx.demo.* +1 jakarta.* +1 jasperreports.* +1 javassist.* +1 javolution.* +1 jersey.repackaged.* +1 jnr.ffi.* +1 jnr.posix.* +1 joptsimple.* +1 jregex.* +1 jrun.* +1 jrunx.* +1 jva_cup.* +1 liquibase.* +1 kodo.* +1 kong.unirest.* +1 macromedia.* +1 Microsoft.* +1 nanoxml.* +1 nano.xml.* +1 net.bytebuddy.* +1 net.jcip.* +1 net.jodah.failsafe.* +1 net.jpountz.xxhash.* +1 net.logstash.* +1 net.nicholaswilliams.* +1 net.sf.beanlib.* +1 net.sf.cglib.* +1 net.sf.ehcache.* +1 net.sf.jasperreports.* +1 net.sf.jsqlparser.* +1 net.sf.saxon.* +1 net.sourceforge.argparse4j.* +1 net.sourceforge.barbecue.* +1 netscape.* +1 nu.xom.* +1 okhttp3.* +1 okio.* +1 ognl.* +1 oracle.jdbc.* +1 oracle.sql.* +1 org.ajax4jsf.* +1 org.aopalliance.* +1 org.antlr.* +1 org.apache.* +0 org.apache.http.client.methods.* +0 org.apache.hc.client5.http.classic.methods.* +0 org.apache.jsp.* +1 org.apiguardian.* +1 org.aspectj.* +1 org.attoparser.* +1 org.bouncycastle.* +1 org.bson.* +1 org.clojure.* +1 org.codehaus.* +1 org.crac.* +1 org.cyberneko.* +1 org.directwebremoting.* +1 org.dom4j.* +1 org.eclipse.* +1 org.ehcache.* +1 org.flywaydb.* +1 org.gjt.mm.mysql.* +1 org.glassfish.* +1 org.graalvm.* +1 org.grails.orm.hibernate.cfg.GrailsDomainBinder +1 org.h2.* +1 org.hamcrest.* +1 org.hdiv.* +1 org.hibernate.* +1 org.hsqldb.* +1 org.htmlparser.* +1 org.ietf.* +1 org.infinispan.* +1 org.jaxen.* +1 org.jboss.* +1 org.jcp.xml.* +1 org.jdbcdslog +1 org.jdbi.* +1 org.jdom.* +1 org.jetbrains.* +1 org.jfree.* +1 org.jnp.* +1 org.joda.* +1 org.jooq.* +1 org.jruby.* +1 org.json.* +1 org.jsoup.* +1 org.jvnet.hk2.* +1 org.keycloak.* +1 org.liquibase.* +1 org.mariadb.* +1 org.mockito.* +1 org.modelmapper.* +1 org.mongodb.* +1 org.mortbay.* +1 org.objectweb.* +1 org.openid4java.* +1 org.openjdk.jol.vm.* +1 io.opentelemetry.* +1 org.openxmlformats.* +1 org.osgi.* +1 org.owasp.* +0 org.owasp.benchmark.* +0 org.owasp.webgoat.* +1 org.picketbox.* +1 org.picketlink.* +1 org.postgresql.* +1 org.primefaces.* +1 org.python.* +1 org.quartz.* +1 org.reactivestreams.* +1 org.relaxng.* +1 org.renjin.* +1 org.richfaces.* +1 org.seasar.* +1 org.slf4j.* +1 org.springdoc.* +1 org.springframework.* +0 org.springframework.samples.* +1 org.sqlite.* +1 org.stringtemplate.* +1 org.synchronoss.* +1 org.terracotta.* +1 org.testcontainers.* +1 org.thymeleaf.* +1 org.tigris.gef.* +1 org.wildfly.* +1 org.xerial.snappy.* +1 org.xnio.* +1 org.yaml.* +1 org.yecht.* +1 reactor.* +1 sbt.* +1 schemacom_bea_xml.* +1 serp.* +1 sl.org.objectweb.asm.* +1 software.amazon.awssdk.* +1 spark.* +1 springfox.* +1 System.* +1 tech.jhipster.* +1 uk.ltd.getahead.* +1 weblogic.* +1 zipkin2.* diff --git a/dd-java-agent/appsec/src/main/resources/sca_cves.json b/dd-java-agent/appsec/src/main/resources/sca_cves.json new file mode 100644 index 00000000000..c15f59bc822 --- /dev/null +++ b/dd-java-agent/appsec/src/main/resources/sca_cves.json @@ -0,0 +1 @@ +{"version":1,"entries":[{"vuln_id":"GHSA-2jrg-rf5x-568g","artifact":"org.springframework.security:spring-security-web","version_ranges":[">=7.0.0,<7.0.5"],"symbols":[{"class":"org/springframework/security/web/authentication/preauth/x509/SubjectX500PrincipalExtractor","method":"extractPrincipal"}]},{"vuln_id":"GHSA-563x-q5rq-57qp","artifact":"org.apache.tomcat.embed:tomcat-embed-core","version_ranges":[">=7.0.0,<9.0.116",">=10.1.0-M1,<10.1.52",">=11.0.0-M1,<11.0.20"],"symbols":[{"class":"org/apache/coyote/http11/filters/ChunkedInputFilter","method":"parseChunkHeader"},{"class":"org/apache/coyote/http11/filters/ChunkedInputFilter","method":"skipChunkHeader"}]},{"vuln_id":"GHSA-563x-q5rq-57qp","artifact":"org.apache.tomcat:tomcat-coyote","version_ranges":[">=7.0.0,<9.0.116",">=10.1.0-M1,<10.1.52",">=11.0.0-M1,<11.0.20"],"symbols":[{"class":"org/apache/coyote/http11/filters/ChunkedInputFilter","method":"parseChunkHeader"},{"class":"org/apache/coyote/http11/filters/ChunkedInputFilter","method":"skipChunkHeader"}]},{"vuln_id":"GHSA-69r9-qgr7-g2wj","artifact":"org.apache.tomcat:tomcat","version_ranges":[">=11.0.20,<11.0.21",">=10.1.53,<10.1.54",">=9.0.116,<9.0.117"],"symbols":[{"class":"org/apache/catalina/tribes/group/interceptors/EncryptInterceptor","method":"messageReceived"}]},{"vuln_id":"GHSA-69r9-qgr7-g2wj","artifact":"org.apache.tomcat:tomcat-tribes","version_ranges":[">=11.0.20,<11.0.21",">=10.1.53,<10.1.54",">=9.0.116,<9.0.117"],"symbols":[{"class":"org/apache/catalina/tribes/group/interceptors/EncryptInterceptor","method":"messageReceived"}]},{"vuln_id":"GHSA-8mc5-53m5-3qj2","artifact":"org.apache.tomcat.embed:tomcat-embed-core","version_ranges":[">=9.0.113,<9.0.116",">=10.1.50,<10.1.53",">=11.0.15,<11.0.20"],"symbols":[{"class":"org/apache/tomcat/util/net/AbstractEndpoint","method":"checkSni"}]},{"vuln_id":"GHSA-8mc5-53m5-3qj2","artifact":"org.apache.tomcat:tomcat","version_ranges":[">=9.0.113,<9.0.116",">=10.1.50,<10.1.53",">=11.0.15,<11.0.20"],"symbols":[{"class":"org/apache/tomcat/util/net/AbstractEndpoint","method":"checkSni"}]},{"vuln_id":"GHSA-8mc5-53m5-3qj2","artifact":"org.apache.tomcat:tomcat-coyote","version_ranges":[">=9.0.113,<9.0.116",">=10.1.50,<10.1.53",">=11.0.15,<11.0.20"],"symbols":[{"class":"org/apache/tomcat/util/net/AbstractEndpoint","method":"checkSni"}]},{"vuln_id":"GHSA-cpm7-cfpx-3hvp","artifact":"gov.nsa.emissary:emissary","version_ranges":[">=0,<8.39.0"],"symbols":[{"class":"emissary/server/mvc/EmissaryNav","method":"convert"}]},{"vuln_id":"GHSA-cwq5-8pvq-j65j","artifact":"io.github.ndsev:zserio-runtime","version_ranges":[">=0,<2.18.1"],"symbols":[{"class":"zserio/runtime/array/Array","method":"read"},{"class":"zserio/runtime/io/ByteArrayBitStreamReader","method":"readBitBuffer"},{"class":"zserio/runtime/io/ByteArrayBitStreamReader","method":"readBytes"},{"class":"zserio/runtime/io/ByteArrayBitStreamReader","method":"readString"}]},{"vuln_id":"GHSA-f2hx-5fx3-hmcv","artifact":"org.keycloak:keycloak-services","version_ranges":[">=0,<26.5.7"],"symbols":[{"class":"org/keycloak/authorization/protection/policy/UserManagedPermissionService","method":"checkRequest"}]},{"vuln_id":"GHSA-h468-7pvh-8vr8","artifact":"org.apache.tomcat:tomcat","version_ranges":[">=9.0.13,<9.0.116",">=10.1.50,<10.1.53",">=11.0.0-M1,<11.0.20"],"symbols":[{"class":"org/apache/catalina/tribes/group/interceptors/EncryptInterceptor","method":"createEncryptionManager"},{"class":"org/apache/catalina/tribes/group/interceptors/EncryptInterceptor","method":"messageReceived"}]},{"vuln_id":"GHSA-h468-7pvh-8vr8","artifact":"org.apache.tomcat:tomcat-tribes","version_ranges":[">=9.0.13,<9.0.116",">=10.1.50,<10.1.53",">=11.0.0-M1,<11.0.20"],"symbols":[{"class":"org/apache/catalina/tribes/group/interceptors/EncryptInterceptor","method":"createEncryptionManager"},{"class":"org/apache/catalina/tribes/group/interceptors/EncryptInterceptor","method":"messageReceived"}]},{"vuln_id":"GHSA-hf5p-q87m-crj7","artifact":"com.github.junrar:junrar","version_ranges":[">=0,<7.5.10"],"symbols":[{"class":"com/github/junrar/LocalFolderExtractor","method":"createDirectory"},{"class":"com/github/junrar/LocalFolderExtractor","method":"createFile"}]},{"vuln_id":"GHSA-x2wq-9x2f-fhj7","artifact":"org.springframework.security:spring-security-core","version_ranges":[">=6.5.0,<6.5.10",">=7.0.3,<7.0.5"],"symbols":[{"class":"org/springframework/security/authentication/ott/JdbcOneTimeTokenService","method":"consume"},{"class":"org/springframework/security/authentication/ott/JdbcOneTimeTokenService","method":"deleteOneTimeToken"}]}]} \ No newline at end of file diff --git a/dd-java-agent/appsec/src/test/groovy/com/datadog/appsec/api/security/ApiSecurityDownstreamSamplerTest.groovy b/dd-java-agent/appsec/src/test/groovy/com/datadog/appsec/api/security/ApiSecurityDownstreamSamplerTest.groovy index d89313b65a7..562925f01af 100644 --- a/dd-java-agent/appsec/src/test/groovy/com/datadog/appsec/api/security/ApiSecurityDownstreamSamplerTest.groovy +++ b/dd-java-agent/appsec/src/test/groovy/com/datadog/appsec/api/security/ApiSecurityDownstreamSamplerTest.groovy @@ -1,6 +1,11 @@ package com.datadog.appsec.api.security +import static datadog.trace.api.config.AppSecConfig.API_SECURITY_DOWNSTREAM_BODY_ANALYSIS_SAMPLE_RATE +import static datadog.trace.api.config.AppSecConfig.API_SECURITY_DOWNSTREAM_REQUEST_ANALYSIS_SAMPLE_RATE +import static datadog.trace.api.config.AppSecConfig.API_SECURITY_DOWNSTREAM_REQUEST_BODY_ANALYSIS_SAMPLE_RATE + import com.datadog.appsec.gateway.AppSecRequestContext +import datadog.trace.api.Config import datadog.trace.test.util.DDSpecification class ApiSecurityDownstreamSamplerTest extends DDSpecification { @@ -43,4 +48,22 @@ class ApiSecurityDownstreamSamplerTest extends DDSpecification { where: rate << [-1.0, 0.0, 0.1, 0.25, 0.5, 0.75, 0.9, 1.0, 2.0] } + + void 'test config aliases'() { + setup: + injectSysConfig(env, "0.25") + + when: + final value = Config.get().getApiSecurityDownstreamRequestBodyAnalysisSampleRate() + + then: + value == 0.25 + + where: + env << [ + API_SECURITY_DOWNSTREAM_BODY_ANALYSIS_SAMPLE_RATE, + API_SECURITY_DOWNSTREAM_REQUEST_ANALYSIS_SAMPLE_RATE, + API_SECURITY_DOWNSTREAM_REQUEST_BODY_ANALYSIS_SAMPLE_RATE, + ] + } } diff --git a/dd-java-agent/appsec/src/test/groovy/com/datadog/appsec/config/AppSecConfigServiceImplSpecification.groovy b/dd-java-agent/appsec/src/test/groovy/com/datadog/appsec/config/AppSecConfigServiceImplSpecification.groovy index e42b82a4b7d..cc650c3c7e6 100644 --- a/dd-java-agent/appsec/src/test/groovy/com/datadog/appsec/config/AppSecConfigServiceImplSpecification.groovy +++ b/dd-java-agent/appsec/src/test/groovy/com/datadog/appsec/config/AppSecConfigServiceImplSpecification.groovy @@ -1,5 +1,6 @@ package com.datadog.appsec.config +import com.datadog.appsec.AppSecModule import com.datadog.appsec.AppSecSystem import com.datadog.appsec.util.AbortStartupException import static datadog.remoteconfig.Capabilities.CAPABILITY_ASM_EXTENDED_DATA_COLLECTION @@ -703,6 +704,49 @@ class AppSecConfigServiceImplSpecification extends DDSpecification { noExceptionThrown() } + void 'currentRuleVersion is updated from diagnostics when InvalidRuleSetException is thrown on RC update'() { + setup: + final key = new ParsedConfigKey('Test', '1234', 1, 'ASM_DD', 'ID') + final service = new AppSecConfigServiceImpl(config, poller, reconf) + AppSecSystem.active = true + config.getAppSecActivation() >> ProductActivation.FULLY_ENABLED + AppSecModule wafModule = Mock() + wafModule.isWafBuilderSet() >> false + service.modulesToUpdateVersionIn([wafModule]) + + when: + service.maybeSubscribeConfigPolling() + + then: + 1 * poller.addListener(Product.ASM_DD, _) >> { + listeners.savedWafDataChangesListener = it[1] + } + + when: + listeners.savedWafDataChangesListener.accept( + key, + '''{ + "version": "2.2", + "metadata": {"rules_version": "1.99.0"}, + "rules": [{ + "id": "invalid-rule", + "name": "Invalid Rule", + "tags": {"type": "attack_attempt", "category": "attack_attempt"}, + "conditions": [{ + "operator": "invalid_operator", + "parameters": {"inputs": [{"address": "server.request.query"}]} + }] + }] + }'''.getBytes(), + NOOP) + + then: + thrown RuntimeException + service.getCurrentRuleVersion() == '1.99.0' + 1 * wafModule.setWafBuilder(_) + 1 * wafModule.setRuleVersion('1.99.0') + } + void 'config keys are added and removed to the set when receiving ASM_DD payloads'() { setup: final key = new ParsedConfigKey('Test', '1234', 1, 'ASM_DD', 'ID') diff --git a/dd-java-agent/appsec/src/test/groovy/com/datadog/appsec/gateway/GatewayBridgeSpecification.groovy b/dd-java-agent/appsec/src/test/groovy/com/datadog/appsec/gateway/GatewayBridgeSpecification.groovy index 36a8ebc861d..7f519c3d76e 100644 --- a/dd-java-agent/appsec/src/test/groovy/com/datadog/appsec/gateway/GatewayBridgeSpecification.groovy +++ b/dd-java-agent/appsec/src/test/groovy/com/datadog/appsec/gateway/GatewayBridgeSpecification.groovy @@ -210,7 +210,7 @@ class GatewayBridgeSpecification extends DDSpecification { 1 * mockAppSecCtx.isWafRequestBlockFailure() 1 * mockAppSecCtx.isWafRateLimited() 1 * mockAppSecCtx.isWafTruncated() - 1 * wafMetricCollector.wafRequest(_, _, _, _, _, _, _) // call waf request metric + 1 * wafMetricCollector.wafRequest(_, _, _, _, _, _, _, _) // call waf request metric flow.result == null flow.action == Flow.Action.Noop.INSTANCE } diff --git a/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaBytecodeTestUtils.java b/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaBytecodeTestUtils.java new file mode 100644 index 00000000000..3b2e4a02d04 --- /dev/null +++ b/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaBytecodeTestUtils.java @@ -0,0 +1,42 @@ +package com.datadog.appsec.sca; + +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import net.bytebuddy.jar.asm.ClassReader; +import net.bytebuddy.jar.asm.ClassWriter; + +final class ScaBytecodeTestUtils { + + private ScaBytecodeTestUtils() {} + + static byte[] bytecodeOf(Class clazz) throws Exception { + String path = clazz.getName().replace('.', '/') + ".class"; + try (InputStream is = clazz.getClassLoader().getResourceAsStream(path)) { + assertNotNull(is, "Cannot load bytecode for " + clazz.getName()); + ByteArrayOutputStream buf = new ByteArrayOutputStream(); + byte[] chunk = new byte[4096]; + int n; + while ((n = is.read(chunk)) != -1) { + buf.write(chunk, 0, n); + } + return buf.toByteArray(); + } + } + + static Class loadModified(byte[] bytecode) { + return new ClassLoader(ScaBytecodeTestUtils.class.getClassLoader()) { + Class define() { + return defineClass(null, bytecode, 0, bytecode.length); + } + }.define(); + } + + static byte[] bytecodeWithoutDebugInfo(Class clazz) throws Exception { + ClassReader cr = new ClassReader(bytecodeOf(clazz)); + ClassWriter cw = new ClassWriter(0); + cr.accept(cw, ClassReader.SKIP_DEBUG); + return cw.toByteArray(); + } +} diff --git a/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaCveDatabaseTest.java b/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaCveDatabaseTest.java new file mode 100644 index 00000000000..5fe9efdbcad --- /dev/null +++ b/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaCveDatabaseTest.java @@ -0,0 +1,195 @@ +package com.datadog.appsec.sca; + +import static java.util.Collections.singletonList; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.StringReader; +import java.util.List; +import org.junit.jupiter.api.Test; + +class ScaCveDatabaseTest { + + private static final String MINIMAL_JSON = + "{\"version\":1,\"entries\":[" + + "{\"vuln_id\":\"GHSA-test-1234-5678\"," + + "\"artifact\":\"com.example:lib\"," + + "\"version_ranges\":[\"< 2.0.0\"]," + + "\"symbols\":[" + + "{\"class\":\"com/example/Foo\",\"method\":\"dangerousOp\"}," + + "{\"class\":\"com/example/Bar\",\"method\":\"dangerousOp\"}" + + "]}]}"; + + @Test + void loadsFromJson() throws Exception { + ScaCveDatabase db = ScaCveDatabase.parse(new StringReader(MINIMAL_JSON)); + + assertFalse(db.isEmpty()); + assertEquals(2, db.size()); // 2 unique class names + } + + @Test + void indexedByClassName() throws Exception { + ScaCveDatabase db = ScaCveDatabase.parse(new StringReader(MINIMAL_JSON)); + + List entries = db.entriesForClass("com/example/Foo"); + assertNotNull(entries); + assertEquals(1, entries.size()); + assertEquals("GHSA-test-1234-5678", entries.get(0).vulnId()); + assertEquals("com.example:lib", entries.get(0).artifact()); + } + + @Test + void unknownClassReturnsNull() throws Exception { + ScaCveDatabase db = ScaCveDatabase.parse(new StringReader(MINIMAL_JSON)); + + assertNull(db.entriesForClass("com/example/Unknown")); + } + + @Test + void emptyEntriesProducesEmptyDatabase() throws Exception { + String json = "{\"version\":1,\"entries\":[]}"; + ScaCveDatabase db = ScaCveDatabase.parse(new StringReader(json)); + + assertTrue(db.isEmpty()); + } + + @Test + void malformedEntryIsSkipped() throws Exception { + String json = + "{\"version\":1,\"entries\":[" + + "{\"vuln_id\":null,\"artifact\":\"com.example:lib\"," + + "\"version_ranges\":[\"< 2.0.0\"],\"symbols\":[{\"class\":\"com/example/Foo\",\"method\":\"op\"}]}," + + "{\"vuln_id\":\"GHSA-good-0000-0000\",\"artifact\":\"com.example:other\"," + + "\"version_ranges\":[\"< 1.0.0\"],\"symbols\":[{\"class\":\"com/example/Good\",\"method\":\"op\"}]}" + + "]}"; + + ScaCveDatabase db = ScaCveDatabase.parse(new StringReader(json)); + + assertNull(db.entriesForClass("com/example/Foo")); + assertNotNull(db.entriesForClass("com/example/Good")); + } + + @Test + void symbolWithNullMethodIsSkipped() throws Exception { + // A symbol with method=null is treated as malformed and skipped. + // If all symbols in an entry are null-method, the whole entry is dropped. + String json = + "{\"version\":1,\"entries\":[" + + "{\"vuln_id\":\"GHSA-null-method\",\"artifact\":\"com.example:lib\"," + + "\"version_ranges\":[\"< 1.0.0\"]," + + "\"symbols\":[{\"class\":\"com/example/Foo\",\"method\":null}]}" + + "]}"; + ScaCveDatabase db = ScaCveDatabase.parse(new StringReader(json)); + + assertTrue(db.isEmpty(), "Entry with all null-method symbols must be dropped"); + } + + @Test + void symbolWithNullMethodSkippedButValidSymbolsKept() throws Exception { + // When an entry has a mix of null-method and valid symbols, only the valid ones are kept. + String json = + "{\"version\":1,\"entries\":[" + + "{\"vuln_id\":\"GHSA-mixed-method\",\"artifact\":\"com.example:lib\"," + + "\"version_ranges\":[\"< 1.0.0\"]," + + "\"symbols\":[" + + "{\"class\":\"com/example/Foo\",\"method\":null}," + + "{\"class\":\"com/example/Foo\",\"method\":\"readValue\"}" + + "]}" + + "]}"; + ScaCveDatabase db = ScaCveDatabase.parse(new StringReader(json)); + + List entries = db.entriesForClass("com/example/Foo"); + assertNotNull(entries); + List symbols = entries.get(0).symbols(); + assertEquals(1, symbols.size(), "null-method symbol must be dropped; valid symbol kept"); + assertEquals("readValue", symbols.get(0).method()); + } + + @Test + void multipleEntriesForSameClass() throws Exception { + String json = + "{\"version\":1,\"entries\":[" + + "{\"vuln_id\":\"GHSA-aaaa-0001-0001\",\"artifact\":\"com.example:lib\"," + + "\"version_ranges\":[\"< 2.0.0\"],\"symbols\":[{\"class\":\"com/example/Shared\",\"method\":\"op\"}]}," + + "{\"vuln_id\":\"GHSA-bbbb-0002-0002\",\"artifact\":\"com.example:lib\"," + + "\"version_ranges\":[\"< 3.0.0\"],\"symbols\":[{\"class\":\"com/example/Shared\",\"method\":\"op\"}]}" + + "]}"; + + ScaCveDatabase db = ScaCveDatabase.parse(new StringReader(json)); + + List entries = db.entriesForClass("com/example/Shared"); + assertNotNull(entries); + assertEquals(2, entries.size()); + } + + @Test + void scaEntryMatchesVersions() { + List expectedRanges = singletonList("< 2.0.0"); + List symbols = singletonList(new ScaSymbol("com/example/Foo", "op")); + ScaEntry entry = new ScaEntry("GHSA-entry", "com.example:lib", expectedRanges, symbols); + + assertEquals(expectedRanges, entry.versionRanges()); + assertTrue(entry.isVersionVulnerable("1.9.9")); + assertFalse(entry.isVersionVulnerable("2.0.0")); + } + + @Test + void scaEntryExposesImmutableLists() { + List ranges = singletonList("< 2.0.0"); + List symbols = singletonList(new ScaSymbol("com/example/Foo", "op")); + ScaEntry entry = new ScaEntry("GHSA-entry", "com.example:lib", ranges, symbols); + + assertThrows(UnsupportedOperationException.class, () -> entry.versionRanges().add("< 3.0.0")); + assertThrows( + UnsupportedOperationException.class, + () -> entry.symbols().add(new ScaSymbol("com/example/Bar", "op"))); + } + + @Test + void entryWithMultipleSymbolsInSameClassIndexedOnce() throws Exception { + // An entry with two symbols for the same class (e.g. Yaml.load + Yaml.loadAll) must appear + // only once in the index. Duplicate entries cause the same bytecode callback to be injected + // twice into each method, producing redundant bootstrap calls on every invocation. + String json = + "{\"version\":1,\"entries\":[" + + "{\"vuln_id\":\"GHSA-mjmj-j48q-9wg2\",\"artifact\":\"org.yaml:snakeyaml\"," + + "\"version_ranges\":[\"<= 1.33\"],\"symbols\":[" + + "{\"class\":\"org/yaml/snakeyaml/Yaml\",\"method\":\"load\"}," + + "{\"class\":\"org/yaml/snakeyaml/Yaml\",\"method\":\"loadAll\"}" + + "]}]}"; + + ScaCveDatabase db = ScaCveDatabase.parse(new StringReader(json)); + + List entries = db.entriesForClass("org/yaml/snakeyaml/Yaml"); + assertNotNull(entries); + assertEquals(1, entries.size(), "same entry must not appear twice even with multiple symbols"); + assertEquals(2, entries.get(0).symbols().size(), "entry must retain all method symbols"); + } + + @Test + void loadFromClasspathSucceeds() { + // Verifies the real sca_cves.json generated by generateScaCvesJson is valid and loadable + ScaCveDatabase db = ScaCveDatabase.load(); + + assertFalse(db.isEmpty(), "sca_cves.json should be on the classpath and contain entries"); + assertTrue(db.size() > 0); + } + + @Test + void junrarLocalFolderExtractorIsIndexed() { + // Spot-check a known entry from the real database (com.github.junrar:junrar, GHSA-hf5p) + ScaCveDatabase db = ScaCveDatabase.load(); + + List entries = db.entriesForClass("com/github/junrar/LocalFolderExtractor"); + assertNotNull(entries, "junrar LocalFolderExtractor should be in the database"); + assertFalse(entries.isEmpty()); + assertTrue( + entries.get(0).symbols().stream().allMatch(s -> s.method() != null), + "all symbols must be method-level"); + } +} diff --git a/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaReachabilityMethodLevelTest.java b/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaReachabilityMethodLevelTest.java new file mode 100644 index 00000000000..5083745e48f --- /dev/null +++ b/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaReachabilityMethodLevelTest.java @@ -0,0 +1,379 @@ +package com.datadog.appsec.sca; + +import static com.datadog.appsec.sca.ScaBytecodeTestUtils.bytecodeOf; +import static com.datadog.appsec.sca.ScaBytecodeTestUtils.bytecodeWithoutDebugInfo; +import static com.datadog.appsec.sca.ScaBytecodeTestUtils.loadModified; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.api.telemetry.ScaReachabilityDependencyRegistry; +import datadog.trace.api.telemetry.ScaReachabilityDependencyRegistry.DependencySnapshot; +import datadog.trace.api.telemetry.ScaReachabilityHit; +import datadog.trace.bootstrap.appsec.sca.ScaReachabilityCallback; +import java.io.StringReader; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** + * Tests for method-level symbol detection ({@code method != null} in sca_cves.json). + * + *

Strategy: test {@link ScaMethodCallbackInjector#inject} directly to verify the ASM injection + * mechanism, decoupled from JAR version resolution. The version resolution path is covered by + * {@link ScaReachabilityTransformerTest}. + */ +class ScaReachabilityMethodLevelTest { + + /** Target class that the transformer will instrument in tests. */ + public static class TargetClass { + public String vulnerableMethod() { + return "executed"; + } + + public String safeMethod() { + return "safe"; + } + } + + /** Fixture compiled normally, then stripped of line numbers before callback injection. */ + public static class ClassToBeStrippedOfLineNumber { + // Intentionally non-final so javac emits a field read instead of inlining a constant. + private static int runtimeFieldValue = 7; + + public static int readField() { + return runtimeFieldValue; + } + + public static Object returnArgument(Object value) { + return value; + } + + public static String callToString(Object value) { + return value.toString(); + } + } + + private ScaCveDatabase db; + private ScaReachabilityTransformer transformer; + + @BeforeEach + void setUp() throws Exception { + ScaReachabilityDependencyRegistry.INSTANCE.resetForTesting(); + // Register the same handler as ScaReachabilitySystem.start() does in production + ScaReachabilityCallback.register( + (vulnId, artifact, version, dotClassName, methodName, line) -> + ScaReachabilityDependencyRegistry.INSTANCE.recordHit( + artifact, version, vulnId, dotClassName, methodName, line)); + db = ScaCveDatabase.parse(new StringReader("{\"version\":1,\"entries\":[]}")); + transformer = new ScaReachabilityTransformer(db, null); + } + + @AfterEach + void tearDown() { + ScaReachabilityDependencyRegistry.INSTANCE.resetForTesting(); + ScaReachabilityCallback.register(null); + } + + // --------------------------------------------------------------------------- + // ASM injection: ScaMethodCallbackInjector.inject() + // --------------------------------------------------------------------------- + + @Test + void inject_returnsModifiedBytecode() throws Exception { + byte[] original = bytecodeOf(TargetClass.class); + Map> callbacks = + singleCallback("vulnerableMethod"); + + byte[] modified = ScaMethodCallbackInjector.inject(original, callbacks); + + assertNotNull(modified, "inject must return non-null modified bytecode"); + } + + @Test + void inject_callbackFiredOnMethodCall() throws Exception { + byte[] original = bytecodeOf(TargetClass.class); + Map> callbacks = + singleCallback("vulnerableMethod"); + + byte[] modified = ScaMethodCallbackInjector.inject(original, callbacks); + Class cls = loadModified(modified); + Object instance = cls.getDeclaredConstructor().newInstance(); + cls.getMethod("vulnerableMethod").invoke(instance); + + List hits = drainHits(); + assertEquals(1, hits.size()); + ScaReachabilityHit hit = hits.get(0); + assertEquals("GHSA-method-0001", hit.vulnId()); + assertEquals("com.example:test-lib", hit.artifact()); + assertEquals("1.2.3", hit.version()); + // Callsite semantics: path/symbol/line should be the APPLICATION frame that invoked the + // vulnerable method. In production (e.g. TargetClass = com.fasterxml.jackson.ObjectMapper), + // findCallsite() finds the caller and returns it. + // + // In this test, TargetClass is in com.datadog.appsec.sca.* which AbstractStackWalker + // treats as agent code and filters out. findCallsite() returns null and the handler falls + // back to reporting the vulnerable symbol itself (dotClassName/methodName). + // This verifies the fallback path works correctly. + assertFalse( + hit.className().isEmpty(), "className must be non-empty (fallback: vulnerable class)"); + assertFalse(hit.symbolName().isEmpty(), "symbolName must be non-empty"); + assertTrue(hit.line() >= 0, "line must be non-negative"); + } + + @Test + void inject_noCallbackForSafeMethod() throws Exception { + byte[] original = bytecodeOf(TargetClass.class); + Map> callbacks = + singleCallback("vulnerableMethod"); + + byte[] modified = ScaMethodCallbackInjector.inject(original, callbacks); + Class cls = loadModified(modified); + Object instance = cls.getDeclaredConstructor().newInstance(); + cls.getMethod("safeMethod").invoke(instance); // call only the safe method + + assertTrue( + drainHits().isEmpty(), "No hit expected when only non-instrumented methods are called"); + } + + @Test + void inject_deduplicatesOnMultipleCalls() throws Exception { + byte[] original = bytecodeOf(TargetClass.class); + Map> callbacks = + singleCallback("vulnerableMethod"); + + byte[] modified = ScaMethodCallbackInjector.inject(original, callbacks); + Class cls = loadModified(modified); + Object instance = cls.getDeclaredConstructor().newInstance(); + Method m = cls.getMethod("vulnerableMethod"); + + m.invoke(instance); + m.invoke(instance); + m.invoke(instance); + + assertEquals( + 1, + drainHits().size(), + "Hit must be reported only once regardless of how many times the method is called"); + } + + @Test + void inject_injectsMultipleMethodsIndependently() throws Exception { + byte[] original = bytecodeOf(TargetClass.class); + Map> callbacks = new HashMap<>(); + callbacks.put( + "vulnerableMethod", + Collections.singletonList( + spec("GHSA-m1", "com.example:lib", "1.0.0", "T", "vulnerableMethod"))); + callbacks.put( + "safeMethod", + Collections.singletonList(spec("GHSA-m2", "com.example:lib", "1.0.0", "T", "safeMethod"))); + + byte[] modified = ScaMethodCallbackInjector.inject(original, callbacks); + Class cls = loadModified(modified); + Object instance = cls.getDeclaredConstructor().newInstance(); + + cls.getMethod("vulnerableMethod").invoke(instance); + cls.getMethod("safeMethod").invoke(instance); + + List hits = drainHits(); + assertEquals(2, hits.size(), "Each instrumented method produces its own hit"); + assertTrue(hits.stream().anyMatch(h -> h.symbolName().equals("vulnerableMethod"))); + assertTrue(hits.stream().anyMatch(h -> h.symbolName().equals("safeMethod"))); + } + + @Test + void inject_withoutLineNumbersInjectsBeforeFirstInstruction() throws Exception { + byte[] original = bytecodeWithoutDebugInfo(ClassToBeStrippedOfLineNumber.class); + String className = ClassToBeStrippedOfLineNumber.class.getName(); + Map> callbacks = new HashMap<>(); + callbacks.put( + "readField", + Collections.singletonList( + spec("GHSA-field", "com.example:lib", "1.0.0", className, "readField"))); + callbacks.put( + "returnArgument", + Collections.singletonList( + spec("GHSA-var", "com.example:lib", "1.0.0", className, "returnArgument"))); + callbacks.put( + "callToString", + Collections.singletonList( + spec("GHSA-method", "com.example:lib", "1.0.0", className, "callToString"))); + + Class cls = loadModified(ScaMethodCallbackInjector.inject(original, callbacks)); + + assertEquals(7, cls.getMethod("readField").invoke(null)); + assertEquals("value", cls.getMethod("returnArgument", Object.class).invoke(null, "value")); + assertEquals("value", cls.getMethod("callToString", Object.class).invoke(null, "value")); + + List hits = drainHits(); + assertEquals(3, hits.size()); + assertTrue(hits.stream().allMatch(hit -> hit.line() == 1)); + assertTrue(hits.stream().anyMatch(hit -> hit.symbolName().equals("readField"))); + assertTrue(hits.stream().anyMatch(hit -> hit.symbolName().equals("returnArgument"))); + assertTrue(hits.stream().anyMatch(hit -> hit.symbolName().equals("callToString"))); + } + + @Test + void inject_sameMethodNameInDifferentClassesProduceIndependentHits() throws Exception { + // Regression test for dedup key bug: if two classes in the same artifact share a method + // name (e.g. ClassA.parse and ClassB.parse), both must be reported independently. + // With the stateful RFC model, one hit per CVE is reported (first occurrence wins). + // The dedup key in ScaReachabilityCallback uses dotClassName to allow both classes to reach + // the registry handler, but the registry itself enforces "single occurrence per CVE". + // This verifies that ClassB's hit does NOT cause a NullPointerException or error — it is + // simply ignored since ClassA already provided the first callsite for GHSA-shared. + + Map> callbacksClassA = + new HashMap<>(); + callbacksClassA.put( + "vulnerableMethod", + Collections.singletonList( + spec( + "GHSA-shared", + "com.example:lib", + "1.0.0", + "com.example.ClassA", + "vulnerableMethod"))); + + Map> callbacksClassB = + new HashMap<>(); + callbacksClassB.put( + "vulnerableMethod", + Collections.singletonList( + spec( + "GHSA-shared", + "com.example:lib", + "1.0.0", + "com.example.ClassB", + "vulnerableMethod"))); + + byte[] original = bytecodeOf(TargetClass.class); + Class clsA = loadModified(ScaMethodCallbackInjector.inject(original, callbacksClassA)); + Class clsB = loadModified(ScaMethodCallbackInjector.inject(original, callbacksClassB)); + + clsA.getMethod("vulnerableMethod").invoke(clsA.getDeclaredConstructor().newInstance()); + clsB.getMethod("vulnerableMethod").invoke(clsB.getDeclaredConstructor().newInstance()); + + List hits = drainHits(); + // RFC: "reporting a single occurrence is sufficient" — only the first callsite per CVE is kept. + assertEquals(1, hits.size(), "Only the first hit per CVE is retained (RFC: single occurrence)"); + assertEquals("GHSA-shared", hits.get(0).vulnId()); + } + + // --------------------------------------------------------------------------- + // transform(): two-phase design — first load enqueues, retransform injects + // --------------------------------------------------------------------------- + + @Test + void transform_firstLoad_schedulesRetransformAndReturnsNull() throws Exception { + String json = + "{\"version\":1,\"entries\":[{" + + "\"vuln_id\":\"GHSA-cls\",\"artifact\":\"com.example:lib\"," + + "\"version_ranges\":[\"< 999.0.0\"]," + + "\"symbols\":[{\"class\":\"" + + TargetClass.class.getName().replace('.', '/') + + "\",\"method\":\"vulnerableMethod\"}]" + + "}]}"; + ScaCveDatabase classDb = ScaCveDatabase.parse(new StringReader(json)); + ScaReachabilityTransformer t = new ScaReachabilityTransformer(classDb, null); + + byte[] result = + t.transform( + null, + TargetClass.class.getName().replace('.', '/'), + null, // classBeingRedefined == null → first load path + TargetClass.class.getProtectionDomain(), + bytecodeOf(TargetClass.class)); + + assertNull(result, "First load must return null (JAR I/O deferred to periodic task)"); + assertFalse( + t.pendingRetransformNames.isEmpty(), + "First load must add the class name to pendingRetransformNames for the next heartbeat"); + } + + @Test + void transform_retransform_processesInlineAndDoesNotReSchedule() throws Exception { + // On retransform (classBeingRedefined != null), transform() calls processClass() inline. + // Version resolution fails in the unit-test context (no real JAR for com.example:lib), + // so processClass() re-queues in pendingRetransformNames for a retry, but the key invariant + // is that the retransform path reaches processClass() rather than the first-load fast-path. + String json = + "{\"version\":1,\"entries\":[{" + + "\"vuln_id\":\"GHSA-mth\",\"artifact\":\"com.example:lib\"," + + "\"version_ranges\":[\"< 999.0.0\"]," + + "\"symbols\":[{\"class\":\"" + + TargetClass.class.getName().replace('.', '/') + + "\",\"method\":\"vulnerableMethod\"}]" + + "}]}"; + ScaCveDatabase methodDb = ScaCveDatabase.parse(new StringReader(json)); + ScaReachabilityTransformer t = new ScaReachabilityTransformer(methodDb, null); + + // Start clean: no pending retransforms + assertTrue(t.pendingRetransformNames.isEmpty()); + + t.transform( + null, + TargetClass.class.getName().replace('.', '/'), + TargetClass.class, // classBeingRedefined != null → retransform path + TargetClass.class.getProtectionDomain(), + bytecodeOf(TargetClass.class)); + + // Version resolution failed (no pom.properties for com.example:lib in test classpath), + // so processClass() re-queued the class for a retry on the next heartbeat. + // This confirms the retransform path reached processClass() rather than the first-load path. + assertFalse( + t.pendingRetransformNames.isEmpty(), + "processClass() must re-queue on version resolution failure for heartbeat retry"); + } + + // --------------------------------------------------------------------------- + // Helpers + // --------------------------------------------------------------------------- + + /** + * Extracts ScaReachabilityHit objects from pending dependencies in the registry. Only returns + * CVEs that have an actual hit (callsite recorded), not empty-reached CVEs. + */ + private static List drainHits() { + List result = new ArrayList<>(); + for (DependencySnapshot dep : + ScaReachabilityDependencyRegistry.INSTANCE.drainPendingDependencies()) { + for (ScaReachabilityDependencyRegistry.CveSnapshot cve : dep.cves) { + if (cve.hit != null) { + result.add(cve.hit); + } + } + } + return result; + } + + private static Map> singleCallback( + String methodName) { + Map> m = new HashMap<>(); + m.put( + methodName, + Collections.singletonList( + spec( + "GHSA-method-0001", + "com.example:test-lib", + "1.2.3", + TargetClass.class.getName(), + methodName))); + return m; + } + + private static ScaMethodCallbackInjector.MethodCallbackSpec spec( + String vulnId, String artifact, String version, String dotClass, String method) { + return new ScaMethodCallbackInjector.MethodCallbackSpec( + vulnId, artifact, version, dotClass, method); + } +} diff --git a/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaReachabilityRetransformTest.java b/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaReachabilityRetransformTest.java new file mode 100644 index 00000000000..aa37b1fcb1f --- /dev/null +++ b/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaReachabilityRetransformTest.java @@ -0,0 +1,106 @@ +package com.datadog.appsec.sca; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import java.io.StringReader; +import java.lang.instrument.Instrumentation; +import org.junit.jupiter.api.Test; + +/** + * Regression tests for {@link ScaReachabilityTransformer#performPendingRetransforms()}. + * + *

Spring Boot fat JARs create multiple {@code LaunchedURLClassLoader} instances, each loading + * their own copy of the same vulnerable class. The name-based retransform path must retransform ALL + * classloader instances, not just the first one found. + * + *

The bug: {@code pendingRetransformNames.remove(name)} inside the loop returned {@code true} + * only for the first matching class, so subsequent instances were silently skipped. The fix uses + * {@code contains(name)} inside the loop and {@code removeAll(matched)} after, collecting every + * class before any removal. + */ +class ScaReachabilityRetransformTest { + + /** Dummy class used as the retransform target in tests. */ + public static class Target { + public void method() {} + } + + @Test + void performPendingRetransforms_retransformsAllMatchingInstances() throws Exception { + // Returning the same Class twice in getAllLoadedClasses() simulates two classloader + // instances holding the same vulnerable class. With the old remove()-inside-loop approach + // only the first entry was retransformed; with contains()+removeAll() both are collected. + String internalName = Target.class.getName().replace('.', '/'); + + Instrumentation instr = mock(Instrumentation.class); + when(instr.getAllLoadedClasses()).thenReturn(new Class[] {Target.class, Target.class}); + when(instr.isModifiableClass(Target.class)).thenReturn(true); + + ScaCveDatabase db = ScaCveDatabase.parse(new StringReader("{\"version\":1,\"entries\":[]}")); + ScaReachabilityTransformer t = new ScaReachabilityTransformer(db, instr); + t.pendingRetransformNames.add(internalName); + + t.performPendingRetransforms(); + + // Both entries must reach retransformClasses: with the old remove() approach only the first + // matched (length 1). With contains()+removeAll() both are collected (length 2). + // Mockito expands varargs as individual arguments, so verify with two explicit entries. + verify(instr).retransformClasses(Target.class, Target.class); + assertTrue( + t.pendingRetransformNames.isEmpty(), + "internal name must be removed from the pending set after retransform"); + } + + @Test + void performPendingRetransforms_requeuesOnRetransformFailure() throws Exception { + String internalName = Target.class.getName().replace('.', '/'); + + Instrumentation instr = mock(Instrumentation.class); + when(instr.getAllLoadedClasses()).thenReturn(new Class[] {Target.class, Target.class}); + when(instr.isModifiableClass(Target.class)).thenReturn(true); + doThrow(new RuntimeException("retransform failed")).when(instr).retransformClasses(any()); + + ScaCveDatabase db = ScaCveDatabase.parse(new StringReader("{\"version\":1,\"entries\":[]}")); + ScaReachabilityTransformer t = new ScaReachabilityTransformer(db, instr); + t.pendingRetransformNames.add(internalName); + + t.performPendingRetransforms(); + + assertEquals( + 2, + t.pendingRetransform.size(), + "both classes must be re-queued in pendingRetransform for the next heartbeat retry"); + } + + @Test + void performPendingRetransforms_skipsNonModifiableClasses() throws Exception { + // Non-modifiable classes (e.g. JDK classes, primitive wrappers) must be silently discarded + // from the pending set and never passed to retransformClasses. Without this guard they would + // loop forever: retransformClasses rejects them, the catch re-queues them, next heartbeat + // tries again, ad infinitum. + String internalName = Target.class.getName().replace('.', '/'); + + Instrumentation instr = mock(Instrumentation.class); + when(instr.getAllLoadedClasses()).thenReturn(new Class[] {Target.class}); + when(instr.isModifiableClass(Target.class)).thenReturn(false); + + ScaCveDatabase db = ScaCveDatabase.parse(new StringReader("{\"version\":1,\"entries\":[]}")); + ScaReachabilityTransformer t = new ScaReachabilityTransformer(db, instr); + t.pendingRetransformNames.add(internalName); + + t.performPendingRetransforms(); + + assertTrue( + t.pendingRetransformNames.isEmpty(), + "non-modifiable class must be removed from pendingRetransformNames"); + assertTrue( + t.pendingRetransform.isEmpty(), + "non-modifiable class must not be re-queued in pendingRetransform"); + } +} diff --git a/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaReachabilitySystemCallsiteTest.java b/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaReachabilitySystemCallsiteTest.java new file mode 100644 index 00000000000..38dbb4130f5 --- /dev/null +++ b/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaReachabilitySystemCallsiteTest.java @@ -0,0 +1,99 @@ +package com.datadog.appsec.sca; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; + +import org.junit.jupiter.api.Test; + +/** Unit tests for {@link ScaReachabilitySystem#findCallsite(String, StackTraceElement[])}. */ +class ScaReachabilitySystemCallsiteTest { + + private static final String VULNERABLE_CLASS = "org.yaml.snakeyaml.Yaml"; + + @Test + void findCallsite_returnsNullWhenVulnerableClassIsNotInStack() { + StackTraceElement[] stack = { + frame("sca.test.TestController", "doSomething"), + }; + + assertNull( + ScaReachabilitySystem.findCallsite("com.example.ClassNotOnStack", stack), + "Should return null when vulnerable class is not on the stack"); + } + + @Test + void findCallsite_returnsDirectCallerWhenNoIntermediateLibrary() { + StackTraceElement[] stack = { + frame(VULNERABLE_CLASS, "load"), frame("sca.test.TestController", "yamlHitDirect"), + }; + + StackTraceElement result = ScaReachabilitySystem.findCallsite(VULNERABLE_CLASS, stack); + + assertEquals("sca.test.TestController", result.getClassName()); + assertEquals("yamlHitDirect", result.getMethodName()); + } + + @Test + void findCallsite_skipsRepeatedVulnerableFrames() { + StackTraceElement[] stack = { + frame(VULNERABLE_CLASS, "load"), + frame(VULNERABLE_CLASS, "loadAll"), + frame("sca.test.TestController", "yamlHitRecursive"), + }; + + StackTraceElement result = ScaReachabilitySystem.findCallsite(VULNERABLE_CLASS, stack); + + assertEquals("sca.test.TestController", result.getClassName()); + assertEquals("yamlHitRecursive", result.getMethodName()); + } + + @Test + void findCallsite_skipsIntermediateLibraryFrameAndReturnsClientCode() { + // com.google.* is excluded by the SCA trie (value >= 1) + StackTraceElement[] stack = { + frame(VULNERABLE_CLASS, "load"), + frame("com.google.yaml.YamlWrapper", "load"), + frame("sca.test.TestController", "yamlHitTransitive"), + }; + + StackTraceElement result = ScaReachabilitySystem.findCallsite(VULNERABLE_CLASS, stack); + + assertEquals( + "sca.test.TestController", + result.getClassName(), + "Should skip intermediate library frame and return application code"); + assertEquals("yamlHitTransitive", result.getMethodName()); + } + + @Test + void findCallsite_skipsMultipleIntermediateLibraryFrames() { + StackTraceElement[] stack = { + frame(VULNERABLE_CLASS, "load"), + frame("com.google.yaml.YamlWrapper", "load"), + frame("org.springframework.beans.factory.xml.XmlBeanFactory", "init"), + frame("sca.test.TestController", "yamlHitDeep"), + }; + + StackTraceElement result = ScaReachabilitySystem.findCallsite(VULNERABLE_CLASS, stack); + + assertEquals("sca.test.TestController", result.getClassName()); + assertEquals("yamlHitDeep", result.getMethodName()); + } + + @Test + void findCallsite_returnsNullWhenOnlyLibraryFramesFollowVulnerableClass() { + StackTraceElement[] stack = { + frame(VULNERABLE_CLASS, "load"), + frame("com.google.yaml.YamlWrapper", "load"), + frame("org.springframework.beans.factory.BeanFactory", "getBean"), + }; + + assertNull( + ScaReachabilitySystem.findCallsite(VULNERABLE_CLASS, stack), + "Should return null and trigger fallback when no application frame is found"); + } + + private static StackTraceElement frame(String className, String methodName) { + return new StackTraceElement(className, methodName, null, -1); + } +} diff --git a/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaReachabilitySystemTest.java b/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaReachabilitySystemTest.java new file mode 100644 index 00000000000..82c7f62a9ca --- /dev/null +++ b/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaReachabilitySystemTest.java @@ -0,0 +1,53 @@ +package com.datadog.appsec.sca; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import datadog.trace.api.telemetry.ScaReachabilityDependencyRegistry; +import datadog.trace.api.telemetry.ScaReachabilityHit; +import datadog.trace.bootstrap.appsec.sca.ScaReachabilityCallback; +import java.lang.instrument.Instrumentation; +import java.util.List; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; + +class ScaReachabilitySystemTest { + + @AfterEach + void tearDown() { + ScaReachabilityDependencyRegistry.INSTANCE.resetForTesting(); + ScaReachabilityCallback.register(null); + } + + @Test + void startRegistersTransformerCallbackAndPeriodicWork() { + Instrumentation instrumentation = mock(Instrumentation.class); + when(instrumentation.getAllLoadedClasses()).thenReturn(new Class[0]); + + ScaReachabilitySystem.start(instrumentation); + + verify(instrumentation).addTransformer(any(ScaReachabilityTransformer.class), eq(true)); + assertNotNull(ScaReachabilityDependencyRegistry.INSTANCE.getPeriodicWorkCallback()); + + ScaReachabilityCallback.onMethodHit( + "GHSA-start", "com.example:lib", "1.0.0", "missing.Vulnerable", "danger", 42); + + List snapshots = + ScaReachabilityDependencyRegistry.INSTANCE.drainPendingDependencies(); + assertEquals(1, snapshots.size()); + assertEquals("com.example:lib", snapshots.get(0).artifact); + assertEquals("1.0.0", snapshots.get(0).version); + assertEquals(1, snapshots.get(0).cves.size()); + ScaReachabilityHit hit = snapshots.get(0).cves.get(0).hit; + assertNotNull(hit); + assertEquals("GHSA-start", hit.vulnId()); + assertEquals("missing.Vulnerable", hit.className()); + assertEquals("danger", hit.symbolName()); + assertEquals(42, hit.line()); + } +} diff --git a/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaReachabilityTransformerJava9Test.java b/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaReachabilityTransformerJava9Test.java new file mode 100644 index 00000000000..48bfa48b1a9 --- /dev/null +++ b/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaReachabilityTransformerJava9Test.java @@ -0,0 +1,407 @@ +package com.datadog.appsec.sca; + +import static com.datadog.appsec.sca.ScaBytecodeTestUtils.bytecodeOf; +import static java.util.Collections.emptyList; +import static java.util.Collections.singletonList; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import datadog.telemetry.dependency.Dependency; +import datadog.trace.api.telemetry.ScaReachabilityDependencyRegistry; +import java.io.StringReader; +import java.lang.instrument.Instrumentation; +import java.net.URLClassLoader; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.condition.EnabledForJreRange; +import org.junit.jupiter.api.condition.JRE; + +/** + * Verifies that {@code findArtifactVersionInClasspath} relies only on {@code java.class.path} and + * not on a URLClassLoader chain walk. + * + *

There are two independent reasons why a URLClassLoader walk cannot work here: + * + *

    + *
  1. Agent thread constraint: {@code AgentThreadFactory} explicitly sets the context + * classloader to {@code null} on every agent thread ({@code + * thread.setContextClassLoader(null)}), so {@code + * Thread.currentThread().getContextClassLoader()} always returns {@code null} on the + * telemetry thread where this method runs. Any URLClassLoader chain walk starting from {@code + * null} is a no-op. + *
  2. Java 9+ system classloader: On Java 9+, the system classloader is {@code + * jdk.internal.loader.ClassLoaders$AppClassLoader}, which does not extend {@link + * URLClassLoader}. Even if a non-null classloader were available, the system classloader + * would be missed by any {@code instanceof URLClassLoader} walk. + *
+ * + *

The {@code java.class.path} system property covers standard deployments (JARs passed via + * {@code -cp}). OSGi bundles and Spring Boot fat JAR nested libraries loaded via {@code + * LaunchedURLClassLoader} are a known limitation: they are not listed in {@code java.class.path} + * and cannot be reached from this method. + */ +class ScaReachabilityTransformerJava9Test { + + private static final String JACKSON_JSON = + "{\"version\":1,\"entries\":[{" + + "\"vuln_id\":\"GHSA-test-jackson\"," + + "\"artifact\":\"com.fasterxml.jackson.core:jackson-databind\"," + + "\"version_ranges\":[\"< 999.0.0\"]," + + "\"symbols\":[{\"class\":\"com/fasterxml/jackson/databind/ObjectMapper\",\"method\":\"readValue\"}]" + + "}]}"; + + @AfterEach + void resetRegistry() { + ScaReachabilityDependencyRegistry.INSTANCE.resetForTesting(); + } + + @Test + @EnabledForJreRange(min = JRE.JAVA_9) + void systemClassLoaderIsNotUrlClassLoaderOnJava9Plus() { + // This is the root cause of the bug: the URLClassLoader chain walk misses the system + // classloader on Java 9+. Verify our assumption so the test has a clear failure message + // if the JDK ever reverts this (extremely unlikely). + assertFalse( + ClassLoader.getSystemClassLoader() instanceof URLClassLoader, + "On Java 9+, the system classloader must not be a URLClassLoader — " + + "this is the invariant that makes the java.class.path fallback necessary"); + } + + @Test + @EnabledForJreRange(min = JRE.JAVA_9) + void findArtifactVersionInClasspath_findsArtifactViaJavaClassPathOnJava9Plus() throws Exception { + // jackson-databind is on the test classpath (testImplementation dependency). + // On Java 9+, it would NOT be found by the URLClassLoader chain because the system + // classloader is not a URLClassLoader. The java.class.path fallback must find it. + ScaCveDatabase db = ScaCveDatabase.parse(new StringReader(JACKSON_JSON)); + ScaReachabilityTransformer transformer = new ScaReachabilityTransformer(db, null); + + String version = + transformer.findArtifactVersionInClasspath("com.fasterxml.jackson.core:jackson-databind"); + + assertNotNull( + version, + "jackson-databind must be found via java.class.path fallback on Java 9+. " + + "java.class.path=" + + System.getProperty("java.class.path", "")); + } + + @Test + @EnabledForJreRange(min = JRE.JAVA_9) + void findArtifactVersionInClasspath_returnsNullForUnknownArtifact() throws Exception { + ScaCveDatabase db = ScaCveDatabase.parse(new StringReader(JACKSON_JSON)); + ScaReachabilityTransformer transformer = new ScaReachabilityTransformer(db, null); + + String version = transformer.findArtifactVersionInClasspath("com.example:nonexistent-artifact"); + + assertNull(version, "Unknown artifacts must return null"); + } + + // --------------------------------------------------------------------------- + // matchVersion: artifact-ID-only fallback for JARs without pom.properties + // --------------------------------------------------------------------------- + + @Test + void matchVersion_exactMatchReturnsVersion() { + Dependency dep = new Dependency("com.github.junrar:junrar", "7.5.5", "junrar-7.5.5.jar", null); + assertEquals( + "7.5.5", + ScaReachabilityTransformer.matchVersion("com.github.junrar:junrar", singletonList(dep))); + } + + @Test + void matchVersion_artifactIdOnlyFallbackForNoPomJar() { + // Models guessFallbackNoPom result: no pom.properties in junrar-7.5.5.jar, + // so DependencyResolver extracts only the artifact ID from the filename. + Dependency dep = new Dependency("junrar", "7.5.5", "junrar-7.5.5.jar", null); + assertEquals( + "7.5.5", + ScaReachabilityTransformer.matchVersion("com.github.junrar:junrar", singletonList(dep)), + "artifact-ID fallback must match 'junrar' against 'com.github.junrar:junrar'"); + } + + @Test + void matchVersion_artifactIdFallbackDoesNotMatchWhenGroupIdPresent() { + // If dep.name already contains ':' (from pom.properties), artifact-ID fallback must not fire: + // "org.other:junrar" should NOT match "com.github.junrar:junrar". + Dependency dep = new Dependency("org.other:junrar", "1.0.0", "junrar-1.0.0.jar", null); + assertNull( + ScaReachabilityTransformer.matchVersion("com.github.junrar:junrar", singletonList(dep)), + "artifact-ID fallback must not fire when dep.name already has a group ID"); + } + + @Test + void matchVersion_emptyListReturnsNull() { + assertNull(ScaReachabilityTransformer.matchVersion("com.github.junrar:junrar", emptyList())); + } + + @Test + void matchVersion_exactMatchTakesPrecedenceOverFallback() { + // Exact match must win even when an artifact-ID-only dep is also present. + Dependency exact = new Dependency("com.github.junrar:junrar", "7.5.5", "a.jar", null); + Dependency fallback = new Dependency("junrar", "1.0.0", "b.jar", null); + assertEquals( + "7.5.5", + ScaReachabilityTransformer.matchVersion( + "com.github.junrar:junrar", Arrays.asList(fallback, exact))); + } + + /** + * Regression test for the snakeyaml deadlock (APPSEC-62260 follow-up): + * + *

JAR resolution (I/O via {@code resolveDependencies}) must happen on the telemetry thread + * BEFORE {@code retransformClasses()} acquires JVM locks. If I/O runs inside the retransform + * callback, libraries that trigger class loading during JAR resolution (e.g. snakeyaml) can + * deadlock because the JVM class-loading lock and the retransform lock are both held. + * + *

With a mock {@code Instrumentation}, the retransform callback never fires, so {@code + * resolveDependencies} (and therefore {@code jarCache}) can only be populated by the pre-warming + * step that runs before {@code retransformClasses()}. The test asserts that {@code jarCache} is + * non-empty after the call, which is only possible if the pre-warm loop ran. + */ + @Test + void performPendingRetransforms_prewarms_jarCache_before_retransformClasses() throws Exception { + Instrumentation mockInstr = mock(Instrumentation.class); + when(mockInstr.isModifiableClass(any())).thenReturn(true); + when(mockInstr.getAllLoadedClasses()).thenReturn(new Class[0]); + + ScaCveDatabase db = ScaCveDatabase.parse(new StringReader(JACKSON_JSON)); + ScaReachabilityTransformer transformer = new ScaReachabilityTransformer(db, mockInstr); + + transformer.pendingRetransform.add(com.fasterxml.jackson.databind.ObjectMapper.class); + transformer.performPendingRetransforms(); + + assertFalse( + transformer.jarCache.isEmpty(), + "jarCache must be populated by the pre-warming step that runs before retransformClasses();" + + " with a mock Instrumentation the transform callback never fires, so an empty jarCache" + + " means the pre-warm loop was not executed"); + } + + /** + * Regression test for the aggregator-artifact deadlock gap (Codex P1 on PR #11614): + * + *

When the entry's artifact is not in the class's own JAR (aggregator/starter case, e.g., + * {@code spring-boot-starter-web} whose watched classes live in {@code spring-context.jar}), + * {@code resolveVersionForArtifact()} falls through to {@code findArtifactVersionInClasspath()}, + * which calls {@code resolveDependencies()} for every {@code java.class.path} entry — fresh JAR + * I/O that would deadlock if it ran inside the retransform callback. + * + *

The pre-warm step must also populate {@code classpathArtifactCache} before {@code + * retransformClasses()} acquires JVM locks. With a mock {@code Instrumentation} the callback + * never fires, so the only way {@code classpathArtifactCache} can be populated is via the + * pre-warm loop. {@code ObjectMapper} lives in {@code jackson-databind.jar}; the entry's artifact + * is {@code jackson-core} (a different JAR that is a transitive test dependency), so {@code + * matchVersion} fails on the class JAR and the classpath fallback must run during pre-warm. + */ + @Test + void performPendingRetransforms_prewarms_classpathArtifactCache_for_aggregator_artifacts() + throws Exception { + // Entry artifact is jackson-core, but ObjectMapper is in jackson-databind.jar. + // matchVersion() returns null on classJarDeps → triggers findArtifactVersionInClasspath(). + String crossJarJson = + "{\"version\":1,\"entries\":[{" + + "\"vuln_id\":\"GHSA-test-cross-jar\"," + + "\"artifact\":\"com.fasterxml.jackson.core:jackson-core\"," + + "\"version_ranges\":[\"< 999.0.0\"]," + + "\"symbols\":[{\"class\":\"com/fasterxml/jackson/databind/ObjectMapper\"," + + "\"method\":\"readValue\"}]}]}"; + + Instrumentation mockInstr = mock(Instrumentation.class); + when(mockInstr.isModifiableClass(any())).thenReturn(true); + when(mockInstr.getAllLoadedClasses()).thenReturn(new Class[0]); + + ScaCveDatabase db = ScaCveDatabase.parse(new StringReader(crossJarJson)); + ScaReachabilityTransformer transformer = new ScaReachabilityTransformer(db, mockInstr); + + transformer.pendingRetransform.add(com.fasterxml.jackson.databind.ObjectMapper.class); + transformer.performPendingRetransforms(); + + // jackson-core is on the test classpath (transitive dependency of jackson-databind). + // classpathArtifactCache must be populated during pre-warm — not by the callback (which never + // fires with a mock Instrumentation). An empty cache means findArtifactVersionInClasspath() + // would run under JVM retransform locks and risk the snakeyaml-style deadlock. + assertNotNull( + transformer.classpathArtifactCache.get("com.fasterxml.jackson.core:jackson-core"), + "classpathArtifactCache must be populated during pre-warm for aggregator artifacts; " + + "if empty, findArtifactVersionInClasspath() would run under JVM retransform locks"); + } + + @Test + void transform_retransform_injectsCallbacksWhenVersionResolvedFromCache() throws Exception { + String internalName = + ScaReachabilityMethodLevelTest.TargetClass.class.getName().replace('.', '/'); + String json = + "{\"version\":1,\"entries\":[{" + + "\"vuln_id\":\"GHSA-transform\"," + + "\"artifact\":\"com.example:lib\"," + + "\"version_ranges\":[\"< 999.0.0\"]," + + "\"symbols\":[{\"class\":\"" + + internalName + + "\",\"method\":\"vulnerableMethod\"}]" + + "}]}"; + ScaCveDatabase db = ScaCveDatabase.parse(new StringReader(json)); + ScaReachabilityTransformer transformer = new ScaReachabilityTransformer(db, null); + transformer.jarCache.put( + ScaReachabilityMethodLevelTest.TargetClass.class + .getProtectionDomain() + .getCodeSource() + .getLocation() + .toURI(), + singletonList(new Dependency("com.example:lib", "1.2.3", "test.jar", null))); + + byte[] transformed = + transformer.transform( + null, + internalName, + ScaReachabilityMethodLevelTest.TargetClass.class, + ScaReachabilityMethodLevelTest.TargetClass.class.getProtectionDomain(), + bytecodeOf(ScaReachabilityMethodLevelTest.TargetClass.class)); + + assertNotNull(transformed); + assertTrue(transformer.pendingRetransformNames.isEmpty()); + List snapshots = + ScaReachabilityDependencyRegistry.INSTANCE.drainPendingDependencies(); + assertEquals(1, snapshots.size()); + assertEquals("com.example:lib", snapshots.get(0).artifact); + assertEquals("1.2.3", snapshots.get(0).version); + assertEquals("GHSA-transform", snapshots.get(0).cves.get(0).vulnId); + assertNull(snapshots.get(0).cves.get(0).hit); + } + + @Test + void checkAlreadyLoadedClassesSchedulesOnlyMatchingNonBootstrapClasses() throws Exception { + String internalName = + ScaReachabilityMethodLevelTest.TargetClass.class.getName().replace('.', '/'); + String json = + "{\"version\":1,\"entries\":[" + + "{\"vuln_id\":\"GHSA-target\",\"artifact\":\"com.example:lib\"," + + "\"version_ranges\":[\"< 999.0.0\"]," + + "\"symbols\":[{\"class\":\"" + + internalName + + "\",\"method\":\"vulnerableMethod\"}]}," + + "{\"vuln_id\":\"GHSA-jdk\",\"artifact\":\"com.example:jdk\"," + + "\"version_ranges\":[\"< 999.0.0\"]," + + "\"symbols\":[{\"class\":\"java/lang/String\",\"method\":\"substring\"}]}" + + "]}"; + + Instrumentation mockInstr = mock(Instrumentation.class); + when(mockInstr.getAllLoadedClasses()) + .thenReturn( + new Class[] { + null, String[].class, String.class, ScaReachabilityMethodLevelTest.TargetClass.class, + }); + ScaReachabilityTransformer transformer = + new ScaReachabilityTransformer(ScaCveDatabase.parse(new StringReader(json)), mockInstr); + + transformer.checkAlreadyLoadedClasses(); + + assertEquals(1, transformer.pendingRetransform.size()); + assertSame( + ScaReachabilityMethodLevelTest.TargetClass.class, transformer.pendingRetransform.peek()); + } + + @Test + void performPendingRetransforms_noopsWithoutInstrumentation() throws Exception { + ScaReachabilityTransformer transformer = + new ScaReachabilityTransformer( + ScaCveDatabase.parse(new StringReader("{\"version\":1,\"entries\":[]}")), null); + transformer.pendingRetransform.add(ScaReachabilityMethodLevelTest.TargetClass.class); + + transformer.performPendingRetransforms(); + + assertSame( + ScaReachabilityMethodLevelTest.TargetClass.class, transformer.pendingRetransform.peek()); + } + + @Test + void resolveArtifactDep_returnsCachedClasspathArtifact() throws Exception { + ScaReachabilityTransformer transformer = + new ScaReachabilityTransformer(ScaCveDatabase.parse(new StringReader(JACKSON_JSON)), null); + Dependency cached = new Dependency("com.example:lib", "1.0.0", "lib.jar", null); + transformer.classpathArtifactCache.put("com.example:lib", cached); + + assertSame(cached, transformer.resolveArtifactDep("com.example:lib", emptyList())); + } + + @Test + void matchVersion_nullDepNameDoesNotThrow() { + // guessFallbackNoPom can produce Dependency(name=null, ...) for JARs with unrecognizable names. + Dependency nullName = new Dependency(null, "1.0", "foo.jar", null); + assertNull(ScaReachabilityTransformer.matchVersion("com.example:foo", singletonList(nullName))); + } + + /** + * Regression test for the registry key mismatch bug (PR #11614). + * + *

For JARs without {@code pom.properties}, {@code DependencyResolver.guessFallbackNoPom} + * produces a dep with {@code name = "junrar"} (artifactId only, no groupId). {@code + * resolveArtifactDep} must return that dep object so that callers ({@code processClass}) can use + * {@code dep.name} — not {@code entry.artifact()} — when calling {@code registerCve} and building + * {@code MethodCallbackSpec}. Using {@code entry.artifact()} would create a registry key ({@code + * "com.github.junrar:junrar@7.5.5"}) that mismatches the key {@code DependencyService} will use + * ({@code "junrar@7.5.5"}), causing the CVE telemetry to lose source/hash or appear under the + * wrong name. + */ + @Test + void resolveArtifactDep_noPomJar_returnsArtifactIdOnlyName() throws Exception { + ScaCveDatabase db = ScaCveDatabase.parse(new StringReader(JACKSON_JSON)); + ScaReachabilityTransformer transformer = new ScaReachabilityTransformer(db, null); + + // Simulate guessFallbackNoPom: dep.name is artifactId only (no groupId). + Dependency noPomDep = + new Dependency("jackson-databind", "2.9.0", "jackson-databind-2.9.0.jar", null); + + Dependency resolved = + transformer.resolveArtifactDep( + "com.fasterxml.jackson.core:jackson-databind", singletonList(noPomDep)); + + assertNotNull(resolved, "should resolve via artifactId-only fallback"); + assertEquals( + "jackson-databind", + resolved.name, + "resolved dep.name must be the artifactId-only name from the jar, " + + "not entry.artifact() — so registerCve uses the same key as DependencyService"); + assertEquals("2.9.0", resolved.version); + } + + /** + * Validates that {@code findArtifactVersionInClasspath} works correctly when the context + * classloader is {@code null} — which is the actual runtime condition on agent threads, because + * {@code AgentThreadFactory} calls {@code thread.setContextClassLoader(null)} unconditionally. + * + *

If the implementation relied on a URLClassLoader chain walk starting from the context + * classloader, it would silently return {@code null} here. The test asserts that {@code + * java.class.path} scanning is the only mechanism in use and is sufficient. + */ + @Test + void findArtifactVersionInClasspath_worksWithNullContextClassLoader() throws Exception { + ClassLoader original = Thread.currentThread().getContextClassLoader(); + try { + Thread.currentThread().setContextClassLoader(null); + + ScaCveDatabase db = ScaCveDatabase.parse(new StringReader(JACKSON_JSON)); + ScaReachabilityTransformer transformer = new ScaReachabilityTransformer(db, null); + + String version = + transformer.findArtifactVersionInClasspath("com.fasterxml.jackson.core:jackson-databind"); + + assertNotNull( + version, + "jackson-databind must be found via java.class.path even with null context classloader. " + + "java.class.path=" + + System.getProperty("java.class.path", "")); + } finally { + Thread.currentThread().setContextClassLoader(original); + } + } +} diff --git a/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaRealDatabaseTest.java b/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaRealDatabaseTest.java new file mode 100644 index 00000000000..68550972572 --- /dev/null +++ b/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaRealDatabaseTest.java @@ -0,0 +1,95 @@ +package com.datadog.appsec.sca; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.List; +import org.junit.jupiter.api.Test; + +/** + * Integration tests that load the real {@code sca_cves.json} and verify the three library classes + * used to validate the new sca-reachability-symbols database format: + * + *

    + *
  • {@code com.github.junrar:junrar 7.5.5} - GHSA-hf5p-q87m-crj7 + *
  • {@code io.github.ndsev:zserio-runtime 2.16.1} - GHSA-cwq5-8pvq-j65j + *
  • {@code org.apache.tomcat.embed:tomcat-embed-core 9.0.115} - GHSA-563x-q5rq-57qp + *
+ */ +class ScaRealDatabaseTest { + + @Test + void junrarLocalFolderExtractorMethodsAreIndexed() { + ScaCveDatabase db = ScaCveDatabase.load(); + + List entries = db.entriesForClass("com/github/junrar/LocalFolderExtractor"); + assertNotNull(entries, "LocalFolderExtractor must be indexed (junrar GHSA-hf5p)"); + assertFalse(entries.isEmpty()); + assertTrue( + entries.stream() + .flatMap(e -> e.symbols().stream()) + .anyMatch(s -> "createDirectory".equals(s.method())), + "createDirectory must be a tracked method"); + assertTrue( + entries.stream() + .flatMap(e -> e.symbols().stream()) + .anyMatch(s -> "createFile".equals(s.method())), + "createFile must be a tracked method"); + } + + @Test + void zserioArrayReadIsIndexed() { + ScaCveDatabase db = ScaCveDatabase.load(); + + List entries = db.entriesForClass("zserio/runtime/array/Array"); + assertNotNull(entries, "zserio Array must be indexed (zserio-runtime GHSA-cwq5)"); + assertFalse(entries.isEmpty()); + assertTrue( + entries.stream() + .flatMap(e -> e.symbols().stream()) + .anyMatch(s -> "read".equals(s.method())), + "read must be a tracked method"); + } + + @Test + void tomcatChunkedInputFilterIsIndexed() { + ScaCveDatabase db = ScaCveDatabase.load(); + + List entries = + db.entriesForClass("org/apache/coyote/http11/filters/ChunkedInputFilter"); + assertNotNull(entries, "ChunkedInputFilter must be indexed (tomcat-embed-core GHSA-563x)"); + assertFalse(entries.isEmpty()); + assertTrue( + entries.stream() + .flatMap(e -> e.symbols().stream()) + .anyMatch(s -> "parseChunkHeader".equals(s.method())), + "parseChunkHeader must be a tracked method"); + } + + @Test + void allTrackedSymbolsForThreeLibrariesAreMethodLevel() { + ScaCveDatabase db = ScaCveDatabase.load(); + + String[] classes = { + "com/github/junrar/LocalFolderExtractor", + "zserio/runtime/array/Array", + "zserio/runtime/io/ByteArrayBitStreamReader", + "org/apache/coyote/http11/filters/ChunkedInputFilter", + }; + for (String className : classes) { + List entries = db.entriesForClass(className); + if (entries == null) continue; + for (ScaEntry entry : entries) { + for (ScaSymbol symbol : entry.symbols()) { + assertNotNull( + symbol.method(), + "All symbols must be method-level - found null method for " + + symbol.className() + + " in entry " + + entry.vulnId()); + } + } + } + } +} diff --git a/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaRealLibraryBytecodeTest.java b/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaRealLibraryBytecodeTest.java new file mode 100644 index 00000000000..40303c46bf2 --- /dev/null +++ b/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/ScaRealLibraryBytecodeTest.java @@ -0,0 +1,201 @@ +package com.datadog.appsec.sca; + +import static com.datadog.appsec.sca.ScaBytecodeTestUtils.bytecodeOf; +import static com.datadog.appsec.sca.ScaBytecodeTestUtils.loadModified; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.api.telemetry.ScaReachabilityDependencyRegistry; +import datadog.trace.api.telemetry.ScaReachabilityDependencyRegistry.CveSnapshot; +import datadog.trace.api.telemetry.ScaReachabilityDependencyRegistry.DependencySnapshot; +import datadog.trace.api.telemetry.ScaReachabilityHit; +import datadog.trace.bootstrap.appsec.sca.ScaReachabilityCallback; +import java.io.File; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** + * End-to-end tests verifying that ASM bytecode injection works on real library classes from the + * three libraries added to validate the new database format. + * + *

Two complementary levels of coverage: + * + *

    + *
  1. Injection tests - load real bytecode, inject the callback, verify the bytecode grew + * (proving the named method exists in the class and the callback was inserted). + *
  2. Callback test - for junrar, where the constructor is accessible with reflection, + * also calls the instrumented method and verifies the callback fires even when the method + * body throws NPE due to a null argument. + *
+ */ +class ScaRealLibraryBytecodeTest { + + @BeforeEach + void setUp() { + ScaReachabilityDependencyRegistry.INSTANCE.resetForTesting(); + ScaReachabilityCallback.register( + (vulnId, artifact, version, dotClassName, methodName, line) -> + ScaReachabilityDependencyRegistry.INSTANCE.recordHit( + artifact, version, vulnId, dotClassName, methodName, line)); + } + + @AfterEach + void tearDown() { + ScaReachabilityDependencyRegistry.INSTANCE.resetForTesting(); + ScaReachabilityCallback.register(null); + } + + // --------------------------------------------------------------------------- + // Injection tests: ASM can process real library bytecode + // --------------------------------------------------------------------------- + + @Test + void junrar_createDirectory_injectionProducesBytecodeChange() throws Exception { + Class localFolderExtractor = Class.forName("com.github.junrar.LocalFolderExtractor"); + byte[] original = bytecodeOf(localFolderExtractor); + Map> callbacks = new HashMap<>(); + callbacks.put( + "createDirectory", + Collections.singletonList( + spec( + "GHSA-hf5p-q87m-crj7", + "com.github.junrar:junrar", + "7.5.5", + "com.github.junrar.LocalFolderExtractor", + "createDirectory"))); + + byte[] modified = ScaMethodCallbackInjector.inject(original, callbacks); + + assertNotNull(modified, "ASM injection must not return null on real junrar bytecode"); + assertTrue( + modified.length > original.length, + "injected bytecode must be larger than original; proves createDirectory exists" + + " and the callback was inserted"); + } + + @Test + void zserio_array_read_injectionProducesBytecodeChange() throws Exception { + byte[] original = bytecodeOf(zserio.runtime.array.Array.class); + Map> callbacks = new HashMap<>(); + callbacks.put( + "read", + Collections.singletonList( + spec( + "GHSA-cwq5-8pvq-j65j", + "io.github.ndsev:zserio-runtime", + "2.16.1", + "zserio.runtime.array.Array", + "read"))); + + byte[] modified = ScaMethodCallbackInjector.inject(original, callbacks); + + assertNotNull(modified); + assertTrue( + modified.length > original.length, + "injected bytecode must be larger than original; proves Array.read exists" + + " and the callback was inserted"); + } + + @Test + void tomcat_chunkedInputFilter_parseChunkHeader_injectionProducesBytecodeChange() + throws Exception { + byte[] original = bytecodeOf(org.apache.coyote.http11.filters.ChunkedInputFilter.class); + Map> callbacks = new HashMap<>(); + callbacks.put( + "parseChunkHeader", + Collections.singletonList( + spec( + "GHSA-563x-q5rq-57qp", + "org.apache.tomcat.embed:tomcat-embed-core", + "9.0.115", + "org.apache.coyote.http11.filters.ChunkedInputFilter", + "parseChunkHeader"))); + + byte[] modified = ScaMethodCallbackInjector.inject(original, callbacks); + + assertNotNull(modified); + assertTrue( + modified.length > original.length, + "injected bytecode must be larger; proves parseChunkHeader exists and was instrumented"); + } + + // --------------------------------------------------------------------------- + // Callback test: the injected callback fires on a real method call + // --------------------------------------------------------------------------- + + @Test + void junrar_createDirectory_callbackFiresWhenMethodCalled() throws Exception { + Class localFolderExtractor = Class.forName("com.github.junrar.LocalFolderExtractor"); + byte[] original = bytecodeOf(localFolderExtractor); + Map> callbacks = new HashMap<>(); + callbacks.put( + "createDirectory", + Collections.singletonList( + spec( + "GHSA-hf5p-q87m-crj7", + "com.github.junrar:junrar", + "7.5.5", + "com.github.junrar.LocalFolderExtractor", + "createDirectory"))); + + byte[] modified = ScaMethodCallbackInjector.inject(original, callbacks); + Class cls = loadModified(modified); + + // Constructor is package-private in junrar; setAccessible(true) bypasses visibility. + Constructor ctor = cls.getDeclaredConstructor(File.class); + ctor.setAccessible(true); + Object instance = ctor.newInstance(new File("/tmp")); + + // createDirectory(FileHeader) is package-private. Passing null triggers the injected callback + // at method entry before the body tries to access header fields (NPE expected after callback). + Class fileHeaderClass = Class.forName("com.github.junrar.rarfile.FileHeader"); + Method m = cls.getDeclaredMethod("createDirectory", fileHeaderClass); + m.setAccessible(true); + try { + m.invoke(instance, (Object) null); + } catch (InvocationTargetException ignored) { + // NPE from null FileHeader is expected; the callback already fired before it + } + + List hits = drainHits(); + assertEquals( + 1, hits.size(), "createDirectory callback must fire even when method body throws NPE"); + ScaReachabilityHit hit = hits.get(0); + assertEquals("GHSA-hf5p-q87m-crj7", hit.vulnId()); + assertEquals("com.github.junrar:junrar", hit.artifact()); + assertEquals("7.5.5", hit.version()); + } + + // --------------------------------------------------------------------------- + // Helpers (duplicated from ScaReachabilityMethodLevelTest to keep tests self-contained) + // --------------------------------------------------------------------------- + + private static List drainHits() { + List result = new ArrayList<>(); + for (DependencySnapshot dep : + ScaReachabilityDependencyRegistry.INSTANCE.drainPendingDependencies()) { + for (CveSnapshot cve : dep.cves) { + if (cve.hit != null) { + result.add(cve.hit); + } + } + } + return result; + } + + private static ScaMethodCallbackInjector.MethodCallbackSpec spec( + String vulnId, String artifact, String version, String dotClass, String method) { + return new ScaMethodCallbackInjector.MethodCallbackSpec( + vulnId, artifact, version, dotClass, method); + } +} diff --git a/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/VersionRangeParserTest.java b/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/VersionRangeParserTest.java new file mode 100644 index 00000000000..1e74d9de5d6 --- /dev/null +++ b/dd-java-agent/appsec/src/test/java/com/datadog/appsec/sca/VersionRangeParserTest.java @@ -0,0 +1,181 @@ +package com.datadog.appsec.sca; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.junit.jupiter.api.Test; + +class VersionRangeParserTest { + + // --- matchesAny: null / empty guards --- + + @Test + void nullVersionReturnsFalse() { + assertFalse(VersionRangeParser.matchesAny(null, Arrays.asList("< 2.0.0"))); + } + + @Test + void emptyVersionReturnsFalse() { + assertFalse(VersionRangeParser.matchesAny("", Arrays.asList("< 2.0.0"))); + } + + @Test + void nullRangesReturnsFalse() { + assertFalse(VersionRangeParser.matchesAny("1.0.0", null)); + } + + @Test + void emptyRangesReturnsFalse() { + assertFalse(VersionRangeParser.matchesAny("1.0.0", Collections.emptyList())); + } + + // --- single-condition operators --- + + @Test + void lessThan_belowBound() { + assertTrue(VersionRangeParser.matchesAny("2.6.7.2", Arrays.asList("< 2.6.7.3"))); + } + + @Test + void lessThan_atBound() { + assertFalse(VersionRangeParser.matchesAny("2.6.7.3", Arrays.asList("< 2.6.7.3"))); + } + + @Test + void lessThan_aboveBound() { + assertFalse(VersionRangeParser.matchesAny("2.6.7.4", Arrays.asList("< 2.6.7.3"))); + } + + @Test + void lessThanOrEqual_atBound() { + assertTrue(VersionRangeParser.matchesAny("2.6.7.3", Arrays.asList("<= 2.6.7.3"))); + } + + @Test + void lessThanOrEqual_aboveBound() { + assertFalse(VersionRangeParser.matchesAny("2.6.7.4", Arrays.asList("<= 2.6.7.3"))); + } + + @Test + void greaterThan_aboveBound() { + assertTrue(VersionRangeParser.matchesAny("9.5.1", Arrays.asList("> 9.5.0"))); + } + + @Test + void greaterThan_atBound() { + assertFalse(VersionRangeParser.matchesAny("9.5.0", Arrays.asList("> 9.5.0"))); + } + + @Test + void greaterThanOrEqual_atBound() { + assertTrue(VersionRangeParser.matchesAny("9.5.0", Arrays.asList(">= 9.5.0"))); + } + + @Test + void exactMatch_matches() { + assertTrue(VersionRangeParser.matchesAny("9.5.0", Arrays.asList("= 9.5.0"))); + } + + @Test + void exactMatch_doesNotMatch() { + assertFalse(VersionRangeParser.matchesAny("9.5.1", Arrays.asList("= 9.5.0"))); + } + + // --- compound condition (AND within one string) --- + + @Test + void compoundRange_withinBounds() { + assertTrue(VersionRangeParser.matchesAny("2.7.5", Arrays.asList(">= 2.7.0, < 2.7.9.5"))); + } + + @Test + void compoundRange_realGhsaJackson() { + List ranges = Arrays.asList("< 2.6.7.3", ">= 2.7.0, < 2.7.9.5", ">= 2.8.0, < 2.8.11.3"); + assertTrue(VersionRangeParser.matchesAny("2.8.5", ranges)); + assertTrue(VersionRangeParser.matchesAny("2.7.5", ranges)); + assertTrue(VersionRangeParser.matchesAny("2.6.0", ranges)); + assertFalse(VersionRangeParser.matchesAny("2.9.7", ranges)); + } + + @Test + void compoundRange_atLowerBound() { + assertTrue(VersionRangeParser.matchesAny("2.7.0", Arrays.asList(">= 2.7.0, < 2.7.9.5"))); + } + + @Test + void compoundRange_atUpperBound() { + assertFalse(VersionRangeParser.matchesAny("2.7.9.5", Arrays.asList(">= 2.7.0, < 2.7.9.5"))); + } + + @Test + void compoundRange_belowLowerBound() { + assertFalse(VersionRangeParser.matchesAny("2.6.9", Arrays.asList(">= 2.7.0, < 2.7.9.5"))); + } + + // --- OR across multiple range strings --- + + @Test + void multipleRanges_matchesFirstRange() { + List ranges = Arrays.asList("< 2.6.7.3", ">= 2.7.0, < 2.7.9.5"); + assertTrue(VersionRangeParser.matchesAny("2.6.0", ranges)); + } + + @Test + void multipleRanges_matchesSecondRange() { + List ranges = Arrays.asList("< 2.6.7.3", ">= 2.7.0, < 2.7.9.5"); + assertTrue(VersionRangeParser.matchesAny("2.7.5", ranges)); + } + + @Test + void multipleRanges_matchesNeitherRange() { + List ranges = Arrays.asList("< 2.6.7.3", ">= 2.7.0, < 2.7.9.5"); + assertFalse(VersionRangeParser.matchesAny("2.6.8", ranges)); + } + + // --- Maven qualifier handling (Gap 10) --- + + @Test + void releaseQualifier_belowBound() { + assertTrue(VersionRangeParser.matchesAny("5.2.19.RELEASE", Arrays.asList("< 5.2.20.RELEASE"))); + } + + @Test + void releaseQualifier_atBound() { + assertFalse(VersionRangeParser.matchesAny("5.2.20.RELEASE", Arrays.asList("< 5.2.20.RELEASE"))); + } + + @Test + void releaseQualifier_equivalentToPlain() { + // 5.2.20.RELEASE == 5.2.20 in Maven versioning + assertFalse(VersionRangeParser.matchesAny("5.2.20", Arrays.asList("< 5.2.20.RELEASE"))); + } + + @Test + void releaseQualifier_compoundRange() { + assertTrue(VersionRangeParser.matchesAny("5.3.10", Arrays.asList(">= 5.3.0, < 5.3.18"))); + assertFalse( + VersionRangeParser.matchesAny("5.2.20.RELEASE", Arrays.asList(">= 5.3.0, < 5.3.18"))); + } + + // --- 4-part versions --- + + @Test + void fourPartVersion() { + assertTrue(VersionRangeParser.matchesAny("2.6.7.2", Arrays.asList("< 2.6.7.3"))); + assertFalse(VersionRangeParser.matchesAny("2.6.7.3", Arrays.asList("< 2.6.7.3"))); + assertFalse(VersionRangeParser.matchesAny("2.6.7.4", Arrays.asList("< 2.6.7.3"))); + } + + // --- error handling --- + + @Test + void unknownOperatorThrows() { + assertThrows( + IllegalArgumentException.class, + () -> VersionRangeParser.matchesAny("1.0.0", Arrays.asList("~ 2.0.0"))); + } +} diff --git a/dd-java-agent/appsec/src/test/java/com/github/junrar/LocalFolderExtractor.java b/dd-java-agent/appsec/src/test/java/com/github/junrar/LocalFolderExtractor.java new file mode 100644 index 00000000000..c518e200a0e --- /dev/null +++ b/dd-java-agent/appsec/src/test/java/com/github/junrar/LocalFolderExtractor.java @@ -0,0 +1,20 @@ +package com.github.junrar; + +import com.github.junrar.rarfile.FileHeader; +import java.io.File; + +// Minimal stub replacing junrar:7.5.5 to avoid shipping a test dependency with known CVEs. +// Preserves the constructor and method signatures used by ScaRealLibraryBytecodeTest. +class LocalFolderExtractor { + + @SuppressWarnings("unused") + private final File destinationFolder; + + LocalFolderExtractor(File destinationFolder) { + this.destinationFolder = destinationFolder; + } + + void createDirectory(FileHeader header) { + // stub — the test verifies that the injected callback fires at method entry before this body + } +} diff --git a/dd-java-agent/appsec/src/test/java/com/github/junrar/rarfile/FileHeader.java b/dd-java-agent/appsec/src/test/java/com/github/junrar/rarfile/FileHeader.java new file mode 100644 index 00000000000..ecc3a2beb9c --- /dev/null +++ b/dd-java-agent/appsec/src/test/java/com/github/junrar/rarfile/FileHeader.java @@ -0,0 +1,4 @@ +package com.github.junrar.rarfile; + +// Minimal stub: used only as a parameter type in LocalFolderExtractor.createDirectory(FileHeader). +public class FileHeader {} diff --git a/dd-java-agent/appsec/src/test/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java b/dd-java-agent/appsec/src/test/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java new file mode 100644 index 00000000000..2431b913796 --- /dev/null +++ b/dd-java-agent/appsec/src/test/java/org/apache/coyote/http11/filters/ChunkedInputFilter.java @@ -0,0 +1,9 @@ +package org.apache.coyote.http11.filters; + +// Minimal stub replacing tomcat-embed-core:9.0.115 to avoid shipping a test dependency with known +// CVEs. +// Preserves the method signature used by ScaRealLibraryBytecodeTest. +public class ChunkedInputFilter { + + public void parseChunkHeader() {} +} diff --git a/dd-java-agent/appsec/src/test/java/zserio/runtime/array/Array.java b/dd-java-agent/appsec/src/test/java/zserio/runtime/array/Array.java new file mode 100644 index 00000000000..25896960568 --- /dev/null +++ b/dd-java-agent/appsec/src/test/java/zserio/runtime/array/Array.java @@ -0,0 +1,8 @@ +package zserio.runtime.array; + +// Minimal stub replacing zserio-runtime:2.16.1 to avoid shipping a test dependency with known CVEs. +// Preserves the method signature used by ScaRealLibraryBytecodeTest. +public class Array { + + public void read() {} +} diff --git a/dd-java-agent/benchmark-integration/build.gradle b/dd-java-agent/benchmark-integration/build.gradle index 9a033a774d7..49f94e0714e 100644 --- a/dd-java-agent/benchmark-integration/build.gradle +++ b/dd-java-agent/benchmark-integration/build.gradle @@ -1,26 +1,3 @@ -buildscript { - repositories { - mavenLocal() - if (project.rootProject.hasProperty("gradlePluginProxy")) { - maven { - url project.rootProject.property("gradlePluginProxy") - allowInsecureProtocol = true - } - } - if (project.rootProject.hasProperty("mavenRepositoryProxy")) { - maven { - url project.rootProject.property("mavenRepositoryProxy") - allowInsecureProtocol = true - } - } - gradlePluginPortal() - mavenCentral() - } - dependencies { - classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.1' - } -} - apply from: "$rootDir/gradle/java.gradle" description = 'Integration Level Agent benchmarks.' diff --git a/dd-java-agent/benchmark-integration/gradle.lockfile b/dd-java-agent/benchmark-integration/gradle.lockfile index afda810c8e2..972ab455e1f 100644 --- a/dd-java-agent/benchmark-integration/gradle.lockfile +++ b/dd-java-agent/benchmark-integration/gradle.lockfile @@ -1,10 +1,11 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:benchmark-integration:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/benchmark-integration/jetty-perftest/gradle.lockfile b/dd-java-agent/benchmark-integration/jetty-perftest/gradle.lockfile index 0010dc4347e..e0cd2926a0b 100644 --- a/dd-java-agent/benchmark-integration/jetty-perftest/gradle.lockfile +++ b/dd-java-agent/benchmark-integration/jetty-perftest/gradle.lockfile @@ -1,10 +1,11 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:benchmark-integration:jetty-perftest:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/benchmark-integration/play-perftest/gradle.lockfile b/dd-java-agent/benchmark-integration/play-perftest/gradle.lockfile index 1babafbd070..920f2a7e0cd 100644 --- a/dd-java-agent/benchmark-integration/play-perftest/gradle.lockfile +++ b/dd-java-agent/benchmark-integration/play-perftest/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:benchmark-integration:play-perftest:dependencies --write-locks aopalliance:aopalliance:1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath args4j:args4j:2.0.26=javaScriptCompiler cglib:cglib-nodep:3.2.4=testCompileClasspath,testRuntimeClasspath @@ -19,7 +20,7 @@ com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.8.11=compileClasspath,pla com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.8.11=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml:classmate:1.3.1=compileClasspath,play com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:1.3.9=javaScriptCompiler,play,runtimeClasspath @@ -77,7 +78,7 @@ commons-io:commons-io:2.20.0=spotbugs commons-io:commons-io:2.5=routesCompiler,runtimeClasspath,testCompileClasspath,testRuntimeClasspath commons-logging:commons-logging:1.2=testCompileClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.jsonwebtoken:jjwt:0.7.0=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath io.opentracing:opentracing-api:0.32.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -94,7 +95,6 @@ net.bytebuddy:byte-buddy-agent:1.12.8=testRuntimeClasspath net.bytebuddy:byte-buddy:1.12.8=testRuntimeClasspath net.java.dev.jna:jna-platform:4.1.0=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna:4.1.0=testCompileClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.jodah:typetools:0.5.0=compileClasspath,play net.openhft:zero-allocation-hashing:0.16=zinc net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -138,7 +138,7 @@ org.eclipse.jetty:jetty-http:9.4.5.v20170502=testCompileClasspath,testRuntimeCla org.eclipse.jetty:jetty-io:9.4.5.v20170502=testCompileClasspath,testRuntimeClasspath org.eclipse.jetty:jetty-util:9.4.5.v20170502=testCompileClasspath,testRuntimeClasspath org.fluentlenium:fluentlenium-core:3.3.0=testCompileClasspath,testRuntimeClasspath -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testCompileClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath @@ -148,7 +148,7 @@ org.jboss.logging:jboss-logging:3.3.0.Final=compileClasspath,play org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -184,35 +184,35 @@ org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=zinc org.scala-lang.modules:scala-xml_2.12:1.0.6=compileClasspath,play,routesCompiler,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,twirlCompiler org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc org.scala-lang:scala-compiler:2.12.4=twirlCompiler -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.12.6=compileClasspath,play,routesCompiler,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang:scala-library:2.12.8=twirlCompiler -org.scala-lang:scala-library:2.13.15=zinc +org.scala-lang:scala-library:2.13.16=zinc org.scala-lang:scala-reflect:2.12.4=twirlCompiler org.scala-lang:scala-reflect:2.12.6=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-lang:scala-reflect:2.13.15=zinc -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-lang:scala-reflect:2.13.16=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc org.scala-sbt:test-interface:1.0=testCompileClasspath,testRuntimeClasspath -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.seleniumhq.selenium:htmlunit-driver:2.27=testCompileClasspath,testRuntimeClasspath org.seleniumhq.selenium:selenium-api:3.5.3=testCompileClasspath,testRuntimeClasspath org.seleniumhq.selenium:selenium-firefox-driver:3.5.3=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/benchmark/gradle.lockfile b/dd-java-agent/benchmark/gradle.lockfile index 1489023c613..b7f5c2fc5eb 100644 --- a/dd-java-agent/benchmark/gradle.lockfile +++ b/dd-java-agent/benchmark/gradle.lockfile @@ -1,10 +1,11 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:benchmark:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,jmhCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -16,7 +17,7 @@ de.thetaphi:forbiddenapis:3.10=compileClasspath,jmhCompileClasspath io.leangen.geantyref:geantyref:1.3.16=jmhRuntimeClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs net.bytebuddy:byte-buddy-agent:1.12.8=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=jmh,jmhCompileClasspath,jmhRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=jmh,jmhCompileClasspath,jmhRuntimeClasspath net.bytebuddy:byte-buddy:1.12.8=jmhRuntimeClasspath,testRuntimeClasspath net.sf.jopt-simple:jopt-simple:5.0.4=jmh,jmhCompileClasspath,jmhRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs diff --git a/dd-java-agent/build.gradle b/dd-java-agent/build.gradle index 58ad7540df2..5959cc8b3c9 100644 --- a/dd-java-agent/build.gradle +++ b/dd-java-agent/build.gradle @@ -1,5 +1,9 @@ +import static org.gradle.api.file.DuplicatesStrategy.INCLUDE + import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar +import com.github.jengelman.gradle.plugins.shadow.transformers.PreserveFirstFoundResourceTransformer import java.util.concurrent.atomic.AtomicBoolean +import java.util.jar.JarFile plugins { id 'com.gradleup.shadow' @@ -19,6 +23,10 @@ configurations { def includedAgentDir = project.layout.buildDirectory.dir("generated/included") def includedJarFileTree = fileTree(includedAgentDir) +// Populated automatically by includeShadowJar for every product dir registered in this build. +// Used by verifyAgentJarContents to check that all included products land in the assembled jar. +ext.includedProductPrefixes = objects.setProperty(String) + def pomPropertiesDir = project.layout.buildDirectory.dir("generated/maven-metadata") def pomPropertiesFileTree = fileTree(pomPropertiesDir) @@ -60,6 +68,7 @@ tasks.named("compileJava") { dependencies { implementation sourceSets.main_java11.output main_java11CompileOnly libs.forbiddenapis + main_java6CompileOnly project(':components:annotations') main_java6CompileOnly libs.forbiddenapis testImplementation sourceSets.main_java6.output } @@ -75,8 +84,22 @@ dependencies { def generalShadowJarConfig(ShadowJar shadowJarTask) { shadowJarTask.with { mergeServiceFiles() - - duplicatesStrategy = DuplicatesStrategy.FAIL + addMultiReleaseAttribute = false + + // Allow duplicate to merge service files + duplicatesStrategy = INCLUDE + // Ensure there is no duplicate in the final jar after resource transformer applied + failOnDuplicateEntries = true + + // Vendored dependencies repeat license/notice metadata; keep a single copy + transform(PreserveFirstFoundResourceTransformer) { + it.include( + 'META-INF/LICENSE*', + 'META-INF/NOTICE*', + 'META-INF/AL2.0', + 'META-INF/LGPL2.1', + ) + } // Remove some cruft from the final jar. // These patterns should NOT include **/META-INF/maven/**/pom.properties, which is @@ -93,6 +116,7 @@ def generalShadowJarConfig(ShadowJar shadowJarTask) { exclude '**/inst/META-INF/versions/**' exclude '**/META-INF/versions/*/org/yaml/**' exclude '**/package.html' + exclude '**/about.html' // Used to generate Java code during build, no need to include original file exclude '**/*.trie' @@ -182,6 +206,8 @@ def generalShadowJarConfig(ShadowJar shadowJarTask) { } def includeShadowJar(TaskProvider includedShadowJarTask, String agentDir, FileTree includedJarFileTree) { + includedProductPrefixes.add(agentDir) + def expandTask = project.tasks.register("expandAgentShadowJar${agentDir.capitalize()}", Sync) { it.group = LifecycleBasePlugin.BUILD_GROUP it.description = "Expand the included shadow jar into the agent jar under ${agentDir}" @@ -249,7 +275,7 @@ includeSubprojShadowJar(project(':products:metrics:metrics-lib'), 'metrics', inc includeSubprojShadowJar(project(':products:feature-flagging:feature-flagging-agent'), 'feature-flagging', includedJarFileTree) def sharedShadowJar = tasks.register('sharedShadowJar', ShadowJar) { - it.configurations = [project.configurations.sharedShadowInclude] + it.configurations.add(project.configurations.named('sharedShadowInclude')) // Put the jar in a different directory so we don't overwrite the normal shadow jar and // break caching, and also to not interfere with CI scripts that copy everything in the // libs directory @@ -267,16 +293,16 @@ def sharedShadowJar = tasks.register('sharedShadowJar', ShadowJar) { exclude(project(':utils:time-utils')) exclude(project(':products:metrics:metrics-api')) exclude(project(':products:metrics:metrics-agent')) - exclude(dependency('org.slf4j::')) + exclude(dependency('org.slf4j:.*:.*')) // use dd-instrument-java's embedded copy of asm - exclude(dependency('org.ow2.asm:asm:')) + exclude(dependency('org.ow2.asm:asm:.*')) } } includeShadowJar(sharedShadowJar, 'shared', includedJarFileTree) // place the tracer in its own shadow jar separate to instrumentation def traceShadowJar = tasks.register('traceShadowJar', ShadowJar) { - it.configurations = [project.configurations.traceShadowInclude] + it.configurations.add(project.configurations.named('traceShadowInclude')) it.destinationDirectory.set(project.layout.buildDirectory.dir("trace-lib")) it.archiveClassifier = 'trace' it.dependencies deps.excludeShared @@ -291,7 +317,10 @@ tasks.named("shadowJar", ShadowJar) { generalShadowJarConfig(it) - configurations = [project.configurations.shadowInclude] + // The default shadowJar task has a runtimeClasspath convention. Replace it + // instead of adding to it, otherwise runtimeClasspath would be bundled too. + configurations.empty() + configurations.add(project.configurations.named('shadowInclude')) archiveClassifier = '' @@ -319,8 +348,11 @@ def generateAgentJarIndex = tasks.register('generateAgentJarIndex', JavaExec) { it.mainClass = 'datadog.trace.bootstrap.AgentJarIndex$IndexGenerator' it.inputs.files(includedJarFileTree) - it.inputs.files(it.classpath) + .withPropertyName("includedAgentFiles") + .withPathSensitivity(PathSensitivity.RELATIVE) it.outputs.dir(destinationDir) + .withPropertyName("agentJarIndex") + it.outputs.cacheIf { true } it.classpath = objects.fileCollection().tap { it.from(project.configurations.named("shadowInclude")) it.from(project.configurations.named('slf4j-simple')) @@ -467,16 +499,201 @@ tasks.withType(Test).configureEach { dependsOn "shadowJar" } -tasks.register('checkAgentJarSize') { +def agentJarChecksProps = rootProject.file('metadata/agent-jar-checks.properties') + +tasks.register('verifyAgentJarContents') { + group = LifecycleBasePlugin.VERIFICATION_GROUP + description = 'Verify the agent jar contains required entries and meets structural invariants' + + def jarProvider = tasks.named('shadowJar', ShadowJar).flatMap { it.archiveFile } + inputs.file(jarProvider) + inputs.file(agentJarChecksProps) + inputs.property('productPrefixes', includedProductPrefixes) + outputs.file(project.layout.buildDirectory.file("tmp/${it.name}/.verified")) + doLast { - // Arbitrary limit to prevent unintentional increases to the agent jar size - // Raise or lower as required - assert tasks.named("shadowJar", ShadowJar).get().archiveFile.get().getAsFile().length() <= 33 * 1024 * 1024 + def props = new Properties() + agentJarChecksProps.withInputStream { props.load(it) } + + File jarFile = jarProvider.get().asFile + List failures = [] + Map entries = [:] + + // Jar size budget — raise only when the growth is intentional + def sizeBudget = Long.parseLong(props['jar.size.budget']) + if (jarFile.length() > sizeBudget) { + failures.add("Jar size ${jarFile.length()} B exceeds budget ${sizeBudget} B") + } + + // Inspect jar content + new JarFile(jarFile).withCloseable { jf -> + jf.entries().each { ze -> entries[ze.name] = ze.size } + } + + // Required entries + [ + // Runtime index, loaded at startup to resolve classdata paths + // Generated by :dd-java-agent:generateAgentJarIndex + 'dd-java-agent.index', + // Premain-Class: Java 6 pre check + 'datadog/trace/bootstrap/AgentPreCheck.class', + // Agent-Class: main bootstrap entry point + 'datadog/trace/bootstrap/AgentBootstrap.class', + // Additional checks for Java 11 + 'datadog/trace/bootstrap/AdvancedAgentChecks.class', + // Instrumentation indexes + // * :dd-java-agent:instrumentation:generateInstrumenterIndex + // * :dd-java-agent:instrumentation:generateKnownTypesIndex + // Without instrumenter.index, zero instrumentations load at runtime. + 'inst/instrumenter.index', + 'inst/known-types.index', + // OTel drop-in support, embedded via otel-bootstrap + otel-shim shadowInclude + 'datadog/trace/bootstrap/otel/api/', + 'datadog/trace/bootstrap/otel/context/', + 'datadog/trace/bootstrap/otel/shim/', + 'META-INF/maven/com.datadoghq/dd-java-agent/pom.properties', + ].each { required -> + if (!entries.containsKey(required)) { + failures.add("Missing required entry: ${required}") + } + } + + // Sanity check on the minimum number of classes; see metadata/agent-jar-checks.properties. + def classCount = entries.keySet().count { it.endsWith('.class') || it.endsWith('.classdata') } + def classFloor = Integer.parseInt(props['classes.minimum.guard']) + if (classCount < classFloor) { + failures.add("Class count ${classCount} is below floor ${classFloor}") + } + + // Each registered product must contribute at least one .classdata entry. + // Catches a product wired into the build but producing no classes. + def classdataPrefixes = entries.keySet() + .findAll { it.endsWith('.classdata') } + .collect { it.split('/')[0] } + .toSet() + includedProductPrefixes.get().each { dir -> + if (!classdataPrefixes.contains(dir)) { + failures.add("Product '${dir}' has no .classdata entries in the assembled jar") + } + } + + // All *.index files in the jar must be non-empty + entries.findAll { name, size -> name.endsWith('.index') && size == 0 }.each { name, _ -> + failures.add("Empty index file: ${name}") + } + + // Packages that must not appear anywhere in the jar after relocation. + // NOTE: Hardcoded to catch accidental removal of relocate() calls in generalShadowJarConfig or in a nested shadow jar. + def productPrefixes = includedProductPrefixes.get() + ['org/slf4j/', 'org/jctools/', 'net/jpountz/', 'org/objectweb/asm/', 'io/airlift/'].each { pkg -> + def leaked = entries.keySet().findAll { entry -> + entry.startsWith(pkg) || productPrefixes.any { prefix -> entry.startsWith("${prefix}/${pkg}") } + } + if (!leaked.empty) { + def sample = leaked.take(3).toString() + failures.add("Unrelocated package '${pkg}': ${sample}${leaked.size() > 3 ? ' ...' : ''}") + } + } + + if (!failures.empty) { + throw new GradleException( + "Agent jar verification failed (${failures.size()} issue(s)):\n" + + failures.collect { " - ${it}" }.join('\n')) + } + + def marker = outputs.files.singleFile + marker.parentFile.mkdirs() + marker.text = 'verified' } +} - dependsOn "shadowJar" +tasks.register('verifyAgentJarIntegrations', JavaExec) { + group = LifecycleBasePlugin.VERIFICATION_GROUP + description = 'Verify the agent jar lists exactly the integrations in metadata/agent-jar-checks.properties' + + def jarProvider = tasks.named('shadowJar', ShadowJar).flatMap { it.archiveFile } + inputs.file(jarProvider) + inputs.file(agentJarChecksProps) + outputs.file(project.layout.buildDirectory.file("tmp/${it.name}/.verified")) + + // Run the assembled agent jar directly — this exercises dd-java-agent.index, + // inst/instrumenter.index, and instrumentation class loading end-to-end. + mainClass = 'datadog.trace.bootstrap.AgentBootstrap' + classpath = objects.fileCollection().from(jarProvider) + args = ['--list-integrations'] + + // Capture both stdout and stderr: InstrumenterIndex.buildModule() logs ERROR and returns null when a module + // fails to load, while the process exits with status 0. + def capturedOutput = new ByteArrayOutputStream() + def capturedError = new ByteArrayOutputStream() + standardOutput = capturedOutput + errorOutput = capturedError + + doLast { + def stderr = capturedError.toString() + if (!stderr.isBlank()) { + throw new GradleException( + "--list-integrations produced unexpected stderr output " + + "(likely a module load failure; see InstrumenterIndex.buildModule):\n${stderr}") + } + + def props = new Properties() + agentJarChecksProps.withInputStream { props.load(it) } + def actual = capturedOutput.toString().readLines().findAll { !it.isBlank() }.toSorted() + def expected = props.getProperty('expected.integrations').split(',').collect { it.trim() }.toSorted() + def added = actual - expected + def removed = expected - actual + + if (added || removed) { + def msg = new StringBuilder('Integration list differs from metadata/agent-jar-checks.properties.') + msg.append(" Run './gradlew :dd-java-agent:updateAgentJarIntegrationsGoldenFile' to update it.\n") + added.each { msg.append(" + ${it}\n") } + removed.each { msg.append(" - ${it}\n") } + throw new GradleException(msg.toString()) + } + + def marker = outputs.files.singleFile + marker.parentFile.mkdirs() + marker.text = 'verified' + } +} + +// Manual run after adding/removing integrations; rewrites the expected.integrations block in +// metadata/agent-jar-checks.properties while preserving all other properties and comments. +tasks.register('updateAgentJarIntegrationsGoldenFile', JavaExec) { + group = LifecycleBasePlugin.VERIFICATION_GROUP + description = 'Regenerate expected.integrations in metadata/agent-jar-checks.properties from the current agent jar' + + def jarProvider = tasks.named('shadowJar', ShadowJar).flatMap { it.archiveFile } + inputs.file(jarProvider) + + mainClass = 'datadog.trace.bootstrap.AgentBootstrap' + classpath = objects.fileCollection().from(jarProvider) + args = ['--list-integrations'] + + def capturedOutput = new ByteArrayOutputStream() + standardOutput = capturedOutput + + doLast { + def integrations = capturedOutput.toString().readLines().findAll { !it.isBlank() }.toSorted() + + def entryLines = integrations.withIndex().collect { name, i -> + def prefix = (i == 0) ? 'expected.integrations = ' : ' ' + def suffix = (i < integrations.size() - 1) ? ',\\' : '' + "${prefix}${name}${suffix}" + } + + // Replace everything between the BEGIN/END markers (inclusive) with the fresh value. + def BEGIN = '# BEGIN expected.integrations' + def END = '# END expected.integrations' + def allLines = agentJarChecksProps.readLines() + def before = allLines.subList(0, allLines.findIndexOf { it.startsWith(BEGIN) }) + def after = allLines.subList(allLines.findIndexOf { it.startsWith(END) } + 1, allLines.size()) + agentJarChecksProps.text = (before + [BEGIN] + entryLines + [END] + after).join('\n') + '\n' + logger.lifecycle("Updated metadata/agent-jar-checks.properties with ${integrations.size()} integrations") + } } tasks.named('check') { - dependsOn 'checkAgentJarSize' + dependsOn 'verifyAgentJarContents', 'verifyAgentJarIntegrations' } diff --git a/dd-java-agent/cws-tls/build.gradle b/dd-java-agent/cws-tls/build.gradle index df9efdd2608..199340693e6 100644 --- a/dd-java-agent/cws-tls/build.gradle +++ b/dd-java-agent/cws-tls/build.gradle @@ -3,11 +3,10 @@ import org.apache.maven.model.License plugins { id 'com.gradleup.shadow' + id 'dd-trace-java.version-file' } apply from: "$rootDir/gradle/java.gradle" -// We do not publish a separate jar, but having a version file is useful for checking if cws is included -apply from: "$rootDir/gradle/version.gradle" excludedClassesCoverage += ['datadog.cws.erpc.*', 'datadog.cws.tls.*',] diff --git a/dd-java-agent/cws-tls/gradle.lockfile b/dd-java-agent/cws-tls/gradle.lockfile index 5c0f6357032..15406f73c7b 100644 --- a/dd-java-agent/cws-tls/gradle.lockfile +++ b/dd-java-agent/cws-tls/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:cws-tls:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -70,12 +75,13 @@ org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -93,14 +99,16 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt org.ow2.asm:asm-commons:9.7.1=testRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.10.1=jacocoAnt,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/ddprof-lib/build.gradle b/dd-java-agent/ddprof-lib/build.gradle index b4f3219ae23..f6d653e3bbd 100644 --- a/dd-java-agent/ddprof-lib/build.gradle +++ b/dd-java-agent/ddprof-lib/build.gradle @@ -16,10 +16,8 @@ dependencies { } tasks.named("shadowJar", ShadowJar) { - dependencies { - deps.excludeShared - exclude '**/*.debug' - } + dependencies deps.excludeShared + exclude '**/*.debug' archiveClassifier = 'all' include { def rslt = false diff --git a/dd-java-agent/ddprof-lib/gradle.lockfile b/dd-java-agent/ddprof-lib/gradle.lockfile index a624b4ce695..0a9d788b1a3 100644 --- a/dd-java-agent/ddprof-lib/gradle.lockfile +++ b/dd-java-agent/ddprof-lib/gradle.lockfile @@ -1,12 +1,13 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:ddprof-lib:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:ddprof:1.42.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:ddprof:1.46.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -41,10 +42,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -58,10 +59,13 @@ org.mockito:mockito-core:4.4.0=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/gradle.lockfile b/dd-java-agent/gradle.lockfile index fa8ba4fc43e..61a5ecf96b5 100644 --- a/dd-java-agent/gradle.lockfile +++ b/dd-java-agent/gradle.lockfile @@ -1,33 +1,39 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:dependencies --write-locks +at.yawk.lz4:lz4-java:1.11.0=sharedShadowInclude cafe.cryptography:curve25519-elisabeth:0.1.0=sharedShadowInclude,testRuntimeClasspath,traceShadowInclude cafe.cryptography:ed25519-elisabeth:0.1.0=sharedShadowInclude,testRuntimeClasspath,traceShadowInclude ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=sharedShadowInclude,testCompileClasspath,testRuntimeClasspath,traceShadowInclude com.datadoghq.okio:okio:1.17.6=sharedShadowInclude,testCompileClasspath,testRuntimeClasspath,traceShadowInclude -com.datadoghq:dd-instrument-java:0.0.3=shadowInclude,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=shadowInclude,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=shadowInclude,testCompileClasspath,testRuntimeClasspath,traceShadowInclude com.datadoghq:java-dogstatsd-client:4.4.5=sharedShadowInclude,testRuntimeClasspath,traceShadowInclude com.datadoghq:sketches-java:0.8.3=sharedShadowInclude,testRuntimeClasspath,traceShadowInclude com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=sharedShadowInclude,testRuntimeClasspath,traceShadowInclude +com.github.jnr:jffi:1.3.15=sharedShadowInclude,testRuntimeClasspath,traceShadowInclude com.github.jnr:jnr-a64asm:1.0.0=sharedShadowInclude,testRuntimeClasspath,traceShadowInclude com.github.jnr:jnr-constants:0.10.4=sharedShadowInclude,testRuntimeClasspath,traceShadowInclude -com.github.jnr:jnr-enxio:0.32.19=sharedShadowInclude,testRuntimeClasspath,traceShadowInclude -com.github.jnr:jnr-ffi:2.2.18=sharedShadowInclude,testRuntimeClasspath,traceShadowInclude -com.github.jnr:jnr-posix:3.1.21=sharedShadowInclude,testRuntimeClasspath,traceShadowInclude -com.github.jnr:jnr-unixsocket:0.38.24=sharedShadowInclude,testRuntimeClasspath,traceShadowInclude +com.github.jnr:jnr-enxio:0.32.20=sharedShadowInclude,testRuntimeClasspath,traceShadowInclude +com.github.jnr:jnr-ffi:2.2.19=sharedShadowInclude,testRuntimeClasspath,traceShadowInclude +com.github.jnr:jnr-posix:3.1.22=sharedShadowInclude,testRuntimeClasspath,traceShadowInclude +com.github.jnr:jnr-unixsocket:0.38.25=sharedShadowInclude,testRuntimeClasspath,traceShadowInclude com.github.jnr:jnr-x86asm:1.0.2=sharedShadowInclude,testRuntimeClasspath,traceShadowInclude -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath,traceShadowInclude +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=sharedShadowInclude,testRuntimeClasspath,traceShadowInclude com.squareup.moshi:moshi:1.11.0=sharedShadowInclude,testCompileClasspath,testRuntimeClasspath,traceShadowInclude com.squareup.okhttp3:mockwebserver:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -43,8 +49,8 @@ io.opentracing:opentracing-noop:0.31.0=testCompileClasspath,testRuntimeClasspath io.opentracing:opentracing-util:0.31.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.12=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -70,6 +76,7 @@ org.hamcrest:hamcrest-core:1.3=testCompileClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=sharedShadowInclude,testRuntimeClasspath,traceShadowInclude org.jctools:jctools-core:4.0.6=sharedShadowInclude,testRuntimeClasspath,traceShadowInclude +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -79,24 +86,23 @@ org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntime org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath -org.lz4:lz4-java:1.7.1=sharedShadowInclude org.mockito:mockito-core:4.4.0=testRuntimeClasspath org.msgpack:msgpack-core:0.8.24=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=sharedShadowInclude,testRuntimeClasspath,traceShadowInclude org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=sharedShadowInclude org.ow2.asm:asm-commons:9.7.1=testRuntimeClasspath,traceShadowInclude org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=sharedShadowInclude +org.ow2.asm:asm-tree:9.10.1=sharedShadowInclude org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath,traceShadowInclude org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=sharedShadowInclude org.ow2.asm:asm-util:9.7.1=sharedShadowInclude,testRuntimeClasspath,traceShadowInclude org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=sharedShadowInclude org.ow2.asm:asm:9.7.1=testRuntimeClasspath,traceShadowInclude org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=sharedShadowInclude org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath @@ -111,4 +117,4 @@ org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeCla org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -empty=annotationProcessor,main_java11AnnotationProcessor,main_java11RuntimeClasspath,main_java6AnnotationProcessor,main_java6RuntimeClasspath,runtimeClasspath,shadow,signatures,spotbugsPlugins,testAnnotationProcessor +empty=annotationProcessor,main_java11AnnotationProcessor,main_java11RuntimeClasspath,main_java6AnnotationProcessor,main_java6RuntimeClasspath,runtimeClasspath,shadow,spotbugsPlugins,testAnnotationProcessor diff --git a/dd-java-agent/instrumentation-annotation-processor/gradle.lockfile b/dd-java-agent/instrumentation-annotation-processor/gradle.lockfile index afda810c8e2..eca9a30a550 100644 --- a/dd-java-agent/instrumentation-annotation-processor/gradle.lockfile +++ b/dd-java-agent/instrumentation-annotation-processor/gradle.lockfile @@ -1,10 +1,11 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation-annotation-processor:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation-testing/gradle.lockfile b/dd-java-agent/instrumentation-testing/gradle.lockfile index a19663497a6..913897175ad 100644 --- a/dd-java-agent/instrumentation-testing/gradle.lockfile +++ b/dd-java-agent/instrumentation-testing/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation-testing:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath cglib:cglib:3.2.5=testCompileClasspath,testRuntimeClasspath @@ -9,20 +10,20 @@ ch.qos.logback:logback-core:1.2.13=compileClasspath,runtimeClasspath,testCompile com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=testAnnotationProcessor,testCompileClasspath @@ -32,12 +33,15 @@ com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testAnnotationPr com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=testAnnotationProcessor -com.google.guava:guava:20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,runtimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=testAnnotationProcessor -com.google.re2j:re2j:1.7=runtimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=runtimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -48,12 +52,12 @@ commons-io:commons-io:2.11.0=compileClasspath,runtimeClasspath,testCompileClassp commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=runtimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=runtimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=runtimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=runtimeClasspath,testRuntimeClasspath net.sf.jt400:jt400:6.1=testCompileClasspath,testRuntimeClasspath @@ -85,6 +89,7 @@ org.hamcrest:hamcrest-core:1.3=compileClasspath,runtimeClasspath,testCompileClas org.hamcrest:hamcrest:3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=runtimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=runtimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -102,14 +107,14 @@ org.objenesis:objenesis:3.3=compileClasspath,testCompileClasspath,testRuntimeCla org.opentest4j:opentest4j:1.3.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=runtimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation-testing/src/main/groovy/datadog/trace/agent/test/InstrumentationSpecification.groovy b/dd-java-agent/instrumentation-testing/src/main/groovy/datadog/trace/agent/test/InstrumentationSpecification.groovy index 0c9bfd035b8..951c2ecff3e 100644 --- a/dd-java-agent/instrumentation-testing/src/main/groovy/datadog/trace/agent/test/InstrumentationSpecification.groovy +++ b/dd-java-agent/instrumentation-testing/src/main/groovy/datadog/trace/agent/test/InstrumentationSpecification.groovy @@ -10,7 +10,6 @@ import static datadog.trace.api.config.TraceInstrumentationConfig.CODE_ORIGIN_FO import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.closePrevious import static datadog.trace.util.AgentThreadFactory.AgentThread.TASK_SCHEDULER - import ch.qos.logback.classic.Level import ch.qos.logback.classic.util.ContextInitializer import com.datadog.debugger.agent.ClassesToRetransformFinder @@ -47,6 +46,7 @@ import datadog.trace.api.Pair import datadog.trace.api.ProcessTags import datadog.trace.api.TraceConfig import datadog.trace.api.config.GeneralConfig +import datadog.trace.api.config.TraceInstrumentationConfig import datadog.trace.api.config.TracerConfig import datadog.trace.api.datastreams.AgentDataStreamsMonitoring import datadog.trace.api.datastreams.DataStreamsTransactionExtractor @@ -79,7 +79,6 @@ import java.nio.ByteBuffer import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.TimeUnit import java.util.concurrent.TimeoutException -import java.util.concurrent.atomic.AtomicInteger import net.bytebuddy.agent.ByteBuddyAgent import net.bytebuddy.agent.builder.AgentBuilder import net.bytebuddy.description.type.TypeDescription @@ -125,7 +124,7 @@ abstract class InstrumentationSpecification extends DDSpecification implements A StringBuilder ddEnvVars = new StringBuilder() for (Map.Entry entry : System.getProperties().entrySet()) { if (entry.getKey().toString().startsWith("dd.")) { - ddEnvVars.append(ConfigStrings.systemPropertyNameToEnvironmentVariableName(entry.getKey().toString())) + ddEnvVars.append(ConfigStrings.toEnvVar(entry.getKey().toString())) .append("=").append(entry.getValue()).append(",") } } @@ -169,10 +168,6 @@ abstract class InstrumentationSpecification extends DDSpecification implements A @Shared Set TRANSFORMED_CLASSES_TYPES = Sets.newConcurrentHashSet() - @SuppressWarnings('PropertyName') - @Shared - AtomicInteger INSTRUMENTATION_ERROR_COUNT = new AtomicInteger(0) - // don't use mocks because it will break too many exhaustive interaction-verifying tests @SuppressWarnings('PropertyName') @Shared @@ -353,11 +348,7 @@ abstract class InstrumentationSpecification extends DDSpecification implements A @SuppressForbidden void setupSpec() { - AgentMeter.registerIfAbsent( - STATS_D_CLIENT, - new MonitoringImpl(STATS_D_CLIENT, 10, TimeUnit.SECONDS), - DDSketchHistograms.FACTORY - ) + InstrumentationErrors.resetErrors() // If this fails, it's likely the result of another test loading Config before it can be // injected into the bootstrap classpath. If one test extends AgentTestRunner in a module, all tests must extend @@ -365,6 +356,14 @@ abstract class InstrumentationSpecification extends DDSpecification implements A configurePreAgent() + AgentTracer.maybeInstallLegacyContextManager() + + AgentMeter.registerIfAbsent( + STATS_D_CLIENT, + new MonitoringImpl(STATS_D_CLIENT, 10, TimeUnit.SECONDS), + DDSketchHistograms.FACTORY + ) + TEST_DATA_STREAMS_WRITER = new RecordingDatastreamsPayloadWriter() DDAgentFeaturesDiscovery features = new MockFeaturesDiscovery(true) @@ -423,6 +422,9 @@ abstract class InstrumentationSpecification extends DDSpecification implements A .hasNext(): "No instrumentation found" activeTransformer = AgentInstaller.installBytebuddyAgent( INSTRUMENTATION, true, AgentInstaller.getEnabledSystems(), this) + + // check for instrumentation issues during installation + assert InstrumentationErrors.noErrors(): InstrumentationErrors.describeErrors() } protected String idGenerationStrategyName() { @@ -431,12 +433,15 @@ abstract class InstrumentationSpecification extends DDSpecification implements A /** Override to set config before the agent is installed */ protected void configurePreAgent() { + injectSysConfig(TraceInstrumentationConfig.DETAILED_INSTRUMENTATION_ERRORS, "true") injectSysConfig(TracerConfig.SCOPE_ITERATION_KEEP_ALIVE, "1") // don't let iteration spans linger injectSysConfig(GeneralConfig.DATA_STREAMS_ENABLED, String.valueOf(isDataStreamsEnabled())) injectSysConfig(GeneralConfig.DATA_JOBS_ENABLED, String.valueOf(isDataJobsEnabled())) } void setup() { + InstrumentationErrors.resetErrors() // reset for each test + configureLoggingLevels() assertThreadsEachCleanup = false @@ -472,7 +477,6 @@ abstract class InstrumentationSpecification extends DDSpecification implements A if (forceAppSecActive) { ActiveSubsystems.APPSEC_ACTIVE = true } - InstrumentationErrors.resetErrorCount() ProcessTags.reset() } @@ -514,7 +518,9 @@ abstract class InstrumentationSpecification extends DDSpecification implements A spanFinishLocations.clear() originalToTrackingSpan.clear() } - assert InstrumentationErrors.errorCount == 0 + + // check for instrumentation issues while running each test + assert InstrumentationErrors.noErrors(): InstrumentationErrors.describeErrors() } private void doCheckRepeatedFinish() { @@ -556,8 +562,6 @@ abstract class InstrumentationSpecification extends DDSpecification implements A cleanupAfterAgent() // All cleanup should happen before these assertion. If not, a failing assertion may prevent cleanup - assert INSTRUMENTATION_ERROR_COUNT.get() == 0: INSTRUMENTATION_ERROR_COUNT.get() + " Instrumentation errors during test" - assert TRANSFORMED_CLASSES_TYPES.findAll { GlobalIgnores.isAdditionallyIgnored(it.getActualName()) }.isEmpty(): "Transformed classes match global libraries ignore matcher" @@ -621,7 +625,7 @@ abstract class InstrumentationSpecification extends DDSpecification implements A static void blockUntilChildSpansFinished(AgentSpan span, int numberOfSpans) { if (span instanceof DDSpan) { - def traceCollector = ((DDSpan) span).context().getTraceCollector() + def traceCollector = ((DDSpan) span).spanContext().getTraceCollector() if (!(traceCollector instanceof PendingTrace)) { throw new IllegalStateException("Expected $PendingTrace.name trace collector, got $traceCollector.class.name") } @@ -658,9 +662,9 @@ abstract class InstrumentationSpecification extends DDSpecification implements A return } + InstrumentationErrors.recordError(throwable) println "Unexpected instrumentation error when instrumenting ${typeName} on ${classLoader}" throwable.printStackTrace() - INSTRUMENTATION_ERROR_COUNT.incrementAndGet() } @Override diff --git a/dd-java-agent/instrumentation-testing/src/main/groovy/datadog/trace/agent/test/TrackingSpanDecorator.groovy b/dd-java-agent/instrumentation-testing/src/main/groovy/datadog/trace/agent/test/TrackingSpanDecorator.groovy index a3aee830cf8..b9de4adad0e 100644 --- a/dd-java-agent/instrumentation-testing/src/main/groovy/datadog/trace/agent/test/TrackingSpanDecorator.groovy +++ b/dd-java-agent/instrumentation-testing/src/main/groovy/datadog/trace/agent/test/TrackingSpanDecorator.groovy @@ -261,8 +261,8 @@ class TrackingSpanDecorator implements AgentSpan { } @Override - AgentSpanContext context() { - return delegate.context() + AgentSpanContext spanContext() { + return delegate.spanContext() } @Override diff --git a/dd-java-agent/instrumentation-testing/src/main/groovy/datadog/trace/agent/test/base/HttpServerTest.groovy b/dd-java-agent/instrumentation-testing/src/main/groovy/datadog/trace/agent/test/base/HttpServerTest.groovy index 03fced9538e..46abd76a6da 100644 --- a/dd-java-agent/instrumentation-testing/src/main/groovy/datadog/trace/agent/test/base/HttpServerTest.groovy +++ b/dd-java-agent/instrumentation-testing/src/main/groovy/datadog/trace/agent/test/base/HttpServerTest.groovy @@ -65,6 +65,8 @@ import java.util.function.Supplier import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.BODY_JSON import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.BODY_MULTIPART +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.BODY_MULTIPART_COMBINED +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.BODY_MULTIPART_REPEATED import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.BODY_URLENCODED import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.CREATED import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.CREATED_IS @@ -369,6 +371,14 @@ abstract class HttpServerTest extends WithHttpServer { false } + boolean testBodyFilenamesCalledOnce() { + false + } + + boolean testBodyFilenamesCalledOnceCombined() { + false + } + boolean testBodyFilenames() { false } @@ -377,6 +387,11 @@ abstract class HttpServerTest extends WithHttpServer { false } + /** Override to false when the multipart implementation uses a set with non-deterministic ordering (e.g. HashSet). */ + boolean testBodyFilesContentOrdering() { + true + } + boolean testBodyJson() { false } @@ -481,6 +496,8 @@ abstract class HttpServerTest extends WithHttpServer { CREATED_IS("created_input_stream", 201, "created"), BODY_URLENCODED("body-urlencoded?ignore=pair", 200, '[a:[x]]'), BODY_MULTIPART("body-multipart?ignore=pair", 200, '[a:[x]]'), + BODY_MULTIPART_REPEATED("body-multipart-repeated", 200, "ok"), + BODY_MULTIPART_COMBINED("body-multipart-combined", 200, "ok"), BODY_JSON("body-json", 200, '{"a":"x"}'), BODY_XML("body-xml", 200, 'mytext'), REDIRECT("redirect", 302, "/redirected"), @@ -1657,6 +1674,54 @@ abstract class HttpServerTest extends WithHttpServer { response.close() } + def 'test instrumentation gateway file upload filenames called once'() { + setup: + assumeTrue(testBodyFilenamesCalledOnce()) + RequestBody fileBody = RequestBody.create(MediaType.parse('application/octet-stream'), 'file content') + def body = new MultipartBody.Builder() + .setType(MultipartBody.FORM) + .addFormDataPart('file', 'evil.php', fileBody) + .build() + def httpRequest = request(BODY_MULTIPART_REPEATED, 'POST', body).build() + def response = client.newCall(httpRequest).execute() + + when: + TEST_WRITER.waitForTraces(1) + + then: + TEST_WRITER.get(0).any { + it.getTag('request.body.filenames') == "[evil.php]" + && it.getTag('_dd.appsec.filenames.cb.calls') == 1 + } + + cleanup: + response.close() + } + + def 'test instrumentation gateway file upload filenames called once via parameter map'() { + setup: + assumeTrue(testBodyFilenamesCalledOnceCombined()) + RequestBody fileBody = RequestBody.create(MediaType.parse('application/octet-stream'), 'file content') + def body = new MultipartBody.Builder() + .setType(MultipartBody.FORM) + .addFormDataPart('file', 'evil.php', fileBody) + .build() + def httpRequest = request(BODY_MULTIPART_COMBINED, 'POST', body).build() + def response = client.newCall(httpRequest).execute() + + when: + TEST_WRITER.waitForTraces(1) + + then: + TEST_WRITER.get(0).any { + it.getTag('request.body.filenames') == "[evil.php]" + && it.getTag('_dd.appsec.filenames.cb.calls') == 1 + } + + cleanup: + response.close() + } + def 'test instrumentation gateway file upload content'() { setup: assumeTrue(testBodyFilesContent()) @@ -1707,7 +1772,7 @@ abstract class HttpServerTest extends WithHttpServer { def 'test instrumentation gateway file upload content max files limit'() { setup: - assumeTrue(testBodyFilesContent()) + assumeTrue(testBodyFilesContent() && testBodyFilesContentOrdering()) def maxFilesToInspect = Config.get().getAppSecMaxFileContentCount() def bodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM) (1..maxFilesToInspect + 1).each { @@ -1725,8 +1790,8 @@ abstract class HttpServerTest extends WithHttpServer { TEST_WRITER.get(0).any { span -> def tag = span.getTag('request.body.files_content') as String - tag?.contains("content_of_file_$maxFilesToInspect") && - !tag.contains("content_of_file_${maxFilesToInspect + 1}") + // Exactly maxFilesToInspect files inspected; which file is excluded depends on iteration order + tag != null && tag.count('content_of_file_') == maxFilesToInspect } cleanup: @@ -2667,6 +2732,7 @@ abstract class HttpServerTest extends WithHttpServer { Object responseBody List uploadedFilenames List uploadedFilesContent + int uploadedFilenamesCallCount = 0 } static final String stringOrEmpty(String string) { @@ -2840,6 +2906,8 @@ abstract class HttpServerTest extends WithHttpServer { rqCtxt.traceSegment.setTagTop('request.body.filenames', filenames as String) Context context = rqCtxt.getData(RequestContextSlot.APPSEC) context.uploadedFilenames = filenames + context.uploadedFilenamesCallCount++ + rqCtxt.traceSegment.setTagTop('_dd.appsec.filenames.cb.calls', context.uploadedFilenamesCallCount) Flow.ResultFlow.empty() } as BiFunction, Flow>) diff --git a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/AbstractInstrumentationTest.java b/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/AbstractInstrumentationTest.java index 58f1831c0f3..e8fe97f00de 100644 --- a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/AbstractInstrumentationTest.java +++ b/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/AbstractInstrumentationTest.java @@ -13,6 +13,7 @@ import datadog.trace.agent.tooling.bytebuddy.matcher.ClassLoaderMatchers; import datadog.trace.api.Config; import datadog.trace.api.IdGenerationStrategy; +import datadog.trace.bootstrap.InstrumentationErrors; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentTracer.TracerAPI; import datadog.trace.common.writer.ListWriter; @@ -20,7 +21,9 @@ import datadog.trace.core.DDSpan; import datadog.trace.core.PendingTrace; import datadog.trace.core.TraceCollector; -import datadog.trace.junit.utils.context.AllowContextTestingExtension; +import datadog.trace.test.junit.utils.config.WithConfig; +import datadog.trace.test.junit.utils.context.AllowContextTestingExtension; +import datadog.trace.test.junit.utils.context.LegacyContextTestingExtension; import java.lang.instrument.ClassFileTransformer; import java.lang.instrument.Instrumentation; import java.util.List; @@ -51,7 +54,12 @@ *
  • {@code @AfterAll}: Closes the tracer and removes the agent transformer * */ -@ExtendWith({TestClassShadowingExtension.class, AllowContextTestingExtension.class}) +@WithConfig(key = "detailed.instrumentation.errors", value = "true") +@ExtendWith({ + TestClassShadowingExtension.class, + AllowContextTestingExtension.class, + LegacyContextTestingExtension.class +}) public abstract class AbstractInstrumentationTest { static final Instrumentation INSTRUMENTATION = ByteBuddyAgent.getInstrumentation(); @@ -66,6 +74,8 @@ public abstract class AbstractInstrumentationTest { @BeforeAll static void initAll() { + InstrumentationErrors.resetErrors(); + // If this fails, it's likely the result of another test loading Config before it can be // injected into the bootstrap classpath. assertNull(Config.class.getClassLoader(), "Config must load on the bootstrap classpath."); @@ -97,10 +107,14 @@ static void initAll() { activeTransformer = AgentInstaller.installBytebuddyAgent( INSTRUMENTATION, true, AgentInstaller.getEnabledSystems(), transformerListener); + + // check for instrumentation issues during installation + assertTrue(InstrumentationErrors.noErrors(), InstrumentationErrors::describeErrors); } @BeforeEach public void init() { + InstrumentationErrors.resetErrors(); // reset for each test tracer.flush(); writer.start(); } @@ -108,6 +122,9 @@ public void init() { @AfterEach public void tearDown() { tracer.flush(); + + // check for instrumentation issues while running each test + assertTrue(InstrumentationErrors.noErrors(), InstrumentationErrors::describeErrors); } @AfterAll @@ -184,7 +201,7 @@ protected void blockUntilChildSpansFinished(int numberOfSpans) { static void blockUntilChildSpansFinished(AgentSpan span, int numberOfSpans) { if (span instanceof DDSpan) { - TraceCollector traceCollector = ((DDSpan) span).context().getTraceCollector(); + TraceCollector traceCollector = ((DDSpan) span).spanContext().getTraceCollector(); if (!(traceCollector instanceof PendingTrace)) { throw new IllegalStateException( "Expected PendingTrace trace collector, got " + traceCollector.getClass().getName()); diff --git a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/BootstrapClasspathSetupListener.java b/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/BootstrapClasspathSetupListener.java index c5caff59c9b..4b2475ae1ea 100644 --- a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/BootstrapClasspathSetupListener.java +++ b/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/BootstrapClasspathSetupListener.java @@ -62,6 +62,7 @@ public void launcherSessionOpened(LauncherSession session) { */ public static final String[] BOOTSTRAP_PACKAGE_PREFIXES_COPY = { "datadog.slf4j", + "datadog.common.filesystem", "datadog.context", "datadog.environment", "datadog.json", diff --git a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/ClassFileTransformerListener.java b/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/ClassFileTransformerListener.java index 16ba4954efc..a865bf374d1 100644 --- a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/ClassFileTransformerListener.java +++ b/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/ClassFileTransformerListener.java @@ -1,13 +1,12 @@ package datadog.trace.agent.test; -import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.common.collect.Sets; import datadog.trace.agent.tooling.bytebuddy.matcher.GlobalIgnores; +import datadog.trace.bootstrap.InstrumentationErrors; import de.thetaphi.forbiddenapis.SuppressForbidden; import java.util.Set; -import java.util.concurrent.atomic.AtomicInteger; import net.bytebuddy.agent.builder.AgentBuilder; import net.bytebuddy.description.type.TypeDescription; import net.bytebuddy.dynamic.DynamicType; @@ -18,7 +17,6 @@ public class ClassFileTransformerListener implements AgentBuilder.Listener { final Set transformedClassesNames = Sets.newConcurrentHashSet(); final Set transformedClassesTypes = Sets.newConcurrentHashSet(); - final AtomicInteger instrumentationErrorCount = new AtomicInteger(0); @Override public void onTransformation( @@ -45,10 +43,10 @@ public void onError( return; } + InstrumentationErrors.recordError(throwable); System.out.println( "Unexpected instrumentation error when instrumenting " + typeName + " on " + classLoader); throwable.printStackTrace(); - instrumentationErrorCount.incrementAndGet(); } @Override @@ -70,9 +68,6 @@ public void onComplete( } public void verify() { - // Check instrumentation errors - int errorCount = this.instrumentationErrorCount.get(); - assertEquals(0, errorCount, errorCount + " instrumentation errors during test"); // Check effectively transformed classes that should have been ignored assertTrue( this.transformedClassesTypes.stream() diff --git a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/SpanLinkMatcher.java b/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/SpanLinkMatcher.java index ef70ace9764..76cb201e790 100644 --- a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/SpanLinkMatcher.java +++ b/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/SpanLinkMatcher.java @@ -1,15 +1,17 @@ package datadog.trace.agent.test.assertions; -import static datadog.trace.agent.test.assertions.Matchers.assertValue; -import static datadog.trace.agent.test.assertions.Matchers.is; import static datadog.trace.bootstrap.instrumentation.api.AgentSpanLink.DEFAULT_FLAGS; import static datadog.trace.bootstrap.instrumentation.api.SpanAttributes.EMPTY; +import static datadog.trace.test.junit.utils.assertions.Matchers.assertValue; +import static datadog.trace.test.junit.utils.assertions.Matchers.is; import datadog.trace.api.DDTraceId; import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext; import datadog.trace.bootstrap.instrumentation.api.AgentSpanLink; import datadog.trace.bootstrap.instrumentation.api.SpanAttributes; import datadog.trace.core.DDSpan; +import datadog.trace.test.junit.utils.assertions.Matcher; +import datadog.trace.test.junit.utils.assertions.Matchers; /** * Provides matchers for span links based on their properties such as trace and span IDs links refer @@ -37,7 +39,7 @@ private SpanLinkMatcher(Matcher traceIdMatcher, Matcher spanIdM * @return A {@code SpanLinkMatcher} that matches a span link to the given span. */ public static SpanLinkMatcher to(DDSpan span) { - return to(span.context()); + return to(span.spanContext()); } /** diff --git a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/SpanMatcher.java b/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/SpanMatcher.java index d913cd78752..693edfac39d 100644 --- a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/SpanMatcher.java +++ b/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/SpanMatcher.java @@ -1,14 +1,14 @@ package datadog.trace.agent.test.assertions; -import static datadog.trace.agent.test.assertions.Matchers.assertValue; -import static datadog.trace.agent.test.assertions.Matchers.is; -import static datadog.trace.agent.test.assertions.Matchers.isFalse; -import static datadog.trace.agent.test.assertions.Matchers.isNonNull; -import static datadog.trace.agent.test.assertions.Matchers.isNull; -import static datadog.trace.agent.test.assertions.Matchers.isTrue; -import static datadog.trace.agent.test.assertions.Matchers.matches; -import static datadog.trace.agent.test.assertions.Matchers.validates; import static datadog.trace.core.DDSpanAccessor.spanLinks; +import static datadog.trace.test.junit.utils.assertions.Matchers.assertValue; +import static datadog.trace.test.junit.utils.assertions.Matchers.is; +import static datadog.trace.test.junit.utils.assertions.Matchers.isFalse; +import static datadog.trace.test.junit.utils.assertions.Matchers.isNonNull; +import static datadog.trace.test.junit.utils.assertions.Matchers.isNull; +import static datadog.trace.test.junit.utils.assertions.Matchers.isTrue; +import static datadog.trace.test.junit.utils.assertions.Matchers.matches; +import static datadog.trace.test.junit.utils.assertions.Matchers.validates; import static java.time.Duration.ofNanos; import static org.junit.jupiter.api.AssertionFailureBuilder.assertionFailure; @@ -16,6 +16,10 @@ import datadog.trace.api.TagMap; import datadog.trace.bootstrap.instrumentation.api.AgentSpanLink; import datadog.trace.core.DDSpan; +import datadog.trace.test.junit.utils.assertions.Any; +import datadog.trace.test.junit.utils.assertions.IsNull; +import datadog.trace.test.junit.utils.assertions.Matcher; +import datadog.trace.test.junit.utils.assertions.Matchers; import java.time.Duration; import java.util.ArrayList; import java.util.Collection; @@ -45,6 +49,8 @@ * #durationLongerThan(Duration)} *
  • span type with {@link #type(String)} *
  • span error status with {@link #error()} and {@link #error(boolean)} + *
  • span measured status with {@link #measured()} and {@link #measured(boolean)} + *
  • span top-level status with {@link #topLevel()} and {@link #topLevel(boolean)} *
  • span tags with {@link #tags(TagsMatcher...)} *
  • span links with {@link #links(SpanLinkMatcher...)} * @@ -53,18 +59,22 @@ public final class SpanMatcher { private Matcher traceIdMatcher; private Matcher idMatcher; private Matcher parentIdMatcher; + private int parentSpanIndex; private Matcher serviceNameMatcher; private Matcher operationNameMatcher; private Matcher resourceNameMatcher; private Matcher durationMatcher; private Matcher typeMatcher; private Matcher errorMatcher; + private Matcher measuredMatcher; + private Matcher topLevelMatcher; private TagsMatcher[] tagMatchers; private SpanLinkMatcher[] linkMatchers; private static final Matcher CHILD_OF_PREVIOUS_MATCHER = is(0L); private SpanMatcher() { + this.parentSpanIndex = -1; this.serviceNameMatcher = validates(s -> s != null && !s.isEmpty()); this.typeMatcher = isNull(); this.errorMatcher = isFalse(); @@ -120,6 +130,7 @@ public SpanMatcher root() { */ public SpanMatcher childOf(long parentId) { this.parentIdMatcher = is(parentId); + this.parentSpanIndex = -1; return this; } @@ -130,6 +141,19 @@ public SpanMatcher childOf(long parentId) { */ public SpanMatcher childOfPrevious() { this.parentIdMatcher = CHILD_OF_PREVIOUS_MATCHER; + this.parentSpanIndex = -1; + return this; + } + + /** + * Checks the span is a direct child of the span at the specified index in the trace. + * + * @param parentSpanIndex The index of the parent span in the trace. + * @return The current {@link SpanMatcher} instance with the child-of constraint applied. + */ + public SpanMatcher childOfIndex(int parentSpanIndex) { + this.parentIdMatcher = null; + this.parentSpanIndex = parentSpanIndex; return this; } @@ -284,6 +308,50 @@ public SpanMatcher error(boolean errored) { return this; } + /** + * Checks the span is measured. + * + * @return The current {@link SpanMatcher} instance updated with the specified measured + * constraint. + */ + public SpanMatcher measured() { + return measured(true); + } + + /** + * Checks the span measured status matches the given value. + * + * @param measured The expected measured status. + * @return The current {@link SpanMatcher} instance updated with the specified measured + * constraint. + */ + public SpanMatcher measured(boolean measured) { + this.measuredMatcher = measured ? isTrue() : isFalse(); + return this; + } + + /** + * Checks the span is a top-level span. + * + * @return The current {@link SpanMatcher} instance updated with the specified top-level + * constraint. + */ + public SpanMatcher topLevel() { + return topLevel(true); + } + + /** + * Checks the span top-level status matches the given value. + * + * @param topLevel The expected top-level status. + * @return The current {@link SpanMatcher} instance updated with the specified top-level + * constraint. + */ + public SpanMatcher topLevel(boolean topLevel) { + this.topLevelMatcher = topLevel ? isTrue() : isFalse(); + return this; + } + public SpanMatcher tags(TagsMatcher... matchers) { this.tagMatchers = matchers; return this; @@ -301,21 +369,32 @@ public SpanMatcher links(SpanLinkMatcher... matchers) { return this; } - void assertSpan(DDSpan span, DDSpan previousSpan) { + void assertSpan(List trace, int spanIndex) { + DDSpan span = trace.get(spanIndex); + // Apply parent span index + if (this.parentSpanIndex >= 0) { + this.parentIdMatcher = is(trace.get(this.parentSpanIndex).getSpanId()); + } // Apply parent id matcher from the previous span - if (this.parentIdMatcher == CHILD_OF_PREVIOUS_MATCHER) { + else if (this.parentIdMatcher == CHILD_OF_PREVIOUS_MATCHER) { + if (spanIndex == 0) { + throw new IllegalStateException("Cannot use childOfPrevious() matcher on the first span"); + } + DDSpan previousSpan = trace.get(spanIndex - 1); this.parentIdMatcher = is(previousSpan.getSpanId()); } // Assert span values - assertValue(this.traceIdMatcher, span.getTraceId(), "Expected trace identifier"); - assertValue(this.idMatcher, span.getSpanId(), "Expected identifier"); - assertValue(this.parentIdMatcher, span.getParentId(), "Expected parent identifier"); - assertValue(this.serviceNameMatcher, span.getServiceName(), "Expected service name"); - assertValue(this.operationNameMatcher, span.getOperationName(), "Expected operation name"); - assertValue(this.resourceNameMatcher, span.getResourceName(), "Expected resource name"); - assertValue(this.durationMatcher, ofNanos(span.getDurationNano()), "Expected duration"); - assertValue(this.typeMatcher, span.getSpanType(), "Expected span type"); - assertValue(this.errorMatcher, span.isError(), "Expected error status"); + assertValue(this.traceIdMatcher, span.getTraceId(), "Unexpected trace identifier"); + assertValue(this.idMatcher, span.getSpanId(), "Unexpected identifier"); + assertValue(this.parentIdMatcher, span.getParentId(), "Unexpected parent identifier"); + assertValue(this.serviceNameMatcher, span.getServiceName(), "Unexpected service name"); + assertValue(this.operationNameMatcher, span.getOperationName(), "Unexpected operation name"); + assertValue(this.resourceNameMatcher, span.getResourceName(), "Unexpected resource name"); + assertValue(this.durationMatcher, ofNanos(span.getDurationNano()), "Unexpected duration"); + assertValue(this.typeMatcher, span.getSpanType(), "Unexpected span type"); + assertValue(this.errorMatcher, span.isError(), "Unexpected error status"); + assertValue(this.measuredMatcher, span.isMeasured(), "Unexpected measured status"); + assertValue(this.topLevelMatcher, span.isTopLevel(), "Unexpected top-level status"); assertSpanTags(span.getTags()); assertSpanLinks(spanLinks(span)); } @@ -374,7 +453,7 @@ private void assertSpanLinks(List links) { .buildAndThrow(); } for (int i = 0; i < expectedLinkCount; i++) { - SpanLinkMatcher linkMatcher = this.linkMatchers[expectedLinkCount]; + SpanLinkMatcher linkMatcher = this.linkMatchers[i]; AgentSpanLink link = links.get(i); linkMatcher.assertLink(link); } diff --git a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/TagsMatcher.java b/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/TagsMatcher.java index b9d439d0259..7fe7cd0645e 100644 --- a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/TagsMatcher.java +++ b/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/TagsMatcher.java @@ -1,8 +1,5 @@ package datadog.trace.agent.test.assertions; -import static datadog.trace.agent.test.assertions.Matchers.any; -import static datadog.trace.agent.test.assertions.Matchers.is; -import static datadog.trace.agent.test.assertions.Matchers.isNonNull; import static datadog.trace.api.DDTags.BASE_SERVICE; import static datadog.trace.api.DDTags.DD_INTEGRATION; import static datadog.trace.api.DDTags.DJM_ENABLED; @@ -24,7 +21,13 @@ import static datadog.trace.api.DDTags.TRACER_HOST; import static datadog.trace.common.sampling.RateByServiceTraceSampler.SAMPLING_AGENT_RATE; import static datadog.trace.common.writer.ddagent.TraceMapper.SAMPLING_PRIORITY_KEY; +import static datadog.trace.core.DDSpanContext.SAMPLE_RATE_KEY; +import static datadog.trace.test.junit.utils.assertions.Matchers.any; +import static datadog.trace.test.junit.utils.assertions.Matchers.is; +import static datadog.trace.test.junit.utils.assertions.Matchers.isNonNull; +import datadog.trace.test.junit.utils.assertions.Matcher; +import datadog.trace.test.junit.utils.assertions.Matchers; import java.util.HashMap; import java.util.Map; @@ -43,7 +46,7 @@ public static TagsMatcher defaultTags() { tagMatchers.put(LANGUAGE_TAG_KEY, any()); tagMatchers.put(SAMPLING_AGENT_RATE, any()); tagMatchers.put(SAMPLING_PRIORITY_KEY.toString(), any()); - tagMatchers.put("_sample_rate", any()); + tagMatchers.put(SAMPLE_RATE_KEY, any()); tagMatchers.put(PID_TAG, any()); tagMatchers.put(SCHEMA_VERSION_TAG_KEY, any()); tagMatchers.put(PROFILING_ENABLED, any()); diff --git a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/TraceAssertions.java b/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/TraceAssertions.java index 3299a8bc1be..ebbf23c5072 100644 --- a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/TraceAssertions.java +++ b/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/TraceAssertions.java @@ -4,6 +4,7 @@ import static org.junit.jupiter.api.AssertionFailureBuilder.assertionFailure; import datadog.trace.core.DDSpan; +import java.util.ArrayList; import java.util.Comparator; import java.util.List; import java.util.function.UnaryOperator; @@ -26,6 +27,9 @@ * */ public final class TraceAssertions { + /* + * Trace comparators. + */ /** Trace comparator to sort by start time. */ public static final Comparator> TRACE_START_TIME_COMPARATOR = Comparator.comparingLong( @@ -37,19 +41,19 @@ public final class TraceAssertions { trace -> trace.isEmpty() ? 0L : trace.get(0).getLocalRootSpan().getSpanId()); /* - * Trace assertions options. + * Trace assertion options. */ - /** Ignores addition traces. If there are more traces than expected, do not fail. */ + /** Ignores additional traces. If there are more traces than expected, do not fail. */ public static final UnaryOperator IGNORE_ADDITIONAL_TRACES = - Options::ignoredAdditionalTraces; + Options::ignoreAdditionalTraces; /** Sorts traces by start time. */ public static final UnaryOperator SORT_BY_START_TIME = - options -> options.sorter(TRACE_START_TIME_COMPARATOR); + options -> options.sort(TRACE_START_TIME_COMPARATOR); /** Sorts traces by their root span identifier. */ public static final UnaryOperator SORT_BY_ROOT_SPAN_ID = - options -> options.sorter(TRACE_ROOT_SPAN_ID_COMPARATOR); + options -> options.sort(TRACE_ROOT_SPAN_ID_COMPARATOR); private TraceAssertions() {} @@ -102,8 +106,9 @@ public static void assertTraces( .buildAndThrow(); } } - if (opts.sorter != null) { - traces.sort(opts.sorter); + if (opts.comparator != null) { + traces = new ArrayList<>(traces); + traces.sort(opts.comparator); } for (int i = 0; i < expectedTraceCount; i++) { List trace = traces.get(i); @@ -111,17 +116,17 @@ public static void assertTraces( } } - public static class Options { - boolean ignoredAdditionalTraces = false; - Comparator> sorter = TRACE_START_TIME_COMPARATOR; + public static final class Options { + private boolean ignoredAdditionalTraces = false; + private Comparator> comparator = TRACE_START_TIME_COMPARATOR; - public Options ignoredAdditionalTraces() { + public Options ignoreAdditionalTraces() { this.ignoredAdditionalTraces = true; return this; } - public Options sorter(Comparator> sorter) { - this.sorter = sorter; + public Options sort(Comparator> comparator) { + this.comparator = comparator; return this; } } diff --git a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/TraceMatcher.java b/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/TraceMatcher.java index 4187bcd3823..7511ee12f99 100644 --- a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/TraceMatcher.java +++ b/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/TraceMatcher.java @@ -1,10 +1,15 @@ package datadog.trace.agent.test.assertions; import static java.util.Comparator.comparingLong; +import static java.util.stream.Collectors.toSet; import datadog.trace.core.DDSpan; +import java.util.ArrayList; import java.util.Comparator; +import java.util.HashMap; import java.util.List; +import java.util.Map; +import java.util.Set; import java.util.function.UnaryOperator; import org.opentest4j.AssertionFailedError; @@ -15,17 +20,37 @@ * with the expected {@link SpanMatcher}s (one per expected span), or {@link #trace(UnaryOperator, * SpanMatcher...)} to configure the checks with a {@link Options} object. * - *

    {@link #SORT_BY_START_TIME} can be used as predefined configuration to sort spans by start - * time. + *

    The following predefined configurations: + * + *

      + *
    • {@link #SORT_BY_START_TIME} sorts spans by start time, + *
    • {@link #SORT_BY_ANCESTRY} sorts spans by ancestry, root spans (or which parents are not + * present in the trace chunk) first, followed by their children by start time, depth-first * + *
    * * @see TraceAssertions * @see SpanMatcher */ public final class TraceMatcher { + /* + * Span comparators. + */ + /** Span comparator to sort by start time. */ public static final Comparator START_TIME_COMPARATOR = - comparingLong(DDSpan::getStartTime); + comparingLong(DDSpan::getStartTime).thenComparingLong(DDSpan::getSpanId); + + /* + * Span assertion options. + */ + /** Sorts spans by start time. */ public static UnaryOperator SORT_BY_START_TIME = - options -> options.sorter(START_TIME_COMPARATOR); + options -> options.sort(START_TIME_COMPARATOR); + + /** + * Sorts spans by ancestry, root spans (or which parents are absent from the trace chunk) first, + * followed by their children by start time, depth-first. + */ + public static final UnaryOperator SORT_BY_ANCESTRY = Options::sortByAncestry; private final Options options; private final SpanMatcher[] matchers; @@ -65,22 +90,58 @@ void assertTrace(List trace, int traceIndex) { this.matchers.length, spanCount); } - if (this.options.sorter != null) { - trace.sort(this.options.sorter); + if (this.options.sortByAncestry) { + trace = sortByAncestry(trace); + } else if (this.options.comparator != null) { + trace = new ArrayList<>(trace); + trace.sort(this.options.comparator); } - DDSpan previousSpan = null; - for (int i = 0; i < spanCount; i++) { - DDSpan span = trace.get(i); - this.matchers[i].assertSpan(span, previousSpan); - previousSpan = span; + for (int spanIndex = 0; spanIndex < spanCount; spanIndex++) { + this.matchers[spanIndex].assertSpan(trace, spanIndex); } } - public static class Options { - Comparator sorter = null; + private static List sortByAncestry(List spans) { + Set spanIds = spans.stream().map(DDSpan::getSpanId).collect(toSet()); + Map> spansByParentId = new HashMap<>(); + for (DDSpan span : spans) { + long parentId = span.getParentId(); + if (parentId != 0 && !spanIds.contains(parentId)) { + parentId = 0; + } + spansByParentId.computeIfAbsent(parentId, k -> new ArrayList<>()).add(span); + } + spansByParentId.forEach((k, v) -> v.sort(START_TIME_COMPARATOR)); + + List ordered = new ArrayList<>(spans.size()); + appendChildren(ordered, spansByParentId.get(0L), spansByParentId); + return ordered; + } + + private static void appendChildren( + List orderedSpan, List children, Map> spansByParentId) { + for (DDSpan child : children) { + orderedSpan.add(child); + List grandChildren = spansByParentId.get(child.getSpanId()); + if (grandChildren != null) { + appendChildren(orderedSpan, grandChildren, spansByParentId); + } + } + } + + public static final class Options { + private Comparator comparator = null; + private boolean sortByAncestry = false; + + public Options sort(Comparator comparator) { + this.comparator = comparator; + this.sortByAncestry = false; + return this; + } - public Options sorter(Comparator sorter) { - this.sorter = sorter; + private Options sortByAncestry() { + this.comparator = null; + this.sortByAncestry = true; return this; } } diff --git a/dd-java-agent/instrumentation/aerospike-4.0/gradle.lockfile b/dd-java-agent/instrumentation/aerospike-4.0/gradle.lockfile index 5d28b64c66e..f9cb411503c 100644 --- a/dd-java-agent/instrumentation/aerospike-4.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/aerospike-4.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:aerospike-4.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -11,7 +12,7 @@ com.aerospike:aerospike-client:8.0.0=latestDepForkedTestCompileClasspath,latestD com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -20,15 +21,15 @@ com.github.docker-java:docker-java-api:3.4.2=latest7DepForkedTestCompileClasspat com.github.docker-java:docker-java-transport-zerodep:3.4.2=latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latest7DepForkedTestAnnotationProcessor,latest7DepForkedTestCompileClasspath,latest7DepTestAnnotationProcessor,latest7DepTestCompileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -38,12 +39,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latest7DepForkedTestAnnotationProcessor,latest7DepTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latest7DepForkedTestAnnotationProcessor,latest7DepTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latest7DepForkedTestAnnotationProcessor,latest7DepTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latest7DepForkedTestAnnotationProcessor,latest7DepTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latest7DepForkedTestAnnotationProcessor,latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestAnnotationProcessor,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latest7DepForkedTestAnnotationProcessor,latest7DepTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -54,12 +58,12 @@ commons-io:commons-io:2.11.0=latest7DepForkedTestCompileClasspath,latest7DepFork commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -91,6 +95,7 @@ org.hamcrest:hamcrest:3.0=latest7DepForkedTestCompileClasspath,latest7DepForkedT org.jctools:jctools-core-jdk11:4.0.6=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -112,14 +117,14 @@ org.objenesis:objenesis:3.3=latest7DepForkedTestCompileClasspath,latest7DepForke org.opentest4j:opentest4j:1.3.0=latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latest7DepForkedTestRuntimeClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latest7DepForkedTestCompileClasspath,latest7DepForkedTestRuntimeClasspath,latest7DepTestCompileClasspath,latest7DepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/aerospike-4.0/src/main/java/datadog/trace/instrumentation/aerospike4/AerospikeClientDecorator.java b/dd-java-agent/instrumentation/aerospike-4.0/src/main/java/datadog/trace/instrumentation/aerospike4/AerospikeClientDecorator.java index e00683755c9..134fed3a879 100644 --- a/dd-java-agent/instrumentation/aerospike-4.0/src/main/java/datadog/trace/instrumentation/aerospike4/AerospikeClientDecorator.java +++ b/dd-java-agent/instrumentation/aerospike-4.0/src/main/java/datadog/trace/instrumentation/aerospike4/AerospikeClientDecorator.java @@ -65,7 +65,7 @@ protected String dbHostname(final Node node) { return null; } - public AgentSpan onConnection( + public void onConnection( final AgentSpan span, final Node node, final Cluster cluster, final Partition partition) { onPeerConnection(span, node.getAddress()); @@ -85,8 +85,6 @@ public AgentSpan onConnection( span.setServiceName(instanceName, DB_CLIENT_SPLIT_BY_INSTANCE); } } - - return span; } public void withMethod(final AgentSpan span, final String methodName) { diff --git a/dd-java-agent/instrumentation/aerospike-4.0/src/main/java/datadog/trace/instrumentation/aerospike4/TracingListener.java b/dd-java-agent/instrumentation/aerospike-4.0/src/main/java/datadog/trace/instrumentation/aerospike4/TracingListener.java index b51b7b67398..be234ebb95f 100644 --- a/dd-java-agent/instrumentation/aerospike-4.0/src/main/java/datadog/trace/instrumentation/aerospike4/TracingListener.java +++ b/dd-java-agent/instrumentation/aerospike-4.0/src/main/java/datadog/trace/instrumentation/aerospike4/TracingListener.java @@ -17,8 +17,8 @@ import com.aerospike.client.listener.RecordListener; import com.aerospike.client.listener.RecordSequenceListener; import com.aerospike.client.listener.WriteListener; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; -import datadog.trace.bootstrap.instrumentation.api.AgentScope.Continuation; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.util.List; @@ -36,11 +36,11 @@ public final class TracingListener DeleteListener { protected final AgentSpan clientSpan; - protected final Continuation continuation; + protected final ContextContinuation continuation; protected final Object listener; public TracingListener( - final AgentSpan clientSpan, final Continuation continuation, final Object listener) { + final AgentSpan clientSpan, final ContextContinuation continuation, final Object listener) { this.clientSpan = clientSpan; this.continuation = continuation; this.listener = listener; @@ -73,7 +73,7 @@ public void onSuccess(final Key key, final boolean exists) { clientSpan.finish(); if (listener != null) { - try (final AgentScope scope = continuation.activate()) { + try (final ContextScope scope = continuation.resume()) { if (listener instanceof ExistsListener) { ((ExistsListener) listener).onSuccess(key, exists); } else if (listener instanceof DeleteListener) { @@ -81,7 +81,7 @@ public void onSuccess(final Key key, final boolean exists) { } } } else { - continuation.cancel(); + continuation.release(); } } @@ -91,11 +91,11 @@ public void onSuccess(final Key[] keys, final boolean[] exists) { clientSpan.finish(); if (listener != null) { - try (final AgentScope scope = continuation.activate()) { + try (final ContextScope scope = continuation.resume()) { ((ExistsArrayListener) listener).onSuccess(keys, exists); } } else { - continuation.cancel(); + continuation.release(); } } @@ -105,11 +105,11 @@ public void onSuccess(final Key key, final Record record) { clientSpan.finish(); if (listener != null) { - try (final AgentScope scope = continuation.activate()) { + try (final ContextScope scope = continuation.resume()) { ((RecordListener) listener).onSuccess(key, record); } } else { - continuation.cancel(); + continuation.release(); } } @@ -119,11 +119,11 @@ public void onSuccess(final Key[] keys, final Record[] records) { clientSpan.finish(); if (listener != null) { - try (final AgentScope scope = continuation.activate()) { + try (final ContextScope scope = continuation.resume()) { ((RecordArrayListener) listener).onSuccess(keys, records); } } else { - continuation.cancel(); + continuation.release(); } } @@ -133,11 +133,11 @@ public void onSuccess(final List records) { clientSpan.finish(); if (listener != null) { - try (final AgentScope scope = continuation.activate()) { + try (final ContextScope scope = continuation.resume()) { ((BatchListListener) listener).onSuccess(records); } } else { - continuation.cancel(); + continuation.release(); } } @@ -147,11 +147,11 @@ public void onSuccess(final Key key) { clientSpan.finish(); if (listener != null) { - try (final AgentScope scope = continuation.activate()) { + try (final ContextScope scope = continuation.resume()) { ((WriteListener) listener).onSuccess(key); } } else { - continuation.cancel(); + continuation.release(); } } @@ -161,11 +161,11 @@ public void onSuccess(final Key key, final Object obj) { clientSpan.finish(); if (listener != null) { - try (final AgentScope scope = continuation.activate()) { + try (final ContextScope scope = continuation.resume()) { ((ExecuteListener) listener).onSuccess(key, obj); } } else { - continuation.cancel(); + continuation.release(); } } @@ -175,7 +175,7 @@ public void onSuccess() { clientSpan.finish(); if (listener != null) { - try (final AgentScope scope = continuation.activate()) { + try (final ContextScope scope = continuation.resume()) { if (listener instanceof ExistsSequenceListener) { ((ExistsSequenceListener) listener).onSuccess(); } else if (listener instanceof RecordSequenceListener) { @@ -185,7 +185,7 @@ public void onSuccess() { } } } else { - continuation.cancel(); + continuation.release(); } } @@ -196,7 +196,7 @@ public void onFailure(final AerospikeException error) { clientSpan.finish(); if (listener != null) { - try (final AgentScope scope = continuation.activate()) { + try (final ContextScope scope = continuation.resume()) { if (listener instanceof ExistsListener) { ((ExistsListener) listener).onFailure(error); } else if (listener instanceof ExistsSequenceListener) { @@ -222,7 +222,7 @@ public void onFailure(final AerospikeException error) { } } } else { - continuation.cancel(); + continuation.release(); } } } diff --git a/dd-java-agent/instrumentation/aerospike-4.0/src/test/groovy/datadog/trace/instrumentation/aerospike4/AerospikeBaseTest.groovy b/dd-java-agent/instrumentation/aerospike-4.0/src/test/groovy/datadog/trace/instrumentation/aerospike4/AerospikeBaseTest.groovy index 57848379357..746f57577c8 100644 --- a/dd-java-agent/instrumentation/aerospike-4.0/src/test/groovy/datadog/trace/instrumentation/aerospike4/AerospikeBaseTest.groovy +++ b/dd-java-agent/instrumentation/aerospike-4.0/src/test/groovy/datadog/trace/instrumentation/aerospike4/AerospikeBaseTest.groovy @@ -1,6 +1,10 @@ package datadog.trace.instrumentation.aerospike4 +import static datadog.trace.agent.test.utils.PortUtils.waitForPortToOpen +import static java.util.concurrent.TimeUnit.SECONDS +import static org.testcontainers.containers.wait.strategy.Wait.forLogMessage +import com.github.dockerjava.api.model.Ulimit import datadog.trace.agent.test.asserts.TraceAssert import datadog.trace.agent.test.naming.VersionedNamingTestBase import datadog.trace.api.DDSpanTypes @@ -9,10 +13,6 @@ import datadog.trace.core.DDSpan import org.testcontainers.containers.GenericContainer import spock.lang.Shared -import static datadog.trace.agent.test.utils.PortUtils.waitForPortToOpen -import static java.util.concurrent.TimeUnit.SECONDS -import static org.testcontainers.containers.wait.strategy.Wait.forLogMessage - abstract class AerospikeBaseTest extends VersionedNamingTestBase { @Shared @@ -25,8 +25,14 @@ abstract class AerospikeBaseTest extends VersionedNamingTestBase { int aerospikePort = 3000 def setup() throws Exception { - aerospike = new GenericContainer('aerospike:5.5.0.9') + // Linux arm64 supported since `ce-6.2.0.2` + aerospike = new GenericContainer('aerospike:ce-6.2.0.2') .withExposedPorts(3000) + // proto-fd-max default is 15000, but container default is 1024. + // see: https://aerospike.com/docs/database/reference/config#service__proto-fd-max + .withCreateContainerCmdModifier({ cmd -> + cmd.getHostConfig().withUlimits([new Ulimit('nofile', 15000L, 15000L)] as Ulimit[]) + }) .waitingFor(forLogMessage(".*heartbeat-received.*\\n", 1)) aerospike.start() @@ -37,9 +43,7 @@ abstract class AerospikeBaseTest extends VersionedNamingTestBase { } def cleanup() throws Exception { - if (aerospike) { - aerospike.stop() - } + aerospike?.stop() } def aerospikeSpan(TraceAssert trace, int index, String methodName, Object parentSpan = null) { diff --git a/dd-java-agent/instrumentation/akka/akka-actor-2.5/build.gradle b/dd-java-agent/instrumentation/akka/akka-actor-2.5/build.gradle index 7fef692093b..e5e8bfcc84f 100644 --- a/dd-java-agent/instrumentation/akka/akka-actor-2.5/build.gradle +++ b/dd-java-agent/instrumentation/akka/akka-actor-2.5/build.gradle @@ -16,11 +16,19 @@ apply from: "$rootDir/gradle/java.gradle" apply from: "$rootDir/gradle/test-with-scala.gradle" addTestSuite('akka23Test') +addTestSuiteExtendingForDir('akka23ForkedTest', 'akka23Test', 'akka23Test') addTestSuiteForDir('latestDepTest', 'test') +addTestSuiteExtendingForDir('latestDepForkedTest', 'latestDepTest', 'akka23Test') tasks.named("compileAkka23TestGroovy", GroovyCompile) { classpath += files(sourceSets.akka23Test.scala.classesDirectory) } +tasks.named("compileAkka23ForkedTestGroovy", GroovyCompile) { + classpath += files(sourceSets.akka23ForkedTest.scala.classesDirectory) +} +tasks.named("compileLatestDepForkedTestGroovy", GroovyCompile) { + classpath += files(sourceSets.latestDepForkedTest.scala.classesDirectory) +} // Run the akka23Test against the normal and latestDep akka version as well sourceSets { diff --git a/dd-java-agent/instrumentation/akka/akka-actor-2.5/gradle.lockfile b/dd-java-agent/instrumentation/akka/akka-actor-2.5/gradle.lockfile index 42e468ec768..1bd577572b6 100644 --- a/dd-java-agent/instrumentation/akka/akka-actor-2.5/gradle.lockfile +++ b/dd-java-agent/instrumentation/akka/akka-actor-2.5/gradle.lockfile @@ -1,77 +1,80 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. -cafe.cryptography:curve25519-elisabeth:0.1.0=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -cafe.cryptography:ed25519-elisabeth:0.1.0=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -ch.qos.logback:logback-classic:1.2.13=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.13=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.blogspot.mydailyjava:weak-lock-free:0.17=akka23TestCompileClasspath,akka23TestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq.okhttp3:okhttp:3.12.15=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq.okio:okio:1.17.6=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=akka23TestCompileClasspath,akka23TestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-javac-plugin-client:0.2.2=akka23TestCompileClasspath,akka23TestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:java-dogstatsd-client:4.4.5=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.datadoghq:sketches-java:0.8.3=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:akka:akka-actor-2.5:dependencies --write-locks +cafe.cryptography:curve25519-elisabeth:0.1.0=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +cafe.cryptography:ed25519-elisabeth:0.1.0=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +ch.qos.logback:logback-classic:1.2.13=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.blogspot.mydailyjava:weak-lock-free:0.17=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq.okhttp3:okhttp:3.12.15=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq.okio:okio:1.17.6=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:java-dogstatsd-client:4.4.5=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.datadoghq:sketches-java:0.8.3=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.eed3si9n:shaded-jawn-parser_2.13:1.3.2=zinc com.eed3si9n:shaded-scalajson_2.13:1.0.0-M4=zinc com.eed3si9n:sjson-new-core_2.13:0.10.1=zinc com.eed3si9n:sjson-new-scalajson_2.13:0.10.1=zinc com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-a64asm:1.0.0=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-constants:0.10.4=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-x86asm:1.0.2=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=akka23TestCompileClasspath,akka23TestRuntimeClasspath,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-a64asm:1.0.0=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-constants:0.10.4=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-x86asm:1.0.2=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs -com.google.auto.service:auto-service-annotations:1.1.1=akka23TestAnnotationProcessor,akka23TestCompileClasspath,annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath -com.google.auto.service:auto-service:1.1.1=akka23TestAnnotationProcessor,annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.auto:auto-common:1.2.1=akka23TestAnnotationProcessor,annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.code.findbugs:jsr305:3.0.2=akka23TestAnnotationProcessor,akka23TestCompileClasspath,akka23TestRuntimeClasspath,annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.google.auto.service:auto-service-annotations:1.1.1=akka23ForkedTestAnnotationProcessor,akka23ForkedTestCompileClasspath,akka23TestAnnotationProcessor,akka23TestCompileClasspath,annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath +com.google.auto.service:auto-service:1.1.1=akka23ForkedTestAnnotationProcessor,akka23TestAnnotationProcessor,annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.auto:auto-common:1.2.1=akka23ForkedTestAnnotationProcessor,akka23TestAnnotationProcessor,annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.code.findbugs:jsr305:3.0.2=akka23ForkedTestAnnotationProcessor,akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestAnnotationProcessor,akka23TestCompileClasspath,akka23TestRuntimeClasspath,annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs -com.google.errorprone:error_prone_annotations:2.18.0=akka23TestAnnotationProcessor,annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.errorprone:error_prone_annotations:2.18.0=akka23ForkedTestAnnotationProcessor,akka23TestAnnotationProcessor,annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:failureaccess:1.0.1=akka23TestAnnotationProcessor,annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.guava:guava:32.0.1-jre=akka23TestAnnotationProcessor,annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=akka23TestAnnotationProcessor,annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.j2objc:j2objc-annotations:2.8=akka23TestAnnotationProcessor,annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.1=akka23ForkedTestAnnotationProcessor,akka23TestAnnotationProcessor,annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.3=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:32.0.1-jre=akka23ForkedTestAnnotationProcessor,akka23TestAnnotationProcessor,annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=akka23ForkedTestAnnotationProcessor,akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestAnnotationProcessor,akka23TestCompileClasspath,akka23TestRuntimeClasspath,annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:2.8=akka23ForkedTestAnnotationProcessor,akka23TestAnnotationProcessor,annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:3.1=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc -com.squareup.moshi:moshi:1.11.0=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:logging-interceptor:3.12.12=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:okhttp:3.12.12=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.squareup.okio:okio:1.17.5=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.moshi:moshi:1.11.0=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:logging-interceptor:3.12.12=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:okhttp:3.12.12=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.okio:okio:1.17.5=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.swoval:file-tree-views:2.1.12=zinc com.thoughtworks.qdox:qdox:1.12.1=codenarc -com.typesafe.akka:akka-actor_2.11:2.3.16=akka23TestCompileClasspath,akka23TestRuntimeClasspath +com.typesafe.akka:akka-actor_2.11:2.3.16=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath com.typesafe.akka:akka-actor_2.11:2.5.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.typesafe.akka:akka-actor_2.11:2.5.32=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.typesafe.akka:akka-testkit_2.11:2.3.16=akka23TestCompileClasspath,akka23TestRuntimeClasspath +com.typesafe.akka:akka-actor_2.11:2.5.32=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.typesafe.akka:akka-testkit_2.11:2.3.16=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath com.typesafe.akka:akka-testkit_2.11:2.5.0=testCompileClasspath,testRuntimeClasspath -com.typesafe.akka:akka-testkit_2.11:2.5.32=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.typesafe:config:1.2.1=akka23TestCompileClasspath,akka23TestRuntimeClasspath +com.typesafe.akka:akka-testkit_2.11:2.5.32=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.typesafe:config:1.2.1=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath com.typesafe:config:1.3.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.typesafe:config:1.3.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -commons-fileupload:commons-fileupload:1.5=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -commons-io:commons-io:2.11.0=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.typesafe:config:1.3.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +commons-fileupload:commons-fileupload:1.5=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +commons-io:commons-io:2.11.0=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs -de.thetaphi:forbiddenapis:3.10=akka23TestCompileClasspath,akka23TestRuntimeClasspath,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc -io.leangen.geantyref:geantyref:1.3.16=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -javax.servlet:javax.servlet-api:3.1.0=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +de.thetaphi:forbiddenapis:3.10=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.github.java-diff-utils:java-diff-utils:4.15=zinc +io.leangen.geantyref:geantyref:1.3.16=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +javax.servlet:javax.servlet-api:3.1.0=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -junit:junit:4.13.2=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=akka23TestCompileClasspath,akka23TestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=akka23TestCompileClasspath,akka23TestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.java.dev.jna:jna-platform:5.8.0=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc -net.java.dev.jna:jna:5.8.0=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +junit:junit:4.13.2=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.java.dev.jna:jna-platform:5.8.0=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +net.java.dev.jna:jna:5.8.0=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.openhft:zero-allocation-hashing:0.16=zinc net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc @@ -83,94 +86,95 @@ org.apache.logging.log4j:log4j-api:2.17.1=zinc org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.17.1=zinc org.apache.logging.log4j:log4j-core:2.25.2=spotbugs -org.apiguardian:apiguardian-api:1.1.2=akka23TestCompileClasspath,latestDepTestCompileClasspath,testCompileClasspath -org.checkerframework:checker-qual:3.33.0=akka23TestAnnotationProcessor,annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +org.apiguardian:apiguardian-api:1.1.2=akka23ForkedTestCompileClasspath,akka23TestCompileClasspath,latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath,testCompileClasspath +org.checkerframework:checker-qual:3.33.0=akka23ForkedTestAnnotationProcessor,akka23TestAnnotationProcessor,annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc org.codehaus.groovy:groovy-json:3.0.23=codenarc -org.codehaus.groovy:groovy-json:3.0.25=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-json:3.0.25=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codehaus.groovy:groovy-templates:3.0.23=codenarc org.codehaus.groovy:groovy-xml:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.23=codenarc -org.codehaus.groovy:groovy:3.0.25=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy:3.0.25=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc -org.hamcrest:hamcrest-core:1.3=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.hamcrest:hamcrest:3.0=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jctools:jctools-core-jdk11:4.0.6=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jctools:jctools-core:4.0.6=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.hamcrest:hamcrest-core:1.3=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.hamcrest:hamcrest:3.0=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jctools:jctools-core-jdk11:4.0.6=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jctools:jctools-core:4.0.6=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc -org.junit.jupiter:junit-jupiter-api:5.14.1=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-engine:5.14.1=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-params:5.14.1=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter:5.14.1=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-commons:1.14.1=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-engine:1.14.1=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-launcher:1.14.1=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-runner:1.14.1=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-api:1.14.1=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-commons:1.14.1=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jline:jline:3.27.1=zinc +org.jspecify:jspecify:1.0.0=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:5.14.1=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.14.1=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.14.1=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.14.1=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.14.1=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.14.1=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-runner:1.14.1=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-api:1.14.1=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-commons:1.14.1=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs -org.junit:junit-bom:5.14.1=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.mockito:mockito-core:4.4.0=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.objenesis:objenesis:3.3=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.opentest4j:opentest4j:1.3.0=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-analysis:9.7.1=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit:junit-bom:5.14.1=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-core:4.4.0=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.objenesis:objenesis:3.3=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.opentest4j:opentest4j:1.3.0=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-analysis:9.7.1=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-util:9.7.1=akka23TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-util:9.7.1=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=akka23TestCompileClasspath,akka23TestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-lang.modules:scala-java8-compat_2.11:0.7.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.scala-lang.modules:scala-java8-compat_2.11:0.7.0=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=zinc org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc -org.scala-lang:scala-library:2.11.12=akka23TestCompileClasspath,akka23TestRuntimeClasspath,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-lang:scala-library:2.13.15=zinc -org.scala-lang:scala-reflect:2.13.15=zinc -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-lang:scala-compiler:2.13.16=zinc +org.scala-lang:scala-library:2.11.12=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.scala-lang:scala-library:2.13.16=zinc +org.scala-lang:scala-reflect:2.13.16=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc -org.slf4j:jcl-over-slf4j:1.7.30=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:jul-to-slf4j:1.7.30=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:log4j-over-slf4j:1.7.30=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc +org.slf4j:jcl-over-slf4j:1.7.30=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:jul-to-slf4j:1.7.30=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:log4j-over-slf4j:1.7.30=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath -org.slf4j:slf4j-api:1.7.32=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.32=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j -org.snakeyaml:snakeyaml-engine:2.9=akka23TestRuntimeClasspath,buildTimeInstrumentationPlugin,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath -org.spockframework:spock-bom:2.4-groovy-3.0=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.spockframework:spock-core:2.4-groovy-3.0=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-junit:1.2.1=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-parser:1.2.0=akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.snakeyaml:snakeyaml-engine:2.9=akka23ForkedTestRuntimeClasspath,akka23TestRuntimeClasspath,buildTimeInstrumentationPlugin,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +org.spockframework:spock-bom:2.4-groovy-3.0=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.spockframework:spock-core:2.4-groovy-3.0=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-junit:1.2.1=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-parser:1.2.0=akka23ForkedTestCompileClasspath,akka23ForkedTestRuntimeClasspath,akka23TestCompileClasspath,akka23TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs empty=scalaCompilerPlugins,scalaToolchainRuntimeClasspath,spotbugsPlugins diff --git a/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/akka23Test/groovy/AkkaActorTest.groovy b/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/akka23Test/groovy/AkkaActorTest.groovy index 2f958f5bdbf..e4a5d76d27a 100644 --- a/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/akka23Test/groovy/AkkaActorTest.groovy +++ b/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/akka23Test/groovy/AkkaActorTest.groovy @@ -1,10 +1,12 @@ import datadog.trace.agent.test.InstrumentationSpecification import datadog.trace.api.config.TraceInstrumentationConfig import datadog.trace.bootstrap.instrumentation.api.Tags +import spock.lang.AutoCleanup import spock.lang.Shared class AkkaActorTest extends InstrumentationSpecification { @Shared + @AutoCleanup def akkaTester = new AkkaActors() def "akka actor send #name #iterations"() { @@ -84,7 +86,7 @@ class AkkaActorTest extends InstrumentationSpecification { } } -class AkkaActorContextSwapTest extends AkkaActorTest { +class AkkaActorContextSwapForkedTest extends AkkaActorTest { @Override void configurePreAgent() { super.configurePreAgent() diff --git a/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/akka23Test/scala/AkkaActors.scala b/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/akka23Test/scala/AkkaActors.scala index 10ab806c329..7dc5e1741df 100644 --- a/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/akka23Test/scala/AkkaActors.scala +++ b/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/akka23Test/scala/AkkaActors.scala @@ -11,6 +11,7 @@ import datadog.trace.bootstrap.instrumentation.api.AgentTracer.{ startSpan } +import scala.concurrent.Await import scala.concurrent.duration._ class AkkaActors extends AutoCloseable { @@ -87,24 +88,18 @@ object AkkaActors { } // The way to terminate an actor system has changed between versions - val terminate: (ActorSystem) => Unit = { - val t = - try { - ActorSystem.getClass.getMethod("terminate") - } catch { - case _: Throwable => - try { - ActorSystem.getClass.getMethod("awaitTermination") - } catch { - case _: Throwable => null - } - } - if (t ne null) { - { system: ActorSystem => - t.invoke(system) - } - } else { - { _ => ??? } + val terminate: (ActorSystem) => Unit = { system => + try { + classOf[ActorSystem].getMethod("terminate").invoke(system) + val whenTerminated = classOf[ActorSystem] + .getMethod("whenTerminated") + .invoke(system) + .asInstanceOf[scala.concurrent.Future[AnyRef]] + Await.ready(whenTerminated, 30.seconds) + } catch { + case _: NoSuchMethodException => + classOf[ActorSystem].getMethod("shutdown").invoke(system) + classOf[ActorSystem].getMethod("awaitTermination").invoke(system) } } } diff --git a/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaActorCellInstrumentation.java b/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaActorCellInstrumentation.java index f799267fb2d..4343ae0bd47 100644 --- a/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaActorCellInstrumentation.java +++ b/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaActorCellInstrumentation.java @@ -3,18 +3,18 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.checkpointActiveForRollback; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.rollbackActiveToCheckpoint; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; import static java.util.Collections.singletonMap; import static net.bytebuddy.matcher.ElementMatchers.isMethod; import akka.dispatch.Envelope; import com.google.auto.service.AutoService; import datadog.context.Context; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.api.InstrumenterConfig; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.java.concurrent.AdviceUtils; import datadog.trace.bootstrap.instrumentation.java.concurrent.State; import java.util.Map; @@ -59,7 +59,7 @@ public static class InvokeAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) public static Context enter( @Advice.Argument(value = 0) Envelope envelope, - @Advice.Local("taskScope") AgentScope taskScope) { + @Advice.Local("taskScope") ContextScope taskScope) { // do this before checkpointing, as the envelope's task scope may already be active taskScope = @@ -71,13 +71,14 @@ public static Context enter( checkpointActiveForRollback(); return null; } else { - return getCurrentContext().swap(); + return currentContext().swap(); } } @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void exit( - @Advice.Local("taskScope") AgentScope taskScope, @Advice.Enter Context checkpointContext) { + @Advice.Local("taskScope") ContextScope taskScope, + @Advice.Enter Context checkpointContext) { if (checkpointContext == null) { // Clean up any leaking scopes from akka-streams/akka-http etc. diff --git a/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaForkJoinExecutorTaskInstrumentation.java b/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaForkJoinExecutorTaskInstrumentation.java index b72f9f9a8f1..8f7c2f893a7 100644 --- a/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaForkJoinExecutorTaskInstrumentation.java +++ b/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaForkJoinExecutorTaskInstrumentation.java @@ -9,11 +9,11 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArgument; import com.google.auto.service.AutoService; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.api.InstrumenterConfig; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.java.concurrent.State; import java.util.Collections; import java.util.Map; @@ -66,12 +66,12 @@ public static void construct(@Advice.Argument(0) Runnable wrapped) { public static final class Run { @Advice.OnMethodEnter - public static AgentScope before(@Advice.Argument(0) Runnable wrapped) { + public static ContextScope before(@Advice.Argument(0) Runnable wrapped) { return startTaskScope(InstrumentationContext.get(Runnable.class, State.class), wrapped); } @Advice.OnMethodExit(onThrowable = Throwable.class) - public static void after(@Advice.Enter AgentScope scope) { + public static void after(@Advice.Enter ContextScope scope) { endTaskScope(scope); } } diff --git a/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaForkJoinTaskInstrumentation.java b/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaForkJoinTaskInstrumentation.java index 69960e8ac34..d079a6e03b8 100644 --- a/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaForkJoinTaskInstrumentation.java +++ b/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaForkJoinTaskInstrumentation.java @@ -16,12 +16,12 @@ import akka.dispatch.forkjoin.ForkJoinTask; import com.google.auto.service.AutoService; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.ExcludeFilterProvider; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.api.InstrumenterConfig; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.java.concurrent.ExcludeFilter; import datadog.trace.bootstrap.instrumentation.java.concurrent.State; import java.util.Arrays; @@ -103,12 +103,12 @@ public void methodAdvice(MethodTransformer transformer) { public static final class Exec { @Advice.OnMethodEnter - public static AgentScope before(@Advice.This ForkJoinTask task) { + public static ContextScope before(@Advice.This ForkJoinTask task) { return startTaskScope(InstrumentationContext.get(ForkJoinTask.class, State.class), task); } @Advice.OnMethodExit(onThrowable = Throwable.class) - public static void after(@Advice.Enter AgentScope scope) { + public static void after(@Advice.Enter ContextScope scope) { endTaskScope(scope); } } diff --git a/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaMailboxInstrumentation.java b/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaMailboxInstrumentation.java index 6f1eae44b34..96efa140128 100644 --- a/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaMailboxInstrumentation.java +++ b/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaMailboxInstrumentation.java @@ -3,26 +3,19 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.checkpointActiveForRollback; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.rollbackActiveToCheckpoint; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; -import static java.util.Collections.singletonList; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; import static net.bytebuddy.matcher.ElementMatchers.isMethod; import com.google.auto.service.AutoService; import datadog.context.Context; -import datadog.trace.agent.tooling.ExcludeFilterProvider; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.api.InstrumenterConfig; -import datadog.trace.bootstrap.instrumentation.java.concurrent.ExcludeFilter; -import java.util.Collection; -import java.util.EnumMap; -import java.util.List; -import java.util.Map; import net.bytebuddy.asm.Advice; @AutoService(InstrumenterModule.class) public class AkkaMailboxInstrumentation extends InstrumenterModule.ContextTracking - implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice, ExcludeFilterProvider { + implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { public AkkaMailboxInstrumentation() { super("akka_actor_mailbox", "akka_actor", "akka_concurrent", "java_concurrent"); @@ -39,16 +32,6 @@ public void methodAdvice(MethodTransformer transformer) { isMethod().and(named("run")), getClass().getName() + "$SuppressMailboxRunAdvice"); } - @Override - public Map> excludedClasses() { - List excludedClass = singletonList("akka.dispatch.MailBox"); - EnumMap> excludedTypes = - new EnumMap<>(ExcludeFilter.ExcludeType.class); - excludedTypes.put(ExcludeFilter.ExcludeType.RUNNABLE, excludedClass); - excludedTypes.put(ExcludeFilter.ExcludeType.FORK_JOIN_TASK, excludedClass); - return excludedTypes; - } - /** * This instrumentation is defensive and closes all scopes on the scope stack that were not there * when we started processing this actor mailbox. The reason for that is twofold. @@ -68,7 +51,7 @@ public static Context enter() { checkpointActiveForRollback(); return null; } else { - return getCurrentContext().swap(); + return currentContext().swap(); } } diff --git a/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaRoutedActorCellInstrumentation.java b/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaRoutedActorCellInstrumentation.java index 40e0988374a..90d5ccf1fb8 100644 --- a/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaRoutedActorCellInstrumentation.java +++ b/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/main/java/datadog/trace/instrumentation/akka/concurrent/AkkaRoutedActorCellInstrumentation.java @@ -8,10 +8,10 @@ import akka.dispatch.Envelope; import akka.routing.RoutedActorCell; import com.google.auto.service.AutoService; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.java.concurrent.AdviceUtils; import datadog.trace.bootstrap.instrumentation.java.concurrent.State; import java.util.Map; @@ -48,7 +48,7 @@ public void methodAdvice(MethodTransformer transformer) { */ public static class SendMessageAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) - public static AgentScope enter( + public static ContextScope enter( @Advice.This RoutedActorCell zis, @Advice.Argument(value = 0) Envelope envelope) { // If this isn't a management message, it will be deconstructed before being routed through // the routing logic, so activate the Scope @@ -61,7 +61,7 @@ public static AgentScope enter( } @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) - public static void exit(@Advice.Enter AgentScope scope) { + public static void exit(@Advice.Enter ContextScope scope) { if (null != scope) { scope.close(); // then we have invoked an Envelope and need to mark the work complete diff --git a/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/test/java/LinearTask.java b/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/test/java/LinearTask.java index caffe6096f5..14be3d3601b 100644 --- a/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/test/java/LinearTask.java +++ b/dd-java-agent/instrumentation/akka/akka-actor-2.5/src/test/java/LinearTask.java @@ -2,7 +2,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; import akka.dispatch.forkjoin.RecursiveTask; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; public class LinearTask extends RecursiveTask { @@ -32,7 +32,7 @@ protected Integer compute() { } else { int next = parent + 1; AgentSpan span = startSpan("test", Integer.toString(next)); - try (AgentScope scope = activateSpan(span)) { + try (ContextScope scope = activateSpan(span)) { LinearTask child = new LinearTask(next, depth); return child.fork().join(); } finally { diff --git a/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.0/gradle.lockfile b/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.0/gradle.lockfile index 88a41c0a523..2ce131efff4 100644 --- a/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:akka:akka-http:akka-http-10.0:dependencies --write-locks aopalliance:aopalliance:1.0=lagomTestCompileClasspath,lagomTestRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath @@ -9,7 +10,7 @@ ch.qos.logback:logback-core:1.2.13=baseForkedTestCompileClasspath,baseForkedTest com.blogspot.mydailyjava:weak-lock-free:0.17=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath com.datadoghq.okio:okio:1.17.6=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath com.datadoghq:sketches-java:0.8.3=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath @@ -37,17 +38,17 @@ com.fasterxml.jackson.module:jackson-module-parameter-names:2.8.11=lagomTestComp com.fasterxml.jackson:jackson-bom:2.13.4=latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc com.github.jnr:jffi:1.2.16=lagomTestCompileClasspath -com.github.jnr:jffi:1.3.14=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath +com.github.jnr:jffi:1.3.15=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath com.github.jnr:jnr-constants:0.9.9=lagomTestCompileClasspath -com.github.jnr:jnr-enxio:0.32.19=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath com.github.jnr:jnr-ffi:2.1.6=lagomTestCompileClasspath -com.github.jnr:jnr-ffi:2.2.18=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,baseForkedTestAnnotationProcessor,baseForkedTestCompileClasspath,baseTestAnnotationProcessor,baseTestCompileClasspath,compileClasspath,csiCompileClasspath,iastTestAnnotationProcessor,iastTestCompileClasspath,lagomTestAnnotationProcessor,lagomTestCompileClasspath,latestDepIastTestAnnotationProcessor,latestDepIastTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath,version101ForkedTestAnnotationProcessor,version101ForkedTestCompileClasspath,version101IastTestAnnotationProcessor,version101IastTestCompileClasspath,version101TestAnnotationProcessor,version101TestCompileClasspath,version102IastTestAnnotationProcessor,version102IastTestCompileClasspath,version102Scala213TestAnnotationProcessor,version102Scala213TestCompileClasspath @@ -55,19 +56,19 @@ com.google.auto.service:auto-service:1.1.1=annotationProcessor,baseForkedTestAnn com.google.auto:auto-common:1.2.1=annotationProcessor,baseForkedTestAnnotationProcessor,baseTestAnnotationProcessor,iastTestAnnotationProcessor,lagomTestAnnotationProcessor,latestDepIastTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,version101ForkedTestAnnotationProcessor,version101IastTestAnnotationProcessor,version101TestAnnotationProcessor,version102IastTestAnnotationProcessor,version102Scala213TestAnnotationProcessor com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,baseForkedTestAnnotationProcessor,baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestAnnotationProcessor,baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath,csiCompileClasspath,iastTestAnnotationProcessor,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestAnnotationProcessor,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestAnnotationProcessor,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath,version101ForkedTestAnnotationProcessor,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestAnnotationProcessor,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestAnnotationProcessor,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestAnnotationProcessor,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestAnnotationProcessor,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs -com.google.errorprone:error_prone_annotations:2.0.18=lagomTestCompileClasspath,lagomTestRuntimeClasspath com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,baseForkedTestAnnotationProcessor,baseTestAnnotationProcessor,iastTestAnnotationProcessor,lagomTestAnnotationProcessor,latestDepIastTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,version101ForkedTestAnnotationProcessor,version101IastTestAnnotationProcessor,version101TestAnnotationProcessor,version102IastTestAnnotationProcessor,version102Scala213TestAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,baseForkedTestAnnotationProcessor,baseTestAnnotationProcessor,iastTestAnnotationProcessor,lagomTestAnnotationProcessor,latestDepIastTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,version101ForkedTestAnnotationProcessor,version101IastTestAnnotationProcessor,version101TestAnnotationProcessor,version102IastTestAnnotationProcessor,version102Scala213TestAnnotationProcessor -com.google.guava:guava:20.0=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath -com.google.guava:guava:22.0=lagomTestCompileClasspath,lagomTestRuntimeClasspath +com.google.guava:failureaccess:1.0.3=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,baseForkedTestAnnotationProcessor,baseTestAnnotationProcessor,iastTestAnnotationProcessor,lagomTestAnnotationProcessor,latestDepIastTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,version101ForkedTestAnnotationProcessor,version101IastTestAnnotationProcessor,version101TestAnnotationProcessor,version102IastTestAnnotationProcessor,version102Scala213TestAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,baseForkedTestAnnotationProcessor,baseTestAnnotationProcessor,iastTestAnnotationProcessor,lagomTestAnnotationProcessor,latestDepIastTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,version101ForkedTestAnnotationProcessor,version101IastTestAnnotationProcessor,version101TestAnnotationProcessor,version102IastTestAnnotationProcessor,version102Scala213TestAnnotationProcessor +com.google.guava:guava:33.6.0-jre=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,baseForkedTestAnnotationProcessor,baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestAnnotationProcessor,baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestAnnotationProcessor,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestAnnotationProcessor,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestAnnotationProcessor,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath,version101ForkedTestAnnotationProcessor,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestAnnotationProcessor,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestAnnotationProcessor,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestAnnotationProcessor,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestAnnotationProcessor,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath com.google.inject.extensions:guice-assistedinject:4.1.0=lagomTestCompileClasspath,lagomTestRuntimeClasspath com.google.inject:guice:4.1.0=lagomTestCompileClasspath,lagomTestRuntimeClasspath -com.google.j2objc:j2objc-annotations:1.1=lagomTestCompileClasspath,lagomTestRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,baseForkedTestAnnotationProcessor,baseTestAnnotationProcessor,iastTestAnnotationProcessor,lagomTestAnnotationProcessor,latestDepIastTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,version101ForkedTestAnnotationProcessor,version101IastTestAnnotationProcessor,version101TestAnnotationProcessor,version102IastTestAnnotationProcessor,version102Scala213TestAnnotationProcessor -com.google.re2j:re2j:1.7=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath +com.google.re2j:re2j:1.8=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath com.lightbend.lagom:lagom-api_2.11:1.4.0=lagomTestCompileClasspath,lagomTestRuntimeClasspath com.lightbend.lagom:lagom-client_2.11:1.4.0=lagomTestCompileClasspath,lagomTestRuntimeClasspath com.lightbend.lagom:lagom-cluster-core_2.11:1.4.0=lagomTestCompileClasspath,lagomTestRuntimeClasspath @@ -200,7 +201,7 @@ de.thetaphi:forbiddenapis:3.10=baseForkedTestCompileClasspath,baseForkedTestRunt io.aeron:aeron-client:1.7.0=lagomTestCompileClasspath,lagomTestRuntimeClasspath io.aeron:aeron-driver:1.7.0=lagomTestCompileClasspath,lagomTestRuntimeClasspath io.dropwizard.metrics:metrics-core:3.2.2=lagomTestCompileClasspath,lagomTestRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.jsonwebtoken:jjwt:0.7.0=lagomTestCompileClasspath,lagomTestRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath io.netty:netty-buffer:4.1.19.Final=lagomTestCompileClasspath,lagomTestRuntimeClasspath @@ -216,7 +217,7 @@ io.netty:netty:3.10.6.Final=lagomTestCompileClasspath,lagomTestRuntimeClasspath io.spray:spray-json_2.11:1.3.3=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath io.spray:spray-json_2.12:1.3.6=version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath io.spray:spray-json_2.13:1.3.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath javax.cache:cache-api:1.0.0=lagomTestCompileClasspath,lagomTestRuntimeClasspath javax.inject:javax.inject:1=lagomTestCompileClasspath,lagomTestRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath @@ -225,10 +226,9 @@ jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.9.9=lagomTestCompileClasspath,lagomTestRuntimeClasspath junit:junit:4.11=lagomTestCompileClasspath junit:junit:4.13.2=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.8.0=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath net.jodah:typetools:0.5.0=lagomTestCompileClasspath,lagomTestRuntimeClasspath net.openhft:zero-allocation-hashing:0.16=zinc @@ -255,11 +255,10 @@ org.codehaus.groovy:groovy-templates:3.0.23=codenarc org.codehaus.groovy:groovy-xml:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath -org.codehaus.mojo:animal-sniffer-annotations:1.14=lagomTestCompileClasspath,lagomTestRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.eclipse.jetty.alpn:alpn-api:1.1.3.v20160715=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath org.hamcrest:hamcrest:3.0=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath @@ -269,8 +268,9 @@ org.jctools:jctools-core:4.0.6=baseForkedTestRuntimeClasspath,baseTestRuntimeCla org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc org.joda:joda-convert:1.7=lagomTestCompileClasspath,lagomTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath @@ -291,16 +291,16 @@ org.ow2.asm:asm-analysis:5.0.3=lagomTestCompileClasspath org.ow2.asm:asm-analysis:9.7.1=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs org.ow2.asm:asm-commons:5.0.3=lagomTestCompileClasspath +org.ow2.asm:asm-commons:9.10.1=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath org.ow2.asm:asm-tree:5.0.3=lagomTestCompileClasspath +org.ow2.asm:asm-tree:9.10.1=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath org.ow2.asm:asm-util:5.0.3=lagomTestCompileClasspath org.ow2.asm:asm-util:9.7.1=baseForkedTestRuntimeClasspath,baseTestRuntimeClasspath,iastTestRuntimeClasspath,lagomTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,version101ForkedTestRuntimeClasspath,version101IastTestRuntimeClasspath,version101TestRuntimeClasspath,version102IastTestRuntimeClasspath,version102Scala213TestRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath org.pcollections:pcollections:2.1.2=lagomTestCompileClasspath,lagomTestRuntimeClasspath org.reactivestreams:reactive-streams:1.0.0=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath org.reactivestreams:reactive-streams:1.0.2=lagomTestCompileClasspath,lagomTestRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath @@ -318,34 +318,34 @@ org.scala-lang.modules:scala-parser-combinators_2.12:1.1.2=version101ForkedTestC org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath,zinc org.scala-lang.modules:scala-xml_2.11:1.0.6=lagomTestCompileClasspath,lagomTestRuntimeClasspath org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.11.12=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath org.scala-lang:scala-library:2.12.18=version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath org.scala-lang:scala-library:2.13.11=latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath -org.scala-lang:scala-library:2.13.15=zinc +org.scala-lang:scala-library:2.13.16=zinc org.scala-lang:scala-reflect:2.11.11=lagomTestCompileClasspath,lagomTestRuntimeClasspath -org.scala-lang:scala-reflect:2.13.15=zinc -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-lang:scala-reflect:2.13.16=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.slf4j:jcl-over-slf4j:1.7.30=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,lagomTestCompileClasspath,lagomTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version101ForkedTestCompileClasspath,version101ForkedTestRuntimeClasspath,version101IastTestCompileClasspath,version101IastTestRuntimeClasspath,version101TestCompileClasspath,version101TestRuntimeClasspath,version102IastTestCompileClasspath,version102IastTestRuntimeClasspath,version102Scala213TestCompileClasspath,version102Scala213TestRuntimeClasspath diff --git a/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.0/src/baseTest/groovy/AkkaHttpServerInstrumentationTest.groovy b/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.0/src/baseTest/groovy/AkkaHttpServerInstrumentationTest.groovy index 65ed26909e7..a1aa9510a93 100644 --- a/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.0/src/baseTest/groovy/AkkaHttpServerInstrumentationTest.groovy +++ b/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.0/src/baseTest/groovy/AkkaHttpServerInstrumentationTest.groovy @@ -79,6 +79,11 @@ abstract class AkkaHttpServerInstrumentationTest extends HttpServerTest, Flow> filenamesCallback = cbp.getCallback(EVENTS.requestFilesFilenames()); - if (bodyCallback == null && filenamesCallback == null) { + BiFunction, Flow> contentCallback = + cbp.getCallback(EVENTS.requestFilesContent()); + if (bodyCallback == null && filenamesCallback == null && contentCallback == null) { return; } @@ -204,13 +210,19 @@ private static void handleMultipartStrictFormData( st.getStrictParts(); Map> conv = new HashMap<>(); List filenames = filenamesCallback != null ? new ArrayList<>() : null; + List filesContent = contentCallback != null ? new ArrayList<>() : null; for (akka.http.javadsl.model.Multipart.FormData.BodyPart.Strict part : strictParts) { Optional filenameOpt = part.getFilename(); if (filenames != null && filenameOpt.isPresent() && !filenameOpt.get().isEmpty()) { filenames.add(filenameOpt.get()); } - if (bodyCallback == null) { + boolean needsEntity = + bodyCallback != null + || (filesContent != null + && filenameOpt.isPresent() + && filesContent.size() < MAX_FILES_TO_INSPECT); + if (!needsEntity) { continue; } @@ -221,19 +233,30 @@ private static void handleMultipartStrictFormData( HttpEntity.Strict sentity = (HttpEntity.Strict) entity; - String name = part.getName(); - List curStrings = conv.get(name); - if (curStrings == null) { - curStrings = new ArrayList<>(); - conv.put(name, curStrings); + if (bodyCallback != null) { + String name = part.getName(); + List curStrings = conv.get(name); + if (curStrings == null) { + curStrings = new ArrayList<>(); + conv.put(name, curStrings); + } + + String s = + sentity + .getData() + .decodeString( + Unmarshaller$.MODULE$.bestUnmarshallingCharsetFor(sentity).nioCharset()); + curStrings.add(s); } - String s = - sentity - .getData() - .decodeString( - Unmarshaller$.MODULE$.bestUnmarshallingCharsetFor(sentity).nioCharset()); - curStrings.add(s); + if (filesContent != null + && filenameOpt.isPresent() + && filesContent.size() < MAX_FILES_TO_INSPECT) { + byte[] bytes = sentity.getData().take(MAX_CONTENT_BYTES).toArray(); + filesContent.add( + MultipartContentDecoder.decodeBytes( + bytes, bytes.length, entity.getContentType().toString())); + } } BlockingException pendingBlock = null; @@ -260,6 +283,18 @@ private static void handleMultipartStrictFormData( } } + if (pendingBlock == null && filesContent != null && !filesContent.isEmpty()) { + Flow flow = contentCallback.apply(reqCtx, filesContent); + Flow.Action action = flow.getAction(); + if (action instanceof Flow.Action.RequestBlockingAction) { + pendingBlock = + tryBlock( + reqCtx, + (Flow.Action.RequestBlockingAction) action, + "multipart file upload content"); + } + } + if (pendingBlock != null) { throw pendingBlock; } @@ -417,12 +452,20 @@ public static Unmarshaller transformStrictFormUnmarshall private static void handleStrictFormData(StrictForm sf) { CallbackProvider cbp = AgentTracer.get().getCallbackProvider(RequestContextSlot.APPSEC); + BiFunction> bodyCb = + cbp.getCallback(EVENTS.requestBodyProcessed()); BiFunction, Flow> filenamesCb = cbp.getCallback(EVENTS.requestFilesFilenames()); + BiFunction, Flow> contentCb = + cbp.getCallback(EVENTS.requestFilesContent()); + if (bodyCb == null && filenamesCb == null && contentCb == null) { + return; + } Iterator> iterator = sf.fields().iterator(); Map> conv = new HashMap<>(); List filenames = filenamesCb != null ? new ArrayList<>() : null; + List filesContent = contentCb != null ? new ArrayList<>() : null; while (iterator.hasNext()) { Tuple2 next = iterator.next(); String fieldName = next._1(); @@ -449,47 +492,71 @@ private static void handleStrictFormData(StrictForm sf) { instanceof akka.http.scaladsl.model.Multipart$FormData$BodyPart$Strict) { akka.http.scaladsl.model.Multipart$FormData$BodyPart$Strict bodyPart = (akka.http.scaladsl.model.Multipart$FormData$BodyPart$Strict) strictFieldValue; - if (filenames != null) { - Optional filenameOpt = bodyPart.getFilename(); - if (filenameOpt.isPresent() && !filenameOpt.get().isEmpty()) { - filenames.add(filenameOpt.get()); - } + Optional filenameOpt = bodyPart.getFilename(); + if (filenames != null && filenameOpt.isPresent() && !filenameOpt.get().isEmpty()) { + filenames.add(filenameOpt.get()); } HttpEntity.Strict sentity = bodyPart.entity(); - String s = - sentity - .getData() - .decodeString( - Unmarshaller$.MODULE$.bestUnmarshallingCharsetFor(sentity).nioCharset()); - strings.add(s); + if (filesContent != null + && filenameOpt.isPresent() + && filesContent.size() < MAX_FILES_TO_INSPECT) { + byte[] bytes = sentity.getData().take(MAX_CONTENT_BYTES).toArray(); + filesContent.add( + MultipartContentDecoder.decodeBytes( + bytes, bytes.length, sentity.contentType().toString())); + } + if (bodyCb != null) { + String s = + sentity + .getData() + .decodeString( + Unmarshaller$.MODULE$.bestUnmarshallingCharsetFor(sentity).nioCharset()); + strings.add(s); + } } } BlockingException pendingBlock = null; - try { - handleArbitraryPostData(conv, "HttpEntity -> StrictForm unmarshaller"); - } catch (BlockingException e) { - pendingBlock = e; - } - - if (filenamesCb != null && filenames != null && !filenames.isEmpty()) { - AgentSpan span = activeSpan(); - RequestContext reqCtx; - if (span != null - && (reqCtx = span.getRequestContext()) != null - && reqCtx.getData(RequestContextSlot.APPSEC) != null) { - Flow flow = filenamesCb.apply(reqCtx, filenames); - if (pendingBlock == null) { - Flow.Action action = flow.getAction(); - if (action instanceof Flow.Action.RequestBlockingAction) { - pendingBlock = - tryBlock( - reqCtx, (Flow.Action.RequestBlockingAction) action, "multipart file upload"); - } + if (bodyCb != null) { + try { + handleArbitraryPostData(conv, "HttpEntity -> StrictForm unmarshaller"); + } catch (BlockingException e) { + pendingBlock = e; + } + } + + AgentSpan span = activeSpan(); + RequestContext reqCtx = null; + if (span != null) { + RequestContext ctx = span.getRequestContext(); + if (ctx != null && ctx.getData(RequestContextSlot.APPSEC) != null) { + reqCtx = ctx; + } + } + + if (reqCtx != null && filenamesCb != null && filenames != null && !filenames.isEmpty()) { + Flow flow = filenamesCb.apply(reqCtx, filenames); + if (pendingBlock == null) { + Flow.Action action = flow.getAction(); + if (action instanceof Flow.Action.RequestBlockingAction) { + pendingBlock = + tryBlock(reqCtx, (Flow.Action.RequestBlockingAction) action, "multipart file upload"); } } } + if (pendingBlock == null && reqCtx != null && contentCb != null && !filesContent.isEmpty()) { + Flow flow = contentCb.apply(reqCtx, filesContent); + Flow.Action action = flow.getAction(); + if (action instanceof Flow.Action.RequestBlockingAction) { + pendingBlock = + tryBlock( + reqCtx, + (Flow.Action.RequestBlockingAction) action, + "multipart file upload content"); + } + } + if (pendingBlock != null) { throw pendingBlock; } diff --git a/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.2-iast/gradle.lockfile b/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.2-iast/gradle.lockfile index 02a11d42109..a415fd7448a 100644 --- a/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.2-iast/gradle.lockfile +++ b/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.2-iast/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:akka:akka-http:akka-http-10.2-iast:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -17,15 +18,15 @@ com.eed3si9n:shaded-scalajson_2.13:1.0.0-M4=zinc com.eed3si9n:sjson-new-core_2.13:0.10.1=zinc com.eed3si9n:sjson-new-scalajson_2.13:0.10.1=zinc com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -55,16 +59,15 @@ commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testRuntimeClassp commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.openhft:zero-allocation-hashing:0.16=zinc net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -90,7 +93,7 @@ org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath @@ -99,7 +102,8 @@ org.jctools:jctools-core:4.0.6=testRuntimeClasspath org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -117,42 +121,42 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=zinc org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.13.11=compileClasspath -org.scala-lang:scala-library:2.13.15=zinc -org.scala-lang:scala-reflect:2.13.15=zinc -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-lang:scala-library:2.13.16=zinc +org.scala-lang:scala-reflect:2.13.16=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.6/gradle.lockfile b/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.6/gradle.lockfile index fd429d35194..b942a3bca8a 100644 --- a/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.6/gradle.lockfile +++ b/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.6/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:akka:akka-http:akka-http-10.6:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -25,15 +26,15 @@ com.fasterxml.jackson.core:jackson-databind:2.18.4=latestDepTestCompileClasspath com.fasterxml.jackson:jackson-bom:2.15.2=testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.18.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -43,12 +44,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.hierynomus:asn-one:0.6.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -57,7 +61,7 @@ com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestR com.squareup.okio:okio:1.17.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.swoval:file-tree-views:2.1.12=zinc com.thoughtworks.qdox:qdox:1.12.1=codenarc -com.typesafe.akka:akka-actor_2.13:2.10.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.typesafe.akka:akka-actor_2.13:2.10.20=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.typesafe.akka:akka-actor_2.13:2.9.0=main_java11CompileClasspath,testCompileClasspath,testRuntimeClasspath com.typesafe.akka:akka-http-core_2.13:10.6.0=main_java11CompileClasspath,testCompileClasspath,testRuntimeClasspath com.typesafe.akka:akka-http-core_2.13:10.7.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -69,28 +73,27 @@ com.typesafe.akka:akka-http_2.13:10.6.0=main_java11CompileClasspath,testCompileC com.typesafe.akka:akka-http_2.13:10.7.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.typesafe.akka:akka-parsing_2.13:10.6.0=main_java11CompileClasspath,testCompileClasspath,testRuntimeClasspath com.typesafe.akka:akka-parsing_2.13:10.7.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.typesafe.akka:akka-pki_2.13:2.10.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.typesafe.akka:akka-protobuf-v3_2.13:2.10.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.typesafe.akka:akka-pki_2.13:2.10.20=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.typesafe.akka:akka-protobuf-v3_2.13:2.10.20=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.typesafe.akka:akka-protobuf-v3_2.13:2.9.0=testCompileClasspath,testRuntimeClasspath -com.typesafe.akka:akka-stream_2.13:2.10.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.typesafe.akka:akka-stream_2.13:2.10.20=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.typesafe.akka:akka-stream_2.13:2.9.0=testCompileClasspath,testRuntimeClasspath com.typesafe:config:1.4.3=main_java11CompileClasspath,testCompileClasspath,testRuntimeClasspath -com.typesafe:config:1.4.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.typesafe:config:1.4.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath commons-fileupload:commons-fileupload:1.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath io.spray:spray-json_2.13:1.3.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.openhft:zero-allocation-hashing:0.16=zinc net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -116,7 +119,7 @@ org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -125,7 +128,8 @@ org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspat org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -143,45 +147,45 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-java8-compat_2.13:1.0.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=zinc org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.13.12=main_java11CompileClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-lang:scala-library:2.13.15=zinc +org.scala-lang:scala-library:2.13.16=zinc org.scala-lang:scala-library:2.13.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.scala-lang:scala-reflect:2.13.15=zinc -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-lang:scala-reflect:2.13.16=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.6/src/main/java11/datadog/trace/instrumentation/akkahttp106/SingleRequestAdvice.java b/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.6/src/main/java11/datadog/trace/instrumentation/akkahttp106/SingleRequestAdvice.java index 4ea48bf5584..de14a16d057 100644 --- a/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.6/src/main/java11/datadog/trace/instrumentation/akkahttp106/SingleRequestAdvice.java +++ b/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.6/src/main/java11/datadog/trace/instrumentation/akkahttp106/SingleRequestAdvice.java @@ -44,11 +44,12 @@ public static void methodExit( if (throwable == null) { responseFuture.onComplete( new AkkaHttpClientHelpers.OnCompleteHandler(span), thiz.system().dispatcher()); + scope.close(); } else { DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); + scope.close(); span.finish(); } - scope.close(); } } diff --git a/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.6/src/main/java11/datadog/trace/instrumentation/akkahttp106/SingleRequestContextPropagationAdvice.java b/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.6/src/main/java11/datadog/trace/instrumentation/akkahttp106/SingleRequestContextPropagationAdvice.java index 49f9ce99e7b..5cc4af02d7a 100644 --- a/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.6/src/main/java11/datadog/trace/instrumentation/akkahttp106/SingleRequestContextPropagationAdvice.java +++ b/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.6/src/main/java11/datadog/trace/instrumentation/akkahttp106/SingleRequestContextPropagationAdvice.java @@ -1,7 +1,7 @@ package datadog.trace.instrumentation.akkahttp106; import static datadog.trace.agent.tooling.InstrumenterModule.TargetSystem.CONTEXT_TRACKING; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; import static datadog.trace.instrumentation.akkahttp106.AkkaHttpClientDecorator.DECORATE; import akka.http.scaladsl.model.HttpRequest; @@ -19,7 +19,7 @@ public static void methodEnter( final AkkaHttpClientHelpers.AkkaHttpHeaders headers = new AkkaHttpClientHelpers.AkkaHttpHeaders(request); - DECORATE.injectContext(getCurrentContext(), request, headers); + DECORATE.injectContext(currentContext(), request, headers); request = headers.getRequest(); } } diff --git a/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.6/src/test/groovy/AkkaHttp102ServerInstrumentationTests.groovy b/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.6/src/test/groovy/AkkaHttp102ServerInstrumentationTests.groovy index 6e517914b17..711bf874fa5 100644 --- a/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.6/src/test/groovy/AkkaHttp102ServerInstrumentationTests.groovy +++ b/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.6/src/test/groovy/AkkaHttp102ServerInstrumentationTests.groovy @@ -41,6 +41,11 @@ class AkkaHttp102ServerInstrumentationBindSyncTest extends AkkaHttpServerInstrum false } + @Override + boolean testBodyFilesContent() { + false + } + @Override boolean testBodyJson() { false diff --git a/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.6/src/test/groovy/AkkaHttpServerInstrumentationTest.groovy b/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.6/src/test/groovy/AkkaHttpServerInstrumentationTest.groovy index 1fe0b3a3be0..9a4815ed382 100644 --- a/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.6/src/test/groovy/AkkaHttpServerInstrumentationTest.groovy +++ b/dd-java-agent/instrumentation/akka/akka-http/akka-http-10.6/src/test/groovy/AkkaHttpServerInstrumentationTest.groovy @@ -80,6 +80,11 @@ abstract class AkkaHttpServerInstrumentationTest extends HttpServerTest implements FutureCallback { - private final AgentScope.Continuation parentContinuation; + private final ContextContinuation parentContinuation; private final AgentSpan clientSpan; private final HttpContext context; private final FutureCallback delegate; public TraceContinuedFutureCallback( - final AgentScope.Continuation parentContinuation, + final ContextContinuation parentContinuation, final AgentSpan clientSpan, final HttpContext context, final FutureCallback delegate) { @@ -32,10 +33,10 @@ public void completed(final T result) { DECORATE.beforeFinish(clientSpan); clientSpan.finish(); // Finish span before calling delegate - if (parentContinuation == noopContinuation()) { + if (parentContinuation.context() == Context.root()) { completeDelegate(result); } else { - try (final AgentScope scope = parentContinuation.activate()) { + try (final ContextScope scope = parentContinuation.resume()) { completeDelegate(result); } } @@ -48,10 +49,10 @@ public void failed(final Exception ex) { DECORATE.beforeFinish(clientSpan); clientSpan.finish(); // Finish span before calling delegate - if (parentContinuation == noopContinuation()) { + if (parentContinuation.context() == Context.root()) { failDelegate(ex); } else { - try (final AgentScope scope = parentContinuation.activate()) { + try (final ContextScope scope = parentContinuation.resume()) { failDelegate(ex); } } @@ -63,10 +64,10 @@ public void cancelled() { DECORATE.beforeFinish(clientSpan); clientSpan.finish(); // Finish span before calling delegate - if (parentContinuation == noopContinuation()) { + if (parentContinuation.context() == Context.root()) { cancelDelegate(); } else { - try (final AgentScope scope = parentContinuation.activate()) { + try (final ContextScope scope = parentContinuation.resume()) { cancelDelegate(); } } diff --git a/dd-java-agent/instrumentation/apache-httpclient/apache-httpasyncclient-4.0/src/test/java/datadog/trace/instrumentation/apachehttpasyncclient/ApacheHttpClientRedirectInstrumentationTest.java b/dd-java-agent/instrumentation/apache-httpclient/apache-httpasyncclient-4.0/src/test/java/datadog/trace/instrumentation/apachehttpasyncclient/ApacheHttpClientRedirectInstrumentationTest.java new file mode 100644 index 00000000000..83892ef07a5 --- /dev/null +++ b/dd-java-agent/instrumentation/apache-httpclient/apache-httpasyncclient-4.0/src/test/java/datadog/trace/instrumentation/apachehttpasyncclient/ApacheHttpClientRedirectInstrumentationTest.java @@ -0,0 +1,101 @@ +package datadog.trace.instrumentation.apachehttpasyncclient; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; + +import org.apache.http.HttpHost; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.client.methods.HttpRequestWrapper; +import org.apache.http.protocol.BasicHttpContext; +import org.apache.http.protocol.HttpContext; +import org.junit.jupiter.api.Test; + +class ApacheHttpClientRedirectInstrumentationTest { + + @Test + void doesNotCopyApplicationHeadersToCrossOriginRedirects() throws Exception { + HttpGet original = originalRequest("http://example.com/request"); + original.addHeader("Authorization", "Bearer secret"); + original.addHeader("Cookie", "session=secret"); + original.addHeader("X-Api-Key", "secret"); + original.addHeader("x-datadog-trace-id", "123"); + + HttpGet redirect = new HttpGet("http://attacker.example/redirect"); + + ApacheHttpClientRedirectInstrumentation.ClientRedirectAdvice.onAfterExecute( + contextWith(original), redirect); + + assertFalse(redirect.containsHeader("Authorization")); + assertFalse(redirect.containsHeader("Cookie")); + assertFalse(redirect.containsHeader("X-Api-Key")); + assertEquals("123", redirect.getFirstHeader("x-datadog-trace-id").getValue()); + } + + @Test + void preventsApacheHeaderCopyWhenCrossOriginRedirectHasNoPropagationHeaders() throws Exception { + HttpGet original = originalRequest("http://example.com/request"); + original.addHeader("Authorization", "Bearer secret"); + original.addHeader("Cookie", "session=secret"); + + HttpGet redirect = new HttpGet("http://attacker.example/redirect"); + + ApacheHttpClientRedirectInstrumentation.ClientRedirectAdvice.onAfterExecute( + contextWith(original), redirect); + + assertFalse(redirect.containsHeader("Authorization")); + assertFalse(redirect.containsHeader("Cookie")); + assertEquals("true", redirect.getFirstHeader("x-datadog-redirect").getValue()); + } + + @Test + void copiesApplicationHeadersToSameOriginRedirects() throws Exception { + HttpGet original = originalRequest("https://example.com/request"); + original.addHeader("Authorization", "Bearer secret"); + original.addHeader("x-datadog-trace-id", "123"); + + HttpGet redirect = new HttpGet("https://example.com/redirect"); + + ApacheHttpClientRedirectInstrumentation.ClientRedirectAdvice.onAfterExecute( + contextWith(original), redirect); + + assertEquals("Bearer secret", redirect.getFirstHeader("Authorization").getValue()); + assertEquals("123", redirect.getFirstHeader("x-datadog-trace-id").getValue()); + } + + @Test + void treatsDefaultPortsAsSameOrigin() throws Exception { + HttpGet original = originalRequest("https://example.com:443/request"); + original.addHeader("Authorization", "Bearer secret"); + + HttpGet redirect = new HttpGet("https://example.com/redirect"); + + ApacheHttpClientRedirectInstrumentation.ClientRedirectAdvice.onAfterExecute( + contextWith(original), redirect); + + assertEquals("Bearer secret", redirect.getFirstHeader("Authorization").getValue()); + } + + @Test + void resolvesHostRequestOriginFromContext() throws Exception { + HttpGet original = originalRequest("/request"); + original.addHeader("Authorization", "Bearer secret"); + + HttpGet redirect = new HttpGet("http://example.com/redirect"); + HttpContext context = contextWith(original); + context.setAttribute("http.target_host", new HttpHost("example.com", 80, "http")); + + ApacheHttpClientRedirectInstrumentation.ClientRedirectAdvice.onAfterExecute(context, redirect); + + assertEquals("Bearer secret", redirect.getFirstHeader("Authorization").getValue()); + } + + private static HttpGet originalRequest(final String uri) { + return new HttpGet(uri); + } + + private static HttpContext contextWith(final HttpGet request) throws Exception { + HttpContext context = new BasicHttpContext(); + context.setAttribute("http.request", HttpRequestWrapper.wrap(request)); + return context; + } +} diff --git a/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-4.0/gradle.lockfile b/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-4.0/gradle.lockfile index fd79c86865b..9f5efab6868 100644 --- a/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-4.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-4.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:apache-httpclient:apache-httpclient-4.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=iastIntegrationTestCompileClasspath,iastInteg com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath com.datadoghq.okio:okio:1.17.6=iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath com.datadoghq:sketches-java:0.8.3=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath +com.github.jnr:jffi:1.3.15=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,iastIntegrationTestAnnotationProcessor,iastIntegrationTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath,v41IastIntegrationTestAnnotationProcessor,v41IastIntegrationTestCompileClasspath,v42IastIntegrationTestAnnotationProcessor,v42IastIntegrationTestCompileClasspath,v43IastIntegrationTestAnnotationProcessor,v43IastIntegrationTestCompileClasspath,v44IastIntegrationTestAnnotationProcessor,v44IastIntegrationTestCompileClasspath,v45IastIntegrationTestAnnotationProcessor,v45IastIntegrationTestCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,iastI com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,iastIntegrationTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,v41IastIntegrationTestAnnotationProcessor,v42IastIntegrationTestAnnotationProcessor,v43IastIntegrationTestAnnotationProcessor,v44IastIntegrationTestAnnotationProcessor,v45IastIntegrationTestAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,iastIntegrationTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,v41IastIntegrationTestAnnotationProcessor,v42IastIntegrationTestAnnotationProcessor,v43IastIntegrationTestAnnotationProcessor,v44IastIntegrationTestAnnotationProcessor,v45IastIntegrationTestAnnotationProcessor -com.google.guava:guava:20.0=iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath +com.google.guava:failureaccess:1.0.3=iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,iastIntegrationTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,v41IastIntegrationTestAnnotationProcessor,v42IastIntegrationTestAnnotationProcessor,v43IastIntegrationTestAnnotationProcessor,v44IastIntegrationTestAnnotationProcessor,v45IastIntegrationTestAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,iastIntegrationTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,v41IastIntegrationTestAnnotationProcessor,v42IastIntegrationTestAnnotationProcessor,v43IastIntegrationTestAnnotationProcessor,v44IastIntegrationTestAnnotationProcessor,v45IastIntegrationTestAnnotationProcessor +com.google.guava:guava:33.6.0-jre=iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,iastIntegrationTestAnnotationProcessor,iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestAnnotationProcessor,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestAnnotationProcessor,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestAnnotationProcessor,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestAnnotationProcessor,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestAnnotationProcessor,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,iastIntegrationTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,v41IastIntegrationTestAnnotationProcessor,v42IastIntegrationTestAnnotationProcessor,v43IastIntegrationTestAnnotationProcessor,v44IastIntegrationTestAnnotationProcessor,v45IastIntegrationTestAnnotationProcessor -com.google.re2j:re2j:1.7=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath +com.google.re2j:re2j:1.8=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath com.squareup.moshi:moshi:1.11.0=iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath @@ -55,12 +59,12 @@ commons-logging:commons-logging:1.1.3=v43IastIntegrationTestCompileClasspath,v43 commons-logging:commons-logging:1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath net.java.dev.jna:jna:5.8.0=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -110,6 +114,7 @@ org.hamcrest:hamcrest-core:1.3=iastIntegrationTestRuntimeClasspath,latestDepTest org.hamcrest:hamcrest:3.0=iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath org.jctools:jctools-core:4.0.6=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath @@ -127,14 +132,14 @@ org.objenesis:objenesis:3.3=iastIntegrationTestCompileClasspath,iastIntegrationT org.opentest4j:opentest4j:1.3.0=iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath org.ow2.asm:asm-util:9.7.1=iastIntegrationTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=iastIntegrationTestCompileClasspath,iastIntegrationTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v41IastIntegrationTestCompileClasspath,v41IastIntegrationTestRuntimeClasspath,v42IastIntegrationTestCompileClasspath,v42IastIntegrationTestRuntimeClasspath,v43IastIntegrationTestCompileClasspath,v43IastIntegrationTestRuntimeClasspath,v44IastIntegrationTestCompileClasspath,v44IastIntegrationTestRuntimeClasspath,v45IastIntegrationTestCompileClasspath,v45IastIntegrationTestRuntimeClasspath diff --git a/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-5.0/gradle.lockfile b/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-5.0/gradle.lockfile index d92e18785e8..e8b30aade27 100644 --- a/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-5.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-5.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:apache-httpclient:apache-httpclient-5.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -48,12 +52,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -63,11 +67,11 @@ org.apache.bcel:bcel:6.11.0=spotbugs org.apache.commons:commons-lang3:3.19.0=spotbugs org.apache.commons:commons-text:1.14.0=spotbugs org.apache.httpcomponents.client5:httpclient5:5.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.httpcomponents.client5:httpclient5:5.6.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.httpcomponents.client5:httpclient5:5.6.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.httpcomponents.core5:httpcore5-h2:5.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.httpcomponents.core5:httpcore5-h2:5.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.httpcomponents.core5:httpcore5-h2:5.4.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.httpcomponents.core5:httpcore5:5.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.httpcomponents.core5:httpcore5:5.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.httpcomponents.core5:httpcore5:5.4.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=latestDepTestCompileClasspath,testCompileClasspath @@ -88,6 +92,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -105,14 +110,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-5.0/src/main/java/datadog/trace/instrumentation/apachehttpclient5/ApacheHttpAsyncClientInstrumentation.java b/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-5.0/src/main/java/datadog/trace/instrumentation/apachehttpclient5/ApacheHttpAsyncClientInstrumentation.java index 16aea977e5e..3854a77bca0 100644 --- a/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-5.0/src/main/java/datadog/trace/instrumentation/apachehttpclient5/ApacheHttpAsyncClientInstrumentation.java +++ b/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-5.0/src/main/java/datadog/trace/instrumentation/apachehttpclient5/ApacheHttpAsyncClientInstrumentation.java @@ -14,6 +14,7 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArguments; import com.google.auto.service.AutoService; +import datadog.context.ContextContinuation; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.agent.tooling.annotation.AppliesOn; @@ -113,7 +114,7 @@ public static AgentScope methodEnter( @Advice.Argument(value = 3, readOnly = false) HttpContext context, @Advice.Argument(value = 4, readOnly = false) FutureCallback futureCallback) { - final AgentScope.Continuation parentContinuation = captureActiveSpan(); + final ContextContinuation parentContinuation = captureActiveSpan(); final AgentSpan clientSpan = startSpan(APACHE_HTTP_CLIENT.toString(), HTTP_REQUEST); final AgentScope clientScope = activateSpan(clientSpan); DECORATE.afterStart(clientSpan); @@ -142,15 +143,17 @@ public static void methodExit( if (scope == null) { return; } + final AgentSpan span = scope.span(); try { if (throwable != null) { - final AgentSpan span = scope.span(); DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); - span.finish(); } } finally { scope.close(); + if (throwable != null) { + span.finish(); + } } } } diff --git a/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-5.0/src/main/java/datadog/trace/instrumentation/apachehttpclient5/TraceContinuedFutureCallback.java b/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-5.0/src/main/java/datadog/trace/instrumentation/apachehttpclient5/TraceContinuedFutureCallback.java index d283b9c7ca5..771ee21a4a1 100644 --- a/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-5.0/src/main/java/datadog/trace/instrumentation/apachehttpclient5/TraceContinuedFutureCallback.java +++ b/dd-java-agent/instrumentation/apache-httpclient/apache-httpclient-5.0/src/main/java/datadog/trace/instrumentation/apachehttpclient5/TraceContinuedFutureCallback.java @@ -1,9 +1,10 @@ package datadog.trace.instrumentation.apachehttpclient5; -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopContinuation; import static datadog.trace.instrumentation.apachehttpclient5.ApacheHttpClientDecorator.DECORATE; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.Context; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import javax.annotation.Nullable; import org.apache.hc.core5.concurrent.FutureCallback; @@ -12,13 +13,13 @@ import org.apache.hc.core5.http.protocol.HttpCoreContext; public class TraceContinuedFutureCallback implements FutureCallback { - private final AgentScope.Continuation parentContinuation; + private final ContextContinuation parentContinuation; private final AgentSpan clientSpan; private final HttpContext context; private final FutureCallback delegate; public TraceContinuedFutureCallback( - final AgentScope.Continuation parentContinuation, + final ContextContinuation parentContinuation, final AgentSpan clientSpan, final HttpContext context, final FutureCallback delegate) { @@ -35,10 +36,10 @@ public void completed(final T result) { DECORATE.beforeFinish(clientSpan); clientSpan.finish(); // Finish span before calling delegate - if (parentContinuation == noopContinuation()) { + if (parentContinuation.context() == Context.root()) { completeDelegate(result); } else { - try (final AgentScope scope = parentContinuation.activate()) { + try (final ContextScope scope = parentContinuation.resume()) { completeDelegate(result); } } @@ -51,10 +52,10 @@ public void failed(final Exception ex) { DECORATE.beforeFinish(clientSpan); clientSpan.finish(); // Finish span before calling delegate - if (parentContinuation == noopContinuation()) { + if (parentContinuation.context() == Context.root()) { failDelegate(ex); } else { - try (final AgentScope scope = parentContinuation.activate()) { + try (final ContextScope scope = parentContinuation.resume()) { failDelegate(ex); } } @@ -66,10 +67,10 @@ public void cancelled() { DECORATE.beforeFinish(clientSpan); clientSpan.finish(); // Finish span before calling delegate - if (parentContinuation == noopContinuation()) { + if (parentContinuation.context() == Context.root()) { cancelDelegate(); } else { - try (final AgentScope scope = parentContinuation.activate()) { + try (final ContextScope scope = parentContinuation.resume()) { cancelDelegate(); } } diff --git a/dd-java-agent/instrumentation/apache-httpcore/apache-httpcore-4.0/gradle.lockfile b/dd-java-agent/instrumentation/apache-httpcore/apache-httpcore-4.0/gradle.lockfile index 6f62c82a5a0..9cde4ecc685 100644 --- a/dd-java-agent/instrumentation/apache-httpcore/apache-httpcore-4.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/apache-httpcore/apache-httpcore-4.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:apache-httpcore:apache-httpcore-4.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -83,6 +87,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -100,14 +105,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/apache-httpcore/apache-httpcore-5.0/gradle.lockfile b/dd-java-agent/instrumentation/apache-httpcore/apache-httpcore-5.0/gradle.lockfile index c06739559a6..67b178adbd1 100644 --- a/dd-java-agent/instrumentation/apache-httpcore/apache-httpcore-5.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/apache-httpcore/apache-httpcore-5.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:apache-httpcore:apache-httpcore-5.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -62,7 +66,7 @@ org.apache.bcel:bcel:6.11.0=spotbugs org.apache.commons:commons-lang3:3.19.0=spotbugs org.apache.commons:commons-text:1.14.0=spotbugs org.apache.httpcomponents.core5:httpcore5:5.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.httpcomponents.core5:httpcore5:5.5-alpha1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.httpcomponents.core5:httpcore5:5.5-beta2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=latestDepTestCompileClasspath,testCompileClasspath @@ -83,6 +87,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -100,14 +105,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/gradle.lockfile b/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/gradle.lockfile index d821d7fb9a6..61485c3f81f 100644 --- a/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/gradle.lockfile +++ b/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/gradle.lockfile @@ -1,72 +1,68 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:armeria:armeria-grpc-0.84:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -com.aayushatharva.brotli4j:brotli4j:1.22.0=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath -com.aayushatharva.brotli4j:service:1.22.0=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +com.aayushatharva.brotli4j:brotli4j:1.23.0=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +com.aayushatharva.brotli4j:service:1.23.0=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-annotations:2.11.2=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.21=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-annotations:2.22=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-annotations:2.9.8=compileClasspath,compileProtoPath com.fasterxml.jackson.core:jackson-core:2.11.2=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.21.2=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-core:2.22.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-core:2.9.8=compileClasspath,compileProtoPath com.fasterxml.jackson.core:jackson-databind:2.11.2=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.21.2=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-databind:2.22.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-databind:2.9.8=compileClasspath,compileProtoPath -com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.21.2=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.21.2=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.21.2=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.22.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.22.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +com.fasterxml.jackson:jackson-bom:2.22.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,compileProtoPath,latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,compileProtoPath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.android:annotations:4.1.1.4=compileClasspath,compileProtoPath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath com.google.api.grpc:proto-google-common-protos:1.12.0=compileClasspath,compileProtoPath com.google.api.grpc:proto-google-common-protos:1.17.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -com.google.api.grpc:proto-google-common-protos:2.63.2=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +com.google.api.grpc:proto-google-common-protos:2.64.1=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,compileProtoPath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,testAnnotationProcessor,testCompileClasspath,testCompileProtoPath com.google.auto.service:auto-service:1.1.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.auto:auto-common:1.2.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,compileProtoPath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -com.google.code.gson:gson:2.12.1=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath -com.google.code.gson:gson:2.13.2=spotbugs +com.google.code.gson:gson:2.13.2=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,spotbugs com.google.code.gson:gson:2.7=compileClasspath,compileProtoPath com.google.code.gson:gson:2.8.6=testCompileProtoPath,testRuntimeClasspath com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.3.2=compileClasspath,compileProtoPath com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.errorprone:error_prone_annotations:2.45.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath -com.google.errorprone:error_prone_annotations:2.5.1=testCompileClasspath -com.google.errorprone:error_prone_annotations:2.9.0=testCompileProtoPath,testRuntimeClasspath -com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.48.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.guava:guava:26.0-android=compileClasspath,compileProtoPath -com.google.guava:guava:30.1.1-android=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:33.5.0-android=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath -com.google.guava:guava:33.5.0-jre=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -com.google.j2objc:j2objc-annotations:1.3=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.protobuf:protobuf-java-util:3.12.0=testCompileProtoPath,testRuntimeClasspath com.google.protobuf:protobuf-java-util:3.25.8=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath com.google.protobuf:protobuf-java-util:3.7.1=compileClasspath,compileProtoPath @@ -75,18 +71,18 @@ com.google.protobuf:protobuf-java:3.25.8=latestDepForkedTestCompileClasspath,lat com.google.protobuf:protobuf-java:3.7.1=compileClasspath,compileProtoPath com.google.protobuf:protoc:3.17.3=protobufToolsLocator_protoc com.google.re2j:re2j:1.2=compileClasspath,compileProtoPath -com.google.re2j:re2j:1.7=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath com.linecorp.armeria:armeria-grpc-protocol:0.84.0=compileClasspath,compileProtoPath com.linecorp.armeria:armeria-grpc-protocol:1.0.0=testCompileProtoPath,testRuntimeClasspath -com.linecorp.armeria:armeria-grpc-protocol:1.38.0=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +com.linecorp.armeria:armeria-grpc-protocol:1.40.0=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath com.linecorp.armeria:armeria-grpc:0.84.0=compileClasspath,compileProtoPath com.linecorp.armeria:armeria-grpc:1.0.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -com.linecorp.armeria:armeria-grpc:1.38.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +com.linecorp.armeria:armeria-grpc:1.40.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath com.linecorp.armeria:armeria-junit4:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -com.linecorp.armeria:armeria-protobuf:1.38.0=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +com.linecorp.armeria:armeria-protobuf:1.40.0=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath com.linecorp.armeria:armeria:0.84.0=compileClasspath,compileProtoPath com.linecorp.armeria:armeria:1.0.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -com.linecorp.armeria:armeria:1.38.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +com.linecorp.armeria:armeria:1.40.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath @@ -97,100 +93,100 @@ commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForked commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,compileProtoPath,latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath io.grpc:grpc-api:1.42.2=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.grpc:grpc-api:1.80.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.grpc:grpc-api:1.81.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.grpc:grpc-context:1.20.0=compileClasspath,compileProtoPath io.grpc:grpc-context:1.42.2=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.grpc:grpc-context:1.80.0=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.grpc:grpc-context:1.81.0=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.grpc:grpc-core:1.20.0=compileClasspath,compileProtoPath io.grpc:grpc-core:1.31.1=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.grpc:grpc-core:1.80.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.grpc:grpc-core:1.81.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.grpc:grpc-protobuf-lite:1.20.0=compileClasspath,compileProtoPath io.grpc:grpc-protobuf-lite:1.31.1=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.grpc:grpc-protobuf-lite:1.80.0=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.grpc:grpc-protobuf-lite:1.81.0=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.grpc:grpc-protobuf:1.20.0=compileClasspath,compileProtoPath io.grpc:grpc-protobuf:1.31.1=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.grpc:grpc-protobuf:1.80.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.grpc:grpc-protobuf:1.81.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.grpc:grpc-services:1.20.0=compileClasspath,compileProtoPath io.grpc:grpc-services:1.31.1=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.grpc:grpc-services:1.80.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.grpc:grpc-services:1.81.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.grpc:grpc-stub:1.20.0=compileClasspath,compileProtoPath io.grpc:grpc-stub:1.42.2=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.grpc:grpc-stub:1.80.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath -io.grpc:grpc-util:1.80.0=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.grpc:grpc-stub:1.81.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.grpc:grpc-util:1.81.0=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.grpc:protoc-gen-grpc-java:1.42.2=protobufToolsLocator_grpc io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath io.micrometer:context-propagation:1.2.1=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath -io.micrometer:micrometer-commons:1.16.4=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.micrometer:micrometer-commons:1.17.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.micrometer:micrometer-core:1.1.4=compileClasspath,compileProtoPath -io.micrometer:micrometer-core:1.16.4=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.micrometer:micrometer-core:1.17.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.micrometer:micrometer-core:1.5.4=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.micrometer:micrometer-observation:1.16.4=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.micrometer:micrometer-observation:1.17.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.netty:netty-buffer:4.1.34.Final=compileClasspath,compileProtoPath io.netty:netty-buffer:4.1.51.Final=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.netty:netty-buffer:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath -io.netty:netty-codec-base:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath -io.netty:netty-codec-compression:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-buffer:4.2.15.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-codec-base:4.2.15.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-codec-compression:4.2.15.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.netty:netty-codec-dns:4.1.34.Final=compileClasspath,compileProtoPath io.netty:netty-codec-dns:4.1.51.Final=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.netty:netty-codec-dns:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-codec-dns:4.2.15.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.netty:netty-codec-haproxy:4.1.34.Final=compileClasspath,compileProtoPath io.netty:netty-codec-haproxy:4.1.51.Final=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.netty:netty-codec-haproxy:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-codec-haproxy:4.2.15.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.netty:netty-codec-http2:4.1.34.Final=compileClasspath,compileProtoPath io.netty:netty-codec-http2:4.1.51.Final=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.netty:netty-codec-http2:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http2:4.2.15.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.netty:netty-codec-http:4.1.34.Final=compileClasspath,compileProtoPath io.netty:netty-codec-http:4.1.51.Final=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.netty:netty-codec-http:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http:4.2.15.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.netty:netty-codec-socks:4.1.51.Final=testCompileProtoPath,testRuntimeClasspath -io.netty:netty-codec-socks:4.2.12.Final=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-codec-socks:4.2.15.Final=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.netty:netty-codec:4.1.34.Final=compileClasspath,compileProtoPath io.netty:netty-codec:4.1.51.Final=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath io.netty:netty-common:4.1.34.Final=compileClasspath,compileProtoPath io.netty:netty-common:4.1.51.Final=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.netty:netty-common:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-common:4.2.15.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.netty:netty-handler-proxy:4.1.51.Final=testCompileProtoPath,testRuntimeClasspath -io.netty:netty-handler-proxy:4.2.12.Final=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-handler-proxy:4.2.15.Final=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.netty:netty-handler:4.1.34.Final=compileClasspath,compileProtoPath io.netty:netty-handler:4.1.51.Final=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.netty:netty-handler:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath -io.netty:netty-resolver-dns-classes-macos:4.2.12.Final=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath -io.netty:netty-resolver-dns-native-macos:4.2.12.Final=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-handler:4.2.15.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-resolver-dns-classes-macos:4.2.15.Final=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-resolver-dns-native-macos:4.2.15.Final=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.netty:netty-resolver-dns:4.1.34.Final=compileClasspath,compileProtoPath io.netty:netty-resolver-dns:4.1.51.Final=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.netty:netty-resolver-dns:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-resolver-dns:4.2.15.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.netty:netty-resolver:4.1.34.Final=compileClasspath,compileProtoPath io.netty:netty-resolver:4.1.51.Final=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.netty:netty-resolver:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-resolver:4.2.15.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.netty:netty-tcnative-boringssl-static:2.0.23.Final=compileClasspath,compileProtoPath io.netty:netty-tcnative-boringssl-static:2.0.31.Final=testCompileProtoPath,testRuntimeClasspath -io.netty:netty-tcnative-boringssl-static:2.0.75.Final=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath -io.netty:netty-tcnative-classes:2.0.75.Final=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath -io.netty:netty-transport-classes-epoll:4.2.12.Final=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath -io.netty:netty-transport-classes-kqueue:4.2.12.Final=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-tcnative-boringssl-static:2.0.77.Final=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-tcnative-classes:2.0.77.Final=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-transport-classes-epoll:4.2.15.Final=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-transport-classes-kqueue:4.2.15.Final=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.netty:netty-transport-native-epoll:4.1.34.Final=compileClasspath,compileProtoPath io.netty:netty-transport-native-epoll:4.1.51.Final=testCompileProtoPath,testRuntimeClasspath -io.netty:netty-transport-native-epoll:4.2.12.Final=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath -io.netty:netty-transport-native-kqueue:4.2.12.Final=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-epoll:4.2.15.Final=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-kqueue:4.2.15.Final=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.netty:netty-transport-native-unix-common:4.1.34.Final=compileClasspath,compileProtoPath io.netty:netty-transport-native-unix-common:4.1.51.Final=testCompileProtoPath,testRuntimeClasspath -io.netty:netty-transport-native-unix-common:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.2.15.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.34.Final=compileClasspath,compileProtoPath io.netty:netty-transport:4.1.51.Final=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.netty:netty-transport:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-transport:4.2.15.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.opencensus:opencensus-api:0.19.2=compileClasspath,compileProtoPath io.opencensus:opencensus-contrib-grpc-metrics:0.19.2=compileClasspath,compileProtoPath io.perfmark:perfmark-api:0.19.0=testCompileProtoPath,testRuntimeClasspath io.perfmark:perfmark-api:0.27.0=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath javax.annotation:javax.annotation-api:1.3.2=compileProtoPath,latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath,testCompileClasspath junit:junit:4.13.2=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -203,7 +199,6 @@ org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath,testCompileClasspath org.checkerframework:checker-compat-qual:2.5.2=compileClasspath,compileProtoPath -org.checkerframework:checker-compat-qual:2.5.5=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.checkerframework:checker-qual:3.33.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc @@ -215,7 +210,7 @@ org.codehaus.groovy:groovy-xml:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.codehaus.mojo:animal-sniffer-annotations:1.18=testCompileProtoPath,testRuntimeClasspath -org.codehaus.mojo:animal-sniffer-annotations:1.26=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +org.codehaus.mojo:animal-sniffer-annotations:1.27=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.curioswitch.curiostack:protobuf-jackson:0.3.1=compileClasspath,compileProtoPath org.curioswitch.curiostack:protobuf-jackson:1.1.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath @@ -229,7 +224,7 @@ org.hdrhistogram:HdrHistogram:2.1.9=compileClasspath,compileProtoPath org.hdrhistogram:HdrHistogram:2.2.2=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath -org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath @@ -242,20 +237,20 @@ org.junit.platform:junit-platform-suite-api:1.14.1=latestDepForkedTestCompilePro org.junit.platform:junit-platform-suite-commons:1.14.1=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath org.junit:junit-bom:5.14.0=compileProtoPath,spotbugs org.junit:junit-bom:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -org.latencyutils:LatencyUtils:2.0.3=compileClasspath,compileProtoPath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath +org.latencyutils:LatencyUtils:2.0.3=compileClasspath,compileProtoPath,testCompileProtoPath,testRuntimeClasspath org.mockito:mockito-core:4.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.2=compileClasspath,compileProtoPath org.reactivestreams:reactive-streams:1.0.3=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.4=latestDepForkedTestCompileClasspath,latestDepForkedTestCompileProtoPath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath diff --git a/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/main/java/datadog/trace/instrumentation/armeria/grpc/client/ClientCallImplInstrumentation.java b/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/main/java/datadog/trace/instrumentation/armeria/grpc/client/ClientCallImplInstrumentation.java index 7833daeb1c0..58c84f37af1 100644 --- a/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/main/java/datadog/trace/instrumentation/armeria/grpc/client/ClientCallImplInstrumentation.java +++ b/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/main/java/datadog/trace/instrumentation/armeria/grpc/client/ClientCallImplInstrumentation.java @@ -5,6 +5,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; import static datadog.trace.instrumentation.armeria.grpc.client.GrpcClientDecorator.COMPONENT_NAME; import static datadog.trace.instrumentation.armeria.grpc.client.GrpcClientDecorator.DECORATE; import static datadog.trace.instrumentation.armeria.grpc.client.GrpcClientDecorator.GRPC_MESSAGE; @@ -21,12 +22,12 @@ import datadog.trace.bootstrap.InstrumentationContext; import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; -import datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge; import io.grpc.ClientCall; import io.grpc.Metadata; import io.grpc.MethodDescriptor; import io.grpc.Status; import io.grpc.StatusException; +import io.grpc.StatusRuntimeException; import java.util.Arrays; import net.bytebuddy.asm.Advice; @@ -60,8 +61,16 @@ public void methodAdvice(MethodTransformer transformer) { transformer.applyAdvice( named("sendMessage").and(isMethod()), getClass().getName() + "$SendMessage"); transformer.applyAdvice( + // matches the method signature for versions until 1.40 excluded named("close").and(isMethod().and(takesArguments(2))), getClass().getName() + "$CloseObserver"); + transformer.applyAdvice( + // matches the signature after v1.40 + named("close") + .and(isMethod()) + .and(takesArguments(3)) + .and(takesArgument(2, named("java.lang.Throwable"))), + getClass().getName() + "$CloseObserverWithCause"); if (InstrumenterConfig.get() .isIntegrationEnabled(Arrays.asList("armeria-grpc-message", "grpc-message"), false)) { transformer.applyAdvice( @@ -113,12 +122,14 @@ public static void after( @Advice.Thrown Throwable error, @Advice.Local("$$ddSpan") AgentSpan span) throws Throwable { + if (null != error && null != span) { + DECORATE.onError(span, error); + DECORATE.beforeFinish(span); + } if (null != scope) { scope.close(); } if (null != error && null != span) { - DECORATE.onError(span, error); - DECORATE.beforeFinish(span); span.finish(); throw error; } @@ -129,7 +140,7 @@ public static void after( public static final class StartContextPropagationAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) public static void before(@Advice.Argument(1) Metadata headers) { - DECORATE.injectContext(Java8BytecodeBridge.getCurrentContext(), headers, SETTER); + DECORATE.injectContext(currentContext(), headers, SETTER); } } @@ -176,7 +187,9 @@ public static void before( @Advice.This ClientCall call, @Advice.Argument(1) Throwable cause) { AgentSpan span = InstrumentationContext.get(ClientCall.class, AgentSpan.class).remove(call); if (null != span) { - if (cause instanceof StatusException) { + if (cause instanceof StatusRuntimeException) { + DECORATE.onClose(span, ((StatusRuntimeException) cause).getStatus()); + } else if (cause instanceof StatusException) { DECORATE.onClose(span, ((StatusException) cause).getStatus()); } span.finish(); @@ -187,7 +200,6 @@ public static void before( public static final class CloseObserver { @Advice.OnMethodEnter public static AgentScope before(@Advice.This ClientCall call) { - // could create a message span here for the request AgentSpan span = InstrumentationContext.get(ClientCall.class, AgentSpan.class).remove(call); if (span != null) { return activateSpan(span); @@ -200,8 +212,45 @@ public static void closeObserver( @Advice.Enter AgentScope scope, @Advice.Argument(0) Status status) { if (null != scope) { DECORATE.onClose(scope.span(), status); + scope.close(); scope.span().finish(); + } + } + } + + /** + * After armeria 1.40 and
    this PR, it is + * possible that the first call to close would not be the real close. We need to rely on the + * internal boolean `closed` to know if we are dealing with the real closing. + */ + public static final class CloseObserverWithCause { + @Advice.OnMethodEnter + public static AgentScope before(@Advice.This ClientCall call) { + AgentSpan span = InstrumentationContext.get(ClientCall.class, AgentSpan.class).get(call); + if (span != null) { + return activateSpan(span); + } + return null; + } + + @Advice.OnMethodExit(onThrowable = Throwable.class) + public static void closeObserver( + @Advice.This ClientCall call, + @Advice.Enter AgentScope scope, + @Advice.Argument(0) Status status, + @Advice.FieldValue("closed") boolean closed) { + if (null != scope) { + AgentSpan span = null; + if (closed) { + span = InstrumentationContext.get(ClientCall.class, AgentSpan.class).remove(call); + if (span != null) { + DECORATE.onClose(span, status); + } + } scope.close(); + if (span != null) { + span.finish(); + } } } } @@ -223,8 +272,8 @@ public static AgentScope before() { @Advice.OnMethodExit(onThrowable = Throwable.class) public static void after(@Advice.Enter AgentScope scope) { if (null != scope) { - scope.span().finish(); scope.close(); + scope.span().finish(); } } } diff --git a/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/main/java/datadog/trace/instrumentation/armeria/grpc/client/GrpcClientDecorator.java b/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/main/java/datadog/trace/instrumentation/armeria/grpc/client/GrpcClientDecorator.java index ef945048118..d7a592ee72a 100644 --- a/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/main/java/datadog/trace/instrumentation/armeria/grpc/client/GrpcClientDecorator.java +++ b/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/main/java/datadog/trace/instrumentation/armeria/grpc/client/GrpcClientDecorator.java @@ -104,7 +104,8 @@ public AgentSpan startCall(MethodDescriptor method) { RPC_SERVICE_CACHE.computeIfAbsent( method.getFullMethodName(), MethodDescriptor::extractFullServiceName)); span.setResourceName(method.getFullMethodName()); - return afterStart(span); + afterStart(span); + return span; } public void injectContext(Context context, final C request, CarrierSetter setter) { @@ -114,7 +115,7 @@ public void injectContext(Context context, final C request, CarrierSetter defaultPropagator().inject(context, request, setter); } - public AgentSpan onClose(final AgentSpan span, final Status status) { + public void onClose(final AgentSpan span, final Status status) { span.setTag("status.code", status.getCode().name()); span.setTag("grpc.status.code", status.getCode().name()); @@ -124,6 +125,5 @@ public AgentSpan onClose(final AgentSpan span, final Status status) { // TODO why is there a mismatch between client / server for calling the onError method? onError(span, status.getCause()); span.setError(CLIENT_ERROR_STATUSES.get(status.getCode().value())); - return span; } } diff --git a/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/main/java/datadog/trace/instrumentation/armeria/grpc/client/GrpcInjectAdapter.java b/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/main/java/datadog/trace/instrumentation/armeria/grpc/client/GrpcInjectAdapter.java index 931d729c6e1..8be18d7f369 100644 --- a/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/main/java/datadog/trace/instrumentation/armeria/grpc/client/GrpcInjectAdapter.java +++ b/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/main/java/datadog/trace/instrumentation/armeria/grpc/client/GrpcInjectAdapter.java @@ -1,17 +1,24 @@ package datadog.trace.instrumentation.armeria.grpc.client; import datadog.context.propagation.CarrierSetter; +import datadog.trace.api.cache.DDCache; +import datadog.trace.api.cache.DDCaches; import io.grpc.Metadata; +import java.util.function.Function; import javax.annotation.ParametersAreNonnullByDefault; @ParametersAreNonnullByDefault public final class GrpcInjectAdapter implements CarrierSetter { + private static final Function> KEY_MAKER = + key -> Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER); + private static final DDCache> KEY_CACHE = + DDCaches.newFixedSizeCache(64); public static final GrpcInjectAdapter SETTER = new GrpcInjectAdapter(); @Override public void set(final Metadata carrier, final String key, final String value) { - Metadata.Key metadataKey = Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER); + Metadata.Key metadataKey = KEY_CACHE.computeIfAbsent(key, KEY_MAKER); if (carrier.containsKey(metadataKey)) { carrier.removeAll( metadataKey); // Remove existing to ensure identical behavior with other carriers diff --git a/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/main/java/datadog/trace/instrumentation/armeria/grpc/server/GrpcExtractAdapter.java b/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/main/java/datadog/trace/instrumentation/armeria/grpc/server/GrpcExtractAdapter.java index e358e7a0632..6cc62562d72 100644 --- a/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/main/java/datadog/trace/instrumentation/armeria/grpc/server/GrpcExtractAdapter.java +++ b/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/main/java/datadog/trace/instrumentation/armeria/grpc/server/GrpcExtractAdapter.java @@ -1,9 +1,16 @@ package datadog.trace.instrumentation.armeria.grpc.server; +import datadog.trace.api.cache.DDCache; +import datadog.trace.api.cache.DDCaches; import datadog.trace.bootstrap.instrumentation.api.AgentPropagation; import io.grpc.Metadata; +import java.util.function.Function; public final class GrpcExtractAdapter implements AgentPropagation.ContextVisitor { + private static final Function> KEY_MAKER = + key -> Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER); + private static final DDCache> KEY_CACHE = + DDCaches.newFixedSizeCache(64); public static final GrpcExtractAdapter GETTER = new GrpcExtractAdapter(); @@ -11,8 +18,7 @@ public final class GrpcExtractAdapter implements AgentPropagation.ContextVisitor public void forEachKey(Metadata carrier, AgentPropagation.KeyClassifier classifier) { for (String key : carrier.keys()) { if (!key.endsWith(Metadata.BINARY_HEADER_SUFFIX) && !key.startsWith(":")) { - if (!classifier.accept( - key, carrier.get(Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER)))) { + if (!classifier.accept(key, carrier.get(KEY_CACHE.computeIfAbsent(key, KEY_MAKER)))) { return; } } diff --git a/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/main/java/datadog/trace/instrumentation/armeria/grpc/server/GrpcServerDecorator.java b/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/main/java/datadog/trace/instrumentation/armeria/grpc/server/GrpcServerDecorator.java index 61a46648cc3..62050536186 100644 --- a/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/main/java/datadog/trace/instrumentation/armeria/grpc/server/GrpcServerDecorator.java +++ b/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/main/java/datadog/trace/instrumentation/armeria/grpc/server/GrpcServerDecorator.java @@ -79,12 +79,12 @@ protected CharSequence component() { } @Override - public AgentSpan afterStart(final AgentSpan span) { + public void afterStart(final AgentSpan span) { span.setMeasured(true); - return super.afterStart(span); + super.afterStart(span); } - public AgentSpan onCall(final AgentSpan span, ServerCall call) { + public void onCall(final AgentSpan span, ServerCall call) { if (TRIM_RESOURCE_PACKAGE_NAME) { span.setResourceName( cachedResourceNames.computeIfAbsent( @@ -92,33 +92,31 @@ public AgentSpan onCall(final AgentSpan span, ServerCall> KEY_MAKER = + key -> Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER); + private static final DDCache> KEY_CACHE = + DDCaches.newFixedSizeCache(64); public static final TracingServerInterceptor INSTANCE = new TracingServerInterceptor(); private static final Set IGNORED_METHODS = Config.get().getGrpcIgnoredInboundMethods(); @@ -85,7 +91,7 @@ public ServerCall.Listener interceptCall( DECORATE.onCall(span, call); final ServerCall.Listener result; - try (AgentScope scope = activateSpan(span)) { + try (ContextScope scope = activateSpan(span)) { // Wrap the server call so that we can decorate the span // with the resulting status final TracingServerCall tracingServerCall = new TracingServerCall<>(span, call); @@ -117,7 +123,7 @@ static final class TracingServerCall @Override public void close(final Status status, final Metadata trailers) { DECORATE.onClose(span, status); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { delegate().close(status, trailers); } catch (final Throwable e) { DECORATE.onError(span, e); @@ -144,10 +150,10 @@ public static final class TracingServerCallListener @Override public void onMessage(final ReqT message) { final AgentSpan msgSpan = - startSpan(DECORATE.instrumentationNames()[0], GRPC_MESSAGE, this.span.context()) + startSpan(DECORATE.instrumentationNames()[0], GRPC_MESSAGE, this.span.spanContext()) .setTag("message.type", message.getClass().getName()); DECORATE.afterStart(msgSpan); - try (AgentScope scope = activateSpan(msgSpan)) { + try (ContextScope scope = activateSpan(msgSpan)) { callIGCallbackGrpcMessage(msgSpan, message); delegate().onMessage(message); } catch (final Throwable e) { @@ -167,7 +173,7 @@ public void onMessage(final ReqT message) { @Override public void onHalfClose() { - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { delegate().onHalfClose(); } catch (final Throwable e) { if (span.phasedFinish()) { @@ -183,7 +189,7 @@ public void onHalfClose() { @Override public void onCancel() { // Finishes span. - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { delegate().onCancel(); span.setTag("canceled", true); } catch (CancellationException e) { @@ -204,7 +210,7 @@ public void onCancel() { @Override public void onComplete() { // Finishes span. - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { delegate().onComplete(); } catch (final Throwable e) { DECORATE.onError(span, e); @@ -224,7 +230,7 @@ public void onComplete() { @Override public void onReady() { - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { delegate().onReady(); } catch (final Throwable e) { if (span.phasedFinish()) { @@ -294,7 +300,7 @@ private static void callIGCallbackHeaders( } for (String key : metadata.keys()) { if (!key.endsWith(Metadata.BINARY_HEADER_SUFFIX) && !key.startsWith(":")) { - Metadata.Key mdKey = Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER); + Metadata.Key mdKey = KEY_CACHE.computeIfAbsent(key, KEY_MAKER); for (String value : metadata.getAll(mdKey)) { headerCb.accept(reqCtx, key, value); } diff --git a/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/test/groovy/ArmeriaGrpcStreamingTest.groovy b/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/test/groovy/ArmeriaGrpcStreamingTest.groovy index 4098f3d4f62..912fa60e0ed 100644 --- a/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/test/groovy/ArmeriaGrpcStreamingTest.groovy +++ b/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/test/groovy/ArmeriaGrpcStreamingTest.groovy @@ -41,11 +41,6 @@ abstract class ArmeriaGrpcStreamingTest extends VersionedNamingTestBase { false } - @Override - boolean useStrictTraceWrites() { - false - } - @Override protected void configurePreAgent() { super.configurePreAgent() diff --git a/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/test/groovy/ArmeriaGrpcTest.groovy b/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/test/groovy/ArmeriaGrpcTest.groovy index da2fd3e2510..7f8089f9aa9 100644 --- a/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/test/groovy/ArmeriaGrpcTest.groovy +++ b/dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/src/test/groovy/ArmeriaGrpcTest.groovy @@ -87,11 +87,6 @@ abstract class ArmeriaGrpcTest extends VersionedNamingTestBase { injectSysConfig(GRPC_SERVER_ERROR_STATUSES, "2-14", true) } - @Override - boolean useStrictTraceWrites() { - false - } - def setupSpec() { ig = AgentTracer.get().getCallbackProvider(RequestContextSlot.APPSEC) } diff --git a/dd-java-agent/instrumentation/armeria/armeria-jetty-1.24/build.gradle b/dd-java-agent/instrumentation/armeria/armeria-jetty-1.24/build.gradle index 65cde281c07..2d8e7cf20a5 100644 --- a/dd-java-agent/instrumentation/armeria/armeria-jetty-1.24/build.gradle +++ b/dd-java-agent/instrumentation/armeria/armeria-jetty-1.24/build.gradle @@ -87,6 +87,8 @@ dependencies { testRuntimeOnly project(':dd-java-agent:instrumentation:jetty:jetty-server:jetty-server-9.0') testRuntimeOnly(project(':dd-java-agent:instrumentation:jetty:jetty-util-9.4.31')) testRuntimeOnly project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-9.3') + testRuntimeOnly project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-9.4') + testRuntimeOnly project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-11.0') testRuntimeOnly project(':dd-java-agent:instrumentation:servlet:jakarta-servlet-5.0') testRuntimeOnly project(':dd-java-agent:instrumentation:servlet:javax-servlet:javax-servlet-3.0') } diff --git a/dd-java-agent/instrumentation/armeria/armeria-jetty-1.24/gradle.lockfile b/dd-java-agent/instrumentation/armeria/armeria-jetty-1.24/gradle.lockfile index 3eb74dc764b..17b897570e7 100644 --- a/dd-java-agent/instrumentation/armeria/armeria-jetty-1.24/gradle.lockfile +++ b/dd-java-agent/instrumentation/armeria/armeria-jetty-1.24/gradle.lockfile @@ -1,43 +1,44 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:armeria:armeria-jetty-1.24:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.aayushatharva.brotli4j:brotli4j:1.12.0=jetty11TestRuntimeClasspath,jetty9TestRuntimeClasspath -com.aayushatharva.brotli4j:brotli4j:1.22.0=jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath +com.aayushatharva.brotli4j:brotli4j:1.23.0=jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath com.aayushatharva.brotli4j:service:1.12.0=jetty11TestRuntimeClasspath,jetty9TestRuntimeClasspath -com.aayushatharva.brotli4j:service:1.22.0=jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath +com.aayushatharva.brotli4j:service:1.23.0=jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-annotations:2.15.2=compileClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.21=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-annotations:2.22=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-core:2.15.2=compileClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.21.2=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-core:2.22.0=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-databind:2.15.2=compileClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.21.2=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-databind:2.22.0=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.15.2=compileClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.21.2=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath +com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.22.0=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.15.2=compileClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.21.2=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath +com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.22.0=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.15.2=compileClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.21.2=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath +com.fasterxml.jackson:jackson-bom:2.22.0=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,jetty11LatestDepTestAnnotationProcessor,jetty11LatestDepTestCompileClasspath,jetty11TestAnnotationProcessor,jetty11TestCompileClasspath,jetty9LatestDepTestAnnotationProcessor,jetty9LatestDepTestCompileClasspath,jetty9TestAnnotationProcessor,jetty9TestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -47,18 +48,21 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,jetty com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,jetty11LatestDepTestAnnotationProcessor,jetty11TestAnnotationProcessor,jetty9LatestDepTestAnnotationProcessor,jetty9TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,jetty11LatestDepTestAnnotationProcessor,jetty11TestAnnotationProcessor,jetty9LatestDepTestAnnotationProcessor,jetty9TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,jetty11LatestDepTestAnnotationProcessor,jetty11TestAnnotationProcessor,jetty9LatestDepTestAnnotationProcessor,jetty9TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,jetty11LatestDepTestAnnotationProcessor,jetty11TestAnnotationProcessor,jetty9LatestDepTestAnnotationProcessor,jetty9TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,jetty11LatestDepTestAnnotationProcessor,jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestAnnotationProcessor,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestAnnotationProcessor,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestAnnotationProcessor,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,jetty11LatestDepTestAnnotationProcessor,jetty11TestAnnotationProcessor,jetty9LatestDepTestAnnotationProcessor,jetty9TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.linecorp.armeria:armeria-jetty11:1.24.0=jetty11TestCompileClasspath,jetty11TestRuntimeClasspath -com.linecorp.armeria:armeria-jetty11:1.38.0=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath +com.linecorp.armeria:armeria-jetty11:1.40.0=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath com.linecorp.armeria:armeria-jetty9:1.24.0=compileClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath -com.linecorp.armeria:armeria-jetty9:1.38.0=jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath +com.linecorp.armeria:armeria-jetty9:1.40.0=jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath com.linecorp.armeria:armeria:1.24.0=compileClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath -com.linecorp.armeria:armeria:1.38.0=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath +com.linecorp.armeria:armeria:1.40.0=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath com.squareup.moshi:moshi:1.11.0=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -71,64 +75,64 @@ de.thetaphi:forbiddenapis:3.10=compileClasspath,jetty11LatestDepTestCompileClass io.leangen.geantyref:geantyref:1.3.16=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.micrometer:context-propagation:1.2.1=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath io.micrometer:micrometer-commons:1.11.1=compileClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath -io.micrometer:micrometer-commons:1.16.4=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath +io.micrometer:micrometer-commons:1.17.0=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath io.micrometer:micrometer-core:1.11.1=compileClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath -io.micrometer:micrometer-core:1.16.4=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath +io.micrometer:micrometer-core:1.17.0=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath io.micrometer:micrometer-observation:1.11.1=compileClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath -io.micrometer:micrometer-observation:1.16.4=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath +io.micrometer:micrometer-observation:1.17.0=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath io.netty:netty-buffer:4.1.93.Final=compileClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath -io.netty:netty-buffer:4.2.12.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath -io.netty:netty-codec-base:4.2.12.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath -io.netty:netty-codec-compression:4.2.12.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath +io.netty:netty-buffer:4.2.15.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath +io.netty:netty-codec-base:4.2.15.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath +io.netty:netty-codec-compression:4.2.15.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath io.netty:netty-codec-dns:4.1.93.Final=compileClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath -io.netty:netty-codec-dns:4.2.12.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath +io.netty:netty-codec-dns:4.2.15.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath io.netty:netty-codec-haproxy:4.1.93.Final=compileClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath -io.netty:netty-codec-haproxy:4.2.12.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath +io.netty:netty-codec-haproxy:4.2.15.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath io.netty:netty-codec-http2:4.1.93.Final=compileClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath -io.netty:netty-codec-http2:4.2.12.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath +io.netty:netty-codec-http2:4.2.15.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath io.netty:netty-codec-http:4.1.93.Final=compileClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath -io.netty:netty-codec-http:4.2.12.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath +io.netty:netty-codec-http:4.2.15.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath io.netty:netty-codec-socks:4.1.93.Final=jetty11TestRuntimeClasspath,jetty9TestRuntimeClasspath -io.netty:netty-codec-socks:4.2.12.Final=jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath +io.netty:netty-codec-socks:4.2.15.Final=jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath io.netty:netty-codec:4.1.93.Final=compileClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath io.netty:netty-common:4.1.93.Final=compileClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath -io.netty:netty-common:4.2.12.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath +io.netty:netty-common:4.2.15.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath io.netty:netty-handler-proxy:4.1.93.Final=jetty11TestRuntimeClasspath,jetty9TestRuntimeClasspath -io.netty:netty-handler-proxy:4.2.12.Final=jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath +io.netty:netty-handler-proxy:4.2.15.Final=jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath io.netty:netty-handler:4.1.93.Final=compileClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath -io.netty:netty-handler:4.2.12.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath +io.netty:netty-handler:4.2.15.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath io.netty:netty-resolver-dns-classes-macos:4.1.93.Final=jetty11TestRuntimeClasspath,jetty9TestRuntimeClasspath -io.netty:netty-resolver-dns-classes-macos:4.2.12.Final=jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath +io.netty:netty-resolver-dns-classes-macos:4.2.15.Final=jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath io.netty:netty-resolver-dns-native-macos:4.1.93.Final=jetty11TestRuntimeClasspath,jetty9TestRuntimeClasspath -io.netty:netty-resolver-dns-native-macos:4.2.12.Final=jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath +io.netty:netty-resolver-dns-native-macos:4.2.15.Final=jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath io.netty:netty-resolver-dns:4.1.93.Final=compileClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath -io.netty:netty-resolver-dns:4.2.12.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath +io.netty:netty-resolver-dns:4.2.15.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath io.netty:netty-resolver:4.1.93.Final=compileClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath -io.netty:netty-resolver:4.2.12.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath +io.netty:netty-resolver:4.2.15.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath io.netty:netty-tcnative-boringssl-static:2.0.61.Final=jetty11TestRuntimeClasspath,jetty9TestRuntimeClasspath -io.netty:netty-tcnative-boringssl-static:2.0.75.Final=jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath +io.netty:netty-tcnative-boringssl-static:2.0.77.Final=jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath io.netty:netty-tcnative-classes:2.0.61.Final=jetty11TestRuntimeClasspath,jetty9TestRuntimeClasspath -io.netty:netty-tcnative-classes:2.0.75.Final=jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath +io.netty:netty-tcnative-classes:2.0.77.Final=jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath io.netty:netty-transport-classes-epoll:4.1.93.Final=jetty11TestRuntimeClasspath,jetty9TestRuntimeClasspath -io.netty:netty-transport-classes-epoll:4.2.12.Final=jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath +io.netty:netty-transport-classes-epoll:4.2.15.Final=jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath io.netty:netty-transport-classes-kqueue:4.1.93.Final=jetty11TestRuntimeClasspath,jetty9TestRuntimeClasspath -io.netty:netty-transport-classes-kqueue:4.2.12.Final=jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath +io.netty:netty-transport-classes-kqueue:4.2.15.Final=jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath io.netty:netty-transport-native-epoll:4.1.93.Final=jetty11TestRuntimeClasspath,jetty9TestRuntimeClasspath -io.netty:netty-transport-native-epoll:4.2.12.Final=jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath +io.netty:netty-transport-native-epoll:4.2.15.Final=jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath io.netty:netty-transport-native-kqueue:4.1.93.Final=jetty11TestRuntimeClasspath,jetty9TestRuntimeClasspath -io.netty:netty-transport-native-kqueue:4.2.12.Final=jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath +io.netty:netty-transport-native-kqueue:4.2.15.Final=jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath io.netty:netty-transport-native-unix-common:4.1.93.Final=compileClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath -io.netty:netty-transport-native-unix-common:4.2.12.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.2.15.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath io.netty:netty-transport:4.1.93.Final=compileClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath -io.netty:netty-transport:4.2.12.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.netty:netty-transport:4.2.15.Final=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.websocket:jakarta.websocket-client-api:2.0.0=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=compileClasspath,jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.websocket:javax.websocket-api:1.0=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -186,7 +190,7 @@ org.hdrhistogram:HdrHistogram:2.1.12=jetty11TestRuntimeClasspath,jetty9TestRunti org.hdrhistogram:HdrHistogram:2.2.2=jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jspecify:jspecify:1.0.0=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -199,20 +203,20 @@ org.junit.platform:junit-platform-suite-api:1.14.1=jetty11LatestDepTestRuntimeCl org.junit.platform:junit-platform-suite-commons:1.14.1=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.latencyutils:LatencyUtils:2.0.3=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath +org.latencyutils:LatencyUtils:2.0.3=jetty11TestRuntimeClasspath,jetty9TestRuntimeClasspath org.mockito:mockito-core:4.4.0=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=jetty11LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.4=compileClasspath,jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=jetty11LatestDepTestCompileClasspath,jetty11LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,jetty9LatestDepTestCompileClasspath,jetty9LatestDepTestRuntimeClasspath,jetty9TestCompileClasspath,jetty9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/avro-1.11.3/gradle.lockfile b/dd-java-agent/instrumentation/avro-1.11.3/gradle.lockfile index 1404b3e0cf5..1002b5dacdc 100644 --- a/dd-java-agent/instrumentation/avro-1.11.3/gradle.lockfile +++ b/dd-java-agent/instrumentation/avro-1.11.3/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:avro-1.11.3:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -9,7 +10,7 @@ ch.qos.reload4j:reload4j:1.2.22=latestDepTest8CompileClasspath,latestDepTest8Run com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -28,16 +29,16 @@ com.fasterxml.jackson:jackson-bom:2.20.0=latestDepTestCompileClasspath,latestDep com.fasterxml.woodstox:woodstox-core:5.3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.woodstox:woodstox-core:5.4.0=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.luben:zstd-jni:1.5.5-5=compileClasspath,latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTest8AnnotationProcessor,latestDepTest8CompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -48,22 +49,21 @@ com.google.code.gson:gson:2.13.2=spotbugs com.google.code.gson:gson:2.2.4=compileClasspath,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.9.0=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTest8AnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.errorprone:error_prone_annotations:2.2.0=testCompileClasspath,testRuntimeClasspath -com.google.errorprone:error_prone_annotations:2.36.0=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:failureaccess:1.0=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0=compileClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTest8AnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:failureaccess:1.0.3=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.google.guava:guava:27.0-jre=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:27.0-jre=compileClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTest8AnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:33.4.8-jre=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.guava:guava:33.6.0-jre=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,compileClasspath,latestDepTest8AnnotationProcessor,latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -com.google.j2objc:j2objc-annotations:1.1=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:1.1=compileClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTest8AnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.j2objc:j2objc-annotations:3.0.0=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.protobuf:protobuf-java:2.5.0=compileClasspath,testCompileClasspath,testRuntimeClasspath com.google.re2j:re2j:1.1=compileClasspath,latestDepTest8CompileClasspath,latestDepTestCompileClasspath,testCompileClasspath -com.google.re2j:re2j:1.7=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.jcraft:jsch:0.1.55=compileClasspath,latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.nimbusds:nimbus-jose-jwt:10.4=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.nimbusds:nimbus-jose-jwt:9.8.1=compileClasspath,testCompileClasspath,testRuntimeClasspath @@ -117,7 +117,7 @@ io.netty:netty-transport-native-unix-common:4.1.130.Final=latestDepTest8CompileC io.netty:netty-transport-native-unix-common:4.1.42.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.1.130.Final=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.42.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:1.2.1=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath jakarta.servlet.jsp:jakarta.servlet.jsp-api:2.3.6=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -134,8 +134,8 @@ javax.xml.stream:stax-api:1.0-2=compileClasspath,testCompileClasspath,testRuntim jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath log4j:log4j:1.2.17=compileClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.minidev:accessors-smart:2.4.2=compileClasspath,testCompileClasspath,testRuntimeClasspath @@ -215,7 +215,7 @@ org.apache.zookeeper:zookeeper:3.5.6=compileClasspath,testCompileClasspath,testR org.apache.zookeeper:zookeeper:3.8.6=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apiguardian:apiguardian-api:1.1.2=latestDepTest8CompileClasspath,latestDepTestCompileClasspath,testCompileClasspath org.bouncycastle:bcprov-jdk18on:1.82=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.checkerframework:checker-qual:2.5.2=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.checkerframework:checker-qual:2.5.2=compileClasspath org.checkerframework:checker-qual:3.33.0=annotationProcessor,latestDepTest8AnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc @@ -231,7 +231,7 @@ org.codehaus.jackson:jackson-jaxrs:1.9.2=compileClasspath,testCompileClasspath,t org.codehaus.jackson:jackson-mapper-asl:1.9.2=compileClasspath,testCompileClasspath,testRuntimeClasspath org.codehaus.jackson:jackson-xc:1.9.2=compileClasspath,testCompileClasspath,testRuntimeClasspath org.codehaus.jettison:jettison:1.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.codehaus.mojo:animal-sniffer-annotations:1.17=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.mojo:animal-sniffer-annotations:1.17=compileClasspath org.codehaus.woodstox:stax2-api:4.2.1=compileClasspath,latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs @@ -273,7 +273,7 @@ org.hamcrest:hamcrest:3.0=latestDepTest8CompileClasspath,latestDepTest8RuntimeCl org.javassist:javassist:3.30.2-GA=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jspecify:jspecify:1.0.0=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -291,14 +291,14 @@ org.objenesis:objenesis:3.3=latestDepTest8CompileClasspath,latestDepTest8Runtime org.opentest4j:opentest4j:1.3.0=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTest8RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTest8CompileClasspath,latestDepTest8RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-common/gradle.lockfile b/dd-java-agent/instrumentation/aws-java/aws-java-common/gradle.lockfile index 5ca3972ba7b..24ccb8e7f40 100644 --- a/dd-java-agent/instrumentation/aws-java/aws-java-common/gradle.lockfile +++ b/dd-java-agent/instrumentation/aws-java/aws-java-common/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:aws-java:aws-java-common:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-dynamodb-2.0/gradle.lockfile b/dd-java-agent/instrumentation/aws-java/aws-java-dynamodb-2.0/gradle.lockfile index 9ead0b0528c..300c9648189 100644 --- a/dd-java-agent/instrumentation/aws-java/aws-java-dynamodb-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/aws-java/aws-java-dynamodb-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:aws-java:aws-java-dynamodb-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.github.docker-java:docker-java-api:3.4.2=latestDepForkedTestCompileClasspath com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,50 +36,53 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okio:okio:1.17.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc -commons-codec:commons-codec:1.17.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +commons-codec:commons-codec:1.17.1=testRuntimeClasspath commons-fileupload:commons-fileupload:1.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs -commons-logging:commons-logging:1.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +commons-logging:commons-logging:1.2=testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.netty:netty-buffer:4.1.118.Final=testRuntimeClasspath -io.netty:netty-buffer:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-buffer:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http2:4.1.118.Final=testRuntimeClasspath -io.netty:netty-codec-http2:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http2:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http:4.1.118.Final=testRuntimeClasspath -io.netty:netty-codec-http:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec:4.1.118.Final=testRuntimeClasspath -io.netty:netty-codec:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-common:4.1.118.Final=testRuntimeClasspath -io.netty:netty-common:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-common:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-handler:4.1.118.Final=testRuntimeClasspath -io.netty:netty-handler:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-resolver:4.1.118.Final=testRuntimeClasspath -io.netty:netty-resolver:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport-classes-epoll:4.1.118.Final=testRuntimeClasspath -io.netty:netty-transport-classes-epoll:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-classes-epoll:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport-native-unix-common:4.1.118.Final=testRuntimeClasspath -io.netty:netty-transport-native-unix-common:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.118.Final=testRuntimeClasspath -io.netty:netty-transport:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.netty:netty-transport:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -88,8 +92,11 @@ org.apache.bcel:bcel:6.11.0=spotbugs org.apache.commons:commons-compress:1.24.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.apache.commons:commons-lang3:3.19.0=spotbugs org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.httpcomponents:httpclient:4.5.13=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.apache.httpcomponents:httpcore:4.4.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.apache.httpcomponents.client5:httpclient5:5.6.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +org.apache.httpcomponents.core5:httpcore5-h2:5.4.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +org.apache.httpcomponents.core5:httpcore5:5.4.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +org.apache.httpcomponents:httpclient:4.5.13=testRuntimeClasspath +org.apache.httpcomponents:httpcore:4.4.16=testRuntimeClasspath org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath,testCompileClasspath @@ -111,6 +118,7 @@ org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTes org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -128,14 +136,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.4=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -154,57 +162,57 @@ org.testcontainers:localstack:1.21.4=latestDepForkedTestCompileClasspath,latestD org.testcontainers:testcontainers:1.21.4=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs software.amazon.awssdk:annotations:2.30.22=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:annotations:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:annotations:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:apache-client:2.30.22=testRuntimeClasspath -software.amazon.awssdk:apache-client:2.44.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:apache5-client:2.48.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:auth:2.30.22=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:auth:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:auth:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:aws-core:2.30.22=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:aws-core:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:aws-core:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:aws-json-protocol:2.30.22=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:aws-json-protocol:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:aws-json-protocol:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:checksums-spi:2.30.22=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:checksums-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:checksums-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:checksums:2.30.22=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:checksums:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:checksums:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:dynamodb:2.30.22=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:dynamodb:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:dynamodb:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:endpoints-spi:2.30.22=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:endpoints-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:endpoints-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:http-auth-aws-eventstream:2.30.22=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:http-auth-aws-eventstream:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:http-auth-aws-eventstream:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:http-auth-aws:2.30.22=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:http-auth-aws:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:http-auth-aws:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:http-auth-spi:2.30.22=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:http-auth-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:http-auth-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:http-auth:2.30.22=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:http-auth:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:http-auth:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:http-client-spi:2.30.22=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:http-client-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:http-client-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:identity-spi:2.30.22=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:identity-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:identity-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:json-utils:2.30.22=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:json-utils:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:json-utils:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:metrics-spi:2.30.22=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:metrics-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:metrics-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:netty-nio-client:2.30.22=testRuntimeClasspath -software.amazon.awssdk:netty-nio-client:2.44.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:netty-nio-client:2.48.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:profiles:2.30.22=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:profiles:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:profiles:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:protocol-core:2.30.22=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:protocol-core:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:protocol-core:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:regions:2.30.22=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:regions:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:regions:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:retries-spi:2.30.22=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:retries-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:retries-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:retries:2.30.22=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:retries:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:retries:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:sdk-core:2.30.22=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:sdk-core:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:sdk-core:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:third-party-jackson-core:2.30.22=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:third-party-jackson-core:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -software.amazon.awssdk:utils-lite:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:third-party-jackson-core:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:utils-lite:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:utils:2.30.22=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:utils:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:utils:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.eventstream:eventstream:1.0.1=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath empty=spotbugsPlugins diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-eventbridge-2.0/gradle.lockfile b/dd-java-agent/instrumentation/aws-java/aws-java-eventbridge-2.0/gradle.lockfile index 75ba2e06b27..fa812911453 100644 --- a/dd-java-agent/instrumentation/aws-java/aws-java-eventbridge-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/aws-java/aws-java-eventbridge-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:aws-java:aws-java-eventbridge-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.github.docker-java:docker-java-api:3.4.2=latestDepForkedTestCompileClasspath com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -54,31 +58,31 @@ commons-logging:commons-logging:1.2=latestDepForkedTestRuntimeClasspath,latestDe de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.netty:netty-buffer:4.1.112.Final=testRuntimeClasspath -io.netty:netty-buffer:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-buffer:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http2:4.1.112.Final=testRuntimeClasspath -io.netty:netty-codec-http2:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http2:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http:4.1.112.Final=testRuntimeClasspath -io.netty:netty-codec-http:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec:4.1.112.Final=testRuntimeClasspath -io.netty:netty-codec:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-common:4.1.112.Final=testRuntimeClasspath -io.netty:netty-common:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-common:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-handler:4.1.112.Final=testRuntimeClasspath -io.netty:netty-handler:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-resolver:4.1.112.Final=testRuntimeClasspath -io.netty:netty-resolver:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport-classes-epoll:4.1.112.Final=testRuntimeClasspath -io.netty:netty-transport-classes-epoll:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-classes-epoll:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport-native-unix-common:4.1.112.Final=testRuntimeClasspath -io.netty:netty-transport-native-unix-common:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.112.Final=testRuntimeClasspath -io.netty:netty-transport:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.netty:netty-transport:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -88,6 +92,9 @@ org.apache.bcel:bcel:6.11.0=spotbugs org.apache.commons:commons-compress:1.24.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.apache.commons:commons-lang3:3.19.0=spotbugs org.apache.commons:commons-text:1.14.0=spotbugs +org.apache.httpcomponents.client5:httpclient5:5.6.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +org.apache.httpcomponents.core5:httpcore5-h2:5.4.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +org.apache.httpcomponents.core5:httpcore5:5.4.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath org.apache.httpcomponents:httpclient:4.5.13=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.apache.httpcomponents:httpcore:4.4.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.apache.logging.log4j:log4j-api:2.25.2=spotbugs @@ -111,6 +118,7 @@ org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTes org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -128,14 +136,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.4=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -155,83 +163,83 @@ org.testcontainers:testcontainers:1.21.4=latestDepForkedTestCompileClasspath,lat org.xmlresolver:xmlresolver:5.3.3=spotbugs software.amazon.awssdk:annotations:2.27.19=compileClasspath software.amazon.awssdk:annotations:2.27.23=testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:annotations:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -software.amazon.awssdk:apache-client:2.27.23=testRuntimeClasspath -software.amazon.awssdk:apache-client:2.44.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:annotations:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:apache-client:2.27.23=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +software.amazon.awssdk:apache5-client:2.48.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:auth:2.27.19=compileClasspath software.amazon.awssdk:auth:2.27.23=testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:auth:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:auth:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:aws-core:2.27.19=compileClasspath software.amazon.awssdk:aws-core:2.27.23=testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:aws-core:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:aws-core:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:aws-json-protocol:2.27.19=compileClasspath software.amazon.awssdk:aws-json-protocol:2.27.23=testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:aws-json-protocol:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:aws-json-protocol:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:aws-query-protocol:2.27.23=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath software.amazon.awssdk:checksums-spi:2.27.19=compileClasspath software.amazon.awssdk:checksums-spi:2.27.23=testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:checksums-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:checksums-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:checksums:2.27.19=compileClasspath software.amazon.awssdk:checksums:2.27.23=testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:checksums:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:checksums:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:endpoints-spi:2.27.19=compileClasspath software.amazon.awssdk:endpoints-spi:2.27.23=testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:endpoints-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:endpoints-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:eventbridge:2.27.19=compileClasspath software.amazon.awssdk:eventbridge:2.27.23=testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:eventbridge:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:eventbridge:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:http-auth-aws-eventstream:2.27.19=compileClasspath software.amazon.awssdk:http-auth-aws-eventstream:2.27.23=testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:http-auth-aws-eventstream:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:http-auth-aws-eventstream:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:http-auth-aws:2.27.19=compileClasspath software.amazon.awssdk:http-auth-aws:2.27.23=testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:http-auth-aws:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:http-auth-aws:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:http-auth-spi:2.27.19=compileClasspath software.amazon.awssdk:http-auth-spi:2.27.23=testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:http-auth-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:http-auth-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:http-auth:2.27.19=compileClasspath software.amazon.awssdk:http-auth:2.27.23=testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:http-auth:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:http-auth:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:http-client-spi:2.27.19=compileClasspath software.amazon.awssdk:http-client-spi:2.27.23=testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:http-client-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:http-client-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:identity-spi:2.27.19=compileClasspath software.amazon.awssdk:identity-spi:2.27.23=testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:identity-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:identity-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:json-utils:2.27.19=compileClasspath software.amazon.awssdk:json-utils:2.27.23=testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:json-utils:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:json-utils:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:metrics-spi:2.27.19=compileClasspath software.amazon.awssdk:metrics-spi:2.27.23=testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:metrics-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:metrics-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:netty-nio-client:2.27.23=testRuntimeClasspath -software.amazon.awssdk:netty-nio-client:2.44.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:netty-nio-client:2.48.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:profiles:2.27.19=compileClasspath software.amazon.awssdk:profiles:2.27.23=testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:profiles:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:profiles:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:protocol-core:2.27.19=compileClasspath software.amazon.awssdk:protocol-core:2.27.23=testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:protocol-core:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:protocol-core:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:regions:2.27.19=compileClasspath software.amazon.awssdk:regions:2.27.23=testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:regions:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:regions:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:retries-spi:2.27.19=compileClasspath software.amazon.awssdk:retries-spi:2.27.23=testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:retries-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:retries-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:retries:2.27.19=compileClasspath software.amazon.awssdk:retries:2.27.23=testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:retries:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:retries:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:sdk-core:2.27.19=compileClasspath software.amazon.awssdk:sdk-core:2.27.23=testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:sdk-core:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:sdk-core:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:sns:2.27.23=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath software.amazon.awssdk:sqs:2.27.23=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath software.amazon.awssdk:third-party-jackson-core:2.27.19=compileClasspath software.amazon.awssdk:third-party-jackson-core:2.27.23=testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:third-party-jackson-core:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -software.amazon.awssdk:utils-lite:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:third-party-jackson-core:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:utils-lite:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:utils:2.27.19=compileClasspath software.amazon.awssdk:utils:2.27.23=testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:utils:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:utils:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.eventstream:eventstream:1.0.1=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath empty=spotbugsPlugins diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-eventbridge-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/eventbridge/EventBridgeInterceptor.java b/dd-java-agent/instrumentation/aws-java/aws-java-eventbridge-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/eventbridge/EventBridgeInterceptor.java index 6b566886938..7cb54b62230 100644 --- a/dd-java-agent/instrumentation/aws-java/aws-java-eventbridge-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/eventbridge/EventBridgeInterceptor.java +++ b/dd-java-agent/instrumentation/aws-java/aws-java-eventbridge-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/eventbridge/EventBridgeInterceptor.java @@ -25,6 +25,8 @@ public class EventBridgeInterceptor implements ExecutionInterceptor { private static final Logger log = LoggerFactory.getLogger(EventBridgeInterceptor.class); + private static final String DEFAULT_EVENT_BUS_NAME = "default"; + private static final String EVENT_BUS_ARN_PREFIX = "event-bus/"; public static final ExecutionAttribute CONTEXT_ATTRIBUTE = InstanceStore.of(ExecutionAttribute.class) @@ -57,7 +59,8 @@ public SdkRequest modifyRequest(ModifyRequest context, ExecutionAttributes execu } String traceContext = - getTraceContextToInject(executionAttributes, entry.eventBusName(), startTime); + getTraceContextToInject( + executionAttributes, entry.eventBusName(), entry.detailType(), startTime); detailBuilder.setLength(detailBuilder.length() - 1); // Remove the last bracket if (detailBuilder.length() > 1) { detailBuilder.append(", "); // Only add a comma if detail is not empty. @@ -79,14 +82,19 @@ public SdkRequest modifyRequest(ModifyRequest context, ExecutionAttributes execu } private String getTraceContextToInject( - ExecutionAttributes executionAttributes, String eventBusName, long startTime) { + ExecutionAttributes executionAttributes, + String eventBusName, + String detailType, + long startTime) { Context context = executionAttributes.getAttribute(CONTEXT_ATTRIBUTE); + String resourceName = + eventBusName == null || eventBusName.isEmpty() ? DEFAULT_EVENT_BUS_NAME : eventBusName; StringBuilder jsonBuilder = new StringBuilder(); jsonBuilder.append('{'); // Inject context if (traceConfig().isDataStreamsEnabled()) { - DataStreamsTags tags = DataStreamsTags.createWithBus(OUTBOUND, eventBusName); + DataStreamsTags tags = buildDataStreamsTags(eventBusName, detailType); DataStreamsContext dsmContext = DataStreamsContext.fromTags(tags); context = context.with(dsmContext); } @@ -103,10 +111,48 @@ private String getTraceContextToInject( .append(" \"") .append(RESOURCE_NAME_KEY) .append("\": \"") - .append(eventBusName) + .append(resourceName) .append('\"'); jsonBuilder.append('}'); return jsonBuilder.toString(); } + + static DataStreamsTags buildDataStreamsTags(String eventBusName, String detailType) { + return new DataStreamsTags( + null, + OUTBOUND, + normalizeEventBusName(eventBusName), + normalizeDetailType(detailType), + "eventbridge", + null, + null, + null, + null, + null, + null, + null, + null, + null); + } + + static String normalizeEventBusName(String eventBusName) { + if (eventBusName == null || eventBusName.isEmpty()) { + return DEFAULT_EVENT_BUS_NAME; + } + + // EventBridge ARNs embed the full bus name after "event-bus/", including partner bus paths. + int arnBusNameStart = eventBusName.indexOf(EVENT_BUS_ARN_PREFIX); + if (arnBusNameStart >= 0) { + return eventBusName.substring(arnBusNameStart + EVENT_BUS_ARN_PREFIX.length()); + } + return eventBusName; + } + + static String normalizeDetailType(String detailType) { + if (detailType == null || detailType.isEmpty()) { + return null; + } + return detailType; + } } diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-eventbridge-2.0/src/test/java/datadog/trace/instrumentation/aws/v2/eventbridge/EventBridgeInterceptorTest.java b/dd-java-agent/instrumentation/aws-java/aws-java-eventbridge-2.0/src/test/java/datadog/trace/instrumentation/aws/v2/eventbridge/EventBridgeInterceptorTest.java new file mode 100644 index 00000000000..b30ccec011a --- /dev/null +++ b/dd-java-agent/instrumentation/aws-java/aws-java-eventbridge-2.0/src/test/java/datadog/trace/instrumentation/aws/v2/eventbridge/EventBridgeInterceptorTest.java @@ -0,0 +1,51 @@ +package datadog.trace.instrumentation.aws.v2.eventbridge; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; + +import datadog.trace.api.datastreams.DataStreamsTags; +import org.junit.jupiter.api.Test; + +class EventBridgeInterceptorTest { + + @Test + void buildsDataStreamsTagsFromArnAndDetailType() { + DataStreamsTags tags = + EventBridgeInterceptor.buildDataStreamsTags( + "arn:aws:events:us-east-1:123456789012:event-bus/test-bus", "order.created"); + + assertEquals(DataStreamsTags.DIRECTION_TAG + ":out", tags.getDirection()); + assertEquals(DataStreamsTags.EXCHANGE_TAG + ":test-bus", tags.getExchange()); + assertEquals(DataStreamsTags.TOPIC_TAG + ":order.created", tags.getTopic()); + assertEquals(DataStreamsTags.TYPE_TAG + ":eventbridge", tags.getType()); + } + + @Test + void keepsPartnerBusPathWhenNormalizingArn() { + DataStreamsTags tags = + EventBridgeInterceptor.buildDataStreamsTags( + "arn:aws:events:us-east-1:123456789012:event-bus/aws.partner/example.com/acct/bus-name", + "detail-type"); + + assertEquals( + DataStreamsTags.EXCHANGE_TAG + ":aws.partner/example.com/acct/bus-name", + tags.getExchange()); + assertEquals(DataStreamsTags.TOPIC_TAG + ":detail-type", tags.getTopic()); + } + + @Test + void defaultsToTheDefaultEventBusNameWhenMissing() { + DataStreamsTags tags = EventBridgeInterceptor.buildDataStreamsTags(null, "detail-type"); + + assertEquals(DataStreamsTags.EXCHANGE_TAG + ":default", tags.getExchange()); + assertEquals(DataStreamsTags.TOPIC_TAG + ":detail-type", tags.getTopic()); + } + + @Test + void omitsTheTopicTagWhenDetailTypeIsMissing() { + DataStreamsTags tags = EventBridgeInterceptor.buildDataStreamsTags("test-bus", null); + + assertEquals(DataStreamsTags.EXCHANGE_TAG + ":test-bus", tags.getExchange()); + assertNull(tags.getTopic()); + } +} diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/gradle.lockfile b/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/gradle.lockfile index 4db6f04c810..975005a6450 100644 --- a/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/gradle.lockfile +++ b/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:aws-java:aws-java-lambda-handler-1.2:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -9,20 +10,20 @@ com.amazonaws:aws-lambda-java-core:1.2.1=compileClasspath,latestDepTestCompileCl com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -32,12 +33,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -48,12 +52,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -82,6 +86,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -99,14 +104,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/main/java/datadog/trace/instrumentation/aws/v1/lambda/LambdaHandlerInstrumentation.java b/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/main/java/datadog/trace/instrumentation/aws/v1/lambda/LambdaHandlerInstrumentation.java index d7407b47b5f..cb8d369d51e 100644 --- a/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/main/java/datadog/trace/instrumentation/aws/v1/lambda/LambdaHandlerInstrumentation.java +++ b/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/main/java/datadog/trace/instrumentation/aws/v1/lambda/LambdaHandlerInstrumentation.java @@ -24,6 +24,7 @@ import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; import datadog.trace.bootstrap.instrumentation.api.InternalSpanTypes; +import datadog.trace.bootstrap.instrumentation.api.ResourceNamePriorities; import datadog.trace.config.inversion.ConfigHelper; import net.bytebuddy.asm.Advice; import net.bytebuddy.description.type.TypeDescription; @@ -118,18 +119,33 @@ static void exit( CallDepthThreadLocalMap.reset(RequestHandler.class); + final AgentSpan span = scope.span(); try { - final AgentSpan span = scope.span(); - if (throwable != null) { + if (throwable == null) { + AgentTracer.get().notifyAppSecEnd(span, result); + } else { span.addThrowable(throwable); } - String lambdaRequestId = awsContext.getAwsRequestId(); - - AgentTracer.get().notifyAppSecEnd(span); - span.finish(); - AgentTracer.get().notifyExtensionEnd(span, result, null != throwable, lambdaRequestId); + // Force the resource name back to the literal placeholder marker right + // before finish so that the Datadog Lambda Extension's filter + // (filter_span_from_lambda_library_or_runtime in + // bottlecap/src/traces/trace_processor.rs, which compares + // span.resource == "dd-tracer-serverless-span") drops the placeholder. + // Other instrumentation (HTTP/JAX-RS) may have overwritten it with the + // route ("POST /") during the invocation, in which case the extension + // would fail to dedup, leading to the placeholder leaking to the backend + // with parent_id=0 and detaching the inferred apigateway root from the + // rest of the trace. + // Use TAG_INTERCEPTOR priority because DDSpanContext.setResourceName + // ignores writes whose priority is below the current resource priority, + // and the HTTP/JAX-RS instrumentation will already have written + // HTTP_FRAMEWORK_ROUTE (3) by this point. + span.setResourceName(INVOCATION_SPAN_NAME, ResourceNamePriorities.TAG_INTERCEPTOR); } finally { scope.close(); + span.finish(); + AgentTracer.get() + .notifyExtensionEnd(span, result, null != throwable, awsContext.getAwsRequestId()); } } } diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/groovy/LambdaHandlerInstrumentationTest.groovy b/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/groovy/LambdaHandlerInstrumentationTest.groovy deleted file mode 100644 index d5b6a4bbbc1..00000000000 --- a/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/groovy/LambdaHandlerInstrumentationTest.groovy +++ /dev/null @@ -1,272 +0,0 @@ -import static datadog.trace.api.gateway.Events.EVENTS - -import datadog.trace.agent.test.naming.VersionedNamingTestBase -import datadog.trace.api.DDSpanTypes -import datadog.trace.api.function.TriConsumer -import datadog.trace.api.function.TriFunction -import datadog.trace.api.gateway.Flow -import datadog.trace.api.gateway.RequestContext -import datadog.trace.api.gateway.RequestContextSlot -import datadog.trace.bootstrap.ActiveSubsystems -import datadog.trace.bootstrap.instrumentation.api.AgentTracer -import datadog.trace.bootstrap.instrumentation.api.URIDataAdapter -import com.amazonaws.services.lambda.runtime.Context -import java.nio.charset.StandardCharsets -import java.util.function.BiFunction -import java.util.function.Function -import java.util.function.Supplier - -abstract class LambdaHandlerInstrumentationTest extends VersionedNamingTestBase { - def requestId = "test-request-id" - - // Must set this env var before the Datadog integration is initialized. - // If present at load time, the integration auto-enables. - static { - environmentVariables.set("_HANDLER", "Handler") - } - - @Override - String service() { - null - } - - def ig - def appSecStarted = false - def capturedMethod = null - def capturedPath = null - def capturedHeaders = [:] - def capturedBody = null - def appSecEnded = false - - def setup() { - ig = AgentTracer.get().getCallbackProvider(RequestContextSlot.APPSEC) - ActiveSubsystems.APPSEC_ACTIVE = true - appSecStarted = false - capturedMethod = null - capturedPath = null - capturedHeaders = [:] - capturedBody = null - appSecEnded = false - ig.registerCallback(EVENTS.requestStarted(), { - appSecStarted = true - new Flow.ResultFlow(new Object()) - } as Supplier) - ig.registerCallback(EVENTS.requestMethodUriRaw(), { RequestContext ctx, String method, URIDataAdapter uri -> - capturedMethod = method - capturedPath = uri.path() - Flow.ResultFlow.empty() - } as TriFunction) - ig.registerCallback(EVENTS.requestHeader(), { RequestContext ctx, String name, String value -> - capturedHeaders[name] = value - } as TriConsumer) - ig.registerCallback(EVENTS.requestHeaderDone(), { RequestContext ctx -> - Flow.ResultFlow.empty() - } as Function) - ig.registerCallback(EVENTS.requestBodyProcessed(), { RequestContext ctx, Object body -> - capturedBody = body - Flow.ResultFlow.empty() - } as BiFunction) - ig.registerCallback(EVENTS.requestEnded(), { RequestContext ctx, Object spanInfo -> - appSecEnded = true - Flow.ResultFlow.empty() - } as BiFunction) - } - - def cleanup() { - ig.reset() - ActiveSubsystems.APPSEC_ACTIVE = false - } - - def "test lambda streaming handler"() { - when: - def input = new ByteArrayInputStream(StandardCharsets.UTF_8.encode("Hello").array()) - def output = new ByteArrayOutputStream() - def ctx = Stub(Context) { - getAwsRequestId() >> requestId - } - new HandlerStreaming().handleRequest(input, output, ctx) - - then: - assertTraces(1) { - trace(1) { - span { - operationName operation() - spanType DDSpanTypes.SERVERLESS - errored false - } - } - } - } - - def "test streaming handler with error"() { - when: - def input = new ByteArrayInputStream(StandardCharsets.UTF_8.encode("Hello").array()) - def output = new ByteArrayOutputStream() - def ctx = Stub(Context) { - getAwsRequestId() >> requestId - } - new HandlerStreamingWithError().handleRequest(input, output, ctx) - - then: - thrown(Error) - assertTraces(1) { - trace(1) { - span { - operationName operation() - spanType DDSpanTypes.SERVERLESS - errored true - tags { - tag "request_id", requestId - tag "error.type", "java.lang.Error" - tag "error.message", "Some error" - tag "error.stack", String - tag "language", "jvm" - tag "process_id", Long - tag "runtime-id", String - tag "thread.id", Long - tag "thread.name", String - tag "_dd.profiling.ctx", "test" - tag "_dd.profiling.enabled", 0 - tag "_dd.agent_psr", 1.0 - tag "_dd.tracer_host", String - tag "_sample_rate", 1 - tag "_dd.trace_span_attribute_schema", { it != null } - } - } - } - } - } - - def "appsec callbacks are invoked for API Gateway v1 event"() { - given: - def eventJson = """{ - "path": "/api/users/123", - "headers": {"content-type": "application/json", "x-forwarded-for": "203.0.113.1"}, - "body": "{\\"key\\": \\"value\\"}", - "requestContext": { - "httpMethod": "GET", - "requestId": "req-abc", - "identity": {"sourceIp": "203.0.113.1"} - } - }""" - - when: - def input = new ByteArrayInputStream(eventJson.getBytes(StandardCharsets.UTF_8)) - def output = new ByteArrayOutputStream() - def ctx = Stub(Context) { getAwsRequestId() >> requestId } - new HandlerStreaming().handleRequest(input, output, ctx) - - then: - appSecStarted - capturedMethod == "GET" - capturedPath == "/api/users/123" - capturedHeaders["content-type"] == "application/json" - capturedBody instanceof Map - appSecEnded - assertTraces(1) { - trace(1) { - span { - operationName operation() - spanType DDSpanTypes.SERVERLESS - errored false - } - } - } - } - - def "appsec callbacks are invoked for API Gateway v2 HTTP event"() { - given: - def eventJson = """{ - "version": "2.0", - "headers": {"content-type": "application/json", "accept": "application/json"}, - "cookies": ["session=abc123"], - "body": "{\\"key\\": \\"value\\"}", - "requestContext": { - "http": { - "method": "POST", - "path": "/api/items", - "sourceIp": "198.51.100.1" - }, - "domainName": "api.example.com" - } - }""" - - when: - def input = new ByteArrayInputStream(eventJson.getBytes(StandardCharsets.UTF_8)) - def output = new ByteArrayOutputStream() - def ctx = Stub(Context) { getAwsRequestId() >> requestId } - new HandlerStreaming().handleRequest(input, output, ctx) - - then: - appSecStarted - capturedMethod == "POST" - capturedPath == "/api/items" - capturedHeaders["content-type"] == "application/json" - capturedHeaders["cookie"] == "session=abc123" - capturedBody instanceof Map - appSecEnded - assertTraces(1) { - trace(1) { - span { - operationName operation() - spanType DDSpanTypes.SERVERLESS - errored false - } - } - } - } - - def "appsec callbacks are not invoked when appsec is disabled"() { - given: - ActiveSubsystems.APPSEC_ACTIVE = false - - when: - def eventJson = """{ - "path": "/api/test", - "requestContext": {"httpMethod": "GET", "requestId": "req-xyz"} - }""" - def input = new ByteArrayInputStream(eventJson.getBytes(StandardCharsets.UTF_8)) - def output = new ByteArrayOutputStream() - def ctx = Stub(Context) { getAwsRequestId() >> requestId } - new HandlerStreaming().handleRequest(input, output, ctx) - - then: - !appSecStarted - capturedMethod == null - !appSecEnded - assertTraces(1) { - trace(1) { - span { - operationName operation() - spanType DDSpanTypes.SERVERLESS - errored false - } - } - } - } -} - - -class LambdaHandlerInstrumentationV0Test extends LambdaHandlerInstrumentationTest { - @Override - int version() { - 0 - } - - @Override - String operation() { - "dd-tracer-serverless-span" - } -} - -class LambdaHandlerInstrumentationV1ForkedTest extends LambdaHandlerInstrumentationTest { - @Override - int version() { - 1 - } - - @Override - String operation() { - "aws.lambda.invoke" - } -} diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/groovy/HandlerStreaming.java b/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/java/HandlerStreaming.java similarity index 100% rename from dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/groovy/HandlerStreaming.java rename to dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/java/HandlerStreaming.java diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/java/HandlerStreamingSimulatesHttpFrameworkResource.java b/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/java/HandlerStreamingSimulatesHttpFrameworkResource.java new file mode 100644 index 00000000000..826f9858e25 --- /dev/null +++ b/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/java/HandlerStreamingSimulatesHttpFrameworkResource.java @@ -0,0 +1,26 @@ +import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.RequestStreamHandler; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import datadog.trace.bootstrap.instrumentation.api.ResourceNamePriorities; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +/** + * Simulates HTTP server instrumentation updating the local root span resource (e.g. route) while + * the Lambda invocation span is active. + */ +public class HandlerStreamingSimulatesHttpFrameworkResource implements RequestStreamHandler { + + @Override + public void handleRequest(InputStream inputStream, OutputStream outputStream, Context context) + throws IOException { + AgentSpan span = AgentTracer.activeSpan(); + if (span != null) { + span.setResourceName("POST /api/simulated", ResourceNamePriorities.HTTP_FRAMEWORK_ROUTE); + } + outputStream.write('O'); + outputStream.write('K'); + } +} diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/java/HandlerStreamingWith404Response.java b/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/java/HandlerStreamingWith404Response.java new file mode 100644 index 00000000000..540b245e802 --- /dev/null +++ b/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/java/HandlerStreamingWith404Response.java @@ -0,0 +1,24 @@ +import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.RequestStreamHandler; +import java.io.BufferedWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.nio.charset.StandardCharsets; + +public class HandlerStreamingWith404Response implements RequestStreamHandler { + @Override + public void handleRequest(InputStream inputStream, OutputStream outputStream, Context context) + throws IOException { + PrintWriter writer = + new PrintWriter( + new BufferedWriter(new OutputStreamWriter(outputStream, StandardCharsets.UTF_8))); + writer.write( + "{\"statusCode\": 404, " + + "\"headers\": {\"content-type\": \"text/html\"}, " + + "\"body\": \"Not Found\"}"); + writer.close(); + } +} diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/java/HandlerStreamingWithApiGwResponse.java b/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/java/HandlerStreamingWithApiGwResponse.java new file mode 100644 index 00000000000..7b91f1f3510 --- /dev/null +++ b/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/java/HandlerStreamingWithApiGwResponse.java @@ -0,0 +1,24 @@ +import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.RequestStreamHandler; +import java.io.BufferedWriter; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.PrintWriter; +import java.nio.charset.StandardCharsets; + +public class HandlerStreamingWithApiGwResponse implements RequestStreamHandler { + @Override + public void handleRequest(InputStream inputStream, OutputStream outputStream, Context context) + throws IOException { + PrintWriter writer = + new PrintWriter( + new BufferedWriter(new OutputStreamWriter(outputStream, StandardCharsets.UTF_8))); + writer.write( + "{\"statusCode\": 200, " + + "\"headers\": {\"content-type\": \"application/json\", \"x-custom\": \"custom-val\"}, " + + "\"body\": \"{\\\"result\\\": \\\"ok\\\"}\"}"); + writer.close(); + } +} diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/groovy/HandlerStreamingWithError.java b/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/java/HandlerStreamingWithError.java similarity index 100% rename from dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/groovy/HandlerStreamingWithError.java rename to dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/java/HandlerStreamingWithError.java diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/java/HandlerStreamingWithRawJson.java b/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/java/HandlerStreamingWithRawJson.java new file mode 100644 index 00000000000..a34a2623770 --- /dev/null +++ b/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/java/HandlerStreamingWithRawJson.java @@ -0,0 +1,15 @@ +import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.RequestStreamHandler; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.charset.StandardCharsets; + +/** Writes valid JSON that is not in API Gateway response format (no statusCode/headers/body). */ +public class HandlerStreamingWithRawJson implements RequestStreamHandler { + @Override + public void handleRequest(InputStream inputStream, OutputStream outputStream, Context context) + throws IOException { + outputStream.write("{\"result\": \"hello\"}".getBytes(StandardCharsets.UTF_8)); + } +} diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/java/LambdaHandlerInstrumentationTest.java b/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/java/LambdaHandlerInstrumentationTest.java new file mode 100644 index 00000000000..6bb27aef0d5 --- /dev/null +++ b/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/java/LambdaHandlerInstrumentationTest.java @@ -0,0 +1,566 @@ +import static datadog.trace.agent.test.assertions.SpanMatcher.span; +import static datadog.trace.agent.test.assertions.TagsMatcher.defaultTags; +import static datadog.trace.agent.test.assertions.TagsMatcher.error; +import static datadog.trace.agent.test.assertions.TagsMatcher.tag; +import static datadog.trace.agent.test.assertions.TraceMatcher.trace; +import static datadog.trace.api.gateway.Events.EVENTS; +import static datadog.trace.test.junit.utils.assertions.Matchers.is; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.amazonaws.services.lambda.runtime.ClientContext; +import com.amazonaws.services.lambda.runtime.CognitoIdentity; +import com.amazonaws.services.lambda.runtime.Context; +import com.amazonaws.services.lambda.runtime.LambdaLogger; +import datadog.trace.agent.test.AbstractInstrumentationTest; +import datadog.trace.api.DDSpanTypes; +import datadog.trace.api.function.TriConsumer; +import datadog.trace.api.function.TriFunction; +import datadog.trace.api.gateway.Flow; +import datadog.trace.api.gateway.IGSpanInfo; +import datadog.trace.api.gateway.RequestContext; +import datadog.trace.api.gateway.RequestContextSlot; +import datadog.trace.api.gateway.SubscriptionService; +import datadog.trace.bootstrap.ActiveSubsystems; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import datadog.trace.bootstrap.instrumentation.api.URIDataAdapter; +import datadog.trace.test.junit.utils.config.WithConfig; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.BiFunction; +import java.util.function.Function; +import java.util.function.Supplier; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +@WithConfig(key = "_HANDLER", value = "Handler", env = true, addPrefix = false) +abstract class LambdaHandlerInstrumentationTest extends AbstractInstrumentationTest { + + static final String REQUEST_ID = "test-request-id"; + + // Object to avoid bootstrap class in field type (TestClassShadowingExtension check) + Object ig; + + boolean appSecStarted; + String capturedMethod; + String capturedPath; + Map capturedHeaders; + Object capturedBody; + boolean appSecEnded; + + Integer capturedResponseStatus; + Map capturedResponseHeaders; + Object capturedResponseBody; + boolean responseHeaderDoneCalled; + + abstract int version(); + + abstract String operation(); + + @BeforeEach + void setUpAppSec() { + SubscriptionService ss = + (SubscriptionService) AgentTracer.get().getSubscriptionService(RequestContextSlot.APPSEC); + ig = ss; + ActiveSubsystems.APPSEC_ACTIVE = true; + + appSecStarted = false; + capturedMethod = null; + capturedPath = null; + capturedHeaders = new HashMap<>(); + capturedBody = null; + appSecEnded = false; + capturedResponseStatus = null; + capturedResponseHeaders = new HashMap<>(); + capturedResponseBody = null; + responseHeaderDoneCalled = false; + + ss.registerCallback( + EVENTS.requestStarted(), + (Supplier>) + () -> { + appSecStarted = true; + return new Flow.ResultFlow<>(new Object()); + }); + ss.registerCallback( + EVENTS.requestMethodUriRaw(), + (TriFunction>) + (ctx2, method2, uri) -> { + capturedMethod = method2; + capturedPath = uri.path(); + return Flow.ResultFlow.empty(); + }); + ss.registerCallback( + EVENTS.requestHeader(), + (TriConsumer) + (ctx2, name, value) -> capturedHeaders.put(name, value)); + ss.registerCallback( + EVENTS.requestHeaderDone(), + (Function>) ctx2 -> Flow.ResultFlow.empty()); + ss.registerCallback( + EVENTS.requestBodyProcessed(), + (BiFunction>) + (ctx2, body) -> { + capturedBody = body; + return Flow.ResultFlow.empty(); + }); + ss.registerCallback( + EVENTS.requestEnded(), + (BiFunction>) + (ctx2, spanInfo) -> { + appSecEnded = true; + return Flow.ResultFlow.empty(); + }); + + ss.registerCallback( + EVENTS.responseStarted(), + (BiFunction>) + (ctx2, status) -> { + capturedResponseStatus = status; + return Flow.ResultFlow.empty(); + }); + ss.registerCallback( + EVENTS.responseHeader(), + (TriConsumer) + (ctx2, name, value) -> capturedResponseHeaders.put(name, value)); + ss.registerCallback( + EVENTS.responseHeaderDone(), + (Function>) + ctx2 -> { + responseHeaderDoneCalled = true; + return Flow.ResultFlow.empty(); + }); + ss.registerCallback( + EVENTS.responseBody(), + (BiFunction>) + (ctx2, body) -> { + capturedResponseBody = body; + return Flow.ResultFlow.empty(); + }); + } + + @AfterEach + void cleanUpAppSec() { + ((SubscriptionService) ig).reset(); + ActiveSubsystems.APPSEC_ACTIVE = false; + } + + private Context newContext() { + return new TestContext(REQUEST_ID); + } + + @Test + void testLambdaStreamingHandler() throws IOException { + ByteArrayInputStream input = new ByteArrayInputStream("Hello".getBytes(StandardCharsets.UTF_8)); + ByteArrayOutputStream output = new ByteArrayOutputStream(); + new HandlerStreaming().handleRequest(input, output, newContext()); + + assertTraces(trace(span().type(DDSpanTypes.SERVERLESS).error(false))); + } + + @Test + void serverlessInvocationSpanResourceResetAfterHttpFrameworkOverwrite() throws IOException { + ByteArrayInputStream input = new ByteArrayInputStream("Hello".getBytes(StandardCharsets.UTF_8)); + ByteArrayOutputStream output = new ByteArrayOutputStream(); + new HandlerStreamingSimulatesHttpFrameworkResource().handleRequest(input, output, newContext()); + + assertTraces( + trace( + span() + .resourceName(name -> operation().equals(name.toString())) + .type(DDSpanTypes.SERVERLESS) + .error(false))); + } + + @Test + void testStreamingHandlerWithError() { + ByteArrayInputStream input = new ByteArrayInputStream("Hello".getBytes(StandardCharsets.UTF_8)); + ByteArrayOutputStream output = new ByteArrayOutputStream(); + + assertThrows( + Error.class, + () -> new HandlerStreamingWithError().handleRequest(input, output, newContext())); + + assertTraces( + trace( + span() + .type(DDSpanTypes.SERVERLESS) + .error(true) + .tags( + defaultTags(), + tag("request_id", is(REQUEST_ID)), + error(Error.class, "Some error")))); + } + + @Test + void appSecCallbacksAreInvokedForApiGatewayV1Event() throws IOException { + String eventJson = + "{" + + "\"path\": \"/api/users/123\"," + + "\"headers\": {\"content-type\": \"application/json\"," + + " \"x-forwarded-for\": \"203.0.113.1\"}," + + "\"body\": \"{\\\"key\\\": \\\"value\\\"}\"," + + "\"requestContext\": {" + + " \"httpMethod\": \"GET\"," + + " \"requestId\": \"req-abc\"," + + " \"identity\": {\"sourceIp\": \"203.0.113.1\"}" + + "}" + + "}"; + + ByteArrayInputStream input = + new ByteArrayInputStream(eventJson.getBytes(StandardCharsets.UTF_8)); + ByteArrayOutputStream output = new ByteArrayOutputStream(); + new HandlerStreaming().handleRequest(input, output, newContext()); + + assertTrue(appSecStarted); + assertEquals("GET", capturedMethod); + assertEquals("/api/users/123", capturedPath); + assertEquals("application/json", capturedHeaders.get("content-type")); + assertTrue(capturedBody instanceof Map); + assertTrue(appSecEnded); + assertTraces(trace(span().type(DDSpanTypes.SERVERLESS).error(false))); + } + + @Test + void appSecCallbacksAreInvokedForApiGatewayV2HttpEvent() throws IOException { + String eventJson = + "{" + + "\"version\": \"2.0\"," + + "\"headers\": {\"content-type\": \"application/json\"," + + " \"accept\": \"application/json\"}," + + "\"cookies\": [\"session=abc123\"]," + + "\"body\": \"{\\\"key\\\": \\\"value\\\"}\"," + + "\"requestContext\": {" + + " \"http\": {" + + " \"method\": \"POST\"," + + " \"path\": \"/api/items\"," + + " \"sourceIp\": \"198.51.100.1\"" + + " }," + + " \"domainName\": \"api.example.com\"" + + "}" + + "}"; + + ByteArrayInputStream input = + new ByteArrayInputStream(eventJson.getBytes(StandardCharsets.UTF_8)); + ByteArrayOutputStream output = new ByteArrayOutputStream(); + new HandlerStreaming().handleRequest(input, output, newContext()); + + assertTrue(appSecStarted); + assertEquals("POST", capturedMethod); + assertEquals("/api/items", capturedPath); + assertEquals("application/json", capturedHeaders.get("content-type")); + assertEquals("session=abc123", capturedHeaders.get("cookie")); + assertTrue(capturedBody instanceof Map); + assertTrue(appSecEnded); + assertTraces(trace(span().type(DDSpanTypes.SERVERLESS).error(false))); + } + + @Test + void appSecCallbacksAreNotInvokedWhenAppSecIsDisabled() throws IOException { + ActiveSubsystems.APPSEC_ACTIVE = false; + + String eventJson = + "{" + + "\"path\": \"/api/test\"," + + "\"requestContext\": {\"httpMethod\": \"GET\", \"requestId\": \"req-xyz\"}" + + "}"; + ByteArrayInputStream input = + new ByteArrayInputStream(eventJson.getBytes(StandardCharsets.UTF_8)); + ByteArrayOutputStream output = new ByteArrayOutputStream(); + new HandlerStreaming().handleRequest(input, output, newContext()); + + assertFalse(appSecStarted); + assertNull(capturedMethod); + assertFalse(appSecEnded); + assertNull(capturedResponseStatus); + assertTraces(trace(span().type(DDSpanTypes.SERVERLESS).error(false))); + } + + @Test + void responseCallbacksAreInvokedForJsonEncodedResponse() throws IOException { + String eventJson = + "{" + + "\"path\": \"/api/test\"," + + "\"headers\": {\"content-type\": \"application/json\"}," + + "\"requestContext\": {" + + " \"httpMethod\": \"GET\"," + + " \"identity\": {\"sourceIp\": \"127.0.0.1\"}" + + "}" + + "}"; + + ByteArrayInputStream input = + new ByteArrayInputStream(eventJson.getBytes(StandardCharsets.UTF_8)); + ByteArrayOutputStream output = new ByteArrayOutputStream(); + new HandlerStreamingWithApiGwResponse().handleRequest(input, output, newContext()); + + assertEquals(200, (int) capturedResponseStatus); + assertEquals("application/json", capturedResponseHeaders.get("content-type")); + assertEquals("custom-val", capturedResponseHeaders.get("x-custom")); + assertTrue(capturedResponseBody instanceof Map); + assertEquals("ok", ((Map) capturedResponseBody).get("result")); + assertTrue(responseHeaderDoneCalled); + assertTrue(appSecEnded); + assertTraces(trace(span().type(DDSpanTypes.SERVERLESS).error(false))); + } + + @Test + void responseCallbacksReceiveCorrectDataFor404Response() throws IOException { + String eventJson = + "{" + + "\"path\": \"/missing\"," + + "\"requestContext\": {" + + " \"httpMethod\": \"GET\"" + + "}" + + "}"; + + ByteArrayInputStream input = + new ByteArrayInputStream(eventJson.getBytes(StandardCharsets.UTF_8)); + ByteArrayOutputStream output = new ByteArrayOutputStream(); + new HandlerStreamingWith404Response().handleRequest(input, output, newContext()); + + assertEquals(404, (int) capturedResponseStatus); + assertEquals("text/html", capturedResponseHeaders.get("content-type")); + assertEquals("Not Found", capturedResponseBody); + assertTrue(appSecEnded); + assertTraces(trace(span().type(DDSpanTypes.SERVERLESS).error(false))); + } + + @Test + void responseCallbacksApplyFallbackForLambdaUrlWithNonApiGatewayResponse() throws IOException { + // A Lambda Function URL handler returning plain JSON (no statusCode/headers/body structure) + // should trigger the fallback: no responseStarted (status unknown), content-type: + // application/json, full JSON as body. + String eventJson = + "{" + + "\"version\": \"2.0\"," + + "\"rawPath\": \"/\"," + + "\"headers\": {\"host\": \"example.lambda-url.us-east-1.on.aws\"}," + + "\"requestContext\": {" + + " \"domainName\": \"example.lambda-url.us-east-1.on.aws\"," + + " \"http\": {" + + " \"method\": \"GET\"," + + " \"path\": \"/\"," + + " \"sourceIp\": \"1.2.3.4\"" + + " }" + + "}" + + "}"; + ByteArrayInputStream input = + new ByteArrayInputStream(eventJson.getBytes(StandardCharsets.UTF_8)); + ByteArrayOutputStream output = new ByteArrayOutputStream(); + new HandlerStreamingWithRawJson().handleRequest(input, output, newContext()); + + assertNull(capturedResponseStatus); // no responseStarted for status-less fallback + assertEquals("application/json", capturedResponseHeaders.get("content-type")); + assertTrue(capturedResponseBody instanceof Map); + assertEquals("hello", ((Map) capturedResponseBody).get("result")); + assertTrue(responseHeaderDoneCalled); + assertTrue(appSecEnded); + assertTraces(trace(span().type(DDSpanTypes.SERVERLESS).error(false))); + } + + @Test + void responseCallbacksSkipNonApiGatewayResponseForNonHttpEvent() throws IOException { + // When the trigger type cannot be determined (non-JSON or non-HTTP event), + // response callbacks must not fire even if the response is valid JSON. + ByteArrayInputStream input = new ByteArrayInputStream("Hello".getBytes(StandardCharsets.UTF_8)); + ByteArrayOutputStream output = new ByteArrayOutputStream(); + new HandlerStreamingWithRawJson().handleRequest(input, output, newContext()); + + assertNull(capturedResponseStatus); + assertTrue(capturedResponseHeaders.isEmpty()); + assertNull(capturedResponseBody); + assertFalse(responseHeaderDoneCalled); + assertTrue(appSecEnded); + assertTraces(trace(span().type(DDSpanTypes.SERVERLESS).error(false))); + } + + @Test + void responseAndRequestCallbacksAreBothInvoked() throws IOException { + String eventJson = + "{" + + "\"path\": \"/api/users/123\"," + + "\"headers\": {\"content-type\": \"application/json\"}," + + "\"body\": \"{\\\"key\\\": \\\"value\\\"}\"," + + "\"requestContext\": {" + + " \"httpMethod\": \"POST\"," + + " \"requestId\": \"req-order-1\"," + + " \"identity\": {\"sourceIp\": \"10.0.0.1\"}" + + "}" + + "}"; + + ByteArrayInputStream input = + new ByteArrayInputStream(eventJson.getBytes(StandardCharsets.UTF_8)); + ByteArrayOutputStream output = new ByteArrayOutputStream(); + new HandlerStreamingWithApiGwResponse().handleRequest(input, output, newContext()); + + assertTrue(appSecStarted); + assertEquals("POST", capturedMethod); + assertEquals("/api/users/123", capturedPath); + assertTrue(capturedBody instanceof Map); + + assertEquals(200, (int) capturedResponseStatus); + assertEquals("application/json", capturedResponseHeaders.get("content-type")); + assertTrue(capturedResponseBody instanceof Map); + + assertTrue(appSecEnded); + assertTraces(trace(span().type(DDSpanTypes.SERVERLESS).error(false))); + } + + @Test + void responseCallbacksFireBeforeRequestEnded() throws IOException { + List callOrder = new ArrayList<>(); + + // Reset and re-register to capture ordering + SubscriptionService ss = (SubscriptionService) ig; + ss.reset(); + + ss.registerCallback( + EVENTS.requestStarted(), + (Supplier>) () -> new Flow.ResultFlow<>(new Object())); + ss.registerCallback( + EVENTS.responseStarted(), + (BiFunction>) + (ctx2, status) -> { + callOrder.add("responseStarted"); + return Flow.ResultFlow.empty(); + }); + ss.registerCallback( + EVENTS.responseHeaderDone(), + (Function>) + ctx2 -> { + callOrder.add("responseHeaderDone"); + return Flow.ResultFlow.empty(); + }); + ss.registerCallback( + EVENTS.responseBody(), + (BiFunction>) + (ctx2, body) -> { + callOrder.add("responseBody"); + return Flow.ResultFlow.empty(); + }); + ss.registerCallback( + EVENTS.requestEnded(), + (BiFunction>) + (ctx2, spanInfo) -> { + callOrder.add("requestEnded"); + return Flow.ResultFlow.empty(); + }); + + String eventJson = + "{" + + "\"path\": \"/api/test\"," + + "\"requestContext\": {" + + " \"httpMethod\": \"GET\"," + + " \"requestId\": \"req-order-2\"" + + "}" + + "}"; + ByteArrayInputStream input = + new ByteArrayInputStream(eventJson.getBytes(StandardCharsets.UTF_8)); + ByteArrayOutputStream output = new ByteArrayOutputStream(); + new HandlerStreamingWithApiGwResponse().handleRequest(input, output, newContext()); + + assertTrue(callOrder.contains("responseStarted")); + assertTrue(callOrder.contains("responseHeaderDone")); + assertTrue(callOrder.contains("responseBody")); + assertTrue(callOrder.contains("requestEnded")); + assertTrue(callOrder.indexOf("responseStarted") < callOrder.indexOf("requestEnded")); + assertTrue(callOrder.indexOf("responseHeaderDone") < callOrder.indexOf("requestEnded")); + assertTrue(callOrder.indexOf("responseBody") < callOrder.indexOf("requestEnded")); + assertTraces(trace(span().type(DDSpanTypes.SERVERLESS).error(false))); + } + + @Test + void responseCallbacksReceiveNoDataWhenHandlerThrows() { + ByteArrayInputStream input = new ByteArrayInputStream("Hello".getBytes(StandardCharsets.UTF_8)); + ByteArrayOutputStream output = new ByteArrayOutputStream(); + + assertThrows( + Error.class, + () -> new HandlerStreamingWithError().handleRequest(input, output, newContext())); + + assertNull(capturedResponseStatus, "response status should not be set when handler throws"); + assertNull(capturedResponseBody, "response body should not be set when handler throws"); + assertTraces( + trace( + span() + .type(DDSpanTypes.SERVERLESS) + .error(true) + .tags( + defaultTags(), + tag("request_id", is(REQUEST_ID)), + error(Error.class, "Some error")))); + } + + private static final class TestContext implements Context { + private final String requestId; + + TestContext(String requestId) { + this.requestId = requestId; + } + + @Override + public String getAwsRequestId() { + return requestId; + } + + @Override + public String getLogGroupName() { + return null; + } + + @Override + public String getLogStreamName() { + return null; + } + + @Override + public String getFunctionName() { + return null; + } + + @Override + public String getFunctionVersion() { + return null; + } + + @Override + public String getInvokedFunctionArn() { + return null; + } + + @Override + public CognitoIdentity getIdentity() { + return null; + } + + @Override + public ClientContext getClientContext() { + return null; + } + + @Override + public int getRemainingTimeInMillis() { + return 0; + } + + @Override + public int getMemoryLimitInMB() { + return 0; + } + + @Override + public LambdaLogger getLogger() { + return null; + } + } +} diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/java/LambdaHandlerInstrumentationV0Test.java b/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/java/LambdaHandlerInstrumentationV0Test.java new file mode 100644 index 00000000000..b92c889193b --- /dev/null +++ b/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/java/LambdaHandlerInstrumentationV0Test.java @@ -0,0 +1,15 @@ +import datadog.trace.test.junit.utils.config.WithConfig; + +@WithConfig(key = "trace.span.attribute.schema", value = "v0") +class LambdaHandlerInstrumentationV0Test extends LambdaHandlerInstrumentationTest { + + @Override + int version() { + return 0; + } + + @Override + String operation() { + return "dd-tracer-serverless-span"; + } +} diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/java/LambdaHandlerInstrumentationV1ForkedTest.java b/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/java/LambdaHandlerInstrumentationV1ForkedTest.java new file mode 100644 index 00000000000..784431755c9 --- /dev/null +++ b/dd-java-agent/instrumentation/aws-java/aws-java-lambda-handler-1.2/src/test/java/LambdaHandlerInstrumentationV1ForkedTest.java @@ -0,0 +1,15 @@ +import datadog.trace.test.junit.utils.config.WithConfig; + +@WithConfig(key = "trace.span.attribute.schema", value = "v1") +class LambdaHandlerInstrumentationV1ForkedTest extends LambdaHandlerInstrumentationTest { + + @Override + int version() { + return 1; + } + + @Override + String operation() { + return "aws.lambda.invoke"; + } +} diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-s3-2.0/gradle.lockfile b/dd-java-agent/instrumentation/aws-java/aws-java-s3-2.0/gradle.lockfile index f20f6210a5e..6018ae0d3e6 100644 --- a/dd-java-agent/instrumentation/aws-java/aws-java-s3-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/aws-java/aws-java-s3-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:aws-java:aws-java-s3-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.github.docker-java:docker-java-api:3.4.2=latestDepForkedTestCompileClasspath com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,50 +36,53 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okio:okio:1.17.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc -commons-codec:commons-codec:1.17.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +commons-codec:commons-codec:1.17.1=testRuntimeClasspath commons-fileupload:commons-fileupload:1.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs -commons-logging:commons-logging:1.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +commons-logging:commons-logging:1.2=testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.netty:netty-buffer:4.1.115.Final=testRuntimeClasspath -io.netty:netty-buffer:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-buffer:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http2:4.1.115.Final=testRuntimeClasspath -io.netty:netty-codec-http2:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http2:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http:4.1.115.Final=testRuntimeClasspath -io.netty:netty-codec-http:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec:4.1.115.Final=testRuntimeClasspath -io.netty:netty-codec:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-common:4.1.115.Final=testRuntimeClasspath -io.netty:netty-common:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-common:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-handler:4.1.115.Final=testRuntimeClasspath -io.netty:netty-handler:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-resolver:4.1.115.Final=testRuntimeClasspath -io.netty:netty-resolver:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport-classes-epoll:4.1.115.Final=testRuntimeClasspath -io.netty:netty-transport-classes-epoll:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-classes-epoll:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport-native-unix-common:4.1.115.Final=testRuntimeClasspath -io.netty:netty-transport-native-unix-common:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.115.Final=testRuntimeClasspath -io.netty:netty-transport:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.netty:netty-transport:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -88,8 +92,11 @@ org.apache.bcel:bcel:6.11.0=spotbugs org.apache.commons:commons-compress:1.24.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.apache.commons:commons-lang3:3.19.0=spotbugs org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.httpcomponents:httpclient:4.5.13=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.apache.httpcomponents:httpcore:4.4.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.apache.httpcomponents.client5:httpclient5:5.6.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +org.apache.httpcomponents.core5:httpcore5-h2:5.4.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +org.apache.httpcomponents.core5:httpcore5:5.4.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +org.apache.httpcomponents:httpclient:4.5.13=testRuntimeClasspath +org.apache.httpcomponents:httpcore:4.4.16=testRuntimeClasspath org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath,testCompileClasspath @@ -111,6 +118,7 @@ org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTes org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -128,14 +136,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.4=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -154,63 +162,63 @@ org.testcontainers:localstack:1.21.4=latestDepForkedTestCompileClasspath,latestD org.testcontainers:testcontainers:1.21.4=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs software.amazon.awssdk:annotations:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:annotations:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:annotations:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:apache-client:2.29.26=testRuntimeClasspath -software.amazon.awssdk:apache-client:2.44.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:apache5-client:2.48.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:arns:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:arns:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:arns:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:auth:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:auth:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:auth:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:aws-core:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:aws-core:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:aws-core:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:aws-query-protocol:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:aws-query-protocol:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:aws-query-protocol:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:aws-xml-protocol:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:aws-xml-protocol:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:aws-xml-protocol:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:checksums-spi:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:checksums-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:checksums-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:checksums:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:checksums:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:checksums:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:crt-core:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:crt-core:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:crt-core:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:endpoints-spi:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:endpoints-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:endpoints-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:http-auth-aws-eventstream:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:http-auth-aws-eventstream:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:http-auth-aws-eventstream:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:http-auth-aws:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:http-auth-aws:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:http-auth-aws:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:http-auth-spi:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:http-auth-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:http-auth-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:http-auth:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:http-auth:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:http-auth:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:http-client-spi:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:http-client-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:http-client-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:identity-spi:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:identity-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:identity-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:json-utils:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:json-utils:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:json-utils:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:metrics-spi:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:metrics-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:metrics-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:netty-nio-client:2.29.26=testRuntimeClasspath -software.amazon.awssdk:netty-nio-client:2.44.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:netty-nio-client:2.48.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:profiles:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:profiles:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:profiles:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:protocol-core:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:protocol-core:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:protocol-core:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:regions:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:regions:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:regions:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:retries-spi:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:retries-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:retries-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:retries:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:retries:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:retries:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:s3:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:s3:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:s3:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:sdk-core:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:sdk-core:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:sdk-core:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:third-party-jackson-core:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:third-party-jackson-core:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -software.amazon.awssdk:utils-lite:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:third-party-jackson-core:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:utils-lite:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:utils:2.29.26=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:utils:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:utils:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.eventstream:eventstream:1.0.1=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath empty=spotbugsPlugins diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-sdk-1.11/gradle.lockfile b/dd-java-agent/instrumentation/aws-java/aws-java-sdk-1.11/gradle.lockfile index 8a8a2c0b6cf..94f09b66386 100644 --- a/dd-java-agent/instrumentation/aws-java/aws-java-sdk-1.11/gradle.lockfile +++ b/dd-java-agent/instrumentation/aws-java/aws-java-sdk-1.11/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:aws-java:aws-java-sdk-1.11:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath ch.qos.logback:logback-classic:1.2.13=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath @@ -42,7 +43,7 @@ com.amazonaws:jmespath-java:1.12.797=latestDepForkedTestCompileClasspath,latestD com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath com.datadoghq.okio:okio:1.17.6=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath com.datadoghq:sketches-java:0.8.3=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath @@ -65,15 +66,15 @@ com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.6.6=testCompileClassp com.fasterxml.jackson:jackson-bom:2.12.7=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.17.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath +com.github.jnr:jffi:1.3.15=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath com.github.jnr:jnr-constants:0.10.4=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,dsmForkedTestAnnotationProcessor,dsmForkedTestCompileClasspath,dsmTestAnnotationProcessor,dsmTestCompileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDsmForkedTestAnnotationProcessor,latestDsmForkedTestCompileClasspath,latestDsmTestAnnotationProcessor,latestDsmTestCompileClasspath,testAnnotationProcessor,testCompileClasspath,test_before_1_11_106AnnotationProcessor,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestAnnotationProcessor,test_before_1_11_106ForkedTestCompileClasspath @@ -83,12 +84,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,dsmFo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,dsmForkedTestAnnotationProcessor,dsmTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,latestDsmForkedTestAnnotationProcessor,latestDsmTestAnnotationProcessor,testAnnotationProcessor,test_before_1_11_106AnnotationProcessor,test_before_1_11_106ForkedTestAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,dsmForkedTestAnnotationProcessor,dsmTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,latestDsmForkedTestAnnotationProcessor,latestDsmTestAnnotationProcessor,testAnnotationProcessor,test_before_1_11_106AnnotationProcessor,test_before_1_11_106ForkedTestAnnotationProcessor -com.google.guava:guava:20.0=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath +com.google.guava:failureaccess:1.0.3=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,dsmForkedTestAnnotationProcessor,dsmTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,latestDsmForkedTestAnnotationProcessor,latestDsmTestAnnotationProcessor,testAnnotationProcessor,test_before_1_11_106AnnotationProcessor,test_before_1_11_106ForkedTestAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,dsmForkedTestAnnotationProcessor,dsmTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,latestDsmForkedTestAnnotationProcessor,latestDsmTestAnnotationProcessor,testAnnotationProcessor,test_before_1_11_106AnnotationProcessor,test_before_1_11_106ForkedTestAnnotationProcessor +com.google.guava:guava:33.6.0-jre=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,dsmForkedTestAnnotationProcessor,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestAnnotationProcessor,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestAnnotationProcessor,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestAnnotationProcessor,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106AnnotationProcessor,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestAnnotationProcessor,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,dsmForkedTestAnnotationProcessor,dsmTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,latestDsmForkedTestAnnotationProcessor,latestDsmTestAnnotationProcessor,testAnnotationProcessor,test_before_1_11_106AnnotationProcessor,test_before_1_11_106ForkedTestAnnotationProcessor -com.google.re2j:re2j:1.7=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath +com.google.re2j:re2j:1.8=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath com.squareup.moshi:moshi:1.11.0=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath @@ -102,14 +106,14 @@ commons-io:commons-io:2.20.0=spotbugs commons-logging:commons-logging:1.2=compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath -io.sqreen:libsqreen:17.3.0=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath +io.sqreen:libsqreen:17.4.0=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.12.7=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath joda-time:joda-time:2.8.1=compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath junit:junit:4.13.2=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath net.java.dev.jna:jna:5.8.0=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -143,6 +147,7 @@ org.hamcrest:hamcrest:3.0=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClas org.jctools:jctools-core-jdk11:4.0.6=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath org.jctools:jctools-core:4.0.6=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath org.json:json:20231013=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath +org.jspecify:jspecify:1.0.0=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath @@ -160,14 +165,14 @@ org.objenesis:objenesis:3.3=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeCl org.opentest4j:opentest4j:1.3.0=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath org.ow2.asm:asm-util:9.7.1=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,testRuntimeClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_before_1_11_106CompileClasspath,test_before_1_11_106ForkedTestCompileClasspath,test_before_1_11_106ForkedTestRuntimeClasspath,test_before_1_11_106RuntimeClasspath diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-sdk-1.11/src/main/java/datadog/trace/instrumentation/aws/v0/AwsSdkClientDecorator.java b/dd-java-agent/instrumentation/aws-java/aws-java-sdk-1.11/src/main/java/datadog/trace/instrumentation/aws/v0/AwsSdkClientDecorator.java index e2a56e73500..f5e3e75b015 100644 --- a/dd-java-agent/instrumentation/aws-java/aws-java-sdk-1.11/src/main/java/datadog/trace/instrumentation/aws/v0/AwsSdkClientDecorator.java +++ b/dd-java-agent/instrumentation/aws-java/aws-java-sdk-1.11/src/main/java/datadog/trace/instrumentation/aws/v0/AwsSdkClientDecorator.java @@ -11,6 +11,7 @@ import com.amazonaws.Request; import com.amazonaws.Response; import com.amazonaws.http.HttpMethodName; +import datadog.context.ContextScope; import datadog.context.propagation.CarrierSetter; import datadog.trace.api.Config; import datadog.trace.api.DDTags; @@ -18,7 +19,6 @@ import datadog.trace.api.cache.DDCaches; import datadog.trace.api.datastreams.DataStreamsTags; import datadog.trace.api.naming.SpanNaming; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; import datadog.trace.bootstrap.instrumentation.api.InstrumentationTags; @@ -78,7 +78,7 @@ private static String applyServiceNamePattern(String awsServiceName) { } @Override - public AgentSpan onRequest(final AgentSpan span, final Request request) { + public void onRequest(final AgentSpan span, final Request request) { // Call super first because we override the resource name below. super.onRequest(span, request); @@ -206,14 +206,14 @@ public AgentSpan onRequest(final AgentSpan span, final Request request) { if (null != streamArn && "AmazonKinesis".equals(awsServiceName)) { switch (awsOperation.getSimpleName()) { case PUT_RECORD_OPERATION_NAME: - try (AgentScope scope = AgentTracer.activateSpan(span)) { + try (ContextScope scope = AgentTracer.activateSpan(span)) { AgentTracer.get() .getDataStreamsMonitoring() .setProduceCheckpoint("kinesis", streamArn); } break; case PUT_RECORDS_OPERATION_NAME: - try (AgentScope scope = AgentTracer.activateSpan(span)) { + try (ContextScope scope = AgentTracer.activateSpan(span)) { List records = access.getRecords(originalRequest); for (Object ignored : records) { AgentTracer.get() @@ -228,12 +228,12 @@ public AgentSpan onRequest(final AgentSpan span, final Request request) { } else if (null != topicName && "AmazonSNS".equals(awsServiceName)) { switch (awsOperation.getSimpleName()) { case PUBLISH_OPERATION_NAME: - try (AgentScope scope = AgentTracer.activateSpan(span)) { + try (ContextScope scope = AgentTracer.activateSpan(span)) { AgentTracer.get().getDataStreamsMonitoring().setProduceCheckpoint("sns", topicName); } break; case PUBLISH_BATCH_OPERATION_NAME: - try (AgentScope scope = AgentTracer.activateSpan(span)) { + try (ContextScope scope = AgentTracer.activateSpan(span)) { List entries = access.getEntries(originalRequest); for (Object ignored : entries) { AgentTracer.get().getDataStreamsMonitoring().setProduceCheckpoint("sns", topicName); @@ -245,11 +245,9 @@ public AgentSpan onRequest(final AgentSpan span, final Request request) { } } } - - return span; } - public AgentSpan onServiceResponse( + public void onServiceResponse( final AgentSpan span, final String awsService, final Response response) { if ("s3".equalsIgnoreCase(simplifyServiceName(awsService)) && traceConfig().isDataStreamsEnabled()) { @@ -287,18 +285,16 @@ && traceConfig().isDataStreamsEnabled()) { } } } - - return span; } @Override - public AgentSpan onResponse(final AgentSpan span, final Response response) { + public void onResponse(final AgentSpan span, final Response response) { if (response.getAwsResponse() instanceof AmazonWebServiceResponse) { final AmazonWebServiceResponse awsResp = (AmazonWebServiceResponse) response.getAwsResponse(); span.setTag(InstrumentationTags.AWS_REQUEST_ID, awsResp.getRequestId()); } - return super.onResponse(span, response); + super.onResponse(span, response); } @Override diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-sdk-1.11/src/main/java/datadog/trace/instrumentation/aws/v0/TracingRequestHandler.java b/dd-java-agent/instrumentation/aws-java/aws-java-sdk-1.11/src/main/java/datadog/trace/instrumentation/aws/v0/TracingRequestHandler.java index 89b49fa2c1b..84e6f7ad142 100644 --- a/dd-java-agent/instrumentation/aws-java/aws-java-sdk-1.11/src/main/java/datadog/trace/instrumentation/aws/v0/TracingRequestHandler.java +++ b/dd-java-agent/instrumentation/aws-java/aws-java-sdk-1.11/src/main/java/datadog/trace/instrumentation/aws/v0/TracingRequestHandler.java @@ -8,7 +8,6 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.blackholeSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.traceConfig; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.aws.v0.AwsSdkClientDecorator.AWS_LEGACY_TRACING; import static datadog.trace.instrumentation.aws.v0.AwsSdkClientDecorator.COMPONENT_NAME; import static datadog.trace.instrumentation.aws.v0.AwsSdkClientDecorator.DECORATE; @@ -59,7 +58,7 @@ public void beforeRequest(final Request request) { activateSpanWithoutScope(blackholeSpan()); } else { Context context = requestContextStore.remove(request.getOriginalRequest()); - AgentSpan span = spanFromContext(context); + AgentSpan span = AgentSpan.fromContext(context); if (span != null) { // we'll land here for SQS send requests when DSM is enabled. In that case, we create the // span in SqsInterceptor to inject DSM tags. @@ -94,7 +93,7 @@ public void afterResponse(final Request request, final Response response) AgentSpan span = null; if (context != null) { request.addHandlerContext(CONTEXT_CONTEXT_KEY, null); - span = spanFromContext(context); + span = AgentSpan.fromContext(context); if (span != null) { DECORATE.onResponse(span, response); DECORATE.onServiceResponse(span, request.getServiceName(), response); @@ -135,8 +134,8 @@ private void dsmCheckpoint(AgentSpan span, String streamArn, Response respons PathwayContext pathwayContext = dataStreamsMonitoring.newPathwayContext(); DataStreamsContext dataStreamsContext = create(tags, arrivalTime.getTime(), 0); pathwayContext.setCheckpoint(dataStreamsContext, dataStreamsMonitoring::add); - if (!span.context().getPathwayContext().isStarted()) { - span.context().mergePathwayContext(pathwayContext); + if (!span.spanContext().getPathwayContext().isStarted()) { + span.spanContext().mergePathwayContext(pathwayContext); } } } @@ -153,7 +152,7 @@ public void afterError(final Request request, final Response response, fin if (context != null) { request.addHandlerContext(CONTEXT_CONTEXT_KEY, null); - final AgentSpan span = spanFromContext(context); + final AgentSpan span = AgentSpan.fromContext(context); if (span != null) { if (response != null) { DECORATE.onResponse(span, response); diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-sdk-2.2/gradle.lockfile b/dd-java-agent/instrumentation/aws-java/aws-java-sdk-2.2/gradle.lockfile index ef6ecf95cab..ece71afdc0e 100644 --- a/dd-java-agent/instrumentation/aws-java/aws-java-sdk-2.2/gradle.lockfile +++ b/dd-java-agent/instrumentation/aws-java/aws-java-sdk-2.2/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:aws-java:aws-java-sdk-2.2:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=dsmForkedTestCompileClasspath,dsmForkedTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,muzzleTooling,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath @@ -21,15 +22,15 @@ com.github.docker-java:docker-java-api:3.4.2=dsmForkedTestCompileClasspath,dsmFo com.github.docker-java:docker-java-transport-zerodep:3.4.2=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,dsmForkedTestAnnotationProcessor,dsmForkedTestCompileClasspath,dsmTestAnnotationProcessor,dsmTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDsmForkedTestAnnotationProcessor,latestDsmForkedTestCompileClasspath,latestDsmTestAnnotationProcessor,latestDsmTestCompileClasspath,latestPayloadTaggingForkedTestAnnotationProcessor,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingTestAnnotationProcessor,latestPayloadTaggingTestCompileClasspath,payloadTaggingForkedTestAnnotationProcessor,payloadTaggingForkedTestCompileClasspath,payloadTaggingTestAnnotationProcessor,payloadTaggingTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -39,12 +40,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,dsmFo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,dsmForkedTestAnnotationProcessor,dsmTestAnnotationProcessor,latestDepTestAnnotationProcessor,latestDsmForkedTestAnnotationProcessor,latestDsmTestAnnotationProcessor,latestPayloadTaggingForkedTestAnnotationProcessor,latestPayloadTaggingTestAnnotationProcessor,payloadTaggingForkedTestAnnotationProcessor,payloadTaggingTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,dsmForkedTestAnnotationProcessor,dsmTestAnnotationProcessor,latestDepTestAnnotationProcessor,latestDsmForkedTestAnnotationProcessor,latestDsmTestAnnotationProcessor,latestPayloadTaggingForkedTestAnnotationProcessor,latestPayloadTaggingTestAnnotationProcessor,payloadTaggingForkedTestAnnotationProcessor,payloadTaggingTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,dsmForkedTestAnnotationProcessor,dsmTestAnnotationProcessor,latestDepTestAnnotationProcessor,latestDsmForkedTestAnnotationProcessor,latestDsmTestAnnotationProcessor,latestPayloadTaggingForkedTestAnnotationProcessor,latestPayloadTaggingTestAnnotationProcessor,payloadTaggingForkedTestAnnotationProcessor,payloadTaggingTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,dsmForkedTestAnnotationProcessor,dsmTestAnnotationProcessor,latestDepTestAnnotationProcessor,latestDsmForkedTestAnnotationProcessor,latestDsmTestAnnotationProcessor,latestPayloadTaggingForkedTestAnnotationProcessor,latestPayloadTaggingTestAnnotationProcessor,payloadTaggingForkedTestAnnotationProcessor,payloadTaggingTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,dsmForkedTestAnnotationProcessor,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestAnnotationProcessor,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestAnnotationProcessor,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestAnnotationProcessor,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestAnnotationProcessor,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestAnnotationProcessor,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestAnnotationProcessor,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestAnnotationProcessor,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,dsmForkedTestAnnotationProcessor,dsmTestAnnotationProcessor,latestDepTestAnnotationProcessor,latestDsmForkedTestAnnotationProcessor,latestDsmTestAnnotationProcessor,latestPayloadTaggingForkedTestAnnotationProcessor,latestPayloadTaggingTestAnnotationProcessor,payloadTaggingForkedTestAnnotationProcessor,payloadTaggingTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -63,61 +67,61 @@ commons-logging:commons-logging:1.2=dsmForkedTestCompileClasspath,dsmForkedTestR de.thetaphi:forbiddenapis:3.10=compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath io.netty:netty-buffer:4.1.108.Final=latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath -io.netty:netty-buffer:4.1.132.Final=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +io.netty:netty-buffer:4.1.135.Final=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath io.netty:netty-buffer:4.1.32.Final=testRuntimeClasspath io.netty:netty-buffer:4.1.77.Final=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath io.netty:netty-buffer:4.1.86.Final=latestDepTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath io.netty:netty-codec-http2:4.1.108.Final=latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath -io.netty:netty-codec-http2:4.1.132.Final=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +io.netty:netty-codec-http2:4.1.135.Final=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath io.netty:netty-codec-http2:4.1.32.Final=testRuntimeClasspath io.netty:netty-codec-http2:4.1.77.Final=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath io.netty:netty-codec-http2:4.1.86.Final=latestDepTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath io.netty:netty-codec-http:4.1.108.Final=latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath -io.netty:netty-codec-http:4.1.132.Final=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +io.netty:netty-codec-http:4.1.135.Final=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath io.netty:netty-codec-http:4.1.32.Final=testRuntimeClasspath io.netty:netty-codec-http:4.1.77.Final=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath io.netty:netty-codec-http:4.1.86.Final=latestDepTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath io.netty:netty-codec:4.1.108.Final=latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath -io.netty:netty-codec:4.1.132.Final=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +io.netty:netty-codec:4.1.135.Final=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath io.netty:netty-codec:4.1.32.Final=testRuntimeClasspath io.netty:netty-codec:4.1.77.Final=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath io.netty:netty-codec:4.1.86.Final=latestDepTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath io.netty:netty-common:4.1.108.Final=latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath -io.netty:netty-common:4.1.132.Final=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +io.netty:netty-common:4.1.135.Final=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath io.netty:netty-common:4.1.32.Final=testRuntimeClasspath io.netty:netty-common:4.1.77.Final=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath io.netty:netty-common:4.1.86.Final=latestDepTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath io.netty:netty-handler:4.1.108.Final=latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath -io.netty:netty-handler:4.1.132.Final=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +io.netty:netty-handler:4.1.135.Final=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath io.netty:netty-handler:4.1.32.Final=testRuntimeClasspath io.netty:netty-handler:4.1.77.Final=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath io.netty:netty-handler:4.1.86.Final=latestDepTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath io.netty:netty-resolver:4.1.108.Final=latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath -io.netty:netty-resolver:4.1.132.Final=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +io.netty:netty-resolver:4.1.135.Final=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath io.netty:netty-resolver:4.1.32.Final=testRuntimeClasspath io.netty:netty-resolver:4.1.77.Final=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath io.netty:netty-resolver:4.1.86.Final=latestDepTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath io.netty:netty-transport-classes-epoll:4.1.108.Final=latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath -io.netty:netty-transport-classes-epoll:4.1.132.Final=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +io.netty:netty-transport-classes-epoll:4.1.135.Final=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath io.netty:netty-transport-classes-epoll:4.1.77.Final=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath io.netty:netty-transport-classes-epoll:4.1.86.Final=latestDepTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath io.netty:netty-transport-native-epoll:4.1.32.Final=testRuntimeClasspath io.netty:netty-transport-native-unix-common:4.1.108.Final=latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath -io.netty:netty-transport-native-unix-common:4.1.132.Final=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.1.135.Final=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath io.netty:netty-transport-native-unix-common:4.1.32.Final=testRuntimeClasspath io.netty:netty-transport-native-unix-common:4.1.77.Final=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath io.netty:netty-transport-native-unix-common:4.1.86.Final=latestDepTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath io.netty:netty-transport:4.1.108.Final=latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath -io.netty:netty-transport:4.1.132.Final=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +io.netty:netty-transport:4.1.135.Final=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath io.netty:netty-transport:4.1.32.Final=testRuntimeClasspath io.netty:netty-transport:4.1.77.Final=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath io.netty:netty-transport:4.1.86.Final=latestDepTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,muzzleTooling,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,muzzleTooling,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,muzzleTooling,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,muzzleTooling,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -127,6 +131,9 @@ org.apache.bcel:bcel:6.11.0=spotbugs org.apache.commons:commons-compress:1.24.0=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.apache.commons:commons-lang3:3.19.0=spotbugs org.apache.commons:commons-text:1.14.0=spotbugs +org.apache.httpcomponents.client5:httpclient5:5.6.2=latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath +org.apache.httpcomponents.core5:httpcore5-h2:5.4.3=latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath +org.apache.httpcomponents.core5:httpcore5:5.4.3=latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath org.apache.httpcomponents:httpclient:4.5.13=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath org.apache.httpcomponents:httpclient:4.5.6=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingTestCompileClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingTestCompileClasspath,testCompileClasspath,testRuntimeClasspath org.apache.httpcomponents:httpcore:4.4.10=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingTestCompileClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingTestCompileClasspath,testCompileClasspath,testRuntimeClasspath @@ -160,6 +167,7 @@ org.hamcrest:hamcrest:3.0=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClas org.jctools:jctools-core-jdk11:4.0.6=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -177,14 +185,14 @@ org.objenesis:objenesis:3.3=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeCl org.opentest4j:opentest4j:1.3.0=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=dsmForkedTestRuntimeClasspath,dsmTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,muzzleTooling,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,muzzleTooling,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.2=compileClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.3=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath org.reactivestreams:reactive-streams:1.0.4=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath @@ -209,13 +217,14 @@ software.amazon.awssdk:annotations:2.19.0=payloadTaggingForkedTestCompileClasspa software.amazon.awssdk:annotations:2.2.0=compileClasspath,testCompileClasspath,testRuntimeClasspath software.amazon.awssdk:annotations:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:annotations:2.25.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath -software.amazon.awssdk:annotations:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:annotations:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:apache-client:2.18.40=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath software.amazon.awssdk:apache-client:2.19.0=payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath software.amazon.awssdk:apache-client:2.2.0=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingTestCompileClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingTestCompileClasspath,testCompileClasspath,testRuntimeClasspath software.amazon.awssdk:apache-client:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:apache-client:2.25.40=latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath -software.amazon.awssdk:apache-client:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:apache-client:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:apache5-client:2.48.2=latestDsmForkedTestRuntimeClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:apigateway:2.19.0=payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath software.amazon.awssdk:apigateway:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:apigateway:2.25.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath @@ -226,35 +235,35 @@ software.amazon.awssdk:auth:2.19.0=payloadTaggingForkedTestCompileClasspath,payl software.amazon.awssdk:auth:2.2.0=compileClasspath,testCompileClasspath,testRuntimeClasspath software.amazon.awssdk:auth:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:auth:2.25.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath -software.amazon.awssdk:auth:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:auth:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:aws-cbor-protocol:2.18.40=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath software.amazon.awssdk:aws-cbor-protocol:2.2.0=testCompileClasspath,testRuntimeClasspath software.amazon.awssdk:aws-cbor-protocol:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -software.amazon.awssdk:aws-cbor-protocol:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:aws-cbor-protocol:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:aws-core:2.18.40=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath software.amazon.awssdk:aws-core:2.19.0=payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath software.amazon.awssdk:aws-core:2.2.0=compileClasspath,testCompileClasspath,testRuntimeClasspath software.amazon.awssdk:aws-core:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:aws-core:2.25.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath -software.amazon.awssdk:aws-core:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:aws-core:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:aws-json-protocol:2.18.40=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath software.amazon.awssdk:aws-json-protocol:2.19.0=payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath software.amazon.awssdk:aws-json-protocol:2.2.0=testCompileClasspath,testRuntimeClasspath software.amazon.awssdk:aws-json-protocol:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:aws-json-protocol:2.25.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath -software.amazon.awssdk:aws-json-protocol:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:aws-json-protocol:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:aws-query-protocol:2.18.40=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath software.amazon.awssdk:aws-query-protocol:2.2.0=testCompileClasspath,testRuntimeClasspath software.amazon.awssdk:aws-query-protocol:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:aws-query-protocol:2.25.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath -software.amazon.awssdk:aws-query-protocol:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:aws-query-protocol:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:aws-xml-protocol:2.18.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath software.amazon.awssdk:aws-xml-protocol:2.2.0=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath software.amazon.awssdk:aws-xml-protocol:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:checksums-spi:2.25.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath -software.amazon.awssdk:checksums-spi:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:checksums-spi:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:checksums:2.25.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath -software.amazon.awssdk:checksums:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:checksums:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:crt-core:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:dynamodb:2.2.0=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath software.amazon.awssdk:dynamodb:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -264,57 +273,57 @@ software.amazon.awssdk:endpoints-spi:2.18.40=dsmForkedTestCompileClasspath,dsmFo software.amazon.awssdk:endpoints-spi:2.19.0=payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath software.amazon.awssdk:endpoints-spi:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:endpoints-spi:2.25.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath -software.amazon.awssdk:endpoints-spi:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:endpoints-spi:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:eventbridge:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:eventbridge:2.25.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath software.amazon.awssdk:eventbridge:2.7.4=payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath -software.amazon.awssdk:http-auth-aws-eventstream:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:http-auth-aws-eventstream:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:http-auth-aws:2.25.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath -software.amazon.awssdk:http-auth-aws:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:http-auth-aws:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:http-auth-spi:2.25.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath -software.amazon.awssdk:http-auth-spi:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:http-auth-spi:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:http-auth:2.25.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath -software.amazon.awssdk:http-auth:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:http-auth:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:http-client-spi:2.18.40=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath software.amazon.awssdk:http-client-spi:2.19.0=payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath software.amazon.awssdk:http-client-spi:2.2.0=compileClasspath,testCompileClasspath,testRuntimeClasspath software.amazon.awssdk:http-client-spi:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:http-client-spi:2.25.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath -software.amazon.awssdk:http-client-spi:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:http-client-spi:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:identity-spi:2.25.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath -software.amazon.awssdk:identity-spi:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:identity-spi:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:json-utils:2.18.40=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath software.amazon.awssdk:json-utils:2.19.0=payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath software.amazon.awssdk:json-utils:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:json-utils:2.25.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath -software.amazon.awssdk:json-utils:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:json-utils:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:kinesis:2.18.40=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath software.amazon.awssdk:kinesis:2.2.0=testCompileClasspath,testRuntimeClasspath software.amazon.awssdk:kinesis:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -software.amazon.awssdk:kinesis:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:kinesis:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:metrics-spi:2.18.40=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath software.amazon.awssdk:metrics-spi:2.19.0=payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath software.amazon.awssdk:metrics-spi:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:metrics-spi:2.25.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath -software.amazon.awssdk:metrics-spi:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:metrics-spi:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:netty-nio-client:2.18.40=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath software.amazon.awssdk:netty-nio-client:2.19.0=payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestRuntimeClasspath software.amazon.awssdk:netty-nio-client:2.2.0=testRuntimeClasspath software.amazon.awssdk:netty-nio-client:2.20.33=latestDepTestRuntimeClasspath software.amazon.awssdk:netty-nio-client:2.25.40=latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestRuntimeClasspath -software.amazon.awssdk:netty-nio-client:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:netty-nio-client:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:profiles:2.18.40=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath software.amazon.awssdk:profiles:2.19.0=payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath software.amazon.awssdk:profiles:2.2.0=compileClasspath,testCompileClasspath,testRuntimeClasspath software.amazon.awssdk:profiles:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:profiles:2.25.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath -software.amazon.awssdk:profiles:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:profiles:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:protocol-core:2.18.40=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath software.amazon.awssdk:protocol-core:2.19.0=payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath software.amazon.awssdk:protocol-core:2.2.0=testCompileClasspath,testRuntimeClasspath software.amazon.awssdk:protocol-core:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:protocol-core:2.25.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath -software.amazon.awssdk:protocol-core:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:protocol-core:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:rds:2.2.0=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath software.amazon.awssdk:rds:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:regions:2.18.40=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath @@ -322,9 +331,9 @@ software.amazon.awssdk:regions:2.19.0=payloadTaggingForkedTestCompileClasspath,p software.amazon.awssdk:regions:2.2.0=compileClasspath,testCompileClasspath,testRuntimeClasspath software.amazon.awssdk:regions:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:regions:2.25.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath -software.amazon.awssdk:regions:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath -software.amazon.awssdk:retries-spi:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath -software.amazon.awssdk:retries:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:regions:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:retries-spi:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:retries:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:s3:2.18.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath software.amazon.awssdk:s3:2.2.0=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath software.amazon.awssdk:s3:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -333,12 +342,12 @@ software.amazon.awssdk:sdk-core:2.19.0=payloadTaggingForkedTestCompileClasspath, software.amazon.awssdk:sdk-core:2.2.0=compileClasspath,testCompileClasspath,testRuntimeClasspath software.amazon.awssdk:sdk-core:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:sdk-core:2.25.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath -software.amazon.awssdk:sdk-core:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:sdk-core:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:sns:2.18.40=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath software.amazon.awssdk:sns:2.2.0=testCompileClasspath,testRuntimeClasspath software.amazon.awssdk:sns:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:sns:2.25.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath -software.amazon.awssdk:sns:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:sns:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:sqs:2.18.40=payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath software.amazon.awssdk:sqs:2.2.0=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath software.amazon.awssdk:sqs:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -347,17 +356,17 @@ software.amazon.awssdk:third-party-jackson-core:2.18.40=dsmForkedTestCompileClas software.amazon.awssdk:third-party-jackson-core:2.19.0=payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath software.amazon.awssdk:third-party-jackson-core:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:third-party-jackson-core:2.25.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath -software.amazon.awssdk:third-party-jackson-core:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:third-party-jackson-core:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:third-party-jackson-dataformat-cbor:2.18.40=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath software.amazon.awssdk:third-party-jackson-dataformat-cbor:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -software.amazon.awssdk:third-party-jackson-dataformat-cbor:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath -software.amazon.awssdk:utils-lite:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:third-party-jackson-dataformat-cbor:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:utils-lite:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.awssdk:utils:2.18.40=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath software.amazon.awssdk:utils:2.19.0=payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath software.amazon.awssdk:utils:2.2.0=compileClasspath,testCompileClasspath,testRuntimeClasspath software.amazon.awssdk:utils:2.20.33=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:utils:2.25.40=latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath -software.amazon.awssdk:utils:2.44.0=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath +software.amazon.awssdk:utils:2.48.2=latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath software.amazon.eventstream:eventstream:1.0.1=dsmForkedTestCompileClasspath,dsmForkedTestRuntimeClasspath,dsmTestCompileClasspath,dsmTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestDsmForkedTestCompileClasspath,latestDsmForkedTestRuntimeClasspath,latestDsmTestCompileClasspath,latestDsmTestRuntimeClasspath,latestPayloadTaggingForkedTestCompileClasspath,latestPayloadTaggingForkedTestRuntimeClasspath,latestPayloadTaggingTestCompileClasspath,latestPayloadTaggingTestRuntimeClasspath,payloadTaggingForkedTestCompileClasspath,payloadTaggingForkedTestRuntimeClasspath,payloadTaggingTestCompileClasspath,payloadTaggingTestRuntimeClasspath software.amazon:flow:1.7=compileClasspath,testCompileClasspath,testRuntimeClasspath empty=spotbugsPlugins diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-sdk-2.2/src/main/java/datadog/trace/instrumentation/aws/v2/AwsSdkClientDecorator.java b/dd-java-agent/instrumentation/aws-java/aws-java-sdk-2.2/src/main/java/datadog/trace/instrumentation/aws/v2/AwsSdkClientDecorator.java index b0c92a6c8e7..c4c55c06bee 100644 --- a/dd-java-agent/instrumentation/aws-java/aws-java-sdk-2.2/src/main/java/datadog/trace/instrumentation/aws/v2/AwsSdkClientDecorator.java +++ b/dd-java-agent/instrumentation/aws-java/aws-java-sdk-2.2/src/main/java/datadog/trace/instrumentation/aws/v2/AwsSdkClientDecorator.java @@ -115,7 +115,7 @@ public CharSequence spanName(final ExecutionAttributes attributes) { "aws", attributes.getAttribute(SdkExecutionAttribute.SERVICE_NAME), s)); } - public Context onSdkRequest( + public void onSdkRequest( final Context context, final SdkRequest request, final SdkHttpRequest httpRequest, @@ -226,11 +226,9 @@ public Context onSdkRequest( span.setTag(Tags.PEER_SERVICE, hostname); span.setTag(DDTags.PEER_SERVICE_SOURCE, "peer.service"); } - - return context; } - private static AgentSpan onOperation( + private static void onOperation( final AgentSpan span, final String awsServiceName, final String awsOperationName) { String awsRequestName = awsServiceName + "." + awsOperationName; span.setResourceName(awsRequestName, RESOURCE_NAME_PRIORITY); @@ -261,8 +259,6 @@ private static AgentSpan onOperation( span.setTag(InstrumentationTags.AWS_SERVICE, awsServiceName); span.setTag(InstrumentationTags.TOP_LEVEL_AWS_SERVICE, awsServiceName); span.setTag(InstrumentationTags.AWS_OPERATION, awsOperationName); - - return span; } private static void setPeerService( @@ -307,7 +303,7 @@ private static void setTableName(AgentSpan span, String name) { setPeerService(span, InstrumentationTags.AWS_TABLE_NAME, name); } - public Context onSdkResponse( + public void onSdkResponse( final Context context, final SdkResponse response, final SdkHttpResponse httpResponse, @@ -365,8 +361,8 @@ public Context onSdkResponse( pathwayContext.setCheckpoint( create(tags, arrivalTime.toEpochMilli(), 0), dataStreamsMonitoring::add); - if (!span.context().getPathwayContext().isStarted()) { - span.context().mergePathwayContext(pathwayContext); + if (!span.spanContext().getPathwayContext().isStarted()) { + span.spanContext().mergePathwayContext(pathwayContext); } } } @@ -405,7 +401,6 @@ public Context onSdkResponse( } } } - return span; } @Override diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-sdk-2.2/src/main/java/datadog/trace/instrumentation/aws/v2/TracingExecutionInterceptor.java b/dd-java-agent/instrumentation/aws-java/aws-java-sdk-2.2/src/main/java/datadog/trace/instrumentation/aws/v2/TracingExecutionInterceptor.java index 4969eff41f6..980f08ca118 100644 --- a/dd-java-agent/instrumentation/aws-java/aws-java-sdk-2.2/src/main/java/datadog/trace/instrumentation/aws/v2/TracingExecutionInterceptor.java +++ b/dd-java-agent/instrumentation/aws-java/aws-java-sdk-2.2/src/main/java/datadog/trace/instrumentation/aws/v2/TracingExecutionInterceptor.java @@ -11,11 +11,11 @@ import static datadog.trace.instrumentation.aws.v2.AwsSdkClientDecorator.DECORATE; import datadog.context.Context; +import datadog.context.ContextScope; import datadog.context.propagation.Propagators; import datadog.trace.api.Config; import datadog.trace.bootstrap.ContextStore; import datadog.trace.bootstrap.InstanceStore; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.util.Optional; import org.slf4j.Logger; @@ -28,6 +28,7 @@ import software.amazon.awssdk.core.interceptor.Context.BeforeTransmission; import software.amazon.awssdk.core.interceptor.Context.FailedExecution; import software.amazon.awssdk.core.interceptor.Context.ModifyHttpRequest; +import software.amazon.awssdk.core.interceptor.Context.ModifyResponse; import software.amazon.awssdk.core.interceptor.ExecutionAttribute; import software.amazon.awssdk.core.interceptor.ExecutionAttributes; import software.amazon.awssdk.core.interceptor.ExecutionInterceptor; @@ -68,7 +69,7 @@ public void afterMarshalling( final Context ddContext = executionAttributes.getAttribute(CONTEXT_ATTRIBUTE); final AgentSpan span = fromContext(ddContext); if (context != null && span != null) { - try (AgentScope ignored = activateSpan(span)) { + try (ContextScope ignored = activateSpan(span)) { DECORATE.onRequest(span, context.httpRequest()); DECORATE.onSdkRequest( ddContext, context.request(), context.httpRequest(), executionAttributes); @@ -111,6 +112,22 @@ public void beforeTransmission( } } + @Override + public SdkResponse modifyResponse( + final ModifyResponse context, final ExecutionAttributes executionAttributes) { + final SdkResponse response = context.response(); + if (!AWS_LEGACY_TRACING && isPollingRequest(context.request()) && isPollingResponse(response)) { + // Attach queueUrl before AWS SDK core rebuilds the response with + // toBuilder().sdkHttpResponse(...).build(). afterExecution sees this pre-rebuild response, + // not the final response returned to user code, so capturing queueUrl there is too late. + context + .request() + .getValueForField("QueueUrl", String.class) + .ifPresent(queueUrl -> responseQueueStore.put(response, queueUrl)); + } + return response; + } + @Override public void afterExecution( final AfterExecution context, final ExecutionAttributes executionAttributes) { @@ -124,13 +141,6 @@ public void afterExecution( DECORATE.beforeFinish(span); span.finish(); } - if (!AWS_LEGACY_TRACING && isPollingResponse(context.response())) { - // store queueUrl inside response for SqsReceiveResultInstrumentation - context - .request() - .getValueForField("QueueUrl", String.class) - .ifPresent(queueUrl -> responseQueueStore.put(context.response(), queueUrl)); - } } @Override diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-sfn-2.0/gradle.lockfile b/dd-java-agent/instrumentation/aws-java/aws-java-sfn-2.0/gradle.lockfile index 25bd83ccb80..0ecbe842158 100644 --- a/dd-java-agent/instrumentation/aws-java/aws-java-sfn-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/aws-java/aws-java-sfn-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:aws-java:aws-java-sfn-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -20,15 +21,15 @@ com.github.docker-java:docker-java-api:3.4.2=latestDepForkedTestCompileClasspath com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -38,12 +39,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -52,39 +56,38 @@ com.thoughtworks.qdox:qdox:1.12.1=codenarc com.typesafe.netty:netty-reactive-streams-http:2.0.4=testRuntimeClasspath com.typesafe.netty:netty-reactive-streams:2.0.4=testRuntimeClasspath commons-codec:commons-codec:1.11=testRuntimeClasspath -commons-codec:commons-codec:1.17.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath commons-fileupload:commons-fileupload:1.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs -commons-logging:commons-logging:1.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +commons-logging:commons-logging:1.2=testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.netty:netty-buffer:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-buffer:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-buffer:4.1.53.Final=testRuntimeClasspath -io.netty:netty-codec-http2:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http2:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http2:4.1.53.Final=testRuntimeClasspath -io.netty:netty-codec-http:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http:4.1.53.Final=testRuntimeClasspath -io.netty:netty-codec:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec:4.1.53.Final=testRuntimeClasspath -io.netty:netty-common:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-common:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-common:4.1.53.Final=testRuntimeClasspath -io.netty:netty-handler:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-handler:4.1.53.Final=testRuntimeClasspath -io.netty:netty-resolver:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-resolver:4.1.53.Final=testRuntimeClasspath -io.netty:netty-transport-classes-epoll:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-classes-epoll:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport-native-epoll:4.1.53.Final=testRuntimeClasspath -io.netty:netty-transport-native-unix-common:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport-native-unix-common:4.1.53.Final=testRuntimeClasspath -io.netty:netty-transport:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.53.Final=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -94,9 +97,11 @@ org.apache.bcel:bcel:6.11.0=spotbugs org.apache.commons:commons-compress:1.24.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.apache.commons:commons-lang3:3.19.0=spotbugs org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.httpcomponents:httpclient:4.5.13=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.apache.httpcomponents.client5:httpclient5:5.6.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +org.apache.httpcomponents.core5:httpcore5-h2:5.4.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +org.apache.httpcomponents.core5:httpcore5:5.4.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +org.apache.httpcomponents:httpclient:4.5.13=testRuntimeClasspath org.apache.httpcomponents:httpcore:4.4.13=testRuntimeClasspath -org.apache.httpcomponents:httpcore:4.4.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath,testCompileClasspath @@ -118,6 +123,7 @@ org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTes org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -135,14 +141,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.2=compileClasspath,testCompileClasspath org.reactivestreams:reactive-streams:1.0.3=testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.4=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -162,45 +168,45 @@ org.tabletest:tabletest-parser:1.2.0=latestDepForkedTestCompileClasspath,latestD org.testcontainers:testcontainers:1.21.4=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs software.amazon.awssdk:annotations:2.15.35=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:annotations:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:annotations:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:apache-client:2.15.35=testRuntimeClasspath -software.amazon.awssdk:apache-client:2.44.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:apache5-client:2.48.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:auth:2.15.35=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:auth:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:auth:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:aws-core:2.15.35=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:aws-core:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:aws-core:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:aws-json-protocol:2.15.35=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:aws-json-protocol:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -software.amazon.awssdk:checksums-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -software.amazon.awssdk:checksums:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -software.amazon.awssdk:endpoints-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -software.amazon.awssdk:http-auth-aws-eventstream:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -software.amazon.awssdk:http-auth-aws:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -software.amazon.awssdk:http-auth-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -software.amazon.awssdk:http-auth:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:aws-json-protocol:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:checksums-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:checksums:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:endpoints-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:http-auth-aws-eventstream:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:http-auth-aws:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:http-auth-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:http-auth:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:http-client-spi:2.15.35=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:http-client-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -software.amazon.awssdk:identity-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -software.amazon.awssdk:json-utils:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:http-client-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:identity-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:json-utils:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:metrics-spi:2.15.35=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:metrics-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:metrics-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:netty-nio-client:2.15.35=testRuntimeClasspath -software.amazon.awssdk:netty-nio-client:2.44.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:netty-nio-client:2.48.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:profiles:2.15.35=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:profiles:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:profiles:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:protocol-core:2.15.35=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:protocol-core:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:protocol-core:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:regions:2.15.35=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:regions:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -software.amazon.awssdk:retries-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -software.amazon.awssdk:retries:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:regions:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:retries-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:retries:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:sdk-core:2.15.35=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:sdk-core:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:sdk-core:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:sfn:2.15.35=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:sfn:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -software.amazon.awssdk:third-party-jackson-core:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -software.amazon.awssdk:utils-lite:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:sfn:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:third-party-jackson-core:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:utils-lite:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:utils:2.15.35=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:utils:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:utils:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.eventstream:eventstream:1.0.1=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath empty=spotbugsPlugins diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-sns-1.0/gradle.lockfile b/dd-java-agent/instrumentation/aws-java/aws-java-sns-1.0/gradle.lockfile index 5697ea22921..35a500deef4 100644 --- a/dd-java-agent/instrumentation/aws-java/aws-java-sns-1.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/aws-java/aws-java-sns-1.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:aws-java:aws-java-sns-1.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -16,7 +17,7 @@ com.amazonaws:jmespath-java:1.12.797=latestDepForkedTestCompileClasspath,latestD com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -34,15 +35,15 @@ com.github.docker-java:docker-java-api:3.4.2=latestDepForkedTestCompileClasspath com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -52,12 +53,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -80,13 +84,13 @@ io.netty:netty-resolver:4.1.108.Final=latestDepForkedTestRuntimeClasspath,latest io.netty:netty-transport-classes-epoll:4.1.108.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.netty:netty-transport-native-unix-common:4.1.108.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.netty:netty-transport:4.1.108.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.12.7=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath junit:junit:4.13.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -119,6 +123,7 @@ org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTes org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -136,14 +141,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.4=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-sns-2.0/gradle.lockfile b/dd-java-agent/instrumentation/aws-java/aws-java-sns-2.0/gradle.lockfile index 7e941e390f1..e5d125b7c36 100644 --- a/dd-java-agent/instrumentation/aws-java/aws-java-sns-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/aws-java/aws-java-sns-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:aws-java:aws-java-sns-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.github.docker-java:docker-java-api:3.4.2=latestDepForkedTestCompileClasspath com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,19 +36,21 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okio:okio:1.17.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc -commons-codec:commons-codec:1.15=testRuntimeClasspath -commons-codec:commons-codec:1.17.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +commons-codec:commons-codec:1.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath commons-fileupload:commons-fileupload:1.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs @@ -55,31 +58,31 @@ commons-logging:commons-logging:1.2=latestDepForkedTestRuntimeClasspath,latestDe de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.netty:netty-buffer:4.1.108.Final=testRuntimeClasspath -io.netty:netty-buffer:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-buffer:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http2:4.1.108.Final=testRuntimeClasspath -io.netty:netty-codec-http2:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http2:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http:4.1.108.Final=testRuntimeClasspath -io.netty:netty-codec-http:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec:4.1.108.Final=testRuntimeClasspath -io.netty:netty-codec:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-common:4.1.108.Final=testRuntimeClasspath -io.netty:netty-common:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-common:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-handler:4.1.108.Final=testRuntimeClasspath -io.netty:netty-handler:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-resolver:4.1.108.Final=testRuntimeClasspath -io.netty:netty-resolver:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport-classes-epoll:4.1.108.Final=testRuntimeClasspath -io.netty:netty-transport-classes-epoll:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-classes-epoll:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport-native-unix-common:4.1.108.Final=testRuntimeClasspath -io.netty:netty-transport-native-unix-common:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.108.Final=testRuntimeClasspath -io.netty:netty-transport:4.1.132.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.netty:netty-transport:4.1.135.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -89,9 +92,11 @@ org.apache.bcel:bcel:6.11.0=spotbugs org.apache.commons:commons-compress:1.24.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.apache.commons:commons-lang3:3.19.0=spotbugs org.apache.commons:commons-text:1.14.0=spotbugs +org.apache.httpcomponents.client5:httpclient5:5.6.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +org.apache.httpcomponents.core5:httpcore5-h2:5.4.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +org.apache.httpcomponents.core5:httpcore5:5.4.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath org.apache.httpcomponents:httpclient:4.5.13=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.apache.httpcomponents:httpcore:4.4.13=testRuntimeClasspath -org.apache.httpcomponents:httpcore:4.4.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +org.apache.httpcomponents:httpcore:4.4.13=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath,testCompileClasspath @@ -113,6 +118,7 @@ org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTes org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -130,14 +136,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.4=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -156,56 +162,56 @@ org.testcontainers:localstack:1.21.4=latestDepForkedTestCompileClasspath,latestD org.testcontainers:testcontainers:1.21.4=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs software.amazon.awssdk:annotations:2.25.40=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:annotations:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -software.amazon.awssdk:apache-client:2.25.40=testRuntimeClasspath -software.amazon.awssdk:apache-client:2.44.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:annotations:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:apache-client:2.25.40=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +software.amazon.awssdk:apache5-client:2.48.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:auth:2.25.40=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:auth:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:auth:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:aws-core:2.25.40=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:aws-core:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:aws-core:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:aws-json-protocol:2.25.40=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath software.amazon.awssdk:aws-query-protocol:2.25.40=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:aws-query-protocol:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:aws-query-protocol:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:checksums-spi:2.25.40=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:checksums-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:checksums-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:checksums:2.25.40=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:checksums:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:checksums:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:endpoints-spi:2.25.40=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:endpoints-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -software.amazon.awssdk:http-auth-aws-eventstream:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:endpoints-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:http-auth-aws-eventstream:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:http-auth-aws:2.25.40=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:http-auth-aws:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:http-auth-aws:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:http-auth-spi:2.25.40=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:http-auth-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:http-auth-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:http-auth:2.25.40=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:http-auth:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:http-auth:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:http-client-spi:2.25.40=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:http-client-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:http-client-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:identity-spi:2.25.40=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:identity-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:identity-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:json-utils:2.25.40=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:json-utils:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:json-utils:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:metrics-spi:2.25.40=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:metrics-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:metrics-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:netty-nio-client:2.25.40=testRuntimeClasspath -software.amazon.awssdk:netty-nio-client:2.44.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:netty-nio-client:2.48.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:profiles:2.25.40=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:profiles:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:profiles:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:protocol-core:2.25.40=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:protocol-core:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:protocol-core:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:regions:2.25.40=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:regions:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -software.amazon.awssdk:retries-spi:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -software.amazon.awssdk:retries:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:regions:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:retries-spi:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:retries:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:sdk-core:2.25.40=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:sdk-core:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:sdk-core:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:sns:2.25.40=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:sns:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:sns:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:sqs:2.25.40=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath software.amazon.awssdk:third-party-jackson-core:2.25.40=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:third-party-jackson-core:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -software.amazon.awssdk:utils-lite:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:third-party-jackson-core:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:utils-lite:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.awssdk:utils:2.25.40=compileClasspath,testCompileClasspath,testRuntimeClasspath -software.amazon.awssdk:utils:2.44.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +software.amazon.awssdk:utils:2.48.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath software.amazon.eventstream:eventstream:1.0.1=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath empty=spotbugsPlugins diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-sqs-1.0/gradle.lockfile b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-1.0/gradle.lockfile index 15e9814f901..2ba0d7236ab 100644 --- a/dd-java-agent/instrumentation/aws-java/aws-java-sqs-1.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-1.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:aws-java:aws-java-sqs-1.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -19,7 +20,7 @@ com.amazonaws:jmespath-java:1.12.797=latestDepForkedTestCompileClasspath,latestD com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -37,15 +38,15 @@ com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.5.3=compileClasspath com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.6.6=testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.17.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -55,12 +56,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -80,7 +84,7 @@ commons-logging:commons-logging:1.2=compileClasspath,latestDepForkedTestCompileC de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.spray:spray-json_2.13:1.3.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:1.2.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.xml.bind:jakarta.xml.bind-api:2.3.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.jms:jms-api:1.1-rev-1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -89,8 +93,8 @@ jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.12.7=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath joda-time:joda-time:2.8.1=compileClasspath,testCompileClasspath,testRuntimeClasspath junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -136,6 +140,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepForkedTestRuntimeClasspath,latestDepTest org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -154,14 +159,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.parboiled:parboiled_2.13:2.5.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.4=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-async_2.13:1.0.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-sqs-1.0/src/main/java/datadog/trace/instrumentation/aws/v1/sqs/TracingIterator.java b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-1.0/src/main/java/datadog/trace/instrumentation/aws/v1/sqs/TracingIterator.java index 1d6f379145e..c6d6b40cc59 100644 --- a/dd-java-agent/instrumentation/aws-java/aws-java-sqs-1.0/src/main/java/datadog/trace/instrumentation/aws/v1/sqs/TracingIterator.java +++ b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-1.0/src/main/java/datadog/trace/instrumentation/aws/v1/sqs/TracingIterator.java @@ -7,8 +7,6 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateNext; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.closePrevious; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.bootstrap.instrumentation.api.URIUtils.urlFileName; import static datadog.trace.instrumentation.aws.v1.sqs.MessageExtractAdapter.GETTER; import static datadog.trace.instrumentation.aws.v1.sqs.SqsDecorator.BROKER_DECORATE; @@ -20,6 +18,7 @@ import static java.util.concurrent.TimeUnit.MILLISECONDS; import com.amazonaws.services.sqs.model.Message; +import datadog.context.Context; import datadog.trace.api.Config; import datadog.trace.api.InstrumenterConfig; import datadog.trace.api.datastreams.DataStreamsTags; @@ -50,7 +49,7 @@ public boolean hasNext() { if (InstrumenterConfig.get().isLegacyContextManagerEnabled()) { closePrevious(true); } else { - final AgentSpan previousSpan = spanFromContext(getRootContext().swap()); + final AgentSpan previousSpan = AgentSpan.fromContext(Context.root().swap()); if (previousSpan != null) { previousSpan.finishWithEndToEnd(); } @@ -71,7 +70,7 @@ protected void startNewMessageSpan(Message message) { if (InstrumenterConfig.get().isLegacyContextManagerEnabled()) { closePrevious(true); } else if (message == null) { // previous message span was the last - final AgentSpan previousSpan = spanFromContext(getRootContext().swap()); + final AgentSpan previousSpan = AgentSpan.fromContext(Context.root().swap()); if (previousSpan != null) { previousSpan.finishWithEndToEnd(); } @@ -96,7 +95,7 @@ protected void startNewMessageSpan(Message message) { MILLISECONDS.toMicros(timeInQueueStart)); BROKER_DECORATE.afterStart(queueSpan); BROKER_DECORATE.onTimeInQueue(queueSpan, queueUrl); - spanContext = queueSpan.context(); + spanContext = queueSpan.spanContext(); // The queueSpan will be finished after inner span has been activated to ensure that // spans are written out together by TraceStructureWriter when running in strict mode } @@ -114,7 +113,7 @@ protected void startNewMessageSpan(Message message) { if (InstrumenterConfig.get().isLegacyContextManagerEnabled()) { activateNext(span); } else { - final AgentSpan previousSpan = spanFromContext(span.swap()); + final AgentSpan previousSpan = AgentSpan.fromContext(span.swap()); if (previousSpan != null) { previousSpan.finishWithEndToEnd(); } diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-sqs-1.0/src/main/java/datadog/trace/instrumentation/aws/v1/sqs/TracingListIterator.java b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-1.0/src/main/java/datadog/trace/instrumentation/aws/v1/sqs/TracingListIterator.java index ba94e197866..d7f8174cd8c 100644 --- a/dd-java-agent/instrumentation/aws-java/aws-java-sqs-1.0/src/main/java/datadog/trace/instrumentation/aws/v1/sqs/TracingListIterator.java +++ b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-1.0/src/main/java/datadog/trace/instrumentation/aws/v1/sqs/TracingListIterator.java @@ -1,10 +1,9 @@ package datadog.trace.instrumentation.aws.v1.sqs; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.closePrevious; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import com.amazonaws.services.sqs.model.Message; +import datadog.context.Context; import datadog.trace.api.InstrumenterConfig; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.util.ListIterator; @@ -24,7 +23,7 @@ public boolean hasPrevious() { if (InstrumenterConfig.get().isLegacyContextManagerEnabled()) { closePrevious(true); } else { - final AgentSpan previousSpan = spanFromContext(getRootContext().swap()); + final AgentSpan previousSpan = AgentSpan.fromContext(Context.root().swap()); if (previousSpan != null) { previousSpan.finishWithEndToEnd(); } diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/gradle.lockfile b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/gradle.lockfile index c9c4b539fe5..97d9b972426 100644 --- a/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:aws-java:aws-java-sqs-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -10,20 +11,20 @@ com.amazonaws:amazon-sqs-java-messaging-lib:2.0.3=latestDepForkedTestCompileClas com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -33,12 +34,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -84,14 +88,14 @@ io.netty:netty-transport-native-unix-common:4.1.86.Final=latestDepForkedTestRunt io.netty:netty-transport:4.1.77.Final=testRuntimeClasspath io.netty:netty-transport:4.1.86.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.spray:spray-json_2.13:1.3.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.10.13=compileClasspath,testCompileClasspath,testRuntimeClasspath joda-time:joda-time:2.12.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -125,6 +129,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepForkedTestRuntimeClasspath,latestDepTest org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -142,14 +147,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.3=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-async_2.13:1.0.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-java8-compat_2.13:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/SqsMd5ChecksumInterceptorInstrumentation.java b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/SqsMd5ChecksumInterceptorInstrumentation.java new file mode 100644 index 00000000000..074f09ca47c --- /dev/null +++ b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/SqsMd5ChecksumInterceptorInstrumentation.java @@ -0,0 +1,36 @@ +package datadog.trace.instrumentation.aws.v2.sqs; + +import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static net.bytebuddy.matcher.ElementMatchers.isMethod; + +import datadog.trace.agent.tooling.Instrumenter; +import net.bytebuddy.asm.Advice; + +public final class SqsMd5ChecksumInterceptorInstrumentation + implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { + + @Override + public String instrumentedType() { + // The AWS SDK checksum interceptor reads ReceiveMessageResponse.messages() while finalizing + // the response. Mark that internal access so we only wrap messages for application code. + return "software.amazon.awssdk.services.sqs.internal.MessageMD5ChecksumInterceptor"; + } + + @Override + public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvice( + isMethod().and(named("afterExecution")), getClass().getName() + "$AfterExecutionAdvice"); + } + + public static class AfterExecutionAdvice { + @Advice.OnMethodEnter(suppress = Throwable.class) + public static void onEnter() { + SqsReceiveResponseInternalAccess.enter(); + } + + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + public static void onExit() { + SqsReceiveResponseInternalAccess.exit(); + } + } +} diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/SqsModule.java b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/SqsModule.java index 5db7932aeef..4d2fe577bd1 100644 --- a/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/SqsModule.java +++ b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/SqsModule.java @@ -5,7 +5,6 @@ import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.api.InstrumenterConfig; import java.util.ArrayList; -import java.util.Collections; import java.util.List; import java.util.Map; @@ -24,6 +23,7 @@ public String[] helperClassNames() { "datadog.trace.instrumentation.aws.v2.sqs.MessageAttributeInjector", "datadog.trace.instrumentation.aws.v2.sqs.MessageExtractAdapter", "datadog.trace.instrumentation.aws.v2.sqs.SqsDecorator", + "datadog.trace.instrumentation.aws.v2.sqs.SqsReceiveResponseInternalAccess", "datadog.trace.instrumentation.aws.v2.sqs.TracingIterator", "datadog.trace.instrumentation.aws.v2.sqs.TracingList", "datadog.trace.instrumentation.aws.v2.sqs.TracingListIterator" @@ -32,17 +32,25 @@ public String[] helperClassNames() { @Override public Map contextStore() { - return Collections.singletonMap( + Map contextStore = new java.util.HashMap<>(); + contextStore.put( "software.amazon.awssdk.services.sqs.model.ReceiveMessageResponse", "java.lang.String"); + contextStore.put( + "software.amazon.awssdk.services.sqs.model.ReceiveMessageResponse$BuilderImpl", + "java.lang.String"); + return contextStore; } @Override public List typeInstrumentations() { - final List ret = new ArrayList<>(4); + final List ret = new ArrayList<>(6); ret.add(new SqsClientInstrumentation()); ret.add(new SqsReceiveRequestInstrumentation()); // we don't need to instrument messages when we're doing legacy AWS-SDK tracing if (!InstrumenterConfig.get().isLegacyInstrumentationEnabled(false, "aws-sdk")) { + ret.add(new SqsMd5ChecksumInterceptorInstrumentation()); + ret.add(new SqsReceiveResponseBuilderInstrumentation()); + ret.add(new SqsReceiveResponseBuilderImplInstrumentation()); ret.add(new SqsReceiveResultInstrumentation()); } return ret; diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/SqsReceiveResponseBuilderImplInstrumentation.java b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/SqsReceiveResponseBuilderImplInstrumentation.java new file mode 100644 index 00000000000..9b6266ef0ad --- /dev/null +++ b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/SqsReceiveResponseBuilderImplInstrumentation.java @@ -0,0 +1,54 @@ +package datadog.trace.instrumentation.aws.v2.sqs; + +import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static net.bytebuddy.matcher.ElementMatchers.isMethod; +import static net.bytebuddy.matcher.ElementMatchers.returns; +import static net.bytebuddy.matcher.ElementMatchers.takesNoArguments; + +import datadog.trace.agent.tooling.Instrumenter; +import datadog.trace.bootstrap.ContextStore; +import datadog.trace.bootstrap.InstrumentationContext; +import net.bytebuddy.asm.Advice; +import software.amazon.awssdk.services.sqs.model.ReceiveMessageResponse; + +public final class SqsReceiveResponseBuilderImplInstrumentation + implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { + + private static final String BUILDER_IMPL = + "software.amazon.awssdk.services.sqs.model.ReceiveMessageResponse$BuilderImpl"; + + @Override + public String instrumentedType() { + return BUILDER_IMPL; + } + + @Override + public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvice( + isMethod() + .and(named("build")) + .and(takesNoArguments()) + .and( + returns(named("software.amazon.awssdk.services.sqs.model.ReceiveMessageResponse"))), + getClass().getName() + "$BuildAdvice"); + } + + public static class BuildAdvice { + @Advice.OnMethodExit(suppress = Throwable.class) + public static void onExit( + @Advice.This Object builder, @Advice.Return ReceiveMessageResponse response) { + if (response == null) { + return; + } + ContextStore builderStore = + InstrumentationContext.get(BUILDER_IMPL, "java.lang.String"); + String queueUrl = builderStore.get(builder); + if (queueUrl != null) { + // Complete the handoff from the pre-rebuild response to the final response user code + // sees. + InstrumentationContext.get(ReceiveMessageResponse.class, String.class) + .put(response, queueUrl); + } + } + } +} diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/SqsReceiveResponseBuilderInstrumentation.java b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/SqsReceiveResponseBuilderInstrumentation.java new file mode 100644 index 00000000000..3fc1ffeb55d --- /dev/null +++ b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/SqsReceiveResponseBuilderInstrumentation.java @@ -0,0 +1,53 @@ +package datadog.trace.instrumentation.aws.v2.sqs; + +import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static net.bytebuddy.matcher.ElementMatchers.isMethod; +import static net.bytebuddy.matcher.ElementMatchers.returns; +import static net.bytebuddy.matcher.ElementMatchers.takesNoArguments; + +import datadog.trace.agent.tooling.Instrumenter; +import datadog.trace.bootstrap.InstrumentationContext; +import net.bytebuddy.asm.Advice; +import software.amazon.awssdk.services.sqs.model.ReceiveMessageResponse; + +public final class SqsReceiveResponseBuilderInstrumentation + implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { + + private static final String BUILDER_IMPL = + "software.amazon.awssdk.services.sqs.model.ReceiveMessageResponse$BuilderImpl"; + + @Override + public String instrumentedType() { + return "software.amazon.awssdk.services.sqs.model.ReceiveMessageResponse"; + } + + @Override + public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvice( + isMethod() + .and(named("toBuilder")) + .and(takesNoArguments()) + .and( + returns( + named( + "software.amazon.awssdk.services.sqs.model.ReceiveMessageResponse$Builder"))), + getClass().getName() + "$ToBuilderAdvice"); + } + + public static class ToBuilderAdvice { + @Advice.OnMethodExit(suppress = Throwable.class) + public static void onExit( + @Advice.This ReceiveMessageResponse response, @Advice.Return Object builder) { + if (builder == null) { + return; + } + String queueUrl = + InstrumentationContext.get(ReceiveMessageResponse.class, String.class).get(response); + if (queueUrl != null) { + // AWS SDK core finalizes modeled responses through response.toBuilder().build(). + // Carry queueUrl onto the builder so it survives that response instance change. + InstrumentationContext.get(BUILDER_IMPL, "java.lang.String").put(builder, queueUrl); + } + } + } +} diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/SqsReceiveResponseInternalAccess.java b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/SqsReceiveResponseInternalAccess.java new file mode 100644 index 00000000000..aa73af23641 --- /dev/null +++ b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/SqsReceiveResponseInternalAccess.java @@ -0,0 +1,20 @@ +package datadog.trace.instrumentation.aws.v2.sqs; + +import datadog.trace.bootstrap.CallDepthThreadLocalMap; + +public final class SqsReceiveResponseInternalAccess { + + private SqsReceiveResponseInternalAccess() {} + + public static void enter() { + CallDepthThreadLocalMap.incrementCallDepth(SqsReceiveResponseInternalAccess.class); + } + + public static void exit() { + CallDepthThreadLocalMap.decrementCallDepth(SqsReceiveResponseInternalAccess.class); + } + + public static boolean active() { + return CallDepthThreadLocalMap.getCallDepth(SqsReceiveResponseInternalAccess.class) > 0; + } +} diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/SqsReceiveResultInstrumentation.java b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/SqsReceiveResultInstrumentation.java index 148fd04479a..9b53fd8a316 100644 --- a/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/SqsReceiveResultInstrumentation.java +++ b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/SqsReceiveResultInstrumentation.java @@ -29,6 +29,11 @@ public static class GetMessagesAdvice { public static void onExit( @Advice.This ReceiveMessageResponse result, @Advice.Return(readOnly = false) List messages) { + if (SqsReceiveResponseInternalAccess.active()) { + // AWS SDK's MD5 checksum interceptor calls messages() during afterExecution. That should + // not create consumer spans; those belong around application message processing. + return; + } if (messages != null && !messages.isEmpty() && !(messages instanceof TracingList)) { String queueUrl = InstrumentationContext.get(ReceiveMessageResponse.class, String.class).get(result); diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/TracingIterator.java b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/TracingIterator.java index 8a1214447c3..2ea90670408 100644 --- a/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/TracingIterator.java +++ b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/TracingIterator.java @@ -7,8 +7,6 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateNext; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.closePrevious; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.bootstrap.instrumentation.api.URIUtils.urlFileName; import static datadog.trace.instrumentation.aws.v2.sqs.MessageExtractAdapter.GETTER; import static datadog.trace.instrumentation.aws.v2.sqs.SqsDecorator.BROKER_DECORATE; @@ -19,6 +17,7 @@ import static datadog.trace.instrumentation.aws.v2.sqs.SqsDecorator.TIME_IN_QUEUE_ENABLED; import static java.util.concurrent.TimeUnit.MILLISECONDS; +import datadog.context.Context; import datadog.trace.api.Config; import datadog.trace.api.InstrumenterConfig; import datadog.trace.api.datastreams.DataStreamsTags; @@ -52,7 +51,7 @@ public boolean hasNext() { if (InstrumenterConfig.get().isLegacyContextManagerEnabled()) { closePrevious(true); } else { - final AgentSpan previousSpan = spanFromContext(getRootContext().swap()); + final AgentSpan previousSpan = AgentSpan.fromContext(Context.root().swap()); if (previousSpan != null) { previousSpan.finishWithEndToEnd(); } @@ -73,7 +72,7 @@ protected void startNewMessageSpan(Message message) { if (InstrumenterConfig.get().isLegacyContextManagerEnabled()) { closePrevious(true); } else if (message == null) { // previous message span was the last - final AgentSpan previousSpan = spanFromContext(getRootContext().swap()); + final AgentSpan previousSpan = AgentSpan.fromContext(Context.root().swap()); if (previousSpan != null) { previousSpan.finishWithEndToEnd(); } @@ -98,7 +97,7 @@ protected void startNewMessageSpan(Message message) { MILLISECONDS.toMicros(timeInQueueStart)); BROKER_DECORATE.afterStart(queueSpan); BROKER_DECORATE.onTimeInQueue(queueSpan, queueUrl, requestId); - spanContext = queueSpan.context(); + spanContext = queueSpan.spanContext(); // The queueSpan will be finished after inner span has been activated to ensure that // spans are written out together by TraceStructureWriter when running in strict mode } @@ -116,7 +115,7 @@ protected void startNewMessageSpan(Message message) { if (InstrumenterConfig.get().isLegacyContextManagerEnabled()) { activateNext(span); } else { - final AgentSpan previousSpan = spanFromContext(span.swap()); + final AgentSpan previousSpan = AgentSpan.fromContext(span.swap()); if (previousSpan != null) { previousSpan.finishWithEndToEnd(); } diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/TracingListIterator.java b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/TracingListIterator.java index 8277937ea52..f3f471db89d 100644 --- a/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/TracingListIterator.java +++ b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/main/java/datadog/trace/instrumentation/aws/v2/sqs/TracingListIterator.java @@ -1,9 +1,8 @@ package datadog.trace.instrumentation.aws.v2.sqs; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.closePrevious; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; +import datadog.context.Context; import datadog.trace.api.InstrumenterConfig; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.util.ListIterator; @@ -24,7 +23,7 @@ public boolean hasPrevious() { if (InstrumenterConfig.get().isLegacyContextManagerEnabled()) { closePrevious(true); } else { - final AgentSpan previousSpan = spanFromContext(getRootContext().swap()); + final AgentSpan previousSpan = AgentSpan.fromContext(Context.root().swap()); if (previousSpan != null) { previousSpan.finishWithEndToEnd(); } diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/test/groovy/SqsClientTest.groovy b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/test/groovy/SqsClientTest.groovy deleted file mode 100644 index 0b8bbdc9207..00000000000 --- a/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/test/groovy/SqsClientTest.groovy +++ /dev/null @@ -1,683 +0,0 @@ -import static datadog.trace.agent.test.utils.TraceUtils.basicSpan -import static java.nio.charset.StandardCharsets.UTF_8 -import datadog.trace.api.config.TraceInstrumentationConfig - -import com.amazon.sqs.javamessaging.ProviderConfiguration -import com.amazon.sqs.javamessaging.SQSConnectionFactory -import datadog.trace.agent.test.naming.VersionedNamingTestBase -import datadog.trace.agent.test.utils.TraceUtils -import datadog.trace.api.Config -import datadog.trace.api.DDSpanId -import datadog.trace.api.DDSpanTypes -import datadog.trace.api.DDTags -import datadog.trace.api.config.GeneralConfig -import datadog.trace.api.naming.SpanNaming -import datadog.trace.bootstrap.instrumentation.api.InstrumentationTags -import datadog.trace.bootstrap.instrumentation.api.Tags -import datadog.trace.core.datastreams.StatsGroup -import datadog.trace.instrumentation.aws.ExpectedQueryParams -import datadog.trace.instrumentation.aws.v2.sqs.TracingList -import javax.jms.Session -import org.elasticmq.rest.sqs.SQSRestServerBuilder -import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider -import software.amazon.awssdk.core.SdkBytes -import software.amazon.awssdk.core.SdkSystemSetting -import software.amazon.awssdk.regions.Region -import software.amazon.awssdk.services.sqs.SqsClient -import software.amazon.awssdk.services.sqs.model.CreateQueueRequest -import software.amazon.awssdk.services.sqs.model.Message -import software.amazon.awssdk.services.sqs.model.MessageAttributeValue -import software.amazon.awssdk.services.sqs.model.ReceiveMessageRequest -import software.amazon.awssdk.services.sqs.model.SendMessageRequest -import spock.lang.IgnoreIf -import spock.lang.Shared - -abstract class SqsClientTest extends VersionedNamingTestBase { - - def setup() { - System.setProperty(SdkSystemSetting.AWS_ACCESS_KEY_ID.property(), "my-access-key") - System.setProperty(SdkSystemSetting.AWS_SECRET_ACCESS_KEY.property(), "my-secret-key") - } - - @Override - protected void configurePreAgent() { - super.configurePreAgent() - // Set a service name that gets sorted early with SORT_BY_NAMES - injectSysConfig(GeneralConfig.SERVICE_NAME, "A-service") - injectSysConfig(GeneralConfig.DATA_STREAMS_ENABLED, isDataStreamsEnabled().toString()) - } - - @Shared - def credentialsProvider = AnonymousCredentialsProvider.create() - @Shared - def server = SQSRestServerBuilder.withInterface("localhost").withDynamicPort().start() - @Shared - def address = server.waitUntilStarted().localAddress() - @Shared - def endpoint = URI.create("http://localhost:${address.port}") - - def cleanupSpec() { - if (server != null) { - try { - server.stopAndWait() - } catch (InterruptedException ie) { - Thread.currentThread().interrupt() - } - } - } - - @Override - String operation() { - null - } - - @Override - String service() { - null - } - - boolean hasTimeInQueueSpan() { - false - } - - abstract String expectedOperation(String awsService, String awsOperation) - - abstract String expectedService(String awsService, String awsOperation) - - def "trace details propagated via SQS system message attributes"() { - setup: - def client = SqsClient.builder() - .region(Region.EU_CENTRAL_1) - .endpointOverride(endpoint) - .credentialsProvider(credentialsProvider) - .build() - def queueUrl = client.createQueue(CreateQueueRequest.builder().queueName('somequeue').build()).queueUrl() - TEST_WRITER.clear() - - when: - TraceUtils.runUnderTrace('parent', { - client.sendMessage(SendMessageRequest.builder().queueUrl(queueUrl).messageBody('sometext').build()) - }) - def messages = client.receiveMessage(ReceiveMessageRequest.builder().queueUrl(queueUrl).build()).messages() - - if (isDataStreamsEnabled()) { - TEST_DATA_STREAMS_WRITER.waitForGroups(2) - } - - messages.forEach {/* consume to create message spans */ } - - then: - def sendSpan - assertTraces(2) { - trace(2) { - basicSpan(it, "parent") - span { - serviceName expectedService("Sqs", "SendMessage") - operationName expectedOperation("Sqs", "SendMessage") - resourceName "Sqs.SendMessage" - spanType DDSpanTypes.HTTP_CLIENT - errored false - measured true - childOf(span(0)) - tags { - "$Tags.COMPONENT" "java-aws-sdk" - "$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT - "$Tags.HTTP_METHOD" "POST" - "$Tags.HTTP_STATUS" 200 - "$Tags.PEER_PORT" address.port - "$Tags.PEER_HOSTNAME" "localhost" - "aws.service" "Sqs" - "aws_service" "Sqs" - "aws.operation" "SendMessage" - "aws.agent" "java-aws-sdk" - "aws.queue.url" "http://localhost:${address.port}/000000000000/somequeue" - "aws.requestId" "00000000-0000-0000-0000-000000000000" - if ({ isDataStreamsEnabled() }) { - "$DDTags.PATHWAY_HASH" { String } - } - urlTags("http://localhost:${address.port}/", ExpectedQueryParams.getExpectedQueryParams("SendMessage")) - serviceNameSource("java-aws-sdk") - defaultTags() - } - } - sendSpan = span(1) - } - trace(1) { - span { - serviceName expectedService("Sqs", "ReceiveMessage") - operationName expectedOperation("Sqs", "ReceiveMessage") - resourceName "Sqs.ReceiveMessage" - spanType DDSpanTypes.MESSAGE_CONSUMER - errored false - measured true - childOf(sendSpan) - tags { - "$Tags.COMPONENT" "java-aws-sdk" - "$Tags.SPAN_KIND" Tags.SPAN_KIND_CONSUMER - "aws.service" "Sqs" - "aws_service" "Sqs" - "aws.operation" "ReceiveMessage" - "aws.agent" "java-aws-sdk" - "aws.queue.url" "http://localhost:${address.port}/000000000000/somequeue" - "aws.requestId" "00000000-0000-0000-0000-000000000000" - if ({ isDataStreamsEnabled() }) { - "$DDTags.PATHWAY_HASH" { String } - } - defaultTags(true) - } - } - } - } - - and: - if (isDataStreamsEnabled()) { - StatsGroup first = TEST_DATA_STREAMS_WRITER.groups.find { it.parentHash == 0 } - - verifyAll(first) { - tags.hasAllTags("direction:out", "topic:somequeue", "type:sqs") - } - - StatsGroup second = TEST_DATA_STREAMS_WRITER.groups.find { it.parentHash == first.hash } - verifyAll(second) { - tags.hasAllTags("direction:in", "topic:somequeue", "type:sqs") - } - } - - assert messages[0].attributesAsStrings()['AWSTraceHeader'] =~ - /Root=1-[0-9a-f]{8}-00000000${sendSpan.traceId.toHexStringPadded(16)};Parent=${DDSpanId.toHexStringPadded(sendSpan.spanId)};Sampled=1/ - - cleanup: - client.close() - } - - def "dadatog context is not injected if SqsInjectDatadogAttribute is disabled"() { - setup: - injectSysConfig("sqs.inject.datadog.attribute.enabled", "false") - def client = SqsClient.builder() - .region(Region.EU_CENTRAL_1) - .endpointOverride(endpoint) - .credentialsProvider(credentialsProvider) - .build() - def queueUrl = client.createQueue(CreateQueueRequest.builder().queueName('somequeue').build()).queueUrl() - TEST_WRITER.clear() - - when: - client.sendMessage(SendMessageRequest.builder().queueUrl(queueUrl).messageBody('sometext').build()) - def messages = client.receiveMessage(ReceiveMessageRequest.builder().queueUrl(queueUrl).build()).messages() - - if (isDataStreamsEnabled()) { - TEST_DATA_STREAMS_WRITER.waitForGroups(1) - } - - then: - assert !messages[0].messageAttributes().containsKey("_datadog") - - cleanup: - client.close() - } - def "APM trace context is injected into _datadog message attribute on send"() { - setup: - def client = SqsClient.builder() - .region(Region.EU_CENTRAL_1) - .endpointOverride(endpoint) - .credentialsProvider(credentialsProvider) - .build() - def queueUrl = client.createQueue(CreateQueueRequest.builder().queueName('somequeue').build()).queueUrl() - TEST_WRITER.clear() - - when: - TraceUtils.runUnderTrace('parent', { - client.sendMessage(SendMessageRequest.builder().queueUrl(queueUrl).messageBody('sometext').build()) - }) - def messages = client.receiveMessage(ReceiveMessageRequest.builder().queueUrl(queueUrl).build()).messages() - - if (isDataStreamsEnabled()) { - TEST_DATA_STREAMS_WRITER.waitForGroups(2) - } - - messages.forEach {/* consume to create message spans */ } - - then: - def sendSpan - assertTraces(2) { - trace(2) { - basicSpan(it, 'parent') - span { - serviceName expectedService("Sqs", "SendMessage") - operationName expectedOperation("Sqs", "SendMessage") - resourceName "Sqs.SendMessage" - spanType DDSpanTypes.HTTP_CLIENT - errored false - measured true - childOf(span(0)) - tags { - "$Tags.COMPONENT" "java-aws-sdk" - "$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT - "$Tags.HTTP_METHOD" "POST" - "$Tags.HTTP_STATUS" 200 - "$Tags.PEER_PORT" address.port - "$Tags.PEER_HOSTNAME" "localhost" - "aws.service" "Sqs" - "aws_service" "Sqs" - "aws.operation" "SendMessage" - "aws.agent" "java-aws-sdk" - "aws.queue.url" "http://localhost:${address.port}/000000000000/somequeue" - "aws.requestId" "00000000-0000-0000-0000-000000000000" - if ({ isDataStreamsEnabled() }) { - "$DDTags.PATHWAY_HASH" { String } - } - urlTags("http://localhost:${address.port}/", ExpectedQueryParams.getExpectedQueryParams("SendMessage")) - serviceNameSource("java-aws-sdk") - defaultTags() - } - } - sendSpan = span(1) - } - trace(1) { - span { - serviceName expectedService("Sqs", "ReceiveMessage") - operationName expectedOperation("Sqs", "ReceiveMessage") - resourceName "Sqs.ReceiveMessage" - spanType DDSpanTypes.MESSAGE_CONSUMER - errored false - measured true - childOf(sendSpan) - tags { - "$Tags.COMPONENT" "java-aws-sdk" - "$Tags.SPAN_KIND" Tags.SPAN_KIND_CONSUMER - "aws.service" "Sqs" - "aws_service" "Sqs" - "aws.operation" "ReceiveMessage" - "aws.agent" "java-aws-sdk" - "aws.queue.url" "http://localhost:${address.port}/000000000000/somequeue" - "aws.requestId" "00000000-0000-0000-0000-000000000000" - if ({ isDataStreamsEnabled() }) { - "$DDTags.PATHWAY_HASH" { String } - } - defaultTags(true) - } - } - } - } - - def ddAttr = messages[0].messageAttributes()['_datadog'] - ddAttr != null - ddAttr.dataType() == 'String' - ddAttr.stringValue().contains('"x-datadog-trace-id"') - ddAttr.stringValue().contains(sendSpan.traceId.toString()) - ddAttr.stringValue().contains('"x-datadog-parent-id"') - ddAttr.stringValue().contains(Long.toUnsignedString(sendSpan.spanId)) - - cleanup: - client.close() - } - - @IgnoreIf({instance.isDataStreamsEnabled()}) - def "trace details propagated via embedded SQS message attribute (string)"() { - setup: - TEST_WRITER.clear() - - when: - def message = Message.builder().messageAttributes(['_datadog': MessageAttributeValue.builder().dataType('String').stringValue( - "{\"x-datadog-trace-id\": \"4948377316357291421\", \"x-datadog-parent-id\": \"6746998015037429512\", \"x-datadog-sampling-priority\": \"1\"}" - ).build()]).build() - def messages = new TracingList([message], - "http://localhost:${address.port}/000000000000/somequeue", - "00000000-0000-0000-0000-000000000000") - - messages.forEach {/* consume to create message spans */ } - - then: - assertTraces(1) { - trace(1) { - span { - serviceName expectedService("Sqs", "ReceiveMessage") - operationName expectedOperation("Sqs", "ReceiveMessage") - resourceName "Sqs.ReceiveMessage" - spanType DDSpanTypes.MESSAGE_CONSUMER - errored false - measured true - traceId(4948377316357291421 as BigInteger) - parentSpanId(6746998015037429512 as BigInteger) - tags { - "$Tags.COMPONENT" "java-aws-sdk" - "$Tags.SPAN_KIND" Tags.SPAN_KIND_CONSUMER - "aws.service" "Sqs" - "aws_service" "Sqs" - "aws.operation" "ReceiveMessage" - "aws.agent" "java-aws-sdk" - "aws.queue.url" "http://localhost:${address.port}/000000000000/somequeue" - "aws.requestId" "00000000-0000-0000-0000-000000000000" - defaultTags(true) - } - } - } - } - } - - @IgnoreIf({instance.isDataStreamsEnabled()}) - def "trace details propagated via embedded SQS message attribute (binary)"() { - setup: - TEST_WRITER.clear() - - when: - def message = Message.builder().messageAttributes(['_datadog': MessageAttributeValue.builder().dataType('Binary').binaryValue(SdkBytes.fromByteBuffer( - headerValue - )).build()]).build() - def messages = new TracingList([message], - "http://localhost:${address.port}/000000000000/somequeue", - "00000000-0000-0000-0000-000000000000") - - messages.forEach {/* consume to create message spans */ } - - then: - assertTraces(1) { - trace(1) { - span { - serviceName expectedService("Sqs", "ReceiveMessage") - operationName expectedOperation("Sqs", "ReceiveMessage") - resourceName "Sqs.ReceiveMessage" - spanType DDSpanTypes.MESSAGE_CONSUMER - errored false - measured true - traceId(4948377316357291421 as BigInteger) - parentSpanId(6746998015037429512 as BigInteger) - tags { - "$Tags.COMPONENT" "java-aws-sdk" - "$Tags.SPAN_KIND" Tags.SPAN_KIND_CONSUMER - "aws.service" "Sqs" - "aws_service" "Sqs" - "aws.operation" "ReceiveMessage" - "aws.agent" "java-aws-sdk" - "aws.queue.url" "http://localhost:${address.port}/000000000000/somequeue" - "aws.requestId" "00000000-0000-0000-0000-000000000000" - defaultTags(true) - } - } - } - } - - where: - headerValue << [ - UTF_8.encode('{"x-datadog-trace-id":"4948377316357291421","x-datadog-parent-id":"6746998015037429512","x-datadog-sampling-priority":"1"}'), - // not sure this test case with base 64 corresponds to an actual use case - UTF_8.encode('eyJ4LWRhdGFkb2ctdHJhY2UtaWQiOiI0OTQ4Mzc3MzE2MzU3MjkxNDIxIiwieC1kYXRhZG9nLXBhcmVudC1pZCI6IjY3NDY5OTgwMTUwMzc0Mjk1MTIiLCJ4LWRhdGFkb2ctc2FtcGxpbmctcHJpb3JpdHkiOiIxIn0=') - ] - } - - @IgnoreIf({instance.isDataStreamsEnabled()}) - def "trace details propagated from SQS to JMS"() { - setup: - def client = SqsClient.builder() - .region(Region.EU_CENTRAL_1) - .endpointOverride(endpoint) - .credentialsProvider(credentialsProvider) - .build() - - def connectionFactory = new SQSConnectionFactory(new ProviderConfiguration(), client) - def connection = connectionFactory.createConnection() - def session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE) - def queue = session.createQueue('somequeue') - def consumer = session.createConsumer(queue) - - TEST_WRITER.clear() - - when: - def ddMsgAttribute = MessageAttributeValue.builder() - .dataType("Binary") - .binaryValue(SdkBytes.fromUtf8String("hello world")).build() - connection.start() - TraceUtils.runUnderTrace('parent') { - client.sendMessage(SendMessageRequest.builder() - .queueUrl(queue.queueUrl) - .messageBody('sometext') - .messageAttributes([_datadog: ddMsgAttribute]).build()) - } - def message = consumer.receive() - consumer.receiveNoWait() - - then: - def sendSpan - def timeInQueue = hasTimeInQueueSpan() - - assertTraces(4, SORT_TRACES_BY_START) { - trace(2) { - basicSpan(it, "parent") - span { - serviceName expectedService("Sqs", "SendMessage") - operationName expectedOperation("Sqs", "SendMessage") - resourceName "Sqs.SendMessage" - spanType DDSpanTypes.HTTP_CLIENT - errored false - measured true - childOf(span(0)) - tags { - "$Tags.COMPONENT" "java-aws-sdk" - "$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT - "$Tags.HTTP_METHOD" "POST" - "$Tags.HTTP_STATUS" 200 - "$Tags.PEER_PORT" address.port - "$Tags.PEER_HOSTNAME" "localhost" - "aws.service" "Sqs" - "aws_service" "Sqs" - "aws.operation" "SendMessage" - "aws.agent" "java-aws-sdk" - "aws.queue.url" "http://localhost:${address.port}/000000000000/somequeue" - "aws.requestId" "00000000-0000-0000-0000-000000000000" - urlTags("http://localhost:${address.port}/", ExpectedQueryParams.getExpectedQueryParams("SendMessage")) - serviceNameSource("java-aws-sdk") - defaultTags() - } - } - sendSpan = span(1) - } - trace(timeInQueue ? 2 : 1) { - span { - serviceName expectedService("Sqs", "ReceiveMessage") - operationName expectedOperation("Sqs", "ReceiveMessage") - resourceName "Sqs.ReceiveMessage" - spanType DDSpanTypes.MESSAGE_CONSUMER - errored false - measured true - childOf(timeInQueue ? span(1): sendSpan) - tags { - "$Tags.COMPONENT" "java-aws-sdk" - "$Tags.SPAN_KIND" Tags.SPAN_KIND_CONSUMER - "aws.service" "Sqs" - "aws_service" "Sqs" - "aws.operation" "ReceiveMessage" - "aws.agent" "java-aws-sdk" - "aws.queue.url" "http://localhost:${address.port}/000000000000/somequeue" - "aws.requestId" "00000000-0000-0000-0000-000000000000" - defaultTags(!timeInQueue) - } - } - if (timeInQueue) { - // only v1 has this automatically without legacy disabled - span { - serviceName "sqs-queue" - operationName "aws.sqs.deliver" - resourceName "Sqs.DeliverMessage" - spanType DDSpanTypes.MESSAGE_BROKER - errored false - measured true - childOf(sendSpan) - tags { - "$Tags.COMPONENT" "java-aws-sdk" - "$Tags.SPAN_KIND" Tags.SPAN_KIND_BROKER - "aws.queue.url" "http://localhost:${address.port}/000000000000/somequeue" - "aws.requestId" "00000000-0000-0000-0000-000000000000" - defaultTags(true) - } - } - } - } - trace(1) { - span { - serviceName expectedService("Sqs", "DeleteMessage") - operationName expectedOperation("Sqs", "DeleteMessage") - resourceName "Sqs.DeleteMessage" - spanType DDSpanTypes.HTTP_CLIENT - errored false - measured true - parent() - tags { - "$Tags.COMPONENT" "java-aws-sdk" - "$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT - "$Tags.HTTP_METHOD" "POST" - "$Tags.HTTP_STATUS" 200 - "$Tags.PEER_PORT" address.port - "$Tags.PEER_HOSTNAME" "localhost" - "aws.service" "Sqs" - "aws_service" "Sqs" - "aws.operation" "DeleteMessage" - "aws.agent" "java-aws-sdk" - "aws.queue.url" "http://localhost:${address.port}/000000000000/somequeue" - "aws.requestId" { it.trim() == "00000000-0000-0000-0000-000000000000" } // the test server seem messing with request id and insert \n - urlTags("http://localhost:${address.port}/", ExpectedQueryParams.getExpectedQueryParams("DeleteMessage")) - serviceNameSource("java-aws-sdk") - defaultTags() - } - } - } - trace(1) { - span { - serviceName SpanNaming.instance().namingSchema().messaging().inboundService("jms", Config.get().isJmsLegacyTracingEnabled()).get() ?: Config.get().getServiceName() - operationName SpanNaming.instance().namingSchema().messaging().inboundOperation("jms") - resourceName "Consumed from Queue somequeue" - spanType DDSpanTypes.MESSAGE_CONSUMER - errored false - measured true - childOf(sendSpan) - tags { - "$Tags.COMPONENT" "jms" - "$Tags.SPAN_KIND" Tags.SPAN_KIND_CONSUMER - "$InstrumentationTags.RECORD_QUEUE_TIME_MS" { it >= 0 } - defaultTags(true) - } - } - } - } - - def expectedTraceProperty = 'X-Amzn-Trace-Id'.toLowerCase(Locale.ENGLISH).replace('-', '__dash__') - assert message.getStringProperty(expectedTraceProperty) =~ - /Root=1-[0-9a-f]{8}-00000000${sendSpan.traceId.toHexStringPadded(16)};Parent=${DDSpanId.toHexStringPadded(sendSpan.spanId)};Sampled=1/ - assert !message.propertyExists("_datadog") - - cleanup: - session.close() - connection.stop() - client.close() - } -} - -class SqsClientV0Test extends SqsClientTest { - - @Override - String expectedOperation(String awsService, String awsOperation) { - "aws.http" - } - - @Override - String expectedService(String awsService, String awsOperation) { - if ("Sqs" == awsService) { - return "sqs" - } - return "java-aws-sdk" - } - - @Override - int version() { - 0 - } -} - -class SqsClientV1ForkedTest extends SqsClientTest { - - @Override - String expectedOperation(String awsService, String awsOperation) { - if (awsService == "Sqs") { - if (awsOperation == "ReceiveMessage") { - return "aws.sqs.process" - } else if (awsOperation == "SendMessage") { - return "aws.sqs.send" - } - } - return "aws.${awsService.toLowerCase()}.request" - } - - @Override - String expectedService(String awsService, String awsOperation) { - "A-service" - } - - @Override - int version() { - 1 - } -} - -class SqsClientV0DataStreamsTest extends SqsClientTest { - @Override - String expectedOperation(String awsService, String awsOperation) { - "aws.http" - } - - @Override - String expectedService(String awsService, String awsOperation) { - if ("Sqs" == awsService) { - return "sqs" - } - return "java-aws-sdk" - } - - @Override - boolean isDataStreamsEnabled() { - true - } - - - @Override - int version() { - 0 - } -} - -class SqsClientV1DataStreamsForkedTest extends SqsClientTest { - @Override - String expectedOperation(String awsService, String awsOperation) { - if (awsService == "Sqs") { - if (awsOperation == "ReceiveMessage") { - return "aws.sqs.process" - } else if (awsOperation == "SendMessage") { - return "aws.sqs.send" - } - } - return "aws.${awsService.toLowerCase()}.request" - } - - @Override - String expectedService(String awsService, String awsOperation) { - "A-service" - } - - @Override - boolean isDataStreamsEnabled() { - true - } - - @Override - int version() { - 1 - } -} - -class SqsClientV0ContextSwapForkedTest extends SqsClientV0Test { - @Override - protected void configurePreAgent() { - super.configurePreAgent() - injectSysConfig(TraceInstrumentationConfig.LEGACY_CONTEXT_MANAGER_ENABLED, "false") - } -} - - diff --git a/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/test/java/SqsClientTest.java b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/test/java/SqsClientTest.java new file mode 100644 index 00000000000..709f59f7ae3 --- /dev/null +++ b/dd-java-agent/instrumentation/aws-java/aws-java-sqs-2.0/src/test/java/SqsClientTest.java @@ -0,0 +1,793 @@ +import static java.nio.charset.StandardCharsets.UTF_8; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assumptions.assumeFalse; + +import com.amazon.sqs.javamessaging.ProviderConfiguration; +import com.amazon.sqs.javamessaging.SQSConnectionFactory; +import datadog.trace.agent.test.AbstractInstrumentationTest; +import datadog.trace.agent.test.utils.TraceUtils; +import datadog.trace.api.Config; +import datadog.trace.api.DDSpanId; +import datadog.trace.api.DDSpanTypes; +import datadog.trace.api.config.GeneralConfig; +import datadog.trace.api.config.TraceInstrumentationConfig; +import datadog.trace.api.config.TracerConfig; +import datadog.trace.api.naming.SpanNaming; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import datadog.trace.bootstrap.instrumentation.api.InstrumentationTags; +import datadog.trace.bootstrap.instrumentation.api.Tags; +import datadog.trace.core.DDSpan; +import datadog.trace.instrumentation.aws.v2.sqs.TracingList; +import datadog.trace.test.junit.utils.config.WithConfig; +import java.net.InetSocketAddress; +import java.net.URI; +import java.nio.ByteBuffer; +import java.util.Collections; +import java.util.List; +import java.util.Locale; +import java.util.concurrent.atomic.AtomicInteger; +import javax.jms.Connection; +import javax.jms.MessageConsumer; +import javax.jms.Queue; +import javax.jms.Session; +import org.elasticmq.rest.sqs.SQSRestServer; +import org.elasticmq.rest.sqs.SQSRestServerBuilder; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import software.amazon.awssdk.auth.credentials.AnonymousCredentialsProvider; +import software.amazon.awssdk.core.SdkBytes; +import software.amazon.awssdk.core.SdkSystemSetting; +import software.amazon.awssdk.regions.Region; +import software.amazon.awssdk.services.sqs.SqsClient; +import software.amazon.awssdk.services.sqs.model.CreateQueueRequest; +import software.amazon.awssdk.services.sqs.model.Message; +import software.amazon.awssdk.services.sqs.model.MessageAttributeValue; +import software.amazon.awssdk.services.sqs.model.ReceiveMessageRequest; +import software.amazon.awssdk.services.sqs.model.SendMessageRequest; + +@WithConfig(key = GeneralConfig.SERVICE_NAME, value = "A-service") +abstract class SqsClientTestBase extends AbstractInstrumentationTest { + private static final AnonymousCredentialsProvider CREDENTIALS_PROVIDER = + AnonymousCredentialsProvider.create(); + private static final AtomicInteger QUEUE_COUNTER = new AtomicInteger(); + private static SQSRestServer server; + private static URI endpoint; + + @BeforeAll + static void startSqsServer() { + server = SQSRestServerBuilder.withInterface("localhost").withDynamicPort().start(); + InetSocketAddress address = server.waitUntilStarted().localAddress(); + endpoint = URI.create("http://localhost:" + address.getPort()); + } + + @AfterAll + static void stopSqsServer() { + if (server != null) { + server.stopAndWait(); + server = null; + } + } + + @BeforeEach + void setUpAwsCredentials() { + System.setProperty(SdkSystemSetting.AWS_ACCESS_KEY_ID.property(), "my-access-key"); + System.setProperty(SdkSystemSetting.AWS_SECRET_ACCESS_KEY.property(), "my-secret-key"); + } + + @Test + void traceDetailsPropagatedViaSqsSystemMessageAttributes() throws Exception { + try (SqsClient client = newClient()) { + String queueUrl = createQueue(client); + writer.clear(); + + TraceUtils.runUnderTrace( + "parent", + () -> { + client.sendMessage( + SendMessageRequest.builder().queueUrl(queueUrl).messageBody("sometext").build()); + return null; + }); + List messages = + client + .receiveMessage(ReceiveMessageRequest.builder().queueUrl(queueUrl).build()) + .messages(); + messages.forEach(message -> {}); + + DDSpan sendSpan = assertSqsSendReceiveTraces(queueUrl); + assertEquals(1, messages.size()); + + String awsTraceHeader = messages.get(0).attributesAsStrings().get("AWSTraceHeader"); + assertNotNull(awsTraceHeader); + assertTrue( + awsTraceHeader.matches( + "Root=1-[0-9a-f]{8}-00000000" + + sendSpan.getTraceId().toHexStringPadded(16) + + ";Parent=" + + DDSpanId.toHexStringPadded(sendSpan.getSpanId()) + + ";Sampled=1")); + } + } + + @Test + @WithConfig(key = "sqs.inject.datadog.attribute.enabled", value = "false") + void datadogContextIsNotInjectedIfSqsInjectDatadogAttributeIsDisabled() throws Exception { + try (SqsClient client = newClient()) { + String queueUrl = createQueue(client); + writer.clear(); + + client.sendMessage( + SendMessageRequest.builder().queueUrl(queueUrl).messageBody("sometext").build()); + List messages = + client + .receiveMessage(ReceiveMessageRequest.builder().queueUrl(queueUrl).build()) + .messages(); + + assertEquals(1, messages.size()); + assertFalse(messages.get(0).messageAttributes().containsKey("_datadog")); + } + } + + @Test + void apmTraceContextIsInjectedIntoDatadogMessageAttributeOnSend() throws Exception { + try (SqsClient client = newClient()) { + String queueUrl = createQueue(client); + writer.clear(); + + TraceUtils.runUnderTrace( + "parent", + () -> { + client.sendMessage( + SendMessageRequest.builder().queueUrl(queueUrl).messageBody("sometext").build()); + return null; + }); + List messages = + client + .receiveMessage(ReceiveMessageRequest.builder().queueUrl(queueUrl).build()) + .messages(); + messages.forEach(message -> {}); + + DDSpan sendSpan = assertSqsSendReceiveTraces(queueUrl); + MessageAttributeValue datadogAttribute = messages.get(0).messageAttributes().get("_datadog"); + assertNotNull(datadogAttribute); + assertEquals("String", datadogAttribute.dataType()); + assertTrue(datadogAttribute.stringValue().contains("\"x-datadog-trace-id\"")); + assertTrue(datadogAttribute.stringValue().contains(sendSpan.getTraceId().toString())); + assertTrue(datadogAttribute.stringValue().contains("\"x-datadog-parent-id\"")); + assertTrue( + datadogAttribute.stringValue().contains(Long.toUnsignedString(sendSpan.getSpanId()))); + } + } + + @Test + void traceDetailsPropagatedViaEmbeddedSqsMessageAttributeString() throws Exception { + assumeFalse(isDataStreamsEnabled()); + + writer.clear(); + Message message = + Message.builder() + .messageAttributes( + Collections.singletonMap( + "_datadog", + MessageAttributeValue.builder() + .dataType("String") + .stringValue( + "{\"x-datadog-trace-id\": \"4948377316357291421\", " + + "\"x-datadog-parent-id\": \"6746998015037429512\", " + + "\"x-datadog-sampling-priority\": \"1\"}") + .build())) + .build(); + List messages = + new TracingList( + Collections.singletonList(message), expectedQueueUrl("somequeue"), requestId()); + + messages.forEach(ignored -> {}); + + assertEmbeddedReceiveSpan("somequeue"); + } + + @Test + void traceDetailsPropagatedViaEmbeddedSqsMessageAttributeBinary() throws Exception { + assumeFalse(isDataStreamsEnabled()); + + assertEmbeddedBinaryHeader( + UTF_8.encode( + "{\"x-datadog-trace-id\":\"4948377316357291421\"," + + "\"x-datadog-parent-id\":\"6746998015037429512\"," + + "\"x-datadog-sampling-priority\":\"1\"}")); + assertEmbeddedBinaryHeader( + UTF_8.encode( + "eyJ4LWRhdGFkb2ctdHJhY2UtaWQiOiI0OTQ4Mzc3MzE2MzU3MjkxNDIxIiwieC1kYXRhZG9n" + + "LXBhcmVudC1pZCI6IjY3NDY5OTgwMTUwMzc0Mjk1MTIiLCJ4LWRhdGFkb2ctc2FtcGxpbmct" + + "cHJpb3JpdHkiOiIxIn0=")); + } + + @Test + void traceDetailsPropagatedFromSqsToJms() throws Exception { + assumeFalse(isDataStreamsEnabled()); + + try (SqsClient client = newClient()) { + String queueName = queueName(); + String queueUrl = + client.createQueue(CreateQueueRequest.builder().queueName(queueName).build()).queueUrl(); + SQSConnectionFactory connectionFactory = + new SQSConnectionFactory(new ProviderConfiguration(), client); + Connection connection = connectionFactory.createConnection(); + Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); + Queue queue = session.createQueue(queueName); + MessageConsumer consumer = session.createConsumer(queue); + + writer.clear(); + + MessageAttributeValue datadogAttribute = + MessageAttributeValue.builder() + .dataType("Binary") + .binaryValue(SdkBytes.fromUtf8String("hello world")) + .build(); + + try { + connection.start(); + TraceUtils.runUnderTrace( + "parent", + () -> { + client.sendMessage( + SendMessageRequest.builder() + .queueUrl(queueUrl) + .messageBody("sometext") + .messageAttributes(Collections.singletonMap("_datadog", datadogAttribute)) + .build()); + return null; + }); + javax.jms.Message message = consumer.receive(); + consumer.receiveNoWait(); + + writer.waitForTraces(4); + + DDSpan parentSpan = findSpanByResource("parent"); + DDSpan sendSpan = findSpanByResource("Sqs.SendMessage"); + DDSpan receiveSpan = findSpanByResource("Sqs.ReceiveMessage"); + DDSpan deleteSpan = findSpanByResource("Sqs.DeleteMessage"); + DDSpan jmsSpan = findSpanByResource("Consumed from Queue " + queue.getQueueName()); + + assertTestSpan(parentSpan, 0); + assertAwsSpan( + sendSpan, + expectedService("Sqs", "SendMessage"), + expectedOperation("Sqs", "SendMessage"), + "Sqs.SendMessage", + DDSpanTypes.HTTP_CLIENT, + Tags.SPAN_KIND_CLIENT, + "SendMessage", + parentSpan.getSpanId(), + queueUrl); + assertEquals(parentSpan.getTraceId(), sendSpan.getTraceId()); + + assertAwsSpan( + receiveSpan, + expectedService("Sqs", "ReceiveMessage"), + expectedOperation("Sqs", "ReceiveMessage"), + "Sqs.ReceiveMessage", + DDSpanTypes.MESSAGE_CONSUMER, + Tags.SPAN_KIND_CONSUMER, + "ReceiveMessage", + sendSpan.getSpanId(), + queueUrl); + assertEquals(sendSpan.getTraceId(), receiveSpan.getTraceId()); + + assertAwsSpan( + deleteSpan, + expectedService("Sqs", "DeleteMessage"), + expectedOperation("Sqs", "DeleteMessage"), + "Sqs.DeleteMessage", + DDSpanTypes.HTTP_CLIENT, + Tags.SPAN_KIND_CLIENT, + "DeleteMessage", + 0, + queueUrl); + + assertNotNull(jmsSpan); + assertEquals(expectedJmsService(), jmsSpan.getServiceName()); + assertEquals(expectedJmsOperation(), jmsSpan.getOperationName().toString()); + assertEquals(DDSpanTypes.MESSAGE_CONSUMER, jmsSpan.getSpanType()); + assertEquals(sendSpan.getSpanId(), jmsSpan.getParentId()); + assertEquals(sendSpan.getTraceId(), jmsSpan.getTraceId()); + assertEquals("jms", tagValue(jmsSpan, Tags.COMPONENT)); + assertEquals(Tags.SPAN_KIND_CONSUMER, tagValue(jmsSpan, Tags.SPAN_KIND)); + assertNotNull(jmsSpan.getTag(InstrumentationTags.RECORD_QUEUE_TIME_MS)); + + String expectedTraceProperty = + "X-Amzn-Trace-Id".toLowerCase(Locale.ENGLISH).replace("-", "__dash__"); + assertTrue( + message + .getStringProperty(expectedTraceProperty) + .matches( + "Root=1-[0-9a-f]{8}-00000000" + + sendSpan.getTraceId().toHexStringPadded(16) + + ";Parent=" + + DDSpanId.toHexStringPadded(sendSpan.getSpanId()) + + ";Sampled=1")); + assertFalse(message.propertyExists("_datadog")); + } finally { + session.close(); + connection.stop(); + } + } + } + + abstract String expectedOperation(String awsService, String awsOperation); + + abstract String expectedService(String awsService, String awsOperation); + + boolean isDataStreamsEnabled() { + return false; + } + + private SqsClient newClient() { + return SqsClient.builder() + .region(Region.EU_CENTRAL_1) + .endpointOverride(endpoint) + .credentialsProvider(CREDENTIALS_PROVIDER) + .build(); + } + + private static String createQueue(SqsClient client) { + return client + .createQueue(CreateQueueRequest.builder().queueName(queueName()).build()) + .queueUrl(); + } + + private static String queueName() { + return "somequeue" + QUEUE_COUNTER.incrementAndGet(); + } + + private DDSpan assertSqsSendReceiveTraces(String queueUrl) throws Exception { + writer.waitForTraces(2); + + DDSpan parentSpan = findSpanByResource("parent"); + DDSpan sendSpan = findSpanByResource("Sqs.SendMessage"); + DDSpan receiveSpan = findSpanByResource("Sqs.ReceiveMessage"); + + assertEquals(2, writer.size(), () -> "Unexpected traces: " + writer); + assertEquals(3, spanCount(), () -> "Unexpected spans: " + writer); + + assertTestSpan(parentSpan, 0); + assertAwsSpan( + sendSpan, + expectedService("Sqs", "SendMessage"), + expectedOperation("Sqs", "SendMessage"), + "Sqs.SendMessage", + DDSpanTypes.HTTP_CLIENT, + Tags.SPAN_KIND_CLIENT, + "SendMessage", + parentSpan.getSpanId(), + queueUrl); + assertEquals(parentSpan.getTraceId(), sendSpan.getTraceId()); + + assertAwsSpan( + receiveSpan, + expectedService("Sqs", "ReceiveMessage"), + expectedOperation("Sqs", "ReceiveMessage"), + "Sqs.ReceiveMessage", + DDSpanTypes.MESSAGE_CONSUMER, + Tags.SPAN_KIND_CONSUMER, + "ReceiveMessage", + sendSpan.getSpanId(), + queueUrl); + assertEquals(sendSpan.getTraceId(), receiveSpan.getTraceId()); + + return sendSpan; + } + + private void assertEmbeddedBinaryHeader(ByteBuffer headerValue) throws Exception { + writer.clear(); + Message message = + Message.builder() + .messageAttributes( + Collections.singletonMap( + "_datadog", + MessageAttributeValue.builder() + .dataType("Binary") + .binaryValue(SdkBytes.fromByteBuffer(headerValue)) + .build())) + .build(); + List messages = + new TracingList( + Collections.singletonList(message), expectedQueueUrl("somequeue"), requestId()); + + messages.forEach(ignored -> {}); + + assertEmbeddedReceiveSpan("somequeue"); + } + + private void assertEmbeddedReceiveSpan(String queueName) throws Exception { + writer.waitForTraces(1); + + DDSpan receiveSpan = findSpanByResource("Sqs.ReceiveMessage"); + assertEquals(1, writer.size(), () -> "Unexpected traces: " + writer); + assertEquals(1, spanCount(), () -> "Unexpected spans: " + writer); + assertAwsSpan( + receiveSpan, + expectedService("Sqs", "ReceiveMessage"), + expectedOperation("Sqs", "ReceiveMessage"), + "Sqs.ReceiveMessage", + DDSpanTypes.MESSAGE_CONSUMER, + Tags.SPAN_KIND_CONSUMER, + "ReceiveMessage", + 6746998015037429512L, + expectedQueueUrl(queueName)); + assertEquals(4948377316357291421L, receiveSpan.getTraceId().toLong()); + } + + private static void assertTestSpan(DDSpan span, long parentId) { + assertNotNull(span); + assertEquals(parentId, span.getParentId()); + assertFalse(span.isError()); + } + + private static void assertAwsSpan( + DDSpan span, + String serviceName, + String operationName, + String resourceName, + String spanType, + String spanKind, + String awsOperation, + long parentId, + String queueUrl) { + assertNotNull(span); + assertEquals(serviceName, span.getServiceName()); + assertEquals(operationName, span.getOperationName().toString()); + assertEquals(resourceName, span.getResourceName().toString()); + assertEquals(spanType, span.getSpanType()); + assertEquals(parentId, span.getParentId()); + assertFalse(span.isError()); + assertEquals("java-aws-sdk", tagValue(span, Tags.COMPONENT)); + assertEquals(spanKind, tagValue(span, Tags.SPAN_KIND)); + assertEquals("Sqs", tagValue(span, "aws.service")); + assertEquals("Sqs", tagValue(span, "aws_service")); + assertEquals(awsOperation, tagValue(span, "aws.operation")); + assertEquals("java-aws-sdk", tagValue(span, "aws.agent")); + assertEquals(queueUrl, tagValue(span, "aws.queue.url")); + assertEquals(requestId(), tagValue(span, "aws.requestId").trim()); + } + + private static String tagValue(DDSpan span, String tagName) { + Object value = span.getTag(tagName); + return value == null ? null : value.toString(); + } + + private static DDSpan findSpanByResource(String resourceName) { + for (List trace : writer) { + for (DDSpan span : trace) { + if (resourceName.equals(span.getResourceName().toString())) { + return span; + } + } + } + return null; + } + + private static int spanCount() { + int count = 0; + for (List trace : writer) { + count += trace.size(); + } + return count; + } + + private static String expectedQueueUrl(String queueName) { + return endpoint + "/000000000000/" + queueName; + } + + private static String requestId() { + return "00000000-0000-0000-0000-000000000000"; + } + + private static String expectedJmsService() { + String service = + SpanNaming.instance() + .namingSchema() + .messaging() + .inboundService("jms", Config.get().isJmsLegacyTracingEnabled()) + .get(); + return service == null ? Config.get().getServiceName() : service; + } + + private static String expectedJmsOperation() { + return SpanNaming.instance().namingSchema().messaging().inboundOperation("jms"); + } +} + +@WithConfig(key = TracerConfig.TRACE_SPAN_ATTRIBUTE_SCHEMA, value = "v0") +abstract class SqsClientV0TestBase extends SqsClientTestBase { + @Override + String expectedOperation(String awsService, String awsOperation) { + return "aws.http"; + } + + @Override + String expectedService(String awsService, String awsOperation) { + if ("Sqs".equals(awsService)) { + return "sqs"; + } + return "java-aws-sdk"; + } +} + +@WithConfig(key = GeneralConfig.DATA_STREAMS_ENABLED, value = "false") +class SqsClientV0Test extends SqsClientV0TestBase {} + +@WithConfig(key = GeneralConfig.DATA_STREAMS_ENABLED, value = "true") +class SqsClientV0DataStreamsTest extends SqsClientV0TestBase { + @Override + boolean isDataStreamsEnabled() { + return true; + } +} + +@WithConfig(key = GeneralConfig.DATA_STREAMS_ENABLED, value = "false") +@WithConfig(key = TraceInstrumentationConfig.LEGACY_CONTEXT_MANAGER_ENABLED, value = "false") +class SqsClientV0ContextSwapForkedTest extends SqsClientV0TestBase {} + +@WithConfig(key = TracerConfig.TRACE_SPAN_ATTRIBUTE_SCHEMA, value = "v1") +abstract class SqsClientV1TestBase extends SqsClientTestBase { + @Override + String expectedOperation(String awsService, String awsOperation) { + if ("Sqs".equals(awsService)) { + if ("ReceiveMessage".equals(awsOperation)) { + return "aws.sqs.process"; + } else if ("SendMessage".equals(awsOperation)) { + return "aws.sqs.send"; + } + } + return "aws." + awsService.toLowerCase(Locale.ROOT) + ".request"; + } + + @Override + String expectedService(String awsService, String awsOperation) { + return "A-service"; + } +} + +@WithConfig(key = GeneralConfig.DATA_STREAMS_ENABLED, value = "false") +class SqsClientV1ForkedTest extends SqsClientV1TestBase {} + +@WithConfig(key = GeneralConfig.DATA_STREAMS_ENABLED, value = "true") +class SqsClientV1DataStreamsForkedTest extends SqsClientV1TestBase { + @Override + boolean isDataStreamsEnabled() { + return true; + } +} + +@WithConfig(key = GeneralConfig.SERVICE_NAME, value = "A-service") +@WithConfig(key = TracerConfig.SCOPE_ITERATION_KEEP_ALIVE, value = "1") +abstract class SqsClientReceiveIterationTestBase extends AbstractInstrumentationTest { + private static final AnonymousCredentialsProvider CREDENTIALS_PROVIDER = + AnonymousCredentialsProvider.create(); + private static SQSRestServer server; + private static URI endpoint; + + @BeforeAll + static void startSqsServer() { + server = SQSRestServerBuilder.withInterface("localhost").withDynamicPort().start(); + InetSocketAddress address = server.waitUntilStarted().localAddress(); + endpoint = URI.create("http://localhost:" + address.getPort()); + } + + @AfterAll + static void stopSqsServer() { + if (server != null) { + server.stopAndWait(); + server = null; + } + } + + @BeforeEach + void setUpAwsCredentials() { + if (closePreviousBeforeTest()) { + AgentTracer.closePrevious(true); + } + System.setProperty(SdkSystemSetting.AWS_ACCESS_KEY_ID.property(), "my-access-key"); + System.setProperty(SdkSystemSetting.AWS_SECRET_ACCESS_KEY.property(), "my-secret-key"); + } + + @Test + void syncReceiveActivatesConsumerSpanForUserHandlerIteration() throws Exception { + try (SqsClient client = + SqsClient.builder() + .region(Region.EU_CENTRAL_1) + .endpointOverride(endpoint) + .credentialsProvider(CREDENTIALS_PROVIDER) + .build()) { + String queueUrl = + client + .createQueue(CreateQueueRequest.builder().queueName("somequeue").build()) + .queueUrl(); + writer.clear(); + + TraceUtils.runUnderTrace( + "parent", + () -> { + client.sendMessage( + SendMessageRequest.builder().queueUrl(queueUrl).messageBody("sometext").build()); + return null; + }); + + // The sync AWS SDK receive pipeline rebuilds the immutable response before user code sees it. + // Iterating the copied message list must still activate the consumer span for user handlers. + List messages = + client + .receiveMessage(ReceiveMessageRequest.builder().queueUrl(queueUrl).build()) + .messages(); + messages.forEach(message -> TraceUtils.runUnderTrace("handler", () -> null)); + + assertEquals(1, messages.size()); + writer.waitForTraces(2); + + DDSpan parentSpan = findSpanByResource("parent"); + DDSpan sendSpan = findSpanByResource("Sqs.SendMessage"); + DDSpan receiveSpan = findSpanByResource("Sqs.ReceiveMessage"); + DDSpan handlerSpan = findSpanByResource("handler"); + + assertEquals(2, writer.size(), () -> "Unexpected traces: " + writer); + assertEquals(4, spanCount(), () -> "Unexpected spans: " + writer); + + assertTestSpan(parentSpan, 0); + assertAwsSpan( + sendSpan, + expectedService("Sqs", "SendMessage"), + expectedOperation("Sqs", "SendMessage"), + "Sqs.SendMessage", + DDSpanTypes.HTTP_CLIENT, + Tags.SPAN_KIND_CLIENT, + "SendMessage", + parentSpan.getSpanId()); + assertEquals(parentSpan.getTraceId(), sendSpan.getTraceId()); + + assertAwsSpan( + receiveSpan, + expectedService("Sqs", "ReceiveMessage"), + expectedOperation("Sqs", "ReceiveMessage"), + "Sqs.ReceiveMessage", + DDSpanTypes.MESSAGE_CONSUMER, + Tags.SPAN_KIND_CONSUMER, + "ReceiveMessage", + sendSpan.getSpanId()); + assertEquals(sendSpan.getTraceId(), receiveSpan.getTraceId()); + + assertTestSpan(handlerSpan, receiveSpan.getSpanId()); + assertEquals(receiveSpan.getTraceId(), handlerSpan.getTraceId()); + } + } + + abstract String expectedOperation(String awsService, String awsOperation); + + abstract String expectedService(String awsService, String awsOperation); + + boolean closePreviousBeforeTest() { + return true; + } + + private static void assertTestSpan(DDSpan span, long parentId) { + assertNotNull(span); + assertEquals(parentId, span.getParentId()); + assertFalse(span.isError()); + } + + private static void assertAwsSpan( + DDSpan span, + String serviceName, + String operationName, + String resourceName, + String spanType, + String spanKind, + String awsOperation, + long parentId) { + assertNotNull(span); + assertEquals(serviceName, span.getServiceName()); + assertEquals(operationName, span.getOperationName().toString()); + assertEquals(resourceName, span.getResourceName().toString()); + assertEquals(spanType, span.getSpanType()); + assertEquals(parentId, span.getParentId()); + assertFalse(span.isError()); + assertEquals("java-aws-sdk", tagValue(span, Tags.COMPONENT)); + assertEquals(spanKind, tagValue(span, Tags.SPAN_KIND)); + assertEquals("Sqs", tagValue(span, "aws.service")); + assertEquals("Sqs", tagValue(span, "aws_service")); + assertEquals(awsOperation, tagValue(span, "aws.operation")); + assertEquals("java-aws-sdk", tagValue(span, "aws.agent")); + assertEquals(expectedQueueUrl(), tagValue(span, "aws.queue.url")); + assertEquals("00000000-0000-0000-0000-000000000000", tagValue(span, "aws.requestId")); + } + + private static String tagValue(DDSpan span, String tagName) { + Object value = span.getTag(tagName); + return value == null ? null : value.toString(); + } + + private static DDSpan findSpanByResource(String resourceName) { + for (List trace : writer) { + for (DDSpan span : trace) { + if (resourceName.equals(span.getResourceName().toString())) { + return span; + } + } + } + return null; + } + + private static int spanCount() { + int count = 0; + for (List trace : writer) { + count += trace.size(); + } + return count; + } + + private static String expectedQueueUrl() { + return endpoint + "/000000000000/somequeue"; + } +} + +@WithConfig(key = TracerConfig.TRACE_SPAN_ATTRIBUTE_SCHEMA, value = "v0") +abstract class SqsClientV0ReceiveIterationTestBase extends SqsClientReceiveIterationTestBase { + @Override + String expectedOperation(String awsService, String awsOperation) { + return "aws.http"; + } + + @Override + String expectedService(String awsService, String awsOperation) { + if ("Sqs".equals(awsService)) { + return "sqs"; + } + return "java-aws-sdk"; + } +} + +@WithConfig(key = GeneralConfig.DATA_STREAMS_ENABLED, value = "false") +class SqsClientV0ReceiveIterationTest extends SqsClientV0ReceiveIterationTestBase {} + +@WithConfig(key = GeneralConfig.DATA_STREAMS_ENABLED, value = "true") +class SqsClientV0DataStreamsReceiveIterationTest extends SqsClientV0ReceiveIterationTestBase {} + +@WithConfig(key = GeneralConfig.DATA_STREAMS_ENABLED, value = "false") +@WithConfig(key = TraceInstrumentationConfig.LEGACY_CONTEXT_MANAGER_ENABLED, value = "false") +class SqsClientV0ContextSwapReceiveIterationForkedTest extends SqsClientV0ReceiveIterationTestBase { + @Override + boolean closePreviousBeforeTest() { + return false; + } +} + +@WithConfig(key = TracerConfig.TRACE_SPAN_ATTRIBUTE_SCHEMA, value = "v1") +abstract class SqsClientV1ReceiveIterationTestBase extends SqsClientReceiveIterationTestBase { + @Override + String expectedOperation(String awsService, String awsOperation) { + if ("Sqs".equals(awsService)) { + if ("ReceiveMessage".equals(awsOperation)) { + return "aws.sqs.process"; + } else if ("SendMessage".equals(awsOperation)) { + return "aws.sqs.send"; + } + } + return "aws." + awsService.toLowerCase(Locale.ROOT) + ".request"; + } + + @Override + String expectedService(String awsService, String awsOperation) { + return "A-service"; + } +} + +@WithConfig(key = GeneralConfig.DATA_STREAMS_ENABLED, value = "false") +class SqsClientV1ReceiveIterationForkedTest extends SqsClientV1ReceiveIterationTestBase {} + +@WithConfig(key = GeneralConfig.DATA_STREAMS_ENABLED, value = "true") +class SqsClientV1DataStreamsReceiveIterationForkedTest + extends SqsClientV1ReceiveIterationTestBase {} diff --git a/dd-java-agent/instrumentation/axis2-1.3/build.gradle b/dd-java-agent/instrumentation/axis2-1.3/build.gradle index 5eea1ed11ea..7ae221bc3e3 100644 --- a/dd-java-agent/instrumentation/axis2-1.3/build.gradle +++ b/dd-java-agent/instrumentation/axis2-1.3/build.gradle @@ -13,13 +13,13 @@ addTestSuiteForDir('latestDepForkedTest', 'test') tasks.named("latestDepTest", Test) { testJvmConstraints { - minJavaVersion = JavaVersion.VERSION_11 + minJavaVersion = JavaVersion.VERSION_17 } } tasks.named("latestDepForkedTest", Test) { testJvmConstraints { - minJavaVersion = JavaVersion.VERSION_11 + minJavaVersion = JavaVersion.VERSION_17 } } @@ -32,11 +32,11 @@ configurations.configureEach { } } -configureGroovyCompiler(11, "compileLatestDepForkedTestGroovy", "compileLatestDepTestGroovy") +configureGroovyCompiler(17, "compileLatestDepForkedTestGroovy", "compileLatestDepTestGroovy") ["compileLatestDepForkedTestJava", "compileLatestDepTestJava"].each { tasks.named(it, JavaCompile) { - configureCompiler(it, 11) + configureCompiler(it, 17) } } diff --git a/dd-java-agent/instrumentation/axis2-1.3/gradle.lockfile b/dd-java-agent/instrumentation/axis2-1.3/gradle.lockfile index 1a265b4986c..e713ba1d4f7 100644 --- a/dd-java-agent/instrumentation/axis2-1.3/gradle.lockfile +++ b/dd-java-agent/instrumentation/axis2-1.3/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:axis2-1.3:dependencies --write-locks annogen:annogen:0.1.0=compileClasspath,testCompileClasspath,testRuntimeClasspath avalon-framework:avalon-framework:4.1.3=compileClasspath,testCompileClasspath,testRuntimeClasspath backport-util-concurrent:backport-util-concurrent:2.2=compileClasspath,testCompileClasspath,testRuntimeClasspath @@ -11,21 +12,21 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.fasterxml.woodstox:woodstox-core:7.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -52,14 +56,14 @@ commons-fileupload:commons-fileupload:1.5=latestDepForkedTestCompileClasspath,la commons-httpclient:commons-httpclient:3.0.1=compileClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:1.2=compileClasspath commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath -commons-io:commons-io:2.18.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs +commons-io:commons-io:2.22.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath commons-logging:commons-logging:1.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -commons-logging:commons-logging:1.3.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +commons-logging:commons-logging:1.3.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -jakarta.activation:jakarta.activation-api:2.1.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +jakarta.activation:jakarta.activation-api:2.1.4=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath jakarta.transaction:jakarta.transaction-api:2.0.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath jakarta.ws.rs:jakarta.ws.rs-api:4.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath javax.activation:activation:1.1=compileClasspath,testCompileClasspath,testRuntimeClasspath @@ -69,39 +73,37 @@ javax.servlet:servlet-api:2.3=compileClasspath,testCompileClasspath,testRuntimeC jaxen:jaxen:1.1-beta-9=compileClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs junit:junit:3.8.1=compileClasspath,testCompileClasspath -junit:junit:4.13.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath log4j:log4j:1.2.12=compileClasspath,testCompileClasspath,testRuntimeClasspath logkit:logkit:1.0.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc -org.apache.axis2:axis2-adb:2.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.axis2:axis2-adb:2.0.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.axis2:axis2-kernel:1.3=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.axis2:axis2-kernel:2.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.apache.axis2:axis2-transport-http:2.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.apache.axis2:axis2-transport-local:2.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.axis2:axis2-kernel:2.0.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.axis2:axis2-transport-http:2.0.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.axis2:axis2-transport-local:2.0.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.bcel:bcel:6.11.0=spotbugs -org.apache.commons:commons-fileupload2-core:2.0.0-M2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.apache.commons:commons-fileupload2-jakarta-servlet6:2.0.0-M2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.commons:commons-fileupload2-core:2.0.0-M5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.commons:commons-fileupload2-jakarta-servlet6:2.0.0-M5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.commons:commons-lang3:3.19.0=spotbugs org.apache.commons:commons-text:1.14.0=spotbugs org.apache.geronimo.specs:geronimo-jms_1.1_spec:1.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.geronimo.specs:geronimo-ws-metadata_2.0_spec:1.1.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.apache.httpcomponents.client5:httpclient5:5.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.apache.httpcomponents.core5:httpcore5-h2:5.3.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.apache.httpcomponents.core5:httpcore5:5.3.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.httpcomponents.client5:httpclient5:5.6.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.httpcomponents.core5:httpcore5-h2:5.4=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.httpcomponents.core5:httpcore5:5.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.httpcomponents:httpcore-nio:4.0-alpha5=compileClasspath,testCompileClasspath,testRuntimeClasspath org.apache.httpcomponents:httpcore:4.0-alpha5=compileClasspath,testCompileClasspath,testRuntimeClasspath org.apache.james:apache-mime4j-core:0.8.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apache.neethi:neethi:2.0.2=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.neethi:neethi:3.2.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.apache.woden:woden-core:1.0M10=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.neethi:neethi:3.2.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.ws.commons.axiom:axiom-api:1.2.5=compileClasspath,testCompileClasspath,testRuntimeClasspath org.apache.ws.commons.axiom:axiom-api:2.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.ws.commons.axiom:axiom-dom:1.2.5=compileClasspath,testCompileClasspath,testRuntimeClasspath @@ -111,7 +113,7 @@ org.apache.ws.commons.axiom:axiom-impl:2.0.0=latestDepForkedTestRuntimeClasspath org.apache.ws.commons.axiom:axiom-jakarta-activation:2.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.ws.commons.axiom:axiom-legacy-attachments:2.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.ws.commons.schema:XmlSchema:1.3.2=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.ws.xmlschema:xmlschema-core:2.3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.ws.xmlschema:xmlschema-core:2.3.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apiguardian:apiguardian-api:1.1.2=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath,testCompileClasspath org.checkerframework:checker-qual:3.33.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor org.codehaus.groovy:groovy-ant:3.0.23=codenarc @@ -128,10 +130,11 @@ org.codehaus.woodstox:wstx-asl:3.2.1=compileClasspath,testCompileClasspath,testR org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc -org.hamcrest:hamcrest-core:1.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.hamcrest:hamcrest-core:1.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -149,14 +152,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/axis2-1.3/src/main/java/datadog/trace/instrumentation/axis2/AxisEngineInstrumentation.java b/dd-java-agent/instrumentation/axis2-1.3/src/main/java/datadog/trace/instrumentation/axis2/AxisEngineInstrumentation.java index a522d76deab..8857ce4a01e 100644 --- a/dd-java-agent/instrumentation/axis2-1.3/src/main/java/datadog/trace/instrumentation/axis2/AxisEngineInstrumentation.java +++ b/dd-java-agent/instrumentation/axis2-1.3/src/main/java/datadog/trace/instrumentation/axis2/AxisEngineInstrumentation.java @@ -12,6 +12,8 @@ import static net.bytebuddy.matcher.ElementMatchers.isMethod; import static net.bytebuddy.matcher.ElementMatchers.takesArgument; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.api.Tracer; import datadog.trace.bootstrap.instrumentation.api.AgentScope; @@ -84,10 +86,10 @@ public static final class ResumeMessageAdvice { public static AgentScope beginResumingMessage( @Advice.Argument(0) final MessageContext message) { Object continuation = message.getSelfManagedData(Tracer.class, AXIS2_CONTINUATION_KEY); - if (null != continuation) { + if (continuation instanceof ContextContinuation) { message.removeSelfManagedData(Tracer.class, AXIS2_CONTINUATION_KEY); // resuming is a distinct operation, so create a new span under the original request - try (AgentScope parentScope = ((AgentScope.Continuation) continuation).activate()) { + try (ContextScope parentScope = ((ContextContinuation) continuation).resume()) { AgentSpan span = startSpan("axis2", AXIS2_MESSAGE); DECORATE.afterStart(span); DECORATE.onMessage(span, message); diff --git a/dd-java-agent/instrumentation/axis2-1.3/src/main/java/datadog/trace/instrumentation/axis2/AxisMessageDecorator.java b/dd-java-agent/instrumentation/axis2-1.3/src/main/java/datadog/trace/instrumentation/axis2/AxisMessageDecorator.java index 524e1df75ad..9833205e3f2 100644 --- a/dd-java-agent/instrumentation/axis2-1.3/src/main/java/datadog/trace/instrumentation/axis2/AxisMessageDecorator.java +++ b/dd-java-agent/instrumentation/axis2-1.3/src/main/java/datadog/trace/instrumentation/axis2/AxisMessageDecorator.java @@ -95,8 +95,9 @@ private static String soapAction(final MessageContext message) { } @Override - public AgentSpan afterStart(AgentSpan span) { - return super.afterStart(span).setMeasured(true); + public void afterStart(AgentSpan span) { + super.afterStart(span); + span.setMeasured(true); } public void onTransport(AgentSpan span, MessageContext message) { diff --git a/dd-java-agent/instrumentation/axway-api-7.5/gradle.lockfile b/dd-java-agent/instrumentation/axway-api-7.5/gradle.lockfile index 5ca3972ba7b..ebae34e342f 100644 --- a/dd-java-agent/instrumentation/axway-api-7.5/gradle.lockfile +++ b/dd-java-agent/instrumentation/axway-api-7.5/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:axway-api-7.5:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/axway-api-7.5/src/main/java/datadog/trace/instrumentation/axway/AxwayHTTPPluginDecorator.java b/dd-java-agent/instrumentation/axway-api-7.5/src/main/java/datadog/trace/instrumentation/axway/AxwayHTTPPluginDecorator.java index 148c08eef1b..10ce28bdd1b 100644 --- a/dd-java-agent/instrumentation/axway-api-7.5/src/main/java/datadog/trace/instrumentation/axway/AxwayHTTPPluginDecorator.java +++ b/dd-java-agent/instrumentation/axway-api-7.5/src/main/java/datadog/trace/instrumentation/axway/AxwayHTTPPluginDecorator.java @@ -196,14 +196,13 @@ protected int status(final Object serverTransaction) { /** * @param stateInstance type com.vordel.circuit.net.State */ - public AgentSpan onTransaction(AgentSpan span, Object stateInstance) { + public void onTransaction(AgentSpan span, Object stateInstance) { if (span != null) { setStringTagFromStateField(span, Tags.PEER_HOSTNAME, stateInstance, hostField_mh); setStringTagFromStateField(span, Tags.PEER_PORT, stateInstance, portField_mh); setStringTagFromStateField(span, Tags.HTTP_METHOD, stateInstance, methodField_mh); setURLTagFromUriStateField(span, stateInstance); } - return span; } /** diff --git a/dd-java-agent/instrumentation/axway-api-7.5/src/main/java/datadog/trace/instrumentation/axway/HTTPPluginAdvice.java b/dd-java-agent/instrumentation/axway-api-7.5/src/main/java/datadog/trace/instrumentation/axway/HTTPPluginAdvice.java index 0d45090a975..757e44e03a1 100644 --- a/dd-java-agent/instrumentation/axway-api-7.5/src/main/java/datadog/trace/instrumentation/axway/HTTPPluginAdvice.java +++ b/dd-java-agent/instrumentation/axway-api-7.5/src/main/java/datadog/trace/instrumentation/axway/HTTPPluginAdvice.java @@ -2,8 +2,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentSpan.fromContext; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static datadog.trace.instrumentation.axway.AxwayHTTPPluginDecorator.DECORATE; import static datadog.trace.instrumentation.axway.AxwayHTTPPluginDecorator.SERVER_TRANSACTION_CLASS; @@ -20,8 +19,8 @@ public static ContextScope onEnter(@Advice.Argument(value = 2) final Object serv final AgentSpan span = startSpan("axway-http", DECORATE.spanName()).setMeasured(true); DECORATE.afterStart(span); // serverTransaction is like request + connection in one object: - DECORATE.onRequest(span, serverTransaction, serverTransaction, getRootContext()); - return getCurrentContext().with(span).attach(); + DECORATE.onRequest(span, serverTransaction, serverTransaction, rootContext()); + return span.attachWithContext(); } @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) diff --git a/dd-java-agent/instrumentation/azure-functions-1.2.2/gradle.lockfile b/dd-java-agent/instrumentation/azure-functions-1.2.2/gradle.lockfile index ef2c1cf70ad..24ab73c0e40 100644 --- a/dd-java-agent/instrumentation/azure-functions-1.2.2/gradle.lockfile +++ b/dd-java-agent/instrumentation/azure-functions-1.2.2/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:azure-functions-1.2.2:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.microsoft.azure.functions:azure-functions-java-core-library:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.microsoft.azure.functions:azure-functions-java-library:1.2.2=compileClasspath,testCompileClasspath,testRuntimeClasspath com.microsoft.azure.functions:azure-functions-java-library:3.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -50,12 +54,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -84,6 +88,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -102,14 +107,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/azure-functions-1.2.2/src/main/java/datadog/trace/instrumentation/azure/functions/AzureFunctionsDecorator.java b/dd-java-agent/instrumentation/azure-functions-1.2.2/src/main/java/datadog/trace/instrumentation/azure/functions/AzureFunctionsDecorator.java index 3a778f986b7..e8466f50844 100644 --- a/dd-java-agent/instrumentation/azure-functions-1.2.2/src/main/java/datadog/trace/instrumentation/azure/functions/AzureFunctionsDecorator.java +++ b/dd-java-agent/instrumentation/azure-functions-1.2.2/src/main/java/datadog/trace/instrumentation/azure/functions/AzureFunctionsDecorator.java @@ -76,9 +76,9 @@ protected int status(final HttpResponseMessage response) { return response.getStatusCode(); } - public AgentSpan afterStart(final AgentSpan span, final String functionName) { + public void afterStart(final AgentSpan span, final String functionName) { span.setTag("aas.function.name", functionName); span.setTag("aas.function.trigger", "Http"); - return super.afterStart(span); + super.afterStart(span); } } diff --git a/dd-java-agent/instrumentation/azure-functions-1.2.2/src/main/java/datadog/trace/instrumentation/azure/functions/AzureFunctionsInstrumentation.java b/dd-java-agent/instrumentation/azure-functions-1.2.2/src/main/java/datadog/trace/instrumentation/azure/functions/AzureFunctionsInstrumentation.java index 47ac3a0b8de..cd2cfe5e65a 100644 --- a/dd-java-agent/instrumentation/azure-functions-1.2.2/src/main/java/datadog/trace/instrumentation/azure/functions/AzureFunctionsInstrumentation.java +++ b/dd-java-agent/instrumentation/azure-functions-1.2.2/src/main/java/datadog/trace/instrumentation/azure/functions/AzureFunctionsInstrumentation.java @@ -5,7 +5,7 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.HierarchyMatchers.isAnnotatedWith; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.AgentSpan.fromContext; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; import static datadog.trace.bootstrap.instrumentation.decorator.http.HttpResourceDecorator.HTTP_RESOURCE_DECORATOR; import static datadog.trace.instrumentation.azure.functions.AzureFunctionsDecorator.DECORATE; import static net.bytebuddy.matcher.ElementMatchers.isMethod; @@ -74,7 +74,7 @@ public static ContextScope onEnter(@Advice.Argument(0) final HttpRequestMessage< return parentContext.attach(); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void closeScope(@Advice.Enter final ContextScope scope) { scope.close(); } @@ -86,7 +86,7 @@ public static ContextScope methodEnter( @Advice.Argument(0) final HttpRequestMessage request, @Advice.Argument(1) final ExecutionContext executionContext) { final Context parentContext = - getCurrentContext(); // parent context attached by ContextTrackingAdvice + currentContext(); // parent context attached by ContextTrackingAdvice final Context context = DECORATE.startSpan(request, parentContext); final AgentSpan span = fromContext(context); DECORATE.afterStart(span, executionContext.getFunctionName()); diff --git a/dd-java-agent/instrumentation/build.gradle b/dd-java-agent/instrumentation/build.gradle index 2f5807ba4f5..4b2b6588492 100644 --- a/dd-java-agent/instrumentation/build.gradle +++ b/dd-java-agent/instrumentation/build.gradle @@ -44,7 +44,9 @@ subprojects { Project subProj -> // Add instrumentation-specific forbiddenApi rules subProj.tasks.withType(CheckForbiddenApis).configureEach { - signaturesFiles += subProj.files("$rootDir/gradle/forbiddenApiFilters/instrumentation.txt") + signaturesFiles = subProj.files( + "$rootDir/gradle/forbiddenApiFilters/main.txt", + "$rootDir/gradle/forbiddenApiFilters/instrumentation.txt") } @@ -85,11 +87,13 @@ subprojects { Project subProj -> } } - if (subProj.path != ':dd-java-agent:instrumentation:vertx:vertx-redis-client:vertx-redis-client-stubs') { - // don't include the redis RequestImpl stubs - parent_project.dependencies { - addProvider("implementation", providers.provider { project(subProj.path) }) - } + if (subProj.path != ':dd-java-agent:instrumentation:vertx:vertx-redis-client:vertx-redis-client-stubs' + && subProj.path != ':dd-java-agent:instrumentation:tibco-businessworks:tibco-businessworks-stubs') { + // don't include the redis or tibco stubs + parent_project.dependencies.add( + "implementation", + parent_project.dependencies.project(path: subProj.path) + ) } } @@ -117,14 +121,22 @@ if (project.gradle.startParameter.taskNames.any { it.endsWith("generateMuzzleRep } tasks.named('shadowJar', ShadowJar) { + // Keep duplicate detection enabled on the aggregate instrumentation jar. + // + // The previous source-set fixes and the servlet5 relocated-jar fix keep extra classes in + // producer jars without also publishing their raw output through `runtimeElements`. The old + // per-path `EXCLUDE` workaround is no longer needed. + // + // Shadow 9 honors `DuplicatesStrategy.FAIL` for these inputs. If a producer publishes the same + // classes from both its jar and a runtime file or directory, this task should fail again. duplicatesStrategy = DuplicatesStrategy.FAIL dependencies { // the tracer is now in a separate shadow jar exclude(project(":dd-trace-core")) exclude(dependency('com.datadoghq:sketches-java')) exclude(dependency('com.google.re2j:re2j')) + deps.excludeShared.execute(it) } - dependencies deps.excludeShared } // temporary config to add slf4j-simple so we get logging from instrumenters while indexing @@ -143,8 +155,9 @@ TaskProvider registerIndexTask(String indexTaskName, String indexer, S it.from(project.configurations.named("runtimeClasspath")) it.from(project.configurations.named('slf4j-simple')) } - it.inputs.files(it.classpath) it.outputs.dir(destinationDir) + .withPropertyName("indexDirectory") + it.outputs.cacheIf { true } it.argumentProviders.add(new CommandLineArgumentProvider() { @Override Iterable asArguments() { diff --git a/dd-java-agent/instrumentation/caffeine-1.0/gradle.lockfile b/dd-java-agent/instrumentation/caffeine-1.0/gradle.lockfile index a2ed52b7d3a..569f6de9902 100644 --- a/dd-java-agent/instrumentation/caffeine-1.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/caffeine-1.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:caffeine-1.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,22 +9,22 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.ben-manes.caffeine:caffeine:1.0.0=compileClasspath com.github.ben-manes.caffeine:tracing-api:1.0.0=compileClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -33,12 +34,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -49,12 +53,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -83,6 +87,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -100,14 +105,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/cdi-1.2/gradle.lockfile b/dd-java-agent/instrumentation/cdi-1.2/gradle.lockfile index 318e4268222..01aad298845 100644 --- a/dd-java-agent/instrumentation/cdi-1.2/gradle.lockfile +++ b/dd-java-agent/instrumentation/cdi-1.2/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:cdi-1.2:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,13 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:18.0=testCompileClasspath,testRuntimeClasspath -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -48,14 +51,14 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.enterprise:cdi-api:1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.inject:javax.inject:1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -105,6 +108,7 @@ org.jboss.weld:weld-spi:2.3.Final=testCompileClasspath,testRuntimeClasspath org.jboss.weld:weld-spi:2.4.SP2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -122,14 +126,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/cics-9.1/build.gradle b/dd-java-agent/instrumentation/cics-9.1/build.gradle index c25c8aad173..41f3d89ebbc 100644 --- a/dd-java-agent/instrumentation/cics-9.1/build.gradle +++ b/dd-java-agent/instrumentation/cics-9.1/build.gradle @@ -1,3 +1,7 @@ +plugins { + id 'dd-trace-java.mass' +} + apply from: "$rootDir/gradle/java.gradle" // Configuration for downloading CICS SDK from IBM @@ -8,7 +12,7 @@ ext { repositories { ivy { - url = 'https://public.dhe.ibm.com/software/htp/cics/support/supportpacs/individual/' + url = mass.artifactUrl('public.dhe.ibm.com/software/htp/cics/support/supportpacs/individual/') patternLayout { artifact '[module].[ext]' } diff --git a/dd-java-agent/instrumentation/cics-9.1/gradle.lockfile b/dd-java-agent/instrumentation/cics-9.1/gradle.lockfile index a032810b11e..0e50e930c12 100644 --- a/dd-java-agent/instrumentation/cics-9.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/cics-9.1/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:cics-9.1:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,14 +51,14 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.resource:javax.resource-api:1.7.1=compileClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath javax.transaction:javax.transaction-api:1.3=compileClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -83,6 +87,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -101,14 +106,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/cics-9.1/src/main/java/datadog/trace/instrumentation/cics/CicsDecorator.java b/dd-java-agent/instrumentation/cics-9.1/src/main/java/datadog/trace/instrumentation/cics/CicsDecorator.java index 227882d2212..58ea735240b 100644 --- a/dd-java-agent/instrumentation/cics-9.1/src/main/java/datadog/trace/instrumentation/cics/CicsDecorator.java +++ b/dd-java-agent/instrumentation/cics-9.1/src/main/java/datadog/trace/instrumentation/cics/CicsDecorator.java @@ -36,10 +36,10 @@ protected CharSequence spanType() { } @Override - public AgentSpan afterStart(AgentSpan span) { + public void afterStart(AgentSpan span) { assert span != null; span.setTag("rpc.system", "cics"); - return super.afterStart(span); + super.afterStart(span); } /** @@ -50,7 +50,7 @@ public AgentSpan afterStart(AgentSpan span) { * @param port the port number * @param ipGateway the resolved InetAddress (can be null) */ - public AgentSpan onConnection( + public void onConnection( final AgentSpan span, final String strAddress, final int port, final InetAddress ipGateway) { if (strAddress != null) { span.setTag(Tags.PEER_HOSTNAME, strAddress); @@ -63,8 +63,6 @@ public AgentSpan onConnection( if (port > 0) { setPeerPort(span, port); } - - return span; } /** @@ -89,7 +87,7 @@ private String getInteractionVerbString(final int verb) { } } - public AgentSpan onECIInteraction(final AgentSpan span, final ECIInteractionSpec spec) { + public void onECIInteraction(final AgentSpan span, final ECIInteractionSpec spec) { final String interactionVerb = getInteractionVerbString(spec.getInteractionVerb()); final String functionName = spec.getFunctionName(); final String tranName = spec.getTranName(); @@ -107,7 +105,5 @@ public AgentSpan onECIInteraction(final AgentSpan span, final ECIInteractionSpec if (tpnName != null) { span.setTag("cics.tpn", tpnName); } - - return span; } } diff --git a/dd-java-agent/instrumentation/cics-9.1/src/main/java/datadog/trace/instrumentation/cics/ECIInteractionInstrumentation.java b/dd-java-agent/instrumentation/cics-9.1/src/main/java/datadog/trace/instrumentation/cics/ECIInteractionInstrumentation.java index d65ac829fb7..c682bb4466a 100644 --- a/dd-java-agent/instrumentation/cics-9.1/src/main/java/datadog/trace/instrumentation/cics/ECIInteractionInstrumentation.java +++ b/dd-java-agent/instrumentation/cics-9.1/src/main/java/datadog/trace/instrumentation/cics/ECIInteractionInstrumentation.java @@ -50,10 +50,11 @@ public static void exit( CallDepthThreadLocalMap.decrementCallDepth(ECIInteraction.class); if (null != scope) { - DECORATE.onError(scope.span(), throwable); - DECORATE.beforeFinish(scope.span()); - scope.span().finish(); + AgentSpan span = scope.span(); + DECORATE.onError(span, throwable); + DECORATE.beforeFinish(span); scope.close(); + span.finish(); } } } diff --git a/dd-java-agent/instrumentation/cics-9.1/src/main/java/datadog/trace/instrumentation/cics/JavaGatewayInterfaceInstrumentation.java b/dd-java-agent/instrumentation/cics-9.1/src/main/java/datadog/trace/instrumentation/cics/JavaGatewayInterfaceInstrumentation.java index e7e6aca1129..2745576e4e5 100644 --- a/dd-java-agent/instrumentation/cics-9.1/src/main/java/datadog/trace/instrumentation/cics/JavaGatewayInterfaceInstrumentation.java +++ b/dd-java-agent/instrumentation/cics-9.1/src/main/java/datadog/trace/instrumentation/cics/JavaGatewayInterfaceInstrumentation.java @@ -71,8 +71,8 @@ public static void exit( DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); - span.finish(); scope.close(); + span.finish(); } } } diff --git a/dd-java-agent/instrumentation/commons-codec-1.1/gradle.lockfile b/dd-java-agent/instrumentation/commons-codec-1.1/gradle.lockfile index 4dadc2ee18a..8af62a7ca05 100644 --- a/dd-java-agent/instrumentation/commons-codec-1.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/commons-codec-1.1/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:commons-codec-1.1:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,csiCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,csiCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -48,12 +52,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -82,6 +86,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -99,14 +104,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/commons-fileupload-1.5/gradle.lockfile b/dd-java-agent/instrumentation/commons-fileupload-1.5/gradle.lockfile index 52db7122941..b65acf7a889 100644 --- a/dd-java-agent/instrumentation/commons-fileupload-1.5/gradle.lockfile +++ b/dd-java-agent/instrumentation/commons-fileupload-1.5/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:commons-fileupload-1.5:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -49,12 +53,12 @@ commons-io:commons-io:2.19.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -84,6 +88,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -101,14 +106,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/commons-fileupload-1.5/src/main/java/datadog/trace/instrumentation/commons/fileupload/CommonsFileUploadAppSecInstrumentation.java b/dd-java-agent/instrumentation/commons-fileupload-1.5/src/main/java/datadog/trace/instrumentation/commons/fileupload/CommonsFileUploadAppSecInstrumentation.java index f5b37d0ee02..e778a3e7d98 100644 --- a/dd-java-agent/instrumentation/commons-fileupload-1.5/src/main/java/datadog/trace/instrumentation/commons/fileupload/CommonsFileUploadAppSecInstrumentation.java +++ b/dd-java-agent/instrumentation/commons-fileupload-1.5/src/main/java/datadog/trace/instrumentation/commons/fileupload/CommonsFileUploadAppSecInstrumentation.java @@ -53,7 +53,7 @@ public void methodAdvice(MethodTransformer transformer) { @RequiresRequestContext(RequestContextSlot.APPSEC) public static class ParseRequestAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Return final List fileItems, @ActiveRequestContext RequestContext reqCtx, diff --git a/dd-java-agent/instrumentation/commons-httpclient-2.0/gradle.lockfile b/dd-java-agent/instrumentation/commons-httpclient-2.0/gradle.lockfile index 35751c522f7..33d785cb957 100644 --- a/dd-java-agent/instrumentation/commons-httpclient-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/commons-httpclient-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:commons-httpclient-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -53,12 +57,12 @@ commons-logging:commons-logging:1.0.3=compileClasspath,testCompileClasspath,test commons-logging:commons-logging:1.0.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,6 +91,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -104,14 +109,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/commons-httpclient-2.0/src/main/java/datadog/trace/instrumentation/commonshttpclient/CommonsHttpClientInstrumentation.java b/dd-java-agent/instrumentation/commons-httpclient-2.0/src/main/java/datadog/trace/instrumentation/commonshttpclient/CommonsHttpClientInstrumentation.java index a63ee7c9a82..6a9d07fe749 100644 --- a/dd-java-agent/instrumentation/commons-httpclient-2.0/src/main/java/datadog/trace/instrumentation/commonshttpclient/CommonsHttpClientInstrumentation.java +++ b/dd-java-agent/instrumentation/commons-httpclient-2.0/src/main/java/datadog/trace/instrumentation/commonshttpclient/CommonsHttpClientInstrumentation.java @@ -4,7 +4,7 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; import static datadog.trace.instrumentation.commonshttpclient.CommonsHttpClientDecorator.DECORATE; import static datadog.trace.instrumentation.commonshttpclient.CommonsHttpClientDecorator.HTTP_REQUEST; import static datadog.trace.instrumentation.commonshttpclient.HttpHeadersInjectAdapter.SETTER; @@ -105,7 +105,7 @@ public static void methodExit( public static class ContextPropagationAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) public static void methodEnter(@Advice.Argument(1) final HttpMethod httpMethod) { - DECORATE.injectContext(getCurrentContext(), httpMethod, SETTER); + DECORATE.injectContext(currentContext(), httpMethod, SETTER); } } } diff --git a/dd-java-agent/instrumentation/commons-lang/commons-lang-2.1/gradle.lockfile b/dd-java-agent/instrumentation/commons-lang/commons-lang-2.1/gradle.lockfile index fefc9fc0547..586d186c6f2 100644 --- a/dd-java-agent/instrumentation/commons-lang/commons-lang-2.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/commons-lang/commons-lang-2.1/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:commons-lang:commons-lang-2.1:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,csiCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,csiCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -49,12 +53,12 @@ commons-lang:commons-lang:2.1=compileClasspath,csiCompileClasspath,testCompileCl commons-lang:commons-lang:2.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -83,6 +87,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -100,14 +105,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/commons-lang/commons-lang-3.5/gradle.lockfile b/dd-java-agent/instrumentation/commons-lang/commons-lang-3.5/gradle.lockfile index 1a8d91a88a5..2c6409acb8b 100644 --- a/dd-java-agent/instrumentation/commons-lang/commons-lang-3.5/gradle.lockfile +++ b/dd-java-agent/instrumentation/commons-lang/commons-lang-3.5/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:commons-lang:commons-lang-3.5:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,csiCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,csiCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -83,6 +87,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -100,14 +105,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/commons-text-1.0/gradle.lockfile b/dd-java-agent/instrumentation/commons-text-1.0/gradle.lockfile index 2bca32fb8b6..7fce48cc1af 100644 --- a/dd-java-agent/instrumentation/commons-text-1.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/commons-text-1.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:commons-text-1.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,csiCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,csiCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -85,6 +89,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -102,14 +107,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/confluent-schema-registry/confluent-schema-registry-4.1/build.gradle b/dd-java-agent/instrumentation/confluent-schema-registry/confluent-schema-registry-4.1/build.gradle index 2d4a5765150..20f539f5abf 100644 --- a/dd-java-agent/instrumentation/confluent-schema-registry/confluent-schema-registry-4.1/build.gradle +++ b/dd-java-agent/instrumentation/confluent-schema-registry/confluent-schema-registry-4.1/build.gradle @@ -8,7 +8,20 @@ muzzle { versions = "[4.1.0,)" // broken POMs: depend on non-existent org.eclipse.jetty:jetty-bom:9.4.59 // can be fixed after https://github.com/confluentinc/kafka-connect-storage-common/issues/468 is resolved - skipVersions += ['7.4.14', '7.5.13', '7.6.10', '7.7.8', '7.8.7', '7.9.6'] + skipVersions += [ + '7.4.14', + '7.4.15', + '7.5.13', + '7.5.14', + '7.6.10', + '7.6.11', + '7.7.8', + '7.7.9', + '7.8.7', + '7.8.8', + '7.9.6', + '7.9.7' + ] excludeDependency "org.codehaus.jackson:jackson-mapper-asl" // missing on some releases assertInverse = true } diff --git a/dd-java-agent/instrumentation/confluent-schema-registry/confluent-schema-registry-4.1/gradle.lockfile b/dd-java-agent/instrumentation/confluent-schema-registry/confluent-schema-registry-4.1/gradle.lockfile index 7e1e329b58c..7e8576066d6 100644 --- a/dd-java-agent/instrumentation/confluent-schema-registry/confluent-schema-registry-4.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/confluent-schema-registry/confluent-schema-registry-4.1/gradle.lockfile @@ -1,7 +1,8 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. -at.yawk.lz4:lz4-java:1.10.1=latestDepTestRuntimeClasspath +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:confluent-schema-registry:confluent-schema-registry-4.1:dependencies --write-locks +at.yawk.lz4:lz4-java:1.10.2=latestDepTestRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -10,36 +11,36 @@ com.101tec:zkclient:0.10=compileClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.eclipsesource.minimal-json:minimal-json:0.9.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-annotations:2.14.2=testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.20=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-annotations:2.21=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-annotations:2.9.0=compileClasspath com.fasterxml.jackson.core:jackson-core:2.14.2=testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-core:2.21.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-core:2.9.4=compileClasspath com.fasterxml.jackson.core:jackson-databind:2.14.2=testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-databind:2.21.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-databind:2.9.4=compileClasspath -com.fasterxml.jackson.dataformat:jackson-dataformat-csv:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.dataformat:jackson-dataformat-csv:2.21.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.21.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.14.2=testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson:jackson-bom:2.21.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.luben:zstd-jni:1.5.2-1=testRuntimeClasspath com.github.luben:zstd-jni:1.5.6-10=latestDepTestRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -47,17 +48,18 @@ com.google.auto.service:auto-service:1.1.1=annotationProcessor,latestDepTestAnno com.google.auto:auto-common:1.2.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs -com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor +com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.errorprone:error_prone_annotations:2.5.1=testCompileClasspath,testRuntimeClasspath -com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -com.google.guava:guava:30.1.1-jre=testCompileClasspath,testRuntimeClasspath -com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -com.google.j2objc:j2objc-annotations:1.3=testCompileClasspath,testRuntimeClasspath -com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.re2j:re2j:1.6=latestDepTestCompileClasspath,testCompileClasspath -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -72,30 +74,32 @@ de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,la io.confluent:common-config:4.1.0=compileClasspath io.confluent:common-utils:4.1.0=compileClasspath io.confluent:common-utils:7.4.0=testCompileClasspath,testRuntimeClasspath -io.confluent:common-utils:8.2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.confluent:common-utils:8.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.confluent:kafka-avro-serializer:7.4.0=testCompileClasspath,testRuntimeClasspath -io.confluent:kafka-avro-serializer:8.2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.confluent:kafka-avro-serializer:8.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.confluent:kafka-avro-types:8.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.confluent:kafka-schema-registry-client:4.1.0=compileClasspath io.confluent:kafka-schema-registry-client:7.4.0=testCompileClasspath,testRuntimeClasspath -io.confluent:kafka-schema-registry-client:8.2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.confluent:kafka-schema-registry-client:8.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.confluent:kafka-schema-serializer:7.4.0=testCompileClasspath,testRuntimeClasspath -io.confluent:kafka-schema-serializer:8.2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.confluent:kafka-schema-serializer:8.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.confluent:kafka-schema-types:8.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.confluent:logredactor-metrics:1.0.11=testCompileClasspath,testRuntimeClasspath -io.confluent:logredactor-metrics:1.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.confluent:logredactor-metrics:1.0.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.confluent:logredactor:1.0.11=testCompileClasspath,testRuntimeClasspath -io.confluent:logredactor:1.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.confluent:logredactor:1.0.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath io.netty:netty:3.10.5.Final=compileClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.swagger.core.v3:swagger-annotations-jakarta:2.2.42=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.swagger.core.v3:swagger-annotations:2.1.10=testCompileClasspath,testRuntimeClasspath -io.swagger.core.v3:swagger-annotations:2.2.29=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs jline:jline:0.9.94=compileClasspath junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath log4j:log4j:1.2.16=compileClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -116,13 +120,12 @@ org.apache.httpcomponents.core5:httpcore5-h2:5.3.4=latestDepTestCompileClasspath org.apache.httpcomponents.core5:httpcore5:5.3.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.kafka:kafka-clients:1.1.0-cp1=compileClasspath org.apache.kafka:kafka-clients:7.4.0-ccs=testCompileClasspath,testRuntimeClasspath -org.apache.kafka:kafka-clients:8.2.0-ccs=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.kafka:kafka-clients:8.3.0-ccs=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apache.zookeeper:zookeeper:3.4.10=compileClasspath org.apiguardian:apiguardian-api:1.1.2=latestDepTestCompileClasspath,testCompileClasspath -org.checkerframework:checker-qual:3.33.0=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor -org.checkerframework:checker-qual:3.8.0=testCompileClasspath,testRuntimeClasspath +org.checkerframework:checker-qual:3.33.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc @@ -141,6 +144,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -160,14 +164,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/couchbase/couchbase-2.0/gradle.lockfile b/dd-java-agent/instrumentation/couchbase/couchbase-2.0/gradle.lockfile index c46cccb802e..a9c14a4abcd 100644 --- a/dd-java-agent/instrumentation/couchbase/couchbase-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/couchbase/couchbase-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:couchbase:couchbase-2.0:dependencies --write-locks aopalliance:aopalliance:1.0=testCompileClasspath,testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -17,7 +18,7 @@ com.couchbase.client:java-client:2.7.23=latestDepTestCompileClasspath,latestDepT com.couchbase.mock:CouchbaseMock:1.5.19=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -28,15 +29,15 @@ com.fasterxml.jackson.core:jackson-core:2.6.4=testCompileClasspath,testRuntimeCl com.fasterxml.jackson.core:jackson-databind:2.10.5.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-databind:2.6.4=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -46,12 +47,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -67,12 +71,12 @@ io.opentracing:opentracing-api:0.31.0=latestDepTestCompileClasspath,latestDepTes io.reactivex:rxjava:1.0.0-rc.3=compileClasspath io.reactivex:rxjava:1.3.0=testCompileClasspath,testRuntimeClasspath io.reactivex:rxjava:1.3.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -101,6 +105,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -118,14 +123,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/couchbase/couchbase-2.6/gradle.lockfile b/dd-java-agent/instrumentation/couchbase/couchbase-2.6/gradle.lockfile index 30dbeb80d11..e5f2dfffa96 100644 --- a/dd-java-agent/instrumentation/couchbase/couchbase-2.6/gradle.lockfile +++ b/dd-java-agent/instrumentation/couchbase/couchbase-2.6/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:couchbase:couchbase-2.6:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -17,7 +18,7 @@ com.couchbase.client:java-client:2.7.23=latestDepTestCompileClasspath,latestDepT com.couchbase.mock:CouchbaseMock:1.5.19=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -28,15 +29,15 @@ com.fasterxml.jackson.core:jackson-core:2.9.7=testCompileClasspath,testRuntimeCl com.fasterxml.jackson.core:jackson-databind:2.9.10.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-databind:2.9.7=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -46,12 +47,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -65,12 +69,12 @@ io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeC io.opentracing:opentracing-api:0.31.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.reactivex:rxjava:1.3.7=compileClasspath,testCompileClasspath,testRuntimeClasspath io.reactivex:rxjava:1.3.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -99,6 +103,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -116,14 +121,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/couchbase/couchbase-3.1/gradle.lockfile b/dd-java-agent/instrumentation/couchbase/couchbase-3.1/gradle.lockfile index 8292a52088a..660fdef88a5 100644 --- a/dd-java-agent/instrumentation/couchbase/couchbase-3.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/couchbase/couchbase-3.1/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:couchbase:couchbase-3.1:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -12,7 +13,7 @@ com.couchbase.client:java-client:3.1.0=compileClasspath,testCompileClasspath,tes com.couchbase.client:java-client:3.1.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -21,15 +22,15 @@ com.github.docker-java:docker-java-api:3.4.2=latestDepTestCompileClasspath,lates com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -39,12 +40,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -57,12 +61,12 @@ de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,la io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath io.projectreactor:reactor-core:3.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath io.projectreactor:reactor-core:3.4.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -93,6 +97,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -110,14 +115,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.3=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/couchbase/couchbase-3.1/src/main/java/datadog/trace/instrumentation/couchbase_31/client/DatadogRequestTracer.java b/dd-java-agent/instrumentation/couchbase/couchbase-3.1/src/main/java/datadog/trace/instrumentation/couchbase_31/client/DatadogRequestTracer.java index 57d04969b98..bd508d4bd85 100644 --- a/dd-java-agent/instrumentation/couchbase/couchbase-3.1/src/main/java/datadog/trace/instrumentation/couchbase_31/client/DatadogRequestTracer.java +++ b/dd-java-agent/instrumentation/couchbase/couchbase-3.1/src/main/java/datadog/trace/instrumentation/couchbase_31/client/DatadogRequestTracer.java @@ -50,9 +50,9 @@ public RequestSpan requestSpan(String requestName, RequestSpan requestParent) { seedNodes = parent.getTag(InstrumentationTags.COUCHBASE_SEED_NODES); } - AgentTracer.SpanBuilder builder = tracer.singleSpanBuilder(spanName); + AgentTracer.SpanBuilder builder = tracer.singleSpanBuilder("couchbase", spanName); if (null != parent) { - builder.asChildOf(parent.context()); + builder.asChildOf(parent.spanContext()); } AgentSpan span = builder.start(); CouchbaseClientDecorator.DECORATE.afterStart(span); diff --git a/dd-java-agent/instrumentation/couchbase/couchbase-3.2/gradle.lockfile b/dd-java-agent/instrumentation/couchbase/couchbase-3.2/gradle.lockfile index 0a967173cca..74966ae92ec 100644 --- a/dd-java-agent/instrumentation/couchbase/couchbase-3.2/gradle.lockfile +++ b/dd-java-agent/instrumentation/couchbase/couchbase-3.2/gradle.lockfile @@ -1,18 +1,19 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:couchbase:couchbase-3.2:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.couchbase.client:core-io:2.2.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.couchbase.client:core-io:3.11.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.couchbase.client:java-client:3.11.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.couchbase.client:core-io:3.12.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.couchbase.client:java-client:3.12.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.couchbase.client:java-client:3.2.0=compileClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -21,15 +22,15 @@ com.github.docker-java:docker-java-api:3.4.2=latestDepTestCompileClasspath,lates com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -39,12 +40,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -57,12 +61,12 @@ de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,la io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath io.projectreactor:reactor-core:3.4.6=compileClasspath,testCompileClasspath,testRuntimeClasspath io.projectreactor:reactor-core:3.6.9=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -93,7 +97,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -111,14 +115,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.3=compileClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/couchbase/couchbase-3.2/src/main/java/datadog/trace/instrumentation/couchbase_32/client/DatadogRequestTracer.java b/dd-java-agent/instrumentation/couchbase/couchbase-3.2/src/main/java/datadog/trace/instrumentation/couchbase_32/client/DatadogRequestTracer.java index d330f5e36b9..8463e0e20b9 100644 --- a/dd-java-agent/instrumentation/couchbase/couchbase-3.2/src/main/java/datadog/trace/instrumentation/couchbase_32/client/DatadogRequestTracer.java +++ b/dd-java-agent/instrumentation/couchbase/couchbase-3.2/src/main/java/datadog/trace/instrumentation/couchbase_32/client/DatadogRequestTracer.java @@ -54,9 +54,9 @@ public RequestSpan requestSpan(String requestName, RequestSpan requestParent) { } } if (requestSpan == null) { - AgentTracer.SpanBuilder builder = tracer.singleSpanBuilder(spanName); + AgentTracer.SpanBuilder builder = tracer.singleSpanBuilder("couchbase", spanName); if (null != parent) { - builder.asChildOf(parent.context()); + builder.asChildOf(parent.spanContext()); } AgentSpan span = builder.start(); CouchbaseClientDecorator.DECORATE.afterStart(span); diff --git a/dd-java-agent/instrumentation/cucumber-5.4/gradle.lockfile b/dd-java-agent/instrumentation/cucumber-5.4/gradle.lockfile index 438bff09fe4..df011c9f093 100644 --- a/dd-java-agent/instrumentation/cucumber-5.4/gradle.lockfile +++ b/dd-java-agent/instrumentation/cucumber-5.4/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:cucumber-5.4:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -48,28 +52,28 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.cucumber:ci-environment:12.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:cucumber-core:5.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.cucumber:cucumber-core:7.34.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:cucumber-core:7.34.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:cucumber-expressions:18.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:cucumber-expressions:8.3.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.cucumber:cucumber-gherkin-messages:7.34.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:cucumber-gherkin-messages:7.34.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:cucumber-gherkin-vintage:5.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath io.cucumber:cucumber-gherkin:5.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.cucumber:cucumber-gherkin:7.34.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:cucumber-gherkin:7.34.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:cucumber-java:5.4.0=testCompileClasspath,testRuntimeClasspath -io.cucumber:cucumber-java:7.34.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:cucumber-java:7.34.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:cucumber-json-formatter:0.3.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:cucumber-junit-platform-engine:5.4.0=testCompileClasspath,testRuntimeClasspath -io.cucumber:cucumber-junit-platform-engine:7.34.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:cucumber-junit-platform-engine:7.34.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:cucumber-plugin:5.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.cucumber:cucumber-plugin:7.34.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:cucumber-plugin:7.34.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:datatable:3.3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.cucumber:datatable:7.34.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:datatable:7.34.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:docstring:5.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.cucumber:docstring:7.34.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:docstring:7.34.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:gherkin:36.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:html-formatter:22.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:junit-xml-formatter:0.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.cucumber:messages-ndjson:0.3.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:messages-ndjson:0.3.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:messages:30.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:pretty-formatter:2.4.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:query:14.7.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -79,12 +83,12 @@ io.cucumber:teamcity-formatter:0.2.0=latestDepTestCompileClasspath,latestDepTest io.cucumber:testng-xml-formatter:0.7.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:usage-formatter:0.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -114,6 +118,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath @@ -146,14 +151,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/cucumber-5.4/src/main/java/datadog/trace/instrumentation/cucumber/CucumberStepDecorator.java b/dd-java-agent/instrumentation/cucumber-5.4/src/main/java/datadog/trace/instrumentation/cucumber/CucumberStepDecorator.java index 4e5ac4401af..f0ad990cead 100644 --- a/dd-java-agent/instrumentation/cucumber-5.4/src/main/java/datadog/trace/instrumentation/cucumber/CucumberStepDecorator.java +++ b/dd-java-agent/instrumentation/cucumber-5.4/src/main/java/datadog/trace/instrumentation/cucumber/CucumberStepDecorator.java @@ -44,7 +44,7 @@ public AgentScope onStepStart(StepDefinition step, Object[] arguments) { public void onStepFinish(AgentScope scope) { AgentSpan span = scope.span(); beforeFinish(span); - span.finish(); scope.close(); + span.finish(); } } diff --git a/dd-java-agent/instrumentation/cxf-2.1/gradle.lockfile b/dd-java-agent/instrumentation/cxf-2.1/gradle.lockfile index 1987420209d..3c0f21da71e 100644 --- a/dd-java-agent/instrumentation/cxf-2.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/cxf-2.1/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:cxf-2.1:dependencies --write-locks aopalliance:aopalliance:1.0=compileClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -9,22 +10,22 @@ ch.qos.logback:logback-core:1.2.13=cxf3LatestDepTestCompileClasspath,cxf3LatestD com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.fasterxml.woodstox:woodstox-core:6.6.2=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath -com.fasterxml.woodstox:woodstox-core:7.1.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.woodstox:woodstox-core:7.2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,cxf3LatestDepTestAnnotationProcessor,cxf3LatestDepTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -34,12 +35,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,cxf3L com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,cxf3LatestDepTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,cxf3LatestDepTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,cxf3LatestDepTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,cxf3LatestDepTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,cxf3LatestDepTestAnnotationProcessor,cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,cxf3LatestDepTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -55,7 +59,7 @@ commons-lang:commons-lang:2.4=compileClasspath commons-logging:commons-logging:1.1.1=compileClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:1.2.2=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath jakarta.activation:jakarta.activation-api:2.1.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath @@ -64,7 +68,7 @@ jakarta.servlet:jakarta.servlet-api:6.1.0=latestDepTestCompileClasspath,latestDe jakarta.ws.rs:jakarta.ws.rs-api:2.1.6=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath jakarta.ws.rs:jakarta.ws.rs-api:4.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath jakarta.xml.bind:jakarta.xml.bind-api:2.3.3=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath -jakarta.xml.bind:jakarta.xml.bind-api:4.0.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +jakarta.xml.bind:jakarta.xml.bind-api:4.0.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath javax.activation:javax.activation-api:1.2.0=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.annotation:javax.annotation-api:1.2=testCompileClasspath javax.annotation:javax.annotation-api:1.3.2=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -75,8 +79,8 @@ javax.xml.bind:jaxb-api:2.1=compileClasspath javax.xml.bind:jaxb-api:2.3.1=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -89,19 +93,19 @@ org.apache.cxf:cxf-api:2.1=compileClasspath org.apache.cxf:cxf-common-schemas:2.1=compileClasspath org.apache.cxf:cxf-common-utilities:2.1=compileClasspath org.apache.cxf:cxf-core:3.0.0=testCompileClasspath,testRuntimeClasspath -org.apache.cxf:cxf-core:3.6.10=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath -org.apache.cxf:cxf-core:4.2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.cxf:cxf-core:3.6.11=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath +org.apache.cxf:cxf-core:4.2.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.cxf:cxf-rt-frontend-jaxrs:3.0.0=testCompileClasspath,testRuntimeClasspath -org.apache.cxf:cxf-rt-frontend-jaxrs:3.6.10=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath -org.apache.cxf:cxf-rt-frontend-jaxrs:4.2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.apache.cxf:cxf-rt-security:3.6.10=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath -org.apache.cxf:cxf-rt-security:4.2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.cxf:cxf-rt-frontend-jaxrs:3.6.11=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath +org.apache.cxf:cxf-rt-frontend-jaxrs:4.2.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.cxf:cxf-rt-security:3.6.11=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath +org.apache.cxf:cxf-rt-security:4.2.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.cxf:cxf-rt-transports-http-jetty:3.0.0=testCompileClasspath,testRuntimeClasspath -org.apache.cxf:cxf-rt-transports-http-jetty:3.6.10=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath -org.apache.cxf:cxf-rt-transports-http-jetty:4.2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.cxf:cxf-rt-transports-http-jetty:3.6.11=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath +org.apache.cxf:cxf-rt-transports-http-jetty:4.2.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.cxf:cxf-rt-transports-http:3.0.0=testCompileClasspath,testRuntimeClasspath -org.apache.cxf:cxf-rt-transports-http:3.6.10=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath -org.apache.cxf:cxf-rt-transports-http:4.2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.cxf:cxf-rt-transports-http:3.6.11=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath +org.apache.cxf:cxf-rt-transports-http:4.2.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.geronimo.specs:geronimo-activation_1.1_spec:1.0.2=compileClasspath org.apache.geronimo.specs:geronimo-annotation_1.0_spec:1.1.1=compileClasspath org.apache.geronimo.specs:geronimo-servlet_3.0_spec:1.0=testCompileClasspath,testRuntimeClasspath @@ -124,43 +128,44 @@ org.codehaus.groovy:groovy-xml:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codehaus.woodstox:stax2-api:3.1.4=testCompileClasspath,testRuntimeClasspath -org.codehaus.woodstox:stax2-api:4.2.2=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.codehaus.woodstox:stax2-api:4.2.2=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath +org.codehaus.woodstox:stax2-api:4.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.codehaus.woodstox:woodstox-core-asl:4.3.0=testCompileClasspath,testRuntimeClasspath org.codehaus.woodstox:wstx-asl:3.2.4=compileClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.eclipse.angus:angus-activation:2.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.eclipse.jetty.ee11:jetty-ee11-servlet:12.1.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.eclipse.jetty.ee11:jetty-ee11-servlet:12.1.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.eclipse.jetty.orbit:javax.servlet:3.0.0.v201112011016=testCompileClasspath,testRuntimeClasspath org.eclipse.jetty.toolchain:jetty-servlet-api:4.0.6=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath org.eclipse.jetty:jetty-continuation:8.1.15.v20140411=testCompileClasspath,testRuntimeClasspath org.eclipse.jetty:jetty-http:10.0.26=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath -org.eclipse.jetty:jetty-http:12.1.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.eclipse.jetty:jetty-http:12.1.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.eclipse.jetty:jetty-http:8.1.15.v20140411=testCompileClasspath,testRuntimeClasspath org.eclipse.jetty:jetty-io:10.0.26=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath -org.eclipse.jetty:jetty-io:12.1.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.eclipse.jetty:jetty-io:12.1.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.eclipse.jetty:jetty-io:8.1.15.v20140411=testCompileClasspath,testRuntimeClasspath org.eclipse.jetty:jetty-security:10.0.26=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath -org.eclipse.jetty:jetty-security:12.1.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.eclipse.jetty:jetty-security:12.1.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.eclipse.jetty:jetty-security:8.1.15.v20140411=testCompileClasspath,testRuntimeClasspath org.eclipse.jetty:jetty-server:10.0.26=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath -org.eclipse.jetty:jetty-server:12.1.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.eclipse.jetty:jetty-server:12.1.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.eclipse.jetty:jetty-server:8.1.15.v20140411=testCompileClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-session:12.1.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.eclipse.jetty:jetty-session:12.1.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.eclipse.jetty:jetty-util:10.0.26=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath -org.eclipse.jetty:jetty-util:12.1.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.eclipse.jetty:jetty-util:12.1.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.eclipse.jetty:jetty-util:8.1.15.v20140411=testCompileClasspath,testRuntimeClasspath -org.glassfish.jaxb:jaxb-core:4.0.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.glassfish.jaxb:jaxb-core:4.0.9=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.glassfish.jaxb:jaxb-runtime:2.3.5=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath -org.glassfish.jaxb:jaxb-runtime:4.0.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.glassfish.jaxb:jaxb-runtime:4.0.9=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.glassfish.jaxb:txw2:2.3.5=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath -org.glassfish.jaxb:txw2:4.0.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.glassfish.jaxb:txw2:4.0.9=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -178,21 +183,22 @@ org.objenesis:objenesis:3.3=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestR org.opentest4j:opentest4j:1.3.0=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,cxf3LatestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:2.0.13=cxf3LatestDepTestCompileClasspath -org.slf4j:slf4j-api:2.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,spotbugsSlf4j +org.slf4j:slf4j-api:2.0.17=latestDepTestCompileClasspath,spotbugs,spotbugsSlf4j +org.slf4j:slf4j-api:2.0.18=latestDepTestRuntimeClasspath org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,cxf3LatestDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath org.spockframework:spock-bom:2.4-groovy-3.0=cxf3LatestDepTestCompileClasspath,cxf3LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/cxf-2.1/src/main/java/datadog/trace/instrumentation/cxf/InvokerInstrumentation.java b/dd-java-agent/instrumentation/cxf-2.1/src/main/java/datadog/trace/instrumentation/cxf/InvokerInstrumentation.java index 775fe5fced3..c1625b98746 100644 --- a/dd-java-agent/instrumentation/cxf-2.1/src/main/java/datadog/trace/instrumentation/cxf/InvokerInstrumentation.java +++ b/dd-java-agent/instrumentation/cxf-2.1/src/main/java/datadog/trace/instrumentation/cxf/InvokerInstrumentation.java @@ -69,7 +69,7 @@ public static ContextScope beforeInvoke(@Advice.Argument(0) final Exchange excha return null; } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void afterInvoke(@Advice.Enter final ContextScope scope) { if (scope != null) { scope.close(); diff --git a/dd-java-agent/instrumentation/datadog/asm/iast-instrumenter/gradle.lockfile b/dd-java-agent/instrumentation/datadog/asm/iast-instrumenter/gradle.lockfile index 63a0ad98313..47c7283437e 100644 --- a/dd-java-agent/instrumentation/datadog/asm/iast-instrumenter/gradle.lockfile +++ b/dd-java-agent/instrumentation/datadog/asm/iast-instrumenter/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:datadog:asm:iast-instrumenter:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/datadog/dynamic-instrumentation/span-origin/gradle.lockfile b/dd-java-agent/instrumentation/datadog/dynamic-instrumentation/span-origin/gradle.lockfile index 5ca3972ba7b..cc4a35859a2 100644 --- a/dd-java-agent/instrumentation/datadog/dynamic-instrumentation/span-origin/gradle.lockfile +++ b/dd-java-agent/instrumentation/datadog/dynamic-instrumentation/span-origin/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:datadog:dynamic-instrumentation:span-origin:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/datadog/dynamic-instrumentation/span-origin/src/main/java/datadog/trace/instrumentation/codeorigin/CodeOriginInstrumentation.java b/dd-java-agent/instrumentation/datadog/dynamic-instrumentation/span-origin/src/main/java/datadog/trace/instrumentation/codeorigin/CodeOriginInstrumentation.java index 239c1f0e962..db77d1b8bc5 100644 --- a/dd-java-agent/instrumentation/datadog/dynamic-instrumentation/span-origin/src/main/java/datadog/trace/instrumentation/codeorigin/CodeOriginInstrumentation.java +++ b/dd-java-agent/instrumentation/datadog/dynamic-instrumentation/span-origin/src/main/java/datadog/trace/instrumentation/codeorigin/CodeOriginInstrumentation.java @@ -1,13 +1,12 @@ package datadog.trace.instrumentation.codeorigin; -import static net.bytebuddy.matcher.ElementMatchers.declaresMethod; -import static net.bytebuddy.matcher.ElementMatchers.hasSuperType; -import static net.bytebuddy.matcher.ElementMatchers.isAnnotatedWith; -import static net.bytebuddy.matcher.ElementMatchers.isInterface; +import static datadog.trace.agent.tooling.bytebuddy.matcher.HierarchyMatchers.declaresMethod; +import static datadog.trace.agent.tooling.bytebuddy.matcher.HierarchyMatchers.implementsInterface; +import static datadog.trace.agent.tooling.bytebuddy.matcher.HierarchyMatchers.isAnnotatedWith; +import static net.bytebuddy.matcher.ElementMatchers.isDeclaredBy; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule.Tracing; -import datadog.trace.agent.tooling.bytebuddy.matcher.HierarchyMatchers; import datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers; import datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.OneOf; import datadog.trace.api.InstrumenterConfig; @@ -16,7 +15,6 @@ import net.bytebuddy.description.NamedElement; import net.bytebuddy.description.type.TypeDescription; import net.bytebuddy.matcher.ElementMatcher; -import net.bytebuddy.matcher.ElementMatchers; public abstract class CodeOriginInstrumentation extends Tracing implements Instrumenter.ForTypeHierarchy, Instrumenter.HasMethodAdvice { @@ -44,13 +42,9 @@ public String hierarchyMarkerType() { @Override public ElementMatcher hierarchyMatcher() { ElementMatcher.Junction matcher = - HierarchyMatchers.declaresMethod(HierarchyMatchers.isAnnotatedWith(this.matcher)); + declaresMethod(isAnnotatedWith(this.matcher)); if (InstrumenterConfig.get().isCodeOriginInterfaceSupport()) { - matcher = - matcher.or( - HierarchyMatchers.implementsInterface( - HierarchyMatchers.declaresMethod( - HierarchyMatchers.isAnnotatedWith(this.matcher)))); + matcher = matcher.or(implementsInterface(declaresMethod(isAnnotatedWith(this.matcher)))); } return matcher; } @@ -58,12 +52,10 @@ public ElementMatcher hierarchyMatcher() { @Override public void methodAdvice(MethodTransformer transformer) { transformer.applyAdvice( - HierarchyMatchers.isAnnotatedWith(matcher), - "datadog.trace.instrumentation.codeorigin.EntrySpanOriginAdvice"); + isAnnotatedWith(matcher), "datadog.trace.instrumentation.codeorigin.EntrySpanOriginAdvice"); if (InstrumenterConfig.get().isCodeOriginInterfaceSupport()) { transformer.applyAdvice( - ElementMatchers.isDeclaredBy( - hasSuperType(isInterface().and(declaresMethod(isAnnotatedWith(matcher))))), + isDeclaredBy(implementsInterface(declaresMethod(isAnnotatedWith(matcher)))), "datadog.trace.instrumentation.codeorigin.EntrySpanOriginAdvice"); } } diff --git a/dd-java-agent/instrumentation/datadog/profiling/enable-wallclock-profiling/gradle.lockfile b/dd-java-agent/instrumentation/datadog/profiling/enable-wallclock-profiling/gradle.lockfile index c2d375bf513..50a7c6bf8e6 100644 --- a/dd-java-agent/instrumentation/datadog/profiling/enable-wallclock-profiling/gradle.lockfile +++ b/dd-java-agent/instrumentation/datadog/profiling/enable-wallclock-profiling/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:datadog:profiling:enable-wallclock-profiling:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDep4TestCompileClasspath,latestDep4Test com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDep4TestAnnotationProcessor,latestDep4TestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDep4TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDep4TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDep4TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDep4TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDep4TestAnnotationProcessor,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDep4TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -49,7 +53,7 @@ de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDep4TestCompileClasspath,l io.leangen.geantyref:geantyref:1.3.16=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.netty:netty-all:4.1.108.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-buffer:4.1.108.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-buffer:4.2.12.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-buffer:4.2.16.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-dns:4.1.108.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-codec-haproxy:4.1.108.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-codec-http2:4.1.108.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -63,7 +67,7 @@ io.netty:netty-codec-stomp:4.1.108.Final=latestDep4TestCompileClasspath,latestDe io.netty:netty-codec-xml:4.1.108.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-codec:4.1.108.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-common:4.1.108.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-common:4.2.12.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-common:4.2.16.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-handler-proxy:4.1.108.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-handler-ssl-ocsp:4.1.108.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-handler:4.1.108.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -71,7 +75,7 @@ io.netty:netty-resolver-dns-classes-macos:4.1.108.Final=latestDep4TestCompileCla io.netty:netty-resolver-dns-native-macos:4.1.108.Final=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.netty:netty-resolver-dns:4.1.108.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-resolver:4.1.108.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-resolver:4.2.12.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver:4.2.16.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport-classes-epoll:4.1.108.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-transport-classes-kqueue:4.1.108.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-transport-native-epoll:4.1.108.Final=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -81,13 +85,13 @@ io.netty:netty-transport-rxtx:4.1.108.Final=latestDep4TestCompileClasspath,lates io.netty:netty-transport-sctp:4.1.108.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-transport-udt:4.1.108.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.1.108.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-transport:4.2.12.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.netty:netty-transport:4.2.16.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -116,6 +120,7 @@ org.hamcrest:hamcrest-core:1.3=latestDep4TestRuntimeClasspath,latestDepTestRunti org.hamcrest:hamcrest:3.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -133,14 +138,14 @@ org.objenesis:objenesis:3.3=latestDep4TestCompileClasspath,latestDep4TestRuntime org.opentest4j:opentest4j:1.3.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/datadog/profiling/enable-wallclock-profiling/src/main/java/datadog/trace/instrumentation/wallclock/EnableWallclockProfilingInstrumentation.java b/dd-java-agent/instrumentation/datadog/profiling/enable-wallclock-profiling/src/main/java/datadog/trace/instrumentation/wallclock/EnableWallclockProfilingInstrumentation.java index 33567a42048..42750e317ba 100644 --- a/dd-java-agent/instrumentation/datadog/profiling/enable-wallclock-profiling/src/main/java/datadog/trace/instrumentation/wallclock/EnableWallclockProfilingInstrumentation.java +++ b/dd-java-agent/instrumentation/datadog/profiling/enable-wallclock-profiling/src/main/java/datadog/trace/instrumentation/wallclock/EnableWallclockProfilingInstrumentation.java @@ -94,7 +94,7 @@ public static boolean before() { return false; } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void after(@Advice.Enter boolean wasDisabled) { if (wasDisabled) { AgentTracer.get().getProfilingContext().onDetach(); diff --git a/dd-java-agent/instrumentation/datadog/profiling/exception-profiling/gradle.lockfile b/dd-java-agent/instrumentation/datadog/profiling/exception-profiling/gradle.lockfile index c113612ca81..d6d270aa96a 100644 --- a/dd-java-agent/instrumentation/datadog/profiling/exception-profiling/gradle.lockfile +++ b/dd-java-agent/instrumentation/datadog/profiling/exception-profiling/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:datadog:profiling:exception-profiling:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -82,6 +86,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -103,14 +108,14 @@ org.openjdk.jmc:flightrecorder:8.1.0=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.owasp.encoder:encoder:1.2.3=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/datadog/tracing/trace-annotation/gradle.lockfile b/dd-java-agent/instrumentation/datadog/tracing/trace-annotation/gradle.lockfile index feb2a7a7d7c..85f17afb16f 100644 --- a/dd-java-agent/instrumentation/datadog/tracing/trace-annotation/gradle.lockfile +++ b/dd-java-agent/instrumentation/datadog/tracing/trace-annotation/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:datadog:tracing:trace-annotation:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.newrelic.agent.java:newrelic-api:6.5.4=testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -48,12 +52,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -82,6 +86,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -99,14 +104,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/datadog/tracing/trace-annotation/src/main/java/datadog/trace/instrumentation/trace_annotation/DoNotTraceAdvice.java b/dd-java-agent/instrumentation/datadog/tracing/trace-annotation/src/main/java/datadog/trace/instrumentation/trace_annotation/DoNotTraceAdvice.java index 754cacda5c1..9248a676519 100644 --- a/dd-java-agent/instrumentation/datadog/tracing/trace-annotation/src/main/java/datadog/trace/instrumentation/trace_annotation/DoNotTraceAdvice.java +++ b/dd-java-agent/instrumentation/datadog/tracing/trace-annotation/src/main/java/datadog/trace/instrumentation/trace_annotation/DoNotTraceAdvice.java @@ -15,7 +15,7 @@ public static AgentScope before() { return activateSpan(blackholeSpan()); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void after( @Advice.Enter final AgentScope scope, @Advice.Origin final MethodType methodType, diff --git a/dd-java-agent/instrumentation/datanucleus-4.0.5/build.gradle b/dd-java-agent/instrumentation/datanucleus-4.0.5/build.gradle index 4fb501a01ab..d440e52111b 100644 --- a/dd-java-agent/instrumentation/datanucleus-4.0.5/build.gradle +++ b/dd-java-agent/instrumentation/datanucleus-4.0.5/build.gradle @@ -1,24 +1,3 @@ -import org.datanucleus.enhancer.DataNucleusEnhancer - -buildscript { - repositories { - mavenLocal() - if (project.rootProject.hasProperty("mavenRepositoryProxy")) { - maven { - url project.rootProject.property("mavenRepositoryProxy") - allowInsecureProtocol = true - } - } - mavenCentral() - } - - dependencies { - classpath group: 'org.datanucleus', name: 'datanucleus-core', version: '4.0.5' - classpath group: 'org.datanucleus', name: 'datanucleus-api-jdo', version: '4.0.5' - classpath group: 'org.datanucleus', name: 'javax.jdo', version: '3.2.0-m1' - } -} - muzzle { // 2 libraries are instrumented. // Muzzle is tested by keeping one version fixed and modifying the other @@ -44,24 +23,34 @@ apply from: "${rootDir}/gradle/java.gradle" def datanucleusVersion = '4.0.5' +def datanucleusEnhancer = configurations.register("datanucleusEnhancer") { + canBeConsumed = false + canBeResolved = true +} + // Datanucleus modifies persistable objects with bytecode manipulation // The unofficial plugin (org.rm3l.datanucleus-gradle-plugin) doesn't work with our build // The enhancement is done manually here for the test classes // LatestDepTest can't be used because the enhancer class generates incompatible code // Specifically, org.datanucleus.enhancer.Persistable changes package -// Only one version can be set as the script classpath in the 'buildScript' block tasks.register('enhance') { doLast { - def outputUrls = (sourceSets.test.output.classesDirs.files + sourceSets.test.output.resourcesDir) + def outputUrls = (datanucleusEnhancer.get().files + sourceSets.test.output.classesDirs.files + sourceSets.test.output.resourcesDir) + .findAll { it != null } .collect { it.toURI().toURL() } as URL[] def testClassloader = new URLClassLoader(outputUrls, Thread.currentThread().getContextClassLoader()) - - DataNucleusEnhancer enhancer = new DataNucleusEnhancer("JDO", null) - enhancer.setVerbose(true).addPersistenceUnit("testPersistenceUnit") - enhancer.setSystemOut(true) - enhancer.setClassLoader(testClassloader) - enhancer.enhance() + try { + def enhancerClass = testClassloader.loadClass("org.datanucleus.enhancer.DataNucleusEnhancer") + enhancerClass.getConstructor(String, Properties).newInstance("JDO", null).with { + setVerbose(true).addPersistenceUnit("testPersistenceUnit") + setSystemOut(true) + setClassLoader(testClassloader) + enhance() + } + } finally { + testClassloader.close() + } } dependsOn "testClasses" @@ -82,4 +71,8 @@ dependencies { testImplementation group: 'org.datanucleus', name: 'datanucleus-rdbms', version: datanucleusVersion testImplementation group: 'org.datanucleus', name: 'javax.jdo', version: '3.2.0-m1' testImplementation group: 'com.h2database', name: 'h2', version: '1.3.169' + + add(datanucleusEnhancer.name, "org.datanucleus:datanucleus-core:$datanucleusVersion") + add(datanucleusEnhancer.name, "org.datanucleus:datanucleus-api-jdo:$datanucleusVersion") + add(datanucleusEnhancer.name, "org.datanucleus:javax.jdo:3.2.0-m1") } diff --git a/dd-java-agent/instrumentation/datanucleus-4.0.5/gradle.lockfile b/dd-java-agent/instrumentation/datanucleus-4.0.5/gradle.lockfile index 445b7ddb76d..b640f44265c 100644 --- a/dd-java-agent/instrumentation/datanucleus-4.0.5/gradle.lockfile +++ b/dd-java-agent/instrumentation/datanucleus-4.0.5/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:datanucleus-4.0.5:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.h2database:h2:1.3.169=testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -48,13 +52,13 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath -javax.transaction:transaction-api:1.1=compileClasspath,testCompileClasspath,testRuntimeClasspath +javax.transaction:transaction-api:1.1=compileClasspath,datanucleusEnhancer,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -77,16 +81,17 @@ org.codehaus.groovy:groovy-xml:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc -org.datanucleus:datanucleus-api-jdo:4.0.5=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.datanucleus:datanucleus-core:4.0.5=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.datanucleus:datanucleus-api-jdo:4.0.5=compileClasspath,datanucleusEnhancer,testCompileClasspath,testRuntimeClasspath +org.datanucleus:datanucleus-core:4.0.5=compileClasspath,datanucleusEnhancer,testCompileClasspath,testRuntimeClasspath org.datanucleus:datanucleus-rdbms:4.0.5=testCompileClasspath,testRuntimeClasspath -org.datanucleus:javax.jdo:3.2.0-m1=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.datanucleus:javax.jdo:3.2.0-m1=compileClasspath,datanucleusEnhancer,testCompileClasspath,testRuntimeClasspath org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -104,14 +109,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/datanucleus-4.0.5/src/main/java/datadog/trace/instrumentation/datanucleus/DatanucleusDecorator.java b/dd-java-agent/instrumentation/datanucleus-4.0.5/src/main/java/datadog/trace/instrumentation/datanucleus/DatanucleusDecorator.java index bbd970de659..cbd9aa4d665 100644 --- a/dd-java-agent/instrumentation/datanucleus-4.0.5/src/main/java/datadog/trace/instrumentation/datanucleus/DatanucleusDecorator.java +++ b/dd-java-agent/instrumentation/datanucleus-4.0.5/src/main/java/datadog/trace/instrumentation/datanucleus/DatanucleusDecorator.java @@ -46,7 +46,7 @@ public CharSequence entityName(final Object entity) { return className(entity.getClass()); } - public AgentSpan setResourceFromIdOrClass(AgentSpan span, Object id, String className) { + public void setResourceFromIdOrClass(AgentSpan span, Object id, String className) { String targetClass = null; if (className != null) { targetClass = className; @@ -59,8 +59,6 @@ public AgentSpan setResourceFromIdOrClass(AgentSpan span, Object id, String clas if (targetClass != null && !targetClass.isEmpty()) { span.setResourceName(targetClass.substring(targetClass.lastIndexOf(".") + 1)); } - - return span; } @Override diff --git a/dd-java-agent/instrumentation/datanucleus-4.0.5/src/main/java/datadog/trace/instrumentation/datanucleus/ExecutionContextInstrumentation.java b/dd-java-agent/instrumentation/datanucleus-4.0.5/src/main/java/datadog/trace/instrumentation/datanucleus/ExecutionContextInstrumentation.java index 573e51aff53..74518e0cee8 100644 --- a/dd-java-agent/instrumentation/datanucleus-4.0.5/src/main/java/datadog/trace/instrumentation/datanucleus/ExecutionContextInstrumentation.java +++ b/dd-java-agent/instrumentation/datanucleus-4.0.5/src/main/java/datadog/trace/instrumentation/datanucleus/ExecutionContextInstrumentation.java @@ -97,8 +97,8 @@ public static void endMethod( DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); - span.finish(); scope.close(); + span.finish(); } } @@ -133,8 +133,8 @@ public static void endMethod( DECORATE.onOperation(span, entity); DECORATE.beforeFinish(span); - span.finish(); scope.close(); + span.finish(); } } @@ -164,8 +164,8 @@ public static void endMethod( DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); - span.finish(); scope.close(); + span.finish(); } } @@ -195,8 +195,8 @@ public static void endMethod( DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); - span.finish(); scope.close(); + span.finish(); } } } diff --git a/dd-java-agent/instrumentation/datanucleus-4.0.5/src/main/java/datadog/trace/instrumentation/datanucleus/JDOQueryInstrumentation.java b/dd-java-agent/instrumentation/datanucleus-4.0.5/src/main/java/datadog/trace/instrumentation/datanucleus/JDOQueryInstrumentation.java index 1fec8683117..abd3fb76f1c 100644 --- a/dd-java-agent/instrumentation/datanucleus-4.0.5/src/main/java/datadog/trace/instrumentation/datanucleus/JDOQueryInstrumentation.java +++ b/dd-java-agent/instrumentation/datanucleus-4.0.5/src/main/java/datadog/trace/instrumentation/datanucleus/JDOQueryInstrumentation.java @@ -89,8 +89,8 @@ public static void endExecute( DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); - span.finish(); scope.close(); + span.finish(); } } } diff --git a/dd-java-agent/instrumentation/datanucleus-4.0.5/src/main/java/datadog/trace/instrumentation/datanucleus/JDOTransactionInstrumentation.java b/dd-java-agent/instrumentation/datanucleus-4.0.5/src/main/java/datadog/trace/instrumentation/datanucleus/JDOTransactionInstrumentation.java index 196da352374..a3158a7d3c0 100644 --- a/dd-java-agent/instrumentation/datanucleus-4.0.5/src/main/java/datadog/trace/instrumentation/datanucleus/JDOTransactionInstrumentation.java +++ b/dd-java-agent/instrumentation/datanucleus-4.0.5/src/main/java/datadog/trace/instrumentation/datanucleus/JDOTransactionInstrumentation.java @@ -51,8 +51,8 @@ public static void end( DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); - span.finish(); scope.close(); + span.finish(); } } } diff --git a/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-3.0/build.gradle b/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-3.0/build.gradle index 0eba6eadd02..d8dc5c49f88 100644 --- a/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-3.0/build.gradle +++ b/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-3.0/build.gradle @@ -40,7 +40,6 @@ muzzle { apply from: "$rootDir/gradle/java.gradle" - testJvmConstraints { // Test use Cassandra 3 which requires Java 8. (Currently incompatible with Java 9.) maxJavaVersion = JavaVersion.VERSION_1_8 @@ -49,6 +48,13 @@ testJvmConstraints { addTestSuiteForDir('latestDepTest', 'test') dependencies { + constraints { + testImplementation("com.google.guava:guava") { + version { strictly "19.0" } + because "cassandra-driver-core 3.x is not compatible with Guava 20+" + } + } + compileOnly group: 'com.datastax.cassandra', name: 'cassandra-driver-core', version: '3.0.0' compileOnly group: 'com.google.guava', name: 'guava', version: '18.0' diff --git a/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-3.0/gradle.lockfile b/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-3.0/gradle.lockfile index 17e6bda65f9..e827bb610f7 100644 --- a/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-3.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-3.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:datastax-cassandra:datastax-cassandra-3.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -23,21 +24,21 @@ com.github.javaparser:javaparser-core:3.25.6=codenarc com.github.jbellis:jamm:0.3.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.jnr:jffi:1.2.10=testCompileClasspath com.github.jnr:jffi:1.2.16=latestDepTestCompileClasspath -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.9.0=testCompileClasspath com.github.jnr:jnr-constants:0.9.9=latestDepTestCompileClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-ffi:2.0.7=testCompileClasspath com.github.jnr:jnr-ffi:2.1.7=latestDepTestCompileClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-posix:3.0.27=testCompileClasspath com.github.jnr:jnr-posix:3.0.44=latestDepTestCompileClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -53,7 +54,7 @@ com.google.guava:guava:19.0=latestDepTestCompileClasspath,latestDepTestRuntimeCl com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -81,12 +82,12 @@ io.netty:netty-handler:4.0.56.Final=latestDepTestCompileClasspath,latestDepTestR io.netty:netty-transport:4.0.33.Final=compileClasspath io.netty:netty-transport:4.0.44.Final=testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.0.56.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -136,16 +137,16 @@ org.ow2.asm:asm-analysis:5.0.3=latestDepTestCompileClasspath,testCompileClasspat org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs org.ow2.asm:asm-commons:5.0.3=latestDepTestCompileClasspath,testCompileClasspath +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:5.0.3=latestDepTestCompileClasspath,testCompileClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:5.0.3=latestDepTestCompileClasspath,testCompileClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-3.0/src/main/java/datadog/trace/instrumentation/datastax/cassandra/CassandraClientDecorator.java b/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-3.0/src/main/java/datadog/trace/instrumentation/datastax/cassandra/CassandraClientDecorator.java index 09f83cd84fa..ac3bfe440a8 100644 --- a/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-3.0/src/main/java/datadog/trace/instrumentation/datastax/cassandra/CassandraClientDecorator.java +++ b/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-3.0/src/main/java/datadog/trace/instrumentation/datastax/cassandra/CassandraClientDecorator.java @@ -78,12 +78,11 @@ protected String dbHostname(Session session) { return null; } - public AgentSpan onStatement(final AgentSpan span, final CharSequence statement) { + public void onStatement(final AgentSpan span, final CharSequence statement) { span.setResourceName(normalizedQuery(statement)); - return span; } - public AgentSpan onResponse(final AgentSpan span, final ResultSet result) { + public void onResponse(final AgentSpan span, final ResultSet result) { if (result != null) { final Host host = result.getExecutionInfo().getQueriedHost(); onPeerConnection(span, host.getSocketAddress()); @@ -100,6 +99,5 @@ public AgentSpan onResponse(final AgentSpan span, final ResultSet result) { } catch (final Throwable ignored) { } } - return span; } } diff --git a/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-3.8/gradle.lockfile b/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-3.8/gradle.lockfile index fb49c4de0a2..4fc84bb3fbc 100644 --- a/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-3.8/gradle.lockfile +++ b/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-3.8/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:datastax-cassandra:datastax-cassandra-3.8:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -23,18 +24,18 @@ com.github.docker-java:docker-java-transport:3.4.2=latestDepTestCompileClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc com.github.jbellis:jamm:0.3.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.jnr:jffi:1.2.16=compileClasspath,latestDepTestCompileClasspath,testCompileClasspath -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.9.9=compileClasspath,latestDepTestCompileClasspath,testCompileClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-ffi:2.1.7=compileClasspath,latestDepTestCompileClasspath,testCompileClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-posix:3.0.44=compileClasspath,latestDepTestCompileClasspath,testCompileClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -44,12 +45,16 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:19.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:19.0=compileClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -66,12 +71,12 @@ io.netty:netty-codec:4.0.56.Final=compileClasspath,latestDepTestCompileClasspath io.netty:netty-common:4.0.56.Final=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-handler:4.0.56.Final=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.0.56.Final=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -102,6 +107,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -121,16 +127,16 @@ org.ow2.asm:asm-analysis:5.0.3=compileClasspath,latestDepTestCompileClasspath,te org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs org.ow2.asm:asm-commons:5.0.3=compileClasspath,latestDepTestCompileClasspath,testCompileClasspath +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:5.0.3=compileClasspath,latestDepTestCompileClasspath,testCompileClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:5.0.3=compileClasspath,latestDepTestCompileClasspath,testCompileClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-4.0/gradle.lockfile b/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-4.0/gradle.lockfile index e4f41cd17b5..94b1aefb175 100644 --- a/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-4.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-4.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:datastax-cassandra:datastax-cassandra-4.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -33,22 +34,23 @@ com.github.docker-java:docker-java-transport:3.4.2=latestDepTestCompileClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc com.github.jbellis:jamm:0.3.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.jnr:jffi:1.2.17=compileClasspath,testCompileClasspath -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jffi:1.3.9=latestDepTestCompileClasspath com.github.jnr:jnr-a64asm:1.0.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.3=latestDepTestCompileClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.9.9=compileClasspath,testCompileClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-ffi:2.1.9=compileClasspath,testCompileClasspath com.github.jnr:jnr-ffi:2.2.11=latestDepTestCompileClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-posix:3.0.49=compileClasspath,testCompileClasspath com.github.jnr:jnr-posix:3.1.15=latestDepTestCompileClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:3.1.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -58,12 +60,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:19.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -91,12 +96,12 @@ io.netty:netty-resolver:4.1.94.Final=latestDepTestCompileClasspath,latestDepTest io.netty:netty-transport-native-unix-common:4.1.94.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.34.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.1.94.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -129,6 +134,7 @@ org.hdrhistogram:HdrHistogram:2.1.12=latestDepTestCompileClasspath,latestDepTest org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -149,19 +155,19 @@ org.ow2.asm:asm-analysis:9.2=latestDepTestCompileClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs org.ow2.asm:asm-commons:5.0.3=compileClasspath,testCompileClasspath +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.2=latestDepTestCompileClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:5.0.3=compileClasspath,testCompileClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.2=latestDepTestCompileClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:5.0.3=compileClasspath,testCompileClasspath org.ow2.asm:asm-util:9.2=latestDepTestCompileClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-4.0/src/main/java/datadog/trace/instrumentation/datastax/cassandra4/CassandraClientDecorator.java b/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-4.0/src/main/java/datadog/trace/instrumentation/datastax/cassandra4/CassandraClientDecorator.java index 73badd7fbd2..22688bca2ba 100644 --- a/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-4.0/src/main/java/datadog/trace/instrumentation/datastax/cassandra4/CassandraClientDecorator.java +++ b/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-4.0/src/main/java/datadog/trace/instrumentation/datastax/cassandra4/CassandraClientDecorator.java @@ -82,41 +82,32 @@ protected String dbHostname(Session session) { return null; } - public AgentSpan onStatement(final AgentSpan span, final CharSequence statement) { + public void onStatement(final AgentSpan span, final CharSequence statement) { span.setResourceName(normalizedQuery(statement)); - return span; } - public AgentSpan onResponse(final AgentSpan span, final ResultSet result) { + public void onResponse(final AgentSpan span, final ResultSet result) { if (result != null) { - return onResponse( - span, result.getExecutionInfo().getCoordinator(), result.getColumnDefinitions()); + onResponse(span, result.getExecutionInfo().getCoordinator(), result.getColumnDefinitions()); } - - return span; } - public AgentSpan onResponse(final AgentSpan span, final AsyncResultSet result) { + public void onResponse(final AgentSpan span, final AsyncResultSet result) { if (result != null) { - return onResponse( - span, result.getExecutionInfo().getCoordinator(), result.getColumnDefinitions()); + onResponse(span, result.getExecutionInfo().getCoordinator(), result.getColumnDefinitions()); } - - return span; } @Override - public AgentSpan onError(final AgentSpan span, final Throwable throwable) { + public void onError(final AgentSpan span, final Throwable throwable) { super.onError(span, throwable); if (throwable instanceof CoordinatorException) { onResponse(span, ((CoordinatorException) throwable).getCoordinator(), null); } - - return span; } - private AgentSpan onResponse(AgentSpan span, Node coordinator, ColumnDefinitions columns) { + private void onResponse(AgentSpan span, Node coordinator, ColumnDefinitions columns) { if (coordinator != null) { SocketAddress address = coordinator.getEndPoint().resolve(); if (address instanceof InetSocketAddress) { @@ -134,6 +125,5 @@ private AgentSpan onResponse(AgentSpan span, Node coordinator, ColumnDefinitions } } catch (final Throwable ignored) { } - return span; } } diff --git a/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-4.0/src/main/java/datadog/trace/instrumentation/datastax/cassandra4/TracingSession.java b/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-4.0/src/main/java/datadog/trace/instrumentation/datastax/cassandra4/TracingSession.java index 090f6983310..23cdb14b3d2 100644 --- a/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-4.0/src/main/java/datadog/trace/instrumentation/datastax/cassandra4/TracingSession.java +++ b/dd-java-agent/instrumentation/datastax-cassandra/datastax-cassandra-4.0/src/main/java/datadog/trace/instrumentation/datastax/cassandra4/TracingSession.java @@ -17,16 +17,16 @@ import com.datastax.oss.driver.api.core.session.Session; import com.datastax.oss.driver.api.core.type.reflect.GenericType; import com.datastax.oss.driver.internal.core.session.SessionWrapper; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.InstrumentationTags; import datadog.trace.util.AgentThreadFactory; -import edu.umd.cs.findbugs.annotations.Nullable; import java.util.concurrent.CompletionException; import java.util.concurrent.CompletionStage; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import javax.annotation.Nonnull; +import javax.annotation.Nullable; public class TracingSession extends SessionWrapper implements CqlSession { private static final ExecutorService EXECUTOR_SERVICE = @@ -62,7 +62,7 @@ private ResultSet wrapSyncRequest(Statement request) { DECORATE.onStatement(span, getQuery(request)); span.setTag(InstrumentationTags.CASSANDRA_CONTACT_POINTS, contactPoints); - try (AgentScope scope = activateSpan(span)) { + try (ContextScope scope = activateSpan(span)) { ResultSet resultSet = getDelegate().execute(request, Statement.SYNC); DECORATE.onResponse(span, resultSet); DECORATE.beforeFinish(span); @@ -86,7 +86,7 @@ private CompletionStage wrapAsyncRequest(Statement request) { DECORATE.onStatement(span, getQuery(request)); span.setTag(InstrumentationTags.CASSANDRA_CONTACT_POINTS, contactPoints); - try (AgentScope scope = activateSpan(span)) { + try (ContextScope scope = activateSpan(span)) { CompletionStage completionStage = getDelegate().execute(request, Statement.ASYNC); diff --git a/dd-java-agent/instrumentation/drools/drools-6.0/gradle.lockfile b/dd-java-agent/instrumentation/drools/drools-6.0/gradle.lockfile index b21052a2d08..20b10f3f3ad 100644 --- a/dd-java-agent/instrumentation/drools/drools-6.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/drools/drools-6.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:drools:drools-6.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latest7TestCompileClasspath,latest7TestRuntim com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latest7TestAnnotationProcessor,latest7TestCompileClasspath,latest8TestAnnotationProcessor,latest8TestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,13 +32,16 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latest7TestAnnotationProcessor,latest8TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latest7TestAnnotationProcessor,latest8TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latest7TestAnnotationProcessor,latest8TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latest7TestAnnotationProcessor,latest8TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latest7TestAnnotationProcessor,latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestAnnotationProcessor,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latest7TestAnnotationProcessor,latest8TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:3.1=latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.protobuf:protobuf-java:2.5.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -53,12 +57,12 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.github.x-stream:mxparser:1.2.2=latest7TestCompileClasspath,latest7TestRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -129,6 +133,7 @@ org.hamcrest:hamcrest-core:1.3=latest7TestRuntimeClasspath,latest8TestRuntimeCla org.hamcrest:hamcrest:3.0=latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -170,14 +175,14 @@ org.objenesis:objenesis:3.3=latest7TestCompileClasspath,latest7TestRuntimeClassp org.opentest4j:opentest4j:1.3.0=latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latest7TestRuntimeClasspath,latest8TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latest7TestCompileClasspath,latest7TestRuntimeClasspath,latest8TestCompileClasspath,latest8TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/dropwizard/dropwizard-0.8/build.gradle b/dd-java-agent/instrumentation/dropwizard/dropwizard-0.8/build.gradle index c5d82fd530e..82925a513e6 100644 --- a/dd-java-agent/instrumentation/dropwizard/dropwizard-0.8/build.gradle +++ b/dd-java-agent/instrumentation/dropwizard/dropwizard-0.8/build.gradle @@ -23,3 +23,11 @@ dependencies { // Anything 1.0+ fails with a java.lang.NoClassDefFoundError: org/eclipse/jetty/server/RequestLog // latestDepTestImplementation group: 'io.dropwizard', name: 'dropwizard-testing', version: '1.+' } + +// Dropwizard 0.8 (via Jackson's FuzzyEnumModule) references the CharMatcher.WHITESPACE field, +// which present only until 25.1-jre. +['testCompileClasspath', 'testRuntimeClasspath'].each { + configurations.named(it) { + resolutionStrategy.force 'com.google.guava:guava:25.1-jre' + } +} diff --git a/dd-java-agent/instrumentation/dropwizard/dropwizard-0.8/gradle.lockfile b/dd-java-agent/instrumentation/dropwizard/dropwizard-0.8/gradle.lockfile index 727c0078d6c..1c256038c4f 100644 --- a/dd-java-agent/instrumentation/dropwizard/dropwizard-0.8/gradle.lockfile +++ b/dd-java-agent/instrumentation/dropwizard/dropwizard-0.8/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:dropwizard:dropwizard-0.8:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -25,15 +26,15 @@ com.fasterxml.jackson.module:jackson-module-afterburner:2.9.10=testCompileClassp com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.5.1=testCompileClasspath,testRuntimeClasspath com.fasterxml:classmate:1.0.0=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -41,14 +42,16 @@ com.google.auto.service:auto-service:1.1.1=annotationProcessor,testAnnotationPro com.google.auto:auto-common:1.2.1=annotationProcessor,testAnnotationProcessor com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs +com.google.errorprone:error_prone_annotations:2.1.3=testCompileClasspath,testRuntimeClasspath com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:18.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:25.1-jre=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:1.1=testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -80,7 +83,7 @@ io.dropwizard:dropwizard-testing:0.8.0=testCompileClasspath,testRuntimeClasspath io.dropwizard:dropwizard-util:0.8.0=testCompileClasspath,testRuntimeClasspath io.dropwizard:dropwizard-validation:0.8.0=testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.activation:activation:1.1=testCompileClasspath,testRuntimeClasspath javax.annotation:javax.annotation-api:1.2=testCompileClasspath,testRuntimeClasspath javax.inject:javax.inject:1=testCompileClasspath,testRuntimeClasspath @@ -93,8 +96,8 @@ jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.7=testCompileClasspath,testRuntimeClasspath junit:junit:4.12=testCompileClasspath junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -109,6 +112,7 @@ org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath org.assertj:assertj-core:1.7.1=testCompileClasspath,testRuntimeClasspath +org.checkerframework:checker-qual:2.0.0=testCompileClasspath,testRuntimeClasspath org.checkerframework:checker-qual:3.33.0=annotationProcessor,testAnnotationProcessor org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc @@ -119,6 +123,7 @@ org.codehaus.groovy:groovy-templates:3.0.23=codenarc org.codehaus.groovy:groovy-xml:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath +org.codehaus.mojo:animal-sniffer-annotations:1.14=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.eclipse.jetty.toolchain.setuid:jetty-setuid-java:1.0.2=testCompileClasspath,testRuntimeClasspath @@ -175,15 +180,15 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath org.ow2.asm:asm-debug-all:5.0.2=testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/dropwizard/dropwizard-views-0.7/gradle.lockfile b/dd-java-agent/instrumentation/dropwizard/dropwizard-views-0.7/gradle.lockfile index 2e929189c22..e8c93cbe5eb 100644 --- a/dd-java-agent/instrumentation/dropwizard/dropwizard-views-0.7/gradle.lockfile +++ b/dd-java-agent/instrumentation/dropwizard/dropwizard-views-0.7/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:dropwizard:dropwizard-views-0.7:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.1.1=compileClasspath @@ -19,7 +20,7 @@ com.codahale.metrics:metrics-logback:3.0.1=compileClasspath,testCompileClasspath com.codahale.metrics:metrics-servlets:3.0.1=compileClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -35,15 +36,15 @@ com.fasterxml.jackson.module:jackson-module-afterburner:2.3.2=compileClasspath,t com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.3.2=compileClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml:classmate:1.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.spullara.mustache.java:compiler:0.8.14=testCompileClasspath,testRuntimeClasspath com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs @@ -54,12 +55,16 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:16.0.1=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:16.0.1=compileClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -88,15 +93,15 @@ io.dropwizard:dropwizard-views-freemarker:0.7.0=testCompileClasspath,testRuntime io.dropwizard:dropwizard-views-mustache:0.7.0=testCompileClasspath,testRuntimeClasspath io.dropwizard:dropwizard-views:0.7.0=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.el:javax.el-api:2.2.5=compileClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath javax.validation:validation-api:1.1.0.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.3=compileClasspath,testCompileClasspath,testRuntimeClasspath junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -140,6 +145,7 @@ org.hibernate:hibernate-validator:5.0.2.Final=compileClasspath,testCompileClassp org.jboss.logging:jboss-logging:3.1.1.GA=compileClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -157,14 +163,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.6=compileClasspath diff --git a/dd-java-agent/instrumentation/dropwizard/dropwizard-views-0.7/src/main/java/datadog/trace/instrumentation/dropwizard/view/DropwizardViewInstrumentation.java b/dd-java-agent/instrumentation/dropwizard/dropwizard-views-0.7/src/main/java/datadog/trace/instrumentation/dropwizard/view/DropwizardViewInstrumentation.java index 3e88551ebc2..119516a05f3 100644 --- a/dd-java-agent/instrumentation/dropwizard/dropwizard-views-0.7/src/main/java/datadog/trace/instrumentation/dropwizard/view/DropwizardViewInstrumentation.java +++ b/dd-java-agent/instrumentation/dropwizard/dropwizard-views-0.7/src/main/java/datadog/trace/instrumentation/dropwizard/view/DropwizardViewInstrumentation.java @@ -71,7 +71,7 @@ public static AgentScope onEnter( } final AgentSpan span = startSpan("dropwizard-view", "view.render").setTag(Tags.COMPONENT, "dropwizard-view"); - span.context().setIntegrationName("dropwizard-view"); + span.spanContext().setIntegrationName("dropwizard-view"); span.setResourceName("View " + view.getTemplateName()); return activateSpan(span); } diff --git a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-common/gradle.lockfile b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-common/gradle.lockfile index 8311ad3597c..121ba1a059b 100644 --- a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-common/gradle.lockfile +++ b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-common/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:elasticsearch:elasticsearch-common:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -9,7 +10,7 @@ com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,comp com.carrotsearch:hppc:0.7.1=compileClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -18,15 +19,15 @@ com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.5.3=compileClasspath com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.5.3=compileClasspath com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.5.3=compileClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -36,13 +37,16 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:18.0=compileClasspath -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.ning:compress-lzf:1.0.2=compileClasspath com.spatial4j:spatial4j:0.4.1=compileClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath @@ -61,13 +65,13 @@ commons-logging:commons-logging:1.1.3=compileClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath io.netty:netty:3.10.5.Final=compileClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.8.2=compileClasspath junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -117,6 +121,7 @@ org.hdrhistogram:HdrHistogram:2.1.6=compileClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath org.joda:joda-convert:1.2=compileClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -134,14 +139,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-common/src/main/java/datadog/trace/instrumentation/elasticsearch/ElasticsearchRestClientDecorator.java b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-common/src/main/java/datadog/trace/instrumentation/elasticsearch/ElasticsearchRestClientDecorator.java index 0741e14a39e..951967e2ec4 100644 --- a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-common/src/main/java/datadog/trace/instrumentation/elasticsearch/ElasticsearchRestClientDecorator.java +++ b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-common/src/main/java/datadog/trace/instrumentation/elasticsearch/ElasticsearchRestClientDecorator.java @@ -86,7 +86,7 @@ private String getElasticsearchRequestBody(HttpEntity entity) { } } - public AgentSpan onRequest( + public void onRequest( final AgentSpan span, final String method, final String endpoint, @@ -126,14 +126,13 @@ public AgentSpan onRequest( span.setTag("elasticsearch.params", queryParametersStringBuilder.toString()); } } - return HTTP_RESOURCE_DECORATOR.withClientPath(span, method, endpoint); + HTTP_RESOURCE_DECORATOR.withClientPath(span, method, endpoint); } - public AgentSpan onResponse(final AgentSpan span, final Response response) { + public void onResponse(final AgentSpan span, final Response response) { if (response != null && response.getHost() != null) { span.setTag(Tags.PEER_HOSTNAME, response.getHost().getHostName()); setPeerPort(span, response.getHost().getPort()); } - return span; } } diff --git a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-common/src/main/java/datadog/trace/instrumentation/elasticsearch/ElasticsearchTransportClientDecorator.java b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-common/src/main/java/datadog/trace/instrumentation/elasticsearch/ElasticsearchTransportClientDecorator.java index 172a7a56ef8..1973e2b15d5 100644 --- a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-common/src/main/java/datadog/trace/instrumentation/elasticsearch/ElasticsearchTransportClientDecorator.java +++ b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-common/src/main/java/datadog/trace/instrumentation/elasticsearch/ElasticsearchTransportClientDecorator.java @@ -60,7 +60,7 @@ protected String dbHostname(Object o) { return null; } - public AgentSpan onRequest(final AgentSpan span, final Class action, final Class request) { + public void onRequest(final AgentSpan span, final Class action, final Class request) { if (action != null) { String actionName = action.getSimpleName(); // ES 7.9 internally changes PutMappingAction to AutoPutMappingAction for @@ -74,6 +74,5 @@ public AgentSpan onRequest(final AgentSpan span, final Class action, final Class if (request != null) { span.setTag("elasticsearch.request", request.getSimpleName()); } - return span; } } diff --git a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-rest/elasticsearch-rest-5.0/gradle.lockfile b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-rest/elasticsearch-rest-5.0/gradle.lockfile index 3e9dffab128..f82cf6ce9f0 100644 --- a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-rest/elasticsearch-rest-5.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-rest/elasticsearch-rest-5.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:elasticsearch:elasticsearch-rest:elasticsearch-rest-5.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -9,7 +10,7 @@ com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,comp com.carrotsearch:hppc:0.7.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -22,15 +23,15 @@ com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.8.10=latestDepTestCo com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.8.1=testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.8.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -40,12 +41,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -68,14 +72,14 @@ io.netty:netty-handler:4.1.16.Final=latestDepTestCompileClasspath,latestDepTestR io.netty:netty-resolver:4.1.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty:3.10.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.9.4=testCompileClasspath,testRuntimeClasspath joda-time:joda-time:2.9.9=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:4.2.2=testCompileClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -157,6 +161,7 @@ org.hdrhistogram:HdrHistogram:2.1.9=latestDepTestCompileClasspath,latestDepTestR org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.joda:joda-convert:1.2=testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -174,14 +179,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-rest/elasticsearch-rest-5.0/src/main/java/datadog/trace/instrumentation/elasticsearch5/Elasticsearch5RestClientInstrumentation.java b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-rest/elasticsearch-rest-5.0/src/main/java/datadog/trace/instrumentation/elasticsearch5/Elasticsearch5RestClientInstrumentation.java index 9691b5756f5..8ebc3b9e9e8 100644 --- a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-rest/elasticsearch-rest-5.0/src/main/java/datadog/trace/instrumentation/elasticsearch5/Elasticsearch5RestClientInstrumentation.java +++ b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-rest/elasticsearch-rest-5.0/src/main/java/datadog/trace/instrumentation/elasticsearch5/Elasticsearch5RestClientInstrumentation.java @@ -76,9 +76,11 @@ public static void stopSpan( final AgentSpan span = scope.span(); DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); + scope.close(); span.finish(); + } else { + scope.close(); } - scope.close(); // span finished by RestResponseListener } } diff --git a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-rest/elasticsearch-rest-6.4/gradle.lockfile b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-rest/elasticsearch-rest-6.4/gradle.lockfile index e4545044769..bc2c053036c 100644 --- a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-rest/elasticsearch-rest-6.4/gradle.lockfile +++ b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-rest/elasticsearch-rest-6.4/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:elasticsearch:elasticsearch-rest:elasticsearch-rest-6.4:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -9,7 +10,7 @@ com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,comp com.carrotsearch:hppc:0.7.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -22,15 +23,15 @@ com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.8.11=latestDepTestCo com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.8.10=testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.8.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.spullara.mustache.java:compiler:0.9.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs @@ -41,12 +42,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -74,14 +78,14 @@ io.netty:netty-resolver:4.1.16.Final=testCompileClasspath,testRuntimeClasspath io.netty:netty-resolver:4.1.32.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.16.Final=testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.1.32.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.10=testCompileClasspath,testRuntimeClasspath joda-time:joda-time:2.10.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.jopt-simple:jopt-simple:5.0.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -172,6 +176,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.hdrhistogram:HdrHistogram:2.1.9=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -189,14 +194,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-rest/elasticsearch-rest-6.4/src/main/java/datadog/trace/instrumentation/elasticsearch6_4/Elasticsearch6RestClientInstrumentation.java b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-rest/elasticsearch-rest-6.4/src/main/java/datadog/trace/instrumentation/elasticsearch6_4/Elasticsearch6RestClientInstrumentation.java index c08d3807ef7..93fc4e3948f 100644 --- a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-rest/elasticsearch-rest-6.4/src/main/java/datadog/trace/instrumentation/elasticsearch6_4/Elasticsearch6RestClientInstrumentation.java +++ b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-rest/elasticsearch-rest-6.4/src/main/java/datadog/trace/instrumentation/elasticsearch6_4/Elasticsearch6RestClientInstrumentation.java @@ -79,9 +79,11 @@ public static void stopSpan( final AgentSpan span = scope.span(); DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); + scope.close(); span.finish(); + } else { + scope.close(); } - scope.close(); // span finished by RestResponseListener } } diff --git a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-rest/elasticsearch-rest-7.0/gradle.lockfile b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-rest/elasticsearch-rest-7.0/gradle.lockfile index 4f7955bbe87..440c85feb36 100644 --- a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-rest/elasticsearch-rest-7.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-rest/elasticsearch-rest-7.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:elasticsearch:elasticsearch-rest:elasticsearch-rest-7.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -10,7 +11,7 @@ com.carrotsearch:hppc:0.7.1=testCompileClasspath,testRuntimeClasspath com.carrotsearch:hppc:0.8.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -23,15 +24,15 @@ com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.8.11=testCompileClas com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.10.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.8.11=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.spullara.mustache.java:compiler:0.9.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs @@ -42,12 +43,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -75,14 +79,14 @@ io.netty:netty-resolver:4.1.32.Final=testCompileClasspath,testRuntimeClasspath io.netty:netty-resolver:4.1.49.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.32.Final=testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.1.49.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.10.1=testCompileClasspath,testRuntimeClasspath joda-time:joda-time:2.10.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.jopt-simple:jopt-simple:5.0.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -176,6 +180,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.hdrhistogram:HdrHistogram:2.1.9=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -193,14 +198,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-rest/elasticsearch-rest-7.0/src/main/java/datadog/trace/instrumentation/elasticsearch7/Elasticsearch7RestClientInstrumentation.java b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-rest/elasticsearch-rest-7.0/src/main/java/datadog/trace/instrumentation/elasticsearch7/Elasticsearch7RestClientInstrumentation.java index 4ea559367ef..92430e40ec2 100644 --- a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-rest/elasticsearch-rest-7.0/src/main/java/datadog/trace/instrumentation/elasticsearch7/Elasticsearch7RestClientInstrumentation.java +++ b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-rest/elasticsearch-rest-7.0/src/main/java/datadog/trace/instrumentation/elasticsearch7/Elasticsearch7RestClientInstrumentation.java @@ -100,6 +100,7 @@ public static void stopSpan( final AgentSpan span = scope.span(); DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); + scope.close(); span.finish(); } else if (result instanceof Response) { final AgentSpan span = scope.span(); @@ -107,11 +108,12 @@ public static void stopSpan( DECORATE.onResponse(span, ((Response) result)); } DECORATE.beforeFinish(span); + scope.close(); span.finish(); } else { + scope.close(); // async call, span finished by RestResponseListener } - scope.close(); } } } diff --git a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-2.0/gradle.lockfile b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-2.0/gradle.lockfile index 2e72e1738b2..e937afdb541 100644 --- a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:elasticsearch:elasticsearch-transport:elasticsearch-transport-2.0:dependencies --write-locks aopalliance:aopalliance:1.0=testCompileClasspath,testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -10,7 +11,7 @@ com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,comp com.carrotsearch:hppc:0.7.1=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -29,15 +30,15 @@ com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.5.3=compileClasspath com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.6.2=testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.8.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -47,12 +48,16 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:18.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:18.0=compileClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.ning:compress-lzf:1.0.2=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.spatial4j:spatial4j:0.4.1=compileClasspath com.spatial4j:spatial4j:0.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -73,15 +78,15 @@ de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,la io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath io.netty:netty:3.10.5.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty:3.10.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.8.2=compileClasspath joda-time:joda-time:2.9.2=testCompileClasspath,testRuntimeClasspath joda-time:joda-time:2.9.9=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:4.5.1=latestDepTestCompileClasspath,testCompileClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -160,6 +165,7 @@ org.hdrhistogram:HdrHistogram:2.1.6=compileClasspath,latestDepTestCompileClasspa org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.joda:joda-convert:1.2=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -177,14 +183,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-2.0/src/main/java/datadog/trace/instrumentation/elasticsearch2/Elasticsearch2TransportClientInstrumentation.java b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-2.0/src/main/java/datadog/trace/instrumentation/elasticsearch2/Elasticsearch2TransportClientInstrumentation.java index fdad25561bc..642366895fc 100644 --- a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-2.0/src/main/java/datadog/trace/instrumentation/elasticsearch2/Elasticsearch2TransportClientInstrumentation.java +++ b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-2.0/src/main/java/datadog/trace/instrumentation/elasticsearch2/Elasticsearch2TransportClientInstrumentation.java @@ -80,9 +80,11 @@ public static void stopSpan( final AgentSpan span = scope.span(); DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); + scope.close(); span.finish(); + } else { + scope.close(); } - scope.close(); // span finished by TransportActionListener } } diff --git a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-5.0/gradle.lockfile b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-5.0/gradle.lockfile index 28e02315dbe..b2b4c922f50 100644 --- a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-5.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-5.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:elasticsearch:elasticsearch-transport:elasticsearch-transport-5.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -9,7 +10,7 @@ com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,comp com.carrotsearch:hppc:0.7.1=compileClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -18,15 +19,15 @@ com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.8.1=compileClasspath, com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.8.1=compileClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.8.1=compileClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.spullara.mustache.java:compiler:0.9.3=compileClasspath,testCompileClasspath,testRuntimeClasspath com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs @@ -37,12 +38,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -64,13 +68,13 @@ io.netty:netty-handler:4.1.5.Final=compileClasspath,testCompileClasspath,testRun io.netty:netty-resolver:4.1.5.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.1.5.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty:3.10.6.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.9.4=compileClasspath,testCompileClasspath,testRuntimeClasspath junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:4.2.2=compileClasspath,testCompileClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath @@ -133,6 +137,7 @@ org.hdrhistogram:HdrHistogram:2.1.6=compileClasspath,testCompileClasspath,testRu org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath org.joda:joda-convert:1.2=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -150,14 +155,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-5.0/src/main/java/datadog/trace/instrumentation/elasticsearch5/Elasticsearch5TransportClientInstrumentation.java b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-5.0/src/main/java/datadog/trace/instrumentation/elasticsearch5/Elasticsearch5TransportClientInstrumentation.java index b2aa96eb1e3..831580a2363 100644 --- a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-5.0/src/main/java/datadog/trace/instrumentation/elasticsearch5/Elasticsearch5TransportClientInstrumentation.java +++ b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-5.0/src/main/java/datadog/trace/instrumentation/elasticsearch5/Elasticsearch5TransportClientInstrumentation.java @@ -80,9 +80,11 @@ public static void stopSpan( final AgentSpan span = scope.span(); DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); + scope.close(); span.finish(); + } else { + scope.close(); } - scope.close(); // span finished by TransportActionListener } } diff --git a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-5.3/gradle.lockfile b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-5.3/gradle.lockfile index 004d41aa3a7..207c6fb92f6 100644 --- a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-5.3/gradle.lockfile +++ b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-5.3/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:elasticsearch:elasticsearch-transport:elasticsearch-transport-5.3:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -9,7 +10,7 @@ com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,comp com.carrotsearch:hppc:0.7.1=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -23,15 +24,15 @@ com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.8.6=compileClasspath, com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.8.6=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.8.6=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.spullara.mustache.java:compiler:0.9.3=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs @@ -42,12 +43,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -85,15 +89,15 @@ io.netty:netty-transport:4.1.11.Final=testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.1.13.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.7.Final=compileClasspath io.netty:netty:3.10.6.Final=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath joda-time:joda-time:2.9.5=compileClasspath joda-time:joda-time:2.9.9=testCompileClasspath,testRuntimeClasspath junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:4.2.2=compileClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -209,6 +213,7 @@ org.hdrhistogram:HdrHistogram:2.1.6=compileClasspath org.hdrhistogram:HdrHistogram:2.1.9=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -227,14 +232,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-5.3/src/main/java/datadog/trace/instrumentation/elasticsearch5_3/Elasticsearch53TransportClientInstrumentation.java b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-5.3/src/main/java/datadog/trace/instrumentation/elasticsearch5_3/Elasticsearch53TransportClientInstrumentation.java index 17e68319983..4fe2617d330 100644 --- a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-5.3/src/main/java/datadog/trace/instrumentation/elasticsearch5_3/Elasticsearch53TransportClientInstrumentation.java +++ b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-5.3/src/main/java/datadog/trace/instrumentation/elasticsearch5_3/Elasticsearch53TransportClientInstrumentation.java @@ -81,9 +81,11 @@ public static void stopSpan( final AgentSpan span = scope.span(); DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); + scope.close(); span.finish(); + } else { + scope.close(); } - scope.close(); // span finished by TransportActionListener } } diff --git a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-6.0/gradle.lockfile b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-6.0/gradle.lockfile index e035dc0d478..ece2d769557 100644 --- a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-6.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-6.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:elasticsearch:elasticsearch-transport:elasticsearch-transport-6.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -9,7 +10,7 @@ com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,comp com.carrotsearch:hppc:0.7.1=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -22,15 +23,15 @@ com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.8.6=compileClasspath com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.8.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.8.6=compileClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.spullara.mustache.java:compiler:0.9.3=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs @@ -41,12 +42,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -75,14 +79,14 @@ io.netty:netty-resolver:4.1.13.Final=compileClasspath,testCompileClasspath,testR io.netty:netty-resolver:4.1.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.13.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.1.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath joda-time:joda-time:2.9.5=compileClasspath,testCompileClasspath,testRuntimeClasspath junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.jopt-simple:jopt-simple:5.0.2=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -175,6 +179,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.hdrhistogram:HdrHistogram:2.1.9=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -192,14 +197,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-6.0/src/main/java/datadog/trace/instrumentation/elasticsearch6/Elasticsearch6TransportClientInstrumentation.java b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-6.0/src/main/java/datadog/trace/instrumentation/elasticsearch6/Elasticsearch6TransportClientInstrumentation.java index 1ad02b44acd..14c81617e0b 100644 --- a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-6.0/src/main/java/datadog/trace/instrumentation/elasticsearch6/Elasticsearch6TransportClientInstrumentation.java +++ b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-6.0/src/main/java/datadog/trace/instrumentation/elasticsearch6/Elasticsearch6TransportClientInstrumentation.java @@ -84,9 +84,11 @@ public static void stopSpan( final AgentSpan span = scope.span(); DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); + scope.close(); span.finish(); + } else { + scope.close(); } - scope.close(); // span finished by TransportActionListener } } diff --git a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-7.3/gradle.lockfile b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-7.3/gradle.lockfile index 9cf3e15dba8..815f7f833ec 100644 --- a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-7.3/gradle.lockfile +++ b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-7.3/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:elasticsearch:elasticsearch-transport:elasticsearch-transport-7.3:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -9,7 +10,7 @@ com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,comp com.carrotsearch:hppc:0.8.1=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -22,15 +23,15 @@ com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.8.11=compileClasspat com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.10.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.8.11=compileClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.spullara.mustache.java:compiler:0.9.3=compileClasspath,testCompileClasspath,testRuntimeClasspath com.github.spullara.mustache.java:compiler:0.9.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -42,12 +43,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -75,14 +79,14 @@ io.netty:netty-resolver:4.1.36.Final=compileClasspath,testCompileClasspath,testR io.netty:netty-resolver:4.1.49.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.36.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.1.49.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.10.2=compileClasspath,testCompileClasspath,testRuntimeClasspath joda-time:joda-time:2.10.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.jopt-simple:jopt-simple:5.0.2=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -183,6 +187,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.hdrhistogram:HdrHistogram:2.1.9=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -200,14 +205,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-7.3/src/main/java/datadog/trace/instrumentation/elasticsearch7_3/Elasticsearch73TransportClientInstrumentation.java b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-7.3/src/main/java/datadog/trace/instrumentation/elasticsearch7_3/Elasticsearch73TransportClientInstrumentation.java index 2a07be66fb8..0dcb52a6d98 100644 --- a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-7.3/src/main/java/datadog/trace/instrumentation/elasticsearch7_3/Elasticsearch73TransportClientInstrumentation.java +++ b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-7.3/src/main/java/datadog/trace/instrumentation/elasticsearch7_3/Elasticsearch73TransportClientInstrumentation.java @@ -91,9 +91,11 @@ public static void stopSpan( final AgentSpan span = scope.span(); DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); + scope.close(); span.finish(); + } else { + scope.close(); } - scope.close(); // span finished by TransportActionListener } } diff --git a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-common/gradle.lockfile b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-common/gradle.lockfile index 3ac4b203cc2..f7cc5cf13eb 100644 --- a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-common/gradle.lockfile +++ b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-common/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:elasticsearch:elasticsearch-transport:elasticsearch-transport-common:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -9,7 +10,7 @@ com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,comp com.carrotsearch:hppc:0.8.1=compileClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -18,15 +19,15 @@ com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.8.11=compileClasspath com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.8.11=compileClasspath com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.8.11=compileClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.spullara.mustache.java:compiler:0.9.3=compileClasspath com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs @@ -37,12 +38,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -63,13 +67,13 @@ io.netty:netty-common:4.1.36.Final=compileClasspath io.netty:netty-handler:4.1.36.Final=compileClasspath io.netty:netty-resolver:4.1.36.Final=compileClasspath io.netty:netty-transport:4.1.36.Final=compileClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.10.2=compileClasspath junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.jopt-simple:jopt-simple:5.0.2=compileClasspath @@ -136,6 +140,7 @@ org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.hdrhistogram:HdrHistogram:2.1.9=compileClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -153,14 +158,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-common/src/main/java/datadog/trace/instrumentation/elasticsearch/ShadowExistingScopeAdvice.java b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-common/src/main/java/datadog/trace/instrumentation/elasticsearch/ShadowExistingScopeAdvice.java index cd6a1ec0cf4..8f81e315c95 100644 --- a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-common/src/main/java/datadog/trace/instrumentation/elasticsearch/ShadowExistingScopeAdvice.java +++ b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-common/src/main/java/datadog/trace/instrumentation/elasticsearch/ShadowExistingScopeAdvice.java @@ -17,7 +17,7 @@ public static AgentScope enter() { return activateSpan(noopSpan()); } - @Advice.OnMethodExit(suppress = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void exit(@Advice.Enter final AgentScope scope) { scope.close(); } diff --git a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-common/src/main/java/datadog/trace/instrumentation/elasticsearch/ThreadedActionListenerInstrumentation.java b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-common/src/main/java/datadog/trace/instrumentation/elasticsearch/ThreadedActionListenerInstrumentation.java index bb560931c34..0d82ef38f7d 100644 --- a/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-common/src/main/java/datadog/trace/instrumentation/elasticsearch/ThreadedActionListenerInstrumentation.java +++ b/dd-java-agent/instrumentation/elasticsearch/elasticsearch-transport/elasticsearch-transport-common/src/main/java/datadog/trace/instrumentation/elasticsearch/ThreadedActionListenerInstrumentation.java @@ -9,10 +9,10 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArguments; import com.google.auto.service.AutoService; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.java.concurrent.State; import java.util.Map; import net.bytebuddy.asm.Advice; @@ -61,13 +61,13 @@ public static void after(@Advice.This ThreadedActionListener listener) { @SuppressWarnings("rawtypes") public static final class OnResponse { @Advice.OnMethodEnter - public static AgentScope before(@Advice.This ThreadedActionListener listener) { + public static ContextScope before(@Advice.This ThreadedActionListener listener) { return startTaskScope( InstrumentationContext.get(ThreadedActionListener.class, State.class), listener); } @Advice.OnMethodExit(onThrowable = Throwable.class) - public static void after(@Advice.Enter AgentScope scope) { + public static void after(@Advice.Enter ContextScope scope) { endTaskScope(scope); } } diff --git a/dd-java-agent/instrumentation/finatra-2.9/gradle.lockfile b/dd-java-agent/instrumentation/finatra-2.9/gradle.lockfile index 9d75d418926..beec67846d5 100644 --- a/dd-java-agent/instrumentation/finatra-2.9/gradle.lockfile +++ b/dd-java-agent/instrumentation/finatra-2.9/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:finatra-2.9:dependencies --write-locks aopalliance:aopalliance:1.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath @@ -9,7 +10,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath @@ -39,17 +40,17 @@ com.github.ben-manes.caffeine:caffeine:2.3.4=compileClasspath com.github.ben-manes.caffeine:caffeine:2.8.0=latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.ben-manes.caffeine:caffeine:2.8.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath com.github.nscala-time:nscala-time_2.11:2.14.0=compileClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.nscala-time:nscala-time_2.11:2.22.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.spullara.mustache.java:compiler:0.8.18=compileClasspath com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs @@ -59,14 +60,14 @@ com.google.auto:auto-common:1.2.1=annotationProcessor,latestDepTestAnnotationPro com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestAnnotationProcessor,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,latestPre207TestAnnotationProcessor,testAnnotationProcessor -com.google.errorprone:error_prone_annotations:2.3.3=latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.errorprone:error_prone_annotations:2.4.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:19.0=compileClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.guava:guava:27.1-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,latestPre207TestAnnotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:19.0=compileClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,latestPre207TestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestAnnotationProcessor,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.inject.extensions:guice-assistedinject:4.0=compileClasspath com.google.inject.extensions:guice-assistedinject:4.1.0=latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.inject.extensions:guice-assistedinject:4.2.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -74,9 +75,9 @@ com.google.inject.extensions:guice-multibindings:4.1.0=compileClasspath,latestPr com.google.inject.extensions:guice-multibindings:4.2.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.inject:guice:4.1.0=compileClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.inject:guice:4.2.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.google.j2objc:j2objc-annotations:1.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,latestPre207TestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.netflix.concurrency-limits:concurrency-limits-core:0.3.0=latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -230,7 +231,7 @@ commons-io:commons-io:2.4=compileClasspath commons-lang:commons-lang:2.6=compileClasspath commons-logging:commons-logging:1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath io.netty:netty-buffer:4.1.43.Final=latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-buffer:4.1.51.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -270,7 +271,7 @@ io.netty:netty-transport:4.1.43.Final=latestPre207TestCompileClasspath,latestPre io.netty:netty-transport:4.1.51.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.8.Final=compileClasspath io.netty:netty:3.10.1.Final=compileClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath javax.activation:activation:1.1.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.annotation:javax.annotation-api:1.3.2=latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.inject:javax.inject:1=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -282,12 +283,11 @@ joda-time:joda-time:2.10.8=latestDepTestCompileClasspath,latestDepTestRuntimeCla joda-time:joda-time:2.9.4=compileClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath junit:junit:4.12=latestDepTestCompileClasspath junit:junit:4.13.2=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.codingwell:scala-guice_2.11:4.1.0=compileClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.codingwell:scala-guice_2.11:4.2.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath net.openhft:zero-allocation-hashing:0.16=zinc net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -317,10 +317,9 @@ org.codehaus.groovy:groovy-templates:3.0.23=codenarc org.codehaus.groovy:groovy-xml:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.codehaus.mojo:animal-sniffer-annotations:1.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -330,12 +329,13 @@ org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,latestPre207TestRun org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc org.joda:joda-convert:1.2=compileClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.joda:joda-convert:2.2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.json4s:json4s-ast_2.11:3.6.7=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.json4s:json4s-core_2.11:3.6.7=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.json4s:json4s-scalap_2.11:3.6.7=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -353,14 +353,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,latestPre207TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-collection-compat_2.11:2.1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.11:1.0.4=compileClasspath @@ -371,35 +371,35 @@ org.scala-lang.modules:scala-xml_2.11:1.0.5=latestDepTestCompileClasspath,latest org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc org.scala-lang:scala-compiler:2.11.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang:scala-compiler:2.11.8=compileClasspath -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.11.12=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-lang:scala-library:2.13.15=zinc +org.scala-lang:scala-library:2.13.16=zinc org.scala-lang:scala-reflect:2.11.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang:scala-reflect:2.11.8=compileClasspath -org.scala-lang:scala-reflect:2.13.15=zinc +org.scala-lang:scala-reflect:2.13.16=zinc org.scala-lang:scalap:2.11.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang:scalap:2.11.8=compileClasspath -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.slf4j:jcl-over-slf4j:1.7.21=compileClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPre207TestCompileClasspath,latestPre207TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.21=compileClasspath diff --git a/dd-java-agent/instrumentation/finatra-2.9/src/main/java/datadog/trace/instrumentation/finatra/FinatraInstrumentation.java b/dd-java-agent/instrumentation/finatra-2.9/src/main/java/datadog/trace/instrumentation/finatra/FinatraInstrumentation.java index de2a5ab12cf..37b198283b3 100644 --- a/dd-java-agent/instrumentation/finatra-2.9/src/main/java/datadog/trace/instrumentation/finatra/FinatraInstrumentation.java +++ b/dd-java-agent/instrumentation/finatra-2.9/src/main/java/datadog/trace/instrumentation/finatra/FinatraInstrumentation.java @@ -5,7 +5,6 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.bootstrap.instrumentation.decorator.http.HttpResourceDecorator.HTTP_RESOURCE_DECORATOR; import static datadog.trace.instrumentation.finatra.FinatraDecorator.DECORATE; @@ -79,7 +78,7 @@ public static ContextScope nameSpan( DECORATE.afterStart(span); span.setResourceName(DECORATE.className(clazz)); - return getCurrentContext().with(span).attach(); + return span.attachWithContext(); } @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) @@ -96,8 +95,8 @@ public static void setupCallback( if (throwable != null) { DECORATE.onError(span, throwable); DECORATE.beforeFinish(scope.context()); - span.finish(); scope.close(); + span.finish(); return; } diff --git a/dd-java-agent/instrumentation/finatra-2.9/src/main/java/datadog/trace/instrumentation/finatra/Listener.java b/dd-java-agent/instrumentation/finatra-2.9/src/main/java/datadog/trace/instrumentation/finatra/Listener.java index 6d948f86532..29c3723559d 100644 --- a/dd-java-agent/instrumentation/finatra-2.9/src/main/java/datadog/trace/instrumentation/finatra/Listener.java +++ b/dd-java-agent/instrumentation/finatra-2.9/src/main/java/datadog/trace/instrumentation/finatra/Listener.java @@ -1,6 +1,5 @@ package datadog.trace.instrumentation.finatra; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.finatra.FinatraDecorator.DECORATE; import com.twitter.finagle.http.Response; @@ -18,23 +17,23 @@ public Listener(final ContextScope scope) { @Override public void onSuccess(final Response response) { - final AgentSpan span = spanFromContext(scope.context()); + final AgentSpan span = AgentSpan.fromContext(scope.context()); // Don't use DECORATE.onResponse because this is the controller span if (Config.get().getHttpServerErrorStatuses().get(DECORATE.status(response))) { span.setError(true); } DECORATE.beforeFinish(scope.context()); - span.finish(); scope.close(); + span.finish(); } @Override public void onFailure(final Throwable cause) { - final AgentSpan span = spanFromContext(scope.context()); + final AgentSpan span = AgentSpan.fromContext(scope.context()); DECORATE.onError(span, cause); DECORATE.beforeFinish(scope.context()); - span.finish(); scope.close(); + span.finish(); } } diff --git a/dd-java-agent/instrumentation/freemarker/freemarker-2.3.24/gradle.lockfile b/dd-java-agent/instrumentation/freemarker/freemarker-2.3.24/gradle.lockfile index 940163f642a..62dd37350d6 100644 --- a/dd-java-agent/instrumentation/freemarker/freemarker-2.3.24/gradle.lockfile +++ b/dd-java-agent/instrumentation/freemarker/freemarker-2.3.24/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:freemarker:freemarker-2.3.24:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,csiCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,csiCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -83,6 +87,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -100,14 +105,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/freemarker/freemarker-2.3.9/gradle.lockfile b/dd-java-agent/instrumentation/freemarker/freemarker-2.3.9/gradle.lockfile index 0981d9e7862..5d202158a7c 100644 --- a/dd-java-agent/instrumentation/freemarker/freemarker-2.3.9/gradle.lockfile +++ b/dd-java-agent/instrumentation/freemarker/freemarker-2.3.9/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:freemarker:freemarker-2.3.9:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath,version2_3_23TestRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath,version2_3_23TestRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath,ver com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath,version2_3_23TestRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath,version2_3_23TestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath,version2_3_23TestRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath,version2_3_23TestRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath,version2_3_23TestRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath,version2_3_23TestRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath,version2_3_23TestRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath,version2_3_23TestRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath,version2_3_23TestRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath,version2_3_23TestRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath,version2_3_23TestRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath,version2_3_23TestRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath,version2_3_23TestRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath,version2_3_23TestRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath,version2_3_23TestRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath,version2_3_23TestAnnotationProcessor,version2_3_23TestCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor,version2_3_23TestAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor,version2_3_23TestAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor,version2_3_23TestAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,version2_3_23TestAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath,version2_3_23TestAnnotationProcessor,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor,version2_3_23TestAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath,version2_3_23TestRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath,version2_3_23TestRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath,version2_ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath,version2_3_23TestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath,version2_3_23TestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath,version2_3_23TestRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath,version2_3_23TestRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath,version2_3_23TestRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath,version2_3_23TestRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -83,6 +87,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath,version2_3_23TestRuntimeClas org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath,version2_3_23TestRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath,version2_3_23TestRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath,version2_3_23TestRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath @@ -100,14 +105,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath,version2_3 org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath,version2_3_23TestRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath,version2_3_23TestRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath,version2_3_23TestRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath,version2_3_23TestRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath,version2_3_23TestRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath,version2_3_23TestRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath,version2_3_23TestCompileClasspath,version2_3_23TestRuntimeClasspath diff --git a/dd-java-agent/instrumentation/gax-1.4/build.gradle b/dd-java-agent/instrumentation/gax-1.4/build.gradle new file mode 100644 index 00000000000..8e05bc27402 --- /dev/null +++ b/dd-java-agent/instrumentation/gax-1.4/build.gradle @@ -0,0 +1,21 @@ +muzzle { + pass { + group = "com.google.api" + module = "gax" + // CallbackChainRetryingFuture (with setAttemptFuture + attemptFutureCompletionListener) first + // appears in gax 1.4.0. No need to assert the low bound hence since the instrumentation is not applied. + versions = "[1.4.0,]" + } +} + +apply from: "$rootDir/gradle/java.gradle" + +addTestSuiteForDir('latestDepTest', 'test') + +dependencies { + compileOnly group: 'com.google.api', name: 'gax', version: '1.4.0' + testImplementation project(":dd-java-agent:instrumentation:guava-10.0") + testImplementation group: 'com.google.api', name: 'gax', version: '1.4.0' + + latestDepTestImplementation group: 'com.google.api', name: 'gax', version: '+' +} diff --git a/dd-java-agent/instrumentation/gax-1.4/gradle.lockfile b/dd-java-agent/instrumentation/gax-1.4/gradle.lockfile new file mode 100644 index 00000000000..4f6603f7a2b --- /dev/null +++ b/dd-java-agent/instrumentation/gax-1.4/gradle.lockfile @@ -0,0 +1,161 @@ +# This is a Gradle generated file for dependency locking. +# Manual edits can break the build and are not advised. +# This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:gax-1.4:dependencies --write-locks +cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.fasterxml.jackson.core:jackson-core:2.1.3=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.github.javaparser:javaparser-core:3.25.6=codenarc +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs +com.github.spotbugs:spotbugs:4.9.8=spotbugs +com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs +com.google.api.grpc:proto-google-common-protos:2.73.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.api:api-common:1.1.0=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.google.api:api-common:2.65.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.api:gax:1.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.google.api:gax:2.82.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.auth:google-auth-library-credentials:0.7.0=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.google.auth:google-auth-library-credentials:1.49.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.auth:google-auth-library-oauth2-http:0.7.0=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.google.auth:google-auth-library-oauth2-http:1.49.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath +com.google.auto.service:auto-service:1.1.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.auto.value:auto-value-annotations:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.auto.value:auto-value:1.2=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.google.auto:auto-common:1.2.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.google.code.gson:gson:2.13.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs +com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.48.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:19.0=compileClasspath +com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.google.http-client:google-http-client-gson:2.1.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.http-client:google-http-client-jackson2:1.19.0=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.google.http-client:google-http-client:1.19.0=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.google.http-client:google-http-client:2.1.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.protobuf:protobuf-java-util:4.33.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.protobuf:protobuf-java:4.33.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.okio:okio:1.17.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.thoughtworks.qdox:qdox:1.12.1=codenarc +commons-codec:commons-codec:1.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +commons-codec:commons-codec:1.3=compileClasspath,testCompileClasspath,testRuntimeClasspath +commons-fileupload:commons-fileupload:1.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +commons-io:commons-io:2.20.0=spotbugs +commons-logging:commons-logging:1.1.1=compileClasspath,testCompileClasspath,testRuntimeClasspath +de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.grpc:grpc-api:1.81.0=latestDepTestRuntimeClasspath +io.grpc:grpc-context:1.70.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.opencensus:opencensus-api:0.31.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.opencensus:opencensus-contrib-http-util:0.31.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +javax.annotation:javax.annotation-api:1.3.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +jaxen:jaxen:2.0.0=spotbugs +junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +net.sf.saxon:Saxon-HE:12.9=spotbugs +org.apache.ant:ant-antlr:1.10.14=codenarc +org.apache.ant:ant-junit:1.10.14=codenarc +org.apache.bcel:bcel:6.11.0=spotbugs +org.apache.commons:commons-lang3:3.19.0=spotbugs +org.apache.commons:commons-text:1.14.0=spotbugs +org.apache.httpcomponents:httpclient:4.0.1=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.apache.httpcomponents:httpclient:4.5.14=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.httpcomponents:httpcore:4.0.1=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.apache.httpcomponents:httpcore:4.4.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.logging.log4j:log4j-api:2.25.2=spotbugs +org.apache.logging.log4j:log4j-core:2.25.2=spotbugs +org.apiguardian:apiguardian-api:1.1.2=latestDepTestCompileClasspath,testCompileClasspath +org.checkerframework:checker-qual:3.33.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +org.codehaus.groovy:groovy-ant:3.0.23=codenarc +org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc +org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.25=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-templates:3.0.23=codenarc +org.codehaus.groovy:groovy-xml:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.25=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codenarc:CodeNarc:3.7.0=codenarc +org.dom4j:dom4j:2.2.0=spotbugs +org.gmetrics:GMetrics:2.1.0=codenarc +org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-runner:1.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-api:1.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-commons:1.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit:junit-bom:5.14.0=spotbugs +org.junit:junit-bom:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-core:4.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.9=spotbugs +org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs +org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath +org.slf4j:slf4j-api:1.7.32=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j +org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j +org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +org.spockframework:spock-bom:2.4-groovy-3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.spockframework:spock-core:2.4-groovy-3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-junit:1.2.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-parser:1.2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.threeten:threetenbp:1.3.3=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.threeten:threetenbp:1.7.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.xmlresolver:xmlresolver:5.3.3=spotbugs +empty=spotbugsPlugins diff --git a/dd-java-agent/instrumentation/gax-1.4/src/main/java/datadog/trace/instrumentation/gax/CallbackChainRetryingFutureInstrumentation.java b/dd-java-agent/instrumentation/gax-1.4/src/main/java/datadog/trace/instrumentation/gax/CallbackChainRetryingFutureInstrumentation.java new file mode 100644 index 00000000000..9eb3b2edd35 --- /dev/null +++ b/dd-java-agent/instrumentation/gax-1.4/src/main/java/datadog/trace/instrumentation/gax/CallbackChainRetryingFutureInstrumentation.java @@ -0,0 +1,84 @@ +package datadog.trace.instrumentation.gax; + +import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static java.util.Collections.singletonMap; +import static net.bytebuddy.matcher.ElementMatchers.takesArgument; +import static net.bytebuddy.matcher.ElementMatchers.takesArguments; + +import com.google.auto.service.AutoService; +import datadog.trace.agent.tooling.Instrumenter; +import datadog.trace.agent.tooling.InstrumenterModule; +import datadog.trace.bootstrap.ContextStore; +import datadog.trace.bootstrap.InstrumentationContext; +import datadog.trace.bootstrap.instrumentation.java.concurrent.State; +import java.util.Map; +import net.bytebuddy.asm.Advice; + +/** + * Cancels the trace continuation captured on a gax retry attempt's completion listener when that + * listener is superseded. + * + *

    {@code AttemptCallable.call()} calls {@code setAttemptFuture} twice per attempt: first with a + * {@code NonCancellableFuture} placeholder (a reservation that is never completed), then with the + * real RPC future. {@code CallbackChainRetryingFuture.setAttemptFuture} registers a fresh {@code + * AttemptCompletionListener} each time and stores it in {@code attemptFutureCompletionListener}. + * The guava {@code AbstractFuture} instrumentation captures a continuation onto each listener. The + * placeholder's listener never runs (its future never completes), so its continuation would never + * be activated or canceled. + * + *

    Each {@code setAttemptFuture} overwrites the previous listener: that overwrite is the + * abandonment signal. We capture the previous listener on entry but cancel its continuation on + * exit, once the field has actually been replaced, so a listener GAX still treats as active (early + * return, or a completion racing the overwrite) keeps its continuation. + */ +@AutoService(InstrumenterModule.class) +public class CallbackChainRetryingFutureInstrumentation extends InstrumenterModule.ContextTracking + implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { + + public CallbackChainRetryingFutureInstrumentation() { + super("gax", "gax-1.4"); + } + + @Override + public String instrumentedType() { + return "com.google.api.gax.retrying.CallbackChainRetryingFuture"; + } + + @Override + public Map contextStore() { + return singletonMap(Runnable.class.getName(), State.class.getName()); + } + + @Override + public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvice( + named("setAttemptFuture") + .and(takesArguments(1)) + .and(takesArgument(0, named("com.google.api.core.ApiFuture"))), + CallbackChainRetryingFutureInstrumentation.class.getName() + "$SetAttemptFutureAdvice"); + } + + public static class SetAttemptFutureAdvice { + @Advice.OnMethodEnter(suppress = Throwable.class) + public static Runnable capturePrevious( + @Advice.FieldValue("attemptFutureCompletionListener") final Runnable previousListener) { + return previousListener; + } + + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + public static void cancelSuperseded( + @Advice.Enter final Runnable previousListener, + @Advice.FieldValue("attemptFutureCompletionListener") final Runnable newListener) { + // Only cancel once the field has actually been replaced: GAX may return early without + // reassigning, and a listener still treated as active must keep its continuation. + if (previousListener != null && previousListener != newListener) { + final ContextStore contextStore = + InstrumentationContext.get(Runnable.class, State.class); + final State state = contextStore.remove(previousListener); + if (state != null) { + state.closeContinuation(); + } + } + } + } +} diff --git a/dd-java-agent/instrumentation/gax-1.4/src/test/java/datadog/trace/instrumentation/gax/GaxRetryContinuationTest.java b/dd-java-agent/instrumentation/gax-1.4/src/test/java/datadog/trace/instrumentation/gax/GaxRetryContinuationTest.java new file mode 100644 index 00000000000..f70f1b6280e --- /dev/null +++ b/dd-java-agent/instrumentation/gax-1.4/src/test/java/datadog/trace/instrumentation/gax/GaxRetryContinuationTest.java @@ -0,0 +1,193 @@ +package datadog.trace.instrumentation.gax; + +import static datadog.trace.agent.test.assertions.SpanMatcher.span; +import static datadog.trace.agent.test.assertions.TraceMatcher.SORT_BY_START_TIME; +import static datadog.trace.agent.test.assertions.TraceMatcher.trace; +import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; +import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import com.google.api.core.ApiClock; +import com.google.api.core.NanoClock; +import com.google.api.core.SettableApiFuture; +import com.google.api.gax.retrying.BasicResultRetryAlgorithm; +import com.google.api.gax.retrying.ExponentialRetryAlgorithm; +import com.google.api.gax.retrying.RetryAlgorithm; +import com.google.api.gax.retrying.RetrySettings; +import com.google.api.gax.retrying.RetryingFuture; +import com.google.api.gax.retrying.ScheduledRetryingExecutor; +import datadog.context.ContextScope; +import datadog.trace.agent.test.AbstractInstrumentationTest; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.jupiter.api.Test; +import org.threeten.bp.Duration; + +class GaxRetryContinuationTest extends AbstractInstrumentationTest { + + @Test + void supersededAttemptListenerDoesNotLeak() throws Exception { + ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor(); + try { + ScheduledRetryingExecutor executor = + new ScheduledRetryingExecutor<>(retryAlgorithm(1), scheduler); + RetryingFuture retryingFuture = executor.createFuture(() -> "ok"); + + AgentSpan span = startSpan("gax", "publish"); + try (ContextScope scope = activateSpan(span)) { + // reserve the attempt slot with a placeholder that is never completed + SettableApiFuture placeholder = SettableApiFuture.create(); + retryingFuture.setAttemptFuture(placeholder); + // supersede it with the real attempt future -> must cancel the placeholder's continuation + SettableApiFuture attempt = SettableApiFuture.create(); + retryingFuture.setAttemptFuture(attempt); + // real attempt completes -> its listener runs -> resolves normally + attempt.set("ok"); + } + span.finish(); + // one trace that will be dropped if the placeholder's continuation is never cancelled + assertTraces(trace(span().root().operationName("publish"))); + } finally { + scheduler.shutdownNow(); + } + } + + @Test + void singleAttemptSucceedsAndContextNotLeaked() throws Exception { + ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor(); + try { + ScheduledRetryingExecutor executor = + new ScheduledRetryingExecutor<>(retryAlgorithm(3), scheduler); + AgentSpan parent = startSpan("gax", "publish"); + CountDownLatch allAttemptsDone = new CountDownLatch(1); + RetryingFuture future = + executor.createFuture( + () -> { + AgentSpan attempt = startSpan("gax", "attempt"); + try { + return "ok"; + } finally { + attempt.finish(); + allAttemptsDone.countDown(); + } + }); + + try (ContextScope scope = activateSpan(parent)) { + future.setAttemptFuture(executor.submit(future)); + assertEquals("ok", future.get(5, TimeUnit.SECONDS)); + } + allAttemptsDone.await(5, TimeUnit.SECONDS); + parent.finish(); + assertTraces( + trace( + SORT_BY_START_TIME, + span().root().operationName("publish"), + span().childOf(parent.getSpanId()).operationName("attempt"))); + } finally { + scheduler.shutdownNow(); + } + } + + @Test + void retriedAttemptsSucceedAndContextNotLeaked() throws Exception { + ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor(); + try { + ScheduledRetryingExecutor executor = + new ScheduledRetryingExecutor<>(retryAlgorithm(3), scheduler); + AtomicInteger count = new AtomicInteger(0); + AgentSpan parent = startSpan("gax", "publish"); + CountDownLatch allAttemptsDone = new CountDownLatch(3); + RetryingFuture future = + executor.createFuture( + () -> { + AgentSpan attempt = startSpan("gax", "attempt"); + try { + if (count.incrementAndGet() < 3) { + throw new RuntimeException("transient"); + } + return "ok"; + } finally { + attempt.finish(); + allAttemptsDone.countDown(); + } + }); + + try (ContextScope scope = activateSpan(parent)) { + future.setAttemptFuture(executor.submit(future)); + assertEquals("ok", future.get(5, TimeUnit.SECONDS)); + } + allAttemptsDone.await(5, TimeUnit.SECONDS); + parent.finish(); + assertTraces( + trace( + SORT_BY_START_TIME, + span().root().operationName("publish"), + span().childOf(parent.getSpanId()).operationName("attempt"), + span().childOf(parent.getSpanId()).operationName("attempt"), + span().childOf(parent.getSpanId()).operationName("attempt"))); + } finally { + scheduler.shutdownNow(); + } + } + + @Test + void exhaustedRetriesContextNotLeaked() throws Exception { + ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor(); + try { + ScheduledRetryingExecutor executor = + new ScheduledRetryingExecutor<>(retryAlgorithm(3), scheduler); + AgentSpan parent = startSpan("gax", "publish"); + CountDownLatch allAttemptsDone = new CountDownLatch(3); + RetryingFuture future = + executor.createFuture( + () -> { + AgentSpan attempt = startSpan("gax", "attempt"); + try { + throw new RuntimeException("always fails"); + } finally { + attempt.finish(); + allAttemptsDone.countDown(); + } + }); + + try (ContextScope scope = activateSpan(parent)) { + future.setAttemptFuture(executor.submit(future)); + assertThrows(ExecutionException.class, () -> future.get(5, TimeUnit.SECONDS)); + } + allAttemptsDone.await(5, TimeUnit.SECONDS); + parent.finish(); + assertTraces( + trace( + SORT_BY_START_TIME, + span().root().operationName("publish"), + span().childOf(parent.getSpanId()).operationName("attempt"), + span().childOf(parent.getSpanId()).operationName("attempt"), + span().childOf(parent.getSpanId()).operationName("attempt"))); + } finally { + scheduler.shutdownNow(); + } + } + + private static RetryAlgorithm retryAlgorithm(int maxAttempts) { + RetrySettings settings = + RetrySettings.newBuilder() + .setMaxAttempts(maxAttempts) + .setInitialRetryDelay(Duration.ofMillis(1)) + .setRetryDelayMultiplier(1.0) + .setMaxRetryDelay(Duration.ofMillis(10)) + .setInitialRpcTimeout(Duration.ofSeconds(5)) + .setRpcTimeoutMultiplier(1.0) + .setMaxRpcTimeout(Duration.ofSeconds(5)) + .setTotalTimeout(Duration.ofSeconds(30)) + .build(); + ApiClock clock = NanoClock.getDefaultClock(); + return new RetryAlgorithm<>( + new BasicResultRetryAlgorithm<>(), new ExponentialRetryAlgorithm(settings, clock)); + } +} diff --git a/dd-java-agent/instrumentation/glassfish-3.0/gradle.lockfile b/dd-java-agent/instrumentation/glassfish-3.0/gradle.lockfile index 1736f9dc2ef..be6fc990abb 100644 --- a/dd-java-agent/instrumentation/glassfish-3.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/glassfish-3.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:glassfish-3.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -85,6 +89,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -102,14 +107,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/google-http-client-1.19/gradle.lockfile b/dd-java-agent/instrumentation/google-http-client-1.19/gradle.lockfile index 1508ba4d27c..f0290719ee4 100644 --- a/dd-java-agent/instrumentation/google-http-client-1.19/gradle.lockfile +++ b/dd-java-agent/instrumentation/google-http-client-1.19/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:google-http-client-1.19:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -30,19 +31,18 @@ com.google.auto:auto-common:1.2.1=annotationProcessor,latestDepTestAnnotationPro com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.errorprone:error_prone_annotations:2.36.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:33.4.8-android=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.http-client:google-http-client:1.19.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.google.http-client:google-http-client:2.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.http-client:google-http-client:2.1.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.j2objc:j2objc-annotations:3.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -60,12 +60,12 @@ io.grpc:grpc-context:1.70.0=latestDepTestCompileClasspath,latestDepTestRuntimeCl io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath io.opencensus:opencensus-api:0.31.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.opencensus:opencensus-contrib-http-util:0.31.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -98,7 +98,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -116,14 +116,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/google-http-client-1.19/src/main/java/datadog/trace/instrumentation/googlehttpclient/GoogleHttpClientDecorator.java b/dd-java-agent/instrumentation/google-http-client-1.19/src/main/java/datadog/trace/instrumentation/googlehttpclient/GoogleHttpClientDecorator.java index 6204dfda7ae..f1d41a0d97c 100644 --- a/dd-java-agent/instrumentation/google-http-client-1.19/src/main/java/datadog/trace/instrumentation/googlehttpclient/GoogleHttpClientDecorator.java +++ b/dd-java-agent/instrumentation/google-http-client-1.19/src/main/java/datadog/trace/instrumentation/googlehttpclient/GoogleHttpClientDecorator.java @@ -31,10 +31,9 @@ protected URI url(final HttpRequest httpRequest) throws URISyntaxException { return URIUtils.safeParse(fixedUrl); } - public AgentSpan prepareSpan(AgentSpan span, HttpRequest request) { + public void prepareSpan(AgentSpan span, HttpRequest request) { DECORATE.afterStart(span); DECORATE.onRequest(span, request); - return span; } @Override diff --git a/dd-java-agent/instrumentation/google-http-client-1.19/src/main/java/datadog/trace/instrumentation/googlehttpclient/GoogleHttpClientInstrumentation.java b/dd-java-agent/instrumentation/google-http-client-1.19/src/main/java/datadog/trace/instrumentation/googlehttpclient/GoogleHttpClientInstrumentation.java index 52ceab06153..45fec3e612d 100644 --- a/dd-java-agent/instrumentation/google-http-client-1.19/src/main/java/datadog/trace/instrumentation/googlehttpclient/GoogleHttpClientInstrumentation.java +++ b/dd-java-agent/instrumentation/google-http-client-1.19/src/main/java/datadog/trace/instrumentation/googlehttpclient/GoogleHttpClientInstrumentation.java @@ -5,7 +5,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; import static datadog.trace.instrumentation.googlehttpclient.GoogleHttpClientDecorator.DECORATE; import static datadog.trace.instrumentation.googlehttpclient.GoogleHttpClientDecorator.HTTP_REQUEST; import static datadog.trace.instrumentation.googlehttpclient.HeadersInjectAdapter.SETTER; @@ -80,8 +80,9 @@ public static AgentScope methodEnter( return null; } } - return activateSpan( - DECORATE.prepareSpan(startSpan("google-http-client", HTTP_REQUEST), request)); + AgentSpan span = startSpan("google-http-client", HTTP_REQUEST); + DECORATE.prepareSpan(span, request); + return activateSpan(span); } @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) @@ -90,17 +91,16 @@ public static void methodExit( @Advice.Local("inherited") AgentSpan inheritedSpan, @Advice.Return final HttpResponse response, @Advice.Thrown final Throwable throwable) { + AgentSpan span = scope != null ? scope.span() : inheritedSpan; try { - AgentSpan span = scope != null ? scope.span() : inheritedSpan; DECORATE.onError(span, throwable); DECORATE.onResponse(span, response); - DECORATE.beforeFinish(span); - span.finish(); } finally { if (scope != null) { scope.close(); } + span.finish(); } } } @@ -109,22 +109,25 @@ public static class GoogleHttpClientAsyncAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) public static AgentScope methodEnter(@Advice.This HttpRequest request) { - return activateSpan( - DECORATE.prepareSpan(startSpan("google-http-client", HTTP_REQUEST), request)); + AgentSpan span = startSpan("google-http-client", HTTP_REQUEST); + DECORATE.prepareSpan(span, request); + return activateSpan(span); } @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void methodExit( @Advice.Enter AgentScope scope, @Advice.Thrown final Throwable throwable) { + final AgentSpan span = scope.span(); try { if (throwable != null) { - AgentSpan span = scope.span(); DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); - span.finish(); } } finally { scope.close(); + if (throwable != null) { + span.finish(); + } } } } @@ -133,7 +136,7 @@ public static void methodExit( public static class GoogleHttpClientContextPropagationAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) public static void methodEnter(@Advice.This HttpRequest request) { - DECORATE.injectContext(getCurrentContext(), request, SETTER); + DECORATE.injectContext(currentContext(), request, SETTER); } } } diff --git a/dd-java-agent/instrumentation/google-pubsub-1.116/build.gradle b/dd-java-agent/instrumentation/google-pubsub-1.116/build.gradle index 905bdd8e67b..6d0480e0680 100644 --- a/dd-java-agent/instrumentation/google-pubsub-1.116/build.gradle +++ b/dd-java-agent/instrumentation/google-pubsub-1.116/build.gradle @@ -18,6 +18,7 @@ dependencies { testImplementation group: 'com.google.cloud', name: 'google-cloud-pubsub', version: '1.116.0' testImplementation project(":dd-java-agent:instrumentation:grpc-1.5") testImplementation project(":dd-java-agent:instrumentation:guava-10.0") + testImplementation project(":dd-java-agent:instrumentation:gax-1.4") latestDepTestImplementation group: 'com.google.cloud', name: 'google-cloud-pubsub', version: '+' } diff --git a/dd-java-agent/instrumentation/google-pubsub-1.116/gradle.lockfile b/dd-java-agent/instrumentation/google-pubsub-1.116/gradle.lockfile index 5122adb403e..0b1ce98265a 100644 --- a/dd-java-agent/instrumentation/google-pubsub-1.116/gradle.lockfile +++ b/dd-java-agent/instrumentation/google-pubsub-1.116/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:google-pubsub-1.116:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -17,34 +18,34 @@ com.github.docker-java:docker-java-api:3.4.2=latestDepForkedTestCompileClasspath com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.android:annotations:4.1.1.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.google.api.grpc:proto-google-cloud-pubsub-v1:1.132.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.api.grpc:proto-google-cloud-pubsub-v1:1.152.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.api.grpc:proto-google-cloud-pubsub-v1:1.98.0=compileClasspath,testCompileClasspath,testRuntimeClasspath com.google.api.grpc:proto-google-common-protos:2.7.4=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.google.api.grpc:proto-google-common-protos:2.70.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.api.grpc:proto-google-common-protos:2.73.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.api.grpc:proto-google-iam-v1:1.2.6=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.google.api.grpc:proto-google-iam-v1:1.65.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.api.grpc:proto-google-iam-v1:1.68.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.api:api-common:2.1.4=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.google.api:api-common:2.62.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.api:api-common:2.65.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.api:gax-grpc:2.12.2=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.google.api:gax-grpc:2.79.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.google.api:gax-httpjson:2.79.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.api:gax-grpc:2.82.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.api:gax-httpjson:2.82.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.api:gax:2.12.2=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.google.api:gax:2.79.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.google.auth:google-auth-library-credentials:1.46.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.api:gax:2.82.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.auth:google-auth-library-credentials:1.49.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.auth:google-auth-library-credentials:1.5.3=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.google.auth:google-auth-library-oauth2-http:1.46.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.auth:google-auth-library-oauth2-http:1.49.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.auth:google-auth-library-oauth2-http:1.5.3=compileClasspath,testCompileClasspath,testRuntimeClasspath com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath com.google.auto.service:auto-service:1.1.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor @@ -52,34 +53,33 @@ com.google.auto.value:auto-value-annotations:1.11.0=latestDepForkedTestCompileCl com.google.auto.value:auto-value-annotations:1.9=compileClasspath,testCompileClasspath,testRuntimeClasspath com.google.auto:auto-common:1.2.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.cloud:google-cloud-pubsub:1.116.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.google.cloud:google-cloud-pubsub:1.150.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.cloud:google-cloud-pubsub:1.152.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -com.google.code.gson:gson:2.12.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.google.code.gson:gson:2.13.2=spotbugs +com.google.code.gson:gson:2.13.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs com.google.code.gson:gson:2.9.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.google.errorprone:error_prone_annotations:2.11.0=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.11.0=compileClasspath com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.errorprone:error_prone_annotations:2.45.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.google.guava:failureaccess:1.0.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.google.guava:guava:31.0.1-jre=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.48.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.guava:failureaccess:1.0.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:31.0.1-jre=compileClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:33.5.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.http-client:google-http-client-gson:1.41.4=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.google.http-client:google-http-client-gson:2.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.http-client:google-http-client-gson:2.1.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.http-client:google-http-client:1.41.4=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.google.http-client:google-http-client:2.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath -com.google.j2objc:j2objc-annotations:1.3=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.google.http-client:google-http-client:2.1.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +com.google.j2objc:j2objc-annotations:1.3=compileClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.protobuf:protobuf-java-util:3.19.4=testRuntimeClasspath com.google.protobuf:protobuf-java-util:4.33.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.protobuf:protobuf-java:3.19.4=compileClasspath,testCompileClasspath,testRuntimeClasspath com.google.protobuf:protobuf-java:4.33.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath -com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -93,48 +93,49 @@ commons-io:commons-io:2.20.0=spotbugs commons-logging:commons-logging:1.2=compileClasspath,testCompileClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.grpc:grpc-alts:1.44.1=testRuntimeClasspath -io.grpc:grpc-alts:1.80.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.grpc:grpc-alts:1.81.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.grpc:grpc-api:1.44.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.grpc:grpc-api:1.80.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.grpc:grpc-api:1.81.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.grpc:grpc-auth:1.44.1=testRuntimeClasspath -io.grpc:grpc-auth:1.80.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.grpc:grpc-auth:1.81.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.grpc:grpc-context:1.44.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.grpc:grpc-context:1.80.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.grpc:grpc-context:1.81.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.grpc:grpc-core:1.44.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.grpc:grpc-core:1.80.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.grpc:grpc-googleapis:1.80.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.grpc:grpc-core:1.81.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.grpc:grpc-googleapis:1.81.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.grpc:grpc-grpclb:1.44.1=testRuntimeClasspath -io.grpc:grpc-inprocess:1.80.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.grpc:grpc-inprocess:1.81.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.grpc:grpc-netty-shaded:1.44.1=testRuntimeClasspath -io.grpc:grpc-netty-shaded:1.80.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.grpc:grpc-netty-shaded:1.81.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.grpc:grpc-protobuf-lite:1.44.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.grpc:grpc-protobuf-lite:1.80.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.grpc:grpc-protobuf-lite:1.81.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.grpc:grpc-protobuf:1.44.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.grpc:grpc-protobuf:1.80.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.grpc:grpc-protobuf:1.81.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.grpc:grpc-services:1.44.1=testRuntimeClasspath -io.grpc:grpc-services:1.80.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.grpc:grpc-services:1.81.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.grpc:grpc-stub:1.44.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.grpc:grpc-stub:1.80.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath -io.grpc:grpc-util:1.80.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.grpc:grpc-stub:1.81.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.grpc:grpc-util:1.81.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.grpc:grpc-xds:1.44.1=testRuntimeClasspath -io.grpc:grpc-xds:1.80.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.grpc:grpc-xds:1.81.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.opencensus:opencensus-api:0.31.0=compileClasspath,testCompileClasspath,testRuntimeClasspath io.opencensus:opencensus-api:0.31.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.opencensus:opencensus-contrib-http-util:0.31.0=compileClasspath,testCompileClasspath,testRuntimeClasspath io.opencensus:opencensus-contrib-http-util:0.31.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.opencensus:opencensus-proto:0.2.0=testRuntimeClasspath -io.opentelemetry:opentelemetry-api:1.51.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.opentelemetry:opentelemetry-context:1.51.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.opentelemetry:opentelemetry-api:1.62.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.opentelemetry:opentelemetry-common:1.62.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.opentelemetry:opentelemetry-context:1.62.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.perfmark:perfmark-api:0.23.0=testRuntimeClasspath io.perfmark:perfmark-api:0.27.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.annotation:javax.annotation-api:1.3.2=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -165,7 +166,7 @@ org.codehaus.groovy:groovy-xml:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codehaus.mojo:animal-sniffer-annotations:1.21=testRuntimeClasspath -org.codehaus.mojo:animal-sniffer-annotations:1.26=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +org.codehaus.mojo:animal-sniffer-annotations:1.27=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.conscrypt:conscrypt-openjdk-uber:2.5.1=testRuntimeClasspath org.conscrypt:conscrypt-openjdk-uber:2.5.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -176,7 +177,7 @@ org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTes org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -194,14 +195,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/google-pubsub-1.116/src/main/java/datadog/trace/instrumentation/googlepubsub/MessageReceiverWithAckResponseWrapper.java b/dd-java-agent/instrumentation/google-pubsub-1.116/src/main/java/datadog/trace/instrumentation/googlepubsub/MessageReceiverWithAckResponseWrapper.java index aa6ba981dd4..e85354c537c 100644 --- a/dd-java-agent/instrumentation/google-pubsub-1.116/src/main/java/datadog/trace/instrumentation/googlepubsub/MessageReceiverWithAckResponseWrapper.java +++ b/dd-java-agent/instrumentation/google-pubsub-1.116/src/main/java/datadog/trace/instrumentation/googlepubsub/MessageReceiverWithAckResponseWrapper.java @@ -6,7 +6,7 @@ import com.google.cloud.pubsub.v1.AckReplyConsumerWithResponse; import com.google.cloud.pubsub.v1.MessageReceiverWithAckResponse; import com.google.pubsub.v1.PubsubMessage; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; public class MessageReceiverWithAckResponseWrapper implements MessageReceiverWithAckResponse { @@ -21,8 +21,8 @@ public MessageReceiverWithAckResponseWrapper( @Override public void receiveMessage(PubsubMessage message, AckReplyConsumerWithResponse consumer) { - final AgentSpan span = CONSUMER_DECORATE.onConsume(message, subscription); - try (final AgentScope scope = activateSpan(span)) { + final AgentSpan span = CONSUMER_DECORATE.startConsumeSpan(message, subscription); + try (final ContextScope scope = activateSpan(span)) { this.delegate.receiveMessage(message, consumer); } finally { CONSUMER_DECORATE.beforeFinish(span); diff --git a/dd-java-agent/instrumentation/google-pubsub-1.116/src/main/java/datadog/trace/instrumentation/googlepubsub/MessageReceiverWrapper.java b/dd-java-agent/instrumentation/google-pubsub-1.116/src/main/java/datadog/trace/instrumentation/googlepubsub/MessageReceiverWrapper.java index fc87a410a08..59ffc1d928e 100644 --- a/dd-java-agent/instrumentation/google-pubsub-1.116/src/main/java/datadog/trace/instrumentation/googlepubsub/MessageReceiverWrapper.java +++ b/dd-java-agent/instrumentation/google-pubsub-1.116/src/main/java/datadog/trace/instrumentation/googlepubsub/MessageReceiverWrapper.java @@ -6,7 +6,7 @@ import com.google.cloud.pubsub.v1.AckReplyConsumer; import com.google.cloud.pubsub.v1.MessageReceiver; import com.google.pubsub.v1.PubsubMessage; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; public final class MessageReceiverWrapper implements MessageReceiver { @@ -20,8 +20,8 @@ public MessageReceiverWrapper(String subscription, MessageReceiver delegate) { @Override public void receiveMessage(PubsubMessage message, AckReplyConsumer consumer) { - final AgentSpan span = CONSUMER_DECORATE.onConsume(message, subscription); - try (final AgentScope scope = activateSpan(span)) { + final AgentSpan span = CONSUMER_DECORATE.startConsumeSpan(message, subscription); + try (final ContextScope scope = activateSpan(span)) { this.delegate.receiveMessage(message, consumer); } finally { CONSUMER_DECORATE.beforeFinish(span); diff --git a/dd-java-agent/instrumentation/google-pubsub-1.116/src/main/java/datadog/trace/instrumentation/googlepubsub/PubSubDecorator.java b/dd-java-agent/instrumentation/google-pubsub-1.116/src/main/java/datadog/trace/instrumentation/googlepubsub/PubSubDecorator.java index b4b012fc4db..57c5b13a807 100644 --- a/dd-java-agent/instrumentation/google-pubsub-1.116/src/main/java/datadog/trace/instrumentation/googlepubsub/PubSubDecorator.java +++ b/dd-java-agent/instrumentation/google-pubsub-1.116/src/main/java/datadog/trace/instrumentation/googlepubsub/PubSubDecorator.java @@ -121,7 +121,7 @@ protected String spanKind() { return spanKind; } - public AgentSpan onConsume(final PubsubMessage message, final String subscription) { + public AgentSpan startConsumeSpan(final PubsubMessage message, final String subscription) { final AgentSpanContext spanContext = extractContextAndGetSpanContext(message, TextMapExtractAdapter.GETTER); final AgentSpan span = startSpan(JAVA_PUBSUB.toString(), PUBSUB_CONSUME, spanContext); diff --git a/dd-java-agent/instrumentation/google-pubsub-1.116/src/main/java/datadog/trace/instrumentation/googlepubsub/PublisherInstrumentation.java b/dd-java-agent/instrumentation/google-pubsub-1.116/src/main/java/datadog/trace/instrumentation/googlepubsub/PublisherInstrumentation.java index a746bcbcfdb..35f44420a64 100644 --- a/dd-java-agent/instrumentation/google-pubsub-1.116/src/main/java/datadog/trace/instrumentation/googlepubsub/PublisherInstrumentation.java +++ b/dd-java-agent/instrumentation/google-pubsub-1.116/src/main/java/datadog/trace/instrumentation/googlepubsub/PublisherInstrumentation.java @@ -57,8 +57,8 @@ public static void stopSpan( @Advice.Enter final AgentScope scope, @Advice.Thrown final Throwable throwable) { PRODUCER_DECORATE.onError(scope, throwable); PRODUCER_DECORATE.beforeFinish(scope); - scope.span().finish(); scope.close(); + scope.span().finish(); } } diff --git a/dd-java-agent/instrumentation/google-pubsub-1.116/src/test/groovy/PubSubTest.groovy b/dd-java-agent/instrumentation/google-pubsub-1.116/src/test/groovy/PubSubTest.groovy index 289822df042..09892853956 100644 --- a/dd-java-agent/instrumentation/google-pubsub-1.116/src/test/groovy/PubSubTest.groovy +++ b/dd-java-agent/instrumentation/google-pubsub-1.116/src/test/groovy/PubSubTest.groovy @@ -1,4 +1,3 @@ - import static datadog.trace.agent.test.utils.TraceUtils.basicSpan import com.google.api.gax.core.NoCredentialsProvider @@ -34,13 +33,12 @@ import datadog.trace.core.datastreams.StatsGroup import datadog.trace.instrumentation.grpc.client.GrpcClientDecorator import io.grpc.ManagedChannel import io.grpc.ManagedChannelBuilder +import java.nio.charset.StandardCharsets +import java.util.concurrent.CountDownLatch import org.testcontainers.containers.PubSubEmulatorContainer import org.testcontainers.utility.DockerImageName import spock.lang.Shared -import java.nio.charset.StandardCharsets -import java.util.concurrent.CountDownLatch - abstract class PubSubTest extends VersionedNamingTestBase { private static final String PROJECT_ID = "dd-trace-java" @@ -69,11 +67,6 @@ abstract class PubSubTest extends VersionedNamingTestBase { null } - @Override - boolean useStrictTraceWrites() { - false - } - boolean shadowGrpcSpans() { true } @@ -97,7 +90,7 @@ abstract class PubSubTest extends VersionedNamingTestBase { } def setupSpec() { - emulator = new PubSubEmulatorContainer(DockerImageName.parse("gcr.io/google.com/cloudsdktool/cloud-sdk:495.0.0-emulators")) + emulator = new PubSubEmulatorContainer(DockerImageName.parse("gcr.io/google.com/cloudsdktool/google-cloud-cli:495.0.0-emulators")) emulator.start() channel = ManagedChannelBuilder.forTarget(emulator.getEmulatorEndpoint()).usePlaintext().build() transportChannelProvider = FixedTransportChannelProvider.create(GrpcTransportChannel.create(channel)) diff --git a/dd-java-agent/instrumentation/graal/build.gradle b/dd-java-agent/instrumentation/graal/build.gradle deleted file mode 100644 index 5e69c67bd78..00000000000 --- a/dd-java-agent/instrumentation/graal/build.gradle +++ /dev/null @@ -1 +0,0 @@ -apply from: "$rootDir/gradle/java.gradle" diff --git a/dd-java-agent/instrumentation/graal/graal-native-image-20.0/gradle.lockfile b/dd-java-agent/instrumentation/graal/graal-native-image-20.0/gradle.lockfile index 5b5cf664404..33cd9f120d7 100644 --- a/dd-java-agent/instrumentation/graal/graal-native-image-20.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/graal/graal-native-image-20.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:graal:graal-native-image-20.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=muzzleBootstrap,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=muzzleBootstrap,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -94,6 +98,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -111,14 +116,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/graal/graal-native-image-20.0/src/main/java/datadog/trace/instrumentation/graal/nativeimage/NativeImageGeneratorRunnerInstrumentation.java b/dd-java-agent/instrumentation/graal/graal-native-image-20.0/src/main/java/datadog/trace/instrumentation/graal/nativeimage/NativeImageGeneratorRunnerInstrumentation.java index 405d3f35bc2..8ab84d9b8af 100644 --- a/dd-java-agent/instrumentation/graal/graal-native-image-20.0/src/main/java/datadog/trace/instrumentation/graal/nativeimage/NativeImageGeneratorRunnerInstrumentation.java +++ b/dd-java-agent/instrumentation/graal/graal-native-image-20.0/src/main/java/datadog/trace/instrumentation/graal/nativeimage/NativeImageGeneratorRunnerInstrumentation.java @@ -92,6 +92,7 @@ public static void onEnter(@Advice.Argument(value = 0, readOnly = false) String[ + "datadog.trace.api.GenericClassValue:build_time," + "datadog.trace.api.GlobalTracer:build_time," + "datadog.trace.api.GlobalTracer$1:build_time," + + "datadog.trace.api.IdGenerationStrategy:build_time," + "datadog.trace.api.MethodFilterConfigParser:build_time," + "datadog.trace.api.WithGlobalTracer:build_time," + "datadog.trace.api.ProductActivation:build_time," @@ -156,6 +157,7 @@ public static void onEnter(@Advice.Argument(value = 0, readOnly = false) String[ + "datadog.trace.instrumentation.reactivestreams.ReactiveStreamsAsyncResultExtension:build_time," + "datadog.trace.instrumentation.reactor.core.ReactorAsyncResultExtension:build_time," + "datadog.trace.instrumentation.rxjava2.RxJavaAsyncResultExtension:build_time," + + "datadog.trace.instrumentation.rxjava3.RxJavaAsyncResultExtension:build_time," + "datadog.trace.logging.ddlogger.DDLogger:build_time," + "datadog.trace.logging.ddlogger.DDLoggerFactory:build_time," + "datadog.trace.logging.ddlogger.DDLoggerFactory$HelperWrapper:build_time," diff --git a/dd-java-agent/instrumentation/graal/graal-native-image-20.0/src/main/java/datadog/trace/instrumentation/graal/nativeimage/ResourcesFeatureInstrumentation.java b/dd-java-agent/instrumentation/graal/graal-native-image-20.0/src/main/java/datadog/trace/instrumentation/graal/nativeimage/ResourcesFeatureInstrumentation.java index f45917f9e8c..bdc78bed041 100644 --- a/dd-java-agent/instrumentation/graal/graal-native-image-20.0/src/main/java/datadog/trace/instrumentation/graal/nativeimage/ResourcesFeatureInstrumentation.java +++ b/dd-java-agent/instrumentation/graal/graal-native-image-20.0/src/main/java/datadog/trace/instrumentation/graal/nativeimage/ResourcesFeatureInstrumentation.java @@ -54,6 +54,7 @@ public static void onExit() { // tracer's jmxfetch configs tracerResources.add("jmxfetch/jmxfetch-config.yaml"); + tracerResources.add("jmxfetch/jmxfetch-config-no-jvm-defaults.yaml"); tracerResources.add("jmxfetch/jmxfetch-websphere-config.yaml"); // jmxfetch integrations metricconfigs diff --git a/dd-java-agent/instrumentation/graal/gradle.lockfile b/dd-java-agent/instrumentation/graal/gradle.lockfile deleted file mode 100644 index 5ca3972ba7b..00000000000 --- a/dd-java-agent/instrumentation/graal/gradle.lockfile +++ /dev/null @@ -1,122 +0,0 @@ -# This is a Gradle generated file for dependency locking. -# Manual edits can break the build and are not advised. -# This file is expected to be part of source control. -cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath -cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath -ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath -com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath -com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath -com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath -com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath -com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath -com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath -com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs:4.9.8=spotbugs -com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs -com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath -com.google.auto.service:auto-service:1.1.1=annotationProcessor,testAnnotationProcessor -com.google.auto:auto-common:1.2.1=annotationProcessor,testAnnotationProcessor -com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -com.google.code.gson:gson:2.13.2=spotbugs -com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor -com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor -com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath -com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath -com.squareup.okio:okio:1.17.5=testCompileClasspath,testRuntimeClasspath -com.thoughtworks.qdox:qdox:1.12.1=codenarc -commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testRuntimeClasspath -commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath -commons-io:commons-io:2.20.0=spotbugs -de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath -javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath -jaxen:jaxen:2.0.0=spotbugs -junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath -net.java.dev.jna:jna:5.8.0=testRuntimeClasspath -net.sf.saxon:Saxon-HE:12.9=spotbugs -org.apache.ant:ant-antlr:1.10.14=codenarc -org.apache.ant:ant-junit:1.10.14=codenarc -org.apache.bcel:bcel:6.11.0=spotbugs -org.apache.commons:commons-lang3:3.19.0=spotbugs -org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.logging.log4j:log4j-api:2.25.2=spotbugs -org.apache.logging.log4j:log4j-core:2.25.2=spotbugs -org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath -org.checkerframework:checker-qual:3.33.0=annotationProcessor,testAnnotationProcessor -org.codehaus.groovy:groovy-ant:3.0.23=codenarc -org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc -org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc -org.codehaus.groovy:groovy-json:3.0.23=codenarc -org.codehaus.groovy:groovy-json:3.0.25=testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-templates:3.0.23=codenarc -org.codehaus.groovy:groovy-xml:3.0.23=codenarc -org.codehaus.groovy:groovy:3.0.23=codenarc -org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath -org.codenarc:CodeNarc:3.7.0=codenarc -org.dom4j:dom4j:2.2.0=spotbugs -org.gmetrics:GMetrics:2.1.0=codenarc -org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath -org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath -org.jctools:jctools-core:4.0.6=testRuntimeClasspath -org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath -org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath -org.junit.platform:junit-platform-runner:1.14.1=testRuntimeClasspath -org.junit.platform:junit-platform-suite-api:1.14.1=testRuntimeClasspath -org.junit.platform:junit-platform-suite-commons:1.14.1=testRuntimeClasspath -org.junit:junit-bom:5.14.0=spotbugs -org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath -org.mockito:mockito-core:4.4.0=testRuntimeClasspath -org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath -org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath -org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath -org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath -org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath -org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j -org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j -org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,muzzleTooling,runtimeClasspath,testRuntimeClasspath -org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath -org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath -org.xmlresolver:xmlresolver:5.3.3=spotbugs -empty=spotbugsPlugins diff --git a/dd-java-agent/instrumentation/gradle-testing-5.1/gradle.lockfile b/dd-java-agent/instrumentation/gradle-testing-5.1/gradle.lockfile index 5ca3972ba7b..1cfcaf737b9 100644 --- a/dd-java-agent/instrumentation/gradle-testing-5.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/gradle-testing-5.1/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:gradle-testing-5.1:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/gradle.lockfile b/dd-java-agent/instrumentation/gradle.lockfile index d5718dbc9da..48265eb0cca 100644 --- a/dd-java-agent/instrumentation/gradle.lockfile +++ b/dd-java-agent/instrumentation/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,26 +9,26 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=runtimeClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=runtimeClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.re2j:re2j:1.7=runtimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=runtimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=runtimeClasspath,testRuntimeClasspath com.squareup.okio:okio:1.17.5=runtimeClasspath,testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc @@ -35,8 +36,8 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=runtimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=runtimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -83,8 +84,8 @@ org.ow2.asm:asm-tree:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/gradle/gradle-3.0/build.gradle b/dd-java-agent/instrumentation/gradle/gradle-3.0/build.gradle index 22fa1b97ca4..dd59affe950 100644 --- a/dd-java-agent/instrumentation/gradle/gradle-3.0/build.gradle +++ b/dd-java-agent/instrumentation/gradle/gradle-3.0/build.gradle @@ -9,3 +9,14 @@ repositories { dependencies { compileOnly gradleApi() } + +// This module's Groovy classes are loaded into the user's Gradle daemon, which might bundle Groovy <3.0 (Gradle <7.x). +// Groovy 4 (bundled by the build's Gradle 9+) compiles invokedynamic by default, binding dynamic calls to +// org.codehaus.groovy.vmplugin.v8.IndyInterface — a class that only exists from Groovy +// 3.0 onwards. Under Groovy <3.0 that bootstrap target is missing, so the classes fail +// to link and CI Visibility never instruments the build. Force classic call-site +// dispatch so the emitted bytecode links on older daemons regardless of the build's +// bundled Groovy version. +tasks.withType(GroovyCompile).configureEach { + groovyOptions.optimizationOptions.indy = false +} diff --git a/dd-java-agent/instrumentation/gradle/gradle-3.0/gradle.lockfile b/dd-java-agent/instrumentation/gradle/gradle-3.0/gradle.lockfile index 5ca3972ba7b..feed5a8410d 100644 --- a/dd-java-agent/instrumentation/gradle/gradle-3.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/gradle/gradle-3.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:gradle:gradle-3.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/gradle/gradle-3.0/src/main/groovy/datadog/trace/instrumentation/gradle/legacy/GradleBuildListener.java b/dd-java-agent/instrumentation/gradle/gradle-3.0/src/main/groovy/datadog/trace/instrumentation/gradle/legacy/GradleBuildListener.java index f92a31b345b..bf99dbe034d 100644 --- a/dd-java-agent/instrumentation/gradle/gradle-3.0/src/main/groovy/datadog/trace/instrumentation/gradle/legacy/GradleBuildListener.java +++ b/dd-java-agent/instrumentation/gradle/gradle-3.0/src/main/groovy/datadog/trace/instrumentation/gradle/legacy/GradleBuildListener.java @@ -7,6 +7,7 @@ import datadog.trace.api.civisibility.domain.BuildSessionSettings; import datadog.trace.api.civisibility.domain.JavaAgent; import datadog.trace.api.civisibility.events.BuildEventsHandler; +import datadog.trace.bootstrap.instrumentation.api.Tags; import java.nio.file.Path; import java.util.Collections; import java.util.List; @@ -111,9 +112,22 @@ public void beforeExecute(@Nonnull Task task) { List classpath = GradleUtils.getClasspath(task); JavaAgent jacocoAgent = GradleUtils.getJacocoAgent(task); + // "com.android.base" is applied transitively by every Android Gradle Plugin, so it is a + // reliable single marker for an Android project regardless of how its tests are executed. + Map additionalTags = + project.getPluginManager().hasPlugin("com.android.base") + ? Collections.singletonMap(Tags.TEST_IS_ANDROID, true) + : Collections.emptyMap(); + BuildModuleSettings moduleSettings = buildEventsHandler.onTestModuleStart( - gradle, taskPath, moduleLayout, jvmExecutable, classpath, jacocoAgent, null); + gradle, + taskPath, + moduleLayout, + jvmExecutable, + classpath, + jacocoAgent, + additionalTags); Map systemProperties = moduleSettings.getSystemProperties(); GradleProjectConfigurator.INSTANCE.configureTracer(task, systemProperties); } diff --git a/dd-java-agent/instrumentation/gradle/gradle-8.3/gradle.lockfile b/dd-java-agent/instrumentation/gradle/gradle-8.3/gradle.lockfile index 5ca3972ba7b..c12e17f5d05 100644 --- a/dd-java-agent/instrumentation/gradle/gradle-8.3/gradle.lockfile +++ b/dd-java-agent/instrumentation/gradle/gradle-8.3/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:gradle:gradle-8.3:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/gradle/gradle-8.3/src/main/groovy/datadog/trace/instrumentation/gradle/CiVisibilityGradleListener.java b/dd-java-agent/instrumentation/gradle/gradle-8.3/src/main/groovy/datadog/trace/instrumentation/gradle/CiVisibilityGradleListener.java index 09d6506822a..8e3f6220073 100644 --- a/dd-java-agent/instrumentation/gradle/gradle-8.3/src/main/groovy/datadog/trace/instrumentation/gradle/CiVisibilityGradleListener.java +++ b/dd-java-agent/instrumentation/gradle/gradle-8.3/src/main/groovy/datadog/trace/instrumentation/gradle/CiVisibilityGradleListener.java @@ -183,6 +183,14 @@ public void beforeExecute(TaskIdentity taskIdentity) { Project project = gradle.getRootProject().project(projectPath); Test task = (Test) project.getTasks().getByName(taskIdentity.name); + // "com.android.base" is applied transitively by the application/library/dynamic-feature/test + // Android Gradle Plugins. The Android KMP library plugin (AGP 8.8+) is a separate entry point + // that does NOT apply com.android.base, so it must be checked explicitly. + PluginManager pluginManager = project.getPluginManager(); + boolean isAndroid = + pluginManager.hasPlugin("com.android.base") + || pluginManager.hasPlugin("com.android.kotlin.multiplatform.library"); + Map inputProperties = task.getInputs().getProperties(); BuildModuleLayout moduleLayout = (BuildModuleLayout) inputProperties.get(CiVisibilityPluginExtension.MODULE_LAYOUT_PROPERTY); @@ -197,7 +205,7 @@ public void beforeExecute(TaskIdentity taskIdentity) { List taskClasspath = CiVisibilityPluginExtension.getClasspath(task); ciVisibilityService.onModuleStart( - taskPath, moduleLayout, jvmExecutable, taskClasspath, jacocoAgent); + taskPath, isAndroid, moduleLayout, jvmExecutable, taskClasspath, jacocoAgent); } private JavaAgent getJacocoAgent(Test task) { diff --git a/dd-java-agent/instrumentation/gradle/gradle-8.3/src/main/groovy/datadog/trace/instrumentation/gradle/CiVisibilityService.java b/dd-java-agent/instrumentation/gradle/gradle-8.3/src/main/groovy/datadog/trace/instrumentation/gradle/CiVisibilityService.java index adc27283cb0..6d4462f15b0 100644 --- a/dd-java-agent/instrumentation/gradle/gradle-8.3/src/main/groovy/datadog/trace/instrumentation/gradle/CiVisibilityService.java +++ b/dd-java-agent/instrumentation/gradle/gradle-8.3/src/main/groovy/datadog/trace/instrumentation/gradle/CiVisibilityService.java @@ -123,12 +123,21 @@ public void onBuildTaskFinish(String taskPath, @Nullable Throwable failure) { public void onModuleStart( String taskPath, + boolean isAndroid, BuildModuleLayout moduleLayout, Path jvmExecutable, Collection taskClasspath, JavaAgent jacocoAgent) { + Map additionalTags = + isAndroid ? Collections.singletonMap(Tags.TEST_IS_ANDROID, true) : Collections.emptyMap(); buildEventsHandler.onTestModuleStart( - SESSION_KEY, taskPath, moduleLayout, jvmExecutable, taskClasspath, jacocoAgent, null); + SESSION_KEY, + taskPath, + moduleLayout, + jvmExecutable, + taskClasspath, + jacocoAgent, + additionalTags); } public void onModuleFinish( diff --git a/dd-java-agent/instrumentation/graphql-java/graphql-java-14.0/gradle.lockfile b/dd-java-agent/instrumentation/graphql-java/graphql-java-14.0/gradle.lockfile index be7e0418ce5..d966936fd04 100644 --- a/dd-java-agent/instrumentation/graphql-java/graphql-java-14.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/graphql-java/graphql-java-14.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:graphql-java:graphql-java-14.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.graphql-java:graphql-java:14.0=compileClasspath,testCompileClasspath,testRuntimeClasspath com.graphql-java:graphql-java:19.11=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.graphql-java:java-dataloader:2.2.3=compileClasspath,testCompileClasspath,testRuntimeClasspath @@ -51,12 +55,12 @@ commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForked commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -86,6 +90,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepForkedTestRuntimeClasspath,latestDepTest org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -103,14 +108,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.2=compileClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/graphql-java/graphql-java-14.0/src/main/java/datadog/trace/instrumentation/graphqljava14/GraphQLInstrumentation.java b/dd-java-agent/instrumentation/graphql-java/graphql-java-14.0/src/main/java/datadog/trace/instrumentation/graphqljava14/GraphQLInstrumentation.java index c7f0abf0705..14c2753d1c0 100644 --- a/dd-java-agent/instrumentation/graphql-java/graphql-java-14.0/src/main/java/datadog/trace/instrumentation/graphqljava14/GraphQLInstrumentation.java +++ b/dd-java-agent/instrumentation/graphql-java/graphql-java-14.0/src/main/java/datadog/trace/instrumentation/graphqljava14/GraphQLInstrumentation.java @@ -102,7 +102,7 @@ public InstrumentationContext beginParse( InstrumentationExecutionParameters parameters) { State state = parameters.getInstrumentationState(); final AgentSpan parsingSpan = - startSpan(GRAPHQL_JAVA.toString(), GRAPHQL_PARSING, state.getRequestSpan().context()); + startSpan(GRAPHQL_JAVA.toString(), GRAPHQL_PARSING, state.getRequestSpan().spanContext()); DECORATE.afterStart(parsingSpan); return new ParsingInstrumentationContext(parsingSpan, state, parameters.getQuery()); } @@ -113,7 +113,8 @@ public InstrumentationContext> beginValidation( State state = parameters.getInstrumentationState(); final AgentSpan validationSpan = - startSpan(GRAPHQL_JAVA.toString(), GRAPHQL_VALIDATION, state.getRequestSpan().context()); + startSpan( + GRAPHQL_JAVA.toString(), GRAPHQL_VALIDATION, state.getRequestSpan().spanContext()); DECORATE.afterStart(validationSpan); return new ValidationInstrumentationContext(validationSpan); } diff --git a/dd-java-agent/instrumentation/graphql-java/graphql-java-20.0/gradle.lockfile b/dd-java-agent/instrumentation/graphql-java/graphql-java-20.0/gradle.lockfile index ad020c4cdce..f3e2031cf41 100644 --- a/dd-java-agent/instrumentation/graphql-java/graphql-java-20.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/graphql-java/graphql-java-20.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:graphql-java:graphql-java-20.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=graphql20LatestDepForkedTestCompileClasspath, com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,graphql20LatestDepForkedTestAnnotationProcessor,graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepTestAnnotationProcessor,graphql20LatestDepTestCompileClasspath,graphql21LatestDepForkedTestAnnotationProcessor,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepTestAnnotationProcessor,graphql21LatestDepTestCompileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,graph com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,graphql20LatestDepForkedTestAnnotationProcessor,graphql20LatestDepTestAnnotationProcessor,graphql21LatestDepForkedTestAnnotationProcessor,graphql21LatestDepTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,graphql20LatestDepForkedTestAnnotationProcessor,graphql20LatestDepTestAnnotationProcessor,graphql21LatestDepForkedTestAnnotationProcessor,graphql21LatestDepTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,graphql20LatestDepForkedTestAnnotationProcessor,graphql20LatestDepTestAnnotationProcessor,graphql21LatestDepForkedTestAnnotationProcessor,graphql21LatestDepTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,graphql20LatestDepForkedTestAnnotationProcessor,graphql20LatestDepTestAnnotationProcessor,graphql21LatestDepForkedTestAnnotationProcessor,graphql21LatestDepTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,graphql20LatestDepForkedTestAnnotationProcessor,graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestAnnotationProcessor,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestAnnotationProcessor,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestAnnotationProcessor,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,graphql20LatestDepForkedTestAnnotationProcessor,graphql20LatestDepTestAnnotationProcessor,graphql21LatestDepForkedTestAnnotationProcessor,graphql21LatestDepTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.graphql-java:graphql-java:20.0=compileClasspath,testCompileClasspath,testRuntimeClasspath com.graphql-java:graphql-java:20.9=graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath com.graphql-java:graphql-java:21.5=graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath @@ -54,12 +58,12 @@ commons-io:commons-io:2.11.0=graphql20LatestDepForkedTestCompileClasspath,graphq commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -88,6 +92,7 @@ org.hamcrest:hamcrest-core:1.3=graphql20LatestDepForkedTestRuntimeClasspath,grap org.hamcrest:hamcrest:3.0=graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -105,14 +110,14 @@ org.objenesis:objenesis:3.3=graphql20LatestDepForkedTestCompileClasspath,graphql org.opentest4j:opentest4j:1.3.0=graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.3=compileClasspath,graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=graphql20LatestDepForkedTestCompileClasspath,graphql20LatestDepForkedTestRuntimeClasspath,graphql20LatestDepTestCompileClasspath,graphql20LatestDepTestRuntimeClasspath,graphql21LatestDepForkedTestCompileClasspath,graphql21LatestDepForkedTestRuntimeClasspath,graphql21LatestDepTestCompileClasspath,graphql21LatestDepTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/graphql-java/graphql-java-20.0/src/main/java/datadog/trace/instrumentation/graphqljava20/GraphQLInstrumentation.java b/dd-java-agent/instrumentation/graphql-java/graphql-java-20.0/src/main/java/datadog/trace/instrumentation/graphqljava20/GraphQLInstrumentation.java index 0e736c6e4fb..5a88ec3dd81 100644 --- a/dd-java-agent/instrumentation/graphql-java/graphql-java-20.0/src/main/java/datadog/trace/instrumentation/graphqljava20/GraphQLInstrumentation.java +++ b/dd-java-agent/instrumentation/graphql-java/graphql-java-20.0/src/main/java/datadog/trace/instrumentation/graphqljava20/GraphQLInstrumentation.java @@ -120,7 +120,7 @@ public InstrumentationContext beginParse( AgentTracer.startSpan( GraphQLDecorator.GRAPHQL_JAVA.toString(), GraphQLDecorator.GRAPHQL_PARSING, - state.getRequestSpan().context()); + state.getRequestSpan().spanContext()); GraphQLDecorator.DECORATE.afterStart(parsingSpan); return new ParsingInstrumentationContext(parsingSpan, state, parameters.getQuery()); } @@ -137,7 +137,7 @@ public InstrumentationContext> beginValidation( AgentTracer.startSpan( GraphQLDecorator.GRAPHQL_JAVA.toString(), GraphQLDecorator.GRAPHQL_VALIDATION, - state.getRequestSpan().context()); + state.getRequestSpan().spanContext()); GraphQLDecorator.DECORATE.afterStart(validationSpan); return new ValidationInstrumentationContext(validationSpan); } diff --git a/dd-java-agent/instrumentation/graphql-java/graphql-java-common/gradle.lockfile b/dd-java-agent/instrumentation/graphql-java/graphql-java-common/gradle.lockfile index 726c07a45c7..b2e71632524 100644 --- a/dd-java-agent/instrumentation/graphql-java/graphql-java-common/gradle.lockfile +++ b/dd-java-agent/instrumentation/graphql-java/graphql-java-common/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:graphql-java:graphql-java-common:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.graphql-java:graphql-java:14.0=compileClasspath com.graphql-java:java-dataloader:2.2.3=compileClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath @@ -49,12 +53,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -84,6 +88,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -101,14 +106,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.2=compileClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/graphql-java/graphql-java-common/src/main/java/datadog/trace/instrumentation/graphqljava/GraphQLDecorator.java b/dd-java-agent/instrumentation/graphql-java/graphql-java-common/src/main/java/datadog/trace/instrumentation/graphqljava/GraphQLDecorator.java index 7981de23037..a61306846fb 100644 --- a/dd-java-agent/instrumentation/graphql-java/graphql-java-common/src/main/java/datadog/trace/instrumentation/graphqljava/GraphQLDecorator.java +++ b/dd-java-agent/instrumentation/graphql-java/graphql-java-common/src/main/java/datadog/trace/instrumentation/graphqljava/GraphQLDecorator.java @@ -54,12 +54,12 @@ protected CharSequence component() { } @Override - public AgentSpan afterStart(final AgentSpan span) { + public void afterStart(final AgentSpan span) { span.setMeasured(true); - return super.afterStart(span); + super.afterStart(span); } - public AgentSpan onRequest(final AgentSpan span, final ExecutionContext context) { + public void onRequest(final AgentSpan span, final ExecutionContext context) { if (ActiveSubsystems.APPSEC_ACTIVE) { @@ -88,13 +88,13 @@ public AgentSpan onRequest(final AgentSpan span, final ExecutionContext context) CallbackProvider cbp = tracer().getCallbackProvider(RequestContextSlot.APPSEC); RequestContext ctx = span.getRequestContext(); if (cbp == null || resolversArgs.isEmpty() || ctx == null) { - return null; + return; } BiFunction, Flow> graphqlResolverCallback = cbp.getCallback(EVENTS.graphqlServerRequestMessage()); if (graphqlResolverCallback == null) { - return null; + return; } Flow flow = graphqlResolverCallback.apply(ctx, resolversArgs); @@ -103,7 +103,5 @@ public AgentSpan onRequest(final AgentSpan span, final ExecutionContext context) // span.setRequestBlockingAction((Flow.Action.RequestBlockingAction) flow.getAction()); } } - - return span; } } diff --git a/dd-java-agent/instrumentation/graphql-java/graphql-java-common/src/main/java/datadog/trace/instrumentation/graphqljava/InstrumentedDataFetcher.java b/dd-java-agent/instrumentation/graphql-java/graphql-java-common/src/main/java/datadog/trace/instrumentation/graphqljava/InstrumentedDataFetcher.java index 8faacaf0f32..98bbc788e2c 100644 --- a/dd-java-agent/instrumentation/graphql-java/graphql-java-common/src/main/java/datadog/trace/instrumentation/graphqljava/InstrumentedDataFetcher.java +++ b/dd-java-agent/instrumentation/graphql-java/graphql-java-common/src/main/java/datadog/trace/instrumentation/graphqljava/InstrumentedDataFetcher.java @@ -5,7 +5,7 @@ import static datadog.trace.instrumentation.graphqljava.GraphQLDecorator.DECORATE; import static datadog.trace.instrumentation.graphqljava.GraphQLDecorator.GRAPHQL_JAVA; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import graphql.execution.instrumentation.parameters.InstrumentationFieldFetchParameters; import graphql.schema.DataFetcher; @@ -31,12 +31,12 @@ public InstrumentedDataFetcher( @Override public Object get(DataFetchingEnvironment environment) throws Exception { if (parameters.isTrivialDataFetcher()) { - try (AgentScope scope = activateSpan(this.requestSpan)) { + try (ContextScope scope = activateSpan(this.requestSpan)) { return dataFetcher.get(environment); } } else { final AgentSpan fieldSpan = - startSpan(GRAPHQL_JAVA.toString(), "graphql.field", this.requestSpan.context()); + startSpan(GRAPHQL_JAVA.toString(), "graphql.field", this.requestSpan.spanContext()); DECORATE.afterStart(fieldSpan); String parentType = GraphQLTypeUtil.simplePrint(environment.getParentType()); String fieldName = environment.getField().getName(); @@ -46,7 +46,7 @@ public Object get(DataFetchingEnvironment environment) throws Exception { GraphQLOutputType fieldType = environment.getFieldType(); fieldSpan.setTag("graphql.type", GraphQLTypeUtil.simplePrint(fieldType)); Object dataValue; - try (AgentScope scope = activateSpan(fieldSpan)) { + try (ContextScope scope = activateSpan(fieldSpan)) { dataValue = dataFetcher.get(environment); } catch (Exception e) { DECORATE.onError(fieldSpan, e); diff --git a/dd-java-agent/instrumentation/grizzly/grizzly-2.0/build.gradle b/dd-java-agent/instrumentation/grizzly/grizzly-2.0/build.gradle index 4dc46f8d760..11610568ae6 100644 --- a/dd-java-agent/instrumentation/grizzly/grizzly-2.0/build.gradle +++ b/dd-java-agent/instrumentation/grizzly/grizzly-2.0/build.gradle @@ -30,3 +30,10 @@ configurations.named('testRuntimeOnly') { // jersey-container-grizzly2-http transitively imports its own set repackaged asm classes exclude group: 'org.ow2.asm' } + +// Jersey 2.0 links to Guava's removed MoreExecutors.sameThreadExecutor method. +['testCompileClasspath', 'testRuntimeClasspath'].each { + configurations.named(it) { + resolutionStrategy.force 'com.google.guava:guava:20.0' + } +} diff --git a/dd-java-agent/instrumentation/grizzly/grizzly-2.0/gradle.lockfile b/dd-java-agent/instrumentation/grizzly/grizzly-2.0/gradle.lockfile index bc9dd8931c3..c9a089cac5e 100644 --- a/dd-java-agent/instrumentation/grizzly/grizzly-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/grizzly/grizzly-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:grizzly:grizzly-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,16 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,7 +52,7 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath jakarta.validation:jakarta.validation-api:2.0.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath jakarta.ws.rs:jakarta.ws.rs-api:2.1.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -61,8 +66,8 @@ javax.xml.bind:jaxb-api:2.2.3=latestDepTestCompileClasspath,latestDepTestRuntime javax.xml.stream:stax-api:1.0-2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -127,6 +132,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.javassist:javassist:3.30.2-GA=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -146,8 +152,8 @@ org.ow2.asm:asm-analysis:9.9=spotbugs org.ow2.asm:asm-commons:9.9=spotbugs org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/grizzly/grizzly-2.0/src/main/java/datadog/trace/instrumentation/grizzly/GrizzlyBlockingHelper.java b/dd-java-agent/instrumentation/grizzly/grizzly-2.0/src/main/java/datadog/trace/instrumentation/grizzly/GrizzlyBlockingHelper.java index 8ab2a5b8aed..ece9d6c4f07 100644 --- a/dd-java-agent/instrumentation/grizzly/grizzly-2.0/src/main/java/datadog/trace/instrumentation/grizzly/GrizzlyBlockingHelper.java +++ b/dd-java-agent/instrumentation/grizzly/grizzly-2.0/src/main/java/datadog/trace/instrumentation/grizzly/GrizzlyBlockingHelper.java @@ -1,6 +1,5 @@ package datadog.trace.instrumentation.grizzly; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.grizzly.GrizzlyDecorator.DECORATE; import datadog.appsec.api.blocking.BlockingContentType; @@ -60,7 +59,7 @@ public static boolean block( return false; } - AgentSpan span = spanFromContext(context); + AgentSpan span = AgentSpan.fromContext(context); try { OutputStream os = (OutputStream) GET_OUTPUT_STREAM.invoke(response); response.setStatus(BlockingActionHelper.getHttpCode(statusCode)); diff --git a/dd-java-agent/instrumentation/grizzly/grizzly-2.0/src/main/java/datadog/trace/instrumentation/grizzly/GrizzlyHttpHandlerInstrumentation.java b/dd-java-agent/instrumentation/grizzly/grizzly-2.0/src/main/java/datadog/trace/instrumentation/grizzly/GrizzlyHttpHandlerInstrumentation.java index ecbb38bdfaa..5c474dfdd0e 100644 --- a/dd-java-agent/instrumentation/grizzly/grizzly-2.0/src/main/java/datadog/trace/instrumentation/grizzly/GrizzlyHttpHandlerInstrumentation.java +++ b/dd-java-agent/instrumentation/grizzly/grizzly-2.0/src/main/java/datadog/trace/instrumentation/grizzly/GrizzlyHttpHandlerInstrumentation.java @@ -2,7 +2,7 @@ import static datadog.trace.agent.tooling.InstrumenterModule.TargetSystem.CONTEXT_TRACKING; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; import static datadog.trace.instrumentation.grizzly.GrizzlyDecorator.DECORATE; @@ -53,7 +53,7 @@ public static void onEnter( parentScope = parentContext.attach(); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void closeScope(@Advice.Local("parentScope") ContextScope parentScope) { if (parentScope != null) { parentScope.close(); @@ -73,7 +73,7 @@ public static class HandleAdvice { } final Context parentContext = - getCurrentContext(); // parent context attached by ContextTrackingAdvice + currentContext(); // parent context attached by ContextTrackingAdvice final Context context = DECORATE.startSpan(request, parentContext); final AgentSpan span = spanFromContext(context); DECORATE.afterStart(span); @@ -113,9 +113,11 @@ public static void methodExit( final AgentSpan span = spanFromContext(scope.context()); DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); + scope.close(); span.finish(); + } else { + scope.close(); } - scope.close(); // span finished by SpanClosingListener if (skippedBody) { diff --git a/dd-java-agent/instrumentation/grizzly/grizzly-2.0/src/main/java/datadog/trace/instrumentation/grizzly/SpanClosingListener.java b/dd-java-agent/instrumentation/grizzly/grizzly-2.0/src/main/java/datadog/trace/instrumentation/grizzly/SpanClosingListener.java index 46142eb7771..4729ae8b395 100644 --- a/dd-java-agent/instrumentation/grizzly/grizzly-2.0/src/main/java/datadog/trace/instrumentation/grizzly/SpanClosingListener.java +++ b/dd-java-agent/instrumentation/grizzly/grizzly-2.0/src/main/java/datadog/trace/instrumentation/grizzly/SpanClosingListener.java @@ -1,6 +1,5 @@ package datadog.trace.instrumentation.grizzly; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; import static datadog.trace.instrumentation.grizzly.GrizzlyDecorator.DECORATE; @@ -19,7 +18,7 @@ public void onAfterService(final Request request) { request.removeAttribute(DD_CONTEXT_ATTRIBUTE); final Context context = (Context) contextAttr; - final AgentSpan span = spanFromContext(context); + final AgentSpan span = AgentSpan.fromContext(context); if (span != null) { DECORATE.onResponse(span, request.getResponse()); DECORATE.beforeFinish(context); diff --git a/dd-java-agent/instrumentation/grizzly/grizzly-client-1.9/gradle.lockfile b/dd-java-agent/instrumentation/grizzly/grizzly-client-1.9/gradle.lockfile index cf515146658..dbd86f062a7 100644 --- a/dd-java-agent/instrumentation/grizzly/grizzly-client-1.9/gradle.lockfile +++ b/dd-java-agent/instrumentation/grizzly/grizzly-client-1.9/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:grizzly:grizzly-client-1.9:dependencies --write-locks biz.aQute.bnd:biz.aQute.bnd.annotation:7.1.0=latest5DepTestCompileClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath @@ -9,20 +10,20 @@ ch.qos.logback:logback-core:1.2.13=latest5DepTestCompileClasspath,latest5DepTest com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latest5DepTestAnnotationProcessor,latest5DepTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,muleLatestDepTestAnnotationProcessor,muleLatestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,14 +32,16 @@ com.google.auto:auto-common:1.2.1=annotationProcessor,latest5DepTestAnnotationPr com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,latest5DepTestAnnotationProcessor,latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestAnnotationProcessor,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latest5DepTestAnnotationProcessor,latestDepTestAnnotationProcessor,muleLatestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.errorprone:error_prone_annotations:2.38.0=latest5DepTestCompileClasspath com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latest5DepTestAnnotationProcessor,latestDepTestAnnotationProcessor,muleLatestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latest5DepTestAnnotationProcessor,latestDepTestAnnotationProcessor,muleLatestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latest5DepTestAnnotationProcessor,latestDepTestAnnotationProcessor,muleLatestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latest5DepTestAnnotationProcessor,latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestAnnotationProcessor,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latest5DepTestAnnotationProcessor,latestDepTestAnnotationProcessor,muleLatestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -49,12 +52,12 @@ commons-io:commons-io:2.11.0=latest5DepTestCompileClasspath,latest5DepTestRuntim commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -102,7 +105,7 @@ org.hamcrest:hamcrest-core:1.3=latest5DepTestRuntimeClasspath,latestDepTestRunti org.hamcrest:hamcrest:3.0=latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath -org.jspecify:jspecify:1.0.0=latest5DepTestCompileClasspath +org.jspecify:jspecify:1.0.0=latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -129,14 +132,14 @@ org.osgi:org.osgi.resource:1.0.0=latest5DepTestCompileClasspath org.osgi:org.osgi.service.serviceloader:1.0.0=latest5DepTestCompileClasspath org.ow2.asm:asm-analysis:9.7.1=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latest5DepTestRuntimeClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latest5DepTestCompileClasspath,latest5DepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muleLatestDepTestCompileClasspath,muleLatestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/grizzly/grizzly-client-1.9/src/main/java/datadog/trace/instrumentation/grizzly/client/AsyncHandlerAdapter.java b/dd-java-agent/instrumentation/grizzly/grizzly-client-1.9/src/main/java/datadog/trace/instrumentation/grizzly/client/AsyncHandlerAdapter.java index 6dc269a81c1..2a3c84139a0 100644 --- a/dd-java-agent/instrumentation/grizzly/grizzly-client-1.9/src/main/java/datadog/trace/instrumentation/grizzly/client/AsyncHandlerAdapter.java +++ b/dd-java-agent/instrumentation/grizzly/grizzly-client-1.9/src/main/java/datadog/trace/instrumentation/grizzly/client/AsyncHandlerAdapter.java @@ -8,7 +8,7 @@ import com.ning.http.client.HttpResponseHeaders; import com.ning.http.client.HttpResponseStatus; import com.ning.http.client.Response; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; public class AsyncHandlerAdapter implements AsyncHandler { @@ -30,7 +30,7 @@ public void onThrowable(Throwable throwable) { @Override public STATE onBodyPartReceived(HttpResponseBodyPart httpResponseBodyPart) throws Exception { - try (final AgentScope ignored = activateSpan(clientSpan)) { + try (final ContextScope ignored = activateSpan(clientSpan)) { return delegate.onBodyPartReceived(httpResponseBodyPart); } } @@ -38,7 +38,7 @@ public STATE onBodyPartReceived(HttpResponseBodyPart httpResponseBodyPart) throw @Override public STATE onStatusReceived(HttpResponseStatus httpResponseStatus) throws Exception { responseBuilder = responseBuilder.accumulate(httpResponseStatus); - try (final AgentScope ignored = activateSpan(clientSpan)) { + try (final ContextScope ignored = activateSpan(clientSpan)) { return delegate.onStatusReceived(httpResponseStatus); } } @@ -46,7 +46,7 @@ public STATE onStatusReceived(HttpResponseStatus httpResponseStatus) throws Exce @Override public STATE onHeadersReceived(HttpResponseHeaders httpResponseHeaders) throws Exception { responseBuilder = responseBuilder.accumulate(httpResponseHeaders); - try (final AgentScope ignored = activateSpan(clientSpan)) { + try (final ContextScope ignored = activateSpan(clientSpan)) { return delegate.onHeadersReceived(httpResponseHeaders); } } @@ -55,7 +55,7 @@ public STATE onHeadersReceived(HttpResponseHeaders httpResponseHeaders) throws E public T onCompleted() throws Exception { try { final T response; - try (AgentScope ignored = (parentSpan != null ? activateSpan(parentSpan) : null)) { + try (ContextScope ignored = (parentSpan != null ? activateSpan(parentSpan) : null)) { response = delegate.onCompleted(); } if (response instanceof Response) { diff --git a/dd-java-agent/instrumentation/grizzly/grizzly-client-1.9/src/main/java/datadog/trace/instrumentation/grizzly/client/AsyncHttpClientInstrumentation.java b/dd-java-agent/instrumentation/grizzly/grizzly-client-1.9/src/main/java/datadog/trace/instrumentation/grizzly/client/AsyncHttpClientInstrumentation.java index bd46afb7234..30b38dbfeb9 100644 --- a/dd-java-agent/instrumentation/grizzly/grizzly-client-1.9/src/main/java/datadog/trace/instrumentation/grizzly/client/AsyncHttpClientInstrumentation.java +++ b/dd-java-agent/instrumentation/grizzly/grizzly-client-1.9/src/main/java/datadog/trace/instrumentation/grizzly/client/AsyncHttpClientInstrumentation.java @@ -5,7 +5,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; import static datadog.trace.instrumentation.grizzly.client.ClientDecorator.DECORATE; import static datadog.trace.instrumentation.grizzly.client.ClientDecorator.HTTP_REQUEST; import static datadog.trace.instrumentation.grizzly.client.InjectAdapter.SETTER; @@ -63,9 +63,11 @@ public static void onExit( AgentSpan span = scope.span(); DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); + scope.close(); span.finish(); + } else { + scope.close(); } - scope.close(); } } @@ -73,7 +75,7 @@ public static void onExit( public static class ExecuteContextPropagationAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) public static void onEnter(@Advice.Argument(0) final Request request) { - DECORATE.injectContext(getCurrentContext(), request, SETTER); + DECORATE.injectContext(currentContext(), request, SETTER); } } } diff --git a/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/gradle.lockfile b/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/gradle.lockfile index 45e97a80144..d9da4fdd224 100644 --- a/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/gradle.lockfile +++ b/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:grizzly:grizzly-http-2.3.20:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,7 +51,7 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath jakarta.validation:jakarta.validation-api:2.0.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath jakarta.ws.rs:jakarta.ws.rs-api:2.1.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -62,8 +66,8 @@ javax.xml.bind:jaxb-api:2.2.3=latestDepTestCompileClasspath,latestDepTestRuntime javax.xml.stream:stax-api:1.0-2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -125,6 +129,7 @@ org.javassist:javassist:3.18.1-GA=testCompileClasspath,testRuntimeClasspath org.javassist:javassist:3.30.2-GA=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -144,14 +149,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/DefaultFilterChainInstrumentation.java b/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/DefaultFilterChainInstrumentation.java index 84efdb6e24b..99b02eb9052 100644 --- a/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/DefaultFilterChainInstrumentation.java +++ b/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/DefaultFilterChainInstrumentation.java @@ -53,7 +53,7 @@ public static ContextScope onEnter(@Advice.Argument(2) final FilterChainContext return null; } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void onExit(@Advice.Enter final ContextScope scope) { if (scope != null) { scope.close(); diff --git a/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/FilterAdvice.java b/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/FilterAdvice.java index 9e39339d732..0c58e436c8d 100644 --- a/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/FilterAdvice.java +++ b/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/FilterAdvice.java @@ -1,7 +1,7 @@ package datadog.trace.instrumentation.grizzlyhttp232; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; import datadog.context.Context; @@ -13,7 +13,7 @@ public class FilterAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) public static ContextScope onEnter(@Advice.Argument(0) final FilterChainContext ctx) { - if (getCurrentContext() != getRootContext()) { + if (currentContext() != rootContext()) { return null; } Object contextObj = ctx.getAttributes().getAttribute(DD_CONTEXT_ATTRIBUTE); diff --git a/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/GrizzlyByteBodyInstrumentation.java b/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/GrizzlyByteBodyInstrumentation.java index a39e7362ba7..1989ab3ba0b 100644 --- a/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/GrizzlyByteBodyInstrumentation.java +++ b/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/GrizzlyByteBodyInstrumentation.java @@ -109,7 +109,7 @@ static void after(@Advice.This final NIOInputStream thiz, @Advice.Return int ret } static class NIOInputStreamReadByteArrayAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.This final NIOInputStream thiz, @Advice.Argument(0) byte[] byteArray, @@ -137,7 +137,7 @@ static void after( } static class NIOInputStreamReadByteArrayIntIntAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.This final NIOInputStream thiz, @Advice.Argument(0) byte[] byteArray, @@ -183,7 +183,7 @@ static void after(@Advice.This final NIOInputStream thiz, @Advice.Return Buffer } static class NIOInputStreamIsFinishedAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.This final NIOInputStream thiz, @Advice.Return boolean ret, @@ -207,7 +207,7 @@ static void after( } static class NIOInputStreamRecycleAdvice { - @Advice.OnMethodExit(suppress = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after(@Advice.This final NIOInputStream thiz) { InstrumentationContext.get(NIOInputStream.class, StoredByteBody.class).put(thiz, null); } diff --git a/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/GrizzlyCharBodyInstrumentation.java b/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/GrizzlyCharBodyInstrumentation.java index 3a5e27cfabc..73ce6a5efdd 100644 --- a/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/GrizzlyCharBodyInstrumentation.java +++ b/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/GrizzlyCharBodyInstrumentation.java @@ -73,7 +73,7 @@ static void after( } static class NIOReaderReadAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.This final NIOReader thiz, @Advice.Return int ret, @@ -99,7 +99,7 @@ static void after( } static class NIOReaderReadCharArrayAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.This final NIOReader thiz, @Advice.Argument(0) char[] charArray, @@ -126,7 +126,7 @@ static void after( } static class NIOReaderReadCharArrayIntIntAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.This final NIOReader thiz, @Advice.Argument(0) char[] charArray, @@ -166,7 +166,7 @@ static int before( return charBuffer.position(); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Local("storedCharBody") StoredCharBody storedCharBody, @Advice.Argument(0) CharBuffer charBuffer, @@ -197,7 +197,7 @@ static void after( } static class NIOReaderIsFinishedAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.This final NIOReader thiz, @Advice.Return boolean ret, @@ -221,7 +221,7 @@ static void after( } static class NIOReaderRecycleAdvice { - @Advice.OnMethodExit(suppress = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after(@Advice.This final NIOReader thiz) { InstrumentationContext.get(NIOReader.class, StoredCharBody.class).put(thiz, null); } diff --git a/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/GrizzlyDecorator.java b/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/GrizzlyDecorator.java index 9b917f65941..acdb6b26eee 100644 --- a/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/GrizzlyDecorator.java +++ b/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/GrizzlyDecorator.java @@ -1,6 +1,5 @@ package datadog.trace.instrumentation.grizzlyhttp232; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; import datadog.appsec.api.blocking.BlockingContentType; @@ -90,7 +89,7 @@ public static void onHttpServerFilterPrepareResponseEnter( FilterChainContext ctx, HttpResponsePacket responsePacket) { Context context = (Context) ctx.getAttributes().getAttribute(DD_CONTEXT_ATTRIBUTE); AgentSpan span; - if (context != null && (span = spanFromContext(context)) != null) { + if (context != null && (span = AgentSpan.fromContext(context)) != null) { DECORATE.onResponse(span, responsePacket); } } @@ -99,7 +98,7 @@ public static void onHttpServerFilterPrepareResponseExit( FilterChainContext ctx, HttpResponsePacket responsePacket) { Context context = (Context) ctx.getAttributes().getAttribute(DD_CONTEXT_ATTRIBUTE); AgentSpan span; - if (context != null && (span = spanFromContext(context)) != null) { + if (context != null && (span = AgentSpan.fromContext(context)) != null) { DECORATE.beforeFinish(context); span.finish(); } @@ -120,7 +119,7 @@ public static NextAction onHttpCodecFilterExit( Context parentContext = DECORATE.extract(httpRequest); Context context = DECORATE.startSpan(httpRequest, parentContext); ContextScope scope = context.attach(); - AgentSpan span = spanFromContext(context); + AgentSpan span = AgentSpan.fromContext(context); DECORATE.afterStart(span); ctx.getAttributes().setAttribute(DD_RESPONSE_ATTRIBUTE, httpResponse); ctx.getAttributes().setAttribute(DD_CONTEXT_ATTRIBUTE, context); @@ -150,7 +149,7 @@ public static NextAction onHttpCodecFilterExit( public static void onFilterChainFail(FilterChainContext ctx, Throwable throwable) { Context context = (Context) ctx.getAttributes().getAttribute(DD_CONTEXT_ATTRIBUTE); AgentSpan span; - if (context != null && (span = spanFromContext(context)) != null) { + if (context != null && (span = AgentSpan.fromContext(context)) != null) { DECORATE.onError(span, throwable); DECORATE.beforeFinish(context); span.finish(); diff --git a/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/ParsedBodyParametersInstrumentation.java b/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/ParsedBodyParametersInstrumentation.java index 037c220c739..aea5c512c3b 100644 --- a/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/ParsedBodyParametersInstrumentation.java +++ b/dd-java-agent/instrumentation/grizzly/grizzly-http-2.3.20/src/main/java/datadog/trace/instrumentation/grizzlyhttp232/ParsedBodyParametersInstrumentation.java @@ -82,7 +82,7 @@ static int before( // if there is no request context, skips the body, returns 0 and will skip after() } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Local("origParamHashValues") Map> origParamValues, @Advice.FieldValue("paramHashValues") final Map> paramValuesField, diff --git a/dd-java-agent/instrumentation/grpc-1.5/gradle.lockfile b/dd-java-agent/instrumentation/grpc-1.5/gradle.lockfile index 2a3756d16b4..d6fe9414c55 100644 --- a/dd-java-agent/instrumentation/grpc-1.5/gradle.lockfile +++ b/dd-java-agent/instrumentation/grpc-1.5/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:grpc-1.5:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestCo com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,compileProtoPath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,compileProtoPath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.android:annotations:4.1.1.4=compileProtoPath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath @@ -35,22 +36,22 @@ com.google.code.gson:gson:2.13.2=latestDepTestCompileProtoPath,latestDepTestRunt com.google.code.gson:gson:2.8.6=compileProtoPath,testCompileProtoPath,testRuntimeClasspath com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.errorprone:error_prone_annotations:2.48.0=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath -com.google.errorprone:error_prone_annotations:2.5.1=testCompileClasspath -com.google.errorprone:error_prone_annotations:2.9.0=compileProtoPath,testCompileProtoPath,testRuntimeClasspath -com.google.guava:failureaccess:1.0.1=annotationProcessor,compileProtoPath,latestDepTestAnnotationProcessor,testAnnotationProcessor,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath -com.google.guava:guava:30.1.1-android=compileProtoPath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.9.0=compileProtoPath +com.google.guava:failureaccess:1.0.1=annotationProcessor,compileProtoPath,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.google.guava:guava:30.1.1-android=compileProtoPath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:33.5.0-android=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,compileProtoPath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -com.google.j2objc:j2objc-annotations:1.3=compileProtoPath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:1.3=compileProtoPath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.protobuf:protobuf-java:3.18.2=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.protobuf:protobuf-java:3.25.8=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath com.google.protobuf:protoc:3.17.3=protobufToolsLocator_protoc -com.google.re2j:re2j:1.7=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath @@ -61,53 +62,53 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestCompileP commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,compileProtoPath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath io.grpc:grpc-api:1.42.2=compileClasspath,compileProtoPath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.grpc:grpc-api:1.81.0=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.grpc:grpc-api:1.82.2=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.grpc:grpc-context:1.42.2=compileClasspath,compileProtoPath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.grpc:grpc-context:1.81.0=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.grpc:grpc-context:1.82.2=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.grpc:grpc-core:1.42.2=compileClasspath,compileProtoPath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.grpc:grpc-core:1.81.0=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath -io.grpc:grpc-inprocess:1.81.0=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.grpc:grpc-core:1.82.2=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.grpc:grpc-inprocess:1.82.2=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.grpc:grpc-netty:1.42.2=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.grpc:grpc-netty:1.81.0=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.grpc:grpc-netty:1.82.2=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.grpc:grpc-protobuf-lite:1.42.2=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.grpc:grpc-protobuf-lite:1.81.0=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.grpc:grpc-protobuf-lite:1.82.2=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.grpc:grpc-protobuf:1.42.2=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.grpc:grpc-protobuf:1.81.0=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.grpc:grpc-protobuf:1.82.2=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.grpc:grpc-stub:1.42.2=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.grpc:grpc-stub:1.81.0=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath -io.grpc:grpc-util:1.81.0=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.grpc:grpc-stub:1.82.2=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.grpc:grpc-util:1.82.2=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.grpc:protoc-gen-grpc-java:1.42.2=protobufToolsLocator_grpc io.leangen.geantyref:geantyref:1.3.16=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath -io.netty:netty-buffer:4.1.132.Final=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-buffer:4.1.133.Final=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.netty:netty-buffer:4.1.63.Final=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.netty:netty-codec-http2:4.1.132.Final=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http2:4.1.133.Final=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.netty:netty-codec-http2:4.1.63.Final=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.netty:netty-codec-http:4.1.132.Final=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http:4.1.133.Final=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.netty:netty-codec-http:4.1.63.Final=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.netty:netty-codec-socks:4.1.132.Final=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-codec-socks:4.1.133.Final=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.netty:netty-codec-socks:4.1.63.Final=testCompileProtoPath,testRuntimeClasspath -io.netty:netty-codec:4.1.132.Final=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-codec:4.1.133.Final=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.netty:netty-codec:4.1.63.Final=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.netty:netty-common:4.1.132.Final=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-common:4.1.133.Final=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.netty:netty-common:4.1.63.Final=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.netty:netty-handler-proxy:4.1.132.Final=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-handler-proxy:4.1.133.Final=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.netty:netty-handler-proxy:4.1.63.Final=testCompileProtoPath,testRuntimeClasspath -io.netty:netty-handler:4.1.132.Final=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-handler:4.1.133.Final=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.netty:netty-handler:4.1.63.Final=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.netty:netty-resolver:4.1.132.Final=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-resolver:4.1.133.Final=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.netty:netty-resolver:4.1.63.Final=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -io.netty:netty-transport-native-unix-common:4.1.132.Final=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath -io.netty:netty-transport:4.1.132.Final=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.1.133.Final=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +io.netty:netty-transport:4.1.133.Final=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.63.Final=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath io.perfmark:perfmark-api:0.23.0=compileProtoPath,testCompileProtoPath,testRuntimeClasspath io.perfmark:perfmark-api:0.27.0=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath javax.annotation:javax.annotation-api:1.3.2=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -119,7 +120,7 @@ org.apache.commons:commons-text:1.14.0=spotbugs org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=latestDepTestCompileClasspath,testCompileClasspath -org.checkerframework:checker-compat-qual:2.5.5=compileProtoPath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +org.checkerframework:checker-compat-qual:2.5.5=compileProtoPath org.checkerframework:checker-qual:3.33.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc @@ -139,7 +140,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestCompileProtoPath,latestDepTestRuntim org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath -org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath @@ -157,14 +158,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestCompilePr org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestCompileProtoPath,latestDepTestRuntimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/QueuedCommandInstrumentation.java b/dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/QueuedCommandInstrumentation.java index 506c3414b47..d44454e6c1d 100644 --- a/dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/QueuedCommandInstrumentation.java +++ b/dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/QueuedCommandInstrumentation.java @@ -10,11 +10,11 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArguments; import com.google.auto.service.AutoService; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.bootstrap.ContextStore; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.java.concurrent.QueueTimerHelper; import datadog.trace.bootstrap.instrumentation.java.concurrent.State; import java.nio.channels.Channel; @@ -80,12 +80,12 @@ public static void after(@Advice.This Object command) { public static final class Run { @Advice.OnMethodEnter(suppress = Throwable.class) - public static AgentScope before(@Advice.This Object command) { + public static ContextScope before(@Advice.This Object command) { return startTaskScope(InstrumentationContext.get(QUEUED_COMMAND, STATE), command); } @Advice.OnMethodExit(onThrowable = Throwable.class) - public static void after(@Advice.Enter AgentScope scope) { + public static void after(@Advice.Enter ContextScope scope) { endTaskScope(scope); } } diff --git a/dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/client/GrpcClientDecorator.java b/dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/client/GrpcClientDecorator.java index 94ca56566f9..bcf6a5461b5 100644 --- a/dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/client/GrpcClientDecorator.java +++ b/dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/client/GrpcClientDecorator.java @@ -107,7 +107,8 @@ public AgentSpan startCall(MethodDescriptor method) { RPC_SERVICE_CACHE.computeIfAbsent( method.getFullMethodName(), MethodDescriptor::extractFullServiceName)); span.setResourceName(method.getFullMethodName()); - return afterStart(span); + afterStart(span); + return span; } public void injectContext(Context context, final C request, CarrierSetter setter) { @@ -117,7 +118,7 @@ public void injectContext(Context context, final C request, CarrierSetter defaultPropagator().inject(context, request, setter); } - public AgentSpan onClose(final AgentSpan span, final Status status) { + public void onClose(final AgentSpan span, final Status status) { span.setTag("status.code", status.getCode().name()); span.setTag("grpc.status.code", status.getCode().name()); span.setTag(InstrumentationTags.GRPC_STATUS_CODE, status.getCode().value()); @@ -126,6 +127,5 @@ public AgentSpan onClose(final AgentSpan span, final Status status) { // TODO why is there a mismatch between client / server for calling the onError method? onError(span, status.getCause()); span.setError(CLIENT_ERROR_STATUSES.get(status.getCode().value())); - return span; } } diff --git a/dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/client/GrpcInjectAdapter.java b/dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/client/GrpcInjectAdapter.java index a969dcb8771..24a6c7df1aa 100644 --- a/dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/client/GrpcInjectAdapter.java +++ b/dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/client/GrpcInjectAdapter.java @@ -1,16 +1,24 @@ package datadog.trace.instrumentation.grpc.client; import datadog.context.propagation.CarrierSetter; +import datadog.trace.api.cache.DDCache; +import datadog.trace.api.cache.DDCaches; import io.grpc.Metadata; +import java.util.function.Function; import javax.annotation.ParametersAreNonnullByDefault; @ParametersAreNonnullByDefault public final class GrpcInjectAdapter implements CarrierSetter { + private static final Function> KEY_MAKER = + key -> Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER); + private static final DDCache> KEY_CACHE = + DDCaches.newFixedSizeCache(64); + public static final GrpcInjectAdapter SETTER = new GrpcInjectAdapter(); @Override public void set(final Metadata carrier, final String key, final String value) { - Metadata.Key metadataKey = Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER); + Metadata.Key metadataKey = KEY_CACHE.computeIfAbsent(key, KEY_MAKER); if (carrier.containsKey(metadataKey)) { carrier.removeAll( metadataKey); // Remove existing to ensure identical behavior with other carriers diff --git a/dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/client/MessagesAvailableInstrumentation.java b/dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/client/MessagesAvailableInstrumentation.java index a967b00c170..e72ef5d5431 100644 --- a/dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/client/MessagesAvailableInstrumentation.java +++ b/dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/client/MessagesAvailableInstrumentation.java @@ -67,8 +67,8 @@ public static AgentScope before() { @Advice.OnMethodExit(onThrowable = Throwable.class) public static void after(@Advice.Enter AgentScope scope) { if (null != scope) { - scope.span().finish(); scope.close(); + scope.span().finish(); } } } diff --git a/dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/server/GrpcExtractAdapter.java b/dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/server/GrpcExtractAdapter.java index 26477356e11..27a8804651c 100644 --- a/dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/server/GrpcExtractAdapter.java +++ b/dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/server/GrpcExtractAdapter.java @@ -1,9 +1,16 @@ package datadog.trace.instrumentation.grpc.server; +import datadog.trace.api.cache.DDCache; +import datadog.trace.api.cache.DDCaches; import datadog.trace.bootstrap.instrumentation.api.AgentPropagation; import io.grpc.Metadata; +import java.util.function.Function; public final class GrpcExtractAdapter implements AgentPropagation.ContextVisitor { + private static final Function> KEY_MAKER = + key -> Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER); + private static final DDCache> KEY_CACHE = + DDCaches.newFixedSizeCache(64); public static final GrpcExtractAdapter GETTER = new GrpcExtractAdapter(); @@ -11,8 +18,7 @@ public final class GrpcExtractAdapter implements AgentPropagation.ContextVisitor public void forEachKey(Metadata carrier, AgentPropagation.KeyClassifier classifier) { for (String key : carrier.keys()) { if (!key.endsWith(Metadata.BINARY_HEADER_SUFFIX)) { - if (!classifier.accept( - key, carrier.get(Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER)))) { + if (!classifier.accept(key, carrier.get(KEY_CACHE.computeIfAbsent(key, KEY_MAKER)))) { return; } } diff --git a/dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/server/GrpcServerDecorator.java b/dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/server/GrpcServerDecorator.java index 263a1feb3d0..249d003a5df 100644 --- a/dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/server/GrpcServerDecorator.java +++ b/dd-java-agent/instrumentation/grpc-1.5/src/main/java/datadog/trace/instrumentation/grpc/server/GrpcServerDecorator.java @@ -80,12 +80,12 @@ protected CharSequence component() { } @Override - public AgentSpan afterStart(final AgentSpan span) { + public void afterStart(final AgentSpan span) { span.setMeasured(true); - return super.afterStart(span); + super.afterStart(span); } - public AgentSpan onCall(final AgentSpan span, ServerCall call) { + public void onCall(final AgentSpan span, ServerCall call) { if (TRIM_RESOURCE_PACKAGE_NAME) { span.setResourceName( cachedResourceNames.computeIfAbsent( @@ -93,33 +93,31 @@ public AgentSpan onCall(final AgentSpan span, ServerCall> KEY_MAKER = + key -> Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER); + private static final DDCache> KEY_CACHE = + DDCaches.newFixedSizeCache(64); public static final TracingServerInterceptor INSTANCE = new TracingServerInterceptor(); private static final Set IGNORED_METHODS = Config.get().getGrpcIgnoredInboundMethods(); @@ -86,7 +92,7 @@ public ServerCall.Listener interceptCall( DECORATE.onCall(span, call); final ServerCall.Listener result; - try (AgentScope scope = activateSpan(span)) { + try (ContextScope scope = activateSpan(span)) { // Wrap the server call so that we can decorate the span // with the resulting status final TracingServerCall tracingServerCall = new TracingServerCall<>(span, call); @@ -118,7 +124,7 @@ static final class TracingServerCall @Override public void close(final Status status, final Metadata trailers) { DECORATE.onClose(span, status); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { delegate().close(status, trailers); } catch (final Throwable e) { DECORATE.onError(span, e); @@ -145,10 +151,10 @@ static final class TracingServerCallListener @Override public void onMessage(final ReqT message) { final AgentSpan msgSpan = - startSpan(COMPONENT_NAME.toString(), GRPC_MESSAGE, this.span.context()) + startSpan(COMPONENT_NAME.toString(), GRPC_MESSAGE, this.span.spanContext()) .setTag("message.type", message.getClass().getName()); DECORATE.afterStart(msgSpan); - try (AgentScope scope = activateSpan(msgSpan)) { + try (ContextScope scope = activateSpan(msgSpan)) { callIGCallbackGrpcMessage(msgSpan, message); delegate().onMessage(message); } catch (final Throwable e) { @@ -168,7 +174,7 @@ public void onMessage(final ReqT message) { @Override public void onHalfClose() { - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { delegate().onHalfClose(); } catch (final Throwable e) { if (span.phasedFinish()) { @@ -184,7 +190,7 @@ public void onHalfClose() { @Override public void onCancel() { // Finishes span. - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { delegate().onCancel(); span.setTag("canceled", true); } catch (CancellationException e) { @@ -205,7 +211,7 @@ public void onCancel() { @Override public void onComplete() { // Finishes span. - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { delegate().onComplete(); } catch (final Throwable e) { DECORATE.onError(span, e); @@ -225,7 +231,7 @@ public void onComplete() { @Override public void onReady() { - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { delegate().onReady(); } catch (final Throwable e) { if (span.phasedFinish()) { @@ -295,7 +301,7 @@ private static void callIGCallbackHeaders( } for (String key : metadata.keys()) { if (!key.endsWith(Metadata.BINARY_HEADER_SUFFIX)) { - Metadata.Key mdKey = Metadata.Key.of(key, Metadata.ASCII_STRING_MARSHALLER); + Metadata.Key mdKey = KEY_CACHE.computeIfAbsent(key, KEY_MAKER); for (String value : metadata.getAll(mdKey)) { headerCb.accept(reqCtx, key, value); } diff --git a/dd-java-agent/instrumentation/gson-1.6/gradle.lockfile b/dd-java-agent/instrumentation/gson-1.6/gradle.lockfile index 71abdb64500..b0bf682c3bd 100644 --- a/dd-java-agent/instrumentation/gson-1.6/gradle.lockfile +++ b/dd-java-agent/instrumentation/gson-1.6/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:gson-1.6:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -33,13 +34,16 @@ com.google.code.gson:gson:2.13.2=spotbugs com.google.code.gson:gson:2.14.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.errorprone:error_prone_annotations:2.48.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -50,12 +54,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -84,6 +88,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -101,14 +106,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/guava-10.0/build.gradle b/dd-java-agent/instrumentation/guava-10.0/build.gradle index db51a7e8832..3fb88e31638 100644 --- a/dd-java-agent/instrumentation/guava-10.0/build.gradle +++ b/dd-java-agent/instrumentation/guava-10.0/build.gradle @@ -25,6 +25,13 @@ dependencies { latestDepTestImplementation group: 'com.google.guava', name: 'guava', version: '+' } +// Baseline tests should exercise the first Guava version needed by the tests. +['testCompileClasspath', 'testRuntimeClasspath'].each { + configurations.named(it) { + resolutionStrategy.force 'com.google.guava:guava:16.0' + } +} + // Exclude helper class from test execution to avoid JUnit 5.14+ discovering it as test tasks.withType(Test).configureEach { filter { diff --git a/dd-java-agent/instrumentation/guava-10.0/gradle.lockfile b/dd-java-agent/instrumentation/guava-10.0/gradle.lockfile index 39ac1d65940..38953c49cbf 100644 --- a/dd-java-agent/instrumentation/guava-10.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/guava-10.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:guava-10.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -41,7 +42,7 @@ com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRun com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -55,12 +56,12 @@ io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeC io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations:1.28.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentelemetry:opentelemetry-api:1.28.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentelemetry:opentelemetry-context:1.28.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -107,14 +108,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/hazelcast/hazelcast-3.6/gradle.lockfile b/dd-java-agent/instrumentation/hazelcast/hazelcast-3.6/gradle.lockfile index 814da0f531d..5e98e4594b2 100644 --- a/dd-java-agent/instrumentation/hazelcast/hazelcast-3.6/gradle.lockfile +++ b/dd-java-agent/instrumentation/hazelcast/hazelcast-3.6/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:hazelcast:hazelcast-3.6:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.hazelcast:hazelcast-all:3.6=compileClasspath com.hazelcast:hazelcast-all:3.8=testCompileClasspath,testRuntimeClasspath com.hazelcast:hazelcast-all:3.8.9=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -50,12 +54,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -84,6 +88,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -101,14 +106,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/hazelcast/hazelcast-3.6/src/main/java/datadog/trace/instrumentation/hazelcast36/DistributedObjectDecorator.java b/dd-java-agent/instrumentation/hazelcast/hazelcast-3.6/src/main/java/datadog/trace/instrumentation/hazelcast36/DistributedObjectDecorator.java index 0f60adcc6c4..5deadde66c4 100644 --- a/dd-java-agent/instrumentation/hazelcast/hazelcast-3.6/src/main/java/datadog/trace/instrumentation/hazelcast36/DistributedObjectDecorator.java +++ b/dd-java-agent/instrumentation/hazelcast/hazelcast-3.6/src/main/java/datadog/trace/instrumentation/hazelcast36/DistributedObjectDecorator.java @@ -76,7 +76,7 @@ protected String service() { } /** Decorate trace based on service execution metadata. */ - public AgentSpan onServiceExecution( + public void onServiceExecution( final AgentSpan span, final DistributedObject object, final String methodName) { final String objectName = @@ -88,12 +88,5 @@ public AgentSpan onServiceExecution( span.setTag(HAZELCAST_SERVICE, object.getServiceName()); span.setTag(HAZELCAST_OPERATION, methodName); span.setTag(HAZELCAST_NAME, objectName); - - return span; - } - - /** Annotate the span with the results of the operation. */ - public AgentSpan onResult(final AgentSpan span, Object result) { - return span; } } diff --git a/dd-java-agent/instrumentation/hazelcast/hazelcast-3.6/src/main/java/datadog/trace/instrumentation/hazelcast36/DistributedObjectInstrumentation.java b/dd-java-agent/instrumentation/hazelcast/hazelcast-3.6/src/main/java/datadog/trace/instrumentation/hazelcast36/DistributedObjectInstrumentation.java index 4f4399b01d8..0e52c21873c 100644 --- a/dd-java-agent/instrumentation/hazelcast/hazelcast-3.6/src/main/java/datadog/trace/instrumentation/hazelcast36/DistributedObjectInstrumentation.java +++ b/dd-java-agent/instrumentation/hazelcast/hazelcast-3.6/src/main/java/datadog/trace/instrumentation/hazelcast36/DistributedObjectInstrumentation.java @@ -278,16 +278,18 @@ public static void methodExit( final AgentSpan span = scope.span(); try { if (throwable != null) { - // There was an synchronous error, + // There was a synchronous error, // which means we shouldn't wait for a callback to close the span. DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); - span.finish(); } else { future.andThen(new SpanFinishingExecutionCallback(span)); } } finally { scope.close(); + if (throwable != null) { + span.finish(); + } CallDepthThreadLocalMap.reset(DistributedObject.class); // reset call depth count } } diff --git a/dd-java-agent/instrumentation/hazelcast/hazelcast-3.6/src/main/java/datadog/trace/instrumentation/hazelcast36/SpanFinishingExecutionCallback.java b/dd-java-agent/instrumentation/hazelcast/hazelcast-3.6/src/main/java/datadog/trace/instrumentation/hazelcast36/SpanFinishingExecutionCallback.java index 41056751afd..337e044089d 100644 --- a/dd-java-agent/instrumentation/hazelcast/hazelcast-3.6/src/main/java/datadog/trace/instrumentation/hazelcast36/SpanFinishingExecutionCallback.java +++ b/dd-java-agent/instrumentation/hazelcast/hazelcast-3.6/src/main/java/datadog/trace/instrumentation/hazelcast36/SpanFinishingExecutionCallback.java @@ -17,7 +17,6 @@ public SpanFinishingExecutionCallback(final AgentSpan span) { @Override public void onResponse(V response) { DECORATE.beforeFinish(span); - DECORATE.onResult(span, response); span.finish(); } diff --git a/dd-java-agent/instrumentation/hazelcast/hazelcast-3.9/gradle.lockfile b/dd-java-agent/instrumentation/hazelcast/hazelcast-3.9/gradle.lockfile index b101cb09a88..f94b4a0e224 100644 --- a/dd-java-agent/instrumentation/hazelcast/hazelcast-3.9/gradle.lockfile +++ b/dd-java-agent/instrumentation/hazelcast/hazelcast-3.9/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:hazelcast:hazelcast-3.9:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.hazelcast:hazelcast-all:3.12.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.hazelcast:hazelcast-all:3.9=compileClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -49,12 +53,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -83,6 +87,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -100,14 +105,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/hazelcast/hazelcast-3.9/src/main/java/datadog/trace/instrumentation/hazelcast39/ClientInvocationDecorator.java b/dd-java-agent/instrumentation/hazelcast/hazelcast-3.9/src/main/java/datadog/trace/instrumentation/hazelcast39/ClientInvocationDecorator.java index 5cf340edebf..b038ccb22c2 100644 --- a/dd-java-agent/instrumentation/hazelcast/hazelcast-3.9/src/main/java/datadog/trace/instrumentation/hazelcast39/ClientInvocationDecorator.java +++ b/dd-java-agent/instrumentation/hazelcast/hazelcast-3.9/src/main/java/datadog/trace/instrumentation/hazelcast39/ClientInvocationDecorator.java @@ -43,7 +43,7 @@ protected String service() { } /** Decorate trace based on service execution metadata. */ - public AgentSpan onServiceExecution( + public void onServiceExecution( final AgentSpan span, final String operationName, final String objectName, @@ -62,17 +62,9 @@ public AgentSpan onServiceExecution( if (correlationId > 0) { span.setTag(HAZELCAST_CORRELATION_ID, correlationId); } - - return span; } - public AgentSpan onHazelcastInstance(final AgentSpan span, String instanceName) { + public void onHazelcastInstance(final AgentSpan span, String instanceName) { span.setTag(HAZELCAST_INSTANCE, instanceName); - return span; - } - - /** Annotate the span with the results of the operation. */ - public AgentSpan onResult(final AgentSpan span, Object result) { - return span; } } diff --git a/dd-java-agent/instrumentation/hazelcast/hazelcast-3.9/src/main/java/datadog/trace/instrumentation/hazelcast39/ClientInvocationInstrumentation.java b/dd-java-agent/instrumentation/hazelcast/hazelcast-3.9/src/main/java/datadog/trace/instrumentation/hazelcast39/ClientInvocationInstrumentation.java index a3783b1fbb2..09d98e0ba39 100644 --- a/dd-java-agent/instrumentation/hazelcast/hazelcast-3.9/src/main/java/datadog/trace/instrumentation/hazelcast39/ClientInvocationInstrumentation.java +++ b/dd-java-agent/instrumentation/hazelcast/hazelcast-3.9/src/main/java/datadog/trace/instrumentation/hazelcast39/ClientInvocationInstrumentation.java @@ -93,16 +93,18 @@ public static void methodExit( final AgentSpan span = scope.span(); try { if (throwable != null) { - // There was an synchronous error, + // There was a synchronous error, // which means we shouldn't wait for a callback to close the span. DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); - span.finish(); } else { future.andThen(new SpanFinishingExecutionCallback(span)); } } finally { scope.close(); + if (throwable != null) { + span.finish(); + } CallDepthThreadLocalMap.reset(ClientInvocation.class); // reset call depth count } } diff --git a/dd-java-agent/instrumentation/hazelcast/hazelcast-3.9/src/main/java/datadog/trace/instrumentation/hazelcast39/SpanFinishingExecutionCallback.java b/dd-java-agent/instrumentation/hazelcast/hazelcast-3.9/src/main/java/datadog/trace/instrumentation/hazelcast39/SpanFinishingExecutionCallback.java index 2880a47c91f..6d5547f9c38 100644 --- a/dd-java-agent/instrumentation/hazelcast/hazelcast-3.9/src/main/java/datadog/trace/instrumentation/hazelcast39/SpanFinishingExecutionCallback.java +++ b/dd-java-agent/instrumentation/hazelcast/hazelcast-3.9/src/main/java/datadog/trace/instrumentation/hazelcast39/SpanFinishingExecutionCallback.java @@ -17,7 +17,6 @@ public SpanFinishingExecutionCallback(final AgentSpan span) { @Override public void onResponse(V response) { DECORATE.beforeFinish(span); - DECORATE.onResult(span, response); span.finish(); } diff --git a/dd-java-agent/instrumentation/hazelcast/hazelcast-4.0/gradle.lockfile b/dd-java-agent/instrumentation/hazelcast/hazelcast-4.0/gradle.lockfile index b45df8b850a..cecd15148b2 100644 --- a/dd-java-agent/instrumentation/hazelcast/hazelcast-4.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/hazelcast/hazelcast-4.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:hazelcast:hazelcast-4.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.hazelcast:hazelcast-all:4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath com.hazelcast:hazelcast-all:5.0-BETA-1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -49,12 +53,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -83,6 +87,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -100,14 +105,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/hazelcast/hazelcast-4.0/src/main/java/datadog/trace/instrumentation/hazelcast4/ClientListenerInstrumentation.java b/dd-java-agent/instrumentation/hazelcast/hazelcast-4.0/src/main/java/datadog/trace/instrumentation/hazelcast4/ClientListenerInstrumentation.java index d2b9df11b19..902f4e43696 100644 --- a/dd-java-agent/instrumentation/hazelcast/hazelcast-4.0/src/main/java/datadog/trace/instrumentation/hazelcast4/ClientListenerInstrumentation.java +++ b/dd-java-agent/instrumentation/hazelcast/hazelcast-4.0/src/main/java/datadog/trace/instrumentation/hazelcast4/ClientListenerInstrumentation.java @@ -79,13 +79,9 @@ public static void methodExit( final AgentSpan span = scope.span(); try { if (throwable != null) { - // There was an synchronous error, - // which means we shouldn't wait for a callback to close the span. DECORATE.onError(span, throwable); - DECORATE.beforeFinish(span); - } else { - DECORATE.beforeFinish(span); } + DECORATE.beforeFinish(span); } finally { scope.close(); span.finish(); diff --git a/dd-java-agent/instrumentation/hazelcast/hazelcast-4.0/src/main/java/datadog/trace/instrumentation/hazelcast4/HazelcastDecorator.java b/dd-java-agent/instrumentation/hazelcast/hazelcast-4.0/src/main/java/datadog/trace/instrumentation/hazelcast4/HazelcastDecorator.java index 42448833c74..86dfab1731a 100644 --- a/dd-java-agent/instrumentation/hazelcast/hazelcast-4.0/src/main/java/datadog/trace/instrumentation/hazelcast4/HazelcastDecorator.java +++ b/dd-java-agent/instrumentation/hazelcast/hazelcast-4.0/src/main/java/datadog/trace/instrumentation/hazelcast4/HazelcastDecorator.java @@ -42,7 +42,7 @@ protected String service() { } /** Decorate trace based on service execution metadata. */ - public AgentSpan onServiceExecution( + public void onServiceExecution( final AgentSpan span, final String operationName, final Object objectName, @@ -62,7 +62,5 @@ public AgentSpan onServiceExecution( if (correlationId > 0) { span.setTag(HAZELCAST_CORRELATION_ID, correlationId); } - - return span; } } diff --git a/dd-java-agent/instrumentation/hazelcast/hazelcast-4.0/src/main/java/datadog/trace/instrumentation/hazelcast4/InvocationAdvice.java b/dd-java-agent/instrumentation/hazelcast/hazelcast-4.0/src/main/java/datadog/trace/instrumentation/hazelcast4/InvocationAdvice.java index facb9a4e8c4..3d1ae0d5381 100644 --- a/dd-java-agent/instrumentation/hazelcast/hazelcast-4.0/src/main/java/datadog/trace/instrumentation/hazelcast4/InvocationAdvice.java +++ b/dd-java-agent/instrumentation/hazelcast/hazelcast-4.0/src/main/java/datadog/trace/instrumentation/hazelcast4/InvocationAdvice.java @@ -62,16 +62,18 @@ public static void methodExit( final AgentSpan span = scope.span(); try { if (throwable != null) { - // There was an synchronous error, + // There was a synchronous error, // which means we shouldn't wait for a callback to close the span. DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); - span.finish(); } else { future.whenComplete(new SpanFinishingExecutionCallback(span)); } } finally { scope.close(); + if (throwable != null) { + span.finish(); + } CallDepthThreadLocalMap.reset(ClientInvocation.class); // reset call depth count } } diff --git a/dd-java-agent/instrumentation/hibernate/hibernate-common/gradle.lockfile b/dd-java-agent/instrumentation/hibernate/hibernate-common/gradle.lockfile index 5ca3972ba7b..1694f5723c3 100644 --- a/dd-java-agent/instrumentation/hibernate/hibernate-common/gradle.lockfile +++ b/dd-java-agent/instrumentation/hibernate/hibernate-common/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:hibernate:hibernate-common:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/hibernate/hibernate-common/src/main/java/datadog/trace/instrumentation/hibernate/SessionMethodUtils.java b/dd-java-agent/instrumentation/hibernate/hibernate-common/src/main/java/datadog/trace/instrumentation/hibernate/SessionMethodUtils.java index 2b95ae67ea9..ddcee1bcae5 100644 --- a/dd-java-agent/instrumentation/hibernate/hibernate-common/src/main/java/datadog/trace/instrumentation/hibernate/SessionMethodUtils.java +++ b/dd-java-agent/instrumentation/hibernate/hibernate-common/src/main/java/datadog/trace/instrumentation/hibernate/SessionMethodUtils.java @@ -42,7 +42,7 @@ public static SessionState startScopeFrom( final AgentScope scope; if (createSpan) { final AgentSpan span = - startSpan("java-hibernate", operationName, sessionState.getSessionSpan().context()); + startSpan("java-hibernate", operationName, sessionState.getSessionSpan().spanContext()); DECORATOR.afterStart(span); DECORATOR.onOperation(span, entity); scope = activateSpan(span); @@ -62,14 +62,15 @@ public static void closeScope( final Object entity, final boolean closeSpan) { - if (sessionState == null || sessionState.getMethodScope() == null) { + final AgentScope scope = sessionState == null ? null : sessionState.getMethodScope(); + if (scope == null) { // This method call was re-entrant. Do nothing, since it is being traced by the parent/first // call. return; } CallDepthThreadLocalMap.reset(SessionMethodUtils.class); - final AgentScope scope = sessionState.getMethodScope(); + sessionState.setMethodScope(null); final AgentSpan span = scope.span(); if (span != null && (sessionState.hasChildSpan() || closeSpan)) { DECORATOR.onError(span, throwable); @@ -77,11 +78,11 @@ public static void closeScope( DECORATOR.onOperation(span, entity); } DECORATOR.beforeFinish(span); + scope.close(); span.finish(); + } else { + scope.close(); } - - scope.close(); - sessionState.setMethodScope(null); } /** diff --git a/dd-java-agent/instrumentation/hibernate/hibernate-core-3.3/gradle.lockfile b/dd-java-agent/instrumentation/hibernate/hibernate-core-3.3/gradle.lockfile index c335741195b..fedd5f1db7a 100644 --- a/dd-java-agent/instrumentation/hibernate/hibernate-core-3.3/gradle.lockfile +++ b/dd-java-agent/instrumentation/hibernate/hibernate-core-3.3/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:hibernate:hibernate-core-3.3:dependencies --write-locks antlr:antlr:2.7.6=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -9,20 +10,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -32,12 +33,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.h2database:h2:1.4.197=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -53,7 +57,7 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath dom4j:dom4j:1.6.1=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javassist:javassist:3.12.1.GA=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.activation:activation:1.1.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -61,8 +65,8 @@ javax.transaction:jta:1.1=compileClasspath,latestDepTestCompileClasspath,latestD javax.xml.bind:jaxb-api:2.2.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -99,6 +103,7 @@ org.hibernate:hibernate-core:3.3.0.SP1=testCompileClasspath,testRuntimeClasspath org.hibernate:hibernate-core:3.6.10.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -116,14 +121,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/hibernate/hibernate-core-4.0/gradle.lockfile b/dd-java-agent/instrumentation/hibernate/hibernate-core-4.0/gradle.lockfile index e59750cd03f..9458dd1ca32 100644 --- a/dd-java-agent/instrumentation/hibernate/hibernate-core-4.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/hibernate/hibernate-core-4.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:hibernate:hibernate-core-4.0:dependencies --write-locks antlr:antlr:2.7.7=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -9,21 +10,21 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.fasterxml:classmate:0.5.4=compileClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -33,12 +34,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.h2database:h2:1.4.197=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -54,15 +58,15 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath dom4j:dom4j:1.6.1=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javassist:javassist:3.12.1.GA=compileClasspath,testCompileClasspath,testRuntimeClasspath javax.activation:activation:1.1.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.xml.bind:jaxb-api:2.2.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -102,6 +106,7 @@ org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:1.0.1.Final=late org.jboss:jandex:1.0.3.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -119,14 +124,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/hibernate/hibernate-core-4.3/gradle.lockfile b/dd-java-agent/instrumentation/hibernate/hibernate-core-4.3/gradle.lockfile index acdb6fd8349..25f263e8f00 100644 --- a/dd-java-agent/instrumentation/hibernate/hibernate-core-4.3/gradle.lockfile +++ b/dd-java-agent/instrumentation/hibernate/hibernate-core-4.3/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:hibernate:hibernate-core-4.3:dependencies --write-locks antlr:antlr:2.7.7=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath aopalliance:aopalliance:1.0=testCompileClasspath,testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -10,20 +11,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -33,12 +34,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -51,12 +55,12 @@ commons-logging:commons-logging:1.1.3=testCompileClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath dom4j:dom4j:1.6.1=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -97,6 +101,7 @@ org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.0.0.Final=comp org.jboss:jandex:1.1.0.Final=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -114,14 +119,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/hystrix-1.4/gradle.lockfile b/dd-java-agent/instrumentation/hystrix-1.4/gradle.lockfile index ef0aab45949..52c302f187c 100644 --- a/dd-java-agent/instrumentation/hystrix-1.4/gradle.lockfile +++ b/dd-java-agent/instrumentation/hystrix-1.4/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:hystrix-1.4:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.netflix.archaius:archaius-core:0.4.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.netflix.hystrix:hystrix-core:1.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath com.netflix.hystrix:hystrix-core:1.5.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -55,12 +59,12 @@ de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,la io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath io.reactivex:rxjava:1.0.7=compileClasspath,testCompileClasspath,testRuntimeClasspath io.reactivex:rxjava:1.3.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -90,6 +94,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.hdrhistogram:HdrHistogram:2.1.9=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -107,14 +112,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/ignite-2.0/gradle.lockfile b/dd-java-agent/instrumentation/ignite-2.0/gradle.lockfile index 9abf50170a0..23bf72158b7 100644 --- a/dd-java-agent/instrumentation/ignite-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/ignite-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:ignite-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=ignite216ForkedTestCompileClasspath,ignite216 com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,ignite216ForkedTestAnnotationProcessor,ignite216ForkedTestCompileClasspath,ignite216TestAnnotationProcessor,ignite216TestCompileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,ignit com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,ignite216ForkedTestAnnotationProcessor,ignite216TestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,ignite216ForkedTestAnnotationProcessor,ignite216TestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,ignite216ForkedTestAnnotationProcessor,ignite216TestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,ignite216ForkedTestAnnotationProcessor,ignite216TestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,ignite216ForkedTestAnnotationProcessor,ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestAnnotationProcessor,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,ignite216ForkedTestAnnotationProcessor,ignite216TestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.h2database:h2:1.4.195=testCompileClasspath,testRuntimeClasspath com.h2database:h2:1.4.197=ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.squareup.moshi:moshi:1.11.0=ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -52,13 +56,13 @@ commons-io:commons-io:2.11.0=ignite216ForkedTestCompileClasspath,ignite216Forked commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.cache:cache-api:1.0.0=compileClasspath,ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -106,6 +110,7 @@ org.jctools:jctools-core-jdk11:4.0.6=ignite216ForkedTestRuntimeClasspath,ignite2 org.jctools:jctools-core:4.0.6=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:13.0=compileClasspath,testCompileClasspath,testRuntimeClasspath org.jetbrains:annotations:16.0.3=ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -123,14 +128,14 @@ org.objenesis:objenesis:3.3=ignite216ForkedTestCompileClasspath,ignite216ForkedT org.opentest4j:opentest4j:1.3.0=ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=ignite216ForkedTestRuntimeClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=ignite216ForkedTestCompileClasspath,ignite216ForkedTestRuntimeClasspath,ignite216TestCompileClasspath,ignite216TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/ignite-2.0/src/main/java/datadog/trace/instrumentation/ignite/v2/cache/IgniteCacheAsyncInstrumentation.java b/dd-java-agent/instrumentation/ignite-2.0/src/main/java/datadog/trace/instrumentation/ignite/v2/cache/IgniteCacheAsyncInstrumentation.java index 7205216301c..9e61d594ae7 100644 --- a/dd-java-agent/instrumentation/ignite-2.0/src/main/java/datadog/trace/instrumentation/ignite/v2/cache/IgniteCacheAsyncInstrumentation.java +++ b/dd-java-agent/instrumentation/ignite-2.0/src/main/java/datadog/trace/instrumentation/ignite/v2/cache/IgniteCacheAsyncInstrumentation.java @@ -88,16 +88,14 @@ public static void stopSpan( if (scope == null) { return; } - // If we have a scope (i.e. we were the top-level Twilio SDK invocation), + // If we have a scope (i.e. we were the top-level Ignite SDK invocation), + final AgentSpan span = scope.span(); try { - final AgentSpan span = scope.span(); - if (throwable != null) { - // There was an synchronous error, + // There was a synchronous error, // which means we shouldn't wait for a callback to close the span. IgniteCacheDecorator.DECORATE.onError(span, throwable); IgniteCacheDecorator.DECORATE.beforeFinish(span); - span.finish(); } else { // We're calling an async operation, we still need to finish the span when it's // complete and report the results; set an appropriate callback @@ -105,7 +103,9 @@ public static void stopSpan( } } finally { scope.close(); - // span finished in SpanFinishingCallback + if (throwable != null) { + span.finish(); + } // else span finished in SpanFinishingCallback CallDepthThreadLocalMap.reset(IgniteCache.class); // reset call depth count } } @@ -143,16 +143,14 @@ public static void stopSpan( if (scope == null) { return; } - // If we have a scope (i.e. we were the top-level Twilio SDK invocation), + // If we have a scope (i.e. we were the top-level Ignite SDK invocation), + final AgentSpan span = scope.span(); try { - final AgentSpan span = scope.span(); - if (throwable != null) { - // There was an synchronous error, + // There was a synchronous error, // which means we shouldn't wait for a callback to close the span. IgniteCacheDecorator.DECORATE.onError(span, throwable); IgniteCacheDecorator.DECORATE.beforeFinish(span); - span.finish(); } else { // We're calling an async operation, we still need to finish the span when it's // complete and report the results; set an appropriate callback @@ -160,7 +158,9 @@ public static void stopSpan( } } finally { scope.close(); - // span finished in SpanFinishingCallback + if (throwable != null) { + span.finish(); + } // else span finished in SpanFinishingCallback CallDepthThreadLocalMap.reset(IgniteCache.class); // reset call depth count } } diff --git a/dd-java-agent/instrumentation/ignite-2.0/src/main/java/datadog/trace/instrumentation/ignite/v2/cache/IgniteCacheDecorator.java b/dd-java-agent/instrumentation/ignite-2.0/src/main/java/datadog/trace/instrumentation/ignite/v2/cache/IgniteCacheDecorator.java index ef372f24a06..7cd46a731e2 100644 --- a/dd-java-agent/instrumentation/ignite-2.0/src/main/java/datadog/trace/instrumentation/ignite/v2/cache/IgniteCacheDecorator.java +++ b/dd-java-agent/instrumentation/ignite-2.0/src/main/java/datadog/trace/instrumentation/ignite/v2/cache/IgniteCacheDecorator.java @@ -71,12 +71,11 @@ protected CharSequence dbHostname(IgniteCache igniteCache) { return null; } - public AgentSpan onOperation( - final AgentSpan span, final String cacheName, final String methodName) { - return onOperation(span, cacheName, methodName, null); + public void onOperation(final AgentSpan span, final String cacheName, final String methodName) { + onOperation(span, cacheName, methodName, null); } - public AgentSpan onQuery( + public void onQuery( final AgentSpan span, final String cacheName, final String methodName, final Query query) { if (methodName != null) { span.setTag("ignite.operation", "cache." + methodName); @@ -112,11 +111,9 @@ public AgentSpan onQuery( resourceName.append(cacheName); span.setResourceName(resourceName); } - - return span; } - public AgentSpan onOperation( + public void onOperation( final AgentSpan span, final String cacheName, final String methodName, Object key) { final StringBuilder resourceName = new StringBuilder("cache."); @@ -139,25 +136,17 @@ public AgentSpan onOperation( if (includeKeys && key != null) { span.setTag("ignite.cache.key", key.toString()); } - - return span; } - public AgentSpan onIgnite(final AgentSpan span, final Ignite ignite) { + public void onIgnite(final AgentSpan span, final Ignite ignite) { if (ignite == null) { - return span; + return; } if (ignite.name() != null) { span.setTag("ignite.instance", ignite.name()); } span.setTag("ignite.version", ignite.version().toString()); - - return span; - } - - public AgentSpan onResult(AgentSpan span, Object result) { - return span; } } diff --git a/dd-java-agent/instrumentation/ignite-2.0/src/main/java/datadog/trace/instrumentation/ignite/v2/cache/SpanFinishingCallback.java b/dd-java-agent/instrumentation/ignite-2.0/src/main/java/datadog/trace/instrumentation/ignite/v2/cache/SpanFinishingCallback.java index a25c2f658f7..a73fb066cc7 100644 --- a/dd-java-agent/instrumentation/ignite-2.0/src/main/java/datadog/trace/instrumentation/ignite/v2/cache/SpanFinishingCallback.java +++ b/dd-java-agent/instrumentation/ignite-2.0/src/main/java/datadog/trace/instrumentation/ignite/v2/cache/SpanFinishingCallback.java @@ -22,9 +22,8 @@ public void apply(IgniteFuture igniteFuture) { IgniteCacheDecorator.DECORATE.beforeFinish(span); try { - Object result = igniteFuture.get(); + igniteFuture.get(); // propagates failure to the catch block below IgniteCacheDecorator.DECORATE.beforeFinish(span); - IgniteCacheDecorator.DECORATE.onResult(span, result); } catch (Exception e) { IgniteCacheDecorator.DECORATE.onError(span, e); } finally { diff --git a/dd-java-agent/instrumentation/jackson-core/jackson-core-1.9.13/gradle.lockfile b/dd-java-agent/instrumentation/jackson-core/jackson-core-1.9.13/gradle.lockfile index 50e6f3372dd..36964f24b01 100644 --- a/dd-java-agent/instrumentation/jackson-core/jackson-core-1.9.13/gradle.lockfile +++ b/dd-java-agent/instrumentation/jackson-core/jackson-core-1.9.13/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jackson-core:jackson-core-1.9.13:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -83,6 +87,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -100,14 +105,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jackson-core/jackson-core-2.0/gradle.lockfile b/dd-java-agent/instrumentation/jackson-core/jackson-core-2.0/gradle.lockfile index 3c1ba9f85b3..beae9e90b29 100644 --- a/dd-java-agent/instrumentation/jackson-core/jackson-core-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/jackson-core/jackson-core-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jackson-core:jackson-core-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -19,15 +20,15 @@ com.fasterxml.jackson.core:jackson-core:2.5.5=latestDepTestCompileClasspath,late com.fasterxml.jackson.core:jackson-databind:2.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-databind:2.5.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -37,12 +38,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -53,12 +57,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,6 +91,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -104,14 +109,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jackson-core/jackson-core-2.12/gradle.lockfile b/dd-java-agent/instrumentation/jackson-core/jackson-core-2.12/gradle.lockfile index 831ff12b9fb..885cf7fb0a1 100644 --- a/dd-java-agent/instrumentation/jackson-core/jackson-core-2.12/gradle.lockfile +++ b/dd-java-agent/instrumentation/jackson-core/jackson-core-2.12/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jackson-core:jackson-core-2.12:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -21,15 +22,15 @@ com.fasterxml.jackson.core:jackson-databind:2.15.4=latestDepTestCompileClasspath com.fasterxml.jackson:jackson-bom:2.12.0=compileClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.15.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -39,12 +40,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -55,12 +59,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -89,6 +93,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -106,14 +111,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jackson-core/jackson-core-2.16/gradle.lockfile b/dd-java-agent/instrumentation/jackson-core/jackson-core-2.16/gradle.lockfile index 52de39f1f2a..28b44fdc2d2 100644 --- a/dd-java-agent/instrumentation/jackson-core/jackson-core-2.16/gradle.lockfile +++ b/dd-java-agent/instrumentation/jackson-core/jackson-core-2.16/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jackson-core:jackson-core-2.16:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,28 +9,28 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-annotations:2.16.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.21=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-annotations:2.22=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-core:2.16.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.21.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-core:2.22.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-databind:2.16.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.21.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-databind:2.22.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.16.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.21.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson:jackson-bom:2.22.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -39,12 +40,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -55,12 +59,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -89,6 +93,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -106,14 +111,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jackson-core/jackson-core-2.6/gradle.lockfile b/dd-java-agent/instrumentation/jackson-core/jackson-core-2.6/gradle.lockfile index 691251b9724..383a0aeb4ff 100644 --- a/dd-java-agent/instrumentation/jackson-core/jackson-core-2.6/gradle.lockfile +++ b/dd-java-agent/instrumentation/jackson-core/jackson-core-2.6/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jackson-core:jackson-core-2.6:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -19,15 +20,15 @@ com.fasterxml.jackson.core:jackson-core:2.7.9=latestDepTestCompileClasspath,late com.fasterxml.jackson.core:jackson-databind:2.6.0=compileClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-databind:2.7.9.7=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -37,12 +38,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -53,12 +57,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,6 +91,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -104,14 +109,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jackson-core/jackson-core-2.8/gradle.lockfile b/dd-java-agent/instrumentation/jackson-core/jackson-core-2.8/gradle.lockfile index 6ac18ca762a..b4b6185a75d 100644 --- a/dd-java-agent/instrumentation/jackson-core/jackson-core-2.8/gradle.lockfile +++ b/dd-java-agent/instrumentation/jackson-core/jackson-core-2.8/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jackson-core:jackson-core-2.8:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -19,15 +20,15 @@ com.fasterxml.jackson.core:jackson-core:2.8.0=compileClasspath,testCompileClassp com.fasterxml.jackson.core:jackson-databind:2.11.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-databind:2.8.0=compileClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -37,12 +38,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -53,12 +57,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,6 +91,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -104,14 +109,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jackson-core/jackson-core-common/build.gradle b/dd-java-agent/instrumentation/jackson-core/jackson-core-common/build.gradle index 0ac436fae5b..8dd00de25fa 100644 --- a/dd-java-agent/instrumentation/jackson-core/jackson-core-common/build.gradle +++ b/dd-java-agent/instrumentation/jackson-core/jackson-core-common/build.gradle @@ -3,6 +3,7 @@ muzzle { group = 'com.fasterxml.jackson.core' module = 'jackson-core' versions = "[2.0.0,)" + skipVersions = ['2.22.0'] // missing in Maven Central assertInverse = true } @@ -11,6 +12,7 @@ muzzle { group = 'com.fasterxml.jackson.core' module = 'jackson-databind' versions = "[2.0.0,)" + skipVersions = ['2.22.0'] // missing in Maven Central assertInverse = true } } diff --git a/dd-java-agent/instrumentation/jackson-core/jackson-core-common/gradle.lockfile b/dd-java-agent/instrumentation/jackson-core/jackson-core-common/gradle.lockfile index 667383ac3d7..55231f6f909 100644 --- a/dd-java-agent/instrumentation/jackson-core/jackson-core-common/gradle.lockfile +++ b/dd-java-agent/instrumentation/jackson-core/jackson-core-common/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jackson-core:jackson-core-common:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,28 +9,28 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-annotations:2.14.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.21=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-annotations:2.22=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-core:2.14.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.21.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-core:2.22.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-databind:2.14.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.21.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-databind:2.22.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.14.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.21.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson:jackson-bom:2.22.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -39,12 +40,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -55,12 +59,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -89,6 +93,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -106,14 +111,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jacoco-0.8.9/gradle.lockfile b/dd-java-agent/instrumentation/jacoco-0.8.9/gradle.lockfile index b67232409a1..93026412324 100644 --- a/dd-java-agent/instrumentation/jacoco-0.8.9/gradle.lockfile +++ b/dd-java-agent/instrumentation/jacoco-0.8.9/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jacoco-0.8.9:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -82,6 +86,7 @@ org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jacoco:org.jacoco.agent:0.8.9=compileClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -99,14 +104,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/build.gradle b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/build.gradle index ee85bef77fa..83caaeb1324 100644 --- a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/build.gradle +++ b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/build.gradle @@ -21,4 +21,3 @@ dependencies { // TODO: Tomcat 10.0.10 has a copy of the JSR166 ThreadPoolExecutor so it needs special instrumentation latestDepTestImplementation group: 'org.apache.tomcat.embed', name: 'tomcat-embed-core', version: '10.0.8' } - diff --git a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/gradle.lockfile b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/gradle.lockfile index e918d10d18f..094fdde7af3 100644 --- a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/gradle.lockfile +++ b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:java:java-concurrent:java-concurrent-1.8:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -48,12 +52,12 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath io.netty:netty-all:4.1.9.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -85,6 +89,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -102,14 +107,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/completablefuture/AsyncTaskInstrumentation.java b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/completablefuture/AsyncTaskInstrumentation.java index 3cfe3b47b84..a0d8211279f 100644 --- a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/completablefuture/AsyncTaskInstrumentation.java +++ b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/completablefuture/AsyncTaskInstrumentation.java @@ -6,9 +6,9 @@ import static datadog.trace.bootstrap.instrumentation.java.concurrent.AdviceUtils.startTaskScope; import static net.bytebuddy.matcher.ElementMatchers.isConstructor; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.java.concurrent.State; import java.util.concurrent.ForkJoinTask; import net.bytebuddy.asm.Advice; @@ -40,26 +40,26 @@ public void methodAdvice(MethodTransformer transformer) { } public static class Construct { - @Advice.OnMethodExit + @Advice.OnMethodExit(suppress = Throwable.class) public static void construct(@Advice.This ForkJoinTask task) { capture(InstrumentationContext.get(ForkJoinTask.class, State.class), task); } } public static class Run { - @Advice.OnMethodEnter - public static AgentScope before(@Advice.This ForkJoinTask zis) { + @Advice.OnMethodEnter(suppress = Throwable.class) + public static ContextScope before(@Advice.This ForkJoinTask zis) { return startTaskScope(InstrumentationContext.get(ForkJoinTask.class, State.class), zis); } - @Advice.OnMethodExit - public static void after(@Advice.Enter AgentScope scope) { + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + public static void after(@Advice.Enter ContextScope scope) { endTaskScope(scope); } } public static class Cancel { - @Advice.OnMethodExit + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void cancel(@Advice.This ForkJoinTask task) { State state = InstrumentationContext.get(ForkJoinTask.class, State.class).get(task); if (null != state) { diff --git a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/AsyncPropagatingDisableInstrumentation.java b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/AsyncPropagatingDisableInstrumentation.java index 1d543a705d2..2eadfb0cfe9 100644 --- a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/AsyncPropagatingDisableInstrumentation.java +++ b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/AsyncPropagatingDisableInstrumentation.java @@ -45,6 +45,25 @@ public AsyncPropagatingDisableInstrumentation() { nameEndsWith("io.grpc.internal.ManagedChannelImpl"); private static final ElementMatcher REACTOR_DISABLED_TYPE_INITIALIZERS = namedOneOf("reactor.core.scheduler.SchedulerTask", "reactor.core.scheduler.WorkerTask"); + private static final ElementMatcher RXJAVA2_DISABLED_TYPE_INITIALIZERS = + named("io.reactivex.internal.schedulers.AbstractDirectTask"); + + /** + * RxJava 3's AbstractDirectTask creates FINISHED/DISPOSED sentinel FutureTask instances in its + * static initializer. + */ + private static final ElementMatcher RXJAVA3_DISABLED_TYPE_INITIALIZERS = + named("io.reactivex.rxjava3.internal.schedulers.AbstractDirectTask"); + + private static final ElementMatcher NETTY_GLOBAL_EVENT_EXECUTOR = + namedOneOf( + "io.netty.util.concurrent.GlobalEventExecutor", + // shaded version + "io.grpc.netty.shaded.io.netty.util.concurrent.GlobalEventExecutor"); + private static final ElementMatcher JAVA_HTTP_CLIENT = + extendsClass(named("java.net.http.HttpClient")); + private static final String LETTUCE_HANDSHAKE_HANDLER = + "io.lettuce.core.protocol.RedisHandshakeHandler"; @Override public boolean onlyMatchKnownTypes() { @@ -77,7 +96,15 @@ public String[] knownMatchingTypes() { "net.sf.ehcache.store.disk.DiskStorageFactory", "org.springframework.jms.listener.DefaultMessageListenerContainer", "org.apache.activemq.broker.TransactionBroker", - "com.mongodb.internal.connection.DefaultConnectionPool$AsyncWorkManager" + "com.mongodb.internal.connection.DefaultConnectionPool$AsyncWorkManager", + "io.reactivex.internal.schedulers.AbstractDirectTask", + "io.reactivex.rxjava3.internal.schedulers.AbstractDirectTask", + "jdk.internal.net.http.HttpClientImpl", + LETTUCE_HANDSHAKE_HANDLER, + "io.netty.util.concurrent.GlobalEventExecutor", + "io.grpc.netty.shaded.io.netty.util.concurrent.GlobalEventExecutor", + "com.linecorp.armeria.client.HttpClientFactory", + "com.linecorp.armeria.client.HttpChannelPool" }; } @@ -88,7 +115,12 @@ public String hierarchyMarkerType() { @Override public ElementMatcher hierarchyMatcher() { - return RX_WORKERS.or(GRPC_MANAGED_CHANNEL).or(REACTOR_DISABLED_TYPE_INITIALIZERS); + return RX_WORKERS + .or(GRPC_MANAGED_CHANNEL) + .or(REACTOR_DISABLED_TYPE_INITIALIZERS) + .or(RXJAVA2_DISABLED_TYPE_INITIALIZERS) + .or(RXJAVA3_DISABLED_TYPE_INITIALIZERS) + .or(JAVA_HTTP_CLIENT); } @Override @@ -172,11 +204,28 @@ public void methodAdvice(MethodTransformer transformer) { advice); transformer.applyAdvice( isTypeInitializer().and(isDeclaredBy(REACTOR_DISABLED_TYPE_INITIALIZERS)), advice); + transformer.applyAdvice( + isTypeInitializer().and(isDeclaredBy(RXJAVA2_DISABLED_TYPE_INITIALIZERS)), advice); + transformer.applyAdvice( + isTypeInitializer().and(isDeclaredBy(RXJAVA3_DISABLED_TYPE_INITIALIZERS)), advice); + transformer.applyAdvice( + isTypeInitializer().and(isDeclaredBy(NETTY_GLOBAL_EVENT_EXECUTOR)), advice); + transformer.applyAdvice(namedOneOf("sendAsync").and(isDeclaredBy(JAVA_HTTP_CLIENT)), advice); + transformer.applyAdvice( + named("channelRegistered").and(isDeclaredBy(named(LETTUCE_HANDSHAKE_HANDLER))), advice); + // armeria runs its own codec/pipeline, so the active request span captured during connection + // pool creation and channel connect will have no consumers. + transformer.applyAdvice( + named("pool").and(isDeclaredBy(named("com.linecorp.armeria.client.HttpClientFactory"))), + advice); + transformer.applyAdvice( + named("connect").and(isDeclaredBy(named("com.linecorp.armeria.client.HttpChannelPool"))), + advice); } public static class DisableAsyncAdvice { - @Advice.OnMethodEnter + @Advice.OnMethodEnter(suppress = Throwable.class) public static boolean before() { if (isAsyncPropagationEnabled()) { setAsyncPropagationEnabled(false); @@ -185,7 +234,7 @@ public static boolean before() { return false; } - @Advice.OnMethodExit(onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void after(@Advice.Enter boolean wasDisabled) { if (wasDisabled) { setAsyncPropagationEnabled(true); diff --git a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/WrapRunnableAsNewTaskInstrumentation.java b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/WrapRunnableAsNewTaskInstrumentation.java index 41303a9f006..45909ebc3d8 100644 --- a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/WrapRunnableAsNewTaskInstrumentation.java +++ b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/WrapRunnableAsNewTaskInstrumentation.java @@ -76,7 +76,7 @@ public void methodAdvice(MethodTransformer transformer) { */ @SuppressWarnings("rawtypes") public static final class NewTaskFor { - @Advice.OnMethodEnter + @Advice.OnMethodEnter(suppress = Throwable.class) public static boolean execute( @Advice.This Executor executor, @Advice.Argument(value = 0, readOnly = false) Runnable task) { @@ -91,7 +91,7 @@ public static boolean execute( return true; } - @Advice.OnMethodExit(onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void cancel( @Advice.Enter boolean wrapped, @Advice.Argument(0) Runnable task, @@ -115,12 +115,12 @@ public static void cancel( /** More general wrapper that uses {@link Wrapper} instead of calling 'newTaskFor'. */ @SuppressWarnings("rawtypes") public static final class Wrap { - @Advice.OnMethodEnter + @Advice.OnMethodEnter(suppress = Throwable.class) public static void execute(@Advice.Argument(value = 0, readOnly = false) Runnable task) { task = Wrapper.wrap(task); } - @Advice.OnMethodExit(onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void cancel(@Advice.Argument(0) Runnable task, @Advice.Thrown Throwable error) { if (null != error && task instanceof Wrapper) { ((Wrapper) task).cancel(); diff --git a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/executor/RejectedExecutionHandlerInstrumentation.java b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/executor/RejectedExecutionHandlerInstrumentation.java index ad3ce00ac6c..e8b7b9effd3 100644 --- a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/executor/RejectedExecutionHandlerInstrumentation.java +++ b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/executor/RejectedExecutionHandlerInstrumentation.java @@ -87,7 +87,7 @@ public static Wrapper handle( // must execute after in case the handler actually runs the runnable, // which is preferable to cancelling the continuation - @Advice.OnMethodExit(onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void reject( @Advice.Enter Wrapper wrapper, @Advice.Argument(value = 0) Runnable runnable) { // not handling rejected work (which will often not manifest in an exception being thrown) diff --git a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/executor/ThreadPoolExecutorInstrumentation.java b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/executor/ThreadPoolExecutorInstrumentation.java index 6fea0ee14ec..d98a8bee1ac 100644 --- a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/executor/ThreadPoolExecutorInstrumentation.java +++ b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/executor/ThreadPoolExecutorInstrumentation.java @@ -14,10 +14,10 @@ import static net.bytebuddy.matcher.ElementMatchers.returns; import static net.bytebuddy.matcher.ElementMatchers.takesArgument; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.api.Platform; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.java.concurrent.QueueTimerHelper; import datadog.trace.bootstrap.instrumentation.java.concurrent.State; import datadog.trace.bootstrap.instrumentation.java.concurrent.TPEHelper; @@ -34,23 +34,23 @@ * The old way of doing this is to wrap the Runnable when it is added to the queue, which is scary * by itself, since the queue can contain any type of object that implements Runnable, and the queue * implementation can try to cast it to something that our wrapper doesn't implement. To avoid this - * we use the existing State field context store in the Runnable and hand off the AgentScope from + * we use the existing State field context store in the Runnable and hand off the ContextScope from * beforeExecute to afterExecute via a ThreadLocal. * *

    Here is a simple flow chart for the non wrapping version with + signifying added code: * *

    {@code
      * beforeExecute -> enter
    - *                  + start AgentScope if available and pass it to exit
    + *                  + start ContextScope if available and pass it to exit
      *                  normal method body
      *                  exit
    - *               <- + store AgentScope in ThreadLocal if available
    + *               <- + store ContextScope in ThreadLocal if available
      * normal execution of the Runnable
      * afterExecute  -> enter
    - *                  + clear and pass ThreadLocal AgentScope if available to exit
    + *                  + clear and pass ThreadLocal ContextScope if available to exit
      *                  normal method body
      *                  exit
    - *               <- + close AgentScope if available
    + *               <- + close ContextScope if available
      * }
    */ public final class ThreadPoolExecutorInstrumentation @@ -154,7 +154,7 @@ public static void capture( public static final class BeforeExecute { @Advice.OnMethodEnter(suppress = Throwable.class) - public static AgentScope beforeExecuteEnter( + public static ContextScope beforeExecuteEnter( @Advice.This final ThreadPoolExecutor zis, @Advice.Argument(readOnly = false, value = 1) Runnable task) { if (TPEHelper.shouldPropagate( @@ -171,7 +171,7 @@ public static AgentScope beforeExecuteEnter( @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void beforeExecuteExit( - @Advice.Enter final AgentScope scope, @Advice.Argument(value = 1) Runnable task) { + @Advice.Enter final ContextScope scope, @Advice.Argument(value = 1) Runnable task) { if (scope != null) { TPEHelper.setThreadLocalScope(scope, task); } @@ -180,7 +180,7 @@ public static void beforeExecuteExit( public static final class AfterExecute { @Advice.OnMethodEnter(suppress = Throwable.class) - public static AgentScope afterExecuteEnter( + public static ContextScope afterExecuteEnter( @Advice.This final ThreadPoolExecutor zis, @Advice.Argument(readOnly = false, value = 0) Runnable task) { if (TPEHelper.shouldPropagate( @@ -196,7 +196,7 @@ public static AgentScope afterExecuteEnter( @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void afterExecuteExit( - @Advice.Enter final AgentScope scope, @Advice.Argument(value = 0) Runnable task) { + @Advice.Enter final ContextScope scope, @Advice.Argument(value = 0) Runnable task) { if (scope != null) { TPEHelper.endScope(scope, task); } diff --git a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/forkjoin/JavaForkJoinPoolInstrumentation.java b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/forkjoin/JavaForkJoinPoolInstrumentation.java index 369db565612..65bbbafb5f9 100644 --- a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/forkjoin/JavaForkJoinPoolInstrumentation.java +++ b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/forkjoin/JavaForkJoinPoolInstrumentation.java @@ -34,7 +34,7 @@ public void methodAdvice(MethodTransformer transformer) { public static final class ExternalPush { @SuppressWarnings("rawtypes") - @Advice.OnMethodEnter + @Advice.OnMethodEnter(suppress = Throwable.class) public static void externalPush(@Advice.Argument(0) ForkJoinTask task) { if (!exclude(FORK_JOIN_TASK, task)) { ContextStore contextStore = @@ -43,7 +43,7 @@ public static void externalPush(@Advice.Argument(0) ForkJoinTask task) { } } - @Advice.OnMethodExit(onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void cleanup( @Advice.Argument(0) ForkJoinTask task, @Advice.Thrown Throwable thrown) { if (null != thrown && !exclude(FORK_JOIN_TASK, task)) { @@ -53,7 +53,7 @@ public static void cleanup( } public static final class PoolSubmit { - @Advice.OnMethodEnter + @Advice.OnMethodEnter(suppress = Throwable.class) public static void poolSubmit(@Advice.Argument(1) ForkJoinTask task) { if (!exclude(FORK_JOIN_TASK, task)) { ContextStore contextStore = @@ -62,7 +62,7 @@ public static void poolSubmit(@Advice.Argument(1) ForkJoinTask task) { } } - @Advice.OnMethodExit(onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void cleanup( @Advice.Argument(1) ForkJoinTask task, @Advice.Thrown Throwable thrown) { if (null != thrown && !exclude(FORK_JOIN_TASK, task)) { diff --git a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/forkjoin/JavaForkJoinTaskInstrumentation.java b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/forkjoin/JavaForkJoinTaskInstrumentation.java index 045431b4d4a..ade7366c32a 100644 --- a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/forkjoin/JavaForkJoinTaskInstrumentation.java +++ b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/forkjoin/JavaForkJoinTaskInstrumentation.java @@ -12,9 +12,9 @@ import static datadog.trace.bootstrap.instrumentation.java.concurrent.ExcludeFilter.exclude; import static net.bytebuddy.matcher.ElementMatchers.isMethod; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.java.concurrent.State; import java.util.concurrent.ForkJoinTask; import net.bytebuddy.asm.Advice; @@ -53,21 +53,21 @@ public void methodAdvice(MethodTransformer transformer) { } public static final class Exec { - @Advice.OnMethodEnter - public static AgentScope before(@Advice.This ForkJoinTask task) { + @Advice.OnMethodEnter(suppress = Throwable.class) + public static ContextScope before(@Advice.This ForkJoinTask task) { return exclude(FORK_JOIN_TASK, task) ? null : startTaskScope(InstrumentationContext.get(ForkJoinTask.class, State.class), task); } - @Advice.OnMethodExit(onThrowable = Throwable.class) - public static void after(@Advice.Enter AgentScope scope) { + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + public static void after(@Advice.Enter ContextScope scope) { endTaskScope(scope); } } public static final class Fork { - @Advice.OnMethodEnter + @Advice.OnMethodEnter(suppress = Throwable.class) public static void fork(@Advice.This ForkJoinTask task) { if (!exclude(FORK_JOIN_TASK, task)) { capture(InstrumentationContext.get(ForkJoinTask.class, State.class), task); @@ -76,7 +76,7 @@ public static void fork(@Advice.This ForkJoinTask task) { } public static final class Cancel { - @Advice.OnMethodExit(onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void cancel(@Advice.This ForkJoinTask task) { State state = InstrumentationContext.get(ForkJoinTask.class, State.class).get(task); if (null != state) { diff --git a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/runnable/ConsumerTaskInstrumentation.java b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/runnable/ConsumerTaskInstrumentation.java index 9f81f679153..f5df4d8923e 100644 --- a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/runnable/ConsumerTaskInstrumentation.java +++ b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/runnable/ConsumerTaskInstrumentation.java @@ -9,10 +9,10 @@ import static net.bytebuddy.matcher.ElementMatchers.isConstructor; import com.google.auto.service.AutoService; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.java.concurrent.State; import java.util.Map; @@ -49,7 +49,7 @@ public void methodAdvice(MethodTransformer transformer) { } public static class Construct { - @Advice.OnMethodExit + @Advice.OnMethodExit(suppress = Throwable.class) public static void construct(@Advice.This ForkJoinTask task) { AgentSpan span = activeSpan(); if (null != span) { @@ -61,13 +61,13 @@ public static void construct(@Advice.This ForkJoinTask task) { } public static final class Run { - @Advice.OnMethodEnter - public static AgentScope before(@Advice.This ForkJoinTask task) { + @Advice.OnMethodEnter(suppress = Throwable.class) + public static ContextScope before(@Advice.This ForkJoinTask task) { return startTaskScope(InstrumentationContext.get(ForkJoinTask.class, State.class), task); } - @Advice.OnMethodExit(onThrowable = Throwable.class) - public static void after(@Advice.Enter AgentScope scope) { + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + public static void after(@Advice.Enter ContextScope scope) { endTaskScope(scope); } } diff --git a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/runnable/RunnableFutureInstrumentation.java b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/runnable/RunnableFutureInstrumentation.java index a783258c421..4b560dc541f 100644 --- a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/runnable/RunnableFutureInstrumentation.java +++ b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/runnable/RunnableFutureInstrumentation.java @@ -19,11 +19,11 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArgument; import com.google.auto.service.AutoService; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.ExcludeFilterProvider; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.java.concurrent.ExcludeFilter; import datadog.trace.bootstrap.instrumentation.java.concurrent.State; import java.util.Arrays; @@ -138,26 +138,26 @@ public void methodAdvice(MethodTransformer transformer) { public static final class Construct { - @Advice.OnMethodExit + @Advice.OnMethodExit(suppress = Throwable.class) public static void captureScope(@Advice.This RunnableFuture task) { capture(InstrumentationContext.get(RunnableFuture.class, State.class), task); } } public static final class Run { - @Advice.OnMethodEnter - public static AgentScope activate(@Advice.This RunnableFuture task) { + @Advice.OnMethodEnter(suppress = Throwable.class) + public static ContextScope activate(@Advice.This RunnableFuture task) { return startTaskScope(InstrumentationContext.get(RunnableFuture.class, State.class), task); } - @Advice.OnMethodExit(onThrowable = Throwable.class) - public static void close(@Advice.Enter AgentScope scope) { + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + public static void close(@Advice.Enter ContextScope scope) { endTaskScope(scope); } } public static final class Cancel { - @Advice.OnMethodEnter + @Advice.OnMethodEnter(suppress = Throwable.class) public static void cancel(@Advice.This RunnableFuture task) { cancelTask(InstrumentationContext.get(RunnableFuture.class, State.class), task); } diff --git a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/runnable/RunnableInstrumentation.java b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/runnable/RunnableInstrumentation.java index 567ff2ec90f..32dcff9f561 100644 --- a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/runnable/RunnableInstrumentation.java +++ b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/runnable/RunnableInstrumentation.java @@ -12,11 +12,11 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArguments; import com.google.auto.service.AutoService; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.bootstrap.ContextStore; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.java.concurrent.AdviceUtils; import datadog.trace.bootstrap.instrumentation.java.concurrent.State; import java.util.Map; @@ -63,14 +63,14 @@ public void methodAdvice(MethodTransformer transformer) { public static class RunnableAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) - public static AgentScope enter(@Advice.This final Runnable thiz) { + public static ContextScope enter(@Advice.This final Runnable thiz) { final ContextStore contextStore = InstrumentationContext.get(Runnable.class, State.class); return AdviceUtils.startTaskScope(contextStore, thiz); } @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) - public static void exit(@Advice.Enter final AgentScope scope) { + public static void exit(@Advice.Enter final ContextScope scope) { AdviceUtils.endTaskScope(scope); } } diff --git a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/timer/JavaTimerInstrumentation.java b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/timer/JavaTimerInstrumentation.java index 4ff5fdc489e..07e3cc934e7 100644 --- a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/timer/JavaTimerInstrumentation.java +++ b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/datadog/trace/instrumentation/java/concurrent/timer/JavaTimerInstrumentation.java @@ -52,7 +52,7 @@ public static void before(@Advice.Argument(0) TimerTask task, @Advice.Argument(2 } } - @Advice.OnMethodExit(onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void after(@Advice.Argument(0) TimerTask task, @Advice.Thrown Throwable thrown) { if (null != thrown && !exclude(RUNNABLE, task)) { cancelTask(InstrumentationContext.get(Runnable.class, State.class), task); diff --git a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/java/util/concurrent/CompletableFutureAdvice.java b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/java/util/concurrent/CompletableFutureAdvice.java index 9f16130796f..cc1e0deecb5 100644 --- a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/java/util/concurrent/CompletableFutureAdvice.java +++ b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/main/java/java/util/concurrent/CompletableFutureAdvice.java @@ -3,9 +3,9 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; import static java.util.concurrent.CompletableFuture.ASYNC; +import datadog.context.ContextScope; import datadog.trace.bootstrap.ContextStore; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.java.concurrent.ConcurrentState; import java.util.concurrent.CompletableFuture.UniCompletion; @@ -32,7 +32,7 @@ private static void muzzleCheck(final UniCompletion callback) { public static final class UniSubTryFire { @Advice.OnMethodEnter(suppress = Throwable.class) - public static AgentScope enter( + public static ContextScope enter( @Advice.This UniCompletion zis, @Advice.Local("hadExecutor") boolean hadExecutor, @Advice.Local("wasClaimed") boolean wasClaimed, @@ -51,7 +51,7 @@ public static AgentScope enter( @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void exit( - @Advice.Enter AgentScope scope, + @Advice.Enter ContextScope scope, @Advice.Thrown final Throwable throwable, @Advice.This UniCompletion zis, @Advice.Argument(0) int mode, diff --git a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/test/groovy/executor/NettyExecutorInstrumentationTest.groovy b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/test/groovy/executor/NettyExecutorInstrumentationTest.groovy index fc944416d94..0fd96e40d29 100644 --- a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/test/groovy/executor/NettyExecutorInstrumentationTest.groovy +++ b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/test/groovy/executor/NettyExecutorInstrumentationTest.groovy @@ -1,5 +1,8 @@ package executor +import static org.junit.jupiter.api.Assumptions.assumeTrue + +import datadog.environment.OperatingSystem import datadog.trace.agent.test.InstrumentationSpecification import datadog.trace.api.Trace import datadog.trace.core.DDSpan @@ -8,21 +11,23 @@ import io.netty.channel.epoll.EpollEventLoopGroup import io.netty.channel.local.LocalEventLoopGroup import io.netty.channel.nio.NioEventLoopGroup import io.netty.util.concurrent.DefaultEventExecutorGroup -import runnable.JavaAsyncChild -import spock.lang.Shared - import java.lang.reflect.InvocationTargetException import java.util.concurrent.Callable import java.util.concurrent.Future import java.util.concurrent.RejectedExecutionException import java.util.concurrent.TimeUnit +import runnable.JavaAsyncChild +import spock.lang.IgnoreIf +import spock.lang.Shared -import static org.junit.jupiter.api.Assumptions.assumeTrue - +// TODO: netty-all 4.1.9 only ships linux-x86_64 epoll native libraries. +@IgnoreIf({ + OperatingSystem.isLinux() && OperatingSystem.architecture().isArm64() +}) class NettyExecutorInstrumentationTest extends InstrumentationSpecification { @Shared - boolean isLinux = System.getProperty("os.name").toLowerCase().contains("linux") + boolean isLinux = OperatingSystem.isLinux() @Shared EpollEventLoopGroup epollEventLoopGroup = isLinux ? new EpollEventLoopGroup(4) : null diff --git a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/test/java/executor/recursive/RecursiveThreadPoolExecution.java b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/test/java/executor/recursive/RecursiveThreadPoolExecution.java index ce572c0c698..a471986f41b 100644 --- a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/test/java/executor/recursive/RecursiveThreadPoolExecution.java +++ b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/test/java/executor/recursive/RecursiveThreadPoolExecution.java @@ -3,7 +3,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.util.concurrent.ExecutorService; @@ -26,7 +26,7 @@ public void run() { return; } AgentSpan span = startSpan("test", String.valueOf(depth)); - try (AgentScope scope = activateSpan(span)) { + try (ContextScope scope = activateSpan(span)) { executor.execute(new RecursiveThreadPoolExecution(executor, maxDepth, depth + 1)); } finally { span.finish(); diff --git a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/test/java/executor/recursive/RecursiveThreadPoolMixedSubmissionAndExecution.java b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/test/java/executor/recursive/RecursiveThreadPoolMixedSubmissionAndExecution.java index ca882efd884..5887fd8a3a2 100644 --- a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/test/java/executor/recursive/RecursiveThreadPoolMixedSubmissionAndExecution.java +++ b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/test/java/executor/recursive/RecursiveThreadPoolMixedSubmissionAndExecution.java @@ -3,7 +3,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.util.concurrent.ExecutorService; @@ -27,7 +27,7 @@ public void run() { return; } AgentSpan span = startSpan("test", String.valueOf(depth)); - try (AgentScope scope = activateSpan(span)) { + try (ContextScope scope = activateSpan(span)) { if (depth % 2 == 0) { executor.submit( new RecursiveThreadPoolMixedSubmissionAndExecution(executor, maxDepth, depth + 1)); diff --git a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/test/java/executor/recursive/RecursiveThreadPoolSubmission.java b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/test/java/executor/recursive/RecursiveThreadPoolSubmission.java index 331062a90ca..d5e4ba967a5 100644 --- a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/test/java/executor/recursive/RecursiveThreadPoolSubmission.java +++ b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/test/java/executor/recursive/RecursiveThreadPoolSubmission.java @@ -3,7 +3,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.util.concurrent.ExecutorService; @@ -26,7 +26,7 @@ public void run() { return; } AgentSpan span = startSpan("test", String.valueOf(depth)); - try (AgentScope scope = activateSpan(span)) { + try (ContextScope scope = activateSpan(span)) { executor.submit(new RecursiveThreadPoolSubmission(executor, maxDepth, depth + 1)); } finally { span.finish(); diff --git a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/test/java/forkjoin/LinearTask.java b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/test/java/forkjoin/LinearTask.java index 35a3891bc87..5482fd97bde 100644 --- a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/test/java/forkjoin/LinearTask.java +++ b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/test/java/forkjoin/LinearTask.java @@ -3,7 +3,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.util.concurrent.RecursiveTask; @@ -34,7 +34,7 @@ protected Integer compute() { } else { int next = parent + 1; AgentSpan span = startSpan("test", Integer.toString(next)); - try (AgentScope scope = activateSpan(span)) { + try (ContextScope scope = activateSpan(span)) { LinearTask child = new LinearTask(next, depth); return child.fork().join(); } finally { diff --git a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/test/java/runnable/Descendant.java b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/test/java/runnable/Descendant.java index 3cf7c6e93f2..9df56e98cff 100644 --- a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/test/java/runnable/Descendant.java +++ b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-1.8/src/test/java/runnable/Descendant.java @@ -3,7 +3,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; public final class Descendant implements Runnable { @@ -17,7 +17,7 @@ public Descendant(String parent) { @Override public void run() { AgentSpan span = startSpan("test", parent + "-child"); - try (AgentScope scope = activateSpan(span)) { + try (ContextScope scope = activateSpan(span)) { } finally { span.finish(); diff --git a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-21.0/build.gradle b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-21.0/build.gradle index d2d9001f4b1..d95e9432796 100644 --- a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-21.0/build.gradle +++ b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-21.0/build.gradle @@ -8,9 +8,6 @@ apply from: "$rootDir/gradle/slf4j-simple.gradle" testJvmConstraints { minJavaVersion = JavaVersion.VERSION_21 - // Structured concurrency is a preview feature in Java 21. Methods (e.g. ShutdownOnFailure) used in this instrumentation test are no longer available in Java 25, so we set the max version to 24. - // See: https://download.java.net/java/early_access/loom/docs/api/java.base/java/util/concurrent/StructuredTaskScope.html - maxJavaVersion = JavaVersion.VERSION_24 } muzzle { @@ -30,6 +27,14 @@ idea { */ addTestSuite('previewTest') +tasks.named("previewTest").configure { + testJvmConstraints { + // Structured concurrency is a preview feature in Java 21. Methods (e.g. ShutdownOnFailure) used in this instrumentation test are no longer available in Java 25, so we set the max version to 24. + // See: https://download.java.net/java/early_access/loom/docs/api/java.base/java/util/concurrent/StructuredTaskScope.html + maxJavaVersion = JavaVersion.VERSION_24 + } +} + // Set all compile tasks to use JDK21 but let instrumentation code targets 1.8 compatibility tasks.withType(AbstractCompile).configureEach { configureCompiler(it, 21, JavaVersion.VERSION_1_8) diff --git a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-21.0/gradle.lockfile b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-21.0/gradle.lockfile index 46234ba4467..f760b03f42d 100644 --- a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-21.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-21.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:java:java-concurrent:java-concurrent-21.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=previewTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=previewTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=previewTestCompileClasspath,testCompileClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=previewTestCompileClasspath,testCompileClassp com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,previewTestCompileClasspath,previewTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=previewTestCompileClasspath,previewTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=previewTestCompileClasspath,previewTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,previewTestCompileClasspath,previewTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,previewTestCompileClasspath,previewTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,previewTestCompileClasspath,previewTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=previewTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=previewTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=previewTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=previewTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=previewTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=previewTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=previewTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=previewTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=previewTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=previewTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=previewTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=previewTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=previewTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=previewTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=previewTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,previewTestCompileClasspath,previewTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,previewTestAnnotationProcessor,previewTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,previ com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,previewTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=previewTestCompileClasspath,previewTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,previewTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=previewTestCompileClasspath,previewTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=previewTestCompileClasspath,previewTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,previewTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,previewTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=previewTestCompileClasspath,previewTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,previewTestAnnotationProcessor,previewTestCompileClasspath,previewTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,previewTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=previewTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=previewTestCompileClasspath,previewTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=previewTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=previewTestCompileClasspath,previewTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=previewTestCompileClasspath,previewTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=previewTestCompileClasspath,previewTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=previewTestCompileClasspath,previewTestRuntimeClass commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,previewTestCompileClasspath,previewTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=previewTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=previewTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=previewTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=previewTestCompileClasspath,previewTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=previewTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,previewTestCompileClasspath,previewTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,previewTestCompileClasspath,previewTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,previewTestCompileClasspath,previewTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,previewTestCompileClasspath,previewTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=previewTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=previewTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=previewTestRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=previewTestCompileClasspath,previewTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=previewTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=previewTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=previewTestCompileClasspath,previewTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=previewTestCompileClasspath,previewTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=previewTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=previewTestCompileClasspath,previewTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=previewTestCompileClasspath,previewTestRuntimeClassp org.opentest4j:opentest4j:1.3.0=previewTestCompileClasspath,previewTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=previewTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=previewTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=previewTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=previewTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=previewTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=previewTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,previewTestCompileClasspath,previewTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,previewTestCompileClasspath,previewTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=previewTestCompileClasspath,previewTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=previewTestCompileClasspath,previewTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=previewTestCompileClasspath,previewTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-21.0/src/main/java/datadog/trace/instrumentation/java/concurrent/virtualthread/TaskRunnerInstrumentation.java b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-21.0/src/main/java/datadog/trace/instrumentation/java/concurrent/virtualthread/TaskRunnerInstrumentation.java index cafe1df5d51..30e1afd9f51 100644 --- a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-21.0/src/main/java/datadog/trace/instrumentation/java/concurrent/virtualthread/TaskRunnerInstrumentation.java +++ b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-21.0/src/main/java/datadog/trace/instrumentation/java/concurrent/virtualthread/TaskRunnerInstrumentation.java @@ -9,11 +9,11 @@ import static net.bytebuddy.matcher.ElementMatchers.isMethod; import com.google.auto.service.AutoService; +import datadog.context.ContextScope; import datadog.environment.JavaVirtualMachine; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.java.concurrent.State; import java.util.Map; import net.bytebuddy.asm.Advice; @@ -62,12 +62,12 @@ public static void captureScope(@Advice.This Runnable task) { public static final class Run { @OnMethodEnter(suppress = Throwable.class) - public static AgentScope activate(@Advice.This Runnable task) { + public static ContextScope activate(@Advice.This Runnable task) { return startTaskScope(InstrumentationContext.get(Runnable.class, State.class), task); } @OnMethodExit(suppress = Throwable.class) - public static void close(@Advice.Enter AgentScope scope) { + public static void close(@Advice.Enter ContextScope scope) { endTaskScope(scope); } } diff --git a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-25.0/gradle.lockfile b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-25.0/gradle.lockfile index beb4e91f746..aee9f7eff28 100644 --- a/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-25.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/java/java-concurrent/java-concurrent-25.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:java:java-concurrent:java-concurrent-25.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/java/java-io-1.8/gradle.lockfile b/dd-java-agent/instrumentation/java/java-io-1.8/gradle.lockfile index 9beed286723..bd9a04c4f19 100644 --- a/dd-java-agent/instrumentation/java/java-io-1.8/gradle.lockfile +++ b/dd-java-agent/instrumentation/java/java-io-1.8/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:java:java-io-1.8:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=java11TestCompileClasspath,java11TestRuntimeC com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,csiCompileClasspath,java11TestAnnotationProcessor,java11TestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,csiCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,java11TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,java11TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,java11TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,java11TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,java11TestAnnotationProcessor,java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,java11TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=java11TestCompileClasspath,java11TestRuntimeClasspa commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,csiCompileClasspath,java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -93,6 +97,7 @@ org.hamcrest:hamcrest-core:1.3=java11TestRuntimeClasspath,latestDepTestRuntimeCl org.hamcrest:hamcrest:3.0=java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -110,14 +115,14 @@ org.objenesis:objenesis:3.3=java11TestCompileClasspath,java11TestRuntimeClasspat org.opentest4j:opentest4j:1.3.0=java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=java11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=java11TestCompileClasspath,java11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/java/java-lang/java-lang-1.8/gradle.lockfile b/dd-java-agent/instrumentation/java/java-lang/java-lang-1.8/gradle.lockfile index 3868a0fc0c3..dc553735a1d 100644 --- a/dd-java-agent/instrumentation/java/java-lang/java-lang-1.8/gradle.lockfile +++ b/dd-java-agent/instrumentation/java/java-lang/java-lang-1.8/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:java:java-lang:java-lang-1.8:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,csiCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,csiCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -100,14 +105,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/java/java-lang/java-lang-1.8/src/main/java/datadog/trace/instrumentation/java/lang/ProcessImplStartAdvice.java b/dd-java-agent/instrumentation/java/java-lang/java-lang-1.8/src/main/java/datadog/trace/instrumentation/java/lang/ProcessImplStartAdvice.java index d7529cbea8e..d8a324481cb 100644 --- a/dd-java-agent/instrumentation/java/java-lang/java-lang-1.8/src/main/java/datadog/trace/instrumentation/java/lang/ProcessImplStartAdvice.java +++ b/dd-java-agent/instrumentation/java/java-lang/java-lang-1.8/src/main/java/datadog/trace/instrumentation/java/lang/ProcessImplStartAdvice.java @@ -12,16 +12,17 @@ class ProcessImplStartAdvice { public static AgentSpan beforeStart( @Advice.Argument(0) final String[] command, @Advice.Argument(1) final Map environment) { + + if (!AgentTracer.isRegistered()) { + return null; + } + String rootSessionId = Config.get().getRootSessionId(); if (rootSessionId != null && environment != null) { environment.put("_DD_ROOT_JAVA_SESSION_ID", rootSessionId); } - if (!ProcessImplInstrumentationHelpers.ONLINE) { - return null; - } - - if (command.length == 0 || !AgentTracer.isRegistered()) { + if (!ProcessImplInstrumentationHelpers.ONLINE || command.length == 0) { return null; } @@ -29,13 +30,13 @@ public static AgentSpan beforeStart( span.setSpanType("system"); span.setResourceName(ProcessImplInstrumentationHelpers.determineResource(command)); span.setTag("component", "subprocess"); - span.context().setIntegrationName("subprocess"); + span.spanContext().setIntegrationName("subprocess"); ProcessImplInstrumentationHelpers.setTags(span, command); ProcessImplInstrumentationHelpers.cmdiRaspCheck(command); return span; } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void afterStart( @Advice.Return Process p, @Advice.Enter AgentSpan span, @Advice.Thrown Throwable t) { if (span == null) { diff --git a/dd-java-agent/instrumentation/java/java-lang/java-lang-1.8/src/main/java/datadog/trace/instrumentation/java/lang/RuntimeExecStringAdvice.java b/dd-java-agent/instrumentation/java/java-lang/java-lang-1.8/src/main/java/datadog/trace/instrumentation/java/lang/RuntimeExecStringAdvice.java index 574b9f829ed..07b858e778d 100644 --- a/dd-java-agent/instrumentation/java/java-lang/java-lang-1.8/src/main/java/datadog/trace/instrumentation/java/lang/RuntimeExecStringAdvice.java +++ b/dd-java-agent/instrumentation/java/java-lang/java-lang-1.8/src/main/java/datadog/trace/instrumentation/java/lang/RuntimeExecStringAdvice.java @@ -14,7 +14,7 @@ public static boolean beforeExec(@Advice.Argument(0) final String command) { return true; } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void afterExec(@Advice.Enter boolean checking) { if (checking) { ProcessImplInstrumentationHelpers.resetCheckShi(); diff --git a/dd-java-agent/instrumentation/java/java-lang/java-lang-11.0/gradle.lockfile b/dd-java-agent/instrumentation/java/java-lang/java-lang-11.0/gradle.lockfile index c7b58d9527b..45ea8a351ba 100644 --- a/dd-java-agent/instrumentation/java/java-lang/java-lang-11.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/java/java-lang/java-lang-11.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:java:java-lang:java-lang-11.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,csiCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,csiCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/java/java-lang/java-lang-15.0/gradle.lockfile b/dd-java-agent/instrumentation/java/java-lang/java-lang-15.0/gradle.lockfile index 3623cc3b5d3..d1f3c2628b7 100644 --- a/dd-java-agent/instrumentation/java/java-lang/java-lang-15.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/java/java-lang/java-lang-15.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:java:java-lang:java-lang-15.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,21 +9,21 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.javaparser:javaparser-core:3.24.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.javaparser:javaparser-core:3.28.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,csiCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -32,12 +33,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,csiCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -48,12 +52,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -82,6 +86,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -99,14 +104,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/java/java-lang/java-lang-17.0/gradle.lockfile b/dd-java-agent/instrumentation/java/java-lang/java-lang-17.0/gradle.lockfile index c7b58d9527b..ef6a8c68ba0 100644 --- a/dd-java-agent/instrumentation/java/java-lang/java-lang-17.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/java/java-lang/java-lang-17.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:java:java-lang:java-lang-17.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,csiCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,csiCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/java/java-lang/java-lang-21.0/gradle.lockfile b/dd-java-agent/instrumentation/java/java-lang/java-lang-21.0/gradle.lockfile index beb4e91f746..23c31b6353f 100644 --- a/dd-java-agent/instrumentation/java/java-lang/java-lang-21.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/java/java-lang/java-lang-21.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:java:java-lang:java-lang-21.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/java/java-lang/java-lang-21.0/src/main/java/datadog/trace/instrumentation/java/lang/jdk21/VirtualThreadInstrumentation.java b/dd-java-agent/instrumentation/java/java-lang/java-lang-21.0/src/main/java/datadog/trace/instrumentation/java/lang/jdk21/VirtualThreadInstrumentation.java index 4f40cc0ff50..61761fb44d8 100644 --- a/dd-java-agent/instrumentation/java/java-lang/java-lang-21.0/src/main/java/datadog/trace/instrumentation/java/lang/jdk21/VirtualThreadInstrumentation.java +++ b/dd-java-agent/instrumentation/java/java-lang/java-lang-21.0/src/main/java/datadog/trace/instrumentation/java/lang/jdk21/VirtualThreadInstrumentation.java @@ -15,13 +15,13 @@ import com.google.auto.service.AutoService; import datadog.context.Context; +import datadog.context.ContextContinuation; import datadog.environment.JavaVirtualMachine; import datadog.trace.agent.tooling.ExcludeFilterProvider; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.bootstrap.ContextStore; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope.Continuation; import datadog.trace.bootstrap.instrumentation.java.concurrent.ExcludeFilter; import datadog.trace.bootstrap.instrumentation.java.lang.VirtualThreadState; import java.util.Collection; @@ -32,14 +32,14 @@ /** * Instruments {@code VirtualThread} to propagate the context across mount/unmount cycles using - * {@link Context#swap()}, and {@link Continuation} to prevent context scope to complete before the - * thread finishes. + * {@link Context#swap()}, and {@link ContextContinuation} to prevent context scope to complete + * before the thread finishes. * *

    The lifecycle is as follows: * *

      - *
    1. {@code init()}: captures the current {@link Context} and an {@link Continuation} to prevent - * the enclosing context scope from completing early. + *
    2. {@code init()}: captures the current {@link Context} and an {@link ContextContinuation} to + * prevent the enclosing context scope from completing early. *
    3. {@code mount()}: swaps the virtual thread's saved context into the carrier thread, saving * the carrier thread's context. *
    4. {@code unmount()}: swaps the carrier thread's original context back, saving the virtual diff --git a/dd-java-agent/instrumentation/java/java-lang/java-lang-22.0/gradle.lockfile b/dd-java-agent/instrumentation/java/java-lang/java-lang-22.0/gradle.lockfile index 1a19561d8ae..5200871b11c 100644 --- a/dd-java-agent/instrumentation/java/java-lang/java-lang-22.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/java/java-lang/java-lang-22.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:java:java-lang:java-lang-22.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,main_java25CompileClasspath,main_java25RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,main_java25CompileClasspath,main_java25RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,main_java25CompileClasspath,main_java25RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,main_java25CompileClasspath,main_java25RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,main_java25CompileClasspath,main_java25RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,main_java25CompileClasspath,main_java25RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,main_java25CompileClasspath,main_java25RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,main_java25CompileClasspath,main_java25RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,main_java25CompileClasspath,main_java25RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,main_java25CompileClasspath,main_java25RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/java/java-lang/java-lang-22.0/src/test/groovy/FFMInstrumentationForkedTest.groovy b/dd-java-agent/instrumentation/java/java-lang/java-lang-22.0/src/test/groovy/FFMInstrumentationForkedTest.groovy index 66d73cbe68f..35ae87c60ea 100644 --- a/dd-java-agent/instrumentation/java/java-lang/java-lang-22.0/src/test/groovy/FFMInstrumentationForkedTest.groovy +++ b/dd-java-agent/instrumentation/java/java-lang/java-lang-22.0/src/test/groovy/FFMInstrumentationForkedTest.groovy @@ -136,58 +136,32 @@ class FFMInstrumentationForkedTest extends InstrumentationSpecification { def "should trace ffm calls using libraryLookup by path for library loaded with System.load"() { setup: - injectSysConfig("trace.native.methods", "libjvm[*]") - final String libName = System.mapLibraryName("jvm") - final Path libPath = Path.of(System.getProperty("java.home"), "lib", "server", libName) + injectSysConfig("trace.native.methods", "libdt_socket[*]") + final String libName = System.mapLibraryName("dt_socket") + final Path libPath = Path.of(System.getProperty("java.home"), "lib", libName) when: LoaderUtil.loadLibrary(libPath) - try (final Arena arena = Arena.ofConfined()) { - final SymbolLookup libLookup = LoaderUtil.loaderLookup() - FunctionDescriptor fd = FunctionDescriptor.of( - ValueLayout.JAVA_INT, // jint return - ValueLayout.ADDRESS, // JavaVM** - ValueLayout.JAVA_INT, // jsize bufLen - ValueLayout.ADDRESS // jsize* nVMs - ) - - // this is a quite stable symbol (it's in the public API) - MemorySegment sym = - libLookup.find("JNI_GetCreatedJavaVMs") - .orElseThrow() - - MethodHandle methodHandle = Linker.nativeLinker().downcallHandle(sym, fd) - - // Allocate space for JavaVM* (we only expect 1 VM) - MemorySegment vmBuf = arena.allocate(ValueLayout.ADDRESS) - - // Allocate space for jsize nVMs - MemorySegment nVMs = arena.allocate(ValueLayout.JAVA_INT) - - int result = (int) methodHandle.invokeWithArguments( - vmBuf, - 1, - nVMs - ) - - int count = nVMs.get(ValueLayout.JAVA_INT, 0) - - System.out.println("Return code: " + result) - System.out.println("Number of VMs: " + count) - - if (count > 0) { - MemorySegment vmPtr = vmBuf.get(ValueLayout.ADDRESS, 0) - System.out.println("JavaVM pointer: " + vmPtr) - } - } - + final SymbolLookup libLookup = LoaderUtil.loaderLookup() + final MemorySegment onLoadAddr = libLookup.findOrThrow("jdwpTransport_OnLoad") + final MethodHandle onLoadHandle = + Linker.nativeLinker().downcallHandle( + onLoadAddr, + FunctionDescriptor.of( + ValueLayout.JAVA_INT, + ValueLayout.ADDRESS, + ValueLayout.ADDRESS, + ValueLayout.JAVA_INT, + ValueLayout.ADDRESS)) + // version 0 is rejected before any argument is dereferenced + onLoadHandle.invokeWithArguments(MemorySegment.NULL, MemorySegment.NULL, 0, MemorySegment.NULL) then: assertTraces(1) { trace(1) { span { operationName "trace.native" - resourceName "libjvm.JNI_GetCreatedJavaVMs" + resourceName "libdt_socket.jdwpTransport_OnLoad" tags { "$Tags.COMPONENT" "trace-ffm" defaultTags() diff --git a/dd-java-agent/instrumentation/java/java-lang/java-lang-9.0/gradle.lockfile b/dd-java-agent/instrumentation/java/java-lang/java-lang-9.0/gradle.lockfile index c7b58d9527b..c14bfd734ad 100644 --- a/dd-java-agent/instrumentation/java/java-lang/java-lang-9.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/java/java-lang/java-lang-9.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:java:java-lang:java-lang-9.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,csiCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,csiCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/java/java-lang/java-lang-classloading-1.8/gradle.lockfile b/dd-java-agent/instrumentation/java/java-lang/java-lang-classloading-1.8/gradle.lockfile index f4ae2594c29..552d1986d0f 100644 --- a/dd-java-agent/instrumentation/java/java-lang/java-lang-classloading-1.8/gradle.lockfile +++ b/dd-java-agent/instrumentation/java/java-lang/java-lang-classloading-1.8/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:java:java-lang:java-lang-classloading-1.8:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=classloadingJbossTestCompileClasspath,classlo com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,classloadingJbossTestAnnotationProcessor,classloadingJbossTestCompileClasspath,classloadingJsr14TestAnnotationProcessor,classloadingJsr14TestCompileClasspath,classloadingOsgiTestAnnotationProcessor,classloadingOsgiTestCompileClasspath,classloadingTomcatLatestDepTestAnnotationProcessor,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatTestAnnotationProcessor,classloadingTomcatTestCompileClasspath,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,classloadingJbossTestA com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,classloadingJbossTestAnnotationProcessor,classloadingJsr14TestAnnotationProcessor,classloadingOsgiTestAnnotationProcessor,classloadingTomcatLatestDepTestAnnotationProcessor,classloadingTomcatTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,classloadingJbossTestAnnotationProcessor,classloadingJsr14TestAnnotationProcessor,classloadingOsgiTestAnnotationProcessor,classloadingTomcatLatestDepTestAnnotationProcessor,classloadingTomcatTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,classloadingJbossTestAnnotationProcessor,classloadingJsr14TestAnnotationProcessor,classloadingOsgiTestAnnotationProcessor,classloadingTomcatLatestDepTestAnnotationProcessor,classloadingTomcatTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,classloadingJbossTestAnnotationProcessor,classloadingJsr14TestAnnotationProcessor,classloadingOsgiTestAnnotationProcessor,classloadingTomcatLatestDepTestAnnotationProcessor,classloadingTomcatTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,classloadingJbossTestAnnotationProcessor,classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestAnnotationProcessor,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestAnnotationProcessor,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestAnnotationProcessor,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestAnnotationProcessor,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,classloadingJbossTestAnnotationProcessor,classloadingJsr14TestAnnotationProcessor,classloadingOsgiTestAnnotationProcessor,classloadingTomcatLatestDepTestAnnotationProcessor,classloadingTomcatTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=classloadingJbossTestCompileClasspath,classloadingJ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -64,28 +68,28 @@ org.apache.commons:commons-text:1.14.0=spotbugs org.apache.felix:org.apache.felix.framework:6.0.2=classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs -org.apache.tomcat:tomcat-annotations-api:11.0.21=classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath +org.apache.tomcat:tomcat-annotations-api:11.0.24=classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath org.apache.tomcat:tomcat-annotations-api:8.0.14=classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath -org.apache.tomcat:tomcat-api:11.0.21=classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath +org.apache.tomcat:tomcat-api:11.0.24=classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath org.apache.tomcat:tomcat-api:8.0.14=classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath -org.apache.tomcat:tomcat-catalina:11.0.21=classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath +org.apache.tomcat:tomcat-catalina:11.0.24=classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath org.apache.tomcat:tomcat-catalina:8.0.14=classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath -org.apache.tomcat:tomcat-coyote:11.0.21=classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath +org.apache.tomcat:tomcat-coyote:11.0.24=classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath org.apache.tomcat:tomcat-coyote:8.0.14=classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath -org.apache.tomcat:tomcat-el-api:11.0.21=classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath +org.apache.tomcat:tomcat-el-api:11.0.24=classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath org.apache.tomcat:tomcat-el-api:8.0.14=classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath -org.apache.tomcat:tomcat-jaspic-api:11.0.21=classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath -org.apache.tomcat:tomcat-jni:11.0.21=classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath +org.apache.tomcat:tomcat-jaspic-api:11.0.24=classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath +org.apache.tomcat:tomcat-jni:11.0.24=classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath org.apache.tomcat:tomcat-jni:8.0.14=classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath -org.apache.tomcat:tomcat-jsp-api:11.0.21=classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath +org.apache.tomcat:tomcat-jsp-api:11.0.24=classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath org.apache.tomcat:tomcat-jsp-api:8.0.14=classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath -org.apache.tomcat:tomcat-juli:11.0.21=classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath +org.apache.tomcat:tomcat-juli:11.0.24=classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath org.apache.tomcat:tomcat-juli:8.0.14=classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath -org.apache.tomcat:tomcat-servlet-api:11.0.21=classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath +org.apache.tomcat:tomcat-servlet-api:11.0.24=classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath org.apache.tomcat:tomcat-servlet-api:8.0.14=classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath -org.apache.tomcat:tomcat-util-scan:11.0.21=classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath +org.apache.tomcat:tomcat-util-scan:11.0.24=classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath org.apache.tomcat:tomcat-util-scan:8.0.14=classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath -org.apache.tomcat:tomcat-util:11.0.21=classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath +org.apache.tomcat:tomcat-util:11.0.24=classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath org.apache.tomcat:tomcat-util:8.0.14=classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath org.apiguardian:apiguardian-api:1.1.2=classloadingJbossTestCompileClasspath,classloadingJsr14TestCompileClasspath,classloadingOsgiTestCompileClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatTestCompileClasspath,testCompileClasspath org.checkerframework:checker-qual:3.33.0=annotationProcessor,classloadingJbossTestAnnotationProcessor,classloadingJsr14TestAnnotationProcessor,classloadingOsgiTestAnnotationProcessor,classloadingTomcatLatestDepTestAnnotationProcessor,classloadingTomcatTestAnnotationProcessor,testAnnotationProcessor @@ -108,6 +112,7 @@ org.hamcrest:hamcrest:3.0=classloadingJbossTestCompileClasspath,classloadingJbos org.jboss.modules:jboss-modules:1.3.10.Final=classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -125,14 +130,14 @@ org.objenesis:objenesis:3.3=classloadingJbossTestCompileClasspath,classloadingJb org.opentest4j:opentest4j:1.3.0=classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=classloadingJbossTestRuntimeClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=classloadingJbossTestCompileClasspath,classloadingJbossTestRuntimeClasspath,classloadingJsr14TestCompileClasspath,classloadingJsr14TestRuntimeClasspath,classloadingOsgiTestCompileClasspath,classloadingOsgiTestRuntimeClasspath,classloadingTomcatLatestDepTestCompileClasspath,classloadingTomcatLatestDepTestRuntimeClasspath,classloadingTomcatTestCompileClasspath,classloadingTomcatTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/java/java-net/java-net-1.8/gradle.lockfile b/dd-java-agent/instrumentation/java/java-net/java-net-1.8/gradle.lockfile index 81147cd0e35..813085be9d6 100644 --- a/dd-java-agent/instrumentation/java/java-net/java-net-1.8/gradle.lockfile +++ b/dd-java-agent/instrumentation/java/java-net/java-net-1.8/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:java:java-net:java-net-1.8:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,csiCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,csiCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -48,12 +52,12 @@ commons-io:commons-io:2.20.0=spotbugs commons-logging:commons-logging:1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -82,6 +86,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -99,14 +104,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/java/java-net/java-net-1.8/src/main/java/datadog/trace/instrumentation/java/net/HttpUrlConnectionInstrumentation.java b/dd-java-agent/instrumentation/java/java-net/java-net-1.8/src/main/java/datadog/trace/instrumentation/java/net/HttpUrlConnectionInstrumentation.java index a51087c85eb..fb59f988a66 100644 --- a/dd-java-agent/instrumentation/java/java-net/java-net-1.8/src/main/java/datadog/trace/instrumentation/java/net/HttpUrlConnectionInstrumentation.java +++ b/dd-java-agent/instrumentation/java/java-net/java-net-1.8/src/main/java/datadog/trace/instrumentation/java/net/HttpUrlConnectionInstrumentation.java @@ -2,7 +2,7 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.namedOneOf; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; import static datadog.trace.bootstrap.instrumentation.decorator.UrlConnectionDecorator.DECORATE; import static datadog.trace.bootstrap.instrumentation.httpurlconnection.HeadersInjectAdapter.SETTER; import static java.util.Collections.singletonMap; @@ -85,7 +85,7 @@ public static HttpUrlState methodEnter( if (!state.hasSpan() && !state.isFinished()) { final AgentSpan span = state.start(thiz); if (!connected) { - DECORATE.injectContext(getCurrentContext().with(span), thiz, SETTER); + DECORATE.injectContext(currentContext().with(span), thiz, SETTER); } } return state; diff --git a/dd-java-agent/instrumentation/java/java-net/java-net-1.8/src/main/java/datadog/trace/instrumentation/java/net/SocketConnectInstrumentation.java b/dd-java-agent/instrumentation/java/java-net/java-net-1.8/src/main/java/datadog/trace/instrumentation/java/net/SocketConnectInstrumentation.java index 13e80ec3853..44897c867ea 100644 --- a/dd-java-agent/instrumentation/java/java-net/java-net-1.8/src/main/java/datadog/trace/instrumentation/java/net/SocketConnectInstrumentation.java +++ b/dd-java-agent/instrumentation/java/java-net/java-net-1.8/src/main/java/datadog/trace/instrumentation/java/net/SocketConnectInstrumentation.java @@ -61,7 +61,7 @@ public static boolean before() { return false; } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void after(@Advice.Enter boolean wasEnabled) { if (wasEnabled) { AgentTracer.get().getProfilingContext().onAttach(); diff --git a/dd-java-agent/instrumentation/java/java-net/java-net-1.8/src/main/java/datadog/trace/instrumentation/java/net/UrlInstrumentation.java b/dd-java-agent/instrumentation/java/java-net/java-net-1.8/src/main/java/datadog/trace/instrumentation/java/net/UrlInstrumentation.java index 990d3a4ae7c..0b349aff712 100644 --- a/dd-java-agent/instrumentation/java/java-net/java-net-1.8/src/main/java/datadog/trace/instrumentation/java/net/UrlInstrumentation.java +++ b/dd-java-agent/instrumentation/java/java-net/java-net-1.8/src/main/java/datadog/trace/instrumentation/java/net/UrlInstrumentation.java @@ -9,9 +9,9 @@ import static net.bytebuddy.matcher.ElementMatchers.isPublic; import com.google.auto.service.AutoService; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.net.URL; import java.net.URLStreamHandler; @@ -55,7 +55,7 @@ public static void errorSpan( final AgentSpan span = startSpan("UrlConnection", DECORATE.operationName(protocol)); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { DECORATE.afterStart(span); DECORATE.onURL(span, url); HTTP_RESOURCE_DECORATOR.withClientPath(span, null, url.getPath()); diff --git a/dd-java-agent/instrumentation/java/java-net/java-net-11.0/gradle.lockfile b/dd-java-agent/instrumentation/java/java-net/java-net-11.0/gradle.lockfile index 83feea80e8f..dc3970a587f 100644 --- a/dd-java-agent/instrumentation/java/java-net/java-net-11.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/java/java-net/java-net-11.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:java:java-net:java-net-11.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/main/java11/datadog/trace/instrumentation/httpclient/BodyHandlerWrapper.java b/dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/main/java11/datadog/trace/instrumentation/httpclient/BodyHandlerWrapper.java index e0c2ce126a4..802c76b4fb2 100644 --- a/dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/main/java11/datadog/trace/instrumentation/httpclient/BodyHandlerWrapper.java +++ b/dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/main/java11/datadog/trace/instrumentation/httpclient/BodyHandlerWrapper.java @@ -1,6 +1,10 @@ package datadog.trace.instrumentation.httpclient; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.captureSpan; + +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.net.http.HttpResponse.BodyHandler; import java.net.http.HttpResponse.BodySubscriber; import java.net.http.HttpResponse.ResponseInfo; @@ -11,27 +15,28 @@ public class BodyHandlerWrapper implements BodyHandler { private final BodyHandler delegate; - private final AgentScope.Continuation continuation; + private final AgentSpan span; - public BodyHandlerWrapper(BodyHandler delegate, AgentScope.Continuation context) { + public BodyHandlerWrapper(BodyHandler delegate, AgentSpan span) { this.delegate = delegate; - this.continuation = context; + this.span = span; } @Override public BodySubscriber apply(ResponseInfo responseInfo) { + // Capture the continuation lazily here rather than at sendAsync() call time. BodySubscriber subscriber = delegate.apply(responseInfo); if (subscriber instanceof BodySubscriberWrapper) { return subscriber; } - return new BodySubscriberWrapper<>(subscriber, continuation); + return new BodySubscriberWrapper<>(subscriber, captureSpan(span)); } static class BodySubscriberWrapper implements BodySubscriber { private final BodySubscriber delegate; - private final AgentScope.Continuation continuation; + private final ContextContinuation continuation; - public BodySubscriberWrapper(BodySubscriber delegate, AgentScope.Continuation continuation) { + public BodySubscriberWrapper(BodySubscriber delegate, ContextContinuation continuation) { this.delegate = delegate; this.continuation = continuation; } @@ -52,21 +57,21 @@ public void onSubscribe(Flow.Subscription subscription) { @Override public void onNext(List item) { - try (AgentScope ignore = continuation.activate()) { + try (ContextScope ignore = continuation.resume()) { delegate.onNext(item); } } @Override public void onError(Throwable throwable) { - try (AgentScope ignore = continuation.activate()) { + try (ContextScope ignore = continuation.resume()) { delegate.onError(throwable); } } @Override public void onComplete() { - try (AgentScope ignore = continuation.activate()) { + try (ContextScope ignore = continuation.resume()) { delegate.onComplete(); } } diff --git a/dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/main/java11/datadog/trace/instrumentation/httpclient/CompletableFutureWrapper.java b/dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/main/java11/datadog/trace/instrumentation/httpclient/CompletableFutureWrapper.java index 68c304176cf..86fd52493d0 100644 --- a/dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/main/java11/datadog/trace/instrumentation/httpclient/CompletableFutureWrapper.java +++ b/dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/main/java11/datadog/trace/instrumentation/httpclient/CompletableFutureWrapper.java @@ -1,6 +1,7 @@ package datadog.trace.instrumentation.httpclient; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; import java.util.concurrent.CompletableFuture; public final class CompletableFutureWrapper { @@ -8,11 +9,11 @@ public final class CompletableFutureWrapper { private CompletableFutureWrapper() {} public static CompletableFuture wrap( - CompletableFuture future, AgentScope.Continuation continuation) { + CompletableFuture future, ContextContinuation continuation) { CompletableFuture result = new CompletableFuture<>(); future.whenComplete( (T value, Throwable throwable) -> { - try (AgentScope scope = continuation.activate()) { + try (ContextScope scope = continuation.resume()) { if (throwable != null) { result.completeExceptionally(throwable); } else { diff --git a/dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/main/java11/datadog/trace/instrumentation/httpclient/HeadersAdvice.java b/dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/main/java11/datadog/trace/instrumentation/httpclient/HeadersAdvice.java index 0657b3f44f5..4dd8ffd96e0 100644 --- a/dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/main/java11/datadog/trace/instrumentation/httpclient/HeadersAdvice.java +++ b/dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/main/java11/datadog/trace/instrumentation/httpclient/HeadersAdvice.java @@ -1,7 +1,7 @@ package datadog.trace.instrumentation.httpclient; import static datadog.trace.agent.tooling.InstrumenterModule.TargetSystem.CONTEXT_TRACKING; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; import static datadog.trace.instrumentation.httpclient.HttpHeadersInjectAdapter.KEEP; import static datadog.trace.instrumentation.httpclient.HttpHeadersInjectAdapter.SETTER; import static datadog.trace.instrumentation.httpclient.JavaNetClientDecorator.DECORATE; @@ -24,7 +24,7 @@ public static void methodExit(@Advice.Return(readOnly = false) HttpHeaders heade // case insensitively final Map> headerMap = new TreeMap<>(CASE_INSENSITIVE_ORDER); headerMap.putAll(headers.map()); - DECORATE.injectContext(getCurrentContext(), headerMap, SETTER); + DECORATE.injectContext(currentContext(), headerMap, SETTER); headers = HttpHeaders.of(headerMap, KEEP); } } diff --git a/dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/main/java11/datadog/trace/instrumentation/httpclient/SendAsyncAdvice.java b/dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/main/java11/datadog/trace/instrumentation/httpclient/SendAsyncAdvice.java index c58b1e5c562..a73c4c15722 100644 --- a/dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/main/java11/datadog/trace/instrumentation/httpclient/SendAsyncAdvice.java +++ b/dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/main/java11/datadog/trace/instrumentation/httpclient/SendAsyncAdvice.java @@ -1,7 +1,6 @@ package datadog.trace.instrumentation.httpclient; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.captureSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; import static datadog.trace.instrumentation.httpclient.JavaNetClientDecorator.DECORATE; import static datadog.trace.instrumentation.httpclient.JavaNetClientDecorator.INSTRUMENTATION_NAME; @@ -38,7 +37,10 @@ public static AgentScope methodEnter( final AgentSpan span = startSpan(INSTRUMENTATION_NAME, OPERATION_NAME); final AgentScope scope = activateSpan(span); if (bodyHandler != null) { - bodyHandler = new BodyHandlerWrapper<>(bodyHandler, captureSpan(span)); + // Pass span directly — BodyHandlerWrapper captures the continuation lazily in apply(), + // only once response headers arrive. This avoids leaking a continuation when the + // connection fails before headers are received. + bodyHandler = new BodyHandlerWrapper<>(bodyHandler, span); } DECORATE.afterStart(span); @@ -71,11 +73,12 @@ public static void methodExit( if (throwable != null) { DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); + scope.close(); span.finish(); } else { future = future.whenComplete(new ResponseConsumer(span)); + scope.close(); } - scope.close(); } } diff --git a/dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/test/groovy/datadog/trace/instrumentation/httpclient/JavaHttpClientTest.groovy b/dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/test/groovy/datadog/trace/instrumentation/httpclient/JavaHttpClientTest.groovy index c666e0d0efa..c07838d941f 100644 --- a/dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/test/groovy/datadog/trace/instrumentation/httpclient/JavaHttpClientTest.groovy +++ b/dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/test/groovy/datadog/trace/instrumentation/httpclient/JavaHttpClientTest.groovy @@ -10,11 +10,6 @@ import java.net.http.HttpResponse import java.time.Duration abstract class JavaHttpClientTest extends HttpClientTest { - @Override - boolean useStrictTraceWrites() { - // TODO fix this by making sure that spans get closed properly - return false - } def client = HttpClient.newBuilder() .connectTimeout(Duration.ofMillis(CONNECT_TIMEOUT_MS)) diff --git a/dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/test/java/datadog/trace/instrumentation/httpclient/JpmsInetAddressDisabledForkedTest.java b/dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/test/java/datadog/trace/instrumentation/httpclient/JpmsInetAddressDisabledForkedTest.java index 9bcc47d5f4f..1bb1127aa20 100644 --- a/dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/test/java/datadog/trace/instrumentation/httpclient/JpmsInetAddressDisabledForkedTest.java +++ b/dd-java-agent/instrumentation/java/java-net/java-net-11.0/src/test/java/datadog/trace/instrumentation/httpclient/JpmsInetAddressDisabledForkedTest.java @@ -6,7 +6,7 @@ import datadog.environment.JavaVirtualMachine; import datadog.trace.agent.test.AbstractInstrumentationTest; import datadog.trace.bootstrap.instrumentation.java.net.HostNameResolver; -import datadog.trace.junit.utils.config.WithConfig; +import datadog.trace.test.junit.utils.config.WithConfig; import java.net.InetAddress; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.EnabledForJreRange; diff --git a/dd-java-agent/instrumentation/java/java-nio-1.8/gradle.lockfile b/dd-java-agent/instrumentation/java/java-nio-1.8/gradle.lockfile index 83feea80e8f..de7aff17697 100644 --- a/dd-java-agent/instrumentation/java/java-nio-1.8/gradle.lockfile +++ b/dd-java-agent/instrumentation/java/java-nio-1.8/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:java:java-nio-1.8:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/java/java-rmi-1.1/gradle.lockfile b/dd-java-agent/instrumentation/java/java-rmi-1.1/gradle.lockfile index 5ca3972ba7b..3b75b8cfc33 100644 --- a/dd-java-agent/instrumentation/java/java-rmi-1.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/java/java-rmi-1.1/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:java:java-rmi-1.1:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/java/java-security-1.8/gradle.lockfile b/dd-java-agent/instrumentation/java/java-security-1.8/gradle.lockfile index ca0e6e8fc0a..9c167d581c8 100644 --- a/dd-java-agent/instrumentation/java/java-security-1.8/gradle.lockfile +++ b/dd-java-agent/instrumentation/java/java-security-1.8/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:java:java-security-1.8:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,csiCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,csiCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -82,6 +86,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -99,14 +104,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/java/java-util-1.8/gradle.lockfile b/dd-java-agent/instrumentation/java/java-util-1.8/gradle.lockfile index c7b58d9527b..39843f8e431 100644 --- a/dd-java-agent/instrumentation/java/java-util-1.8/gradle.lockfile +++ b/dd-java-agent/instrumentation/java/java-util-1.8/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:java:java-util-1.8:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,csiCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,csiCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/javax-naming-1.0/gradle.lockfile b/dd-java-agent/instrumentation/javax-naming-1.0/gradle.lockfile index c7b58d9527b..4ad08b82cf8 100644 --- a/dd-java-agent/instrumentation/javax-naming-1.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/javax-naming-1.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:javax-naming-1.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,csiCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,csiCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/javax-xml-1.4/gradle.lockfile b/dd-java-agent/instrumentation/javax-xml-1.4/gradle.lockfile index 9fee0aef72a..9d06e34f376 100644 --- a/dd-java-agent/instrumentation/javax-xml-1.4/gradle.lockfile +++ b/dd-java-agent/instrumentation/javax-xml-1.4/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:javax-xml-1.4:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,csiCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,csiCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,csiCompileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jboss/jboss-logmanager-1.1/gradle.lockfile b/dd-java-agent/instrumentation/jboss/jboss-logmanager-1.1/gradle.lockfile index 1a62d083d7e..a1ac56af063 100644 --- a/dd-java-agent/instrumentation/jboss/jboss-logmanager-1.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/jboss/jboss-logmanager-1.1/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jboss:jboss-logmanager-1.1:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -82,6 +86,7 @@ org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jboss.logmanager:jboss-logmanager:1.1.0.GA=compileClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -99,14 +104,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jboss/jboss-logmanager-1.1/src/main/java/datadog/trace/instrumentation/jbosslogmanager/LoggerNodeInstrumentation.java b/dd-java-agent/instrumentation/jboss/jboss-logmanager-1.1/src/main/java/datadog/trace/instrumentation/jbosslogmanager/LoggerNodeInstrumentation.java index ea9bf2758ae..4e8cc81ef37 100644 --- a/dd-java-agent/instrumentation/jboss/jboss-logmanager-1.1/src/main/java/datadog/trace/instrumentation/jbosslogmanager/LoggerNodeInstrumentation.java +++ b/dd-java-agent/instrumentation/jboss/jboss-logmanager-1.1/src/main/java/datadog/trace/instrumentation/jbosslogmanager/LoggerNodeInstrumentation.java @@ -56,7 +56,7 @@ public static boolean attachContext(@Advice.Argument(0) ExtLogRecord record) { if (span != null && traceConfig(span).isLogsInjectionEnabled()) { InstrumentationContext.get(ExtLogRecord.class, AgentSpanContext.class) - .put(record, span.context()); + .put(record, span.spanContext()); } return true; diff --git a/dd-java-agent/instrumentation/jboss/jboss-modules-1.3/gradle.lockfile b/dd-java-agent/instrumentation/jboss/jboss-modules-1.3/gradle.lockfile index 30c3c6ca553..73dbaafa613 100644 --- a/dd-java-agent/instrumentation/jboss/jboss-modules-1.3/gradle.lockfile +++ b/dd-java-agent/instrumentation/jboss/jboss-modules-1.3/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jboss:jboss-modules-1.3:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -83,6 +87,7 @@ org.jboss.modules:jboss-modules:1.3.0.Final=compileClasspath,testCompileClasspat org.jboss.modules:jboss-modules:2.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -100,14 +105,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jdbc/gradle.lockfile b/dd-java-agent/instrumentation/jdbc/gradle.lockfile index 2e180916ecd..5915d184d9a 100644 --- a/dd-java-agent/instrumentation/jdbc/gradle.lockfile +++ b/dd-java-agent/instrumentation/jdbc/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jdbc:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=jmhRuntimeClasspath,latestDepJava11TestCompil com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.github.docker-java:docker-java-api:3.4.2=jmhRuntimeClasspath,latestDepJava11 com.github.docker-java:docker-java-transport-zerodep:3.4.2=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,jmhCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,csiCompileClasspath,jmhCompileClasspath,latestDepJava11TestAnnotationProcessor,latestDepJava11TestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,oldH2TestAnnotationProcessor,oldH2TestCompileClasspath,oldPostgresTestAnnotationProcessor,oldPostgresTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,13 +36,16 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,csiCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepJava11TestAnnotationProcessor,latestDepTestAnnotationProcessor,oldH2TestAnnotationProcessor,oldPostgresTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepJava11TestAnnotationProcessor,latestDepTestAnnotationProcessor,oldH2TestAnnotationProcessor,oldPostgresTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepJava11TestAnnotationProcessor,latestDepTestAnnotationProcessor,oldH2TestAnnotationProcessor,oldPostgresTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepJava11TestAnnotationProcessor,latestDepTestAnnotationProcessor,oldH2TestAnnotationProcessor,oldPostgresTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,jmhRuntimeClasspath,latestDepJava11TestAnnotationProcessor,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestAnnotationProcessor,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestAnnotationProcessor,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepJava11TestAnnotationProcessor,latestDepTestAnnotationProcessor,oldH2TestAnnotationProcessor,oldPostgresTestAnnotationProcessor,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:3.1=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.protobuf:protobuf-java:3.11.4=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath com.h2database:h2:1.3.168=oldH2TestCompileClasspath,oldH2TestRuntimeClasspath com.h2database:h2:1.3.169=jmhRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.h2database:h2:2.2.224=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -59,21 +63,21 @@ com.squareup.okio:okio:1.17.5=jmhRuntimeClasspath,latestDepJava11TestCompileClas com.thoughtworks.qdox:qdox:1.12.1=codenarc com.zaxxer:HikariCP:2.4.0=compileClasspath,csiCompileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.zaxxer:HikariCP:4.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.zaxxer:HikariCP:7.0.2=latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath +com.zaxxer:HikariCP:7.1.0=latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath commons-fileupload:commons-fileupload:1.5=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.11.0=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs commons-logging:commons-logging:1.2=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,csiCompileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath jakarta.transaction:jakarta.transaction-api:1.3.1=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath mysql:mysql-connector-java:8.0.23=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.jopt-simple:jopt-simple:5.0.4=jmh,jmhCompileClasspath,jmhRuntimeClasspath @@ -117,6 +121,7 @@ org.hsqldb:hsqldb:2.5.2=latestDepJava11TestCompileClasspath,latestDepJava11TestR org.jctools:jctools-core-jdk11:4.0.6=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -138,15 +143,15 @@ org.openjdk.jmh:jmh-generator-reflection:1.36=jmh,jmhCompileClasspath,jmhRuntime org.opentest4j:opentest4j:1.3.0=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=jmhRuntimeClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,oldH2TestRuntimeClasspath,oldPostgresTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs org.ow2.asm:asm:9.0=jmh +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.postgresql:postgresql:42.2.18=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.postgresql:postgresql:9.4-1201-jdbc41=oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=jmhRuntimeClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,oldH2TestCompileClasspath,oldH2TestRuntimeClasspath,oldPostgresTestCompileClasspath,oldPostgresTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jdbc/scalikejdbc-3.5/build.gradle b/dd-java-agent/instrumentation/jdbc/scalikejdbc-3.5/build.gradle index 044430e7e33..299ed4490e9 100644 --- a/dd-java-agent/instrumentation/jdbc/scalikejdbc-3.5/build.gradle +++ b/dd-java-agent/instrumentation/jdbc/scalikejdbc-3.5/build.gradle @@ -29,6 +29,10 @@ tasks.withType(ScalaCompile).configureEach { } dependencies { + // Scala plugin needs scala-library on the main compile classpath so IDEA + // can infer the Scala classpath, even though Scala sources only exist under test. + compileOnly libs.scala + testImplementation project(':dd-java-agent:instrumentation:jdbc') testImplementation group: 'org.scalikejdbc', name: 'scalikejdbc_2.13', version: '3.5.0' testImplementation libs.scala diff --git a/dd-java-agent/instrumentation/jdbc/scalikejdbc-3.5/gradle.lockfile b/dd-java-agent/instrumentation/jdbc/scalikejdbc-3.5/gradle.lockfile index 57cfb5bdd0b..97230b6d0b0 100644 --- a/dd-java-agent/instrumentation/jdbc/scalikejdbc-3.5/gradle.lockfile +++ b/dd-java-agent/instrumentation/jdbc/scalikejdbc-3.5/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jdbc:scalikejdbc-3.5:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.eed3si9n:shaded-scalajson_2.13:1.0.0-M4=zinc com.eed3si9n:sjson-new-core_2.13:0.10.1=zinc com.eed3si9n:sjson-new-scalajson_2.13:0.10.1=zinc com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,19 +36,22 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.h2database:h2:1.3.169=testCompileClasspath,testRuntimeClasspath com.h2database:h2:2.2.224=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.lmax:disruptor:3.4.2=zinc -com.mchange:c3p0:0.13.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.mchange:c3p0:0.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.mchange:c3p0:0.9.5=testCompileClasspath,testRuntimeClasspath com.mchange:mchange-commons-java:0.2.9=testCompileClasspath,testRuntimeClasspath -com.mchange:mchange-commons-java:0.5.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.mchange:mchange-commons-java:0.6.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -61,16 +65,15 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs commons-logging:commons-logging:1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.openhft:zero-allocation-hashing:0.16=zinc net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -104,7 +107,7 @@ org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -115,7 +118,8 @@ org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspat org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -133,45 +137,46 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-collection-compat_2.13:2.1.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,zinc org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc -org.scala-lang:scala-library:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc +org.scala-lang:scala-library:2.11.12=compileClasspath +org.scala-lang:scala-library:2.13.16=zinc org.scala-lang:scala-library:2.13.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.scala-lang:scala-library:2.13.3=testCompileClasspath,testRuntimeClasspath -org.scala-lang:scala-reflect:2.13.15=zinc +org.scala-lang:scala-reflect:2.13.16=zinc org.scala-lang:scala-reflect:2.13.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.scalikejdbc:scalikejdbc-core_2.13:3.5.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.scalikejdbc:scalikejdbc-interpolation-macro_2.13:3.5.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.scalikejdbc:scalikejdbc-interpolation_2.13:3.5.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jdbc/src/jmh/java/datadog/trace/instrumentation/jdbc/SQLCommenterDuplicateCommentBenchmark.java b/dd-java-agent/instrumentation/jdbc/src/jmh/java/datadog/trace/instrumentation/jdbc/SQLCommenterDuplicateCommentBenchmark.java new file mode 100644 index 00000000000..9c9a8e09a39 --- /dev/null +++ b/dd-java-agent/instrumentation/jdbc/src/jmh/java/datadog/trace/instrumentation/jdbc/SQLCommenterDuplicateCommentBenchmark.java @@ -0,0 +1,77 @@ +package datadog.trace.instrumentation.jdbc; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.annotations.Warmup; + +/** + * Benchmark for the duplicate-comment guard in {@link SQLCommenter#inject} -- the {@code + * hasDDComment} path that avoids double-commenting an already-instrumented statement. + * + *

      What we're measuring. The guard used to materialize {@code sql.substring(commentStart, + * commentEnd)} (the comment body) just to scan it for trace-comment needles. (B) checks the comment + * region in place via {@code SharedDBCommenter.containsTraceComment(sql, from, to)} -- no + * substring. + * + *

      Isolation. The substring only happens when the SQL already carries a comment in the + * checked position; for a DD comment {@code inject} then returns early. Passing {@code dbType=null} + * skips the first-word scan (benchmarked separately for the {@code getFirstWord} change), so over + * already-DD-commented SQL the only allocation left in {@code inject} is the substring (B) + * removes. Run at {@code @Threads(8)} with {@code -prof gc}. + * + *

      + *   ./gradlew :dd-java-agent:instrumentation:jdbc:jmh   # add -prof gc
      + * 
      + * + *

      Results (JDK 17, MacBook M-series, {@code @Threads(8)}, {@code @Fork(5)}, {@code -prof + * gc}): + * + *

      + *                        throughput            gc.alloc.rate.norm
      + *   before (substring)   23.5M ± 1.1M ops/s    140 B/op
      + *   after  (range/view)  26.2M ± 1.5M ops/s    ~0  B/op  (10^-5)
      + * 
      + * + * The extractCommentContent substring (140 B/op) is gone -- the in-place range scan and the + * SubSequence view it flows through are both EA-elided. The allocation delta is exact and + * fork-stable; that's the win. At {@code @Fork(5)} the spread tightens and a small throughput + * uplift (~1.1x) resolves -- but this path is dominated by the nine indexOf scans (CPU the + * alloc-removal doesn't touch), so the headline win is the allocation, a small cut that compounds + * across comment-bearing injects, not a per-call throughput jump. + */ +@Fork(5) +@Warmup(iterations = 2) +@Measurement(iterations = 5) +@Threads(8) +public class SQLCommenterDuplicateCommentBenchmark { + + // Already-DD-commented SQL (append style, comment at the end). First needle hits at different + // depths: ddps first (cheap), traceparent-only (scans 8 before the match). + static final String[] SQL = { + "SELECT * FROM foo /*ddps='svc',dde='test',dddbs='mydb',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/", + "SELECT * FROM bar WHERE id = 42 /*traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-01'*/", + }; + + /** Per-thread cursor so threads don't contend on a shared index under {@code @Threads(8)}. */ + @State(Scope.Thread) + public static class Cursor { + int index = 0; + + String next() { + int i = index; + index = (i + 1) % SQL.length; + return SQL[i]; + } + } + + @Benchmark + public boolean alreadyCommented(Cursor cursor) { + // dbType=null skips the first-word scan; the DD comment makes inject return early after the + // duplicate-comment check -- the path (B) optimizes. Returns the input sql (no new String). + return SQLCommenter.inject(cursor.next(), "mydb", null, "h", "n", null, true) != null; + } +} diff --git a/dd-java-agent/instrumentation/jdbc/src/jmh/java/datadog/trace/instrumentation/jdbc/SQLCommenterGetFirstWordBenchmark.java b/dd-java-agent/instrumentation/jdbc/src/jmh/java/datadog/trace/instrumentation/jdbc/SQLCommenterGetFirstWordBenchmark.java new file mode 100644 index 00000000000..1c556646167 --- /dev/null +++ b/dd-java-agent/instrumentation/jdbc/src/jmh/java/datadog/trace/instrumentation/jdbc/SQLCommenterGetFirstWordBenchmark.java @@ -0,0 +1,82 @@ +package datadog.trace.instrumentation.jdbc; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.annotations.Warmup; + +/** + * Benchmark for {@link SQLCommenter#getFirstWord(String)} -- the per-{@code inject} first-word + * scan. + * + *

      What we're measuring. {@code getFirstWord} used to return {@code sql.substring(b, e)} -- + * a fresh {@code String} (with its own backing array) allocated on every {@code inject} call, just + * to {@code startsWith}/{@code equalsIgnoreCase} it. It now returns a zero-copy {@code SubSequence} + * view. The question is empirical: does escape analysis elide the view in the transient consumption + * (→ 0 B/op), while the old {@code substring} always allocated? + * + *

      Honest EA measurement. The view is consumed exactly as {@code inject} consumes it -- a + * boolean decision ({@code startsWith("{")}) -- and the benchmark returns that boolean. It does NOT + * return/Blackhole the view itself, which would force it to escape and fake away the very EA win + * under test. The chained {@code getFirstWord(sql).startsWith("{")} (no typed local) also lets one + * source compile both before (String.startsWith) and after (SubSequence.startsWith), so before/after + * is a clean toggle of the production method. + * + *

      Run at {@code @Threads(8)} so the allocation delta surfaces as throughput; {@code -prof gc} + * (gc.alloc.rate.norm) is the headline mechanism and is fork-stable. + * + *

      + *   ./gradlew :dd-java-agent:instrumentation:jdbc:jmh   # add -prof gc
      + * 
      + * + *

      Results (JDK 17, MacBook M-series, {@code @Threads(8)}, {@code @Fork(5)}, {@code -prof + * gc}): + * + *

      + *                        throughput            gc.alloc.rate.norm
      + *   before (substring)   258.1M ± 21.0M ops/s   48 B/op
      + *   after  (SubSequence) 508.0M ± 21.6M ops/s   ~0 B/op  (10^-4)
      + * 
      + * + * Escape analysis fully elides the view in the transient consumption (it never escapes the + * decision), so the per-call 48 B/op of the old {@code substring} (a String + its backing array) + * drops to ~0 and throughput rises ~2x at {@code @Threads(8)} — the allocation win surfacing as + * throughput. At {@code @Fork(5)} the error tightens (the earlier {@code @Fork(2)} spread was + * bimodal JIT, not signal); the allocation delta is exact and the throughput gap clears it. + */ +@Fork(5) +@Warmup(iterations = 2) +@Measurement(iterations = 5) +@Threads(8) +public class SQLCommenterGetFirstWordBenchmark { + + // Representative first-word shapes: plain keywords, a stored-proc brace, a CALL, leading space. + static final String[] SQL = { + "SELECT * FROM foo WHERE id = 42", + "{call dogshelterProc(?, ?)}", + "CALL dogshelterProc(?, ?)", + "UPDATE accounts SET balance = balance - 100 WHERE id = 42", + " INSERT INTO logs VALUES (?)", + }; + + /** Per-thread cursor so threads don't contend on a shared index under {@code @Threads(8)}. */ + @State(Scope.Thread) + public static class Cursor { + int index = 0; + + String next() { + int i = index; + index = (i + 1) % SQL.length; + return SQL[i]; + } + } + + @Benchmark + public boolean firstWordCheck(Cursor cursor) { + // Mirrors inject(): take the first word, make a boolean decision, discard it. + return SQLCommenter.getFirstWord(cursor.next()).startsWith("{"); + } +} diff --git a/dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/AbstractPreparedStatementInstrumentation.java b/dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/AbstractPreparedStatementInstrumentation.java index fc93e1c8edd..f24dcb8077a 100644 --- a/dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/AbstractPreparedStatementInstrumentation.java +++ b/dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/AbstractPreparedStatementInstrumentation.java @@ -86,7 +86,11 @@ public static AgentScope onEnter(@Advice.This final Statement statement) { // The span ID is pre-determined so that we can reference it when setting the context final long spanID = DECORATE.setContextInfo(connection, dbInfo); // we then force that pre-determined span ID for the span covering the actual query - span = AgentTracer.get().singleSpanBuilder(DATABASE_QUERY).withSpanId(spanID).start(); + span = + AgentTracer.get() + .singleSpanBuilder("java-jdbc-prepared_statement", DATABASE_QUERY) + .withSpanId(spanID) + .start(); span.setTag(DBM_TRACE_INJECTED, true); } else if (DECORATE.isPostgres(dbInfo) && DBM_TRACE_PREPARED_STATEMENTS) { span = startSpan("java-jdbc-prepared_statement", DATABASE_QUERY); diff --git a/dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/JDBCDecorator.java b/dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/JDBCDecorator.java index e9ead946cda..7914ef8d89c 100644 --- a/dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/JDBCDecorator.java +++ b/dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/JDBCDecorator.java @@ -1,5 +1,6 @@ package datadog.trace.instrumentation.jdbc; +import static datadog.trace.api.Config.DBM_PROPAGATION_MODE_DYNAMIC_SERVICE; import static datadog.trace.api.Config.DBM_PROPAGATION_MODE_FULL; import static datadog.trace.api.Config.DBM_PROPAGATION_MODE_STATIC; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; @@ -7,6 +8,7 @@ import static datadog.trace.bootstrap.instrumentation.api.InstrumentationTags.INSTRUMENTATION_TIME_MS; import static datadog.trace.bootstrap.instrumentation.api.Tags.*; +import datadog.context.ContextScope; import datadog.trace.api.BaseHash; import datadog.trace.api.Config; import datadog.trace.api.DDTraceId; @@ -14,7 +16,6 @@ import datadog.trace.api.propagation.W3CTraceParent; import datadog.trace.api.telemetry.LogCollector; import datadog.trace.bootstrap.ContextStore; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; import datadog.trace.bootstrap.instrumentation.api.InternalSpanTypes; @@ -60,7 +61,8 @@ public class JDBCDecorator extends DatabaseClientDecorator { Config.get().isExperimentalPropagateProcessTagsEnabled(); public static final boolean INJECT_COMMENT = DBM_PROPAGATION_MODE.equals(DBM_PROPAGATION_MODE_FULL) - || DBM_PROPAGATION_MODE.equals(DBM_PROPAGATION_MODE_STATIC); + || DBM_PROPAGATION_MODE.equals(DBM_PROPAGATION_MODE_STATIC) + || DBM_PROPAGATION_MODE.equals(DBM_PROPAGATION_MODE_DYNAMIC_SERVICE); private static final boolean INJECT_TRACE_CONTEXT = DBM_PROPAGATION_MODE.equals(DBM_PROPAGATION_MODE_FULL); public static final boolean DBM_TRACE_PREPARED_STATEMENTS = @@ -151,7 +153,7 @@ private void setTagIfPresent(final AgentSpan span, final String key, final Strin } } - public AgentSpan onConnection(final AgentSpan span, DBInfo dbInfo) { + public void onConnection(final AgentSpan span, DBInfo dbInfo) { if (dbInfo != null) { processDatabaseType(span, dbInfo.getType()); @@ -159,7 +161,7 @@ public AgentSpan onConnection(final AgentSpan span, DBInfo dbInfo) { setTagIfPresent(span, DB_SCHEMA, dbInfo.getSchema()); setTagIfPresent(span, DB_POOL_NAME, dbInfo.getPoolName()); } - return super.onConnection(span, dbInfo); + super.onConnection(span, dbInfo); } public static DBInfo parseDBInfo( @@ -234,27 +236,27 @@ public static DBInfo parseDBInfoFromConnection(final Connection connection) { clientInfo = connection.getClientInfo(); } catch (final Throwable ex) { // getClientInfo is likely not allowed, we can still extract info from the url alone - log.debug("Could not get client info from DB", ex); + log.debug(LogCollector.EXCLUDE_TELEMETRY, "Could not get client info from DB", ex); } dbInfo = JDBCConnectionUrlParser.extractDBInfo(url, clientInfo); } else { dbInfo = DBInfo.DEFAULT; } - } catch (final SQLException se) { + } catch (final Throwable se) { log.debug("Could not get metadata from DB", se); dbInfo = DBInfo.DEFAULT; } return dbInfo; } - public AgentSpan onStatement(AgentSpan span, final String statement) { + public void onStatement(AgentSpan span, final String statement) { onRawStatement(span, statement); DBQueryInfo dbQueryInfo = DBQueryInfo.ofStatement(statement); - return withQueryInfo(span, dbQueryInfo, JDBC_STATEMENT); + withQueryInfo(span, dbQueryInfo, JDBC_STATEMENT); } - public AgentSpan onPreparedStatement(AgentSpan span, DBQueryInfo dbQueryInfo) { - return withQueryInfo(span, dbQueryInfo, JDBC_PREPARED_STATEMENT); + public void onPreparedStatement(AgentSpan span, DBQueryInfo dbQueryInfo) { + withQueryInfo(span, dbQueryInfo, JDBC_PREPARED_STATEMENT); } /** @@ -267,15 +269,15 @@ public void withBaseHash(AgentSpan span) { } } - private AgentSpan withQueryInfo(AgentSpan span, DBQueryInfo info, CharSequence component) { + private void withQueryInfo(AgentSpan span, DBQueryInfo info, CharSequence component) { if (null != info) { span.setResourceName(info.getSql()); span.setTag(DB_OPERATION, info.getOperation()); } else { span.setResourceName(DB_QUERY); } - span.context().setIntegrationName(component); - return span.setTag(Tags.COMPONENT, component); + span.spanContext().setIntegrationName(component); + span.setTag(Tags.COMPONENT, component); } public boolean isOracle(final DBInfo dbInfo) { @@ -336,12 +338,12 @@ public long setContextInfo(Connection connection, DBInfo dbInfo) { // potentially get build span like here AgentSpan instrumentationSpan = AgentTracer.get() - .singleSpanBuilder("set context_info") + .singleSpanBuilder("java-jdbc", "set context_info") .withTag("dd.instrumentation", true) .start(); DECORATE.afterStart(instrumentationSpan); DECORATE.onConnection(instrumentationSpan, dbInfo); - try (AgentScope scope = activateSpan(instrumentationSpan)) { + try (ContextScope scope = activateSpan(instrumentationSpan)) { final byte samplingDecision = (byte) (instrumentationSpan.forceSamplingDecision() > 0 ? 1 : 0); final byte versionAndSamplingDecision = diff --git a/dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/SQLCommenter.java b/dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/SQLCommenter.java index 3171550aba3..e40b09e1a04 100644 --- a/dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/SQLCommenter.java +++ b/dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/SQLCommenter.java @@ -1,6 +1,7 @@ package datadog.trace.instrumentation.jdbc; import datadog.trace.bootstrap.instrumentation.dbm.SharedDBCommenter; +import datadog.trace.util.SubSequence; public class SQLCommenter { // SQL-specific constants, rest defined in SharedDBCommenter @@ -15,7 +16,17 @@ public class SQLCommenter { private static final int BUFFER_EXTRA = 4; private static final int SQL_COMMENT_OVERHEAD = SPACE_CHARS + COMMENT_DELIMITERS + BUFFER_EXTRA; - protected static String getFirstWord(String sql) { + /** + * Returns the first whitespace-delimited word of {@code sql} as a zero-copy {@link SubSequence} + * -- avoiding a substring allocation on every {@link #inject} call, since the callers only need + * to {@code startsWith}/{@code equalsIgnoreCase} it. + * + *

      Transient view -- do not retain. The returned {@code SubSequence} references the + * entire {@code sql} string, so holding onto it keeps the whole query reachable (a memory hazard + * for large SQL). Consume it in place and discard; if the value must be retained, call {@link + * SubSequence#toString()} to detach a standalone copy. + */ + protected static SubSequence getFirstWord(String sql) { int beginIndex = 0; while (beginIndex < sql.length() && Character.isWhitespace(sql.charAt(beginIndex))) { beginIndex++; @@ -24,7 +35,7 @@ protected static String getFirstWord(String sql) { while (endIndex < sql.length() && !Character.isWhitespace(sql.charAt(endIndex))) { endIndex++; } - return sql.substring(beginIndex, endIndex); + return SubSequence.of(sql, beginIndex, endIndex); } public static String inject( @@ -40,7 +51,7 @@ public static String inject( } boolean appendComment = preferAppend; if (dbType != null) { - final String firstWord = getFirstWord(sql); + final SubSequence firstWord = getFirstWord(sql); // The Postgres JDBC parser doesn't allow SQL comments anywhere in a JDBC // callable statements @@ -112,11 +123,6 @@ private static boolean hasDDComment(String sql, boolean appendComment) { return false; } - String commentContent = extractCommentContent(sql, appendComment); - return SharedDBCommenter.containsTraceComment(commentContent); - } - - private static String extractCommentContent(String sql, boolean appendComment) { int startIdx; int endIdx; if (appendComment) { @@ -127,9 +133,10 @@ private static String extractCommentContent(String sql, boolean appendComment) { endIdx = sql.indexOf(CLOSE_COMMENT); } if (startIdx != -1 && endIdx != -1 && endIdx > startIdx) { - return sql.substring(startIdx + OPEN_COMMENT_LEN, endIdx); + // Check the comment body in place -- no substring of the comment region. + return SharedDBCommenter.containsTraceComment(sql, startIdx + OPEN_COMMENT_LEN, endIdx); } - return ""; + return false; } /** diff --git a/dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/StatementInstrumentation.java b/dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/StatementInstrumentation.java index 5e565470572..5b5ec71b671 100644 --- a/dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/StatementInstrumentation.java +++ b/dd-java-agent/instrumentation/jdbc/src/main/java/datadog/trace/instrumentation/jdbc/StatementInstrumentation.java @@ -98,7 +98,11 @@ public static AgentScope onEnter( // The span ID is pre-determined so that we can reference it when setting the context final long spanID = DECORATE.setContextInfo(connection, dbInfo); // we then force that pre-determined span ID for the span covering the actual query - span = AgentTracer.get().singleSpanBuilder(DATABASE_QUERY).withSpanId(spanID).start(); + span = + AgentTracer.get() + .singleSpanBuilder("java-jdbc-statement", DATABASE_QUERY) + .withSpanId(spanID) + .start(); } else if (isOracle) { span = startSpan("java-jdbc-statement", DATABASE_QUERY); DECORATE.setAction(span, connection); diff --git a/dd-java-agent/instrumentation/jdbc/src/test/groovy/DBMInjectionForkedTest.groovy b/dd-java-agent/instrumentation/jdbc/src/test/groovy/DBMInjectionForkedTest.groovy index 466b2be6d3f..f7910e8bed6 100644 --- a/dd-java-agent/instrumentation/jdbc/src/test/groovy/DBMInjectionForkedTest.groovy +++ b/dd-java-agent/instrumentation/jdbc/src/test/groovy/DBMInjectionForkedTest.groovy @@ -2,7 +2,6 @@ import datadog.trace.agent.test.InstrumentationSpecification import datadog.trace.api.BaseHash import datadog.trace.api.DDSpanTypes import datadog.trace.api.ProcessTags -import datadog.trace.api.config.GeneralConfig import datadog.trace.api.config.TraceInstrumentationConfig import datadog.trace.api.config.TracerConfig import datadog.trace.bootstrap.instrumentation.api.Tags @@ -83,13 +82,49 @@ class DBMAppendInjectionForkedTest extends InjectionTest { } } +class DBMDynamicServiceInjectionForkedTest extends InjectionTest { + + @Override + void configurePreAgent() { + super.configurePreAgent() + // override to dynamic_service (InjectionTest sets full) + injectSysConfig(TraceInstrumentationConfig.DB_DBM_PROPAGATION_MODE_MODE, "dynamic_service") + } + + def "dynamic_service injects comment with base hash but no traceparent"() { + setup: + ProcessTags.reset() + BaseHash.updateBaseHash(123456789L) + def connection = new TestConnection(false) + + when: + def statement = connection.createStatement() as TestStatement + statement.executeQuery(query) + + then: + assert statement.sql.contains("ddps='my_service_name'") + assert statement.sql.contains("dddbs='remapped_testdb'") + assert statement.sql.contains("ddsh='123456789'") + assert !statement.sql.contains("traceparent=") + assertTraces(1) { + trace(1) { + span { + spanType DDSpanTypes.SQL + tags(false) { + "$Tags.BASE_HASH" "123456789" + } + } + } + } + } +} + class DBMBaseHashInjectionForkedTest extends InjectionTest { @Override void configurePreAgent() { super.configurePreAgent() injectSysConfig(TraceInstrumentationConfig.DB_DBM_INJECT_SQL_BASEHASH, "true") - injectSysConfig(GeneralConfig.EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED, "true") } def "base hash tag is set on span and matches the one in the SQL comment"() { diff --git a/dd-java-agent/instrumentation/jdbc/src/test/groovy/DriverInstrumentationMetadataFetchingTest.groovy b/dd-java-agent/instrumentation/jdbc/src/test/groovy/DriverInstrumentationMetadataFetchingTest.groovy index 43abf38721a..52495ff782c 100644 --- a/dd-java-agent/instrumentation/jdbc/src/test/groovy/DriverInstrumentationMetadataFetchingTest.groovy +++ b/dd-java-agent/instrumentation/jdbc/src/test/groovy/DriverInstrumentationMetadataFetchingTest.groovy @@ -131,14 +131,14 @@ abstract class DriverInstrumentationMetadataFetchingTestBase extends Instrumenta connection?.close() } - def "test driver connect with metadata exception"() { + def "test driver connect with metadata exception #exceptionType"() { setup: def originalUrl = "jdbc:postgresql://original-host:5432/originaldb" def testConnection = new TestConnection(false) { @Override DatabaseMetaData getMetaData() throws SQLException { - throw new SQLException("Test exception") + throw metadataException } } @@ -179,6 +179,11 @@ abstract class DriverInstrumentationMetadataFetchingTestBase extends Instrumenta cleanup: statement?.close() connection?.close() + + where: + exceptionType | metadataException + "SQLException" | new SQLException("Test exception") + "RuntimeException" | new RuntimeException("Test exception") } def "test driver connect with Oracle sharding driver"() { @@ -268,4 +273,3 @@ class DriverInstrumentationWithoutMetadataOnConnectForkedTest extends DriverInst return false } } - diff --git a/dd-java-agent/instrumentation/jdbc/src/test/groovy/IastJDBCTest.groovy b/dd-java-agent/instrumentation/jdbc/src/test/groovy/IastJDBCTest.groovy index bf2631f4939..822ded08797 100644 --- a/dd-java-agent/instrumentation/jdbc/src/test/groovy/IastJDBCTest.groovy +++ b/dd-java-agent/instrumentation/jdbc/src/test/groovy/IastJDBCTest.groovy @@ -1,14 +1,20 @@ import com.datadog.iast.taint.Ranges import com.datadog.iast.test.IastAgentTestRunner import com.datadog.iast.model.VulnerabilityBatch +import datadog.trace.api.iast.InstrumentationBridge +import datadog.trace.api.iast.sink.SqlInjectionModule import datadog.trace.core.DDSpan +import datadog.trace.instrumentation.jdbc.IastConnectionCallSite import foo.bar.IastInstrumentedConnection import foo.bar.IastInstrumentedStatement +import test.TestConnection import spock.lang.Shared import javax.sql.DataSource import java.sql.Connection +import java.sql.DatabaseMetaData +import java.sql.SQLException import java.sql.Statement class IastJDBCTest extends IastAgentTestRunner { @@ -121,4 +127,28 @@ class IastJDBCTest extends IastAgentTestRunner { value == 'SELECT id FROM TEST LIMIT 1' } } + + void 'metadata runtime exception does not report unexpected exception on connection method'() { + setup: + def previousModule = InstrumentationBridge.SQL_INJECTION + def module = Mock(SqlInjectionModule) + InstrumentationBridge.SQL_INJECTION = module + def sql = 'SELECT id FROM TEST LIMIT 1' + def connection = new TestConnection(false) { + @Override + DatabaseMetaData getMetaData() throws SQLException { + throw new RuntimeException('metadata exception') + } + } + + when: + IastConnectionCallSite.beforePrepare(connection, sql) + + then: + 1 * module.onJdbcQuery(sql, 'database') + 0 * module.onUnexpectedException(_, _) + + cleanup: + InstrumentationBridge.SQL_INJECTION = previousModule + } } diff --git a/dd-java-agent/instrumentation/jdbc/src/test/groovy/JDBCDecoratorTest.groovy b/dd-java-agent/instrumentation/jdbc/src/test/groovy/JDBCDecoratorTest.groovy index f08c7bda13b..645129636e3 100644 --- a/dd-java-agent/instrumentation/jdbc/src/test/groovy/JDBCDecoratorTest.groovy +++ b/dd-java-agent/instrumentation/jdbc/src/test/groovy/JDBCDecoratorTest.groovy @@ -68,3 +68,16 @@ class JDBCDecoratorNoPropagationForkedTest extends JDBCDecoratorTest { return false } } + +class JDBCDecoratorDynamicServicePropagationForkedTest extends JDBCDecoratorTest { + @Override + protected void setupPropagationMode() { + injectSysConfig(DB_DBM_PROPAGATION_MODE_MODE, "dynamic_service") + } + + @Override + protected boolean expectedFromConfig() { + // dynamic_service behaves like service mode: no trace context injection + return false + } +} diff --git a/dd-java-agent/instrumentation/jdbc/src/test/groovy/RemoteJDBCInstrumentationTest.groovy b/dd-java-agent/instrumentation/jdbc/src/test/groovy/RemoteJDBCInstrumentationTest.groovy index 616b38a456d..da27c427158 100644 --- a/dd-java-agent/instrumentation/jdbc/src/test/groovy/RemoteJDBCInstrumentationTest.groovy +++ b/dd-java-agent/instrumentation/jdbc/src/test/groovy/RemoteJDBCInstrumentationTest.groovy @@ -1,12 +1,22 @@ +import static DbType.MYSQL +import static DbType.ORACLE +import static DbType.POSTGRESQL +import static DbType.SQLSERVER import static datadog.trace.agent.test.utils.TraceUtils.basicSpan import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace import static datadog.trace.api.config.TraceInstrumentationConfig.DB_CLIENT_HOST_SPLIT_BY_INSTANCE import static datadog.trace.api.config.TraceInstrumentationConfig.DB_DBM_TRACE_PREPARED_STATEMENTS +import static java.util.concurrent.TimeUnit.SECONDS +import static org.junit.jupiter.api.Assumptions.assumeTrue +import static org.testcontainers.containers.MSSQLServerContainer.MS_SQL_SERVER_PORT +import static org.testcontainers.containers.MySQLContainer.MYSQL_PORT +import static org.testcontainers.containers.PostgreSQLContainer.POSTGRESQL_PORT import com.mchange.v2.c3p0.ComboPooledDataSource import com.microsoft.sqlserver.jdbc.SQLServerException import com.zaxxer.hikari.HikariConfig import com.zaxxer.hikari.HikariDataSource +import datadog.environment.OperatingSystem import datadog.trace.agent.test.naming.VersionedNamingTestBase import datadog.trace.agent.test.utils.PortUtils import datadog.trace.api.Config @@ -22,7 +32,6 @@ import java.sql.ResultSet import java.sql.Statement import java.sql.Types import java.time.Duration -import java.util.concurrent.TimeUnit import javax.sql.DataSource import org.testcontainers.containers.MSSQLServerContainer import org.testcontainers.containers.MySQLContainer @@ -31,50 +40,63 @@ import org.testcontainers.containers.PostgreSQLContainer import org.testcontainers.utility.DockerImageName import spock.lang.Shared -abstract class RemoteJDBCInstrumentationTest extends VersionedNamingTestBase { - static final String POSTGRESQL = "postgresql" - static final String MYSQL = "mysql" - static final String SQLSERVER = "sqlserver" - static final String ORACLE = "oracle" +enum DbType { + POSTGRESQL("postgresql"), + MYSQL("mysql"), + SQLSERVER("sqlserver"), + ORACLE("oracle") + + private final String name + + DbType(String name) { + this.name = name + } + + @Override + String toString() { + return name + } +} +abstract class RemoteJDBCInstrumentationTest extends VersionedNamingTestBase { @Shared - private Map dbName = [ + private Map dbName = [ (POSTGRESQL): "jdbcUnitTest", (MYSQL) : "jdbcUnitTest", (SQLSERVER) : "master", - (ORACLE) : "freepdb1", + (ORACLE) : "freepdb1", ] @Shared - private Map jdbcUrls = [ - (POSTGRESQL) : "jdbc:postgresql://localhost:5432/" + dbName.get(POSTGRESQL), - (MYSQL) : "jdbc:mysql://localhost:3306/" + dbName.get(MYSQL), - (SQLSERVER) : "jdbc:sqlserver://localhost:1433/" + dbName.get(SQLSERVER), - (ORACLE) : "jdbc:oracle:thin:@//localhost:1521/" + dbName.get(ORACLE), + private Map jdbcUrls = [ + (POSTGRESQL): "jdbc:postgresql://localhost:5432/${dbName.get(POSTGRESQL)}", + (MYSQL) : "jdbc:mysql://localhost:3306/${dbName.get(MYSQL)}", + (SQLSERVER) : "jdbc:sqlserver://localhost:1433/${dbName.get(SQLSERVER)}", + (ORACLE) : "jdbc:oracle:thin:@//localhost:1521/${dbName.get(ORACLE)}" ] @Shared - private Map jdbcDriverClassNames = [ + private Map jdbcDriverClassNames = [ (POSTGRESQL): "org.postgresql.Driver", (MYSQL) : "com.mysql.jdbc.Driver", (SQLSERVER) : "com.microsoft.sqlserver.jdbc.SQLServerDriver", - (ORACLE) : "oracle.jdbc.OracleDriver", + (ORACLE) : "oracle.jdbc.OracleDriver", ] @Shared - private Map jdbcUserNames = [ + private Map jdbcUserNames = [ (POSTGRESQL): "sa", (MYSQL) : "sa", - (SQLSERVER) : "sa", - (ORACLE) : "testuser", + (SQLSERVER) : "sa", + (ORACLE) : "testuser", ] @Shared - private Map jdbcPasswords = [ + private Map jdbcPasswords = [ (MYSQL) : "sa", (POSTGRESQL): "sa", (SQLSERVER) : "Datad0g_", - (ORACLE) : "testPassword", + (ORACLE) : "testPassword", ] @Shared @@ -88,31 +110,109 @@ abstract class RemoteJDBCInstrumentationTest extends VersionedNamingTestBase { // JDBC Connection pool name (i.e. HikariCP) -> Map @Shared - private Map> cpDatasources = new HashMap<>() + private Map> cpDatasources = new HashMap<>() - def peerConnectionProps(String db){ + private static boolean dockerImageSupported(DbType db) { + // MS SQL Server has no arm64 images. + return !(db == SQLSERVER + && OperatingSystem.isLinux() + && OperatingSystem.architecture().isArm64()) + } + + def peerConnectionProps(DbType db) { def props = new Properties() props.setProperty("user", jdbcUserNames.get(db)) props.setProperty("password", jdbcPasswords.get(db)) return props } - protected getDbType(String dbType){ - return dbType + protected String getDbType(DbType dbType) { + return dbType.toString() } - def prepareConnectionPoolDatasources() { - String[] connectionPoolNames = ["tomcat", "hikari", "c3p0",] - connectionPoolNames.each { cpName -> - Map dbDSMapping = new HashMap<>() - jdbcUrls.each { dbType, jdbcUrl -> - dbDSMapping.put(dbType, createDS(cpName, dbType, jdbcUrl)) - } - cpDatasources.put(cpName, dbDSMapping) + private String jdbcUrlFor(DbType db) { + startContainer(db) + return jdbcUrls.get(db) + } + + private void startContainer(DbType db) { + switch (db) { + case POSTGRESQL: + startPostgres() + return + case MYSQL: + startMysql() + return + case SQLSERVER: + startSqlserver() + return + case ORACLE: + startOracle() + return + } + + throw new IllegalArgumentException("Unsupported database: ${db}") + } + + private void startPostgres() { + if (postgres != null) { + return + } + + postgres = new PostgreSQLContainer("postgres:11.2") + .withDatabaseName(dbName.get(POSTGRESQL)) + .withUsername(jdbcUserNames.get(POSTGRESQL)) + .withPassword(jdbcPasswords.get(POSTGRESQL)) + postgres.start() + PortUtils.waitForPortToOpen(postgres.getHost(), postgres.getMappedPort(POSTGRESQL_PORT), 5, SECONDS) + jdbcUrls.put(POSTGRESQL, "${postgres.getJdbcUrl()}") + } + + private void startMysql() { + if (mysql != null) { + return } + + mysql = new MySQLContainer("mysql:8.0") + .withDatabaseName(dbName.get(MYSQL)) + .withUsername(jdbcUserNames.get(MYSQL)) + .withPassword(jdbcPasswords.get(MYSQL)) + // https://github.com/testcontainers/testcontainers-java/issues/914 + mysql.addParameter("TC_MY_CNF", null) + mysql.start() + PortUtils.waitForPortToOpen(mysql.getHost(), mysql.getMappedPort(MYSQL_PORT), 5, SECONDS) + jdbcUrls.put(MYSQL, "${mysql.getJdbcUrl()}") } - def createTomcatDS(String dbType, String jdbcUrl) { + private void startSqlserver() { + if (sqlserver != null) { + return + } + + sqlserver = new MSSQLServerContainer(MSSQLServerContainer.IMAGE) + .acceptLicense() + .withPassword(jdbcPasswords.get(SQLSERVER)) + sqlserver.start() + PortUtils.waitForPortToOpen(sqlserver.getHost(), sqlserver.getMappedPort(MS_SQL_SERVER_PORT), 5, SECONDS) + jdbcUrls.put(SQLSERVER, "${sqlserver.getJdbcUrl()};DatabaseName=${dbName.get(SQLSERVER)}") + } + + private void startOracle() { + if (oracle != null) { + return + } + + // Earlier Oracle version images (oracle-xe) don't work on arm64 + DockerImageName oracleImage = DockerImageName.parse("gvenzl/oracle-free:23.5-slim-faststart").asCompatibleSubstituteFor("gvenzl/oracle-xe") + oracle = new OracleContainer(oracleImage) + .withStartupTimeout(Duration.ofMinutes(5)) + .withUsername(jdbcUserNames.get(ORACLE)) + .withPassword(jdbcPasswords.get(ORACLE)) + oracle.start() + jdbcUrls.put(ORACLE, "${oracle.getJdbcUrl()}".replace("xepdb1", dbName.get(ORACLE))) + } + + def createTomcatDS(DbType dbType, String jdbcUrl) { DataSource ds = new org.apache.tomcat.jdbc.pool.DataSource() ds.setUrl(jdbcUrl) ds.setDriverClassName(jdbcDriverClassNames.get(dbType)) @@ -126,7 +226,7 @@ abstract class RemoteJDBCInstrumentationTest extends VersionedNamingTestBase { return ds } - def createHikariDS(String dbType, String jdbcUrl) { + def createHikariDS(DbType dbType, String jdbcUrl) { HikariConfig config = new HikariConfig() config.setJdbcUrl(jdbcUrl) String username = jdbcUserNames.get(dbType) @@ -142,11 +242,10 @@ abstract class RemoteJDBCInstrumentationTest extends VersionedNamingTestBase { return new HikariDataSource(config) } - def createC3P0DS(String dbType, String jdbcUrl) { + def createC3P0DS(DbType dbType, String jdbcUrl) { DataSource ds = new ComboPooledDataSource() ds.setDriverClass(jdbcDriverClassNames.get(dbType)) - def jdbcUrlToSet = dbType == "derby" ? jdbcUrl + ";create=true" : jdbcUrl - ds.setJdbcUrl(jdbcUrlToSet) + ds.setJdbcUrl(jdbcUrl) String username = jdbcUserNames.get(dbType) if (username != null) { ds.setUser(username) @@ -156,8 +255,9 @@ abstract class RemoteJDBCInstrumentationTest extends VersionedNamingTestBase { return ds } - def createDS(String connectionPoolName, String dbType, String jdbcUrl) { + def createDS(String connectionPoolName, DbType dbType, String jdbcUrl) { DataSource ds = null + if (connectionPoolName == "tomcat") { ds = createTomcatDS(dbType, jdbcUrl) } @@ -170,6 +270,21 @@ abstract class RemoteJDBCInstrumentationTest extends VersionedNamingTestBase { return ds } + private DataSource dataSourceFor(String pool, DbType db) { + Map dbDatasources = cpDatasources.get(pool) + if (dbDatasources == null) { + dbDatasources = new HashMap<>() + cpDatasources.put(pool, dbDatasources) + } + + DataSource datasource = dbDatasources.get(db) + if (datasource == null) { + datasource = createDS(pool, db, jdbcUrlFor(db)) + dbDatasources.put(db, datasource) + } + return datasource + } + @Override void configurePreAgent() { super.configurePreAgent() @@ -178,40 +293,6 @@ abstract class RemoteJDBCInstrumentationTest extends VersionedNamingTestBase { injectSysConfig("dd.integration.jdbc-datasource.enabled", "true") } - def setupSpec() { - // POSTGRESQL - postgres = new PostgreSQLContainer("postgres:11.2") - .withDatabaseName(dbName.get(POSTGRESQL)).withUsername(jdbcUserNames.get(POSTGRESQL)).withPassword(jdbcPasswords.get(POSTGRESQL)) - postgres.start() - PortUtils.waitForPortToOpen(postgres.getHost(), postgres.getMappedPort(PostgreSQLContainer.POSTGRESQL_PORT), 5, TimeUnit.SECONDS) - jdbcUrls.put(POSTGRESQL, "${postgres.getJdbcUrl()}") - - // MYSQL - mysql = new MySQLContainer("mysql:8.0") - .withDatabaseName(dbName.get(MYSQL)).withUsername(jdbcUserNames.get(MYSQL)).withPassword(jdbcPasswords.get(MYSQL)) - // https://github.com/testcontainers/testcontainers-java/issues/914 - mysql.addParameter("TC_MY_CNF", null) - mysql.start() - PortUtils.waitForPortToOpen(mysql.getHost(), mysql.getMappedPort(MySQLContainer.MYSQL_PORT), 5, TimeUnit.SECONDS) - jdbcUrls.put(MYSQL, "${mysql.getJdbcUrl()}") - - // SQLSERVER - sqlserver = new MSSQLServerContainer(MSSQLServerContainer.IMAGE).acceptLicense().withPassword(jdbcPasswords.get(SQLSERVER)) - sqlserver.start() - PortUtils.waitForPortToOpen(sqlserver.getHost(), sqlserver.getMappedPort(MSSQLServerContainer.MS_SQL_SERVER_PORT), 5, TimeUnit.SECONDS) - jdbcUrls.put(SQLSERVER, "${sqlserver.getJdbcUrl()};DatabaseName=${dbName.get(SQLSERVER)}") - - // ORACLE - // Earlier Oracle version images (oracle-xe) don't work on arm64 - DockerImageName oracleImage = DockerImageName.parse("gvenzl/oracle-free:23.5-slim-faststart").asCompatibleSubstituteFor("gvenzl/oracle-xe") - oracle = new OracleContainer(oracleImage) - .withStartupTimeout(Duration.ofMinutes(5)).withUsername(jdbcUserNames.get(ORACLE)).withPassword(jdbcPasswords.get(ORACLE)) - oracle.start() - jdbcUrls.put(ORACLE, "${oracle.getJdbcUrl()}".replace("xepdb1", dbName.get(ORACLE))) - - prepareConnectionPoolDatasources() - } - def cleanupSpec() { cpDatasources.values().each { it.values().each { datasource -> @@ -375,7 +456,7 @@ abstract class RemoteJDBCInstrumentationTest extends VersionedNamingTestBase { resultSet.next() resultSet.getInt(1) == 3 def addDbmTag = dbmTraceInjected() - if (driver == SQLSERVER && addDbmTag){ + if (driver == SQLSERVER && addDbmTag) { assertTraces(1) { trace(3) { basicSpan(it, "parent") @@ -458,7 +539,7 @@ abstract class RemoteJDBCInstrumentationTest extends VersionedNamingTestBase { if (usingHikari) { "$Tags.DB_POOL_NAME" String } - if (this.dbmTracePreparedStatements(this.getDbType(driver))){ + if (this.dbmTracePreparedStatements(driver)) { "$InstrumentationTags.DBM_TRACE_INJECTED" true if (driver == POSTGRESQL) { "$InstrumentationTags.INSTRUMENTATION_TIME_MS" Long @@ -478,22 +559,22 @@ abstract class RemoteJDBCInstrumentationTest extends VersionedNamingTestBase { where: driver | pool | query | operation | obfuscatedQuery | usingHikari - MYSQL | null | "SELECT 3" | "SELECT" | "SELECT ?" | false - POSTGRESQL | null | "SELECT 3 from pg_user" | "SELECT" | "SELECT ? from pg_user" | false - SQLSERVER | null | "SELECT 3" | "SELECT" | "SELECT ?" | false - ORACLE | null | "SELECT 3 FROM dual" | "SELECT" | "SELECT ? FROM dual" | false - MYSQL | "tomcat" | "SELECT 3" | "SELECT" | "SELECT ?" | false - POSTGRESQL | "tomcat" | "SELECT 3 from pg_user" | "SELECT" | "SELECT ? from pg_user" | false - SQLSERVER | "tomcat" | "SELECT 3" | "SELECT" | "SELECT ?" | false - ORACLE | "tomcat" | "SELECT 3 FROM dual" | "SELECT" | "SELECT ? FROM dual" | false - MYSQL | "hikari" | "SELECT 3" | "SELECT" | "SELECT ?" | true - POSTGRESQL | "hikari" | "SELECT 3 from pg_user" | "SELECT" | "SELECT ? from pg_user" | true - SQLSERVER | "hikari" | "SELECT 3" | "SELECT" | "SELECT ?" | true - ORACLE | "hikari" | "SELECT 3 FROM dual" | "SELECT" | "SELECT ? FROM dual" | true - MYSQL | "c3p0" | "SELECT 3" | "SELECT" | "SELECT ?" | false - POSTGRESQL | "c3p0" | "SELECT 3 from pg_user" | "SELECT" | "SELECT ? from pg_user" | false - SQLSERVER | "c3p0" | "SELECT 3" | "SELECT" | "SELECT ?" | false - ORACLE | "c3p0" | "SELECT 3 FROM dual" | "SELECT" | "SELECT ? FROM dual" | false + MYSQL | null | "SELECT 3" | "SELECT" | "SELECT ?" | false + POSTGRESQL | null | "SELECT 3 from pg_user" | "SELECT" | "SELECT ? from pg_user" | false + SQLSERVER | null | "SELECT 3" | "SELECT" | "SELECT ?" | false + ORACLE | null | "SELECT 3 FROM dual" | "SELECT" | "SELECT ? FROM dual" | false + MYSQL | "tomcat" | "SELECT 3" | "SELECT" | "SELECT ?" | false + POSTGRESQL | "tomcat" | "SELECT 3 from pg_user" | "SELECT" | "SELECT ? from pg_user" | false + SQLSERVER | "tomcat" | "SELECT 3" | "SELECT" | "SELECT ?" | false + ORACLE | "tomcat" | "SELECT 3 FROM dual" | "SELECT" | "SELECT ? FROM dual" | false + MYSQL | "hikari" | "SELECT 3" | "SELECT" | "SELECT ?" | true + POSTGRESQL | "hikari" | "SELECT 3 from pg_user" | "SELECT" | "SELECT ? from pg_user" | true + SQLSERVER | "hikari" | "SELECT 3" | "SELECT" | "SELECT ?" | true + ORACLE | "hikari" | "SELECT 3 FROM dual" | "SELECT" | "SELECT ? FROM dual" | true + MYSQL | "c3p0" | "SELECT 3" | "SELECT" | "SELECT ?" | false + POSTGRESQL | "c3p0" | "SELECT 3 from pg_user" | "SELECT" | "SELECT ? from pg_user" | false + SQLSERVER | "c3p0" | "SELECT 3" | "SELECT" | "SELECT ?" | false + ORACLE | "c3p0" | "SELECT 3 FROM dual" | "SELECT" | "SELECT ? FROM dual" | false } def "prepared statement query on #driver with #pool generates a span"() { @@ -512,7 +593,7 @@ abstract class RemoteJDBCInstrumentationTest extends VersionedNamingTestBase { resultSet.getInt(1) == 3 def addDbmTag = dbmTraceInjected() - if (driver == SQLSERVER && addDbmTag){ + if (driver == SQLSERVER && addDbmTag) { assertTraces(1) { trace(3) { basicSpan(it, "parent") @@ -597,7 +678,7 @@ abstract class RemoteJDBCInstrumentationTest extends VersionedNamingTestBase { if (pool == "hikari") { "$Tags.DB_POOL_NAME" String } - if (this.dbmTracePreparedStatements(driver)){ + if (this.dbmTracePreparedStatements(driver)) { "$InstrumentationTags.DBM_TRACE_INJECTED" true if (driver == POSTGRESQL) { "$InstrumentationTags.INSTRUMENTATION_TIME_MS" Long @@ -616,23 +697,23 @@ abstract class RemoteJDBCInstrumentationTest extends VersionedNamingTestBase { connection.close() where: - driver | pool | query | operation | obfuscatedQuery - MYSQL | null | "SELECT 3" | "SELECT" | "SELECT ?" - POSTGRESQL | null | "SELECT 3 from pg_user" | "SELECT" | "SELECT ? from pg_user" - SQLSERVER | null | "SELECT 3" | "SELECT" | "SELECT ?" - ORACLE | null | "SELECT 3 FROM dual" | "SELECT" | "SELECT ? FROM dual" - MYSQL | "tomcat" | "SELECT 3" | "SELECT" | "SELECT ?" - POSTGRESQL | "tomcat" | "SELECT 3 from pg_user" | "SELECT" | "SELECT ? from pg_user" - SQLSERVER | "tomcat" | "SELECT 3" | "SELECT" | "SELECT ?" - ORACLE | "tomcat" | "SELECT 3 FROM dual" | "SELECT" | "SELECT ? FROM dual" - MYSQL | "hikari" | "SELECT 3" | "SELECT" | "SELECT ?" - POSTGRESQL | "hikari" | "SELECT 3 from pg_user" | "SELECT" | "SELECT ? from pg_user" - SQLSERVER | "hikari" | "SELECT 3" | "SELECT" | "SELECT ?" - ORACLE | "hikari" | "SELECT 3 FROM dual" | "SELECT" | "SELECT ? FROM dual" - MYSQL | "c3p0" | "SELECT 3" | "SELECT" | "SELECT ?" - POSTGRESQL | "c3p0" | "SELECT 3 from pg_user" | "SELECT" | "SELECT ? from pg_user" - SQLSERVER | "c3p0" | "SELECT 3" | "SELECT" | "SELECT ?" - ORACLE | "c3p0" | "SELECT 3 FROM dual" | "SELECT" | "SELECT ? FROM dual" + driver | pool | query | operation | obfuscatedQuery + MYSQL | null | "SELECT 3" | "SELECT" | "SELECT ?" + POSTGRESQL | null | "SELECT 3 from pg_user" | "SELECT" | "SELECT ? from pg_user" + SQLSERVER | null | "SELECT 3" | "SELECT" | "SELECT ?" + ORACLE | null | "SELECT 3 FROM dual" | "SELECT" | "SELECT ? FROM dual" + MYSQL | "tomcat" | "SELECT 3" | "SELECT" | "SELECT ?" + POSTGRESQL | "tomcat" | "SELECT 3 from pg_user" | "SELECT" | "SELECT ? from pg_user" + SQLSERVER | "tomcat" | "SELECT 3" | "SELECT" | "SELECT ?" + ORACLE | "tomcat" | "SELECT 3 FROM dual" | "SELECT" | "SELECT ? FROM dual" + MYSQL | "hikari" | "SELECT 3" | "SELECT" | "SELECT ?" + POSTGRESQL | "hikari" | "SELECT 3 from pg_user" | "SELECT" | "SELECT ? from pg_user" + SQLSERVER | "hikari" | "SELECT 3" | "SELECT" | "SELECT ?" + ORACLE | "hikari" | "SELECT 3 FROM dual" | "SELECT" | "SELECT ? FROM dual" + MYSQL | "c3p0" | "SELECT 3" | "SELECT" | "SELECT ?" + POSTGRESQL | "c3p0" | "SELECT 3 from pg_user" | "SELECT" | "SELECT ? from pg_user" + SQLSERVER | "c3p0" | "SELECT 3" | "SELECT" | "SELECT ?" + ORACLE | "c3p0" | "SELECT 3 FROM dual" | "SELECT" | "SELECT ? FROM dual" } def "prepared call on #driver with #pool generates a span"() { @@ -650,7 +731,7 @@ abstract class RemoteJDBCInstrumentationTest extends VersionedNamingTestBase { resultSet.next() resultSet.getInt(1) == 3 def addDbmTag = dbmTraceInjected() - if (driver == SQLSERVER && addDbmTag){ + if (driver == SQLSERVER && addDbmTag) { assertTraces(1) { trace(3) { basicSpan(it, "parent") @@ -730,7 +811,7 @@ abstract class RemoteJDBCInstrumentationTest extends VersionedNamingTestBase { if (pool == "hikari") { "$Tags.DB_POOL_NAME" String } - if (this.dbmTracePreparedStatements(this.getDbType(driver))){ + if (this.dbmTracePreparedStatements(driver)) { "$InstrumentationTags.DBM_TRACE_INJECTED" true if (driver == POSTGRESQL) { "$InstrumentationTags.INSTRUMENTATION_TIME_MS" Long @@ -942,7 +1023,7 @@ abstract class RemoteJDBCInstrumentationTest extends VersionedNamingTestBase { Connection connection = setupConnection(pool, driver) String createSql - if (driver == "postgresql") { + if (driver == POSTGRESQL) { createSql = """ CREATE OR REPLACE PROCEDURE dummy(inout res integer) @@ -951,7 +1032,7 @@ abstract class RemoteJDBCInstrumentationTest extends VersionedNamingTestBase { SELECT 1; \$\$; """ - } else if (driver == "mysql") { + } else if (driver == MYSQL) { createSql = """ CREATE PROCEDURE IF NOT EXISTS dummy(inout res int) @@ -959,7 +1040,7 @@ abstract class RemoteJDBCInstrumentationTest extends VersionedNamingTestBase { SELECT 1; END """ - } else if (driver == "sqlserver") { + } else if (driver == SQLSERVER) { createSql = """ CREATE PROCEDURE dummy @res integer output @@ -972,7 +1053,7 @@ abstract class RemoteJDBCInstrumentationTest extends VersionedNamingTestBase { assert false } - if (driver.equals("postgresql") && connection.getMetaData().getDatabaseMajorVersion() <= 11) { + if (driver == POSTGRESQL && connection.getMetaData().getDatabaseMajorVersion() <= 11) { // Skip test for older versions of PG that don't support out on procedure return } @@ -984,7 +1065,7 @@ abstract class RemoteJDBCInstrumentationTest extends VersionedNamingTestBase { injectSysConfig("dd.dbm.propagation.mode", "full") CallableStatement proc = connection.prepareCall(query) - proc.setInt(1,1) + proc.setInt(1, 1) proc.registerOutParameter(1, Types.INTEGER) when: runUnderTrace("parent") { @@ -1017,16 +1098,14 @@ abstract class RemoteJDBCInstrumentationTest extends VersionedNamingTestBase { SQLSERVER | null | "{CALL dummy(?)}" } - Driver driverFor(String db) { - return newDriver(jdbcDriverClassNames.get(db)) + Connection connectTo(DbType db, Properties properties) { + return connect(jdbcDriverClassNames.get(db), jdbcUrlFor(db), properties) } - Connection connectTo(String db, Properties properties) { - return connect(jdbcDriverClassNames.get(db), jdbcUrls.get(db), properties) - } + Connection setupConnection(String pool, DbType db) { + assumeTrue(dockerImageSupported(db)) - Connection setupConnection(String pool, String db) { - def conn = pool ? cpDatasources.get(pool).get(db).getConnection() : connectTo(db, peerConnectionProps(db)) + def conn = pool ? dataSourceFor(pool, db).getConnection() : connectTo(db, peerConnectionProps(db)) // Clear any traces that pool or db can emmit on connection creation. TEST_WRITER.clear() @@ -1054,13 +1133,13 @@ abstract class RemoteJDBCInstrumentationTest extends VersionedNamingTestBase { return null } - protected abstract String service(String dbType) + protected abstract String service(DbType dbType) protected abstract String operation(String dbType) protected abstract boolean dbmTraceInjected() - protected abstract boolean dbmTracePreparedStatements(String dbType) + protected abstract boolean dbmTracePreparedStatements(DbType dbType) } class RemoteJDBCInstrumentationV0Test extends RemoteJDBCInstrumentationTest { @@ -1071,8 +1150,8 @@ class RemoteJDBCInstrumentationV0Test extends RemoteJDBCInstrumentationTest { } @Override - protected String service(String dbType) { - return dbType + protected String service(DbType dbType) { + return dbType.toString() } @Override @@ -1086,7 +1165,7 @@ class RemoteJDBCInstrumentationV0Test extends RemoteJDBCInstrumentationTest { } @Override - protected boolean dbmTracePreparedStatements(String dbType) { + protected boolean dbmTracePreparedStatements(DbType dbType) { return false } } @@ -1099,7 +1178,7 @@ class RemoteJDBCInstrumentationV1ForkedTest extends RemoteJDBCInstrumentationTes } @Override - protected String service(String dbType) { + protected String service(DbType dbType) { return Config.get().getServiceName() } @@ -1114,14 +1193,14 @@ class RemoteJDBCInstrumentationV1ForkedTest extends RemoteJDBCInstrumentationTes } @Override - protected boolean dbmTracePreparedStatements(String dbType) { + protected boolean dbmTracePreparedStatements(DbType dbType) { return false } @Override - protected String getDbType(String dbType) { + protected String getDbType(DbType dbType) { final databaseNaming = new DatabaseNamingV1() - return databaseNaming.normalizedName(dbType) + return databaseNaming.normalizedName(dbType.toString()) } } @@ -1139,7 +1218,7 @@ class RemoteDBMTraceInjectedForkedTest extends RemoteJDBCInstrumentationTest { } @Override - protected boolean dbmTracePreparedStatements(String dbType){ + protected boolean dbmTracePreparedStatements(DbType dbType) { return dbType == ORACLE } @@ -1149,7 +1228,7 @@ class RemoteDBMTraceInjectedForkedTest extends RemoteJDBCInstrumentationTest { } @Override - protected String service(String dbType) { + protected String service(DbType dbType) { return Config.get().getServiceName() } @@ -1159,9 +1238,9 @@ class RemoteDBMTraceInjectedForkedTest extends RemoteJDBCInstrumentationTest { } @Override - protected String getDbType(String dbType) { + protected String getDbType(DbType dbType) { final databaseNaming = new DatabaseNamingV1() - return databaseNaming.normalizedName(dbType) + return databaseNaming.normalizedName(dbType.toString()) } def "Oracle DBM comment contains instance name in dddbs and dddb, not generic type string"() { @@ -1222,7 +1301,7 @@ class RemoteDBMTraceInjectedForkedTestTracePreparedStatements extends RemoteJDBC } @Override - protected String service(String dbType) { + protected String service(DbType dbType) { return Config.get().getServiceName() } @@ -1232,13 +1311,13 @@ class RemoteDBMTraceInjectedForkedTestTracePreparedStatements extends RemoteJDBC } @Override - protected String getDbType(String dbType) { + protected String getDbType(DbType dbType) { final databaseNaming = new DatabaseNamingV1() - return databaseNaming.normalizedName(dbType) + return databaseNaming.normalizedName(dbType.toString()) } @Override - protected boolean dbmTracePreparedStatements(String dbType){ + protected boolean dbmTracePreparedStatements(DbType dbType) { return dbType == POSTGRESQL || dbType == ORACLE } } diff --git a/dd-java-agent/instrumentation/jdbc/src/test/groovy/SQLCommenterTest.groovy b/dd-java-agent/instrumentation/jdbc/src/test/groovy/SQLCommenterTest.groovy deleted file mode 100644 index 9d843ad8bf5..00000000000 --- a/dd-java-agent/instrumentation/jdbc/src/test/groovy/SQLCommenterTest.groovy +++ /dev/null @@ -1,171 +0,0 @@ -import datadog.trace.agent.test.InstrumentationSpecification -import datadog.trace.api.BaseHash -import datadog.trace.api.Config -import datadog.trace.api.ProcessTags -import datadog.trace.bootstrap.instrumentation.api.AgentSpan -import datadog.trace.bootstrap.instrumentation.api.AgentTracer -import datadog.trace.bootstrap.instrumentation.api.Tags -import datadog.trace.instrumentation.jdbc.SQLCommenter - -import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace - -class SQLCommenterTest extends InstrumentationSpecification { - - def "test find first word"() { - setup: - - when: - String word = SQLCommenter.getFirstWord(sql) - - then: - word == firstWord - - where: - sql | firstWord - "SELECT *" | "SELECT" - " { " | "{" - "{" | "{" - "{call" | "{call" - "{ call" | "{" - "CALL ( ? )" | "CALL" - "" | "" - " " | "" - } - - def "test encode Sql Comment"() { - setup: - injectSysConfig("dd.service", ddService) - injectSysConfig("dd.env", ddEnv) - injectSysConfig("dd.version", ddVersion) - - when: - String sqlWithComment = SQLCommenter.inject(query, dbService, dbType, host, dbName, traceParent, append) - - then: - sqlWithComment == expected - - where: - query | ddService | ddEnv | dbService | dbType | host | dbName | ddVersion | append | traceParent | expected - "SELECT * FROM foo" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | true | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "SELECT * FROM foo /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/" - "SELECT * FROM foo;" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | true | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "SELECT * FROM foo /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/;" - "SELECT * FROM foo; \t\n\r" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | true | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "SELECT * FROM foo /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/;" - "SELECT * FROM foo; SELECT * FROM bar" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | true | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "SELECT * FROM foo; SELECT * FROM bar /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/" - "SELECT * FROM foo; SELECT * FROM bar; " | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | true | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "SELECT * FROM foo; SELECT * FROM bar /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/;" - "SELECT * FROM foo" | "SqlCommenter" | "Test" | "my-service" | "postgres" | "h" | "n" | "TestVersion" | true | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "SELECT * FROM foo /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/" - "{call dogshelterProc(?, ?)}" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | true | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "{call dogshelterProc(?, ?)} /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/" - "{call dogshelterProc(?, ?)}" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | false | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "{call dogshelterProc(?, ?)} /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/" - "{call dogshelterProc(?, ?)}" | "SqlCommenter" | "Test" | "my-service" | "postgres" | "h" | "n" | "TestVersion" | true | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "{call dogshelterProc(?, ?)}" - "CALL dogshelterProc(?, ?)" | "SqlCommenter" | "Test" | "my-service" | "postgres" | "h" | "n" | "TestVersion" | false | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "CALL dogshelterProc(?, ?) /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/" - "CALL dogshelterProc(?, ?)" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | false | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "CALL dogshelterProc(?, ?) /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/" - "SELECT * FROM foo" | "" | "Test" | "" | "mysql" | "h" | "n" | "TestVersion" | true | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "SELECT * FROM foo /*ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/" - "SELECT * FROM foo" | "" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | true | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "SELECT * FROM foo /*dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/" - "SELECT * FROM foo" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "" | "" | "TestVersion" | true | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "SELECT * FROM foo /*ddps='SqlCommenter',dddbs='my-service',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/" - "SELECT * FROM foo" | "" | "Test" | "" | "" | "h" | "n" | "" | true | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "SELECT * FROM foo /*ddh='h',dddb='n',dde='Test',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/" - "SELECT * FROM foo" | "" | "" | "" | "" | "h" | "n" | "" | true | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "SELECT * FROM foo /*ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/" - "SELECT * FROM foo" | "" | "" | "" | "" | "" | "" | "" | true | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "SELECT * FROM foo /*traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/" - "SELECT * from FOO -- test query" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | true | "00-00000000000000007fffffffffffffff-000000024cb016ea-01" | "SELECT * from FOO -- test query /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-01'*/" - "SELECT /* customer-comment */ * FROM foo" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | true | "00-00000000000000007fffffffffffffff-000000024cb016ea-01" | "SELECT /* customer-comment */ * FROM foo /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-01'*/" - "SELECT * FROM foo" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | true | null | "SELECT * FROM foo /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion'*/" - "SELECT * FROM DUAL" | "SqlCommenter" | "Test" | "my-service" | "oracle" | "h" | "n" | "TestVersion" | true | null | "SELECT * FROM DUAL /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion'*/" - "SELECT * FROM sys.tables" | "SqlCommenter" | "Test" | "my-service" | "sqlserver"| "h" | "n" | "TestVersion" | true | null | "SELECT * FROM sys.tables /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion'*/" - "SELECT /* customer-comment */ * FROM foo" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | true | null | "SELECT /* customer-comment */ * FROM foo /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion'*/" - "SELECT * from FOO -- test query" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | true | null | "SELECT * from FOO -- test query /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion'*/" - "" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | true | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "" - " " | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | true | "00-00000000000000007fffffffffffffff-000000024cb016ea-01" | " /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-01'*/" - "" | "SqlCommenter" | "Test" | "postgres" | "mysql" | "h" | "n" | "TestVersion" | true | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "" - " " | "SqlCommenter" | "Test" | "postgres" | "mysql" | "h" | "n" | "TestVersion" | true | "00-00000000000000007fffffffffffffff-000000024cb016ea-01" | " /*ddps='SqlCommenter',dddbs='postgres',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-01'*/" - "SELECT * FROM foo /*dddbs='my-service',ddh='h',dddb='n',dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | true | null | "SELECT * FROM foo /*dddbs='my-service',ddh='h',dddb='n',dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/" - "SELECT * FROM foo /*ddh='h',dddb='n',dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | true | null | "SELECT * FROM foo /*ddh='h',dddb='n',dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/" - "SELECT * FROM foo /*dddb='n',dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | true | null | "SELECT * FROM foo /*dddb='n',dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/" - "SELECT * FROM foo /*dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | true | null | "SELECT * FROM foo /*dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/" - "SELECT * FROM foo /*ddps='SqlCommenter',ddpv='TestVersion'*/" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | true | null | "SELECT * FROM foo /*ddps='SqlCommenter',ddpv='TestVersion'*/" - "SELECT * FROM foo /*ddpv='TestVersion'*/" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | true | null | "SELECT * FROM foo /*ddpv='TestVersion'*/" - "/*ddjk its a customer */ SELECT * FROM foo" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | true | null | "/*ddjk its a customer */ SELECT * FROM foo /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion'*/" - "SELECT * FROM foo /*traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-01'*/" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | true | null | "SELECT * FROM foo /*traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-01'*/" - "/*customer-comment*/ SELECT * FROM foo" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | true | null | "/*customer-comment*/ SELECT * FROM foo /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion'*/" - "/*traceparent" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | true | null | "/*traceparent /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion'*/" - "SELECT * FROM foo" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | false | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "/*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/ SELECT * FROM foo" - "SELECT * FROM foo" | "" | "Test" | "" | "mysql" | "h" | "n" | "TestVersion" | false | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "/*ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/ SELECT * FROM foo" - "SELECT * FROM foo" | "" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | false | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "/*dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/ SELECT * FROM foo" - "SELECT * FROM foo" | "" | "Test" | "" | "" | "h" | "n" | "" | false | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "/*ddh='h',dddb='n',dde='Test',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/ SELECT * FROM foo" - "SELECT * FROM foo" | "" | "" | "" | "" | "" | "" | "" | false | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "/*traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/ SELECT * FROM foo" - "SELECT * from FOO -- test query" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | false | "00-00000000000000007fffffffffffffff-000000024cb016ea-01" | "/*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-01'*/ SELECT * from FOO -- test query" - "SELECT /* customer-comment */ * FROM foo" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | false | "00-00000000000000007fffffffffffffff-000000024cb016ea-01" | "/*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-01'*/ SELECT /* customer-comment */ * FROM foo" - "SELECT * FROM foo" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | false | null | "/*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion'*/ SELECT * FROM foo" - "SELECT /* customer-comment */ * FROM foo" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | false | null | "/*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion'*/ SELECT /* customer-comment */ * FROM foo" - "SELECT * from FOO -- test query" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | false | null | "/*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion'*/ SELECT * from FOO -- test query" - "" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | false | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "" - " " | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | false | "00-00000000000000007fffffffffffffff-000000024cb016ea-01" | "/*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-01'*/ " - "/*dddbs='my-service',ddh='h',dddb='n',dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/ SELECT * FROM foo" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | false | null | "/*dddbs='my-service',ddh='h',dddb='n',dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/ SELECT * FROM foo" - "/*ddh='h',dddb='n',dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/ SELECT * FROM foo" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | false | null | "/*ddh='h',dddb='n',dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/ SELECT * FROM foo" - "/*dddb='n',dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/ SELECT * FROM foo" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | false | null | "/*dddb='n',dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/ SELECT * FROM foo" - "/*dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/ SELECT * FROM foo" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | false | null | "/*dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/ SELECT * FROM foo" - "/*ddps='SqlCommenter',ddpv='TestVersion'*/ SELECT * FROM foo" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | false | null | "/*ddps='SqlCommenter',ddpv='TestVersion'*/ SELECT * FROM foo" - "/*ddpv='TestVersion'*/ SELECT * FROM foo" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | false | null | "/*ddpv='TestVersion'*/ SELECT * FROM foo" - "/*ddjk its a customer */ SELECT * FROM foo" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | false | null | "/*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion'*/ /*ddjk its a customer */ SELECT * FROM foo" - "/*traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-01'*/ SELECT * FROM foo" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | false | null | "/*traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-01'*/ SELECT * FROM foo" - "/*customer-comment*/ SELECT * FROM foo" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | false | null | "/*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion'*/ /*customer-comment*/ SELECT * FROM foo" - "/*traceparent" | "SqlCommenter" | "Test" | "my-service" | "mysql" | "h" | "n" | "TestVersion" | false | null | "/*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion'*/ /*traceparent" - "SELECT /*+ SeqScan(foo) */ * FROM foo" | "SqlCommenter" | "Test" | "my-service" | "postgres" | "h" | "n" | "TestVersion" | true | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "SELECT /*+ SeqScan(foo) */ * FROM foo /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/" - "/*+ SeqScan(foo) */ SELECT * FROM foo" | "SqlCommenter" | "Test" | "my-service" | "postgres" | "h" | "n" | "TestVersion" | true | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "/*+ SeqScan(foo) */ SELECT * FROM foo /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/" - "/*+ SeqScan(foo) */ SELECT * FROM foo" | "SqlCommenter" | "Test" | "my-service" | "postgres" | "h" | "n" | "TestVersion" | true | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "/*+ SeqScan(foo) */ SELECT * FROM foo /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/" - "/*+ SeqScan(foo) */ SELECT * FROM foo" | "SqlCommenter" | "Test" | "my-service" | "postgres" | "h" | "n" | "TestVersion" | false | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "/*+ SeqScan(foo) */ SELECT * FROM foo /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/" - "/*+ SeqScan(foo) */ SELECT * FROM foo /*ddps=''*/" | "SqlCommenter" | "Test" | "my-service" | "postgres" | "h" | "n" | "TestVersion" | false | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "/*+ SeqScan(foo) */ SELECT * FROM foo /*ddps=''*/" - "/*+ SeqScan(foo) */ SELECT * FROM foo /*ddps=''*/" | "SqlCommenter" | "Test" | "my-service" | "postgres" | "h" | "n" | "TestVersion" | true | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "/*+ SeqScan(foo) */ SELECT * FROM foo /*ddps=''*/" - "CALL dogshelterProc(?, ?) /*ddps=''*/" | "SqlCommenter" | "Test" | "my-service" | "postgres" | "h" | "n" | "TestVersion" | false | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "CALL dogshelterProc(?, ?) /*ddps=''*/" - "CALL dogshelterProc(?, ?) /*ddps=''*/" | "SqlCommenter" | "Test" | "my-service" | "postgres" | "h" | "n" | "TestVersion" | true | "00-00000000000000007fffffffffffffff-000000024cb016ea-00" | "CALL dogshelterProc(?, ?) /*ddps=''*/" - } - - def "inject base hash"() { - setup: - injectSysConfig("dd.service", srv) - injectSysConfig("dd.env", "") - injectSysConfig("dbm.inject.sql.basehash", Boolean.toString(injectHash)) - injectSysConfig("dd.experimental.propagate.process.tags.enabled", Boolean.toString(processTagsEnabled)) - ProcessTags.reset() - BaseHash.updateBaseHash(baseHash) - - expect: - Config.get().isExperimentalPropagateProcessTagsEnabled() == processTagsEnabled - and: - SQLCommenter.inject(query, "", "", "", "", "", false) == result - - where: - query | injectHash | baseHash | processTagsEnabled | srv | result - "SELECT *" | true | 234563 | false | "" | "SELECT *" - "SELECT *" | true | 234563 | true | "" | "/*ddsh='234563'*/ SELECT *" - "SELECT *" | true | 345342 | false | "" | "SELECT *" - "SELECT *" | true | 345342 | true | "" | "/*ddsh='345342'*/ SELECT *" - "SELECT *" | true | 234563 | false | "srv" | "/*ddps='srv'*/ SELECT *" - "SELECT *" | true | 234563 | true | "srv" | "/*ddps='srv',ddsh='234563'*/ SELECT *" - "SELECT *" | true | 345342 | false | "srv" | "/*ddps='srv'*/ SELECT *" - "SELECT *" | true | 345342 | true | "srv" | "/*ddps='srv',ddsh='345342'*/ SELECT *" - "SELECT *" | false | 234563 | true | "" | "SELECT *" - "SELECT *" | false | 234563 | true | "srv" | "/*ddps='srv'*/ SELECT *" - "SELECT *" | false | 345342 | true | "srv" | "/*ddps='srv'*/ SELECT *" - "/*ddsh='-3750763034362895579'*/ SELECT *" | true | 234563 | true | "" | "/*ddsh='-3750763034362895579'*/ SELECT *" - } - - def "test encode Sql Comment with peer service"() { - setup: - injectSysConfig("dd.service", "SqlCommenter") - injectSysConfig("dd.env", "Test") - injectSysConfig("dd.version", "TestVersion") - - when: - String sqlWithComment = runUnderTrace("testTrace") { - AgentSpan currSpan = AgentTracer.activeSpan() - currSpan.setTag(Tags.PEER_SERVICE, peerService) - return SQLCommenter.inject("SELECT * FROM foo", "my-service", dbType, "h", "n", "00-00000000000000007fffffffffffffff-000000024cb016ea-00", true) - } - - then: - sqlWithComment == expected - - where: - dbType | peerService | expected - "mysql" | null | "SELECT * FROM foo /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/" - "postgres" | "" | "SELECT * FROM foo /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/" - "postgres" | "testPeer" | "SELECT * FROM foo /*ddps='SqlCommenter',dddbs='my-service',ddh='h',dddb='n',ddprs='testPeer',dde='Test',ddpv='TestVersion',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/" - } -} diff --git a/dd-java-agent/instrumentation/jdbc/src/test/java/datadog/trace/instrumentation/jdbc/SQLCommenterTest.java b/dd-java-agent/instrumentation/jdbc/src/test/java/datadog/trace/instrumentation/jdbc/SQLCommenterTest.java new file mode 100644 index 00000000000..d2f448ddd66 --- /dev/null +++ b/dd-java-agent/instrumentation/jdbc/src/test/java/datadog/trace/instrumentation/jdbc/SQLCommenterTest.java @@ -0,0 +1,1136 @@ +package datadog.trace.instrumentation.jdbc; + +import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace; +import static datadog.trace.test.junit.utils.config.WithConfigExtension.injectSysConfig; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.params.provider.Arguments.arguments; + +import datadog.trace.agent.test.AbstractInstrumentationTest; +import datadog.trace.api.BaseHash; +import datadog.trace.api.Config; +import datadog.trace.api.ProcessTags; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import datadog.trace.bootstrap.instrumentation.api.Tags; +import datadog.trace.bootstrap.instrumentation.dbm.SharedDBCommenter; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +class SQLCommenterTest extends AbstractInstrumentationTest { + + private static final String TRACE_PARENT = + "00-00000000000000007fffffffffffffff-000000024cb016ea-00"; + private static final String TRACE_PARENT_SAMPLED = + "00-00000000000000007fffffffffffffff-000000024cb016ea-01"; + + @ParameterizedTest(name = "{0}") + @MethodSource("testFindFirstWordArguments") + void testFindFirstWord(String scenario, String sql, String firstWord) { + // when + String word = SQLCommenter.getFirstWord(sql).toString(); + + // then + assertEquals(firstWord, word); + } + + static Stream testFindFirstWordArguments() { + return Stream.of( + arguments("SELECT *", "SELECT *", "SELECT"), + arguments("leading spaces brace", " { ", "{"), + arguments("brace", "{", "{"), + arguments("brace call", "{call", "{call"), + arguments("brace space call", "{ call", "{"), + arguments("CALL with args", "CALL ( ? )", "CALL"), + arguments("empty", "", ""), + arguments("blank", " ", "")); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("testEncodeSqlCommentArguments") + void testEncodeSqlComment( + String scenario, + String query, + String ddService, + String ddEnv, + String dbService, + String dbType, + String host, + String dbName, + String ddVersion, + boolean append, + String traceParent, + String expected) { + // setup + injectSysConfig("service", ddService); + injectSysConfig("env", ddEnv); + injectSysConfig("version", ddVersion); + SharedDBCommenter.resetStaticPrefixForTesting(); + + // when + String sqlWithComment = + SQLCommenter.inject(query, dbService, dbType, host, dbName, traceParent, append); + + // then + assertEquals(expected, sqlWithComment); + } + + static Stream testEncodeSqlCommentArguments() { + return Stream.of( + arguments( + "append mysql simple", + "SELECT * FROM foo", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + true, + TRACE_PARENT, + "SELECT * FROM foo /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/"), + arguments( + "append mysql trailing semicolon", + "SELECT * FROM foo;", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + true, + TRACE_PARENT, + "SELECT * FROM foo /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/;"), + arguments( + "append mysql trailing semicolon and whitespace", + "SELECT * FROM foo; \t\n\r", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + true, + TRACE_PARENT, + "SELECT * FROM foo /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/;"), + arguments( + "append mysql two statements", + "SELECT * FROM foo; SELECT * FROM bar", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + true, + TRACE_PARENT, + "SELECT * FROM foo; SELECT * FROM bar /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/"), + arguments( + "append mysql two statements trailing semicolon", + "SELECT * FROM foo; SELECT * FROM bar; ", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + true, + TRACE_PARENT, + "SELECT * FROM foo; SELECT * FROM bar /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/;"), + arguments( + "append postgres simple", + "SELECT * FROM foo", + "SqlCommenter", + "Test", + "my-service", + "postgres", + "h", + "n", + "TestVersion", + true, + TRACE_PARENT, + "SELECT * FROM foo /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/"), + arguments( + "append mysql stored proc braces", + "{call dogshelterProc(?, ?)}", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + true, + TRACE_PARENT, + "{call dogshelterProc(?, ?)} /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/"), + arguments( + "prepend mysql stored proc braces", + "{call dogshelterProc(?, ?)}", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + false, + TRACE_PARENT, + "{call dogshelterProc(?, ?)} /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/"), + arguments( + "append postgres stored proc braces unchanged", + "{call dogshelterProc(?, ?)}", + "SqlCommenter", + "Test", + "my-service", + "postgres", + "h", + "n", + "TestVersion", + true, + TRACE_PARENT, + "{call dogshelterProc(?, ?)}"), + arguments( + "prepend postgres CALL proc", + "CALL dogshelterProc(?, ?)", + "SqlCommenter", + "Test", + "my-service", + "postgres", + "h", + "n", + "TestVersion", + false, + TRACE_PARENT, + "CALL dogshelterProc(?, ?) /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/"), + arguments( + "prepend mysql CALL proc", + "CALL dogshelterProc(?, ?)", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + false, + TRACE_PARENT, + "CALL dogshelterProc(?, ?) /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/"), + arguments( + "append empty service drops ddps and dddbs", + "SELECT * FROM foo", + "", + "Test", + "", + "mysql", + "h", + "n", + "TestVersion", + true, + TRACE_PARENT, + "SELECT * FROM foo /*dde='Test',ddpv='TestVersion',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/"), + arguments( + "append empty service keeps dddbs", + "SELECT * FROM foo", + "", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + true, + TRACE_PARENT, + "SELECT * FROM foo /*dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/"), + arguments( + "append empty host and dbName drops ddh and dddb", + "SELECT * FROM foo", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "", + "", + "TestVersion", + true, + TRACE_PARENT, + "SELECT * FROM foo /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/"), + arguments( + "append only env host dbName", + "SELECT * FROM foo", + "", + "Test", + "", + "", + "h", + "n", + "", + true, + TRACE_PARENT, + "SELECT * FROM foo /*dde='Test',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/"), + arguments( + "append only host dbName", + "SELECT * FROM foo", + "", + "", + "", + "", + "h", + "n", + "", + true, + TRACE_PARENT, + "SELECT * FROM foo /*ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/"), + arguments( + "append only traceparent", + "SELECT * FROM foo", + "", + "", + "", + "", + "", + "", + "", + true, + TRACE_PARENT, + "SELECT * FROM foo /*traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/"), + arguments( + "append with line comment sampled", + "SELECT * from FOO -- test query", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + true, + TRACE_PARENT_SAMPLED, + "SELECT * from FOO -- test query /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-01'*/"), + arguments( + "append with inline customer comment sampled", + "SELECT /* customer-comment */ * FROM foo", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + true, + TRACE_PARENT_SAMPLED, + "SELECT /* customer-comment */ * FROM foo /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-01'*/"), + arguments( + "append null traceparent omits traceparent", + "SELECT * FROM foo", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + true, + null, + "SELECT * FROM foo /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n'*/"), + arguments( + "append oracle null traceparent", + "SELECT * FROM DUAL", + "SqlCommenter", + "Test", + "my-service", + "oracle", + "h", + "n", + "TestVersion", + true, + null, + "SELECT * FROM DUAL /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n'*/"), + arguments( + "append sqlserver null traceparent", + "SELECT * FROM sys.tables", + "SqlCommenter", + "Test", + "my-service", + "sqlserver", + "h", + "n", + "TestVersion", + true, + null, + "SELECT * FROM sys.tables /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n'*/"), + arguments( + "append inline customer comment null traceparent", + "SELECT /* customer-comment */ * FROM foo", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + true, + null, + "SELECT /* customer-comment */ * FROM foo /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n'*/"), + arguments( + "append line comment null traceparent", + "SELECT * from FOO -- test query", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + true, + null, + "SELECT * from FOO -- test query /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n'*/"), + arguments( + "append empty query stays empty", + "", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + true, + TRACE_PARENT, + ""), + arguments( + "append blank query sampled", + " ", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + true, + TRACE_PARENT_SAMPLED, + " /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-01'*/"), + arguments( + "append empty query dbService postgres", + "", + "SqlCommenter", + "Test", + "postgres", + "mysql", + "h", + "n", + "TestVersion", + true, + TRACE_PARENT, + ""), + arguments( + "append blank query dbService postgres sampled", + " ", + "SqlCommenter", + "Test", + "postgres", + "mysql", + "h", + "n", + "TestVersion", + true, + TRACE_PARENT_SAMPLED, + " /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='postgres',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-01'*/"), + arguments( + "append idempotent full existing comment", + "SELECT * FROM foo /*dddbs='my-service',ddh='h',dddb='n',dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + true, + null, + "SELECT * FROM foo /*dddbs='my-service',ddh='h',dddb='n',dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/"), + arguments( + "append idempotent existing comment no dddbs", + "SELECT * FROM foo /*ddh='h',dddb='n',dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + true, + null, + "SELECT * FROM foo /*ddh='h',dddb='n',dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/"), + arguments( + "append idempotent existing comment no ddh", + "SELECT * FROM foo /*dddb='n',dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + true, + null, + "SELECT * FROM foo /*dddb='n',dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/"), + arguments( + "append idempotent existing comment no dddb", + "SELECT * FROM foo /*dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + true, + null, + "SELECT * FROM foo /*dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/"), + arguments( + "append idempotent existing comment no dde", + "SELECT * FROM foo /*ddps='SqlCommenter',ddpv='TestVersion'*/", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + true, + null, + "SELECT * FROM foo /*ddps='SqlCommenter',ddpv='TestVersion'*/"), + arguments( + "append idempotent existing comment only ddpv", + "SELECT * FROM foo /*ddpv='TestVersion'*/", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + true, + null, + "SELECT * FROM foo /*ddpv='TestVersion'*/"), + arguments( + "append leading customer comment null traceparent", + "/*ddjk its a customer */ SELECT * FROM foo", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + true, + null, + "/*ddjk its a customer */ SELECT * FROM foo /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n'*/"), + arguments( + "append existing traceparent comment unchanged", + "SELECT * FROM foo /*traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-01'*/", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + true, + null, + "SELECT * FROM foo /*traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-01'*/"), + arguments( + "append leading customer block comment", + "/*customer-comment*/ SELECT * FROM foo", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + true, + null, + "/*customer-comment*/ SELECT * FROM foo /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n'*/"), + arguments( + "append unterminated traceparent comment", + "/*traceparent", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + true, + null, + "/*traceparent /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n'*/"), + arguments( + "prepend mysql simple", + "SELECT * FROM foo", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + false, + TRACE_PARENT, + "/*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/ SELECT * FROM foo"), + arguments( + "prepend empty service drops ddps and dddbs", + "SELECT * FROM foo", + "", + "Test", + "", + "mysql", + "h", + "n", + "TestVersion", + false, + TRACE_PARENT, + "/*dde='Test',ddpv='TestVersion',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/ SELECT * FROM foo"), + arguments( + "prepend empty service keeps dddbs", + "SELECT * FROM foo", + "", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + false, + TRACE_PARENT, + "/*dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/ SELECT * FROM foo"), + arguments( + "prepend only env host dbName", + "SELECT * FROM foo", + "", + "Test", + "", + "", + "h", + "n", + "", + false, + TRACE_PARENT, + "/*dde='Test',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/ SELECT * FROM foo"), + arguments( + "prepend only traceparent", + "SELECT * FROM foo", + "", + "", + "", + "", + "", + "", + "", + false, + TRACE_PARENT, + "/*traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/ SELECT * FROM foo"), + arguments( + "prepend line comment sampled", + "SELECT * from FOO -- test query", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + false, + TRACE_PARENT_SAMPLED, + "/*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-01'*/ SELECT * from FOO -- test query"), + arguments( + "prepend inline customer comment sampled", + "SELECT /* customer-comment */ * FROM foo", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + false, + TRACE_PARENT_SAMPLED, + "/*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-01'*/ SELECT /* customer-comment */ * FROM foo"), + arguments( + "prepend mysql null traceparent", + "SELECT * FROM foo", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + false, + null, + "/*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n'*/ SELECT * FROM foo"), + arguments( + "prepend inline customer comment null traceparent", + "SELECT /* customer-comment */ * FROM foo", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + false, + null, + "/*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n'*/ SELECT /* customer-comment */ * FROM foo"), + arguments( + "prepend line comment null traceparent", + "SELECT * from FOO -- test query", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + false, + null, + "/*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n'*/ SELECT * from FOO -- test query"), + arguments( + "prepend empty query stays empty", + "", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + false, + TRACE_PARENT, + ""), + arguments( + "prepend blank query sampled", + " ", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + false, + TRACE_PARENT_SAMPLED, + "/*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-01'*/ "), + arguments( + "prepend idempotent full existing comment", + "/*dddbs='my-service',ddh='h',dddb='n',dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/ SELECT * FROM foo", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + false, + null, + "/*dddbs='my-service',ddh='h',dddb='n',dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/ SELECT * FROM foo"), + arguments( + "prepend idempotent existing comment no dddbs", + "/*ddh='h',dddb='n',dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/ SELECT * FROM foo", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + false, + null, + "/*ddh='h',dddb='n',dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/ SELECT * FROM foo"), + arguments( + "prepend idempotent existing comment no ddh", + "/*dddb='n',dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/ SELECT * FROM foo", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + false, + null, + "/*dddb='n',dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/ SELECT * FROM foo"), + arguments( + "prepend idempotent existing comment no dddb", + "/*dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/ SELECT * FROM foo", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + false, + null, + "/*dde='Test',ddps='SqlCommenter',ddpv='TestVersion'*/ SELECT * FROM foo"), + arguments( + "prepend idempotent existing comment no dde", + "/*ddps='SqlCommenter',ddpv='TestVersion'*/ SELECT * FROM foo", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + false, + null, + "/*ddps='SqlCommenter',ddpv='TestVersion'*/ SELECT * FROM foo"), + arguments( + "prepend idempotent existing comment only ddpv", + "/*ddpv='TestVersion'*/ SELECT * FROM foo", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + false, + null, + "/*ddpv='TestVersion'*/ SELECT * FROM foo"), + arguments( + "prepend leading customer comment null traceparent", + "/*ddjk its a customer */ SELECT * FROM foo", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + false, + null, + "/*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n'*/ /*ddjk its a customer */ SELECT * FROM foo"), + arguments( + "prepend existing traceparent comment unchanged", + "/*traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-01'*/ SELECT * FROM foo", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + false, + null, + "/*traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-01'*/ SELECT * FROM foo"), + arguments( + "prepend leading customer block comment", + "/*customer-comment*/ SELECT * FROM foo", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + false, + null, + "/*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n'*/ /*customer-comment*/ SELECT * FROM foo"), + arguments( + "prepend unterminated traceparent comment", + "/*traceparent", + "SqlCommenter", + "Test", + "my-service", + "mysql", + "h", + "n", + "TestVersion", + false, + null, + "/*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n'*/ /*traceparent"), + arguments( + "append postgres optimizer hint inline", + "SELECT /*+ SeqScan(foo) */ * FROM foo", + "SqlCommenter", + "Test", + "my-service", + "postgres", + "h", + "n", + "TestVersion", + true, + TRACE_PARENT, + "SELECT /*+ SeqScan(foo) */ * FROM foo /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/"), + arguments( + "append postgres optimizer hint leading", + "/*+ SeqScan(foo) */ SELECT * FROM foo", + "SqlCommenter", + "Test", + "my-service", + "postgres", + "h", + "n", + "TestVersion", + true, + TRACE_PARENT, + "/*+ SeqScan(foo) */ SELECT * FROM foo /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/"), + arguments( + "postgres optimizer hint leading -- re-injecting already-commented SQL is a no-op", + "/*+ SeqScan(foo) */ SELECT * FROM foo /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/", + "SqlCommenter", + "Test", + "my-service", + "postgres", + "h", + "n", + "TestVersion", + true, + TRACE_PARENT, + "/*+ SeqScan(foo) */ SELECT * FROM foo /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/"), + arguments( + "prepend postgres optimizer hint leading", + "/*+ SeqScan(foo) */ SELECT * FROM foo", + "SqlCommenter", + "Test", + "my-service", + "postgres", + "h", + "n", + "TestVersion", + false, + TRACE_PARENT, + "/*+ SeqScan(foo) */ SELECT * FROM foo /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/"), + arguments( + "prepend postgres optimizer hint with empty ddps unchanged", + "/*+ SeqScan(foo) */ SELECT * FROM foo /*ddps=''*/", + "SqlCommenter", + "Test", + "my-service", + "postgres", + "h", + "n", + "TestVersion", + false, + TRACE_PARENT, + "/*+ SeqScan(foo) */ SELECT * FROM foo /*ddps=''*/"), + arguments( + "append postgres optimizer hint with empty ddps unchanged", + "/*+ SeqScan(foo) */ SELECT * FROM foo /*ddps=''*/", + "SqlCommenter", + "Test", + "my-service", + "postgres", + "h", + "n", + "TestVersion", + true, + TRACE_PARENT, + "/*+ SeqScan(foo) */ SELECT * FROM foo /*ddps=''*/"), + arguments( + "prepend postgres CALL proc with empty ddps unchanged", + "CALL dogshelterProc(?, ?) /*ddps=''*/", + "SqlCommenter", + "Test", + "my-service", + "postgres", + "h", + "n", + "TestVersion", + false, + TRACE_PARENT, + "CALL dogshelterProc(?, ?) /*ddps=''*/"), + arguments( + "append postgres CALL proc with empty ddps unchanged", + "CALL dogshelterProc(?, ?) /*ddps=''*/", + "SqlCommenter", + "Test", + "my-service", + "postgres", + "h", + "n", + "TestVersion", + true, + TRACE_PARENT, + "CALL dogshelterProc(?, ?) /*ddps=''*/")); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("injectBaseHashArguments") + void injectBaseHash( + String scenario, + String query, + boolean injectHash, + long baseHash, + boolean processTagsEnabled, + String srv, + String result) { + // setup + injectSysConfig("service", srv); + injectSysConfig("env", ""); + injectSysConfig("dbm.inject.sql.basehash", Boolean.toString(injectHash)); + injectSysConfig( + "experimental.propagate.process.tags.enabled", Boolean.toString(processTagsEnabled)); + ProcessTags.reset(Config.get()); + BaseHash.updateBaseHash(baseHash); + SharedDBCommenter.resetStaticPrefixForTesting(); + + // expect + assertEquals(processTagsEnabled, Config.get().isExperimentalPropagateProcessTagsEnabled()); + // and + assertEquals(result, SQLCommenter.inject(query, "", "", "", "", "", false)); + } + + static Stream injectBaseHashArguments() { + return Stream.of( + arguments( + "hash on, no process tags, no service", + "SELECT *", + true, + 234563L, + false, + "", + "SELECT *"), + arguments( + "hash on, process tags, no service", + "SELECT *", + true, + 234563L, + true, + "", + "/*ddsh='234563'*/ SELECT *"), + arguments( + "hash on alt base, no process tags, no service", + "SELECT *", + true, + 345342L, + false, + "", + "SELECT *"), + arguments( + "hash on alt base, process tags, no service", + "SELECT *", + true, + 345342L, + true, + "", + "/*ddsh='345342'*/ SELECT *"), + arguments( + "hash on, no process tags, with service", + "SELECT *", + true, + 234563L, + false, + "srv", + "/*ddps='srv'*/ SELECT *"), + arguments( + "hash on, process tags, with service", + "SELECT *", + true, + 234563L, + true, + "srv", + "/*ddps='srv',ddsh='234563'*/ SELECT *"), + arguments( + "hash on alt base, no process tags, with service", + "SELECT *", + true, + 345342L, + false, + "srv", + "/*ddps='srv'*/ SELECT *"), + arguments( + "hash on alt base, process tags, with service", + "SELECT *", + true, + 345342L, + true, + "srv", + "/*ddps='srv',ddsh='345342'*/ SELECT *"), + arguments( + "hash off, process tags, no service", "SELECT *", false, 234563L, true, "", "SELECT *"), + arguments( + "hash off, process tags, with service", + "SELECT *", + false, + 234563L, + true, + "srv", + "/*ddps='srv'*/ SELECT *"), + arguments( + "hash off alt base, process tags, with service", + "SELECT *", + false, + 345342L, + true, + "srv", + "/*ddps='srv'*/ SELECT *"), + arguments( + "hash on, process tags, existing ddsh unchanged", + "/*ddsh='-3750763034362895579'*/ SELECT *", + true, + 234563L, + true, + "", + "/*ddsh='-3750763034362895579'*/ SELECT *")); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("testEncodeSqlCommentWithPeerServiceArguments") + void testEncodeSqlCommentWithPeerService( + String scenario, String dbType, String peerService, String expected) throws Exception { + // setup + injectSysConfig("service", "SqlCommenter"); + injectSysConfig("env", "Test"); + injectSysConfig("version", "TestVersion"); + SharedDBCommenter.resetStaticPrefixForTesting(); + + // when + String sqlWithComment = + runUnderTrace( + "testTrace", + () -> { + AgentSpan currSpan = AgentTracer.activeSpan(); + currSpan.setTag(Tags.PEER_SERVICE, peerService); + return SQLCommenter.inject( + "SELECT * FROM foo", + "my-service", + dbType, + "h", + "n", + "00-00000000000000007fffffffffffffff-000000024cb016ea-00", + true); + }); + + // then + assertEquals(expected, sqlWithComment); + } + + static Stream testEncodeSqlCommentWithPeerServiceArguments() { + return Stream.of( + arguments( + "mysql null peer service", + "mysql", + null, + "SELECT * FROM foo /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/"), + arguments( + "postgres empty peer service", + "postgres", + "", + "SELECT * FROM foo /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/"), + arguments( + "postgres with peer service", + "postgres", + "testPeer", + "SELECT * FROM foo /*ddps='SqlCommenter',dde='Test',ddpv='TestVersion',dddbs='my-service',ddh='h',dddb='n',ddprs='testPeer',traceparent='00-00000000000000007fffffffffffffff-000000024cb016ea-00'*/")); + } +} diff --git a/dd-java-agent/instrumentation/jdbc/src/test/java/test/DataDogRegistryImageNameSubstitutor.java b/dd-java-agent/instrumentation/jdbc/src/test/java/test/DataDogRegistryImageNameSubstitutor.java new file mode 100644 index 00000000000..8f7693f49d1 --- /dev/null +++ b/dd-java-agent/instrumentation/jdbc/src/test/java/test/DataDogRegistryImageNameSubstitutor.java @@ -0,0 +1,35 @@ +package test; + +import org.testcontainers.utility.DockerImageName; +import org.testcontainers.utility.ImageNameSubstitutor; + +/** + * A custom {@link ImageNameSubstitutor} implementation that rewrites Docker image names to use + * Datadog's internal registry {@code registry.ddbuild.io} when running in a CI environment. + * + *

      Images from DockerHub already mirrored by {@code registry.ddbuild.io} via environment variable + * {@code TESTCONTAINERS_HUB_IMAGE_NAME_PREFIX} + * + *

      For images from other repositories custom image name substitutor should be implemented. + * Internal registry is faster and not affected by rate limiting. + */ +public class DataDogRegistryImageNameSubstitutor extends ImageNameSubstitutor { + @Override + public DockerImageName apply(DockerImageName original) { + String name = original.asCanonicalNameString(); + + if (System.getenv("CI") != null) { + // For now, we need to mirror Microsoft SQL Server images only. + name = + name.replace( + "mcr.microsoft.com/mssql/server:", "registry.ddbuild.io/images/mirror/sqlserver:"); + } + + return DockerImageName.parse(name); + } + + @Override + protected String getDescription() { + return "Image name substitutor to load images from registry.ddbuild.io"; + } +} diff --git a/dd-java-agent/instrumentation/jdbc/src/test/resources/testcontainers.properties b/dd-java-agent/instrumentation/jdbc/src/test/resources/testcontainers.properties new file mode 100644 index 00000000000..03fb660c6d1 --- /dev/null +++ b/dd-java-agent/instrumentation/jdbc/src/test/resources/testcontainers.properties @@ -0,0 +1 @@ +image.substitutor=test.DataDogRegistryImageNameSubstitutor diff --git a/dd-java-agent/instrumentation/jedis/jedis-1.4/gradle.lockfile b/dd-java-agent/instrumentation/jedis/jedis-1.4/gradle.lockfile index 0edd095727b..902d76f5e52 100644 --- a/dd-java-agent/instrumentation/jedis/jedis-1.4/gradle.lockfile +++ b/dd-java-agent/instrumentation/jedis/jedis-1.4/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jedis:jedis-1.4:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,21 +9,21 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.codemonstur:embedded-redis:1.4.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -32,12 +33,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -48,12 +52,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -83,6 +87,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -100,14 +105,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jedis/jedis-3.0/gradle.lockfile b/dd-java-agent/instrumentation/jedis/jedis-3.0/gradle.lockfile index 27e626dbb4f..b120b893c29 100644 --- a/dd-java-agent/instrumentation/jedis/jedis-3.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/jedis/jedis-3.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jedis:jedis-3.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,21 +9,21 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.codemonstur:embedded-redis:1.4.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -32,12 +33,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -48,12 +52,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -84,6 +88,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -101,14 +106,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jedis/jedis-4.0/gradle.lockfile b/dd-java-agent/instrumentation/jedis/jedis-4.0/gradle.lockfile index db3e4db78b3..944dfd2e195 100644 --- a/dd-java-agent/instrumentation/jedis/jedis-4.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/jedis/jedis-4.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jedis:jedis-4.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,21 +9,21 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.codemonstur:embedded-redis:1.4.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -34,12 +35,15 @@ com.google.code.gson:gson:2.13.2=spotbugs com.google.code.gson:gson:2.8.9=compileClasspath,testCompileClasspath,testRuntimeClasspath com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -50,12 +54,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,6 +91,7 @@ org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeCl org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.json:json:20211205=compileClasspath,testCompileClasspath,testRuntimeClasspath org.json:json:20231013=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -104,14 +109,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jersey/jersey-2.0/gradle.lockfile b/dd-java-agent/instrumentation/jersey/jersey-2.0/gradle.lockfile index 6f501c85858..6f6ffa57a71 100644 --- a/dd-java-agent/instrumentation/jersey/jersey-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/jersey/jersey-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jersey:jersey-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=jersey2JettyTestCompileClasspath,jersey2Jetty com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -24,15 +25,15 @@ com.fasterxml.jackson.module:jackson-module-jakarta-xmlbind-annotations:2.14.1=j com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.5.1=jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.14.1=jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,jersey2JettyTestAnnotationProcessor,jersey2JettyTestCompileClasspath,jersey3JettyTestAnnotationProcessor,jersey3JettyTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -42,13 +43,16 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,jerse com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,jersey2JettyTestAnnotationProcessor,jersey3JettyTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,jersey2JettyTestAnnotationProcessor,jersey3JettyTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.3=jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:14.0.1=compileClasspath -com.google.guava:guava:20.0=jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,jersey2JettyTestAnnotationProcessor,jersey3JettyTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,jersey2JettyTestAnnotationProcessor,jersey3JettyTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,jersey2JettyTestAnnotationProcessor,jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestAnnotationProcessor,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,jersey2JettyTestAnnotationProcessor,jersey3JettyTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -59,7 +63,7 @@ commons-io:commons-io:2.11.0=jersey2JettyTestCompileClasspath,jersey2JettyTestRu commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:2.1.0=jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath jakarta.annotation:jakarta.annotation-api:2.1.1=jersey2JettyTestCompileClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:3.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -82,8 +86,8 @@ javax.xml.bind:jaxb-api:2.2.3=jersey2JettyTestRuntimeClasspath,jersey3JettyTestR javax.xml.stream:stax-api:1.0-2=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -162,6 +166,7 @@ org.javassist:javassist:3.18.1-GA=jersey2JettyTestCompileClasspath,jersey2JettyT org.javassist:javassist:3.29.0-GA=jersey3JettyTestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -181,14 +186,14 @@ org.objenesis:objenesis:3.3=jersey2JettyTestCompileClasspath,jersey2JettyTestRun org.opentest4j:opentest4j:1.3.0=jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=jersey2JettyTestRuntimeClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=jersey2JettyTestCompileClasspath,jersey2JettyTestRuntimeClasspath,jersey3JettyTestCompileClasspath,jersey3JettyTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-2.0/gradle.lockfile b/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-2.0/gradle.lockfile index 796f1c98f3d..f6b4f24cbdc 100644 --- a/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-2.0/gradle.lockfile @@ -115,14 +115,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-2.0/src/main/java/datadog/trace/instrumentation/jersey2/MessageBodyReaderInstrumentation.java b/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-2.0/src/main/java/datadog/trace/instrumentation/jersey2/MessageBodyReaderInstrumentation.java index 8fd21ac4e5e..70647600ffb 100644 --- a/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-2.0/src/main/java/datadog/trace/instrumentation/jersey2/MessageBodyReaderInstrumentation.java +++ b/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-2.0/src/main/java/datadog/trace/instrumentation/jersey2/MessageBodyReaderInstrumentation.java @@ -50,7 +50,7 @@ public void methodAdvice(MethodTransformer transformer) { @RequiresRequestContext(RequestContextSlot.APPSEC) public static class ReaderInterceptorExecutorProceedAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Return final Object ret, @ActiveRequestContext RequestContext reqCtx, diff --git a/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-2.0/src/main/java/datadog/trace/instrumentation/jersey2/MultiPartReaderServerSideInstrumentation.java b/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-2.0/src/main/java/datadog/trace/instrumentation/jersey2/MultiPartReaderServerSideInstrumentation.java index 7e94374f831..a1f6658b068 100644 --- a/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-2.0/src/main/java/datadog/trace/instrumentation/jersey2/MultiPartReaderServerSideInstrumentation.java +++ b/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-2.0/src/main/java/datadog/trace/instrumentation/jersey2/MultiPartReaderServerSideInstrumentation.java @@ -62,7 +62,7 @@ public void methodAdvice(MethodTransformer transformer) { @RequiresRequestContext(RequestContextSlot.APPSEC) public static class ReadMultiPartAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Return final MultiPart ret, @ActiveRequestContext RequestContext reqCtx, diff --git a/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-2.0/src/main/java/datadog/trace/instrumentation/jersey2/UriRoutingContextGetPathSegmentsInstrumentation.java b/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-2.0/src/main/java/datadog/trace/instrumentation/jersey2/UriRoutingContextGetPathSegmentsInstrumentation.java index 4aee0839a07..73d1061b533 100644 --- a/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-2.0/src/main/java/datadog/trace/instrumentation/jersey2/UriRoutingContextGetPathSegmentsInstrumentation.java +++ b/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-2.0/src/main/java/datadog/trace/instrumentation/jersey2/UriRoutingContextGetPathSegmentsInstrumentation.java @@ -38,7 +38,7 @@ public void methodAdvice(MethodTransformer transformer) { @RequiresRequestContext(RequestContextSlot.APPSEC) public static class GetPathSegmentsAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.This UriRoutingContext thiz, @Advice.Argument(0) boolean decode, diff --git a/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-2.0/src/main/java/datadog/trace/instrumentation/jersey2/UriRoutingContextInstrumentation.java b/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-2.0/src/main/java/datadog/trace/instrumentation/jersey2/UriRoutingContextInstrumentation.java index 3cc7a7e0ce3..16b155b138a 100644 --- a/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-2.0/src/main/java/datadog/trace/instrumentation/jersey2/UriRoutingContextInstrumentation.java +++ b/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-2.0/src/main/java/datadog/trace/instrumentation/jersey2/UriRoutingContextInstrumentation.java @@ -48,7 +48,7 @@ public void methodAdvice(MethodTransformer transformer) { @RequiresRequestContext(RequestContextSlot.APPSEC) public static class GetPathParametersAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Return final Map> ret, @ActiveRequestContext RequestContext reqCtx, diff --git a/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-3.0/gradle.lockfile b/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-3.0/gradle.lockfile index e4111f2e236..e3a9e93165d 100644 --- a/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-3.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-3.0/gradle.lockfile @@ -111,14 +111,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-3.0/src/main/java/datadog/trace/instrumentation/jersey3/MessageBodyReaderInstrumentation.java b/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-3.0/src/main/java/datadog/trace/instrumentation/jersey3/MessageBodyReaderInstrumentation.java index 60a5ccaa8e5..4d6ec5beaff 100644 --- a/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-3.0/src/main/java/datadog/trace/instrumentation/jersey3/MessageBodyReaderInstrumentation.java +++ b/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-3.0/src/main/java/datadog/trace/instrumentation/jersey3/MessageBodyReaderInstrumentation.java @@ -49,7 +49,7 @@ public void methodAdvice(MethodTransformer transformer) { @RequiresRequestContext(RequestContextSlot.APPSEC) public static class ReaderInterceptorExecutorProceedAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Return final Object ret, @ActiveRequestContext RequestContext reqCtx, diff --git a/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-3.0/src/main/java/datadog/trace/instrumentation/jersey3/MultiPartReaderServerSideInstrumentation.java b/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-3.0/src/main/java/datadog/trace/instrumentation/jersey3/MultiPartReaderServerSideInstrumentation.java index b573187d7be..8dbbb6459ea 100644 --- a/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-3.0/src/main/java/datadog/trace/instrumentation/jersey3/MultiPartReaderServerSideInstrumentation.java +++ b/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-3.0/src/main/java/datadog/trace/instrumentation/jersey3/MultiPartReaderServerSideInstrumentation.java @@ -62,7 +62,7 @@ public void methodAdvice(MethodTransformer transformer) { @RequiresRequestContext(RequestContextSlot.APPSEC) public static class ReadMultiPartAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Return final MultiPart ret, @ActiveRequestContext RequestContext reqCtx, diff --git a/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-3.0/src/main/java/datadog/trace/instrumentation/jersey3/UriRoutingContextGetPathSegmentsInstrumentation.java b/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-3.0/src/main/java/datadog/trace/instrumentation/jersey3/UriRoutingContextGetPathSegmentsInstrumentation.java index ec013052658..41acf68d4b6 100644 --- a/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-3.0/src/main/java/datadog/trace/instrumentation/jersey3/UriRoutingContextGetPathSegmentsInstrumentation.java +++ b/dd-java-agent/instrumentation/jersey/jersey-appsec/jersey-appsec-3.0/src/main/java/datadog/trace/instrumentation/jersey3/UriRoutingContextGetPathSegmentsInstrumentation.java @@ -38,7 +38,7 @@ public void methodAdvice(MethodTransformer transformer) { @RequiresRequestContext(RequestContextSlot.APPSEC) public static class GetPathSegmentsAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.This UriRoutingContext thiz, @Advice.Argument(0) boolean decode, diff --git a/dd-java-agent/instrumentation/jersey/jersey-client-2.0/gradle.lockfile b/dd-java-agent/instrumentation/jersey/jersey-client-2.0/gradle.lockfile index 517229466d0..a440e06ed70 100644 --- a/dd-java-agent/instrumentation/jersey/jersey-client-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/jersey/jersey-client-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jersey:jersey-client-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,13 +32,16 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:14.0.1=compileClasspath -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -48,15 +52,15 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.annotation:javax.annotation-api:1.2=compileClasspath,testCompileClasspath,testRuntimeClasspath javax.inject:javax.inject:1=compileClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath javax.ws.rs:javax.ws.rs-api:2.0=compileClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -94,6 +98,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -111,14 +116,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jersey/jersey-filter-2.0/gradle.lockfile b/dd-java-agent/instrumentation/jersey/jersey-filter-2.0/gradle.lockfile index abddd278232..9d14b959076 100644 --- a/dd-java-agent/instrumentation/jersey/jersey-filter-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/jersey/jersey-filter-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jersey:jersey-filter-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,13 +32,16 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:14.0.1=compileClasspath -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -48,7 +52,7 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.annotation:javax.annotation-api:1.2=compileClasspath javax.inject:javax.inject:1=compileClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath @@ -56,8 +60,8 @@ javax.validation:validation-api:1.1.0.Final=compileClasspath javax.ws.rs:javax.ws.rs-api:2.0=compileClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -96,6 +100,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -113,14 +118,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-11.0/build.gradle b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-11.0/build.gradle new file mode 100644 index 00000000000..4eaaee67246 --- /dev/null +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-11.0/build.gradle @@ -0,0 +1,29 @@ +muzzle { + pass { + group = 'org.eclipse.jetty' + module = 'jetty-server' + versions = '[11.0,12.0)' + assertInverse = true + javaVersion = 11 + } +} + +apply from: "$rootDir/gradle/java.gradle" + +dependencies { + compileOnly(group: 'org.eclipse.jetty', name: 'jetty-server', version: '11.0.26') { + exclude group: 'org.slf4j', module: 'slf4j-api' + } + testImplementation(group: 'org.eclipse.jetty.toolchain', name: 'jetty-jakarta-servlet-api', version: '5.0.1') + testImplementation libs.bundles.mockito +} + +tasks.withType(JavaCompile).configureEach { + configureCompiler(it, 11, JavaVersion.VERSION_1_8) +} + +tasks.withType(Test).configureEach { + javaLauncher = getJavaLauncherFor(11) +} + +// testing happens in the jetty-* modules diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-11.0/gradle.lockfile b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-11.0/gradle.lockfile new file mode 100644 index 00000000000..db9d5f14a6b --- /dev/null +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-11.0/gradle.lockfile @@ -0,0 +1,134 @@ +# This is a Gradle generated file for dependency locking. +# Manual edits can break the build and are not advised. +# This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-11.0:dependencies --write-locks +cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath +cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath +ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath +com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath +com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath +com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath +com.github.javaparser:javaparser-core:3.25.6=codenarc +com.github.jnr:jffi:1.3.15=testRuntimeClasspath +com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath +com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath +com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs +com.github.spotbugs:spotbugs:4.9.8=spotbugs +com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs +com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath +com.google.auto.service:auto-service:1.1.1=annotationProcessor,testAnnotationProcessor +com.google.auto:auto-common:1.2.1=annotationProcessor,testAnnotationProcessor +com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.google.code.gson:gson:2.13.2=spotbugs +com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor +com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath +com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okio:okio:1.17.5=testCompileClasspath,testRuntimeClasspath +com.thoughtworks.qdox:qdox:1.12.1=codenarc +commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testRuntimeClasspath +commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath +commons-io:commons-io:2.20.0=spotbugs +de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath +io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath +javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath +jaxen:jaxen:2.0.0=spotbugs +junit:junit:4.13.2=testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath +net.java.dev.jna:jna:5.8.0=testRuntimeClasspath +net.sf.saxon:Saxon-HE:12.9=spotbugs +org.apache.ant:ant-antlr:1.10.14=codenarc +org.apache.ant:ant-junit:1.10.14=codenarc +org.apache.bcel:bcel:6.11.0=spotbugs +org.apache.commons:commons-lang3:3.19.0=spotbugs +org.apache.commons:commons-text:1.14.0=spotbugs +org.apache.logging.log4j:log4j-api:2.25.2=spotbugs +org.apache.logging.log4j:log4j-core:2.25.2=spotbugs +org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath +org.checkerframework:checker-qual:3.33.0=annotationProcessor,testAnnotationProcessor +org.codehaus.groovy:groovy-ant:3.0.23=codenarc +org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc +org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.25=testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-templates:3.0.23=codenarc +org.codehaus.groovy:groovy-xml:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath +org.codenarc:CodeNarc:3.7.0=codenarc +org.dom4j:dom4j:2.2.0=spotbugs +org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.1=testCompileClasspath,testRuntimeClasspath +org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=compileClasspath +org.eclipse.jetty:jetty-http:11.0.26=compileClasspath +org.eclipse.jetty:jetty-io:11.0.26=compileClasspath +org.eclipse.jetty:jetty-server:11.0.26=compileClasspath +org.eclipse.jetty:jetty-util:11.0.26=compileClasspath +org.gmetrics:GMetrics:2.1.0=codenarc +org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath +org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath +org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath +org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath +org.junit.platform:junit-platform-runner:1.14.1=testRuntimeClasspath +org.junit.platform:junit-platform-suite-api:1.14.1=testRuntimeClasspath +org.junit.platform:junit-platform-suite-commons:1.14.1=testRuntimeClasspath +org.junit:junit-bom:5.14.0=spotbugs +org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-core:4.4.0=testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspath +org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath +org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath +org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.9=spotbugs +org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath +org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs +org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath +org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath +org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath +org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j +org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j +org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,muzzleTooling,runtimeClasspath,testRuntimeClasspath +org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath +org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath +org.xmlresolver:xmlresolver:5.3.3=spotbugs +empty=spotbugsPlugins diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-11.0/src/main/java/datadog/trace/instrumentation/jetty11/MultipartHelper.java b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-11.0/src/main/java/datadog/trace/instrumentation/jetty11/MultipartHelper.java new file mode 100644 index 00000000000..bd813c49bff --- /dev/null +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-11.0/src/main/java/datadog/trace/instrumentation/jetty11/MultipartHelper.java @@ -0,0 +1,157 @@ +package datadog.trace.instrumentation.jetty11; + +import static datadog.trace.api.gateway.Events.EVENTS; +import static datadog.trace.api.telemetry.LogCollector.EXCLUDE_TELEMETRY; + +import datadog.appsec.api.blocking.BlockingException; +import datadog.trace.api.Config; +import datadog.trace.api.gateway.BlockResponseFunction; +import datadog.trace.api.gateway.CallbackProvider; +import datadog.trace.api.gateway.Flow; +import datadog.trace.api.gateway.RequestContext; +import datadog.trace.api.gateway.RequestContextSlot; +import datadog.trace.api.http.MultipartContentDecoder; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import jakarta.servlet.http.Part; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.function.BiFunction; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class MultipartHelper { + + public static final int MAX_CONTENT_BYTES = Config.get().getAppSecMaxFileContentBytes(); + public static final int MAX_FILES_TO_INSPECT = Config.get().getAppSecMaxFileContentCount(); + + private static final Logger log = LoggerFactory.getLogger(MultipartHelper.class); + + private MultipartHelper() {} + + /** + * Extracts non-null, non-empty filenames from a collection of multipart {@link Part}s using + * {@link Part#getSubmittedFileName()} (Servlet 3.1+, Jetty 11.0.x). + * + * @return list of filenames; never {@code null}, may be empty + */ + public static List extractFilenames(Collection parts) { + if (parts == null || parts.isEmpty()) { + return Collections.emptyList(); + } + List filenames = new ArrayList<>(parts.size()); + for (Part part : parts) { + try { + String name = part.getSubmittedFileName(); + if (name != null && !name.isEmpty()) { + filenames.add(name); + } + } catch (Exception ignored) { + // malformed or inaccessible part — skip and continue with remaining parts + log.debug(EXCLUDE_TELEMETRY, "extractFilenames: skipping malformed part", ignored); + } + } + return filenames; + } + + /** + * Extracts file content from a collection of multipart {@link Part}s. Form fields (those with a + * {@code null} submitted filename) are skipped. Reads up to {@link #MAX_CONTENT_BYTES} bytes per + * part, up to {@link #MAX_FILES_TO_INSPECT} parts total. + * + * @return list of decoded content strings; never {@code null}, may be empty + */ + public static List extractContents(Collection parts) { + if (parts == null || parts.isEmpty()) { + return Collections.emptyList(); + } + List contents = new ArrayList<>(Math.min(parts.size(), MAX_FILES_TO_INSPECT)); + for (Part part : parts) { + if (contents.size() >= MAX_FILES_TO_INSPECT) { + break; + } + try { + if (part.getSubmittedFileName() == null) { + continue; // form field — skip + } + contents.add(readFileContent(part)); + } catch (Exception ignored) { + log.debug(EXCLUDE_TELEMETRY, "extractContents: skipping malformed part", ignored); + } + } + return contents; + } + + private static String readFileContent(Part part) { + try (InputStream is = part.getInputStream()) { + return MultipartContentDecoder.readInputStream(is, MAX_CONTENT_BYTES, part.getContentType()); + } catch (Exception e) { + log.debug(EXCLUDE_TELEMETRY, "readFileContent: stream read failed", e); + return ""; + } + } + + /** + * Fires the {@code requestFilesContent} IG event and returns a {@link BlockingException} if the + * WAF requests blocking, or {@code null} otherwise. + */ + public static BlockingException fireFilesContentEvent( + Collection parts, RequestContext reqCtx) { + CallbackProvider cbp = AgentTracer.get().getCallbackProvider(RequestContextSlot.APPSEC); + BiFunction, Flow> callback = + cbp.getCallback(EVENTS.requestFilesContent()); + if (callback == null) { + return null; + } + List contents = extractContents(parts); + if (contents.isEmpty()) { + return null; + } + Flow flow = callback.apply(reqCtx, contents); + Flow.Action action = flow.getAction(); + if (action instanceof Flow.Action.RequestBlockingAction) { + Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action; + BlockResponseFunction brf = reqCtx.getBlockResponseFunction(); + if (brf != null) { + if (brf.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba)) { + reqCtx.getTraceSegment().effectivelyBlocked(); + return new BlockingException("Blocked request (multipart file content)"); + } + } + } + return null; + } + + /** + * Fires the {@code requestFilesFilenames} IG event and returns a {@link BlockingException} if the + * WAF requests blocking, or {@code null} otherwise. + */ + public static BlockingException fireFilenamesEvent( + Collection parts, RequestContext reqCtx) { + CallbackProvider cbp = AgentTracer.get().getCallbackProvider(RequestContextSlot.APPSEC); + BiFunction, Flow> callback = + cbp.getCallback(EVENTS.requestFilesFilenames()); + if (callback == null) { + return null; + } + List filenames = extractFilenames(parts); + if (filenames.isEmpty()) { + return null; + } + Flow flow = callback.apply(reqCtx, filenames); + Flow.Action action = flow.getAction(); + if (action instanceof Flow.Action.RequestBlockingAction) { + Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action; + BlockResponseFunction brf = reqCtx.getBlockResponseFunction(); + if (brf != null) { + if (brf.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba)) { + reqCtx.getTraceSegment().effectivelyBlocked(); + return new BlockingException("Blocked request (multipart file upload)"); + } + } + } + return null; + } +} diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-11.0/src/main/java/datadog/trace/instrumentation/jetty11/RequestExtractContentParametersInstrumentation.java b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-11.0/src/main/java/datadog/trace/instrumentation/jetty11/RequestExtractContentParametersInstrumentation.java new file mode 100644 index 00000000000..9660f7824a7 --- /dev/null +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-11.0/src/main/java/datadog/trace/instrumentation/jetty11/RequestExtractContentParametersInstrumentation.java @@ -0,0 +1,199 @@ +package datadog.trace.instrumentation.jetty11; + +import static datadog.trace.agent.tooling.bytebuddy.matcher.HierarchyMatchers.declaresField; +import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static datadog.trace.api.gateway.Events.EVENTS; +import static net.bytebuddy.matcher.ElementMatchers.fieldType; +import static net.bytebuddy.matcher.ElementMatchers.takesArguments; + +import com.google.auto.service.AutoService; +import datadog.appsec.api.blocking.BlockingException; +import datadog.trace.advice.ActiveRequestContext; +import datadog.trace.advice.RequiresRequestContext; +import datadog.trace.agent.tooling.Instrumenter; +import datadog.trace.agent.tooling.InstrumenterModule; +import datadog.trace.api.gateway.BlockResponseFunction; +import datadog.trace.api.gateway.CallbackProvider; +import datadog.trace.api.gateway.Flow; +import datadog.trace.api.gateway.RequestContext; +import datadog.trace.api.gateway.RequestContextSlot; +import datadog.trace.bootstrap.CallDepthThreadLocalMap; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import jakarta.servlet.http.Part; +import java.util.Collection; +import java.util.function.BiFunction; +import net.bytebuddy.asm.Advice; +import net.bytebuddy.description.type.TypeDescription; +import net.bytebuddy.implementation.bytecode.assign.Assigner; +import net.bytebuddy.matcher.ElementMatcher; +import org.eclipse.jetty.server.Request; +import org.eclipse.jetty.util.MultiMap; + +@AutoService(InstrumenterModule.class) +public class RequestExtractContentParametersInstrumentation extends InstrumenterModule.AppSec + implements Instrumenter.ForSingleType, + Instrumenter.WithTypeStructure, + Instrumenter.HasMethodAdvice { + + public RequestExtractContentParametersInstrumentation() { + super("jetty"); + } + + @Override + public String instrumentedType() { + return "org.eclipse.jetty.server.Request"; + } + + @Override + public String[] helperClassNames() { + return new String[] {packageName + ".MultipartHelper"}; + } + + // Discriminates Jetty 11.0.x ([11.0, 12.0)): + // - _contentParameters: MultiMap field exists in 11.x (excludes Jetty 12 where + // org.eclipse.jetty.server.Request was removed) + // - _dispatcherType: jakarta.servlet.DispatcherType in the Request bytecode (excludes + // Jetty 9.4–10.x where the field type is javax.servlet.DispatcherType). Checked against + // Request.class bytecode, so it works even when both javax and jakarta are on the classpath. + // NOTE: _multiParts changes type at 11.0.10 (MultiPartFormInputStream → MultiParts); both + // are handled transparently because GetFilenamesAdvice reads it with typing=DYNAMIC. + @Override + public ElementMatcher structureMatcher() { + return declaresField( + named("_contentParameters").and(fieldType(named("org.eclipse.jetty.util.MultiMap")))) + .and( + declaresField( + named("_dispatcherType").and(fieldType(named("jakarta.servlet.DispatcherType"))))); + } + + @Override + public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvice( + named("extractContentParameters").and(takesArguments(0)).or(named("getParts")), + getClass().getName() + "$ExtractContentParametersAdvice"); + transformer.applyAdvice( + named("getParts").and(takesArguments(0)), getClass().getName() + "$GetFilenamesAdvice"); + transformer.applyAdvice( + named("getParts").and(takesArguments(1)), + getClass().getName() + "$GetFilenamesFromMultiPartAdvice"); + } + + @RequiresRequestContext(RequestContextSlot.APPSEC) + public static class ExtractContentParametersAdvice { + @Advice.OnMethodEnter(suppress = Throwable.class) + static boolean before(@Advice.FieldValue("_contentParameters") final MultiMap map) { + if (map != null) { + return false; + } + CallDepthThreadLocalMap.incrementCallDepth(Request.class); + return true; + } + + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + static void after( + @Advice.Enter boolean proceed, + @Advice.FieldValue("_contentParameters") final MultiMap map, + @ActiveRequestContext RequestContext reqCtx, + @Advice.Thrown(readOnly = false) Throwable t) { + if (!proceed) { + return; + } + if (CallDepthThreadLocalMap.decrementCallDepth(Request.class) != 0) { + return; + } + if (map == null || map.isEmpty()) { + return; + } + + CallbackProvider cbp = AgentTracer.get().getCallbackProvider(RequestContextSlot.APPSEC); + BiFunction> callback = + cbp.getCallback(EVENTS.requestBodyProcessed()); + if (callback == null) { + return; + } + + Flow flow = callback.apply(reqCtx, map); + Flow.Action action = flow.getAction(); + if (action instanceof Flow.Action.RequestBlockingAction) { + Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action; + BlockResponseFunction blockResponseFunction = reqCtx.getBlockResponseFunction(); + if (blockResponseFunction != null) { + blockResponseFunction.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba); + if (t == null) { + t = new BlockingException("Blocked request (for Request/extractContentParameters)"); + reqCtx.getTraceSegment().effectivelyBlocked(); + } + } + } + } + } + + /** + * Fires the {@code requestFilesFilenames} event when the application calls public {@code + * getParts()}. Guards prevent double-firing: + * + *

        + *
      • {@code _contentParameters != null}: set by {@code extractContentParameters()} (the {@code + * getParameterMap()} path); means filenames were already reported via {@code + * GetFilenamesFromMultiPartAdvice}. + *
      • {@code _multiParts != null}: set by the first {@code getParts()} call in Jetty 11.0.x; + * means filenames were already reported. + *
      + */ + @RequiresRequestContext(RequestContextSlot.APPSEC) + public static class GetFilenamesAdvice { + @Advice.OnMethodEnter(suppress = Throwable.class) + static boolean before( + @Advice.FieldValue("_contentParameters") final MultiMap contentParameters, + @Advice.FieldValue(value = "_multiParts", typing = Assigner.Typing.DYNAMIC) + final Object multiParts) { + final int callDepth = CallDepthThreadLocalMap.incrementCallDepth(MultipartHelper.class); + return callDepth == 0 && contentParameters == null && multiParts == null; + } + + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + static void after( + @Advice.Enter boolean proceed, + @Advice.Return Collection parts, + @ActiveRequestContext RequestContext reqCtx, + @Advice.Thrown(readOnly = false) Throwable t) { + CallDepthThreadLocalMap.decrementCallDepth(MultipartHelper.class); + if (!proceed || t != null || parts == null || parts.isEmpty()) { + return; + } + t = MultipartHelper.fireFilenamesEvent(parts, reqCtx); + if (t == null) { + t = MultipartHelper.fireFilesContentEvent(parts, reqCtx); + } + } + } + + /** + * Fires the {@code requestFilesFilenames} event when multipart content is parsed via the internal + * {@code getParts(MultiMap)} path triggered by {@code getParameter*()} / {@code + * getParameterMap()} — i.e. when the application never calls public {@code getParts()}. + */ + @RequiresRequestContext(RequestContextSlot.APPSEC) + public static class GetFilenamesFromMultiPartAdvice { + @Advice.OnMethodEnter(suppress = Throwable.class) + static boolean before() { + return CallDepthThreadLocalMap.incrementCallDepth(MultipartHelper.class) == 0; + } + + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + static void after( + @Advice.Enter boolean proceed, + @Advice.Return Collection parts, + @ActiveRequestContext RequestContext reqCtx, + @Advice.Thrown(readOnly = false) Throwable t) { + CallDepthThreadLocalMap.decrementCallDepth(MultipartHelper.class); + if (!proceed || t != null || parts == null || parts.isEmpty()) { + return; + } + t = MultipartHelper.fireFilenamesEvent(parts, reqCtx); + if (t == null) { + t = MultipartHelper.fireFilesContentEvent(parts, reqCtx); + } + } + } +} diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-11.0/src/test/java/datadog/trace/instrumentation/jetty11/MultipartHelperTest.java b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-11.0/src/test/java/datadog/trace/instrumentation/jetty11/MultipartHelperTest.java new file mode 100644 index 00000000000..6d20a79bbb4 --- /dev/null +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-11.0/src/test/java/datadog/trace/instrumentation/jetty11/MultipartHelperTest.java @@ -0,0 +1,147 @@ +package datadog.trace.instrumentation.jetty11; + +import static java.util.Arrays.asList; +import static java.util.Collections.emptyList; +import static java.util.Collections.singletonList; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import jakarta.servlet.http.Part; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Test; + +class MultipartHelperTest { + + @Test + void returnsEmptyListForNull() { + assertEquals(emptyList(), MultipartHelper.extractFilenames(null)); + } + + @Test + void returnsEmptyListForEmpty() { + assertEquals(emptyList(), MultipartHelper.extractFilenames(emptyList())); + } + + @Test + void returnsEmptyListWhenAllPartsHaveNullFilename() { + List parts = asList(part(null), part(null)); + assertEquals(emptyList(), MultipartHelper.extractFilenames(parts)); + } + + @Test + void returnsEmptyListWhenAllPartsHaveEmptyFilename() { + List parts = asList(part(""), part("")); + assertEquals(emptyList(), MultipartHelper.extractFilenames(parts)); + } + + @Test + void extractsFilenameFromSinglePart() { + List parts = singletonList(part("photo.jpg")); + assertEquals(singletonList("photo.jpg"), MultipartHelper.extractFilenames(parts)); + } + + @Test + void extractsFilenamesFromMultipleParts() { + List parts = asList(part("a.jpg"), part("b.png"), part("c.pdf")); + assertEquals(asList("a.jpg", "b.png", "c.pdf"), MultipartHelper.extractFilenames(parts)); + } + + @Test + void skipsPartsWithNullOrEmptyFilenameAndKeepsValid() { + List parts = asList(part(null), part("valid.txt"), part(""), part("other.zip")); + assertEquals(asList("valid.txt", "other.zip"), MultipartHelper.extractFilenames(parts)); + } + + @Test + void preservesFilenamesWithSpacesAndSpecialCharacters() { + List parts = asList(part("my file.tar.gz"), part("résumé.pdf")); + assertEquals(asList("my file.tar.gz", "résumé.pdf"), MultipartHelper.extractFilenames(parts)); + } + + private Part part(String submittedFileName) { + Part p = mock(Part.class); + when(p.getSubmittedFileName()).thenReturn(submittedFileName); + return p; + } + + // ── extractContents ───────────────────────────────────────────────────────── + + @Test + void extractContentsReturnsEmptyListForNull() { + assertEquals(emptyList(), MultipartHelper.extractContents(null)); + } + + @Test + void extractContentsReturnsEmptyListForEmpty() { + assertEquals(emptyList(), MultipartHelper.extractContents(emptyList())); + } + + @Test + void extractContentsSkipsFormFieldParts() { + List parts = asList(part(null), part(null)); + assertEquals(emptyList(), MultipartHelper.extractContents(parts)); + } + + @Test + void extractContentsIncludesFileWithEmptyFilename() throws IOException { + Part p = mock(Part.class); + when(p.getSubmittedFileName()).thenReturn(""); + when(p.getInputStream()) + .thenReturn(new ByteArrayInputStream("data".getBytes(StandardCharsets.UTF_8))); + when(p.getContentType()).thenReturn("text/plain; charset=UTF-8"); + assertEquals(singletonList("data"), MultipartHelper.extractContents(singletonList(p))); + } + + @Test + void extractContentsReadsFileContent() throws IOException { + Part p = mock(Part.class); + when(p.getSubmittedFileName()).thenReturn("photo.jpg"); + when(p.getInputStream()) + .thenReturn(new ByteArrayInputStream("file-content".getBytes(StandardCharsets.UTF_8))); + when(p.getContentType()).thenReturn("text/plain; charset=UTF-8"); + assertEquals(singletonList("file-content"), MultipartHelper.extractContents(singletonList(p))); + } + + @Test + void extractContentsTruncatesAtMaxContentBytes() throws IOException { + byte[] large = new byte[MultipartHelper.MAX_CONTENT_BYTES + 1]; + Arrays.fill(large, (byte) 'A'); + Part p = mock(Part.class); + when(p.getSubmittedFileName()).thenReturn("big.bin"); + when(p.getInputStream()).thenReturn(new ByteArrayInputStream(large)); + when(p.getContentType()).thenReturn(null); + List contents = MultipartHelper.extractContents(singletonList(p)); + assertEquals(1, contents.size()); + assertEquals(MultipartHelper.MAX_CONTENT_BYTES, contents.get(0).length()); + } + + @Test + void extractContentsReturnsEmptyStringOnIOException() throws IOException { + Part p = mock(Part.class); + when(p.getSubmittedFileName()).thenReturn("file.txt"); + when(p.getInputStream()).thenThrow(new IOException("simulated")); + assertEquals(singletonList(""), MultipartHelper.extractContents(singletonList(p))); + } + + @Test + void extractContentsCappsAtMaxFilesToInspect() throws IOException { + int count = MultipartHelper.MAX_FILES_TO_INSPECT + 1; + List parts = new ArrayList<>(count); + for (int i = 0; i < count; i++) { + Part p = mock(Part.class); + when(p.getSubmittedFileName()).thenReturn("file" + i + ".txt"); + when(p.getInputStream()) + .thenReturn(new ByteArrayInputStream("c".getBytes(StandardCharsets.UTF_8))); + when(p.getContentType()).thenReturn(null); + parts.add(p); + } + List contents = MultipartHelper.extractContents(parts); + assertEquals(MultipartHelper.MAX_FILES_TO_INSPECT, contents.size()); + } +} diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-7.0/gradle.lockfile b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-7.0/gradle.lockfile index 31bc1eaf370..9fd13175c0c 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-7.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-7.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-7.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,13 +51,13 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath javax.servlet:servlet-api:2.5=compileClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,6 +91,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -104,14 +109,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-7.0/src/main/java/datadog/trace/instrumentation/jetty70/RequestExtractParametersInstrumentation.java b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-7.0/src/main/java/datadog/trace/instrumentation/jetty70/RequestExtractParametersInstrumentation.java index e2405b77a29..30c10f70a15 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-7.0/src/main/java/datadog/trace/instrumentation/jetty70/RequestExtractParametersInstrumentation.java +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-7.0/src/main/java/datadog/trace/instrumentation/jetty70/RequestExtractParametersInstrumentation.java @@ -46,7 +46,7 @@ static int before() { return CallDepthThreadLocalMap.incrementCallDepth(Request.class); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after(@Advice.Enter final int depth) { if (depth > 0) { return; diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-7.0/src/main/java/datadog/trace/instrumentation/jetty70/UrlEncodedInstrumentation.java b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-7.0/src/main/java/datadog/trace/instrumentation/jetty70/UrlEncodedInstrumentation.java index 376b2a2c58b..76dc3fcca64 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-7.0/src/main/java/datadog/trace/instrumentation/jetty70/UrlEncodedInstrumentation.java +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-7.0/src/main/java/datadog/trace/instrumentation/jetty70/UrlEncodedInstrumentation.java @@ -72,7 +72,7 @@ static boolean before( return true; } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Enter boolean relevantCall, @Advice.Argument(1) MultiMap map, // this is our map, not the orig arg diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-8.1.3/build.gradle b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-8.1.3/build.gradle index 86e26948d2d..70a700f8294 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-8.1.3/build.gradle +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-8.1.3/build.gradle @@ -11,6 +11,8 @@ apply from: "$rootDir/gradle/java.gradle" dependencies { compileOnly group: 'org.eclipse.jetty', name: 'jetty-server', version: '8.1.3.v20120416' -} + testImplementation group: 'org.eclipse.jetty', name: 'jetty-server', version: '8.1.3.v20120416' -// testing happens in the jetty-* modules + testImplementation libs.bundles.mockito + testImplementation group: 'javax.servlet', name: 'javax.servlet-api', version: '3.0.1' +} diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-8.1.3/gradle.lockfile b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-8.1.3/gradle.lockfile index 4e9a8f3e6ed..4aa56b06864 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-8.1.3/gradle.lockfile +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-8.1.3/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-8.1.3:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -76,17 +80,18 @@ org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.eclipse.jetty.orbit:javax.servlet:3.0.0.v201112011016=compileClasspath -org.eclipse.jetty:jetty-continuation:8.1.3.v20120416=compileClasspath -org.eclipse.jetty:jetty-http:8.1.3.v20120416=compileClasspath -org.eclipse.jetty:jetty-io:8.1.3.v20120416=compileClasspath -org.eclipse.jetty:jetty-server:8.1.3.v20120416=compileClasspath -org.eclipse.jetty:jetty-util:8.1.3.v20120416=compileClasspath +org.eclipse.jetty.orbit:javax.servlet:3.0.0.v201112011016=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.eclipse.jetty:jetty-continuation:8.1.3.v20120416=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.eclipse.jetty:jetty-http:8.1.3.v20120416=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.eclipse.jetty:jetty-io:8.1.3.v20120416=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.eclipse.jetty:jetty-server:8.1.3.v20120416=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.eclipse.jetty:jetty-util:8.1.3.v20120416=compileClasspath,testCompileClasspath,testRuntimeClasspath org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -99,19 +104,20 @@ org.junit.platform:junit-platform-suite-api:1.14.1=testRuntimeClasspath org.junit.platform:junit-platform-suite-commons:1.14.1=testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath -org.mockito:mockito-core:4.4.0=testRuntimeClasspath +org.mockito:mockito-core:4.4.0=testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-8.1.3/src/main/java/datadog/trace/instrumentation/jetty8/ParameterCollector.java b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-8.1.3/src/main/java/datadog/trace/instrumentation/jetty8/ParameterCollector.java deleted file mode 100644 index 73e7038238e..00000000000 --- a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-8.1.3/src/main/java/datadog/trace/instrumentation/jetty8/ParameterCollector.java +++ /dev/null @@ -1,59 +0,0 @@ -package datadog.trace.instrumentation.jetty8; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public interface ParameterCollector { - boolean isEmpty(); - - void put(String key, String value); - - Map> getMap(); - - class ParameterCollectorNoop implements ParameterCollector { - public static final ParameterCollector INSTANCE = new ParameterCollectorNoop(); - - private ParameterCollectorNoop() {} - - @Override - public boolean isEmpty() { - return true; - } - - @Override - public void put(String key, String value) {} - - @Override - public Map> getMap() { - return Collections.emptyMap(); - } - } - - class ParameterCollectorImpl implements ParameterCollector { - public Map> map; - - public boolean isEmpty() { - return map == null; - } - - public void put(String key, String value) { - if (map == null) { - map = new HashMap<>(); - } - List strings = map.get(key); - if (strings == null) { - strings = new ArrayList<>(); - map.put(key, strings); - } - strings.add(value); - } - - @Override - public Map> getMap() { - return map; - } - } -} diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-8.1.3/src/main/java/datadog/trace/instrumentation/jetty8/PartHelper.java b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-8.1.3/src/main/java/datadog/trace/instrumentation/jetty8/PartHelper.java new file mode 100644 index 00000000000..468a93a028d --- /dev/null +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-8.1.3/src/main/java/datadog/trace/instrumentation/jetty8/PartHelper.java @@ -0,0 +1,397 @@ +package datadog.trace.instrumentation.jetty8; + +import static datadog.trace.api.gateway.Events.EVENTS; +import static datadog.trace.api.telemetry.LogCollector.EXCLUDE_TELEMETRY; + +import datadog.appsec.api.blocking.BlockingException; +import datadog.trace.api.Config; +import datadog.trace.api.gateway.BlockResponseFunction; +import datadog.trace.api.gateway.CallbackProvider; +import datadog.trace.api.gateway.Flow; +import datadog.trace.api.gateway.RequestContext; +import datadog.trace.api.gateway.RequestContextSlot; +import datadog.trace.api.http.MultipartContentDecoder; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.function.BiFunction; +import javax.servlet.http.Part; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Helper for extracting filenames and form-field values from Servlet 3.0 {@link Part} objects. + * + *

      {@code Part.getSubmittedFileName()} was added in Servlet 3.1 (Jetty 9.1+); for Jetty 8.x we + * must parse the {@code Content-Disposition} header manually. + */ +public class PartHelper { + + private static final Logger log = LoggerFactory.getLogger(PartHelper.class); + + public static final int MAX_CONTENT_BYTES = Config.get().getAppSecMaxFileContentBytes(); + public static final int MAX_FILES_TO_INSPECT = Config.get().getAppSecMaxFileContentCount(); + + private PartHelper() {} + + // Lazily resolves MultiPartInputStream.getParts() as a MethodHandle on first class access. + // Uses IODH so no volatile is needed; the JVM class-loading guarantee ensures safe publication. + private static final class MpiGetPartsHolder { + static final MethodHandle GET_PARTS; + + static { + MethodHandle h = null; + try { + Class cls = + Class.forName( + "org.eclipse.jetty.util.MultiPartInputStream", + false, + MpiGetPartsHolder.class.getClassLoader()); + h = MethodHandles.lookup().unreflect(cls.getMethod("getParts")); + } catch (Exception ignored) { + // class or method not available — getAllParts() falls back to singleton + } + GET_PARTS = h; + } + } + + /** + * Returns all parts from a {@code MultiPartInputStream} object (already-parsed, no re-trigger). + * Falls back to a singleton of {@code singlePart} if reflection fails or the collection is empty. + */ + public static Collection getAllParts(Object multiPartInputStream, Part singlePart) { + if (multiPartInputStream != null) { + MethodHandle mh = MpiGetPartsHolder.GET_PARTS; + if (mh != null) { + try { + @SuppressWarnings("unchecked") + Collection all = (Collection) mh.invoke(multiPartInputStream); + if (all != null && !all.isEmpty()) { + return all; + } + } catch (Throwable e) { + log.debug("getAllParts: MethodHandle invocation failed, falling back to singleton", e); + } + } + } + return singlePart != null ? Collections.singletonList(singlePart) : Collections.emptyList(); + } + + /** + * Returns filenames found in {@code parts} by parsing each part's {@code Content-Disposition} + * header for a {@code filename=} parameter. + */ + public static List extractFilenames(Collection parts) { + if (parts == null || parts.isEmpty()) { + return Collections.emptyList(); + } + List filenames = new ArrayList<>(parts.size()); + for (Object obj : parts) { + try { + String filename = filenameFromPart((Part) obj); + if (filename != null && !filename.isEmpty()) { + filenames.add(filename); + } + } catch (Exception e) { + log.debug(EXCLUDE_TELEMETRY, "extractFilenames: skipping malformed part", e); + } + } + return filenames; + } + + /** + * Returns a name→values map of form-field parts (those without a {@code filename=} parameter). + * File-upload parts are skipped to avoid reading potentially large content. Reads up to {@link + * #MAX_CONTENT_BYTES} bytes per field, up to {@link #MAX_FILES_TO_INSPECT} fields total — same + * knobs and cap pattern as {@link #extractContents} uses for file content, reused here since + * there is no dedicated "max form fields" config. + */ + public static Map> extractFormFields(Collection parts) { + if (parts == null || parts.isEmpty()) { + return Collections.emptyMap(); + } + Map> result = new LinkedHashMap<>(); + int count = 0; + for (Object obj : parts) { + if (count >= MAX_FILES_TO_INSPECT) { + break; + } + try { + Part part = (Part) obj; + if (filenameFromPart(part) != null) { + continue; // file-upload part — skip + } + String name = part.getName(); + if (name == null) { + continue; + } + String value = readPartContent(part); + if (value == null) { + continue; + } + result.computeIfAbsent(name, k -> new ArrayList<>()).add(value); + count++; + } catch (Exception e) { + log.debug(EXCLUDE_TELEMETRY, "extractFormFields: skipping malformed part", e); + } + } + return result; + } + + /** + * Extracts the {@code filename} value from a {@code Content-Disposition} header, or {@code null} + * if the part has no filename (i.e. it is a plain form field). + * + *

      Uses a quote-aware parser so that semicolons inside a quoted filename (e.g. {@code + * filename="shell;evil.php"}) are not mistaken for parameter separators. + */ + static String filenameFromPart(Part part) { + String cd = part.getHeader("Content-Disposition"); + if (cd == null) { + return null; + } + int len = cd.length(); + int i = 0; + while (i < len) { + // Skip separators between parameters + while (i < len && (cd.charAt(i) == ';' || cd.charAt(i) == ' ' || cd.charAt(i) == '\t')) { + i++; + } + if (i >= len) break; + // Read parameter name (up to '=' or ';') + int nameStart = i; + while (i < len && cd.charAt(i) != '=' && cd.charAt(i) != ';') { + i++; + } + boolean isFilename = "filename".equalsIgnoreCase(cd.substring(nameStart, i).trim()); + if (i >= len || cd.charAt(i) == ';') { + // Value-less token (e.g. "form-data") — skip + continue; + } + i++; // skip '=' + String value; + if (i < len && cd.charAt(i) == '"') { + i++; // skip opening quote + StringBuilder sb = new StringBuilder(); + while (i < len && cd.charAt(i) != '"') { + if (cd.charAt(i) == '\\' && i + 1 < len) { + i++; // consume escape backslash, add next char literally + } + sb.append(cd.charAt(i++)); + } + if (i < len) i++; // skip closing quote + value = sb.toString(); + } else { + int valueStart = i; + while (i < len && cd.charAt(i) != ';') { + i++; + } + value = cd.substring(valueStart, i).trim(); + } + if (isFilename) { + // Return empty string (not null) so callers can distinguish "filename present but empty" + // from "no filename parameter". extractFormFields() uses != null to skip file parts, + // so empty string correctly prevents buffering a file-upload body with filename="". + return value; + } + } + return null; + } + + /** + * Fires the {@code requestBodyProcessed} IG event for form-field parts in {@code parts} and + * returns a {@link BlockingException} if the WAF requests blocking, or {@code null} otherwise. + */ + public static BlockingException fireBodyProcessedEvent( + Collection parts, RequestContext reqCtx) { + CallbackProvider cbp = AgentTracer.get().getCallbackProvider(RequestContextSlot.APPSEC); + BiFunction> callback = + cbp.getCallback(EVENTS.requestBodyProcessed()); + if (callback == null) { + return null; + } + Map> formFields = extractFormFields(parts); + if (formFields.isEmpty()) { + return null; + } + Flow flow = callback.apply(reqCtx, formFields); + Flow.Action action = flow.getAction(); + if (action instanceof Flow.Action.RequestBlockingAction) { + Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action; + BlockResponseFunction brf = reqCtx.getBlockResponseFunction(); + if (brf != null) { + if (brf.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba)) { + reqCtx.getTraceSegment().effectivelyBlocked(); + return new BlockingException("Blocked request (multipart form fields)"); + } + } + } + return null; + } + + /** + * Fires the {@code requestFilesFilenames} IG event for file-upload parts in {@code parts} and + * returns a {@link BlockingException} if the WAF requests blocking, or {@code null} otherwise. + */ + public static BlockingException fireFilenamesEvent(Collection parts, RequestContext reqCtx) { + CallbackProvider cbp = AgentTracer.get().getCallbackProvider(RequestContextSlot.APPSEC); + BiFunction, Flow> callback = + cbp.getCallback(EVENTS.requestFilesFilenames()); + if (callback == null) { + return null; + } + List filenames = extractFilenames(parts); + if (filenames.isEmpty()) { + return null; + } + Flow flow = callback.apply(reqCtx, filenames); + Flow.Action action = flow.getAction(); + if (action instanceof Flow.Action.RequestBlockingAction) { + Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action; + BlockResponseFunction brf = reqCtx.getBlockResponseFunction(); + if (brf != null) { + if (brf.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba)) { + reqCtx.getTraceSegment().effectivelyBlocked(); + return new BlockingException("Blocked request (multipart file upload)"); + } + } + } + return null; + } + + /** + * Extracts file content from a collection of multipart {@link Part}s. Form fields (those without + * a {@code filename} parameter in the {@code Content-Disposition} header) are skipped. Reads up + * to {@link #MAX_CONTENT_BYTES} bytes per part, up to {@link #MAX_FILES_TO_INSPECT} parts total. + * + * @return list of decoded content strings; never {@code null}, may be empty + */ + public static List extractContents(Collection parts) { + if (parts == null || parts.isEmpty()) { + return Collections.emptyList(); + } + List contents = new ArrayList<>(Math.min(parts.size(), MAX_FILES_TO_INSPECT)); + for (Object obj : parts) { + if (contents.size() >= MAX_FILES_TO_INSPECT) { + break; + } + try { + Part part = (Part) obj; + if (filenameFromPart(part) == null) { + continue; // form field — skip + } + contents.add(readFileContent(part)); + } catch (Exception e) { + log.debug(EXCLUDE_TELEMETRY, "extractContents: skipping malformed part", e); + } + } + return contents; + } + + private static String readFileContent(Part part) { + try (InputStream is = part.getInputStream()) { + return MultipartContentDecoder.readInputStream(is, MAX_CONTENT_BYTES, part.getContentType()); + } catch (Exception e) { + log.debug(EXCLUDE_TELEMETRY, "readFileContent: stream read failed", e); + return ""; + } + } + + /** + * Fires the {@code requestFilesContent} IG event for file-upload parts in {@code parts} and + * returns a {@link BlockingException} if the WAF requests blocking, or {@code null} otherwise. + */ + public static BlockingException fireFilesContentEvent( + Collection parts, RequestContext reqCtx) { + CallbackProvider cbp = AgentTracer.get().getCallbackProvider(RequestContextSlot.APPSEC); + BiFunction, Flow> callback = + cbp.getCallback(EVENTS.requestFilesContent()); + if (callback == null) { + return null; + } + List contents = extractContents(parts); + if (contents.isEmpty()) { + return null; + } + Flow flow = callback.apply(reqCtx, contents); + Flow.Action action = flow.getAction(); + if (action instanceof Flow.Action.RequestBlockingAction) { + Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action; + BlockResponseFunction brf = reqCtx.getBlockResponseFunction(); + if (brf != null) { + if (brf.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba)) { + reqCtx.getTraceSegment().effectivelyBlocked(); + return new BlockingException("Blocked request (multipart file content)"); + } + } + } + return null; + } + + private static String readPartContent(Part part) { + Charset charset = charsetFromContentType(part.getContentType()); + // Bound the buffered form-field text by the file-content byte cap. There is no dedicated + // "max form-field bytes" config, so we intentionally reuse MAX_CONTENT_BYTES: + // this is the only framework that must manually buffer form-field text (Servlet 3.0 has no + // container-side bound), and without a cap a single huge text field could exhaust the heap. + try (InputStream is = part.getInputStream()) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + byte[] buf = new byte[4096]; + int total = 0; + int read; + while (total < MAX_CONTENT_BYTES + && (read = is.read(buf, 0, Math.min(buf.length, MAX_CONTENT_BYTES - total))) != -1) { + baos.write(buf, 0, read); + total += read; + } + return new String(baos.toByteArray(), charset); + } catch (IOException e) { + log.debug(EXCLUDE_TELEMETRY, "readPartContent: stream read failed", e); + return null; + } + } + + /** + * Parses the {@code charset} parameter from a {@code Content-Type} header value (e.g. {@code + * text/plain; charset=ISO-8859-1}). Returns UTF-8 when absent, unknown, or {@code null}. + */ + static Charset charsetFromContentType(String contentType) { + if (contentType != null) { + int idx = contentType.toLowerCase(Locale.ROOT).indexOf("charset="); + if (idx >= 0) { + String name = contentType.substring(idx + 8).trim(); + if (!name.isEmpty() && name.charAt(0) == '"') { + name = name.substring(1); + int end = name.indexOf('"'); + if (end >= 0) name = name.substring(0, end); + } else { + int end = 0; + while (end < name.length() + && name.charAt(end) != ';' + && !Character.isWhitespace(name.charAt(end))) { + end++; + } + name = name.substring(0, end); + } + try { + return Charset.forName(name); + } catch (Exception ignored) { + // unknown or unsupported charset name — fall back to UTF-8 + } + } + } + return StandardCharsets.UTF_8; + } +} diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-8.1.3/src/main/java/datadog/trace/instrumentation/jetty8/RequestGetPartsInstrumentation.java b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-8.1.3/src/main/java/datadog/trace/instrumentation/jetty8/RequestGetPartsInstrumentation.java index 104a3affa7c..96ec5ff528a 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-8.1.3/src/main/java/datadog/trace/instrumentation/jetty8/RequestGetPartsInstrumentation.java +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-8.1.3/src/main/java/datadog/trace/instrumentation/jetty8/RequestGetPartsInstrumentation.java @@ -1,48 +1,35 @@ package datadog.trace.instrumentation.jetty8; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; -import static datadog.trace.api.gateway.Events.EVENTS; import static net.bytebuddy.matcher.ElementMatchers.takesArgument; import static net.bytebuddy.matcher.ElementMatchers.takesArguments; import com.google.auto.service.AutoService; import datadog.appsec.api.blocking.BlockingException; +import datadog.trace.advice.ActiveRequestContext; +import datadog.trace.advice.RequiresRequestContext; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; -import datadog.trace.api.gateway.BlockResponseFunction; -import datadog.trace.api.gateway.CallbackProvider; -import datadog.trace.api.gateway.Flow; import datadog.trace.api.gateway.RequestContext; import datadog.trace.api.gateway.RequestContextSlot; -import datadog.trace.bootstrap.instrumentation.api.AgentSpan; -import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import datadog.trace.bootstrap.CallDepthThreadLocalMap; import java.io.IOException; import java.io.InputStream; -import java.util.function.BiFunction; -import javax.servlet.ServletException; +import java.util.Collection; +import javax.servlet.http.Part; import net.bytebuddy.asm.Advice; -import net.bytebuddy.asm.AsmVisitorWrapper; -import net.bytebuddy.description.field.FieldDescription; -import net.bytebuddy.description.field.FieldList; -import net.bytebuddy.description.method.MethodList; -import net.bytebuddy.description.type.TypeDescription; -import net.bytebuddy.implementation.Implementation; +import net.bytebuddy.implementation.bytecode.assign.Assigner; import net.bytebuddy.jar.asm.ClassReader; import net.bytebuddy.jar.asm.ClassVisitor; -import net.bytebuddy.jar.asm.ClassWriter; import net.bytebuddy.jar.asm.FieldVisitor; import net.bytebuddy.jar.asm.MethodVisitor; import net.bytebuddy.jar.asm.Opcodes; -import net.bytebuddy.jar.asm.Type; import net.bytebuddy.matcher.ElementMatcher; -import net.bytebuddy.pool.TypePool; -import org.eclipse.jetty.server.Request; +import net.bytebuddy.utility.OpenedClassReader; @AutoService(InstrumenterModule.class) public class RequestGetPartsInstrumentation extends InstrumenterModule.AppSec - implements Instrumenter.ForSingleType, - Instrumenter.HasTypeAdvice, - Instrumenter.HasMethodAdvice { + implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { public RequestGetPartsInstrumentation() { super("jetty"); } @@ -55,25 +42,17 @@ public String instrumentedType() { @Override public String[] helperClassNames() { return new String[] { - packageName + ".ParameterCollector", - packageName + ".ParameterCollector$ParameterCollectorImpl", - packageName + ".ParameterCollector$ParameterCollectorNoop", + packageName + ".PartHelper", packageName + ".PartHelper$MpiGetPartsHolder" }; } - @Override - public void typeAdvice(TypeTransformer transformer) { - transformer.applyAdvice(new GetPartsVisitorWrapper()); - } - @Override public void methodAdvice(MethodTransformer transformer) { transformer.applyAdvice( - named("getPart") - .and(takesArguments(1)) - .and(takesArgument(0, String.class)) - .or(named("getParts").and(takesArguments(0))), - getClass().getName() + "$GetPartsAdvice"); + named("getParts").and(takesArguments(0)), getClass().getName() + "$GetFilenamesAdvice"); + transformer.applyAdvice( + named("getPart").and(takesArguments(1)).and(takesArgument(0, String.class)), + getClass().getName() + "$GetPartAdvice"); } @Override @@ -108,7 +87,7 @@ public static class ClassLoaderMatcherClassVisitor extends ClassVisitor { final boolean[] foundGetParameters; public ClassLoaderMatcherClassVisitor(boolean[] foundField, boolean[] foundGetParameters) { - super(Opcodes.ASM9); + super(OpenedClassReader.ASM_API); this.foundField = foundField; this.foundGetParameters = foundGetParameters; } @@ -126,7 +105,7 @@ public FieldVisitor visitField( public MethodVisitor visitMethod( int access, String name, String descriptor, String signature, String[] exceptions) { if (name.equals("getParts") && "()Ljava/util/Collection;".equals(descriptor)) { - return new MethodVisitor(Opcodes.ASM9) { + return new MethodVisitor(OpenedClassReader.ASM_API) { @Override public void visitMethodInsn( int opcode, String owner, String name, String descriptor, boolean isInterface) { @@ -142,134 +121,86 @@ public void visitMethodInsn( } } - public static class GetPartsAdvice { + @RequiresRequestContext(RequestContextSlot.APPSEC) + public static class GetFilenamesAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) - static void before( - @Advice.Local("collector") ParameterCollector collector, - @Advice.Local("reqCtx") RequestContext reqCtx) { - AgentSpan agentSpan = AgentTracer.activeSpan(); - if (agentSpan != null) { - RequestContext requestContext = agentSpan.getRequestContext(); - if (requestContext != null && requestContext.getData(RequestContextSlot.APPSEC) != null) { - reqCtx = requestContext; - collector = new ParameterCollector.ParameterCollectorImpl(); - return; - } - } - // this variable is used in the custom instrumentation below - collector = ParameterCollector.ParameterCollectorNoop.INSTANCE; + static boolean before( + @Advice.FieldValue(value = "_multiPartInputStream", typing = Assigner.Typing.DYNAMIC) + final Object multiPartInputStream) { + final int callDepth = CallDepthThreadLocalMap.incrementCallDepth(Collection.class); + // _multiPartInputStream is null before the first parse; non-null on cached repeat calls. + // In Jetty 9.0/9.1, getPart(String) delegates to getParts() internally, triggering both + // GetPartAdvice and GetFilenamesAdvice — double-firing the filename event. + // If GetPartAdvice is already active (Part.class depth > 0) it will handle the event; skip. + return callDepth == 0 + && multiPartInputStream == null + && CallDepthThreadLocalMap.getCallDepth(Part.class) == 0; } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( - @Advice.Local("collector") ParameterCollector collector, - @Advice.Local("reqCtx") RequestContext reqCtx, + @Advice.Enter boolean proceed, + @Advice.Return Collection parts, + @ActiveRequestContext RequestContext reqCtx, @Advice.Thrown(readOnly = false) Throwable t) { - if (t != null || reqCtx == null || collector.isEmpty()) { + CallDepthThreadLocalMap.decrementCallDepth(Collection.class); + if (!proceed || t != null || parts == null || parts.isEmpty()) { return; } - - CallbackProvider cbp = AgentTracer.get().getCallbackProvider(RequestContextSlot.APPSEC); - BiFunction> callback = - cbp.getCallback(EVENTS.requestBodyProcessed()); - if (callback == null) { - return; - } - Flow flow = callback.apply(reqCtx, collector.getMap()); - Flow.Action action = flow.getAction(); - if (action instanceof Flow.Action.RequestBlockingAction) { - Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action; - BlockResponseFunction blockResponseFunction = reqCtx.getBlockResponseFunction(); - if (blockResponseFunction != null) { - blockResponseFunction.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba); - if (t == null) { - t = new BlockingException("Blocked request (for Request/parsePart(s))"); - } - } - } - } - - static void muzzle(Request req) throws ServletException, IOException { - req.getParts(); + BlockingException bodyBlock = PartHelper.fireBodyProcessedEvent(parts, reqCtx); + BlockingException filenamesBlock = PartHelper.fireFilenamesEvent(parts, reqCtx); + BlockingException contentBlock = + bodyBlock == null && filenamesBlock == null + ? PartHelper.fireFilesContentEvent(parts, reqCtx) + : null; + t = bodyBlock != null ? bodyBlock : (filenamesBlock != null ? filenamesBlock : contentBlock); } } - public static class GetPartsVisitorWrapper implements AsmVisitorWrapper { - @Override - public int mergeWriter(int flags) { - return flags | ClassWriter.COMPUTE_MAXS; - } - - @Override - public int mergeReader(int flags) { - return flags; - } - - @Override - public ClassVisitor wrap( - TypeDescription instrumentedType, - ClassVisitor classVisitor, - Implementation.Context implementationContext, - TypePool typePool, - FieldList fields, - MethodList methods, - int writerFlags, - int readerFlags) { - return new RequestClassVisitor(Opcodes.ASM8, classVisitor); - } - } - - public static class RequestClassVisitor extends ClassVisitor { - public RequestClassVisitor(int api, ClassVisitor cv) { - super(api, cv); + /** + * Fires AppSec events for requests whose first multipart access is {@code getPart(String)}. + * + *

      In Jetty 8.x, {@code getPart(String)} parses and caches the entire multipart stream into + * {@code _multiPartInputStream} but returns only the single requested part. If the app only calls + * {@code getPart("field")} (a text field), any co-uploaded file parts would never reach {@code + * requestFilesFilenames}. We therefore read all cached parts via {@code + * MultiPartInputStream.getParts()} and fall back to the returned singleton only if that fails. + */ + @RequiresRequestContext(RequestContextSlot.APPSEC) + public static class GetPartAdvice { + @Advice.OnMethodEnter(suppress = Throwable.class) + static boolean before( + @Advice.FieldValue(value = "_multiPartInputStream", typing = Assigner.Typing.DYNAMIC) + Object multiPartInputStream) { + // _multiPartInputStream is null before the first parse. Once set, all parts are cached and + // events have already fired (either here or in GetFilenamesAdvice). Skip on repeat calls. + return CallDepthThreadLocalMap.incrementCallDepth(Part.class) == 0 + && multiPartInputStream == null; } - @Override - public MethodVisitor visitMethod( - int access, String name, String descriptor, String signature, String[] exceptions) { - MethodVisitor superMv = super.visitMethod(access, name, descriptor, signature, exceptions); - if ("getPart".equals(name) - && "(Ljava/lang/String;)Ljavax/servlet/http/Part;".equals(descriptor) - || "getParts".equals(name) && "()Ljava/util/Collection;".equals(descriptor)) { - return new GetPartsMethodVisitor(api, superMv, descriptor.startsWith("()") ? 1 : 2); - } else { - return superMv; + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + static void after( + @Advice.Enter boolean proceed, + @Advice.Return Part part, + @Advice.FieldValue(value = "_multiPartInputStream", typing = Assigner.Typing.DYNAMIC) + Object multiPartInputStream, + @ActiveRequestContext RequestContext reqCtx, + @Advice.Thrown(readOnly = false) Throwable t) { + CallDepthThreadLocalMap.decrementCallDepth(Part.class); + if (!proceed || t != null) { + return; } - } - } - - public static class GetPartsMethodVisitor extends MethodVisitor { - private final int collectedParamsVar; - - public GetPartsMethodVisitor(int api, MethodVisitor superMv, int collectedParamsVar) { - super(api, superMv); - this.collectedParamsVar = collectedParamsVar; - } - - @Override - public void visitMethodInsn( - int opcode, String owner, String name, String descriptor, boolean isInterface) { - if (opcode == Opcodes.INVOKEVIRTUAL - && owner.equals("org/eclipse/jetty/util/MultiMap") - && name.equals("add") - && descriptor.equals("(Ljava/lang/String;Ljava/lang/Object;)V")) { - super.visitVarInsn(Opcodes.ALOAD, collectedParamsVar); - // stack: ..., key, value, collParams - super.visitInsn(Opcodes.DUP_X2); - // stack: ..., collParams, key, value, collParams - super.visitInsn(Opcodes.POP); - // stack: ..., collParams, key, value - super.visitInsn(Opcodes.DUP2_X1); - // stack: ..., key, value, collParams, key, value - super.visitMethodInsn( - Opcodes.INVOKEINTERFACE, - Type.getInternalName(ParameterCollector.class), - "put", - "(Ljava/lang/String;Ljava/lang/String;)V", - true); - // original stack + Collection parts = PartHelper.getAllParts(multiPartInputStream, part); + if (parts.isEmpty()) { + return; } - super.visitMethodInsn(opcode, owner, name, descriptor, isInterface); + BlockingException bodyBlock = PartHelper.fireBodyProcessedEvent(parts, reqCtx); + BlockingException filenamesBlock = PartHelper.fireFilenamesEvent(parts, reqCtx); + BlockingException contentBlock = + bodyBlock == null && filenamesBlock == null + ? PartHelper.fireFilesContentEvent(parts, reqCtx) + : null; + t = bodyBlock != null ? bodyBlock : (filenamesBlock != null ? filenamesBlock : contentBlock); } } } diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-8.1.3/src/test/java/datadog/trace/instrumentation/jetty8/PartHelperTest.java b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-8.1.3/src/test/java/datadog/trace/instrumentation/jetty8/PartHelperTest.java new file mode 100644 index 00000000000..5826698454d --- /dev/null +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-8.1.3/src/test/java/datadog/trace/instrumentation/jetty8/PartHelperTest.java @@ -0,0 +1,425 @@ +package datadog.trace.instrumentation.jetty8; + +import static java.util.Arrays.asList; +import static java.util.Arrays.fill; +import static java.util.Collections.emptyList; +import static java.util.Collections.singletonList; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import datadog.trace.api.Config; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import javax.servlet.http.Part; +import org.eclipse.jetty.util.MultiPartInputStream; +import org.junit.jupiter.api.Test; + +class PartHelperTest { + + // ── extractFilenames ──────────────────────────────────────────────────────── + + @Test + void extractFilenamesReturnsEmptyListForNull() { + assertEquals(emptyList(), PartHelper.extractFilenames(null)); + } + + @Test + void extractFilenamesReturnsEmptyListForEmpty() { + assertEquals(emptyList(), PartHelper.extractFilenames(emptyList())); + } + + @Test + void extractFilenamesReturnsEmptyListWhenNoPartsHaveFilename() { + List parts = asList(formField("a"), formField("b")); + assertEquals(emptyList(), PartHelper.extractFilenames(parts)); + } + + @Test + void extractFilenamesExtractsFilenameFromSingleFilePart() { + List parts = singletonList(filePart("photo.jpg")); + assertEquals(singletonList("photo.jpg"), PartHelper.extractFilenames(parts)); + } + + @Test + void extractFilenamesExtractsFilenamesFromMultipleFileParts() { + List parts = asList(filePart("a.jpg"), filePart("b.png"), filePart("c.pdf")); + assertEquals(asList("a.jpg", "b.png", "c.pdf"), PartHelper.extractFilenames(parts)); + } + + @Test + void extractFilenamesSkipsFormFieldPartsAndKeepsFileParts() { + List parts = asList(formField("x"), filePart("upload.zip"), formField("y")); + assertEquals(singletonList("upload.zip"), PartHelper.extractFilenames(parts)); + } + + @Test + void extractFilenamesPreservesFilenamesWithSpacesAndSpecialCharacters() { + List parts = asList(filePart("my file.tar.gz"), filePart("résumé.pdf")); + assertEquals(asList("my file.tar.gz", "résumé.pdf"), PartHelper.extractFilenames(parts)); + } + + // ── filenameFromPart ──────────────────────────────────────────────────────── + + @Test + void filenameFromPartReturnsNullWhenContentDispositionHeaderIsAbsent() { + Part p = mock(Part.class); + when(p.getHeader("Content-Disposition")).thenReturn(null); + assertNull(PartHelper.filenameFromPart(p)); + } + + @Test + void filenameFromPartReturnsNullWhenThereIsNoFilenameParameter() { + Part p = mock(Part.class); + when(p.getHeader("Content-Disposition")).thenReturn("form-data; name=\"field\""); + assertNull(PartHelper.filenameFromPart(p)); + } + + @Test + void filenameFromPartExtractsUnquotedFilename() { + Part p = mock(Part.class); + when(p.getHeader("Content-Disposition")) + .thenReturn("form-data; name=\"file\"; filename=photo.jpg"); + assertEquals("photo.jpg", PartHelper.filenameFromPart(p)); + } + + @Test + void filenameFromPartStripsQuotesFromFilename() { + Part p = mock(Part.class); + when(p.getHeader("Content-Disposition")) + .thenReturn("form-data; name=\"file\"; filename=\"photo.jpg\""); + assertEquals("photo.jpg", PartHelper.filenameFromPart(p)); + } + + @Test + void filenameFromPartReturnsEmptyStringForEmptyQuotedFilename() { + Part p = mock(Part.class); + when(p.getHeader("Content-Disposition")).thenReturn("form-data; name=\"file\"; filename=\"\""); + assertEquals("", PartHelper.filenameFromPart(p)); + } + + @Test + void filenameFromPartReturnsEmptyStringForEmptyUnquotedFilename() { + Part p = mock(Part.class); + when(p.getHeader("Content-Disposition")).thenReturn("form-data; name=\"file\"; filename="); + assertEquals("", PartHelper.filenameFromPart(p)); + } + + @Test + void filenameFromPartPreservesSemicolonsInsideQuotedFilename() { + Part p = mock(Part.class); + when(p.getHeader("Content-Disposition")) + .thenReturn("form-data; name=\"file\"; filename=\"shell;evil.php\""); + assertEquals("shell;evil.php", PartHelper.filenameFromPart(p)); + } + + @Test + void filenameFromPartHandlesEscapedQuoteInsideFilename() { + Part p = mock(Part.class); + when(p.getHeader("Content-Disposition")) + .thenReturn("form-data; name=\"file\"; filename=\"file\\\"name.txt\""); + assertEquals("file\"name.txt", PartHelper.filenameFromPart(p)); + } + + @Test + void filenameFromPartHandlesFilenameBeforeOtherParameters() { + Part p = mock(Part.class); + when(p.getHeader("Content-Disposition")) + .thenReturn("form-data; filename=\"first.txt\"; name=\"file\""); + assertEquals("first.txt", PartHelper.filenameFromPart(p)); + } + + // ── charsetFromContentType ────────────────────────────────────────────────── + + @Test + void charsetFromContentTypeReturnsUtf8ForNull() { + assertEquals(StandardCharsets.UTF_8, PartHelper.charsetFromContentType(null)); + } + + @Test + void charsetFromContentTypeReturnsUtf8WhenNoCharsetParameter() { + assertEquals(StandardCharsets.UTF_8, PartHelper.charsetFromContentType("text/plain")); + } + + @Test + void charsetFromContentTypeParsesUnquotedCharset() { + assertEquals( + Charset.forName("ISO-8859-1"), + PartHelper.charsetFromContentType("text/plain; charset=ISO-8859-1")); + } + + @Test + void charsetFromContentTypeParsesQuotedCharset() { + assertEquals( + Charset.forName("ISO-8859-1"), + PartHelper.charsetFromContentType("text/plain; charset=\"ISO-8859-1\"")); + } + + @Test + void charsetFromContentTypeIsCaseInsensitive() { + assertEquals( + StandardCharsets.UTF_16, PartHelper.charsetFromContentType("text/plain; CHARSET=UTF-16")); + } + + @Test + void charsetFromContentTypeReturnsUtf8ForUnknownCharset() { + assertEquals( + StandardCharsets.UTF_8, + PartHelper.charsetFromContentType("text/plain; charset=not-a-real-charset")); + } + + // ── extractFormFields ─────────────────────────────────────────────────────── + + @Test + void extractFormFieldsReturnsEmptyMapForNull() { + assertEquals(Collections.emptyMap(), PartHelper.extractFormFields(null)); + } + + @Test + void extractFormFieldsReturnsEmptyMapForEmpty() { + assertEquals(Collections.emptyMap(), PartHelper.extractFormFields(emptyList())); + } + + @Test + void extractFormFieldsSkipsFileUploadParts() { + List parts = singletonList(filePart("evil.php")); + assertEquals(Collections.emptyMap(), PartHelper.extractFormFields(parts)); + } + + @Test + void extractFormFieldsSkipsPartWithEmptyFilename() { + List parts = singletonList(emptyFilenamePart("field")); + assertEquals(Collections.emptyMap(), PartHelper.extractFormFields(parts)); + } + + @Test + void extractFilenamesSkipsEmptyFilename() { + List parts = singletonList(emptyFilenamePart("field")); + assertEquals(emptyList(), PartHelper.extractFilenames(parts)); + } + + @Test + void extractFormFieldsExtractsSingleFormField() throws IOException { + List parts = singletonList(field("username", "alice")); + Map> expected = + Collections.singletonMap("username", singletonList("alice")); + assertEquals(expected, PartHelper.extractFormFields(parts)); + } + + @Test + void extractFormFieldsGroupsMultipleValuesUnderSameName() throws IOException { + List parts = asList(field("tag", "foo"), field("tag", "bar")); + Map> result = PartHelper.extractFormFields(parts); + assertEquals(asList("foo", "bar"), result.get("tag")); + } + + @Test + void extractFormFieldsMixesFieldsAndSkipsFiles() throws IOException { + List parts = asList(field("a", "x"), filePart("upload.bin"), field("b", "y")); + Map> result = PartHelper.extractFormFields(parts); + assertEquals(singletonList("x"), result.get("a")); + assertEquals(singletonList("y"), result.get("b")); + assertNull(result.get("file")); + } + + @Test + void extractFormFieldsDecodesFieldUsingContentTypeCharset() throws IOException { + byte[] iso88591Bytes = "café".getBytes("ISO-8859-1"); + List parts = + singletonList( + fieldWithContentType("drink", iso88591Bytes, "text/plain; charset=ISO-8859-1")); + Map> result = PartHelper.extractFormFields(parts); + assertEquals(singletonList("café"), result.get("drink")); + } + + @Test + void extractFormFieldsTruncatesFieldExceedingMaxContentBytes() throws IOException { + int maxBytes = Config.get().getAppSecMaxFileContentBytes(); + // ASCII value larger than the cap so byte length == char length and truncation is exact. + char[] chars = new char[maxBytes * 2 + 123]; + fill(chars, 'a'); + String oversized = new String(chars); + List parts = singletonList(field("big", oversized)); + Map> result = PartHelper.extractFormFields(parts); + List values = result.get("big"); + assertEquals(1, values.size()); + assertEquals(maxBytes, values.get(0).length()); + } + + @Test + void extractFormFieldsCapsAtMaxFileContentCount() throws IOException { + int maxFields = Config.get().getAppSecMaxFileContentCount(); + int count = maxFields + 1; + Part[] parts = new Part[count]; + for (int i = 0; i < count; i++) { + parts[i] = field("field" + i, "value" + i); + } + Map> result = PartHelper.extractFormFields(asList(parts)); + assertEquals(maxFields, result.size()); + } + + // ── extractContents ───────────────────────────────────────────────────────── + + @Test + void extractContentsReturnsEmptyListForNull() { + assertEquals(emptyList(), PartHelper.extractContents(null)); + } + + @Test + void extractContentsReturnsEmptyListForEmpty() { + assertEquals(emptyList(), PartHelper.extractContents(emptyList())); + } + + @Test + void extractContentsSkipsFormFieldParts() { + List parts = asList(formField("a"), formField("b")); + assertEquals(emptyList(), PartHelper.extractContents(parts)); + } + + @Test + void extractContentsIncludesFileWithEmptyFilename() throws IOException { + List parts = singletonList(emptyFilenamePart("upload")); + Part p = parts.get(0); + when(p.getInputStream()) + .thenReturn(new ByteArrayInputStream("data".getBytes(StandardCharsets.UTF_8))); + when(p.getContentType()).thenReturn("text/plain; charset=UTF-8"); + assertEquals(singletonList("data"), PartHelper.extractContents(parts)); + } + + @Test + void extractContentsReadsFileContent() throws IOException { + Part p = filePart("photo.jpg"); + when(p.getInputStream()) + .thenReturn(new ByteArrayInputStream("file-content".getBytes(StandardCharsets.UTF_8))); + when(p.getContentType()).thenReturn("text/plain; charset=UTF-8"); + assertEquals(singletonList("file-content"), PartHelper.extractContents(singletonList(p))); + } + + @Test + void extractContentsTruncatesAtMaxContentBytes() throws IOException { + byte[] large = new byte[PartHelper.MAX_CONTENT_BYTES + 1]; + Arrays.fill(large, (byte) 'A'); + Part p = filePart("big.bin"); + when(p.getInputStream()).thenReturn(new ByteArrayInputStream(large)); + when(p.getContentType()).thenReturn(null); + List contents = PartHelper.extractContents(singletonList(p)); + assertEquals(1, contents.size()); + assertEquals(PartHelper.MAX_CONTENT_BYTES, contents.get(0).length()); + } + + @Test + void extractContentsReturnsEmptyStringOnIOException() throws IOException { + Part p = filePart("file.txt"); + when(p.getInputStream()).thenThrow(new IOException("simulated")); + assertEquals(singletonList(""), PartHelper.extractContents(singletonList(p))); + } + + @Test + void extractContentsCappsAtMaxFilesToInspect() throws IOException { + int count = PartHelper.MAX_FILES_TO_INSPECT + 1; + List parts = new ArrayList<>(count); + for (int i = 0; i < count; i++) { + Part p = filePart("file" + i + ".txt"); + when(p.getInputStream()) + .thenReturn(new ByteArrayInputStream("c".getBytes(StandardCharsets.UTF_8))); + when(p.getContentType()).thenReturn(null); + parts.add(p); + } + List contents = PartHelper.extractContents(parts); + assertEquals(PartHelper.MAX_FILES_TO_INSPECT, contents.size()); + } + + // ── getAllParts ───────────────────────────────────────────────────────────── + + @Test + void getAllPartsReturnsEmptyListWhenBothNull() { + assertEquals(emptyList(), PartHelper.getAllParts(null, null)); + } + + @Test + void getAllPartsFallsBackToSingletonWhenMultiPartInputStreamIsNull() { + Part part = filePart("evil.php"); + assertEquals(singletonList(part), PartHelper.getAllParts(null, part)); + } + + @Test + void getAllPartsReturnsAllPartsFromMultiPartInputStream() throws Exception { + Part file = filePart("evil.php"); + Part text = formField("name"); + MultiPartInputStream mpi = mock(MultiPartInputStream.class); + when(mpi.getParts()).thenReturn(asList(file, text)); + assertEquals(asList(file, text), PartHelper.getAllParts(mpi, null)); + } + + @Test + void getAllPartsPrefersFullCollectionOverSingleton() throws Exception { + Part file = filePart("evil.php"); + Part other = formField("name"); + MultiPartInputStream mpi = mock(MultiPartInputStream.class); + when(mpi.getParts()).thenReturn(asList(file, other)); + assertEquals(asList(file, other), PartHelper.getAllParts(mpi, file)); + } + + @Test + void getAllPartsFallsBackToSingletonWhenGetPartsThrows() throws Exception { + Part part = filePart("fallback.jpg"); + MultiPartInputStream mpi = mock(MultiPartInputStream.class); + when(mpi.getParts()).thenThrow(new IOException("simulated failure")); + assertEquals(singletonList(part), PartHelper.getAllParts(mpi, part)); + } + + // ── helpers ───────────────────────────────────────────────────────────────── + + /** Creates a stub Part that looks like a plain form field (no filename). */ + private Part field(String name, String value) throws IOException { + Part p = mock(Part.class); + when(p.getHeader("Content-Disposition")).thenReturn("form-data; name=\"" + name + "\""); + when(p.getName()).thenReturn(name); + when(p.getInputStream()) + .thenReturn(new ByteArrayInputStream(value.getBytes(StandardCharsets.UTF_8))); + return p; + } + + /** Creates a stub Part with a specific Content-Type (for charset testing). */ + private Part fieldWithContentType(String name, byte[] rawValue, String contentType) + throws IOException { + Part p = mock(Part.class); + when(p.getHeader("Content-Disposition")).thenReturn("form-data; name=\"" + name + "\""); + when(p.getName()).thenReturn(name); + when(p.getContentType()).thenReturn(contentType); + when(p.getInputStream()).thenReturn(new ByteArrayInputStream(rawValue)); + return p; + } + + /** Creates a stub Part for extractFilenames/extractFormFields tests that only need the header. */ + private Part formField(String name) { + Part p = mock(Part.class); + when(p.getHeader("Content-Disposition")).thenReturn("form-data; name=\"" + name + "\""); + when(p.getName()).thenReturn(name); + return p; + } + + /** Creates a stub Part that looks like a file upload with the given filename. */ + private Part filePart(String filename) { + Part p = mock(Part.class); + when(p.getHeader("Content-Disposition")) + .thenReturn("form-data; name=\"file\"; filename=\"" + filename + "\""); + return p; + } + + /** Creates a stub Part that has filename="" — a file input submitted with no file chosen. */ + private Part emptyFilenamePart(String name) { + Part p = mock(Part.class); + when(p.getHeader("Content-Disposition")) + .thenReturn("form-data; name=\"" + name + "\"; filename=\"\""); + return p; + } +} diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.2/build.gradle b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.2/build.gradle index 349861079eb..ffcf95ba27c 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.2/build.gradle +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.2/build.gradle @@ -11,6 +11,7 @@ apply from: "$rootDir/gradle/java.gradle" dependencies { compileOnly group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.2.30.v20200428' -} -// testing happens in the jetty-* modules + testImplementation libs.bundles.mockito + testImplementation group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0' +} diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.2/gradle.lockfile b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.2/gradle.lockfile index bfb56dcc4d4..a2a83ad79fd 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.2/gradle.lockfile +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.2/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-9.2:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=compileClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -85,6 +89,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -97,19 +102,20 @@ org.junit.platform:junit-platform-suite-api:1.14.1=testRuntimeClasspath org.junit.platform:junit-platform-suite-commons:1.14.1=testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath -org.mockito:mockito-core:4.4.0=testRuntimeClasspath +org.mockito:mockito-core:4.4.0=testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.2/src/main/java/datadog/trace/instrumentation/jetty92/MultipartHelper.java b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.2/src/main/java/datadog/trace/instrumentation/jetty92/MultipartHelper.java new file mode 100644 index 00000000000..902db2d493a --- /dev/null +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.2/src/main/java/datadog/trace/instrumentation/jetty92/MultipartHelper.java @@ -0,0 +1,157 @@ +package datadog.trace.instrumentation.jetty92; + +import static datadog.trace.api.gateway.Events.EVENTS; +import static datadog.trace.api.telemetry.LogCollector.EXCLUDE_TELEMETRY; + +import datadog.appsec.api.blocking.BlockingException; +import datadog.trace.api.Config; +import datadog.trace.api.gateway.BlockResponseFunction; +import datadog.trace.api.gateway.CallbackProvider; +import datadog.trace.api.gateway.Flow; +import datadog.trace.api.gateway.RequestContext; +import datadog.trace.api.gateway.RequestContextSlot; +import datadog.trace.api.http.MultipartContentDecoder; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.function.BiFunction; +import javax.servlet.http.Part; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class MultipartHelper { + + public static final int MAX_CONTENT_BYTES = Config.get().getAppSecMaxFileContentBytes(); + public static final int MAX_FILES_TO_INSPECT = Config.get().getAppSecMaxFileContentCount(); + + private static final Logger log = LoggerFactory.getLogger(MultipartHelper.class); + + private MultipartHelper() {} + + /** + * Extracts non-null, non-empty filenames from a collection of multipart {@link Part}s using + * {@link Part#getSubmittedFileName()} (Servlet 3.1+, Jetty 9.2.x). + * + * @return list of filenames; never {@code null}, may be empty + */ + public static List extractFilenames(Collection parts) { + if (parts == null || parts.isEmpty()) { + return Collections.emptyList(); + } + List filenames = new ArrayList<>(parts.size()); + for (Part part : parts) { + try { + String name = part.getSubmittedFileName(); + if (name != null && !name.isEmpty()) { + filenames.add(name); + } + } catch (Exception ignored) { + // malformed or inaccessible part — skip and continue with remaining parts + log.debug(EXCLUDE_TELEMETRY, "extractFilenames: skipping malformed part", ignored); + } + } + return filenames; + } + + /** + * Extracts file content from a collection of multipart {@link Part}s. Form fields (those with a + * {@code null} submitted filename) are skipped. Reads up to {@link #MAX_CONTENT_BYTES} bytes per + * part, up to {@link #MAX_FILES_TO_INSPECT} parts total. + * + * @return list of decoded content strings; never {@code null}, may be empty + */ + public static List extractContents(Collection parts) { + if (parts == null || parts.isEmpty()) { + return Collections.emptyList(); + } + List contents = new ArrayList<>(Math.min(parts.size(), MAX_FILES_TO_INSPECT)); + for (Part part : parts) { + if (contents.size() >= MAX_FILES_TO_INSPECT) { + break; + } + try { + if (part.getSubmittedFileName() == null) { + continue; // form field — skip + } + contents.add(readFileContent(part)); + } catch (Exception ignored) { + log.debug(EXCLUDE_TELEMETRY, "extractContents: skipping malformed part", ignored); + } + } + return contents; + } + + private static String readFileContent(Part part) { + try (InputStream is = part.getInputStream()) { + return MultipartContentDecoder.readInputStream(is, MAX_CONTENT_BYTES, part.getContentType()); + } catch (Exception e) { + log.debug(EXCLUDE_TELEMETRY, "readFileContent: stream read failed", e); + return ""; + } + } + + /** + * Fires the {@code requestFilesContent} IG event and returns a {@link BlockingException} if the + * WAF requests blocking, or {@code null} otherwise. + */ + public static BlockingException fireFilesContentEvent( + Collection parts, RequestContext reqCtx) { + CallbackProvider cbp = AgentTracer.get().getCallbackProvider(RequestContextSlot.APPSEC); + BiFunction, Flow> callback = + cbp.getCallback(EVENTS.requestFilesContent()); + if (callback == null) { + return null; + } + List contents = extractContents(parts); + if (contents.isEmpty()) { + return null; + } + Flow flow = callback.apply(reqCtx, contents); + Flow.Action action = flow.getAction(); + if (action instanceof Flow.Action.RequestBlockingAction) { + Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action; + BlockResponseFunction brf = reqCtx.getBlockResponseFunction(); + if (brf != null) { + if (brf.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba)) { + reqCtx.getTraceSegment().effectivelyBlocked(); + return new BlockingException("Blocked request (multipart file content)"); + } + } + } + return null; + } + + /** + * Fires the {@code requestFilesFilenames} IG event and returns a {@link BlockingException} if the + * WAF requests blocking, or {@code null} otherwise. + */ + public static BlockingException fireFilenamesEvent( + Collection parts, RequestContext reqCtx) { + CallbackProvider cbp = AgentTracer.get().getCallbackProvider(RequestContextSlot.APPSEC); + BiFunction, Flow> callback = + cbp.getCallback(EVENTS.requestFilesFilenames()); + if (callback == null) { + return null; + } + List filenames = extractFilenames(parts); + if (filenames.isEmpty()) { + return null; + } + Flow flow = callback.apply(reqCtx, filenames); + Flow.Action action = flow.getAction(); + if (action instanceof Flow.Action.RequestBlockingAction) { + Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action; + BlockResponseFunction brf = reqCtx.getBlockResponseFunction(); + if (brf != null) { + if (brf.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba)) { + reqCtx.getTraceSegment().effectivelyBlocked(); + return new BlockingException("Blocked request (multipart file upload)"); + } + } + } + return null; + } +} diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.2/src/main/java/datadog/trace/instrumentation/jetty92/RequestExtractContentParametersInstrumentation.java b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.2/src/main/java/datadog/trace/instrumentation/jetty92/RequestExtractContentParametersInstrumentation.java index 0796aa32538..dcfae4aca4c 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.2/src/main/java/datadog/trace/instrumentation/jetty92/RequestExtractContentParametersInstrumentation.java +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.2/src/main/java/datadog/trace/instrumentation/jetty92/RequestExtractContentParametersInstrumentation.java @@ -19,9 +19,11 @@ import datadog.trace.api.gateway.RequestContextSlot; import datadog.trace.bootstrap.CallDepthThreadLocalMap; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import java.util.Collection; import java.util.function.BiFunction; +import javax.servlet.http.Part; import net.bytebuddy.asm.Advice; -import org.eclipse.jetty.server.Request; +import net.bytebuddy.implementation.bytecode.assign.Assigner; import org.eclipse.jetty.util.MultiMap; @AutoService(InstrumenterModule.class) @@ -38,6 +40,11 @@ public String instrumentedType() { return "org.eclipse.jetty.server.Request"; } + @Override + public String[] helperClassNames() { + return new String[] {packageName + ".MultipartHelper"}; + } + @Override public void methodAdvice(MethodTransformer transformer) { transformer.applyAdvice( @@ -48,6 +55,11 @@ public void methodAdvice(MethodTransformer transformer) { .and(takesArguments(1)) .and(takesArgument(0, named("org.eclipse.jetty.util.MultiMap"))), getClass().getName() + "$GetPartsAdvice"); + transformer.applyAdvice( + named("getParts").and(takesArguments(0)), getClass().getName() + "$GetFilenamesAdvice"); + transformer.applyAdvice( + named("getParts").and(takesArguments(1)), + getClass().getName() + "$GetFilenamesFromMultiPartAdvice"); } private static final Reference REQUEST_REFERENCE = @@ -63,7 +75,7 @@ public Reference[] additionalMuzzleReferences() { @RequiresRequestContext(RequestContextSlot.APPSEC) public static class ExtractContentParametersAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Return MultiMap map, @ActiveRequestContext RequestContext reqCtx, @@ -99,13 +111,12 @@ static boolean before(@Advice.FieldValue("_contentParameters") final MultiMap map, @ActiveRequestContext RequestContext reqCtx, @Advice.Thrown(readOnly = false) Throwable t) { - CallDepthThreadLocalMap.decrementCallDepth(Request.class); if (!proceed) { return; } @@ -135,4 +146,75 @@ static void after( } } } + + /** + * Fires the {@code requestFilesFilenames} event when the application calls public {@code + * getParts()}. Guards prevent double-firing: + * + *

        + *
      • {@code _contentParameters != null}: set by {@code extractContentParameters()} (the {@code + * getParameterMap()} path); means filenames were already reported via {@code + * GetFilenamesFromMultiPartAdvice}. + *
      • {@code _multiPartInputStream != null}: set by the first {@code getParts()} call in Jetty + * 9.2.x; means filenames were already reported. + *
      + */ + @RequiresRequestContext(RequestContextSlot.APPSEC) + public static class GetFilenamesAdvice { + @Advice.OnMethodEnter(suppress = Throwable.class) + static boolean before( + @Advice.FieldValue("_contentParameters") final MultiMap contentParameters, + @Advice.FieldValue(value = "_multiPartInputStream", typing = Assigner.Typing.DYNAMIC) + final Object multiPartInputStream) { + final int callDepth = CallDepthThreadLocalMap.incrementCallDepth(MultipartHelper.class); + return callDepth == 0 && contentParameters == null && multiPartInputStream == null; + } + + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + static void after( + @Advice.Enter boolean proceed, + @Advice.Return Collection parts, + @ActiveRequestContext RequestContext reqCtx, + @Advice.Thrown(readOnly = false) Throwable t) { + CallDepthThreadLocalMap.decrementCallDepth(MultipartHelper.class); + if (!proceed || t != null || parts == null || parts.isEmpty()) { + return; + } + t = MultipartHelper.fireFilenamesEvent(parts, reqCtx); + if (t == null) { + t = MultipartHelper.fireFilesContentEvent(parts, reqCtx); + } + } + } + + /** + * Fires the {@code requestFilesFilenames} event when multipart content is parsed via the internal + * {@code getParts(MultiMap)} path triggered by {@code getParameter*()} / {@code + * getParameterMap()} — i.e. when the application never calls public {@code getParts()}. The + * call-depth guard prevents double-firing when {@code getParts()} internally delegates to this + * method. + */ + @RequiresRequestContext(RequestContextSlot.APPSEC) + public static class GetFilenamesFromMultiPartAdvice { + @Advice.OnMethodEnter(suppress = Throwable.class) + static boolean before() { + return CallDepthThreadLocalMap.incrementCallDepth(MultipartHelper.class) == 0; + } + + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + static void after( + @Advice.Enter boolean proceed, + @Advice.Return Collection parts, + @ActiveRequestContext RequestContext reqCtx, + @Advice.Thrown(readOnly = false) Throwable t) { + CallDepthThreadLocalMap.decrementCallDepth(MultipartHelper.class); + if (!proceed || t != null || parts == null || parts.isEmpty()) { + return; + } + t = MultipartHelper.fireFilenamesEvent(parts, reqCtx); + if (t == null) { + t = MultipartHelper.fireFilesContentEvent(parts, reqCtx); + } + } + } } diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.2/src/test/java/datadog/trace/instrumentation/jetty92/MultipartHelperTest.java b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.2/src/test/java/datadog/trace/instrumentation/jetty92/MultipartHelperTest.java new file mode 100644 index 00000000000..376e1bd6305 --- /dev/null +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.2/src/test/java/datadog/trace/instrumentation/jetty92/MultipartHelperTest.java @@ -0,0 +1,147 @@ +package datadog.trace.instrumentation.jetty92; + +import static java.util.Arrays.asList; +import static java.util.Collections.emptyList; +import static java.util.Collections.singletonList; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import javax.servlet.http.Part; +import org.junit.jupiter.api.Test; + +class MultipartHelperTest { + + @Test + void returnsEmptyListForNull() { + assertEquals(emptyList(), MultipartHelper.extractFilenames(null)); + } + + @Test + void returnsEmptyListForEmpty() { + assertEquals(emptyList(), MultipartHelper.extractFilenames(emptyList())); + } + + @Test + void returnsEmptyListWhenAllPartsHaveNullFilename() { + List parts = asList(part(null), part(null)); + assertEquals(emptyList(), MultipartHelper.extractFilenames(parts)); + } + + @Test + void returnsEmptyListWhenAllPartsHaveEmptyFilename() { + List parts = asList(part(""), part("")); + assertEquals(emptyList(), MultipartHelper.extractFilenames(parts)); + } + + @Test + void extractsFilenameFromSinglePart() { + List parts = singletonList(part("photo.jpg")); + assertEquals(singletonList("photo.jpg"), MultipartHelper.extractFilenames(parts)); + } + + @Test + void extractsFilenamesFromMultipleParts() { + List parts = asList(part("a.jpg"), part("b.png"), part("c.pdf")); + assertEquals(asList("a.jpg", "b.png", "c.pdf"), MultipartHelper.extractFilenames(parts)); + } + + @Test + void skipsPartsWithNullOrEmptyFilenameAndKeepsValid() { + List parts = asList(part(null), part("valid.txt"), part(""), part("other.zip")); + assertEquals(asList("valid.txt", "other.zip"), MultipartHelper.extractFilenames(parts)); + } + + @Test + void preservesFilenamesWithSpacesAndSpecialCharacters() { + List parts = asList(part("my file.tar.gz"), part("résumé.pdf")); + assertEquals(asList("my file.tar.gz", "résumé.pdf"), MultipartHelper.extractFilenames(parts)); + } + + private Part part(String submittedFileName) { + Part p = mock(Part.class); + when(p.getSubmittedFileName()).thenReturn(submittedFileName); + return p; + } + + // ── extractContents ───────────────────────────────────────────────────────── + + @Test + void extractContentsReturnsEmptyListForNull() { + assertEquals(emptyList(), MultipartHelper.extractContents(null)); + } + + @Test + void extractContentsReturnsEmptyListForEmpty() { + assertEquals(emptyList(), MultipartHelper.extractContents(emptyList())); + } + + @Test + void extractContentsSkipsFormFieldParts() { + List parts = asList(part(null), part(null)); + assertEquals(emptyList(), MultipartHelper.extractContents(parts)); + } + + @Test + void extractContentsIncludesFileWithEmptyFilename() throws IOException { + Part p = mock(Part.class); + when(p.getSubmittedFileName()).thenReturn(""); + when(p.getInputStream()) + .thenReturn(new ByteArrayInputStream("data".getBytes(StandardCharsets.UTF_8))); + when(p.getContentType()).thenReturn("text/plain; charset=UTF-8"); + assertEquals(singletonList("data"), MultipartHelper.extractContents(singletonList(p))); + } + + @Test + void extractContentsReadsFileContent() throws IOException { + Part p = mock(Part.class); + when(p.getSubmittedFileName()).thenReturn("photo.jpg"); + when(p.getInputStream()) + .thenReturn(new ByteArrayInputStream("file-content".getBytes(StandardCharsets.UTF_8))); + when(p.getContentType()).thenReturn("text/plain; charset=UTF-8"); + assertEquals(singletonList("file-content"), MultipartHelper.extractContents(singletonList(p))); + } + + @Test + void extractContentsTruncatesAtMaxContentBytes() throws IOException { + byte[] large = new byte[MultipartHelper.MAX_CONTENT_BYTES + 1]; + Arrays.fill(large, (byte) 'A'); + Part p = mock(Part.class); + when(p.getSubmittedFileName()).thenReturn("big.bin"); + when(p.getInputStream()).thenReturn(new ByteArrayInputStream(large)); + when(p.getContentType()).thenReturn(null); + List contents = MultipartHelper.extractContents(singletonList(p)); + assertEquals(1, contents.size()); + assertEquals(MultipartHelper.MAX_CONTENT_BYTES, contents.get(0).length()); + } + + @Test + void extractContentsReturnsEmptyStringOnIOException() throws IOException { + Part p = mock(Part.class); + when(p.getSubmittedFileName()).thenReturn("file.txt"); + when(p.getInputStream()).thenThrow(new IOException("simulated")); + assertEquals(singletonList(""), MultipartHelper.extractContents(singletonList(p))); + } + + @Test + void extractContentsCappsAtMaxFilesToInspect() throws IOException { + int count = MultipartHelper.MAX_FILES_TO_INSPECT + 1; + List parts = new ArrayList<>(count); + for (int i = 0; i < count; i++) { + Part p = mock(Part.class); + when(p.getSubmittedFileName()).thenReturn("file" + i + ".txt"); + when(p.getInputStream()) + .thenReturn(new ByteArrayInputStream("c".getBytes(StandardCharsets.UTF_8))); + when(p.getContentType()).thenReturn(null); + parts.add(p); + } + List contents = MultipartHelper.extractContents(parts); + assertEquals(MultipartHelper.MAX_FILES_TO_INSPECT, contents.size()); + } +} diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.3/build.gradle b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.3/build.gradle index 69bad38c12b..f7dbb028001 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.3/build.gradle +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.3/build.gradle @@ -2,7 +2,7 @@ muzzle { pass { group = 'org.eclipse.jetty' module = 'jetty-server' - versions = '[9.3,12)' + versions = '[9.3,9.4.10)' assertInverse = true } } @@ -11,6 +11,7 @@ apply from: "$rootDir/gradle/java.gradle" dependencies { compileOnly group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.2.30.v20200428' -} -// testing happens in the jetty-* modules + testImplementation libs.bundles.mockito + testImplementation group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0' +} diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.3/gradle.lockfile b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.3/gradle.lockfile index bfb56dcc4d4..ac94396629b 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.3/gradle.lockfile +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.3/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-9.3:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=compileClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -85,6 +89,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -97,19 +102,20 @@ org.junit.platform:junit-platform-suite-api:1.14.1=testRuntimeClasspath org.junit.platform:junit-platform-suite-commons:1.14.1=testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath -org.mockito:mockito-core:4.4.0=testRuntimeClasspath +org.mockito:mockito-core:4.4.0=testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.3/src/main/java/datadog/trace/instrumentation/jetty93/MultipartHelper.java b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.3/src/main/java/datadog/trace/instrumentation/jetty93/MultipartHelper.java new file mode 100644 index 00000000000..d223d15b519 --- /dev/null +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.3/src/main/java/datadog/trace/instrumentation/jetty93/MultipartHelper.java @@ -0,0 +1,157 @@ +package datadog.trace.instrumentation.jetty93; + +import static datadog.trace.api.gateway.Events.EVENTS; +import static datadog.trace.api.telemetry.LogCollector.EXCLUDE_TELEMETRY; + +import datadog.appsec.api.blocking.BlockingException; +import datadog.trace.api.Config; +import datadog.trace.api.gateway.BlockResponseFunction; +import datadog.trace.api.gateway.CallbackProvider; +import datadog.trace.api.gateway.Flow; +import datadog.trace.api.gateway.RequestContext; +import datadog.trace.api.gateway.RequestContextSlot; +import datadog.trace.api.http.MultipartContentDecoder; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.function.BiFunction; +import javax.servlet.http.Part; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class MultipartHelper { + + public static final int MAX_CONTENT_BYTES = Config.get().getAppSecMaxFileContentBytes(); + public static final int MAX_FILES_TO_INSPECT = Config.get().getAppSecMaxFileContentCount(); + + private static final Logger log = LoggerFactory.getLogger(MultipartHelper.class); + + private MultipartHelper() {} + + /** + * Extracts non-null, non-empty filenames from a collection of multipart {@link Part}s using + * {@link Part#getSubmittedFileName()} (Servlet 3.1+, Jetty 9.3.x). + * + * @return list of filenames; never {@code null}, may be empty + */ + public static List extractFilenames(Collection parts) { + if (parts == null || parts.isEmpty()) { + return Collections.emptyList(); + } + List filenames = new ArrayList<>(parts.size()); + for (Part part : parts) { + try { + String name = part.getSubmittedFileName(); + if (name != null && !name.isEmpty()) { + filenames.add(name); + } + } catch (Exception ignored) { + // malformed or inaccessible part — skip and continue with remaining parts + log.debug(EXCLUDE_TELEMETRY, "extractFilenames: skipping malformed part", ignored); + } + } + return filenames; + } + + /** + * Extracts file content from a collection of multipart {@link Part}s. Form fields (those with a + * {@code null} submitted filename) are skipped. Reads up to {@link #MAX_CONTENT_BYTES} bytes per + * part, up to {@link #MAX_FILES_TO_INSPECT} parts total. + * + * @return list of decoded content strings; never {@code null}, may be empty + */ + public static List extractContents(Collection parts) { + if (parts == null || parts.isEmpty()) { + return Collections.emptyList(); + } + List contents = new ArrayList<>(Math.min(parts.size(), MAX_FILES_TO_INSPECT)); + for (Part part : parts) { + if (contents.size() >= MAX_FILES_TO_INSPECT) { + break; + } + try { + if (part.getSubmittedFileName() == null) { + continue; // form field — skip + } + contents.add(readFileContent(part)); + } catch (Exception ignored) { + log.debug(EXCLUDE_TELEMETRY, "extractContents: skipping malformed part", ignored); + } + } + return contents; + } + + private static String readFileContent(Part part) { + try (InputStream is = part.getInputStream()) { + return MultipartContentDecoder.readInputStream(is, MAX_CONTENT_BYTES, part.getContentType()); + } catch (Exception e) { + log.debug(EXCLUDE_TELEMETRY, "readFileContent: stream read failed", e); + return ""; + } + } + + /** + * Fires the {@code requestFilesContent} IG event and returns a {@link BlockingException} if the + * WAF requests blocking, or {@code null} otherwise. + */ + public static BlockingException fireFilesContentEvent( + Collection parts, RequestContext reqCtx) { + CallbackProvider cbp = AgentTracer.get().getCallbackProvider(RequestContextSlot.APPSEC); + BiFunction, Flow> callback = + cbp.getCallback(EVENTS.requestFilesContent()); + if (callback == null) { + return null; + } + List contents = extractContents(parts); + if (contents.isEmpty()) { + return null; + } + Flow flow = callback.apply(reqCtx, contents); + Flow.Action action = flow.getAction(); + if (action instanceof Flow.Action.RequestBlockingAction) { + Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action; + BlockResponseFunction brf = reqCtx.getBlockResponseFunction(); + if (brf != null) { + if (brf.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba)) { + reqCtx.getTraceSegment().effectivelyBlocked(); + return new BlockingException("Blocked request (multipart file content)"); + } + } + } + return null; + } + + /** + * Fires the {@code requestFilesFilenames} IG event and returns a {@link BlockingException} if the + * WAF requests blocking, or {@code null} otherwise. + */ + public static BlockingException fireFilenamesEvent( + Collection parts, RequestContext reqCtx) { + CallbackProvider cbp = AgentTracer.get().getCallbackProvider(RequestContextSlot.APPSEC); + BiFunction, Flow> callback = + cbp.getCallback(EVENTS.requestFilesFilenames()); + if (callback == null) { + return null; + } + List filenames = extractFilenames(parts); + if (filenames.isEmpty()) { + return null; + } + Flow flow = callback.apply(reqCtx, filenames); + Flow.Action action = flow.getAction(); + if (action instanceof Flow.Action.RequestBlockingAction) { + Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action; + BlockResponseFunction brf = reqCtx.getBlockResponseFunction(); + if (brf != null) { + if (brf.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba)) { + reqCtx.getTraceSegment().effectivelyBlocked(); + return new BlockingException("Blocked request (multipart file upload)"); + } + } + } + return null; + } +} diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.3/src/main/java/datadog/trace/instrumentation/jetty93/RequestExtractContentParametersInstrumentation.java b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.3/src/main/java/datadog/trace/instrumentation/jetty93/RequestExtractContentParametersInstrumentation.java index 3e1e2bf6d5c..ed769a11d7c 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.3/src/main/java/datadog/trace/instrumentation/jetty93/RequestExtractContentParametersInstrumentation.java +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.3/src/main/java/datadog/trace/instrumentation/jetty93/RequestExtractContentParametersInstrumentation.java @@ -18,8 +18,11 @@ import datadog.trace.api.gateway.RequestContextSlot; import datadog.trace.bootstrap.CallDepthThreadLocalMap; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import java.util.Collection; import java.util.function.BiFunction; +import javax.servlet.http.Part; import net.bytebuddy.asm.Advice; +import net.bytebuddy.implementation.bytecode.assign.Assigner; import org.eclipse.jetty.server.Request; import org.eclipse.jetty.util.MultiMap; @@ -37,17 +40,36 @@ public String instrumentedType() { return "org.eclipse.jetty.server.Request"; } + @Override + public String[] helperClassNames() { + return new String[] {packageName + ".MultipartHelper"}; + } + @Override public void methodAdvice(MethodTransformer transformer) { transformer.applyAdvice( named("extractContentParameters").and(takesArguments(0)).or(named("getParts")), getClass().getName() + "$ExtractContentParametersAdvice"); + transformer.applyAdvice( + named("getParts").and(takesArguments(0)), getClass().getName() + "$GetFilenamesAdvice"); + transformer.applyAdvice( + named("getParts").and(takesArguments(1)), + getClass().getName() + "$GetFilenamesFromMultiPartAdvice"); } + // Discriminates Jetty 9.3.x–9.4.9.x ([9.3, 9.4.10)): + // - _contentParameters + extractContentParameters(void) exist from 9.3+ (excludes 9.2) + // - _multiPartInputStream exists in 9.3.x and early 9.4.x (< 9.4.10); replaced by _multiParts + // in 9.4.10 (covered by jetty-appsec-9.4) private static final Reference REQUEST_REFERENCE = new Reference.Builder("org.eclipse.jetty.server.Request") .withMethod(new String[0], 0, "extractContentParameters", "V") .withField(new String[0], 0, "_contentParameters", MULTI_MAP_INTERNAL_NAME) + .withField( + new String[0], + 0, + "_multiPartInputStream", + "Lorg/eclipse/jetty/util/MultiPartInputStreamParser;") .build(); @Override @@ -63,7 +85,7 @@ static boolean before(@Advice.FieldValue("_contentParameters") final MultiMap map, @@ -99,4 +121,76 @@ static void after( } } } + + /** + * Fires the {@code requestFilesFilenames} event when the application calls public {@code + * getParts()}. Guards prevent double-firing: + * + *
        + *
      • {@code _contentParameters != null}: set by {@code extractContentParameters()} (the {@code + * getParameterMap()} path); means filenames were already reported via {@code + * GetFilenamesFromMultiPartAdvice}. + *
      • {@code _multiPartInputStream != null}: set by the first {@code getParts()} call in Jetty + * 9.3.x; means filenames were already reported. + *
      + */ + @RequiresRequestContext(RequestContextSlot.APPSEC) + public static class GetFilenamesAdvice { + @Advice.OnMethodEnter(suppress = Throwable.class) + static boolean before( + @Advice.FieldValue("_contentParameters") final MultiMap contentParameters, + @Advice.FieldValue(value = "_multiPartInputStream", typing = Assigner.Typing.DYNAMIC) + final Object multiPartInputStream) { + final int callDepth = CallDepthThreadLocalMap.incrementCallDepth(MultipartHelper.class); + return callDepth == 0 && contentParameters == null && multiPartInputStream == null; + } + + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + static void after( + @Advice.Enter boolean proceed, + @Advice.Return Collection parts, + @ActiveRequestContext RequestContext reqCtx, + @Advice.Thrown(readOnly = false) Throwable t) { + CallDepthThreadLocalMap.decrementCallDepth(MultipartHelper.class); + if (!proceed || t != null || parts == null || parts.isEmpty()) { + return; + } + t = MultipartHelper.fireFilenamesEvent(parts, reqCtx); + if (t == null) { + t = MultipartHelper.fireFilesContentEvent(parts, reqCtx); + } + } + } + + /** + * Fires the {@code requestFilesFilenames} event when multipart content is parsed via the internal + * {@code getParts(MultiMap)} path triggered by {@code getParameter*()} / {@code + * getParameterMap()} — i.e. when the application never calls public {@code getParts()}. In Jetty + * 9.3+, {@code extractContentParameters()} assigns {@code _contentParameters} before calling this + * method, so {@code map == null} cannot be used as a "first parse" guard here; the call-depth + * guard prevents double-firing when {@code getParts()} internally delegates to this method. + */ + @RequiresRequestContext(RequestContextSlot.APPSEC) + public static class GetFilenamesFromMultiPartAdvice { + @Advice.OnMethodEnter(suppress = Throwable.class) + static boolean before() { + return CallDepthThreadLocalMap.incrementCallDepth(MultipartHelper.class) == 0; + } + + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + static void after( + @Advice.Enter boolean proceed, + @Advice.Return Collection parts, + @ActiveRequestContext RequestContext reqCtx, + @Advice.Thrown(readOnly = false) Throwable t) { + CallDepthThreadLocalMap.decrementCallDepth(MultipartHelper.class); + if (!proceed || t != null || parts == null || parts.isEmpty()) { + return; + } + t = MultipartHelper.fireFilenamesEvent(parts, reqCtx); + if (t == null) { + t = MultipartHelper.fireFilesContentEvent(parts, reqCtx); + } + } + } } diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.3/src/test/java/datadog/trace/instrumentation/jetty93/MultipartHelperTest.java b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.3/src/test/java/datadog/trace/instrumentation/jetty93/MultipartHelperTest.java new file mode 100644 index 00000000000..9f580412ae8 --- /dev/null +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.3/src/test/java/datadog/trace/instrumentation/jetty93/MultipartHelperTest.java @@ -0,0 +1,147 @@ +package datadog.trace.instrumentation.jetty93; + +import static java.util.Arrays.asList; +import static java.util.Collections.emptyList; +import static java.util.Collections.singletonList; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import javax.servlet.http.Part; +import org.junit.jupiter.api.Test; + +class MultipartHelperTest { + + @Test + void returnsEmptyListForNull() { + assertEquals(emptyList(), MultipartHelper.extractFilenames(null)); + } + + @Test + void returnsEmptyListForEmpty() { + assertEquals(emptyList(), MultipartHelper.extractFilenames(emptyList())); + } + + @Test + void returnsEmptyListWhenAllPartsHaveNullFilename() { + List parts = asList(part(null), part(null)); + assertEquals(emptyList(), MultipartHelper.extractFilenames(parts)); + } + + @Test + void returnsEmptyListWhenAllPartsHaveEmptyFilename() { + List parts = asList(part(""), part("")); + assertEquals(emptyList(), MultipartHelper.extractFilenames(parts)); + } + + @Test + void extractsFilenameFromSinglePart() { + List parts = singletonList(part("photo.jpg")); + assertEquals(singletonList("photo.jpg"), MultipartHelper.extractFilenames(parts)); + } + + @Test + void extractsFilenamesFromMultipleParts() { + List parts = asList(part("a.jpg"), part("b.png"), part("c.pdf")); + assertEquals(asList("a.jpg", "b.png", "c.pdf"), MultipartHelper.extractFilenames(parts)); + } + + @Test + void skipsPartsWithNullOrEmptyFilenameAndKeepsValid() { + List parts = asList(part(null), part("valid.txt"), part(""), part("other.zip")); + assertEquals(asList("valid.txt", "other.zip"), MultipartHelper.extractFilenames(parts)); + } + + @Test + void preservesFilenamesWithSpacesAndSpecialCharacters() { + List parts = asList(part("my file.tar.gz"), part("résumé.pdf")); + assertEquals(asList("my file.tar.gz", "résumé.pdf"), MultipartHelper.extractFilenames(parts)); + } + + private Part part(String submittedFileName) { + Part p = mock(Part.class); + when(p.getSubmittedFileName()).thenReturn(submittedFileName); + return p; + } + + // ── extractContents ───────────────────────────────────────────────────────── + + @Test + void extractContentsReturnsEmptyListForNull() { + assertEquals(emptyList(), MultipartHelper.extractContents(null)); + } + + @Test + void extractContentsReturnsEmptyListForEmpty() { + assertEquals(emptyList(), MultipartHelper.extractContents(emptyList())); + } + + @Test + void extractContentsSkipsFormFieldParts() { + List parts = asList(part(null), part(null)); + assertEquals(emptyList(), MultipartHelper.extractContents(parts)); + } + + @Test + void extractContentsIncludesFileWithEmptyFilename() throws IOException { + Part p = mock(Part.class); + when(p.getSubmittedFileName()).thenReturn(""); + when(p.getInputStream()) + .thenReturn(new ByteArrayInputStream("data".getBytes(StandardCharsets.UTF_8))); + when(p.getContentType()).thenReturn("text/plain; charset=UTF-8"); + assertEquals(singletonList("data"), MultipartHelper.extractContents(singletonList(p))); + } + + @Test + void extractContentsReadsFileContent() throws IOException { + Part p = mock(Part.class); + when(p.getSubmittedFileName()).thenReturn("photo.jpg"); + when(p.getInputStream()) + .thenReturn(new ByteArrayInputStream("file-content".getBytes(StandardCharsets.UTF_8))); + when(p.getContentType()).thenReturn("text/plain; charset=UTF-8"); + assertEquals(singletonList("file-content"), MultipartHelper.extractContents(singletonList(p))); + } + + @Test + void extractContentsTruncatesAtMaxContentBytes() throws IOException { + byte[] large = new byte[MultipartHelper.MAX_CONTENT_BYTES + 1]; + Arrays.fill(large, (byte) 'A'); + Part p = mock(Part.class); + when(p.getSubmittedFileName()).thenReturn("big.bin"); + when(p.getInputStream()).thenReturn(new ByteArrayInputStream(large)); + when(p.getContentType()).thenReturn(null); + List contents = MultipartHelper.extractContents(singletonList(p)); + assertEquals(1, contents.size()); + assertEquals(MultipartHelper.MAX_CONTENT_BYTES, contents.get(0).length()); + } + + @Test + void extractContentsReturnsEmptyStringOnIOException() throws IOException { + Part p = mock(Part.class); + when(p.getSubmittedFileName()).thenReturn("file.txt"); + when(p.getInputStream()).thenThrow(new IOException("simulated")); + assertEquals(singletonList(""), MultipartHelper.extractContents(singletonList(p))); + } + + @Test + void extractContentsCappsAtMaxFilesToInspect() throws IOException { + int count = MultipartHelper.MAX_FILES_TO_INSPECT + 1; + List parts = new ArrayList<>(count); + for (int i = 0; i < count; i++) { + Part p = mock(Part.class); + when(p.getSubmittedFileName()).thenReturn("file" + i + ".txt"); + when(p.getInputStream()) + .thenReturn(new ByteArrayInputStream("c".getBytes(StandardCharsets.UTF_8))); + when(p.getContentType()).thenReturn(null); + parts.add(p); + } + List contents = MultipartHelper.extractContents(parts); + assertEquals(MultipartHelper.MAX_FILES_TO_INSPECT, contents.size()); + } +} diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.4/build.gradle b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.4/build.gradle new file mode 100644 index 00000000000..10fc0a659a9 --- /dev/null +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.4/build.gradle @@ -0,0 +1,32 @@ +muzzle { + pass { + name = '9_series' + group = 'org.eclipse.jetty' + module = 'jetty-server' + versions = '[9.4.10,10.0)' + } + pass { + name = 'early_10_series' + group = 'org.eclipse.jetty' + module = 'jetty-server' + // _multiParts: MultiPartFormInputStream (before 10.0.10 switched to MultiParts) + versions = '[10.0.0,10.0.10)' + javaVersion = 11 + } + pass { + name = '10_series' + group = 'org.eclipse.jetty' + module = 'jetty-server' + versions = '[10.0.10,11.0)' + javaVersion = 11 + } +} + +apply from: "$rootDir/gradle/java.gradle" + +dependencies { + compileOnly group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.4.21.v20190926' + + testImplementation libs.bundles.mockito + testImplementation group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0' +} diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.4/gradle.lockfile b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.4/gradle.lockfile new file mode 100644 index 00000000000..038b5cd6ea1 --- /dev/null +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.4/gradle.lockfile @@ -0,0 +1,132 @@ +# This is a Gradle generated file for dependency locking. +# Manual edits can break the build and are not advised. +# This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-9.4:dependencies --write-locks +cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath +cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath +ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath +com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath +com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath +com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath +com.github.javaparser:javaparser-core:3.25.6=codenarc +com.github.jnr:jffi:1.3.15=testRuntimeClasspath +com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath +com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath +com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs +com.github.spotbugs:spotbugs:4.9.8=spotbugs +com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs +com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath +com.google.auto.service:auto-service:1.1.1=annotationProcessor,testAnnotationProcessor +com.google.auto:auto-common:1.2.1=annotationProcessor,testAnnotationProcessor +com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.google.code.gson:gson:2.13.2=spotbugs +com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor +com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath +com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okio:okio:1.17.5=testCompileClasspath,testRuntimeClasspath +com.thoughtworks.qdox:qdox:1.12.1=codenarc +commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testRuntimeClasspath +commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath +commons-io:commons-io:2.20.0=spotbugs +de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath +io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath +javax.servlet:javax.servlet-api:3.1.0=compileClasspath,testCompileClasspath,testRuntimeClasspath +jaxen:jaxen:2.0.0=spotbugs +junit:junit:4.13.2=testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath +net.java.dev.jna:jna:5.8.0=testRuntimeClasspath +net.sf.saxon:Saxon-HE:12.9=spotbugs +org.apache.ant:ant-antlr:1.10.14=codenarc +org.apache.ant:ant-junit:1.10.14=codenarc +org.apache.bcel:bcel:6.11.0=spotbugs +org.apache.commons:commons-lang3:3.19.0=spotbugs +org.apache.commons:commons-text:1.14.0=spotbugs +org.apache.logging.log4j:log4j-api:2.25.2=spotbugs +org.apache.logging.log4j:log4j-core:2.25.2=spotbugs +org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath +org.checkerframework:checker-qual:3.33.0=annotationProcessor,testAnnotationProcessor +org.codehaus.groovy:groovy-ant:3.0.23=codenarc +org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc +org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.25=testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-templates:3.0.23=codenarc +org.codehaus.groovy:groovy-xml:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath +org.codenarc:CodeNarc:3.7.0=codenarc +org.dom4j:dom4j:2.2.0=spotbugs +org.eclipse.jetty:jetty-http:9.4.21.v20190926=compileClasspath +org.eclipse.jetty:jetty-io:9.4.21.v20190926=compileClasspath +org.eclipse.jetty:jetty-server:9.4.21.v20190926=compileClasspath +org.eclipse.jetty:jetty-util:9.4.21.v20190926=compileClasspath +org.gmetrics:GMetrics:2.1.0=codenarc +org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath +org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath +org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath +org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath +org.junit.platform:junit-platform-runner:1.14.1=testRuntimeClasspath +org.junit.platform:junit-platform-suite-api:1.14.1=testRuntimeClasspath +org.junit.platform:junit-platform-suite-commons:1.14.1=testRuntimeClasspath +org.junit:junit-bom:5.14.0=spotbugs +org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-core:4.4.0=testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspath +org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath +org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath +org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.9=spotbugs +org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath +org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs +org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath +org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath +org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath +org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j +org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j +org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,muzzleTooling,runtimeClasspath,testRuntimeClasspath +org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath +org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath +org.xmlresolver:xmlresolver:5.3.3=spotbugs +empty=spotbugsPlugins diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.4/src/main/java/datadog/trace/instrumentation/jetty94/MultipartHelper.java b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.4/src/main/java/datadog/trace/instrumentation/jetty94/MultipartHelper.java new file mode 100644 index 00000000000..0f9e2b00df2 --- /dev/null +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.4/src/main/java/datadog/trace/instrumentation/jetty94/MultipartHelper.java @@ -0,0 +1,157 @@ +package datadog.trace.instrumentation.jetty94; + +import static datadog.trace.api.gateway.Events.EVENTS; +import static datadog.trace.api.telemetry.LogCollector.EXCLUDE_TELEMETRY; + +import datadog.appsec.api.blocking.BlockingException; +import datadog.trace.api.Config; +import datadog.trace.api.gateway.BlockResponseFunction; +import datadog.trace.api.gateway.CallbackProvider; +import datadog.trace.api.gateway.Flow; +import datadog.trace.api.gateway.RequestContext; +import datadog.trace.api.gateway.RequestContextSlot; +import datadog.trace.api.http.MultipartContentDecoder; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.function.BiFunction; +import javax.servlet.http.Part; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class MultipartHelper { + + public static final int MAX_CONTENT_BYTES = Config.get().getAppSecMaxFileContentBytes(); + public static final int MAX_FILES_TO_INSPECT = Config.get().getAppSecMaxFileContentCount(); + + private static final Logger log = LoggerFactory.getLogger(MultipartHelper.class); + + private MultipartHelper() {} + + /** + * Extracts non-null, non-empty filenames from a collection of multipart {@link Part}s using + * {@link Part#getSubmittedFileName()} (Servlet 3.1+, Jetty 9.4.x–10.x). + * + * @return list of filenames; never {@code null}, may be empty + */ + public static List extractFilenames(Collection parts) { + if (parts == null || parts.isEmpty()) { + return Collections.emptyList(); + } + List filenames = new ArrayList<>(parts.size()); + for (Part part : parts) { + try { + String name = part.getSubmittedFileName(); + if (name != null && !name.isEmpty()) { + filenames.add(name); + } + } catch (Exception ignored) { + // malformed or inaccessible part — skip and continue with remaining parts + log.debug(EXCLUDE_TELEMETRY, "extractFilenames: skipping malformed part", ignored); + } + } + return filenames; + } + + /** + * Extracts file content from a collection of multipart {@link Part}s. Form fields (those with a + * {@code null} submitted filename) are skipped. Reads up to {@link #MAX_CONTENT_BYTES} bytes per + * part, up to {@link #MAX_FILES_TO_INSPECT} parts total. + * + * @return list of decoded content strings; never {@code null}, may be empty + */ + public static List extractContents(Collection parts) { + if (parts == null || parts.isEmpty()) { + return Collections.emptyList(); + } + List contents = new ArrayList<>(Math.min(parts.size(), MAX_FILES_TO_INSPECT)); + for (Part part : parts) { + if (contents.size() >= MAX_FILES_TO_INSPECT) { + break; + } + try { + if (part.getSubmittedFileName() == null) { + continue; // form field — skip + } + contents.add(readFileContent(part)); + } catch (Exception ignored) { + log.debug(EXCLUDE_TELEMETRY, "extractContents: skipping malformed part", ignored); + } + } + return contents; + } + + private static String readFileContent(Part part) { + try (InputStream is = part.getInputStream()) { + return MultipartContentDecoder.readInputStream(is, MAX_CONTENT_BYTES, part.getContentType()); + } catch (Exception e) { + log.debug(EXCLUDE_TELEMETRY, "readFileContent: stream read failed", e); + return ""; + } + } + + /** + * Fires the {@code requestFilesContent} IG event and returns a {@link BlockingException} if the + * WAF requests blocking, or {@code null} otherwise. + */ + public static BlockingException fireFilesContentEvent( + Collection parts, RequestContext reqCtx) { + CallbackProvider cbp = AgentTracer.get().getCallbackProvider(RequestContextSlot.APPSEC); + BiFunction, Flow> callback = + cbp.getCallback(EVENTS.requestFilesContent()); + if (callback == null) { + return null; + } + List contents = extractContents(parts); + if (contents.isEmpty()) { + return null; + } + Flow flow = callback.apply(reqCtx, contents); + Flow.Action action = flow.getAction(); + if (action instanceof Flow.Action.RequestBlockingAction) { + Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action; + BlockResponseFunction brf = reqCtx.getBlockResponseFunction(); + if (brf != null) { + if (brf.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba)) { + reqCtx.getTraceSegment().effectivelyBlocked(); + return new BlockingException("Blocked request (multipart file content)"); + } + } + } + return null; + } + + /** + * Fires the {@code requestFilesFilenames} IG event and returns a {@link BlockingException} if the + * WAF requests blocking, or {@code null} otherwise. + */ + public static BlockingException fireFilenamesEvent( + Collection parts, RequestContext reqCtx) { + CallbackProvider cbp = AgentTracer.get().getCallbackProvider(RequestContextSlot.APPSEC); + BiFunction, Flow> callback = + cbp.getCallback(EVENTS.requestFilesFilenames()); + if (callback == null) { + return null; + } + List filenames = extractFilenames(parts); + if (filenames.isEmpty()) { + return null; + } + Flow flow = callback.apply(reqCtx, filenames); + Flow.Action action = flow.getAction(); + if (action instanceof Flow.Action.RequestBlockingAction) { + Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action; + BlockResponseFunction brf = reqCtx.getBlockResponseFunction(); + if (brf != null) { + if (brf.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba)) { + reqCtx.getTraceSegment().effectivelyBlocked(); + return new BlockingException("Blocked request (multipart file upload)"); + } + } + } + return null; + } +} diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.4/src/main/java/datadog/trace/instrumentation/jetty94/RequestExtractContentParametersInstrumentation.java b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.4/src/main/java/datadog/trace/instrumentation/jetty94/RequestExtractContentParametersInstrumentation.java new file mode 100644 index 00000000000..d7c810a511b --- /dev/null +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.4/src/main/java/datadog/trace/instrumentation/jetty94/RequestExtractContentParametersInstrumentation.java @@ -0,0 +1,205 @@ +package datadog.trace.instrumentation.jetty94; + +import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static datadog.trace.api.gateway.Events.EVENTS; +import static net.bytebuddy.matcher.ElementMatchers.takesArguments; + +import com.google.auto.service.AutoService; +import datadog.appsec.api.blocking.BlockingException; +import datadog.trace.advice.ActiveRequestContext; +import datadog.trace.advice.RequiresRequestContext; +import datadog.trace.agent.tooling.Instrumenter; +import datadog.trace.agent.tooling.InstrumenterModule; +import datadog.trace.agent.tooling.muzzle.Reference; +import datadog.trace.api.gateway.BlockResponseFunction; +import datadog.trace.api.gateway.CallbackProvider; +import datadog.trace.api.gateway.Flow; +import datadog.trace.api.gateway.RequestContext; +import datadog.trace.api.gateway.RequestContextSlot; +import datadog.trace.bootstrap.CallDepthThreadLocalMap; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import java.util.Collection; +import java.util.function.BiFunction; +import javax.servlet.http.Part; +import net.bytebuddy.asm.Advice; +import net.bytebuddy.implementation.bytecode.assign.Assigner; +import org.eclipse.jetty.server.Request; +import org.eclipse.jetty.util.MultiMap; + +@AutoService(InstrumenterModule.class) +public class RequestExtractContentParametersInstrumentation extends InstrumenterModule.AppSec + implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { + private static final String MULTI_MAP_INTERNAL_NAME = "Lorg/eclipse/jetty/util/MultiMap;"; + + public RequestExtractContentParametersInstrumentation() { + super("jetty"); + } + + @Override + public String instrumentedType() { + return "org.eclipse.jetty.server.Request"; + } + + @Override + public String[] helperClassNames() { + return new String[] {packageName + ".MultipartHelper"}; + } + + @Override + public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvice( + named("extractContentParameters").and(takesArguments(0)).or(named("getParts")), + getClass().getName() + "$ExtractContentParametersAdvice"); + transformer.applyAdvice( + named("getParts").and(takesArguments(0)), getClass().getName() + "$GetFilenamesAdvice"); + transformer.applyAdvice( + named("getParts").and(takesArguments(1)), + getClass().getName() + "$GetFilenamesFromMultiPartAdvice"); + } + + // Discriminates Jetty [9.4.10, 10.0) + [10.0.0, 11.0): + // - _contentParameters + extractContentParameters(void) exist from 9.3+ (excludes 9.2) + // - _multiParts field exists from 9.4.10+ (excludes 9.3.x–9.4.9 covered by jetty-appsec-9.3) + // - primary spec: _multiParts: MultiParts → matches 9.4.10–9.4.x and 10.0.10+ + // - OR spec: _multiParts: MultiPartFormInputStream → matches 10.0.0–10.0.9 + // - _dispatcherType: Ljavax/servlet/DispatcherType; in the Request bytecode (excludes Jetty 11+ + // where the field descriptor is Ljakarta/servlet/DispatcherType;). This check is tied to the + // Request.class bytecode, NOT just classpath presence, so it works even when both + // javax.servlet and jakarta.servlet are on the classpath simultaneously. + // Note: GetFilenamesAdvice reads _multiParts with typing=DYNAMIC so it works for all versions. + private static final Reference REQUEST_REFERENCE = + new Reference.Builder("org.eclipse.jetty.server.Request") + .withMethod(new String[0], 0, "extractContentParameters", "V") + .withField(new String[0], 0, "_contentParameters", MULTI_MAP_INTERNAL_NAME) + .withField(new String[0], 0, "_multiParts", "Lorg/eclipse/jetty/server/MultiParts;") + .withField(new String[0], 0, "_dispatcherType", "Ljavax/servlet/DispatcherType;") + .or() + .withMethod(new String[0], 0, "extractContentParameters", "V") + .withField(new String[0], 0, "_contentParameters", MULTI_MAP_INTERNAL_NAME) + .withField( + new String[0], + 0, + "_multiParts", + "Lorg/eclipse/jetty/server/MultiPartFormInputStream;") + .withField(new String[0], 0, "_dispatcherType", "Ljavax/servlet/DispatcherType;") + .build(); + + @Override + public Reference[] additionalMuzzleReferences() { + return new Reference[] {REQUEST_REFERENCE}; + } + + @RequiresRequestContext(RequestContextSlot.APPSEC) + public static class ExtractContentParametersAdvice { + @Advice.OnMethodEnter(suppress = Throwable.class) + static boolean before(@Advice.FieldValue("_contentParameters") final MultiMap map) { + final int callDepth = CallDepthThreadLocalMap.incrementCallDepth(Request.class); + return callDepth == 0 && map == null; + } + + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + static void after( + @Advice.Enter boolean proceed, + @Advice.FieldValue("_contentParameters") final MultiMap map, + @ActiveRequestContext RequestContext reqCtx, + @Advice.Thrown(readOnly = false) Throwable t) { + CallDepthThreadLocalMap.decrementCallDepth(Request.class); + if (!proceed) { + return; + } + if (map == null || map.isEmpty()) { + return; + } + + CallbackProvider cbp = AgentTracer.get().getCallbackProvider(RequestContextSlot.APPSEC); + BiFunction> callback = + cbp.getCallback(EVENTS.requestBodyProcessed()); + if (callback == null) { + return; + } + + Flow flow = callback.apply(reqCtx, map); + Flow.Action action = flow.getAction(); + if (action instanceof Flow.Action.RequestBlockingAction) { + Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action; + BlockResponseFunction blockResponseFunction = reqCtx.getBlockResponseFunction(); + if (blockResponseFunction != null) { + blockResponseFunction.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba); + if (t == null) { + t = new BlockingException("Blocked request (for Request/extractContentParameters)"); + reqCtx.getTraceSegment().effectivelyBlocked(); + } + } + } + } + } + + /** + * Fires the {@code requestFilesFilenames} event when the application calls public {@code + * getParts()}. Guards prevent double-firing: + * + *
        + *
      • {@code _contentParameters != null}: set by {@code extractContentParameters()} (the {@code + * getParameterMap()} path); means filenames were already reported via {@code + * GetFilenamesFromMultiPartAdvice}. + *
      • {@code _multiParts != null}: set by the first {@code getParts()} call in Jetty 9.4.10+; + * means filenames were already reported. + *
      + */ + @RequiresRequestContext(RequestContextSlot.APPSEC) + public static class GetFilenamesAdvice { + @Advice.OnMethodEnter(suppress = Throwable.class) + static boolean before( + @Advice.FieldValue("_contentParameters") final MultiMap contentParameters, + @Advice.FieldValue(value = "_multiParts", typing = Assigner.Typing.DYNAMIC) + final Object multiParts) { + final int callDepth = CallDepthThreadLocalMap.incrementCallDepth(MultipartHelper.class); + return callDepth == 0 && contentParameters == null && multiParts == null; + } + + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + static void after( + @Advice.Enter boolean proceed, + @Advice.Return Collection parts, + @ActiveRequestContext RequestContext reqCtx, + @Advice.Thrown(readOnly = false) Throwable t) { + CallDepthThreadLocalMap.decrementCallDepth(MultipartHelper.class); + if (!proceed || t != null || parts == null || parts.isEmpty()) { + return; + } + t = MultipartHelper.fireFilenamesEvent(parts, reqCtx); + if (t == null) { + t = MultipartHelper.fireFilesContentEvent(parts, reqCtx); + } + } + } + + /** + * Fires the {@code requestFilesFilenames} event when multipart content is parsed via the internal + * {@code getParts(MultiMap)} path triggered by {@code getParameter*()} / {@code + * getParameterMap()} — i.e. when the application never calls public {@code getParts()}. + */ + @RequiresRequestContext(RequestContextSlot.APPSEC) + public static class GetFilenamesFromMultiPartAdvice { + @Advice.OnMethodEnter(suppress = Throwable.class) + static boolean before() { + return CallDepthThreadLocalMap.incrementCallDepth(MultipartHelper.class) == 0; + } + + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + static void after( + @Advice.Enter boolean proceed, + @Advice.Return Collection parts, + @ActiveRequestContext RequestContext reqCtx, + @Advice.Thrown(readOnly = false) Throwable t) { + CallDepthThreadLocalMap.decrementCallDepth(MultipartHelper.class); + if (!proceed || t != null || parts == null || parts.isEmpty()) { + return; + } + t = MultipartHelper.fireFilenamesEvent(parts, reqCtx); + if (t == null) { + t = MultipartHelper.fireFilesContentEvent(parts, reqCtx); + } + } + } +} diff --git a/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.4/src/test/java/datadog/trace/instrumentation/jetty94/MultipartHelperTest.java b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.4/src/test/java/datadog/trace/instrumentation/jetty94/MultipartHelperTest.java new file mode 100644 index 00000000000..a32058a8624 --- /dev/null +++ b/dd-java-agent/instrumentation/jetty/jetty-appsec/jetty-appsec-9.4/src/test/java/datadog/trace/instrumentation/jetty94/MultipartHelperTest.java @@ -0,0 +1,147 @@ +package datadog.trace.instrumentation.jetty94; + +import static java.util.Arrays.asList; +import static java.util.Collections.emptyList; +import static java.util.Collections.singletonList; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import javax.servlet.http.Part; +import org.junit.jupiter.api.Test; + +class MultipartHelperTest { + + @Test + void returnsEmptyListForNull() { + assertEquals(emptyList(), MultipartHelper.extractFilenames(null)); + } + + @Test + void returnsEmptyListForEmpty() { + assertEquals(emptyList(), MultipartHelper.extractFilenames(emptyList())); + } + + @Test + void returnsEmptyListWhenAllPartsHaveNullFilename() { + List parts = asList(part(null), part(null)); + assertEquals(emptyList(), MultipartHelper.extractFilenames(parts)); + } + + @Test + void returnsEmptyListWhenAllPartsHaveEmptyFilename() { + List parts = asList(part(""), part("")); + assertEquals(emptyList(), MultipartHelper.extractFilenames(parts)); + } + + @Test + void extractsFilenameFromSinglePart() { + List parts = singletonList(part("photo.jpg")); + assertEquals(singletonList("photo.jpg"), MultipartHelper.extractFilenames(parts)); + } + + @Test + void extractsFilenamesFromMultipleParts() { + List parts = asList(part("a.jpg"), part("b.png"), part("c.pdf")); + assertEquals(asList("a.jpg", "b.png", "c.pdf"), MultipartHelper.extractFilenames(parts)); + } + + @Test + void skipsPartsWithNullOrEmptyFilenameAndKeepsValid() { + List parts = asList(part(null), part("valid.txt"), part(""), part("other.zip")); + assertEquals(asList("valid.txt", "other.zip"), MultipartHelper.extractFilenames(parts)); + } + + @Test + void preservesFilenamesWithSpacesAndSpecialCharacters() { + List parts = asList(part("my file.tar.gz"), part("résumé.pdf")); + assertEquals(asList("my file.tar.gz", "résumé.pdf"), MultipartHelper.extractFilenames(parts)); + } + + private Part part(String submittedFileName) { + Part p = mock(Part.class); + when(p.getSubmittedFileName()).thenReturn(submittedFileName); + return p; + } + + // ── extractContents ───────────────────────────────────────────────────────── + + @Test + void extractContentsReturnsEmptyListForNull() { + assertEquals(emptyList(), MultipartHelper.extractContents(null)); + } + + @Test + void extractContentsReturnsEmptyListForEmpty() { + assertEquals(emptyList(), MultipartHelper.extractContents(emptyList())); + } + + @Test + void extractContentsSkipsFormFieldParts() { + List parts = asList(part(null), part(null)); + assertEquals(emptyList(), MultipartHelper.extractContents(parts)); + } + + @Test + void extractContentsIncludesFileWithEmptyFilename() throws IOException { + Part p = mock(Part.class); + when(p.getSubmittedFileName()).thenReturn(""); + when(p.getInputStream()) + .thenReturn(new ByteArrayInputStream("data".getBytes(StandardCharsets.UTF_8))); + when(p.getContentType()).thenReturn("text/plain; charset=UTF-8"); + assertEquals(singletonList("data"), MultipartHelper.extractContents(singletonList(p))); + } + + @Test + void extractContentsReadsFileContent() throws IOException { + Part p = mock(Part.class); + when(p.getSubmittedFileName()).thenReturn("photo.jpg"); + when(p.getInputStream()) + .thenReturn(new ByteArrayInputStream("file-content".getBytes(StandardCharsets.UTF_8))); + when(p.getContentType()).thenReturn("text/plain; charset=UTF-8"); + assertEquals(singletonList("file-content"), MultipartHelper.extractContents(singletonList(p))); + } + + @Test + void extractContentsTruncatesAtMaxContentBytes() throws IOException { + byte[] large = new byte[MultipartHelper.MAX_CONTENT_BYTES + 1]; + Arrays.fill(large, (byte) 'A'); + Part p = mock(Part.class); + when(p.getSubmittedFileName()).thenReturn("big.bin"); + when(p.getInputStream()).thenReturn(new ByteArrayInputStream(large)); + when(p.getContentType()).thenReturn(null); + List contents = MultipartHelper.extractContents(singletonList(p)); + assertEquals(1, contents.size()); + assertEquals(MultipartHelper.MAX_CONTENT_BYTES, contents.get(0).length()); + } + + @Test + void extractContentsReturnsEmptyStringOnIOException() throws IOException { + Part p = mock(Part.class); + when(p.getSubmittedFileName()).thenReturn("file.txt"); + when(p.getInputStream()).thenThrow(new IOException("simulated")); + assertEquals(singletonList(""), MultipartHelper.extractContents(singletonList(p))); + } + + @Test + void extractContentsCappsAtMaxFilesToInspect() throws IOException { + int count = MultipartHelper.MAX_FILES_TO_INSPECT + 1; + List parts = new ArrayList<>(count); + for (int i = 0; i < count; i++) { + Part p = mock(Part.class); + when(p.getSubmittedFileName()).thenReturn("file" + i + ".txt"); + when(p.getInputStream()) + .thenReturn(new ByteArrayInputStream("c".getBytes(StandardCharsets.UTF_8))); + when(p.getContentType()).thenReturn(null); + parts.add(p); + } + List contents = MultipartHelper.extractContents(parts); + assertEquals(MultipartHelper.MAX_FILES_TO_INSPECT, contents.size()); + } +} diff --git a/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-10.0/gradle.lockfile b/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-10.0/gradle.lockfile index ec0a8f4d564..a82bae858bf 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-10.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-10.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jetty:jetty-client:jetty-client-10.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=jetty10LatestDepTestCompileClasspath,jetty10L com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,jetty10LatestDepTestAnnotationProcessor,jetty10LatestDepTestCompileClasspath,jetty11TestAnnotationProcessor,jetty11TestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,jetty com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,jetty10LatestDepTestAnnotationProcessor,jetty11TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,jetty10LatestDepTestAnnotationProcessor,jetty11TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,jetty10LatestDepTestAnnotationProcessor,jetty11TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,jetty10LatestDepTestAnnotationProcessor,jetty11TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,jetty10LatestDepTestAnnotationProcessor,jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestAnnotationProcessor,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,jetty10LatestDepTestAnnotationProcessor,jetty11TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=jetty10LatestDepTestCompileClasspath,jetty10LatestD commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -103,6 +107,7 @@ org.hamcrest:hamcrest-core:1.3=jetty10LatestDepTestRuntimeClasspath,jetty11TestR org.hamcrest:hamcrest:3.0=jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -120,14 +125,14 @@ org.objenesis:objenesis:3.3=jetty10LatestDepTestCompileClasspath,jetty10LatestDe org.opentest4j:opentest4j:1.3.0=jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=jetty10LatestDepTestRuntimeClasspath,jetty11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=jetty10LatestDepTestCompileClasspath,jetty10LatestDepTestRuntimeClasspath,jetty11TestCompileClasspath,jetty11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-10.0/src/main/java11/datadog/trace/instrumentation/jetty_client10/SendContextPropagationAdvice.java b/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-10.0/src/main/java11/datadog/trace/instrumentation/jetty_client10/SendContextPropagationAdvice.java index 8a0f4846f1e..1123e8d1cbd 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-10.0/src/main/java11/datadog/trace/instrumentation/jetty_client10/SendContextPropagationAdvice.java +++ b/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-10.0/src/main/java11/datadog/trace/instrumentation/jetty_client10/SendContextPropagationAdvice.java @@ -1,7 +1,7 @@ package datadog.trace.instrumentation.jetty_client10; import static datadog.trace.agent.tooling.InstrumenterModule.TargetSystem.CONTEXT_TRACKING; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; import static datadog.trace.instrumentation.jetty_client.HeadersInjectAdapter.SETTER; import static datadog.trace.instrumentation.jetty_client10.JettyClientDecorator.DECORATE; @@ -17,7 +17,7 @@ public class SendContextPropagationAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) public static void methodEnter(@Advice.Argument(0) final Request request) { final AgentSpan span = InstrumentationContext.get(Request.class, AgentSpan.class).get(request); - Context destination = getCurrentContext(); + Context destination = currentContext(); if (span != null) { destination = destination.with(span); } diff --git a/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-12.0/gradle.lockfile b/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-12.0/gradle.lockfile index e9cc9c8e343..000de9d2a1b 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-12.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-12.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jetty:jetty-client:jetty-client-12.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -76,23 +80,24 @@ org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.eclipse.jetty.compression:jetty-compression-common:12.1.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.eclipse.jetty.compression:jetty-compression-gzip:12.1.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.eclipse.jetty.compression:jetty-compression-common:12.1.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.eclipse.jetty.compression:jetty-compression-gzip:12.1.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.eclipse.jetty:jetty-alpn-client:12.0.0=main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-alpn-client:12.1.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.eclipse.jetty:jetty-alpn-client:12.1.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.eclipse.jetty:jetty-client:12.0.0=main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-client:12.1.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.eclipse.jetty:jetty-client:12.1.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.eclipse.jetty:jetty-http:12.0.0=main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-http:12.1.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.eclipse.jetty:jetty-http:12.1.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.eclipse.jetty:jetty-io:12.0.0=main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-io:12.1.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.eclipse.jetty:jetty-io:12.1.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.eclipse.jetty:jetty-util:12.0.0=main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-util:12.1.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.eclipse.jetty:jetty-util:12.1.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -110,14 +115,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-12.0/src/main/java17/datadog/trace/instrumentation/jetty_client12/CallbackWrapper.java b/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-12.0/src/main/java17/datadog/trace/instrumentation/jetty_client12/CallbackWrapper.java index 74e393a47c2..90aa89b4f3e 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-12.0/src/main/java17/datadog/trace/instrumentation/jetty_client12/CallbackWrapper.java +++ b/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-12.0/src/main/java17/datadog/trace/instrumentation/jetty_client12/CallbackWrapper.java @@ -3,6 +3,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpan; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import org.eclipse.jetty.client.Request; @@ -24,7 +25,7 @@ public CallbackWrapper(AgentSpan parent, AgentSpan span, Object delegate) { @Override public void onBegin(Response response) { if (delegate instanceof Response.BeginListener) { - try (AgentScope scope = activate(span)) { + try (ContextScope scope = activate(span)) { ((Response.BeginListener) delegate).onBegin(response); } } @@ -33,7 +34,7 @@ public void onBegin(Response response) { @Override public void onComplete(Result result) { if (delegate instanceof Response.CompleteListener) { - try (AgentScope scope = activate(parent)) { + try (ContextScope scope = activate(parent)) { ((Response.CompleteListener) delegate).onComplete(result); } } @@ -42,7 +43,7 @@ public void onComplete(Result result) { @Override public void onFailure(Response response, Throwable failure) { if (delegate instanceof Response.FailureListener) { - try (AgentScope scope = activate(span)) { + try (ContextScope scope = activate(span)) { ((Response.FailureListener) delegate).onFailure(response, failure); } } @@ -51,7 +52,7 @@ public void onFailure(Response response, Throwable failure) { @Override public void onHeaders(Response response) { if (delegate instanceof Response.HeadersListener) { - try (AgentScope scope = activate(span)) { + try (ContextScope scope = activate(span)) { ((Response.HeadersListener) delegate).onHeaders(response); } } @@ -60,7 +61,7 @@ public void onHeaders(Response response) { @Override public void onSuccess(Response response) { if (delegate instanceof Response.SuccessListener) { - try (AgentScope scope = activate(span)) { + try (ContextScope scope = activate(span)) { ((Response.SuccessListener) delegate).onSuccess(response); } } @@ -69,7 +70,7 @@ public void onSuccess(Response response) { @Override public void onBegin(Request request) { if (delegate instanceof Request.BeginListener) { - try (AgentScope scope = activate(span)) { + try (ContextScope scope = activate(span)) { ((Request.SuccessListener) delegate).onSuccess(request); } } @@ -78,7 +79,7 @@ public void onBegin(Request request) { @Override public void onCommit(Request request) { if (delegate instanceof Request.CommitListener) { - try (AgentScope scope = activate(span)) { + try (ContextScope scope = activate(span)) { ((Request.CommitListener) delegate).onCommit(request); } } @@ -87,7 +88,7 @@ public void onCommit(Request request) { @Override public void onFailure(Request request, Throwable failure) { if (delegate instanceof Request.FailureListener) { - try (AgentScope scope = activate(span)) { + try (ContextScope scope = activate(span)) { ((Request.FailureListener) delegate).onFailure(request, failure); } } @@ -96,7 +97,7 @@ public void onFailure(Request request, Throwable failure) { @Override public void onHeaders(Request request) { if (delegate instanceof Request.HeadersListener) { - try (AgentScope scope = activate(span)) { + try (ContextScope scope = activate(span)) { ((Request.HeadersListener) delegate).onHeaders(request); } } @@ -105,7 +106,7 @@ public void onHeaders(Request request) { @Override public void onQueued(Request request) { if (delegate instanceof Request.QueuedListener) { - try (AgentScope scope = activate(span)) { + try (ContextScope scope = activate(span)) { ((Request.QueuedListener) delegate).onQueued(request); } } @@ -114,7 +115,7 @@ public void onQueued(Request request) { @Override public void onSuccess(Request request) { if (delegate instanceof Request.SuccessListener) { - try (AgentScope scope = activate(span)) { + try (ContextScope scope = activate(span)) { ((Request.SuccessListener) delegate).onSuccess(request); } } diff --git a/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-12.0/src/main/java17/datadog/trace/instrumentation/jetty_client12/SendContextPropagationAdvice.java b/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-12.0/src/main/java17/datadog/trace/instrumentation/jetty_client12/SendContextPropagationAdvice.java index 490763613f8..ab0a1e45132 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-12.0/src/main/java17/datadog/trace/instrumentation/jetty_client12/SendContextPropagationAdvice.java +++ b/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-12.0/src/main/java17/datadog/trace/instrumentation/jetty_client12/SendContextPropagationAdvice.java @@ -1,7 +1,7 @@ package datadog.trace.instrumentation.jetty_client12; import static datadog.trace.agent.tooling.InstrumenterModule.TargetSystem.CONTEXT_TRACKING; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; import static datadog.trace.instrumentation.jetty_client12.HeadersInjectAdapter.SETTER; import static datadog.trace.instrumentation.jetty_client12.JettyClientDecorator.DECORATE; @@ -20,6 +20,6 @@ public static void methodEnter(@Advice.This final HttpRequest request) { if (span == null) { return; } - DECORATE.injectContext(getCurrentContext().with(span), request, SETTER); + DECORATE.injectContext(currentContext().with(span), request, SETTER); } } diff --git a/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-9.1/gradle.lockfile b/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-9.1/gradle.lockfile index ce21749bd4d..f795e0c919d 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-9.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-9.1/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jetty:jetty-client:jetty-client-9.1:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -91,6 +95,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -108,14 +113,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-9.1/src/main/java/datadog/trace/instrumentation/jetty_client91/JettyClientInstrumentation.java b/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-9.1/src/main/java/datadog/trace/instrumentation/jetty_client91/JettyClientInstrumentation.java index ccdfad18391..eb0ffb52c1e 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-9.1/src/main/java/datadog/trace/instrumentation/jetty_client91/JettyClientInstrumentation.java +++ b/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-9.1/src/main/java/datadog/trace/instrumentation/jetty_client91/JettyClientInstrumentation.java @@ -4,7 +4,7 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.namedOneOf; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; import static datadog.trace.bootstrap.instrumentation.java.concurrent.ExcludeFilter.ExcludeType.RUNNABLE; import static datadog.trace.instrumentation.jetty_client.HeadersInjectAdapter.SETTER; import static datadog.trace.instrumentation.jetty_client91.JettyClientDecorator.DECORATE; @@ -114,7 +114,7 @@ public static class ContextPropagationAdvice { public static void methodEnter(@Advice.Argument(0) final Request request) { final AgentSpan span = InstrumentationContext.get(Request.class, AgentSpan.class).get(request); - Context destination = getCurrentContext(); + Context destination = currentContext(); if (span != null) { destination = destination.with(span); } diff --git a/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-common/gradle.lockfile b/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-common/gradle.lockfile index a4445dec277..4c9d9a6f4b7 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-common/gradle.lockfile +++ b/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-common/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jetty:jetty-client:jetty-client-common:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -85,6 +89,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -102,14 +107,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-common/src/main/java/datadog/trace/instrumentation/jetty_client/CallbackWrapper.java b/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-common/src/main/java/datadog/trace/instrumentation/jetty_client/CallbackWrapper.java index a7e623eee19..8b8aa2972dc 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-common/src/main/java/datadog/trace/instrumentation/jetty_client/CallbackWrapper.java +++ b/dd-java-agent/instrumentation/jetty/jetty-client/jetty-client-common/src/main/java/datadog/trace/instrumentation/jetty_client/CallbackWrapper.java @@ -2,6 +2,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.nio.ByteBuffer; @@ -25,7 +26,7 @@ public CallbackWrapper(AgentSpan parent, AgentSpan span, Object delegate) { @Override public void onBegin(Response response) { if (delegate instanceof Response.BeginListener) { - try (AgentScope scope = activate(span)) { + try (ContextScope scope = activate(span)) { ((Response.BeginListener) delegate).onBegin(response); } } @@ -36,7 +37,7 @@ public void onComplete(Result result) { if (delegate instanceof Response.CompleteListener) { // this probably does the wrong thing, but preserves old behaviour and is consistent // with other http clients with completion callback registration - try (AgentScope scope = activate(parent)) { + try (ContextScope scope = activate(parent)) { ((Response.CompleteListener) delegate).onComplete(result); } } @@ -45,7 +46,7 @@ public void onComplete(Result result) { @Override public void onContent(Response response, ByteBuffer content) { if (delegate instanceof Response.ContentListener) { - try (AgentScope scope = activate(span)) { + try (ContextScope scope = activate(span)) { ((Response.ContentListener) delegate).onContent(response, content); } } @@ -54,7 +55,7 @@ public void onContent(Response response, ByteBuffer content) { @Override public void onFailure(Response response, Throwable failure) { if (delegate instanceof Response.FailureListener) { - try (AgentScope scope = activate(span)) { + try (ContextScope scope = activate(span)) { ((Response.FailureListener) delegate).onFailure(response, failure); } } @@ -63,7 +64,7 @@ public void onFailure(Response response, Throwable failure) { @Override public boolean onHeader(Response response, HttpField field) { if (delegate instanceof Response.HeaderListener) { - try (AgentScope scope = activate(span)) { + try (ContextScope scope = activate(span)) { return ((Response.HeaderListener) delegate).onHeader(response, field); } } @@ -73,7 +74,7 @@ public boolean onHeader(Response response, HttpField field) { @Override public void onHeaders(Response response) { if (delegate instanceof Response.HeadersListener) { - try (AgentScope scope = activate(span)) { + try (ContextScope scope = activate(span)) { ((Response.HeadersListener) delegate).onHeaders(response); } } @@ -82,7 +83,7 @@ public void onHeaders(Response response) { @Override public void onSuccess(Response response) { if (delegate instanceof Response.SuccessListener) { - try (AgentScope scope = activate(span)) { + try (ContextScope scope = activate(span)) { ((Response.SuccessListener) delegate).onSuccess(response); } } @@ -91,7 +92,7 @@ public void onSuccess(Response response) { @Override public void onBegin(Request request) { if (delegate instanceof Request.BeginListener) { - try (AgentScope scope = activate(span)) { + try (ContextScope scope = activate(span)) { ((Request.SuccessListener) delegate).onSuccess(request); } } @@ -100,7 +101,7 @@ public void onBegin(Request request) { @Override public void onCommit(Request request) { if (delegate instanceof Request.CommitListener) { - try (AgentScope scope = activate(span)) { + try (ContextScope scope = activate(span)) { ((Request.CommitListener) delegate).onCommit(request); } } @@ -109,7 +110,7 @@ public void onCommit(Request request) { @Override public void onContent(Request request, ByteBuffer content) { if (delegate instanceof Request.ContentListener) { - try (AgentScope scope = activate(span)) { + try (ContextScope scope = activate(span)) { ((Request.ContentListener) delegate).onContent(request, content); } } @@ -118,7 +119,7 @@ public void onContent(Request request, ByteBuffer content) { @Override public void onFailure(Request request, Throwable failure) { if (delegate instanceof Request.FailureListener) { - try (AgentScope scope = activate(span)) { + try (ContextScope scope = activate(span)) { ((Request.FailureListener) delegate).onFailure(request, failure); } } @@ -127,7 +128,7 @@ public void onFailure(Request request, Throwable failure) { @Override public void onHeaders(Request request) { if (delegate instanceof Request.HeadersListener) { - try (AgentScope scope = activate(span)) { + try (ContextScope scope = activate(span)) { ((Request.HeadersListener) delegate).onHeaders(request); } } @@ -136,7 +137,7 @@ public void onHeaders(Request request) { @Override public void onQueued(Request request) { if (delegate instanceof Request.QueuedListener) { - try (AgentScope scope = activate(span)) { + try (ContextScope scope = activate(span)) { ((Request.QueuedListener) delegate).onQueued(request); } } @@ -145,7 +146,7 @@ public void onQueued(Request request) { @Override public void onSuccess(Request request) { if (delegate instanceof Request.SuccessListener) { - try (AgentScope scope = activate(span)) { + try (ContextScope scope = activate(span)) { ((Request.SuccessListener) delegate).onSuccess(request); } } diff --git a/dd-java-agent/instrumentation/jetty/jetty-common/gradle.lockfile b/dd-java-agent/instrumentation/jetty/jetty-common/gradle.lockfile index f1b557b7585..c3edd58b2dd 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-common/gradle.lockfile +++ b/dd-java-agent/instrumentation/jetty/jetty-common/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jetty:jetty-common:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,13 +51,13 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:servlet-api:2.5=compileClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -91,6 +95,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -108,14 +113,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jetty/jetty-common/src/main/java/datadog/trace/instrumentation/jetty/HandleRequestVisitor.java b/dd-java-agent/instrumentation/jetty/jetty-common/src/main/java/datadog/trace/instrumentation/jetty/HandleRequestVisitor.java index e8081846844..4c832fa4891 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-common/src/main/java/datadog/trace/instrumentation/jetty/HandleRequestVisitor.java +++ b/dd-java-agent/instrumentation/jetty/jetty-common/src/main/java/datadog/trace/instrumentation/jetty/HandleRequestVisitor.java @@ -17,7 +17,7 @@ * and replaces it with: * *
      - * if (JettyBlockingHelper.block(this.getRequest(), this.getResponse(), Java8BytecodeBridge.getCurrentContext()) {
      + * if (JettyBlockingHelper.block(this.getRequest(), this.getResponse(), Java8BytecodeBridge.currentContext()) {
        *   // nothing
        * } else {
        *   server.handle(this);
      @@ -83,7 +83,7 @@ public void visitMethodInsn(
             super.visitMethodInsn(
                 INVOKESTATIC,
                 Type.getInternalName(Java8BytecodeBridge.class),
      -          "getCurrentContext",
      +          "currentContext",
                 "()Ldatadog/context/Context;",
                 false);
             // Call JettyBlockingHelper.block(request, response, context)
      diff --git a/dd-java-agent/instrumentation/jetty/jetty-common/src/main/java/datadog/trace/instrumentation/jetty/JettyBlockingHelper.java b/dd-java-agent/instrumentation/jetty/jetty-common/src/main/java/datadog/trace/instrumentation/jetty/JettyBlockingHelper.java
      index 53b059d7506..c8704f5f895 100644
      --- a/dd-java-agent/instrumentation/jetty/jetty-common/src/main/java/datadog/trace/instrumentation/jetty/JettyBlockingHelper.java
      +++ b/dd-java-agent/instrumentation/jetty/jetty-common/src/main/java/datadog/trace/instrumentation/jetty/JettyBlockingHelper.java
      @@ -1,6 +1,5 @@
       package datadog.trace.instrumentation.jetty;
       
      -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext;
       import static java.lang.invoke.MethodHandles.collectArguments;
       import static java.lang.invoke.MethodHandles.lookup;
       import static java.lang.invoke.MethodType.methodType;
      @@ -229,7 +228,7 @@ public static boolean block(
         }
       
         public static boolean block(Request request, Response response, Context context) {
      -    AgentSpan span = spanFromContext(context);
      +    AgentSpan span = AgentSpan.fromContext(context);
           Flow.Action.RequestBlockingAction rba;
           if (span == null || (rba = span.getRequestBlockingAction()) == null) {
             return false;
      @@ -245,7 +244,7 @@ public static boolean block(Request request, Response response, Context context)
         }
       
         public static boolean hasRequestBlockingAction(Context context) {
      -    AgentSpan span = spanFromContext(context);
      +    AgentSpan span = AgentSpan.fromContext(context);
           return span != null && span.getRequestBlockingAction() != null;
         }
       
      diff --git a/dd-java-agent/instrumentation/jetty/jetty-common/src/main/java/datadog/trace/instrumentation/jetty9/HandleVisitor.java b/dd-java-agent/instrumentation/jetty/jetty-common/src/main/java/datadog/trace/instrumentation/jetty9/HandleVisitor.java
      index 096c656cb7e..44cd32cf7e5 100644
      --- a/dd-java-agent/instrumentation/jetty/jetty-common/src/main/java/datadog/trace/instrumentation/jetty9/HandleVisitor.java
      +++ b/dd-java-agent/instrumentation/jetty/jetty-common/src/main/java/datadog/trace/instrumentation/jetty9/HandleVisitor.java
      @@ -39,7 +39,7 @@
        * 
        *   case REQUEST_DISPATCH:
        *   // ...
      - *   if (JettyBlockingHelper.block(this.getRequest(), this.getResponse(), Java8BytecodeBridge.getCurrentContext())) {
      + *   if (JettyBlockingHelper.block(this.getRequest(), this.getResponse(), Java8BytecodeBridge.currentContext())) {
        *     // nothing
        *   } else {
        *     getServer().handle(this);
      @@ -65,10 +65,10 @@
        *   case DISPATCH:
        *   {
        *     // ...
      - *     if (JettyBlockingHelper.hasBlockingRequest(Java8BytecodeBridge.getCurrentContext()) {
      + *     if (JettyBlockingHelper.hasBlockingRequest(Java8BytecodeBridge.currentContext()) {
        *       Request req = getRequest(); // actually on the stack only
        *       Response resp = getResponse(); // idem
      - *       Context context = Java8BytecodeBridge.getCurrentContext() // idem
      + *       Context context = Java8BytecodeBridge.currentContext() // idem
        *       dispatch(DispatcherType.REQUEST, () -> {
        *         JettyBlockingHelper.blockAndThrowOnFailure(request, response, context);
        *       });
      @@ -95,10 +95,10 @@
        *   case DISPATCH:
        *   {
        *     // ...
      - *     if (JettyBlockingHelper.hasBlockingRequest(Java8BytecodeBridge.getCurrentContext()) {
      + *     if (JettyBlockingHelper.hasBlockingRequest(Java8BytecodeBridge.currentContext()) {
        *       Request req = getRequest(); // actually on the stack only
        *       Response resp = getResponse(); // idem
      - *       Context context = Java8BytecodeBridge.getCurrentContext() // idem
      + *       Context context = Java8BytecodeBridge.currentContext() // idem
        *       dispatch(DispatcherType.REQUEST, () -> {
        *         JettyBlockingHelper.blockAndThrowOnFailure(request, response, context);
        *       });
      @@ -170,7 +170,7 @@ public void visitMethodInsn(
             super.visitMethodInsn(
                 INVOKESTATIC,
                 Type.getInternalName(Java8BytecodeBridge.class),
      -          "getCurrentContext",
      +          "currentContext",
                 "()Ldatadog/context/Context;",
                 false);
             super.visitMethodInsn(
      @@ -216,7 +216,7 @@ public void visitMethodInsn(
             super.visitMethodInsn(
                 INVOKESTATIC,
                 Type.getInternalName(Java8BytecodeBridge.class),
      -          "getCurrentContext",
      +          "currentContext",
                 "()Ldatadog/context/Context;",
                 false);
             // Call JettyBlockingHelper.hasRequestBlockingAction(context)
      @@ -251,7 +251,7 @@ public void visitMethodInsn(
             super.visitMethodInsn(
                 INVOKESTATIC,
                 Type.getInternalName(Java8BytecodeBridge.class),
      -          "getCurrentContext",
      +          "currentContext",
                 "()Ldatadog/context/Context;",
                 false);
       
      diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/build.gradle b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/build.gradle
      index 334d032273c..aab0069cbcb 100644
      --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/build.gradle
      +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/build.gradle
      @@ -36,6 +36,9 @@ tracerJava {
       
       addTestSuiteForDir("latestDepTest", "test")
       addTestSuiteExtendingForDir("latestDepForkedTest", "latestDepTest", "test")
      +// Exercises jetty-appsec-9.4's early_10_series muzzle pass: _multiParts was
      +// MultiPartFormInputStream in [10.0.0, 10.0.10) before switching to MultiParts in 10.0.10.
      +addTestSuiteForDir("earlyDep10ForkedTest", "test")
       
       dependencies {
         main_java11Implementation project(':dd-java-agent:instrumentation:jetty:jetty-common')
      @@ -48,9 +51,11 @@ dependencies {
         }
         testImplementation project(':dd-java-agent:instrumentation:jetty:jetty-util-9.4.31')
       
      -  testImplementation group: 'org.eclipse.jetty', name: 'jetty-server', version: '10.0.0'
      -  testImplementation group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '10.0.0'
      -  testImplementation group: 'org.eclipse.jetty.websocket', name: 'websocket-javax-server', version: '10.0.0'
      +  // Use 10.0.10+ so jetty-appsec-9.4 applies: _multiParts changed from MultiPartFormInputStream
      +  // to MultiParts in 10.0.10 (jetty-appsec-9.4's muzzle requires the MultiParts type).
      +  testImplementation group: 'org.eclipse.jetty', name: 'jetty-server', version: '10.0.10'
      +  testImplementation group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '10.0.10'
      +  testImplementation group: 'org.eclipse.jetty.websocket', name: 'websocket-javax-server', version: '10.0.10'
         testImplementation project(':dd-java-agent:appsec:appsec-test-fixtures')
         testImplementation testFixtures(project(":dd-java-agent:instrumentation:jetty:jetty-server:jetty-server-9.0"))
         testImplementation testFixtures(project(':dd-java-agent:instrumentation:servlet:javax-servlet:javax-servlet-3.0'))
      @@ -63,7 +68,7 @@ dependencies {
         testRuntimeOnly project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-7.0')
         testRuntimeOnly project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-8.1.3')
         testRuntimeOnly project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-9.2')
      -  testRuntimeOnly project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-9.3')
      +  testRuntimeOnly project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-9.4')
         // Include all websocket instrumentation modules for testing. Only the version-compatible module will apply at runtime.
         testRuntimeOnly project(':dd-java-agent:instrumentation:websocket:javax-websocket-1.0')
         testRuntimeOnly project(':dd-java-agent:instrumentation:websocket:jakarta-websocket-2.0')
      @@ -72,14 +77,42 @@ dependencies {
         latestDepTestImplementation group: 'org.eclipse.jetty', name: 'jetty-server', version: '10.+'
         latestDepTestImplementation group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '10.+'
         latestDepTestImplementation group: 'org.eclipse.jetty.websocket', name: 'websocket-javax-server', version: '10.+'
      -  latestDepTestImplementation project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-9.3')
      +  latestDepTestImplementation project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-9.4')
         latestDepTestImplementation testFixtures(project(':dd-java-agent:instrumentation:servlet:javax-servlet:javax-servlet-3.0'))
       
         latestDepForkedTestImplementation group: 'org.eclipse.jetty', name: 'jetty-server', version: '10.+'
         latestDepForkedTestImplementation group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '10.+'
         latestDepForkedTestImplementation group: 'org.eclipse.jetty.websocket', name: 'websocket-javax-server', version: '10.+'
      -  latestDepForkedTestImplementation project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-9.3')
      +  latestDepForkedTestImplementation project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-9.4')
         latestDepForkedTestImplementation testFixtures(project(':dd-java-agent:instrumentation:servlet:javax-servlet:javax-servlet-3.0'))
      +
      +  // Early Jetty 10 (10.0.0–10.0.9): _multiParts is MultiPartFormInputStream, not MultiParts.
      +  earlyDep10ForkedTestImplementation group: 'org.eclipse.jetty', name: 'jetty-server', version: '10.0.9'
      +  earlyDep10ForkedTestImplementation group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '10.0.9'
      +  earlyDep10ForkedTestImplementation group: 'org.eclipse.jetty.websocket', name: 'websocket-javax-server', version: '10.0.9'
      +  earlyDep10ForkedTestImplementation project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-9.4')
      +  earlyDep10ForkedTestImplementation testFixtures(project(':dd-java-agent:instrumentation:servlet:javax-servlet:javax-servlet-3.0'))
      +}
      +
      +tasks.named('earlyDep10ForkedTest', Test) {
      +  systemProperty 'test.dd.earlyJetty10', 'true'
      +}
      +
      +// Force Jetty 10.0.9 for the early suite: earlyDep10ForkedTestImplementation extends
      +// testImplementation (which pins 10.0.10), so without this force Gradle would pick 10.0.10
      +// and never exercise the MultiPartFormInputStream path.
      +['earlyDep10ForkedTestCompileClasspath', 'earlyDep10ForkedTestRuntimeClasspath'].each { conf ->
      +  configurations.named(conf) {
      +    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
      +      if (details.requested.group == 'org.eclipse.jetty' ||
      +        details.requested.group == 'org.eclipse.jetty.websocket') {
      +        if (details.requested.version.startsWith('10.')) {
      +          details.useVersion '10.0.9'
      +          details.because 'earlyDep10ForkedTest must stay on Jetty 10.0.9 to exercise MultiPartFormInputStream path'
      +        }
      +      }
      +    }
      +  }
       }
       
       configurations.named('latestDepForkedTestRuntimeClasspath') {
      diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/gradle.lockfile b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/gradle.lockfile
      index 86c4ff52c45..cb4975c8c1d 100644
      --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/gradle.lockfile
      +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/gradle.lockfile
      @@ -1,64 +1,67 @@
       # This is a Gradle generated file for dependency locking.
       # Manual edits can break the build and are not advised.
       # This file is expected to be part of source control.
      -cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
      -com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
      -com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
      -com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jetty:jetty-server:jetty-server-10.0:dependencies --write-locks
      +cafe.cryptography:curve25519-elisabeth:0.1.0=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +cafe.cryptography:ed25519-elisabeth:0.1.0=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +ch.qos.logback:logback-classic:1.2.13=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +ch.qos.logback:logback-core:1.2.13=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
      +com.datadoghq.okhttp3:okhttp:3.12.15=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +com.datadoghq.okio:okio:1.17.6=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
      +com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
      +com.datadoghq:java-dogstatsd-client:4.4.5=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +com.datadoghq:sketches-java:0.8.3=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
       com.github.javaparser:javaparser-core:3.25.6=codenarc
      -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath
      +com.github.jnr:jffi:1.3.15=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +com.github.jnr:jnr-a64asm:1.0.0=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +com.github.jnr:jnr-constants:0.10.4=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +com.github.jnr:jnr-enxio:0.32.20=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +com.github.jnr:jnr-ffi:2.2.19=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +com.github.jnr:jnr-posix:3.1.22=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +com.github.jnr:jnr-unixsocket:0.38.25=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +com.github.jnr:jnr-x86asm:1.0.2=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs
       com.github.spotbugs:spotbugs:4.9.8=spotbugs
       com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs
      -com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath
      -com.google.auto.service:auto-service:1.1.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor
      -com.google.auto:auto-common:1.2.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor
      -com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath
      +com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,earlyDep10ForkedTestAnnotationProcessor,earlyDep10ForkedTestCompileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath
      +com.google.auto.service:auto-service:1.1.1=annotationProcessor,earlyDep10ForkedTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor
      +com.google.auto:auto-common:1.2.1=annotationProcessor,earlyDep10ForkedTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor
      +com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,earlyDep10ForkedTestAnnotationProcessor,earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath
       com.google.code.gson:gson:2.13.2=spotbugs
      -com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor
      +com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,earlyDep10ForkedTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor
       com.google.errorprone:error_prone_annotations:2.41.0=spotbugs
      -com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor
      -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor
      -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor
      -com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor
      -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -com.squareup.okio:okio:1.17.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +com.google.errorprone:error_prone_annotations:2.47.0=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +com.google.guava:failureaccess:1.0.1=annotationProcessor,earlyDep10ForkedTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor
      +com.google.guava:failureaccess:1.0.3=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +com.google.guava:guava:32.0.1-jre=annotationProcessor,earlyDep10ForkedTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor
      +com.google.guava:guava:33.6.0-jre=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,earlyDep10ForkedTestAnnotationProcessor,earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath
      +com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,earlyDep10ForkedTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor
      +com.google.j2objc:j2objc-annotations:3.1=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +com.google.re2j:re2j:1.8=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +com.squareup.moshi:moshi:1.11.0=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +com.squareup.okhttp3:logging-interceptor:3.12.12=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +com.squareup.okhttp3:okhttp:3.12.12=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +com.squareup.okio:okio:1.17.5=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
       com.thoughtworks.qdox:qdox:1.12.1=codenarc
      -commons-fileupload:commons-fileupload:1.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +commons-fileupload:commons-fileupload:1.5=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +commons-io:commons-io:2.11.0=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
       commons-io:commons-io:2.20.0=spotbugs
      -de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -jakarta.annotation:jakarta.annotation-api:1.3.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -jakarta.transaction:jakarta.transaction-api:1.3.2=testCompileClasspath,testRuntimeClasspath
      -jakarta.transaction:jakarta.transaction-api:1.3.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
      -javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -javax.websocket:javax.websocket-api:1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +de.thetaphi:forbiddenapis:3.10=compileClasspath,earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +io.leangen.geantyref:geantyref:1.3.16=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +io.sqreen:libsqreen:17.4.0=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +jakarta.annotation:jakarta.annotation-api:1.3.5=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +jakarta.transaction:jakarta.transaction-api:1.3.3=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +javax.servlet:javax.servlet-api:3.1.0=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +javax.websocket:javax.websocket-api:1.0=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
       jaxen:jaxen:2.0.0=spotbugs
      -junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
      -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
      -net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +junit:junit:4.13.2=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
      +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
      +net.java.dev.jna:jna-platform:5.8.0=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +net.java.dev.jna:jna:5.8.0=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
       net.sf.saxon:Saxon-HE:12.9=spotbugs
       org.apache.ant:ant-antlr:1.10.14=codenarc
       org.apache.ant:ant-junit:1.10.14=codenarc
      @@ -67,109 +70,138 @@ org.apache.commons:commons-lang3:3.19.0=spotbugs
       org.apache.commons:commons-text:1.14.0=spotbugs
       org.apache.logging.log4j:log4j-api:2.25.2=spotbugs
       org.apache.logging.log4j:log4j-core:2.25.2=spotbugs
      -org.apiguardian:apiguardian-api:1.1.2=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath,testCompileClasspath
      -org.checkerframework:checker-qual:3.33.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor
      +org.apiguardian:apiguardian-api:1.1.2=earlyDep10ForkedTestCompileClasspath,latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath,testCompileClasspath
      +org.checkerframework:checker-qual:3.33.0=annotationProcessor,earlyDep10ForkedTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor
       org.codehaus.groovy:groovy-ant:3.0.23=codenarc
       org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc
       org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc
       org.codehaus.groovy:groovy-json:3.0.23=codenarc
      -org.codehaus.groovy:groovy-json:3.0.25=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +org.codehaus.groovy:groovy-json:3.0.25=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
       org.codehaus.groovy:groovy-templates:3.0.23=codenarc
       org.codehaus.groovy:groovy-xml:3.0.23=codenarc
       org.codehaus.groovy:groovy:3.0.23=codenarc
      -org.codehaus.groovy:groovy:3.0.25=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +org.codehaus.groovy:groovy:3.0.25=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
       org.codenarc:CodeNarc:3.7.0=codenarc
       org.dom4j:dom4j:2.2.0=spotbugs
      -org.eclipse.jetty.toolchain:jetty-javax-websocket-api:1.1.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -org.eclipse.jetty.toolchain:jetty-servlet-api:4.0.5=main_java11CompileClasspath,testCompileClasspath,testRuntimeClasspath
      -org.eclipse.jetty.toolchain:jetty-servlet-api:4.0.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
      -org.eclipse.jetty.websocket:websocket-core-client:10.0.0=testCompileClasspath,testRuntimeClasspath
      +org.eclipse.jetty.toolchain:jetty-javax-websocket-api:1.1.2=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +org.eclipse.jetty.toolchain:jetty-servlet-api:4.0.5=main_java11CompileClasspath
      +org.eclipse.jetty.toolchain:jetty-servlet-api:4.0.6=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +org.eclipse.jetty.websocket:websocket-core-client:10.0.10=testCompileClasspath,testRuntimeClasspath
       org.eclipse.jetty.websocket:websocket-core-client:10.0.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
      -org.eclipse.jetty.websocket:websocket-core-common:10.0.0=testCompileClasspath,testRuntimeClasspath
      +org.eclipse.jetty.websocket:websocket-core-client:10.0.9=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath
      +org.eclipse.jetty.websocket:websocket-core-common:10.0.10=testCompileClasspath,testRuntimeClasspath
       org.eclipse.jetty.websocket:websocket-core-common:10.0.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
      -org.eclipse.jetty.websocket:websocket-core-server:10.0.0=testCompileClasspath,testRuntimeClasspath
      +org.eclipse.jetty.websocket:websocket-core-common:10.0.9=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath
      +org.eclipse.jetty.websocket:websocket-core-server:10.0.10=testCompileClasspath,testRuntimeClasspath
       org.eclipse.jetty.websocket:websocket-core-server:10.0.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
      -org.eclipse.jetty.websocket:websocket-javax-client:10.0.0=testCompileClasspath,testRuntimeClasspath
      +org.eclipse.jetty.websocket:websocket-core-server:10.0.9=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath
      +org.eclipse.jetty.websocket:websocket-javax-client:10.0.10=testCompileClasspath,testRuntimeClasspath
       org.eclipse.jetty.websocket:websocket-javax-client:10.0.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
      -org.eclipse.jetty.websocket:websocket-javax-common:10.0.0=testCompileClasspath,testRuntimeClasspath
      +org.eclipse.jetty.websocket:websocket-javax-client:10.0.9=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath
      +org.eclipse.jetty.websocket:websocket-javax-common:10.0.10=testCompileClasspath,testRuntimeClasspath
       org.eclipse.jetty.websocket:websocket-javax-common:10.0.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
      -org.eclipse.jetty.websocket:websocket-javax-server:10.0.0=testCompileClasspath,testRuntimeClasspath
      +org.eclipse.jetty.websocket:websocket-javax-common:10.0.9=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath
      +org.eclipse.jetty.websocket:websocket-javax-server:10.0.10=testCompileClasspath,testRuntimeClasspath
       org.eclipse.jetty.websocket:websocket-javax-server:10.0.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
      -org.eclipse.jetty.websocket:websocket-servlet:10.0.0=testCompileClasspath,testRuntimeClasspath
      +org.eclipse.jetty.websocket:websocket-javax-server:10.0.9=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath
      +org.eclipse.jetty.websocket:websocket-servlet:10.0.10=testCompileClasspath,testRuntimeClasspath
       org.eclipse.jetty.websocket:websocket-servlet:10.0.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
      -org.eclipse.jetty:jetty-alpn-client:10.0.0=testCompileClasspath,testRuntimeClasspath
      +org.eclipse.jetty.websocket:websocket-servlet:10.0.9=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath
      +org.eclipse.jetty:jetty-alpn-client:10.0.10=testCompileClasspath,testRuntimeClasspath
       org.eclipse.jetty:jetty-alpn-client:10.0.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
      -org.eclipse.jetty:jetty-annotations:10.0.0=testCompileClasspath,testRuntimeClasspath
      +org.eclipse.jetty:jetty-alpn-client:10.0.9=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath
      +org.eclipse.jetty:jetty-annotations:10.0.10=testCompileClasspath,testRuntimeClasspath
       org.eclipse.jetty:jetty-annotations:10.0.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
      -org.eclipse.jetty:jetty-client:10.0.0=testCompileClasspath,testRuntimeClasspath
      +org.eclipse.jetty:jetty-annotations:10.0.9=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath
      +org.eclipse.jetty:jetty-client:10.0.10=testCompileClasspath,testRuntimeClasspath
       org.eclipse.jetty:jetty-client:10.0.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
      -org.eclipse.jetty:jetty-http:10.0.0=main_java11CompileClasspath,testCompileClasspath,testRuntimeClasspath
      +org.eclipse.jetty:jetty-client:10.0.9=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath
      +org.eclipse.jetty:jetty-http:10.0.0=main_java11CompileClasspath
      +org.eclipse.jetty:jetty-http:10.0.10=testCompileClasspath,testRuntimeClasspath
       org.eclipse.jetty:jetty-http:10.0.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
      -org.eclipse.jetty:jetty-io:10.0.0=main_java11CompileClasspath,testCompileClasspath,testRuntimeClasspath
      +org.eclipse.jetty:jetty-http:10.0.9=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath
      +org.eclipse.jetty:jetty-io:10.0.0=main_java11CompileClasspath
      +org.eclipse.jetty:jetty-io:10.0.10=testCompileClasspath,testRuntimeClasspath
       org.eclipse.jetty:jetty-io:10.0.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
      -org.eclipse.jetty:jetty-jndi:10.0.0=testCompileClasspath,testRuntimeClasspath
      +org.eclipse.jetty:jetty-io:10.0.9=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath
      +org.eclipse.jetty:jetty-jndi:10.0.10=testCompileClasspath,testRuntimeClasspath
       org.eclipse.jetty:jetty-jndi:10.0.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
      -org.eclipse.jetty:jetty-plus:10.0.0=testCompileClasspath,testRuntimeClasspath
      +org.eclipse.jetty:jetty-jndi:10.0.9=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath
      +org.eclipse.jetty:jetty-plus:10.0.10=testCompileClasspath,testRuntimeClasspath
       org.eclipse.jetty:jetty-plus:10.0.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
      -org.eclipse.jetty:jetty-security:10.0.0=testCompileClasspath,testRuntimeClasspath
      +org.eclipse.jetty:jetty-plus:10.0.9=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath
      +org.eclipse.jetty:jetty-security:10.0.10=testCompileClasspath,testRuntimeClasspath
       org.eclipse.jetty:jetty-security:10.0.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
      -org.eclipse.jetty:jetty-server:10.0.0=main_java11CompileClasspath,testCompileClasspath,testRuntimeClasspath
      +org.eclipse.jetty:jetty-security:10.0.9=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath
      +org.eclipse.jetty:jetty-server:10.0.0=main_java11CompileClasspath
      +org.eclipse.jetty:jetty-server:10.0.10=testCompileClasspath,testRuntimeClasspath
       org.eclipse.jetty:jetty-server:10.0.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
      -org.eclipse.jetty:jetty-servlet:10.0.0=testCompileClasspath,testRuntimeClasspath
      +org.eclipse.jetty:jetty-server:10.0.9=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath
      +org.eclipse.jetty:jetty-servlet:10.0.10=testCompileClasspath,testRuntimeClasspath
       org.eclipse.jetty:jetty-servlet:10.0.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
      -org.eclipse.jetty:jetty-util:10.0.0=main_java11CompileClasspath,testCompileClasspath,testRuntimeClasspath
      +org.eclipse.jetty:jetty-servlet:10.0.9=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath
      +org.eclipse.jetty:jetty-util:10.0.0=main_java11CompileClasspath
      +org.eclipse.jetty:jetty-util:10.0.10=testCompileClasspath,testRuntimeClasspath
       org.eclipse.jetty:jetty-util:10.0.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
      -org.eclipse.jetty:jetty-webapp:10.0.0=testCompileClasspath,testRuntimeClasspath
      +org.eclipse.jetty:jetty-util:10.0.9=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath
      +org.eclipse.jetty:jetty-webapp:10.0.10=testCompileClasspath,testRuntimeClasspath
       org.eclipse.jetty:jetty-webapp:10.0.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
      -org.eclipse.jetty:jetty-xml:10.0.0=testCompileClasspath,testRuntimeClasspath
      +org.eclipse.jetty:jetty-webapp:10.0.9=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath
      +org.eclipse.jetty:jetty-xml:10.0.10=testCompileClasspath,testRuntimeClasspath
       org.eclipse.jetty:jetty-xml:10.0.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
      +org.eclipse.jetty:jetty-xml:10.0.9=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath
       org.gmetrics:GMetrics:2.1.0=codenarc
      -org.hamcrest:hamcrest-core:1.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -org.junit.jupiter:junit-jupiter:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -org.junit.platform:junit-platform-commons:1.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -org.junit.platform:junit-platform-engine:1.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -org.junit.platform:junit-platform-launcher:1.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -org.junit.platform:junit-platform-runner:1.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -org.junit.platform:junit-platform-suite-api:1.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -org.junit.platform:junit-platform-suite-commons:1.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +org.hamcrest:hamcrest-core:1.3=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +org.hamcrest:hamcrest:3.0=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +org.jctools:jctools-core-jdk11:4.0.6=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +org.jctools:jctools-core:4.0.6=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +org.jspecify:jspecify:1.0.0=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +org.junit.jupiter:junit-jupiter-api:5.14.1=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +org.junit.jupiter:junit-jupiter-engine:5.14.1=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +org.junit.jupiter:junit-jupiter-params:5.14.1=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +org.junit.jupiter:junit-jupiter:5.14.1=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +org.junit.platform:junit-platform-commons:1.14.1=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +org.junit.platform:junit-platform-engine:1.14.1=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +org.junit.platform:junit-platform-launcher:1.14.1=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +org.junit.platform:junit-platform-runner:1.14.1=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +org.junit.platform:junit-platform-suite-api:1.14.1=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +org.junit.platform:junit-platform-suite-commons:1.14.1=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
       org.junit:junit-bom:5.14.0=spotbugs
      -org.junit:junit-bom:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -org.mockito:mockito-core:4.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -org.ow2.asm:asm-analysis:9.0=testCompileClasspath
      -org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +org.junit:junit-bom:5.14.1=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +org.mockito:mockito-core:4.4.0=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +org.objenesis:objenesis:3.3=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +org.opentest4j:opentest4j:1.3.0=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +org.ow2.asm:asm-analysis:9.2=earlyDep10ForkedTestCompileClasspath
      +org.ow2.asm:asm-analysis:9.3=testCompileClasspath
      +org.ow2.asm:asm-analysis:9.7.1=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
       org.ow2.asm:asm-analysis:9.9=spotbugs
      -org.ow2.asm:asm-commons:9.0=testCompileClasspath
      +org.ow2.asm:asm-commons:9.10.1=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +org.ow2.asm:asm-commons:9.2=earlyDep10ForkedTestCompileClasspath
      +org.ow2.asm:asm-commons:9.3=testCompileClasspath
       org.ow2.asm:asm-commons:9.8=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath
       org.ow2.asm:asm-commons:9.9=spotbugs
      -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -org.ow2.asm:asm-tree:9.0=testCompileClasspath
      +org.ow2.asm:asm-tree:9.10.1=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +org.ow2.asm:asm-tree:9.2=earlyDep10ForkedTestCompileClasspath
      +org.ow2.asm:asm-tree:9.3=testCompileClasspath
       org.ow2.asm:asm-tree:9.8=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath
       org.ow2.asm:asm-tree:9.9=spotbugs
      -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      -org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
      +org.ow2.asm:asm-util:9.7.1=earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath
       org.ow2.asm:asm-util:9.9=spotbugs
      +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
       org.ow2.asm:asm:9.9=spotbugs
      -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath
      -org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +org.slf4j:jcl-over-slf4j:1.7.30=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +org.slf4j:jul-to-slf4j:1.7.30=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +org.slf4j:log4j-over-slf4j:1.7.30=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
       org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestRuntimeClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath
      -org.slf4j:slf4j-api:2.0.0-alpha1=main_java11CompileClasspath,testCompileClasspath,testRuntimeClasspath
      +org.slf4j:slf4j-api:2.0.0-alpha1=main_java11CompileClasspath
      +org.slf4j:slf4j-api:2.0.0-alpha6=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
       org.slf4j:slf4j-api:2.0.13=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath
       org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j
       org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j
      -org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath
      -org.spockframework:spock-bom:2.4-groovy-3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -org.spockframework:spock-core:2.4-groovy-3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -org.tabletest:tabletest-junit:1.2.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      -org.tabletest:tabletest-parser:1.2.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath
      +org.spockframework:spock-bom:2.4-groovy-3.0=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +org.spockframework:spock-core:2.4-groovy-3.0=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +org.tabletest:tabletest-junit:1.2.1=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
      +org.tabletest:tabletest-parser:1.2.0=earlyDep10ForkedTestCompileClasspath,earlyDep10ForkedTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath
       org.xmlresolver:xmlresolver:5.3.3=spotbugs
      -empty=main_java11AnnotationProcessor,spotbugsPlugins
      +empty=earlyDep10TestAnnotationProcessor,earlyDep10TestCompileOnly,earlyDep10TestImplementation,earlyDep10TestRuntimeOnly,main_java11AnnotationProcessor,spotbugsPlugins
      diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/main/java11/datadog/trace/instrumentation/jetty10/DispatchableAdvice.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/main/java11/datadog/trace/instrumentation/jetty10/DispatchableAdvice.java
      index 5ea02dccb66..fe009a75de4 100644
      --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/main/java11/datadog/trace/instrumentation/jetty10/DispatchableAdvice.java
      +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/main/java11/datadog/trace/instrumentation/jetty10/DispatchableAdvice.java
      @@ -1,6 +1,7 @@
       package datadog.trace.instrumentation.jetty10;
       
      -import datadog.context.Context;
      +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext;
      +
       import datadog.trace.instrumentation.jetty.JettyBlockingHelper;
       import net.bytebuddy.asm.Advice;
       import org.eclipse.jetty.server.HttpChannel;
      @@ -8,7 +9,6 @@
       public class DispatchableAdvice {
         @Advice.OnMethodEnter(suppress = Throwable.class, skipOn = Advice.OnNonDefaultValue.class)
         public static boolean /* skip */ before(@Advice.FieldValue("this$0") HttpChannel channel) {
      -    return JettyBlockingHelper.block(
      -        channel.getRequest(), channel.getResponse(), Context.current());
      +    return JettyBlockingHelper.block(channel.getRequest(), channel.getResponse(), currentContext());
         }
       }
      diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/main/java11/datadog/trace/instrumentation/jetty10/HandleAdvice.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/main/java11/datadog/trace/instrumentation/jetty10/HandleAdvice.java
      index 879562a64cf..fea6f678dac 100644
      --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/main/java11/datadog/trace/instrumentation/jetty10/HandleAdvice.java
      +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/main/java11/datadog/trace/instrumentation/jetty10/HandleAdvice.java
      @@ -1,7 +1,7 @@
       package datadog.trace.instrumentation.jetty10;
       
       import static datadog.trace.agent.tooling.InstrumenterModule.TargetSystem.CONTEXT_TRACKING;
      -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext;
      +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext;
       import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext;
       import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE;
       import static datadog.trace.instrumentation.jetty10.JettyDecorator.DD_PARENT_CONTEXT_ATTRIBUTE;
      @@ -34,7 +34,7 @@ public static void onEnter(
             parentScope = parentContext.attach();
           }
       
      -    @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class)
      +    @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
           public static void closeScope(@Advice.Local("parentScope") ContextScope parentScope) {
             if (parentScope != null) {
               parentScope.close();
      @@ -54,7 +54,7 @@ public static ContextScope onEnter(
       
           final Object parentContextObj = req.getAttribute(DD_PARENT_CONTEXT_ATTRIBUTE);
           final Context parentContext =
      -        (parentContextObj instanceof Context) ? (Context) parentContextObj : getRootContext();
      +        (parentContextObj instanceof Context) ? (Context) parentContextObj : rootContext();
           final Context context = DECORATE.startSpan(req, parentContext);
           span = spanFromContext(context);
           DECORATE.afterStart(span);
      @@ -67,7 +67,7 @@ public static ContextScope onEnter(
           return scope;
         }
       
      -  @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class)
      +  @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
         public static void closeScope(@Advice.Enter final ContextScope scope) {
           scope.close();
         }
      diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/main/java11/datadog/trace/instrumentation/jetty10/JettyCommitResponseHelper.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/main/java11/datadog/trace/instrumentation/jetty10/JettyCommitResponseHelper.java
      index 14afb30fc2a..be0be6eaa3a 100644
      --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/main/java11/datadog/trace/instrumentation/jetty10/JettyCommitResponseHelper.java
      +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/main/java11/datadog/trace/instrumentation/jetty10/JettyCommitResponseHelper.java
      @@ -1,6 +1,5 @@
       package datadog.trace.instrumentation.jetty10;
       
      -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext;
       import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE;
       import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_IGNORE_COMMIT_ATTRIBUTE;
       
      @@ -63,7 +62,7 @@ public class JettyCommitResponseHelper {
           }
       
           Context context = (Context) contextObj;
      -    AgentSpan span = spanFromContext(context);
      +    AgentSpan span = AgentSpan.fromContext(context);
           if (span == null) {
             state.partialResponse();
             return false;
      diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/main/java11/datadog/trace/instrumentation/jetty10/JettyDecorator.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/main/java11/datadog/trace/instrumentation/jetty10/JettyDecorator.java
      index d7a2591cd87..2caf9cf2754 100644
      --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/main/java11/datadog/trace/instrumentation/jetty10/JettyDecorator.java
      +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/main/java11/datadog/trace/instrumentation/jetty10/JettyDecorator.java
      @@ -108,7 +108,7 @@ protected BlockResponseFunction createBlockResponseFunction(Request request, Req
         }
       
         public static final class OnResponse {
      -    public static AgentSpan onResponse(AgentSpan span, HttpChannel channel) {
      +    public static void onResponse(AgentSpan span, HttpChannel channel) {
             Request request = channel.getRequest();
             Response response = channel.getResponse();
             if (Config.get().isServletPrincipalEnabled() && request.getUserPrincipal() != null) {
      @@ -122,7 +122,7 @@ public static AgentSpan onResponse(AgentSpan span, HttpChannel channel) {
               }
               JettyDecorator.DECORATE.onError(span, throwable);
             }
      -      return DECORATE.onResponse(span, response);
      +      DECORATE.onResponse(span, response);
           }
         }
       }
      diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/main/java11/datadog/trace/instrumentation/jetty10/ServerHandleAdvice.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/main/java11/datadog/trace/instrumentation/jetty10/ServerHandleAdvice.java
      index b121af3f8eb..eeeec5dd611 100644
      --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/main/java11/datadog/trace/instrumentation/jetty10/ServerHandleAdvice.java
      +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/main/java11/datadog/trace/instrumentation/jetty10/ServerHandleAdvice.java
      @@ -51,7 +51,7 @@ static ContextScope onEnter(
           return null;
         }
       
      -  @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class)
      +  @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class)
         public static void onExit(
             @Advice.Enter final ContextScope scope,
             @Advice.Local("request") Request req,
      @@ -68,9 +68,11 @@ public static void onExit(
             // finish will be handled by the async listener
             // Use the full context from the scope for beforeFinish
             DECORATE.beforeFinish(scope.context());
      +      scope.close();
             span.finish();
      +    } else {
      +      scope.close();
           }
      -    scope.close();
       
           synchronized (req) {
             req.removeAttribute(DD_DISPATCH_SPAN_ATTRIBUTE);
      diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/test/groovy/datadog/trace/instrumentation/jetty10/Jetty10EarlyDepForkedTest.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/test/groovy/datadog/trace/instrumentation/jetty10/Jetty10EarlyDepForkedTest.java
      new file mode 100644
      index 00000000000..47cbde9736c
      --- /dev/null
      +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/test/groovy/datadog/trace/instrumentation/jetty10/Jetty10EarlyDepForkedTest.java
      @@ -0,0 +1,58 @@
      +package datadog.trace.instrumentation.jetty10;
      +
      +import datadog.trace.agent.test.naming.TestingGenericHttpNamingConventions;
      +import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
      +
      +/**
      + * Exercises jetty-appsec-9.4's "early_10_series" muzzle pass ([10.0.0, 10.0.10)) where {@code
      + * _multiParts} is {@code MultiPartFormInputStream} instead of {@code MultiParts}. The OR-muzzle
      + * reference in jetty-appsec-9.4 covers both field types; this suite verifies the advice actually
      + * applies and fires AppSec events on the older field type.
      + *
      + * 

      Guarded by the {@code test.dd.earlyJetty10} system property so these classes only run in the + * {@code earlyDep10ForkedTest} Gradle task (Jetty 10.0.9). + */ +@EnabledIfSystemProperty(named = "test.dd.earlyJetty10", matches = ".+") +class Jetty10EarlyDepV0ForkedTest extends Jetty10Test + implements TestingGenericHttpNamingConventions.ServerV0 { + + @Override + public int version() { + return 0; + } + + @Override + public String service() { + return null; + } + + @Override + public String operation() { + return "servlet.request"; + } +} + +@EnabledIfSystemProperty(named = "test.dd.earlyJetty10", matches = ".+") +class Jetty10EarlyDepV1ForkedTest extends Jetty10Test + implements TestingGenericHttpNamingConventions.ServerV1 { + + @Override + public int version() { + return 1; + } + + @Override + public String service() { + return null; + } + + @Override + public String operation() { + return "http.server.request"; + } + + @Override + protected boolean useWebsocketPojoEndpoint() { + return false; + } +} diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/test/groovy/datadog/trace/instrumentation/jetty10/Jetty10Test.groovy b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/test/groovy/datadog/trace/instrumentation/jetty10/Jetty10Test.groovy index 7dec61c223f..5f7f5a2c10b 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/test/groovy/datadog/trace/instrumentation/jetty10/Jetty10Test.groovy +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-10.0/src/test/groovy/datadog/trace/instrumentation/jetty10/Jetty10Test.groovy @@ -85,6 +85,26 @@ abstract class Jetty10Test extends HttpServerTest { true } + @Override + boolean testBodyFilenames() { + true + } + + @Override + boolean testBodyFilenamesCalledOnce() { + true + } + + @Override + boolean testBodyFilenamesCalledOnceCombined() { + true + } + + @Override + boolean testBodyFilesContent() { + true + } + @Override boolean testSessionId() { true diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-11.0/build.gradle b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-11.0/build.gradle index 119dd38ea12..ae74abe7d1b 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-11.0/build.gradle +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-11.0/build.gradle @@ -47,7 +47,7 @@ dependencies { testImplementation ("org.eclipse.jetty.websocket:websocket-jakarta-server:11.0.0") { exclude group: 'org.slf4j', module: 'slf4j-api' } - testImplementation(project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-9.3')) + testImplementation(project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-11.0')) testImplementation testFixtures(project(':dd-java-agent:instrumentation:servlet:jakarta-servlet-5.0')) testImplementation project(':dd-java-agent:appsec:appsec-test-fixtures') testRuntimeOnly project(':dd-java-agent:instrumentation:jetty:jetty-server:jetty-server-9.0') diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-11.0/gradle.lockfile b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-11.0/gradle.lockfile index 6a0c6159783..36a30861e0f 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-11.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-11.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jetty:jetty-server:jetty-server-11.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -47,7 +51,7 @@ commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForked commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:2.0.0=testCompileClasspath,testFixturesCompileClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:2.1.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath jakarta.transaction:jakarta.transaction-api:2.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -57,8 +61,8 @@ javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latest javax.servlet:javax.servlet-api:4.0.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -130,6 +134,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepForkedTestRuntimeClasspath,latestDepTest org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -149,17 +154,17 @@ org.ow2.asm:asm-analysis:9.0=testCompileClasspath,testFixturesCompileClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs org.ow2.asm:asm-commons:9.0=testCompileClasspath,testFixturesCompileClasspath +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.8=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.0=testCompileClasspath,testFixturesCompileClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.8=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-11.0/src/main/java11/datadog/trace/instrumentation/jetty11/JettyDecorator.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-11.0/src/main/java11/datadog/trace/instrumentation/jetty11/JettyDecorator.java index a3746ca60a4..0003f085225 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-11.0/src/main/java11/datadog/trace/instrumentation/jetty11/JettyDecorator.java +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-11.0/src/main/java11/datadog/trace/instrumentation/jetty11/JettyDecorator.java @@ -102,7 +102,7 @@ protected String getRequestHeader(final Request request, String key) { return request.getHeader(key); } - public AgentSpan onResponse(AgentSpan span, HttpChannel channel) { + public void onResponse(AgentSpan span, HttpChannel channel) { Request request = channel.getRequest(); Response response = channel.getResponse(); if (Config.get().isServletPrincipalEnabled() && request.getUserPrincipal() != null) { @@ -116,7 +116,7 @@ public AgentSpan onResponse(AgentSpan span, HttpChannel channel) { } onError(span, throwable); } - return super.onResponse(span, response); + super.onResponse(span, response); } @Override diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-11.0/src/main/java11/datadog/trace/instrumentation/jetty11/JettyServerAdvice.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-11.0/src/main/java11/datadog/trace/instrumentation/jetty11/JettyServerAdvice.java index 786db5341dd..06aca2ae484 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-11.0/src/main/java11/datadog/trace/instrumentation/jetty11/JettyServerAdvice.java +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-11.0/src/main/java11/datadog/trace/instrumentation/jetty11/JettyServerAdvice.java @@ -2,7 +2,7 @@ import static datadog.trace.agent.tooling.InstrumenterModule.TargetSystem.CONTEXT_TRACKING; import static datadog.trace.bootstrap.instrumentation.api.AgentSpan.fromContext; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; import static datadog.trace.instrumentation.jetty11.JettyDecorator.DD_PARENT_CONTEXT_ATTRIBUTE; import static datadog.trace.instrumentation.jetty11.JettyDecorator.DECORATE; @@ -34,7 +34,7 @@ public static void onEnter( parentScope = parentContext.attach(); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void closeScope(@Advice.Local("parentScope") ContextScope parentScope) { if (parentScope != null) { parentScope.close(); @@ -56,7 +56,7 @@ public static ContextScope onEnter( final Object parentContextObj = req.getAttribute(DD_PARENT_CONTEXT_ATTRIBUTE); final Context parentContext = - (parentContextObj instanceof Context) ? (Context) parentContextObj : getRootContext(); + (parentContextObj instanceof Context) ? (Context) parentContextObj : rootContext(); final Context context = DECORATE.startSpan(req, parentContext); final ContextScope scope = context.attach(); span = fromContext(context); @@ -70,7 +70,7 @@ public static ContextScope onEnter( return scope; } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void closeScope(@Advice.Enter final ContextScope scope) { scope.close(); } diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-11.0/src/test/groovy/Jetty11Test.groovy b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-11.0/src/test/groovy/Jetty11Test.groovy index f4da48aaaf3..6c3c72b67e9 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-11.0/src/test/groovy/Jetty11Test.groovy +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-11.0/src/test/groovy/Jetty11Test.groovy @@ -67,6 +67,26 @@ abstract class Jetty11Test extends HttpServerTest { true } + @Override + boolean testBodyFilenames() { + true + } + + @Override + boolean testBodyFilenamesCalledOnce() { + true + } + + @Override + boolean testBodyFilenamesCalledOnceCombined() { + true + } + + @Override + boolean testBodyFilesContent() { + true + } + @Override boolean testBlocking() { true diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-11.0/src/test/groovy/JettyAsyncHandlerTest.groovy b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-11.0/src/test/groovy/JettyAsyncHandlerTest.groovy index 38f5b1449ab..799a7d392b1 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-11.0/src/test/groovy/JettyAsyncHandlerTest.groovy +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-11.0/src/test/groovy/JettyAsyncHandlerTest.groovy @@ -25,6 +25,21 @@ class JettyAsyncHandlerTest extends Jetty11Test implements TestingGenericHttpNam false } + @Override + boolean testBodyFilenames() { + false + } + + @Override + boolean testBodyFilenamesCalledOnce() { + false + } + + @Override + boolean testBodyFilenamesCalledOnceCombined() { + false + } + static class ContinuationTestHandler implements Handler { @Delegate private final Handler delegate diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/build.gradle b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/build.gradle index d2346ef072a..25b4cd11e3f 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/build.gradle +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/build.gradle @@ -67,6 +67,8 @@ dependencies { } testImplementation(project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-9.3')) + testRuntimeOnly(project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-9.4')) + testRuntimeOnly(project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-11.0')) testImplementation testFixtures(project(':dd-java-agent:instrumentation:servlet:jakarta-servlet-5.0')) testImplementation testFixtures(project(':dd-java-agent:instrumentation:servlet:javax-servlet:javax-servlet-3.0')) testRuntimeOnly project(':dd-java-agent:instrumentation:websocket:javax-websocket-1.0') diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/gradle.lockfile b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/gradle.lockfile index 99af171e106..24ba6e62cc0 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jetty:jetty-server:jetty-server-12.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=ee10ForkedTestCompileClasspath,ee10ForkedTest com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,ee10ForkedTestAnnotationProcessor,ee10ForkedTestCompileClasspath,ee10LatestDepForkedTestAnnotationProcessor,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepTestAnnotationProcessor,ee10LatestDepTestCompileClasspath,ee10TestAnnotationProcessor,ee10TestCompileClasspath,ee8LatestDepTestAnnotationProcessor,ee8LatestDepTestCompileClasspath,ee8TestAnnotationProcessor,ee8TestCompileClasspath,ee9LatestDepTestAnnotationProcessor,ee9LatestDepTestCompileClasspath,ee9TestAnnotationProcessor,ee9TestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,ee10F com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,ee10ForkedTestAnnotationProcessor,ee10LatestDepForkedTestAnnotationProcessor,ee10LatestDepTestAnnotationProcessor,ee10TestAnnotationProcessor,ee8LatestDepTestAnnotationProcessor,ee8TestAnnotationProcessor,ee9LatestDepTestAnnotationProcessor,ee9TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,ee10ForkedTestAnnotationProcessor,ee10LatestDepForkedTestAnnotationProcessor,ee10LatestDepTestAnnotationProcessor,ee10TestAnnotationProcessor,ee8LatestDepTestAnnotationProcessor,ee8TestAnnotationProcessor,ee9LatestDepTestAnnotationProcessor,ee9TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,ee10ForkedTestAnnotationProcessor,ee10LatestDepForkedTestAnnotationProcessor,ee10LatestDepTestAnnotationProcessor,ee10TestAnnotationProcessor,ee8LatestDepTestAnnotationProcessor,ee8TestAnnotationProcessor,ee9LatestDepTestAnnotationProcessor,ee9TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,ee10ForkedTestAnnotationProcessor,ee10LatestDepForkedTestAnnotationProcessor,ee10LatestDepTestAnnotationProcessor,ee10TestAnnotationProcessor,ee8LatestDepTestAnnotationProcessor,ee8TestAnnotationProcessor,ee9LatestDepTestAnnotationProcessor,ee9TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,ee10ForkedTestAnnotationProcessor,ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestAnnotationProcessor,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestAnnotationProcessor,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestAnnotationProcessor,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestAnnotationProcessor,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestAnnotationProcessor,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestAnnotationProcessor,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestAnnotationProcessor,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,ee10ForkedTestAnnotationProcessor,ee10LatestDepForkedTestAnnotationProcessor,ee10LatestDepTestAnnotationProcessor,ee10TestAnnotationProcessor,ee8LatestDepTestAnnotationProcessor,ee8TestAnnotationProcessor,ee9LatestDepTestAnnotationProcessor,ee9TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,7 +51,7 @@ commons-io:commons-io:2.11.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntim commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath jakarta.annotation:jakarta.annotation-api:2.0.0=ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath jakarta.annotation:jakarta.annotation-api:2.1.1=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath @@ -69,8 +73,8 @@ jakarta.websocket:jakarta.websocket-client-api:2.1.1=ee10ForkedTestCompileClassp javax.servlet:javax.servlet-api:3.1.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -94,103 +98,104 @@ org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.eclipse.jetty.compression:jetty-compression-common:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath -org.eclipse.jetty.compression:jetty-compression-gzip:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath +org.eclipse.jetty.compression:jetty-compression-common:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath +org.eclipse.jetty.compression:jetty-compression-gzip:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jakarta-client:12.0.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath -org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jakarta-client:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jakarta-client:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jakarta-common:12.0.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath -org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jakarta-common:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jakarta-common:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jakarta-server:12.0.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath -org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jakarta-server:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-jakarta-server:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-servlet:12.0.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath -org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-servlet:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee10.websocket:jetty-ee10-websocket-servlet:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath org.eclipse.jetty.ee10:jetty-ee10-annotations:12.0.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath -org.eclipse.jetty.ee10:jetty-ee10-annotations:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee10:jetty-ee10-annotations:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath org.eclipse.jetty.ee10:jetty-ee10-plus:12.0.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath -org.eclipse.jetty.ee10:jetty-ee10-plus:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee10:jetty-ee10-plus:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath org.eclipse.jetty.ee10:jetty-ee10-servlet:12.0.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath -org.eclipse.jetty.ee10:jetty-ee10-servlet:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee10:jetty-ee10-servlet:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath org.eclipse.jetty.ee10:jetty-ee10-webapp:12.0.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath -org.eclipse.jetty.ee10:jetty-ee10-webapp:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee10:jetty-ee10-webapp:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath org.eclipse.jetty.ee8.websocket:jetty-ee8-websocket-javax-client:12.0.0=ee8TestCompileClasspath,ee8TestRuntimeClasspath -org.eclipse.jetty.ee8.websocket:jetty-ee8-websocket-javax-client:12.1.8=ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee8.websocket:jetty-ee8-websocket-javax-client:12.1.11=ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath org.eclipse.jetty.ee8.websocket:jetty-ee8-websocket-javax-common:12.0.0=ee8TestCompileClasspath,ee8TestRuntimeClasspath -org.eclipse.jetty.ee8.websocket:jetty-ee8-websocket-javax-common:12.1.8=ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee8.websocket:jetty-ee8-websocket-javax-common:12.1.11=ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath org.eclipse.jetty.ee8.websocket:jetty-ee8-websocket-javax-server:12.0.0=ee8TestCompileClasspath,ee8TestRuntimeClasspath -org.eclipse.jetty.ee8.websocket:jetty-ee8-websocket-javax-server:12.1.8=ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee8.websocket:jetty-ee8-websocket-javax-server:12.1.11=ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath org.eclipse.jetty.ee8.websocket:jetty-ee8-websocket-servlet:12.0.0=ee8TestCompileClasspath,ee8TestRuntimeClasspath -org.eclipse.jetty.ee8.websocket:jetty-ee8-websocket-servlet:12.1.8=ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee8.websocket:jetty-ee8-websocket-servlet:12.1.11=ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath org.eclipse.jetty.ee8:jetty-ee8-annotations:12.0.0=ee8TestCompileClasspath,ee8TestRuntimeClasspath -org.eclipse.jetty.ee8:jetty-ee8-annotations:12.1.8=ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee8:jetty-ee8-annotations:12.1.11=ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath org.eclipse.jetty.ee8:jetty-ee8-nested:12.0.0=ee8TestCompileClasspath,ee8TestRuntimeClasspath -org.eclipse.jetty.ee8:jetty-ee8-nested:12.1.8=ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee8:jetty-ee8-nested:12.1.11=ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath org.eclipse.jetty.ee8:jetty-ee8-plus:12.0.0=ee8TestCompileClasspath,ee8TestRuntimeClasspath -org.eclipse.jetty.ee8:jetty-ee8-plus:12.1.8=ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee8:jetty-ee8-plus:12.1.11=ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath org.eclipse.jetty.ee8:jetty-ee8-security:12.0.0=ee8TestCompileClasspath,ee8TestRuntimeClasspath -org.eclipse.jetty.ee8:jetty-ee8-security:12.1.8=ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee8:jetty-ee8-security:12.1.11=ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath org.eclipse.jetty.ee8:jetty-ee8-servlet:12.0.0=ee8TestCompileClasspath,ee8TestRuntimeClasspath -org.eclipse.jetty.ee8:jetty-ee8-servlet:12.1.8=ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee8:jetty-ee8-servlet:12.1.11=ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath org.eclipse.jetty.ee8:jetty-ee8-webapp:12.0.0=ee8TestCompileClasspath,ee8TestRuntimeClasspath -org.eclipse.jetty.ee8:jetty-ee8-webapp:12.1.8=ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee8:jetty-ee8-webapp:12.1.11=ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath org.eclipse.jetty.ee9.websocket:jetty-ee9-websocket-jakarta-client:12.0.0=ee9TestCompileClasspath,ee9TestRuntimeClasspath -org.eclipse.jetty.ee9.websocket:jetty-ee9-websocket-jakarta-client:12.1.8=ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee9.websocket:jetty-ee9-websocket-jakarta-client:12.1.11=ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath org.eclipse.jetty.ee9.websocket:jetty-ee9-websocket-jakarta-common:12.0.0=ee9TestCompileClasspath,ee9TestRuntimeClasspath -org.eclipse.jetty.ee9.websocket:jetty-ee9-websocket-jakarta-common:12.1.8=ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee9.websocket:jetty-ee9-websocket-jakarta-common:12.1.11=ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath org.eclipse.jetty.ee9.websocket:jetty-ee9-websocket-jakarta-server:12.0.0=ee9TestCompileClasspath,ee9TestRuntimeClasspath -org.eclipse.jetty.ee9.websocket:jetty-ee9-websocket-jakarta-server:12.1.8=ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee9.websocket:jetty-ee9-websocket-jakarta-server:12.1.11=ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath org.eclipse.jetty.ee9.websocket:jetty-ee9-websocket-servlet:12.0.0=ee9TestCompileClasspath,ee9TestRuntimeClasspath -org.eclipse.jetty.ee9.websocket:jetty-ee9-websocket-servlet:12.1.8=ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee9.websocket:jetty-ee9-websocket-servlet:12.1.11=ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath org.eclipse.jetty.ee9:jetty-ee9-annotations:12.0.0=ee9TestCompileClasspath,ee9TestRuntimeClasspath -org.eclipse.jetty.ee9:jetty-ee9-annotations:12.1.8=ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee9:jetty-ee9-annotations:12.1.11=ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath org.eclipse.jetty.ee9:jetty-ee9-nested:12.0.0=ee9TestCompileClasspath,ee9TestRuntimeClasspath -org.eclipse.jetty.ee9:jetty-ee9-nested:12.1.8=ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee9:jetty-ee9-nested:12.1.11=ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath org.eclipse.jetty.ee9:jetty-ee9-plus:12.0.0=ee9TestCompileClasspath,ee9TestRuntimeClasspath -org.eclipse.jetty.ee9:jetty-ee9-plus:12.1.8=ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee9:jetty-ee9-plus:12.1.11=ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath org.eclipse.jetty.ee9:jetty-ee9-security:12.0.0=ee9TestCompileClasspath,ee9TestRuntimeClasspath -org.eclipse.jetty.ee9:jetty-ee9-security:12.1.8=ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee9:jetty-ee9-security:12.1.11=ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath org.eclipse.jetty.ee9:jetty-ee9-servlet:12.0.0=ee9TestCompileClasspath,ee9TestRuntimeClasspath -org.eclipse.jetty.ee9:jetty-ee9-servlet:12.1.8=ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee9:jetty-ee9-servlet:12.1.11=ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath org.eclipse.jetty.ee9:jetty-ee9-webapp:12.0.0=ee9TestCompileClasspath,ee9TestRuntimeClasspath -org.eclipse.jetty.ee9:jetty-ee9-webapp:12.1.8=ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath -org.eclipse.jetty.ee:jetty-ee-webapp:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee9:jetty-ee9-webapp:12.1.11=ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath +org.eclipse.jetty.ee:jetty-ee-webapp:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath org.eclipse.jetty.toolchain:jetty-jakarta-servlet-api:5.0.2=ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath org.eclipse.jetty.toolchain:jetty-jakarta-websocket-api:2.0.0=ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath org.eclipse.jetty.toolchain:jetty-javax-websocket-api:1.1.2=ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath org.eclipse.jetty.toolchain:jetty-servlet-api:4.0.6=ee8TestCompileClasspath,ee8TestRuntimeClasspath org.eclipse.jetty.toolchain:jetty-servlet-api:4.0.9=ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath org.eclipse.jetty.websocket:jetty-websocket-core-client:12.0.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath -org.eclipse.jetty.websocket:jetty-websocket-core-client:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath +org.eclipse.jetty.websocket:jetty-websocket-core-client:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath org.eclipse.jetty.websocket:jetty-websocket-core-common:12.0.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath -org.eclipse.jetty.websocket:jetty-websocket-core-common:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath +org.eclipse.jetty.websocket:jetty-websocket-core-common:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath org.eclipse.jetty.websocket:jetty-websocket-core-server:12.0.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath -org.eclipse.jetty.websocket:jetty-websocket-core-server:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath +org.eclipse.jetty.websocket:jetty-websocket-core-server:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath org.eclipse.jetty:jetty-alpn-client:12.0.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath -org.eclipse.jetty:jetty-alpn-client:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath -org.eclipse.jetty:jetty-annotations:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath +org.eclipse.jetty:jetty-alpn-client:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath +org.eclipse.jetty:jetty-annotations:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath org.eclipse.jetty:jetty-client:12.0.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath -org.eclipse.jetty:jetty-client:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath +org.eclipse.jetty:jetty-client:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath org.eclipse.jetty:jetty-http:12.0.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-http:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.eclipse.jetty:jetty-http:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.eclipse.jetty:jetty-io:12.0.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-io:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.eclipse.jetty:jetty-io:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.eclipse.jetty:jetty-jndi:12.0.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath -org.eclipse.jetty:jetty-jndi:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath -org.eclipse.jetty:jetty-plus:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath +org.eclipse.jetty:jetty-jndi:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath +org.eclipse.jetty:jetty-plus:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath org.eclipse.jetty:jetty-security:12.0.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath -org.eclipse.jetty:jetty-security:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath +org.eclipse.jetty:jetty-security:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath org.eclipse.jetty:jetty-server:12.0.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-server:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.eclipse.jetty:jetty-server:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.eclipse.jetty:jetty-session:12.0.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,main_java17CompileClasspath -org.eclipse.jetty:jetty-session:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.eclipse.jetty:jetty-session:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.eclipse.jetty:jetty-util:12.0.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-util:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.eclipse.jetty:jetty-util:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.eclipse.jetty:jetty-xml:12.0.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath -org.eclipse.jetty:jetty-xml:12.1.8=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath +org.eclipse.jetty:jetty-xml:12.1.11=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -208,22 +213,25 @@ org.objenesis:objenesis:3.3=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntime org.opentest4j:opentest4j:1.3.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepTestCompileClasspath,ee8LatestDepTestCompileClasspath,ee9LatestDepTestCompileClasspath +org.ow2.asm:asm-commons:9.10.1=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.5=ee10ForkedTestCompileClasspath,ee10TestCompileClasspath,ee8TestCompileClasspath,ee9TestCompileClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepTestCompileClasspath,ee8LatestDepTestCompileClasspath,ee9LatestDepTestCompileClasspath +org.ow2.asm:asm-tree:9.10.1=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.5=ee10ForkedTestCompileClasspath,ee10TestCompileClasspath,ee8TestCompileClasspath,ee9TestCompileClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath org.slf4j:slf4j-api:1.7.32=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:2.0.17=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,spotbugsSlf4j +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j +org.slf4j:slf4j-api:2.0.18=ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestRuntimeClasspath,latestDepTestRuntimeClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath org.spockframework:spock-bom:2.4-groovy-3.0=ee10ForkedTestCompileClasspath,ee10ForkedTestRuntimeClasspath,ee10LatestDepForkedTestCompileClasspath,ee10LatestDepForkedTestRuntimeClasspath,ee10LatestDepTestCompileClasspath,ee10LatestDepTestRuntimeClasspath,ee10TestCompileClasspath,ee10TestRuntimeClasspath,ee8LatestDepTestCompileClasspath,ee8LatestDepTestRuntimeClasspath,ee8TestCompileClasspath,ee8TestRuntimeClasspath,ee9LatestDepTestCompileClasspath,ee9LatestDepTestRuntimeClasspath,ee9TestCompileClasspath,ee9TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/src/main/java17/datadog/trace/instrumentation/jetty12/JettyDecorator.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/src/main/java17/datadog/trace/instrumentation/jetty12/JettyDecorator.java index d11fbe87cdf..bfa8d3bb1dd 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/src/main/java17/datadog/trace/instrumentation/jetty12/JettyDecorator.java +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/src/main/java17/datadog/trace/instrumentation/jetty12/JettyDecorator.java @@ -131,7 +131,7 @@ protected String getRequestHeader(final Request request, String key) { return request.getHeaders().get(key); } - public AgentSpan onResponse(AgentSpan span, HttpChannelState channel) { + public void onResponse(AgentSpan span, HttpChannelState channel) { Request request = channel.getRequest(); Response response = channel.getResponse(); if (Config.get().isServletPrincipalEnabled()) { @@ -155,6 +155,6 @@ public AgentSpan onResponse(AgentSpan span, HttpChannelState channel) { } onError(span, throwable); } - return super.onResponse(span, response); + super.onResponse(span, response); } } diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/src/main/java17/datadog/trace/instrumentation/jetty12/JettyRunnableWrapper.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/src/main/java17/datadog/trace/instrumentation/jetty12/JettyRunnableWrapper.java index 3c14020cafe..62df546a1a0 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/src/main/java17/datadog/trace/instrumentation/jetty12/JettyRunnableWrapper.java +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/src/main/java17/datadog/trace/instrumentation/jetty12/JettyRunnableWrapper.java @@ -1,25 +1,26 @@ package datadog.trace.instrumentation.jetty12; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.captureActiveSpan; -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopContinuation; import static datadog.trace.bootstrap.instrumentation.java.concurrent.ExcludeFilter.ExcludeType.RUNNABLE; import static datadog.trace.bootstrap.instrumentation.java.concurrent.ExcludeFilter.exclude; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.Context; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; public class JettyRunnableWrapper implements Runnable { private Runnable runnable; - private AgentScope.Continuation continuation; + private ContextContinuation continuation; - public JettyRunnableWrapper(Runnable runnable, AgentScope.Continuation continuation) { + public JettyRunnableWrapper(Runnable runnable, ContextContinuation continuation) { this.runnable = runnable; this.continuation = continuation; } @Override public void run() { - try (AgentScope scope = continuation.activate()) { + try (ContextScope scope = continuation.resume()) { runnable.run(); } } @@ -28,8 +29,8 @@ public static Runnable wrapIfNeeded(final Runnable task) { if (task instanceof JettyRunnableWrapper || exclude(RUNNABLE, task)) { return task; } - AgentScope.Continuation continuation = captureActiveSpan(); - if (continuation != noopContinuation()) { + ContextContinuation continuation = captureActiveSpan(); + if (continuation.context() != Context.root()) { return new JettyRunnableWrapper(task, continuation); } return task; // don't wrap unless there is a scope to propagate diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/src/main/java17/datadog/trace/instrumentation/jetty12/JettyServerAdvice.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/src/main/java17/datadog/trace/instrumentation/jetty12/JettyServerAdvice.java index 5c58258d5ce..e0c507071c5 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/src/main/java17/datadog/trace/instrumentation/jetty12/JettyServerAdvice.java +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-12.0/src/main/java17/datadog/trace/instrumentation/jetty12/JettyServerAdvice.java @@ -2,7 +2,7 @@ import static datadog.trace.agent.tooling.InstrumenterModule.TargetSystem.CONTEXT_TRACKING; import static datadog.trace.bootstrap.instrumentation.api.AgentSpan.fromContext; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; import static datadog.trace.instrumentation.jetty12.JettyDecorator.DD_PARENT_CONTEXT_ATTRIBUTE; import static datadog.trace.instrumentation.jetty12.JettyDecorator.DECORATE; @@ -49,7 +49,7 @@ public static void onExit( final Object parentContextObj = req.getAttribute(DD_PARENT_CONTEXT_ATTRIBUTE); final Context parentContext = - (parentContextObj instanceof Context) ? (Context) parentContextObj : getRootContext(); + (parentContextObj instanceof Context) ? (Context) parentContextObj : rootContext(); final Context context = DECORATE.startSpan(req, parentContext); try (final ContextScope ignored = context.attach()) { final AgentSpan span = fromContext(context); diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.0/gradle.lockfile b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.0/gradle.lockfile index 1819d4ce7ee..9e6250d112c 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jetty:jetty-server:jetty-server-7.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForked commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath javax.servlet:servlet-api:2.5=compileClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -95,6 +99,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepForkedTestRuntimeClasspath,testRuntimeCl org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -113,14 +118,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.0/src/main/java/datadog/trace/instrumentation/jetty70/JettyDecorator.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.0/src/main/java/datadog/trace/instrumentation/jetty70/JettyDecorator.java index 21a55f52535..14cd00c493d 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.0/src/main/java/datadog/trace/instrumentation/jetty70/JettyDecorator.java +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.0/src/main/java/datadog/trace/instrumentation/jetty70/JettyDecorator.java @@ -104,7 +104,7 @@ protected String getRequestHeader(final Request request, String key) { return request.getHeader(key); } - public AgentSpan onResponse(AgentSpan span, HttpConnection channel) { + public void onResponse(AgentSpan span, HttpConnection channel) { Request request = channel.getRequest(); Response response = channel.getResponse(); if (Config.get().isServletPrincipalEnabled() && request.getUserPrincipal() != null) { @@ -118,7 +118,7 @@ public AgentSpan onResponse(AgentSpan span, HttpConnection channel) { } onError(span, throwable); } - return super.onResponse(span, response); + super.onResponse(span, response); } @Override diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.0/src/main/java/datadog/trace/instrumentation/jetty70/JettyServerInstrumentation.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.0/src/main/java/datadog/trace/instrumentation/jetty70/JettyServerInstrumentation.java index 673bcb2a232..24cb4ac4f2d 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.0/src/main/java/datadog/trace/instrumentation/jetty70/JettyServerInstrumentation.java +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.0/src/main/java/datadog/trace/instrumentation/jetty70/JettyServerInstrumentation.java @@ -2,7 +2,7 @@ import static datadog.trace.agent.tooling.InstrumenterModule.TargetSystem.CONTEXT_TRACKING; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; import static datadog.trace.instrumentation.jetty70.JettyDecorator.DD_PARENT_CONTEXT_ATTRIBUTE; @@ -159,7 +159,7 @@ public static void onEnter( parentScope = parentContext.attach(); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void closeScope(@Advice.Local("parentScope") ContextScope parentScope) { if (parentScope != null) { parentScope.close(); @@ -186,7 +186,7 @@ public static ContextScope onEnter( final Object parentContextObj = req.getAttribute(DD_PARENT_CONTEXT_ATTRIBUTE); final Context parentContext = - (parentContextObj instanceof Context) ? (Context) parentContextObj : getRootContext(); + (parentContextObj instanceof Context) ? (Context) parentContextObj : rootContext(); final Context context = DECORATE.startSpan(req, parentContext); final ContextScope scope = context.attach(); span = spanFromContext(context); @@ -199,7 +199,7 @@ public static ContextScope onEnter( return scope; } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void closeScope(@Advice.Enter final ContextScope scope) { // Span is finished when the connection is reset, so we only need to close the scope here. scope.close(); diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.0/src/main/java/datadog/trace/instrumentation/jetty70/ServerHandleInstrumentation.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.0/src/main/java/datadog/trace/instrumentation/jetty70/ServerHandleInstrumentation.java index 0acc3649f3f..b0a96a784cc 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.0/src/main/java/datadog/trace/instrumentation/jetty70/ServerHandleInstrumentation.java +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.0/src/main/java/datadog/trace/instrumentation/jetty70/ServerHandleInstrumentation.java @@ -84,7 +84,7 @@ static ContextScope onEnter( return null; } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void onExit( @Advice.Enter final ContextScope scope, @Advice.Local("request") Request req, @@ -101,9 +101,11 @@ public static void onExit( // finish will be handled by the async listener // Use the full context from the scope for beforeFinish DECORATE.beforeFinish(scope.context()); + scope.close(); span.finish(); + } else { + scope.close(); } - scope.close(); synchronized (req) { req.removeAttribute(DD_DISPATCH_SPAN_ATTRIBUTE); diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.6/build.gradle b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.6/build.gradle index 613f00a4f3e..0b34ae39684 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.6/build.gradle +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.6/build.gradle @@ -20,6 +20,11 @@ configurations.testRuntimeOnly { exclude group: 'javax.servlet', module: 'javax.servlet-api' } +tasks.named('latestDepForkedTest', Test) { + // Signal that we are running against Jetty 8.x so Jetty8*LatestDepForkedTest activates. + systemProperty 'test.dd.filenames', 'true' +} + dependencies { compileOnly group: 'org.eclipse.jetty', name: 'jetty-server', version: '7.6.0.v20120127' implementation project(':dd-java-agent:instrumentation:jetty:jetty-common') @@ -34,8 +39,14 @@ dependencies { testImplementation group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '7.6.0.v20120127' testImplementation group: 'org.eclipse.jetty', name: 'jetty-continuation', version: '7.6.0.v20120127' testImplementation testFixtures(project(':dd-java-agent:instrumentation:servlet:javax-servlet:javax-servlet-3.0')) + // Needed to compile Jetty8LatestDepForkedTest (provides MultipartConfigElement). + // Uses the Orbit repackaging so it is not caught by the javax.servlet:javax.servlet-api exclusion. + // Compile-only: the Orbit jar is provided at runtime by Jetty 8.x in the latestDepForkedTest. + testCompileOnly group: 'org.eclipse.jetty.orbit', name: 'javax.servlet', version: '3.0.0.v201112011016' testRuntimeOnly project(':dd-java-agent:instrumentation:servlet:javax-servlet:javax-servlet-2.2') testRuntimeOnly project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-7.0') + // Activated only on Jetty 8.x (muzzle rejects it for 7.6) + testRuntimeOnly project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-8.1.3') latestDepTestImplementation group: 'org.eclipse.jetty', name: 'jetty-server', version: '8.+' latestDepTestImplementation group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '8.+' diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.6/gradle.lockfile b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.6/gradle.lockfile index 17fe90eaa61..8146b02ee96 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.6/gradle.lockfile +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.6/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jetty:jetty-server:jetty-server-7.6:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForked commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath javax.servlet:servlet-api:2.5=compileClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -76,7 +80,7 @@ org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.eclipse.jetty.orbit:javax.servlet:3.0.0.v201112011016=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestImplementation +org.eclipse.jetty.orbit:javax.servlet:3.0.0.v201112011016=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestImplementation,testCompileClasspath org.eclipse.jetty:jetty-continuation:7.6.0.v20120127=compileClasspath,testCompileClasspath,testRuntimeClasspath org.eclipse.jetty:jetty-continuation:8.2.0.v20160908=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestImplementation org.eclipse.jetty:jetty-http:7.6.0.v20120127=compileClasspath,testCompileClasspath,testRuntimeClasspath @@ -96,6 +100,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepForkedTestRuntimeClasspath,testRuntimeCl org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -113,14 +118,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.6/src/main/java/datadog/trace/instrumentation/jetty76/JettyDecorator.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.6/src/main/java/datadog/trace/instrumentation/jetty76/JettyDecorator.java index e5d7d184953..26817ff246e 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.6/src/main/java/datadog/trace/instrumentation/jetty76/JettyDecorator.java +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.6/src/main/java/datadog/trace/instrumentation/jetty76/JettyDecorator.java @@ -104,7 +104,7 @@ protected String getRequestHeader(final Request request, String key) { return request.getHeader(key); } - public AgentSpan onResponse(AgentSpan span, AbstractHttpConnection connection) { + public void onResponse(AgentSpan span, AbstractHttpConnection connection) { Request request = connection.getRequest(); Response response = connection.getResponse(); if (Config.get().isServletPrincipalEnabled() && request.getUserPrincipal() != null) { @@ -118,7 +118,7 @@ public AgentSpan onResponse(AgentSpan span, AbstractHttpConnection connection) { } onError(span, throwable); } - return super.onResponse(span, response); + super.onResponse(span, response); } @Override diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.6/src/main/java/datadog/trace/instrumentation/jetty76/JettyServerInstrumentation.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.6/src/main/java/datadog/trace/instrumentation/jetty76/JettyServerInstrumentation.java index 633c687743e..bba94900b2e 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.6/src/main/java/datadog/trace/instrumentation/jetty76/JettyServerInstrumentation.java +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.6/src/main/java/datadog/trace/instrumentation/jetty76/JettyServerInstrumentation.java @@ -2,7 +2,7 @@ import static datadog.trace.agent.tooling.InstrumenterModule.TargetSystem.CONTEXT_TRACKING; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_FIN_DISP_LIST_SPAN_ATTRIBUTE; @@ -159,7 +159,7 @@ public static void onEnter( parentScope = parentContext.attach(); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void closeScope(@Advice.Local("parentScope") ContextScope parentScope) { if (parentScope != null) { parentScope.close(); @@ -187,7 +187,7 @@ public static ContextScope onEnter( final Object parentContextObj = req.getAttribute(DD_PARENT_CONTEXT_ATTRIBUTE); final Context parentContext = - (parentContextObj instanceof Context) ? (Context) parentContextObj : getRootContext(); + (parentContextObj instanceof Context) ? (Context) parentContextObj : rootContext(); final Context context = DECORATE.startSpan(req, parentContext); final ContextScope scope = context.attach(); span = spanFromContext(context); @@ -200,7 +200,7 @@ public static ContextScope onEnter( return scope; } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void closeScope(@Advice.Enter final ContextScope scope) { // Span is finished when the connection is reset, so we only need to close the scope here. scope.close(); diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.6/src/main/java/datadog/trace/instrumentation/jetty76/ServerHandleInstrumentation.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.6/src/main/java/datadog/trace/instrumentation/jetty76/ServerHandleInstrumentation.java index ae8515aec21..06833e9820a 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.6/src/main/java/datadog/trace/instrumentation/jetty76/ServerHandleInstrumentation.java +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.6/src/main/java/datadog/trace/instrumentation/jetty76/ServerHandleInstrumentation.java @@ -84,7 +84,7 @@ static ContextScope onEnter( return null; } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void onExit( @Advice.Enter final ContextScope scope, @Advice.Local("agentSpan") AgentSpan span, @@ -101,9 +101,11 @@ public static void onExit( // finish will be handled by the async listener // Use the full context from the scope for beforeFinish DECORATE.beforeFinish(scope.context()); + scope.close(); span.finish(); + } else { + scope.close(); } - scope.close(); synchronized (req) { req.removeAttribute(DD_DISPATCH_SPAN_ATTRIBUTE); diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.6/src/test/groovy/Jetty8LatestDepForkedTest.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.6/src/test/groovy/Jetty8LatestDepForkedTest.java new file mode 100644 index 00000000000..2188513a81c --- /dev/null +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-7.6/src/test/groovy/Jetty8LatestDepForkedTest.java @@ -0,0 +1,138 @@ +import datadog.trace.agent.test.base.HttpServerTest; +import datadog.trace.agent.test.naming.TestingGenericHttpNamingConventions; +import java.io.IOException; +import javax.servlet.MultipartConfigElement; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.eclipse.jetty.server.Request; +import org.eclipse.jetty.server.handler.AbstractHandler; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; + +/** + * Integration tests for multipart filename extraction on Jetty 8.x. + * + *

      Jetty 8.x introduced Servlet 3.0 and {@code getParts()}, which is the only entry point for + * multipart processing in this version range (there is no {@code extractContentParameters()} + * instrumentation like in 9.3+). The handler must therefore call {@code getParts()} explicitly + * before {@code getParameterMap()} so that multipart form fields are visible to the servlet. + * + *

      Only activated for the {@code latestDepForkedTest} Gradle task (Jetty 8.x). The {@code + * test.dd.filenames} system property gates execution, preventing these tests from running against + * Jetty 7.6 where {@code getParts()} does not exist. + */ +abstract class Jetty8LatestDepForkedTest extends Jetty76Test { + + @Override + public AbstractHandler handler() { + return new Jetty8TestHandler(); + } + + @Override + public boolean testBodyMultipart() { + return true; + } + + @Override + public boolean testBodyFilenames() { + return true; + } + + @Override + public boolean testBodyFilenamesCalledOnce() { + // Jetty 8.x has no _multiParts field guard; getParts() called multiple times + // (BODY_MULTIPART_REPEATED) fires the event more than once. + return false; + } + + @Override + public boolean testBodyFilenamesCalledOnceCombined() { + // Jetty 8.x has no _contentParameters field guard; BODY_MULTIPART_COMBINED + // fires the event on the getParts() call regardless of prior parameterMap access. + return false; + } + + @Override + public boolean testBodyFilesContent() { + return true; + } + + static class Jetty8TestHandler extends AbstractHandler { + private static final MultipartConfigElement MULTIPART_CONFIG = + new MultipartConfigElement(System.getProperty("java.io.tmpdir")); + + @Override + public void handle( + String target, + Request baseRequest, + HttpServletRequest request, + HttpServletResponse response) + throws IOException, ServletException { + if (!baseRequest.getDispatcherType().name().equals("ERROR")) { + // Enable Servlet 3.0 multipart processing for all requests. + request.setAttribute("org.eclipse.jetty.multipartConfig", MULTIPART_CONFIG); + request.setAttribute("org.eclipse.multipartConfig", MULTIPART_CONFIG); + + // Jetty 8.x does not populate getParameterMap() from multipart form fields without a + // prior getParts() call (unlike 9.3+ where extractContentParameters() does this). + // Pre-call getParts() for BODY_MULTIPART so the servlet can read form fields via + // getParameterMap(). Skip for BODY_MULTIPART_REPEATED and BODY_MULTIPART_COMBINED, + // which call getParts() themselves and rely on the first call triggering filenames. + HttpServerTest.ServerEndpoint endpoint = + HttpServerTest.ServerEndpoint.forPath(request.getRequestURI()); + if (endpoint == HttpServerTest.ServerEndpoint.BODY_MULTIPART) { + try { + request.getParts(); + } catch (IOException | ServletException ignored) { + } + } + + Jetty76Test.TestHandler.handleRequest(baseRequest, response); + baseRequest.setHandled(true); + } else { + ((AbstractHandler) Jetty76Test.getErrorHandler()) + .handle(target, baseRequest, request, response); + } + } + } +} + +@EnabledIfSystemProperty(named = "test.dd.filenames", matches = ".+") +class Jetty8V0LatestDepForkedTest extends Jetty8LatestDepForkedTest + implements TestingGenericHttpNamingConventions.ServerV0 { + + @Override + public int version() { + return 0; + } + + @Override + public String service() { + return null; + } + + @Override + public String operation() { + return "servlet.request"; + } +} + +@EnabledIfSystemProperty(named = "test.dd.filenames", matches = ".+") +class Jetty8V1LatestDepForkedTest extends Jetty8LatestDepForkedTest + implements TestingGenericHttpNamingConventions.ServerV1 { + + @Override + public int version() { + return 1; + } + + @Override + public String service() { + return null; + } + + @Override + public String operation() { + return "http.server.request"; + } +} diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0.4/build.gradle b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0.4/build.gradle index d10301bebad..c341a6447fe 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0.4/build.gradle +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0.4/build.gradle @@ -12,6 +12,10 @@ apply from: "$rootDir/gradle/java.gradle" addTestSuiteForDir("latestDepTest", "test") addTestSuiteExtendingForDir("latestDepForkedTest", "latestDepTest", "test") +tasks.named('latestDepForkedTest', Test) { + systemProperty 'test.dd.jetty92', 'true' +} + // Exclude servlet 3.x API (coming from dd-java-agent:testing) to ensure servlet 2.x instrumentation applies. // Using testRuntimeClasspath instead of testImplementation because exclusions on testImplementation // propagate to latestDep* configurations, which need servlet 3.1 API for Jetty 9.2.x. diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0.4/gradle.lockfile b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0.4/gradle.lockfile index 693bc124d62..d0ca198b49c 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0.4/gradle.lockfile +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0.4/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jetty:jetty-server:jetty-server-9.0.4:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,14 +51,14 @@ commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForked commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.annotation:javax.annotation-api:1.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath javax.websocket:javax.websocket-api:1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -110,6 +114,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepForkedTestRuntimeClasspath,latestDepTest org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -128,15 +133,15 @@ org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepFor org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs org.ow2.asm:asm-commons:5.0.1=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:5.0.1=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0.4/src/main/java/datadog/trace/instrumentation/jetty904/JettyCommitResponseHelper.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0.4/src/main/java/datadog/trace/instrumentation/jetty904/JettyCommitResponseHelper.java index 7bdfa0bfb20..964f6e7a524 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0.4/src/main/java/datadog/trace/instrumentation/jetty904/JettyCommitResponseHelper.java +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0.4/src/main/java/datadog/trace/instrumentation/jetty904/JettyCommitResponseHelper.java @@ -1,6 +1,5 @@ package datadog.trace.instrumentation.jetty904; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_IGNORE_COMMIT_ATTRIBUTE; import static datadog.trace.instrumentation.jetty9.JettyDecorator.DECORATE; @@ -60,7 +59,7 @@ public class JettyCommitResponseHelper { return false; } Context context = (Context) contextObj; - AgentSpan span = spanFromContext(context); + AgentSpan span = AgentSpan.fromContext(context); if (span == null) { _committed.set(false); return false; diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0.4/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty92LatestDepForkedTest.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0.4/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty92LatestDepForkedTest.java new file mode 100644 index 00000000000..cbddff84bec --- /dev/null +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0.4/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty92LatestDepForkedTest.java @@ -0,0 +1,82 @@ +package datadog.trace.instrumentation.jetty9; + +import datadog.trace.agent.test.naming.TestingGenericHttpNamingConventions; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; + +/** + * Integration tests for multipart filename extraction on Jetty 9.2.x. + * + *

      Jetty 9.2 introduces Servlet 3.1 and {@link javax.servlet.http.Part#getSubmittedFileName()}, + * which is used by the {@code jetty-appsec-9.2} instrumentation to report filenames to the WAF. + * + *

      Only activated for the {@code latestDepForkedTest} Gradle task (Jetty 9.2.x). The {@code + * test.dd.jetty92} system property gates execution, preventing these tests from running against + * Jetty 9.0.4 where {@code getSubmittedFileName()} does not exist. + */ +abstract class Jetty92LatestDepForkedTest extends Jetty9Test { + + @Override + public boolean testBodyMultipart() { + return true; + } + + @Override + public boolean testBodyFilenames() { + return true; + } + + @Override + public boolean testBodyFilenamesCalledOnce() { + return true; + } + + @Override + public boolean testBodyFilenamesCalledOnceCombined() { + return true; + } + + @Override + public boolean testBodyFilesContent() { + return true; + } +} + +@EnabledIfSystemProperty(named = "test.dd.jetty92", matches = ".+") +class Jetty92V0LatestDepForkedTest extends Jetty92LatestDepForkedTest + implements TestingGenericHttpNamingConventions.ServerV0 { + + @Override + public int version() { + return 0; + } + + @Override + public String service() { + return null; + } + + @Override + public String operation() { + return "servlet.request"; + } +} + +@EnabledIfSystemProperty(named = "test.dd.jetty92", matches = ".+") +class Jetty92V1LatestDepForkedTest extends Jetty92LatestDepForkedTest + implements TestingGenericHttpNamingConventions.ServerV1 { + + @Override + public int version() { + return 1; + } + + @Override + public String service() { + return null; + } + + @Override + public String operation() { + return "http.server.request"; + } +} diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0.4/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty9InactiveAppSecTest.groovy b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0.4/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty9InactiveAppSecTest.groovy index b54000a00ec..3a1e9bdf844 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0.4/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty9InactiveAppSecTest.groovy +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0.4/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty9InactiveAppSecTest.groovy @@ -9,4 +9,12 @@ class Jetty9InactiveAppSecTest extends AppSecInactiveHttpServerTest { HttpServer server() { new JettyServer(TestHandler.INSTANCE) } + + // jetty-appsec-8.1.3 covers [8.1.3, 9.2.0.RC0) which includes Jetty 9.0.x. + // It instruments extractContentParameters() but calls ParameterCollector.put(String, String) + // which does not exist in Jetty 9.0.x → HTTP 500 on multipart requests. + @Override + protected boolean supportsMultipart() { + false + } } diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0.4/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty9Test.groovy b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0.4/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty9Test.groovy index 38eb20340c6..36faf0b24a9 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0.4/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty9Test.groovy +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0.4/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty9Test.groovy @@ -82,7 +82,10 @@ abstract class Jetty9Test extends HttpServerTest { @Override boolean testBodyMultipart() { - true + // jetty-appsec-8.1.3 covers [8.1.3, 9.2.0.RC0) which includes Jetty 9.0.x. + // Its extractContentParameters() advice calls ParameterCollector.put(String, String) + // which does not exist in Jetty 9.0.x → HTTP 500 on multipart requests. + false } @Override diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/gradle.lockfile b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/gradle.lockfile index 7a7fc1a2c6e..21cddc4333c 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jetty:jetty-server:jetty-server-9.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testFixturesRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testFixturesRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testFixturesCompileClass com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testFixturesRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -47,13 +51,13 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testFixturesCompileClasspath,t commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testFixturesRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testFixturesRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testFixturesCompileClasspath,testFixturesRuntimeClasspath javax.websocket:javax.websocket-api:1.0=testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testFixturesRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -90,6 +94,7 @@ org.hamcrest:hamcrest-core:1.3=testFixturesRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testFixturesRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=testFixturesRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -107,14 +112,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testFixturesRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/src/main/java/datadog/trace/instrumentation/jetty9/JettyDecorator.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/src/main/java/datadog/trace/instrumentation/jetty9/JettyDecorator.java index 3e73bc914be..ca99c88fead 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/src/main/java/datadog/trace/instrumentation/jetty9/JettyDecorator.java +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/src/main/java/datadog/trace/instrumentation/jetty9/JettyDecorator.java @@ -101,7 +101,7 @@ protected String getRequestHeader(final Request request, String key) { return request.getHeader(key); } - public AgentSpan onResponse(AgentSpan span, HttpChannel channel) { + public void onResponse(AgentSpan span, HttpChannel channel) { Request request = channel.getRequest(); Response response = channel.getResponse(); if (Config.get().isServletPrincipalEnabled() && request.getUserPrincipal() != null) { @@ -115,7 +115,7 @@ public AgentSpan onResponse(AgentSpan span, HttpChannel channel) { } onError(span, throwable); } - return super.onResponse(span, response); + super.onResponse(span, response); } @Override diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/src/main/java/datadog/trace/instrumentation/jetty9/JettyServerInstrumentation.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/src/main/java/datadog/trace/instrumentation/jetty9/JettyServerInstrumentation.java index cb533ae9462..67a6e85d9d4 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/src/main/java/datadog/trace/instrumentation/jetty9/JettyServerInstrumentation.java +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/src/main/java/datadog/trace/instrumentation/jetty9/JettyServerInstrumentation.java @@ -4,7 +4,7 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.HierarchyMatchers.declaresMethod; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.namedOneOf; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; import static datadog.trace.bootstrap.instrumentation.java.concurrent.ExcludeFilter.ExcludeType.RUNNABLE; @@ -171,7 +171,7 @@ public static void extractParent( parentScope = parentContext.attach(); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void closeParentScope(@Advice.Local("parentScope") ContextScope parentScope) { if (parentScope != null) parentScope.close(); } @@ -191,7 +191,7 @@ public static ContextScope onEnter( Object parentContextObj = req.getAttribute(DD_PARENT_CONTEXT_ATTRIBUTE); Context parentContext = - (parentContextObj instanceof Context) ? (Context) parentContextObj : getRootContext(); + (parentContextObj instanceof Context) ? (Context) parentContextObj : rootContext(); final Context context = DECORATE.startSpan(req, parentContext); final ContextScope scope = context.attach(); span = spanFromContext(context); @@ -204,7 +204,7 @@ public static ContextScope onEnter( return scope; } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void closeScope(@Advice.Enter final ContextScope scope) { scope.close(); } diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/src/main/java/datadog/trace/instrumentation/jetty9/ServerHandleInstrumentation.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/src/main/java/datadog/trace/instrumentation/jetty9/ServerHandleInstrumentation.java index 590390d8404..113bfa54151 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/src/main/java/datadog/trace/instrumentation/jetty9/ServerHandleInstrumentation.java +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/src/main/java/datadog/trace/instrumentation/jetty9/ServerHandleInstrumentation.java @@ -113,7 +113,7 @@ static ContextScope onEnter( return null; } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void onExit( @Advice.Enter final ContextScope scope, @Advice.Local("request") Request req, @@ -144,9 +144,11 @@ public static void onExit( // finish will be handled by the async listener // Use the full context from the scope for beforeFinish DECORATE.beforeFinish(scope.context()); + scope.close(); span.finish(); + } else { + scope.close(); } - scope.close(); } } } diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/src/main/java/datadog/trace/instrumentation/jetty9/WebSocketSessionInstrumentation.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/src/main/java/datadog/trace/instrumentation/jetty9/WebSocketSessionInstrumentation.java index 9057949dc62..61fd9cc8c17 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/src/main/java/datadog/trace/instrumentation/jetty9/WebSocketSessionInstrumentation.java +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/src/main/java/datadog/trace/instrumentation/jetty9/WebSocketSessionInstrumentation.java @@ -76,10 +76,10 @@ public static AgentScope before( if (handlerContext == null) { return null; } - return activateSpan(DECORATE.onSessionCloseIssued(handlerContext, null, 1000)); + return activateSpan(DECORATE.startOutboundCloseSpan(handlerContext, null, 1000)); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void after( @Advice.Enter final AgentScope scope, @Advice.Thrown final Throwable thrown, diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty9InactiveAppSecTest.groovy b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty9InactiveAppSecTest.groovy index b54000a00ec..3a1e9bdf844 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty9InactiveAppSecTest.groovy +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty9InactiveAppSecTest.groovy @@ -9,4 +9,12 @@ class Jetty9InactiveAppSecTest extends AppSecInactiveHttpServerTest { HttpServer server() { new JettyServer(TestHandler.INSTANCE) } + + // jetty-appsec-8.1.3 covers [8.1.3, 9.2.0.RC0) which includes Jetty 9.0.x. + // It instruments extractContentParameters() but calls ParameterCollector.put(String, String) + // which does not exist in Jetty 9.0.x → HTTP 500 on multipart requests. + @Override + protected boolean supportsMultipart() { + false + } } diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty9Test.groovy b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty9Test.groovy index 32a1b300c28..848f551bf29 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty9Test.groovy +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.0/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty9Test.groovy @@ -81,7 +81,10 @@ abstract class Jetty9Test extends HttpServerTest { @Override boolean testBodyMultipart() { - true + // jetty-appsec-8.1.3 covers [8.1.3, 9.2.0.RC0) which includes Jetty 9.0.x. + // Its extractContentParameters() advice calls ParameterCollector.put(String, String) + // which does not exist in Jetty 9.0.x → HTTP 500 on multipart requests. + false } @Override diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.3/build.gradle b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.3/build.gradle index 5d08c44f4c9..736630c640e 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.3/build.gradle +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.3/build.gradle @@ -41,6 +41,7 @@ dependencies { testRuntimeOnly project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-8.1.3') testRuntimeOnly project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-9.2') testRuntimeOnly project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-9.3') + testRuntimeOnly project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-9.4') latestDepTestImplementation group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.4.20.v20190813' latestDepTestImplementation group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '9.4.20.v20190813' diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.3/gradle.lockfile b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.3/gradle.lockfile index a2af18156b9..1bd8170c064 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.3/gradle.lockfile +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.3/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jetty:jetty-server:jetty-server-9.3:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,15 +51,15 @@ commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForked commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.annotation:javax.annotation-api:1.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.websocket:javax.websocket-api:1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.websocket:javax.websocket-client-api:1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -111,6 +115,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepForkedTestRuntimeClasspath,latestDepTest org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -130,15 +135,15 @@ org.ow2.asm:asm-analysis:7.1=latestDepForkedTestCompileClasspath,latestDepTestCo org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs org.ow2.asm:asm-commons:7.1=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:7.1=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.3/src/main/java/datadog/trace/instrumentation/jetty93/JettyCommitResponseHelper.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.3/src/main/java/datadog/trace/instrumentation/jetty93/JettyCommitResponseHelper.java index 5e4dc5fa078..9eb5a286891 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.3/src/main/java/datadog/trace/instrumentation/jetty93/JettyCommitResponseHelper.java +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.3/src/main/java/datadog/trace/instrumentation/jetty93/JettyCommitResponseHelper.java @@ -1,6 +1,5 @@ package datadog.trace.instrumentation.jetty93; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_IGNORE_COMMIT_ATTRIBUTE; import static datadog.trace.instrumentation.jetty9.JettyDecorator.DECORATE; @@ -56,7 +55,7 @@ public class JettyCommitResponseHelper { RequestContext requestContext; if (req.getAttribute(DD_IGNORE_COMMIT_ATTRIBUTE) != null || !((contextObj = req.getAttribute(DD_CONTEXT_ATTRIBUTE)) instanceof Context) - || (span = spanFromContext(context = (Context) contextObj)) == null + || (span = AgentSpan.fromContext(context = (Context) contextObj)) == null || (requestContext = span.getRequestContext()) == null) { _committed.set(false); return false; diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.3/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty9Test.groovy b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.3/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty9Test.groovy index 32a1b300c28..3c4c45a9d02 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.3/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty9Test.groovy +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.3/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty9Test.groovy @@ -84,6 +84,26 @@ abstract class Jetty9Test extends HttpServerTest { true } + @Override + boolean testBodyFilenames() { + true + } + + @Override + boolean testBodyFilenamesCalledOnce() { + true + } + + @Override + boolean testBodyFilenamesCalledOnceCombined() { + true + } + + @Override + boolean testBodyFilesContent() { + true + } + @Override boolean testSessionId() { true diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.4.21/build.gradle b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.4.21/build.gradle index d9ef585146e..144358e05f5 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.4.21/build.gradle +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.4.21/build.gradle @@ -42,7 +42,7 @@ dependencies { testRuntimeOnly project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-7.0') testRuntimeOnly project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-8.1.3') testRuntimeOnly project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-9.2') - testRuntimeOnly project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-9.3') + testRuntimeOnly project(':dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-9.4') latestDepTestImplementation group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.+' latestDepTestImplementation group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '9.+' diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.4.21/gradle.lockfile b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.4.21/gradle.lockfile index 53208754f2c..5c02b6066d5 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.4.21/gradle.lockfile +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.4.21/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jetty:jetty-server:jetty-server-9.4.21:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,15 +51,15 @@ commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForked commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.annotation:javax.annotation-api:1.3.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.websocket:javax.websocket-api:1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.websocket:javax.websocket-client-api:1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -112,6 +116,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepForkedTestRuntimeClasspath,latestDepTest org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -129,16 +134,16 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.7.1=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.7.1=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.4.21/src/main/java/datadog/trace/instrumentation/jetty9421/JettyCommitResponseHelper.java b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.4.21/src/main/java/datadog/trace/instrumentation/jetty9421/JettyCommitResponseHelper.java index ba34bd6412d..c51be7f1b20 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.4.21/src/main/java/datadog/trace/instrumentation/jetty9421/JettyCommitResponseHelper.java +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.4.21/src/main/java/datadog/trace/instrumentation/jetty9421/JettyCommitResponseHelper.java @@ -1,6 +1,5 @@ package datadog.trace.instrumentation.jetty9421; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_IGNORE_COMMIT_ATTRIBUTE; import static datadog.trace.instrumentation.jetty9.JettyDecorator.DECORATE; @@ -59,7 +58,7 @@ public class JettyCommitResponseHelper { RequestContext requestContext; if (req.getAttribute(DD_IGNORE_COMMIT_ATTRIBUTE) != null || !((contextObj = req.getAttribute(DD_CONTEXT_ATTRIBUTE)) instanceof Context) - || (span = spanFromContext(context = (Context) contextObj)) == null + || (span = AgentSpan.fromContext(context = (Context) contextObj)) == null || (requestContext = span.getRequestContext()) == null) { state.partialResponse(); return false; diff --git a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.4.21/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty9Test.groovy b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.4.21/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty9Test.groovy index 38eb20340c6..fcbe105bc6f 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.4.21/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty9Test.groovy +++ b/dd-java-agent/instrumentation/jetty/jetty-server/jetty-server-9.4.21/src/test/groovy/datadog/trace/instrumentation/jetty9/Jetty9Test.groovy @@ -85,6 +85,26 @@ abstract class Jetty9Test extends HttpServerTest { true } + @Override + boolean testBodyFilenames() { + true + } + + @Override + boolean testBodyFilenamesCalledOnce() { + true + } + + @Override + boolean testBodyFilenamesCalledOnceCombined() { + true + } + + @Override + boolean testBodyFilesContent() { + true + } + @Override boolean testSessionId() { true diff --git a/dd-java-agent/instrumentation/jetty/jetty-util-9.4.31/gradle.lockfile b/dd-java-agent/instrumentation/jetty/jetty-util-9.4.31/gradle.lockfile index 2420e8345ac..505744eb63c 100644 --- a/dd-java-agent/instrumentation/jetty/jetty-util-9.4.31/gradle.lockfile +++ b/dd-java-agent/instrumentation/jetty/jetty-util-9.4.31/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jetty:jetty-util-9.4.31:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -83,6 +87,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -100,14 +105,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jms/jakarta-jms-3.0/gradle.lockfile b/dd-java-agent/instrumentation/jms/jakarta-jms-3.0/gradle.lockfile index 95acd48addf..1bb1804b34c 100644 --- a/dd-java-agent/instrumentation/jms/jakarta-jms-3.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/jms/jakarta-jms-3.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jms:jakarta-jms-3.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -48,7 +52,7 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath io.netty:netty-all:4.0.30.Final=testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:2.1.1=testCompileClasspath,testRuntimeClasspath jakarta.ejb:jakarta.ejb-api:4.0.0=testCompileClasspath,testRuntimeClasspath jakarta.inject:jakarta.inject-api:2.0.0=testCompileClasspath,testRuntimeClasspath @@ -58,8 +62,8 @@ javax.inject:javax.inject:1=testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -104,6 +108,7 @@ org.jboss:jboss-transaction-spi:7.0.0.Final=testCompileClasspath,testRuntimeClas org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath org.jgroups:jgroups:3.3.4.Final=testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -121,14 +126,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jms/javax-jms-1.1/build.gradle b/dd-java-agent/instrumentation/jms/javax-jms-1.1/build.gradle index 739bc235846..74b9d050a9a 100644 --- a/dd-java-agent/instrumentation/jms/javax-jms-1.1/build.gradle +++ b/dd-java-agent/instrumentation/jms/javax-jms-1.1/build.gradle @@ -14,6 +14,7 @@ muzzle { } apply from: "$rootDir/gradle/java.gradle" +apply plugin: 'java-test-fixtures' repositories { maven { @@ -33,6 +34,8 @@ tasks.named("latestDepTest", Test) { dependencies { compileOnly group: 'javax.jms', name: 'jms-api', version: '1.1-rev-1' + testFixturesCompileOnly group: 'javax.jms', name: 'jms-api', version: '1.1-rev-1' + testImplementation project(':dd-java-agent:instrumentation:datadog:tracing:trace-annotation') testImplementation group: 'org.apache.activemq.tooling', name: 'activemq-junit', version: '5.14.5' testImplementation group: 'org.apache.activemq', name: 'activemq-pool', version: '5.14.5' diff --git a/dd-java-agent/instrumentation/jms/javax-jms-1.1/gradle.lockfile b/dd-java-agent/instrumentation/jms/javax-jms-1.1/gradle.lockfile index cde2ee01a01..a942dc58005 100644 --- a/dd-java-agent/instrumentation/jms/javax-jms-1.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/jms/javax-jms-1.1/gradle.lockfile @@ -1,27 +1,28 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jms:javax-jms-1.1:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -49,17 +53,17 @@ commons-logging:commons-logging:1.2=latestDepForkedTestCompileClasspath,latestDe de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.netty:netty-all:4.0.13.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.annotation:javax.annotation-api:1.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.ejb:javax.ejb-api:3.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.inject:javax.inject:1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -javax.jms:jms-api:1.1-rev-1=compileClasspath +javax.jms:jms-api:1.1-rev-1=compileClasspath,testFixturesCompileClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.transaction:javax.transaction-api:1.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -114,6 +118,7 @@ org.jboss:jboss-transaction-spi:7.0.0.Final=latestDepForkedTestCompileClasspath, org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jgroups:jgroups:3.3.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -131,22 +136,22 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath +org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath org.slf4j:slf4j-api:1.7.32=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j -org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.spockframework:spock-bom:2.4-groovy-3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.springframework:spring-aop:4.3.21.RELEASE=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -160,4 +165,4 @@ org.springframework:spring-tx:4.3.21.RELEASE=latestDepForkedTestCompileClasspath org.tabletest:tabletest-junit:1.2.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -empty=spotbugsPlugins +empty=spotbugsPlugins,testFixturesAnnotationProcessor diff --git a/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/main/java/datadog/trace/instrumentation/jms/DatadogMessageListener.java b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/main/java/datadog/trace/instrumentation/jms/DatadogMessageListener.java index 954dec71ad0..991d4823fc6 100644 --- a/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/main/java/datadog/trace/instrumentation/jms/DatadogMessageListener.java +++ b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/main/java/datadog/trace/instrumentation/jms/DatadogMessageListener.java @@ -11,8 +11,8 @@ import static datadog.trace.instrumentation.jms.MessageExtractAdapter.GETTER; import static java.util.concurrent.TimeUnit.MILLISECONDS; +import datadog.context.ContextScope; import datadog.trace.bootstrap.ContextStore; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext; import datadog.trace.bootstrap.instrumentation.jms.MessageConsumerState; @@ -58,7 +58,7 @@ public void onMessage(Message message) { consumerState.getBrokerServiceName()); consumerState.setTimeInQueueSpan(batchId, timeInQueue); } - span = startSpan("jms", JMS_CONSUME, timeInQueue.context()); + span = startSpan("jms", JMS_CONSUME, timeInQueue.spanContext()); } CONSUMER_DECORATE.afterStart(span); CONSUMER_DECORATE.onConsume(span, message, consumerState.getConsumerResourceName()); @@ -71,7 +71,7 @@ public void onMessage(Message message) { // span will be finished by Session.commit/rollback/close sessionState.finishOnCommit(span); } - try (AgentScope scope = activateSpan(span)) { + try (ContextScope scope = activateSpan(span)) { messageListener.onMessage(message); } catch (RuntimeException | Error thrown) { CONSUMER_DECORATE.onError(span, thrown); diff --git a/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/main/java/datadog/trace/instrumentation/jms/JMSDecorator.java b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/main/java/datadog/trace/instrumentation/jms/JMSDecorator.java index 87fbfc55fc7..c9dd753b3da 100644 --- a/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/main/java/datadog/trace/instrumentation/jms/JMSDecorator.java +++ b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/main/java/datadog/trace/instrumentation/jms/JMSDecorator.java @@ -19,10 +19,13 @@ import javax.jms.Destination; import javax.jms.JMSException; import javax.jms.Message; +import javax.jms.MessageProducer; import javax.jms.Queue; +import javax.jms.QueueSender; import javax.jms.TemporaryQueue; import javax.jms.TemporaryTopic; import javax.jms.Topic; +import javax.jms.TopicPublisher; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -265,6 +268,18 @@ public CharSequence toResourceName(String destinationName, boolean isQueue) { return joiner.apply(destinationName); } + public Destination getDestination(final MessageProducer messageProducer) throws JMSException { + try { + return messageProducer.getDestination(); // >= 1.1 + } catch (AbstractMethodError ignored) { + // <=1.1 getDestination is not available so we need to pay an additional instanceOf + if (messageProducer instanceof QueueSender) { + return ((QueueSender) messageProducer).getQueue(); + } + return ((TopicPublisher) messageProducer).getTopic(); + } + } + public String getDestinationName(Destination destination) { String name = null; try { diff --git a/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/main/java/datadog/trace/instrumentation/jms/JMSMessageConsumerInstrumentation.java b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/main/java/datadog/trace/instrumentation/jms/JMSMessageConsumerInstrumentation.java index 75a59e7406d..06d53e1ba3b 100644 --- a/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/main/java/datadog/trace/instrumentation/jms/JMSMessageConsumerInstrumentation.java +++ b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/main/java/datadog/trace/instrumentation/jms/JMSMessageConsumerInstrumentation.java @@ -9,7 +9,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateNext; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.closePrevious; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.jms.JMSDecorator.BROKER_DECORATE; import static datadog.trace.instrumentation.jms.JMSDecorator.CONSUMER_DECORATE; @@ -96,7 +96,7 @@ public static MessageConsumerState beforeReceive(@Advice.This final MessageConsu if (InstrumenterConfig.get().isLegacyContextManagerEnabled()) { closePrevious(finishSpan); } else { - final AgentSpan previousSpan = spanFromContext(getRootContext().swap()); + final AgentSpan previousSpan = spanFromContext(rootContext().swap()); if (previousSpan != null) { CONSUMER_DECORATE.beforeFinish(previousSpan); previousSpan.finishWithEndToEnd(); @@ -156,7 +156,7 @@ public static void afterReceive( consumerState.getBrokerServiceName()); consumerState.setTimeInQueueSpan(batchId, timeInQueue); } - span = startSpan("jms", JMS_CONSUME, timeInQueue.context()); + span = startSpan("jms", JMS_CONSUME, timeInQueue.spanContext()); } CONSUMER_DECORATE.afterStart(span); @@ -209,7 +209,7 @@ public static void beforeClose(@Advice.This final MessageConsumer consumer) { if (InstrumenterConfig.get().isLegacyContextManagerEnabled()) { closePrevious(finishSpan); } else { - final AgentSpan previousSpan = spanFromContext(getRootContext().swap()); + final AgentSpan previousSpan = spanFromContext(rootContext().swap()); if (previousSpan != null) { CONSUMER_DECORATE.beforeFinish(previousSpan); previousSpan.finishWithEndToEnd(); diff --git a/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/main/java/datadog/trace/instrumentation/jms/JMSMessageProducerInstrumentation.java b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/main/java/datadog/trace/instrumentation/jms/JMSMessageProducerInstrumentation.java index 972b4382209..3dbfa0579f5 100644 --- a/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/main/java/datadog/trace/instrumentation/jms/JMSMessageProducerInstrumentation.java +++ b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/main/java/datadog/trace/instrumentation/jms/JMSMessageProducerInstrumentation.java @@ -90,10 +90,10 @@ public static AgentScope beforeSend( // fall-back when producer wasn't created via standard Session.createProducer API if (null != producerState) { resourceName = producerState.getResourceName(); - Destination destination = producer.getDestination(); + Destination destination = PRODUCER_DECORATE.getDestination(producer); destinationName = PRODUCER_DECORATE.getDestinationName(destination); } else { - Destination destination = producer.getDestination(); + Destination destination = PRODUCER_DECORATE.getDestination(producer); destinationName = PRODUCER_DECORATE.getDestinationName(destination); boolean isQueue = PRODUCER_DECORATE.isQueue(destination); resourceName = PRODUCER_DECORATE.toResourceName(destinationName, isQueue); diff --git a/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/main/java/datadog/trace/instrumentation/jms/MDBMessageConsumerInstrumentation.java b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/main/java/datadog/trace/instrumentation/jms/MDBMessageConsumerInstrumentation.java index d9b878f9c69..9ae776c7ed4 100644 --- a/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/main/java/datadog/trace/instrumentation/jms/MDBMessageConsumerInstrumentation.java +++ b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/main/java/datadog/trace/instrumentation/jms/MDBMessageConsumerInstrumentation.java @@ -8,7 +8,7 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static datadog.trace.instrumentation.jms.JMSDecorator.CONSUMER_DECORATE; import static datadog.trace.instrumentation.jms.JMSDecorator.JMS_CONSUME; import static datadog.trace.instrumentation.jms.JMSDecorator.logJMSException; @@ -70,7 +70,7 @@ public static class ContextPropagationAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) public static void onEnter( @Advice.Argument(0) final Message message, @Advice.Local("ctxScope") ContextScope scope) { - scope = defaultPropagator().extract(getRootContext(), message, GETTER).attach(); + scope = defaultPropagator().extract(rootContext(), message, GETTER).attach(); } @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) diff --git a/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/main/java/datadog/trace/instrumentation/jms/SessionInstrumentation.java b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/main/java/datadog/trace/instrumentation/jms/SessionInstrumentation.java index 3f7b095b3b7..8c3ffa48231 100644 --- a/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/main/java/datadog/trace/instrumentation/jms/SessionInstrumentation.java +++ b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/main/java/datadog/trace/instrumentation/jms/SessionInstrumentation.java @@ -114,7 +114,7 @@ public static void bindProducerState( int ackMode; try { ackMode = session.getAcknowledgeMode(); - } catch (Exception ignored) { + } catch (Throwable ignored) { ackMode = Session.AUTO_ACKNOWLEDGE; } sessionState = @@ -155,7 +155,7 @@ public static void bindConsumerState( int ackMode; try { ackMode = session.getAcknowledgeMode(); - } catch (Exception ignored) { + } catch (Throwable ignored) { ackMode = Session.AUTO_ACKNOWLEDGE; } sessionState = diff --git a/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/test/groovy/JMS1Test.groovy b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/test/groovy/JMS1Test.groovy index f059016bc62..f24b7e8f9ff 100644 --- a/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/test/groovy/JMS1Test.groovy +++ b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/test/groovy/JMS1Test.groovy @@ -7,32 +7,32 @@ import datadog.trace.agent.test.naming.VersionedNamingTestBase import datadog.trace.api.Config import datadog.trace.api.DDSpanTypes import datadog.trace.api.Trace -import datadog.trace.api.config.TracerConfig import datadog.trace.api.config.TraceInstrumentationConfig +import datadog.trace.api.config.TracerConfig import datadog.trace.bootstrap.instrumentation.api.InstrumentationTags import datadog.trace.bootstrap.instrumentation.api.Tags import datadog.trace.core.DDSpan -import org.apache.activemq.ActiveMQConnectionFactory -import org.apache.activemq.command.ActiveMQTextMessage -import org.apache.activemq.junit.EmbeddedActiveMQBroker -import spock.lang.Shared - +import java.util.concurrent.CountDownLatch +import java.util.concurrent.atomic.AtomicReference import javax.jms.Connection +import javax.jms.ConnectionFactory import javax.jms.Destination import javax.jms.Message import javax.jms.MessageListener +import javax.jms.Queue import javax.jms.QueueConnection import javax.jms.QueueSession import javax.jms.Session import javax.jms.TemporaryQueue import javax.jms.TemporaryTopic -import javax.jms.Queue -import javax.jms.Topic import javax.jms.TextMessage +import javax.jms.Topic import javax.jms.TopicConnection import javax.jms.TopicSession -import java.util.concurrent.CountDownLatch -import java.util.concurrent.atomic.AtomicReference +import jms10mock.Jms10ConnectionFactory +import org.apache.activemq.command.ActiveMQTextMessage +import org.apache.activemq.junit.EmbeddedActiveMQBroker +import spock.lang.Shared abstract class JMS1Test extends VersionedNamingTestBase { @Shared @@ -69,9 +69,13 @@ abstract class JMS1Test extends VersionedNamingTestBase { true } + def createConnectionFactory() { + broker.createConnectionFactory() + } + def setupSpec() { broker.start() - final ActiveMQConnectionFactory connectionFactory = broker.createConnectionFactory() + final ConnectionFactory connectionFactory = createConnectionFactory() connection = connectionFactory.createConnection() connection.start() @@ -1097,3 +1101,10 @@ class JMS1V1ForkedTest extends JMS1Test { "jms.process" } } + +class JMS10Test extends JMS1V0Test { + @Override + def createConnectionFactory() { + new Jms10ConnectionFactory(super.createConnectionFactory()) + } +} diff --git a/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/testFixtures/java/jms10mock/Jms10Connection.java b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/testFixtures/java/jms10mock/Jms10Connection.java new file mode 100644 index 00000000000..0f8721a2b89 --- /dev/null +++ b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/testFixtures/java/jms10mock/Jms10Connection.java @@ -0,0 +1,130 @@ +package jms10mock; + +import javax.jms.Connection; +import javax.jms.ConnectionConsumer; +import javax.jms.ConnectionMetaData; +import javax.jms.Destination; +import javax.jms.ExceptionListener; +import javax.jms.JMSException; +import javax.jms.Queue; +import javax.jms.QueueConnection; +import javax.jms.QueueSession; +import javax.jms.ServerSessionPool; +import javax.jms.Session; +import javax.jms.Topic; +import javax.jms.TopicConnection; +import javax.jms.TopicSession; + +/** Wraps a real {@link Connection} but simulates a JMS 1.0 provider. */ +public class Jms10Connection implements QueueConnection, TopicConnection { + private final Connection delegate; + + public Jms10Connection(Connection delegate) { + this.delegate = delegate; + } + + // --- JMS 1.1-only unified Connection method --- + + @Override + public Session createSession(boolean transacted, int acknowledgeMode) throws JMSException { + throw new AbstractMethodError( + "JMS 1.0 provider does not implement createSession(boolean, int) on Connection"); + } + + // --- JMS 1.0 QueueConnection methods --- + + @Override + public QueueSession createQueueSession(boolean transacted, int acknowledgeMode) + throws JMSException { + return new Jms10Session(delegate.createSession(transacted, acknowledgeMode)); + } + + // --- JMS 1.0 TopicConnection methods --- + + @Override + public TopicSession createTopicSession(boolean transacted, int acknowledgeMode) + throws JMSException { + return new Jms10Session(delegate.createSession(transacted, acknowledgeMode)); + } + + // --- Common Connection methods --- + + @Override + public String getClientID() throws JMSException { + return delegate.getClientID(); + } + + @Override + public void setClientID(String clientID) throws JMSException { + delegate.setClientID(clientID); + } + + @Override + public ConnectionMetaData getMetaData() throws JMSException { + return delegate.getMetaData(); + } + + @Override + public ExceptionListener getExceptionListener() throws JMSException { + return delegate.getExceptionListener(); + } + + @Override + public void setExceptionListener(ExceptionListener listener) throws JMSException { + delegate.setExceptionListener(listener); + } + + @Override + public void start() throws JMSException { + delegate.start(); + } + + @Override + public void stop() throws JMSException { + delegate.stop(); + } + + @Override + public void close() throws JMSException { + delegate.close(); + } + + // --- ConnectionConsumer methods — not commonly used, throw for JMS 1.1 unified form --- + + @Override + public ConnectionConsumer createConnectionConsumer( + Destination destination, + String messageSelector, + ServerSessionPool sessionPool, + int maxMessages) + throws JMSException { + throw new AbstractMethodError( + "JMS 1.0 provider does not implement createConnectionConsumer(Destination, ...)"); + } + + @Override + public ConnectionConsumer createConnectionConsumer( + Queue queue, String messageSelector, ServerSessionPool sessionPool, int maxMessages) + throws JMSException { + return delegate.createConnectionConsumer(queue, messageSelector, sessionPool, maxMessages); + } + + @Override + public ConnectionConsumer createConnectionConsumer( + Topic topic, String messageSelector, ServerSessionPool sessionPool, int maxMessages) + throws JMSException { + return delegate.createConnectionConsumer(topic, messageSelector, sessionPool, maxMessages); + } + + @Override + public ConnectionConsumer createDurableConnectionConsumer( + Topic topic, + String subscriptionName, + String messageSelector, + ServerSessionPool sessionPool, + int maxMessages) + throws JMSException { + return delegate.createDurableConnectionConsumer( + topic, subscriptionName, messageSelector, sessionPool, maxMessages); + } +} diff --git a/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/testFixtures/java/jms10mock/Jms10ConnectionFactory.java b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/testFixtures/java/jms10mock/Jms10ConnectionFactory.java new file mode 100644 index 00000000000..1660765f731 --- /dev/null +++ b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/testFixtures/java/jms10mock/Jms10ConnectionFactory.java @@ -0,0 +1,61 @@ +package jms10mock; + +import javax.jms.Connection; +import javax.jms.ConnectionFactory; +import javax.jms.JMSException; +import javax.jms.QueueConnection; +import javax.jms.QueueConnectionFactory; +import javax.jms.TopicConnection; +import javax.jms.TopicConnectionFactory; + +/** + * Wraps a real {@link ConnectionFactory} but simulates a JMS 1.0 provider. + * + *

      In JMS 1.0, clients used the domain-specific {@link QueueConnectionFactory} and {@link + * TopicConnectionFactory} to obtain connections. The unified {@link ConnectionFactory} and its + * {@code createConnection()} methods are JMS 1.1 additions that this wrapper does not support. + */ +public class Jms10ConnectionFactory implements QueueConnectionFactory, TopicConnectionFactory { + private final ConnectionFactory delegate; + + public Jms10ConnectionFactory(ConnectionFactory delegate) { + this.delegate = delegate; + } + + // --- JMS 1.1-only unified ConnectionFactory methods --- + + @Override + public Connection createConnection() throws JMSException { + return delegate.createConnection(); + } + + @Override + public Connection createConnection(String userName, String password) throws JMSException { + return delegate.createConnection(userName, password); + } + + // --- JMS 1.0 QueueConnectionFactory methods --- + @Override + public QueueConnection createQueueConnection() throws JMSException { + return new Jms10Connection(delegate.createConnection()); + } + + @Override + public QueueConnection createQueueConnection(String userName, String password) + throws JMSException { + return new Jms10Connection(delegate.createConnection(userName, password)); + } + + // --- JMS 1.0 TopicConnectionFactory methods --- + + @Override + public TopicConnection createTopicConnection() throws JMSException { + return new Jms10Connection(delegate.createConnection()); + } + + @Override + public TopicConnection createTopicConnection(String userName, String password) + throws JMSException { + return new Jms10Connection(delegate.createConnection(userName, password)); + } +} diff --git a/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/testFixtures/java/jms10mock/Jms10QueueReceiver.java b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/testFixtures/java/jms10mock/Jms10QueueReceiver.java new file mode 100644 index 00000000000..92b8f8ec93b --- /dev/null +++ b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/testFixtures/java/jms10mock/Jms10QueueReceiver.java @@ -0,0 +1,59 @@ +package jms10mock; + +import javax.jms.JMSException; +import javax.jms.Message; +import javax.jms.MessageConsumer; +import javax.jms.MessageListener; +import javax.jms.Queue; +import javax.jms.QueueReceiver; + +/** Wraps a real {@link MessageConsumer} but simulates a JMS 1.0 provider. */ +public class Jms10QueueReceiver implements QueueReceiver { + private final MessageConsumer delegate; + private final Queue queue; + + public Jms10QueueReceiver(MessageConsumer delegate, Queue queue) { + this.delegate = delegate; + this.queue = queue; + } + + @Override + public Queue getQueue() { + return queue; + } + + @Override + public String getMessageSelector() throws JMSException { + return delegate.getMessageSelector(); + } + + @Override + public MessageListener getMessageListener() throws JMSException { + return delegate.getMessageListener(); + } + + @Override + public void setMessageListener(MessageListener listener) throws JMSException { + delegate.setMessageListener(listener); + } + + @Override + public Message receive() throws JMSException { + return delegate.receive(); + } + + @Override + public Message receive(long timeout) throws JMSException { + return delegate.receive(timeout); + } + + @Override + public Message receiveNoWait() throws JMSException { + return delegate.receiveNoWait(); + } + + @Override + public void close() throws JMSException { + delegate.close(); + } +} diff --git a/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/testFixtures/java/jms10mock/Jms10QueueSender.java b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/testFixtures/java/jms10mock/Jms10QueueSender.java new file mode 100644 index 00000000000..1f888203483 --- /dev/null +++ b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/testFixtures/java/jms10mock/Jms10QueueSender.java @@ -0,0 +1,124 @@ +package jms10mock; + +import javax.jms.Destination; +import javax.jms.JMSException; +import javax.jms.Message; +import javax.jms.MessageProducer; +import javax.jms.Queue; +import javax.jms.QueueSender; + +/** Wraps a real {@link MessageProducer} but simulates a JMS 1.0 provider. */ +public class Jms10QueueSender implements QueueSender { + private final MessageProducer delegate; + private final Queue queue; + + public Jms10QueueSender(MessageProducer delegate, Queue queue) { + this.delegate = delegate; + this.queue = queue; + } + + // --- JMS 1.1-only methods — not present in JMS 1.0 --- + + @Override + public Destination getDestination() { + throw new AbstractMethodError("JMS 1.0 provider does not implement getDestination()"); + } + + @Override + public void send(Destination destination, Message message) throws JMSException { + delegate.send(destination, message); + } + + @Override + public void send( + Destination destination, Message message, int deliveryMode, int priority, long timeToLive) + throws JMSException { + delegate.send(destination, message, deliveryMode, priority, timeToLive); + } + + // --- JMS 1.0 QueueSender methods --- + + @Override + public Queue getQueue() { + return queue; + } + + @Override + public void send(Message message) throws JMSException { + delegate.send(message); + } + + @Override + public void send(Message message, int deliveryMode, int priority, long timeToLive) + throws JMSException { + delegate.send(message, deliveryMode, priority, timeToLive); + } + + @Override + public void send(Queue queue, Message message) throws JMSException { + delegate.send(queue, message); + } + + @Override + public void send(Queue queue, Message message, int deliveryMode, int priority, long timeToLive) + throws JMSException { + delegate.send(queue, message, deliveryMode, priority, timeToLive); + } + + // --- MessageProducer config methods --- + + @Override + public void close() throws JMSException { + delegate.close(); + } + + @Override + public void setDisableMessageID(boolean value) throws JMSException { + delegate.setDisableMessageID(value); + } + + @Override + public boolean getDisableMessageID() throws JMSException { + return delegate.getDisableMessageID(); + } + + @Override + public void setDisableMessageTimestamp(boolean value) throws JMSException { + delegate.setDisableMessageTimestamp(value); + } + + @Override + public boolean getDisableMessageTimestamp() throws JMSException { + return delegate.getDisableMessageTimestamp(); + } + + @Override + public void setDeliveryMode(int deliveryMode) throws JMSException { + delegate.setDeliveryMode(deliveryMode); + } + + @Override + public int getDeliveryMode() throws JMSException { + return delegate.getDeliveryMode(); + } + + @Override + public void setPriority(int defaultPriority) throws JMSException { + delegate.setPriority(defaultPriority); + } + + @Override + public int getPriority() throws JMSException { + return delegate.getPriority(); + } + + @Override + public void setTimeToLive(long timeToLive) throws JMSException { + delegate.setTimeToLive(timeToLive); + } + + @Override + public long getTimeToLive() throws JMSException { + return delegate.getTimeToLive(); + } +} diff --git a/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/testFixtures/java/jms10mock/Jms10Session.java b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/testFixtures/java/jms10mock/Jms10Session.java new file mode 100644 index 00000000000..65629319237 --- /dev/null +++ b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/testFixtures/java/jms10mock/Jms10Session.java @@ -0,0 +1,229 @@ +package jms10mock; + +import java.io.Serializable; +import javax.jms.BytesMessage; +import javax.jms.Destination; +import javax.jms.JMSException; +import javax.jms.MapMessage; +import javax.jms.Message; +import javax.jms.MessageConsumer; +import javax.jms.MessageListener; +import javax.jms.MessageProducer; +import javax.jms.ObjectMessage; +import javax.jms.Queue; +import javax.jms.QueueBrowser; +import javax.jms.QueueReceiver; +import javax.jms.QueueSender; +import javax.jms.QueueSession; +import javax.jms.Session; +import javax.jms.StreamMessage; +import javax.jms.TemporaryQueue; +import javax.jms.TemporaryTopic; +import javax.jms.TextMessage; +import javax.jms.Topic; +import javax.jms.TopicPublisher; +import javax.jms.TopicSession; +import javax.jms.TopicSubscriber; + +/** Wraps a real {@link Session} but simulates a JMS 1.0 provider. */ +public class Jms10Session implements QueueSession, TopicSession { + private final Session delegate; + + public Jms10Session(Session delegate) { + this.delegate = delegate; + } + + // --- JMS 1.1-only unified Session methods — not present in JMS 1.0 --- + + @Override + public MessageProducer createProducer(Destination destination) throws JMSException { + return delegate.createProducer(destination); + } + + @Override + public MessageConsumer createConsumer(Destination destination) throws JMSException { + return delegate.createConsumer(destination); + } + + @Override + public MessageConsumer createConsumer(Destination destination, String messageSelector) + throws JMSException { + return delegate.createConsumer(destination, messageSelector); + } + + @Override + public MessageConsumer createConsumer( + Destination destination, String messageSelector, boolean noLocal) throws JMSException { + return delegate.createConsumer(destination, messageSelector, noLocal); + } + + // --- JMS 1.0 QueueSession methods --- + + @Override + public Queue createQueue(String queueName) throws JMSException { + return delegate.createQueue(queueName); + } + + @Override + public QueueReceiver createReceiver(Queue queue) throws JMSException { + return new Jms10QueueReceiver(delegate.createConsumer(queue), queue); + } + + @Override + public QueueReceiver createReceiver(Queue queue, String messageSelector) throws JMSException { + return new Jms10QueueReceiver(delegate.createConsumer(queue, messageSelector), queue); + } + + @Override + public QueueSender createSender(Queue queue) throws JMSException { + return new Jms10QueueSender(delegate.createProducer(queue), queue); + } + + @Override + public QueueBrowser createBrowser(Queue queue) throws JMSException { + return delegate.createBrowser(queue); + } + + @Override + public QueueBrowser createBrowser(Queue queue, String messageSelector) throws JMSException { + return delegate.createBrowser(queue, messageSelector); + } + + @Override + public TemporaryQueue createTemporaryQueue() throws JMSException { + return delegate.createTemporaryQueue(); + } + + // --- JMS 1.0 TopicSession methods --- + + @Override + public Topic createTopic(String topicName) throws JMSException { + return delegate.createTopic(topicName); + } + + @Override + public TopicSubscriber createSubscriber(Topic topic) throws JMSException { + return new Jms10TopicSubscriber(delegate.createConsumer(topic), topic, false); + } + + @Override + public TopicSubscriber createSubscriber(Topic topic, String messageSelector, boolean noLocal) + throws JMSException { + return new Jms10TopicSubscriber( + delegate.createConsumer(topic, messageSelector, noLocal), topic, noLocal); + } + + @Override + public TopicSubscriber createDurableSubscriber(Topic topic, String name) throws JMSException { + return new Jms10TopicSubscriber(delegate.createDurableSubscriber(topic, name), topic, false); + } + + @Override + public TopicSubscriber createDurableSubscriber( + Topic topic, String name, String messageSelector, boolean noLocal) throws JMSException { + return new Jms10TopicSubscriber( + delegate.createDurableSubscriber(topic, name, messageSelector, noLocal), topic, noLocal); + } + + @Override + public TopicPublisher createPublisher(Topic topic) throws JMSException { + return new Jms10TopicPublisher(delegate.createProducer(topic), topic); + } + + @Override + public TemporaryTopic createTemporaryTopic() throws JMSException { + return delegate.createTemporaryTopic(); + } + + @Override + public void unsubscribe(String name) throws JMSException { + delegate.unsubscribe(name); + } + + // --- Common Session methods --- + + @Override + public BytesMessage createBytesMessage() throws JMSException { + return delegate.createBytesMessage(); + } + + @Override + public MapMessage createMapMessage() throws JMSException { + return delegate.createMapMessage(); + } + + @Override + public Message createMessage() throws JMSException { + return delegate.createMessage(); + } + + @Override + public ObjectMessage createObjectMessage() throws JMSException { + return delegate.createObjectMessage(); + } + + @Override + public ObjectMessage createObjectMessage(Serializable object) throws JMSException { + return delegate.createObjectMessage(object); + } + + @Override + public StreamMessage createStreamMessage() throws JMSException { + return delegate.createStreamMessage(); + } + + @Override + public TextMessage createTextMessage() throws JMSException { + return delegate.createTextMessage(); + } + + @Override + public TextMessage createTextMessage(String text) throws JMSException { + return delegate.createTextMessage(text); + } + + @Override + public boolean getTransacted() throws JMSException { + return delegate.getTransacted(); + } + + @Override + public int getAcknowledgeMode() { + throw new AbstractMethodError("JMS 1.0 provider does not implement getAcknowledgeMode()"); + } + + @Override + public void commit() throws JMSException { + delegate.commit(); + } + + @Override + public void rollback() throws JMSException { + delegate.rollback(); + } + + @Override + public void close() throws JMSException { + delegate.close(); + } + + @Override + public void recover() throws JMSException { + delegate.recover(); + } + + @Override + public MessageListener getMessageListener() throws JMSException { + return delegate.getMessageListener(); + } + + @Override + public void setMessageListener(MessageListener listener) throws JMSException { + delegate.setMessageListener(listener); + } + + @Override + public void run() { + delegate.run(); + } +} diff --git a/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/testFixtures/java/jms10mock/Jms10TopicPublisher.java b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/testFixtures/java/jms10mock/Jms10TopicPublisher.java new file mode 100644 index 00000000000..6f3c1e38663 --- /dev/null +++ b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/testFixtures/java/jms10mock/Jms10TopicPublisher.java @@ -0,0 +1,137 @@ +package jms10mock; + +import javax.jms.Destination; +import javax.jms.JMSException; +import javax.jms.Message; +import javax.jms.MessageProducer; +import javax.jms.Topic; +import javax.jms.TopicPublisher; + +/** Wraps a real {@link MessageProducer} but simulates a JMS 1.0 provider. */ +public class Jms10TopicPublisher implements TopicPublisher { + private final MessageProducer delegate; + private final Topic topic; + + public Jms10TopicPublisher(MessageProducer delegate, Topic topic) { + this.delegate = delegate; + this.topic = topic; + } + + // --- JMS 1.1-only methods — not present in JMS 1.0 --- + + @Override + public Destination getDestination() { + throw new AbstractMethodError("JMS 1.0 provider does not implement getDestination()"); + } + + @Override + public void send(Destination destination, Message message) throws JMSException { + delegate.send(destination, message); + } + + @Override + public void send( + Destination destination, Message message, int deliveryMode, int priority, long timeToLive) + throws JMSException { + delegate.send(destination, message, deliveryMode, priority, timeToLive); + } + + // --- JMS 1.0 TopicPublisher methods --- + + @Override + public Topic getTopic() { + return topic; + } + + @Override + public void publish(Message message) throws JMSException { + delegate.send(message); + } + + @Override + public void publish(Message message, int deliveryMode, int priority, long timeToLive) + throws JMSException { + delegate.send(message, deliveryMode, priority, timeToLive); + } + + @Override + public void publish(Topic topic, Message message) throws JMSException { + delegate.send(topic, message); + } + + @Override + public void publish(Topic topic, Message message, int deliveryMode, int priority, long timeToLive) + throws JMSException { + delegate.send(topic, message, deliveryMode, priority, timeToLive); + } + + // --- MessageProducer send methods (also available via publish in 1.0) --- + + @Override + public void send(Message message) throws JMSException { + delegate.send(message); + } + + @Override + public void send(Message message, int deliveryMode, int priority, long timeToLive) + throws JMSException { + delegate.send(message, deliveryMode, priority, timeToLive); + } + + // --- MessageProducer config methods --- + + @Override + public void close() throws JMSException { + delegate.close(); + } + + @Override + public void setDisableMessageID(boolean value) throws JMSException { + delegate.setDisableMessageID(value); + } + + @Override + public boolean getDisableMessageID() throws JMSException { + return delegate.getDisableMessageID(); + } + + @Override + public void setDisableMessageTimestamp(boolean value) throws JMSException { + delegate.setDisableMessageTimestamp(value); + } + + @Override + public boolean getDisableMessageTimestamp() throws JMSException { + return delegate.getDisableMessageTimestamp(); + } + + @Override + public void setDeliveryMode(int deliveryMode) throws JMSException { + delegate.setDeliveryMode(deliveryMode); + } + + @Override + public int getDeliveryMode() throws JMSException { + return delegate.getDeliveryMode(); + } + + @Override + public void setPriority(int defaultPriority) throws JMSException { + delegate.setPriority(defaultPriority); + } + + @Override + public int getPriority() throws JMSException { + return delegate.getPriority(); + } + + @Override + public void setTimeToLive(long timeToLive) throws JMSException { + delegate.setTimeToLive(timeToLive); + } + + @Override + public long getTimeToLive() throws JMSException { + return delegate.getTimeToLive(); + } +} diff --git a/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/testFixtures/java/jms10mock/Jms10TopicSubscriber.java b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/testFixtures/java/jms10mock/Jms10TopicSubscriber.java new file mode 100644 index 00000000000..97ca5ea2343 --- /dev/null +++ b/dd-java-agent/instrumentation/jms/javax-jms-1.1/src/testFixtures/java/jms10mock/Jms10TopicSubscriber.java @@ -0,0 +1,66 @@ +package jms10mock; + +import javax.jms.JMSException; +import javax.jms.Message; +import javax.jms.MessageConsumer; +import javax.jms.MessageListener; +import javax.jms.Topic; +import javax.jms.TopicSubscriber; + +/** Wraps a real {@link MessageConsumer} but simulates a JMS 1.0 provider. */ +public class Jms10TopicSubscriber implements TopicSubscriber { + private final MessageConsumer delegate; + private final Topic topic; + private final boolean noLocal; + + public Jms10TopicSubscriber(MessageConsumer delegate, Topic topic, boolean noLocal) { + this.delegate = delegate; + this.topic = topic; + this.noLocal = noLocal; + } + + @Override + public Topic getTopic() { + return topic; + } + + @Override + public boolean getNoLocal() { + return noLocal; + } + + @Override + public String getMessageSelector() throws JMSException { + return delegate.getMessageSelector(); + } + + @Override + public MessageListener getMessageListener() throws JMSException { + return delegate.getMessageListener(); + } + + @Override + public void setMessageListener(MessageListener listener) throws JMSException { + delegate.setMessageListener(listener); + } + + @Override + public Message receive() throws JMSException { + return delegate.receive(); + } + + @Override + public Message receive(long timeout) throws JMSException { + return delegate.receive(timeout); + } + + @Override + public Message receiveNoWait() throws JMSException { + return delegate.receiveNoWait(); + } + + @Override + public void close() throws JMSException { + delegate.close(); + } +} diff --git a/dd-java-agent/instrumentation/jose-jwt-4.0/gradle.lockfile b/dd-java-agent/instrumentation/jose-jwt-4.0/gradle.lockfile index b544a0ab22e..3ef13965d0f 100644 --- a/dd-java-agent/instrumentation/jose-jwt-4.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/jose-jwt-4.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jose-jwt-4.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -9,7 +10,7 @@ com.auth0:java-jwt:4.0.0-beta.0=latestDepTestCompileClasspath,latestDepTestRunti com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -18,15 +19,15 @@ com.fasterxml.jackson.core:jackson-core:2.13.2=latestDepTestRuntimeClasspath,tes com.fasterxml.jackson.core:jackson-databind:2.13.2.2=latestDepTestRuntimeClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -36,12 +37,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.nimbusds:nimbus-jose-jwt:9.24.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -53,12 +57,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,6 +91,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -104,14 +109,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/jsp-2.3/gradle.lockfile b/dd-java-agent/instrumentation/jsp-2.3/gradle.lockfile index f1d91119265..269cfcc640a 100644 --- a/dd-java-agent/instrumentation/jsp-2.3/gradle.lockfile +++ b/dd-java-agent/instrumentation/jsp-2.3/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:jsp-2.3:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,15 +51,15 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet.jsp:javax.servlet.jsp-api:2.3.0=compileClasspath javax.servlet.jsp:javax.servlet.jsp-api:2.3.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=compileClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:4.0.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -67,13 +71,13 @@ org.apache.commons:commons-text:1.14.0=spotbugs org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apache.tomcat.embed:tomcat-embed-core:7.0.37=testCompileClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-core:9.0.117=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-el:9.0.117=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.tomcat.embed:tomcat-embed-core:9.0.120=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.tomcat.embed:tomcat-embed-el:9.0.120=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.tomcat.embed:tomcat-embed-jasper:7.0.37=testCompileClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-jasper:9.0.117=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.tomcat.embed:tomcat-embed-jasper:9.0.120=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.tomcat.embed:tomcat-embed-logging-juli:7.0.37=testCompileClasspath,testRuntimeClasspath org.apache.tomcat.embed:tomcat-embed-logging-juli:9.0.0.M6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.apache.tomcat:tomcat-annotations-api:9.0.117=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.tomcat:tomcat-annotations-api:9.0.120=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.tomcat:tomcat-api:7.0.20=compileClasspath org.apache.tomcat:tomcat-el-api:7.0.20=compileClasspath org.apache.tomcat:tomcat-jasper-el:7.0.20=compileClasspath @@ -103,6 +107,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -120,14 +125,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/junit/junit-4/junit-4-cucumber-5.4/gradle.lockfile b/dd-java-agent/instrumentation/junit/junit-4/junit-4-cucumber-5.4/gradle.lockfile index d6576313ec6..ac0180f6343 100644 --- a/dd-java-agent/instrumentation/junit/junit-4/junit-4-cucumber-5.4/gradle.lockfile +++ b/dd-java-agent/instrumentation/junit/junit-4/junit-4-cucumber-5.4/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:junit:junit-4:junit-4-cucumber-5.4:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.fasterxml.jackson.core:jackson-core:2.20.0=latestDepTestCompileClasspath,lat com.fasterxml.jackson.core:jackson-databind:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.jayway.jsonpath:json-path:2.8.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -54,28 +58,28 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.cucumber:ci-environment:12.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:cucumber-core:5.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.cucumber:cucumber-core:7.34.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:cucumber-core:7.34.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:cucumber-expressions:18.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:cucumber-expressions:8.3.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.cucumber:cucumber-gherkin-messages:7.34.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:cucumber-gherkin-messages:7.34.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:cucumber-gherkin-vintage:5.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath io.cucumber:cucumber-gherkin:5.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.cucumber:cucumber-gherkin:7.34.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:cucumber-gherkin:7.34.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:cucumber-java:5.4.0=testCompileClasspath,testRuntimeClasspath -io.cucumber:cucumber-java:7.34.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:cucumber-java:7.34.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:cucumber-json-formatter:0.3.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:cucumber-junit:5.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.cucumber:cucumber-junit:7.34.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:cucumber-junit:7.34.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:cucumber-plugin:5.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.cucumber:cucumber-plugin:7.34.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:cucumber-plugin:7.34.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:datatable:3.3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.cucumber:datatable:7.34.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:datatable:7.34.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:docstring:5.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.cucumber:docstring:7.34.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:docstring:7.34.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:gherkin:36.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:html-formatter:22.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:junit-xml-formatter:0.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.cucumber:messages-ndjson:0.3.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:messages-ndjson:0.3.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:messages:30.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:pretty-formatter:2.4.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:query:14.7.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -85,13 +89,13 @@ io.cucumber:teamcity-formatter:0.2.0=latestDepTestCompileClasspath,latestDepTest io.cucumber:testng-xml-formatter:0.7.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:usage-formatter:0.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13=compileClasspath junit:junit:4.13.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.minidev:accessors-smart:2.4.9=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -122,10 +126,11 @@ org.freemarker:freemarker:2.3.31=latestDepTestCompileClasspath,latestDepTestRunt org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.core:0.8.14=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.report:0.8.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.core:0.8.15=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.report:0.8.15=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -145,14 +150,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.skyscreamer:jsonassert:1.5.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/junit/junit-4/junit-4-munit-0.7.28/gradle.lockfile b/dd-java-agent/instrumentation/junit/junit-4/junit-4-munit-0.7.28/gradle.lockfile index ecb795b3a89..4401d2dab37 100644 --- a/dd-java-agent/instrumentation/junit/junit-4/junit-4-munit-0.7.28/gradle.lockfile +++ b/dd-java-agent/instrumentation/junit/junit-4/junit-4-munit-0.7.28/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:junit:junit-4:junit-4-munit-0.7.28:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -21,15 +22,15 @@ com.fasterxml.jackson.core:jackson-core:2.20.0=latestDepTestCompileClasspath,lat com.fasterxml.jackson.core:jackson-databind:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -39,12 +40,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.jayway.jsonpath:json-path:2.8.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -58,16 +62,15 @@ commons-fileupload:commons-fileupload:1.5=latestDepTestCompileClasspath,latestDe commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.minidev:accessors-smart:2.4.9=latestDepTestRuntimeClasspath,testRuntimeClasspath net.minidev:json-smart:2.4.10=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -96,18 +99,19 @@ org.codehaus.groovy:groovy:3.0.25=latestDepTestCompileClasspath,latestDepTestRun org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.freemarker:freemarker:2.3.31=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.core:0.8.14=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.report:0.8.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.core:0.8.15=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.report:0.8.15=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -127,50 +131,51 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.portable-scala:portable-scala-reflect_2.13:1.1.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=zinc org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.13.10=testCompileClasspath,testRuntimeClasspath -org.scala-lang:scala-library:2.13.15=zinc +org.scala-lang:scala-library:2.13.16=zinc org.scala-lang:scala-library:2.13.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.scala-lang:scala-library:2.13.6=compileClasspath -org.scala-lang:scala-reflect:2.13.15=zinc -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-lang:scala-reflect:2.13.16=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc org.scala-sbt:test-interface:1.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.scalameta:junit-interface:0.7.28=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.scalameta:junit-interface:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.scalameta:munit-diff_2.13:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.scalameta:junit-interface:1.3.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.scalameta:munit-diff_2.13:1.3.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.scalameta:munit_2.13:0.7.28=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.scalameta:munit_2.13:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.scalameta:munit_2.13:1.3.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.skyscreamer:jsonassert:1.5.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/junit/junit-4/junit-4.10/gradle.lockfile b/dd-java-agent/instrumentation/junit/junit-4/junit-4.10/gradle.lockfile index e736ca76987..6f1fdbf1729 100644 --- a/dd-java-agent/instrumentation/junit/junit-4/junit-4.10/gradle.lockfile +++ b/dd-java-agent/instrumentation/junit/junit-4/junit-4.10/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:junit:junit-4:junit-4.10:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestIm com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.fasterxml.jackson.core:jackson-core:2.20.0=latestDepTestCompileClasspath,lat com.fasterxml.jackson.core:jackson-databind:2.20.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.20.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,compileOnlyDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,compileOnlyDependenciesMetadata,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,compileOnlyDependenciesMetadata,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestCompileOnlyDependenciesMetadata,testAnnotationProcessor,testCompileClasspath,testCompileOnlyDependenciesMetadata @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,compi com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.jayway.jsonpath:json-path:2.8.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath @@ -53,13 +57,13 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestImplemen commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,compileOnlyDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.10=compileClasspath,compileOnlyDependenciesMetadata junit:junit:4.13.2=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.minidev:accessors-smart:2.4.9=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -90,31 +94,30 @@ org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.1=compileClasspath,compileOnlyDependenciesMetadata org.hamcrest:hamcrest-core:1.3=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.jacoco:org.jacoco.core:0.8.14=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.report:0.8.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.core:0.8.15=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.report:0.8.15=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-build-common:2.0.21=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-build-tools-api:2.0.21=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-build-tools-impl:2.0.21=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-compiler-embeddable:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-compiler-runner:2.0.21=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-daemon-client:2.0.21=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-daemon-embeddable:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:2.0.21=kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-native-prebuilt:2.0.21=kotlinNativeBundleConfiguration +org.jetbrains.kotlin:kotlin-build-tools-api:2.1.20=kotlinBuildToolsApiClasspath +org.jetbrains.kotlin:kotlin-build-tools-impl:2.1.20=kotlinBuildToolsApiClasspath +org.jetbrains.kotlin:kotlin-compiler-embeddable:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath +org.jetbrains.kotlin:kotlin-compiler-runner:2.1.20=kotlinBuildToolsApiClasspath +org.jetbrains.kotlin:kotlin-daemon-client:2.1.20=kotlinBuildToolsApiClasspath +org.jetbrains.kotlin:kotlin-daemon-embeddable:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath +org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:2.1.20=kotlinKlibCommonizerClasspath org.jetbrains.kotlin:kotlin-reflect:1.6.10=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-script-runtime:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-scripting-common:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest -org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest -org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest -org.jetbrains.kotlin:kotlin-scripting-jvm:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest +org.jetbrains.kotlin:kotlin-script-runtime:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath +org.jetbrains.kotlin:kotlin-scripting-common:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest +org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest +org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest +org.jetbrains.kotlin:kotlin-scripting-jvm:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21=compileClasspath,compileOnlyDependenciesMetadata org.jetbrains.kotlin:kotlin-stdlib:1.6.21=compileClasspath,compileOnlyDependenciesMetadata -org.jetbrains.kotlin:kotlin-stdlib:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,latestDepTestApiDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath +org.jetbrains.kotlin:kotlin-stdlib:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,latestDepTestApiDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.8.0=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath org.jetbrains:annotations:13.0=compileClasspath,compileOnlyDependenciesMetadata,kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath @@ -134,14 +137,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestImplement org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.skyscreamer:jsonassert:1.5.1=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/junit/junit-4/junit-4.10/src/main/java/datadog/trace/instrumentation/junit4/JUnit4TracingListener.java b/dd-java-agent/instrumentation/junit/junit-4/junit-4.10/src/main/java/datadog/trace/instrumentation/junit4/JUnit4TracingListener.java index fd6954d007b..afa43e45493 100644 --- a/dd-java-agent/instrumentation/junit/junit-4/junit-4.10/src/main/java/datadog/trace/instrumentation/junit4/JUnit4TracingListener.java +++ b/dd-java-agent/instrumentation/junit/junit-4/junit-4.10/src/main/java/datadog/trace/instrumentation/junit4/JUnit4TracingListener.java @@ -8,11 +8,8 @@ import datadog.trace.bootstrap.ContextStore; import java.lang.reflect.Method; import java.util.List; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; import org.junit.Ignore; import org.junit.runner.Description; -import org.junit.runner.Result; import org.junit.runner.notification.Failure; public class JUnit4TracingListener extends TracingListener { @@ -22,26 +19,6 @@ public class JUnit4TracingListener extends TracingListener { private final ContextStore executionTrackers; - /** - * Suites for which {@code onTestSuiteStart} has been fired (from either the normal - * ParentRunner-based flow or via lazy-registration in {@link #testStarted}). Used to keep - * lifecycle events idempotent and to know which auto-started suite still needs closing. - */ - private final Set startedSuites = ConcurrentHashMap.newKeySet(); - - /** - * Last suite lazy-started from {@link #testStarted} because no {@link #testSuiteStarted} event - * was observed for it first. This has been seen under {@code - * com.google.testing.junit.runner.BazelTestRunner}, where the suite-start advice in {@code - * JUnit4SuiteEventsInstrumentation} does not fire for reasons still to be pinpointed (likely a - * classloader or runner-wrapping quirk specific to the Bazel test launcher). Closed when the next - * test belongs to a different suite, or when the whole test run finishes. - * - *

      TODO: investigate the exact cause under {@code BazelTestRunner} and add a dedicated - * instrumentation that emits proper suite-lifecycle events instead of relying on this fallback. - */ - private volatile TestSuiteDescriptor autoStartedSuite; - public JUnit4TracingListener(ContextStore executionTrackers) { this.executionTrackers = executionTrackers; } @@ -55,9 +32,6 @@ public void testSuiteStarted(final Description description) { } TestSuiteDescriptor suiteDescriptor = JUnit4Utils.toSuiteDescriptor(description); - if (!startedSuites.add(suiteDescriptor)) { - return; // already started (idempotent vs. lazy-registration or duplicate events) - } Class testClass = description.getTestClass(); String testSuiteName = JUnit4Utils.getSuiteName(testClass, description); List categories = JUnit4Utils.getCategories(testClass, null); @@ -84,9 +58,6 @@ public void testSuiteFinished(final Description description) { } TestSuiteDescriptor suiteDescriptor = JUnit4Utils.toSuiteDescriptor(description); - if (!startedSuites.remove(suiteDescriptor)) { - return; // never started - } TestEventsHandlerHolder.HANDLERS .get(TestFrameworkInstrumentation.JUNIT4) .onTestSuiteFinish(suiteDescriptor, null); @@ -102,8 +73,6 @@ public void testStarted(final Description description) { TestDescriptor testDescriptor = JUnit4Utils.toTestDescriptor(description); TestSourceData testSourceData = JUnit4Utils.toTestSourceData(description); - lazyStartSuiteIfNeeded(suiteDescriptor, description, testSourceData); - String testName = JUnit4Utils.getTestName(description, testSourceData.getTestMethod()); String testParameters = JUnit4Utils.getParameters(description); List categories = @@ -124,50 +93,6 @@ public void testStarted(final Description description) { executionTrackers.get(description)); } - @Override - public void testRunFinished(Result result) { - closeAutoStartedSuite(); - } - - private void lazyStartSuiteIfNeeded( - TestSuiteDescriptor newSuite, Description description, TestSourceData testSourceData) { - if (startedSuites.contains(newSuite)) { - return; - } - closeAutoStartedSuite(); - - Class testClass = testSourceData.getTestClass(); - String testSuiteName = JUnit4Utils.getSuiteName(testClass, description); - List categories = JUnit4Utils.getCategories(testClass, null); - TestEventsHandlerHolder.HANDLERS - .get(TestFrameworkInstrumentation.JUNIT4) - .onTestSuiteStart( - newSuite, - testSuiteName, - FRAMEWORK_NAME, - FRAMEWORK_VERSION, - testClass, - categories, - false, - TestFrameworkInstrumentation.JUNIT4, - null); - startedSuites.add(newSuite); - autoStartedSuite = newSuite; - } - - private void closeAutoStartedSuite() { - TestSuiteDescriptor suite = autoStartedSuite; - if (suite == null) { - return; - } - autoStartedSuite = null; - if (startedSuites.remove(suite)) { - TestEventsHandlerHolder.HANDLERS - .get(TestFrameworkInstrumentation.JUNIT4) - .onTestSuiteFinish(suite, null); - } - } - @Override public void testFinished(final Description description) { if (JUnit4Utils.isJUnitPlatformRunnerTest(description)) { diff --git a/dd-java-agent/instrumentation/junit/junit-4/junit-4.10/src/main/java/datadog/trace/instrumentation/junit4/JUnit4Utils.java b/dd-java-agent/instrumentation/junit/junit-4/junit-4.10/src/main/java/datadog/trace/instrumentation/junit4/JUnit4Utils.java index 697c38d56e2..ca6f383c2cf 100644 --- a/dd-java-agent/instrumentation/junit/junit-4/junit-4.10/src/main/java/datadog/trace/instrumentation/junit4/JUnit4Utils.java +++ b/dd-java-agent/instrumentation/junit/junit-4/junit-4.10/src/main/java/datadog/trace/instrumentation/junit4/JUnit4Utils.java @@ -41,15 +41,6 @@ public abstract class JUnit4Utils { private static final String SYNCHRONIZED_LISTENER = "org.junit.runner.notification.SynchronizedRunListener"; - - /** - * Bazel's test launcher wraps the {@link RunNotifier} that our instrumentation advice receives. - * {@link RunNotifier#addListener} on the wrapper forwards to its inner delegate, but {@link - * org.junit.runner.notification.RunNotifier#listeners} on the wrapper is a separate (empty) - * field. Without unwrapping, our idempotency check fails to see a listener installed via a prior - * advice call on the inner notifier, and we end up adding a second tracing listener that the - * wrapper also forwards to the delegate. - */ private static final String BAZEL_RUN_NOTIFIER_WRAPPER = "com.google.testing.junit.junit4.runner.RunNotifierWrapper"; @@ -117,13 +108,14 @@ public static List runListenersFromRunNotifier(final RunNotifier ru } /** - * Walks through {@link RunNotifier} wrappers (e.g. Bazel's {@code RunNotifierWrapper}) so the - * effective {@code listeners} field is read, not the wrapper's own (forwarded) one. + * Walks through {@link RunNotifier} wrappers (e.g. Bazel's {@code RunNotifierWrapper}) and + * returns the inner notifier whose {@code listeners} field actually receives {@code addListener} + * calls. Returns the input untouched when it is not a known wrapper. */ - private static RunNotifier unwrapRunNotifier(RunNotifier notifier) { + public static RunNotifier unwrapRunNotifier(RunNotifier notifier) { RunNotifier current = notifier; for (int i = 0; i < 8 && current != null; i++) { - if (!isBazelRunNotifierWrapper(current.getClass())) { + if (!isBazelRunNotifierWrapper(current)) { return current; } RunNotifier delegate = METHOD_HANDLES.invoke(BAZEL_RUN_NOTIFIER_WRAPPER_DELEGATE, current); @@ -135,7 +127,8 @@ private static RunNotifier unwrapRunNotifier(RunNotifier notifier) { return current; } - private static boolean isBazelRunNotifierWrapper(Class cls) { + private static boolean isBazelRunNotifierWrapper(RunNotifier notifier) { + Class cls = notifier.getClass(); while (cls != null && cls != Object.class) { if (BAZEL_RUN_NOTIFIER_WRAPPER.equals(cls.getName())) { return true; diff --git a/dd-java-agent/instrumentation/junit/junit-4/junit-4.10/src/test/java/org/example/TestFailedThenSucceed.java b/dd-java-agent/instrumentation/junit/junit-4/junit-4.10/src/test/java/org/example/TestFailedThenSucceed.java index 7c46ae4042e..94220ba0bd5 100644 --- a/dd-java-agent/instrumentation/junit/junit-4/junit-4.10/src/test/java/org/example/TestFailedThenSucceed.java +++ b/dd-java-agent/instrumentation/junit/junit-4/junit-4.10/src/test/java/org/example/TestFailedThenSucceed.java @@ -2,7 +2,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; import org.junit.After; @@ -17,7 +17,7 @@ public class TestFailedThenSucceed { public void setUp() { AgentTracer.TracerAPI agentTracer = AgentTracer.get(); AgentSpan span = agentTracer.buildSpan("junit-manual", "set-up").start(); - try (AgentScope scope = agentTracer.activateManualSpan(span)) { + try (ContextScope scope = agentTracer.activateManualSpan(span)) { // tracing setup to verify that it is executed for every retry } span.finish(); @@ -32,7 +32,7 @@ public void test_failed_then_succeed() { public void tearDown() { AgentTracer.TracerAPI agentTracer = AgentTracer.get(); AgentSpan span = agentTracer.buildSpan("junit-manual", "tear-down").start(); - try (AgentScope scope = agentTracer.activateManualSpan(span)) { + try (ContextScope scope = agentTracer.activateManualSpan(span)) { // tracing teardown to verify that it is executed for every retry } span.finish(); diff --git a/dd-java-agent/instrumentation/junit/junit-4/junit-4.13/gradle.lockfile b/dd-java-agent/instrumentation/junit/junit-4/junit-4.13/gradle.lockfile index 13e38e0b600..b9fd99e75bf 100644 --- a/dd-java-agent/instrumentation/junit/junit-4/junit-4.13/gradle.lockfile +++ b/dd-java-agent/instrumentation/junit/junit-4/junit-4.13/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:junit:junit-4:junit-4.13:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.fasterxml.jackson.core:jackson-core:2.20.0=latestDepTestCompileClasspath,lat com.fasterxml.jackson.core:jackson-databind:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.jayway.jsonpath:json-path:2.8.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -53,13 +57,13 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13=compileClasspath junit:junit:4.13.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.minidev:accessors-smart:2.4.9=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -89,10 +93,11 @@ org.freemarker:freemarker:2.3.31=latestDepTestCompileClasspath,latestDepTestRunt org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.core:0.8.14=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.report:0.8.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.core:0.8.15=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.report:0.8.15=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -112,14 +117,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.skyscreamer:jsonassert:1.5.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/junit/junit-4/junit-4.13/src/main/java/datadog/trace/instrumentation/junit4/BazelRunNotifierWrapperInstrumentation.java b/dd-java-agent/instrumentation/junit/junit-4/junit-4.13/src/main/java/datadog/trace/instrumentation/junit4/BazelRunNotifierWrapperInstrumentation.java new file mode 100644 index 00000000000..782e6e1ebf8 --- /dev/null +++ b/dd-java-agent/instrumentation/junit/junit-4/junit-4.13/src/main/java/datadog/trace/instrumentation/junit4/BazelRunNotifierWrapperInstrumentation.java @@ -0,0 +1,114 @@ +package datadog.trace.instrumentation.junit4; + +import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static net.bytebuddy.matcher.ElementMatchers.takesArgument; + +import com.google.auto.service.AutoService; +import datadog.trace.agent.tooling.Instrumenter; +import datadog.trace.agent.tooling.InstrumenterModule; +import java.util.List; +import net.bytebuddy.asm.Advice; +import org.junit.runner.Description; +import org.junit.runner.notification.RunListener; +import org.junit.runner.notification.RunNotifier; + +/** + * Restores suite lifecycle events when JUnit 4.13+ tests run under Bazel's {@code + * com.google.testing.junit.runner.BazelTestRunner}. + * + *

      Bazel's {@code com.google.testing.junit.junit4.runner.RunNotifierWrapper} explicitly delegates + * {@code addListener}, {@code fireTestStarted}, etc. to the inner notifier, but does not override + * {@link RunNotifier#fireTestSuiteStarted(Description)} and {@link + * RunNotifier#fireTestSuiteFinished(Description)}. The runner therefore fires the suite-lifecycle + * events on the wrapper's own (always empty) listener list, and our tracing listener — installed on + * the inner notifier via the wrapper's delegating {@code addListener} — never sees them. + * + *

      This advice intercepts {@link RunNotifier#fireTestSuiteStarted(Description)} and {@link + * RunNotifier#fireTestSuiteFinished(Description)} on the wrapper instance, looks up our tracing + * listener inside the inner notifier's listener list, and invokes it directly. Other listeners + * installed on the inner notifier are intentionally skipped so Bazel's default dispatch behavior is + * unchanged. Calls on a non-wrapper notifier are a no-op. + */ +@AutoService(InstrumenterModule.class) +public class BazelRunNotifierWrapperInstrumentation extends InstrumenterModule.CiVisibility + implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { + + public BazelRunNotifierWrapperInstrumentation() { + super("ci-visibility", "junit-4"); + } + + @Override + public String instrumentedType() { + return "org.junit.runner.notification.RunNotifier"; + } + + @Override + public String[] helperClassNames() { + return new String[] { + packageName + ".JUnit4Utils", + packageName + ".TracingListener", + packageName + ".SkippedByDatadog", + }; + } + + @Override + public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvice( + named("fireTestSuiteStarted").and(takesArgument(0, named("org.junit.runner.Description"))), + BazelRunNotifierWrapperInstrumentation.class.getName() + "$FireSuiteStartedAdvice"); + transformer.applyAdvice( + named("fireTestSuiteFinished").and(takesArgument(0, named("org.junit.runner.Description"))), + BazelRunNotifierWrapperInstrumentation.class.getName() + "$FireSuiteFinishedAdvice"); + } + + public static class FireSuiteStartedAdvice { + @Advice.OnMethodEnter(suppress = Throwable.class) + public static void fireOnTracingListener( + @Advice.This final RunNotifier self, @Advice.Argument(0) final Description description) { + RunNotifier inner = JUnit4Utils.unwrapRunNotifier(self); + if (inner == null || inner == self) { + return; + } + List listeners = JUnit4Utils.runListenersFromRunNotifier(inner); + if (listeners == null) { + return; + } + for (RunListener listener : listeners) { + TracingListener tracingListener = JUnit4Utils.toTracingListener(listener); + if (tracingListener != null) { + tracingListener.testSuiteStarted(description); + } + } + } + + // JUnit 4.13 muzzle marker: fireTestSuiteStarted exists from 4.13. + public static void muzzleCheck(final RunNotifier notifier) { + notifier.fireTestSuiteStarted(null); + } + } + + public static class FireSuiteFinishedAdvice { + @Advice.OnMethodEnter(suppress = Throwable.class) + public static void fireOnTracingListener( + @Advice.This final RunNotifier self, @Advice.Argument(0) final Description description) { + RunNotifier inner = JUnit4Utils.unwrapRunNotifier(self); + if (inner == null || inner == self) { + return; + } + List listeners = JUnit4Utils.runListenersFromRunNotifier(inner); + if (listeners == null) { + return; + } + for (RunListener listener : listeners) { + TracingListener tracingListener = JUnit4Utils.toTracingListener(listener); + if (tracingListener != null) { + tracingListener.testSuiteFinished(description); + } + } + } + + public static void muzzleCheck(final RunNotifier notifier) { + notifier.fireTestSuiteFinished(null); + } + } +} diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/build.gradle b/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/build.gradle index a6245277f19..b274e69ff26 100644 --- a/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/build.gradle +++ b/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/build.gradle @@ -13,6 +13,8 @@ muzzle { } } +addTestSuiteForDir('cucumber723Test', 'test') +addTestSuiteForDir('cucumber76Test', 'test') addTestSuiteForDir('latestDepTest', 'test') dependencies { @@ -33,9 +35,15 @@ dependencies { latestDepTestImplementation group: 'io.cucumber', name: 'cucumber-java', version: '+' latestDepTestImplementation group: 'io.cucumber', name: 'cucumber-junit-platform-engine', version: '+' + + cucumber76TestImplementation group: 'io.cucumber', name: 'cucumber-java', version: '7.6.0' + cucumber76TestImplementation group: 'io.cucumber', name: 'cucumber-junit-platform-engine', version: '7.6.0' + + cucumber723TestImplementation group: 'io.cucumber', name: 'cucumber-java', version: '7.23.0' + cucumber723TestImplementation group: 'io.cucumber', name: 'cucumber-junit-platform-engine', version: '7.23.0' } -configurations.matching({ it.name.startsWith('test') }).configureEach({ +configurations.matching({ it.name.startsWith('test') || it.name.startsWith('cucumber') }).configureEach({ it.resolutionStrategy { force group: 'org.junit.platform', name: 'junit-platform-launcher', version: libs.versions.junit.platform.get() force group: 'org.junit.platform', name: 'junit-platform-suite', version: libs.versions.junit.platform.get() diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/gradle.lockfile b/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/gradle.lockfile index 38b12a1e34a..0250f3b28ca 100644 --- a/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/gradle.lockfile +++ b/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/gradle.lockfile @@ -1,100 +1,135 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. -cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath -cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath -ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.20=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:junit:junit-5:junit-5-cucumber-5.4:dependencies --write-locks +cafe.cryptography:curve25519-elisabeth:0.1.0=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +cafe.cryptography:ed25519-elisabeth:0.1.0=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +ch.qos.logback:logback-classic:1.2.13=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq.okhttp3:okhttp:3.12.15=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq.okio:okio:1.17.6=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:java-dogstatsd-client:4.4.5=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.datadoghq:sketches-java:0.8.3=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.fasterxml.jackson.core:jackson-annotations:2.20=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.fasterxml.jackson.core:jackson-core:2.20.0=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.fasterxml.jackson.core:jackson-databind:2.20.0=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.fasterxml.jackson:jackson-bom:2.20.0=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-a64asm:1.0.0=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-constants:0.10.4=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-x86asm:1.0.2=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs -com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath -com.google.auto.service:auto-service:1.1.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.auto:auto-common:1.2.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,cucumber723TestAnnotationProcessor,cucumber723TestCompileClasspath,cucumber76TestAnnotationProcessor,cucumber76TestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath +com.google.auto.service:auto-service:1.1.1=annotationProcessor,cucumber723TestAnnotationProcessor,cucumber76TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.auto:auto-common:1.2.1=annotationProcessor,cucumber723TestAnnotationProcessor,cucumber76TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,cucumber723TestAnnotationProcessor,cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestAnnotationProcessor,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs -com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,cucumber723TestAnnotationProcessor,cucumber76TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.jayway.jsonpath:json-path:2.8.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.squareup.okio:okio:1.17.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.1=annotationProcessor,cucumber723TestAnnotationProcessor,cucumber76TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.3=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:32.0.1-jre=annotationProcessor,cucumber723TestAnnotationProcessor,cucumber76TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,cucumber723TestAnnotationProcessor,cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestAnnotationProcessor,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,cucumber723TestAnnotationProcessor,cucumber76TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:3.1=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.jayway.jsonpath:json-path:2.8.0=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.moshi:moshi:1.11.0=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:logging-interceptor:3.12.12=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:okhttp:3.12.12=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.okio:okio:1.17.5=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc -com.vaadin.external.google:android-json:0.0.20131108.vaadin1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -commons-fileupload:commons-fileupload:1.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.vaadin.external.google:android-json:0.0.20131108.vaadin1=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +commons-fileupload:commons-fileupload:1.5=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +commons-io:commons-io:2.11.0=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs -de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +de.thetaphi:forbiddenapis:3.10=compileClasspath,cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.cucumber:ci-environment:10.0.1=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath io.cucumber:ci-environment:12.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:ci-environment:9.1.0=cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath io.cucumber:cucumber-core:5.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.cucumber:cucumber-core:7.34.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:cucumber-core:7.23.0=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath +io.cucumber:cucumber-core:7.34.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:cucumber-core:7.6.0=cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath +io.cucumber:cucumber-expressions:16.0.0=cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath +io.cucumber:cucumber-expressions:18.0.1=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath io.cucumber:cucumber-expressions:18.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:cucumber-expressions:8.3.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.cucumber:cucumber-gherkin-messages:7.34.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:cucumber-gherkin-messages:7.23.0=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath +io.cucumber:cucumber-gherkin-messages:7.34.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:cucumber-gherkin-messages:7.6.0=cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath io.cucumber:cucumber-gherkin-vintage:5.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath io.cucumber:cucumber-gherkin:5.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.cucumber:cucumber-gherkin:7.34.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:cucumber-gherkin:7.23.0=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath +io.cucumber:cucumber-gherkin:7.34.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:cucumber-gherkin:7.6.0=cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath io.cucumber:cucumber-java:5.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.cucumber:cucumber-java:7.34.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:cucumber-java:7.23.0=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath +io.cucumber:cucumber-java:7.34.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:cucumber-java:7.6.0=cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath io.cucumber:cucumber-json-formatter:0.3.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:cucumber-junit-platform-engine:5.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.cucumber:cucumber-junit-platform-engine:7.34.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:cucumber-junit-platform-engine:7.23.0=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath +io.cucumber:cucumber-junit-platform-engine:7.34.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:cucumber-junit-platform-engine:7.6.0=cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath io.cucumber:cucumber-plugin:5.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.cucumber:cucumber-plugin:7.34.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:cucumber-plugin:7.23.0=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath +io.cucumber:cucumber-plugin:7.34.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:cucumber-plugin:7.6.0=cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath io.cucumber:datatable:3.3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.cucumber:datatable:7.34.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:datatable:7.23.0=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath +io.cucumber:datatable:7.34.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:datatable:7.6.0=cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath io.cucumber:docstring:5.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.cucumber:docstring:7.34.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:docstring:7.23.0=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath +io.cucumber:docstring:7.34.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:docstring:7.6.0=cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath +io.cucumber:gherkin:24.0.0=cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath +io.cucumber:gherkin:32.1.1=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath io.cucumber:gherkin:36.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:html-formatter:20.0.0=cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath +io.cucumber:html-formatter:21.10.1=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath io.cucumber:html-formatter:22.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:junit-xml-formatter:0.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.cucumber:messages-ndjson:0.3.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:junit-xml-formatter:0.7.1=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath +io.cucumber:messages-ndjson:0.3.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:messages:19.0.0=cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath +io.cucumber:messages:27.2.0=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath io.cucumber:messages:30.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:pretty-formatter:2.4.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:query:13.6.0=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath io.cucumber:query:14.7.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:tag-expressions:2.0.4=compileClasspath,testCompileClasspath,testRuntimeClasspath +io.cucumber:tag-expressions:4.1.0=cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath +io.cucumber:tag-expressions:6.1.2=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath io.cucumber:tag-expressions:8.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:teamcity-formatter:0.2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.cucumber:testng-xml-formatter:0.3.1=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath io.cucumber:testng-xml-formatter:0.7.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.cucumber:usage-formatter:0.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath -javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.leangen.geantyref:geantyref:1.3.16=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +javax.servlet:javax.servlet-api:3.1.0=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.minidev:accessors-smart:2.4.9=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.minidev:json-smart:2.4.10=latestDepTestRuntimeClasspath,testRuntimeClasspath +junit:junit:4.13.2=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.java.dev.jna:jna-platform:5.8.0=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +net.java.dev.jna:jna:5.8.0=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +net.minidev:accessors-smart:2.4.9=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +net.minidev:json-smart:2.4.10=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -104,87 +139,88 @@ org.apache.commons:commons-text:1.14.0=spotbugs org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.0=compileClasspath,testRuntimeClasspath -org.apiguardian:apiguardian-api:1.1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath -org.checkerframework:checker-qual:3.33.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +org.apiguardian:apiguardian-api:1.1.2=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath +org.checkerframework:checker-qual:3.33.0=annotationProcessor,cucumber723TestAnnotationProcessor,cucumber76TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc org.codehaus.groovy:groovy-json:3.0.23=codenarc -org.codehaus.groovy:groovy-json:3.0.25=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-json:3.0.25=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codehaus.groovy:groovy-templates:3.0.23=codenarc org.codehaus.groovy:groovy-xml:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.23=codenarc -org.codehaus.groovy:groovy:3.0.25=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy:3.0.25=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.freemarker:freemarker:2.3.31=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.freemarker:freemarker:2.3.31=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.gmetrics:GMetrics:2.1.0=codenarc -org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.core:0.8.14=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.report:0.8.14=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath +org.hamcrest:hamcrest-core:1.3=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.hamcrest:hamcrest:3.0=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.core:0.8.15=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.report:0.8.15=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jctools:jctools-core-jdk11:4.0.6=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jctools:jctools-core:4.0.6=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:5.14.1=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.14.1=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.2=latestDepTestRuntimeClasspath -org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.14.1=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter:5.14.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.14.1=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-commons:1.14.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.junit.platform:junit-platform-commons:1.6.0=compileClasspath -org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.14.1=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-engine:1.14.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.junit.platform:junit-platform-engine:1.6.0=compileClasspath -org.junit.platform:junit-platform-launcher:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.14.1=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-launcher:1.14.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.junit.platform:junit-platform-runner:1.14.1=testRuntimeClasspath +org.junit.platform:junit-platform-runner:1.14.1=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,testRuntimeClasspath org.junit.platform:junit-platform-runner:1.14.2=latestDepTestRuntimeClasspath -org.junit.platform:junit-platform-suite-api:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-api:1.14.1=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-suite-api:1.14.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.junit.platform:junit-platform-suite-commons:1.14.1=testRuntimeClasspath +org.junit.platform:junit-platform-suite-commons:1.14.1=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,testRuntimeClasspath org.junit.platform:junit-platform-suite-commons:1.14.2=latestDepTestRuntimeClasspath -org.junit.platform:junit-platform-suite-engine:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-engine:1.14.1=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-suite-engine:1.14.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.junit.platform:junit-platform-suite:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite:1.14.1=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-suite:1.14.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs -org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit:junit-bom:5.14.1=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit:junit-bom:5.14.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.junit:junit-bom:5.6.0=compileClasspath -org.mockito:mockito-core:4.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.msgpack:jackson-dataformat-msgpack:0.9.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.msgpack:msgpack-core:0.9.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-core:4.4.0=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.msgpack:jackson-dataformat-msgpack:0.9.6=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.msgpack:msgpack-core:0.9.6=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.objenesis:objenesis:3.3=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.2.0=compileClasspath -org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.opentest4j:opentest4j:1.3.0=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-analysis:9.7.1=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-util:9.7.1=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.skyscreamer:jsonassert:1.5.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.skyscreamer:jsonassert:1.5.1=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:jcl-over-slf4j:1.7.30=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:jul-to-slf4j:1.7.30=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:log4j-over-slf4j:1.7.30=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath -org.slf4j:slf4j-api:1.7.32=latestDepTestCompileClasspath,testCompileClasspath -org.slf4j:slf4j-api:1.7.36=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.32=cucumber723TestCompileClasspath,cucumber76TestCompileClasspath,latestDepTestCompileClasspath,testCompileClasspath +org.slf4j:slf4j-api:1.7.36=cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j -org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath -org.spockframework:spock-bom:2.4-groovy-3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.spockframework:spock-core:2.4-groovy-3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-junit:1.2.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-parser:1.2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,cucumber723TestRuntimeClasspath,cucumber76TestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +org.spockframework:spock-bom:2.4-groovy-3.0=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.spockframework:spock-core:2.4-groovy-3.0=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-junit:1.2.1=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-parser:1.2.0=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -org.xmlunit:xmlunit-core:2.10.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.xmlunit:xmlunit-core:2.10.3=cucumber723TestCompileClasspath,cucumber723TestRuntimeClasspath,cucumber76TestCompileClasspath,cucumber76TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath empty=spotbugsPlugins diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/main/java/datadog/trace/instrumentation/junit5/CucumberRetryDescriptorFactory.java b/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/main/java/datadog/trace/instrumentation/junit5/CucumberRetryDescriptorFactory.java new file mode 100644 index 00000000000..449f3068ec2 --- /dev/null +++ b/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/main/java/datadog/trace/instrumentation/junit5/CucumberRetryDescriptorFactory.java @@ -0,0 +1,109 @@ +package datadog.trace.instrumentation.junit5; + +import datadog.trace.instrumentation.junit5.execution.RetryDescriptorFactory; +import datadog.trace.util.MethodHandles; +import io.cucumber.core.gherkin.Pickle; +import java.lang.invoke.MethodHandle; +import java.util.function.UnaryOperator; +import org.junit.platform.commons.util.ClassLoaderUtils; +import org.junit.platform.engine.ConfigurationParameters; +import org.junit.platform.engine.TestDescriptor; +import org.junit.platform.engine.TestSource; +import org.junit.platform.engine.UniqueId; + +/** + * Reconstructs the Cucumber retry descriptor ({@code PickleDescriptor}) through its own constructor + * with a transformed unique id to avoid final-field mutations (JEP 500). + */ +public final class CucumberRetryDescriptorFactory implements RetryDescriptorFactory { + + private static final MethodHandles METHOD_HANDLES = + new MethodHandles(ClassLoaderUtils.getDefaultClassLoader()); + + private static final String PACKAGE = "io.cucumber.junit.platform.engine."; + + private static final MethodHandle CONSTRUCTOR_7_24 = + METHOD_HANDLES.constructor( + PACKAGE + "CucumberTestDescriptor$PickleDescriptor", + JUnitPlatformUtils.loadClass(PACKAGE + "CucumberConfiguration"), + UniqueId.class, + String.class, + TestSource.class, + Pickle.class); + private static final MethodHandle CONSTRUCTOR_7_7 = + METHOD_HANDLES.constructor( + PACKAGE + "NodeDescriptor$PickleDescriptor", + ConfigurationParameters.class, + UniqueId.class, + String.class, + TestSource.class, + Pickle.class); + private static final MethodHandle CONSTRUCTOR_6_0 = + METHOD_HANDLES.constructor( + PACKAGE + "PickleDescriptor", + ConfigurationParameters.class, + UniqueId.class, + String.class, + TestSource.class, + Pickle.class); + private static final MethodHandle CONSTRUCTOR_5_4 = + METHOD_HANDLES.constructor( + PACKAGE + "PickleDescriptor", + UniqueId.class, + String.class, + TestSource.class, + Pickle.class); + + // 7.24+ stores the configuration on the descriptor, read it back for the reconstruction. + private static final MethodHandle CONFIGURATION_GETTER = + METHOD_HANDLES.privateFieldGetter( + PACKAGE + "CucumberTestDescriptor$PickleDescriptor", "configuration"); + + // The Pickle field was renamed pickleEvent -> pickle; resolved lazily off the descriptor's class. + private volatile MethodHandle pickleGetter; + + @Override + public TestDescriptor copy(TestDescriptor original, UnaryOperator idTransform) { + if (!"PickleDescriptor".equals(original.getClass().getSimpleName())) { + return null; // only the leaf scenario descriptor is retried; containers are filtered earlier + } + Object pickle = readPickle(original); + if (pickle == null) { + return null; + } + UniqueId newId = idTransform.apply(original.getUniqueId()); + String name = original.getDisplayName(); + TestSource source = original.getSource().orElse(null); + + if (CONSTRUCTOR_7_24 != null) { + Object configuration = METHOD_HANDLES.invoke(CONFIGURATION_GETTER, original); + return configuration == null + ? null + : METHOD_HANDLES.invoke(CONSTRUCTOR_7_24, configuration, newId, name, source, pickle); + } + if (CONSTRUCTOR_7_7 != null) { + return METHOD_HANDLES.invoke( + CONSTRUCTOR_7_7, new EmptyConfigurationParameters(), newId, name, source, pickle); + } + if (CONSTRUCTOR_6_0 != null) { + return METHOD_HANDLES.invoke( + CONSTRUCTOR_6_0, new EmptyConfigurationParameters(), newId, name, source, pickle); + } + if (CONSTRUCTOR_5_4 != null) { + return METHOD_HANDLES.invoke(CONSTRUCTOR_5_4, newId, name, source, pickle); + } + return null; // unknown cucumber version -> fall back to the generic clone + } + + private Object readPickle(TestDescriptor descriptor) { + MethodHandle getter = pickleGetter; + if (getter == null) { + getter = METHOD_HANDLES.privateFieldGetter(descriptor.getClass(), "pickle"); + if (getter == null) { + getter = METHOD_HANDLES.privateFieldGetter(descriptor.getClass(), "pickleEvent"); + } + pickleGetter = getter; + } + return getter != null ? METHOD_HANDLES.invoke(getter, descriptor) : null; + } +} diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/main/java/datadog/trace/instrumentation/junit5/CucumberUtils.java b/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/main/java/datadog/trace/instrumentation/junit5/CucumberUtils.java index e0dd68f6c98..c199f4be4e1 100644 --- a/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/main/java/datadog/trace/instrumentation/junit5/CucumberUtils.java +++ b/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/main/java/datadog/trace/instrumentation/junit5/CucumberUtils.java @@ -3,6 +3,7 @@ import datadog.trace.api.Pair; import datadog.trace.api.civisibility.config.TestIdentifier; import datadog.trace.api.civisibility.config.TestSourceData; +import datadog.trace.instrumentation.junit5.execution.RetryDescriptorFactories; import java.io.InputStream; import java.util.ArrayDeque; import java.util.Deque; @@ -25,6 +26,8 @@ public abstract class CucumberUtils { CucumberUtils::toTestIdentifier, d -> TestSourceData.UNKNOWN, null); + RetryDescriptorFactories.register( + JUnitPlatformUtils.ENGINE_ID_CUCUMBER, new CucumberRetryDescriptorFactory()); } public static @Nullable String getCucumberVersion(TestEngine cucumberEngine) { diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/main/java/datadog/trace/instrumentation/junit5/EmptyConfigurationParameters.java b/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/main/java/datadog/trace/instrumentation/junit5/EmptyConfigurationParameters.java new file mode 100644 index 00000000000..17bda38f082 --- /dev/null +++ b/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/main/java/datadog/trace/instrumentation/junit5/EmptyConfigurationParameters.java @@ -0,0 +1,34 @@ +package datadog.trace.instrumentation.junit5; + +import java.util.Collections; +import java.util.Optional; +import java.util.Set; +import org.junit.platform.engine.ConfigurationParameters; + +/** + * NO-OP {@link ConfigurationParameters}, used when reconstructing a Cucumber retry descriptor for + * engine versions (6.0–7.23) whose {@code PickleDescriptor} constructor consumes the configuration + * to compute exclusive resources but does not store it (so it cannot be read back). + */ +@SuppressWarnings("deprecation") // ConfigurationParameters#size() is deprecated in newer platforms +public final class EmptyConfigurationParameters implements ConfigurationParameters { + + @Override + public Optional get(String key) { + return Optional.empty(); + } + + @Override + public Optional getBoolean(String key) { + return Optional.empty(); + } + + @Override + public int size() { + return 0; + } + + public Set keySet() { + return Collections.emptySet(); + } +} diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/main/java/datadog/trace/instrumentation/junit5/JUnit5CucumberInstrumentation.java b/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/main/java/datadog/trace/instrumentation/junit5/JUnit5CucumberInstrumentation.java index 2975e92d759..2ddb230ea86 100644 --- a/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/main/java/datadog/trace/instrumentation/junit5/JUnit5CucumberInstrumentation.java +++ b/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/main/java/datadog/trace/instrumentation/junit5/JUnit5CucumberInstrumentation.java @@ -39,6 +39,10 @@ public String[] helperClassNames() { return new String[] { packageName + ".TestDataFactory", packageName + ".JUnitPlatformUtils", + packageName + ".execution.RetryDescriptorFactory", + packageName + ".execution.RetryDescriptorFactories", + packageName + ".EmptyConfigurationParameters", + packageName + ".CucumberRetryDescriptorFactory", packageName + ".CucumberUtils", packageName + ".TestEventsHandlerHolder", packageName + ".CucumberTracingListener", diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/main/java/datadog/trace/instrumentation/junit5/JUnit5CucumberSkipInstrumentation.java b/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/main/java/datadog/trace/instrumentation/junit5/JUnit5CucumberSkipInstrumentation.java index 73af4a2d485..1833f955f40 100644 --- a/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/main/java/datadog/trace/instrumentation/junit5/JUnit5CucumberSkipInstrumentation.java +++ b/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/main/java/datadog/trace/instrumentation/junit5/JUnit5CucumberSkipInstrumentation.java @@ -65,6 +65,10 @@ public String[] helperClassNames() { return new String[] { packageName + ".TestDataFactory", packageName + ".JUnitPlatformUtils", + packageName + ".execution.RetryDescriptorFactory", + packageName + ".execution.RetryDescriptorFactories", + packageName + ".EmptyConfigurationParameters", + packageName + ".CucumberRetryDescriptorFactory", packageName + ".CucumberUtils", packageName + ".TestEventsHandlerHolder", }; diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/groovy/CucumberTest.groovy b/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/groovy/CucumberTest.groovy index 9aa909b8345..0b84103cbf4 100644 --- a/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/groovy/CucumberTest.groovy +++ b/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/groovy/CucumberTest.groovy @@ -4,6 +4,7 @@ import datadog.trace.api.civisibility.config.TestIdentifier import datadog.trace.civisibility.CiVisibilityInstrumentationTest import datadog.trace.instrumentation.junit5.JUnitPlatformUtils import datadog.trace.instrumentation.junit5.TestEventsHandlerHolder +import datadog.trace.util.ComparableVersion import io.cucumber.core.api.TypeRegistry import io.cucumber.core.options.Constants import org.junit.platform.engine.DiscoverySelector @@ -31,10 +32,10 @@ class CucumberTest extends CiVisibilityInstrumentationTest { where: testcaseName | features | parallel "test-succeed" | ["org/example/cucumber/calculator/basic_arithmetic.feature"] | false - "test-scenario-outline-${version()}" | ["org/example/cucumber/calculator/basic_arithmetic_with_examples.feature"] | false + "test-scenario-outline-${fixtureVersion()}" | ["org/example/cucumber/calculator/basic_arithmetic_with_examples.feature"] | false "test-skipped" | ["org/example/cucumber/calculator/basic_arithmetic_skipped.feature"] | false "test-skipped-feature" | ["org/example/cucumber/calculator/basic_arithmetic_skipped_feature.feature"] | false - "test-skipped-scenario-outline-${version()}" | ["org/example/cucumber/calculator/basic_arithmetic_with_examples_skipped.feature"] | false + "test-skipped-scenario-outline-${fixtureVersion()}" | ["org/example/cucumber/calculator/basic_arithmetic_with_examples_skipped.feature"] | false "test-parallel" | [ "org/example/cucumber/calculator/basic_arithmetic.feature", "org/example/cucumber/calculator/basic_arithmetic_skipped.feature" @@ -78,7 +79,7 @@ class CucumberTest extends CiVisibilityInstrumentationTest { "test-failed-then-succeed" | true | ["org/example/cucumber/calculator/basic_arithmetic_failed_then_succeed.feature"] | [ new TestFQN("classpath:org/example/cucumber/calculator/basic_arithmetic_failed_then_succeed.feature:Basic Arithmetic", "Addition") ] - "test-retry-failed-scenario-outline-${version()}" | false | ["org/example/cucumber/calculator/basic_arithmetic_with_failed_examples.feature"] | [ + "test-retry-failed-scenario-outline-${fixtureVersion()}" | false | ["org/example/cucumber/calculator/basic_arithmetic_with_failed_examples.feature"] | [ new TestFQN("classpath:org/example/cucumber/calculator/basic_arithmetic_with_failed_examples.feature:Basic Arithmetic With Examples", "Many additions.Single digits.${parameterizedTestNameSuffix()}") ] } @@ -97,7 +98,7 @@ class CucumberTest extends CiVisibilityInstrumentationTest { new TestFQN("classpath:org/example/cucumber/calculator/basic_arithmetic.feature:Basic Arithmetic", "Addition") ] "test-efd-new-test" | ["org/example/cucumber/calculator/basic_arithmetic.feature"] | [] - "test-efd-new-scenario-outline-${version()}" | ["org/example/cucumber/calculator/basic_arithmetic_with_examples.feature"] | [] + "test-efd-new-scenario-outline-${fixtureVersion()}" | ["org/example/cucumber/calculator/basic_arithmetic_with_examples.feature"] | [] "test-efd-new-slow-test" | ["org/example/cucumber/calculator/basic_arithmetic_slow.feature"] | [] "test-efd-skip-new-test" | ["org/example/cucumber/calculator/basic_arithmetic_skip_efd.feature"] | [] } @@ -221,13 +222,22 @@ class CucumberTest extends CiVisibilityInstrumentationTest { } private String parameterizedTestNameSuffix() { - // older releases report different example names - version() == "5.4.0" ? "Example #1" : "Example #1.1" + // Cucumber 7.11.0 changed scenario-outline example naming from the flat "Example #" + // to "Example #.". + usesFlatExampleNaming() ? "Example #1" : "Example #1.1" } - private String version() { + private String fixtureVersion() { + // Scenario-outline fixtures only differ by the example naming scheme, so every release that + // still uses the flat naming shares the "legacy" fixture bucket; the rest use "latest". + usesFlatExampleNaming() ? "legacy" : "latest" + } + + private boolean usesFlatExampleNaming() { def version = TypeRegistry.package.getImplementationVersion() - return version != null ? "latest" : "5.4.0" // older releases do not have package version populated + // 5.4.0 does not populate the package version; cucumber 7.11.0 switched from the flat + // "Example #" naming to "Example #.". + return version == null || new ComparableVersion(version) < new ComparableVersion("7.11.0") } protected void runFeatures(List classpathFeatures, boolean parallel, boolean expectSuccess = true) { diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-efd-new-scenario-outline-5.4.0/coverages.ftl b/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-efd-new-scenario-outline-legacy/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-efd-new-scenario-outline-5.4.0/coverages.ftl rename to dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-efd-new-scenario-outline-legacy/coverages.ftl diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-efd-new-scenario-outline-5.4.0/events.ftl b/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-efd-new-scenario-outline-legacy/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-efd-new-scenario-outline-5.4.0/events.ftl rename to dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-efd-new-scenario-outline-legacy/events.ftl diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-retry-failed-scenario-outline-5.4.0/coverages.ftl b/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-retry-failed-scenario-outline-legacy/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-retry-failed-scenario-outline-5.4.0/coverages.ftl rename to dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-retry-failed-scenario-outline-legacy/coverages.ftl diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-retry-failed-scenario-outline-5.4.0/events.ftl b/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-retry-failed-scenario-outline-legacy/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-retry-failed-scenario-outline-5.4.0/events.ftl rename to dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-retry-failed-scenario-outline-legacy/events.ftl diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-scenario-outline-5.4.0/coverages.ftl b/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-scenario-outline-legacy/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-scenario-outline-5.4.0/coverages.ftl rename to dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-scenario-outline-legacy/coverages.ftl diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-scenario-outline-5.4.0/events.ftl b/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-scenario-outline-legacy/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-scenario-outline-5.4.0/events.ftl rename to dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-scenario-outline-legacy/events.ftl diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-skipped-scenario-outline-5.4.0/coverages.ftl b/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-skipped-scenario-outline-legacy/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-skipped-scenario-outline-5.4.0/coverages.ftl rename to dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-skipped-scenario-outline-legacy/coverages.ftl diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-skipped-scenario-outline-5.4.0/events.ftl b/dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-skipped-scenario-outline-legacy/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-skipped-scenario-outline-5.4.0/events.ftl rename to dd-java-agent/instrumentation/junit/junit-5/junit-5-cucumber-5.4/src/test/resources/test-skipped-scenario-outline-legacy/events.ftl diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5-spock-2.0/gradle.lockfile b/dd-java-agent/instrumentation/junit/junit-5/junit-5-spock-2.0/gradle.lockfile index 1cdcb4771ac..19c2b91572d 100644 --- a/dd-java-agent/instrumentation/junit/junit-5/junit-5-spock-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/junit/junit-5/junit-5-spock-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:junit:junit-5:junit-5-spock-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cglib:cglib-nodep:3.3.0=compileClasspath @@ -9,7 +10,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -18,15 +19,15 @@ com.fasterxml.jackson.core:jackson-core:2.20.0=latestDepTestCompileClasspath,lat com.fasterxml.jackson.core:jackson-databind:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -36,12 +37,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.jayway.jsonpath:json-path:2.8.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -54,12 +58,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.minidev:accessors-smart:2.4.9=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -93,11 +97,12 @@ org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:2.2=compileClasspath org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.core:0.8.14=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.report:0.8.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.core:0.8.15=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.report:0.8.15=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:20.1.0=compileClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.7.2=compileClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -125,14 +130,14 @@ org.opentest4j:opentest4j:1.2.0=compileClasspath org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.skyscreamer:jsonassert:1.5.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5-spock-2.0/src/main/java/datadog/trace/instrumentation/junit5/JUnit5SpockInstrumentation.java b/dd-java-agent/instrumentation/junit/junit-5/junit-5-spock-2.0/src/main/java/datadog/trace/instrumentation/junit5/JUnit5SpockInstrumentation.java index 1960a6c254f..2871d8ff26d 100644 --- a/dd-java-agent/instrumentation/junit/junit-5/junit-5-spock-2.0/src/main/java/datadog/trace/instrumentation/junit5/JUnit5SpockInstrumentation.java +++ b/dd-java-agent/instrumentation/junit/junit-5/junit-5-spock-2.0/src/main/java/datadog/trace/instrumentation/junit5/JUnit5SpockInstrumentation.java @@ -39,6 +39,9 @@ public String[] helperClassNames() { return new String[] { packageName + ".JUnitPlatformUtils", packageName + ".TestDataFactory", + packageName + ".execution.RetryDescriptorFactory", + packageName + ".execution.RetryDescriptorFactories", + packageName + ".SpockRetryDescriptorFactory", packageName + ".SpockUtils", packageName + ".TestEventsHandlerHolder", packageName + ".SpockTracingListener", diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5-spock-2.0/src/main/java/datadog/trace/instrumentation/junit5/JUnit5SpockSkipInstrumentation.java b/dd-java-agent/instrumentation/junit/junit-5/junit-5-spock-2.0/src/main/java/datadog/trace/instrumentation/junit5/JUnit5SpockSkipInstrumentation.java index a93a401bfc8..023f0d53ac5 100644 --- a/dd-java-agent/instrumentation/junit/junit-5/junit-5-spock-2.0/src/main/java/datadog/trace/instrumentation/junit5/JUnit5SpockSkipInstrumentation.java +++ b/dd-java-agent/instrumentation/junit/junit-5/junit-5-spock-2.0/src/main/java/datadog/trace/instrumentation/junit5/JUnit5SpockSkipInstrumentation.java @@ -59,6 +59,9 @@ public String[] helperClassNames() { return new String[] { packageName + ".JUnitPlatformUtils", packageName + ".TestDataFactory", + packageName + ".execution.RetryDescriptorFactory", + packageName + ".execution.RetryDescriptorFactories", + packageName + ".SpockRetryDescriptorFactory", packageName + ".SpockUtils", packageName + ".TestEventsHandlerHolder", }; diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5-spock-2.0/src/main/java/datadog/trace/instrumentation/junit5/SpockRetryDescriptorFactory.java b/dd-java-agent/instrumentation/junit/junit-5/junit-5-spock-2.0/src/main/java/datadog/trace/instrumentation/junit5/SpockRetryDescriptorFactory.java new file mode 100644 index 00000000000..8c87bf0b775 --- /dev/null +++ b/dd-java-agent/instrumentation/junit/junit-5/junit-5-spock-2.0/src/main/java/datadog/trace/instrumentation/junit5/SpockRetryDescriptorFactory.java @@ -0,0 +1,99 @@ +package datadog.trace.instrumentation.junit5; + +import datadog.trace.instrumentation.junit5.execution.RetryDescriptorFactory; +import datadog.trace.util.MethodHandles; +import java.lang.invoke.MethodHandle; +import java.util.function.UnaryOperator; +import org.junit.platform.commons.util.ClassLoaderUtils; +import org.junit.platform.engine.TestDescriptor; +import org.junit.platform.engine.UniqueId; +import org.spockframework.runtime.IterationNode; +import org.spockframework.runtime.SimpleFeatureNode; +import org.spockframework.runtime.model.FeatureInfo; +import org.spockframework.runtime.model.IterationInfo; +import spock.config.RunnerConfiguration; + +/** + * Reconstructs the Spock retry descriptor through its own constructor (with a transformed unique + * id) instead of cloning + mutating the final {@code uniqueId} field to avoid JEP 500 warnings. + * + *

      The leaf descriptor reaching the retry advice is either a {@link SimpleFeatureNode} + * (non-parametric feature, on every supported tag) or an {@link IterationNode} (a parametric {@code + * where:} row). + */ +public final class SpockRetryDescriptorFactory implements RetryDescriptorFactory { + + private static final MethodHandles METHOD_HANDLES = + new MethodHandles(ClassLoaderUtils.getDefaultClassLoader()); + + private static final MethodHandle SIMPLE_FEATURE_NODE_CONSTRUCTOR = + METHOD_HANDLES.constructor( + SimpleFeatureNode.class, + UniqueId.class, + RunnerConfiguration.class, + FeatureInfo.class, + IterationNode.class); + + private static final MethodHandle ITERATION_NODE_CONSTRUCTOR = + METHOD_HANDLES.constructor( + IterationNode.class, UniqueId.class, RunnerConfiguration.class, IterationInfo.class); + + private static final MethodHandle SIMPLE_FEATURE_NODE_DELEGATE = + METHOD_HANDLES.privateFieldGetter(SimpleFeatureNode.class, "delegate"); + + private static final MethodHandle ITERATION_NODE_INFO = + METHOD_HANDLES.privateFieldGetter(IterationNode.class, "iterationInfo"); + + @Override + public TestDescriptor copy(TestDescriptor original, UnaryOperator idTransform) { + if (original instanceof SimpleFeatureNode) { + return copySimpleFeatureNode((SimpleFeatureNode) original, idTransform); + } + if (original instanceof IterationNode) { + return copyIterationNode((IterationNode) original, idTransform); + } + return null; // unknown Spock node type -> fall back to the generic clone + } + + private static TestDescriptor copySimpleFeatureNode( + SimpleFeatureNode original, UnaryOperator idTransform) { + if (SIMPLE_FEATURE_NODE_CONSTRUCTOR == null || ITERATION_NODE_CONSTRUCTOR == null) { + return null; + } + RunnerConfiguration configuration = original.getConfiguration(); + FeatureInfo featureInfo = original.getNodeInfo(); + IterationNode originalDelegate = METHOD_HANDLES.invoke(SIMPLE_FEATURE_NODE_DELEGATE, original); + if (originalDelegate == null) { + return null; + } + IterationInfo iterationInfo = METHOD_HANDLES.invoke(ITERATION_NODE_INFO, originalDelegate); + + UniqueId newId = idTransform.apply(original.getUniqueId()); + // keep the delegate a proper child of the copy and distinct across attempts + UniqueId.Segment delegateSegment = originalDelegate.getUniqueId().getLastSegment(); + UniqueId newDelegateId = newId.append(delegateSegment.getType(), delegateSegment.getValue()); + + IterationNode delegate = + METHOD_HANDLES.invoke( + ITERATION_NODE_CONSTRUCTOR, newDelegateId, configuration, iterationInfo); + if (delegate == null) { + return null; + } + return METHOD_HANDLES.invoke( + SIMPLE_FEATURE_NODE_CONSTRUCTOR, newId, configuration, featureInfo, delegate); + } + + private static TestDescriptor copyIterationNode( + IterationNode original, UnaryOperator idTransform) { + if (ITERATION_NODE_CONSTRUCTOR == null) { + return null; + } + RunnerConfiguration configuration = original.getConfiguration(); + IterationInfo iterationInfo = METHOD_HANDLES.invoke(ITERATION_NODE_INFO, original); + if (iterationInfo == null) { + return null; + } + UniqueId newId = idTransform.apply(original.getUniqueId()); + return METHOD_HANDLES.invoke(ITERATION_NODE_CONSTRUCTOR, newId, configuration, iterationInfo); + } +} diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5-spock-2.0/src/main/java/datadog/trace/instrumentation/junit5/SpockUtils.java b/dd-java-agent/instrumentation/junit/junit-5/junit-5-spock-2.0/src/main/java/datadog/trace/instrumentation/junit5/SpockUtils.java index 8cd89350722..19796973732 100644 --- a/dd-java-agent/instrumentation/junit/junit-5/junit-5-spock-2.0/src/main/java/datadog/trace/instrumentation/junit5/SpockUtils.java +++ b/dd-java-agent/instrumentation/junit/junit-5/junit-5-spock-2.0/src/main/java/datadog/trace/instrumentation/junit5/SpockUtils.java @@ -3,6 +3,7 @@ import datadog.trace.api.civisibility.CIConstants; import datadog.trace.api.civisibility.config.TestIdentifier; import datadog.trace.api.civisibility.config.TestSourceData; +import datadog.trace.instrumentation.junit5.execution.RetryDescriptorFactories; import java.lang.invoke.MethodHandle; import java.lang.reflect.Method; import java.util.ArrayList; @@ -43,6 +44,8 @@ public class SpockUtils { SpockUtils::toTestIdentifier, SpockUtils::toTestSourceData, SpockUtils::shouldBeTraced); + RetryDescriptorFactories.register( + JUnitPlatformUtils.ENGINE_ID_SPOCK, new SpockRetryDescriptorFactory()); } /* diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/gradle.lockfile b/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/gradle.lockfile index 19492e7cd60..26b56f80e3e 100644 --- a/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/gradle.lockfile +++ b/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:junit:junit-5:junit-5.3:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latest5TestCompileClasspath,latest5TestRuntim com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath @@ -17,15 +18,15 @@ com.fasterxml.jackson.core:jackson-core:2.20.0=latest5TestCompileClasspath,lates com.fasterxml.jackson.core:jackson-databind:2.20.0=latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.20.0=latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath +com.github.jnr:jffi:1.3.15=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latest5TestAnnotationProcessor,latest5TestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath,v513TestAnnotationProcessor,v513TestCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latest5TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,v513TestAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latest5TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,v513TestAnnotationProcessor -com.google.guava:guava:20.0=latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latest5TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,v513TestAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latest5TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,v513TestAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latest5TestAnnotationProcessor,latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath,v513TestAnnotationProcessor,v513TestCompileClasspath,v513TestRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latest5TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,v513TestAnnotationProcessor -com.google.re2j:re2j:1.7=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath +com.google.re2j:re2j:1.8=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath com.jayway.jsonpath:json-path:2.8.0=latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath @@ -53,12 +57,12 @@ commons-io:commons-io:2.11.0=latest5TestCompileClasspath,latest5TestRuntimeClass commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath net.java.dev.jna:jna:5.8.0=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath net.minidev:accessors-smart:2.4.9=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath @@ -89,47 +93,47 @@ org.freemarker:freemarker:2.3.31=latest5TestCompileClasspath,latest5TestRuntimeC org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath org.hamcrest:hamcrest:3.0=latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath -org.jacoco:org.jacoco.core:0.8.14=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath -org.jacoco:org.jacoco.report:0.8.14=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath +org.jacoco:org.jacoco.core:0.8.15=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath +org.jacoco:org.jacoco.report:0.8.15=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath org.jctools:jctools-core:4.0.6=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath -org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath +org.jspecify:jspecify:1.0.0=latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.4=latest5TestCompileClasspath,latest5TestRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.3.0=compileClasspath -org.junit.jupiter:junit-jupiter-api:6.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:6.1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.4=latest5TestCompileClasspath,latest5TestRuntimeClasspath -org.junit.jupiter:junit-jupiter-engine:6.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:6.1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.4=latest5TestCompileClasspath,latest5TestRuntimeClasspath -org.junit.jupiter:junit-jupiter-params:6.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:6.1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath org.junit.jupiter:junit-jupiter:5.14.4=latest5TestCompileClasspath,latest5TestRuntimeClasspath -org.junit.jupiter:junit-jupiter:6.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.junit.jupiter:junit-jupiter:6.1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath org.junit.platform:junit-platform-commons:1.14.4=latest5TestCompileClasspath,latest5TestRuntimeClasspath org.junit.platform:junit-platform-commons:1.3.0=compileClasspath -org.junit.platform:junit-platform-commons:6.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.junit.platform:junit-platform-commons:6.1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath org.junit.platform:junit-platform-engine:1.14.4=latest5TestCompileClasspath,latest5TestRuntimeClasspath org.junit.platform:junit-platform-engine:1.3.0=compileClasspath -org.junit.platform:junit-platform-engine:6.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.junit.platform:junit-platform-engine:6.1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.junit.platform:junit-platform-launcher:1.14.1=testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath org.junit.platform:junit-platform-launcher:1.14.4=latest5TestCompileClasspath,latest5TestRuntimeClasspath org.junit.platform:junit-platform-launcher:1.3.0=compileClasspath -org.junit.platform:junit-platform-launcher:6.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.junit.platform:junit-platform-launcher:6.1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.junit.platform:junit-platform-runner:1.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath org.junit.platform:junit-platform-runner:1.14.4=latest5TestRuntimeClasspath org.junit.platform:junit-platform-suite-api:1.14.1=testRuntimeClasspath,v513TestRuntimeClasspath org.junit.platform:junit-platform-suite-api:1.14.4=latest5TestRuntimeClasspath -org.junit.platform:junit-platform-suite-api:6.0.3=latestDepTestRuntimeClasspath +org.junit.platform:junit-platform-suite-api:6.1.2=latestDepTestRuntimeClasspath org.junit.platform:junit-platform-suite-commons:1.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath org.junit.platform:junit-platform-suite-commons:1.14.4=latest5TestRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath org.junit:junit-bom:5.14.4=latest5TestCompileClasspath,latest5TestRuntimeClasspath -org.junit:junit-bom:6.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.junit:junit-bom:6.1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.mockito:mockito-core:4.4.0=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath org.msgpack:jackson-dataformat-msgpack:0.9.6=latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath org.msgpack:msgpack-core:0.9.6=latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath @@ -138,14 +142,14 @@ org.opentest4j:opentest4j:1.1.0=compileClasspath org.opentest4j:opentest4j:1.3.0=latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latest5TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,v513TestRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath org.skyscreamer:jsonassert:1.5.1=latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latest5TestCompileClasspath,latest5TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,v513TestCompileClasspath,v513TestRuntimeClasspath diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/JUnitPlatformUtils.java b/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/JUnitPlatformUtils.java index ac7849dce81..e3bd1d58eca 100644 --- a/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/JUnitPlatformUtils.java +++ b/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/JUnitPlatformUtils.java @@ -99,6 +99,18 @@ private JUnitPlatformUtils() {} private static final MethodHandles METHOD_HANDLES = new MethodHandles(ClassLoaderUtils.getDefaultClassLoader()); + /** + * Loads a class by name from the default class loader, returning {@code null} if it is absent. + */ + @Nullable + public static Class loadClass(String className) { + try { + return ClassLoaderUtils.getDefaultClassLoader().loadClass(className); + } catch (Throwable t) { + return null; + } + } + /* * We have to support older versions of JUnit 5 that do not have certain methods that we would * like to use. We try to get method handles in runtime, and if we fail to do it there's a diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/TestDataFactory.java b/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/TestDataFactory.java index 0a3d673b0c2..9061433bb5a 100644 --- a/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/TestDataFactory.java +++ b/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/TestDataFactory.java @@ -5,11 +5,11 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; +import java.util.Optional; import java.util.function.Function; import java.util.function.Predicate; import javax.annotation.Nullable; import org.junit.platform.engine.TestDescriptor; -import org.junit.platform.engine.UniqueId; public abstract class TestDataFactory { @@ -46,29 +46,36 @@ private static Map addEntry(Map originalMap, K key, V value) } public static TestIdentifier createTestIdentifier(TestDescriptor testDescriptor) { - UniqueId uniqueId = testDescriptor.getUniqueId(); - return uniqueId - .getEngineId() + return engineId(testDescriptor) .map(TEST_IDENTIFIER_FACTORY_BY_ENGINE_ID::get) .orElse(JUnitPlatformUtils::toTestIdentifier) .apply(testDescriptor); } public static TestSourceData createTestSourceData(TestDescriptor testDescriptor) { - UniqueId uniqueId = testDescriptor.getUniqueId(); - return uniqueId - .getEngineId() + return engineId(testDescriptor) .map(TEST_SOURCE_DATA_FACTORY_BY_ENGINE_ID::get) .orElse(JUnitPlatformUtils::toTestSourceData) .apply(testDescriptor); } public static boolean shouldBeTraced(TestDescriptor testDescriptor) { - UniqueId uniqueId = testDescriptor.getUniqueId(); - return uniqueId - .getEngineId() + return engineId(testDescriptor) .map(TEST_DESCRIPTOR_FILTER_BY_ENGINE_ID::get) .map(filter -> filter.test(testDescriptor)) .orElse(true); } + + /** + * Resolves the innermost {@code engine} segment rather than the root one returned by the JUnit + * Platform {@code UniqueId#getEngineId()}. + * + *

      Per-engine factories are registered under leaf engine ids ({@code cucumber}, {@code spock}, + * ...). When a framework runs nested under {@code junit-platform-suite-engine}, the unique id is + * rooted at the suite engine (e.g. {@code + * [engine:junit-platform-suite]/[suite:...]/[engine:cucumber]/...}). + */ + private static Optional engineId(TestDescriptor testDescriptor) { + return Optional.ofNullable(JUnitPlatformUtils.getEngineId(testDescriptor)); + } } diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/JUnit5ExecutionInstrumentation.java b/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/JUnit5ExecutionInstrumentation.java index 83c29a5306a..2961aed44e6 100644 --- a/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/JUnit5ExecutionInstrumentation.java +++ b/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/JUnit5ExecutionInstrumentation.java @@ -30,7 +30,6 @@ import org.junit.platform.engine.TestDescriptor; import org.junit.platform.engine.support.hierarchical.EngineExecutionContext; import org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutorService; -import org.junit.platform.engine.support.hierarchical.Node; import org.junit.platform.engine.support.hierarchical.ThrowableCollector; @AutoService(InstrumenterModule.class) @@ -59,6 +58,8 @@ public String[] helperClassNames() { return new String[] { packageName + ".TestTaskHandle", packageName + ".TestDescriptorHandle", + packageName + ".RetryDescriptorFactory", + packageName + ".RetryDescriptorFactories", packageName + ".ThrowableCollectorFactoryWrapper", parentPackageName + ".JUnitPlatformUtils", parentPackageName + ".TestDataFactory", @@ -161,12 +162,13 @@ public static Boolean execute(@Advice.This HierarchicalTestExecutorService.TestT EngineExecutionContext parentContext = taskHandle.getParentContext(); TestDescriptorHandle descriptorHandle = new TestDescriptorHandle(testDescriptor); + HierarchicalTestExecutorService.TestTask currentTask = testTask; int retryAttemptIdx = 0; while (true) { factory.setSuppressFailures(executionPolicy.suppressFailures()); CallDepthThreadLocalMap.incrementCallDepth(HierarchicalTestExecutorService.TestTask.class); - testTask.execute(); + currentTask.execute(); CallDepthThreadLocalMap.decrementCallDepth(HierarchicalTestExecutorService.TestTask.class); factory.setSuppressFailures(false); // restore default behavior @@ -185,13 +187,12 @@ public static Boolean execute(@Advice.This HierarchicalTestExecutorService.TestT JUnitPlatformUtils.RETRY_DESCRIPTOR_ID_SUFFIX, String.valueOf(++retryAttemptIdx)); TestDescriptor retryDescriptor = descriptorHandle.withIdSuffix(suffix); - taskHandle.setTestDescriptor(retryDescriptor); - taskHandle.setNode((Node) retryDescriptor); taskHandle.getListener().dynamicTestRegistered(retryDescriptor); TestEventsHandlerHolder.setExecutionTracker(retryDescriptor, executionPolicy); - // restore parent context, since the reference is overwritten with null after execution - taskHandle.setParentContext(parentContext); + // build a fresh task for the retry and reuse the original parent context, since execution + // overwrites it with null + currentTask = taskHandle.createRetryTask(retryDescriptor, parentContext); } return Boolean.TRUE; // skip original method execution } diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/RetryDescriptorFactories.java b/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/RetryDescriptorFactories.java new file mode 100644 index 00000000000..4d4eb3885ab --- /dev/null +++ b/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/RetryDescriptorFactories.java @@ -0,0 +1,24 @@ +package datadog.trace.instrumentation.junit5.execution; + +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * Registry of per-engine {@link RetryDescriptorFactory} keyed by leaf engine id (e.g. {@code + * spock}, {@code cucumber}). Used by the engine-agnostic retry advice in {@code + * TestDescriptorHandle}. + */ +public final class RetryDescriptorFactories { + + private static final Map BY_ENGINE_ID = new ConcurrentHashMap<>(); + + private RetryDescriptorFactories() {} + + public static void register(String engineId, RetryDescriptorFactory factory) { + BY_ENGINE_ID.put(engineId, factory); + } + + public static RetryDescriptorFactory forEngine(String engineId) { + return engineId != null ? BY_ENGINE_ID.get(engineId) : null; + } +} diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/RetryDescriptorFactory.java b/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/RetryDescriptorFactory.java new file mode 100644 index 00000000000..e1fc99fa8a1 --- /dev/null +++ b/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/RetryDescriptorFactory.java @@ -0,0 +1,18 @@ +package datadog.trace.instrumentation.junit5.execution; + +import java.util.function.UnaryOperator; +import org.junit.platform.engine.TestDescriptor; +import org.junit.platform.engine.UniqueId; + +/** + * Builds a re-executable copy of a leaf test descriptor carrying a transformed unique id, + * without mutating final fields (JEP 500). + */ +public interface RetryDescriptorFactory { + + /** + * @return a reconstructed, re-executable copy with the transformed id, or {@code null} to fall + * back to the generic (Unsafe/reflection) clone. + */ + TestDescriptor copy(TestDescriptor original, UnaryOperator idTransform); +} diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/TestDescriptorHandle.java b/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/TestDescriptorHandle.java index b89fc1113e4..63de4af1367 100644 --- a/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/TestDescriptorHandle.java +++ b/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/TestDescriptorHandle.java @@ -1,12 +1,14 @@ package datadog.trace.instrumentation.junit5.execution; import datadog.trace.agent.tooling.muzzle.Reference; +import datadog.trace.instrumentation.junit5.JUnitPlatformUtils; import datadog.trace.util.MethodHandles; import datadog.trace.util.UnsafeUtils; import java.lang.invoke.MethodHandle; import java.util.Collection; import java.util.Collections; import java.util.Map; +import java.util.function.UnaryOperator; import org.junit.platform.commons.util.ClassLoaderUtils; import org.junit.platform.engine.TestDescriptor; import org.junit.platform.engine.UniqueId; @@ -17,8 +19,28 @@ public class TestDescriptorHandle { private static final MethodHandles METHOD_HANDLES = new MethodHandles(ClassLoaderUtils.getDefaultClassLoader()); - private static final MethodHandle UNIQUE_ID_SETTER = - METHOD_HANDLES.privateFieldSetter(AbstractTestDescriptor.class, "uniqueId"); + private static final String JUPITER_TEST_DESCRIPTOR = + "org.junit.jupiter.engine.descriptor.JupiterTestDescriptor"; + private static final Class JUPITER_TEST_DESCRIPTOR_CLASS = + JUnitPlatformUtils.loadClass(JUPITER_TEST_DESCRIPTOR); + + /** {@code JupiterTestDescriptor#copyIncludingDescendants(UnaryOperator)} (5.13+) */ + private static final MethodHandle COPY_INCLUDING_DESCENDANTS = + METHOD_HANDLES.method( + JUPITER_TEST_DESCRIPTOR, "copyIncludingDescendants", UnaryOperator.class); + + // Legacy fallback used when copyIncludingDescendants is unavailable. + // Overwrites the final unique ID field by reflection. Lazily created to avoid JEP 500 warnings. + private static volatile MethodHandle uniqueIdSetter; + + private static MethodHandle uniqueIdSetter() { + MethodHandle handle = uniqueIdSetter; + if (handle == null) { + handle = METHOD_HANDLES.privateFieldSetter(AbstractTestDescriptor.class, "uniqueId"); + uniqueIdSetter = handle; + } + return handle; + } public static final class MuzzleHelper { public static Collection compileReferences() { @@ -33,24 +55,71 @@ public static Collection compileReferences() { public TestDescriptorHandle(TestDescriptor testDescriptor) { /* - * We're cloning the descriptor to preserve its original state: + * We're copying the descriptor to preserve its original state: * JUnit will modify some of its fields during and after test execution * (one example is parameterized test descriptor, * whose invocation context is overwritten with null). - * Cloning has to be done before each test retry to - * compensate for the state modifications. + * The snapshot is taken before the first execution so that every retry + * can be derived from the pristine state. */ - this.testDescriptor = UnsafeUtils.tryShallowClone(testDescriptor); + this.testDescriptor = copy(testDescriptor, UnaryOperator.identity()); } public TestDescriptor withIdSuffix(Map suffices) { - UniqueId updatedId = testDescriptor.getUniqueId(); - for (Map.Entry e : suffices.entrySet()) { - updatedId = updatedId.append(e.getKey(), String.valueOf(e.getValue())); + return copy( + testDescriptor, + id -> { + UniqueId updatedId = id; + for (Map.Entry e : suffices.entrySet()) { + updatedId = updatedId.append(e.getKey(), String.valueOf(e.getValue())); + } + return updatedId; + }); + } + + private static TestDescriptor copy( + TestDescriptor testDescriptor, UnaryOperator idTransform) { + if (COPY_INCLUDING_DESCENDANTS != null + && JUPITER_TEST_DESCRIPTOR_CLASS != null + && JUPITER_TEST_DESCRIPTOR_CLASS.isInstance(testDescriptor)) { + TestDescriptor copy = + METHOD_HANDLES.invoke(COPY_INCLUDING_DESCENDANTS, testDescriptor, idTransform); + if (copy != null) { + // copyIncludingDescendants returns a detached copy so we link it back to its suite + if (copy instanceof AbstractTestDescriptor) { + ((AbstractTestDescriptor) copy).setParent(testDescriptor.getParent().orElse(null)); + } + return copy; + } } + // per-engine reconstruction (Spock, Cucumber) + RetryDescriptorFactory factory = + RetryDescriptorFactories.forEngine(JUnitPlatformUtils.getEngineId(testDescriptor)); + if (factory != null) { + TestDescriptor copy = factory.copy(testDescriptor, idTransform); + if (copy != null) { + // reconstructed descriptors are detached, so we link them back to the original's suite + if (copy instanceof AbstractTestDescriptor) { + ((AbstractTestDescriptor) copy).setParent(testDescriptor.getParent().orElse(null)); + } + return copy; + } + } + return legacyCopy(testDescriptor, idTransform); + } + + /** + * Fallback for engines without {@code copyIncludingDescendants}: shallow-clone the descriptor and + * overwrite the cloned unique ID field by reflection. Not JEP 500 compliant. + */ + private static TestDescriptor legacyCopy( + TestDescriptor testDescriptor, UnaryOperator idTransform) { TestDescriptor descriptorClone = UnsafeUtils.tryShallowClone(testDescriptor); - METHOD_HANDLES.invoke(UNIQUE_ID_SETTER, descriptorClone, updatedId); + UniqueId updatedId = idTransform.apply(testDescriptor.getUniqueId()); + if (descriptorClone != testDescriptor && !updatedId.equals(testDescriptor.getUniqueId())) { + METHOD_HANDLES.invoke(uniqueIdSetter(), descriptorClone, updatedId); + } return descriptorClone; } } diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/TestTaskHandle.java b/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/TestTaskHandle.java index af50a2aef5b..adf7c364ea5 100644 --- a/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/TestTaskHandle.java +++ b/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/main/java/datadog/trace/instrumentation/junit5/execution/TestTaskHandle.java @@ -2,6 +2,7 @@ import datadog.trace.agent.tooling.muzzle.Reference; import datadog.trace.agent.tooling.muzzle.ReferenceProvider; +import datadog.trace.instrumentation.junit5.JUnitPlatformUtils; import datadog.trace.util.MethodHandles; import java.lang.invoke.MethodHandle; import java.util.Arrays; @@ -13,7 +14,6 @@ import org.junit.platform.engine.TestDescriptor; import org.junit.platform.engine.support.hierarchical.EngineExecutionContext; import org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutorService; -import org.junit.platform.engine.support.hierarchical.Node; import org.junit.platform.engine.support.hierarchical.ThrowableCollector; public class TestTaskHandle { @@ -28,17 +28,44 @@ public class TestTaskHandle { private static final MethodHandle TEST_DESCRIPTOR_GETTER = METHOD_HANDLES.privateFieldGetter(TEST_TASK_CLASS, "testDescriptor"); - private static final MethodHandle TEST_DESCRIPTOR_SETTER = - METHOD_HANDLES.privateFieldSetter(TEST_TASK_CLASS, "testDescriptor"); - - private static final MethodHandle NODE_SETTER = - METHOD_HANDLES.privateFieldSetter(TEST_TASK_CLASS, "node"); private static final MethodHandle PARENT_CONTEXT_GETTER = METHOD_HANDLES.privateFieldGetter(TEST_TASK_CLASS, "parentContext"); private static final MethodHandle PARENT_CONTEXT_SETTER = METHOD_HANDLES.privateFieldSetter(TEST_TASK_CLASS, "parentContext"); + /** NodeTestTask's {@code (NodeTestTaskContext, TestDescriptor)} constructor (1.3.1+) */ + private static final Class TEST_TASK_CONTEXT_CLASS_REF = + JUnitPlatformUtils.loadClass(TEST_TASK_CONTEXT_CLASS); + + private static final MethodHandle TEST_TASK_CONSTRUCTOR = + TEST_TASK_CONTEXT_CLASS_REF != null + ? METHOD_HANDLES.constructor( + TEST_TASK_CLASS, TEST_TASK_CONTEXT_CLASS_REF, TestDescriptor.class) + : null; + + // Legacy fallback setters, lazily created to avoid JEP 500 warnings, only used on 1.3.0 + private static volatile MethodHandle testDescriptorSetter; + private static volatile MethodHandle nodeSetter; + + private static MethodHandle testDescriptorSetter() { + MethodHandle handle = testDescriptorSetter; + if (handle == null) { + handle = METHOD_HANDLES.privateFieldSetter(TEST_TASK_CLASS, "testDescriptor"); + testDescriptorSetter = handle; + } + return handle; + } + + private static MethodHandle nodeSetter() { + MethodHandle handle = nodeSetter; + if (handle == null) { + handle = METHOD_HANDLES.privateFieldSetter(TEST_TASK_CLASS, "node"); + nodeSetter = handle; + } + return handle; + } + private static final MethodHandle THROWABLE_COLLECTOR_FACTORY_GETTER = METHOD_HANDLES.privateFieldGetter(TEST_TASK_CLASS, "throwableCollectorFactory"); private static final MethodHandle TASK_CONTEXT_THROWABLE_COLLECTOR_FACTORY_GETTER = @@ -118,20 +145,29 @@ public TestDescriptor getTestDescriptor() { return METHOD_HANDLES.invoke(TEST_DESCRIPTOR_GETTER, testTask); } - public void setTestDescriptor(TestDescriptor testDescriptor) { - METHOD_HANDLES.invoke(TEST_DESCRIPTOR_SETTER, testTask, testDescriptor); - } - - public void setNode(Node node) { - METHOD_HANDLES.invoke(NODE_SETTER, testTask, node); - } - public EngineExecutionContext getParentContext() { return METHOD_HANDLES.invoke(PARENT_CONTEXT_GETTER, testTask); } - public void setParentContext(EngineExecutionContext parentContext) { + /** + * Returns a task that will execute the given retry descriptor. If possible, a brand-new + * NodeTestTask is constructed; otherwise we fall back to overwriting the current task's fields + * (non-compliant with JEP500). + */ + public HierarchicalTestExecutorService.TestTask createRetryTask( + TestDescriptor descriptor, EngineExecutionContext parentContext) { + if (TEST_TASK_CONSTRUCTOR != null && testTaskContext != null) { + Object retryTask = METHOD_HANDLES.invoke(TEST_TASK_CONSTRUCTOR, testTaskContext, descriptor); + if (retryTask != null) { + METHOD_HANDLES.invoke(PARENT_CONTEXT_SETTER, retryTask, parentContext); + return (HierarchicalTestExecutorService.TestTask) retryTask; + } + } + // fallback (< 1.3.1): reuse the current task by overwriting its final fields. + METHOD_HANDLES.invoke(testDescriptorSetter(), testTask, descriptor); + METHOD_HANDLES.invoke(nodeSetter(), testTask, descriptor); METHOD_HANDLES.invoke(PARENT_CONTEXT_SETTER, testTask, parentContext); + return testTask; } public EngineExecutionListener getListener() { diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/test/java/org/example/TestFailedThenSucceed.java b/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/test/java/org/example/TestFailedThenSucceed.java index 38ea775d7d8..cac99b64d40 100644 --- a/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/test/java/org/example/TestFailedThenSucceed.java +++ b/dd-java-agent/instrumentation/junit/junit-5/junit-5.3/src/test/java/org/example/TestFailedThenSucceed.java @@ -2,7 +2,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; import org.junit.jupiter.api.AfterEach; @@ -17,7 +17,7 @@ public class TestFailedThenSucceed { public void setUp() { AgentTracer.TracerAPI agentTracer = AgentTracer.get(); AgentSpan span = agentTracer.buildSpan("junit-manual", "set-up").start(); - try (AgentScope scope = agentTracer.activateManualSpan(span)) { + try (ContextScope scope = agentTracer.activateManualSpan(span)) { // tracing setup to verify that it is executed for every retry } span.finish(); @@ -32,7 +32,7 @@ public void test_failed_then_succeed() { public void tearDown() { AgentTracer.TracerAPI agentTracer = AgentTracer.get(); AgentSpan span = agentTracer.buildSpan("junit-manual", "tear-down").start(); - try (AgentScope scope = agentTracer.activateManualSpan(span)) { + try (ContextScope scope = agentTracer.activateManualSpan(span)) { // tracing teardown to verify that it is executed for every retry } span.finish(); diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5.8/gradle.lockfile b/dd-java-agent/instrumentation/junit/junit-5/junit-5.8/gradle.lockfile index 968d7ffb81c..4ae1992998c 100644 --- a/dd-java-agent/instrumentation/junit/junit-5/junit-5.8/gradle.lockfile +++ b/dd-java-agent/instrumentation/junit/junit-5/junit-5.8/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:junit:junit-5:junit-5.8:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.fasterxml.jackson.core:jackson-core:2.20.0=latestDepTestCompileClasspath,lat com.fasterxml.jackson.core:jackson-databind:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.jayway.jsonpath:json-path:2.8.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -53,12 +57,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.minidev:accessors-smart:2.4.9=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -88,38 +92,38 @@ org.freemarker:freemarker:2.3.31=latestDepTestCompileClasspath,latestDepTestRunt org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.core:0.8.14=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.report:0.8.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.core:0.8.15=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.report:0.8.15=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.8.0=compileClasspath -org.junit.jupiter:junit-jupiter-api:6.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:6.1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.8.0=compileClasspath -org.junit.jupiter:junit-jupiter-engine:6.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:6.1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-params:6.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:6.1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter:6.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.junit.jupiter:junit-jupiter:6.1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-commons:1.8.0=compileClasspath -org.junit.platform:junit-platform-commons:6.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.junit.platform:junit-platform-commons:6.1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-engine:1.8.0=compileClasspath -org.junit.platform:junit-platform-engine:6.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.junit.platform:junit-platform-engine:6.1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.junit.platform:junit-platform-launcher:1.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-launcher:1.8.0=compileClasspath -org.junit.platform:junit-platform-launcher:6.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.junit.platform:junit-platform-launcher:6.1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.junit.platform:junit-platform-runner:1.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.platform:junit-platform-suite-api:1.14.1=testRuntimeClasspath -org.junit.platform:junit-platform-suite-api:6.0.3=latestDepTestRuntimeClasspath +org.junit.platform:junit-platform-suite-api:6.1.2=latestDepTestRuntimeClasspath org.junit.platform:junit-platform-suite-commons:1.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit:junit-bom:5.8.0=compileClasspath -org.junit:junit-bom:6.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.junit:junit-bom:6.1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.mockito:mockito-core:4.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath org.msgpack:jackson-dataformat-msgpack:0.9.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.msgpack:msgpack-core:0.9.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -128,14 +132,14 @@ org.opentest4j:opentest4j:1.2.0=compileClasspath org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.skyscreamer:jsonassert:1.5.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/junit/junit-5/junit-5.8/src/main/java/datadog/trace/instrumentation/junit5/BeforeAfterOperationsTracer.java b/dd-java-agent/instrumentation/junit/junit-5/junit-5.8/src/main/java/datadog/trace/instrumentation/junit5/BeforeAfterOperationsTracer.java index 19d56086a4b..99448382196 100644 --- a/dd-java-agent/instrumentation/junit/junit-5/junit-5.8/src/main/java/datadog/trace/instrumentation/junit5/BeforeAfterOperationsTracer.java +++ b/dd-java-agent/instrumentation/junit/junit-5/junit-5.8/src/main/java/datadog/trace/instrumentation/junit5/BeforeAfterOperationsTracer.java @@ -1,6 +1,6 @@ package datadog.trace.instrumentation.junit5; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; import datadog.trace.bootstrap.instrumentation.api.Tags; @@ -51,7 +51,7 @@ private static void traceInvocation( Invocation invocation, Method executable, String operationName) throws Throwable { AgentSpan agentSpan = AgentTracer.startSpan("junit", executable.getName()); agentSpan.setTag(Tags.TEST_CALLBACK, operationName); - try (AgentScope agentScope = AgentTracer.activateSpan(agentSpan)) { + try (ContextScope scope = AgentTracer.activateSpan(agentSpan)) { invocation.proceed(); } catch (Throwable t) { agentSpan.addThrowable(t); diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/build.gradle b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/build.gradle index d94981f3adb..d1eb7ae1226 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/build.gradle +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/build.gradle @@ -24,7 +24,6 @@ dependencies { compileOnly group: 'org.apache.kafka', name: 'kafka-clients', version: '0.11.0.0' implementation project(':dd-java-agent:instrumentation:kafka:kafka-common') - testImplementation libs.spock.junit4 // This module still needs Spock with JUnit4. testImplementation group: 'org.apache.kafka', name: 'kafka-clients', version: '0.11.0.0' testImplementation group: 'org.springframework.kafka', name: 'spring-kafka', version: '1.3.3.RELEASE' testImplementation group: 'org.springframework.kafka', name: 'spring-kafka-test', version: '1.3.3.RELEASE' diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/gradle.lockfile b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/gradle.lockfile index 3bfc8a3634d..3b486176dd4 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/gradle.lockfile +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:kafka:kafka-clients-0.11:dependencies --write-locks at.yawk.lz4:lz4-java:1.10.1=iastLatestDepTest3RuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -10,7 +11,7 @@ com.101tec:zkclient:0.10=iastLatestDepTest3CompileClasspath,iastLatestDepTest3Ru com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -29,17 +30,17 @@ com.fasterxml.jackson.module:jackson-module-scala_2.13:2.13.3=latestDepTestRunti com.fasterxml.jackson:jackson-bom:2.13.3=latestDepTestRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.15.4=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.luben:zstd-jni:1.5.2-1=latestDepTestRuntimeClasspath com.github.luben:zstd-jni:1.5.6-4=iastLatestDepTest3RuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,iastLatestDepTest3AnnotationProcessor,iastLatestDepTest3CompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -49,12 +50,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,iastL com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,iastLatestDepTest3AnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,iastLatestDepTest3AnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,iastLatestDepTest3AnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,iastLatestDepTest3AnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,iastLatestDepTest3AnnotationProcessor,iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,iastLatestDepTest3AnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -71,8 +75,8 @@ commons-logging:commons-logging:1.2=testCompileClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.dropwizard.metrics:metrics-core:4.1.12.1=latestDepTestRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.micrometer:micrometer-commons:1.15.11=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath -io.micrometer:micrometer-observation:1.15.11=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath +io.micrometer:micrometer-commons:1.15.12=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath +io.micrometer:micrometer-observation:1.15.12=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath io.netty:netty-buffer:4.1.63.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec:4.1.63.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-common:4.1.63.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -83,16 +87,17 @@ io.netty:netty-transport-native-unix-common:4.1.63.Final=latestDepTestCompileCla io.netty:netty-transport:4.1.63.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.projectreactor.kafka:reactor-kafka:1.0.0.RELEASE=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.projectreactor:reactor-core:3.1.0.RELEASE=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.activation:activation:1.1=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.xml.bind:jaxb-api:2.2.3=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.xml.stream:stax-api:1.0-2=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -junit:junit:4.13.2=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +junit:junit:4.12=iastLatestDepTest3CompileClasspath,testCompileClasspath +junit:junit:4.13.2=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath log4j:log4j:1.2.16=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.jpountz.lz4:lz4:1.3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath @@ -139,10 +144,11 @@ org.codehaus.groovy:groovy:3.0.25=iastLatestDepTest3CompileClasspath,iastLatestD org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc -org.hamcrest:hamcrest-core:1.3=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.hamcrest:hamcrest-core:1.3=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -162,14 +168,14 @@ org.objenesis:objenesis:3.3=iastLatestDepTest3CompileClasspath,iastLatestDepTest org.opentest4j:opentest4j:1.3.0=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.1=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.rocksdb:rocksdbjni:6.29.4.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.scala-lang.modules:scala-collection-compat_2.13:2.6.0=latestDepTestRuntimeClasspath @@ -189,40 +195,39 @@ org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,iastLatestDepTest3RuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath org.spockframework:spock-bom:2.4-groovy-3.0=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.spockframework:spock-junit4:2.4-groovy-3.0=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.springframework.kafka:spring-kafka-test:1.3.3.RELEASE=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.springframework.kafka:spring-kafka-test:2.9.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.kafka:spring-kafka:1.3.3.RELEASE=testCompileClasspath,testRuntimeClasspath org.springframework.kafka:spring-kafka:2.9.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.springframework.kafka:spring-kafka:3.3.15=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath +org.springframework.kafka:spring-kafka:3.3.16=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath org.springframework.retry:spring-retry:1.2.2.RELEASE=testCompileClasspath,testRuntimeClasspath org.springframework.retry:spring-retry:1.3.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.springframework.retry:spring-retry:2.0.12=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath +org.springframework.retry:spring-retry:2.0.13=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath org.springframework:spring-aop:4.3.14.RELEASE=testCompileClasspath,testRuntimeClasspath org.springframework:spring-aop:5.3.29=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.springframework:spring-aop:6.2.18=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath +org.springframework:spring-aop:6.2.19=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath org.springframework:spring-beans:4.3.14.RELEASE=testCompileClasspath,testRuntimeClasspath org.springframework:spring-beans:5.3.29=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.springframework:spring-beans:6.2.18=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath +org.springframework:spring-beans:6.2.19=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath org.springframework:spring-context:4.3.14.RELEASE=testCompileClasspath,testRuntimeClasspath org.springframework:spring-context:5.3.29=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.springframework:spring-context:6.2.18=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath +org.springframework:spring-context:6.2.19=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath org.springframework:spring-core:4.3.14.RELEASE=testCompileClasspath,testRuntimeClasspath org.springframework:spring-core:5.3.29=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.springframework:spring-core:6.2.18=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath +org.springframework:spring-core:6.2.19=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath org.springframework:spring-expression:4.3.14.RELEASE=testCompileClasspath,testRuntimeClasspath org.springframework:spring-expression:5.3.29=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.springframework:spring-expression:6.2.18=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath +org.springframework:spring-expression:6.2.19=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath org.springframework:spring-jcl:5.3.29=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.springframework:spring-jcl:6.2.18=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath +org.springframework:spring-jcl:6.2.19=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath org.springframework:spring-messaging:4.3.14.RELEASE=testCompileClasspath,testRuntimeClasspath org.springframework:spring-messaging:5.3.29=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.springframework:spring-messaging:6.2.18=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath +org.springframework:spring-messaging:6.2.19=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath org.springframework:spring-test:4.3.14.RELEASE=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.springframework:spring-test:5.3.29=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-tx:4.3.14.RELEASE=testCompileClasspath,testRuntimeClasspath org.springframework:spring-tx:5.3.29=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.springframework:spring-tx:6.2.18=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath +org.springframework:spring-tx:6.2.19=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath org.tabletest:tabletest-junit:1.2.1=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=iastLatestDepTest3CompileClasspath,iastLatestDepTest3RuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.xerial.snappy:snappy-java:1.1.10.5=iastLatestDepTest3RuntimeClasspath diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/latestDepTest/groovy/KafkaClientTestBase.groovy b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/latestDepTest/groovy/KafkaClientTestBase.groovy index 58913d9ffb8..7a5ce9597b6 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/latestDepTest/groovy/KafkaClientTestBase.groovy +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/latestDepTest/groovy/KafkaClientTestBase.groovy @@ -14,12 +14,10 @@ import org.apache.kafka.clients.producer.KafkaProducer import org.apache.kafka.clients.producer.ProducerConfig import org.apache.kafka.clients.producer.ProducerRecord import org.apache.kafka.common.serialization.StringSerializer -import org.junit.Rule import org.springframework.kafka.core.DefaultKafkaConsumerFactory import org.springframework.kafka.listener.KafkaMessageListenerContainer import org.springframework.kafka.listener.MessageListener import org.springframework.kafka.test.EmbeddedKafkaBroker -import org.springframework.kafka.test.rule.EmbeddedKafkaRule import org.springframework.kafka.test.utils.ContainerTestUtils import org.springframework.kafka.test.utils.KafkaTestUtils import spock.lang.Shared @@ -34,9 +32,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.isAsyncPro abstract class KafkaClientTestBase extends VersionedNamingTestBase { static final SHARED_TOPIC = "shared.topic" - @Rule - EmbeddedKafkaRule kafkaRule = new EmbeddedKafkaRule(1, true, SHARED_TOPIC) - EmbeddedKafkaBroker embeddedKafka = kafkaRule.embeddedKafka + protected EmbeddedKafkaBroker embeddedKafka @Override void configurePreAgent() { @@ -96,9 +92,15 @@ abstract class KafkaClientTestBase extends VersionedNamingTestBase { } def setup() { + embeddedKafka = new EmbeddedKafkaBroker(1, true, SHARED_TOPIC) + embeddedKafka.afterPropertiesSet() TEST_WRITER.setFilter(DROP_KAFKA_POLL) } + def cleanup() { + embeddedKafka?.destroy() + } + @Override int version() { 0 @@ -163,7 +165,6 @@ abstract class KafkaClientTestBase extends VersionedNamingTestBase { container.setupMessageListener(new MessageListener() { @Override void onMessage(ConsumerRecord record) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces records.add(record) } }) diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/KafkaConsumerInfoInstrumentation.java b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/KafkaConsumerInfoInstrumentation.java index 1092d9b2a0c..a2fa481491c 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/KafkaConsumerInfoInstrumentation.java +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/KafkaConsumerInfoInstrumentation.java @@ -37,6 +37,7 @@ import org.apache.kafka.clients.consumer.ConsumerRecords; import org.apache.kafka.clients.consumer.KafkaConsumer; import org.apache.kafka.clients.consumer.internals.ConsumerCoordinator; +import org.apache.kafka.common.errors.WakeupException; /** * This instrumentation saves additional information from the KafkaConsumer, such as consumer group @@ -258,11 +259,12 @@ public static AgentScope onEnter(@Advice.This KafkaConsumer consumer) { return null; } - @Advice.OnMethodExit(suppress = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void captureGroup( @Advice.Enter final AgentScope scope, @Advice.This KafkaConsumer consumer, - @Advice.Return ConsumerRecords records) { + @Advice.Return ConsumerRecords records, + @Advice.Thrown Throwable throwable) { int recordsCount = 0; if (records != null) { KafkaConsumerInfo kafkaConsumerInfo = @@ -281,8 +283,11 @@ public static void captureGroup( } AgentSpan span = scope.span(); span.setTag(KAFKA_RECORDS_COUNT, recordsCount); - span.finish(); + if (!(throwable instanceof WakeupException)) { + span.addThrowable(throwable); + } scope.close(); + span.finish(); } } } diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/KafkaDeserializerInstrumentation.java b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/KafkaDeserializerInstrumentation.java index 2f180b7a3e2..98fbb90d925 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/KafkaDeserializerInstrumentation.java +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/KafkaDeserializerInstrumentation.java @@ -116,7 +116,7 @@ public static void deserialize( ctx = KafkaIastHelper.beforeDeserialize(store, deserializer, data); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void afterDeserialize( @Advice.This final Deserializer deserializer, @Advice.Return Object result, @@ -141,7 +141,7 @@ public static void deserialize( ctx = KafkaIastHelper.beforeDeserialize(store, deserializer, data); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void afterDeserialize( @Advice.This final Deserializer deserializer, @Advice.Return Object result, @@ -166,7 +166,7 @@ public static void deserialize( ctx = KafkaIastHelper.beforeDeserialize(store, deserializer, data); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void afterDeserialize( @Advice.This final Deserializer deserializer, @Advice.Return final Object result, diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/KafkaProducerCallback.java b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/KafkaProducerCallback.java index d96d99916d1..c536e147e77 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/KafkaProducerCallback.java +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/KafkaProducerCallback.java @@ -5,8 +5,8 @@ import static datadog.trace.bootstrap.instrumentation.api.InstrumentationTags.PARTITION; import static datadog.trace.instrumentation.kafka_clients.KafkaDecorator.PRODUCER_DECORATE; +import datadog.context.ContextScope; import datadog.trace.api.datastreams.DataStreamsTags; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; import javax.annotation.Nullable; @@ -41,7 +41,7 @@ public void onCompletion(final RecordMetadata metadata, final Exception exceptio span.finish(); if (callback != null) { if (parent != null) { - try (final AgentScope scope = activateSpan(parent)) { + try (final ContextScope scope = activateSpan(parent)) { callback.onCompletion(metadata, exception); } } else { diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/KafkaProducerInstrumentation.java b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/KafkaProducerInstrumentation.java index 1887e0a5205..b425b7a67c6 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/KafkaProducerInstrumentation.java +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/KafkaProducerInstrumentation.java @@ -287,7 +287,7 @@ public static class PayloadSizeAdvice { */ @Advice.OnMethodEnter(suppress = Throwable.class) public static void onEnter(@Advice.Argument(value = 0) int estimatedPayloadSize) { - StatsPoint saved = activeSpan().context().getPathwayContext().getSavedStats(); + StatsPoint saved = activeSpan().spanContext().getPathwayContext().getSavedStats(); if (saved != null) { // create new stats including the payload size StatsPoint updated = diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/TextMapExtractAdapter.java b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/TextMapExtractAdapter.java index 4f2c178e0c1..429038773ba 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/TextMapExtractAdapter.java +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/TextMapExtractAdapter.java @@ -1,13 +1,16 @@ package datadog.trace.instrumentation.kafka_clients; +import static datadog.trace.api.Functions.BASE64_DECODE; +import static datadog.trace.api.Functions.UTF8_BYTES_TO_STRING; +import static datadog.trace.api.telemetry.LogCollector.EXCLUDE_TELEMETRY; import static datadog.trace.instrumentation.kafka_clients.KafkaDecorator.KAFKA_PRODUCED_KEY; -import static java.nio.charset.StandardCharsets.UTF_8; import datadog.trace.api.Config; import datadog.trace.bootstrap.instrumentation.api.AgentPropagation; import datadog.trace.bootstrap.instrumentation.api.AgentPropagation.ContextVisitor; import java.nio.ByteBuffer; import java.util.Base64; +import java.util.function.Function; import org.apache.kafka.common.header.Header; import org.apache.kafka.common.header.Headers; import org.slf4j.Logger; @@ -19,10 +22,17 @@ public class TextMapExtractAdapter implements ContextVisitor { public static final TextMapExtractAdapter GETTER = new TextMapExtractAdapter(Config.get().isKafkaClientBase64DecodingEnabled()); - private final Base64.Decoder base64; + private final Function headerValueTransformer; + private final Base64.Decoder decoder; - public TextMapExtractAdapter(boolean base64DecodeHeaders) { - this.base64 = base64DecodeHeaders ? Base64.getDecoder() : null; + public TextMapExtractAdapter(boolean decodeBase64Headers) { + if (decodeBase64Headers) { + this.headerValueTransformer = BASE64_DECODE; + this.decoder = Base64.getDecoder(); + } else { + this.headerValueTransformer = UTF8_BYTES_TO_STRING; + this.decoder = null; + } } @Override @@ -33,10 +43,12 @@ public void forEachKey(Headers carrier, AgentPropagation.KeyClassifier classifie if (null == value) { continue; } - if (base64 != null) { - value = base64.decode(value); + String decoded = headerValueTransformer.apply(value); + if (decoded == null) { + log.debug(EXCLUDE_TELEMETRY, "Failed to Base64-decode Kafka header '{}', skipping", key); + continue; } - if (!classifier.accept(key, new String(value, UTF_8))) { + if (!classifier.accept(key, decoded)) { return; } } @@ -47,11 +59,11 @@ public long extractTimeInQueueStart(Headers carrier) { if (null != header) { try { ByteBuffer buf = ByteBuffer.allocate(8); - buf.put(base64 != null ? base64.decode(header.value()) : header.value()); + buf.put(decoder != null ? decoder.decode(header.value()) : header.value()); buf.flip(); return buf.getLong(); } catch (Exception e) { - log.debug("Unable to get kafka produced time", e); + log.debug(EXCLUDE_TELEMETRY, "Unable to get kafka produced time", e); } } return 0; diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/TracingIterator.java b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/TracingIterator.java index bbf30914e3b..93179e4e3f2 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/TracingIterator.java +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/TracingIterator.java @@ -9,8 +9,6 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.closePrevious; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.traceConfig; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.kafka_clients.KafkaDecorator.BROKER_DECORATE; import static datadog.trace.instrumentation.kafka_clients.KafkaDecorator.JAVA_KAFKA; import static datadog.trace.instrumentation.kafka_clients.KafkaDecorator.KAFKA_DELIVER; @@ -22,6 +20,7 @@ import static datadog.trace.instrumentation.kafka_common.Utils.computePayloadSizeBytes; import static java.util.concurrent.TimeUnit.MILLISECONDS; +import datadog.context.Context; import datadog.context.propagation.Propagator; import datadog.context.propagation.Propagators; import datadog.trace.api.Config; @@ -72,7 +71,7 @@ public boolean hasNext() { if (InstrumenterConfig.get().isLegacyContextManagerEnabled()) { closePrevious(true); } else { - final AgentSpan previousSpan = spanFromContext(getRootContext().swap()); + final AgentSpan previousSpan = AgentSpan.fromContext(Context.root().swap()); if (previousSpan != null) { previousSpan.finishWithEndToEnd(); } @@ -93,7 +92,7 @@ protected void startNewRecordSpan(ConsumerRecord val) { if (InstrumenterConfig.get().isLegacyContextManagerEnabled()) { closePrevious(true); } else if (val == null) { // previous message span was the last - final AgentSpan previousSpan = spanFromContext(getRootContext().swap()); + final AgentSpan previousSpan = AgentSpan.fromContext(Context.root().swap()); if (previousSpan != null) { previousSpan.finishWithEndToEnd(); } @@ -115,7 +114,7 @@ protected void startNewRecordSpan(ConsumerRecord val) { MILLISECONDS.toMicros(timeInQueueStart)); BROKER_DECORATE.afterStart(queueSpan); BROKER_DECORATE.onTimeInQueue(queueSpan, val); - span = startSpan(JAVA_KAFKA.toString(), operationName, queueSpan.context()); + span = startSpan(JAVA_KAFKA.toString(), operationName, queueSpan.spanContext()); BROKER_DECORATE.beforeFinish(queueSpan); // The queueSpan will be finished after inner span has been activated to ensure that // spans are written out together by TraceStructureWriter when running in strict mode @@ -151,7 +150,7 @@ protected void startNewRecordSpan(ConsumerRecord val) { if (InstrumenterConfig.get().isLegacyContextManagerEnabled()) { activateNext(span); } else { - final AgentSpan previousSpan = spanFromContext(span.swap()); + final AgentSpan previousSpan = AgentSpan.fromContext(span.swap()); if (previousSpan != null) { previousSpan.finishWithEndToEnd(); } diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/TracingListIterator.java b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/TracingListIterator.java index b3f1e1abe66..34e7bbe00df 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/TracingListIterator.java +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/main/java/datadog/trace/instrumentation/kafka_clients/TracingListIterator.java @@ -1,9 +1,8 @@ package datadog.trace.instrumentation.kafka_clients; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.closePrevious; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; +import datadog.context.Context; import datadog.trace.api.InstrumenterConfig; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.util.ListIterator; @@ -33,7 +32,7 @@ public boolean hasPrevious() { if (InstrumenterConfig.get().isLegacyContextManagerEnabled()) { closePrevious(true); } else { - final AgentSpan previousSpan = spanFromContext(getRootContext().swap()); + final AgentSpan previousSpan = AgentSpan.fromContext(Context.root().swap()); if (previousSpan != null) { previousSpan.finishWithEndToEnd(); } diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/test/groovy/KafkaClientCustomPropagationConfigTest.groovy b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/test/groovy/KafkaClientCustomPropagationConfigTest.groovy index 124ba06ee62..98460601e5c 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/test/groovy/KafkaClientCustomPropagationConfigTest.groovy +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/test/groovy/KafkaClientCustomPropagationConfigTest.groovy @@ -5,7 +5,6 @@ import org.apache.kafka.clients.consumer.ConsumerRecord import org.apache.kafka.clients.producer.ProducerRecord import org.apache.kafka.common.header.Headers import org.apache.kafka.common.header.internals.RecordHeaders -import org.junit.Rule import org.springframework.kafka.core.DefaultKafkaConsumerFactory import org.springframework.kafka.core.DefaultKafkaProducerFactory import org.springframework.kafka.core.KafkaTemplate @@ -44,8 +43,16 @@ class KafkaClientCustomPropagationConfigTest extends InstrumentationSpecificatio return false } - @Rule - KafkaEmbedded embeddedKafka = new KafkaEmbedded(1, true, SHARED_TOPIC[0], SHARED_TOPIC[1], SHARED_TOPIC[2], SHARED_TOPIC[3]) + KafkaEmbedded embeddedKafka + + def setup() { + embeddedKafka = new KafkaEmbedded(1, true, SHARED_TOPIC[0], SHARED_TOPIC[1], SHARED_TOPIC[2], SHARED_TOPIC[3]) + embeddedKafka.before() + } + + def cleanup() { + embeddedKafka?.after() + } @Override void configurePreAgent() { @@ -90,7 +97,6 @@ class KafkaClientCustomPropagationConfigTest extends InstrumentationSpecificatio container1.setupMessageListener(new MessageListener() { @Override void onMessage(ConsumerRecord record) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces records1.add(record) } }) @@ -98,7 +104,6 @@ class KafkaClientCustomPropagationConfigTest extends InstrumentationSpecificatio container2.setupMessageListener(new MessageListener() { @Override void onMessage(ConsumerRecord record) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces records2.add(record) } }) @@ -106,7 +111,6 @@ class KafkaClientCustomPropagationConfigTest extends InstrumentationSpecificatio container3.setupMessageListener(new MessageListener() { @Override void onMessage(ConsumerRecord record) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces records3.add(record) } }) @@ -114,7 +118,6 @@ class KafkaClientCustomPropagationConfigTest extends InstrumentationSpecificatio container4.setupMessageListener(new MessageListener() { @Override void onMessage(ConsumerRecord record) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces records4.add(record) } }) @@ -195,7 +198,6 @@ class KafkaClientCustomPropagationConfigTest extends InstrumentationSpecificatio container1.setupMessageListener(new MessageListener() { @Override void onMessage(ConsumerRecord record) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces records1.add(activeSpan()) } }) @@ -203,7 +205,6 @@ class KafkaClientCustomPropagationConfigTest extends InstrumentationSpecificatio container2.setupMessageListener(new MessageListener() { @Override void onMessage(ConsumerRecord record) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces records2.add(activeSpan()) } }) @@ -211,7 +212,6 @@ class KafkaClientCustomPropagationConfigTest extends InstrumentationSpecificatio container3.setupMessageListener(new MessageListener() { @Override void onMessage(ConsumerRecord record) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces records3.add(activeSpan()) } }) @@ -219,7 +219,6 @@ class KafkaClientCustomPropagationConfigTest extends InstrumentationSpecificatio container4.setupMessageListener(new MessageListener() { @Override void onMessage(ConsumerRecord record) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces records4.add(activeSpan()) } }) diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/test/groovy/KafkaClientTestBase.groovy b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/test/groovy/KafkaClientTestBase.groovy index 1cf0d22160e..a3168dac5c1 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/test/groovy/KafkaClientTestBase.groovy +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/test/groovy/KafkaClientTestBase.groovy @@ -1,6 +1,7 @@ import datadog.trace.api.datastreams.DataStreamsTags import datadog.trace.api.datastreams.DataStreamsTransactionExtractor import datadog.trace.api.config.TraceInstrumentationConfig +import datadog.trace.api.config.TracerConfig import datadog.trace.instrumentation.kafka_common.ClusterIdHolder import static datadog.trace.agent.test.utils.TraceUtils.basicSpan @@ -8,6 +9,7 @@ import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.isAsyncPropagationEnabled +import datadog.trace.agent.test.InstrumentationSpecification import datadog.trace.agent.test.asserts.TraceAssert import datadog.trace.agent.test.naming.VersionedNamingTestBase import datadog.trace.api.Config @@ -31,7 +33,6 @@ import org.apache.kafka.common.header.internals.RecordHeaders import org.apache.kafka.common.serialization.StringSerializer import java.nio.charset.StandardCharsets -import org.junit.Rule import org.springframework.kafka.core.DefaultKafkaConsumerFactory import org.springframework.kafka.core.DefaultKafkaProducerFactory import org.springframework.kafka.core.KafkaTemplate @@ -51,8 +52,7 @@ import java.util.concurrent.TimeUnit abstract class KafkaClientTestBase extends VersionedNamingTestBase { static final SHARED_TOPIC = "shared.topic" - @Rule - KafkaEmbedded embeddedKafka = new KafkaEmbedded(1, true, SHARED_TOPIC) + KafkaEmbedded embeddedKafka @Override void configurePreAgent() { @@ -138,9 +138,15 @@ abstract class KafkaClientTestBase extends VersionedNamingTestBase { } def setup() { + embeddedKafka = new KafkaEmbedded(1, true, SHARED_TOPIC) + embeddedKafka.before() TEST_WRITER.setFilter(DROP_KAFKA_POLL) } + def cleanup() { + embeddedKafka?.after() + } + @Override int version() { 0 @@ -246,7 +252,6 @@ abstract class KafkaClientTestBase extends VersionedNamingTestBase { container.setupMessageListener(new MessageListener() { @Override void onMessage(ConsumerRecord record) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces records.add(record) } }) @@ -414,7 +419,6 @@ abstract class KafkaClientTestBase extends VersionedNamingTestBase { container.setupMessageListener(new MessageListener() { @Override void onMessage(ConsumerRecord record) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces records.add(record) } }) @@ -465,10 +469,13 @@ abstract class KafkaClientTestBase extends VersionedNamingTestBase { } } + // sort a snapshot so the producer trace is deterministically first, regardless of write order + def sortedTraces = new ArrayList<>(TEST_WRITER) + sortedTraces.sort(SORT_TRACES_BY_ID) def headers = received.headers() headers.iterator().hasNext() - new String(headers.headers("x-datadog-trace-id").iterator().next().value()) == "${TEST_WRITER[0][2].traceId}" - new String(headers.headers("x-datadog-parent-id").iterator().next().value()) == "${TEST_WRITER[0][2].spanId}" + new String(headers.headers("x-datadog-trace-id").iterator().next().value()) == "${sortedTraces[0][2].traceId}" + new String(headers.headers("x-datadog-parent-id").iterator().next().value()) == "${sortedTraces[0][2].spanId}" if (isDataStreamsEnabled()) { StatsGroup first = TEST_DATA_STREAMS_WRITER.groups.find { it.parentHash == 0 } @@ -547,7 +554,6 @@ abstract class KafkaClientTestBase extends VersionedNamingTestBase { container.setupMessageListener(new MessageListener() { @Override void onMessage(ConsumerRecord record) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces records.add(record) } }) @@ -883,7 +889,6 @@ abstract class KafkaClientTestBase extends VersionedNamingTestBase { container.setupMessageListener(new BatchMessageListener() { @Override void onMessage(List> consumerRecords) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces consumerRecords.each { records.add(it) } @@ -1020,7 +1025,6 @@ abstract class KafkaClientTestBase extends VersionedNamingTestBase { container.setupMessageListener(new MessageListener() { @Override void onMessage(ConsumerRecord record) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces records.add(record) if (isDataStreamsEnabled()) { // even if header propagation is disabled, we want data streams to work. @@ -1540,9 +1544,48 @@ class KafkaClientDataStreamsDisabledForkedTest extends KafkaClientTestBase { } class KafkaClientContextSwapForkedTest extends KafkaClientV0ForkedTest { - @Override void configurePreAgent() { super.configurePreAgent() injectSysConfig(TraceInstrumentationConfig.LEGACY_CONTEXT_MANAGER_ENABLED, "false") } } + +class KafkaClientBadBase64HeaderForkedTest extends InstrumentationSpecification { + KafkaEmbedded embeddedKafka + + def setup() { + embeddedKafka = new KafkaEmbedded(1, true, KafkaClientTestBase.SHARED_TOPIC) + embeddedKafka.before() + } + + def cleanup() { + embeddedKafka?.after() + } + + @Override + void configurePreAgent() { + super.configurePreAgent() + injectSysConfig(TraceInstrumentationConfig.KAFKA_CLIENT_BASE64_DECODING_ENABLED, "true") + injectSysConfig(TracerConfig.HEADER_TAGS, "x-custom-header:my.custom.tag") + } + + def "producer span is created when message carries non-Base64 headers and base64 decoding is enabled"() { + setup: + def senderProps = KafkaTestUtils.senderProps(embeddedKafka.getBrokersAsString()) + def producer = new KafkaProducer(senderProps, new StringSerializer(), new StringSerializer()) + + when: + def headers = new RecordHeaders([ + new RecordHeader("x-custom-header", "not-valid-base64!@#".getBytes(StandardCharsets.UTF_8)), + new RecordHeader("x-another-header", "also-not-base64!!".getBytes(StandardCharsets.UTF_8)) + ]) + producer.send(new ProducerRecord<>(KafkaClientTestBase.SHARED_TOPIC, 0, null, "hello", headers)).get() + + then: + TEST_WRITER.waitForTraces(1) + !TEST_WRITER.isEmpty() + + cleanup: + producer?.close() + } +} diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/test/groovy/KafkaReactorForkedTest.groovy b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/test/groovy/KafkaReactorForkedTest.groovy index eeba8f3998f..49ec8900712 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/test/groovy/KafkaReactorForkedTest.groovy +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/test/groovy/KafkaReactorForkedTest.groovy @@ -10,7 +10,6 @@ import org.apache.kafka.clients.consumer.ConsumerConfig import org.apache.kafka.clients.consumer.ConsumerRecord import org.apache.kafka.clients.producer.ProducerConfig import org.apache.kafka.clients.producer.ProducerRecord -import org.junit.Rule import org.springframework.kafka.test.rule.KafkaEmbedded import org.springframework.kafka.test.utils.KafkaTestUtils import reactor.core.publisher.Flux @@ -27,9 +26,8 @@ import java.util.concurrent.LinkedBlockingQueue import java.util.concurrent.TimeUnit class KafkaReactorForkedTest extends InstrumentationSpecification { - @Rule // create 4 partitions for more parallelism - KafkaEmbedded embeddedKafka = new KafkaEmbedded(1, true, 4, KafkaClientTestBase.SHARED_TOPIC) + KafkaEmbedded embeddedKafka @Override boolean useStrictTraceWrites() { @@ -37,9 +35,15 @@ class KafkaReactorForkedTest extends InstrumentationSpecification { } def setup() { + embeddedKafka = new KafkaEmbedded(1, true, 4, KafkaClientTestBase.SHARED_TOPIC) + embeddedKafka.before() TEST_WRITER.setFilter(KafkaClientTestBase.DROP_KAFKA_POLL) } + def cleanup() { + embeddedKafka?.after() + } + def "test reactive produce and consume"() { setup: def senderProps = KafkaTestUtils.senderProps(embeddedKafka.getBrokersAsString()) diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/test/groovy/TextMapExtractAdapterTest.groovy b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/test/groovy/TextMapExtractAdapterTest.groovy index 666a0d8357a..b2a8feb66da 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/test/groovy/TextMapExtractAdapterTest.groovy +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-0.11/src/test/groovy/TextMapExtractAdapterTest.groovy @@ -2,12 +2,11 @@ import com.google.common.io.BaseEncoding import datadog.trace.agent.test.InstrumentationSpecification import datadog.trace.bootstrap.instrumentation.api.AgentPropagation import datadog.trace.instrumentation.kafka_clients.TextMapExtractAdapter +import java.nio.charset.StandardCharsets import org.apache.kafka.common.header.Headers import org.apache.kafka.common.header.internals.RecordHeader import org.apache.kafka.common.header.internals.RecordHeaders -import java.nio.charset.StandardCharsets - class TextMapExtractAdapterTest extends InstrumentationSpecification { def "check can decode base64 mangled headers"() { @@ -32,4 +31,27 @@ class TextMapExtractAdapterTest extends InstrumentationSpecification { where: base64Decode << [true, false] } + + def "invalid base64 header is skipped and subsequent valid headers are still processed"() { + given: + def validBase64 = BaseEncoding.base64().encode("bar".getBytes(StandardCharsets.UTF_8)) + Headers headers = new RecordHeaders([ + new RecordHeader("bad-key", "not-valid-base64!@#".getBytes(StandardCharsets.UTF_8)), + new RecordHeader("good-key", validBase64.getBytes(StandardCharsets.UTF_8)) + ]) + TextMapExtractAdapter adapter = new TextMapExtractAdapter(true) + when: + Map extracted = [:] + adapter.forEachKey(headers, new AgentPropagation.KeyClassifier() { + @Override + boolean accept(String key, String value) { + extracted[key] = value + return true + } + }) + then: + noExceptionThrown() + !extracted.containsKey("bad-key") + extracted["good-key"] == "bar" + } } diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/gradle.lockfile b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/gradle.lockfile index 666d71e6640..2a237134d6a 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/gradle.lockfile +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:kafka:kafka-clients-3.8:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -10,7 +11,7 @@ ch.qos.logback:logback-core:1.3.15=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -23,17 +24,17 @@ com.fasterxml.jackson.module:jackson-module-scala_2.13:2.16.2=latestDepForkedTes com.fasterxml.jackson:jackson-bom:2.16.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.ben-manes.caffeine:caffeine:2.9.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.luben:zstd-jni:1.5.6-3=testRuntimeClasspath com.github.luben:zstd-jni:1.5.6-4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -41,15 +42,17 @@ com.google.auto.service:auto-service:1.1.1=annotationProcessor,latestDepForkedTe com.google.auto:auto-common:1.2.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs -com.google.errorprone:error_prone_annotations:2.10.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -70,12 +73,12 @@ commons-logging:commons-logging:1.2=latestDepForkedTestRuntimeClasspath,latestDe commons-validator:commons-validator:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.dropwizard.metrics:metrics-core:4.1.12.1=testRuntimeClasspath -io.dropwizard.metrics:metrics-core:4.2.38=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.dropwizard.metrics:metrics-core:4.2.39=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.micrometer:micrometer-commons:1.14.5=testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-commons:1.15.11=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micrometer:micrometer-commons:1.15.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micrometer:micrometer-observation:1.14.5=testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-observation:1.15.11=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micrometer:micrometer-observation:1.15.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-buffer:4.1.105.Final=testCompileClasspath,testRuntimeClasspath io.netty:netty-buffer:4.1.130.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec:4.1.105.Final=testCompileClasspath,testRuntimeClasspath @@ -94,15 +97,15 @@ io.netty:netty-transport-native-unix-common:4.1.105.Final=testCompileClasspath,t io.netty:netty-transport-native-unix-common:4.1.130.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.105.Final=testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.1.130.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.activation:activation:1.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.xml.bind:jaxb-api:2.2.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.xml.stream:stax-api:1.0-2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.jopt-simple:jopt-simple:5.0.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -166,6 +169,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepForkedTestRuntimeClasspath,latestDepTest org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -185,14 +189,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.pcollections:pcollections:4.0.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.rocksdb:rocksdbjni:7.9.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.scala-lang.modules:scala-collection-compat_2.13:2.10.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -211,29 +215,29 @@ org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath org.spockframework:spock-bom:2.4-groovy-3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework.kafka:spring-kafka-test:3.3.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.kafka:spring-kafka-test:3.3.16=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.kafka:spring-kafka-test:3.3.4=testCompileClasspath,testRuntimeClasspath -org.springframework.kafka:spring-kafka:3.3.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.kafka:spring-kafka:3.3.16=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.kafka:spring-kafka:3.3.4=testCompileClasspath,testRuntimeClasspath org.springframework.retry:spring-retry:2.0.11=testCompileClasspath,testRuntimeClasspath -org.springframework.retry:spring-retry:2.0.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.springframework:spring-aop:6.2.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.retry:spring-retry:2.0.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-aop:6.2.19=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-aop:6.2.4=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-beans:6.2.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-beans:6.2.19=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-beans:6.2.4=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-context:6.2.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-context:6.2.19=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-context:6.2.4=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-core:6.2.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-core:6.2.19=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-core:6.2.4=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-expression:6.2.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-expression:6.2.19=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-expression:6.2.4=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-jcl:6.2.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-jcl:6.2.19=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-jcl:6.2.4=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-messaging:6.2.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-messaging:6.2.19=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-messaging:6.2.4=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-test:6.2.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-test:6.2.19=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-test:6.2.4=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-tx:6.2.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-tx:6.2.19=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-tx:6.2.4=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-junit:1.2.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/KafkaConsumerInstrumentationHelper.java b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/KafkaConsumerInstrumentationHelper.java index 11c020e78e3..57e0baa7edd 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/KafkaConsumerInstrumentationHelper.java +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/KafkaConsumerInstrumentationHelper.java @@ -2,12 +2,13 @@ import datadog.trace.bootstrap.ContextStore; import datadog.trace.instrumentation.kafka_common.MetadataState; +import java.util.Optional; import org.apache.kafka.clients.Metadata; public class KafkaConsumerInstrumentationHelper { public static String extractGroup(KafkaConsumerInfo kafkaConsumerInfo) { if (kafkaConsumerInfo != null) { - return kafkaConsumerInfo.getConsumerGroup().get(); + return kafkaConsumerInfo.getConsumerGroup().orElse(null); } return null; } @@ -16,9 +17,9 @@ public static String extractClusterId( KafkaConsumerInfo kafkaConsumerInfo, ContextStore metadataContextStore) { if (kafkaConsumerInfo != null) { - Metadata metadata = kafkaConsumerInfo.getmetadata().get(); - if (metadata != null) { - MetadataState state = metadataContextStore.get(metadata); + Optional metadata = kafkaConsumerInfo.getmetadata(); + if (metadata.isPresent()) { + MetadataState state = metadataContextStore.get(metadata.get()); return state != null ? state.clusterId : null; } } @@ -26,6 +27,6 @@ public static String extractClusterId( } public static String extractBootstrapServers(KafkaConsumerInfo kafkaConsumerInfo) { - return kafkaConsumerInfo == null ? null : kafkaConsumerInfo.getBootstrapServers().get(); + return kafkaConsumerInfo == null ? null : kafkaConsumerInfo.getBootstrapServers().orElse(null); } } diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/KafkaProducerCallback.java b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/KafkaProducerCallback.java index 898508dc541..dd7bb52989c 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/KafkaProducerCallback.java +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/KafkaProducerCallback.java @@ -5,8 +5,8 @@ import static datadog.trace.bootstrap.instrumentation.api.InstrumentationTags.PARTITION; import static datadog.trace.instrumentation.kafka_clients38.KafkaDecorator.PRODUCER_DECORATE; +import datadog.context.ContextScope; import datadog.trace.api.datastreams.DataStreamsTags; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; import org.apache.kafka.clients.producer.Callback; @@ -40,7 +40,7 @@ public void onCompletion(final RecordMetadata metadata, final Exception exceptio span.finish(); if (callback != null) { if (parent != null) { - try (final AgentScope scope = activateSpan(parent)) { + try (final ContextScope scope = activateSpan(parent)) { callback.onCompletion(metadata, exception); } } else { diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/PayloadSizeAdvice.java b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/PayloadSizeAdvice.java index 7db4e95e711..3b4effb3979 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/PayloadSizeAdvice.java +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/PayloadSizeAdvice.java @@ -15,7 +15,7 @@ public class PayloadSizeAdvice { */ @Advice.OnMethodEnter(suppress = Throwable.class) public static void onEnter(@Advice.Argument(value = 0) int estimatedPayloadSize) { - StatsPoint saved = activeSpan().context().getPathwayContext().getSavedStats(); + StatsPoint saved = activeSpan().spanContext().getPathwayContext().getSavedStats(); if (saved != null) { // create new stats including the payload size StatsPoint updated = diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/RecordsAdvice.java b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/RecordsAdvice.java index 156c6d1f1fa..b8f3dff049a 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/RecordsAdvice.java +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/RecordsAdvice.java @@ -17,6 +17,7 @@ import org.apache.kafka.clients.Metadata; import org.apache.kafka.clients.consumer.ConsumerRecords; import org.apache.kafka.clients.consumer.internals.ConsumerDelegate; +import org.apache.kafka.common.errors.WakeupException; /** * this method transfers the consumer group from the KafkaConsumer class key to the ConsumerRecords @@ -45,11 +46,12 @@ public static AgentScope onEnter(@Advice.This ConsumerDelegate consumer) { return null; } - @Advice.OnMethodExit(suppress = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void captureGroup( @Advice.Enter final AgentScope scope, @Advice.This ConsumerDelegate consumer, - @Advice.Return ConsumerRecords records) { + @Advice.Return ConsumerRecords records, + @Advice.Thrown Throwable throwable) { int recordsCount = 0; if (records != null) { // new - we are getting the KafkaConsumerInfo from the ConsumerDelegate instead of @@ -70,7 +72,10 @@ public static void captureGroup( } AgentSpan span = scope.span(); span.setTag(KAFKA_RECORDS_COUNT, recordsCount); - span.finish(); + if (!(throwable instanceof WakeupException)) { + span.addThrowable(throwable); + } scope.close(); + span.finish(); } } diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/TextMapExtractAdapter.java b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/TextMapExtractAdapter.java index a7523885e60..30b35216a4b 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/TextMapExtractAdapter.java +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/TextMapExtractAdapter.java @@ -1,12 +1,15 @@ package datadog.trace.instrumentation.kafka_clients38; -import static java.nio.charset.StandardCharsets.UTF_8; +import static datadog.trace.api.Functions.BASE64_DECODE; +import static datadog.trace.api.Functions.UTF8_BYTES_TO_STRING; +import static datadog.trace.api.telemetry.LogCollector.EXCLUDE_TELEMETRY; import datadog.trace.api.Config; import datadog.trace.bootstrap.instrumentation.api.AgentPropagation; import datadog.trace.bootstrap.instrumentation.api.AgentPropagation.ContextVisitor; import java.nio.ByteBuffer; import java.util.Base64; +import java.util.function.Function; import org.apache.kafka.common.header.Header; import org.apache.kafka.common.header.Headers; import org.slf4j.Logger; @@ -18,10 +21,17 @@ public class TextMapExtractAdapter implements ContextVisitor { public static final TextMapExtractAdapter GETTER = new TextMapExtractAdapter(Config.get().isKafkaClientBase64DecodingEnabled()); - private final Base64.Decoder base64; + private final Function headerValueTransformer; + private final Base64.Decoder decoder; - public TextMapExtractAdapter(boolean base64DecodeHeaders) { - this.base64 = base64DecodeHeaders ? Base64.getDecoder() : null; + public TextMapExtractAdapter(boolean decodeBase64Headers) { + if (decodeBase64Headers) { + this.headerValueTransformer = BASE64_DECODE; + this.decoder = Base64.getDecoder(); + } else { + this.headerValueTransformer = UTF8_BYTES_TO_STRING; + this.decoder = null; + } } @Override @@ -32,10 +42,12 @@ public void forEachKey(Headers carrier, AgentPropagation.KeyClassifier classifie if (null == value) { continue; } - if (base64 != null) { - value = base64.decode(value); + String decoded = headerValueTransformer.apply(value); + if (decoded == null) { + log.debug(EXCLUDE_TELEMETRY, "Failed to Base64-decode Kafka header '{}', skipping", key); + continue; } - if (!classifier.accept(key, new String(value, UTF_8))) { + if (!classifier.accept(key, decoded)) { return; } } @@ -46,11 +58,11 @@ public long extractTimeInQueueStart(Headers carrier) { if (null != header) { try { ByteBuffer buf = ByteBuffer.allocate(8); - buf.put(base64 != null ? base64.decode(header.value()) : header.value()); + buf.put(decoder != null ? decoder.decode(header.value()) : header.value()); buf.flip(); return buf.getLong(); } catch (Exception e) { - log.debug("Unable to get kafka produced time", e); + log.debug(EXCLUDE_TELEMETRY, "Unable to get kafka produced time", e); } } return 0; diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/TracingIterator.java b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/TracingIterator.java index eb1f0633908..7beba848473 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/TracingIterator.java +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/TracingIterator.java @@ -9,13 +9,12 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.closePrevious; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.traceConfig; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.kafka_clients38.KafkaDecorator.JAVA_KAFKA; import static datadog.trace.instrumentation.kafka_clients38.TextMapExtractAdapter.GETTER; import static datadog.trace.instrumentation.kafka_clients38.TextMapInjectAdapter.SETTER; import static java.util.concurrent.TimeUnit.MILLISECONDS; +import datadog.context.Context; import datadog.context.propagation.Propagator; import datadog.context.propagation.Propagators; import datadog.trace.api.Config; @@ -68,7 +67,7 @@ public boolean hasNext() { if (InstrumenterConfig.get().isLegacyContextManagerEnabled()) { closePrevious(true); } else { - final AgentSpan previousSpan = spanFromContext(getRootContext().swap()); + final AgentSpan previousSpan = AgentSpan.fromContext(Context.root().swap()); if (previousSpan != null) { previousSpan.finishWithEndToEnd(); } @@ -89,7 +88,7 @@ protected void startNewRecordSpan(ConsumerRecord val) { if (InstrumenterConfig.get().isLegacyContextManagerEnabled()) { closePrevious(true); } else if (val == null) { // previous message span was the last - final AgentSpan previousSpan = spanFromContext(getRootContext().swap()); + final AgentSpan previousSpan = AgentSpan.fromContext(Context.root().swap()); if (previousSpan != null) { previousSpan.finishWithEndToEnd(); } @@ -111,7 +110,7 @@ protected void startNewRecordSpan(ConsumerRecord val) { MILLISECONDS.toMicros(timeInQueueStart)); KafkaDecorator.BROKER_DECORATE.afterStart(queueSpan); KafkaDecorator.BROKER_DECORATE.onTimeInQueue(queueSpan, val); - span = startSpan(JAVA_KAFKA.toString(), operationName, queueSpan.context()); + span = startSpan(JAVA_KAFKA.toString(), operationName, queueSpan.spanContext()); KafkaDecorator.BROKER_DECORATE.beforeFinish(queueSpan); // The queueSpan will be finished after inner span has been activated to ensure that // spans are written out together by TraceStructureWriter when running in strict mode @@ -147,7 +146,7 @@ protected void startNewRecordSpan(ConsumerRecord val) { if (InstrumenterConfig.get().isLegacyContextManagerEnabled()) { activateNext(span); } else { - final AgentSpan previousSpan = spanFromContext(span.swap()); + final AgentSpan previousSpan = AgentSpan.fromContext(span.swap()); if (previousSpan != null) { previousSpan.finishWithEndToEnd(); } diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/TracingListIterator.java b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/TracingListIterator.java index 5d52061f884..3b17006d562 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/TracingListIterator.java +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/main/java17/datadog/trace/instrumentation/kafka_clients38/TracingListIterator.java @@ -1,9 +1,8 @@ package datadog.trace.instrumentation.kafka_clients38; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.closePrevious; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; +import datadog.context.Context; import datadog.trace.api.InstrumenterConfig; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.util.ListIterator; @@ -33,7 +32,7 @@ public boolean hasPrevious() { if (InstrumenterConfig.get().isLegacyContextManagerEnabled()) { closePrevious(true); } else { - final AgentSpan previousSpan = spanFromContext(getRootContext().swap()); + final AgentSpan previousSpan = AgentSpan.fromContext(Context.root().swap()); if (previousSpan != null) { previousSpan.finishWithEndToEnd(); } diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/test/groovy/KafkaClientCustomPropagationConfigTest.groovy b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/test/groovy/KafkaClientCustomPropagationConfigTest.groovy index 787bb5930f5..0dec7bbe6bc 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/test/groovy/KafkaClientCustomPropagationConfigTest.groovy +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/test/groovy/KafkaClientCustomPropagationConfigTest.groovy @@ -101,7 +101,6 @@ class KafkaClientCustomPropagationConfigTest extends InstrumentationSpecificatio container1.setupMessageListener(new MessageListener() { @Override void onMessage(ConsumerRecord record) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces records1.add(record) } }) @@ -109,7 +108,6 @@ class KafkaClientCustomPropagationConfigTest extends InstrumentationSpecificatio container2.setupMessageListener(new MessageListener() { @Override void onMessage(ConsumerRecord record) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces records2.add(record) } }) @@ -117,7 +115,6 @@ class KafkaClientCustomPropagationConfigTest extends InstrumentationSpecificatio container3.setupMessageListener(new MessageListener() { @Override void onMessage(ConsumerRecord record) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces records3.add(record) } }) @@ -125,7 +122,6 @@ class KafkaClientCustomPropagationConfigTest extends InstrumentationSpecificatio container4.setupMessageListener(new MessageListener() { @Override void onMessage(ConsumerRecord record) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces records4.add(record) } }) @@ -205,7 +201,6 @@ class KafkaClientCustomPropagationConfigTest extends InstrumentationSpecificatio container1.setupMessageListener(new MessageListener() { @Override void onMessage(ConsumerRecord record) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces records1.add(activeSpan()) } }) @@ -213,7 +208,6 @@ class KafkaClientCustomPropagationConfigTest extends InstrumentationSpecificatio container2.setupMessageListener(new MessageListener() { @Override void onMessage(ConsumerRecord record) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces records2.add(activeSpan()) } }) @@ -221,7 +215,6 @@ class KafkaClientCustomPropagationConfigTest extends InstrumentationSpecificatio container3.setupMessageListener(new MessageListener() { @Override void onMessage(ConsumerRecord record) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces records3.add(activeSpan()) } }) @@ -229,7 +222,6 @@ class KafkaClientCustomPropagationConfigTest extends InstrumentationSpecificatio container4.setupMessageListener(new MessageListener() { @Override void onMessage(ConsumerRecord record) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces records4.add(activeSpan()) } }) diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/test/groovy/KafkaClientTestBase.groovy b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/test/groovy/KafkaClientTestBase.groovy index 0e10388a8d2..a3f451f126d 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/test/groovy/KafkaClientTestBase.groovy +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/test/groovy/KafkaClientTestBase.groovy @@ -1,7 +1,9 @@ +import datadog.trace.agent.test.InstrumentationSpecification import datadog.trace.agent.test.asserts.TraceAssert import datadog.trace.agent.test.naming.VersionedNamingTestBase import datadog.trace.api.Config import datadog.trace.api.config.TraceInstrumentationConfig +import datadog.trace.api.config.TracerConfig import datadog.trace.api.DDTags import datadog.trace.api.datastreams.DataStreamsTags import datadog.trace.bootstrap.instrumentation.api.InstrumentationTags @@ -188,7 +190,6 @@ abstract class KafkaClientTestBase extends VersionedNamingTestBase { container.setupMessageListener(new MessageListener() { @Override void onMessage(ConsumerRecord record) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces records.add(record) } }) @@ -347,7 +348,6 @@ abstract class KafkaClientTestBase extends VersionedNamingTestBase { container.setupMessageListener(new MessageListener() { @Override void onMessage(ConsumerRecord record) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces records.add(record) } }) @@ -402,10 +402,13 @@ abstract class KafkaClientTestBase extends VersionedNamingTestBase { } } + // sort a snapshot so the producer trace is deterministically first, regardless of write order + def sortedTraces = new ArrayList<>(TEST_WRITER) + sortedTraces.sort(SORT_TRACES_BY_ID) def headers = received.headers() headers.iterator().hasNext() - new String(headers.headers("x-datadog-trace-id").iterator().next().value()) == "${TEST_WRITER[0][2].traceId}" - new String(headers.headers("x-datadog-parent-id").iterator().next().value()) == "${TEST_WRITER[0][2].spanId}" + new String(headers.headers("x-datadog-trace-id").iterator().next().value()) == "${sortedTraces[0][2].traceId}" + new String(headers.headers("x-datadog-parent-id").iterator().next().value()) == "${sortedTraces[0][2].spanId}" if (isDataStreamsEnabled()) { StatsGroup first = TEST_DATA_STREAMS_WRITER.groups.find { it.parentHash == 0 } @@ -478,7 +481,6 @@ abstract class KafkaClientTestBase extends VersionedNamingTestBase { container.setupMessageListener(new MessageListener() { @Override void onMessage(ConsumerRecord record) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces records.add(record) } }) @@ -822,7 +824,6 @@ abstract class KafkaClientTestBase extends VersionedNamingTestBase { container.setupMessageListener(new MessageListener() { @Override void onMessage(ConsumerRecord record) { - TEST_WRITER.waitForTraces(1) // ensure consistent ordering of traces records.add(record) if (isDataStreamsEnabled()) { // even if header propagation is disabled, we want data streams to work. @@ -1210,9 +1211,48 @@ class KafkaClientDataStreamsDisabledForkedTest extends KafkaClientTestBase { } class KafkaClientContextSwapForkedTest extends KafkaClientV0ForkedTest { - @Override void configurePreAgent() { super.configurePreAgent() injectSysConfig(TraceInstrumentationConfig.LEGACY_CONTEXT_MANAGER_ENABLED, "false") } } + +class KafkaClientBadBase64HeaderForkedTest extends InstrumentationSpecification { + EmbeddedKafkaBroker embeddedKafka + + def setup() { + embeddedKafka = new EmbeddedKafkaKraftBroker(1, 2, KafkaClientTestBase.SHARED_TOPIC) + embeddedKafka.afterPropertiesSet() + } + + def cleanup() { + embeddedKafka.destroy() + } + + @Override + void configurePreAgent() { + super.configurePreAgent() + injectSysConfig(TraceInstrumentationConfig.KAFKA_CLIENT_BASE64_DECODING_ENABLED, "true") + injectSysConfig(TracerConfig.HEADER_TAGS, "x-custom-header:my.custom.tag") + } + + def "producer span is created when message carries non-Base64 headers and base64 decoding is enabled"() { + setup: + def producerProps = KafkaTestUtils.producerProps(embeddedKafka.getBrokersAsString()) + def producer = new KafkaProducer(producerProps, new StringSerializer(), new StringSerializer()) + + when: + def headers = new RecordHeaders([ + new RecordHeader("x-custom-header", "not-valid-base64!@#".getBytes(StandardCharsets.UTF_8)), + new RecordHeader("x-another-header", "also-not-base64!!".getBytes(StandardCharsets.UTF_8)) + ]) + producer.send(new ProducerRecord<>(KafkaClientTestBase.SHARED_TOPIC, 0, null, "hello", headers)).get() + + then: + TEST_WRITER.waitForTraces(1) + !TEST_WRITER.isEmpty() + + cleanup: + producer?.close() + } +} diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/test/groovy/TextMapExtractAdapterTest.groovy b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/test/groovy/TextMapExtractAdapterTest.groovy index 103e2ed95ba..e0d155f588e 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/test/groovy/TextMapExtractAdapterTest.groovy +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/test/groovy/TextMapExtractAdapterTest.groovy @@ -2,12 +2,11 @@ import com.google.common.io.BaseEncoding import datadog.trace.agent.test.InstrumentationSpecification import datadog.trace.bootstrap.instrumentation.api.AgentPropagation import datadog.trace.instrumentation.kafka_clients38.TextMapExtractAdapter +import java.nio.charset.StandardCharsets import org.apache.kafka.common.header.Headers import org.apache.kafka.common.header.internals.RecordHeader import org.apache.kafka.common.header.internals.RecordHeaders -import java.nio.charset.StandardCharsets - class TextMapExtractAdapterTest extends InstrumentationSpecification { def "check can decode base64 mangled headers"() { @@ -32,4 +31,27 @@ class TextMapExtractAdapterTest extends InstrumentationSpecification { where: base64Decode << [true, false] } + + def "invalid base64 header is skipped and subsequent valid headers are still processed"() { + given: + def validBase64 = BaseEncoding.base64().encode("bar".getBytes(StandardCharsets.UTF_8)) + Headers headers = new RecordHeaders([ + new RecordHeader("bad-key", "not-valid-base64!@#".getBytes(StandardCharsets.UTF_8)), + new RecordHeader("good-key", validBase64.getBytes(StandardCharsets.UTF_8)) + ]) + TextMapExtractAdapter adapter = new TextMapExtractAdapter(true) + when: + Map extracted = [:] + adapter.forEachKey(headers, new AgentPropagation.KeyClassifier() { + @Override + boolean accept(String key, String value) { + extracted[key] = value + return true + } + }) + then: + noExceptionThrown() + !extracted.containsKey("bad-key") + extracted["good-key"] == "bar" + } } diff --git a/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/test/java/datadog/trace/instrumentation/kafka_clients38/KafkaConsumerInstrumentationHelperTest.java b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/test/java/datadog/trace/instrumentation/kafka_clients38/KafkaConsumerInstrumentationHelperTest.java new file mode 100644 index 00000000000..dee19831317 --- /dev/null +++ b/dd-java-agent/instrumentation/kafka/kafka-clients-3.8/src/test/java/datadog/trace/instrumentation/kafka_clients38/KafkaConsumerInstrumentationHelperTest.java @@ -0,0 +1,94 @@ +package datadog.trace.instrumentation.kafka_clients38; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import datadog.trace.bootstrap.ContextStore; +import datadog.trace.instrumentation.kafka_common.MetadataState; +import org.apache.kafka.clients.Metadata; +import org.junit.jupiter.api.Test; + +class KafkaConsumerInstrumentationHelperTest { + + @SuppressWarnings("unchecked") + private final ContextStore metadataContextStore = + mock(ContextStore.class); + + @Test + void extractGroupReturnsNullForNullKafkaConsumerInfo() { + assertNull(KafkaConsumerInstrumentationHelper.extractGroup(null)); + } + + @Test + void extractGroupReturnsNullWhenConsumerGroupIsNull() { + KafkaConsumerInfo kafkaConsumerInfo = new KafkaConsumerInfo(null, null, "localhost:9092"); + assertNull(KafkaConsumerInstrumentationHelper.extractGroup(kafkaConsumerInfo)); + } + + @Test + void extractGroupReturnsConsumerGroupWhenPresent() { + KafkaConsumerInfo kafkaConsumerInfo = + new KafkaConsumerInfo("test-group", null, "localhost:9092"); + assertEquals("test-group", KafkaConsumerInstrumentationHelper.extractGroup(kafkaConsumerInfo)); + } + + @Test + void extractBootstrapServersReturnsNullForNullKafkaConsumerInfo() { + assertNull(KafkaConsumerInstrumentationHelper.extractBootstrapServers(null)); + } + + @Test + void extractBootstrapServersReturnsNullWhenBootstrapServersIsNull() { + KafkaConsumerInfo kafkaConsumerInfo = new KafkaConsumerInfo("test-group", null, null); + assertNull(KafkaConsumerInstrumentationHelper.extractBootstrapServers(kafkaConsumerInfo)); + } + + @Test + void extractBootstrapServersReturnsValueWhenPresent() { + KafkaConsumerInfo kafkaConsumerInfo = + new KafkaConsumerInfo("test-group", null, "localhost:9092"); + assertEquals( + "localhost:9092", + KafkaConsumerInstrumentationHelper.extractBootstrapServers(kafkaConsumerInfo)); + } + + @Test + void extractClusterIdReturnsNullForNullKafkaConsumerInfo() { + assertNull(KafkaConsumerInstrumentationHelper.extractClusterId(null, metadataContextStore)); + } + + @Test + void extractClusterIdReturnsNullWhenMetadataIsNull() { + KafkaConsumerInfo kafkaConsumerInfo = new KafkaConsumerInfo("test-group", "localhost:9092"); + assertNull( + KafkaConsumerInstrumentationHelper.extractClusterId( + kafkaConsumerInfo, metadataContextStore)); + } + + @Test + void extractClusterIdReturnsNullWhenNoStateForMetadata() { + Metadata metadata = mock(Metadata.class); + KafkaConsumerInfo kafkaConsumerInfo = + new KafkaConsumerInfo("test-group", metadata, "localhost:9092"); + when(metadataContextStore.get(metadata)).thenReturn(null); + assertNull( + KafkaConsumerInstrumentationHelper.extractClusterId( + kafkaConsumerInfo, metadataContextStore)); + } + + @Test + void extractClusterIdReturnsClusterIdWhenStatePresent() { + Metadata metadata = mock(Metadata.class); + KafkaConsumerInfo kafkaConsumerInfo = + new KafkaConsumerInfo("test-group", metadata, "localhost:9092"); + MetadataState state = new MetadataState(); + state.clusterId = "cluster-1"; + when(metadataContextStore.get(metadata)).thenReturn(state); + assertEquals( + "cluster-1", + KafkaConsumerInstrumentationHelper.extractClusterId( + kafkaConsumerInfo, metadataContextStore)); + } +} diff --git a/dd-java-agent/instrumentation/kafka/kafka-common/gradle.lockfile b/dd-java-agent/instrumentation/kafka/kafka-common/gradle.lockfile index f69de99e52d..cfc74c48527 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-common/gradle.lockfile +++ b/dd-java-agent/instrumentation/kafka/kafka-common/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:kafka:kafka-common:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.jpountz.lz4:lz4:1.3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath @@ -83,6 +87,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -100,14 +105,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/kafka/kafka-connect-0.11/build.gradle b/dd-java-agent/instrumentation/kafka/kafka-connect-0.11/build.gradle index ea6a02a9457..57745940c19 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-connect-0.11/build.gradle +++ b/dd-java-agent/instrumentation/kafka/kafka-connect-0.11/build.gradle @@ -4,21 +4,43 @@ muzzle { module = "connect-runtime" versions = "[0.11.0.0,)" javaVersion = "17" - // broken POMs: depend on non-existent org.eclipse.jetty:jetty-server:9.4.59 + // broken POMs: depend on non-existent org.eclipse.jetty:*:9.4.NN (7.x lines only; 8.x uses jetty 12) // can be fixed after https://github.com/confluentinc/kafka-connect-storage-common/issues/468 is resolved skipVersions += [ '7.4.14-ce', '7.4.14-ccs', + '7.4.15-ce', + '7.4.15-ccs', '7.5.13-ce', '7.5.13-ccs', + '7.5.14-ce', + '7.5.14-ccs', + '7.5.15-ce', + '7.5.15-ccs', '7.6.10-ce', '7.6.10-ccs', + '7.6.11-ce', + '7.6.11-ccs', + '7.6.12-ce', + '7.6.12-ccs', '7.7.8-ce', '7.7.8-ccs', + '7.7.9-ce', + '7.7.9-ccs', + '7.7.10-ce', + '7.7.10-ccs', '7.8.7-ce', '7.8.7-ccs', + '7.8.8-ce', + '7.8.8-ccs', + '7.8.9-ce', + '7.8.9-ccs', '7.9.6-ce', - '7.9.6-ccs' + '7.9.6-ccs', + '7.9.7-ce', + '7.9.7-ccs', + '7.9.8-ce', + '7.9.8-ccs' ] excludeDependency "io.confluent.cloud:*" excludeDependency "io.confluent.observability:*" diff --git a/dd-java-agent/instrumentation/kafka/kafka-connect-0.11/gradle.lockfile b/dd-java-agent/instrumentation/kafka/kafka-connect-0.11/gradle.lockfile index b6adedd6990..67bc6ba9dcc 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-connect-0.11/gradle.lockfile +++ b/dd-java-agent/instrumentation/kafka/kafka-connect-0.11/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:kafka:kafka-connect-0.11:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -29,16 +30,16 @@ com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.8.5=compileClassp com.fasterxml.jackson.module:jackson-module-scala_2.13:2.20.0=testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.20.0=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath com.github.luben:zstd-jni:1.4.5-6=testCompileClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -48,12 +49,16 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:20.0=compileClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -76,7 +81,7 @@ io.netty:netty-resolver:4.1.50.Final=testCompileClasspath,testRuntimeClasspath io.netty:netty-transport-native-epoll:4.1.50.Final=testCompileClasspath,testRuntimeClasspath io.netty:netty-transport-native-unix-common:4.1.50.Final=testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.1.50.Final=testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath jakarta.activation:jakarta.activation-api:1.2.2=testCompileClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=testCompileClasspath,testRuntimeClasspath jakarta.validation:jakarta.validation-api:2.0.2=testCompileClasspath,testRuntimeClasspath @@ -92,8 +97,8 @@ javax.xml.bind:jaxb-api:2.3.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath log4j:log4j:1.2.17=compileClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.jpountz.lz4:lz4:1.3.0=compileClasspath @@ -197,6 +202,7 @@ org.javassist:javassist:3.21.0-GA=compileClasspath org.javassist:javassist:3.26.0-GA=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -216,14 +222,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reflections:reflections:0.9.11=compileClasspath org.reflections:reflections:0.9.12=testCompileClasspath,testRuntimeClasspath org.rocksdb:rocksdbjni:5.18.4=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/kafka/kafka-streams-0.11/build.gradle b/dd-java-agent/instrumentation/kafka/kafka-streams-0.11/build.gradle index 0ab6b30ad7f..0fdffd3d57d 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-streams-0.11/build.gradle +++ b/dd-java-agent/instrumentation/kafka/kafka-streams-0.11/build.gradle @@ -24,9 +24,6 @@ dependencies { testImplementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.2.3' testImplementation group: 'org.mockito', name: 'mockito-core', version: '2.19.0' - // This module still needs Spock with JUnit4. - testImplementation(libs.spock.junit4) - // Include latest version of kafka itself along with latest version of client libs. // This seems to help with jar compatibility hell. latestDepTestImplementation group: 'org.apache.kafka', name: 'kafka_2.13', version: '2.+' diff --git a/dd-java-agent/instrumentation/kafka/kafka-streams-0.11/gradle.lockfile b/dd-java-agent/instrumentation/kafka/kafka-streams-0.11/gradle.lockfile index aa2837390a0..dda9057127b 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-streams-0.11/gradle.lockfile +++ b/dd-java-agent/instrumentation/kafka/kafka-streams-0.11/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:kafka:kafka-streams-0.11:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -9,7 +10,7 @@ com.101tec:zkclient:0.10=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -24,16 +25,16 @@ com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.10.5=latestDepTestCompile com.fasterxml.jackson.module:jackson-module-paranamer:2.10.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.module:jackson-module-scala_2.13:2.10.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.luben:zstd-jni:1.4.9-1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -43,12 +44,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -72,16 +76,17 @@ io.netty:netty-resolver:4.1.50.Final=latestDepTestCompileClasspath,latestDepTest io.netty:netty-transport-native-epoll:4.1.50.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport-native-unix-common:4.1.50.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.50.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.activation:activation:1.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.xml.bind:jaxb-api:2.2.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.xml.stream:stax-api:1.0-2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -junit:junit:4.13.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +junit:junit:4.12=testCompileClasspath +junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath log4j:log4j:1.2.16=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.jpountz.lz4:lz4:1.3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath @@ -127,10 +132,11 @@ org.codehaus.groovy:groovy:3.0.25=latestDepTestCompileClasspath,latestDepTestRun org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc -org.hamcrest:hamcrest-core:1.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -150,14 +156,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.rocksdb:rocksdbjni:5.0.1=compileClasspath,testCompileClasspath,testRuntimeClasspath org.rocksdb:rocksdbjni:5.18.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.scala-lang.modules:scala-collection-compat_2.13:2.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -176,7 +182,6 @@ org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath org.spockframework:spock-bom:2.4-groovy-3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.spockframework:spock-junit4:2.4-groovy-3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.springframework.kafka:spring-kafka-test:1.3.3.RELEASE=testCompileClasspath,testRuntimeClasspath org.springframework.kafka:spring-kafka-test:2.7.14=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.kafka:spring-kafka:1.3.3.RELEASE=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/kafka/kafka-streams-0.11/src/latestDepTest/groovy/KafkaStreamsTest.groovy b/dd-java-agent/instrumentation/kafka/kafka-streams-0.11/src/latestDepTest/groovy/KafkaStreamsTest.groovy index 7300c486be0..49c04c57bae 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-streams-0.11/src/latestDepTest/groovy/KafkaStreamsTest.groovy +++ b/dd-java-agent/instrumentation/kafka/kafka-streams-0.11/src/latestDepTest/groovy/KafkaStreamsTest.groovy @@ -12,7 +12,6 @@ import org.apache.kafka.streams.StreamsConfig import org.apache.kafka.streams.kstream.KStream import org.apache.kafka.streams.kstream.Produced import org.apache.kafka.streams.kstream.ValueMapper -import org.junit.ClassRule import org.springframework.kafka.core.DefaultKafkaConsumerFactory import org.springframework.kafka.core.DefaultKafkaProducerFactory import org.springframework.kafka.core.KafkaTemplate @@ -20,7 +19,6 @@ import org.springframework.kafka.listener.ContainerProperties import org.springframework.kafka.listener.KafkaMessageListenerContainer import org.springframework.kafka.listener.MessageListener import org.springframework.kafka.test.EmbeddedKafkaBroker -import org.springframework.kafka.test.rule.EmbeddedKafkaRule import org.springframework.kafka.test.utils.ContainerTestUtils import org.springframework.kafka.test.utils.KafkaTestUtils import spock.lang.Shared @@ -34,10 +32,16 @@ class KafkaStreamsTest extends InstrumentationSpecification { static final STREAM_PROCESSED = "test.processed" @Shared - @ClassRule - EmbeddedKafkaRule kafkaRule = new EmbeddedKafkaRule(1, true, 1, STREAM_PENDING, STREAM_PROCESSED) - @Shared - EmbeddedKafkaBroker embeddedKafka = kafkaRule.embeddedKafka + private EmbeddedKafkaBroker embeddedKafka + + def setupSpec() { + embeddedKafka = new EmbeddedKafkaBroker(1, true, 1, STREAM_PENDING, STREAM_PROCESSED) + embeddedKafka.afterPropertiesSet() + } + + def cleanupSpec() { + embeddedKafka?.destroy() + } @Override protected boolean isDataStreamsEnabled() { diff --git a/dd-java-agent/instrumentation/kafka/kafka-streams-0.11/src/main/java/datadog/trace/instrumentation/kafka_streams/KafkaStreamTaskInstrumentation.java b/dd-java-agent/instrumentation/kafka/kafka-streams-0.11/src/main/java/datadog/trace/instrumentation/kafka_streams/KafkaStreamTaskInstrumentation.java index 26da9ec0018..81ddfd4202f 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-streams-0.11/src/main/java/datadog/trace/instrumentation/kafka_streams/KafkaStreamTaskInstrumentation.java +++ b/dd-java-agent/instrumentation/kafka/kafka-streams-0.11/src/main/java/datadog/trace/instrumentation/kafka_streams/KafkaStreamTaskInstrumentation.java @@ -10,7 +10,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.traceConfig; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static datadog.trace.instrumentation.kafka_common.StreamingContext.STREAMING_CONTEXT; import static datadog.trace.instrumentation.kafka_common.Utils.computePayloadSizeBytes; import static datadog.trace.instrumentation.kafka_streams.KafkaStreamsDecorator.BROKER_DECORATE; @@ -233,7 +233,7 @@ public static void onEnter( return; } if (!Config.get().isKafkaClientPropagationDisabledForTopic(record.topic())) { - scope = defaultPropagator().extract(getRootContext(), record, SR_GETTER).attach(); + scope = defaultPropagator().extract(rootContext(), record, SR_GETTER).attach(); } } @@ -254,7 +254,7 @@ public static void onEnter( return; } if (!Config.get().isKafkaClientPropagationDisabledForTopic(record.topic())) { - scope = defaultPropagator().extract(getRootContext(), record, PR_GETTER).attach(); + scope = defaultPropagator().extract(rootContext(), record, PR_GETTER).attach(); } } @@ -288,7 +288,7 @@ public static void start( JAVA_KAFKA.toString(), KAFKA_DELIVER, MILLISECONDS.toMicros(timeInQueueStart)); BROKER_DECORATE.afterStart(queueSpan); BROKER_DECORATE.onTimeInQueue(queueSpan, record); - span = startSpan(JAVA_KAFKA.toString(), KAFKA_CONSUME, queueSpan.context()); + span = startSpan(JAVA_KAFKA.toString(), KAFKA_CONSUME, queueSpan.spanContext()); BROKER_DECORATE.beforeFinish(queueSpan); // The queueSpan will be finished after inner span has been activated to ensure that // spans are written out together by TraceStructureWriter when running in strict mode @@ -354,7 +354,7 @@ public static void start( JAVA_KAFKA.toString(), KAFKA_DELIVER, MILLISECONDS.toMicros(timeInQueueStart)); BROKER_DECORATE.afterStart(queueSpan); BROKER_DECORATE.onTimeInQueue(queueSpan, record); - span = startSpan(JAVA_KAFKA.toString(), KAFKA_CONSUME, queueSpan.context()); + span = startSpan(JAVA_KAFKA.toString(), KAFKA_CONSUME, queueSpan.spanContext()); BROKER_DECORATE.beforeFinish(queueSpan); // The queueSpan will be finished after inner span has been activated to ensure that // spans are written out together by TraceStructureWriter when running in strict mode diff --git a/dd-java-agent/instrumentation/kafka/kafka-streams-0.11/src/test/groovy/KafkaStreamsTestBase.groovy b/dd-java-agent/instrumentation/kafka/kafka-streams-0.11/src/test/groovy/KafkaStreamsTestBase.groovy index 35db04a8431..d697e529f72 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-streams-0.11/src/test/groovy/KafkaStreamsTestBase.groovy +++ b/dd-java-agent/instrumentation/kafka/kafka-streams-0.11/src/test/groovy/KafkaStreamsTestBase.groovy @@ -10,7 +10,6 @@ import org.apache.kafka.streams.StreamsConfig import org.apache.kafka.streams.kstream.KStream import org.apache.kafka.streams.kstream.KStreamBuilder import org.apache.kafka.streams.kstream.ValueMapper -import org.junit.ClassRule import org.springframework.kafka.core.DefaultKafkaConsumerFactory import org.springframework.kafka.core.DefaultKafkaProducerFactory import org.springframework.kafka.core.KafkaTemplate @@ -31,8 +30,16 @@ abstract class KafkaStreamsTestBase extends VersionedNamingTestBase { static final STREAM_PROCESSED = "test.processed" @Shared - @ClassRule - KafkaEmbedded embeddedKafka = new KafkaEmbedded(1, true, 1, STREAM_PENDING, STREAM_PROCESSED) + protected KafkaEmbedded embeddedKafka + + def setupSpec() { + embeddedKafka = new KafkaEmbedded(1, true, 1, STREAM_PENDING, STREAM_PROCESSED) + embeddedKafka.before() + } + + def cleanupSpec() { + embeddedKafka?.after() + } abstract boolean hasQueueSpan() diff --git a/dd-java-agent/instrumentation/kafka/kafka-streams-1.0/gradle.lockfile b/dd-java-agent/instrumentation/kafka/kafka-streams-1.0/gradle.lockfile index cc3ae4fdab4..59fcc5d7d0a 100644 --- a/dd-java-agent/instrumentation/kafka/kafka-streams-1.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/kafka/kafka-streams-1.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:kafka:kafka-streams-1.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -16,15 +17,15 @@ com.fasterxml.jackson.core:jackson-annotations:2.9.0=compileClasspath com.fasterxml.jackson.core:jackson-core:2.9.1=compileClasspath com.fasterxml.jackson.core:jackson-databind:2.9.1=compileClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -34,12 +35,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -50,12 +54,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -88,6 +92,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -106,14 +111,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.rocksdb:rocksdbjni:5.7.3=compileClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/karate-1.0/gradle.lockfile b/dd-java-agent/instrumentation/karate-1.0/gradle.lockfile deleted file mode 100644 index 7351446ca4a..00000000000 --- a/dd-java-agent/instrumentation/karate-1.0/gradle.lockfile +++ /dev/null @@ -1,312 +0,0 @@ -# This is a Gradle generated file for dependency locking. -# Manual edits can break the build and are not advised. -# This file is expected to be part of source control. -cafe.cryptography:curve25519-elisabeth:0.1.0=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -cafe.cryptography:ed25519-elisabeth:0.1.0=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -ch.qos.logback:logback-classic:1.2.13=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-classic:1.2.3=compileClasspath -ch.qos.logback:logback-core:1.2.13=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.3=compileClasspath -com.aayushatharva.brotli4j:brotli4j:1.12.0=karate141TestRuntimeClasspath -com.aayushatharva.brotli4j:brotli4j:1.18.0=latestDepTestRuntimeClasspath -com.aayushatharva.brotli4j:brotli4j:1.7.1=karate131TestRuntimeClasspath -com.aayushatharva.brotli4j:service:1.12.0=karate141TestRuntimeClasspath -com.aayushatharva.brotli4j:service:1.18.0=latestDepTestRuntimeClasspath -com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq.okhttp3:okhttp:3.12.15=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq.okio:okio:1.17.6=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:java-dogstatsd-client:4.4.5=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.datadoghq:sketches-java:0.8.3=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.20=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.20.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.20.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.20.0=karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.20.0=karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.20.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-a64asm:1.0.0=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-constants:0.10.4=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-x86asm:1.0.2=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs:4.9.8=spotbugs -com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs -com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,karate131TestAnnotationProcessor,karate131TestCompileClasspath,karate141TestAnnotationProcessor,karate141TestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath -com.google.auto.service:auto-service:1.1.1=annotationProcessor,karate131TestAnnotationProcessor,karate141TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.auto:auto-common:1.2.1=annotationProcessor,karate131TestAnnotationProcessor,karate141TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,karate131TestAnnotationProcessor,karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestAnnotationProcessor,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -com.google.code.gson:gson:2.13.2=spotbugs -com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,karate131TestAnnotationProcessor,karate141TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:failureaccess:1.0.1=annotationProcessor,karate131TestAnnotationProcessor,karate141TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.guava:guava:32.0.1-jre=annotationProcessor,karate131TestAnnotationProcessor,karate141TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,karate131TestAnnotationProcessor,karate141TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,karate131TestAnnotationProcessor,karate141TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.ibm.icu:icu4j:67.1=testRuntimeClasspath -com.ibm.icu:icu4j:71.1=karate141TestRuntimeClasspath -com.intuit.karate:karate-core:1.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.intuit.karate:karate-core:1.3.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath -com.intuit.karate:karate-core:1.4.1=karate141TestCompileClasspath,karate141TestRuntimeClasspath -com.intuit.karate:karate-junit5:1.0.0=testCompileClasspath,testRuntimeClasspath -com.intuit.karate:karate-junit5:1.3.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath -com.intuit.karate:karate-junit5:1.4.1=karate141TestCompileClasspath,karate141TestRuntimeClasspath -com.jayway.jsonpath:json-path:2.5.0=compileClasspath -com.jayway.jsonpath:json-path:2.8.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.jayway.jsonpath:json-path:2.9.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.linecorp.armeria:armeria:1.18.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath -com.linecorp.armeria:armeria:1.25.2=karate141TestCompileClasspath,karate141TestRuntimeClasspath -com.linecorp.armeria:armeria:1.33.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.squareup.moshi:moshi:1.11.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:logging-interceptor:3.12.12=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:okhttp:3.12.12=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.squareup.okio:okio:1.17.5=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.thoughtworks.qdox:qdox:1.12.1=codenarc -com.vaadin.external.google:android-json:0.0.20131108.vaadin1=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -commons-codec:commons-codec:1.11=karate131TestCompileClasspath,karate131TestRuntimeClasspath -commons-codec:commons-codec:1.16.0=karate141TestCompileClasspath,karate141TestRuntimeClasspath -commons-codec:commons-codec:1.16.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -commons-fileupload:commons-fileupload:1.5=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -commons-io:commons-io:2.11.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -commons-io:commons-io:2.20.0=spotbugs -de.siegmar:fastcsv:1.0.4=compileClasspath,testCompileClasspath,testRuntimeClasspath -de.siegmar:fastcsv:2.0.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath -de.siegmar:fastcsv:2.2.1=karate141TestCompileClasspath,karate141TestRuntimeClasspath -de.siegmar:fastcsv:3.4.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -de.thetaphi:forbiddenapis:3.10=compileClasspath,karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -info.cukes:cucumber-core:1.2.5=compileClasspath,karate131TestCompileClasspath,karate131TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -info.cukes:cucumber-java:1.2.5=compileClasspath,karate131TestCompileClasspath,karate131TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -info.picocli:picocli:4.5.2=compileClasspath,testCompileClasspath,testRuntimeClasspath -info.picocli:picocli:4.6.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath -info.picocli:picocli:4.7.1=karate141TestCompileClasspath,karate141TestRuntimeClasspath -info.picocli:picocli:4.7.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.github.classgraph:classgraph:4.8.149=karate131TestCompileClasspath,karate131TestRuntimeClasspath -io.github.classgraph:classgraph:4.8.160=karate141TestCompileClasspath,karate141TestRuntimeClasspath -io.github.classgraph:classgraph:4.8.181=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.github.t12y:resemble:1.0.2=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath -io.github.t12y:resemble:1.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.github.t12y:ssim:1.0.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.karatelabs:karate-core:1.5.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.karatelabs:karate-junit5:1.5.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.leangen.geantyref:geantyref:1.3.16=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.micrometer:context-propagation:1.1.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.micrometer:micrometer-commons:1.11.3=karate141TestCompileClasspath,karate141TestRuntimeClasspath -io.micrometer:micrometer-commons:1.15.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.micrometer:micrometer-core:1.11.3=karate141TestCompileClasspath,karate141TestRuntimeClasspath -io.micrometer:micrometer-core:1.15.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.micrometer:micrometer-core:1.9.2=karate131TestCompileClasspath,karate131TestRuntimeClasspath -io.micrometer:micrometer-observation:1.11.3=karate141TestCompileClasspath,karate141TestRuntimeClasspath -io.micrometer:micrometer-observation:1.15.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-buffer:4.1.79.Final=karate131TestCompileClasspath,karate131TestRuntimeClasspath -io.netty:netty-buffer:4.1.96.Final=karate141TestCompileClasspath,karate141TestRuntimeClasspath -io.netty:netty-buffer:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-base:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-compression:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-dns:4.1.79.Final=karate131TestCompileClasspath,karate131TestRuntimeClasspath -io.netty:netty-codec-dns:4.1.96.Final=karate141TestCompileClasspath,karate141TestRuntimeClasspath -io.netty:netty-codec-dns:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-haproxy:4.1.79.Final=karate131TestCompileClasspath,karate131TestRuntimeClasspath -io.netty:netty-codec-haproxy:4.1.96.Final=karate141TestCompileClasspath,karate141TestRuntimeClasspath -io.netty:netty-codec-haproxy:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-http2:4.1.79.Final=karate131TestCompileClasspath,karate131TestRuntimeClasspath -io.netty:netty-codec-http2:4.1.96.Final=karate141TestCompileClasspath,karate141TestRuntimeClasspath -io.netty:netty-codec-http2:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-http:4.1.79.Final=karate131TestCompileClasspath,karate131TestRuntimeClasspath -io.netty:netty-codec-http:4.1.96.Final=karate141TestCompileClasspath,karate141TestRuntimeClasspath -io.netty:netty-codec-http:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-socks:4.1.79.Final=karate131TestRuntimeClasspath -io.netty:netty-codec-socks:4.1.96.Final=karate141TestRuntimeClasspath -io.netty:netty-codec-socks:4.2.6.Final=latestDepTestRuntimeClasspath -io.netty:netty-codec:4.1.79.Final=karate131TestCompileClasspath,karate131TestRuntimeClasspath -io.netty:netty-codec:4.1.96.Final=karate141TestCompileClasspath,karate141TestRuntimeClasspath -io.netty:netty-common:4.1.79.Final=karate131TestCompileClasspath,karate131TestRuntimeClasspath -io.netty:netty-common:4.1.96.Final=karate141TestCompileClasspath,karate141TestRuntimeClasspath -io.netty:netty-common:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-handler-proxy:4.1.79.Final=karate131TestRuntimeClasspath -io.netty:netty-handler-proxy:4.1.96.Final=karate141TestRuntimeClasspath -io.netty:netty-handler-proxy:4.2.6.Final=latestDepTestRuntimeClasspath -io.netty:netty-handler:4.1.79.Final=karate131TestCompileClasspath,karate131TestRuntimeClasspath -io.netty:netty-handler:4.1.96.Final=karate141TestCompileClasspath,karate141TestRuntimeClasspath -io.netty:netty-handler:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-resolver-dns-classes-macos:4.1.79.Final=karate131TestRuntimeClasspath -io.netty:netty-resolver-dns-classes-macos:4.1.96.Final=karate141TestRuntimeClasspath -io.netty:netty-resolver-dns-classes-macos:4.2.6.Final=latestDepTestRuntimeClasspath -io.netty:netty-resolver-dns-native-macos:4.1.79.Final=karate131TestRuntimeClasspath -io.netty:netty-resolver-dns-native-macos:4.1.96.Final=karate141TestRuntimeClasspath -io.netty:netty-resolver-dns-native-macos:4.2.6.Final=latestDepTestRuntimeClasspath -io.netty:netty-resolver-dns:4.1.79.Final=karate131TestCompileClasspath,karate131TestRuntimeClasspath -io.netty:netty-resolver-dns:4.1.96.Final=karate141TestCompileClasspath,karate141TestRuntimeClasspath -io.netty:netty-resolver-dns:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-resolver:4.1.79.Final=karate131TestCompileClasspath,karate131TestRuntimeClasspath -io.netty:netty-resolver:4.1.96.Final=karate141TestCompileClasspath,karate141TestRuntimeClasspath -io.netty:netty-resolver:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-tcnative-boringssl-static:2.0.53.Final=karate131TestRuntimeClasspath -io.netty:netty-tcnative-boringssl-static:2.0.61.Final=karate141TestRuntimeClasspath -io.netty:netty-tcnative-boringssl-static:2.0.73.Final=latestDepTestRuntimeClasspath -io.netty:netty-tcnative-classes:2.0.53.Final=karate131TestRuntimeClasspath -io.netty:netty-tcnative-classes:2.0.61.Final=karate141TestRuntimeClasspath -io.netty:netty-tcnative-classes:2.0.73.Final=latestDepTestRuntimeClasspath -io.netty:netty-transport-classes-epoll:4.1.79.Final=karate131TestRuntimeClasspath -io.netty:netty-transport-classes-epoll:4.1.96.Final=karate141TestRuntimeClasspath -io.netty:netty-transport-classes-epoll:4.2.6.Final=latestDepTestRuntimeClasspath -io.netty:netty-transport-classes-kqueue:4.1.96.Final=karate141TestRuntimeClasspath -io.netty:netty-transport-classes-kqueue:4.2.6.Final=latestDepTestRuntimeClasspath -io.netty:netty-transport-native-epoll:4.1.79.Final=karate131TestRuntimeClasspath -io.netty:netty-transport-native-epoll:4.1.96.Final=karate141TestRuntimeClasspath -io.netty:netty-transport-native-epoll:4.2.6.Final=latestDepTestRuntimeClasspath -io.netty:netty-transport-native-kqueue:4.1.96.Final=karate141TestRuntimeClasspath -io.netty:netty-transport-native-kqueue:4.2.6.Final=latestDepTestRuntimeClasspath -io.netty:netty-transport-native-unix-common:4.1.79.Final=karate131TestCompileClasspath,karate131TestRuntimeClasspath -io.netty:netty-transport-native-unix-common:4.1.96.Final=karate141TestCompileClasspath,karate141TestRuntimeClasspath -io.netty:netty-transport-native-unix-common:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-transport:4.1.79.Final=karate131TestCompileClasspath,karate131TestRuntimeClasspath -io.netty:netty-transport:4.1.96.Final=karate141TestCompileClasspath,karate141TestRuntimeClasspath -io.netty:netty-transport:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -javax.servlet:javax.servlet-api:3.1.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -jaxen:jaxen:2.0.0=spotbugs -junit:junit:4.13.2=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.java.dev.jna:jna-platform:5.8.0=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.8.0=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.minidev:accessors-smart:1.2=compileClasspath -net.minidev:accessors-smart:2.4.9=karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,testRuntimeClasspath -net.minidev:accessors-smart:2.5.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -net.minidev:json-smart:2.3=compileClasspath -net.minidev:json-smart:2.4.10=karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,testRuntimeClasspath -net.minidev:json-smart:2.5.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -net.sf.saxon:Saxon-HE:12.9=spotbugs -ognl:ognl:3.1.26=karate131TestCompileClasspath,karate131TestRuntimeClasspath -ognl:ognl:3.3.4=karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.antlr:antlr4-runtime:4.11.1=karate141TestCompileClasspath,karate141TestRuntimeClasspath -org.antlr:antlr4-runtime:4.13.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.antlr:antlr4-runtime:4.9.3=karate131TestCompileClasspath,karate131TestRuntimeClasspath -org.apache.ant:ant-antlr:1.10.14=codenarc -org.apache.ant:ant-junit:1.10.14=codenarc -org.apache.bcel:bcel:6.11.0=spotbugs -org.apache.commons:commons-lang3:3.19.0=spotbugs -org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.httpcomponents:httpclient:4.5.13=karate131TestCompileClasspath,karate131TestRuntimeClasspath -org.apache.httpcomponents:httpclient:4.5.14=karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.apache.httpcomponents:httpcore:4.4.13=karate131TestCompileClasspath,karate131TestRuntimeClasspath -org.apache.httpcomponents:httpcore:4.4.16=karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.apache.logging.log4j:log4j-api:2.25.2=spotbugs -org.apache.logging.log4j:log4j-core:2.25.2=spotbugs -org.apiguardian:apiguardian-api:1.1.2=karate131TestCompileClasspath,karate141TestCompileClasspath,latestDepTestCompileClasspath,testCompileClasspath -org.attoparser:attoparser:2.0.5.RELEASE=karate131TestCompileClasspath,karate131TestRuntimeClasspath -org.attoparser:attoparser:2.0.7.RELEASE=karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.brotli:dec:0.1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.checkerframework:checker-qual:3.33.0=annotationProcessor,karate131TestAnnotationProcessor,karate141TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -org.codehaus.groovy:groovy-ant:3.0.23=codenarc -org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc -org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc -org.codehaus.groovy:groovy-json:3.0.23=codenarc -org.codehaus.groovy:groovy-json:3.0.25=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-templates:3.0.23=codenarc -org.codehaus.groovy:groovy-xml:3.0.23=codenarc -org.codehaus.groovy:groovy:3.0.23=codenarc -org.codehaus.groovy:groovy:3.0.25=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.codenarc:CodeNarc:3.7.0=codenarc -org.dom4j:dom4j:2.2.0=spotbugs -org.freemarker:freemarker:2.3.31=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.gmetrics:GMetrics:2.1.0=codenarc -org.graalvm.js:js-language:24.0.0=latestDepTestRuntimeClasspath -org.graalvm.js:js-scriptengine:21.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.graalvm.js:js-scriptengine:22.0.0.2=karate131TestCompileClasspath,karate131TestRuntimeClasspath -org.graalvm.js:js-scriptengine:22.3.3=karate141TestCompileClasspath,karate141TestRuntimeClasspath -org.graalvm.js:js-scriptengine:24.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.graalvm.js:js:21.0.0=testRuntimeClasspath -org.graalvm.js:js:22.0.0.2=karate131TestRuntimeClasspath -org.graalvm.js:js:22.3.3=karate141TestRuntimeClasspath -org.graalvm.polyglot:polyglot:24.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.graalvm.regex:regex:21.0.0=testRuntimeClasspath -org.graalvm.regex:regex:22.0.0.2=karate131TestRuntimeClasspath -org.graalvm.regex:regex:22.3.3=karate141TestRuntimeClasspath -org.graalvm.regex:regex:24.0.0=latestDepTestRuntimeClasspath -org.graalvm.sdk:collections:24.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.graalvm.sdk:graal-sdk:21.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.graalvm.sdk:graal-sdk:22.0.0.2=karate131TestCompileClasspath,karate131TestRuntimeClasspath -org.graalvm.sdk:graal-sdk:22.3.3=karate141TestCompileClasspath,karate141TestRuntimeClasspath -org.graalvm.sdk:nativeimage:24.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.graalvm.sdk:word:24.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.graalvm.shadowed:icu4j:24.0.0=latestDepTestRuntimeClasspath -org.graalvm.truffle:truffle-api:21.0.0=testRuntimeClasspath -org.graalvm.truffle:truffle-api:22.0.0.2=karate131TestRuntimeClasspath -org.graalvm.truffle:truffle-api:22.3.3=karate141TestRuntimeClasspath -org.graalvm.truffle:truffle-api:24.0.0=latestDepTestRuntimeClasspath -org.hamcrest:hamcrest-core:1.3=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.hamcrest:hamcrest:3.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.hdrhistogram:HdrHistogram:2.1.12=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestRuntimeClasspath -org.hdrhistogram:HdrHistogram:2.2.2=latestDepTestRuntimeClasspath -org.jacoco:org.jacoco.core:0.8.14=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.report:0.8.14=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.javassist:javassist:3.20.0-GA=karate131TestCompileClasspath,karate131TestRuntimeClasspath -org.javassist:javassist:3.29.0-GA=karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.jctools:jctools-core-jdk11:4.0.6=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jctools:jctools-core:4.0.6=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-api:5.14.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-engine:5.14.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-params:5.14.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter:5.14.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-commons:1.14.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-engine:1.14.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-launcher:1.14.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-runner:1.14.1=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-api:1.14.1=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-commons:1.14.1=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit:junit-bom:5.14.0=spotbugs -org.junit:junit-bom:5.14.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.latencyutils:LatencyUtils:2.0.3=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath -org.mockito:mockito-core:4.4.0=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.msgpack:jackson-dataformat-msgpack:0.9.6=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.msgpack:msgpack-core:0.9.6=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.objenesis:objenesis:3.3=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.opentest4j:opentest4j:1.3.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-analysis:9.7.1=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-util:9.7.1=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.reactivestreams:reactive-streams:1.0.4=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.skyscreamer:jsonassert:1.5.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:jcl-over-slf4j:1.7.30=karate131TestCompileClasspath,karate141TestCompileClasspath,latestDepTestCompileClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:jcl-over-slf4j:1.7.32=karate131TestRuntimeClasspath -org.slf4j:jcl-over-slf4j:2.0.17=latestDepTestRuntimeClasspath -org.slf4j:jcl-over-slf4j:2.0.9=karate141TestRuntimeClasspath -org.slf4j:jul-to-slf4j:1.7.30=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:log4j-over-slf4j:1.7.30=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath -org.slf4j:slf4j-api:1.7.32=testCompileClasspath -org.slf4j:slf4j-api:1.7.36=karate131TestCompileClasspath,karate131TestRuntimeClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:2.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,spotbugsSlf4j -org.slf4j:slf4j-api:2.0.7=karate141TestCompileClasspath -org.slf4j:slf4j-api:2.0.9=karate141TestRuntimeClasspath -org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j -org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath -org.spockframework:spock-bom:2.4-groovy-3.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.spockframework:spock-core:2.4-groovy-3.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-junit:1.2.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-parser:1.2.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.thymeleaf:thymeleaf:3.0.14.RELEASE=karate131TestCompileClasspath,karate131TestRuntimeClasspath -org.thymeleaf:thymeleaf:3.1.2.RELEASE=karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.unbescape:unbescape:1.1.6.RELEASE=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.xmlresolver:xmlresolver:5.3.3=spotbugs -org.xmlunit:xmlunit-core:2.10.3=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.yaml:snakeyaml:1.27=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.yaml:snakeyaml:1.32=karate131TestCompileClasspath,karate131TestRuntimeClasspath -org.yaml:snakeyaml:2.0=karate141TestCompileClasspath,karate141TestRuntimeClasspath -org.yaml:snakeyaml:2.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -empty=spotbugsPlugins diff --git a/dd-java-agent/instrumentation/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/ExecutionContext.java b/dd-java-agent/instrumentation/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/ExecutionContext.java deleted file mode 100644 index fbcc6c37d90..00000000000 --- a/dd-java-agent/instrumentation/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/ExecutionContext.java +++ /dev/null @@ -1,39 +0,0 @@ -package datadog.trace.instrumentation.karate; - -import com.intuit.karate.core.Scenario; -import datadog.trace.api.civisibility.config.TestIdentifier; -import datadog.trace.api.civisibility.config.TestSourceData; -import datadog.trace.api.civisibility.execution.TestExecutionPolicy; -import java.util.Collection; - -public class ExecutionContext { - - private final TestExecutionPolicy executionPolicy; - private boolean suppressFailures; - - public ExecutionContext(TestExecutionPolicy executionPolicy) { - this.executionPolicy = executionPolicy; - } - - public void setSuppressFailures(boolean suppressFailures) { - this.suppressFailures = suppressFailures; - } - - public boolean getAndResetSuppressFailures() { - boolean suppressFailures = this.suppressFailures; - this.suppressFailures = false; - return suppressFailures; - } - - public TestExecutionPolicy getExecutionPolicy() { - return executionPolicy; - } - - public static ExecutionContext create(Scenario scenario) { - TestIdentifier testIdentifier = KarateUtils.toTestIdentifier(scenario); - Collection testTags = scenario.getTagsEffective().getTagKeys(); - return new ExecutionContext( - TestEventsHandlerHolder.TEST_EVENTS_HANDLER.executionPolicy( - testIdentifier, TestSourceData.UNKNOWN, testTags)); - } -} diff --git a/dd-java-agent/instrumentation/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/KarateExecutionInstrumentation.java b/dd-java-agent/instrumentation/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/KarateExecutionInstrumentation.java deleted file mode 100644 index f11b647d93e..00000000000 --- a/dd-java-agent/instrumentation/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/KarateExecutionInstrumentation.java +++ /dev/null @@ -1,156 +0,0 @@ -package datadog.trace.instrumentation.karate; - -import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; -import static net.bytebuddy.matcher.ElementMatchers.takesArgument; -import static net.bytebuddy.matcher.ElementMatchers.takesArguments; -import static net.bytebuddy.matcher.ElementMatchers.takesNoArguments; - -import com.google.auto.service.AutoService; -import com.intuit.karate.RuntimeHook; -import com.intuit.karate.core.Result; -import com.intuit.karate.core.Scenario; -import com.intuit.karate.core.ScenarioResult; -import com.intuit.karate.core.ScenarioRuntime; -import com.intuit.karate.core.StepResult; -import datadog.trace.agent.tooling.Instrumenter; -import datadog.trace.agent.tooling.InstrumenterModule; -import datadog.trace.api.Config; -import datadog.trace.api.civisibility.execution.TestExecutionPolicy; -import datadog.trace.bootstrap.CallDepthThreadLocalMap; -import datadog.trace.bootstrap.InstrumentationContext; -import java.util.Collections; -import java.util.Map; -import net.bytebuddy.asm.Advice; - -@AutoService(InstrumenterModule.class) -public class KarateExecutionInstrumentation extends InstrumenterModule.CiVisibility - implements Instrumenter.ForKnownTypes, Instrumenter.HasMethodAdvice { - - public KarateExecutionInstrumentation() { - super("ci-visibility", "karate", "test-retry"); - } - - @Override - public boolean isEnabled() { - return super.isEnabled() && Config.get().isCiVisibilityExecutionPoliciesEnabled(); - } - - @Override - public String[] knownMatchingTypes() { - return new String[] { - "com.intuit.karate.core.ScenarioRuntime", "com.intuit.karate.core.ScenarioResult" - }; - } - - @Override - public String[] helperClassNames() { - return new String[] { - packageName + ".KarateUtils", - packageName + ".TestEventsHandlerHolder", - packageName + ".KarateTracingHook", - packageName + ".ExecutionContext" - }; - } - - @Override - public Map contextStore() { - return Collections.singletonMap( - "com.intuit.karate.core.Scenario", packageName + ".ExecutionContext"); - } - - @Override - public void methodAdvice(MethodTransformer transformer) { - // ScenarioRuntime - transformer.applyAdvice( - named("run").and(takesNoArguments()), - KarateExecutionInstrumentation.class.getName() + "$RetryAdvice"); - - // ScenarioResult - transformer.applyAdvice( - named("addStepResult") - .and(takesArguments(1)) - .and(takesArgument(0, named("com.intuit.karate.core.StepResult"))), - KarateExecutionInstrumentation.class.getName() + "$SuppressErrorAdvice"); - } - - public static class RetryAdvice { - @Advice.OnMethodEnter - public static void beforeExecute(@Advice.This ScenarioRuntime scenarioRuntime) { - ExecutionContext executionContext = - InstrumentationContext.get(Scenario.class, ExecutionContext.class) - .computeIfAbsent(scenarioRuntime.scenario, ExecutionContext::create); - - // Indicate beforehand if the failures should be suppressed. This aligns the ordering with the - // rest of the frameworks - TestExecutionPolicy executionPolicy = executionContext.getExecutionPolicy(); - executionContext.setSuppressFailures(executionPolicy.suppressFailures()); - - scenarioRuntime.magicVariables.putIfAbsent( - KarateUtils.EXECUTION_TRACKER_MAGICVARIABLE, executionPolicy); - } - - @Advice.OnMethodExit - public static void afterExecute(@Advice.This ScenarioRuntime scenarioRuntime) { - if (CallDepthThreadLocalMap.incrementCallDepth(ScenarioRuntime.class) > 0) { - // nested call - return; - } - - Scenario scenario = scenarioRuntime.scenario; - ExecutionContext context = - InstrumentationContext.get(Scenario.class, ExecutionContext.class).get(scenario); - if (context == null) { - return; - } - - ScenarioResult finalResult = scenarioRuntime.result; - - TestExecutionPolicy executionPolicy = context.getExecutionPolicy(); - while (executionPolicy.applicable()) { - ScenarioRuntime retry = - new ScenarioRuntime(scenarioRuntime.featureRuntime, scenarioRuntime.scenario); - retry.magicVariables.put(KarateUtils.EXECUTION_TRACKER_MAGICVARIABLE, executionPolicy); - retry.run(); - retry.featureRuntime.result.addResult(retry.result); - finalResult = retry.result; - } - - KarateUtils.setResult(scenarioRuntime, finalResult); - - CallDepthThreadLocalMap.reset(ScenarioRuntime.class); - } - - // Karate 1.0.0 and above - public static void muzzleCheck(RuntimeHook runtimeHook) { - runtimeHook.beforeSuite(null); - } - } - - public static class SuppressErrorAdvice { - @Advice.OnMethodEnter - public static void onAddingStepResult( - @Advice.Argument(value = 0, readOnly = false) StepResult stepResult, - @Advice.FieldValue("scenario") Scenario scenario) { - - Result result = stepResult.getResult(); - if (result.isFailed()) { - ExecutionContext executionContext = - InstrumentationContext.get(Scenario.class, ExecutionContext.class).get(scenario); - if (executionContext == null) { - return; - } - - if (executionContext.getAndResetSuppressFailures()) { - stepResult = new StepResult(stepResult.getStep(), KarateUtils.abortedResult()); - stepResult.setFailedReason(result.getError()); - stepResult.setErrorIgnored(true); - } - } - } - - // Karate 1.0.0 and above - public static void muzzleCheck(RuntimeHook runtimeHook) { - runtimeHook.beforeSuite(null); - } - } -} diff --git a/dd-java-agent/instrumentation/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/KarateUtils.java b/dd-java-agent/instrumentation/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/KarateUtils.java deleted file mode 100644 index 80b422d9f59..00000000000 --- a/dd-java-agent/instrumentation/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/KarateUtils.java +++ /dev/null @@ -1,179 +0,0 @@ -package datadog.trace.instrumentation.karate; - -import static datadog.json.JsonMapper.toJson; - -import com.intuit.karate.FileUtils; -import com.intuit.karate.core.Feature; -import com.intuit.karate.core.FeatureRuntime; -import com.intuit.karate.core.Result; -import com.intuit.karate.core.Scenario; -import com.intuit.karate.core.ScenarioResult; -import com.intuit.karate.core.ScenarioRuntime; -import com.intuit.karate.core.Tag; -import datadog.trace.api.civisibility.config.LibraryCapability; -import datadog.trace.api.civisibility.config.TestIdentifier; -import datadog.trace.api.civisibility.events.TestDescriptor; -import datadog.trace.api.civisibility.events.TestSuiteDescriptor; -import datadog.trace.util.ComparableVersion; -import datadog.trace.util.MethodHandles; -import datadog.trace.util.Strings; -import java.lang.invoke.MethodHandle; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; - -public abstract class KarateUtils { - - public static final String EXECUTION_TRACKER_MAGICVARIABLE = "__datadog_execution_tracker"; - - private KarateUtils() {} - - private static final MethodHandles METHOD_HANDLES = - new MethodHandles(FeatureRuntime.class.getClassLoader()); - private static final MethodHandle FEATURE_RUNTIME_FEATURE_GETTER = - METHOD_HANDLES.privateFieldGetter(FeatureRuntime.class, "feature"); - private static final MethodHandle FEATURE_RUNTIME_FEATURE_CALL_GETTER = - METHOD_HANDLES.privateFieldGetter(FeatureRuntime.class, "featureCall"); - private static final MethodHandle FEATURE_RUNTIME_BEFORE_HOOK_DONE_GETTER = - METHOD_HANDLES.privateFieldGetter(FeatureRuntime.class, "beforeHookDone"); - private static final MethodHandle FEATURE_RUNTIME_BEFORE_HOOK_DONE_SETTER = - METHOD_HANDLES.privateFieldSetter(FeatureRuntime.class, "beforeHookDone"); - private static final MethodHandle FEATURE_CALL_FEATURE_GETTER = - METHOD_HANDLES.privateFieldGetter("com.intuit.karate.core.FeatureCall", "feature"); - private static final MethodHandle ABORTED_RESULT_DURATION_NANOS = - METHOD_HANDLES.method(Result.class, "aborted", long.class); - // static method to create aborted result has a different signature starting with Karate 1.4.1 - private static final MethodHandle ABORTED_RESULT_STARTTIME_DURATION_NANOS = - METHOD_HANDLES.method(Result.class, "aborted", long.class, long.class); - private static final MethodHandle SCENARIO_RUNTIME_RESULT_SETTER = - METHOD_HANDLES.privateFieldSetter(ScenarioRuntime.class, "result"); - - private static final ComparableVersion karateV12 = new ComparableVersion("1.2.0"); - private static final ComparableVersion karateV13 = new ComparableVersion("1.3.0"); - - public static final List CAPABILITIES_BASE = - Arrays.asList( - LibraryCapability.ATR, - LibraryCapability.EFD, - LibraryCapability.FTR, - LibraryCapability.QUARANTINE, - LibraryCapability.ATTEMPT_TO_FIX); - - public static final List CAPABILITIES_SKIPPING = - Arrays.asList( - LibraryCapability.ATR, - LibraryCapability.EFD, - LibraryCapability.FTR, - LibraryCapability.QUARANTINE, - LibraryCapability.ATTEMPT_TO_FIX, - LibraryCapability.TIA, - LibraryCapability.DISABLED); - - public static Feature getFeature(FeatureRuntime featureRuntime) { - if (FEATURE_RUNTIME_FEATURE_CALL_GETTER != null) { - Object featureCall = - METHOD_HANDLES.invoke(FEATURE_RUNTIME_FEATURE_CALL_GETTER, featureRuntime); - if (featureCall != null && FEATURE_CALL_FEATURE_GETTER != null) { - return METHOD_HANDLES.invoke(FEATURE_CALL_FEATURE_GETTER, featureCall); - } - } else if (FEATURE_RUNTIME_FEATURE_GETTER != null) { - // Karate versions prior to 1.3.0 - return METHOD_HANDLES.invoke(FEATURE_RUNTIME_FEATURE_GETTER, featureRuntime); - } - return null; - } - - public static String getScenarioName(Scenario scenario) { - String scenarioName = scenario.getName(); - if (Strings.isNotBlank(scenarioName)) { - return scenarioName; - } else { - return scenario.getRefId(); - } - } - - public static List getCategories(List tags) { - if (tags == null) { - return Collections.emptyList(); - } - - List categories = new ArrayList<>(tags.size()); - for (Tag tag : tags) { - categories.add(tag.getName()); - } - return categories; - } - - public static String getParameters(Scenario scenario) { - return scenario.getExampleData() != null ? toJson(scenario.getExampleData()) : null; - } - - public static TestIdentifier toTestIdentifier(Scenario scenario) { - Feature feature = scenario.getFeature(); - String featureName = feature.getNameForReport(); - String scenarioName = KarateUtils.getScenarioName(scenario); - String parameters = KarateUtils.getParameters(scenario); - return new TestIdentifier(featureName, scenarioName, parameters); - } - - public static TestDescriptor toTestDescriptor(ScenarioRuntime scenarioRuntime) { - Scenario scenario = scenarioRuntime.scenario; - Feature feature = scenario.getFeature(); - String featureName = feature.getNameForReport(); - String scenarioName = KarateUtils.getScenarioName(scenario); - String parameters = KarateUtils.getParameters(scenario); - return new TestDescriptor(featureName, null, scenarioName, parameters, scenarioRuntime); - } - - public static TestSuiteDescriptor toSuiteDescriptor(FeatureRuntime featureRuntime) { - String featureName = KarateUtils.getFeature(featureRuntime).getNameForReport(); - return new TestSuiteDescriptor(featureName, null); - } - - public static Result abortedResult() { - if (ABORTED_RESULT_STARTTIME_DURATION_NANOS != null) { - long startTime = System.currentTimeMillis(); - long durationNanos = 1; - return METHOD_HANDLES.invoke( - ABORTED_RESULT_STARTTIME_DURATION_NANOS, startTime, durationNanos); - } else { - long durationNanos = 1; - return METHOD_HANDLES.invoke(ABORTED_RESULT_DURATION_NANOS, durationNanos); - } - } - - public static boolean isBeforeHookExecuted(FeatureRuntime featureRuntime) { - Boolean beforeHookDone = - METHOD_HANDLES.invoke(FEATURE_RUNTIME_BEFORE_HOOK_DONE_GETTER, featureRuntime); - return beforeHookDone != null ? beforeHookDone : true; - } - - public static void resetBeforeHook(FeatureRuntime featureRuntime) { - METHOD_HANDLES.invoke(FEATURE_RUNTIME_BEFORE_HOOK_DONE_SETTER, featureRuntime, false); - } - - public static void setResult(ScenarioRuntime runtime, ScenarioResult result) { - METHOD_HANDLES.invoke(SCENARIO_RUNTIME_RESULT_SETTER, runtime, result); - } - - public static String getKarateVersion() { - return FileUtils.KARATE_VERSION; - } - - public static boolean isSkippingSupported(String version) { - return version != null && karateV12.compareTo(new ComparableVersion(version)) <= 0; - } - - public static boolean isSetupTagSupported(String version) { - return version != null && karateV13.compareTo(new ComparableVersion(version)) <= 0; - } - - public static List capabilities(String frameworkVersion) { - if (isSkippingSupported(frameworkVersion)) { - return CAPABILITIES_SKIPPING; - } - - return CAPABILITIES_BASE; - } -} diff --git a/dd-java-agent/instrumentation/karate-1.0/build.gradle b/dd-java-agent/instrumentation/karate/karate-1.0/build.gradle similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/build.gradle rename to dd-java-agent/instrumentation/karate/karate-1.0/build.gradle diff --git a/dd-java-agent/instrumentation/karate/karate-1.0/gradle.lockfile b/dd-java-agent/instrumentation/karate/karate-1.0/gradle.lockfile new file mode 100644 index 00000000000..8f89d521678 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-1.0/gradle.lockfile @@ -0,0 +1,317 @@ +# This is a Gradle generated file for dependency locking. +# Manual edits can break the build and are not advised. +# This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:karate:karate-1.0:dependencies --write-locks +cafe.cryptography:curve25519-elisabeth:0.1.0=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +cafe.cryptography:ed25519-elisabeth:0.1.0=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +ch.qos.logback:logback-classic:1.2.13=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-classic:1.2.3=compileClasspath +ch.qos.logback:logback-core:1.2.13=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.3=compileClasspath +com.aayushatharva.brotli4j:brotli4j:1.12.0=karate141TestRuntimeClasspath +com.aayushatharva.brotli4j:brotli4j:1.18.0=latestDepTestRuntimeClasspath +com.aayushatharva.brotli4j:brotli4j:1.7.1=karate131TestRuntimeClasspath +com.aayushatharva.brotli4j:service:1.12.0=karate141TestRuntimeClasspath +com.aayushatharva.brotli4j:service:1.18.0=latestDepTestRuntimeClasspath +com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq.okhttp3:okhttp:3.12.15=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq.okio:okio:1.17.6=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:java-dogstatsd-client:4.4.5=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.datadoghq:sketches-java:0.8.3=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.fasterxml.jackson.core:jackson-annotations:2.20=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.fasterxml.jackson.core:jackson-core:2.20.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.fasterxml.jackson.core:jackson-databind:2.20.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.20.0=karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.20.0=karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson:jackson-bom:2.20.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.javaparser:javaparser-core:3.25.6=codenarc +com.github.jnr:jffi:1.3.15=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-a64asm:1.0.0=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-constants:0.10.4=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-x86asm:1.0.2=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs +com.github.spotbugs:spotbugs:4.9.8=spotbugs +com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs +com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,karate131TestAnnotationProcessor,karate131TestCompileClasspath,karate141TestAnnotationProcessor,karate141TestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath +com.google.auto.service:auto-service:1.1.1=annotationProcessor,karate131TestAnnotationProcessor,karate141TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.auto:auto-common:1.2.1=annotationProcessor,karate131TestAnnotationProcessor,karate141TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,karate131TestAnnotationProcessor,karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestAnnotationProcessor,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.google.code.gson:gson:2.13.2=spotbugs +com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,karate131TestAnnotationProcessor,karate141TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.1=annotationProcessor,karate131TestAnnotationProcessor,karate141TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.3=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:32.0.1-jre=annotationProcessor,karate131TestAnnotationProcessor,karate141TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,karate131TestAnnotationProcessor,karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestAnnotationProcessor,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,karate131TestAnnotationProcessor,karate141TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:3.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.ibm.icu:icu4j:67.1=testRuntimeClasspath +com.ibm.icu:icu4j:71.1=karate141TestRuntimeClasspath +com.intuit.karate:karate-core:1.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.intuit.karate:karate-core:1.3.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath +com.intuit.karate:karate-core:1.4.1=karate141TestCompileClasspath,karate141TestRuntimeClasspath +com.intuit.karate:karate-junit5:1.0.0=testCompileClasspath,testRuntimeClasspath +com.intuit.karate:karate-junit5:1.3.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath +com.intuit.karate:karate-junit5:1.4.1=karate141TestCompileClasspath,karate141TestRuntimeClasspath +com.jayway.jsonpath:json-path:2.5.0=compileClasspath +com.jayway.jsonpath:json-path:2.8.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.jayway.jsonpath:json-path:2.9.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.linecorp.armeria:armeria:1.18.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath +com.linecorp.armeria:armeria:1.25.2=karate141TestCompileClasspath,karate141TestRuntimeClasspath +com.linecorp.armeria:armeria:1.33.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.squareup.moshi:moshi:1.11.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:logging-interceptor:3.12.12=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:okhttp:3.12.12=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.okio:okio:1.17.5=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.thoughtworks.qdox:qdox:1.12.1=codenarc +com.vaadin.external.google:android-json:0.0.20131108.vaadin1=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +commons-codec:commons-codec:1.11=karate131TestCompileClasspath,karate131TestRuntimeClasspath +commons-codec:commons-codec:1.16.0=karate141TestCompileClasspath,karate141TestRuntimeClasspath +commons-codec:commons-codec:1.16.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +commons-fileupload:commons-fileupload:1.5=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +commons-io:commons-io:2.11.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +commons-io:commons-io:2.20.0=spotbugs +de.siegmar:fastcsv:1.0.4=compileClasspath,testCompileClasspath,testRuntimeClasspath +de.siegmar:fastcsv:2.0.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath +de.siegmar:fastcsv:2.2.1=karate141TestCompileClasspath,karate141TestRuntimeClasspath +de.siegmar:fastcsv:3.4.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +de.thetaphi:forbiddenapis:3.10=compileClasspath,karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +info.cukes:cucumber-core:1.2.5=compileClasspath,karate131TestCompileClasspath,karate131TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +info.cukes:cucumber-java:1.2.5=compileClasspath,karate131TestCompileClasspath,karate131TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +info.picocli:picocli:4.5.2=compileClasspath,testCompileClasspath,testRuntimeClasspath +info.picocli:picocli:4.6.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath +info.picocli:picocli:4.7.1=karate141TestCompileClasspath,karate141TestRuntimeClasspath +info.picocli:picocli:4.7.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.github.classgraph:classgraph:4.8.149=karate131TestCompileClasspath,karate131TestRuntimeClasspath +io.github.classgraph:classgraph:4.8.160=karate141TestCompileClasspath,karate141TestRuntimeClasspath +io.github.classgraph:classgraph:4.8.181=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.github.t12y:resemble:1.0.2=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath +io.github.t12y:resemble:1.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.github.t12y:ssim:1.0.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.karatelabs:karate-core:1.5.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.karatelabs:karate-junit5:1.5.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.leangen.geantyref:geantyref:1.3.16=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.micrometer:context-propagation:1.1.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micrometer:micrometer-commons:1.11.3=karate141TestCompileClasspath,karate141TestRuntimeClasspath +io.micrometer:micrometer-commons:1.15.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micrometer:micrometer-core:1.11.3=karate141TestCompileClasspath,karate141TestRuntimeClasspath +io.micrometer:micrometer-core:1.15.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micrometer:micrometer-core:1.9.2=karate131TestCompileClasspath,karate131TestRuntimeClasspath +io.micrometer:micrometer-observation:1.11.3=karate141TestCompileClasspath,karate141TestRuntimeClasspath +io.micrometer:micrometer-observation:1.15.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-buffer:4.1.79.Final=karate131TestCompileClasspath,karate131TestRuntimeClasspath +io.netty:netty-buffer:4.1.96.Final=karate141TestCompileClasspath,karate141TestRuntimeClasspath +io.netty:netty-buffer:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-base:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-compression:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-dns:4.1.79.Final=karate131TestCompileClasspath,karate131TestRuntimeClasspath +io.netty:netty-codec-dns:4.1.96.Final=karate141TestCompileClasspath,karate141TestRuntimeClasspath +io.netty:netty-codec-dns:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-haproxy:4.1.79.Final=karate131TestCompileClasspath,karate131TestRuntimeClasspath +io.netty:netty-codec-haproxy:4.1.96.Final=karate141TestCompileClasspath,karate141TestRuntimeClasspath +io.netty:netty-codec-haproxy:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http2:4.1.79.Final=karate131TestCompileClasspath,karate131TestRuntimeClasspath +io.netty:netty-codec-http2:4.1.96.Final=karate141TestCompileClasspath,karate141TestRuntimeClasspath +io.netty:netty-codec-http2:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http:4.1.79.Final=karate131TestCompileClasspath,karate131TestRuntimeClasspath +io.netty:netty-codec-http:4.1.96.Final=karate141TestCompileClasspath,karate141TestRuntimeClasspath +io.netty:netty-codec-http:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-socks:4.1.79.Final=karate131TestRuntimeClasspath +io.netty:netty-codec-socks:4.1.96.Final=karate141TestRuntimeClasspath +io.netty:netty-codec-socks:4.2.6.Final=latestDepTestRuntimeClasspath +io.netty:netty-codec:4.1.79.Final=karate131TestCompileClasspath,karate131TestRuntimeClasspath +io.netty:netty-codec:4.1.96.Final=karate141TestCompileClasspath,karate141TestRuntimeClasspath +io.netty:netty-common:4.1.79.Final=karate131TestCompileClasspath,karate131TestRuntimeClasspath +io.netty:netty-common:4.1.96.Final=karate141TestCompileClasspath,karate141TestRuntimeClasspath +io.netty:netty-common:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler-proxy:4.1.79.Final=karate131TestRuntimeClasspath +io.netty:netty-handler-proxy:4.1.96.Final=karate141TestRuntimeClasspath +io.netty:netty-handler-proxy:4.2.6.Final=latestDepTestRuntimeClasspath +io.netty:netty-handler:4.1.79.Final=karate131TestCompileClasspath,karate131TestRuntimeClasspath +io.netty:netty-handler:4.1.96.Final=karate141TestCompileClasspath,karate141TestRuntimeClasspath +io.netty:netty-handler:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver-dns-classes-macos:4.1.79.Final=karate131TestRuntimeClasspath +io.netty:netty-resolver-dns-classes-macos:4.1.96.Final=karate141TestRuntimeClasspath +io.netty:netty-resolver-dns-classes-macos:4.2.6.Final=latestDepTestRuntimeClasspath +io.netty:netty-resolver-dns-native-macos:4.1.79.Final=karate131TestRuntimeClasspath +io.netty:netty-resolver-dns-native-macos:4.1.96.Final=karate141TestRuntimeClasspath +io.netty:netty-resolver-dns-native-macos:4.2.6.Final=latestDepTestRuntimeClasspath +io.netty:netty-resolver-dns:4.1.79.Final=karate131TestCompileClasspath,karate131TestRuntimeClasspath +io.netty:netty-resolver-dns:4.1.96.Final=karate141TestCompileClasspath,karate141TestRuntimeClasspath +io.netty:netty-resolver-dns:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver:4.1.79.Final=karate131TestCompileClasspath,karate131TestRuntimeClasspath +io.netty:netty-resolver:4.1.96.Final=karate141TestCompileClasspath,karate141TestRuntimeClasspath +io.netty:netty-resolver:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-tcnative-boringssl-static:2.0.53.Final=karate131TestRuntimeClasspath +io.netty:netty-tcnative-boringssl-static:2.0.61.Final=karate141TestRuntimeClasspath +io.netty:netty-tcnative-boringssl-static:2.0.73.Final=latestDepTestRuntimeClasspath +io.netty:netty-tcnative-classes:2.0.53.Final=karate131TestRuntimeClasspath +io.netty:netty-tcnative-classes:2.0.61.Final=karate141TestRuntimeClasspath +io.netty:netty-tcnative-classes:2.0.73.Final=latestDepTestRuntimeClasspath +io.netty:netty-transport-classes-epoll:4.1.79.Final=karate131TestRuntimeClasspath +io.netty:netty-transport-classes-epoll:4.1.96.Final=karate141TestRuntimeClasspath +io.netty:netty-transport-classes-epoll:4.2.6.Final=latestDepTestRuntimeClasspath +io.netty:netty-transport-classes-kqueue:4.1.96.Final=karate141TestRuntimeClasspath +io.netty:netty-transport-classes-kqueue:4.2.6.Final=latestDepTestRuntimeClasspath +io.netty:netty-transport-native-epoll:4.1.79.Final=karate131TestRuntimeClasspath +io.netty:netty-transport-native-epoll:4.1.96.Final=karate141TestRuntimeClasspath +io.netty:netty-transport-native-epoll:4.2.6.Final=latestDepTestRuntimeClasspath +io.netty:netty-transport-native-kqueue:4.1.96.Final=karate141TestRuntimeClasspath +io.netty:netty-transport-native-kqueue:4.2.6.Final=latestDepTestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.1.79.Final=karate131TestCompileClasspath,karate131TestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.1.96.Final=karate141TestCompileClasspath,karate141TestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport:4.1.79.Final=karate131TestCompileClasspath,karate131TestRuntimeClasspath +io.netty:netty-transport:4.1.96.Final=karate141TestCompileClasspath,karate141TestRuntimeClasspath +io.netty:netty-transport:4.2.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +javax.servlet:javax.servlet-api:3.1.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +jaxen:jaxen:2.0.0=spotbugs +junit:junit:4.13.2=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.java.dev.jna:jna-platform:5.8.0=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +net.java.dev.jna:jna:5.8.0=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +net.minidev:accessors-smart:1.2=compileClasspath +net.minidev:accessors-smart:2.4.9=karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,testRuntimeClasspath +net.minidev:accessors-smart:2.5.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +net.minidev:json-smart:2.3=compileClasspath +net.minidev:json-smart:2.4.10=karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,testRuntimeClasspath +net.minidev:json-smart:2.5.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +net.sf.saxon:Saxon-HE:12.9=spotbugs +ognl:ognl:3.1.26=karate131TestCompileClasspath,karate131TestRuntimeClasspath +ognl:ognl:3.3.4=karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.antlr:antlr4-runtime:4.11.1=karate141TestCompileClasspath,karate141TestRuntimeClasspath +org.antlr:antlr4-runtime:4.13.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.antlr:antlr4-runtime:4.9.3=karate131TestCompileClasspath,karate131TestRuntimeClasspath +org.apache.ant:ant-antlr:1.10.14=codenarc +org.apache.ant:ant-junit:1.10.14=codenarc +org.apache.bcel:bcel:6.11.0=spotbugs +org.apache.commons:commons-lang3:3.19.0=spotbugs +org.apache.commons:commons-text:1.14.0=spotbugs +org.apache.httpcomponents:httpclient:4.5.13=karate131TestCompileClasspath,karate131TestRuntimeClasspath +org.apache.httpcomponents:httpclient:4.5.14=karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.httpcomponents:httpcore:4.4.13=karate131TestCompileClasspath,karate131TestRuntimeClasspath +org.apache.httpcomponents:httpcore:4.4.16=karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.logging.log4j:log4j-api:2.25.2=spotbugs +org.apache.logging.log4j:log4j-core:2.25.2=spotbugs +org.apiguardian:apiguardian-api:1.1.2=karate131TestCompileClasspath,karate141TestCompileClasspath,latestDepTestCompileClasspath,testCompileClasspath +org.attoparser:attoparser:2.0.5.RELEASE=karate131TestCompileClasspath,karate131TestRuntimeClasspath +org.attoparser:attoparser:2.0.7.RELEASE=karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.brotli:dec:0.1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.checkerframework:checker-qual:3.33.0=annotationProcessor,karate131TestAnnotationProcessor,karate141TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +org.codehaus.groovy:groovy-ant:3.0.23=codenarc +org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc +org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.25=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-templates:3.0.23=codenarc +org.codehaus.groovy:groovy-xml:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.25=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codenarc:CodeNarc:3.7.0=codenarc +org.dom4j:dom4j:2.2.0=spotbugs +org.freemarker:freemarker:2.3.31=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.gmetrics:GMetrics:2.1.0=codenarc +org.graalvm.js:js-language:24.0.0=latestDepTestRuntimeClasspath +org.graalvm.js:js-scriptengine:21.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.graalvm.js:js-scriptengine:22.0.0.2=karate131TestCompileClasspath,karate131TestRuntimeClasspath +org.graalvm.js:js-scriptengine:22.3.3=karate141TestCompileClasspath,karate141TestRuntimeClasspath +org.graalvm.js:js-scriptengine:24.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.graalvm.js:js:21.0.0=testRuntimeClasspath +org.graalvm.js:js:22.0.0.2=karate131TestRuntimeClasspath +org.graalvm.js:js:22.3.3=karate141TestRuntimeClasspath +org.graalvm.polyglot:polyglot:24.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.graalvm.regex:regex:21.0.0=testRuntimeClasspath +org.graalvm.regex:regex:22.0.0.2=karate131TestRuntimeClasspath +org.graalvm.regex:regex:22.3.3=karate141TestRuntimeClasspath +org.graalvm.regex:regex:24.0.0=latestDepTestRuntimeClasspath +org.graalvm.sdk:collections:24.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.graalvm.sdk:graal-sdk:21.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.graalvm.sdk:graal-sdk:22.0.0.2=karate131TestCompileClasspath,karate131TestRuntimeClasspath +org.graalvm.sdk:graal-sdk:22.3.3=karate141TestCompileClasspath,karate141TestRuntimeClasspath +org.graalvm.sdk:nativeimage:24.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.graalvm.sdk:word:24.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.graalvm.shadowed:icu4j:24.0.0=latestDepTestRuntimeClasspath +org.graalvm.truffle:truffle-api:21.0.0=testRuntimeClasspath +org.graalvm.truffle:truffle-api:22.0.0.2=karate131TestRuntimeClasspath +org.graalvm.truffle:truffle-api:22.3.3=karate141TestRuntimeClasspath +org.graalvm.truffle:truffle-api:24.0.0=latestDepTestRuntimeClasspath +org.hamcrest:hamcrest-core:1.3=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.hamcrest:hamcrest:3.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.hdrhistogram:HdrHistogram:2.1.12=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestRuntimeClasspath +org.hdrhistogram:HdrHistogram:2.2.2=latestDepTestRuntimeClasspath +org.jacoco:org.jacoco.core:0.8.15=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.report:0.8.15=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.javassist:javassist:3.20.0-GA=karate131TestCompileClasspath,karate131TestRuntimeClasspath +org.javassist:javassist:3.29.0-GA=karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jctools:jctools-core-jdk11:4.0.6=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jctools:jctools-core:4.0.6=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:5.14.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.14.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.14.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.14.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.14.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.14.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-runner:1.14.1=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-api:1.14.1=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-commons:1.14.1=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit:junit-bom:5.14.0=spotbugs +org.junit:junit-bom:5.14.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.latencyutils:LatencyUtils:2.0.3=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath +org.mockito:mockito-core:4.4.0=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.msgpack:jackson-dataformat-msgpack:0.9.6=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.msgpack:msgpack-core:0.9.6=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.objenesis:objenesis:3.3=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.opentest4j:opentest4j:1.3.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-analysis:9.7.1=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.9=spotbugs +org.ow2.asm:asm-util:9.7.1=karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs +org.reactivestreams:reactive-streams:1.0.4=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.skyscreamer:jsonassert:1.5.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:jcl-over-slf4j:1.7.30=karate131TestCompileClasspath,karate141TestCompileClasspath,latestDepTestCompileClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:jcl-over-slf4j:1.7.32=karate131TestRuntimeClasspath +org.slf4j:jcl-over-slf4j:2.0.17=latestDepTestRuntimeClasspath +org.slf4j:jcl-over-slf4j:2.0.9=karate141TestRuntimeClasspath +org.slf4j:jul-to-slf4j:1.7.30=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:log4j-over-slf4j:1.7.30=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath +org.slf4j:slf4j-api:1.7.32=testCompileClasspath +org.slf4j:slf4j-api:1.7.36=karate131TestCompileClasspath,karate131TestRuntimeClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:2.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,spotbugsSlf4j +org.slf4j:slf4j-api:2.0.7=karate141TestCompileClasspath +org.slf4j:slf4j-api:2.0.9=karate141TestRuntimeClasspath +org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j +org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,karate131TestRuntimeClasspath,karate141TestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +org.spockframework:spock-bom:2.4-groovy-3.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.spockframework:spock-core:2.4-groovy-3.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-junit:1.2.1=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-parser:1.2.0=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.thymeleaf:thymeleaf:3.0.14.RELEASE=karate131TestCompileClasspath,karate131TestRuntimeClasspath +org.thymeleaf:thymeleaf:3.1.2.RELEASE=karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.unbescape:unbescape:1.1.6.RELEASE=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.xmlresolver:xmlresolver:5.3.3=spotbugs +org.xmlunit:xmlunit-core:2.10.3=karate131TestCompileClasspath,karate131TestRuntimeClasspath,karate141TestCompileClasspath,karate141TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.yaml:snakeyaml:1.27=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.yaml:snakeyaml:1.32=karate131TestCompileClasspath,karate131TestRuntimeClasspath +org.yaml:snakeyaml:2.0=karate141TestCompileClasspath,karate141TestRuntimeClasspath +org.yaml:snakeyaml:2.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +empty=spotbugsPlugins diff --git a/dd-java-agent/instrumentation/karate/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/ExecutionContext.java b/dd-java-agent/instrumentation/karate/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/ExecutionContext.java new file mode 100644 index 00000000000..cf909a85e89 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/ExecutionContext.java @@ -0,0 +1,37 @@ +package datadog.trace.instrumentation.karate; + +import com.intuit.karate.core.Scenario; +import datadog.trace.api.civisibility.config.TestIdentifier; +import datadog.trace.api.civisibility.config.TestSourceData; +import datadog.trace.api.civisibility.execution.TestExecutionPolicy; +import java.util.Collection; + +public class ExecutionContext { + + private final TestExecutionPolicy executionPolicy; + private boolean suppressFailures; + + public ExecutionContext(TestExecutionPolicy executionPolicy) { + this.executionPolicy = executionPolicy; + } + + public void setSuppressFailures(boolean suppressFailures) { + this.suppressFailures = suppressFailures; + } + + public boolean shouldSuppressFailures() { + return suppressFailures; + } + + public TestExecutionPolicy getExecutionPolicy() { + return executionPolicy; + } + + public static ExecutionContext create(Scenario scenario) { + TestIdentifier testIdentifier = KarateUtils.toTestIdentifier(scenario); + Collection testTags = scenario.getTagsEffective().getTagKeys(); + return new ExecutionContext( + TestEventsHandlerHolder.TEST_EVENTS_HANDLER.executionPolicy( + testIdentifier, TestSourceData.UNKNOWN, testTags)); + } +} diff --git a/dd-java-agent/instrumentation/karate/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/KarateExecutionInstrumentation.java b/dd-java-agent/instrumentation/karate/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/KarateExecutionInstrumentation.java new file mode 100644 index 00000000000..1a1b030fac1 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/KarateExecutionInstrumentation.java @@ -0,0 +1,173 @@ +package datadog.trace.instrumentation.karate; + +import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static net.bytebuddy.matcher.ElementMatchers.takesArgument; +import static net.bytebuddy.matcher.ElementMatchers.takesArguments; +import static net.bytebuddy.matcher.ElementMatchers.takesNoArguments; + +import com.google.auto.service.AutoService; +import com.intuit.karate.RuntimeHook; +import com.intuit.karate.core.Result; +import com.intuit.karate.core.Scenario; +import com.intuit.karate.core.ScenarioResult; +import com.intuit.karate.core.ScenarioRuntime; +import com.intuit.karate.core.StepResult; +import datadog.trace.agent.tooling.Instrumenter; +import datadog.trace.agent.tooling.InstrumenterModule; +import datadog.trace.api.Config; +import datadog.trace.api.civisibility.execution.TestExecutionPolicy; +import datadog.trace.bootstrap.CallDepthThreadLocalMap; +import datadog.trace.bootstrap.InstrumentationContext; +import java.util.Collections; +import java.util.Map; +import net.bytebuddy.asm.Advice; + +@AutoService(InstrumenterModule.class) +public class KarateExecutionInstrumentation extends InstrumenterModule.CiVisibility + implements Instrumenter.ForKnownTypes, Instrumenter.HasMethodAdvice { + + public KarateExecutionInstrumentation() { + super("ci-visibility", "karate", "test-retry"); + } + + @Override + public boolean isEnabled() { + return super.isEnabled() && Config.get().isCiVisibilityExecutionPoliciesEnabled(); + } + + @Override + public String[] knownMatchingTypes() { + return new String[] { + "com.intuit.karate.core.ScenarioRuntime", "com.intuit.karate.core.ScenarioResult" + }; + } + + @Override + public String[] helperClassNames() { + return new String[] { + packageName + ".KarateUtils", + packageName + ".TestEventsHandlerHolder", + packageName + ".KarateTracingHook", + packageName + ".ExecutionContext" + }; + } + + @Override + public Map contextStore() { + return Collections.singletonMap( + "com.intuit.karate.core.Scenario", packageName + ".ExecutionContext"); + } + + @Override + public void methodAdvice(MethodTransformer transformer) { + // ScenarioRuntime + transformer.applyAdvice( + named("run").and(takesNoArguments()), + KarateExecutionInstrumentation.class.getName() + "$RetryAdvice"); + + // ScenarioResult + transformer.applyAdvice( + named("addStepResult") + .and(takesArguments(1)) + .and(takesArgument(0, named("com.intuit.karate.core.StepResult"))), + KarateExecutionInstrumentation.class.getName() + "$SuppressErrorAdvice"); + } + + public static class RetryAdvice { + @Advice.OnMethodEnter + public static void beforeExecute(@Advice.This ScenarioRuntime scenarioRuntime) { + if (KarateTracingHook.skipTracking(scenarioRuntime)) { + return; + } + + ExecutionContext executionContext = + InstrumentationContext.get(Scenario.class, ExecutionContext.class) + .computeIfAbsent(scenarioRuntime.scenario, ExecutionContext::create); + + // Indicate beforehand if the failures should be suppressed. This aligns the ordering with the + // rest of the frameworks + TestExecutionPolicy executionPolicy = executionContext.getExecutionPolicy(); + executionContext.setSuppressFailures(executionPolicy.suppressFailures()); + + scenarioRuntime.magicVariables.putIfAbsent( + KarateUtils.EXECUTION_TRACKER_MAGICVARIABLE, executionPolicy); + } + + @Advice.OnMethodExit + public static void afterExecute(@Advice.This ScenarioRuntime scenarioRuntime) { + if (KarateTracingHook.skipTracking(scenarioRuntime)) { + return; + } + + if (CallDepthThreadLocalMap.incrementCallDepth(ScenarioRuntime.class) > 0) { + // nested call + return; + } + + Scenario scenario = scenarioRuntime.scenario; + ExecutionContext context = + InstrumentationContext.get(Scenario.class, ExecutionContext.class).get(scenario); + if (context == null) { + return; + } + + ScenarioResult originalResult = scenarioRuntime.result; + ScenarioResult finalResult = originalResult; + + TestExecutionPolicy executionPolicy = context.getExecutionPolicy(); + while (executionPolicy.applicable()) { + ScenarioRuntime retry = + new ScenarioRuntime(scenarioRuntime.featureRuntime, scenarioRuntime.scenario); + retry.magicVariables.put(KarateUtils.EXECUTION_TRACKER_MAGICVARIABLE, executionPolicy); + retry.run(); + retry.featureRuntime.result.addResult(retry.result); + finalResult = retry.result; + } + + // When the scenario is retried, the original runtime's result must reflect the final + // attempt's outcome. To avoid final field modifications, the final attempt's failure is + // reflected onto the original result via addStepResult + if (finalResult.isFailed() && !originalResult.isFailed()) { + originalResult.addStepResult(finalResult.getFailedStep()); + } + + CallDepthThreadLocalMap.reset(ScenarioRuntime.class); + } + + // Karate 1.0.0 and above + public static void muzzleCheck(RuntimeHook runtimeHook) { + runtimeHook.beforeSuite(null); + } + } + + public static class SuppressErrorAdvice { + @Advice.OnMethodEnter + public static void onAddingStepResult( + @Advice.Argument(value = 0, readOnly = false) StepResult stepResult, + @Advice.FieldValue("scenario") Scenario scenario) { + + Result result = stepResult.getResult(); + if (result.isFailed()) { + ExecutionContext executionContext = + InstrumentationContext.get(Scenario.class, ExecutionContext.class).get(scenario); + if (executionContext == null) { + return; + } + + // Suppress every failing step of a to-be-retried attempt (not just the first): with + // continueOnStepFailure a single attempt can add multiple failing steps, and any leak would + // mark the original runtime's result failed + if (executionContext.shouldSuppressFailures()) { + stepResult = new StepResult(stepResult.getStep(), KarateUtils.abortedResult()); + stepResult.setFailedReason(result.getError()); + stepResult.setErrorIgnored(true); + } + } + } + + // Karate 1.0.0 and above + public static void muzzleCheck(RuntimeHook runtimeHook) { + runtimeHook.beforeSuite(null); + } + } +} diff --git a/dd-java-agent/instrumentation/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/KarateInstrumentation.java b/dd-java-agent/instrumentation/karate/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/KarateInstrumentation.java similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/KarateInstrumentation.java rename to dd-java-agent/instrumentation/karate/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/KarateInstrumentation.java diff --git a/dd-java-agent/instrumentation/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/KarateTracingHook.java b/dd-java-agent/instrumentation/karate/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/KarateTracingHook.java similarity index 98% rename from dd-java-agent/instrumentation/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/KarateTracingHook.java rename to dd-java-agent/instrumentation/karate/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/KarateTracingHook.java index 1f56a1e7ebb..4542e816c92 100644 --- a/dd-java-agent/instrumentation/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/KarateTracingHook.java +++ b/dd-java-agent/instrumentation/karate/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/KarateTracingHook.java @@ -205,7 +205,7 @@ public boolean beforeStep(Step step, ScenarioRuntime sr) { String stepName = step.getPrefix() + " " + step.getText(); span.setResourceName(stepName); span.setTag(Tags.COMPONENT, "karate"); - span.context().setIntegrationName("karate"); + span.spanContext().setIntegrationName("karate"); span.setTag("step.name", stepName); span.setTag("step.startLine", step.getLine()); span.setTag("step.endLine", step.getEndLine()); @@ -233,7 +233,7 @@ private static boolean skipTracking(FeatureRuntime fr) { return !fr.caller.isNone(); } - private static boolean skipTracking(ScenarioRuntime sr) { + public static boolean skipTracking(ScenarioRuntime sr) { // do not track nested scenario calls and setup scenarios return !sr.caller.isNone() || sr.tags.getTagKeys().contains("setup"); } diff --git a/dd-java-agent/instrumentation/karate/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/KarateUtils.java b/dd-java-agent/instrumentation/karate/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/KarateUtils.java new file mode 100644 index 00000000000..1525d5dd741 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/KarateUtils.java @@ -0,0 +1,172 @@ +package datadog.trace.instrumentation.karate; + +import static datadog.json.JsonMapper.toJson; + +import com.intuit.karate.FileUtils; +import com.intuit.karate.core.Feature; +import com.intuit.karate.core.FeatureRuntime; +import com.intuit.karate.core.Result; +import com.intuit.karate.core.Scenario; +import com.intuit.karate.core.ScenarioRuntime; +import com.intuit.karate.core.Tag; +import datadog.trace.api.civisibility.config.LibraryCapability; +import datadog.trace.api.civisibility.config.TestIdentifier; +import datadog.trace.api.civisibility.events.TestDescriptor; +import datadog.trace.api.civisibility.events.TestSuiteDescriptor; +import datadog.trace.util.ComparableVersion; +import datadog.trace.util.MethodHandles; +import datadog.trace.util.Strings; +import java.lang.invoke.MethodHandle; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +public abstract class KarateUtils { + + public static final String EXECUTION_TRACKER_MAGICVARIABLE = "__datadog_execution_tracker"; + + private KarateUtils() {} + + private static final MethodHandles METHOD_HANDLES = + new MethodHandles(FeatureRuntime.class.getClassLoader()); + private static final MethodHandle FEATURE_RUNTIME_FEATURE_GETTER = + METHOD_HANDLES.privateFieldGetter(FeatureRuntime.class, "feature"); + private static final MethodHandle FEATURE_RUNTIME_FEATURE_CALL_GETTER = + METHOD_HANDLES.privateFieldGetter(FeatureRuntime.class, "featureCall"); + private static final MethodHandle FEATURE_RUNTIME_BEFORE_HOOK_DONE_GETTER = + METHOD_HANDLES.privateFieldGetter(FeatureRuntime.class, "beforeHookDone"); + private static final MethodHandle FEATURE_RUNTIME_BEFORE_HOOK_DONE_SETTER = + METHOD_HANDLES.privateFieldSetter(FeatureRuntime.class, "beforeHookDone"); + private static final MethodHandle FEATURE_CALL_FEATURE_GETTER = + METHOD_HANDLES.privateFieldGetter("com.intuit.karate.core.FeatureCall", "feature"); + private static final MethodHandle ABORTED_RESULT_DURATION_NANOS = + METHOD_HANDLES.method(Result.class, "aborted", long.class); + // static method to create aborted result has a different signature starting with Karate 1.4.1 + private static final MethodHandle ABORTED_RESULT_STARTTIME_DURATION_NANOS = + METHOD_HANDLES.method(Result.class, "aborted", long.class, long.class); + + private static final ComparableVersion karateV12 = new ComparableVersion("1.2.0"); + private static final ComparableVersion karateV13 = new ComparableVersion("1.3.0"); + + public static final List CAPABILITIES_BASE = + Arrays.asList( + LibraryCapability.ATR, + LibraryCapability.EFD, + LibraryCapability.FTR, + LibraryCapability.QUARANTINE, + LibraryCapability.ATTEMPT_TO_FIX); + + public static final List CAPABILITIES_SKIPPING = + Arrays.asList( + LibraryCapability.ATR, + LibraryCapability.EFD, + LibraryCapability.FTR, + LibraryCapability.QUARANTINE, + LibraryCapability.ATTEMPT_TO_FIX, + LibraryCapability.TIA, + LibraryCapability.DISABLED); + + public static Feature getFeature(FeatureRuntime featureRuntime) { + if (FEATURE_RUNTIME_FEATURE_CALL_GETTER != null) { + Object featureCall = + METHOD_HANDLES.invoke(FEATURE_RUNTIME_FEATURE_CALL_GETTER, featureRuntime); + if (featureCall != null && FEATURE_CALL_FEATURE_GETTER != null) { + return METHOD_HANDLES.invoke(FEATURE_CALL_FEATURE_GETTER, featureCall); + } + } else if (FEATURE_RUNTIME_FEATURE_GETTER != null) { + // Karate versions prior to 1.3.0 + return METHOD_HANDLES.invoke(FEATURE_RUNTIME_FEATURE_GETTER, featureRuntime); + } + return null; + } + + public static String getScenarioName(Scenario scenario) { + String scenarioName = scenario.getName(); + if (Strings.isNotBlank(scenarioName)) { + return scenarioName; + } else { + return scenario.getRefId(); + } + } + + public static List getCategories(List tags) { + if (tags == null) { + return Collections.emptyList(); + } + + List categories = new ArrayList<>(tags.size()); + for (Tag tag : tags) { + categories.add(tag.getName()); + } + return categories; + } + + public static String getParameters(Scenario scenario) { + return scenario.getExampleData() != null ? toJson(scenario.getExampleData()) : null; + } + + public static TestIdentifier toTestIdentifier(Scenario scenario) { + Feature feature = scenario.getFeature(); + String featureName = feature.getNameForReport(); + String scenarioName = KarateUtils.getScenarioName(scenario); + String parameters = KarateUtils.getParameters(scenario); + return new TestIdentifier(featureName, scenarioName, parameters); + } + + public static TestDescriptor toTestDescriptor(ScenarioRuntime scenarioRuntime) { + Scenario scenario = scenarioRuntime.scenario; + Feature feature = scenario.getFeature(); + String featureName = feature.getNameForReport(); + String scenarioName = KarateUtils.getScenarioName(scenario); + String parameters = KarateUtils.getParameters(scenario); + return new TestDescriptor(featureName, null, scenarioName, parameters, scenarioRuntime); + } + + public static TestSuiteDescriptor toSuiteDescriptor(FeatureRuntime featureRuntime) { + String featureName = KarateUtils.getFeature(featureRuntime).getNameForReport(); + return new TestSuiteDescriptor(featureName, null); + } + + public static Result abortedResult() { + if (ABORTED_RESULT_STARTTIME_DURATION_NANOS != null) { + long startTime = System.currentTimeMillis(); + long durationNanos = 1; + return METHOD_HANDLES.invoke( + ABORTED_RESULT_STARTTIME_DURATION_NANOS, startTime, durationNanos); + } else { + long durationNanos = 1; + return METHOD_HANDLES.invoke(ABORTED_RESULT_DURATION_NANOS, durationNanos); + } + } + + public static boolean isBeforeHookExecuted(FeatureRuntime featureRuntime) { + Boolean beforeHookDone = + METHOD_HANDLES.invoke(FEATURE_RUNTIME_BEFORE_HOOK_DONE_GETTER, featureRuntime); + return beforeHookDone != null ? beforeHookDone : true; + } + + public static void resetBeforeHook(FeatureRuntime featureRuntime) { + METHOD_HANDLES.invoke(FEATURE_RUNTIME_BEFORE_HOOK_DONE_SETTER, featureRuntime, false); + } + + public static String getKarateVersion() { + return FileUtils.KARATE_VERSION; + } + + public static boolean isSkippingSupported(String version) { + return version != null && karateV12.compareTo(new ComparableVersion(version)) <= 0; + } + + public static boolean isSetupTagSupported(String version) { + return version != null && karateV13.compareTo(new ComparableVersion(version)) <= 0; + } + + public static List capabilities(String frameworkVersion) { + if (isSkippingSupported(frameworkVersion)) { + return CAPABILITIES_SKIPPING; + } + + return CAPABILITIES_BASE; + } +} diff --git a/dd-java-agent/instrumentation/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/TestEventsHandlerHolder.java b/dd-java-agent/instrumentation/karate/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/TestEventsHandlerHolder.java similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/TestEventsHandlerHolder.java rename to dd-java-agent/instrumentation/karate/karate-1.0/src/main/java/datadog/trace/instrumentation/karate/TestEventsHandlerHolder.java diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/groovy/KarateTest.groovy b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/groovy/KarateTest.groovy similarity index 83% rename from dd-java-agent/instrumentation/karate-1.0/src/test/groovy/KarateTest.groovy rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/groovy/KarateTest.groovy index 0ae24e826fc..4cafd545c09 100644 --- a/dd-java-agent/instrumentation/karate-1.0/src/test/groovy/KarateTest.groovy +++ b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/groovy/KarateTest.groovy @@ -72,16 +72,21 @@ class KarateTest extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | success | tests | retriedTests - "test-failed" | false | [TestFailedKarate] | [] - "test-retry-failed" | false | [TestFailedKarate] | [new TestFQN("[org/example/test_failed] test failed", "second scenario")] - "test-failed-then-succeed" | true | [TestFailedThenSucceedKarate] | [new TestFQN("[org/example/test_failed_then_succeed] test failed", "flaky scenario")] - "test-retry-parameterized" | false | [TestFailedParameterizedKarate] | [ + testcaseName | success | tests | retriedTests + "test-failed" | false | [TestFailedKarate] | [] + "test-retry-failed" | false | [TestFailedKarate] | [new TestFQN("[org/example/test_failed] test failed", "second scenario")] + "test-failed-then-succeed" | true | [TestFailedThenSucceedKarate] | [new TestFQN("[org/example/test_failed_then_succeed] test failed", "flaky scenario")] + "test-retry-continue-on-step-failure" | true | [TestContinueOnStepFailureKarate] | [ + new TestFQN("[org/example/test_continue_on_step_failure] test continue on step failure", "flaky scenario") + ] + "test-retry-parameterized" | false | [TestFailedParameterizedKarate] | [ new TestFQN("[org/example/test_failed_parameterized] test parameterized", "first scenario as an outline") ] } def "test early flakiness detection #testcaseName"() { + Assumptions.assumeTrue(assumption) + givenEarlyFlakinessDetectionEnabled(true) givenKnownTests(knownTestsList) @@ -90,16 +95,18 @@ class KarateTest extends CiVisibilityInstrumentationTest { assertSpansData(testcaseName) where: - testcaseName | tests | knownTestsList - "test-efd-known-test" | [TestSucceedOneCaseKarate] | [new TestFQN("[org/example/test_succeed_one_case] test succeed", "first scenario")] + testcaseName | tests | knownTestsList | assumption + "test-efd-known-test" | [TestSucceedOneCaseKarate] | [new TestFQN("[org/example/test_succeed_one_case] test succeed", "first scenario")] | true "test-efd-known-parameterized-test" | [TestParameterizedKarate] | [ new TestFQN("[org/example/test_parameterized] test parameterized", "first scenario as an outline") - ] - "test-efd-new-test" | [TestSucceedOneCaseKarate] | [] - "test-efd-new-parameterized-test" | [TestParameterizedKarate] | [] - "test-efd-new-slow-test" | [TestSucceedKarateSlow] | [] // is executed only twice - "test-efd-faulty-session-threshold" | [TestParameterizedMoreCasesKarate] | [] - "test-efd-skip-new-test" | [TestSucceedKarateSkipEfd] | [] + ] | true + "test-efd-new-test" | [TestSucceedOneCaseKarate] | [] | true + "test-efd-new-parameterized-test" | [TestParameterizedKarate] | [] | true + "test-efd-new-slow-test" | [TestSucceedKarateSlow] | [] | true // is executed only twice + "test-efd-faulty-session-threshold" | [TestParameterizedMoreCasesKarate] | [] | true + "test-efd-skip-new-test" | [TestSucceedKarateSkipEfd] | [] | true + "test-efd-setup" | [TestWithSetupKarate] | [] | KarateUtils.isSetupTagSupported(KarateUtils.getKarateVersion()) + "test-efd-called-feature" | [TestSucceedCalledFeatureKarate] | [new TestFQN("[org/example/test_called_feature] test called feature", "caller")] | true } def "test quarantined #testcaseName"() { diff --git a/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/Flaky.java b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/Flaky.java new file mode 100644 index 00000000000..2a474c24299 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/Flaky.java @@ -0,0 +1,20 @@ +package org.example; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +public class Flaky { + + private static int counter = 0; + private static int stepCounter = 0; + + // Fails the first two attempts, passes from the third onwards. + public static void flake() { + assertTrue(++counter >= 3); + } + + // Same flaky behavior exposed as a value, for continueOnStepFailure scenarios that assert it in + // several steps. Uses a separate counter because both helpers run in the same test JVM. + public static boolean shouldPass() { + return ++stepCounter >= 3; + } +} diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/Slow.java b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/Slow.java similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/Slow.java rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/Slow.java diff --git a/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestContinueOnStepFailureKarate.java b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestContinueOnStepFailureKarate.java new file mode 100644 index 00000000000..7aa9d4c435a --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestContinueOnStepFailureKarate.java @@ -0,0 +1,11 @@ +package org.example; + +import com.intuit.karate.junit5.Karate; + +public class TestContinueOnStepFailureKarate { + + @Karate.Test + public Karate test() { + return Karate.run("classpath:org/example/test_continue_on_step_failure.feature"); + } +} diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestFailedBuiltInRetryKarate.java b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestFailedBuiltInRetryKarate.java similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestFailedBuiltInRetryKarate.java rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestFailedBuiltInRetryKarate.java diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestFailedKarate.java b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestFailedKarate.java similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestFailedKarate.java rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestFailedKarate.java diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestFailedParameterizedKarate.java b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestFailedParameterizedKarate.java similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestFailedParameterizedKarate.java rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestFailedParameterizedKarate.java diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestFailedThenSucceedKarate.java b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestFailedThenSucceedKarate.java similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestFailedThenSucceedKarate.java rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestFailedThenSucceedKarate.java diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestParameterizedKarate.java b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestParameterizedKarate.java similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestParameterizedKarate.java rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestParameterizedKarate.java diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestParameterizedMoreCasesKarate.java b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestParameterizedMoreCasesKarate.java similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestParameterizedMoreCasesKarate.java rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestParameterizedMoreCasesKarate.java diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestSkippedFeatureKarate.java b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestSkippedFeatureKarate.java similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestSkippedFeatureKarate.java rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestSkippedFeatureKarate.java diff --git a/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestSucceedCalledFeatureKarate.java b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestSucceedCalledFeatureKarate.java new file mode 100644 index 00000000000..f0db64756aa --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestSucceedCalledFeatureKarate.java @@ -0,0 +1,11 @@ +package org.example; + +import com.intuit.karate.junit5.Karate; + +public class TestSucceedCalledFeatureKarate { + + @Karate.Test + public Karate testCalledFeature() { + return Karate.run("classpath:org/example/test_called_feature.feature"); + } +} diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestSucceedKarate.java b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestSucceedKarate.java similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestSucceedKarate.java rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestSucceedKarate.java diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestSucceedKarateSkipEfd.java b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestSucceedKarateSkipEfd.java similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestSucceedKarateSkipEfd.java rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestSucceedKarateSkipEfd.java diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestSucceedKarateSlow.java b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestSucceedKarateSlow.java similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestSucceedKarateSlow.java rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestSucceedKarateSlow.java diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestSucceedOneCaseKarate.java b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestSucceedOneCaseKarate.java similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestSucceedOneCaseKarate.java rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestSucceedOneCaseKarate.java diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestSucceedParallelKarate.java b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestSucceedParallelKarate.java similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestSucceedParallelKarate.java rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestSucceedParallelKarate.java diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestUnskippableKarate.java b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestUnskippableKarate.java similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestUnskippableKarate.java rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestUnskippableKarate.java diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestWithSetupKarate.java b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestWithSetupKarate.java similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/TestWithSetupKarate.java rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/TestWithSetupKarate.java diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/karate-config.js b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/karate-config.js similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/karate-config.js rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/karate-config.js diff --git a/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_called_feature.feature b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_called_feature.feature new file mode 100644 index 00000000000..397dfdcf103 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_called_feature.feature @@ -0,0 +1,4 @@ +Feature: test called feature + + Scenario: caller + * call read('test_called_feature_nested.feature') diff --git a/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_called_feature_nested.feature b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_called_feature_nested.feature new file mode 100644 index 00000000000..4dcb62008a4 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_called_feature_nested.feature @@ -0,0 +1,4 @@ +Feature: test called feature nested + + Scenario: called + * def value = true diff --git a/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_continue_on_step_failure.feature b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_continue_on_step_failure.feature new file mode 100644 index 00000000000..83fe25d5f84 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_continue_on_step_failure.feature @@ -0,0 +1,7 @@ +Feature: test continue on step failure + + Scenario: flaky scenario + * configure continueOnStepFailure = { enabled: true, continueAfter: true } + * def pass = Java.type('org.example.Flaky').shouldPass() + * match pass == true + * match pass == true diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/test_failed.feature b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_failed.feature similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/test_failed.feature rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_failed.feature diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/test_failed_parameterized.feature b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_failed_parameterized.feature similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/test_failed_parameterized.feature rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_failed_parameterized.feature diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/test_failed_then_succeed.feature b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_failed_then_succeed.feature similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/test_failed_then_succeed.feature rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_failed_then_succeed.feature diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/test_parameterized.feature b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_parameterized.feature similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/test_parameterized.feature rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_parameterized.feature diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/test_parameterized_more_cases.feature b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_parameterized_more_cases.feature similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/test_parameterized_more_cases.feature rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_parameterized_more_cases.feature diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/test_succeed.feature b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_succeed.feature similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/test_succeed.feature rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_succeed.feature diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/test_succeed_one_case.feature b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_succeed_one_case.feature similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/test_succeed_one_case.feature rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_succeed_one_case.feature diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/test_succeed_skip_efd.feature b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_succeed_skip_efd.feature similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/test_succeed_skip_efd.feature rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_succeed_skip_efd.feature diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/test_succeed_slow.feature b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_succeed_slow.feature similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/test_succeed_slow.feature rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_succeed_slow.feature diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/test_unskippable.feature b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_unskippable.feature similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/test_unskippable.feature rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_unskippable.feature diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/test_with_setup.feature b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_with_setup.feature similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/test_with_setup.feature rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/java/org/example/test_with_setup.feature diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-attempt-to-fix-disabled-failed/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-attempt-to-fix-disabled-failed/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-attempt-to-fix-disabled-failed/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-attempt-to-fix-disabled-failed/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-attempt-to-fix-disabled-failed/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-attempt-to-fix-disabled-failed/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-attempt-to-fix-disabled-failed/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-attempt-to-fix-disabled-failed/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-attempt-to-fix-disabled-succeeded/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-attempt-to-fix-disabled-succeeded/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-attempt-to-fix-disabled-succeeded/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-attempt-to-fix-disabled-succeeded/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-attempt-to-fix-disabled-succeeded/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-attempt-to-fix-disabled-succeeded/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-attempt-to-fix-disabled-succeeded/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-attempt-to-fix-disabled-succeeded/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-attempt-to-fix-failed/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-attempt-to-fix-failed/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-attempt-to-fix-failed/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-attempt-to-fix-failed/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-attempt-to-fix-failed/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-attempt-to-fix-failed/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-attempt-to-fix-failed/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-attempt-to-fix-failed/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-attempt-to-fix-quarantined-failed/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-attempt-to-fix-quarantined-failed/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-attempt-to-fix-quarantined-failed/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-attempt-to-fix-quarantined-failed/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-attempt-to-fix-quarantined-failed/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-attempt-to-fix-quarantined-failed/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-attempt-to-fix-quarantined-failed/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-attempt-to-fix-quarantined-failed/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-attempt-to-fix-quarantined-succeeded/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-attempt-to-fix-quarantined-succeeded/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-attempt-to-fix-quarantined-succeeded/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-attempt-to-fix-quarantined-succeeded/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-attempt-to-fix-quarantined-succeeded/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-attempt-to-fix-quarantined-succeeded/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-attempt-to-fix-quarantined-succeeded/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-attempt-to-fix-quarantined-succeeded/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-attempt-to-fix-succeeded/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-attempt-to-fix-succeeded/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-attempt-to-fix-succeeded/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-attempt-to-fix-succeeded/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-attempt-to-fix-succeeded/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-attempt-to-fix-succeeded/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-attempt-to-fix-succeeded/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-attempt-to-fix-succeeded/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-built-in-retry/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-built-in-retry/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-built-in-retry/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-built-in-retry/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-built-in-retry/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-built-in-retry/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-built-in-retry/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-built-in-retry/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-disabled-failed/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-disabled-failed/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-disabled-failed/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-disabled-failed/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-disabled-failed/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-disabled-failed/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-disabled-failed/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-disabled-failed/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-faulty-session-threshold/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-called-feature/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-faulty-session-threshold/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-called-feature/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-called-feature/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-called-feature/events.ftl new file mode 100644 index 00000000000..60071b5ef53 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-called-feature/events.ftl @@ -0,0 +1,192 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* call read('test_called_feature_nested.feature')" + }, + "metrics" : { + "step.endLine" : 4, + "step.startLine" : 4 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* call read('test_called_feature_nested.feature')", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* def value = true" + }, + "metrics" : { + "step.endLine" : 4, + "step.startLine" : 4 + }, + "name" : "karate.step", + "parent_id" : ${content_span_id}, + "resource" : "* def value = true", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-1.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_called_feature] test called feature", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_called_feature] test called feature", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-1.0", + "test.name" : "caller", + "test.status" : "pass", + "test.suite" : "[org/example/test_called_feature] test called feature", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_2}, + "resource" : "[org/example/test_called_feature] test called feature.caller", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-1.0", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-1.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_5}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-1.0", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4} + }, + "name" : "karate.test_module", + "resource" : "karate-1.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_6}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-known-parameterized-test/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-faulty-session-threshold/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-known-parameterized-test/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-faulty-session-threshold/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-faulty-session-threshold/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-faulty-session-threshold/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-faulty-session-threshold/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-faulty-session-threshold/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-known-test/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-known-parameterized-test/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-known-test/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-known-parameterized-test/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-known-parameterized-test/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-known-parameterized-test/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-known-parameterized-test/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-known-parameterized-test/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-new-parameterized-test/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-known-test/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-new-parameterized-test/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-known-test/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-known-test/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-known-test/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-known-test/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-known-test/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-new-slow-test/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-new-parameterized-test/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-new-slow-test/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-new-parameterized-test/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-new-parameterized-test/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-new-parameterized-test/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-new-parameterized-test/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-new-parameterized-test/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-new-test/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-new-slow-test/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-new-test/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-new-slow-test/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-new-slow-test/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-new-slow-test/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-new-slow-test/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-new-slow-test/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-skip-new-test/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-new-test/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-skip-new-test/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-new-test/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-new-test/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-new-test/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-new-test/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-new-test/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-failed-then-succeed/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-setup/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-failed-then-succeed/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-setup/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-setup/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-setup/events.ftl new file mode 100644 index 00000000000..6f8a76bef9b --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-setup/events.ftl @@ -0,0 +1,527 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* print foo" + }, + "metrics" : { + "step.endLine" : 15, + "step.startLine" : 15 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* print foo", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* print foo" + }, + "metrics" : { + "step.endLine" : 15, + "step.startLine" : 15 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* print foo", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* print foo" + }, + "metrics" : { + "step.endLine" : 15, + "step.startLine" : 15 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "* print foo", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_3}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* print foo" + }, + "metrics" : { + "step.endLine" : 21, + "step.startLine" : 21 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_4}, + "resource" : "* print foo", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_4}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* print foo" + }, + "metrics" : { + "step.endLine" : 21, + "step.startLine" : 21 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_5}, + "resource" : "* print foo", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_5}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* print foo" + }, + "metrics" : { + "step.endLine" : 21, + "step.startLine" : 21 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_6}, + "resource" : "* print foo", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_6}, + "start" : ${content_start_6}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-1.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_with_setup] test with setup", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_with_setup] test with setup", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.module" : "karate-1.0", + "test.name" : "first scenario", + "test.parameters" : "{\"foo\":\"bar\"}", + "test.status" : "pass", + "test.suite" : "[org/example/test_with_setup] test with setup", + "test.traits" : "{\"category\":[\"withSetup\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_with_setup] test with setup.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_8}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_9}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "karate-1.0", + "test.name" : "first scenario", + "test.parameters" : "{\"foo\":\"bar\"}", + "test.retry_reason" : "early_flake_detection", + "test.status" : "pass", + "test.suite" : "[org/example/test_with_setup] test with setup", + "test.traits" : "{\"category\":[\"withSetup\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_with_setup] test with setup.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_9}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_10}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "karate-1.0", + "test.name" : "first scenario", + "test.parameters" : "{\"foo\":\"bar\"}", + "test.retry_reason" : "early_flake_detection", + "test.status" : "pass", + "test.suite" : "[org/example/test_with_setup] test with setup", + "test.traits" : "{\"category\":[\"withSetup\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_with_setup] test with setup.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_3}, + "start" : ${content_start_10}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_11}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.module" : "karate-1.0", + "test.name" : "second scenario", + "test.parameters" : "{\"foo\":\"bar\"}", + "test.status" : "pass", + "test.suite" : "[org/example/test_with_setup] test with setup", + "test.traits" : "{\"category\":[\"withSetupOnce\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_with_setup] test with setup.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_4}, + "start" : ${content_start_11}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_12}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "karate-1.0", + "test.name" : "second scenario", + "test.parameters" : "{\"foo\":\"bar\"}", + "test.retry_reason" : "early_flake_detection", + "test.status" : "pass", + "test.suite" : "[org/example/test_with_setup] test with setup", + "test.traits" : "{\"category\":[\"withSetupOnce\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_with_setup] test with setup.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_5}, + "start" : ${content_start_12}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_13}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "karate-1.0", + "test.name" : "second scenario", + "test.parameters" : "{\"foo\":\"bar\"}", + "test.retry_reason" : "early_flake_detection", + "test.status" : "pass", + "test.suite" : "[org/example/test_with_setup] test with setup", + "test.traits" : "{\"category\":[\"withSetupOnce\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_7}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_with_setup] test with setup.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_6}, + "start" : ${content_start_13}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_14}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-1.0", + "test.early_flake.abort_reason" : "faulty", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_8}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-1.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_14}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_15}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.early_flake.abort_reason" : "faulty", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-1.0", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_9} + }, + "name" : "karate.test_module", + "resource" : "karate-1.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_15}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-failed/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-skip-new-test/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-failed/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-skip-new-test/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-skip-new-test/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-skip-new-test/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-efd-skip-new-test/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-efd-skip-new-test/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-itr-skipping-parameterized/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-failed-then-succeed/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-itr-skipping-parameterized/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-failed-then-succeed/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-failed-then-succeed/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-failed-then-succeed/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-failed-then-succeed/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-failed-then-succeed/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-itr-skipping/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-failed/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-itr-skipping/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-failed/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-failed/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-failed/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-failed/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-failed/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-itr-unskippable/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-itr-skipping-parameterized/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-itr-unskippable/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-itr-skipping-parameterized/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-itr-skipping-parameterized/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-itr-skipping-parameterized/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-itr-skipping-parameterized/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-itr-skipping-parameterized/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-parameterized/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-itr-skipping/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-parameterized/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-itr-skipping/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-itr-skipping/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-itr-skipping/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-itr-skipping/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-itr-skipping/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-quarantined-failed-atr/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-itr-unskippable/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-quarantined-failed-atr/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-itr-unskippable/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-itr-unskippable/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-itr-unskippable/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-itr-unskippable/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-itr-unskippable/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-quarantined-failed-efd/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-parameterized/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-quarantined-failed-efd/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-parameterized/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-parameterized/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-parameterized/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-parameterized/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-parameterized/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-quarantined-failed-known/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-quarantined-failed-atr/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-quarantined-failed-known/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-quarantined-failed-atr/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-quarantined-failed-atr/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-quarantined-failed-atr/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-quarantined-failed-atr/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-quarantined-failed-atr/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-quarantined-failed/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-quarantined-failed-efd/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-quarantined-failed/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-quarantined-failed-efd/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-quarantined-failed-efd/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-quarantined-failed-efd/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-quarantined-failed-efd/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-quarantined-failed-efd/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-retry-failed/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-quarantined-failed-known/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-retry-failed/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-quarantined-failed-known/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-quarantined-failed-known/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-quarantined-failed-known/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-quarantined-failed-known/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-quarantined-failed-known/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-retry-parameterized/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-quarantined-failed/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-retry-parameterized/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-quarantined-failed/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-quarantined-failed/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-quarantined-failed/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-quarantined-failed/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-quarantined-failed/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-skipped-feature/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-retry-continue-on-step-failure/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-skipped-feature/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-retry-continue-on-step-failure/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-retry-continue-on-step-failure/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-retry-continue-on-step-failure/events.ftl new file mode 100644 index 00000000000..15752c0fcb1 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-retry-continue-on-step-failure/events.ftl @@ -0,0 +1,526 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* configure continueOnStepFailure = { enabled: true, continueAfter: true }" + }, + "metrics" : { + "step.endLine" : 4, + "step.startLine" : 4 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* configure continueOnStepFailure = { enabled: true, continueAfter: true }", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* configure continueOnStepFailure = { enabled: true, continueAfter: true }" + }, + "metrics" : { + "step.endLine" : 4, + "step.startLine" : 4 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* configure continueOnStepFailure = { enabled: true, continueAfter: true }", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* configure continueOnStepFailure = { enabled: true, continueAfter: true }" + }, + "metrics" : { + "step.endLine" : 4, + "step.startLine" : 4 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "* configure continueOnStepFailure = { enabled: true, continueAfter: true }", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_3}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* def pass = Java.type('org.example.Flaky').shouldPass()" + }, + "metrics" : { + "step.endLine" : 5, + "step.startLine" : 5 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* def pass = Java.type('org.example.Flaky').shouldPass()", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_4}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* def pass = Java.type('org.example.Flaky').shouldPass()" + }, + "metrics" : { + "step.endLine" : 5, + "step.startLine" : 5 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* def pass = Java.type('org.example.Flaky').shouldPass()", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_5}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* def pass = Java.type('org.example.Flaky').shouldPass()" + }, + "metrics" : { + "step.endLine" : 5, + "step.startLine" : 5 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "* def pass = Java.type('org.example.Flaky').shouldPass()", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_6}, + "start" : ${content_start_6}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* match pass == true" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* match pass == true", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_7}, + "start" : ${content_start_7}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* match pass == true" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* match pass == true", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_8}, + "start" : ${content_start_8}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_9}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* match pass == true" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* match pass == true", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_9}, + "start" : ${content_start_9}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_10}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* match pass == true" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* match pass == true", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_10}, + "start" : ${content_start_10}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_11}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* match pass == true" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "* match pass == true", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_11}, + "start" : ${content_start_11}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_12}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* match pass == true" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "* match pass == true", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_12}, + "start" : ${content_start_12}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_13}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-1.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_continue_on_step_failure] test continue on step failure", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_continue_on_step_failure] test continue on step failure", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_13}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_14}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "com.intuit.karate.KarateException", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-1.0", + "test.name" : "flaky scenario", + "test.status" : "fail", + "test.suite" : "[org/example/test_continue_on_step_failure] test continue on step failure", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_4}, + "resource" : "[org/example/test_continue_on_step_failure] test continue on step failure.flaky scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_14}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_15}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_2}, + "error.type" : "com.intuit.karate.KarateException", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.module" : "karate-1.0", + "test.name" : "flaky scenario", + "test.retry_reason" : "auto_test_retry", + "test.status" : "fail", + "test.suite" : "[org/example/test_continue_on_step_failure] test continue on step failure", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_4}, + "resource" : "[org/example/test_continue_on_step_failure] test continue on step failure.flaky scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_15}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_16}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.module" : "karate-1.0", + "test.name" : "flaky scenario", + "test.retry_reason" : "auto_test_retry", + "test.status" : "pass", + "test.suite" : "[org/example/test_continue_on_step_failure] test continue on step failure", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_4}, + "resource" : "[org/example/test_continue_on_step_failure] test continue on step failure.flaky scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_3}, + "start" : ${content_start_16}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_17}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-1.0", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-1.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_17}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_18}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-1.0", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6} + }, + "name" : "karate.test_module", + "resource" : "karate-1.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_18}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-succeed-parallel/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-retry-failed/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-succeed-parallel/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-retry-failed/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-retry-failed/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-retry-failed/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-retry-failed/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-retry-failed/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-succeed/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-retry-parameterized/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-succeed/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-retry-parameterized/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-retry-parameterized/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-retry-parameterized/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-retry-parameterized/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-retry-parameterized/events.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-with-setup/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-skipped-feature/coverages.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-with-setup/coverages.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-skipped-feature/coverages.ftl diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-skipped-feature/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-skipped-feature/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-skipped-feature/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-skipped-feature/events.ftl diff --git a/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-succeed-parallel/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-succeed-parallel/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-succeed-parallel/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-succeed-parallel/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-succeed-parallel/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-succeed-parallel/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-succeed-parallel/events.ftl diff --git a/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-succeed/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-succeed/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-succeed/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-succeed/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-succeed/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-succeed/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-succeed/events.ftl diff --git a/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-with-setup/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-with-setup/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-with-setup/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-with-setup/events.ftl b/dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-with-setup/events.ftl similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/resources/test-with-setup/events.ftl rename to dd-java-agent/instrumentation/karate/karate-1.0/src/test/resources/test-with-setup/events.ftl diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/build.gradle b/dd-java-agent/instrumentation/karate/karate-2.0/build.gradle new file mode 100644 index 00000000000..d3f81242750 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/build.gradle @@ -0,0 +1,52 @@ +plugins { + id 'dd-trace-java.instrumentation.testing-framework-tests' +} + +apply from: "$rootDir/gradle/java.gradle" + +// Karate 2.x is compiled with Java 21 (uses virtual threads for parallelism) +tracerJava { + addSourceSetFor(JavaVersion.VERSION_21) +} + +muzzle { + pass { + group = 'io.karatelabs' + module = 'karate-core' + versions = '[2.0.0,)' + javaVersion = '21' + } +} + +["compileMain_java21Java", "compileTestJava"].each { + tasks.named(it, JavaCompile) { + configureCompiler(it, 21, JavaVersion.VERSION_21) + } +} + +tasks.withType(GroovyCompile).configureEach { + configureCompiler(it, 21) +} + +dependencies { + main_java21CompileOnly group: 'io.karatelabs', name: 'karate-core', version: '2.0.9' + + testImplementation project(':dd-java-agent:agent-ci-visibility:civisibility-instrumentation-test-fixtures') + testImplementation group: 'org.junit.platform', name: 'junit-platform-launcher', version: libs.versions.junit.platform.get() + testImplementation group: 'org.junit.jupiter', name: 'junit-jupiter-engine', version: libs.versions.junit5.get() + + testImplementation(group: 'io.karatelabs', name: 'karate-core', version: '2.0.9') { + // excluding logback to avoid conflicts with libs.bundles.test.logging + exclude group: 'ch.qos.logback', module: 'logback-classic' + } +} + +// Using recommended Karate project layout where Karate feature files sit in same /test/java folders as their java counterparts +sourceSets { + test { + resources { + srcDir file('src/test/java') + exclude '**/*.java' + } + } +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/gradle.lockfile b/dd-java-agent/instrumentation/karate/karate-2.0/gradle.lockfile new file mode 100644 index 00000000000..857dae6c7d3 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/gradle.lockfile @@ -0,0 +1,164 @@ +# This is a Gradle generated file for dependency locking. +# Manual edits can break the build and are not advised. +# This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:karate:karate-2.0:dependencies --write-locks +cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath +cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath +ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath +com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,main_java21CompileClasspath,main_java21RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath +com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,main_java21CompileClasspath,main_java21RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,main_java21CompileClasspath,main_java21RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath +com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath +com.fasterxml.jackson.core:jackson-annotations:2.20=testCompileClasspath,testRuntimeClasspath +com.fasterxml.jackson.core:jackson-core:2.20.0=testCompileClasspath,testRuntimeClasspath +com.fasterxml.jackson.core:jackson-databind:2.20.0=testCompileClasspath,testRuntimeClasspath +com.fasterxml.jackson:jackson-bom:2.20.0=testCompileClasspath,testRuntimeClasspath +com.github.javaparser:javaparser-core:3.25.6=codenarc +com.github.jnr:jffi:1.3.15=testRuntimeClasspath +com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath +com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath +com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs +com.github.spotbugs:spotbugs:4.9.8=spotbugs +com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs +com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath +com.google.auto.service:auto-service:1.1.1=annotationProcessor,testAnnotationProcessor +com.google.auto:auto-common:1.2.1=annotationProcessor,testAnnotationProcessor +com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.google.code.gson:gson:2.13.2=spotbugs +com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor +com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath +com.jayway.jsonpath:json-path:3.0.0=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okio:okio:1.17.5=testCompileClasspath,testRuntimeClasspath +com.thoughtworks.qdox:qdox:1.12.1=codenarc +com.vaadin.external.google:android-json:0.0.20131108.vaadin1=testCompileClasspath,testRuntimeClasspath +commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testRuntimeClasspath +commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath +commons-io:commons-io:2.20.0=spotbugs +de.siegmar:fastcsv:4.2.0=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath +info.picocli:picocli:4.7.7=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +io.karatelabs:karate-core:2.0.9=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +io.karatelabs:karate-js:2.0.9=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath +io.netty:netty-buffer:4.2.13.Final=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-codec-base:4.2.13.Final=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-codec-compression:4.2.13.Final=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-codec-http:4.2.13.Final=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-common:4.2.13.Final=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-handler:4.2.13.Final=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-resolver:4.2.13.Final=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.2.13.Final=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-transport:4.2.13.Final=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath +javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath +jaxen:jaxen:2.0.0=spotbugs +junit:junit:4.13.2=testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,main_java21CompileClasspath,main_java21RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,main_java21CompileClasspath,main_java21RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath +net.java.dev.jna:jna:5.8.0=testRuntimeClasspath +net.minidev:accessors-smart:2.6.0=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +net.minidev:json-smart:2.6.0=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +net.sf.saxon:Saxon-HE:12.9=spotbugs +ognl:ognl:3.3.4=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +org.apache.ant:ant-antlr:1.10.14=codenarc +org.apache.ant:ant-junit:1.10.14=codenarc +org.apache.bcel:bcel:6.11.0=spotbugs +org.apache.commons:commons-lang3:3.19.0=spotbugs +org.apache.commons:commons-text:1.14.0=spotbugs +org.apache.httpcomponents.client5:httpclient5:5.6.1=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +org.apache.httpcomponents.core5:httpcore5-h2:5.4=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +org.apache.httpcomponents.core5:httpcore5:5.4=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +org.apache.logging.log4j:log4j-api:2.25.2=spotbugs +org.apache.logging.log4j:log4j-core:2.25.2=spotbugs +org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath +org.attoparser:attoparser:2.0.7.RELEASE=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +org.brotli:dec:0.1.2=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +org.checkerframework:checker-qual:3.33.0=annotationProcessor,testAnnotationProcessor +org.codehaus.groovy:groovy-ant:3.0.23=codenarc +org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc +org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.25=testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-templates:3.0.23=codenarc +org.codehaus.groovy:groovy-xml:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath +org.codenarc:CodeNarc:3.7.0=codenarc +org.dom4j:dom4j:2.2.0=spotbugs +org.freemarker:freemarker:2.3.31=testCompileClasspath,testRuntimeClasspath +org.gmetrics:GMetrics:2.1.0=codenarc +org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath +org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.core:0.8.15=testRuntimeClasspath +org.jacoco:org.jacoco.report:0.8.15=testRuntimeClasspath +org.javassist:javassist:3.29.0-GA=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath +org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-runner:1.14.1=testRuntimeClasspath +org.junit.platform:junit-platform-suite-api:1.14.1=testRuntimeClasspath +org.junit.platform:junit-platform-suite-commons:1.14.1=testRuntimeClasspath +org.junit:junit-bom:5.14.0=spotbugs +org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-core:4.4.0=testRuntimeClasspath +org.msgpack:jackson-dataformat-msgpack:0.9.6=testCompileClasspath,testRuntimeClasspath +org.msgpack:msgpack-core:0.9.6=testCompileClasspath,testRuntimeClasspath +org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath +org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath +org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.9=spotbugs +org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath +org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,main_java21CompileClasspath,main_java21RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs +org.skyscreamer:jsonassert:1.5.1=testCompileClasspath,testRuntimeClasspath +org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath +org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath +org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,main_java21RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath +org.slf4j:slf4j-api:2.0.17=main_java21CompileClasspath,spotbugs,spotbugsSlf4j,testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j +org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,main_java21RuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath +org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath +org.thymeleaf:thymeleaf:3.1.5.RELEASE=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +org.unbescape:unbescape:1.1.6.RELEASE=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +org.xmlresolver:xmlresolver:5.3.3=spotbugs +org.xmlunit:xmlunit-core:2.10.3=testCompileClasspath,testRuntimeClasspath +org.yaml:snakeyaml:2.6=main_java21CompileClasspath,testCompileClasspath,testRuntimeClasspath +empty=main_java21AnnotationProcessor,spotbugsPlugins diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/main/java/datadog/trace/instrumentation/karate2/KarateExecutionInstrumentation.java b/dd-java-agent/instrumentation/karate/karate-2.0/src/main/java/datadog/trace/instrumentation/karate2/KarateExecutionInstrumentation.java new file mode 100644 index 00000000000..8b88bf2476e --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/main/java/datadog/trace/instrumentation/karate2/KarateExecutionInstrumentation.java @@ -0,0 +1,87 @@ +package datadog.trace.instrumentation.karate2; + +import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static net.bytebuddy.matcher.ElementMatchers.isBridge; +import static net.bytebuddy.matcher.ElementMatchers.not; +import static net.bytebuddy.matcher.ElementMatchers.returns; +import static net.bytebuddy.matcher.ElementMatchers.takesArgument; +import static net.bytebuddy.matcher.ElementMatchers.takesArguments; +import static net.bytebuddy.matcher.ElementMatchers.takesNoArguments; + +import com.google.auto.service.AutoService; +import datadog.trace.agent.tooling.Instrumenter; +import datadog.trace.agent.tooling.InstrumenterModule; +import datadog.trace.api.Config; +import java.util.Collections; +import java.util.Map; + +/** + * Drives test-retry execution policies (ATR / EFD / attempt-to-fix) and failure suppression for + * Karate v2. + * + *

        + *
      • {@code ScenarioRuntime#call()} is advised to re-run the scenario while the execution policy + * is applicable, overriding the returned {@code ScenarioResult} with the final attempt. + *
      • {@code ScenarioResult#addStepResult(StepResult)} is advised to replace a failing step with + * a skipped one when the policy requests failure suppression. + *
      + * + * Compiled for Java 8 (see {@link KarateInstrumentation}); the advice lives in the {@code java21} + * source set. + */ +@AutoService(InstrumenterModule.class) +public class KarateExecutionInstrumentation extends InstrumenterModule.CiVisibility + implements Instrumenter.ForKnownTypes, Instrumenter.HasMethodAdvice { + + public KarateExecutionInstrumentation() { + super("ci-visibility", "karate", "test-retry"); + } + + @Override + public boolean isEnabled() { + return super.isEnabled() && Config.get().isCiVisibilityExecutionPoliciesEnabled(); + } + + @Override + public String[] knownMatchingTypes() { + return new String[] {"io.karatelabs.core.ScenarioRuntime", "io.karatelabs.core.ScenarioResult"}; + } + + @Override + public String[] helperClassNames() { + return new String[] { + packageName + ".KarateUtils", + packageName + ".TestEventsHandlerHolder", + packageName + ".ExecutionContext", + packageName + ".KarateTracingListener", + packageName + ".KarateScenarioAdvice", + packageName + ".KarateScenarioAdvice$RetryAdvice", + packageName + ".KarateScenarioAdvice$SuppressErrorAdvice" + }; + } + + @Override + public Map contextStore() { + return Collections.singletonMap( + "io.karatelabs.gherkin.Scenario", packageName + ".ExecutionContext"); + } + + @Override + public void methodAdvice(MethodTransformer transformer) { + // ScenarioRuntime#call() is the run()-equivalent; match the concrete ScenarioResult-returning + // method, not the synthetic Callable#call() bridge. + transformer.applyAdvice( + named("call") + .and(takesNoArguments()) + .and(returns(named("io.karatelabs.core.ScenarioResult"))) + .and(not(isBridge())), + packageName + ".KarateScenarioAdvice$RetryAdvice"); + + // ScenarioResult#addStepResult(StepResult) + transformer.applyAdvice( + named("addStepResult") + .and(takesArguments(1)) + .and(takesArgument(0, named("io.karatelabs.core.StepResult"))), + packageName + ".KarateScenarioAdvice$SuppressErrorAdvice"); + } +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/main/java/datadog/trace/instrumentation/karate2/KarateInstrumentation.java b/dd-java-agent/instrumentation/karate/karate-2.0/src/main/java/datadog/trace/instrumentation/karate2/KarateInstrumentation.java new file mode 100644 index 00000000000..522c8a464fc --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/main/java/datadog/trace/instrumentation/karate2/KarateInstrumentation.java @@ -0,0 +1,53 @@ +package datadog.trace.instrumentation.karate2; + +import static net.bytebuddy.matcher.ElementMatchers.isConstructor; + +import com.google.auto.service.AutoService; +import datadog.trace.agent.tooling.Instrumenter; +import datadog.trace.agent.tooling.InstrumenterModule; +import java.util.Collections; +import java.util.Map; + +/** + * Registers a {@code io.karatelabs.core.RunListener} on every {@code + * io.karatelabs.core.Runner.Builder}. + * + *

      This module is compiled for Java 8 so the agent can enumerate it on any JVM; the advice and + * helper classes that reference the Java 21 {@code io.karatelabs} API live in the {@code java21} + * source set and are referenced by name. + */ +@AutoService(InstrumenterModule.class) +public class KarateInstrumentation extends InstrumenterModule.CiVisibility + implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { + + public KarateInstrumentation() { + super("ci-visibility", "karate"); + } + + @Override + public String instrumentedType() { + return "io.karatelabs.core.Runner$Builder"; + } + + @Override + public String[] helperClassNames() { + return new String[] { + packageName + ".KarateUtils", + packageName + ".TestEventsHandlerHolder", + packageName + ".ExecutionContext", + packageName + ".KarateTracingListener", + packageName + ".KarateBuilderAdvice" + }; + } + + @Override + public Map contextStore() { + return Collections.singletonMap( + "io.karatelabs.gherkin.Scenario", packageName + ".ExecutionContext"); + } + + @Override + public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvice(isConstructor(), packageName + ".KarateBuilderAdvice"); + } +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/main/java21/datadog/trace/instrumentation/karate2/ExecutionContext.java b/dd-java-agent/instrumentation/karate/karate-2.0/src/main/java21/datadog/trace/instrumentation/karate2/ExecutionContext.java new file mode 100644 index 00000000000..91e24c197fe --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/main/java21/datadog/trace/instrumentation/karate2/ExecutionContext.java @@ -0,0 +1,56 @@ +package datadog.trace.instrumentation.karate2; + +import datadog.trace.api.civisibility.config.TestIdentifier; +import datadog.trace.api.civisibility.config.TestSourceData; +import datadog.trace.api.civisibility.execution.TestExecutionPolicy; +import io.karatelabs.gherkin.Scenario; +import java.util.Collection; + +public class ExecutionContext { + + private final TestExecutionPolicy executionPolicy; + private boolean suppressFailures; + private Throwable suppressedError; + + public ExecutionContext(TestExecutionPolicy executionPolicy) { + this.executionPolicy = executionPolicy; + } + + public void setSuppressFailures(boolean suppressFailures) { + this.suppressFailures = suppressFailures; + } + + public boolean shouldSuppressFailures() { + return suppressFailures; + } + + public TestExecutionPolicy getExecutionPolicy() { + return executionPolicy; + } + + /** + * Karate v2 {@code StepResult} is immutable (no {@code setFailedReason}/{@code setErrorIgnored}), + * so a failure that was suppressed for retry purposes cannot be carried on the replacement step. + * We stash it here instead, so the tracing listener can still report the failure to CI + * Visibility. + */ + public void setSuppressedError(Throwable suppressedError) { + if (this.suppressedError == null) { + this.suppressedError = suppressedError; + } + } + + public Throwable getAndClearSuppressedError() { + Throwable suppressedError = this.suppressedError; + this.suppressedError = null; + return suppressedError; + } + + public static ExecutionContext create(Scenario scenario) { + TestIdentifier testIdentifier = KarateUtils.toTestIdentifier(scenario); + Collection testTags = KarateUtils.getCategories(scenario.getTagsEffective()); + return new ExecutionContext( + TestEventsHandlerHolder.TEST_EVENTS_HANDLER.executionPolicy( + testIdentifier, TestSourceData.UNKNOWN, testTags)); + } +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/main/java21/datadog/trace/instrumentation/karate2/KarateBuilderAdvice.java b/dd-java-agent/instrumentation/karate/karate-2.0/src/main/java21/datadog/trace/instrumentation/karate2/KarateBuilderAdvice.java new file mode 100644 index 00000000000..54bda255b9c --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/main/java21/datadog/trace/instrumentation/karate2/KarateBuilderAdvice.java @@ -0,0 +1,25 @@ +package datadog.trace.instrumentation.karate2; + +import datadog.trace.bootstrap.ContextStore; +import datadog.trace.bootstrap.InstrumentationContext; +import io.karatelabs.core.RunEvent; +import io.karatelabs.core.RunListener; +import io.karatelabs.core.Runner; +import io.karatelabs.gherkin.Scenario; +import net.bytebuddy.asm.Advice; + +/** Advice for the {@code io.karatelabs.core.Runner.Builder} constructor. */ +public class KarateBuilderAdvice { + + @Advice.OnMethodExit + public static void onRunnerBuilderConstructorExit(@Advice.This Runner.Builder builder) { + ContextStore scenarioContext = + InstrumentationContext.get(Scenario.class, ExecutionContext.class); + builder.listener(new KarateTracingListener(scenarioContext)); + } + + // Karate 2.0.0 and above + public static void muzzleCheck(RunListener runListener) { + runListener.onEvent((RunEvent) null); + } +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/main/java21/datadog/trace/instrumentation/karate2/KarateScenarioAdvice.java b/dd-java-agent/instrumentation/karate/karate-2.0/src/main/java21/datadog/trace/instrumentation/karate2/KarateScenarioAdvice.java new file mode 100644 index 00000000000..dbeb18a63ab --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/main/java21/datadog/trace/instrumentation/karate2/KarateScenarioAdvice.java @@ -0,0 +1,108 @@ +package datadog.trace.instrumentation.karate2; + +import datadog.trace.api.civisibility.execution.TestExecutionPolicy; +import datadog.trace.bootstrap.CallDepthThreadLocalMap; +import datadog.trace.bootstrap.InstrumentationContext; +import io.karatelabs.core.RunEvent; +import io.karatelabs.core.RunListener; +import io.karatelabs.core.ScenarioResult; +import io.karatelabs.core.ScenarioRuntime; +import io.karatelabs.core.StepResult; +import io.karatelabs.gherkin.Scenario; +import net.bytebuddy.asm.Advice; + +/** Advice classes for {@code io.karatelabs.core.ScenarioRuntime}/{@code ScenarioResult}. */ +public class KarateScenarioAdvice { + + public static class RetryAdvice { + @Advice.OnMethodEnter + public static void beforeExecute(@Advice.This ScenarioRuntime scenarioRuntime) { + if (KarateTracingListener.skipTracking(scenarioRuntime)) { + return; + } + + ExecutionContext executionContext = + InstrumentationContext.get(Scenario.class, ExecutionContext.class) + .computeIfAbsent(scenarioRuntime.getScenario(), ExecutionContext::create); + + // Indicate beforehand whether failures should be suppressed. This aligns the ordering with + // the rest of the frameworks. + TestExecutionPolicy executionPolicy = executionContext.getExecutionPolicy(); + executionContext.setSuppressFailures(executionPolicy.suppressFailures()); + } + + @Advice.OnMethodExit + public static void afterExecute( + @Advice.This ScenarioRuntime scenarioRuntime, + @Advice.Return(readOnly = false) ScenarioResult result) { + if (KarateTracingListener.skipTracking(scenarioRuntime)) { + return; + } + + if (CallDepthThreadLocalMap.incrementCallDepth(ScenarioRuntime.class) > 0) { + // nested call (a retry invoked below, or a called scenario) + return; + } + + try { + Scenario scenario = scenarioRuntime.getScenario(); + ExecutionContext context = + InstrumentationContext.get(Scenario.class, ExecutionContext.class).get(scenario); + if (context == null) { + return; + } + + ScenarioResult finalResult = result; + TestExecutionPolicy executionPolicy = context.getExecutionPolicy(); + while (executionPolicy.applicable()) { + ScenarioRuntime retry = + new ScenarioRuntime(scenarioRuntime.getFeatureRuntime(), scenario); + finalResult = retry.call(); + } + + // override the return value so the final attempt is the one recorded. + result = finalResult; + } finally { + CallDepthThreadLocalMap.reset(ScenarioRuntime.class); + } + } + + // Karate 2.0.0 and above + public static void muzzleCheck(RunListener runListener) { + runListener.onEvent((RunEvent) null); + } + } + + public static class SuppressErrorAdvice { + @Advice.OnMethodEnter + public static void onAddingStepResult( + @Advice.Argument(value = 0, readOnly = false) StepResult stepResult, + @Advice.FieldValue("scenario") Scenario scenario) { + + if (stepResult.isFailed()) { + ExecutionContext executionContext = + InstrumentationContext.get(Scenario.class, ExecutionContext.class).get(scenario); + if (executionContext == null) { + return; + } + + // Suppress every failing step of a to-be-retried attempt (not just the first): with + // continueOnStepFailure a single attempt can add multiple failing steps, and any leak + // would mark the retry attempt's result failed. + if (executionContext.shouldSuppressFailures()) { + // v2 StepResult is immutable: preserve the error out-of-band, then replace the failing + // step with a skipped one so the scenario no longer counts as failed. + executionContext.setSuppressedError(stepResult.getError()); + stepResult = StepResult.skipped(stepResult.getStep(), stepResult.getStartTime()); + } + } + } + + // Karate 2.0.0 and above + public static void muzzleCheck(RunListener runListener) { + runListener.onEvent((RunEvent) null); + } + } + + private KarateScenarioAdvice() {} +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/main/java21/datadog/trace/instrumentation/karate2/KarateTracingListener.java b/dd-java-agent/instrumentation/karate/karate-2.0/src/main/java21/datadog/trace/instrumentation/karate2/KarateTracingListener.java new file mode 100644 index 00000000000..a9ea059ca26 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/main/java21/datadog/trace/instrumentation/karate2/KarateTracingListener.java @@ -0,0 +1,259 @@ +package datadog.trace.instrumentation.karate2; + +import datadog.trace.api.Config; +import datadog.trace.api.civisibility.CIConstants; +import datadog.trace.api.civisibility.config.TestIdentifier; +import datadog.trace.api.civisibility.config.TestSourceData; +import datadog.trace.api.civisibility.events.TestDescriptor; +import datadog.trace.api.civisibility.events.TestSuiteDescriptor; +import datadog.trace.api.civisibility.execution.TestExecutionTracker; +import datadog.trace.api.civisibility.telemetry.tag.SkipReason; +import datadog.trace.api.civisibility.telemetry.tag.TestFrameworkInstrumentation; +import datadog.trace.bootstrap.ContextStore; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import datadog.trace.bootstrap.instrumentation.api.Tags; +import io.karatelabs.core.FeatureResult; +import io.karatelabs.core.FeatureRunEvent; +import io.karatelabs.core.FeatureRuntime; +import io.karatelabs.core.RunEvent; +import io.karatelabs.core.RunEventType; +import io.karatelabs.core.RunListener; +import io.karatelabs.core.ScenarioResult; +import io.karatelabs.core.ScenarioRunEvent; +import io.karatelabs.core.ScenarioRuntime; +import io.karatelabs.core.StepResult; +import io.karatelabs.core.StepRunEvent; +import io.karatelabs.gherkin.Feature; +import io.karatelabs.gherkin.Scenario; +import io.karatelabs.gherkin.Step; +import java.util.Collection; +import java.util.List; + +public class KarateTracingListener implements RunListener { + + private static final String FRAMEWORK_NAME = "karate"; + public static final String FRAMEWORK_VERSION = KarateUtils.getKarateVersion(); + public static final String KARATE_STEP_SPAN_NAME = "karate.step"; + + private final ContextStore scenarioContext; + + public KarateTracingListener(ContextStore scenarioContext) { + this.scenarioContext = scenarioContext; + } + + @Override + public boolean onEvent(RunEvent event) { + RunEventType type = event.getType(); + if (type == RunEventType.FEATURE_ENTER) { + return beforeFeature((FeatureRunEvent) event); + } else if (type == RunEventType.FEATURE_EXIT) { + afterFeature((FeatureRunEvent) event); + } else if (type == RunEventType.SCENARIO_ENTER) { + return beforeScenario((ScenarioRunEvent) event); + } else if (type == RunEventType.SCENARIO_EXIT) { + afterScenario((ScenarioRunEvent) event); + } else if (type == RunEventType.STEP_ENTER) { + beforeStep((StepRunEvent) event); + } else if (type == RunEventType.STEP_EXIT) { + afterStep((StepRunEvent) event); + } + return true; + } + + private boolean beforeFeature(FeatureRunEvent event) { + FeatureRuntime fr = event.source(); + if (skipTracking(fr)) { + return true; + } + TestSuiteDescriptor suiteDescriptor = KarateUtils.toSuiteDescriptor(fr); + Feature feature = fr.getFeature(); + TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestSuiteStart( + suiteDescriptor, + KarateUtils.getFeatureNameForReport(feature), + FRAMEWORK_NAME, + FRAMEWORK_VERSION, + null, + KarateUtils.getCategories(feature.getTags()), + isParallel(fr), + TestFrameworkInstrumentation.KARATE, + null); + return true; + } + + private void afterFeature(FeatureRunEvent event) { + FeatureRuntime fr = event.source(); + if (skipTracking(fr)) { + return; + } + TestSuiteDescriptor suiteDescriptor = KarateUtils.toSuiteDescriptor(fr); + FeatureResult result = event.result(); + if (result != null && result.isFailed()) { + TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestSuiteFailure( + suiteDescriptor, suiteThrowable(result)); + } else if (result != null && result.isEmpty()) { + TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestSuiteSkip(suiteDescriptor, null); + } + TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestSuiteFinish(suiteDescriptor, null); + } + + private boolean beforeScenario(ScenarioRunEvent event) { + ScenarioRuntime sr = event.source(); + if (skipTracking(sr)) { + return true; + } + Scenario scenario = sr.getScenario(); + TestSuiteDescriptor suiteDescriptor = KarateUtils.toSuiteDescriptor(sr.getFeatureRuntime()); + TestDescriptor testDescriptor = KarateUtils.toTestDescriptor(sr); + String scenarioName = KarateUtils.getScenarioName(scenario); + String parameters = KarateUtils.getParameters(scenario); + Collection categories = KarateUtils.getCategories(scenario.getTagsEffective()); + + ExecutionContext context = scenarioContext.get(scenario); + TestExecutionTracker executionTracker = context != null ? context.getExecutionPolicy() : null; + + if (Config.get().isCiVisibilityTestSkippingEnabled() + || Config.get().isCiVisibilityTestManagementEnabled()) { + TestIdentifier skippableTest = KarateUtils.toTestIdentifier(scenario); + SkipReason skipReason = TestEventsHandlerHolder.TEST_EVENTS_HANDLER.skipReason(skippableTest); + + if (skipReason != null + && !(skipReason == SkipReason.ITR + && categories.contains(CIConstants.Tags.ITR_UNSKIPPABLE_TAG))) { + TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestIgnore( + suiteDescriptor, + testDescriptor, + scenarioName, + FRAMEWORK_NAME, + FRAMEWORK_VERSION, + parameters, + categories, + TestSourceData.UNKNOWN, + skipReason.getDescription(), + executionTracker); + return false; + } + } + + TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestStart( + suiteDescriptor, + testDescriptor, + scenarioName, + FRAMEWORK_NAME, + FRAMEWORK_VERSION, + parameters, + categories, + TestSourceData.UNKNOWN, + null, + executionTracker); + return true; + } + + private void afterScenario(ScenarioRunEvent event) { + ScenarioRuntime sr = event.source(); + if (skipTracking(sr)) { + return; + } + Scenario scenario = sr.getScenario(); + ScenarioResult result = event.result(); + TestDescriptor testDescriptor = KarateUtils.toTestDescriptor(sr); + + ExecutionContext context = scenarioContext.get(scenario); + Throwable suppressedError = context != null ? context.getAndClearSuppressedError() : null; + Throwable failedReason = getFailedReason(result, suppressedError); + + if ((result != null && result.isFailed()) || failedReason != null) { + TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFailure(testDescriptor, failedReason); + } else if (result == null || result.getStepResults().isEmpty()) { + TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestSkip(testDescriptor, null); + } + + TestExecutionTracker executionTracker = context != null ? context.getExecutionPolicy() : null; + TestEventsHandlerHolder.TEST_EVENTS_HANDLER.onTestFinish( + testDescriptor, null, executionTracker); + } + + private void beforeStep(StepRunEvent event) { + Step step = event.step(); + if (skipTracking(step)) { + return; + } + AgentSpan span = AgentTracer.startSpan("karate", KARATE_STEP_SPAN_NAME); + AgentTracer.activateSpanWithoutScope(span); + String stepName = step.getPrefix() + " " + step.getText(); + span.setResourceName(stepName); + span.setTag(Tags.COMPONENT, "karate"); + span.spanContext().setIntegrationName("karate"); + span.setTag("step.name", stepName); + span.setTag("step.startLine", step.getLine()); + span.setTag("step.endLine", step.getEndLine()); + span.setTag("step.docString", step.getDocString()); + } + + private void afterStep(StepRunEvent event) { + if (skipTracking(event.step())) { + return; + } + + AgentSpan span = AgentTracer.activeSpan(); + if (span == null) { + return; + } + + AgentTracer.closeActive(); + span.finish(); + } + + private static Throwable getFailedReason(ScenarioResult result, Throwable suppressedError) { + if (result != null) { + Throwable error = result.getError(); + if (error != null) { + return error; + } + for (StepResult stepResult : result.getStepResults()) { + if (stepResult.getError() != null) { + return stepResult.getError(); + } + } + } + // a failure that was suppressed by the retry logic (the failing step was replaced with a + // skipped one) is carried out-of-band on the ExecutionContext + return suppressedError; + } + + private static Throwable suiteThrowable(FeatureResult result) { + List scenarioResults = result.getScenarioResults(); + if (scenarioResults != null) { + for (ScenarioResult scenarioResult : scenarioResults) { + Throwable error = scenarioResult.getError(); + if (error != null) { + return error; + } + } + } + return new RuntimeException(result.getFailureMessage()); + } + + private static boolean isParallel(FeatureRuntime fr) { + return fr.getSuite() != null && fr.getSuite().parallel; + } + + private static boolean skipTracking(FeatureRuntime fr) { + // do not track nested (called) feature runs + return fr.getCaller() != null; + } + + public static boolean skipTracking(ScenarioRuntime sr) { + // do not track nested (called) scenario runs and setup scenarios + FeatureRuntime fr = sr.getFeatureRuntime(); + return fr == null || fr.getCaller() != null || sr.getScenario().isSetup(); + } + + private static boolean skipTracking(Step step) { + // do not track steps that are not children of a tracked scenario or another tracked step + AgentSpan activeSpan = AgentTracer.activeSpan(); + return activeSpan == null + || (!KARATE_STEP_SPAN_NAME.contentEquals(activeSpan.getSpanName()) + && !Tags.SPAN_KIND_TEST.contentEquals(activeSpan.getSpanType())); + } +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/main/java21/datadog/trace/instrumentation/karate2/KarateUtils.java b/dd-java-agent/instrumentation/karate/karate-2.0/src/main/java21/datadog/trace/instrumentation/karate2/KarateUtils.java new file mode 100644 index 00000000000..7a8b4bb4e7c --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/main/java21/datadog/trace/instrumentation/karate2/KarateUtils.java @@ -0,0 +1,178 @@ +package datadog.trace.instrumentation.karate2; + +import static datadog.json.JsonMapper.toJson; + +import datadog.trace.api.civisibility.config.LibraryCapability; +import datadog.trace.api.civisibility.config.TestIdentifier; +import datadog.trace.api.civisibility.events.TestDescriptor; +import datadog.trace.api.civisibility.events.TestSuiteDescriptor; +import datadog.trace.util.Strings; +import io.karatelabs.core.FeatureRuntime; +import io.karatelabs.core.Globals; +import io.karatelabs.core.ScenarioRuntime; +import io.karatelabs.gherkin.Feature; +import io.karatelabs.gherkin.Scenario; +import io.karatelabs.gherkin.Tag; +import java.net.URI; +import java.net.URL; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.ConcurrentHashMap; + +public abstract class KarateUtils { + + private KarateUtils() {} + + public static final List CAPABILITIES = Collections.emptyList(); + + private static final ConcurrentHashMap CLASSPATH_NAME_CACHE = + new ConcurrentHashMap<>(); + + public static Feature getFeature(FeatureRuntime featureRuntime) { + return featureRuntime.getFeature(); + } + + /** + * Produces the karate-1.0-compatible suite identifier {@code "[] + * "} (e.g. {@code "[org/example/test_succeed] test succeed"}). + * + *

      We can't use v2's {@code Feature.getNameForReport()} directly: it derives the path from + * {@code Resource.getRelativePath()}, which v2 relativizes against the JVM working directory and + * falls back to the absolute path when the file is outside it. + * + *

      We recover that form by asking the classloader to resolve progressively longer suffixes of + * the feature's path; the shortest suffix that resolves back to the same file is the + * classpath-relative name. Falls back to Karate's working-directory-relative path if nothing + * resolves. + */ + public static String getFeatureNameForReport(Feature feature) { + if (feature == null) { + return null; + } + String classpathPath = resolveClasspathRelativeName(feature); + String name = feature.getName(); + if (name == null || name.isEmpty()) { + return "[" + classpathPath + "]"; + } + return "[" + classpathPath + "] " + name; + } + + private static String resolveClasspathRelativeName(Feature feature) { + URI uri = feature.getResource() != null ? feature.getResource().getUri() : null; + // use Karate's own relative path as fallback for anything the classloader can't resolve + String fallback = resourceRelativeName(feature); + if (uri == null) { + return fallback; + } + return CLASSPATH_NAME_CACHE.computeIfAbsent( + uri, u -> computeClasspathRelativeName(u, fallback)); + } + + private static String resourceRelativeName(Feature feature) { + String relativePath = + feature.getResource() != null ? feature.getResource().getRelativePath() : null; + if (relativePath != null && !relativePath.isEmpty()) { + return stripFeatureExtension(relativePath); + } + return feature.getName() != null ? feature.getName() : ""; + } + + private static String computeClasspathRelativeName(URI uri, String fallback) { + Path path; + try { + path = Paths.get(uri); + } catch (Exception e) { + // non-file URI (e.g. a feature packaged inside a jar): can't walk filesystem segments + return fallback; + } + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + if (cl == null) { + cl = Feature.class.getClassLoader(); + } + int segments = path.getNameCount(); + for (int start = segments - 1; start >= 0; start--) { + StringBuilder candidate = new StringBuilder(); + for (int i = start; i < segments; i++) { + if (i > start) { + candidate.append('/'); + } + candidate.append(path.getName(i).toString()); + } + URL resolved = cl.getResource(candidate.toString()); + if (resolved != null) { + try { + if (Paths.get(resolved.toURI()).equals(path)) { + return stripFeatureExtension(candidate.toString()); + } + } catch (Exception ignored) { + // continue searching + } + } + } + return fallback; + } + + private static String stripFeatureExtension(String path) { + return path.endsWith(".feature") + ? path.substring(0, path.length() - ".feature".length()) + : path; + } + + public static String getScenarioName(Scenario scenario) { + String scenarioName = scenario.getName(); + if (Strings.isNotBlank(scenarioName)) { + return scenarioName; + } else { + return scenario.getRefId(); + } + } + + public static List getCategories(List tags) { + if (tags == null) { + return Collections.emptyList(); + } + + List categories = new ArrayList<>(tags.size()); + for (Tag tag : tags) { + categories.add(tag.getName()); + } + return categories; + } + + public static String getParameters(Scenario scenario) { + return scenario.getExampleData() != null ? toJson(scenario.getExampleData()) : null; + } + + public static TestIdentifier toTestIdentifier(Scenario scenario) { + Feature feature = scenario.getFeature(); + String featureName = getFeatureNameForReport(feature); + String scenarioName = getScenarioName(scenario); + String parameters = getParameters(scenario); + return new TestIdentifier(featureName, scenarioName, parameters); + } + + public static TestDescriptor toTestDescriptor(ScenarioRuntime scenarioRuntime) { + Scenario scenario = scenarioRuntime.getScenario(); + Feature feature = scenario.getFeature(); + String featureName = getFeatureNameForReport(feature); + String scenarioName = getScenarioName(scenario); + String parameters = getParameters(scenario); + return new TestDescriptor(featureName, null, scenarioName, parameters, scenarioRuntime); + } + + public static TestSuiteDescriptor toSuiteDescriptor(FeatureRuntime featureRuntime) { + String featureName = getFeatureNameForReport(featureRuntime.getFeature()); + return new TestSuiteDescriptor(featureName, null); + } + + public static String getKarateVersion() { + return Globals.KARATE_VERSION; + } + + public static List capabilities() { + return CAPABILITIES; + } +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/main/java21/datadog/trace/instrumentation/karate2/TestEventsHandlerHolder.java b/dd-java-agent/instrumentation/karate/karate-2.0/src/main/java21/datadog/trace/instrumentation/karate2/TestEventsHandlerHolder.java new file mode 100644 index 00000000000..d2c4c495cab --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/main/java21/datadog/trace/instrumentation/karate2/TestEventsHandlerHolder.java @@ -0,0 +1,32 @@ +package datadog.trace.instrumentation.karate2; + +import datadog.trace.api.civisibility.InstrumentationBridge; +import datadog.trace.api.civisibility.events.TestDescriptor; +import datadog.trace.api.civisibility.events.TestEventsHandler; +import datadog.trace.api.civisibility.events.TestSuiteDescriptor; +import datadog.trace.api.internal.VisibleForTesting; + +public abstract class TestEventsHandlerHolder { + + public static volatile TestEventsHandler TEST_EVENTS_HANDLER; + + static { + start(); + } + + public static void start() { + TEST_EVENTS_HANDLER = + InstrumentationBridge.createTestEventsHandler( + "karate", null, null, KarateUtils.capabilities()); + } + + @VisibleForTesting + public static void stop() { + if (TEST_EVENTS_HANDLER != null) { + TEST_EVENTS_HANDLER.close(); + TEST_EVENTS_HANDLER = null; + } + } + + private TestEventsHandlerHolder() {} +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/groovy/KarateV2Test.groovy b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/groovy/KarateV2Test.groovy new file mode 100644 index 00000000000..6adce09eeac --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/groovy/KarateV2Test.groovy @@ -0,0 +1,230 @@ +import datadog.trace.api.DisableTestTrace +import datadog.trace.api.civisibility.config.TestFQN +import datadog.trace.api.civisibility.config.TestIdentifier +import datadog.trace.civisibility.CiVisibilityInstrumentationTest +import datadog.trace.instrumentation.karate2.KarateUtils +import datadog.trace.instrumentation.karate2.TestEventsHandlerHolder +import org.example.* +import org.junit.jupiter.engine.JupiterTestEngine +import org.junit.platform.engine.DiscoverySelector +import org.junit.platform.engine.TestExecutionResult +import org.junit.platform.launcher.TestExecutionListener +import org.junit.platform.launcher.core.LauncherConfig +import org.junit.platform.launcher.core.LauncherDiscoveryRequestBuilder +import org.junit.platform.launcher.core.LauncherFactory + +import java.util.concurrent.ConcurrentHashMap +import java.util.concurrent.CopyOnWriteArrayList + +import static org.junit.platform.engine.discovery.DiscoverySelectors.selectClass + +@DisableTestTrace(reason = "avoid self-tracing") +class KarateV2Test extends CiVisibilityInstrumentationTest { + + def "test #testcaseName"() { + runTests(tests, success) + + assertSpansData(testcaseName) + + where: + testcaseName | success | tests + "test-succeed" | true | [TestSucceedKarate] + "test-succeed-parallel" | true | [TestSucceedParallelKarate] + "test-with-setup" | true | [TestWithSetupKarate] + "test-parameterized" | true | [TestParameterizedKarate] + "test-failed" | false | [TestFailedKarate] + "test-skipped-feature" | true | [TestSkippedFeatureKarate] + } + + def "test ITR #testcaseName"() { + givenSkippableTests(skippedTests) + + runTests(tests) + + assertSpansData(testcaseName) + + where: + testcaseName | tests | skippedTests + "test-itr-skipping" | [TestSucceedKarate] | [new TestIdentifier("[org/example/test_succeed] test succeed", "first scenario", null)] + "test-itr-skipping-parameterized" | [TestParameterizedKarate] | [ + new TestIdentifier("[org/example/test_parameterized] test parameterized", "first scenario as an outline", '{"param":"\'a\'","value":"aa"}') + ] + "test-itr-unskippable" | [TestUnskippableKarate] | [ + new TestIdentifier("[org/example/test_unskippable] test unskippable", "first scenario", null) + ] + } + + def "test flaky retries #testcaseName"() { + givenFlakyRetryEnabled(true) + givenFlakyTests(retriedTests) + + runTests(tests, success) + + assertSpansData(testcaseName) + + where: + testcaseName | success | tests | retriedTests + "test-failed" | false | [TestFailedKarate] | [] + "test-retry-failed" | false | [TestFailedKarate] | [new TestFQN("[org/example/test_failed] test failed", "second scenario")] + "test-failed-then-succeed" | true | [TestFailedThenSucceedKarate] | [new TestFQN("[org/example/test_failed_then_succeed] test failed", "flaky scenario")] + "test-retry-parameterized" | false | [TestFailedParameterizedKarate] | [ + new TestFQN("[org/example/test_failed_parameterized] test parameterized", "first scenario as an outline") + ] + } + + def "test early flakiness detection #testcaseName"() { + givenEarlyFlakinessDetectionEnabled(true) + givenKnownTests(knownTestsList) + + runTests(tests) + + assertSpansData(testcaseName) + + where: + testcaseName | tests | knownTestsList + "test-efd-known-test" | [TestSucceedOneCaseKarate] | [new TestFQN("[org/example/test_succeed_one_case] test succeed", "first scenario")] + "test-efd-known-parameterized-test" | [TestParameterizedKarate] | [ + new TestFQN("[org/example/test_parameterized] test parameterized", "first scenario as an outline") + ] + "test-efd-new-test" | [TestSucceedOneCaseKarate] | [] + "test-efd-new-parameterized-test" | [TestParameterizedKarate] | [] + "test-efd-new-slow-test" | [TestSucceedKarateSlow] | [] // is executed only twice + "test-efd-faulty-session-threshold" | [TestParameterizedMoreCasesKarate] | [] + "test-efd-skip-new-test" | [TestSucceedKarateSkipEfd] | [] + "test-efd-setup" | [TestWithSetupKarate] | [] + "test-efd-called-feature" | [TestSucceedCalledFeatureKarate] | [new TestFQN("[org/example/test_called_feature] test called feature", "caller")] + } + + def "test quarantined #testcaseName"() { + givenQuarantinedTests(quarantined) + + runTests(tests, true) + + assertSpansData(testcaseName) + + where: + testcaseName | tests | quarantined + "test-quarantined-failed" | [TestFailedKarate] | [new TestFQN("[org/example/test_failed] test failed", "second scenario")] + } + + def "test quarantined auto-retries #testcaseName"() { + givenQuarantinedTests(quarantined) + + givenFlakyRetryEnabled(true) + givenFlakyTests(retried) + + // every test retry fails, but the build status is successful + runTests(tests, true) + + assertSpansData(testcaseName) + + where: + testcaseName | tests | quarantined | retried + "test-quarantined-failed-atr" | [TestFailedKarate] | [new TestFQN("[org/example/test_failed] test failed", "second scenario")] | [new TestFQN("[org/example/test_failed] test failed", "second scenario")] + } + + def "test quarantined early flakiness detection #testcaseName"() { + givenQuarantinedTests(quarantined) + + givenEarlyFlakinessDetectionEnabled(true) + givenKnownTests(known) + + // every test retry fails, but the build status is successful + runTests(tests, true) + + assertSpansData(testcaseName) + + where: + testcaseName | tests | quarantined | known + "test-quarantined-failed-known" | [TestFailedKarate] | [new TestFQN("[org/example/test_failed] test failed", "second scenario")] | [new TestFQN("[org/example/test_failed] test failed", "second scenario")] + "test-quarantined-failed-efd" | [TestFailedKarate] | [new TestFQN("[org/example/test_failed] test failed", "second scenario")] | [] + } + + def "test disabled #testcaseName"() { + givenDisabledTests(disabled) + + runTests(tests, true) + + assertSpansData(testcaseName) + + where: + testcaseName | tests | disabled + "test-disabled-failed" | [TestFailedKarate] | [new TestFQN("[org/example/test_failed] test failed", "second scenario")] + } + + def "test attempt to fix #testcaseName"() { + givenQuarantinedTests(quarantined) + givenDisabledTests(disabled) + givenAttemptToFixTests(attemptToFix) + + runTests(tests, success) + + assertSpansData(testcaseName) + + where: + testcaseName | success | tests | attemptToFix | quarantined | disabled + "test-attempt-to-fix-failed" | false | [TestFailedKarate] | [new TestFQN("[org/example/test_failed] test failed", "second scenario")] | [] | [] + "test-attempt-to-fix-succeeded" | true | [TestSucceedKarate] | [new TestFQN("[org/example/test_succeed] test succeed", "first scenario")] | [] | [] + "test-attempt-to-fix-quarantined-failed" | false | [TestFailedKarate] | [new TestFQN("[org/example/test_failed] test failed", "second scenario")] | [new TestFQN("[org/example/test_failed] test failed", "second scenario")] | [] + "test-attempt-to-fix-quarantined-succeeded" | true | [TestSucceedKarate] | [new TestFQN("[org/example/test_succeed] test succeed", "first scenario")] | [new TestFQN("[org/example/test_succeed] test succeed", "first scenario")] | [] + "test-attempt-to-fix-disabled-failed" | false | [TestFailedKarate] | [new TestFQN("[org/example/test_failed] test failed", "second scenario")] | [] | [new TestFQN("[org/example/test_failed] test failed", "second scenario")] + "test-attempt-to-fix-disabled-succeeded" | true | [TestSucceedKarate] | [new TestFQN("[org/example/test_succeed] test succeed", "first scenario")] | [] | [new TestFQN("[org/example/test_succeed] test succeed", "first scenario")] + } + + private void runTests(List> tests, boolean expectSuccess = true) { + TestEventsHandlerHolder.start() + + DiscoverySelector[] selectors = new DiscoverySelector[tests.size()] + for (i in 0..> testsByStatus = new ConcurrentHashMap<>() + + void executionFinished(org.junit.platform.launcher.TestIdentifier testIdentifier, TestExecutionResult testExecutionResult) { + testsByStatus.computeIfAbsent(testExecutionResult.status, k -> new CopyOnWriteArrayList<>()).add(testIdentifier) + } + } +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/KarateStandaloneScenarioTest.java b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/KarateStandaloneScenarioTest.java new file mode 100644 index 00000000000..15f2c4f2db9 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/KarateStandaloneScenarioTest.java @@ -0,0 +1,23 @@ +import static org.junit.jupiter.api.Assertions.assertTrue; + +import io.karatelabs.common.Resource; +import io.karatelabs.core.KarateJs; +import io.karatelabs.core.ScenarioResult; +import io.karatelabs.core.ScenarioRuntime; +import io.karatelabs.gherkin.Feature; +import io.karatelabs.gherkin.Scenario; +import org.junit.jupiter.api.Test; + +public class KarateStandaloneScenarioTest { + + @Test + public void testStandaloneScenarioRuntime() { + Resource resource = Resource.path("classpath:org/example/test_succeed_one_case.feature"); + Feature feature = Feature.read(resource); + Scenario scenario = feature.getSections().getFirst().getScenario(); + + ScenarioResult result = new ScenarioRuntime(new KarateJs(resource), scenario).call(); + + assertTrue(result.isPassed()); + } +} diff --git a/dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/Flaky.java b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/Flaky.java similarity index 100% rename from dd-java-agent/instrumentation/karate-1.0/src/test/java/org/example/Flaky.java rename to dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/Flaky.java diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/Slow.java b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/Slow.java new file mode 100644 index 00000000000..23a8bcd6d7e --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/Slow.java @@ -0,0 +1,12 @@ +package org.example; + +public class Slow { + + public static void stall() { + try { + Thread.sleep(1100); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestFailedKarate.java b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestFailedKarate.java new file mode 100644 index 00000000000..0aa667d0a7d --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestFailedKarate.java @@ -0,0 +1,16 @@ +package org.example; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.intuit.karate.Results; +import com.intuit.karate.Runner; +import org.junit.jupiter.api.Test; + +public class TestFailedKarate { + + @Test + public void test() { + Results results = Runner.path("classpath:org/example/test_failed.feature").parallel(1); + assertEquals(0, results.getFailCount(), results.getErrorMessages()); + } +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestFailedParameterizedKarate.java b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestFailedParameterizedKarate.java new file mode 100644 index 00000000000..026f47875ed --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestFailedParameterizedKarate.java @@ -0,0 +1,17 @@ +package org.example; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.intuit.karate.Results; +import com.intuit.karate.Runner; +import org.junit.jupiter.api.Test; + +public class TestFailedParameterizedKarate { + + @Test + public void test() { + Results results = + Runner.path("classpath:org/example/test_failed_parameterized.feature").parallel(1); + assertEquals(0, results.getFailCount(), results.getErrorMessages()); + } +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestFailedThenSucceedKarate.java b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestFailedThenSucceedKarate.java new file mode 100644 index 00000000000..9ce500bd482 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestFailedThenSucceedKarate.java @@ -0,0 +1,17 @@ +package org.example; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.intuit.karate.Results; +import com.intuit.karate.Runner; +import org.junit.jupiter.api.Test; + +public class TestFailedThenSucceedKarate { + + @Test + public void test() { + Results results = + Runner.path("classpath:org/example/test_failed_then_succeed.feature").parallel(1); + assertEquals(0, results.getFailCount(), results.getErrorMessages()); + } +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestParameterizedKarate.java b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestParameterizedKarate.java new file mode 100644 index 00000000000..3d849359504 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestParameterizedKarate.java @@ -0,0 +1,16 @@ +package org.example; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.intuit.karate.Results; +import com.intuit.karate.Runner; +import org.junit.jupiter.api.Test; + +public class TestParameterizedKarate { + + @Test + public void test() { + Results results = Runner.path("classpath:org/example/test_parameterized.feature").parallel(1); + assertEquals(0, results.getFailCount(), results.getErrorMessages()); + } +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestParameterizedMoreCasesKarate.java b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestParameterizedMoreCasesKarate.java new file mode 100644 index 00000000000..7a0a9af41a4 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestParameterizedMoreCasesKarate.java @@ -0,0 +1,17 @@ +package org.example; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.intuit.karate.Results; +import com.intuit.karate.Runner; +import org.junit.jupiter.api.Test; + +public class TestParameterizedMoreCasesKarate { + + @Test + public void test() { + Results results = + Runner.path("classpath:org/example/test_parameterized_more_cases.feature").parallel(1); + assertEquals(0, results.getFailCount(), results.getErrorMessages()); + } +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestSkippedFeatureKarate.java b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestSkippedFeatureKarate.java new file mode 100644 index 00000000000..74d246bd98f --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestSkippedFeatureKarate.java @@ -0,0 +1,19 @@ +package org.example; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.intuit.karate.Results; +import com.intuit.karate.Runner; +import org.junit.jupiter.api.Test; + +public class TestSkippedFeatureKarate { + + @Test + void testParallel() { + Results results = + Runner.path("classpath:org/example/test_succeed.feature") + .systemProperty("karate.options", "--tags ~@foo") + .parallel(1); + assertEquals(0, results.getFailCount(), results.getErrorMessages()); + } +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestSucceedCalledFeatureKarate.java b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestSucceedCalledFeatureKarate.java new file mode 100644 index 00000000000..df87c42a593 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestSucceedCalledFeatureKarate.java @@ -0,0 +1,16 @@ +package org.example; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.intuit.karate.Results; +import com.intuit.karate.Runner; +import org.junit.jupiter.api.Test; + +public class TestSucceedCalledFeatureKarate { + + @Test + public void test() { + Results results = Runner.path("classpath:org/example/test_called_feature.feature").parallel(1); + assertEquals(0, results.getFailCount(), results.getErrorMessages()); + } +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestSucceedKarate.java b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestSucceedKarate.java new file mode 100644 index 00000000000..3c3ae82182d --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestSucceedKarate.java @@ -0,0 +1,16 @@ +package org.example; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.intuit.karate.Results; +import com.intuit.karate.Runner; +import org.junit.jupiter.api.Test; + +public class TestSucceedKarate { + + @Test + public void test() { + Results results = Runner.path("classpath:org/example/test_succeed.feature").parallel(1); + assertEquals(0, results.getFailCount(), results.getErrorMessages()); + } +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestSucceedKarateSkipEfd.java b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestSucceedKarateSkipEfd.java new file mode 100644 index 00000000000..c13e94725c9 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestSucceedKarateSkipEfd.java @@ -0,0 +1,17 @@ +package org.example; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.intuit.karate.Results; +import com.intuit.karate.Runner; +import org.junit.jupiter.api.Test; + +public class TestSucceedKarateSkipEfd { + + @Test + public void test() { + Results results = + Runner.path("classpath:org/example/test_succeed_skip_efd.feature").parallel(1); + assertEquals(0, results.getFailCount(), results.getErrorMessages()); + } +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestSucceedKarateSlow.java b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestSucceedKarateSlow.java new file mode 100644 index 00000000000..b5b41c94657 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestSucceedKarateSlow.java @@ -0,0 +1,16 @@ +package org.example; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.intuit.karate.Results; +import com.intuit.karate.Runner; +import org.junit.jupiter.api.Test; + +public class TestSucceedKarateSlow { + + @Test + public void test() { + Results results = Runner.path("classpath:org/example/test_succeed_slow.feature").parallel(1); + assertEquals(0, results.getFailCount(), results.getErrorMessages()); + } +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestSucceedOneCaseKarate.java b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestSucceedOneCaseKarate.java new file mode 100644 index 00000000000..2158105d49e --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestSucceedOneCaseKarate.java @@ -0,0 +1,17 @@ +package org.example; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.intuit.karate.Results; +import com.intuit.karate.Runner; +import org.junit.jupiter.api.Test; + +public class TestSucceedOneCaseKarate { + + @Test + public void test() { + Results results = + Runner.path("classpath:org/example/test_succeed_one_case.feature").parallel(1); + assertEquals(0, results.getFailCount(), results.getErrorMessages()); + } +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestSucceedParallelKarate.java b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestSucceedParallelKarate.java new file mode 100644 index 00000000000..f180ca3ba02 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestSucceedParallelKarate.java @@ -0,0 +1,16 @@ +package org.example; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.intuit.karate.Results; +import com.intuit.karate.Runner; +import org.junit.jupiter.api.Test; + +public class TestSucceedParallelKarate { + + @Test + public void testSucceed() { + Results results = Runner.path("classpath:org/example/test_succeed.feature").parallel(4); + assertEquals(0, results.getFailCount(), results.getErrorMessages()); + } +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestUnskippableKarate.java b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestUnskippableKarate.java new file mode 100644 index 00000000000..fd82915bc7b --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestUnskippableKarate.java @@ -0,0 +1,16 @@ +package org.example; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.intuit.karate.Results; +import com.intuit.karate.Runner; +import org.junit.jupiter.api.Test; + +public class TestUnskippableKarate { + + @Test + public void test() { + Results results = Runner.path("classpath:org/example/test_unskippable.feature").parallel(1); + assertEquals(0, results.getFailCount(), results.getErrorMessages()); + } +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestWithSetupKarate.java b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestWithSetupKarate.java new file mode 100644 index 00000000000..86a5d703884 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/TestWithSetupKarate.java @@ -0,0 +1,16 @@ +package org.example; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.intuit.karate.Results; +import com.intuit.karate.Runner; +import org.junit.jupiter.api.Test; + +public class TestWithSetupKarate { + + @Test + public void test() { + Results results = Runner.path("classpath:org/example/test_with_setup.feature").parallel(1); + assertEquals(0, results.getFailCount(), results.getErrorMessages()); + } +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/karate-config.js b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/karate-config.js new file mode 100644 index 00000000000..7e70e8ac51b --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/karate-config.js @@ -0,0 +1,2 @@ +function fn() { +} diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_called_feature.feature b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_called_feature.feature new file mode 100644 index 00000000000..397dfdcf103 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_called_feature.feature @@ -0,0 +1,4 @@ +Feature: test called feature + + Scenario: caller + * call read('test_called_feature_nested.feature') diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_called_feature_nested.feature b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_called_feature_nested.feature new file mode 100644 index 00000000000..4dcb62008a4 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_called_feature_nested.feature @@ -0,0 +1,4 @@ +Feature: test called feature nested + + Scenario: called + * def value = true diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_failed.feature b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_failed.feature new file mode 100644 index 00000000000..534144ae715 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_failed.feature @@ -0,0 +1,7 @@ +Feature: test failed + + Scenario: first scenario + * print 'first' + + Scenario: second scenario + * assert false diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_failed_parameterized.feature b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_failed_parameterized.feature new file mode 100644 index 00000000000..5728f8d7df2 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_failed_parameterized.feature @@ -0,0 +1,13 @@ +Feature: test parameterized + + Scenario Outline: first scenario as an outline + (to prevent a particular bug from re-appearing) + + Given def p = + When def response = p + p + Then match response == value + + Examples: + | param | value | + | 'a' | aaa | + | 'b' | bb | diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_failed_then_succeed.feature b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_failed_then_succeed.feature new file mode 100644 index 00000000000..31fe2d52422 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_failed_then_succeed.feature @@ -0,0 +1,4 @@ +Feature: test failed + + Scenario: flaky scenario + * Java.type('org.example.Flaky').flake() diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_parameterized.feature b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_parameterized.feature new file mode 100644 index 00000000000..62beb7ae198 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_parameterized.feature @@ -0,0 +1,13 @@ +Feature: test parameterized + + Scenario Outline: first scenario as an outline + (to prevent a particular bug from re-appearing) + + Given def p = + When def response = p + p + Then match response == value + + Examples: + | param | value | + | 'a' | aa | + | 'b' | bb | diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_parameterized_more_cases.feature b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_parameterized_more_cases.feature new file mode 100644 index 00000000000..9ed0d225025 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_parameterized_more_cases.feature @@ -0,0 +1,14 @@ +Feature: test parameterized + + Scenario Outline: first scenario as an outline + (to prevent a particular bug from re-appearing) + + Given def p = + When def response = p + p + Then match response == value + + Examples: + | param | value | + | 'a' | aa | + | 'b' | bb | + | 'c' | cc | diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_succeed.feature b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_succeed.feature new file mode 100644 index 00000000000..a82428ed0c6 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_succeed.feature @@ -0,0 +1,9 @@ +@foo +Feature: test succeed + + @bar + Scenario: first scenario + * print 'first' + + Scenario: second scenario + * print 'second' diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_succeed_one_case.feature b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_succeed_one_case.feature new file mode 100644 index 00000000000..162d2af3b42 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_succeed_one_case.feature @@ -0,0 +1,6 @@ +@foo +Feature: test succeed + + @bar + Scenario: first scenario + * print 'first' diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_succeed_skip_efd.feature b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_succeed_skip_efd.feature new file mode 100644 index 00000000000..1b2325b1880 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_succeed_skip_efd.feature @@ -0,0 +1,6 @@ +@foo +Feature: test succeed + + @datadog_efd_disable + Scenario: first scenario + * print 'first' diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_succeed_slow.feature b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_succeed_slow.feature new file mode 100644 index 00000000000..1e32a10962e --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_succeed_slow.feature @@ -0,0 +1,6 @@ +@foo +Feature: test succeed + + @bar + Scenario: first scenario + * Java.type('org.example.Slow').stall() diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_unskippable.feature b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_unskippable.feature new file mode 100644 index 00000000000..25142d2a161 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_unskippable.feature @@ -0,0 +1,10 @@ +@foo +Feature: test unskippable + + @bar + @datadog_itr_unskippable + Scenario: first scenario + * print 'first' + + Scenario: second scenario + * print 'second' diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_with_setup.feature b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_with_setup.feature new file mode 100644 index 00000000000..a2e7535b031 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/java/org/example/test_with_setup.feature @@ -0,0 +1,20 @@ +Feature: test with setup + + @setup + Scenario: setup scenario + * def data = + """ + [ + {foo: "bar"} + ] + """ + + Scenario Outline: first scenario + * print foo + Examples: + | karate.setup().data | + + Scenario Outline: second scenario + * print foo + Examples: + | karate.setupOnce().data | diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-disabled-failed/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-disabled-failed/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-disabled-failed/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-disabled-failed/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-disabled-failed/events.ftl new file mode 100644 index 00000000000..16339cefc58 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-disabled-failed/events.ftl @@ -0,0 +1,244 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 4, + "step.startLine" : 4 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* false" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* false", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 1, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "java.lang.AssertionError", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_failed] test failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_failed] test failed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_2}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "fail", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed] test failed", + "test.test_management.attempt_to_fix_passed" : "false", + "test.test_management.is_attempt_to_fix" : "true", + "test.test_management.is_test_disabled" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_failed] test failed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.test_management.enabled" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_6}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "fail", + "test.test_management.enabled" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-disabled-succeeded/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-disabled-succeeded/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-disabled-succeeded/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-disabled-succeeded/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-disabled-succeeded/events.ftl new file mode 100644 index 00000000000..92b7cb61f6a --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-disabled-succeeded/events.ftl @@ -0,0 +1,525 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_3}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_4}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_4}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_5}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_5}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'second'" + }, + "metrics" : { + "step.endLine" : 9, + "step.startLine" : 9 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_6}, + "resource" : "* 'second'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_6}, + "start" : ${content_start_6}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.traits" : "{\"category\":[\"foo\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_succeed] test succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.test_management.is_attempt_to_fix" : "true", + "test.test_management.is_test_disabled" : "true", + "test.traits" : "{\"category\":[\"foo\",\"bar\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_succeed] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_8}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_9}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.retry_reason" : "attempt_to_fix", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.test_management.is_attempt_to_fix" : "true", + "test.test_management.is_test_disabled" : "true", + "test.traits" : "{\"category\":[\"foo\",\"bar\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_succeed] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_9}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_10}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.retry_reason" : "attempt_to_fix", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.test_management.is_attempt_to_fix" : "true", + "test.test_management.is_test_disabled" : "true", + "test.traits" : "{\"category\":[\"foo\",\"bar\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_succeed] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_3}, + "start" : ${content_start_10}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_11}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.retry_reason" : "attempt_to_fix", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.test_management.is_attempt_to_fix" : "true", + "test.test_management.is_test_disabled" : "true", + "test.traits" : "{\"category\":[\"foo\",\"bar\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_succeed] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_4}, + "start" : ${content_start_11}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_12}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.retry_reason" : "attempt_to_fix", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.test_management.attempt_to_fix_passed" : "true", + "test.test_management.is_attempt_to_fix" : "true", + "test.test_management.is_test_disabled" : "true", + "test.traits" : "{\"category\":[\"foo\",\"bar\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_succeed] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_5}, + "start" : ${content_start_12}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_13}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.traits" : "{\"category\":[\"foo\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_7}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_succeed] test succeed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_6}, + "start" : ${content_start_13}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_14}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.test_management.enabled" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_8}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_14}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_15}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.test_management.enabled" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_9} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_15}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-failed/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-failed/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-failed/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-failed/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-failed/events.ftl new file mode 100644 index 00000000000..8283cde93b2 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-failed/events.ftl @@ -0,0 +1,243 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 4, + "step.startLine" : 4 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* false" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* false", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 1, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "java.lang.AssertionError", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_failed] test failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_failed] test failed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_2}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "fail", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed] test failed", + "test.test_management.attempt_to_fix_passed" : "false", + "test.test_management.is_attempt_to_fix" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_failed] test failed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.test_management.enabled" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_6}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "fail", + "test.test_management.enabled" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-quarantined-failed/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-quarantined-failed/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-quarantined-failed/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-quarantined-failed/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-quarantined-failed/events.ftl new file mode 100644 index 00000000000..a2e55ac59cc --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-quarantined-failed/events.ftl @@ -0,0 +1,244 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 4, + "step.startLine" : 4 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* false" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* false", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 1, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "java.lang.AssertionError", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_failed] test failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_failed] test failed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_2}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "fail", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed] test failed", + "test.test_management.attempt_to_fix_passed" : "false", + "test.test_management.is_attempt_to_fix" : "true", + "test.test_management.is_quarantined" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_failed] test failed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.test_management.enabled" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_6}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "fail", + "test.test_management.enabled" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-quarantined-succeeded/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-quarantined-succeeded/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-quarantined-succeeded/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-quarantined-succeeded/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-quarantined-succeeded/events.ftl new file mode 100644 index 00000000000..6ae123bab0a --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-quarantined-succeeded/events.ftl @@ -0,0 +1,525 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_3}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_4}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_4}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_5}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_5}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'second'" + }, + "metrics" : { + "step.endLine" : 9, + "step.startLine" : 9 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_6}, + "resource" : "* 'second'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_6}, + "start" : ${content_start_6}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.traits" : "{\"category\":[\"foo\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_succeed] test succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.test_management.is_attempt_to_fix" : "true", + "test.test_management.is_quarantined" : "true", + "test.traits" : "{\"category\":[\"foo\",\"bar\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_succeed] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_8}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_9}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.retry_reason" : "attempt_to_fix", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.test_management.is_attempt_to_fix" : "true", + "test.test_management.is_quarantined" : "true", + "test.traits" : "{\"category\":[\"foo\",\"bar\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_succeed] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_9}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_10}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.retry_reason" : "attempt_to_fix", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.test_management.is_attempt_to_fix" : "true", + "test.test_management.is_quarantined" : "true", + "test.traits" : "{\"category\":[\"foo\",\"bar\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_succeed] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_3}, + "start" : ${content_start_10}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_11}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.retry_reason" : "attempt_to_fix", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.test_management.is_attempt_to_fix" : "true", + "test.test_management.is_quarantined" : "true", + "test.traits" : "{\"category\":[\"foo\",\"bar\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_succeed] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_4}, + "start" : ${content_start_11}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_12}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.retry_reason" : "attempt_to_fix", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.test_management.attempt_to_fix_passed" : "true", + "test.test_management.is_attempt_to_fix" : "true", + "test.test_management.is_quarantined" : "true", + "test.traits" : "{\"category\":[\"foo\",\"bar\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_succeed] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_5}, + "start" : ${content_start_12}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_13}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.traits" : "{\"category\":[\"foo\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_7}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_succeed] test succeed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_6}, + "start" : ${content_start_13}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_14}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.test_management.enabled" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_8}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_14}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_15}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.test_management.enabled" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_9} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_15}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-succeeded/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-succeeded/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-succeeded/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-succeeded/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-succeeded/events.ftl new file mode 100644 index 00000000000..2854fab44a6 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-attempt-to-fix-succeeded/events.ftl @@ -0,0 +1,520 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_3}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_4}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_4}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_5}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_5}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'second'" + }, + "metrics" : { + "step.endLine" : 9, + "step.startLine" : 9 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_6}, + "resource" : "* 'second'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_6}, + "start" : ${content_start_6}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.traits" : "{\"category\":[\"foo\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_succeed] test succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.test_management.is_attempt_to_fix" : "true", + "test.traits" : "{\"category\":[\"foo\",\"bar\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_succeed] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_8}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_9}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.retry_reason" : "attempt_to_fix", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.test_management.is_attempt_to_fix" : "true", + "test.traits" : "{\"category\":[\"foo\",\"bar\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_succeed] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_9}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_10}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.retry_reason" : "attempt_to_fix", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.test_management.is_attempt_to_fix" : "true", + "test.traits" : "{\"category\":[\"foo\",\"bar\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_succeed] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_3}, + "start" : ${content_start_10}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_11}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.retry_reason" : "attempt_to_fix", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.test_management.is_attempt_to_fix" : "true", + "test.traits" : "{\"category\":[\"foo\",\"bar\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_succeed] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_4}, + "start" : ${content_start_11}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_12}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.retry_reason" : "attempt_to_fix", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.test_management.attempt_to_fix_passed" : "true", + "test.test_management.is_attempt_to_fix" : "true", + "test.traits" : "{\"category\":[\"foo\",\"bar\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_succeed] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_5}, + "start" : ${content_start_12}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_13}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.traits" : "{\"category\":[\"foo\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_7}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_succeed] test succeed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_6}, + "start" : ${content_start_13}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_14}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.test_management.enabled" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_8}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_14}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_15}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.test_management.enabled" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_9} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_15}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-disabled-failed/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-disabled-failed/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-disabled-failed/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-disabled-failed/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-disabled-failed/events.ftl new file mode 100644 index 00000000000..8ec4e8fa639 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-disabled-failed/events.ftl @@ -0,0 +1,213 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 4, + "step.startLine" : 4 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_failed] test failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_2}, + "resource" : "[org/example/test_failed] test failed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "skip", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.skip_reason" : "Flaky test is disabled by Datadog", + "test.status" : "skip", + "test.suite" : "[org/example/test_failed] test failed", + "test.test_management.is_test_disabled" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_2}, + "resource" : "[org/example/test_failed] test failed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.test_management.enabled" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_5}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.test_management.enabled" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_6}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-called-feature/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-called-feature/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-called-feature/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-called-feature/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-called-feature/events.ftl new file mode 100644 index 00000000000..dc7845a9902 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-called-feature/events.ftl @@ -0,0 +1,192 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* read('test_called_feature_nested.feature')" + }, + "metrics" : { + "step.endLine" : 4, + "step.startLine" : 4 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* read('test_called_feature_nested.feature')", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* value = true" + }, + "metrics" : { + "step.endLine" : 4, + "step.startLine" : 4 + }, + "name" : "karate.step", + "parent_id" : ${content_span_id}, + "resource" : "* value = true", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_called_feature] test called feature", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_called_feature] test called feature", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "caller", + "test.status" : "pass", + "test.suite" : "[org/example/test_called_feature] test called feature", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_2}, + "resource" : "[org/example/test_called_feature] test called feature.caller", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_5}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_6}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-faulty-session-threshold/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-faulty-session-threshold/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-faulty-session-threshold/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-faulty-session-threshold/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-faulty-session-threshold/events.ftl new file mode 100644 index 00000000000..831f14555c6 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-faulty-session-threshold/events.ftl @@ -0,0 +1,926 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Given p = 'a'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "Given p = 'a'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Given p = 'a'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "Given p = 'a'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Given p = 'a'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "Given p = 'a'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_3}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Given p = 'b'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_4}, + "resource" : "Given p = 'b'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_4}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Given p = 'b'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_5}, + "resource" : "Given p = 'b'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_5}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Given p = 'b'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_6}, + "resource" : "Given p = 'b'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_6}, + "start" : ${content_start_6}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Given p = 'c'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_7}, + "resource" : "Given p = 'c'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_7}, + "start" : ${content_start_7}, + "trace_id" : ${content_trace_id_7} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Then response == value" + }, + "metrics" : { + "step.endLine" : 8, + "step.startLine" : 8 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "Then response == value", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_8}, + "start" : ${content_start_8}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_9}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Then response == value" + }, + "metrics" : { + "step.endLine" : 8, + "step.startLine" : 8 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "Then response == value", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_9}, + "start" : ${content_start_9}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_10}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Then response == value" + }, + "metrics" : { + "step.endLine" : 8, + "step.startLine" : 8 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "Then response == value", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_10}, + "start" : ${content_start_10}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_11}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Then response == value" + }, + "metrics" : { + "step.endLine" : 8, + "step.startLine" : 8 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_4}, + "resource" : "Then response == value", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_11}, + "start" : ${content_start_11}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_12}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Then response == value" + }, + "metrics" : { + "step.endLine" : 8, + "step.startLine" : 8 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_5}, + "resource" : "Then response == value", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_12}, + "start" : ${content_start_12}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_13}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Then response == value" + }, + "metrics" : { + "step.endLine" : 8, + "step.startLine" : 8 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_6}, + "resource" : "Then response == value", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_13}, + "start" : ${content_start_13}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_14}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Then response == value" + }, + "metrics" : { + "step.endLine" : 8, + "step.startLine" : 8 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_7}, + "resource" : "Then response == value", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_14}, + "start" : ${content_start_14}, + "trace_id" : ${content_trace_id_7} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_15}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "When response = p + p" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "When response = p + p", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_15}, + "start" : ${content_start_15}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_16}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "When response = p + p" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "When response = p + p", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_16}, + "start" : ${content_start_16}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_17}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "When response = p + p" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "When response = p + p", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_17}, + "start" : ${content_start_17}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_18}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "When response = p + p" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_4}, + "resource" : "When response = p + p", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_18}, + "start" : ${content_start_18}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_19}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "When response = p + p" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_5}, + "resource" : "When response = p + p", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_19}, + "start" : ${content_start_19}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_20}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "When response = p + p" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_6}, + "resource" : "When response = p + p", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_20}, + "start" : ${content_start_20}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_21}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "When response = p + p" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_7}, + "resource" : "When response = p + p", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_21}, + "start" : ${content_start_21}, + "trace_id" : ${content_trace_id_7} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_22}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_parameterized_more_cases] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_parameterized_more_cases] test parameterized", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_22}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_23}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario as an outline", + "test.parameters" : "{\"param\":\"'a'\",\"value\":\"aa\"}", + "test.status" : "pass", + "test.suite" : "[org/example/test_parameterized_more_cases] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_8}, + "resource" : "[org/example/test_parameterized_more_cases] test parameterized.first scenario as an outline", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_23}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_24}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario as an outline", + "test.parameters" : "{\"param\":\"'a'\",\"value\":\"aa\"}", + "test.retry_reason" : "early_flake_detection", + "test.status" : "pass", + "test.suite" : "[org/example/test_parameterized_more_cases] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_8}, + "resource" : "[org/example/test_parameterized_more_cases] test parameterized.first scenario as an outline", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_24}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_25}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario as an outline", + "test.parameters" : "{\"param\":\"'a'\",\"value\":\"aa\"}", + "test.retry_reason" : "early_flake_detection", + "test.status" : "pass", + "test.suite" : "[org/example/test_parameterized_more_cases] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_8}, + "resource" : "[org/example/test_parameterized_more_cases] test parameterized.first scenario as an outline", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_3}, + "start" : ${content_start_25}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_26}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario as an outline", + "test.parameters" : "{\"param\":\"'b'\",\"value\":\"bb\"}", + "test.status" : "pass", + "test.suite" : "[org/example/test_parameterized_more_cases] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_8}, + "resource" : "[org/example/test_parameterized_more_cases] test parameterized.first scenario as an outline", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_4}, + "start" : ${content_start_26}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_27}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario as an outline", + "test.parameters" : "{\"param\":\"'b'\",\"value\":\"bb\"}", + "test.retry_reason" : "early_flake_detection", + "test.status" : "pass", + "test.suite" : "[org/example/test_parameterized_more_cases] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_8}, + "resource" : "[org/example/test_parameterized_more_cases] test parameterized.first scenario as an outline", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_5}, + "start" : ${content_start_27}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_28}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario as an outline", + "test.parameters" : "{\"param\":\"'b'\",\"value\":\"bb\"}", + "test.retry_reason" : "early_flake_detection", + "test.status" : "pass", + "test.suite" : "[org/example/test_parameterized_more_cases] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_7}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_8}, + "resource" : "[org/example/test_parameterized_more_cases] test parameterized.first scenario as an outline", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_6}, + "start" : ${content_start_28}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_29}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario as an outline", + "test.parameters" : "{\"param\":\"'c'\",\"value\":\"cc\"}", + "test.status" : "pass", + "test.suite" : "[org/example/test_parameterized_more_cases] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_8}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_8}, + "resource" : "[org/example/test_parameterized_more_cases] test parameterized.first scenario as an outline", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_7}, + "start" : ${content_start_29}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_7} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_30}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.early_flake.abort_reason" : "faulty", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_9}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_30}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_31}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.early_flake.abort_reason" : "faulty", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_10} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_31}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-known-parameterized-test/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-known-parameterized-test/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-known-parameterized-test/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-known-parameterized-test/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-known-parameterized-test/events.ftl new file mode 100644 index 00000000000..e932f698ef1 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-known-parameterized-test/events.ftl @@ -0,0 +1,333 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Given p = 'a'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "Given p = 'a'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Given p = 'b'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "Given p = 'b'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Then response == value" + }, + "metrics" : { + "step.endLine" : 8, + "step.startLine" : 8 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "Then response == value", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_3}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Then response == value" + }, + "metrics" : { + "step.endLine" : 8, + "step.startLine" : 8 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "Then response == value", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_4}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "When response = p + p" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "When response = p + p", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_5}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "When response = p + p" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "When response = p + p", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_6}, + "start" : ${content_start_6}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_parameterized] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_parameterized] test parameterized", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "first scenario as an outline", + "test.parameters" : "{\"param\":\"'a'\",\"value\":\"aa\"}", + "test.status" : "pass", + "test.suite" : "[org/example/test_parameterized] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_parameterized] test parameterized.first scenario as an outline", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_8}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_9}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "first scenario as an outline", + "test.parameters" : "{\"param\":\"'b'\",\"value\":\"bb\"}", + "test.status" : "pass", + "test.suite" : "[org/example/test_parameterized] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_parameterized] test parameterized.first scenario as an outline", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_9}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_10}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_10}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_11}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_11}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-known-test/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-known-test/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-known-test/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-known-test/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-known-test/events.ftl new file mode 100644 index 00000000000..9a7f0fe3d8c --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-known-test/events.ftl @@ -0,0 +1,170 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed_one_case] test succeed", + "test.traits" : "{\"category\":[\"foo\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_succeed_one_case] test succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed_one_case] test succeed", + "test.traits" : "{\"category\":[\"foo\",\"bar\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_2}, + "resource" : "[org/example/test_succeed_one_case] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_4}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-new-parameterized-test/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-new-parameterized-test/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-new-parameterized-test/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-new-parameterized-test/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-new-parameterized-test/events.ftl new file mode 100644 index 00000000000..d9413043788 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-new-parameterized-test/events.ftl @@ -0,0 +1,809 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Given p = 'a'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "Given p = 'a'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Given p = 'a'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "Given p = 'a'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Given p = 'a'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "Given p = 'a'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_3}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Given p = 'b'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_4}, + "resource" : "Given p = 'b'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_4}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Given p = 'b'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_5}, + "resource" : "Given p = 'b'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_5}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Given p = 'b'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_6}, + "resource" : "Given p = 'b'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_6}, + "start" : ${content_start_6}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Then response == value" + }, + "metrics" : { + "step.endLine" : 8, + "step.startLine" : 8 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "Then response == value", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_7}, + "start" : ${content_start_7}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Then response == value" + }, + "metrics" : { + "step.endLine" : 8, + "step.startLine" : 8 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "Then response == value", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_8}, + "start" : ${content_start_8}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_9}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Then response == value" + }, + "metrics" : { + "step.endLine" : 8, + "step.startLine" : 8 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "Then response == value", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_9}, + "start" : ${content_start_9}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_10}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Then response == value" + }, + "metrics" : { + "step.endLine" : 8, + "step.startLine" : 8 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_4}, + "resource" : "Then response == value", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_10}, + "start" : ${content_start_10}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_11}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Then response == value" + }, + "metrics" : { + "step.endLine" : 8, + "step.startLine" : 8 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_5}, + "resource" : "Then response == value", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_11}, + "start" : ${content_start_11}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_12}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Then response == value" + }, + "metrics" : { + "step.endLine" : 8, + "step.startLine" : 8 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_6}, + "resource" : "Then response == value", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_12}, + "start" : ${content_start_12}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_13}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "When response = p + p" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "When response = p + p", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_13}, + "start" : ${content_start_13}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_14}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "When response = p + p" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "When response = p + p", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_14}, + "start" : ${content_start_14}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_15}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "When response = p + p" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "When response = p + p", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_15}, + "start" : ${content_start_15}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_16}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "When response = p + p" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_4}, + "resource" : "When response = p + p", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_16}, + "start" : ${content_start_16}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_17}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "When response = p + p" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_5}, + "resource" : "When response = p + p", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_17}, + "start" : ${content_start_17}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_18}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "When response = p + p" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_6}, + "resource" : "When response = p + p", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_18}, + "start" : ${content_start_18}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_19}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_parameterized] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_parameterized] test parameterized", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_19}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_20}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario as an outline", + "test.parameters" : "{\"param\":\"'a'\",\"value\":\"aa\"}", + "test.status" : "pass", + "test.suite" : "[org/example/test_parameterized] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_parameterized] test parameterized.first scenario as an outline", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_20}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_21}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario as an outline", + "test.parameters" : "{\"param\":\"'a'\",\"value\":\"aa\"}", + "test.retry_reason" : "early_flake_detection", + "test.status" : "pass", + "test.suite" : "[org/example/test_parameterized] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_parameterized] test parameterized.first scenario as an outline", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_21}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_22}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario as an outline", + "test.parameters" : "{\"param\":\"'a'\",\"value\":\"aa\"}", + "test.retry_reason" : "early_flake_detection", + "test.status" : "pass", + "test.suite" : "[org/example/test_parameterized] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_parameterized] test parameterized.first scenario as an outline", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_3}, + "start" : ${content_start_22}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_23}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario as an outline", + "test.parameters" : "{\"param\":\"'b'\",\"value\":\"bb\"}", + "test.status" : "pass", + "test.suite" : "[org/example/test_parameterized] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_parameterized] test parameterized.first scenario as an outline", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_4}, + "start" : ${content_start_23}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_24}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario as an outline", + "test.parameters" : "{\"param\":\"'b'\",\"value\":\"bb\"}", + "test.retry_reason" : "early_flake_detection", + "test.status" : "pass", + "test.suite" : "[org/example/test_parameterized] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_parameterized] test parameterized.first scenario as an outline", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_5}, + "start" : ${content_start_24}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_25}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario as an outline", + "test.parameters" : "{\"param\":\"'b'\",\"value\":\"bb\"}", + "test.retry_reason" : "early_flake_detection", + "test.status" : "pass", + "test.suite" : "[org/example/test_parameterized] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_7}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_parameterized] test parameterized.first scenario as an outline", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_6}, + "start" : ${content_start_25}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_26}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.early_flake.abort_reason" : "faulty", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_8}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_26}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_27}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.early_flake.abort_reason" : "faulty", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_9} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_27}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-new-slow-test/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-new-slow-test/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-new-slow-test/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-new-slow-test/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-new-slow-test/events.ftl new file mode 100644 index 00000000000..648c137f7f9 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-new-slow-test/events.ftl @@ -0,0 +1,241 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* Java.type('org.example.Slow').stall()" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* Java.type('org.example.Slow').stall()", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* Java.type('org.example.Slow').stall()" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* Java.type('org.example.Slow').stall()", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed_slow] test succeed", + "test.traits" : "{\"category\":[\"foo\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_succeed_slow] test succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed_slow] test succeed", + "test.traits" : "{\"category\":[\"foo\",\"bar\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_succeed_slow] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.retry_reason" : "early_flake_detection", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed_slow] test succeed", + "test.traits" : "{\"category\":[\"foo\",\"bar\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_succeed_slow] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_6}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-new-test/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-new-test/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-new-test/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-new-test/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-new-test/events.ftl new file mode 100644 index 00000000000..c6f9d72364e --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-new-test/events.ftl @@ -0,0 +1,311 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_3}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed_one_case] test succeed", + "test.traits" : "{\"category\":[\"foo\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_succeed_one_case] test succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed_one_case] test succeed", + "test.traits" : "{\"category\":[\"foo\",\"bar\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_4}, + "resource" : "[org/example/test_succeed_one_case] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.retry_reason" : "early_flake_detection", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed_one_case] test succeed", + "test.traits" : "{\"category\":[\"foo\",\"bar\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_4}, + "resource" : "[org/example/test_succeed_one_case] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_6}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.retry_reason" : "early_flake_detection", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed_one_case] test succeed", + "test.traits" : "{\"category\":[\"foo\",\"bar\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_4}, + "resource" : "[org/example/test_succeed_one_case] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_3}, + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_8}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_9}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_9}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-setup/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-setup/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-setup/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-setup/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-setup/events.ftl new file mode 100644 index 00000000000..e3ad6366b05 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-setup/events.ftl @@ -0,0 +1,521 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* foo" + }, + "metrics" : { + "step.endLine" : 13, + "step.startLine" : 13 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* foo", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* foo" + }, + "metrics" : { + "step.endLine" : 13, + "step.startLine" : 13 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* foo", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* foo" + }, + "metrics" : { + "step.endLine" : 13, + "step.startLine" : 13 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "* foo", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_3}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* foo" + }, + "metrics" : { + "step.endLine" : 18, + "step.startLine" : 18 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_4}, + "resource" : "* foo", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_4}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* foo" + }, + "metrics" : { + "step.endLine" : 18, + "step.startLine" : 18 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_5}, + "resource" : "* foo", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_5}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* foo" + }, + "metrics" : { + "step.endLine" : 18, + "step.startLine" : 18 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_6}, + "resource" : "* foo", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_6}, + "start" : ${content_start_6}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_with_setup] test with setup", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_with_setup] test with setup", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.parameters" : "{\"foo\":\"bar\"}", + "test.status" : "pass", + "test.suite" : "[org/example/test_with_setup] test with setup", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_with_setup] test with setup.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_8}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_9}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.parameters" : "{\"foo\":\"bar\"}", + "test.retry_reason" : "early_flake_detection", + "test.status" : "pass", + "test.suite" : "[org/example/test_with_setup] test with setup", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_with_setup] test with setup.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_9}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_10}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.parameters" : "{\"foo\":\"bar\"}", + "test.retry_reason" : "early_flake_detection", + "test.status" : "pass", + "test.suite" : "[org/example/test_with_setup] test with setup", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_with_setup] test with setup.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_3}, + "start" : ${content_start_10}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_11}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.parameters" : "{\"foo\":\"bar\"}", + "test.status" : "pass", + "test.suite" : "[org/example/test_with_setup] test with setup", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_with_setup] test with setup.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_4}, + "start" : ${content_start_11}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_12}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.parameters" : "{\"foo\":\"bar\"}", + "test.retry_reason" : "early_flake_detection", + "test.status" : "pass", + "test.suite" : "[org/example/test_with_setup] test with setup", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_with_setup] test with setup.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_5}, + "start" : ${content_start_12}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_13}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.parameters" : "{\"foo\":\"bar\"}", + "test.retry_reason" : "early_flake_detection", + "test.status" : "pass", + "test.suite" : "[org/example/test_with_setup] test with setup", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_7}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_with_setup] test with setup.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_6}, + "start" : ${content_start_13}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_14}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.early_flake.abort_reason" : "faulty", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_8}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_14}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_15}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.early_flake.abort_reason" : "faulty", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_9} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_15}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-skip-new-test/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-skip-new-test/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-skip-new-test/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-skip-new-test/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-skip-new-test/events.ftl new file mode 100644 index 00000000000..f80d4f4ad7d --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-efd-skip-new-test/events.ftl @@ -0,0 +1,171 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed_skip_efd] test succeed", + "test.traits" : "{\"category\":[\"foo\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_succeed_skip_efd] test succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed_skip_efd] test succeed", + "test.traits" : "{\"category\":[\"foo\",\"datadog_efd_disable\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_2}, + "resource" : "[org/example/test_succeed_skip_efd] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_4}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-failed-then-succeed/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-failed-then-succeed/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-failed-then-succeed/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-failed-then-succeed/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-failed-then-succeed/events.ftl new file mode 100644 index 00000000000..250a3344bc2 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-failed-then-succeed/events.ftl @@ -0,0 +1,310 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* Java.type('org.example.Flaky').flake()" + }, + "metrics" : { + "step.endLine" : 4, + "step.startLine" : 4 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* Java.type('org.example.Flaky').flake()", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* Java.type('org.example.Flaky').flake()" + }, + "metrics" : { + "step.endLine" : 4, + "step.startLine" : 4 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* Java.type('org.example.Flaky').flake()", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* Java.type('org.example.Flaky').flake()" + }, + "metrics" : { + "step.endLine" : 4, + "step.startLine" : 4 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "* Java.type('org.example.Flaky').flake()", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_3}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_failed_then_succeed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_failed_then_succeed] test failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "io.karatelabs.js.EngineException", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "flaky scenario", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed_then_succeed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_4}, + "resource" : "[org/example/test_failed_then_succeed] test failed.flaky scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_2}, + "error.type" : "io.karatelabs.js.EngineException", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "flaky scenario", + "test.retry_reason" : "auto_test_retry", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed_then_succeed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_4}, + "resource" : "[org/example/test_failed_then_succeed] test failed.flaky scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_6}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "flaky scenario", + "test.retry_reason" : "auto_test_retry", + "test.status" : "pass", + "test.suite" : "[org/example/test_failed_then_succeed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_4}, + "resource" : "[org/example/test_failed_then_succeed] test failed.flaky scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_3}, + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_8}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_9}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_9}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-failed/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-failed/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-failed/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-failed/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-failed/events.ftl new file mode 100644 index 00000000000..d1e680f8cfb --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-failed/events.ftl @@ -0,0 +1,239 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 4, + "step.startLine" : 4 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* false" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* false", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 1, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "java.lang.AssertionError", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_failed] test failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_failed] test failed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_2}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "fail", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_failed] test failed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_6}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-itr-skipping-parameterized/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-itr-skipping-parameterized/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-itr-skipping-parameterized/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-itr-skipping-parameterized/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-itr-skipping-parameterized/events.ftl new file mode 100644 index 00000000000..a2c029a9497 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-itr-skipping-parameterized/events.ftl @@ -0,0 +1,274 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Given p = 'b'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "Given p = 'b'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Then response == value" + }, + "metrics" : { + "step.endLine" : 8, + "step.startLine" : 8 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "Then response == value", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "When response = p + p" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "When response = p + p", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_3}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.itr.tests_skipping.enabled" : "true", + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_parameterized] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_parameterized] test parameterized", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "itr_correlation_id" : "itrCorrelationId", + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "skip", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.itr.tests_skipping.enabled" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario as an outline", + "test.parameters" : "{\"param\":\"'a'\",\"value\":\"aa\"}", + "test.skip_reason" : "Skipped by Datadog Test Impact Analysis", + "test.skipped_by_itr" : "true", + "test.status" : "skip", + "test.suite" : "[org/example/test_parameterized] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_2}, + "resource" : "[org/example/test_parameterized] test parameterized.first scenario as an outline", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "itr_correlation_id" : "itrCorrelationId", + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.itr.tests_skipping.enabled" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario as an outline", + "test.parameters" : "{\"param\":\"'b'\",\"value\":\"bb\"}", + "test.status" : "pass", + "test.suite" : "[org/example/test_parameterized] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_2}, + "resource" : "[org/example/test_parameterized] test parameterized.first scenario as an outline", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_6}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.ci.itr.tests_skipped" : "true", + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.itr.tests_skipping.enabled" : "true", + "test.itr.tests_skipping.type" : "test", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.itr.tests_skipping.count" : 1 + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, + "meta" : { + "_dd.ci.itr.tests_skipped" : "true", + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.itr.tests_skipping.enabled" : "true", + "test.itr.tests_skipping.type" : "test", + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "test.itr.tests_skipping.count" : 1 + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_8}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-itr-skipping/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-itr-skipping/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-itr-skipping/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-itr-skipping/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-itr-skipping/events.ftl new file mode 100644 index 00000000000..a208d424c82 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-itr-skipping/events.ftl @@ -0,0 +1,227 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'second'" + }, + "metrics" : { + "step.endLine" : 9, + "step.startLine" : 9 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* 'second'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.itr.tests_skipping.enabled" : "true", + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.traits" : "{\"category\":[\"foo\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_succeed] test succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_2}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "itr_correlation_id" : "itrCorrelationId", + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "skip", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.itr.tests_skipping.enabled" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.skip_reason" : "Skipped by Datadog Test Impact Analysis", + "test.skipped_by_itr" : "true", + "test.status" : "skip", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.traits" : "{\"category\":[\"foo\",\"bar\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_2}, + "resource" : "[org/example/test_succeed] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "itr_correlation_id" : "itrCorrelationId", + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.itr.tests_skipping.enabled" : "true", + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.traits" : "{\"category\":[\"foo\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_2}, + "resource" : "[org/example/test_succeed] test succeed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "_dd.ci.itr.tests_skipped" : "true", + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.itr.tests_skipping.enabled" : "true", + "test.itr.tests_skipping.type" : "test", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.itr.tests_skipping.count" : 1 + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_5}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "_dd.ci.itr.tests_skipped" : "true", + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.itr.tests_skipping.enabled" : "true", + "test.itr.tests_skipping.type" : "test", + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "test.itr.tests_skipping.count" : 1 + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_6}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-itr-unskippable/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-itr-unskippable/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-itr-unskippable/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-itr-unskippable/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-itr-unskippable/events.ftl new file mode 100644 index 00000000000..45bf59aa899 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-itr-unskippable/events.ftl @@ -0,0 +1,249 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'second'" + }, + "metrics" : { + "step.endLine" : 10, + "step.startLine" : 10 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* 'second'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.itr.tests_skipping.enabled" : "true", + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_unskippable] test unskippable", + "test.traits" : "{\"category\":[\"foo\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_unskippable] test unskippable", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "itr_correlation_id" : "itrCorrelationId", + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.itr.forced_run" : "true", + "test.itr.tests_skipping.enabled" : "true", + "test.itr.unskippable" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_unskippable] test unskippable", + "test.traits" : "{\"category\":[\"foo\",\"bar\",\"datadog_itr_unskippable\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_unskippable] test unskippable.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "itr_correlation_id" : "itrCorrelationId", + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.itr.tests_skipping.enabled" : "true", + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_unskippable] test unskippable", + "test.traits" : "{\"category\":[\"foo\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_unskippable] test unskippable.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.itr.tests_skipping.enabled" : "true", + "test.itr.tests_skipping.type" : "test", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.itr.tests_skipping.count" : 0 + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_6}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.itr.tests_skipping.enabled" : "true", + "test.itr.tests_skipping.type" : "test", + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "test.itr.tests_skipping.count" : 0 + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-parameterized/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-parameterized/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-parameterized/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-parameterized/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-parameterized/events.ftl new file mode 100644 index 00000000000..a4123cde6c5 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-parameterized/events.ftl @@ -0,0 +1,331 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Given p = 'a'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "Given p = 'a'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Given p = 'b'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "Given p = 'b'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Then response == value" + }, + "metrics" : { + "step.endLine" : 8, + "step.startLine" : 8 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "Then response == value", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_3}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Then response == value" + }, + "metrics" : { + "step.endLine" : 8, + "step.startLine" : 8 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "Then response == value", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_4}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "When response = p + p" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "When response = p + p", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_5}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "When response = p + p" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "When response = p + p", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_6}, + "start" : ${content_start_6}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_parameterized] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_parameterized] test parameterized", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "first scenario as an outline", + "test.parameters" : "{\"param\":\"'a'\",\"value\":\"aa\"}", + "test.status" : "pass", + "test.suite" : "[org/example/test_parameterized] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_parameterized] test parameterized.first scenario as an outline", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_8}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_9}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "first scenario as an outline", + "test.parameters" : "{\"param\":\"'b'\",\"value\":\"bb\"}", + "test.status" : "pass", + "test.suite" : "[org/example/test_parameterized] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_parameterized] test parameterized.first scenario as an outline", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_9}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_10}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_10}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_11}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_11}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-quarantined-failed-atr/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-quarantined-failed-atr/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-quarantined-failed-atr/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-quarantined-failed-atr/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-quarantined-failed-atr/events.ftl new file mode 100644 index 00000000000..fbf1c1cb407 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-quarantined-failed-atr/events.ftl @@ -0,0 +1,533 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 4, + "step.startLine" : 4 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* false" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* false", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* false" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "* false", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_3}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* false" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_4}, + "resource" : "* false", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_4}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* false" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_5}, + "resource" : "* false", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_5}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* false" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_6}, + "resource" : "* false", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_6}, + "start" : ${content_start_6}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_failed] test failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_failed] test failed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_8}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_9}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed] test failed", + "test.test_management.is_quarantined" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_failed] test failed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_9}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_10}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_2}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.retry_reason" : "auto_test_retry", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed] test failed", + "test.test_management.is_quarantined" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_failed] test failed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_3}, + "start" : ${content_start_10}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_11}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_3}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.retry_reason" : "auto_test_retry", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed] test failed", + "test.test_management.is_quarantined" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_failed] test failed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_4}, + "start" : ${content_start_11}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_12}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_4}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.retry_reason" : "auto_test_retry", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed] test failed", + "test.test_management.is_quarantined" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_failed] test failed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_5}, + "start" : ${content_start_12}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_13}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_5}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.retry_reason" : "auto_test_retry", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed] test failed", + "test.test_management.is_quarantined" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_7}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_failed] test failed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_6}, + "start" : ${content_start_13}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_14}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.test_management.enabled" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_8}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_14}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_15}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.test_management.enabled" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_9} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_15}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-quarantined-failed-efd/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-quarantined-failed-efd/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-quarantined-failed-efd/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-quarantined-failed-efd/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-quarantined-failed-efd/events.ftl new file mode 100644 index 00000000000..2fb2cddf5e0 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-quarantined-failed-efd/events.ftl @@ -0,0 +1,533 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 4, + "step.startLine" : 4 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 4, + "step.startLine" : 4 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 4, + "step.startLine" : 4 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_3}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* false" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_4}, + "resource" : "* false", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_4}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* false" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_5}, + "resource" : "* false", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_5}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* false" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_6}, + "resource" : "* false", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_6}, + "start" : ${content_start_6}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_failed] test failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_failed] test failed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_8}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_9}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.retry_reason" : "early_flake_detection", + "test.status" : "pass", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_failed] test failed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_9}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_10}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.retry_reason" : "early_flake_detection", + "test.status" : "pass", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_failed] test failed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_3}, + "start" : ${content_start_10}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_11}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed] test failed", + "test.test_management.is_quarantined" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_failed] test failed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_4}, + "start" : ${content_start_11}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_12}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_2}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.retry_reason" : "early_flake_detection", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed] test failed", + "test.test_management.is_quarantined" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_failed] test failed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_5}, + "start" : ${content_start_12}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_13}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_3}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.retry_reason" : "early_flake_detection", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed] test failed", + "test.test_management.is_quarantined" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_7}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_failed] test failed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_6}, + "start" : ${content_start_13}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_14}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.early_flake.abort_reason" : "faulty", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.test_management.enabled" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_8}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_14}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_15}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.early_flake.abort_reason" : "faulty", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.test_management.enabled" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_9} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_15}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-quarantined-failed-known/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-quarantined-failed-known/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-quarantined-failed-known/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-quarantined-failed-known/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-quarantined-failed-known/events.ftl new file mode 100644 index 00000000000..86a10f1782f --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-quarantined-failed-known/events.ftl @@ -0,0 +1,381 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 4, + "step.startLine" : 4 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 4, + "step.startLine" : 4 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 4, + "step.startLine" : 4 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_3}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* false" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_4}, + "resource" : "* false", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_4}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_failed] test failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_5}, + "resource" : "[org/example/test_failed] test failed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_6}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.retry_reason" : "early_flake_detection", + "test.status" : "pass", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_5}, + "resource" : "[org/example/test_failed] test failed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_new" : "true", + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.retry_reason" : "early_flake_detection", + "test.status" : "pass", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_5}, + "resource" : "[org/example/test_failed] test failed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_3}, + "start" : ${content_start_8}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_9}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed] test failed", + "test.test_management.is_quarantined" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_5}, + "resource" : "[org/example/test_failed] test failed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_4}, + "start" : ${content_start_9}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_10}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.test_management.enabled" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_10}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_11}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.early_flake.enabled" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.test_management.enabled" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_7} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_11}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-quarantined-failed/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-quarantined-failed/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-quarantined-failed/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-quarantined-failed/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-quarantined-failed/events.ftl new file mode 100644 index 00000000000..cf475efcab6 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-quarantined-failed/events.ftl @@ -0,0 +1,240 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 4, + "step.startLine" : 4 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* false" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* false", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_failed] test failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_failed] test failed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed] test failed", + "test.test_management.is_quarantined" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_failed] test failed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.test_management.enabled" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_6}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.test_management.enabled" : "true", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-retry-failed/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-retry-failed/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-retry-failed/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-retry-failed/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-retry-failed/events.ftl new file mode 100644 index 00000000000..813d2d93780 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-retry-failed/events.ftl @@ -0,0 +1,528 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 4, + "step.startLine" : 4 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* false" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* false", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* false" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "* false", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_3}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* false" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_4}, + "resource" : "* false", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_4}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* false" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_5}, + "resource" : "* false", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_5}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* false" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_6}, + "resource" : "* false", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_6}, + "start" : ${content_start_6}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 1, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "java.lang.AssertionError", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_failed] test failed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_failed] test failed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_8}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_9}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_2}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_failed] test failed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_9}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_10}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_3}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.retry_reason" : "auto_test_retry", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_failed] test failed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_3}, + "start" : ${content_start_10}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_11}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_4}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.retry_reason" : "auto_test_retry", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_failed] test failed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_4}, + "start" : ${content_start_11}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_12}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_5}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.retry_reason" : "auto_test_retry", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_failed] test failed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_5}, + "start" : ${content_start_12}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_13}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_6}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "fail", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.retry_reason" : "auto_test_retry", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed] test failed", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_7}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_failed] test failed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_6}, + "start" : ${content_start_13}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_14}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_8}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_14}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_15}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_9} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_15}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-retry-parameterized/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-retry-parameterized/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-retry-parameterized/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-retry-parameterized/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-retry-parameterized/events.ftl new file mode 100644 index 00000000000..ed370dbb34b --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-retry-parameterized/events.ftl @@ -0,0 +1,822 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Given p = 'a'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "Given p = 'a'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Given p = 'a'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "Given p = 'a'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Given p = 'a'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "Given p = 'a'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_3}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Given p = 'a'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_4}, + "resource" : "Given p = 'a'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_4}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Given p = 'a'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_5}, + "resource" : "Given p = 'a'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_5}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Given p = 'b'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_6}, + "resource" : "Given p = 'b'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_6}, + "start" : ${content_start_6}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Then response == value" + }, + "metrics" : { + "step.endLine" : 8, + "step.startLine" : 8 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "Then response == value", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_7}, + "start" : ${content_start_7}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Then response == value" + }, + "metrics" : { + "step.endLine" : 8, + "step.startLine" : 8 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "Then response == value", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_8}, + "start" : ${content_start_8}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_9}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Then response == value" + }, + "metrics" : { + "step.endLine" : 8, + "step.startLine" : 8 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "Then response == value", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_9}, + "start" : ${content_start_9}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_10}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Then response == value" + }, + "metrics" : { + "step.endLine" : 8, + "step.startLine" : 8 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_4}, + "resource" : "Then response == value", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_10}, + "start" : ${content_start_10}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_11}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Then response == value" + }, + "metrics" : { + "step.endLine" : 8, + "step.startLine" : 8 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_5}, + "resource" : "Then response == value", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_11}, + "start" : ${content_start_11}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_12}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "Then response == value" + }, + "metrics" : { + "step.endLine" : 8, + "step.startLine" : 8 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_6}, + "resource" : "Then response == value", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_12}, + "start" : ${content_start_12}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_13}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "When response = p + p" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "When response = p + p", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_13}, + "start" : ${content_start_13}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_14}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "When response = p + p" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "When response = p + p", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_14}, + "start" : ${content_start_14}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_15}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "When response = p + p" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "When response = p + p", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_15}, + "start" : ${content_start_15}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_16}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "When response = p + p" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_4}, + "resource" : "When response = p + p", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_16}, + "start" : ${content_start_16}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_17}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "When response = p + p" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_5}, + "resource" : "When response = p + p", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_17}, + "start" : ${content_start_17}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_18}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "When response = p + p" + }, + "metrics" : { + "step.endLine" : 7, + "step.startLine" : 7 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_6}, + "resource" : "When response = p + p", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_18}, + "start" : ${content_start_18}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_19}, + "error" : 1, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "java.lang.AssertionError", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed_parameterized] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_failed_parameterized] test parameterized", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_19}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_20}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_2}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "first scenario as an outline", + "test.parameters" : "{\"param\":\"'a'\",\"value\":\"aaa\"}", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed_parameterized] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_failed_parameterized] test parameterized.first scenario as an outline", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_20}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_21}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_3}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario as an outline", + "test.parameters" : "{\"param\":\"'a'\",\"value\":\"aaa\"}", + "test.retry_reason" : "auto_test_retry", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed_parameterized] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_failed_parameterized] test parameterized.first scenario as an outline", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_21}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_22}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_4}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario as an outline", + "test.parameters" : "{\"param\":\"'a'\",\"value\":\"aaa\"}", + "test.retry_reason" : "auto_test_retry", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed_parameterized] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_failed_parameterized] test parameterized.first scenario as an outline", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_3}, + "start" : ${content_start_22}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_23}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_5}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario as an outline", + "test.parameters" : "{\"param\":\"'a'\",\"value\":\"aaa\"}", + "test.retry_reason" : "auto_test_retry", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed_parameterized] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_failed_parameterized] test parameterized.first scenario as an outline", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_4}, + "start" : ${content_start_23}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_24}, + "error" : 1, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_6}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "fail", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.has_failed_all_retries" : "true", + "test.is_retry" : "true", + "test.module" : "karate-2.0", + "test.name" : "first scenario as an outline", + "test.parameters" : "{\"param\":\"'a'\",\"value\":\"aaa\"}", + "test.retry_reason" : "auto_test_retry", + "test.status" : "fail", + "test.suite" : "[org/example/test_failed_parameterized] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_failed_parameterized] test parameterized.first scenario as an outline", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_5}, + "start" : ${content_start_24}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_25}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "first scenario as an outline", + "test.parameters" : "{\"param\":\"'b'\",\"value\":\"bb\"}", + "test.status" : "pass", + "test.suite" : "[org/example/test_failed_parameterized] test parameterized", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_7}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_7}, + "resource" : "[org/example/test_failed_parameterized] test parameterized.first scenario as an outline", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_6}, + "start" : ${content_start_25}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_6} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_26}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_8}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_26}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_27}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_9} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_27}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-skipped-feature/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-skipped-feature/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-skipped-feature/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-skipped-feature/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-skipped-feature/events.ftl new file mode 100644 index 00000000000..c2acf214162 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-skipped-feature/events.ftl @@ -0,0 +1,236 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'second'" + }, + "metrics" : { + "step.endLine" : 9, + "step.startLine" : 9 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* 'second'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.traits" : "{\"category\":[\"foo\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_succeed] test succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.traits" : "{\"category\":[\"foo\",\"bar\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_succeed] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.traits" : "{\"category\":[\"foo\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_succeed] test succeed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_6}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-succeed-parallel/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-succeed-parallel/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-succeed-parallel/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-succeed-parallel/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-succeed-parallel/events.ftl new file mode 100644 index 00000000000..c2acf214162 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-succeed-parallel/events.ftl @@ -0,0 +1,236 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'second'" + }, + "metrics" : { + "step.endLine" : 9, + "step.startLine" : 9 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* 'second'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.traits" : "{\"category\":[\"foo\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_succeed] test succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.traits" : "{\"category\":[\"foo\",\"bar\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_succeed] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.traits" : "{\"category\":[\"foo\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_succeed] test succeed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_6}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-succeed/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-succeed/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-succeed/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-succeed/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-succeed/events.ftl new file mode 100644 index 00000000000..c2acf214162 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-succeed/events.ftl @@ -0,0 +1,236 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'first'" + }, + "metrics" : { + "step.endLine" : 6, + "step.startLine" : 6 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* 'first'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* 'second'" + }, + "metrics" : { + "step.endLine" : 9, + "step.startLine" : 9 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* 'second'", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.traits" : "{\"category\":[\"foo\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_succeed] test succeed", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.traits" : "{\"category\":[\"foo\",\"bar\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_succeed] test succeed.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.status" : "pass", + "test.suite" : "[org/example/test_succeed] test succeed", + "test.traits" : "{\"category\":[\"foo\"]}", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_succeed] test succeed.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_6}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-with-setup/coverages.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-with-setup/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-with-setup/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-with-setup/events.ftl b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-with-setup/events.ftl new file mode 100644 index 00000000000..18854759d1c --- /dev/null +++ b/dd-java-agent/instrumentation/karate/karate-2.0/src/test/resources/test-with-setup/events.ftl @@ -0,0 +1,235 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* foo" + }, + "metrics" : { + "step.endLine" : 13, + "step.startLine" : 13 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id}, + "resource" : "* foo", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "component" : "karate", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "step.name" : "* foo" + }, + "metrics" : { + "step.endLine" : 18, + "step.startLine" : 18 + }, + "name" : "karate.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "* foo", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_suite_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.suite" : "[org/example/test_with_setup] test with setup", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count} + }, + "name" : "karate.test_suite", + "resource" : "[org/example/test_with_setup] test with setup", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "first scenario", + "test.parameters" : "{\"foo\":\"bar\"}", + "test.status" : "pass", + "test.suite" : "[org/example/test_with_setup] test with setup", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_with_setup] test with setup.first scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id}, + "start" : ${content_start_4}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test", + "test.final_status" : "pass", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.name" : "second scenario", + "test.parameters" : "{\"foo\":\"bar\"}", + "test.status" : "pass", + "test.suite" : "[org/example/test_with_setup] test with setup", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test", + "parent_id" : ${content_parent_id_3}, + "resource" : "[org/example/test_with_setup] test with setup.second scenario", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_5}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.profiling.ctx" : "test", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "runtime-id" : ${content_meta_runtime_id}, + "span.kind" : "test_session_end", + "test.command" : "karate-2.0", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "karate.test_session", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_6}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "component" : "karate", + "dummy_ci_tag" : "dummy_ci_tag_value", + "env" : "none", + "library_version" : ${content_meta_library_version}, + "span.kind" : "test_module_end", + "test.framework" : "karate", + "test.framework_version" : ${content_meta_test_framework_version}, + "test.module" : "karate-2.0", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "session-name" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5} + }, + "name" : "karate.test_module", + "resource" : "karate-2.0", + "service" : "worker.org.gradle.process.internal.worker.gradleworkermain", + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-java-agent/instrumentation/kotlin-coroutines-1.3/gradle.lockfile b/dd-java-agent/instrumentation/kotlin-coroutines-1.3/gradle.lockfile index 1581030cc5a..1ed65406063 100644 --- a/dd-java-agent/instrumentation/kotlin-coroutines-1.3/gradle.lockfile +++ b/dd-java-agent/instrumentation/kotlin-coroutines-1.3/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:kotlin-coroutines-1.3:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestIm com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,compileOnlyDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,compileOnlyDependenciesMetadata,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,compileOnlyDependenciesMetadata,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestCompileOnlyDependenciesMetadata,testAnnotationProcessor,testCompileClasspath,testCompileOnlyDependenciesMetadata @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,compi com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestImplemen commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,compileOnlyDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -82,32 +86,32 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestImplementat org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-build-common:2.0.21=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-build-tools-api:2.0.21=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-build-tools-impl:2.0.21=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-compiler-embeddable:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-compiler-runner:2.0.21=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-daemon-client:2.0.21=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-daemon-embeddable:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:2.0.21=kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-native-prebuilt:2.0.21=kotlinNativeBundleConfiguration +org.jetbrains.kotlin:kotlin-build-tools-api:2.1.20=kotlinBuildToolsApiClasspath +org.jetbrains.kotlin:kotlin-build-tools-impl:2.1.20=kotlinBuildToolsApiClasspath +org.jetbrains.kotlin:kotlin-compiler-embeddable:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath +org.jetbrains.kotlin:kotlin-compiler-runner:2.1.20=kotlinBuildToolsApiClasspath +org.jetbrains.kotlin:kotlin-daemon-client:2.1.20=kotlinBuildToolsApiClasspath +org.jetbrains.kotlin:kotlin-daemon-embeddable:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath +org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:2.1.20=kotlinKlibCommonizerClasspath org.jetbrains.kotlin:kotlin-reflect:1.6.10=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-script-runtime:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-scripting-common:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures -org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures -org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures -org.jetbrains.kotlin:kotlin-scripting-jvm:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures +org.jetbrains.kotlin:kotlin-script-runtime:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures,kotlinKlibCommonizerClasspath +org.jetbrains.kotlin:kotlin-scripting-common:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures +org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures +org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures +org.jetbrains.kotlin:kotlin-scripting-jvm:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21=compileClasspath,compileOnlyDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath org.jetbrains.kotlin:kotlin-stdlib:1.6.21=compileClasspath,compileOnlyDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures,kotlinKlibCommonizerClasspath +org.jetbrains.kotlin:kotlin-stdlib:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures,kotlinKlibCommonizerClasspath org.jetbrains.kotlinx:atomicfu:0.17.3=latestDepTestImplementationDependenciesMetadata org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.6.4=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath -org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath +org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath +org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.8.0=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.0=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath org.jetbrains:annotations:13.0=compileClasspath,compileOnlyDependenciesMetadata,kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinCompilerPluginClasspathTestFixtures,kotlinKlibCommonizerClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath @@ -125,14 +129,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestImplement org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesCompileOnlyDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesApiDependenciesMetadata,testFixturesCompileClasspath,testFixturesImplementationDependenciesMetadata,testFixturesRuntimeClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/kotlin-coroutines-1.3/src/latestDepTest/groovy/KotlinCoroutineInstrumentationTest.groovy b/dd-java-agent/instrumentation/kotlin-coroutines-1.3/src/latestDepTest/groovy/KotlinCoroutineInstrumentationTest.groovy index 23f5c86bf70..04cc6b46e93 100644 --- a/dd-java-agent/instrumentation/kotlin-coroutines-1.3/src/latestDepTest/groovy/KotlinCoroutineInstrumentationTest.groovy +++ b/dd-java-agent/instrumentation/kotlin-coroutines-1.3/src/latestDepTest/groovy/KotlinCoroutineInstrumentationTest.groovy @@ -19,8 +19,8 @@ class KotlinCoroutineInstrumentationTest extends AbstractKotlinCoroutineInstrume expect: trace.size() == expectedNumberOfSpans trace[0].resourceName.toString() == "KotlinCoroutineTests.tracedAcrossFlows" - findSpan(trace, "produce_2").context().getParentId() == trace[0].context().getSpanId() - findSpan(trace, "consume_2").context().getParentId() == trace[0].context().getSpanId() + findSpan(trace, "produce_2").spanContext().getParentId() == trace[0].spanContext().getSpanId() + findSpan(trace, "consume_2").spanContext().getParentId() == trace[0].spanContext().getSpanId() where: [dispatcherName, dispatcher] << dispatchersToTest @@ -36,8 +36,8 @@ class KotlinCoroutineInstrumentationTest extends AbstractKotlinCoroutineInstrume expect: trace.size() == expectedNumberOfSpans trace[0].resourceName.toString() == "KotlinCoroutineTests.tracedAcrossFlows" - findSpan(trace, "produce_2").context().getParentId() == trace[0].context().getSpanId() - findSpan(trace, "consume_2").context().getParentId() == trace[0].context().getSpanId() + findSpan(trace, "produce_2").spanContext().getParentId() == trace[0].spanContext().getSpanId() + findSpan(trace, "consume_2").spanContext().getParentId() == trace[0].spanContext().getSpanId() where: [dispatcherName, dispatcher] << dispatchersToTest diff --git a/dd-java-agent/instrumentation/kotlin-coroutines-1.3/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/DatadogThreadContextElement.java b/dd-java-agent/instrumentation/kotlin-coroutines-1.3/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/DatadogThreadContextElement.java index aae9d7b95f1..eba6917dce7 100644 --- a/dd-java-agent/instrumentation/kotlin-coroutines-1.3/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/DatadogThreadContextElement.java +++ b/dd-java-agent/instrumentation/kotlin-coroutines-1.3/src/main/java/datadog/trace/instrumentation/kotlin/coroutines/DatadogThreadContextElement.java @@ -1,7 +1,7 @@ package datadog.trace.instrumentation.kotlin.coroutines; import datadog.context.Context; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextContinuation; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; import javax.annotation.Nonnull; import javax.annotation.Nullable; @@ -23,7 +23,7 @@ public static CoroutineContext addDatadogElement(CoroutineContext coroutineConte } private Context context; - private AgentScope.Continuation continuation; + private ContextContinuation continuation; @Nonnull @Override @@ -45,7 +45,7 @@ public static void cancelDatadogContext(@Nonnull AbstractCoroutine coroutine) DatadogThreadContextElement datadog = coroutine.getContext().get(DATADOG_KEY); if (datadog != null && datadog.continuation != null) { // release enclosing trace now the coroutine has completed - datadog.continuation.cancel(); + datadog.continuation.release(); } } diff --git a/dd-java-agent/instrumentation/kotlin-coroutines-1.3/src/test/groovy/KotlinCoroutineInstrumentationTest.groovy b/dd-java-agent/instrumentation/kotlin-coroutines-1.3/src/test/groovy/KotlinCoroutineInstrumentationTest.groovy index d905b9d87f8..096cf1b7ca1 100644 --- a/dd-java-agent/instrumentation/kotlin-coroutines-1.3/src/test/groovy/KotlinCoroutineInstrumentationTest.groovy +++ b/dd-java-agent/instrumentation/kotlin-coroutines-1.3/src/test/groovy/KotlinCoroutineInstrumentationTest.groovy @@ -22,8 +22,8 @@ class KotlinCoroutineInstrumentationTest extends AbstractKotlinCoroutineInstrume expect: trace.size() == expectedNumberOfSpans trace[0].resourceName.toString() == "KotlinCoroutineTests.tracedAcrossChannels" - findSpan(trace, "produce_2").context().getParentId() == trace[0].context().getSpanId() - findSpan(trace, "consume_2").context().getParentId() == trace[0].context().getSpanId() + findSpan(trace, "produce_2").spanContext().getParentId() == trace[0].spanContext().getSpanId() + findSpan(trace, "consume_2").spanContext().getParentId() == trace[0].spanContext().getSpanId() where: [dispatcherName, dispatcher] << dispatchersToTest diff --git a/dd-java-agent/instrumentation/kotlin-coroutines-1.3/src/testFixtures/groovy/datadog/trace/instrumentation/kotlin/coroutines/AbstractKotlinCoroutineInstrumentationTest.groovy b/dd-java-agent/instrumentation/kotlin-coroutines-1.3/src/testFixtures/groovy/datadog/trace/instrumentation/kotlin/coroutines/AbstractKotlinCoroutineInstrumentationTest.groovy index a8d62eafa6b..4298933db84 100644 --- a/dd-java-agent/instrumentation/kotlin-coroutines-1.3/src/testFixtures/groovy/datadog/trace/instrumentation/kotlin/coroutines/AbstractKotlinCoroutineInstrumentationTest.groovy +++ b/dd-java-agent/instrumentation/kotlin-coroutines-1.3/src/testFixtures/groovy/datadog/trace/instrumentation/kotlin/coroutines/AbstractKotlinCoroutineInstrumentationTest.groovy @@ -30,7 +30,7 @@ abstract class AbstractKotlinCoroutineInstrumentationTest { if (ex instanceof CancellationException) { @@ -65,12 +68,13 @@ public static void afterCommand( span.finish(); return null; }); + scope.close(); } else { // No response is expected, so we must finish the span now. DECORATE.beforeFinish(span); + scope.close(); span.finish(); } - scope.close(); // span may be finished by handleAsync call above. } diff --git a/dd-java-agent/instrumentation/lettuce/lettuce-4.0/src/main/java/datadog/trace/instrumentation/lettuce4/LettuceClientDecorator.java b/dd-java-agent/instrumentation/lettuce/lettuce-4.0/src/main/java/datadog/trace/instrumentation/lettuce4/LettuceClientDecorator.java index 31b8c2e67e2..f05371cdab8 100644 --- a/dd-java-agent/instrumentation/lettuce/lettuce-4.0/src/main/java/datadog/trace/instrumentation/lettuce4/LettuceClientDecorator.java +++ b/dd-java-agent/instrumentation/lettuce/lettuce-4.0/src/main/java/datadog/trace/instrumentation/lettuce4/LettuceClientDecorator.java @@ -61,18 +61,17 @@ protected String dbHostname(RedisURI redisURI) { } @Override - public AgentSpan onConnection(final AgentSpan span, final RedisURI connection) { + public void onConnection(final AgentSpan span, final RedisURI connection) { if (connection != null) { setPeerPort(span, connection.getPort()); span.setTag("db.redis.dbIndex", connection.getDatabase()); } - return super.onConnection(span, connection); + super.onConnection(span, connection); } - public AgentSpan onCommand(final AgentSpan span, final RedisCommand command) { + public void onCommand(final AgentSpan span, final RedisCommand command) { span.setResourceName( null == command ? "Redis Command" : getCommandResourceName(command.getType())); - return span; } public String resourceNameForConnection(final RedisURI redisURI) { diff --git a/dd-java-agent/instrumentation/lettuce/lettuce-5.0/build.gradle b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/build.gradle index becb0a29ad7..9f5a2579038 100644 --- a/dd-java-agent/instrumentation/lettuce/lettuce-5.0/build.gradle +++ b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/build.gradle @@ -12,6 +12,10 @@ apply from: "$rootDir/gradle/java.gradle" addTestSuiteForDir('latestDepTest', 'test') addTestSuiteExtendingForDir('latestDepForkedTest', 'latestDepTest', 'test') +addTestSuiteForDir('lettuce51Test', 'test') +addTestSuiteForDir('lettuce60Test', 'test') +addTestSuiteForDir('lettuce61Test', 'test') +addTestSuiteForDir('lettuce62Test', 'test') dependencies { compileOnly group: 'io.lettuce', name: 'lettuce-core', version: '5.0.0.RELEASE' @@ -24,6 +28,10 @@ dependencies { latestDepTestImplementation group: 'io.lettuce', name: 'lettuce-core', version: '+' + lettuce51TestImplementation group: 'io.lettuce', name: 'lettuce-core', version: '5.1.0.RELEASE' + lettuce60TestImplementation group: 'io.lettuce', name: 'lettuce-core', version: '6.0.0.RELEASE' + lettuce61TestImplementation group: 'io.lettuce', name: 'lettuce-core', version: '6.1.0.RELEASE' + lettuce62TestImplementation group: 'io.lettuce', name: 'lettuce-core', version: '6.2.0.RELEASE' tasks.withType(Test).configureEach { usesService(testcontainersLimit) diff --git a/dd-java-agent/instrumentation/lettuce/lettuce-5.0/gradle.lockfile b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/gradle.lockfile index a20f940f8bf..d45057d043f 100644 --- a/dd-java-agent/instrumentation/lettuce/lettuce-5.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/gradle.lockfile @@ -1,163 +1,203 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. -cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.10.3=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath,testCompileClasspath -com.fasterxml.jackson.core:jackson-annotations:2.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.13.2.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.13.2.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.docker-java:docker-java-api:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.docker-java:docker-java-transport:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:lettuce:lettuce-5.0:dependencies --write-locks +cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +com.fasterxml.jackson.core:jackson-annotations:2.10.3=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath,lettuce51TestCompileClasspath,lettuce60TestCompileClasspath,lettuce61TestCompileClasspath,lettuce62TestCompileClasspath,testCompileClasspath +com.fasterxml.jackson.core:jackson-annotations:2.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +com.fasterxml.jackson.core:jackson-core:2.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +com.fasterxml.jackson.core:jackson-databind:2.13.2.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +com.fasterxml.jackson:jackson-bom:2.13.2.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +com.github.docker-java:docker-java-api:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.docker-java:docker-java-transport:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs -com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath -com.google.auto.service:auto-service:1.1.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.auto:auto-common:1.2.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,lettuce51TestAnnotationProcessor,lettuce51TestCompileClasspath,lettuce60TestAnnotationProcessor,lettuce60TestCompileClasspath,lettuce61TestAnnotationProcessor,lettuce61TestCompileClasspath,lettuce62TestAnnotationProcessor,lettuce62TestCompileClasspath,testAnnotationProcessor,testCompileClasspath +com.google.auto.service:auto-service:1.1.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,lettuce51TestAnnotationProcessor,lettuce60TestAnnotationProcessor,lettuce61TestAnnotationProcessor,lettuce62TestAnnotationProcessor,testAnnotationProcessor +com.google.auto:auto-common:1.2.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,lettuce51TestAnnotationProcessor,lettuce60TestAnnotationProcessor,lettuce61TestAnnotationProcessor,lettuce62TestAnnotationProcessor,testAnnotationProcessor +com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestAnnotationProcessor,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestAnnotationProcessor,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestAnnotationProcessor,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestAnnotationProcessor,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs -com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,lettuce51TestAnnotationProcessor,lettuce60TestAnnotationProcessor,lettuce61TestAnnotationProcessor,lettuce62TestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.redis.testcontainers:testcontainers-redis:1.6.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.redis:redis-enterprise-admin:0.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.squareup.okio:okio:1.17.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,lettuce51TestAnnotationProcessor,lettuce60TestAnnotationProcessor,lettuce61TestAnnotationProcessor,lettuce62TestAnnotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,lettuce51TestAnnotationProcessor,lettuce60TestAnnotationProcessor,lettuce61TestAnnotationProcessor,lettuce62TestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestAnnotationProcessor,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestAnnotationProcessor,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestAnnotationProcessor,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestAnnotationProcessor,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,lettuce51TestAnnotationProcessor,lettuce60TestAnnotationProcessor,lettuce61TestAnnotationProcessor,lettuce62TestAnnotationProcessor,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +com.redis.testcontainers:testcontainers-redis:1.6.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.redis:redis-enterprise-admin:0.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.okio:okio:1.17.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc -commons-codec:commons-codec:1.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -commons-fileupload:commons-fileupload:1.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +commons-codec:commons-codec:1.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +commons-fileupload:commons-fileupload:1.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs -de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath io.lettuce:lettuce-core:5.0.0.RELEASE=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.lettuce:lettuce-core:7.5.1.RELEASE=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.lettuce:lettuce-core:5.1.0.RELEASE=lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath +io.lettuce:lettuce-core:6.0.0.RELEASE=lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath +io.lettuce:lettuce-core:6.1.0.RELEASE=lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath +io.lettuce:lettuce-core:6.2.0.RELEASE=lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath +io.lettuce:lettuce-core:7.6.0.RELEASE=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-buffer:4.1.15.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-buffer:4.2.5.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-base:4.2.5.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-dns:4.2.5.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-buffer:4.1.29.Final=lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath +io.netty:netty-buffer:4.1.52.Final=lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath +io.netty:netty-buffer:4.1.60.Final=lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath +io.netty:netty-buffer:4.1.79.Final=lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath +io.netty:netty-buffer:4.2.13.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-base:4.2.13.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-dns:4.2.13.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec:4.1.15.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-codec:4.1.29.Final=lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath +io.netty:netty-codec:4.1.52.Final=lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath +io.netty:netty-codec:4.1.60.Final=lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath +io.netty:netty-codec:4.1.79.Final=lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath io.netty:netty-common:4.1.15.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-common:4.2.5.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-common:4.1.29.Final=lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath +io.netty:netty-common:4.1.52.Final=lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath +io.netty:netty-common:4.1.60.Final=lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath +io.netty:netty-common:4.1.79.Final=lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath +io.netty:netty-common:4.2.13.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-handler:4.1.15.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-handler:4.2.5.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-resolver-dns:4.2.5.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler:4.1.29.Final=lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath +io.netty:netty-handler:4.1.52.Final=lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath +io.netty:netty-handler:4.1.60.Final=lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath +io.netty:netty-handler:4.1.79.Final=lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath +io.netty:netty-handler:4.2.13.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver-dns:4.2.13.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-resolver:4.1.15.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-resolver:4.2.5.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-transport-native-unix-common:4.2.5.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver:4.1.29.Final=lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath +io.netty:netty-resolver:4.1.52.Final=lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath +io.netty:netty-resolver:4.1.60.Final=lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath +io.netty:netty-resolver:4.1.79.Final=lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath +io.netty:netty-resolver:4.2.13.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.1.79.Final=lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.2.13.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.15.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-transport:4.2.5.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport:4.1.29.Final=lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath +io.netty:netty-transport:4.1.52.Final=lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath +io.netty:netty-transport:4.1.60.Final=lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath +io.netty:netty-transport:4.1.79.Final=lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath +io.netty:netty-transport:4.2.13.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.projectreactor:reactor-core:3.1.0.RELEASE=compileClasspath,testCompileClasspath,testRuntimeClasspath +io.projectreactor:reactor-core:3.2.0.RELEASE=lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath +io.projectreactor:reactor-core:3.3.10.RELEASE=lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath +io.projectreactor:reactor-core:3.3.15.RELEASE=lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath +io.projectreactor:reactor-core:3.4.21=lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath io.projectreactor:reactor-core:3.6.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -junit:junit:4.13.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.13.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +junit:junit:4.13.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +net.java.dev.jna:jna:5.13.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc org.apache.bcel:bcel:6.11.0=spotbugs -org.apache.commons:commons-compress:1.24.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.apache.commons:commons-compress:1.24.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.apache.commons:commons-lang3:3.19.0=spotbugs org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.httpcomponents.client5:httpclient5:5.1.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.apache.httpcomponents.core5:httpcore5-h2:5.1.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.apache.httpcomponents.core5:httpcore5:5.1.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.apache.httpcomponents.client5:httpclient5:5.1.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +org.apache.httpcomponents.core5:httpcore5-h2:5.1.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +org.apache.httpcomponents.core5:httpcore5:5.1.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs -org.apiguardian:apiguardian-api:1.1.2=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath,testCompileClasspath -org.awaitility:awaitility:4.2.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.checkerframework:checker-qual:3.33.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +org.apiguardian:apiguardian-api:1.1.2=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath,lettuce51TestCompileClasspath,lettuce60TestCompileClasspath,lettuce61TestCompileClasspath,lettuce62TestCompileClasspath,testCompileClasspath +org.awaitility:awaitility:4.2.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +org.checkerframework:checker-qual:3.33.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,lettuce51TestAnnotationProcessor,lettuce60TestAnnotationProcessor,lettuce61TestAnnotationProcessor,lettuce62TestAnnotationProcessor,testAnnotationProcessor org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc org.codehaus.groovy:groovy-json:3.0.23=codenarc -org.codehaus.groovy:groovy-json:3.0.25=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-json:3.0.25=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codehaus.groovy:groovy-templates:3.0.23=codenarc org.codehaus.groovy:groovy-xml:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.23=codenarc -org.codehaus.groovy:groovy:3.0.25=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy:3.0.25=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc -org.hamcrest:hamcrest-core:1.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jetbrains:annotations:17.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-commons:1.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-engine:1.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-launcher:1.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-runner:1.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-api:1.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-commons:1.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.hamcrest:hamcrest-core:1.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +org.jetbrains:annotations:17.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-runner:1.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-api:1.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-commons:1.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs -org.junit:junit-bom:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.mockito:mockito-core:4.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit:junit-bom:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-core:4.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath +org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.reactivestreams:reactive-streams:1.0.4=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.rnorth.duct-tape:duct-tape:1.0.8=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.reactivestreams:reactive-streams:1.0.2=lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath +org.reactivestreams:reactive-streams:1.0.3=lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath +org.reactivestreams:reactive-streams:1.0.4=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath +org.rnorth.duct-tape:duct-tape:1.0.8=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath -org.slf4j:slf4j-api:1.7.36=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.36=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j -org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath -org.spockframework:spock-bom:2.4-groovy-3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.spockframework:spock-core:2.4-groovy-3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-junit:1.2.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-parser:1.2.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.testcontainers:testcontainers:1.21.4=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,lettuce51TestRuntimeClasspath,lettuce60TestRuntimeClasspath,lettuce61TestRuntimeClasspath,lettuce62TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +org.spockframework:spock-bom:2.4-groovy-3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.spockframework:spock-core:2.4-groovy-3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-junit:1.2.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-parser:1.2.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.testcontainers:testcontainers:1.21.4=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,lettuce51TestCompileClasspath,lettuce51TestRuntimeClasspath,lettuce60TestCompileClasspath,lettuce60TestRuntimeClasspath,lettuce61TestCompileClasspath,lettuce61TestRuntimeClasspath,lettuce62TestCompileClasspath,lettuce62TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs redis.clients.authentication:redis-authx-core:0.1.1-beta2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath empty=spotbugsPlugins diff --git a/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/AsyncCommandInstrumentation.java b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/AsyncCommandInstrumentation.java index 3e69c09ddcf..c427ac15a14 100644 --- a/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/AsyncCommandInstrumentation.java +++ b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/AsyncCommandInstrumentation.java @@ -11,10 +11,10 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArguments; import com.google.auto.service.AutoService; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.java.concurrent.AdviceUtils; import datadog.trace.bootstrap.instrumentation.java.concurrent.State; import io.lettuce.core.protocol.AsyncCommand; @@ -72,13 +72,13 @@ public static void after(@Advice.This AsyncCommand asyncCommand) { public static final class Activate { @SuppressWarnings("rawtypes") @Advice.OnMethodEnter - public static AgentScope before(@Advice.This AsyncCommand asyncCommand) { + public static ContextScope before(@Advice.This AsyncCommand asyncCommand) { return startTaskScope( InstrumentationContext.get(AsyncCommand.class, State.class), asyncCommand); } @Advice.OnMethodExit(onThrowable = Throwable.class) - public static void after(@Advice.Enter AgentScope scope) { + public static void after(@Advice.Enter ContextScope scope) { endTaskScope(scope); } } diff --git a/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/CommandHandlerInstrumentation.java b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/CommandHandlerInstrumentation.java index 3ced2c53bd9..177c6d8f595 100644 --- a/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/CommandHandlerInstrumentation.java +++ b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/CommandHandlerInstrumentation.java @@ -7,10 +7,10 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArgument; import com.google.auto.service.AutoService; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.java.concurrent.State; import io.lettuce.core.protocol.AsyncCommand; import io.lettuce.core.protocol.RedisCommand; @@ -54,7 +54,7 @@ public void methodAdvice(MethodTransformer transformer) { public static class Decode { @SuppressWarnings("rawtypes") @Advice.OnMethodEnter - public static AgentScope before(@Advice.Argument(2) RedisCommand command) { + public static ContextScope before(@Advice.Argument(2) RedisCommand command) { // if it's something we're tracing, it will always be an AsyncCommand if (command instanceof AsyncCommand) { return startTaskScope( @@ -63,8 +63,8 @@ public static AgentScope before(@Advice.Argument(2) RedisCommand command) { return null; } - @Advice.OnMethodExit - public static void after(@Advice.Enter AgentScope scope) { + @Advice.OnMethodExit(onThrowable = Throwable.class) + public static void after(@Advice.Enter ContextScope scope) { endTaskScope(scope); } } diff --git a/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/LettuceClientDecorator.java b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/LettuceClientDecorator.java index a8442a1f320..e6a03dbc242 100644 --- a/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/LettuceClientDecorator.java +++ b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/LettuceClientDecorator.java @@ -57,19 +57,18 @@ protected String dbHostname(RedisURI redisURI) { } @Override - public AgentSpan onConnection(final AgentSpan span, final RedisURI connection) { + public void onConnection(final AgentSpan span, final RedisURI connection) { if (connection != null) { setPeerPort(span, connection.getPort()); span.setTag("db.redis.dbIndex", connection.getDatabase()); } - return super.onConnection(span, connection); + super.onConnection(span, connection); } - public AgentSpan onCommand(final AgentSpan span, final RedisCommand command) { + public void onCommand(final AgentSpan span, final RedisCommand command) { final String commandName = LettuceInstrumentationUtil.getCommandName(command); span.setResourceName(LettuceInstrumentationUtil.getCommandResourceName(commandName)); - return span; } public String resourceNameForConnection(final RedisURI redisURI) { diff --git a/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/MasterReplicaConnectionHelper.java b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/MasterReplicaConnectionHelper.java new file mode 100644 index 00000000000..39261f49eb1 --- /dev/null +++ b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/MasterReplicaConnectionHelper.java @@ -0,0 +1,38 @@ +package datadog.trace.instrumentation.lettuce5; + +import static datadog.trace.instrumentation.lettuce5.LettuceClientDecorator.DECORATE; + +import datadog.trace.bootstrap.ContextStore; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.api.Tags; +import io.lettuce.core.RedisURI; +import io.lettuce.core.api.StatefulConnection; +import java.util.function.BiConsumer; + +public final class MasterReplicaConnectionHelper { + + private MasterReplicaConnectionHelper() {} + + public static boolean isRedisClientSpan(final AgentSpan span) { + return span != null && LettuceClientDecorator.REDIS_CLIENT.equals(span.getTag(Tags.COMPONENT)); + } + + public static void onConnection( + final AgentSpan span, + final StatefulConnection connection, + final ContextStore contextStore) { + if (connection == null) { + return; + } + + final RedisURI redisURI = contextStore.get(connection); + if (redisURI != null) { + DECORATE.onConnection(span, redisURI); + } + } + + public static BiConsumer onConnectionComplete( + final AgentSpan span, final ContextStore contextStore) { + return (connection, _throwable) -> onConnection(span, connection, contextStore); + } +} diff --git a/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/MasterReplicaConnectionProviderInstrumentation.java b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/MasterReplicaConnectionProviderInstrumentation.java new file mode 100644 index 00000000000..e0f93f7bc20 --- /dev/null +++ b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/MasterReplicaConnectionProviderInstrumentation.java @@ -0,0 +1,113 @@ +package datadog.trace.instrumentation.lettuce5; + +import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; +import static net.bytebuddy.matcher.ElementMatchers.isMethod; +import static net.bytebuddy.matcher.ElementMatchers.isPublic; +import static net.bytebuddy.matcher.ElementMatchers.returns; +import static net.bytebuddy.matcher.ElementMatchers.takesArguments; + +import com.google.auto.service.AutoService; +import datadog.trace.agent.tooling.Instrumenter; +import datadog.trace.agent.tooling.InstrumenterModule; +import datadog.trace.bootstrap.InstrumentationContext; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import io.lettuce.core.RedisURI; +import io.lettuce.core.api.StatefulConnection; +import io.lettuce.core.api.StatefulRedisConnection; +import java.util.Collections; +import java.util.Map; +import java.util.concurrent.CompletableFuture; +import net.bytebuddy.asm.Advice; + +/** + * Master/replica APIs expose a routing connection ({@code + * StatefulRedisMasterReplicaConnectionImpl}; legacy {@code MasterSlave} wraps it in {@code + * MasterSlaveConnectionWrapper}). The real node connection is selected only after a command span + * has started and the command is dispatched, so this decorates the active span with the RedisURI + * that is available on the real connection, not the wrapper. + */ +@AutoService(InstrumenterModule.class) +public class MasterReplicaConnectionProviderInstrumentation extends InstrumenterModule.Tracing + implements Instrumenter.ForKnownTypes, Instrumenter.HasMethodAdvice { + + public MasterReplicaConnectionProviderInstrumentation() { + super("lettuce", "lettuce-5"); + } + + @Override + public String[] knownMatchingTypes() { + return new String[] { + // Legacy Lettuce 5.x + "io.lettuce.core.masterslave.MasterSlaveConnectionProvider", + // Transitional Lettuce 6.0 provider + "io.lettuce.core.masterreplica.UpstreamReplicaConnectionProvider", + // Lettuce 6.1+ + "io.lettuce.core.masterreplica.MasterReplicaConnectionProvider" + }; + } + + @Override + public Map contextStore() { + return Collections.singletonMap( + "io.lettuce.core.api.StatefulConnection", "io.lettuce.core.RedisURI"); + } + + @Override + public String[] helperClassNames() { + return new String[] { + packageName + ".LettuceClientDecorator", + packageName + ".MasterReplicaConnectionHelper", + packageName + ".LettuceInstrumentationUtil" + }; + } + + @Override + public void methodAdvice(MethodTransformer transformer) { + // Intent argument types move across Lettuce versions, but only the returned connection is used. + transformer.applyAdvice( + isMethod() + .and(isPublic()) + .and(named("getConnection")) + .and(takesArguments(1)) + .and(returns(named("io.lettuce.core.api.StatefulRedisConnection"))), + MasterReplicaConnectionProviderInstrumentation.class.getName() + "$SyncAdvice"); + transformer.applyAdvice( + isMethod() + .and(isPublic()) + .and(named("getConnectionAsync")) + .and(takesArguments(1)) + .and(returns(named("java.util.concurrent.CompletableFuture"))), + MasterReplicaConnectionProviderInstrumentation.class.getName() + "$AsyncAdvice"); + } + + public static class SyncAdvice { + + @Advice.OnMethodExit(suppress = Throwable.class) + public static void onExit(@Advice.Return final StatefulRedisConnection connection) { + final AgentSpan span = activeSpan(); + if (!MasterReplicaConnectionHelper.isRedisClientSpan(span)) { + return; + } + + MasterReplicaConnectionHelper.onConnection( + span, connection, InstrumentationContext.get(StatefulConnection.class, RedisURI.class)); + } + } + + public static class AsyncAdvice { + + @Advice.OnMethodExit(suppress = Throwable.class) + public static void onExit( + @Advice.Return final CompletableFuture connectionFuture) { + final AgentSpan span = activeSpan(); + if (!MasterReplicaConnectionHelper.isRedisClientSpan(span) || connectionFuture == null) { + return; + } + + connectionFuture.whenComplete( + MasterReplicaConnectionHelper.onConnectionComplete( + span, InstrumentationContext.get(StatefulConnection.class, RedisURI.class))); + } + } +} diff --git a/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/rx/RedisSubscriptionCommandCompleteAdvice.java b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/rx/RedisSubscriptionCommandCompleteAdvice.java index 5b8db94421c..ea04ed01cbf 100644 --- a/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/rx/RedisSubscriptionCommandCompleteAdvice.java +++ b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/rx/RedisSubscriptionCommandCompleteAdvice.java @@ -12,7 +12,7 @@ public class RedisSubscriptionCommandCompleteAdvice { - @Advice.OnMethodExit(suppress = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void afterComplete( @Advice.Origin("#m") String method, @Advice.This RedisCommand command, diff --git a/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/rx/RedisSubscriptionCommandErrorAdvice.java b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/rx/RedisSubscriptionCommandErrorAdvice.java index ebae9eb7e61..0977eb92f5f 100644 --- a/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/rx/RedisSubscriptionCommandErrorAdvice.java +++ b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/rx/RedisSubscriptionCommandErrorAdvice.java @@ -9,7 +9,7 @@ import net.bytebuddy.asm.Advice; public class RedisSubscriptionCommandErrorAdvice { - @Advice.OnMethodExit(suppress = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void afterError( @Advice.This RedisCommand command, @Advice.Argument(value = 0) Throwable throwable) { diff --git a/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/rx/RedisSubscriptionCommandOnCompleteAdvice.java b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/rx/RedisSubscriptionCommandOnCompleteAdvice.java index 2db7dc34a48..ca0951bc1ca 100644 --- a/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/rx/RedisSubscriptionCommandOnCompleteAdvice.java +++ b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/rx/RedisSubscriptionCommandOnCompleteAdvice.java @@ -13,7 +13,7 @@ /** Instrumentation for SubscriptionCommand in version 5.3.6 and later */ public class RedisSubscriptionCommandOnCompleteAdvice { - @Advice.OnMethodExit(suppress = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void afterComplete( @Advice.This RedisCommand command, @Advice.FieldValue("subscription") Subscription subscription) { diff --git a/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/rx/RedisSubscriptionSubscribeAdvice.java b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/rx/RedisSubscriptionSubscribeAdvice.java index 32333a81cd2..d10800f5d94 100644 --- a/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/rx/RedisSubscriptionSubscribeAdvice.java +++ b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/main/java/datadog/trace/instrumentation/lettuce5/rx/RedisSubscriptionSubscribeAdvice.java @@ -59,12 +59,14 @@ public static State beforeSubscribe( return new State(parentScope, span); } - @Advice.OnMethodExit(suppress = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void afterSubscribe( @Advice.FieldValue("command") RedisCommand command, @Advice.FieldValue("subscriptionCommand") RedisCommand subscriptionCommand, - @Advice.Enter State state) { - if (!expectsResponse(command)) { + @Advice.Enter State state, + @Advice.Thrown Throwable throwable) { + if (throwable != null || !expectsResponse(command)) { + DECORATE.onError(state.span, throwable); DECORATE.beforeFinish(state.span); state.span.finish(); InstrumentationContext.get(RedisCommand.class, AgentSpan.class) diff --git a/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/test/groovy/Lettuce5ClientTestBase.groovy b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/test/groovy/Lettuce5ClientTestBase.groovy index b38c142cede..9749dbdfb0f 100644 --- a/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/test/groovy/Lettuce5ClientTestBase.groovy +++ b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/test/groovy/Lettuce5ClientTestBase.groovy @@ -42,13 +42,6 @@ abstract class Lettuce5ClientTestBase extends VersionedNamingTestBase { RedisAsyncCommands asyncCommands RedisCommands syncCommands - @Override - boolean useStrictTraceWrites() { - // latest seems leaking continuations that terminates later hence the strict trace will discard our spans. - !isLatestDepTest - } - - def setup() { redisServer.start() println "Using redis: $redisServer.redisURI" diff --git a/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/test/java/Lettuce5MasterReplicaTest.java b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/test/java/Lettuce5MasterReplicaTest.java new file mode 100644 index 00000000000..40d8564e34c --- /dev/null +++ b/dd-java-agent/instrumentation/lettuce/lettuce-5.0/src/test/java/Lettuce5MasterReplicaTest.java @@ -0,0 +1,123 @@ +import static java.util.Collections.singletonList; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import com.redis.testcontainers.RedisContainer; +import datadog.trace.agent.test.AbstractInstrumentationTest; +import datadog.trace.bootstrap.instrumentation.api.Tags; +import datadog.trace.core.DDSpan; +import io.lettuce.core.ClientOptions; +import io.lettuce.core.RedisClient; +import io.lettuce.core.RedisURI; +import io.lettuce.core.api.StatefulRedisConnection; +import io.lettuce.core.codec.RedisCodec; +import io.lettuce.core.codec.StringCodec; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.testcontainers.containers.wait.strategy.Wait; +import org.testcontainers.utility.DockerImageName; + +class Lettuce5MasterReplicaTest extends AbstractInstrumentationTest { + private RedisContainer redisServer; + private RedisClient redisClient; + private StatefulRedisConnection connection; + private String host; + private int port; + + @BeforeEach + void setUpRedis() throws Exception { + redisServer = + new RedisContainer(DockerImageName.parse("redis:6.2.6")) + .waitingFor(Wait.forListeningPort()); + redisServer.start(); + + host = redisServer.getHost(); + port = redisServer.getFirstMappedPort(); + + RedisURI redisURI = RedisURI.Builder.redis(host, port).withDatabase(0).build(); + redisClient = RedisClient.create(); + redisClient.setOptions(ClientOptions.builder().autoReconnect(false).build()); + connection = connectMasterReplica(redisClient, redisURI); + connection.sync().ping(); + + writer.waitForTraces(2); + tracer.flush(); + writer.clear(); + } + + @AfterEach + void cleanUpRedis() { + if (connection != null) { + connection.close(); + } + + if (redisClient != null) { + redisClient.shutdown(5, 10, TimeUnit.SECONDS); + } + + if (redisServer != null) { + redisServer.stop(); + } + } + + @Test + void staticMasterReplicaCommandSpanHasPeerHostname() throws Exception { + String result = connection.sync().set("TESTSETKEY", "TESTSETVAL"); + + assertEquals("OK", result); + writer.waitForTraces(1); + + List setSpans = new ArrayList<>(); + for (List trace : writer) { + for (DDSpan span : trace) { + if ("SET".contentEquals(span.getResourceName()) + && "redis-client".equals(String.valueOf(span.getTag(Tags.COMPONENT)))) { + setSpans.add(span); + } + } + } + + assertEquals(1, setSpans.size(), "expected exactly one SET command span"); + DDSpan span = setSpans.get(0); + assertEquals("SET", String.valueOf(span.getResourceName())); + assertEquals("redis-client", String.valueOf(span.getTag(Tags.COMPONENT))); + assertEquals("redis", span.getTag(Tags.DB_TYPE)); + assertNotNull(span.getTag(Tags.PEER_HOSTNAME), "command span should include peer.hostname"); + assertEquals(host, span.getTag(Tags.PEER_HOSTNAME)); + } + + @SuppressWarnings("unchecked") + private static StatefulRedisConnection connectMasterReplica( + RedisClient redisClient, RedisURI redisURI) throws Exception { + // Prefer the newer MasterReplica facade when this source is compiled for latestDepTest, but + // resolve both APIs reflectively so the same test still compiles with the Lettuce 5.0 baseline + // and can keep compiling if the deprecated MasterSlave facade disappears later. + Class facade; + try { + facade = Class.forName("io.lettuce.core.masterreplica.MasterReplica"); + } catch (ClassNotFoundException ignored) { + facade = Class.forName("io.lettuce.core.masterslave.MasterSlave"); + } + Method connect = + facade.getMethod("connect", RedisClient.class, RedisCodec.class, Iterable.class); + try { + return (StatefulRedisConnection) + connect.invoke(null, redisClient, StringCodec.UTF8, singletonList(redisURI)); + } catch (InvocationTargetException e) { + Throwable cause = e.getCause(); + if (cause instanceof Exception) { + throw (Exception) cause; + } + if (cause instanceof Error) { + throw (Error) cause; + } + throw e; + } + } +} diff --git a/dd-java-agent/instrumentation/liberty/liberty-20.0/gradle.lockfile b/dd-java-agent/instrumentation/liberty/liberty-20.0/gradle.lockfile index a4b3d0876c6..47e397bd3f7 100644 --- a/dd-java-agent/instrumentation/liberty/liberty-20.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/liberty/liberty-20.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:liberty:liberty-20.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testLogging,webappCompileClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testLogging,webappCompil com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,webappCompileClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,webappCompileClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,webappCompileClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,webappCompileClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath,webappCompileClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath @@ -48,13 +52,13 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath,webappCompileClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath io.openliberty:openliberty-runtime:21.0.0.3=zipped -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.0.1=compileClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,webappCompileClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,webappCompileClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,webappCompileClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,webappCompileClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -84,6 +88,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -101,14 +106,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath,webappComp org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,webappCompileClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,webappCompileClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testLogging,testRuntimeClasspath,webappCompileClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testLogging,testRuntimeClasspath,webappCompileClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testLogging,testRuntimeClasspath,webappCompileClasspath diff --git a/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/GetPartsInstrumentation.java b/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/GetPartsInstrumentation.java index d93a906e096..102c70acd98 100644 --- a/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/GetPartsInstrumentation.java +++ b/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/GetPartsInstrumentation.java @@ -53,7 +53,7 @@ public void methodAdvice(MethodTransformer transformer) { @RequiresRequestContext(RequestContextSlot.APPSEC) public static class GetFilenamesAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Return Collection parts, @ActiveRequestContext RequestContext reqCtx, diff --git a/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/HttpInboundServiceContextImplInstrumentation.java b/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/HttpInboundServiceContextImplInstrumentation.java index e9966d18216..e866c638f8b 100644 --- a/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/HttpInboundServiceContextImplInstrumentation.java +++ b/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/HttpInboundServiceContextImplInstrumentation.java @@ -84,7 +84,7 @@ static class SyncAdviceBuffer { return LibertyBlockingHelper.syncBufferEnter(thiz, buffers, (AgentSpan) o); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Enter BlockingException blockingException, @Advice.Thrown(readOnly = false) Throwable thrown) { diff --git a/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/LibertyDecorator.java b/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/LibertyDecorator.java index e3b34ef74c4..e325f102bc6 100644 --- a/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/LibertyDecorator.java +++ b/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/LibertyDecorator.java @@ -94,7 +94,7 @@ protected String requestedSessionId(final HttpServletRequest request) { } @Override - public AgentSpan onResponseStatus(AgentSpan span, int status) { + public void onResponseStatus(AgentSpan span, int status) { Integer currentStatus = (Integer) span.getTag(Tags.HTTP_STATUS); // do not set status if the tag is already there and it's an error span // we may have the status during response blocking, but in that case @@ -102,10 +102,9 @@ public AgentSpan onResponseStatus(AgentSpan span, int status) { if (currentStatus == null || !span.isError()) { super.onResponseStatus(span, status); } - return span; } - public AgentSpan getPath(AgentSpan span, HttpServletRequest request) { + public void getPath(AgentSpan span, HttpServletRequest request) { if (request != null) { String contextPath = request.getContextPath(); String servletPath = request.getServletPath(); @@ -120,7 +119,6 @@ public AgentSpan getPath(AgentSpan span, HttpServletRequest request) { request.setAttribute(DD_CONTEXT_PATH_ATTRIBUTE, contextPath); request.setAttribute(DD_SERVLET_PATH_ATTRIBUTE, servletPath); } - return span; } @Override @@ -128,7 +126,7 @@ protected boolean isAppSecOnResponseSeparate() { return true; } - public AgentSpan onResponse(AgentSpan span, SRTServletResponse response) { + public void onResponse(AgentSpan span, SRTServletResponse response) { HttpServletRequest req = response.getRequest(); if (Config.get().isServletPrincipalEnabled() && req.getUserPrincipal() != null) { @@ -154,10 +152,9 @@ public AgentSpan onResponse(AgentSpan span, SRTServletResponse response) { span.setError(true); span.setTag(DDTags.ERROR_MSG, (String) errorMessage); } - return span; } - public AgentSpan onError(AgentSpan span, WebAppErrorReport report, Throwable servletThrowable) { + public void onError(AgentSpan span, WebAppErrorReport report, Throwable servletThrowable) { span.setError(true); // make sure the two reported throwables are different throwables if (report.getCause() != null @@ -165,7 +162,6 @@ public AgentSpan onError(AgentSpan span, WebAppErrorReport report, Throwable ser span.addThrowable(report.getCause()); } span.setTag(DDTags.ERROR_MSG, report.getMessage()); - return span; } public static class LibertyBlockResponseFunction implements BlockResponseFunction { diff --git a/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/LibertyServerInstrumentation.java b/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/LibertyServerInstrumentation.java index 7a9e2de6d15..162a13970f4 100644 --- a/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/LibertyServerInstrumentation.java +++ b/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/LibertyServerInstrumentation.java @@ -3,7 +3,7 @@ import static datadog.trace.agent.tooling.InstrumenterModule.TargetSystem.CONTEXT_TRACKING; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.AgentSpan.fromContext; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; import static datadog.trace.instrumentation.liberty20.HttpInboundServiceContextImplInstrumentation.REQUEST_MSG_TYPE; import static datadog.trace.instrumentation.liberty20.LibertyDecorator.DD_PARENT_CONTEXT_ATTRIBUTE; @@ -108,7 +108,7 @@ public static void onEnter( parentScope = parentContext.attach(); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void closeScope(@Advice.Local("parentScope") ContextScope parentScope) { if (parentScope != null) parentScope.close(); } @@ -138,7 +138,7 @@ public static class HandleRequestAdvice { Object parentContextObj = request.getAttribute(DD_PARENT_CONTEXT_ATTRIBUTE); final Context parentContext = - (parentContextObj instanceof Context) ? (Context) parentContextObj : getRootContext(); + (parentContextObj instanceof Context) ? (Context) parentContextObj : rootContext(); final Context context = DECORATE.startSpan(request, parentContext); scope = context.attach(); final AgentSpan span = fromContext(context); @@ -184,7 +184,7 @@ public static class HandleRequestAdvice { return false; } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void closeScope( @Advice.Local("contextScope") final ContextScope scope, @Advice.Argument(value = 0) ServletRequest req) { diff --git a/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/ParseParametersInstrumentation.java b/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/ParseParametersInstrumentation.java index fd7059840b1..dd920e9849b 100644 --- a/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/ParseParametersInstrumentation.java +++ b/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/ParseParametersInstrumentation.java @@ -91,7 +91,7 @@ static void before( collector = ParameterCollector.ParameterCollectorNoop.INSTANCE; } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Local("collector") ParameterCollector collector, @Advice.Local("reqCtx") RequestContext reqCtx, diff --git a/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/ParsePostDataInstrumentation.java b/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/ParsePostDataInstrumentation.java index 02d7bf6cd6a..4fa50a6a58f 100644 --- a/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/ParsePostDataInstrumentation.java +++ b/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/ParsePostDataInstrumentation.java @@ -52,7 +52,7 @@ public void methodAdvice(MethodTransformer transformer) { @RequiresRequestContext(RequestContextSlot.APPSEC) static class ParsePostDataAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Return Hashtable retval, @ActiveRequestContext RequestContext reqCtx, diff --git a/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/PartHelper.java b/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/PartHelper.java index ed6ecb8ad3d..5fb6e4403dc 100644 --- a/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/PartHelper.java +++ b/dd-java-agent/instrumentation/liberty/liberty-20.0/src/main/java/datadog/trace/instrumentation/liberty20/PartHelper.java @@ -1,5 +1,6 @@ package datadog.trace.instrumentation.liberty20; +import de.thetaphi.forbiddenapis.SuppressForbidden; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collection; @@ -48,6 +49,7 @@ private static String getSubmittedFilename(Method method, Object part) { } } + @SuppressForbidden // split on single-character uses a fast path private static String getFilenameFromContentDisposition(Method getHeader, Object part) { if (getHeader == null) { return null; diff --git a/dd-java-agent/instrumentation/liberty/liberty-23.0/build.gradle b/dd-java-agent/instrumentation/liberty/liberty-23.0/build.gradle index f90c9eed237..dbbcdb9b066 100644 --- a/dd-java-agent/instrumentation/liberty/liberty-23.0/build.gradle +++ b/dd-java-agent/instrumentation/liberty/liberty-23.0/build.gradle @@ -137,7 +137,10 @@ tasks.named('filterLogbackClassic', Sync) { } tasks.named("shadowJar", ShadowJar) { - configurations = [project.configurations.shadow] + // The default shadowJar task has a runtimeClasspath convention. Replace it + // instead of adding to it; this jar is intentionally built from the shadow configuration only. + configurations.empty() + configurations.add(project.configurations.named('shadow')) zip64 = true archiveFileName = 'openliberty-shadow.jar' diff --git a/dd-java-agent/instrumentation/liberty/liberty-23.0/gradle.lockfile b/dd-java-agent/instrumentation/liberty/liberty-23.0/gradle.lockfile index 50bab8a694d..290f974ff72 100644 --- a/dd-java-agent/instrumentation/liberty/liberty-23.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/liberty/liberty-23.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:liberty:liberty-23.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testLogging,webappCompileClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testLogging,webappCompil com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,webappCompileClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,webappCompileClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,webappCompileClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,webappCompileClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath,webappCompileClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath @@ -48,13 +52,13 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath,webappCompileClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath io.openliberty:openliberty-runtime:22.0.0.1=zipped -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath jakarta.servlet:jakarta.servlet-api:5.0.0=compileClasspath,webappCompileClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,webappCompileClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,webappCompileClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,webappCompileClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,webappCompileClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -84,6 +88,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -101,14 +106,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath,webappComp org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath,webappCompileClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,webappCompileClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,webappCompileClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testLogging,testRuntimeClasspath,webappCompileClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testLogging,testRuntimeClasspath,webappCompileClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testLogging,testRuntimeClasspath,webappCompileClasspath diff --git a/dd-java-agent/instrumentation/liberty/liberty-23.0/src/main/java/datadog/trace/instrumentation/liberty23/HttpInboundServiceContextImplInstrumentation.java b/dd-java-agent/instrumentation/liberty/liberty-23.0/src/main/java/datadog/trace/instrumentation/liberty23/HttpInboundServiceContextImplInstrumentation.java index b6de023363e..f9f3da82162 100644 --- a/dd-java-agent/instrumentation/liberty/liberty-23.0/src/main/java/datadog/trace/instrumentation/liberty23/HttpInboundServiceContextImplInstrumentation.java +++ b/dd-java-agent/instrumentation/liberty/liberty-23.0/src/main/java/datadog/trace/instrumentation/liberty23/HttpInboundServiceContextImplInstrumentation.java @@ -84,7 +84,7 @@ static class SyncAdviceBuffer { return LibertyBlockingHelper.syncBufferEnter(thiz, buffers, (AgentSpan) o); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Enter BlockingException blockingException, @Advice.Thrown(readOnly = false) Throwable thrown) { diff --git a/dd-java-agent/instrumentation/liberty/liberty-23.0/src/main/java/datadog/trace/instrumentation/liberty23/LibertyDecorator.java b/dd-java-agent/instrumentation/liberty/liberty-23.0/src/main/java/datadog/trace/instrumentation/liberty23/LibertyDecorator.java index ae19d67a054..6a905991350 100644 --- a/dd-java-agent/instrumentation/liberty/liberty-23.0/src/main/java/datadog/trace/instrumentation/liberty23/LibertyDecorator.java +++ b/dd-java-agent/instrumentation/liberty/liberty-23.0/src/main/java/datadog/trace/instrumentation/liberty23/LibertyDecorator.java @@ -94,7 +94,7 @@ protected String requestedSessionId(final HttpServletRequest request) { } @Override - public AgentSpan onResponseStatus(AgentSpan span, int status) { + public void onResponseStatus(AgentSpan span, int status) { Integer currentStatus = (Integer) span.getTag(Tags.HTTP_STATUS); // do not set status if the tag is already there and it's an error span // we may have the status during response blocking, but in that case @@ -102,10 +102,9 @@ public AgentSpan onResponseStatus(AgentSpan span, int status) { if (currentStatus == null || !span.isError()) { super.onResponseStatus(span, status); } - return span; } - public AgentSpan getPath(AgentSpan span, HttpServletRequest request) { + public void getPath(AgentSpan span, HttpServletRequest request) { if (request != null) { String contextPath = request.getContextPath(); String servletPath = request.getServletPath(); @@ -120,7 +119,6 @@ public AgentSpan getPath(AgentSpan span, HttpServletRequest request) { request.setAttribute(DD_CONTEXT_PATH_ATTRIBUTE, contextPath); request.setAttribute(DD_SERVLET_PATH_ATTRIBUTE, servletPath); } - return span; } @Override @@ -128,7 +126,7 @@ protected boolean isAppSecOnResponseSeparate() { return true; } - public AgentSpan onResponse(AgentSpan span, SRTServletResponse response) { + public void onResponse(AgentSpan span, SRTServletResponse response) { HttpServletRequest req = response.getRequest(); if (Config.get().isServletPrincipalEnabled() && req.getUserPrincipal() != null) { @@ -155,10 +153,9 @@ public AgentSpan onResponse(AgentSpan span, SRTServletResponse response) { span.setError(true); span.setTag(DDTags.ERROR_MSG, (String) errorMessage); } - return span; } - public AgentSpan onError(AgentSpan span, WebAppErrorReport report, Throwable servletThrowable) { + public void onError(AgentSpan span, WebAppErrorReport report, Throwable servletThrowable) { span.setError(true); // make sure the two reported throwables are different throwables if (report.getCause() != null @@ -166,7 +163,6 @@ public AgentSpan onError(AgentSpan span, WebAppErrorReport report, Throwable ser span.addThrowable(report.getCause()); } span.setTag(DDTags.ERROR_MSG, report.getMessage()); - return span; } public static class LibertyBlockResponseFunction implements BlockResponseFunction { diff --git a/dd-java-agent/instrumentation/liberty/liberty-23.0/src/main/java/datadog/trace/instrumentation/liberty23/LibertyServerInstrumentation.java b/dd-java-agent/instrumentation/liberty/liberty-23.0/src/main/java/datadog/trace/instrumentation/liberty23/LibertyServerInstrumentation.java index 522d450adb1..220085c4d55 100644 --- a/dd-java-agent/instrumentation/liberty/liberty-23.0/src/main/java/datadog/trace/instrumentation/liberty23/LibertyServerInstrumentation.java +++ b/dd-java-agent/instrumentation/liberty/liberty-23.0/src/main/java/datadog/trace/instrumentation/liberty23/LibertyServerInstrumentation.java @@ -3,7 +3,7 @@ import static datadog.trace.agent.tooling.InstrumenterModule.TargetSystem.CONTEXT_TRACKING; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.AgentSpan.fromContext; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; import static datadog.trace.instrumentation.liberty23.HttpInboundServiceContextImplInstrumentation.REQUEST_MSG_TYPE; import static datadog.trace.instrumentation.liberty23.LibertyDecorator.DD_PARENT_CONTEXT_ATTRIBUTE; @@ -108,7 +108,7 @@ public static void onEnter( parentScope = parentContext.attach(); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void closeScope(@Advice.Local("parentScope") ContextScope parentScope) { if (parentScope != null) parentScope.close(); } @@ -140,7 +140,7 @@ public static class HandleRequestAdvice { Object parentContextObj = request.getAttribute(DD_PARENT_CONTEXT_ATTRIBUTE); final Context parentContext = - (parentContextObj instanceof Context) ? (Context) parentContextObj : getRootContext(); + (parentContextObj instanceof Context) ? (Context) parentContextObj : rootContext(); final Context context = DECORATE.startSpan(request, parentContext); scope = context.attach(); final AgentSpan span = fromContext(context); @@ -184,7 +184,7 @@ public static class HandleRequestAdvice { return false; } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void closeScope( @Advice.Local("contextScope") final ContextScope scope, @Advice.Argument(value = 0) ServletRequest req) { diff --git a/dd-java-agent/instrumentation/liberty/liberty-23.0/src/main/java/datadog/trace/instrumentation/liberty23/ParseParametersInstrumentation.java b/dd-java-agent/instrumentation/liberty/liberty-23.0/src/main/java/datadog/trace/instrumentation/liberty23/ParseParametersInstrumentation.java index c78e3da09c3..d29c4fcdfb0 100644 --- a/dd-java-agent/instrumentation/liberty/liberty-23.0/src/main/java/datadog/trace/instrumentation/liberty23/ParseParametersInstrumentation.java +++ b/dd-java-agent/instrumentation/liberty/liberty-23.0/src/main/java/datadog/trace/instrumentation/liberty23/ParseParametersInstrumentation.java @@ -91,7 +91,7 @@ static void before( collector = ParameterCollector.ParameterCollectorNoop.INSTANCE; } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Local("collector") ParameterCollector collector, @Advice.Local("reqCtx") RequestContext reqCtx, diff --git a/dd-java-agent/instrumentation/liberty/liberty-23.0/src/main/java/datadog/trace/instrumentation/liberty23/ParsePostDataInstrumentation.java b/dd-java-agent/instrumentation/liberty/liberty-23.0/src/main/java/datadog/trace/instrumentation/liberty23/ParsePostDataInstrumentation.java index 25dacb51291..6c5cfda83d8 100644 --- a/dd-java-agent/instrumentation/liberty/liberty-23.0/src/main/java/datadog/trace/instrumentation/liberty23/ParsePostDataInstrumentation.java +++ b/dd-java-agent/instrumentation/liberty/liberty-23.0/src/main/java/datadog/trace/instrumentation/liberty23/ParsePostDataInstrumentation.java @@ -52,7 +52,7 @@ public void methodAdvice(MethodTransformer transformer) { @RequiresRequestContext(RequestContextSlot.APPSEC) static class ParsePostDataAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Return Hashtable retval, @ActiveRequestContext RequestContext reqCtx, diff --git a/dd-java-agent/instrumentation/log4j/log4j-1.2.4/gradle.lockfile b/dd-java-agent/instrumentation/log4j/log4j-1.2.4/gradle.lockfile index 17b194a579c..4f3d40cb4ac 100644 --- a/dd-java-agent/instrumentation/log4j/log4j-1.2.4/gradle.lockfile +++ b/dd-java-agent/instrumentation/log4j/log4j-1.2.4/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:log4j:log4j-1.2.4:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,14 +51,14 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath log4j:log4j:1.2.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath log4j:log4j:1.2.4=compileClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -83,6 +87,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -100,14 +105,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath diff --git a/dd-java-agent/instrumentation/log4j/log4j-1.2.4/src/main/java/datadog/trace/instrumentation/log4j1/CategoryInstrumentation.java b/dd-java-agent/instrumentation/log4j/log4j-1.2.4/src/main/java/datadog/trace/instrumentation/log4j1/CategoryInstrumentation.java index 9455d230850..a7273e8beeb 100644 --- a/dd-java-agent/instrumentation/log4j/log4j-1.2.4/src/main/java/datadog/trace/instrumentation/log4j1/CategoryInstrumentation.java +++ b/dd-java-agent/instrumentation/log4j/log4j-1.2.4/src/main/java/datadog/trace/instrumentation/log4j1/CategoryInstrumentation.java @@ -59,7 +59,7 @@ public static void onEnter(@Advice.Argument(0) LoggingEvent event) { if (span != null && traceConfig(span).isLogsInjectionEnabled()) { InstrumentationContext.get(LoggingEvent.class, AgentSpanContext.class) - .put(event, span.context()); + .put(event, span.spanContext()); } } } diff --git a/dd-java-agent/instrumentation/log4j/log4j-2.0/gradle.lockfile b/dd-java-agent/instrumentation/log4j/log4j-2.0/gradle.lockfile index f21c423987e..714037815fe 100644 --- a/dd-java-agent/instrumentation/log4j/log4j-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/log4j/log4j-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:log4j:log4j-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -83,6 +87,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -100,14 +105,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/log4j/log4j-2.7/gradle.lockfile b/dd-java-agent/instrumentation/log4j/log4j-2.7/gradle.lockfile index 1d1b2915767..6c49ffca30d 100644 --- a/dd-java-agent/instrumentation/log4j/log4j-2.7/gradle.lockfile +++ b/dd-java-agent/instrumentation/log4j/log4j-2.7/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:log4j:log4j-2.7:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -83,6 +87,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -100,14 +105,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/log4j/log4j-2.7/src/main/java/datadog/trace/instrumentation/log4j27/SpanDecoratingContextDataInjector.java b/dd-java-agent/instrumentation/log4j/log4j-2.7/src/main/java/datadog/trace/instrumentation/log4j27/SpanDecoratingContextDataInjector.java index 5403c7321c2..f3e73b6e6d2 100644 --- a/dd-java-agent/instrumentation/log4j/log4j-2.7/src/main/java/datadog/trace/instrumentation/log4j27/SpanDecoratingContextDataInjector.java +++ b/dd-java-agent/instrumentation/log4j/log4j-2.7/src/main/java/datadog/trace/instrumentation/log4j27/SpanDecoratingContextDataInjector.java @@ -54,14 +54,14 @@ public StringMap injectContextData(List list, StringMap reusable) { } if (span != null) { - DDTraceId traceId = span.context().getTraceId(); + DDTraceId traceId = span.spanContext().getTraceId(); String traceIdValue = Config.get().isLogs128bitTraceIdEnabled() && traceId.toHighOrderLong() != 0 ? traceId.toHexString() : traceId.toString(); newContextData.putValue(CorrelationIdentifier.getTraceIdKey(), traceIdValue); newContextData.putValue( - CorrelationIdentifier.getSpanIdKey(), DDSpanId.toString(span.context().getSpanId())); + CorrelationIdentifier.getSpanIdKey(), DDSpanId.toString(span.spanContext().getSpanId())); } newContextData.putAll(contextData); diff --git a/dd-java-agent/instrumentation/logback-1.0/gradle.lockfile b/dd-java-agent/instrumentation/logback-1.0/gradle.lockfile index f4b76e4b589..897c844d544 100644 --- a/dd-java-agent/instrumentation/logback-1.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/logback-1.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:logback-1.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.0.0=compileClasspath @@ -10,20 +11,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -33,12 +34,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -49,12 +53,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -83,6 +87,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -100,14 +105,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/logback-1.0/src/main/java/datadog/trace/instrumentation/logback/LogbackLoggerInstrumentation.java b/dd-java-agent/instrumentation/logback-1.0/src/main/java/datadog/trace/instrumentation/logback/LogbackLoggerInstrumentation.java index 7c3b9e6435d..51fb2870370 100644 --- a/dd-java-agent/instrumentation/logback-1.0/src/main/java/datadog/trace/instrumentation/logback/LogbackLoggerInstrumentation.java +++ b/dd-java-agent/instrumentation/logback-1.0/src/main/java/datadog/trace/instrumentation/logback/LogbackLoggerInstrumentation.java @@ -74,11 +74,14 @@ public void methodAdvice(MethodTransformer transformer) { public static class CallAppendersAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) public static void onEnter(@Advice.Argument(0) ILoggingEvent event) { + if (event == null) { + return; + } AgentSpan span = activeSpan(); if (span != null && traceConfig(span).isLogsInjectionEnabled()) { InstrumentationContext.get(ILoggingEvent.class, AgentSpanContext.class) - .put(event, span.context()); + .put(event, span.spanContext()); } } } @@ -86,6 +89,9 @@ public static void onEnter(@Advice.Argument(0) ILoggingEvent event) { public static class CallAppendersAdvice2 { @Advice.OnMethodEnter(suppress = Throwable.class) public static void onEnter(@Advice.Argument(0) ILoggingEvent event) { + if (event == null) { + return; + } LogsIntakeHelper.log(event); } } diff --git a/dd-java-agent/instrumentation/mail/jakarta-mail-2.0.1/gradle.lockfile b/dd-java-agent/instrumentation/mail/jakarta-mail-2.0.1/gradle.lockfile index 1c4bce4c7eb..4b20e1bc161 100644 --- a/dd-java-agent/instrumentation/mail/jakarta-mail-2.0.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/mail/jakarta-mail-2.0.1/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:mail:jakarta-mail-2.0.1:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -49,14 +53,14 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:2.0.1=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.mail:jakarta.mail-api:2.0.1=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -85,6 +89,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -102,14 +107,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/mail/javax-mail-1.4.4/gradle.lockfile b/dd-java-agent/instrumentation/mail/javax-mail-1.4.4/gradle.lockfile index f9b1f17736a..a8a915899d7 100644 --- a/dd-java-agent/instrumentation/mail/javax-mail-1.4.4/gradle.lockfile +++ b/dd-java-agent/instrumentation/mail/javax-mail-1.4.4/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:mail:javax-mail-1.4.4:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -48,14 +52,14 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.activation:activation:1.1.1=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.mail:javax.mail-api:1.4.4=compileClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -84,6 +88,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -101,14 +106,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/maven/maven-3.2.1/build.gradle b/dd-java-agent/instrumentation/maven/maven-3.2.1/build.gradle index 6afad36c487..566ec05e87e 100644 --- a/dd-java-agent/instrumentation/maven/maven-3.2.1/build.gradle +++ b/dd-java-agent/instrumentation/maven/maven-3.2.1/build.gradle @@ -26,8 +26,9 @@ dependencies { // Maven 4 requires Java 17: https://datadoghq.atlassian.net/browse/AIDM-159 latestDepTestImplementation group: 'org.apache.maven', name: 'maven-embedder', version: '3.+' - latestDepTestImplementation group: 'org.apache.maven.resolver', name: 'maven-resolver-connector-basic', version: '1.+' - latestDepTestImplementation group: 'org.apache.maven.resolver', name: 'maven-resolver-transport-http', version: '1.+' + latestDepTestImplementation group: 'org.apache.maven.resolver', name: 'maven-resolver-connector-basic', version: '2.+' + latestDepTestImplementation group: 'org.apache.maven.resolver', name: 'maven-resolver-transport-apache', version: '2.+' + latestDepTestRuntimeOnly group: 'ch.qos.logback', name: 'logback-classic', version: '1.3.+' latestDepTestImplementation group: 'org.fusesource.jansi', name: 'jansi', version: '+' // Fix issue "No implementation for RepositorySystem was bound while locating DefaultProjectBuildingHelper" // See: https://issues.apache.org/jira/browse/MNG-6561 @@ -41,3 +42,8 @@ dependencies { latestDepTestImplementation group: 'org.codehaus.plexus', name: 'plexus-xml', version: '4.0.1' latestDepTestImplementation group: 'org.eclipse.sisu', name: 'org.eclipse.sisu.plexus', version: '0.9.0.M2' } + +// latestDepTest inherits the Resolver 1.x HTTP transport from testImplementation. +configurations.latestDepTestImplementation { + exclude group: 'org.apache.maven.resolver', module: 'maven-resolver-transport-http' +} diff --git a/dd-java-agent/instrumentation/maven/maven-3.2.1/gradle.lockfile b/dd-java-agent/instrumentation/maven/maven-3.2.1/gradle.lockfile index 3d9d7514433..9ffda91cc17 100644 --- a/dd-java-agent/instrumentation/maven/maven-3.2.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/maven/maven-3.2.1/gradle.lockfile @@ -1,52 +1,56 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:maven:maven-3.2.1:dependencies --write-locks aopalliance:aopalliance:1.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath -ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-classic:1.3.16=latestDepTestRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.3.16=latestDepTestRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-annotations:2.20=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-core:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-databind:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath com.google.auto.service:auto-service:1.1.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.auto:auto-common:1.2.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -com.google.code.gson:gson:2.13.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs +com.google.code.gson:gson:2.13.2=spotbugs +com.google.code.gson:gson:2.14.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.errorprone:error_prone_annotations:2.41.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs +com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.48.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:10.0.1=compileClasspath -com.google.guava:guava:16.0.1=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:33.5.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.inject:guice:6.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.jayway.jsonpath:json-path:2.8.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -56,14 +60,14 @@ com.thoughtworks.qdox:qdox:1.12.1=codenarc com.vaadin.external.google:android-json:0.0.20131108.vaadin1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-cli:commons-cli:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath commons-cli:commons-cli:1.2=compileClasspath,testCompileClasspath,testRuntimeClasspath -commons-codec:commons-codec:1.21.0=latestDepTestRuntimeClasspath +commons-codec:commons-codec:1.22.0=latestDepTestRuntimeClasspath commons-codec:commons-codec:1.6=testCompileClasspath,testRuntimeClasspath commons-fileupload:commons-fileupload:1.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.inject:jakarta.inject-api:2.0.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath javax.annotation:javax.annotation-api:1.3.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath javax.annotation:jsr250-api:1.0=compileClasspath,testCompileClasspath,testRuntimeClasspath @@ -72,8 +76,8 @@ javax.inject:javax.inject:1=compileClasspath,latestDepTestCompileClasspath,lates javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.minidev:accessors-smart:2.4.9=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -91,57 +95,58 @@ org.apache.httpcomponents:httpcore:4.4.16=latestDepTestCompileClasspath,latestDe org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apache.maven.resolver:maven-resolver-api:1.0.3=testCompileClasspath,testRuntimeClasspath -org.apache.maven.resolver:maven-resolver-api:1.9.27=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.maven.resolver:maven-resolver-api:2.0.20=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.maven.resolver:maven-resolver-connector-basic:1.0.3=testCompileClasspath,testRuntimeClasspath -org.apache.maven.resolver:maven-resolver-connector-basic:1.9.27=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.apache.maven.resolver:maven-resolver-impl:1.9.27=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.apache.maven.resolver:maven-resolver-named-locks:1.9.27=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.maven.resolver:maven-resolver-connector-basic:2.0.20=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.maven.resolver:maven-resolver-impl:2.0.20=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.maven.resolver:maven-resolver-named-locks:2.0.20=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.maven.resolver:maven-resolver-spi:1.0.3=testCompileClasspath,testRuntimeClasspath -org.apache.maven.resolver:maven-resolver-spi:1.9.27=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.maven.resolver:maven-resolver-spi:2.0.20=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.maven.resolver:maven-resolver-supplier-mvn3:2.0.20=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.maven.resolver:maven-resolver-transport-apache:2.0.20=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.maven.resolver:maven-resolver-transport-http:1.0.3=testCompileClasspath,testRuntimeClasspath -org.apache.maven.resolver:maven-resolver-transport-http:1.9.27=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.maven.resolver:maven-resolver-util:1.0.3=testCompileClasspath,testRuntimeClasspath -org.apache.maven.resolver:maven-resolver-util:1.9.27=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.apache.maven.shared:maven-shared-utils:3.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.maven.resolver:maven-resolver-util:2.0.20=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.maven.wagon:wagon-provider-api:2.8=testRuntimeClasspath org.apache.maven.wagon:wagon-provider-api:3.5.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.maven:maven-aether-provider:3.2.1=compileClasspath org.apache.maven:maven-aether-provider:3.2.5=testCompileClasspath,testRuntimeClasspath org.apache.maven:maven-api-meta:4.0.0-alpha-5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.maven:maven-api-xml:4.0.0-alpha-5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.maven:maven-artifact:3.10.0-rc-1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.maven:maven-artifact:3.2.1=compileClasspath org.apache.maven:maven-artifact:3.2.5=testCompileClasspath,testRuntimeClasspath -org.apache.maven:maven-artifact:3.9.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.apache.maven:maven-builder-support:3.9.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.maven:maven-builder-support:3.10.0-rc-1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.maven:maven-compat:3.10.0-rc-1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.maven:maven-compat:3.2.5=testRuntimeClasspath -org.apache.maven:maven-compat:3.9.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.maven:maven-core:3.10.0-rc-1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.maven:maven-core:3.2.1=compileClasspath org.apache.maven:maven-core:3.2.5=testCompileClasspath,testRuntimeClasspath -org.apache.maven:maven-core:3.9.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.maven:maven-embedder:3.10.0-rc-1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.maven:maven-embedder:3.2.1=compileClasspath org.apache.maven:maven-embedder:3.2.5=testCompileClasspath,testRuntimeClasspath -org.apache.maven:maven-embedder:3.9.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.maven:maven-jline:3.10.0-rc-1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.maven:maven-model-builder:3.10.0-rc-1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.maven:maven-model-builder:3.2.1=compileClasspath org.apache.maven:maven-model-builder:3.2.5=testCompileClasspath,testRuntimeClasspath -org.apache.maven:maven-model-builder:3.9.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.maven:maven-model:3.10.0-rc-1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.maven:maven-model:3.2.1=compileClasspath org.apache.maven:maven-model:3.2.5=testCompileClasspath,testRuntimeClasspath -org.apache.maven:maven-model:3.9.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.maven:maven-plugin-api:3.10.0-rc-1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.maven:maven-plugin-api:3.2.1=compileClasspath org.apache.maven:maven-plugin-api:3.2.5=testCompileClasspath,testRuntimeClasspath -org.apache.maven:maven-plugin-api:3.9.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.maven:maven-repository-metadata:3.10.0-rc-1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.maven:maven-repository-metadata:3.2.1=compileClasspath org.apache.maven:maven-repository-metadata:3.2.5=testCompileClasspath,testRuntimeClasspath -org.apache.maven:maven-repository-metadata:3.9.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.apache.maven:maven-resolver-provider:3.9.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.maven:maven-resolver-provider:3.10.0-rc-1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.maven:maven-settings-builder:3.10.0-rc-1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.maven:maven-settings-builder:3.2.1=compileClasspath org.apache.maven:maven-settings-builder:3.2.5=testCompileClasspath,testRuntimeClasspath -org.apache.maven:maven-settings-builder:3.9.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.maven:maven-settings:3.10.0-rc-1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.maven:maven-settings:3.2.1=compileClasspath org.apache.maven:maven-settings:3.2.5=testCompileClasspath,testRuntimeClasspath -org.apache.maven:maven-settings:3.9.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.maven:maven-xml-impl:4.0.0-alpha-5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.apiguardian:apiguardian-api:1.1.2=latestDepTestCompileClasspath,testCompileClasspath +org.apiguardian:apiguardian-api:1.1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.checkerframework:checker-qual:3.33.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc @@ -153,9 +158,9 @@ org.codehaus.groovy:groovy-xml:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codehaus.plexus:plexus-cipher:2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.codehaus.plexus:plexus-classworlds:2.12.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.codehaus.plexus:plexus-classworlds:2.5.1=compileClasspath org.codehaus.plexus:plexus-classworlds:2.5.2=testCompileClasspath,testRuntimeClasspath -org.codehaus.plexus:plexus-classworlds:2.9.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.codehaus.plexus:plexus-component-annotations:1.5.5=compileClasspath,testCompileClasspath,testRuntimeClasspath org.codehaus.plexus:plexus-component-annotations:2.2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.codehaus.plexus:plexus-interpolation:1.19=compileClasspath @@ -178,20 +183,24 @@ org.eclipse.aether:aether-util:0.9.0.M2=compileClasspath org.eclipse.aether:aether-util:1.0.0.v20140518=testCompileClasspath,testRuntimeClasspath org.eclipse.sisu:org.eclipse.sisu.inject:0.0.0.M5=compileClasspath org.eclipse.sisu:org.eclipse.sisu.inject:0.3.0.M1=testCompileClasspath,testRuntimeClasspath -org.eclipse.sisu:org.eclipse.sisu.inject:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.eclipse.sisu:org.eclipse.sisu.inject:1.0.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.eclipse.sisu:org.eclipse.sisu.plexus:0.0.0.M5=compileClasspath org.eclipse.sisu:org.eclipse.sisu.plexus:0.3.0.M1=testCompileClasspath,testRuntimeClasspath -org.eclipse.sisu:org.eclipse.sisu.plexus:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.eclipse.sisu:org.eclipse.sisu.plexus:1.0.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.freemarker:freemarker:2.3.31=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.fusesource.jansi:jansi:2.4.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.core:0.8.14=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.report:0.8.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.core:0.8.15=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.report:0.8.15=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jline:jansi-core:3.30.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jline:jline-native:3.30.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jline:jline-terminal-jni:3.30.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jline:jline-terminal:3.30.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -212,23 +221,24 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.skyscreamer:jsonassert:1.5.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:jcl-over-slf4j:1.7.36=latestDepTestRuntimeClasspath +org.slf4j:jcl-over-slf4j:2.0.18=latestDepTestRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath org.slf4j:slf4j-api:1.7.32=testCompileClasspath -org.slf4j:slf4j-api:1.7.36=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.36=testRuntimeClasspath org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j +org.slf4j:slf4j-api:2.0.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath org.sonatype.plexus:plexus-cipher:1.7=compileClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/maven/maven-3.2.1/src/main/java/datadog/trace/instrumentation/maven3/MavenUtils.java b/dd-java-agent/instrumentation/maven/maven-3.2.1/src/main/java/datadog/trace/instrumentation/maven3/MavenUtils.java index b08b6bffa39..c2ed31af284 100644 --- a/dd-java-agent/instrumentation/maven/maven-3.2.1/src/main/java/datadog/trace/instrumentation/maven3/MavenUtils.java +++ b/dd-java-agent/instrumentation/maven/maven-3.2.1/src/main/java/datadog/trace/instrumentation/maven3/MavenUtils.java @@ -351,7 +351,7 @@ public static List getClasspath(MavenSession session, MojoExecution mojoEx MethodHandles methodHandles = new MethodHandles(pluginRealm); MethodHandle generateTestClasspathMethod = - findMethod(methodHandles, mojo.getClass(), "generateTestClasspath"); + findMethod(methodHandles, mojo.getClass(), "generateTestClasspath", true); if (generateTestClasspathMethod == null) { LOGGER.debug( "Could not find generateTestClasspathMethod method in {} class", @@ -485,13 +485,32 @@ private static String getEffectiveJvm(MojoExecution mojoExecution, Mojo mojo) { private static MethodHandle findMethod( MethodHandles methodHandles, Class mojoClass, String methodName) { - do { - MethodHandle getEffectiveJvm = methodHandles.method(mojoClass, methodName); - if (getEffectiveJvm != null) { - return getEffectiveJvm; + return findMethod(methodHandles, mojoClass, methodName, false); + } + + private static MethodHandle findMethod( + MethodHandles methodHandles, Class mojoClass, String methodName, boolean acceptVarargs) { + for (Class clazz = mojoClass; clazz != null; clazz = clazz.getSuperclass()) { + MethodHandle handle = methodHandles.method(clazz, methodName); + if (handle != null) { + return handle; + } + } + if (!acceptVarargs) { + return null; + } + // fallback to a varargs method of the same name, which can also be invoked without arguments: + // our MethodHandles#invoke delegates to MethodHandle#invokeWithArguments, which collects the + // missing trailing varargs into an empty array. Necessary for: + // - AbstractSurefireMojo#generateTestClasspath() in >= 3.6.0-M1: added "ArtifactFilter..." + // param + for (Class clazz = mojoClass; clazz != null; clazz = clazz.getSuperclass()) { + MethodHandle handle = + methodHandles.method(clazz, m -> m.getName().equals(methodName) && m.isVarArgs()); + if (handle != null) { + return handle; } - mojoClass = mojoClass.getSuperclass(); - } while (mojoClass != null); + } return null; } diff --git a/dd-java-agent/instrumentation/maven/maven-3.2.1/src/test/java/datadog/trace/instrumentation/maven3/MavenUtilsTest.java b/dd-java-agent/instrumentation/maven/maven-3.2.1/src/test/java/datadog/trace/instrumentation/maven3/MavenUtilsTest.java index f80ff4ab7e1..6d7fad46e8a 100644 --- a/dd-java-agent/instrumentation/maven/maven-3.2.1/src/test/java/datadog/trace/instrumentation/maven3/MavenUtilsTest.java +++ b/dd-java-agent/instrumentation/maven/maven-3.2.1/src/test/java/datadog/trace/instrumentation/maven3/MavenUtilsTest.java @@ -15,18 +15,15 @@ import java.io.File; import java.io.FileWriter; import java.io.IOException; +import java.io.InputStream; import java.net.URISyntaxException; import java.nio.file.Path; import java.util.Collection; import java.util.Collections; import java.util.List; import java.util.Map; +import java.util.Properties; import java.util.stream.Stream; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; import org.apache.maven.artifact.versioning.ComparableVersion; import org.apache.maven.execution.ExecutionEvent; import org.apache.maven.execution.MavenSession; @@ -38,8 +35,6 @@ import org.junit.jupiter.params.provider.MethodSource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.w3c.dom.Document; -import org.w3c.dom.NodeList; public class MavenUtilsTest extends AbstractMavenTest { @@ -481,38 +476,27 @@ private boolean assertGetContainer(ExecutionEvent executionEvent) { } private static String getLatestMavenSurefireVersion() { - OkHttpClient client = new OkHttpClient(); - Request request = - new Request.Builder() - .url( - "https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-surefire-plugin/maven-metadata.xml") - .build(); - try (Response response = client.newCall(request).execute()) { - if (response.isSuccessful()) { - DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); - DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); - Document doc = dBuilder.parse(response.body().byteStream()); - doc.getDocumentElement().normalize(); - - NodeList versionList = doc.getElementsByTagName("latest"); - if (versionList.getLength() > 0) { - String version = versionList.item(0).getTextContent(); - if (!version.contains("alpha") && !version.contains("beta")) { - LOGGER.info("Will run the 'latest' tests with version {}", version); - return version; - } - } - } else { - LOGGER.warn( - "Could not get latest Maven Surefire version, response from repo.maven.apache.org is {}:{}", - response.code(), - response.body().string()); + // The pinned value is bumped on a schedule by the update-smoke-test-latest-versions workflow. + // See latest-tool-versions.properties. + String version = loadLatestToolVersions().getProperty("maven-surefire.latest"); + LOGGER.info("Will run the 'latest' tests with Maven Surefire version {}", version); + return version; + } + + private static Properties loadLatestToolVersions() { + Properties properties = new Properties(); + try (InputStream stream = + MavenUtilsTest.class + .getClassLoader() + .getResourceAsStream("latest-tool-versions.properties")) { + if (stream == null) { + throw new IllegalStateException( + "Could not find latest-tool-versions.properties on classpath"); } - } catch (Exception e) { - LOGGER.warn("Could not get latest Maven Surefire version", e); + properties.load(stream); + } catch (IOException e) { + throw new RuntimeException(e); } - String hardcodedLatestVersion = "3.5.0"; // latest version that is known to work - LOGGER.info("Will run the 'latest' tests with hard-coded version {}", hardcodedLatestVersion); - return hardcodedLatestVersion; + return properties; } } diff --git a/dd-java-agent/instrumentation/maven/maven-3.2.1/src/test/resources/latest-tool-versions.properties b/dd-java-agent/instrumentation/maven/maven-3.2.1/src/test/resources/latest-tool-versions.properties new file mode 100644 index 00000000000..9cae8a8bf99 --- /dev/null +++ b/dd-java-agent/instrumentation/maven/maven-3.2.1/src/test/resources/latest-tool-versions.properties @@ -0,0 +1,3 @@ +# Pinned latest eligible stable version (>=48h old) for the Maven instrumentation latestDepTest. +# Updated automatically by the update-smoke-test-latest-versions workflow. +maven-surefire.latest=3.5.6 diff --git a/dd-java-agent/instrumentation/maven/maven-surefire-3.0/gradle.lockfile b/dd-java-agent/instrumentation/maven/maven-surefire-3.0/gradle.lockfile index 07ca0237d4a..41d2c0336dd 100644 --- a/dd-java-agent/instrumentation/maven/maven-surefire-3.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/maven/maven-surefire-3.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:maven:maven-surefire-3.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -91,6 +95,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -108,14 +113,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-2.0/gradle.lockfile b/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-2.0/gradle.lockfile index f1a58bd54e1..154fe4ec672 100644 --- a/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:micronaut:micronaut-http-server-netty:micronaut-http-server-netty-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -24,16 +25,16 @@ com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.0=testRuntimeClasspa com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.12.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.12.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.0.3=latestDepTestAnnotationProcessor,testAnnotationProcessor -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.0.3=latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -43,12 +44,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -101,15 +105,15 @@ io.netty:netty-resolver:4.1.67.Final=latestDepTestCompileClasspath,latestDepTest io.netty:netty-transport:4.1.48.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.1.67.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.reactivex.rxjava2:rxjava:2.2.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.annotation:javax.annotation-api:1.3.2=compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath javax.inject:javax.inject:1=compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.validation:validation-api:2.0.1.Final=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -138,6 +142,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -155,14 +160,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.3=compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-3.0/gradle.lockfile b/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-3.0/gradle.lockfile index 6d4207f57d2..0f632ad1200 100644 --- a/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-3.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-3.0/gradle.lockfile @@ -1,40 +1,40 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:micronaut:micronaut-http-server-netty:micronaut-http-server-netty-3.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -ch.randelshofer:fastdoubleparser:0.8.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-annotations:2.12.4=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.15.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-annotations:2.18.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-core:2.12.4=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.15.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-core:2.18.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-databind:2.12.4=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.15.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-databind:2.18.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.12.4=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.15.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.18.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.12.4=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.15.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.12.4=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.15.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson:jackson-bom:2.18.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -44,12 +44,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -61,56 +64,56 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath io.micronaut:micronaut-aop:3.0.0=compileClasspath,latestDepTestAnnotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-aop:3.10.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-aop:3.10.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-buffer-netty:3.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-buffer-netty:3.10.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-buffer-netty:3.10.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-context:3.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-context:3.10.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-context:3.10.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-core-reactive:3.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-core-reactive:3.10.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-core-reactive:3.10.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-core:3.0.0=compileClasspath,latestDepTestAnnotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-core:3.10.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-core:3.10.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-http-client-core:3.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-http-client-core:3.10.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-http-client-core:3.10.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-http-netty:3.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-http-netty:3.10.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-http-netty:3.10.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-http-server-netty:3.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-http-server-netty:3.10.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-http-server-netty:3.10.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-http-server:3.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-http-server:3.10.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-http-server:3.10.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-http:3.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-http:3.10.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-http:3.10.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-inject-java:3.0.0=latestDepTestAnnotationProcessor,testAnnotationProcessor io.micronaut:micronaut-inject:3.0.0=compileClasspath,latestDepTestAnnotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-inject:3.10.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.micronaut:micronaut-jackson-core:3.10.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.micronaut:micronaut-jackson-databind:3.10.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.micronaut:micronaut-json-core:3.10.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-inject:3.10.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-jackson-core:3.10.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-jackson-databind:3.10.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-json-core:3.10.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-router:3.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-router:3.10.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-router:3.10.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-runtime:3.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-runtime:3.10.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-runtime:3.10.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-websocket:3.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-websocket:3.10.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-buffer:4.1.108.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-websocket:3.10.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-buffer:4.1.136.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-buffer:4.1.67.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-http2:4.1.108.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http2:4.1.136.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http2:4.1.67.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-http:4.1.108.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http:4.1.136.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http:4.1.67.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec:4.1.108.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec:4.1.136.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec:4.1.67.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-common:4.1.108.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-common:4.1.136.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-common:4.1.67.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-handler:4.1.108.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler:4.1.136.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-handler:4.1.67.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-resolver:4.1.108.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver:4.1.136.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-resolver:4.1.67.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-transport-native-unix-common:4.1.108.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-transport:4.1.108.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.1.136.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport:4.1.136.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.67.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.projectreactor:reactor-core:3.5.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:2.0.0=compileClasspath,latestDepTestAnnotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:2.1.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath jakarta.inject:jakarta.inject-api:2.0.0=compileClasspath,latestDepTestAnnotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath @@ -120,8 +123,8 @@ javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTes javax.validation:validation-api:2.0.1.Final=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -150,6 +153,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -167,14 +171,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.3=compileClasspath org.reactivestreams:reactive-streams:1.0.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-4.0/gradle.lockfile b/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-4.0/gradle.lockfile index 4f3f08f49a7..5274f770be7 100644 --- a/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-4.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-4.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:micronaut:micronaut-http-server-netty:micronaut-http-server-netty-4.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,34 +9,34 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-annotations:2.15.2=testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-annotations:2.21=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-core:2.15.2=testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.21.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-core:2.21.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-databind:2.15.2=testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.21.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-databind:2.21.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.15.2=testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.21.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.21.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.15.2=testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.21.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.21.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.15.2=testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.21.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson:jackson-bom:2.21.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.4=latestDepTestAnnotationProcessor,testAnnotationProcessor com.github.javaparser:javaparser-core:3.25.6=codenarc com.github.javaparser:javaparser-symbol-solver-core:3.25.4=latestDepTestAnnotationProcessor,testAnnotationProcessor -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -45,12 +46,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -62,66 +66,66 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath io.micronaut:micronaut-aop:4.0.0=latestDepTestAnnotationProcessor,main_java17CompileClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-aop:4.10.22=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-aop:4.10.26=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-buffer-netty:4.0.0=main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-buffer-netty:4.10.22=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-buffer-netty:4.10.26=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-context-propagation:4.0.0=testRuntimeClasspath -io.micronaut:micronaut-context-propagation:4.10.22=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-context-propagation:4.10.26=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-context:4.0.0=main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-context:4.10.22=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-context:4.10.26=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-core-processor:4.0.0=latestDepTestAnnotationProcessor,testAnnotationProcessor io.micronaut:micronaut-core-reactive:4.0.0=main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-core-reactive:4.10.22=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-core-reactive:4.10.26=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-core:4.0.0=latestDepTestAnnotationProcessor,main_java17CompileClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-core:4.10.22=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-core:4.10.26=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-http-netty:4.0.0=main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-http-netty:4.10.22=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-http-netty:4.10.26=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-http-server-netty:4.0.0=main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-http-server-netty:4.10.22=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-http-server-netty:4.10.26=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-http-server:4.0.0=main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-http-server:4.10.22=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-http-server:4.10.26=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-http:4.0.0=main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-http:4.10.22=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-http:4.10.26=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-inject-java:4.0.0=latestDepTestAnnotationProcessor,testAnnotationProcessor io.micronaut:micronaut-inject:4.0.0=latestDepTestAnnotationProcessor,main_java17CompileClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-inject:4.10.22=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-inject:4.10.26=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-jackson-core:4.0.0=testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-jackson-core:4.10.22=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-jackson-core:4.10.26=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-jackson-databind:4.0.0=testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-jackson-databind:4.10.22=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-jackson-databind:4.10.26=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-json-core:4.0.0=testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-json-core:4.10.22=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-json-core:4.10.26=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micronaut:micronaut-router:4.0.0=main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath -io.micronaut:micronaut-router:4.10.22=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micronaut:micronaut-router:4.10.26=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-buffer:4.1.94.Final=main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-buffer:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-base:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-compression:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-buffer:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-base:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-compression:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http2:4.1.94.Final=main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-http2:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http2:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http:4.1.94.Final=main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-http:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec:4.1.94.Final=main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-common:4.1.94.Final=main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-common:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-common:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-handler:4.1.94.Final=main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-handler:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-resolver:4.1.94.Final=main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-resolver:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport-native-unix-common:4.1.94.Final=main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-transport-native-unix-common:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.94.Final=main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-transport:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.projectreactor:reactor-core:3.5.7=latestDepTestCompileClasspath,testCompileClasspath,testRuntimeClasspath io.projectreactor:reactor-core:3.7.12=latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:2.1.1=latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath jakarta.inject:jakarta.inject-api:2.0.1=latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -150,6 +154,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -167,17 +172,17 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.5=latestDepTestAnnotationProcessor,testAnnotationProcessor org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.5=latestDepTestAnnotationProcessor,testAnnotationProcessor org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.5=latestDepTestAnnotationProcessor,testAnnotationProcessor org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-4.0/src/main/java17/datadog/trace/instrumentation/micronaut/v4_0/EncodeHttpResponseAdvice.java b/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-4.0/src/main/java17/datadog/trace/instrumentation/micronaut/v4_0/EncodeHttpResponseAdvice.java index 84535d254b7..8cb199cb8e6 100644 --- a/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-4.0/src/main/java17/datadog/trace/instrumentation/micronaut/v4_0/EncodeHttpResponseAdvice.java +++ b/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-4.0/src/main/java17/datadog/trace/instrumentation/micronaut/v4_0/EncodeHttpResponseAdvice.java @@ -4,7 +4,7 @@ import static datadog.trace.instrumentation.micronaut.v4_0.MicronautDecorator.DECORATE; import static datadog.trace.instrumentation.micronaut.v4_0.MicronautDecorator.SPAN_ATTRIBUTE; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import io.micronaut.http.HttpResponse; import io.micronaut.http.server.netty.NettyHttpRequest; @@ -21,7 +21,7 @@ public static void finishHandlerSpan( return; } - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { DECORATE.onResponse(span, message); DECORATE.beforeFinish(span); span.finish(); diff --git a/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-4.0/src/main/java17/datadog/trace/instrumentation/micronaut/v4_0/EncodeHttpResponseAdvice2.java b/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-4.0/src/main/java17/datadog/trace/instrumentation/micronaut/v4_0/EncodeHttpResponseAdvice2.java index 6d003a1781d..0b522672828 100644 --- a/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-4.0/src/main/java17/datadog/trace/instrumentation/micronaut/v4_0/EncodeHttpResponseAdvice2.java +++ b/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-4.0/src/main/java17/datadog/trace/instrumentation/micronaut/v4_0/EncodeHttpResponseAdvice2.java @@ -4,7 +4,7 @@ import static datadog.trace.instrumentation.micronaut.v4_0.MicronautDecorator.DECORATE; import static datadog.trace.instrumentation.micronaut.v4_0.MicronautDecorator.SPAN_ATTRIBUTE; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import io.micronaut.http.HttpResponse; import io.micronaut.http.server.netty.NettyHttpRequest; @@ -20,7 +20,7 @@ public static void finishHandlerSpan( return; } - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { DECORATE.onResponse(span, message); DECORATE.beforeFinish(span); span.finish(); diff --git a/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-4.0/src/main/java17/datadog/trace/instrumentation/micronaut/v4_0/EncodeHttpResponseAdvice3.java b/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-4.0/src/main/java17/datadog/trace/instrumentation/micronaut/v4_0/EncodeHttpResponseAdvice3.java index a68dea11b96..cd9bfae612a 100644 --- a/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-4.0/src/main/java17/datadog/trace/instrumentation/micronaut/v4_0/EncodeHttpResponseAdvice3.java +++ b/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-4.0/src/main/java17/datadog/trace/instrumentation/micronaut/v4_0/EncodeHttpResponseAdvice3.java @@ -4,7 +4,7 @@ import static datadog.trace.instrumentation.micronaut.v4_0.MicronautDecorator.DECORATE; import static datadog.trace.instrumentation.micronaut.v4_0.MicronautDecorator.SPAN_ATTRIBUTE; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import io.micronaut.http.HttpRequest; import io.micronaut.http.HttpResponse; @@ -20,7 +20,7 @@ public static void finishHandlerSpan( return; } - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { DECORATE.onResponse(span, message); DECORATE.beforeFinish(span); span.finish(); diff --git a/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-4.0/src/main/java17/datadog/trace/instrumentation/micronaut/v4_0/HandleRouteMatchAdvice.java b/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-4.0/src/main/java17/datadog/trace/instrumentation/micronaut/v4_0/HandleRouteMatchAdvice.java index 200b48e1c00..8ca80b25f24 100644 --- a/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-4.0/src/main/java17/datadog/trace/instrumentation/micronaut/v4_0/HandleRouteMatchAdvice.java +++ b/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-4.0/src/main/java17/datadog/trace/instrumentation/micronaut/v4_0/HandleRouteMatchAdvice.java @@ -10,7 +10,7 @@ import net.bytebuddy.asm.Advice; public class HandleRouteMatchAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void captureRoute( @Advice.Argument(0) final HttpRequest request, @Advice.Return final UriRouteMatch routeMatch) { diff --git a/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-common/gradle.lockfile b/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-common/gradle.lockfile index f397a33bae2..6aca2767a04 100644 --- a/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-common/gradle.lockfile +++ b/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-common/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:micronaut:micronaut-http-server-netty:micronaut-http-server-netty-common:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -16,15 +17,15 @@ com.fasterxml.jackson.core:jackson-annotations:2.11.0=compileClasspath com.fasterxml.jackson.core:jackson-core:2.11.0=compileClasspath com.fasterxml.jackson.core:jackson-databind:2.11.0=compileClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -34,12 +35,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -70,15 +74,15 @@ io.netty:netty-handler:4.1.48.Final=compileClasspath io.netty:netty-resolver:4.1.48.Final=compileClasspath io.netty:netty-transport:4.1.48.Final=compileClasspath io.reactivex.rxjava2:rxjava:2.2.10=compileClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.annotation:javax.annotation-api:1.3.2=compileClasspath javax.inject:javax.inject:1=compileClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath javax.validation:validation-api:2.0.1.Final=compileClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -107,6 +111,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -124,14 +129,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.3=compileClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-common/src/main/java/datadog/trace/instrumentation/micronaut/WriteFinalNettyResponseAdvice.java b/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-common/src/main/java/datadog/trace/instrumentation/micronaut/WriteFinalNettyResponseAdvice.java index 47802519796..002c8f18335 100644 --- a/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-common/src/main/java/datadog/trace/instrumentation/micronaut/WriteFinalNettyResponseAdvice.java +++ b/dd-java-agent/instrumentation/micronaut/micronaut-http-server-netty/micronaut-http-server-netty-common/src/main/java/datadog/trace/instrumentation/micronaut/WriteFinalNettyResponseAdvice.java @@ -1,6 +1,5 @@ package datadog.trace.instrumentation.micronaut; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; import static datadog.trace.instrumentation.micronaut.MicronautDecorator.DECORATE; import static datadog.trace.instrumentation.micronaut.MicronautDecorator.SPAN_ATTRIBUTE; @@ -20,7 +19,7 @@ public static void beginRequest( return; } - try (final ContextScope scope = getCurrentContext().with(span).attach()) { + try (final ContextScope scope = span.attachWithContext()) { DECORATE.onResponse(span, message); DECORATE.beforeFinish(scope.context()); span.finish(); diff --git a/dd-java-agent/instrumentation/mongo/mongo-common/build.gradle b/dd-java-agent/instrumentation/mongo/mongo-common/build.gradle index 44e168aaf3d..9cdef640e2b 100644 --- a/dd-java-agent/instrumentation/mongo/mongo-common/build.gradle +++ b/dd-java-agent/instrumentation/mongo/mongo-common/build.gradle @@ -15,6 +15,5 @@ dependencies { testFixturesImplementation(project(':dd-java-agent:instrumentation-testing')) testFixturesImplementation group: 'org.testcontainers', name: 'mongodb', version: libs.versions.testcontainers.get() - //testImplementation project(':dd-java-agent:instrumentation:mongo').sourceSets.test.output testImplementation group: 'org.mongodb', name: 'mongo-java-driver', version: '3.1.0' } diff --git a/dd-java-agent/instrumentation/mongo/mongo-common/gradle.lockfile b/dd-java-agent/instrumentation/mongo/mongo-common/gradle.lockfile index e560fd11317..348c7cb4395 100644 --- a/dd-java-agent/instrumentation/mongo/mongo-common/gradle.lockfile +++ b/dd-java-agent/instrumentation/mongo/mongo-common/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:mongo:mongo-common:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testFixturesCompileClass com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.github.docker-java:docker-java-api:3.4.2=testFixturesCompileClasspath,testFi com.github.docker-java:docker-java-transport-zerodep:3.4.2=testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -51,12 +55,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testFixturesCompileClasspath,t commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testFixturesRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testFixturesRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,6 +91,7 @@ org.hamcrest:hamcrest:3.0=testCompileClasspath,testFixturesCompileClasspath,test org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -105,16 +110,16 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testFixturesCompileClasspath,te org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.7.1=runtimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testFixturesRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.7.1=runtimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/mongo/mongo-common/src/main/java/datadog/trace/instrumentation/mongo/MongoCommandListener.java b/dd-java-agent/instrumentation/mongo/mongo-common/src/main/java/datadog/trace/instrumentation/mongo/MongoCommandListener.java index d11c5b463c9..d37cdd69359 100644 --- a/dd-java-agent/instrumentation/mongo/mongo-common/src/main/java/datadog/trace/instrumentation/mongo/MongoCommandListener.java +++ b/dd-java-agent/instrumentation/mongo/mongo-common/src/main/java/datadog/trace/instrumentation/mongo/MongoCommandListener.java @@ -12,11 +12,11 @@ import com.mongodb.event.CommandListener; import com.mongodb.event.CommandStartedEvent; import com.mongodb.event.CommandSucceededEvent; +import datadog.context.ContextScope; import datadog.trace.api.Config; import datadog.trace.api.cache.DDCache; import datadog.trace.api.cache.DDCaches; import datadog.trace.bootstrap.ContextStore; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.Tags; import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; @@ -133,7 +133,7 @@ public void commandStarted(final CommandStartedEvent event) { shouldForceCloseSpanScope = false; } - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { decorator.afterStart(span); decorator.onConnection(span, event); // overlay Mongo application name if we have it (replaces the deprecated cluster description) diff --git a/dd-java-agent/instrumentation/mongo/mongo-common/src/main/java/datadog/trace/instrumentation/mongo/MongoDecorator.java b/dd-java-agent/instrumentation/mongo/mongo-common/src/main/java/datadog/trace/instrumentation/mongo/MongoDecorator.java index bb6c0f7d8bd..2f882c1ac47 100644 --- a/dd-java-agent/instrumentation/mongo/mongo-common/src/main/java/datadog/trace/instrumentation/mongo/MongoDecorator.java +++ b/dd-java-agent/instrumentation/mongo/mongo-common/src/main/java/datadog/trace/instrumentation/mongo/MongoDecorator.java @@ -67,18 +67,17 @@ protected final String dbHostname(CommandStartedEvent event) { return null; } - public final AgentSpan onStatement( + public final void onStatement( @Nonnull final AgentSpan span, @Nonnull final BsonDocument statement) { - return onStatement(span, statement, null); + onStatement(span, statement, null); } - public final AgentSpan onStatement( + public final void onStatement( @Nonnull final AgentSpan span, @Nonnull final BsonDocument statement, @Nullable ContextStore byteBufAccessor) { // scrub the Mongo command so that parameters are removed from the string span.setResourceName(scrub(statement, byteBufAccessor)); - return span; } @Override diff --git a/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.1/build.gradle b/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.1/build.gradle index 7c9da94525f..72431e4eea4 100644 --- a/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.1/build.gradle +++ b/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.1/build.gradle @@ -30,7 +30,6 @@ dependencies { transitive = false } - testImplementation project(':dd-java-agent:instrumentation:mongo:mongo-common').sourceSets.test.output testImplementation testFixtures(project(':dd-java-agent:instrumentation:mongo:mongo-common')) testImplementation group: 'org.testcontainers', name: 'mongodb', version: libs.versions.testcontainers.get() diff --git a/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.1/gradle.lockfile b/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.1/gradle.lockfile index 3384da5fc16..0ec613dd0a8 100644 --- a/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.1/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:mongo:mongo-driver:mongo-driver-3:mongo-driver-3.1:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.github.docker-java:docker-java-api:3.4.2=latestDepTestCompileClasspath,lates com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -51,12 +55,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,6 +91,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -106,14 +111,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.4/build.gradle b/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.4/build.gradle index 5bbd1a43204..b9d8fb54ce2 100644 --- a/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.4/build.gradle +++ b/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.4/build.gradle @@ -37,7 +37,6 @@ dependencies { transitive = false } - testImplementation project(':dd-java-agent:instrumentation:mongo:mongo-common').sourceSets.test.output testImplementation testFixtures(project(':dd-java-agent:instrumentation:mongo:mongo-common')) testImplementation group: 'org.testcontainers', name: 'mongodb', version: libs.versions.testcontainers.get() diff --git a/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.4/gradle.lockfile b/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.4/gradle.lockfile index a4e3e1f1879..f28c2734474 100644 --- a/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.4/gradle.lockfile +++ b/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.4/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:mongo:mongo-driver:mongo-driver-3:mongo-driver-3.4:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.github.docker-java:docker-java-api:3.4.2=latestDepTestCompileClasspath,lates com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -51,12 +55,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,6 +91,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -108,14 +113,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.6/build.gradle b/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.6/build.gradle index de3d1d0011e..4fa201cbd75 100644 --- a/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.6/build.gradle +++ b/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.6/build.gradle @@ -37,7 +37,6 @@ dependencies { transitive = false } - testImplementation project(':dd-java-agent:instrumentation:mongo:mongo-common').sourceSets.test.output testImplementation testFixtures(project(':dd-java-agent:instrumentation:mongo:mongo-common')) testImplementation group: 'org.testcontainers', name: 'mongodb', version: libs.versions.testcontainers.get() diff --git a/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.6/gradle.lockfile b/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.6/gradle.lockfile index c16e22193e7..25947b3e819 100644 --- a/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.6/gradle.lockfile +++ b/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.6/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:mongo:mongo-driver:mongo-driver-3:mongo-driver-3.6:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.github.docker-java:docker-java-api:3.4.2=latestDepTestCompileClasspath,lates com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -51,12 +55,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,6 +91,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -108,14 +113,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.8/build.gradle b/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.8/build.gradle index db1def27b2d..e6001a35fe8 100644 --- a/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.8/build.gradle +++ b/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.8/build.gradle @@ -37,7 +37,6 @@ dependencies { transitive = false } - testImplementation project(':dd-java-agent:instrumentation:mongo:mongo-common').sourceSets.test.output testImplementation testFixtures(project(':dd-java-agent:instrumentation:mongo:mongo-common')) testImplementation group: 'org.testcontainers', name: 'mongodb', version: libs.versions.testcontainers.get() diff --git a/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.8/gradle.lockfile b/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.8/gradle.lockfile index 69722edc959..de9e72257a6 100644 --- a/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.8/gradle.lockfile +++ b/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-3/mongo-driver-3.8/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:mongo:mongo-driver:mongo-driver-3:mongo-driver-3.8:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.github.docker-java:docker-java-api:3.4.2=latestDepTestCompileClasspath,lates com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -51,12 +55,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,6 +91,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -108,14 +113,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-4.0/build.gradle b/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-4.0/build.gradle index 928546f28fc..526a239351b 100644 --- a/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-4.0/build.gradle +++ b/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-4.0/build.gradle @@ -41,7 +41,6 @@ dependencies { transitive = false } - testImplementation project(':dd-java-agent:instrumentation:mongo:mongo-common').sourceSets.test.output testImplementation group: 'org.testcontainers', name: 'mongodb', version: libs.versions.testcontainers.get() testImplementation group: 'org.mongodb', name: 'mongodb-driver-sync', version: '4.0.1' diff --git a/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-4.0/gradle.lockfile b/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-4.0/gradle.lockfile index fef54dec98d..07f05723c76 100644 --- a/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-4.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-4.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:mongo:mongo-driver:mongo-driver-4.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.github.docker-java:docker-java-api:3.4.2=latestDepForkedTestCompileClasspath com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,mongo410ForkedTestAnnotationProcessor,mongo410ForkedTestCompileClasspath,mongo410TestAnnotationProcessor,mongo410TestCompileClasspath,mongo43ForkedTestAnnotationProcessor,mongo43ForkedTestCompileClasspath,mongo43TestAnnotationProcessor,mongo43TestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,mongo410ForkedTestAnnotationProcessor,mongo410TestAnnotationProcessor,mongo43ForkedTestAnnotationProcessor,mongo43TestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,mongo410ForkedTestAnnotationProcessor,mongo410TestAnnotationProcessor,mongo43ForkedTestAnnotationProcessor,mongo43TestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,mongo410ForkedTestAnnotationProcessor,mongo410TestAnnotationProcessor,mongo43ForkedTestAnnotationProcessor,mongo43TestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,mongo410ForkedTestAnnotationProcessor,mongo410TestAnnotationProcessor,mongo43ForkedTestAnnotationProcessor,mongo43TestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestAnnotationProcessor,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestAnnotationProcessor,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestAnnotationProcessor,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestAnnotationProcessor,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,mongo410ForkedTestAnnotationProcessor,mongo410TestAnnotationProcessor,mongo43ForkedTestAnnotationProcessor,mongo43TestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -53,12 +57,12 @@ de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClassp io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath io.projectreactor:reactor-core:3.2.22.RELEASE=mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath io.projectreactor:reactor-core:3.5.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -89,6 +93,7 @@ org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTes org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -103,39 +108,39 @@ org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.mockito:mockito-core:4.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath org.mongodb:bson-record-codec:4.10.2=mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath -org.mongodb:bson-record-codec:5.7.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +org.mongodb:bson-record-codec:5.9.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath org.mongodb:bson:4.0.0=compileClasspath org.mongodb:bson:4.0.1=testCompileClasspath,testRuntimeClasspath org.mongodb:bson:4.10.2=mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath org.mongodb:bson:4.3.4=mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath -org.mongodb:bson:5.7.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.mongodb:bson:5.9.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.mongodb:mongodb-driver-core:4.0.0=compileClasspath org.mongodb:mongodb-driver-core:4.0.1=testCompileClasspath,testRuntimeClasspath org.mongodb:mongodb-driver-core:4.10.2=mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath org.mongodb:mongodb-driver-core:4.3.4=mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath -org.mongodb:mongodb-driver-core:5.7.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.mongodb:mongodb-driver-core:5.9.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.mongodb:mongodb-driver-reactivestreams:4.0.0=compileClasspath org.mongodb:mongodb-driver-reactivestreams:4.0.1=testCompileClasspath,testRuntimeClasspath org.mongodb:mongodb-driver-reactivestreams:4.10.2=mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath org.mongodb:mongodb-driver-reactivestreams:4.3.4=mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath -org.mongodb:mongodb-driver-reactivestreams:5.7.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.mongodb:mongodb-driver-reactivestreams:5.9.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.mongodb:mongodb-driver-sync:4.0.0=compileClasspath org.mongodb:mongodb-driver-sync:4.0.1=testCompileClasspath,testRuntimeClasspath org.mongodb:mongodb-driver-sync:4.10.2=mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath org.mongodb:mongodb-driver-sync:4.3.4=mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath -org.mongodb:mongodb-driver-sync:5.7.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.mongodb:mongodb-driver-sync:5.9.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.2=compileClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.4=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,mongo410ForkedTestCompileClasspath,mongo410ForkedTestRuntimeClasspath,mongo410TestCompileClasspath,mongo410TestRuntimeClasspath,mongo43ForkedTestCompileClasspath,mongo43ForkedTestRuntimeClasspath,mongo43TestCompileClasspath,mongo43TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-4.0/src/main/java/datadog/trace/instrumentation/mongo/CallbackWrapper.java b/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-4.0/src/main/java/datadog/trace/instrumentation/mongo/CallbackWrapper.java index 0a97e6ae6d3..118ce639074 100644 --- a/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-4.0/src/main/java/datadog/trace/instrumentation/mongo/CallbackWrapper.java +++ b/dd-java-agent/instrumentation/mongo/mongo-driver/mongo-driver-4.0/src/main/java/datadog/trace/instrumentation/mongo/CallbackWrapper.java @@ -1,32 +1,32 @@ package datadog.trace.instrumentation.mongo; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.captureActiveSpan; -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopContinuation; import com.mongodb.internal.async.SingleResultCallback; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.Context; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; public class CallbackWrapper implements SingleResultCallback { - private static final AtomicReferenceFieldUpdater + private static final AtomicReferenceFieldUpdater CONTINUATION = AtomicReferenceFieldUpdater.newUpdater( - CallbackWrapper.class, AgentScope.Continuation.class, "continuation"); + CallbackWrapper.class, ContextContinuation.class, "continuation"); - private volatile AgentScope.Continuation continuation = null; + private volatile ContextContinuation continuation = null; private final SingleResultCallback wrapped; - public CallbackWrapper( - AgentScope.Continuation continuation, SingleResultCallback wrapped) { + public CallbackWrapper(ContextContinuation continuation, SingleResultCallback wrapped) { CONTINUATION.set(this, continuation); this.wrapped = wrapped; } @Override public void onResult(Object result, Throwable t) { - AgentScope.Continuation continuation = getAndResetContinuation(); + ContextContinuation continuation = getAndResetContinuation(); if (null != continuation) { - AgentScope scope = continuation.activate(); + ContextScope scope = continuation.resume(); try { wrapped.onResult(result, t); } finally { @@ -38,14 +38,14 @@ public void onResult(Object result, Throwable t) { } private void cancel() { - AgentScope.Continuation continuation = getAndResetContinuation(); + ContextContinuation continuation = getAndResetContinuation(); if (null != continuation) { - continuation.cancel(); + continuation.release(); } } - private AgentScope.Continuation getAndResetContinuation() { - AgentScope.Continuation continuation = this.continuation; + private ContextContinuation getAndResetContinuation() { + ContextContinuation continuation = this.continuation; if (continuation != null) { if (CONTINUATION.compareAndSet(this, continuation, null)) { return continuation; @@ -55,8 +55,8 @@ private AgentScope.Continuation getAndResetContinuation() { } public static SingleResultCallback wrapIfRequired(SingleResultCallback callback) { - AgentScope.Continuation continuation = captureActiveSpan(); - if (continuation != noopContinuation()) { + ContextContinuation continuation = captureActiveSpan(); + if (continuation.context() != Context.root()) { return new CallbackWrapper<>(continuation, callback); } return callback; diff --git a/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-async-3.3/build.gradle b/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-async-3.3/build.gradle index aa871b76a13..dadcb1afa34 100644 --- a/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-async-3.3/build.gradle +++ b/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-async-3.3/build.gradle @@ -11,7 +11,6 @@ dependencies { transitive = false } - testImplementation project(':dd-java-agent:instrumentation:mongo:mongo-common').sourceSets.test.output testImplementation testFixtures(project(':dd-java-agent:instrumentation:mongo:mongo-common')) testImplementation group: 'org.testcontainers', name: 'mongodb', version: libs.versions.testcontainers.get() diff --git a/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-async-3.3/gradle.lockfile b/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-async-3.3/gradle.lockfile index bc18fea55a4..9cba83bf885 100644 --- a/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-async-3.3/gradle.lockfile +++ b/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-async-3.3/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:mongo:mongo-test:mongo-test-async-3.3:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.github.docker-java:docker-java-api:3.4.2=latestDepTestCompileClasspath,lates com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -51,12 +55,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,6 +91,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -110,14 +115,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-core-3.1/build.gradle b/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-core-3.1/build.gradle index a0f89a42216..fafc53dd04c 100644 --- a/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-core-3.1/build.gradle +++ b/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-core-3.1/build.gradle @@ -3,7 +3,6 @@ apply from: "$rootDir/gradle/java.gradle" addTestSuiteForDir('latestDepTest', 'test') dependencies { - testImplementation project(':dd-java-agent:instrumentation:mongo:mongo-common').sourceSets.test.output testImplementation group: 'org.testcontainers', name: 'mongodb', version: libs.versions.testcontainers.get() // We need to pull in this dependency to get the 'suspend span' instrumentation for spock tests diff --git a/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-core-3.1/gradle.lockfile b/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-core-3.1/gradle.lockfile index 785fddf0689..3faf80b67d9 100644 --- a/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-core-3.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-core-3.1/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:mongo:mongo-test:mongo-test-core-3.1:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.github.docker-java:docker-java-api:3.4.2=latestDepTestCompileClasspath,lates com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -51,12 +55,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,6 +91,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -110,14 +115,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-core-3.7/build.gradle b/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-core-3.7/build.gradle index cdd6948ae80..75faf59a3f9 100644 --- a/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-core-3.7/build.gradle +++ b/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-core-3.7/build.gradle @@ -3,7 +3,6 @@ apply from: "$rootDir/gradle/java.gradle" addTestSuiteForDir('latestDepTest', 'test') dependencies { - testImplementation project(':dd-java-agent:instrumentation:mongo:mongo-common').sourceSets.test.output testImplementation group: 'org.testcontainers', name: 'mongodb', version: libs.versions.testcontainers.get() // We need to pull in this dependency to get the 'suspend span' instrumentation for spock tests diff --git a/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-core-3.7/gradle.lockfile b/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-core-3.7/gradle.lockfile index 6833047db08..6c3e945fb32 100644 --- a/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-core-3.7/gradle.lockfile +++ b/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-core-3.7/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:mongo:mongo-test:mongo-test-core-3.7:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.github.docker-java:docker-java-api:3.4.2=latestDepTestCompileClasspath,lates com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -51,12 +55,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,6 +91,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -110,14 +115,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-sync-3.10/build.gradle b/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-sync-3.10/build.gradle index 18327f98667..a0fe07f63d3 100644 --- a/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-sync-3.10/build.gradle +++ b/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-sync-3.10/build.gradle @@ -18,7 +18,6 @@ dependencies { } testImplementation testFixtures(project(':dd-java-agent:instrumentation:mongo:mongo-common')) - testImplementation project(':dd-java-agent:instrumentation:mongo:mongo-common').sourceSets.test.output testImplementation group: 'org.testcontainers', name: 'mongodb', version: libs.versions.testcontainers.get() diff --git a/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-sync-3.10/gradle.lockfile b/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-sync-3.10/gradle.lockfile index b3bab478300..da9162fbb50 100644 --- a/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-sync-3.10/gradle.lockfile +++ b/dd-java-agent/instrumentation/mongo/mongo-test/mongo-test-sync-3.10/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:mongo:mongo-test:mongo-test-sync-3.10:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.github.docker-java:docker-java-api:3.4.2=latestDepTestCompileClasspath,lates com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -51,12 +55,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,6 +91,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -110,14 +115,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/mule-4.5/gradle.lockfile b/dd-java-agent/instrumentation/mule-4.5/gradle.lockfile index db74492a541..736263cd65e 100644 --- a/dd-java-agent/instrumentation/mule-4.5/gradle.lockfile +++ b/dd-java-agent/instrumentation/mule-4.5/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:mule-4.5:dependencies --write-locks biz.aQute.bnd:biz.aQute.bnd.annotation:7.1.0=latestDepForkedTestCompileClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath @@ -16,7 +17,7 @@ com.conversantmedia:disruptor:1.2.21=latestDepForkedTestCompileClasspath,latestD com.damnhandy:handy-uri-templates:2.1.8=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestMuleServices,mule46Services,muleServices com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath @@ -56,15 +57,16 @@ com.github.java-json-tools:jackson-coreutils:1.9=compileClasspath,latestDepForke com.github.java-json-tools:json-schema-core:1.2.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.java-json-tools:json-schema-validator:2.2.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.7.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,mule46ForkedTestAnnotationProcessor,mule46ForkedTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -75,33 +77,34 @@ com.google.code.gson:gson:2.13.1=latestDepForkedTestCompileClasspath,latestDepFo com.google.code.gson:gson:2.13.2=spotbugs com.google.code.gson:gson:2.8.9=compileClasspath com.google.code.gson:gson:2.9.0=mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,mule46ForkedTestAnnotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -com.google.errorprone:error_prone_annotations:2.21.1=mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath -com.google.errorprone:error_prone_annotations:2.40.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,mule46ForkedTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs com.google.errorprone:error_prone_annotations:2.43.0=latestMuleServices +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.errorprone:error_prone_annotations:2.5.1=mule46Services,muleServices -com.google.guava:failureaccess:1.0.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,mule46ForkedTestAnnotationProcessor,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -com.google.guava:failureaccess:1.0.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestMuleServices -com.google.guava:guava-parent:32.1.1-jre=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,mule46ForkedTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.2=latestMuleServices +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava-parent:32.1.1-jre=compileClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,mule46ForkedTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:32.1.1-jre=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.google.guava:guava:32.1.3-jre=mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath -com.google.guava:guava:33.4.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestMuleServices +com.google.guava:guava:32.1.1-jre=compileClasspath +com.google.guava:guava:33.4.0-jre=latestMuleServices +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestMuleServices,mule46ForkedTestAnnotationProcessor,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,mule46ForkedTestAnnotationProcessor,mule46ForkedTestCompileClasspath,testAnnotationProcessor,testCompileClasspath -com.google.j2objc:j2objc-annotations:3.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestMuleServices +com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,mule46ForkedTestAnnotationProcessor,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:3.0.0=latestMuleServices +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.re2j:re2j:1.6=latestDepForkedTestCompileClasspath,latestMuleServices,mule46Services,muleServices -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath com.googlecode.juniversalchardet:juniversalchardet:1.0.3=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.googlecode.libphonenumber:libphonenumber:8.0.0=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.ibm.icu:icu4j:67.1=mule46Services,muleServices com.lmax:disruptor:3.4.3=mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.lmax:disruptor:4.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath -com.mchange:c3p0:0.12.0=latestMuleServices +com.mchange:c3p0:0.14.1=latestMuleServices com.mchange:c3p0:0.9.5.5=mule46Services,muleServices com.mchange:mchange-commons-java:0.2.19=mule46Services,muleServices -com.mchange:mchange-commons-java:0.4.0=latestMuleServices +com.mchange:mchange-commons-java:0.6.1=latestMuleServices com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,mule46ForkedTestCompileClasspath,testCompileClasspath @@ -226,7 +229,7 @@ io.projectreactor.netty:reactor-netty-http:1.2.11=latestMuleServices io.projectreactor:reactor-core:3.4.22=compileClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.projectreactor:reactor-core:3.7.12=latestMuleServices io.projectreactor:reactor-core:3.7.8=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath it.unimi.dsi:fastutil:8.5.11=mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath it.unimi.dsi:fastutil:8.5.16=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath jakarta.activation:jakarta.activation-api:1.2.2=mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -268,7 +271,7 @@ joda-time:joda-time:2.12.5=mule46ForkedTestCompileClasspath,mule46ForkedTestRunt joda-time:joda-time:2.14.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath joda-time:joda-time:2.9.1=compileClasspath,testCompileClasspath,testRuntimeClasspath junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.bytebuddy:byte-buddy:1.14.18=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath @@ -361,9 +364,9 @@ org.apache.xmlbeans:xmlbeans:5.3.0=latestDepForkedTestCompileClasspath,latestDep org.apfloat:apfloat:1.10.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath org.apiguardian:apiguardian-api:1.1.2=latestDepForkedTestCompileClasspath,mule46ForkedTestCompileClasspath,testCompileClasspath org.checkerframework:checker-qual:3.10.0=mule46Services,muleServices -org.checkerframework:checker-qual:3.33.0=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,mule46ForkedTestAnnotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -org.checkerframework:checker-qual:3.37.0=mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath -org.checkerframework:checker-qual:3.43.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestMuleServices +org.checkerframework:checker-qual:3.12.0=mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.checkerframework:checker-qual:3.33.0=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,mule46ForkedTestAnnotationProcessor,testAnnotationProcessor +org.checkerframework:checker-qual:3.43.0=latestMuleServices org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc @@ -428,7 +431,7 @@ org.json:json:20230227=mule46Services,muleServices org.json:json:20231013=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestMuleServices,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath org.jsoup:jsoup:1.15.3=mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jsoup:jsoup:1.21.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath -org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestMuleServices +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestMuleServices,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -441,12 +444,11 @@ org.junit.platform:junit-platform-suite-api:1.14.1=latestDepForkedTestRuntimeCla org.junit.platform:junit-platform-suite-commons:1.14.1=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.mockito:mockito-core:4.11.0=testRuntimeClasspath -org.mockito:mockito-core:4.4.0=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath -org.mozilla:rhino-engine:1.8.1=latestMuleServices +org.mockito:mockito-core:4.4.0=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath +org.mozilla:rhino-engine:1.9.1=latestMuleServices org.mozilla:rhino:1.7.12=compileClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.mozilla:rhino:1.8.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath -org.mozilla:rhino:1.8.1=latestMuleServices +org.mozilla:rhino:1.9.1=latestMuleServices org.mule.apache:xerces2-xsd11:2.11.3=mule46Services,muleServices org.mule.apache:xerces2-xsd11:2.11.3-MULE-001=compileClasspath,testCompileClasspath,testRuntimeClasspath org.mule.apache:xerces2-xsd11:2.11.3-MULE-002=latestMuleServices,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath @@ -522,7 +524,7 @@ org.mule.runtime:mule-extensions-mime-types:1.10.5=latestDepForkedTestCompileCla org.mule.runtime:mule-extensions-mime-types:1.6.0=mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath org.mule.runtime:mule-extensions-soap-api:1.5.0=testCompileClasspath,testRuntimeClasspath org.mule.runtime:mule-extensions-soap-api:1.6.0=mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath -org.mule.runtime:mule-extensions-soap-api:1.8.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath +org.mule.runtime:mule-extensions-soap-api:1.8.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath org.mule.runtime:mule-features-api:4.10.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath org.mule.runtime:mule-jar-handling-utils:4.10.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath org.mule.runtime:mule-jar-handling-utils:4.5.0=testCompileClasspath,testRuntimeClasspath @@ -615,7 +617,7 @@ org.mule.runtime:mule-module-http-policy-api:1.6.0=mule46ForkedTestCompileClassp org.mule.runtime:mule-module-http-support:4.10.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath org.mule.runtime:mule-module-javaee:4.5.0=testCompileClasspath,testRuntimeClasspath org.mule.runtime:mule-module-javaee:4.6.0=mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath -org.mule.runtime:mule-module-javaee:4.8.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath +org.mule.runtime:mule-module-javaee:4.8.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath org.mule.runtime:mule-module-jpms-utils:4.5.0=testCompileClasspath,testRuntimeClasspath org.mule.runtime:mule-module-jpms-utils:4.6.0=mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath org.mule.runtime:mule-module-launcher:4.10.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath @@ -722,7 +724,7 @@ org.mule.sdk:mule-sdk-compatibility-api:1.0.0=latestDepForkedTestCompileClasspat org.mule.services:mule-netty-http-service:0.3.5=latestMuleServices org.mule.services:mule-service-http:1.12.5=latestMuleServices org.mule.services:mule-service-http:1.5.21=mule46Services,muleServices -org.mule.services:mule-service-scheduler:1.11.3=latestMuleServices +org.mule.services:mule-service-scheduler:1.12.1=latestMuleServices org.mule.services:mule-service-scheduler:1.5.0=mule46Services,muleServices org.mule.services:mule-service-weave:2.5.0=mule46Services,muleServices org.mule.services:mule-service-weave:2.8.1=latestMuleServices @@ -782,14 +784,14 @@ org.osgi:org.osgi.resource:1.0.0=latestDepForkedTestCompileClasspath org.osgi:org.osgi.service.serviceloader:1.0.0=latestDepForkedTestCompileClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,mule46ForkedTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,mule46ForkedTestCompileClasspath,mule46ForkedTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.parboiled:parboiled_2.12:2.1.8=mule46Services,muleServices org.parboiled:parboiled_2.12:2.5.1=latestMuleServices org.quartz-scheduler:quartz:2.3.2=mule46Services,muleServices diff --git a/dd-java-agent/instrumentation/mule-4.5/src/main/java/datadog/trace/instrumentation/mule4/DDEventTracer.java b/dd-java-agent/instrumentation/mule-4.5/src/main/java/datadog/trace/instrumentation/mule4/DDEventTracer.java index 64ac273326b..e771a940c4a 100644 --- a/dd-java-agent/instrumentation/mule-4.5/src/main/java/datadog/trace/instrumentation/mule4/DDEventTracer.java +++ b/dd-java-agent/instrumentation/mule-4.5/src/main/java/datadog/trace/instrumentation/mule4/DDEventTracer.java @@ -95,7 +95,7 @@ private void handleNewSpan(CoreEvent event, InitialSpanInfo spanInfo) { final EventContext eventContext = event.getContext(); final AgentSpan span = - DECORATE.onMuleSpan(findParent(eventContext), spanInfo, event, findComponent(spanInfo)); + DECORATE.startMuleSpan(findParent(eventContext), spanInfo, event, findComponent(spanInfo)); linkToContext(eventContext, span); } @@ -110,7 +110,8 @@ private void handleEndOfSpan(CoreEvent event) { } if (spanState.getSpanContextSpan() != null) { final AgentSpan span = spanState.getSpanContextSpan(); - DECORATE.beforeFinish(span).finish(); + DECORATE.beforeFinish(span); + span.finish(); } eventContextStore.put(eventContext, spanState.getPreviousState()); } diff --git a/dd-java-agent/instrumentation/mule-4.5/src/main/java/datadog/trace/instrumentation/mule4/MuleDecorator.java b/dd-java-agent/instrumentation/mule-4.5/src/main/java/datadog/trace/instrumentation/mule4/MuleDecorator.java index dd2645d04db..09f8b4ff0b1 100644 --- a/dd-java-agent/instrumentation/mule-4.5/src/main/java/datadog/trace/instrumentation/mule4/MuleDecorator.java +++ b/dd-java-agent/instrumentation/mule-4.5/src/main/java/datadog/trace/instrumentation/mule4/MuleDecorator.java @@ -51,13 +51,13 @@ protected CharSequence component() { } @Override - public AgentSpan afterStart(final AgentSpan span) { + public void afterStart(final AgentSpan span) { span.setMeasured(true); span.setTag(Tags.SPAN_KIND, Tags.SPAN_KIND_INTERNAL); - return super.afterStart(span); + super.afterStart(span); } - public AgentSpan onMuleSpan( + public AgentSpan startMuleSpan( AgentSpan parentSpan, InitialSpanInfo spanInfo, CoreEvent event, Component component) { // we stick with the same level of detail of OTEL exporter. // if not exportable we're not going to create a real span but we still need to track those @@ -70,7 +70,7 @@ public AgentSpan onMuleSpan( if (parentSpan == null) { span = startSpan("mule", OPERATION_NAME); } else { - span = startSpan("mule", OPERATION_NAME, parentSpan.context()); + span = startSpan("mule", OPERATION_NAME, parentSpan.spanContext()); } // here we have to use the forEachAttribute since each specialized InitialSpanInfo class can add // different things through this method. Using the map version is not the same. @@ -89,6 +89,7 @@ public AgentSpan onMuleSpan( } else { span.setResourceName(spanInfo.getName()); } - return afterStart(span); + afterStart(span); + return span; } } diff --git a/dd-java-agent/instrumentation/mule-4.5/src/test/groovy/mule4/MuleForkedTest.groovy b/dd-java-agent/instrumentation/mule-4.5/src/test/groovy/mule4/MuleForkedTest.groovy index 81c9b9c2a9f..0fc8809a8b6 100644 --- a/dd-java-agent/instrumentation/mule-4.5/src/test/groovy/mule4/MuleForkedTest.groovy +++ b/dd-java-agent/instrumentation/mule-4.5/src/test/groovy/mule4/MuleForkedTest.groovy @@ -22,12 +22,6 @@ import spock.lang.Shared class MuleForkedTest extends WithHttpServer { - // TODO since mule uses reactor core, things sometime propagate to places where they're not closed - @Override - boolean useStrictTraceWrites() { - return false - } - @Override protected void configurePreAgent() { super.configurePreAgent() diff --git a/dd-java-agent/instrumentation/mule-4.5/src/test/groovy/mule4/MuleHttpServerForkedTest.groovy b/dd-java-agent/instrumentation/mule-4.5/src/test/groovy/mule4/MuleHttpServerForkedTest.groovy index c5b060a2f2b..a9cc6ba8e9b 100644 --- a/dd-java-agent/instrumentation/mule-4.5/src/test/groovy/mule4/MuleHttpServerForkedTest.groovy +++ b/dd-java-agent/instrumentation/mule-4.5/src/test/groovy/mule4/MuleHttpServerForkedTest.groovy @@ -9,12 +9,6 @@ import spock.lang.Shared class MuleHttpServerForkedTest extends HttpServerTest { - // TODO since mule uses reactor core, things sometime propagate to places where they're not closed - @Override - boolean useStrictTraceWrites() { - return false - } - @Override boolean testRedirect() { // Dynamic adding of headers to and HttpResponse from inside a mule application seems diff --git a/dd-java-agent/instrumentation/netty/netty-3.8/gradle.lockfile b/dd-java-agent/instrumentation/netty/netty-3.8/gradle.lockfile index 2d415005d41..bca9b3ca246 100644 --- a/dd-java-agent/instrumentation/netty/netty-3.8/gradle.lockfile +++ b/dd-java-agent/instrumentation/netty/netty-3.8/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:netty:netty-3.8:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.ning:async-http-client:1.8.0=testCompileClasspath,testRuntimeClasspath com.ning:async-http-client:1.9.40=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -52,12 +56,12 @@ io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeC io.netty:netty:3.10.6.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty:3.8.0.Final=compileClasspath io.netty:netty:3.9.0.Final=testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -86,6 +90,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -103,14 +108,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/ChannelFutureListenerInstrumentation.java b/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/ChannelFutureListenerInstrumentation.java index ba6060fced0..7148cffd723 100644 --- a/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/ChannelFutureListenerInstrumentation.java +++ b/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/ChannelFutureListenerInstrumentation.java @@ -3,7 +3,6 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.HierarchyMatchers.implementsInterface; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; import static datadog.trace.instrumentation.netty38.server.NettyHttpServerDecorator.DECORATE; import static datadog.trace.instrumentation.netty38.server.NettyHttpServerDecorator.NETTY; import static datadog.trace.instrumentation.netty38.server.NettyHttpServerDecorator.NETTY_CONNECT; @@ -11,12 +10,12 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArgument; import com.google.auto.service.AutoService; +import datadog.context.ContextContinuation; import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.bootstrap.ContextStore; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.Tags; import java.util.Collections; @@ -84,7 +83,7 @@ public Map contextStore() { public static class OperationCompleteAdvice extends AbstractNettyAdvice { @Advice.OnMethodEnter - public static AgentScope activateScope(@Advice.Argument(0) final ChannelFuture future) { + public static ContextScope activateScope(@Advice.Argument(0) final ChannelFuture future) { /* Idea here is: - To return scope only if we have captured it. @@ -98,7 +97,7 @@ public static AgentScope activateScope(@Advice.Argument(0) final ChannelFuture f final ContextStore contextStore = InstrumentationContext.get(Channel.class, ChannelTraceContext.class); - final AgentScope.Continuation continuation = + final ContextContinuation continuation = contextStore .putIfAbsent(future.getChannel(), ChannelTraceContext.Factory.INSTANCE) .getConnectionContinuation(); @@ -106,11 +105,11 @@ public static AgentScope activateScope(@Advice.Argument(0) final ChannelFuture f if (continuation == null) { return null; } - final AgentScope parentScope = continuation.activate(); + final ContextScope parentScope = continuation.resume(); final AgentSpan errorSpan = startSpan("netty", NETTY_CONNECT).setTag(Tags.COMPONENT, "netty"); - errorSpan.context().setIntegrationName(NETTY); - try (final ContextScope scope = getCurrentContext().with(errorSpan).attach()) { + errorSpan.spanContext().setIntegrationName(NETTY); + try (final ContextScope scope = errorSpan.attachWithContext()) { DECORATE.onError(errorSpan, cause); DECORATE.beforeFinish(scope.context()); errorSpan.finish(); @@ -120,7 +119,7 @@ public static AgentScope activateScope(@Advice.Argument(0) final ChannelFuture f } @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) - public static void deactivateScope(@Advice.Enter final AgentScope scope) { + public static void deactivateScope(@Advice.Enter final ContextScope scope) { if (scope != null) { scope.close(); } diff --git a/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/ChannelTraceContext.java b/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/ChannelTraceContext.java index c320a291061..c38a69248bf 100644 --- a/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/ChannelTraceContext.java +++ b/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/ChannelTraceContext.java @@ -1,8 +1,8 @@ package datadog.trace.instrumentation.netty38; import datadog.context.Context; +import datadog.context.ContextContinuation; import datadog.trace.bootstrap.ContextStore; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.websocket.HandlerContext; import org.jboss.netty.handler.codec.http.HttpHeaders; @@ -17,7 +17,7 @@ public ChannelTraceContext create() { } } - AgentScope.Continuation connectionContinuation; + ContextContinuation connectionContinuation; Context serverContext; AgentSpan clientSpan; AgentSpan clientParentSpan; @@ -62,7 +62,7 @@ public void setBlockedResponse(boolean blockedResponse) { this.blockedResponse = blockedResponse; } - public AgentScope.Continuation getConnectionContinuation() { + public ContextContinuation getConnectionContinuation() { return connectionContinuation; } @@ -82,7 +82,7 @@ public AgentSpan getClientParentSpan() { return clientParentSpan; } - public void setConnectionContinuation(AgentScope.Continuation connectionContinuation) { + public void setConnectionContinuation(ContextContinuation connectionContinuation) { this.connectionContinuation = connectionContinuation; } diff --git a/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/NettyChannelInstrumentation.java b/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/NettyChannelInstrumentation.java index ba50acc680d..5daa04a82f5 100644 --- a/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/NettyChannelInstrumentation.java +++ b/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/NettyChannelInstrumentation.java @@ -3,18 +3,18 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.HierarchyMatchers.implementsInterface; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.captureActiveSpan; -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopContinuation; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static datadog.trace.instrumentation.netty38.NettyChannelPipelineInstrumentation.ADDITIONAL_INSTRUMENTATION_NAMES; import static datadog.trace.instrumentation.netty38.NettyChannelPipelineInstrumentation.INSTRUMENTATION_NAME; import static net.bytebuddy.matcher.ElementMatchers.isMethod; import static net.bytebuddy.matcher.ElementMatchers.returns; import com.google.auto.service.AutoService; +import datadog.context.ContextContinuation; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.bootstrap.ContextStore; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import java.util.Collections; import java.util.Map; import net.bytebuddy.asm.Advice; @@ -66,8 +66,8 @@ public Map contextStore() { public static class ChannelConnectAdvice extends AbstractNettyAdvice { @Advice.OnMethodEnter public static void addConnectContinuation(@Advice.This final Channel channel) { - AgentScope.Continuation continuation = captureActiveSpan(); - if (continuation != noopContinuation()) { + ContextContinuation continuation = captureActiveSpan(); + if (continuation.context() != rootContext()) { final ContextStore contextStore = InstrumentationContext.get(Channel.class, ChannelTraceContext.class); @@ -75,7 +75,7 @@ public static void addConnectContinuation(@Advice.This final Channel channel) { .putIfAbsent(channel, ChannelTraceContext.Factory.INSTANCE) .getConnectionContinuation() != null) { - continuation.cancel(); + continuation.release(); } else { contextStore.get(channel).setConnectionContinuation(continuation); } diff --git a/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/client/HttpClientRequestTracingHandler.java b/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/client/HttpClientRequestTracingHandler.java index 7a5ae7d1dff..974ecbe5181 100644 --- a/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/client/HttpClientRequestTracingHandler.java +++ b/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/client/HttpClientRequestTracingHandler.java @@ -1,6 +1,5 @@ package datadog.trace.instrumentation.netty38.client; -import static datadog.context.Context.current; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; @@ -10,8 +9,10 @@ import static datadog.trace.instrumentation.netty38.client.NettyHttpClientDecorator.NETTY_CLIENT_REQUEST; import static datadog.trace.instrumentation.netty38.client.NettyResponseInjectAdapter.SETTER; +import datadog.context.Context; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; import datadog.trace.bootstrap.ContextStore; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.instrumentation.netty38.ChannelTraceContext; import java.net.InetSocketAddress; @@ -42,10 +43,10 @@ public void writeRequested(final ChannelHandlerContext ctx, final MessageEvent m final ChannelTraceContext channelTraceContext = contextStore.putIfAbsent(ctx.getChannel(), ChannelTraceContext.Factory.INSTANCE); - AgentScope parentScope = null; - final AgentScope.Continuation continuation = channelTraceContext.getConnectionContinuation(); + ContextScope parentScope = null; + final ContextContinuation continuation = channelTraceContext.getConnectionContinuation(); if (continuation != null) { - parentScope = continuation.activate(); + parentScope = continuation.resume(); channelTraceContext.setConnectionContinuation(null); } @@ -56,7 +57,7 @@ public void writeRequested(final ChannelHandlerContext ctx, final MessageEvent m NettyHttpClientDecorator decorate = isSecure ? DECORATE_SECURE : DECORATE; final AgentSpan span = startSpan(NETTY_CLIENT.toString(), NETTY_CLIENT_REQUEST); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { decorate.afterStart(span); decorate.onRequest(span, request); @@ -65,7 +66,7 @@ public void writeRequested(final ChannelHandlerContext ctx, final MessageEvent m decorate.onPeerConnection(span, (InetSocketAddress) socketAddress); } - DECORATE.injectContext(current(), request.headers(), SETTER); + DECORATE.injectContext(Context.current(), request.headers(), SETTER); channelTraceContext.setClientSpan(span); diff --git a/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/client/HttpClientResponseTracingHandler.java b/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/client/HttpClientResponseTracingHandler.java index abda3d05acf..e25a261bb56 100644 --- a/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/client/HttpClientResponseTracingHandler.java +++ b/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/client/HttpClientResponseTracingHandler.java @@ -4,8 +4,8 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpan; import static datadog.trace.instrumentation.netty38.client.NettyHttpClientDecorator.DECORATE; +import datadog.context.ContextScope; import datadog.trace.bootstrap.ContextStore; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.instrumentation.netty38.ChannelTraceContext; import org.jboss.netty.channel.Channel; @@ -40,7 +40,7 @@ public void messageReceived(final ChannelHandlerContext ctx, final MessageEvent final boolean finishSpan = msg.getMessage() instanceof HttpResponse; if (span != null && finishSpan) { - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { DECORATE.onResponse(span, (HttpResponse) msg.getMessage()); DECORATE.beforeFinish(span); span.finish(); @@ -48,7 +48,7 @@ public void messageReceived(final ChannelHandlerContext ctx, final MessageEvent } // We want the callback in the scope of the parent, not the client span - try (final AgentScope scope = activateSpan(parent)) { + try (final ContextScope scope = activateSpan(parent)) { ctx.sendUpstream(msg); } } @@ -68,7 +68,7 @@ public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws if (span != null) { // If an exception is passed to this point, it likely means it was unhandled and the // client span won't be finished with a proper response, so we should finish the span here. - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { DECORATE.onError(span, e.getCause()); DECORATE.beforeFinish(span); span.finish(); @@ -76,7 +76,7 @@ public void exceptionCaught(ChannelHandlerContext ctx, ExceptionEvent e) throws } // We want the callback in the scope of the parent, not the client span - try (final AgentScope scope = activateSpan(parent)) { + try (final ContextScope scope = activateSpan(parent)) { super.exceptionCaught(ctx, e); } } diff --git a/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/server/HttpServerRequestTracingHandler.java b/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/server/HttpServerRequestTracingHandler.java index ee355088118..ae8cfd62eb5 100644 --- a/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/server/HttpServerRequestTracingHandler.java +++ b/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/server/HttpServerRequestTracingHandler.java @@ -1,6 +1,5 @@ package datadog.trace.instrumentation.netty38.server; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.netty38.server.NettyHttpServerDecorator.DECORATE; import datadog.context.Context; @@ -51,7 +50,7 @@ public void messageReceived(final ChannelHandlerContext ctx, final MessageEvent channelTraceContext.setRequestHeaders(headers); try (final ContextScope scope = context.attach()) { - final AgentSpan span = spanFromContext(context); + final AgentSpan span = AgentSpan.fromContext(context); DECORATE.afterStart(span); DECORATE.onRequest(span, ctx.getChannel(), request, parentContext); diff --git a/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/server/HttpServerResponseTracingHandler.java b/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/server/HttpServerResponseTracingHandler.java index 984af432114..cede6cd43c9 100644 --- a/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/server/HttpServerResponseTracingHandler.java +++ b/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/server/HttpServerResponseTracingHandler.java @@ -1,6 +1,5 @@ package datadog.trace.instrumentation.netty38.server; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; import static datadog.trace.instrumentation.netty38.server.NettyHttpServerDecorator.DECORATE; import datadog.context.ContextScope; @@ -36,7 +35,7 @@ public void writeRequested(final ChannelHandlerContext ctx, final MessageEvent m return; } - try (final ContextScope scope = getCurrentContext().with(span).attach()) { + try (final ContextScope scope = span.attachWithContext()) { final HttpResponse response = (HttpResponse) msg.getMessage(); try { diff --git a/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/server/websocket/WebSocketServerRequestTracingHandler.java b/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/server/websocket/WebSocketServerRequestTracingHandler.java index 70c990db900..7f7fcfa5330 100644 --- a/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/server/websocket/WebSocketServerRequestTracingHandler.java +++ b/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/server/websocket/WebSocketServerRequestTracingHandler.java @@ -4,8 +4,8 @@ import static datadog.trace.bootstrap.instrumentation.decorator.WebsocketDecorator.DECORATE; import static datadog.trace.bootstrap.instrumentation.websocket.HandlersExtractor.MESSAGE_TYPE_TEXT; +import datadog.context.ContextScope; import datadog.trace.bootstrap.ContextStore; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.websocket.HandlerContext; import datadog.trace.instrumentation.netty38.ChannelTraceContext; @@ -53,9 +53,9 @@ public void messageReceived(ChannelHandlerContext ctx, MessageEvent event) throw TextWebSocketFrame textFrame = (TextWebSocketFrame) frame; final AgentSpan span = - DECORATE.onReceiveFrameStart( + DECORATE.startInboundFrameSpan( receiverContext, textFrame.getText(), textFrame.isFinalFragment()); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { ctx.sendUpstream(event); // WebSocket Read Text Start } finally { @@ -71,11 +71,11 @@ public void messageReceived(ChannelHandlerContext ctx, MessageEvent event) throw // WebSocket Read Binary Start BinaryWebSocketFrame binaryFrame = (BinaryWebSocketFrame) frame; final AgentSpan span = - DECORATE.onReceiveFrameStart( + DECORATE.startInboundFrameSpan( receiverContext, binaryFrame.getBinaryData().array(), binaryFrame.isFinalFragment()); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { ctx.sendUpstream(event); } finally { // WebSocket Read Binary End @@ -92,13 +92,13 @@ public void messageReceived(ChannelHandlerContext ctx, MessageEvent event) throw ContinuationWebSocketFrame continuationWebSocketFrame = (ContinuationWebSocketFrame) frame; final AgentSpan span = - DECORATE.onReceiveFrameStart( + DECORATE.startInboundFrameSpan( receiverContext, MESSAGE_TYPE_TEXT.equals(receiverContext.getMessageType()) ? continuationWebSocketFrame.getText() : continuationWebSocketFrame.getBinaryData().array(), continuationWebSocketFrame.isFinalFragment()); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { ctx.sendUpstream(event); } finally { if (continuationWebSocketFrame.isFinalFragment()) { @@ -117,8 +117,8 @@ public void messageReceived(ChannelHandlerContext ctx, MessageEvent event) throw traceContext.setSenderHandlerContext(null); traceContext.setReceiverHandlerContext(null); final AgentSpan span = - DECORATE.onSessionCloseReceived(receiverContext, reasonText, statusCode); - try (final AgentScope scope = activateSpan(span)) { + DECORATE.startInboundCloseSpan(receiverContext, reasonText, statusCode); + try (final ContextScope scope = activateSpan(span)) { ctx.sendUpstream(event); if (closeFrame.isFinalFragment()) { DECORATE.onFrameEnd(receiverContext); diff --git a/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/server/websocket/WebSocketServerResponseTracingHandler.java b/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/server/websocket/WebSocketServerResponseTracingHandler.java index 637d1a4abca..3b016b5d9b0 100644 --- a/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/server/websocket/WebSocketServerResponseTracingHandler.java +++ b/dd-java-agent/instrumentation/netty/netty-3.8/src/main/java/datadog/trace/instrumentation/netty38/server/websocket/WebSocketServerResponseTracingHandler.java @@ -5,8 +5,8 @@ import static datadog.trace.bootstrap.instrumentation.websocket.HandlersExtractor.MESSAGE_TYPE_BINARY; import static datadog.trace.bootstrap.instrumentation.websocket.HandlersExtractor.MESSAGE_TYPE_TEXT; +import datadog.context.ContextScope; import datadog.trace.bootstrap.ContextStore; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.websocket.HandlerContext; import datadog.trace.instrumentation.netty38.ChannelTraceContext; @@ -44,9 +44,9 @@ public void writeRequested(ChannelHandlerContext ctx, MessageEvent event) throws // WebSocket Write Text Start TextWebSocketFrame textFrame = (TextWebSocketFrame) frame; final AgentSpan span = - DECORATE.onSendFrameStart( + DECORATE.startOutboundFrameSpan( handlerContext, MESSAGE_TYPE_TEXT, textFrame.getText().length()); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { ctx.sendDownstream(event); } finally { // WebSocket Write Text End @@ -61,11 +61,11 @@ public void writeRequested(ChannelHandlerContext ctx, MessageEvent event) throws // WebSocket Write Binary Start BinaryWebSocketFrame binaryFrame = (BinaryWebSocketFrame) frame; final AgentSpan span = - DECORATE.onSendFrameStart( + DECORATE.startOutboundFrameSpan( handlerContext, MESSAGE_TYPE_BINARY, binaryFrame.getBinaryData().readableBytes()); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { ctx.sendDownstream(event); } finally { // WebSocket Write Binary End @@ -80,13 +80,13 @@ public void writeRequested(ChannelHandlerContext ctx, MessageEvent event) throws ContinuationWebSocketFrame continuationWebSocketFrame = (ContinuationWebSocketFrame) frame; final AgentSpan span = - DECORATE.onSendFrameStart( + DECORATE.startOutboundFrameSpan( handlerContext, handlerContext.getMessageType(), MESSAGE_TYPE_TEXT.equals(handlerContext.getMessageType()) ? continuationWebSocketFrame.getText().length() : continuationWebSocketFrame.getBinaryData().readableBytes()); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { ctx.sendDownstream(event); } finally { // WebSocket Write Binary End @@ -104,8 +104,8 @@ public void writeRequested(ChannelHandlerContext ctx, MessageEvent event) throws String reasonText = closeFrame.getReasonText(); traceContext.setSenderHandlerContext(null); final AgentSpan span = - DECORATE.onSessionCloseIssued(handlerContext, reasonText, statusCode); - try (final AgentScope scope = activateSpan(span)) { + DECORATE.startOutboundCloseSpan(handlerContext, reasonText, statusCode); + try (final ContextScope scope = activateSpan(span)) { ctx.sendDownstream(event); } finally { if (closeFrame.isFinalFragment()) { diff --git a/dd-java-agent/instrumentation/netty/netty-4.0/gradle.lockfile b/dd-java-agent/instrumentation/netty/netty-4.0/gradle.lockfile index 67d7b1183e0..3c39a4c3611 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/netty/netty-4.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:netty:netty-4.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -68,12 +72,12 @@ io.netty:netty-transport-native-epoll:4.0.56.Final=latestDepTestCompileClasspath io.netty:netty-transport:4.0.0.Final=compileClasspath io.netty:netty-transport:4.0.36.Final=testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.0.56.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -112,6 +116,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.javassist:javassist:3.20.0-GA=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -129,14 +134,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/AttributeKeys.java b/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/AttributeKeys.java index bf04f28bb13..ab9f0bb8a3d 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/AttributeKeys.java +++ b/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/AttributeKeys.java @@ -3,8 +3,8 @@ import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; import datadog.context.Context; +import datadog.context.ContextContinuation; import datadog.trace.api.GenericClassValue; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.websocket.HandlerContext; import io.netty.handler.codec.http.HttpHeaders; @@ -23,9 +23,8 @@ public final class AttributeKeys { public static final AttributeKey CLIENT_PARENT_ATTRIBUTE_KEY = attributeKey("datadog.client.parent.span"); - public static final AttributeKey - CONNECT_PARENT_CONTINUATION_ATTRIBUTE_KEY = - attributeKey("datadog.connect.parent.continuation"); + public static final AttributeKey CONNECT_PARENT_CONTINUATION_ATTRIBUTE_KEY = + attributeKey("datadog.connect.parent.continuation"); public static final AttributeKey PARENT_CONTEXT_ATTRIBUTE_KEY = attributeKey("datadog.server.parent-context"); diff --git a/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/ChannelFutureListenerInstrumentation.java b/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/ChannelFutureListenerInstrumentation.java index b0be195bdfb..c303b132ed4 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/ChannelFutureListenerInstrumentation.java +++ b/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/ChannelFutureListenerInstrumentation.java @@ -3,7 +3,6 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.HierarchyMatchers.implementsInterface; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; import static datadog.trace.instrumentation.netty40.AttributeKeys.CONNECT_PARENT_CONTINUATION_ATTRIBUTE_KEY; import static datadog.trace.instrumentation.netty40.server.NettyHttpServerDecorator.NETTY; import static datadog.trace.instrumentation.netty40.server.NettyHttpServerDecorator.NETTY_CONNECT; @@ -11,10 +10,10 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArgument; import com.google.auto.service.AutoService; +import datadog.context.ContextContinuation; import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.Tags; import datadog.trace.instrumentation.netty40.server.NettyHttpServerDecorator; @@ -76,7 +75,7 @@ public void methodAdvice(MethodTransformer transformer) { public static class OperationCompleteAdvice { @Advice.OnMethodEnter - public static AgentScope activateScope(@Advice.Argument(0) final ChannelFuture future) { + public static ContextScope activateScope(@Advice.Argument(0) final ChannelFuture future) { /* Idea here is: - To return scope only if we have captured it. @@ -86,16 +85,16 @@ public static AgentScope activateScope(@Advice.Argument(0) final ChannelFuture f if (cause == null) { return null; } - final AgentScope.Continuation continuation = + final ContextContinuation continuation = future.channel().attr(CONNECT_PARENT_CONTINUATION_ATTRIBUTE_KEY).getAndRemove(); if (continuation == null) { return null; } - final AgentScope parentScope = continuation.activate(); + final ContextScope parentScope = continuation.resume(); final AgentSpan errorSpan = startSpan("netty", NETTY_CONNECT).setTag(Tags.COMPONENT, "netty"); - errorSpan.context().setIntegrationName(NETTY); - try (final ContextScope scope = getCurrentContext().with(errorSpan).attach()) { + errorSpan.spanContext().setIntegrationName(NETTY); + try (final ContextScope scope = errorSpan.attachWithContext()) { NettyHttpServerDecorator.DECORATE.onError(errorSpan, cause); NettyHttpServerDecorator.DECORATE.beforeFinish(scope.context()); errorSpan.finish(); @@ -105,7 +104,7 @@ public static AgentScope activateScope(@Advice.Argument(0) final ChannelFuture f } @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) - public static void deactivateScope(@Advice.Enter final AgentScope scope) { + public static void deactivateScope(@Advice.Enter final ContextScope scope) { if (scope != null) { scope.close(); } diff --git a/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/NettyChannelHandlerContextInstrumentation.java b/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/NettyChannelHandlerContextInstrumentation.java index 7cc2884896d..69e15ac76cb 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/NettyChannelHandlerContextInstrumentation.java +++ b/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/NettyChannelHandlerContextInstrumentation.java @@ -5,7 +5,6 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopScope; import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.netty40.AttributeKeys.CONTEXT_ATTRIBUTE_KEY; import static datadog.trace.instrumentation.netty40.NettyChannelPipelineInstrumentation.ADDITIONAL_INSTRUMENTATION_NAMES; @@ -75,14 +74,16 @@ public static AgentScope scopeSpan(@Advice.This final ChannelHandlerContext ctx) final AgentSpan channelSpan = spanFromContext(storedContext); if (channelSpan == null || channelSpan == activeSpan()) { // don't modify the scope - return noopScope(); + return null; } return activateSpan(channelSpan); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void close(@Advice.Enter final AgentScope scope) { - scope.close(); + if (scope != null) { + scope.close(); + } } private void muzzleCheck() { diff --git a/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/NettyChannelPipelineInstrumentation.java b/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/NettyChannelPipelineInstrumentation.java index 08ebcd2cc0e..d2f514c08bb 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/NettyChannelPipelineInstrumentation.java +++ b/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/NettyChannelPipelineInstrumentation.java @@ -5,19 +5,19 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.namedOneOf; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.captureActiveSpan; -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopContinuation; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static datadog.trace.instrumentation.netty40.AttributeKeys.CONNECT_PARENT_CONTINUATION_ATTRIBUTE_KEY; import static net.bytebuddy.matcher.ElementMatchers.isMethod; import static net.bytebuddy.matcher.ElementMatchers.returns; import static net.bytebuddy.matcher.ElementMatchers.takesArgument; import com.google.auto.service.AutoService; +import datadog.context.ContextContinuation; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.agent.tooling.annotation.AppliesOn; import datadog.trace.api.InstrumenterConfig; import datadog.trace.bootstrap.CallDepthThreadLocalMap; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.instrumentation.netty40.client.HttpClientRequestTracingHandler; import datadog.trace.instrumentation.netty40.client.HttpClientResponseTracingHandler; import datadog.trace.instrumentation.netty40.client.HttpClientTracingHandler; @@ -231,12 +231,12 @@ public static void addHandler( public static class ConnectAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) public static void addParentSpan(@Advice.This final ChannelPipeline pipeline) { - AgentScope.Continuation continuation = captureActiveSpan(); - if (continuation != noopContinuation()) { - final Attribute attribute = + ContextContinuation continuation = captureActiveSpan(); + if (continuation.context() != rootContext()) { + final Attribute attribute = pipeline.channel().attr(CONNECT_PARENT_CONTINUATION_ATTRIBUTE_KEY); if (!attribute.compareAndSet(null, continuation)) { - continuation.cancel(); + continuation.release(); } } } diff --git a/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/client/HttpClientRequestTracingHandler.java b/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/client/HttpClientRequestTracingHandler.java index fc20990ffc8..6a4f5fe1d7c 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/client/HttpClientRequestTracingHandler.java +++ b/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/client/HttpClientRequestTracingHandler.java @@ -1,10 +1,8 @@ package datadog.trace.instrumentation.netty40.client; -import static datadog.context.Context.current; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; import static datadog.trace.instrumentation.netty40.AttributeKeys.CLIENT_PARENT_ATTRIBUTE_KEY; import static datadog.trace.instrumentation.netty40.AttributeKeys.CONNECT_PARENT_CONTINUATION_ATTRIBUTE_KEY; import static datadog.trace.instrumentation.netty40.AttributeKeys.CONTEXT_ATTRIBUTE_KEY; @@ -15,8 +13,9 @@ import static datadog.trace.instrumentation.netty40.client.NettyResponseInjectAdapter.SETTER; import datadog.context.Context; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; import datadog.trace.api.Config; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; @@ -53,11 +52,11 @@ public void write(final ChannelHandlerContext ctx, final Object msg, final Chann return; } - AgentScope parentScope = null; - final AgentScope.Continuation continuation = + ContextScope parentScope = null; + final ContextContinuation continuation = ctx.channel().attr(CONNECT_PARENT_CONTINUATION_ATTRIBUTE_KEY).getAndRemove(); if (continuation != null) { - parentScope = continuation.activate(); + parentScope = continuation.resume(); } final HttpRequest request = (HttpRequest) msg; @@ -79,8 +78,8 @@ public void write(final ChannelHandlerContext ctx, final Object msg, final Chann NettyHttpClientDecorator decorate = isSecure ? DECORATE_SECURE : DECORATE; final AgentSpan span = startSpan(NETTY_CLIENT.toString(), NETTY_CLIENT_REQUEST); - final Context context = getCurrentContext().with(span); - try (final AgentScope scope = activateSpan(span)) { + final Context context = Context.current().with(span); + try (final ContextScope scope = activateSpan(span)) { decorate.afterStart(span); decorate.onRequest(span, request); @@ -91,7 +90,7 @@ public void write(final ChannelHandlerContext ctx, final Object msg, final Chann // AWS calls are often signed, so we can't add headers without breaking the signature. if (!awsClientCall) { - DECORATE.injectContext(current(), request.headers(), SETTER); + DECORATE.injectContext(Context.current(), request.headers(), SETTER); } ctx.channel().attr(CONTEXT_ATTRIBUTE_KEY).set(context); diff --git a/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/client/HttpClientResponseTracingHandler.java b/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/client/HttpClientResponseTracingHandler.java index 75ec585739f..b353d24c9a5 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/client/HttpClientResponseTracingHandler.java +++ b/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/client/HttpClientResponseTracingHandler.java @@ -2,13 +2,12 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.netty40.AttributeKeys.CLIENT_PARENT_ATTRIBUTE_KEY; import static datadog.trace.instrumentation.netty40.AttributeKeys.CONTEXT_ATTRIBUTE_KEY; import static datadog.trace.instrumentation.netty40.client.NettyHttpClientDecorator.DECORATE; import datadog.context.Context; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; @@ -27,7 +26,7 @@ public void channelRead(final ChannelHandlerContext ctx, final Object msg) { parentAttr.setIfAbsent(noopSpan()); final AgentSpan parent = parentAttr.get(); final Context storedContext = ctx.channel().attr(CONTEXT_ATTRIBUTE_KEY).get(); - final AgentSpan span = spanFromContext(storedContext); + final AgentSpan span = AgentSpan.fromContext(storedContext); // Set parent context back to maintain the same functionality as getAndSet(parent) if (storedContext != null) { @@ -37,7 +36,7 @@ public void channelRead(final ChannelHandlerContext ctx, final Object msg) { final boolean finishSpan = msg instanceof HttpResponse; if (span != null && finishSpan) { - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { DECORATE.onResponse(span, (HttpResponse) msg); DECORATE.beforeFinish(span); span.finish(); @@ -45,7 +44,7 @@ public void channelRead(final ChannelHandlerContext ctx, final Object msg) { } // We want the callback in the scope of the parent, not the client span - try (final AgentScope scope = activateSpan(parent)) { + try (final ContextScope scope = activateSpan(parent)) { ctx.fireChannelRead(msg); } } @@ -56,7 +55,7 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws E parentAttr.setIfAbsent(noopSpan()); final AgentSpan parent = parentAttr.get(); final Context storedContext = ctx.channel().attr(CONTEXT_ATTRIBUTE_KEY).get(); - final AgentSpan span = spanFromContext(storedContext); + final AgentSpan span = AgentSpan.fromContext(storedContext); // Set parent context back to maintain the same functionality as getAndSet(parent) if (storedContext != null) { @@ -66,14 +65,14 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws E if (span != null) { // If an exception is passed to this point, it likely means it was unhandled and the // client span won't be finished with a proper response, so we should finish the span here. - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { DECORATE.onError(span, cause); DECORATE.beforeFinish(span); span.finish(); } } // We want the callback in the scope of the parent, not the client span - try (final AgentScope scope = activateSpan(parent)) { + try (final ContextScope scope = activateSpan(parent)) { super.exceptionCaught(ctx, cause); } } @@ -84,7 +83,7 @@ public void channelInactive(ChannelHandlerContext ctx) throws Exception { parentAttr.setIfAbsent(noopSpan()); final AgentSpan parent = parentAttr.get(); final Context storedContext = ctx.channel().attr(CONTEXT_ATTRIBUTE_KEY).get(); - final AgentSpan span = spanFromContext(storedContext); + final AgentSpan span = AgentSpan.fromContext(storedContext); // Set parent context back to maintain the same functionality as getAndSet(parent) if (storedContext != null) { @@ -92,13 +91,13 @@ public void channelInactive(ChannelHandlerContext ctx) throws Exception { } if (span != null && span != parent) { - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { DECORATE.beforeFinish(span); span.finish(); } } // We want the callback in the scope of the parent, not the client span - try (final AgentScope scope = activateSpan(parent)) { + try (final ContextScope scope = activateSpan(parent)) { super.channelInactive(ctx); } } diff --git a/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/server/HttpServerRequestTracingHandler.java b/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/server/HttpServerRequestTracingHandler.java index 4b212bcfa1e..1b524e7051c 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/server/HttpServerRequestTracingHandler.java +++ b/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/server/HttpServerRequestTracingHandler.java @@ -1,6 +1,5 @@ package datadog.trace.instrumentation.netty40.server; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.netty40.AttributeKeys.ANALYZED_RESPONSE_KEY; import static datadog.trace.instrumentation.netty40.AttributeKeys.BLOCKED_RESPONSE_KEY; import static datadog.trace.instrumentation.netty40.AttributeKeys.CONTEXT_ATTRIBUTE_KEY; @@ -47,7 +46,7 @@ public void channelRead(final ChannelHandlerContext ctx, final Object msg) { final Context context = DECORATE.startSpan(headers, parentContext); try (final ContextScope ignored = context.attach()) { - final AgentSpan span = spanFromContext(context); + final AgentSpan span = AgentSpan.fromContext(context); DECORATE.afterStart(span); DECORATE.onRequest(span, channel, request, parentContext); @@ -85,7 +84,7 @@ public void channelInactive(ChannelHandlerContext ctx) throws Exception { } finally { try { final Context storedContext = ctx.channel().attr(CONTEXT_ATTRIBUTE_KEY).getAndRemove(); - final AgentSpan span = spanFromContext(storedContext); + final AgentSpan span = AgentSpan.fromContext(storedContext); if (span != null && span.phasedFinish()) { // at this point we can just publish this span to avoid loosing the rest of the trace span.publish(); diff --git a/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/server/HttpServerResponseTracingHandler.java b/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/server/HttpServerResponseTracingHandler.java index 6b5dd488e76..22d970a8da7 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/server/HttpServerResponseTracingHandler.java +++ b/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/server/HttpServerResponseTracingHandler.java @@ -1,6 +1,5 @@ package datadog.trace.instrumentation.netty40.server; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.netty40.AttributeKeys.CHANNEL_ID; import static datadog.trace.instrumentation.netty40.AttributeKeys.CONTEXT_ATTRIBUTE_KEY; import static datadog.trace.instrumentation.netty40.AttributeKeys.WEBSOCKET_SENDER_HANDLER_CONTEXT; @@ -26,7 +25,7 @@ public class HttpServerResponseTracingHandler extends ChannelOutboundHandlerAdap @Override public void write(final ChannelHandlerContext ctx, final Object msg, final ChannelPromise prm) { final Context storedContext = ctx.channel().attr(CONTEXT_ATTRIBUTE_KEY).get(); - final AgentSpan span = spanFromContext(storedContext); + final AgentSpan span = AgentSpan.fromContext(storedContext); if (span == null || !(msg instanceof HttpResponse)) { ctx.write(msg, prm); return; diff --git a/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/server/MaybeBlockResponseHandler.java b/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/server/MaybeBlockResponseHandler.java index 8ccc6af32e1..d7ec1c109ef 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/server/MaybeBlockResponseHandler.java +++ b/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/server/MaybeBlockResponseHandler.java @@ -1,6 +1,5 @@ package datadog.trace.instrumentation.netty40.server; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.netty40.AttributeKeys.ANALYZED_RESPONSE_KEY; import static datadog.trace.instrumentation.netty40.AttributeKeys.BLOCKED_RESPONSE_KEY; import static datadog.trace.instrumentation.netty40.AttributeKeys.CONTEXT_ATTRIBUTE_KEY; @@ -59,7 +58,7 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise prm) thr Channel channel = ctx.channel(); Context storedContext = channel.attr(CONTEXT_ATTRIBUTE_KEY).get(); - AgentSpan span = spanFromContext(storedContext); + AgentSpan span = AgentSpan.fromContext(storedContext); RequestContext requestContext; if (span == null || (requestContext = span.getRequestContext()) == null diff --git a/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/server/websocket/WebSocketServerRequestTracingHandler.java b/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/server/websocket/WebSocketServerRequestTracingHandler.java index 6ec281b3ae9..6ba233ae0e9 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/server/websocket/WebSocketServerRequestTracingHandler.java +++ b/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/server/websocket/WebSocketServerRequestTracingHandler.java @@ -5,7 +5,7 @@ import static datadog.trace.bootstrap.instrumentation.websocket.HandlersExtractor.MESSAGE_TYPE_TEXT; import static datadog.trace.instrumentation.netty40.AttributeKeys.*; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.websocket.HandlerContext; import io.netty.channel.Channel; @@ -41,9 +41,9 @@ public void channelRead(ChannelHandlerContext ctx, Object frame) { TextWebSocketFrame textFrame = (TextWebSocketFrame) frame; final AgentSpan span = - DECORATE.onReceiveFrameStart( + DECORATE.startInboundFrameSpan( receiverContext, textFrame.text(), textFrame.isFinalFragment()); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { ctx.fireChannelRead(textFrame); // WebSocket Read Text Start } finally { @@ -59,11 +59,11 @@ public void channelRead(ChannelHandlerContext ctx, Object frame) { // WebSocket Read Binary Start BinaryWebSocketFrame binaryFrame = (BinaryWebSocketFrame) frame; final AgentSpan span = - DECORATE.onReceiveFrameStart( + DECORATE.startInboundFrameSpan( receiverContext, binaryFrame.content().nioBuffer(), binaryFrame.isFinalFragment()); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { ctx.fireChannelRead(binaryFrame); } finally { // WebSocket Read Binary End @@ -80,13 +80,13 @@ public void channelRead(ChannelHandlerContext ctx, Object frame) { ContinuationWebSocketFrame continuationWebSocketFrame = (ContinuationWebSocketFrame) frame; final AgentSpan span = - DECORATE.onReceiveFrameStart( + DECORATE.startInboundFrameSpan( receiverContext, MESSAGE_TYPE_TEXT.equals(receiverContext.getMessageType()) ? continuationWebSocketFrame.text() : continuationWebSocketFrame.content().nioBuffer(), continuationWebSocketFrame.isFinalFragment()); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { ctx.fireChannelRead(continuationWebSocketFrame); } finally { if (continuationWebSocketFrame.isFinalFragment()) { @@ -105,8 +105,8 @@ public void channelRead(ChannelHandlerContext ctx, Object frame) { channel.attr(WEBSOCKET_SENDER_HANDLER_CONTEXT).remove(); channel.attr(WEBSOCKET_RECEIVER_HANDLER_CONTEXT).remove(); final AgentSpan span = - DECORATE.onSessionCloseReceived(receiverContext, reasonText, statusCode); - try (final AgentScope scope = activateSpan(span)) { + DECORATE.startInboundCloseSpan(receiverContext, reasonText, statusCode); + try (final ContextScope scope = activateSpan(span)) { ctx.fireChannelRead(closeFrame); if (closeFrame.isFinalFragment()) { DECORATE.onFrameEnd(receiverContext); diff --git a/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/server/websocket/WebSocketServerResponseTracingHandler.java b/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/server/websocket/WebSocketServerResponseTracingHandler.java index bdea83f8bc2..b2908f35182 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/server/websocket/WebSocketServerResponseTracingHandler.java +++ b/dd-java-agent/instrumentation/netty/netty-4.0/src/main/java/datadog/trace/instrumentation/netty40/server/websocket/WebSocketServerResponseTracingHandler.java @@ -6,7 +6,7 @@ import static datadog.trace.bootstrap.instrumentation.websocket.HandlersExtractor.MESSAGE_TYPE_TEXT; import static datadog.trace.instrumentation.netty40.AttributeKeys.WEBSOCKET_SENDER_HANDLER_CONTEXT; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.websocket.HandlerContext; import io.netty.channel.*; @@ -30,9 +30,9 @@ public void write(ChannelHandlerContext ctx, Object frame, ChannelPromise promis // WebSocket Write Text Start TextWebSocketFrame textFrame = (TextWebSocketFrame) frame; final AgentSpan span = - DECORATE.onSendFrameStart( + DECORATE.startOutboundFrameSpan( handlerContext, MESSAGE_TYPE_TEXT, textFrame.text().length()); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { ctx.write(frame, promise); } finally { // WebSocket Write Text End @@ -47,9 +47,9 @@ public void write(ChannelHandlerContext ctx, Object frame, ChannelPromise promis // WebSocket Write Binary Start BinaryWebSocketFrame binaryFrame = (BinaryWebSocketFrame) frame; final AgentSpan span = - DECORATE.onSendFrameStart( + DECORATE.startOutboundFrameSpan( handlerContext, MESSAGE_TYPE_BINARY, binaryFrame.content().readableBytes()); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { ctx.write(frame, promise); } finally { // WebSocket Write Binary End @@ -64,13 +64,13 @@ public void write(ChannelHandlerContext ctx, Object frame, ChannelPromise promis ContinuationWebSocketFrame continuationWebSocketFrame = (ContinuationWebSocketFrame) frame; final AgentSpan span = - DECORATE.onSendFrameStart( + DECORATE.startOutboundFrameSpan( handlerContext, handlerContext.getMessageType(), MESSAGE_TYPE_TEXT.equals(handlerContext.getMessageType()) ? continuationWebSocketFrame.text().length() : continuationWebSocketFrame.content().readableBytes()); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { ctx.write(frame, promise); } finally { // WebSocket Write Binary End @@ -88,8 +88,8 @@ public void write(ChannelHandlerContext ctx, Object frame, ChannelPromise promis String reasonText = closeFrame.reasonText(); channel.attr(WEBSOCKET_SENDER_HANDLER_CONTEXT).remove(); final AgentSpan span = - DECORATE.onSessionCloseIssued(handlerContext, reasonText, statusCode); - try (final AgentScope scope = activateSpan(span)) { + DECORATE.startOutboundCloseSpan(handlerContext, reasonText, statusCode); + try (final ContextScope scope = activateSpan(span)) { ctx.write(frame, promise); } finally { if (closeFrame.isFinalFragment()) { diff --git a/dd-java-agent/instrumentation/netty/netty-4.1/gradle.lockfile b/dd-java-agent/instrumentation/netty/netty-4.1/gradle.lockfile index 1b6fba4f598..95d7efe9e32 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/netty/netty-4.1/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:netty:netty-4.1:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -52,53 +56,53 @@ de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,la io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath io.netty:netty-buffer:4.1.0.Final=compileClasspath io.netty:netty-buffer:4.1.29.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-buffer:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-base:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-compression:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-buffer:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-base:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-compression:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-dns:4.1.19.Final=testCompileClasspath,testRuntimeClasspath io.netty:netty-codec-http2:4.1.0.Final=compileClasspath io.netty:netty-codec-http2:4.1.29.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-http2:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http2:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http:4.1.0.Final=compileClasspath io.netty:netty-codec-http:4.1.29.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-http:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-marshalling:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-protobuf:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-marshalling:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-protobuf:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-socks:4.1.29.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-socks:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-socks:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec:4.1.0.Final=compileClasspath io.netty:netty-codec:4.1.29.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-common:4.1.0.Final=compileClasspath io.netty:netty-common:4.1.29.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-common:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-handler-proxy:4.1.121.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-common:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler-proxy:4.1.133.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-handler-proxy:4.1.29.Final=testCompileClasspath,testRuntimeClasspath io.netty:netty-handler:4.1.0.Final=compileClasspath io.netty:netty-handler:4.1.29.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-handler:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-resolver-dns:4.1.19.Final=testCompileClasspath,testRuntimeClasspath io.netty:netty-resolver:4.1.0.Final=compileClasspath io.netty:netty-resolver:4.1.29.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-resolver:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-transport-classes-epoll:4.1.121.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-transport-classes-kqueue:4.1.121.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-transport-native-epoll:4.1.121.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-classes-epoll:4.1.133.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-classes-kqueue:4.1.133.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-epoll:4.1.133.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport-native-epoll:4.1.29.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-transport-native-kqueue:4.1.121.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-kqueue:4.1.133.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport-native-unix-common:4.1.29.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-transport-native-unix-common:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.0.Final=compileClasspath io.netty:netty-transport:4.1.29.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-transport:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.projectreactor.netty:reactor-netty:0.8.0.RELEASE=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.projectreactor:reactor-core:3.2.0.RELEASE=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -111,9 +115,9 @@ org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=latestDepTestCompileClasspath,testCompileClasspath org.asynchttpclient:async-http-client-netty-utils:2.1.0=testCompileClasspath,testRuntimeClasspath -org.asynchttpclient:async-http-client-netty-utils:2.14.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.asynchttpclient:async-http-client-netty-utils:2.16.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.asynchttpclient:async-http-client:2.1.0=testCompileClasspath,testRuntimeClasspath -org.asynchttpclient:async-http-client:2.14.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.asynchttpclient:async-http-client:2.16.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.checkerframework:checker-qual:3.33.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc @@ -131,6 +135,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -148,14 +153,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.2=testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/ChannelFutureListenerInstrumentation.java b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/ChannelFutureListenerInstrumentation.java index 831166a7923..8fc6c413406 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/ChannelFutureListenerInstrumentation.java +++ b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/ChannelFutureListenerInstrumentation.java @@ -3,7 +3,6 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.HierarchyMatchers.implementsInterface; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; import static datadog.trace.instrumentation.netty41.AttributeKeys.CONNECT_PARENT_CONTINUATION_ATTRIBUTE_KEY; import static datadog.trace.instrumentation.netty41.server.NettyHttpServerDecorator.NETTY; import static datadog.trace.instrumentation.netty41.server.NettyHttpServerDecorator.NETTY_CONNECT; @@ -11,10 +10,10 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArgument; import com.google.auto.service.AutoService; +import datadog.context.ContextContinuation; import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.Tags; import datadog.trace.instrumentation.netty41.server.NettyHttpServerDecorator; @@ -76,7 +75,7 @@ public void methodAdvice(MethodTransformer transformer) { public static class OperationCompleteAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) - public static AgentScope activateScope(@Advice.Argument(0) final ChannelFuture future) { + public static ContextScope activateScope(@Advice.Argument(0) final ChannelFuture future) { /* Idea here is: - To return scope only if we have captured it. @@ -86,16 +85,16 @@ public static AgentScope activateScope(@Advice.Argument(0) final ChannelFuture f if (cause == null) { return null; } - final AgentScope.Continuation continuation = + final ContextContinuation continuation = future.channel().attr(CONNECT_PARENT_CONTINUATION_ATTRIBUTE_KEY).getAndRemove(); if (continuation == null) { return null; } - final AgentScope parentScope = continuation.activate(); + final ContextScope parentScope = continuation.resume(); final AgentSpan errorSpan = startSpan("netty", NETTY_CONNECT).setTag(Tags.COMPONENT, "netty"); - errorSpan.context().setIntegrationName(NETTY); - try (final ContextScope scope = getCurrentContext().with(errorSpan).attach()) { + errorSpan.spanContext().setIntegrationName(NETTY); + try (final ContextScope scope = errorSpan.attachWithContext()) { NettyHttpServerDecorator.DECORATE.onError(errorSpan, cause); NettyHttpServerDecorator.DECORATE.beforeFinish(scope.context()); errorSpan.finish(); @@ -105,7 +104,7 @@ public static AgentScope activateScope(@Advice.Argument(0) final ChannelFuture f } @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) - public static void deactivateScope(@Advice.Enter final AgentScope scope) { + public static void deactivateScope(@Advice.Enter final ContextScope scope) { if (scope != null) { scope.close(); } diff --git a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/Http2ConnectContinuationListener.java b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/Http2ConnectContinuationListener.java new file mode 100644 index 00000000000..c7709e3c39f --- /dev/null +++ b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/Http2ConnectContinuationListener.java @@ -0,0 +1,34 @@ +package datadog.trace.instrumentation.netty41; + +import static datadog.trace.instrumentation.netty41.AttributeKeys.CONNECT_PARENT_CONTINUATION_ATTRIBUTE_KEY; + +import datadog.context.ContextContinuation; +import io.netty.channel.Channel; +import io.netty.channel.ChannelFuture; +import io.netty.channel.ChannelFutureListener; + +public final class Http2ConnectContinuationListener implements ChannelFutureListener { + public static final ChannelFutureListener INSTANCE = new Http2ConnectContinuationListener(); + + private Http2ConnectContinuationListener() {} + + @Override + public void operationComplete(final ChannelFuture future) { + if (future.isSuccess() || future.isCancelled()) { + cancel(future.channel()); + } + // Failed connects are left for ChannelFutureListenerInstrumentation, which creates the + // netty.connect error span under this continuation. + } + + public static void cancel(final Channel channel) { + if (channel == null) { + return; + } + final ContextContinuation continuation = + channel.attr(CONNECT_PARENT_CONTINUATION_ATTRIBUTE_KEY).getAndRemove(); + if (continuation != null) { + continuation.release(); + } + } +} diff --git a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/HttpPostRequestDecoderInstrumentation.java b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/HttpPostRequestDecoderInstrumentation.java index 029d6444c82..60b98472c82 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/HttpPostRequestDecoderInstrumentation.java +++ b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/HttpPostRequestDecoderInstrumentation.java @@ -80,7 +80,7 @@ public void methodAdvice(MethodTransformer transformer) { @RequiresRequestContext(RequestContextSlot.APPSEC) static class ParseBodyAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.This InterfaceHttpPostRequestDecoder thiz, @Advice.FieldValue("currentStatus") Enum currentStatus, diff --git a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/NettyChannelHandlerContextInstrumentation.java b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/NettyChannelHandlerContextInstrumentation.java index 62363fda0cc..da93dff0081 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/NettyChannelHandlerContextInstrumentation.java +++ b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/NettyChannelHandlerContextInstrumentation.java @@ -5,7 +5,6 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopScope; import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.netty41.AttributeKeys.CONTEXT_ATTRIBUTE_KEY; import static datadog.trace.instrumentation.netty41.NettyChannelPipelineInstrumentation.ADDITIONAL_INSTRUMENTATION_NAMES; @@ -75,14 +74,16 @@ public static AgentScope scopeSpan(@Advice.This final ChannelHandlerContext ctx) final AgentSpan channelSpan = spanFromContext(storedContext); if (channelSpan == null || channelSpan == activeSpan()) { // don't modify the scope - return noopScope(); + return null; } return activateSpan(channelSpan); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void close(@Advice.Enter final AgentScope scope) { - scope.close(); + if (scope != null) { + scope.close(); + } } private void muzzleCheck() { diff --git a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/NettyChannelPipelineInstrumentation.java b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/NettyChannelPipelineInstrumentation.java index 2cff8969ddc..a1ceb822132 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/NettyChannelPipelineInstrumentation.java +++ b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/NettyChannelPipelineInstrumentation.java @@ -5,19 +5,20 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.namedOneOf; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.captureActiveSpan; -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopContinuation; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static datadog.trace.instrumentation.netty41.AttributeKeys.CONNECT_PARENT_CONTINUATION_ATTRIBUTE_KEY; +import static datadog.trace.instrumentation.netty41.AttributeKeys.HTTP2_CONNECTION_CODEC_ATTRIBUTE_KEY; import static net.bytebuddy.matcher.ElementMatchers.isMethod; import static net.bytebuddy.matcher.ElementMatchers.returns; import static net.bytebuddy.matcher.ElementMatchers.takesArgument; import com.google.auto.service.AutoService; +import datadog.context.ContextContinuation; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.agent.tooling.annotation.AppliesOn; import datadog.trace.api.InstrumenterConfig; import datadog.trace.bootstrap.CallDepthThreadLocalMap; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.instrumentation.netty41.client.HttpClientRequestTracingHandler; import datadog.trace.instrumentation.netty41.client.HttpClientResponseTracingHandler; import datadog.trace.instrumentation.netty41.client.HttpClientTracingHandler; @@ -29,6 +30,7 @@ import datadog.trace.instrumentation.netty41.server.websocket.WebSocketServerInboundTracingHandler; import datadog.trace.instrumentation.netty41.server.websocket.WebSocketServerOutboundTracingHandler; import datadog.trace.instrumentation.netty41.server.websocket.WebSocketServerTracingHandler; +import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelPipeline; import io.netty.handler.codec.http.HttpClientCodec; @@ -90,6 +92,7 @@ public String[] helperClassNames() { packageName + ".server.websocket.WebSocketServerTracingHandler", packageName + ".server.websocket.WebSocketServerOutboundTracingHandler", packageName + ".server.websocket.WebSocketServerInboundTracingHandler", + packageName + ".Http2ConnectContinuationListener", packageName + ".NettyHttp2Helper", packageName + ".NettyPipelineHelper", }; @@ -175,6 +178,9 @@ public static void addHandler( handler2 instanceof ChannelHandler ? (ChannelHandler) handler2 : handler3; try { + if (NettyHttp2Helper.isHttp2ConnectionCodec(handler)) { + pipeline.channel().attr(HTTP2_CONNECTION_CODEC_ATTRIBUTE_KEY).set(Boolean.TRUE); + } // Server pipeline handlers if (handler instanceof HttpServerCodec) { NettyPipelineHelper.addHandlerAfter( @@ -249,14 +255,33 @@ else if (handler instanceof HttpClientCodec) { public static class ConnectAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) - public static void addParentSpan(@Advice.This final ChannelPipeline pipeline) { - AgentScope.Continuation continuation = captureActiveSpan(); - if (continuation != noopContinuation()) { - final Attribute attribute = + public static boolean addParentSpan(@Advice.This final ChannelPipeline pipeline) { + ContextContinuation continuation = captureActiveSpan(); + if (continuation.context() != rootContext()) { + final Attribute attribute = pipeline.channel().attr(CONNECT_PARENT_CONTINUATION_ATTRIBUTE_KEY); if (!attribute.compareAndSet(null, continuation)) { - continuation.cancel(); + continuation.release(); + return false; } + return Boolean.TRUE.equals( + pipeline.channel().attr(HTTP2_CONNECTION_CODEC_ATTRIBUTE_KEY).get()); + } + return false; + } + + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + public static void cleanupHttp2ConnectParentContinuation( + @Advice.Enter final boolean cleanupHttp2Continuation, + @Advice.This final ChannelPipeline pipeline, + @Advice.Return final ChannelFuture future) { + if (!cleanupHttp2Continuation) { + return; + } + if (future == null) { + Http2ConnectContinuationListener.cancel(pipeline.channel()); + } else { + future.addListener(Http2ConnectContinuationListener.INSTANCE); } } } diff --git a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/NettyHttp2Helper.java b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/NettyHttp2Helper.java index 327a48b02a6..ba2761c8d7a 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/NettyHttp2Helper.java +++ b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/NettyHttp2Helper.java @@ -9,12 +9,14 @@ import org.slf4j.LoggerFactory; public class NettyHttp2Helper { - private static final Class HTTP2_CODEC_CLS; + private static final Class HTTP2_STREAM_FRAME_CODEC_CLS; + private static final Class HTTP2_CONNECTION_CODEC_CLS; private static final MethodHandle IS_SERVER_FIELD; private static final Logger LOGGER = LoggerFactory.getLogger(NettyHttp2Helper.class); static { Class codecClass; + Class frameCodecClass; MethodHandle isServerField; try { codecClass = @@ -38,12 +40,31 @@ public class NettyHttp2Helper { isServerField = null; LOGGER.debug("Unable to setup netty http2 instrumentation", t); } - HTTP2_CODEC_CLS = codecClass; + try { + frameCodecClass = + Class.forName( + "io.netty.handler.codec.http2.Http2FrameCodec", + false, + NettyHttp2Helper.class.getClassLoader()); + } catch (final ClassNotFoundException cnfe) { + // can be expected + frameCodecClass = null; + } catch (Throwable t) { + // unexpected + frameCodecClass = null; + LOGGER.debug("Unable to setup netty http2 connection detection", t); + } + HTTP2_STREAM_FRAME_CODEC_CLS = codecClass; + HTTP2_CONNECTION_CODEC_CLS = frameCodecClass; IS_SERVER_FIELD = isServerField; } public static boolean isHttp2FrameCodec(final ChannelHandler handler) { - return HTTP2_CODEC_CLS != null && HTTP2_CODEC_CLS.isInstance(handler); + return HTTP2_STREAM_FRAME_CODEC_CLS != null && HTTP2_STREAM_FRAME_CODEC_CLS.isInstance(handler); + } + + public static boolean isHttp2ConnectionCodec(final ChannelHandler handler) { + return HTTP2_CONNECTION_CODEC_CLS != null && HTTP2_CONNECTION_CODEC_CLS.isInstance(handler); } public static boolean isServer(final ChannelHandler handler) { diff --git a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/NettyMultipartHelper.java b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/NettyMultipartHelper.java index b268216f2aa..95a0c6292e7 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/NettyMultipartHelper.java +++ b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/NettyMultipartHelper.java @@ -33,8 +33,15 @@ public static RuntimeException collectBodyData( List filesContent) { RuntimeException exc = null; for (InterfaceHttpData data : parts) { - if (attributes != null - && data.getHttpDataType() == InterfaceHttpData.HttpDataType.Attribute) { + InterfaceHttpData.HttpDataType dataType; + try { + dataType = data.getHttpDataType(); + } catch (UnsupportedOperationException ignored) { + // Some framework-specific implementations (e.g. Vert.x NettyFileUpload) do not support + // getHttpDataType() - skip them; their framework's own instrumentation handles them. + continue; + } + if (attributes != null && dataType == InterfaceHttpData.HttpDataType.Attribute) { String name = data.getName(); List values = attributes.get(name); if (values == null) { @@ -45,7 +52,7 @@ public static RuntimeException collectBodyData( } catch (IOException e) { exc = new UndeclaredThrowableException(e); } - } else if (data.getHttpDataType() == InterfaceHttpData.HttpDataType.FileUpload) { + } else if (dataType == InterfaceHttpData.HttpDataType.FileUpload) { FileUpload fileUpload = (FileUpload) data; String filename = fileUpload.getFilename(); if (filenames != null && filename != null && !filename.isEmpty()) { diff --git a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/client/HttpClientRequestTracingHandler.java b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/client/HttpClientRequestTracingHandler.java index 6c35a87edbb..47134f4a0cf 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/client/HttpClientRequestTracingHandler.java +++ b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/client/HttpClientRequestTracingHandler.java @@ -1,10 +1,8 @@ package datadog.trace.instrumentation.netty41.client; -import static datadog.context.Context.current; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; import static datadog.trace.instrumentation.netty41.AttributeKeys.CLIENT_PARENT_ATTRIBUTE_KEY; import static datadog.trace.instrumentation.netty41.AttributeKeys.CONNECT_PARENT_CONTINUATION_ATTRIBUTE_KEY; import static datadog.trace.instrumentation.netty41.AttributeKeys.CONTEXT_ATTRIBUTE_KEY; @@ -15,9 +13,11 @@ import static datadog.trace.instrumentation.netty41.client.NettyResponseInjectAdapter.SETTER; import datadog.context.Context; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; import datadog.trace.api.Config; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import io.netty.channel.Channel; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; import io.netty.channel.ChannelOutboundHandlerAdapter; @@ -53,11 +53,10 @@ public void write(final ChannelHandlerContext ctx, final Object msg, final Chann return; } - AgentScope parentScope = null; - final AgentScope.Continuation continuation = - ctx.channel().attr(CONNECT_PARENT_CONTINUATION_ATTRIBUTE_KEY).getAndRemove(); + ContextScope parentScope = null; + final ContextContinuation continuation = takeConnectParentContinuation(ctx); if (continuation != null) { - parentScope = continuation.activate(); + parentScope = continuation.resume(); } final HttpRequest request = (HttpRequest) msg; @@ -80,8 +79,8 @@ public void write(final ChannelHandlerContext ctx, final Object msg, final Chann NettyHttpClientDecorator decorate = isSecure ? DECORATE_SECURE : DECORATE; final AgentSpan span = startSpan(NETTY_CLIENT.toString(), NETTY_CLIENT_REQUEST); - final Context context = getCurrentContext().with(span); - try (final AgentScope scope = activateSpan(span)) { + final Context context = Context.current().with(span); + try (final ContextScope scope = activateSpan(span)) { decorate.afterStart(span); decorate.onRequest(span, request); @@ -92,7 +91,7 @@ public void write(final ChannelHandlerContext ctx, final Object msg, final Chann // AWS calls are often signed, so we can't add headers without breaking the signature. if (!awsClientCall) { - DECORATE.injectContext(current(), request.headers(), SETTER); + DECORATE.injectContext(Context.current(), request.headers(), SETTER); } ctx.channel().attr(CONTEXT_ATTRIBUTE_KEY).set(context); @@ -111,4 +110,16 @@ public void write(final ChannelHandlerContext ctx, final Object msg, final Chann } } } + + private static ContextContinuation takeConnectParentContinuation( + final ChannelHandlerContext ctx) { + final Channel channel = ctx.channel(); + ContextContinuation continuation = + channel.attr(CONNECT_PARENT_CONTINUATION_ATTRIBUTE_KEY).getAndRemove(); + if (continuation == null && channel.parent() != null) { + continuation = + channel.parent().attr(CONNECT_PARENT_CONTINUATION_ATTRIBUTE_KEY).getAndRemove(); + } + return continuation; + } } diff --git a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/client/HttpClientResponseTracingHandler.java b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/client/HttpClientResponseTracingHandler.java index a1973706338..b80f967a3fb 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/client/HttpClientResponseTracingHandler.java +++ b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/client/HttpClientResponseTracingHandler.java @@ -2,13 +2,12 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.netty41.AttributeKeys.CLIENT_PARENT_ATTRIBUTE_KEY; import static datadog.trace.instrumentation.netty41.AttributeKeys.CONTEXT_ATTRIBUTE_KEY; import static datadog.trace.instrumentation.netty41.client.NettyHttpClientDecorator.DECORATE; import datadog.context.Context; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import io.netty.channel.ChannelHandler; import io.netty.channel.ChannelHandlerContext; @@ -29,7 +28,7 @@ public void channelRead(final ChannelHandlerContext ctx, final Object msg) { parentAttr.setIfAbsent(noopSpan()); final AgentSpan parent = parentAttr.get(); final Context storedContext = ctx.channel().attr(CONTEXT_ATTRIBUTE_KEY).get(); - final AgentSpan span = spanFromContext(storedContext); + final AgentSpan span = AgentSpan.fromContext(storedContext); // Set parent context back to maintain the same functionality as getAndSet(parent) if (storedContext != null) { @@ -43,7 +42,7 @@ public void channelRead(final ChannelHandlerContext ctx, final Object msg) { || "websocket" .equals(((HttpResponse) msg).headers().get(HttpHeaderNames.UPGRADE))); if (finishSpan) { - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { DECORATE.onResponse(span, (HttpResponse) msg); DECORATE.beforeFinish(span); span.finish(); @@ -56,7 +55,7 @@ public void channelRead(final ChannelHandlerContext ctx, final Object msg) { } // We want the callback in the scope of the parent, not the client span - try (final AgentScope scope = activateSpan(parent)) { + try (final ContextScope scope = activateSpan(parent)) { ctx.fireChannelRead(msg); } } @@ -67,7 +66,7 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws E parentAttr.setIfAbsent(noopSpan()); final AgentSpan parent = parentAttr.get(); final Context storedContext = ctx.channel().attr(CONTEXT_ATTRIBUTE_KEY).get(); - final AgentSpan span = spanFromContext(storedContext); + final AgentSpan span = AgentSpan.fromContext(storedContext); // Set parent context back to maintain the same functionality as getAndSet(parent) if (storedContext != null) { @@ -77,14 +76,14 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws E if (span != null) { // If an exception is passed to this point, it likely means it was unhandled and the // client span won't be finished with a proper response, so we should finish the span here. - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { DECORATE.onError(span, cause); DECORATE.beforeFinish(span); span.finish(); } } // We want the callback in the scope of the parent, not the client span - try (final AgentScope scope = activateSpan(parent)) { + try (final ContextScope scope = activateSpan(parent)) { super.exceptionCaught(ctx, cause); } } @@ -95,7 +94,7 @@ public void channelInactive(ChannelHandlerContext ctx) throws Exception { parentAttr.setIfAbsent(noopSpan()); final AgentSpan parent = parentAttr.get(); final Context storedContext = ctx.channel().attr(CONTEXT_ATTRIBUTE_KEY).get(); - final AgentSpan span = spanFromContext(storedContext); + final AgentSpan span = AgentSpan.fromContext(storedContext); // Set parent context back to maintain the same functionality as getAndSet(parent) if (storedContext != null) { @@ -103,13 +102,13 @@ public void channelInactive(ChannelHandlerContext ctx) throws Exception { } if (span != null && span != parent) { - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { DECORATE.beforeFinish(span); span.finish(); } } // We want the callback in the scope of the parent, not the client span - try (final AgentScope scope = activateSpan(parent)) { + try (final ContextScope scope = activateSpan(parent)) { super.channelInactive(ctx); } } diff --git a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/server/HttpServerRequestTracingHandler.java b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/server/HttpServerRequestTracingHandler.java index 251b157b22f..ce58fac2ded 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/server/HttpServerRequestTracingHandler.java +++ b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/server/HttpServerRequestTracingHandler.java @@ -1,6 +1,5 @@ package datadog.trace.instrumentation.netty41.server; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.netty41.AttributeKeys.ANALYZED_RESPONSE_KEY; import static datadog.trace.instrumentation.netty41.AttributeKeys.BLOCKED_RESPONSE_KEY; import static datadog.trace.instrumentation.netty41.AttributeKeys.CONTEXT_ATTRIBUTE_KEY; @@ -46,7 +45,7 @@ public void channelRead(final ChannelHandlerContext ctx, final Object msg) { final Context context = DECORATE.startSpan(headers, parentContext); try (final ContextScope ignored = context.attach()) { - final AgentSpan span = spanFromContext(context); + final AgentSpan span = AgentSpan.fromContext(context); DECORATE.afterStart(span); DECORATE.onRequest(span, channel, request, parentContext); @@ -90,7 +89,7 @@ public void channelInactive(ChannelHandlerContext ctx) throws Exception { } finally { try { final Context storedContext = ctx.channel().attr(CONTEXT_ATTRIBUTE_KEY).getAndRemove(); - final AgentSpan span = spanFromContext(storedContext); + final AgentSpan span = AgentSpan.fromContext(storedContext); if (span != null && span.phasedFinish()) { // at this point we can just publish this span to avoid loosing the rest of the trace span.publish(); diff --git a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/server/HttpServerResponseTracingHandler.java b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/server/HttpServerResponseTracingHandler.java index 1cf31f91eae..04d7f8893fc 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/server/HttpServerResponseTracingHandler.java +++ b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/server/HttpServerResponseTracingHandler.java @@ -1,6 +1,5 @@ package datadog.trace.instrumentation.netty41.server; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.netty41.AttributeKeys.CONTEXT_ATTRIBUTE_KEY; import static datadog.trace.instrumentation.netty41.AttributeKeys.WEBSOCKET_SENDER_HANDLER_CONTEXT; import static datadog.trace.instrumentation.netty41.server.NettyHttpServerDecorator.DECORATE; @@ -24,7 +23,7 @@ public class HttpServerResponseTracingHandler extends ChannelOutboundHandlerAdap @Override public void write(final ChannelHandlerContext ctx, final Object msg, final ChannelPromise prm) { final Context storedContext = ctx.channel().attr(CONTEXT_ATTRIBUTE_KEY).get(); - final AgentSpan span = spanFromContext(storedContext); + final AgentSpan span = AgentSpan.fromContext(storedContext); if (span == null || !(msg instanceof HttpResponse)) { ctx.write(msg, prm); diff --git a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/server/MaybeBlockResponseHandler.java b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/server/MaybeBlockResponseHandler.java index 99da41b19d6..4f79bd6aea6 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/server/MaybeBlockResponseHandler.java +++ b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/server/MaybeBlockResponseHandler.java @@ -1,6 +1,5 @@ package datadog.trace.instrumentation.netty41.server; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.netty41.AttributeKeys.ANALYZED_RESPONSE_KEY; import static datadog.trace.instrumentation.netty41.AttributeKeys.BLOCKED_RESPONSE_KEY; import static datadog.trace.instrumentation.netty41.AttributeKeys.CONTEXT_ATTRIBUTE_KEY; @@ -58,7 +57,7 @@ public void write(ChannelHandlerContext ctx, Object msg, ChannelPromise prm) thr Channel channel = ctx.channel(); Context storedContext = channel.attr(CONTEXT_ATTRIBUTE_KEY).get(); - AgentSpan span = spanFromContext(storedContext); + AgentSpan span = AgentSpan.fromContext(storedContext); RequestContext requestContext; if (span == null || (requestContext = span.getRequestContext()) == null) { super.write(ctx, msg, prm); diff --git a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/server/websocket/WebSocketServerInboundTracingHandler.java b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/server/websocket/WebSocketServerInboundTracingHandler.java index 882a826e15e..a315aa667d8 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/server/websocket/WebSocketServerInboundTracingHandler.java +++ b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/server/websocket/WebSocketServerInboundTracingHandler.java @@ -6,7 +6,7 @@ import static datadog.trace.instrumentation.netty41.AttributeKeys.WEBSOCKET_RECEIVER_HANDLER_CONTEXT; import static datadog.trace.instrumentation.netty41.AttributeKeys.WEBSOCKET_SENDER_HANDLER_CONTEXT; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.websocket.HandlerContext; import io.netty.channel.*; @@ -42,9 +42,9 @@ public void channelRead(ChannelHandlerContext ctx, Object frame) { TextWebSocketFrame textFrame = (TextWebSocketFrame) frame; final AgentSpan span = - DECORATE.onReceiveFrameStart( + DECORATE.startInboundFrameSpan( receiverContext, textFrame.text(), textFrame.isFinalFragment()); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { ctx.fireChannelRead(textFrame); // WebSocket Read Text Start } finally { @@ -60,11 +60,11 @@ public void channelRead(ChannelHandlerContext ctx, Object frame) { // WebSocket Read Binary Start BinaryWebSocketFrame binaryFrame = (BinaryWebSocketFrame) frame; final AgentSpan span = - DECORATE.onReceiveFrameStart( + DECORATE.startInboundFrameSpan( receiverContext, binaryFrame.content().nioBuffer(), binaryFrame.isFinalFragment()); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { ctx.fireChannelRead(binaryFrame); } finally { // WebSocket Read Binary End @@ -81,13 +81,13 @@ public void channelRead(ChannelHandlerContext ctx, Object frame) { ContinuationWebSocketFrame continuationWebSocketFrame = (ContinuationWebSocketFrame) frame; final AgentSpan span = - DECORATE.onReceiveFrameStart( + DECORATE.startInboundFrameSpan( receiverContext, MESSAGE_TYPE_TEXT.equals(receiverContext.getMessageType()) ? continuationWebSocketFrame.text() : continuationWebSocketFrame.content().nioBuffer(), continuationWebSocketFrame.isFinalFragment()); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { ctx.fireChannelRead(continuationWebSocketFrame); } finally { if (continuationWebSocketFrame.isFinalFragment()) { @@ -106,8 +106,8 @@ public void channelRead(ChannelHandlerContext ctx, Object frame) { channel.attr(WEBSOCKET_SENDER_HANDLER_CONTEXT).remove(); channel.attr(WEBSOCKET_RECEIVER_HANDLER_CONTEXT).remove(); final AgentSpan span = - DECORATE.onSessionCloseReceived(receiverContext, reasonText, statusCode); - try (final AgentScope scope = activateSpan(span)) { + DECORATE.startInboundCloseSpan(receiverContext, reasonText, statusCode); + try (final ContextScope scope = activateSpan(span)) { ctx.fireChannelRead(closeFrame); if (closeFrame.isFinalFragment()) { DECORATE.onFrameEnd(receiverContext); diff --git a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/server/websocket/WebSocketServerOutboundTracingHandler.java b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/server/websocket/WebSocketServerOutboundTracingHandler.java index e500c2357f5..49413fce6d4 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/server/websocket/WebSocketServerOutboundTracingHandler.java +++ b/dd-java-agent/instrumentation/netty/netty-4.1/src/main/java/datadog/trace/instrumentation/netty41/server/websocket/WebSocketServerOutboundTracingHandler.java @@ -6,7 +6,7 @@ import static datadog.trace.bootstrap.instrumentation.websocket.HandlersExtractor.MESSAGE_TYPE_TEXT; import static datadog.trace.instrumentation.netty41.AttributeKeys.WEBSOCKET_SENDER_HANDLER_CONTEXT; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.websocket.HandlerContext; import io.netty.channel.*; @@ -34,9 +34,9 @@ public void write(ChannelHandlerContext ctx, Object frame, ChannelPromise promis // WebSocket Write Text Start TextWebSocketFrame textFrame = (TextWebSocketFrame) frame; final AgentSpan span = - DECORATE.onSendFrameStart( + DECORATE.startOutboundFrameSpan( handlerContext, MESSAGE_TYPE_TEXT, textFrame.text().length()); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { ctx.write(frame, promise); } finally { // WebSocket Write Text End @@ -51,9 +51,9 @@ public void write(ChannelHandlerContext ctx, Object frame, ChannelPromise promis // WebSocket Write Binary Start BinaryWebSocketFrame binaryFrame = (BinaryWebSocketFrame) frame; final AgentSpan span = - DECORATE.onSendFrameStart( + DECORATE.startOutboundFrameSpan( handlerContext, MESSAGE_TYPE_BINARY, binaryFrame.content().readableBytes()); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { ctx.write(frame, promise); } finally { // WebSocket Write Binary End @@ -68,13 +68,13 @@ public void write(ChannelHandlerContext ctx, Object frame, ChannelPromise promis ContinuationWebSocketFrame continuationWebSocketFrame = (ContinuationWebSocketFrame) frame; final AgentSpan span = - DECORATE.onSendFrameStart( + DECORATE.startOutboundFrameSpan( handlerContext, handlerContext.getMessageType(), MESSAGE_TYPE_TEXT.equals(handlerContext.getMessageType()) ? continuationWebSocketFrame.text().length() : continuationWebSocketFrame.content().readableBytes()); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { ctx.write(frame, promise); } finally { // WebSocket Write Binary End @@ -92,8 +92,8 @@ public void write(ChannelHandlerContext ctx, Object frame, ChannelPromise promis String reasonText = closeFrame.reasonText(); channel.attr(WEBSOCKET_SENDER_HANDLER_CONTEXT).remove(); final AgentSpan span = - DECORATE.onSessionCloseIssued(handlerContext, reasonText, statusCode); - try (final AgentScope scope = activateSpan(span)) { + DECORATE.startOutboundCloseSpan(handlerContext, reasonText, statusCode); + try (final ContextScope scope = activateSpan(span)) { ctx.write(frame, promise); } finally { if (closeFrame.isFinalFragment()) { diff --git a/dd-java-agent/instrumentation/netty/netty-4.1/src/test/groovy/Netty41ClientTest.groovy b/dd-java-agent/instrumentation/netty/netty-4.1/src/test/groovy/Netty41ClientTest.groovy index 31e5349f01f..5aa21b2f9c5 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.1/src/test/groovy/Netty41ClientTest.groovy +++ b/dd-java-agent/instrumentation/netty/netty-4.1/src/test/groovy/Netty41ClientTest.groovy @@ -121,7 +121,9 @@ abstract class Netty41ClientTest extends HttpClientTest { errored true tags { "$Tags.COMPONENT" "netty" - errorTags AbstractChannel.AnnotatedConnectException, "Connection refused: /127.0.0.1:$UNUSABLE_PORT" + errorTags AbstractChannel.AnnotatedConnectException, { + it.startsWith("Connection refused") && it.endsWith("/127.0.0.1:$UNUSABLE_PORT") + } defaultTags() } } diff --git a/dd-java-agent/instrumentation/netty/netty-4.1/src/test/groovy/ReactorNettyTest.groovy b/dd-java-agent/instrumentation/netty/netty-4.1/src/test/groovy/ReactorNettyTest.groovy index 0cdc7d5f2de..c9878065038 100644 --- a/dd-java-agent/instrumentation/netty/netty-4.1/src/test/groovy/ReactorNettyTest.groovy +++ b/dd-java-agent/instrumentation/netty/netty-4.1/src/test/groovy/ReactorNettyTest.groovy @@ -14,12 +14,6 @@ import java.util.concurrent.ExecutionException import java.util.concurrent.TimeUnit class ReactorNettyTest extends HttpClientTest implements TestingNettyHttpNamingConventions.ClientV0 { - @Override - boolean useStrictTraceWrites() { - // TODO fix this by making sure that spans get closed properly - return false - } - @Override boolean testCircularRedirects() { false diff --git a/dd-java-agent/instrumentation/netty/netty-buffer-4.0/gradle.lockfile b/dd-java-agent/instrumentation/netty/netty-buffer-4.0/gradle.lockfile index 662c8305010..3004cfd359a 100644 --- a/dd-java-agent/instrumentation/netty/netty-buffer-4.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/netty/netty-buffer-4.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:netty:netty-buffer-4.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDep4TestCompileClasspath,latestDep4Test com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDep4TestAnnotationProcessor,latestDep4TestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDep4TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDep4TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDep4TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDep4TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDep4TestAnnotationProcessor,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDep4TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -48,17 +52,17 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.netty:netty-buffer:4.0.0.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-buffer:4.2.12.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath +io.netty:netty-buffer:4.2.16.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath io.netty:netty-buffer:5.0.0.Alpha2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-common:4.0.0.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-common:4.2.12.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath +io.netty:netty-common:4.2.16.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath io.netty:netty-common:5.0.0.Alpha2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,6 +91,7 @@ org.hamcrest:hamcrest-core:1.3=latestDep4TestRuntimeClasspath,latestDepTestRunti org.hamcrest:hamcrest:3.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -104,14 +109,14 @@ org.objenesis:objenesis:3.3=latestDep4TestCompileClasspath,latestDep4TestRuntime org.opentest4j:opentest4j:1.3.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/netty/netty-common/gradle.lockfile b/dd-java-agent/instrumentation/netty/netty-common/gradle.lockfile index 384cc7c4a3b..361abaacf69 100644 --- a/dd-java-agent/instrumentation/netty/netty-common/gradle.lockfile +++ b/dd-java-agent/instrumentation/netty/netty-common/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:netty:netty-common:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -53,12 +57,12 @@ io.netty:netty-codec:4.1.0.Final=compileClasspath io.netty:netty-common:4.1.0.Final=compileClasspath io.netty:netty-resolver:4.1.0.Final=compileClasspath io.netty:netty-transport:4.1.0.Final=compileClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,6 +91,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -104,14 +109,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/netty/netty-common/src/main/java/datadog/trace/instrumentation/netty41/AttributeKeys.java b/dd-java-agent/instrumentation/netty/netty-common/src/main/java/datadog/trace/instrumentation/netty41/AttributeKeys.java index 8640ae9557c..3ad2b1f9e14 100644 --- a/dd-java-agent/instrumentation/netty/netty-common/src/main/java/datadog/trace/instrumentation/netty41/AttributeKeys.java +++ b/dd-java-agent/instrumentation/netty/netty-common/src/main/java/datadog/trace/instrumentation/netty41/AttributeKeys.java @@ -3,8 +3,8 @@ import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; import datadog.context.Context; +import datadog.context.ContextContinuation; import datadog.trace.api.GenericClassValue; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.websocket.HandlerContext; import io.netty.handler.codec.http.HttpHeaders; @@ -23,9 +23,11 @@ public final class AttributeKeys { public static final AttributeKey CLIENT_PARENT_ATTRIBUTE_KEY = attributeKey("datadog.client.parent.span"); - public static final AttributeKey - CONNECT_PARENT_CONTINUATION_ATTRIBUTE_KEY = - attributeKey("datadog.connect.parent.continuation"); + public static final AttributeKey CONNECT_PARENT_CONTINUATION_ATTRIBUTE_KEY = + attributeKey("datadog.connect.parent.continuation"); + + public static final AttributeKey HTTP2_CONNECTION_CODEC_ATTRIBUTE_KEY = + attributeKey("datadog.http2.connection.codec"); public static final AttributeKey PARENT_CONTEXT_ATTRIBUTE_KEY = attributeKey("datadog.server.parent-context"); diff --git a/dd-java-agent/instrumentation/netty/netty-concurrent-4.0/gradle.lockfile b/dd-java-agent/instrumentation/netty/netty-concurrent-4.0/gradle.lockfile index a73968fd079..41f9b3964e2 100644 --- a/dd-java-agent/instrumentation/netty/netty-concurrent-4.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/netty/netty-concurrent-4.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:netty:netty-concurrent-4.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDep4TestCompileClasspath,latestDep4Test com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDep4TestAnnotationProcessor,latestDep4TestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDep4TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDep4TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDep4TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDep4TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDep4TestAnnotationProcessor,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDep4TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -48,13 +52,13 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.netty:netty-common:4.0.0.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-common:4.2.12.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.netty:netty-common:4.2.16.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -83,6 +87,7 @@ org.hamcrest:hamcrest-core:1.3=latestDep4TestRuntimeClasspath,latestDepTestRunti org.hamcrest:hamcrest:3.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -100,14 +105,14 @@ org.objenesis:objenesis:3.3=latestDep4TestCompileClasspath,latestDep4TestRuntime org.opentest4j:opentest4j:1.3.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/netty/netty-promise-4.0/gradle.lockfile b/dd-java-agent/instrumentation/netty/netty-promise-4.0/gradle.lockfile index b5e14b36b27..73d69dab150 100644 --- a/dd-java-agent/instrumentation/netty/netty-promise-4.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/netty/netty-promise-4.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:netty:netty-promise-4.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDep4TestCompileClasspath,latestDep4Test com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDep4TestAnnotationProcessor,latestDep4TestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDep4TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDep4TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDep4TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDep4TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDep4TestAnnotationProcessor,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDep4TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -48,14 +52,14 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.netty:netty-common:4.0.0.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-common:4.2.12.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath +io.netty:netty-common:4.2.16.Final=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath io.netty:netty-common:5.0.0.Alpha2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -84,6 +88,7 @@ org.hamcrest:hamcrest-core:1.3=latestDep4TestRuntimeClasspath,latestDepTestRunti org.hamcrest:hamcrest:3.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -101,14 +106,14 @@ org.objenesis:objenesis:3.3=latestDep4TestCompileClasspath,latestDep4TestRuntime org.opentest4j:opentest4j:1.3.0=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDep4TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDep4TestCompileClasspath,latestDep4TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/netty/netty-promise-4.0/src/main/java/datadog/trace/instrumentation/netty4/promise/ListenerWrapper.java b/dd-java-agent/instrumentation/netty/netty-promise-4.0/src/main/java/datadog/trace/instrumentation/netty4/promise/ListenerWrapper.java index f0cffb08460..3b2d2ee4a8e 100644 --- a/dd-java-agent/instrumentation/netty/netty-promise-4.0/src/main/java/datadog/trace/instrumentation/netty4/promise/ListenerWrapper.java +++ b/dd-java-agent/instrumentation/netty/netty-promise-4.0/src/main/java/datadog/trace/instrumentation/netty4/promise/ListenerWrapper.java @@ -1,10 +1,10 @@ package datadog.trace.instrumentation.netty4.promise; -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.captureActiveSpan; -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopContinuation; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.Context; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; import io.netty.util.concurrent.Future; import io.netty.util.concurrent.GenericFutureListener; import io.netty.util.concurrent.GenericProgressiveFutureListener; @@ -16,8 +16,8 @@ public static GenericFutureListener wrapIfNeeded(final GenericFutureListener lis if (listener == null || listener instanceof GenericWrapper) { return listener; } - AgentScope.Continuation continuation = captureActiveSpan(); - if (continuation == noopContinuation()) { + ContextContinuation continuation = captureActiveSpan(); + if (continuation.context() == Context.root()) { return listener; } if (listener instanceof GenericProgressiveFutureListener) { @@ -30,17 +30,17 @@ public static GenericFutureListener wrapIfNeeded(final GenericFutureListener lis private static class GenericWrapper> implements GenericFutureListener { private final GenericFutureListener listener; - final AgentScope.Continuation continuation; + final ContextContinuation continuation; public GenericWrapper( - final GenericFutureListener listener, AgentScope.Continuation continuation) { + final GenericFutureListener listener, ContextContinuation continuation) { this.listener = listener; this.continuation = continuation; } @Override public void operationComplete(T future) throws Exception { - try (AgentScope scope = continuation.activate()) { + try (ContextScope scope = continuation.resume()) { listener.operationComplete(future); } } @@ -52,7 +52,7 @@ private static class GenericProgressiveWrapper> private final GenericProgressiveFutureListener listener; public GenericProgressiveWrapper( - GenericProgressiveFutureListener listener, AgentScope.Continuation continuation) { + GenericProgressiveFutureListener listener, ContextContinuation continuation) { super(listener, continuation); this.listener = listener; } @@ -60,7 +60,7 @@ public GenericProgressiveWrapper( @Override public void operationProgressed(S future, long progress, long total) throws Exception { // not yet complete, not ready to do final activation of continuation - try (AgentScope scope = activateSpan(continuation.span())) { + try (ContextScope scope = continuation.context().attach()) { listener.operationProgressed(future, progress, total); } } diff --git a/dd-java-agent/instrumentation/ognl-appsec-3.3.2/gradle.lockfile b/dd-java-agent/instrumentation/ognl-appsec-3.3.2/gradle.lockfile index 757794ea261..3bdc565f997 100644 --- a/dd-java-agent/instrumentation/ognl-appsec-3.3.2/gradle.lockfile +++ b/dd-java-agent/instrumentation/ognl-appsec-3.3.2/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:ognl-appsec-3.3.2:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -83,6 +87,7 @@ org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.javassist:javassist:3.28.0-GA=compileClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -100,14 +105,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/ognl-appsec-3.3.2/src/main/java/datadog/trace/instrumentation/ognl/OgnlInstrumentation.java b/dd-java-agent/instrumentation/ognl-appsec-3.3.2/src/main/java/datadog/trace/instrumentation/ognl/OgnlInstrumentation.java index 32978abf35d..031ecd4982a 100644 --- a/dd-java-agent/instrumentation/ognl-appsec-3.3.2/src/main/java/datadog/trace/instrumentation/ognl/OgnlInstrumentation.java +++ b/dd-java-agent/instrumentation/ognl-appsec-3.3.2/src/main/java/datadog/trace/instrumentation/ognl/OgnlInstrumentation.java @@ -41,7 +41,7 @@ static void before(@Advice.Argument(0) String expression) { return; } - AgentSpan agentSpan = startSpan("ognl", "ognl.parse", parentSpan.context()); + AgentSpan agentSpan = startSpan("ognl", "ognl.parse", parentSpan.spanContext()); agentSpan.setTag("ognl.expression", expression); agentSpan.finish(); } diff --git a/dd-java-agent/instrumentation/ognl-appsec-3.3.2/src/test/groovy/datadog/trace/instrumentation/ognl/OgnlInstrumentationSpec.groovy b/dd-java-agent/instrumentation/ognl-appsec-3.3.2/src/test/groovy/datadog/trace/instrumentation/ognl/OgnlInstrumentationSpec.groovy index 16282c29911..d2d77722b24 100644 --- a/dd-java-agent/instrumentation/ognl-appsec-3.3.2/src/test/groovy/datadog/trace/instrumentation/ognl/OgnlInstrumentationSpec.groovy +++ b/dd-java-agent/instrumentation/ognl-appsec-3.3.2/src/test/groovy/datadog/trace/instrumentation/ognl/OgnlInstrumentationSpec.groovy @@ -8,7 +8,7 @@ import ognl.Ognl class OgnlInstrumentationSpec extends InstrumentationSpecification { void 'creates a new span for ognl parsing expressions'() { when: - AgentSpan span = AgentTracer.get().buildSpan("top-span").start() + AgentSpan span = AgentTracer.get().buildSpan("ognl", "top-span").start() def ognlExpr AgentTracer.activateSpan(span).withCloseable { ognlExpr = Ognl.parseExpression('foo') diff --git a/dd-java-agent/instrumentation/okhttp/okhttp-2.2/gradle.lockfile b/dd-java-agent/instrumentation/okhttp/okhttp-2.2/gradle.lockfile index 064be18522f..39f2cbc9409 100644 --- a/dd-java-agent/instrumentation/okhttp/okhttp-2.2/gradle.lockfile +++ b/dd-java-agent/instrumentation/okhttp/okhttp-2.2/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:okhttp:okhttp-2.2:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -50,12 +54,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -84,6 +88,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -101,14 +106,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/okhttp/okhttp-2.2/src/main/java/datadog/trace/instrumentation/okhttp2/TracingInterceptor.java b/dd-java-agent/instrumentation/okhttp/okhttp-2.2/src/main/java/datadog/trace/instrumentation/okhttp2/TracingInterceptor.java index 4a2fbb473fd..46469204281 100644 --- a/dd-java-agent/instrumentation/okhttp/okhttp-2.2/src/main/java/datadog/trace/instrumentation/okhttp2/TracingInterceptor.java +++ b/dd-java-agent/instrumentation/okhttp/okhttp-2.2/src/main/java/datadog/trace/instrumentation/okhttp2/TracingInterceptor.java @@ -10,7 +10,7 @@ import com.squareup.okhttp.Interceptor; import com.squareup.okhttp.Request; import com.squareup.okhttp.Response; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.io.IOException; @@ -19,7 +19,7 @@ public class TracingInterceptor implements Interceptor { public Response intercept(final Chain chain) throws IOException { final AgentSpan span = startSpan("okhttp", OKHTTP_REQUEST); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { DECORATE.afterStart(span); DECORATE.onRequest(span, chain.request()); diff --git a/dd-java-agent/instrumentation/okhttp/okhttp-3.0/gradle.lockfile b/dd-java-agent/instrumentation/okhttp/okhttp-3.0/gradle.lockfile index 242b0c9bcab..c61592e97f5 100644 --- a/dd-java-agent/instrumentation/okhttp/okhttp-3.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/okhttp/okhttp-3.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:okhttp:okhttp-3.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath @@ -49,12 +53,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -83,6 +87,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -100,14 +105,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/okhttp/okhttp-3.0/src/main/java/datadog/trace/instrumentation/okhttp3/TracingInterceptor.java b/dd-java-agent/instrumentation/okhttp/okhttp-3.0/src/main/java/datadog/trace/instrumentation/okhttp3/TracingInterceptor.java index ee8e04362b5..0246a81f531 100644 --- a/dd-java-agent/instrumentation/okhttp/okhttp-3.0/src/main/java/datadog/trace/instrumentation/okhttp3/TracingInterceptor.java +++ b/dd-java-agent/instrumentation/okhttp/okhttp-3.0/src/main/java/datadog/trace/instrumentation/okhttp3/TracingInterceptor.java @@ -7,7 +7,7 @@ import static datadog.trace.instrumentation.okhttp3.OkHttpClientDecorator.OKHTTP_REQUEST; import static datadog.trace.instrumentation.okhttp3.RequestBuilderInjectAdapter.SETTER; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.io.IOException; import okhttp3.Interceptor; @@ -23,7 +23,7 @@ public Response intercept(final Chain chain) throws IOException { final AgentSpan span = startSpan("okhttp", OKHTTP_REQUEST); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { DECORATE.afterStart(span); DECORATE.onRequest(span, chain.request()); diff --git a/dd-java-agent/instrumentation/openai-java/openai-java-3.0/gradle.lockfile b/dd-java-agent/instrumentation/openai-java/openai-java-3.0/gradle.lockfile index 6dad7e6e792..bb7d2deaa2c 100644 --- a/dd-java-agent/instrumentation/openai-java/openai-java-3.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/openai-java/openai-java-3.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:openai-java:openai-java-3.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,testCompileClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -21,15 +22,15 @@ com.fasterxml.jackson.module:jackson-module-kotlin:2.18.2=latestDepTestRuntimeCl com.fasterxml.jackson:jackson-bom:2.18.2=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml:classmate:1.7.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.github.victools:jsonschema-generator:4.38.0=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -41,23 +42,26 @@ com.google.auto:auto-common:1.2.1=annotationProcessor,latestDepTestAnnotationPro com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.errorprone:error_prone_annotations:2.33.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.33.0=compileClasspath com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.openai:openai-java-client-okhttp:3.0.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.openai:openai-java-client-okhttp:4.33.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.openai:openai-java-client-okhttp:4.41.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.openai:openai-java-core:3.0.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.openai:openai-java-core:4.33.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.openai:openai-java-core:4.41.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.openai:openai-java:3.0.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.openai:openai-java:4.33.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.openai:openai-java:4.41.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,testCompileClasspath -com.squareup.okhttp3:logging-interceptor:4.12.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath +com.squareup.okhttp3:logging-interceptor:4.12.0=testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,testCompileClasspath com.squareup.okhttp3:okhttp:4.12.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.okio:okio-jvm:3.6.0=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -69,13 +73,13 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath io.swagger.core.v3:swagger-annotations:2.2.31=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -117,6 +121,7 @@ org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10=latestDepTestRuntimeClasspath,tes org.jetbrains.kotlin:kotlin-stdlib:1.8.0=compileClasspath,latestDepTestCompileClasspath,testCompileClasspath org.jetbrains.kotlin:kotlin-stdlib:1.9.10=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:13.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -134,14 +139,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/openai-java/openai-java-3.0/src/main/java/datadog/trace/instrumentation/openai_java/CommonTags.java b/dd-java-agent/instrumentation/openai-java/openai-java-3.0/src/main/java/datadog/trace/instrumentation/openai_java/CommonTags.java index a992c85400c..af206ac341d 100644 --- a/dd-java-agent/instrumentation/openai-java/openai-java-3.0/src/main/java/datadog/trace/instrumentation/openai_java/CommonTags.java +++ b/dd-java-agent/instrumentation/openai-java/openai-java-3.0/src/main/java/datadog/trace/instrumentation/openai_java/CommonTags.java @@ -30,6 +30,7 @@ interface CommonTags { String ENV = TAG_PREFIX + "env"; String SERVICE = TAG_PREFIX + "service"; String PARENT_ID = TAG_PREFIX + "parent_id"; + String SESSION_ID = TAG_PREFIX + LLMObsTags.SESSION_ID; String TOOL_DEFINITIONS = TAG_PREFIX + "tool_definitions"; diff --git a/dd-java-agent/instrumentation/openai-java/openai-java-3.0/src/main/java/datadog/trace/instrumentation/openai_java/OpenAiDecorator.java b/dd-java-agent/instrumentation/openai-java/openai-java-3.0/src/main/java/datadog/trace/instrumentation/openai_java/OpenAiDecorator.java index 83a2971953f..3431de4302c 100644 --- a/dd-java-agent/instrumentation/openai-java/openai-java-3.0/src/main/java/datadog/trace/instrumentation/openai_java/OpenAiDecorator.java +++ b/dd-java-agent/instrumentation/openai-java/openai-java-3.0/src/main/java/datadog/trace/instrumentation/openai_java/OpenAiDecorator.java @@ -92,7 +92,7 @@ protected CharSequence component() { } @Override - public AgentSpan afterStart(AgentSpan span) { + public void afterStart(AgentSpan span) { if (llmObsEnabled) { // set global dd_tags as base layer so UST and span-level tags can override them for (Map.Entry entry : Config.get().getGlobalTags().entrySet()) { @@ -115,12 +115,22 @@ public AgentSpan afterStart(AgentSpan span) { parentSpanId = String.valueOf(parent.getSpanId()); } span.setTag(CommonTags.PARENT_ID, parentSpanId); + + // Inherit session_id from the active LLMObs parent (e.g. a manual workflow span). + // Matches dd-trace-py / dd-trace-js, where auto-instrumented LLM spans inherit + // session_id from the workflow root via context propagation. Without this, the + // auto-instrumented openai.request span would not appear under its session in + // the LLM Trace Explorer's Sessions view. + String sessionId = LLMObsContext.currentSessionId(); + if (sessionId != null && !sessionId.isEmpty()) { + span.setTag(CommonTags.SESSION_ID, sessionId); + } } - return super.afterStart(span); + super.afterStart(span); } @Override - public AgentSpan beforeFinish(AgentSpan span) { + public void beforeFinish(AgentSpan span) { if (llmObsEnabled) { span.setTag(CommonTags.ERROR, span.isError() ? 1 : 0); span.setTag(CommonTags.ERROR_TYPE, span.getTag(DDTags.ERROR_TYPE)); @@ -133,7 +143,7 @@ public AgentSpan beforeFinish(AgentSpan span) { .recordSpanFinished(INTEGRATION, spanKind, isRootSpan, true, span.isError(), false); } } - return super.beforeFinish(span); + super.beforeFinish(span); } public void withHttpResponse(AgentSpan span, Headers headers) { diff --git a/dd-java-agent/instrumentation/openai-java/openai-java-3.0/src/test/groovy/OpenAiTest.groovy b/dd-java-agent/instrumentation/openai-java/openai-java-3.0/src/test/groovy/OpenAiTest.groovy index b23ef80aeb3..4dbc4e9c05a 100644 --- a/dd-java-agent/instrumentation/openai-java/openai-java-3.0/src/test/groovy/OpenAiTest.groovy +++ b/dd-java-agent/instrumentation/openai-java/openai-java-3.0/src/test/groovy/OpenAiTest.groovy @@ -1,4 +1,5 @@ -import com.google.common.base.Charsets +import static java.nio.charset.StandardCharsets.UTF_8 + import com.google.common.base.Strings import com.openai.client.OpenAIClient import com.openai.client.okhttp.OkHttpClient @@ -42,6 +43,7 @@ abstract class OpenAiTest extends InstrumentationSpecification { // openai token - will use real openai backend and record request/responses to use later in the mock mode // empty or null - will use mockOpenAiBackend and read recorded request/responses static final String OPENAI_TOKEN = "" + static final String MOCK_OPENAI_TOKEN = "mock-openai-token" private static final Path RECORDS_DIR = Paths.get("src/test/resources/http-records") private static final String API_VERSION = "v1" @@ -60,7 +62,7 @@ abstract class OpenAiTest extends InstrumentationSpecification { handlers { prefix("/$API_VERSION/") { def requestBody = request.text - def recFile = RequestResponseRecord.requestToFileName("POST", requestBody.getBytes(Charsets.UTF_8)) + def recFile = RequestResponseRecord.requestToFileName("POST", requestBody.getBytes(UTF_8)) def rec = cache.get(recFile) if (rec == null) { String path = request.path @@ -94,7 +96,7 @@ abstract class OpenAiTest extends InstrumentationSpecification { OpenAIOkHttpClient.Builder b = OpenAIOkHttpClient.builder() openAiBaseApi = "${mockOpenAiBackend.address.toURL()}/$API_VERSION" b.baseUrl(openAiBaseApi) - b.credential(BearerTokenCredential.create("")) + b.credential(BearerTokenCredential.create(MOCK_OPENAI_TOKEN)) openAiClient = b.build() } else { // real openai backend, with custom httpClient to capture and save request/response records diff --git a/dd-java-agent/instrumentation/openai-java/openai-java-3.0/src/test/groovy/ResponseServiceTest.groovy b/dd-java-agent/instrumentation/openai-java/openai-java-3.0/src/test/groovy/ResponseServiceTest.groovy index 1c11808cd33..51b770f704b 100644 --- a/dd-java-agent/instrumentation/openai-java/openai-java-3.0/src/test/groovy/ResponseServiceTest.groovy +++ b/dd-java-agent/instrumentation/openai-java/openai-java-3.0/src/test/groovy/ResponseServiceTest.groovy @@ -353,7 +353,7 @@ class ResponseServiceTest extends OpenAiTest { } def errorClient = OpenAIOkHttpClient.builder() .baseUrl("${errorBackend.address.toURL()}/v1") - .credential(BearerTokenCredential.create("")) + .credential(BearerTokenCredential.create(MOCK_OPENAI_TOKEN)) .maxRetries(0) .build() diff --git a/dd-java-agent/instrumentation/openai-java/openai-java-3.0/src/test/java/datadog/trace/instrumentation/openai_java/SessionIdPropagationForkedTest.java b/dd-java-agent/instrumentation/openai-java/openai-java-3.0/src/test/java/datadog/trace/instrumentation/openai_java/SessionIdPropagationForkedTest.java new file mode 100644 index 00000000000..ee13fa9bef0 --- /dev/null +++ b/dd-java-agent/instrumentation/openai-java/openai-java-3.0/src/test/java/datadog/trace/instrumentation/openai_java/SessionIdPropagationForkedTest.java @@ -0,0 +1,129 @@ +package datadog.trace.instrumentation.openai_java; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; + +import com.openai.client.OpenAIClient; +import com.openai.client.okhttp.OpenAIOkHttpClient; +import com.openai.credential.BearerTokenCredential; +import com.openai.models.ChatModel; +import com.openai.models.chat.completions.ChatCompletionCreateParams; +import com.sun.net.httpserver.HttpServer; +import datadog.context.ContextScope; +import datadog.trace.agent.test.AbstractInstrumentationTest; +import datadog.trace.api.llmobs.LLMObsContext; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import datadog.trace.core.DDSpan; +import datadog.trace.test.junit.utils.config.WithConfig; +import java.io.IOException; +import java.net.InetSocketAddress; +import java.util.List; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +/** + * Verifies that auto-instrumented openai.request spans inherit session_id from an active LLMObs + * parent context. Forked + @WithConfig used together so the LLMObs system property is in place + * before the agent installs and there's no leakage from prior test state. + * + *

      The mock OpenAI backend returns a minimal 200 response — the test asserts on the span tag set + * by OpenAiDecorator.afterStart(), which runs before the HTTP response is parsed, so the response + * body shape doesn't matter for what's being tested. + */ +@WithConfig(key = "llmobs.enabled", value = "true") +class SessionIdPropagationForkedTest extends AbstractInstrumentationTest { + + private static HttpServer mockServer; + private static OpenAIClient openAiClient; + + @BeforeAll + static void setupMockOpenAi() throws IOException { + mockServer = HttpServer.create(new InetSocketAddress("localhost", 0), 0); + mockServer.createContext( + "/v1/", + exchange -> { + exchange.sendResponseHeaders(200, -1); + exchange.close(); + }); + mockServer.start(); + + openAiClient = + OpenAIOkHttpClient.builder() + .baseUrl( + "http://" + + mockServer.getAddress().getHostString() + + ":" + + mockServer.getAddress().getPort() + + "/v1") + .credential(BearerTokenCredential.create("")) + .build(); + } + + @AfterAll + static void tearDownMockOpenAi() { + if (mockServer != null) { + mockServer.stop(0); + mockServer = null; + } + openAiClient = null; + } + + @Test + void openAiRequestSpanInheritsSessionIdFromActiveContext() throws Exception { + String expectedSessionId = "session-propagation-test-abc"; + + AgentSpan parentSpan = AgentTracer.startSpan("test", "parent"); + try (ContextScope ignored1 = AgentTracer.activateSpan(parentSpan)) { + try (ContextScope ignored2 = + LLMObsContext.attach(parentSpan.spanContext(), expectedSessionId)) { + try { + openAiClient.chat().completions().create(buildMinimalChatParams()); + } catch (Exception ignored) { + // Mock server returns no body — the SDK may throw on parse. The span we care about + // is already created by the instrumentation advice before this point. + } + } + } finally { + parentSpan.finish(); + } + + writer.waitForTraces(1); + DDSpan openAiSpan = findSpanByOperationName(writer, "openai.request"); + assertNotNull(openAiSpan, "openai.request span should have been created"); + assertEquals(expectedSessionId, openAiSpan.getTag("_ml_obs_tag.session_id")); + } + + @Test + void openAiRequestSpanHasNoSessionIdWhenNoLlmObsContext() throws Exception { + try { + openAiClient.chat().completions().create(buildMinimalChatParams()); + } catch (Exception ignored) { + // Mock server returns no body — the SDK may throw on parse. The span we care about + // is already created by the instrumentation advice before this point. + } + + writer.waitForTraces(1); + DDSpan openAiSpan = findSpanByOperationName(writer, "openai.request"); + assertNotNull(openAiSpan, "openai.request span should have been created"); + assertNull(openAiSpan.getTag("_ml_obs_tag.session_id")); + } + + private static ChatCompletionCreateParams buildMinimalChatParams() { + return ChatCompletionCreateParams.builder() + .model(ChatModel.GPT_4O_MINI) + .addSystemMessage("") + .addUserMessage("") + .build(); + } + + private static DDSpan findSpanByOperationName(List> traces, String operationName) { + return traces.stream() + .flatMap(List::stream) + .filter(s -> operationName.equals(s.getOperationName().toString())) + .findFirst() + .orElse(null); + } +} diff --git a/dd-java-agent/instrumentation/opensearch/opensearch-common/gradle.lockfile b/dd-java-agent/instrumentation/opensearch/opensearch-common/gradle.lockfile index 88b0caf9a51..b81d275a08d 100644 --- a/dd-java-agent/instrumentation/opensearch/opensearch-common/gradle.lockfile +++ b/dd-java-agent/instrumentation/opensearch/opensearch-common/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:opensearch:opensearch-common:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -9,7 +10,7 @@ com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,comp com.carrotsearch:hppc:0.8.1=compileClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -18,15 +19,15 @@ com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.11.4=compileClasspath com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.11.4=compileClasspath com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.11.4=compileClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -36,12 +37,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -55,13 +59,13 @@ commons-io:commons-io:2.20.0=spotbugs commons-logging:commons-logging:1.1.3=compileClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.10.4=compileClasspath junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.jopt-simple:jopt-simple:5.0.2=compileClasspath @@ -113,6 +117,7 @@ org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.hdrhistogram:HdrHistogram:2.1.9=compileClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -139,14 +144,14 @@ org.opensearch:opensearch:1.0.0=compileClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/opensearch/opensearch-common/src/main/java/datadog/trace/instrumentation/opensearch/OpensearchRestClientDecorator.java b/dd-java-agent/instrumentation/opensearch/opensearch-common/src/main/java/datadog/trace/instrumentation/opensearch/OpensearchRestClientDecorator.java index ec07a1c8e55..95ffcfa059c 100644 --- a/dd-java-agent/instrumentation/opensearch/opensearch-common/src/main/java/datadog/trace/instrumentation/opensearch/OpensearchRestClientDecorator.java +++ b/dd-java-agent/instrumentation/opensearch/opensearch-common/src/main/java/datadog/trace/instrumentation/opensearch/OpensearchRestClientDecorator.java @@ -84,7 +84,7 @@ private String getOpensearchRequestBody(HttpEntity entity) { } } - public AgentSpan onRequest( + public void onRequest( final AgentSpan span, final String method, final String endpoint, @@ -125,14 +125,13 @@ public AgentSpan onRequest( span.setTag("opensearch.params", queryParametersStringBuilder.toString()); } } - return HTTP_RESOURCE_DECORATOR.withClientPath(span, method, endpoint); + HTTP_RESOURCE_DECORATOR.withClientPath(span, method, endpoint); } - public AgentSpan onResponse(final AgentSpan span, final Response response) { + public void onResponse(final AgentSpan span, final Response response) { if (response != null && response.getHost() != null) { span.setTag(Tags.PEER_HOSTNAME, response.getHost().getHostName()); setPeerPort(span, response.getHost().getPort()); } - return span; } } diff --git a/dd-java-agent/instrumentation/opensearch/opensearch-common/src/main/java/datadog/trace/instrumentation/opensearch/OpensearchTransportClientDecorator.java b/dd-java-agent/instrumentation/opensearch/opensearch-common/src/main/java/datadog/trace/instrumentation/opensearch/OpensearchTransportClientDecorator.java index a91b3dffcbc..04faf2ae2a6 100644 --- a/dd-java-agent/instrumentation/opensearch/opensearch-common/src/main/java/datadog/trace/instrumentation/opensearch/OpensearchTransportClientDecorator.java +++ b/dd-java-agent/instrumentation/opensearch/opensearch-common/src/main/java/datadog/trace/instrumentation/opensearch/OpensearchTransportClientDecorator.java @@ -59,7 +59,7 @@ protected String dbHostname(Object o) { return null; } - public AgentSpan onRequest(final AgentSpan span, final Class action, final Class request) { + public void onRequest(final AgentSpan span, final Class action, final Class request) { if (action != null) { String actionName = action.getSimpleName(); if ("AutoPutMappingAction".equals(actionName)) { @@ -71,6 +71,5 @@ public AgentSpan onRequest(final AgentSpan span, final Class action, final Class if (request != null) { span.setTag("opensearch.request", request.getSimpleName()); } - return span; } } diff --git a/dd-java-agent/instrumentation/opensearch/opensearch-rest-1.0/gradle.lockfile b/dd-java-agent/instrumentation/opensearch/opensearch-rest-1.0/gradle.lockfile index 297f1fbfd15..162ff675ff4 100644 --- a/dd-java-agent/instrumentation/opensearch/opensearch-rest-1.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/opensearch/opensearch-rest-1.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:opensearch:opensearch-rest-1.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -9,7 +10,7 @@ com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,comp com.carrotsearch:hppc:0.8.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -18,15 +19,15 @@ com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.11.4=latestDepTestCom com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.11.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.11.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.spullara.mustache.java:compiler:0.9.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs @@ -37,12 +38,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -63,13 +67,13 @@ io.netty:netty-common:4.1.59.Final=latestDepTestCompileClasspath,latestDepTestRu io.netty:netty-handler:4.1.59.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-resolver:4.1.59.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.1.59.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.10.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.jopt-simple:jopt-simple:5.0.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -121,6 +125,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.hdrhistogram:HdrHistogram:2.1.9=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -155,14 +160,14 @@ org.opensearch:opensearch:1.0.0=latestDepTestCompileClasspath,latestDepTestRunti org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/opensearch/opensearch-rest-1.0/src/main/java/datadog/trace/instrumentation/opensearch/OpensearchRestClientInstrumentation.java b/dd-java-agent/instrumentation/opensearch/opensearch-rest-1.0/src/main/java/datadog/trace/instrumentation/opensearch/OpensearchRestClientInstrumentation.java index 5517d8ecc58..e6c900cad53 100644 --- a/dd-java-agent/instrumentation/opensearch/opensearch-rest-1.0/src/main/java/datadog/trace/instrumentation/opensearch/OpensearchRestClientInstrumentation.java +++ b/dd-java-agent/instrumentation/opensearch/opensearch-rest-1.0/src/main/java/datadog/trace/instrumentation/opensearch/OpensearchRestClientInstrumentation.java @@ -92,6 +92,7 @@ public static void stopSpan( final AgentSpan span = scope.span(); DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); + scope.close(); span.finish(); } else if (result instanceof Response) { final AgentSpan span = scope.span(); @@ -99,11 +100,12 @@ public static void stopSpan( DECORATE.onResponse(span, ((Response) result)); } DECORATE.beforeFinish(span); + scope.close(); span.finish(); } else { + scope.close(); // async call, span finished by RestResponseListener } - scope.close(); } } } diff --git a/dd-java-agent/instrumentation/opensearch/opensearch-rest-1.0/src/test/groovy/OpensearchRestClientTest.groovy b/dd-java-agent/instrumentation/opensearch/opensearch-rest-1.0/src/test/groovy/OpensearchRestClientTest.groovy index fe8a6e8d4e3..b6722fbc7e3 100644 --- a/dd-java-agent/instrumentation/opensearch/opensearch-rest-1.0/src/test/groovy/OpensearchRestClientTest.groovy +++ b/dd-java-agent/instrumentation/opensearch/opensearch-rest-1.0/src/test/groovy/OpensearchRestClientTest.groovy @@ -31,12 +31,6 @@ class OpensearchRestClientTest extends InstrumentationSpecification { @Shared RestClient client - @Override - boolean useStrictTraceWrites() { - //FIXME IDM - false - } - def setupSpec() { aosWorkingDir = File.createTempDir("test-aos-working-dir-", "") diff --git a/dd-java-agent/instrumentation/opensearch/opensearch-transport-1.0/gradle.lockfile b/dd-java-agent/instrumentation/opensearch/opensearch-transport-1.0/gradle.lockfile index 7fde78bb33d..c6854fbaba8 100644 --- a/dd-java-agent/instrumentation/opensearch/opensearch-transport-1.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/opensearch/opensearch-transport-1.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:opensearch:opensearch-transport-1.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -9,7 +10,7 @@ com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,comp com.carrotsearch:hppc:0.8.1=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -18,15 +19,15 @@ com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.11.4=compileClasspath com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.11.4=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.11.4=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.spullara.mustache.java:compiler:0.9.6=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs @@ -37,12 +38,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -63,13 +67,13 @@ io.netty:netty-common:4.1.59.Final=compileClasspath,latestDepTestCompileClasspat io.netty:netty-handler:4.1.59.Final=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-resolver:4.1.59.Final=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.1.59.Final=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.10.4=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.jopt-simple:jopt-simple:5.0.2=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -121,6 +125,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.hdrhistogram:HdrHistogram:2.1.9=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -155,14 +160,14 @@ org.opensearch:opensearch:1.0.0=compileClasspath,latestDepTestCompileClasspath,l org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/opensearch/opensearch-transport-1.0/src/main/java/datadog/trace/instrumentation/opensearch/OpensearchTransportClientInstrumentation.java b/dd-java-agent/instrumentation/opensearch/opensearch-transport-1.0/src/main/java/datadog/trace/instrumentation/opensearch/OpensearchTransportClientInstrumentation.java index 46c2a37a095..1ce9c01ba98 100644 --- a/dd-java-agent/instrumentation/opensearch/opensearch-transport-1.0/src/main/java/datadog/trace/instrumentation/opensearch/OpensearchTransportClientInstrumentation.java +++ b/dd-java-agent/instrumentation/opensearch/opensearch-transport-1.0/src/main/java/datadog/trace/instrumentation/opensearch/OpensearchTransportClientInstrumentation.java @@ -87,9 +87,11 @@ public static void stopSpan( final AgentSpan span = scope.span(); DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); + scope.close(); span.finish(); + } else { + scope.close(); } - scope.close(); // span finished by TransportActionListener } } diff --git a/dd-java-agent/instrumentation/opensearch/opensearch-transport-1.0/src/main/java/datadog/trace/instrumentation/opensearch/ShadowExistingScopeAdvice.java b/dd-java-agent/instrumentation/opensearch/opensearch-transport-1.0/src/main/java/datadog/trace/instrumentation/opensearch/ShadowExistingScopeAdvice.java index 301ba879fa9..b2902bf4ff5 100644 --- a/dd-java-agent/instrumentation/opensearch/opensearch-transport-1.0/src/main/java/datadog/trace/instrumentation/opensearch/ShadowExistingScopeAdvice.java +++ b/dd-java-agent/instrumentation/opensearch/opensearch-transport-1.0/src/main/java/datadog/trace/instrumentation/opensearch/ShadowExistingScopeAdvice.java @@ -17,7 +17,7 @@ public static AgentScope enter() { return activateSpan(noopSpan()); } - @Advice.OnMethodExit(suppress = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void exit(@Advice.Enter final AgentScope scope) { scope.close(); } diff --git a/dd-java-agent/instrumentation/opensearch/opensearch-transport-1.0/src/main/java/datadog/trace/instrumentation/opensearch/ThreadedActionListenerInstrumentation.java b/dd-java-agent/instrumentation/opensearch/opensearch-transport-1.0/src/main/java/datadog/trace/instrumentation/opensearch/ThreadedActionListenerInstrumentation.java index 5fa2c048d1a..ecaeb784790 100644 --- a/dd-java-agent/instrumentation/opensearch/opensearch-transport-1.0/src/main/java/datadog/trace/instrumentation/opensearch/ThreadedActionListenerInstrumentation.java +++ b/dd-java-agent/instrumentation/opensearch/opensearch-transport-1.0/src/main/java/datadog/trace/instrumentation/opensearch/ThreadedActionListenerInstrumentation.java @@ -9,10 +9,10 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArguments; import com.google.auto.service.AutoService; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.java.concurrent.State; import java.util.Map; import net.bytebuddy.asm.Advice; @@ -61,13 +61,13 @@ public static void after(@Advice.This ThreadedActionListener listener) { @SuppressWarnings("rawtypes") public static final class OnResponse { @Advice.OnMethodEnter - public static AgentScope before(@Advice.This ThreadedActionListener listener) { + public static ContextScope before(@Advice.This ThreadedActionListener listener) { return startTaskScope( InstrumentationContext.get(ThreadedActionListener.class, State.class), listener); } @Advice.OnMethodExit(onThrowable = Throwable.class) - public static void after(@Advice.Enter AgentScope scope) { + public static void after(@Advice.Enter ContextScope scope) { endTaskScope(scope); } } diff --git a/dd-java-agent/instrumentation/opensearch/opensearch-transport-1.0/src/test/groovy/OpensearchNodeClientTest.groovy b/dd-java-agent/instrumentation/opensearch/opensearch-transport-1.0/src/test/groovy/OpensearchNodeClientTest.groovy index 153a764ac71..97a8f801ea0 100644 --- a/dd-java-agent/instrumentation/opensearch/opensearch-transport-1.0/src/test/groovy/OpensearchNodeClientTest.groovy +++ b/dd-java-agent/instrumentation/opensearch/opensearch-transport-1.0/src/test/groovy/OpensearchNodeClientTest.groovy @@ -28,12 +28,6 @@ class OpensearchNodeClientTest extends InstrumentationSpecification { def client = testNode.client() - @Override - boolean useStrictTraceWrites() { - //FIXME IDM - false - } - @Override protected void configurePreAgent() { super.configurePreAgent() diff --git a/dd-java-agent/instrumentation/opentelemetry/build.gradle b/dd-java-agent/instrumentation/opentelemetry/build.gradle deleted file mode 100644 index 5e69c67bd78..00000000000 --- a/dd-java-agent/instrumentation/opentelemetry/build.gradle +++ /dev/null @@ -1 +0,0 @@ -apply from: "$rootDir/gradle/java.gradle" diff --git a/dd-java-agent/instrumentation/opentelemetry/gradle.lockfile b/dd-java-agent/instrumentation/opentelemetry/gradle.lockfile deleted file mode 100644 index 5ca3972ba7b..00000000000 --- a/dd-java-agent/instrumentation/opentelemetry/gradle.lockfile +++ /dev/null @@ -1,122 +0,0 @@ -# This is a Gradle generated file for dependency locking. -# Manual edits can break the build and are not advised. -# This file is expected to be part of source control. -cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath -cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath -ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath -com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath -com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath -com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath -com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath -com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath -com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath -com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs:4.9.8=spotbugs -com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs -com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath -com.google.auto.service:auto-service:1.1.1=annotationProcessor,testAnnotationProcessor -com.google.auto:auto-common:1.2.1=annotationProcessor,testAnnotationProcessor -com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -com.google.code.gson:gson:2.13.2=spotbugs -com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor -com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor -com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath -com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath -com.squareup.okio:okio:1.17.5=testCompileClasspath,testRuntimeClasspath -com.thoughtworks.qdox:qdox:1.12.1=codenarc -commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testRuntimeClasspath -commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath -commons-io:commons-io:2.20.0=spotbugs -de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath -javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath -jaxen:jaxen:2.0.0=spotbugs -junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath -net.java.dev.jna:jna:5.8.0=testRuntimeClasspath -net.sf.saxon:Saxon-HE:12.9=spotbugs -org.apache.ant:ant-antlr:1.10.14=codenarc -org.apache.ant:ant-junit:1.10.14=codenarc -org.apache.bcel:bcel:6.11.0=spotbugs -org.apache.commons:commons-lang3:3.19.0=spotbugs -org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.logging.log4j:log4j-api:2.25.2=spotbugs -org.apache.logging.log4j:log4j-core:2.25.2=spotbugs -org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath -org.checkerframework:checker-qual:3.33.0=annotationProcessor,testAnnotationProcessor -org.codehaus.groovy:groovy-ant:3.0.23=codenarc -org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc -org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc -org.codehaus.groovy:groovy-json:3.0.23=codenarc -org.codehaus.groovy:groovy-json:3.0.25=testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-templates:3.0.23=codenarc -org.codehaus.groovy:groovy-xml:3.0.23=codenarc -org.codehaus.groovy:groovy:3.0.23=codenarc -org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath -org.codenarc:CodeNarc:3.7.0=codenarc -org.dom4j:dom4j:2.2.0=spotbugs -org.gmetrics:GMetrics:2.1.0=codenarc -org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath -org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath -org.jctools:jctools-core:4.0.6=testRuntimeClasspath -org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath -org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath -org.junit.platform:junit-platform-runner:1.14.1=testRuntimeClasspath -org.junit.platform:junit-platform-suite-api:1.14.1=testRuntimeClasspath -org.junit.platform:junit-platform-suite-commons:1.14.1=testRuntimeClasspath -org.junit:junit-bom:5.14.0=spotbugs -org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath -org.mockito:mockito-core:4.4.0=testRuntimeClasspath -org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath -org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath -org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath -org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath -org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath -org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j -org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j -org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,muzzleTooling,runtimeClasspath,testRuntimeClasspath -org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath -org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath -org.xmlresolver:xmlresolver:5.3.3=spotbugs -empty=spotbugsPlugins diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/build.gradle b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/build.gradle index 61a3cf66caf..40024727e01 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/build.gradle +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/build.gradle @@ -17,8 +17,6 @@ addTestSuiteForDir('latestDepTest', 'test') dependencies { compileOnly group: 'io.opentelemetry', name: 'opentelemetry-api', version: otelVersion - - compileOnly group: 'com.google.code.findbugs', name: 'jsr305', version: '3.0.2' compileOnly group: 'com.google.auto.value', name: 'auto-value-annotations', version: '1.6.6' testImplementation group: 'io.opentelemetry', name: 'opentelemetry-api', version: otelVersion diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/gradle.lockfile b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/gradle.lockfile index ceb3b9f1413..78b803e5cac 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/gradle.lockfile +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:opentelemetry:opentelemetry-0.3:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -32,12 +33,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -54,12 +58,12 @@ io.opentelemetry:opentelemetry-api:0.3.0=compileClasspath,testCompileClasspath,t io.opentelemetry:opentelemetry-api:0.7.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.opentelemetry:opentelemetry-context-prop:0.3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath io.opentelemetry:opentelemetry-context-prop:0.7.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -88,6 +92,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -105,14 +110,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/src/main/java/datadog/trace/instrumentation/opentelemetry/OtelSpan.java b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/src/main/java/datadog/trace/instrumentation/opentelemetry/OtelSpan.java index 1920f28553c..66590e18cc2 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/src/main/java/datadog/trace/instrumentation/opentelemetry/OtelSpan.java +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/src/main/java/datadog/trace/instrumentation/opentelemetry/OtelSpan.java @@ -112,7 +112,7 @@ public void end(final EndSpanOptions endOptions) { @Override public SpanContext getContext() { - return converter.toSpanContext(delegate.context()); + return converter.toSpanContext(delegate.spanContext()); } @Override diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/src/main/java/datadog/trace/instrumentation/opentelemetry/OtelTracer.java b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/src/main/java/datadog/trace/instrumentation/opentelemetry/OtelTracer.java index 5d4bccb6244..529ec13aa65 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/src/main/java/datadog/trace/instrumentation/opentelemetry/OtelTracer.java +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/src/main/java/datadog/trace/instrumentation/opentelemetry/OtelTracer.java @@ -58,7 +58,7 @@ public SpanBuilder(final String spanName) { @Override public Span.Builder setParent(final Span parent) { parentSet = true; - delegate.asChildOf(converter.toAgentSpan(parent).context()); + delegate.asChildOf(converter.toAgentSpan(parent).spanContext()); return this; } @@ -163,7 +163,7 @@ public Span.Builder setStartTimestamp(final long startTimestamp) { @Override public Span startSpan() { final AgentSpan agentSpan = delegate.start(); - agentSpan.context().setIntegrationName("otel"); + agentSpan.spanContext().setIntegrationName("otel"); return converter.toSpan(agentSpan); } } diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/src/main/java/datadog/trace/instrumentation/opentelemetry/TypeConverter.java b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/src/main/java/datadog/trace/instrumentation/opentelemetry/TypeConverter.java index 1e3714d6a2c..66f5602c50e 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/src/main/java/datadog/trace/instrumentation/opentelemetry/TypeConverter.java +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/src/main/java/datadog/trace/instrumentation/opentelemetry/TypeConverter.java @@ -1,6 +1,5 @@ package datadog.trace.instrumentation.opentelemetry; -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopScope; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpanContext; @@ -16,12 +15,10 @@ public class TypeConverter { private final Span noopSpanWrapper; private final SpanContext noopContextWrapper; - private final OtelScope noopScopeWrapper; public TypeConverter() { noopSpanWrapper = new OtelSpan(noopSpan(), this); noopContextWrapper = new OtelSpanContext(noopSpanContext()); - noopScopeWrapper = new OtelScope(noopScope()); } public AgentSpan toAgentSpan(final Span span) { @@ -55,9 +52,6 @@ public Scope toScope(final AgentScope scope) { if (scope == null) { return null; } - if (scope == noopScope()) { - return noopScopeWrapper; - } return new OtelScope(scope); } diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/src/test/groovy/OpenTelemetryTest.groovy b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/src/test/groovy/OpenTelemetryTest.groovy index 3f24dad8eb5..62f315e6191 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/src/test/groovy/OpenTelemetryTest.groovy +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/src/test/groovy/OpenTelemetryTest.groovy @@ -82,7 +82,7 @@ class OpenTelemetryTest extends InstrumentationSpecification { } defaultTags() } - assert span.context().integrationName == "otel" + assert span.spanContext().integrationName == "otel" } } } diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/src/test/groovy/TypeConverterTest.groovy b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/src/test/groovy/TypeConverterTest.groovy index 6852423dd22..60c0f43d9be 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/src/test/groovy/TypeConverterTest.groovy +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-0.3/src/test/groovy/TypeConverterTest.groovy @@ -9,7 +9,6 @@ import datadog.trace.core.PendingTrace import datadog.trace.core.propagation.PropagationTags import datadog.trace.instrumentation.opentelemetry.TypeConverter -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopScope import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpan import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpanContext @@ -39,12 +38,6 @@ class TypeConverterTest extends InstrumentationSpecification { typeConverter.toSpanContext(noopContext) is typeConverter.toSpanContext(noopContext) } - def "should avoid the noop scope wrapper allocation"() { - def noopScope = noopScope() - expect: - typeConverter.toScope(noopScope) is typeConverter.toScope(noopScope) - } - def createTestSpanContext() { def trace = Stub(PendingTrace) return new DDSpanContext( diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.27/gradle.lockfile b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.27/gradle.lockfile index 39b762b75e0..f5bc5048d9a 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.27/gradle.lockfile +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.27/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:opentelemetry:opentelemetry-1.27:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -32,12 +33,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -49,16 +53,16 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath io.opentelemetry:opentelemetry-api:1.27.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.opentelemetry:opentelemetry-api:1.61.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.opentelemetry:opentelemetry-common:1.61.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.opentelemetry:opentelemetry-api:1.64.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.opentelemetry:opentelemetry-common:1.64.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.opentelemetry:opentelemetry-context:1.27.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.opentelemetry:opentelemetry-context:1.61.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.opentelemetry:opentelemetry-context:1.64.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,6 +91,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -104,14 +109,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.27/src/test/java/opentelemetry127/logs/OpenTelemetryLogsActivationByInstrumentationNameForkedTest.java b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.27/src/test/java/opentelemetry127/logs/OpenTelemetryLogsActivationByInstrumentationNameForkedTest.java index 43545da3840..e1d3a705f7a 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.27/src/test/java/opentelemetry127/logs/OpenTelemetryLogsActivationByInstrumentationNameForkedTest.java +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.27/src/test/java/opentelemetry127/logs/OpenTelemetryLogsActivationByInstrumentationNameForkedTest.java @@ -1,6 +1,6 @@ package opentelemetry127.logs; -import datadog.trace.junit.utils.config.WithConfig; +import datadog.trace.test.junit.utils.config.WithConfig; // Forked test: runs in an isolated JVM with opentelemetry-logs instrumentation enabled // by integration name. GlobalOpenTelemetry holds static state that must reset between variants. diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.27/src/test/java/opentelemetry127/logs/OpenTelemetryLogsActivationByOtelRfcNameForkedTest.java b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.27/src/test/java/opentelemetry127/logs/OpenTelemetryLogsActivationByOtelRfcNameForkedTest.java index 3968c82376a..95748da0a6d 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.27/src/test/java/opentelemetry127/logs/OpenTelemetryLogsActivationByOtelRfcNameForkedTest.java +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.27/src/test/java/opentelemetry127/logs/OpenTelemetryLogsActivationByOtelRfcNameForkedTest.java @@ -1,6 +1,6 @@ package opentelemetry127.logs; -import datadog.trace.junit.utils.config.WithConfig; +import datadog.trace.test.junit.utils.config.WithConfig; // Forked test: runs in an isolated JVM with opentelemetry-logs instrumentation enabled // by OTel RFC config name. GlobalOpenTelemetry holds static state that must reset between variants. diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.27/src/test/java/opentelemetry127/logs/OpenTelemetryLogsTest.java b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.27/src/test/java/opentelemetry127/logs/OpenTelemetryLogsTest.java index b5c387d0a38..6c6996f3d0c 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.27/src/test/java/opentelemetry127/logs/OpenTelemetryLogsTest.java +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.27/src/test/java/opentelemetry127/logs/OpenTelemetryLogsTest.java @@ -12,7 +12,7 @@ import datadog.trace.bootstrap.otlp.logs.OtlpLogRecord; import datadog.trace.bootstrap.otlp.logs.OtlpLogsVisitor; import datadog.trace.bootstrap.otlp.logs.OtlpScopedLogsVisitor; -import datadog.trace.junit.utils.config.WithConfig; +import datadog.trace.test.junit.utils.config.WithConfig; import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.api.logs.Logger; import io.opentelemetry.api.logs.LoggerProvider; diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/gradle.lockfile b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/gradle.lockfile index cb5cb41cd02..b3ae43b829f 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/gradle.lockfile +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:opentelemetry:opentelemetry-1.4:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -32,12 +33,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -50,16 +54,16 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath io.opentelemetry:opentelemetry-api:1.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.opentelemetry:opentelemetry-api:1.61.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.opentelemetry:opentelemetry-common:1.61.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.opentelemetry:opentelemetry-api:1.64.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.opentelemetry:opentelemetry-common:1.64.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.opentelemetry:opentelemetry-context:1.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.opentelemetry:opentelemetry-context:1.61.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.opentelemetry:opentelemetry-context:1.64.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -88,6 +92,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -105,14 +110,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.skyscreamer:jsonassert:1.5.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/AbstractOpenTelemetry14Test.java b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/AbstractOpenTelemetry14Test.java index 34664444a14..7da14c067aa 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/AbstractOpenTelemetry14Test.java +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/AbstractOpenTelemetry14Test.java @@ -3,7 +3,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import datadog.trace.agent.test.AbstractInstrumentationTest; -import datadog.trace.junit.utils.config.WithConfig; +import datadog.trace.test.junit.utils.config.WithConfig; import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.api.trace.Tracer; import io.opentelemetry.context.Context; diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/OpenTelemetry14ActivationTest.java b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/OpenTelemetry14ActivationTest.java index 8fa3eeccbee..ec3da010904 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/OpenTelemetry14ActivationTest.java +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/OpenTelemetry14ActivationTest.java @@ -2,7 +2,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; -import datadog.trace.junit.utils.config.WithConfig; +import datadog.trace.test.junit.utils.config.WithConfig; import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.api.trace.Span; import io.opentelemetry.api.trace.SpanBuilder; diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/OpenTelemetry14ConventionsTest.java b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/OpenTelemetry14ConventionsTest.java index 27234ffe7dd..636df381731 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/OpenTelemetry14ConventionsTest.java +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/OpenTelemetry14ConventionsTest.java @@ -1,6 +1,5 @@ package opentelemetry14; -import static datadog.trace.agent.test.assertions.Matchers.is; import static datadog.trace.agent.test.assertions.SpanMatcher.span; import static datadog.trace.agent.test.assertions.TagsMatcher.defaultTags; import static datadog.trace.agent.test.assertions.TagsMatcher.tag; @@ -9,6 +8,7 @@ import static datadog.trace.api.DDTags.DD_SVC_SRC; import static datadog.trace.bootstrap.instrumentation.api.Tags.HTTP_STATUS; import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND; +import static datadog.trace.test.junit.utils.assertions.Matchers.is; import static io.opentelemetry.api.common.AttributeKey.longKey; import static io.opentelemetry.api.common.AttributeKey.stringKey; import static io.opentelemetry.api.trace.SpanKind.CLIENT; @@ -20,10 +20,10 @@ import static org.junit.jupiter.params.provider.Arguments.arguments; import datadog.opentelemetry.shim.trace.OtelConventions; -import datadog.trace.agent.test.assertions.Matcher; -import datadog.trace.agent.test.assertions.Matchers; import datadog.trace.agent.test.assertions.TagsMatcher; import datadog.trace.bootstrap.instrumentation.api.ServiceNameSources; +import datadog.trace.test.junit.utils.assertions.Matcher; +import datadog.trace.test.junit.utils.assertions.Matchers; import io.opentelemetry.api.trace.Span; import io.opentelemetry.api.trace.SpanBuilder; import io.opentelemetry.api.trace.SpanKind; diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/OpenTelemetry14Test.java b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/OpenTelemetry14Test.java index 847e4b16e71..2df2a1902a4 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/OpenTelemetry14Test.java +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/OpenTelemetry14Test.java @@ -1,8 +1,6 @@ package opentelemetry14; import static datadog.opentelemetry.shim.trace.OtelSpanEventTestHelper.stringifyErrorStack; -import static datadog.trace.agent.test.assertions.Matchers.any; -import static datadog.trace.agent.test.assertions.Matchers.is; import static datadog.trace.agent.test.assertions.SpanMatcher.span; import static datadog.trace.agent.test.assertions.TagsMatcher.defaultTags; import static datadog.trace.agent.test.assertions.TagsMatcher.tag; @@ -17,6 +15,8 @@ import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_CONSUMER; import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_PRODUCER; import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_SERVER; +import static datadog.trace.test.junit.utils.assertions.Matchers.any; +import static datadog.trace.test.junit.utils.assertions.Matchers.is; import static io.opentelemetry.api.common.AttributeKey.booleanArrayKey; import static io.opentelemetry.api.common.AttributeKey.doubleArrayKey; import static io.opentelemetry.api.common.AttributeKey.longArrayKey; @@ -43,8 +43,6 @@ import static org.junit.jupiter.params.provider.Arguments.arguments; import datadog.opentelemetry.shim.trace.OtelSpanEvent; -import datadog.trace.agent.test.assertions.Matcher; -import datadog.trace.agent.test.assertions.Matchers; import datadog.trace.agent.test.assertions.TagsMatcher; import datadog.trace.api.DDSpanId; import datadog.trace.api.DDTags; @@ -52,6 +50,8 @@ import datadog.trace.api.time.ControllableTimeSource; import datadog.trace.bootstrap.instrumentation.api.WithAgentSpan; import datadog.trace.core.DDSpan; +import datadog.trace.test.junit.utils.assertions.Matcher; +import datadog.trace.test.junit.utils.assertions.Matchers; import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.trace.Span; @@ -590,7 +590,7 @@ void testIntegrationName() throws Exception { writer.waitForTraces(1); DDSpan ddSpan = writer.firstTrace().get(0); - assertEquals("otel", ddSpan.context().getIntegrationName().toString()); + assertEquals("otel", ddSpan.spanContext().getIntegrationName().toString()); } static Stream testSpanKindsArguments() { diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/context/propagation/B3MultiPropagatorTest.java b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/context/propagation/B3MultiPropagatorTest.java index 7bd32f59d11..f07fd4106eb 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/context/propagation/B3MultiPropagatorTest.java +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/context/propagation/B3MultiPropagatorTest.java @@ -7,7 +7,7 @@ import static org.junit.jupiter.params.provider.Arguments.arguments; import datadog.trace.core.propagation.B3TraceId; -import datadog.trace.junit.utils.config.WithConfig; +import datadog.trace.test.junit.utils.config.WithConfig; import java.util.Map; import java.util.stream.Stream; import org.junit.jupiter.params.provider.Arguments; diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/context/propagation/B3SinglePropagatorTest.java b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/context/propagation/B3SinglePropagatorTest.java index 4e6809f24a4..2cabe3bd21b 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/context/propagation/B3SinglePropagatorTest.java +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/context/propagation/B3SinglePropagatorTest.java @@ -7,7 +7,7 @@ import static org.junit.jupiter.params.provider.Arguments.arguments; import datadog.trace.core.propagation.B3TraceId; -import datadog.trace.junit.utils.config.WithConfig; +import datadog.trace.test.junit.utils.config.WithConfig; import java.util.Map; import java.util.stream.Stream; import org.junit.jupiter.params.provider.Arguments; diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/context/propagation/DatadogPropagatorTest.java b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/context/propagation/DatadogPropagatorTest.java index 038b5208317..09b7ee31a13 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/context/propagation/DatadogPropagatorTest.java +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/context/propagation/DatadogPropagatorTest.java @@ -8,7 +8,7 @@ import static org.junit.jupiter.params.provider.Arguments.arguments; import datadog.trace.api.DDTraceId; -import datadog.trace.junit.utils.config.WithConfig; +import datadog.trace.test.junit.utils.config.WithConfig; import java.util.ArrayList; import java.util.List; import java.util.Map; diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/context/propagation/OtelW3cPropagatorTest.java b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/context/propagation/OtelW3cPropagatorTest.java index dc9893b25f1..8f62cd5b6f2 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/context/propagation/OtelW3cPropagatorTest.java +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/context/propagation/OtelW3cPropagatorTest.java @@ -5,7 +5,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.params.provider.Arguments.arguments; -import datadog.trace.junit.utils.config.WithConfig; +import datadog.trace.test.junit.utils.config.WithConfig; import io.opentelemetry.api.trace.propagation.W3CTraceContextPropagator; import io.opentelemetry.context.propagation.TextMapPropagator; import java.util.Map; diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/context/propagation/W3cPropagatorTest.java b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/context/propagation/W3cPropagatorTest.java index e1612c2bded..27975864cb2 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/context/propagation/W3cPropagatorTest.java +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/context/propagation/W3cPropagatorTest.java @@ -5,7 +5,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.params.provider.Arguments.arguments; -import datadog.trace.junit.utils.config.WithConfig; +import datadog.trace.test.junit.utils.config.WithConfig; import java.util.Map; import java.util.stream.Stream; import org.junit.jupiter.params.provider.Arguments; diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/context/propagation/W3cPropagatorTracestateTest.java b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/context/propagation/W3cPropagatorTracestateTest.java index 04e5c157712..c7e4123f81f 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/context/propagation/W3cPropagatorTracestateTest.java +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.4/src/test/java/opentelemetry14/context/propagation/W3cPropagatorTracestateTest.java @@ -4,7 +4,7 @@ import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; -import datadog.trace.junit.utils.config.WithConfig; +import datadog.trace.test.junit.utils.config.WithConfig; import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.api.trace.Span; import io.opentelemetry.context.Context; diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/build.gradle b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/build.gradle index 3b992b19ff1..ebc3a17f87c 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/build.gradle +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/build.gradle @@ -22,6 +22,8 @@ dependencies { muzzleBootstrap project(path: ':dd-java-agent:agent-otel:otel-bootstrap', configuration: 'shadow') testImplementation project(path: ':dd-java-agent:agent-otel:otel-bootstrap', configuration: 'shadow') + // JvmOtlpRuntimeMetrics lives in agent-jmxfetch; the test exercises it directly. + testImplementation project(':dd-java-agent:agent-jmxfetch') testImplementation group: 'io.opentelemetry', name: 'opentelemetry-api', version: openTelemetryVersion latestDepTestImplementation group: 'io.opentelemetry', name: 'opentelemetry-api', version: '1+' diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/gradle.lockfile b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/gradle.lockfile index 9eedfa7fe07..d6810fc7d13 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/gradle.lockfile +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:opentelemetry:opentelemetry-1.47:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,28 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:java-dogstatsd-client:2.10.5=latestDepTestCompileClasspath,testCompileClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.datadoghq:jmxfetch:0.52.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.2.23=latestDepTestCompileClasspath,testCompileClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-a64asm:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jnr-constants:0.9.15=latestDepTestCompileClasspath,testCompileClasspath +com.github.jnr:jnr-enxio:0.25=latestDepTestCompileClasspath,testCompileClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.1.12=latestDepTestCompileClasspath,testCompileClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.0.53=latestDepTestCompileClasspath,testCompileClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.27=latestDepTestCompileClasspath,testCompileClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-x86asm:1.0.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -32,12 +41,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -49,16 +61,16 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath io.opentelemetry:opentelemetry-api:1.47.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.opentelemetry:opentelemetry-api:1.61.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.opentelemetry:opentelemetry-common:1.61.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.opentelemetry:opentelemetry-api:1.64.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.opentelemetry:opentelemetry-common:1.64.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.opentelemetry:opentelemetry-context:1.47.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.opentelemetry:opentelemetry-context:1.61.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.opentelemetry:opentelemetry-context:1.64.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,6 +99,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -102,16 +115,20 @@ org.junit:junit-bom:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeCla org.mockito:mockito-core:4.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-analysis:7.1=latestDepTestCompileClasspath,testCompileClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:7.1=latestDepTestCompileClasspath,testCompileClasspath +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:7.1=latestDepTestCompileClasspath,testCompileClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-util:7.1=latestDepTestCompileClasspath,testCompileClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/src/test/java/opentelemetry147/metrics/JvmOtlpRuntimeMetricsForkedTest.java b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/src/test/java/opentelemetry147/metrics/JvmOtlpRuntimeMetricsForkedTest.java new file mode 100644 index 00000000000..e4beefeab46 --- /dev/null +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/src/test/java/opentelemetry147/metrics/JvmOtlpRuntimeMetricsForkedTest.java @@ -0,0 +1,107 @@ +package opentelemetry147.metrics; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.agent.jmxfetch.JvmOtlpRuntimeMetrics; +import datadog.trace.bootstrap.otel.metrics.data.OtelMetricRegistry; +import java.util.Arrays; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +// Forked test: runs in an isolated JVM and starts JvmOtlpRuntimeMetrics with the experimental +// flag OFF, verifying that Development-status instruments are not registered and that the +// jvm.gc.cause attribute is omitted from jvm.gc.duration data points. The JvmOtlpRuntimeMetrics +// class uses a one-shot AtomicBoolean to guard registration, so this scenario must run in its +// own JVM separate from the always-on JvmOtlpRuntimeMetricsTest. +class JvmOtlpRuntimeMetricsForkedTest { + + @BeforeAll + static void setUp() { + System.setProperty("dd.metrics.otel.enabled", "true"); + JvmOtlpRuntimeMetrics.start(false); + } + + @Test + void registersOnlyStableMetricsWhenExperimentalDisabled() { + JvmOtlpRuntimeMetricsTest.MetricCollector collector = + new JvmOtlpRuntimeMetricsTest.MetricCollector(); + OtelMetricRegistry.INSTANCE.collectMetrics(collector); + + Set names = collector.metricNames; + + List expectedStableMetrics = + Arrays.asList( + "jvm.memory.used", + "jvm.memory.committed", + "jvm.memory.limit", + "jvm.memory.used_after_last_gc", + "jvm.thread.count", + "jvm.class.loaded", + "jvm.class.count", + "jvm.class.unloaded", + "jvm.cpu.time", + "jvm.cpu.count", + "jvm.cpu.recent_utilization", + "jvm.gc.duration"); + for (String metric : expectedStableMetrics) { + assertTrue( + names.contains(metric), + "Expected stable metric '" + metric + "' not found. Got: " + new TreeSet<>(names)); + } + + List developmentMetrics = + Arrays.asList( + "jvm.memory.init", + "jvm.buffer.memory.used", + "jvm.buffer.memory.limit", + "jvm.buffer.count", + "jvm.system.cpu.utilization", + "jvm.system.cpu.load_1m", + "jvm.file_descriptor.count", + "jvm.file_descriptor.limit"); + for (String metric : developmentMetrics) { + assertFalse( + names.contains(metric), + "Development metric '" + + metric + + "' should not be registered when experimental disabled. Got: " + + new TreeSet<>(names)); + } + } + + @Test + void jvmGcDurationDataPointsOmitGcCauseWhenExperimentalDisabled() throws InterruptedException { + System.gc(); + + List points = null; + long deadlineNanos = System.nanoTime() + TimeUnit.SECONDS.toNanos(2); + while (System.nanoTime() < deadlineNanos) { + JvmOtlpRuntimeMetricsTest.MetricCollector collector = + new JvmOtlpRuntimeMetricsTest.MetricCollector(); + OtelMetricRegistry.INSTANCE.collectMetrics(collector); + points = collector.points.get("jvm.gc.duration"); + if (points != null && !points.isEmpty()) { + break; + } + Thread.sleep(50); + } + + assertNotNull(points, "jvm.gc.duration should have data points after System.gc()"); + assertFalse(points.isEmpty(), "jvm.gc.duration should have at least one data point"); + assertTrue( + points.stream() + .allMatch( + p -> + p.attrs.containsKey("jvm.gc.name") + && p.attrs.containsKey("jvm.gc.action") + && !p.attrs.containsKey("jvm.gc.cause")), + "jvm.gc.duration data points must carry jvm.gc.name and jvm.gc.action, but not jvm.gc.cause" + + " when experimental disabled"); + } +} diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/src/test/java/opentelemetry147/metrics/JvmOtlpRuntimeMetricsTest.java b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/src/test/java/opentelemetry147/metrics/JvmOtlpRuntimeMetricsTest.java new file mode 100644 index 00000000000..9aa86d9c5cc --- /dev/null +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/src/test/java/opentelemetry147/metrics/JvmOtlpRuntimeMetricsTest.java @@ -0,0 +1,310 @@ +package opentelemetry147.metrics; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.sun.management.UnixOperatingSystemMXBean; +import datadog.trace.agent.jmxfetch.JvmOtlpRuntimeMetrics; +import datadog.trace.bootstrap.otel.common.OtelInstrumentationScope; +import datadog.trace.bootstrap.otel.metrics.OtelInstrumentDescriptor; +import datadog.trace.bootstrap.otel.metrics.data.OtelMetricRegistry; +import datadog.trace.bootstrap.otlp.metrics.OtlpDataPoint; +import datadog.trace.bootstrap.otlp.metrics.OtlpDoublePoint; +import datadog.trace.bootstrap.otlp.metrics.OtlpLongPoint; +import datadog.trace.bootstrap.otlp.metrics.OtlpMetricVisitor; +import datadog.trace.bootstrap.otlp.metrics.OtlpMetricsVisitor; +import datadog.trace.bootstrap.otlp.metrics.OtlpScopedMetricsVisitor; +import java.lang.management.ManagementFactory; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.TreeSet; +import java.util.stream.Collectors; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +/** + * Tests that JVM runtime metrics are registered and exported via OTLP using OTel semantic + * convention names (jvm.memory.used, jvm.thread.count, etc.). + * + *

      Ref: https://opentelemetry.io/docs/specs/semconv/runtime/jvm-metrics/ + * + *

      Ref: + * https://github.com/DataDog/semantic-core/blob/main/sor/domains/metrics/integrations/java/_equivalence/ + */ +public class JvmOtlpRuntimeMetricsTest { + + @BeforeAll + static void setUp() { + System.setProperty("dd.metrics.otel.enabled", "true"); + JvmOtlpRuntimeMetrics.start(true); + } + + @Test + void registersExpectedJvmMetrics() { + MetricCollector collector = new MetricCollector(); + OtelMetricRegistry.INSTANCE.collectMetrics(collector); + + List expectedMetrics = + Arrays.asList( + "jvm.memory.used", + "jvm.memory.committed", + "jvm.memory.limit", + "jvm.memory.init", + "jvm.memory.used_after_last_gc", + "jvm.buffer.memory.used", + "jvm.buffer.memory.limit", + "jvm.buffer.count", + "jvm.thread.count", + "jvm.class.loaded", + "jvm.class.count", + "jvm.class.unloaded", + "jvm.cpu.time", + "jvm.cpu.count", + "jvm.cpu.recent_utilization", + "jvm.system.cpu.utilization", + "jvm.system.cpu.load_1m", + "jvm.gc.duration"); + + Set names = collector.metricNames; + for (String metric : expectedMetrics) { + assertTrue( + names.contains(metric), + "Expected metric '" + metric + "' not found. Got: " + new TreeSet<>(names)); + } + + int expectedSize = expectedMetrics.size(); + if (ManagementFactory.getOperatingSystemMXBean() instanceof UnixOperatingSystemMXBean) { + assertTrue( + names.contains("jvm.file_descriptor.count"), + "Expected jvm.file_descriptor.count on Unix. Got: " + new TreeSet<>(names)); + assertTrue( + names.contains("jvm.file_descriptor.limit"), + "Expected jvm.file_descriptor.limit on Unix. Got: " + new TreeSet<>(names)); + expectedSize += 2; + } + + assertEquals(expectedSize, names.size(), "Unexpected metric count: " + new TreeSet<>(names)); + + // No DD-proprietary names should be present + List ddNames = + names.stream() + .filter(n -> n.startsWith("jvm.heap_memory") || n.startsWith("jvm.thread_count")) + .collect(Collectors.toList()); + assertTrue(ddNames.isEmpty(), "DD-proprietary names leaked: " + ddNames); + } + + @Test + void jvmMemoryUsedHasHeapAndNonHeapTypeAttributes() { + MetricCollector collector = new MetricCollector(); + OtelMetricRegistry.INSTANCE.collectMetrics(collector); + + Set types = collector.attributeValues("jvm.memory.used", "jvm.memory.type"); + assertTrue(types.contains("heap"), "jvm.memory.used should have heap attribute"); + assertTrue(types.contains("non_heap"), "jvm.memory.used should have non_heap attribute"); + } + + @Test + void jvmMemoryUsedHeapValueIsPositive() { + MetricCollector collector = new MetricCollector(); + OtelMetricRegistry.INSTANCE.collectMetrics(collector); + + List points = collector.points.get("jvm.memory.used"); + assertNotNull(points, "jvm.memory.used should have data points"); + DataPointEntry heapAggregate = + points.stream() + .filter( + p -> + "heap".equals(p.attrs.get("jvm.memory.type")) + && p.attrs.get("jvm.memory.pool.name") == null) + .findFirst() + .orElse(null); + assertNotNull(heapAggregate, "jvm.memory.used should have a heap aggregate data point"); + assertTrue( + heapAggregate.value.longValue() > 0, + "jvm.memory.used heap aggregate should be positive, got " + heapAggregate.value); + } + + @Test + void jvmThreadCountIsBucketedByDaemonAndState() { + MetricCollector collector = new MetricCollector(); + OtelMetricRegistry.INSTANCE.collectMetrics(collector); + + List threadPoints = collector.points.get("jvm.thread.count"); + assertNotNull(threadPoints, "jvm.thread.count should have data points"); + assertFalse(threadPoints.isEmpty(), "jvm.thread.count should have data points"); + + // Every data point must carry both jvm.thread.daemon (Boolean) and jvm.thread.state (String). + Set validStates = new HashSet<>(); + for (Thread.State state : Thread.State.values()) { + validStates.add(state.name().toLowerCase(Locale.ROOT)); + } + long totalThreads = 0; + for (DataPointEntry point : threadPoints) { + Object daemon = point.attrs.get("jvm.thread.daemon"); + Object state = point.attrs.get("jvm.thread.state"); + assertNotNull(daemon, "jvm.thread.count point missing jvm.thread.daemon: " + point.attrs); + assertNotNull(state, "jvm.thread.count point missing jvm.thread.state: " + point.attrs); + assertTrue( + "true".equals(daemon.toString()) || "false".equals(daemon.toString()), + "jvm.thread.daemon must be a boolean string, got " + daemon); + assertTrue( + validStates.contains(state.toString()), + "jvm.thread.state must be one of " + validStates + ", got " + state); + assertTrue( + point.value.longValue() > 0, + "jvm.thread.count bucket should be positive (empty buckets must be skipped), got " + + point.value + + " for " + + point.attrs); + totalThreads += point.value.longValue(); + } + assertTrue(totalThreads > 0, "Sum of jvm.thread.count buckets should be positive"); + + // The test JVM has at minimum: the main test thread (non-daemon) plus GC/JMX/etc. daemon + // threads — so we should observe at least one daemon=true and one daemon=false bucket. + Set daemonValues = collector.attributeValues("jvm.thread.count", "jvm.thread.daemon"); + assertTrue( + daemonValues.contains("true") && daemonValues.contains("false"), + "jvm.thread.count should emit both daemon and non-daemon buckets, got: " + daemonValues); + } + + @Test + void jvmMemoryInitHasHeapNonHeapAndPoolAttributes() { + MetricCollector collector = new MetricCollector(); + OtelMetricRegistry.INSTANCE.collectMetrics(collector); + + Set types = collector.attributeValues("jvm.memory.init", "jvm.memory.type"); + assertTrue(types.contains("heap"), "jvm.memory.init should have heap aggregate"); + assertTrue(types.contains("non_heap"), "jvm.memory.init should have non_heap aggregate"); + + Set poolNames = collector.attributeValues("jvm.memory.init", "jvm.memory.pool.name"); + assertFalse( + poolNames.isEmpty(), + "jvm.memory.init should have per-pool data points carrying jvm.memory.pool.name"); + } + + @Test + void jvmMemoryInitHeapAggregateIsPositive() { + MetricCollector collector = new MetricCollector(); + OtelMetricRegistry.INSTANCE.collectMetrics(collector); + + List points = collector.points.get("jvm.memory.init"); + assertNotNull(points, "jvm.memory.init should have data points"); + DataPointEntry heapAggregate = + points.stream() + .filter( + p -> + "heap".equals(p.attrs.get("jvm.memory.type")) + && p.attrs.get("jvm.memory.pool.name") == null) + .findFirst() + .orElse(null); + assertNotNull(heapAggregate, "jvm.memory.init should have a heap aggregate data point"); + assertTrue( + heapAggregate.value.longValue() > 0, + "jvm.memory.init heap aggregate should be positive, got " + heapAggregate.value); + } + + @Test + void jvmGcDurationRecordsDataPointsAfterGc() throws InterruptedException { + // Force a GC; the JMX NotificationListener should observe the event and record a data + // point onto the jvm.gc.duration histogram. + System.gc(); + + // JMX delivers the notification on the JVM's internal notification thread, so we have + // to poll briefly. Two seconds is generous — delivery is typically sub-50ms. + List points = null; + long deadlineNanos = System.nanoTime() + java.util.concurrent.TimeUnit.SECONDS.toNanos(2); + while (System.nanoTime() < deadlineNanos) { + MetricCollector collector = new MetricCollector(); + OtelMetricRegistry.INSTANCE.collectMetrics(collector); + points = collector.points.get("jvm.gc.duration"); + if (points != null && !points.isEmpty()) { + break; + } + Thread.sleep(50); + } + + assertNotNull(points, "jvm.gc.duration should have data points after System.gc()"); + assertFalse(points.isEmpty(), "jvm.gc.duration should have at least one data point"); + assertTrue( + points.stream() + .allMatch( + p -> p.attrs.containsKey("jvm.gc.name") && p.attrs.containsKey("jvm.gc.action")), + "Every jvm.gc.duration data point should carry jvm.gc.name and jvm.gc.action attributes"); + } + + static final class DataPointEntry { + final Map attrs; + final Number value; + + DataPointEntry(Map attrs, Number value) { + this.attrs = attrs; + this.value = value; + } + } + + static final class MetricCollector + implements OtlpMetricsVisitor, OtlpScopedMetricsVisitor, OtlpMetricVisitor { + + String currentInstrument = ""; + final Map currentAttrs = new LinkedHashMap<>(); + final Set metricNames = new LinkedHashSet<>(); + final Map> points = new LinkedHashMap<>(); + + @Override + public OtlpScopedMetricsVisitor visitScopedMetrics(OtelInstrumentationScope scope) { + return this; + } + + @Override + public OtlpMetricVisitor visitMetric(OtelInstrumentDescriptor descriptor) { + currentInstrument = descriptor.getName().toString(); + metricNames.add(currentInstrument); + points.computeIfAbsent(currentInstrument, k -> new ArrayList<>()); + return this; + } + + @Override + public void visitAttribute(int type, String key, Object value) { + currentAttrs.put(key, value == null ? null : value.toString()); + } + + @Override + public void visitDataPoint(OtlpDataPoint point) { + Map attrs = new HashMap<>(currentAttrs); + currentAttrs.clear(); + Number value = 0; + if (point instanceof OtlpLongPoint) { + value = ((OtlpLongPoint) point).value; + } else if (point instanceof OtlpDoublePoint) { + value = ((OtlpDoublePoint) point).value; + } + points + .computeIfAbsent(currentInstrument, k -> new ArrayList<>()) + .add(new DataPointEntry(attrs, value)); + } + + Set attributeValues(String metricName, String attrKey) { + List entries = points.get(metricName); + if (entries == null) { + return new LinkedHashSet<>(); + } + return entries.stream() + .map(e -> e.attrs.get(attrKey)) + .filter(Objects::nonNull) + .map(Object::toString) + .collect(Collectors.toCollection(LinkedHashSet::new)); + } + } +} diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/src/test/java/opentelemetry147/metrics/OpenTelemetryMetricsActivationByInstrumentationNameForkedTest.java b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/src/test/java/opentelemetry147/metrics/OpenTelemetryMetricsActivationByInstrumentationNameForkedTest.java index b393e7caea0..0ea9a37f217 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/src/test/java/opentelemetry147/metrics/OpenTelemetryMetricsActivationByInstrumentationNameForkedTest.java +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/src/test/java/opentelemetry147/metrics/OpenTelemetryMetricsActivationByInstrumentationNameForkedTest.java @@ -1,6 +1,6 @@ package opentelemetry147.metrics; -import datadog.trace.junit.utils.config.WithConfig; +import datadog.trace.test.junit.utils.config.WithConfig; // Forked test: runs in an isolated JVM with opentelemetry-metrics instrumentation enabled // by integration name. GlobalOpenTelemetry holds static state that must reset between variants. diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/src/test/java/opentelemetry147/metrics/OpenTelemetryMetricsActivationByOtelRfcNameForkedTest.java b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/src/test/java/opentelemetry147/metrics/OpenTelemetryMetricsActivationByOtelRfcNameForkedTest.java index 91398724699..086f296513d 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/src/test/java/opentelemetry147/metrics/OpenTelemetryMetricsActivationByOtelRfcNameForkedTest.java +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/src/test/java/opentelemetry147/metrics/OpenTelemetryMetricsActivationByOtelRfcNameForkedTest.java @@ -1,6 +1,6 @@ package opentelemetry147.metrics; -import datadog.trace.junit.utils.config.WithConfig; +import datadog.trace.test.junit.utils.config.WithConfig; // Forked test: runs in an isolated JVM with opentelemetry-metrics instrumentation enabled // by OTel RFC config name. GlobalOpenTelemetry holds static state that must reset between variants. diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/src/test/java/opentelemetry147/metrics/OpenTelemetryMetricsCumulativeForkedTest.java b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/src/test/java/opentelemetry147/metrics/OpenTelemetryMetricsCumulativeForkedTest.java new file mode 100644 index 00000000000..f888fd990c2 --- /dev/null +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/src/test/java/opentelemetry147/metrics/OpenTelemetryMetricsCumulativeForkedTest.java @@ -0,0 +1,147 @@ +package opentelemetry147.metrics; + +import static io.opentelemetry.api.common.AttributeKey.stringKey; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import datadog.metrics.impl.DDSketchHistograms; +import datadog.opentelemetry.shim.metrics.OtelMeterProvider; +import datadog.trace.agent.test.AbstractInstrumentationTest; +import datadog.trace.bootstrap.otel.metrics.data.OtelMetricRegistry; +import datadog.trace.test.junit.utils.config.WithConfig; +import io.opentelemetry.api.GlobalOpenTelemetry; +import io.opentelemetry.api.common.Attributes; +import io.opentelemetry.api.metrics.Meter; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +// Forked test: runs in an isolated JVM with cumulative temporality, verifying that observable +// counters report absolute values on each collect (no delta computation). +@WithConfig(key = "metrics.otel.enabled", value = "true") +@WithConfig(key = "otlp.metrics.temporality.preference", value = "cumulative") +class OpenTelemetryMetricsCumulativeForkedTest extends AbstractInstrumentationTest { + + private static final Attributes SOME_ATTRIBUTES = Attributes.of(stringKey("some"), "thing"); + private static final String WITH_ATTRS = "@{some=thing}"; + + private OtelMeterProvider meterProvider; + private Meter meter; + private Map points; + private OpenTelemetryMetricsTest.MeterReader meterReader; + + @BeforeAll + static void registerHistogramFactory() { + datadog.metrics.api.Histograms.register(DDSketchHistograms.FACTORY); + } + + @BeforeEach + void setUpMetrics() { + meterProvider = (OtelMeterProvider) GlobalOpenTelemetry.get().getMeterProvider(); + meter = meterProvider.get("test"); + points = new HashMap<>(); + meterReader = new OpenTelemetryMetricsTest.MeterReader(points); + } + + @Test + void testObservableLongCounterCumulative() { + long[] absoluteValue = {0L}; + AutoCloseable observable = + meter + .counterBuilder("cumulative-observable-long-counter") + .buildWithCallback(m -> m.record(absoluteValue[0])); + + absoluteValue[0] = 5L; + OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); + assertEquals(5L, points.get("test:cumulative-observable-long-counter")); + + // cumulative: same absolute value is reported as-is (not as delta=0) + points.clear(); + OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); + assertEquals(5L, points.get("test:cumulative-observable-long-counter")); + + // absolute value increases: reports new absolute value + points.clear(); + absoluteValue[0] = 12L; + OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); + assertEquals(12L, points.get("test:cumulative-observable-long-counter")); + + closeQuietly(observable); + } + + @Test + void testObservableDoubleCounterCumulative() { + double[] absoluteValue = {0.0}; + AutoCloseable observable = + meter + .counterBuilder("cumulative-observable-double-counter") + .ofDoubles() + .buildWithCallback(m -> m.record(absoluteValue[0])); + + absoluteValue[0] = 3.5; + OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); + assertEquals(3.5, points.get("test:cumulative-observable-double-counter")); + + // cumulative: same absolute value is reported as-is (not as delta=0.0) + points.clear(); + OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); + assertEquals(3.5, points.get("test:cumulative-observable-double-counter")); + + // absolute value increases: reports new absolute value + points.clear(); + absoluteValue[0] = 8.0; + OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); + assertEquals(8.0, points.get("test:cumulative-observable-double-counter")); + + closeQuietly(observable); + } + + @Test + void testSynchronousLongCounterCumulative() { + io.opentelemetry.api.metrics.LongCounter counter = + meter.counterBuilder("cumulative-long-counter").build(); + + counter.add(1); + counter.add(2, SOME_ATTRIBUTES); + OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); + assertEquals(1L, points.get("test:cumulative-long-counter")); + assertEquals(2L, points.get("test:cumulative-long-counter" + WITH_ATTRS)); + + // cumulative: values accumulate without reset between collects + points.clear(); + counter.add(3); + counter.add(4, SOME_ATTRIBUTES); + OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); + assertEquals(4L, points.get("test:cumulative-long-counter")); + assertEquals(6L, points.get("test:cumulative-long-counter" + WITH_ATTRS)); + } + + @Test + void testSynchronousDoubleCounterCumulative() { + io.opentelemetry.api.metrics.DoubleCounter counter = + meter.counterBuilder("cumulative-double-counter").ofDoubles().build(); + + counter.add(1.0); + counter.add(2.0, SOME_ATTRIBUTES); + OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); + assertEquals(1.0, points.get("test:cumulative-double-counter")); + assertEquals(2.0, points.get("test:cumulative-double-counter" + WITH_ATTRS)); + + // cumulative: values accumulate without reset between collects + points.clear(); + counter.add(0.5); + counter.add(1.5, SOME_ATTRIBUTES); + OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); + assertEquals(1.5, (double) points.get("test:cumulative-double-counter"), 0.001); + assertEquals(3.5, (double) points.get("test:cumulative-double-counter" + WITH_ATTRS), 0.001); + } + + private static void closeQuietly(AutoCloseable closeable) { + try { + closeable.close(); + } catch (Exception e) { + throw new RuntimeException(e); + } + } +} diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/src/test/java/opentelemetry147/metrics/OpenTelemetryMetricsTest.java b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/src/test/java/opentelemetry147/metrics/OpenTelemetryMetricsTest.java index 3a4c6187fb2..a6332ae9267 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/src/test/java/opentelemetry147/metrics/OpenTelemetryMetricsTest.java +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-1.47/src/test/java/opentelemetry147/metrics/OpenTelemetryMetricsTest.java @@ -17,7 +17,7 @@ import datadog.trace.bootstrap.otlp.metrics.OtlpMetricVisitor; import datadog.trace.bootstrap.otlp.metrics.OtlpMetricsVisitor; import datadog.trace.bootstrap.otlp.metrics.OtlpScopedMetricsVisitor; -import datadog.trace.junit.utils.config.WithConfig; +import datadog.trace.test.junit.utils.config.WithConfig; import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.metrics.BatchCallback; @@ -212,6 +212,13 @@ void testObservableLongCounter() { assertEquals(1L, points.get("test:observable-long-counter")); assertEquals(2L, points.get("test:observable-long-counter" + WITH_ATTRS)); + // second collect: absolute values are reported, not accumulated + points.clear(); + OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); + + assertEquals(0L, points.get("test:observable-long-counter")); + assertEquals(0L, points.get("test:observable-long-counter" + WITH_ATTRS)); + closeQuietly(observable); } @@ -231,6 +238,13 @@ void testObservableDoubleCounter() { assertEquals(1.2, points.get("test:observable-double-counter")); assertEquals(3.4, points.get("test:observable-double-counter" + WITH_ATTRS)); + // second collect: absolute values are reported, not accumulated + points.clear(); + OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); + + assertEquals(0.0, points.get("test:observable-double-counter")); + assertEquals(0.0, points.get("test:observable-double-counter" + WITH_ATTRS)); + closeQuietly(observable); } @@ -249,6 +263,13 @@ void testObservableLongUpDownCounter() { assertEquals(1L, points.get("test:observable-long-up-down-counter")); assertEquals(2L, points.get("test:observable-long-up-down-counter" + WITH_ATTRS)); + // second collect: absolute values are reported, not accumulated + points.clear(); + OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); + + assertEquals(1L, points.get("test:observable-long-up-down-counter")); + assertEquals(2L, points.get("test:observable-long-up-down-counter" + WITH_ATTRS)); + closeQuietly(observable); } @@ -268,6 +289,13 @@ void testObservableDoubleUpDownCounter() { assertEquals(1.2, points.get("test:observable-double-up-down-counter")); assertEquals(3.4, points.get("test:observable-double-up-down-counter" + WITH_ATTRS)); + // second collect: absolute values are reported, not accumulated + points.clear(); + OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); + + assertEquals(1.2, points.get("test:observable-double-up-down-counter")); + assertEquals(3.4, points.get("test:observable-double-up-down-counter" + WITH_ATTRS)); + closeQuietly(observable); } @@ -308,6 +336,108 @@ void testObservableDoubleGauge() { closeQuietly(observable); } + @Test + void testObservableLongCounterDeltaWithChangingValues() { + long[] absoluteValue = {0L}; + AutoCloseable observable = + meter + .counterBuilder("observable-long-counter-delta-changing") + .buildWithCallback(m -> m.record(absoluteValue[0])); + + absoluteValue[0] = 5L; + OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); + assertEquals(5L, points.get("test:observable-long-counter-delta-changing")); + + // delta since last collect: 12 - 5 = 7 + points.clear(); + absoluteValue[0] = 12L; + OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); + assertEquals(7L, points.get("test:observable-long-counter-delta-changing")); + + // no change in absolute value: delta = 0 + points.clear(); + OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); + assertEquals(0L, points.get("test:observable-long-counter-delta-changing")); + + closeQuietly(observable); + } + + @Test + void testObservableDoubleCounterDeltaWithChangingValues() { + double[] absoluteValue = {0.0}; + AutoCloseable observable = + meter + .counterBuilder("observable-double-counter-delta-changing") + .ofDoubles() + .buildWithCallback(m -> m.record(absoluteValue[0])); + + absoluteValue[0] = 2.5; + OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); + assertEquals(2.5, points.get("test:observable-double-counter-delta-changing")); + + // delta since last collect: 5.0 - 2.5 = 2.5 + points.clear(); + absoluteValue[0] = 5.0; + OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); + assertEquals(2.5, points.get("test:observable-double-counter-delta-changing")); + + // no change in absolute value: delta = 0.0 + points.clear(); + OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); + assertEquals(0.0, points.get("test:observable-double-counter-delta-changing")); + + closeQuietly(observable); + } + + @Test + void testObservableLongUpDownCounterReportsAbsoluteValue() { + long[] absoluteValue = {0L}; + AutoCloseable observable = + meter + .upDownCounterBuilder("observable-long-up-down-counter-absolute") + .buildWithCallback(m -> m.record(absoluteValue[0])); + + absoluteValue[0] = 10L; + OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); + assertEquals(10L, points.get("test:observable-long-up-down-counter-absolute")); + + // value decreases: should report new absolute value, not a delta + points.clear(); + absoluteValue[0] = 3L; + OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); + assertEquals(3L, points.get("test:observable-long-up-down-counter-absolute")); + + // value increases again + points.clear(); + absoluteValue[0] = 15L; + OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); + assertEquals(15L, points.get("test:observable-long-up-down-counter-absolute")); + + closeQuietly(observable); + } + + @Test + void testObservableDoubleUpDownCounterReportsAbsoluteValue() { + double[] absoluteValue = {0.0}; + AutoCloseable observable = + meter + .upDownCounterBuilder("observable-double-up-down-counter-absolute") + .ofDoubles() + .buildWithCallback(m -> m.record(absoluteValue[0])); + + absoluteValue[0] = 8.0; + OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); + assertEquals(8.0, points.get("test:observable-double-up-down-counter-absolute")); + + // value decreases: should report new absolute value + points.clear(); + absoluteValue[0] = 2.5; + OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); + assertEquals(2.5, points.get("test:observable-double-up-down-counter-absolute")); + + closeQuietly(observable); + } + @Test void testBatchCallback() { ObservableLongMeasurement longCounterObserver = @@ -385,18 +515,18 @@ void testBatchCallback() { points.clear(); OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); - // delta mode: counters show values added during last collect - assertEquals(1L, points.get("test:long-counter-observer")); - assertEquals(10L, points.get("test:long-counter-observer" + WITH_ATTRS)); - assertEquals(2.3, points.get("test:double-counter-observer")); - assertEquals(20.3, points.get("test:double-counter-observer" + WITH_ATTRS)); - // up-down counters stay cumulative: they show the running total - assertEquals(8L, points.get("test:long-up-down-counter-observer")); - assertEquals(80L, points.get("test:long-up-down-counter-observer" + WITH_ATTRS)); - assertEquals(11.2, (double) points.get("test:double-up-down-counter-observer"), 0.001); + // async counters show delta since last collect (same value was recorded) + assertEquals(0L, points.get("test:long-counter-observer")); + assertEquals(0L, points.get("test:long-counter-observer" + WITH_ATTRS)); + assertEquals(0.0, points.get("test:double-counter-observer")); + assertEquals(0.0, points.get("test:double-counter-observer" + WITH_ATTRS)); + // async up-down counters stay cumulative and show the latest value + assertEquals(4L, points.get("test:long-up-down-counter-observer")); + assertEquals(40L, points.get("test:long-up-down-counter-observer" + WITH_ATTRS)); + assertEquals(5.6, (double) points.get("test:double-up-down-counter-observer"), 0.001); assertEquals( - 101.2, (double) points.get("test:double-up-down-counter-observer" + WITH_ATTRS), 0.001); - // gauges also stay cumulative: they only show latest value + 50.6, (double) points.get("test:double-up-down-counter-observer" + WITH_ATTRS), 0.001); + // gauges continue to only show the latest value assertEquals(7L, points.get("test:long-gauge-observer")); assertEquals(70L, points.get("test:long-gauge-observer" + WITH_ATTRS)); assertEquals(8.9, points.get("test:double-gauge-observer")); @@ -407,18 +537,18 @@ void testBatchCallback() { points.clear(); OtelMetricRegistry.INSTANCE.collectMetrics(meterReader); - // delta mode: no values were added as batchCallback is closed + // delta mode: no counts were set as batchCallback is closed, so no data point assertNull(points.get("test:long-counter-observer")); assertNull(points.get("test:long-counter-observer" + WITH_ATTRS)); assertNull(points.get("test:double-counter-observer")); assertNull(points.get("test:double-counter-observer" + WITH_ATTRS)); - // up-down counters stay cumulative: they show the running total - assertEquals(8L, points.get("test:long-up-down-counter-observer")); - assertEquals(80L, points.get("test:long-up-down-counter-observer" + WITH_ATTRS)); - assertEquals(11.2, (double) points.get("test:double-up-down-counter-observer"), 0.001); + // up-down counters stay cumulative: they continue to show the last count set + assertEquals(4L, points.get("test:long-up-down-counter-observer")); + assertEquals(40L, points.get("test:long-up-down-counter-observer" + WITH_ATTRS)); + assertEquals(5.6, (double) points.get("test:double-up-down-counter-observer"), 0.001); assertEquals( - 101.2, (double) points.get("test:double-up-down-counter-observer" + WITH_ATTRS), 0.001); - // gauges also stay cumulative: they only show latest value + 50.6, (double) points.get("test:double-up-down-counter-observer" + WITH_ATTRS), 0.001); + // gauges also stay cumulative: they continue to show the latest value set assertEquals(7L, points.get("test:long-gauge-observer")); assertEquals(70L, points.get("test:long-gauge-observer" + WITH_ATTRS)); assertEquals(8.9, points.get("test:double-gauge-observer")); diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-annotations-1.20/gradle.lockfile b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-annotations-1.20/gradle.lockfile index aeec5b9ebdc..73d70eee7d7 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-annotations-1.20/gradle.lockfile +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-annotations-1.20/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:opentelemetry:opentelemetry-annotations-1.20:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latest1xDepTestCompileClasspath,latest1xDepTe com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latest1xDepTestAnnotationProcessor,latest1xDepTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -32,12 +33,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latest1xDepTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latest1xDepTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latest1xDepTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latest1xDepTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latest1xDepTestAnnotationProcessor,latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latest1xDepTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -50,20 +54,20 @@ de.thetaphi:forbiddenapis:3.10=compileClasspath,latest1xDepTestCompileClasspath, io.leangen.geantyref:geantyref:1.3.16=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations:1.20.0=compileClasspath,testCompileClasspath,testRuntimeClasspath io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations:1.33.6=latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath -io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations:2.27.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations:2.29.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.opentelemetry:opentelemetry-api:1.20.0=compileClasspath,testCompileClasspath,testRuntimeClasspath io.opentelemetry:opentelemetry-api:1.41.0=latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath -io.opentelemetry:opentelemetry-api:1.61.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.opentelemetry:opentelemetry-common:1.61.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.opentelemetry:opentelemetry-api:1.63.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.opentelemetry:opentelemetry-common:1.63.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.opentelemetry:opentelemetry-context:1.20.0=compileClasspath,testCompileClasspath,testRuntimeClasspath io.opentelemetry:opentelemetry-context:1.41.0=latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath -io.opentelemetry:opentelemetry-context:1.61.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.opentelemetry:opentelemetry-context:1.63.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -92,6 +96,7 @@ org.hamcrest:hamcrest-core:1.3=latest1xDepTestRuntimeClasspath,latestDepTestRunt org.hamcrest:hamcrest:3.0=latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -109,14 +114,14 @@ org.objenesis:objenesis:3.3=latest1xDepTestCompileClasspath,latest1xDepTestRunti org.opentest4j:opentest4j:1.3.0=latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latest1xDepTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latest1xDepTestCompileClasspath,latest1xDepTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-annotations-1.26/gradle.lockfile b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-annotations-1.26/gradle.lockfile index 0cea8b2b768..19a146a9fbb 100644 --- a/dd-java-agent/instrumentation/opentelemetry/opentelemetry-annotations-1.26/gradle.lockfile +++ b/dd-java-agent/instrumentation/opentelemetry/opentelemetry-annotations-1.26/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:opentelemetry:opentelemetry-annotations-1.26:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -32,12 +33,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -54,12 +58,12 @@ io.opentelemetry:opentelemetry-api:1.26.0=compileClasspath,testCompileClasspath, io.opentelemetry:opentelemetry-api:1.41.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.opentelemetry:opentelemetry-context:1.26.0=compileClasspath,testCompileClasspath,testRuntimeClasspath io.opentelemetry:opentelemetry-context:1.41.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -88,6 +92,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -105,14 +110,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/opentracing/opentracing-0.31/gradle.lockfile b/dd-java-agent/instrumentation/opentracing/opentracing-0.31/gradle.lockfile index 9d56afe0b81..3a5e73e74bc 100644 --- a/dd-java-agent/instrumentation/opentracing/opentracing-0.31/gradle.lockfile +++ b/dd-java-agent/instrumentation/opentracing/opentracing-0.31/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:opentracing:opentracing-0.31:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -50,12 +54,12 @@ io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath io.opentracing:opentracing-api:0.31.0=compileClasspath,testCompileClasspath,testRuntimeClasspath io.opentracing:opentracing-noop:0.31.0=compileClasspath,testCompileClasspath,testRuntimeClasspath io.opentracing:opentracing-util:0.31.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -84,6 +88,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -101,14 +106,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/opentracing/opentracing-0.31/src/main/java/datadog/trace/instrumentation/opentracing31/OTSpan.java b/dd-java-agent/instrumentation/opentracing/opentracing-0.31/src/main/java/datadog/trace/instrumentation/opentracing31/OTSpan.java index fcdb7b759dc..e33c98fb54f 100644 --- a/dd-java-agent/instrumentation/opentracing/opentracing-0.31/src/main/java/datadog/trace/instrumentation/opentracing31/OTSpan.java +++ b/dd-java-agent/instrumentation/opentracing/opentracing-0.31/src/main/java/datadog/trace/instrumentation/opentracing31/OTSpan.java @@ -30,7 +30,7 @@ class OTSpan implements Span, MutableSpan, WithAgentSpan, SpanWrapper { @Override public SpanContext context() { - return converter.toSpanContext(delegate.context()); + return converter.toSpanContext(delegate.spanContext()); } @Override diff --git a/dd-java-agent/instrumentation/opentracing/opentracing-0.31/src/main/java/datadog/trace/instrumentation/opentracing31/OTTracer.java b/dd-java-agent/instrumentation/opentracing/opentracing-0.31/src/main/java/datadog/trace/instrumentation/opentracing31/OTTracer.java index 1a121799024..32f62c86832 100644 --- a/dd-java-agent/instrumentation/opentracing/opentracing-0.31/src/main/java/datadog/trace/instrumentation/opentracing31/OTTracer.java +++ b/dd-java-agent/instrumentation/opentracing/opentracing-0.31/src/main/java/datadog/trace/instrumentation/opentracing31/OTTracer.java @@ -89,7 +89,7 @@ public Tracer.SpanBuilder asChildOf(final SpanContext parent) { @Override public Tracer.SpanBuilder asChildOf(final Span parent) { if (parent != null) { - delegate.asChildOf(converter.toAgentSpan(parent).context()); + delegate.asChildOf(converter.toAgentSpan(parent).spanContext()); } return this; } @@ -151,14 +151,14 @@ public Span startManual() { @Override public Span start() { final AgentSpan agentSpan = delegate.start(); - agentSpan.context().setIntegrationName("opentracing"); + agentSpan.spanContext().setIntegrationName("opentracing"); return converter.toSpan(agentSpan); } @Override public Scope startActive(final boolean finishSpanOnClose) { final AgentSpan agentSpan = delegate.start(); - agentSpan.context().setIntegrationName("opentracing"); + agentSpan.spanContext().setIntegrationName("opentracing"); return converter.toScope(tracer.activateManualSpan(agentSpan), finishSpanOnClose); } } diff --git a/dd-java-agent/instrumentation/opentracing/opentracing-0.31/src/main/java/datadog/trace/instrumentation/opentracing31/TypeConverter.java b/dd-java-agent/instrumentation/opentracing/opentracing-0.31/src/main/java/datadog/trace/instrumentation/opentracing31/TypeConverter.java index 09693fda11b..9d89a0c9320 100644 --- a/dd-java-agent/instrumentation/opentracing/opentracing-0.31/src/main/java/datadog/trace/instrumentation/opentracing31/TypeConverter.java +++ b/dd-java-agent/instrumentation/opentracing/opentracing-0.31/src/main/java/datadog/trace/instrumentation/opentracing31/TypeConverter.java @@ -1,6 +1,5 @@ package datadog.trace.instrumentation.opentracing31; -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopScope; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpanContext; @@ -18,13 +17,11 @@ public class TypeConverter { private final LogHandler logHandler; private final OTSpan noopSpanWrapper; private final OTSpanContext noopContextWrapper; - private final OTScopeManager.OTScope noopScopeWrapper; public TypeConverter(final LogHandler logHandler) { this.logHandler = logHandler; noopSpanWrapper = new OTSpan(noopSpan(), this, logHandler); noopContextWrapper = new OTSpanContext(noopSpanContext()); - noopScopeWrapper = new OTScopeManager.OTScope(noopScope(), false, this); } public AgentSpan toAgentSpan(final Span span) { @@ -58,9 +55,6 @@ public Scope toScope(final AgentScope scope, final boolean finishSpanOnClose) { if (scope == null) { return null; } - if (scope == noopScope()) { - return noopScopeWrapper; - } return new OTScopeManager.OTScope(scope, finishSpanOnClose, this); } diff --git a/dd-java-agent/instrumentation/opentracing/opentracing-0.31/src/test/groovy/OpenTracing31Test.groovy b/dd-java-agent/instrumentation/opentracing/opentracing-0.31/src/test/groovy/OpenTracing31Test.groovy index 2c41794bcaa..e1318ae4d45 100644 --- a/dd-java-agent/instrumentation/opentracing/opentracing-0.31/src/test/groovy/OpenTracing31Test.groovy +++ b/dd-java-agent/instrumentation/opentracing/opentracing-0.31/src/test/groovy/OpenTracing31Test.groovy @@ -1,3 +1,4 @@ +import datadog.context.Context import datadog.trace.agent.test.InstrumentationSpecification import datadog.trace.api.DDSpanId import datadog.trace.api.DDTags @@ -28,7 +29,6 @@ import io.opentracing.util.GlobalTracer import spock.lang.Subject import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopContinuation class OpenTracing31Test extends InstrumentationSpecification { @@ -112,7 +112,7 @@ class OpenTracing31Test extends InstrumentationSpecification { } defaultTags(addReference != null) } - assert span.context().integrationName == "opentracing" + assert span.spanContext().integrationName == "opentracing" } } } @@ -165,7 +165,7 @@ class OpenTracing31Test extends InstrumentationSpecification { span instanceof MutableSpan scope instanceof TraceScope !internalTracer.isAsyncPropagationEnabled() - (scope as TraceScope).capture() == noopContinuation() + (scope as TraceScope).capture().context() == Context.root() (tracer.scopeManager().active().span().delegate == span.delegate) when: diff --git a/dd-java-agent/instrumentation/opentracing/opentracing-0.31/src/test/groovy/TypeConverterTest.groovy b/dd-java-agent/instrumentation/opentracing/opentracing-0.31/src/test/groovy/TypeConverterTest.groovy index 9aba9eabaa8..fcdd67b9e4b 100644 --- a/dd-java-agent/instrumentation/opentracing/opentracing-0.31/src/test/groovy/TypeConverterTest.groovy +++ b/dd-java-agent/instrumentation/opentracing/opentracing-0.31/src/test/groovy/TypeConverterTest.groovy @@ -8,9 +8,9 @@ import datadog.trace.core.DDSpanContext import datadog.trace.core.PendingTrace import datadog.trace.core.propagation.PropagationTags import datadog.trace.instrumentation.opentracing.DefaultLogHandler +import datadog.trace.bootstrap.instrumentation.api.AgentScope import datadog.trace.instrumentation.opentracing31.TypeConverter -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopScope import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpan import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpanContext @@ -40,14 +40,14 @@ class TypeConverterTest extends InstrumentationSpecification { typeConverter.toSpanContext(noopContext) is typeConverter.toSpanContext(noopContext) } - def "should avoid the noop scope wrapper allocation"() { - def noopScope = noopScope() + def "should reuse the noop span wrapper via scope"() { + def noopScope = Stub(AgentScope) { + span() >> noopSpan() + } + def noopSpanWrapper = typeConverter.toSpan(noopSpan()) expect: - typeConverter.toScope(noopScope, true) is typeConverter.toScope(noopScope, true) - typeConverter.toScope(noopScope, false) is typeConverter.toScope(noopScope, false) - // noop scopes expected to be the same despite the finishSpanOnClose flag - typeConverter.toScope(noopScope, true) is typeConverter.toScope(noopScope, false) - typeConverter.toScope(noopScope, false) is typeConverter.toScope(noopScope, true) + typeConverter.toScope(noopScope, true).span() is noopSpanWrapper + typeConverter.toScope(noopScope, false).span() is noopSpanWrapper } def createTestSpanContext() { diff --git a/dd-java-agent/instrumentation/opentracing/opentracing-0.32/gradle.lockfile b/dd-java-agent/instrumentation/opentracing/opentracing-0.32/gradle.lockfile index eae696f8393..cf42f779e6e 100644 --- a/dd-java-agent/instrumentation/opentracing/opentracing-0.32/gradle.lockfile +++ b/dd-java-agent/instrumentation/opentracing/opentracing-0.32/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:opentracing:opentracing-0.32:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -53,12 +57,12 @@ io.opentracing:opentracing-noop:0.32.0=compileClasspath,testCompileClasspath,tes io.opentracing:opentracing-noop:0.33.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.opentracing:opentracing-util:0.32.0=compileClasspath,testCompileClasspath,testRuntimeClasspath io.opentracing:opentracing-util:0.33.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,6 +91,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -104,14 +109,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/opentracing/opentracing-0.32/src/main/java/datadog/trace/instrumentation/opentracing32/OTSpan.java b/dd-java-agent/instrumentation/opentracing/opentracing-0.32/src/main/java/datadog/trace/instrumentation/opentracing32/OTSpan.java index 8fd4213eb16..b8e60b6b4b7 100644 --- a/dd-java-agent/instrumentation/opentracing/opentracing-0.32/src/main/java/datadog/trace/instrumentation/opentracing32/OTSpan.java +++ b/dd-java-agent/instrumentation/opentracing/opentracing-0.32/src/main/java/datadog/trace/instrumentation/opentracing32/OTSpan.java @@ -31,7 +31,7 @@ class OTSpan implements Span, MutableSpan, WithAgentSpan, SpanWrapper { @Override public SpanContext context() { - return converter.toSpanContext(delegate.context()); + return converter.toSpanContext(delegate.spanContext()); } @Override diff --git a/dd-java-agent/instrumentation/opentracing/opentracing-0.32/src/main/java/datadog/trace/instrumentation/opentracing32/OTTracer.java b/dd-java-agent/instrumentation/opentracing/opentracing-0.32/src/main/java/datadog/trace/instrumentation/opentracing32/OTTracer.java index ab4e2ebea92..ba2ce8313c0 100644 --- a/dd-java-agent/instrumentation/opentracing/opentracing-0.32/src/main/java/datadog/trace/instrumentation/opentracing32/OTTracer.java +++ b/dd-java-agent/instrumentation/opentracing/opentracing-0.32/src/main/java/datadog/trace/instrumentation/opentracing32/OTTracer.java @@ -105,7 +105,7 @@ public Tracer.SpanBuilder asChildOf(final SpanContext parent) { @Override public Tracer.SpanBuilder asChildOf(final Span parent) { if (parent != null) { - delegate.asChildOf(converter.toAgentSpan(parent).context()); + delegate.asChildOf(converter.toAgentSpan(parent).spanContext()); } return this; } @@ -173,14 +173,14 @@ public Span startManual() { @Override public Span start() { final AgentSpan agentSpan = delegate.start(); - agentSpan.context().setIntegrationName("opentracing"); + agentSpan.spanContext().setIntegrationName("opentracing"); return converter.toSpan(agentSpan); } @Override public Scope startActive(final boolean finishSpanOnClose) { final AgentSpan agentSpan = delegate.start(); - agentSpan.context().setIntegrationName("opentracing"); + agentSpan.spanContext().setIntegrationName("opentracing"); return converter.toScope(tracer.activateManualSpan(agentSpan), finishSpanOnClose); } } diff --git a/dd-java-agent/instrumentation/opentracing/opentracing-0.32/src/main/java/datadog/trace/instrumentation/opentracing32/TypeConverter.java b/dd-java-agent/instrumentation/opentracing/opentracing-0.32/src/main/java/datadog/trace/instrumentation/opentracing32/TypeConverter.java index 6067d9c2be3..2d2b78b8146 100644 --- a/dd-java-agent/instrumentation/opentracing/opentracing-0.32/src/main/java/datadog/trace/instrumentation/opentracing32/TypeConverter.java +++ b/dd-java-agent/instrumentation/opentracing/opentracing-0.32/src/main/java/datadog/trace/instrumentation/opentracing32/TypeConverter.java @@ -1,6 +1,5 @@ package datadog.trace.instrumentation.opentracing32; -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopScope; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpanContext; @@ -18,13 +17,11 @@ public class TypeConverter { private final LogHandler logHandler; private final OTSpan noopSpanWrapper; private final OTSpanContext noopContextWrapper; - private final OTScopeManager.OTScope noopScopeWrapper; public TypeConverter(final LogHandler logHandler) { this.logHandler = logHandler; noopSpanWrapper = new OTSpan(noopSpan(), this, logHandler); noopContextWrapper = new OTSpanContext(noopSpanContext()); - noopScopeWrapper = new OTScopeManager.OTScope(noopScope(), false, this); } public AgentSpan toAgentSpan(final Span span) { @@ -58,9 +55,6 @@ public Scope toScope(final AgentScope scope, final boolean finishSpanOnClose) { if (scope == null) { return null; } - if (scope == noopScope()) { - return noopScopeWrapper; - } return new OTScopeManager.OTScope(scope, finishSpanOnClose, this); } diff --git a/dd-java-agent/instrumentation/opentracing/opentracing-0.32/src/test/groovy/OpenTracing32Test.groovy b/dd-java-agent/instrumentation/opentracing/opentracing-0.32/src/test/groovy/OpenTracing32Test.groovy index e262f947a14..c02f3a5b71c 100644 --- a/dd-java-agent/instrumentation/opentracing/opentracing-0.32/src/test/groovy/OpenTracing32Test.groovy +++ b/dd-java-agent/instrumentation/opentracing/opentracing-0.32/src/test/groovy/OpenTracing32Test.groovy @@ -1,3 +1,4 @@ +import datadog.context.Context import datadog.trace.agent.test.InstrumentationSpecification import datadog.trace.api.DDSpanId import datadog.trace.api.DDTags @@ -34,7 +35,6 @@ import static datadog.trace.api.sampling.PrioritySampling.USER_KEEP import static datadog.trace.api.sampling.SamplingMechanism.AGENT_RATE import static datadog.trace.api.sampling.SamplingMechanism.DEFAULT import static datadog.trace.api.sampling.SamplingMechanism.MANUAL -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopContinuation class OpenTracing32Test extends InstrumentationSpecification { @@ -118,7 +118,7 @@ class OpenTracing32Test extends InstrumentationSpecification { } defaultTags(addReference != null) } - assert span.context().integrationName == "opentracing" + assert span.spanContext().integrationName == "opentracing" } } } @@ -176,7 +176,7 @@ class OpenTracing32Test extends InstrumentationSpecification { span instanceof MutableSpan scope instanceof TraceScope !internalTracer.isAsyncPropagationEnabled() - (scope as TraceScope).capture() == noopContinuation() + (scope as TraceScope).capture().context() == Context.root() (tracer.scopeManager().active().span().delegate == span.delegate) when: diff --git a/dd-java-agent/instrumentation/opentracing/opentracing-0.32/src/test/groovy/TypeConverterTest.groovy b/dd-java-agent/instrumentation/opentracing/opentracing-0.32/src/test/groovy/TypeConverterTest.groovy index cb05e4b1737..795964ec8eb 100644 --- a/dd-java-agent/instrumentation/opentracing/opentracing-0.32/src/test/groovy/TypeConverterTest.groovy +++ b/dd-java-agent/instrumentation/opentracing/opentracing-0.32/src/test/groovy/TypeConverterTest.groovy @@ -8,9 +8,9 @@ import datadog.trace.core.DDSpanContext import datadog.trace.core.PendingTrace import datadog.trace.core.propagation.PropagationTags import datadog.trace.instrumentation.opentracing.DefaultLogHandler +import datadog.trace.bootstrap.instrumentation.api.AgentScope import datadog.trace.instrumentation.opentracing32.TypeConverter -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopScope import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpan import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpanContext @@ -40,14 +40,14 @@ class TypeConverterTest extends InstrumentationSpecification { typeConverter.toSpanContext(noopContext) is typeConverter.toSpanContext(noopContext) } - def "should avoid the noop scope wrapper allocation"() { - def noopScope = noopScope() + def "should reuse the noop span wrapper via scope"() { + def noopScope = Stub(AgentScope) { + span() >> noopSpan() + } + def noopSpanWrapper = typeConverter.toSpan(noopSpan()) expect: - typeConverter.toScope(noopScope, true) is typeConverter.toScope(noopScope, true) - typeConverter.toScope(noopScope, false) is typeConverter.toScope(noopScope, false) - // noop scopes expected to be the same despite the finishSpanOnClose flag - typeConverter.toScope(noopScope, true) is typeConverter.toScope(noopScope, false) - typeConverter.toScope(noopScope, false) is typeConverter.toScope(noopScope, true) + typeConverter.toScope(noopScope, true).span() is noopSpanWrapper + typeConverter.toScope(noopScope, false).span() is noopSpanWrapper } def createTestSpanContext() { diff --git a/dd-java-agent/instrumentation/opentracing/opentracing-common/gradle.lockfile b/dd-java-agent/instrumentation/opentracing/opentracing-common/gradle.lockfile index 3e33624c7eb..a985ed1379c 100644 --- a/dd-java-agent/instrumentation/opentracing/opentracing-common/gradle.lockfile +++ b/dd-java-agent/instrumentation/opentracing/opentracing-common/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:opentracing:opentracing-common:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -50,12 +54,12 @@ io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath io.opentracing:opentracing-api:0.31.0=compileClasspath io.opentracing:opentracing-noop:0.31.0=compileClasspath io.opentracing:opentracing-util:0.31.0=compileClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -84,6 +88,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -101,14 +106,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/org-json-20230227/gradle.lockfile b/dd-java-agent/instrumentation/org-json-20230227/gradle.lockfile index 8e8db739b95..a198c6c02d7 100644 --- a/dd-java-agent/instrumentation/org-json-20230227/gradle.lockfile +++ b/dd-java-agent/instrumentation/org-json-20230227/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:org-json-20230227:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -83,6 +87,7 @@ org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeCl org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.json:json:20230227=compileClasspath,testCompileClasspath,testRuntimeClasspath org.json:json:20250107=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -100,14 +105,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/osgi-4.3/gradle.lockfile b/dd-java-agent/instrumentation/osgi-4.3/gradle.lockfile index bb58b62e76b..865c47fe7d6 100644 --- a/dd-java-agent/instrumentation/osgi-4.3/gradle.lockfile +++ b/dd-java-agent/instrumentation/osgi-4.3/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:osgi-4.3:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -99,14 +104,14 @@ org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.osgi:org.osgi.core:4.3.0=compileClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/owasp-esapi-2.1/gradle.lockfile b/dd-java-agent/instrumentation/owasp-esapi-2.1/gradle.lockfile index 884e404c20e..6490ac017ef 100644 --- a/dd-java-agent/instrumentation/owasp-esapi-2.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/owasp-esapi-2.1/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:owasp-esapi-2.1:dependencies --write-locks avalon-framework:avalon-framework:4.1.3=compileClasspath,csiCompileClasspath,testCompileClasspath,testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -9,20 +10,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,csiCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -32,12 +33,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,csiCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -65,15 +69,15 @@ commons-logging:commons-logging:1.1=compileClasspath,csiCompileClasspath,testCom commons-logging:commons-logging:1.3.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:servlet-api:2.3=compileClasspath,csiCompileClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath log4j:log4j:1.2.16=compileClasspath,csiCompileClasspath,testCompileClasspath,testRuntimeClasspath logkit:logkit:1.0.1=compileClasspath,csiCompileClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -119,6 +123,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.htmlunit:neko-htmlunit:4.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -136,14 +141,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.owasp.antisamy:antisamy:1.4.3=compileClasspath,csiCompileClasspath,testCompileClasspath,testRuntimeClasspath org.owasp.antisamy:antisamy:1.7.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.owasp.esapi:esapi:2.1.0=compileClasspath,csiCompileClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/build.gradle b/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/build.gradle index f69a08031c1..7b97c7cdf79 100644 --- a/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/build.gradle +++ b/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/build.gradle @@ -22,10 +22,14 @@ apply from: "$rootDir/gradle/java.gradle" apply from: "$rootDir/gradle/test-with-scala.gradle" addTestSuiteForDir('latestDepTest', 'test') +addTestSuiteExtendingForDir('latestDepForkedTest', 'latestDepTest', 'test') tasks.named("compileLatestDepTestGroovy", GroovyCompile) { classpath += files(sourceSets.latestDepTest.scala.classesDirectory) } +tasks.named("compileLatestDepForkedTestGroovy", GroovyCompile) { + classpath += files(sourceSets.latestDepForkedTest.scala.classesDirectory) +} dependencies { compileOnly group: 'org.apache.pekko', name: "pekko-actor_2.12", version: pekkoVersion diff --git a/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/gradle.lockfile b/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/gradle.lockfile index 588205b7814..34d04e9f0f5 100644 --- a/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/gradle.lockfile @@ -1,70 +1,73 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. -cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath -cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath -ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:pekko:pekko-concurrent-1.0:dependencies --write-locks +cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.eed3si9n:shaded-jawn-parser_2.13:1.3.2=zinc com.eed3si9n:shaded-scalajson_2.13:1.0.0-M4=zinc com.eed3si9n:sjson-new-core_2.13:0.10.1=zinc com.eed3si9n:sjson-new-scalajson_2.13:0.10.1=zinc com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs -com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath -com.google.auto.service:auto-service:1.1.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.auto:auto-common:1.2.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath +com.google.auto.service:auto-service:1.1.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.auto:auto-common:1.2.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs -com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc -com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.squareup.okio:okio:1.17.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.okio:okio:1.17.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.swoval:file-tree-views:2.1.12=zinc com.thoughtworks.qdox:qdox:1.12.1=codenarc com.typesafe:config:1.4.2=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.typesafe:config:1.4.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -commons-fileupload:commons-fileupload:1.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.typesafe:config:1.4.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +commons-fileupload:commons-fileupload:1.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs -de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc -io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath -javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.github.java-diff-utils:java-diff-utils:4.15=zinc +io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc -net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.openhft:zero-allocation-hashing:0.16=zinc net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc @@ -76,99 +79,100 @@ org.apache.logging.log4j:log4j-api:2.17.1=zinc org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.17.1=zinc org.apache.logging.log4j:log4j-core:2.25.2=spotbugs -org.apache.pekko:pekko-actor_2.12:1.0.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.pekko:pekko-actor_2.13:1.6.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.apache.pekko:pekko-testkit_2.12:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.pekko:pekko-testkit_2.13:1.6.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.apiguardian:apiguardian-api:1.1.2=latestDepTestCompileClasspath,testCompileClasspath -org.checkerframework:checker-qual:3.33.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +org.apache.pekko:pekko-actor_2.12:1.0.0=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.apache.pekko:pekko-actor_2.13:1.6.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.pekko:pekko-testkit_2.12:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.apache.pekko:pekko-testkit_2.13:1.6.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apiguardian:apiguardian-api:1.1.2=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath,testCompileClasspath +org.checkerframework:checker-qual:3.33.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc org.codehaus.groovy:groovy-json:3.0.23=codenarc -org.codehaus.groovy:groovy-json:3.0.25=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-json:3.0.25=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codehaus.groovy:groovy-templates:3.0.23=codenarc org.codehaus.groovy:groovy-xml:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.23=codenarc -org.codehaus.groovy:groovy:3.0.25=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy:3.0.25=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc -org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.hamcrest:hamcrest-core:1.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc -org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-commons:1.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-engine:1.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-launcher:1.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-runner:1.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-api:1.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-commons:1.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jline:jline:3.27.1=zinc +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-runner:1.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-api:1.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-commons:1.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs -org.junit:junit-bom:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.mockito:mockito-core:4.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit:junit-bom:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-core:4.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-lang.modules:scala-java8-compat_2.12:1.0.2=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.scala-lang.modules:scala-java8-compat_2.12:1.0.2=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=zinc org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.12.18=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-lang:scala-library:2.13.15=zinc -org.scala-lang:scala-library:2.13.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.scala-lang:scala-reflect:2.13.15=zinc -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-lang:scala-library:2.13.16=zinc +org.scala-lang:scala-library:2.13.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.scala-lang:scala-reflect:2.13.16=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc -org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc +org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath -org.slf4j:slf4j-api:1.7.32=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.32=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j -org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath -org.spockframework:spock-bom:2.4-groovy-3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.spockframework:spock-core:2.4-groovy-3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-junit:1.2.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-parser:1.2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +org.spockframework:spock-bom:2.4-groovy-3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.spockframework:spock-core:2.4-groovy-3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-junit:1.2.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-parser:1.2.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs empty=scalaCompilerPlugins,scalaToolchainRuntimeClasspath,spotbugsPlugins diff --git a/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/main/java/datadog/trace/instrumentation/pekko/concurrent/PekkoActorCellInstrumentation.java b/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/main/java/datadog/trace/instrumentation/pekko/concurrent/PekkoActorCellInstrumentation.java index e33bae813e6..2778831de22 100644 --- a/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/main/java/datadog/trace/instrumentation/pekko/concurrent/PekkoActorCellInstrumentation.java +++ b/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/main/java/datadog/trace/instrumentation/pekko/concurrent/PekkoActorCellInstrumentation.java @@ -3,17 +3,17 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.checkpointActiveForRollback; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.rollbackActiveToCheckpoint; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; import static java.util.Collections.singletonMap; import static net.bytebuddy.matcher.ElementMatchers.isMethod; import com.google.auto.service.AutoService; import datadog.context.Context; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.api.InstrumenterConfig; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.java.concurrent.AdviceUtils; import datadog.trace.bootstrap.instrumentation.java.concurrent.State; import java.util.Map; @@ -59,7 +59,7 @@ public static class InvokeAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) public static Context enter( @Advice.Argument(value = 0) Envelope envelope, - @Advice.Local("taskScope") AgentScope taskScope) { + @Advice.Local("taskScope") ContextScope taskScope) { // do this before checkpointing, as the envelope's task scope may already be active taskScope = @@ -71,13 +71,14 @@ public static Context enter( checkpointActiveForRollback(); return null; } else { - return getCurrentContext().swap(); + return currentContext().swap(); } } @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void exit( - @Advice.Local("taskScope") AgentScope taskScope, @Advice.Enter Context checkpointContext) { + @Advice.Local("taskScope") ContextScope taskScope, + @Advice.Enter Context checkpointContext) { if (checkpointContext == null) { // Clean up any leaking scopes from pekko-streams/pekko-http etc. diff --git a/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/main/java/datadog/trace/instrumentation/pekko/concurrent/PekkoForkJoinExecutorTaskInstrumentation.java b/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/main/java/datadog/trace/instrumentation/pekko/concurrent/PekkoForkJoinExecutorTaskInstrumentation.java index 0919d84f9c1..522fda36949 100644 --- a/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/main/java/datadog/trace/instrumentation/pekko/concurrent/PekkoForkJoinExecutorTaskInstrumentation.java +++ b/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/main/java/datadog/trace/instrumentation/pekko/concurrent/PekkoForkJoinExecutorTaskInstrumentation.java @@ -9,10 +9,10 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArgument; import com.google.auto.service.AutoService; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.java.concurrent.State; import java.util.Collections; import java.util.Map; @@ -58,12 +58,12 @@ public static void construct(@Advice.Argument(0) Runnable wrapped) { public static final class Run { @Advice.OnMethodEnter - public static AgentScope before(@Advice.Argument(0) Runnable wrapped) { + public static ContextScope before(@Advice.Argument(0) Runnable wrapped) { return startTaskScope(InstrumentationContext.get(Runnable.class, State.class), wrapped); } @Advice.OnMethodExit(onThrowable = Throwable.class) - public static void after(@Advice.Enter AgentScope scope) { + public static void after(@Advice.Enter ContextScope scope) { endTaskScope(scope); } } diff --git a/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/main/java/datadog/trace/instrumentation/pekko/concurrent/PekkoMailboxInstrumentation.java b/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/main/java/datadog/trace/instrumentation/pekko/concurrent/PekkoMailboxInstrumentation.java index 83c144a8c36..ab33ee024c7 100644 --- a/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/main/java/datadog/trace/instrumentation/pekko/concurrent/PekkoMailboxInstrumentation.java +++ b/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/main/java/datadog/trace/instrumentation/pekko/concurrent/PekkoMailboxInstrumentation.java @@ -3,26 +3,19 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.checkpointActiveForRollback; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.rollbackActiveToCheckpoint; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; -import static java.util.Collections.singletonList; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; import static net.bytebuddy.matcher.ElementMatchers.isMethod; import com.google.auto.service.AutoService; import datadog.context.Context; -import datadog.trace.agent.tooling.ExcludeFilterProvider; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.api.InstrumenterConfig; -import datadog.trace.bootstrap.instrumentation.java.concurrent.ExcludeFilter; -import java.util.Collection; -import java.util.EnumMap; -import java.util.List; -import java.util.Map; import net.bytebuddy.asm.Advice; @AutoService(InstrumenterModule.class) public class PekkoMailboxInstrumentation extends InstrumenterModule.ContextTracking - implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice, ExcludeFilterProvider { + implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { public PekkoMailboxInstrumentation() { super("pekko_actor_mailbox", "pekko_actor", "pekko_concurrent", "java_concurrent"); @@ -39,16 +32,6 @@ public void methodAdvice(MethodTransformer transformer) { isMethod().and(named("run")), getClass().getName() + "$SuppressMailboxRunAdvice"); } - @Override - public Map> excludedClasses() { - List excludedClass = singletonList("org.apache.pekko.dispatch.MailBox"); - EnumMap> excludedTypes = - new EnumMap<>(ExcludeFilter.ExcludeType.class); - excludedTypes.put(ExcludeFilter.ExcludeType.RUNNABLE, excludedClass); - excludedTypes.put(ExcludeFilter.ExcludeType.FORK_JOIN_TASK, excludedClass); - return excludedTypes; - } - /** * This instrumentation is defensive and closes all scopes on the scope stack that were not there * when we started processing this actor mailbox. The reason for that is twofold. @@ -68,7 +51,7 @@ public static Context enter() { checkpointActiveForRollback(); return null; } else { - return getCurrentContext().swap(); + return currentContext().swap(); } } diff --git a/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/main/java/datadog/trace/instrumentation/pekko/concurrent/PekkoRoutedActorCellInstrumentation.java b/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/main/java/datadog/trace/instrumentation/pekko/concurrent/PekkoRoutedActorCellInstrumentation.java index 2211cf173ca..a89eaea3892 100644 --- a/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/main/java/datadog/trace/instrumentation/pekko/concurrent/PekkoRoutedActorCellInstrumentation.java +++ b/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/main/java/datadog/trace/instrumentation/pekko/concurrent/PekkoRoutedActorCellInstrumentation.java @@ -6,10 +6,10 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArgument; import com.google.auto.service.AutoService; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.java.concurrent.AdviceUtils; import datadog.trace.bootstrap.instrumentation.java.concurrent.State; import java.util.Map; @@ -51,7 +51,7 @@ public void methodAdvice(MethodTransformer transformer) { */ public static class SendMessageAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) - public static AgentScope enter( + public static ContextScope enter( @Advice.This RoutedActorCell zis, @Advice.Argument(value = 0) Envelope envelope) { // If this isn't a management message, it will be deconstructed before being routed through // the routing logic, so activate the Scope @@ -64,7 +64,7 @@ public static AgentScope enter( } @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) - public static void exit(@Advice.Enter AgentScope scope) { + public static void exit(@Advice.Enter ContextScope scope) { if (null != scope) { scope.close(); // then we have invoked an Envelope and need to mark the work complete diff --git a/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/test/groovy/PekkoActorTest.groovy b/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/test/groovy/PekkoActorTest.groovy index 7b04c19422b..9b70f175ce5 100644 --- a/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/test/groovy/PekkoActorTest.groovy +++ b/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/test/groovy/PekkoActorTest.groovy @@ -1,11 +1,13 @@ import datadog.trace.agent.test.InstrumentationSpecification import datadog.trace.api.config.TraceInstrumentationConfig import datadog.trace.bootstrap.instrumentation.api.Tags +import spock.lang.AutoCleanup import spock.lang.Shared class PekkoActorTest extends InstrumentationSpecification { @Shared + @AutoCleanup def pekkoTester = new PekkoActors() @Override @@ -122,7 +124,7 @@ class PekkoActorTest extends InstrumentationSpecification { } } -class PekkoActorContextSwapTest extends PekkoActorTest { +class PekkoActorContextSwapForkedTest extends PekkoActorTest { @Override void configurePreAgent() { super.configurePreAgent() diff --git a/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/test/scala/PekkoActors.scala b/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/test/scala/PekkoActors.scala index b1918acd4fa..47f6f2118aa 100644 --- a/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/test/scala/PekkoActors.scala +++ b/dd-java-agent/instrumentation/pekko/pekko-concurrent-1.0/src/test/scala/PekkoActors.scala @@ -13,6 +13,7 @@ import datadog.trace.bootstrap.instrumentation.api.AgentTracer.{ startSpan } +import scala.concurrent.Await import scala.concurrent.duration._ class PekkoActors extends AutoCloseable { @@ -90,26 +91,9 @@ class PekkoActors extends AutoCloseable { object PekkoActors { - // The way to terminate an actor system has changed between versions - val terminate: (ActorSystem) => Unit = { - val t = - try { - ActorSystem.getClass.getMethod("terminate") - } catch { - case _: Throwable => - try { - ActorSystem.getClass.getMethod("awaitTermination") - } catch { - case _: Throwable => null - } - } - if (t ne null) { - { system: ActorSystem => - t.invoke(system) - } - } else { - { _ => ??? } - } + val terminate: (ActorSystem) => Unit = { system => + system.terminate() + Await.ready(system.whenTerminated, 30.seconds) } } diff --git a/dd-java-agent/instrumentation/pekko/pekko-http-1.0/gradle.lockfile b/dd-java-agent/instrumentation/pekko/pekko-http-1.0/gradle.lockfile index 353493e99d1..083466729a7 100644 --- a/dd-java-agent/instrumentation/pekko/pekko-http-1.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/pekko/pekko-http-1.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:pekko:pekko-http-1.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=baseTestCompileClasspath,baseTestRuntimeClass com.blogspot.mydailyjava:weak-lock-free:0.17=baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath @@ -27,17 +28,17 @@ com.fasterxml.jackson.module:jackson-module-scala_2.13:2.18.0=latestDepIastTestC com.fasterxml.jackson:jackson-bom:2.15.2=iastTestCompileClasspath,iastTestRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.18.0=latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath com.github.pjfanning:pekko-http-jackson_2.12:2.1.0=iastTestCompileClasspath,iastTestRuntimeClasspath com.github.pjfanning:pekko-http-jackson_2.13:2.8.0=latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,baseTestAnnotationProcessor,baseTestCompileClasspath,compileClasspath,csiCompileClasspath,iastTestAnnotationProcessor,iastTestCompileClasspath,latestDepIastTestAnnotationProcessor,latestDepIastTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestPekko10TestAnnotationProcessor,latestPekko10TestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -47,12 +48,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,baseTestAnnotationProc com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,baseTestAnnotationProcessor,iastTestAnnotationProcessor,latestDepIastTestAnnotationProcessor,latestDepTestAnnotationProcessor,latestPekko10TestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,baseTestAnnotationProcessor,iastTestAnnotationProcessor,latestDepIastTestAnnotationProcessor,latestDepTestAnnotationProcessor,latestPekko10TestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,baseTestAnnotationProcessor,iastTestAnnotationProcessor,latestDepIastTestAnnotationProcessor,latestDepTestAnnotationProcessor,latestPekko10TestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,baseTestAnnotationProcessor,iastTestAnnotationProcessor,latestDepIastTestAnnotationProcessor,latestDepTestAnnotationProcessor,latestPekko10TestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,baseTestAnnotationProcessor,baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestAnnotationProcessor,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestAnnotationProcessor,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestAnnotationProcessor,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,baseTestAnnotationProcessor,iastTestAnnotationProcessor,latestDepIastTestAnnotationProcessor,latestDepTestAnnotationProcessor,latestPekko10TestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.squareup.moshi:moshi:1.11.0=baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -71,16 +75,15 @@ commons-fileupload:commons-fileupload:1.5=baseTestCompileClasspath,baseTestRunti commons-io:commons-io:2.11.0=baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.leangen.geantyref:geantyref:1.3.16=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.8.0=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath net.openhft:zero-allocation-hashing:0.16=zinc net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -126,7 +129,7 @@ org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -135,7 +138,8 @@ org.jctools:jctools-core:4.0.6=baseTestRuntimeClasspath,iastTestRuntimeClasspath org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc +org.jspecify:jspecify:1.0.0=baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -153,14 +157,14 @@ org.objenesis:objenesis:3.3=baseTestCompileClasspath,baseTestRuntimeClasspath,ia org.opentest4j:opentest4j:1.3.0=baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=baseTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepIastTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestPekko10TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.parboiled:parboiled_2.12:2.5.0=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath org.parboiled:parboiled_2.13:2.5.0=latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath org.parboiled:parboiled_2.13:2.5.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -170,33 +174,34 @@ org.scala-lang.modules:scala-java8-compat_2.13:1.0.2=latestDepIastTestCompileCla org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=zinc org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.12.18=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath,csiCompileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath org.scala-lang:scala-library:2.13.13=latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath -org.scala-lang:scala-library:2.13.15=latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,zinc +org.scala-lang:scala-library:2.13.15=latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath +org.scala-lang:scala-library:2.13.16=zinc org.scala-lang:scala-library:2.13.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.scala-lang:scala-reflect:2.13.15=zinc -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-lang:scala-reflect:2.13.16=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.slf4j:jcl-over-slf4j:1.7.30=baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=baseTestCompileClasspath,baseTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepIastTestCompileClasspath,latestDepIastTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestPekko10TestCompileClasspath,latestPekko10TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/pekko/pekko-http-1.0/src/main/java/datadog/trace/instrumentation/pekkohttp/PekkoHttp2ServerInstrumentation.java b/dd-java-agent/instrumentation/pekko/pekko-http-1.0/src/main/java/datadog/trace/instrumentation/pekkohttp/PekkoHttp2ServerInstrumentation.java index ab630330a73..9899e04f6af 100644 --- a/dd-java-agent/instrumentation/pekko/pekko-http-1.0/src/main/java/datadog/trace/instrumentation/pekkohttp/PekkoHttp2ServerInstrumentation.java +++ b/dd-java-agent/instrumentation/pekko/pekko-http-1.0/src/main/java/datadog/trace/instrumentation/pekkohttp/PekkoHttp2ServerInstrumentation.java @@ -84,7 +84,7 @@ public static void enter( } } - @OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void exit() { CallDepthThreadLocalMap.decrementCallDepth(HttpExt.class); } @@ -101,7 +101,7 @@ public static void enter( } } - @OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void exit() { CallDepthThreadLocalMap.decrementCallDepth(HttpExt.class); } @@ -118,7 +118,7 @@ public static void enter( } } - @OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void exit() { CallDepthThreadLocalMap.decrementCallDepth(HttpExt.class); } diff --git a/dd-java-agent/instrumentation/pekko/pekko-http-1.0/src/main/java/datadog/trace/instrumentation/pekkohttp/PekkoHttpServerInstrumentation.java b/dd-java-agent/instrumentation/pekko/pekko-http-1.0/src/main/java/datadog/trace/instrumentation/pekkohttp/PekkoHttpServerInstrumentation.java index f9d7fbc363f..bb74992b00c 100644 --- a/dd-java-agent/instrumentation/pekko/pekko-http-1.0/src/main/java/datadog/trace/instrumentation/pekkohttp/PekkoHttpServerInstrumentation.java +++ b/dd-java-agent/instrumentation/pekko/pekko-http-1.0/src/main/java/datadog/trace/instrumentation/pekkohttp/PekkoHttpServerInstrumentation.java @@ -98,7 +98,7 @@ public static void enter( } } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void exit() { CallDepthThreadLocalMap.decrementCallDepth(HttpExt.class); } diff --git a/dd-java-agent/instrumentation/pekko/pekko-http-1.0/src/main/java/datadog/trace/instrumentation/pekkohttp/PekkoHttpSingleRequestInstrumentation.java b/dd-java-agent/instrumentation/pekko/pekko-http-1.0/src/main/java/datadog/trace/instrumentation/pekkohttp/PekkoHttpSingleRequestInstrumentation.java index fd4be3153c4..4625cdfe955 100644 --- a/dd-java-agent/instrumentation/pekko/pekko-http-1.0/src/main/java/datadog/trace/instrumentation/pekkohttp/PekkoHttpSingleRequestInstrumentation.java +++ b/dd-java-agent/instrumentation/pekko/pekko-http-1.0/src/main/java/datadog/trace/instrumentation/pekkohttp/PekkoHttpSingleRequestInstrumentation.java @@ -4,7 +4,7 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; import static datadog.trace.instrumentation.pekkohttp.PekkoHttpClientDecorator.DECORATE; import static datadog.trace.instrumentation.pekkohttp.PekkoHttpClientDecorator.PEKKO_CLIENT_REQUEST; import static datadog.trace.instrumentation.pekkohttp.PekkoHttpClientDecorator.PEKKO_HTTP_CLIENT; @@ -100,12 +100,13 @@ public static void methodExit( if (throwable == null) { responseFuture.onComplete(new OnCompleteHandler(span), thiz.system().dispatcher()); + scope.close(); } else { DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); + scope.close(); span.finish(); } - scope.close(); } } @@ -115,7 +116,7 @@ public static class SingleRequestContextPropagationAdvice { public static void methodEnter( @Advice.Argument(value = 0, readOnly = false) HttpRequest request) { final PekkoHttpHeaders headers = new PekkoHttpHeaders(request); - DECORATE.injectContext(getCurrentContext(), request, headers); + DECORATE.injectContext(currentContext(), request, headers); request = headers.getRequest(); } } diff --git a/dd-java-agent/instrumentation/play-ws/play-ws-1.0/gradle.lockfile b/dd-java-agent/instrumentation/play-ws/play-ws-1.0/gradle.lockfile index 4afb5619437..f551e04c035 100644 --- a/dd-java-agent/instrumentation/play-ws/play-ws-1.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/play-ws/play-ws-1.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:play-ws:play-ws-1.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -66,15 +70,15 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.inject:javax.inject:1=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.7=compileClasspath,testCompileClasspath,testRuntimeClasspath joda-time:joda-time:2.9.9=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -105,6 +109,7 @@ org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeCl org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.joda:joda-convert:1.7=compileClasspath,testCompileClasspath,testRuntimeClasspath org.joda:joda-convert:1.9.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -122,14 +127,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.scala-lang.modules:scala-java8-compat_2.12:0.8.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/play-ws/play-ws-1.0/src/main/java/datadog/trace/instrumentation/playws1/AsyncHandlerWrapper.java b/dd-java-agent/instrumentation/play-ws/play-ws-1.0/src/main/java/datadog/trace/instrumentation/playws1/AsyncHandlerWrapper.java index 27502d6d1e4..6df834c0dea 100644 --- a/dd-java-agent/instrumentation/play-ws/play-ws-1.0/src/main/java/datadog/trace/instrumentation/playws1/AsyncHandlerWrapper.java +++ b/dd-java-agent/instrumentation/play-ws/play-ws-1.0/src/main/java/datadog/trace/instrumentation/playws1/AsyncHandlerWrapper.java @@ -3,7 +3,8 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.captureSpan; import static datadog.trace.instrumentation.playws.PlayWSClientDecorator.DECORATE; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import play.shaded.ahc.org.asynchttpclient.AsyncHandler; import play.shaded.ahc.org.asynchttpclient.HttpResponseBodyPart; @@ -14,7 +15,7 @@ public class AsyncHandlerWrapper implements AsyncHandler { private final AsyncHandler delegate; private final AgentSpan span; - private final AgentScope.Continuation continuation; + private final ContextContinuation continuation; private final Response.ResponseBuilder builder = new Response.ResponseBuilder(); @@ -53,7 +54,7 @@ public Object onCompleted() throws Exception { span.finish(); if (continuation != null) { - try (final AgentScope scope = continuation.activate()) { + try (final ContextScope scope = continuation.resume()) { return delegate.onCompleted(); } } else { @@ -68,7 +69,7 @@ public void onThrowable(final Throwable throwable) { span.finish(); if (continuation != null) { - try (final AgentScope scope = continuation.activate()) { + try (final ContextScope scope = continuation.resume()) { delegate.onThrowable(throwable); } } else { diff --git a/dd-java-agent/instrumentation/play-ws/play-ws-1.0/src/main/java/datadog/trace/instrumentation/playws1/PlayWSClientInstrumentation.java b/dd-java-agent/instrumentation/play-ws/play-ws-1.0/src/main/java/datadog/trace/instrumentation/playws1/PlayWSClientInstrumentation.java index 154ff59edb0..9f53b1fccc1 100644 --- a/dd-java-agent/instrumentation/play-ws/play-ws-1.0/src/main/java/datadog/trace/instrumentation/playws1/PlayWSClientInstrumentation.java +++ b/dd-java-agent/instrumentation/play-ws/play-ws-1.0/src/main/java/datadog/trace/instrumentation/playws1/PlayWSClientInstrumentation.java @@ -1,6 +1,7 @@ package datadog.trace.instrumentation.playws1; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.playws.PlayWSClientDecorator.DECORATE; import static datadog.trace.instrumentation.playws.PlayWSClientDecorator.PLAY_WS_REQUEST; @@ -8,7 +9,6 @@ import datadog.context.ContextScope; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; -import datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge; import datadog.trace.instrumentation.playws.BasePlayWSClientInstrumentation; import net.bytebuddy.asm.Advice; import play.shaded.ahc.org.asynchttpclient.AsyncHandler; @@ -36,7 +36,7 @@ public static ContextScope methodEnter( asyncHandler = new AsyncHandlerWrapper(asyncHandler, span); } - return Java8BytecodeBridge.getCurrentContext().with(span).attach(); + return span.attachWithContext(); } @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) @@ -46,12 +46,14 @@ public static void methodExit( return; } if (throwable != null) { - final AgentSpan span = Java8BytecodeBridge.spanFromContext(scope.context()); + final AgentSpan span = spanFromContext(scope.context()); DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); + scope.close(); span.finish(); + } else { + scope.close(); } - scope.close(); } } } diff --git a/dd-java-agent/instrumentation/play-ws/play-ws-2.0/gradle.lockfile b/dd-java-agent/instrumentation/play-ws/play-ws-2.0/gradle.lockfile index 1bd7df8839b..7bda9a75b5a 100644 --- a/dd-java-agent/instrumentation/play-ws/play-ws-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/play-ws/play-ws-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:play-ws:play-ws-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -66,14 +70,14 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.inject:javax.inject:1=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.9.9=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -103,6 +107,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.joda:joda-convert:1.9.2=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -120,14 +125,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.2=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-java8-compat_2.12:0.8.0=compileClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-java8-compat_2.12:0.9.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath diff --git a/dd-java-agent/instrumentation/play-ws/play-ws-2.0/src/main/java/datadog/trace/instrumentation/playws2/AsyncHandlerWrapper.java b/dd-java-agent/instrumentation/play-ws/play-ws-2.0/src/main/java/datadog/trace/instrumentation/playws2/AsyncHandlerWrapper.java index 3572424749e..27d4c0bc625 100644 --- a/dd-java-agent/instrumentation/play-ws/play-ws-2.0/src/main/java/datadog/trace/instrumentation/playws2/AsyncHandlerWrapper.java +++ b/dd-java-agent/instrumentation/play-ws/play-ws-2.0/src/main/java/datadog/trace/instrumentation/playws2/AsyncHandlerWrapper.java @@ -3,7 +3,8 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.captureSpan; import static datadog.trace.instrumentation.playws.PlayWSClientDecorator.DECORATE; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.net.InetSocketAddress; import java.util.List; @@ -18,7 +19,7 @@ public class AsyncHandlerWrapper implements AsyncHandler { private final AsyncHandler delegate; private final AgentSpan span; - private final AgentScope.Continuation continuation; + private final ContextContinuation continuation; private final Response.ResponseBuilder builder = new Response.ResponseBuilder(); @@ -57,7 +58,7 @@ public Object onCompleted() throws Exception { span.finish(); if (continuation != null) { - try (final AgentScope scope = continuation.activate()) { + try (final ContextScope scope = continuation.resume()) { return delegate.onCompleted(); } } else { @@ -72,7 +73,7 @@ public void onThrowable(final Throwable throwable) { span.finish(); if (continuation != null) { - try (final AgentScope scope = continuation.activate()) { + try (final ContextScope scope = continuation.resume()) { delegate.onThrowable(throwable); } } else { diff --git a/dd-java-agent/instrumentation/play-ws/play-ws-2.0/src/main/java/datadog/trace/instrumentation/playws2/PlayWSClientInstrumentation.java b/dd-java-agent/instrumentation/play-ws/play-ws-2.0/src/main/java/datadog/trace/instrumentation/playws2/PlayWSClientInstrumentation.java index 08ea1c509f2..1adf651e7e6 100644 --- a/dd-java-agent/instrumentation/play-ws/play-ws-2.0/src/main/java/datadog/trace/instrumentation/playws2/PlayWSClientInstrumentation.java +++ b/dd-java-agent/instrumentation/play-ws/play-ws-2.0/src/main/java/datadog/trace/instrumentation/playws2/PlayWSClientInstrumentation.java @@ -1,6 +1,7 @@ package datadog.trace.instrumentation.playws2; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.playws.PlayWSClientDecorator.DECORATE; import static datadog.trace.instrumentation.playws.PlayWSClientDecorator.PLAY_WS_REQUEST; @@ -8,7 +9,6 @@ import datadog.context.ContextScope; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; -import datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge; import datadog.trace.instrumentation.playws.BasePlayWSClientInstrumentation; import net.bytebuddy.asm.Advice; import play.shaded.ahc.org.asynchttpclient.AsyncHandler; @@ -36,7 +36,7 @@ public static ContextScope methodEnter( asyncHandler = new AsyncHandlerWrapper(asyncHandler, span); } - return Java8BytecodeBridge.getCurrentContext().with(span).attach(); + return span.attachWithContext(); } @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) @@ -46,12 +46,14 @@ public static void methodExit( return; } if (throwable != null) { - final AgentSpan span = Java8BytecodeBridge.spanFromContext(scope.context()); + final AgentSpan span = spanFromContext(scope.context()); DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); + scope.close(); span.finish(); + } else { + scope.close(); } - scope.close(); } } } diff --git a/dd-java-agent/instrumentation/play-ws/play-ws-2.1/gradle.lockfile b/dd-java-agent/instrumentation/play-ws/play-ws-2.1/gradle.lockfile index 49be461730f..c6cdecd1425 100644 --- a/dd-java-agent/instrumentation/play-ws/play-ws-2.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/play-ws/play-ws-2.1/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:play-ws:play-ws-2.1:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,13 +32,16 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.protobuf:protobuf-java:3.10.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -66,13 +70,13 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.inject:javax.inject:1=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -101,6 +105,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -118,14 +123,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.3=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-java8-compat_2.12:0.9.0=compileClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-java8-compat_2.12:0.9.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath diff --git a/dd-java-agent/instrumentation/play-ws/play-ws-2.1/src/main/java/datadog/trace/instrumentation/playws21/AsyncHandlerWrapper.java b/dd-java-agent/instrumentation/play-ws/play-ws-2.1/src/main/java/datadog/trace/instrumentation/playws21/AsyncHandlerWrapper.java index b442f327c0b..8a2b1b0b2d5 100644 --- a/dd-java-agent/instrumentation/play-ws/play-ws-2.1/src/main/java/datadog/trace/instrumentation/playws21/AsyncHandlerWrapper.java +++ b/dd-java-agent/instrumentation/play-ws/play-ws-2.1/src/main/java/datadog/trace/instrumentation/playws21/AsyncHandlerWrapper.java @@ -3,7 +3,8 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.captureSpan; import static datadog.trace.instrumentation.playws.PlayWSClientDecorator.DECORATE; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.net.InetSocketAddress; import java.util.List; @@ -19,7 +20,7 @@ public class AsyncHandlerWrapper implements AsyncHandler { private final AsyncHandler delegate; private final AgentSpan span; - private final AgentScope.Continuation continuation; + private final ContextContinuation continuation; private final Response.ResponseBuilder builder = new Response.ResponseBuilder(); @@ -58,7 +59,7 @@ public Object onCompleted() throws Exception { span.finish(); if (continuation != null) { - try (final AgentScope scope = continuation.activate()) { + try (final ContextScope scope = continuation.resume()) { return delegate.onCompleted(); } } else { @@ -73,7 +74,7 @@ public void onThrowable(final Throwable throwable) { span.finish(); if (continuation != null) { - try (final AgentScope scope = continuation.activate()) { + try (final ContextScope scope = continuation.resume()) { delegate.onThrowable(throwable); } } else { diff --git a/dd-java-agent/instrumentation/play-ws/play-ws-2.1/src/main/java/datadog/trace/instrumentation/playws21/PlayWSClientInstrumentation.java b/dd-java-agent/instrumentation/play-ws/play-ws-2.1/src/main/java/datadog/trace/instrumentation/playws21/PlayWSClientInstrumentation.java index a28952016ff..810dfdf35e4 100644 --- a/dd-java-agent/instrumentation/play-ws/play-ws-2.1/src/main/java/datadog/trace/instrumentation/playws21/PlayWSClientInstrumentation.java +++ b/dd-java-agent/instrumentation/play-ws/play-ws-2.1/src/main/java/datadog/trace/instrumentation/playws21/PlayWSClientInstrumentation.java @@ -1,6 +1,7 @@ package datadog.trace.instrumentation.playws21; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.playws.PlayWSClientDecorator.DECORATE; import static datadog.trace.instrumentation.playws.PlayWSClientDecorator.PLAY_WS_REQUEST; @@ -8,7 +9,6 @@ import datadog.context.ContextScope; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; -import datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge; import datadog.trace.instrumentation.playws.BasePlayWSClientInstrumentation; import net.bytebuddy.asm.Advice; import play.shaded.ahc.org.asynchttpclient.AsyncHandler; @@ -36,7 +36,7 @@ public static ContextScope methodEnter( asyncHandler = new AsyncHandlerWrapper(asyncHandler, span); } - return Java8BytecodeBridge.getCurrentContext().with(span).attach(); + return span.attachWithContext(); } @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) @@ -46,12 +46,14 @@ public static void methodExit( return; } if (throwable != null) { - final AgentSpan span = Java8BytecodeBridge.spanFromContext(scope.context()); + final AgentSpan span = spanFromContext(scope.context()); DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); + scope.close(); span.finish(); + } else { + scope.close(); } - scope.close(); } } } diff --git a/dd-java-agent/instrumentation/play-ws/play-ws-common/gradle.lockfile b/dd-java-agent/instrumentation/play-ws/play-ws-common/gradle.lockfile index b6da05d9861..269106f8608 100644 --- a/dd-java-agent/instrumentation/play-ws/play-ws-common/gradle.lockfile +++ b/dd-java-agent/instrumentation/play-ws/play-ws-common/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:play-ws:play-ws-common:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -56,14 +60,14 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.inject:javax.inject:1=compileClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.7=compileClasspath,testCompileClasspath,testRuntimeClasspath junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -93,6 +97,7 @@ org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath org.joda:joda-convert:1.7=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -110,14 +115,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-java8-compat_2.12:0.8.0=compileClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-parser-combinators_2.12:1.0.5=compileClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/play-ws/play-ws-common/src/main/java/datadog/trace/instrumentation/playws/BasePlayWSClientInstrumentation.java b/dd-java-agent/instrumentation/play-ws/play-ws-common/src/main/java/datadog/trace/instrumentation/playws/BasePlayWSClientInstrumentation.java index fcf90c9088d..d10ef50ad78 100644 --- a/dd-java-agent/instrumentation/play-ws/play-ws-common/src/main/java/datadog/trace/instrumentation/playws/BasePlayWSClientInstrumentation.java +++ b/dd-java-agent/instrumentation/play-ws/play-ws-common/src/main/java/datadog/trace/instrumentation/playws/BasePlayWSClientInstrumentation.java @@ -4,7 +4,7 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.HierarchyMatchers.implementsInterface; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.nameStartsWith; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; import static datadog.trace.instrumentation.playws.HeadersInjectAdapter.SETTER; import static datadog.trace.instrumentation.playws.PlayWSClientDecorator.DECORATE; import static net.bytebuddy.matcher.ElementMatchers.isMethod; @@ -67,7 +67,7 @@ public String[] helperClassNames() { public static class ClientContextPropagationAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) public static void methodEnter(@Advice.Argument(0) final Request request) { - DECORATE.injectContext(getCurrentContext(), request, SETTER); + DECORATE.injectContext(currentContext(), request, SETTER); } } } diff --git a/dd-java-agent/instrumentation/play/play-2.3/gradle.lockfile b/dd-java-agent/instrumentation/play/play-2.3/gradle.lockfile index 9e6a7d4a3aa..a88e6517e78 100644 --- a/dd-java-agent/instrumentation/play/play-2.3/gradle.lockfile +++ b/dd-java-agent/instrumentation/play/play-2.3/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:play:play-2.3:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cglib:cglib-nodep:2.1_3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -11,7 +12,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -24,15 +25,15 @@ com.fasterxml.jackson.core:jackson-core:2.3.2=compileClasspath,latestDepTestComp com.fasterxml.jackson.core:jackson-databind:2.3.2=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml:classmate:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -42,12 +43,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:16.0.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.ning:async-http-client:1.8.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.novocode:junit-interface:0.11-RC1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -92,11 +96,11 @@ commons-io:commons-io:2.20.0=spotbugs commons-logging:commons-logging:1.1.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath dom4j:dom4j:1.6.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath io.netty:netty:3.9.8.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty:3.9.9.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.transaction:jta:1.1=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.validation:validation-api:1.1.0.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -104,11 +108,10 @@ jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.3=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath junit:junit:4.11=latestDepTestCompileClasspath,testCompileClasspath junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:3.4.0=latestDepTestCompileClasspath,testCompileClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:platform:3.4.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.openhft:zero-allocation-hashing:0.16=zinc @@ -151,7 +154,7 @@ org.easytesting:fest-assert:1.4=latestDepTestCompileClasspath,latestDepTestRunti org.easytesting:fest-util:1.1.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.fluentlenium:fluentlenium-core:0.9.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.fluentlenium:fluentlenium-festassert:0.9.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -164,9 +167,10 @@ org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspat org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc org.joda:joda-convert:1.6=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.json:json:20080701=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -185,14 +189,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reflections:reflections:0.9.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.11:1.0.1=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -200,33 +204,33 @@ org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=zinc org.scala-lang.modules:scala-xml_2.11:1.0.1=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc org.scala-lang:scala-compiler:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.11.12=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-lang:scala-library:2.13.15=zinc +org.scala-lang:scala-library:2.13.16=zinc org.scala-lang:scala-reflect:2.11.1=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-lang:scala-reflect:2.13.15=zinc -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-lang:scala-reflect:2.13.16=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc org.scala-sbt:test-interface:1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.scala-stm:scala-stm_2.11:0.7=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.scalaz:scalaz-concurrent_2.11:7.0.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.scalaz:scalaz-core_2.11:7.0.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/play/play-2.3/src/main/java/datadog/trace/instrumentation/play23/PlayAdvice.java b/dd-java-agent/instrumentation/play/play-2.3/src/main/java/datadog/trace/instrumentation/play23/PlayAdvice.java index 8532f467fa5..f114e48dcbf 100644 --- a/dd-java-agent/instrumentation/play/play-2.3/src/main/java/datadog/trace/instrumentation/play23/PlayAdvice.java +++ b/dd-java-agent/instrumentation/play/play-2.3/src/main/java/datadog/trace/instrumentation/play23/PlayAdvice.java @@ -2,7 +2,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.play23.PlayHttpServerDecorator.DECORATE; import static datadog.trace.instrumentation.play23.PlayHttpServerDecorator.PLAY_ACTION; @@ -35,7 +35,7 @@ public static ContextScope onEnter(@Advice.Argument(0) final Request req) { // Do not extract the context. span = startSpan(PLAY_ACTION.toString(), PLAY_REQUEST); span.setMeasured(true); - scope = span.attachWithCurrent(); + scope = span.attachWithContext(); } DECORATE.afterStart(span); @@ -52,7 +52,7 @@ public static void stopTraceOnResponse( final AgentSpan playControllerSpan = spanFromContext(playControllerScope.context()); // Call onRequest on return after tags are populated. - DECORATE.onRequest(playControllerSpan, req, req, getRootContext()); + DECORATE.onRequest(playControllerSpan, req, req, rootContext()); if (throwable == null) { responseFuture.onComplete( @@ -72,7 +72,7 @@ public static void stopTraceOnResponse( final AgentSpan rootSpan = activeSpan(); // set the resource name on the upstream akka/netty span if there is one if (rootSpan != null) { - DECORATE.onRequest(rootSpan, req, req, getRootContext()); + DECORATE.onRequest(rootSpan, req, req, rootContext()); } } } diff --git a/dd-java-agent/instrumentation/play/play-2.3/src/main/java/datadog/trace/instrumentation/play23/PlayHttpServerDecorator.java b/dd-java-agent/instrumentation/play/play-2.3/src/main/java/datadog/trace/instrumentation/play23/PlayHttpServerDecorator.java index 70ffeaca3f2..7d7e3e06bc4 100644 --- a/dd-java-agent/instrumentation/play/play-2.3/src/main/java/datadog/trace/instrumentation/play23/PlayHttpServerDecorator.java +++ b/dd-java-agent/instrumentation/play/play-2.3/src/main/java/datadog/trace/instrumentation/play23/PlayHttpServerDecorator.java @@ -84,7 +84,7 @@ protected int status(final play.api.mvc.Result httpResponse) { } @Override - public AgentSpan onRequest( + public void onRequest( final AgentSpan span, final Request connection, final Request request, @@ -107,7 +107,6 @@ public AgentSpan onRequest( dispatchRoute(span, path); } } - return span; } /** @@ -163,7 +162,7 @@ private static Request withCapturedPeer(final AgentSpan span, final Request connection, final Request request, @@ -107,7 +107,6 @@ public AgentSpan onRequest( dispatchRoute(span, path); } } - return span; } /** @@ -163,7 +162,7 @@ private static Request withCapturedPeer(final AgentSpan span, final Request connection, final Request request, @@ -155,7 +155,6 @@ public AgentSpan onRequest( dispatchRoute(span, path); } } - return span; } /** @@ -214,7 +213,7 @@ private CharSequence addMissingSlash(String routePath, String rawPath) { } @Override - public AgentSpan onError(final AgentSpan span, Throwable throwable) { + public void onError(final AgentSpan span, Throwable throwable) { if (REPORT_HTTP_STATUS) { span.setHttpStatusCode(500); } @@ -226,7 +225,7 @@ public AgentSpan onError(final AgentSpan span, Throwable throwable) { && throwable.getCause() != null) { throwable = throwable.getCause(); } - return super.onError(span, throwable); + super.onError(span, throwable); } public void updateOn404Only(final AgentSpan span, final Result result) { diff --git a/dd-java-agent/instrumentation/play/play-2.6/src/main/java/datadog/trace/instrumentation/play26/RequestCompleteCallback.java b/dd-java-agent/instrumentation/play/play-2.6/src/main/java/datadog/trace/instrumentation/play26/RequestCompleteCallback.java index 97e84394109..30c49ab6456 100644 --- a/dd-java-agent/instrumentation/play/play-2.6/src/main/java/datadog/trace/instrumentation/play26/RequestCompleteCallback.java +++ b/dd-java-agent/instrumentation/play/play-2.6/src/main/java/datadog/trace/instrumentation/play26/RequestCompleteCallback.java @@ -1,6 +1,5 @@ package datadog.trace.instrumentation.play26; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.play26.PlayHttpServerDecorator.DECORATE; import static datadog.trace.instrumentation.play26.PlayHttpServerDecorator.REPORT_HTTP_STATUS; @@ -19,7 +18,7 @@ public class RequestCompleteCallback extends scala.runtime.AbstractFunction1 ret, @Advice.Thrown(readOnly = false) Throwable t) { if (t != null) { diff --git a/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/BodyParserHelpers.java b/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/BodyParserHelpers.java index 16f0309e4bc..0eba7744dff 100644 --- a/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/BodyParserHelpers.java +++ b/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/BodyParserHelpers.java @@ -12,13 +12,19 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.TextNode; import datadog.appsec.api.blocking.BlockingException; +import datadog.trace.api.Config; import datadog.trace.api.gateway.BlockResponseFunction; import datadog.trace.api.gateway.CallbackProvider; import datadog.trace.api.gateway.Flow; import datadog.trace.api.gateway.RequestContext; import datadog.trace.api.gateway.RequestContextSlot; +import datadog.trace.api.http.MultipartContentDecoder; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.HashMap; @@ -54,6 +60,15 @@ public class BodyParserHelpers { // cause muzzle to disable the instrumentation for Play 2.7. private static final Method MULTIPART_FILES_METHOD; + // Cached via reflection: FilePart.ref() returns the generic file reference (TemporaryFile in + // Play 2.5/2.6), and TemporaryFile.file() returns java.io.File. Using reflection avoids + // embedding bytecode references to TemporaryFile that could break muzzle. + private static final Method FILE_PART_REF; + private static final Method TEMP_FILE_FILE; + + public static final int MAX_CONTENT_BYTES = Config.get().getAppSecMaxFileContentBytes(); + public static final int MAX_FILES_TO_INSPECT = Config.get().getAppSecMaxFileContentCount(); + static { Method m = null; try { @@ -61,6 +76,24 @@ public class BodyParserHelpers { } catch (Exception ignored) { } MULTIPART_FILES_METHOD = m; + + Method ref = null; + Method file = null; + try { + ref = MultipartFormData.FilePart.class.getMethod("ref"); + } catch (Exception ignored) { + } + try { + file = + Class.forName( + "play.api.libs.Files$TemporaryFile", + false, + BodyParserHelpers.class.getClassLoader()) + .getMethod("file"); + } catch (Exception ignored) { + } + FILE_PART_REF = ref; + TEMP_FILE_FILE = file; } private static JFunction1< @@ -148,6 +181,22 @@ private static MultipartFormData handleMultipartFormData(MultipartFormData log.debug("Error handling multipartFormData filenames", e); } + if (pendingBlock == null) { + try { + if (MULTIPART_FILES_METHOD != null) { + Object files = MULTIPART_FILES_METHOD.invoke(data); + if (files instanceof scala.collection.Iterable) { + handleMultipartFilesContent( + new ScalaIteratorAdapter(((scala.collection.Iterable) files).iterator())); + } + } + } catch (BlockingException be) { + pendingBlock = be; + } catch (Exception e) { + log.debug("Error handling multipartFormData files content", e); + } + } + if (pendingBlock != null) throw pendingBlock; return data; } @@ -176,6 +225,7 @@ private static void handleMultipartFilenames(java.util.Iterator iterator) { executeFilenamesCallback(reqCtx, callback, filenames); } + @VisibleForTesting static List collectFilenames(java.util.Iterator iterator) { List filenames = new ArrayList<>(); while (iterator.hasNext()) { @@ -206,6 +256,91 @@ private static void executeFilenamesCallback( } } + private static void handleMultipartFilesContent(java.util.Iterator iterator) { + AgentSpan span = activeSpan(); + if (span == null) { + return; + } + RequestContext reqCtx = span.getRequestContext(); + if (reqCtx == null || reqCtx.getData(RequestContextSlot.APPSEC) == null) { + return; + } + + CallbackProvider cbp = AgentTracer.get().getCallbackProvider(RequestContextSlot.APPSEC); + BiFunction, Flow> callback = + cbp.getCallback(EVENTS.requestFilesContent()); + if (callback == null) { + return; + } + + List contents = collectFilesContent(iterator); + if (contents.isEmpty()) { + return; + } + + executeFilesContentCallback(reqCtx, callback, contents); + } + + @VisibleForTesting + static List collectFilesContent(java.util.Iterator iterator) { + List contents = new ArrayList<>(MAX_FILES_TO_INSPECT); + while (iterator.hasNext() && contents.size() < MAX_FILES_TO_INSPECT) { + MultipartFormData.FilePart part = (MultipartFormData.FilePart) iterator.next(); + // null filename → no Content-Disposition filename attribute → form field → skip + // empty filename → file upload with no name → content still inspected + if (part.filename() == null) { + continue; + } + contents.add(readFilePartContent(part)); + } + return contents; + } + + @VisibleForTesting + static String readFilePartContent(MultipartFormData.FilePart part) { + if (FILE_PART_REF == null || TEMP_FILE_FILE == null) { + return ""; + } + try { + Object ref = FILE_PART_REF.invoke(part); + if (ref == null) { + return ""; + } + Object fileObj = TEMP_FILE_FILE.invoke(ref); + if (!(fileObj instanceof File)) { + return ""; + } + String contentType = null; + scala.Option ct = (scala.Option) part.contentType(); + if (ct != null && ct.isDefined()) { + contentType = (String) ct.get(); + } + try (InputStream is = new FileInputStream((File) fileObj)) { + return MultipartContentDecoder.readInputStream(is, MAX_CONTENT_BYTES, contentType); + } + } catch (Exception ignored) { + return ""; + } + } + + private static void executeFilesContentCallback( + RequestContext reqCtx, + BiFunction, Flow> callback, + List contents) { + Flow flow = callback.apply(reqCtx, contents); + Flow.Action action = flow.getAction(); + if (action instanceof Flow.Action.RequestBlockingAction) { + Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action; + BlockResponseFunction brf = reqCtx.getBlockResponseFunction(); + if (brf != null) { + boolean success = brf.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba); + if (success) { + throw new BlockingException("Blocked request (multipart file upload content)"); + } + } + } + } + public static Function1 getHandleJsonF() { return HANDLE_JSON; } diff --git a/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/BodyParserTolerantJsonParseAdvice.java b/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/BodyParserTolerantJsonParseAdvice.java index 3648168a780..b51bf207c4c 100644 --- a/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/BodyParserTolerantJsonParseAdvice.java +++ b/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/BodyParserTolerantJsonParseAdvice.java @@ -5,7 +5,7 @@ import net.bytebuddy.asm.Advice; public class BodyParserTolerantJsonParseAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after(@Advice.Return JsonNode ret, @Advice.Thrown(readOnly = false) Throwable t) { if (t != null) { return; diff --git a/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/BodyParserTolerantTextParseAdvice.java b/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/BodyParserTolerantTextParseAdvice.java index 43761f4f59b..d472aaca3c9 100644 --- a/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/BodyParserTolerantTextParseAdvice.java +++ b/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/BodyParserTolerantTextParseAdvice.java @@ -4,7 +4,7 @@ import net.bytebuddy.asm.Advice; public class BodyParserTolerantTextParseAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after(@Advice.Return String ret, @Advice.Thrown(readOnly = false) Throwable t) { if (t != null) { return; diff --git a/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/HttpErrorHandlerInstrumentation.java b/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/HttpErrorHandlerInstrumentation.java index 3cf041207fb..040dd321783 100644 --- a/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/HttpErrorHandlerInstrumentation.java +++ b/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/HttpErrorHandlerInstrumentation.java @@ -77,7 +77,7 @@ static void before(@Advice.Argument(1) Throwable t) { agentSpan.addThrowable(t); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after() { CallDepthThreadLocalMap.decrementCallDepth(HttpErrorHandler.class); } diff --git a/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/PathPatternApplyAdvice.java b/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/PathPatternApplyAdvice.java index 7ff4f4f80e3..1fb266b5ae5 100644 --- a/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/PathPatternApplyAdvice.java +++ b/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/PathPatternApplyAdvice.java @@ -13,7 +13,7 @@ @RequiresRequestContext(RequestContextSlot.APPSEC) public class PathPatternApplyAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Return(readOnly = false) scala.Option>> ret, diff --git a/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/SirdPathExtractorExtractAdvice.java b/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/SirdPathExtractorExtractAdvice.java index 3770edf4e9f..5f346fccbf6 100644 --- a/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/SirdPathExtractorExtractAdvice.java +++ b/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/SirdPathExtractorExtractAdvice.java @@ -15,7 +15,7 @@ */ @RequiresRequestContext(RequestContextSlot.APPSEC) public class SirdPathExtractorExtractAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Return scala.Option> ret, @ActiveRequestContext RequestContext reqCtx, diff --git a/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/StatusHeaderSendJsonAdvice.java b/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/StatusHeaderSendJsonAdvice.java index ba7a1583f7f..51a6084c350 100644 --- a/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/StatusHeaderSendJsonAdvice.java +++ b/dd-java-agent/instrumentation/play/play-appsec-2.5/src/main/java/datadog/trace/instrumentation/play25/appsec/StatusHeaderSendJsonAdvice.java @@ -56,7 +56,7 @@ static void before( } } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after() { CallDepthThreadLocalMap.decrementCallDepth(StatusHeader.class); } diff --git a/dd-java-agent/instrumentation/play/play-appsec-2.5/src/test/groovy/datadog/trace/instrumentation/play25/server/PlayServerTest.groovy b/dd-java-agent/instrumentation/play/play-appsec-2.5/src/test/groovy/datadog/trace/instrumentation/play25/server/PlayServerTest.groovy index 76e4dfbc7f2..fd10be014f3 100644 --- a/dd-java-agent/instrumentation/play/play-appsec-2.5/src/test/groovy/datadog/trace/instrumentation/play25/server/PlayServerTest.groovy +++ b/dd-java-agent/instrumentation/play/play-appsec-2.5/src/test/groovy/datadog/trace/instrumentation/play25/server/PlayServerTest.groovy @@ -88,6 +88,11 @@ class PlayServerTest extends HttpServerTest { true } + @Override + boolean testBodyFilesContent() { + true + } + @Override boolean testBlocking() { true diff --git a/dd-java-agent/instrumentation/play/play-appsec-2.6/gradle.lockfile b/dd-java-agent/instrumentation/play/play-appsec-2.6/gradle.lockfile index 077a9bc3d60..da223287d2c 100644 --- a/dd-java-agent/instrumentation/play/play-appsec-2.6/gradle.lockfile +++ b/dd-java-agent/instrumentation/play/play-appsec-2.6/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:play:play-appsec-2.6:dependencies --write-locks aopalliance:aopalliance:1.0=testCompileClasspath,testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath @@ -10,7 +11,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -24,15 +25,15 @@ com.fasterxml.jackson.core:jackson-databind:2.8.9=compileClasspath,testCompileCl com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.8.9=compileClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.8.9=compileClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -41,18 +42,22 @@ com.google.auto:auto-common:1.2.1=annotationProcessor,testAnnotationProcessor com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.code.gson:gson:2.8.0=testCompileClasspath,testRuntimeClasspath -com.google.errorprone:error_prone_annotations:2.0.18=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.0.18=compileClasspath com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:22.0=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:22.0=compileClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.inject.extensions:guice-assistedinject:4.1.0=testCompileClasspath,testRuntimeClasspath com.google.inject:guice:4.1.0=testCompileClasspath,testRuntimeClasspath -com.google.j2objc:j2objc-annotations:1.1=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:1.1=compileClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.novocode:junit-interface:0.11=testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath @@ -87,10 +92,10 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs commons-logging:commons-logging:1.2=testCompileClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.jsonwebtoken:jjwt:0.7.0=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.inject:javax.inject:1=compileClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath javax.transaction:jta:1.1=compileClasspath,testCompileClasspath,testRuntimeClasspath @@ -98,12 +103,11 @@ jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.9.9=compileClasspath,testCompileClasspath,testRuntimeClasspath junit:junit:4.12=testCompileClasspath junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:4.1.0=testCompileClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:4.1.0=testCompileClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.jodah:typetools:0.5.0=compileClasspath,testCompileClasspath,testRuntimeClasspath net.openhft:zero-allocation-hashing:0.16=zinc @@ -138,11 +142,11 @@ org.codehaus.groovy:groovy-templates:3.0.23=codenarc org.codehaus.groovy:groovy-xml:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath -org.codehaus.mojo:animal-sniffer-annotations:1.14=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.mojo:animal-sniffer-annotations:1.14=compileClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.fluentlenium:fluentlenium-core:3.2.0=testCompileClasspath,testRuntimeClasspath -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testCompileClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath @@ -152,7 +156,8 @@ org.jctools:jctools-core:4.0.6=testRuntimeClasspath org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -170,14 +175,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath org.reflections:reflections:0.9.11=compileClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-java8-compat_2.11:0.8.0=compileClasspath,testCompileClasspath,testRuntimeClasspath @@ -186,33 +191,33 @@ org.scala-lang.modules:scala-parser-combinators_2.11:1.0.6=compileClasspath,test org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=zinc org.scala-lang.modules:scala-xml_2.11:1.0.6=compileClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.11.11=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-lang:scala-library:2.13.15=zinc +org.scala-lang:scala-library:2.13.16=zinc org.scala-lang:scala-reflect:2.11.11=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-lang:scala-reflect:2.13.15=zinc -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-lang:scala-reflect:2.13.16=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc org.scala-sbt:test-interface:1.0=testCompileClasspath,testRuntimeClasspath -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.seleniumhq.selenium:htmlunit-driver:2.27=testCompileClasspath,testRuntimeClasspath org.seleniumhq.selenium:selenium-api:3.4.0=testCompileClasspath,testRuntimeClasspath org.seleniumhq.selenium:selenium-firefox-driver:3.4.0=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/BodyParserHelpers.java b/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/BodyParserHelpers.java index c5004dc3bbb..4f1fff4b5fa 100644 --- a/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/BodyParserHelpers.java +++ b/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/BodyParserHelpers.java @@ -12,13 +12,19 @@ import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.databind.node.TextNode; import datadog.appsec.api.blocking.BlockingException; +import datadog.trace.api.Config; import datadog.trace.api.gateway.BlockResponseFunction; import datadog.trace.api.gateway.CallbackProvider; import datadog.trace.api.gateway.Flow; import datadog.trace.api.gateway.RequestContext; import datadog.trace.api.gateway.RequestContextSlot; +import datadog.trace.api.http.MultipartContentDecoder; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; import java.lang.reflect.Method; import java.util.ArrayList; import java.util.Collections; @@ -64,6 +70,15 @@ public class BodyParserHelpers { // cause muzzle to disable the instrumentation for Play 2.7. private static final Method MULTIPART_FILES_METHOD; + // Cached via reflection: FilePart.ref() returns the generic file reference (TemporaryFile in + // Play 2.5/2.6), and TemporaryFile.file() returns java.io.File. Using reflection avoids + // embedding bytecode references to TemporaryFile that could break muzzle. + private static final Method FILE_PART_REF; + private static final Method TEMP_FILE_FILE; + + public static final int MAX_CONTENT_BYTES = Config.get().getAppSecMaxFileContentBytes(); + public static final int MAX_FILES_TO_INSPECT = Config.get().getAppSecMaxFileContentCount(); + static { Method m = null; try { @@ -71,6 +86,24 @@ public class BodyParserHelpers { } catch (Exception ignored) { } MULTIPART_FILES_METHOD = m; + + Method ref = null; + Method file = null; + try { + ref = MultipartFormData.FilePart.class.getMethod("ref"); + } catch (Exception ignored) { + } + try { + file = + Class.forName( + "play.api.libs.Files$TemporaryFile", + false, + BodyParserHelpers.class.getClassLoader()) + .getMethod("file"); + } catch (Exception ignored) { + } + FILE_PART_REF = ref; + TEMP_FILE_FILE = file; } private static JFunction1< @@ -159,6 +192,22 @@ private static MultipartFormData handleMultipartFormData(MultipartFormData log.debug("Error handling multipartFormData filenames", e); } + if (pendingBlock == null) { + try { + if (MULTIPART_FILES_METHOD != null) { + Object files = MULTIPART_FILES_METHOD.invoke(data); + if (files instanceof scala.collection.Iterable) { + handleMultipartFilesContent( + new ScalaIteratorAdapter(((scala.collection.Iterable) files).iterator())); + } + } + } catch (BlockingException be) { + pendingBlock = be; + } catch (Exception e) { + log.debug("Error handling multipartFormData files content", e); + } + } + if (pendingBlock != null) throw pendingBlock; return data; } @@ -187,6 +236,7 @@ private static void handleMultipartFilenames(java.util.Iterator iterator) { executeFilenamesCallback(reqCtx, callback, filenames); } + @VisibleForTesting static List collectFilenames(java.util.Iterator iterator) { List filenames = new ArrayList<>(); while (iterator.hasNext()) { @@ -217,6 +267,91 @@ private static void executeFilenamesCallback( } } + private static void handleMultipartFilesContent(java.util.Iterator iterator) { + AgentSpan span = activeSpan(); + if (span == null) { + return; + } + RequestContext reqCtx = span.getRequestContext(); + if (reqCtx == null || reqCtx.getData(RequestContextSlot.APPSEC) == null) { + return; + } + + CallbackProvider cbp = AgentTracer.get().getCallbackProvider(RequestContextSlot.APPSEC); + BiFunction, Flow> callback = + cbp.getCallback(EVENTS.requestFilesContent()); + if (callback == null) { + return; + } + + List contents = collectFilesContent(iterator); + if (contents.isEmpty()) { + return; + } + + executeFilesContentCallback(reqCtx, callback, contents); + } + + @VisibleForTesting + static List collectFilesContent(java.util.Iterator iterator) { + List contents = new ArrayList<>(MAX_FILES_TO_INSPECT); + while (iterator.hasNext() && contents.size() < MAX_FILES_TO_INSPECT) { + MultipartFormData.FilePart part = (MultipartFormData.FilePart) iterator.next(); + // null filename → no Content-Disposition filename attribute → form field → skip + // empty filename → file upload with no name → content still inspected + if (part.filename() == null) { + continue; + } + contents.add(readFilePartContent(part)); + } + return contents; + } + + @VisibleForTesting + static String readFilePartContent(MultipartFormData.FilePart part) { + if (FILE_PART_REF == null || TEMP_FILE_FILE == null) { + return ""; + } + try { + Object ref = FILE_PART_REF.invoke(part); + if (ref == null) { + return ""; + } + Object fileObj = TEMP_FILE_FILE.invoke(ref); + if (!(fileObj instanceof File)) { + return ""; + } + String contentType = null; + scala.Option ct = (scala.Option) part.contentType(); + if (ct != null && ct.isDefined()) { + contentType = (String) ct.get(); + } + try (InputStream is = new FileInputStream((File) fileObj)) { + return MultipartContentDecoder.readInputStream(is, MAX_CONTENT_BYTES, contentType); + } + } catch (Exception ignored) { + return ""; + } + } + + private static void executeFilesContentCallback( + RequestContext reqCtx, + BiFunction, Flow> callback, + List contents) { + Flow flow = callback.apply(reqCtx, contents); + Flow.Action action = flow.getAction(); + if (action instanceof Flow.Action.RequestBlockingAction) { + Flow.Action.RequestBlockingAction rba = (Flow.Action.RequestBlockingAction) action; + BlockResponseFunction brf = reqCtx.getBlockResponseFunction(); + if (brf != null) { + boolean success = brf.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba); + if (success) { + throw new BlockingException("Blocked request (multipart file upload content)"); + } + } + } + } + public static Function1 getHandleJsonF() { return HANDLE_JSON; } diff --git a/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/FormUrlEncodedInstrumentation.java b/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/FormUrlEncodedInstrumentation.java index 3833218e1d3..c24225f9c75 100644 --- a/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/FormUrlEncodedInstrumentation.java +++ b/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/FormUrlEncodedInstrumentation.java @@ -53,7 +53,7 @@ public void methodAdvice(MethodTransformer transformer) { } static class ParseAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Return Map ret, @Advice.Thrown(readOnly = false) Throwable t) { if (t != null) { diff --git a/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/HttpErrorHandlerInstrumentation.java b/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/HttpErrorHandlerInstrumentation.java index fdbb4bcc693..145ee7d8d82 100644 --- a/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/HttpErrorHandlerInstrumentation.java +++ b/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/HttpErrorHandlerInstrumentation.java @@ -83,7 +83,7 @@ static void before(@Advice.Argument(1) Throwable t) { agentSpan.addThrowable(t); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after() { CallDepthThreadLocalMap.decrementCallDepth(HttpErrorHandler.class); } diff --git a/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/PathPatternInstrumentation.java b/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/PathPatternInstrumentation.java index 386f2889e81..8740c1a12f3 100644 --- a/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/PathPatternInstrumentation.java +++ b/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/PathPatternInstrumentation.java @@ -68,7 +68,7 @@ public void methodAdvice(MethodTransformer transformer) { @RequiresRequestContext(RequestContextSlot.APPSEC) static class ApplyAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Return(readOnly = false) scala.Option< diff --git a/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/PlayBodyParsersInstrumentation.java b/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/PlayBodyParsersInstrumentation.java index afcc1950eda..2fbfdc02810 100644 --- a/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/PlayBodyParsersInstrumentation.java +++ b/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/PlayBodyParsersInstrumentation.java @@ -109,7 +109,7 @@ static void before() { CallDepthThreadLocalMap.incrementCallDepth(PlayBodyParsers.class); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Return(readOnly = false) BodyParser parser, @Advice.Thrown Throwable t) { int depth = CallDepthThreadLocalMap.decrementCallDepth(PlayBodyParsers.class); diff --git a/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/SirdPathExtractorInstrumentation.java b/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/SirdPathExtractorInstrumentation.java index 3c7844ccec5..cfa61d26931 100644 --- a/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/SirdPathExtractorInstrumentation.java +++ b/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/SirdPathExtractorInstrumentation.java @@ -64,7 +64,7 @@ public String[] helperClassNames() { @RequiresRequestContext(RequestContextSlot.APPSEC) static class ExtractAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Return scala.Option> ret, @ActiveRequestContext RequestContext reqCtx, diff --git a/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/StatusHeaderInstrumentation.java b/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/StatusHeaderInstrumentation.java index 164813faf18..904c3731d3f 100644 --- a/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/StatusHeaderInstrumentation.java +++ b/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/StatusHeaderInstrumentation.java @@ -94,7 +94,7 @@ static void before( } } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after() { CallDepthThreadLocalMap.decrementCallDepth(StatusHeader.class); } diff --git a/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/TolerantJsonInstrumentation.java b/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/TolerantJsonInstrumentation.java index 865fb87399f..d76e9aede90 100644 --- a/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/TolerantJsonInstrumentation.java +++ b/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/TolerantJsonInstrumentation.java @@ -63,7 +63,7 @@ public void methodAdvice(MethodTransformer transformer) { @RequiresRequestContext(RequestContextSlot.APPSEC) static class ParseAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after(@Advice.Return JsonNode ret, @Advice.Thrown(readOnly = false) Throwable t) { if (t != null) { return; diff --git a/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/TolerantTextInstrumentation.java b/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/TolerantTextInstrumentation.java index d87ff023af2..8672cb509f8 100644 --- a/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/TolerantTextInstrumentation.java +++ b/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/TolerantTextInstrumentation.java @@ -59,7 +59,7 @@ public void methodAdvice(MethodTransformer transformer) { } static class ParseAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after(@Advice.Return String ret, @Advice.Thrown(readOnly = false) Throwable t) { if (t != null) { return; diff --git a/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/TolerantXmlInstrumentation.java b/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/TolerantXmlInstrumentation.java index 8b4787f2f69..d834c4bb04e 100644 --- a/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/TolerantXmlInstrumentation.java +++ b/dd-java-agent/instrumentation/play/play-appsec-2.6/src/main/java/datadog/trace/instrumentation/play26/appsec/TolerantXmlInstrumentation.java @@ -59,7 +59,7 @@ public void methodAdvice(MethodTransformer transformer) { } static class ParseAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Return org.w3c.dom.Document ret, @Advice.Thrown(readOnly = false) Throwable t) { if (t != null) { diff --git a/dd-java-agent/instrumentation/play/play-appsec-2.6/src/test/groovy/datadog/trace/instrumentation/play26/server/PlayAsyncServerTest.groovy b/dd-java-agent/instrumentation/play/play-appsec-2.6/src/test/groovy/datadog/trace/instrumentation/play26/server/PlayAsyncServerTest.groovy index 339c17ff797..fdf35a116f9 100644 --- a/dd-java-agent/instrumentation/play/play-appsec-2.6/src/test/groovy/datadog/trace/instrumentation/play26/server/PlayAsyncServerTest.groovy +++ b/dd-java-agent/instrumentation/play/play-appsec-2.6/src/test/groovy/datadog/trace/instrumentation/play26/server/PlayAsyncServerTest.groovy @@ -13,6 +13,11 @@ class PlayAsyncServerTest extends AbstractPlayServerTest { true } + @Override + boolean testBodyFilesContent() { + true + } + @Shared def executor diff --git a/dd-java-agent/instrumentation/play/play-appsec-2.6/src/test/groovy/datadog/trace/instrumentation/play26/server/PlayServerTest.groovy b/dd-java-agent/instrumentation/play/play-appsec-2.6/src/test/groovy/datadog/trace/instrumentation/play26/server/PlayServerTest.groovy index b48ff0ad201..0ac729a38ac 100644 --- a/dd-java-agent/instrumentation/play/play-appsec-2.6/src/test/groovy/datadog/trace/instrumentation/play26/server/PlayServerTest.groovy +++ b/dd-java-agent/instrumentation/play/play-appsec-2.6/src/test/groovy/datadog/trace/instrumentation/play26/server/PlayServerTest.groovy @@ -12,6 +12,11 @@ class PlayServerTest extends AbstractPlayServerTest { true } + @Override + boolean testBodyFilesContent() { + true + } + def 'test instrumentation gateway xml request body'() { setup: def request = request( diff --git a/dd-java-agent/instrumentation/play/play-appsec-2.7/gradle.lockfile b/dd-java-agent/instrumentation/play/play-appsec-2.7/gradle.lockfile index 48ddc168d35..684771a935e 100644 --- a/dd-java-agent/instrumentation/play/play-appsec-2.7/gradle.lockfile +++ b/dd-java-agent/instrumentation/play/play-appsec-2.7/gradle.lockfile @@ -1,19 +1,20 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:play:play-appsec-2.7:dependencies --write-locks aopalliance:aopalliance:1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -at.yawk.lz4:lz4-java:1.10.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +at.yawk.lz4:lz4-java:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cglib:cglib:3.3.0=latestDepTestRuntimeClasspath ch.qos.logback:logback-classic:1.4.5=testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-classic:1.5.22=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +ch.qos.logback:logback-classic:1.5.32=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath ch.qos.logback:logback-core:1.4.5=testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.5.22=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +ch.qos.logback:logback-core:1.5.32=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -36,16 +37,16 @@ com.fasterxml.jackson.module:jackson-module-parameter-names:2.14.3=latestDepTest com.fasterxml.jackson.module:jackson-module-scala_2.13:2.14.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.14.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.sbt:junit-interface:0.13.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath @@ -56,21 +57,23 @@ com.google.code.gson:gson:2.10=latestDepTestRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.2.0=compileClasspath -com.google.errorprone:error_prone_annotations:2.21.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0=compileClasspath -com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:27.0-jre=compileClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:32.1.3-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.inject.extensions:guice-assistedinject:4.2.2=testCompileClasspath,testRuntimeClasspath com.google.inject.extensions:guice-assistedinject:6.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.inject:guice:4.2.2=testCompileClasspath,testRuntimeClasspath com.google.inject:guice:6.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.j2objc:j2objc-annotations:1.1=compileClasspath -com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.novocode:junit-interface:0.11=testCompileClasspath,testRuntimeClasspath com.shapesecurity:salvation2:3.0.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -96,34 +99,34 @@ com.typesafe.akka:akka-stream_2.13:2.6.21=latestDepTestCompileClasspath,latestDe com.typesafe.netty:netty-reactive-streams-http:2.0.3=testCompileClasspath,testRuntimeClasspath com.typesafe.netty:netty-reactive-streams:2.0.3=testCompileClasspath,testRuntimeClasspath com.typesafe.play:build-link:2.7.0=compileClasspath -com.typesafe.play:play-akka-http-server_2.13:2.9.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.typesafe.play:play-build-link:2.9.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.typesafe.play:play-configuration_2.13:2.9.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.typesafe.play:play-akka-http-server_2.13:2.9.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.typesafe.play:play-build-link:2.9.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.typesafe.play:play-configuration_2.13:2.9.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.typesafe.play:play-exceptions:2.7.0=compileClasspath -com.typesafe.play:play-exceptions:2.9.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.typesafe.play:play-exceptions:2.9.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.typesafe.play:play-functional_2.11:2.7.0=compileClasspath com.typesafe.play:play-functional_2.13:2.10.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.typesafe.play:play-guice_2.13:2.7.9=testCompileClasspath,testRuntimeClasspath -com.typesafe.play:play-guice_2.13:2.9.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.typesafe.play:play-guice_2.13:2.9.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.typesafe.play:play-java_2.11:2.7.0=compileClasspath com.typesafe.play:play-java_2.13:2.7.9=testCompileClasspath,testRuntimeClasspath -com.typesafe.play:play-java_2.13:2.9.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.typesafe.play:play-java_2.13:2.9.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.typesafe.play:play-json_2.11:2.7.0=compileClasspath com.typesafe.play:play-json_2.13:2.10.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.typesafe.play:play-netty-server_2.13:2.7.9=testCompileClasspath,testRuntimeClasspath -com.typesafe.play:play-server_2.13:2.9.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.typesafe.play:play-server_2.13:2.9.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.typesafe.play:play-streams_2.11:2.7.0=compileClasspath -com.typesafe.play:play-streams_2.13:2.9.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.typesafe.play:play-streams_2.13:2.9.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.typesafe.play:play-test_2.13:2.7.9=testCompileClasspath,testRuntimeClasspath -com.typesafe.play:play-test_2.13:2.9.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.typesafe.play:play-test_2.13:2.9.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.typesafe.play:play_2.11:2.7.0=compileClasspath -com.typesafe.play:play_2.13:2.9.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.typesafe.play:play_2.13:2.9.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.typesafe.play:routes-compiler_2.13:2.9.0-M6=routeGeneratorCompileClasspath,routeGeneratorRuntimeClasspath com.typesafe.play:twirl-api_2.11:1.4.0=compileClasspath com.typesafe.play:twirl-api_2.13:1.6.0-RC4=routeGeneratorCompileClasspath,routeGeneratorRuntimeClasspath com.typesafe.play:twirl-api_2.13:1.6.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.typesafe:config:1.3.3=compileClasspath -com.typesafe:config:1.4.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.typesafe:config:1.4.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.typesafe:ssl-config-core_2.11:0.3.7=compileClasspath com.typesafe:ssl-config-core_2.13:0.6.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-beanutils:commons-beanutils:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -134,7 +137,7 @@ commons-digester:commons-digester:2.1=latestDepTestRuntimeClasspath commons-fileupload:commons-fileupload:1.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs -commons-io:commons-io:2.21.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +commons-io:commons-io:2.22.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath commons-logging:commons-logging:1.2=testCompileClasspath,testRuntimeClasspath commons-logging:commons-logging:1.3.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath commons-net:commons-net:3.6=testCompileClasspath,testRuntimeClasspath @@ -144,7 +147,7 @@ de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,la dev.failsafe:failsafe:3.3.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.appium:java-client:8.2.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.fluentlenium:fluentlenium-core:6.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.jsonwebtoken:jjwt-api:0.11.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.jsonwebtoken:jjwt-impl:0.11.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.jsonwebtoken:jjwt-jackson:0.11.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -172,7 +175,7 @@ io.opentelemetry:opentelemetry-sdk-metrics:1.28.0=latestDepTestCompileClasspath, io.opentelemetry:opentelemetry-sdk-trace:1.28.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.opentelemetry:opentelemetry-sdk:1.28.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.opentelemetry:opentelemetry-semconv:1.28.0-alpha=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.inject:jakarta.inject-api:2.0.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath javax.activation:javax.activation-api:1.2.0=compileClasspath javax.inject:javax.inject:1=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -183,10 +186,9 @@ jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.10.1=compileClasspath junit:junit:4.12=testCompileClasspath junit:junit:4.13.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.jodah:typetools:0.5.0=compileClasspath,testCompileClasspath,testRuntimeClasspath net.jodah:typetools:0.6.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -228,7 +230,6 @@ org.atteo.classindex:classindex:3.4=testCompileClasspath,testRuntimeClasspath org.brotli:dec:0.1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.checkerframework:checker-qual:2.5.2=compileClasspath org.checkerframework:checker-qual:3.33.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -org.checkerframework:checker-qual:3.37.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc @@ -243,7 +244,7 @@ org.codehaus.plexus:plexus-utils:3.5.1=latestDepTestCompileClasspath,latestDepTe org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.fluentlenium:fluentlenium-core:3.7.1=testCompileClasspath,testRuntimeClasspath -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -252,7 +253,8 @@ org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspat org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -270,14 +272,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.2=compileClasspath org.reactivestreams:reactive-streams:1.0.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-collection-compat_2.11:0.1.1=compileClasspath @@ -290,36 +292,35 @@ org.scala-lang.modules:scala-xml_2.11:1.1.0=compileClasspath org.scala-lang.modules:scala-xml_2.13:2.1.0=routeGeneratorCompileClasspath,routeGeneratorRuntimeClasspath org.scala-lang.modules:scala-xml_2.13:2.2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.11.12=compileClasspath org.scala-lang:scala-library:2.13.11=routeGeneratorCompileClasspath,routeGeneratorRuntimeClasspath -org.scala-lang:scala-library:2.13.15=zinc +org.scala-lang:scala-library:2.13.16=zinc org.scala-lang:scala-library:2.13.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang:scala-reflect:2.11.12=compileClasspath -org.scala-lang:scala-reflect:2.13.15=zinc -org.scala-lang:scala-reflect:2.13.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-lang:scala-reflect:2.13.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc org.scala-sbt:test-interface:1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.seleniumhq.selenium:htmlunit-driver:2.33.3=testCompileClasspath,testRuntimeClasspath org.seleniumhq.selenium:htmlunit-driver:4.13.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.seleniumhq.selenium:selenium-api:3.141.59=testCompileClasspath,testRuntimeClasspath @@ -336,12 +337,13 @@ org.seleniumhq.selenium:selenium-remote-driver:4.14.1=latestDepTestCompileClassp org.seleniumhq.selenium:selenium-support:3.141.59=testCompileClasspath,testRuntimeClasspath org.seleniumhq.selenium:selenium-support:4.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.25=compileClasspath -org.slf4j:jcl-over-slf4j:2.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:jcl-over-slf4j:2.0.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.25=compileClasspath -org.slf4j:jul-to-slf4j:2.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:jul-to-slf4j:2.0.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath -org.slf4j:slf4j-api:2.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,spotbugsSlf4j,testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j +org.slf4j:slf4j-api:2.0.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath org.spockframework:spock-bom:2.4-groovy-3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/play/play-appsec-common/gradle.lockfile b/dd-java-agent/instrumentation/play/play-appsec-common/gradle.lockfile index 5ca3972ba7b..afcdd8bcb99 100644 --- a/dd-java-agent/instrumentation/play/play-appsec-common/gradle.lockfile +++ b/dd-java-agent/instrumentation/play/play-appsec-common/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:play:play-appsec-common:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/protobuf-3.0/build.gradle b/dd-java-agent/instrumentation/protobuf-3.0/build.gradle index c20b9434017..cd5e818975f 100644 --- a/dd-java-agent/instrumentation/protobuf-3.0/build.gradle +++ b/dd-java-agent/instrumentation/protobuf-3.0/build.gradle @@ -1,3 +1,5 @@ +import datadog.gradle.plugin.HostPlatform + plugins { id 'com.google.protobuf' version '0.10.0' } @@ -14,13 +16,11 @@ muzzle { } } + protobuf { protoc { - def os = System.getProperty("os.name").toLowerCase() - def arch = System.getProperty("os.arch").toLowerCase() - - // There is no m1 support for protoc 3.0.0, so require Rosetta - if (os.contains("mac") && arch.contains("aarch64")) { + // There is no macOS arm64 support for protoc 3.0.0, so require Rosetta. + if (HostPlatform.isMacArm64()) { artifact = "com.google.protobuf:protoc:3.0.0:osx-x86_64" } else { artifact = "com.google.protobuf:protoc:3.0.0" @@ -28,16 +28,25 @@ protobuf { } } +// TODO: protobuf supports Linux arm64 since `3.12.0`, but it is not source-compatible with 3.0.0 +if (HostPlatform.isLinuxArm64()) { + tasks.matching { + it.name in [ + "extractTestProto", + "generateTestProto", + "compileTestJava", + "compileTestGroovy", + "processTestResources", + "testClasses", + "test" + ] + }.configureEach { + enabled = false + } +} + dependencies { compileOnly group: 'com.google.protobuf', name: 'protobuf-java', version: '3.0.0' testImplementation group: 'com.google.protobuf', name: 'protobuf-java', version: '3.0.0' } - -sourceSets { - test { - java { - srcDir layout.buildDirectory.dir("generated/sources/proto/test/java") - } - } -} diff --git a/dd-java-agent/instrumentation/protobuf-3.0/gradle.lockfile b/dd-java-agent/instrumentation/protobuf-3.0/gradle.lockfile index d38dd82c464..045333a110d 100644 --- a/dd-java-agent/instrumentation/protobuf-3.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/protobuf-3.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:protobuf-3.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testCompileProtoPath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testCompileProtoPath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testCompileProtoPath,tes com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testCompileProtoPath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testCompileProtoPath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testCompileProtoPath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testCompileProtoPath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testCompileProtoPath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testCompileProtoPath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testCompileProtoPath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testCompileProtoPath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testCompileProtoPath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testCompileProtoPath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,compileProtoPath,spotbugs,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,compileProtoPath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,compileProtoPath,testAnnotationProcessor,testCompileClasspath,testCompileProtoPath @@ -31,14 +32,17 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,compi com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.protobuf:protobuf-java:3.0.0=compileClasspath,compileProtoPath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.protobuf:protoc:3.0.0=protobufToolsLocator_protoc -com.google.re2j:re2j:1.7=testCompileProtoPath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testCompileProtoPath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath @@ -49,12 +53,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testCompileProtoPath,testRunti commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,compileProtoPath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testCompileProtoPath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testCompileProtoPath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testCompileProtoPath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testCompileProtoPath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testCompileProtoPath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testCompileProtoPath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -83,6 +87,7 @@ org.hamcrest:hamcrest-core:1.3=testCompileProtoPath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testCompileProtoPath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=testCompileProtoPath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testCompileProtoPath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath @@ -100,14 +105,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testCompileProtoPath,testRuntim org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testCompileProtoPath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,compileProtoPath,muzzleTooling,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/quartz-2.0/gradle.lockfile b/dd-java-agent/instrumentation/quartz-2.0/gradle.lockfile index 090a8276d3d..38b68a2c43c 100644 --- a/dd-java-agent/instrumentation/quartz-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/quartz-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:quartz-2.0:dependencies --write-locks c3p0:c3p0:0.9.1.1=compileClasspath,testCompileClasspath,testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath @@ -9,20 +10,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath,version40TestAnnotationProcessor,version40TestCompileClasspath @@ -32,12 +33,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,version40TestAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,version40TestAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,version40TestAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,version40TestAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath,version40TestAnnotationProcessor,version40TestCompileClasspath,version40TestRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,version40TestAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath @@ -48,7 +52,7 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath jakarta.activation:jakarta.activation-api:2.1.4=latestDepTestRuntimeClasspath,version40TestRuntimeClasspath jakarta.transaction:jakarta.transaction-api:2.0.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath jakarta.xml.bind:jakarta.xml.bind-api:4.0.4=latestDepTestRuntimeClasspath,version40TestRuntimeClasspath @@ -56,8 +60,8 @@ javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTes javax.transaction:jta:1.1=compileClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -86,6 +90,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath @@ -103,14 +108,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,version40TestRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,version40TestCompileClasspath,version40TestRuntimeClasspath org.quartz-scheduler:quartz-jobs:2.4.0=version40TestCompileClasspath,version40TestRuntimeClasspath org.quartz-scheduler:quartz-jobs:2.5.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.quartz-scheduler:quartz:2.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/quartz-2.0/src/main/java/datadog/trace/instrumentation/quartz/QuartzDecorator.java b/dd-java-agent/instrumentation/quartz-2.0/src/main/java/datadog/trace/instrumentation/quartz/QuartzDecorator.java index fba0e49e2fe..bafb9ae23ee 100644 --- a/dd-java-agent/instrumentation/quartz-2.0/src/main/java/datadog/trace/instrumentation/quartz/QuartzDecorator.java +++ b/dd-java-agent/instrumentation/quartz-2.0/src/main/java/datadog/trace/instrumentation/quartz/QuartzDecorator.java @@ -34,7 +34,7 @@ protected CharSequence component() { return "quartz"; } - public AgentSpan onExecute(final AgentSpan span, JobExecutionContext context) { + public void onExecute(final AgentSpan span, JobExecutionContext context) { if (context != null) { if (context.getJobInstance() != null) { span.setTag(DDTags.RESOURCE_NAME, context.getJobInstance().getClass()).toString(); @@ -52,6 +52,5 @@ public AgentSpan onExecute(final AgentSpan span, JobExecutionContext context) { } } } - return span; } } diff --git a/dd-java-agent/instrumentation/quartz-2.0/src/main/java/datadog/trace/instrumentation/quartz/QuartzSchedulingInstrumentation.java b/dd-java-agent/instrumentation/quartz-2.0/src/main/java/datadog/trace/instrumentation/quartz/QuartzSchedulingInstrumentation.java index c1291f15593..aa7993b8639 100644 --- a/dd-java-agent/instrumentation/quartz-2.0/src/main/java/datadog/trace/instrumentation/quartz/QuartzSchedulingInstrumentation.java +++ b/dd-java-agent/instrumentation/quartz-2.0/src/main/java/datadog/trace/instrumentation/quartz/QuartzSchedulingInstrumentation.java @@ -71,8 +71,8 @@ public static void onExit( DECORATE.onError(span, throwable); } DECORATE.beforeFinish(span); - span.finish(); scope.close(); + span.finish(); } } } diff --git a/dd-java-agent/instrumentation/rabbitmq-amqp-2.7/gradle.lockfile b/dd-java-agent/instrumentation/rabbitmq-amqp-2.7/gradle.lockfile index bac01363793..521c2d1bd06 100644 --- a/dd-java-agent/instrumentation/rabbitmq-amqp-2.7/gradle.lockfile +++ b/dd-java-agent/instrumentation/rabbitmq-amqp-2.7/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:rabbitmq-amqp-2.7:dependencies --write-locks aopalliance:aopalliance:1.0=latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,reactorTestCompileClasspath,reactorTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath @@ -9,7 +10,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,muzzleTooling,reactorTestCompileClasspath,reactorTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,reactorTestCompileClasspath,reactorTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,reactorTestCompileClasspath,reactorTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,reactorTestCompileClasspath,reactorTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,reactorTestCompileClasspath,reactorTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,reactorTestCompileClasspath,reactorTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath @@ -18,15 +19,15 @@ com.github.docker-java:docker-java-api:3.4.2=latestDepTestCompileClasspath,lates com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,reactorTestCompileClasspath,reactorTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,reactorTestCompileClasspath,reactorTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,reactorTestCompileClasspath,reactorTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestReactorTestAnnotationProcessor,latestReactorTestCompileClasspath,reactorTestAnnotationProcessor,reactorTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -36,16 +37,19 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,latestReactorTestAnnotationProcessor,reactorTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,reactorTestCompileClasspath,reactorTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,latestReactorTestAnnotationProcessor,reactorTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,reactorTestCompileClasspath,reactorTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,reactorTestCompileClasspath,reactorTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,latestReactorTestAnnotationProcessor,reactorTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestReactorTestAnnotationProcessor,reactorTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,reactorTestCompileClasspath,reactorTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestAnnotationProcessor,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,reactorTestAnnotationProcessor,reactorTestCompileClasspath,reactorTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,latestReactorTestAnnotationProcessor,reactorTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,reactorTestCompileClasspath,reactorTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath com.rabbitmq:amqp-client:2.7.0=compileClasspath com.rabbitmq:amqp-client:2.8.1=testCompileClasspath,testRuntimeClasspath com.rabbitmq:amqp-client:5.14.2=latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath -com.rabbitmq:amqp-client:5.30.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.rabbitmq:amqp-client:5.34.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.rabbitmq:amqp-client:5.5.1=reactorTestCompileClasspath,reactorTestRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,reactorTestCompileClasspath,reactorTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,reactorTestCompileClasspath,reactorTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -60,27 +64,27 @@ commons-io:commons-io:2.20.0=spotbugs commons-logging:commons-logging:1.1.1=latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,reactorTestCompileClasspath,reactorTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,reactorTestCompileClasspath,reactorTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath -io.netty:netty-buffer:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-base:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-compression:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-marshalling:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-protobuf:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-common:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-handler:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-resolver:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-transport-native-unix-common:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-transport:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-buffer:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-base:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-compression:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-marshalling:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-protobuf:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-common:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport:4.2.16.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.projectreactor.rabbitmq:reactor-rabbitmq:1.0.0.RELEASE=reactorTestCompileClasspath,reactorTestRuntimeClasspath io.projectreactor.rabbitmq:reactor-rabbitmq:1.5.6=latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath io.projectreactor:reactor-core:3.2.3.RELEASE=reactorTestCompileClasspath,reactorTestRuntimeClasspath io.projectreactor:reactor-core:3.4.28=latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,reactorTestCompileClasspath,reactorTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,reactorTestCompileClasspath,reactorTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,muzzleTooling,reactorTestCompileClasspath,reactorTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,muzzleTooling,reactorTestCompileClasspath,reactorTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,muzzleTooling,reactorTestCompileClasspath,reactorTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,muzzleTooling,reactorTestCompileClasspath,reactorTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,reactorTestCompileClasspath,reactorTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -111,6 +115,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,reactorTestCompileClasspath,reactorTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,reactorTestCompileClasspath,reactorTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,reactorTestCompileClasspath,reactorTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,reactorTestCompileClasspath,reactorTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -128,14 +133,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,reactorTestCompileClasspath,reactorTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,latestReactorTestRuntimeClasspath,reactorTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,muzzleTooling,reactorTestCompileClasspath,reactorTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,muzzleTooling,reactorTestCompileClasspath,reactorTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.2=reactorTestCompileClasspath,reactorTestRuntimeClasspath org.reactivestreams:reactive-streams:1.0.4=latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestReactorTestCompileClasspath,latestReactorTestRuntimeClasspath,reactorTestCompileClasspath,reactorTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/rabbitmq-amqp-2.7/src/main/java/datadog/trace/instrumentation/rabbitmq/amqp/RabbitChannelInstrumentation.java b/dd-java-agent/instrumentation/rabbitmq-amqp-2.7/src/main/java/datadog/trace/instrumentation/rabbitmq/amqp/RabbitChannelInstrumentation.java index c8beb8c4863..2780015a5bf 100644 --- a/dd-java-agent/instrumentation/rabbitmq-amqp-2.7/src/main/java/datadog/trace/instrumentation/rabbitmq/amqp/RabbitChannelInstrumentation.java +++ b/dd-java-agent/instrumentation/rabbitmq-amqp-2.7/src/main/java/datadog/trace/instrumentation/rabbitmq/amqp/RabbitChannelInstrumentation.java @@ -8,6 +8,7 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.namedOneOf; import static datadog.trace.api.datastreams.DataStreamsTags.Direction.OUTBOUND; +import static datadog.trace.api.datastreams.DataStreamsTags.create; import static datadog.trace.api.datastreams.DataStreamsTags.createWithExchange; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; @@ -207,8 +208,10 @@ public static void onEnter( AgentSpan span = activeSpan(); if (span == null) return; Config config = Config.get(); + final boolean isDefaultExchange = exchange == null || exchange.isEmpty(); + final String destination = isDefaultExchange ? routingKey : exchange; if (!config.isRabbitPropagationEnabled() - || config.isRabbitPropagationDisabledForDestination(exchange)) return; + || config.isRabbitPropagationDisabledForDestination(destination)) return; // This is the internal behavior when props are null. We're just doing it earlier now. if (props == null) { props = MessageProperties.MINIMAL_BASIC; @@ -219,9 +222,13 @@ public static void onEnter( if (TIME_IN_QUEUE_ENABLED) { RabbitDecorator.injectTimeInQueueStart(headers); } - DataStreamsTags tags = - createWithExchange( - "rabbitmq", OUTBOUND, exchange, routingKey != null && !routingKey.isEmpty()); + final boolean hasRoutingKey = routingKey != null && !routingKey.isEmpty(); + DataStreamsTags tags; + if (isDefaultExchange && hasRoutingKey) { + tags = create("rabbitmq", OUTBOUND, routingKey); + } else { + tags = createWithExchange("rabbitmq", OUTBOUND, exchange, hasRoutingKey); + } DataStreamsContext dsmContext = DataStreamsContext.fromTags(tags); defaultPropagator().inject(span.with(dsmContext), headers, SETTER); props = diff --git a/dd-java-agent/instrumentation/rabbitmq-amqp-2.7/src/main/java/datadog/trace/instrumentation/rabbitmq/amqp/RabbitDecorator.java b/dd-java-agent/instrumentation/rabbitmq-amqp-2.7/src/main/java/datadog/trace/instrumentation/rabbitmq/amqp/RabbitDecorator.java index 78703cf9790..e73bf99c34a 100644 --- a/dd-java-agent/instrumentation/rabbitmq-amqp-2.7/src/main/java/datadog/trace/instrumentation/rabbitmq/amqp/RabbitDecorator.java +++ b/dd-java-agent/instrumentation/rabbitmq-amqp-2.7/src/main/java/datadog/trace/instrumentation/rabbitmq/amqp/RabbitDecorator.java @@ -204,7 +204,7 @@ public static AgentScope startReceivingSpan( String queue) { final Map headers = propagate && null != properties ? properties.getHeaders() : null; - AgentSpanContext parentContext = + AgentSpanContext parentSpanContext = null != headers ? extractContextAndGetSpanContext(headers, ContextVisitors.objectValuesMap()) : null; @@ -226,17 +226,18 @@ public static AgentScope startReceivingSpan( startSpan( RABBITMQ_AMQP.toString(), OPERATION_AMQP_DELIVER, - parentContext, + parentSpanContext, TimeUnit.MILLISECONDS.toMicros(queueStartMillis)); BROKER_DECORATE.afterStart(queueSpan); BROKER_DECORATE.onTimeInQueue(queueSpan, queue, body); - parentContext = queueSpan.context(); + parentSpanContext = queueSpan.spanContext(); BROKER_DECORATE.beforeFinish(queueSpan); // The queueSpan will be finished after the inner span has been activated to ensure that the // spans are written out together by the TraceStructureWriter when running in strict mode } final AgentSpan span = - startSpan(RABBITMQ_AMQP.toString(), OPERATION_AMQP_INBOUND, parentContext, spanStartMicros); + startSpan( + RABBITMQ_AMQP.toString(), OPERATION_AMQP_INBOUND, parentSpanContext, spanStartMicros); if (null != body) { span.setTag("message.size", body.length); @@ -267,12 +268,12 @@ public static AgentScope startReceivingSpan( public static void finishReceivingSpan(AgentScope scope) { AgentSpan span = scope.span(); + scope.close(); if (CONSUMER_DECORATE.endToEndDurationsEnabled) { span.finishWithEndToEnd(); } else { span.finish(); } - scope.close(); } public static final String RABBITMQ_PRODUCED_KEY = "x_datadog_rabbitmq_produced"; diff --git a/dd-java-agent/instrumentation/rabbitmq-amqp-2.7/src/test/groovy/RabbitMQTest.groovy b/dd-java-agent/instrumentation/rabbitmq-amqp-2.7/src/test/groovy/RabbitMQTest.groovy index 407195ed08c..966ab9d4b80 100644 --- a/dd-java-agent/instrumentation/rabbitmq-amqp-2.7/src/test/groovy/RabbitMQTest.groovy +++ b/dd-java-agent/instrumentation/rabbitmq-amqp-2.7/src/test/groovy/RabbitMQTest.groovy @@ -14,6 +14,7 @@ import datadog.trace.agent.test.utils.PortUtils import datadog.trace.api.Config import datadog.trace.api.DDSpanTypes import datadog.trace.api.DDTags +import datadog.trace.api.datastreams.PathwayContext import datadog.trace.bootstrap.instrumentation.api.InstrumentationTags import datadog.trace.bootstrap.instrumentation.api.Tags import datadog.trace.core.DDSpan @@ -225,7 +226,7 @@ abstract class RabbitMQTestBase extends VersionedNamingTestBase { if (isDataStreamsEnabled()) { StatsGroup first = TEST_DATA_STREAMS_WRITER.groups.find { it.parentHash == 0 } verifyAll(first) { - tags.hasAllTags("direction:out", "exchange:", "has_routing_key:true", "type:rabbitmq") + tags.hasAllTags("direction:out", "topic:" + queueName, "type:rabbitmq") } StatsGroup second = TEST_DATA_STREAMS_WRITER.groups.find { it.parentHash == first.hash } @@ -493,7 +494,7 @@ abstract class RabbitMQTestBase extends VersionedNamingTestBase { if (isDataStreamsEnabled()) { StatsGroup first = TEST_DATA_STREAMS_WRITER.groups.find { it.parentHash == 0 } verifyAll(first) { - tags.hasAllTags("direction:out", "exchange:", "has_routing_key:true", "type:rabbitmq") + tags.hasAllTags("direction:out", "topic:some-routing-queue", "type:rabbitmq") } StatsGroup second = TEST_DATA_STREAMS_WRITER.groups.find { it.parentHash == first.hash } @@ -689,6 +690,49 @@ abstract class RabbitMQTestBase extends VersionedNamingTestBase { "deliver" | "some-exchange" | "some-routing-key" | "queueNameTest" | "" | false } + def "test rabbit publish to default exchange with queue name in disabled queues (producer side)"() { + setup: + removeSysConfig(RABBIT_PROPAGATION_DISABLED_QUEUES) + def queueName = channel.queueDeclare().getQueue() + injectSysConfig(RABBIT_PROPAGATION_DISABLED_QUEUES, queueName) + + when: + runUnderTrace("parent") { + channel.basicPublish("", queueName, null, "Hello, world!".bytes) + } + GetResponse response = channel.basicGet(queueName, true) + String body = new String(response.body) + + then: + body == "Hello, world!" + + and: + // Publishing to the default exchange uses the routing key (i.e. the queue name) as the + // DSM destination, so a queue name in RABBIT_PROPAGATION_DISABLED_QUEUES must suppress + // the pathway header, the same way it does for named-exchange publishes. + if (isDataStreamsEnabled()) { + def headers = response.getProps().getHeaders() + assert headers == null || !headers.containsKey(PathwayContext.PROPAGATION_KEY_BASE64) + } + + and: + assertTraces(3, SORT_TRACES_BY_ID) { + trace(1) { + rabbitSpan(it, "queue.declare") + } + trace(2) { + basicSpan(it, "parent") + rabbitSpan(it, "basic.publish -> ", false, span(0), operationForProducer()) + } + trace(1) { + rabbitSpan(it, "basic.get ", false, null, operationForConsumer()) + } + } + + cleanup: + removeSysConfig(RABBIT_PROPAGATION_DISABLED_QUEUES) + } + def rabbitSpan( TraceAssert trace, String resource, diff --git a/dd-java-agent/instrumentation/ratpack-1.5/gradle.lockfile b/dd-java-agent/instrumentation/ratpack-1.5/gradle.lockfile index 5b5c5ab9f88..472e58cee6e 100644 --- a/dd-java-agent/instrumentation/ratpack-1.5/gradle.lockfile +++ b/dd-java-agent/instrumentation/ratpack-1.5/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:ratpack-1.5:dependencies --write-locks aopalliance:aopalliance:1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -10,7 +11,7 @@ com.beust:jcommander:1.72=latestDepTestRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -31,15 +32,15 @@ com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.8.7=compileClasspath,te com.github.ben-manes.caffeine:caffeine:2.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath com.github.ben-manes.caffeine:caffeine:2.8.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -48,20 +49,21 @@ com.google.auto:auto-common:1.2.1=annotationProcessor,latestDepTestAnnotationPro com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.errorprone:error_prone_annotations:2.4.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor -com.google.guava:guava:21.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.google.guava:guava:28.2-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:21.0=compileClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.inject.extensions:guice-multibindings:4.1.0=testCompileClasspath,testRuntimeClasspath com.google.inject.extensions:guice-multibindings:4.2.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.inject:guice:4.1.0=testCompileClasspath,testRuntimeClasspath com.google.inject:guice:4.2.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.google.j2objc:j2objc-annotations:1.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -116,15 +118,15 @@ io.ratpack:ratpack-guice:1.10.0-milestone-39=latestDepTestCompileClasspath,lates io.ratpack:ratpack-guice:1.5.0=testCompileClasspath,testRuntimeClasspath io.ratpack:ratpack-test:1.10.0-milestone-39=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.ratpack:ratpack-test:1.5.0=testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.inject:javax.inject:1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs jline:jline:2.14.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath junit:junit:4.12=latestDepTestCompileClasspath junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -182,6 +184,7 @@ org.javassist:javassist:3.19.0-GA=compileClasspath,testCompileClasspath,testRunt org.javassist:javassist:3.22.0-GA=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -199,14 +202,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.0.final=compileClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/ActionWrapper.java b/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/ActionWrapper.java index 23ab189156f..b0ce89cc2cd 100644 --- a/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/ActionWrapper.java +++ b/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/ActionWrapper.java @@ -2,7 +2,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -22,7 +22,7 @@ private ActionWrapper(final Action delegate, final AgentSpan span) { @Override public void execute(final T t) throws Exception { - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { delegate.execute(t); } } diff --git a/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/BlockWrapper.java b/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/BlockWrapper.java index 2dc9eb10690..7fe94d5a86e 100644 --- a/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/BlockWrapper.java +++ b/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/BlockWrapper.java @@ -2,7 +2,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -23,7 +23,7 @@ private BlockWrapper(final Block delegate, final AgentSpan span) { @Override public void execute() throws Exception { - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { delegate.execute(); } } diff --git a/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/ContextParseAdvice.java b/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/ContextParseAdvice.java index 8a51356a78f..e4b03268eff 100644 --- a/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/ContextParseAdvice.java +++ b/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/ContextParseAdvice.java @@ -19,7 +19,7 @@ public class ContextParseAdvice { // for now ignore that the parser can be configured to mix in the query string - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Return Object obj_, @ActiveRequestContext RequestContext reqCtx, diff --git a/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/RatpackRequestBodyCallGetBufferAdvice.java b/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/RatpackRequestBodyCallGetBufferAdvice.java index d69d9862d39..43c9de353d2 100644 --- a/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/RatpackRequestBodyCallGetBufferAdvice.java +++ b/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/RatpackRequestBodyCallGetBufferAdvice.java @@ -52,7 +52,7 @@ static Throwable before( return null; } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Enter Throwable enterThr, @Advice.Thrown(readOnly = false) Throwable t, diff --git a/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/RatpackRequestBodyGetTextCalledAdvice.java b/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/RatpackRequestBodyGetTextCalledAdvice.java index 7a221e446e9..847041f83f8 100644 --- a/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/RatpackRequestBodyGetTextCalledAdvice.java +++ b/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/RatpackRequestBodyGetTextCalledAdvice.java @@ -15,7 +15,7 @@ @RequiresRequestContext(RequestContextSlot.APPSEC) public class RatpackRequestBodyGetTextCalledAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.This ByteBufBackedTypedData thiz, @Advice.Return String str, diff --git a/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/RatpackServerDecorator.java b/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/RatpackServerDecorator.java index 205ae8832fe..e8e355c75c4 100644 --- a/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/RatpackServerDecorator.java +++ b/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/RatpackServerDecorator.java @@ -77,7 +77,7 @@ protected int status(final Response response) { } } - public AgentSpan onContext(final AgentSpan span, final Context ctx) { + public void onContext(final AgentSpan span, final Context ctx) { String description = ctx.getPathBinding().getDescription(); if (description == null || description.isEmpty()) { @@ -87,16 +87,15 @@ public AgentSpan onContext(final AgentSpan span, final Context ctx) { } HTTP_RESOURCE_DECORATOR.withRoute(span, ctx.getRequest().getMethod().getName(), description); - - return span; } @Override - public AgentSpan onError(final AgentSpan span, Throwable throwable) { + public void onError(final AgentSpan span, Throwable throwable) { // Attempt to unwrap ratpack.handling.internal.HandlerException without direct reference. if (throwable instanceof Error && throwable.getCause() != null) { - return super.onError(span, throwable.getCause()); + super.onError(span, throwable.getCause()); + } else { + super.onError(span, throwable); } - return super.onError(span, throwable); } } diff --git a/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/TracingHandler.java b/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/TracingHandler.java index 022af818747..7c5ad8b19b2 100644 --- a/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/TracingHandler.java +++ b/dd-java-agent/instrumentation/ratpack-1.5/src/main/java/datadog/trace/instrumentation/ratpack/TracingHandler.java @@ -8,8 +8,8 @@ import static datadog.trace.instrumentation.ratpack.RatpackServerDecorator.DECORATE; import com.google.common.reflect.TypeToken; +import datadog.context.ContextScope; import datadog.trace.api.gateway.Flow; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import io.netty.util.Attribute; import io.netty.util.AttributeKey; @@ -45,12 +45,12 @@ public void handle(final Context ctx) { boolean setFinalizer = false; - try (final AgentScope scope = activateSpan(ratpackSpan)) { + try (final ContextScope scope = activateSpan(ratpackSpan)) { ctx.getResponse() .beforeSend( response -> { - try (final AgentScope ignored = activateSpan(ratpackSpan)) { + try (final ContextScope ignored = activateSpan(ratpackSpan)) { if (nettySpan != null) { // Rename the netty span resource name with the ratpack route. DECORATE.onContext(nettySpan, ctx); diff --git a/dd-java-agent/instrumentation/reactive-streams-1.0/gradle.lockfile b/dd-java-agent/instrumentation/reactive-streams-1.0/gradle.lockfile index c0fd32f38b6..9d22d82cf7c 100644 --- a/dd-java-agent/instrumentation/reactive-streams-1.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/reactive-streams-1.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:reactive-streams-1.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -32,12 +33,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -51,12 +55,12 @@ io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeC io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations:1.28.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentelemetry:opentelemetry-api:1.28.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentelemetry:opentelemetry-context:1.28.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -85,6 +89,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -102,14 +107,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/reactive-streams-1.0/src/main/java/datadog/trace/instrumentation/reactivestreams/PublisherInstrumentation.java b/dd-java-agent/instrumentation/reactive-streams-1.0/src/main/java/datadog/trace/instrumentation/reactivestreams/PublisherInstrumentation.java index 221a9c5c369..9a293319be1 100644 --- a/dd-java-agent/instrumentation/reactive-streams-1.0/src/main/java/datadog/trace/instrumentation/reactivestreams/PublisherInstrumentation.java +++ b/dd-java-agent/instrumentation/reactive-streams-1.0/src/main/java/datadog/trace/instrumentation/reactivestreams/PublisherInstrumentation.java @@ -13,7 +13,7 @@ import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge; +import datadog.trace.bootstrap.instrumentation.reactivestreams.HandoffContext; import net.bytebuddy.asm.Advice; import net.bytebuddy.description.type.TypeDescription; import net.bytebuddy.matcher.ElementMatcher; @@ -53,24 +53,14 @@ public static class PublisherSubscribeAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) public static ContextScope onSubscribe( @Advice.This final Publisher self, @Advice.Argument(value = 0) final Subscriber s) { - - final Context context = - InstrumentationContext.get(Publisher.class, Context.class).remove(self); - final Context activeContext = Java8BytecodeBridge.getCurrentContext(); - if (s == null || (context == null && activeContext == null)) { - return null; - } - final Context current = - InstrumentationContext.get(Subscriber.class, Context.class) - .putIfAbsent(s, context != null ? context : activeContext); - if (current != null) { - return current.attach(); - } - - return null; + return ReactiveStreamsContextPropagation.captureOnSubscribe( + self, + s, + InstrumentationContext.get(Publisher.class, HandoffContext.class), + InstrumentationContext.get(Subscriber.class, Context.class)); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void afterSubscribe(@Advice.Enter final ContextScope scope) { if (scope != null) { scope.close(); diff --git a/dd-java-agent/instrumentation/reactive-streams-1.0/src/main/java/datadog/trace/instrumentation/reactivestreams/ReactiveStreamsContextPropagation.java b/dd-java-agent/instrumentation/reactive-streams-1.0/src/main/java/datadog/trace/instrumentation/reactivestreams/ReactiveStreamsContextPropagation.java new file mode 100644 index 00000000000..32bdf7b3299 --- /dev/null +++ b/dd-java-agent/instrumentation/reactive-streams-1.0/src/main/java/datadog/trace/instrumentation/reactivestreams/ReactiveStreamsContextPropagation.java @@ -0,0 +1,60 @@ +package datadog.trace.instrumentation.reactivestreams; + +import datadog.context.Context; +import datadog.context.ContextScope; +import datadog.trace.bootstrap.ContextStore; +import datadog.trace.bootstrap.instrumentation.reactivestreams.HandoffContext; +import org.reactivestreams.Publisher; +import org.reactivestreams.Subscriber; + +public final class ReactiveStreamsContextPropagation { + + private ReactiveStreamsContextPropagation() {} + + public static ContextScope captureOnSubscribe( + final Publisher publisher, + final Subscriber subscriber, + final ContextStore publisherContexts, + final ContextStore subscriberContexts) { + // Don't consume the publisher context until we've verified the subscriber is non-null. For + // subscribe(null), Reactive Streams mandates an NPE after this advice returns. Consuming the + // context earlier would incorrectly discard it. + if (subscriber == null) { + return null; + } + + final HandoffContext handoff = publisherContexts.remove(publisher); + final Context contextFromPublisher = handoff == null ? null : handoff.contextForCurrentThread(); + final Context activeContext = Context.current(); + final Context context = contextFromPublisher != null ? contextFromPublisher : activeContext; + if (context == Context.root()) { + return null; + } + + final Context subscriberContext = subscriberContexts.putIfAbsent(subscriber, context); + // A context captured on the publisher (cross-thread propagation) must win even when the + // current thread already carries a non-root active context. + return attachIfRequired(subscriberContext, activeContext); + } + + public static ContextScope activateOnSignal( + final Subscriber subscriber, final ContextStore subscriberContexts) { + final Context activeContext = Context.current(); + if (activeContext != Context.root()) { + return null; + } + return attachIfRequired(subscriberContexts.get(subscriber), activeContext); + } + + public static ContextScope activateOnComplete( + final Subscriber subscriber, final ContextStore subscriberContexts) { + return attachIfRequired(subscriberContexts.get(subscriber), Context.current()); + } + + private static ContextScope attachIfRequired(final Context context, final Context activeContext) { + if (context == null || context == activeContext || context == Context.root()) { + return null; + } + return context.attach(); + } +} diff --git a/dd-java-agent/instrumentation/reactive-streams-1.0/src/main/java/datadog/trace/instrumentation/reactivestreams/ReactiveStreamsModule.java b/dd-java-agent/instrumentation/reactive-streams-1.0/src/main/java/datadog/trace/instrumentation/reactivestreams/ReactiveStreamsModule.java index 164eec431c1..9749b838254 100644 --- a/dd-java-agent/instrumentation/reactive-streams-1.0/src/main/java/datadog/trace/instrumentation/reactivestreams/ReactiveStreamsModule.java +++ b/dd-java-agent/instrumentation/reactive-streams-1.0/src/main/java/datadog/trace/instrumentation/reactivestreams/ReactiveStreamsModule.java @@ -6,6 +6,7 @@ import datadog.context.Context; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; +import datadog.trace.bootstrap.instrumentation.reactivestreams.HandoffContext; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -19,6 +20,7 @@ public ReactiveStreamsModule() { @Override public String[] helperClassNames() { return new String[] { + packageName + ".ReactiveStreamsContextPropagation", packageName + ".ReactiveStreamsAsyncResultExtension", packageName + ".ReactiveStreamsAsyncResultExtension$WrappedPublisher", packageName + ".ReactiveStreamsAsyncResultExtension$WrappedSubscriber", @@ -30,7 +32,7 @@ public String[] helperClassNames() { public Map contextStore() { final Map store = new HashMap<>(); store.put("org.reactivestreams.Subscriber", Context.class.getName()); - store.put("org.reactivestreams.Publisher", Context.class.getName()); + store.put("org.reactivestreams.Publisher", HandoffContext.class.getName()); return store; } diff --git a/dd-java-agent/instrumentation/reactive-streams-1.0/src/main/java/datadog/trace/instrumentation/reactivestreams/SubscriberInstrumentation.java b/dd-java-agent/instrumentation/reactive-streams-1.0/src/main/java/datadog/trace/instrumentation/reactivestreams/SubscriberInstrumentation.java index d184e80e728..6d0d27fe440 100644 --- a/dd-java-agent/instrumentation/reactive-streams-1.0/src/main/java/datadog/trace/instrumentation/reactivestreams/SubscriberInstrumentation.java +++ b/dd-java-agent/instrumentation/reactive-streams-1.0/src/main/java/datadog/trace/instrumentation/reactivestreams/SubscriberInstrumentation.java @@ -10,7 +10,6 @@ import datadog.trace.agent.tooling.bytebuddy.matcher.HierarchyMatchers; import datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge; import net.bytebuddy.asm.Advice; import net.bytebuddy.description.type.TypeDescription; import net.bytebuddy.matcher.ElementMatcher; @@ -51,12 +50,8 @@ public ElementMatcher hierarchyMatcher() { public static class SubscriberDownStreamAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) public static ContextScope before(@Advice.This final Subscriber self) { - final Context currentContext = Java8BytecodeBridge.getCurrentContext(); - if (currentContext != null && currentContext != Java8BytecodeBridge.getRootContext()) { - return null; - } - final Context context = InstrumentationContext.get(Subscriber.class, Context.class).get(self); - return context == null ? null : context.attach(); + return ReactiveStreamsContextPropagation.activateOnSignal( + self, InstrumentationContext.get(Subscriber.class, Context.class)); } @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) @@ -75,8 +70,8 @@ public static void closeScope(@Advice.Enter final ContextScope scope) { public static class SubscriberCompleteAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) public static ContextScope before(@Advice.This final Subscriber self) { - final Context context = InstrumentationContext.get(Subscriber.class, Context.class).get(self); - return context == null ? null : context.attach(); + return ReactiveStreamsContextPropagation.activateOnComplete( + self, InstrumentationContext.get(Subscriber.class, Context.class)); } @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) diff --git a/dd-java-agent/instrumentation/reactive-streams-1.0/src/test/java/datadog/trace/instrumentation/reactivestreams/ReactiveStreamsContextPropagationTest.java b/dd-java-agent/instrumentation/reactive-streams-1.0/src/test/java/datadog/trace/instrumentation/reactivestreams/ReactiveStreamsContextPropagationTest.java new file mode 100644 index 00000000000..46b0e241e48 --- /dev/null +++ b/dd-java-agent/instrumentation/reactive-streams-1.0/src/test/java/datadog/trace/instrumentation/reactivestreams/ReactiveStreamsContextPropagationTest.java @@ -0,0 +1,214 @@ +package datadog.trace.instrumentation.reactivestreams; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; + +import datadog.context.Context; +import datadog.context.ContextKey; +import datadog.context.ContextScope; +import datadog.trace.bootstrap.ContextStore; +import datadog.trace.bootstrap.instrumentation.reactivestreams.HandoffContext; +import java.util.IdentityHashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; +import org.reactivestreams.Publisher; +import org.reactivestreams.Subscriber; +import org.reactivestreams.Subscription; + +class ReactiveStreamsContextPropagationTest { + + private static final ContextKey KEY = ContextKey.named("reactive-streams-test"); + + @Test + void publisherCapturedContextOverridesActiveContext() { + final Publisher publisher = subscriber -> {}; + final Subscriber subscriber = new NoopSubscriber(); + final ContextStore publisherContexts = new MapContextStore<>(); + final ContextStore subscriberContexts = new MapContextStore<>(); + + // A context was handed off on the publisher, confined to this (the producing) thread. + final Context captured = Context.root().with(KEY, "captured"); + publisherContexts.put(publisher, HandoffContext.threadConfined(captured)); + + // The current thread already carries a different, non-root active context. + final Context active = Context.root().with(KEY, "active"); + try (ContextScope activeScope = active.attach()) { + assertSame(active, Context.current()); + + final ContextScope scope = + ReactiveStreamsContextPropagation.captureOnSubscribe( + publisher, subscriber, publisherContexts, subscriberContexts); + try { + // The captured context must win over the ambient active one + assertNotNull(scope, "captured context should be attached over the active context"); + assertSame(captured, Context.current()); + } finally { + if (scope != null) { + scope.close(); + } + } + + // Closing the scope restores the previously active context. + assertSame(active, Context.current()); + } + + // The captured context is remembered for the subscriber, and consumed from the publisher store. + assertSame(captured, subscriberContexts.get(subscriber)); + assertNull(publisherContexts.get(publisher)); + } + + @Test + void publisherContextFromAnotherThreadIsIgnored() throws InterruptedException { + // A thread-confined deposit from another thread (concurrent multicast subscribe) must be + // ignored. + final Publisher publisher = subscriber -> {}; + final Subscriber subscriber = new NoopSubscriber(); + final ContextStore publisherContexts = new MapContextStore<>(); + final ContextStore subscriberContexts = new MapContextStore<>(); + + final Context foreign = Context.root().with(KEY, "foreign"); + final Thread producer = + new Thread(() -> publisherContexts.put(publisher, HandoffContext.threadConfined(foreign))); + producer.start(); + producer.join(); + + final Context active = Context.root().with(KEY, "active"); + try (ContextScope activeScope = active.attach()) { + final ContextScope scope = + ReactiveStreamsContextPropagation.captureOnSubscribe( + publisher, subscriber, publisherContexts, subscriberContexts); + if (scope != null) { + scope.close(); + } + } + + // The foreign deposit is ignored; the subscriber keeps this thread's active context. + assertSame(active, subscriberContexts.get(subscriber)); + } + + @Test + void anyThreadPublisherContextIsAdoptedAcrossThreads() throws InterruptedException { + // An any-thread deposit (resilience4j/spring-messaging: attached early, subscribed later) is + // adopted even when the subscribe runs on a different thread. + final Publisher publisher = subscriber -> {}; + final Subscriber subscriber = new NoopSubscriber(); + final ContextStore publisherContexts = new MapContextStore<>(); + final ContextStore subscriberContexts = new MapContextStore<>(); + + final Context captured = Context.root().with(KEY, "captured"); + final Thread producer = + new Thread(() -> publisherContexts.put(publisher, HandoffContext.anyThread(captured))); + producer.start(); + producer.join(); + + final ContextScope scope = + ReactiveStreamsContextPropagation.captureOnSubscribe( + publisher, subscriber, publisherContexts, subscriberContexts); + if (scope != null) { + scope.close(); + } + + // The any-thread deposit is adopted despite the cross-thread subscribe. + assertSame(captured, subscriberContexts.get(subscriber)); + } + + @Test + void signalActivationIsSkippedWhenAnotherContextIsActive() { + final Subscriber subscriber = new NoopSubscriber(); + final ContextStore subscriberContexts = new MapContextStore<>(); + subscriberContexts.put(subscriber, Context.root().with(KEY, "stored")); + + final Context active = Context.root().with(KEY, "active"); + try (ContextScope activeScope = active.attach()) { + final ContextScope scope = + ReactiveStreamsContextPropagation.activateOnSignal(subscriber, subscriberContexts); + assertNull(scope, "must not override an already-active non-root context on a signal"); + assertSame(active, Context.current()); + } + } + + @Test + void signalActivationAttachesStoredContextWhenIdle() { + final Subscriber subscriber = new NoopSubscriber(); + final ContextStore subscriberContexts = new MapContextStore<>(); + final Context stored = Context.root().with(KEY, "stored"); + subscriberContexts.put(subscriber, stored); + + final ContextScope scope = + ReactiveStreamsContextPropagation.activateOnSignal(subscriber, subscriberContexts); + try { + assertNotNull(scope); + assertSame(stored, Context.current()); + } finally { + if (scope != null) { + scope.close(); + } + } + } + + private static final class NoopSubscriber implements Subscriber { + @Override + public void onSubscribe(final Subscription subscription) {} + + @Override + public void onNext(final Object value) {} + + @Override + public void onError(final Throwable throwable) {} + + @Override + public void onComplete() {} + } + + private static final class MapContextStore implements ContextStore { + private final Map map = new IdentityHashMap<>(); + + @Override + public C get(final K key) { + return map.get(key); + } + + @Override + public void put(final K key, final C context) { + map.put(key, context); + } + + @Override + public C putIfAbsent(final K key, final C context) { + final C existing = map.get(key); + if (existing != null) { + return existing; + } + map.put(key, context); + return context; + } + + @Override + public C putIfAbsent(final K key, final Factory contextFactory) { + final C existing = map.get(key); + if (existing != null) { + return existing; + } + final C created = contextFactory.create(); + map.put(key, created); + return created; + } + + @Override + public C computeIfAbsent(final K key, final KeyAwareFactory contextFactory) { + final C existing = map.get(key); + if (existing != null) { + return existing; + } + final C created = contextFactory.create(key); + map.put(key, created); + return created; + } + + @Override + public C remove(final K key) { + return map.remove(key); + } + } +} diff --git a/dd-java-agent/instrumentation/reactor-core-3.1/gradle.lockfile b/dd-java-agent/instrumentation/reactor-core-3.1/gradle.lockfile index 78c1155bc84..ea8e38bbf0f 100644 --- a/dd-java-agent/instrumentation/reactor-core-3.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/reactor-core-3.1/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:reactor-core-3.1:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,9 +51,9 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.micrometer:micrometer-commons:1.17.0-RC1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.micrometer:micrometer-core:1.17.0-RC1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.micrometer:micrometer-observation:1.17.0-RC1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micrometer:micrometer-commons:1.17.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micrometer:micrometer-core:1.17.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micrometer:micrometer-observation:1.17.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations:1.28.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentelemetry:opentelemetry-api:1.28.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentelemetry:opentelemetry-context:1.28.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -57,13 +61,13 @@ io.opentracing:opentracing-api:0.32.0=latestDepTestCompileClasspath,latestDepTes io.opentracing:opentracing-noop:0.32.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentracing:opentracing-util:0.32.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.projectreactor:reactor-core:3.1.0.RELEASE=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.projectreactor:reactor-core:3.8.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.projectreactor:reactor-core:3.8.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -93,7 +97,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.hdrhistogram:HdrHistogram:2.2.2=latestDepTestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -111,14 +115,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.1=compileClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/reactor-core-3.1/src/latestDepTest/groovy/ReactorCoreTest.groovy b/dd-java-agent/instrumentation/reactor-core-3.1/src/latestDepTest/groovy/ReactorCoreTest.groovy index d2cd1baf58e..09823e83e9e 100644 --- a/dd-java-agent/instrumentation/reactor-core-3.1/src/latestDepTest/groovy/ReactorCoreTest.groovy +++ b/dd-java-agent/instrumentation/reactor-core-3.1/src/latestDepTest/groovy/ReactorCoreTest.groovy @@ -383,6 +383,50 @@ class ReactorCoreTest extends InstrumentationSpecification { "immediate" | Schedulers.immediate() } + def "subscribe-time context propagates across threads with #name"() { + // Guards that the thread-confined publisher hand-off (HandoffContext) does not break cross-thread + // propagation: the @Trace "addOne" spans run in map's onNext on scheduler threads and must still + // be children of the subscribe-time parent. + when: + runUnderTrace("parent") { + pipeline.call().collectList().block() + } + + then: + assertTraces(1) { + trace(3) { + sortSpansByStart() + span { + operationName "parent" + parent() + } + span { + operationName "addOne" + childOf span(0) + } + span { + operationName "addOne" + childOf span(0) + } + } + } + + where: + name | pipeline + "publishOn" | { + Flux.just(1, 2).publishOn(Schedulers.parallel()).map(addOne) + } + "subscribeOn" | { + Flux.just(1, 2).subscribeOn(Schedulers.single()).map(addOne) + } + "subscribeOn+publishOn" | { + Flux.just(1, 2) + .subscribeOn(Schedulers.single()) + .publishOn(Schedulers.parallel()) + .map(addOne) + } + } + def "Context propagation through reactor context with span #spanType"() { when: runUnderTrace("parent", { @@ -417,7 +461,7 @@ class ReactorCoreTest extends InstrumentationSpecification { where: spanType | buildSpan | finishSpan "datadog" | { - TEST_TRACER.buildSpan("contextual").start() + TEST_TRACER.buildSpan("reactor-core", "contextual").start() } | { AgentSpan span -> span.finish() } diff --git a/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/BlockingPublisherInstrumentation.java b/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/BlockingPublisherInstrumentation.java index 9dd5257e902..349ea7397f7 100644 --- a/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/BlockingPublisherInstrumentation.java +++ b/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/BlockingPublisherInstrumentation.java @@ -5,10 +5,10 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.namedOneOf; import static net.bytebuddy.matcher.ElementMatchers.isMethod; -import datadog.context.Context; import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.bootstrap.InstrumentationContext; +import datadog.trace.bootstrap.instrumentation.reactivestreams.HandoffContext; import net.bytebuddy.asm.Advice; import net.bytebuddy.description.type.TypeDescription; import net.bytebuddy.matcher.ElementMatcher; @@ -41,14 +41,11 @@ public void methodAdvice(MethodTransformer transformer) { public static class BlockingAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) public static ContextScope before(@Advice.This final Publisher self) { - final Context context = InstrumentationContext.get(Publisher.class, Context.class).get(self); - if (context == null) { - return null; - } - return context.attach(); + return ReactorContextBridge.activateForBlocking( + self, InstrumentationContext.get(Publisher.class, HandoffContext.class)); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void after(@Advice.Enter final ContextScope scope) { if (scope != null) { scope.close(); diff --git a/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/ContextSpanHelper.java b/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/ContextSpanHelper.java deleted file mode 100644 index bf11f50b640..00000000000 --- a/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/ContextSpanHelper.java +++ /dev/null @@ -1,55 +0,0 @@ -package datadog.trace.instrumentation.reactor.core; - -import datadog.context.Context; -import datadog.trace.bootstrap.instrumentation.api.WithAgentSpan; -import javax.annotation.Nullable; -import reactor.core.CoreSubscriber; -import reactor.core.publisher.Mono; - -public class ContextSpanHelper { - - private static final Class MONO_WITH_CONTEXT_CLASS = findMonoWithContextClass(); - - private static final String DD_SPAN_KEY = "dd.span"; - - private static Class findMonoWithContextClass() { - final ClassLoader classLoader = Mono.class.getClassLoader(); - // 3.4+ - try { - return Class.forName( - "reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber", false, classLoader); - } catch (Throwable ignored) { - } - // < 3.4 - try { - return Class.forName( - "reactor.core.publisher.FluxContextStart$ContextStartSubscriber", false, classLoader); - } catch (Throwable ignored) { - } - return null; - } - - private ContextSpanHelper() {} - - @Nullable - public static Context extractContextFromSubscriberContext(final CoreSubscriber subscriber) { - if (MONO_WITH_CONTEXT_CLASS == null || !MONO_WITH_CONTEXT_CLASS.isInstance(subscriber)) { - return null; - } - reactor.util.context.Context reactorContext = null; - try { - reactorContext = subscriber.currentContext(); - } catch (Throwable ignored) { - } - if (reactorContext == null) { - return null; - } - if (reactorContext.hasKey(DD_SPAN_KEY)) { - Object maybeSpan = reactorContext.get(DD_SPAN_KEY); - if (maybeSpan instanceof WithAgentSpan) { - return ((WithAgentSpan) maybeSpan).asAgentSpan(); - } - } - return null; - } -} diff --git a/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/ContextWritingSubscriberInstrumentation.java b/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/ContextWritingSubscriberInstrumentation.java new file mode 100644 index 00000000000..bd9be15cd09 --- /dev/null +++ b/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/ContextWritingSubscriberInstrumentation.java @@ -0,0 +1,71 @@ +package datadog.trace.instrumentation.reactor.core; + +import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.namedOneOf; +import static net.bytebuddy.matcher.ElementMatchers.isConstructor; + +import datadog.context.Context; +import datadog.context.ContextScope; +import datadog.trace.agent.tooling.Instrumenter; +import datadog.trace.bootstrap.InstrumentationContext; +import net.bytebuddy.asm.Advice; +import org.reactivestreams.Subscriber; +import reactor.core.CoreSubscriber; + +/** + * Tailored instrumentation for Reactor's context-writing subscribers (the inner subscribers created + * by {@code contextWrite}/{@code subscriberContext} operators). Matching them by exact type removes + * the per-signal {@code instanceof} chain that the generic {@code CoreSubscriberInstrumentation} + * used to run on every {@link CoreSubscriber}. + * + *

      The explicit Datadog {@link Context} carried by these subscribers is fixed at construction, so + * it is read once (constructor advice) and stored; signal advice then only does a context-store + * lookup. + */ +public class ContextWritingSubscriberInstrumentation + implements Instrumenter.ForKnownTypes, Instrumenter.HasMethodAdvice { + + @Override + public String[] knownMatchingTypes() { + return new String[] { + "reactor.core.publisher.FluxContextWrite$ContextWriteSubscriber", + "reactor.core.publisher.FluxContextStart$ContextStartSubscriber", + "reactor.core.publisher.FluxContextWriteRestoringThreadLocals" + + "$ContextWriteRestoringThreadLocalsSubscriber", + "reactor.core.publisher.FluxContextWriteRestoringThreadLocalsFuseable" + + "$FuseableContextWriteRestoringThreadLocalsSubscriber", + "reactor.core.publisher.MonoContextWriteRestoringThreadLocals" + + "$ContextWriteRestoringThreadLocalsSubscriber", + }; + } + + @Override + public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvice(isConstructor(), getClass().getName() + "$CaptureContextAdvice"); + transformer.applyAdvice( + namedOneOf("onNext", "onComplete", "onError"), + getClass().getName() + "$ActivateContextAdvice"); + } + + public static class CaptureContextAdvice { + @Advice.OnMethodExit(suppress = Throwable.class) + public static void onConstructed(@Advice.This final CoreSubscriber self) { + ReactorContextBridge.captureSubscriberContext( + self, InstrumentationContext.get(Subscriber.class, Context.class)); + } + } + + public static class ActivateContextAdvice { + @Advice.OnMethodEnter(suppress = Throwable.class) + public static ContextScope before(@Advice.This final CoreSubscriber self) { + return ReactorContextBridge.activateStoredContext( + self, InstrumentationContext.get(Subscriber.class, Context.class)); + } + + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + public static void after(@Advice.Enter final ContextScope scope) { + if (scope != null) { + scope.close(); + } + } + } +} diff --git a/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/CorePublisherInstrumentation.java b/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/CorePublisherInstrumentation.java index 38c0061bea6..0d6053b0cd2 100644 --- a/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/CorePublisherInstrumentation.java +++ b/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/CorePublisherInstrumentation.java @@ -4,7 +4,6 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.HierarchyMatchers.implementsInterface; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.namedOneOf; -import static datadog.trace.instrumentation.reactor.core.ContextSpanHelper.extractContextFromSubscriberContext; import static net.bytebuddy.matcher.ElementMatchers.isStatic; import static net.bytebuddy.matcher.ElementMatchers.not; import static net.bytebuddy.matcher.ElementMatchers.takesArgument; @@ -14,6 +13,7 @@ import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.bootstrap.InstrumentationContext; +import datadog.trace.bootstrap.instrumentation.reactivestreams.HandoffContext; import net.bytebuddy.asm.Advice; import net.bytebuddy.description.type.TypeDescription; import net.bytebuddy.matcher.ElementMatcher; @@ -51,23 +51,19 @@ public void methodAdvice(MethodTransformer transformer) { public static class PropagateContextSpanOnSubscribe { @Advice.OnMethodEnter(suppress = Throwable.class) public static ContextScope before( - @Advice.This Publisher self, @Advice.Argument(0) final CoreSubscriber subscriber) { - final Context context = extractContextFromSubscriberContext(subscriber); - - if (context != null) { - /* - we force storing the context state linked to publisher and subscriber to the one - explicitly present in the reactor context so that, if PublisherInstrumentation is kicking in - after this advice, it won't override that active context. - */ - InstrumentationContext.get(Publisher.class, Context.class).put(self, context); - InstrumentationContext.get(Subscriber.class, Context.class).put(subscriber, context); - return context.attach(); - } - return null; + @Advice.This final Publisher self, + @Advice.Argument(0) final CoreSubscriber subscriber) { + // Hands the explicit context recorded for a context-writing subscriber to the publisher store + // (for the reactive-streams hand-off) and attaches it. The subscriber wrapping for + // context-reading operators lives in ContextReadingPublisherInstrumentation. + return ReactorContextBridge.captureOnSubscribe( + self, + subscriber, + InstrumentationContext.get(Publisher.class, HandoffContext.class), + InstrumentationContext.get(Subscriber.class, Context.class)); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void after(@Advice.Enter final ContextScope scope) { if (scope != null) { scope.close(); diff --git a/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/CoreSubscriberInstrumentation.java b/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/CoreSubscriberInstrumentation.java deleted file mode 100644 index 75152611f80..00000000000 --- a/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/CoreSubscriberInstrumentation.java +++ /dev/null @@ -1,53 +0,0 @@ -package datadog.trace.instrumentation.reactor.core; - -import static datadog.trace.agent.tooling.bytebuddy.matcher.HierarchyMatchers.implementsInterface; -import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; -import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.namedOneOf; -import static datadog.trace.instrumentation.reactor.core.ContextSpanHelper.extractContextFromSubscriberContext; - -import datadog.context.Context; -import datadog.context.ContextScope; -import datadog.trace.agent.tooling.Instrumenter; -import net.bytebuddy.asm.Advice; -import net.bytebuddy.description.type.TypeDescription; -import net.bytebuddy.matcher.ElementMatcher; -import reactor.core.CoreSubscriber; - -public class CoreSubscriberInstrumentation - implements Instrumenter.ForTypeHierarchy, Instrumenter.HasMethodAdvice { - - @Override - public String hierarchyMarkerType() { - return "reactor.core.CoreSubscriber"; - } - - @Override - public ElementMatcher hierarchyMatcher() { - return implementsInterface(named(hierarchyMarkerType())); - } - - @Override - public void methodAdvice(MethodTransformer transformer) { - transformer.applyAdvice( - namedOneOf("onNext", "onComplete", "onError"), - getClass().getName() + "$PropagateSpanInScopeAdvice"); - } - - public static class PropagateSpanInScopeAdvice { - @Advice.OnMethodEnter(suppress = Throwable.class) - public static ContextScope before(@Advice.This final CoreSubscriber self) { - final Context context = extractContextFromSubscriberContext(self); - if (context != null) { - return context.attach(); - } - return null; - } - - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) - public static void after(@Advice.Enter final ContextScope scope) { - if (scope != null) { - scope.close(); - } - } - } -} diff --git a/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/OptimizableOperatorInstrumentation.java b/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/OptimizableOperatorInstrumentation.java index 747216f2402..73c963dd898 100644 --- a/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/OptimizableOperatorInstrumentation.java +++ b/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/OptimizableOperatorInstrumentation.java @@ -10,6 +10,7 @@ import datadog.context.Context; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.bootstrap.InstrumentationContext; +import datadog.trace.bootstrap.instrumentation.reactivestreams.HandoffContext; import net.bytebuddy.asm.Advice; import net.bytebuddy.description.type.TypeDescription; import net.bytebuddy.matcher.ElementMatcher; @@ -50,16 +51,12 @@ public static void onSubscribe( @Advice.This final Publisher self, @Advice.Argument(0) final Subscriber arg, @Advice.Return final Subscriber s) { - if (s == null || arg == null) { - return; - } - Context context = InstrumentationContext.get(Publisher.class, Context.class).get(self); - if (context == null) { - context = InstrumentationContext.get(Subscriber.class, Context.class).get(arg); - } - if (context != null) { - InstrumentationContext.get(Subscriber.class, Context.class).putIfAbsent(s, context); - } + ReactorContextBridge.transferToOptimizedSubscriber( + self, + arg, + s, + InstrumentationContext.get(Publisher.class, HandoffContext.class), + InstrumentationContext.get(Subscriber.class, Context.class)); } } } diff --git a/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/ReactorContextBridge.java b/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/ReactorContextBridge.java new file mode 100644 index 00000000000..df2f9a91a0c --- /dev/null +++ b/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/ReactorContextBridge.java @@ -0,0 +1,139 @@ +package datadog.trace.instrumentation.reactor.core; + +import datadog.context.Context; +import datadog.context.ContextScope; +import datadog.trace.bootstrap.ContextStore; +import datadog.trace.bootstrap.instrumentation.api.WithAgentSpan; +import datadog.trace.bootstrap.instrumentation.reactivestreams.HandoffContext; +import org.reactivestreams.Publisher; +import org.reactivestreams.Subscriber; +import reactor.core.CoreSubscriber; + +/** + * Helper shared by the reactor-core instrumentations. It reads the span a user placed in the + * Reactor context under the {@code dd.span} key (adapting it to a {@link Context}) and drives the + * context-store-based propagation: capture on subscribe, restore on signal/blocking, and transfer + * to optimized subscribers. + */ +public final class ReactorContextBridge { + + private static final String DD_SPAN_KEY = "dd.span"; + + private ReactorContextBridge() {} + + /** + * Records the {@link Context} derived from the {@code dd.span} span a context-writing subscriber + * carries, into the subscriber store, once, when the subscriber is constructed. The caller + * ({@code ContextWritingSubscriberInstrumentation}) only matches context-writing subscribers, so + * no runtime type check is needed. + */ + public static void captureSubscriberContext( + final CoreSubscriber subscriber, + final ContextStore subscriberContexts) { + final Context context = explicitContextFromSubscriber(subscriber); + if (context != null) { + subscriberContexts.put(subscriber, context); + } + } + + /** + * Attaches the context recorded for {@code subscriber} by {@link #captureSubscriberContext}. A + * plain store lookup — no {@code instanceof}, no {@code currentContext()} call — on the signal + * hot path. + */ + public static ContextScope activateStoredContext( + final Subscriber subscriber, final ContextStore subscriberContexts) { + return attachIfRequired(subscriberContexts.get(subscriber), Context.current()); + } + + /** + * On subscribe, hands the explicit context recorded for {@code subscriber} (a context-writing + * subscriber) to the publisher store so the reactive-streams layer can propagate it, and attaches + * it. The deposit is {@linkplain HandoffContext#threadConfined thread-confined} since the + * subscribed publisher may be a concurrently-subscribed shared sink. + */ + public static ContextScope captureOnSubscribe( + final Publisher publisher, + final Subscriber subscriber, + final ContextStore publisherContexts, + final ContextStore subscriberContexts) { + final Context context = subscriberContexts.get(subscriber); + if (context == null) { + return null; + } + + publisherContexts.put(publisher, HandoffContext.threadConfined(context)); + return attachIfRequired(context, Context.current()); + } + + public static ContextScope activateForBlocking( + final Publisher publisher, + final ContextStore publisherContexts) { + final HandoffContext handoff = publisherContexts.get(publisher); + return attachIfRequired( + handoff == null ? null : handoff.contextForCurrentThread(), Context.current()); + } + + public static void transferToOptimizedSubscriber( + final Publisher publisher, + final Subscriber source, + final Subscriber target, + final ContextStore publisherContexts, + final ContextStore subscriberContexts) { + if (source == null || target == null) { + return; + } + + final HandoffContext handoff = publisherContexts.get(publisher); + Context context = handoff == null ? null : handoff.contextForCurrentThread(); + if (context == null) { + context = subscriberContexts.get(source); + } + if (context != null) { + subscriberContexts.putIfAbsent(target, context); + } + } + + private static Context explicitContextFromSubscriber(final CoreSubscriber subscriber) { + final reactor.util.context.Context reactorContext = currentContext(subscriber); + if (reactorContext == null || !hasKey(reactorContext, DD_SPAN_KEY)) { + return null; + } + final Object maybeSpan = get(reactorContext, DD_SPAN_KEY); + return maybeSpan instanceof WithAgentSpan ? ((WithAgentSpan) maybeSpan).asAgentSpan() : null; + } + + private static reactor.util.context.Context currentContext(final CoreSubscriber subscriber) { + if (subscriber == null) { + return null; + } + try { + return subscriber.currentContext(); + } catch (Throwable ignored) { + return null; + } + } + + private static ContextScope attachIfRequired(final Context context, final Context activeContext) { + if (context == null || context == activeContext || context == Context.root()) { + return null; + } + return context.attach(); + } + + private static boolean hasKey(final reactor.util.context.Context context, final Object key) { + try { + return context.hasKey(key); + } catch (Throwable ignored) { + return false; + } + } + + private static Object get(final reactor.util.context.Context context, final Object key) { + try { + return context.get(key); + } catch (Throwable ignored) { + return null; + } + } +} diff --git a/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/ReactorCoreModule.java b/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/ReactorCoreModule.java index 9073903a8c4..14bd109c458 100644 --- a/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/ReactorCoreModule.java +++ b/dd-java-agent/instrumentation/reactor-core-3.1/src/main/java/datadog/trace/instrumentation/reactor/core/ReactorCoreModule.java @@ -8,6 +8,7 @@ import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.bootstrap.instrumentation.java.concurrent.ExcludeFilter; +import datadog.trace.bootstrap.instrumentation.reactivestreams.HandoffContext; import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -25,7 +26,7 @@ public ReactorCoreModule() { @Override public String[] helperClassNames() { return new String[] { - packageName + ".ReactorAsyncResultExtension", packageName + ".ContextSpanHelper", + packageName + ".ReactorAsyncResultExtension", packageName + ".ReactorContextBridge", }; } @@ -33,7 +34,7 @@ public String[] helperClassNames() { public Map contextStore() { final Map store = new HashMap<>(); store.put("org.reactivestreams.Subscriber", Context.class.getName()); - store.put("org.reactivestreams.Publisher", Context.class.getName()); + store.put("org.reactivestreams.Publisher", HandoffContext.class.getName()); return store; } @@ -55,7 +56,7 @@ public List typeInstrumentations() { return asList( new BlockingPublisherInstrumentation(), new CorePublisherInstrumentation(), - new CoreSubscriberInstrumentation(), + new ContextWritingSubscriberInstrumentation(), new OptimizableOperatorInstrumentation()); } } diff --git a/dd-java-agent/instrumentation/reactor-core-3.1/src/test/groovy/ReactorCoreTest.groovy b/dd-java-agent/instrumentation/reactor-core-3.1/src/test/groovy/ReactorCoreTest.groovy index 1245cc641b0..f2654e4e1a4 100644 --- a/dd-java-agent/instrumentation/reactor-core-3.1/src/test/groovy/ReactorCoreTest.groovy +++ b/dd-java-agent/instrumentation/reactor-core-3.1/src/test/groovy/ReactorCoreTest.groovy @@ -383,6 +383,50 @@ class ReactorCoreTest extends InstrumentationSpecification { "immediate" | Schedulers.immediate() } + def "subscribe-time context propagates across threads with #name"() { + // Guards that the thread-confined publisher hand-off (HandoffContext) does not break cross-thread + // propagation: the @Trace "addOne" spans run in map's onNext on scheduler threads and must still + // be children of the subscribe-time parent. + when: + runUnderTrace("parent") { + pipeline.call().collectList().block() + } + + then: + assertTraces(1) { + trace(3) { + sortSpansByStart() + span { + operationName "parent" + parent() + } + span { + operationName "addOne" + childOf span(0) + } + span { + operationName "addOne" + childOf span(0) + } + } + } + + where: + name | pipeline + "publishOn" | { + Flux.just(1, 2).publishOn(Schedulers.parallel()).map(addOne) + } + "subscribeOn" | { + Flux.just(1, 2).subscribeOn(Schedulers.single()).map(addOne) + } + "subscribeOn+publishOn" | { + Flux.just(1, 2) + .subscribeOn(Schedulers.single()) + .publishOn(Schedulers.parallel()) + .map(addOne) + } + } + def "Context propagation through reactor context with span #spanType"() { when: runUnderTrace("parent", { @@ -417,7 +461,7 @@ class ReactorCoreTest extends InstrumentationSpecification { where: spanType | buildSpan | finishSpan "datadog" | { - TEST_TRACER.buildSpan("contextual").start() + TEST_TRACER.buildSpan("reactor-core", "contextual").start() } | { AgentSpan span -> span.finish() } diff --git a/dd-java-agent/instrumentation/reactor-netty-1.0/gradle.lockfile b/dd-java-agent/instrumentation/reactor-netty-1.0/gradle.lockfile index d6bbe5a1057..934c48f1d59 100644 --- a/dd-java-agent/instrumentation/reactor-netty-1.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/reactor-netty-1.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:reactor-netty-1.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -48,52 +52,52 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath io.netty:netty-buffer:4.1.53.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-buffer:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-base:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-classes-quic:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-compression:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-buffer:4.2.15.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-base:4.2.15.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-classes-quic:4.2.15.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-compression:4.2.15.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-dns:4.1.53.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-dns:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-dns:4.2.15.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http2:4.1.53.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-http2:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-http3:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http2:4.2.15.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http3:4.2.15.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http:4.1.53.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-http:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-native-quic:4.2.12.Final=latestDepTestRuntimeClasspath +io.netty:netty-codec-http:4.2.15.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-native-quic:4.2.15.Final=latestDepTestRuntimeClasspath io.netty:netty-codec-socks:4.1.53.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-socks:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-socks:4.2.15.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec:4.1.53.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-common:4.1.53.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-common:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-common:4.2.15.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-handler-proxy:4.1.53.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-handler-proxy:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler-proxy:4.2.15.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-handler:4.1.53.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-handler:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-resolver-dns-classes-macos:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-resolver-dns-native-macos:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler:4.2.15.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver-dns-classes-macos:4.2.15.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver-dns-native-macos:4.2.15.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-resolver-dns:4.1.53.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-resolver-dns:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver-dns:4.2.15.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-resolver:4.1.53.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-resolver:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-transport-classes-epoll:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver:4.2.15.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-classes-epoll:4.2.15.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport-native-epoll:4.1.53.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-transport-native-epoll:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-epoll:4.2.15.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport-native-unix-common:4.1.53.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-transport-native-unix-common:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.2.15.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.53.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-transport:4.2.12.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport:4.2.15.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.projectreactor.netty:reactor-netty-core:1.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.projectreactor.netty:reactor-netty-core:1.3.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.projectreactor.netty:reactor-netty-core:1.3.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.projectreactor.netty:reactor-netty-http:1.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.projectreactor.netty:reactor-netty-http:1.3.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.projectreactor.netty:reactor-netty-http:1.3.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.projectreactor:reactor-core:3.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.projectreactor:reactor-core:3.8.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.projectreactor:reactor-core:3.8.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -122,7 +126,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -140,14 +144,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.3=compileClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/reactor-netty-1.0/src/main/java/datadog/trace/instrumentation/reactor/netty/TransferConnectSpan.java b/dd-java-agent/instrumentation/reactor-netty-1.0/src/main/java/datadog/trace/instrumentation/reactor/netty/TransferConnectSpan.java index 5d07e5c3c26..84a02afa36e 100644 --- a/dd-java-agent/instrumentation/reactor-netty-1.0/src/main/java/datadog/trace/instrumentation/reactor/netty/TransferConnectSpan.java +++ b/dd-java-agent/instrumentation/reactor-netty-1.0/src/main/java/datadog/trace/instrumentation/reactor/netty/TransferConnectSpan.java @@ -4,7 +4,7 @@ import static datadog.trace.instrumentation.netty41.AttributeKeys.CONNECT_PARENT_CONTINUATION_ATTRIBUTE_KEY; import static datadog.trace.instrumentation.reactor.netty.CaptureConnectSpan.CONNECT_SPAN; -import datadog.trace.bootstrap.instrumentation.api.AgentScope.Continuation; +import datadog.context.ContextContinuation; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.util.function.BiConsumer; import reactor.netty.Connection; @@ -14,15 +14,15 @@ public class TransferConnectSpan implements BiConsumer res.status(200).send() } .bindNow() - @Override - boolean useStrictTraceWrites() { - false - } - @Override def cleanupSpec() { server?.disposeNow() } + def "test http2 prior knowledge failed connect creates connect error span"() { + setup: + HttpClient httpClient = HttpClient.create() + .disableRetry(true) + .protocol(HttpProtocol.H2C) + + when: + runUnderTrace("parent", { + httpClient.baseUrl("http://127.0.0.1:${UNUSABLE_PORT}") + .get() + .uri("/") + .response() + .block() + }) + + then: + def ex = thrown(Exception) + (ex instanceof ConnectException) || (ex.cause instanceof ConnectException) + + and: + assertTraces(1) { + trace(2) { + basicSpan(it, "parent", null, ex) + + span { + operationName "netty.connect" + resourceName "netty.connect" + childOf span(0) + errored true + tags { + "$Tags.COMPONENT" "netty" + errorTags Throwable, ~"Connection refused" + defaultTags() + } + } + } + } + } + def "test http2 client/server propagation"() { setup: HttpClient httpClient = HttpClient.create() diff --git a/dd-java-agent/instrumentation/rediscala-1.8/gradle.lockfile b/dd-java-agent/instrumentation/rediscala-1.8/gradle.lockfile index 717bc21ff24..919f8efa470 100644 --- a/dd-java-agent/instrumentation/rediscala-1.8/gradle.lockfile +++ b/dd-java-agent/instrumentation/rediscala-1.8/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:rediscala-1.8:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -16,15 +17,15 @@ com.github.codemonstur:embedded-redis:1.4.3=latestDepTestCompileClasspath,latest com.github.etaty:rediscala_2.11:1.8.0=compileClasspath,testCompileClasspath,testRuntimeClasspath com.github.etaty:rediscala_2.11:1.9.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -34,12 +35,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -54,12 +58,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -89,6 +93,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -106,14 +111,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-java8-compat_2.11:0.7.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang:scala-library:2.11.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.scala-lang:scala-library:2.11.8=compileClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/rediscala-1.8/src/main/java/datadog/trace/instrumentation/rediscala/RediscalaClientDecorator.java b/dd-java-agent/instrumentation/rediscala-1.8/src/main/java/datadog/trace/instrumentation/rediscala/RediscalaClientDecorator.java index 3205409a63e..41e566312f1 100644 --- a/dd-java-agent/instrumentation/rediscala-1.8/src/main/java/datadog/trace/instrumentation/rediscala/RediscalaClientDecorator.java +++ b/dd-java-agent/instrumentation/rediscala-1.8/src/main/java/datadog/trace/instrumentation/rediscala/RediscalaClientDecorator.java @@ -59,11 +59,11 @@ protected String dbHostname(final RedisConnectionInfo redisConnectionInfo) { } @Override - public AgentSpan onConnection(final AgentSpan span, final RedisConnectionInfo connection) { + public void onConnection(final AgentSpan span, final RedisConnectionInfo connection) { if (connection != null) { setPeerPort(span, connection.port); span.setTag("db.redis.dbIndex", connection.dbIndex); } - return super.onConnection(span, connection); + super.onConnection(span, connection); } } diff --git a/dd-java-agent/instrumentation/rediscala-1.8/src/main/java/datadog/trace/instrumentation/rediscala/RediscalaInstrumentation.java b/dd-java-agent/instrumentation/rediscala-1.8/src/main/java/datadog/trace/instrumentation/rediscala/RediscalaInstrumentation.java index c15bcd370e4..0dd5e434c21 100644 --- a/dd-java-agent/instrumentation/rediscala-1.8/src/main/java/datadog/trace/instrumentation/rediscala/RediscalaInstrumentation.java +++ b/dd-java-agent/instrumentation/rediscala-1.8/src/main/java/datadog/trace/instrumentation/rediscala/RediscalaInstrumentation.java @@ -107,6 +107,7 @@ public static void stopSpan( } if (throwable == null) { responseFuture.onComplete(new OnCompleteHandler(contextStore, connection), ctx); + scope.close(); } else { if (connection != null) { // try to get the info early @@ -114,9 +115,9 @@ public static void stopSpan( } DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); + scope.close(); span.finish(); } - scope.close(); // span finished in OnCompleteHandler } } diff --git a/dd-java-agent/instrumentation/redisson/redisson-2.0.0/gradle.lockfile b/dd-java-agent/instrumentation/redisson/redisson-2.0.0/gradle.lockfile index 347397162c0..b67ed6317df 100644 --- a/dd-java-agent/instrumentation/redisson/redisson-2.0.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/redisson/redisson-2.0.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:redisson:redisson-2.0.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -28,15 +29,15 @@ com.github.docker-java:docker-java-api:3.4.2=latestDepForkedTestCompileClasspath com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -46,12 +47,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.redis.testcontainers:testcontainers-redis:1.6.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.redis:redis-enterprise-admin:0.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -78,12 +82,12 @@ io.netty:netty-transport:4.0.28.Final=compileClasspath,testCompileClasspath,test io.netty:netty-transport:4.0.39.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.projectreactor:reactor-core:2.0.8.RELEASE=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.projectreactor:reactor-stream:2.0.8.RELEASE=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.openhft:zero-allocation-hashing:0.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -119,6 +123,7 @@ org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTes org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -136,14 +141,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.redisson:redisson:2.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath org.redisson:redisson:2.2.27=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath diff --git a/dd-java-agent/instrumentation/redisson/redisson-2.0.0/src/main/java/datadog/trace/instrumentation/redisson/SpanFinishListener.java b/dd-java-agent/instrumentation/redisson/redisson-2.0.0/src/main/java/datadog/trace/instrumentation/redisson/SpanFinishListener.java index f4d90b215a1..83cf885ef49 100644 --- a/dd-java-agent/instrumentation/redisson/redisson-2.0.0/src/main/java/datadog/trace/instrumentation/redisson/SpanFinishListener.java +++ b/dd-java-agent/instrumentation/redisson/redisson-2.0.0/src/main/java/datadog/trace/instrumentation/redisson/SpanFinishListener.java @@ -2,25 +2,27 @@ import static datadog.trace.instrumentation.redisson.RedissonClientDecorator.DECORATE; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import io.netty.util.concurrent.Future; import io.netty.util.concurrent.GenericFutureListener; public class SpanFinishListener implements GenericFutureListener> { - private final AgentScope.Continuation continuation; + private final ContextContinuation continuation; - public SpanFinishListener(final AgentScope.Continuation continuation) { + public SpanFinishListener(final ContextContinuation continuation) { this.continuation = continuation; } @Override public void operationComplete(Future future) throws Exception { - try (final AgentScope scope = continuation.activate()) { + try (final ContextScope scope = continuation.resume()) { if (!future.isSuccess()) { DECORATE.onError(scope, future.cause()); } DECORATE.beforeFinish(scope); - scope.span().finish(); + AgentSpan.fromContext(scope.context()).finish(); } } } diff --git a/dd-java-agent/instrumentation/redisson/redisson-2.3.0/gradle.lockfile b/dd-java-agent/instrumentation/redisson/redisson-2.3.0/gradle.lockfile index 42f4c291060..f0a463f501f 100644 --- a/dd-java-agent/instrumentation/redisson/redisson-2.3.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/redisson/redisson-2.3.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:redisson:redisson-2.3.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -29,15 +30,15 @@ com.github.docker-java:docker-java-api:3.4.2=latestDepForkedTestCompileClasspath com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -47,12 +48,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.redis.testcontainers:testcontainers-redis:1.6.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.redis:redis-enterprise-admin:0.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -84,13 +88,13 @@ io.projectreactor:reactor-core:2.0.8.RELEASE=compileClasspath,testCompileClasspa io.projectreactor:reactor-core:3.2.3.RELEASE=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.projectreactor:reactor-stream:2.0.8.RELEASE=compileClasspath,testCompileClasspath,testRuntimeClasspath io.reactivex.rxjava2:rxjava:2.1.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.cache:cache-api:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.openhft:zero-allocation-hashing:0.5=compileClasspath,testCompileClasspath,testRuntimeClasspath @@ -129,6 +133,7 @@ org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTest org.jetbrains:annotations:17.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jodd:jodd-bean:3.7.1=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jodd:jodd-core:3.7.1=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -146,14 +151,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.redisson:redisson:2.3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/redisson/redisson-2.3.0/src/main/java/datadog/trace/instrumentation/redisson23/SpanFinishListener.java b/dd-java-agent/instrumentation/redisson/redisson-2.3.0/src/main/java/datadog/trace/instrumentation/redisson23/SpanFinishListener.java index 4fd2e6d23c6..4111f197b72 100644 --- a/dd-java-agent/instrumentation/redisson/redisson-2.3.0/src/main/java/datadog/trace/instrumentation/redisson23/SpanFinishListener.java +++ b/dd-java-agent/instrumentation/redisson/redisson-2.3.0/src/main/java/datadog/trace/instrumentation/redisson23/SpanFinishListener.java @@ -1,24 +1,26 @@ package datadog.trace.instrumentation.redisson23; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import io.netty.util.concurrent.Future; import io.netty.util.concurrent.FutureListener; public class SpanFinishListener implements FutureListener { - private final AgentScope.Continuation continuation; + private final ContextContinuation continuation; - public SpanFinishListener(final AgentScope.Continuation continuation) { + public SpanFinishListener(final ContextContinuation continuation) { this.continuation = continuation; } @Override public void operationComplete(Future future) throws Exception { - try (final AgentScope scope = continuation.activate()) { + try (final ContextScope scope = continuation.resume()) { if (!future.isSuccess()) { RedissonClientDecorator.DECORATE.onError(scope, future.cause()); } RedissonClientDecorator.DECORATE.beforeFinish(scope); - scope.span().finish(); + AgentSpan.fromContext(scope.context()).finish(); } } } diff --git a/dd-java-agent/instrumentation/redisson/redisson-3.10.3/gradle.lockfile b/dd-java-agent/instrumentation/redisson/redisson-3.10.3/gradle.lockfile index d1a82ab4898..f0e14070500 100644 --- a/dd-java-agent/instrumentation/redisson/redisson-3.10.3/gradle.lockfile +++ b/dd-java-agent/instrumentation/redisson/redisson-3.10.3/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:redisson:redisson-3.10.3:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -35,15 +36,15 @@ com.github.docker-java:docker-java-api:3.4.2=latestDepForkedTestCompileClasspath com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -53,12 +54,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.redis.testcontainers:testcontainers-redis:1.6.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.redis:redis-enterprise-admin:0.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -94,14 +98,14 @@ io.projectreactor:reactor-core:3.2.6.RELEASE=compileClasspath,testCompileClasspa io.projectreactor:reactor-core:3.6.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.reactivex.rxjava2:rxjava:2.2.7=compileClasspath,testCompileClasspath,testRuntimeClasspath io.reactivex.rxjava3:rxjava:3.1.8=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.cache:cache-api:1.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath javax.cache:cache-api:1.1.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -140,6 +144,7 @@ org.jetbrains:annotations:17.0.0=latestDepForkedTestCompileClasspath,latestDepFo org.jodd:jodd-bean:5.0.8=compileClasspath,testCompileClasspath,testRuntimeClasspath org.jodd:jodd-core:5.0.8=compileClasspath,testCompileClasspath,testRuntimeClasspath org.jodd:jodd-util:6.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -159,14 +164,14 @@ org.objenesis:objenesis:3.4=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.2=compileClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.4=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.redisson:redisson:3.10.3=compileClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/redisson/redisson-3.10.3/src/main/java/datadog/trace/instrumentation/redisson30/SpanFinishListener.java b/dd-java-agent/instrumentation/redisson/redisson-3.10.3/src/main/java/datadog/trace/instrumentation/redisson30/SpanFinishListener.java index 36c6c341479..a61b4ad369d 100644 --- a/dd-java-agent/instrumentation/redisson/redisson-3.10.3/src/main/java/datadog/trace/instrumentation/redisson30/SpanFinishListener.java +++ b/dd-java-agent/instrumentation/redisson/redisson-3.10.3/src/main/java/datadog/trace/instrumentation/redisson30/SpanFinishListener.java @@ -1,23 +1,25 @@ package datadog.trace.instrumentation.redisson30; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.util.function.BiConsumer; public class SpanFinishListener implements BiConsumer { - private final AgentScope.Continuation continuation; + private final ContextContinuation continuation; - public SpanFinishListener(final AgentScope.Continuation continuation) { + public SpanFinishListener(final ContextContinuation continuation) { this.continuation = continuation; } @Override public void accept(Object o, Throwable throwable) { - try (final AgentScope scope = continuation.activate()) { + try (final ContextScope scope = continuation.resume()) { if (throwable != null) { RedissonClientDecorator.DECORATE.onError(scope, throwable); } RedissonClientDecorator.DECORATE.beforeFinish(scope); - scope.span().finish(); + AgentSpan.fromContext(scope.context()).finish(); } } } diff --git a/dd-java-agent/instrumentation/renaissance-0.7/gradle.lockfile b/dd-java-agent/instrumentation/renaissance-0.7/gradle.lockfile index 5ca3972ba7b..bf8f6e8a2fc 100644 --- a/dd-java-agent/instrumentation/renaissance-0.7/gradle.lockfile +++ b/dd-java-agent/instrumentation/renaissance-0.7/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:renaissance-0.7:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/resilience4j/resilience4j-2.0/gradle.lockfile b/dd-java-agent/instrumentation/resilience4j/resilience4j-2.0/gradle.lockfile index 91654ccbd33..bdaa56b9b12 100644 --- a/dd-java-agent/instrumentation/resilience4j/resilience4j-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/resilience4j/resilience4j-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:resilience4j:resilience4j-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -67,13 +71,13 @@ io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeC io.micrometer:micrometer-commons:1.16.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micrometer:micrometer-core:1.16.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micrometer:micrometer-observation:1.16.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.cache:cache-api:1.1.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -103,7 +107,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.hdrhistogram:HdrHistogram:2.2.2=latestDepTestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -122,14 +126,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/resilience4j/resilience4j-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/Resilience4jSpanDecorator.java b/dd-java-agent/instrumentation/resilience4j/resilience4j-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/Resilience4jSpanDecorator.java index 93a24368c7f..0e43b284e6b 100644 --- a/dd-java-agent/instrumentation/resilience4j/resilience4j-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/Resilience4jSpanDecorator.java +++ b/dd-java-agent/instrumentation/resilience4j/resilience4j-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/Resilience4jSpanDecorator.java @@ -27,14 +27,13 @@ protected CharSequence component() { } @Override - public AgentSpan afterStart(AgentSpan span) { + public void afterStart(AgentSpan span) { super.afterStart(span); span.setSpanName(RESILIENCE4J); span.setTag(Tags.SPAN_KIND, Tags.SPAN_KIND_INTERNAL); if (Config.get().isResilience4jMeasuredEnabled()) { span.setMeasured(true); } - return span; } public void decorate(AgentSpan span, T data) {} diff --git a/dd-java-agent/instrumentation/resilience4j/resilience4j-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/WrapperWithContext.java b/dd-java-agent/instrumentation/resilience4j/resilience4j-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/WrapperWithContext.java index a791f605bbb..6d4553508d1 100644 --- a/dd-java-agent/instrumentation/resilience4j/resilience4j-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/WrapperWithContext.java +++ b/dd-java-agent/instrumentation/resilience4j/resilience4j-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/WrapperWithContext.java @@ -1,5 +1,6 @@ package datadog.trace.instrumentation.resilience4j; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; @@ -32,7 +33,7 @@ public CheckedConsumerWithContext( @Override public void accept(I arg) throws Throwable { - try (AgentScope ignore = activateScope()) { + try (ContextScope ignore = activateScope()) { delegate.accept(arg); } finally { finishSpanIfNeeded(); @@ -52,7 +53,7 @@ public ConsumerWithContext( @Override public void accept(I arg) { - try (AgentScope ignore = activateScope()) { + try (ContextScope ignore = activateScope()) { delegate.accept(arg); } finally { finishSpanIfNeeded(); @@ -72,7 +73,7 @@ public CheckedFunctionWithContext( @Override public O apply(I arg) throws Throwable { - try (AgentScope ignore = activateScope()) { + try (ContextScope ignore = activateScope()) { return delegate.apply(arg); } finally { finishSpanIfNeeded(); @@ -92,7 +93,7 @@ public SupplierWithContext( @Override public O get() { - try (AgentScope ignore = activateScope()) { + try (ContextScope ignore = activateScope()) { return delegate.get(); } finally { finishSpanIfNeeded(); @@ -112,7 +113,7 @@ public CallableWithContext( @Override public O call() throws Exception { - try (AgentScope ignore = activateScope()) { + try (ContextScope ignore = activateScope()) { return delegate.call(); } finally { finishSpanIfNeeded(); @@ -132,7 +133,7 @@ public FunctionWithContext( @Override public O apply(I arg) { - try (AgentScope ignore = activateScope()) { + try (ContextScope ignore = activateScope()) { return delegate.apply(arg); } finally { finishSpanIfNeeded(); @@ -152,7 +153,7 @@ public CheckedSupplierWithContext( @Override public O get() throws Throwable { - try (AgentScope ignore = activateScope()) { + try (ContextScope ignore = activateScope()) { return delegate.get(); } finally { finishSpanIfNeeded(); @@ -172,7 +173,7 @@ public CheckedRunnableWithContext( @Override public void run() throws Throwable { - try (AgentScope ignore = activateScope()) { + try (ContextScope ignore = activateScope()) { delegate.run(); } finally { finishSpanIfNeeded(); @@ -192,7 +193,7 @@ public RunnableWithContext( @Override public void run() { - try (AgentScope ignore = activateScope()) { + try (ContextScope ignore = activateScope()) { delegate.run(); } finally { finishSpanIfNeeded(); @@ -212,7 +213,7 @@ public SupplierOfCompletionStageWithContext( @Override public CompletionStage get() { - try (AgentScope ignore = activateScope()) { + try (ContextScope ignore = activateScope()) { return delegate .get() .whenComplete( @@ -235,7 +236,7 @@ public SupplierOfFutureWithContext( @Override public Future get() { - try (AgentScope ignore = activateScope()) { + try (ContextScope ignore = activateScope()) { Future future = delegate.get(); if (future instanceof CompletableFuture) { ((CompletableFuture) future) diff --git a/dd-java-agent/instrumentation/resilience4j/resilience4j-reactor-2.0/gradle.lockfile b/dd-java-agent/instrumentation/resilience4j/resilience4j-reactor-2.0/gradle.lockfile index 8876929b602..2d746598a17 100644 --- a/dd-java-agent/instrumentation/resilience4j/resilience4j-reactor-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/resilience4j/resilience4j-reactor-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:resilience4j:resilience4j-reactor-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -70,13 +74,13 @@ io.micrometer:micrometer-commons:1.16.0=latestDepTestCompileClasspath,latestDepT io.micrometer:micrometer-core:1.16.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micrometer:micrometer-observation:1.16.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.projectreactor:reactor-core:3.4.24=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.cache:cache-api:1.1.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -106,7 +110,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.hdrhistogram:HdrHistogram:2.2.2=latestDepTestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -125,14 +129,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.4=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/resilience4j/resilience4j-reactor-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/CircuitBreakerOperatorInstrumentation.java b/dd-java-agent/instrumentation/resilience4j/resilience4j-reactor-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/CircuitBreakerOperatorInstrumentation.java index b45d865f34b..7dbc912eb44 100644 --- a/dd-java-agent/instrumentation/resilience4j/resilience4j-reactor-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/CircuitBreakerOperatorInstrumentation.java +++ b/dd-java-agent/instrumentation/resilience4j/resilience4j-reactor-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/CircuitBreakerOperatorInstrumentation.java @@ -4,9 +4,9 @@ import static net.bytebuddy.matcher.ElementMatchers.isMethod; import static net.bytebuddy.matcher.ElementMatchers.takesArgument; -import datadog.context.Context; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.bootstrap.InstrumentationContext; +import datadog.trace.bootstrap.instrumentation.reactivestreams.HandoffContext; import io.github.resilience4j.circuitbreaker.CircuitBreaker; import net.bytebuddy.asm.Advice; import org.reactivestreams.Publisher; @@ -30,7 +30,7 @@ public void methodAdvice(MethodTransformer transformer) { public static class ApplyAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void after( @Advice.Return(readOnly = false) Publisher result, @Advice.FieldValue(value = "circuitBreaker") CircuitBreaker circuitBreaker) { @@ -40,7 +40,8 @@ public static void after( result, CircuitBreakerDecorator.DECORATE, circuitBreaker, - InstrumentationContext.get(Publisher.class, Context.class)::put); + ReactorHelper.putInto( + InstrumentationContext.get(Publisher.class, HandoffContext.class))); } } } diff --git a/dd-java-agent/instrumentation/resilience4j/resilience4j-reactor-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/FallbackOperatorInstrumentation.java b/dd-java-agent/instrumentation/resilience4j/resilience4j-reactor-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/FallbackOperatorInstrumentation.java index 8a87951497a..ed9f5ebbd2f 100644 --- a/dd-java-agent/instrumentation/resilience4j/resilience4j-reactor-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/FallbackOperatorInstrumentation.java +++ b/dd-java-agent/instrumentation/resilience4j/resilience4j-reactor-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/FallbackOperatorInstrumentation.java @@ -5,9 +5,9 @@ import static net.bytebuddy.matcher.ElementMatchers.returns; import static net.bytebuddy.matcher.ElementMatchers.takesArgument; -import datadog.context.Context; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.bootstrap.InstrumentationContext; +import datadog.trace.bootstrap.instrumentation.reactivestreams.HandoffContext; import io.github.resilience4j.core.functions.CheckedSupplier; import java.util.function.Function; import net.bytebuddy.asm.Advice; @@ -34,13 +34,15 @@ public void methodAdvice(MethodTransformer transformer) { public static class DecorateAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void after( @Advice.Return(readOnly = false) Function, Publisher> result) { result = ReactorHelper.wrapFunction( - result, InstrumentationContext.get(Publisher.class, Context.class)::putIfAbsent); + result, + ReactorHelper.putIfAbsentInto( + InstrumentationContext.get(Publisher.class, HandoffContext.class))); } // 2.0.0+ diff --git a/dd-java-agent/instrumentation/resilience4j/resilience4j-reactor-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/ReactorHelper.java b/dd-java-agent/instrumentation/resilience4j/resilience4j-reactor-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/ReactorHelper.java index 97dc83e0859..bfb2bb7cdbe 100644 --- a/dd-java-agent/instrumentation/resilience4j/resilience4j-reactor-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/ReactorHelper.java +++ b/dd-java-agent/instrumentation/resilience4j/resilience4j-reactor-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/ReactorHelper.java @@ -2,8 +2,10 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; +import datadog.trace.bootstrap.ContextStore; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.reactivestreams.HandoffContext; import java.util.function.BiConsumer; import java.util.function.Consumer; import java.util.function.Function; @@ -19,6 +21,20 @@ public class ReactorHelper { private static final Logger log = LoggerFactory.getLogger(ReactorHelper.class); + // These build the hand-off BiConsumer here rather than in @Advice code on purpose: a lambda + // defined in advice desugars to an invokedynamic that cannot be linked once the advice is inlined + // into the (third-party) operator, and fails silently. anyThread: the span is attached at + // assembly and the publisher may be subscribed later on another thread. + public static BiConsumer, AgentSpan> putInto( + final ContextStore store) { + return (publisher, span) -> store.put(publisher, HandoffContext.anyThread(span)); + } + + public static BiConsumer, AgentSpan> putIfAbsentInto( + final ContextStore store) { + return (publisher, span) -> store.putIfAbsent(publisher, HandoffContext.anyThread(span)); + } + public static Function, Publisher> wrapFunction( Function, Publisher> operator, BiConsumer, AgentSpan> attachContext) { @@ -31,7 +47,7 @@ public static Function, Publisher> wrapFunction( spanDecorator.afterStart(current); } spanDecorator.decorate(current, null); - try (AgentScope scope = activateSpan(current)) { + try (ContextScope scope = activateSpan(current)) { Publisher ret = operator.apply(value); attachContext.accept(ret, current); if (owned == null) { diff --git a/dd-java-agent/instrumentation/resilience4j/resilience4j-reactor-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/Resilience4jReactorModule.java b/dd-java-agent/instrumentation/resilience4j/resilience4j-reactor-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/Resilience4jReactorModule.java index f1d3266c1da..53d90f8919b 100644 --- a/dd-java-agent/instrumentation/resilience4j/resilience4j-reactor-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/Resilience4jReactorModule.java +++ b/dd-java-agent/instrumentation/resilience4j/resilience4j-reactor-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/Resilience4jReactorModule.java @@ -1,9 +1,9 @@ package datadog.trace.instrumentation.resilience4j; import com.google.auto.service.AutoService; -import datadog.context.Context; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; +import datadog.trace.bootstrap.instrumentation.reactivestreams.HandoffContext; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -33,7 +33,8 @@ public String[] helperClassNames() { @Override public Map contextStore() { - return Collections.singletonMap("org.reactivestreams.Publisher", Context.class.getName()); + return Collections.singletonMap( + "org.reactivestreams.Publisher", HandoffContext.class.getName()); } @Override diff --git a/dd-java-agent/instrumentation/resilience4j/resilience4j-reactor-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/RetryOperatorInstrumentation.java b/dd-java-agent/instrumentation/resilience4j/resilience4j-reactor-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/RetryOperatorInstrumentation.java index d740571b9ae..1b395be55ab 100644 --- a/dd-java-agent/instrumentation/resilience4j/resilience4j-reactor-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/RetryOperatorInstrumentation.java +++ b/dd-java-agent/instrumentation/resilience4j/resilience4j-reactor-2.0/src/main/java/datadog/trace/instrumentation/resilience4j/RetryOperatorInstrumentation.java @@ -4,9 +4,9 @@ import static net.bytebuddy.matcher.ElementMatchers.isMethod; import static net.bytebuddy.matcher.ElementMatchers.takesArgument; -import datadog.context.Context; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.bootstrap.InstrumentationContext; +import datadog.trace.bootstrap.instrumentation.reactivestreams.HandoffContext; import io.github.resilience4j.retry.Retry; import net.bytebuddy.asm.Advice; import org.reactivestreams.Publisher; @@ -29,7 +29,7 @@ public void methodAdvice(MethodTransformer transformer) { } public static class ApplyAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void after( @Advice.Return(readOnly = false) Publisher result, @Advice.FieldValue(value = "retry") Retry retry) { @@ -39,7 +39,8 @@ public static void after( result, RetryDecorator.DECORATE, retry, - InstrumentationContext.get(Publisher.class, Context.class)::put); + ReactorHelper.putInto( + InstrumentationContext.get(Publisher.class, HandoffContext.class))); } } } diff --git a/dd-java-agent/instrumentation/resteasy/filter-resteasy/filter-resteasy-3.0/gradle.lockfile b/dd-java-agent/instrumentation/resteasy/filter-resteasy/filter-resteasy-3.0/gradle.lockfile index 8e9da10368f..81b7c0438f1 100644 --- a/dd-java-agent/instrumentation/resteasy/filter-resteasy/filter-resteasy-3.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/resteasy/filter-resteasy/filter-resteasy-3.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:resteasy:filter-resteasy:filter-resteasy-3.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -50,7 +54,7 @@ commons-io:commons-io:2.20.0=spotbugs commons-logging:commons-logging:1.1.1=compileClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javassist:javassist:3.12.1.GA=compileClasspath javax.activation:activation:1.1=compileClasspath javax.annotation:jsr250-api:1.0=compileClasspath @@ -58,8 +62,8 @@ javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath javax.ws.rs:javax.ws.rs-api:2.0=compileClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.jcip:jcip-annotations:1.0=compileClasspath @@ -93,6 +97,7 @@ org.jboss.resteasy:jaxrs-api:3.0.0.Final=compileClasspath org.jboss.resteasy:resteasy-jaxrs:3.0.0.Final=compileClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -110,14 +115,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.scannotation:scannotation:1.0.3=compileClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/resteasy/filter-resteasy/filter-resteasy-3.1/gradle.lockfile b/dd-java-agent/instrumentation/resteasy/filter-resteasy/filter-resteasy-3.1/gradle.lockfile index 51288c92bdc..a2e75ea02db 100644 --- a/dd-java-agent/instrumentation/resteasy/filter-resteasy/filter-resteasy-3.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/resteasy/filter-resteasy/filter-resteasy-3.1/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:resteasy:filter-resteasy:filter-resteasy-3.1:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -50,14 +54,14 @@ commons-io:commons-io:2.5=compileClasspath commons-logging:commons-logging:1.2=compileClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.activation:activation:1.1.1=compileClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath javax.ws.rs:javax.ws.rs-api:2.0=compileClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.jcip:jcip-annotations:1.0=compileClasspath @@ -94,6 +98,7 @@ org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec:1.0.0.Final=compi org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_2.0_spec:1.0.1.Beta1=compileClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -111,14 +116,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/resteasy/resteasy-3.0/gradle.lockfile b/dd-java-agent/instrumentation/resteasy/resteasy-3.0/gradle.lockfile index 04631093dfa..dbd3609b887 100644 --- a/dd-java-agent/instrumentation/resteasy/resteasy-3.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/resteasy/resteasy-3.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:resteasy:resteasy-3.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -50,15 +54,15 @@ commons-io:commons-io:2.20.0=spotbugs commons-logging:commons-logging:1.1.1=compileClasspath,testCompileClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javassist:javassist:3.12.1.GA=compileClasspath,testCompileClasspath,testRuntimeClasspath javax.activation:activation:1.1=compileClasspath,testCompileClasspath,testRuntimeClasspath javax.annotation:jsr250-api:1.0=compileClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.jcip:jcip-annotations:1.0=compileClasspath,testCompileClasspath,testRuntimeClasspath @@ -93,6 +97,7 @@ org.jboss.resteasy:resteasy-client:3.0.0.Final=compileClasspath,testCompileClass org.jboss.resteasy:resteasy-jaxrs:3.0.0.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -110,14 +115,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.scannotation:scannotation:1.0.3=compileClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/resteasy/resteasy-appsec-3.0/src/main/java/datadog/trace/instrumentation/resteasy/DecodedFormParametersInstrumentation.java b/dd-java-agent/instrumentation/resteasy/resteasy-appsec-3.0/src/main/java/datadog/trace/instrumentation/resteasy/DecodedFormParametersInstrumentation.java index 04745c1173a..6cb2eb998ca 100644 --- a/dd-java-agent/instrumentation/resteasy/resteasy-appsec-3.0/src/main/java/datadog/trace/instrumentation/resteasy/DecodedFormParametersInstrumentation.java +++ b/dd-java-agent/instrumentation/resteasy/resteasy-appsec-3.0/src/main/java/datadog/trace/instrumentation/resteasy/DecodedFormParametersInstrumentation.java @@ -106,7 +106,7 @@ static boolean before( return map == null; } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.FieldValue("decodedFormParameters") final MultivaluedMap map, @ActiveRequestContext RequestContext reqCtx, diff --git a/dd-java-agent/instrumentation/resteasy/resteasy-appsec-3.0/src/main/java/datadog/trace/instrumentation/resteasy/MessageBodyReaderInvocationInstrumentation.java b/dd-java-agent/instrumentation/resteasy/resteasy-appsec-3.0/src/main/java/datadog/trace/instrumentation/resteasy/MessageBodyReaderInvocationInstrumentation.java index 236dcd86713..a9e5ec578c7 100644 --- a/dd-java-agent/instrumentation/resteasy/resteasy-appsec-3.0/src/main/java/datadog/trace/instrumentation/resteasy/MessageBodyReaderInvocationInstrumentation.java +++ b/dd-java-agent/instrumentation/resteasy/resteasy-appsec-3.0/src/main/java/datadog/trace/instrumentation/resteasy/MessageBodyReaderInvocationInstrumentation.java @@ -51,7 +51,7 @@ public void methodAdvice(MethodTransformer transformer) { @RequiresRequestContext(RequestContextSlot.APPSEC) public static class AbstractReaderInterceptorAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Return final Object ret, @ActiveRequestContext RequestContext reqCtx, diff --git a/dd-java-agent/instrumentation/resteasy/resteasy-appsec-3.0/src/main/java/datadog/trace/instrumentation/resteasy/MethodExpressionInstrumentation.java b/dd-java-agent/instrumentation/resteasy/resteasy-appsec-3.0/src/main/java/datadog/trace/instrumentation/resteasy/MethodExpressionInstrumentation.java index c7f3bd29ec3..524f280bf44 100644 --- a/dd-java-agent/instrumentation/resteasy/resteasy-appsec-3.0/src/main/java/datadog/trace/instrumentation/resteasy/MethodExpressionInstrumentation.java +++ b/dd-java-agent/instrumentation/resteasy/resteasy-appsec-3.0/src/main/java/datadog/trace/instrumentation/resteasy/MethodExpressionInstrumentation.java @@ -54,7 +54,7 @@ public void methodAdvice(MethodTransformer transformer) { @RequiresRequestContext(RequestContextSlot.APPSEC) public static class PopulatePathParamsAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Argument(0) HttpRequest req, @ActiveRequestContext RequestContext reqCtx, diff --git a/dd-java-agent/instrumentation/resteasy/resteasy-appsec-3.0/src/main/java/datadog/trace/instrumentation/resteasy/MultipartFormDataReaderInstrumentation.java b/dd-java-agent/instrumentation/resteasy/resteasy-appsec-3.0/src/main/java/datadog/trace/instrumentation/resteasy/MultipartFormDataReaderInstrumentation.java index c1ea29ffe07..4a435fb0c93 100644 --- a/dd-java-agent/instrumentation/resteasy/resteasy-appsec-3.0/src/main/java/datadog/trace/instrumentation/resteasy/MultipartFormDataReaderInstrumentation.java +++ b/dd-java-agent/instrumentation/resteasy/resteasy-appsec-3.0/src/main/java/datadog/trace/instrumentation/resteasy/MultipartFormDataReaderInstrumentation.java @@ -63,7 +63,7 @@ public void methodAdvice(MethodTransformer transformer) { @RequiresRequestContext(RequestContextSlot.APPSEC) public static class ReadFromAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Return final MultipartFormDataInput ret, @ActiveRequestContext RequestContext reqCtx, diff --git a/dd-java-agent/instrumentation/restlet-2.2/gradle.lockfile b/dd-java-agent/instrumentation/restlet-2.2/gradle.lockfile index a41d702773b..e5ab1af3912 100644 --- a/dd-java-agent/instrumentation/restlet-2.2/gradle.lockfile +++ b/dd-java-agent/instrumentation/restlet-2.2/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:restlet-2.2:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=baseForkedTestCompileClasspath,baseForkedTest com.blogspot.mydailyjava:weak-lock-free:0.17=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,baseForkedTestAnnotationProcessor,baseForkedTestCompileClasspath,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,baseForkedTestAnnotati com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,baseForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,baseForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,baseForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,baseForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,baseForkedTestAnnotationProcessor,baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,baseForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=baseForkedTestCompileClasspath,baseForkedTestRuntim commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=baseForkedTestRuntimeClasspath,latestDepTestRunti org.hamcrest:hamcrest:3.0=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=baseForkedTestCompileClasspath,baseForkedTestRuntime org.opentest4j:opentest4j:1.3.0=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=baseForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.restlet.jse:org.restlet:2.2.0=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,compileClasspath,testCompileClasspath,testRuntimeClasspath org.restlet.jse:org.restlet:2.4.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=baseForkedTestCompileClasspath,baseForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/restlet-2.2/src/latestDepTest/groovy/RestletTest.groovy b/dd-java-agent/instrumentation/restlet-2.2/src/latestDepTest/groovy/RestletTest.groovy index 3217e53394d..5b3d1a75d73 100644 --- a/dd-java-agent/instrumentation/restlet-2.2/src/latestDepTest/groovy/RestletTest.groovy +++ b/dd-java-agent/instrumentation/restlet-2.2/src/latestDepTest/groovy/RestletTest.groovy @@ -1,3 +1,4 @@ +import datadog.environment.OperatingSystem import org.restlet.Request import org.restlet.Response import org.restlet.data.Header @@ -6,6 +7,12 @@ import org.restlet.util.Series class RestletTest extends RestletTestBase { + @Override + boolean testParallelRequest() { + // TODO: Parallel processing is failing on Linux arm64. + return !(OperatingSystem.isLinux() && OperatingSystem.architecture().isArm64()) + } + @Override protected Filter createHeaderFilter() { return new ResponseHeaderFilter() diff --git a/dd-java-agent/instrumentation/restlet-2.2/src/main/java/datadog/trace/instrumentation/restlet/RestletInstrumentation.java b/dd-java-agent/instrumentation/restlet-2.2/src/main/java/datadog/trace/instrumentation/restlet/RestletInstrumentation.java index f52eb224755..db2eb8c2fa5 100644 --- a/dd-java-agent/instrumentation/restlet-2.2/src/main/java/datadog/trace/instrumentation/restlet/RestletInstrumentation.java +++ b/dd-java-agent/instrumentation/restlet-2.2/src/main/java/datadog/trace/instrumentation/restlet/RestletInstrumentation.java @@ -2,7 +2,7 @@ import static datadog.trace.agent.tooling.InstrumenterModule.TargetSystem.CONTEXT_TRACKING; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.restlet.RestletDecorator.DECORATE; import static net.bytebuddy.matcher.ElementMatchers.isMethod; @@ -63,7 +63,7 @@ public static ContextScope onEnter(@Advice.Argument(0) final HttpExchange exchan return parentContext.attach(); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void closeScope(@Advice.Enter final ContextScope scope) { scope.close(); } @@ -72,8 +72,7 @@ public static void closeScope(@Advice.Enter final ContextScope scope) { public static class RestletHandleAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) public static ContextScope beginRequest(@Advice.Argument(0) final HttpExchange exchange) { - Context parentContext = - getCurrentContext(); // parent context attached by ContextTrackingAdvice + Context parentContext = currentContext(); // parent context attached by ContextTrackingAdvice Context context = DECORATE.startSpan(exchange, parentContext); AgentSpan span = spanFromContext(context); ContextScope scope = context.attach(); diff --git a/dd-java-agent/instrumentation/robolectric-4.13/build.gradle b/dd-java-agent/instrumentation/robolectric-4.13/build.gradle new file mode 100644 index 00000000000..a0d9c0605aa --- /dev/null +++ b/dd-java-agent/instrumentation/robolectric-4.13/build.gradle @@ -0,0 +1,36 @@ +muzzle { + extraRepository('google', 'https://maven.google.com') + pass { + group = 'org.robolectric' + module = 'robolectric' + versions = '[4.13,)' + // androidx.test:monitor is an Android archive (.aar) that a JVM configuration cannot consume; + // it is not referenced by the advice/helper. Mirror the compileOnly exclusion below. + excludeDependency 'androidx.test:monitor' + } +} + +apply from: "$rootDir/gradle/java.gradle" + +repositories { + // Robolectric drags in androidx.test.* transitive dependencies that are published only to + // Google's Maven. Declared after java.gradle so Maven Central is tried first + maven { + url = 'https://maven.google.com' + content { + includeGroupAndSubgroups 'androidx' + } + } +} + +dependencies { + // Instrumentation is validated through a scenario in `GradleDaemonSmokeTest`. + // Exclude androidx.test:monitor: it is an Android archive (.aar) published only to Google's Maven + // repository, is not referenced by the advice/helper. + compileOnly(group: 'org.robolectric', name: 'robolectric', version: '4.16.1') { + exclude group: 'androidx.test', module: 'monitor' + } + // RobolectricTestRunner extends JUnit's BlockJUnit4ClassRunner; JUnit must be on the compile + // classpath so its supertypes resolve (both javac and forbiddenApis walk the class hierarchy). + compileOnly group: 'junit', name: 'junit', version: '4.13.2' +} diff --git a/dd-java-agent/instrumentation/robolectric-4.13/gradle.lockfile b/dd-java-agent/instrumentation/robolectric-4.13/gradle.lockfile new file mode 100644 index 00000000000..27a76b84618 --- /dev/null +++ b/dd-java-agent/instrumentation/robolectric-4.13/gradle.lockfile @@ -0,0 +1,150 @@ +# This is a Gradle generated file for dependency locking. +# Manual edits can break the build and are not advised. +# This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:robolectric-4.13:dependencies --write-locks +cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath +cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath +ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath +com.almworks.sqlite4java:sqlite4java:1.0.392=compileClasspath +com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath +com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath +com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath +com.github.javaparser:javaparser-core:3.25.6=codenarc +com.github.jnr:jffi:1.3.15=testRuntimeClasspath +com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath +com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath +com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs +com.github.spotbugs:spotbugs:4.9.8=spotbugs +com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs +com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath +com.google.auto.service:auto-service:1.1.1=annotationProcessor,testAnnotationProcessor +com.google.auto.value:auto-value-annotations:1.11.0=compileClasspath +com.google.auto:auto-common:1.2.1=annotationProcessor,testAnnotationProcessor +com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.google.code.gson:gson:2.13.2=spotbugs +com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor +com.google.errorprone:error_prone_annotations:2.36.0=compileClasspath +com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.3=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.4.8-jre=compileClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:3.0.0=compileClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath +com.ibm.icu:icu4j:77.1=compileClasspath +com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okio:okio:1.17.5=testCompileClasspath,testRuntimeClasspath +com.thoughtworks.qdox:qdox:1.12.1=codenarc +commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testRuntimeClasspath +commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath +commons-io:commons-io:2.20.0=spotbugs +de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath +io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath +javax.annotation:javax.annotation-api:1.3.2=compileClasspath +javax.inject:javax.inject:1=compileClasspath +javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath +jaxen:jaxen:2.0.0=spotbugs +junit:junit:4.13.2=compileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath +net.java.dev.jna:jna:5.8.0=testRuntimeClasspath +net.sf.saxon:Saxon-HE:12.9=spotbugs +org.apache.ant:ant-antlr:1.10.14=codenarc +org.apache.ant:ant-junit:1.10.14=codenarc +org.apache.bcel:bcel:6.11.0=spotbugs +org.apache.commons:commons-lang3:3.19.0=spotbugs +org.apache.commons:commons-text:1.14.0=spotbugs +org.apache.logging.log4j:log4j-api:2.25.2=spotbugs +org.apache.logging.log4j:log4j-core:2.25.2=spotbugs +org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath +org.bouncycastle:bcprov-jdk18on:1.81=compileClasspath +org.checkerframework:checker-qual:3.33.0=annotationProcessor,testAnnotationProcessor +org.codehaus.groovy:groovy-ant:3.0.23=codenarc +org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc +org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.25=testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-templates:3.0.23=codenarc +org.codehaus.groovy:groovy-xml:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath +org.codenarc:CodeNarc:3.7.0=codenarc +org.dom4j:dom4j:2.2.0=spotbugs +org.gmetrics:GMetrics:2.1.0=codenarc +org.hamcrest:hamcrest-core:1.3=compileClasspath,testRuntimeClasspath +org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath +org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath +org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath +org.junit.platform:junit-platform-runner:1.14.1=testRuntimeClasspath +org.junit.platform:junit-platform-suite-api:1.14.1=testRuntimeClasspath +org.junit.platform:junit-platform-suite-commons:1.14.1=testRuntimeClasspath +org.junit:junit-bom:5.14.0=spotbugs +org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-core:4.4.0=testRuntimeClasspath +org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath +org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath +org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath +org.ow2.asm:asm-commons:9.8=compileClasspath +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.8=compileClasspath +org.ow2.asm:asm-tree:9.9=spotbugs +org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath +org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs +org.robolectric:annotations:4.16.1=compileClasspath +org.robolectric:junit:4.16.1=compileClasspath +org.robolectric:nativeruntime:4.16.1=compileClasspath +org.robolectric:pluginapi:4.16.1=compileClasspath +org.robolectric:plugins-maven-dependency-resolver:4.16.1=compileClasspath +org.robolectric:resources:4.16.1=compileClasspath +org.robolectric:robolectric:4.16.1=compileClasspath +org.robolectric:sandbox:4.16.1=compileClasspath +org.robolectric:shadowapi:4.16.1=compileClasspath +org.robolectric:shadows-framework:4.16.1=compileClasspath +org.robolectric:utils-reflector:4.16.1=compileClasspath +org.robolectric:utils:4.16.1=compileClasspath +org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath +org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath +org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath +org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j +org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j +org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,muzzleTooling,runtimeClasspath,testRuntimeClasspath +org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath +org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath +org.xmlresolver:xmlresolver:5.3.3=spotbugs +empty=spotbugsPlugins diff --git a/dd-java-agent/instrumentation/robolectric-4.13/src/main/java/datadog/trace/instrumentation/robolectric/RobolectricInstrumentation.java b/dd-java-agent/instrumentation/robolectric-4.13/src/main/java/datadog/trace/instrumentation/robolectric/RobolectricInstrumentation.java new file mode 100644 index 00000000000..d58de1dc64b --- /dev/null +++ b/dd-java-agent/instrumentation/robolectric-4.13/src/main/java/datadog/trace/instrumentation/robolectric/RobolectricInstrumentation.java @@ -0,0 +1,58 @@ +package datadog.trace.instrumentation.robolectric; + +import static datadog.trace.agent.tooling.bytebuddy.matcher.HierarchyMatchers.implementsInterface; +import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; + +import com.google.auto.service.AutoService; +import datadog.trace.agent.tooling.Instrumenter; +import datadog.trace.agent.tooling.InstrumenterModule; +import net.bytebuddy.asm.Advice; +import net.bytebuddy.description.type.TypeDescription; +import net.bytebuddy.matcher.ElementMatcher; + +/** + * Captures the emulated Android SDK for tests running under Robolectric. + * + *

      Robolectric establishes the emulated SDK in {@code TestEnvironment#setUpApplicationState}, + * which runs on the per-SDK sandbox "main" thread right before the test body (the SDK is not yet + * set when the JUnit test-start event fires, and is torn down before the finish event). + */ +@AutoService(InstrumenterModule.class) +public class RobolectricInstrumentation extends InstrumenterModule.CiVisibility + implements Instrumenter.ForTypeHierarchy, Instrumenter.HasMethodAdvice { + + public RobolectricInstrumentation() { + super("ci-visibility", "robolectric"); + } + + @Override + public String hierarchyMarkerType() { + return "org.robolectric.internal.TestEnvironment"; + } + + @Override + public ElementMatcher hierarchyMatcher() { + return implementsInterface(named(hierarchyMarkerType())); + } + + @Override + public String[] helperClassNames() { + return new String[] {packageName + ".RobolectricTestAnnotator"}; + } + + @Override + public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvice( + named("setUpApplicationState"), getClass().getName() + "$SetUpApplicationStateAdvice"); + } + + public static class SetUpApplicationStateAdvice { + // onThrowable so the tags are still captured when setUpApplicationState fails (e.g. during + // manifest/resource initialization): the emulated SDK is set early in the method, and the test + // span still exists, so the failing test should carry the Android metadata too. + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + public static void onExit() { + RobolectricTestAnnotator.annotate(); + } + } +} diff --git a/dd-java-agent/instrumentation/robolectric-4.13/src/main/java/datadog/trace/instrumentation/robolectric/RobolectricTestAnnotator.java b/dd-java-agent/instrumentation/robolectric-4.13/src/main/java/datadog/trace/instrumentation/robolectric/RobolectricTestAnnotator.java new file mode 100644 index 00000000000..8396ddc8c2d --- /dev/null +++ b/dd-java-agent/instrumentation/robolectric-4.13/src/main/java/datadog/trace/instrumentation/robolectric/RobolectricTestAnnotator.java @@ -0,0 +1,71 @@ +package datadog.trace.instrumentation.robolectric; + +import datadog.trace.api.gateway.RequestContext; +import datadog.trace.api.gateway.RequestContextSlot; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import datadog.trace.bootstrap.instrumentation.api.Tags; +import java.io.File; +import java.net.URL; +import java.security.CodeSource; +import java.security.ProtectionDomain; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.robolectric.RobolectricTestRunner; +import org.robolectric.RuntimeEnvironment; +import org.robolectric.versioning.AndroidVersions; + +public final class RobolectricTestAnnotator { + + /** Matches the version in a {@code robolectric-.jar} file name. */ + private static final Pattern ROBOLECTRIC_JAR = Pattern.compile("^robolectric-(.+)\\.jar$"); + + private RobolectricTestAnnotator() {} + + public static void annotate() { + int apiLevel = RuntimeEnvironment.getApiLevel(); + if (apiLevel <= 0) { + return; + } + + AgentSpan span = AgentTracer.activeSpan(); + if (span == null) { + return; + } + RequestContext requestContext = span.getRequestContext(); + if (requestContext == null + || requestContext.getData(RequestContextSlot.CI_VISIBILITY) == null) { + // The active span is not a CI Visibility test span; nothing to enrich. + return; + } + + span.setTag(Tags.TEST_ANDROID_API_LEVEL, apiLevel); + AndroidVersions.AndroidRelease release = AndroidVersions.getReleaseForSdkInt(apiLevel); + if (release != null) { + span.setTag(Tags.TEST_ANDROID_RELEASE, release.getVersion()); + span.setTag(Tags.TEST_ANDROID_CODENAME, release.getShortCode()); + } + String robolectricVersion = robolectricVersion(); + if (robolectricVersion != null) { + span.setTag(Tags.TEST_ANDROID_ROBOLECTRIC_VERSION, robolectricVersion); + } + } + + private static String robolectricVersion() { + try { + // RuntimeEnvironment is re-loaded by the sandbox classloader with no CodeSource, but the + // runner runs outside the sandbox (it creates it), so it is delegated to the application + // classloader and its CodeSource points at the real robolectric-.jar. + ProtectionDomain protectionDomain = RobolectricTestRunner.class.getProtectionDomain(); + CodeSource codeSource = protectionDomain != null ? protectionDomain.getCodeSource() : null; + URL location = codeSource != null ? codeSource.getLocation() : null; + if (location == null) { + return null; + } + Matcher matcher = ROBOLECTRIC_JAR.matcher(new File(location.getPath()).getName()); + return matcher.matches() ? matcher.group(1) : null; + } catch (Throwable t) { + return null; + } + } +} diff --git a/dd-java-agent/instrumentation/rs/jakarta-rs-annotations-3.0/gradle.lockfile b/dd-java-agent/instrumentation/rs/jakarta-rs-annotations-3.0/gradle.lockfile index 279917608d8..1c6555917bd 100644 --- a/dd-java-agent/instrumentation/rs/jakarta-rs-annotations-3.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/rs/jakarta-rs-annotations-3.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:rs:jakarta-rs-annotations-3.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepJava11TestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepJava11TestAnnotationProcessor,latestDepJava11TestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepJava11TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepJava11TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepJava11TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepJava11TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepJava11TestAnnotationProcessor,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepJava11TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -49,7 +53,7 @@ commons-io:commons-io:2.11.0=latestDepJava11TestCompileClasspath,latestDepJava11 commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.ws.rs:jakarta.ws.rs-api:3.0.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.ws.rs:jakarta.ws.rs-api:3.1.0=latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath jakarta.xml.bind:jakarta.xml.bind-api:3.0.0=testCompileClasspath,testRuntimeClasspath @@ -57,8 +61,8 @@ jakarta.xml.bind:jakarta.xml.bind-api:3.0.1=latestDepJava11TestCompileClasspath, javax.servlet:javax.servlet-api:3.1.0=latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,6 +91,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepJava11TestRuntimeClasspath,latestDepTest org.hamcrest:hamcrest:3.0=latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -104,14 +109,14 @@ org.objenesis:objenesis:3.3=latestDepJava11TestCompileClasspath,latestDepJava11T org.opentest4j:opentest4j:1.3.0=latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepJava11TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepJava11TestCompileClasspath,latestDepJava11TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/rs/jakarta-rs-annotations-3.0/src/main/java/datadog/trace/instrumentation/jakarta3/DefaultRequestContextInstrumentation.java b/dd-java-agent/instrumentation/rs/jakarta-rs-annotations-3.0/src/main/java/datadog/trace/instrumentation/jakarta3/DefaultRequestContextInstrumentation.java index 5a189597b64..ec65e37549e 100644 --- a/dd-java-agent/instrumentation/rs/jakarta-rs-annotations-3.0/src/main/java/datadog/trace/instrumentation/jakarta3/DefaultRequestContextInstrumentation.java +++ b/dd-java-agent/instrumentation/rs/jakarta-rs-annotations-3.0/src/main/java/datadog/trace/instrumentation/jakarta3/DefaultRequestContextInstrumentation.java @@ -73,8 +73,8 @@ public static void stopSpan( } DECORATE.beforeFinish(span); - span.finish(); scope.close(); + span.finish(); } } } diff --git a/dd-java-agent/instrumentation/rs/jakarta-rs-annotations-3.0/src/main/java/datadog/trace/instrumentation/jakarta3/JakartaRsAnnotationsInstrumentation.java b/dd-java-agent/instrumentation/rs/jakarta-rs-annotations-3.0/src/main/java/datadog/trace/instrumentation/jakarta3/JakartaRsAnnotationsInstrumentation.java index ea72c70ee17..d7fbe26311d 100644 --- a/dd-java-agent/instrumentation/rs/jakarta-rs-annotations-3.0/src/main/java/datadog/trace/instrumentation/jakarta3/JakartaRsAnnotationsInstrumentation.java +++ b/dd-java-agent/instrumentation/rs/jakarta-rs-annotations-3.0/src/main/java/datadog/trace/instrumentation/jakarta3/JakartaRsAnnotationsInstrumentation.java @@ -144,8 +144,8 @@ public static void stopSpan( if (throwable != null) { DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); - span.finish(); scope.close(); + span.finish(); return; } @@ -155,10 +155,12 @@ public static void stopSpan( } if (asyncResponse == null || !asyncResponse.isSuspended()) { DECORATE.beforeFinish(span); + scope.close(); span.finish(); + } else { + scope.close(); } // else span finished by AsyncResponseAdvice - scope.close(); } } } diff --git a/dd-java-agent/instrumentation/rs/jakarta-rs-annotations-3.0/src/main/java/datadog/trace/instrumentation/jakarta3/JakartaRsAsyncResponseInstrumentation.java b/dd-java-agent/instrumentation/rs/jakarta-rs-annotations-3.0/src/main/java/datadog/trace/instrumentation/jakarta3/JakartaRsAsyncResponseInstrumentation.java index 0942d990edd..1ae11e76090 100644 --- a/dd-java-agent/instrumentation/rs/jakarta-rs-annotations-3.0/src/main/java/datadog/trace/instrumentation/jakarta3/JakartaRsAsyncResponseInstrumentation.java +++ b/dd-java-agent/instrumentation/rs/jakarta-rs-annotations-3.0/src/main/java/datadog/trace/instrumentation/jakarta3/JakartaRsAsyncResponseInstrumentation.java @@ -65,8 +65,9 @@ public void methodAdvice(MethodTransformer transformer) { public static class AsyncResponseAdvice { - @Advice.OnMethodExit(suppress = Throwable.class) - public static void stopSpan(@Advice.This final AsyncResponse asyncResponse) { + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + public static void stopSpan( + @Advice.This final AsyncResponse asyncResponse, @Advice.Thrown Throwable throwable) { final ContextStore contextStore = InstrumentationContext.get(AsyncResponse.class, AgentSpan.class); @@ -74,6 +75,7 @@ public static void stopSpan(@Advice.This final AsyncResponse asyncResponse) { final AgentSpan span = contextStore.get(asyncResponse); if (span != null) { contextStore.put(asyncResponse, null); + DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); span.finish(); } @@ -82,7 +84,7 @@ public static void stopSpan(@Advice.This final AsyncResponse asyncResponse) { public static class AsyncResponseThrowableAdvice { - @Advice.OnMethodExit(suppress = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void stopSpan( @Advice.This final AsyncResponse asyncResponse, @Advice.Argument(0) final Throwable throwable) { @@ -102,8 +104,9 @@ public static void stopSpan( public static class AsyncResponseCancelAdvice { - @Advice.OnMethodExit(suppress = Throwable.class) - public static void stopSpan(@Advice.This final AsyncResponse asyncResponse) { + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + public static void stopSpan( + @Advice.This final AsyncResponse asyncResponse, @Advice.Thrown Throwable throwable) { final ContextStore contextStore = InstrumentationContext.get(AsyncResponse.class, AgentSpan.class); @@ -111,7 +114,11 @@ public static void stopSpan(@Advice.This final AsyncResponse asyncResponse) { final AgentSpan span = contextStore.get(asyncResponse); if (span != null) { contextStore.put(asyncResponse, null); - span.setTag("canceled", true); + if (throwable != null) { + DECORATE.onError(span, throwable); + } else { + span.setTag("canceled", true); + } DECORATE.beforeFinish(span); span.finish(); } diff --git a/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-annotations/jax-rs-annotations-1.1.1/gradle.lockfile b/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-annotations/jax-rs-annotations-1.1.1/gradle.lockfile index b5c213ca1a2..8ec23ec9ad1 100644 --- a/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-annotations/jax-rs-annotations-1.1.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-annotations/jax-rs-annotations-1.1.1/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:rs:jax-rs:jax-rs-annotations:jax-rs-annotations-1.1.1:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -17,7 +18,7 @@ com.codahale.metrics:metrics-logback:3.0.2=testCompileClasspath,testRuntimeClass com.codahale.metrics:metrics-servlets:3.0.2=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -33,15 +34,15 @@ com.fasterxml.jackson.module:jackson-module-afterburner:2.3.3=testCompileClasspa com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.3.3=testCompileClasspath,testRuntimeClasspath com.fasterxml:classmate:1.0.0=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -51,12 +52,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:17.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -86,7 +90,7 @@ io.dropwizard:dropwizard-testing:0.7.1=testCompileClasspath,testRuntimeClasspath io.dropwizard:dropwizard-util:0.7.1=testCompileClasspath,testRuntimeClasspath io.dropwizard:dropwizard-validation:0.7.1=testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.activation:activation:1.1=testCompileClasspath,testRuntimeClasspath javax.el:javax.el-api:2.2.5=testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath @@ -97,8 +101,8 @@ javax.xml.stream:stax-api:1.0-2=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.3=testCompileClasspath,testRuntimeClasspath junit:junit:4.13.2=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -143,6 +147,7 @@ org.hibernate:hibernate-validator:5.1.1.Final=testCompileClasspath,testRuntimeCl org.jboss.logging:jboss-logging:3.1.3.GA=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -161,14 +166,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-annotations/jax-rs-annotations-2.0/gradle.lockfile b/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-annotations/jax-rs-annotations-2.0/gradle.lockfile index b7e9b9347cb..39c4601d069 100644 --- a/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-annotations/jax-rs-annotations-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-annotations/jax-rs-annotations-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:rs:jax-rs:jax-rs-annotations:jax-rs-annotations-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-access:1.2.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -9,7 +10,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath @@ -28,15 +29,15 @@ com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.9.10=latestDepTes com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml:classmate:1.3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,nestedTestAnnotationProcessor,nestedTestCompileClasspath,resteasy31TestAnnotationProcessor,resteasy31TestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -45,15 +46,16 @@ com.google.auto:auto-common:1.2.1=annotationProcessor,latestDepTestAnnotationPro com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestAnnotationProcessor,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestAnnotationProcessor,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,nestedTestAnnotationProcessor,resteasy31TestAnnotationProcessor,testAnnotationProcessor -com.google.errorprone:error_prone_annotations:2.3.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestAnnotationProcessor,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestAnnotationProcessor,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -com.google.guava:guava:30.1-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,nestedTestAnnotationProcessor,resteasy31TestAnnotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,nestedTestAnnotationProcessor,resteasy31TestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestAnnotationProcessor,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestAnnotationProcessor,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath -com.google.j2objc:j2objc-annotations:1.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,nestedTestAnnotationProcessor,resteasy31TestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath com.helger:profiler:1.1.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -95,7 +97,7 @@ io.dropwizard:dropwizard-testing:1.3.29=latestDepTestCompileClasspath,latestDepT io.dropwizard:dropwizard-util:1.3.29=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.dropwizard:dropwizard-validation:1.3.29=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath jakarta.xml.bind:jakarta.xml.bind-api:2.3.3=nestedTestCompileClasspath,nestedTestRuntimeClasspath javassist:javassist:3.12.1.GA=nestedTestCompileClasspath,nestedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.activation:activation:1.1=nestedTestCompileClasspath,nestedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -114,8 +116,8 @@ jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.10.9=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath junit:junit:4.13.1=latestDepTestCompileClasspath,nestedTestCompileClasspath,resteasy31TestCompileClasspath,testCompileClasspath junit:junit:4.13.2=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath net.jcip:jcip-annotations:1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -139,7 +141,6 @@ org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=latestDepTestCompileClasspath,nestedTestCompileClasspath,resteasy31TestCompileClasspath,testCompileClasspath org.assertj:assertj-core:3.18.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.checkerframework:checker-qual:3.33.0=annotationProcessor,latestDepTestAnnotationProcessor,nestedTestAnnotationProcessor,resteasy31TestAnnotationProcessor,testAnnotationProcessor -org.checkerframework:checker-qual:3.5.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc @@ -202,6 +203,7 @@ org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_2.1_spec:1.0.1.Final=latestDepTestCom org.jboss.spec.javax.xml.bind:jboss-jaxb-api_2.3_spec:1.0.0.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -219,14 +221,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,nestedTestRuntimeClasspath,resteasy31TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.scannotation:scannotation:1.0.3=nestedTestCompileClasspath,nestedTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,nestedTestCompileClasspath,nestedTestRuntimeClasspath,resteasy31TestCompileClasspath,resteasy31TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-annotations/jax-rs-annotations-2.0/src/main/java/datadog/trace/instrumentation/jaxrs2/DefaultRequestContextInstrumentation.java b/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-annotations/jax-rs-annotations-2.0/src/main/java/datadog/trace/instrumentation/jaxrs2/DefaultRequestContextInstrumentation.java index 4c9b3098967..8dc0da68fbd 100644 --- a/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-annotations/jax-rs-annotations-2.0/src/main/java/datadog/trace/instrumentation/jaxrs2/DefaultRequestContextInstrumentation.java +++ b/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-annotations/jax-rs-annotations-2.0/src/main/java/datadog/trace/instrumentation/jaxrs2/DefaultRequestContextInstrumentation.java @@ -72,8 +72,8 @@ public static void stopSpan( } DECORATE.beforeFinish(span); - span.finish(); scope.close(); + span.finish(); } } } diff --git a/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-annotations/jax-rs-annotations-2.0/src/main/java/datadog/trace/instrumentation/jaxrs2/JaxRsAnnotationsInstrumentation.java b/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-annotations/jax-rs-annotations-2.0/src/main/java/datadog/trace/instrumentation/jaxrs2/JaxRsAnnotationsInstrumentation.java index 5fe95a54c64..963637e91f8 100644 --- a/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-annotations/jax-rs-annotations-2.0/src/main/java/datadog/trace/instrumentation/jaxrs2/JaxRsAnnotationsInstrumentation.java +++ b/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-annotations/jax-rs-annotations-2.0/src/main/java/datadog/trace/instrumentation/jaxrs2/JaxRsAnnotationsInstrumentation.java @@ -151,8 +151,8 @@ public static void stopSpan( if (throwable != null) { DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); - span.finish(); scope.close(); + span.finish(); return; } @@ -162,10 +162,12 @@ public static void stopSpan( } if (asyncResponse == null || !asyncResponse.isSuspended()) { DECORATE.beforeFinish(span); + scope.close(); span.finish(); + } else { + scope.close(); } // else span finished by AsyncResponseAdvice - scope.close(); } } } diff --git a/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-annotations/jax-rs-annotations-2.0/src/main/java/datadog/trace/instrumentation/jaxrs2/JaxRsAsyncResponseInstrumentation.java b/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-annotations/jax-rs-annotations-2.0/src/main/java/datadog/trace/instrumentation/jaxrs2/JaxRsAsyncResponseInstrumentation.java index 849ff1cdc98..9972a720d8c 100644 --- a/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-annotations/jax-rs-annotations-2.0/src/main/java/datadog/trace/instrumentation/jaxrs2/JaxRsAsyncResponseInstrumentation.java +++ b/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-annotations/jax-rs-annotations-2.0/src/main/java/datadog/trace/instrumentation/jaxrs2/JaxRsAsyncResponseInstrumentation.java @@ -65,8 +65,9 @@ public void methodAdvice(MethodTransformer transformer) { public static class AsyncResponseAdvice { - @Advice.OnMethodExit(suppress = Throwable.class) - public static void stopSpan(@Advice.This final AsyncResponse asyncResponse) { + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + public static void stopSpan( + @Advice.This final AsyncResponse asyncResponse, @Advice.Thrown Throwable throwable) { final ContextStore contextStore = InstrumentationContext.get(AsyncResponse.class, AgentSpan.class); @@ -74,6 +75,7 @@ public static void stopSpan(@Advice.This final AsyncResponse asyncResponse) { final AgentSpan span = contextStore.get(asyncResponse); if (span != null) { contextStore.put(asyncResponse, null); + DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); span.finish(); } @@ -82,7 +84,7 @@ public static void stopSpan(@Advice.This final AsyncResponse asyncResponse) { public static class AsyncResponseThrowableAdvice { - @Advice.OnMethodExit(suppress = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void stopSpan( @Advice.This final AsyncResponse asyncResponse, @Advice.Argument(0) final Throwable throwable) { @@ -102,8 +104,9 @@ public static void stopSpan( public static class AsyncResponseCancelAdvice { - @Advice.OnMethodExit(suppress = Throwable.class) - public static void stopSpan(@Advice.This final AsyncResponse asyncResponse) { + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + public static void stopSpan( + @Advice.This final AsyncResponse asyncResponse, @Advice.Thrown Throwable throwable) { final ContextStore contextStore = InstrumentationContext.get(AsyncResponse.class, AgentSpan.class); @@ -111,7 +114,11 @@ public static void stopSpan(@Advice.This final AsyncResponse asyncResponse) { final AgentSpan span = contextStore.get(asyncResponse); if (span != null) { contextStore.put(asyncResponse, null); - span.setTag("canceled", true); + if (throwable != null) { + DECORATE.onError(span, throwable); + } else { + span.setTag("canceled", true); + } DECORATE.beforeFinish(span); span.finish(); } diff --git a/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-client/jax-rs-client-1.1/gradle.lockfile b/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-client/jax-rs-client-1.1/gradle.lockfile index 2f03f0697b9..be66df70c53 100644 --- a/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-client/jax-rs-client-1.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-client/jax-rs-client-1.1/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:rs:jax-rs:jax-rs-client:jax-rs-client-1.1:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -51,13 +55,13 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.ws.rs:jsr311-api:1.1.1=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -86,6 +90,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -103,14 +108,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-client/jax-rs-client-1.1/src/main/java/datadog/trace/instrumentation/jaxrs/v1/JaxRsClientV1Instrumentation.java b/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-client/jax-rs-client-1.1/src/main/java/datadog/trace/instrumentation/jaxrs/v1/JaxRsClientV1Instrumentation.java index c21382ad3e9..6f3e92f6813 100644 --- a/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-client/jax-rs-client-1.1/src/main/java/datadog/trace/instrumentation/jaxrs/v1/JaxRsClientV1Instrumentation.java +++ b/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-client/jax-rs-client-1.1/src/main/java/datadog/trace/instrumentation/jaxrs/v1/JaxRsClientV1Instrumentation.java @@ -6,7 +6,7 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; import static datadog.trace.instrumentation.jaxrs.v1.InjectAdapter.SETTER; import static datadog.trace.instrumentation.jaxrs.v1.JaxRsClientV1Decorator.DECORATE; @@ -103,7 +103,7 @@ public static void onExit( public static class HandleContextPropagationAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) public static void onEnter(@Advice.Argument(0) final ClientRequest request) { - DECORATE.injectContext(getCurrentContext(), request.getHeaders(), SETTER); + DECORATE.injectContext(currentContext(), request.getHeaders(), SETTER); } } } diff --git a/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-client/jax-rs-client-2.0/build.gradle b/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-client/jax-rs-client-2.0/build.gradle index d815a85207e..3cab406b467 100644 --- a/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-client/jax-rs-client-2.0/build.gradle +++ b/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-client/jax-rs-client-2.0/build.gradle @@ -41,3 +41,10 @@ dependencies { latestDepTestImplementation group: 'org.apache.cxf', name: 'cxf-rt-rs-client', version: '3.2.6' latestDepTestImplementation group: 'org.jboss.resteasy', name: 'resteasy-client', version: '3.0.26.Final' } + +// Jersey 2.0 links to Guava's removed MoreExecutors.sameThreadExecutor method. +['testCompileClasspath', 'testRuntimeClasspath'].each { + configurations.named(it) { + resolutionStrategy.force 'com.google.guava:guava:20.0' + } +} diff --git a/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-client/jax-rs-client-2.0/gradle.lockfile b/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-client/jax-rs-client-2.0/gradle.lockfile index 0dbb306a010..42bc0188cf1 100644 --- a/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-client/jax-rs-client-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-client/jax-rs-client-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:rs:jax-rs:jax-rs-client:jax-rs-client-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,21 +9,21 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.fasterxml.woodstox:woodstox-core:5.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -32,12 +33,16 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -52,7 +57,7 @@ commons-logging:commons-logging:1.1.1=testCompileClasspath,testRuntimeClasspath commons-logging:commons-logging:1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath jakarta.ws.rs:jakarta.ws.rs-api:2.1.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath javassist:javassist:3.12.1.GA=testCompileClasspath,testRuntimeClasspath @@ -68,8 +73,8 @@ javax.xml.bind:jaxb-api:2.2.3=latestDepTestCompileClasspath,latestDepTestRuntime javax.xml.stream:stax-api:1.0-2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.jcip:jcip-annotations:1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -144,6 +149,7 @@ org.jboss.spec.javax.annotation:jboss-annotations-api_1.2_spec:1.0.0.Final=lates org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_2.0_spec:1.0.1.Beta1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -161,14 +167,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.scannotation:scannotation:1.0.3=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-client/jax-rs-client-2.0/src/main/java/datadog/trace/instrumentation/jaxrs/ClientTracingFilter.java b/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-client/jax-rs-client-2.0/src/main/java/datadog/trace/instrumentation/jaxrs/ClientTracingFilter.java index 639891cace2..45e6c04a3a0 100644 --- a/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-client/jax-rs-client-2.0/src/main/java/datadog/trace/instrumentation/jaxrs/ClientTracingFilter.java +++ b/dd-java-agent/instrumentation/rs/jax-rs/jax-rs-client/jax-rs-client-2.0/src/main/java/datadog/trace/instrumentation/jaxrs/ClientTracingFilter.java @@ -8,7 +8,7 @@ import static datadog.trace.instrumentation.jaxrs.JaxRsClientDecorator.JAX_RS_CLIENT; import static datadog.trace.instrumentation.jaxrs.JaxRsClientDecorator.JAX_RS_CLIENT_CALL; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import javax.annotation.Priority; import javax.ws.rs.Priorities; @@ -24,7 +24,7 @@ public class ClientTracingFilter implements ClientRequestFilter, ClientResponseF @Override public void filter(final ClientRequestContext requestContext) { final AgentSpan span = startSpan(JAX_RS_CLIENT.toString(), JAX_RS_CLIENT_CALL); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { DECORATE.afterStart(span); DECORATE.onRequest(span, requestContext); DECORATE.injectContext(current().with(span), requestContext.getHeaders(), SETTER); diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-1.0/gradle.lockfile b/dd-java-agent/instrumentation/rxjava/rxjava-1.0/gradle.lockfile index 57a8070e1ce..07f821ef4fe 100644 --- a/dd-java-agent/instrumentation/rxjava/rxjava-1.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/rxjava/rxjava-1.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:rxjava:rxjava-1.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -48,12 +52,12 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath io.reactivex:rxjava:1.0.7=compileClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -82,6 +86,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -99,14 +104,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-1.0/src/main/java/datadog/trace/instrumentation/rxjava/TracedOnSubscribe.java b/dd-java-agent/instrumentation/rxjava/rxjava-1.0/src/main/java/datadog/trace/instrumentation/rxjava/TracedOnSubscribe.java index e18502fa092..f88a82fa3d6 100644 --- a/dd-java-agent/instrumentation/rxjava/rxjava-1.0/src/main/java/datadog/trace/instrumentation/rxjava/TracedOnSubscribe.java +++ b/dd-java-agent/instrumentation/rxjava/rxjava-1.0/src/main/java/datadog/trace/instrumentation/rxjava/TracedOnSubscribe.java @@ -4,7 +4,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.decorator.BaseDecorator; import rx.DDTracingUtil; @@ -35,10 +35,11 @@ protected String instrumentationName() { @Override public void call(final Subscriber subscriber) { final AgentSpan span = - startSpan(instrumentationName(), operationName, parent != null ? parent.context() : null); + startSpan( + instrumentationName(), operationName, parent != null ? parent.spanContext() : null); afterStart(span); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { delegate.call(new TracedSubscriber(span, subscriber, decorator)); } } diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-1.0/src/main/java/datadog/trace/instrumentation/rxjava/TracedSubscriber.java b/dd-java-agent/instrumentation/rxjava/rxjava-1.0/src/main/java/datadog/trace/instrumentation/rxjava/TracedSubscriber.java index c9eccecbc85..9eeb30270f4 100644 --- a/dd-java-agent/instrumentation/rxjava/rxjava-1.0/src/main/java/datadog/trace/instrumentation/rxjava/TracedSubscriber.java +++ b/dd-java-agent/instrumentation/rxjava/rxjava-1.0/src/main/java/datadog/trace/instrumentation/rxjava/TracedSubscriber.java @@ -2,7 +2,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.decorator.BaseDecorator; import java.util.concurrent.atomic.AtomicReference; @@ -28,7 +28,7 @@ public TracedSubscriber( public void onStart() { final AgentSpan span = spanRef.get(); if (span != null) { - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { delegate.onStart(); } } else { @@ -40,7 +40,7 @@ public void onStart() { public void onNext(final T value) { final AgentSpan span = spanRef.get(); if (span != null) { - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { delegate.onNext(value); } catch (final Throwable e) { onError(e); @@ -55,7 +55,7 @@ public void onCompleted() { final AgentSpan span = spanRef.getAndSet(null); if (span != null) { boolean errored = false; - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { delegate.onCompleted(); } catch (final Throwable e) { // Repopulate the spanRef for onError @@ -78,7 +78,7 @@ public void onCompleted() { public void onError(final Throwable e) { final AgentSpan span = spanRef.getAndSet(null); if (span != null) { - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { decorator.onError(span, e); delegate.onError(e); } catch (final Throwable e2) { diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-2.0/gradle.lockfile b/dd-java-agent/instrumentation/rxjava/rxjava-2.0/gradle.lockfile index f143bf55d9e..0ae20a8040d 100644 --- a/dd-java-agent/instrumentation/rxjava/rxjava-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/rxjava/rxjava-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:rxjava:rxjava-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -53,12 +57,12 @@ io.opentelemetry:opentelemetry-context:1.28.0=latestDepTestCompileClasspath,late io.reactivex.rxjava2:rxjava:2.0.0=compileClasspath io.reactivex.rxjava2:rxjava:2.0.5=testCompileClasspath,testRuntimeClasspath io.reactivex.rxjava2:rxjava:2.2.21=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,6 +91,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -104,14 +109,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-2.0/src/main/java/datadog/trace/instrumentation/rxjava2/CompletableInstrumentation.java b/dd-java-agent/instrumentation/rxjava/rxjava-2.0/src/main/java/datadog/trace/instrumentation/rxjava2/CompletableInstrumentation.java index 9c0610faed6..cfed4b67c45 100644 --- a/dd-java-agent/instrumentation/rxjava/rxjava-2.0/src/main/java/datadog/trace/instrumentation/rxjava2/CompletableInstrumentation.java +++ b/dd-java-agent/instrumentation/rxjava/rxjava-2.0/src/main/java/datadog/trace/instrumentation/rxjava2/CompletableInstrumentation.java @@ -1,6 +1,8 @@ package datadog.trace.instrumentation.rxjava2; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static net.bytebuddy.matcher.ElementMatchers.isConstructor; import static net.bytebuddy.matcher.ElementMatchers.isMethod; import static net.bytebuddy.matcher.ElementMatchers.takesArgument; @@ -10,7 +12,6 @@ import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge; import io.reactivex.Completable; import io.reactivex.CompletableObserver; import net.bytebuddy.asm.Advice; @@ -37,8 +38,8 @@ public void methodAdvice(MethodTransformer transformer) { public static class CaptureParentSpanAdvice { @Advice.OnMethodExit(suppress = Throwable.class) public static void onConstruct(@Advice.This final Completable completable) { - Context parentContext = Java8BytecodeBridge.getCurrentContext(); - if (parentContext != null && parentContext != Java8BytecodeBridge.getRootContext()) { + Context parentContext = currentContext(); + if (parentContext != rootContext()) { InstrumentationContext.get(Completable.class, Context.class) .put(completable, parentContext); } diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-2.0/src/main/java/datadog/trace/instrumentation/rxjava2/FlowableInstrumentation.java b/dd-java-agent/instrumentation/rxjava/rxjava-2.0/src/main/java/datadog/trace/instrumentation/rxjava2/FlowableInstrumentation.java index 97276c5b5af..291b8efe8fa 100644 --- a/dd-java-agent/instrumentation/rxjava/rxjava-2.0/src/main/java/datadog/trace/instrumentation/rxjava2/FlowableInstrumentation.java +++ b/dd-java-agent/instrumentation/rxjava/rxjava-2.0/src/main/java/datadog/trace/instrumentation/rxjava2/FlowableInstrumentation.java @@ -1,6 +1,8 @@ package datadog.trace.instrumentation.rxjava2; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static net.bytebuddy.matcher.ElementMatchers.isConstructor; import static net.bytebuddy.matcher.ElementMatchers.isMethod; import static net.bytebuddy.matcher.ElementMatchers.takesArgument; @@ -10,7 +12,6 @@ import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge; import io.reactivex.Flowable; import net.bytebuddy.asm.Advice; import org.reactivestreams.Subscriber; @@ -37,8 +38,8 @@ public void methodAdvice(MethodTransformer transformer) { public static class CaptureParentSpanAdvice { @Advice.OnMethodExit(suppress = Throwable.class) public static void onConstruct(@Advice.This final Flowable flowable) { - Context parentContext = Java8BytecodeBridge.getCurrentContext(); - if (parentContext != null && parentContext != Java8BytecodeBridge.getRootContext()) { + Context parentContext = currentContext(); + if (parentContext != rootContext()) { InstrumentationContext.get(Flowable.class, Context.class).put(flowable, parentContext); } } diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-2.0/src/main/java/datadog/trace/instrumentation/rxjava2/MaybeInstrumentation.java b/dd-java-agent/instrumentation/rxjava/rxjava-2.0/src/main/java/datadog/trace/instrumentation/rxjava2/MaybeInstrumentation.java index 89ee0bf813c..2608e91873d 100644 --- a/dd-java-agent/instrumentation/rxjava/rxjava-2.0/src/main/java/datadog/trace/instrumentation/rxjava2/MaybeInstrumentation.java +++ b/dd-java-agent/instrumentation/rxjava/rxjava-2.0/src/main/java/datadog/trace/instrumentation/rxjava2/MaybeInstrumentation.java @@ -1,6 +1,8 @@ package datadog.trace.instrumentation.rxjava2; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static net.bytebuddy.matcher.ElementMatchers.isConstructor; import static net.bytebuddy.matcher.ElementMatchers.isMethod; import static net.bytebuddy.matcher.ElementMatchers.takesArgument; @@ -10,7 +12,6 @@ import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge; import io.reactivex.Maybe; import io.reactivex.MaybeObserver; import net.bytebuddy.asm.Advice; @@ -36,8 +37,8 @@ public void methodAdvice(MethodTransformer transformer) { public static class CaptureParentSpanAdvice { @Advice.OnMethodExit(suppress = Throwable.class) public static void onConstruct(@Advice.This final Maybe maybe) { - Context parentContext = Java8BytecodeBridge.getCurrentContext(); - if (parentContext != null && parentContext != Java8BytecodeBridge.getRootContext()) { + Context parentContext = currentContext(); + if (parentContext != rootContext()) { InstrumentationContext.get(Maybe.class, Context.class).put(maybe, parentContext); } } diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-2.0/src/main/java/datadog/trace/instrumentation/rxjava2/ObservableInstrumentation.java b/dd-java-agent/instrumentation/rxjava/rxjava-2.0/src/main/java/datadog/trace/instrumentation/rxjava2/ObservableInstrumentation.java index cfd51d9bb06..067dee10e52 100644 --- a/dd-java-agent/instrumentation/rxjava/rxjava-2.0/src/main/java/datadog/trace/instrumentation/rxjava2/ObservableInstrumentation.java +++ b/dd-java-agent/instrumentation/rxjava/rxjava-2.0/src/main/java/datadog/trace/instrumentation/rxjava2/ObservableInstrumentation.java @@ -1,6 +1,8 @@ package datadog.trace.instrumentation.rxjava2; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static net.bytebuddy.matcher.ElementMatchers.isConstructor; import static net.bytebuddy.matcher.ElementMatchers.isMethod; import static net.bytebuddy.matcher.ElementMatchers.takesArgument; @@ -10,7 +12,6 @@ import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge; import io.reactivex.Observable; import io.reactivex.Observer; import net.bytebuddy.asm.Advice; @@ -36,8 +37,8 @@ public void methodAdvice(MethodTransformer transformer) { public static class CaptureParentSpanAdvice { @Advice.OnMethodExit(suppress = Throwable.class) public static void onConstruct(@Advice.This final Observable observable) { - Context parentContext = Java8BytecodeBridge.getCurrentContext(); - if (parentContext != null) { + Context parentContext = currentContext(); + if (parentContext != rootContext()) { InstrumentationContext.get(Observable.class, Context.class).put(observable, parentContext); } } @@ -51,7 +52,7 @@ public static ContextScope onSubscribe( if (observer != null) { Context parentContext = InstrumentationContext.get(Observable.class, Context.class).get(observable); - if (parentContext != null && parentContext != Java8BytecodeBridge.getRootContext()) { + if (parentContext != null) { // wrap the observer so spans from its events treat the captured span as their parent observer = new TracingObserver<>(observer, parentContext); // attach the context here in case additional observers are created during subscribe diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-2.0/src/main/java/datadog/trace/instrumentation/rxjava2/SingleInstrumentation.java b/dd-java-agent/instrumentation/rxjava/rxjava-2.0/src/main/java/datadog/trace/instrumentation/rxjava2/SingleInstrumentation.java index 98d214606bb..a94a48f2968 100644 --- a/dd-java-agent/instrumentation/rxjava/rxjava-2.0/src/main/java/datadog/trace/instrumentation/rxjava2/SingleInstrumentation.java +++ b/dd-java-agent/instrumentation/rxjava/rxjava-2.0/src/main/java/datadog/trace/instrumentation/rxjava2/SingleInstrumentation.java @@ -1,6 +1,8 @@ package datadog.trace.instrumentation.rxjava2; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static net.bytebuddy.matcher.ElementMatchers.isConstructor; import static net.bytebuddy.matcher.ElementMatchers.isMethod; import static net.bytebuddy.matcher.ElementMatchers.takesArgument; @@ -10,7 +12,6 @@ import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge; import io.reactivex.Single; import io.reactivex.SingleObserver; import net.bytebuddy.asm.Advice; @@ -37,8 +38,8 @@ public void methodAdvice(MethodTransformer transformer) { public static class CaptureParentSpanAdvice { @Advice.OnMethodExit(suppress = Throwable.class) public static void onConstruct(@Advice.This final Single single) { - Context parentContext = Java8BytecodeBridge.getCurrentContext(); - if (parentContext != null) { + Context parentContext = currentContext(); + if (parentContext != rootContext()) { InstrumentationContext.get(Single.class, Context.class).put(single, parentContext); } } @@ -51,7 +52,7 @@ public static ContextScope onSubscribe( @Advice.Argument(value = 0, readOnly = false) SingleObserver observer) { if (observer != null) { Context parentContext = InstrumentationContext.get(Single.class, Context.class).get(single); - if (parentContext != null && parentContext != Java8BytecodeBridge.getRootContext()) { + if (parentContext != null) { // wrap the observer so spans from its events treat the captured span as their parent observer = new TracingSingleObserver<>(observer, parentContext); // attach the context here in case additional observers are created during subscribe diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-2.0/src/test/groovy/RxJava2Test.groovy b/dd-java-agent/instrumentation/rxjava/rxjava-2.0/src/test/groovy/RxJava2Test.groovy index b7dd68fa1d2..ad858348316 100644 --- a/dd-java-agent/instrumentation/rxjava/rxjava-2.0/src/test/groovy/RxJava2Test.groovy +++ b/dd-java-agent/instrumentation/rxjava/rxjava-2.0/src/test/groovy/RxJava2Test.groovy @@ -20,12 +20,6 @@ class RxJava2Test extends InstrumentationSpecification { public static final String EXCEPTION_MESSAGE = "test exception" - @Override - boolean useStrictTraceWrites() { - // TODO fix this by making sure that spans get closed properly - return false - } - @Shared def addOne = { i -> addOneFunc(i) diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-3.0/build.gradle b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/build.gradle new file mode 100644 index 00000000000..50d136149d4 --- /dev/null +++ b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/build.gradle @@ -0,0 +1,36 @@ +muzzle { + pass { + group = "io.reactivex.rxjava3" + module = "rxjava" + versions = "[3.0.0,)" + } + // Assert the rxjava3 advice never resolves against rxjava2 — the two namespaces + // must not overlap. rxjava3 references io.reactivex.rxjava3.core.*, absent from the + // rxjava2 artifact, so muzzle must fail to match it. + fail { + name = "rxjava2-must-not-match" + group = "io.reactivex.rxjava2" + module = "rxjava" + versions = "[2.0.0,)" + } +} + +apply from: "$rootDir/gradle/java.gradle" + +addTestSuiteForDir('latestDepTest', 'test') + +dependencies { + compileOnly group: 'org.reactivestreams', name: 'reactive-streams', version: '1.0.3' + compileOnly group: 'io.reactivex.rxjava3', name: 'rxjava', version: '3.0.0' + + testImplementation project(':dd-java-agent:instrumentation:datadog:tracing:trace-annotation') + testImplementation project(':dd-java-agent:instrumentation:opentelemetry:opentelemetry-annotations-1.20') + testImplementation group: 'io.reactivex.rxjava3', name: 'rxjava', version: '3.0.0' + testImplementation group: 'io.opentelemetry.instrumentation', name: 'opentelemetry-instrumentation-annotations', version: '1.28.0' + + // Load the rxjava2 instrumenter at test runtime to prove the two versions coexist on + // the agent without interference (it stays dormant with only rxjava3 on the classpath). + testRuntimeOnly project(':dd-java-agent:instrumentation:rxjava:rxjava-2.0') + + latestDepTestImplementation group: 'io.reactivex.rxjava3', name: 'rxjava', version: '+' +} diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-3.0/gradle.lockfile b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/gradle.lockfile new file mode 100644 index 00000000000..9f78219f652 --- /dev/null +++ b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/gradle.lockfile @@ -0,0 +1,134 @@ +# This is a Gradle generated file for dependency locking. +# Manual edits can break the build and are not advised. +# This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:rxjava:rxjava-3.0:dependencies --write-locks +cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.javaparser:javaparser-core:3.25.6=codenarc +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs +com.github.spotbugs:spotbugs:4.9.8=spotbugs +com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs +com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath +com.google.auto.service:auto-service:1.1.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.auto:auto-common:1.2.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.google.code.gson:gson:2.13.2=spotbugs +com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.okio:okio:1.17.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.thoughtworks.qdox:qdox:1.12.1=codenarc +commons-fileupload:commons-fileupload:1.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +commons-io:commons-io:2.20.0=spotbugs +de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations:1.28.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.opentelemetry:opentelemetry-api:1.28.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.opentelemetry:opentelemetry-context:1.28.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.reactivex.rxjava3:rxjava:3.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath +io.reactivex.rxjava3:rxjava:3.1.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +jaxen:jaxen:2.0.0=spotbugs +junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +net.sf.saxon:Saxon-HE:12.9=spotbugs +org.apache.ant:ant-antlr:1.10.14=codenarc +org.apache.ant:ant-junit:1.10.14=codenarc +org.apache.bcel:bcel:6.11.0=spotbugs +org.apache.commons:commons-lang3:3.19.0=spotbugs +org.apache.commons:commons-text:1.14.0=spotbugs +org.apache.logging.log4j:log4j-api:2.25.2=spotbugs +org.apache.logging.log4j:log4j-core:2.25.2=spotbugs +org.apiguardian:apiguardian-api:1.1.2=latestDepTestCompileClasspath,testCompileClasspath +org.checkerframework:checker-qual:3.33.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +org.codehaus.groovy:groovy-ant:3.0.23=codenarc +org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc +org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.25=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-templates:3.0.23=codenarc +org.codehaus.groovy:groovy-xml:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.25=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codenarc:CodeNarc:3.7.0=codenarc +org.dom4j:dom4j:2.2.0=spotbugs +org.gmetrics:GMetrics:2.1.0=codenarc +org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-runner:1.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-api:1.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-suite-commons:1.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.junit:junit-bom:5.14.0=spotbugs +org.junit:junit-bom:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-core:4.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.9=spotbugs +org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs +org.reactivestreams:reactive-streams:1.0.3=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.reactivestreams:reactive-streams:1.0.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath +org.slf4j:slf4j-api:1.7.32=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j +org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j +org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath +org.spockframework:spock-bom:2.4-groovy-3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.spockframework:spock-core:2.4-groovy-3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-junit:1.2.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-parser:1.2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.xmlresolver:xmlresolver:5.3.3=spotbugs +empty=spotbugsPlugins diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/CompletableInstrumentation.java b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/CompletableInstrumentation.java new file mode 100644 index 00000000000..a77e46fe698 --- /dev/null +++ b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/CompletableInstrumentation.java @@ -0,0 +1,73 @@ +package datadog.trace.instrumentation.rxjava3; + +import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; +import static net.bytebuddy.matcher.ElementMatchers.isConstructor; +import static net.bytebuddy.matcher.ElementMatchers.isMethod; +import static net.bytebuddy.matcher.ElementMatchers.takesArgument; +import static net.bytebuddy.matcher.ElementMatchers.takesArguments; + +import datadog.context.Context; +import datadog.context.ContextScope; +import datadog.trace.agent.tooling.Instrumenter; +import datadog.trace.bootstrap.InstrumentationContext; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.CompletableObserver; +import net.bytebuddy.asm.Advice; + +public final class CompletableInstrumentation + implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { + + @Override + public String instrumentedType() { + return "io.reactivex.rxjava3.core.Completable"; + } + + @Override + public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvice(isConstructor(), getClass().getName() + "$CaptureParentSpanAdvice"); + transformer.applyAdvice( + isMethod() + .and(named("subscribe")) + .and(takesArguments(1)) + .and(takesArgument(0, named("io.reactivex.rxjava3.core.CompletableObserver"))), + getClass().getName() + "$PropagateParentSpanAdvice"); + } + + public static class CaptureParentSpanAdvice { + @Advice.OnMethodExit(suppress = Throwable.class) + public static void onConstruct(@Advice.This final Completable completable) { + Context parentContext = currentContext(); + if (parentContext != rootContext()) { + InstrumentationContext.get(Completable.class, Context.class) + .put(completable, parentContext); + } + } + } + + public static class PropagateParentSpanAdvice { + @Advice.OnMethodEnter(suppress = Throwable.class) + public static ContextScope onSubscribe( + @Advice.This final Completable completable, + @Advice.Argument(value = 0, readOnly = false) CompletableObserver observer) { + if (observer != null) { + Context parentContext = + InstrumentationContext.get(Completable.class, Context.class).get(completable); + if (parentContext != null) { + observer = new TracingCompletableObserver(observer, parentContext); + // attach the context here in case additional observers are created during subscribe + return parentContext.attach(); + } + } + return null; + } + + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + public static void closeScope(@Advice.Enter final ContextScope scope) { + if (scope != null) { + scope.close(); + } + } + } +} diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/FlowableInstrumentation.java b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/FlowableInstrumentation.java new file mode 100644 index 00000000000..35f06daed79 --- /dev/null +++ b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/FlowableInstrumentation.java @@ -0,0 +1,72 @@ +package datadog.trace.instrumentation.rxjava3; + +import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; +import static net.bytebuddy.matcher.ElementMatchers.isConstructor; +import static net.bytebuddy.matcher.ElementMatchers.isMethod; +import static net.bytebuddy.matcher.ElementMatchers.takesArgument; +import static net.bytebuddy.matcher.ElementMatchers.takesArguments; + +import datadog.context.Context; +import datadog.context.ContextScope; +import datadog.trace.agent.tooling.Instrumenter; +import datadog.trace.bootstrap.InstrumentationContext; +import io.reactivex.rxjava3.core.Flowable; +import io.reactivex.rxjava3.core.FlowableSubscriber; +import net.bytebuddy.asm.Advice; + +public final class FlowableInstrumentation + implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { + + @Override + public String instrumentedType() { + return "io.reactivex.rxjava3.core.Flowable"; + } + + @Override + public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvice(isConstructor(), getClass().getName() + "$CaptureParentSpanAdvice"); + transformer.applyAdvice( + isMethod() + .and(named("subscribe")) + .and(takesArguments(1)) + .and(takesArgument(0, named("io.reactivex.rxjava3.core.FlowableSubscriber"))), + getClass().getName() + "$PropagateParentSpanAdvice"); + } + + public static class CaptureParentSpanAdvice { + @Advice.OnMethodExit(suppress = Throwable.class) + public static void onConstruct(@Advice.This final Flowable flowable) { + Context parentContext = currentContext(); + if (parentContext != rootContext()) { + InstrumentationContext.get(Flowable.class, Context.class).put(flowable, parentContext); + } + } + } + + public static class PropagateParentSpanAdvice { + @Advice.OnMethodEnter(suppress = Throwable.class) + public static ContextScope onSubscribe( + @Advice.This final Flowable flowable, + @Advice.Argument(value = 0, readOnly = false) FlowableSubscriber subscriber) { + if (subscriber != null) { + Context parentContext = + InstrumentationContext.get(Flowable.class, Context.class).get(flowable); + if (parentContext != null) { + subscriber = new TracingSubscriber<>(subscriber, parentContext); + // attach the context here in case additional subscribers are created during subscribe + return parentContext.attach(); + } + } + return null; + } + + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + public static void closeScope(@Advice.Enter final ContextScope scope) { + if (scope != null) { + scope.close(); + } + } + } +} diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/MaybeInstrumentation.java b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/MaybeInstrumentation.java new file mode 100644 index 00000000000..0bc833922be --- /dev/null +++ b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/MaybeInstrumentation.java @@ -0,0 +1,70 @@ +package datadog.trace.instrumentation.rxjava3; + +import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; +import static net.bytebuddy.matcher.ElementMatchers.isConstructor; +import static net.bytebuddy.matcher.ElementMatchers.isMethod; +import static net.bytebuddy.matcher.ElementMatchers.takesArgument; +import static net.bytebuddy.matcher.ElementMatchers.takesArguments; + +import datadog.context.Context; +import datadog.context.ContextScope; +import datadog.trace.agent.tooling.Instrumenter; +import datadog.trace.bootstrap.InstrumentationContext; +import io.reactivex.rxjava3.core.Maybe; +import io.reactivex.rxjava3.core.MaybeObserver; +import net.bytebuddy.asm.Advice; + +public final class MaybeInstrumentation + implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { + @Override + public String instrumentedType() { + return "io.reactivex.rxjava3.core.Maybe"; + } + + @Override + public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvice(isConstructor(), getClass().getName() + "$CaptureParentSpanAdvice"); + transformer.applyAdvice( + isMethod() + .and(named("subscribe")) + .and(takesArguments(1)) + .and(takesArgument(0, named("io.reactivex.rxjava3.core.MaybeObserver"))), + getClass().getName() + "$PropagateParentSpanAdvice"); + } + + public static class CaptureParentSpanAdvice { + @Advice.OnMethodExit(suppress = Throwable.class) + public static void onConstruct(@Advice.This final Maybe maybe) { + Context parentContext = currentContext(); + if (parentContext != rootContext()) { + InstrumentationContext.get(Maybe.class, Context.class).put(maybe, parentContext); + } + } + } + + public static class PropagateParentSpanAdvice { + @Advice.OnMethodEnter(suppress = Throwable.class) + public static ContextScope onSubscribe( + @Advice.This final Maybe maybe, + @Advice.Argument(value = 0, readOnly = false) MaybeObserver observer) { + if (observer != null) { + Context parentContext = InstrumentationContext.get(Maybe.class, Context.class).get(maybe); + if (parentContext != null) { + observer = new TracingMaybeObserver<>(observer, parentContext); + // attach the context here in case additional observers are created during subscribe + return parentContext.attach(); + } + } + return null; + } + + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + public static void closeScope(@Advice.Enter final ContextScope scope) { + if (scope != null) { + scope.close(); + } + } + } +} diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/ObservableInstrumentation.java b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/ObservableInstrumentation.java new file mode 100644 index 00000000000..304b710aa87 --- /dev/null +++ b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/ObservableInstrumentation.java @@ -0,0 +1,71 @@ +package datadog.trace.instrumentation.rxjava3; + +import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; +import static net.bytebuddy.matcher.ElementMatchers.isConstructor; +import static net.bytebuddy.matcher.ElementMatchers.isMethod; +import static net.bytebuddy.matcher.ElementMatchers.takesArgument; +import static net.bytebuddy.matcher.ElementMatchers.takesArguments; + +import datadog.context.Context; +import datadog.context.ContextScope; +import datadog.trace.agent.tooling.Instrumenter; +import datadog.trace.bootstrap.InstrumentationContext; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.core.Observer; +import net.bytebuddy.asm.Advice; + +public final class ObservableInstrumentation + implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { + @Override + public String instrumentedType() { + return "io.reactivex.rxjava3.core.Observable"; + } + + @Override + public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvice(isConstructor(), getClass().getName() + "$CaptureParentSpanAdvice"); + transformer.applyAdvice( + isMethod() + .and(named("subscribe")) + .and(takesArguments(1)) + .and(takesArgument(0, named("io.reactivex.rxjava3.core.Observer"))), + getClass().getName() + "$PropagateParentSpanAdvice"); + } + + public static class CaptureParentSpanAdvice { + @Advice.OnMethodExit(suppress = Throwable.class) + public static void onConstruct(@Advice.This final Observable observable) { + Context parentContext = currentContext(); + if (parentContext != rootContext()) { + InstrumentationContext.get(Observable.class, Context.class).put(observable, parentContext); + } + } + } + + public static class PropagateParentSpanAdvice { + @Advice.OnMethodEnter(suppress = Throwable.class) + public static ContextScope onSubscribe( + @Advice.This final Observable observable, + @Advice.Argument(value = 0, readOnly = false) Observer observer) { + if (observer != null) { + Context parentContext = + InstrumentationContext.get(Observable.class, Context.class).get(observable); + if (parentContext != null) { + observer = new TracingObserver<>(observer, parentContext); + // attach the context here in case additional observers are created during subscribe + return parentContext.attach(); + } + } + return null; + } + + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + public static void closeScope(@Advice.Enter final ContextScope scope) { + if (scope != null) { + scope.close(); + } + } + } +} diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/RxJavaAsyncResultExtension.java b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/RxJavaAsyncResultExtension.java new file mode 100644 index 00000000000..26ad58cfcf3 --- /dev/null +++ b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/RxJavaAsyncResultExtension.java @@ -0,0 +1,68 @@ +package datadog.trace.instrumentation.rxjava3; + +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.api.EagerHelper; +import datadog.trace.bootstrap.instrumentation.java.concurrent.AsyncResultExtension; +import datadog.trace.bootstrap.instrumentation.java.concurrent.AsyncResultExtensions; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Flowable; +import io.reactivex.rxjava3.core.Maybe; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.core.Single; + +public class RxJavaAsyncResultExtension implements AsyncResultExtension, EagerHelper { + static { + AsyncResultExtensions.register(new RxJavaAsyncResultExtension()); + } + + /** + * Register the extension as an {@link AsyncResultExtension} using static class initialization. + *
      + * It uses an empty static method call to ensure the class loading and the one-time-only static + * class initialization. This will ensure this extension will only be registered once under {@link + * AsyncResultExtensions}. + */ + public static void init() {} + + @Override + public boolean supports(Class result) { + return Completable.class.isAssignableFrom(result) + || Maybe.class.isAssignableFrom(result) + || Single.class.isAssignableFrom(result) + || Observable.class.isAssignableFrom(result) + || Flowable.class.isAssignableFrom(result); + } + + @Override + public Object apply(Object result, AgentSpan span) { + if (result instanceof Completable) { + return ((Completable) result) + .doOnEvent(throwable -> onError(span, throwable)) + .doOnDispose(span::finish); + } else if (result instanceof Maybe) { + return ((Maybe) result) + .doOnEvent((o, throwable) -> onError(span, throwable)) + .doOnDispose(span::finish); + } else if (result instanceof Single) { + return ((Single) result) + .doOnEvent((o, throwable) -> onError(span, throwable)) + .doOnDispose(span::finish); + } else if (result instanceof Observable) { + return ((Observable) result) + .doOnComplete(span::finish) + .doOnError(throwable -> onError(span, throwable)) + .doOnDispose(span::finish); + } else if (result instanceof Flowable) { + return ((Flowable) result) + .doOnComplete(span::finish) + .doOnError(throwable -> onError(span, throwable)) + .doOnCancel(span::finish); + } + return null; + } + + private static void onError(AgentSpan span, Throwable throwable) { + span.addThrowable(throwable); + span.finish(); + } +} diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/RxJavaModule.java b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/RxJavaModule.java new file mode 100644 index 00000000000..69cfb0e833a --- /dev/null +++ b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/RxJavaModule.java @@ -0,0 +1,52 @@ +package datadog.trace.instrumentation.rxjava3; + +import static java.util.Arrays.asList; + +import com.google.auto.service.AutoService; +import datadog.context.Context; +import datadog.trace.agent.tooling.Instrumenter; +import datadog.trace.agent.tooling.InstrumenterModule; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@AutoService(InstrumenterModule.class) +public final class RxJavaModule extends InstrumenterModule.ContextTracking { + public RxJavaModule() { + super("rxjava", "rxjava-3"); + } + + @Override + public String[] helperClassNames() { + return new String[] { + packageName + ".TracingCompletableObserver", + packageName + ".TracingSubscriber", + packageName + ".TracingMaybeObserver", + packageName + ".TracingObserver", + packageName + ".RxJavaAsyncResultExtension", + packageName + ".TracingSingleObserver", + }; + } + + @Override + public Map contextStore() { + String contextClass = Context.class.getName(); + final Map store = new HashMap<>(); + store.put("io.reactivex.rxjava3.core.Flowable", contextClass); + store.put("io.reactivex.rxjava3.core.Completable", contextClass); + store.put("io.reactivex.rxjava3.core.Maybe", contextClass); + store.put("io.reactivex.rxjava3.core.Observable", contextClass); + store.put("io.reactivex.rxjava3.core.Single", contextClass); + return store; + } + + @Override + public List typeInstrumentations() { + return asList( + new CompletableInstrumentation(), + new FlowableInstrumentation(), + new MaybeInstrumentation(), + new ObservableInstrumentation(), + new SingleInstrumentation()); + } +} diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/SingleInstrumentation.java b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/SingleInstrumentation.java new file mode 100644 index 00000000000..3dfc1382da2 --- /dev/null +++ b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/SingleInstrumentation.java @@ -0,0 +1,71 @@ +package datadog.trace.instrumentation.rxjava3; + +import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; +import static net.bytebuddy.matcher.ElementMatchers.isConstructor; +import static net.bytebuddy.matcher.ElementMatchers.isMethod; +import static net.bytebuddy.matcher.ElementMatchers.takesArgument; +import static net.bytebuddy.matcher.ElementMatchers.takesArguments; + +import datadog.context.Context; +import datadog.context.ContextScope; +import datadog.trace.agent.tooling.Instrumenter; +import datadog.trace.bootstrap.InstrumentationContext; +import io.reactivex.rxjava3.core.Single; +import io.reactivex.rxjava3.core.SingleObserver; +import net.bytebuddy.asm.Advice; + +public final class SingleInstrumentation + implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { + + @Override + public String instrumentedType() { + return "io.reactivex.rxjava3.core.Single"; + } + + @Override + public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvice(isConstructor(), getClass().getName() + "$CaptureParentSpanAdvice"); + transformer.applyAdvice( + isMethod() + .and(named("subscribe")) + .and(takesArguments(1)) + .and(takesArgument(0, named("io.reactivex.rxjava3.core.SingleObserver"))), + getClass().getName() + "$PropagateParentSpanAdvice"); + } + + public static class CaptureParentSpanAdvice { + @Advice.OnMethodExit(suppress = Throwable.class) + public static void onConstruct(@Advice.This final Single single) { + Context parentContext = currentContext(); + if (parentContext != rootContext()) { + InstrumentationContext.get(Single.class, Context.class).put(single, parentContext); + } + } + } + + public static class PropagateParentSpanAdvice { + @Advice.OnMethodEnter(suppress = Throwable.class) + public static ContextScope onSubscribe( + @Advice.This final Single single, + @Advice.Argument(value = 0, readOnly = false) SingleObserver observer) { + if (observer != null) { + Context parentContext = InstrumentationContext.get(Single.class, Context.class).get(single); + if (parentContext != null) { + observer = new TracingSingleObserver<>(observer, parentContext); + // attach the context here in case additional observers are created during subscribe + return parentContext.attach(); + } + } + return null; + } + + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + public static void closeScope(@Advice.Enter final ContextScope scope) { + if (scope != null) { + scope.close(); + } + } + } +} diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/TracingCompletableObserver.java b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/TracingCompletableObserver.java new file mode 100644 index 00000000000..8a0dd7254e1 --- /dev/null +++ b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/TracingCompletableObserver.java @@ -0,0 +1,38 @@ +package datadog.trace.instrumentation.rxjava3; + +import datadog.context.Context; +import datadog.context.ContextScope; +import io.reactivex.rxjava3.core.CompletableObserver; +import io.reactivex.rxjava3.disposables.Disposable; +import javax.annotation.Nonnull; + +/** Wrapper that makes sure spans from observer events treat the captured span as their parent. */ +public final class TracingCompletableObserver implements CompletableObserver { + private final CompletableObserver observer; + private final Context parentContext; + + public TracingCompletableObserver( + @Nonnull final CompletableObserver observer, @Nonnull final Context parentContext) { + this.observer = observer; + this.parentContext = parentContext; + } + + @Override + public void onSubscribe(final Disposable d) { + observer.onSubscribe(d); + } + + @Override + public void onError(final Throwable e) { + try (final ContextScope scope = parentContext.attach()) { + observer.onError(e); + } + } + + @Override + public void onComplete() { + try (final ContextScope scope = parentContext.attach()) { + observer.onComplete(); + } + } +} diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/TracingMaybeObserver.java b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/TracingMaybeObserver.java new file mode 100644 index 00000000000..0cbf34c61e4 --- /dev/null +++ b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/TracingMaybeObserver.java @@ -0,0 +1,45 @@ +package datadog.trace.instrumentation.rxjava3; + +import datadog.context.Context; +import datadog.context.ContextScope; +import io.reactivex.rxjava3.core.MaybeObserver; +import io.reactivex.rxjava3.disposables.Disposable; +import javax.annotation.Nonnull; + +/** Wrapper that makes sure spans from observer events treat the captured span as their parent. */ +public final class TracingMaybeObserver implements MaybeObserver { + private final MaybeObserver observer; + private final Context parentContext; + + public TracingMaybeObserver( + @Nonnull final MaybeObserver observer, @Nonnull final Context parentContext) { + this.observer = observer; + this.parentContext = parentContext; + } + + @Override + public void onSubscribe(final Disposable d) { + observer.onSubscribe(d); + } + + @Override + public void onSuccess(final T value) { + try (final ContextScope scope = parentContext.attach()) { + observer.onSuccess(value); + } + } + + @Override + public void onError(final Throwable e) { + try (final ContextScope scope = parentContext.attach()) { + observer.onError(e); + } + } + + @Override + public void onComplete() { + try (final ContextScope scope = parentContext.attach()) { + observer.onComplete(); + } + } +} diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/TracingObserver.java b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/TracingObserver.java new file mode 100644 index 00000000000..50bad4e92a1 --- /dev/null +++ b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/TracingObserver.java @@ -0,0 +1,45 @@ +package datadog.trace.instrumentation.rxjava3; + +import datadog.context.Context; +import datadog.context.ContextScope; +import io.reactivex.rxjava3.core.Observer; +import io.reactivex.rxjava3.disposables.Disposable; +import javax.annotation.Nonnull; + +/** Wrapper that makes sure spans from observer events treat the captured span as their parent. */ +public final class TracingObserver implements Observer { + private final Observer observer; + private final Context parentContext; + + public TracingObserver( + @Nonnull final Observer observer, @Nonnull final Context parentContext) { + this.observer = observer; + this.parentContext = parentContext; + } + + @Override + public void onSubscribe(final Disposable d) { + observer.onSubscribe(d); + } + + @Override + public void onNext(final T value) { + try (final ContextScope scope = parentContext.attach()) { + observer.onNext(value); + } + } + + @Override + public void onError(final Throwable e) { + try (final ContextScope scope = parentContext.attach()) { + observer.onError(e); + } + } + + @Override + public void onComplete() { + try (final ContextScope scope = parentContext.attach()) { + observer.onComplete(); + } + } +} diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/TracingSingleObserver.java b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/TracingSingleObserver.java new file mode 100644 index 00000000000..3e05d1124bc --- /dev/null +++ b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/TracingSingleObserver.java @@ -0,0 +1,38 @@ +package datadog.trace.instrumentation.rxjava3; + +import datadog.context.Context; +import datadog.context.ContextScope; +import io.reactivex.rxjava3.core.SingleObserver; +import io.reactivex.rxjava3.disposables.Disposable; +import javax.annotation.Nonnull; + +/** Wrapper that makes sure spans from observer events treat the captured span as their parent. */ +public final class TracingSingleObserver implements SingleObserver { + private final SingleObserver observer; + private final Context parentContext; + + public TracingSingleObserver( + @Nonnull final SingleObserver observer, @Nonnull final Context parentContext) { + this.observer = observer; + this.parentContext = parentContext; + } + + @Override + public void onSubscribe(final Disposable d) { + observer.onSubscribe(d); + } + + @Override + public void onSuccess(final T value) { + try (final ContextScope scope = parentContext.attach()) { + observer.onSuccess(value); + } + } + + @Override + public void onError(final Throwable e) { + try (final ContextScope scope = parentContext.attach()) { + observer.onError(e); + } + } +} diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/TracingSubscriber.java b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/TracingSubscriber.java new file mode 100644 index 00000000000..49caa0e6ecf --- /dev/null +++ b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/main/java/datadog/trace/instrumentation/rxjava3/TracingSubscriber.java @@ -0,0 +1,45 @@ +package datadog.trace.instrumentation.rxjava3; + +import datadog.context.Context; +import datadog.context.ContextScope; +import io.reactivex.rxjava3.core.FlowableSubscriber; +import javax.annotation.Nonnull; +import org.reactivestreams.Subscription; + +/** Wrapper that makes sure spans from subscriber events treat the captured span as their parent. */ +public final class TracingSubscriber implements FlowableSubscriber { + private final FlowableSubscriber subscriber; + private final Context parentContext; + + public TracingSubscriber( + @Nonnull final FlowableSubscriber subscriber, @Nonnull final Context parentContext) { + this.subscriber = subscriber; + this.parentContext = parentContext; + } + + @Override + public void onSubscribe(final Subscription subscription) { + subscriber.onSubscribe(subscription); + } + + @Override + public void onNext(final T value) { + try (final ContextScope scope = parentContext.attach()) { + subscriber.onNext(value); + } + } + + @Override + public void onError(final Throwable e) { + try (final ContextScope scope = parentContext.attach()) { + subscriber.onError(e); + } + } + + @Override + public void onComplete() { + try (final ContextScope scope = parentContext.attach()) { + subscriber.onComplete(); + } + } +} diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/test/java/annotatedsample/RxJava3TracedMethods.java b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/test/java/annotatedsample/RxJava3TracedMethods.java new file mode 100644 index 00000000000..163f5fb4b69 --- /dev/null +++ b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/test/java/annotatedsample/RxJava3TracedMethods.java @@ -0,0 +1,137 @@ +package annotatedsample; + +import static java.util.concurrent.TimeUnit.SECONDS; + +import io.opentelemetry.instrumentation.annotations.WithSpan; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Flowable; +import io.reactivex.rxjava3.core.Maybe; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.core.Single; +import java.util.concurrent.CountDownLatch; + +public class RxJava3TracedMethods { + @WithSpan + public static Completable traceAsyncCompletable(CountDownLatch latch) { + return Completable.fromRunnable(() -> await(latch)); + } + + @WithSpan + public static Completable traceAsyncFailingCompletable( + CountDownLatch latch, Exception exception) { + return Completable.fromCallable( + () -> { + await(latch); + throw exception; + }); + } + + @WithSpan + public static Maybe traceAsyncMaybe(CountDownLatch latch) { + return Maybe.fromCallable( + () -> { + await(latch); + return "hello"; + }); + } + + @WithSpan + public static Maybe traceAsyncFailingMaybe(CountDownLatch latch, Exception exception) { + return Maybe.fromCallable( + () -> { + await(latch); + throw exception; + }); + } + + @WithSpan + public static Single traceAsyncSingle(CountDownLatch latch) { + return Single.fromCallable( + () -> { + await(latch); + return "hello"; + }); + } + + @WithSpan + public static Single traceAsyncFailingSingle(CountDownLatch latch, Exception exception) { + return Single.fromCallable( + () -> { + await(latch); + throw exception; + }); + } + + @WithSpan + public static Observable traceAsyncObservable(CountDownLatch latch) { + return Observable.fromCallable( + () -> { + await(latch); + return "hello"; + }); + } + + @WithSpan + public static Observable traceAsyncFailingObservable( + CountDownLatch latch, Exception exception) { + return Observable.fromCallable( + () -> { + await(latch); + throw exception; + }); + } + + @WithSpan + public static Flowable traceAsyncFlowable(CountDownLatch latch) { + return Flowable.fromCallable( + () -> { + await(latch); + return "hello"; + }); + } + + @WithSpan + public static Flowable traceAsyncFailingFlowable( + CountDownLatch latch, Exception exception) { + return Flowable.fromCallable( + () -> { + await(latch); + throw exception; + }); + } + + @WithSpan + public static Completable traceAsyncNeverCompletable() { + return Completable.never(); + } + + @WithSpan + public static Maybe traceAsyncNeverMaybe() { + return Maybe.never(); + } + + @WithSpan + public static Single traceAsyncNeverSingle() { + return Single.never(); + } + + @WithSpan + public static Observable traceAsyncNeverObservable() { + return Observable.never(); + } + + @WithSpan + public static Flowable traceAsyncNeverFlowable() { + return Flowable.never(); + } + + private static void await(CountDownLatch latch) { + try { + if (!latch.await(5, SECONDS)) { + throw new IllegalStateException("Latch still locked"); + } + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + } +} diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/test/java/testdog/trace/instrumentation/rxjava3/RxJava3InteropTest.java b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/test/java/testdog/trace/instrumentation/rxjava3/RxJava3InteropTest.java new file mode 100644 index 00000000000..207ca3f6ca1 --- /dev/null +++ b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/test/java/testdog/trace/instrumentation/rxjava3/RxJava3InteropTest.java @@ -0,0 +1,132 @@ +package testdog.trace.instrumentation.rxjava3; + +import static datadog.trace.agent.test.assertions.SpanMatcher.span; +import static datadog.trace.agent.test.assertions.TagsMatcher.defaultTags; +import static datadog.trace.agent.test.assertions.TagsMatcher.tag; +import static datadog.trace.agent.test.assertions.TraceMatcher.SORT_BY_START_TIME; +import static datadog.trace.agent.test.assertions.TraceMatcher.trace; +import static datadog.trace.test.junit.utils.assertions.Matchers.validates; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import datadog.trace.agent.test.AbstractInstrumentationTest; +import datadog.trace.agent.test.assertions.TagsMatcher; +import datadog.trace.api.Trace; +import datadog.trace.bootstrap.instrumentation.api.Tags; +import io.reactivex.rxjava3.core.Flowable; +import io.reactivex.rxjava3.core.Maybe; +import io.reactivex.rxjava3.core.Single; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.CompletableFuture; +import java.util.function.Supplier; +import java.util.stream.Stream; +import org.junit.jupiter.api.Test; + +class RxJava3InteropTest extends AbstractInstrumentationTest { + + // The component tag is stored as a UTF8BytesString, so compare by string content. + static TagsMatcher componentTrace() { + return tag(Tags.COMPONENT, validates(o -> "trace".equals(String.valueOf(o)))); + } + + static class Worker { + static int child(int i) { + return childTraced(i); + } + + @Trace(operationName = "child", resourceName = "child") + static int childTraced(int i) { + return i + 1; + } + + @Trace(operationName = "interop-parent", resourceName = "interop-parent") + static T runUnderParent(Supplier work) { + return work.get(); + } + } + + @Test + void fromCompletionStageSync() { + Integer result = + Worker.runUnderParent( + () -> + Single.fromCompletionStage(CompletableFuture.completedFuture(1)) + .map(Worker::child) + .blockingGet()); + assertEquals(2, result); + + assertTraces( + trace( + SORT_BY_START_TIME, + span().root().operationName("interop-parent").resourceName("interop-parent"), + span() + .childOfIndex(0) + .operationName("child") + .resourceName("child") + .tags(componentTrace(), defaultTags()))); + } + + @Test + void fromCompletionStageAsync() { + Integer result = + Worker.runUnderParent( + () -> + Single.fromCompletionStage(CompletableFuture.supplyAsync(() -> 1)) + .map(Worker::child) + .blockingGet()); + assertEquals(2, result); + + assertTraces( + trace( + SORT_BY_START_TIME, + span().root().operationName("interop-parent").resourceName("interop-parent"), + span() + .childOfIndex(0) + .operationName("child") + .resourceName("child") + .tags(componentTrace(), defaultTags()))); + } + + @Test + void fromOptional() { + Integer result = + Worker.runUnderParent( + () -> Maybe.fromOptional(Optional.of(1)).map(Worker::child).blockingGet()); + assertEquals(2, result); + + assertTraces( + trace( + SORT_BY_START_TIME, + span().root().operationName("interop-parent").resourceName("interop-parent"), + span() + .childOfIndex(0) + .operationName("child") + .resourceName("child") + .tags(componentTrace(), defaultTags()))); + } + + @Test + void fromStream() { + List result = + Worker.runUnderParent( + () -> Flowable.fromStream(Stream.of(1, 2)).map(Worker::child).toList().blockingGet()); + assertEquals(2, result.size()); + assertEquals(2, result.get(0)); + assertEquals(3, result.get(1)); + + assertTraces( + trace( + SORT_BY_START_TIME, + span().root().operationName("interop-parent").resourceName("interop-parent"), + span() + .childOfIndex(0) + .operationName("child") + .resourceName("child") + .tags(componentTrace(), defaultTags()), + span() + .childOfIndex(0) + .operationName("child") + .resourceName("child") + .tags(componentTrace(), defaultTags()))); + } +} diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/test/java/testdog/trace/instrumentation/rxjava3/RxJava3ResultExtensionTest.java b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/test/java/testdog/trace/instrumentation/rxjava3/RxJava3ResultExtensionTest.java new file mode 100644 index 00000000000..500a92c7637 --- /dev/null +++ b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/test/java/testdog/trace/instrumentation/rxjava3/RxJava3ResultExtensionTest.java @@ -0,0 +1,241 @@ +package testdog.trace.instrumentation.rxjava3; + +import static datadog.trace.agent.test.assertions.SpanMatcher.span; +import static datadog.trace.agent.test.assertions.TagsMatcher.defaultTags; +import static datadog.trace.agent.test.assertions.TagsMatcher.error; +import static datadog.trace.agent.test.assertions.TagsMatcher.tag; +import static datadog.trace.agent.test.assertions.TraceMatcher.trace; +import static datadog.trace.test.junit.utils.assertions.Matchers.validates; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import annotatedsample.RxJava3TracedMethods; +import datadog.trace.agent.test.AbstractInstrumentationTest; +import datadog.trace.agent.test.assertions.SpanMatcher; +import datadog.trace.agent.test.assertions.TagsMatcher; +import datadog.trace.bootstrap.instrumentation.api.Tags; +import datadog.trace.test.junit.utils.config.WithConfig; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Flowable; +import io.reactivex.rxjava3.core.Maybe; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.core.Single; +import java.util.concurrent.CountDownLatch; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.EnumSource; + +@WithConfig(key = "trace.otel.enabled", value = "true") +class RxJava3ResultExtensionTest extends AbstractInstrumentationTest { + + static final String EXCEPTION_MESSAGE = "Test exception"; + + // The COMPONENT and SPAN_KIND tags are stored as UTF8BytesString, so we compare by string content + // rather than using is("...") which would fail the asymmetric String#equals(UTF8BytesString) + // check. + static TagsMatcher otelComponent() { + return tag(Tags.COMPONENT, validates(o -> "opentelemetry".equals(String.valueOf(o)))); + } + + static TagsMatcher internalSpanKind() { + return tag(Tags.SPAN_KIND, validates(o -> Tags.SPAN_KIND_INTERNAL.equals(String.valueOf(o)))); + } + + // The operation and resource names are stored as UTF8BytesString, so we compare by string content + // (CharSequence equality is asymmetric: String#equals(UTF8BytesString) is false). + static SpanMatcher otelSpan(String name) { + return span() + .operationName(java.util.regex.Pattern.compile(java.util.regex.Pattern.quote(name))) + .resourceName((CharSequence cs) -> name.contentEquals(cs)); + } + + /** + * The five reactive types exercised by the test, with their type-specific terminal operations. + */ + enum ReactiveType { + COMPLETABLE("Completable"), + MAYBE("Maybe"), + SINGLE("Single"), + OBSERVABLE("Observable"), + FLOWABLE("Flowable"); + + final String type; + + ReactiveType(String type) { + this.type = type; + } + + /** Runs the blocking terminal operation that drives the async result to completion. */ + void runTerminal(Object asyncType) { + switch (this) { + case COMPLETABLE: + ((Completable) asyncType).blockingAwait(); + break; + case MAYBE: + ((Maybe) asyncType).blockingGet(); + break; + case SINGLE: + ((Single) asyncType).blockingGet(); + break; + case OBSERVABLE: + ((Observable) asyncType).blockingLast(); + break; + case FLOWABLE: + ((Flowable) asyncType).blockingLast(); + break; + default: + throw new IllegalStateException("Unknown type: " + this); + } + } + + /** Subscribes and immediately disposes (cancels) the async result. */ + void subscribeAndDispose(Object asyncType) { + switch (this) { + case COMPLETABLE: + ((Completable) asyncType).subscribe().dispose(); + break; + case MAYBE: + ((Maybe) asyncType).subscribe().dispose(); + break; + case SINGLE: + ((Single) asyncType).subscribe().dispose(); + break; + case OBSERVABLE: + ((Observable) asyncType).subscribe().dispose(); + break; + case FLOWABLE: + ((Flowable) asyncType).subscribe().dispose(); + break; + default: + throw new IllegalStateException("Unknown type: " + this); + } + } + + Object traceAsync(CountDownLatch latch) { + switch (this) { + case COMPLETABLE: + return RxJava3TracedMethods.traceAsyncCompletable(latch); + case MAYBE: + return RxJava3TracedMethods.traceAsyncMaybe(latch); + case SINGLE: + return RxJava3TracedMethods.traceAsyncSingle(latch); + case OBSERVABLE: + return RxJava3TracedMethods.traceAsyncObservable(latch); + case FLOWABLE: + return RxJava3TracedMethods.traceAsyncFlowable(latch); + default: + throw new IllegalStateException("Unknown type: " + this); + } + } + + Object traceAsyncNever() { + switch (this) { + case COMPLETABLE: + return RxJava3TracedMethods.traceAsyncNeverCompletable(); + case MAYBE: + return RxJava3TracedMethods.traceAsyncNeverMaybe(); + case SINGLE: + return RxJava3TracedMethods.traceAsyncNeverSingle(); + case OBSERVABLE: + return RxJava3TracedMethods.traceAsyncNeverObservable(); + case FLOWABLE: + return RxJava3TracedMethods.traceAsyncNeverFlowable(); + default: + throw new IllegalStateException("Unknown type: " + this); + } + } + + Object traceAsyncFailing(CountDownLatch latch, Exception exception) { + switch (this) { + case COMPLETABLE: + return RxJava3TracedMethods.traceAsyncFailingCompletable(latch, exception); + case MAYBE: + return RxJava3TracedMethods.traceAsyncFailingMaybe(latch, exception); + case SINGLE: + return RxJava3TracedMethods.traceAsyncFailingSingle(latch, exception); + case OBSERVABLE: + return RxJava3TracedMethods.traceAsyncFailingObservable(latch, exception); + case FLOWABLE: + return RxJava3TracedMethods.traceAsyncFailingFlowable(latch, exception); + default: + throw new IllegalStateException("Unknown type: " + this); + } + } + } + + @ParameterizedTest(name = "test WithSpan annotated async method {0}") + @EnumSource(ReactiveType.class) + void success(ReactiveType type) { + CountDownLatch latch = new CountDownLatch(1); + Object asyncType = type.traceAsync(latch); + + // The span must not be finished before the async result completes. + assertEquals(0, writer.size()); + + latch.countDown(); + type.runTerminal(asyncType); + + String method = "traceAsync" + type.type; + assertTraces( + trace( + otelSpan("RxJava3TracedMethods." + method) + .tags(defaultTags(), otelComponent(), internalSpanKind()))); + } + + @ParameterizedTest(name = "test WithSpan annotated async method failing {0}") + @EnumSource(ReactiveType.class) + void failing(ReactiveType type) { + CountDownLatch latch = new CountDownLatch(1); + IllegalStateException expectedException = new IllegalStateException(EXCEPTION_MESSAGE); + Object asyncType = type.traceAsyncFailing(latch, expectedException); + + assertEquals(0, writer.size()); + + latch.countDown(); + assertThrows(IllegalStateException.class, () -> type.runTerminal(asyncType)); + + String method = "traceAsyncFailing" + type.type; + assertTraces( + trace( + otelSpan("RxJava3TracedMethods." + method) + .error() + .tags( + defaultTags(), + otelComponent(), + internalSpanKind(), + error(IllegalStateException.class, EXCEPTION_MESSAGE)))); + } + + @ParameterizedTest(name = "test WithSpan annotated async method cancelled {0}") + @EnumSource(ReactiveType.class) + void cancelled(ReactiveType type) { + CountDownLatch latch = new CountDownLatch(1); + Object asyncType = type.traceAsync(latch); + + assertEquals(0, writer.size()); + + latch.countDown(); + type.subscribeAndDispose(asyncType); + + String method = "traceAsync" + type.type; + assertTraces( + trace( + otelSpan("RxJava3TracedMethods." + method) + .tags(defaultTags(), otelComponent(), internalSpanKind()))); + } + + @ParameterizedTest(name = "test WithSpan annotated never async method cancelled {0}") + @EnumSource(ReactiveType.class) + void cancelledNever(ReactiveType type) { + Object asyncType = type.traceAsyncNever(); + + assertEquals(0, writer.size()); + + type.subscribeAndDispose(asyncType); + + String method = "traceAsyncNever" + type.type; + assertTraces( + trace( + otelSpan("RxJava3TracedMethods." + method) + .tags(defaultTags(), otelComponent(), internalSpanKind()))); + } +} diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/test/java/testdog/trace/instrumentation/rxjava3/RxJava3Test.java b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/test/java/testdog/trace/instrumentation/rxjava3/RxJava3Test.java new file mode 100644 index 00000000000..092156d84ee --- /dev/null +++ b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/test/java/testdog/trace/instrumentation/rxjava3/RxJava3Test.java @@ -0,0 +1,657 @@ +package testdog.trace.instrumentation.rxjava3; + +import static datadog.trace.agent.test.assertions.SpanMatcher.span; +import static datadog.trace.agent.test.assertions.TagsMatcher.defaultTags; +import static datadog.trace.agent.test.assertions.TagsMatcher.error; +import static datadog.trace.agent.test.assertions.TagsMatcher.tag; +import static datadog.trace.agent.test.assertions.TraceMatcher.SORT_BY_START_TIME; +import static datadog.trace.agent.test.assertions.TraceMatcher.trace; +import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; +import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; +import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; +import static datadog.trace.test.junit.utils.assertions.Matchers.validates; +import static java.util.concurrent.TimeUnit.MILLISECONDS; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import datadog.trace.agent.test.AbstractInstrumentationTest; +import datadog.trace.agent.test.assertions.SpanMatcher; +import datadog.trace.agent.test.assertions.TagsMatcher; +import datadog.trace.api.Trace; +import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.api.Tags; +import io.reactivex.rxjava3.core.BackpressureStrategy; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Flowable; +import io.reactivex.rxjava3.core.Maybe; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.core.Scheduler; +import io.reactivex.rxjava3.core.Single; +import io.reactivex.rxjava3.schedulers.Schedulers; +import java.util.Arrays; +import java.util.List; +import java.util.function.Supplier; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import org.reactivestreams.Subscriber; +import org.reactivestreams.Subscription; + +class RxJava3Test extends AbstractInstrumentationTest { + + static final String EXCEPTION_MESSAGE = "test exception"; + + // The component tag is stored as a UTF8BytesString, so we compare by string content rather than + // using is("trace") which would fail the asymmetric String#equals(UTF8BytesString) check. + static TagsMatcher componentTrace() { + return tag(Tags.COMPONENT, validates(o -> "trace".equals(String.valueOf(o)))); + } + + static class Worker { + static long traceParentId; + static long publisherParentId; + static long intermediateId; + + static int addOne(int i) { + return addOneTraced(i); + } + + @Trace(operationName = "addOne", resourceName = "addOne") + static int addOneTraced(int i) { + return i + 1; + } + + static int addTwo(int i) { + return addTwoTraced(i); + } + + @Trace(operationName = "addTwo", resourceName = "addTwo") + static int addTwoTraced(int i) { + return i + 2; + } + + static Object throwException() { + throw new RuntimeException(EXCEPTION_MESSAGE); + } + + @Trace(operationName = "trace-parent", resourceName = "trace-parent") + @SuppressWarnings("unchecked") + static Object assemblePublisherUnderTrace(Supplier publisherSupplier) { + traceParentId = activeSpan().getSpanId(); + AgentSpan span = startSpan("test", "publisher-parent"); + publisherParentId = span.getSpanId(); + AgentScope scope = activateSpan(span); + + Object publisher = publisherSupplier.get(); + try { + if (publisher instanceof Maybe) { + return ((Maybe) publisher).blockingGet(); + } else if (publisher instanceof Flowable) { + List list = ((Flowable) publisher).toList().blockingGet(); + return list.toArray(new Object[0]); + } + throw new RuntimeException("Unknown publisher: " + publisher); + } finally { + scope.close(); + span.finish(); + } + } + + @Trace(operationName = "trace-parent", resourceName = "trace-parent") + static void cancelUnderTrace(Supplier publisherSupplier) { + traceParentId = activeSpan().getSpanId(); + AgentSpan span = startSpan("test", "publisher-parent"); + publisherParentId = span.getSpanId(); + AgentScope scope = activateSpan(span); + + // Normalize every reactive type to a Flowable so a single Subscriber can cancel the + // subscription right away, exercising the cancellation path of each instrumentation. + Object publisher = publisherSupplier.get(); + Flowable flowable; + if (publisher instanceof Maybe) { + flowable = ((Maybe) publisher).toFlowable(); + } else if (publisher instanceof Single) { + flowable = ((Single) publisher).toFlowable(); + } else if (publisher instanceof Observable) { + flowable = ((Observable) publisher).toFlowable(BackpressureStrategy.BUFFER); + } else if (publisher instanceof Completable) { + flowable = ((Completable) publisher).toFlowable(); + } else { + flowable = (Flowable) publisher; + } + + try { + flowable.subscribe( + new Subscriber() { + @Override + public void onSubscribe(Subscription subscription) { + subscription.cancel(); + } + + @Override + public void onNext(Object t) {} + + @Override + public void onError(Throwable error) {} + + @Override + public void onComplete() {} + }); + } finally { + scope.close(); + span.finish(); + } + } + + @Trace(operationName = "trace-parent", resourceName = "trace-parent") + static Object runUnderTraceParent(Supplier work) { + traceParentId = activeSpan().getSpanId(); + return work.get(); + } + } + + // --- Publisher success --------------------------------------------------- + + static List publisherSuccessArgs() { + return Arrays.asList( + Arguments.of( + "basic maybe", + new Object[] {2}, + 1, + (Supplier) () -> Maybe.just(1).map(Worker::addOne)), + Arguments.of( + "two operations maybe", + new Object[] {4}, + 2, + (Supplier) () -> Maybe.just(2).map(Worker::addOne).map(Worker::addOne)), + Arguments.of( + "delayed maybe", + new Object[] {4}, + 1, + (Supplier) () -> Maybe.just(3).delay(100, MILLISECONDS).map(Worker::addOne)), + Arguments.of( + "delayed twice maybe", + new Object[] {6}, + 2, + (Supplier) + () -> + Maybe.just(4) + .delay(100, MILLISECONDS) + .map(Worker::addOne) + .delay(100, MILLISECONDS) + .map(Worker::addOne)), + Arguments.of( + "basic flowable", + new Object[] {6, 7}, + 2, + (Supplier) + () -> Flowable.fromIterable(Arrays.asList(5, 6)).map(Worker::addOne)), + Arguments.of( + "two operations flowable", + new Object[] {8, 9}, + 4, + (Supplier) + () -> + Flowable.fromIterable(Arrays.asList(6, 7)) + .map(Worker::addOne) + .map(Worker::addOne)), + Arguments.of( + "delayed flowable", + new Object[] {8, 9}, + 2, + (Supplier) + () -> + Flowable.fromIterable(Arrays.asList(7, 8)) + .delay(100, MILLISECONDS) + .map(Worker::addOne)), + Arguments.of( + "delayed twice flowable", + new Object[] {10, 11}, + 4, + (Supplier) + () -> + Flowable.fromIterable(Arrays.asList(8, 9)) + .delay(100, MILLISECONDS) + .map(Worker::addOne) + .delay(100, MILLISECONDS) + .map(Worker::addOne)), + Arguments.of( + "maybe from callable", + new Object[] {12}, + 2, + (Supplier) + () -> Maybe.fromCallable(() -> Worker.addOne(10)).map(Worker::addOne))); + } + + @ParameterizedTest(name = "Publisher ''{0}'' test") + @MethodSource("publisherSuccessArgs") + void publisherSuccess(String name, Object[] expected, int workSpans, Supplier supplier) { + Object result = Worker.assemblePublisherUnderTrace(supplier); + + if (expected.length == 1) { + assertEquals(expected[0], result); + } else { + assertArrayEquals(expected, (Object[]) result); + } + + SpanMatcher[] matchers = new SpanMatcher[workSpans + 2]; + matchers[0] = + span() + .root() + .operationName("trace-parent") + .resourceName("trace-parent") + .tags(componentTrace(), defaultTags()); + matchers[1] = + span() + .id(Worker.publisherParentId) + .childOf(Worker.traceParentId) + .operationName("publisher-parent") + .resourceName("publisher-parent") + .tags(defaultTags()); + for (int i = 0; i < workSpans; i++) { + matchers[2 + i] = + span() + .childOf(Worker.publisherParentId) + .operationName("addOne") + .resourceName("addOne") + .tags(componentTrace(), defaultTags()); + } + + assertTraces(trace(SORT_BY_START_TIME, matchers)); + } + + // --- Publisher error ----------------------------------------------------- + + static List publisherErrorArgs() { + return Arrays.asList( + Arguments.of( + "maybe", (Supplier) () -> Maybe.error(new RuntimeException(EXCEPTION_MESSAGE))), + Arguments.of( + "flowable", + (Supplier) () -> Flowable.error(new RuntimeException(EXCEPTION_MESSAGE)))); + } + + @ParameterizedTest(name = "Publisher error ''{0}'' test") + @MethodSource("publisherErrorArgs") + void publisherError(String name, Supplier supplier) { + RuntimeException exception = + assertThrows(RuntimeException.class, () -> Worker.assemblePublisherUnderTrace(supplier)); + assertEquals(EXCEPTION_MESSAGE, exception.getMessage()); + + assertTraces( + trace( + SORT_BY_START_TIME, + span() + .root() + .operationName("trace-parent") + .resourceName("trace-parent") + .error() + .tags( + componentTrace(), + error(RuntimeException.class, EXCEPTION_MESSAGE), + defaultTags()), + // It's important that we don't attach errors at the reactive level so that we don't + // impact the spans on reactive integrations such as netty and lettuce. + span() + .id(Worker.publisherParentId) + .childOf(Worker.traceParentId) + .operationName("publisher-parent") + .resourceName("publisher-parent") + .tags(defaultTags()))); + } + + // --- Publisher step error ------------------------------------------------ + + static List publisherStepErrorArgs() { + return Arrays.asList( + Arguments.of( + "basic maybe failure", + 1, + (Supplier) + () -> Maybe.just(1).map(Worker::addOne).map(i -> Worker.throwException())), + Arguments.of( + "basic flowable failure", + 1, + (Supplier) + () -> + Flowable.fromIterable(Arrays.asList(5, 6)) + .map(Worker::addOne) + .map(i -> Worker.throwException()))); + } + + @ParameterizedTest(name = "Publisher step ''{0}'' test") + @MethodSource("publisherStepErrorArgs") + void publisherStepError(String name, int workSpans, Supplier supplier) { + RuntimeException exception = + assertThrows(RuntimeException.class, () -> Worker.assemblePublisherUnderTrace(supplier)); + assertEquals(EXCEPTION_MESSAGE, exception.getMessage()); + + SpanMatcher[] matchers = new SpanMatcher[workSpans + 2]; + matchers[0] = + span() + .root() + .operationName("trace-parent") + .resourceName("trace-parent") + .error() + .tags( + componentTrace(), error(RuntimeException.class, EXCEPTION_MESSAGE), defaultTags()); + matchers[1] = + span() + .id(Worker.publisherParentId) + .childOf(Worker.traceParentId) + .operationName("publisher-parent") + .resourceName("publisher-parent") + .tags(defaultTags()); + for (int i = 0; i < workSpans; i++) { + matchers[2 + i] = + span() + .childOf(Worker.publisherParentId) + .operationName("addOne") + .resourceName("addOne") + .tags(componentTrace(), defaultTags()); + } + + assertTraces(trace(SORT_BY_START_TIME, matchers)); + } + + // --- Cancel -------------------------------------------------------------- + + static List cancelArgs() { + return Arrays.asList( + Arguments.of("basic maybe", (Supplier) () -> Maybe.just(1)), + Arguments.of( + "basic flowable", (Supplier) () -> Flowable.fromIterable(Arrays.asList(5, 6))), + Arguments.of("basic single", (Supplier) () -> Single.just(1)), + Arguments.of( + "basic observable", + (Supplier) () -> Observable.fromIterable(Arrays.asList(5, 6))), + Arguments.of("basic completable", (Supplier) Completable::complete)); + } + + @ParameterizedTest(name = "Publisher ''{0}'' cancel") + @MethodSource("cancelArgs") + void cancel(String name, Supplier supplier) { + Worker.cancelUnderTrace(supplier); + + assertTraces( + trace( + SORT_BY_START_TIME, + span() + .root() + .operationName("trace-parent") + .resourceName("trace-parent") + .tags(componentTrace(), defaultTags()), + span() + .id(Worker.publisherParentId) + .childOf(Worker.traceParentId) + .operationName("publisher-parent") + .resourceName("publisher-parent") + .tags(defaultTags()))); + } + + // --- Chain spans correct parent ------------------------------------------ + + static List chainParentArgs() { + return Arrays.asList( + Arguments.of( + "basic maybe", + 3, + (Supplier) + () -> + Maybe.just(1) + .map(Worker::addOne) + .map(Worker::addOne) + .concatWith(Maybe.just(1).map(Worker::addOne))), + Arguments.of( + "basic flowable", + 5, + (Supplier) + () -> + Flowable.fromIterable(Arrays.asList(5, 6)) + .map(Worker::addOne) + .map(Worker::addOne) + .concatWith(Maybe.just(1).map(Worker::addOne).toFlowable()))); + } + + @ParameterizedTest(name = "Publisher chain spans have the correct parent for ''{0}''") + @MethodSource("chainParentArgs") + void chainParent(String name, int workSpans, Supplier supplier) { + Worker.assemblePublisherUnderTrace(supplier); + + SpanMatcher[] matchers = new SpanMatcher[workSpans + 2]; + matchers[0] = + span() + .root() + .operationName("trace-parent") + .resourceName("trace-parent") + .tags(componentTrace(), defaultTags()); + matchers[1] = + span() + .id(Worker.publisherParentId) + .childOf(Worker.traceParentId) + .operationName("publisher-parent") + .resourceName("publisher-parent") + .tags(defaultTags()); + for (int i = 0; i < workSpans; i++) { + matchers[2 + i] = + span() + .childOf(Worker.publisherParentId) + .operationName("addOne") + .resourceName("addOne") + .tags(componentTrace(), defaultTags()); + } + + assertTraces(trace(SORT_BY_START_TIME, matchers)); + } + + // --- Correct parents from subscription time (blockingGet) ---------------- + + @Test + void correctParentsFromSubscriptionTimeBlockingGet() { + Maybe maybe = Maybe.just(42).map(Worker::addOne).map(Worker::addTwo); + + Worker.runUnderTraceParent( + () -> { + maybe.blockingGet(); + return null; + }); + + assertTraces( + trace( + SORT_BY_START_TIME, + span().root().operationName("trace-parent").resourceName("trace-parent"), + span() + .childOf(Worker.traceParentId) + .operationName("addOne") + .tags(componentTrace(), defaultTags()), + span() + .childOf(Worker.traceParentId) + .operationName("addTwo") + .tags(componentTrace(), defaultTags()))); + } + + // --- Correct parents from subscription time (intermediate span) ---------- + + static List subscriptionTimeIntermediateArgs() { + return Arrays.asList( + Arguments.of("basic maybe", 1, (Supplier) () -> Maybe.just(1).map(Worker::addOne)), + Arguments.of( + "basic flowable", + 2, + (Supplier) + () -> Flowable.fromIterable(Arrays.asList(1, 2)).map(Worker::addOne))); + } + + @ParameterizedTest( + name = "Publisher chain spans have the correct parents from subscription time ''{0}''") + @MethodSource("subscriptionTimeIntermediateArgs") + @SuppressWarnings("unchecked") + void correctParentsFromSubscriptionTime(String name, int workItems, Supplier supplier) { + Worker.assemblePublisherUnderTrace( + () -> { + // The "add one" operations are assembled under publisher-parent and stay its children. + // The "add two" operations are assembled under intermediate, but intermediate is finished + // before subscription, so re-activating its context at delivery time is a no-op and + // addTwo falls back to the still-active publisher-parent as well. + Object publisher = supplier.get(); + + AgentSpan intermediate = startSpan("test", "intermediate"); + Worker.intermediateId = intermediate.getSpanId(); + AgentScope scope = activateSpan(intermediate); + try { + if (publisher instanceof Maybe) { + return ((Maybe) publisher).map(Worker::addTwo); + } else if (publisher instanceof Flowable) { + return ((Flowable) publisher).map(Worker::addTwo); + } + throw new IllegalStateException("Unknown publisher type"); + } finally { + scope.close(); + intermediate.finish(); + } + }); + + SpanMatcher[] matchers = new SpanMatcher[3 + 2 * workItems]; + matchers[0] = + span() + .root() + .operationName("trace-parent") + .resourceName("trace-parent") + .tags(componentTrace(), defaultTags()); + matchers[1] = + span() + .id(Worker.publisherParentId) + .childOf(Worker.traceParentId) + .operationName("publisher-parent") + .resourceName("publisher-parent") + .tags(defaultTags()); + matchers[2] = + span() + .id(Worker.intermediateId) + .childOf(Worker.publisherParentId) + .operationName("intermediate") + .resourceName("intermediate") + .tags(defaultTags()); + for (int i = 0; i < 2 * workItems; i += 2) { + matchers[3 + i] = + span() + .childOf(Worker.publisherParentId) + .operationName("addOne") + .tags(componentTrace(), defaultTags()); + matchers[4 + i] = + span() + .childOf(Worker.publisherParentId) + .operationName("addTwo") + .tags(componentTrace(), defaultTags()); + } + + assertTraces(trace(SORT_BY_START_TIME, matchers)); + } + + // --- Schedulers ---------------------------------------------------------- + + static List schedulerArgs() { + return Arrays.asList( + Arguments.of("new-thread", Schedulers.newThread()), + Arguments.of("computation", Schedulers.computation()), + Arguments.of("single", Schedulers.single()), + Arguments.of("trampoline", Schedulers.trampoline())); + } + + @ParameterizedTest(name = "Flowables produce the right number of results on ''{0}'' scheduler") + @MethodSource("schedulerArgs") + void schedulers(String schedulerName, Scheduler scheduler) { + List values = + Flowable.fromIterable(Arrays.asList(1, 2, 3, 4)) + .parallel() + .runOn(scheduler) + .flatMap( + num -> + Maybe.just(num.toString() + " on " + Thread.currentThread().getName()) + .toFlowable()) + .sequential() + .toList() + .blockingGet(); + + assertEquals(4, values.size()); + + // No trace-parent span is active while the chain is assembled, so the instrumentation must be + // non-intrusive: parallel scheduler hops must not synthesize any trace. Flushing makes sure + // any span that the instrumentation might have wrongly created on the scheduler threads is + // reported before we assert the writer is empty. + tracer.flush(); + assertEquals( + 0, + writer.getTraceCount(), + () -> "Unexpected traces emitted without active trace: " + writer); + } + + @ParameterizedTest(name = "Flowable propagates context on ''{0}'' scheduler") + @MethodSource("schedulerArgs") + void flowableParallelContextPropagation(String schedulerName, Scheduler scheduler) { + Worker.assemblePublisherUnderTrace( + () -> + Flowable.fromIterable(Arrays.asList(1, 2, 3, 4)) + .parallel() + .runOn(scheduler) + .flatMap(num -> Maybe.just(num).map(Worker::addOne).toFlowable()) + .sequential()); + + SpanMatcher[] matchers = new SpanMatcher[6]; + matchers[0] = + span() + .root() + .operationName("trace-parent") + .resourceName("trace-parent") + .tags(componentTrace(), defaultTags()); + matchers[1] = + span() + .id(Worker.publisherParentId) + .childOf(Worker.traceParentId) + .operationName("publisher-parent") + .resourceName("publisher-parent") + .tags(defaultTags()); + for (int i = 0; i < 4; i++) { + matchers[2 + i] = + span() + .childOf(Worker.publisherParentId) + .operationName("addOne") + .resourceName("addOne") + .tags(componentTrace(), defaultTags()); + } + + assertTraces(trace(SORT_BY_START_TIME, matchers)); + } + + // --- No spurious traces outside active trace -------------------------------- + + // Verifies that CaptureParentSpanAdvice and PropagateParentSpanAdvice are no-ops when there is + // no active trace: the instrumentation must not synthesize any spans of its own. + static List noSpuriousTracesArgs() { + return Arrays.asList( + Arguments.of( + "observable", + (Supplier) + () -> + Observable.fromIterable(Arrays.asList(1, 2, 3, 4)) + .map(i -> i + 1) + .toList() + .blockingGet()), + Arguments.of( + "single", (Supplier) () -> Single.just(1).map(i -> i + 1).blockingGet())); + } + + @ParameterizedTest(name = "No spurious traces for ''{0}'' assembled outside active trace") + @MethodSource("noSpuriousTracesArgs") + void noSpuriousTracesWhenAssembledOutsideTrace(String name, Supplier supplier) { + supplier.get(); + tracer.flush(); + assertEquals( + 0, + writer.getTraceCount(), + () -> "Unexpected traces emitted without active trace: " + writer); + } +} diff --git a/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/test/java/testdog/trace/instrumentation/rxjava3/SubscriptionTest.java b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/test/java/testdog/trace/instrumentation/rxjava3/SubscriptionTest.java new file mode 100644 index 00000000000..d2f76d17a9b --- /dev/null +++ b/dd-java-agent/instrumentation/rxjava/rxjava-3.0/src/test/java/testdog/trace/instrumentation/rxjava3/SubscriptionTest.java @@ -0,0 +1,162 @@ +package testdog.trace.instrumentation.rxjava3; + +import static datadog.trace.agent.test.assertions.SpanMatcher.span; +import static datadog.trace.agent.test.assertions.TraceMatcher.SORT_BY_START_TIME; +import static datadog.trace.agent.test.assertions.TraceMatcher.trace; +import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; +import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; + +import datadog.trace.agent.test.AbstractInstrumentationTest; +import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import io.reactivex.rxjava3.core.BackpressureStrategy; +import io.reactivex.rxjava3.core.Completable; +import io.reactivex.rxjava3.core.Flowable; +import io.reactivex.rxjava3.core.Maybe; +import io.reactivex.rxjava3.core.Observable; +import io.reactivex.rxjava3.core.Single; +import java.util.Random; +import java.util.concurrent.CountDownLatch; +import org.junit.jupiter.api.Test; + +class SubscriptionTest extends AbstractInstrumentationTest { + + @Test + void maybeSubscriptionPropagatesParentSpan() throws InterruptedException { + CountDownLatch latch = new CountDownLatch(1); + + AgentSpan parent = startSpan("test", "parent"); + try (AgentScope scope = activateSpan(parent)) { + Maybe connection = Maybe.create(emitter -> emitter.onSuccess(new Connection())); + connection.subscribe( + c -> { + c.query(); + latch.countDown(); + }); + } finally { + parent.finish(); + } + latch.await(); + + assertTraces( + trace( + SORT_BY_START_TIME, + span().root().operationName("parent"), + span().childOfPrevious().operationName("Connection.query"))); + } + + @Test + void singleSubscriptionPropagatesParentSpan() throws InterruptedException { + CountDownLatch latch = new CountDownLatch(1); + + AgentSpan parent = startSpan("test", "parent"); + try (AgentScope scope = activateSpan(parent)) { + Single connection = Single.create(emitter -> emitter.onSuccess(new Connection())); + connection.subscribe( + c -> { + c.query(); + latch.countDown(); + }); + } finally { + parent.finish(); + } + latch.await(); + + assertTraces( + trace( + SORT_BY_START_TIME, + span().root().operationName("parent"), + span().childOfPrevious().operationName("Connection.query"))); + } + + @Test + void completableSubscriptionPropagatesParentSpan() throws InterruptedException { + CountDownLatch latch = new CountDownLatch(1); + + AgentSpan parent = startSpan("test", "parent"); + try (AgentScope scope = activateSpan(parent)) { + Completable action = Completable.create(emitter -> emitter.onComplete()); + action.subscribe( + () -> { + new Connection().query(); + latch.countDown(); + }); + } finally { + parent.finish(); + } + latch.await(); + + assertTraces( + trace( + SORT_BY_START_TIME, + span().root().operationName("parent"), + span().childOfPrevious().operationName("Connection.query"))); + } + + @Test + void observableSubscriptionPropagatesParentSpan() throws InterruptedException { + CountDownLatch latch = new CountDownLatch(1); + + AgentSpan parent = startSpan("test", "parent"); + try (AgentScope scope = activateSpan(parent)) { + Observable connection = + Observable.create( + emitter -> { + emitter.onNext(new Connection()); + emitter.onComplete(); + }); + connection.subscribe( + c -> { + c.query(); + latch.countDown(); + }); + } finally { + parent.finish(); + } + latch.await(); + + assertTraces( + trace( + SORT_BY_START_TIME, + span().root().operationName("parent"), + span().childOfPrevious().operationName("Connection.query"))); + } + + @Test + void flowableSubscriptionPropagatesParentSpan() throws InterruptedException { + CountDownLatch latch = new CountDownLatch(1); + + AgentSpan parent = startSpan("test", "parent"); + try (AgentScope scope = activateSpan(parent)) { + Flowable connection = + Flowable.create( + emitter -> { + emitter.onNext(new Connection()); + emitter.onComplete(); + }, + BackpressureStrategy.BUFFER); + connection.subscribe( + c -> { + c.query(); + latch.countDown(); + }); + } finally { + parent.finish(); + } + latch.await(); + + assertTraces( + trace( + SORT_BY_START_TIME, + span().root().operationName("parent"), + span().childOfPrevious().operationName("Connection.query"))); + } + + static class Connection { + int query() { + AgentSpan span = startSpan("test", "Connection.query"); + span.finish(); + return new Random().nextInt(); + } + } +} diff --git a/dd-java-agent/instrumentation/scala/scala-2.10.7/build.gradle b/dd-java-agent/instrumentation/scala/scala-2.10.7/build.gradle index 970172cc5ad..498efc5814a 100644 --- a/dd-java-agent/instrumentation/scala/scala-2.10.7/build.gradle +++ b/dd-java-agent/instrumentation/scala/scala-2.10.7/build.gradle @@ -68,7 +68,9 @@ final testTasks = scalaVersions.collect { scalaLibrary -> } return tasks.register("test$version", Test) { - classpath = classpath + testClassesDirs = sourceSets.test.output.classesDirs + .minus(files(sourceSets.test.scala.classesDirectory)) + classpath = sourceSets.test.runtimeClasspath .filter { !it.toString().contains('scala-library') } // exclude default scala-library .minus(files(sourceSets.test.scala.classesDirectory)) // exclude default /build/classes/scala/test folder .plus(customSourceSet.output.classesDirs) // add /build/classes/scala/${version} folder @@ -83,4 +85,3 @@ tasks.named('test', Test) { systemProperty('uses.java.concat', false) // version 2.10.7 does not use java concatenation finalizedBy(testTasks) } - diff --git a/dd-java-agent/instrumentation/scala/scala-2.10.7/gradle.lockfile b/dd-java-agent/instrumentation/scala/scala-2.10.7/gradle.lockfile index 83e9bfee3c4..d5c96eae7b4 100644 --- a/dd-java-agent/instrumentation/scala/scala-2.10.7/gradle.lockfile +++ b/dd-java-agent/instrumentation/scala/scala-2.10.7/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:scala:scala-2.10.7:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=2_12_18RuntimeClasspath,2_13_11RuntimeClasspath,3_3_0RuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=2_12_18RuntimeClasspath,2_13_11RuntimeClasspath,3_3_0RuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=2_12_18RuntimeClasspath,2_13_11RuntimeClasspath,3_3_0RuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=2_12_18RuntimeClasspath,2_13_11RuntimeClasspath,3_3_0RuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -17,15 +18,15 @@ com.eed3si9n:shaded-scalajson_2.13:1.0.0-M4=zinc com.eed3si9n:sjson-new-core_2.13:0.10.1=zinc com.eed3si9n:sjson-new-scalajson_2.13:0.10.1=zinc com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,csiCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,csiCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -52,16 +56,15 @@ commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testRuntimeClassp commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,csiCompileClasspath,testCompileClasspath,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=2_12_18RuntimeClasspath,2_13_11RuntimeClasspath,3_3_0RuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=2_12_18RuntimeClasspath,2_13_11RuntimeClasspath,3_3_0RuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=2_12_18RuntimeClasspath,2_13_11RuntimeClasspath,3_3_0RuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=2_12_18RuntimeClasspath,2_13_11RuntimeClasspath,3_3_0RuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.openhft:zero-allocation-hashing:0.16=zinc net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,7 +90,7 @@ org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath @@ -96,7 +99,8 @@ org.jctools:jctools-core:4.0.6=testRuntimeClasspath org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -114,47 +118,47 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=2_12_18RuntimeClasspath,2_13_11RuntimeClasspath,3_3_0RuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=2_12_18RuntimeClasspath,2_13_11RuntimeClasspath,3_3_0RuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=zinc org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.10.7=compileClasspath,csiCompileClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang:scala-library:2.11.12=2_11_12CompileClasspath,2_11_12RuntimeClasspath org.scala-lang:scala-library:2.12.18=2_12_18CompileClasspath,2_12_18RuntimeClasspath org.scala-lang:scala-library:2.13.10=3_3_0CompileClasspath,3_3_0RuntimeClasspath org.scala-lang:scala-library:2.13.11=2_13_11CompileClasspath,2_13_11RuntimeClasspath -org.scala-lang:scala-library:2.13.15=zinc -org.scala-lang:scala-reflect:2.13.15=zinc +org.scala-lang:scala-library:2.13.16=zinc +org.scala-lang:scala-reflect:2.13.16=zinc org.scala-lang:scala3-library_3:3.3.0=3_3_0CompileClasspath,3_3_0RuntimeClasspath -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/scala/scala-concurrent-2.8/gradle.lockfile b/dd-java-agent/instrumentation/scala/scala-concurrent-2.8/gradle.lockfile index 56adcab67db..3bc871689cc 100644 --- a/dd-java-agent/instrumentation/scala/scala-concurrent-2.8/gradle.lockfile +++ b/dd-java-agent/instrumentation/scala/scala-concurrent-2.8/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:scala:scala-concurrent-2.8:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latest11TestCompileClasspath,latest11TestRunt com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.eed3si9n:shaded-scalajson_2.13:1.0.0-M4=zinc com.eed3si9n:sjson-new-core_2.13:0.10.1=zinc com.eed3si9n:sjson-new-scalajson_2.13:0.10.1=zinc com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latest11TestAnnotationProcessor,latest11TestCompileClasspath,latest12TestAnnotationProcessor,latest12TestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latest11TestAnnotationProcessor,latest12TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latest11TestAnnotationProcessor,latest12TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latest11TestAnnotationProcessor,latest12TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latest11TestAnnotationProcessor,latest12TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latest11TestAnnotationProcessor,latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestAnnotationProcessor,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latest11TestAnnotationProcessor,latest12TestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.squareup.moshi:moshi:1.11.0=latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -52,16 +56,15 @@ commons-fileupload:commons-fileupload:1.5=latest11TestCompileClasspath,latest11T commons-io:commons-io:2.11.0=latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.leangen.geantyref:geantyref:1.3.16=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.8.0=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.openhft:zero-allocation-hashing:0.16=zinc net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,7 +90,7 @@ org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -96,7 +99,8 @@ org.jctools:jctools-core:4.0.6=latest11TestRuntimeClasspath,latest12TestRuntimeC org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc +org.jspecify:jspecify:1.0.0=latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -114,45 +118,45 @@ org.objenesis:objenesis:3.3=latest11TestCompileClasspath,latest11TestRuntimeClas org.opentest4j:opentest4j:1.3.0=latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latest11TestRuntimeClasspath,latest12TestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=zinc org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.10.7=compileClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang:scala-library:2.11.12=latest11TestCompileClasspath,latest11TestRuntimeClasspath org.scala-lang:scala-library:2.12.21=latest12TestCompileClasspath,latest12TestRuntimeClasspath -org.scala-lang:scala-library:2.13.15=zinc +org.scala-lang:scala-library:2.13.16=zinc org.scala-lang:scala-library:2.13.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.scala-lang:scala-reflect:2.13.15=zinc -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-lang:scala-reflect:2.13.16=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.slf4j:jcl-over-slf4j:1.7.30=latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latest11TestCompileClasspath,latest11TestRuntimeClasspath,latest12TestCompileClasspath,latest12TestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/scala/scala-concurrent-2.8/src/latestDepTest/groovy/ScalaInstrumentationTest.groovy b/dd-java-agent/instrumentation/scala/scala-concurrent-2.8/src/latestDepTest/groovy/ScalaInstrumentationTest.groovy index 1f18e42508a..dfc848ec74e 100644 --- a/dd-java-agent/instrumentation/scala/scala-concurrent-2.8/src/latestDepTest/groovy/ScalaInstrumentationTest.groovy +++ b/dd-java-agent/instrumentation/scala/scala-concurrent-2.8/src/latestDepTest/groovy/ScalaInstrumentationTest.groovy @@ -19,10 +19,10 @@ class ScalaInstrumentationTest extends InstrumentationSpecification { expect: trace.size() == expectedNumberOfSpans trace[0].resourceName.toString() == "ScalaConcurrentTests.traceWithFutureAndCallbacks" - findSpan(trace, "goodFuture").context().getParentId() == trace[0].context().getSpanId() - findSpan(trace, "badFuture").context().getParentId() == trace[0].context().getSpanId() - findSpan(trace, "good complete").context().getParentId() == trace[0].context().getSpanId() - findSpan(trace, "bad complete").context().getParentId() == trace[0].context().getSpanId() + findSpan(trace, "goodFuture").spanContext().getParentId() == trace[0].spanContext().getSpanId() + findSpan(trace, "badFuture").spanContext().getParentId() == trace[0].spanContext().getSpanId() + findSpan(trace, "good complete").spanContext().getParentId() == trace[0].spanContext().getSpanId() + findSpan(trace, "bad complete").spanContext().getParentId() == trace[0].spanContext().getSpanId() } def "scala propagates across futures with no traces"() { @@ -35,7 +35,7 @@ class ScalaInstrumentationTest extends InstrumentationSpecification { expect: trace.size() == expectedNumberOfSpans trace[0].resourceName.toString() == "ScalaConcurrentTests.tracedAcrossThreadsWithNoTrace" - findSpan(trace, "callback").context().getParentId() == trace[0].context().getSpanId() + findSpan(trace, "callback").spanContext().getParentId() == trace[0].spanContext().getSpanId() } def "scala either promise completion"() { @@ -49,9 +49,9 @@ class ScalaInstrumentationTest extends InstrumentationSpecification { TEST_WRITER.size() == 1 trace.size() == expectedNumberOfSpans trace[0].resourceName.toString() == "ScalaConcurrentTests.traceWithPromises" - findSpan(trace, "keptPromise").context().getParentId() == trace[0].context().getSpanId() - findSpan(trace, "keptPromise2").context().getParentId() == trace[0].context().getSpanId() - findSpan(trace, "brokenPromise").context().getParentId() == trace[0].context().getSpanId() + findSpan(trace, "keptPromise").spanContext().getParentId() == trace[0].spanContext().getSpanId() + findSpan(trace, "keptPromise2").spanContext().getParentId() == trace[0].spanContext().getSpanId() + findSpan(trace, "brokenPromise").spanContext().getParentId() == trace[0].spanContext().getSpanId() } def "scala first completed future"() { @@ -64,9 +64,9 @@ class ScalaInstrumentationTest extends InstrumentationSpecification { expect: TEST_WRITER.size() == 1 trace.size() == expectedNumberOfSpans - findSpan(trace, "timeout1").context().getParentId() == trace[0].context().getSpanId() - findSpan(trace, "timeout2").context().getParentId() == trace[0].context().getSpanId() - findSpan(trace, "timeout3").context().getParentId() == trace[0].context().getSpanId() + findSpan(trace, "timeout1").spanContext().getParentId() == trace[0].spanContext().getSpanId() + findSpan(trace, "timeout2").spanContext().getParentId() == trace[0].spanContext().getSpanId() + findSpan(trace, "timeout3").spanContext().getParentId() == trace[0].spanContext().getSpanId() } private DDSpan findSpan(List trace, String opName) { diff --git a/dd-java-agent/instrumentation/scala/scala-concurrent-2.8/src/main/java/datadog/trace/instrumentation/scala/concurrent/ScalaForkJoinTaskInstrumentation.java b/dd-java-agent/instrumentation/scala/scala-concurrent-2.8/src/main/java/datadog/trace/instrumentation/scala/concurrent/ScalaForkJoinTaskInstrumentation.java index e089a45d912..37c77580199 100644 --- a/dd-java-agent/instrumentation/scala/scala-concurrent-2.8/src/main/java/datadog/trace/instrumentation/scala/concurrent/ScalaForkJoinTaskInstrumentation.java +++ b/dd-java-agent/instrumentation/scala/scala-concurrent-2.8/src/main/java/datadog/trace/instrumentation/scala/concurrent/ScalaForkJoinTaskInstrumentation.java @@ -13,9 +13,9 @@ import static datadog.trace.bootstrap.instrumentation.java.concurrent.ExcludeFilter.exclude; import static net.bytebuddy.matcher.ElementMatchers.isMethod; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.java.concurrent.State; import net.bytebuddy.asm.Advice; import net.bytebuddy.description.type.TypeDescription; @@ -55,12 +55,12 @@ public void methodAdvice(MethodTransformer transformer) { public static final class Exec { @Advice.OnMethodEnter - public static AgentScope before(@Advice.This ForkJoinTask task) { + public static ContextScope before(@Advice.This ForkJoinTask task) { return startTaskScope(InstrumentationContext.get(ForkJoinTask.class, State.class), task); } @Advice.OnMethodExit(onThrowable = Throwable.class) - public static void after(@Advice.Enter AgentScope scope) { + public static void after(@Advice.Enter ContextScope scope) { endTaskScope(scope); } } diff --git a/dd-java-agent/instrumentation/scala/scala-concurrent-2.8/src/test/groovy/ScalaInstrumentationTest.groovy b/dd-java-agent/instrumentation/scala/scala-concurrent-2.8/src/test/groovy/ScalaInstrumentationTest.groovy index 1f18e42508a..dfc848ec74e 100644 --- a/dd-java-agent/instrumentation/scala/scala-concurrent-2.8/src/test/groovy/ScalaInstrumentationTest.groovy +++ b/dd-java-agent/instrumentation/scala/scala-concurrent-2.8/src/test/groovy/ScalaInstrumentationTest.groovy @@ -19,10 +19,10 @@ class ScalaInstrumentationTest extends InstrumentationSpecification { expect: trace.size() == expectedNumberOfSpans trace[0].resourceName.toString() == "ScalaConcurrentTests.traceWithFutureAndCallbacks" - findSpan(trace, "goodFuture").context().getParentId() == trace[0].context().getSpanId() - findSpan(trace, "badFuture").context().getParentId() == trace[0].context().getSpanId() - findSpan(trace, "good complete").context().getParentId() == trace[0].context().getSpanId() - findSpan(trace, "bad complete").context().getParentId() == trace[0].context().getSpanId() + findSpan(trace, "goodFuture").spanContext().getParentId() == trace[0].spanContext().getSpanId() + findSpan(trace, "badFuture").spanContext().getParentId() == trace[0].spanContext().getSpanId() + findSpan(trace, "good complete").spanContext().getParentId() == trace[0].spanContext().getSpanId() + findSpan(trace, "bad complete").spanContext().getParentId() == trace[0].spanContext().getSpanId() } def "scala propagates across futures with no traces"() { @@ -35,7 +35,7 @@ class ScalaInstrumentationTest extends InstrumentationSpecification { expect: trace.size() == expectedNumberOfSpans trace[0].resourceName.toString() == "ScalaConcurrentTests.tracedAcrossThreadsWithNoTrace" - findSpan(trace, "callback").context().getParentId() == trace[0].context().getSpanId() + findSpan(trace, "callback").spanContext().getParentId() == trace[0].spanContext().getSpanId() } def "scala either promise completion"() { @@ -49,9 +49,9 @@ class ScalaInstrumentationTest extends InstrumentationSpecification { TEST_WRITER.size() == 1 trace.size() == expectedNumberOfSpans trace[0].resourceName.toString() == "ScalaConcurrentTests.traceWithPromises" - findSpan(trace, "keptPromise").context().getParentId() == trace[0].context().getSpanId() - findSpan(trace, "keptPromise2").context().getParentId() == trace[0].context().getSpanId() - findSpan(trace, "brokenPromise").context().getParentId() == trace[0].context().getSpanId() + findSpan(trace, "keptPromise").spanContext().getParentId() == trace[0].spanContext().getSpanId() + findSpan(trace, "keptPromise2").spanContext().getParentId() == trace[0].spanContext().getSpanId() + findSpan(trace, "brokenPromise").spanContext().getParentId() == trace[0].spanContext().getSpanId() } def "scala first completed future"() { @@ -64,9 +64,9 @@ class ScalaInstrumentationTest extends InstrumentationSpecification { expect: TEST_WRITER.size() == 1 trace.size() == expectedNumberOfSpans - findSpan(trace, "timeout1").context().getParentId() == trace[0].context().getSpanId() - findSpan(trace, "timeout2").context().getParentId() == trace[0].context().getSpanId() - findSpan(trace, "timeout3").context().getParentId() == trace[0].context().getSpanId() + findSpan(trace, "timeout1").spanContext().getParentId() == trace[0].spanContext().getSpanId() + findSpan(trace, "timeout2").spanContext().getParentId() == trace[0].spanContext().getSpanId() + findSpan(trace, "timeout3").spanContext().getParentId() == trace[0].spanContext().getSpanId() } private DDSpan findSpan(List trace, String opName) { diff --git a/dd-java-agent/instrumentation/scala/scala-concurrent-2.8/src/test/java/LinearTask.java b/dd-java-agent/instrumentation/scala/scala-concurrent-2.8/src/test/java/LinearTask.java index c62b49217fe..0bfd9877d15 100644 --- a/dd-java-agent/instrumentation/scala/scala-concurrent-2.8/src/test/java/LinearTask.java +++ b/dd-java-agent/instrumentation/scala/scala-concurrent-2.8/src/test/java/LinearTask.java @@ -1,7 +1,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import scala.concurrent.forkjoin.RecursiveTask; @@ -32,7 +32,7 @@ protected Integer compute() { } else { int next = parent + 1; AgentSpan span = startSpan("test", Integer.toString(next)); - try (AgentScope scope = activateSpan(span)) { + try (ContextScope scope = activateSpan(span)) { LinearTask child = new LinearTask(next, depth); return child.fork().join(); } finally { diff --git a/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-2.10/gradle.lockfile b/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-2.10/gradle.lockfile index 07ec6165d5e..adc8a03da63 100644 --- a/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-2.10/gradle.lockfile +++ b/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-2.10/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:scala:scala-promise:scala-promise-2.10:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.eed3si9n:shaded-scalajson_2.13:1.0.0-M4=zinc com.eed3si9n:sjson-new-core_2.13:0.10.1=zinc com.eed3si9n:sjson-new-scalajson_2.13:0.10.1=zinc com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -52,16 +56,15 @@ commons-fileupload:commons-fileupload:1.5=latestDepForkedTestCompileClasspath,la commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.openhft:zero-allocation-hashing:0.16=zinc net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,7 +90,7 @@ org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -96,7 +99,8 @@ org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTest org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -114,43 +118,43 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=zinc org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.10.7=compileClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang:scala-library:2.12.21=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.scala-lang:scala-library:2.13.15=zinc -org.scala-lang:scala-reflect:2.13.15=zinc -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-lang:scala-library:2.13.16=zinc +org.scala-lang:scala-reflect:2.13.16=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-2.10/src/main/java/datadog/trace/instrumentation/scala210/concurrent/CallbackRunnableInstrumentation.java b/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-2.10/src/main/java/datadog/trace/instrumentation/scala210/concurrent/CallbackRunnableInstrumentation.java index 81e23d1fc9d..177a5e65bbc 100644 --- a/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-2.10/src/main/java/datadog/trace/instrumentation/scala210/concurrent/CallbackRunnableInstrumentation.java +++ b/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-2.10/src/main/java/datadog/trace/instrumentation/scala210/concurrent/CallbackRunnableInstrumentation.java @@ -7,10 +7,10 @@ import static net.bytebuddy.matcher.ElementMatchers.isMethod; import datadog.context.Context; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.bootstrap.ContextStore; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.java.concurrent.State; import datadog.trace.instrumentation.scala.PromiseHelper; import net.bytebuddy.asm.Advice; @@ -43,13 +43,13 @@ public static void onConstruct(@Advice.This CallbackRunnable task) { public static final class Run { @Advice.OnMethodEnter - public static AgentScope before(@Advice.This CallbackRunnable task) { + public static ContextScope before(@Advice.This CallbackRunnable task) { return PromiseHelper.runActivateSpan( InstrumentationContext.get(CallbackRunnable.class, State.class).get(task)); } @Advice.OnMethodExit(onThrowable = Throwable.class) - public static void after(@Advice.Enter AgentScope scope) { + public static void after(@Advice.Enter ContextScope scope) { endTaskScope(scope); } } diff --git a/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-2.10/src/main/java/datadog/trace/instrumentation/scala210/concurrent/PromiseObjectInstrumentation.java b/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-2.10/src/main/java/datadog/trace/instrumentation/scala210/concurrent/PromiseObjectInstrumentation.java index 935251e27d6..d29f7075db3 100644 --- a/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-2.10/src/main/java/datadog/trace/instrumentation/scala210/concurrent/PromiseObjectInstrumentation.java +++ b/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-2.10/src/main/java/datadog/trace/instrumentation/scala210/concurrent/PromiseObjectInstrumentation.java @@ -1,6 +1,7 @@ package datadog.trace.instrumentation.scala210.concurrent; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static net.bytebuddy.matcher.ElementMatchers.isMethod; import datadog.context.Context; @@ -8,7 +9,6 @@ import datadog.trace.bootstrap.ContextStore; import datadog.trace.bootstrap.InstrumentationContext; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; -import datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge; import datadog.trace.instrumentation.scala.PromiseHelper; import net.bytebuddy.asm.Advice; import scala.concurrent.impl.CallbackRunnable; @@ -43,8 +43,7 @@ public static void afterResolve(@Advice.Return(readOnly = false) Try reso ContextStore contextStore = InstrumentationContext.get(Try.class, Context.class); final Context existing = contextStore.get(resolved); - Try next = - PromiseHelper.getTry(resolved, span, Java8BytecodeBridge.spanFromContext(existing)); + Try next = PromiseHelper.getTry(resolved, span, spanFromContext(existing)); if (next != resolved) { contextStore.put(next, span); resolved = next; diff --git a/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-2.13/gradle.lockfile b/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-2.13/gradle.lockfile index ac8eb8a5945..0ee45a43889 100644 --- a/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-2.13/gradle.lockfile +++ b/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-2.13/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:scala:scala-promise:scala-promise-2.13:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.eed3si9n:shaded-scalajson_2.13:1.0.0-M4=zinc com.eed3si9n:sjson-new-core_2.13:0.10.1=zinc com.eed3si9n:sjson-new-scalajson_2.13:0.10.1=zinc com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -52,16 +56,15 @@ commons-fileupload:commons-fileupload:1.5=latestDepForkedTestCompileClasspath,la commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.openhft:zero-allocation-hashing:0.16=zinc net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,7 +90,7 @@ org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -96,7 +99,8 @@ org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTest org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -114,43 +118,43 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=zinc org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.13.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-lang:scala-library:2.13.15=zinc +org.scala-lang:scala-library:2.13.16=zinc org.scala-lang:scala-library:2.13.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.scala-lang:scala-reflect:2.13.15=zinc -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-lang:scala-reflect:2.13.16=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-2.13/src/main/java/datadog/trace/instrumentation/scala213/concurrent/PromiseTransformationInstrumentation.java b/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-2.13/src/main/java/datadog/trace/instrumentation/scala213/concurrent/PromiseTransformationInstrumentation.java index f0bd95daaf3..1d45b284b25 100644 --- a/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-2.13/src/main/java/datadog/trace/instrumentation/scala213/concurrent/PromiseTransformationInstrumentation.java +++ b/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-2.13/src/main/java/datadog/trace/instrumentation/scala213/concurrent/PromiseTransformationInstrumentation.java @@ -8,10 +8,10 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArguments; import datadog.context.Context; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.bootstrap.ContextStore; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.java.concurrent.State; import datadog.trace.instrumentation.scala.PromiseHelper; import net.bytebuddy.asm.Advice; @@ -50,13 +50,13 @@ public static void onConstruct( public static final class Run { @Advice.OnMethodEnter - public static AgentScope before(@Advice.This Transformation task) { + public static ContextScope before(@Advice.This Transformation task) { return PromiseHelper.runActivateSpan( InstrumentationContext.get(Transformation.class, State.class).get(task)); } @Advice.OnMethodExit(onThrowable = Throwable.class) - public static void after(@Advice.Enter AgentScope scope) { + public static void after(@Advice.Enter ContextScope scope) { endTaskScope(scope); } } diff --git a/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-common/gradle.lockfile b/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-common/gradle.lockfile index 07a15dfac64..533c7888b93 100644 --- a/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-common/gradle.lockfile +++ b/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-common/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:scala:scala-promise:scala-promise-common:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -17,15 +18,15 @@ com.eed3si9n:shaded-scalajson_2.13:1.0.0-M4=zinc com.eed3si9n:sjson-new-core_2.13:0.10.1=zinc com.eed3si9n:sjson-new-scalajson_2.13:0.10.1=zinc com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -52,16 +56,15 @@ commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testRuntimeClassp commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.openhft:zero-allocation-hashing:0.16=zinc net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,7 +90,7 @@ org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath @@ -96,7 +99,8 @@ org.jctools:jctools-core:4.0.6=testRuntimeClasspath org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -114,42 +118,42 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=zinc org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.10.7=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-lang:scala-library:2.13.15=zinc -org.scala-lang:scala-reflect:2.13.15=zinc -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-lang:scala-library:2.13.16=zinc +org.scala-lang:scala-reflect:2.13.16=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-common/src/main/java/datadog/trace/instrumentation/scala/PromiseHelper.java b/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-common/src/main/java/datadog/trace/instrumentation/scala/PromiseHelper.java index 3a34267ebd2..690771cbd76 100644 --- a/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-common/src/main/java/datadog/trace/instrumentation/scala/PromiseHelper.java +++ b/dd-java-agent/instrumentation/scala/scala-promise/scala-promise-common/src/main/java/datadog/trace/instrumentation/scala/PromiseHelper.java @@ -3,12 +3,12 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.captureSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.isAsyncPropagationEnabled; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import datadog.context.Context; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; import datadog.trace.api.InstrumenterConfig; import datadog.trace.bootstrap.ContextStore; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.java.concurrent.AdviceUtils; import datadog.trace.bootstrap.instrumentation.java.concurrent.State; @@ -65,13 +65,13 @@ public static Try getTry( } /** - * Activate the {@code AgentScope} stored in the {@code State} for the active task, if any, and - * mark migration accordingly. + * Activate the {@code Context} stored in the {@code State} for the active task, if any, and mark + * migration accordingly. * * @param state the State related to the task becoming active. - * @return tha active AgentScope + * @return the active ContextScope */ - public static AgentScope runActivateSpan(State state) { + public static ContextScope runActivateSpan(State state) { if (state == null) { return null; } @@ -104,14 +104,14 @@ public static State executeCaptureSpan( ContextStore taskStore, K task, State state) { - final AgentSpan span = spanFromContext(tryStore.get(resolved)); + final AgentSpan span = AgentSpan.fromContext(tryStore.get(resolved)); if (span != null) { // Check if the new Span is the same as the currently stored one if (null != state && state.getSpan() == span) { return state; } - AgentScope.Continuation continuation = captureSpan(span); - AgentScope.Continuation existing = null; + ContextContinuation continuation = captureSpan(span); + ContextContinuation existing = null; if (null != state) { existing = state.getAndResetContinuation(); } else { @@ -120,7 +120,7 @@ public static State executeCaptureSpan( } state.setOrCancelContinuation(continuation); if (null != existing) { - existing.cancel(); + existing.release(); } } return state; diff --git a/dd-java-agent/instrumentation/scalatest-3.0.8/gradle.lockfile b/dd-java-agent/instrumentation/scalatest-3.0.8/gradle.lockfile index 6e4cb100adf..669a0400477 100644 --- a/dd-java-agent/instrumentation/scalatest-3.0.8/gradle.lockfile +++ b/dd-java-agent/instrumentation/scalatest-3.0.8/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:scalatest-3.0.8:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -21,15 +22,15 @@ com.fasterxml.jackson.core:jackson-core:2.20.0=latestDepTestCompileClasspath,lat com.fasterxml.jackson.core:jackson-databind:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -39,12 +40,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.jayway.jsonpath:json-path:2.8.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -58,16 +62,15 @@ commons-fileupload:commons-fileupload:1.5=latestDepTestCompileClasspath,latestDe commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.minidev:accessors-smart:2.4.9=latestDepTestRuntimeClasspath,testRuntimeClasspath net.minidev:json-smart:2.4.10=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -96,18 +99,19 @@ org.codehaus.groovy:groovy:3.0.25=latestDepTestCompileClasspath,latestDepTestRun org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.freemarker:freemarker:2.3.31=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.core:0.8.14=latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.report:0.8.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.core:0.8.15=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.report:0.8.15=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -127,50 +131,50 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=zinc org.scala-lang.modules:scala-xml_2.12:1.2.0=testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-xml_2.12:2.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.scala-lang.modules:scala-xml_2.13:1.2.0=compileClasspath org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.12.15=testCompileClasspath,testRuntimeClasspath org.scala-lang:scala-library:2.12.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.scala-lang:scala-library:2.13.0=compileClasspath -org.scala-lang:scala-library:2.13.15=zinc +org.scala-lang:scala-library:2.13.16=zinc org.scala-lang:scala-reflect:2.12.10=testCompileClasspath,testRuntimeClasspath org.scala-lang:scala-reflect:2.12.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.scala-lang:scala-reflect:2.13.0=compileClasspath -org.scala-lang:scala-reflect:2.13.15=zinc -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-lang:scala-reflect:2.13.16=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.scalactic:scalactic_2.12:3.1.0=testCompileClasspath,testRuntimeClasspath org.scalactic:scalactic_2.12:3.3.0-SNAP4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.scalactic:scalactic_2.13:3.0.8=compileClasspath diff --git a/dd-java-agent/instrumentation/selenium-3.13/build.gradle b/dd-java-agent/instrumentation/selenium-3.13/build.gradle index 1f6301d7595..ea944f04aa9 100644 --- a/dd-java-agent/instrumentation/selenium-3.13/build.gradle +++ b/dd-java-agent/instrumentation/selenium-3.13/build.gradle @@ -49,12 +49,15 @@ configurations.matching({ it.name.startsWith('test') || it.name.startsWith('late }) tasks.named("compileLatestDepTestJava", JavaCompile) { - configureCompiler(it, 11, JavaVersion.VERSION_1_8) + configureCompiler(it, 17, JavaVersion.VERSION_1_8) +} + +tasks.named("compileLatestDepTestGroovy", GroovyCompile) { + configureCompiler(it, 17) } tasks.named("latestDepTest", Test) { testJvmConstraints { - minJavaVersion = JavaVersion.VERSION_11 + minJavaVersion = JavaVersion.VERSION_17 } } - diff --git a/dd-java-agent/instrumentation/selenium-3.13/gradle.lockfile b/dd-java-agent/instrumentation/selenium-3.13/gradle.lockfile index c0462504da8..4dcde2af800 100644 --- a/dd-java-agent/instrumentation/selenium-3.13/gradle.lockfile +++ b/dd-java-agent/instrumentation/selenium-3.13/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:selenium-3.13:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.fasterxml.jackson.core:jackson-core:2.20.0=latestDepTestCompileClasspath,lat com.fasterxml.jackson.core:jackson-databind:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath @@ -33,20 +34,20 @@ com.google.auto.service:auto-service:1.1.1=annotationProcessor,latestDepTestAnno com.google.auto:auto-common:1.2.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs -com.google.errorprone:error_prone_annotations:2.1.3=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.1.3=compileClasspath com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.errorprone:error_prone_annotations:2.41.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs +com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.google.guava:guava:20.0=testFixturesCompileClasspath,testFixturesRuntimeClasspath -com.google.guava:guava:25.0-jre=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:guava:25.0-jre=compileClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:33.5.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor -com.google.j2objc:j2objc-annotations:1.1=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:1.1=compileClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.jayway.jsonpath:json-path:2.8.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.shapesecurity:salvation2:3.0.1=testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -62,29 +63,30 @@ commons-codec:commons-codec:1.15=testCompileClasspath,testRuntimeClasspath commons-fileupload:commons-fileupload:1.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath commons-io:commons-io:2.11.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs -commons-io:commons-io:2.21.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +commons-io:commons-io:2.22.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath commons-logging:commons-logging:1.2=testCompileClasspath,testRuntimeClasspath -commons-logging:commons-logging:1.3.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +commons-logging:commons-logging:1.4.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath commons-net:commons-net:3.9.0=testCompileClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.opentelemetry:opentelemetry-api:1.60.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.opentelemetry:opentelemetry-common:1.60.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.opentelemetry:opentelemetry-context:1.60.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.opentelemetry:opentelemetry-exporter-logging:1.60.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.opentelemetry:opentelemetry-sdk-common:1.60.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi:1.60.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:1.60.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.opentelemetry:opentelemetry-sdk-logs:1.60.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.opentelemetry:opentelemetry-sdk-metrics:1.60.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.opentelemetry:opentelemetry-sdk-trace:1.60.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.opentelemetry:opentelemetry-sdk:1.60.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +io.opentelemetry:opentelemetry-api:1.64.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.opentelemetry:opentelemetry-common:1.64.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.opentelemetry:opentelemetry-context:1.64.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.opentelemetry:opentelemetry-exporter-logging:1.64.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.opentelemetry:opentelemetry-sdk-common:1.64.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi:1.64.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.opentelemetry:opentelemetry-sdk-extension-autoconfigure:1.64.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.opentelemetry:opentelemetry-sdk-logs:1.64.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.opentelemetry:opentelemetry-sdk-metrics:1.64.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.opentelemetry:opentelemetry-sdk-trace:1.64.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.opentelemetry:opentelemetry-sdk:1.64.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.minidev:accessors-smart:2.4.9=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -111,7 +113,7 @@ org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=latestDepTestCompileClasspath,testCompileClasspath,testFixturesCompileClasspath org.brotli:dec:0.1.2=testCompileClasspath,testRuntimeClasspath -org.checkerframework:checker-compat-qual:2.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.checkerframework:checker-compat-qual:2.0.0=compileClasspath org.checkerframework:checker-qual:3.33.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc @@ -122,7 +124,7 @@ org.codehaus.groovy:groovy-templates:3.0.23=codenarc org.codehaus.groovy:groovy-xml:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testRuntimeClasspath -org.codehaus.mojo:animal-sniffer-annotations:1.14=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.mojo:animal-sniffer-annotations:1.14=compileClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.eclipse.jetty.websocket:websocket-api:9.4.50.v20221201=testCompileClasspath,testRuntimeClasspath @@ -136,22 +138,22 @@ org.freemarker:freemarker:2.3.31=latestDepTestCompileClasspath,latestDepTestRunt org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testRuntimeClasspath -org.htmlunit:htmlunit-core-js:4.21.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.htmlunit:htmlunit-csp:4.21.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.htmlunit:htmlunit-cssparser:4.21.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.htmlunit:htmlunit-websocket-client:4.21.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.htmlunit:htmlunit-xpath:4.21.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.htmlunit:htmlunit:4.21.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.htmlunit:neko-htmlunit:4.21.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.jacoco:org.jacoco.core:0.8.14=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.report:0.8.14=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.htmlunit:htmlunit-core-js:5.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.htmlunit:htmlunit-csp:5.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.htmlunit:htmlunit-cssparser:5.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.htmlunit:htmlunit-websocket-client:5.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.htmlunit:htmlunit-xpath:5.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.htmlunit:htmlunit:5.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.htmlunit:neko-htmlunit:5.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jacoco:org.jacoco.core:0.8.15=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.report:0.8.15=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.platform:junit-platform-commons:1.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.platform:junit-platform-engine:1.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.platform:junit-platform-launcher:1.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -167,43 +169,44 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.seleniumhq.selenium:htmlunit-driver:2.70.0=testCompileClasspath,testRuntimeClasspath -org.seleniumhq.selenium:htmlunit3-driver:4.43.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.seleniumhq.selenium:htmlunit3-driver:4.46.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.seleniumhq.selenium:selenium-api:3.141.59=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.seleniumhq.selenium:selenium-api:4.43.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.seleniumhq.selenium:selenium-api:4.46.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.seleniumhq.selenium:selenium-chrome-driver:3.141.59=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.seleniumhq.selenium:selenium-chrome-driver:4.43.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.seleniumhq.selenium:selenium-chromium-driver:4.43.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.seleniumhq.selenium:selenium-devtools-v145:4.43.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.seleniumhq.selenium:selenium-devtools-v146:4.43.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.seleniumhq.selenium:selenium-devtools-v147:4.43.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.seleniumhq.selenium:selenium-chrome-driver:4.46.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.seleniumhq.selenium:selenium-chromium-driver:4.46.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.seleniumhq.selenium:selenium-devtools-latest:4.46.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.seleniumhq.selenium:selenium-devtools-v148:4.46.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.seleniumhq.selenium:selenium-devtools-v149:4.46.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.seleniumhq.selenium:selenium-devtools-v150:4.46.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.seleniumhq.selenium:selenium-edge-driver:3.141.59=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.seleniumhq.selenium:selenium-edge-driver:4.43.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.seleniumhq.selenium:selenium-edge-driver:4.46.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.seleniumhq.selenium:selenium-firefox-driver:3.141.59=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.seleniumhq.selenium:selenium-firefox-driver:4.43.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.seleniumhq.selenium:selenium-http:4.43.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.seleniumhq.selenium:selenium-firefox-driver:4.46.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.seleniumhq.selenium:selenium-http:4.46.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.seleniumhq.selenium:selenium-ie-driver:3.141.59=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.seleniumhq.selenium:selenium-ie-driver:4.43.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.seleniumhq.selenium:selenium-ie-driver:4.46.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.seleniumhq.selenium:selenium-java:3.141.59=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.seleniumhq.selenium:selenium-java:4.43.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.seleniumhq.selenium:selenium-json:4.43.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.seleniumhq.selenium:selenium-manager:4.43.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.seleniumhq.selenium:selenium-java:4.46.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.seleniumhq.selenium:selenium-json:4.46.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.seleniumhq.selenium:selenium-manager:4.46.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.seleniumhq.selenium:selenium-opera-driver:3.141.59=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.seleniumhq.selenium:selenium-os:4.43.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.seleniumhq.selenium:selenium-os:4.46.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.seleniumhq.selenium:selenium-remote-driver:3.141.59=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.seleniumhq.selenium:selenium-remote-driver:4.43.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.seleniumhq.selenium:selenium-remote-driver:4.46.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.seleniumhq.selenium:selenium-safari-driver:3.141.59=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.seleniumhq.selenium:selenium-safari-driver:4.43.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.seleniumhq.selenium:selenium-safari-driver:4.46.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.seleniumhq.selenium:selenium-support:3.141.59=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.seleniumhq.selenium:selenium-support:4.43.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.seleniumhq.selenium:selenium-support:4.46.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.skyscreamer:jsonassert:1.5.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -216,8 +219,8 @@ org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.spockframework:spock-bom:2.4-groovy-3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-junit:1.2.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-parser:1.2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-junit:1.2.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.tabletest:tabletest-parser:1.2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs org.xmlunit:xmlunit-core:2.10.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath empty=spotbugsPlugins,testFixturesAnnotationProcessor diff --git a/dd-java-agent/instrumentation/selenium-3.13/src/latestDepTest/groovy/datadog/trace/instrumentation/selenium/SeleniumLatestTest.groovy b/dd-java-agent/instrumentation/selenium-3.13/src/latestDepTest/groovy/datadog/trace/instrumentation/selenium/SeleniumLatestTest.groovy index 2d0f1be39db..a5ec727dd0b 100644 --- a/dd-java-agent/instrumentation/selenium-3.13/src/latestDepTest/groovy/datadog/trace/instrumentation/selenium/SeleniumLatestTest.groovy +++ b/dd-java-agent/instrumentation/selenium-3.13/src/latestDepTest/groovy/datadog/trace/instrumentation/selenium/SeleniumLatestTest.groovy @@ -7,8 +7,8 @@ import spock.util.environment.Jvm class SeleniumLatestTest extends AbstractSeleniumTest { def "test Selenium #testcaseName"() { - // Latest Selenium versions require Java 11 - Assumptions.assumeTrue(Jvm.current.java11Compatible) + // Latest HtmlUnit versions require Java 17 + Assumptions.assumeTrue(Jvm.current.java17Compatible) runTests(tests) diff --git a/dd-java-agent/instrumentation/servicetalk/servicetalk-0.42.0/gradle.lockfile b/dd-java-agent/instrumentation/servicetalk/servicetalk-0.42.0/gradle.lockfile index 8842e2d2542..92684a4baa6 100644 --- a/dd-java-agent/instrumentation/servicetalk/servicetalk-0.42.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/servicetalk/servicetalk-0.42.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:servicetalk:servicetalk-0.42.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,21 +9,21 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.15.4=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -32,13 +33,16 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.protobuf:protobuf-bom:3.25.1=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -69,12 +73,12 @@ io.servicetalk:servicetalk-context-api:0.42.55=latestDepTestCompileClasspath,lat io.servicetalk:servicetalk-dependencies:0.42.42=testCompileClasspath,testRuntimeClasspath io.servicetalk:servicetalk-utils-internal:0.42.42=testRuntimeClasspath io.servicetalk:servicetalk-utils-internal:0.42.55=latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -105,6 +109,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -122,14 +127,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/servicetalk/servicetalk-0.42.0/src/main/java/datadog/trace/instrumentation/servicetalk0_42_0/ContextPreservingInstrumentation.java b/dd-java-agent/instrumentation/servicetalk/servicetalk-0.42.0/src/main/java/datadog/trace/instrumentation/servicetalk0_42_0/ContextPreservingInstrumentation.java index 874df60efb5..f175ada8f4b 100644 --- a/dd-java-agent/instrumentation/servicetalk/servicetalk-0.42.0/src/main/java/datadog/trace/instrumentation/servicetalk0_42_0/ContextPreservingInstrumentation.java +++ b/dd-java-agent/instrumentation/servicetalk/servicetalk-0.42.0/src/main/java/datadog/trace/instrumentation/servicetalk0_42_0/ContextPreservingInstrumentation.java @@ -62,7 +62,7 @@ public static AgentScope enter(@Advice.FieldValue("saved") final ContextMap cont return null; } - @Advice.OnMethodExit(suppress = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void exit(@Advice.Enter final AgentScope agentScope) { if (agentScope != null) { agentScope.close(); diff --git a/dd-java-agent/instrumentation/servicetalk/servicetalk-0.42.0/src/test/groovy/ContextPreservingInstrumentationTest.groovy b/dd-java-agent/instrumentation/servicetalk/servicetalk-0.42.0/src/test/groovy/ContextPreservingInstrumentationTest.groovy index a60ecc28fc0..693baa079b9 100644 --- a/dd-java-agent/instrumentation/servicetalk/servicetalk-0.42.0/src/test/groovy/ContextPreservingInstrumentationTest.groovy +++ b/dd-java-agent/instrumentation/servicetalk/servicetalk-0.42.0/src/test/groovy/ContextPreservingInstrumentationTest.groovy @@ -1,13 +1,13 @@ +import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace + +import datadog.context.ContextContinuation import datadog.trace.agent.test.InstrumentationSpecification -import datadog.trace.bootstrap.instrumentation.api.AgentScope import datadog.trace.bootstrap.instrumentation.api.AgentTracer import io.servicetalk.concurrent.api.AsyncContext import io.servicetalk.context.api.ContextMap import java.util.concurrent.ExecutorService import java.util.concurrent.Executors -import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace - class ContextPreservingInstrumentationTest extends InstrumentationSpecification { def "wrapBiConsumer"() { @@ -112,10 +112,10 @@ class ContextPreservingInstrumentationTest extends InstrumentationSpecification */ private class ParentContext { final ContextMap contextMap = AsyncContext.context().copy() - final AgentScope.Continuation spanContinuation = AgentTracer.captureActiveSpan() + final ContextContinuation spanContinuation = AgentTracer.captureActiveSpan() def releaseParentSpan() { - spanContinuation.cancel() + spanContinuation.release() } } diff --git a/dd-java-agent/instrumentation/servicetalk/servicetalk-0.42.56/gradle.lockfile b/dd-java-agent/instrumentation/servicetalk/servicetalk-0.42.56/gradle.lockfile index 0541132b516..bce286ae04c 100644 --- a/dd-java-agent/instrumentation/servicetalk/servicetalk-0.42.56/gradle.lockfile +++ b/dd-java-agent/instrumentation/servicetalk/servicetalk-0.42.56/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:servicetalk:servicetalk-0.42.56:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -54,12 +58,12 @@ io.servicetalk:servicetalk-concurrent-internal:0.42.56=testRuntimeClasspath io.servicetalk:servicetalk-concurrent:0.42.56=compileClasspath,testCompileClasspath,testRuntimeClasspath io.servicetalk:servicetalk-context-api:0.42.56=compileClasspath,testCompileClasspath,testRuntimeClasspath io.servicetalk:servicetalk-utils-internal:0.42.56=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -88,6 +92,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -105,14 +110,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/servicetalk/servicetalk-0.42.56/src/test/groovy/ContextPreservingInstrumentationTest.groovy b/dd-java-agent/instrumentation/servicetalk/servicetalk-0.42.56/src/test/groovy/ContextPreservingInstrumentationTest.groovy index 5a4e140b91f..4671237ecde 100644 --- a/dd-java-agent/instrumentation/servicetalk/servicetalk-0.42.56/src/test/groovy/ContextPreservingInstrumentationTest.groovy +++ b/dd-java-agent/instrumentation/servicetalk/servicetalk-0.42.56/src/test/groovy/ContextPreservingInstrumentationTest.groovy @@ -1,13 +1,13 @@ +import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace + +import datadog.context.ContextContinuation import datadog.trace.agent.test.InstrumentationSpecification -import datadog.trace.bootstrap.instrumentation.api.AgentScope import datadog.trace.bootstrap.instrumentation.api.AgentTracer import io.servicetalk.concurrent.api.AsyncContext import io.servicetalk.concurrent.api.CapturedContext import java.util.concurrent.ExecutorService import java.util.concurrent.Executors -import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace - class ContextPreservingInstrumentationTest extends InstrumentationSpecification { def "capturedContext"() { @@ -150,10 +150,10 @@ class ContextPreservingInstrumentationTest extends InstrumentationSpecification */ private class ParentContext { final CapturedContext capturedContext = asyncContextProvider.captureContext() - final AgentScope.Continuation spanContinuation = AgentTracer.captureActiveSpan() + final ContextContinuation spanContinuation = AgentTracer.captureActiveSpan() def releaseParentSpan() { - spanContinuation.cancel() + spanContinuation.release() } } diff --git a/dd-java-agent/instrumentation/servlet/jakarta-servlet-5.0/build.gradle b/dd-java-agent/instrumentation/servlet/jakarta-servlet-5.0/build.gradle index 93ffdc1a131..c664a055f14 100644 --- a/dd-java-agent/instrumentation/servlet/jakarta-servlet-5.0/build.gradle +++ b/dd-java-agent/instrumentation/servlet/jakarta-servlet-5.0/build.gradle @@ -1,4 +1,5 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar +import datadog.gradle.plugin.muzzle.tasks.MuzzleTask plugins { id 'java-test-fixtures' @@ -30,14 +31,14 @@ configurations { javaxClassesToRelocate } -tasks.register('relocatedJavaxJar', ShadowJar) { +def relocatedJavaxJar = tasks.register('relocatedJavaxJar', ShadowJar) { relocate 'javax.servlet', 'jakarta.servlet' relocate 'datadog.trace.instrumentation.servlet3', 'datadog.trace.instrumentation.servlet5' relocate 'datadog.trace.instrumentation.servlet', 'datadog.trace.instrumentation.servlet5' archiveClassifier.set('relocated-javax') - configurations = [project.configurations.javaxClassesToRelocate] + configurations.add(project.configurations.named('javaxClassesToRelocate')) include '**/*.jar' include '**/Servlet31InputStreamWrapper.class' @@ -49,9 +50,24 @@ tasks.register('relocatedJavaxJar', ShadowJar) { includeEmptyDirs = false } +def relocatedJavaxJarFile = relocatedJavaxJar.flatMap { it.archiveFile } dependencies { - implementation files(relocatedJavaxJar.outputs.files) + // Wire the relocated javax->jakarta advice into this project without publishing + // the relocated jar as runtime output: + // + // - keep the relocated jar visible to main compilation through `compileOnly` + // - keep the relocated jar visible to tests through `testImplementation` + // - include the relocated classes into this project's jar (jar task config) + // + // NOTE: + // Do not add the relocated jar to `implementation`: `runtimeElements` publishes + // both the jar artifact and runtime dependencies derived from `implementation`. + // Publishing the relocated jar there would expose the same servlet5 advice classes + // twice to downstream projects, once from the module jar and once from the + // relocated jar. + compileOnly files(relocatedJavaxJarFile) + testImplementation files(relocatedJavaxJarFile) compileOnly group: 'jakarta.servlet', name: 'jakarta.servlet-api', version: '5.0.0' testImplementation group: 'jakarta.servlet', name: 'jakarta.servlet-api', version: '5.0.0' testImplementation group: 'jakarta.servlet.jsp', name: 'jakarta.servlet.jsp-api', version: '3.0.0' @@ -76,5 +92,12 @@ dependencies { } tasks.named("jar", Jar) { - from zipTree(relocatedJavaxJar.outputs.files.asPath) + from zipTree(relocatedJavaxJarFile) +} + +// Make the relocated jar visible to muzzle through `extraAgentClasspath`. +// Muzzle uses the runtime classpath of a project, and this jar is produced +// outside of it. +tasks.withType(MuzzleTask).configureEach { + extraAgentClasspath.from(relocatedJavaxJarFile) } diff --git a/dd-java-agent/instrumentation/servlet/jakarta-servlet-5.0/gradle.lockfile b/dd-java-agent/instrumentation/servlet/jakarta-servlet-5.0/gradle.lockfile index dac6eb91a56..0937483e7c4 100644 --- a/dd-java-agent/instrumentation/servlet/jakarta-servlet-5.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/servlet/jakarta-servlet-5.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:servlet:jakarta-servlet-5.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testFixturesRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testFixturesRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testFixturesCompileClass com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testFixturesRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,csiCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,csiCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -47,14 +51,14 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testFixturesCompileClasspath,t commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,csiCompileClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testFixturesRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testFixturesRuntimeClasspath,testRuntimeClasspath jakarta.servlet.jsp:jakarta.servlet.jsp-api:3.0.0=testCompileClasspath,testRuntimeClasspath jakarta.servlet:jakarta.servlet-api:5.0.0=compileClasspath,csiCompileClasspath,testCompileClasspath,testFixturesCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testFixturesRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -83,6 +87,7 @@ org.hamcrest:hamcrest-core:1.3=testFixturesRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testFixturesCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testFixturesRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=testFixturesRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -100,14 +105,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testFixturesCompileClasspath,te org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testFixturesRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/servlet/jakarta-servlet-5.0/src/testFixtures/groovy/datadog/trace/instrumentation/servlet5/TestServlet5.groovy b/dd-java-agent/instrumentation/servlet/jakarta-servlet-5.0/src/testFixtures/groovy/datadog/trace/instrumentation/servlet5/TestServlet5.groovy index 51e7c974f6d..93060644456 100644 --- a/dd-java-agent/instrumentation/servlet/jakarta-servlet-5.0/src/testFixtures/groovy/datadog/trace/instrumentation/servlet5/TestServlet5.groovy +++ b/dd-java-agent/instrumentation/servlet/jakarta-servlet-5.0/src/testFixtures/groovy/datadog/trace/instrumentation/servlet5/TestServlet5.groovy @@ -11,6 +11,8 @@ import java.lang.reflect.Field import java.lang.reflect.Modifier import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.BODY_MULTIPART +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.BODY_MULTIPART_COMBINED +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.BODY_MULTIPART_REPEATED import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.BODY_URLENCODED import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.CREATED import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.CREATED_IS @@ -68,6 +70,22 @@ class TestServlet5 extends HttpServlet { resp.status = endpoint.status resp.writer.print(req.getHeader("x-forwarded-for")) break + case BODY_MULTIPART_REPEATED: + resp.status = endpoint.status + // Call getParts() 3 times to verify the filenames callback fires only once + req.getParts() + req.getParts() + req.getParts() + resp.writer.print(endpoint.body) + break + case BODY_MULTIPART_COMBINED: + resp.status = endpoint.status + // Call getParameterMap() first (exercises GetFilenamesFromMultiPartAdvice via extractContentParameters), + // then getParts() explicitly (GetFilenamesAdvice must not double-fire since map is already set) + req.parameterMap + req.getParts() + resp.writer.print(endpoint.body) + break case BODY_MULTIPART: case BODY_URLENCODED: resp.status = endpoint.status diff --git a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-2.2/gradle.lockfile b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-2.2/gradle.lockfile index b828062ef05..d4faab88c92 100644 --- a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-2.2/gradle.lockfile +++ b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-2.2/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:servlet:javax-servlet:javax-servlet-2.2:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,13 +51,13 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:servlet-api:2.2=compileClasspath javax.servlet:servlet-api:2.5=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -97,6 +101,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -114,14 +119,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-2.2/src/main/java/datadog/trace/instrumentation/servlet2/Servlet2Decorator.java b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-2.2/src/main/java/datadog/trace/instrumentation/servlet2/Servlet2Decorator.java index b93877f73ed..202b67602a1 100644 --- a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-2.2/src/main/java/datadog/trace/instrumentation/servlet2/Servlet2Decorator.java +++ b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-2.2/src/main/java/datadog/trace/instrumentation/servlet2/Servlet2Decorator.java @@ -80,7 +80,7 @@ protected int status(final Integer status) { } @Override - public AgentSpan onRequest( + public void onRequest( final AgentSpan span, final HttpServletRequest connection, final HttpServletRequest request, @@ -90,6 +90,6 @@ public AgentSpan onRequest( span.setTag("servlet.context", request.getContextPath()); span.setTag("servlet.path", request.getServletPath()); } - return super.onRequest(span, connection, request, parentContext); + super.onRequest(span, connection, request, parentContext); } } diff --git a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/gradle.lockfile b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/gradle.lockfile index 72b113b7507..b4a2cd95f0e 100644 --- a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:servlet:javax-servlet:javax-servlet-3.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,csiCompileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,csiCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForked commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,csiCompileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=compileClasspath,csiCompileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -105,6 +109,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepForkedTestRuntimeClasspath,latestDepTest org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -122,14 +127,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/src/main/java/datadog/trace/instrumentation/servlet3/AsyncContextInstrumentation.java b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/src/main/java/datadog/trace/instrumentation/servlet3/AsyncContextInstrumentation.java index afb9e2a0859..d1a2432d16d 100644 --- a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/src/main/java/datadog/trace/instrumentation/servlet3/AsyncContextInstrumentation.java +++ b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/src/main/java/datadog/trace/instrumentation/servlet3/AsyncContextInstrumentation.java @@ -98,7 +98,7 @@ public static boolean enter( } final AgentSpan span = - startSpan(JAVA_WEB_SERVLET_DISPATCHER.toString(), SERVLET_DISPATCH, parent.context()); + startSpan(JAVA_WEB_SERVLET_DISPATCHER.toString(), SERVLET_DISPATCH, parent.spanContext()); // This span should get finished by Servlet3Advice // However, when using Jetty without servlets (directly org.eclipse.jetty.server.Handler), // that's not the case (see jetty's HandleAdvice) diff --git a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/src/main/java/datadog/trace/instrumentation/servlet3/FinishAsyncDispatchListener.java b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/src/main/java/datadog/trace/instrumentation/servlet3/FinishAsyncDispatchListener.java index 8d7080bba95..7799a54ab67 100644 --- a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/src/main/java/datadog/trace/instrumentation/servlet3/FinishAsyncDispatchListener.java +++ b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/src/main/java/datadog/trace/instrumentation/servlet3/FinishAsyncDispatchListener.java @@ -1,7 +1,6 @@ package datadog.trace.instrumentation.servlet3; import static datadog.trace.bootstrap.instrumentation.api.InstrumentationTags.TIMEOUT; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.servlet3.Servlet3Decorator.DECORATE; import datadog.context.ContextScope; @@ -37,7 +36,7 @@ public FinishAsyncDispatchListener(final ContextScope scope, boolean doOnRespons public FinishAsyncDispatchListener( final ContextScope scope, AtomicBoolean activated, boolean doOnResponse) { this.scope = scope; - this.span = spanFromContext(scope.context()); + this.span = AgentSpan.fromContext(scope.context()); this.activated = activated; this.doOnResponse = doOnResponse; } diff --git a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/src/main/java/datadog/trace/instrumentation/servlet3/HttpServletExtractAdapter.java b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/src/main/java/datadog/trace/instrumentation/servlet3/HttpServletExtractAdapter.java index 75981facf00..6fce09dfdb2 100644 --- a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/src/main/java/datadog/trace/instrumentation/servlet3/HttpServletExtractAdapter.java +++ b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/src/main/java/datadog/trace/instrumentation/servlet3/HttpServletExtractAdapter.java @@ -30,7 +30,8 @@ public static final class Request extends HttpServletExtractAdapter getHeaderNames(HttpServletRequest request) { - return request.getHeaderNames(); + final Enumeration ret = request.getHeaderNames(); + return ret != null ? ret : emptyEnumeration(); } @Override diff --git a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/src/main/java/datadog/trace/instrumentation/servlet3/Servlet3Advice.java b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/src/main/java/datadog/trace/instrumentation/servlet3/Servlet3Advice.java index c750c3fafc1..d4799961504 100644 --- a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/src/main/java/datadog/trace/instrumentation/servlet3/Servlet3Advice.java +++ b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/src/main/java/datadog/trace/instrumentation/servlet3/Servlet3Advice.java @@ -153,12 +153,13 @@ public static void stopSpan( return; } + final AgentSpan span = spanFromContext(scope.context()); + boolean finishSpanManually = false; + if (request instanceof HttpServletRequest && response instanceof HttpServletResponse) { final HttpServletResponse resp = (HttpServletResponse) response; - final AgentSpan span = spanFromContext(scope.context()); - - if (request.isAsyncStarted()) { + if (DECORATE.safeIsAsyncStarted(request)) { AtomicBoolean activated = new AtomicBoolean(); FinishAsyncDispatchListener asyncListener = new FinishAsyncDispatchListener(scope, activated, !isDispatch); @@ -166,17 +167,17 @@ public static void stopSpan( request.setAttribute(DD_FIN_DISP_LIST_SPAN_ATTRIBUTE, asyncListener); try { request.getAsyncContext().addListener(asyncListener); - } catch (final IllegalStateException e) { + } catch (final IllegalStateException | AbstractMethodError ignored) { // org.eclipse.jetty.server.Request may throw an exception here if request became // finished after check above. We just ignore that exception and move on. } - if (!request.isAsyncStarted() && activated.compareAndSet(false, true)) { + if (!DECORATE.safeIsAsyncStarted(request) && activated.compareAndSet(false, true)) { if (!isDispatch) { DECORATE.onResponse(span, resp); } if (finishSpan) { DECORATE.beforeFinish(scope.context()); - span.finish(); // Finish the span manually since finishSpanOnClose was false + finishSpanManually = true; } } } else { // not async @@ -199,10 +200,13 @@ public static void stopSpan( } if (finishSpan) { DECORATE.beforeFinish(scope.context()); - span.finish(); // Finish the span manually since finishSpanOnClose was false + finishSpanManually = true; } } } scope.close(); + if (finishSpanManually) { + span.finish(); // Finish the span manually since finishSpanOnClose was false + } } } diff --git a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/src/main/java/datadog/trace/instrumentation/servlet3/Servlet3Decorator.java b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/src/main/java/datadog/trace/instrumentation/servlet3/Servlet3Decorator.java index 61a8d22a2b8..e96cb1a8f3e 100644 --- a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/src/main/java/datadog/trace/instrumentation/servlet3/Servlet3Decorator.java +++ b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/src/main/java/datadog/trace/instrumentation/servlet3/Servlet3Decorator.java @@ -1,5 +1,7 @@ package datadog.trace.instrumentation.servlet3; +import static datadog.trace.api.telemetry.LogCollector.EXCLUDE_TELEMETRY; + import datadog.context.Context; import datadog.trace.api.ClassloaderConfigurationOverrides; import datadog.trace.bootstrap.instrumentation.api.AgentPropagation; @@ -8,8 +10,11 @@ import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; import datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator; import javax.servlet.ServletException; +import javax.servlet.ServletRequest; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class Servlet3Decorator extends HttpServerDecorator< @@ -21,6 +26,7 @@ public class Servlet3Decorator UTF8BytesString.create(DECORATE.operationName()); public static final String DD_CONTEXT_PATH_ATTRIBUTE = "datadog.context.path"; public static final String DD_SERVLET_PATH_ATTRIBUTE = "datadog.servlet.path"; + private static final Logger LOGGER = LoggerFactory.getLogger(Servlet3Decorator.class); @Override protected String[] instrumentationNames() { @@ -64,7 +70,15 @@ protected String peerHostIP(final HttpServletRequest httpServletRequest) { @Override protected int peerPort(final HttpServletRequest httpServletRequest) { - return httpServletRequest.getRemotePort(); + try { + return httpServletRequest.getRemotePort(); + } catch (AbstractMethodError e) { + LOGGER.debug( + EXCLUDE_TELEMETRY, + "Method not implemented when trying to get the request remote port", + e); + return 0; // 0 will be handled as `no port` by the caller + } } @Override @@ -83,7 +97,7 @@ protected String getRequestHeader(final HttpServletRequest request, String key) } @Override - public AgentSpan onRequest( + public void onRequest( final AgentSpan span, final HttpServletRequest connection, final HttpServletRequest request, @@ -102,16 +116,30 @@ public AgentSpan onRequest( request.setAttribute(DD_CONTEXT_PATH_ATTRIBUTE, contextPath); request.setAttribute(DD_SERVLET_PATH_ATTRIBUTE, servletPath); } - return super.onRequest(span, connection, request, parentContext); + super.onRequest(span, connection, request, parentContext); } @Override - public AgentSpan onError(final AgentSpan span, final Throwable throwable) { + public void onError(final AgentSpan span, final Throwable throwable) { if (throwable instanceof ServletException && throwable.getCause() != null) { super.onError(span, throwable.getCause()); } else { super.onError(span, throwable); } - return span; + } + + /** + * Safely calls ServletRequest#isAsyncStarted. Some 2.x wrappers might be dangling in the 3.x + * classpath and produce an AbstractMethodError + * + * @param servletRequest the servlet request. + * @return the real call result or false when the method does not exist in the provided object. + */ + public boolean safeIsAsyncStarted(final ServletRequest servletRequest) { + try { + return servletRequest.isAsyncStarted(); + } catch (AbstractMethodError ignored) { + return false; + } } } diff --git a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/src/testFixtures/groovy/datadog/trace/instrumentation/servlet3/TestServlet3.groovy b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/src/testFixtures/groovy/datadog/trace/instrumentation/servlet3/TestServlet3.groovy index 4b0b9df85d4..98a5983a36d 100644 --- a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/src/testFixtures/groovy/datadog/trace/instrumentation/servlet3/TestServlet3.groovy +++ b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-3.0/src/testFixtures/groovy/datadog/trace/instrumentation/servlet3/TestServlet3.groovy @@ -15,6 +15,8 @@ import java.lang.reflect.Modifier import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.BODY_URLENCODED import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.BODY_MULTIPART +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.BODY_MULTIPART_COMBINED +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.BODY_MULTIPART_REPEATED import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.CREATED import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.CREATED_IS import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.CUSTOM_EXCEPTION @@ -95,6 +97,22 @@ class TestServlet3 { resp.status = endpoint.status resp.writer.print(endpoint.bodyForQuery(req.queryString)) break + case BODY_MULTIPART_REPEATED: + resp.status = endpoint.status + // Call getParts() 3 times to verify the filenames callback fires only once + req.getParts() + req.getParts() + req.getParts() + resp.writer.print(endpoint.body) + break + case BODY_MULTIPART_COMBINED: + resp.status = endpoint.status + // Call getParameterMap() first (exercises GetFilenamesFromMultiPartAdvice via extractContentParameters), + // then getParts() explicitly (GetFilenamesAdvice must not double-fire since map is already set) + req.parameterMap + req.getParts() + resp.writer.print(endpoint.body) + break case BODY_URLENCODED: case BODY_MULTIPART: resp.status = endpoint.status diff --git a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-common/gradle.lockfile b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-common/gradle.lockfile index 89e7afcc5c5..0d576ce0985 100644 --- a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-common/gradle.lockfile +++ b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-common/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:servlet:javax-servlet:javax-servlet-common:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,csiCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,csiCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,csiCompileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:servlet-api:2.3=compileClasspath,csiCompileClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-common/src/main/java/datadog/trace/instrumentation/servlet/dispatcher/RequestDispatcherDecorator.java b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-common/src/main/java/datadog/trace/instrumentation/servlet/dispatcher/RequestDispatcherDecorator.java index 8f23091e758..dd5c85e0696 100644 --- a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-common/src/main/java/datadog/trace/instrumentation/servlet/dispatcher/RequestDispatcherDecorator.java +++ b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-common/src/main/java/datadog/trace/instrumentation/servlet/dispatcher/RequestDispatcherDecorator.java @@ -34,13 +34,12 @@ protected CharSequence component() { } @Override - public AgentSpan onError(final AgentSpan span, final Throwable throwable) { + public void onError(final AgentSpan span, final Throwable throwable) { if (throwable instanceof ServletException && throwable.getCause() != null) { super.onError(span, throwable.getCause()); } else { super.onError(span, throwable); } - return span; } public void injectContext(Context context, final C request, CarrierSetter setter) { diff --git a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-common/src/main/java/datadog/trace/instrumentation/servlet/dispatcher/RequestDispatcherInstrumentation.java b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-common/src/main/java/datadog/trace/instrumentation/servlet/dispatcher/RequestDispatcherInstrumentation.java index f112ba27f41..88b2ce98782 100644 --- a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-common/src/main/java/datadog/trace/instrumentation/servlet/dispatcher/RequestDispatcherInstrumentation.java +++ b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-common/src/main/java/datadog/trace/instrumentation/servlet/dispatcher/RequestDispatcherInstrumentation.java @@ -7,7 +7,6 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; import static datadog.trace.bootstrap.instrumentation.api.InstrumentationTags.SERVLET_CONTEXT; import static datadog.trace.bootstrap.instrumentation.api.InstrumentationTags.SERVLET_PATH; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; import static datadog.trace.instrumentation.servlet.ServletRequestSetter.SETTER; @@ -27,6 +26,7 @@ import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; +import datadog.trace.bootstrap.CallDepthThreadLocalMap; import datadog.trace.bootstrap.InstrumentationContext; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext; @@ -100,14 +100,19 @@ public static ContextScope start( // Don't want to generate a new top-level span return null; } + + final int depth = CallDepthThreadLocalMap.incrementCallDepth(RequestDispatcher.class); + if (depth > 0) { + return null; + } final AgentSpanContext parent; if (servletSpan == null || (parentSpan != null && servletSpan.isSameTrace(parentSpan))) { // Use the parentSpan if the servletSpan is null or part of the same trace. - parent = parentSpan.context(); + parent = parentSpan.spanContext(); } else { // parentSpan is part of a different trace, so lets ignore it. // This can happen with the way Tomcat does error handling. - parent = servletSpan.context(); + parent = servletSpan.spanContext(); } final AgentSpan span = @@ -130,7 +135,7 @@ public static ContextScope start( // temporarily replace from request to avoid spring resource name bubbling up: requestContext = request.getAttribute(DD_CONTEXT_ATTRIBUTE); - final ContextScope scope = getCurrentContext().with(span).attach(); + final ContextScope scope = span.attachWithContext(); // Set the context after activation so we have the proper Context object request.setAttribute(DD_CONTEXT_ATTRIBUTE, scope.context()); @@ -148,8 +153,12 @@ public static void stop( return; } - if (requestContext != null) { - request.setAttribute(DD_CONTEXT_ATTRIBUTE, requestContext); + try { + if (requestContext != null) { + request.setAttribute(DD_CONTEXT_ATTRIBUTE, requestContext); + } + } finally { + CallDepthThreadLocalMap.reset(RequestDispatcher.class); } final AgentSpan span = spanFromContext(scope.context()); diff --git a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-common/src/test/java/RequestDispatcherRecursionTest.java b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-common/src/test/java/RequestDispatcherRecursionTest.java new file mode 100644 index 00000000000..ea9f498909e --- /dev/null +++ b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-common/src/test/java/RequestDispatcherRecursionTest.java @@ -0,0 +1,195 @@ +import static datadog.trace.agent.test.utils.TraceUtils.runUnderTrace; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.agent.test.AbstractInstrumentationTest; +import java.io.IOException; +import java.lang.reflect.Proxy; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; +import javax.servlet.RequestDispatcher; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequestWrapper; +import javax.servlet.http.HttpServletResponse; +import org.junit.jupiter.api.Test; + +/** + * Regression test for the SAP Hybris/Spartacus StackOverflow reported in v1.63.0. + * + *

      Root cause: {@code RequestDispatcherAdvice.start()} calls {@code injectContext()} which calls + * {@code request.setAttribute()} for each propagation header. In some request wrappers (Hybris + * internals, SAP Commerce), {@code setAttribute()} internally triggers another {@code + * RequestDispatcher.forward()} call. Without a re-entrancy guard the advice recurses until {@code + * StackOverflowError}, visible in production as many "Failed to handle exception in instrumentation + * for ApplicationDispatcher" log entries. + * + *

      The fix is a {@code CallDepthThreadLocalMap} guard in {@code RequestDispatcherAdvice.start()} + * analogous to the one already present in {@code AsyncContextInstrumentation}. + */ +class RequestDispatcherRecursionTest extends AbstractInstrumentationTest { + + /** Minimal {@code RequestDispatcher} stub — instrumented by ByteBuddy via interface match. */ + static class TestDispatcher implements RequestDispatcher { + @Override + public void forward(ServletRequest req, ServletResponse resp) + throws ServletException, IOException {} + + @Override + public void include(ServletRequest req, ServletResponse resp) + throws ServletException, IOException {} + } + + /** + * {@code RequestDispatcher} with a non-trivial body simulating {@code ApplicationDispatcher} + * (Tomcat / SAP Commerce), which traverses a filter and valve chain adding significant call + * depth. + */ + static class RealisticDispatcher implements RequestDispatcher { + @Override + public void forward(ServletRequest req, ServletResponse resp) + throws ServletException, IOException { + simulateFilterChain(200); + } + + @Override + public void include(ServletRequest req, ServletResponse resp) + throws ServletException, IOException {} + + private static void simulateFilterChain(int depth) { + if (depth > 0) simulateFilterChain(depth - 1); + } + } + + /** Creates a proxy stub for {@code iface} where all methods return null / 0 / false. */ + @SuppressWarnings("unchecked") + static T nullStub(Class iface) { + return (T) + Proxy.newProxyInstance( + iface.getClassLoader(), + new Class[] {iface}, + (proxy, method, args) -> { + Class ret = method.getReturnType(); + if (ret == boolean.class) return false; + if (ret == int.class || ret == long.class) return 0; + return null; + }); + } + + @Test + void forward_doesNotRecurse_whenSetAttributeTriggersRedispatch() throws Exception { + TestDispatcher dispatcher = new TestDispatcher(); + HttpServletResponse response = nullStub(HttpServletResponse.class); + + AtomicInteger currentDepth = new AtomicInteger(0); + AtomicInteger maxDepth = new AtomicInteger(0); + + // Hybris-style wrapper: setAttribute() re-triggers a dispatch. Capped at depth 3 + // to bound total calls (≈ N^3, N ≈ 5 headers) and avoid OOM without the fix. + final int MAX_SETATTRIBUTE_DEPTH = 3; + HttpServletRequest recursiveRequest = + new HttpServletRequestWrapper(nullStub(HttpServletRequest.class)) { + @Override + public void setAttribute(String name, Object value) { + int depth = currentDepth.incrementAndGet(); + maxDepth.updateAndGet(d -> Math.max(d, depth)); + try { + super.setAttribute(name, value); + if (depth < MAX_SETATTRIBUTE_DEPTH) { + dispatcher.forward(this, response); + } + } catch (Exception | StackOverflowError ignored) { + } finally { + currentDepth.decrementAndGet(); + } + } + }; + + // runUnderTrace provides an active span; without one the advice exits before injectContext(). + runUnderTrace( + "test", + () -> { + dispatcher.forward(recursiveRequest, response); + return null; + }); + + assertTrue( + maxDepth.get() >= 1, + "advice did not call setAttribute() — check that TestDispatcher is instrumented" + + " by ByteBuddy and that runUnderTrace creates an active span"); + + assertEquals( + 1, + maxDepth.get(), + "setAttribute() was called recursively to depth " + + maxDepth.get() + + ". RequestDispatcherAdvice.start() needs a CallDepthThreadLocalMap guard " + + "(see AsyncContextInstrumentation for the pattern)."); + } + + /** + * Regression test for the production SOE scenario with a realistic dispatcher body. + * + *

      Without the fix, the recursive {@code setAttribute()} pattern in Hybris would fill the call + * stack, and the extra frames from {@code simulateFilterChain()} would tip it into a {@code + * StackOverflowError} from the method body — captured by {@code @Advice.Thrown} → {@code + * DECORATE.onError()} → {@code span.setTag("error.stack")}. + * + *

      With the {@code CallDepthThreadLocalMap} fix, re-entrant {@code forward()} calls return + * immediately from the enter advice (depth > 0), so the stack never saturates and no SOE is + * thrown. The test verifies exactly this: {@code capturedSoe} must be {@code null}. + */ + @Test + void forward_noSoe_withRealisticDispatcherBodyAndSetAttributeRecursion() throws Exception { + AtomicReference capturedSoe = new AtomicReference<>(); + AtomicBoolean soeSeen = new AtomicBoolean(false); // stops re-dispatching once SOE is caught + AtomicBoolean setAttributeInvoked = new AtomicBoolean(false); // guards against false-positive + + RealisticDispatcher dispatcher = new RealisticDispatcher(); + HttpServletResponse response = nullStub(HttpServletResponse.class); + + // Hybris-style wrapper: setAttribute() triggers a new forward(); no depth cap. + HttpServletRequest recursiveRequest = + new HttpServletRequestWrapper(nullStub(HttpServletRequest.class)) { + @Override + public void setAttribute(String name, Object value) { + super.setAttribute(name, value); + setAttributeInvoked.set(true); + if (soeSeen.get()) return; // already captured — stop recursing + try { + dispatcher.forward(this, response); + } catch (StackOverflowError soe) { + capturedSoe.compareAndSet(null, soe); + soeSeen.set(true); + throw soe; + } catch (Exception ignored) { + } + } + }; + + try { + runUnderTrace( + "test", + () -> { + dispatcher.forward(recursiveRequest, response); + return null; + }); + } catch (StackOverflowError ignored) { + // SOE may reach this level if it is not fully absorbed at inner levels. + } + + assertTrue( + setAttributeInvoked.get(), + "advice did not call setAttribute() — check that RealisticDispatcher is instrumented" + + " by ByteBuddy and that runUnderTrace creates an active span"); + + assertNull( + capturedSoe.get(), + "StackOverflowError was thrown — fix regression: CallDepthThreadLocalMap guard " + + "was removed from RequestDispatcherAdvice.start()"); + } +} diff --git a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-iast/gradle.lockfile b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-iast/gradle.lockfile index 54abb3e5c8e..d35e66a38dd 100644 --- a/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-iast/gradle.lockfile +++ b/dd-java-agent/instrumentation/servlet/javax-servlet/javax-servlet-iast/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:servlet:javax-servlet:javax-servlet-iast:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,13 +51,13 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath javax.servlet:servlet-api:2.3=compileClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -84,6 +88,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -101,14 +106,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/slick-3.2/gradle.lockfile b/dd-java-agent/instrumentation/slick-3.2/gradle.lockfile index 9e76c173a6f..8255c53779d 100644 --- a/dd-java-agent/instrumentation/slick-3.2/gradle.lockfile +++ b/dd-java-agent/instrumentation/slick-3.2/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:slick-3.2:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.eed3si9n:shaded-scalajson_2.13:1.0.0-M4=zinc com.eed3si9n:sjson-new-core_2.13:0.10.1=zinc com.eed3si9n:sjson-new-scalajson_2.13:0.10.1=zinc com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.h2database:h2:1.4.197=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -57,16 +61,15 @@ commons-fileupload:commons-fileupload:1.5=latestDepTestCompileClasspath,latestDe commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.openhft:zero-allocation-hashing:0.16=zinc net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -92,7 +95,7 @@ org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -101,7 +104,8 @@ org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspat org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -119,46 +123,46 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.scala-lang.modules:scala-collection-compat_2.13:2.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=zinc org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.11.12=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-lang:scala-library:2.13.15=zinc +org.scala-lang:scala-library:2.13.16=zinc org.scala-lang:scala-library:2.13.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.scala-lang:scala-reflect:2.13.15=zinc -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-lang:scala-reflect:2.13.16=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/slick-3.2/src/main/java/datadog/trace/instrumentation/slick/SlickRunnableInstrumentation.java b/dd-java-agent/instrumentation/slick-3.2/src/main/java/datadog/trace/instrumentation/slick/SlickRunnableInstrumentation.java index 7cc9adb13b5..c4e6fb7b5fd 100644 --- a/dd-java-agent/instrumentation/slick-3.2/src/main/java/datadog/trace/instrumentation/slick/SlickRunnableInstrumentation.java +++ b/dd-java-agent/instrumentation/slick-3.2/src/main/java/datadog/trace/instrumentation/slick/SlickRunnableInstrumentation.java @@ -7,11 +7,11 @@ import static net.bytebuddy.matcher.ElementMatchers.takesNoArguments; import com.google.auto.service.AutoService; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.bootstrap.ContextStore; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.java.concurrent.AdviceUtils; import datadog.trace.bootstrap.instrumentation.java.concurrent.State; import java.util.Collections; @@ -58,14 +58,14 @@ public static void capture(@Advice.This Runnable zis) { public static final class Run { @Advice.OnMethodEnter(suppress = Throwable.class) - public static AgentScope enter(@Advice.This final Runnable zis) { + public static ContextScope enter(@Advice.This final Runnable zis) { final ContextStore contextStore = InstrumentationContext.get(Runnable.class, State.class); return AdviceUtils.startTaskScope(contextStore, zis); } @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) - public static void exit(@Advice.Enter final AgentScope scope) { + public static void exit(@Advice.Enter final ContextScope scope) { AdviceUtils.endTaskScope(scope); } } diff --git a/dd-java-agent/instrumentation/snakeyaml-1.33/gradle.lockfile b/dd-java-agent/instrumentation/snakeyaml-1.33/gradle.lockfile index 842140792aa..f214c9e4994 100644 --- a/dd-java-agent/instrumentation/snakeyaml-1.33/gradle.lockfile +++ b/dd-java-agent/instrumentation/snakeyaml-1.33/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:snakeyaml-1.33:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/sofarpc/sofarpc-5.0/build.gradle b/dd-java-agent/instrumentation/sofarpc/sofarpc-5.0/build.gradle index bb063fa43be..1d7ef979c0d 100644 --- a/dd-java-agent/instrumentation/sofarpc/sofarpc-5.0/build.gradle +++ b/dd-java-agent/instrumentation/sofarpc/sofarpc-5.0/build.gradle @@ -11,10 +11,6 @@ apply from: "$rootDir/gradle/java.gradle" addTestSuiteForDir('latestDepTest', 'test') -configurations.testRuntimeClasspath { - resolutionStrategy.force "com.google.guava:guava:32.1.3-jre" -} - dependencies { compileOnly group: "com.alipay.sofa", name: "sofa-rpc-all", version: "5.6.0" @@ -29,7 +25,25 @@ dependencies { testImplementation group: "io.grpc", name: "grpc-stub", version: "1.53.0" testImplementation group: "com.google.protobuf", name: "protobuf-java", version: "3.25.3" testImplementation group: "com.alibaba", name: "fastjson", version: "1.2.83" - testImplementation group: "com.google.guava", name: "guava", version: "32.1.3-jre" latestDepTestImplementation group: "com.alipay.sofa", name: "sofa-rpc-all", version: "+" + + constraints { + // Regression fix for Gradle 9.6.0 (should be fixed in 9.7.0) + // + // The `sofa-rpc-all:5.14.2` brings `netty-all:4.1.44.Final`, which is a fat jar, + // while `grpc-netty:1.53.0` brings individual `netty-*:4.1.79.Final` modules. + // Gradle 9.6.0 introduced a regression in the classpath ordering, as they are + // working on revamping the dependency traversal. The result is that the `4.1.44` + // fat jar classes appear earlier and its classes are loaded from it ; this + // produces a `NoSuchMethodError` at runtime in netty's `AbstractReferenceCountedByteBuf`. + // + // The workaround is to force `netty-all` to `4.1.79` so the fat jar and the individual + // modules are aligned on the same version. This should be fixed in 9.7.0 and consequently + // removed from the constraints. + // See https://github.com/gradle/gradle/issues/38057 for more details. + testImplementation("io.netty:netty-all:4.1.79.Final") { + because "sofa-rpc-all brings netty-all:4.1.44.Final (fat jar) while grpc-netty brings individual netty-*:4.1.79.Final modules; Gradle 9.6.0 classpath ordering regression causes 4.1.44 classes to shadow 4.1.79, producing NoSuchMethodError" + } + } } diff --git a/dd-java-agent/instrumentation/sofarpc/sofarpc-5.0/gradle.lockfile b/dd-java-agent/instrumentation/sofarpc/sofarpc-5.0/gradle.lockfile index d7c54f5df0e..ad4e6f7f1dc 100644 --- a/dd-java-agent/instrumentation/sofarpc/sofarpc-5.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/sofarpc/sofarpc-5.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:sofarpc:sofarpc-5.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -14,14 +15,15 @@ com.alipay.sofa:bolt:1.5.2=compileClasspath com.alipay.sofa:bolt:1.6.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.alipay.sofa:hessian:3.3.6=compileClasspath com.alipay.sofa:hessian:3.5.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.alipay.sofa:sofa-rpc-all:5.14.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.alipay.sofa:sofa-rpc-all:5.14.2=testCompileClasspath,testRuntimeClasspath +com.alipay.sofa:sofa-rpc-all:5.14.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.alipay.sofa:sofa-rpc-all:5.6.0=compileClasspath com.alipay.sofa:tracer-core:2.1.2=compileClasspath com.alipay.sofa:tracer-core:3.1.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -44,15 +46,15 @@ com.github.fge:jackson-coreutils:1.6=compileClasspath,latestDepTestCompileClassp com.github.fge:json-patch:1.9=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.fge:msg-simple:1.1=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.android:annotations:4.1.1.4=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -67,21 +69,22 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.code.gson:gson:2.9.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.errorprone:error_prone_annotations:2.21.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:16.0.1=compileClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:32.1.3-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.http-client:google-http-client-gson:1.41.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.http-client:google-http-client:1.41.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.j2objc:j2objc-annotations:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath +com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.protobuf:protobuf-java-util:3.21.7=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.protobuf:protobuf-java:3.25.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.re2j:re2j:1.6=latestDepTestCompileClasspath,testCompileClasspath -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -116,17 +119,35 @@ io.grpc:grpc-testing:1.53.0=latestDepTestCompileClasspath,latestDepTestRuntimeCl io.grpc:grpc-xds:1.53.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath io.netty:netty-all:4.1.32.Final=compileClasspath -io.netty:netty-all:4.1.44.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-all:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-buffer:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-codec-dns:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-codec-haproxy:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-codec-http2:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-codec-http:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-socks:4.1.79.Final=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.netty:netty-codec-memcache:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-codec-mqtt:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-codec-redis:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-codec-smtp:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-codec-socks:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-codec-stomp:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-codec-xml:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-codec:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-common:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-handler-proxy:4.1.79.Final=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.netty:netty-handler-proxy:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-handler:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-resolver-dns-classes-macos:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-resolver-dns-native-macos:4.1.79.Final=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.netty:netty-resolver-dns:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-resolver:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-transport-classes-epoll:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-transport-classes-kqueue:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-transport-native-epoll:4.1.79.Final=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.netty:netty-transport-native-kqueue:4.1.79.Final=latestDepTestRuntimeClasspath,testRuntimeClasspath io.netty:netty-transport-native-unix-common:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-transport-rxtx:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-transport-sctp:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +io.netty:netty-transport-udt:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.1.79.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.opencensus:opencensus-api:0.28.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.opencensus:opencensus-contrib-http-util:0.28.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -136,7 +157,7 @@ io.opentracing:opentracing-mock:0.22.0=compileClasspath,latestDepTestCompileClas io.opentracing:opentracing-noop:0.22.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentracing:opentracing-util:0.22.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.perfmark:perfmark-api:0.25.0=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath io.swagger:swagger-annotations:1.6.9=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.swagger:swagger-core:1.6.9=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.swagger:swagger-models:1.6.9=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -148,8 +169,8 @@ javax.validation:validation-api:2.0.1.Final=compileClasspath,latestDepTestCompil javax.ws.rs:javax.ws.rs-api:2.1.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.jcip:jcip-annotations:1.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -161,6 +182,7 @@ org.apache.commons:commons-compress:1.26.0=latestDepTestCompileClasspath,latestD org.apache.commons:commons-lang3:3.14.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.apache.commons:commons-lang3:3.19.0=spotbugs org.apache.commons:commons-text:1.14.0=spotbugs +org.apache.fory:fory-core:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.httpcomponents:httpclient:4.5.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.apache.httpcomponents:httpclient:4.5.4=compileClasspath org.apache.httpcomponents:httpcore:4.4.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -170,7 +192,6 @@ org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=latestDepTestCompileClasspath,testCompileClasspath org.checkerframework:checker-qual:3.33.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -org.checkerframework:checker-qual:3.37.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc @@ -200,6 +221,7 @@ org.jboss.spec.javax.ws.rs:jboss-jaxrs-api_2.1_spec:1.0.2.Final=compileClasspath org.jboss.spec.javax.xml.bind:jboss-jaxb-api_2.3_spec:1.0.1.Final=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -217,14 +239,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.2=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/sofarpc/sofarpc-5.0/src/main/java/datadog/trace/instrumentation/sofarpc/SofaRpcClientDecorator.java b/dd-java-agent/instrumentation/sofarpc/sofarpc-5.0/src/main/java/datadog/trace/instrumentation/sofarpc/SofaRpcClientDecorator.java index 4e9cc7e29f9..a626be864dd 100644 --- a/dd-java-agent/instrumentation/sofarpc/sofarpc-5.0/src/main/java/datadog/trace/instrumentation/sofarpc/SofaRpcClientDecorator.java +++ b/dd-java-agent/instrumentation/sofarpc/sofarpc-5.0/src/main/java/datadog/trace/instrumentation/sofarpc/SofaRpcClientDecorator.java @@ -39,10 +39,10 @@ protected String service() { return null; } - public AgentSpan onRequest(AgentSpan span, SofaRequest request) { + public void onRequest(AgentSpan span, SofaRequest request) { span.setTag("rpc.system", "sofarpc"); if (request == null) { - return span; + return; } String serviceName = request.getTargetServiceUniqueName(); String methodName = request.getMethodName(); @@ -54,14 +54,12 @@ public AgentSpan onRequest(AgentSpan span, SofaRequest request) { } else if (methodName != null) { span.setResourceName(methodName); } - return span; } - public AgentSpan onResponse(AgentSpan span, SofaResponse response) { + public void onResponse(AgentSpan span, SofaResponse response) { if (response != null && response.isError()) { span.setError(true); span.setTag("error.message", response.getErrorMsg()); } - return span; } } diff --git a/dd-java-agent/instrumentation/sofarpc/sofarpc-5.0/src/main/java/datadog/trace/instrumentation/sofarpc/SofaRpcServerDecorator.java b/dd-java-agent/instrumentation/sofarpc/sofarpc-5.0/src/main/java/datadog/trace/instrumentation/sofarpc/SofaRpcServerDecorator.java index 7fbbe329934..09097dbdfe7 100644 --- a/dd-java-agent/instrumentation/sofarpc/sofarpc-5.0/src/main/java/datadog/trace/instrumentation/sofarpc/SofaRpcServerDecorator.java +++ b/dd-java-agent/instrumentation/sofarpc/sofarpc-5.0/src/main/java/datadog/trace/instrumentation/sofarpc/SofaRpcServerDecorator.java @@ -35,15 +35,15 @@ protected CharSequence spanType() { } @Override - public AgentSpan afterStart(AgentSpan span) { + public void afterStart(AgentSpan span) { span.setMeasured(true); - return super.afterStart(span); + super.afterStart(span); } - public AgentSpan onRequest(AgentSpan span, SofaRequest request) { + public void onRequest(AgentSpan span, SofaRequest request) { span.setTag("rpc.system", "sofarpc"); if (request == null) { - return span; + return; } String serviceName = request.getTargetServiceUniqueName(); String methodName = request.getMethodName(); @@ -54,12 +54,11 @@ public AgentSpan onRequest(AgentSpan span, SofaRequest request) { } else if (methodName != null) { span.setResourceName(methodName); } - return span; } - public AgentSpan onResponse(AgentSpan span, SofaResponse response) { + public void onResponse(AgentSpan span, SofaResponse response) { if (response == null) { - return span; + return; } if (response.isError()) { // RPC-layer error (timeout, serialization failure, etc.) @@ -71,6 +70,5 @@ public AgentSpan onResponse(AgentSpan span, SofaResponse response) { span.setError(true); span.setTag("error.message", t.getMessage()); } - return span; } } diff --git a/dd-java-agent/instrumentation/spark/spark-common/build.gradle b/dd-java-agent/instrumentation/spark/spark-common/build.gradle index f19ebd38b4a..224484243e8 100644 --- a/dd-java-agent/instrumentation/spark/spark-common/build.gradle +++ b/dd-java-agent/instrumentation/spark/spark-common/build.gradle @@ -29,5 +29,9 @@ dependencies { testImplementation project(':dd-java-agent:instrumentation-testing') testImplementation group: 'org.apache.spark', name: 'spark-launcher_2.12', version: '2.4.0' + testImplementation libs.bundles.junit5 + testImplementation libs.bundles.mockito + testImplementation group: 'org.apache.spark', name: 'spark-core_2.12', version: '2.4.0' + testImplementation group: 'org.apache.spark', name: 'spark-sql_2.12', version: '2.4.0' } diff --git a/dd-java-agent/instrumentation/spark/spark-common/src/main/java/datadog/trace/instrumentation/spark/AbstractDatadogSparkListener.java b/dd-java-agent/instrumentation/spark/spark-common/src/main/java/datadog/trace/instrumentation/spark/AbstractDatadogSparkListener.java index 292719f31fd..2f033394a53 100644 --- a/dd-java-agent/instrumentation/spark/spark-common/src/main/java/datadog/trace/instrumentation/spark/AbstractDatadogSparkListener.java +++ b/dd-java-agent/instrumentation/spark/spark-common/src/main/java/datadog/trace/instrumentation/spark/AbstractDatadogSparkListener.java @@ -191,8 +191,7 @@ public void setupOpenLineage(DDTraceId traceId) { openLineageSparkConf.set( "spark.openlineage.transport.transports.agent.endpoint", AGENT_OL_ENDPOINT); openLineageSparkConf.set("spark.openlineage.transport.transports.agent.compression", "gzip"); - openLineageSparkConf.set( - "spark.openlineage.run.tags", + String runTags = "_dd.trace_id:" + traceId.toString() + ";_dd.ol_intake.emit_spans:false;_dd.ol_service:" @@ -200,7 +199,17 @@ public void setupOpenLineage(DDTraceId traceId) { + ";_dd.ol_intake.process_tags:" + ProcessTags.getTagsForSerialization() + ";_dd.ol_app_id:" - + appId); + + appId; + // _dd.ol_env carries the run environment so the lineage-processor can use it + // as the Spark application's UGP namespace, letting the OpenLineage-created + // node and the tracer-only node (djm-span-processor) resolve to the same + // entity_id. Omitted when env is unset so the consumer falls back to the + // OpenLineage namespace. + String olEnv = Config.get().getEnv(); + if (!olEnv.isEmpty()) { + runTags += ";_dd.ol_env:" + olEnv; + } + openLineageSparkConf.set("spark.openlineage.run.tags", runTags); setupOpenLineageCircuitBreaker(); return; } @@ -478,12 +487,12 @@ private AgentSpan getOrCreateSqlSpan( if (batchKey != null) { AgentSpan batchSpan = getOrCreateStreamingBatchSpan(batchKey, queryStart.time(), jobProperties); - spanBuilder.asChildOf(batchSpan.context()); + spanBuilder.asChildOf(batchSpan.spanContext()); } else if (isRunningOnDatabricks) { addDatabricksSpecificTags(spanBuilder, jobProperties, true); } else { initApplicationSpanIfNotInitialized(); - spanBuilder.asChildOf(applicationSpan.context()); + spanBuilder.asChildOf(applicationSpan.spanContext()); } AgentSpan sqlSpan = spanBuilder.start(); @@ -523,18 +532,18 @@ public synchronized void onJobStart(SparkListenerJobStart jobStart) { * spark.job */ if (sqlSpan != null) { - jobSpanBuilder.asChildOf(sqlSpan.context()); + jobSpanBuilder.asChildOf(sqlSpan.spanContext()); } else if (batchKey != null) { isStreamingJob = true; AgentSpan batchSpan = getOrCreateStreamingBatchSpan(batchKey, jobStart.time(), jobStart.properties()); - jobSpanBuilder.asChildOf(batchSpan.context()); + jobSpanBuilder.asChildOf(batchSpan.spanContext()); } else if (isRunningOnDatabricks) { addDatabricksSpecificTags(jobSpanBuilder, jobStart.properties(), true); } else { // In non-databricks, non-streaming env, the spark application is the local root span initApplicationSpanIfNotInitialized(); - jobSpanBuilder.asChildOf(applicationSpan.context()); + jobSpanBuilder.asChildOf(applicationSpan.spanContext()); } jobSpanBuilder.withTag(DDTags.RESOURCE_NAME, getSparkJobName(jobStart)); @@ -623,7 +632,7 @@ public synchronized void onStageSubmitted(SparkListenerStageSubmitted stageSubmi AgentSpan stageSpan = buildSparkSpan("spark.stage", stageSubmitted.properties()) - .asChildOf(jobSpan.context()) + .asChildOf(jobSpan.spanContext()) .withStartTimestamp(submissionTimeMs * 1000) .withTag("stage_id", stageId) .withTag( @@ -778,7 +787,7 @@ private void sendTaskSpan( AgentSpan stageSpan, SparkListenerTaskEnd taskEnd, Properties properties) { AgentSpan taskSpan = buildSparkSpan("spark.task", properties) - .asChildOf(stageSpan.context()) + .asChildOf(stageSpan.spanContext()) .withStartTimestamp(taskEnd.taskInfo().launchTime() * 1000) .withTag("task_id", taskEnd.taskInfo().taskId()) .withTag("task_attempt_id", taskEnd.taskInfo().attemptNumber()) @@ -1092,7 +1101,7 @@ private void setDataJobsSamplingPriority(AgentSpan span) { private AgentTracer.SpanBuilder buildSparkSpan(String spanName, Properties properties) { AgentTracer.SpanBuilder builder = - tracer.buildSpan(spanName).withSpanType("spark").withTag("app_id", appId); + tracer.buildSpan("spark", spanName).withSpanType("spark").withTag("app_id", appId); if (databricksServiceName != null) { builder.withServiceName(databricksServiceName); diff --git a/dd-java-agent/instrumentation/spark/spark-common/src/main/java/datadog/trace/instrumentation/spark/AbstractSparkInstrumentation.java b/dd-java-agent/instrumentation/spark/spark-common/src/main/java/datadog/trace/instrumentation/spark/AbstractSparkInstrumentation.java index 50f8a0275b7..8b5368aafd2 100644 --- a/dd-java-agent/instrumentation/spark/spark-common/src/main/java/datadog/trace/instrumentation/spark/AbstractSparkInstrumentation.java +++ b/dd-java-agent/instrumentation/spark/spark-common/src/main/java/datadog/trace/instrumentation/spark/AbstractSparkInstrumentation.java @@ -120,7 +120,7 @@ public static void enter() { } } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void exit(@Advice.Thrown Throwable throwable) { if (AbstractDatadogSparkListener.listener != null) { AbstractDatadogSparkListener.listener.finishApplication( @@ -142,7 +142,7 @@ public static void enter(@Advice.Argument(1) int exitCode, @Advice.Argument(2) S } public static class SparkSqlFailureAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void exit(@Advice.Thrown Throwable throwable) { if (throwable != null && AbstractDatadogSparkListener.listener != null) { AbstractDatadogSparkListener.listener.onSqlFailure(throwable); @@ -151,7 +151,7 @@ public static void exit(@Advice.Thrown Throwable throwable) { } public static class QueryExecutionFailureAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void exit(@Advice.Thrown Throwable throwable) { if (throwable != null && AbstractDatadogSparkListener.listener != null) { AbstractDatadogSparkListener.listener.onSqlFailure(throwable); diff --git a/dd-java-agent/instrumentation/spark/spark-common/src/main/java/datadog/trace/instrumentation/spark/SparkLauncherInstrumentation.java b/dd-java-agent/instrumentation/spark/spark-common/src/main/java/datadog/trace/instrumentation/spark/SparkLauncherInstrumentation.java index 61686f390ac..96f0494b7c1 100644 --- a/dd-java-agent/instrumentation/spark/spark-common/src/main/java/datadog/trace/instrumentation/spark/SparkLauncherInstrumentation.java +++ b/dd-java-agent/instrumentation/spark/spark-common/src/main/java/datadog/trace/instrumentation/spark/SparkLauncherInstrumentation.java @@ -48,7 +48,7 @@ public void methodAdvice(MethodTransformer transformer) { } public static class StartApplicationAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void exit( @Advice.This Object launcher, @Advice.Return SparkAppHandle handle, diff --git a/dd-java-agent/instrumentation/spark/spark-common/src/main/java/datadog/trace/instrumentation/spark/SparkLauncherListener.java b/dd-java-agent/instrumentation/spark/spark-common/src/main/java/datadog/trace/instrumentation/spark/SparkLauncherListener.java index c926b42b1ef..643953b22c8 100644 --- a/dd-java-agent/instrumentation/spark/spark-common/src/main/java/datadog/trace/instrumentation/spark/SparkLauncherListener.java +++ b/dd-java-agent/instrumentation/spark/spark-common/src/main/java/datadog/trace/instrumentation/spark/SparkLauncherListener.java @@ -38,7 +38,7 @@ public static synchronized void createLauncherSpan(Object launcher) { AgentTracer.TracerAPI tracer = AgentTracer.get(); AgentSpan span = tracer - .buildSpan("spark.launcher.launch") + .buildSpan("spark-launcher", "spark.launcher.launch") .withSpanType("spark") .withResourceName("SparkLauncher.startApplication") .start(); diff --git a/dd-java-agent/instrumentation/spark/spark-common/src/test/groovy/datadog/trace/instrumentation/spark/SparkLauncherTest.groovy b/dd-java-agent/instrumentation/spark/spark-common/src/test/groovy/datadog/trace/instrumentation/spark/SparkLauncherTest.groovy index f7a5b5a9601..eb26699c1e6 100644 --- a/dd-java-agent/instrumentation/spark/spark-common/src/test/groovy/datadog/trace/instrumentation/spark/SparkLauncherTest.groovy +++ b/dd-java-agent/instrumentation/spark/spark-common/src/test/groovy/datadog/trace/instrumentation/spark/SparkLauncherTest.groovy @@ -100,7 +100,7 @@ class SparkLauncherTest extends InstrumentationSpecification { SparkLauncherListener.launcherSpan = null def tracer = AgentTracer.get() SparkLauncherListener.launcherSpan = tracer - .buildSpan("spark.launcher.launch") + .buildSpan("spark-launcher", "spark.launcher.launch") .withSpanType("spark") .withResourceName("SparkLauncher.startApplication") .start() @@ -135,7 +135,7 @@ class SparkLauncherTest extends InstrumentationSpecification { SparkLauncherListener.launcherSpan = null def tracer = AgentTracer.get() SparkLauncherListener.launcherSpan = tracer - .buildSpan("spark.launcher.launch") + .buildSpan("spark-launcher", "spark.launcher.launch") .withSpanType("spark") .withResourceName("SparkLauncher.startApplication") .start() @@ -167,7 +167,7 @@ class SparkLauncherTest extends InstrumentationSpecification { SparkLauncherListener.launcherSpan = null def tracer = AgentTracer.get() SparkLauncherListener.launcherSpan = tracer - .buildSpan("spark.launcher.launch") + .buildSpan("spark-launcher", "spark.launcher.launch") .withSpanType("spark") .withResourceName("SparkLauncher.startApplication") .start() diff --git a/dd-java-agent/instrumentation/spark/spark-common/src/test/java/datadog/trace/instrumentation/spark/SetupOpenLineageTest.java b/dd-java-agent/instrumentation/spark/spark-common/src/test/java/datadog/trace/instrumentation/spark/SetupOpenLineageTest.java new file mode 100644 index 00000000000..372cd3c10b7 --- /dev/null +++ b/dd-java-agent/instrumentation/spark/spark-common/src/test/java/datadog/trace/instrumentation/spark/SetupOpenLineageTest.java @@ -0,0 +1,133 @@ +package datadog.trace.instrumentation.spark; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.mockStatic; +import static org.mockito.Mockito.when; + +import datadog.trace.api.Config; +import datadog.trace.api.DDTraceId; +import java.lang.reflect.Field; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import org.apache.spark.SparkConf; +import org.apache.spark.executor.TaskMetrics; +import org.apache.spark.scheduler.SparkListenerInterface; +import org.apache.spark.scheduler.SparkListenerJobStart; +import org.apache.spark.scheduler.StageInfo; +import org.apache.spark.sql.execution.SparkPlanInfo; +import org.apache.spark.sql.execution.metric.SQLMetricInfo; +import org.apache.spark.util.AccumulatorV2; +import org.junit.jupiter.api.Test; +import org.mockito.MockedStatic; + +class SetupOpenLineageTest { + + private static TestListener newListenerWithOpenLineage() { + TestListener listener = new TestListener(new SparkConf(), "some_app_id", "some_version"); + // The constructor registers a JVM shutdown hook that finishes the application trace. In a plain + // unit test there is no registered tracer, so that hook would NPE at JVM exit. Mark the + // application as already ended so the hook short-circuits. + markApplicationEnded(listener); + listener.openLineageSparkListener = mock(SparkListenerInterface.class); + listener.openLineageSparkConf = new SparkConf(); + return listener; + } + + private static void markApplicationEnded(AbstractDatadogSparkListener listener) { + try { + Field applicationEnded = + AbstractDatadogSparkListener.class.getDeclaredField("applicationEnded"); + applicationEnded.setAccessible(true); + applicationEnded.setBoolean(listener, true); + } catch (ReflectiveOperationException e) { + throw new IllegalStateException("Could not mark application as ended", e); + } + } + + private static List runTags(TestListener listener) { + return Arrays.asList( + listener.openLineageSparkConf.get("spark.openlineage.run.tags").split(";")); + } + + @Test + void addsOlEnvTagWhenEnvIsSet() { + TestListener listener = newListenerWithOpenLineage(); + + Config config = mock(Config.class); + when(config.getEnv()).thenReturn("my-env"); + try (MockedStatic configMock = mockStatic(Config.class)) { + configMock.when(Config::get).thenReturn(config); + listener.setupOpenLineage(mock(DDTraceId.class)); + } + + assertTrue(runTags(listener).contains("_dd.ol_env:my-env")); + } + + @Test + void omitsOlEnvTagWhenEnvIsEmpty() { + TestListener listener = newListenerWithOpenLineage(); + + Config config = mock(Config.class); + when(config.getEnv()).thenReturn(""); + try (MockedStatic configMock = mockStatic(Config.class)) { + configMock.when(Config::get).thenReturn(config); + listener.setupOpenLineage(mock(DDTraceId.class)); + } + + assertFalse( + runTags(listener).stream().anyMatch(tag -> tag.startsWith("_dd.ol_env:")), + "No _dd.ol_env tag should be set when env is empty"); + } + + /** + * Minimal concrete listener so the version-agnostic {@link + * AbstractDatadogSparkListener#setupOpenLineage} logic can be exercised without a running Spark + * context. The scala-version-specific abstract methods are irrelevant here and return empty + * results. + */ + private static class TestListener extends AbstractDatadogSparkListener { + TestListener(SparkConf sparkConf, String appId, String sparkVersion) { + super(sparkConf, appId, sparkVersion); + } + + @Override + protected String getSparkJobName(SparkListenerJobStart jobStart) { + return null; + } + + @Override + protected ArrayList getSparkJobStageIds(SparkListenerJobStart jobStart) { + return new ArrayList<>(); + } + + @Override + protected int getStageCount(SparkListenerJobStart jobStart) { + return 0; + } + + @Override + protected Collection getPlanInfoChildren(SparkPlanInfo info) { + return Collections.emptyList(); + } + + @Override + protected List getPlanInfoMetrics(SparkPlanInfo info) { + return Collections.emptyList(); + } + + @Override + protected int[] getStageParentIds(StageInfo info) { + return new int[0]; + } + + @Override + protected List getExternalAccumulators(TaskMetrics metrics) { + return Collections.emptyList(); + } + } +} diff --git a/dd-java-agent/instrumentation/spark/spark-common/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/dd-java-agent/instrumentation/spark/spark-common/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker new file mode 100644 index 00000000000..1f0955d450f --- /dev/null +++ b/dd-java-agent/instrumentation/spark/spark-common/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker @@ -0,0 +1 @@ +mock-maker-inline diff --git a/dd-java-agent/instrumentation/spark/spark-common/src/testFixtures/groovy/datadog/trace/instrumentation/spark/AbstractSparkStructuredStreamingTest.groovy b/dd-java-agent/instrumentation/spark/spark-common/src/testFixtures/groovy/datadog/trace/instrumentation/spark/AbstractSparkStructuredStreamingTest.groovy index ebad7aec0bd..21698955136 100644 --- a/dd-java-agent/instrumentation/spark/spark-common/src/testFixtures/groovy/datadog/trace/instrumentation/spark/AbstractSparkStructuredStreamingTest.groovy +++ b/dd-java-agent/instrumentation/spark/spark-common/src/testFixtures/groovy/datadog/trace/instrumentation/spark/AbstractSparkStructuredStreamingTest.groovy @@ -92,8 +92,8 @@ class AbstractSparkStructuredStreamingTest extends InstrumentationSpecification resourceName "test-query" spanType "spark" parent() - assert span.context().getSamplingPriority() == PrioritySampling.USER_KEEP - assert span.context().getPropagationTags().createTagMap()["_dd.p.dm"] == (-SamplingMechanism.DATA_JOBS).toString() + assert span.spanContext().getSamplingPriority() == PrioritySampling.USER_KEEP + assert span.spanContext().getPropagationTags().createTagMap()["_dd.p.dm"] == (-SamplingMechanism.DATA_JOBS).toString() tags { defaultTags() // Streaming tags @@ -201,8 +201,8 @@ class AbstractSparkStructuredStreamingTest extends InstrumentationSpecification operationName "spark.streaming_batch" spanType "spark" assert span.tags["streaming_query.batch_id"] == 1 - assert span.context().getSamplingPriority() == PrioritySampling.USER_KEEP - assert span.context().getPropagationTags().createTagMap()["_dd.p.dm"] == (-SamplingMechanism.DATA_JOBS).toString() + assert span.spanContext().getSamplingPriority() == PrioritySampling.USER_KEEP + assert span.spanContext().getPropagationTags().createTagMap()["_dd.p.dm"] == (-SamplingMechanism.DATA_JOBS).toString() parent() } span { diff --git a/dd-java-agent/instrumentation/spark/spark-common/src/testFixtures/groovy/datadog/trace/instrumentation/spark/AbstractSparkTest.groovy b/dd-java-agent/instrumentation/spark/spark-common/src/testFixtures/groovy/datadog/trace/instrumentation/spark/AbstractSparkTest.groovy index 95748c054d3..f311d437a84 100644 --- a/dd-java-agent/instrumentation/spark/spark-common/src/testFixtures/groovy/datadog/trace/instrumentation/spark/AbstractSparkTest.groovy +++ b/dd-java-agent/instrumentation/spark/spark-common/src/testFixtures/groovy/datadog/trace/instrumentation/spark/AbstractSparkTest.groovy @@ -58,9 +58,9 @@ abstract class AbstractSparkTest extends InstrumentationSpecification { resourceName "spark.application" spanType "spark" errored false - assert span.context().getTraceId() != DDTraceId.ZERO - assert span.context().getSamplingPriority() == PrioritySampling.USER_KEEP - assert span.context().getPropagationTags().createTagMap()["_dd.p.dm"] == (-SamplingMechanism.DATA_JOBS).toString() + assert span.spanContext().getTraceId() != DDTraceId.ZERO + assert span.spanContext().getSamplingPriority() == PrioritySampling.USER_KEEP + assert span.spanContext().getPropagationTags().createTagMap()["_dd.p.dm"] == (-SamplingMechanism.DATA_JOBS).toString() parent() } span { @@ -363,8 +363,8 @@ abstract class AbstractSparkTest extends InstrumentationSpecification { spanType "spark" traceId 8944764253919609482G parentSpanId 15104224823446433673G - assert span.context().getSamplingPriority() == PrioritySampling.USER_KEEP - assert span.context().getPropagationTags().createTagMap()["_dd.p.dm"] == (-SamplingMechanism.DATA_JOBS).toString() + assert span.spanContext().getSamplingPriority() == PrioritySampling.USER_KEEP + assert span.spanContext().getPropagationTags().createTagMap()["_dd.p.dm"] == (-SamplingMechanism.DATA_JOBS).toString() assert span.tags["databricks_job_id"] == "1234" assert span.tags["databricks_job_run_id"] == "5678" assert span.tags["databricks_task_run_id"] == "9012" @@ -386,8 +386,8 @@ abstract class AbstractSparkTest extends InstrumentationSpecification { spanType "spark" traceId 5240384461065211484G parentSpanId 14128229261586201946G - assert span.context().getSamplingPriority() == PrioritySampling.USER_KEEP - assert span.context().getPropagationTags().createTagMap()["_dd.p.dm"] == (-SamplingMechanism.DATA_JOBS).toString() + assert span.spanContext().getSamplingPriority() == PrioritySampling.USER_KEEP + assert span.spanContext().getPropagationTags().createTagMap()["_dd.p.dm"] == (-SamplingMechanism.DATA_JOBS).toString() assert span.tags["databricks_job_id"] == "3456" assert span.tags["databricks_job_run_id"] == "901" assert span.tags["databricks_task_run_id"] == "7890" @@ -409,8 +409,8 @@ abstract class AbstractSparkTest extends InstrumentationSpecification { spanType "spark" traceId 2235374731114184741G parentSpanId 8956125882166502063G - assert span.context().getSamplingPriority() == PrioritySampling.USER_KEEP - assert span.context().getPropagationTags().createTagMap()["_dd.p.dm"] == (-SamplingMechanism.DATA_JOBS).toString() + assert span.spanContext().getSamplingPriority() == PrioritySampling.USER_KEEP + assert span.spanContext().getPropagationTags().createTagMap()["_dd.p.dm"] == (-SamplingMechanism.DATA_JOBS).toString() assert span.tags["databricks_job_id"] == "123" assert span.tags["databricks_job_run_id"] == "8765" assert span.tags["databricks_task_run_id"] == "456" @@ -431,8 +431,8 @@ abstract class AbstractSparkTest extends InstrumentationSpecification { operationName "spark.job" spanType "spark" parent() - assert span.context().getSamplingPriority() == PrioritySampling.USER_KEEP - assert span.context().getPropagationTags().createTagMap()["_dd.p.dm"] == (-SamplingMechanism.DATA_JOBS).toString() + assert span.spanContext().getSamplingPriority() == PrioritySampling.USER_KEEP + assert span.spanContext().getPropagationTags().createTagMap()["_dd.p.dm"] == (-SamplingMechanism.DATA_JOBS).toString() assert span.tags["databricks_job_id"] == null assert span.tags["databricks_job_run_id"] == "8765" assert span.tags["databricks_task_run_id"] == null @@ -590,8 +590,8 @@ abstract class AbstractSparkTest extends InstrumentationSpecification { spanType "spark" traceId 8944764253919609482G parentSpanId 15104224823446433673G - assert span.context().getSamplingPriority() == PrioritySampling.USER_KEEP - assert span.context().getPropagationTags().createTagMap()["_dd.p.dm"] == (-SamplingMechanism.DATA_JOBS).toString() + assert span.spanContext().getSamplingPriority() == PrioritySampling.USER_KEEP + assert span.spanContext().getPropagationTags().createTagMap()["_dd.p.dm"] == (-SamplingMechanism.DATA_JOBS).toString() } span { operationName "spark.job" diff --git a/dd-java-agent/instrumentation/spark/spark-executor-common/gradle.lockfile b/dd-java-agent/instrumentation/spark/spark-executor-common/gradle.lockfile index 9d72a9f4608..0ac56f6e492 100644 --- a/dd-java-agent/instrumentation/spark/spark-executor-common/gradle.lockfile +++ b/dd-java-agent/instrumentation/spark/spark-executor-common/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:spark:spark-executor-common:dependencies --write-locks aopalliance:aopalliance:1.0=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath @@ -12,7 +13,7 @@ com.clearspring.analytics:stream:2.7.0=baseTestCompileClasspath,baseTestRuntimeC com.clearspring.analytics:stream:2.9.6=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=baseTestCompileClasspath,baseTestRuntimeClasspath,latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=baseTestCompileClasspath,baseTestRuntimeClasspath,latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath @@ -31,17 +32,17 @@ com.fasterxml.jackson.module:jackson-module-scala_2.12:2.6.7.1=baseTestCompileCl com.fasterxml.jackson.module:jackson-module-scala_2.13:2.15.2=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.15.2=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath com.github.luben:zstd-jni:1.3.2-2=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath com.github.luben:zstd-jni:1.5.5-4=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath,latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,baseTestAnnotationProcessor,baseTestCompileClasspath,compileClasspath,latest212DepTestAnnotationProcessor,latest212DepTestCompileClasspath,latest213DepTestAnnotationProcessor,latest213DepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -54,17 +55,20 @@ com.google.code.gson:gson:2.2.4=baseTestCompileClasspath,baseTestRuntimeClasspat com.google.crypto.tink:tink:1.9.0=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,baseTestAnnotationProcessor,latest212DepTestAnnotationProcessor,latest213DepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=baseTestCompileClasspath,baseTestRuntimeClasspath,latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.flatbuffers:flatbuffers-java:1.12.0=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,baseTestAnnotationProcessor,latest212DepTestAnnotationProcessor,latest213DepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:16.0.1=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath,latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=baseTestCompileClasspath,baseTestRuntimeClasspath,latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:16.0.1=compileClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,baseTestAnnotationProcessor,latest212DepTestAnnotationProcessor,latest213DepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,baseTestAnnotationProcessor,latest212DepTestAnnotationProcessor,latest213DepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=baseTestCompileClasspath,baseTestRuntimeClasspath,latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,baseTestAnnotationProcessor,baseTestCompileClasspath,baseTestRuntimeClasspath,latest212DepTestAnnotationProcessor,latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestAnnotationProcessor,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.inject:guice:3.0=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,baseTestAnnotationProcessor,latest212DepTestAnnotationProcessor,latest213DepTestAnnotationProcessor,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:3.1=baseTestCompileClasspath,baseTestRuntimeClasspath,latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.protobuf:protobuf-java:2.5.0=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath com.google.protobuf:protobuf-java:3.19.6=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath -com.google.re2j:re2j:1.7=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath com.ning:compress-lzf:1.0.3=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath com.ning:compress-lzf:1.1.2=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath com.squareup.moshi:moshi:1.11.0=baseTestCompileClasspath,baseTestRuntimeClasspath,latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -129,7 +133,7 @@ io.netty:netty-transport-native-kqueue:4.1.96.Final=latest212DepTestCompileClass io.netty:netty-transport-native-unix-common:4.1.96.Final=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath io.netty:netty-transport:4.1.96.Final=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath io.netty:netty:3.9.9.Final=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath -io.sqreen:libsqreen:17.3.0=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath jakarta.servlet:jakarta.servlet-api:4.0.3=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath jakarta.validation:jakarta.validation-api:2.0.2=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath @@ -149,8 +153,8 @@ joda-time:joda-time:2.9.9=baseTestCompileClasspath,baseTestRuntimeClasspath,comp junit:junit:3.8.1=baseTestCompileClasspath,compileClasspath junit:junit:4.13.2=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath log4j:log4j:1.2.17=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath net.razorvine:pickle:1.3=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath @@ -221,7 +225,7 @@ org.apache.hive:hive-storage-api:2.8.1=latest212DepTestCompileClasspath,latest21 org.apache.httpcomponents:httpclient:4.2.5=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath org.apache.httpcomponents:httpcore:4.2.4=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath org.apache.ivy:ivy:2.4.0=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath -org.apache.ivy:ivy:2.5.1=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath +org.apache.ivy:ivy:2.5.3=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath org.apache.logging.log4j:log4j-1.2-api:2.20.0=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath org.apache.logging.log4j:log4j-api:2.20.0=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath org.apache.logging.log4j:log4j-api:2.25.2=spotbugs @@ -247,39 +251,39 @@ org.apache.parquet:parquet-hadoop:1.13.1=latest212DepTestCompileClasspath,latest org.apache.parquet:parquet-jackson:1.10.0=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath org.apache.parquet:parquet-jackson:1.13.1=latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath org.apache.spark:spark-catalyst_2.12:2.4.0=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath -org.apache.spark:spark-catalyst_2.12:3.5.8=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath -org.apache.spark:spark-catalyst_2.13:3.5.8=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath -org.apache.spark:spark-common-utils_2.12:3.5.8=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath -org.apache.spark:spark-common-utils_2.13:3.5.8=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath +org.apache.spark:spark-catalyst_2.12:3.5.9=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath +org.apache.spark:spark-catalyst_2.13:3.5.9=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath +org.apache.spark:spark-common-utils_2.12:3.5.9=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath +org.apache.spark:spark-common-utils_2.13:3.5.9=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath org.apache.spark:spark-core_2.12:2.4.0=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath -org.apache.spark:spark-core_2.12:3.5.8=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath -org.apache.spark:spark-core_2.13:3.5.8=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath +org.apache.spark:spark-core_2.12:3.5.9=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath +org.apache.spark:spark-core_2.13:3.5.9=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath org.apache.spark:spark-kvstore_2.12:2.4.0=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath -org.apache.spark:spark-kvstore_2.12:3.5.8=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath -org.apache.spark:spark-kvstore_2.13:3.5.8=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath +org.apache.spark:spark-kvstore_2.12:3.5.9=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath +org.apache.spark:spark-kvstore_2.13:3.5.9=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath org.apache.spark:spark-launcher_2.12:2.4.0=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath -org.apache.spark:spark-launcher_2.12:3.5.8=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath -org.apache.spark:spark-launcher_2.13:3.5.8=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath +org.apache.spark:spark-launcher_2.12:3.5.9=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath +org.apache.spark:spark-launcher_2.13:3.5.9=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath org.apache.spark:spark-network-common_2.12:2.4.0=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath -org.apache.spark:spark-network-common_2.12:3.5.8=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath -org.apache.spark:spark-network-common_2.13:3.5.8=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath +org.apache.spark:spark-network-common_2.12:3.5.9=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath +org.apache.spark:spark-network-common_2.13:3.5.9=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath org.apache.spark:spark-network-shuffle_2.12:2.4.0=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath -org.apache.spark:spark-network-shuffle_2.12:3.5.8=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath -org.apache.spark:spark-network-shuffle_2.13:3.5.8=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath +org.apache.spark:spark-network-shuffle_2.12:3.5.9=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath +org.apache.spark:spark-network-shuffle_2.13:3.5.9=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath org.apache.spark:spark-sketch_2.12:2.4.0=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath -org.apache.spark:spark-sketch_2.12:3.5.8=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath -org.apache.spark:spark-sketch_2.13:3.5.8=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath -org.apache.spark:spark-sql-api_2.12:3.5.8=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath -org.apache.spark:spark-sql-api_2.13:3.5.8=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath +org.apache.spark:spark-sketch_2.12:3.5.9=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath +org.apache.spark:spark-sketch_2.13:3.5.9=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath +org.apache.spark:spark-sql-api_2.12:3.5.9=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath +org.apache.spark:spark-sql-api_2.13:3.5.9=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath org.apache.spark:spark-sql_2.12:2.4.0=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath -org.apache.spark:spark-sql_2.12:3.5.8=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath -org.apache.spark:spark-sql_2.13:3.5.8=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath +org.apache.spark:spark-sql_2.12:3.5.9=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath +org.apache.spark:spark-sql_2.13:3.5.9=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath org.apache.spark:spark-tags_2.12:2.4.0=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath -org.apache.spark:spark-tags_2.12:3.5.8=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath -org.apache.spark:spark-tags_2.13:3.5.8=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath +org.apache.spark:spark-tags_2.12:3.5.9=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath +org.apache.spark:spark-tags_2.13:3.5.9=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath org.apache.spark:spark-unsafe_2.12:2.4.0=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath -org.apache.spark:spark-unsafe_2.12:3.5.8=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath -org.apache.spark:spark-unsafe_2.13:3.5.8=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath +org.apache.spark:spark-unsafe_2.12:3.5.9=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath +org.apache.spark:spark-unsafe_2.13:3.5.9=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath org.apache.xbean:xbean-asm6-shaded:4.8=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath org.apache.xbean:xbean-asm9-shaded:4.23=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath org.apache.yetus:audience-annotations:0.13.0=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath @@ -355,6 +359,7 @@ org.json4s:json4s-jackson_2.13:3.7.0-M11=latest213DepTestCompileClasspath,latest org.json4s:json4s-scalap_2.12:3.5.3=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath org.json4s:json4s-scalap_2.12:3.7.0-M11=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath org.json4s:json4s-scalap_2.13:3.7.0-M11=latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=baseTestCompileClasspath,baseTestRuntimeClasspath,latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=baseTestCompileClasspath,baseTestRuntimeClasspath,latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=baseTestCompileClasspath,baseTestRuntimeClasspath,latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -376,14 +381,14 @@ org.objenesis:objenesis:3.3=baseTestCompileClasspath,baseTestRuntimeClasspath,la org.opentest4j:opentest4j:1.3.0=baseTestCompileClasspath,baseTestRuntimeClasspath,latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=baseTestRuntimeClasspath,latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=baseTestCompileClasspath,baseTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.roaringbitmap:RoaringBitmap:0.5.11=baseTestCompileClasspath,baseTestRuntimeClasspath,compileClasspath org.roaringbitmap:RoaringBitmap:0.9.45=latest212DepTestCompileClasspath,latest212DepTestRuntimeClasspath,latest213DepTestCompileClasspath,latest213DepTestRuntimeClasspath org.roaringbitmap:shims:0.9.45=latest212DepTestRuntimeClasspath,latest213DepTestRuntimeClasspath diff --git a/dd-java-agent/instrumentation/spark/spark_2.12/gradle.lockfile b/dd-java-agent/instrumentation/spark/spark_2.12/gradle.lockfile index 76cbaf99fb3..a286e6d08d2 100644 --- a/dd-java-agent/instrumentation/spark/spark_2.12/gradle.lockfile +++ b/dd-java-agent/instrumentation/spark/spark_2.12/gradle.lockfile @@ -461,14 +461,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,test_spark24CompileClasspath,test_spark24RuntimeClasspath,test_spark32CompileClasspath,test_spark32RuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,test_spark24RuntimeClasspath,test_spark32RuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,test_spark24RuntimeClasspath,test_spark32RuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,test_spark24RuntimeClasspath,test_spark32RuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,test_spark24RuntimeClasspath,test_spark32RuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,test_spark24RuntimeClasspath,test_spark32RuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,test_spark24RuntimeClasspath,test_spark32RuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,test_spark24CompileClasspath,test_spark24RuntimeClasspath,test_spark32CompileClasspath,test_spark32RuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,test_spark24CompileClasspath,test_spark24RuntimeClasspath,test_spark32CompileClasspath,test_spark32RuntimeClasspath org.roaringbitmap:RoaringBitmap:0.5.11=compileClasspath,testCompileClasspath,testRuntimeClasspath org.roaringbitmap:RoaringBitmap:0.7.45=test_spark24CompileClasspath,test_spark24RuntimeClasspath org.roaringbitmap:RoaringBitmap:0.9.0=test_spark32CompileClasspath,test_spark32RuntimeClasspath diff --git a/dd-java-agent/instrumentation/spark/spark_2.12/src/main/java/datadog/trace/instrumentation/spark/Spark212Instrumentation.java b/dd-java-agent/instrumentation/spark/spark_2.12/src/main/java/datadog/trace/instrumentation/spark/Spark212Instrumentation.java index 1d69489c7a6..0b326794b1c 100644 --- a/dd-java-agent/instrumentation/spark/spark_2.12/src/main/java/datadog/trace/instrumentation/spark/Spark212Instrumentation.java +++ b/dd-java-agent/instrumentation/spark/spark_2.12/src/main/java/datadog/trace/instrumentation/spark/Spark212Instrumentation.java @@ -99,7 +99,7 @@ public static void enter(@Advice.This SparkContext sparkContext) { } public static class SparkPlanInfoAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) @SuppressForbidden public static void exit( @Advice.Return(readOnly = false) SparkPlanInfo planInfo, diff --git a/dd-java-agent/instrumentation/spark/spark_2.13/src/main/java/datadog/trace/instrumentation/spark/Spark213Instrumentation.java b/dd-java-agent/instrumentation/spark/spark_2.13/src/main/java/datadog/trace/instrumentation/spark/Spark213Instrumentation.java index d9d5b34ae7d..e2568a9d4ed 100644 --- a/dd-java-agent/instrumentation/spark/spark_2.13/src/main/java/datadog/trace/instrumentation/spark/Spark213Instrumentation.java +++ b/dd-java-agent/instrumentation/spark/spark_2.13/src/main/java/datadog/trace/instrumentation/spark/Spark213Instrumentation.java @@ -100,7 +100,7 @@ public static void enter(@Advice.This SparkContext sparkContext) { } public static class SparkPlanInfoAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) @SuppressForbidden public static void exit( @Advice.Return(readOnly = false) SparkPlanInfo planInfo, diff --git a/dd-java-agent/instrumentation/spark/sparkjava-2.3/gradle.lockfile b/dd-java-agent/instrumentation/spark/sparkjava-2.3/gradle.lockfile index 03bd65d20d3..fb5875cb064 100644 --- a/dd-java-agent/instrumentation/spark/sparkjava-2.3/gradle.lockfile +++ b/dd-java-agent/instrumentation/spark/sparkjava-2.3/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:spark:sparkjava-2.3:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.sparkjava:spark-core:2.3=compileClasspath com.sparkjava:spark-core:2.4=testCompileClasspath,testRuntimeClasspath com.sparkjava:spark-core:2.9.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -50,12 +54,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -125,6 +129,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -142,14 +147,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/spray-1.3/gradle.lockfile b/dd-java-agent/instrumentation/spray-1.3/gradle.lockfile index c33b2aae416..561211da667 100644 --- a/dd-java-agent/instrumentation/spray-1.3/gradle.lockfile +++ b/dd-java-agent/instrumentation/spray-1.3/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:spray-1.3:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -9,7 +10,7 @@ com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,comp com.chuusai:shapeless_2.11:1.2.4=compileClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -18,15 +19,15 @@ com.eed3si9n:shaded-scalajson_2.13:1.0.0-M4=zinc com.eed3si9n:sjson-new-core_2.13:0.10.1=zinc com.eed3si9n:sjson-new-scalajson_2.13:0.10.1=zinc com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -36,12 +37,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -55,7 +59,7 @@ commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testRuntimeClassp commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath io.spray:spray-can_2.11:1.3.1=compileClasspath io.spray:spray-can_2.11:1.3.3=testCompileClasspath,testRuntimeClasspath @@ -67,14 +71,13 @@ io.spray:spray-io_2.11:1.3.3=testCompileClasspath,testRuntimeClasspath io.spray:spray-routing_2.11:1.3.1=compileClasspath,testCompileClasspath,testRuntimeClasspath io.spray:spray-util_2.11:1.3.1=compileClasspath io.spray:spray-util_2.11:1.3.3=testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.openhft:zero-allocation-hashing:0.16=zinc net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -100,7 +103,7 @@ org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath @@ -109,7 +112,8 @@ org.jctools:jctools-core:4.0.6=testRuntimeClasspath org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -128,14 +132,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.parboiled:parboiled-core:1.1.6=compileClasspath org.parboiled:parboiled-core:1.1.7=testCompileClasspath,testRuntimeClasspath org.parboiled:parboiled-scala_2.11:1.1.6=compileClasspath @@ -144,31 +148,31 @@ org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=zinc org.scala-lang.modules:scala-xml_2.11:1.0.1=compileClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.11.12=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-lang:scala-library:2.13.15=zinc -org.scala-lang:scala-reflect:2.13.15=zinc -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-lang:scala-library:2.13.16=zinc +org.scala-lang:scala-reflect:2.13.16=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/spray-1.3/src/main/scala/datadog/trace/instrumentation/spray/SprayHelper.scala b/dd-java-agent/instrumentation/spray-1.3/src/main/scala/datadog/trace/instrumentation/spray/SprayHelper.scala index f1c994b33d2..0c37f91fd66 100644 --- a/dd-java-agent/instrumentation/spray-1.3/src/main/scala/datadog/trace/instrumentation/spray/SprayHelper.scala +++ b/dd-java-agent/instrumentation/spray-1.3/src/main/scala/datadog/trace/instrumentation/spray/SprayHelper.scala @@ -4,7 +4,7 @@ import datadog.context.Context; import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan import datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan -import datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; +import datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import datadog.trace.instrumentation.spray.SprayHttpServerDecorator.DECORATE import spray.http.HttpResponse import spray.routing.{RequestContext, Route} @@ -34,7 +34,7 @@ object SprayHelper { def wrapRoute(route: Route): Route = { ctx => { - DECORATE.onRequest(activeSpan(), ctx, ctx.request, getRootContext()) + DECORATE.onRequest(activeSpan(), ctx, ctx.request, rootContext()) try route(ctx) catch { case NonFatal(e) => diff --git a/dd-java-agent/instrumentation/spray-1.3/src/main/scala/datadog/trace/instrumentation/spray/SprayHttpServerRunSealedRouteAdvice.java b/dd-java-agent/instrumentation/spray-1.3/src/main/scala/datadog/trace/instrumentation/spray/SprayHttpServerRunSealedRouteAdvice.java index 8f45c40d26e..f3ba5b60e1b 100644 --- a/dd-java-agent/instrumentation/spray-1.3/src/main/scala/datadog/trace/instrumentation/spray/SprayHttpServerRunSealedRouteAdvice.java +++ b/dd-java-agent/instrumentation/spray-1.3/src/main/scala/datadog/trace/instrumentation/spray/SprayHttpServerRunSealedRouteAdvice.java @@ -2,7 +2,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.spray.SprayHttpServerDecorator.DECORATE; import static datadog.trace.instrumentation.spray.SprayHttpServerDecorator.SPRAY_HTTP_SERVER; @@ -29,7 +29,7 @@ public static ContextScope enter( context = DECORATE.startSpan(request, parentContext); span = spanFromContext(context); } else { - parentContext = getRootContext(); + parentContext = rootContext(); span = startSpan(SPRAY_HTTP_SERVER.toString(), DECORATE.spanName()); context = span; } diff --git a/dd-java-agent/instrumentation/spring/spring-beans-3.1/gradle.lockfile b/dd-java-agent/instrumentation/spring/spring-beans-3.1/gradle.lockfile index 768223c7048..1b519ee4cf3 100644 --- a/dd-java-agent/instrumentation/spring/spring-beans-3.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/spring/spring-beans-3.1/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:spring:spring-beans-3.1:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -48,12 +52,12 @@ commons-io:commons-io:2.20.0=spotbugs commons-logging:commons-logging:1.1.1=compileClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -82,6 +86,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -99,14 +104,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/spring/spring-boot-1.3/gradle.lockfile b/dd-java-agent/instrumentation/spring/spring-boot-1.3/gradle.lockfile index bad0744bdb1..a5c40a0aadd 100644 --- a/dd-java-agent/instrumentation/spring/spring-boot-1.3/gradle.lockfile +++ b/dd-java-agent/instrumentation/spring/spring-boot-1.3/gradle.lockfile @@ -1,31 +1,32 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:spring:spring-boot-1.3:dependencies --write-locks aopalliance:aopalliance:1.0=compileClasspath,testCompileClasspath,testRuntimeClasspath biz.aQute.bnd:biz.aQute.bnd.annotation:7.1.0=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-classic:1.5.32=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +ch.qos.logback:logback-classic:1.5.34=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath ch.qos.logback:logback-core:1.2.13=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.5.32=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +ch.qos.logback:logback-core:1.5.34=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,boot1LatestDepForkedTestAnnotationProcessor,boot1LatestDepForkedTestCompileClasspath,boot1LatestDepTestAnnotationProcessor,boot1LatestDepTestCompileClasspath,boot2ForkedTestAnnotationProcessor,boot2ForkedTestCompileClasspath,boot2LatestDepForkedTestAnnotationProcessor,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepTestAnnotationProcessor,boot2LatestDepTestCompileClasspath,boot2TestAnnotationProcessor,boot2TestCompileClasspath,boot3ForkedTestAnnotationProcessor,boot3ForkedTestCompileClasspath,boot3TestAnnotationProcessor,boot3TestCompileClasspath,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -34,14 +35,16 @@ com.google.auto:auto-common:1.2.1=annotationProcessor,boot1LatestDepForkedTestAn com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,boot1LatestDepForkedTestAnnotationProcessor,boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestAnnotationProcessor,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestAnnotationProcessor,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestAnnotationProcessor,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestAnnotationProcessor,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestAnnotationProcessor,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestAnnotationProcessor,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestAnnotationProcessor,boot3TestCompileClasspath,boot3TestRuntimeClasspath,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,boot1LatestDepForkedTestAnnotationProcessor,boot1LatestDepTestAnnotationProcessor,boot2ForkedTestAnnotationProcessor,boot2LatestDepForkedTestAnnotationProcessor,boot2LatestDepTestAnnotationProcessor,boot2TestAnnotationProcessor,boot3ForkedTestAnnotationProcessor,boot3TestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.errorprone:error_prone_annotations:2.38.0=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,boot1LatestDepForkedTestAnnotationProcessor,boot1LatestDepTestAnnotationProcessor,boot2ForkedTestAnnotationProcessor,boot2LatestDepForkedTestAnnotationProcessor,boot2LatestDepTestAnnotationProcessor,boot2TestAnnotationProcessor,boot3ForkedTestAnnotationProcessor,boot3TestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,boot1LatestDepForkedTestAnnotationProcessor,boot1LatestDepTestAnnotationProcessor,boot2ForkedTestAnnotationProcessor,boot2LatestDepForkedTestAnnotationProcessor,boot2LatestDepTestAnnotationProcessor,boot2TestAnnotationProcessor,boot3ForkedTestAnnotationProcessor,boot3TestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,boot1LatestDepForkedTestAnnotationProcessor,boot1LatestDepTestAnnotationProcessor,boot2ForkedTestAnnotationProcessor,boot2LatestDepForkedTestAnnotationProcessor,boot2LatestDepTestAnnotationProcessor,boot2TestAnnotationProcessor,boot3ForkedTestAnnotationProcessor,boot3TestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,boot1LatestDepForkedTestAnnotationProcessor,boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestAnnotationProcessor,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestAnnotationProcessor,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestAnnotationProcessor,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestAnnotationProcessor,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestAnnotationProcessor,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestAnnotationProcessor,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestAnnotationProcessor,boot3TestCompileClasspath,boot3TestRuntimeClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,boot1LatestDepForkedTestAnnotationProcessor,boot1LatestDepTestAnnotationProcessor,boot2ForkedTestAnnotationProcessor,boot2LatestDepForkedTestAnnotationProcessor,boot2LatestDepTestAnnotationProcessor,boot2TestAnnotationProcessor,boot3ForkedTestAnnotationProcessor,boot3TestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -54,14 +57,14 @@ commons-logging:commons-logging:1.2=boot1LatestDepForkedTestCompileClasspath,boo commons-logging:commons-logging:1.3.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath de.thetaphi:forbiddenapis:3.10=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.micrometer:micrometer-commons:1.16.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.micrometer:micrometer-observation:1.16.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.micrometer:micrometer-commons:1.16.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micrometer:micrometer-observation:1.16.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -92,7 +95,7 @@ org.hamcrest:hamcrest-core:1.3=boot1LatestDepForkedTestRuntimeClasspath,boot1Lat org.hamcrest:hamcrest:3.0=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -114,56 +117,57 @@ org.osgi:org.osgi.resource:1.0.0=latestDepForkedTestCompileClasspath,latestDepTe org.osgi:org.osgi.service.serviceloader:1.0.0=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath org.ow2.asm:asm-analysis:9.7.1=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:jul-to-slf4j:2.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.slf4j:jul-to-slf4j:2.0.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath org.slf4j:slf4j-api:1.7.32=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:2.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,spotbugsSlf4j +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j +org.slf4j:slf4j-api:2.0.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.snakeyaml:snakeyaml-engine:2.9=boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestRuntimeClasspath,boot3ForkedTestRuntimeClasspath,boot3TestRuntimeClasspath,buildTimeInstrumentationPlugin,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath org.spockframework:spock-bom:2.4-groovy-3.0=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-logging:4.1.0-RC1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-starter-logging:4.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot:1.3.0.RELEASE=compileClasspath,testCompileClasspath,testRuntimeClasspath org.springframework.boot:spring-boot:1.5.22.RELEASE=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath org.springframework.boot:spring-boot:2.0.0.RELEASE=boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath org.springframework.boot:spring-boot:3.0.0=boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath -org.springframework.boot:spring-boot:4.1.0-RC1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot:4.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-aop:4.2.3.RELEASE=compileClasspath,testCompileClasspath,testRuntimeClasspath org.springframework:spring-aop:4.3.25.RELEASE=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath org.springframework:spring-aop:5.0.4.RELEASE=boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath org.springframework:spring-aop:6.0.2=boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath -org.springframework:spring-aop:7.0.7=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-aop:7.0.8=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-beans:4.2.3.RELEASE=compileClasspath,testCompileClasspath,testRuntimeClasspath org.springframework:spring-beans:4.3.25.RELEASE=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath org.springframework:spring-beans:5.0.4.RELEASE=boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath org.springframework:spring-beans:6.0.2=boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath -org.springframework:spring-beans:7.0.7=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-beans:7.0.8=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-context:4.2.3.RELEASE=compileClasspath,testCompileClasspath,testRuntimeClasspath org.springframework:spring-context:4.3.25.RELEASE=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath org.springframework:spring-context:5.0.4.RELEASE=boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath org.springframework:spring-context:6.0.2=boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath -org.springframework:spring-context:7.0.7=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-context:7.0.8=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-core:4.2.3.RELEASE=compileClasspath,testCompileClasspath,testRuntimeClasspath org.springframework:spring-core:4.3.25.RELEASE=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath org.springframework:spring-core:5.0.4.RELEASE=boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath org.springframework:spring-core:6.0.2=boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath -org.springframework:spring-core:7.0.7=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-core:7.0.8=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-expression:4.2.3.RELEASE=compileClasspath,testCompileClasspath,testRuntimeClasspath org.springframework:spring-expression:4.3.25.RELEASE=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath org.springframework:spring-expression:5.0.4.RELEASE=boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath org.springframework:spring-expression:6.0.2=boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath -org.springframework:spring-expression:7.0.7=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-expression:7.0.8=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-jcl:5.0.4.RELEASE=boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath org.springframework:spring-jcl:6.0.2=boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath org.tabletest:tabletest-junit:1.2.1=boot1LatestDepForkedTestCompileClasspath,boot1LatestDepForkedTestRuntimeClasspath,boot1LatestDepTestCompileClasspath,boot1LatestDepTestRuntimeClasspath,boot2ForkedTestCompileClasspath,boot2ForkedTestRuntimeClasspath,boot2LatestDepForkedTestCompileClasspath,boot2LatestDepForkedTestRuntimeClasspath,boot2LatestDepTestCompileClasspath,boot2LatestDepTestRuntimeClasspath,boot2TestCompileClasspath,boot2TestRuntimeClasspath,boot3ForkedTestCompileClasspath,boot3ForkedTestRuntimeClasspath,boot3TestCompileClasspath,boot3TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/spring/spring-cloud-zuul-2.0/gradle.lockfile b/dd-java-agent/instrumentation/spring/spring-cloud-zuul-2.0/gradle.lockfile index 2b7c822434f..40408684943 100644 --- a/dd-java-agent/instrumentation/spring/spring-cloud-zuul-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/spring/spring-cloud-zuul-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:spring:spring-cloud-zuul-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.3=compileClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.3=compileClasspath,testCompileClasspath,testRunt com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -23,15 +24,15 @@ com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.3=testCompileClasspa com.fasterxml.jackson.module:jackson-module-afterburner:2.11.3=testRuntimeClasspath com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.3=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -41,14 +42,16 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:15.0=compileClasspath -com.google.guava:guava:19.0=testRuntimeClasspath -com.google.guava:guava:20.0=testCompileClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.jayway.jsonpath:json-path:2.4.0=testCompileClasspath,testRuntimeClasspath com.netflix.archaius:archaius-core:0.7.6=compileClasspath,testCompileClasspath,testRuntimeClasspath com.netflix.hystrix:hystrix-core:1.5.12=compileClasspath @@ -95,7 +98,7 @@ io.reactivex:rxjava:1.3.8=testCompileClasspath,testRuntimeClasspath io.reactivex:rxnetty-contexts:0.4.9=testRuntimeClasspath io.reactivex:rxnetty-servo:0.4.9=testRuntimeClasspath io.reactivex:rxnetty:0.4.9=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath jakarta.activation:jakarta.activation-api:1.2.2=testCompileClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=testCompileClasspath,testRuntimeClasspath jakarta.xml.bind:jakarta.xml.bind-api:2.3.3=testCompileClasspath,testRuntimeClasspath @@ -107,8 +110,8 @@ javax.ws.rs:jsr311-api:1.1.1=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.1=testRuntimeClasspath net.bytebuddy:byte-buddy-agent:1.10.17=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.minidev:accessors-smart:1.2=testCompileClasspath,testRuntimeClasspath @@ -160,6 +163,7 @@ org.hdrhistogram:HdrHistogram:2.1.12=testCompileClasspath,testRuntimeClasspath org.hdrhistogram:HdrHistogram:2.1.9=compileClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -179,14 +183,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.3=testRuntimeClasspath org.skyscreamer:jsonassert:1.5.0=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/spring/spring-core-3.2.2/gradle.lockfile b/dd-java-agent/instrumentation/spring/spring-core-3.2.2/gradle.lockfile index 4058275fc53..5e6ca4929fe 100644 --- a/dd-java-agent/instrumentation/spring/spring-core-3.2.2/gradle.lockfile +++ b/dd-java-agent/instrumentation/spring/spring-core-3.2.2/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:spring:spring-core-3.2.2:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -48,12 +52,12 @@ commons-io:commons-io:2.20.0=spotbugs commons-logging:commons-logging:1.1.1=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -82,6 +86,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -99,14 +104,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/spring/spring-core-3.2.2/src/main/java/datadog/trace/instrumentation/springcore/StreamUtilsInstrumentation.java b/dd-java-agent/instrumentation/spring/spring-core-3.2.2/src/main/java/datadog/trace/instrumentation/springcore/StreamUtilsInstrumentation.java index 68a081bf54d..1b9f15b2d35 100644 --- a/dd-java-agent/instrumentation/spring/spring-core-3.2.2/src/main/java/datadog/trace/instrumentation/springcore/StreamUtilsInstrumentation.java +++ b/dd-java-agent/instrumentation/spring/spring-core-3.2.2/src/main/java/datadog/trace/instrumentation/springcore/StreamUtilsInstrumentation.java @@ -1,6 +1,7 @@ package datadog.trace.instrumentation.springcore; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static java.nio.charset.StandardCharsets.UTF_8; import static net.bytebuddy.matcher.ElementMatchers.isMethod; import static net.bytebuddy.matcher.ElementMatchers.takesArgument; import static net.bytebuddy.matcher.ElementMatchers.takesArguments; @@ -56,7 +57,7 @@ public static void checkReturnedObject( private static void muzzleCheck() throws IOException { StreamUtils.copyToString( - new ByteArrayInputStream("test".getBytes()), Charset.defaultCharset()); + new ByteArrayInputStream("test".getBytes(UTF_8)), Charset.defaultCharset()); } } } diff --git a/dd-java-agent/instrumentation/spring/spring-data-1.8/gradle.lockfile b/dd-java-agent/instrumentation/spring/spring-data-1.8/gradle.lockfile index ba329c87042..a0ba742eb9b 100644 --- a/dd-java-agent/instrumentation/spring/spring-data-1.8/gradle.lockfile +++ b/dd-java-agent/instrumentation/spring/spring-data-1.8/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:spring:spring-data-1.8:dependencies --write-locks antlr:antlr:2.7.7=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath aopalliance:aopalliance:1.0=testCompileClasspath,testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -10,20 +11,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -33,12 +34,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:18.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.infradna.tool:bridge-method-annotation:1.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.mysema.commons:mysema-commons-lang:0.2.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.mysema.querydsl:querydsl-core:3.7.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -55,12 +59,12 @@ commons-logging:commons-logging:1.1.3=compileClasspath,testCompileClasspath,test de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath dom4j:dom4j:1.6.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -101,6 +105,7 @@ org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:1.0.0.Final=late org.jboss:jandex:1.1.0.Final=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -118,14 +123,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/spring/spring-jms-3.1/gradle.lockfile b/dd-java-agent/instrumentation/spring/spring-jms-3.1/gradle.lockfile index 956c12b7a1e..c4ab6b21289 100644 --- a/dd-java-agent/instrumentation/spring/spring-jms-3.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/spring/spring-jms-3.1/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:spring:spring-jms-3.1:dependencies --write-locks aopalliance:aopalliance:1.0=compileClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -9,20 +10,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -32,12 +33,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -50,13 +54,13 @@ commons-logging:commons-logging:1.1.1=compileClasspath commons-logging:commons-logging:1.2=testCompileClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.jms:jms-api:1.1-rev-1=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -96,6 +100,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepForkedTestCompileClasspath,latestDepFork org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -113,14 +118,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/spring/spring-jms-3.1/src/main/java/datadog/trace/instrumentation/springjms/AbstractPollingMessageListenerContainerInstrumentation.java b/dd-java-agent/instrumentation/spring/spring-jms-3.1/src/main/java/datadog/trace/instrumentation/springjms/AbstractPollingMessageListenerContainerInstrumentation.java index 30915126a55..3ad07247953 100644 --- a/dd-java-agent/instrumentation/spring/spring-jms-3.1/src/main/java/datadog/trace/instrumentation/springjms/AbstractPollingMessageListenerContainerInstrumentation.java +++ b/dd-java-agent/instrumentation/spring/spring-jms-3.1/src/main/java/datadog/trace/instrumentation/springjms/AbstractPollingMessageListenerContainerInstrumentation.java @@ -2,7 +2,7 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.closePrevious; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static java.util.Collections.singletonMap; import static net.bytebuddy.matcher.ElementMatchers.takesArgument; @@ -62,7 +62,7 @@ public static void afterExecute(@Advice.Argument(2) final MessageConsumer consum if (InstrumenterConfig.get().isLegacyContextManagerEnabled()) { closePrevious(finishSpan); } else { - final AgentSpan previousSpan = spanFromContext(getRootContext().swap()); + final AgentSpan previousSpan = spanFromContext(rootContext().swap()); if (previousSpan != null) { previousSpan.finishWithEndToEnd(); } diff --git a/dd-java-agent/instrumentation/spring/spring-messaging-4.0/gradle.lockfile b/dd-java-agent/instrumentation/spring/spring-messaging-4.0/gradle.lockfile index 09772087814..4f7416526b4 100644 --- a/dd-java-agent/instrumentation/spring/spring-messaging-4.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/spring/spring-messaging-4.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:spring:spring-messaging-4.0:dependencies --write-locks aopalliance:aopalliance:1.0=compileClasspath,compileOnlyDependenciesMetadata cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -9,7 +10,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestIm com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -26,16 +27,16 @@ com.fasterxml.jackson:jackson-bom:2.14.1=latestDepTestCompileClasspath,latestDep com.fasterxml.jackson:jackson-bom:2.16.2=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.ben-manes.caffeine:caffeine:2.9.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.luben:zstd-jni:1.5.6-3=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,compileOnlyDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,compileOnlyDependenciesMetadata,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,compileOnlyDependenciesMetadata,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestCompileOnlyDependenciesMetadata,testAnnotationProcessor,testCompileClasspath,testCompileOnlyDependenciesMetadata @@ -43,15 +44,17 @@ com.google.auto.service:auto-service:1.1.1=annotationProcessor,latestDepTestAnno com.google.auto:auto-common:1.2.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,compileOnlyDependenciesMetadata,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,spotbugs,testAnnotationProcessor,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs -com.google.errorprone:error_prone_annotations:2.10.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath @@ -99,16 +102,16 @@ io.netty:netty-transport-classes-epoll:4.1.105.Final=latestDepTestCompileClasspa io.netty:netty-transport-native-epoll:4.1.105.Final=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath io.netty:netty-transport-native-unix-common:4.1.105.Final=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath io.netty:netty-transport:4.1.105.Final=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -io.projectreactor:reactor-core:3.8.5=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +io.projectreactor:reactor-core:3.8.6=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath io.spray:spray-json_2.13:1.3.6=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:2.0.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.10.12=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.jopt-simple:jopt-simple:5.0.4=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -161,29 +164,27 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestImplementat org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-build-common:2.0.21=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-build-tools-api:2.0.21=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-build-tools-impl:2.0.21=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-compiler-embeddable:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-compiler-runner:2.0.21=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-daemon-client:2.0.21=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-daemon-embeddable:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:2.0.21=kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-native-prebuilt:2.0.21=kotlinNativeBundleConfiguration +org.jetbrains.kotlin:kotlin-build-tools-api:2.1.20=kotlinBuildToolsApiClasspath +org.jetbrains.kotlin:kotlin-build-tools-impl:2.1.20=kotlinBuildToolsApiClasspath +org.jetbrains.kotlin:kotlin-compiler-embeddable:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath +org.jetbrains.kotlin:kotlin-compiler-runner:2.1.20=kotlinBuildToolsApiClasspath +org.jetbrains.kotlin:kotlin-daemon-client:2.1.20=kotlinBuildToolsApiClasspath +org.jetbrains.kotlin:kotlin-daemon-embeddable:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath +org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:2.1.20=kotlinKlibCommonizerClasspath org.jetbrains.kotlin:kotlin-reflect:1.6.10=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-reflect:2.0.21=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-script-runtime:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-scripting-common:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest -org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest -org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest -org.jetbrains.kotlin:kotlin-scripting-jvm:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest +org.jetbrains.kotlin:kotlin-reflect:2.1.20=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.jetbrains.kotlin:kotlin-script-runtime:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath +org.jetbrains.kotlin:kotlin-scripting-common:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest +org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest +org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest +org.jetbrains.kotlin:kotlin-scripting-jvm:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21=compileClasspath,compileOnlyDependenciesMetadata -org.jetbrains.kotlin:kotlin-stdlib-common:2.0.21=latestDepTestImplementationDependenciesMetadata,testImplementationDependenciesMetadata +org.jetbrains.kotlin:kotlin-stdlib-common:2.1.20=latestDepTestImplementationDependenciesMetadata,testImplementationDependenciesMetadata org.jetbrains.kotlin:kotlin-stdlib:1.6.21=compileClasspath,compileOnlyDependenciesMetadata -org.jetbrains.kotlin:kotlin-stdlib:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +org.jetbrains.kotlin:kotlin-stdlib:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathLatestDepTest,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.jetbrains.kotlinx:atomicfu:0.23.1=latestDepTestImplementationDependenciesMetadata,testImplementationDependenciesMetadata org.jetbrains.kotlinx:kotlinx-coroutines-bom:1.8.1=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath +org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.8.0=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.8.1=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.jetbrains.kotlinx:kotlinx-coroutines-reactive:1.8.1=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath @@ -210,14 +211,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestImplement org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,implementationDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.pcollections:pcollections:4.0.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.4=compileClasspath,compileOnlyDependenciesMetadata,latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.scala-lang.modules:scala-async_2.13:0.10.0=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath @@ -246,19 +247,19 @@ org.springframework.retry:spring-retry:2.0.11=latestDepTestCompileClasspath,late org.springframework:spring-aop:4.0.0.RELEASE=compileClasspath,compileOnlyDependenciesMetadata org.springframework:spring-aop:6.2.4=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.springframework:spring-beans:4.0.0.RELEASE=compileClasspath,compileOnlyDependenciesMetadata -org.springframework:spring-beans:6.2.18=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath +org.springframework:spring-beans:6.2.19=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath org.springframework:spring-beans:6.2.4=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.springframework:spring-context:4.0.0.RELEASE=compileClasspath,compileOnlyDependenciesMetadata org.springframework:spring-context:6.2.4=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.springframework:spring-core:4.0.0.RELEASE=compileClasspath,compileOnlyDependenciesMetadata -org.springframework:spring-core:6.2.18=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath +org.springframework:spring-core:6.2.19=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath org.springframework:spring-core:6.2.4=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.springframework:spring-expression:4.0.0.RELEASE=compileClasspath,compileOnlyDependenciesMetadata org.springframework:spring-expression:6.2.4=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.springframework:spring-jcl:6.2.18=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath +org.springframework:spring-jcl:6.2.19=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath org.springframework:spring-jcl:6.2.4=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.springframework:spring-messaging:4.0.0.RELEASE=compileClasspath,compileOnlyDependenciesMetadata -org.springframework:spring-messaging:6.2.18=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath +org.springframework:spring-messaging:6.2.19=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath org.springframework:spring-messaging:6.2.4=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.springframework:spring-test:6.2.4=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.springframework:spring-tx:6.2.4=latestDepTestCompileClasspath,latestDepTestImplementationDependenciesMetadata,latestDepTestRuntimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/spring/spring-messaging-4.0/src/main/java/datadog/trace/instrumentation/springmessaging/KotlinAwareHandlerInstrumentation.java b/dd-java-agent/instrumentation/spring/spring-messaging-4.0/src/main/java/datadog/trace/instrumentation/springmessaging/KotlinAwareHandlerInstrumentation.java index bf43161cce4..081de301d3f 100644 --- a/dd-java-agent/instrumentation/spring/spring-messaging-4.0/src/main/java/datadog/trace/instrumentation/springmessaging/KotlinAwareHandlerInstrumentation.java +++ b/dd-java-agent/instrumentation/spring/spring-messaging-4.0/src/main/java/datadog/trace/instrumentation/springmessaging/KotlinAwareHandlerInstrumentation.java @@ -1,6 +1,7 @@ package datadog.trace.instrumentation.springmessaging; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; import static net.bytebuddy.matcher.ElementMatchers.isMethod; import com.google.auto.service.AutoService; @@ -8,6 +9,7 @@ import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.bootstrap.InstrumentationContext; +import datadog.trace.bootstrap.instrumentation.reactivestreams.HandoffContext; import java.util.Collections; import java.util.Map; import net.bytebuddy.asm.Advice; @@ -38,7 +40,8 @@ public KotlinAwareHandlerInstrumentation() { @Override public Map contextStore() { - return Collections.singletonMap("org.reactivestreams.Publisher", Context.class.getName()); + return Collections.singletonMap( + "org.reactivestreams.Publisher", HandoffContext.class.getName()); } @Override @@ -58,8 +61,8 @@ public static class DoInvokeAdvice { @Advice.OnMethodExit(suppress = Throwable.class) public static void onExit(@Advice.Return Object result) { if (result instanceof Publisher) { - InstrumentationContext.get(Publisher.class, Context.class) - .put((Publisher) result, Context.current()); + InstrumentationContext.get(Publisher.class, HandoffContext.class) + .put((Publisher) result, HandoffContext.anyThread(currentContext())); } } } diff --git a/dd-java-agent/instrumentation/spring/spring-messaging-4.0/src/main/java/datadog/trace/instrumentation/springmessaging/SpringMessageHandlerInstrumentation.java b/dd-java-agent/instrumentation/spring/spring-messaging-4.0/src/main/java/datadog/trace/instrumentation/springmessaging/SpringMessageHandlerInstrumentation.java index 47106e41cc0..69e8d73408e 100644 --- a/dd-java-agent/instrumentation/spring/spring-messaging-4.0/src/main/java/datadog/trace/instrumentation/springmessaging/SpringMessageHandlerInstrumentation.java +++ b/dd-java-agent/instrumentation/spring/spring-messaging-4.0/src/main/java/datadog/trace/instrumentation/springmessaging/SpringMessageHandlerInstrumentation.java @@ -6,7 +6,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static datadog.trace.instrumentation.springmessaging.SpringMessageDecorator.COMPONENT_NAME; import static datadog.trace.instrumentation.springmessaging.SpringMessageDecorator.DECORATE; import static datadog.trace.instrumentation.springmessaging.SpringMessageDecorator.SPRING_INBOUND; @@ -67,7 +67,7 @@ public static void onEnter( @Advice.Argument(0) Message message, @Advice.Local("ctxScope") ContextScope scope) { if (activeSpan() == null) { // no local active span, so extract from message to avoid disconnected trace - scope = defaultPropagator().extract(getRootContext(), message, GETTER).attach(); + scope = defaultPropagator().extract(rootContext(), message, GETTER).attach(); } } diff --git a/dd-java-agent/instrumentation/spring/spring-rabbit-1.5/gradle.lockfile b/dd-java-agent/instrumentation/spring/spring-rabbit-1.5/gradle.lockfile index 2306908db76..5adfd4bf1f7 100644 --- a/dd-java-agent/instrumentation/spring/spring-rabbit-1.5/gradle.lockfile +++ b/dd-java-agent/instrumentation/spring/spring-rabbit-1.5/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:spring:spring-rabbit-1.5:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -20,15 +21,15 @@ com.github.docker-java:docker-java-api:3.4.2=latestDepTestCompileClasspath,lates com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -38,12 +39,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.rabbitmq:amqp-client:5.0.0=compileClasspath com.rabbitmq:amqp-client:5.14.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.rabbitmq:amqp-client:5.9.0=testCompileClasspath,testRuntimeClasspath @@ -60,13 +64,13 @@ commons-io:commons-io:2.20.0=spotbugs commons-logging:commons-logging:1.1.3=compileClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -103,6 +107,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -120,14 +125,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/spring/spring-rabbit-1.5/src/main/java/datadog/trace/instrumentation/springamqp/AbstractMessageListenerContainerInstrumentation.java b/dd-java-agent/instrumentation/spring/spring-rabbit-1.5/src/main/java/datadog/trace/instrumentation/springamqp/AbstractMessageListenerContainerInstrumentation.java index 957e289e641..6a9fa4bec55 100644 --- a/dd-java-agent/instrumentation/spring/spring-rabbit-1.5/src/main/java/datadog/trace/instrumentation/springamqp/AbstractMessageListenerContainerInstrumentation.java +++ b/dd-java-agent/instrumentation/spring/spring-rabbit-1.5/src/main/java/datadog/trace/instrumentation/springamqp/AbstractMessageListenerContainerInstrumentation.java @@ -11,6 +11,8 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArgument; import com.google.auto.service.AutoService; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.ExcludeFilterProvider; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; @@ -69,9 +71,9 @@ public static AgentScope activate(@Advice.Argument(1) Object data) { Message message = (Message) data; State state = InstrumentationContext.get(Message.class, State.class).get(message); if (null != state) { - AgentScope.Continuation continuation = state.getAndResetContinuation(); + ContextContinuation continuation = state.getAndResetContinuation(); if (null != continuation) { - try (AgentScope scope = continuation.activate()) { + try (ContextScope scope = continuation.resume()) { AgentSpan span = startSpan("rabbitmq-amqp", AMQP_CONSUME); span.setMeasured(true); DECORATE.afterStart(span); diff --git a/dd-java-agent/instrumentation/spring/spring-scheduling-3.1/gradle.lockfile b/dd-java-agent/instrumentation/spring/spring-scheduling-3.1/gradle.lockfile index 04929d63460..a1e27e29d58 100644 --- a/dd-java-agent/instrumentation/spring/spring-scheduling-3.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/spring/spring-scheduling-3.1/gradle.lockfile @@ -1,19 +1,20 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:spring:spring-scheduling-3.1:dependencies --write-locks antlr:antlr:2.7.7=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.4.5=spring6TestCompileClasspath,spring6TestRuntimeClasspath -ch.qos.logback:logback-classic:1.5.32=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +ch.qos.logback:logback-classic:1.5.34=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath ch.qos.logback:logback-core:1.2.13=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.4.5=spring6TestCompileClasspath,spring6TestRuntimeClasspath -ch.qos.logback:logback-core:1.5.32=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +ch.qos.logback:logback-core:1.5.34=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,muzzleTooling,runtimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath @@ -23,15 +24,15 @@ com.fasterxml.jackson.core:jackson-databind:2.11.3=latestDepForkedTestRuntimeCla com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath com.fasterxml:classmate:1.5.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,spotbugs,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestSpring5TestAnnotationProcessor,latestSpring5TestCompileClasspath,spring6TestAnnotationProcessor,spring6TestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -41,12 +42,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,latestSpring5TestAnnotationProcessor,spring6TestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,latestSpring5TestAnnotationProcessor,spring6TestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,latestSpring5TestAnnotationProcessor,spring6TestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,latestSpring5TestAnnotationProcessor,spring6TestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestAnnotationProcessor,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,spring6TestAnnotationProcessor,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,latestSpring5TestAnnotationProcessor,spring6TestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath com.h2database:h2:1.4.199=spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.h2database:h2:2.2.224=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath com.h2database:h2:2.4.240=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -69,11 +73,11 @@ commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForked commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath -io.micrometer:micrometer-commons:1.15.11=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micrometer:micrometer-commons:1.15.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micrometer:micrometer-core:1.6.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-observation:1.15.11=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micrometer:micrometer-observation:1.15.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.smallrye:jandex:3.2.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:2.1.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:2.1.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath @@ -90,8 +94,8 @@ jakarta.xml.bind:jakarta.xml.bind-api:4.0.0=latestDepForkedTestRuntimeClasspath, javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,muzzleTooling,runtimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,muzzleTooling,runtimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,muzzleTooling,runtimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,muzzleTooling,runtimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath net.javacrumbs.shedlock:shedlock-core:4.21.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -102,7 +106,7 @@ net.javacrumbs.shedlock:shedlock-spring:4.21.0=latestDepForkedTestCompileClasspa net.javacrumbs.shedlock:shedlock-spring:4.48.0=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.antlr:antlr4-runtime:4.10.1=spring6TestRuntimeClasspath -org.antlr:antlr4-runtime:4.13.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.antlr:antlr4-runtime:4.13.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc org.apache.bcel:bcel:6.11.0=spotbugs @@ -153,7 +157,7 @@ org.hibernate.common:hibernate-commons-annotations:5.1.2.Final=latestSpring5Test org.hibernate.common:hibernate-commons-annotations:6.0.2.Final=spring6TestRuntimeClasspath org.hibernate.common:hibernate-commons-annotations:7.0.3.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath org.hibernate.orm:hibernate-core:6.1.5.Final=spring6TestCompileClasspath,spring6TestRuntimeClasspath -org.hibernate.orm:hibernate-core:6.6.49.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.hibernate.orm:hibernate-core:6.6.53.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.hibernate:hibernate-core:5.4.23.Final=testCompileClasspath,testRuntimeClasspath org.hibernate:hibernate-core:5.6.15.Final=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath org.javassist:javassist:3.24.0-GA=testCompileClasspath,testRuntimeClasspath @@ -164,6 +168,7 @@ org.jboss:jandex:2.1.3.Final=testCompileClasspath,testRuntimeClasspath org.jboss:jandex:2.4.2.Final=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -183,24 +188,25 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,muzzleTooling,runtimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,muzzleTooling,runtimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.36=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath -org.slf4j:jul-to-slf4j:2.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.slf4j:jul-to-slf4j:2.0.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:jul-to-slf4j:2.0.4=spring6TestCompileClasspath,spring6TestRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:1.7.36=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath -org.slf4j:slf4j-api:2.0.17=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,spotbugsSlf4j +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j +org.slf4j:slf4j-api:2.0.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:slf4j-api:2.0.4=spring6TestCompileClasspath,spring6TestRuntimeClasspath org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestSpring5TestRuntimeClasspath,muzzleTooling,runtimeClasspath,spring6TestRuntimeClasspath,testRuntimeClasspath @@ -211,7 +217,7 @@ org.springframework.boot:spring-boot-actuator:2.4.0=latestDepForkedTestCompileCl org.springframework.boot:spring-boot-autoconfigure:2.4.0=testCompileClasspath,testRuntimeClasspath org.springframework.boot:spring-boot-autoconfigure:2.7.18=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath org.springframework.boot:spring-boot-autoconfigure:3.0.0=spring6TestCompileClasspath,spring6TestRuntimeClasspath -org.springframework.boot:spring-boot-autoconfigure:3.5.14=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-autoconfigure:3.5.16=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot-starter-actuator:2.4.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.springframework.boot:spring-boot-starter-aop:2.4.0=testCompileClasspath,testRuntimeClasspath org.springframework.boot:spring-boot-starter-aop:2.7.18=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath @@ -219,77 +225,77 @@ org.springframework.boot:spring-boot-starter-aop:3.0.0=spring6TestCompileClasspa org.springframework.boot:spring-boot-starter-data-jpa:2.4.0=testCompileClasspath,testRuntimeClasspath org.springframework.boot:spring-boot-starter-data-jpa:2.7.18=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath org.springframework.boot:spring-boot-starter-data-jpa:3.0.0=spring6TestCompileClasspath,spring6TestRuntimeClasspath -org.springframework.boot:spring-boot-starter-data-jpa:3.5.14=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-starter-data-jpa:3.5.16=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot-starter-jdbc:2.4.0=testCompileClasspath,testRuntimeClasspath org.springframework.boot:spring-boot-starter-jdbc:2.7.18=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath org.springframework.boot:spring-boot-starter-jdbc:3.0.0=spring6TestCompileClasspath,spring6TestRuntimeClasspath -org.springframework.boot:spring-boot-starter-jdbc:3.5.14=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-starter-jdbc:3.5.16=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot-starter-logging:2.4.0=testCompileClasspath,testRuntimeClasspath org.springframework.boot:spring-boot-starter-logging:2.7.18=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath org.springframework.boot:spring-boot-starter-logging:3.0.0=spring6TestCompileClasspath,spring6TestRuntimeClasspath -org.springframework.boot:spring-boot-starter-logging:3.5.14=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-starter-logging:3.5.16=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot-starter:2.4.0=testCompileClasspath,testRuntimeClasspath org.springframework.boot:spring-boot-starter:2.7.18=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath org.springframework.boot:spring-boot-starter:3.0.0=spring6TestCompileClasspath,spring6TestRuntimeClasspath -org.springframework.boot:spring-boot-starter:3.5.14=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-starter:3.5.16=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot:2.4.0=testCompileClasspath,testRuntimeClasspath org.springframework.boot:spring-boot:2.7.18=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath org.springframework.boot:spring-boot:3.0.0=spring6TestCompileClasspath,spring6TestRuntimeClasspath -org.springframework.boot:spring-boot:3.5.14=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot:3.5.16=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.data:spring-data-commons:2.4.1=testCompileClasspath,testRuntimeClasspath org.springframework.data:spring-data-commons:2.7.18=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath org.springframework.data:spring-data-commons:3.0.0=spring6TestCompileClasspath,spring6TestRuntimeClasspath -org.springframework.data:spring-data-commons:3.5.11=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.data:spring-data-commons:3.5.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.data:spring-data-jpa:2.4.1=testCompileClasspath,testRuntimeClasspath org.springframework.data:spring-data-jpa:2.7.18=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath org.springframework.data:spring-data-jpa:3.0.0=spring6TestCompileClasspath,spring6TestRuntimeClasspath -org.springframework.data:spring-data-jpa:3.5.11=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.data:spring-data-jpa:3.5.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-aop:5.0.0.RELEASE=compileClasspath org.springframework:spring-aop:5.3.39=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath org.springframework:spring-aop:5.3.4=testCompileClasspath,testRuntimeClasspath org.springframework:spring-aop:6.0.2=spring6TestCompileClasspath,spring6TestRuntimeClasspath -org.springframework:spring-aop:6.2.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-aop:6.2.19=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-aspects:5.3.1=testCompileClasspath,testRuntimeClasspath org.springframework:spring-aspects:5.3.31=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath org.springframework:spring-aspects:6.0.2=spring6TestCompileClasspath,spring6TestRuntimeClasspath -org.springframework:spring-aspects:6.2.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-aspects:6.2.19=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-beans:5.0.0.RELEASE=compileClasspath org.springframework:spring-beans:5.3.39=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath org.springframework:spring-beans:5.3.4=testCompileClasspath,testRuntimeClasspath org.springframework:spring-beans:6.0.2=spring6TestCompileClasspath,spring6TestRuntimeClasspath -org.springframework:spring-beans:6.2.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-beans:6.2.19=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-context:5.0.0.RELEASE=compileClasspath org.springframework:spring-context:5.3.39=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath org.springframework:spring-context:5.3.4=testCompileClasspath,testRuntimeClasspath org.springframework:spring-context:6.0.2=spring6TestCompileClasspath,spring6TestRuntimeClasspath -org.springframework:spring-context:6.2.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-context:6.2.19=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-core:5.0.0.RELEASE=compileClasspath org.springframework:spring-core:5.3.39=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath org.springframework:spring-core:5.3.4=testCompileClasspath,testRuntimeClasspath org.springframework:spring-core:6.0.2=spring6TestCompileClasspath,spring6TestRuntimeClasspath -org.springframework:spring-core:6.2.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-core:6.2.19=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-expression:5.0.0.RELEASE=compileClasspath org.springframework:spring-expression:5.3.39=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath org.springframework:spring-expression:5.3.4=testCompileClasspath,testRuntimeClasspath org.springframework:spring-expression:6.0.2=spring6TestCompileClasspath,spring6TestRuntimeClasspath -org.springframework:spring-expression:6.2.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-expression:6.2.19=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-jcl:5.0.0.RELEASE=compileClasspath org.springframework:spring-jcl:5.3.39=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath org.springframework:spring-jcl:5.3.4=testCompileClasspath,testRuntimeClasspath org.springframework:spring-jcl:6.0.2=spring6TestCompileClasspath,spring6TestRuntimeClasspath -org.springframework:spring-jcl:6.2.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-jcl:6.2.19=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-jdbc:5.3.31=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath org.springframework:spring-jdbc:5.3.4=testCompileClasspath,testRuntimeClasspath org.springframework:spring-jdbc:6.0.2=spring6TestCompileClasspath,spring6TestRuntimeClasspath -org.springframework:spring-jdbc:6.2.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-jdbc:6.2.19=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-orm:5.3.1=testCompileClasspath,testRuntimeClasspath org.springframework:spring-orm:5.3.31=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath org.springframework:spring-orm:6.0.0=spring6TestCompileClasspath,spring6TestRuntimeClasspath -org.springframework:spring-orm:6.2.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-orm:6.2.19=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-tx:5.3.31=latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath org.springframework:spring-tx:5.3.4=testCompileClasspath,testRuntimeClasspath org.springframework:spring-tx:6.0.2=spring6TestCompileClasspath,spring6TestRuntimeClasspath -org.springframework:spring-tx:6.2.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-tx:6.2.19=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.tabletest:tabletest-junit:1.2.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestSpring5TestCompileClasspath,latestSpring5TestRuntimeClasspath,spring6TestCompileClasspath,spring6TestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs diff --git a/dd-java-agent/instrumentation/spring/spring-scheduling-3.1/src/main/java/datadog/trace/instrumentation/springscheduling/SpannedMethodInvocation.java b/dd-java-agent/instrumentation/spring/spring-scheduling-3.1/src/main/java/datadog/trace/instrumentation/springscheduling/SpannedMethodInvocation.java index 7e5fbea27c7..2b713ef8500 100644 --- a/dd-java-agent/instrumentation/spring/spring-scheduling-3.1/src/main/java/datadog/trace/instrumentation/springscheduling/SpannedMethodInvocation.java +++ b/dd-java-agent/instrumentation/spring/spring-scheduling-3.1/src/main/java/datadog/trace/instrumentation/springscheduling/SpannedMethodInvocation.java @@ -1,11 +1,12 @@ package datadog.trace.instrumentation.springscheduling; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopContinuation; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; import static datadog.trace.instrumentation.springscheduling.SpringSchedulingDecorator.DECORATE; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.Context; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.lang.reflect.AccessibleObject; import java.lang.reflect.Method; @@ -13,10 +14,10 @@ public class SpannedMethodInvocation implements MethodInvocation { - private final AgentScope.Continuation continuation; + private final ContextContinuation continuation; private final MethodInvocation delegate; - public SpannedMethodInvocation(AgentScope.Continuation continuation, MethodInvocation delegate) { + public SpannedMethodInvocation(ContextContinuation continuation, MethodInvocation delegate) { this.continuation = continuation; this.delegate = delegate; } @@ -34,7 +35,7 @@ public Object[] getArguments() { @Override public Object proceed() throws Throwable { CharSequence spanName = DECORATE.spanNameForMethod(delegate.getMethod()); - if (continuation != noopContinuation()) { + if (continuation.context() != Context.root()) { return invokeWithContinuation(spanName); } else { return invokeWithSpan(spanName); @@ -42,14 +43,14 @@ public Object proceed() throws Throwable { } private Object invokeWithContinuation(CharSequence spanName) throws Throwable { - try (AgentScope scope = continuation.activate()) { + try (ContextScope scope = continuation.resume()) { return invokeWithSpan(spanName); } } private Object invokeWithSpan(CharSequence spanName) throws Throwable { AgentSpan span = startSpan("spring-scheduling", spanName); - try (AgentScope scope = activateSpan(span)) { + try (ContextScope scope = activateSpan(span)) { return delegate.proceed(); } finally { span.finish(); diff --git a/dd-java-agent/instrumentation/spring/spring-scheduling-3.1/src/main/java/datadog/trace/instrumentation/springscheduling/SpringSchedulingDecorator.java b/dd-java-agent/instrumentation/spring/spring-scheduling-3.1/src/main/java/datadog/trace/instrumentation/springscheduling/SpringSchedulingDecorator.java index 863263df6d2..ca149b19830 100644 --- a/dd-java-agent/instrumentation/spring/spring-scheduling-3.1/src/main/java/datadog/trace/instrumentation/springscheduling/SpringSchedulingDecorator.java +++ b/dd-java-agent/instrumentation/spring/spring-scheduling-3.1/src/main/java/datadog/trace/instrumentation/springscheduling/SpringSchedulingDecorator.java @@ -26,7 +26,7 @@ protected CharSequence component() { return "spring-scheduling"; } - public AgentSpan onRun(final AgentSpan span, final Runnable runnable) { + public void onRun(final AgentSpan span, final Runnable runnable) { if (runnable != null) { CharSequence resourceName = ""; if (runnable instanceof ScheduledMethodRunnable) { @@ -37,6 +37,5 @@ public AgentSpan onRun(final AgentSpan span, final Runnable runnable) { } span.setResourceName(resourceName); } - return span; } } diff --git a/dd-java-agent/instrumentation/spring/spring-scheduling-3.1/src/main/java/datadog/trace/instrumentation/springscheduling/SpringSchedulingRunnableWrapper.java b/dd-java-agent/instrumentation/spring/spring-scheduling-3.1/src/main/java/datadog/trace/instrumentation/springscheduling/SpringSchedulingRunnableWrapper.java index bf0dc7ceced..553f4518d83 100644 --- a/dd-java-agent/instrumentation/spring/spring-scheduling-3.1/src/main/java/datadog/trace/instrumentation/springscheduling/SpringSchedulingRunnableWrapper.java +++ b/dd-java-agent/instrumentation/spring/spring-scheduling-3.1/src/main/java/datadog/trace/instrumentation/springscheduling/SpringSchedulingRunnableWrapper.java @@ -7,8 +7,8 @@ import static datadog.trace.instrumentation.springscheduling.SpringSchedulingDecorator.DECORATE; import static datadog.trace.instrumentation.springscheduling.SpringSchedulingDecorator.SCHEDULED_CALL; +import datadog.context.ContextScope; import datadog.trace.api.Config; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.util.MethodHandles; import java.lang.invoke.MethodHandle; @@ -60,7 +60,7 @@ public void run() { : startSpan("spring-scheduling", SCHEDULED_CALL, null); DECORATE.afterStart(span); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { DECORATE.onRun(span, runnable); try { diff --git a/dd-java-agent/instrumentation/spring/spring-security/spring-security-5.0/gradle.lockfile b/dd-java-agent/instrumentation/spring/spring-security/spring-security-5.0/gradle.lockfile index 5a9564b1280..efc57dcaa4b 100644 --- a/dd-java-agent/instrumentation/spring/spring-security/spring-security-5.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/spring/spring-security/spring-security-5.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:spring:spring-security:spring-security-5.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -27,15 +28,15 @@ com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.5=latestDepTest com.fasterxml.jackson:jackson-bom:2.13.0=testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.13.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -45,12 +46,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.jayway.jsonpath:json-path:2.6.0=testCompileClasspath,testRuntimeClasspath com.jayway.jsonpath:json-path:2.7.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -64,15 +68,15 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:1.2.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.xml.bind:jakarta.xml.bind-api:2.3.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.minidev:accessors-smart:2.4.7=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -115,6 +119,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -136,14 +141,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.skyscreamer:jsonassert:1.5.0=testCompileClasspath,testRuntimeClasspath org.skyscreamer:jsonassert:1.5.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/spring/spring-security/spring-security-5.0/src/test/groovy/datadog/trace/instrumentation/springsecurity5/SpringBootBasedTest.groovy b/dd-java-agent/instrumentation/spring/spring-security/spring-security-5.0/src/test/groovy/datadog/trace/instrumentation/springsecurity5/SpringBootBasedTest.groovy index 8e869deb22c..15cb8cab358 100644 --- a/dd-java-agent/instrumentation/spring/spring-security/spring-security-5.0/src/test/groovy/datadog/trace/instrumentation/springsecurity5/SpringBootBasedTest.groovy +++ b/dd-java-agent/instrumentation/spring/spring-security/spring-security-5.0/src/test/groovy/datadog/trace/instrumentation/springsecurity5/SpringBootBasedTest.groovy @@ -279,7 +279,7 @@ class SpringBootBasedTest extends AppSecHttpServerTest key.startsWith('appsec.events.users.login') }.isEmpty() // single call to the appender 1 * appender.doAppend(_) >> { diff --git a/dd-java-agent/instrumentation/spring/spring-security/spring-security-6.0/gradle.lockfile b/dd-java-agent/instrumentation/spring/spring-security/spring-security-6.0/gradle.lockfile index 7e73cdd0861..d73814e51b9 100644 --- a/dd-java-agent/instrumentation/spring/spring-security/spring-security-6.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/spring/spring-security/spring-security-6.0/gradle.lockfile @@ -1,43 +1,44 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:spring:spring-security:spring-security-6.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.4.5=testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-classic:1.5.32=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +ch.qos.logback:logback-classic:1.5.34=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath ch.qos.logback:logback-core:1.4.5=testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.5.32=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +ch.qos.logback:logback-core:1.5.34=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-annotations:2.14.1=testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-annotations:2.21=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-core:2.14.1=testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.21.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-core:2.21.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-databind:2.14.1=testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.21.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-databind:2.21.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.14.1=testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.21.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.21.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.14.1=testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.21.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.21.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.module:jackson-module-parameter-names:2.14.1=testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.module:jackson-module-parameter-names:2.21.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.module:jackson-module-parameter-names:2.21.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.14.1=testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.21.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson:jackson-bom:2.21.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -47,12 +48,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.jayway.jsonpath:json-path:2.7.0=testCompileClasspath,testRuntimeClasspath com.jayway.jsonpath:json-path:2.9.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -67,20 +71,20 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath io.micrometer:micrometer-commons:1.10.1=testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-commons:1.15.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micrometer:micrometer-commons:1.15.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micrometer:micrometer-observation:1.10.1=testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-observation:1.15.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.micrometer:micrometer-observation:1.15.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:2.1.0=testCompileClasspath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:2.1.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath jakarta.annotation:jakarta.annotation-api:2.1.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.xml.bind:jakarta.xml.bind-api:4.0.0=testCompileClasspath,testRuntimeClasspath -jakarta.xml.bind:jakarta.xml.bind-api:4.0.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +jakarta.xml.bind:jakarta.xml.bind-api:4.0.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.minidev:accessors-smart:2.4.7=testCompileClasspath,testRuntimeClasspath @@ -100,11 +104,11 @@ org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apache.logging.log4j:log4j-to-slf4j:2.19.0=testCompileClasspath,testRuntimeClasspath org.apache.logging.log4j:log4j-to-slf4j:2.24.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.tomcat.embed:tomcat-embed-core:10.1.1=testCompileClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-core:10.1.54=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.tomcat.embed:tomcat-embed-core:10.1.55=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.tomcat.embed:tomcat-embed-el:10.1.1=testCompileClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-el:10.1.54=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.tomcat.embed:tomcat-embed-el:10.1.55=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.tomcat.embed:tomcat-embed-websocket:10.1.1=testCompileClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-websocket:10.1.54=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.tomcat.embed:tomcat-embed-websocket:10.1.55=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apiguardian:apiguardian-api:1.1.2=latestDepTestCompileClasspath,testCompileClasspath org.assertj:assertj-core:3.23.1=testCompileClasspath,testRuntimeClasspath org.assertj:assertj-core:3.27.7=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -126,6 +130,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -146,75 +151,76 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.skyscreamer:jsonassert:1.5.1=testCompileClasspath,testRuntimeClasspath org.skyscreamer:jsonassert:1.5.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:jul-to-slf4j:2.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.slf4j:jul-to-slf4j:2.0.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:jul-to-slf4j:2.0.4=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath -org.slf4j:slf4j-api:2.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,spotbugsSlf4j +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j +org.slf4j:slf4j-api:2.0.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:slf4j-api:2.0.4=testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath org.spockframework:spock-bom:2.4-groovy-3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.springframework.boot:spring-boot-autoconfigure:3.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-autoconfigure:3.5.14=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-autoconfigure:3.5.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot-starter-json:3.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-json:3.5.14=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-starter-json:3.5.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot-starter-logging:3.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-logging:3.5.14=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-starter-logging:3.5.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot-starter-security:3.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-security:3.5.14=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-starter-security:3.5.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot-starter-test:3.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-test:3.5.14=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-starter-test:3.5.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot-starter-tomcat:3.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-tomcat:3.5.14=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-starter-tomcat:3.5.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot-starter-web:3.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-web:3.5.14=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-starter-web:3.5.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot-starter:3.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter:3.5.14=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-starter:3.5.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot-test-autoconfigure:3.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-test-autoconfigure:3.5.14=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-test-autoconfigure:3.5.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot-test:3.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-test:3.5.14=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-test:3.5.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot:3.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot:3.5.14=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot:3.5.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.security:spring-security-config:6.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.security:spring-security-config:6.5.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.security:spring-security-config:6.5.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.security:spring-security-core:6.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.security:spring-security-core:6.5.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.security:spring-security-core:6.5.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.security:spring-security-crypto:6.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.security:spring-security-crypto:6.5.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.security:spring-security-crypto:6.5.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.security:spring-security-web:6.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.security:spring-security-web:6.5.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.security:spring-security-web:6.5.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-aop:6.0.2=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-aop:6.2.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-aop:6.2.19=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-beans:6.0.2=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-beans:6.2.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-beans:6.2.19=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-context:6.0.2=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-context:6.2.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-context:6.2.19=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-core:6.0.2=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-core:6.2.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-core:6.2.19=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-expression:6.0.2=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-expression:6.2.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-expression:6.2.19=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-jcl:6.0.2=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-jcl:6.2.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-jcl:6.2.19=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-test:6.0.2=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-test:6.2.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-test:6.2.19=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-web:6.0.2=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-web:6.2.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-web:6.2.19=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-webmvc:6.0.2=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-webmvc:6.2.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-webmvc:6.2.19=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.tabletest:tabletest-junit:1.2.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs diff --git a/dd-java-agent/instrumentation/spring/spring-security/spring-security-6.0/src/test/groovy/datadog/trace/instrumentation/springsecurity6/SpringBootBasedTest.groovy b/dd-java-agent/instrumentation/spring/spring-security/spring-security-6.0/src/test/groovy/datadog/trace/instrumentation/springsecurity6/SpringBootBasedTest.groovy index d7e17fb8051..902cf1786b8 100644 --- a/dd-java-agent/instrumentation/spring/spring-security/spring-security-6.0/src/test/groovy/datadog/trace/instrumentation/springsecurity6/SpringBootBasedTest.groovy +++ b/dd-java-agent/instrumentation/spring/spring-security/spring-security-6.0/src/test/groovy/datadog/trace/instrumentation/springsecurity6/SpringBootBasedTest.groovy @@ -254,7 +254,7 @@ class SpringBootBasedTest extends AppSecHttpServerTest key.startsWith('appsec.events.users.login')}.isEmpty() // single call to the appender 1 * appender.doAppend(_) >> { diff --git a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/gradle.lockfile b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/gradle.lockfile index 9e50521bc5f..c4a0e6da783 100644 --- a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:spring:spring-webflux:spring-webflux-5.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=iastTestCompileClasspath,iastTestRuntimeClass com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath @@ -35,15 +36,15 @@ com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.8=iastTestCompil com.fasterxml.jackson:jackson-bom:2.13.5=latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath com.fasterxml:classmate:1.3.4=iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,iastTestAnnotationProcessor,iastTestCompileClasspath,latestBoot20TestAnnotationProcessor,latestBoot20TestCompileClasspath,latestBoot24TestAnnotationProcessor,latestBoot24TestCompileClasspath,latestBoot2LatestTestAnnotationProcessor,latestBoot2LatestTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestIast24TestAnnotationProcessor,latestIast24TestCompileClasspath,latestIast3TestAnnotationProcessor,latestIast3TestCompileClasspath,latestIastTestAnnotationProcessor,latestIastTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -53,12 +54,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,iastT com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,iastTestAnnotationProcessor,latestBoot20TestAnnotationProcessor,latestBoot24TestAnnotationProcessor,latestBoot2LatestTestAnnotationProcessor,latestDepTestAnnotationProcessor,latestIast24TestAnnotationProcessor,latestIast3TestAnnotationProcessor,latestIastTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,iastTestAnnotationProcessor,latestBoot20TestAnnotationProcessor,latestBoot24TestAnnotationProcessor,latestBoot2LatestTestAnnotationProcessor,latestDepTestAnnotationProcessor,latestIast24TestAnnotationProcessor,latestIast3TestAnnotationProcessor,latestIastTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,iastTestAnnotationProcessor,latestBoot20TestAnnotationProcessor,latestBoot24TestAnnotationProcessor,latestBoot2LatestTestAnnotationProcessor,latestDepTestAnnotationProcessor,latestIast24TestAnnotationProcessor,latestIast3TestAnnotationProcessor,latestIastTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,iastTestAnnotationProcessor,latestBoot20TestAnnotationProcessor,latestBoot24TestAnnotationProcessor,latestBoot2LatestTestAnnotationProcessor,latestDepTestAnnotationProcessor,latestIast24TestAnnotationProcessor,latestIast3TestAnnotationProcessor,latestIastTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,iastTestAnnotationProcessor,iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestAnnotationProcessor,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestAnnotationProcessor,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestAnnotationProcessor,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestIast24TestAnnotationProcessor,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestAnnotationProcessor,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath,latestIastTestAnnotationProcessor,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,iastTestAnnotationProcessor,latestBoot20TestAnnotationProcessor,latestBoot24TestAnnotationProcessor,latestBoot2LatestTestAnnotationProcessor,latestDepTestAnnotationProcessor,latestIast24TestAnnotationProcessor,latestIast3TestAnnotationProcessor,latestIastTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath com.jayway.jsonpath:json-path:2.4.0=iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath com.jayway.jsonpath:json-path:2.7.0=latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath com.squareup.moshi:moshi:1.11.0=iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -140,7 +144,7 @@ io.projectreactor:reactor-core:3.1.16.RELEASE=iastTestCompileClasspath,iastTestR io.projectreactor:reactor-core:3.4.12=latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath io.projectreactor:reactor-core:3.4.34=latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath io.projectreactor:reactor-core:3.4.41=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:1.2.2=latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath jakarta.xml.bind:jakarta.xml.bind-api:2.3.3=latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath @@ -150,8 +154,8 @@ javax.validation:validation-api:2.0.1.Final=iastTestCompileClasspath,iastTestRun jaxen:jaxen:2.0.0=spotbugs junit:junit:4.12=iastTestCompileClasspath,latestBoot20TestCompileClasspath,latestIast3TestCompileClasspath junit:junit:4.13.2=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath net.minidev:accessors-smart:1.2=iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath @@ -196,6 +200,7 @@ org.hibernate.validator:hibernate-validator:6.0.16.Final=iastTestCompileClasspat org.jboss.logging:jboss-logging:3.3.2.Final=iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -218,14 +223,14 @@ org.objenesis:objenesis:3.3=iastTestCompileClasspath,iastTestRuntimeClasspath,la org.opentest4j:opentest4j:1.3.0=iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=iastTestRuntimeClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestRuntimeClasspath,latestIast24TestRuntimeClasspath,latestIast3TestRuntimeClasspath,latestIastTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestBoot2LatestTestCompileClasspath,latestBoot2LatestTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath,latestIastTestCompileClasspath,latestIastTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.1=compileClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.2=iastTestCompileClasspath,iastTestRuntimeClasspath,latestBoot20TestCompileClasspath,latestBoot20TestRuntimeClasspath,latestIast3TestCompileClasspath,latestIast3TestRuntimeClasspath org.reactivestreams:reactive-streams:1.0.3=latestBoot24TestCompileClasspath,latestBoot24TestRuntimeClasspath,latestIast24TestCompileClasspath,latestIast24TestRuntimeClasspath diff --git a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/bootTest/groovy/SpringWebfluxTest.groovy b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/bootTest/groovy/SpringWebfluxTest.groovy index f34edaf1f33..13cd0e3ff93 100644 --- a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/bootTest/groovy/SpringWebfluxTest.groovy +++ b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/bootTest/groovy/SpringWebfluxTest.groovy @@ -53,10 +53,6 @@ class SpringWebfluxTest extends InstrumentationSpecification { WebClient client = WebClient.builder().clientConnector(new ReactorClientHttpConnector()).build() - @Override - boolean useStrictTraceWrites() { - false - } def "Basic GET test #testName"() { setup: diff --git a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/client/TraceWebClientSubscriber.java b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/client/TraceWebClientSubscriber.java index b04c5cf9eea..c0d75bf4999 100644 --- a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/client/TraceWebClientSubscriber.java +++ b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/client/TraceWebClientSubscriber.java @@ -4,7 +4,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpan; import static datadog.trace.instrumentation.springwebflux.client.SpringWebfluxHttpClientDecorator.DECORATE; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import org.reactivestreams.Subscription; import org.springframework.web.reactive.function.client.ClientResponse; @@ -32,14 +32,14 @@ public TraceWebClientSubscriber( @Override public void onSubscribe(final Subscription subscription) { - try (final AgentScope scope = activateSpan(parent)) { + try (final ContextScope scope = activateSpan(parent)) { actual.onSubscribe(subscription); } } @Override public void onNext(final ClientResponse response) { - try (final AgentScope scope = activateSpan(parent)) { + try (final ContextScope scope = activateSpan(parent)) { actual.onNext(response); } finally { DECORATE.onResponse(span, response); @@ -50,7 +50,7 @@ public void onNext(final ClientResponse response) { @Override public void onError(final Throwable t) { - try (final AgentScope scope = activateSpan(parent)) { + try (final ContextScope scope = activateSpan(parent)) { actual.onError(t); } finally { DECORATE.onError(span, t); @@ -62,7 +62,7 @@ public void onError(final Throwable t) { @Override public void onComplete() { - try (final AgentScope scope = activateSpan(parent)) { + try (final ContextScope scope = activateSpan(parent)) { actual.onComplete(); } } diff --git a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/client/WebClientTracingFilter.java b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/client/WebClientTracingFilter.java index 79f0e3c5310..ad84ba4be92 100644 --- a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/client/WebClientTracingFilter.java +++ b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/client/WebClientTracingFilter.java @@ -6,7 +6,7 @@ import static datadog.trace.instrumentation.springwebflux.client.SpringWebfluxHttpClientDecorator.DECORATE; import static datadog.trace.instrumentation.springwebflux.client.SpringWebfluxHttpClientDecorator.HTTP_REQUEST; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.util.List; import org.springframework.web.reactive.function.client.ClientRequest; @@ -54,7 +54,7 @@ public void subscribe(final CoreSubscriber subscriber) { DECORATE.afterStart(span); DECORATE.onRequest(span, request); AgentSpan parent = activeSpan(); - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { TraceWebClientSubscriber tracingSubscriber = new TraceWebClientSubscriber(subscriber, span, parent); next.exchange(request).doOnCancel(tracingSubscriber::onCancel).subscribe(tracingSubscriber); diff --git a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/server/DispatcherHandlerAdvice.java b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/server/DispatcherHandlerAdvice.java index efcbab555d1..2f5cdcbeae8 100644 --- a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/server/DispatcherHandlerAdvice.java +++ b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/server/DispatcherHandlerAdvice.java @@ -6,10 +6,10 @@ import static datadog.trace.instrumentation.springwebflux.server.SpringWebfluxHttpServerDecorator.DECORATE; import static datadog.trace.instrumentation.springwebflux.server.SpringWebfluxHttpServerDecorator.DISPATCHER_HANDLE_HANDLER; -import datadog.context.Context; import datadog.trace.bootstrap.InstrumentationContext; import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.reactivestreams.HandoffContext; import java.util.function.Consumer; import net.bytebuddy.asm.Advice; import org.reactivestreams.Publisher; @@ -51,7 +51,8 @@ public static void methodExit( final AgentSpan span = scope.span(); final Consumer finisher = new AdviceUtils.MonoSpanFinisher(span); mono = mono.doOnError(finisher).doFinally(finisher); - InstrumentationContext.get(Publisher.class, Context.class).put(mono, span); + InstrumentationContext.get(Publisher.class, HandoffContext.class) + .put(mono, HandoffContext.anyThread(span)); } scope.close(); // span finished in MonoSpanFinisher diff --git a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/server/DispatcherHandlerInstrumentation.java b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/server/DispatcherHandlerInstrumentation.java index 9488b2e6950..94a340dbcd7 100644 --- a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/server/DispatcherHandlerInstrumentation.java +++ b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/server/DispatcherHandlerInstrumentation.java @@ -7,9 +7,9 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArguments; import com.google.auto.service.AutoService; -import datadog.context.Context; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; +import datadog.trace.bootstrap.instrumentation.reactivestreams.HandoffContext; import java.util.Collections; import java.util.Map; @@ -24,7 +24,8 @@ public String instrumentedType() { @Override public Map contextStore() { - return Collections.singletonMap("org.reactivestreams.Publisher", Context.class.getName()); + return Collections.singletonMap( + "org.reactivestreams.Publisher", HandoffContext.class.getName()); } @Override diff --git a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/server/HandleResultAdvice.java b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/server/HandleResultAdvice.java index 52fe8d67558..6cfd3f903d4 100644 --- a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/server/HandleResultAdvice.java +++ b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/server/HandleResultAdvice.java @@ -1,8 +1,8 @@ package datadog.trace.instrumentation.springwebflux.server; -import datadog.context.Context; import datadog.trace.bootstrap.InstrumentationContext; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.reactivestreams.HandoffContext; import net.bytebuddy.asm.Advice; import org.reactivestreams.Publisher; import org.springframework.web.server.ServerWebExchange; @@ -15,7 +15,8 @@ public static void methodExit( @Advice.Return(readOnly = false) Mono mono) { final AgentSpan span = exchange.getAttribute(AdviceUtils.SPAN_ATTRIBUTE); if (span != null && mono != null) { - InstrumentationContext.get(Publisher.class, Context.class).put(mono, span); + InstrumentationContext.get(Publisher.class, HandoffContext.class) + .put(mono, HandoffContext.anyThread(span)); } } } diff --git a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/server/HandlerAdapterAdvice.java b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/server/HandlerAdapterAdvice.java index 592a594e624..326ddce3ff4 100644 --- a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/server/HandlerAdapterAdvice.java +++ b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/server/HandlerAdapterAdvice.java @@ -5,10 +5,10 @@ import static datadog.trace.instrumentation.springwebflux.server.AdviceUtils.constructOperationName; import static datadog.trace.instrumentation.springwebflux.server.SpringWebfluxHttpServerDecorator.DECORATE; -import datadog.context.Context; import datadog.trace.bootstrap.InstrumentationContext; import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.reactivestreams.HandoffContext; import net.bytebuddy.asm.Advice; import org.reactivestreams.Publisher; import org.springframework.http.HttpMethod; @@ -72,7 +72,8 @@ public static void methodExit( if (throwable != null) { DECORATE.onError(scope, throwable); } else if (mono != null) { - InstrumentationContext.get(Publisher.class, Context.class).put(mono, scope.span()); + InstrumentationContext.get(Publisher.class, HandoffContext.class) + .put(mono, HandoffContext.anyThread(scope.span())); } scope.close(); // span finished in SpanFinishingSubscriber diff --git a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/server/HandlerAdapterInstrumentation.java b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/server/HandlerAdapterInstrumentation.java index f3196983e0a..7d0c9b48410 100644 --- a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/server/HandlerAdapterInstrumentation.java +++ b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/main/java/datadog/trace/instrumentation/springwebflux/server/HandlerAdapterInstrumentation.java @@ -9,9 +9,9 @@ import static net.bytebuddy.matcher.ElementMatchers.takesArguments; import com.google.auto.service.AutoService; -import datadog.context.Context; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; +import datadog.trace.bootstrap.instrumentation.reactivestreams.HandoffContext; import java.util.Collections; import java.util.Map; import net.bytebuddy.description.type.TypeDescription; @@ -33,7 +33,8 @@ public ElementMatcher hierarchyMatcher() { @Override public Map contextStore() { - return Collections.singletonMap("org.reactivestreams.Publisher", Context.class.getName()); + return Collections.singletonMap( + "org.reactivestreams.Publisher", HandoffContext.class.getName()); } @Override diff --git a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/test/groovy/dd/trace/instrumentation/springwebflux/client/SpringWebfluxHttpClientBase.groovy b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/test/groovy/dd/trace/instrumentation/springwebflux/client/SpringWebfluxHttpClientBase.groovy index 8c60fddbff3..3b8fca1f2a9 100644 --- a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/test/groovy/dd/trace/instrumentation/springwebflux/client/SpringWebfluxHttpClientBase.groovy +++ b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-5.0/src/test/groovy/dd/trace/instrumentation/springwebflux/client/SpringWebfluxHttpClientBase.groovy @@ -21,12 +21,6 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan abstract class SpringWebfluxHttpClientBase extends HttpClientTest implements TestingGenericHttpNamingConventions.ClientV0 { - @Override - boolean useStrictTraceWrites() { - // TODO fix this by making sure that spans get closed properly - return false - } - abstract WebClient createClient(CharSequence component) abstract void check() diff --git a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-6.0/gradle.lockfile b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-6.0/gradle.lockfile index b07727c9f44..28e2e072db8 100644 --- a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-6.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-6.0/gradle.lockfile @@ -1,45 +1,46 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:spring:spring-webflux:spring-webflux-6.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.4.5=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -ch.qos.logback:logback-classic:1.5.32=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath +ch.qos.logback:logback-classic:1.5.34=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.4.5=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -ch.qos.logback:logback-core:1.5.32=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath +ch.qos.logback:logback-core:1.5.34=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=bootTestCompileClasspath,bootTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=bootTestCompileClasspath,bootTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=bootTestCompileClasspath,bootTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=bootTestCompileClasspath,bootTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-annotations:2.14.1=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath com.fasterxml.jackson.core:jackson-annotations:2.21=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath com.fasterxml.jackson.core:jackson-core:2.14.1=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.21.2=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-core:2.21.4=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath com.fasterxml.jackson.core:jackson-databind:2.14.1=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.21.2=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-databind:2.21.4=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.14.1=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.21.2=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath +com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.21.4=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.14.1=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.21.2=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath +com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.21.4=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath com.fasterxml.jackson.module:jackson-module-parameter-names:2.14.1=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -com.fasterxml.jackson.module:jackson-module-parameter-names:2.21.2=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath +com.fasterxml.jackson.module:jackson-module-parameter-names:2.21.4=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.14.1=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.21.2=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath +com.fasterxml.jackson:jackson-bom:2.21.4=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=bootTestCompileClasspath,bootTestRuntimeClasspath,compileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,bootTestAnnotationProcessor,bootTestCompileClasspath,compileClasspath,iastTestAnnotationProcessor,iastTestCompileClasspath,latestDepBootTestAnnotationProcessor,latestDepBootTestCompileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -49,12 +50,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,bootTestAnnotationProc com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,bootTestAnnotationProcessor,iastTestAnnotationProcessor,latestDepBootTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,bootTestAnnotationProcessor,iastTestAnnotationProcessor,latestDepBootTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,bootTestAnnotationProcessor,iastTestAnnotationProcessor,latestDepBootTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,bootTestAnnotationProcessor,iastTestAnnotationProcessor,latestDepBootTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,bootTestAnnotationProcessor,bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestAnnotationProcessor,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestAnnotationProcessor,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,bootTestAnnotationProcessor,iastTestAnnotationProcessor,latestDepBootTestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.jayway.jsonpath:json-path:2.7.0=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath com.jayway.jsonpath:json-path:2.9.0=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath com.squareup.moshi:moshi:1.11.0=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -70,69 +74,69 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=bootTestCompileClasspath,bootTestRuntimeClasspath,compileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.micrometer:micrometer-commons:1.10.0=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-commons:1.15.11=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micrometer:micrometer-commons:1.15.12=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micrometer:micrometer-observation:1.10.0=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-observation:1.15.11=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micrometer:micrometer-observation:1.15.12=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty.incubator:netty-incubator-codec-classes-quic:0.0.36.Final=bootTestRuntimeClasspath,iastTestRuntimeClasspath,testRuntimeClasspath io.netty.incubator:netty-incubator-codec-native-quic:0.0.36.Final=bootTestRuntimeClasspath,iastTestRuntimeClasspath,testRuntimeClasspath io.netty:netty-buffer:4.1.89.Final=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-buffer:4.2.12.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-base:4.2.12.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-classes-quic:4.2.12.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-compression:4.2.12.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-buffer:4.2.15.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-base:4.2.15.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-classes-quic:4.2.15.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-compression:4.2.15.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-dns:4.1.89.Final=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-dns:4.2.12.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-dns:4.2.15.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http2:4.1.89.Final=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-http2:4.2.12.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-http3:4.2.12.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http2:4.2.15.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http3:4.2.15.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http:4.1.89.Final=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-http:4.2.12.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-codec-native-quic:4.2.12.Final=latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http:4.2.15.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-native-quic:4.2.15.Final=latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-socks:4.1.89.Final=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-socks:4.2.12.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-socks:4.2.15.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec:4.1.89.Final=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-common:4.1.89.Final=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-common:4.2.12.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-common:4.2.15.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-handler-proxy:4.1.89.Final=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-handler-proxy:4.2.12.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler-proxy:4.2.15.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-handler:4.1.89.Final=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-handler:4.2.12.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler:4.2.15.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-resolver-dns-classes-macos:4.1.89.Final=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-resolver-dns-classes-macos:4.2.12.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver-dns-classes-macos:4.2.15.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-resolver-dns-native-macos:4.1.89.Final=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-resolver-dns-native-macos:4.2.12.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver-dns-native-macos:4.2.15.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-resolver-dns:4.1.89.Final=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-resolver-dns:4.2.12.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver-dns:4.2.15.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-resolver:4.1.89.Final=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-resolver:4.2.12.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver:4.2.15.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport-classes-epoll:4.1.89.Final=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-transport-classes-epoll:4.2.12.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-classes-epoll:4.2.15.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport-native-epoll:4.1.89.Final=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-transport-native-epoll:4.2.12.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-epoll:4.2.15.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport-native-unix-common:4.1.89.Final=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-transport-native-unix-common:4.2.12.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.2.15.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.89.Final=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-transport:4.2.12.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport:4.2.15.Final=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.projectreactor.netty.incubator:reactor-netty-incubator-quic:0.1.3=bootTestRuntimeClasspath,iastTestRuntimeClasspath,testRuntimeClasspath io.projectreactor.netty:reactor-netty-core:1.1.3=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.projectreactor.netty:reactor-netty-core:1.3.5=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.projectreactor.netty:reactor-netty-core:1.3.6=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.projectreactor.netty:reactor-netty-http:1.1.3=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.projectreactor.netty:reactor-netty-http:1.3.5=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.projectreactor.netty:reactor-netty-http:1.3.6=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.projectreactor.netty:reactor-netty:1.1.3=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.projectreactor.netty:reactor-netty:1.3.5=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.projectreactor.netty:reactor-netty:1.3.6=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.projectreactor:reactor-core:3.5.3=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.projectreactor:reactor-core:3.8.5=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.projectreactor:reactor-core:3.8.6=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:2.1.0=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath jakarta.activation:jakarta.activation-api:2.1.4=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath jakarta.annotation:jakarta.annotation-api:2.1.1=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath jakarta.xml.bind:jakarta.xml.bind-api:4.0.0=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -jakarta.xml.bind:jakarta.xml.bind-api:4.0.4=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath +jakarta.xml.bind:jakarta.xml.bind-api:4.0.5=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=bootTestCompileClasspath,bootTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=bootTestCompileClasspath,bootTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=bootTestCompileClasspath,bootTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=bootTestCompileClasspath,bootTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.minidev:accessors-smart:2.4.7=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath @@ -172,7 +176,7 @@ org.hamcrest:hamcrest-core:1.3=bootTestRuntimeClasspath,iastTestRuntimeClasspath org.hamcrest:hamcrest:3.0=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -org.jspecify:jspecify:1.0.0=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -194,25 +198,26 @@ org.objenesis:objenesis:3.3=bootTestCompileClasspath,bootTestRuntimeClasspath,ia org.opentest4j:opentest4j:1.3.0=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=bootTestRuntimeClasspath,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=bootTestCompileClasspath,bootTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=bootTestCompileClasspath,bootTestRuntimeClasspath,buildTimeInstrumentationPlugin,compileClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.4=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.skyscreamer:jsonassert:1.5.1=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath org.skyscreamer:jsonassert:1.5.3=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:jul-to-slf4j:2.0.17=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath +org.slf4j:jul-to-slf4j:2.0.18=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath org.slf4j:jul-to-slf4j:2.0.4=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath org.slf4j:slf4j-api:1.7.32=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:2.0.17=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,spotbugs,spotbugsSlf4j +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j +org.slf4j:slf4j-api:2.0.18=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath org.slf4j:slf4j-api:2.0.4=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.snakeyaml:snakeyaml-engine:2.9=bootTestRuntimeClasspath,buildTimeInstrumentationPlugin,iastTestRuntimeClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath @@ -220,49 +225,49 @@ org.spockframework:spock-bom:2.4-groovy-3.0=bootTestCompileClasspath,bootTestRun org.spockframework:spock-core:2.4-groovy-3.0=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.spockframework:spock-spring:2.4-groovy-3.0=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.springframework.boot:spring-boot-autoconfigure:3.0.0=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -org.springframework.boot:spring-boot-autoconfigure:3.5.14=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath +org.springframework.boot:spring-boot-autoconfigure:3.5.16=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath org.springframework.boot:spring-boot-starter-json:3.0.0=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -org.springframework.boot:spring-boot-starter-json:3.5.14=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath +org.springframework.boot:spring-boot-starter-json:3.5.16=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath org.springframework.boot:spring-boot-starter-logging:3.0.0=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -org.springframework.boot:spring-boot-starter-logging:3.5.14=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath +org.springframework.boot:spring-boot-starter-logging:3.5.16=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath org.springframework.boot:spring-boot-starter-reactor-netty:3.0.0=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -org.springframework.boot:spring-boot-starter-reactor-netty:3.5.14=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath +org.springframework.boot:spring-boot-starter-reactor-netty:3.5.16=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath org.springframework.boot:spring-boot-starter-test:3.0.0=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -org.springframework.boot:spring-boot-starter-test:3.5.14=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath +org.springframework.boot:spring-boot-starter-test:3.5.16=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath org.springframework.boot:spring-boot-starter-webflux:3.0.0=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -org.springframework.boot:spring-boot-starter-webflux:3.5.14=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath +org.springframework.boot:spring-boot-starter-webflux:3.5.16=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath org.springframework.boot:spring-boot-starter:3.0.0=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -org.springframework.boot:spring-boot-starter:3.5.14=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath +org.springframework.boot:spring-boot-starter:3.5.16=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath org.springframework.boot:spring-boot-test-autoconfigure:3.0.0=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -org.springframework.boot:spring-boot-test-autoconfigure:3.5.14=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath +org.springframework.boot:spring-boot-test-autoconfigure:3.5.16=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath org.springframework.boot:spring-boot-test:3.0.0=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -org.springframework.boot:spring-boot-test:3.5.14=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath +org.springframework.boot:spring-boot-test:3.5.16=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath org.springframework.boot:spring-boot:3.0.0=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -org.springframework.boot:spring-boot:3.5.14=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath +org.springframework.boot:spring-boot:3.5.16=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath org.springframework:spring-aop:6.0.2=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -org.springframework:spring-aop:6.2.18=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-aop:6.2.19=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-beans:6.0.0=testCompileClasspath,testRuntimeClasspath org.springframework:spring-beans:6.0.2=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -org.springframework:spring-beans:6.2.18=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-beans:6.2.19=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-context:6.0.2=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -org.springframework:spring-context:6.2.18=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-context:6.2.19=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-core:6.0.0=testCompileClasspath,testRuntimeClasspath org.springframework:spring-core:6.0.2=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -org.springframework:spring-core:6.2.18=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-core:6.2.19=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-expression:6.0.2=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -org.springframework:spring-expression:6.2.18=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-expression:6.2.19=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-jcl:6.0.0=testCompileClasspath,testRuntimeClasspath org.springframework:spring-jcl:6.0.2=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -org.springframework:spring-jcl:6.2.18=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-jcl:6.2.19=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-test:6.0.0=testCompileClasspath,testRuntimeClasspath org.springframework:spring-test:6.0.2=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -org.springframework:spring-test:6.2.18=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-test:6.2.19=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-web:6.0.0=testCompileClasspath,testRuntimeClasspath org.springframework:spring-web:6.0.2=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -org.springframework:spring-web:6.2.18=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-web:6.2.19=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-webflux:6.0.0=testCompileClasspath,testRuntimeClasspath org.springframework:spring-webflux:6.0.2=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath -org.springframework:spring-webflux:6.2.18=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-webflux:6.2.19=latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.tabletest:tabletest-junit:1.2.1=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=bootTestCompileClasspath,bootTestRuntimeClasspath,iastTestCompileClasspath,iastTestRuntimeClasspath,latestDepBootTestCompileClasspath,latestDepBootTestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs diff --git a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-6.0/src/bootTest/groovy/SpringWebfluxTest.groovy b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-6.0/src/bootTest/groovy/SpringWebfluxTest.groovy index fabf0c4469f..61b73aed5eb 100644 --- a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-6.0/src/bootTest/groovy/SpringWebfluxTest.groovy +++ b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-6.0/src/bootTest/groovy/SpringWebfluxTest.groovy @@ -859,11 +859,6 @@ class SpringWebfluxHttp11Test extends InstrumentationSpecification { } return ret } - - @Override - boolean useStrictTraceWrites() { - false - } } class SpringWebfluxHttp2UpgradeTest extends SpringWebfluxHttp11Test { diff --git a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-6.0/src/test/groovy/dd/trace/instrumentation/springwebflux6/client/SpringWebfluxHttpClientBase.groovy b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-6.0/src/test/groovy/dd/trace/instrumentation/springwebflux6/client/SpringWebfluxHttpClientBase.groovy index 0048091d901..b419398ca6a 100644 --- a/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-6.0/src/test/groovy/dd/trace/instrumentation/springwebflux6/client/SpringWebfluxHttpClientBase.groovy +++ b/dd-java-agent/instrumentation/spring/spring-webflux/spring-webflux-6.0/src/test/groovy/dd/trace/instrumentation/springwebflux6/client/SpringWebfluxHttpClientBase.groovy @@ -22,12 +22,6 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan abstract class SpringWebfluxHttpClientBase extends HttpClientTest implements TestingGenericHttpNamingConventions.ClientV0 { - @Override - boolean useStrictTraceWrites() { - // TODO fix this by making sure that spans get closed properly - return false - } - abstract WebClient createClient(CharSequence component) abstract void check() diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/gradle.lockfile b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/gradle.lockfile index 200dab8194b..e7c73703e44 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:spring:spring-webmvc:spring-webmvc-3.1:dependencies --write-locks aopalliance:aopalliance:1.0=compileClasspath,testCompileClasspath,testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -9,7 +10,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -25,15 +26,15 @@ com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.5=latestDepFork com.fasterxml.jackson:jackson-bom:2.13.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml:classmate:1.3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -43,12 +44,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.jayway.jsonpath:json-path:2.2.0=testCompileClasspath,testRuntimeClasspath com.jayway.jsonpath:json-path:2.7.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -69,7 +73,7 @@ commons-logging:commons-logging:1.1.1=compileClasspath,latestDepForkedTestCompil commons-logging:commons-logging:1.2=testCompileClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:1.2.1=testCompileClasspath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:1.2.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -83,8 +87,8 @@ javax.validation:validation-api:1.1.0.Final=latestDepForkedTestCompileClasspath, jaxen:jaxen:2.0.0=spotbugs junit:junit:4.12=testCompileClasspath junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.jcip:jcip-annotations:1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -144,6 +148,7 @@ org.jboss.resteasy:resteasy-jettison-provider:3.0.0.Final=latestDepForkedTestCom org.jboss.resteasy:resteasy-spring:3.0.0.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -165,14 +170,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.scannotation:scannotation:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.skyscreamer:jsonassert:1.4.0=testCompileClasspath,testRuntimeClasspath org.skyscreamer:jsonassert:1.5.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/latestDepTest/groovy/datadog/trace/instrumentation/springweb/HandlerMappingResourceNameFilterForkedTest.groovy b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/latestDepTest/groovy/datadog/trace/instrumentation/springweb/HandlerMappingResourceNameFilterForkedTest.groovy index c4a179c1b44..8c0a93a178a 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/latestDepTest/groovy/datadog/trace/instrumentation/springweb/HandlerMappingResourceNameFilterForkedTest.groovy +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/latestDepTest/groovy/datadog/trace/instrumentation/springweb/HandlerMappingResourceNameFilterForkedTest.groovy @@ -39,7 +39,7 @@ class HandlerMappingResourceNameFilterForkedTest extends InstrumentationSpecific when: runUnderTrace("test-servlet", { - request.setAttribute(DD_CONTEXT_ATTRIBUTE, activeSpan().context()) + request.setAttribute(DD_CONTEXT_ATTRIBUTE, activeSpan().spanContext()) filter.doFilterInternal(request, response, filterChain) }) diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/DispatcherServletInstrumentation.java b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/DispatcherServletInstrumentation.java index fd5be84e1d7..8909bf7ebda 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/DispatcherServletInstrumentation.java +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/DispatcherServletInstrumentation.java @@ -4,7 +4,6 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.springweb.SpringWebHttpServerDecorator.DECORATE; import static datadog.trace.instrumentation.springweb.SpringWebHttpServerDecorator.DECORATE_RENDER; @@ -100,7 +99,7 @@ public static ContextScope onEnter(@Advice.Argument(0) final ModelAndView mv) { final AgentSpan span = startSpan("spring-webmvc", RESPONSE_RENDER); DECORATE_RENDER.afterStart(span); DECORATE_RENDER.onRender(span, mv); - return getCurrentContext().with(span).attach(); + return span.attachWithContext(); } @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/HandlerAdapterInstrumentation.java b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/HandlerAdapterInstrumentation.java index ea8282e5681..3e4bd33e594 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/HandlerAdapterInstrumentation.java +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/HandlerAdapterInstrumentation.java @@ -5,8 +5,7 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; import static datadog.trace.instrumentation.springweb.SpringWebHttpServerDecorator.DD_HANDLER_SPAN_CONTINUE_SUFFIX; @@ -80,7 +79,7 @@ public static ContextScope nameResourceAndStartSpan( Context context = (Context) contextObj; AgentSpan parentSpan = spanFromContext(context); if (parentSpan != null) { - DECORATE.onRequest(parentSpan, request, request, getRootContext()); + DECORATE.onRequest(parentSpan, request, request, rootContext()); } } @@ -110,7 +109,7 @@ public static ContextScope nameResourceAndStartSpan( DECORATE.onHandle(span, handler); request.setAttribute(handlerSpanKey, span); - return getCurrentContext().with(span).attach(); + return span.attachWithContext(); } @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/HandlerMappingResourceNameFilter.java b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/HandlerMappingResourceNameFilter.java index 073bce859f1..1307d98fdc1 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/HandlerMappingResourceNameFilter.java +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/HandlerMappingResourceNameFilter.java @@ -1,7 +1,6 @@ package datadog.trace.instrumentation.springweb; import static datadog.context.Context.root; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; import static datadog.trace.instrumentation.springweb.SpringWebHttpServerDecorator.DECORATE; @@ -26,6 +25,7 @@ public class HandlerMappingResourceNameFilter extends OncePerRequestFilter implements Ordered { private static final Logger log = LoggerFactory.getLogger(HandlerMappingResourceNameFilter.class); + private final List handlerMappings = new CopyOnWriteArrayList<>(); @Override @@ -38,7 +38,7 @@ protected void doFilterInternal( final Object contextObj = request.getAttribute(DD_CONTEXT_ATTRIBUTE); if (contextObj instanceof Context) { Context context = (Context) contextObj; - AgentSpan parentSpan = spanFromContext(context); + AgentSpan parentSpan = AgentSpan.fromContext(context); if (parentSpan != null) { PathMatchingHttpServletRequestWrapper wrappedRequest = new PathMatchingHttpServletRequestWrapper(request); diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/HttpMessageConverterInstrumentation.java b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/HttpMessageConverterInstrumentation.java index 005e47e8fa6..d170a53cc22 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/HttpMessageConverterInstrumentation.java +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/HttpMessageConverterInstrumentation.java @@ -97,7 +97,7 @@ public void methodAdvice(MethodTransformer transformer) { @RequiresRequestContext(RequestContextSlot.APPSEC) public static class HttpMessageConverterReadAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void after( @Advice.Return final Object obj, @ActiveRequestContext RequestContext reqCtx, diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/SpringWebHttpServerDecorator.java b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/SpringWebHttpServerDecorator.java index 52ce8855048..1191761443f 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/SpringWebHttpServerDecorator.java +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/SpringWebHttpServerDecorator.java @@ -98,7 +98,7 @@ protected String getRequestHeader(final HttpServletRequest request, String key) } @Override - public AgentSpan onRequest( + public void onRequest( final AgentSpan span, final HttpServletRequest connection, final HttpServletRequest request, @@ -111,7 +111,6 @@ public AgentSpan onRequest( HTTP_RESOURCE_DECORATOR.withRoute(span, method, bestMatchingPattern.toString()); } } - return span; } public void onHandle(final AgentSpan span, final Object handler) { @@ -139,7 +138,7 @@ private String getMethodName(final Object handler) { } } - public AgentSpan onRender(final AgentSpan span, final ModelAndView mv) { + public void onRender(final AgentSpan span, final ModelAndView mv) { final String viewName = mv.getViewName(); if (viewName != null) { span.setTag("view.name", viewName); @@ -148,6 +147,5 @@ public AgentSpan onRender(final AgentSpan span, final ModelAndView mv) { if (mv.getView() != null) { span.setTag("view.type", className(mv.getView().getClass())); } - return span; } } diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/TemplateAndMatrixVariablesInstrumentation.java b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/TemplateAndMatrixVariablesInstrumentation.java index 4ad34b452ec..e82b9b55366 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/TemplateAndMatrixVariablesInstrumentation.java +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/TemplateAndMatrixVariablesInstrumentation.java @@ -98,7 +98,7 @@ public static class HandleMatchAdvice { "org.springframework.web.servlet.HandlerMapping.matrixVariables"; @SuppressWarnings("Duplicates") - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) @Source(SourceTypes.REQUEST_MATRIX_PARAMETER) public static void after( @Advice.Argument(2) final HttpServletRequest req, diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/TemplateVariablesUrlHandlerInstrumentation.java b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/TemplateVariablesUrlHandlerInstrumentation.java index 530bc5bb7b5..cc90713ea2a 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/TemplateVariablesUrlHandlerInstrumentation.java +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/main/java/datadog/trace/instrumentation/springweb/TemplateVariablesUrlHandlerInstrumentation.java @@ -86,7 +86,7 @@ public static class InterceptorPreHandleAdvice { "org.springframework.web.servlet.HandlerMapping.uriTemplateVariables"; @SuppressWarnings("Duplicates") - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) @Source(SourceTypes.REQUEST_PATH_PARAMETER) public static void after( @Advice.Argument(0) final HttpServletRequest req, diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/test/groovy/datadog/trace/instrumentation/springweb/HandlerMappingResourceNameFilterForkedTest.groovy b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/test/groovy/datadog/trace/instrumentation/springweb/HandlerMappingResourceNameFilterForkedTest.groovy index c4a179c1b44..8c0a93a178a 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/test/groovy/datadog/trace/instrumentation/springweb/HandlerMappingResourceNameFilterForkedTest.groovy +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/test/groovy/datadog/trace/instrumentation/springweb/HandlerMappingResourceNameFilterForkedTest.groovy @@ -39,7 +39,7 @@ class HandlerMappingResourceNameFilterForkedTest extends InstrumentationSpecific when: runUnderTrace("test-servlet", { - request.setAttribute(DD_CONTEXT_ATTRIBUTE, activeSpan().context()) + request.setAttribute(DD_CONTEXT_ATTRIBUTE, activeSpan().spanContext()) filter.doFilterInternal(request, response, filterChain) }) diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/test/groovy/test/boot/SpringBootBasedTest.groovy b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/test/groovy/test/boot/SpringBootBasedTest.groovy index 18badff3e97..89b0389c3da 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/test/groovy/test/boot/SpringBootBasedTest.groovy +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/test/groovy/test/boot/SpringBootBasedTest.groovy @@ -570,6 +570,9 @@ class SpringBootBasedTest extends HttpServerTest "$Tags.HTTP_ROUTE" "/success" "servlet.context" "/boot-context" "servlet.path" "/success" + if ({ isDataStreamsEnabled() }) { + "$DDTags.PATHWAY_HASH" { String } + } defaultTags() } } diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/test/groovy/test/filter/FilteredAppConfig.groovy b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/test/groovy/test/filter/FilteredAppConfig.groovy index 874fbefb5e1..f787fafbf82 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/test/groovy/test/filter/FilteredAppConfig.groovy +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-3.1/src/test/groovy/test/filter/FilteredAppConfig.groovy @@ -1,7 +1,26 @@ package test.filter -import com.google.common.base.Charsets +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.BODY_URLENCODED +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.ERROR +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.EXCEPTION +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.FORWARDED +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.PATH_PARAM +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.QUERY_ENCODED_BOTH +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.QUERY_ENCODED_QUERY +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.QUERY_PARAM +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.REDIRECT +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.SUCCESS +import static java.nio.charset.StandardCharsets.UTF_8 + import datadog.trace.agent.test.base.HttpServerTest +import javax.servlet.Filter +import javax.servlet.FilterChain +import javax.servlet.FilterConfig +import javax.servlet.ServletException +import javax.servlet.ServletRequest +import javax.servlet.ServletResponse +import javax.servlet.http.HttpServletRequest +import javax.servlet.http.HttpServletResponse import org.apache.catalina.connector.Connector import org.springframework.boot.autoconfigure.SpringBootApplication import org.springframework.boot.context.embedded.EmbeddedServletContainerFactory @@ -22,26 +41,6 @@ import org.springframework.web.context.request.NativeWebRequest import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter -import javax.servlet.Filter -import javax.servlet.FilterChain -import javax.servlet.FilterConfig -import javax.servlet.ServletException -import javax.servlet.ServletRequest -import javax.servlet.ServletResponse -import javax.servlet.http.HttpServletRequest -import javax.servlet.http.HttpServletResponse - -import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.BODY_URLENCODED -import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.ERROR -import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.EXCEPTION -import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.FORWARDED -import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.PATH_PARAM -import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.QUERY_ENCODED_BOTH -import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.QUERY_ENCODED_QUERY -import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.QUERY_PARAM -import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.REDIRECT -import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.SUCCESS - @SpringBootApplication class FilteredAppConfig extends WebMvcConfigurerAdapter { @@ -90,7 +89,7 @@ class FilteredAppConfig extends WebMvcConfigurerAdapter { @Override protected void writeInternal(Map stringObjectMap, HttpOutputMessage outputMessage) throws IOException, HttpMessageNotWritableException { - StreamUtils.copy(stringObjectMap.get("message"), Charsets.UTF_8, outputMessage.getBody()) + StreamUtils.copy(stringObjectMap.get("message"), UTF_8, outputMessage.getBody()) } } } diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-5.3/gradle.lockfile b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-5.3/gradle.lockfile index 4f7c4c07ffe..2b1529c37f5 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-5.3/gradle.lockfile +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-5.3/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:spring:spring-webmvc:spring-webmvc-5.3:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -20,15 +21,15 @@ com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.4=testCompileClasspa com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.4=testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.13.4=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,csiCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -38,12 +39,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,csiCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.jayway.jsonpath:json-path:2.7.0=testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -56,7 +60,7 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,csiCompileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath jakarta.activation:jakarta.activation-api:1.2.2=testCompileClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=testCompileClasspath,testRuntimeClasspath jakarta.xml.bind:jakarta.xml.bind-api:2.3.3=testCompileClasspath,testRuntimeClasspath @@ -64,8 +68,8 @@ javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:4.0.1=compileClasspath,csiCompileClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.minidev:accessors-smart:2.4.7=testCompileClasspath,testRuntimeClasspath @@ -102,6 +106,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -120,14 +125,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.skyscreamer:jsonassert:1.5.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.36=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/gradle.lockfile b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/gradle.lockfile index 2e555152a21..cdfffa5fa04 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/gradle.lockfile @@ -1,43 +1,44 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:spring:spring-webmvc:spring-webmvc-6.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.4.5=testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-classic:1.5.32=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +ch.qos.logback:logback-classic:1.5.34=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath ch.qos.logback:logback-core:1.4.5=testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.5.32=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +ch.qos.logback:logback-core:1.5.34=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-annotations:2.14.1=testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-annotations:2.21=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-core:2.14.1=testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.21.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-core:2.21.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-databind:2.14.1=testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.21.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-databind:2.21.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.14.1=testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.21.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.21.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.14.1=testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.21.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.21.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.module:jackson-module-parameter-names:2.14.1=testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.module:jackson-module-parameter-names:2.21.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.module:jackson-module-parameter-names:2.21.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.14.1=testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.21.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson:jackson-bom:2.21.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -50,11 +51,13 @@ com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestD com.google.errorprone:error_prone_annotations:2.41.0=spotbugs com.google.errorprone:error_prone_annotations:2.48.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.jayway.jsonpath:json-path:2.7.0=testCompileClasspath,testRuntimeClasspath com.jayway.jsonpath:json-path:2.9.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -70,22 +73,22 @@ de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,la io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath io.micrometer:micrometer-commons:1.10.0=main_java17CompileClasspath io.micrometer:micrometer-commons:1.10.1=testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-commons:1.15.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.micrometer:micrometer-commons:1.15.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.micrometer:micrometer-observation:1.10.0=main_java17CompileClasspath io.micrometer:micrometer-observation:1.10.1=testCompileClasspath,testRuntimeClasspath -io.micrometer:micrometer-observation:1.15.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.micrometer:micrometer-observation:1.15.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:2.1.0=testCompileClasspath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:2.1.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath jakarta.annotation:jakarta.annotation-api:2.1.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.servlet:jakarta.servlet-api:5.0.0=main_java17CompileClasspath jakarta.xml.bind:jakarta.xml.bind-api:4.0.0=testCompileClasspath,testRuntimeClasspath -jakarta.xml.bind:jakarta.xml.bind-api:4.0.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +jakarta.xml.bind:jakarta.xml.bind-api:4.0.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.minidev:accessors-smart:2.4.7=testCompileClasspath,testRuntimeClasspath @@ -105,11 +108,11 @@ org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apache.logging.log4j:log4j-to-slf4j:2.19.0=testCompileClasspath,testRuntimeClasspath org.apache.logging.log4j:log4j-to-slf4j:2.24.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.tomcat.embed:tomcat-embed-core:10.1.1=testCompileClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-core:10.1.54=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.tomcat.embed:tomcat-embed-core:10.1.55=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.tomcat.embed:tomcat-embed-el:10.1.1=testCompileClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-el:10.1.54=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.tomcat.embed:tomcat-embed-el:10.1.55=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.tomcat.embed:tomcat-embed-websocket:10.1.1=testCompileClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-websocket:10.1.54=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.tomcat.embed:tomcat-embed-websocket:10.1.55=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apiguardian:apiguardian-api:1.1.2=latestDepTestCompileClasspath,testCompileClasspath org.assertj:assertj-core:3.23.1=testCompileClasspath,testRuntimeClasspath org.assertj:assertj-core:3.27.7=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -131,6 +134,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -151,22 +155,23 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.skyscreamer:jsonassert:1.5.1=testCompileClasspath,testRuntimeClasspath org.skyscreamer:jsonassert:1.5.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.slf4j:jul-to-slf4j:2.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.slf4j:jul-to-slf4j:2.0.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:jul-to-slf4j:2.0.4=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,main_java17CompileClasspath,main_java17RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath -org.slf4j:slf4j-api:2.0.17=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,spotbugsSlf4j +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j +org.slf4j:slf4j-api:2.0.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:slf4j-api:2.0.4=testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,latestDepTestRuntimeClasspath,main_java17RuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath @@ -174,65 +179,65 @@ org.spockframework:spock-bom:2.4-groovy-3.0=latestDepTestCompileClasspath,latest org.spockframework:spock-core:2.4-groovy-3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.spockframework:spock-spring:2.4-groovy-3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.springframework.boot:spring-boot-autoconfigure:3.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-autoconfigure:3.5.14=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-autoconfigure:3.5.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot-starter-json:3.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-json:3.5.14=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-starter-json:3.5.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot-starter-logging:3.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-logging:3.5.14=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-starter-logging:3.5.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot-starter-security:3.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-security:3.5.14=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-starter-security:3.5.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot-starter-test:3.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-test:3.5.14=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-starter-test:3.5.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot-starter-tomcat:3.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-tomcat:3.5.14=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-starter-tomcat:3.5.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot-starter-web:3.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-web:3.5.14=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.springframework.boot:spring-boot-starter-websocket:3.5.14=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-starter-web:3.5.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-starter-websocket:3.5.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot-starter:3.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter:3.5.14=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-starter:3.5.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot-test-autoconfigure:3.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-test-autoconfigure:3.5.14=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-test-autoconfigure:3.5.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot-test:3.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-test:3.5.14=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot-test:3.5.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.boot:spring-boot:3.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot:3.5.14=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.boot:spring-boot:3.5.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.security:spring-security-config:6.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.security:spring-security-config:6.5.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.security:spring-security-config:6.5.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.security:spring-security-core:6.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.security:spring-security-core:6.5.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.security:spring-security-core:6.5.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.security:spring-security-crypto:6.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.security:spring-security-crypto:6.5.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.security:spring-security-crypto:6.5.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework.security:spring-security-web:6.0.0=testCompileClasspath,testRuntimeClasspath -org.springframework.security:spring-security-web:6.5.10=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework.security:spring-security-web:6.5.11=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-aop:6.0.0=main_java17CompileClasspath org.springframework:spring-aop:6.0.2=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-aop:6.2.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-aop:6.2.19=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-beans:6.0.0=main_java17CompileClasspath org.springframework:spring-beans:6.0.2=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-beans:6.2.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-beans:6.2.19=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-context:6.0.0=main_java17CompileClasspath org.springframework:spring-context:6.0.2=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-context:6.2.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-context:6.2.19=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-core:6.0.0=main_java17CompileClasspath org.springframework:spring-core:6.0.2=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-core:6.2.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-core:6.2.19=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-expression:6.0.0=main_java17CompileClasspath org.springframework:spring-expression:6.0.2=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-expression:6.2.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-expression:6.2.19=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-jcl:6.0.0=main_java17CompileClasspath org.springframework:spring-jcl:6.0.2=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-jcl:6.2.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.springframework:spring-messaging:6.2.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-jcl:6.2.19=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-messaging:6.2.19=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-test:6.0.2=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-test:6.2.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-test:6.2.19=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-web:6.0.0=main_java17CompileClasspath org.springframework:spring-web:6.0.2=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-web:6.2.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-web:6.2.19=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-webmvc:6.0.0=main_java17CompileClasspath org.springframework:spring-webmvc:6.0.2=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-webmvc:6.2.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-webmvc:6.2.19=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.springframework:spring-websocket:6.0.2=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-websocket:6.2.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.springframework:spring-websocket:6.2.19=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.tabletest:tabletest-junit:1.2.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java/datadog/trace/instrumentation/springweb6/DispatcherServletInstrumentation.java b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java/datadog/trace/instrumentation/springweb6/DispatcherServletInstrumentation.java index 2c2874bee35..bfe0f775159 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java/datadog/trace/instrumentation/springweb6/DispatcherServletInstrumentation.java +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java/datadog/trace/instrumentation/springweb6/DispatcherServletInstrumentation.java @@ -4,6 +4,7 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static net.bytebuddy.matcher.ElementMatchers.isMethod; import static net.bytebuddy.matcher.ElementMatchers.isProtected; +import static net.bytebuddy.matcher.ElementMatchers.returns; import static net.bytebuddy.matcher.ElementMatchers.takesArgument; import static net.bytebuddy.matcher.ElementMatchers.takesArguments; @@ -27,10 +28,7 @@ public String instrumentedType() { @Override public String[] helperClassNames() { return new String[] { - packageName + ".SpringWebHttpServerDecorator", - packageName + ".ServletRequestURIAdapter", - packageName + ".HandlerMappingResourceNameFilter", - packageName + ".PathMatchingHttpServletRequestWrapper", + packageName + ".SpringWebHttpServerDecorator", packageName + ".ServletRequestURIAdapter", }; } @@ -39,9 +37,10 @@ public void methodAdvice(MethodTransformer transformer) { transformer.applyAdvice( isMethod() .and(isProtected()) - .and(named("onRefresh")) - .and(takesArgument(0, named("org.springframework.context.ApplicationContext"))) - .and(takesArguments(1)), + .and(named("getHandler")) + .and(takesArgument(0, named("jakarta.servlet.http.HttpServletRequest"))) + .and(takesArguments(1)) + .and(returns(named("org.springframework.web.servlet.HandlerExecutionChain"))), packageName + ".HandlerMappingAdvice"); transformer.applyAdvice( isMethod() diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java/datadog/trace/instrumentation/springweb6/ResourceNameFilterMappingInstrumentation.java b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java/datadog/trace/instrumentation/springweb6/ResourceNameFilterMappingInstrumentation.java new file mode 100644 index 00000000000..9b1b73a4f62 --- /dev/null +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java/datadog/trace/instrumentation/springweb6/ResourceNameFilterMappingInstrumentation.java @@ -0,0 +1,58 @@ +package datadog.trace.instrumentation.springweb6; + +import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static net.bytebuddy.matcher.ElementMatchers.isMethod; +import static net.bytebuddy.matcher.ElementMatchers.isProtected; +import static net.bytebuddy.matcher.ElementMatchers.takesArgument; +import static net.bytebuddy.matcher.ElementMatchers.takesArguments; + +import com.google.auto.service.AutoService; +import datadog.trace.agent.tooling.Instrumenter; +import datadog.trace.agent.tooling.InstrumenterModule; + +/** + * When the opt-in {@code spring-path-filter} integration is enabled, wires the {@code + * DispatcherServlet} handler mappings into {@link HandlerMappingResourceNameFilter} on context + * refresh. Disabled by default; the default route naming is handled by {@link HandlerMappingAdvice} + * ({@code getHandler}) and {@link ControllerAdvice}. + */ +@AutoService(InstrumenterModule.class) +public final class ResourceNameFilterMappingInstrumentation extends InstrumenterModule.Tracing + implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { + + public ResourceNameFilterMappingInstrumentation() { + super("spring-web", "spring-path-filter"); + } + + @Override + protected boolean defaultEnabled() { + return false; + } + + @Override + public String instrumentedType() { + return "org.springframework.web.servlet.DispatcherServlet"; + } + + @Override + public String[] helperClassNames() { + return new String[] { + packageName + ".SpringWebHttpServerDecorator", + packageName + ".ServletRequestURIAdapter", + packageName + ".HandlerMappingResourceNameFilter", + packageName + ".HandlerMappingResourceNameFilter$BeanDefinition", + packageName + ".PathMatchingHttpServletRequestWrapper", + }; + } + + @Override + public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvice( + isMethod() + .and(isProtected()) + .and(named("onRefresh")) + .and(takesArgument(0, named("org.springframework.context.ApplicationContext"))) + .and(takesArguments(1)), + packageName + ".ResourceNameFilterMappingAdvice"); + } +} diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java/datadog/trace/instrumentation/springweb6/ServletPathRequestFilterInstrumentation.java b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java/datadog/trace/instrumentation/springweb6/ServletPathRequestFilterInstrumentation.java index 5c2db70ba85..784da331cf0 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java/datadog/trace/instrumentation/springweb6/ServletPathRequestFilterInstrumentation.java +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java/datadog/trace/instrumentation/springweb6/ServletPathRequestFilterInstrumentation.java @@ -14,8 +14,10 @@ import net.bytebuddy.matcher.ElementMatcher; /** - * This instrumentation adds the ServletPathRequestFilter definition to the spring context When the - * context is created, the filter will be added to the beginning of the filter chain + * Companion to {@link WebApplicationContextInstrumentation}: when the opt-in {@code + * spring-path-filter} integration is enabled, registers Spring's {@code ServletRequestPathFilter} + * first in the chain so the request path is parsed before {@link HandlerMappingResourceNameFilter} + * resolves the handler. Disabled by default. */ @AutoService(InstrumenterModule.class) public class ServletPathRequestFilterInstrumentation extends InstrumenterModule.Tracing @@ -24,6 +26,11 @@ public ServletPathRequestFilterInstrumentation() { super("spring-web", "spring-path-filter"); } + @Override + protected boolean defaultEnabled() { + return false; + } + @Override public ElementMatcher.Junction classLoaderMatcher() { return hasClassNamed("org.springframework.web.filter.ServletRequestPathFilter") diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java/datadog/trace/instrumentation/springweb6/WebApplicationContextInstrumentation.java b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java/datadog/trace/instrumentation/springweb6/WebApplicationContextInstrumentation.java index 672570f94bf..a7c54f26e93 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java/datadog/trace/instrumentation/springweb6/WebApplicationContextInstrumentation.java +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java/datadog/trace/instrumentation/springweb6/WebApplicationContextInstrumentation.java @@ -13,8 +13,10 @@ import net.bytebuddy.matcher.ElementMatcher; /** - * This instrumentation adds the HandlerMappingResourceNameFilter definition to the spring context - * When the context is created, the filter will be added to the beginning of the filter chain + * Opt-in alternative to the default {@code getHandler}/{@code ControllerAdvice} route naming. Adds + * the {@link HandlerMappingResourceNameFilter} bean to the Spring context, which names the route at + * the start of the filter chain by resolving the handler itself. This is the legacy approach and is + * disabled by default; enable it with {@code dd.integration.spring-path-filter.enabled=true}. */ @AutoService(InstrumenterModule.class) public class WebApplicationContextInstrumentation extends InstrumenterModule.Tracing @@ -23,6 +25,11 @@ public WebApplicationContextInstrumentation() { super("spring-web", "spring-path-filter"); } + @Override + protected boolean defaultEnabled() { + return false; + } + @Override public String hierarchyMarkerType() { return "org.springframework.web.context.WebApplicationContext"; diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/ControllerAdvice.java b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/ControllerAdvice.java index 5a675262cad..87979e55648 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/ControllerAdvice.java +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/ControllerAdvice.java @@ -3,7 +3,6 @@ import static datadog.context.Context.root; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; import static datadog.trace.instrumentation.springweb6.SpringWebHttpServerDecorator.DD_HANDLER_SPAN_CONTINUE_SUFFIX; @@ -25,7 +24,11 @@ public static ContextScope nameResourceAndStartSpan( @Advice.Argument(2) final Object handler, @Advice.Local("handlerSpanKey") String handlerSpanKey) { handlerSpanKey = ""; - // Name the parent span based on the matching pattern + + /* + By the time HandlerAdapter.handle runs, every handler mapping kind (annotated and SimpleUrlHandlerMapping via its + PathExposingHandlerInterceptor) has populated BEST_MATCHING_PATTERN_ATTRIBUTE. + */ Object contextObj = request.getAttribute(DD_CONTEXT_ATTRIBUTE); if (contextObj instanceof Context) { Context context = (Context) contextObj; @@ -61,7 +64,7 @@ public static ContextScope nameResourceAndStartSpan( DECORATE.onHandle(span, handler); request.setAttribute(handlerSpanKey, span); - return getCurrentContext().with(span).attach(); + return span.attachWithContext(); } @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/HandleMatchAdvice.java b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/HandleMatchAdvice.java index e299ac0f91c..368e91303ad 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/HandleMatchAdvice.java +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/HandleMatchAdvice.java @@ -28,7 +28,7 @@ public class HandleMatchAdvice { "org.springframework.web.servlet.HandlerMapping.matrixVariables"; @SuppressWarnings("Duplicates") - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) @Source(SourceTypes.REQUEST_PATH_PARAMETER) public static void after( @Advice.Argument(2) final HttpServletRequest req, @@ -37,7 +37,8 @@ public static void after( return; } - // hacky, but APM instrumentation causes the instrumented method to be called twice + // When the opt-in spring-path-filter integration is enabled, the filter resolves the handler + // against a PathMatchingHttpServletRequestWrapper, which triggers handleMatch a second time. if (req.getClass() .getName() .equals("datadog.trace.instrumentation.springweb6.PathMatchingHttpServletRequestWrapper")) { diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/HandlerMappingAdvice.java b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/HandlerMappingAdvice.java index ffabc4115be..08783e50a96 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/HandlerMappingAdvice.java +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/HandlerMappingAdvice.java @@ -1,26 +1,39 @@ package datadog.trace.instrumentation.springweb6; -import java.util.List; +import static datadog.context.Context.root; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; +import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; +import static datadog.trace.instrumentation.springweb6.SpringWebHttpServerDecorator.DECORATE; + +import datadog.context.Context; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import jakarta.servlet.http.HttpServletRequest; import net.bytebuddy.asm.Advice; -import org.springframework.context.ApplicationContext; -import org.springframework.web.servlet.HandlerMapping; +import org.springframework.web.servlet.HandlerExecutionChain; /** - * This advice creates a filter that has reference to the handlerMappings from DispatcherServlet - * which allows the mappings to be evaluated at the beginning of the filter chain. This evaluation - * is done inside the Servlet3Decorator.onContext method. + * Names the server span route as soon as {@code DispatcherServlet} has resolved the handler. + * + *

      For {@code RequestMappingInfoHandlerMapping}, {@code handleMatch} sets {@link + * org.springframework.web.servlet.HandlerMapping#BEST_MATCHING_PATTERN_ATTRIBUTE} synchronously + * inside {@code getHandler}, before interceptors run. Naming the route here means it survives a + * {@code HandlerInterceptor.preHandle} that aborts the request before the controller executes. */ public class HandlerMappingAdvice { - @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) - public static void afterRefresh( - @Advice.Argument(0) final ApplicationContext springCtx, - @Advice.FieldValue("handlerMappings") final List handlerMappings) { - if (springCtx.containsBean("ddDispatcherFilter")) { - final datadog.trace.instrumentation.springweb6.HandlerMappingResourceNameFilter filter = - (HandlerMappingResourceNameFilter) springCtx.getBean("ddDispatcherFilter"); - if (handlerMappings != null && filter != null) { - filter.setHandlerMappings(handlerMappings); + @Advice.OnMethodExit(suppress = Throwable.class) + public static void onExit( + @Advice.Argument(0) final HttpServletRequest request, + @Advice.Return final HandlerExecutionChain chain) { + if (chain == null) { + // No handler matched (e.g. 404): leave the resource name untouched. + return; + } + final Object contextObj = request.getAttribute(DD_CONTEXT_ATTRIBUTE); + if (contextObj instanceof Context) { + final AgentSpan parentSpan = spanFromContext((Context) contextObj); + if (parentSpan != null) { + DECORATE.onRequest(parentSpan, request, request, root()); } } } diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/HandlerMappingResourceNameFilter.java b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/HandlerMappingResourceNameFilter.java index eac11f69ca2..85fd73633c9 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/HandlerMappingResourceNameFilter.java +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/HandlerMappingResourceNameFilter.java @@ -1,7 +1,6 @@ package datadog.trace.instrumentation.springweb6; import static datadog.context.Context.root; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; import static datadog.trace.instrumentation.springweb6.SpringWebHttpServerDecorator.DECORATE; @@ -38,7 +37,7 @@ protected void doFilterInternal( final Object contextObj = request.getAttribute(DD_CONTEXT_ATTRIBUTE); if (contextObj instanceof Context) { Context context = (Context) contextObj; - AgentSpan parentSpan = spanFromContext(context); + AgentSpan parentSpan = AgentSpan.fromContext(context); if (parentSpan != null) { PathMatchingHttpServletRequestWrapper wrappedRequest = new PathMatchingHttpServletRequestWrapper(request); diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/InterceptorPreHandleAdvice.java b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/InterceptorPreHandleAdvice.java index ca872367f5c..89ac5f23e85 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/InterceptorPreHandleAdvice.java +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/InterceptorPreHandleAdvice.java @@ -25,7 +25,7 @@ public class InterceptorPreHandleAdvice { "org.springframework.web.servlet.HandlerMapping.uriTemplateVariables"; @SuppressWarnings("Duplicates") - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) @Source(SourceTypes.REQUEST_PATH_PARAMETER) public static void after( @Advice.Argument(0) final HttpServletRequest req, diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/RenderAdvice.java b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/RenderAdvice.java index 52a18e2c2f1..9b9c89e7613 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/RenderAdvice.java +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/RenderAdvice.java @@ -1,7 +1,6 @@ package datadog.trace.instrumentation.springweb6; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import datadog.context.ContextScope; @@ -16,7 +15,7 @@ public static ContextScope onEnter(@Advice.Argument(0) final ModelAndView mv) { final AgentSpan span = startSpan("spring-webmvc", SpringWebHttpServerDecorator.RESPONSE_RENDER); SpringWebHttpServerDecorator.DECORATE_RENDER.afterStart(span); SpringWebHttpServerDecorator.DECORATE_RENDER.onRender(span, mv); - return getCurrentContext().with(span).attach(); + return span.attachWithContext(); } @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/ResourceNameFilterMappingAdvice.java b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/ResourceNameFilterMappingAdvice.java new file mode 100644 index 00000000000..7794aa0ac15 --- /dev/null +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/ResourceNameFilterMappingAdvice.java @@ -0,0 +1,26 @@ +package datadog.trace.instrumentation.springweb6; + +import java.util.List; +import net.bytebuddy.asm.Advice; +import org.springframework.context.ApplicationContext; +import org.springframework.web.servlet.HandlerMapping; + +/** + * Wires the {@code DispatcherServlet} handler mappings into the (opt-in) {@link + * HandlerMappingResourceNameFilter} after the context refreshes, so the filter can evaluate them at + * the start of the filter chain. Only active when the {@code spring-path-filter} integration is + * enabled (see {@code ResourceNameFilterMappingInstrumentation}). + */ +public class ResourceNameFilterMappingAdvice { + + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + public static void afterRefresh( + @Advice.Argument(0) final ApplicationContext springCtx, + @Advice.FieldValue("handlerMappings") final List handlerMappings) { + if (handlerMappings != null && springCtx.containsBean("ddDispatcherFilter")) { + final HandlerMappingResourceNameFilter filter = + (HandlerMappingResourceNameFilter) springCtx.getBean("ddDispatcherFilter"); + filter.setHandlerMappings(handlerMappings); + } + } +} diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/SpringWebHttpServerDecorator.java b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/SpringWebHttpServerDecorator.java index 79b89c1aad5..f237944377c 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/SpringWebHttpServerDecorator.java +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/main/java17/datadog/trace/instrumentation/springweb6/SpringWebHttpServerDecorator.java @@ -102,7 +102,7 @@ protected int status(final HttpServletResponse httpServletResponse) { } @Override - public AgentSpan onRequest( + public void onRequest( final AgentSpan span, final HttpServletRequest connection, final HttpServletRequest request, @@ -118,7 +118,6 @@ public AgentSpan onRequest( HTTP_RESOURCE_DECORATOR.withRoute(span, method, bestMatchingPattern.toString()); } } - return span; } public void onHandle(final AgentSpan span, final Object handler) { @@ -146,7 +145,7 @@ private String getMethodName(final Object handler) { } } - public AgentSpan onRender(final AgentSpan span, final ModelAndView mv) { + public void onRender(final AgentSpan span, final ModelAndView mv) { final String viewName = mv.getViewName(); if (viewName != null) { span.setTag("view.name", viewName); @@ -155,6 +154,5 @@ public AgentSpan onRender(final AgentSpan span, final ModelAndView mv) { if (mv.getView() != null) { span.setTag("view.type", className(mv.getView().getClass())); } - return span; } } diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/test/groovy/datadog/trace/instrumentation/springweb6/boot/SpringBootBasedTest.groovy b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/test/groovy/datadog/trace/instrumentation/springweb6/boot/SpringBootBasedTest.groovy index 3cd4ff3efd9..7bf01c8905f 100644 --- a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/test/groovy/datadog/trace/instrumentation/springweb6/boot/SpringBootBasedTest.groovy +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/test/groovy/datadog/trace/instrumentation/springweb6/boot/SpringBootBasedTest.groovy @@ -16,8 +16,6 @@ import datadog.trace.bootstrap.instrumentation.api.Tags import datadog.trace.core.DDSpan import datadog.trace.instrumentation.springweb6.SetupSpecHelper import datadog.trace.instrumentation.springweb6.SpringWebHttpServerDecorator -import jakarta.servlet.http.HttpServletRequest -import jakarta.servlet.http.HttpServletResponse import okhttp3.Credentials import okhttp3.FormBody import okhttp3.Request @@ -28,7 +26,6 @@ import org.springframework.boot.SpringApplication import org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext import org.springframework.context.ConfigurableApplicationContext import org.springframework.http.MediaType -import org.springframework.web.servlet.HandlerInterceptor import org.springframework.web.socket.BinaryMessage import org.springframework.web.socket.TextMessage import org.springframework.web.socket.WebSocketSession @@ -59,7 +56,7 @@ class SpringBootBasedTest extends HttpServerTest Map extraServerTags = [:] SpringApplication application() { - return new SpringApplication(SecurityConfig, TestController, AppConfig, WebsocketConfig) + return new SpringApplication(SecurityConfig, TestController, AppConfig, WebsocketConfig, FailOnHeaderConfig) } class SpringBootServer implements WebsocketServer { @@ -451,26 +448,20 @@ class SpringBootBasedTest extends HttpServerTest InstrumentationBridge.clearIastModules() } - def 'path is extract when preHandle fails'() { + def 'path is extracted when preHandle fails'() { setup: def request = request(PATH_PARAM, 'GET', null).header("fail", "true").build() - context.getBeanFactory().registerSingleton("testHandler", new HandlerInterceptor() { - @Override - boolean preHandle(HttpServletRequest req, HttpServletResponse response, Object handler) throws Exception { - if ("true".equalsIgnoreCase(req.getHeader("fail"))) { - throw new RuntimeException("Stop here") - } - return true - } - }) when: - client.newCall(request).execute() + def response = client.newCall(request).execute() + response.close() TEST_WRITER.waitForTraces(1) DDSpan span = TEST_WRITER.flatten().find { "servlet.request".contentEquals(it.operationName) } then: + response.code() == 500 span.getResourceName().toString() == "GET " + testPathParam() + span.isError() } boolean hasResponseSpan(ServerEndpoint endpoint) { @@ -526,3 +517,16 @@ class SpringBootRumInjectionForkedTest extends SpringBootBasedTest { true } } + +/** + * Runs the full suite with the opt-in legacy route-naming filter enabled, to verify that path still + * produces the same traces (including APMS-8174). The default path (getHandler + ControllerAdvice) + * stays active; the DD_FILTERED_SPRING_ROUTE_ALREADY_APPLIED guard prevents double naming. + */ +class SpringBootResourceNameFilterForkedTest extends SpringBootBasedTest { + @Override + protected void configurePreAgent() { + super.configurePreAgent() + injectSysConfig("dd.integration.spring-path-filter.enabled", "true") + } +} diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/test/java/datadog/trace/instrumentation/springweb6/boot/FailOnHeaderConfig.java b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/test/java/datadog/trace/instrumentation/springweb6/boot/FailOnHeaderConfig.java new file mode 100644 index 00000000000..654893ffd40 --- /dev/null +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/test/java/datadog/trace/instrumentation/springweb6/boot/FailOnHeaderConfig.java @@ -0,0 +1,13 @@ +package datadog.trace.instrumentation.springweb6.boot; + +import org.springframework.context.annotation.Configuration; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; + +@Configuration +public class FailOnHeaderConfig implements WebMvcConfigurer { + @Override + public void addInterceptors(final InterceptorRegistry registry) { + registry.addInterceptor(new FailOnHeaderInterceptor()); + } +} diff --git a/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/test/java/datadog/trace/instrumentation/springweb6/boot/FailOnHeaderInterceptor.java b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/test/java/datadog/trace/instrumentation/springweb6/boot/FailOnHeaderInterceptor.java new file mode 100644 index 00000000000..03728a89e4e --- /dev/null +++ b/dd-java-agent/instrumentation/spring/spring-webmvc/spring-webmvc-6.0/src/test/java/datadog/trace/instrumentation/springweb6/boot/FailOnHeaderInterceptor.java @@ -0,0 +1,21 @@ +package datadog.trace.instrumentation.springweb6.boot; + +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; +import org.springframework.web.servlet.HandlerInterceptor; + +/** + * Aborts the request from {@code preHandle} when the {@code fail} header is set, so the controller + * is never invoked. Test to verify the route is still named on the server span in that case (see + * {@code HandlerMappingAdvice}). + */ +public class FailOnHeaderInterceptor implements HandlerInterceptor { + @Override + public boolean preHandle( + final HttpServletRequest request, final HttpServletResponse response, final Object handler) { + if ("true".equalsIgnoreCase(request.getHeader("fail"))) { + throw new RuntimeException("Stop here"); + } + return true; + } +} diff --git a/dd-java-agent/instrumentation/spring/spring-ws-2.0/gradle.lockfile b/dd-java-agent/instrumentation/spring/spring-ws-2.0/gradle.lockfile index b1bba75a9ea..b1d50f143b7 100644 --- a/dd-java-agent/instrumentation/spring/spring-ws-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/spring/spring-ws-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:spring:spring-ws-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -20,15 +21,15 @@ com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.4=latestDepTestCompi com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.13.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -39,12 +40,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -58,7 +62,7 @@ commons-io:commons-io:2.20.0=spotbugs commons-logging:commons-logging:1.1.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.jws:jakarta.jws-api:2.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.xml.bind:jakarta.xml.bind-api:2.3.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -67,8 +71,8 @@ jakarta.xml.ws:jakarta.xml.ws-api:2.3.3=latestDepTestCompileClasspath,latestDepT javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -104,6 +108,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jdom:jdom:2.0.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -122,14 +127,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.36=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/spymemcached-2.10/gradle.lockfile b/dd-java-agent/instrumentation/spymemcached-2.10/gradle.lockfile index 3ad7726ac65..bdcb4abf940 100644 --- a/dd-java-agent/instrumentation/spymemcached-2.10/gradle.lockfile +++ b/dd-java-agent/instrumentation/spymemcached-2.10/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:spymemcached-2.10:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.github.docker-java:docker-java-api:3.4.2=latestDepForkedTestCompileClasspath com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -51,12 +55,12 @@ commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForked commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -89,6 +93,7 @@ org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTes org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -106,14 +111,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/spymemcached-2.10/src/main/java/datadog/trace/instrumentation/spymemcached/CompletionListener.java b/dd-java-agent/instrumentation/spymemcached-2.10/src/main/java/datadog/trace/instrumentation/spymemcached/CompletionListener.java index a3c31f49522..d079b05c342 100644 --- a/dd-java-agent/instrumentation/spymemcached-2.10/src/main/java/datadog/trace/instrumentation/spymemcached/CompletionListener.java +++ b/dd-java-agent/instrumentation/spymemcached-2.10/src/main/java/datadog/trace/instrumentation/spymemcached/CompletionListener.java @@ -3,7 +3,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.instrumentation.spymemcached.MemcacheClientDecorator.DECORATE; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.util.concurrent.CancellationException; import java.util.concurrent.ExecutionException; @@ -19,14 +19,14 @@ public abstract class CompletionListener { public CompletionListener(final AgentSpan span, final String methodName) { this.span = span; - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { DECORATE.afterStart(span); DECORATE.onOperation(span, methodName); } } protected void closeAsyncSpan(final T future) { - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { try { processResult(span, future); } catch (final CancellationException e) { @@ -54,7 +54,7 @@ protected void closeAsyncSpan(final T future) { } protected void closeSyncSpan(final Throwable thrown) { - try (final AgentScope scope = activateSpan(span)) { + try (final ContextScope scope = activateSpan(span)) { DECORATE.onError(span, thrown); DECORATE.beforeFinish(span); span.finish(); diff --git a/dd-java-agent/instrumentation/spymemcached-2.10/src/main/java/datadog/trace/instrumentation/spymemcached/MemcacheClientDecorator.java b/dd-java-agent/instrumentation/spymemcached-2.10/src/main/java/datadog/trace/instrumentation/spymemcached/MemcacheClientDecorator.java index bcfc58674d5..6301d034c7a 100644 --- a/dd-java-agent/instrumentation/spymemcached-2.10/src/main/java/datadog/trace/instrumentation/spymemcached/MemcacheClientDecorator.java +++ b/dd-java-agent/instrumentation/spymemcached-2.10/src/main/java/datadog/trace/instrumentation/spymemcached/MemcacheClientDecorator.java @@ -59,7 +59,7 @@ protected String dbHostname(MemcachedConnection connection) { return null; } - public AgentSpan onOperation(final AgentSpan span, final String methodName) { + public void onOperation(final AgentSpan span, final String methodName) { // optimization over string.replaceFirst() StringBuilder builder = new StringBuilder(methodName); @@ -68,6 +68,5 @@ public AgentSpan onOperation(final AgentSpan span, final String methodName) { builder.replace(0, 1, String.valueOf(Character.toLowerCase(builder.charAt(0)))); span.setResourceName(builder.toString()); - return span; } } diff --git a/dd-java-agent/instrumentation/synapse-3.0/gradle.lockfile b/dd-java-agent/instrumentation/synapse-3.0/gradle.lockfile index e20b205ac32..ee6ab02f816 100644 --- a/dd-java-agent/instrumentation/synapse-3.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/synapse-3.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:synapse-3.0:dependencies --write-locks c3p0:c3p0:0.9.1.1=testCompileClasspath,testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -9,20 +10,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -32,12 +33,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.mchange:c3p0:0.9.5.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.mchange:mchange-commons-java:0.2.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -63,7 +67,7 @@ commons-logging:commons-logging:1.2=compileClasspath,latestDepTestCompileClasspa commons-pool:commons-pool:1.5.7=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:1.2.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath jakarta.xml.soap:jakarta.xml.soap-api:1.4.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath javax.activation:activation:1.1=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -77,8 +81,8 @@ jline:jline:0.9.94=compileClasspath,latestDepTestCompileClasspath,latestDepTestR junit:junit:3.8.1=compileClasspath,latestDepTestCompileClasspath,testCompileClasspath junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath log4j:log4j:1.2.14=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -157,6 +161,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -174,14 +179,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.quartz-scheduler:quartz:2.2.0=testCompileClasspath,testRuntimeClasspath org.quartz-scheduler:quartz:2.3.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/synapse-3.0/src/main/java/datadog/trace/instrumentation/synapse3/SynapseClientInstrumentation.java b/dd-java-agent/instrumentation/synapse-3.0/src/main/java/datadog/trace/instrumentation/synapse3/SynapseClientInstrumentation.java index dc605dbd9d0..2ce58b4b181 100644 --- a/dd-java-agent/instrumentation/synapse-3.0/src/main/java/datadog/trace/instrumentation/synapse3/SynapseClientInstrumentation.java +++ b/dd-java-agent/instrumentation/synapse-3.0/src/main/java/datadog/trace/instrumentation/synapse3/SynapseClientInstrumentation.java @@ -6,7 +6,7 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.namedOneOf; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.synapse3.SynapseClientDecorator.DECORATE; import static datadog.trace.instrumentation.synapse3.SynapseClientDecorator.SYNAPSE_CLIENT; @@ -87,14 +87,14 @@ public static ContextScope beginRequest( AgentSpan span; if (null != parentSpan) { - span = startSpan(SYNAPSE_CLIENT.toString(), SYNAPSE_REQUEST, parentSpan.context()); + span = startSpan(SYNAPSE_CLIENT.toString(), SYNAPSE_REQUEST, parentSpan.spanContext()); } else { span = startSpan(SYNAPSE_CLIENT.toString(), SYNAPSE_REQUEST); } DECORATE.afterStart(span); - Context context = getCurrentContext().with(span); + Context context = currentContext().with(span); // capture context to be finished by one of the various client response advices connection.getContext().setAttribute(SYNAPSE_CONTEXT_KEY, context); diff --git a/dd-java-agent/instrumentation/synapse-3.0/src/main/java/datadog/trace/instrumentation/synapse3/SynapseClientWorkerInstrumentation.java b/dd-java-agent/instrumentation/synapse-3.0/src/main/java/datadog/trace/instrumentation/synapse3/SynapseClientWorkerInstrumentation.java index b514bc39d56..76e0ff7d8e4 100644 --- a/dd-java-agent/instrumentation/synapse-3.0/src/main/java/datadog/trace/instrumentation/synapse3/SynapseClientWorkerInstrumentation.java +++ b/dd-java-agent/instrumentation/synapse-3.0/src/main/java/datadog/trace/instrumentation/synapse3/SynapseClientWorkerInstrumentation.java @@ -2,8 +2,7 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.captureActiveSpan; -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopContinuation; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.synapse3.SynapseClientDecorator.DECORATE; import static datadog.trace.instrumentation.synapse3.SynapseClientDecorator.SYNAPSE_CONTINUATION_KEY; @@ -13,10 +12,10 @@ import static net.bytebuddy.matcher.ElementMatchers.takesNoArguments; import com.google.auto.service.AutoService; +import datadog.context.ContextContinuation; import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import net.bytebuddy.asm.Advice; import org.apache.http.HttpResponse; @@ -56,8 +55,8 @@ public void methodAdvice(final MethodTransformer transformer) { public static final class NewClientWorkerAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) public static void createWorker(@Advice.Argument(2) final TargetResponse response) { - AgentScope.Continuation continuation = captureActiveSpan(); - if (continuation != noopContinuation()) { + ContextContinuation continuation = captureActiveSpan(); + if (continuation.context() != rootContext()) { response.getConnection().getContext().setAttribute(SYNAPSE_CONTINUATION_KEY, continuation); } } @@ -67,18 +66,11 @@ public static final class ClientWorkerResponseAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) public static ContextScope beginResponse( @Advice.FieldValue("response") final TargetResponse response) { - AgentScope.Continuation continuation = - (AgentScope.Continuation) - response.getConnection().getContext().removeAttribute(SYNAPSE_CONTINUATION_KEY); - if (null != continuation) { - AgentScope agentScope = continuation.activate(); - try { - return getCurrentContext().with(agentScope.span()).attach(); - } finally { - agentScope.close(); - } - } - return null; + Object continuation = + response.getConnection().getContext().removeAttribute(SYNAPSE_CONTINUATION_KEY); + return continuation instanceof ContextContinuation + ? ((ContextContinuation) continuation).resume() + : null; } @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) diff --git a/dd-java-agent/instrumentation/synapse-3.0/src/main/java/datadog/trace/instrumentation/synapse3/SynapseServerInstrumentation.java b/dd-java-agent/instrumentation/synapse-3.0/src/main/java/datadog/trace/instrumentation/synapse3/SynapseServerInstrumentation.java index f46d6ac3956..6efb0410997 100644 --- a/dd-java-agent/instrumentation/synapse-3.0/src/main/java/datadog/trace/instrumentation/synapse3/SynapseServerInstrumentation.java +++ b/dd-java-agent/instrumentation/synapse-3.0/src/main/java/datadog/trace/instrumentation/synapse3/SynapseServerInstrumentation.java @@ -3,8 +3,8 @@ import static datadog.trace.agent.tooling.InstrumenterModule.TargetSystem.CONTEXT_TRACKING; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.namedOneOf; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.synapse3.SynapseServerDecorator.DECORATE; import static datadog.trace.instrumentation.synapse3.SynapseServerDecorator.SYNAPSE_CONTEXT_KEY; @@ -75,7 +75,7 @@ public static ContextScope onEnter(@Advice.Argument(0) final NHttpServerConnecti return parentContext.attach(); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void onExit(@Advice.Enter final ContextScope scope) { scope.close(); } @@ -88,8 +88,7 @@ public static ContextScope beginRequest( // check incoming request for distributed trace ids HttpRequest request = connection.getHttpRequest(); - Context parentContext = - getCurrentContext(); // parent context attached by ContextTrackingAdvice + Context parentContext = currentContext(); // parent context attached by ContextTrackingAdvice Context context = DECORATE.startSpan(request, parentContext); ContextScope scope = context.attach(); AgentSpan span = spanFromContext(context); @@ -161,7 +160,7 @@ public static void errorResponse( @Advice.Argument(value = 1, optional = true) final Object error) { // check and remove context so it won't be finished twice Context context = (Context) connection.getContext().removeAttribute(SYNAPSE_CONTEXT_KEY); - if (null != context && context != getRootContext()) { + if (null != context && context != rootContext()) { AgentSpan span = spanFromContext(context); if (null != span) { if (error instanceof Throwable) { diff --git a/dd-java-agent/instrumentation/synapse-3.0/src/main/java/datadog/trace/instrumentation/synapse3/SynapseServerWorkerInstrumentation.java b/dd-java-agent/instrumentation/synapse-3.0/src/main/java/datadog/trace/instrumentation/synapse3/SynapseServerWorkerInstrumentation.java index 9c01b7f021a..292c62038d0 100644 --- a/dd-java-agent/instrumentation/synapse-3.0/src/main/java/datadog/trace/instrumentation/synapse3/SynapseServerWorkerInstrumentation.java +++ b/dd-java-agent/instrumentation/synapse-3.0/src/main/java/datadog/trace/instrumentation/synapse3/SynapseServerWorkerInstrumentation.java @@ -2,8 +2,7 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.captureActiveSpan; -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopContinuation; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getCurrentContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.synapse3.SynapseServerDecorator.DECORATE; import static datadog.trace.instrumentation.synapse3.SynapseServerDecorator.SYNAPSE_CONTEXT_KEY; @@ -14,10 +13,10 @@ import static net.bytebuddy.matcher.ElementMatchers.takesNoArguments; import com.google.auto.service.AutoService; +import datadog.context.ContextContinuation; import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import net.bytebuddy.asm.Advice; import org.apache.http.HttpResponse; @@ -60,8 +59,8 @@ public void methodAdvice(final MethodTransformer transformer) { public static final class NewServerWorkerAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) public static void createWorker(@Advice.Argument(0) final SourceRequest request) { - AgentScope.Continuation continuation = captureActiveSpan(); - if (continuation != noopContinuation()) { + ContextContinuation continuation = captureActiveSpan(); + if (continuation.context() != rootContext()) { request.getConnection().getContext().setAttribute(SYNAPSE_CONTINUATION_KEY, continuation); } } @@ -71,18 +70,11 @@ public static final class ServerWorkerResponseAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) public static ContextScope beginResponse( @Advice.FieldValue("request") final SourceRequest request) { - AgentScope.Continuation continuation = - (AgentScope.Continuation) - request.getConnection().getContext().removeAttribute(SYNAPSE_CONTINUATION_KEY); - if (null != continuation) { - AgentScope agentScope = continuation.activate(); - try { - return getCurrentContext().with(agentScope.span()).attach(); - } finally { - agentScope.close(); - } - } - return null; + Object continuation = + request.getConnection().getContext().removeAttribute(SYNAPSE_CONTINUATION_KEY); + return continuation instanceof ContextContinuation + ? ((ContextContinuation) continuation).resume() + : null; } @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) @@ -109,8 +101,8 @@ public static void responseReady( scope.close(); span.finish(); } else { - // otherwise will be finished by a separate server response event scope.close(); + // otherwise will be finished by a separate server response event } } } diff --git a/dd-java-agent/instrumentation/testng/testng-6.4/gradle.lockfile b/dd-java-agent/instrumentation/testng/testng-6.4/gradle.lockfile index 1c6402c2e0f..3d969fc17fd 100644 --- a/dd-java-agent/instrumentation/testng/testng-6.4/gradle.lockfile +++ b/dd-java-agent/instrumentation/testng/testng-6.4/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:testng:testng-6.4:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -9,7 +10,7 @@ com.beust:jcommander:1.12=compileClasspath,testCompileClasspath,testRuntimeClass com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -18,15 +19,15 @@ com.fasterxml.jackson.core:jackson-core:2.20.0=testCompileClasspath,testRuntimeC com.fasterxml.jackson.core:jackson-databind:2.20.0=testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.20.0=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -36,12 +37,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.jayway.jsonpath:json-path:2.8.0=testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -54,13 +58,13 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:3.8.1=compileClasspath,testCompileClasspath junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.minidev:accessors-smart:2.4.9=testRuntimeClasspath @@ -93,10 +97,11 @@ org.freemarker:freemarker:2.3.31=testCompileClasspath,testRuntimeClasspath org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.core:0.8.14=testRuntimeClasspath -org.jacoco:org.jacoco.report:0.8.14=testRuntimeClasspath +org.jacoco:org.jacoco.core:0.8.15=testRuntimeClasspath +org.jacoco:org.jacoco.report:0.8.15=testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -116,14 +121,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.skyscreamer:jsonassert:1.5.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/testng/testng-7.0/gradle.lockfile b/dd-java-agent/instrumentation/testng/testng-7.0/gradle.lockfile index 2c12ab207b9..c2b8f6fffc5 100644 --- a/dd-java-agent/instrumentation/testng/testng-7.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/testng/testng-7.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:testng:testng-7.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath @@ -9,7 +10,7 @@ com.beust:jcommander:1.72=compileClasspath,testCompileClasspath,testRuntimeClass com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath @@ -18,15 +19,15 @@ com.fasterxml.jackson.core:jackson-core:2.20.0=latestDepTestCompileClasspath,lat com.fasterxml.jackson.core:jackson-databind:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath,testng751TestAnnotationProcessor,testng751TestCompileClasspath @@ -36,12 +37,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,testng751TestAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,testng751TestAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,testng751TestAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,testng751TestAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath,testng751TestAnnotationProcessor,testng751TestCompileClasspath,testng751TestRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,testng751TestAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath com.jayway.jsonpath:json-path:2.8.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath @@ -54,12 +58,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath net.minidev:accessors-smart:2.4.9=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath @@ -91,11 +95,12 @@ org.freemarker:freemarker:2.3.31=latestDepTestCompileClasspath,latestDepTestRunt org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath -org.jacoco:org.jacoco.core:0.8.14=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath -org.jacoco:org.jacoco.report:0.8.14=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath +org.jacoco:org.jacoco.core:0.8.15=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath +org.jacoco:org.jacoco.report:0.8.15=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath org.jcommander:jcommander:1.83=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath @@ -115,14 +120,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,testng751TestRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath org.skyscreamer:jsonassert:1.5.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,testng751TestCompileClasspath,testng751TestRuntimeClasspath diff --git a/dd-java-agent/instrumentation/testng/testng-common/gradle.lockfile b/dd-java-agent/instrumentation/testng/testng-common/gradle.lockfile index 8b009dbb0bf..d54c0c1327d 100644 --- a/dd-java-agent/instrumentation/testng/testng-common/gradle.lockfile +++ b/dd-java-agent/instrumentation/testng/testng-common/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:testng:testng-common:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testFixturesRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testFixturesRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -9,7 +10,7 @@ com.beust:jcommander:1.12=compileClasspath,testFixturesCompileClasspath,testFixt com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testFixturesRuntimeClasspath,testRuntimeClasspath @@ -18,15 +19,15 @@ com.fasterxml.jackson.core:jackson-core:2.20.0=testCompileClasspath,testFixtures com.fasterxml.jackson.core:jackson-databind:2.20.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.20.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -36,12 +37,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testFixturesRuntimeClasspath,testRuntimeClasspath com.jayway.jsonpath:json-path:2.8.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -54,13 +58,13 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testFixturesCompileClasspath,t commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testFixturesRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testFixturesRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:3.8.1=compileClasspath,testFixturesCompileClasspath junit:junit:4.13.2=testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testFixturesRuntimeClasspath,testRuntimeClasspath net.minidev:accessors-smart:2.4.9=testFixturesRuntimeClasspath,testRuntimeClasspath @@ -93,10 +97,11 @@ org.freemarker:freemarker:2.3.31=testCompileClasspath,testFixturesCompileClasspa org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testFixturesRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testFixturesCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.core:0.8.14=testFixturesRuntimeClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.report:0.8.14=testFixturesRuntimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.core:0.8.15=testFixturesRuntimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.report:0.8.15=testFixturesRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testFixturesRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=testFixturesRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -116,14 +121,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testFixturesCompileClasspath,te org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testFixturesRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.skyscreamer:jsonassert:1.5.1=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -136,8 +141,8 @@ org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,muzzleTooling,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testFixturesCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testFixturesCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.testng:testng:6.4=compileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs org.xmlunit:xmlunit-core:2.10.3=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/thymeleaf-3.0/gradle.lockfile b/dd-java-agent/instrumentation/thymeleaf-3.0/gradle.lockfile index 0ce0b81ff13..b6eff0b1eeb 100644 --- a/dd-java-agent/instrumentation/thymeleaf-3.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/thymeleaf-3.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:thymeleaf-3.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,6 +91,7 @@ org.javassist:javassist:3.20.0-GA=compileClasspath,testCompileClasspath,testRunt org.javassist:javassist:3.29.0-GA=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -104,14 +109,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-5.14/gradle.lockfile b/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-5.14/gradle.lockfile index 5ca3972ba7b..4beeecc5eaa 100644 --- a/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-5.14/gradle.lockfile +++ b/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-5.14/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:tibco-businessworks:tibco-businessworks-5.14:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-5.14/src/main/java/datadog/trace/instrumentation/tibcobw5/JobPoolInstrumentation.java b/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-5.14/src/main/java/datadog/trace/instrumentation/tibcobw5/JobPoolInstrumentation.java index 3c3adc6218c..647a0a6e759 100644 --- a/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-5.14/src/main/java/datadog/trace/instrumentation/tibcobw5/JobPoolInstrumentation.java +++ b/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-5.14/src/main/java/datadog/trace/instrumentation/tibcobw5/JobPoolInstrumentation.java @@ -58,7 +58,7 @@ public static void after(@Advice.Argument(value = 0) ProcessContext processConte } public static class JobEndAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void after( @Advice.This final JobPool self, @Advice.Argument(value = 0) ProcessContext processContext, diff --git a/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-5.14/src/main/java/datadog/trace/instrumentation/tibcobw5/TaskInstrumentation.java b/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-5.14/src/main/java/datadog/trace/instrumentation/tibcobw5/TaskInstrumentation.java index 9d64a23fad7..d99a6c9b5a9 100644 --- a/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-5.14/src/main/java/datadog/trace/instrumentation/tibcobw5/TaskInstrumentation.java +++ b/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-5.14/src/main/java/datadog/trace/instrumentation/tibcobw5/TaskInstrumentation.java @@ -11,6 +11,7 @@ import com.tibco.pe.core.ProcessGroup; import com.tibco.pe.core.Task; import com.tibco.pe.plugin.ProcessContext; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers; @@ -68,7 +69,7 @@ public static boolean before( AgentSpan parent = map.getOrDefault(ddActivityInfo.parent, activeSpan()); span = startSpan( - "tibco_bw", TIBCO_ACTIVITY_OPERATION, parent != null ? parent.context() : null); + "tibco_bw", TIBCO_ACTIVITY_OPERATION, parent != null ? parent.spanContext() : null); DECORATE.afterStart(span); DECORATE.onActivityStart(span, ddActivityInfo.name); map.put(ddActivityInfo.id, span); @@ -87,7 +88,7 @@ public static void after( @Advice.Enter boolean traced, @Advice.Local("ddActivityInfo") ActivityHelper.ActivityInfo ddActivityInfo, @Advice.Local("ddScope") AgentScope ddScope) { - try (AgentScope closeMe = ddScope) { + try (ContextScope closeMe = ddScope) { if (!traced) { return; } diff --git a/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-5.14/src/main/java/datadog/trace/instrumentation/tibcobw5/TibcoDecorator.java b/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-5.14/src/main/java/datadog/trace/instrumentation/tibcobw5/TibcoDecorator.java index 2c6c07c1499..a0234a7607f 100644 --- a/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-5.14/src/main/java/datadog/trace/instrumentation/tibcobw5/TibcoDecorator.java +++ b/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-5.14/src/main/java/datadog/trace/instrumentation/tibcobw5/TibcoDecorator.java @@ -57,20 +57,19 @@ protected CharSequence component() { } @Override - public AgentSpan afterStart(final AgentSpan span) { + public void afterStart(final AgentSpan span) { span.setTag(Tags.SPAN_KIND, Tags.SPAN_KIND_INTERNAL); - return super.afterStart(span); + super.afterStart(span); } - public AgentSpan onProcessStart(AgentSpan span, String processName) { - return span.setResourceName(processName) + public void onProcessStart(AgentSpan span, String processName) { + span.setResourceName(processName) .setTag(TIBCO_NODE, JobPool.getName()) .setTag(TIBCO_VERSION, VERSION) .setMeasured(true); } - public AgentSpan onActivityStart(final AgentSpan span, String activityName) { + public void onActivityStart(final AgentSpan span, String activityName) { span.setResourceName(activityName); - return span; } } diff --git a/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-6.5/gradle.lockfile b/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-6.5/gradle.lockfile index 5ca3972ba7b..ccaf3654d52 100644 --- a/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-6.5/gradle.lockfile +++ b/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-6.5/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:tibco-businessworks:tibco-businessworks-6.5:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-6.5/src/main/java/datadog/trace/instrumentation/tibcobw6/BehaviorInstrumentation.java b/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-6.5/src/main/java/datadog/trace/instrumentation/tibcobw6/BehaviorInstrumentation.java index c6d968bc7ca..c777f20d872 100644 --- a/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-6.5/src/main/java/datadog/trace/instrumentation/tibcobw6/BehaviorInstrumentation.java +++ b/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-6.5/src/main/java/datadog/trace/instrumentation/tibcobw6/BehaviorInstrumentation.java @@ -93,7 +93,7 @@ public static AgentScope activityBegin( startSpan( "tibco_bw", TibcoDecorator.TIBCO_ACTIVITY_OPERATION, - parentSpan != null ? parentSpan.context() : null); + parentSpan != null ? parentSpan.spanContext() : null); TibcoDecorator.DECORATE.afterStart(span); TibcoDecorator.DECORATE.onActivityStart(span, pmTask.getName(pmContext)); return activateSpan(span); @@ -108,16 +108,20 @@ public static void activityEnd( if (scope == null) { return; } + final AgentSpan span = scope.span(); + boolean finished = false; try { - final AgentSpan span = scope.span(); - if (self.isFinished(pmContext, pmTask)) { + finished = self.isFinished(pmContext, pmTask); + if (finished) { TibcoDecorator.DECORATE.beforeFinish(span); - span.finish(); } else { InstrumentationContext.get(PmWorkUnit.class, AgentSpan.class).put(pmTask, span); } } finally { scope.close(); + if (finished) { + span.finish(); + } } } } @@ -144,7 +148,7 @@ public static void processStarts( startSpan( "tibco_bw", TibcoDecorator.TIBCO_PROCESS_OPERATION, - parent != null ? parentSpan.context() : null); + parent != null ? parentSpan.spanContext() : null); TibcoDecorator.DECORATE.afterStart(span); TibcoDecorator.DECORATE.onProcessStart(span, pmProcessInstance.getName(pmContext)); contextStore.put(pmProcessInstance, span); diff --git a/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-6.5/src/main/java/datadog/trace/instrumentation/tibcobw6/ProcessInstrumentation.java b/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-6.5/src/main/java/datadog/trace/instrumentation/tibcobw6/ProcessInstrumentation.java index e6a90077917..d6a070d0126 100644 --- a/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-6.5/src/main/java/datadog/trace/instrumentation/tibcobw6/ProcessInstrumentation.java +++ b/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-6.5/src/main/java/datadog/trace/instrumentation/tibcobw6/ProcessInstrumentation.java @@ -11,12 +11,12 @@ import com.tibco.pvm.api.PmProcessInstance; import com.tibco.pvm.api.PmWorkUnit; import com.tibco.pvm.api.session.PmContext; +import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.api.Config; import datadog.trace.bootstrap.ContextStore; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import net.bytebuddy.asm.Advice; import net.bytebuddy.description.type.TypeDescription; @@ -65,7 +65,7 @@ public static void onExit( // cannot find the name } } - try (AgentScope maybeScope = parentSpan != null ? activateSpan(parentSpan) : null) { + try (ContextScope maybeScope = parentSpan != null ? activateSpan(parentSpan) : null) { AgentSpan span = startSpan("tibco_bw", TibcoDecorator.TIBCO_PROCESS_OPERATION); TibcoDecorator.DECORATE.afterStart(span); if (appName != null) { diff --git a/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-6.5/src/main/java/datadog/trace/instrumentation/tibcobw6/TibcoDecorator.java b/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-6.5/src/main/java/datadog/trace/instrumentation/tibcobw6/TibcoDecorator.java index 4f788ff8fba..59987e822c4 100644 --- a/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-6.5/src/main/java/datadog/trace/instrumentation/tibcobw6/TibcoDecorator.java +++ b/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-6.5/src/main/java/datadog/trace/instrumentation/tibcobw6/TibcoDecorator.java @@ -59,20 +59,19 @@ protected CharSequence component() { } @Override - public AgentSpan afterStart(final AgentSpan span) { + public void afterStart(final AgentSpan span) { span.setTag(Tags.SPAN_KIND, Tags.SPAN_KIND_INTERNAL); - return super.afterStart(span); + super.afterStart(span); } - public AgentSpan onProcessStart(AgentSpan span, String processName) { - return span.setResourceName(processName) + public void onProcessStart(AgentSpan span, String processName) { + span.setResourceName(processName) .setTag(TIBCO_NODE, APPNODE_NAME) .setTag(TIBCO_VERSION, BW_VERSION) .setMeasured(true); } - public AgentSpan onActivityStart(final AgentSpan span, String activityName) { + public void onActivityStart(final AgentSpan span, String activityName) { span.setResourceName(activityName); - return span; } } diff --git a/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-stubs/gradle.lockfile b/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-stubs/gradle.lockfile index 5ca3972ba7b..7f3a6b2c167 100644 --- a/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-stubs/gradle.lockfile +++ b/dd-java-agent/instrumentation/tibco-businessworks/tibco-businessworks-stubs/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:tibco-businessworks:tibco-businessworks-stubs:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/tinylog-2.0/gradle.lockfile b/dd-java-agent/instrumentation/tinylog-2.0/gradle.lockfile index c2855bc4767..c2ba1677663 100644 --- a/dd-java-agent/instrumentation/tinylog-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/tinylog-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:tinylog-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/tinylog-2.0/src/main/java/datadog/trace/instrumentation/tinylog2/TinylogLoggingProviderInstrumentation.java b/dd-java-agent/instrumentation/tinylog-2.0/src/main/java/datadog/trace/instrumentation/tinylog2/TinylogLoggingProviderInstrumentation.java index 15b66a664d9..08379c059c4 100644 --- a/dd-java-agent/instrumentation/tinylog-2.0/src/main/java/datadog/trace/instrumentation/tinylog2/TinylogLoggingProviderInstrumentation.java +++ b/dd-java-agent/instrumentation/tinylog-2.0/src/main/java/datadog/trace/instrumentation/tinylog2/TinylogLoggingProviderInstrumentation.java @@ -54,7 +54,7 @@ public static void onEnter(@Advice.Argument(0) LogEntry event) { if (span != null && traceConfig(span).isLogsInjectionEnabled()) { InstrumentationContext.get(LogEntry.class, AgentSpanContext.class) - .put(event, span.context()); + .put(event, span.spanContext()); } } } diff --git a/dd-java-agent/instrumentation/tomcat/tomcat-5.5/gradle.lockfile b/dd-java-agent/instrumentation/tomcat/tomcat-5.5/gradle.lockfile index 59afdb2dc1a..d46dae3bf7f 100644 --- a/dd-java-agent/instrumentation/tomcat/tomcat-5.5/gradle.lockfile +++ b/dd-java-agent/instrumentation/tomcat/tomcat-5.5/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:tomcat:tomcat-5.5:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latest10ForkedTestCompileClasspath,latest10Fo com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath +com.github.jnr:jffi:1.3.15=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latest10ForkedTestAnnotationProcessor,latest10ForkedTestCompileClasspath,latest10TestAnnotationProcessor,latest10TestCompileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath,tomcat9TestAnnotationProcessor,tomcat9TestCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latest10ForkedTestAnnotationProcessor,latest10TestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,tomcat9TestAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latest10ForkedTestAnnotationProcessor,latest10TestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,tomcat9TestAnnotationProcessor -com.google.guava:guava:20.0=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latest10ForkedTestAnnotationProcessor,latest10TestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,tomcat9TestAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latest10ForkedTestAnnotationProcessor,latest10TestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,tomcat9TestAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latest10ForkedTestAnnotationProcessor,latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestAnnotationProcessor,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath,tomcat9TestAnnotationProcessor,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latest10ForkedTestAnnotationProcessor,latest10TestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,tomcat9TestAnnotationProcessor -com.google.re2j:re2j:1.7=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath +com.google.re2j:re2j:1.8=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath @@ -49,39 +53,41 @@ commons-digester:commons-digester:1.4.1=testCompileClasspath,testRuntimeClasspat commons-fileupload:commons-fileupload:1.5=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs -commons-io:commons-io:2.21.0=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +commons-io:commons-io:2.22.0=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath commons-logging:commons-logging-api:1.0.4=testCompileClasspath,testRuntimeClasspath commons-logging:commons-logging:1.0=testCompileClasspath,testRuntimeClasspath commons-modeler:commons-modeler:2.0.1=testCompileClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath javax.servlet:servlet-api:2.4=compileClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath net.java.dev.jna:jna:5.8.0=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc -org.apache.bcel:bcel:6.11.0=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs +org.apache.bcel:bcel:6.11.0=spotbugs +org.apache.bcel:bcel:6.12.0=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.commons:commons-compress:1.28.0=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.apache.commons:commons-lang3:3.19.0=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs +org.apache.commons:commons-lang3:3.19.0=spotbugs +org.apache.commons:commons-lang3:3.20.0=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.commons:commons-text:1.14.0=spotbugs org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs -org.apache.tomcat.embed:tomcat-embed-core:10.1.54=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-core:11.0.21=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-core:9.0.117=tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-websocket:10.1.54=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-websocket:11.0.21=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-websocket:9.0.117=tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath -org.apache.tomcat:jakartaee-migration:1.0.10=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.apache.tomcat:tomcat-annotations-api:10.1.54=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath -org.apache.tomcat:tomcat-annotations-api:11.0.21=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.apache.tomcat:tomcat-annotations-api:9.0.117=tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath +org.apache.tomcat.embed:tomcat-embed-core:10.1.57=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath +org.apache.tomcat.embed:tomcat-embed-core:11.0.24=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.tomcat.embed:tomcat-embed-core:9.0.120=tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath +org.apache.tomcat.embed:tomcat-embed-websocket:10.1.57=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath +org.apache.tomcat.embed:tomcat-embed-websocket:11.0.24=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.tomcat.embed:tomcat-embed-websocket:9.0.120=tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath +org.apache.tomcat:jakartaee-migration:1.0.12=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.tomcat:tomcat-annotations-api:10.1.57=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath +org.apache.tomcat:tomcat-annotations-api:11.0.24=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.tomcat:tomcat-annotations-api:9.0.120=tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath org.apache.tomcat:tomcat-websocket-api:8.0.1=compileClasspath org.apache.tomcat:tomcat-websocket:8.0.1=compileClasspath org.apiguardian:apiguardian-api:1.1.2=latest10ForkedTestCompileClasspath,latest10TestCompileClasspath,latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath,testCompileClasspath,tomcat9TestCompileClasspath @@ -97,12 +103,13 @@ org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.eclipse.platform:org.eclipse.osgi:3.18.600=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.eclipse.platform:org.eclipse.osgi:3.24.100=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath org.hamcrest:hamcrest:3.0=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath org.jctools:jctools-core:4.0.6=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath +org.jspecify:jspecify:1.0.0=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath @@ -120,14 +127,14 @@ org.objenesis:objenesis:3.3=latest10ForkedTestCompileClasspath,latest10ForkedTes org.opentest4j:opentest4j:1.3.0=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latest10ForkedTestRuntimeClasspath,latest10TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath,tomcat9TestRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latest10ForkedTestCompileClasspath,latest10ForkedTestRuntimeClasspath,latest10TestCompileClasspath,latest10TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,tomcat9TestCompileClasspath,tomcat9TestRuntimeClasspath diff --git a/dd-java-agent/instrumentation/tomcat/tomcat-5.5/src/main/java/datadog/trace/instrumentation/tomcat/TomcatServerInstrumentation.java b/dd-java-agent/instrumentation/tomcat/tomcat-5.5/src/main/java/datadog/trace/instrumentation/tomcat/TomcatServerInstrumentation.java index 07c88563d59..14fb92e8fae 100644 --- a/dd-java-agent/instrumentation/tomcat/tomcat-5.5/src/main/java/datadog/trace/instrumentation/tomcat/TomcatServerInstrumentation.java +++ b/dd-java-agent/instrumentation/tomcat/tomcat-5.5/src/main/java/datadog/trace/instrumentation/tomcat/TomcatServerInstrumentation.java @@ -3,7 +3,7 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.agent.tooling.muzzle.Reference.EXPECTS_NON_STATIC; import static datadog.trace.agent.tooling.muzzle.Reference.EXPECTS_PUBLIC; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; import static datadog.trace.bootstrap.instrumentation.java.concurrent.ExcludeFilter.ExcludeType.RUNNABLE; @@ -131,7 +131,7 @@ public static void extractParent( } } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void closeScope(@Advice.Local("parentScope") ContextScope scope) { scope.close(); } @@ -151,7 +151,7 @@ public static void onService( } final Object parentContextObj = req.getAttribute(DD_PARENT_CONTEXT_ATTRIBUTE); final Context parentContext = - (parentContextObj instanceof Context) ? (Context) parentContextObj : null; + (parentContextObj instanceof Context) ? (Context) parentContextObj : rootContext(); final Context context = DECORATE.startSpan(req, parentContext); serverScope = context.attach(); @@ -165,7 +165,7 @@ public static void onService( req.setAttribute(CorrelationIdentifier.getSpanIdKey(), CorrelationIdentifier.getSpanId()); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void closeScope(@Advice.Local("serverScope") ContextScope serverScope) { serverScope.close(); } @@ -198,7 +198,7 @@ public static void afterParse( CorrelationIdentifier.getTraceIdKey(), AgentTracer.get().getTraceId(span)); req.setAttribute(CorrelationIdentifier.getSpanIdKey(), AgentTracer.get().getSpanId(span)); Object ctxObj = req.getAttribute(DD_PARENT_CONTEXT_ATTRIBUTE); - Context parentContext = ctxObj instanceof Context ? (Context) ctxObj : getRootContext(); + Context parentContext = ctxObj instanceof Context ? (Context) ctxObj : rootContext(); DECORATE.onRequest(span, req, req, parentContext); Flow.Action.RequestBlockingAction rba = span.getRequestBlockingAction(); if (rba != null) { diff --git a/dd-java-agent/instrumentation/tomcat/tomcat-9.0/gradle.lockfile b/dd-java-agent/instrumentation/tomcat/tomcat-9.0/gradle.lockfile index 935feccdcdb..69ef47f39f8 100644 --- a/dd-java-agent/instrumentation/tomcat/tomcat-9.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/tomcat/tomcat-9.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:tomcat:tomcat-9.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -92,6 +96,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -109,14 +114,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-5.5/gradle.lockfile b/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-5.5/gradle.lockfile index 819d84b9422..24cf9bf6c9d 100644 --- a/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-5.5/gradle.lockfile +++ b/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-5.5/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:tomcat:tomcat-appsec:tomcat-appsec-5.5:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -48,12 +52,12 @@ commons-io:commons-io:2.20.0=spotbugs commons-logging:commons-logging-api:1.0.4=compileClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -82,6 +86,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -99,14 +104,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-5.5/src/main/java/datadog/trace/instrumentation/tomcat55/ParsedBodyParametersInstrumentation.java b/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-5.5/src/main/java/datadog/trace/instrumentation/tomcat55/ParsedBodyParametersInstrumentation.java index 86f4ca2a590..be98fe79c12 100644 --- a/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-5.5/src/main/java/datadog/trace/instrumentation/tomcat55/ParsedBodyParametersInstrumentation.java +++ b/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-5.5/src/main/java/datadog/trace/instrumentation/tomcat55/ParsedBodyParametersInstrumentation.java @@ -87,7 +87,7 @@ static int before() { return CallDepthThreadLocalMap.incrementCallDepth(Parameters.class); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after(@Advice.Enter final int depth) { if (depth > 0) { return; @@ -113,7 +113,7 @@ static int before( // if there is no request context, skips the body, returns 0 and will skip after() } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Local("origParamHashStringArray") Hashtable origParamValues, @Advice.FieldValue(value = "paramHashStringArray", readOnly = false) diff --git a/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-6.0/gradle.lockfile b/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-6.0/gradle.lockfile index 823f18fab77..623983ed0e8 100644 --- a/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-6.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-6.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:tomcat:tomcat-appsec:tomcat-appsec-6.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -84,6 +88,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -101,14 +106,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-6.0/src/main/java/datadog/trace/instrumentation/tomcat6/ParsedBodyParametersInstrumentation.java b/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-6.0/src/main/java/datadog/trace/instrumentation/tomcat6/ParsedBodyParametersInstrumentation.java index 62883114bec..6a6aebeec7b 100644 --- a/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-6.0/src/main/java/datadog/trace/instrumentation/tomcat6/ParsedBodyParametersInstrumentation.java +++ b/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-6.0/src/main/java/datadog/trace/instrumentation/tomcat6/ParsedBodyParametersInstrumentation.java @@ -75,7 +75,7 @@ static int before() { return CallDepthThreadLocalMap.incrementCallDepth(Parameters.class); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after(@Advice.Enter final int depth) { if (depth > 0) { return; @@ -102,7 +102,7 @@ static int before( // if there is no request context, skips the body, returns 0 and will skip after() } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Local("origParamHashValues") Map> origParamValues, @Advice.FieldValue("paramHashValues") final Map> paramValuesField, diff --git a/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-7.0/build.gradle b/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-7.0/build.gradle index f5542d48255..46143d86080 100644 --- a/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-7.0/build.gradle +++ b/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-7.0/build.gradle @@ -15,6 +15,13 @@ muzzle { extraDependency 'org.apache.tomcat:tomcat-catalina:7.0.4' assertInverse = true } + pass { + name = 'glassfish' + group = 'org.glassfish.main.extras' + module = 'glassfish-embedded-all' + versions = '[4.0, 6.1.0)' // GlassFish 6.1.0+ uses jakarta.* namespace; our advice uses javax.servlet.http.Part + assertInverse = true + } } apply from: "$rootDir/gradle/java.gradle" @@ -22,10 +29,20 @@ apply from: "$rootDir/gradle/java.gradle" dependencies { compileOnly group: 'org.apache.tomcat', name: 'tomcat-catalina', version: '7.0.4' compileOnly group: 'org.apache.tomcat', name: 'tomcat-coyote', version: '7.0.4' + // Servlet 3.1 API needed to reference Part.getSubmittedFileName() in GlassFishMultipartInstrumentation. + // tomcat-catalina:7.0.4 provides only Servlet 3.0 (no getSubmittedFileName); GlassFish 4+ is Servlet 3.1. + compileOnly group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0' + // org.apache.catalina.Request and org.apache.catalina.Response interfaces are GlassFish-specific — + // Tomcat 7.x removed them from its published API. Required to cast connector.Request to the + // catalina Request interface in GlassFishBlockingHelper without reflection. + compileOnly group: 'org.glassfish.main.extras', name: 'glassfish-embedded-all', version: '4.0' implementation project(':dd-java-agent:instrumentation:tomcat:tomcat-common') testImplementation group: 'org.apache.tomcat', name: 'tomcat-catalina', version: '7.0.4' testImplementation group: 'org.apache.tomcat', name: 'tomcat-coyote', version: '7.0.4' + testImplementation group: 'javax.servlet', name: 'javax.servlet-api', version: '3.1.0' + testImplementation libs.bundles.mockito + testCompileOnly group: 'org.glassfish.main.extras', name: 'glassfish-embedded-all', version: '4.0' } // testing happens in tomcat-5.5 module diff --git a/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-7.0/gradle.lockfile b/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-7.0/gradle.lockfile index 0ec82c398ca..5ae3bdf3e27 100644 --- a/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-7.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-7.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:tomcat:tomcat-appsec:tomcat-appsec-7.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath -javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath +javax.servlet:javax.servlet-api:3.1.0=compileClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -83,11 +87,13 @@ org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs +org.glassfish.main.extras:glassfish-embedded-all:4.0=compileClasspath,testCompileClasspath org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -100,19 +106,20 @@ org.junit.platform:junit-platform-suite-api:1.14.1=testRuntimeClasspath org.junit.platform:junit-platform-suite-commons:1.14.1=testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath -org.mockito:mockito-core:4.4.0=testRuntimeClasspath +org.mockito:mockito-core:4.4.0=testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-7.0/src/main/java/datadog/trace/instrumentation/tomcat7/GlassFishBlockingHelper.java b/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-7.0/src/main/java/datadog/trace/instrumentation/tomcat7/GlassFishBlockingHelper.java new file mode 100644 index 00000000000..78a06148a71 --- /dev/null +++ b/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-7.0/src/main/java/datadog/trace/instrumentation/tomcat7/GlassFishBlockingHelper.java @@ -0,0 +1,184 @@ +package datadog.trace.instrumentation.tomcat7; + +import datadog.appsec.api.blocking.BlockingContentType; +import datadog.trace.api.Config; +import datadog.trace.api.gateway.BlockResponseFunction; +import datadog.trace.api.gateway.Flow; +import datadog.trace.api.gateway.RequestContext; +import datadog.trace.api.http.MultipartContentDecoder; +import datadog.trace.bootstrap.blocking.BlockingActionHelper; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.function.BiFunction; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.Part; + +public final class GlassFishBlockingHelper { + + public static final int MAX_FILE_CONTENT_COUNT = Config.get().getAppSecMaxFileContentCount(); + public static final int MAX_FILE_CONTENT_BYTES = Config.get().getAppSecMaxFileContentBytes(); + + /** + * Attempts to commit a blocking response via the registered {@link BlockResponseFunction} or via + * the Servlet API fallback, then marks the trace segment as effectively blocked. + * + *

      Returns {@code true} if the response was committed (regardless of whether {@link + * datadog.trace.api.internal.TraceSegment#effectivelyBlocked()} succeeded). Returns {@code false} + * if no response could be committed. + */ + public static boolean tryBlock( + RequestContext reqCtx, + HttpServletRequest fallbackReq, + HttpServletResponse fallbackResp, + Flow.Action.RequestBlockingAction rba) { + try { + BlockResponseFunction brf = reqCtx.getBlockResponseFunction(); + if (brf != null) { + brf.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba); + } else if (!commitBlocking(fallbackReq, fallbackResp, rba)) { + return false; + } + } catch (Exception ignored) { + // commit failed — response not sent, cannot block this request + return false; + } + // Response was committed — mark as blocked on a best-effort basis. + // effectivelyBlocked() can throw if the span is already finished; that must not suppress the + // true return value since the response has already been sent to the client. + try { + reqCtx.getTraceSegment().effectivelyBlocked(); + } catch (Exception ignored) { + // span already finished — response was sent, blocking succeeded + } + return true; + } + + /** + * Collects filenames and file contents from the given multipart parts, fires the AppSec IG + * callbacks, and commits a blocking response if the WAF requests one. + * + *

      Returns {@code true} if a blocking response was committed (the caller should replace the + * parts collection with an empty list to prevent further processing). + */ + public static boolean processPartsAndBlock( + Collection parts, + RequestContext reqCtx, + org.apache.catalina.Request catRequest, + BiFunction, Flow> filenamesCb, + BiFunction, Flow> contentCb) { + // org.apache.catalina.Request.getRequest() returns the underlying ServletRequest. + // TomcatServerInstrumentation is muzzled out in Payara (CoyoteAdapter.postParseRequest arg + // types differ from standard Tomcat), so BlockResponseFunction is never registered there — + // this Servlet API fallback is required to commit the blocking response in Payara. + javax.servlet.ServletRequest sr = catRequest != null ? catRequest.getRequest() : null; + HttpServletRequest fallbackReq = + sr instanceof HttpServletRequest ? (HttpServletRequest) sr : null; + HttpServletResponse fallbackResp = null; + if (catRequest != null) { + org.apache.catalina.Response cr = catRequest.getResponse(); + if (cr != null) { + javax.servlet.ServletResponse svr = cr.getResponse(); + if (svr instanceof HttpServletResponse) { + fallbackResp = (HttpServletResponse) svr; + } + } + } + List filenames = null; + List contents = null; + for (Object partObj : parts) { + try { + if (!(partObj instanceof Part)) { + continue; + } + Part part = (Part) partObj; + String filename = part.getSubmittedFileName(); + if (filename == null) { + continue; + } + if (filenamesCb != null && !filename.isEmpty()) { + if (filenames == null) { + filenames = new ArrayList<>(); + } + filenames.add(filename); + } + if (contentCb != null) { + if (contents == null) { + contents = new ArrayList<>(); + } + if (contents.size() < MAX_FILE_CONTENT_COUNT) { + try (InputStream is = part.getInputStream()) { + contents.add( + MultipartContentDecoder.readInputStream( + is, MAX_FILE_CONTENT_BYTES, part.getContentType())); + } catch (Exception ignored) { + // stream read failed — report empty content rather than skipping the part entirely + contents.add(""); + } + } + } + } catch (Exception ignored) { + // malformed or inaccessible part — skip and continue with remaining parts + } + } + + if (filenames != null && !filenames.isEmpty()) { + Flow flow = filenamesCb.apply(reqCtx, filenames); + Flow.Action action = flow.getAction(); + if (action instanceof Flow.Action.RequestBlockingAction) { + if (tryBlock( + reqCtx, fallbackReq, fallbackResp, (Flow.Action.RequestBlockingAction) action)) { + return true; + } + } + } + + if (contents != null && !contents.isEmpty()) { + Flow contentFlow = contentCb.apply(reqCtx, contents); + Flow.Action contentAction = contentFlow.getAction(); + if (contentAction instanceof Flow.Action.RequestBlockingAction) { + return tryBlock( + reqCtx, fallbackReq, fallbackResp, (Flow.Action.RequestBlockingAction) contentAction); + } + } + + return false; + } + + public static boolean commitBlocking( + HttpServletRequest request, + HttpServletResponse response, + Flow.Action.RequestBlockingAction rba) { + if (response == null) { + return false; + } + try { + if (response.isCommitted()) { + return false; + } + response.reset(); + response.setStatus(BlockingActionHelper.getHttpCode(rba.getStatusCode())); + for (Map.Entry e : rba.getExtraHeaders().entrySet()) { + response.setHeader(e.getKey(), e.getValue()); + } + if (rba.getBlockingContentType() != BlockingContentType.NONE) { + String accept = request != null ? request.getHeader("Accept") : null; + BlockingActionHelper.TemplateType type = + BlockingActionHelper.determineTemplateType(rba.getBlockingContentType(), accept); + byte[] body = BlockingActionHelper.getTemplate(type, rba.getSecurityResponseId()); + if (body != null) { + response.setHeader("Content-Type", BlockingActionHelper.getContentType(type)); + response.setHeader("Content-Length", Integer.toString(body.length)); + response.getOutputStream().write(body); + } + } + response.flushBuffer(); + return true; + } catch (Exception e) { + return false; + } + } +} diff --git a/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-7.0/src/main/java/datadog/trace/instrumentation/tomcat7/GlassFishMultipartInstrumentation.java b/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-7.0/src/main/java/datadog/trace/instrumentation/tomcat7/GlassFishMultipartInstrumentation.java new file mode 100644 index 00000000000..74dde6d6b38 --- /dev/null +++ b/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-7.0/src/main/java/datadog/trace/instrumentation/tomcat7/GlassFishMultipartInstrumentation.java @@ -0,0 +1,99 @@ +package datadog.trace.instrumentation.tomcat7; + +import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static datadog.trace.api.gateway.Events.EVENTS; +import static net.bytebuddy.matcher.ElementMatchers.isPublic; +import static net.bytebuddy.matcher.ElementMatchers.takesArguments; + +import com.google.auto.service.AutoService; +import datadog.trace.agent.tooling.Instrumenter; +import datadog.trace.agent.tooling.InstrumenterModule; +import datadog.trace.api.gateway.CallbackProvider; +import datadog.trace.api.gateway.Flow; +import datadog.trace.api.gateway.RequestContext; +import datadog.trace.api.gateway.RequestContextSlot; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.function.BiFunction; +import net.bytebuddy.asm.Advice; + +/** + * GlassFish/Payara does not have {@code Request.parseParts()} - instead {@code Request.getParts()} + * delegates to {@code org.apache.catalina.fileupload.Multipart.getParts()}. This instrumentation + * hooks that GlassFish-specific class to report uploaded file names and contents to the AppSec WAF + * via the {@code requestFilesFilenames} and {@code requestFilesContent} IG events. + * + *

      Because {@code org.apache.catalina.fileupload.Multipart} does not exist in standard Tomcat, + * this instrumentation is automatically skipped by ByteBuddy on non-GlassFish containers. + */ +@AutoService(InstrumenterModule.class) +public class GlassFishMultipartInstrumentation extends InstrumenterModule.AppSec + implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { + + public GlassFishMultipartInstrumentation() { + super("tomcat"); + } + + @Override + public String muzzleDirective() { + return "glassfish"; + } + + @Override + public String instrumentedType() { + return "org.apache.catalina.fileupload.Multipart"; + } + + @Override + public String[] helperClassNames() { + return new String[] { + "datadog.trace.instrumentation.tomcat7.GlassFishBlockingHelper", + }; + } + + @Override + public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvice( + named("getParts").and(takesArguments(0)).and(isPublic()), + getClass().getName() + "$GetPartsAdvice"); + } + + public static class GetPartsAdvice { + + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + static void after( + @Advice.Return(readOnly = false) Collection parts, + @Advice.Thrown Throwable t, + @Advice.FieldValue("request") org.apache.catalina.Request catRequest) { + if (t != null || parts == null || parts.isEmpty()) { + return; + } + + AgentSpan agentSpan = AgentTracer.activeSpan(); + if (agentSpan == null) { + return; + } + RequestContext reqCtx = agentSpan.getRequestContext(); + if (reqCtx == null || reqCtx.getData(RequestContextSlot.APPSEC) == null) { + return; + } + + CallbackProvider cbp = AgentTracer.get().getCallbackProvider(RequestContextSlot.APPSEC); + BiFunction, Flow> filenamesCb = + cbp.getCallback(EVENTS.requestFilesFilenames()); + BiFunction, Flow> contentCb = + cbp.getCallback(EVENTS.requestFilesContent()); + if (filenamesCb == null && contentCb == null) { + return; + } + + if (GlassFishBlockingHelper.processPartsAndBlock( + parts, reqCtx, catRequest, filenamesCb, contentCb)) { + parts = Collections.emptyList(); + } + } + } +} diff --git a/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-7.0/src/main/java/datadog/trace/instrumentation/tomcat7/ParsePartsInstrumentation.java b/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-7.0/src/main/java/datadog/trace/instrumentation/tomcat7/ParsePartsInstrumentation.java index ad7417a380d..1799a9cbaa9 100644 --- a/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-7.0/src/main/java/datadog/trace/instrumentation/tomcat7/ParsePartsInstrumentation.java +++ b/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-7.0/src/main/java/datadog/trace/instrumentation/tomcat7/ParsePartsInstrumentation.java @@ -101,7 +101,7 @@ static void before( collector = ParameterCollector.ParameterCollectorNoop.INSTANCE; } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Local("collector") ParameterCollector collector, @Advice.Local("reqCtx") RequestContext reqCtx, diff --git a/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-7.0/src/test/java/datadog/trace/instrumentation/tomcat7/GlassFishBlockingHelperTest.java b/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-7.0/src/test/java/datadog/trace/instrumentation/tomcat7/GlassFishBlockingHelperTest.java new file mode 100644 index 00000000000..e4c4a953c17 --- /dev/null +++ b/dd-java-agent/instrumentation/tomcat/tomcat-appsec/tomcat-appsec-7.0/src/test/java/datadog/trace/instrumentation/tomcat7/GlassFishBlockingHelperTest.java @@ -0,0 +1,379 @@ +package datadog.trace.instrumentation.tomcat7; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.contains; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import datadog.appsec.api.blocking.BlockingContentType; +import datadog.trace.api.gateway.BlockResponseFunction; +import datadog.trace.api.gateway.Flow; +import datadog.trace.api.gateway.RequestContext; +import datadog.trace.api.internal.TraceSegment; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.function.BiFunction; +import javax.servlet.ServletOutputStream; +import javax.servlet.WriteListener; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.Part; +import org.junit.jupiter.api.Test; + +class GlassFishBlockingHelperTest { + + // ------- commitBlocking() ------- + + @Test + void commitBlocking_nullResponse_returnsFalse() { + assertFalse(GlassFishBlockingHelper.commitBlocking(null, null, rba(403))); + } + + @Test + void commitBlocking_committedResponse_returnsFalse() { + HttpServletResponse resp = mock(HttpServletResponse.class); + when(resp.isCommitted()).thenReturn(true); + assertFalse(GlassFishBlockingHelper.commitBlocking(null, resp, rba(403))); + } + + @Test + void commitBlocking_blockingContentTypeNone_setsStatusWithoutBody() throws IOException { + HttpServletResponse resp = mock(HttpServletResponse.class); + when(resp.isCommitted()).thenReturn(false); + + assertTrue( + GlassFishBlockingHelper.commitBlocking( + null, resp, new Flow.Action.RequestBlockingAction(403, BlockingContentType.NONE))); + + verify(resp).setStatus(403); + verify(resp).flushBuffer(); + verify(resp, never()).setHeader(eq("Content-Type"), any()); + verify(resp, never()).getOutputStream(); + } + + @Test + void commitBlocking_withJsonAccept_writesJsonBody() throws IOException { + HttpServletRequest req = mock(HttpServletRequest.class); + when(req.getHeader("Accept")).thenReturn("application/json"); + TestServletOutputStream out = new TestServletOutputStream(); + HttpServletResponse resp = mock(HttpServletResponse.class); + when(resp.isCommitted()).thenReturn(false); + when(resp.getOutputStream()).thenReturn(out); + + assertTrue(GlassFishBlockingHelper.commitBlocking(req, resp, rba(403))); + + verify(resp).setStatus(403); + verify(resp).setHeader(eq("Content-Type"), contains("json")); + verify(resp).setHeader(eq("Content-Length"), any()); + assertTrue(out.getBytes().length > 0); + verify(resp).flushBuffer(); + } + + @Test + void commitBlocking_withHtmlAccept_writesHtmlBody() throws IOException { + HttpServletRequest req = mock(HttpServletRequest.class); + when(req.getHeader("Accept")).thenReturn("text/html"); + TestServletOutputStream out = new TestServletOutputStream(); + HttpServletResponse resp = mock(HttpServletResponse.class); + when(resp.isCommitted()).thenReturn(false); + when(resp.getOutputStream()).thenReturn(out); + + assertTrue(GlassFishBlockingHelper.commitBlocking(req, resp, rba(403))); + + verify(resp).setHeader(eq("Content-Type"), contains("html")); + assertTrue(out.getBytes().length > 0); + } + + @Test + void commitBlocking_nullRequest_defaultsToJsonBody() throws IOException { + TestServletOutputStream out = new TestServletOutputStream(); + HttpServletResponse resp = mock(HttpServletResponse.class); + when(resp.isCommitted()).thenReturn(false); + when(resp.getOutputStream()).thenReturn(out); + + assertTrue(GlassFishBlockingHelper.commitBlocking(null, resp, rba(403))); + + verify(resp).setStatus(403); + assertTrue(out.getBytes().length > 0); + } + + @Test + void commitBlocking_ioException_returnsFalse() throws IOException { + HttpServletResponse resp = mock(HttpServletResponse.class); + when(resp.isCommitted()).thenReturn(false); + when(resp.getOutputStream()).thenThrow(new IOException("stream error")); + + assertFalse(GlassFishBlockingHelper.commitBlocking(null, resp, rba(403))); + } + + // ------- tryBlock() ------- + + @Test + void tryBlock_withBrf_commitsViaFunctionAndReturnsTrue() throws Exception { + TraceSegment segment = mock(TraceSegment.class); + BlockResponseFunction brf = mock(BlockResponseFunction.class); + RequestContext reqCtx = mockReqCtx(brf, segment); + + Flow.Action.RequestBlockingAction action = rba(403); + assertTrue(GlassFishBlockingHelper.tryBlock(reqCtx, null, null, action)); + + verify(brf).tryCommitBlockingResponse(segment, action); + verify(segment).effectivelyBlocked(); + } + + @Test + void tryBlock_noBrf_fallbackSucceeds_returnsTrue() throws IOException { + TraceSegment segment = mock(TraceSegment.class); + RequestContext reqCtx = mockReqCtx(null, segment); + TestServletOutputStream out = new TestServletOutputStream(); + HttpServletResponse resp = mock(HttpServletResponse.class); + when(resp.isCommitted()).thenReturn(false); + when(resp.getOutputStream()).thenReturn(out); + + assertTrue(GlassFishBlockingHelper.tryBlock(reqCtx, null, resp, rba(403))); + verify(segment).effectivelyBlocked(); + } + + @Test + void tryBlock_noBrf_nullFallbackResponse_returnsFalse() { + RequestContext reqCtx = mock(RequestContext.class); + when(reqCtx.getBlockResponseFunction()).thenReturn(null); + + assertFalse(GlassFishBlockingHelper.tryBlock(reqCtx, null, null, rba(403))); + verify(reqCtx, never()).getTraceSegment(); + } + + @Test + void tryBlock_brfThrows_returnsFalse() throws Exception { + TraceSegment segment = mock(TraceSegment.class); + BlockResponseFunction brf = mock(BlockResponseFunction.class); + RequestContext reqCtx = mockReqCtx(brf, segment); + doThrow(new RuntimeException("commit failed")) + .when(brf) + .tryCommitBlockingResponse(any(), any(Flow.Action.RequestBlockingAction.class)); + + assertFalse(GlassFishBlockingHelper.tryBlock(reqCtx, null, null, rba(403))); + verify(segment, never()).effectivelyBlocked(); + } + + @Test + void tryBlock_effectivelyBlockedThrows_stillReturnsTrue() throws Exception { + TraceSegment segment = mock(TraceSegment.class); + BlockResponseFunction brf = mock(BlockResponseFunction.class); + RequestContext reqCtx = mockReqCtx(brf, segment); + doThrow(new RuntimeException("span already finished")).when(segment).effectivelyBlocked(); + + assertTrue(GlassFishBlockingHelper.tryBlock(reqCtx, null, null, rba(403))); + } + + // ------- processPartsAndBlock() ------- + + @Test + void processPartsAndBlock_formField_skipped() throws Exception { + Part formField = mockPart(null, "text/plain", new byte[0]); + RequestContext reqCtx = mockReqCtx(null, mock(TraceSegment.class)); + BiFunction, Flow> filenamesCb = mockPassThroughCb(); + + assertFalse( + GlassFishBlockingHelper.processPartsAndBlock( + Collections.singletonList(formField), reqCtx, null, filenamesCb, null)); + verify(formField).getSubmittedFileName(); + verify(formField, never()).getInputStream(); + } + + @Test + void processPartsAndBlock_emptyFilename_notAddedToFilenames_butContentRead() throws Exception { + byte[] content = "data".getBytes(); + Part filePart = mockPart("", "application/octet-stream", content); + RequestContext reqCtx = mockReqCtx(null, mock(TraceSegment.class)); + BiFunction, Flow> filenamesCb = mockPassThroughCb(); + BiFunction, Flow> contentCb = mockPassThroughCb(); + + assertFalse( + GlassFishBlockingHelper.processPartsAndBlock( + Collections.singletonList(filePart), reqCtx, null, filenamesCb, contentCb)); + + verify(filePart).getInputStream(); + verify(filenamesCb, never()).apply(any(), any()); + verify(contentCb).apply(eq(reqCtx), any()); + } + + @Test + void processPartsAndBlock_normalFilename_reportedViaFilenamesCb() throws Exception { + Part filePart = mockPart("file.txt", "text/plain", "hello".getBytes()); + RequestContext reqCtx = mockReqCtx(null, mock(TraceSegment.class)); + BiFunction, Flow> filenamesCb = mockPassThroughCb(); + + assertFalse( + GlassFishBlockingHelper.processPartsAndBlock( + Collections.singletonList(filePart), reqCtx, null, filenamesCb, null)); + + verify(filenamesCb).apply(eq(reqCtx), eq(Collections.singletonList("file.txt"))); + } + + @Test + void processPartsAndBlock_contentRead_reportedViaContentCb() throws Exception { + Part filePart = mockPart("file.bin", "application/octet-stream", new byte[] {1, 2, 3}); + RequestContext reqCtx = mockReqCtx(null, mock(TraceSegment.class)); + BiFunction, Flow> contentCb = mockPassThroughCb(); + + assertFalse( + GlassFishBlockingHelper.processPartsAndBlock( + Collections.singletonList(filePart), reqCtx, null, null, contentCb)); + + verify(contentCb).apply(eq(reqCtx), any()); + } + + @Test + void processPartsAndBlock_maxFilesLimit_enforced() throws Exception { + int limit = GlassFishBlockingHelper.MAX_FILE_CONTENT_COUNT; + Part[] tooMany = new Part[limit + 1]; + for (int i = 0; i <= limit; i++) { + tooMany[i] = mockPart("f" + i + ".bin", "application/octet-stream", new byte[0]); + } + RequestContext reqCtx = mockReqCtx(null, mock(TraceSegment.class)); + BiFunction, Flow> contentCb = mockPassThroughCb(); + + assertFalse( + GlassFishBlockingHelper.processPartsAndBlock( + Arrays.asList(tooMany), reqCtx, null, null, contentCb)); + + verify(contentCb).apply(eq(reqCtx), any(List.class)); + verify(tooMany[limit], never()).getInputStream(); + } + + @Test + @SuppressWarnings("unchecked") + void processPartsAndBlock_getInputStreamThrows_emptyStringFallback() throws Exception { + Part filePart = mock(Part.class); + when(filePart.getSubmittedFileName()).thenReturn("bad.bin"); + when(filePart.getInputStream()).thenThrow(new IOException("disk error")); + RequestContext reqCtx = mockReqCtx(null, mock(TraceSegment.class)); + BiFunction, Flow> contentCb = mockPassThroughCb(); + + assertFalse( + GlassFishBlockingHelper.processPartsAndBlock( + Collections.singletonList(filePart), reqCtx, null, null, contentCb)); + + verify(contentCb).apply(eq(reqCtx), eq(Collections.singletonList(""))); + } + + @Test + void processPartsAndBlock_filenamesCbBlocks_contentCbNotFired() throws Exception { + Part filePart = mockPart("evil.exe", "application/octet-stream", "content".getBytes()); + TraceSegment segment = mock(TraceSegment.class); + BlockResponseFunction brf = mock(BlockResponseFunction.class); + RequestContext reqCtx = mockReqCtx(brf, segment); + BiFunction, Flow> filenamesCb = mockBlockingCb(403); + BiFunction, Flow> contentCb = mockPassThroughCb(); + + assertTrue( + GlassFishBlockingHelper.processPartsAndBlock( + Collections.singletonList(filePart), reqCtx, null, filenamesCb, contentCb)); + + verify(contentCb, never()).apply(any(), any()); + } + + @Test + void processPartsAndBlock_contentCbBlocks_returnsTrue() throws Exception { + Part filePart = mockPart("upload.bin", "application/octet-stream", "payload".getBytes()); + TraceSegment segment = mock(TraceSegment.class); + BlockResponseFunction brf = mock(BlockResponseFunction.class); + RequestContext reqCtx = mockReqCtx(brf, segment); + BiFunction, Flow> filenamesCb = mockPassThroughCb(); + BiFunction, Flow> contentCb = mockBlockingCb(403); + + assertTrue( + GlassFishBlockingHelper.processPartsAndBlock( + Collections.singletonList(filePart), reqCtx, null, filenamesCb, contentCb)); + } + + @Test + void processPartsAndBlock_nonPartObject_skipped() { + RequestContext reqCtx = mockReqCtx(null, mock(TraceSegment.class)); + BiFunction, Flow> filenamesCb = mockPassThroughCb(); + + assertFalse( + GlassFishBlockingHelper.processPartsAndBlock( + Collections.singletonList("not-a-part"), reqCtx, null, filenamesCb, null)); + + verify(filenamesCb, never()).apply(any(), any()); + } + + // ------- Helpers ------- + + private static Flow.Action.RequestBlockingAction rba(int statusCode) { + return new Flow.Action.RequestBlockingAction(statusCode, BlockingContentType.AUTO); + } + + private static RequestContext mockReqCtx(BlockResponseFunction brf, TraceSegment segment) { + RequestContext reqCtx = mock(RequestContext.class); + when(reqCtx.getBlockResponseFunction()).thenReturn(brf); + when(reqCtx.getTraceSegment()).thenReturn(segment); + return reqCtx; + } + + private static Part mockPart(String submittedFilename, String contentType, byte[] content) + throws Exception { + Part part = mock(Part.class); + when(part.getSubmittedFileName()).thenReturn(submittedFilename); + when(part.getContentType()).thenReturn(contentType); + when(part.getInputStream()).thenAnswer(ignored -> new java.io.ByteArrayInputStream(content)); + return part; + } + + @SuppressWarnings("unchecked") + private static BiFunction, Flow> mockPassThroughCb() { + BiFunction, Flow> cb = mock(BiFunction.class); + Flow flow = mock(Flow.class); + when(flow.getAction()).thenReturn(Flow.Action.Noop.INSTANCE); + when(cb.apply(any(), any())).thenReturn(flow); + return cb; + } + + @SuppressWarnings("unchecked") + private static BiFunction, Flow> mockBlockingCb( + int statusCode) { + BiFunction, Flow> cb = mock(BiFunction.class); + Flow flow = mock(Flow.class); + when(flow.getAction()) + .thenReturn(new Flow.Action.RequestBlockingAction(statusCode, BlockingContentType.AUTO)); + when(cb.apply(any(), any())).thenReturn(flow); + return cb; + } + + private static final class TestServletOutputStream extends ServletOutputStream { + private final ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + + @Override + public boolean isReady() { + return true; + } + + @Override + public void setWriteListener(WriteListener listener) {} + + @Override + public void write(int b) throws IOException { + buffer.write(b); + } + + @Override + public void write(byte[] b, int off, int len) throws IOException { + buffer.write(b, off, len); + } + + public byte[] getBytes() { + return buffer.toByteArray(); + } + } +} diff --git a/dd-java-agent/instrumentation/tomcat/tomcat-common/gradle.lockfile b/dd-java-agent/instrumentation/tomcat/tomcat-common/gradle.lockfile index 0cabd302f91..1134aa2e291 100644 --- a/dd-java-agent/instrumentation/tomcat/tomcat-common/gradle.lockfile +++ b/dd-java-agent/instrumentation/tomcat/tomcat-common/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:tomcat:tomcat-common:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,13 +51,13 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath javax.servlet:servlet-api:2.4=compileClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -82,6 +86,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -99,14 +104,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/tomcat/tomcat-common/src/main/java/datadog/trace/instrumentation/tomcat/TomcatDecorator.java b/dd-java-agent/instrumentation/tomcat/tomcat-common/src/main/java/datadog/trace/instrumentation/tomcat/TomcatDecorator.java index 0303e7cdcd4..b285eabeaf9 100644 --- a/dd-java-agent/instrumentation/tomcat/tomcat-common/src/main/java/datadog/trace/instrumentation/tomcat/TomcatDecorator.java +++ b/dd-java-agent/instrumentation/tomcat/tomcat-common/src/main/java/datadog/trace/instrumentation/tomcat/TomcatDecorator.java @@ -95,7 +95,7 @@ protected String requestedSessionId(final Request request) { } @Override - public AgentSpan onRequest( + public void onRequest( final AgentSpan span, final Request connection, final Request request, @@ -117,7 +117,7 @@ public AgentSpan onRequest( request.setAttribute(DD_CONTEXT_PATH_ATTRIBUTE, contextPath); request.setAttribute(DD_SERVLET_PATH_ATTRIBUTE, servletPath); } - return super.onRequest(span, connection, request, parentContext); + super.onRequest(span, connection, request, parentContext); } @Override @@ -126,7 +126,7 @@ protected boolean isAppSecOnResponseSeparate() { } @Override - public AgentSpan onResponse(AgentSpan span, Response response) { + public void onResponse(AgentSpan span, Response response) { Request req = response.getRequest(); if (Config.get().isServletPrincipalEnabled() && req.getUserPrincipal() != null) { span.setTag(DDTags.USER_NAME, req.getUserPrincipal().getName()); @@ -139,7 +139,7 @@ public AgentSpan onResponse(AgentSpan span, Response response) { if (throwable instanceof Throwable) { onError(span, (Throwable) throwable); } - return super.onResponse(span, response); + super.onResponse(span, response); } @Override diff --git a/dd-java-agent/instrumentation/twilio-0.0.1/gradle.lockfile b/dd-java-agent/instrumentation/twilio-0.0.1/gradle.lockfile index 35f43020508..0dfa2f20275 100644 --- a/dd-java-agent/instrumentation/twilio-0.0.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/twilio-0.0.1/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:twilio-0.0.1:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -9,7 +10,7 @@ com.auth0:java-jwt:4.4.0=latestDepTestCompileClasspath,latestDepTestRuntimeClass com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -24,15 +25,15 @@ com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.18.6=latestDepTestCompi com.fasterxml.jackson:jackson-bom:2.18.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.woodstox:woodstox-core:7.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -43,20 +44,23 @@ com.google.code.gson:gson:2.10.1=latestDepTestCompileClasspath,latestDepTestRunt com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:18.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:18.0=compileClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okio:okio:1.17.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc com.twilio.sdk:twilio:0.0.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.twilio.sdk:twilio:12.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.twilio.sdk:twilio:12.1.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath commons-codec:commons-codec:1.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath commons-codec:commons-codec:1.9=compileClasspath,testCompileClasspath,testRuntimeClasspath commons-fileupload:commons-fileupload:1.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -70,7 +74,7 @@ io.jsonwebtoken:jjwt-impl:0.12.6=latestDepTestRuntimeClasspath io.jsonwebtoken:jjwt-jackson:0.12.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.jsonwebtoken:jjwt:0.4=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.activation:activation:1.1=compileClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.xml.bind:jaxb-api:2.2=compileClasspath,testCompileClasspath,testRuntimeClasspath @@ -78,8 +82,8 @@ javax.xml.stream:stax-api:1.0-2=compileClasspath,testCompileClasspath,testRuntim jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.5=compileClasspath,testCompileClasspath,testRuntimeClasspath junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -116,6 +120,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.json:json:20240303=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -133,14 +138,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/twilio-0.0.1/src/main/java/datadog/trace/instrumentation/twilio/TwilioAsyncInstrumentation.java b/dd-java-agent/instrumentation/twilio-0.0.1/src/main/java/datadog/trace/instrumentation/twilio/TwilioAsyncInstrumentation.java index 5f9c23dec85..0ba37278c43 100644 --- a/dd-java-agent/instrumentation/twilio-0.0.1/src/main/java/datadog/trace/instrumentation/twilio/TwilioAsyncInstrumentation.java +++ b/dd-java-agent/instrumentation/twilio-0.0.1/src/main/java/datadog/trace/instrumentation/twilio/TwilioAsyncInstrumentation.java @@ -121,15 +121,13 @@ public static void methodExit( return; } // If we have a scope (i.e. we were the top-level Twilio SDK invocation), + final AgentSpan span = scope.span(); try { - final AgentSpan span = scope.span(); - if (throwable != null) { - // There was an synchronous error, + // There was a synchronous error, // which means we shouldn't wait for a callback to close the span. DECORATE.onError(span, throwable); DECORATE.beforeFinish(span); - span.finish(); } else { // We're calling an async operation, we still need to finish the span when it's // complete and report the results; set an appropriate callback @@ -138,7 +136,9 @@ public static void methodExit( } } finally { scope.close(); - // span finished in SpanFinishingCallback + if (throwable != null) { + span.finish(); + } // else span finished in SpanFinishingCallback CallDepthThreadLocalMap.reset(Twilio.class); // reset call depth count } } diff --git a/dd-java-agent/instrumentation/twilio-0.0.1/src/main/java/datadog/trace/instrumentation/twilio/TwilioClientDecorator.java b/dd-java-agent/instrumentation/twilio-0.0.1/src/main/java/datadog/trace/instrumentation/twilio/TwilioClientDecorator.java index 48e89083c3b..b3865cbf1b5 100644 --- a/dd-java-agent/instrumentation/twilio-0.0.1/src/main/java/datadog/trace/instrumentation/twilio/TwilioClientDecorator.java +++ b/dd-java-agent/instrumentation/twilio-0.0.1/src/main/java/datadog/trace/instrumentation/twilio/TwilioClientDecorator.java @@ -64,14 +64,13 @@ protected String service() { } /** Decorate trace based on service execution metadata. */ - public AgentSpan onServiceExecution( + public void onServiceExecution( final AgentSpan span, final Object serviceExecutor, final String methodName) { span.setResourceName(NAMES.getQualifiedName(serviceExecutor.getClass(), methodName)); - return span; } /** Annotate the span with the results of the operation. */ - public AgentSpan onResult(final AgentSpan span, Object result) { + public void onResult(final AgentSpan span, Object result) { // Unwrap ListenableFuture (if present) if (result instanceof ListenableFuture) { @@ -84,7 +83,7 @@ public AgentSpan onResult(final AgentSpan span, Object result) { // Nothing to do here, so return if (result == null) { - return span; + return; } // Provide helpful metadata for some of the more common response types @@ -114,8 +113,6 @@ public AgentSpan onResult(final AgentSpan span, Object result) { setTagIfPresent(span, result, "twilio.account", "getAccountSid"); setTagIfPresent(span, result, "twilio.status", "getStatus"); } - - return span; } /** diff --git a/dd-java-agent/instrumentation/unbescape-1.1/gradle.lockfile b/dd-java-agent/instrumentation/unbescape-1.1/gradle.lockfile index 8240dc8b5d9..f44022a1c33 100644 --- a/dd-java-agent/instrumentation/unbescape-1.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/unbescape-1.1/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:unbescape-1.1:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,csiCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,csiCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/undertow/undertow-2.0/gradle.lockfile b/dd-java-agent/instrumentation/undertow/undertow-2.0/gradle.lockfile index 8b3c72fc992..f52756495d9 100644 --- a/dd-java-agent/instrumentation/undertow/undertow-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/undertow/undertow-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:undertow:undertow-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,7 +51,7 @@ commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForked commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.undertow:undertow-core:2.0.0.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.undertow:undertow-core:2.2.39.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.undertow:undertow-servlet:2.0.0.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath @@ -57,8 +61,8 @@ io.undertow:undertow-websockets-jsr:2.2.39.Final=latestDepForkedTestCompileClass javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -100,6 +104,7 @@ org.jboss.xnio:xnio-nio:3.3.8.Final=testRuntimeClasspath org.jboss.xnio:xnio-nio:3.8.16.Final=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -117,14 +122,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/ExchangeEndSpanListener.java b/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/ExchangeEndSpanListener.java index e45de60d5c7..41bca412c5c 100644 --- a/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/ExchangeEndSpanListener.java +++ b/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/ExchangeEndSpanListener.java @@ -5,7 +5,7 @@ import static datadog.trace.instrumentation.undertow.UndertowDecorator.DECORATE; import datadog.context.Context; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextContinuation; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import io.undertow.server.DefaultResponseListener; import io.undertow.server.ExchangeCompletionListener; @@ -18,7 +18,7 @@ private ExchangeEndSpanListener() {} @Override public void exchangeEvent(HttpServerExchange exchange, NextListener nextListener) { - AgentScope.Continuation continuation = exchange.getAttachment(DATADOG_UNDERTOW_CONTINUATION); + ContextContinuation continuation = exchange.getAttachment(DATADOG_UNDERTOW_CONTINUATION); if (continuation == null) { return; } @@ -37,7 +37,7 @@ public void exchangeEvent(HttpServerExchange exchange, NextListener nextListener DECORATE.beforeFinish(context); } - continuation.cancel(); + continuation.release(); nextListener.proceed(); } } diff --git a/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/FormDataContentHelper.java b/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/FormDataContentHelper.java new file mode 100644 index 00000000000..9901a9b67b9 --- /dev/null +++ b/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/FormDataContentHelper.java @@ -0,0 +1,99 @@ +package datadog.trace.instrumentation.undertow; + +import datadog.trace.api.Config; +import datadog.trace.api.http.MultipartContentDecoder; +import datadog.trace.api.internal.VisibleForTesting; +import io.undertow.server.handlers.form.FormData; +import io.undertow.util.HeaderMap; +import io.undertow.util.Headers; +import java.io.InputStream; +import java.lang.reflect.Method; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public final class FormDataContentHelper { + + private static final Logger log = LoggerFactory.getLogger(FormDataContentHelper.class); + + public static final int MAX_CONTENT_BYTES = Config.get().getAppSecMaxFileContentBytes(); + public static final int MAX_FILES_TO_INSPECT = Config.get().getAppSecMaxFileContentCount(); + + // Undertow 2.2+ added getFileItem() to FormValue for in-memory uploads. + // In 2.0 all uploads are always on disk so getPath() suffices. + private static final Method GET_FILE_ITEM; + private static final Method FILE_ITEM_GET_INPUT_STREAM; + + static { + Method gfi = null; + Method gis = null; + try { + gfi = FormData.FormValue.class.getMethod("getFileItem"); + gis = gfi.getReturnType().getMethod("getInputStream"); + } catch (Exception ignored) { + } + GET_FILE_ITEM = gfi; + FILE_ITEM_GET_INPUT_STREAM = gis; + } + + public static List collectContents(FormData attachment) { + List result = new ArrayList<>(MAX_FILES_TO_INSPECT); + for (String key : attachment) { + for (FormData.FormValue formValue : attachment.get(key)) { + if (result.size() >= MAX_FILES_TO_INSPECT) { + return result; + } + try { + // null means no filename attribute → form field → skip + if (formValue.getFileName() == null) { + continue; + } + result.add(readContent(formValue)); + } catch (Exception e) { + log.debug("Failed to process form value", e); + } + } + } + return result; + } + + @VisibleForTesting + static String readContent(FormData.FormValue formValue) { + String contentType = null; + HeaderMap headers = formValue.getHeaders(); + if (headers != null) { + contentType = headers.getFirst(Headers.CONTENT_TYPE); + } + + // Try getPath() first: works for 2.0 (all files on disk) and 2.2+ disk files. + try { + Path path = formValue.getPath(); + try (InputStream is = Files.newInputStream(path)) { + return MultipartContentDecoder.readInputStream(is, MAX_CONTENT_BYTES, contentType); + } + } catch (Exception ignored) { + // In Undertow 2.2+, in-memory uploads throw here (no path). + } + + // Fallback for Undertow 2.2+ in-memory uploads via cached reflection. + if (GET_FILE_ITEM != null && FILE_ITEM_GET_INPUT_STREAM != null) { + try { + Object fileItem = GET_FILE_ITEM.invoke(formValue); + if (fileItem != null) { + try (InputStream is = (InputStream) FILE_ITEM_GET_INPUT_STREAM.invoke(fileItem)) { + return MultipartContentDecoder.readInputStream(is, MAX_CONTENT_BYTES, contentType); + } + } + } catch (Exception e) { + log.debug("Failed to read in-memory upload via reflection", e); + } + } + + return ""; + } + + private FormDataContentHelper() {} +} diff --git a/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/FormDataParserInstrumentation.java b/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/FormDataParserInstrumentation.java index d3b94d003a5..8f34ab5e9f9 100644 --- a/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/FormDataParserInstrumentation.java +++ b/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/FormDataParserInstrumentation.java @@ -65,7 +65,7 @@ public void methodAdvice(MethodTransformer transformer) { @RequiresRequestContext(RequestContextSlot.APPSEC) public static class DoParseAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.FieldValue("exchange") HttpServerExchange exchange, @ActiveRequestContext RequestContext reqCtx, diff --git a/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/HandlerInstrumentation.java b/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/HandlerInstrumentation.java index cc5ed26ba9f..274bd7fffdb 100644 --- a/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/HandlerInstrumentation.java +++ b/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/HandlerInstrumentation.java @@ -3,7 +3,7 @@ import static datadog.trace.agent.tooling.InstrumenterModule.TargetSystem.CONTEXT_TRACKING; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.captureSpan; -import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.getRootContext; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.rootContext; import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.undertow.UndertowBlockingHandler.REQUEST_BLOCKING_DATA; import static datadog.trace.instrumentation.undertow.UndertowBlockingHandler.TRACE_SEGMENT; @@ -18,12 +18,12 @@ import com.google.auto.service.AutoService; import datadog.context.Context; +import datadog.context.ContextContinuation; import datadog.context.ContextScope; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.agent.tooling.annotation.AppliesOn; import datadog.trace.api.gateway.Flow.Action.RequestBlockingAction; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; import io.undertow.server.HttpHandler; @@ -86,7 +86,7 @@ public static void extractParent( parentScope = parentContext.attach(); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void closeParentScope(@Advice.Local("parentScope") ContextScope parentScope) { if (parentScope != null) parentScope.close(); } @@ -112,15 +112,15 @@ public static void onEnter( } } - AgentScope.Continuation continuation = exchange.getAttachment(DATADOG_UNDERTOW_CONTINUATION); + ContextContinuation continuation = exchange.getAttachment(DATADOG_UNDERTOW_CONTINUATION); if (continuation != null) { // not yet complete, not ready to do final activation of continuation - scope = continuation.span().attach(); + scope = continuation.context().attach(); return; } Context parentContext = exchange.getAttachment(PARENT_CONTEXT_KEY); - if (parentContext == null) parentContext = getRootContext(); + if (parentContext == null) parentContext = rootContext(); final Context context = DECORATE.startSpan(exchange, parentContext); scope = context.attach(); final AgentSpan span = spanFromContext(context); diff --git a/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/HttpRequestParserInstrumentation.java b/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/HttpRequestParserInstrumentation.java index 119cbf2538a..2cb89cdc44b 100644 --- a/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/HttpRequestParserInstrumentation.java +++ b/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/HttpRequestParserInstrumentation.java @@ -60,7 +60,7 @@ public void methodAdvice(MethodTransformer transformer) { } public static class RequestParseFailureAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void afterRequestParse( @Advice.Argument(2) final HttpServerExchange exchange, @Advice.Thrown final Throwable throwable) { @@ -90,12 +90,12 @@ public static void afterRequestParse( } } finally { if (span != null) { - span.finish(); if (scope != null) { scope.close(); } else { // span was already active, scope will be closed by HandlerInstrumentation } + span.finish(); } } } diff --git a/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/HttpServerExchangeSenderInstrumentation.java b/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/HttpServerExchangeSenderInstrumentation.java index 7fbaf819a02..075849e79db 100644 --- a/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/HttpServerExchangeSenderInstrumentation.java +++ b/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/HttpServerExchangeSenderInstrumentation.java @@ -1,6 +1,7 @@ package datadog.trace.instrumentation.undertow; import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.instrumentation.undertow.UndertowDecorator.DATADOG_UNDERTOW_CONTINUATION; import static net.bytebuddy.matcher.ElementMatchers.isPrivate; import static net.bytebuddy.matcher.ElementMatchers.not; @@ -8,10 +9,10 @@ import com.google.auto.service.AutoService; import datadog.appsec.api.blocking.BlockingException; +import datadog.context.ContextContinuation; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; import datadog.trace.api.gateway.Flow; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import io.undertow.server.HttpServerExchange; import net.bytebuddy.asm.Advice; @@ -62,7 +63,7 @@ static class GetResponseChannelAdvice { return false; } - AgentScope.Continuation continuation = xchg.getAttachment(DATADOG_UNDERTOW_CONTINUATION); + ContextContinuation continuation = xchg.getAttachment(DATADOG_UNDERTOW_CONTINUATION); if (continuation == null) { return false; } @@ -71,7 +72,7 @@ static class GetResponseChannelAdvice { } xchg.putAttachment(IgnoreSendAttribute.IGNORE_SEND_KEY, IgnoreSendAttribute.INSTANCE); - AgentSpan span = continuation.span(); + AgentSpan span = spanFromContext(continuation.context()); Flow flow = UndertowDecorator.DECORATE.callIGCallbackResponseAndHeaders( span, xchg, xchg.getStatusCode(), UndertowExtractAdapter.Response.GETTER); @@ -89,7 +90,7 @@ static class GetResponseChannelAdvice { return true; } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Enter boolean skip, @Advice.Thrown(readOnly = false) Throwable thrown) { if (!skip) { diff --git a/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/MultiPartUploadHandlerInstrumentation.java b/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/MultiPartUploadHandlerInstrumentation.java index 52bd0b73897..3f0313464d3 100644 --- a/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/MultiPartUploadHandlerInstrumentation.java +++ b/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/MultiPartUploadHandlerInstrumentation.java @@ -53,7 +53,7 @@ public Reference[] additionalMuzzleReferences() { @Override public String[] helperClassNames() { - return new String[] {packageName + ".FormDataMap"}; + return new String[] {packageName + ".FormDataMap", packageName + ".FormDataContentHelper"}; } public void methodAdvice(MethodTransformer transformer) { @@ -72,7 +72,7 @@ static boolean onEnter(@Advice.FieldValue("exchange") HttpServerExchange exchang return exchange.getAttachment(FORM_DATA) == null; } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Enter boolean relevant, @Advice.FieldValue("exchange") HttpServerExchange exchange, @@ -87,7 +87,9 @@ static void after( cbp.getCallback(EVENTS.requestBodyProcessed()); BiFunction, Flow> filenamesCb = cbp.getCallback(EVENTS.requestFilesFilenames()); - if (bodyCallback == null && filenamesCb == null) { + BiFunction, Flow> contentCb = + cbp.getCallback(EVENTS.requestFilesContent()); + if (bodyCallback == null && filenamesCb == null && contentCb == null) { return; } FormData attachment = exchange.getAttachment(FORM_DATA); @@ -139,6 +141,25 @@ static void after( } } } + + if (contentCb != null && t == null) { + List filesContent = FormDataContentHelper.collectContents(attachment); + if (!filesContent.isEmpty()) { + Flow contentFlow = contentCb.apply(reqCtx, filesContent); + Flow.Action contentAction = contentFlow.getAction(); + if (contentAction instanceof Flow.Action.RequestBlockingAction) { + Flow.Action.RequestBlockingAction rba = + (Flow.Action.RequestBlockingAction) contentAction; + BlockResponseFunction brf = reqCtx.getBlockResponseFunction(); + if (brf != null && t == null) { + boolean success = brf.tryCommitBlockingResponse(reqCtx.getTraceSegment(), rba); + if (success) { + t = new BlockingException("Blocked request (multipart file upload content)"); + } + } + } + } + } } } } diff --git a/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/ServletInstrumentation.java b/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/ServletInstrumentation.java index c33fd9d4244..6e9877d6347 100644 --- a/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/ServletInstrumentation.java +++ b/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/ServletInstrumentation.java @@ -3,6 +3,7 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.InstrumentationTags.SERVLET_CONTEXT; import static datadog.trace.bootstrap.instrumentation.api.InstrumentationTags.SERVLET_PATH; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; import static datadog.trace.bootstrap.instrumentation.decorator.http.HttpResourceDecorator.HTTP_RESOURCE_DECORATOR; import static datadog.trace.instrumentation.undertow.UndertowDecorator.DATADOG_UNDERTOW_CONTINUATION; @@ -10,9 +11,9 @@ import static net.bytebuddy.matcher.ElementMatchers.isMethod; import com.google.auto.service.AutoService; +import datadog.context.ContextContinuation; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import io.undertow.server.HttpServerExchange; import io.undertow.servlet.handlers.ServletPathMatch; @@ -64,9 +65,9 @@ public static class DispatchAdvice { public static void enter( @Advice.Argument(0) final HttpServerExchange exchange, @Advice.Argument(1) final ServletRequestContext servletRequestContext) { - AgentScope.Continuation continuation = exchange.getAttachment(DATADOG_UNDERTOW_CONTINUATION); + ContextContinuation continuation = exchange.getAttachment(DATADOG_UNDERTOW_CONTINUATION); if (continuation != null) { - AgentSpan undertowSpan = continuation.span(); + AgentSpan undertowSpan = spanFromContext(continuation.context()); ServletRequest request = servletRequestContext.getServletRequest(); request.setAttribute(DD_CONTEXT_ATTRIBUTE, continuation.context()); undertowSpan.setSpanName(SERVLET_REQUEST); diff --git a/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/UndertowRunnableWrapper.java b/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/UndertowRunnableWrapper.java index 0b27f27fe2d..e68b7a6e9a1 100644 --- a/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/UndertowRunnableWrapper.java +++ b/dd-java-agent/instrumentation/undertow/undertow-2.0/src/main/java/datadog/trace/instrumentation/undertow/UndertowRunnableWrapper.java @@ -1,21 +1,22 @@ package datadog.trace.instrumentation.undertow; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.captureActiveSpan; -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopContinuation; import static datadog.trace.bootstrap.instrumentation.java.concurrent.ExcludeFilter.ExcludeType.RUNNABLE; import static datadog.trace.bootstrap.instrumentation.java.concurrent.ExcludeFilter.exclude; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.Context; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; import io.undertow.server.HttpServerExchange; public class UndertowRunnableWrapper implements Runnable { private Runnable runnable; private HttpServerExchange exchange; - private AgentScope.Continuation continuation; + private ContextContinuation continuation; public UndertowRunnableWrapper( - Runnable runnable, HttpServerExchange exchange, AgentScope.Continuation continuation) { + Runnable runnable, HttpServerExchange exchange, ContextContinuation continuation) { this.runnable = runnable; this.exchange = exchange; this.continuation = continuation; @@ -23,7 +24,7 @@ public UndertowRunnableWrapper( @Override public void run() { - try (AgentScope scope = continuation.activate()) { + try (ContextScope scope = continuation.resume()) { runnable.run(); } } @@ -32,8 +33,8 @@ public static Runnable wrapIfNeeded(final Runnable task, HttpServerExchange exch if (task instanceof UndertowRunnableWrapper || exclude(RUNNABLE, task)) { return task; } - AgentScope.Continuation continuation = captureActiveSpan(); - if (continuation != noopContinuation()) { + ContextContinuation continuation = captureActiveSpan(); + if (continuation.context() != Context.root()) { return new UndertowRunnableWrapper(task, exchange, continuation); } return task; // don't wrap unless there is a span to propagate diff --git a/dd-java-agent/instrumentation/undertow/undertow-2.0/src/test/groovy/UndertowServletTest.groovy b/dd-java-agent/instrumentation/undertow/undertow-2.0/src/test/groovy/UndertowServletTest.groovy index 6fc47cd0e15..846389417ba 100644 --- a/dd-java-agent/instrumentation/undertow/undertow-2.0/src/test/groovy/UndertowServletTest.groovy +++ b/dd-java-agent/instrumentation/undertow/undertow-2.0/src/test/groovy/UndertowServletTest.groovy @@ -47,7 +47,7 @@ abstract class UndertowServletTest extends HttpServerTest { final ServletContainer container = ServletContainer.Factory.newInstance() DeploymentInfo builder = new DeploymentInfo() - .setDefaultMultipartConfig(new MultipartConfigElement(System.getProperty('java.io.tmpdir'), 1024, 1024, 1024)) + .setDefaultMultipartConfig(new MultipartConfigElement(System.getProperty('java.io.tmpdir'), -1, -1, 1024)) .setClassLoader(UndertowServletTest.getClassLoader()) .setContextPath("/$CONTEXT") .setDeploymentName("servletContext.war") @@ -201,6 +201,11 @@ abstract class UndertowServletTest extends HttpServerTest { true } + @Override + boolean testBodyFilesContent() { + true + } + @Override boolean testBlockingOnResponse() { true diff --git a/dd-java-agent/instrumentation/undertow/undertow-2.0/src/test/java/datadog/trace/instrumentation/undertow/FormDataContentHelperTest.java b/dd-java-agent/instrumentation/undertow/undertow-2.0/src/test/java/datadog/trace/instrumentation/undertow/FormDataContentHelperTest.java new file mode 100644 index 00000000000..5f5ef6b1499 --- /dev/null +++ b/dd-java-agent/instrumentation/undertow/undertow-2.0/src/test/java/datadog/trace/instrumentation/undertow/FormDataContentHelperTest.java @@ -0,0 +1,162 @@ +package datadog.trace.instrumentation.undertow; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import io.undertow.server.handlers.form.FormData; +import io.undertow.util.HeaderMap; +import java.io.IOException; +import java.lang.reflect.Field; +import java.lang.reflect.Proxy; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayDeque; +import java.util.Arrays; +import java.util.Deque; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; + +class FormDataContentHelperTest { + + @TempDir Path tempDir; + + @Test + void diskFile_contentRead() throws IOException { + byte[] content = "file content".getBytes(StandardCharsets.ISO_8859_1); + Path file = Files.createTempFile(tempDir, "upload", ".bin"); + Files.write(file, content); + + FormData fd = new FormData(10); + fd.add("upload", file, "test.bin", new HeaderMap()); + + List result = FormDataContentHelper.collectContents(fd); + assertEquals(1, result.size()); + assertEquals("file content", result.get(0)); + } + + @Test + void formField_skipped() throws IOException { + FormData fd = new FormData(10); + fd.add("name", "John"); + + List result = FormDataContentHelper.collectContents(fd); + assertTrue(result.isEmpty()); + } + + @Test + void emptyFilename_contentRead() throws Exception { + // filename="" means a file upload with no filename attribute — content still inspected + byte[] content = "data".getBytes(StandardCharsets.ISO_8859_1); + Path file = Files.createTempFile(tempDir, "upload", ".bin"); + Files.write(file, content); + + FormData fd = new FormData(10); + fd.add("upload", file, "", new HeaderMap()); + + List result = FormDataContentHelper.collectContents(fd); + assertEquals(1, result.size()); + assertEquals("data", result.get(0)); + } + + @Test + void truncation_atMaxContentBytes() throws IOException { + byte[] content = new byte[FormDataContentHelper.MAX_CONTENT_BYTES + 500]; + Arrays.fill(content, (byte) 'X'); + Path file = Files.createTempFile(tempDir, "upload", ".bin"); + Files.write(file, content); + + FormData fd = new FormData(10); + fd.add("upload", file, "big.bin", new HeaderMap()); + + List result = FormDataContentHelper.collectContents(fd); + assertEquals(1, result.size()); + assertEquals(FormDataContentHelper.MAX_CONTENT_BYTES, result.get(0).length()); + } + + @Test + void maxFilesLimit_enforced() throws IOException { + FormData fd = new FormData(100); + int limit = FormDataContentHelper.MAX_FILES_TO_INSPECT; + for (int i = 0; i < limit + 1; i++) { + Path file = Files.createTempFile(tempDir, "f" + i, ".bin"); + Files.write(file, ("content_" + i).getBytes(StandardCharsets.ISO_8859_1)); + fd.add("file" + i, file, "f" + i + ".bin", new HeaderMap()); + } + + List result = FormDataContentHelper.collectContents(fd); + assertEquals(limit, result.size()); + } + + @Test + void mixedFieldsAndFiles() throws IOException { + Path file = Files.createTempFile(tempDir, "upload", ".bin"); + Files.write(file, "file content".getBytes(StandardCharsets.ISO_8859_1)); + + FormData fd = new FormData(10); + fd.add("name", "John"); + fd.add("upload", file, "test.bin", new HeaderMap()); + + List result = FormDataContentHelper.collectContents(fd); + assertEquals(1, result.size()); + assertEquals("file content", result.get(0)); + } + + @Test + void inMemoryFile_contentRead_viaProxy() throws Exception { + // Simulate an in-memory file upload (Undertow 2.2+) using a Proxy. + // getPath() throws IllegalStateException for in-memory uploads; the helper + // falls back to getFileItem().getInputStream() via reflection. + byte[] content = "in-memory content".getBytes(StandardCharsets.ISO_8859_1); + + FormData fd = new FormData(10); + addInMemoryFileValue(fd, "upload", "mem.bin", content); + + // The reflection fallback won't work in a test environment where FileItem + // isn't actually loaded, so we just verify the helper doesn't throw and + // returns either the content (if reflection works) or "" (graceful fallback). + List result = FormDataContentHelper.collectContents(fd); + assertEquals(1, result.size()); + // Either the reflection path worked or the graceful fallback returned "" + assertTrue(result.get(0).equals("in-memory content") || result.get(0).isEmpty()); + } + + @SuppressWarnings("unchecked") + private static void addInMemoryFileValue( + FormData fd, String name, String filename, byte[] content) throws Exception { + Field valuesField = FormData.class.getDeclaredField("values"); + valuesField.setAccessible(true); + Map> values = + (Map>) valuesField.get(fd); + + // Use a Proxy so this compiles against Undertow 2.0 and also works against 2.2.x. + // getPath() throws to simulate an in-memory upload. + FormData.FormValue inMemory = + (FormData.FormValue) + Proxy.newProxyInstance( + FormData.FormValue.class.getClassLoader(), + new Class[] {FormData.FormValue.class}, + (proxy, method, args) -> { + switch (method.getName()) { + case "getFileName": + return filename; + case "getHeaders": + return new HeaderMap(); + case "getPath": + throw new IllegalStateException("in-memory upload has no path"); + case "isFile": + case "isFileItem": + case "isBigField": + return false; + default: + return null; + } + }); + + Deque deque = new ArrayDeque<>(); + deque.add(inMemory); + values.put(name, deque); + } +} diff --git a/dd-java-agent/instrumentation/undertow/undertow-2.2/gradle.lockfile b/dd-java-agent/instrumentation/undertow/undertow-2.2/gradle.lockfile index 80b45c29c87..b7b3332e609 100644 --- a/dd-java-agent/instrumentation/undertow/undertow-2.2/gradle.lockfile +++ b/dd-java-agent/instrumentation/undertow/undertow-2.2/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:undertow:undertow-2.2:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latest22ForkedTestCompileClasspath,latest22Fo com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latest22ForkedTestAnnotationProcessor,latest22ForkedTestCompileClasspath,latest22TestAnnotationProcessor,latest22TestCompileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latest22ForkedTestAnnotationProcessor,latest22TestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latest22ForkedTestAnnotationProcessor,latest22TestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latest22ForkedTestAnnotationProcessor,latest22TestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latest22ForkedTestAnnotationProcessor,latest22TestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latest22ForkedTestAnnotationProcessor,latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestAnnotationProcessor,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latest22ForkedTestAnnotationProcessor,latest22TestAnnotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -55,7 +59,7 @@ io.smallrye.common:smallrye-common-function:2.6.0=latestDepForkedTestCompileClas io.smallrye.common:smallrye-common-net:2.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.smallrye.common:smallrye-common-os:2.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath io.smallrye.common:smallrye-common-ref:2.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.undertow:undertow-core:2.2.14.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.undertow:undertow-core:2.2.20.Final=latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath io.undertow:undertow-core:2.3.24.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -75,8 +79,8 @@ jakarta.websocket:jakarta.websocket-client-api:2.1.0=latestDepForkedTestCompileC javax.servlet:javax.servlet-api:3.1.0=latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -115,6 +119,7 @@ org.jboss.xnio:xnio-nio:3.8.4.Final=testRuntimeClasspath org.jboss.xnio:xnio-nio:3.8.7.Final=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -132,14 +137,14 @@ org.objenesis:objenesis:3.3=latest22ForkedTestCompileClasspath,latest22ForkedTes org.opentest4j:opentest4j:1.3.0=latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latest22ForkedTestRuntimeClasspath,latest22TestRuntimeClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latest22ForkedTestCompileClasspath,latest22ForkedTestRuntimeClasspath,latest22TestCompileClasspath,latest22TestRuntimeClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/undertow/undertow-2.2/src/main/java/datadog/trace/instrumentation/undertow/JakartaServletInstrumentation.java b/dd-java-agent/instrumentation/undertow/undertow-2.2/src/main/java/datadog/trace/instrumentation/undertow/JakartaServletInstrumentation.java index dd20449a1de..e429c961a11 100644 --- a/dd-java-agent/instrumentation/undertow/undertow-2.2/src/main/java/datadog/trace/instrumentation/undertow/JakartaServletInstrumentation.java +++ b/dd-java-agent/instrumentation/undertow/undertow-2.2/src/main/java/datadog/trace/instrumentation/undertow/JakartaServletInstrumentation.java @@ -3,15 +3,16 @@ import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static datadog.trace.bootstrap.instrumentation.api.InstrumentationTags.SERVLET_CONTEXT; import static datadog.trace.bootstrap.instrumentation.api.InstrumentationTags.SERVLET_PATH; +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.spanFromContext; import static datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator.DD_CONTEXT_ATTRIBUTE; import static datadog.trace.instrumentation.undertow.UndertowDecorator.DATADOG_UNDERTOW_CONTINUATION; import static datadog.trace.instrumentation.undertow.UndertowDecorator.SERVLET_REQUEST; import static net.bytebuddy.matcher.ElementMatchers.isMethod; import com.google.auto.service.AutoService; +import datadog.context.ContextContinuation; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import io.undertow.server.HttpServerExchange; import io.undertow.servlet.handlers.ServletRequestContext; @@ -56,9 +57,9 @@ public static class DispatchAdvice { public static void enter( @Advice.Argument(0) final HttpServerExchange exchange, @Advice.Argument(1) final ServletRequestContext servletRequestContext) { - AgentScope.Continuation continuation = exchange.getAttachment(DATADOG_UNDERTOW_CONTINUATION); + ContextContinuation continuation = exchange.getAttachment(DATADOG_UNDERTOW_CONTINUATION); if (continuation != null) { - AgentSpan undertowSpan = continuation.span(); + AgentSpan undertowSpan = spanFromContext(continuation.context()); ServletRequest request = servletRequestContext.getServletRequest(); request.setAttribute(DD_CONTEXT_ATTRIBUTE, continuation.context()); undertowSpan.setSpanName(SERVLET_REQUEST); diff --git a/dd-java-agent/instrumentation/undertow/undertow-2.2/src/test/groovy/UndertowServletTest.groovy b/dd-java-agent/instrumentation/undertow/undertow-2.2/src/test/groovy/UndertowServletTest.groovy index c7a1924eb12..4287b8a8ebe 100644 --- a/dd-java-agent/instrumentation/undertow/undertow-2.2/src/test/groovy/UndertowServletTest.groovy +++ b/dd-java-agent/instrumentation/undertow/undertow-2.2/src/test/groovy/UndertowServletTest.groovy @@ -40,7 +40,7 @@ class UndertowServletTest extends HttpServerTest { final ServletContainer container = ServletContainer.Factory.newInstance() DeploymentInfo builder = new DeploymentInfo() - .setDefaultMultipartConfig(new MultipartConfigElement(System.getProperty('java.io.tmpdir'), 1024, 1024, 1024)) + .setDefaultMultipartConfig(new MultipartConfigElement(System.getProperty('java.io.tmpdir'), -1, -1, 1024)) .setClassLoader(UndertowServletTest.getClassLoader()) .setContextPath("/$CONTEXT") .setDeploymentName("servletContext.war") @@ -198,6 +198,11 @@ class UndertowServletTest extends HttpServerTest { true } + @Override + boolean testBodyFilesContent() { + true + } + boolean hasResponseSpan(ServerEndpoint endpoint) { // FIXME: re-enable when jakarta servlet will be fully supported // return endpoint == REDIRECT || endpoint == NOT_FOUND diff --git a/dd-java-agent/instrumentation/undertow/undertow-common/gradle.lockfile b/dd-java-agent/instrumentation/undertow/undertow-common/gradle.lockfile index 30219390970..b651f84f2e8 100644 --- a/dd-java-agent/instrumentation/undertow/undertow-common/gradle.lockfile +++ b/dd-java-agent/instrumentation/undertow/undertow-common/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:undertow:undertow-common:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,13 +51,13 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath io.undertow:undertow-core:2.0.0.Final=compileClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -84,6 +88,7 @@ org.jboss.logging:jboss-logging:3.3.0.Final=compileClasspath org.jboss.xnio:xnio-api:3.3.8.Final=compileClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -101,14 +106,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/undertow/undertow-common/src/main/java/datadog/trace/instrumentation/undertow/UndertowBlockingHandler.java b/dd-java-agent/instrumentation/undertow/undertow-common/src/main/java/datadog/trace/instrumentation/undertow/UndertowBlockingHandler.java index d8be722a514..0a2a7c2ed5d 100644 --- a/dd-java-agent/instrumentation/undertow/undertow-common/src/main/java/datadog/trace/instrumentation/undertow/UndertowBlockingHandler.java +++ b/dd-java-agent/instrumentation/undertow/undertow-common/src/main/java/datadog/trace/instrumentation/undertow/UndertowBlockingHandler.java @@ -3,10 +3,11 @@ import static datadog.trace.instrumentation.undertow.UndertowDecorator.DATADOG_UNDERTOW_CONTINUATION; import datadog.appsec.api.blocking.BlockingContentType; +import datadog.context.ContextContinuation; import datadog.trace.api.gateway.Flow; import datadog.trace.api.internal.TraceSegment; import datadog.trace.bootstrap.blocking.BlockingActionHelper; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import io.undertow.server.HttpHandler; import io.undertow.server.HttpServerExchange; import io.undertow.util.AttachmentKey; @@ -117,9 +118,12 @@ private static void commitBlockingResponse( } private static void markAsEffectivelyBlocked(HttpServerExchange xchg) { - AgentScope.Continuation continuation = xchg.getAttachment(DATADOG_UNDERTOW_CONTINUATION); + ContextContinuation continuation = xchg.getAttachment(DATADOG_UNDERTOW_CONTINUATION); if (continuation != null) { - continuation.span().getRequestContext().getTraceSegment().effectivelyBlocked(); + AgentSpan.fromContext(continuation.context()) + .getRequestContext() + .getTraceSegment() + .effectivelyBlocked(); } } } diff --git a/dd-java-agent/instrumentation/undertow/undertow-common/src/main/java/datadog/trace/instrumentation/undertow/UndertowDecorator.java b/dd-java-agent/instrumentation/undertow/undertow-common/src/main/java/datadog/trace/instrumentation/undertow/UndertowDecorator.java index 6e42f2431bf..c34602884bd 100644 --- a/dd-java-agent/instrumentation/undertow/undertow-common/src/main/java/datadog/trace/instrumentation/undertow/UndertowDecorator.java +++ b/dd-java-agent/instrumentation/undertow/undertow-common/src/main/java/datadog/trace/instrumentation/undertow/UndertowDecorator.java @@ -1,12 +1,12 @@ package datadog.trace.instrumentation.undertow; import datadog.context.Context; +import datadog.context.ContextContinuation; import datadog.trace.api.Config; import datadog.trace.api.gateway.BlockResponseFunction; import datadog.trace.api.naming.SpanNaming; import datadog.trace.bootstrap.InstanceStore; import datadog.trace.bootstrap.instrumentation.api.AgentPropagation; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.URIDataAdapter; import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; import datadog.trace.bootstrap.instrumentation.decorator.HttpServerDecorator; @@ -27,9 +27,9 @@ public class UndertowDecorator InstanceStore.of(AttachmentKey.class); @SuppressWarnings("unchecked") - public static final AttachmentKey DATADOG_UNDERTOW_CONTINUATION = + public static final AttachmentKey DATADOG_UNDERTOW_CONTINUATION = attachmentStore.putIfAbsent( - "DD_UNDERTOW_CONTINUATION", () -> AttachmentKey.create(AgentScope.Continuation.class)); + "DD_UNDERTOW_CONTINUATION", () -> AttachmentKey.create(ContextContinuation.class)); @SuppressWarnings("unchecked") public static final AttachmentKey PARENT_CONTEXT_KEY = diff --git a/dd-java-agent/instrumentation/valkey-java-5.3/gradle.lockfile b/dd-java-agent/instrumentation/valkey-java-5.3/gradle.lockfile index c3f66bfddc1..e0f25785246 100644 --- a/dd-java-agent/instrumentation/valkey-java-5.3/gradle.lockfile +++ b/dd-java-agent/instrumentation/valkey-java-5.3/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:valkey-java-5.3:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,21 +9,21 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.codemonstur:embedded-redis:1.4.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -33,12 +34,15 @@ com.google.code.gson:gson:2.10.1=compileClasspath,latestDepTestCompileClasspath, com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -49,14 +53,14 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath io.valkey:valkey-java:5.3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath io.valkey:valkey-java:5.5.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -87,6 +91,7 @@ org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClas org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.json:json:20240303=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -104,14 +109,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/velocity-1.5/gradle.lockfile b/dd-java-agent/instrumentation/velocity-1.5/gradle.lockfile index 3c0d4112a26..7eb63284058 100644 --- a/dd-java-agent/instrumentation/velocity-1.5/gradle.lockfile +++ b/dd-java-agent/instrumentation/velocity-1.5/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:velocity-1.5:dependencies --write-locks antlr:antlr:2.7.2=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath avalon-framework:avalon-framework:4.1.3=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -10,20 +11,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,csiCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,csiCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -33,12 +34,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,csiCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -60,15 +64,15 @@ commons-validator:commons-validator:1.3.1=compileClasspath,csiCompileClasspath,l de.thetaphi:forbiddenapis:3.10=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath dom4j:dom4j:1.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:servlet-api:2.3=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath log4j:log4j:1.2.12=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath logkit:logkit:1.0.1=compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -104,6 +108,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -121,14 +126,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,csiCompileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/vertx/vertx-mysql-client/vertx-mysql-client-3.9/gradle.lockfile b/dd-java-agent/instrumentation/vertx/vertx-mysql-client/vertx-mysql-client-3.9/gradle.lockfile index b8d68f01665..34f6c8cb0c3 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-mysql-client/vertx-mysql-client-3.9/gradle.lockfile +++ b/dd-java-agent/instrumentation/vertx/vertx-mysql-client/vertx-mysql-client-3.9/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:vertx:vertx-mysql-client:vertx-mysql-client-3.9:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -24,15 +25,15 @@ com.github.docker-java:docker-java-api:3.4.2=latestDepForkedTestCompileClasspath com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -42,13 +43,16 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.protobuf:protobuf-java:3.11.4=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -84,7 +88,7 @@ io.netty:netty-resolver:4.1.89.Final=latestDepForkedTestCompileClasspath,latestD io.netty:netty-transport-native-unix-common:4.1.89.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.48.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.1.89.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.vertx:vertx-core:3.9.0=compileClasspath,testCompileClasspath,testRuntimeClasspath io.vertx:vertx-core:3.9.16=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-mysql-client:3.9.0=compileClasspath,testCompileClasspath,testRuntimeClasspath @@ -95,8 +99,8 @@ javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latest jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath mysql:mysql-connector-java:8.0.23=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -127,6 +131,7 @@ org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTes org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -144,14 +149,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/vertx/vertx-mysql-client/vertx-mysql-client-4.0/gradle.lockfile b/dd-java-agent/instrumentation/vertx/vertx-mysql-client/vertx-mysql-client-4.0/gradle.lockfile index 36b3c38562e..ad7d3886c98 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-mysql-client/vertx-mysql-client-4.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/vertx/vertx-mysql-client/vertx-mysql-client-4.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:vertx:vertx-mysql-client:vertx-mysql-client-4.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,28 +9,28 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-annotations:2.10.3=testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.18.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-annotations:2.21=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-core:2.11.3=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.18.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.18.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-core:2.21.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson:jackson-bom:2.21.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.docker-java:docker-java-api:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -39,13 +40,16 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.protobuf:protobuf-java:3.11.4=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -56,44 +60,45 @@ commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForked commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.netty:netty-buffer:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-buffer:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-buffer:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-dns:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-dns:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-dns:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-http2:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http2:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http2:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-http:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-socks:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-socks:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-socks:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-common:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-common:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-common:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-handler-proxy:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler-proxy:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-handler-proxy:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-handler:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-handler:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-resolver-dns:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver-dns:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-resolver-dns:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-resolver:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-resolver:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-transport-native-unix-common:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-transport:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-tcnative-classes:2.0.78.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.vertx:vertx-core:4.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-core:4.5.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-core:4.5.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-mysql-client:4.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-mysql-client:4.5.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-mysql-client:4.5.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-sql-client:4.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-sql-client:4.5.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-sql-client:4.5.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath mysql:mysql-connector-java:8.0.23=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -124,6 +129,7 @@ org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTes org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -141,14 +147,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/vertx/vertx-mysql-client/vertx-mysql-client-4.4.2/gradle.lockfile b/dd-java-agent/instrumentation/vertx/vertx-mysql-client/vertx-mysql-client-4.4.2/gradle.lockfile index eb136d6a193..0e16b5b821e 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-mysql-client/vertx-mysql-client-4.4.2/gradle.lockfile +++ b/dd-java-agent/instrumentation/vertx/vertx-mysql-client/vertx-mysql-client-4.4.2/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:vertx:vertx-mysql-client:vertx-mysql-client-4.4.2:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -9,22 +10,22 @@ ch.randelshofer:fastdoubleparser:0.8.0=compileClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-core:2.15.0=compileClasspath com.fasterxml.jackson:jackson-bom:2.15.0=compileClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -34,12 +35,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -63,15 +67,15 @@ io.netty:netty-resolver-dns:4.1.92.Final=compileClasspath io.netty:netty-resolver:4.1.92.Final=compileClasspath io.netty:netty-transport-native-unix-common:4.1.92.Final=compileClasspath io.netty:netty-transport:4.1.92.Final=compileClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.vertx:vertx-core:4.4.2=compileClasspath io.vertx:vertx-mysql-client:4.4.2=compileClasspath io.vertx:vertx-sql-client:4.4.2=compileClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -100,6 +104,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepForkedTestRuntimeClasspath,latestDepTest org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -117,14 +122,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/vertx/vertx-pg-client/vertx-pg-client-4.0/gradle.lockfile b/dd-java-agent/instrumentation/vertx/vertx-pg-client/vertx-pg-client-4.0/gradle.lockfile index d826bb3df22..cff71e77b33 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-pg-client/vertx-pg-client-4.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/vertx/vertx-pg-client/vertx-pg-client-4.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:vertx:vertx-pg-client:vertx-pg-client-4.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,28 +9,28 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-annotations:2.10.3=testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.18.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-annotations:2.21=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-core:2.11.4=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.18.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.18.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-core:2.21.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson:jackson-bom:2.21.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.docker-java:docker-java-api:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -39,12 +40,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.ongres.scram:client:2.1=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath,testCompileClasspath,testRuntimeClasspath com.ongres.scram:common:2.1=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath,testCompileClasspath,testRuntimeClasspath com.ongres.scram:scram-client:3.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -63,43 +67,44 @@ commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForked commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.netty:netty-buffer:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-buffer:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-buffer:4.1.65.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-dns:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-dns:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-dns:4.1.65.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-http2:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http2:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http2:4.1.65.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-http:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http:4.1.65.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-socks:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-socks:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-socks:4.1.65.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec:4.1.65.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-common:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-common:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-common:4.1.65.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-handler-proxy:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler-proxy:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-handler-proxy:4.1.65.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-handler:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-handler:4.1.65.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-resolver-dns:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver-dns:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-resolver-dns:4.1.65.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-resolver:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-resolver:4.1.65.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-transport-native-unix-common:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-transport:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-tcnative-classes:2.0.78.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.65.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.vertx:vertx-core:4.1.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-core:4.5.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-core:4.5.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-pg-client:4.1.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-pg-client:4.5.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-pg-client:4.5.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-sql-client:4.1.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-sql-client:4.5.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-sql-client:4.5.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -131,6 +136,7 @@ org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTes org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -148,14 +154,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.postgresql:postgresql:42.7.4=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/vertx/vertx-pg-client/vertx-pg-client-4.4.2/gradle.lockfile b/dd-java-agent/instrumentation/vertx/vertx-pg-client/vertx-pg-client-4.4.2/gradle.lockfile index e4f32224b81..edbe6dbecf2 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-pg-client/vertx-pg-client-4.4.2/gradle.lockfile +++ b/dd-java-agent/instrumentation/vertx/vertx-pg-client/vertx-pg-client-4.4.2/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:vertx:vertx-pg-client:vertx-pg-client-4.4.2:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -9,22 +10,22 @@ ch.randelshofer:fastdoubleparser:0.8.0=compileClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-core:2.15.0=compileClasspath com.fasterxml.jackson:jackson-bom:2.15.0=compileClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -34,12 +35,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -63,15 +67,15 @@ io.netty:netty-resolver-dns:4.1.92.Final=compileClasspath io.netty:netty-resolver:4.1.92.Final=compileClasspath io.netty:netty-transport-native-unix-common:4.1.92.Final=compileClasspath io.netty:netty-transport:4.1.92.Final=compileClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.vertx:vertx-core:4.4.2=compileClasspath io.vertx:vertx-pg-client:4.4.2=compileClasspath io.vertx:vertx-sql-client:4.4.2=compileClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -100,6 +104,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepForkedTestRuntimeClasspath,latestDepTest org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -117,14 +122,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/gradle.lockfile b/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/gradle.lockfile index fcf9fe15bc0..057b00c1520 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/gradle.lockfile +++ b/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:vertx:vertx-redis-client:vertx-redis-client-3.9:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,36 +9,36 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-annotations:2.10.2=compileClasspath com.fasterxml.jackson.core:jackson-annotations:2.10.3=redis4xForkedTestCompileClasspath,redis4xTestCompileClasspath,testCompileClasspath com.fasterxml.jackson.core:jackson-annotations:2.13.2=redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.18.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-annotations:2.21=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-core:2.10.2=compileClasspath,testCompileClasspath com.fasterxml.jackson.core:jackson-core:2.11.3=redis4xForkedTestCompileClasspath,redis4xTestCompileClasspath com.fasterxml.jackson.core:jackson-core:2.13.2=redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.18.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-core:2.21.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson.core:jackson-databind:2.10.2=compileClasspath,testCompileClasspath com.fasterxml.jackson.core:jackson-databind:2.13.2.1=redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.18.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-databind:2.21.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.13.2.1=redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.18.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson:jackson-bom:2.21.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.docker-java:docker-java-api:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport-zerodep:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,redis4xForkedTestAnnotationProcessor,redis4xForkedTestCompileClasspath,redis4xTestAnnotationProcessor,redis4xTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -47,12 +48,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,redis4xForkedTestAnnotationProcessor,redis4xTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,redis4xForkedTestAnnotationProcessor,redis4xTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,redis4xForkedTestAnnotationProcessor,redis4xTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,redis4xForkedTestAnnotationProcessor,redis4xTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestAnnotationProcessor,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestAnnotationProcessor,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,redis4xForkedTestAnnotationProcessor,redis4xTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath com.redis.testcontainers:testcontainers-redis:1.6.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.redis:redis-enterprise-admin:0.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -66,68 +70,69 @@ commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForked commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath -io.netty:netty-buffer:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-buffer:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-buffer:4.1.48.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-buffer:4.1.49.Final=redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath -io.netty:netty-codec-dns:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-dns:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-dns:4.1.48.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-codec-dns:4.1.49.Final=redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath -io.netty:netty-codec-http2:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http2:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http2:4.1.48.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-codec-http2:4.1.49.Final=redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath -io.netty:netty-codec-http:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http:4.1.48.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-codec-http:4.1.49.Final=redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath -io.netty:netty-codec-socks:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-socks:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-socks:4.1.48.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-codec-socks:4.1.49.Final=redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath -io.netty:netty-codec:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec:4.1.48.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-codec:4.1.49.Final=redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath -io.netty:netty-common:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-common:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-common:4.1.48.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-common:4.1.49.Final=redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath -io.netty:netty-handler-proxy:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler-proxy:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-handler-proxy:4.1.48.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-handler-proxy:4.1.49.Final=redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath -io.netty:netty-handler:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-handler:4.1.48.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-handler:4.1.49.Final=redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath -io.netty:netty-resolver-dns:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver-dns:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-resolver-dns:4.1.48.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-resolver-dns:4.1.49.Final=redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath -io.netty:netty-resolver:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-resolver:4.1.48.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-resolver:4.1.49.Final=redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath -io.netty:netty-transport-native-unix-common:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-transport:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-tcnative-classes:2.0.78.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.48.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.1.49.Final=redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath io.reactivex.rxjava2:rxjava:2.2.12=redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.reactivex.rxjava2:rxjava:2.2.21=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath io.vertx:vertx-codegen:3.9.0=testCompileClasspath,testRuntimeClasspath io.vertx:vertx-codegen:4.0.0=redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath -io.vertx:vertx-codegen:4.5.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-codegen:4.5.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-core:3.9.0=compileClasspath,testCompileClasspath,testRuntimeClasspath io.vertx:vertx-core:4.0.0=redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath -io.vertx:vertx-core:4.5.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-core:4.5.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-redis-client:3.9.0=compileClasspath,testCompileClasspath,testRuntimeClasspath io.vertx:vertx-redis-client:4.0.0=redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath -io.vertx:vertx-redis-client:4.5.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-redis-client:4.5.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-rx-gen:3.9.0=testCompileClasspath,testRuntimeClasspath io.vertx:vertx-rx-gen:4.0.0=redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath -io.vertx:vertx-rx-gen:4.5.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-rx-gen:4.5.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-rx-java2-gen:4.0.0=redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath -io.vertx:vertx-rx-java2-gen:4.5.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-rx-java2-gen:4.5.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-rx-java2:3.9.0=testCompileClasspath,testRuntimeClasspath io.vertx:vertx-rx-java2:4.0.0=redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath -io.vertx:vertx-rx-java2:4.5.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-rx-java2:4.5.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.13.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -162,6 +167,7 @@ org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTes org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:17.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -180,14 +186,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,redis4xForkedTestCompileClasspath,redis4xForkedTestRuntimeClasspath,redis4xTestCompileClasspath,redis4xTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/RedisAPICallAdvice.java b/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/RedisAPICallAdvice.java index 5a83857e40c..179ef81e0ca 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/RedisAPICallAdvice.java +++ b/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/RedisAPICallAdvice.java @@ -6,6 +6,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpan; import static datadog.trace.instrumentation.vertx_redis_client.VertxRedisClientDecorator.DECORATE; +import datadog.context.ContextContinuation; import datadog.trace.bootstrap.CallDepthThreadLocalMap; import datadog.trace.bootstrap.InstrumentationContext; import datadog.trace.bootstrap.instrumentation.api.AgentScope; @@ -104,7 +105,7 @@ public static boolean beforeCall( final AgentSpan parentSpan = activeSpan(); final AgentSpan clientSpan = DECORATE.startAndDecorateSpan(method.getName()); - AgentScope.Continuation parentContinuation = + ContextContinuation parentContinuation = null == parentSpan ? captureSpan(noopSpan()) : captureSpan(parentSpan); /* Opens a new scope. diff --git a/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/RedisAPIImplSendAdvice.java b/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/RedisAPIImplSendAdvice.java index 3c8aadba9a3..3599f31233d 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/RedisAPIImplSendAdvice.java +++ b/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/RedisAPIImplSendAdvice.java @@ -4,8 +4,8 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpan; import static datadog.trace.instrumentation.vertx_redis_client.VertxRedisClientDecorator.DECORATE; +import datadog.context.ContextScope; import datadog.trace.bootstrap.InstrumentationContext; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import io.vertx.core.Future; import io.vertx.core.net.SocketAddress; import io.vertx.redis.client.Redis; @@ -27,7 +27,7 @@ public static void afterSend( */ // Note that we should not _leak_ the active scope to the handler if it gets executed directly - try (AgentScope scope = activateSpan(noopSpan())) { + try (ContextScope scope = activateSpan(noopSpan())) { // Get the handler from the context, set by RedisAPICallAdvice ResponseHandlerWrapper handler = InstrumentationContext.get(RedisAPI.class, ResponseHandlerWrapper.class).get(self); diff --git a/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/RedisFutureSendAdvice.java b/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/RedisFutureSendAdvice.java index 5e58231501c..9d963a7228b 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/RedisFutureSendAdvice.java +++ b/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/RedisFutureSendAdvice.java @@ -8,6 +8,7 @@ import static datadog.trace.instrumentation.vertx_redis_client.VertxRedisClientDecorator.DECORATE; import static datadog.trace.instrumentation.vertx_redis_client.VertxRedisClientDecorator.REDIS_COMMAND; +import datadog.context.ContextContinuation; import datadog.trace.bootstrap.CallDepthThreadLocalMap; import datadog.trace.bootstrap.ContextStore; import datadog.trace.bootstrap.InstrumentationContext; @@ -29,7 +30,7 @@ public class RedisFutureSendAdvice { @Advice.OnMethodEnter(suppress = Throwable.class) public static AgentScope beforeSend( @Advice.Argument(value = 0, readOnly = false) Request request, - @Advice.Local("ddParentContinuation") AgentScope.Continuation parentContinuation) + @Advice.Local("ddParentContinuation") ContextContinuation parentContinuation) throws Throwable { ContextStore ctxt = InstrumentationContext.get(Request.class, Boolean.class); Boolean handled = ctxt.get(request); @@ -68,7 +69,7 @@ public static AgentScope beforeSend( @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void afterSend( @Advice.Return(readOnly = false) Future responseFuture, - @Advice.Local("ddParentContinuation") AgentScope.Continuation parentContinuation, + @Advice.Local("ddParentContinuation") ContextContinuation parentContinuation, @Advice.Enter final AgentScope clientScope, @Advice.This final Object thiz) { if (thiz instanceof RedisConnection) { diff --git a/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/RedisSendAdvice.java b/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/RedisSendAdvice.java index b58ead7b8fe..88acf8e8109 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/RedisSendAdvice.java +++ b/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/RedisSendAdvice.java @@ -8,6 +8,7 @@ import static datadog.trace.instrumentation.vertx_redis_client.VertxRedisClientDecorator.DECORATE; import static datadog.trace.instrumentation.vertx_redis_client.VertxRedisClientDecorator.REDIS_COMMAND; +import datadog.context.ContextContinuation; import datadog.trace.bootstrap.CallDepthThreadLocalMap; import datadog.trace.bootstrap.ContextStore; import datadog.trace.bootstrap.InstrumentationContext; @@ -60,7 +61,7 @@ public static AgentScope beforeSend( return null; } - AgentScope.Continuation parentContinuation = + ContextContinuation parentContinuation = null == parentSpan ? captureSpan(noopSpan()) : captureSpan(parentSpan); final AgentSpan clientSpan = DECORATE.startAndDecorateSpan( diff --git a/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/ResponseHandler.java b/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/ResponseHandler.java index 901ad23b928..d036a29bd07 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/ResponseHandler.java +++ b/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/ResponseHandler.java @@ -2,7 +2,8 @@ import static datadog.trace.instrumentation.vertx_redis_client.VertxRedisClientDecorator.DECORATE; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -11,14 +12,14 @@ public class ResponseHandler implements Handler> { public final AgentSpan clientSpan; - private final AgentScope.Continuation continuation; + private final ContextContinuation continuation; private final Promise promise; private boolean handled = false; public ResponseHandler( final Promise promise, final AgentSpan clientSpan, - final AgentScope.Continuation continuation) { + final ContextContinuation continuation) { this.clientSpan = clientSpan; this.continuation = continuation; this.promise = promise; @@ -28,7 +29,7 @@ public ResponseHandler( public void handle(final AsyncResult event) { if (!handled && clientSpan != null) { handled = true; - AgentScope scope = null; + ContextScope scope = null; try { // Close client scope and span if (!event.succeeded()) { @@ -37,7 +38,7 @@ public void handle(final AsyncResult event) { clientSpan.finish(); // Activate parent continuation and trigger promise completion if (continuation != null) { - scope = continuation.activate(); + scope = continuation.resume(); } promise.handle(event); } finally { diff --git a/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/ResponseHandlerWrapper.java b/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/ResponseHandlerWrapper.java index 8518ac42dda..ea8e92ee0c8 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/ResponseHandlerWrapper.java +++ b/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_redis_client/ResponseHandlerWrapper.java @@ -1,6 +1,7 @@ package datadog.trace.instrumentation.vertx_redis_client; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -9,13 +10,13 @@ public class ResponseHandlerWrapper implements Handler> { private final Handler> handler; public final AgentSpan clientSpan; - private final AgentScope.Continuation parentContinuation; + private final ContextContinuation parentContinuation; private boolean handled = false; public ResponseHandlerWrapper( final Handler> handler, final AgentSpan clientSpan, - final AgentScope.Continuation parentContinuation) { + final ContextContinuation parentContinuation) { this.handler = handler; this.clientSpan = clientSpan; this.parentContinuation = parentContinuation; @@ -32,13 +33,13 @@ public void handle(final AsyncResult event) { */ if (!handled) { handled = true; - AgentScope scope = null; + ContextScope scope = null; try { if (null != clientSpan) { clientSpan.finish(); } if (null != parentContinuation) { - scope = parentContinuation.activate(); + scope = parentContinuation.resume(); } handler.handle(event); } finally { diff --git a/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-stubs/gradle.lockfile b/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-stubs/gradle.lockfile index 6f2e37410c3..2a2e0cc884c 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-stubs/gradle.lockfile +++ b/dd-java-agent/instrumentation/vertx/vertx-redis-client/vertx-redis-client-stubs/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:vertx:vertx-redis-client:vertx-redis-client-stubs:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -16,15 +17,15 @@ com.fasterxml.jackson.core:jackson-annotations:2.10.2=compileClasspath com.fasterxml.jackson.core:jackson-core:2.10.2=compileClasspath com.fasterxml.jackson.core:jackson-databind:2.10.2=compileClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -34,12 +35,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -62,14 +66,14 @@ io.netty:netty-handler:4.1.48.Final=compileClasspath io.netty:netty-resolver-dns:4.1.48.Final=compileClasspath io.netty:netty-resolver:4.1.48.Final=compileClasspath io.netty:netty-transport:4.1.48.Final=compileClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath io.vertx:vertx-core:3.9.0=compileClasspath io.vertx:vertx-redis-client:3.9.0=compileClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -98,6 +102,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -115,14 +120,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/vertx/vertx-rx-3.5/gradle.lockfile b/dd-java-agent/instrumentation/vertx/vertx-rx-3.5/gradle.lockfile index ef6388193f7..ed5f7d78060 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-rx-3.5/gradle.lockfile +++ b/dd-java-agent/instrumentation/vertx/vertx-rx-3.5/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:vertx:vertx-rx-3.5:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -20,15 +21,15 @@ com.fasterxml.jackson.core:jackson-databind:2.14.0=latestDepForkedTestCompileCla com.fasterxml.jackson.core:jackson-databind:2.9.0=testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.14.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -38,12 +39,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -81,7 +85,7 @@ io.netty:netty-transport:4.1.15.Final=testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.1.89.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.reactivex.rxjava2:rxjava:2.1.3=testCompileClasspath,testRuntimeClasspath io.reactivex.rxjava2:rxjava:2.2.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.vertx:vertx-auth-common:3.5.0=testCompileClasspath,testRuntimeClasspath io.vertx:vertx-auth-common:3.9.16=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-bridge-common:3.5.0=testCompileClasspath,testRuntimeClasspath @@ -103,8 +107,8 @@ io.vertx:vertx-web:3.9.16=latestDepForkedTestCompileClasspath,latestDepForkedTes javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -135,6 +139,7 @@ org.hdrhistogram:HdrHistogram:2.1.10=latestDepForkedTestCompileClasspath,latestD org.hdrhistogram:HdrHistogram:2.1.9=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -153,14 +158,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.1=testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/vertx/vertx-rx-3.5/src/test/groovy/server/VertxRxCircuitBreakerHttpServerForkedTest.groovy b/dd-java-agent/instrumentation/vertx/vertx-rx-3.5/src/test/groovy/server/VertxRxCircuitBreakerHttpServerForkedTest.groovy index 01479aad752..96b8b9b3a54 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-rx-3.5/src/test/groovy/server/VertxRxCircuitBreakerHttpServerForkedTest.groovy +++ b/dd-java-agent/instrumentation/vertx/vertx-rx-3.5/src/test/groovy/server/VertxRxCircuitBreakerHttpServerForkedTest.groovy @@ -39,6 +39,16 @@ class VertxRxCircuitBreakerHttpServerForkedTest extends VertxHttpServerForkedTes false } + @Override + boolean testBodyFilenames() { + false + } + + @Override + boolean testBodyFilesContent() { + false + } + @Override boolean testBodyJson() { false diff --git a/dd-java-agent/instrumentation/vertx/vertx-sql-client-3.9/gradle.lockfile b/dd-java-agent/instrumentation/vertx/vertx-sql-client-3.9/gradle.lockfile index 8aa9dfe9088..434f96167af 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-sql-client-3.9/gradle.lockfile +++ b/dd-java-agent/instrumentation/vertx/vertx-sql-client-3.9/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:vertx:vertx-sql-client-3.9:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -16,15 +17,15 @@ com.fasterxml.jackson.core:jackson-annotations:2.10.2=compileClasspath com.fasterxml.jackson.core:jackson-core:2.10.2=compileClasspath com.fasterxml.jackson.core:jackson-databind:2.10.2=compileClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -34,12 +35,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -62,14 +66,14 @@ io.netty:netty-handler:4.1.48.Final=compileClasspath io.netty:netty-resolver-dns:4.1.48.Final=compileClasspath io.netty:netty-resolver:4.1.48.Final=compileClasspath io.netty:netty-transport:4.1.48.Final=compileClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath io.vertx:vertx-core:3.9.0=compileClasspath io.vertx:vertx-sql-client:3.9.0=compileClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -98,6 +102,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -115,14 +120,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/vertx/vertx-sql-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_sql_client_39/CursorReadAdvice.java b/dd-java-agent/instrumentation/vertx/vertx-sql-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_sql_client_39/CursorReadAdvice.java index fbfc294591b..6e997ab4c58 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-sql-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_sql_client_39/CursorReadAdvice.java +++ b/dd-java-agent/instrumentation/vertx/vertx-sql-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_sql_client_39/CursorReadAdvice.java @@ -5,6 +5,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.captureSpan; import static datadog.trace.instrumentation.vertx_sql_client_39.VertxSqlClientDecorator.DECORATE; +import datadog.context.ContextContinuation; import datadog.trace.api.Pair; import datadog.trace.bootstrap.InstrumentationContext; import datadog.trace.bootstrap.instrumentation.api.AgentScope; @@ -27,7 +28,7 @@ public static AgentScope beforeRead( return null; } final AgentSpan parentSpan = activeSpan(); - final AgentScope.Continuation parentContinuation = + final ContextContinuation parentContinuation = null == parentSpan ? null : captureSpan(parentSpan); final AgentSpan clientSpan = DECORATE.startAndDecorateSpanForStatement( diff --git a/dd-java-agent/instrumentation/vertx/vertx-sql-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_sql_client_39/QueryAdvice.java b/dd-java-agent/instrumentation/vertx/vertx-sql-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_sql_client_39/QueryAdvice.java index 49b52e3fe03..225e016e820 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-sql-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_sql_client_39/QueryAdvice.java +++ b/dd-java-agent/instrumentation/vertx/vertx-sql-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_sql_client_39/QueryAdvice.java @@ -5,6 +5,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.captureSpan; import static datadog.trace.instrumentation.vertx_sql_client_39.VertxSqlClientDecorator.DECORATE; +import datadog.context.ContextContinuation; import datadog.trace.api.Pair; import datadog.trace.bootstrap.ContextStore; import datadog.trace.bootstrap.InstrumentationContext; @@ -42,7 +43,7 @@ public static > AgentScope beforeExecute( final boolean prepared = !(maybeHandler instanceof Handler); final AgentSpan parentSpan = activeSpan(); - final AgentScope.Continuation parentContinuation = + final ContextContinuation parentContinuation = null == parentSpan ? null : captureSpan(parentSpan); final AgentSpan clientSpan = DECORATE.startAndDecorateSpanForStatement( diff --git a/dd-java-agent/instrumentation/vertx/vertx-sql-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_sql_client_39/QueryResultHandlerWrapper.java b/dd-java-agent/instrumentation/vertx/vertx-sql-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_sql_client_39/QueryResultHandlerWrapper.java index 7cf63771ad5..3053a0ae8d8 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-sql-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_sql_client_39/QueryResultHandlerWrapper.java +++ b/dd-java-agent/instrumentation/vertx/vertx-sql-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_sql_client_39/QueryResultHandlerWrapper.java @@ -1,6 +1,7 @@ package datadog.trace.instrumentation.vertx_sql_client_39; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import io.vertx.core.AsyncResult; import io.vertx.core.Handler; @@ -10,12 +11,12 @@ public class QueryResultHandlerWrapper> implements Handler> { private final Handler> handler; private final AgentSpan clientSpan; - private final AgentScope.Continuation parentContinuation; + private final ContextContinuation parentContinuation; public QueryResultHandlerWrapper( final Handler> handler, final AgentSpan clientSpan, - final AgentScope.Continuation parentContinuation) { + final ContextContinuation parentContinuation) { this.handler = handler; this.clientSpan = clientSpan; this.parentContinuation = parentContinuation; @@ -23,13 +24,13 @@ public QueryResultHandlerWrapper( @Override public void handle(final AsyncResult event) { - AgentScope scope = null; + ContextScope scope = null; try { if (null != clientSpan) { clientSpan.finish(); } if (null != parentContinuation) { - scope = parentContinuation.activate(); + scope = parentContinuation.resume(); } handler.handle(event); } finally { diff --git a/dd-java-agent/instrumentation/vertx/vertx-sql-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_sql_client_39/VertxSqlClientDecorator.java b/dd-java-agent/instrumentation/vertx/vertx-sql-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_sql_client_39/VertxSqlClientDecorator.java index 6a9375ca9ea..d95a6c65137 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-sql-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_sql_client_39/VertxSqlClientDecorator.java +++ b/dd-java-agent/instrumentation/vertx/vertx-sql-client-3.9/src/main/java/datadog/trace/instrumentation/vertx_sql_client_39/VertxSqlClientDecorator.java @@ -100,7 +100,7 @@ public AgentSpan startAndDecorateSpanForStatement( span.setResourceName(DB_QUERY); } span.setTag(Tags.COMPONENT, component); - span.context().setIntegrationName(component); + span.spanContext().setIntegrationName(component); return span; } diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/.gitignore b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/.gitignore new file mode 100644 index 00000000000..866a6ca4ccc --- /dev/null +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/.gitignore @@ -0,0 +1 @@ +/file-uploads/ diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/build.gradle b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/build.gradle index 56311523214..2344e2a0a81 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/build.gradle +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/build.gradle @@ -42,10 +42,10 @@ dependencies { testImplementation group: 'io.vertx', name: 'vertx-web', version: '3.4.0' testImplementation group: 'io.vertx', name: 'vertx-web-client', version: '3.4.0' - testImplementation group: 'org.mockito', name: 'mockito-inline', version: '4.11.0' - testImplementation project(':dd-java-agent:appsec:appsec-test-fixtures') + testImplementation libs.junit.jupiter + latestDepTestImplementation group: 'io.vertx', name: 'vertx-web', version: '3.+' latestDepTestImplementation group: 'io.vertx', name: 'vertx-web-client', version: '3.+' } diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/gradle.lockfile b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/gradle.lockfile index d3495089c19..0d65ee74ada 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/gradle.lockfile +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:vertx:vertx-web:vertx-web-3.4:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -20,15 +21,15 @@ com.fasterxml.jackson.core:jackson-databind:2.14.0=latestDepForkedTestCompileCla com.fasterxml.jackson.core:jackson-databind:2.7.4=compileClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.14.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -38,12 +39,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -79,7 +83,7 @@ io.netty:netty-resolver:4.1.89.Final=latestDepForkedTestCompileClasspath,latestD io.netty:netty-transport-native-unix-common:4.1.89.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.8.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.1.89.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.vertx:vertx-auth-common:3.4.0=compileClasspath,testCompileClasspath,testRuntimeClasspath io.vertx:vertx-auth-common:3.9.16=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-bridge-common:3.9.16=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -94,8 +98,8 @@ io.vertx:vertx-web:3.9.16=latestDepForkedTestCompileClasspath,latestDepForkedTes javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -124,6 +128,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepForkedTestRuntimeClasspath,latestDepTest org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -136,20 +141,19 @@ org.junit.platform:junit-platform-suite-api:1.14.1=latestDepForkedTestRuntimeCla org.junit.platform:junit-platform-suite-commons:1.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.mockito:mockito-core:4.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.mockito:mockito-inline:4.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-core:4.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/EndHandlerWrapper.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/EndHandlerWrapper.java index a8cb1ebb079..f4b30bc4d44 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/EndHandlerWrapper.java +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/EndHandlerWrapper.java @@ -1,9 +1,5 @@ package datadog.trace.instrumentation.vertx_3_4.server; -import static datadog.trace.instrumentation.vertx_3_4.server.RouteHandlerWrapper.HANDLER_SPAN_CONTEXT_KEY; -import static datadog.trace.instrumentation.vertx_3_4.server.VertxDecorator.DECORATE; - -import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import io.vertx.core.Handler; import io.vertx.ext.web.RoutingContext; @@ -18,16 +14,12 @@ public class EndHandlerWrapper implements Handler { @Override public void handle(final Void event) { - AgentSpan span = routingContext.get(HANDLER_SPAN_CONTEXT_KEY); try { if (actual != null) { actual.handle(event); } } finally { - if (span != null) { - DECORATE.onResponse(span, routingContext.response()); - span.finish(); - } + RouteHandlerWrapper.finishHandlerSpan(routingContext); } } } diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/FileUploadHelper.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/FileUploadHelper.java new file mode 100644 index 00000000000..913003e8c28 --- /dev/null +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/FileUploadHelper.java @@ -0,0 +1,51 @@ +package datadog.trace.instrumentation.vertx_3_4.server; + +import datadog.appsec.api.blocking.BlockingException; +import datadog.trace.api.gateway.BlockResponseFunction; +import datadog.trace.api.gateway.Flow; +import datadog.trace.api.gateway.RequestContext; +import datadog.trace.api.http.MultipartContentDecoder; +import io.vertx.ext.web.FileUpload; +import java.io.FileInputStream; +import java.util.List; +import java.util.function.BiFunction; + +public class FileUploadHelper { + + public static BlockingException commitBlockingResponse( + BiFunction, Flow> cb, + RequestContext reqCtx, + List data, + String reason) { + Flow flow = cb.apply(reqCtx, data); + Flow.Action action = flow.getAction(); + if (action instanceof Flow.Action.RequestBlockingAction) { + BlockResponseFunction brf = reqCtx.getBlockResponseFunction(); + if (brf != null) { + brf.tryCommitBlockingResponse( + reqCtx.getTraceSegment(), (Flow.Action.RequestBlockingAction) action); + return new BlockingException(reason); + } + } + return null; + } + + public static String readUploadContent(FileUpload upload, int maxBytes) { + try { + String path = upload.uploadedFileName(); + if (path == null || path.isEmpty()) { + return ""; + } + String charSet = upload.charSet(); + String contentType = + charSet != null && !charSet.isEmpty() + ? upload.contentType() + "; charset=" + charSet + : upload.contentType(); + try (FileInputStream fis = new FileInputStream(path)) { + return MultipartContentDecoder.readInputStream(fis, maxBytes, contentType); + } + } catch (Exception ignored) { + return ""; + } + } +} diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/RouteHandlerWrapper.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/RouteHandlerWrapper.java index 37120c2f0cd..7af44b78e9d 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/RouteHandlerWrapper.java +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/RouteHandlerWrapper.java @@ -2,13 +2,12 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopScope; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; import static datadog.trace.bootstrap.instrumentation.decorator.http.HttpResourceDecorator.HTTP_RESOURCE_DECORATOR; import static datadog.trace.instrumentation.vertx_3_4.server.VertxDecorator.DECORATE; import static datadog.trace.instrumentation.vertx_3_4.server.VertxDecorator.INSTRUMENTATION_NAME; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.Tags; import io.vertx.core.Handler; @@ -47,13 +46,22 @@ public void handle(final RoutingContext routingContext) { span = startSpan("vertx", INSTRUMENTATION_NAME); routingContext.put(HANDLER_SPAN_CONTEXT_KEY, span); + // Register three hooks that fire on response outcome: + // finishHandlerSpan is idempotent; whichever hook fires first wins. + // + // Known remaining gap: sendFile() failures on file-not-found or + // IOException-during-open log via HttpServerResponseImpl and return + // without firing any of the three hooks above (when the caller did + // not pass a resultHandler), so the span still leaks on that path. routingContext.response().endHandler(new EndHandlerWrapper(routingContext)); + routingContext.addBodyEndHandler(v -> finishHandlerSpan(routingContext)); + routingContext.response().exceptionHandler(t -> finishHandlerSpan(routingContext)); DECORATE.afterStart(span); span.setResourceName(DECORATE.className(actual.getClass())); } setRoute(routingContext); } - try (final AgentScope scope = span != null ? activateSpan(span) : noopScope()) { + try (final ContextScope scope = span != null ? activateSpan(span) : null) { try { actual.handle(routingContext); } catch (final Throwable t) { @@ -63,6 +71,20 @@ public void handle(final RoutingContext routingContext) { } } + // Idempotently finish the route-handler span. Any of the three registered + // hooks (EndHandlerWrapper, the addBodyEndHandler fallback, or the + // response.exceptionHandler lambda) may call this; the first one to win + // clears HANDLER_SPAN_CONTEXT_KEY so the others are no-ops. + static void finishHandlerSpan(final RoutingContext routingContext) { + final AgentSpan span = routingContext.get(HANDLER_SPAN_CONTEXT_KEY); + if (span == null) { + return; + } + routingContext.put(HANDLER_SPAN_CONTEXT_KEY, null); + DECORATE.onResponse(span, routingContext.response()); + span.finish(); + } + private void setRoute(RoutingContext routingContext) { final AgentSpan parentSpan = routingContext.get(PARENT_SPAN_CONTEXT_KEY); if (parentSpan == null) { diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/RouteMatchesAdvice.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/RouteMatchesAdvice.java index 7aec8ec2487..73bb2f3e3ae 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/RouteMatchesAdvice.java +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/RouteMatchesAdvice.java @@ -7,7 +7,7 @@ import net.bytebuddy.asm.Advice; class RouteMatchesAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) @Source(SourceTypes.REQUEST_PATH_PARAMETER) static void after( @Advice.Return int ret, @@ -26,7 +26,7 @@ static void after( } static class BooleanReturnVariant { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) @Source(SourceTypes.REQUEST_PATH_PARAMETER) static void after( @Advice.Return boolean ret, diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/RoutingContextFilenamesAdvice.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/RoutingContextFilenamesAdvice.java new file mode 100644 index 00000000000..0fa821e3754 --- /dev/null +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/RoutingContextFilenamesAdvice.java @@ -0,0 +1,88 @@ +package datadog.trace.instrumentation.vertx_3_4.server; + +import static datadog.trace.api.gateway.Events.EVENTS; + +import datadog.trace.advice.ActiveRequestContext; +import datadog.trace.advice.RequiresRequestContext; +import datadog.trace.api.Config; +import datadog.trace.api.gateway.CallbackProvider; +import datadog.trace.api.gateway.Flow; +import datadog.trace.api.gateway.RequestContext; +import datadog.trace.api.gateway.RequestContextSlot; +import datadog.trace.bootstrap.CallDepthThreadLocalMap; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import io.vertx.ext.web.FileUpload; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.function.BiFunction; +import net.bytebuddy.asm.Advice; + +@RequiresRequestContext(RequestContextSlot.APPSEC) +class RoutingContextFilenamesAdvice { + + @Advice.OnMethodEnter(suppress = Throwable.class) + static int before() { + return CallDepthThreadLocalMap.incrementCallDepth(FileUpload.class); + } + + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + static void after( + @Advice.Enter int depth, + @Advice.Return Set uploads, + @ActiveRequestContext RequestContext reqCtx, + @Advice.Thrown(readOnly = false) Throwable throwable) { + CallDepthThreadLocalMap.decrementCallDepth(FileUpload.class); + if (depth != 0 || throwable != null || uploads == null || uploads.isEmpty()) { + return; + } + + CallbackProvider cbp = AgentTracer.get().getCallbackProvider(RequestContextSlot.APPSEC); + BiFunction, Flow> filenamesCb = + cbp.getCallback(EVENTS.requestFilesFilenames()); + BiFunction, Flow> contentCb = + cbp.getCallback(EVENTS.requestFilesContent()); + if (filenamesCb == null && contentCb == null) { + return; + } + + int maxFiles = Config.get().getAppSecMaxFileContentCount(); + int maxBytes = Config.get().getAppSecMaxFileContentBytes(); + List filenames = null; + List filesContent = null; + + for (FileUpload upload : uploads) { + String name = upload.fileName(); + if (filenamesCb != null && name != null && !name.isEmpty()) { + if (filenames == null) { + filenames = new ArrayList<>(); + } + filenames.add(name); + } + if (contentCb != null + && maxFiles > 0 + && (filesContent == null || filesContent.size() < maxFiles)) { + if (filesContent == null) { + filesContent = new ArrayList<>(); + } + filesContent.add(FileUploadHelper.readUploadContent(upload, maxBytes)); + } + } + + if (filenamesCb != null && filenames != null) { + throwable = + FileUploadHelper.commitBlockingResponse( + filenamesCb, reqCtx, filenames, "Blocked request (multipart file upload)"); + } + + if (throwable != null) { + return; + } + + if (contentCb != null && filesContent != null) { + throwable = + FileUploadHelper.commitBlockingResponse( + contentCb, reqCtx, filesContent, "Blocked request (file content)"); + } + } +} diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/RoutingContextImplInstrumentation.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/RoutingContextImplInstrumentation.java index bc52bbfdbed..af8ee74bf18 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/RoutingContextImplInstrumentation.java +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/RoutingContextImplInstrumentation.java @@ -15,10 +15,23 @@ public class RoutingContextImplInstrumentation extends InstrumenterModule.AppSec implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { + private static final Reference FILE_UPLOAD_REF = + new Reference.Builder("io.vertx.ext.web.FileUpload") + .withMethod(new String[0], 0, "fileName", "Ljava/lang/String;") + .withMethod(new String[0], 0, "uploadedFileName", "Ljava/lang/String;") + .withMethod(new String[0], 0, "contentType", "Ljava/lang/String;") + .withMethod(new String[0], 0, "charSet", "Ljava/lang/String;") + .build(); + public RoutingContextImplInstrumentation() { super("vertx", "vertx-3.4"); } + @Override + public String[] helperClassNames() { + return new String[] {packageName + ".FileUploadHelper"}; + } + @Override public String instrumentedType() { return "io.vertx.ext.web.impl.RoutingContextImpl"; @@ -26,7 +39,7 @@ public String instrumentedType() { @Override public Reference[] additionalMuzzleReferences() { - return new Reference[] {PARSABLE_HEADER_VALUE, VIRTUAL_HOST_HANDLER}; + return new Reference[] {PARSABLE_HEADER_VALUE, VIRTUAL_HOST_HANDLER, FILE_UPLOAD_REF}; } @Override @@ -37,5 +50,8 @@ public void methodAdvice(MethodTransformer transformer) { transformer.applyAdvice( named("setSession").and(takesArgument(0, named("io.vertx.ext.web.Session"))), packageName + ".RoutingContextSessionAdvice"); + transformer.applyAdvice( + named("fileUploads").and(takesArguments(0)), + packageName + ".RoutingContextFilenamesAdvice"); } } diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/RoutingContextJsonAdvice.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/RoutingContextJsonAdvice.java index edd19ade931..8cb28041ec8 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/RoutingContextJsonAdvice.java +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/RoutingContextJsonAdvice.java @@ -17,7 +17,7 @@ @RequiresRequestContext(RequestContextSlot.APPSEC) class RoutingContextJsonAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Return Object obj_, @ActiveRequestContext RequestContext reqCtx, diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/VertxDecorator.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/VertxDecorator.java index 29900eb8034..fc9745da645 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/VertxDecorator.java +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/main/java/datadog/trace/instrumentation/vertx_3_4/server/VertxDecorator.java @@ -54,13 +54,11 @@ protected URIDataAdapter url(final RoutingContext routingContext) { } @Override - public AgentSpan onRequest( + public void onRequest( final AgentSpan span, final RoutingContext connection, final RoutingContext routingContext, - final Context parentContext) { - return span; - } + final Context parentContext) {} @Override protected String peerHostIP(final RoutingContext routingContext) { diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/test/groovy/server/VertxHttpServerForkedTest.groovy b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/test/groovy/server/VertxHttpServerForkedTest.groovy index 4b585252db3..7fadc69bac5 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/test/groovy/server/VertxHttpServerForkedTest.groovy +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/test/groovy/server/VertxHttpServerForkedTest.groovy @@ -1,6 +1,8 @@ package server +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.BODY_MULTIPART import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.ERROR +import static org.junit.jupiter.api.Assumptions.assumeTrue import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.EXCEPTION import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.LOGIN import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.NOT_FOUND @@ -10,6 +12,10 @@ import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.SUCCES import datadog.trace.agent.test.asserts.TraceAssert import datadog.trace.agent.test.base.HttpServer import datadog.trace.agent.test.base.HttpServerTest +import datadog.trace.api.Config +import okhttp3.MediaType +import okhttp3.MultipartBody +import okhttp3.RequestBody import datadog.trace.api.DDSpanTypes import datadog.trace.bootstrap.instrumentation.api.Tags import datadog.trace.instrumentation.netty41.server.NettyHttpServerDecorator @@ -82,6 +88,47 @@ class VertxHttpServerForkedTest extends HttpServerTest { true } + @Override + boolean testBodyFilenames() { + true + } + + @Override + boolean testBodyFilesContent() { + true + } + + @Override + boolean testBodyFilesContentOrdering() { + false + } + + // fileUploads() returns a HashSet in Vert.x: check count instead of which specific file is excluded + def 'test instrumentation gateway file upload content max files limit count'() { + setup: + assumeTrue(testBodyFilesContent()) + def maxFilesToInspect = Config.get().getAppSecMaxFileContentCount() + def bodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM) + (1..maxFilesToInspect + 1).each { i -> + bodyBuilder.addFormDataPart("file${i}", "file${i}.bin", + RequestBody.create(MediaType.parse('application/octet-stream'), "content_of_file_${i}")) + } + def httpRequest = request(BODY_MULTIPART, 'POST', bodyBuilder.build()).build() + def response = client.newCall(httpRequest).execute() + + when: + TEST_WRITER.waitForTraces(1) + + then: + TEST_WRITER.get(0).any { span -> + def tag = span.getTag('request.body.files_content') as String + tag != null && tag.count('content_of_file_') == maxFilesToInspect + } + + cleanup: + response.close() + } + @Override boolean testBodyJson() { true diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/test/java/io/vertx/core/http/impl/ResponseExceptionFiringHelper.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/test/java/io/vertx/core/http/impl/ResponseExceptionFiringHelper.java new file mode 100644 index 00000000000..5c581365de5 --- /dev/null +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/test/java/io/vertx/core/http/impl/ResponseExceptionFiringHelper.java @@ -0,0 +1,17 @@ +package io.vertx.core.http.impl; + +import io.vertx.core.http.HttpServerResponse; + +/** + * Test-side bridge that fires the package-private HttpServerResponseImpl.handleException on a + * Vert.x 3.x server response. Used by server.RouteHandlerExceptionHandlerTest to deterministically + * reproduce the non-CLOSED_EXCEPTION I/O-failure path that Vert.x exposes via + * response.exceptionHandler(...). + */ +public final class ResponseExceptionFiringHelper { + private ResponseExceptionFiringHelper() {} + + public static void fireException(HttpServerResponse response, Throwable cause) { + ((HttpServerResponseImpl) response).handleException(cause); + } +} diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/test/java/server/RouteHandlerExceptionHandlerTest.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/test/java/server/RouteHandlerExceptionHandlerTest.java new file mode 100644 index 00000000000..3892646adcf --- /dev/null +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/test/java/server/RouteHandlerExceptionHandlerTest.java @@ -0,0 +1,126 @@ +package server; + +import static datadog.trace.agent.test.assertions.SpanMatcher.span; +import static datadog.trace.agent.test.assertions.TraceMatcher.SORT_BY_START_TIME; +import static datadog.trace.agent.test.assertions.TraceMatcher.trace; + +import datadog.trace.agent.test.AbstractInstrumentationTest; +import datadog.trace.api.DDSpanTypes; +import io.vertx.core.Vertx; +import io.vertx.core.http.HttpServer; +import io.vertx.core.http.impl.ResponseExceptionFiringHelper; +import io.vertx.ext.web.Router; +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.ServerSocket; +import java.net.URL; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.regex.Pattern; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +/** + * Regression test for the vertx-web 3.x route-handler span lifecycle on the + * response.exceptionHandler path. + * + *

      HttpServerResponseImpl.handleException is invoked by Vert.x on non-CLOSED_EXCEPTION I/O + * failures of the response. Neither endHandler nor bodyEndHandler fires on this path, so the + * route-handler span would leak without an exception handler registered. The route handler here + * fires handleException directly via ResponseExceptionFiringHelper (the package-private method + * Vert.x itself uses internally), then calls response.end() normally so the HTTP client gets a + * response. + */ +class RouteHandlerExceptionHandlerTest extends AbstractInstrumentationTest { + + private static Vertx vertx; + private static HttpServer server; + private static int port; + + @BeforeAll + static void startServer() throws Exception { + try (ServerSocket socket = new ServerSocket(0)) { + port = socket.getLocalPort(); + } + + vertx = Vertx.vertx(); + Router router = Router.router(vertx); + router + .route("/fail") + .handler( + ctx -> { + ResponseExceptionFiringHelper.fireException( + ctx.response(), new IOException("simulated response I/O failure")); + try { + ctx.response().setStatusCode(500).end("error"); + } catch (IllegalStateException ignore) { + // handleException may have left the response in a state where end() is rejected; + // the span is already finished by our registered exception handler. + } + }); + + CountDownLatch ready = new CountDownLatch(1); + server = + vertx + .createHttpServer() + .requestHandler(router::accept) + .listen( + port, + result -> { + if (result.failed()) { + throw new RuntimeException("Failed to start Vert.x server", result.cause()); + } + ready.countDown(); + }); + if (!ready.await(10, TimeUnit.SECONDS)) { + throw new IllegalStateException("Vert.x server did not start in time"); + } + } + + @AfterAll + static void stopServer() throws Exception { + if (server != null) { + CountDownLatch closed = new CountDownLatch(1); + server.close(ar -> closed.countDown()); + closed.await(10, TimeUnit.SECONDS); + } + if (vertx != null) { + CountDownLatch closed = new CountDownLatch(1); + vertx.close(ar -> closed.countDown()); + closed.await(10, TimeUnit.SECONDS); + } + } + + @Test + void exceptionHandlerFinishesRouteHandlerSpan() throws Exception { + HttpURLConnection conn = + (HttpURLConnection) new URL("http://localhost:" + port + "/fail").openConnection(); + conn.setRequestMethod("GET"); + conn.setConnectTimeout(5000); + conn.setReadTimeout(5000); + try { + // We don't care about the response code or body — only that the trace flushes. + conn.getResponseCode(); + } catch (IOException ignore) { + // If end() was rejected after handleException, the client may see a closed connection. + } finally { + conn.disconnect(); + } + + // The netty.request span is marked as errored because the route handler ends with + // HTTP 500; the route-handler span is finished by our exception handler before + // setStatusCode(500), so it sees status=200 (default) and is not errored. + assertTraces( + trace( + SORT_BY_START_TIME, + span() + .operationName(Pattern.compile(Pattern.quote("netty.request"))) + .type(DDSpanTypes.HTTP_SERVER) + .error(), + span() + .childOfPrevious() + .operationName(Pattern.compile(Pattern.quote("vertx.route-handler"))) + .type(DDSpanTypes.HTTP_SERVER))); + } +} diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/test/java/server/RouteHandlerSendFileTest.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/test/java/server/RouteHandlerSendFileTest.java new file mode 100644 index 00000000000..06102063a1b --- /dev/null +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/test/java/server/RouteHandlerSendFileTest.java @@ -0,0 +1,122 @@ +package server; + +import static datadog.trace.agent.test.assertions.SpanMatcher.span; +import static datadog.trace.agent.test.assertions.TraceMatcher.SORT_BY_START_TIME; +import static datadog.trace.agent.test.assertions.TraceMatcher.trace; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import datadog.trace.agent.test.AbstractInstrumentationTest; +import datadog.trace.api.DDSpanTypes; +import io.vertx.core.Vertx; +import io.vertx.core.http.HttpServer; +import io.vertx.ext.web.Router; +import java.io.BufferedReader; +import java.io.InputStreamReader; +import java.net.HttpURLConnection; +import java.net.ServerSocket; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.regex.Pattern; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +/** + * Regression test for the vertx-web 3.x route-handler span lifecycle on the response.sendFile(...) + * path. + * + *

      HttpServerResponseImpl.doSendFile (vertx-core 3.x) only invokes bodyEndHandler after the file + * is written; it never invokes endHandler. With only the endHandler registration (pre-fix), the + * vertx.route-handler span never finishes on this path, the trace fails to flush, and assertTraces + * times out. With the fallback addBodyEndHandler registration, the span finishes on every + * response-end path. + */ +class RouteHandlerSendFileTest extends AbstractInstrumentationTest { + + private static Vertx vertx; + private static HttpServer server; + private static int port; + private static Path payload; + + @BeforeAll + static void startServer() throws Exception { + payload = Files.createTempFile("vertx-sendfile-", ".txt"); + Files.write(payload, "vertx sendFile payload\n".getBytes(StandardCharsets.UTF_8)); + payload.toFile().deleteOnExit(); + + try (ServerSocket socket = new ServerSocket(0)) { + port = socket.getLocalPort(); + } + + vertx = Vertx.vertx(); + Router router = Router.router(vertx); + router + .route("/sendfile") + .handler(ctx -> ctx.response().sendFile(payload.toAbsolutePath().toString())); + + CountDownLatch ready = new CountDownLatch(1); + server = + vertx + .createHttpServer() + .requestHandler(router::accept) + .listen( + port, + result -> { + if (result.failed()) { + throw new RuntimeException("Failed to start Vert.x server", result.cause()); + } + ready.countDown(); + }); + if (!ready.await(10, TimeUnit.SECONDS)) { + throw new IllegalStateException("Vert.x server did not start in time"); + } + } + + @AfterAll + static void stopServer() throws Exception { + if (server != null) { + CountDownLatch closed = new CountDownLatch(1); + server.close(ar -> closed.countDown()); + closed.await(10, TimeUnit.SECONDS); + } + if (vertx != null) { + CountDownLatch closed = new CountDownLatch(1); + vertx.close(ar -> closed.countDown()); + closed.await(10, TimeUnit.SECONDS); + } + if (payload != null) { + Files.deleteIfExists(payload); + } + } + + @Test + void sendFileFinishesRouteHandlerSpan() throws Exception { + HttpURLConnection conn = + (HttpURLConnection) new URL("http://localhost:" + port + "/sendfile").openConnection(); + conn.setRequestMethod("GET"); + conn.setConnectTimeout(5000); + conn.setReadTimeout(5000); + assertEquals(200, conn.getResponseCode()); + try (BufferedReader reader = + new BufferedReader(new InputStreamReader(conn.getInputStream(), StandardCharsets.UTF_8))) { + assertEquals("vertx sendFile payload", reader.readLine()); + } + + // Pre-fix: the route-handler span never finishes on the sendFile path, so the trace + // is never published and assertTraces times out waiting for the trace to flush. + assertTraces( + trace( + SORT_BY_START_TIME, + span() + .operationName(Pattern.compile(Pattern.quote("netty.request"))) + .type(DDSpanTypes.HTTP_SERVER), + span() + .childOfPrevious() + .operationName(Pattern.compile(Pattern.quote("vertx.route-handler"))) + .type(DDSpanTypes.HTTP_SERVER))); + } +} diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/test/java/server/VertxTestServer.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/test/java/server/VertxTestServer.java index 2d20d98a0ef..0110d1268da 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/test/java/server/VertxTestServer.java +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.4/src/test/java/server/VertxTestServer.java @@ -92,6 +92,7 @@ public void start(final Future startFuture) { String res = convertFormAttributes(ctx); ctx.response().setStatusCode(BODY_URLENCODED.getStatus()).end(res); })); + router.route(BODY_MULTIPART.getPath()).handler(BodyHandler.create()); router .route(BODY_MULTIPART.getPath()) .handler( @@ -100,13 +101,9 @@ public void start(final Future startFuture) { ctx, BODY_MULTIPART, () -> { - ctx.request().setExpectMultipart(true); - ctx.request() - .endHandler( - (_void) -> { - String res = convertFormAttributes(ctx); - ctx.response().setStatusCode(BODY_MULTIPART.getStatus()).end(res); - }); + ctx.fileUploads(); + String res = convertFormAttributes(ctx); + ctx.response().setStatusCode(BODY_MULTIPART.getStatus()).end(res); })); router.route(BODY_JSON.getPath()).handler(BodyHandler.create()); router diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.5/gradle.lockfile b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.5/gradle.lockfile index 3df9eb2e04c..d8cca9bb9a0 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.5/gradle.lockfile +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.5/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:vertx:vertx-web:vertx-web-3.5:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -20,15 +21,15 @@ com.fasterxml.jackson.core:jackson-databind:2.14.0=latestDepForkedTestCompileCla com.fasterxml.jackson.core:jackson-databind:2.9.0=compileClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.14.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -38,12 +39,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -79,7 +83,7 @@ io.netty:netty-resolver:4.1.89.Final=latestDepForkedTestCompileClasspath,latestD io.netty:netty-transport-native-unix-common:4.1.89.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.15.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.1.89.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.vertx:vertx-auth-common:3.5.0=compileClasspath,testCompileClasspath,testRuntimeClasspath io.vertx:vertx-auth-common:3.9.16=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-bridge-common:3.5.0=compileClasspath,testCompileClasspath,testRuntimeClasspath @@ -92,8 +96,8 @@ io.vertx:vertx-web:3.9.16=latestDepForkedTestCompileClasspath,latestDepForkedTes javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -122,6 +126,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepForkedTestRuntimeClasspath,latestDepTest org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -139,14 +144,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.9/gradle.lockfile b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.9/gradle.lockfile index 0c9a065dfd5..e83da93956b 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.9/gradle.lockfile +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-3.9/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:vertx:vertx-web:vertx-web-3.9:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -16,15 +17,15 @@ com.fasterxml.jackson.core:jackson-annotations:2.10.2=compileClasspath,latestDep com.fasterxml.jackson.core:jackson-core:2.10.2=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-databind:2.10.2=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -34,12 +35,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -62,7 +66,7 @@ io.netty:netty-handler:4.1.48.Final=compileClasspath,latestDepTestCompileClasspa io.netty:netty-resolver-dns:4.1.48.Final=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-resolver:4.1.48.Final=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.1.48.Final=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath io.vertx:vertx-auth-common:3.9.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.vertx:vertx-bridge-common:3.9.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.vertx:vertx-core:3.9.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -72,8 +76,8 @@ io.vertx:vertx-web:3.9.0=compileClasspath,latestDepTestCompileClasspath,latestDe javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -102,6 +106,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -119,14 +124,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/.gitignore b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/.gitignore new file mode 100644 index 00000000000..866a6ca4ccc --- /dev/null +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/.gitignore @@ -0,0 +1 @@ +/file-uploads/ diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/build.gradle b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/build.gradle index 096110203b4..ee305e1e172 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/build.gradle +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/build.gradle @@ -45,6 +45,8 @@ dependencies { testImplementation project(':dd-java-agent:appsec:appsec-test-fixtures') + testImplementation libs.junit.jupiter + testRuntimeOnly project(':dd-java-agent:instrumentation:jackson-core:jackson-core-common') testRuntimeOnly project(':dd-java-agent:instrumentation:netty:netty-buffer-4.0') diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/gradle.lockfile b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/gradle.lockfile index 132d43833dc..cfebc64a7c8 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:vertx:vertx-web:vertx-web-4.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,23 +9,23 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-core:2.11.3=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.18.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.18.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-core:2.21.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson:jackson-bom:2.21.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -34,12 +35,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -50,50 +54,51 @@ commons-io:commons-io:2.11.0=latestDepForkedTestCompileClasspath,latestDepForked commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -io.netty:netty-buffer:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-buffer:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-buffer:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-dns:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-dns:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-dns:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-http2:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http2:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http2:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-http:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-socks:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-socks:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-socks:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-common:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-common:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-common:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-handler-proxy:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler-proxy:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-handler-proxy:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-handler:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-handler:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-resolver-dns:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver-dns:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-resolver-dns:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-resolver:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-resolver:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-transport-native-unix-common:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.netty:netty-transport:4.1.132.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-tcnative-classes:2.0.78.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport:4.1.136.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.1.49.Final=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.vertx:vertx-auth-common:4.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-auth-common:4.5.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-auth-common:4.5.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-bridge-common:4.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-bridge-common:4.5.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-bridge-common:4.5.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-core:4.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-core:4.5.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.vertx:vertx-uri-template:4.5.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-core:4.5.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-uri-template:4.5.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-web-client:4.0.0=testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-web-client:4.5.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-web-client:4.5.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-web-common:4.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-web-common:4.5.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-web-common:4.5.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-web:4.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-web:4.5.26=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-web:4.5.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -122,6 +127,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepForkedTestRuntimeClasspath,latestDepTest org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -139,14 +145,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/latestDepTest/groovy/server/VertxHttpServerForkedTest.groovy b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/latestDepTest/groovy/server/VertxHttpServerForkedTest.groovy index 2c09d35d353..f08e9dd7fd2 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/latestDepTest/groovy/server/VertxHttpServerForkedTest.groovy +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/latestDepTest/groovy/server/VertxHttpServerForkedTest.groovy @@ -1,6 +1,8 @@ package server +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.BODY_MULTIPART import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.ERROR +import static org.junit.jupiter.api.Assumptions.assumeTrue import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.EXCEPTION import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.LOGIN import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.NOT_FOUND @@ -10,6 +12,10 @@ import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.SUCCES import datadog.trace.agent.test.asserts.TraceAssert import datadog.trace.agent.test.base.HttpServer import datadog.trace.agent.test.base.HttpServerTest +import datadog.trace.api.Config +import okhttp3.MediaType +import okhttp3.MultipartBody +import okhttp3.RequestBody import datadog.trace.api.DDSpanTypes import datadog.trace.bootstrap.instrumentation.api.Tags import datadog.trace.instrumentation.netty41.server.NettyHttpServerDecorator @@ -77,6 +83,47 @@ class VertxHttpServerForkedTest extends HttpServerTest { true } + @Override + boolean testBodyFilenames() { + true + } + + @Override + boolean testBodyFilesContent() { + true + } + + @Override + boolean testBodyFilesContentOrdering() { + false + } + + // fileUploads() returns a HashSet in Vert.x: check count instead of which specific file is excluded + def 'test instrumentation gateway file upload content max files limit count'() { + setup: + assumeTrue(testBodyFilesContent()) + def maxFilesToInspect = Config.get().getAppSecMaxFileContentCount() + def bodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM) + (1..maxFilesToInspect + 1).each { i -> + bodyBuilder.addFormDataPart("file${i}", "file${i}.bin", + RequestBody.create(MediaType.parse('application/octet-stream'), "content_of_file_${i}")) + } + def httpRequest = request(BODY_MULTIPART, 'POST', bodyBuilder.build()).build() + def response = client.newCall(httpRequest).execute() + + when: + TEST_WRITER.waitForTraces(1) + + then: + TEST_WRITER.get(0).any { span -> + def tag = span.getTag('request.body.files_content') as String + tag != null && tag.count('content_of_file_') == maxFilesToInspect + } + + cleanup: + response.close() + } + @Override boolean testBodyJson() { true diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/latestDepTest/java/server/VertxTestServer.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/latestDepTest/java/server/VertxTestServer.java index f711678b3bd..8b20617cc7c 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/latestDepTest/java/server/VertxTestServer.java +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/latestDepTest/java/server/VertxTestServer.java @@ -92,6 +92,7 @@ public void start(final Promise startPromise) { String res = convertFormAttributes(ctx); ctx.response().setStatusCode(BODY_URLENCODED.getStatus()).end(res); })); + router.route(BODY_MULTIPART.getPath()).handler(BodyHandler.create()); router .route(BODY_MULTIPART.getPath()) .handler( @@ -100,13 +101,9 @@ public void start(final Promise startPromise) { ctx, BODY_MULTIPART, () -> { - ctx.request().setExpectMultipart(true); - ctx.request() - .endHandler( - (_void) -> { - String res = convertFormAttributes(ctx); - ctx.response().setStatusCode(BODY_MULTIPART.getStatus()).end(res); - }); + ctx.fileUploads(); + String res = convertFormAttributes(ctx); + ctx.response().setStatusCode(BODY_MULTIPART.getStatus()).end(res); })); router.route(BODY_JSON.getPath()).handler(BodyHandler.create()); router diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/EndHandlerWrapper.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/EndHandlerWrapper.java index a71584b11a7..fd4a042edf8 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/EndHandlerWrapper.java +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/EndHandlerWrapper.java @@ -1,9 +1,5 @@ package datadog.trace.instrumentation.vertx_4_0.server; -import static datadog.trace.instrumentation.vertx_4_0.server.RouteHandlerWrapper.HANDLER_SPAN_CONTEXT_KEY; -import static datadog.trace.instrumentation.vertx_4_0.server.VertxDecorator.DECORATE; - -import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import io.vertx.core.Handler; import io.vertx.ext.web.RoutingContext; @@ -18,16 +14,12 @@ public class EndHandlerWrapper implements Handler { @Override public void handle(final Void event) { - AgentSpan span = routingContext.get(HANDLER_SPAN_CONTEXT_KEY); try { if (actual != null) { actual.handle(event); } } finally { - if (span != null) { - DECORATE.onResponse(span, routingContext.response()); - span.finish(); - } + RouteHandlerWrapper.finishHandlerSpan(routingContext); } } } diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/FileUploadHelper.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/FileUploadHelper.java new file mode 100644 index 00000000000..c0eef8cab2e --- /dev/null +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/FileUploadHelper.java @@ -0,0 +1,51 @@ +package datadog.trace.instrumentation.vertx_4_0.server; + +import datadog.appsec.api.blocking.BlockingException; +import datadog.trace.api.gateway.BlockResponseFunction; +import datadog.trace.api.gateway.Flow; +import datadog.trace.api.gateway.RequestContext; +import datadog.trace.api.http.MultipartContentDecoder; +import io.vertx.ext.web.FileUpload; +import java.io.FileInputStream; +import java.util.List; +import java.util.function.BiFunction; + +public class FileUploadHelper { + + public static BlockingException commitBlockingResponse( + BiFunction, Flow> cb, + RequestContext reqCtx, + List data, + String reason) { + Flow flow = cb.apply(reqCtx, data); + Flow.Action action = flow.getAction(); + if (action instanceof Flow.Action.RequestBlockingAction) { + BlockResponseFunction brf = reqCtx.getBlockResponseFunction(); + if (brf != null) { + brf.tryCommitBlockingResponse( + reqCtx.getTraceSegment(), (Flow.Action.RequestBlockingAction) action); + return new BlockingException(reason); + } + } + return null; + } + + public static String readUploadContent(FileUpload upload, int maxBytes) { + try { + String path = upload.uploadedFileName(); + if (path == null || path.isEmpty()) { + return ""; + } + String charSet = upload.charSet(); + String contentType = + charSet != null && !charSet.isEmpty() + ? upload.contentType() + "; charset=" + charSet + : upload.contentType(); + try (FileInputStream fis = new FileInputStream(path)) { + return MultipartContentDecoder.readInputStream(fis, maxBytes, contentType); + } + } catch (Exception ignored) { + return ""; + } + } +} diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/HttpServerResponseEndHandlerInstrumentation.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/HttpServerResponseEndHandlerInstrumentation.java index 5cfdf5767b2..da2d589e475 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/HttpServerResponseEndHandlerInstrumentation.java +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/HttpServerResponseEndHandlerInstrumentation.java @@ -34,7 +34,10 @@ public String[] helperClassNames() { @Override public String[] knownMatchingTypes() { return new String[] { - "io.vertx.core.http.impl.Http1xServerResponse", "io.vertx.core.http.impl.Http2ServerResponse " + "io.vertx.core.http.impl.Http1xServerResponse", + "io.vertx.core.http.impl.Http2ServerResponse", + "io.vertx.core.http.impl.http1.Http1ServerResponse", // HTTP/1 response when v >= 5.1 + "io.vertx.core.http.impl.HttpServerResponseImpl" // HTTP/2 response when v >= 5.1 }; } diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RouteHandlerWrapper.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RouteHandlerWrapper.java index 8706f816e1c..28e79e35a27 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RouteHandlerWrapper.java +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RouteHandlerWrapper.java @@ -2,13 +2,13 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activeSpan; -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopScope; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; import static datadog.trace.bootstrap.instrumentation.decorator.http.HttpResourceDecorator.HTTP_RESOURCE_DECORATOR; import static datadog.trace.instrumentation.vertx_4_0.server.VertxDecorator.DECORATE; import static datadog.trace.instrumentation.vertx_4_0.server.VertxDecorator.INSTRUMENTATION_NAME; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.appsec.api.blocking.BlockingException; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.Tags; import io.vertx.core.Handler; @@ -44,22 +44,51 @@ public void handle(final RoutingContext routingContext) { routingContext.put(HANDLER_SPAN_CONTEXT_KEY, span); routingContext.response().endHandler(new EndHandlerWrapper(routingContext)); + // Fallback finish path: HttpServerResponse.endHandler is silently skipped + // by Vert.x's Http1xServerResponse.end() when the underlying connection + // has already closed (Http1xServerResponse#end gates `endHandler.handle()` + // behind `!closed`). This happens in synthetic transports such as + // quarkus-amazon-lambda-rest's virtual Netty channel, where writes and + // close are synchronous in-memory, leaving the route-handler span unfinished + // and orphaning all jakarta-rs.request / aws.http child spans in the trace. + // RoutingContext#addEndHandler fires on routing-context completion regardless + // of underlying connection state and on both success and failure. + routingContext.addEndHandler(ar -> finishHandlerSpan(routingContext)); DECORATE.afterStart(span); span.setResourceName(DECORATE.className(actual.getClass())); } setRoute(routingContext); } - try (final AgentScope scope = span != null ? activateSpan(span) : noopScope()) { + try (final ContextScope scope = span != null ? activateSpan(span) : null) { try { actual.handle(routingContext); } catch (final Throwable t) { DECORATE.onError(span, t); + if (t instanceof BlockingException) { + // AppSec uses BlockingException as control flow after committing a blocking response + // from advice such as WafPublishingBodyHandler and RoutingContextJsonAdvice. Finish + // immediately because that abort path may bypass Vert.x response/routing end callbacks. + finishHandlerSpan(routingContext); + } throw t; } } } + // Idempotently finish the route-handler span. Both EndHandlerWrapper (the + // response.endHandler path) and the routingContext.addEndHandler fallback may call + // this; the first one to win clears HANDLER_SPAN_CONTEXT_KEY so the second is a no-op. + static void finishHandlerSpan(final RoutingContext routingContext) { + final AgentSpan span = routingContext.get(HANDLER_SPAN_CONTEXT_KEY); + if (span == null) { + return; + } + routingContext.put(HANDLER_SPAN_CONTEXT_KEY, null); + DECORATE.onResponse(span, routingContext.response()); + span.finish(); + } + private void setRoute(RoutingContext routingContext) { final AgentSpan parentSpan = routingContext.get(PARENT_SPAN_CONTEXT_KEY); if (parentSpan == null) { diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RouteMatchesAdvice.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RouteMatchesAdvice.java index f52ed53ece3..8e65add2d90 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RouteMatchesAdvice.java +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RouteMatchesAdvice.java @@ -7,7 +7,7 @@ import net.bytebuddy.asm.Advice; class RouteMatchesAdvice { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) @Source(SourceTypes.REQUEST_PATH_PARAMETER) static void after( @Advice.Return int ret, @@ -30,7 +30,7 @@ static void after( } static class BooleanReturnVariant { - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) @Source(SourceTypes.REQUEST_PATH_PARAMETER) static void after( @Advice.Return boolean ret, diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RoutingContextFilenamesAdvice.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RoutingContextFilenamesAdvice.java new file mode 100644 index 00000000000..284b8448a4f --- /dev/null +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RoutingContextFilenamesAdvice.java @@ -0,0 +1,88 @@ +package datadog.trace.instrumentation.vertx_4_0.server; + +import static datadog.trace.api.gateway.Events.EVENTS; + +import datadog.trace.advice.ActiveRequestContext; +import datadog.trace.advice.RequiresRequestContext; +import datadog.trace.api.Config; +import datadog.trace.api.gateway.CallbackProvider; +import datadog.trace.api.gateway.Flow; +import datadog.trace.api.gateway.RequestContext; +import datadog.trace.api.gateway.RequestContextSlot; +import datadog.trace.bootstrap.CallDepthThreadLocalMap; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import io.vertx.ext.web.FileUpload; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.function.BiFunction; +import net.bytebuddy.asm.Advice; + +@RequiresRequestContext(RequestContextSlot.APPSEC) +class RoutingContextFilenamesAdvice { + + @Advice.OnMethodEnter(suppress = Throwable.class) + static int before() { + return CallDepthThreadLocalMap.incrementCallDepth(FileUpload.class); + } + + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + static void after( + @Advice.Enter int depth, + @Advice.Return Collection uploads, + @ActiveRequestContext RequestContext reqCtx, + @Advice.Thrown(readOnly = false) Throwable throwable) { + CallDepthThreadLocalMap.decrementCallDepth(FileUpload.class); + if (depth != 0 || throwable != null || uploads == null || uploads.isEmpty()) { + return; + } + + CallbackProvider cbp = AgentTracer.get().getCallbackProvider(RequestContextSlot.APPSEC); + BiFunction, Flow> filenamesCb = + cbp.getCallback(EVENTS.requestFilesFilenames()); + BiFunction, Flow> contentCb = + cbp.getCallback(EVENTS.requestFilesContent()); + if (filenamesCb == null && contentCb == null) { + return; + } + + int maxFiles = Config.get().getAppSecMaxFileContentCount(); + int maxBytes = Config.get().getAppSecMaxFileContentBytes(); + List filenames = null; + List filesContent = null; + + for (FileUpload upload : uploads) { + String name = upload.fileName(); + if (filenamesCb != null && name != null && !name.isEmpty()) { + if (filenames == null) { + filenames = new ArrayList<>(); + } + filenames.add(name); + } + if (contentCb != null + && maxFiles > 0 + && (filesContent == null || filesContent.size() < maxFiles)) { + if (filesContent == null) { + filesContent = new ArrayList<>(); + } + filesContent.add(FileUploadHelper.readUploadContent(upload, maxBytes)); + } + } + + if (filenamesCb != null && filenames != null) { + throwable = + FileUploadHelper.commitBlockingResponse( + filenamesCb, reqCtx, filenames, "Blocked request (multipart file upload)"); + } + + if (throwable != null) { + return; + } + + if (contentCb != null && filesContent != null) { + throwable = + FileUploadHelper.commitBlockingResponse( + contentCb, reqCtx, filesContent, "Blocked request (file content)"); + } + } +} diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RoutingContextImplInstrumentation.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RoutingContextImplInstrumentation.java index 7a1e157e174..97623985225 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RoutingContextImplInstrumentation.java +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RoutingContextImplInstrumentation.java @@ -18,13 +18,26 @@ public class RoutingContextImplInstrumentation extends InstrumenterModule.AppSec implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { + private static final Reference FILE_UPLOAD_REF = + new Reference.Builder("io.vertx.ext.web.FileUpload") + .withMethod(new String[0], 0, "fileName", "Ljava/lang/String;") + .withMethod(new String[0], 0, "uploadedFileName", "Ljava/lang/String;") + .withMethod(new String[0], 0, "contentType", "Ljava/lang/String;") + .withMethod(new String[0], 0, "charSet", "Ljava/lang/String;") + .build(); + public RoutingContextImplInstrumentation() { super("vertx", "vertx-4.0"); } + @Override + public String[] helperClassNames() { + return new String[] {packageName + ".FileUploadHelper"}; + } + @Override public Reference[] additionalMuzzleReferences() { - return new Reference[] {VertxVersionMatcher.HTTP_1X_SERVER_RESPONSE}; + return new Reference[] {VertxVersionMatcher.HTTP_1X_SERVER_RESPONSE, FILE_UPLOAD_REF}; } @Override @@ -43,5 +56,8 @@ public void methodAdvice(MethodTransformer transformer) { transformer.applyAdvice( named("setSession").and(takesArgument(0, named("io.vertx.ext.web.Session"))), packageName + ".RoutingContextSessionAdvice"); + transformer.applyAdvice( + named("fileUploads").and(takesArguments(0)), + packageName + ".RoutingContextFilenamesAdvice"); } } diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RoutingContextJsonAdvice.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RoutingContextJsonAdvice.java index 7ecafa66981..b1699e5c8f7 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RoutingContextJsonAdvice.java +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/RoutingContextJsonAdvice.java @@ -25,7 +25,7 @@ static void before() { CallDepthThreadLocalMap.incrementCallDepth(RoutingContext.class); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) static void after( @Advice.Return Object obj_, @ActiveRequestContext RequestContext reqCtx, diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/VertxDecorator.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/VertxDecorator.java index d693e5cd70a..a4f0352e9ce 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/VertxDecorator.java +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/VertxDecorator.java @@ -55,13 +55,11 @@ protected URIDataAdapter url(final RoutingContext routingContext) { } @Override - public AgentSpan onRequest( + public void onRequest( final AgentSpan span, final RoutingContext connection, final RoutingContext routingContext, - final Context parentContext) { - return span; - } + final Context parentContext) {} @Override protected String peerHostIP(final RoutingContext routingContext) { diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/VertxVersionMatcher.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/VertxVersionMatcher.java index 7a6447f4006..e3db3b75066 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/VertxVersionMatcher.java +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/main/java/datadog/trace/instrumentation/vertx_4_0/server/VertxVersionMatcher.java @@ -6,5 +6,5 @@ public class VertxVersionMatcher { // added in 4.0 public static final Reference HTTP_1X_SERVER_RESPONSE = - new Reference.Builder("io.vertx.core.http.impl.Http1xServerResponse").build(); + new Reference.Builder("io.vertx.core.http.impl.headers.HeadersAdaptor").build(); } diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/test/groovy/server/VertxHttpServerForkedTest.groovy b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/test/groovy/server/VertxHttpServerForkedTest.groovy index e18172999ff..62455354611 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/test/groovy/server/VertxHttpServerForkedTest.groovy +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/test/groovy/server/VertxHttpServerForkedTest.groovy @@ -1,6 +1,8 @@ package server +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.BODY_MULTIPART import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.ERROR +import static org.junit.jupiter.api.Assumptions.assumeTrue import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.EXCEPTION import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.LOGIN import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.NOT_FOUND @@ -10,6 +12,10 @@ import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.SUCCES import datadog.trace.agent.test.asserts.TraceAssert import datadog.trace.agent.test.base.HttpServer import datadog.trace.agent.test.base.HttpServerTest +import datadog.trace.api.Config +import okhttp3.MediaType +import okhttp3.MultipartBody +import okhttp3.RequestBody import datadog.trace.api.DDSpanTypes import datadog.trace.bootstrap.instrumentation.api.Tags import datadog.trace.instrumentation.netty41.server.NettyHttpServerDecorator @@ -78,6 +84,47 @@ class VertxHttpServerForkedTest extends HttpServerTest { true } + @Override + boolean testBodyFilenames() { + true + } + + @Override + boolean testBodyFilesContent() { + true + } + + @Override + boolean testBodyFilesContentOrdering() { + false + } + + // fileUploads() returns a HashSet in Vert.x: check count instead of which specific file is excluded + def 'test instrumentation gateway file upload content max files limit count'() { + setup: + assumeTrue(testBodyFilesContent()) + def maxFilesToInspect = Config.get().getAppSecMaxFileContentCount() + def bodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM) + (1..maxFilesToInspect + 1).each { i -> + bodyBuilder.addFormDataPart("file${i}", "file${i}.bin", + RequestBody.create(MediaType.parse('application/octet-stream'), "content_of_file_${i}")) + } + def httpRequest = request(BODY_MULTIPART, 'POST', bodyBuilder.build()).build() + def response = client.newCall(httpRequest).execute() + + when: + TEST_WRITER.waitForTraces(1) + + then: + TEST_WRITER.get(0).any { span -> + def tag = span.getTag('request.body.files_content') as String + tag != null && tag.count('content_of_file_') == maxFilesToInspect + } + + cleanup: + response.close() + } + @Override boolean testBodyJson() { true diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/test/java/io/vertx/core/http/impl/ResponseExceptionFiringHelper.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/test/java/io/vertx/core/http/impl/ResponseExceptionFiringHelper.java new file mode 100644 index 00000000000..4754c38843e --- /dev/null +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/test/java/io/vertx/core/http/impl/ResponseExceptionFiringHelper.java @@ -0,0 +1,17 @@ +package io.vertx.core.http.impl; + +import io.vertx.core.http.HttpServerResponse; + +/** + * Test-side bridge that fires the package-private Http1xServerResponse.handleException on a Vert.x + * 4.x server response. Used by server.RouteHandlerExceptionHandlerTest to deterministically + * reproduce the non-CLOSED_EXCEPTION I/O-failure path that Vert.x exposes via + * response.exceptionHandler(...). + */ +public final class ResponseExceptionFiringHelper { + private ResponseExceptionFiringHelper() {} + + public static void fireException(HttpServerResponse response, Throwable cause) { + ((Http1xServerResponse) response).handleException(cause); + } +} diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/test/java/server/RouteHandlerExceptionHandlerTest.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/test/java/server/RouteHandlerExceptionHandlerTest.java new file mode 100644 index 00000000000..fb91f77a4b7 --- /dev/null +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/test/java/server/RouteHandlerExceptionHandlerTest.java @@ -0,0 +1,130 @@ +package server; + +import static datadog.trace.agent.test.assertions.SpanMatcher.span; +import static datadog.trace.agent.test.assertions.TraceMatcher.SORT_BY_START_TIME; +import static datadog.trace.agent.test.assertions.TraceMatcher.trace; + +import datadog.trace.agent.test.AbstractInstrumentationTest; +import datadog.trace.api.DDSpanTypes; +import io.vertx.core.Vertx; +import io.vertx.core.http.HttpServer; +import io.vertx.core.http.impl.ResponseExceptionFiringHelper; +import io.vertx.ext.web.Router; +import java.io.IOException; +import java.net.HttpURLConnection; +import java.net.ServerSocket; +import java.net.URL; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.regex.Pattern; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +/** + * Regression test for the vertx-web 4.x route-handler span lifecycle on the + * response.exceptionHandler path. + * + *

      Http1xServerResponse.handleException is invoked by Vert.x on non-CLOSED_EXCEPTION I/O failures + * of the response. Without RoutingContext.addEndHandler(...) registered, only the wrapped + * response.endHandler could finish the route-handler span — and that hook does not fire on the + * exception path. With the addEndHandler fallback in RouteHandlerWrapper, the routing context's + * internal exception handler fires our completion callback regardless of which response hook + * surfaces the error. The route handler here fires handleException directly via + * ResponseExceptionFiringHelper, then calls response.end() normally so the HTTP client gets a + * response. + */ +class RouteHandlerExceptionHandlerTest extends AbstractInstrumentationTest { + + private static Vertx vertx; + private static HttpServer server; + private static int port; + + @BeforeAll + static void startServer() throws Exception { + try (ServerSocket socket = new ServerSocket(0)) { + port = socket.getLocalPort(); + } + + vertx = Vertx.vertx(); + Router router = Router.router(vertx); + router + .route("/fail") + .handler( + ctx -> { + ResponseExceptionFiringHelper.fireException( + ctx.response(), new IOException("simulated response I/O failure")); + try { + ctx.response().setStatusCode(500).end("error"); + } catch (IllegalStateException ignore) { + // handleException may have left the response in a state where end() is rejected; + // the span is already finished by our addEndHandler callback. + } + }); + + CountDownLatch ready = new CountDownLatch(1); + server = + vertx + .createHttpServer() + .requestHandler(router) + .listen( + port, + result -> { + if (result.failed()) { + throw new RuntimeException("Failed to start Vert.x server", result.cause()); + } + ready.countDown(); + }); + if (!ready.await(10, TimeUnit.SECONDS)) { + throw new IllegalStateException("Vert.x server did not start in time"); + } + } + + @AfterAll + static void stopServer() throws Exception { + if (server != null) { + CountDownLatch closed = new CountDownLatch(1); + server.close(ar -> closed.countDown()); + closed.await(10, TimeUnit.SECONDS); + } + if (vertx != null) { + CountDownLatch closed = new CountDownLatch(1); + vertx.close(ar -> closed.countDown()); + closed.await(10, TimeUnit.SECONDS); + } + } + + @Test + void exceptionHandlerFinishesRouteHandlerSpan() throws Exception { + HttpURLConnection conn = + (HttpURLConnection) new URL("http://localhost:" + port + "/fail").openConnection(); + conn.setRequestMethod("GET"); + conn.setConnectTimeout(5000); + conn.setReadTimeout(5000); + try { + // We don't care about the response code or body — only that the trace flushes. + conn.getResponseCode(); + } catch (IOException ignore) { + // If end() was rejected after handleException, the client may see a closed connection. + } finally { + conn.disconnect(); + } + + // If addEndHandler did not finish the route-handler span, assertTraces would time out + // waiting for the trace to flush. + // The netty.request span is marked as errored because the route handler ends with + // HTTP 500; the route-handler span is finished by our addEndHandler callback before + // setStatusCode(500), so it sees status=200 (default) and is not errored. + assertTraces( + trace( + SORT_BY_START_TIME, + span() + .operationName(Pattern.compile(Pattern.quote("netty.request"))) + .type(DDSpanTypes.HTTP_SERVER) + .error(), + span() + .childOfPrevious() + .operationName(Pattern.compile(Pattern.quote("vertx.route-handler"))) + .type(DDSpanTypes.HTTP_SERVER))); + } +} diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/test/java/server/VertxTestServer.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/test/java/server/VertxTestServer.java index d4dc482cb2a..53c8236ef78 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/test/java/server/VertxTestServer.java +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-4.0/src/test/java/server/VertxTestServer.java @@ -39,13 +39,6 @@ public class VertxTestServer extends AbstractVerticle { public static final String CONFIG_HTTP_SERVER_PORT = "http.server.port"; public static final String PORT_DATA_ADDRESS = "PORT_DATA"; - int fibonacci(int n) { - if (n <= 1) { - return n; - } - return fibonacci(n - 1) + fibonacci(n - 2); - } - @Override public void start(final Promise startPromise) { final int port = config().getInteger(CONFIG_HTTP_SERVER_PORT); @@ -60,10 +53,8 @@ public void start(final Promise startPromise) { controller( ctx, SUCCESS, - () -> { - fibonacci(40); - ctx.response().setStatusCode(SUCCESS.getStatus()).end(SUCCESS.getBody()); - })); + () -> + ctx.response().setStatusCode(SUCCESS.getStatus()).end(SUCCESS.getBody()))); router .route(FORWARDED.getPath()) .handler( @@ -101,6 +92,7 @@ public void start(final Promise startPromise) { String res = convertFormAttributes(ctx); ctx.response().setStatusCode(BODY_URLENCODED.getStatus()).end(res); })); + router.route(BODY_MULTIPART.getPath()).handler(BodyHandler.create()); router .route(BODY_MULTIPART.getPath()) .handler( @@ -109,13 +101,9 @@ public void start(final Promise startPromise) { ctx, BODY_MULTIPART, () -> { - ctx.request().setExpectMultipart(true); - ctx.request() - .endHandler( - (_void) -> { - String res = convertFormAttributes(ctx); - ctx.response().setStatusCode(BODY_MULTIPART.getStatus()).end(res); - }); + ctx.fileUploads(); + String res = convertFormAttributes(ctx); + ctx.response().setStatusCode(BODY_MULTIPART.getStatus()).end(res); })); router.route(BODY_JSON.getPath()).handler(BodyHandler.create()); router diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/.gitignore b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/.gitignore new file mode 100644 index 00000000000..866a6ca4ccc --- /dev/null +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/.gitignore @@ -0,0 +1 @@ +/file-uploads/ diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/build.gradle b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/build.gradle index 3470f74a725..fb61a90836b 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/build.gradle +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/build.gradle @@ -60,3 +60,14 @@ tasks.named("compileJava", JavaCompile) { configureCompiler(it, 11, JavaVersion.VERSION_1_8) } +// TEMPORARILY exclude iast tests from latest Dep at the compile level because it fails with vertx 5.1 +// (types HeadersMultiMap and Http2HeadersAdaptor were (re)moved) +// TODO for AppSec team: remove this section, run `./gradlew :dd-java-agent:instrumentation:vertx:vertx-web:vertx-web-5.0:latestDepTest`, see errors and fix them. +["compileLatestDepTestGroovy", "compileLatestDepForkedTestGroovy"].each { + tasks.named(it, GroovyCompile) { + exclude("core/MultiMapInstrumentationTest.groovy") + exclude("core/BufferInstrumentationTest.groovy") + exclude("server/Iast*.groovy") + } +} + diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/gradle.lockfile b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/gradle.lockfile index cd9e6db887f..3b1543b2d95 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:vertx:vertx-web:vertx-web-5.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,24 +9,24 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.fasterxml.jackson.core:jackson-core:2.16.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.18.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson.core:jackson-core:2.21.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.16.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.18.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +com.fasterxml.jackson:jackson-bom:2.21.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -52,58 +56,62 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.netty:netty-buffer:4.2.0.RC1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-buffer:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-buffer:4.2.16.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-base:4.2.0.RC1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-base:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-base:4.2.16.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-classes-quic:4.2.16.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-compression:4.2.0.RC1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-compression:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-compression:4.2.16.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-dns:4.2.0.RC1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-dns:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-dns:4.2.16.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http2:4.2.0.RC1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-http2:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http2:4.2.16.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http3:4.2.16.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-http:4.2.0.RC1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-http:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-http:4.2.16.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec-marshalling:4.2.0.RC1=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-codec-protobuf:4.2.0.RC1=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-codec-socks:4.2.0.RC1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec-socks:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-codec-socks:4.2.16.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-codec:4.2.0.RC1=compileClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-common:4.2.0.RC1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-common:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-common:4.2.16.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-handler-proxy:4.2.0.RC1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-handler-proxy:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler-proxy:4.2.16.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-handler:4.2.0.RC1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-handler:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-handler:4.2.16.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-resolver-dns:4.2.0.RC1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-resolver-dns:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver-dns:4.2.16.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-resolver:4.2.0.RC1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-resolver:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-resolver:4.2.16.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-tcnative-classes:2.0.78.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport-native-unix-common:4.2.0.RC1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-transport-native-unix-common:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.2.16.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.netty:netty-transport:4.2.0.RC1=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.netty:netty-transport:4.2.12.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.netty:netty-transport:4.2.16.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.vertx:vertx-auth-common:5.0.0.CR3=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-auth-common:5.0.11=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-auth-common:5.1.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-bridge-common:5.0.0.CR3=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-bridge-common:5.0.11=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-bridge-common:5.1.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-core-logging:5.0.0.CR3=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-core-logging:5.0.11=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-core-logging:5.1.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-core:5.0.0.CR3=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-core:5.0.11=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-core:5.1.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-eventbus-bridge-common:5.1.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-uri-template:5.0.0.CR3=testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-uri-template:5.0.11=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-uri-template:5.1.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-web-client:5.0.0.CR3=testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-web-client:5.0.11=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-web-client:5.1.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-web-common:5.0.0.CR3=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-web-common:5.0.11=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-web-common:5.1.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.vertx:vertx-web:5.0.0.CR3=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.vertx:vertx-web:5.0.11=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.vertx:vertx-web:5.1.5=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -132,6 +140,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepForkedTestRuntimeClasspath,latestDepTest org.hamcrest:hamcrest:3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -149,14 +158,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/src/main/java/datadog/trace/instrumentation/vertx_5_0/server/FileUploadHelper.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/src/main/java/datadog/trace/instrumentation/vertx_5_0/server/FileUploadHelper.java new file mode 100644 index 00000000000..045d825444a --- /dev/null +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/src/main/java/datadog/trace/instrumentation/vertx_5_0/server/FileUploadHelper.java @@ -0,0 +1,51 @@ +package datadog.trace.instrumentation.vertx_5_0.server; + +import datadog.appsec.api.blocking.BlockingException; +import datadog.trace.api.gateway.BlockResponseFunction; +import datadog.trace.api.gateway.Flow; +import datadog.trace.api.gateway.RequestContext; +import datadog.trace.api.http.MultipartContentDecoder; +import io.vertx.ext.web.FileUpload; +import java.io.FileInputStream; +import java.util.List; +import java.util.function.BiFunction; + +public class FileUploadHelper { + + public static BlockingException commitBlockingResponse( + BiFunction, Flow> cb, + RequestContext reqCtx, + List data, + String reason) { + Flow flow = cb.apply(reqCtx, data); + Flow.Action action = flow.getAction(); + if (action instanceof Flow.Action.RequestBlockingAction) { + BlockResponseFunction brf = reqCtx.getBlockResponseFunction(); + if (brf != null) { + brf.tryCommitBlockingResponse( + reqCtx.getTraceSegment(), (Flow.Action.RequestBlockingAction) action); + return new BlockingException(reason); + } + } + return null; + } + + public static String readUploadContent(FileUpload upload, int maxBytes) { + try { + String path = upload.uploadedFileName(); + if (path == null || path.isEmpty()) { + return ""; + } + String charSet = upload.charSet(); + String contentType = + charSet != null && !charSet.isEmpty() + ? upload.contentType() + "; charset=" + charSet + : upload.contentType(); + try (FileInputStream fis = new FileInputStream(path)) { + return MultipartContentDecoder.readInputStream(fis, maxBytes, contentType); + } + } catch (Exception ignored) { + return ""; + } + } +} diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/src/main/java/datadog/trace/instrumentation/vertx_5_0/server/RoutingContextFilenamesAdvice.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/src/main/java/datadog/trace/instrumentation/vertx_5_0/server/RoutingContextFilenamesAdvice.java new file mode 100644 index 00000000000..189fd6cd0f7 --- /dev/null +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/src/main/java/datadog/trace/instrumentation/vertx_5_0/server/RoutingContextFilenamesAdvice.java @@ -0,0 +1,87 @@ +package datadog.trace.instrumentation.vertx_5_0.server; + +import static datadog.trace.api.gateway.Events.EVENTS; + +import datadog.trace.advice.ActiveRequestContext; +import datadog.trace.advice.RequiresRequestContext; +import datadog.trace.api.Config; +import datadog.trace.api.gateway.CallbackProvider; +import datadog.trace.api.gateway.Flow; +import datadog.trace.api.gateway.RequestContext; +import datadog.trace.api.gateway.RequestContextSlot; +import datadog.trace.bootstrap.CallDepthThreadLocalMap; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import io.vertx.ext.web.FileUpload; +import java.util.ArrayList; +import java.util.List; +import java.util.function.BiFunction; +import net.bytebuddy.asm.Advice; + +@RequiresRequestContext(RequestContextSlot.APPSEC) +class RoutingContextFilenamesAdvice { + + @Advice.OnMethodEnter(suppress = Throwable.class) + static int before() { + return CallDepthThreadLocalMap.incrementCallDepth(FileUpload.class); + } + + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) + static void after( + @Advice.Enter int depth, + @Advice.Return List uploads, + @ActiveRequestContext RequestContext reqCtx, + @Advice.Thrown(readOnly = false) Throwable throwable) { + CallDepthThreadLocalMap.decrementCallDepth(FileUpload.class); + if (depth != 0 || throwable != null || uploads == null || uploads.isEmpty()) { + return; + } + + CallbackProvider cbp = AgentTracer.get().getCallbackProvider(RequestContextSlot.APPSEC); + BiFunction, Flow> filenamesCb = + cbp.getCallback(EVENTS.requestFilesFilenames()); + BiFunction, Flow> contentCb = + cbp.getCallback(EVENTS.requestFilesContent()); + if (filenamesCb == null && contentCb == null) { + return; + } + + int maxFiles = Config.get().getAppSecMaxFileContentCount(); + int maxBytes = Config.get().getAppSecMaxFileContentBytes(); + List filenames = null; + List filesContent = null; + + for (FileUpload upload : uploads) { + String name = upload.fileName(); + if (filenamesCb != null && name != null && !name.isEmpty()) { + if (filenames == null) { + filenames = new ArrayList<>(); + } + filenames.add(name); + } + if (contentCb != null + && maxFiles > 0 + && (filesContent == null || filesContent.size() < maxFiles)) { + if (filesContent == null) { + filesContent = new ArrayList<>(); + } + filesContent.add(FileUploadHelper.readUploadContent(upload, maxBytes)); + } + } + + if (filenamesCb != null && filenames != null) { + throwable = + FileUploadHelper.commitBlockingResponse( + filenamesCb, reqCtx, filenames, "Blocked request (multipart file upload)"); + } + + if (throwable != null) { + return; + } + + if (contentCb != null && filesContent != null) { + throwable = + FileUploadHelper.commitBlockingResponse( + contentCb, reqCtx, filesContent, "Blocked request (file content)"); + } + } +} diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/src/main/java/datadog/trace/instrumentation/vertx_5_0/server/RoutingContextImplInstrumentation.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/src/main/java/datadog/trace/instrumentation/vertx_5_0/server/RoutingContextImplInstrumentation.java new file mode 100644 index 00000000000..627d7798f9e --- /dev/null +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/src/main/java/datadog/trace/instrumentation/vertx_5_0/server/RoutingContextImplInstrumentation.java @@ -0,0 +1,48 @@ +package datadog.trace.instrumentation.vertx_5_0.server; + +import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; +import static net.bytebuddy.matcher.ElementMatchers.takesArguments; + +import com.google.auto.service.AutoService; +import datadog.trace.agent.tooling.Instrumenter; +import datadog.trace.agent.tooling.InstrumenterModule; +import datadog.trace.agent.tooling.muzzle.Reference; + +@AutoService(InstrumenterModule.class) +public class RoutingContextImplInstrumentation extends InstrumenterModule.AppSec + implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { + + private static final Reference FILE_UPLOAD_REF = + new Reference.Builder("io.vertx.ext.web.FileUpload") + .withMethod(new String[0], 0, "fileName", "Ljava/lang/String;") + .withMethod(new String[0], 0, "uploadedFileName", "Ljava/lang/String;") + .withMethod(new String[0], 0, "contentType", "Ljava/lang/String;") + .withMethod(new String[0], 0, "charSet", "Ljava/lang/String;") + .build(); + + public RoutingContextImplInstrumentation() { + super("vertx", "vertx-5.0"); + } + + @Override + public String[] helperClassNames() { + return new String[] {packageName + ".FileUploadHelper"}; + } + + @Override + public String instrumentedType() { + return "io.vertx.ext.web.impl.RoutingContextImpl"; + } + + @Override + public Reference[] additionalMuzzleReferences() { + return new Reference[] {VertxVersionMatcher.HTTP_HEADERS_INTERNAL, FILE_UPLOAD_REF}; + } + + @Override + public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvice( + named("fileUploads").and(takesArguments(0)), + packageName + ".RoutingContextFilenamesAdvice"); + } +} diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/src/test/groovy/server/VertxHttpServerForkedTest.groovy b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/src/test/groovy/server/VertxHttpServerForkedTest.groovy index 261430c0023..cdd4bca1c19 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/src/test/groovy/server/VertxHttpServerForkedTest.groovy +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/src/test/groovy/server/VertxHttpServerForkedTest.groovy @@ -1,6 +1,9 @@ package server +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.BODY_JSON +import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.BODY_MULTIPART import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.ERROR +import static org.junit.jupiter.api.Assumptions.assumeTrue import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.EXCEPTION import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.LOGIN import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.NOT_FOUND @@ -10,6 +13,10 @@ import static datadog.trace.agent.test.base.HttpServerTest.ServerEndpoint.SUCCES import datadog.trace.agent.test.asserts.TraceAssert import datadog.trace.agent.test.base.HttpServer import datadog.trace.agent.test.base.HttpServerTest +import datadog.trace.api.Config +import okhttp3.MediaType +import okhttp3.MultipartBody +import okhttp3.RequestBody import datadog.trace.api.DDSpanTypes import datadog.trace.bootstrap.instrumentation.api.Tags import datadog.trace.instrumentation.netty41.server.NettyHttpServerDecorator @@ -82,6 +89,47 @@ class VertxHttpServerForkedTest extends HttpServerTest { true } + @Override + boolean testBodyFilenames() { + true + } + + @Override + boolean testBodyFilesContent() { + true + } + + @Override + boolean testBodyFilesContentOrdering() { + false + } + + // fileUploads() returns a HashSet in Vert.x: check count instead of which specific file is excluded + def 'test instrumentation gateway file upload content max files limit count'() { + setup: + assumeTrue(testBodyFilesContent()) + def maxFilesToInspect = Config.get().getAppSecMaxFileContentCount() + def bodyBuilder = new MultipartBody.Builder().setType(MultipartBody.FORM) + (1..maxFilesToInspect + 1).each { i -> + bodyBuilder.addFormDataPart("file${i}", "file${i}.bin", + RequestBody.create(MediaType.parse('application/octet-stream'), "content_of_file_${i}")) + } + def httpRequest = request(BODY_MULTIPART, 'POST', bodyBuilder.build()).build() + def response = client.newCall(httpRequest).execute() + + when: + TEST_WRITER.waitForTraces(1) + + then: + TEST_WRITER.get(0).any { span -> + def tag = span.getTag('request.body.files_content') as String + tag != null && tag.count('content_of_file_') == maxFilesToInspect + } + + cleanup: + response.close() + } + @Override boolean testBodyJson() { true @@ -176,4 +224,28 @@ class VertxHttpServerWorkerForkedTest extends VertxHttpServerForkedTest { HttpServer server() { return new VertxServer(verticle(), routerBasePath(), true) } + + def 'test blocking of JSON request body finishes route handler span'() { + setup: + // VertxTestServer handles BODY_JSON by calling ctx.body().asJsonObject(). + // The IG_BODY_CONVERTED_HEADER is consumed by HttpServerTest's AppSec test callback, which + // returns a RequestBlockingAction from requestBodyProcessed() when that JSON body is converted. + def request = request( + BODY_JSON, 'POST', + RequestBody.create(MediaType.get('application/json'), '{"a": "x"}')) + .header(IG_BODY_CONVERTED_HEADER, 'true') + .build() + + when: + def response = client.newCall(request).execute() + + then: + response.code() == 413 + response.body().charStream().text.contains('"title":"You\'ve been blocked"') + !handlerRan + // The client receiving a 413 only proves the blocking response was committed. + // We want to make sure that a BlockingException does now abort the worker route handler + // before the vertx.route-handler span has been finished (which would leave it dangling) + TEST_WRITER.waitForTraces(1) + } } diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/src/test/java/server/HttpServerResponseEndHandlerInstrumentationTest.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/src/test/java/server/HttpServerResponseEndHandlerInstrumentationTest.java new file mode 100644 index 00000000000..25201f3e872 --- /dev/null +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/src/test/java/server/HttpServerResponseEndHandlerInstrumentationTest.java @@ -0,0 +1,179 @@ +package server; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assumptions.assumeTrue; + +import datadog.trace.agent.test.AbstractInstrumentationTest; +import io.vertx.core.Handler; +import io.vertx.core.Vertx; +import io.vertx.core.buffer.Buffer; +import io.vertx.core.http.HttpClient; +import io.vertx.core.http.HttpClientOptions; +import io.vertx.core.http.HttpClientResponse; +import io.vertx.core.http.HttpMethod; +import io.vertx.core.http.HttpServer; +import io.vertx.core.http.HttpServerOptions; +import io.vertx.core.http.HttpServerResponse; +import io.vertx.core.http.HttpVersion; +import io.vertx.ext.web.Router; +import java.io.InputStream; +import java.lang.reflect.Field; +import java.net.HttpURLConnection; +import java.net.ServerSocket; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class HttpServerResponseEndHandlerInstrumentationTest extends AbstractInstrumentationTest { + private static final String HTTP1_RESPONSE = "io.vertx.core.http.impl.http1.Http1ServerResponse"; + private static final String HTTP2_RESPONSE = "io.vertx.core.http.impl.HttpServerResponseImpl"; + private static final String END_HANDLER_WRAPPER = + "datadog.trace.instrumentation.vertx_4_0.server.EndHandlerWrapper"; + + private static Vertx vertx; + private static HttpServer server; + private static int port; + + @BeforeAll + static void startServer() throws Exception { + try (ServerSocket socket = new ServerSocket(0)) { + port = socket.getLocalPort(); + } + + vertx = Vertx.vertx(); + Router router = Router.router(vertx); + router + .route("/end-handler-wrapper") + .handler(HttpServerResponseEndHandlerInstrumentationTest::handle); + + CountDownLatch ready = new CountDownLatch(1); + vertx + .createHttpServer(new HttpServerOptions().setHttp2ClearTextEnabled(true)) + .requestHandler(router) + .listen(port) + .andThen( + result -> { + if (result.failed()) { + throw new RuntimeException("Failed to start Vert.x server", result.cause()); + } + server = result.result(); + ready.countDown(); + }); + if (!ready.await(10, TimeUnit.SECONDS)) { + throw new IllegalStateException("Vert.x server did not start in time"); + } + } + + @AfterAll + static void stopServer() throws Exception { + if (server != null) { + CountDownLatch closed = new CountDownLatch(1); + server.close().andThen(ar -> closed.countDown()); + closed.await(10, TimeUnit.SECONDS); + } + if (vertx != null) { + CountDownLatch closed = new CountDownLatch(1); + vertx.close().andThen(ar -> closed.countDown()); + closed.await(10, TimeUnit.SECONDS); + } + } + + @Test + void wrapsApplicationEndHandlerOnVertx51Http1Response() throws Exception { + assumeTrue(hasVertx51Http1Response(), "Http1ServerResponse exists only in Vert.x 5.1+"); + + HttpURLConnection conn = + (HttpURLConnection) + new URL("http://localhost:" + port + "/end-handler-wrapper").openConnection(); + conn.setRequestMethod("GET"); + conn.setConnectTimeout(5000); + conn.setReadTimeout(5000); + + int responseCode = conn.getResponseCode(); + InputStream responseStream = + responseCode >= 400 ? conn.getErrorStream() : conn.getInputStream(); + String body = new String(responseStream.readAllBytes(), StandardCharsets.UTF_8); + conn.disconnect(); + + assertWrapped(responseCode, body, HTTP1_RESPONSE); + } + + @Test + void wrapsApplicationEndHandlerOnVertx51Http2Response() throws Exception { + assumeTrue(hasVertx51Http2Response(), "HttpServerResponseImpl exists only in Vert.x 5.1+"); + + HttpClient client = + vertx.createHttpClient( + new HttpClientOptions() + .setProtocolVersion(HttpVersion.HTTP_2) + .setHttp2ClearTextUpgrade(false)); + try { + HttpClientResponse response = + client + .request(HttpMethod.GET, port, "localhost", "/end-handler-wrapper") + .compose(request -> request.send()) + .toCompletionStage() + .toCompletableFuture() + .get(10, TimeUnit.SECONDS); + Buffer body = + response.body().toCompletionStage().toCompletableFuture().get(10, TimeUnit.SECONDS); + + assertWrapped(response.statusCode(), body.toString(StandardCharsets.UTF_8), HTTP2_RESPONSE); + } finally { + client.close().toCompletionStage().toCompletableFuture().get(10, TimeUnit.SECONDS); + } + } + + private static boolean hasVertx51Http1Response() { + return hasClass(HTTP1_RESPONSE); + } + + private static boolean hasVertx51Http2Response() { + return hasClass(HTTP2_RESPONSE); + } + + private static boolean hasClass(String className) { + try { + Class.forName(className); + return true; + } catch (ClassNotFoundException ignored) { + return false; + } + } + + private static void assertWrapped(int responseCode, String body, String expectedResponseClass) { + assertEquals(200, responseCode, body); + assertTrue(body.contains("response=" + expectedResponseClass), body); + assertTrue(body.contains("endHandler=" + END_HANDLER_WRAPPER), body); + } + + private static void handle(io.vertx.ext.web.RoutingContext ctx) { + HttpServerResponse response = ctx.response(); + Handler applicationEndHandler = ignored -> {}; + response.endHandler(applicationEndHandler); + + String responseClassName = response.getClass().getName(); + Object installedEndHandler; + try { + Field endHandler = response.getClass().getDeclaredField("endHandler"); + endHandler.setAccessible(true); + installedEndHandler = endHandler.get(response); + } catch (ReflectiveOperationException e) { + throw new AssertionError("Could not inspect Vert.x response endHandler field", e); + } + + String installedClassName = + installedEndHandler == null ? "" : installedEndHandler.getClass().getName(); + boolean wrapped = + (HTTP1_RESPONSE.equals(responseClassName) || HTTP2_RESPONSE.equals(responseClassName)) + && END_HANDLER_WRAPPER.equals(installedClassName); + response + .setStatusCode(wrapped ? 200 : 500) + .end("response=" + responseClassName + "\nendHandler=" + installedClassName + "\n"); + } +} diff --git a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/src/test/java/server/VertxTestServer.java b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/src/test/java/server/VertxTestServer.java index 17feffcc79f..24902867163 100644 --- a/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/src/test/java/server/VertxTestServer.java +++ b/dd-java-agent/instrumentation/vertx/vertx-web/vertx-web-5.0/src/test/java/server/VertxTestServer.java @@ -92,6 +92,7 @@ public void start(final Promise startPromise) { String res = convertFormAttributes(ctx); ctx.response().setStatusCode(BODY_URLENCODED.getStatus()).end(res); })); + router.route(BODY_MULTIPART.getPath()).handler(BodyHandler.create()); router .route(BODY_MULTIPART.getPath()) .handler( @@ -100,13 +101,9 @@ public void start(final Promise startPromise) { ctx, BODY_MULTIPART, () -> { - ctx.request().setExpectMultipart(true); - ctx.request() - .endHandler( - (_void) -> { - String res = convertFormAttributes(ctx); - ctx.response().setStatusCode(BODY_MULTIPART.getStatus()).end(res); - }); + ctx.fileUploads(); + String res = convertFormAttributes(ctx); + ctx.response().setStatusCode(BODY_MULTIPART.getStatus()).end(res); })); router.route(BODY_JSON.getPath()).handler(BodyHandler.create()); router diff --git a/dd-java-agent/instrumentation/weaver-0.9/gradle.lockfile b/dd-java-agent/instrumentation/weaver-0.9/gradle.lockfile index c12406c9046..c938cceef95 100644 --- a/dd-java-agent/instrumentation/weaver-0.9/gradle.lockfile +++ b/dd-java-agent/instrumentation/weaver-0.9/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:weaver-0.9:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath @@ -10,7 +11,7 @@ co.fs2:fs2-core_3:3.13.0=latestDepTestCompileClasspath,latestDepTestRuntimeClass com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath @@ -28,15 +29,15 @@ com.fasterxml.jackson.core:jackson-core:2.20.0=latestDepTestCompileClasspath,lat com.fasterxml.jackson.core:jackson-databind:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath,weaver084TestAnnotationProcessor,weaver084TestCompileClasspath @@ -46,12 +47,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,weaver084TestAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,weaver084TestAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,weaver084TestAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,weaver084TestAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath,weaver084TestAnnotationProcessor,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor,weaver084TestAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath com.jayway.jsonpath:json-path:2.8.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath @@ -65,16 +69,15 @@ commons-fileupload:commons-fileupload:1.5=latestDepTestCompileClasspath,latestDe commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath net.minidev:accessors-smart:2.4.9=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath net.minidev:json-smart:2.4.10=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath @@ -103,18 +106,19 @@ org.codehaus.groovy:groovy:3.0.25=latestDepTestCompileClasspath,latestDepTestRun org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.freemarker:freemarker:2.3.31=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath -org.jacoco:org.jacoco.core:0.8.14=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath -org.jacoco:org.jacoco.report:0.8.14=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath +org.jacoco:org.jacoco.core:0.8.15=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath +org.jacoco:org.jacoco.report:0.8.15=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath @@ -134,50 +138,48 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath,weaver084TestRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath org.portable-scala:portable-scala-reflect_2.13:1.1.2=compileClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath org.portable-scala:portable-scala-reflect_2.13:1.1.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=zinc org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.13.12=compileClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath -org.scala-lang:scala-library:2.13.15=zinc -org.scala-lang:scala-library:2.13.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.scala-lang:scala-library:2.13.16=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,zinc org.scala-lang:scala-reflect:2.13.12=compileClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath -org.scala-lang:scala-reflect:2.13.15=zinc -org.scala-lang:scala-reflect:2.13.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.scala-lang:scala-reflect:2.13.16=zinc org.scala-lang:scala3-library_3:3.3.3=compileClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath org.scala-lang:scala3-library_3:3.3.7=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc org.scala-sbt:test-interface:1.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.scodec:scodec-bits_3:1.1.38=compileClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath org.scodec:scodec-bits_3:1.2.4=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.skyscreamer:jsonassert:1.5.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath @@ -206,13 +208,13 @@ org.typelevel:cats-kernel_3:2.10.0=compileClasspath,testCompileClasspath,testRun org.typelevel:cats-kernel_3:2.13.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.typelevel:cats-mtl_3:1.6.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.typelevel:scalac-compat-annotation_3:0.1.4=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath -org.typelevel:weaver-cats-core_3:0.12.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.typelevel:weaver-cats-core_3:0.13.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.typelevel:weaver-cats-core_3:0.9.0=compileClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath -org.typelevel:weaver-cats_3:0.12.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.typelevel:weaver-cats_3:0.13.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.typelevel:weaver-cats_3:0.9.0=compileClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath -org.typelevel:weaver-core_3:0.12.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.typelevel:weaver-core_3:0.13.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.typelevel:weaver-core_3:0.9.0=compileClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath -org.typelevel:weaver-framework_3:0.12.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.typelevel:weaver-framework_3:0.13.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.typelevel:weaver-framework_3:0.9.0=compileClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs org.xmlunit:xmlunit-core:2.10.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,weaver084TestCompileClasspath,weaver084TestRuntimeClasspath diff --git a/dd-java-agent/instrumentation/weaver-0.9/src/main/java/datadog/trace/instrumentation/weaver/WeaverInstrumentation.java b/dd-java-agent/instrumentation/weaver-0.9/src/main/java/datadog/trace/instrumentation/weaver/WeaverInstrumentation.java index fe8e60e4fd2..be033fb009a 100644 --- a/dd-java-agent/instrumentation/weaver-0.9/src/main/java/datadog/trace/instrumentation/weaver/WeaverInstrumentation.java +++ b/dd-java-agent/instrumentation/weaver-0.9/src/main/java/datadog/trace/instrumentation/weaver/WeaverInstrumentation.java @@ -1,12 +1,12 @@ package datadog.trace.instrumentation.weaver; +import static datadog.trace.agent.tooling.bytebuddy.matcher.NameMatchers.named; import static net.bytebuddy.matcher.ElementMatchers.isConstructor; +import static net.bytebuddy.matcher.ElementMatchers.takesArgument; import com.google.auto.service.AutoService; import datadog.trace.agent.tooling.Instrumenter; import datadog.trace.agent.tooling.InstrumenterModule; -import de.thetaphi.forbiddenapis.SuppressForbidden; -import java.lang.reflect.Field; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.LinkedBlockingQueue; import net.bytebuddy.asm.Advice; @@ -38,34 +38,34 @@ public String[] helperClassNames() { @Override public void methodAdvice(MethodTransformer transformer) { + // disneystreaming/weaver-test (0.8.4+) uses a ConcurrentLinkedQueue transformer.applyAdvice( - isConstructor(), WeaverInstrumentation.class.getName() + "$SbtTaskCreationAdvice"); + isConstructor().and(takesArgument(5, named("java.util.concurrent.ConcurrentLinkedQueue"))), + WeaverInstrumentation.class.getName() + "$ConcurrentLinkedQueueAdvice"); + // typelevel/weaver-test (0.9+) uses a LinkedBlockingQueue + transformer.applyAdvice( + isConstructor().and(takesArgument(5, named("java.util.concurrent.LinkedBlockingQueue"))), + WeaverInstrumentation.class.getName() + "$LinkedBlockingQueueAdvice"); + } + + public static class ConcurrentLinkedQueueAdvice { + @Advice.OnMethodEnter(suppress = Throwable.class) + public static void wrapQueue( + @Advice.Argument(0) TaskDef taskDef, + @Advice.Argument(value = 5, readOnly = false) ConcurrentLinkedQueue queue) { + if (!(queue instanceof TaskDefAwareConcurrentLinkedQueueProxy)) { + queue = new TaskDefAwareConcurrentLinkedQueueProxy<>(taskDef, queue); + } + } } - public static class SbtTaskCreationAdvice { - // TODO: JEP 500 - avoid mutating final fields - @SuppressForbidden - @Advice.OnMethodExit(suppress = Throwable.class) - public static void onTaskCreation( - @Advice.This Object sbtTask, @Advice.FieldValue("taskDef") TaskDef taskDef) { - try { - Field queueField = sbtTask.getClass().getDeclaredField("queue"); - queueField.setAccessible(true); - Object queue = queueField.get(sbtTask); - if (queue instanceof ConcurrentLinkedQueue) { - // disney's implementation (0.8.4+) uses a ConcurrentLinkedQueue for the field - queueField.set( - sbtTask, - new TaskDefAwareConcurrentLinkedQueueProxy( - taskDef, (ConcurrentLinkedQueue) queue)); - } else if (queue instanceof LinkedBlockingQueue) { - // typelevel's implementation (0.9+) uses a LinkedBlockingQueue for the field - queueField.set( - sbtTask, - new TaskDefAwareLinkedBlockingQueueProxy( - taskDef, (LinkedBlockingQueue) queue)); - } - } catch (Exception ignored) { + public static class LinkedBlockingQueueAdvice { + @Advice.OnMethodEnter(suppress = Throwable.class) + public static void wrapQueue( + @Advice.Argument(0) TaskDef taskDef, + @Advice.Argument(value = 5, readOnly = false) LinkedBlockingQueue queue) { + if (!(queue instanceof TaskDefAwareLinkedBlockingQueueProxy)) { + queue = new TaskDefAwareLinkedBlockingQueueProxy<>(taskDef, queue); } } } diff --git a/dd-java-agent/instrumentation/websocket/jakarta-websocket-2.0/build.gradle b/dd-java-agent/instrumentation/websocket/jakarta-websocket-2.0/build.gradle index 326c397a648..8b3bacba81f 100644 --- a/dd-java-agent/instrumentation/websocket/jakarta-websocket-2.0/build.gradle +++ b/dd-java-agent/instrumentation/websocket/jakarta-websocket-2.0/build.gradle @@ -22,10 +22,12 @@ dependencies { testRuntimeOnly project(":dd-java-agent:instrumentation:websocket:javax-websocket-1.0") testImplementation group: 'org.glassfish.tyrus', name: 'tyrus-container-inmemory', version: '2.0.0' - // `tyrus 2.3.0-M1` pulls `grizzly 5.0.0`, whose POM imports a missing `grizzly-bom 5.0.0-SNAPSHOT`. - // See issue: https://github.com/eclipse-ee4j/glassfish-grizzly/issues/2278 - // This fix must be revisited once correct version of `grizzly-bom` will be released. - latestDepTestImplementation group: 'org.glassfish.tyrus', name: 'tyrus-container-inmemory', version: '2.2.+' + latestDepTestImplementation(group: 'org.glassfish.tyrus', name: 'tyrus-container-inmemory', version: '+') { + version { + reject '2.3.0-M1' + } + because 'Tyrus 2.3.0-M1 depends on broken Grizzly 5.0.0 POM metadata' + } } tasks.named('latestDepTest', Test) { diff --git a/dd-java-agent/instrumentation/websocket/jakarta-websocket-2.0/gradle.lockfile b/dd-java-agent/instrumentation/websocket/jakarta-websocket-2.0/gradle.lockfile index ac37ff01046..aca59096302 100644 --- a/dd-java-agent/instrumentation/websocket/jakarta-websocket-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/websocket/jakarta-websocket-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:websocket:jakarta-websocket-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -48,7 +52,7 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:2.1.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath jakarta.websocket:jakarta.websocket-api:2.0.0=testCompileClasspath,testRuntimeClasspath jakarta.websocket:jakarta.websocket-api:2.2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -59,8 +63,8 @@ jakarta.xml.bind:jakarta.xml.bind-api:4.0.2=latestDepTestCompileClasspath,latest javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -107,6 +111,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -124,14 +129,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/gradle.lockfile b/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/gradle.lockfile index 35f64a6f8d3..b104c0816d2 100644 --- a/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:websocket:javax-websocket-1.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,7 +51,7 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.websocket:jakarta.websocket-api:1.1.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.websocket:javax.websocket-api:1.0=testCompileClasspath,testRuntimeClasspath @@ -55,8 +59,8 @@ javax.websocket:javax.websocket-api:1.0-rc1=compileClasspath javax.websocket:javax.websocket-client-api:1.0-rc1=compileClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -103,6 +107,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -120,14 +125,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/AsyncRemoteEndpointInstrumentation.java b/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/AsyncRemoteEndpointInstrumentation.java index 47b760ae5cd..575d7a8cded 100644 --- a/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/AsyncRemoteEndpointInstrumentation.java +++ b/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/AsyncRemoteEndpointInstrumentation.java @@ -96,7 +96,7 @@ public static AgentScope before( } final AgentSpan wsSpan = - DECORATE.onSendFrameStart( + DECORATE.startOutboundFrameSpan( handlerContext, CHAR_SEQUENCE_SIZE_CALCULATOR.getFormat(), CHAR_SEQUENCE_SIZE_CALCULATOR.getLengthFunction().applyAsInt(text)); @@ -106,7 +106,7 @@ public static AgentScope before( return activateSpan(wsSpan); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void after( @Advice.Enter final AgentScope scope, @Advice.Local("handlerContext") HandlerContext.Sender handlerContext, @@ -153,7 +153,7 @@ public static AgentScope before( } final AgentSpan wsSpan = - DECORATE.onSendFrameStart( + DECORATE.startOutboundFrameSpan( handlerContext, BYTE_BUFFER_SIZE_CALCULATOR.getFormat(), BYTE_BUFFER_SIZE_CALCULATOR.getLengthFunction().applyAsInt(buffer)); @@ -163,7 +163,7 @@ public static AgentScope before( return activateSpan(wsSpan); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void after( @Advice.Enter final AgentScope scope, @Advice.Local("handlerContext") HandlerContext.Sender handlerContext, @@ -209,14 +209,15 @@ public static AgentScope before( } final AgentSpan wsSpan = - DECORATE.onSendFrameStart(handlerContext, BYTE_BUFFER_SIZE_CALCULATOR.getFormat(), 0); + DECORATE.startOutboundFrameSpan( + handlerContext, BYTE_BUFFER_SIZE_CALCULATOR.getFormat(), 0); if (sendHandler != null) { sendHandler = new TracingSendHandler(sendHandler, handlerContext); } return activateSpan(wsSpan); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void after( @Advice.Enter final AgentScope scope, @Advice.Local("handlerContext") HandlerContext.Sender handlerContext, diff --git a/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/BasicRemoteEndpointInstrumentation.java b/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/BasicRemoteEndpointInstrumentation.java index 40850478789..0b37adbc312 100644 --- a/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/BasicRemoteEndpointInstrumentation.java +++ b/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/BasicRemoteEndpointInstrumentation.java @@ -85,14 +85,14 @@ public static AgentScope before( } final AgentSpan wsSpan = - DECORATE.onSendFrameStart( + DECORATE.startOutboundFrameSpan( handlerContext, CHAR_SEQUENCE_SIZE_CALCULATOR.getFormat(), CHAR_SEQUENCE_SIZE_CALCULATOR.getLengthFunction().applyAsInt(text)); return activateSpan(wsSpan); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void after( @Advice.Enter final AgentScope scope, @Advice.Local("handlerContext") HandlerContext.Sender handlerContext, @@ -132,14 +132,14 @@ public static AgentScope before( } final AgentSpan wsSpan = - DECORATE.onSendFrameStart( + DECORATE.startOutboundFrameSpan( handlerContext, BYTE_BUFFER_SIZE_CALCULATOR.getFormat(), BYTE_BUFFER_SIZE_CALCULATOR.getLengthFunction().applyAsInt(buffer)); return activateSpan(wsSpan); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void after( @Advice.Enter final AgentScope scope, @Advice.Local("handlerContext") HandlerContext.Sender handlerContext, @@ -180,11 +180,11 @@ public static AgentScope before( // encoders/decoders. // we can anyway instrument also the Encoders but that would add much more complexity. // right now this is not in scope - final AgentSpan wsSpan = DECORATE.onSendFrameStart(handlerContext, null, 0); + final AgentSpan wsSpan = DECORATE.startOutboundFrameSpan(handlerContext, null, 0); return activateSpan(wsSpan); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void after( @Advice.Enter final AgentScope scope, @Advice.Local("handlerContext") HandlerContext.Sender handlerContext, diff --git a/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/EndpointInstrumentation.java b/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/EndpointInstrumentation.java index 21ec05b00f7..5f475eb82cc 100644 --- a/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/EndpointInstrumentation.java +++ b/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/EndpointInstrumentation.java @@ -89,7 +89,7 @@ public static AgentScope onEnter( new HandlerContext.Receiver(sessionState.getHandshakeSpan(), session.getId()); return activateSpan( - DECORATE.onSessionCloseReceived( + DECORATE.startInboundCloseSpan( handlerContext, closeReason.getReasonPhrase(), closeReason.getCloseCode().getCode())); } diff --git a/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/MessageHandlerInstrumentation.java b/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/MessageHandlerInstrumentation.java index 6d1c93d4cf6..b07914ac920 100644 --- a/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/MessageHandlerInstrumentation.java +++ b/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/MessageHandlerInstrumentation.java @@ -67,11 +67,11 @@ public static AgentScope onEnter( } final AgentSpan wsSpan = - DECORATE.onReceiveFrameStart(handlerContext, data, last != null && last); + DECORATE.startInboundFrameSpan(handlerContext, data, last != null && last); return activateSpan(wsSpan); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void onExit( @Advice.Enter final AgentScope scope, @Advice.Local("handlerContext") HandlerContext.Receiver handlerContext, diff --git a/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/SessionInstrumentation.java b/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/SessionInstrumentation.java index 4c1c5bb8f41..b8ceed2f78d 100644 --- a/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/SessionInstrumentation.java +++ b/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/SessionInstrumentation.java @@ -157,11 +157,11 @@ public static AgentScope before( return null; } return activateSpan( - DECORATE.onSessionCloseIssued( + DECORATE.startOutboundCloseSpan( handlerContext, reason.getReasonPhrase(), reason.getCloseCode().getCode())); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void after( @Advice.Enter final AgentScope scope, @Advice.Thrown final Throwable thrown, @@ -185,10 +185,10 @@ public static AgentScope before( if (handlerContext == null) { return null; } - return activateSpan(DECORATE.onSessionCloseIssued(handlerContext, null, 1000)); + return activateSpan(DECORATE.startOutboundCloseSpan(handlerContext, null, 1000)); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void after( @Advice.Enter final AgentScope scope, @Advice.Thrown final Throwable thrown, diff --git a/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/TracingOutputStream.java b/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/TracingOutputStream.java index 6aa3d2f01eb..7ae4d5416c0 100644 --- a/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/TracingOutputStream.java +++ b/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/TracingOutputStream.java @@ -4,8 +4,8 @@ import static datadog.trace.bootstrap.instrumentation.decorator.WebsocketDecorator.DECORATE; import static datadog.trace.bootstrap.instrumentation.websocket.HandlersExtractor.MESSAGE_TYPE_BINARY; +import datadog.context.ContextScope; import datadog.trace.bootstrap.CallDepthThreadLocalMap; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.websocket.HandlerContext; import java.io.IOException; import java.io.OutputStream; @@ -24,9 +24,9 @@ public TracingOutputStream(OutputStream delegate, HandlerContext.Sender handlerC public void write(int b) throws IOException { final boolean doTrace = CallDepthThreadLocalMap.incrementCallDepth(HandlerContext.class) == 0; if (doTrace) { - DECORATE.onSendFrameStart(handlerContext, MESSAGE_TYPE_BINARY, 1); + DECORATE.startOutboundFrameSpan(handlerContext, MESSAGE_TYPE_BINARY, 1); } - try (final AgentScope ignored = activateSpan(handlerContext.getWebsocketSpan())) { + try (final ContextScope ignored = activateSpan(handlerContext.getWebsocketSpan())) { delegate.write(b); } finally { if (doTrace) { @@ -39,9 +39,9 @@ public void write(int b) throws IOException { public void write(byte[] b, int off, int len) throws IOException { final boolean doTrace = CallDepthThreadLocalMap.incrementCallDepth(HandlerContext.class) == 0; if (doTrace) { - DECORATE.onSendFrameStart(handlerContext, MESSAGE_TYPE_BINARY, len); + DECORATE.startOutboundFrameSpan(handlerContext, MESSAGE_TYPE_BINARY, len); } - try (final AgentScope ignored = activateSpan(handlerContext.getWebsocketSpan())) { + try (final ContextScope ignored = activateSpan(handlerContext.getWebsocketSpan())) { delegate.write(b, off, len); } finally { if (doTrace) { @@ -53,7 +53,7 @@ public void write(byte[] b, int off, int len) throws IOException { @Override public void close() throws IOException { final boolean doTrace = CallDepthThreadLocalMap.incrementCallDepth(HandlerContext.class) == 0; - try (final AgentScope ignored = + try (final ContextScope ignored = handlerContext.getWebsocketSpan() != null ? activateSpan(handlerContext.getWebsocketSpan()) : null) { diff --git a/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/TracingSendHandler.java b/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/TracingSendHandler.java index 1401ae0f502..c5a582859a3 100644 --- a/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/TracingSendHandler.java +++ b/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/TracingSendHandler.java @@ -3,7 +3,7 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.decorator.WebsocketDecorator.DECORATE; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.websocket.HandlerContext; import javax.websocket.SendHandler; @@ -21,7 +21,7 @@ public TracingSendHandler(SendHandler delegate, HandlerContext handlerContext) { @Override public void onResult(SendResult sendResult) { final AgentSpan wsSpan = handlerContext.getWebsocketSpan(); - try (final AgentScope ignored = activateSpan(wsSpan)) { + try (final ContextScope ignored = activateSpan(wsSpan)) { delegate.onResult(sendResult); } finally { if (sendResult.getException() != null) { diff --git a/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/TracingWriter.java b/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/TracingWriter.java index 4d37d1ba307..32f0fd236d0 100644 --- a/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/TracingWriter.java +++ b/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/main/java/datadog/trace/instrumentation/websocket/jsr256/TracingWriter.java @@ -4,8 +4,8 @@ import static datadog.trace.bootstrap.instrumentation.decorator.WebsocketDecorator.DECORATE; import static datadog.trace.bootstrap.instrumentation.websocket.HandlersExtractor.MESSAGE_TYPE_TEXT; +import datadog.context.ContextScope; import datadog.trace.bootstrap.CallDepthThreadLocalMap; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.websocket.HandlerContext; import java.io.IOException; import java.io.Writer; @@ -24,9 +24,9 @@ public TracingWriter(Writer delegate, HandlerContext.Sender handlerContext) { public void write(char[] cbuf, int off, int len) throws IOException { final boolean doTrace = CallDepthThreadLocalMap.incrementCallDepth(HandlerContext.class) == 0; if (doTrace) { - DECORATE.onSendFrameStart(handlerContext, MESSAGE_TYPE_TEXT, len); + DECORATE.startOutboundFrameSpan(handlerContext, MESSAGE_TYPE_TEXT, len); } - try (final AgentScope ignored = activateSpan(handlerContext.getWebsocketSpan())) { + try (final ContextScope ignored = activateSpan(handlerContext.getWebsocketSpan())) { delegate.write(cbuf, off, len); } finally { if (doTrace) { @@ -43,7 +43,7 @@ public void flush() throws IOException { @Override public void close() throws IOException { final boolean doTrace = CallDepthThreadLocalMap.incrementCallDepth(HandlerContext.class) == 0; - try (final AgentScope ignored = + try (final ContextScope ignored = handlerContext.getWebsocketSpan() != null ? activateSpan(handlerContext.getWebsocketSpan()) : null) { diff --git a/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/test/groovy/WebsocketTest.groovy b/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/test/groovy/WebsocketTest.groovy index b1ab4fc252c..f0b1170737e 100644 --- a/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/test/groovy/WebsocketTest.groovy +++ b/dd-java-agent/instrumentation/websocket/javax-websocket-1.0/src/test/groovy/WebsocketTest.groovy @@ -582,7 +582,7 @@ class WebsocketTest extends InstrumentationSpecification { def clientHandshake = createHandshakeSpan("http.request", url) //simulate client span clientHandshake.setSamplingPriority(PrioritySampling.SAMPLER_DROP) // simulate sampler drop def serverHandshake = createHandshakeSpan("servlet.request", url, - new ExtractedContext(clientHandshake.context().getTraceId(), clientHandshake.context().getSpanId(), clientHandshake.context().getSamplingPriority(), + new ExtractedContext(clientHandshake.spanContext().getTraceId(), clientHandshake.spanContext().getSpanId(), clientHandshake.spanContext().getSamplingPriority(), "test", 0, ["example_baggage": "test"], TagMap.EMPTY, null, null, null, null)) // simulate server span def session = deployEndpointAndConnect(new Endpoints.TestEndpoint(new Endpoints.FullStringHandler()), clientHandshake, serverHandshake, url) @@ -626,8 +626,8 @@ class WebsocketTest extends InstrumentationSpecification { // check that the handshake trace state is inherited TEST_WRITER.flatten().findAll { span -> (span as DDSpan).getSpanType() == "websocket" && (span as DDSpan).getParentId() == 0}.each { assert (it as DDSpan).getSamplingPriority() == serverHandshake.getSamplingPriority() - assert (it as DDSpan).getOrigin() == serverHandshake.context().getOrigin() - assert (it as DDSpan).getBaggage() == serverHandshake.context().getBaggageItems() + assert (it as DDSpan).getOrigin() == serverHandshake.spanContext().getOrigin() + assert (it as DDSpan).getBaggage() == serverHandshake.spanContext().getBaggageItems() assert !(it as DDSpan).getBaggage().isEmpty() } } diff --git a/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-10.0/gradle.lockfile b/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-10.0/gradle.lockfile index 5d38f68a6d7..81c80741ab0 100644 --- a/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-10.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-10.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:websocket:jetty-websocket:jetty-websocket-10.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,main_java11CompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,15 +51,15 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,testCompileClasspath,testRuntimeClasspath jakarta.transaction:jakarta.transaction-api:1.3.2=main_java11CompileClasspath,testCompileClasspath,testRuntimeClasspath jakarta.transaction:jakarta.transaction-api:1.3.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -127,6 +131,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -146,17 +151,17 @@ org.ow2.asm:asm-analysis:9.0=main_java11CompileClasspath,testCompileClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs org.ow2.asm:asm-commons:9.0=main_java11CompileClasspath,testCompileClasspath +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.8=latestDepTestCompileClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.0=main_java11CompileClasspath,testCompileClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.8=latestDepTestCompileClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,main_java11CompileClasspath,main_java11RuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-10.0/src/main/java11/datadog/trace/instrumentation/websocket/jetty10/MethodHandleWrappers.java b/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-10.0/src/main/java11/datadog/trace/instrumentation/websocket/jetty10/MethodHandleWrappers.java index 7896b2eb5a6..982330b6805 100644 --- a/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-10.0/src/main/java11/datadog/trace/instrumentation/websocket/jetty10/MethodHandleWrappers.java +++ b/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-10.0/src/main/java11/datadog/trace/instrumentation/websocket/jetty10/MethodHandleWrappers.java @@ -3,11 +3,11 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.activateSpan; import static datadog.trace.bootstrap.instrumentation.decorator.WebsocketDecorator.DECORATE; +import datadog.context.ContextScope; import datadog.trace.api.Config; import datadog.trace.bootstrap.CallDepthThreadLocalMap; import datadog.trace.bootstrap.ContextStore; import datadog.trace.bootstrap.ExceptionLogger; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; import datadog.trace.bootstrap.instrumentation.websocket.HandlerContext; @@ -117,9 +117,9 @@ public static void onClose( if (handlerContext != null) { final HandlerContext.Receiver closeContext = new HandlerContext.Receiver(handlerContext.getHandshakeSpan(), session.getId()); - try (AgentScope ignored = + try (ContextScope ignored = activateSpan( - DECORATE.onSessionCloseReceived( + DECORATE.startInboundCloseSpan( closeContext, closeReason.getReasonPhrase(), closeReason.getCloseCode().getCode()))) { @@ -157,13 +157,13 @@ public static Object onMessage( if (partialDelivery) { finishSpan = (boolean) args[1]; } - wsSpan = DECORATE.onReceiveFrameStart(handlerContext, args[0], partialDelivery); + wsSpan = DECORATE.startInboundFrameSpan(handlerContext, args[0], partialDelivery); } } catch (Throwable t) { ExceptionLogger.LOGGER.debug("Unforeseen error instrumenting jetty websocket POJO", t); } if (wsSpan != null) { - try (AgentScope ignored = activateSpan(wsSpan)) { + try (ContextScope ignored = activateSpan(wsSpan)) { return delegate.invokeWithArguments(args); } catch (Throwable t) { finishSpan = true; diff --git a/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-11.0/gradle.lockfile b/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-11.0/gradle.lockfile index 63c9486f93f..a8514be35ef 100644 --- a/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-11.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-11.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:websocket:jetty-websocket:jetty-websocket-11.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,7 +51,7 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:2.0.0=testCompileClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:2.1.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath jakarta.transaction:jakarta.transaction-api:2.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -55,8 +59,8 @@ jakarta.transaction:jakarta.transaction-api:2.0.0-RC1=testCompileClasspath,testR javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -128,6 +132,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -147,17 +152,17 @@ org.ow2.asm:asm-analysis:9.0=testCompileClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs org.ow2.asm:asm-commons:9.0=testCompileClasspath +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.8=latestDepTestCompileClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.0=testCompileClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.8=latestDepTestCompileClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-12.0/gradle.lockfile b/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-12.0/gradle.lockfile index bc36a017f4d..13c1a2de7f5 100644 --- a/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-12.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/websocket/jetty-websocket/jetty-websocket-12.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:websocket:jetty-websocket:jetty-websocket-12.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,7 +51,7 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:2.1.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.el:jakarta.el-api:4.0.0=testCompileClasspath,testRuntimeClasspath jakarta.el:jakarta.el-api:5.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -64,8 +68,8 @@ jakarta.websocket:jakarta.websocket-client-api:2.1.1=latestDepTestCompileClasspa javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -182,6 +186,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -199,18 +204,18 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.5=testCompileClasspath org.ow2.asm:asm-commons:9.7.1=latestDepTestCompileClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.5=testCompileClasspath org.ow2.asm:asm-tree:9.7.1=latestDepTestCompileClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/websphere-jmx-8.5/gradle.lockfile b/dd-java-agent/instrumentation/websphere-jmx-8.5/gradle.lockfile index 5ca3972ba7b..c743b5d15b5 100644 --- a/dd-java-agent/instrumentation/websphere-jmx-8.5/gradle.lockfile +++ b/dd-java-agent/instrumentation/websphere-jmx-8.5/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:websphere-jmx-8.5:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,12 +51,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,6 +85,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -98,14 +103,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/wildfly-9.0/gradle.lockfile b/dd-java-agent/instrumentation/wildfly-9.0/gradle.lockfile index 7b338bc2c5c..c99aa9d9c5c 100644 --- a/dd-java-agent/instrumentation/wildfly-9.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/wildfly-9.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:wildfly-9.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepForkedTestCompileClasspath,latestDep com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath com.googlecode.javaewah:JavaEWAH:1.2.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -50,25 +54,25 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.smallrye.common:smallrye-common-annotation:2.14.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.smallrye.common:smallrye-common-constraint:2.17.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.smallrye.common:smallrye-common-cpu:2.17.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.smallrye.common:smallrye-common-expression:2.4.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.smallrye.common:smallrye-common-function:2.17.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.smallrye.common:smallrye-common-net:2.4.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.smallrye.common:smallrye-common-os:2.4.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.smallrye.common:smallrye-common-constraint:2.19.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.smallrye.common:smallrye-common-cpu:2.19.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.smallrye.common:smallrye-common-expression:2.19.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.smallrye.common:smallrye-common-function:2.19.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.smallrye.common:smallrye-common-net:2.19.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.smallrye.common:smallrye-common-os:2.19.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.smallrye.common:smallrye-common-ref:2.4.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath io.smallrye:jandex:3.1.2=testCompileClasspath,testRuntimeClasspath -io.smallrye:jandex:3.5.3=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +io.smallrye:jandex:3.6.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath io.undertow:undertow-core:1.2.8.Final=compileClasspath io.undertow:undertow-core:2.3.7.Final=testCompileClasspath,testRuntimeClasspath -io.undertow:undertow-core:2.4.0.RC4=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +io.undertow:undertow-core:2.4.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath jakarta.servlet:jakarta.servlet-api:6.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -80,9 +84,9 @@ org.apache.commons:commons-text:1.14.0=spotbugs org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apache.sshd:sshd-common:2.10.0=testCompileClasspath,testRuntimeClasspath -org.apache.sshd:sshd-common:2.17.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.sshd:sshd-common:2.18.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apache.sshd:sshd-core:2.10.0=testCompileClasspath,testRuntimeClasspath -org.apache.sshd:sshd-core:2.17.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.apache.sshd:sshd-core:2.18.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.apiguardian:apiguardian-api:1.1.2=latestDepForkedTestCompileClasspath,latestDepTestCompileClasspath,testCompileClasspath org.checkerframework:checker-qual:3.33.0=annotationProcessor,latestDepForkedTestAnnotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor org.codehaus.groovy:groovy-ant:3.0.23=codenarc @@ -163,6 +167,7 @@ org.jboss:staxmapper:1.4.0.Final=testCompileClasspath,testRuntimeClasspath org.jboss:staxmapper:1.5.0.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -180,14 +185,14 @@ org.objenesis:objenesis:3.3=latestDepForkedTestCompileClasspath,latestDepForkedT org.opentest4j:opentest4j:1.3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.picketbox:picketbox:4.9.2.Final=compileClasspath org.projectodd.vdx:vdx-core:1.1.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.projectodd.vdx:vdx-wildfly:1.1.6=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -197,8 +202,8 @@ org.slf4j:jul-to-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForke org.slf4j:log4j-over-slf4j:1.7.30=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:1.7.30=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.36=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j +org.slf4j:slf4j-api:2.0.18=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.snakeyaml:snakeyaml-engine:2.9=buildTimeInstrumentationPlugin,latestDepForkedTestRuntimeClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testRuntimeClasspath org.spockframework:spock-bom:2.4-groovy-3.0=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -211,135 +216,135 @@ org.wildfly.common:wildfly-common:1.6.0.Final=testCompileClasspath,testRuntimeCl org.wildfly.common:wildfly-common:2.0.1=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.core:wildfly-controller-client:1.0.0.Final=compileClasspath org.wildfly.core:wildfly-controller-client:21.1.0.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.core:wildfly-controller-client:32.0.0.Beta7=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.core:wildfly-controller-client:33.0.0.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.core:wildfly-controller:1.0.0.Final=compileClasspath org.wildfly.core:wildfly-controller:21.1.0.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.core:wildfly-controller:32.0.0.Beta7=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.core:wildfly-controller:33.0.0.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.core:wildfly-core-management-client:21.1.0.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.core:wildfly-core-management-client:32.0.0.Beta7=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.core:wildfly-core-management-client:33.0.0.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.core:wildfly-core-security-api:1.0.0.Final=compileClasspath org.wildfly.core:wildfly-core-security:1.0.0.Final=compileClasspath org.wildfly.core:wildfly-core-security:21.1.0.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.core:wildfly-core-security:32.0.0.Beta7=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.core:wildfly-core-security:33.0.0.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.core:wildfly-deployment-repository:1.0.0.Final=compileClasspath org.wildfly.core:wildfly-deployment-repository:21.1.0.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.core:wildfly-deployment-repository:32.0.0.Beta7=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.core:wildfly-deployment-repository:33.0.0.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.core:wildfly-domain-http-interface:1.0.0.Final=compileClasspath org.wildfly.core:wildfly-domain-http-interface:21.1.0.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.core:wildfly-domain-http-interface:32.0.0.Beta7=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.core:wildfly-domain-http-interface:33.0.0.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.core:wildfly-domain-management:1.0.0.Final=compileClasspath org.wildfly.core:wildfly-domain-management:21.1.0.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.core:wildfly-domain-management:32.0.0.Beta7=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.core:wildfly-domain-management:33.0.0.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.core:wildfly-embedded:21.1.0.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.core:wildfly-embedded:32.0.0.Beta7=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.wildfly.core:wildfly-io-spi:32.0.0.Beta7=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.core:wildfly-embedded:33.0.0.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.core:wildfly-io-spi:33.0.0.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.core:wildfly-io:1.0.0.Final=compileClasspath org.wildfly.core:wildfly-io:21.1.0.Final=testCompileClasspath,testRuntimeClasspath org.wildfly.core:wildfly-network:1.0.0.Final=compileClasspath org.wildfly.core:wildfly-network:21.1.0.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.core:wildfly-network:32.0.0.Beta7=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.core:wildfly-network:33.0.0.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.core:wildfly-platform-mbean:1.0.0.Final=compileClasspath org.wildfly.core:wildfly-platform-mbean:21.1.0.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.core:wildfly-platform-mbean:32.0.0.Beta7=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.core:wildfly-platform-mbean:33.0.0.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.core:wildfly-process-controller:1.0.0.Final=compileClasspath org.wildfly.core:wildfly-process-controller:21.1.0.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.core:wildfly-process-controller:32.0.0.Beta7=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.core:wildfly-process-controller:33.0.0.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.core:wildfly-protocol:1.0.0.Final=compileClasspath org.wildfly.core:wildfly-protocol:21.1.0.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.core:wildfly-protocol:32.0.0.Beta7=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.core:wildfly-protocol:33.0.0.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.core:wildfly-remoting:1.0.0.Final=compileClasspath org.wildfly.core:wildfly-remoting:21.1.0.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.core:wildfly-remoting:32.0.0.Beta7=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.core:wildfly-remoting:33.0.0.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.core:wildfly-request-controller:1.0.0.Final=compileClasspath org.wildfly.core:wildfly-self-contained:1.0.0.Final=compileClasspath org.wildfly.core:wildfly-server:1.0.0.Final=compileClasspath org.wildfly.core:wildfly-server:21.1.0.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.core:wildfly-server:32.0.0.Beta7=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.wildfly.core:wildfly-service:32.0.0.Beta7=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.core:wildfly-server:33.0.0.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.core:wildfly-service:33.0.0.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.core:wildfly-version:1.0.0.Final=compileClasspath org.wildfly.core:wildfly-version:21.1.0.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.core:wildfly-version:32.0.0.Beta7=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.core:wildfly-version:33.0.0.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security.elytron-web:undertow-server:4.0.0.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security.elytron-web:undertow-server:4.1.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security.elytron-web:undertow-server:4.2.1.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-asn1:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-asn1:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-asn1:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-audit:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-audit:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-audit:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-auth-server-deprecated:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-auth-server-deprecated:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-auth-server-deprecated:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-auth-server-http:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-auth-server-http:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-auth-server-http:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-auth-server-sasl:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-auth-server-sasl:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-auth-server-sasl:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-auth-server:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-auth-server:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-auth-server:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-auth-util:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-auth-util:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-auth-util:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-auth:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-auth:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-auth:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-base:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-base:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-base:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-client:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-client:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-client:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-credential-source-impl:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-credential-source-impl:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-credential-source-impl:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-credential-store:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-credential-store:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-credential-store:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-credential:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-credential:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-credential:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-encryption:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-encryption:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-encryption:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-http-util:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-http-util:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-http-util:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-http:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-http:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-http:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-keystore:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-keystore:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-keystore:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-mechanism-digest:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-mechanism-digest:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-mechanism-digest:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-mechanism-gssapi:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-mechanism-gssapi:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-mechanism-gssapi:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-mechanism:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-mechanism:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-mechanism:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-password-impl:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-password-impl:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-password-impl:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-permission:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-permission:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-permission:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-provider-util:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-provider-util:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-provider-util:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-realm:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-realm:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-realm:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-sasl-anonymous:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-sasl-anonymous:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-sasl-anonymous:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-sasl-auth-util:1.20.2.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-sasl-auth-util:2.5.0.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-sasl-auth-util:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-sasl-digest:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-sasl-digest:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-sasl-digest:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-sasl-localuser:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-sasl-localuser:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-sasl-localuser:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-sasl:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-sasl:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-sasl:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-security-manager-action:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-security-manager-action:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-security-manager-action:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-security-manager:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-security-manager:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-security-manager:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-ssh-util:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-ssh-util:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-ssh-util:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-ssl:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-ssl:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-ssl:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-util:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-util:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-util:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-x500-cert-acme:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-x500-cert-acme:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-x500-cert-acme:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-x500-cert-util:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-x500-cert-util:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-x500-cert-util:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-x500-cert:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-x500-cert:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-x500-cert:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-elytron-x500:2.2.1.Final=testCompileClasspath,testRuntimeClasspath -org.wildfly.security:wildfly-elytron-x500:2.8.4.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath +org.wildfly.security:wildfly-elytron-x500:2.9.2.Final=latestDepForkedTestCompileClasspath,latestDepForkedTestRuntimeClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath org.wildfly.security:wildfly-security-manager:1.1.2.Final=compileClasspath org.wildfly:wildfly-dist:21.0.0.Final=wildflyTest -org.wildfly:wildfly-dist:40.0.0.Beta1=wildflyLatestDepTest +org.wildfly:wildfly-dist:41.0.0.Final=wildflyLatestDepTest org.wildfly:wildfly-ee:9.0.0.Final=compileClasspath org.wildfly:wildfly-naming:9.0.0.Final=compileClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs diff --git a/dd-java-agent/instrumentation/ws/jakarta-ws-annotations-3.0/gradle.lockfile b/dd-java-agent/instrumentation/ws/jakarta-ws-annotations-3.0/gradle.lockfile index e3460032992..e085827c0c6 100644 --- a/dd-java-agent/instrumentation/ws/jakarta-ws-annotations-3.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/ws/jakarta-ws-annotations-3.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:ws:jakarta-ws-annotations-3.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,13 +51,13 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath jakarta.jws:jakarta.jws-api:3.0.0=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -82,6 +86,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -99,14 +104,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/ws/jax-ws/jax-ws-annotations-1.1/gradle.lockfile b/dd-java-agent/instrumentation/ws/jax-ws/jax-ws-annotations-1.1/gradle.lockfile index 84ef931de12..e92c51c7d68 100644 --- a/dd-java-agent/instrumentation/ws/jax-ws/jax-ws-annotations-1.1/gradle.lockfile +++ b/dd-java-agent/instrumentation/ws/jax-ws/jax-ws-annotations-1.1/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:ws:jax-ws:jax-ws-annotations-1.1:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,spotb com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -47,13 +51,13 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.jws:javax.jws-api:1.1=compileClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -82,6 +86,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -99,14 +104,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/ws/jax-ws/jax-ws-annotations-2.0/gradle.lockfile b/dd-java-agent/instrumentation/ws/jax-ws/jax-ws-annotations-2.0/gradle.lockfile index 21ce7def46f..ddf4999f40f 100644 --- a/dd-java-agent/instrumentation/ws/jax-ws/jax-ws-annotations-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/ws/jax-ws/jax-ws-annotations-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:ws:jax-ws:jax-ws-annotations-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -47,7 +51,7 @@ commons-io:commons-io:2.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeC commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.activation:activation:1.1=compileClasspath,testCompileClasspath,testRuntimeClasspath javax.activation:javax.activation-api:1.2.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath javax.annotation:javax.annotation-api:1.3.2=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath @@ -60,8 +64,8 @@ javax.xml.ws:jaxws-api:2.0=compileClasspath,testCompileClasspath,testRuntimeClas javax.xml.ws:jaxws-api:2.3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -90,6 +94,7 @@ org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspat org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -107,14 +112,14 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/zio/zio-2.0/gradle.lockfile b/dd-java-agent/instrumentation/zio/zio-2.0/gradle.lockfile index ebdd820d526..99830098455 100644 --- a/dd-java-agent/instrumentation/zio/zio-2.0/gradle.lockfile +++ b/dd-java-agent/instrumentation/zio/zio-2.0/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:instrumentation:zio:zio-2.0:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=latestDepTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=latestDepTestCompileClasspath,latestDepTestRu com.blogspot.mydailyjava:weak-lock-free:0.17=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleBootstrap,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=latestDepTestRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=latestDepTestRuntimeClasspath,testRuntimeClasspath @@ -17,15 +18,15 @@ com.eed3si9n:shaded-scalajson_2.13:1.0.0-M4=zinc com.eed3si9n:sjson-new-core_2.13:0.10.1=zinc com.eed3si9n:sjson-new-scalajson_2.13:0.10.1=zinc com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=latestDepTestRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,testAnnotationProcessor,testCompileClasspath @@ -35,12 +36,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,lates com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:guava:20.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor +com.google.guava:guava:33.6.0-jre=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,latestDepTestAnnotationProcessor,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor,latestDepTestAnnotationProcessor,testAnnotationProcessor -com.google.re2j:re2j:1.7=latestDepTestRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=latestDepTestRuntimeClasspath,testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.squareup.moshi:moshi:1.11.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -62,16 +66,15 @@ dev.zio:zio-stacktracer_2.12:2.0.0=compileClasspath,testCompileClasspath,testRun dev.zio:zio-stacktracer_2.12:2.0.22=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath dev.zio:zio_2.12:2.0.0=compileClasspath,testCompileClasspath,testRuntimeClasspath dev.zio:zio_2.12:2.0.22=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.leangen.geantyref:geantyref:1.3.16=latestDepTestRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=latestDepTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=latestDepTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.8.0=latestDepTestRuntimeClasspath,testRuntimeClasspath net.openhft:zero-allocation-hashing:0.16=zinc net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -97,7 +100,7 @@ org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=latestDepTestRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -106,7 +109,8 @@ org.jctools:jctools-core:4.0.6=latestDepTestRuntimeClasspath,testRuntimeClasspat org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc +org.jspecify:jspecify:1.0.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -124,43 +128,43 @@ org.objenesis:objenesis:3.3=latestDepTestCompileClasspath,latestDepTestRuntimeCl org.opentest4j:opentest4j:1.3.0=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=latestDepTestRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=buildTimeInstrumentationPlugin,compileClasspath,latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,muzzleTooling,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=zinc org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.12.15=compileClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang:scala-library:2.12.18=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath -org.scala-lang:scala-library:2.13.15=zinc -org.scala-lang:scala-reflect:2.13.15=zinc -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-lang:scala-library:2.13.16=zinc +org.scala-lang:scala-reflect:2.13.16=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.slf4j:jcl-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=latestDepTestCompileClasspath,latestDepTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/instrumentation/zio/zio-2.0/src/main/java/datadog/trace/instrumentation/zio/v2_0/FiberContext.java b/dd-java-agent/instrumentation/zio/zio-2.0/src/main/java/datadog/trace/instrumentation/zio/v2_0/FiberContext.java index a1b421a9ed3..afca3d06c0f 100644 --- a/dd-java-agent/instrumentation/zio/zio-2.0/src/main/java/datadog/trace/instrumentation/zio/v2_0/FiberContext.java +++ b/dd-java-agent/instrumentation/zio/zio-2.0/src/main/java/datadog/trace/instrumentation/zio/v2_0/FiberContext.java @@ -3,11 +3,11 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.captureActiveSpan; import datadog.context.Context; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.context.ContextContinuation; public class FiberContext { private Context context; - private final AgentScope.Continuation continuation; + private final ContextContinuation continuation; private Context originalContext; @@ -32,7 +32,7 @@ public void onSuspend() { public void onEnd() { if (continuation != null) { // release enclosing trace now the fiber has ended - continuation.cancel(); + continuation.release(); } } } diff --git a/dd-java-agent/instrumentation/zio/zio-2.0/src/test/scala/ZioTestFixtures.scala b/dd-java-agent/instrumentation/zio/zio-2.0/src/test/scala/ZioTestFixtures.scala index eff669dc97c..335e2b9bdbb 100644 --- a/dd-java-agent/instrumentation/zio/zio-2.0/src/test/scala/ZioTestFixtures.scala +++ b/dd-java-agent/instrumentation/zio/zio-2.0/src/test/scala/ZioTestFixtures.scala @@ -121,7 +121,7 @@ object ZioTestFixtures { ddSpan <- ZIO.succeed( AgentTracer .get() - .buildSpan(opName) + .buildSpan("zio.experimental", opName) .withResourceName("zio-test") .start() ) diff --git a/dd-java-agent/load-generator/gradle.lockfile b/dd-java-agent/load-generator/gradle.lockfile index 3f05069bfb1..7d85b0756fd 100644 --- a/dd-java-agent/load-generator/gradle.lockfile +++ b/dd-java-agent/load-generator/gradle.lockfile @@ -1,31 +1,36 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:load-generator:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=runtimeClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=runtimeClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=runtimeClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=runtimeClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=runtimeClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=runtimeClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=runtimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=runtimeClasspath,testRuntimeClasspath com.squareup.okio:okio:1.17.5=runtimeClasspath,testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc @@ -64,6 +69,7 @@ org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=runtimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/src/main/java6/datadog/trace/bootstrap/AgentPreCheck.java b/dd-java-agent/src/main/java6/datadog/trace/bootstrap/AgentPreCheck.java index de49e86ec73..e9ea4fc7b7a 100644 --- a/dd-java-agent/src/main/java6/datadog/trace/bootstrap/AgentPreCheck.java +++ b/dd-java-agent/src/main/java6/datadog/trace/bootstrap/AgentPreCheck.java @@ -1,5 +1,6 @@ package datadog.trace.bootstrap; +import datadog.trace.api.internal.VisibleForTesting; import de.thetaphi.forbiddenapis.SuppressForbidden; import java.io.BufferedReader; import java.io.IOException; @@ -91,9 +92,9 @@ private static boolean compatible() { return compatible(javaVersion, javaHome, System.err); } - // Reachable for testing // System.getenv usage is necessary since class is designed to be Java 6 compatible, while // Environment component is for Java 8+ + @VisibleForTesting @SuppressForbidden static boolean compatible(String javaVersion, String javaHome, PrintStream output) { int majorJavaVersion = parseJavaMajorVersion(javaVersion); @@ -114,7 +115,7 @@ static boolean compatible(String javaVersion, String javaHome, PrintStream outpu return false; } - // Reachable for testing + @VisibleForTesting static int parseJavaMajorVersion(String javaVersion) { int major = 0; if (javaVersion == null || javaVersion.isEmpty()) { diff --git a/dd-java-agent/src/test/groovy/datadog/trace/agent/JMXFetchTest.groovy b/dd-java-agent/src/test/groovy/datadog/trace/agent/JMXFetchTest.groovy index 50428eafa1b..6c68e2a0eb6 100644 --- a/dd-java-agent/src/test/groovy/datadog/trace/agent/JMXFetchTest.groovy +++ b/dd-java-agent/src/test/groovy/datadog/trace/agent/JMXFetchTest.groovy @@ -1,8 +1,10 @@ package datadog.trace.agent +import datadog.environment.JavaVirtualMachine import datadog.trace.agent.test.IntegrationTestUtils import jvmbootstraptest.AgentLoadedChecker import jvmbootstraptest.JmxStartedChecker +import spock.lang.IgnoreIf import spock.lang.Specification import spock.lang.Timeout @@ -73,6 +75,9 @@ class JMXFetchTest extends Specification { returnCode == 0 } + @IgnoreIf(reason = "JDK 27 TODO: address failing test", value = { + JavaVirtualMachine.isJavaVersion(27) + }) def "test jmxfetch config"() { setup: def configSettings = names.collect { diff --git a/dd-java-agent/testing/build.gradle b/dd-java-agent/testing/build.gradle index 02d83f9db62..f979f390728 100644 --- a/dd-java-agent/testing/build.gradle +++ b/dd-java-agent/testing/build.gradle @@ -67,9 +67,9 @@ tasks.named("shadowJar", ShadowJar) { // Only bundle jetty dependencies into the jar (relocated) // All other dependencies remain as transitive dependencies dependencies { - include(dependency { + include { it.moduleGroup == 'org.eclipse.jetty' || it.moduleGroup == 'org.eclipse.jetty.http2' - }) + } } // Relocate jetty classes to avoid conflicts with instrumented versions diff --git a/dd-java-agent/testing/gradle.lockfile b/dd-java-agent/testing/gradle.lockfile index 1ac143d9696..a5a4068d2cf 100644 --- a/dd-java-agent/testing/gradle.lockfile +++ b/dd-java-agent/testing/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-java-agent:testing:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=compileClasspath,runtimeClasspath,testCompile com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=runtimeClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=runtimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=compileClasspath,runtimeClasspath,testCompileClassp commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=runtimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=runtimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=runtimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=runtimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -77,12 +82,13 @@ org.eclipse.jetty:jetty-util:9.4.56.v20240826=compileClasspath,runtimeClasspath, org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=runtimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -100,14 +106,16 @@ org.objenesis:objenesis:3.3=compileClasspath,testCompileClasspath,testRuntimeCla org.opentest4j:opentest4j:1.3.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt org.ow2.asm:asm-commons:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt org.ow2.asm:asm-tree:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.10.1=compileClasspath,jacocoAnt,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/asserts/LinksAssert.groovy b/dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/asserts/LinksAssert.groovy index 3d583398cac..2f560469de0 100644 --- a/dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/asserts/LinksAssert.groovy +++ b/dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/asserts/LinksAssert.groovy @@ -32,7 +32,7 @@ class LinksAssert { } def link(DDSpan linked, byte flags = SpanLink.DEFAULT_FLAGS, SpanAttributes attributes = SpanAttributes.EMPTY, String traceState = '') { - link(linked.context(), flags, attributes, traceState) + link(linked.spanContext(), flags, attributes, traceState) } def link(AgentSpanContext context, byte flags = SpanLink.DEFAULT_FLAGS, SpanAttributes attributes = SpanAttributes.EMPTY, String traceState = '') { diff --git a/dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/base/HttpServer.groovy b/dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/base/HttpServer.groovy deleted file mode 100644 index 0e06968c28c..00000000000 --- a/dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/base/HttpServer.groovy +++ /dev/null @@ -1,12 +0,0 @@ -package datadog.trace.agent.test.base - -import java.util.concurrent.TimeoutException - -interface HttpServer { - - void start() throws TimeoutException - - void stop() - - URI address() -} diff --git a/dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/server/http/TestHttpServer.groovy b/dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/server/http/TestHttpServer.groovy index 30ee20fb1ef..e691d92a435 100644 --- a/dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/server/http/TestHttpServer.groovy +++ b/dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/server/http/TestHttpServer.groovy @@ -6,6 +6,7 @@ import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext import datadog.trace.bootstrap.instrumentation.api.Tags import datadog.trace.core.DDSpan import edu.umd.cs.findbugs.annotations.SuppressFBWarnings +import groovy.transform.CompileStatic import org.eclipse.jetty.http.HttpMethod import org.eclipse.jetty.http.HttpVersion import org.eclipse.jetty.server.Handler @@ -298,6 +299,7 @@ class TestHttpServer implements AutoCloseable { } @Override + @CompileStatic void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { if (request.method.equalsIgnoreCase(method)) { super.handle(target, baseRequest, request, response) @@ -315,6 +317,7 @@ class TestHttpServer implements AutoCloseable { } @Override + @CompileStatic void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { if (target == path) { super.handle(target, baseRequest, request, response) @@ -332,6 +335,7 @@ class TestHttpServer implements AutoCloseable { } @Override + @CompileStatic void handle(String target, Request baseRequest, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { if (target.startsWith(prefix)) { super.handle(target, baseRequest, request, response) diff --git a/dd-java-agent/testing/src/main/java/datadog/trace/agent/test/base/HttpServer.java b/dd-java-agent/testing/src/main/java/datadog/trace/agent/test/base/HttpServer.java new file mode 100644 index 00000000000..620a135ac9a --- /dev/null +++ b/dd-java-agent/testing/src/main/java/datadog/trace/agent/test/base/HttpServer.java @@ -0,0 +1,13 @@ +package datadog.trace.agent.test.base; + +import java.net.URI; +import java.util.concurrent.TimeoutException; + +public interface HttpServer { + + void start() throws TimeoutException; + + void stop(); + + URI address(); +} diff --git a/dd-java-agent/testing/src/main/java/datadog/trace/agent/test/server/http/HttpServletRequestExtractAdapter.java b/dd-java-agent/testing/src/main/java/datadog/trace/agent/test/server/http/HttpServletRequestExtractAdapter.java index 6f835ab619a..9fd47af1ab4 100644 --- a/dd-java-agent/testing/src/main/java/datadog/trace/agent/test/server/http/HttpServletRequestExtractAdapter.java +++ b/dd-java-agent/testing/src/main/java/datadog/trace/agent/test/server/http/HttpServletRequestExtractAdapter.java @@ -20,6 +20,9 @@ public class HttpServletRequestExtractAdapter public void forEachKey( final HttpServletRequest carrier, final AgentPropagation.KeyClassifier classifier) { Enumeration headerNames = carrier.getHeaderNames(); + if (headerNames == null) { + return; + } while (headerNames.hasMoreElements()) { final String header = headerNames.nextElement(); if (!classifier.accept(header, carrier.getHeader(header))) { diff --git a/dd-java-agent/testing/src/main/java/datadog/trace/agent/test/server/http/JavaTestHttpServer.java b/dd-java-agent/testing/src/main/java/datadog/trace/agent/test/server/http/JavaTestHttpServer.java new file mode 100644 index 00000000000..1ff635fba5e --- /dev/null +++ b/dd-java-agent/testing/src/main/java/datadog/trace/agent/test/server/http/JavaTestHttpServer.java @@ -0,0 +1,628 @@ +package datadog.trace.agent.test.server.http; + +import static datadog.trace.agent.test.server.http.HttpServletRequestExtractAdapter.GETTER; +import static datadog.trace.bootstrap.instrumentation.api.AgentPropagation.extractContextAndGetSpanContext; +import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; + +import datadog.trace.agent.test.base.HttpServer; +import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext; +import datadog.trace.bootstrap.instrumentation.api.Tags; +import de.thetaphi.forbiddenapis.SuppressForbidden; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.nio.charset.StandardCharsets; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Consumer; +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; +import javax.servlet.ServletException; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.eclipse.jetty.http.HttpMethod; +import org.eclipse.jetty.http.HttpVersion; +import org.eclipse.jetty.server.Handler; +import org.eclipse.jetty.server.HttpConfiguration; +import org.eclipse.jetty.server.HttpConnectionFactory; +import org.eclipse.jetty.server.Request; +import org.eclipse.jetty.server.SecureRequestCustomizer; +import org.eclipse.jetty.server.Server; +import org.eclipse.jetty.server.ServerConnector; +import org.eclipse.jetty.server.SslConnectionFactory; +import org.eclipse.jetty.server.handler.AbstractHandler; +import org.eclipse.jetty.server.handler.HandlerList; +import org.eclipse.jetty.util.ssl.SslContextFactory; +import org.eclipse.jetty.util.thread.QueuedThreadPool; + +@SuppressFBWarnings({"IS2_INCONSISTENT_SYNC", "PA_PUBLIC_PRIMITIVE_ATTRIBUTE"}) +public class JavaTestHttpServer implements AutoCloseable { + + @FunctionalInterface + public interface RequestHandler { + void handle(HandlerApi api) throws Exception; + } + + private final Server internalServer; + private HandlersSpec handlers; + private Consumer customizer = s -> {}; + + public String keystorePath; + private URI address; + private URI secureAddress; + private final AtomicReference last = new AtomicReference<>(); + + public final SSLContext sslContext; + + private final X509TrustManager trustManager = + new X509TrustManager() { + @Override + public X509Certificate[] getAcceptedIssuers() { + return new X509Certificate[0]; + } + + @Override + public void checkClientTrusted(X509Certificate[] certificate, String str) {} + + @Override + public void checkServerTrusted(X509Certificate[] certificate, String str) {} + }; + + private final HostnameVerifier hostnameVerifier = + (hostname, session) -> "localhost".equals(hostname); + + public static JavaTestHttpServer httpServer(Consumer spec) { + JavaTestHttpServer server = new JavaTestHttpServer(); + spec.accept(server); + server.start(); + return server; + } + + private JavaTestHttpServer() { + // In some versions, Jetty requires max threads > than some arbitrary calculated value. + // The calculated value can be high in CI. There is no easy way to override the configuration + // in a version-neutral way. + internalServer = new Server(new QueuedThreadPool(400)); + try { + sslContext = SSLContext.getInstance("TLSv1.2"); + sslContext.init(null, new TrustManager[] {trustManager}, null); + } catch (NoSuchAlgorithmException | KeyManagementException e) { + throw new IllegalStateException(e); + } + } + + @SuppressForbidden + public JavaTestHttpServer start() { + if (internalServer.isStarted()) { + return this; + } + synchronized (this) { + if (!internalServer.isRunning()) { + if (handlers == null) { + throw new IllegalStateException("handlers must be defined"); + } + HandlerList handlerList = new HandlerList(); + handlerList.setHandlers(handlers.configured.toArray(new Handler[0])); + internalServer.setHandler(handlerList); + + HttpConfiguration httpConfiguration = new HttpConfiguration(); + + // HTTP + ServerConnector http = + new ServerConnector(internalServer, new HttpConnectionFactory(httpConfiguration)); + http.setHost("localhost"); + http.setPort(0); + internalServer.addConnector(http); + + // HTTPS + SslContextFactory sslContextFactory = new SslContextFactory(); + keystorePath = + extractKeystoreToDisk(JavaTestHttpServer.class.getResource("datadog.jks")).getPath(); + sslContextFactory.setKeyStorePath(keystorePath); + sslContextFactory.setKeyStorePassword("datadog"); + HttpConfiguration httpsConfiguration = new HttpConfiguration(httpConfiguration); + httpsConfiguration.addCustomizer(new SecureRequestCustomizer()); + ServerConnector https = + new ServerConnector( + internalServer, + new SslConnectionFactory(sslContextFactory, HttpVersion.HTTP_1_1.asString()), + new HttpConnectionFactory(httpsConfiguration)); + https.setHost("localhost"); + https.setPort(0); + internalServer.addConnector(https); + + customizer.accept(internalServer); + try { + internalServer.start(); + } catch (Exception e) { + throw new IllegalStateException(e); + } + // set after starting, otherwise two callbacks get added. + internalServer.setStopAtShutdown(true); + + try { + address = new URI("http://localhost:" + http.getLocalPort()); + secureAddress = new URI("https://localhost:" + https.getLocalPort()); + } catch (URISyntaxException e) { + throw new IllegalStateException(e); + } + } + } + long startTime = System.nanoTime(); + long rem = TimeUnit.SECONDS.toMillis(5); + while (!internalServer.isStarted()) { + if (rem <= 0) { + throw new RuntimeException( + new TimeoutException( + "Failed to start server " + this + " on port " + address.getPort())); + } + try { + Thread.sleep(Math.min(rem, 100)); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw new RuntimeException(e); + } + long endTime = System.nanoTime(); + rem -= TimeUnit.NANOSECONDS.toMillis(endTime - startTime); + startTime = endTime; + } + System.out.println("Started server " + this + " on " + address + " and " + secureAddress); + return this; + } + + private File extractKeystoreToDisk(URL internalFile) { + try (InputStream inputStream = internalFile.openStream()) { + File tempFile = File.createTempFile("datadog", ".jks"); + tempFile.deleteOnExit(); + try (OutputStream out = new FileOutputStream(tempFile)) { + byte[] buffer = new byte[1024]; + int len; + while ((len = inputStream.read(buffer)) != -1) { + out.write(buffer, 0, len); + } + } + return tempFile; + } catch (IOException e) { + throw new IllegalStateException(e); + } + } + + @SuppressForbidden + public JavaTestHttpServer stop() { + System.out.println("Stopping server " + this + " on " + address + " and " + secureAddress); + try { + internalServer.stop(); + } catch (Exception e) { + throw new IllegalStateException(e); + } + return this; + } + + @Override + public void close() { + stop(); + } + + public URI getAddress() { + return address; + } + + public URI getSecureAddress() { + return secureAddress; + } + + public X509TrustManager getTrustManager() { + return trustManager; + } + + public HostnameVerifier getHostnameVerifier() { + return hostnameVerifier; + } + + public HandlerApi.RequestApi getLastRequest() { + return last.get(); + } + + public void customizer(Consumer spec) { + this.customizer = spec; + } + + public void handlers(Consumer spec) { + if (handlers != null) { + throw new IllegalStateException("handlers already defined"); + } + handlers = new HandlersSpec(); + spec.accept(handlers); + } + + public HttpServer asHttpServer() { + return new HttpServerAdapter(this, false); + } + + public HttpServer asHttpServer(boolean secure) { + return new HttpServerAdapter(this, secure); + } + + public final class HandlersSpec { + final List configured = new ArrayList<>(); + + public void get(String path, RequestHandler spec) { + if (path == null) { + throw new IllegalArgumentException("path must not be null"); + } + configured.add(new PathHandler(HttpMethod.GET, path, spec)); + } + + public void post(String path, RequestHandler spec) { + if (path == null) { + throw new IllegalArgumentException("path must not be null"); + } + configured.add(new PathHandler(HttpMethod.POST, path, spec)); + } + + public void put(String path, RequestHandler spec) { + if (path == null) { + throw new IllegalArgumentException("path must not be null"); + } + configured.add(new PathHandler(HttpMethod.PUT, path, spec)); + } + + public void connect(RequestHandler spec) { + configured.add(new MethodHandler(HttpMethod.CONNECT, spec)); + } + + public void prefix(String path, RequestHandler spec) { + configured.add(new PrefixHandler(path, spec)); + } + + public void all(RequestHandler spec) { + configured.add(new AllHandler(spec)); + } + } + + private class AllHandler extends AbstractHandler { + final RequestHandler spec; + + AllHandler(RequestHandler spec) { + this.spec = spec; + } + + @Override + public void handle( + String target, + Request baseRequest, + HttpServletRequest request, + HttpServletResponse response) + throws IOException, ServletException { + send(baseRequest, response); + } + + void send(Request baseRequest, HttpServletResponse response) { + HandlerApi api = new HandlerApi(baseRequest, response); + last.set(api.getRequest()); + try { + spec.handle(api); + } catch (Exception e) { + try { + api.getResponse().status(500).send(e.getMessage()); + } catch (Exception ignored) { + // ignore + } + e.printStackTrace(); + } + } + } + + private class MethodHandler extends AllHandler { + private final String method; + + MethodHandler(HttpMethod method, RequestHandler spec) { + super(spec); + this.method = method.name(); + } + + @Override + public void handle( + String target, + Request baseRequest, + HttpServletRequest request, + HttpServletResponse response) + throws IOException, ServletException { + if (request.getMethod().equalsIgnoreCase(method)) { + super.handle(target, baseRequest, request, response); + } + } + } + + private class PathHandler extends MethodHandler { + private final String path; + + PathHandler(HttpMethod method, String path, RequestHandler spec) { + super(method, spec); + this.path = path.startsWith("/") ? path : "/" + path; + } + + @Override + public void handle( + String target, + Request baseRequest, + HttpServletRequest request, + HttpServletResponse response) + throws IOException, ServletException { + if (path.equals(target)) { + super.handle(target, baseRequest, request, response); + } + } + } + + private class PrefixHandler extends AllHandler { + private final String prefix; + + PrefixHandler(String prefix, RequestHandler spec) { + super(spec); + this.prefix = prefix.startsWith("/") ? prefix : "/" + prefix; + } + + @Override + public void handle( + String target, + Request baseRequest, + HttpServletRequest request, + HttpServletResponse response) + throws IOException, ServletException { + if (target.startsWith(prefix)) { + super.handle(target, baseRequest, request, response); + } + } + } + + public static class HandlerApi { + private final RequestApi req; + private final HttpServletResponse resp; + + private HandlerApi(Request request, HttpServletResponse response) { + this.req = new RequestApi(request); + this.resp = response; + } + + public RequestApi getRequest() { + return req; + } + + public ResponseApi getResponse() { + return new ResponseApi(); + } + + public void redirect(String uri) throws IOException { + resp.sendRedirect(uri); + req.orig.setHandled(true); + } + + public void handleDistributedRequest() { + boolean isDDServer = true; + String header = req.getHeader("is-dd-server"); + if (header != null) { + isDDServer = Boolean.parseBoolean(header); + } + if (isDDServer) { + AgentSpanContext extractedContext = extractContextAndGetSpanContext(req.orig, GETTER); + if (extractedContext != null) { + startSpan("test", "test-http-server", extractedContext) + .setTag("path", req.getPath()) + .setTag(Tags.SPAN_KIND, Tags.SPAN_KIND_SERVER) + .finish(); + } else { + startSpan("test", "test-http-server") + .setTag("path", req.getPath()) + .setTag(Tags.SPAN_KIND, Tags.SPAN_KIND_SERVER) + .finish(); + } + } + } + + public static class RequestApi { + final Request orig; + final String path; + final Headers headers; + final int contentLength; + final String contentType; + final byte[] body; + + RequestApi(Request req) { + this.orig = req; + this.path = req.getPathInfo(); + this.headers = new Headers(req); + this.contentLength = req.getContentLength(); + String ct = req.getContentType(); + this.contentType = ct; + try (InputStream is = req.getInputStream()) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + byte[] buffer = new byte[1024]; + int read; + while ((read = is.read(buffer)) != -1) { + baos.write(buffer, 0, read); + } + this.body = baos.toByteArray(); + } catch (IOException e) { + throw new IllegalStateException(e); + } + } + + public String getPath() { + return path; + } + + public int getContentLength() { + return contentLength; + } + + public String getContentType() { + if (contentType == null) { + return null; + } + int idx = contentType.indexOf(';'); + return idx >= 0 ? contentType.substring(0, idx) : contentType; + } + + public Headers getHeaders() { + return headers; + } + + public String getHeader(String header) { + return headers.get(header); + } + + public byte[] getBody() { + return body; + } + + public String getText() { + return new String(body); + } + + public String getParameter(String parameter) { + return orig.getParameter(parameter); + } + } + + public class ResponseApi { + private static final String DEFAULT_TYPE = "text/plain;charset=utf-8"; + private int status = 200; + private final Map headers = new HashMap<>(); + + public ResponseApi status(int status) { + this.status = status; + return this; + } + + public ResponseApi addHeader(String headerName, String headerValue) { + this.headers.put(headerName, headerValue); + return this; + } + + public void send() { + sendWithType(DEFAULT_TYPE); + } + + public void sendWithType(String contentType) { + if (contentType == null) { + throw new IllegalArgumentException("contentType must not be null"); + } + if (req.orig.isHandled()) { + throw new IllegalStateException("response already handled"); + } + req.orig.setContentType(contentType); + resp.setStatus(status); + for (Map.Entry e : headers.entrySet()) { + resp.addHeader(e.getKey(), e.getValue()); + } + req.orig.setHandled(true); + } + + public void send(String body) { + sendWithType(DEFAULT_TYPE, body); + } + + public void sendWithType(String contentType, String body) { + if (body == null) { + throw new IllegalArgumentException("body must not be null"); + } + sendWithType(contentType); + byte[] bytes = body.getBytes(StandardCharsets.UTF_8); + resp.setContentLength(bytes.length); + try { + resp.getWriter().print(body); + } catch (IOException e) { + throw new IllegalStateException(e); + } + } + + public void send(byte[] body) { + sendWithType(DEFAULT_TYPE, body); + } + + public void sendWithType(String contentType, byte[] body) { + if (body == null) { + throw new IllegalArgumentException("body must not be null"); + } + sendWithType(contentType); + resp.setContentLength(body.length); + try { + resp.getOutputStream().write(body); + } catch (IOException e) { + throw new IllegalStateException(e); + } + } + } + } + + public static class Headers { + private final Map headers = new HashMap<>(); + + private Headers(Request request) { + Enumeration names = request.getHeaderNames(); + if (names != null) { + while (names.hasMoreElements()) { + String name = names.nextElement(); + headers.put(name, request.getHeader(name)); + } + } + } + + public String get(String header) { + return headers.get(header); + } + } + + public static class HttpServerAdapter implements HttpServer { + final JavaTestHttpServer server; + final boolean secure; + URI address; + + public HttpServerAdapter(JavaTestHttpServer server, boolean secure) { + this.server = server; + this.secure = secure; + } + + @Override + public void start() throws TimeoutException { + server.start(); + address = secure ? server.secureAddress : server.address; + if (!address.getPath().endsWith("/")) { + try { + address = new URI(address.toString() + "/"); + } catch (URISyntaxException e) { + throw new IllegalStateException(e); + } + } + } + + @Override + public void stop() { + server.stop(); + } + + @Override + public URI address() { + return address; + } + } +} diff --git a/dd-smoke-tests/apm-tracing-disabled/application/build.gradle b/dd-smoke-tests/apm-tracing-disabled/application/build.gradle new file mode 100644 index 00000000000..cac44f5c2dd --- /dev/null +++ b/dd-smoke-tests/apm-tracing-disabled/application/build.gradle @@ -0,0 +1,43 @@ +// Spring Boot 2.7.x is the last line that still supports Java 8, which this smoke test +// exercises (see the `sourceCompatibility = '1.8'` below). Do not bump to 3.x without +// also moving the smoke test off Java 8. +plugins { + id 'java' + id 'org.springframework.boot' version '2.7.15' + id 'io.spring.dependency-management' version '1.0.15.RELEASE' +} + +def sharedRootDir = "$rootDir/../../../" +def sharedConfigDirectory = "$sharedRootDir/gradle" +rootProject.ext.sharedConfigDirectory = sharedConfigDirectory + +apply from: "$sharedConfigDirectory/repositories.gradle" + +if (hasProperty('appBuildDir')) { + buildDir = property('appBuildDir') +} + +version = "" + +java { + sourceCompatibility = '1.8' +} + +if (hasProperty('apiJar')) { + dependencies { + implementation files(property('apiJar')) + } +} else { + dependencies { + implementation "com.datadoghq:dd-trace-api:+" + } +} + +dependencies { + implementation 'org.springframework.boot:spring-boot-starter-web' + // OpenTracing 0.32.0 is the last release and is intentionally pinned: this smoke test + // exercises the legacy OpenTracing bridge in dd-trace-ot. Do not "upgrade" — there is + // no newer version. + implementation group: 'io.opentracing', name: 'opentracing-api', version: '0.32.0' + implementation group: 'io.opentracing', name: 'opentracing-util', version: '0.32.0' +} diff --git a/dd-smoke-tests/apm-tracing-disabled/application/settings.gradle b/dd-smoke-tests/apm-tracing-disabled/application/settings.gradle new file mode 100644 index 00000000000..bcaf7090afe --- /dev/null +++ b/dd-smoke-tests/apm-tracing-disabled/application/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'apm-tracing-disabled-smoketest' diff --git a/dd-smoke-tests/apm-tracing-disabled/src/main/java/datadog/smoketest/apmtracingdisabled/AppConfig.java b/dd-smoke-tests/apm-tracing-disabled/application/src/main/java/datadog/smoketest/apmtracingdisabled/AppConfig.java similarity index 100% rename from dd-smoke-tests/apm-tracing-disabled/src/main/java/datadog/smoketest/apmtracingdisabled/AppConfig.java rename to dd-smoke-tests/apm-tracing-disabled/application/src/main/java/datadog/smoketest/apmtracingdisabled/AppConfig.java diff --git a/dd-smoke-tests/apm-tracing-disabled/src/main/java/datadog/smoketest/apmtracingdisabled/Controller.java b/dd-smoke-tests/apm-tracing-disabled/application/src/main/java/datadog/smoketest/apmtracingdisabled/Controller.java similarity index 96% rename from dd-smoke-tests/apm-tracing-disabled/src/main/java/datadog/smoketest/apmtracingdisabled/Controller.java rename to dd-smoke-tests/apm-tracing-disabled/application/src/main/java/datadog/smoketest/apmtracingdisabled/Controller.java index 3bb55197614..8fdda3fd75e 100644 --- a/dd-smoke-tests/apm-tracing-disabled/src/main/java/datadog/smoketest/apmtracingdisabled/Controller.java +++ b/dd-smoke-tests/apm-tracing-disabled/application/src/main/java/datadog/smoketest/apmtracingdisabled/Controller.java @@ -1,6 +1,5 @@ package datadog.smoketest.apmtracingdisabled; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import io.opentracing.Span; import io.opentracing.util.GlobalTracer; import java.io.IOException; @@ -51,7 +50,6 @@ public String pathParam( } @GetMapping("/iast") - @SuppressFBWarnings public void write( @RequestParam(name = "injection", required = false) String injection, @RequestParam(name = "url", required = false) String url, diff --git a/dd-smoke-tests/apm-tracing-disabled/src/main/java/datadog/smoketest/apmtracingdisabled/SpringbootApplication.java b/dd-smoke-tests/apm-tracing-disabled/application/src/main/java/datadog/smoketest/apmtracingdisabled/SpringbootApplication.java similarity index 100% rename from dd-smoke-tests/apm-tracing-disabled/src/main/java/datadog/smoketest/apmtracingdisabled/SpringbootApplication.java rename to dd-smoke-tests/apm-tracing-disabled/application/src/main/java/datadog/smoketest/apmtracingdisabled/SpringbootApplication.java diff --git a/dd-smoke-tests/apm-tracing-disabled/build.gradle b/dd-smoke-tests/apm-tracing-disabled/build.gradle index 638260752db..d1a5504043a 100644 --- a/dd-smoke-tests/apm-tracing-disabled/build.gradle +++ b/dd-smoke-tests/apm-tracing-disabled/build.gradle @@ -1,36 +1,32 @@ -import org.springframework.boot.gradle.tasks.bundling.BootJar - plugins { - id 'java' - id 'org.springframework.boot' version '2.7.15' - id 'io.spring.dependency-management' version '1.0.15.RELEASE' + id 'dd-trace-java.smoke-test-app' id 'java-test-fixtures' } apply from: "$rootDir/gradle/java.gradle" -apply from: "$rootDir/gradle/spring-boot-plugin.gradle" + description = 'ASM Standalone Billing Tests.' -java { - sourceCompatibility = '1.8' +smokeTestApp { + gradleApp { + taskName = 'bootJar' + artifactPath = 'libs/apm-tracing-disabled-smoketest.jar' + sysProperty = 'datadog.smoketest.springboot.shadowJar.path' + } + projectJar('apiJar', project(':dd-trace-api')) } dependencies { - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation group: 'io.opentracing', name: 'opentracing-api', version: '0.32.0' - implementation group: 'io.opentracing', name: 'opentracing-util', version: '0.32.0' - implementation project(':dd-trace-api') testImplementation project(':dd-smoke-tests') testImplementation(testFixtures(project(":dd-smoke-tests:iast-util"))) } -tasks.withType(Test).configureEach { - def bootJarTask = tasks.named('bootJar', BootJar) - dependsOn bootJarTask - jvmArgumentProviders.add(new CommandLineArgumentProvider() { - @Override - Iterable asArguments() { - return bootJarTask.map { ["-Ddatadog.smoketest.springboot.shadowJar.path=${it.archiveFile.get()}"] }.get() - } - }) +spotless { + java { + target "**/*.java" + } + + groovyGradle { + target '*.gradle', "**/*.gradle" + } } diff --git a/dd-smoke-tests/apm-tracing-disabled/gradle.lockfile b/dd-smoke-tests/apm-tracing-disabled/gradle.lockfile index dde957c697e..6a6a97615b9 100644 --- a/dd-smoke-tests/apm-tracing-disabled/gradle.lockfile +++ b/dd-smoke-tests/apm-tracing-disabled/gradle.lockfile @@ -1,106 +1,93 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:apm-tracing-disabled:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath -ch.qos.logback:logback-classic:1.2.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.javaparser:javaparser-core:3.25.4=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.javaparser:javaparser-core:3.25.6=codenarc +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath -com.google.code.gson:gson:2.9.1=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.code.gson:gson:2.13.2=spotbugs +com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:logging-interceptor:4.9.3=testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:okhttp:4.9.3=testCompileClasspath,testRuntimeClasspath -com.squareup.okio:okio:2.8.0=testCompileClasspath,testRuntimeClasspath -com.sun.activation:jakarta.activation:1.2.2=testRuntimeClasspath -com.sun.mail:jakarta.mail:1.6.7=testRuntimeClasspath +com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okio:okio:1.17.5=testCompileClasspath,testRuntimeClasspath +com.sun.activation:jakarta.activation:2.0.1=testRuntimeClasspath +com.sun.mail:jakarta.mail:2.0.1=testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.opentracing:opentracing-api:0.32.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -io.opentracing:opentracing-noop:0.32.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -io.opentracing:opentracing-util:0.32.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath -jakarta.activation:jakarta.activation-api:1.2.2=testRuntimeClasspath -jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -jakarta.mail:jakarta.mail-api:1.6.7=testRuntimeClasspath -javax.servlet:javax.servlet-api:4.0.1=testCompileClasspath,testRuntimeClasspath -jaxen:jaxen:1.2.0=spotbugs +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath +jakarta.activation:jakarta.activation-api:2.1.3=testRuntimeClasspath +jakarta.mail:jakarta.mail-api:2.0.1=testRuntimeClasspath +javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath +jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.12.23=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.12.23=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs -org.apache.ant:ant-antlr:1.10.12=codenarc -org.apache.ant:ant-junit:1.10.12=codenarc +org.apache.ant:ant-antlr:1.10.14=codenarc +org.apache.ant:ant-junit:1.10.14=codenarc org.apache.bcel:bcel:6.11.0=spotbugs -org.apache.commons:commons-lang3:3.12.0=spotbugs,testRuntimeClasspath +org.apache.commons:commons-lang3:3.19.0=spotbugs +org.apache.commons:commons-lang3:3.5=testRuntimeClasspath org.apache.commons:commons-text:1.0=testRuntimeClasspath org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.logging.log4j:log4j-api:2.17.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.logging.log4j:log4j-core:2.17.2=spotbugs -org.apache.logging.log4j:log4j-to-slf4j:2.17.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-core:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-el:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-websocket:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.apache.logging.log4j:log4j-api:2.25.2=spotbugs +org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath -org.codehaus.groovy:groovy-ant:3.0.19=codenarc -org.codehaus.groovy:groovy-docgenerator:3.0.19=codenarc -org.codehaus.groovy:groovy-groovydoc:3.0.19=codenarc -org.codehaus.groovy:groovy-json:3.0.19=codenarc +org.codehaus.groovy:groovy-ant:3.0.23=codenarc +org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc +org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.23=codenarc org.codehaus.groovy:groovy-json:3.0.25=testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-templates:3.0.19=codenarc -org.codehaus.groovy:groovy-xml:3.0.19=codenarc -org.codehaus.groovy:groovy:3.0.19=codenarc +org.codehaus.groovy:groovy-templates:3.0.23=codenarc +org.codehaus.groovy:groovy-xml:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc -org.hamcrest:hamcrest-core:2.2=testRuntimeClasspath -org.hamcrest:hamcrest:2.2=testCompileClasspath,testRuntimeClasspath +org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath +org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains:annotations:13.0=testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter:5.8.2=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath @@ -121,33 +108,17 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:jul-to-slf4j:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,spotbugs,spotbugsSlf4j,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-autoconfigure:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-json:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-logging:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-tomcat:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-web:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-aop:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-beans:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-context:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-core:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-expression:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-jcl:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-web:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-webmvc:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -org.yaml:snakeyaml:1.30=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -empty=annotationProcessor,developmentOnly,spotbugsPlugins,testAnnotationProcessor,testFixturesAnnotationProcessor,testFixturesCompileClasspath +empty=annotationProcessor,runtimeClasspath,smokeTestAppExtraJarApiJar,spotbugsPlugins,testAnnotationProcessor,testFixturesAnnotationProcessor,testFixturesCompileClasspath,testFixturesRuntimeClasspath diff --git a/dd-smoke-tests/appsec/gradle.lockfile b/dd-smoke-tests/appsec/gradle.lockfile index 1aa7a4fa9b9..a249e7527f9 100644 --- a/dd-smoke-tests/appsec/gradle.lockfile +++ b/dd-smoke-tests/appsec/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:appsec:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=compileClasspath,runtimeClasspath,testCompile com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=runtimeClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=runtimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -42,8 +47,8 @@ io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=runtimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=runtimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=runtimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -71,6 +76,7 @@ org.hamcrest:hamcrest-core:1.3=runtimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=runtimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -95,8 +101,8 @@ org.ow2.asm:asm-tree:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/appsec/spring-tomcat7/gradle.lockfile b/dd-smoke-tests/appsec/spring-tomcat7/gradle.lockfile index 39e41ab497e..94464f2743c 100644 --- a/dd-smoke-tests/appsec/spring-tomcat7/gradle.lockfile +++ b/dd-smoke-tests/appsec/spring-tomcat7/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:appsec:spring-tomcat7:dependencies --write-locks aopalliance:aopalliance:1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath @@ -9,27 +10,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -44,8 +49,8 @@ io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -77,6 +82,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -101,8 +107,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/appsec/springboot-graphql/build.gradle b/dd-smoke-tests/appsec/springboot-graphql/build.gradle index 78ce91a23ca..6c07696b614 100644 --- a/dd-smoke-tests/appsec/springboot-graphql/build.gradle +++ b/dd-smoke-tests/appsec/springboot-graphql/build.gradle @@ -1,4 +1,5 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar +import com.github.jengelman.gradle.plugins.shadow.transformers.PropertiesFileTransformer plugins { id 'com.gradleup.shadow' @@ -16,8 +17,23 @@ jar { } shadowJar { - mergeServiceFiles { - include 'META-INF/spring.*' + duplicatesStrategy = DuplicatesStrategy.INCLUDE + mergeServiceFiles() + append 'META-INF/spring.handlers' + append 'META-INF/spring.schemas' + append 'META-INF/spring.tooling' + transform(PropertiesFileTransformer) { + paths = ['META-INF/spring.factories'] + mergeStrategy = "append" + } + filesNotMatching([ + 'META-INF/services/**', + 'META-INF/spring.handlers', + 'META-INF/spring.schemas', + 'META-INF/spring.tooling', + 'META-INF/spring.factories', + ]) { + duplicatesStrategy = DuplicatesStrategy.EXCLUDE } } diff --git a/dd-smoke-tests/appsec/springboot-graphql/gradle.lockfile b/dd-smoke-tests/appsec/springboot-graphql/gradle.lockfile index 3d2fccb782e..2b71eb09d7f 100644 --- a/dd-smoke-tests/appsec/springboot-graphql/gradle.lockfile +++ b/dd-smoke-tests/appsec/springboot-graphql/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:appsec:springboot-graphql:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.11=compileClasspath,runtimeClasspath @@ -10,7 +11,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -22,22 +23,26 @@ com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.15.3=compileClasspath,r com.fasterxml.jackson.module:jackson-module-parameter-names:2.15.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.15.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.graphql-java:graphql-java:18.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.graphql-java:java-dataloader:3.1.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath @@ -55,8 +60,8 @@ jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,runtimeClasspat javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -90,6 +95,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -114,8 +120,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.36=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/appsec/springboot-grpc/gradle.lockfile b/dd-smoke-tests/appsec/springboot-grpc/gradle.lockfile index 3e7a6b336b8..e6e884a316f 100644 --- a/dd-smoke-tests/appsec/springboot-grpc/gradle.lockfile +++ b/dd-smoke-tests/appsec/springboot-grpc/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:appsec:springboot-grpc:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -42,8 +47,8 @@ io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -71,6 +76,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -95,8 +101,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/appsec/springboot-security/gradle.lockfile b/dd-smoke-tests/appsec/springboot-security/gradle.lockfile index 1b35120153e..be9ac6af967 100644 --- a/dd-smoke-tests/appsec/springboot-security/gradle.lockfile +++ b/dd-smoke-tests/appsec/springboot-security/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:appsec:springboot-security:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -10,7 +11,7 @@ ch.qos.logback:logback-core:1.2.3=compileClasspath,runtimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -22,22 +23,26 @@ com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.12.3=compileClasspath,r com.fasterxml.jackson.module:jackson-module-parameter-names:2.12.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.12.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.h2database:h2:2.1.212=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.jayway.jsonpath:json-path:2.5.0=testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath @@ -58,8 +63,8 @@ jakarta.xml.bind:jakarta.xml.bind-api:2.3.3=testCompileClasspath,testRuntimeClas javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.minidev:accessors-smart:1.2=testCompileClasspath,testRuntimeClasspath @@ -103,6 +108,7 @@ org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.0=compileClasspath,runtimeClasspath, org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.jetbrains.kotlin:kotlin-stdlib:1.5.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.jetbrains:annotations:13.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -129,8 +135,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.skyscreamer:jsonassert:1.5.0=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/appsec/springboot/build.gradle b/dd-smoke-tests/appsec/springboot/build.gradle index 94c44259a45..80f67bf9cdc 100644 --- a/dd-smoke-tests/appsec/springboot/build.gradle +++ b/dd-smoke-tests/appsec/springboot/build.gradle @@ -25,6 +25,9 @@ dependencies { implementation group: 'io.opentracing', name: 'opentracing-api', version: '0.32.0' implementation group: 'io.opentracing', name: 'opentracing-util', version: '0.32.0' + // SCA reachability smoke test target: junrar 7.5.5 is vulnerable under GHSA-hf5p-q87m-crj7 + implementation group: 'com.github.junrar', name: 'junrar', version: '7.5.5' + // file upload implementation group: 'commons-fileupload', name: 'commons-fileupload', version: '1.5' diff --git a/dd-smoke-tests/appsec/springboot/gradle.lockfile b/dd-smoke-tests/appsec/springboot/gradle.lockfile index f52ae77cfd8..0eae6ce0d82 100644 --- a/dd-smoke-tests/appsec/springboot/gradle.lockfile +++ b/dd-smoke-tests/appsec/springboot/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:appsec:springboot:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -10,7 +11,7 @@ ch.qos.logback:logback-core:1.2.7=compileClasspath,runtimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -22,22 +23,27 @@ com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.0=compileClasspath,r com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.13.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.junrar:junrar:7.5.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.h2database:h2:2.1.212=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -56,12 +62,15 @@ commons-lang:commons-lang:1.0.1=compileClasspath,runtimeClasspath,testCompileCla commons-logging:commons-logging:1.1.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath +io.opentracing:opentracing-api:0.32.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.opentracing:opentracing-noop:0.32.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.opentracing:opentracing-util:0.32.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -96,6 +105,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -120,12 +130,13 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.32=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.32=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.32=compileClasspath,testCompileClasspath +org.slf4j:slf4j-api:1.7.36=runtimeClasspath,testRuntimeClasspath org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/appsec/springboot/src/main/java/datadog/smoketest/appsec/springboot/ScaReachabilityInit.java b/dd-smoke-tests/appsec/springboot/src/main/java/datadog/smoketest/appsec/springboot/ScaReachabilityInit.java new file mode 100644 index 00000000000..c891cd83e2d --- /dev/null +++ b/dd-smoke-tests/appsec/springboot/src/main/java/datadog/smoketest/appsec/springboot/ScaReachabilityInit.java @@ -0,0 +1,28 @@ +package datadog.smoketest.appsec.springboot; + +import javax.annotation.PostConstruct; +import org.springframework.stereotype.Component; + +/** + * Forces junrar's LocalFolderExtractor class to load at application startup so that SCA + * Reachability can detect the dependency at boot time rather than waiting for the first request. + * + *

      The constructor of LocalFolderExtractor is package-private, so Class.forName is used to + * trigger the class load without instantiation. After the next telemetry heartbeat the SCA + * transformer retransforms the class and registers the CVE with reached:[]. No vulnerable method is + * called, so reached stays empty. + */ +@Component +class ScaReachabilityInit { + + @PostConstruct + void init() { + try { + // Loading the class triggers the SCA transformer, which schedules a retransform on the + // next heartbeat. The retransform injects method-level callbacks and registers the CVE + // with reached:[]. Neither createDirectory nor createFile is called here. + Class.forName("com.github.junrar.LocalFolderExtractor"); + } catch (ClassNotFoundException ignored) { + } + } +} diff --git a/dd-smoke-tests/appsec/springboot/src/main/resources/META-INF/maven/com.github.junrar/junrar/pom.properties b/dd-smoke-tests/appsec/springboot/src/main/resources/META-INF/maven/com.github.junrar/junrar/pom.properties new file mode 100644 index 00000000000..87706be1c27 --- /dev/null +++ b/dd-smoke-tests/appsec/springboot/src/main/resources/META-INF/maven/com.github.junrar/junrar/pom.properties @@ -0,0 +1,3 @@ +groupId=com.github.junrar +artifactId=junrar +version=7.5.5 diff --git a/dd-smoke-tests/appsec/springboot/src/test/groovy/datadog/smoketest/appsec/ScaReachabilitySmokeTest.groovy b/dd-smoke-tests/appsec/springboot/src/test/groovy/datadog/smoketest/appsec/ScaReachabilitySmokeTest.groovy new file mode 100644 index 00000000000..8c3d733785d --- /dev/null +++ b/dd-smoke-tests/appsec/springboot/src/test/groovy/datadog/smoketest/appsec/ScaReachabilitySmokeTest.groovy @@ -0,0 +1,105 @@ +package datadog.smoketest.appsec + +import groovy.json.JsonSlurper +import spock.lang.Shared + +/** + * Smoke test for SCA Reachability (DD_APPSEC_SCA_ENABLED=true). + * + * Verifies that the tracer reports vulnerable library classes via the + * app-dependencies-loaded telemetry heartbeat using the RFC stateful model: + * + * 1. At startup, vulnerable dependencies are reported with metadata: [{cve, reached:[]}] + * (signals the backend that SCA is monitoring those CVEs). + * + * The springboot smoke test app includes junrar:7.5.5 (vulnerable under GHSA-hf5p-q87m-crj7, + * range >=0,<7.5.10). ScaReachabilityInit forces loading of LocalFolderExtractor at startup via + * Class.forName. The transformer enqueues it, retransforms on the first heartbeat, registers the + * CVE with reached:[], and injects callbacks for createDirectory and createFile. Neither method + * is called at startup, so reached stays empty. + */ +class ScaReachabilitySmokeTest extends AbstractAppSecServerSmokeTest { + + @Shared + String springBootShadowJar = System.getProperty("datadog.smoketest.appsec.springboot.shadowJar.path") + + @Override + ProcessBuilder createProcessBuilder() { + List command = new ArrayList<>() + command.add(javaPath()) + command.addAll(defaultJavaProperties) + command.addAll(defaultAppSecProperties) + // Enable SCA Reachability + command.add("-Ddd.appsec.sca.enabled=true") + command.addAll((String[]) ["-jar", springBootShadowJar, "--server.port=${httpPort}"]) + + ProcessBuilder processBuilder = new ProcessBuilder(command) + processBuilder.directory(new File(buildDirectory)) + return processBuilder + } + + void 'SCA reachability reports vulnerable junrar via telemetry'() { + when: 'application starts and telemetry heartbeats arrive' + waitForTelemetryFlat({ event -> + if (event.get('request_type') != 'app-dependencies-loaded') { + return false + } + def deps = event.get('payload')?.get('dependencies') as List + deps?.any { dep -> + def d = dep as Map + d.get('name') == 'com.github.junrar:junrar' && + (d.get('metadata') as List)?.any { (it as Map).get('type') == 'reachability' } + } + }) + + then: 'junrar 7.5.5 appears with SCA reachability metadata' + // Collect all dependencies from all app-dependencies-loaded messages + def allDependencies = [] + telemetryFlatMessages.findAll { it.get('request_type') == 'app-dependencies-loaded' }.each { + def payload = it.get('payload') as Map + def deps = payload?.get('dependencies') as List + if (deps) { + allDependencies.addAll(deps) + } + } + + // Find the junrar entry that has SCA reachability metadata. + // ScaReachabilityInit loads LocalFolderExtractor at startup; the transformer retransforms it + // on the first heartbeat and registers the CVE with reached:[]. Neither createDirectory nor + // createFile is called, so reached stays empty. + + def junrarDep = allDependencies.find { dep -> + def d = dep as Map + d.get('name') == 'com.github.junrar:junrar' && + (d.get('metadata') as List)?.any { (it as Map).get('type') == 'reachability' } + } as Map + + assert junrarDep != null : + "junrar must appear with SCA reachability metadata in app-dependencies-loaded" + assert junrarDep.get('version') == '7.5.5' : "must be the vulnerable version 7.5.5" + + // Find the reachability metadata entry + def metadata = junrarDep.get('metadata') as List + def reachabilityEntry = metadata.find { entry -> + (entry as Map).get('type') == 'reachability' + } as Map + + assert reachabilityEntry != null : "at least one reachability metadata entry expected" + + // Parse the stringified JSON value + def valueJson = reachabilityEntry.get('value') as String + assert valueJson != null && !valueJson.isEmpty() : "value must not be empty" + + def reachabilityPayload = new JsonSlurper().parseText(valueJson) as Map + assert reachabilityPayload.get('id') != null : "CVE id must be present" + assert reachabilityPayload.get('id').toString().startsWith('GHSA-') : + "id must be a GHSA identifier, got: ${reachabilityPayload.get('id')}" + assert reachabilityPayload.get('reached') instanceof List : "reached must be a list" + + // junrar has method-level symbols (createDirectory, createFile). ScaReachabilityInit only + // loads the class - neither vulnerable method is called - so reached must stay empty. + def reached = reachabilityPayload.get('reached') as List + assert reached.isEmpty() : + "createDirectory/createFile not called at startup — reached must be []" + } +} diff --git a/dd-smoke-tests/armeria-grpc/application/build.gradle b/dd-smoke-tests/armeria-grpc/application/build.gradle index 1c256936b60..7800b4519a1 100644 --- a/dd-smoke-tests/armeria-grpc/application/build.gradle +++ b/dd-smoke-tests/armeria-grpc/application/build.gradle @@ -17,6 +17,12 @@ if (hasProperty('appBuildDir')) { version = "" +// Pin bytecode target: the nested daemon now runs on JDK 21, but the smoke test launches +// the produced jar on Java 17 (per testJvmConstraints). +java { + sourceCompatibility = JavaVersion.VERSION_17 +} + protobuf { // Configure the protoc executable. protoc { diff --git a/dd-smoke-tests/armeria-grpc/application/settings.gradle b/dd-smoke-tests/armeria-grpc/application/settings.gradle index 40a417ed29c..d2e709db66c 100644 --- a/dd-smoke-tests/armeria-grpc/application/settings.gradle +++ b/dd-smoke-tests/armeria-grpc/application/settings.gradle @@ -1,34 +1 @@ -pluginManagement { - repositories { - mavenLocal() - if (settings.hasProperty("gradlePluginProxy")) { - maven { - url settings["gradlePluginProxy"] - allowInsecureProtocol = true - } - } - if (settings.hasProperty("mavenRepositoryProxy")) { - maven { - url settings["mavenRepositoryProxy"] - allowInsecureProtocol = true - } - } - gradlePluginPortal() - mavenCentral() - } -} - -def isCI = providers.environmentVariable("CI").isPresent() - -// Don't pollute the dependency cache with the build cache -if (isCI) { - def sharedRootDir = "$rootDir/../../../" - buildCache { - local { - // This needs to line up with the code in the outer project settings.gradle - directory = "$sharedRootDir/workspace/build-cache" - } - } -} - rootProject.name='armeria-smoketest' diff --git a/dd-smoke-tests/armeria-grpc/build.gradle b/dd-smoke-tests/armeria-grpc/build.gradle index ebe341a8190..835d07ca040 100644 --- a/dd-smoke-tests/armeria-grpc/build.gradle +++ b/dd-smoke-tests/armeria-grpc/build.gradle @@ -1,4 +1,5 @@ plugins { + id 'dd-trace-java.smoke-test-app' id 'com.google.protobuf' version '0.10.0' } @@ -8,6 +9,8 @@ testJvmConstraints { minJavaVersion = JavaVersion.VERSION_17 } +description = 'Armeria gRPC Smoke Tests.' + sourceSets { main { proto { @@ -39,6 +42,16 @@ protobuf { } } +smokeTestApp { + gradleApp { + taskName = 'armeriaBuild' + nestedTasks = ['build'] + artifactPath = 'libs/armeria-smoketest-all.jar' + sysProperty = 'datadog.smoketest.armeria.uberJar.path' + } + projectJar('apiJar', project(':dd-trace-api')) +} + dependencies { testImplementation project(':dd-smoke-tests') @@ -49,49 +62,13 @@ dependencies { testImplementation(testFixtures(project(":dd-smoke-tests:iast-util"))) } -def appDir = "$projectDir/application" -def appBuildDir = "$buildDir/application" -def isWindows = System.getProperty("os.name").toLowerCase().contains("win") -def gradlewCommand = isWindows ? 'gradlew.bat' : 'gradlew' - -// define the task that builds the armeria project -tasks.register('armeriaBuild', Exec) { - workingDir "$appDir" - environment += [ - "GRADLE_OPTS": "-Dorg.gradle.jvmargs='-Xmx512M'", - "JAVA_HOME": getLazyJavaHomeFor(17) - ] - commandLine "${rootDir}/${gradlewCommand}", "build", "--no-daemon", "--max-workers=4", "-PappBuildDir=$appBuildDir", "-PapiJar=${project(':dd-trace-api').tasks.jar.archiveFile.get()}" - - outputs.cacheIf { true } - - outputs.dir(appBuildDir) - .withPropertyName("applicationJar") - - inputs.files(fileTree(appDir) { - include '**/*' - exclude '.gradle/**' - }) - .withPropertyName("application") - .withPathSensitivity(PathSensitivity.RELATIVE) -} - -evaluationDependsOn ':dd-trace-api' -armeriaBuild { - dependsOn project(':dd-trace-api').tasks.named("jar") -} - tasks.named("compileTestGroovy", GroovyCompile) { dependsOn 'armeriaBuild' outputs.upToDateWhen { - !armeriaBuild.didWork + !tasks.named('armeriaBuild').get().didWork } } -tasks.withType(Test).configureEach { - jvmArgs "-Ddatadog.smoketest.armeria.uberJar.path=$appBuildDir/libs/armeria-smoketest-all.jar" -} - spotless { java { target "**/*.java" diff --git a/dd-smoke-tests/armeria-grpc/gradle.lockfile b/dd-smoke-tests/armeria-grpc/gradle.lockfile index ff9503bfb55..d136c78e59b 100644 --- a/dd-smoke-tests/armeria-grpc/gradle.lockfile +++ b/dd-smoke-tests/armeria-grpc/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:armeria-grpc:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testCompileProtoPath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testCompileProtoPath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testCompileProtoPath,tes com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testCompileProtoPath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testCompileProtoPath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testCompileProtoPath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testCompileProtoPath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testCompileProtoPath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testCompileProtoPath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testCompileProtoPath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testCompileProtoPath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testCompileProtoPath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testCompileProtoPath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,compileProtoPath,spotbugs,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,compileProtoPath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.android:annotations:4.1.1.4=testRuntimeClasspath @@ -29,15 +30,19 @@ com.google.api.grpc:proto-google-common-protos:2.17.0=compileClasspath,compilePr com.google.code.findbugs:jsr305:3.0.2=compileClasspath,compileProtoPath,runtimeClasspath,spotbugs,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.code.gson:gson:2.10.1=testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs -com.google.errorprone:error_prone_annotations:2.18.0=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.18.0=compileClasspath,compileProtoPath,runtimeClasspath com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:failureaccess:1.0.1=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -com.google.guava:guava:31.1-android=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.1=compileClasspath,compileProtoPath,runtimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.google.guava:guava:31.1-android=compileClasspath,compileProtoPath,runtimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -com.google.j2objc:j2objc-annotations:1.3=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:1.3=compileClasspath,compileProtoPath,runtimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.protobuf:protobuf-java:3.22.3=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.protobuf:protoc:3.22.3=protobufToolsLocator_protoc -com.google.re2j:re2j:1.7=testCompileProtoPath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testCompileProtoPath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath @@ -59,14 +64,14 @@ io.grpc:grpc-stub:1.56.0=compileClasspath,compileProtoPath,runtimeClasspath,test io.grpc:protoc-gen-grpc-java:1.56.0=protobufToolsLocator_grpc io.leangen.geantyref:geantyref:1.3.16=testCompileProtoPath,testRuntimeClasspath io.perfmark:perfmark-api:0.26.0=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testCompileProtoPath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testCompileProtoPath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:2.1.3=testCompileProtoPath,testRuntimeClasspath jakarta.mail:jakarta.mail-api:2.0.1=testCompileProtoPath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testCompileProtoPath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testCompileProtoPath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testCompileProtoPath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -81,7 +86,7 @@ org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apache.tomcat:annotations-api:6.0.53=testCompileClasspath,testCompileProtoPath org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath -org.checkerframework:checker-qual:3.12.0=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +org.checkerframework:checker-qual:3.12.0=compileClasspath,compileProtoPath,runtimeClasspath org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc @@ -99,6 +104,7 @@ org.hamcrest:hamcrest-core:1.3=testCompileProtoPath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testCompileProtoPath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=testCompileProtoPath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testCompileProtoPath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath @@ -123,8 +129,8 @@ org.ow2.asm:asm-tree:9.7.1=testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath @@ -136,4 +142,4 @@ org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testCompilePro org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -empty=annotationProcessor,protobuf,spotbugsPlugins,testAnnotationProcessor,testProtobuf +empty=annotationProcessor,protobuf,smokeTestAppExtraJarApiJar,spotbugsPlugins,testAnnotationProcessor,testProtobuf diff --git a/dd-smoke-tests/backend-mock/gradle.lockfile b/dd-smoke-tests/backend-mock/gradle.lockfile index 39322af0d6e..d2f18c7c747 100644 --- a/dd-smoke-tests/backend-mock/gradle.lockfile +++ b/dd-smoke-tests/backend-mock/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:backend-mock:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=compileClasspath,runtimeClasspath,testCompile com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testRuntimeClasspath @@ -17,22 +18,26 @@ com.fasterxml.jackson.core:jackson-core:2.20.0=compileClasspath,runtimeClasspath com.fasterxml.jackson.core:jackson-databind:2.20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=runtimeClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=runtimeClasspath,testRuntimeClasspath com.jayway.jsonpath:json-path:2.8.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -45,12 +50,12 @@ commons-io:commons-io:2.11.0=compileClasspath,runtimeClasspath,testCompileClassp commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=runtimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=runtimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=runtimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=runtimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=runtimeClasspath,testRuntimeClasspath net.minidev:accessors-smart:2.4.9=runtimeClasspath,testRuntimeClasspath @@ -79,14 +84,15 @@ org.freemarker:freemarker:2.3.31=compileClasspath,runtimeClasspath,testCompileCl org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=runtimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.core:0.8.14=runtimeClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.report:0.8.14=runtimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.core:0.8.15=runtimeClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.report:0.8.15=runtimeClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=runtimeClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath -org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-api:5.14.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.14.1=runtimeClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.14.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-commons:1.14.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-engine:1.14.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-launcher:1.14.1=runtimeClasspath,testRuntimeClasspath @@ -102,14 +108,14 @@ org.objenesis:objenesis:3.3=compileClasspath,testCompileClasspath,testRuntimeCla org.opentest4j:opentest4j:1.3.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=runtimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.skyscreamer:jsonassert:1.5.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -121,8 +127,8 @@ org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.snakeyaml:snakeyaml-engine:2.9=runtimeClasspath,testRuntimeClasspath org.spockframework:spock-bom:2.4-groovy-3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-junit:1.2.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-parser:1.2.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs org.xmlunit:xmlunit-core:2.10.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath empty=annotationProcessor,spotbugsPlugins,testAnnotationProcessor diff --git a/dd-smoke-tests/cli/gradle.lockfile b/dd-smoke-tests/cli/gradle.lockfile index 7b42fadc74b..1ac4ffe80c7 100644 --- a/dd-smoke-tests/cli/gradle.lockfile +++ b/dd-smoke-tests/cli/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:cli:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -72,6 +77,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -96,8 +102,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/concurrent/java-21/gradle.lockfile b/dd-smoke-tests/concurrent/java-21/gradle.lockfile index afa50f8db01..092193e49d4 100644 --- a/dd-smoke-tests/concurrent/java-21/gradle.lockfile +++ b/dd-smoke-tests/concurrent/java-21/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:concurrent:java-21:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -42,12 +47,12 @@ io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations:2.13.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentelemetry:opentelemetry-api:1.47.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentelemetry:opentelemetry-context:1.47.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -75,6 +80,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -99,8 +105,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/concurrent/java-25/gradle.lockfile b/dd-smoke-tests/concurrent/java-25/gradle.lockfile index 765a8d4460e..e74cc71c6bb 100644 --- a/dd-smoke-tests/concurrent/java-25/gradle.lockfile +++ b/dd-smoke-tests/concurrent/java-25/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:concurrent:java-25:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -43,12 +48,12 @@ io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations:2.19. io.opentelemetry:opentelemetry-api:1.53.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentelemetry:opentelemetry-common:1.53.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentelemetry:opentelemetry-context:1.53.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -76,6 +81,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -100,8 +106,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/concurrent/java-8/gradle.lockfile b/dd-smoke-tests/concurrent/java-8/gradle.lockfile index afa50f8db01..e8573fcddf3 100644 --- a/dd-smoke-tests/concurrent/java-8/gradle.lockfile +++ b/dd-smoke-tests/concurrent/java-8/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:concurrent:java-8:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -42,12 +47,12 @@ io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations:2.13.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentelemetry:opentelemetry-api:1.47.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentelemetry:opentelemetry-context:1.47.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -75,6 +80,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -99,8 +105,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/crashtracking/gradle.lockfile b/dd-smoke-tests/crashtracking/gradle.lockfile index f559ef1a19f..cde74b5b739 100644 --- a/dd-smoke-tests/crashtracking/gradle.lockfile +++ b/dd-smoke-tests/crashtracking/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:crashtracking:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:mockwebserver:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -40,13 +45,13 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:4.0.1=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.12=testCompileClasspath junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -75,6 +80,7 @@ org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.javadelight:delight-fileupload:0.0.5=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -100,8 +106,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/custom-systemloader/build.gradle b/dd-smoke-tests/custom-systemloader/build.gradle index b9d1d63caf3..28836e0f103 100644 --- a/dd-smoke-tests/custom-systemloader/build.gradle +++ b/dd-smoke-tests/custom-systemloader/build.gradle @@ -14,7 +14,7 @@ tasks.named("jar", Jar) { } tasks.named("shadowJar", ShadowJar) { - configurations = [project.configurations.runtimeClasspath] + configurations.add(project.configurations.named('runtimeClasspath')) } dependencies { diff --git a/dd-smoke-tests/custom-systemloader/gradle.lockfile b/dd-smoke-tests/custom-systemloader/gradle.lockfile index daa88945305..5661104a34b 100644 --- a/dd-smoke-tests/custom-systemloader/gradle.lockfile +++ b/dd-smoke-tests/custom-systemloader/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:custom-systemloader:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -39,13 +44,13 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath javax.ws.rs:javax.ws.rs-api:2.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -73,6 +78,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -97,8 +103,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/datastreams/kafkaschemaregistry/build.gradle b/dd-smoke-tests/datastreams/kafkaschemaregistry/build.gradle index fe525e8a70e..502d39ba6f7 100644 --- a/dd-smoke-tests/datastreams/kafkaschemaregistry/build.gradle +++ b/dd-smoke-tests/datastreams/kafkaschemaregistry/build.gradle @@ -3,11 +3,9 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar plugins { id 'com.gradleup.shadow' id 'java' - id 'org.springframework.boot' version '2.6.3' } apply from: "$rootDir/gradle/java.gradle" -apply from: "$rootDir/gradle/spring-boot-plugin.gradle" description = 'Kafka Smoke Tests.' tasks.named("jar", Jar) { diff --git a/dd-smoke-tests/datastreams/kafkaschemaregistry/gradle.lockfile b/dd-smoke-tests/datastreams/kafkaschemaregistry/gradle.lockfile index 20adae59d50..d6511c9bf96 100644 --- a/dd-smoke-tests/datastreams/kafkaschemaregistry/gradle.lockfile +++ b/dd-smoke-tests/datastreams/kafkaschemaregistry/gradle.lockfile @@ -1,72 +1,72 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:datastreams:kafkaschemaregistry:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-classic:1.2.6=compileClasspath,productionRuntimeClasspath,runtimeClasspath +ch.qos.logback:logback-classic:1.2.6=compileClasspath,runtimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.6=compileClasspath,productionRuntimeClasspath,runtimeClasspath -com.eclipsesource.minimal-json:minimal-json:0.9.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.14.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.14.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.14.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.14.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.6=compileClasspath,runtimeClasspath +com.eclipsesource.minimal-json:minimal-json:0.9.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.fasterxml.jackson.core:jackson-annotations:2.14.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.fasterxml.jackson.core:jackson-core:2.14.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.fasterxml.jackson.core:jackson-databind:2.14.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.fasterxml.jackson:jackson-bom:2.14.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.luben:zstd-jni:1.5.5-1=productionRuntimeClasspath,runtimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.luben:zstd-jni:1.5.5-1=runtimeClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs -com.google.api.grpc:proto-google-common-protos:2.22.1=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.code.findbugs:jsr305:3.0.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.google.api.grpc:proto-google-common-protos:2.22.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.code.findbugs:jsr305:3.0.2=compileClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs -com.google.code.gson:gson:2.8.6=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.errorprone:error_prone_annotations:2.18.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.code.gson:gson:2.8.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.18.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:failureaccess:1.0.1=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.guava:guava:32.0.1-jre=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.j2objc:j2objc-annotations:2.8=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.protobuf:protobuf-java-util:3.19.6=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.protobuf:protobuf-java:3.25.3=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.6=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.squareup.okio:okio-jvm:3.0.0=productionRuntimeClasspath +com.google.guava:failureaccess:1.0.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:32.0.1-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:2.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.protobuf:protobuf-java-util:3.19.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.protobuf:protobuf-java:3.25.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okio:okio-jvm:3.4.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okio:okio:3.4.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.squareup.wire:wire-runtime-jvm:4.8.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.wire:wire-runtime-jvm:4.8.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.wire:wire-runtime:4.8.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.squareup.wire:wire-schema-jvm:4.8.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.squareup.wire:wire-schema-jvm:4.8.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup:javapoet:1.13.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup:kotlinpoet:1.14.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath -io.confluent:common-utils:7.5.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.confluent:kafka-avro-serializer:7.5.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.confluent:kafka-protobuf-provider:7.5.1=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.confluent:kafka-protobuf-serializer:7.5.1=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.confluent:kafka-protobuf-types:7.5.1=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.confluent:kafka-schema-registry-client:7.5.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.confluent:kafka-schema-serializer:7.5.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.confluent:logredactor-metrics:1.0.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.confluent:logredactor:1.0.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.confluent:common-utils:7.5.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.confluent:kafka-avro-serializer:7.5.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.confluent:kafka-protobuf-provider:7.5.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.confluent:kafka-protobuf-serializer:7.5.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.confluent:kafka-protobuf-types:7.5.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.confluent:kafka-schema-registry-client:7.5.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.confluent:kafka-schema-serializer:7.5.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.confluent:logredactor-metrics:1.0.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.confluent:logredactor:1.0.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.swagger.core.v3:swagger-annotations:2.1.10=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.swagger.core.v3:swagger-annotations:2.1.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs net.bytebuddy:byte-buddy-agent:1.12.8=testRuntimeClasspath net.bytebuddy:byte-buddy:1.12.8=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc -org.apache.avro:avro:1.11.3=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.apache.avro:avro:1.11.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.apache.bcel:bcel:6.11.0=spotbugs -org.apache.commons:commons-compress:1.22=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.commons:commons-lang3:3.12.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.apache.commons:commons-compress:1.22=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.apache.commons:commons-lang3:3.12.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.apache.commons:commons-lang3:3.19.0=spotbugs org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.kafka:kafka-clients:7.5.2-ccs=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.apache.kafka:kafka-clients:7.5.2-ccs=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath -org.checkerframework:checker-qual:3.33.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.checkerframework:checker-qual:3.33.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc @@ -81,15 +81,11 @@ org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jetbrains.kotlin:kotlin-reflect:1.8.21=runtimeClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-common:1.6.0=productionRuntimeClasspath org.jetbrains.kotlin:kotlin-stdlib-common:1.8.21=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.31=productionRuntimeClasspath org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.8.21=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.5.31=productionRuntimeClasspath org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.21=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib:1.6.0=productionRuntimeClasspath org.jetbrains.kotlin:kotlin-stdlib:1.8.21=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jetbrains:annotations:13.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jetbrains:annotations:13.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -99,7 +95,7 @@ org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntime org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath -org.lz4:lz4-java:1.8.0=productionRuntimeClasspath,runtimeClasspath,testRuntimeClasspath +org.lz4:lz4-java:1.8.0=runtimeClasspath,testRuntimeClasspath org.mockito:mockito-core:4.4.0=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath @@ -111,14 +107,14 @@ org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.36=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath -org.xerial.snappy:snappy-java:1.1.10.5=productionRuntimeClasspath,runtimeClasspath,testRuntimeClasspath +org.xerial.snappy:snappy-java:1.1.10.5=runtimeClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -org.yaml:snakeyaml:2.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -empty=annotationProcessor,developmentOnly,shadow,spotbugsPlugins,testAnnotationProcessor +org.yaml:snakeyaml:2.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +empty=annotationProcessor,shadow,spotbugsPlugins,testAnnotationProcessor diff --git a/dd-smoke-tests/debugger-integration-tests/build.gradle b/dd-smoke-tests/debugger-integration-tests/build.gradle index e07b7d6e7b6..da0000bcfee 100644 --- a/dd-smoke-tests/debugger-integration-tests/build.gradle +++ b/dd-smoke-tests/debugger-integration-tests/build.gradle @@ -17,8 +17,8 @@ dependencies { testImplementation project(':dd-java-agent:agent-debugger') testImplementation project(':dd-java-agent:agent-debugger:debugger-el') testImplementation project(':dd-java-agent:agent-debugger:debugger-bootstrap') - // dependency on some helper classes made only for tests - testImplementation project(':dd-java-agent:agent-debugger').sourceSets.test.output + // helper classes shared via java-test-fixtures (LogProbeTestHelper, MoshiSnapshotTestHelper) + testImplementation testFixtures(project(':dd-java-agent:agent-debugger')) testImplementation libs.bundles.junit5 testImplementation libs.bundles.mockito } diff --git a/dd-smoke-tests/debugger-integration-tests/gradle.lockfile b/dd-smoke-tests/debugger-integration-tests/gradle.lockfile index 3aa13d8d78c..7cacdfe1c4c 100644 --- a/dd-smoke-tests/debugger-integration-tests/gradle.lockfile +++ b/dd-smoke-tests/debugger-integration-tests/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:debugger-integration-tests:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -10,7 +11,7 @@ ch.qos.logback:logback-core:1.2.3=compileClasspath,runtimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -21,22 +22,26 @@ com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.4=compileClasspath,run com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:mockwebserver:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -49,14 +54,14 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.12=compileClasspath,runtimeClasspath,testCompileClasspath junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -89,6 +94,7 @@ org.hamcrest:hamcrest-core:1.3=compileClasspath,runtimeClasspath,testCompileClas org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -108,14 +114,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/debugger-integration-tests/src/main/java/datadog/smoketest/debugger/DebuggerTestApplication.java b/dd-smoke-tests/debugger-integration-tests/src/main/java/datadog/smoketest/debugger/DebuggerTestApplication.java index 2c1ffc19559..030167f6496 100644 --- a/dd-smoke-tests/debugger-integration-tests/src/main/java/datadog/smoketest/debugger/DebuggerTestApplication.java +++ b/dd-smoke-tests/debugger-integration-tests/src/main/java/datadog/smoketest/debugger/DebuggerTestApplication.java @@ -6,7 +6,9 @@ import java.lang.management.ManagementFactory; import java.lang.management.OperatingSystemMXBean; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.function.Consumer; @@ -51,6 +53,7 @@ private static void registerMethods() { methodsByName.put("multiProbesFullMethod", Main::runFullMethod); methodsByName.put("loopingFullMethod", Main::runLoopingFullMethod); methodsByName.put("exceptionMethod", Main::runExceptionMethod); + methodsByName.put("processLargeCollection", Main::runProcessLargeCollection); } private static void emptyMethod(String arg) {} @@ -82,6 +85,10 @@ private static void runExceptionMethod(String s) { exceptionMethod(s); } + private static void runProcessLargeCollection(String arg) { + processLargeCollection(1_000_000); + } + private static String fullMethod( int argInt, String argStr, double argDouble, Map argMap, String... argVar) { try { @@ -113,4 +120,14 @@ private static void exceptionMethod(String arg) { } } } + + private static void processLargeCollection(int largeListSize) { + List largeList = new ArrayList<>(); + for (int i = 0; i < largeListSize; i++) { + largeList.add("foobar" + i); + } + for (int i = 0; i < largeListSize; i++) { + largeList.get(i); + } + } } diff --git a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/InProductEnablementIntegrationTest.java b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/InProductEnablementIntegrationTest.java index 232bc36345f..32dd3020d04 100644 --- a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/InProductEnablementIntegrationTest.java +++ b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/InProductEnablementIntegrationTest.java @@ -42,6 +42,7 @@ void testDynamicInstrumentationEnablement() throws Exception { waitForReTransformation(appUrl); // wait for retransformation of removed probe } + @Flaky @Test @DisplayName("testDynamicInstrumentationEnablementWithLineProbe") void testDynamicInstrumentationEnablementWithLineProbe() throws Exception { diff --git a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/LogProbesIntegrationTest.java b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/LogProbesIntegrationTest.java index 10c2bd38bd9..338aa762a6c 100644 --- a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/LogProbesIntegrationTest.java +++ b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/LogProbesIntegrationTest.java @@ -1,7 +1,9 @@ package datadog.smoketest; +import static com.datadog.debugger.el.DSL.all; import static com.datadog.debugger.el.DSL.and; import static com.datadog.debugger.el.DSL.eq; +import static com.datadog.debugger.el.DSL.filter; import static com.datadog.debugger.el.DSL.gt; import static com.datadog.debugger.el.DSL.len; import static com.datadog.debugger.el.DSL.nullValue; @@ -9,6 +11,7 @@ import static com.datadog.debugger.el.DSL.value; import static com.datadog.debugger.el.DSL.when; import static com.datadog.debugger.util.LogProbeTestHelper.parseTemplate; +import static java.util.Collections.singletonList; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; @@ -353,7 +356,7 @@ void testLineProbe() throws Exception { LogProbe probe = LogProbe.builder() .probeId(LINE_PROBE_ID1) - .where("DebuggerTestApplication.java", 88) + .where("DebuggerTestApplication.java", 95) .captureSnapshot(true) .build(); setCurrentConfiguration(createConfig(probe)); @@ -362,7 +365,7 @@ void testLineProbe() throws Exception { registerSnapshotListener( snapshot -> { assertEquals(LINE_PROBE_ID1.getId(), snapshot.getProbe().getId()); - CapturedContext capturedContext = snapshot.getCaptures().getLines().get(88); + CapturedContext capturedContext = snapshot.getCaptures().getLines().get(95); assertFullMethodCaptureArgs(capturedContext); assertNull(capturedContext.getLocals()); assertNull(capturedContext.getCapturedThrowable()); @@ -573,6 +576,74 @@ void testCaughtException() throws Exception { () -> String.format("timeout snapshotReceived=%s", snapshotReceived.get())); } + @Test + @DisplayName("testConditionTimeout") + void testConditionTimeout() throws Exception { + final String EXPECTED_UPLOADS = "4"; // 3 statuses + 1 snapshot + final String METHOD_NAME = "processLargeCollection"; + LogProbe probe = + LogProbe.builder() + .probeId(PROBE_ID) + .where(MAIN_CLASS_NAME, METHOD_NAME) + .evaluateAt(MethodLocation.EXIT) + .captureSnapshot(true) + .when( + new ProbeCondition( + when(all(ref("largeList"), gt(len(ref("@it")), value(0)))), + "all(largeList, {len(@it) > 0}")) + .build(); + setCurrentConfiguration(createConfig(probe)); + targetProcess = createProcessBuilder(logFilePath, METHOD_NAME, EXPECTED_UPLOADS).start(); + AtomicBoolean snapshotReceived = new AtomicBoolean(); + registerSnapshotListener( + snapshot -> { + if (snapshot.getProbe().getProbeId().equals(PROBE_ID)) { + assertEquals(1, snapshot.getEvaluationErrors().size()); + assertEquals("timeout (50ms)", snapshot.getEvaluationErrors().get(0).getMessage()); + snapshotReceived.set(true); + } + }); + processRequests( + snapshotReceived::get, + () -> String.format("timeout snapshotReceived=%s", snapshotReceived.get())); + } + + @Test + @DisplayName("testTemplateTimeout") + void testTemplateTimeout() throws Exception { + final String EXPECTED_UPLOADS = "4"; // 3 statuses + 1 snapshot + final String METHOD_NAME = "processLargeCollection"; + final String LARGE_COLLECTION_TEMPLATE = "{filter(largeList, {len(@it) > 0})}"; + List segments = + singletonList( + new LogProbe.Segment( + new ValueScript( + filter(ref("largeList"), gt(len(ref("@it")), value(0))), + "filter(largeList, {len(@it) > 0})"))); + LogProbe probe = + LogProbe.builder() + .probeId(PROBE_ID) + .where(MAIN_CLASS_NAME, METHOD_NAME) + .evaluateAt(MethodLocation.EXIT) + .captureSnapshot(true) + .template(LARGE_COLLECTION_TEMPLATE, segments) + .build(); + setCurrentConfiguration(createConfig(probe)); + targetProcess = createProcessBuilder(logFilePath, METHOD_NAME, EXPECTED_UPLOADS).start(); + AtomicBoolean snapshotReceived = new AtomicBoolean(); + registerSnapshotListener( + snapshot -> { + if (snapshot.getProbe().getProbeId().equals(PROBE_ID)) { + assertEquals(1, snapshot.getEvaluationErrors().size()); + assertEquals("timeout (50ms)", snapshot.getEvaluationErrors().get(0).getMessage()); + snapshotReceived.set(true); + } + }); + processRequests( + snapshotReceived::get, + () -> String.format("timeout snapshotReceived=%s", snapshotReceived.get())); + } + private ProbeId getProbeId(int i) { return new ProbeId(String.valueOf(i), 0); } diff --git a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/MetricProbesIntegrationTest.java b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/MetricProbesIntegrationTest.java index a5b5a1c45db..5c700b07acf 100644 --- a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/MetricProbesIntegrationTest.java +++ b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/MetricProbesIntegrationTest.java @@ -210,7 +210,7 @@ private void doLineMetric( MetricProbe.builder() .probeId(PROBE_ID) // on line: System.out.println("fullMethod"); - .where("DebuggerTestApplication.java", 88) + .where("DebuggerTestApplication.java", 95) .kind(kind) .metricName(metricName) .valueScript(script) diff --git a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/MoshiConfigTestHelper.java b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/MoshiConfigTestHelper.java index ce702c585b3..23eb7f6fb17 100644 --- a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/MoshiConfigTestHelper.java +++ b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/MoshiConfigTestHelper.java @@ -40,8 +40,8 @@ import com.squareup.moshi.JsonWriter; import com.squareup.moshi.Moshi; import datadog.trace.bootstrap.debugger.el.DebuggerScript; -import edu.umd.cs.findbugs.annotations.NonNull; import java.io.IOException; +import javax.annotation.Nonnull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -61,7 +61,7 @@ public static Moshi createMoshiConfig() { private static class ProbeConditionJsonAdapter extends ProbeCondition.ProbeConditionJsonAdapter { @Override - public void toJson(@NonNull JsonWriter jsonWriter, ProbeCondition value) throws IOException { + public void toJson(@Nonnull JsonWriter jsonWriter, ProbeCondition value) throws IOException { if (value == null) { jsonWriter.nullValue(); return; @@ -153,7 +153,20 @@ public Void visit(FilterCollectionExpression filterCollectionExpression) { @Override public Void visit(HasAllExpression hasAllExpression) { - throw new UnsupportedOperationException("hasAll expression"); + try { + jsonWriter.beginObject(); + jsonWriter.name("all"); + jsonWriter.beginArray(); + hasAllExpression.getValueExpression().accept(this); + // jsonWriter.beginObject(); + hasAllExpression.getFilterPredicateExpression().accept(this); + // jsonWriter.endObject(); + jsonWriter.endArray(); + jsonWriter.endObject(); + } catch (IOException ex) { + LOGGER.debug("Cannot serialize: ", ex); + } + return null; } @Override diff --git a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/ProcessBuilderHelper.java b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/ProcessBuilderHelper.java index 5faf29bbaa5..e0ee9150109 100644 --- a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/ProcessBuilderHelper.java +++ b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/ProcessBuilderHelper.java @@ -1,5 +1,6 @@ package datadog.smoketest; +import datadog.environment.OperatingSystem; import java.io.File; import java.nio.file.Path; import java.util.ArrayList; @@ -56,6 +57,10 @@ public static ProcessBuilder createProcessBuilder( List command = new ArrayList<>(); command.addAll(baseCommand); + if (OperatingSystem.isLinux() && OperatingSystem.architecture().isArm64()) { + // Disable CDS to avoid SIGSEGVs on Linux arm64. + command.add(1, "-Xshare:off"); + } command.addAll(additionalCommandParams); command.addAll(Arrays.asList("-cp", classpath, mainClassName)); command.addAll(Arrays.asList(params)); diff --git a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/SpanDecorationProbesIntegrationTests.java b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/SpanDecorationProbesIntegrationTests.java index 93009c1a929..09346289fb7 100644 --- a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/SpanDecorationProbesIntegrationTests.java +++ b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/SpanDecorationProbesIntegrationTests.java @@ -18,6 +18,7 @@ import com.datadog.debugger.probe.SpanDecorationProbe; import datadog.trace.bootstrap.debugger.EvaluationError; import datadog.trace.test.agent.decoder.DecodedSpan; +import datadog.trace.test.util.Flaky; import datadog.trace.test.util.NonRetryable; import java.nio.file.Path; import java.util.Arrays; @@ -44,6 +45,8 @@ void setup(TestInfo testInfo) throws Exception { protected ProcessBuilder createProcessBuilder(Path logFilePath, String... params) { List commandParams = getDebuggerCommandParams(); commandParams.add("-Ddd.trace.enabled=true"); // explicitly enable tracer + // increase eval timeout for decoration evaluations + commandParams.add("-Ddd.dynamic.instrumentation.evaluation.timeout.ms=100"); return ProcessBuilderHelper.createProcessBuilder( commandParams, logFilePath, getAppClass(), params); } @@ -79,6 +82,7 @@ void testMethodSimpleTagNoCondition() throws Exception { traceReceived::get, () -> String.format("timeout traceReceived=%s", traceReceived.get())); } + @Flaky @Test @DisplayName("testMethodMultiTagsMultiConditions") @DisabledIf( diff --git a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/SpanProbesIntegrationTest.java b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/SpanProbesIntegrationTest.java index 3c55b8ff759..6cf6f17f883 100644 --- a/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/SpanProbesIntegrationTest.java +++ b/dd-smoke-tests/debugger-integration-tests/src/test/java/datadog/smoketest/SpanProbesIntegrationTest.java @@ -60,7 +60,7 @@ void testLineRangeSpan() throws Exception { .probeId(PROBE_ID) // from line: System.out.println("fullMethod"); // to line: + String.join(",", argVar); - .where(MAIN_CLASS_NAME, 88, 97) + .where(MAIN_CLASS_NAME, 95, 104) .build(); setCurrentConfiguration(createSpanConfig(spanProbe)); targetProcess = createProcessBuilder(logFilePath, METHOD_NAME, EXPECTED_UPLOADS).start(); @@ -69,7 +69,7 @@ void testLineRangeSpan() throws Exception { registerTraceListener( decodedTrace -> { DecodedSpan decodedSpan = decodedTrace.getSpans().get(0); - assertEquals("Main.fullMethod:L88-97", decodedSpan.getResource()); + assertEquals("Main.fullMethod:L95-104", decodedSpan.getResource()); traceReceived.set(true); }); processRequests( @@ -92,7 +92,7 @@ void testSingleLineSpan() throws Exception { SpanProbe.builder() .probeId(PROBE_ID) // on line: System.out.println("fullMethod"); - .where(MAIN_CLASS_NAME, 88) + .where(MAIN_CLASS_NAME, 95) .build(); setCurrentConfiguration(createSpanConfig(spanProbe)); targetProcess = createProcessBuilder(logFilePath, METHOD_NAME, EXPECTED_UPLOADS).start(); diff --git a/dd-smoke-tests/dynamic-config/gradle.lockfile b/dd-smoke-tests/dynamic-config/gradle.lockfile index f1c4386ecbf..fb001c8e73c 100644 --- a/dd-smoke-tests/dynamic-config/gradle.lockfile +++ b/dd-smoke-tests/dynamic-config/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:dynamic-config:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -42,12 +47,12 @@ io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath io.opentracing:opentracing-api:0.32.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentracing:opentracing-noop:0.32.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentracing:opentracing-util:0.32.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -75,6 +80,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -99,8 +105,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/field-injection/build.gradle b/dd-smoke-tests/field-injection/build.gradle index 2117c2e056b..468f33342f9 100644 --- a/dd-smoke-tests/field-injection/build.gradle +++ b/dd-smoke-tests/field-injection/build.gradle @@ -14,7 +14,7 @@ tasks.named("jar", Jar) { } tasks.named("shadowJar", ShadowJar) { - configurations = [project.configurations.runtimeClasspath] + configurations.add(project.configurations.named('runtimeClasspath')) } dependencies { diff --git a/dd-smoke-tests/field-injection/gradle.lockfile b/dd-smoke-tests/field-injection/gradle.lockfile index f0dd996a02e..bfe5dba6050 100644 --- a/dd-smoke-tests/field-injection/gradle.lockfile +++ b/dd-smoke-tests/field-injection/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:field-injection:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -72,6 +77,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -96,8 +102,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/gradle.lockfile b/dd-smoke-tests/gradle.lockfile index c47db6f102f..5be43003ede 100644 --- a/dd-smoke-tests/gradle.lockfile +++ b/dd-smoke-tests/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=compileClasspath,runtimeClasspath,testCompile com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=runtimeClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=runtimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=compileClasspath,runtimeClasspath,testCompileClassp commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=runtimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=runtimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=runtimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=runtimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=runtimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -72,6 +77,7 @@ org.hamcrest:hamcrest-core:1.3=runtimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=runtimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=compileClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=compileClasspath,testCompileClasspath,testRuntimeClasspath @@ -96,8 +102,8 @@ org.ow2.asm:asm-tree:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/gradle/gradle.lockfile b/dd-smoke-tests/gradle/gradle.lockfile index 468de297da5..abc86779b28 100644 --- a/dd-smoke-tests/gradle/gradle.lockfile +++ b/dd-smoke-tests/gradle/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:gradle:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -17,22 +18,26 @@ com.fasterxml.jackson.core:jackson-core:2.20.0=testCompileClasspath,testRuntimeC com.fasterxml.jackson.core:jackson-databind:2.20.0=testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.20.0=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.jayway.jsonpath:json-path:2.8.0=testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -45,12 +50,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.minidev:accessors-smart:2.4.9=testRuntimeClasspath @@ -79,10 +84,11 @@ org.freemarker:freemarker:2.3.31=testCompileClasspath,testRuntimeClasspath org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.core:0.8.14=testRuntimeClasspath -org.jacoco:org.jacoco.report:0.8.14=testRuntimeClasspath +org.jacoco:org.jacoco.core:0.8.15=testRuntimeClasspath +org.jacoco:org.jacoco.report:0.8.15=testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -102,14 +108,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.skyscreamer:jsonassert:1.5.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/gradle/src/test/groovy/datadog/smoketest/AbstractGradleTest.groovy b/dd-smoke-tests/gradle/src/test/groovy/datadog/smoketest/AbstractGradleTest.groovy deleted file mode 100644 index 5328b4bacac..00000000000 --- a/dd-smoke-tests/gradle/src/test/groovy/datadog/smoketest/AbstractGradleTest.groovy +++ /dev/null @@ -1,143 +0,0 @@ -package datadog.smoketest - -import datadog.environment.JavaVirtualMachine -import datadog.trace.civisibility.CiVisibilitySmokeTest -import datadog.trace.util.ComparableVersion -import org.gradle.internal.impldep.org.apache.commons.io.FileUtils -import org.junit.jupiter.api.Assumptions -import spock.lang.AutoCleanup -import spock.lang.Shared -import spock.lang.TempDir -import spock.util.environment.Jvm - -import java.nio.charset.StandardCharsets -import java.nio.file.FileVisitResult -import java.nio.file.Files -import java.nio.file.Path -import java.nio.file.Paths -import java.nio.file.SimpleFileVisitor -import java.nio.file.attribute.BasicFileAttributes -import java.util.regex.Matcher -import java.util.regex.Pattern - -class AbstractGradleTest extends CiVisibilitySmokeTest { - - static final String LATEST_GRADLE_VERSION = getLatestGradleVersion() - - // test resources use this instead of ".gradle" to avoid unwanted evaluation - private static final String GRADLE_TEST_RESOURCE_EXTENSION = ".gradleTest" - private static final String GRADLE_REGULAR_EXTENSION = ".gradle" - - private static final ComparableVersion GRADLE_9 = new ComparableVersion("9.0.0") - - @TempDir - protected Path projectFolder - - @Shared - @AutoCleanup - protected MockBackend mockBackend = new MockBackend() - - def setup() { - mockBackend.reset() - } - - private static final Pattern PLACEHOLDER_PATTERN = Pattern.compile('\\$\\{(.+?)\\}') - - protected void givenGradleProjectFiles(String projectFilesSources, Map> replacementsByFileName = [:]) { - def projectResourcesUri = this.getClass().getClassLoader().getResource(projectFilesSources).toURI() - def projectResourcesPath = Paths.get(projectResourcesUri) - FileUtils.copyDirectory(projectResourcesPath.toFile(), projectFolder.toFile()) - - Files.walkFileTree(projectFolder, new SimpleFileVisitor() { - @Override - FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { - def replacements = replacementsByFileName.get(file.getFileName().toString()) - if (replacements != null) { - def fileContents = new String(Files.readAllBytes(file), StandardCharsets.UTF_8) - Matcher matcher = PLACEHOLDER_PATTERN.matcher(fileContents) - - StringBuffer result = new StringBuffer() - while (matcher.find()) { - String propertyName = matcher.group(1) - String replacement = replacements.getOrDefault(propertyName, matcher.group(0)) - matcher.appendReplacement(result, Matcher.quoteReplacement(replacement)) - } - matcher.appendTail(result) - - Files.write(file, result.toString().getBytes(StandardCharsets.UTF_8)) - } - - if (file.toString().endsWith(GRADLE_TEST_RESOURCE_EXTENSION)) { - def fileWithFixedExtension = Paths.get(file.toString().replace(GRADLE_TEST_RESOURCE_EXTENSION, GRADLE_REGULAR_EXTENSION)) - Files.move(file, fileWithFixedExtension) - } - - return FileVisitResult.CONTINUE - } - }) - - // creating empty .git directory so that the tracer could detect projectFolder as repo root - Files.createDirectory(projectFolder.resolve(".git")) - } - - protected void givenGradleVersionIsCompatibleWithCurrentJvm(String gradleVersion) { - Assumptions.assumeTrue(isSupported(new ComparableVersion(gradleVersion)), - "Current JVM " + Jvm.current.javaVersion + " does not support Gradle version " + gradleVersion) - } - - private static boolean isSupported(ComparableVersion gradleVersion) { - // https://docs.gradle.org/current/userguide/compatibility.html - if (Jvm.current.isJavaVersionCompatible(26)) { - return gradleVersion.compareTo(new ComparableVersion("9.4")) >= 0 - } else if (Jvm.current.isJavaVersionCompatible(25)) { - return gradleVersion.compareTo(new ComparableVersion("9.1")) >= 0 - } else if (Jvm.current.isJavaVersionCompatible(24)) { - return gradleVersion.compareTo(new ComparableVersion("8.14")) >= 0 - } else if (Jvm.current.java21Compatible) { - return gradleVersion.compareTo(new ComparableVersion("8.4")) >= 0 - } else if (Jvm.current.java20) { - return gradleVersion.compareTo(new ComparableVersion("8.1")) >= 0 - } else if (Jvm.current.java19) { - return gradleVersion.compareTo(new ComparableVersion("7.6")) >= 0 - } else if (Jvm.current.java18) { - return gradleVersion.compareTo(new ComparableVersion("7.5")) >= 0 - } else if (Jvm.current.java17) { - return gradleVersion.compareTo(new ComparableVersion("7.3")) >= 0 - } else if (Jvm.current.java16) { - return gradleVersion.isWithin(new ComparableVersion("7.0"), GRADLE_9) - } else if (Jvm.current.java15) { - return gradleVersion.isWithin(new ComparableVersion("6.7"), GRADLE_9) - } else if (Jvm.current.java14) { - return gradleVersion.isWithin(new ComparableVersion("6.3"), GRADLE_9) - } else if (Jvm.current.java13) { - return gradleVersion.isWithin(new ComparableVersion("6.0"), GRADLE_9) - } else if (Jvm.current.java12) { - return gradleVersion.isWithin(new ComparableVersion("5.4"), GRADLE_9) - } else if (Jvm.current.java11) { - return gradleVersion.isWithin(new ComparableVersion("5.0"), GRADLE_9) - } else if (Jvm.current.java10) { - return gradleVersion.isWithin(new ComparableVersion("4.7"), GRADLE_9) - } else if (Jvm.current.java9) { - return gradleVersion.isWithin(new ComparableVersion("4.3"), GRADLE_9) - } else if (Jvm.current.java8) { - return gradleVersion.isWithin(new ComparableVersion("2.0"), GRADLE_9) - } - return false - } - - protected void givenConfigurationCacheIsCompatibleWithCurrentPlatform(boolean configurationCacheEnabled) { - if (configurationCacheEnabled) { - Assumptions.assumeFalse(JavaVirtualMachine.isIbm8(), "Configuration cache is not compatible with IBM 8") - } - } - - private static String getLatestGradleVersion() { - def properties = new Properties() - def stream = AbstractGradleTest.classLoader.getResourceAsStream("latest-tool-versions.properties") - if (stream == null) { - throw new IllegalStateException("Could not find latest-tool-versions.properties on classpath") - } - stream.withCloseable { properties.load(it) } - return properties.getProperty("gradle.version") - } -} diff --git a/dd-smoke-tests/gradle/src/test/groovy/datadog/smoketest/GradleDaemonSmokeTest.groovy b/dd-smoke-tests/gradle/src/test/groovy/datadog/smoketest/GradleDaemonSmokeTest.groovy deleted file mode 100644 index 2b240f47ab9..00000000000 --- a/dd-smoke-tests/gradle/src/test/groovy/datadog/smoketest/GradleDaemonSmokeTest.groovy +++ /dev/null @@ -1,261 +0,0 @@ -package datadog.smoketest - -import datadog.environment.JavaVirtualMachine -import datadog.trace.api.config.CiVisibilityConfig -import datadog.trace.api.config.GeneralConfig -import datadog.trace.api.config.TraceInstrumentationConfig -import java.nio.file.Files -import java.nio.file.Path -import org.gradle.testkit.runner.BuildResult -import org.gradle.testkit.runner.GradleRunner -import org.gradle.testkit.runner.TaskOutcome -import org.gradle.util.DistributionLocator -import org.gradle.util.GradleVersion -import org.gradle.wrapper.Download -import org.gradle.wrapper.GradleUserHomeLookup -import org.gradle.wrapper.Install -import org.gradle.wrapper.PathAssembler -import org.gradle.wrapper.WrapperConfiguration -import spock.lang.IgnoreIf -import spock.lang.Shared -import spock.lang.TempDir - -class GradleDaemonSmokeTest extends AbstractGradleTest { - - private static final String TEST_SERVICE_NAME = "test-gradle-service" - - private static final int GRADLE_DISTRIBUTION_NETWORK_TIMEOUT = 30_000 // Gradle's default timeout is 10s - - @Shared - @TempDir - Path testKitFolder - - @IgnoreIf(reason = "Jacoco plugin does not work with OpenJ9 in older Gradle versions", value = { - JavaVirtualMachine.isJ9() - }) - def "test legacy #projectName, v#gradleVersion"() { - runGradleTest(gradleVersion, projectName, false, successExpected, false, expectedTraces, expectedCoverages) - - where: - gradleVersion | projectName | successExpected | expectedTraces | expectedCoverages - "3.5" | "test-succeed-old-gradle" | true | 5 | 1 - "7.6.4" | "test-succeed-legacy-instrumentation" | true | 5 | 1 - "7.6.4" | "test-succeed-multi-module-legacy-instrumentation" | true | 7 | 2 - "7.6.4" | "test-succeed-multi-forks-legacy-instrumentation" | true | 6 | 2 - "7.6.4" | "test-skip-legacy-instrumentation" | true | 2 | 0 - "7.6.4" | "test-failed-legacy-instrumentation" | false | 4 | 0 - "7.6.4" | "test-corrupted-config-legacy-instrumentation" | false | 1 | 0 - } - - def "test #projectName, v#gradleVersion, configCache: #configurationCache"() { - runGradleTest(gradleVersion, projectName, configurationCache, successExpected, flakyRetries, expectedTraces, expectedCoverages) - - where: - gradleVersion | projectName | configurationCache | successExpected | flakyRetries | expectedTraces | expectedCoverages - "8.3" | "test-succeed-new-instrumentation" | false | true | false | 5 | 1 - "8.9" | "test-succeed-new-instrumentation" | false | true | false | 5 | 1 - LATEST_GRADLE_VERSION | "test-succeed-new-instrumentation" | false | true | false | 5 | 1 - "8.3" | "test-succeed-new-instrumentation" | true | true | false | 5 | 1 - "8.9" | "test-succeed-new-instrumentation" | true | true | false | 5 | 1 - LATEST_GRADLE_VERSION | "test-succeed-new-instrumentation" | true | true | false | 5 | 1 - LATEST_GRADLE_VERSION | "test-succeed-multi-module-new-instrumentation" | false | true | false | 7 | 2 - LATEST_GRADLE_VERSION | "test-succeed-multi-forks-new-instrumentation" | false | true | false | 6 | 2 - LATEST_GRADLE_VERSION | "test-skip-new-instrumentation" | false | true | false | 2 | 0 - LATEST_GRADLE_VERSION | "test-failed-new-instrumentation" | false | false | false | 4 | 0 - LATEST_GRADLE_VERSION | "test-corrupted-config-new-instrumentation" | false | false | false | 1 | 0 - LATEST_GRADLE_VERSION | "test-succeed-junit-5" | false | true | false | 5 | 1 - LATEST_GRADLE_VERSION | "test-failed-flaky-retries" | false | false | true | 8 | 0 - // TODO: add back LATEST_GRADLE_VERSION after fixing in Gradle 9.4.0 - "9.3.1" | "test-succeed-gradle-plugin-test" | false | true | false | 5 | 0 - } - - def "test junit4 class ordering v#gradleVersion"() { - givenGradleVersionIsCompatibleWithCurrentJvm(gradleVersion) - givenGradleProjectFiles(projectName) - givenGradleProjectProperties() - ensureDependenciesDownloaded(gradleVersion) - - mockBackend.givenKnownTests(true) - for (flakyTest in flakyTests) { - mockBackend.givenFlakyTest(":test", flakyTest.getSuite(), flakyTest.getName()) - mockBackend.givenKnownTest(":test", flakyTest.getSuite(), flakyTest.getName()) - } - - BuildResult buildResult = runGradleTests(gradleVersion, true, false) - assertBuildSuccessful(buildResult) - - verifyTestOrder(mockBackend.waitForEvents(eventsNumber), expectedOrder) - - where: - gradleVersion | projectName | flakyTests | expectedOrder | eventsNumber - "7.6.4" | "test-succeed-junit-4-class-ordering" | [ - test("datadog.smoke.TestSucceedB", "test_succeed"), - test("datadog.smoke.TestSucceedB", "test_succeed_another"), - test("datadog.smoke.TestSucceedA", "test_succeed") - ] | [ - test("datadog.smoke.TestSucceedC", "test_succeed"), - test("datadog.smoke.TestSucceedC", "test_succeed_another"), - test("datadog.smoke.TestSucceedA", "test_succeed_another"), - test("datadog.smoke.TestSucceedA", "test_succeed"), - test("datadog.smoke.TestSucceedB", "test_succeed"), - test("datadog.smoke.TestSucceedB", "test_succeed_another") - ] | 15 - // TODO: add back LATEST_GRADLE_VERSION after fixing ordering on Gradle 9.3.0 - "9.2.1" | "test-succeed-junit-4-class-ordering" | [ - test("datadog.smoke.TestSucceedB", "test_succeed"), - test("datadog.smoke.TestSucceedB", "test_succeed_another"), - test("datadog.smoke.TestSucceedA", "test_succeed") - ] | [ - test("datadog.smoke.TestSucceedC", "test_succeed"), - test("datadog.smoke.TestSucceedC", "test_succeed_another"), - test("datadog.smoke.TestSucceedA", "test_succeed_another"), - test("datadog.smoke.TestSucceedA", "test_succeed"), - test("datadog.smoke.TestSucceedB", "test_succeed"), - test("datadog.smoke.TestSucceedB", "test_succeed_another") - ] | 15 - } - - private runGradleTest(String gradleVersion, String projectName, boolean configurationCache, boolean successExpected, boolean flakyRetries, int expectedTraces, int expectedCoverages) { - givenGradleVersionIsCompatibleWithCurrentJvm(gradleVersion) - givenConfigurationCacheIsCompatibleWithCurrentPlatform(configurationCache) - givenGradleProjectFiles(projectName) - givenGradleProjectProperties() - ensureDependenciesDownloaded(gradleVersion) - - mockBackend.givenFlakyRetries(flakyRetries) - mockBackend.givenFlakyTest(":test", "datadog.smoke.TestFailed", "test_failed") - - mockBackend.givenTestsSkipping(true) - mockBackend.givenSkippableTest(":test", "datadog.smoke.TestSucceed", "test_to_skip_with_itr", [:]) - - BuildResult buildResult = runGradleTests(gradleVersion, successExpected, configurationCache) - - if (successExpected) { - assertBuildSuccessful(buildResult) - } - - verifyEventsAndCoverages(projectName, "gradle", gradleVersion, mockBackend.waitForEvents(expectedTraces), mockBackend.waitForCoverages(expectedCoverages)) - - if (configurationCache) { - // if configuration cache is enabled, run the build one more time - // to verify that building with existing configuration cache entry works - BuildResult buildResultWithConfigCacheEntry = runGradleTests(gradleVersion, successExpected, configurationCache) - - assertBuildSuccessful(buildResultWithConfigCacheEntry) - verifyEventsAndCoverages(projectName, "gradle", gradleVersion, mockBackend.waitForEvents(expectedTraces), mockBackend.waitForCoverages(expectedCoverages)) - } - } - - private void givenGradleProjectProperties() { - assert new File(AGENT_JAR).isFile() - - def ddApiKeyPath = testKitFolder.resolve(".dd.api.key") - Files.write(ddApiKeyPath, "dummy".getBytes()) - - def additionalArgs = [ - (GeneralConfig.API_KEY_FILE) : ddApiKeyPath.toAbsolutePath().toString(), - (CiVisibilityConfig.CIVISIBILITY_JACOCO_PLUGIN_VERSION): JACOCO_PLUGIN_VERSION, - /* - * Some of the smoke tests (in particular the one with the Gradle plugin), are using Gradle Test Kit for their tests. - * Gradle Test Kit needs to do a "chmod" when starting a Gradle Daemon. - * This "chmod" operation is traced by datadog.trace.instrumentation.java.lang.ProcessImplInstrumentation and is reported as a span. - * The problem is that the "chmod" only happens when running in CI (could be due to differences in OS or FS permissions), - * so when running the tests locally, the "chmod" span is not there. - * This causes the tests to fail because the number of reported traces is different. - * To avoid this discrepancy between local and CI runs, we disable tracing instrumentations. - */ - (TraceInstrumentationConfig.TRACE_ENABLED) : "false" - ] - def arguments = buildJvmArguments(mockBackend.intakeUrl, TEST_SERVICE_NAME, additionalArgs) - - def gradleProperties = "org.gradle.jvmargs=${arguments.join(" ")}".toString() - // Write to projectFolder (per-test) instead of testKitFolder (shared), so each - // Gradle daemon gets its own unique preference directory - Files.write(projectFolder.resolve("gradle.properties"), gradleProperties.getBytes()) - } - - private BuildResult runGradleTests(String gradleVersion, boolean successExpected = true, boolean configurationCache = false) { - def arguments = ["test", "--stacktrace"] - if (gradleVersion > "4.5") { - // warning mode available starting from Gradle 4.5 - arguments += ["--warning-mode", "all"] - } - if (configurationCache) { - arguments += ["--configuration-cache", "--rerun-tasks"] - } - BuildResult buildResult = runGradle(gradleVersion, arguments, successExpected) - buildResult - } - - /** - * Sometimes Gradle Test Kit fails because it cannot download the required Gradle distribution - * due to intermittent network issues. - * This method performs the download manually (if needed) with increased timeout (30s vs default 10s). - * Retry logic (3 retries) is already present in org.gradle.wrapper.Install - */ - private ensureDependenciesDownloaded(String gradleVersion) { - try { - println "${new Date()}: $specificationContext.currentIteration.displayName - Starting dependencies download" - - def logger = new org.gradle.wrapper.Logger(false) - def download = new Download(logger, "Gradle Tooling API", GradleVersion.current().getVersion(), GRADLE_DISTRIBUTION_NETWORK_TIMEOUT) - - def userHomeDir = GradleUserHomeLookup.gradleUserHome() - def projectDir = projectFolder.toFile() - def install = new Install(logger, download, new PathAssembler(userHomeDir, projectDir)) - - def configuration = new WrapperConfiguration() - def distribution = new DistributionLocator().getDistributionFor(GradleVersion.version(gradleVersion)) - configuration.setDistribution(distribution) - configuration.setNetworkTimeout(GRADLE_DISTRIBUTION_NETWORK_TIMEOUT) - - // this will download distribution (if not downloaded yet to userHomeDir) and verify its SHA - install.createDist(configuration) - - println "${new Date()}: $specificationContext.currentIteration.displayName - Finished dependencies download" - } catch (Exception e) { - println "${new Date()}: $specificationContext.currentIteration.displayName " + - "- Failed to install Gradle distribution, will proceed to run test kit hoping for the best: $e" - } - } - - private runGradle(String gradleVersion, List arguments, boolean successExpected) { - def buildEnv = ["GRADLE_VERSION": gradleVersion] - - def mavenRepositoryProxy = System.getenv("MAVEN_REPOSITORY_PROXY") - if (mavenRepositoryProxy != null) { - buildEnv += ["MAVEN_REPOSITORY_PROXY": System.getenv("MAVEN_REPOSITORY_PROXY")] - } - - GradleRunner gradleRunner = GradleRunner.create() - .withTestKitDir(testKitFolder.toFile()) - .withProjectDir(projectFolder.toFile()) - .withGradleVersion(gradleVersion) - .withArguments(arguments) - .withEnvironment(buildEnv) - .forwardOutput() - - println "${new Date()}: $specificationContext.currentIteration.displayName - Starting Gradle run" - try { - def buildResult = successExpected ? gradleRunner.build() : gradleRunner.buildAndFail() - println "${new Date()}: $specificationContext.currentIteration.displayName - Finished Gradle run" - return buildResult - } catch (Exception e) { - def daemonLog = Files.list(testKitFolder.resolve("test-kit-daemon/" + gradleVersion)).filter(p -> p.toString().endsWith("log")).findAny().orElse(null) - if (daemonLog != null) { - println "==============================================================" - println "${new Date()}: $specificationContext.currentIteration.displayName - Gradle Daemon log:\n${new String(Files.readAllBytes(daemonLog))}" - println "==============================================================" - } - throw e - } - } - - private void assertBuildSuccessful(buildResult) { - assert buildResult.tasks != null - assert buildResult.tasks.size() > 0 - for (def task : buildResult.tasks) { - assert task.outcome != TaskOutcome.FAILED - } - } -} diff --git a/dd-smoke-tests/gradle/src/test/groovy/datadog/smoketest/GradleLauncherSmokeTest.groovy b/dd-smoke-tests/gradle/src/test/groovy/datadog/smoketest/GradleLauncherSmokeTest.groovy deleted file mode 100644 index 5d11606774a..00000000000 --- a/dd-smoke-tests/gradle/src/test/groovy/datadog/smoketest/GradleLauncherSmokeTest.groovy +++ /dev/null @@ -1,111 +0,0 @@ -package datadog.smoketest - -import datadog.communication.util.IOUtils -import datadog.trace.civisibility.utils.ShellCommandExecutor -import org.opentest4j.AssertionFailedError -import org.slf4j.Logger -import org.slf4j.LoggerFactory - -/** - * This test runs Gradle Launcher with the Java Tracer injected - * and verifies that the tracer is injected into the Gradle Daemon. - */ -class GradleLauncherSmokeTest extends AbstractGradleTest { - - private static final Logger LOGGER = LoggerFactory.getLogger(GradleLauncherSmokeTest) - - private static final int GRADLE_BUILD_TIMEOUT_MILLIS = 90_000 - private static final int GRADLE_WRAPPER_RETRIES = 3 - - private static final String JAVA_HOME = buildJavaHome() - - def "test Gradle Launcher injects tracer into Gradle Daemon: v#gradleVersion, cmd line - #gradleDaemonCmdLineParams"() { - given: - givenGradleVersionIsCompatibleWithCurrentJvm(gradleVersion) - givenGradleProjectFiles("test-gradle-wrapper", ["gradle-wrapper.properties": ["gradle-version": gradleVersion]]) - givenGradleWrapper(gradleVersion) // we want to check that instrumentation works with different wrapper versions too - - when: - def output = whenRunningGradleLauncherWithJavaTracerInjected(gradleDaemonCmdLineParams) - - then: - gradleDaemonStartCommandContains(output, - // verify that the javaagent is injected into the Gradle Daemon start command - "-javaagent:${AGENT_JAR}", - // verify that existing Gradle Daemon JVM args are preserved: - // org.gradle.jvmargs provided on the command line, if present, - // otherwise org.gradle.jvmargs from gradle.properties file - // ("user.country" is used, as Gradle will filter out properties it is not aware of) - gradleDaemonCmdLineParams ? gradleDaemonCmdLineParams : "-Duser.country=VALUE_FROM_GRADLE_PROPERTIES_FILE") - - where: - gradleVersion | gradleDaemonCmdLineParams - "6.6.1" | null - "6.6.1" | "-Duser.country=VALUE_FROM_CMD_LINE" - "7.6.4" | null - "7.6.4" | "-Duser.country=VALUE_FROM_CMD_LINE" - "8.11.1" | null - "8.11.1" | "-Duser.country=VALUE_FROM_CMD_LINE" - LATEST_GRADLE_VERSION | null - LATEST_GRADLE_VERSION | "-Duser.country=VALUE_FROM_CMD_LINE" - } - - private void givenGradleWrapper(String gradleVersion) { - def shellCommandExecutor = new ShellCommandExecutor( - projectFolder.toFile(), - GRADLE_BUILD_TIMEOUT_MILLIS, - [ - "JAVA_HOME": JAVA_HOME, - "GRADLE_OPTS": "" // avoids inheriting CI's GRADLE_OPTS which might be incompatible with the tested JVM - ]) - - for (int attempt = 0; attempt < GRADLE_WRAPPER_RETRIES; attempt++) { - try { - shellCommandExecutor.executeCommand(IOUtils::readFully, "./gradlew", "wrapper", "--gradle-version", gradleVersion) - return - } catch (ShellCommandExecutor.ShellCommandFailedException e) { - LOGGER.warn("Failed gradle wrapper resolution with exception: ", e) - Thread.sleep(2000) // small delay for rapid retries on network issues - } - } - throw new AssertionError((Object) "Tried $GRADLE_WRAPPER_RETRIES times to execute gradle wrapper command and failed") - } - - private String whenRunningGradleLauncherWithJavaTracerInjected(String gradleDaemonCmdLineParams) { - def shellCommandExecutor = new ShellCommandExecutor(projectFolder.toFile(), GRADLE_BUILD_TIMEOUT_MILLIS, [ - "JAVA_HOME" : JAVA_HOME, - "GRADLE_OPTS" : "-javaagent:${AGENT_JAR}".toString(), - "DD_CIVISIBILITY_ENABLED" : "true", - "DD_CIVISIBILITY_AGENTLESS_ENABLED" : "true", - "DD_CIVISIBILITY_AGENTLESS_URL" : "${mockBackend.intakeUrl}".toString(), - "DD_CIVISIBILITY_GIT_UPLOAD_ENABLED": "false", - "DD_CIVISIBILITY_GIT_CLIENT_ENABLED": "false", - "DD_CODE_ORIGIN_FOR_SPANS_ENABLED" : "false", - "DD_CIVISIBILITY_CODE_COVERAGE_ENABLED": "false", - "DD_API_KEY" : "dummy" - ]) - String[] command = ["./gradlew", "--no-daemon", "--info"] - if (gradleDaemonCmdLineParams) { - command += "-Dorg.gradle.jvmargs=$gradleDaemonCmdLineParams".toString() - } - - try { - return shellCommandExecutor.executeCommand(IOUtils::readFully, command) - } catch (Exception e) { - println "==============================================================" - println "${new Date()}: $specificationContext.currentIteration.displayName - Gradle Launcher execution failed with exception:\n ${e.message}" - println "==============================================================" - throw e - } - } - - private static boolean gradleDaemonStartCommandContains(String buildOutput, String... tokens) { - def daemonStartCommandLog = buildOutput.split("\n").find { it.contains("Starting process 'Gradle build daemon'") } - for (String token : tokens) { - if (!daemonStartCommandLog.contains(token)) { - throw new AssertionFailedError("Gradle Daemon start command does not contain " + token, token, daemonStartCommandLog) - } - } - return true - } -} diff --git a/dd-smoke-tests/gradle/src/test/java/datadog/smoketest/AbstractGradleTest.java b/dd-smoke-tests/gradle/src/test/java/datadog/smoketest/AbstractGradleTest.java new file mode 100644 index 00000000000..623184dead6 --- /dev/null +++ b/dd-smoke-tests/gradle/src/test/java/datadog/smoketest/AbstractGradleTest.java @@ -0,0 +1,279 @@ +package datadog.smoketest; + +import datadog.environment.JavaVirtualMachine; +import datadog.environment.OperatingSystem; +import datadog.trace.civisibility.CiVisibilitySmokeTest; +import datadog.trace.util.ComparableVersion; +import java.io.IOException; +import java.io.InputStream; +import java.nio.charset.StandardCharsets; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.Collections; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.TimeUnit; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import java.util.stream.Stream; +import org.gradle.internal.impldep.org.apache.commons.io.FileUtils; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.TestInstance; +import org.junit.jupiter.api.io.TempDir; + +@TestInstance(TestInstance.Lifecycle.PER_CLASS) +public abstract class AbstractGradleTest extends CiVisibilitySmokeTest { + + private static final Properties TOOL_VERSIONS = loadToolVersions(); + protected static final String LATEST_GRADLE_VERSION = toolVersion("gradle.latest"); + + // test resources use this instead of ".gradle" to avoid unwanted evaluation + private static final String GRADLE_TEST_RESOURCE_EXTENSION = ".gradleTest"; + private static final String GRADLE_REGULAR_EXTENSION = ".gradle"; + + private static final ComparableVersion GRADLE_9 = new ComparableVersion("9.0.0"); + + // Gradle daemons may keep file handles on their temp directory open for a short while after being + // stopped; retry a few times to give them a chance to release before giving up. + private static final int TEMP_DIR_CLEANUP_RETRIES = 10; + private static final long TEMP_DIR_CLEANUP_RETRY_DELAY_MILLIS = 200; + + @TempDir protected Path projectFolder; + + protected final MockBackend mockBackend = new MockBackend(); + + @BeforeEach + void resetMockBackend() { + mockBackend.reset(); + } + + @AfterAll + void closeMockBackend() throws Exception { + mockBackend.close(); + } + + /** + * Recursively deletes a directory that a Gradle daemon has been writing into, on a best-effort + * basis. We delete it ourselves (rather than letting JUnit's {@code @TempDir} cleanup do it at + * class teardown) because a daemon may not have released its file handles on {@code + * caches/} by the time the recursive delete runs, which makes the delete fail with a + * {@link java.nio.file.DirectoryNotEmptyException}. + */ + protected static void deleteTempDirectoryQuietly(Path directory) { + if (directory == null) { + return; + } + for (int attempt = 0; + attempt < TEMP_DIR_CLEANUP_RETRIES && Files.exists(directory); + attempt++) { + FileUtils.deleteQuietly(directory.toFile()); + if (!Files.exists(directory)) { + return; + } + try { + Thread.sleep(TEMP_DIR_CLEANUP_RETRY_DELAY_MILLIS); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + return; + } + } + if (Files.exists(directory)) { + System.err.println( + "WARNING: could not fully delete temp directory " + + directory + + " after stopping Gradle daemons; leaving it for the OS to reap. " + + "A Gradle daemon likely still holds a file handle on it."); + } + } + + /** Kills the Gradle daemons whose logs live under {@code testKitDir}, on a best-effort basis. */ + protected static void killGradleDaemonsIn(Path testKitDir) { + if (testKitDir == null || !Files.exists(testKitDir)) { + return; + } + boolean windows = OperatingSystem.isWindows(); + try (Stream files = Files.walk(testKitDir)) { + files + .filter(Files::isRegularFile) + .forEach( + file -> { + String name = file.getFileName().toString(); + if (!name.startsWith("daemon-") || !name.endsWith(".out.log")) { + return; + } + String pid = + name.substring("daemon-".length(), name.length() - ".out.log".length()); + if (!pid.matches("\\d+")) { + // skip the UUID fallback Gradle uses when the PID is unavailable + return; + } + ProcessBuilder kill = + windows + ? new ProcessBuilder("taskkill", "/F", "/PID", pid) + : new ProcessBuilder("kill", pid); + try { + kill.redirectErrorStream(true).start().waitFor(5, TimeUnit.SECONDS); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } catch (Exception e) { + // best effort — the daemon may already be stopped + } + }); + } catch (Exception e) { + // best effort — failing to enumerate daemon logs must not fail the test run + } + } + + private static final Pattern PLACEHOLDER_PATTERN = Pattern.compile("\\$\\{(.+?)\\}"); + + protected void givenGradleProjectFiles(String projectFilesSources) throws IOException { + givenGradleProjectFiles(projectFilesSources, Collections.emptyMap()); + } + + protected void givenGradleProjectFiles( + String projectFilesSources, Map> replacementsByFileName) + throws IOException { + Path projectResourcesPath; + try { + projectResourcesPath = + Paths.get(this.getClass().getClassLoader().getResource(projectFilesSources).toURI()); + } catch (Exception e) { + throw new RuntimeException(e); + } + FileUtils.copyDirectory(projectResourcesPath.toFile(), projectFolder.toFile()); + + Files.walkFileTree( + projectFolder, + new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) + throws IOException { + Map replacements = + replacementsByFileName.get(file.getFileName().toString()); + if (replacements != null) { + String fileContents = new String(Files.readAllBytes(file), StandardCharsets.UTF_8); + Matcher matcher = PLACEHOLDER_PATTERN.matcher(fileContents); + + StringBuffer result = new StringBuffer(); + while (matcher.find()) { + String propertyName = matcher.group(1); + String replacement = replacements.getOrDefault(propertyName, matcher.group(0)); + matcher.appendReplacement(result, Matcher.quoteReplacement(replacement)); + } + matcher.appendTail(result); + + Files.write(file, result.toString().getBytes(StandardCharsets.UTF_8)); + } + + if (file.toString().endsWith(GRADLE_TEST_RESOURCE_EXTENSION)) { + Path fileWithFixedExtension = + Paths.get( + file.toString() + .replace(GRADLE_TEST_RESOURCE_EXTENSION, GRADLE_REGULAR_EXTENSION)); + Files.move(file, fileWithFixedExtension); + } + + return FileVisitResult.CONTINUE; + } + }); + + // creating empty .git directory so that the tracer could detect projectFolder as repo root + Files.createDirectory(projectFolder.resolve(".git")); + } + + protected void givenGradleVersionIsCompatibleWithCurrentJvm(String gradleVersion) { + Assumptions.assumeTrue( + isSupported(new ComparableVersion(gradleVersion)), + "Current JVM does not support Gradle version " + gradleVersion); + } + + private static boolean isSupported(ComparableVersion gradleVersion) { + // https://docs.gradle.org/current/userguide/compatibility.html + if (JavaVirtualMachine.isJavaVersionAtLeast(26)) { + return gradleVersion.compareTo(new ComparableVersion("9.4")) >= 0; + } else if (JavaVirtualMachine.isJavaVersionAtLeast(25)) { + return gradleVersion.compareTo(new ComparableVersion("9.1")) >= 0; + } else if (JavaVirtualMachine.isJavaVersionAtLeast(24)) { + return gradleVersion.compareTo(new ComparableVersion("8.14")) >= 0; + } else if (JavaVirtualMachine.isJavaVersionAtLeast(21)) { + return gradleVersion.compareTo(new ComparableVersion("8.4")) >= 0; + } else if (JavaVirtualMachine.isJavaVersionAtLeast(20)) { + return gradleVersion.compareTo(new ComparableVersion("8.1")) >= 0; + } else if (JavaVirtualMachine.isJavaVersionAtLeast(19)) { + return gradleVersion.compareTo(new ComparableVersion("7.6")) >= 0; + } else if (JavaVirtualMachine.isJavaVersionAtLeast(18)) { + return gradleVersion.compareTo(new ComparableVersion("7.5")) >= 0; + } else if (JavaVirtualMachine.isJavaVersionAtLeast(17)) { + return gradleVersion.compareTo(new ComparableVersion("7.3")) >= 0; + } else if (JavaVirtualMachine.isJavaVersionAtLeast(16)) { + return isWithin(gradleVersion, new ComparableVersion("7.0"), GRADLE_9); + } else if (JavaVirtualMachine.isJavaVersionAtLeast(15)) { + return isWithin(gradleVersion, new ComparableVersion("6.7"), GRADLE_9); + } else if (JavaVirtualMachine.isJavaVersionAtLeast(14)) { + return isWithin(gradleVersion, new ComparableVersion("6.3"), GRADLE_9); + } else if (JavaVirtualMachine.isJavaVersionAtLeast(13)) { + return isWithin(gradleVersion, new ComparableVersion("6.0"), GRADLE_9); + } else if (JavaVirtualMachine.isJavaVersionAtLeast(12)) { + return isWithin(gradleVersion, new ComparableVersion("5.4"), GRADLE_9); + } else if (JavaVirtualMachine.isJavaVersionAtLeast(11)) { + return isWithin(gradleVersion, new ComparableVersion("5.0"), GRADLE_9); + } else if (JavaVirtualMachine.isJavaVersionAtLeast(10)) { + return isWithin(gradleVersion, new ComparableVersion("4.7"), GRADLE_9); + } else if (JavaVirtualMachine.isJavaVersionAtLeast(9)) { + return isWithin(gradleVersion, new ComparableVersion("4.3"), GRADLE_9); + } else if (JavaVirtualMachine.isJavaVersionAtLeast(8)) { + return isWithin(gradleVersion, new ComparableVersion("2.0"), GRADLE_9); + } + return false; + } + + private static boolean isWithin( + ComparableVersion version, + ComparableVersion lowerInclusive, + ComparableVersion upperExclusive) { + return version.compareTo(lowerInclusive) >= 0 && version.compareTo(upperExclusive) < 0; + } + + protected void givenConfigurationCacheIsCompatibleWithCurrentPlatform( + boolean configurationCacheEnabled) { + if (configurationCacheEnabled) { + Assumptions.assumeFalse( + JavaVirtualMachine.isIbm8(), "Configuration cache is not compatible with IBM 8"); + } + } + + private static Properties loadToolVersions() { + Properties properties = new Properties(); + try (InputStream stream = + AbstractGradleTest.class + .getClassLoader() + .getResourceAsStream("latest-tool-versions.properties")) { + if (stream == null) { + throw new IllegalStateException( + "Could not find latest-tool-versions.properties on classpath"); + } + properties.load(stream); + } catch (IOException e) { + throw new RuntimeException(e); + } + return properties; + } + + protected static String toolVersion(String key) { + String value = TOOL_VERSIONS.getProperty(key); + if (value == null) { + throw new IllegalStateException( + "Missing '" + + key + + "' in latest-tool-versions.properties; re-run the " + + "update-smoke-test-latest-versions workflow."); + } + return value; + } +} diff --git a/dd-smoke-tests/gradle/src/test/java/datadog/smoketest/GradleDaemonSmokeTest.java b/dd-smoke-tests/gradle/src/test/java/datadog/smoketest/GradleDaemonSmokeTest.java new file mode 100644 index 00000000000..5b21058b906 --- /dev/null +++ b/dd-smoke-tests/gradle/src/test/java/datadog/smoketest/GradleDaemonSmokeTest.java @@ -0,0 +1,412 @@ +package datadog.smoketest; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.environment.JavaVirtualMachine; +import datadog.environment.OperatingSystem; +import datadog.trace.api.civisibility.config.TestFQN; +import datadog.trace.api.config.CiVisibilityConfig; +import datadog.trace.api.config.GeneralConfig; +import datadog.trace.api.config.TraceInstrumentationConfig; +import datadog.trace.civisibility.CiVisibilityTableTestConverters; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.BuildTask; +import org.gradle.testkit.runner.GradleRunner; +import org.gradle.testkit.runner.TaskOutcome; +import org.gradle.tooling.internal.consumer.DefaultGradleConnector; +import org.gradle.util.GradleVersion; +import org.gradle.wrapper.Download; +import org.gradle.wrapper.Install; +import org.gradle.wrapper.PathAssembler; +import org.gradle.wrapper.WrapperConfiguration; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.api.io.CleanupMode; +import org.junit.jupiter.api.io.TempDir; +import org.junit.jupiter.params.ParameterizedTest; +import org.tabletest.junit.TableTest; +import org.tabletest.junit.TypeConverterSources; + +@TypeConverterSources(CiVisibilityTableTestConverters.class) +class GradleDaemonSmokeTest extends AbstractGradleTest { + + private static final String TEST_SERVICE_NAME = "test-gradle-service"; + + // Gradle's default timeout is 10s + private static final int GRADLE_DISTRIBUTION_NETWORK_TIMEOUT = 30_000; + + // Cleanup is handled manually in stopGradleTestKitDaemons() instead of by JUnit: the TestKit + // daemons may still hold file handles on this directory at class teardown, which would make + // JUnit's recursive delete fail and turn the class into an executionError. + @TempDir(cleanup = CleanupMode.NEVER) + static Path testKitFolder; + + @AfterAll + void stopGradleTestKitDaemons() { + try { + DefaultGradleConnector.close(); + } catch (Exception e) { + System.err.println("Failed to stop Gradle TestKit daemons during cleanup: " + e); + } + killGradleDaemonsIn(testKitFolder); + deleteTempDirectoryQuietly(testKitFolder); + } + + @TableTest({ + "scenario | gradleVersion | projectName | successExpected | expectedTraces | expectedCoverages", + "succeed-old-gradle-oldest | oldest | test-succeed-old-gradle | true | 5 | 1 ", + "succeed-legacy | 7.6.4 | test-succeed-legacy-instrumentation | true | 5 | 1 ", + "succeed-multi-module-legacy | 7.6.4 | test-succeed-multi-module-legacy-instrumentation | true | 7 | 2 ", + "succeed-multi-forks-legacy | 7.6.4 | test-succeed-multi-forks-legacy-instrumentation | true | 6 | 2 ", + "skip-legacy | 7.6.4 | test-skip-legacy-instrumentation | true | 2 | 0 ", + "failed-legacy | 7.6.4 | test-failed-legacy-instrumentation | false | 4 | 0 ", + "corrupted-config-legacy | 7.6.4 | test-corrupted-config-legacy-instrumentation | false | 1 | 0 " + }) + @ParameterizedTest + void testLegacy( + String gradleVersion, + String projectName, + boolean successExpected, + int expectedTraces, + int expectedCoverages) + throws IOException { + // Jacoco plugin does not work with OpenJ9 in older Gradle versions + Assumptions.assumeFalse( + JavaVirtualMachine.isJ9(), + "Jacoco plugin does not work with OpenJ9 in older Gradle versions"); + runGradleTest( + gradleVersion, + projectName, + false, + successExpected, + false, + expectedTraces, + expectedCoverages); + } + + @TableTest({ + "scenario | gradleVersion | projectName | configurationCache | successExpected | flakyRetries | expectedTraces | expectedCoverages", + "succeed-new-8.3 | 8.3 | test-succeed-new-instrumentation | {false, true} | true | false | 5 | 1 ", + "succeed-new-8.9 | 8.9 | test-succeed-new-instrumentation | {false, true} | true | false | 5 | 1 ", + "succeed-new-latest | latest | test-succeed-new-instrumentation | {false, true} | true | false | 5 | 1 ", + "succeed-multi-module-new | latest | test-succeed-multi-module-new-instrumentation | false | true | false | 7 | 2 ", + "succeed-multi-forks-new | latest | test-succeed-multi-forks-new-instrumentation | false | true | false | 6 | 2 ", + "skip-new | latest | test-skip-new-instrumentation | false | true | false | 2 | 0 ", + "failed-new | latest | test-failed-new-instrumentation | false | false | false | 4 | 0 ", + "corrupted-config-new | latest | test-corrupted-config-new-instrumentation | false | false | false | 1 | 0 ", + "succeed-junit-5 | latest | test-succeed-junit-5 | false | true | false | 5 | 1 ", + "failed-flaky-retries | latest | test-failed-flaky-retries | false | false | true | 8 | 0 ", + "succeed-gradle-plugin-test | latest | test-succeed-gradle-plugin-test | false | true | false | 5 | 0 " + }) + @ParameterizedTest + void testNew( + String gradleVersion, + String projectName, + boolean configurationCache, + boolean successExpected, + boolean flakyRetries, + int expectedTraces, + int expectedCoverages) + throws IOException { + Assumptions.assumeFalse( + JavaVirtualMachine.isJavaVersion(27), "JDK 27 TODO: address failing test"); + runGradleTest( + gradleVersion, + projectName, + configurationCache, + successExpected, + flakyRetries, + expectedTraces, + expectedCoverages); + } + + @TableTest({ + "scenario | gradleVersion | projectName | expectedTraces", + "robolectric-latest | latest | test-succeed-robolectric | 7 " + }) + @ParameterizedTest + void testRobolectric(String gradleVersion, String projectName, int expectedTraces) + throws IOException { + Assumptions.assumeTrue( + JavaVirtualMachine.isJavaVersionBetween(17, 22), "Robolectric 4.16 supports JDK 17-21"); + Assumptions.assumeFalse( + OperatingSystem.architecture().isArm64(), + "Robolectric does not support arm64 (missing native runtime binaries, follow https://github.com/robolectric/robolectric/issues/9166)"); + + gradleVersion = resolveVersion(gradleVersion); + givenGradleVersionIsCompatibleWithCurrentJvm(gradleVersion); + givenGradleVersionIsSupportedByCurrentGradleTestKit(gradleVersion); + givenGradleProjectFiles(projectName); + givenGradleProjectProperties(); + ensureDependenciesDownloaded(gradleVersion); + + BuildResult buildResult = runGradleTests(gradleVersion, true, false); + assertBuildSuccessful(buildResult); + + verifyEventsAndCoverages( + projectName, + "gradle", + gradleVersion, + mockBackend.waitForEvents(expectedTraces), + mockBackend.waitForCoverages(0)); + } + + // TODO: add back LATEST_GRADLE_VERSION after fixing ordering on Gradle 9.3.0 + @TableTest({ + "scenario | gradleVersion | projectName | flakyTests | expectedOrder | eventsNumber", + "junit4-ordering-7.6.4 | 7.6.4 | test-succeed-junit-4-class-ordering | ['datadog.smoke.TestSucceedB:test_succeed', 'datadog.smoke.TestSucceedB:test_succeed_another', 'datadog.smoke.TestSucceedA:test_succeed'] | ['datadog.smoke.TestSucceedC:test_succeed', 'datadog.smoke.TestSucceedC:test_succeed_another', 'datadog.smoke.TestSucceedA:test_succeed_another', 'datadog.smoke.TestSucceedA:test_succeed', 'datadog.smoke.TestSucceedB:test_succeed', 'datadog.smoke.TestSucceedB:test_succeed_another'] | 15 ", + "junit4-ordering-9.2.1 | 9.2.1 | test-succeed-junit-4-class-ordering | ['datadog.smoke.TestSucceedB:test_succeed', 'datadog.smoke.TestSucceedB:test_succeed_another', 'datadog.smoke.TestSucceedA:test_succeed'] | ['datadog.smoke.TestSucceedC:test_succeed', 'datadog.smoke.TestSucceedC:test_succeed_another', 'datadog.smoke.TestSucceedA:test_succeed_another', 'datadog.smoke.TestSucceedA:test_succeed', 'datadog.smoke.TestSucceedB:test_succeed', 'datadog.smoke.TestSucceedB:test_succeed_another'] | 15 " + }) + @ParameterizedTest + void testJunit4ClassOrdering( + String gradleVersion, + String projectName, + List flakyTests, + List expectedOrder, + int eventsNumber) + throws IOException { + givenGradleVersionIsCompatibleWithCurrentJvm(gradleVersion); + givenGradleProjectFiles(projectName); + givenGradleProjectProperties(); + ensureDependenciesDownloaded(gradleVersion); + + mockBackend.givenKnownTests(true); + for (TestFQN flakyTest : flakyTests) { + mockBackend.givenFlakyTest(":test", flakyTest.getSuite(), flakyTest.getName()); + mockBackend.givenKnownTest(":test", flakyTest.getSuite(), flakyTest.getName()); + } + + BuildResult buildResult = runGradleTests(gradleVersion, true, false); + assertBuildSuccessful(buildResult); + + verifyTestOrder(mockBackend.waitForEvents(eventsNumber), expectedOrder); + } + + // Resolves the symbolic versions used in the scenario tables: + // - "latest": the newest eligible Gradle release + // - "oldest": the latest patch of the oldest major the current Gradle TestKit still supports + // Any other value is treated as a concrete version and returned as-is. + private static String resolveVersion(String gradleVersion) { + if ("latest".equals(gradleVersion)) { + return LATEST_GRADLE_VERSION; + } + if ("oldest".equals(gradleVersion)) { + return oldestSupportedGradleVersion(); + } + return gradleVersion; + } + + private static String oldestSupportedGradleVersion() { + // The oldest major the current Gradle TestKit can run is dictated by Gradle itself; tracking it + // dynamically (rather than hardcoding a version) means the floor follows TestKit automatically. + // We test the latest patch of that major rather than its initial release for stability. + int oldestSupportedMajor = + DefaultGradleConnector.MINIMUM_SUPPORTED_GRADLE_VERSION.getMajorVersion(); + return toolVersion("gradle.latest." + oldestSupportedMajor); + } + + private static void givenGradleVersionIsSupportedByCurrentGradleTestKit(String gradleVersion) { + // These smoke tests cover the earliest legacy Gradle version that the current Gradle + // TestKit can still run. When Gradle raises TestKit's minimum supported version, older + // rows are skipped as a best-effort compatibility boundary rather than a product signal. + Assumptions.assumeTrue( + GradleVersion.version(gradleVersion) + .compareTo(DefaultGradleConnector.MINIMUM_SUPPORTED_GRADLE_VERSION) + >= 0, + "Current Gradle TestKit does not support Gradle version " + gradleVersion); + } + + private void runGradleTest( + String gradleVersion, + String projectName, + boolean configurationCache, + boolean successExpected, + boolean flakyRetries, + int expectedTraces, + int expectedCoverages) + throws IOException { + gradleVersion = resolveVersion(gradleVersion); + givenGradleVersionIsCompatibleWithCurrentJvm(gradleVersion); + givenGradleVersionIsSupportedByCurrentGradleTestKit(gradleVersion); + givenConfigurationCacheIsCompatibleWithCurrentPlatform(configurationCache); + givenGradleProjectFiles(projectName); + givenGradleProjectProperties(); + ensureDependenciesDownloaded(gradleVersion); + + mockBackend.givenFlakyRetries(flakyRetries); + mockBackend.givenFlakyTest(":test", "datadog.smoke.TestFailed", "test_failed"); + + mockBackend.givenTestsSkipping(true); + mockBackend.givenSkippableTest( + ":test", "datadog.smoke.TestSucceed", "test_to_skip_with_itr", Collections.emptyMap()); + + BuildResult buildResult = runGradleTests(gradleVersion, successExpected, configurationCache); + + if (successExpected) { + assertBuildSuccessful(buildResult); + } + + verifyEventsAndCoverages( + projectName, + "gradle", + gradleVersion, + mockBackend.waitForEvents(expectedTraces), + mockBackend.waitForCoverages(expectedCoverages)); + + if (configurationCache) { + // If configuration cache is enabled, run the build one more time to verify that building + // with an existing configuration cache entry works. + BuildResult buildResultWithConfigCacheEntry = + runGradleTests(gradleVersion, successExpected, configurationCache); + + assertBuildSuccessful(buildResultWithConfigCacheEntry); + verifyEventsAndCoverages( + projectName, + "gradle", + gradleVersion, + mockBackend.waitForEvents(expectedTraces), + mockBackend.waitForCoverages(expectedCoverages)); + } + } + + private void givenGradleProjectProperties() throws IOException { + assertTrue(new java.io.File(AGENT_JAR).isFile()); + + Path ddApiKeyPath = testKitFolder.resolve(".dd.api.key"); + Files.write(ddApiKeyPath, "dummy".getBytes()); + + Map additionalArgs = new HashMap<>(); + additionalArgs.put(GeneralConfig.API_KEY_FILE, ddApiKeyPath.toAbsolutePath().toString()); + additionalArgs.put( + CiVisibilityConfig.CIVISIBILITY_JACOCO_PLUGIN_VERSION, JACOCO_PLUGIN_VERSION); + /* + * Some of the smoke tests (in particular the one with the Gradle plugin), are using Gradle Test Kit for their tests. + * Gradle Test Kit needs to do a "chmod" when starting a Gradle Daemon. + * This "chmod" operation is traced by datadog.trace.instrumentation.java.lang.ProcessImplInstrumentation and is reported as a span. + * The problem is that the "chmod" only happens when running in CI (could be due to differences in OS or FS permissions), + * so when running the tests locally, the "chmod" span is not there. + * This causes the tests to fail because the number of reported traces is different. + * To avoid this discrepancy between local and CI runs, we disable tracing instrumentations. + */ + additionalArgs.put(TraceInstrumentationConfig.TRACE_ENABLED, "false"); + List arguments = + buildJvmArguments(mockBackend.getIntakeUrl(), TEST_SERVICE_NAME, additionalArgs); + + String gradleProperties = "org.gradle.jvmargs=" + String.join(" ", arguments); + // Write to projectFolder (per-test) instead of testKitFolder (shared), so each + // Gradle daemon gets its own unique preference directory. + Files.write(projectFolder.resolve("gradle.properties"), gradleProperties.getBytes()); + } + + private BuildResult runGradleTests( + String gradleVersion, boolean successExpected, boolean configurationCache) + throws IOException { + List arguments = new java.util.ArrayList<>(Arrays.asList("test", "--stacktrace")); + if (gradleVersion.compareTo("4.5") > 0) { + // warning mode available starting from Gradle 4.5 + arguments.addAll(Arrays.asList("--warning-mode", "all")); + } + if (configurationCache) { + arguments.addAll(Arrays.asList("--configuration-cache", "--rerun-tasks")); + } + return runGradle(gradleVersion, arguments, successExpected); + } + + /** + * Sometimes Gradle Test Kit fails because it cannot download the required Gradle distribution due + * to intermittent network issues. This method performs the download manually (if needed) with + * increased timeout (30s vs default 10s). Retry logic (3 retries) is already present in {@code + * org.gradle.wrapper.Install}. + */ + private void ensureDependenciesDownloaded(String gradleVersion) { + try { + org.gradle.wrapper.Logger logger = new org.gradle.wrapper.Logger(false); + Download download = + new Download( + logger, + "Gradle Tooling API", + GradleVersion.current().getVersion(), + GRADLE_DISTRIBUTION_NETWORK_TIMEOUT); + + java.io.File userHomeDir = testKitFolder.toFile(); + java.io.File projectDir = projectFolder.toFile(); + Install install = new Install(logger, download, new PathAssembler(userHomeDir, projectDir)); + + WrapperConfiguration configuration = new WrapperConfiguration(); + configuration.setDistribution(GradleDistribution.uriFor(gradleVersion)); + configuration.setNetworkTimeout(GRADLE_DISTRIBUTION_NETWORK_TIMEOUT); + + // This will download distribution (if not downloaded yet to userHomeDir) and verify its SHA. + install.createDist(configuration); + } catch (Exception e) { + System.out.println( + "Failed to install Gradle distribution, will proceed to run test kit hoping for the best: " + + e); + } + } + + private BuildResult runGradle( + String gradleVersion, List arguments, boolean successExpected) throws IOException { + Map buildEnv = new HashMap<>(); + buildEnv.put("GRADLE_ARGS", ""); + buildEnv.put("GRADLE_OPTS", ""); + buildEnv.put("GRADLE_USER_HOME", testKitFolder.toString()); + buildEnv.put("GRADLE_VERSION", gradleVersion); + buildEnv.put( + GradleDistribution.GRADLE_DISTRIBUTION_URL_ENV, + GradleDistribution.uriFor(gradleVersion).toString()); + + String mavenRepositoryProxy = System.getenv("MAVEN_REPOSITORY_PROXY"); + if (mavenRepositoryProxy != null) { + buildEnv.put("MAVEN_REPOSITORY_PROXY", mavenRepositoryProxy); + } + GradleDistribution.propagateMassReadUrl(buildEnv); + + GradleRunner gradleRunner = + GradleDistribution.withDistribution( + GradleRunner.create() + .withTestKitDir(testKitFolder.toFile()) + .withProjectDir(projectFolder.toFile()), + gradleVersion) + .withArguments(arguments) + .withEnvironment(buildEnv) + .forwardOutput(); + + try { + return successExpected ? gradleRunner.build() : gradleRunner.buildAndFail(); + } catch (Exception e) { + Path daemonLogDir = testKitFolder.resolve("test-kit-daemon/" + gradleVersion); + Path daemonLog = + Files.exists(daemonLogDir) + ? Files.list(daemonLogDir) + .filter(p -> p.toString().endsWith("log")) + .findAny() + .orElse(null) + : null; + if (daemonLog != null) { + System.out.println("=============================================================="); + System.out.println("Gradle Daemon log:\n" + new String(Files.readAllBytes(daemonLog))); + System.out.println("=============================================================="); + } + throw new RuntimeException(e); + } + } + + private void assertBuildSuccessful(BuildResult buildResult) { + assertNotNull(buildResult.getTasks()); + assertFalse(buildResult.getTasks().isEmpty(), "build produced zero tasks"); + for (BuildTask task : buildResult.getTasks()) { + assertFalse(task.getOutcome() == TaskOutcome.FAILED, "task " + task.getPath() + " failed"); + } + } +} diff --git a/dd-smoke-tests/gradle/src/test/java/datadog/smoketest/GradleDistribution.java b/dd-smoke-tests/gradle/src/test/java/datadog/smoketest/GradleDistribution.java new file mode 100644 index 00000000000..edaa526dbac --- /dev/null +++ b/dd-smoke-tests/gradle/src/test/java/datadog/smoketest/GradleDistribution.java @@ -0,0 +1,69 @@ +package datadog.smoketest; + +import java.io.IOException; +import java.net.URI; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.gradle.testkit.runner.GradleRunner; +import org.gradle.util.GradleVersion; +import org.gradle.util.internal.DistributionLocator; + +final class GradleDistribution { + + static final String GRADLE_DISTRIBUTION_URL_ENV = "GRADLE_DISTRIBUTION_URL"; + + private static final String MASS_READ_URL_ENV = "MASS_READ_URL"; + private static final Pattern DISTRIBUTION_URL_LINE = Pattern.compile("(?m)^distributionUrl=.*$"); + + private GradleDistribution() {} + + static URI uriFor(String gradleVersion) { + String massReadUrl = System.getenv(MASS_READ_URL_ENV); + if (massReadUrl == null || massReadUrl.trim().isEmpty()) { + return new DistributionLocator().getDistributionFor(GradleVersion.version(gradleVersion)); + } + return massUriFor(massReadUrl, gradleVersion); + } + + static GradleRunner withDistribution(GradleRunner runner, String gradleVersion) { + String massReadUrl = System.getenv(MASS_READ_URL_ENV); + if (massReadUrl == null || massReadUrl.trim().isEmpty()) { + return runner.withGradleVersion(gradleVersion); + } + return runner.withGradleDistribution(massUriFor(massReadUrl, gradleVersion)); + } + + static void propagateMassReadUrl(Map environment) { + String massReadUrl = System.getenv(MASS_READ_URL_ENV); + if (massReadUrl != null && !massReadUrl.trim().isEmpty()) { + environment.put(MASS_READ_URL_ENV, massReadUrl); + } + } + + static String uriPropertiesValueFor(String gradleVersion) { + return uriFor(gradleVersion).toString().replace(":", "\\:"); + } + + static void rewriteWrapperDistributionUrl(Path projectFolder, String gradleVersion) + throws IOException { + Path wrapperProperties = projectFolder.resolve("gradle/wrapper/gradle-wrapper.properties"); + String contents = new String(Files.readAllBytes(wrapperProperties), StandardCharsets.UTF_8); + String replacement = "distributionUrl=" + uriPropertiesValueFor(gradleVersion); + String updated = + DISTRIBUTION_URL_LINE.matcher(contents).replaceFirst(Matcher.quoteReplacement(replacement)); + Files.write(wrapperProperties, updated.getBytes(StandardCharsets.UTF_8)); + } + + private static URI massUriFor(String massReadUrl, String gradleVersion) { + String baseUrl = massReadUrl.endsWith("/") ? massReadUrl : massReadUrl + "/"; + return URI.create( + baseUrl + + "internal/artifact/services.gradle.org/distributions/gradle-" + + gradleVersion + + "-bin.zip"); + } +} diff --git a/dd-smoke-tests/gradle/src/test/java/datadog/smoketest/GradleLauncherSmokeTest.java b/dd-smoke-tests/gradle/src/test/java/datadog/smoketest/GradleLauncherSmokeTest.java new file mode 100644 index 00000000000..5d4c827a17a --- /dev/null +++ b/dd-smoke-tests/gradle/src/test/java/datadog/smoketest/GradleLauncherSmokeTest.java @@ -0,0 +1,196 @@ +package datadog.smoketest; + +import datadog.communication.util.IOUtils; +import datadog.environment.JavaVirtualMachine; +import datadog.trace.civisibility.utils.ShellCommandExecutor; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.api.io.TempDir; +import org.junit.jupiter.params.ParameterizedTest; +import org.opentest4j.AssertionFailedError; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.tabletest.junit.TableTest; + +/** + * This test runs Gradle Launcher with the Java Tracer injected and verifies that the tracer is + * injected into the Gradle Daemon. + */ +class GradleLauncherSmokeTest extends AbstractGradleTest { + + private static final Logger LOGGER = LoggerFactory.getLogger(GradleLauncherSmokeTest.class); + + private static final int GRADLE_BUILD_TIMEOUT_MILLIS = 90_000; + private static final int GRADLE_STOP_TIMEOUT_MILLIS = 30_000; + private static final int GRADLE_WRAPPER_RETRIES = 3; + + private static final String JAVA_HOME = buildJavaHome(); + + @TempDir static Path gradleUserHome; + + @TableTest({ + "scenario | gradleVersion | gradleDaemonCmdLineParams ", + "6.6.1-from-gradle-props | 6.6.1 | ", + "6.6.1-from-cmd-line | 6.6.1 | -Duser.country=VALUE_FROM_CMD_LINE", + "7.6.4-from-gradle-props | 7.6.4 | ", + "7.6.4-from-cmd-line | 7.6.4 | -Duser.country=VALUE_FROM_CMD_LINE", + "8.11.1-from-gradle-props | 8.11.1 | ", + "8.11.1-from-cmd-line | 8.11.1 | -Duser.country=VALUE_FROM_CMD_LINE", + "latest-from-gradle-props | latest | ", + "latest-from-cmd-line | latest | -Duser.country=VALUE_FROM_CMD_LINE" + }) + @ParameterizedTest + void testGradleLauncherInjectsTracerIntoGradleDaemon( + String gradleVersion, String gradleDaemonCmdLineParams) throws Exception { + Assumptions.assumeFalse( + JavaVirtualMachine.isJavaVersion(27), "JDK 27 TODO: address failing test"); + String resolvedGradleVersion = + "latest".equals(gradleVersion) ? LATEST_GRADLE_VERSION : gradleVersion; + String cmdLineParams = + (gradleDaemonCmdLineParams == null || gradleDaemonCmdLineParams.isEmpty()) + ? null + : gradleDaemonCmdLineParams; + + givenGradleVersionIsCompatibleWithCurrentJvm(resolvedGradleVersion); + Map> replacements = new HashMap<>(); + Map versionMap = new HashMap<>(); + versionMap.put("gradle-version", resolvedGradleVersion); + versionMap.put( + "gradle-distribution-url", GradleDistribution.uriPropertiesValueFor(resolvedGradleVersion)); + replacements.put("gradle-wrapper.properties", versionMap); + givenGradleProjectFiles("test-gradle-wrapper", replacements); + // we want to check that instrumentation works with different wrapper versions too + givenGradleWrapper(resolvedGradleVersion); + + String output = whenRunningGradleLauncherWithJavaTracerInjected(cmdLineParams); + + gradleDaemonStartCommandContains( + output, + // Verify that the javaagent is injected into the Gradle Daemon start command. + "-javaagent:" + AGENT_JAR, + // Verify that existing Gradle Daemon JVM args are preserved: org.gradle.jvmargs provided + // on the command line (if present), otherwise org.gradle.jvmargs from gradle.properties. + // "user.country" is used, as Gradle will filter out properties it is not aware of. + cmdLineParams != null ? cmdLineParams : "-Duser.country=VALUE_FROM_GRADLE_PROPERTIES_FILE"); + } + + /** + * Stops the Gradle build daemon spawned by the launcher after each test. Even though the launcher + * is run with {@code --no-daemon}, Gradle still starts a single-use build daemon that writes into + * {@code $GRADLE_USER_HOME/daemon//}; if that process has not fully released its file + * handles by the time JUnit deletes the shared (static) {@link #gradleUserHome} temp directory at + * class teardown, the recursive delete fails with a {@code DirectoryNotEmptyException}. Stopping + * the daemon here releases those handles ahead of cleanup. + * + *

      This runs in {@code @AfterEach} rather than {@code @AfterAll} on purpose: {@link + * #projectFolder} (which holds the {@code gradlew} script used as the working directory) is an + * instance {@code @TempDir}, so JUnit deletes it at the end of each test invocation. By the time + * an {@code @AfterAll} method would run, that working directory no longer exists and the {@code + * --stop} command could not be launched. + */ + @AfterEach + void stopGradleBuildDaemon() { + if (!Files.exists(projectFolder.resolve("gradlew"))) { + // The test was skipped or failed before the wrapper was set up, so no daemon was started. + return; + } + Map env = new HashMap<>(); + env.put("JAVA_HOME", JAVA_HOME); + env.put("GRADLE_USER_HOME", gradleUserHome.toString()); + env.put("GRADLE_ARGS", ""); + env.put("GRADLE_OPTS", ""); + ShellCommandExecutor shellCommandExecutor = + new ShellCommandExecutor(projectFolder.toFile(), GRADLE_STOP_TIMEOUT_MILLIS, env); + try { + shellCommandExecutor.executeCommand(IOUtils::readFully, "./gradlew", "--stop"); + } catch (Exception e) { + // Best-effort: a failure here should not fail the test run. + LOGGER.warn("Failed to stop Gradle daemon during cleanup", e); + } + } + + private void givenGradleWrapper(String gradleVersion) throws Exception { + Map env = new HashMap<>(); + env.put("JAVA_HOME", JAVA_HOME); + env.put("GRADLE_USER_HOME", gradleUserHome.toString()); + // Avoid inheriting CI Gradle launcher settings that might be incompatible with this wrapper. + env.put("GRADLE_ARGS", ""); + env.put("GRADLE_OPTS", ""); + ShellCommandExecutor shellCommandExecutor = + new ShellCommandExecutor(projectFolder.toFile(), GRADLE_BUILD_TIMEOUT_MILLIS, env); + + for (int attempt = 0; attempt < GRADLE_WRAPPER_RETRIES; attempt++) { + try { + shellCommandExecutor.executeCommand( + IOUtils::readFully, "./gradlew", "wrapper", "--gradle-version", gradleVersion); + GradleDistribution.rewriteWrapperDistributionUrl(projectFolder, gradleVersion); + return; + } catch (ShellCommandExecutor.ShellCommandFailedException e) { + LOGGER.warn("Failed gradle wrapper resolution with exception: ", e); + Thread.sleep(2000); // small delay for rapid retries on network issues + } + } + throw new AssertionError( + "Tried " + GRADLE_WRAPPER_RETRIES + " times to execute gradle wrapper command and failed"); + } + + private String whenRunningGradleLauncherWithJavaTracerInjected(String gradleDaemonCmdLineParams) + throws Exception { + Map env = new HashMap<>(); + env.put("JAVA_HOME", JAVA_HOME); + env.put("GRADLE_USER_HOME", gradleUserHome.toString()); + env.put("GRADLE_ARGS", ""); + env.put("GRADLE_OPTS", "-javaagent:" + AGENT_JAR); + env.put("DD_CIVISIBILITY_ENABLED", "true"); + env.put("DD_CIVISIBILITY_AGENTLESS_ENABLED", "true"); + env.put("DD_CIVISIBILITY_AGENTLESS_URL", mockBackend.getIntakeUrl()); + env.put("DD_CIVISIBILITY_GIT_UPLOAD_ENABLED", "false"); + env.put("DD_CIVISIBILITY_GIT_CLIENT_ENABLED", "false"); + env.put("DD_CODE_ORIGIN_FOR_SPANS_ENABLED", "false"); + env.put("DD_CIVISIBILITY_CODE_COVERAGE_ENABLED", "false"); + env.put("DD_API_KEY", "dummy"); + + ShellCommandExecutor shellCommandExecutor = + new ShellCommandExecutor(projectFolder.toFile(), GRADLE_BUILD_TIMEOUT_MILLIS, env); + + List command = + new java.util.ArrayList<>(Arrays.asList("./gradlew", "--no-daemon", "--info")); + if (gradleDaemonCmdLineParams != null) { + command.add("-Dorg.gradle.jvmargs=" + gradleDaemonCmdLineParams); + } + + try { + return shellCommandExecutor.executeCommand( + IOUtils::readFully, command.toArray(new String[0])); + } catch (Exception e) { + System.out.println("=============================================================="); + System.out.println("Gradle Launcher execution failed with exception:\n " + e.getMessage()); + System.out.println("=============================================================="); + throw e; + } + } + + private static void gradleDaemonStartCommandContains(String buildOutput, String... tokens) { + String daemonStartCommandLog = null; + for (String line : buildOutput.split("\n")) { + if (line.contains("Starting process 'Gradle build daemon'")) { + daemonStartCommandLog = line; + break; + } + } + for (String token : tokens) { + if (daemonStartCommandLog == null || !daemonStartCommandLog.contains(token)) { + throw new AssertionFailedError( + "Gradle Daemon start command does not contain " + token, + token, + String.valueOf(daemonStartCommandLog)); + } + } + } +} diff --git a/dd-smoke-tests/gradle/src/test/resources/latest-tool-versions.properties b/dd-smoke-tests/gradle/src/test/resources/latest-tool-versions.properties index ee744579d50..9493af4c3a7 100644 --- a/dd-smoke-tests/gradle/src/test/resources/latest-tool-versions.properties +++ b/dd-smoke-tests/gradle/src/test/resources/latest-tool-versions.properties @@ -1,3 +1,12 @@ # Pinned latest eligible stable versions (>=48h old) for CI Visibility Gradle smoke tests. # Updated automatically by the update-smoke-test-latest-versions workflow. -gradle.version=9.5.0 +gradle.latest=9.6.1 +# Latest eligible stable patch per Gradle major release. Used to resolve the "oldest" smoke-test +# Gradle version (the latest patch of the oldest major the current TestKit supports). +gradle.latest.3=3.5.1 +gradle.latest.4=4.10.3 +gradle.latest.5=5.6.4 +gradle.latest.6=6.9.4 +gradle.latest.7=7.6.6 +gradle.latest.8=8.14.5 +gradle.latest.9=9.6.1 diff --git a/dd-smoke-tests/gradle/src/test/resources/test-failed-flaky-retries/events.ftl b/dd-smoke-tests/gradle/src/test/resources/test-failed-flaky-retries/events.ftl index d979c6ad5f6..b5b22bf1686 100644 --- a/dd-smoke-tests/gradle/src/test/resources/test-failed-flaky-retries/events.ftl +++ b/dd-smoke-tests/gradle/src/test/resources/test-failed-flaky-retries/events.ftl @@ -209,6 +209,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit4", "test.framework_version" : "4.10", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.source.file" : "src/test/java/datadog/smoke/TestFailed.java", "test.status" : "fail", @@ -269,6 +270,7 @@ "test.failure_suppressed" : "true", "test.framework" : "junit4", "test.framework_version" : "4.10", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.name" : "test_failed", "test.source.file" : "src/test/java/datadog/smoke/TestFailed.java", @@ -335,6 +337,7 @@ "test.framework" : "junit4", "test.framework_version" : "4.10", "test.is_retry" : "true", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.name" : "test_failed", "test.retry_reason" : "auto_test_retry", @@ -402,6 +405,7 @@ "test.framework" : "junit4", "test.framework_version" : "4.10", "test.is_retry" : "true", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.name" : "test_failed", "test.retry_reason" : "auto_test_retry", @@ -469,6 +473,7 @@ "test.framework" : "junit4", "test.framework_version" : "4.10", "test.is_retry" : "true", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.name" : "test_failed", "test.retry_reason" : "auto_test_retry", @@ -537,6 +542,7 @@ "test.framework_version" : "4.10", "test.has_failed_all_retries" : "true", "test.is_retry" : "true", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.name" : "test_failed", "test.retry_reason" : "auto_test_retry", diff --git a/dd-smoke-tests/gradle/src/test/resources/test-failed-legacy-instrumentation/events.ftl b/dd-smoke-tests/gradle/src/test/resources/test-failed-legacy-instrumentation/events.ftl index 44173ccbb90..0857970f5b4 100644 --- a/dd-smoke-tests/gradle/src/test/resources/test-failed-legacy-instrumentation/events.ftl +++ b/dd-smoke-tests/gradle/src/test/resources/test-failed-legacy-instrumentation/events.ftl @@ -157,6 +157,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit4", "test.framework_version" : "4.10", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.source.file" : "src/test/java/datadog/smoke/TestFailed.java", "test.status" : "fail", @@ -217,6 +218,7 @@ "test.final_status" : "fail", "test.framework" : "junit4", "test.framework_version" : "4.10", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.name" : "test_failed", "test.source.file" : "src/test/java/datadog/smoke/TestFailed.java", @@ -386,4 +388,4 @@ }, "type" : "span", "version" : 1 -} ] \ No newline at end of file +} ] diff --git a/dd-smoke-tests/gradle/src/test/resources/test-failed-new-instrumentation/events.ftl b/dd-smoke-tests/gradle/src/test/resources/test-failed-new-instrumentation/events.ftl index 7cc854d3c39..4c20a4b24c0 100644 --- a/dd-smoke-tests/gradle/src/test/resources/test-failed-new-instrumentation/events.ftl +++ b/dd-smoke-tests/gradle/src/test/resources/test-failed-new-instrumentation/events.ftl @@ -209,6 +209,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit4", "test.framework_version" : "4.10", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.source.file" : "src/test/java/datadog/smoke/TestFailed.java", "test.status" : "fail", @@ -269,6 +270,7 @@ "test.final_status" : "fail", "test.framework" : "junit4", "test.framework_version" : "4.10", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.name" : "test_failed", "test.source.file" : "src/test/java/datadog/smoke/TestFailed.java", diff --git a/dd-smoke-tests/gradle/src/test/resources/test-gradle-wrapper/gradle/wrapper/gradle-wrapper.properties b/dd-smoke-tests/gradle/src/test/resources/test-gradle-wrapper/gradle/wrapper/gradle-wrapper.properties index 7b0b125d7b8..a1b0bd8df79 100644 --- a/dd-smoke-tests/gradle/src/test/resources/test-gradle-wrapper/gradle/wrapper/gradle-wrapper.properties +++ b/dd-smoke-tests/gradle/src/test/resources/test-gradle-wrapper/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-${gradle-version}-bin.zip +distributionUrl=${gradle-distribution-url} zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/dd-smoke-tests/gradle/src/test/resources/test-succeed-gradle-plugin-test/coverages.ftl b/dd-smoke-tests/gradle/src/test/resources/test-succeed-gradle-plugin-test/coverages.ftl index 65148a80555..6be477ce51c 100644 --- a/dd-smoke-tests/gradle/src/test/resources/test-succeed-gradle-plugin-test/coverages.ftl +++ b/dd-smoke-tests/gradle/src/test/resources/test-succeed-gradle-plugin-test/coverages.ftl @@ -1,9 +1,9 @@ [ { "files" : [ { - "bitmap" : "AAAAx+EN", + "bitmap" : "AAAA8LF/8wE=", "filename" : "src/test/java/datadog/smoke/HelloPluginFunctionalTest.java" } ], "span_id" : ${content_span_id_4}, "test_session_id" : ${content_test_session_id}, "test_suite_id" : ${content_test_suite_id} -} ] \ No newline at end of file +} ] diff --git a/dd-smoke-tests/gradle/src/test/resources/test-succeed-gradle-plugin-test/events.ftl b/dd-smoke-tests/gradle/src/test/resources/test-succeed-gradle-plugin-test/events.ftl index 0d92092ab56..66ded4c6a4f 100644 --- a/dd-smoke-tests/gradle/src/test/resources/test-succeed-gradle-plugin-test/events.ftl +++ b/dd-smoke-tests/gradle/src/test/resources/test-succeed-gradle-plugin-test/events.ftl @@ -203,6 +203,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit5", "test.framework_version" : "5.10.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.source.file" : "src/test/java/datadog/smoke/HelloPluginFunctionalTest.java", "test.status" : "pass", @@ -215,8 +216,8 @@ "_dd.profiling.enabled" : 0, "_dd.trace_span_attribute_schema" : 0, "process_id" : ${content_metrics_process_id_2}, - "test.source.end" : 44, - "test.source.start" : 16 + "test.source.end" : 58, + "test.source.start" : 20 }, "name" : "junit5.test_suite", "resource" : "datadog.smoke.HelloPluginFunctionalTest", @@ -262,6 +263,7 @@ "test.final_status" : "pass", "test.framework" : "junit5", "test.framework_version" : "5.10.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.name" : "pluginPrintsHelloMessageOnGradle85", "test.source.file" : "src/test/java/datadog/smoke/HelloPluginFunctionalTest.java", @@ -276,8 +278,8 @@ "_dd.profiling.enabled" : 0, "_dd.trace_span_attribute_schema" : 0, "process_id" : ${content_metrics_process_id_2}, - "test.source.end" : 43, - "test.source.start" : 30 + "test.source.end" : 49, + "test.source.start" : 36 }, "name" : "junit5.test", "parent_id" : ${content_parent_id}, @@ -467,4 +469,4 @@ }, "type" : "span", "version" : 1 -} ] \ No newline at end of file +} ] diff --git a/dd-smoke-tests/gradle/src/test/resources/test-succeed-gradle-plugin-test/src/test/java/datadog/smoke/HelloPluginFunctionalTest.java b/dd-smoke-tests/gradle/src/test/resources/test-succeed-gradle-plugin-test/src/test/java/datadog/smoke/HelloPluginFunctionalTest.java index fbb7be2ca29..e0cf8189e54 100644 --- a/dd-smoke-tests/gradle/src/test/resources/test-succeed-gradle-plugin-test/src/test/java/datadog/smoke/HelloPluginFunctionalTest.java +++ b/dd-smoke-tests/gradle/src/test/resources/test-succeed-gradle-plugin-test/src/test/java/datadog/smoke/HelloPluginFunctionalTest.java @@ -1,17 +1,21 @@ package datadog.smoke; +import static java.util.Objects.requireNonNull; import static org.junit.jupiter.api.Assertions.assertTrue; -import org.gradle.testkit.runner.BuildResult; -import org.gradle.testkit.runner.GradleRunner; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; import java.io.File; import java.io.IOException; +import java.net.URI; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; +import java.util.HashMap; +import java.util.Map; +import org.gradle.testkit.runner.BuildResult; +import org.gradle.testkit.runner.GradleRunner; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; class HelloPluginFunctionalTest { @@ -22,23 +26,33 @@ class HelloPluginFunctionalTest { @BeforeEach void setUp() throws IOException { buildFile = testProjectDir.resolve("build.gradle").toFile(); - Files.write(buildFile.toPath(), "plugins { id 'datadog.smoke.helloplugin' }".getBytes(StandardCharsets.UTF_8)); + Files.write( + buildFile.toPath(), + "plugins { id 'datadog.smoke.helloplugin' }".getBytes(StandardCharsets.UTF_8)); } @Test void pluginPrintsHelloMessageOnGradle85() { - BuildResult result = GradleRunner.create() - .withProjectDir(testProjectDir.toFile()) - .withPluginClasspath() - // Use the same Gradle version as of the actual smoke test that builds this project. - // This is to ensure Gradle is already downloaded and available in the environment. - // Gradle Test Kit can download a Gradle distribution by itself, - // but sometimes these downloads fail, making the test flaky. - .withGradleVersion(System.getenv("GRADLE_VERSION")) - .withArguments("hello", "--stacktrace") - .forwardOutput() - .build(); + String gradleDistributionUrl = + requireNonNull(System.getenv("GRADLE_DISTRIBUTION_URL"), "GRADLE_DISTRIBUTION_URL"); + BuildResult result = + GradleRunner.create() + .withProjectDir(testProjectDir.toFile()) + .withPluginClasspath() + .withGradleDistribution(URI.create(gradleDistributionUrl)) + .withArguments("hello", "--stacktrace") + .withEnvironment(sanitizedGradleEnvironment(testProjectDir.resolve("gradle-user-home"))) + .forwardOutput() + .build(); assertTrue(result.getOutput().contains("Hello from my plugin!")); } + + private static Map sanitizedGradleEnvironment(Path gradleUserHomeDir) { + Map environment = new HashMap<>(System.getenv()); + environment.put("GRADLE_ARGS", ""); + environment.put("GRADLE_OPTS", ""); + environment.put("GRADLE_USER_HOME", gradleUserHomeDir.toString()); + return environment; + } } diff --git a/dd-smoke-tests/gradle/src/test/resources/test-succeed-junit-5/events.ftl b/dd-smoke-tests/gradle/src/test/resources/test-succeed-junit-5/events.ftl index 54f13e7a501..39d54d1ccc4 100644 --- a/dd-smoke-tests/gradle/src/test/resources/test-succeed-junit-5/events.ftl +++ b/dd-smoke-tests/gradle/src/test/resources/test-succeed-junit-5/events.ftl @@ -205,6 +205,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit5", "test.framework_version" : "5.9.3", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", "test.status" : "pass", @@ -264,6 +265,7 @@ "test.final_status" : "pass", "test.framework" : "junit5", "test.framework_version" : "5.9.3", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.name" : "test_succeed", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", @@ -328,6 +330,7 @@ "test.final_status" : "skip", "test.framework" : "junit5", "test.framework_version" : "5.9.3", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.name" : "test_to_skip_with_itr", "test.skip_reason" : "Skipped by Datadog Test Impact Analysis", diff --git a/dd-smoke-tests/gradle/src/test/resources/test-succeed-legacy-instrumentation/events.ftl b/dd-smoke-tests/gradle/src/test/resources/test-succeed-legacy-instrumentation/events.ftl index 6c09f1adda7..84ee985455c 100644 --- a/dd-smoke-tests/gradle/src/test/resources/test-succeed-legacy-instrumentation/events.ftl +++ b/dd-smoke-tests/gradle/src/test/resources/test-succeed-legacy-instrumentation/events.ftl @@ -155,6 +155,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit4", "test.framework_version" : "4.10", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", "test.status" : "pass", @@ -213,6 +214,7 @@ "test.final_status" : "pass", "test.framework" : "junit4", "test.framework_version" : "4.10", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.name" : "test_succeed", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", @@ -276,6 +278,7 @@ "test.final_status" : "skip", "test.framework" : "junit4", "test.framework_version" : "4.10", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.name" : "test_to_skip_with_itr", "test.skip_reason" : "Skipped by Datadog Test Impact Analysis", @@ -445,4 +448,4 @@ }, "type" : "span", "version" : 1 -} ] \ No newline at end of file +} ] diff --git a/dd-smoke-tests/gradle/src/test/resources/test-succeed-multi-forks-legacy-instrumentation/events.ftl b/dd-smoke-tests/gradle/src/test/resources/test-succeed-multi-forks-legacy-instrumentation/events.ftl index 68c0e93f4d0..89c54e8c646 100644 --- a/dd-smoke-tests/gradle/src/test/resources/test-succeed-multi-forks-legacy-instrumentation/events.ftl +++ b/dd-smoke-tests/gradle/src/test/resources/test-succeed-multi-forks-legacy-instrumentation/events.ftl @@ -154,6 +154,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", "test.status" : "pass", @@ -213,6 +214,7 @@ "test.final_status" : "pass", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.name" : "test_succeed", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", @@ -266,6 +268,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit5", "test.framework_version" : "5.9.3", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.source.file" : "src/test/java/datadog/smoke/TestSucceedJunit5.java", "test.status" : "pass", @@ -325,6 +328,7 @@ "test.final_status" : "pass", "test.framework" : "junit5", "test.framework_version" : "5.9.3", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.name" : "test_succeed", "test.source.file" : "src/test/java/datadog/smoke/TestSucceedJunit5.java", @@ -491,4 +495,4 @@ }, "type" : "span", "version" : 1 -} ] \ No newline at end of file +} ] diff --git a/dd-smoke-tests/gradle/src/test/resources/test-succeed-multi-forks-new-instrumentation/coverages.ftl b/dd-smoke-tests/gradle/src/test/resources/test-succeed-multi-forks-new-instrumentation/coverages.ftl index 2fe41431bbf..567ef02b425 100644 --- a/dd-smoke-tests/gradle/src/test/resources/test-succeed-multi-forks-new-instrumentation/coverages.ftl +++ b/dd-smoke-tests/gradle/src/test/resources/test-succeed-multi-forks-new-instrumentation/coverages.ftl @@ -1,15 +1,4 @@ [ { - "files" : [ { - "bitmap" : "gAw=", - "filename" : "src/test/java/datadog/smoke/TestSucceed.java" - }, { - "bitmap" : "IA==", - "filename" : "src/main/java/datadog/smoke/Calculator.java" - } ], - "span_id" : ${content_span_id_4}, - "test_session_id" : ${content_test_session_id}, - "test_suite_id" : ${content_test_suite_id} -}, { "files" : [ { "bitmap" : "AAE=", "filename" : "src/main/java/datadog/smoke/Calculator.java" @@ -20,4 +9,15 @@ "span_id" : ${content_span_id_5}, "test_session_id" : ${content_test_session_id}, "test_suite_id" : ${content_test_suite_id_2} +}, { + "files" : [ { + "bitmap" : "gAw=", + "filename" : "src/test/java/datadog/smoke/TestSucceed.java" + }, { + "bitmap" : "IA==", + "filename" : "src/main/java/datadog/smoke/Calculator.java" + } ], + "span_id" : ${content_span_id_4}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} } ] \ No newline at end of file diff --git a/dd-smoke-tests/gradle/src/test/resources/test-succeed-multi-forks-new-instrumentation/events.ftl b/dd-smoke-tests/gradle/src/test/resources/test-succeed-multi-forks-new-instrumentation/events.ftl index b1b9cbf320a..b39c2005ae9 100644 --- a/dd-smoke-tests/gradle/src/test/resources/test-succeed-multi-forks-new-instrumentation/events.ftl +++ b/dd-smoke-tests/gradle/src/test/resources/test-succeed-multi-forks-new-instrumentation/events.ftl @@ -203,6 +203,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", "test.status" : "pass", @@ -262,6 +263,7 @@ "test.final_status" : "pass", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.name" : "test_succeed", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", @@ -315,6 +317,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit5", "test.framework_version" : "5.9.3", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.source.file" : "src/test/java/datadog/smoke/TestSucceedJunit5.java", "test.status" : "pass", @@ -374,6 +377,7 @@ "test.final_status" : "pass", "test.framework" : "junit5", "test.framework_version" : "5.9.3", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.name" : "test_succeed", "test.source.file" : "src/test/java/datadog/smoke/TestSucceedJunit5.java", diff --git a/dd-smoke-tests/gradle/src/test/resources/test-succeed-multi-module-legacy-instrumentation/events.ftl b/dd-smoke-tests/gradle/src/test/resources/test-succeed-multi-module-legacy-instrumentation/events.ftl index 0f4ffc2c3c7..686e3865b96 100644 --- a/dd-smoke-tests/gradle/src/test/resources/test-succeed-multi-module-legacy-instrumentation/events.ftl +++ b/dd-smoke-tests/gradle/src/test/resources/test-succeed-multi-module-legacy-instrumentation/events.ftl @@ -113,6 +113,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit4", "test.framework_version" : "4.10", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":submodule-a:test", "test.source.file" : "submodule-a/src/test/java/datadog/smoke/TestSucceed.java", "test.status" : "pass", @@ -161,6 +162,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit4", "test.framework_version" : "4.10", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":submodule-b:test", "test.source.file" : "submodule-b/src/test/java/datadog/smoke/TestSucceed.java", "test.status" : "pass", @@ -219,6 +221,7 @@ "test.final_status" : "pass", "test.framework" : "junit4", "test.framework_version" : "4.10", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":submodule-a:test", "test.name" : "test_succeed", "test.source.file" : "submodule-a/src/test/java/datadog/smoke/TestSucceed.java", @@ -282,6 +285,7 @@ "test.final_status" : "pass", "test.framework" : "junit4", "test.framework_version" : "4.10", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":submodule-b:test", "test.name" : "test_succeed", "test.source.file" : "submodule-b/src/test/java/datadog/smoke/TestSucceed.java", @@ -709,4 +713,4 @@ }, "type" : "span", "version" : 1 -} ] \ No newline at end of file +} ] diff --git a/dd-smoke-tests/gradle/src/test/resources/test-succeed-multi-module-new-instrumentation/events.ftl b/dd-smoke-tests/gradle/src/test/resources/test-succeed-multi-module-new-instrumentation/events.ftl index ba67705f819..13be2c459db 100644 --- a/dd-smoke-tests/gradle/src/test/resources/test-succeed-multi-module-new-instrumentation/events.ftl +++ b/dd-smoke-tests/gradle/src/test/resources/test-succeed-multi-module-new-instrumentation/events.ftl @@ -162,6 +162,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit4", "test.framework_version" : "4.10", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":submodule-a:test", "test.source.file" : "submodule-a/src/test/java/datadog/smoke/TestSucceed.java", "test.status" : "pass", @@ -210,6 +211,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit4", "test.framework_version" : "4.10", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":submodule-b:test", "test.source.file" : "submodule-b/src/test/java/datadog/smoke/TestSucceed.java", "test.status" : "pass", @@ -268,6 +270,7 @@ "test.final_status" : "pass", "test.framework" : "junit4", "test.framework_version" : "4.10", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":submodule-a:test", "test.name" : "test_succeed", "test.source.file" : "submodule-a/src/test/java/datadog/smoke/TestSucceed.java", @@ -331,6 +334,7 @@ "test.final_status" : "pass", "test.framework" : "junit4", "test.framework_version" : "4.10", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":submodule-b:test", "test.name" : "test_succeed", "test.source.file" : "submodule-b/src/test/java/datadog/smoke/TestSucceed.java", diff --git a/dd-smoke-tests/gradle/src/test/resources/test-succeed-new-instrumentation/events.ftl b/dd-smoke-tests/gradle/src/test/resources/test-succeed-new-instrumentation/events.ftl index 739a850f012..ed5f7b89f2d 100644 --- a/dd-smoke-tests/gradle/src/test/resources/test-succeed-new-instrumentation/events.ftl +++ b/dd-smoke-tests/gradle/src/test/resources/test-succeed-new-instrumentation/events.ftl @@ -205,6 +205,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit4", "test.framework_version" : "4.10", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", "test.status" : "pass", @@ -263,6 +264,7 @@ "test.final_status" : "pass", "test.framework" : "junit4", "test.framework_version" : "4.10", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.name" : "test_succeed", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", @@ -326,6 +328,7 @@ "test.final_status" : "skip", "test.framework" : "junit4", "test.framework_version" : "4.10", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.name" : "test_to_skip_with_itr", "test.skip_reason" : "Skipped by Datadog Test Impact Analysis", diff --git a/dd-smoke-tests/gradle/src/test/resources/test-succeed-old-gradle/events.ftl b/dd-smoke-tests/gradle/src/test/resources/test-succeed-old-gradle/events.ftl index 62181568c7f..e392f13a615 100644 --- a/dd-smoke-tests/gradle/src/test/resources/test-succeed-old-gradle/events.ftl +++ b/dd-smoke-tests/gradle/src/test/resources/test-succeed-old-gradle/events.ftl @@ -155,6 +155,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit4", "test.framework_version" : "4.10", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", "test.status" : "pass", @@ -213,6 +214,7 @@ "test.final_status" : "pass", "test.framework" : "junit4", "test.framework_version" : "4.10", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.name" : "test_succeed", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", @@ -276,6 +278,7 @@ "test.final_status" : "skip", "test.framework" : "junit4", "test.framework_version" : "4.10", + "test.itr.tests_skipping.enabled" : "true", "test.module" : ":test", "test.name" : "test_to_skip_with_itr", "test.skip_reason" : "Skipped by Datadog Test Impact Analysis", @@ -445,4 +448,4 @@ }, "type" : "span", "version" : 1 -} ] \ No newline at end of file +} ] diff --git a/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/build.gradleTest b/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/build.gradleTest new file mode 100644 index 00000000000..618780014b1 --- /dev/null +++ b/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/build.gradleTest @@ -0,0 +1,112 @@ +import java.util.zip.ZipFile +import org.gradle.api.artifacts.transform.InputArtifact +import org.gradle.api.artifacts.transform.TransformAction +import org.gradle.api.artifacts.transform.TransformOutputs +import org.gradle.api.artifacts.transform.TransformParameters +import org.gradle.api.attributes.AttributeCompatibilityRule +import org.gradle.api.attributes.CompatibilityCheckDetails +import org.gradle.api.attributes.LibraryElements + +apply plugin: 'java' +// Inert stand-in for the Android Gradle Plugin (see buildSrc/): real AGP needs the Android SDK, +// which is absent in the smoke-test environment. Our build-level Android detection only checks for +// the 'com.android.base' plugin id, so applying an id-only stand-in exercises it. +apply plugin: 'com.android.base' + +repositories { + mavenLocal() + + def proxyUrl = System.getenv("MAVEN_REPOSITORY_PROXY") + if (proxyUrl) { + println "Using proxy repository: $proxyUrl" + maven { + url = proxyUrl + allowInsecureProtocol = true + } + } + + mavenCentral() + + // androidx.test artifacts (Robolectric runtime dependencies) are published only to Google's Maven + // repository. Scope it strictly to androidx.* so nothing else resolves from it. + maven { + url = 'https://maven.google.com' + content { + includeGroupByRegex 'androidx\\..*' + } + } +} + +// androidx.test ships as Android archives (.aar), which a plain-JVM build cannot consume directly. +// Teach Gradle to accept the aar variant and extract its classes.jar — the part the Android Gradle +// plugin would otherwise do. Safe to apply broadly here: this is a standalone project with no +// class-directory (project) dependencies. +abstract class AarToJarCompatibility implements AttributeCompatibilityRule { + @Override + void execute(CompatibilityCheckDetails details) { + if (details.producerValue != null && details.producerValue.name == 'aar') { + details.compatible() + } + } +} + +abstract class ExtractAarClasses implements TransformAction { + @InputArtifact + abstract Provider getInputArtifact() + + @Override + void transform(TransformOutputs outputs) { + def aar = inputArtifact.get().asFile + if (!aar.name.endsWith('.aar')) { + outputs.file(aar) + return + } + new ZipFile(aar).withCloseable { zip -> + def entry = zip.getEntry('classes.jar') + def out = outputs.file(aar.name - '.aar' + '.jar') + if (entry != null) { + out.withOutputStream { os -> zip.getInputStream(entry).withCloseable { input -> os << input } } + } else { + new java.util.jar.JarOutputStream(out.newOutputStream()).close() + } + } + } +} + +def artifactType = Attribute.of('artifactType', String) + +dependencies { + attributesSchema { + attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE) { + compatibilityRules.add(AarToJarCompatibility) + } + } + registerTransform(ExtractAarClasses) { + from.attribute(artifactType, 'aar') + to.attribute(artifactType, 'jar') + } +} + +configurations.configureEach { + if (canBeResolved) { + attributes.attribute(artifactType, 'jar') + } +} + +dependencies { + testImplementation 'junit:junit:4.13.2' + testImplementation 'org.robolectric:robolectric:4.16.1' + // Pre-built Android SDK jar for the level the fixtures configure. + testImplementation 'org.robolectric:android-all:14-robolectric-10818077' + // androidx.test:core pulls in androidx.test:monitor (InstrumentationRegistry); ext:junit provides + // the AndroidJUnit4 runner, which delegates to RobolectricTestRunner for local (host-JVM) tests. + testImplementation 'androidx.test:core:1.6.1' + testImplementation 'androidx.test.ext:junit:1.2.1' +} + +test { + useJUnit() + // Coverage is validated by the other Gradle smoke scenarios; disable it here so this scenario + // stays focused on the emulated-SDK (test.android.*) tags. + environment "DD_CIVISIBILITY_CODE_COVERAGE_ENABLED", "false" +} diff --git a/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/buildSrc/build.gradleTest b/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/buildSrc/build.gradleTest new file mode 100644 index 00000000000..b894ef21751 --- /dev/null +++ b/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/buildSrc/build.gradleTest @@ -0,0 +1,21 @@ +apply plugin: 'java' + +repositories { + mavenLocal() + + def proxyUrl = System.getenv("MAVEN_REPOSITORY_PROXY") + if (proxyUrl) { + maven { + url = proxyUrl + allowInsecureProtocol = true + } + } + + mavenCentral() +} + +dependencies { + // Plugin lives in the Gradle API; the CI Visibility javac plugin is auto-injected into + // this compile task too, so the repositories above must be able to resolve it. + implementation gradleApi() +} diff --git a/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/buildSrc/src/main/java/datadog/smoke/gradle/AndroidBaseStandInPlugin.java b/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/buildSrc/src/main/java/datadog/smoke/gradle/AndroidBaseStandInPlugin.java new file mode 100644 index 00000000000..978fc313857 --- /dev/null +++ b/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/buildSrc/src/main/java/datadog/smoke/gradle/AndroidBaseStandInPlugin.java @@ -0,0 +1,22 @@ +package datadog.smoke.gradle; + +import org.gradle.api.Plugin; +import org.gradle.api.Project; + +/** + * No-op stand-in for the Android Gradle Plugin's {@code com.android.base} plugin. + * + *

      Real AGP requires the Android SDK to be installed, which is not available in the smoke-test + * environment. The CI Visibility build-level Android detection only checks whether a plugin + * registered under the {@code com.android.base} id has been applied (see {@code + * CiVisibilityGradleListener}); every AGP variant applies {@code com.android.base} transitively. + * Registering an inert plugin under that exact id therefore exercises the detection, the + * module→session tag propagation and the {@code is_android} telemetry faithfully, without pulling + * in AGP or the SDK. + */ +public class AndroidBaseStandInPlugin implements Plugin { + @Override + public void apply(Project project) { + // intentionally empty: only the plugin id matters for detection + } +} diff --git a/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/buildSrc/src/main/resources/META-INF/gradle-plugins/com.android.base.properties b/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/buildSrc/src/main/resources/META-INF/gradle-plugins/com.android.base.properties new file mode 100644 index 00000000000..8f21ff1cce0 --- /dev/null +++ b/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/buildSrc/src/main/resources/META-INF/gradle-plugins/com.android.base.properties @@ -0,0 +1 @@ +implementation-class=datadog.smoke.gradle.AndroidBaseStandInPlugin diff --git a/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/coverages.ftl b/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/coverages.ftl new file mode 100644 index 00000000000..8878e547a79 --- /dev/null +++ b/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/coverages.ftl @@ -0,0 +1 @@ +[ ] \ No newline at end of file diff --git a/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/events.ftl b/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/events.ftl new file mode 100644 index 00000000000..b08072b29ab --- /dev/null +++ b/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/events.ftl @@ -0,0 +1,691 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "_dd.test.is_user_provided_service" : "true", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "ci.workspace_path" : ${content_meta_ci_workspace_path}, + "component" : "gradle", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "span.kind" : "test_session_end", + "test.code_coverage.enabled" : "true", + "test.command" : "gradle test", + "test.framework" : "junit4", + "test.framework_version" : "4.13.2", + "test.is_android" : "true", + "test.itr.tests_skipping.enabled" : "true", + "test.itr.tests_skipping.type" : "test", + "test.status" : "pass", + "test.toolchain" : ${content_meta_test_toolchain}, + "test.type" : "test", + "test_session.name" : "gradle test" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id}, + "test.itr.tests_skipping.count" : 0 + }, + "name" : "gradle.test_session", + "resource" : ":", + "service" : "test-gradle-service", + "start" : ${content_start}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.test.is_user_provided_service" : "true", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "ci.workspace_path" : ${content_meta_ci_workspace_path}, + "component" : "gradle", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "span.kind" : "test_session_end", + "test.command" : "gradle :buildSrc", + "test.gradle.nested_build" : "true", + "test.status" : "skip", + "test.toolchain" : ${content_meta_test_toolchain}, + "test.type" : "test", + "test_session.name" : "gradle :buildSrc" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "gradle.test_session", + "resource" : ":buildSrc", + "service" : "test-gradle-service", + "start" : ${content_start_2}, + "test_session_id" : ${content_test_session_id_2} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "_dd.test.is_user_provided_service" : "true", + "ci.workspace_path" : ${content_meta_ci_workspace_path}, + "component" : "gradle", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "span.kind" : "test_module_end", + "test.code_coverage.enabled" : "true", + "test.command" : "gradle test", + "test.framework" : "junit4", + "test.framework_version" : "4.13.2", + "test.is_android" : "true", + "test.itr.tests_skipping.enabled" : "true", + "test.itr.tests_skipping.type" : "test", + "test.module" : ":test", + "test.status" : "pass", + "test.type" : "test", + "test_session.name" : "gradle test" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "test.itr.tests_skipping.count" : 0 + }, + "name" : "gradle.test_module", + "resource" : ":test", + "service" : "test-gradle-service", + "start" : ${content_start_3}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_4}, + "_dd.test.is_user_provided_service" : "true", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version} + }, + "metrics" : { }, + "name" : "classes", + "parent_id" : ${content_test_session_id_2}, + "resource" : "classes", + "service" : "test-gradle-service", + "span_id" : ${content_span_id}, + "start" : ${content_start_4}, + "trace_id" : ${content_test_session_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_5}, + "_dd.test.is_user_provided_service" : "true", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version} + }, + "metrics" : { }, + "name" : "classes", + "parent_id" : ${content_test_session_id}, + "resource" : "classes", + "service" : "test-gradle-service", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_5}, + "trace_id" : ${content_test_session_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_6}, + "_dd.test.is_user_provided_service" : "true", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version} + }, + "metrics" : { }, + "name" : "compileGroovy", + "parent_id" : ${content_test_session_id_2}, + "resource" : "compileGroovy", + "service" : "test-gradle-service", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_6}, + "trace_id" : ${content_test_session_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_7}, + "_dd.test.is_user_provided_service" : "true", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version} + }, + "metrics" : { }, + "name" : "compileJava", + "parent_id" : ${content_test_session_id_2}, + "resource" : "compileJava", + "service" : "test-gradle-service", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_7}, + "trace_id" : ${content_test_session_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_8}, + "_dd.test.is_user_provided_service" : "true", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version} + }, + "metrics" : { }, + "name" : "compileJava", + "parent_id" : ${content_test_session_id}, + "resource" : "compileJava", + "service" : "test-gradle-service", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_8}, + "trace_id" : ${content_test_session_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_9}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_9}, + "_dd.test.is_user_provided_service" : "true", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version} + }, + "metrics" : { }, + "name" : "compileTestJava", + "parent_id" : ${content_test_session_id}, + "resource" : "compileTestJava", + "service" : "test-gradle-service", + "span_id" : ${content_span_id_6}, + "start" : ${content_start_9}, + "trace_id" : ${content_test_session_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_10}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_10}, + "_dd.test.is_user_provided_service" : "true", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "ci.workspace_path" : ${content_meta_ci_workspace_path}, + "component" : "junit4", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id_2}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "span.kind" : "test_suite_end", + "test.framework" : "junit4", + "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", + "test.module" : ":test", + "test.source.file" : "src/test/java/datadog/smoke/AndroidJUnit4RunnerTest.java", + "test.status" : "pass", + "test.suite" : "datadog.smoke.AndroidJUnit4RunnerTest", + "test.type" : "test", + "test_session.name" : "gradle test" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id_2}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "junit4.test_suite", + "resource" : "datadog.smoke.AndroidJUnit4RunnerTest", + "service" : "test-gradle-service", + "start" : ${content_start_10}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_11}, + "error" : 0, + "meta" : { + "_dd.library_capabilities.auto_test_retries" : "1", + "_dd.library_capabilities.coverage_report_upload" : "1", + "_dd.library_capabilities.early_flake_detection" : "1", + "_dd.library_capabilities.fail_fast_test_order" : "1", + "_dd.library_capabilities.failed_test_replay" : "1", + "_dd.library_capabilities.impacted_tests" : "1", + "_dd.library_capabilities.test_impact_analysis" : "1", + "_dd.library_capabilities.test_management.attempt_to_fix" : "5", + "_dd.library_capabilities.test_management.disable" : "1", + "_dd.library_capabilities.test_management.quarantine" : "1", + "_dd.p.tid" : ${content_meta__dd_p_tid_11}, + "_dd.test.is_user_provided_service" : "true", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "ci.workspace_path" : ${content_meta_ci_workspace_path}, + "component" : "junit4", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id_2}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "span.kind" : "test", + "test.android.codename" : "U", + "test.android.release" : "14", + "test.android.robolectric.version" : "4.16.1", + "test.final_status" : "pass", + "test.framework" : "junit4", + "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", + "test.module" : ":test", + "test.name" : "test_androidjunit4_runner", + "test.source.file" : "src/test/java/datadog/smoke/AndroidJUnit4RunnerTest.java", + "test.source.method" : "test_androidjunit4_runner()V", + "test.status" : "pass", + "test.suite" : "datadog.smoke.AndroidJUnit4RunnerTest", + "test.type" : "test", + "test_session.name" : "gradle test" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id_2}, + "test.android.api_level" : 34, + "test.source.end" : 18, + "test.source.start" : 15 + }, + "name" : "junit4.test", + "parent_id" : ${content_parent_id}, + "resource" : "datadog.smoke.AndroidJUnit4RunnerTest.test_androidjunit4_runner", + "service" : "test-gradle-service", + "span_id" : ${content_span_id_7}, + "start" : ${content_start_11}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_12}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_12}, + "_dd.test.is_user_provided_service" : "true", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "ci.workspace_path" : ${content_meta_ci_workspace_path}, + "component" : "junit4", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id_2}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "span.kind" : "test_suite_end", + "test.framework" : "junit4", + "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", + "test.module" : ":test", + "test.source.file" : "src/test/java/datadog/smoke/RobolectricRunnerTest.java", + "test.status" : "pass", + "test.suite" : "datadog.smoke.RobolectricRunnerTest", + "test.type" : "test", + "test_session.name" : "gradle test" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id_2}, + "test.source.end" : 19, + "test.source.start" : 11 + }, + "name" : "junit4.test_suite", + "resource" : "datadog.smoke.RobolectricRunnerTest", + "service" : "test-gradle-service", + "start" : ${content_start_12}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id_2} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_13}, + "error" : 0, + "meta" : { + "_dd.library_capabilities.auto_test_retries" : "1", + "_dd.library_capabilities.coverage_report_upload" : "1", + "_dd.library_capabilities.early_flake_detection" : "1", + "_dd.library_capabilities.fail_fast_test_order" : "1", + "_dd.library_capabilities.failed_test_replay" : "1", + "_dd.library_capabilities.impacted_tests" : "1", + "_dd.library_capabilities.test_impact_analysis" : "1", + "_dd.library_capabilities.test_management.attempt_to_fix" : "5", + "_dd.library_capabilities.test_management.disable" : "1", + "_dd.library_capabilities.test_management.quarantine" : "1", + "_dd.p.tid" : ${content_meta__dd_p_tid_13}, + "_dd.test.is_user_provided_service" : "true", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "ci.workspace_path" : ${content_meta_ci_workspace_path}, + "component" : "junit4", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id_2}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "span.kind" : "test", + "test.android.codename" : "U", + "test.android.release" : "14", + "test.android.robolectric.version" : "4.16.1", + "test.final_status" : "pass", + "test.framework" : "junit4", + "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", + "test.module" : ":test", + "test.name" : "test_robolectric_runner", + "test.source.file" : "src/test/java/datadog/smoke/RobolectricRunnerTest.java", + "test.source.method" : "test_robolectric_runner()V", + "test.status" : "pass", + "test.suite" : "datadog.smoke.RobolectricRunnerTest", + "test.type" : "test", + "test_session.name" : "gradle test" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_7}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id_2}, + "test.android.api_level" : 34, + "test.source.end" : 18, + "test.source.start" : 15 + }, + "name" : "junit4.test", + "parent_id" : ${content_parent_id}, + "resource" : "datadog.smoke.RobolectricRunnerTest.test_robolectric_runner", + "service" : "test-gradle-service", + "span_id" : ${content_span_id_8}, + "start" : ${content_start_13}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_14}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_14}, + "_dd.test.is_user_provided_service" : "true", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version} + }, + "metrics" : { }, + "name" : "jar", + "parent_id" : ${content_test_session_id_2}, + "resource" : "jar", + "service" : "test-gradle-service", + "span_id" : ${content_span_id_9}, + "start" : ${content_start_14}, + "trace_id" : ${content_test_session_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_15}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_15}, + "_dd.test.is_user_provided_service" : "true", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version} + }, + "metrics" : { }, + "name" : "processResources", + "parent_id" : ${content_test_session_id_2}, + "resource" : "processResources", + "service" : "test-gradle-service", + "span_id" : ${content_span_id_10}, + "start" : ${content_start_15}, + "trace_id" : ${content_test_session_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_16}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_16}, + "_dd.test.is_user_provided_service" : "true", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version} + }, + "metrics" : { }, + "name" : "processResources", + "parent_id" : ${content_test_session_id}, + "resource" : "processResources", + "service" : "test-gradle-service", + "span_id" : ${content_span_id_11}, + "start" : ${content_start_16}, + "trace_id" : ${content_test_session_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_17}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_17}, + "_dd.test.is_user_provided_service" : "true", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version} + }, + "metrics" : { }, + "name" : "processTestResources", + "parent_id" : ${content_test_session_id}, + "resource" : "processTestResources", + "service" : "test-gradle-service", + "span_id" : ${content_span_id_12}, + "start" : ${content_start_17}, + "trace_id" : ${content_test_session_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_18}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_18}, + "_dd.test.is_user_provided_service" : "true", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version} + }, + "metrics" : { }, + "name" : "testClasses", + "parent_id" : ${content_test_session_id}, + "resource" : "testClasses", + "service" : "test-gradle-service", + "span_id" : ${content_span_id_13}, + "start" : ${content_start_18}, + "trace_id" : ${content_test_session_id} + }, + "type" : "span", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/settings.gradleTest b/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/settings.gradleTest new file mode 100644 index 00000000000..6040f1decb8 --- /dev/null +++ b/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/settings.gradleTest @@ -0,0 +1 @@ +rootProject.name = 'gradle-instrumentation-test-project' diff --git a/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/src/test/java/datadog/smoke/AndroidJUnit4RunnerTest.java b/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/src/test/java/datadog/smoke/AndroidJUnit4RunnerTest.java new file mode 100644 index 00000000000..a85709853b1 --- /dev/null +++ b/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/src/test/java/datadog/smoke/AndroidJUnit4RunnerTest.java @@ -0,0 +1,19 @@ +package datadog.smoke; + +import static org.junit.Assert.assertEquals; + +import androidx.test.ext.junit.runners.AndroidJUnit4; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.robolectric.RuntimeEnvironment; +import org.robolectric.annotation.Config; + +@RunWith(AndroidJUnit4.class) +@Config(sdk = 34, manifest = Config.NONE) +public class AndroidJUnit4RunnerTest { + + @Test + public void test_androidjunit4_runner() { + assertEquals(34, RuntimeEnvironment.getApiLevel()); + } +} diff --git a/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/src/test/java/datadog/smoke/RobolectricRunnerTest.java b/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/src/test/java/datadog/smoke/RobolectricRunnerTest.java new file mode 100644 index 00000000000..d034022dd5d --- /dev/null +++ b/dd-smoke-tests/gradle/src/test/resources/test-succeed-robolectric/src/test/java/datadog/smoke/RobolectricRunnerTest.java @@ -0,0 +1,19 @@ +package datadog.smoke; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.robolectric.RobolectricTestRunner; +import org.robolectric.RuntimeEnvironment; +import org.robolectric.annotation.Config; + +@RunWith(RobolectricTestRunner.class) +@Config(sdk = 34, manifest = Config.NONE) +public class RobolectricRunnerTest { + + @Test + public void test_robolectric_runner() { + assertEquals(34, RuntimeEnvironment.getApiLevel()); + } +} diff --git a/dd-smoke-tests/grpc-1.5/build.gradle b/dd-smoke-tests/grpc-1.5/build.gradle index 4babb64d12c..d691a9e157f 100644 --- a/dd-smoke-tests/grpc-1.5/build.gradle +++ b/dd-smoke-tests/grpc-1.5/build.gradle @@ -39,8 +39,12 @@ protobuf { } tasks.withType(ShadowJar).configureEach { + duplicatesStrategy = DuplicatesStrategy.INCLUDE archiveClassifier.set("fat") mergeServiceFiles() + filesNotMatching('META-INF/services/**') { + duplicatesStrategy = DuplicatesStrategy.EXCLUDE + } } tasks.withType(Test).configureEach { diff --git a/dd-smoke-tests/grpc-1.5/gradle.lockfile b/dd-smoke-tests/grpc-1.5/gradle.lockfile index eb95d3abcb5..cd8c94173e8 100644 --- a/dd-smoke-tests/grpc-1.5/gradle.lockfile +++ b/dd-smoke-tests/grpc-1.5/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:grpc-1.5:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testCompileProtoPath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testCompileProtoPath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testCompileProtoPath,tes com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testCompileProtoPath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testCompileProtoPath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testCompileProtoPath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testCompileProtoPath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testCompileProtoPath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testCompileProtoPath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testCompileProtoPath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testCompileProtoPath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testCompileProtoPath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testCompileProtoPath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,compileProtoPath,spotbugs,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,compileProtoPath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.android:annotations:4.1.1.4=compileProtoPath,runtimeClasspath,testCompileProtoPath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -32,18 +33,23 @@ com.google.auto.value:auto-value-annotations:1.10.2=compileClasspath,compileProt com.google.code.findbugs:jsr305:3.0.2=compileClasspath,compileProtoPath,runtimeClasspath,spotbugs,testCompileClasspath,testCompileProtoPath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.code.gson:gson:2.10.1=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs -com.google.errorprone:error_prone_annotations:2.20.0=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.20.0=compileClasspath,compileProtoPath,runtimeClasspath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:failureaccess:1.0.1=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.google.guava:guava:32.0.1-jre=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.1=compileClasspath,compileProtoPath,runtimeClasspath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.google.guava:guava:32.0.1-jre=compileClasspath,compileProtoPath,runtimeClasspath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.http-client:google-http-client-gson:1.41.0=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.http-client:google-http-client:1.41.0=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.google.j2objc:j2objc-annotations:2.8=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:2.8=compileClasspath,compileProtoPath,runtimeClasspath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.protobuf:protobuf-java-util:3.24.0=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.protobuf:protobuf-java:3.24.0=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.protobuf:protoc:3.24.0=protobufToolsLocator_protoc -com.google.re2j:re2j:1.7=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.7=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath +com.google.re2j:re2j:1.8=testCompileProtoPath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath @@ -97,14 +103,14 @@ io.opencensus:opencensus-api:0.28.0=compileClasspath,compileProtoPath,runtimeCla io.opencensus:opencensus-contrib-http-util:0.28.0=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath,testRuntimeClasspath io.opencensus:opencensus-proto:0.2.0=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath,testRuntimeClasspath io.perfmark:perfmark-api:0.26.0=compileProtoPath,runtimeClasspath,testCompileProtoPath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testCompileProtoPath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testCompileProtoPath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:2.1.3=testCompileProtoPath,testRuntimeClasspath jakarta.mail:jakarta.mail-api:2.0.1=testCompileProtoPath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testCompileProtoPath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testCompileProtoPath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -120,7 +126,7 @@ org.apache.httpcomponents:httpcore:4.4.15=compileClasspath,compileProtoPath,runt org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath -org.checkerframework:checker-qual:3.33.0=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.checkerframework:checker-qual:3.33.0=compileClasspath,compileProtoPath,runtimeClasspath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc @@ -142,6 +148,7 @@ org.jctools:jctools-core:4.0.6=testCompileProtoPath,testRuntimeClasspath org.jetbrains.kotlin:kotlin-stdlib-common:1.4.20=compileProtoPath,runtimeClasspath,testCompileProtoPath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath,testRuntimeClasspath org.jetbrains.kotlin:kotlin-stdlib:1.4.20=compileProtoPath,runtimeClasspath,testCompileProtoPath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath,testRuntimeClasspath org.jetbrains:annotations:13.0=compileProtoPath,runtimeClasspath,testCompileProtoPath,testFixturesCompileProtoPath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testCompileProtoPath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath @@ -166,8 +173,8 @@ org.ow2.asm:asm-tree:9.7.1=testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath diff --git a/dd-smoke-tests/iast-propagation/build.gradle b/dd-smoke-tests/iast-propagation/build.gradle index 89a7fd287dc..33d3d1019e0 100644 --- a/dd-smoke-tests/iast-propagation/build.gradle +++ b/dd-smoke-tests/iast-propagation/build.gradle @@ -30,7 +30,7 @@ tasks.named("jar", Jar) { } tasks.named("shadowJar", ShadowJar) { - configurations = [project.configurations.runtimeClasspath] + configurations.add(project.configurations.named('runtimeClasspath')) } dependencies { diff --git a/dd-smoke-tests/iast-propagation/gradle.lockfile b/dd-smoke-tests/iast-propagation/gradle.lockfile index ce05d7c5b7c..a0bebc65899 100644 --- a/dd-smoke-tests/iast-propagation/gradle.lockfile +++ b/dd-smoke-tests/iast-propagation/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:iast-propagation:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath @@ -10,7 +11,7 @@ ch.qos.logback:logback-core:1.2.5=compileClasspath,implementationDependenciesMet com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -26,22 +27,26 @@ com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.12.4=compileClasspath,i com.fasterxml.jackson.module:jackson-module-parameter-names:2.12.4=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.12.4=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,compileOnlyDependenciesMetadata,spotbugs,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,compileOnlyDependenciesMetadata,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,compileOnlyDependenciesMetadata,spotbugs,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath @@ -55,19 +60,18 @@ commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testImplementatio commons-io:commons-io:2.11.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,compileOnlyDependenciesMetadata,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath jakarta.activation:jakarta.activation-api:2.1.3=testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath jakarta.mail:jakarta.mail-api:2.0.1=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.openhft:zero-allocation-hashing:0.16=zinc net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -99,37 +103,36 @@ org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath org.jetbrains.intellij.deps:trove4j:1.0.20200330=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-build-common:2.0.21=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-build-tools-api:2.0.21=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-build-tools-impl:2.0.21=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-compiler-embeddable:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-compiler-runner:2.0.21=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-daemon-client:2.0.21=kotlinBuildToolsApiClasspath -org.jetbrains.kotlin:kotlin-daemon-embeddable:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:2.0.21=kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-native-prebuilt:2.0.21=kotlinNativeBundleConfiguration +org.jetbrains.kotlin:kotlin-build-tools-api:2.1.20=kotlinBuildToolsApiClasspath +org.jetbrains.kotlin:kotlin-build-tools-impl:2.1.20=kotlinBuildToolsApiClasspath +org.jetbrains.kotlin:kotlin-compiler-embeddable:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath +org.jetbrains.kotlin:kotlin-compiler-runner:2.1.20=kotlinBuildToolsApiClasspath +org.jetbrains.kotlin:kotlin-daemon-client:2.1.20=kotlinBuildToolsApiClasspath +org.jetbrains.kotlin:kotlin-daemon-embeddable:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath +org.jetbrains.kotlin:kotlin-klib-commonizer-embeddable:2.1.20=kotlinKlibCommonizerClasspath org.jetbrains.kotlin:kotlin-reflect:1.6.10=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-script-runtime:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath -org.jetbrains.kotlin:kotlin-scripting-common:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest -org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest -org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest -org.jetbrains.kotlin:kotlin-scripting-jvm:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest +org.jetbrains.kotlin:kotlin-script-runtime:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath +org.jetbrains.kotlin:kotlin-scripting-common:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest +org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest +org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest +org.jetbrains.kotlin:kotlin-scripting-jvm:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.jetbrains.kotlin:kotlin-stdlib:1.6.21=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib:2.0.21=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath -org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath +org.jetbrains.kotlin:kotlin-stdlib:2.1.20=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath +org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.8.0=kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinKlibCommonizerClasspath org.jetbrains:annotations:13.0=compileClasspath,implementationDependenciesMetadata,kotlinBuildToolsApiClasspath,kotlinCompilerClasspath,kotlinCompilerPluginClasspathMain,kotlinCompilerPluginClasspathTest,kotlinKlibCommonizerClasspath,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc +org.jspecify:jspecify:1.0.0=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath @@ -154,36 +157,36 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=zinc org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.13.11=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath -org.scala-lang:scala-library:2.13.15=zinc -org.scala-lang:scala-reflect:2.13.15=zinc -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-lang:scala-library:2.13.16=zinc +org.scala-lang:scala-reflect:2.13.16=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.32=compileClasspath,implementationDependenciesMetadata,runtimeClasspath,testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testImplementationDependenciesMetadata,testRuntimeClasspath diff --git a/dd-smoke-tests/iast-util/gradle.lockfile b/dd-smoke-tests/iast-util/gradle.lockfile index ea5fb870e34..3e48595f0ef 100644 --- a/dd-smoke-tests/iast-util/gradle.lockfile +++ b/dd-smoke-tests/iast-util/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:iast-util:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=compileClasspath,runtimeClasspath,testCompile com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -17,23 +18,27 @@ com.fasterxml.jackson.core:jackson-core:2.8.10=compileClasspath com.fasterxml.jackson.core:jackson-databind:2.8.11.3=compileClasspath com.fasterxml:classmate:1.3.1=compileClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.10=compileClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -51,15 +56,15 @@ commons-lang:commons-lang:1.0.1=compileClasspath commons-logging:commons-logging:1.2=compileClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:2.1.3=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jakarta.mail:jakarta.mail-api:2.0.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath javax.validation:validation-api:1.1.0.Final=compileClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -102,6 +107,7 @@ org.hibernate:hibernate-validator:5.3.6.Final=compileClasspath org.jboss.logging:jboss-logging:3.3.0.Final=compileClasspath org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -126,8 +132,8 @@ org.ow2.asm:asm-tree:9.7.1=runtimeClasspath,testFixturesRuntimeClasspath,testRun org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/iast-util/iast-util-11/gradle.lockfile b/dd-smoke-tests/iast-util/iast-util-11/gradle.lockfile index a96cd5366a1..65493a42483 100644 --- a/dd-smoke-tests/iast-util/iast-util-11/gradle.lockfile +++ b/dd-smoke-tests/iast-util/iast-util-11/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:iast-util:iast-util-11:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=compileClasspath,runtimeClasspath,testCompile com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -20,22 +21,26 @@ com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.10.0=compileClasspath com.fasterxml.jackson.module:jackson-module-parameter-names:2.10.0=compileClasspath com.fasterxml:classmate:1.3.4=compileClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -48,7 +53,7 @@ commons-io:commons-io:2.11.0=compileClasspath,runtimeClasspath,testCompileClassp commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:2.1.3=testFixturesRuntimeClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath jakarta.mail:jakarta.mail-api:2.0.1=testFixturesRuntimeClasspath,testRuntimeClasspath @@ -56,8 +61,8 @@ jakarta.validation:jakarta.validation-api:2.0.1=compileClasspath javax.servlet:javax.servlet-api:3.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -95,6 +100,7 @@ org.hibernate.validator:hibernate-validator:6.0.17.Final=compileClasspath org.jboss.logging:jboss-logging:3.3.2.Final=compileClasspath org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -119,8 +125,8 @@ org.ow2.asm:asm-tree:9.7.1=runtimeClasspath,testFixturesRuntimeClasspath,testRun org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/iast-util/iast-util-17/gradle.lockfile b/dd-smoke-tests/iast-util/iast-util-17/gradle.lockfile index 4835806eb23..f6d11d39e9f 100644 --- a/dd-smoke-tests/iast-util/iast-util-17/gradle.lockfile +++ b/dd-smoke-tests/iast-util/iast-util-17/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:iast-util:iast-util-17:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=compileClasspath,runtimeClasspath,testCompile com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -19,24 +20,28 @@ com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.10.0=compileClasspath com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.10.0=compileClasspath com.fasterxml.jackson.module:jackson-module-parameter-names:2.10.0=compileClasspath com.fasterxml:classmate:1.3.4=compileClasspath -com.github.javaparser:javaparser-core:3.24.4=testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.javaparser:javaparser-core:3.28.2=testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -49,7 +54,7 @@ commons-io:commons-io:2.11.0=compileClasspath,runtimeClasspath,testCompileClassp commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:2.1.3=testFixturesRuntimeClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath jakarta.mail:jakarta.mail-api:2.0.1=testFixturesRuntimeClasspath,testRuntimeClasspath @@ -57,8 +62,8 @@ jakarta.validation:jakarta.validation-api:2.0.1=compileClasspath javax.servlet:javax.servlet-api:3.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -96,6 +101,7 @@ org.hibernate.validator:hibernate-validator:6.0.17.Final=compileClasspath org.jboss.logging:jboss-logging:3.3.2.Final=compileClasspath org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -120,8 +126,8 @@ org.ow2.asm:asm-tree:9.7.1=runtimeClasspath,testFixturesRuntimeClasspath,testRun org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/iast-util/src/main/java/datadog/smoketest/springboot/controller/IastWebController.java b/dd-smoke-tests/iast-util/src/main/java/datadog/smoketest/springboot/controller/IastWebController.java index 6545f3f3625..f9b20ca2796 100644 --- a/dd-smoke-tests/iast-util/src/main/java/datadog/smoketest/springboot/controller/IastWebController.java +++ b/dd-smoke-tests/iast-util/src/main/java/datadog/smoketest/springboot/controller/IastWebController.java @@ -6,7 +6,6 @@ import datadog.smoketest.springboot.TestBean; import datadog.smoketest.springboot.controller.mock.JakartaMockTransport; import ddtest.client.sources.Hasher; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.io.File; import java.io.IOException; import java.io.ObjectInputStream; @@ -186,14 +185,12 @@ public String commandInjectionProcessBuilder(final HttpServletRequest request) { return "Command Injection page"; } - @SuppressFBWarnings("PT_ABSOLUTE_PATH_TRAVERSAL") @GetMapping("/path_traversal/file") public String pathTraversalFile(final HttpServletRequest request) { new File(request.getParameter("path")); return "Path Traversal page"; } - @SuppressFBWarnings("PT_ABSOLUTE_PATH_TRAVERSAL") @GetMapping("/path_traversal/paths") public String pathTraversalPaths(final HttpServletRequest request) { Paths.get(request.getParameter("path")); diff --git a/dd-smoke-tests/iast-util/src/main/java/datadog/smoketest/springboot/controller/XssController.java b/dd-smoke-tests/iast-util/src/main/java/datadog/smoketest/springboot/controller/XssController.java index 32cad411098..7889a3c81a9 100644 --- a/dd-smoke-tests/iast-util/src/main/java/datadog/smoketest/springboot/controller/XssController.java +++ b/dd-smoke-tests/iast-util/src/main/java/datadog/smoketest/springboot/controller/XssController.java @@ -2,7 +2,6 @@ import ddtest.securitycontrols.InputValidator; import ddtest.securitycontrols.Sanitizer; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.io.IOException; import java.util.Locale; import javax.servlet.http.HttpServletRequest; @@ -18,7 +17,6 @@ public class XssController { @GetMapping("/write") - @SuppressFBWarnings public void write(final HttpServletRequest request, final HttpServletResponse response) { try { response.getWriter().write(request.getParameter("string")); @@ -28,7 +26,6 @@ public void write(final HttpServletRequest request, final HttpServletResponse re } @GetMapping("/write2") - @SuppressFBWarnings public void write2(final HttpServletRequest request, final HttpServletResponse response) { try { response.getWriter().write(request.getParameter("string").toCharArray()); @@ -38,7 +35,6 @@ public void write2(final HttpServletRequest request, final HttpServletResponse r } @GetMapping("/write3") - @SuppressFBWarnings public void write3(final HttpServletRequest request, final HttpServletResponse response) { try { String insecure = request.getParameter("string"); @@ -49,7 +45,6 @@ public void write3(final HttpServletRequest request, final HttpServletResponse r } @GetMapping("/write4") - @SuppressFBWarnings public void write4(final HttpServletRequest request, final HttpServletResponse response) { try { char[] buf = request.getParameter("string").toCharArray(); @@ -60,7 +55,6 @@ public void write4(final HttpServletRequest request, final HttpServletResponse r } @GetMapping("/print") - @SuppressFBWarnings public void print(final HttpServletRequest request, final HttpServletResponse response) { try { response.getWriter().print(request.getParameter("string")); @@ -70,7 +64,6 @@ public void print(final HttpServletRequest request, final HttpServletResponse re } @GetMapping("/print2") - @SuppressFBWarnings public void print2(final HttpServletRequest request, final HttpServletResponse response) { try { response.getWriter().print(request.getParameter("string").toCharArray()); @@ -80,7 +73,6 @@ public void print2(final HttpServletRequest request, final HttpServletResponse r } @GetMapping("/println") - @SuppressFBWarnings public void println(final HttpServletRequest request, final HttpServletResponse response) { try { response.getWriter().println(request.getParameter("string")); @@ -90,7 +82,6 @@ public void println(final HttpServletRequest request, final HttpServletResponse } @GetMapping("/println2") - @SuppressFBWarnings public void println2(final HttpServletRequest request, final HttpServletResponse response) { try { response.getWriter().println(request.getParameter("string").toCharArray()); @@ -100,7 +91,6 @@ public void println2(final HttpServletRequest request, final HttpServletResponse } @GetMapping("/printf") - @SuppressFBWarnings public void printf(final HttpServletRequest request, final HttpServletResponse response) { try { String format = request.getParameter("string"); @@ -111,7 +101,6 @@ public void printf(final HttpServletRequest request, final HttpServletResponse r } @GetMapping("/printf2") - @SuppressFBWarnings public void printf2(final HttpServletRequest request, final HttpServletResponse response) { try { String format = "Formatted like: %1$s and %2$s."; @@ -122,7 +111,6 @@ public void printf2(final HttpServletRequest request, final HttpServletResponse } @GetMapping("/printf3") - @SuppressFBWarnings public void printf3(final HttpServletRequest request, final HttpServletResponse response) { try { String format = request.getParameter("string"); @@ -133,7 +121,6 @@ public void printf3(final HttpServletRequest request, final HttpServletResponse } @GetMapping("/printf4") - @SuppressFBWarnings public void printf4(final HttpServletRequest request, final HttpServletResponse response) { try { String format = "Formatted like: %1$s and %2$s."; @@ -144,7 +131,6 @@ public void printf4(final HttpServletRequest request, final HttpServletResponse } @GetMapping("/format") - @SuppressFBWarnings public void format(final HttpServletRequest request, final HttpServletResponse response) { try { String format = request.getParameter("string"); @@ -155,7 +141,6 @@ public void format(final HttpServletRequest request, final HttpServletResponse r } @GetMapping("/format2") - @SuppressFBWarnings public void format2(final HttpServletRequest request, final HttpServletResponse response) { try { String format = "Formatted like: %1$s and %2$s."; @@ -166,7 +151,6 @@ public void format2(final HttpServletRequest request, final HttpServletResponse } @GetMapping("/format3") - @SuppressFBWarnings public void format3(final HttpServletRequest request, final HttpServletResponse response) { try { String format = request.getParameter("string"); @@ -177,7 +161,6 @@ public void format3(final HttpServletRequest request, final HttpServletResponse } @GetMapping("/format4") - @SuppressFBWarnings public void format4(final HttpServletRequest request, final HttpServletResponse response) { try { String format = "Formatted like: %1$s and %2$s."; @@ -194,7 +177,6 @@ public String responseBody(final HttpServletRequest request, final HttpServletRe } @GetMapping("/sanitize") - @SuppressFBWarnings public void sanitize(final HttpServletRequest request, final HttpServletResponse response) { try { response.getWriter().write(Sanitizer.sanitize(request.getParameter("string"))); @@ -204,7 +186,6 @@ public void sanitize(final HttpServletRequest request, final HttpServletResponse } @GetMapping("/validateAll") - @SuppressFBWarnings public void validateAll(final HttpServletRequest request, final HttpServletResponse response) { try { String s = request.getParameter("string"); @@ -216,7 +197,6 @@ public void validateAll(final HttpServletRequest request, final HttpServletRespo } @GetMapping("/validateAll2") - @SuppressFBWarnings public void validate2(final HttpServletRequest request, final HttpServletResponse response) { try { String string1 = request.getParameter("string"); @@ -229,7 +209,6 @@ public void validate2(final HttpServletRequest request, final HttpServletRespons } @GetMapping("/validate") - @SuppressFBWarnings public void validate(final HttpServletRequest request, final HttpServletResponse response) { try { String string1 = request.getParameter("string"); diff --git a/dd-smoke-tests/java9-modules/build.gradle b/dd-smoke-tests/java9-modules/build.gradle index 4840ab8eb3b..70e1c0d78fd 100644 --- a/dd-smoke-tests/java9-modules/build.gradle +++ b/dd-smoke-tests/java9-modules/build.gradle @@ -39,11 +39,11 @@ tasks.withType(Test).configureEach { delete generatedImageDir // Run the jlink command to create the image - exec { + providers.exec { commandLine jlinkExecutable, '--no-man-pages', '--no-header-files', '--add-modules', 'java.instrument,datadog.smoketest.moduleapp', "--module-path", "${jdkModulesPath}:" + jar.archiveFile.get().toString(), "--output", generatedImageDir - } + }.result.get().assertNormalExitValue() it.jvmArgs "-Ddatadog.smoketest.module.image=${generatedImageDir}" } diff --git a/dd-smoke-tests/java9-modules/gradle.lockfile b/dd-smoke-tests/java9-modules/gradle.lockfile index 7e9699a2eda..ad369d990c0 100644 --- a/dd-smoke-tests/java9-modules/gradle.lockfile +++ b/dd-smoke-tests/java9-modules/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:java9-modules:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -72,6 +77,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -96,8 +102,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/java9-modules/src/test/groovy/datadog/smoketest/Java9ModulesSmokeTest.groovy b/dd-smoke-tests/java9-modules/src/test/groovy/datadog/smoketest/Java9ModulesSmokeTest.groovy index da1c10bd5c8..57865e57bca 100644 --- a/dd-smoke-tests/java9-modules/src/test/groovy/datadog/smoketest/Java9ModulesSmokeTest.groovy +++ b/dd-smoke-tests/java9-modules/src/test/groovy/datadog/smoketest/Java9ModulesSmokeTest.groovy @@ -2,6 +2,14 @@ package datadog.smoketest import static java.util.concurrent.TimeUnit.SECONDS +import datadog.environment.JavaVirtualMachine +import datadog.environment.OperatingSystem +import spock.lang.IgnoreIf + +// TODO: OpenJ9 (Semeru) on Linux arm64 fails on this test. +@IgnoreIf({ + OperatingSystem.isLinux() && OperatingSystem.architecture().isArm64() && JavaVirtualMachine.isJ9() +}) class Java9ModulesSmokeTest extends AbstractSmokeTest { // Estimate for the amount of time instrumentation plus some extra private static final int TIMEOUT_SECS = 30 diff --git a/dd-smoke-tests/jboss-modules/gradle.lockfile b/dd-smoke-tests/jboss-modules/gradle.lockfile index ad90cb2e5c9..9e2ccd9ee39 100644 --- a/dd-smoke-tests/jboss-modules/gradle.lockfile +++ b/dd-smoke-tests/jboss-modules/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:jboss-modules:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,32 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:20.0=compileClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -41,12 +47,12 @@ commons-io:commons-io:2.20.0=spotbugs commons-logging:commons-logging:1.2=compileClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -78,6 +84,7 @@ org.jboss.modules:jboss-modules:1.3.0.Final=compileClasspath,jbossModulesV1 org.jboss.modules:jboss-modules:2.0.0.Final=jbossModulesV2 org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -102,8 +109,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/jdk-tool-abort/gradle.lockfile b/dd-smoke-tests/jdk-tool-abort/gradle.lockfile index 5b801a39bfb..946a0f1848a 100644 --- a/dd-smoke-tests/jdk-tool-abort/gradle.lockfile +++ b/dd-smoke-tests/jdk-tool-abort/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:jdk-tool-abort:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -72,6 +77,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -96,8 +102,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/jersey-2/gradle.lockfile b/dd-smoke-tests/jersey-2/gradle.lockfile index 07848283fd5..514d8bf827c 100644 --- a/dd-smoke-tests/jersey-2/gradle.lockfile +++ b/dd-smoke-tests/jersey-2/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:jersey-2:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,28 +9,32 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:14.0.1=compileClasspath,runtimeClasspath,testFixturesRuntimeClasspath -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -55,8 +60,8 @@ javax.xml.stream:stax-api:1.0-2=compileClasspath,runtimeClasspath,testCompileCla javax.xml:jaxb-api:2.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -108,6 +113,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -132,8 +138,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/jersey-3/gradle.lockfile b/dd-smoke-tests/jersey-3/gradle.lockfile index 57ecf4e86da..3613d2859e0 100644 --- a/dd-smoke-tests/jersey-3/gradle.lockfile +++ b/dd-smoke-tests/jersey-3/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:jersey-3:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -18,22 +19,26 @@ com.fasterxml.jackson.core:jackson-databind:2.12.2=compileClasspath,runtimeClass com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.12.2=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.12.2=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -58,8 +63,8 @@ javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath javax.xml.bind:jaxb-api:2.3.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -106,6 +111,7 @@ org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.javassist:javassist:3.25.0-GA=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -130,8 +136,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/junit-console/gradle.lockfile b/dd-smoke-tests/junit-console/gradle.lockfile index cb4a23a5e96..7f0683c68a9 100644 --- a/dd-smoke-tests/junit-console/gradle.lockfile +++ b/dd-smoke-tests/junit-console/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:junit-console:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -17,22 +18,26 @@ com.fasterxml.jackson.core:jackson-core:2.20.0=testCompileClasspath,testRuntimeC com.fasterxml.jackson.core:jackson-databind:2.20.0=testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.20.0=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.jayway.jsonpath:json-path:2.8.0=testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -45,12 +50,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.minidev:accessors-smart:2.4.9=testRuntimeClasspath @@ -79,10 +84,11 @@ org.freemarker:freemarker:2.3.31=testCompileClasspath,testRuntimeClasspath org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.core:0.8.14=testRuntimeClasspath -org.jacoco:org.jacoco.report:0.8.14=testRuntimeClasspath +org.jacoco:org.jacoco.core:0.8.15=testRuntimeClasspath +org.jacoco:org.jacoco.report:0.8.15=testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -103,14 +109,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.skyscreamer:jsonassert:1.5.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/junit-console/src/test/groovy/datadog/smoketest/JUnitConsoleSmokeTest.groovy b/dd-smoke-tests/junit-console/src/test/groovy/datadog/smoketest/JUnitConsoleSmokeTest.groovy deleted file mode 100644 index 22fb515c1af..00000000000 --- a/dd-smoke-tests/junit-console/src/test/groovy/datadog/smoketest/JUnitConsoleSmokeTest.groovy +++ /dev/null @@ -1,250 +0,0 @@ -package datadog.smoketest - - -import datadog.trace.api.config.CiVisibilityConfig -import datadog.trace.api.config.DebuggerConfig -import datadog.trace.api.config.GeneralConfig -import datadog.trace.civisibility.CiVisibilitySmokeTest -import java.nio.file.FileVisitResult -import java.nio.file.Files -import java.nio.file.Path -import java.nio.file.Paths -import java.nio.file.SimpleFileVisitor -import java.nio.file.attribute.BasicFileAttributes -import java.util.concurrent.TimeUnit -import java.util.concurrent.TimeoutException -import org.slf4j.Logger -import org.slf4j.LoggerFactory -import spock.lang.AutoCleanup -import spock.lang.Shared -import spock.lang.TempDir - -class JUnitConsoleSmokeTest extends CiVisibilitySmokeTest { - // CodeNarc incorrectly thinks ".class" is unnecessary in getLogger - @SuppressWarnings('UnnecessaryDotClass') - private static final Logger LOGGER = LoggerFactory.getLogger(JUnitConsoleSmokeTest.class) - - private static final String TEST_SERVICE_NAME = "test-headless-service" - - private static final int PROCESS_TIMEOUT_SECS = 60 - private static final String JUNIT_CONSOLE_JAR_PATH = System.getProperty("datadog.smoketest.junit.console.jar.path") - private static final String JAVA_HOME = buildJavaHome() - - @TempDir - Path projectHome - - @Shared - @AutoCleanup - MockBackend mockBackend = new MockBackend() - - def setup() { - mockBackend.reset() - } - - def "test headless failed test replay"() { - givenProjectFiles(projectName) - - mockBackend.givenFlakyRetries(true) - mockBackend.givenFlakyTest("test-headless-service", "com.example.TestFailed", "test_failed") - mockBackend.givenFailedTestReplay(true) - - def compileCode = compileTestProject() - assert compileCode == 0 - - def exitCode = whenRunningJUnitConsole([ - (CiVisibilityConfig.CIVISIBILITY_FLAKY_RETRY_COUNT): "3", - (GeneralConfig.AGENTLESS_LOG_SUBMISSION_URL): mockBackend.intakeUrl, - (DebuggerConfig.DYNAMIC_INSTRUMENTATION_UPLOAD_FLUSH_INTERVAL): "999999" // avoid possible race conditions on shutdown - ], - [:]) - assert exitCode == 1 - - def additionalDynamicTags = ["content.meta.['_dd.debug.error.6.snapshot_id']", "content.meta.['_dd.debug.error.exception_id']"] - verifyEventsAndCoverages(projectName, "junit-console", "headless", mockBackend.waitForEvents(7), mockBackend.waitForCoverages(0), additionalDynamicTags) - verifySnapshots(mockBackend.waitForLogs(2), 2) - - where: - projectName = "test_junit_console_failed_test_replay" - } - - private void givenProjectFiles(String projectFilesSources) { - def projectResourcesUri = this.getClass().getClassLoader().getResource(projectFilesSources).toURI() - def projectResourcesPath = Paths.get(projectResourcesUri) - copyFolder(projectResourcesPath, projectHome) - } - - private void copyFolder(Path src, Path dest) throws IOException { - Files.walkFileTree(src, new SimpleFileVisitor() { - @Override - FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) - throws IOException { - Files.createDirectories(dest.resolve(src.relativize(dir))) - return FileVisitResult.CONTINUE - } - - @Override - FileVisitResult visitFile(Path file, BasicFileAttributes attrs) - throws IOException { - Files.copy(file, dest.resolve(src.relativize(file))) - return FileVisitResult.CONTINUE - } - }) - - // creating empty .git directory so that the tracer could detect projectFolder as repo root - Files.createDirectory(projectHome.resolve(".git")) - } - - private int compileTestProject() { - def srcDir = projectHome.resolve("src/main/java") - def testSrcDir = projectHome.resolve("src/test/java") - def classesDir = projectHome.resolve("target/classes") - def testClassesDir = projectHome.resolve("target/test-classes") - - Files.createDirectories(classesDir) - Files.createDirectories(testClassesDir) - - // Compile main classes if they exist - if (Files.exists(srcDir)) { - def mainJavaFiles = findJavaFiles(srcDir) - if (!mainJavaFiles.isEmpty()) { - def result = runProcess(createCompilerProcessBuilder(classesDir.toString(), mainJavaFiles).start()) - if (result != 0) { - LOGGER.error("Error compiling source classes for JUnit Console smoke test") - return result - } - } - } - - // Compile test classes - def testJavaFiles = findJavaFiles(testSrcDir) - if (!testJavaFiles.isEmpty()) { - def result = runProcess(createCompilerProcessBuilder(testClassesDir.toString(), testJavaFiles, [classesDir.toString()]).start()) - if (result != 0) { - LOGGER.error("Error compiling source classes for JUnit Console smoke test") - return result - } - } - - return 0 - } - - private ProcessBuilder createCompilerProcessBuilder(String targetDir, List files, List additionalDeps = []) { - assert new File(JUNIT_CONSOLE_JAR_PATH).isFile() - - List deps = [JUNIT_CONSOLE_JAR_PATH] - deps.addAll(additionalDeps) - - List command = new ArrayList<>() - command.add(javacPath()) - command.addAll(["-cp", deps.join(":")]) - command.addAll(["-d", targetDir]) - command.addAll(files) - - ProcessBuilder processBuilder = new ProcessBuilder(command) - - processBuilder.directory(projectHome.toFile()) - processBuilder.environment().put("JAVA_HOME", JAVA_HOME) - - return processBuilder - } - - private static List findJavaFiles(Path directory) { - if (!Files.exists(directory)) { - return [] - } - - List javaFiles = [] - Files.walkFileTree(directory, new SimpleFileVisitor() { - @Override - FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { - if (file.toString().endsWith(".java")) { - javaFiles.add(file.toString()) - } - return FileVisitResult.CONTINUE - } - }) - - return javaFiles - } - - private int whenRunningJUnitConsole(Map additionalAgentArgs, Map additionalEnvVars) { - def processBuilder = createConsoleProcessBuilder(["execute"], additionalAgentArgs, additionalEnvVars) - - processBuilder.environment().put("DD_API_KEY", "01234567890abcdef123456789ABCDEF") - - return runProcess(processBuilder.start()) - } - - private static runProcess(Process p, int timeoutSecs = PROCESS_TIMEOUT_SECS) { - StreamConsumer errorGobbler = new StreamConsumer(p.getErrorStream(), "ERROR") - StreamConsumer outputGobbler = new StreamConsumer(p.getInputStream(), "OUTPUT") - outputGobbler.start() - errorGobbler.start() - - if (!p.waitFor(timeoutSecs, TimeUnit.SECONDS)) { - p.destroyForcibly() - throw new TimeoutException("Instrumented process failed to exit within $timeoutSecs seconds") - } - - return p.exitValue() - } - - ProcessBuilder createConsoleProcessBuilder(List consoleCommand, Map additionalAgentArgs, Map additionalEnvVars) { - assert new File(JUNIT_CONSOLE_JAR_PATH).isFile() - - List command = new ArrayList<>() - command.add(javaPath()) - command.add("-Ddatadog.slf4j.simpleLogger.defaultLogLevel=DEBUG") - command.addAll((String[]) ["-jar", JUNIT_CONSOLE_JAR_PATH]) - command.addAll(consoleCommand) - command.addAll([ - "--class-path", - [projectHome.resolve("target/classes").toString(), projectHome.resolve("target/test-classes")].join(":") - ]) - command.add("--scan-class-path") - - ProcessBuilder processBuilder = new ProcessBuilder(command) - processBuilder.directory(projectHome.toFile()) - - processBuilder.environment().put("JAVA_HOME", JAVA_HOME) - processBuilder.environment().put("JAVA_TOOL_OPTIONS", javaToolOptions(additionalAgentArgs)) - for (envVar in additionalEnvVars) { - processBuilder.environment().put(envVar.key, envVar.value) - } - - def mavenRepositoryProxy = System.getenv("MAVEN_REPOSITORY_PROXY") - if (mavenRepositoryProxy != null) { - processBuilder.environment().put("MAVEN_REPOSITORY_PROXY", mavenRepositoryProxy) - } - - return processBuilder - } - - String javaToolOptions(Map additionalAgentArgs) { - additionalAgentArgs.put(CiVisibilityConfig.CIVISIBILITY_BUILD_INSTRUMENTATION_ENABLED, "false") - return buildJvmArguments(mockBackend.intakeUrl, TEST_SERVICE_NAME, additionalAgentArgs).join(" ") - } - - private static class StreamConsumer extends Thread { - final InputStream is - final String messagePrefix - - StreamConsumer(InputStream is, String messagePrefix) { - this.is = is - this.messagePrefix = messagePrefix - } - - @Override - void run() { - try { - BufferedReader br = new BufferedReader(new InputStreamReader(is)) - String line - while ((line = br.readLine()) != null) { - System.out.println(messagePrefix + ": " + line) - } - } catch (IOException e) { - e.printStackTrace() - } - } - } -} diff --git a/dd-smoke-tests/junit-console/src/test/java/datadog/smoketest/JUnitConsoleSmokeTest.java b/dd-smoke-tests/junit-console/src/test/java/datadog/smoketest/JUnitConsoleSmokeTest.java new file mode 100644 index 00000000000..939a81c633a --- /dev/null +++ b/dd-smoke-tests/junit-console/src/test/java/datadog/smoketest/JUnitConsoleSmokeTest.java @@ -0,0 +1,303 @@ +package datadog.smoketest; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.api.config.CiVisibilityConfig; +import datadog.trace.api.config.DebuggerConfig; +import datadog.trace.api.config.GeneralConfig; +import datadog.trace.civisibility.CiVisibilitySmokeTest; +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import java.util.stream.Collectors; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +class JUnitConsoleSmokeTest extends CiVisibilitySmokeTest { + private static final Logger LOGGER = LoggerFactory.getLogger(JUnitConsoleSmokeTest.class); + + private static final String TEST_SERVICE_NAME = "test-headless-service"; + + private static final int PROCESS_TIMEOUT_SECS = 60; + private static final String JUNIT_CONSOLE_JAR_PATH = + System.getProperty("datadog.smoketest.junit.console.jar.path"); + private static final String JAVA_HOME = buildJavaHome(); + + @TempDir Path projectHome; + + static final MockBackend mockBackend = new MockBackend(); + + @BeforeEach + void resetMockBackend() { + mockBackend.reset(); + } + + @AfterAll + static void closeMockBackend() throws Exception { + mockBackend.close(); + } + + @Test + void testHeadlessFailedTestReplay() throws Exception { + String projectName = "test_junit_console_failed_test_replay"; + givenProjectFiles(projectName); + + mockBackend.givenFlakyRetries(true); + mockBackend.givenFlakyTest("test-headless-service", "com.example.TestFailed", "test_failed"); + mockBackend.givenFailedTestReplay(true); + + int compileCode = compileTestProject(); + assertEquals(0, compileCode); + + Map agentArgs = new HashMap<>(); + agentArgs.put(CiVisibilityConfig.CIVISIBILITY_FLAKY_RETRY_COUNT, "3"); + agentArgs.put(GeneralConfig.AGENTLESS_LOG_SUBMISSION_URL, mockBackend.getIntakeUrl()); + // avoid possible race conditions on shutdown + agentArgs.put(DebuggerConfig.DYNAMIC_INSTRUMENTATION_UPLOAD_FLUSH_INTERVAL, "999999"); + + int exitCode = whenRunningJUnitConsole(agentArgs, Collections.emptyMap()); + assertEquals(1, exitCode); + + List additionalDynamicTags = + Arrays.asList( + "content.meta.['_dd.debug.error.6.snapshot_id']", + "content.meta.['_dd.debug.error.exception_id']"); + verifyEventsAndCoverages( + projectName, + "junit-console", + "headless", + mockBackend.waitForEvents(7), + mockBackend.waitForCoverages(0), + additionalDynamicTags); + verifySnapshots(mockBackend.waitForLogs(2), 2); + } + + private void givenProjectFiles(String projectFilesSources) throws Exception { + Path projectResourcesPath = + Paths.get(this.getClass().getClassLoader().getResource(projectFilesSources).toURI()); + copyFolder(projectResourcesPath, projectHome); + } + + private void copyFolder(Path src, Path dest) throws IOException { + Files.walkFileTree( + src, + new SimpleFileVisitor() { + @Override + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) + throws IOException { + Files.createDirectories(dest.resolve(src.relativize(dir))); + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) + throws IOException { + Files.copy(file, dest.resolve(src.relativize(file))); + return FileVisitResult.CONTINUE; + } + }); + + // creating empty .git directory so that the tracer could detect projectFolder as repo root + Files.createDirectory(projectHome.resolve(".git")); + } + + private int compileTestProject() throws Exception { + Path srcDir = projectHome.resolve("src/main/java"); + Path testSrcDir = projectHome.resolve("src/test/java"); + Path classesDir = projectHome.resolve("target/classes"); + Path testClassesDir = projectHome.resolve("target/test-classes"); + + Files.createDirectories(classesDir); + Files.createDirectories(testClassesDir); + + // Compile main classes if they exist + if (Files.exists(srcDir)) { + List mainJavaFiles = findJavaFiles(srcDir); + if (!mainJavaFiles.isEmpty()) { + int result = + runProcess( + createCompilerProcessBuilder( + classesDir.toString(), mainJavaFiles, Collections.emptyList()) + .start(), + PROCESS_TIMEOUT_SECS); + if (result != 0) { + LOGGER.error("Error compiling source classes for JUnit Console smoke test"); + return result; + } + } + } + + // Compile test classes + List testJavaFiles = findJavaFiles(testSrcDir); + if (!testJavaFiles.isEmpty()) { + int result = + runProcess( + createCompilerProcessBuilder( + testClassesDir.toString(), + testJavaFiles, + Collections.singletonList(classesDir.toString())) + .start(), + PROCESS_TIMEOUT_SECS); + if (result != 0) { + LOGGER.error("Error compiling source classes for JUnit Console smoke test"); + return result; + } + } + + return 0; + } + + private ProcessBuilder createCompilerProcessBuilder( + String targetDir, List files, List additionalDeps) { + assertTrue(new File(JUNIT_CONSOLE_JAR_PATH).isFile()); + + List deps = new ArrayList<>(); + deps.add(JUNIT_CONSOLE_JAR_PATH); + deps.addAll(additionalDeps); + + List command = new ArrayList<>(); + command.add(javacPath()); + command.addAll(Arrays.asList("-cp", String.join(":", deps))); + command.addAll(Arrays.asList("-d", targetDir)); + command.addAll(files); + + ProcessBuilder processBuilder = new ProcessBuilder(command); + processBuilder.directory(projectHome.toFile()); + processBuilder.environment().put("JAVA_HOME", JAVA_HOME); + return processBuilder; + } + + private static List findJavaFiles(Path directory) throws IOException { + if (!Files.exists(directory)) { + return Collections.emptyList(); + } + + List javaFiles = new ArrayList<>(); + Files.walkFileTree( + directory, + new SimpleFileVisitor() { + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) + throws IOException { + if (file.toString().endsWith(".java")) { + javaFiles.add(file.toString()); + } + return FileVisitResult.CONTINUE; + } + }); + + return javaFiles; + } + + private int whenRunningJUnitConsole( + Map additionalAgentArgs, Map additionalEnvVars) + throws Exception { + ProcessBuilder processBuilder = + createConsoleProcessBuilder( + Collections.singletonList("execute"), additionalAgentArgs, additionalEnvVars); + processBuilder.environment().put("DD_API_KEY", "01234567890abcdef123456789ABCDEF"); + return runProcess(processBuilder.start(), PROCESS_TIMEOUT_SECS); + } + + private static int runProcess(Process p, int timeoutSecs) throws Exception { + StreamConsumer errorGobbler = new StreamConsumer(p.getErrorStream(), "ERROR"); + StreamConsumer outputGobbler = new StreamConsumer(p.getInputStream(), "OUTPUT"); + outputGobbler.start(); + errorGobbler.start(); + + if (!p.waitFor(timeoutSecs, TimeUnit.SECONDS)) { + p.destroyForcibly(); + throw new TimeoutException( + "Instrumented process failed to exit within " + timeoutSecs + " seconds"); + } + + return p.exitValue(); + } + + ProcessBuilder createConsoleProcessBuilder( + List consoleCommand, + Map additionalAgentArgs, + Map additionalEnvVars) { + assertTrue(new File(JUNIT_CONSOLE_JAR_PATH).isFile()); + + List command = new ArrayList<>(); + command.add(javaPath()); + command.add("-Ddatadog.slf4j.simpleLogger.defaultLogLevel=DEBUG"); + command.addAll(Arrays.asList("-jar", JUNIT_CONSOLE_JAR_PATH)); + command.addAll(consoleCommand); + command.addAll( + Arrays.asList( + "--class-path", + projectHome.resolve("target/classes") + + ":" + + projectHome.resolve("target/test-classes"))); + command.add("--scan-class-path"); + + ProcessBuilder processBuilder = new ProcessBuilder(command); + processBuilder.directory(projectHome.toFile()); + + processBuilder.environment().put("JAVA_HOME", JAVA_HOME); + processBuilder.environment().put("JAVA_TOOL_OPTIONS", javaToolOptions(additionalAgentArgs)); + for (Map.Entry envVar : additionalEnvVars.entrySet()) { + processBuilder.environment().put(envVar.getKey(), envVar.getValue()); + } + + String mavenRepositoryProxy = System.getenv("MAVEN_REPOSITORY_PROXY"); + if (mavenRepositoryProxy != null) { + processBuilder.environment().put("MAVEN_REPOSITORY_PROXY", mavenRepositoryProxy); + } + + return processBuilder; + } + + String javaToolOptions(Map additionalAgentArgs) { + additionalAgentArgs.put(CiVisibilityConfig.CIVISIBILITY_BUILD_INSTRUMENTATION_ENABLED, "false"); + return buildJvmArguments(mockBackend.getIntakeUrl(), TEST_SERVICE_NAME, additionalAgentArgs) + .stream() + .collect(Collectors.joining(" ")); + } + + private static class StreamConsumer extends Thread { + final InputStream is; + final String messagePrefix; + + StreamConsumer(InputStream is, String messagePrefix) { + this.is = is; + this.messagePrefix = messagePrefix; + } + + @Override + public void run() { + try { + BufferedReader br = new BufferedReader(new InputStreamReader(is)); + String line; + while ((line = br.readLine()) != null) { + System.out.println(messagePrefix + ": " + line); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + } +} diff --git a/dd-smoke-tests/junit-console/src/test/resources/test_junit_console_failed_test_replay/events.ftl b/dd-smoke-tests/junit-console/src/test/resources/test_junit_console_failed_test_replay/events.ftl index 2ee6214cae9..0261044895b 100644 --- a/dd-smoke-tests/junit-console/src/test/resources/test_junit_console_failed_test_replay/events.ftl +++ b/dd-smoke-tests/junit-console/src/test/resources/test_junit_console_failed_test_replay/events.ftl @@ -20,6 +20,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit5", "test.framework_version" : "5.13.4", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "test-headless-service", "test.source.file" : "src/test/java/com/example/TestFailed.java", "test.status" : "fail", @@ -76,6 +77,7 @@ "test.final_status" : "fail", "test.framework" : "junit5", "test.framework_version" : "5.13.4", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "test-headless-service", "test.name" : "test_another_failed", "test.source.file" : "src/test/java/com/example/TestFailed.java", @@ -142,6 +144,7 @@ "test.failure_suppressed" : "true", "test.framework" : "junit5", "test.framework_version" : "5.13.4", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "test-headless-service", "test.name" : "test_failed", "test.source.file" : "src/test/java/com/example/TestFailed.java", @@ -214,6 +217,7 @@ "test.framework" : "junit5", "test.framework_version" : "5.13.4", "test.is_retry" : "true", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "test-headless-service", "test.name" : "test_failed", "test.retry_reason" : "auto_test_retry", @@ -289,6 +293,7 @@ "test.framework_version" : "5.13.4", "test.has_failed_all_retries" : "true", "test.is_retry" : "true", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "test-headless-service", "test.name" : "test_failed", "test.retry_reason" : "auto_test_retry", diff --git a/dd-smoke-tests/kafka-2/application/build.gradle b/dd-smoke-tests/kafka-2/application/build.gradle new file mode 100644 index 00000000000..31411ab9e3e --- /dev/null +++ b/dd-smoke-tests/kafka-2/application/build.gradle @@ -0,0 +1,42 @@ +// Spring Boot 2.7.x is the last line that still supports Java 8, which this smoke test +// exercises (see the Java 8 `sourceCompatibility` below). Do not bump to 3.x without +// also moving the smoke test off Java 8. +plugins { + id 'java' + id 'org.springframework.boot' version '2.7.15' + id 'io.spring.dependency-management' version '1.0.15.RELEASE' +} + +def sharedRootDir = "$rootDir/../../../" +def sharedConfigDirectory = "$sharedRootDir/gradle" +rootProject.ext.sharedConfigDirectory = sharedConfigDirectory + +apply from: "$sharedConfigDirectory/repositories.gradle" + +if (hasProperty('appBuildDir')) { + buildDir = property('appBuildDir') +} + +version = "" + +// Pin bytecode target: the nested daemon now runs on JDK 21, but the smoke test launches +// the produced jar on Java 8. +java { + sourceCompatibility = JavaVersion.VERSION_1_8 +} + +// `iastUtilJar` is wired up by the outer `smokeTestApp { projectJar('iastUtilJar', ...) }` +// block in ../build.gradle: it passes the path of the built `:dd-smoke-tests:iast-util` +// jar into this nested build as a Gradle property. We add it as a flat-file dependency +// because the outer build's projects are not addressable from inside the nested build. +if (hasProperty('iastUtilJar')) { + dependencies { + implementation files(property('iastUtilJar')) + } +} + +dependencies { + implementation('org.springframework.boot:spring-boot-starter-web') + implementation('org.springframework.boot:spring-boot-starter-actuator') + implementation('org.springframework.kafka:spring-kafka') +} diff --git a/dd-smoke-tests/kafka-2/application/settings.gradle b/dd-smoke-tests/kafka-2/application/settings.gradle new file mode 100644 index 00000000000..c5c3c0a333d --- /dev/null +++ b/dd-smoke-tests/kafka-2/application/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'kafka-2-smoketest' diff --git a/dd-smoke-tests/kafka-2/src/main/java/datadog/smoketest/kafka/KafkaApplication.java b/dd-smoke-tests/kafka-2/application/src/main/java/datadog/smoketest/kafka/KafkaApplication.java similarity index 100% rename from dd-smoke-tests/kafka-2/src/main/java/datadog/smoketest/kafka/KafkaApplication.java rename to dd-smoke-tests/kafka-2/application/src/main/java/datadog/smoketest/kafka/KafkaApplication.java diff --git a/dd-smoke-tests/kafka-2/src/main/java/datadog/smoketest/kafka/iast/IastConfiguration.java b/dd-smoke-tests/kafka-2/application/src/main/java/datadog/smoketest/kafka/iast/IastConfiguration.java similarity index 100% rename from dd-smoke-tests/kafka-2/src/main/java/datadog/smoketest/kafka/iast/IastConfiguration.java rename to dd-smoke-tests/kafka-2/application/src/main/java/datadog/smoketest/kafka/iast/IastConfiguration.java diff --git a/dd-smoke-tests/kafka-2/src/main/java/datadog/smoketest/kafka/iast/IastController.java b/dd-smoke-tests/kafka-2/application/src/main/java/datadog/smoketest/kafka/iast/IastController.java similarity index 100% rename from dd-smoke-tests/kafka-2/src/main/java/datadog/smoketest/kafka/iast/IastController.java rename to dd-smoke-tests/kafka-2/application/src/main/java/datadog/smoketest/kafka/iast/IastController.java diff --git a/dd-smoke-tests/kafka-2/src/main/java/datadog/smoketest/kafka/iast/IastMessage.java b/dd-smoke-tests/kafka-2/application/src/main/java/datadog/smoketest/kafka/iast/IastMessage.java similarity index 100% rename from dd-smoke-tests/kafka-2/src/main/java/datadog/smoketest/kafka/iast/IastMessage.java rename to dd-smoke-tests/kafka-2/application/src/main/java/datadog/smoketest/kafka/iast/IastMessage.java diff --git a/dd-smoke-tests/kafka-2/build.gradle b/dd-smoke-tests/kafka-2/build.gradle index c947425a4ba..ec1e85d52e3 100644 --- a/dd-smoke-tests/kafka-2/build.gradle +++ b/dd-smoke-tests/kafka-2/build.gradle @@ -1,34 +1,36 @@ -import org.springframework.boot.gradle.tasks.bundling.BootJar - plugins { - id 'org.springframework.boot' version '2.7.15' - id 'io.spring.dependency-management' version '1.0.15.RELEASE' + id 'dd-trace-java.smoke-test-app' id 'java-test-fixtures' } apply from: "$rootDir/gradle/java.gradle" -apply from: "$rootDir/gradle/spring-boot-plugin.gradle" -description = 'Kafka 2.x Smoke Tests.' -dependencies { - implementation('org.springframework.boot:spring-boot-starter-web') - implementation('org.springframework.boot:spring-boot-starter-actuator') - implementation('org.springframework.kafka:spring-kafka') +description = 'Kafka 2.x Smoke Tests.' - testImplementation('org.springframework.kafka:spring-kafka-test') +smokeTestApp { + gradleApp { + taskName = 'bootJar' + artifactPath = 'libs/kafka-2-smoketest.jar' + sysProperty = 'datadog.smoketest.springboot.shadowJar.path' + } + projectJar('iastUtilJar', project(':dd-smoke-tests:iast-util')) +} +dependencies { + // Pinned: this version was previously resolved transitively from the Spring Boot BOM in + // the outer build. Now that the application is in a nested build, the BOM is no longer + // available here. + testImplementation('org.springframework.kafka:spring-kafka-test:2.8.11') testImplementation project(':dd-smoke-tests') - implementation project(':dd-smoke-tests:iast-util') testImplementation(testFixtures(project(":dd-smoke-tests:iast-util"))) } -tasks.withType(Test).configureEach { - def bootJarTask = tasks.named('bootJar', BootJar) - dependsOn bootJarTask - jvmArgumentProviders.add(new CommandLineArgumentProvider() { - @Override - Iterable asArguments() { - return bootJarTask.map { ["-Ddatadog.smoketest.springboot.shadowJar.path=${it.archiveFile.get()}"] }.get() - } - }) +spotless { + java { + target "**/*.java" + } + + groovyGradle { + target '*.gradle', "**/*.gradle" + } } diff --git a/dd-smoke-tests/kafka-2/gradle.lockfile b/dd-smoke-tests/kafka-2/gradle.lockfile index 39a87b7b366..e561130f21c 100644 --- a/dd-smoke-tests/kafka-2/gradle.lockfile +++ b/dd-smoke-tests/kafka-2/gradle.lockfile @@ -1,204 +1,175 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. -cafe.cryptography:curve25519-elisabeth:0.1.0=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -cafe.cryptography:ed25519-elisabeth:0.1.0=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -ch.qos.logback:logback-classic:1.2.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath +# To regenerate this file, run: ./gradlew :dd-smoke-tests:kafka-2:dependencies --write-locks +cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath +cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq.okio:okio:1.17.6=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:java-dogstatsd-client:4.4.5=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:sketches-java:0.8.3=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.dataformat:jackson-dataformat-csv:2.13.5=testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.module:jackson-module-scala_2.13:2.13.5=testRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.javaparser:javaparser-core:3.25.4=codenarc -com.github.jnr:jffi:1.3.14=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-a64asm:1.0.0=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-constants:0.10.4=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-x86asm:1.0.2=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.luben:zstd-jni:1.5.0-4=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath +com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath +com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath +com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath +com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath +com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath +com.fasterxml.jackson.core:jackson-annotations:2.12.6=testRuntimeClasspath +com.fasterxml.jackson.core:jackson-core:2.12.6=testRuntimeClasspath +com.fasterxml.jackson.core:jackson-databind:2.12.6=testRuntimeClasspath +com.fasterxml.jackson.dataformat:jackson-dataformat-csv:2.12.6=testRuntimeClasspath +com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.12.6=testRuntimeClasspath +com.fasterxml.jackson.module:jackson-module-scala_2.13:2.12.6=testRuntimeClasspath +com.fasterxml.jackson:jackson-bom:2.12.6=testRuntimeClasspath +com.github.javaparser:javaparser-core:3.25.6=codenarc +com.github.jnr:jffi:1.3.15=testRuntimeClasspath +com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath +com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath +com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath +com.github.luben:zstd-jni:1.5.0-2=testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs -com.google.code.findbugs:jsr305:3.0.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.google.code.gson:gson:2.9.1=spotbugs -com.google.guava:guava:20.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.squareup.moshi:moshi:1.11.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.squareup.okhttp3:logging-interceptor:4.9.3=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.squareup.okhttp3:okhttp:4.9.3=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.squareup.okio:okio:2.8.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.sun.activation:jakarta.activation:1.2.2=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.sun.mail:jakarta.mail:1.6.7=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.google.code.gson:gson:2.13.2=spotbugs +com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath +com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okio:okio:1.17.5=testCompileClasspath,testRuntimeClasspath +com.sun.activation:jakarta.activation:2.0.1=testRuntimeClasspath +com.sun.mail:jakarta.mail:2.0.1=testRuntimeClasspath com.thoughtworks.paranamer:paranamer:2.8=testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc com.typesafe.scala-logging:scala-logging_2.13:3.9.3=testRuntimeClasspath com.yammer.metrics:metrics-core:2.2.0=testRuntimeClasspath commons-cli:commons-cli:1.4=testRuntimeClasspath -commons-fileupload:commons-fileupload:1.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -commons-io:commons-io:2.11.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testRuntimeClasspath +commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs -de.thetaphi:forbiddenapis:3.10=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -io.dropwizard.metrics:metrics-core:4.2.19=testRuntimeClasspath +de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath +io.dropwizard.metrics:metrics-core:4.1.12.1=testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.micrometer:micrometer-core:1.9.14=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -io.netty:netty-buffer:4.1.97.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-codec:4.1.97.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-common:4.1.97.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-handler:4.1.97.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-resolver:4.1.97.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-transport-classes-epoll:4.1.97.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-transport-native-epoll:4.1.97.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-transport-native-unix-common:4.1.97.Final=testCompileClasspath,testRuntimeClasspath -io.netty:netty-transport:4.1.97.Final=testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -jakarta.activation:jakarta.activation-api:1.2.2=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -jakarta.mail:jakarta.mail-api:1.6.7=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -javax.servlet:javax.servlet-api:4.0.1=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -jaxen:jaxen:1.2.0=spotbugs -junit:junit:4.13.2=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.12.23=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.12.23=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna-platform:5.8.0=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.8.0=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +io.netty:netty-buffer:4.1.63.Final=testCompileClasspath,testRuntimeClasspath +io.netty:netty-codec:4.1.63.Final=testCompileClasspath,testRuntimeClasspath +io.netty:netty-common:4.1.63.Final=testCompileClasspath,testRuntimeClasspath +io.netty:netty-handler:4.1.63.Final=testCompileClasspath,testRuntimeClasspath +io.netty:netty-resolver:4.1.63.Final=testCompileClasspath,testRuntimeClasspath +io.netty:netty-transport-native-epoll:4.1.63.Final=testCompileClasspath,testRuntimeClasspath +io.netty:netty-transport-native-unix-common:4.1.63.Final=testCompileClasspath,testRuntimeClasspath +io.netty:netty-transport:4.1.63.Final=testCompileClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath +jakarta.activation:jakarta.activation-api:2.1.3=testRuntimeClasspath +jakarta.mail:jakarta.mail-api:2.0.1=testRuntimeClasspath +javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath +jaxen:jaxen:2.0.0=spotbugs +junit:junit:4.13.2=testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath +net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath +net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.jopt-simple:jopt-simple:5.0.4=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs net.sourceforge.argparse4j:argparse4j:0.7.0=testRuntimeClasspath -org.apache.ant:ant-antlr:1.10.12=codenarc -org.apache.ant:ant-junit:1.10.12=codenarc +org.apache.ant:ant-antlr:1.10.14=codenarc +org.apache.ant:ant-junit:1.10.14=codenarc org.apache.bcel:bcel:6.11.0=spotbugs -org.apache.commons:commons-lang3:3.12.0=productionRuntimeClasspath,runtimeClasspath,spotbugs,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.commons:commons-text:1.0=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.apache.commons:commons-lang3:3.19.0=spotbugs +org.apache.commons:commons-lang3:3.5=testRuntimeClasspath +org.apache.commons:commons-text:1.0=testRuntimeClasspath org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.kafka:kafka-clients:3.1.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.kafka:kafka-metadata:3.1.2=testCompileClasspath,testRuntimeClasspath -org.apache.kafka:kafka-raft:3.1.2=testRuntimeClasspath -org.apache.kafka:kafka-server-common:3.1.2=testRuntimeClasspath -org.apache.kafka:kafka-storage-api:3.1.2=testRuntimeClasspath -org.apache.kafka:kafka-storage:3.1.2=testRuntimeClasspath -org.apache.kafka:kafka-streams-test-utils:3.1.2=testCompileClasspath,testRuntimeClasspath -org.apache.kafka:kafka-streams:3.1.2=testCompileClasspath,testRuntimeClasspath -org.apache.kafka:kafka_2.13:3.1.2=testCompileClasspath,testRuntimeClasspath -org.apache.logging.log4j:log4j-api:2.17.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.logging.log4j:log4j-core:2.17.2=spotbugs -org.apache.logging.log4j:log4j-to-slf4j:2.17.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-core:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-el:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-websocket:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.apache.kafka:kafka-clients:3.0.2=testCompileClasspath,testRuntimeClasspath +org.apache.kafka:kafka-metadata:3.0.2=testCompileClasspath,testRuntimeClasspath +org.apache.kafka:kafka-raft:3.0.2=testRuntimeClasspath +org.apache.kafka:kafka-server-common:3.0.2=testRuntimeClasspath +org.apache.kafka:kafka-storage-api:3.0.2=testRuntimeClasspath +org.apache.kafka:kafka-storage:3.0.2=testRuntimeClasspath +org.apache.kafka:kafka-streams-test-utils:3.0.2=testCompileClasspath,testRuntimeClasspath +org.apache.kafka:kafka-streams:3.0.2=testCompileClasspath,testRuntimeClasspath +org.apache.kafka:kafka_2.13:3.0.2=testCompileClasspath,testRuntimeClasspath +org.apache.logging.log4j:log4j-api:2.25.2=spotbugs +org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apache.yetus:audience-annotations:0.5.0=testCompileClasspath,testRuntimeClasspath org.apache.zookeeper:zookeeper-jute:3.6.3=testCompileClasspath,testRuntimeClasspath org.apache.zookeeper:zookeeper:3.6.3=testCompileClasspath,testRuntimeClasspath org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath -org.bitbucket.b_c:jose4j:0.7.8=testRuntimeClasspath -org.codehaus.groovy:groovy-ant:3.0.19=codenarc -org.codehaus.groovy:groovy-docgenerator:3.0.19=codenarc -org.codehaus.groovy:groovy-groovydoc:3.0.19=codenarc -org.codehaus.groovy:groovy-json:3.0.19=codenarc +org.codehaus.groovy:groovy-ant:3.0.23=codenarc +org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc +org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.23=codenarc org.codehaus.groovy:groovy-json:3.0.25=testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-templates:3.0.19=codenarc -org.codehaus.groovy:groovy-xml:3.0.19=codenarc -org.codehaus.groovy:groovy:3.0.19=codenarc +org.codehaus.groovy:groovy-templates:3.0.23=codenarc +org.codehaus.groovy:groovy-xml:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc -org.hamcrest:hamcrest-core:2.2=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.hamcrest:hamcrest:2.2=productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.hdrhistogram:HdrHistogram:2.1.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.jctools:jctools-core-jdk11:4.0.6=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.jctools:jctools-core:4.0.6=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib:1.6.21=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.jetbrains:annotations:13.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath +org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath +org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath +org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter:5.8.2=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-commons:1.14.1=productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-engine:1.14.1=productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-launcher:1.14.1=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-runner:1.14.1=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-api:1.14.1=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-commons:1.14.1=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath +org.junit.platform:junit-platform-runner:1.14.1=testRuntimeClasspath +org.junit.platform:junit-platform-suite-api:1.14.1=testRuntimeClasspath +org.junit.platform:junit-platform-suite-commons:1.14.1=testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs -org.junit:junit-bom:5.14.1=productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.latencyutils:LatencyUtils:2.0.3=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.lz4:lz4-java:1.8.0=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath +org.lz4:lz4-java:1.7.1=testRuntimeClasspath org.mockito:mockito-core:4.4.0=testRuntimeClasspath -org.msgpack:msgpack-core:0.8.24=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.msgpack:msgpack-core:0.8.24=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath -org.opentest4j:opentest4j:1.3.0=productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-analysis:9.7.1=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.7.1=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-commons:9.7.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-tree:9.7.1=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-util:9.7.1=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.rocksdb:rocksdbjni:6.22.1.1=testCompileClasspath,testRuntimeClasspath +org.rocksdb:rocksdbjni:6.19.3=testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-collection-compat_2.13:2.4.4=testRuntimeClasspath org.scala-lang.modules:scala-java8-compat_2.13:1.0.0=testRuntimeClasspath -org.scala-lang:scala-library:2.13.10=testRuntimeClasspath -org.scala-lang:scala-library:2.13.6=testCompileClasspath +org.scala-lang:scala-library:2.13.6=testCompileClasspath,testRuntimeClasspath org.scala-lang:scala-reflect:2.13.6=testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:jcl-over-slf4j:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:jul-to-slf4j:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:log4j-over-slf4j:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath -org.slf4j:slf4j-api:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,spotbugs,spotbugsSlf4j,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-actuator-autoconfigure:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-actuator:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-autoconfigure:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-actuator:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-json:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-logging:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-tomcat:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-web:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.springframework.kafka:spring-kafka-test:2.8.11=testCompileClasspath,testRuntimeClasspath -org.springframework.kafka:spring-kafka:2.8.11=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.retry:spring-retry:1.3.4=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-aop:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-beans:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-context:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-core:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-expression:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-jcl:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-messaging:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-test:5.3.29=testCompileClasspath,testRuntimeClasspath -org.springframework:spring-tx:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-web:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-webmvc:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.springframework.retry:spring-retry:1.3.4=testCompileClasspath,testRuntimeClasspath +org.springframework:spring-aop:5.3.24=testCompileClasspath,testRuntimeClasspath +org.springframework:spring-beans:5.3.24=testCompileClasspath,testRuntimeClasspath +org.springframework:spring-context:5.3.24=testCompileClasspath,testRuntimeClasspath +org.springframework:spring-core:5.3.24=testCompileClasspath,testRuntimeClasspath +org.springframework:spring-expression:5.3.24=testCompileClasspath,testRuntimeClasspath +org.springframework:spring-jcl:5.3.24=testCompileClasspath,testRuntimeClasspath +org.springframework:spring-test:5.3.24=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath -org.xerial.snappy:snappy-java:1.1.8.4=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.xerial.snappy:snappy-java:1.1.8.1=testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -org.yaml:snakeyaml:1.30=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -empty=annotationProcessor,developmentOnly,spotbugsPlugins,testAnnotationProcessor,testFixturesAnnotationProcessor,testFixturesCompileClasspath +empty=annotationProcessor,runtimeClasspath,smokeTestAppExtraJarIastUtilJar,spotbugsPlugins,testAnnotationProcessor,testFixturesAnnotationProcessor,testFixturesCompileClasspath,testFixturesRuntimeClasspath diff --git a/dd-smoke-tests/kafka-3/application/build.gradle b/dd-smoke-tests/kafka-3/application/build.gradle index 2386eab0cf0..1d06a0a53af 100644 --- a/dd-smoke-tests/kafka-3/application/build.gradle +++ b/dd-smoke-tests/kafka-3/application/build.gradle @@ -4,10 +4,11 @@ plugins { id 'io.spring.dependency-management' version '1.1.4' } +// Pin bytecode target: the nested daemon runs on JDK 21, but the smoke test launches the +// produced jar on Java 17. Using sourceCompatibility (vs. toolchain.languageVersion) lets +// Gradle cross-compile via `--release 17` without pulling a separate JDK 17 toolchain. java { - toolchain { - languageVersion.set(JavaLanguageVersion.of(17)) - } + sourceCompatibility = JavaVersion.VERSION_17 } def sharedRootDir = "$rootDir/../../../" diff --git a/dd-smoke-tests/kafka-3/application/settings.gradle b/dd-smoke-tests/kafka-3/application/settings.gradle index d577c762a5c..e1725dbf1b1 100644 --- a/dd-smoke-tests/kafka-3/application/settings.gradle +++ b/dd-smoke-tests/kafka-3/application/settings.gradle @@ -1,34 +1 @@ -pluginManagement { - repositories { - mavenLocal() - if (settings.hasProperty("gradlePluginProxy")) { - maven { - url settings["gradlePluginProxy"] - allowInsecureProtocol = true - } - } - if (settings.hasProperty("mavenRepositoryProxy")) { - maven { - url settings["mavenRepositoryProxy"] - allowInsecureProtocol = true - } - } - gradlePluginPortal() - mavenCentral() - } -} - -def isCI = providers.environmentVariable("CI").isPresent() - -// Don't pollute the dependency cache with the build cache -if (isCI) { - def sharedRootDir = "$rootDir/../../../" - buildCache { - local { - // This needs to line up with the code in the outer project settings.gradle - directory = "$sharedRootDir/workspace/build-cache" - } - } -} - rootProject.name='kafka-3-smoketest' diff --git a/dd-smoke-tests/kafka-3/build.gradle b/dd-smoke-tests/kafka-3/build.gradle index 0c92600de50..b21a187b8f2 100644 --- a/dd-smoke-tests/kafka-3/build.gradle +++ b/dd-smoke-tests/kafka-3/build.gradle @@ -1,5 +1,9 @@ +plugins { + id 'dd-trace-java.smoke-test-app' + id 'java-test-fixtures' +} + apply from: "$rootDir/gradle/java.gradle" -apply plugin: 'java-test-fixtures' testJvmConstraints { minJavaVersion = JavaVersion.VERSION_17 @@ -7,6 +11,14 @@ testJvmConstraints { description = 'Kafka 3.x Smoke Tests.' +smokeTestApp { + gradleApp { + taskName = 'bootJar' + artifactPath = 'libs/kafka-3-smoketest.jar' + sysProperty = 'datadog.smoketest.springboot.shadowJar.path' + } +} + dependencies { testImplementation('org.springframework.kafka:spring-kafka-test:2.9.13') @@ -15,45 +27,13 @@ dependencies { testImplementation(testFixtures(project(":dd-smoke-tests:iast-util"))) } -final appDir = "$projectDir/application" -final appBuildDir = "$buildDir/application" -final isWindows = System.getProperty('os.name').toLowerCase().contains('win') -final gradlewCommand = isWindows ? 'gradlew.bat' : 'gradlew' - -tasks.register('bootJar', Exec) { - workingDir appDir - environment += [ - "GRADLE_OPTS": "-Dorg.gradle.jvmargs='-Xmx512M'", - "JAVA_HOME": getLazyJavaHomeFor(17) - ] - commandLine "$rootDir/${gradlewCommand}", "bootJar", "--no-daemon", "--max-workers=4", "-PappBuildDir=$appBuildDir" - - outputs.cacheIf { true } - - outputs.dir(appBuildDir) - .withPropertyName("applicationJar") - - inputs.files(fileTree(appDir) { - include '**/*' - exclude '.gradle/**' - }) - .withPropertyName("application") - .withPathSensitivity(PathSensitivity.RELATIVE) - - group('build') -} - tasks.named('compileTestGroovy') { dependsOn 'bootJar' outputs.upToDateWhen { - !bootJar.didWork + !tasks.named('bootJar').get().didWork } } -tasks.withType(Test).configureEach { - jvmArgs "-Ddatadog.smoketest.springboot.shadowJar.path=${appBuildDir}/libs/kafka-3-smoketest.jar" -} - spotless { java { target "**/*.java" diff --git a/dd-smoke-tests/kafka-3/gradle.lockfile b/dd-smoke-tests/kafka-3/gradle.lockfile index ee1964e0e1e..2c72654e05b 100644 --- a/dd-smoke-tests/kafka-3/gradle.lockfile +++ b/dd-smoke-tests/kafka-3/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:kafka-3:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=compileClasspath,runtimeClasspath,testCompile com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -20,23 +21,27 @@ com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.3=testRuntimeClasspath com.fasterxml.jackson.module:jackson-module-scala_2.13:2.13.3=testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.13.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.luben:zstd-jni:1.5.2-1=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -62,14 +67,14 @@ io.netty:netty-resolver:4.1.63.Final=testCompileClasspath,testRuntimeClasspath io.netty:netty-transport-native-epoll:4.1.63.Final=testCompileClasspath,testRuntimeClasspath io.netty:netty-transport-native-unix-common:4.1.63.Final=testCompileClasspath,testRuntimeClasspath io.netty:netty-transport:4.1.63.Final=testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:2.1.3=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jakarta.mail:jakarta.mail-api:2.0.1=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.sf.jopt-simple:jopt-simple:5.0.4=testRuntimeClasspath @@ -114,6 +119,7 @@ org.hamcrest:hamcrest-core:1.3=runtimeClasspath,testFixturesRuntimeClasspath,tes org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -139,8 +145,8 @@ org.ow2.asm:asm-tree:9.7.1=runtimeClasspath,testFixturesRuntimeClasspath,testRun org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.rocksdb:rocksdbjni:6.29.4.1=testCompileClasspath,testRuntimeClasspath org.scala-lang.modules:scala-collection-compat_2.13:2.6.0=testRuntimeClasspath org.scala-lang.modules:scala-java8-compat_2.13:1.0.2=testRuntimeClasspath diff --git a/dd-smoke-tests/lib-injection/gradle.lockfile b/dd-smoke-tests/lib-injection/gradle.lockfile index 1690027120c..9434ce4dda3 100644 --- a/dd-smoke-tests/lib-injection/gradle.lockfile +++ b/dd-smoke-tests/lib-injection/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:lib-injection:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -41,12 +46,12 @@ de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntime io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath io.opentelemetry:opentelemetry-api:1.4.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentelemetry:opentelemetry-context:1.4.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -74,6 +79,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -98,8 +104,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/log-injection/build.gradle b/dd-smoke-tests/log-injection/build.gradle index e4e86df74ed..9e01a511e8b 100644 --- a/dd-smoke-tests/log-injection/build.gradle +++ b/dd-smoke-tests/log-injection/build.gradle @@ -178,7 +178,9 @@ def generateTestingJar(String interfaceName, String backend, List= count) { - return - } - if (testedProcess != null && !testedProcess.isAlive()) { - def lastLines = tailProcessLog(20) - // RuntimeException (not AssertionError) so PollingConditions propagates - // immediately instead of retrying for the full timeout. - throw new RuntimeException( - "Process exited with code ${testedProcess.exitValue()} while waiting for ${count} traces " + - "(received ${traceCount.get()}, RC polls: ${rcClientMessages.size()}).\n" + - "Last process output:\n${lastLines}") - } - assert traceCount.get() >= count - } - } catch (AssertionError e) { - // The default error ("Condition not satisfied after 30s") is useless — enrich with diagnostic state - def alive = testedProcess?.isAlive() - def lastLines = tailProcessLog(30) - throw new AssertionError( - "Timed out waiting for ${count} traces after ${defaultPoll.timeout}s. " + - "traceCount=${traceCount.get()}, process.alive=${alive}, " + - "RC polls received: ${rcClientMessages.size()}.\n" + - "Last process output:\n${lastLines}", e) - } - traceCount.get() - } - - private String tailProcessLog(int lines) { - try { - def logFile = new File(logFilePath) - if (!logFile.exists()) { - return "(log file does not exist: ${logFilePath})" - } - def allLines = logFile.readLines() - def tail = allLines.size() > lines ? allLines[-lines..-1] : allLines - return tail.join("\n") - } catch (Exception e) { - return "(failed to read log: ${e.message})" - } - } - def parseTraceFromStdOut( String line ) { if (line == null) { throw new IllegalArgumentException("Line is null") @@ -416,10 +362,10 @@ abstract class LogInjectionSmokeTest extends AbstractSmokeTest { return unmangled.split(" ")[1..2] } - @Flaky(condition = () -> JavaVirtualMachine.isIbm8() || JavaVirtualMachine.isOracleJDK8()) + @Flaky(condition = () -> JavaVirtualMachine.isIbm8() || JavaVirtualMachine.isOracleJDK8() || JavaVirtualMachine.isZulu8()) def "check raw file injection"() { when: - def count = waitForTraceCountAlive(2) + def count = waitForTraceCount(2) def newConfig = """ {"lib_config": @@ -428,12 +374,12 @@ abstract class LogInjectionSmokeTest extends AbstractSmokeTest { """.toString() setRemoteConfig("datadog/2/APM_TRACING/config_overrides/config", newConfig) - count = waitForTraceCountAlive(3) + count = waitForTraceCount(3) setRemoteConfig("datadog/2/APM_TRACING/config_overrides/config", """{"lib_config":{}}""".toString()) // Wait for all 4 traces before waiting for process exit to ensure trace delivery is confirmed - count = waitForTraceCountAlive(4) + count = waitForTraceCount(4) assert testedProcess.waitFor(TIMEOUT_SECS, SECONDS) : "Process did not exit within ${TIMEOUT_SECS}s" def exitValue = testedProcess.exitValue() diff --git a/dd-smoke-tests/maven/gradle.lockfile b/dd-smoke-tests/maven/gradle.lockfile index 304372c7f91..240f0dff792 100644 --- a/dd-smoke-tests/maven/gradle.lockfile +++ b/dd-smoke-tests/maven/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:maven:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -17,22 +18,26 @@ com.fasterxml.jackson.core:jackson-core:2.20.0=testCompileClasspath,testRuntimeC com.fasterxml.jackson.core:jackson-databind:2.20.0=testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.20.0=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.jayway.jsonpath:json-path:2.8.0=testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -45,12 +50,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.minidev:accessors-smart:2.4.9=testRuntimeClasspath @@ -80,10 +85,11 @@ org.freemarker:freemarker:2.3.31=testCompileClasspath,testRuntimeClasspath org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.core:0.8.14=testRuntimeClasspath -org.jacoco:org.jacoco.report:0.8.14=testRuntimeClasspath +org.jacoco:org.jacoco.core:0.8.15=testRuntimeClasspath +org.jacoco:org.jacoco.report:0.8.15=testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -103,14 +109,14 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-commons:9.9.1=testRuntimeClasspath +org.ow2.asm:asm-tree:9.10.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-tree:9.9.1=testRuntimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.skyscreamer:jsonassert:1.5.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/maven/src/test/groovy/datadog/smoketest/MavenSmokeTest.groovy b/dd-smoke-tests/maven/src/test/groovy/datadog/smoketest/MavenSmokeTest.groovy deleted file mode 100644 index 4686c959cea..00000000000 --- a/dd-smoke-tests/maven/src/test/groovy/datadog/smoketest/MavenSmokeTest.groovy +++ /dev/null @@ -1,463 +0,0 @@ -package datadog.smoketest - -import datadog.environment.JavaVirtualMachine -import datadog.trace.api.civisibility.CIConstants -import datadog.trace.api.config.CiVisibilityConfig -import datadog.trace.api.config.GeneralConfig -import datadog.trace.civisibility.CiVisibilitySmokeTest -import org.apache.maven.wrapper.MavenWrapperMain -import org.slf4j.Logger -import org.slf4j.LoggerFactory -import spock.lang.AutoCleanup -import spock.lang.IgnoreIf -import spock.lang.Shared -import spock.lang.TempDir -import spock.util.environment.Jvm - -import java.nio.file.FileVisitResult -import java.nio.file.Files -import java.nio.file.Path -import java.nio.file.Paths -import java.nio.file.SimpleFileVisitor -import java.nio.file.attribute.BasicFileAttributes -import java.util.concurrent.TimeUnit -import java.util.concurrent.TimeoutException - -import static org.junit.jupiter.api.Assumptions.assumeTrue - -@IgnoreIf(reason = "IBM8 has flaky AES-GCM TLS failures when downloading Maven artifacts", value = { - JavaVirtualMachine.isIbm8() -}) -class MavenSmokeTest extends CiVisibilitySmokeTest { - - private static final Logger LOGGER = LoggerFactory.getLogger(MavenSmokeTest) - - private static final String LATEST_MAVEN_VERSION = getLatestMavenVersion() - - private static final String TEST_SERVICE_NAME = "test-maven-service" - - private static final int DEPENDENCIES_DOWNLOAD_TIMEOUT_SECS = 120 - private static final int PROCESS_TIMEOUT_SECS = 60 - private static final int DEPENDENCIES_DOWNLOAD_RETRIES = 5 - - @TempDir - Path projectHome - - @Shared - @AutoCleanup - MockBackend mockBackend = new MockBackend() - - def setup() { - mockBackend.reset() - } - - def "test #projectName, v#mavenVersion"() { - println "Starting: ${projectName} ${mavenVersion}" - assumeTrue(Jvm.current.isJavaVersionCompatible(minSupportedJavaVersion), - "Current JVM " + Jvm.current.javaVersion + " is not compatible with minimum required version " + minSupportedJavaVersion) - - givenWrapperPropertiesFile(mavenVersion) - givenMavenProjectFiles(projectName) - givenMavenDependenciesAreLoaded(projectName, mavenVersion) - - mockBackend.givenFlakyRetries(flakyRetries) - mockBackend.givenFlakyTest("Maven Smoke Tests Project maven-surefire-plugin default-test", "datadog.smoke.TestFailed", "test_failed") - - mockBackend.givenTestsSkipping(testsSkipping) - mockBackend.givenSkippableTest("Maven Smoke Tests Project maven-surefire-plugin default-test", "datadog.smoke.TestSucceed", "test_to_skip_with_itr", ["src/main/java/datadog/smoke/Calculator.java": bits(9)]) - - mockBackend.givenImpactedTestsDetection(true) - - def coverageReportExpected = jacocoCoverage && CiVisibilitySmokeTest.classLoader.getResource(projectName + "/coverage_report_event.ftl") != null - if (coverageReportExpected) { - mockBackend.givenCodeCoverageReportUpload(true) - } - - def agentArgs = jacocoCoverage ? [(CiVisibilityConfig.CIVISIBILITY_JACOCO_PLUGIN_VERSION): JACOCO_PLUGIN_VERSION] : [:] - def exitCode = whenRunningMavenBuild(agentArgs, commandLineParams, [:]) - - if (expectSuccess) { - assert exitCode == 0 - } else { - assert exitCode != 0 - } - - verifyEventsAndCoverages(projectName, "maven", mavenVersion, mockBackend.waitForEvents(expectedEvents), mockBackend.waitForCoverages(expectedCoverages)) - verifyTelemetryMetrics(mockBackend.getAllReceivedTelemetryMetrics(), mockBackend.getAllReceivedTelemetryDistributions(), expectedEvents) - - if (coverageReportExpected) { - def reports = mockBackend.waitForCoverageReports(1) - def realProjectHome = projectHome.toRealPath().toString() - verifyCoverageReports(projectName, reports, ["ci_workspace_path": realProjectHome]) - } - - where: - projectName | mavenVersion | expectedEvents | expectedCoverages | expectSuccess | testsSkipping | flakyRetries | jacocoCoverage | commandLineParams | minSupportedJavaVersion - "test_successful_maven_run" | "3.5.4" | 5 | 1 | true | true | false | true | [] | 8 - "test_successful_maven_run" | "3.6.3" | 5 | 1 | true | true | false | true | [] | 8 - "test_successful_maven_run" | "3.8.8" | 5 | 1 | true | true | false | true | [] | 8 - "test_successful_maven_run" | "3.9.9" | 5 | 1 | true | true | false | true | [] | 8 - "test_successful_maven_run_surefire_3_0_0" | "3.9.9" | 5 | 1 | true | true | false | true | [] | 8 - "test_successful_maven_run_surefire_3_0_0" | LATEST_MAVEN_VERSION | 5 | 1 | true | true | false | true | [] | 17 - "test_successful_maven_run_surefire_3_5_0" | "3.9.9" | 5 | 1 | true | true | false | true | [] | 8 - "test_successful_maven_run_surefire_3_5_0" | LATEST_MAVEN_VERSION | 5 | 1 | true | true | false | true | [] | 17 - "test_successful_maven_run_builtin_coverage" | "3.9.9" | 5 | 1 | true | true | false | false | [] | 8 - "test_successful_maven_run_with_jacoco_and_argline" | "3.9.9" | 5 | 1 | true | true | false | true | [] | 8 - // "expectedEvents" count for this test case does not include the spans that correspond to Cucumber steps - "test_successful_maven_run_with_cucumber" | "3.9.9" | 4 | 1 | true | false | false | true | [] | 8 - "test_failed_maven_run_flaky_retries" | "3.9.9" | 8 | 5 | false | false | true | true | [] | 8 - "test_successful_maven_run_junit_platform_runner" | "3.9.9" | 4 | 0 | true | false | false | false | [] | 8 - "test_successful_maven_run_with_arg_line_property" | "3.9.9" | 4 | 0 | true | false | false | false | ["-DargLine='-Dmy-custom-property=provided-via-command-line'"] | 8 - "test_successful_maven_run_multiple_forks" | "3.9.9" | 5 | 1 | true | true | false | true | [] | 8 - "test_successful_maven_run_multiple_forks" | LATEST_MAVEN_VERSION | 5 | 1 | true | true | false | true | [] | 17 - } - - def "test test management"() { - givenWrapperPropertiesFile(mavenVersion) - givenMavenProjectFiles(projectName) - givenMavenDependenciesAreLoaded(projectName, mavenVersion) - - mockBackend.givenTestManagement(true) - mockBackend.givenAttemptToFixRetries(5) - - mockBackend.givenQuarantinedTests("Maven Smoke Tests Project maven-surefire-plugin default-test", "datadog.smoke.TestFailed", "test_failed") - - mockBackend.givenDisabledTests("Maven Smoke Tests Project maven-surefire-plugin default-test", "datadog.smoke.TestSucceeded", "test_succeeded") - - mockBackend.givenAttemptToFixTests("Maven Smoke Tests Project maven-surefire-plugin default-test", "datadog.smoke.TestSucceeded", "test_another_succeeded") - - def exitCode = whenRunningMavenBuild([:], [], [:]) - assert exitCode == 0 - - verifyEventsAndCoverages(projectName, "maven", mavenVersion, mockBackend.waitForEvents(11), mockBackend.waitForCoverages(3)) - - where: - projectName | mavenVersion - "test_successful_maven_run_test_management" | "3.9.9" - } - - def "test junit4 class ordering #testcaseName"() { - def additionalEnvVars = ["SMOKE_TEST_SUREFIRE_VERSION": surefireVersion] - - givenWrapperPropertiesFile(mavenVersion) - givenMavenProjectFiles(projectName) - givenMavenDependenciesAreLoaded(projectName, mavenVersion, additionalEnvVars) - - for (flakyTest in flakyTests) { - mockBackend.givenFlakyTest("Maven Smoke Tests Project maven-surefire-plugin default-test", flakyTest.getSuite(), flakyTest.getName()) - } - - mockBackend.givenKnownTests(true) - for (knownTest in knownTests) { - mockBackend.givenKnownTest("Maven Smoke Tests Project maven-surefire-plugin default-test", knownTest.getSuite(), knownTest.getName()) - } - - def exitCode = whenRunningMavenBuild([(CiVisibilityConfig.CIVISIBILITY_TEST_ORDER): CIConstants.FAIL_FAST_TEST_ORDER], [], additionalEnvVars) - assert exitCode == 0 - - verifyTestOrder(mockBackend.waitForEvents(eventsNumber), expectedOrder) - - where: - testcaseName | projectName | mavenVersion | surefireVersion | flakyTests | knownTests | expectedOrder | eventsNumber - "junit4-provider" | "test_successful_maven_run_junit4_class_ordering" | "3.9.9" | "3.0.0" | [ - test("datadog.smoke.TestSucceedB", "test_succeed"), - test("datadog.smoke.TestSucceedB", "test_succeed_another"), - test("datadog.smoke.TestSucceedA", "test_succeed") - ] | [ - test("datadog.smoke.TestSucceedB", "test_succeed"), - test("datadog.smoke.TestSucceedB", "test_succeed_another"), - test("datadog.smoke.TestSucceedA", "test_succeed") - ] | [ - test("datadog.smoke.TestSucceedC", "test_succeed"), - test("datadog.smoke.TestSucceedC", "test_succeed_another"), - test("datadog.smoke.TestSucceedA", "test_succeed_another"), - test("datadog.smoke.TestSucceedA", "test_succeed"), - test("datadog.smoke.TestSucceedB", "test_succeed"), - test("datadog.smoke.TestSucceedB", "test_succeed_another") - ] | 15 - "junit47-provider" | "test_successful_maven_run_junit4_class_ordering_parallel" | "3.9.9" | "3.0.0" | [test("datadog.smoke.TestSucceedC", "test_succeed")] | [ - test("datadog.smoke.TestSucceedC", "test_succeed"), - test("datadog.smoke.TestSucceedA", "test_succeed") - ] | [ - test("datadog.smoke.TestSucceedB", "test_succeed"), - test("datadog.smoke.TestSucceedC", "test_succeed"), - test("datadog.smoke.TestSucceedA", "test_succeed") - ] | 12 - "junit4-provider-latest-surefire" | "test_successful_maven_run_junit4_class_ordering" | "3.9.9" | getLatestMavenSurefireVersion() | [ - test("datadog.smoke.TestSucceedB", "test_succeed"), - test("datadog.smoke.TestSucceedB", "test_succeed_another"), - test("datadog.smoke.TestSucceedA", "test_succeed") - ] | [ - test("datadog.smoke.TestSucceedB", "test_succeed"), - test("datadog.smoke.TestSucceedB", "test_succeed_another"), - test("datadog.smoke.TestSucceedA", "test_succeed") - ] | [ - test("datadog.smoke.TestSucceedC", "test_succeed"), - test("datadog.smoke.TestSucceedC", "test_succeed_another"), - test("datadog.smoke.TestSucceedA", "test_succeed_another"), - test("datadog.smoke.TestSucceedA", "test_succeed"), - test("datadog.smoke.TestSucceedB", "test_succeed"), - test("datadog.smoke.TestSucceedB", "test_succeed_another") - ] | 15 - "junit47-provider-latest-surefire" | "test_successful_maven_run_junit4_class_ordering_parallel" | "3.9.9" | getLatestMavenSurefireVersion() | [test("datadog.smoke.TestSucceedC", "test_succeed")] | [ - test("datadog.smoke.TestSucceedC", "test_succeed"), - test("datadog.smoke.TestSucceedA", "test_succeed") - ] | [ - test("datadog.smoke.TestSucceedB", "test_succeed"), - test("datadog.smoke.TestSucceedC", "test_succeed"), - test("datadog.smoke.TestSucceedA", "test_succeed") - ] | 12 - } - - def "test service name is propagated to child processes"() { - givenWrapperPropertiesFile(mavenVersion) - givenMavenProjectFiles(projectName) - givenMavenDependenciesAreLoaded(projectName, mavenVersion) - - def exitCode = whenRunningMavenBuild([:], [], [:], false) - assert exitCode == 0 - - def additionalDynamicPaths = ["content.service"] - verifyEventsAndCoverages(projectName, "maven", mavenVersion, mockBackend.waitForEvents(5), mockBackend.waitForCoverages(1), additionalDynamicPaths) - - where: - projectName | mavenVersion - "test_successful_maven_run_child_service_propagation" | "3.9.9" - } - - def "test failed test replay"() { - givenWrapperPropertiesFile(mavenVersion) - givenMavenProjectFiles(projectName) - givenMavenDependenciesAreLoaded(projectName, mavenVersion) - - mockBackend.givenFlakyRetries(true) - mockBackend.givenFlakyTest("Maven Smoke Tests Project maven-surefire-plugin default-test", "com.example.TestFailed", "test_failed") - mockBackend.givenFailedTestReplay(true) - - def exitCode = whenRunningMavenBuild([ - (CiVisibilityConfig.CIVISIBILITY_FLAKY_RETRY_COUNT): "3", - (GeneralConfig.AGENTLESS_LOG_SUBMISSION_URL): mockBackend.intakeUrl - ], - [], - [:]) - assert exitCode == 1 - - def additionalDynamicTags = ["content.meta.['_dd.debug.error.3.snapshot_id']", "content.meta.['_dd.debug.error.exception_id']"] - verifyEventsAndCoverages(projectName, "maven", mavenVersion, mockBackend.waitForEvents(7), mockBackend.waitForCoverages(0), additionalDynamicTags) - verifySnapshots(mockBackend.waitForLogs(2), 2) - - where: - projectName | mavenVersion - "test_failed_maven_failed_test_replay" | "3.9.9" - } - - private void givenWrapperPropertiesFile(String mavenVersion) { - def distributionUrl = "https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/${mavenVersion}/apache-maven-${mavenVersion}-bin.zip" - - def properties = new Properties() - properties.setProperty("distributionUrl", distributionUrl) - - def propertiesFile = projectHome.resolve("maven/wrapper/maven-wrapper.properties") - Files.createDirectories(propertiesFile.getParent()) - new FileOutputStream(propertiesFile.toFile()).withCloseable { - properties.store(it, "") - } - } - - private void givenMavenProjectFiles(String projectFilesSources) { - def projectResourcesUri = this.getClass().getClassLoader().getResource(projectFilesSources).toURI() - def projectResourcesPath = Paths.get(projectResourcesUri) - copyFolder(projectResourcesPath, projectHome) - - def sharedSettingsPath = Paths.get(this.getClass().getClassLoader().getResource("settings.mirror.xml").toURI()) - Files.copy(sharedSettingsPath, projectHome.resolve("settings.mirror.xml")) - } - - private void copyFolder(Path src, Path dest) throws IOException { - Files.walkFileTree(src, new SimpleFileVisitor() { - @Override - FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) - throws IOException { - Files.createDirectories(dest.resolve(src.relativize(dir))) - return FileVisitResult.CONTINUE - } - - @Override - FileVisitResult visitFile(Path file, BasicFileAttributes attrs) - throws IOException { - Files.copy(file, dest.resolve(src.relativize(file))) - return FileVisitResult.CONTINUE - } - }) - - // creating empty .git directory so that the tracer could detect projectFolder as repo root - Files.createDirectory(projectHome.resolve(".git")) - } - - /** - * Sometimes Maven has problems downloading project dependencies because of intermittent network issues. - * Here, in order to reduce flakiness, we ensure that all of the dependencies are loaded (retrying if necessary), - * before proceeding with running the build - */ - private void givenMavenDependenciesAreLoaded(String projectName, String mavenVersion, Map additionalEnvVars = [:]) { - if (LOADED_DEPENDENCIES.add("$projectName:$mavenVersion")) { - retryUntilSuccessfulOrNoAttemptsLeft(["org.apache.maven.plugins:maven-dependency-plugin:3.6.1:go-offline"], additionalEnvVars) - } - // dependencies below are download separately - // because they are not declared in the project, - // but are added at runtime by the tracer - if (LOADED_DEPENDENCIES.add("com.datadoghq:dd-javac-plugin:$JAVAC_PLUGIN_VERSION")) { - retryUntilSuccessfulOrNoAttemptsLeft([ - "org.apache.maven.plugins:maven-dependency-plugin:3.6.1:get", - "-Dartifact=com.datadoghq:dd-javac-plugin:$JAVAC_PLUGIN_VERSION".toString() - ], additionalEnvVars) - } - if (LOADED_DEPENDENCIES.add("org.jacoco:jacoco-maven-plugin:$JACOCO_PLUGIN_VERSION")) { - retryUntilSuccessfulOrNoAttemptsLeft([ - "org.apache.maven.plugins:maven-dependency-plugin:3.6.1:get", - "-Dartifact=org.jacoco:jacoco-maven-plugin:$JACOCO_PLUGIN_VERSION".toString() - ], additionalEnvVars) - } - } - - private static final Collection LOADED_DEPENDENCIES = new HashSet<>() - - private void retryUntilSuccessfulOrNoAttemptsLeft(List mvnCommand, Map additionalEnvVars = [:]) { - def processBuilder = createProcessBuilder(mvnCommand, false, false, [:], additionalEnvVars) - for (int attempt = 0; attempt < DEPENDENCIES_DOWNLOAD_RETRIES; attempt++) { - try { - def exitCode = runProcess(processBuilder.start(), DEPENDENCIES_DOWNLOAD_TIMEOUT_SECS) - if (exitCode == 0) { - return - } - } catch (TimeoutException e) { - LOGGER.warn("Failed dependency resolution with exception: ", e) - } - } - throw new AssertionError((Object) "Tried $DEPENDENCIES_DOWNLOAD_RETRIES times to execute $mvnCommand and failed") - } - - private int whenRunningMavenBuild(Map additionalAgentArgs, List additionalCommandLineParams, Map additionalEnvVars, boolean setServiceName = true) { - def processBuilder = createProcessBuilder(["-B", "test"] + additionalCommandLineParams, true, setServiceName, additionalAgentArgs, additionalEnvVars) - - processBuilder.environment().put("DD_API_KEY", "01234567890abcdef123456789ABCDEF") - - return runProcess(processBuilder.start()) - } - - private static runProcess(Process p, int timeoutSecs = PROCESS_TIMEOUT_SECS) { - StreamConsumer errorGobbler = new StreamConsumer(p.getErrorStream(), "ERROR") - StreamConsumer outputGobbler = new StreamConsumer(p.getInputStream(), "OUTPUT") - outputGobbler.start() - errorGobbler.start() - - if (!p.waitFor(timeoutSecs, TimeUnit.SECONDS)) { - p.destroyForcibly() - throw new TimeoutException("Instrumented process failed to exit within $timeoutSecs seconds") - } - - return p.exitValue() - } - - ProcessBuilder createProcessBuilder(List mvnCommand, boolean runWithAgent, boolean setServiceName, Map additionalAgentArgs, Map additionalEnvVars) { - String mavenRunnerShadowJar = System.getProperty("datadog.smoketest.maven.jar.path") - assert new File(mavenRunnerShadowJar).isFile() - - List command = new ArrayList<>() - command.add(javaPath()) - command.addAll(jvmArguments(runWithAgent, setServiceName, additionalAgentArgs)) - command.addAll((String[]) ["-jar", mavenRunnerShadowJar]) - command.addAll(programArguments()) - - if (System.getenv().get("MAVEN_REPOSITORY_PROXY") != null) { - command.addAll(["-s", "${projectHome.toAbsolutePath()}/settings.mirror.xml".toString()]) - } - command.addAll(mvnCommand) - - ProcessBuilder processBuilder = new ProcessBuilder(command) - processBuilder.directory(projectHome.toFile()) - - processBuilder.environment().put("JAVA_HOME", System.getProperty("java.home")) - for (envVar in additionalEnvVars) { - processBuilder.environment().put(envVar.key, envVar.value) - } - - def mavenRepositoryProxy = System.getenv("MAVEN_REPOSITORY_PROXY") - if (mavenRepositoryProxy != null) { - processBuilder.environment().put("MAVEN_REPOSITORY_PROXY", mavenRepositoryProxy) - } - - return processBuilder - } - - List jvmArguments(boolean runWithAgent, boolean setServiceName, Map additionalAgentArgs) { - def arguments = [ - "-D${MavenWrapperMain.MVNW_VERBOSE}=true".toString(), - "-Duser.dir=${projectHome.toAbsolutePath()}".toString(), - "-Dmaven.mainClass=org.apache.maven.cli.MavenCli".toString(), - "-Dmaven.multiModuleProjectDirectory=${projectHome.toAbsolutePath()}".toString(), - "-Dmaven.artifact.threads=10", - ] - if (runWithAgent) { - arguments += buildJvmArguments(mockBackend.intakeUrl, setServiceName ? TEST_SERVICE_NAME : null, additionalAgentArgs) - } - return arguments - } - - List programArguments() { - return [projectHome.toAbsolutePath().toString()] - } - - private static class StreamConsumer extends Thread { - final InputStream is - final String messagePrefix - - StreamConsumer(InputStream is, String messagePrefix) { - this.is = is - this.messagePrefix = messagePrefix - } - - @Override - void run() { - try { - BufferedReader br = new BufferedReader(new InputStreamReader(is)) - String line - while ((line = br.readLine()) != null) { - System.out.println(messagePrefix + ": " + line) - } - } catch (IOException e) { - e.printStackTrace() - } - } - } - - private static Properties loadLatestToolVersions() { - def properties = new Properties() - def stream = MavenSmokeTest.classLoader.getResourceAsStream("latest-tool-versions.properties") - if (stream == null) { - throw new IllegalStateException("Could not find latest-tool-versions.properties on classpath") - } - stream.withCloseable { properties.load(it) } - return properties - } - - private static String getLatestMavenVersion() { - def version = loadLatestToolVersions().getProperty("maven.version") - LOGGER.info("Will run the 'latest' tests with Maven version ${version}") - return version - } - - private static String getLatestMavenSurefireVersion() { - def version = loadLatestToolVersions().getProperty("maven-surefire.version") - LOGGER.info("Will run the 'latest' tests with Maven Surefire version ${version}") - return version - } - - private static BitSet bits(int ... indices) { - BitSet bitSet = new BitSet() - for (int i : indices) { - bitSet.set(i) - } - return bitSet - } -} diff --git a/dd-smoke-tests/maven/src/test/java/datadog/smoketest/MavenSmokeTest.java b/dd-smoke-tests/maven/src/test/java/datadog/smoketest/MavenSmokeTest.java new file mode 100644 index 00000000000..011bdd68977 --- /dev/null +++ b/dd-smoke-tests/maven/src/test/java/datadog/smoketest/MavenSmokeTest.java @@ -0,0 +1,619 @@ +package datadog.smoketest; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assumptions.assumeFalse; +import static org.junit.jupiter.api.Assumptions.assumeTrue; + +import datadog.environment.JavaVirtualMachine; +import datadog.trace.api.civisibility.CIConstants; +import datadog.trace.api.civisibility.config.TestFQN; +import datadog.trace.api.config.CiVisibilityConfig; +import datadog.trace.api.config.GeneralConfig; +import datadog.trace.civisibility.CiVisibilitySmokeTest; +import datadog.trace.civisibility.CiVisibilityTableTestConverters; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.BitSet; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import org.apache.maven.wrapper.MavenWrapperMain; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.condition.DisabledIf; +import org.junit.jupiter.api.io.TempDir; +import org.junit.jupiter.params.ParameterizedTest; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.tabletest.junit.TableTest; +import org.tabletest.junit.TypeConverterSources; + +@DisabledIf( + value = "disabledOnIbm8", + disabledReason = "IBM8 has flaky AES-GCM TLS failures when downloading Maven artifacts") +@TypeConverterSources(CiVisibilityTableTestConverters.class) +class MavenSmokeTest extends CiVisibilitySmokeTest { + + private static final Logger LOGGER = LoggerFactory.getLogger(MavenSmokeTest.class); + + private static final String LATEST_MAVEN_VERSION = getLatestMavenVersion(); + + private static final String TEST_SERVICE_NAME = "test-maven-service"; + + private static final int DEPENDENCIES_DOWNLOAD_TIMEOUT_SECS = 120; + private static final int PROCESS_TIMEOUT_SECS = 60; + private static final int DEPENDENCIES_DOWNLOAD_RETRIES = 5; + + public static boolean disabledOnIbm8() { + return JavaVirtualMachine.isIbm8(); + } + + @TempDir Path projectHome; + + static final MockBackend mockBackend = new MockBackend(); + + @BeforeEach + void resetMockBackend() { + assumeFalse(JavaVirtualMachine.isJavaVersion(27), "JDK 27 TODO: address failing test"); + mockBackend.reset(); + } + + @AfterAll + static void closeMockBackend() throws Exception { + mockBackend.close(); + } + + @TableTest({ + "scenario | projectName | mavenVersion | expectedEvents | expectedCoverages | expectSuccess | testsSkipping | flakyRetries | jacocoCoverage | commandLineParams | minSupportedJavaVersion", + "succeed-base | test_successful_maven_run | {3.5.4, 3.6.3, 3.8.8, 3.9.9} | 5 | 1 | true | true | false | true | [] | 8 ", + "succeed-surefire-3.0.0-j8 | test_successful_maven_run_surefire_3_0_0 | 3.9.9 | 5 | 1 | true | true | false | true | [] | 8 ", + "succeed-surefire-3.0.0-j17 | test_successful_maven_run_surefire_3_0_0 | latest | 5 | 1 | true | true | false | true | [] | 17 ", + "succeed-surefire-3.5.0-j8 | test_successful_maven_run_surefire_3_5_0 | 3.9.9 | 5 | 1 | true | true | false | true | [] | 8 ", + "succeed-surefire-3.5.0-j17 | test_successful_maven_run_surefire_3_5_0 | latest | 5 | 1 | true | true | false | true | [] | 17 ", + "succeed-builtin-coverage | test_successful_maven_run_builtin_coverage | 3.9.9 | 5 | 1 | true | true | false | false | [] | 8 ", + "succeed-jacoco-argline | test_successful_maven_run_with_jacoco_and_argline | 3.9.9 | 5 | 1 | true | true | false | true | [] | 8 ", + "succeed-cucumber | test_successful_maven_run_with_cucumber | 3.9.9 | 4 | 1 | true | false | false | true | [] | 8 ", + "failed-flaky-retries | test_failed_maven_run_flaky_retries | 3.9.9 | 8 | 5 | false | false | true | true | [] | 8 ", + "cucumber-suite-flaky | test_maven_run_cucumber_suite_flaky_retries | 3.9.9 | 8 | 5 | false | false | true | false | [] | 17 ", + "succeed-junit-platform | test_successful_maven_run_junit_platform_runner | 3.9.9 | 4 | 0 | true | false | false | false | [] | 8 ", + "succeed-arg-line-property | test_successful_maven_run_with_arg_line_property | 3.9.9 | 4 | 0 | true | false | false | false | [\"-DargLine='-Dmy-custom-property=provided-via-command-line'\"] | 8 ", + "succeed-multi-forks-j8 | test_successful_maven_run_multiple_forks | 3.9.9 | 5 | 1 | true | true | false | true | [] | 8 ", + "succeed-multi-forks-j17 | test_successful_maven_run_multiple_forks | latest | 5 | 1 | true | true | false | true | [] | 17 " + }) + @ParameterizedTest + void testMavenRun( + String projectName, + String mavenVersion, + int expectedEvents, + int expectedCoverages, + boolean expectSuccess, + boolean testsSkipping, + boolean flakyRetries, + boolean jacocoCoverage, + List commandLineParams, + int minSupportedJavaVersion) + throws Exception { + mavenVersion = resolveLatestMaven(mavenVersion); + System.out.println("Starting: " + projectName + " " + mavenVersion); + assumeTrue( + JavaVirtualMachine.isJavaVersionAtLeast(minSupportedJavaVersion), + "Current JVM is not compatible with minimum required version " + minSupportedJavaVersion); + + givenWrapperPropertiesFile(mavenVersion); + givenMavenProjectFiles(projectName); + givenMavenDependenciesAreLoaded(projectName, mavenVersion); + + mockBackend.givenFlakyRetries(flakyRetries); + mockBackend.givenFlakyTest( + "Maven Smoke Tests Project maven-surefire-plugin default-test", + "datadog.smoke.TestFailed", + "test_failed"); + mockBackend.givenFlakyTest( + "Maven Smoke Tests Project maven-surefire-plugin default-test", + "classpath:datadog/smoke/basic_arithmetic.feature:Basic Arithmetic", + "Basic Arithmetic - Addition"); // cucumber.junit-platform.naming-strategy=long + + mockBackend.givenTestsSkipping(testsSkipping); + mockBackend.givenSkippableTest( + "Maven Smoke Tests Project maven-surefire-plugin default-test", + "datadog.smoke.TestSucceed", + "test_to_skip_with_itr", + Collections.singletonMap("src/main/java/datadog/smoke/Calculator.java", bits(9))); + + mockBackend.givenImpactedTestsDetection(true); + + boolean coverageReportExpected = + jacocoCoverage + && CiVisibilitySmokeTest.class + .getClassLoader() + .getResource(projectName + "/coverage_report_event.ftl") + != null; + if (coverageReportExpected) { + mockBackend.givenCodeCoverageReportUpload(true); + } + + Map agentArgs = + jacocoCoverage + ? Collections.singletonMap( + CiVisibilityConfig.CIVISIBILITY_JACOCO_PLUGIN_VERSION, JACOCO_PLUGIN_VERSION) + : Collections.emptyMap(); + int exitCode = + whenRunningMavenBuild(agentArgs, commandLineParams, Collections.emptyMap(), true); + + if (expectSuccess) { + assertEquals(0, exitCode); + } else { + assertNotEquals(0, exitCode); + } + + verifyEventsAndCoverages( + projectName, + "maven", + mavenVersion, + mockBackend.waitForEvents(expectedEvents), + mockBackend.waitForCoverages(expectedCoverages)); + verifyTelemetryMetrics( + mockBackend.getAllReceivedTelemetryMetrics(), + mockBackend.getAllReceivedTelemetryDistributions(), + expectedEvents); + + if (coverageReportExpected) { + List reports = + mockBackend.waitForCoverageReports(1); + String realProjectHome = projectHome.toRealPath().toString(); + verifyCoverageReports( + projectName, reports, Collections.singletonMap("ci_workspace_path", realProjectHome)); + } + } + + @TableTest({ + "scenario | projectName | mavenVersion", + "test-management | test_successful_maven_run_test_management | 3.9.9 " + }) + @ParameterizedTest + void testTestManagement(String projectName, String mavenVersion) throws Exception { + givenWrapperPropertiesFile(mavenVersion); + givenMavenProjectFiles(projectName); + givenMavenDependenciesAreLoaded(projectName, mavenVersion); + + mockBackend.givenTestManagement(true); + mockBackend.givenAttemptToFixRetries(5); + + mockBackend.givenQuarantinedTests( + "Maven Smoke Tests Project maven-surefire-plugin default-test", + "datadog.smoke.TestFailed", + "test_failed"); + + mockBackend.givenDisabledTests( + "Maven Smoke Tests Project maven-surefire-plugin default-test", + "datadog.smoke.TestSucceeded", + "test_succeeded"); + + mockBackend.givenAttemptToFixTests( + "Maven Smoke Tests Project maven-surefire-plugin default-test", + "datadog.smoke.TestSucceeded", + "test_another_succeeded"); + + int exitCode = + whenRunningMavenBuild( + Collections.emptyMap(), Collections.emptyList(), Collections.emptyMap(), true); + assertEquals(0, exitCode); + + verifyEventsAndCoverages( + projectName, + "maven", + mavenVersion, + mockBackend.waitForEvents(11), + mockBackend.waitForCoverages(3)); + } + + @TableTest({ + "scenario | projectName | mavenVersion | surefireVersion | flakyTests | knownTests | expectedOrder | eventsNumber", + "junit4-provider | test_successful_maven_run_junit4_class_ordering | 3.9.9 | 3.0.0 | ['datadog.smoke.TestSucceedB:test_succeed', 'datadog.smoke.TestSucceedB:test_succeed_another', 'datadog.smoke.TestSucceedA:test_succeed'] | ['datadog.smoke.TestSucceedB:test_succeed', 'datadog.smoke.TestSucceedB:test_succeed_another', 'datadog.smoke.TestSucceedA:test_succeed'] | ['datadog.smoke.TestSucceedC:test_succeed', 'datadog.smoke.TestSucceedC:test_succeed_another', 'datadog.smoke.TestSucceedA:test_succeed_another', 'datadog.smoke.TestSucceedA:test_succeed', 'datadog.smoke.TestSucceedB:test_succeed', 'datadog.smoke.TestSucceedB:test_succeed_another'] | 15 ", + "junit47-provider | test_successful_maven_run_junit4_class_ordering_parallel | 3.9.9 | 3.0.0 | ['datadog.smoke.TestSucceedC:test_succeed'] | ['datadog.smoke.TestSucceedC:test_succeed', 'datadog.smoke.TestSucceedA:test_succeed'] | ['datadog.smoke.TestSucceedB:test_succeed', 'datadog.smoke.TestSucceedC:test_succeed', 'datadog.smoke.TestSucceedA:test_succeed'] | 12 ", + "junit4-provider-latest-surefire | test_successful_maven_run_junit4_class_ordering | 3.9.9 | latest-maven-surefire | ['datadog.smoke.TestSucceedB:test_succeed', 'datadog.smoke.TestSucceedB:test_succeed_another', 'datadog.smoke.TestSucceedA:test_succeed'] | ['datadog.smoke.TestSucceedB:test_succeed', 'datadog.smoke.TestSucceedB:test_succeed_another', 'datadog.smoke.TestSucceedA:test_succeed'] | ['datadog.smoke.TestSucceedC:test_succeed', 'datadog.smoke.TestSucceedC:test_succeed_another', 'datadog.smoke.TestSucceedA:test_succeed_another', 'datadog.smoke.TestSucceedA:test_succeed', 'datadog.smoke.TestSucceedB:test_succeed', 'datadog.smoke.TestSucceedB:test_succeed_another'] | 15 ", + "junit47-provider-latest-surefire | test_successful_maven_run_junit4_class_ordering_parallel | 3.9.9 | latest-maven-surefire | ['datadog.smoke.TestSucceedC:test_succeed'] | ['datadog.smoke.TestSucceedC:test_succeed', 'datadog.smoke.TestSucceedA:test_succeed'] | ['datadog.smoke.TestSucceedB:test_succeed', 'datadog.smoke.TestSucceedC:test_succeed', 'datadog.smoke.TestSucceedA:test_succeed'] | 12 " + }) + @ParameterizedTest + void testJunit4ClassOrdering( + String projectName, + String mavenVersion, + String surefireVersion, + List flakyTests, + List knownTests, + List expectedOrder, + int eventsNumber) + throws Exception { + surefireVersion = + "latest-maven-surefire".equals(surefireVersion) + ? getLatestMavenSurefireVersion() + : surefireVersion; + Map additionalEnvVars = new HashMap<>(); + additionalEnvVars.put("SMOKE_TEST_SUREFIRE_VERSION", surefireVersion); + + givenWrapperPropertiesFile(mavenVersion); + givenMavenProjectFiles(projectName); + givenMavenDependenciesAreLoaded(projectName, mavenVersion, additionalEnvVars); + + for (TestFQN flakyTest : flakyTests) { + mockBackend.givenFlakyTest( + "Maven Smoke Tests Project maven-surefire-plugin default-test", + flakyTest.getSuite(), + flakyTest.getName()); + } + + mockBackend.givenKnownTests(true); + for (TestFQN knownTest : knownTests) { + mockBackend.givenKnownTest( + "Maven Smoke Tests Project maven-surefire-plugin default-test", + knownTest.getSuite(), + knownTest.getName()); + } + + int exitCode = + whenRunningMavenBuild( + Collections.singletonMap( + CiVisibilityConfig.CIVISIBILITY_TEST_ORDER, CIConstants.FAIL_FAST_TEST_ORDER), + Collections.emptyList(), + additionalEnvVars, + true); + assertEquals(0, exitCode); + + verifyTestOrder(mockBackend.waitForEvents(eventsNumber), expectedOrder); + } + + @TableTest({ + "scenario | projectName | mavenVersion", + "child-service-propagation | test_successful_maven_run_child_service_propagation | 3.9.9 " + }) + @ParameterizedTest + void testServiceNamePropagation(String projectName, String mavenVersion) throws Exception { + givenWrapperPropertiesFile(mavenVersion); + givenMavenProjectFiles(projectName); + givenMavenDependenciesAreLoaded(projectName, mavenVersion); + + int exitCode = + whenRunningMavenBuild( + Collections.emptyMap(), Collections.emptyList(), Collections.emptyMap(), false); + assertEquals(0, exitCode); + + List additionalDynamicPaths = Collections.singletonList("content.service"); + verifyEventsAndCoverages( + projectName, + "maven", + mavenVersion, + mockBackend.waitForEvents(5), + mockBackend.waitForCoverages(1), + additionalDynamicPaths); + } + + @TableTest({ + "scenario | projectName | mavenVersion", + "failed-test-replay | test_failed_maven_failed_test_replay | 3.9.9 " + }) + @ParameterizedTest + void testFailedTestReplay(String projectName, String mavenVersion) throws Exception { + givenWrapperPropertiesFile(mavenVersion); + givenMavenProjectFiles(projectName); + givenMavenDependenciesAreLoaded(projectName, mavenVersion); + + mockBackend.givenFlakyRetries(true); + mockBackend.givenFlakyTest( + "Maven Smoke Tests Project maven-surefire-plugin default-test", + "com.example.TestFailed", + "test_failed"); + mockBackend.givenFailedTestReplay(true); + + Map agentArgs = new HashMap<>(); + agentArgs.put(CiVisibilityConfig.CIVISIBILITY_FLAKY_RETRY_COUNT, "3"); + agentArgs.put(GeneralConfig.AGENTLESS_LOG_SUBMISSION_URL, mockBackend.getIntakeUrl()); + + int exitCode = + whenRunningMavenBuild(agentArgs, Collections.emptyList(), Collections.emptyMap(), true); + assertEquals(1, exitCode); + + List additionalDynamicTags = + Arrays.asList( + "content.meta.['_dd.debug.error.3.snapshot_id']", + "content.meta.['_dd.debug.error.exception_id']"); + verifyEventsAndCoverages( + projectName, + "maven", + mavenVersion, + mockBackend.waitForEvents(7), + mockBackend.waitForCoverages(0), + additionalDynamicTags); + verifySnapshots(mockBackend.waitForLogs(2), 2); + } + + private void givenWrapperPropertiesFile(String mavenVersion) throws IOException { + String distributionUrl = + "https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/" + + mavenVersion + + "/apache-maven-" + + mavenVersion + + "-bin.zip"; + + Properties properties = new Properties(); + properties.setProperty("distributionUrl", distributionUrl); + + Path propertiesFile = projectHome.resolve("maven/wrapper/maven-wrapper.properties"); + Files.createDirectories(propertiesFile.getParent()); + try (FileOutputStream fos = new FileOutputStream(propertiesFile.toFile())) { + properties.store(fos, ""); + } + } + + private void givenMavenProjectFiles(String projectFilesSources) throws Exception { + Path projectResourcesPath = + Paths.get(this.getClass().getClassLoader().getResource(projectFilesSources).toURI()); + copyFolder(projectResourcesPath, projectHome); + + Path sharedSettingsPath = + Paths.get(this.getClass().getClassLoader().getResource("settings.mirror.xml").toURI()); + Files.copy(sharedSettingsPath, projectHome.resolve("settings.mirror.xml")); + } + + private void copyFolder(Path src, Path dest) throws IOException { + Files.walkFileTree( + src, + new SimpleFileVisitor() { + @Override + public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) + throws IOException { + Files.createDirectories(dest.resolve(src.relativize(dir))); + return FileVisitResult.CONTINUE; + } + + @Override + public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) + throws IOException { + Files.copy(file, dest.resolve(src.relativize(file))); + return FileVisitResult.CONTINUE; + } + }); + + // creating empty .git directory so that the tracer could detect projectFolder as repo root + Files.createDirectory(projectHome.resolve(".git")); + } + + /** + * Sometimes Maven has problems downloading project dependencies because of intermittent network + * issues. Here, in order to reduce flakiness, we ensure that all of the dependencies are loaded + * (retrying if necessary), before proceeding with running the build. + */ + private void givenMavenDependenciesAreLoaded(String projectName, String mavenVersion) + throws Exception { + givenMavenDependenciesAreLoaded(projectName, mavenVersion, Collections.emptyMap()); + } + + private void givenMavenDependenciesAreLoaded( + String projectName, String mavenVersion, Map additionalEnvVars) + throws Exception { + if (LOADED_DEPENDENCIES.add(projectName + ":" + mavenVersion)) { + retryUntilSuccessfulOrNoAttemptsLeft( + Collections.singletonList( + "org.apache.maven.plugins:maven-dependency-plugin:3.6.1:go-offline"), + additionalEnvVars); + } + // Dependencies below are downloaded separately because they are not declared in the project, + // but are added at runtime by the tracer. + if (LOADED_DEPENDENCIES.add("com.datadoghq:dd-javac-plugin:" + JAVAC_PLUGIN_VERSION)) { + retryUntilSuccessfulOrNoAttemptsLeft( + Arrays.asList( + "org.apache.maven.plugins:maven-dependency-plugin:3.6.1:get", + "-Dartifact=com.datadoghq:dd-javac-plugin:" + JAVAC_PLUGIN_VERSION), + additionalEnvVars); + } + if (LOADED_DEPENDENCIES.add("org.jacoco:jacoco-maven-plugin:" + JACOCO_PLUGIN_VERSION)) { + retryUntilSuccessfulOrNoAttemptsLeft( + Arrays.asList( + "org.apache.maven.plugins:maven-dependency-plugin:3.6.1:get", + "-Dartifact=org.jacoco:jacoco-maven-plugin:" + JACOCO_PLUGIN_VERSION), + additionalEnvVars); + } + } + + private static final Collection LOADED_DEPENDENCIES = new HashSet<>(); + + private void retryUntilSuccessfulOrNoAttemptsLeft( + List mvnCommand, Map additionalEnvVars) throws Exception { + ProcessBuilder processBuilder = + createProcessBuilder(mvnCommand, false, false, Collections.emptyMap(), additionalEnvVars); + for (int attempt = 0; attempt < DEPENDENCIES_DOWNLOAD_RETRIES; attempt++) { + try { + int exitCode = runProcess(processBuilder.start(), DEPENDENCIES_DOWNLOAD_TIMEOUT_SECS); + if (exitCode == 0) { + return; + } + } catch (TimeoutException e) { + LOGGER.warn("Failed dependency resolution with exception: ", e); + } + } + throw new AssertionError( + "Tried " + + DEPENDENCIES_DOWNLOAD_RETRIES + + " times to execute " + + mvnCommand + + " and failed"); + } + + private int whenRunningMavenBuild( + Map additionalAgentArgs, + List additionalCommandLineParams, + Map additionalEnvVars, + boolean setServiceName) + throws Exception { + List mvnCommand = new ArrayList<>(); + mvnCommand.add("-B"); + mvnCommand.add("test"); + mvnCommand.addAll(additionalCommandLineParams); + + ProcessBuilder processBuilder = + createProcessBuilder( + mvnCommand, true, setServiceName, additionalAgentArgs, additionalEnvVars); + + processBuilder.environment().put("DD_API_KEY", "01234567890abcdef123456789ABCDEF"); + + return runProcess(processBuilder.start(), PROCESS_TIMEOUT_SECS); + } + + private static int runProcess(Process p, int timeoutSecs) throws Exception { + StreamConsumer errorGobbler = new StreamConsumer(p.getErrorStream(), "ERROR"); + StreamConsumer outputGobbler = new StreamConsumer(p.getInputStream(), "OUTPUT"); + outputGobbler.start(); + errorGobbler.start(); + + if (!p.waitFor(timeoutSecs, TimeUnit.SECONDS)) { + p.destroyForcibly(); + throw new TimeoutException( + "Instrumented process failed to exit within " + timeoutSecs + " seconds"); + } + + return p.exitValue(); + } + + ProcessBuilder createProcessBuilder( + List mvnCommand, + boolean runWithAgent, + boolean setServiceName, + Map additionalAgentArgs, + Map additionalEnvVars) { + String mavenRunnerShadowJar = System.getProperty("datadog.smoketest.maven.jar.path"); + assertTrue(new File(mavenRunnerShadowJar).isFile()); + + List command = new ArrayList<>(); + command.add(javaPath()); + command.addAll(jvmArguments(runWithAgent, setServiceName, additionalAgentArgs)); + command.addAll(Arrays.asList("-jar", mavenRunnerShadowJar)); + command.addAll(programArguments()); + + if (System.getenv().get("MAVEN_REPOSITORY_PROXY") != null) { + command.addAll(Arrays.asList("-s", projectHome.toAbsolutePath() + "/settings.mirror.xml")); + } + command.addAll(mvnCommand); + + ProcessBuilder processBuilder = new ProcessBuilder(command); + processBuilder.directory(projectHome.toFile()); + + processBuilder.environment().put("JAVA_HOME", System.getProperty("java.home")); + for (Map.Entry envVar : additionalEnvVars.entrySet()) { + processBuilder.environment().put(envVar.getKey(), envVar.getValue()); + } + + String mavenRepositoryProxy = System.getenv("MAVEN_REPOSITORY_PROXY"); + if (mavenRepositoryProxy != null) { + processBuilder.environment().put("MAVEN_REPOSITORY_PROXY", mavenRepositoryProxy); + } + + return processBuilder; + } + + List jvmArguments( + boolean runWithAgent, boolean setServiceName, Map additionalAgentArgs) { + List arguments = new ArrayList<>(); + arguments.add("-D" + MavenWrapperMain.MVNW_VERBOSE + "=true"); + arguments.add("-Duser.dir=" + projectHome.toAbsolutePath()); + arguments.add("-Dmaven.mainClass=org.apache.maven.cli.MavenCli"); + arguments.add("-Dmaven.multiModuleProjectDirectory=" + projectHome.toAbsolutePath()); + arguments.add("-Dmaven.artifact.threads=10"); + if (runWithAgent) { + arguments.addAll( + buildJvmArguments( + mockBackend.getIntakeUrl(), + setServiceName ? TEST_SERVICE_NAME : null, + additionalAgentArgs)); + } + return arguments; + } + + List programArguments() { + return Collections.singletonList(projectHome.toAbsolutePath().toString()); + } + + private static class StreamConsumer extends Thread { + final InputStream is; + final String messagePrefix; + + StreamConsumer(InputStream is, String messagePrefix) { + this.is = is; + this.messagePrefix = messagePrefix; + } + + @Override + public void run() { + try { + BufferedReader br = new BufferedReader(new InputStreamReader(is)); + String line; + while ((line = br.readLine()) != null) { + // DEBUG: logback.xml keeps this logger at INFO, so subprocess output — which may contain + // secrets (env vars, agent args) — never reaches JUnit XML reports. + LOGGER.debug("{}: {}", messagePrefix, line); + } + } catch (IOException e) { + LOGGER.warn("Error reading process stream", e); + } + } + } + + private static Properties loadLatestToolVersions() { + Properties properties = new Properties(); + try (InputStream stream = + MavenSmokeTest.class + .getClassLoader() + .getResourceAsStream("latest-tool-versions.properties")) { + if (stream == null) { + throw new IllegalStateException( + "Could not find latest-tool-versions.properties on classpath"); + } + properties.load(stream); + } catch (IOException e) { + throw new RuntimeException(e); + } + return properties; + } + + private static String getLatestMavenVersion() { + String version = loadLatestToolVersions().getProperty("maven.latest"); + LOGGER.info("Will run the 'latest' tests with Maven version {}", version); + return version; + } + + private static String getLatestMavenSurefireVersion() { + String version = loadLatestToolVersions().getProperty("maven-surefire.latest"); + LOGGER.info("Will run the 'latest' tests with Maven Surefire version {}", version); + return version; + } + + private static BitSet bits(int... indices) { + BitSet bitSet = new BitSet(); + for (int i : indices) { + bitSet.set(i); + } + return bitSet; + } + + private static String resolveLatestMaven(String mavenVersion) { + return "latest".equals(mavenVersion) ? LATEST_MAVEN_VERSION : mavenVersion; + } +} diff --git a/dd-smoke-tests/maven/src/test/resources/latest-tool-versions.properties b/dd-smoke-tests/maven/src/test/resources/latest-tool-versions.properties index c860128552a..c39f0eebb94 100644 --- a/dd-smoke-tests/maven/src/test/resources/latest-tool-versions.properties +++ b/dd-smoke-tests/maven/src/test/resources/latest-tool-versions.properties @@ -1,4 +1,4 @@ # Pinned latest eligible stable versions (>=48h old) for CI Visibility Maven smoke tests. # Updated automatically by the update-smoke-test-latest-versions workflow. -maven.version=4.0.0-beta-3 -maven-surefire.version=3.5.5 +maven.latest=4.0.0-beta-3 +maven-surefire.latest=3.5.6 diff --git a/dd-smoke-tests/maven/src/test/resources/logback.xml b/dd-smoke-tests/maven/src/test/resources/logback.xml index 24d6bcd768a..297a1d6afed 100644 --- a/dd-smoke-tests/maven/src/test/resources/logback.xml +++ b/dd-smoke-tests/maven/src/test/resources/logback.xml @@ -1,3 +1,9 @@ + + diff --git a/dd-smoke-tests/maven/src/test/resources/test_failed_maven_failed_test_replay/events.ftl b/dd-smoke-tests/maven/src/test/resources/test_failed_maven_failed_test_replay/events.ftl index a0a08671e68..2b5a9e28542 100644 --- a/dd-smoke-tests/maven/src/test/resources/test_failed_maven_failed_test_replay/events.ftl +++ b/dd-smoke-tests/maven/src/test/resources/test_failed_maven_failed_test_replay/events.ftl @@ -249,6 +249,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.source.file" : "src/test/java/com/example/TestFailed.java", "test.status" : "fail", @@ -310,6 +311,7 @@ "test.final_status" : "fail", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_another_failed", "test.source.file" : "src/test/java/com/example/TestFailed.java", @@ -376,6 +378,7 @@ "test.failure_suppressed" : "true", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_failed", "test.source.file" : "src/test/java/com/example/TestFailed.java", @@ -448,6 +451,7 @@ "test.framework" : "junit4", "test.framework_version" : "4.13.2", "test.is_retry" : "true", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_failed", "test.retry_reason" : "auto_test_retry", @@ -523,6 +527,7 @@ "test.framework_version" : "4.13.2", "test.has_failed_all_retries" : "true", "test.is_retry" : "true", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_failed", "test.retry_reason" : "auto_test_retry", diff --git a/dd-smoke-tests/maven/src/test/resources/test_maven_run_cucumber_suite_flaky_retries/coverages.ftl b/dd-smoke-tests/maven/src/test/resources/test_maven_run_cucumber_suite_flaky_retries/coverages.ftl new file mode 100644 index 00000000000..f6900a4dec6 --- /dev/null +++ b/dd-smoke-tests/maven/src/test/resources/test_maven_run_cucumber_suite_flaky_retries/coverages.ftl @@ -0,0 +1,46 @@ +[ { + "files" : [ { + "filename" : "src/test/resources/datadog/smoke/basic_arithmetic.feature" + }, { + "filename" : "src/test/java/datadog/smoke/calculator/CalculatorSteps.java" + } ], + "span_id" : ${content_parent_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} +}, { + "files" : [ { + "filename" : "src/test/resources/datadog/smoke/basic_arithmetic.feature" + }, { + "filename" : "src/test/java/datadog/smoke/calculator/CalculatorSteps.java" + } ], + "span_id" : ${content_parent_id_2}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} +}, { + "files" : [ { + "filename" : "src/test/resources/datadog/smoke/basic_arithmetic.feature" + }, { + "filename" : "src/test/java/datadog/smoke/calculator/CalculatorSteps.java" + } ], + "span_id" : ${content_parent_id_3}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} +}, { + "files" : [ { + "filename" : "src/test/resources/datadog/smoke/basic_arithmetic.feature" + }, { + "filename" : "src/test/java/datadog/smoke/calculator/CalculatorSteps.java" + } ], + "span_id" : ${content_parent_id_4}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} +}, { + "files" : [ { + "filename" : "src/test/resources/datadog/smoke/basic_arithmetic.feature" + }, { + "filename" : "src/test/java/datadog/smoke/calculator/CalculatorSteps.java" + } ], + "span_id" : ${content_parent_id_5}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} +} ] \ No newline at end of file diff --git a/dd-smoke-tests/maven/src/test/resources/test_maven_run_cucumber_suite_flaky_retries/events.ftl b/dd-smoke-tests/maven/src/test/resources/test_maven_run_cucumber_suite_flaky_retries/events.ftl new file mode 100644 index 00000000000..b5fe99d9bcd --- /dev/null +++ b/dd-smoke-tests/maven/src/test/resources/test_maven_run_cucumber_suite_flaky_retries/events.ftl @@ -0,0 +1,1085 @@ +[ { + "content" : { + "duration" : ${content_duration}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid}, + "_dd.test.is_user_provided_service" : "true", + "component" : "cucumber", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "step.arguments" : "[4, 5]", + "step.location" : "datadog.smoke.calculator.CalculatorSteps.adding(int,int)", + "step.name" : "I add {int} and {int}", + "step.type" : "io.cucumber.java.JavaStepDefinition" + }, + "metrics" : { }, + "name" : "cucumber.step", + "parent_id" : ${content_parent_id}, + "resource" : "I add {int} and {int}", + "service" : "test-maven-service", + "span_id" : ${content_span_id}, + "start" : ${content_start}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_2}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_2}, + "_dd.test.is_user_provided_service" : "true", + "component" : "cucumber", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "step.arguments" : "[4, 5]", + "step.location" : "datadog.smoke.calculator.CalculatorSteps.adding(int,int)", + "step.name" : "I add {int} and {int}", + "step.type" : "io.cucumber.java.JavaStepDefinition" + }, + "metrics" : { }, + "name" : "cucumber.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "I add {int} and {int}", + "service" : "test-maven-service", + "span_id" : ${content_span_id_2}, + "start" : ${content_start_2}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_3}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_3}, + "_dd.test.is_user_provided_service" : "true", + "component" : "cucumber", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "step.arguments" : "[4, 5]", + "step.location" : "datadog.smoke.calculator.CalculatorSteps.adding(int,int)", + "step.name" : "I add {int} and {int}", + "step.type" : "io.cucumber.java.JavaStepDefinition" + }, + "metrics" : { }, + "name" : "cucumber.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "I add {int} and {int}", + "service" : "test-maven-service", + "span_id" : ${content_span_id_3}, + "start" : ${content_start_3}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_4}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_4}, + "_dd.test.is_user_provided_service" : "true", + "component" : "cucumber", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "step.arguments" : "[4, 5]", + "step.location" : "datadog.smoke.calculator.CalculatorSteps.adding(int,int)", + "step.name" : "I add {int} and {int}", + "step.type" : "io.cucumber.java.JavaStepDefinition" + }, + "metrics" : { }, + "name" : "cucumber.step", + "parent_id" : ${content_parent_id_4}, + "resource" : "I add {int} and {int}", + "service" : "test-maven-service", + "span_id" : ${content_span_id_4}, + "start" : ${content_start_4}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_5}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_5}, + "_dd.test.is_user_provided_service" : "true", + "component" : "cucumber", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "step.arguments" : "[4, 5]", + "step.location" : "datadog.smoke.calculator.CalculatorSteps.adding(int,int)", + "step.name" : "I add {int} and {int}", + "step.type" : "io.cucumber.java.JavaStepDefinition" + }, + "metrics" : { }, + "name" : "cucumber.step", + "parent_id" : ${content_parent_id_5}, + "resource" : "I add {int} and {int}", + "service" : "test-maven-service", + "span_id" : ${content_span_id_5}, + "start" : ${content_start_5}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_6}, + "error" : 1, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_6}, + "_dd.test.is_user_provided_service" : "true", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "ci.workspace_path" : ${content_meta_ci_workspace_path}, + "component" : "maven", + "env" : "integration-test", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack}, + "error.type" : "org.apache.maven.lifecycle.LifecycleExecutionException", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id_2}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "span.kind" : "test_session_end", + "test.code_coverage.enabled" : "true", + "test.command" : "mvn -B test", + "test.framework" : "cucumber", + "test.framework_version" : "7.22.0", + "test.status" : "fail", + "test.toolchain" : ${content_meta_test_toolchain}, + "test.type" : "test", + "test_session.name" : "mvn -B test" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id} + }, + "name" : "maven.test_session", + "resource" : "Maven Smoke Tests Project", + "service" : "test-maven-service", + "start" : ${content_start_6}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_session_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_7}, + "error" : 1, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_7}, + "_dd.test.is_user_provided_service" : "true", + "ci.workspace_path" : ${content_meta_ci_workspace_path}, + "component" : "maven", + "env" : "integration-test", + "error.message" : ${content_meta_error_message}, + "error.stack" : ${content_meta_error_stack_2}, + "error.type" : "org.apache.maven.lifecycle.LifecycleExecutionException", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id_2}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "span.kind" : "test_module_end", + "test.code_coverage.enabled" : "true", + "test.command" : "mvn -B test", + "test.execution" : "maven-surefire-plugin:test:default-test", + "test.framework" : "cucumber", + "test.framework_version" : "7.22.0", + "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", + "test.status" : "fail", + "test.type" : "test", + "test_session.name" : "mvn -B test" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_2} + }, + "name" : "maven.test_module", + "resource" : "Maven Smoke Tests Project maven-surefire-plugin default-test", + "service" : "test-maven-service", + "start" : ${content_start_7}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id} + }, + "type" : "test_module_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_8}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_8}, + "_dd.test.is_user_provided_service" : "true", + "env" : "integration-test", + "execution" : "default-compile", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "plugin" : "maven-compiler-plugin", + "project" : "Maven Smoke Tests Project", + "runtime-id" : ${content_meta_runtime_id_2}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version} + }, + "metrics" : { }, + "name" : "Maven_Smoke_Tests_Project_maven_compiler_plugin_default_compile", + "parent_id" : ${content_test_session_id}, + "resource" : "Maven_Smoke_Tests_Project_maven_compiler_plugin_default_compile", + "service" : "test-maven-service", + "span_id" : ${content_span_id_6}, + "start" : ${content_start_8}, + "trace_id" : ${content_test_session_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_9}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_9}, + "_dd.test.is_user_provided_service" : "true", + "env" : "integration-test", + "execution" : "default-testCompile", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "plugin" : "maven-compiler-plugin", + "project" : "Maven Smoke Tests Project", + "runtime-id" : ${content_meta_runtime_id_2}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version} + }, + "metrics" : { }, + "name" : "Maven_Smoke_Tests_Project_maven_compiler_plugin_default_testCompile", + "parent_id" : ${content_test_session_id}, + "resource" : "Maven_Smoke_Tests_Project_maven_compiler_plugin_default_testCompile", + "service" : "test-maven-service", + "span_id" : ${content_span_id_7}, + "start" : ${content_start_9}, + "trace_id" : ${content_test_session_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_10}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_10}, + "_dd.test.is_user_provided_service" : "true", + "env" : "integration-test", + "execution" : "default-resources", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "plugin" : "maven-resources-plugin", + "project" : "Maven Smoke Tests Project", + "runtime-id" : ${content_meta_runtime_id_2}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version} + }, + "metrics" : { }, + "name" : "Maven_Smoke_Tests_Project_maven_resources_plugin_default_resources", + "parent_id" : ${content_test_session_id}, + "resource" : "Maven_Smoke_Tests_Project_maven_resources_plugin_default_resources", + "service" : "test-maven-service", + "span_id" : ${content_span_id_8}, + "start" : ${content_start_10}, + "trace_id" : ${content_test_session_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_11}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_11}, + "_dd.test.is_user_provided_service" : "true", + "env" : "integration-test", + "execution" : "default-testResources", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "plugin" : "maven-resources-plugin", + "project" : "Maven Smoke Tests Project", + "runtime-id" : ${content_meta_runtime_id_2}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version} + }, + "metrics" : { }, + "name" : "Maven_Smoke_Tests_Project_maven_resources_plugin_default_testResources", + "parent_id" : ${content_test_session_id}, + "resource" : "Maven_Smoke_Tests_Project_maven_resources_plugin_default_testResources", + "service" : "test-maven-service", + "span_id" : ${content_span_id_9}, + "start" : ${content_start_11}, + "trace_id" : ${content_test_session_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_12}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_12}, + "_dd.test.is_user_provided_service" : "true", + "component" : "cucumber", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "step.location" : "datadog.smoke.calculator.CalculatorSteps.a_calculator_I_just_turned_on()", + "step.name" : "a calculator I just turned on", + "step.type" : "io.cucumber.java.JavaStepDefinition" + }, + "metrics" : { }, + "name" : "cucumber.step", + "parent_id" : ${content_parent_id}, + "resource" : "a calculator I just turned on", + "service" : "test-maven-service", + "span_id" : ${content_span_id_10}, + "start" : ${content_start_12}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_13}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_13}, + "_dd.test.is_user_provided_service" : "true", + "component" : "cucumber", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "step.location" : "datadog.smoke.calculator.CalculatorSteps.a_calculator_I_just_turned_on()", + "step.name" : "a calculator I just turned on", + "step.type" : "io.cucumber.java.JavaStepDefinition" + }, + "metrics" : { }, + "name" : "cucumber.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "a calculator I just turned on", + "service" : "test-maven-service", + "span_id" : ${content_span_id_11}, + "start" : ${content_start_13}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_14}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_14}, + "_dd.test.is_user_provided_service" : "true", + "component" : "cucumber", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "step.location" : "datadog.smoke.calculator.CalculatorSteps.a_calculator_I_just_turned_on()", + "step.name" : "a calculator I just turned on", + "step.type" : "io.cucumber.java.JavaStepDefinition" + }, + "metrics" : { }, + "name" : "cucumber.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "a calculator I just turned on", + "service" : "test-maven-service", + "span_id" : ${content_span_id_12}, + "start" : ${content_start_14}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_15}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_15}, + "_dd.test.is_user_provided_service" : "true", + "component" : "cucumber", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "step.location" : "datadog.smoke.calculator.CalculatorSteps.a_calculator_I_just_turned_on()", + "step.name" : "a calculator I just turned on", + "step.type" : "io.cucumber.java.JavaStepDefinition" + }, + "metrics" : { }, + "name" : "cucumber.step", + "parent_id" : ${content_parent_id_4}, + "resource" : "a calculator I just turned on", + "service" : "test-maven-service", + "span_id" : ${content_span_id_13}, + "start" : ${content_start_15}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_16}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_16}, + "_dd.test.is_user_provided_service" : "true", + "component" : "cucumber", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "step.location" : "datadog.smoke.calculator.CalculatorSteps.a_calculator_I_just_turned_on()", + "step.name" : "a calculator I just turned on", + "step.type" : "io.cucumber.java.JavaStepDefinition" + }, + "metrics" : { }, + "name" : "cucumber.step", + "parent_id" : ${content_parent_id_5}, + "resource" : "a calculator I just turned on", + "service" : "test-maven-service", + "span_id" : ${content_span_id_14}, + "start" : ${content_start_16}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_17}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_17}, + "_dd.test.is_user_provided_service" : "true", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "ci.workspace_path" : ${content_meta_ci_workspace_path}, + "component" : "cucumber", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "span.kind" : "test_suite_end", + "test.framework" : "cucumber", + "test.framework_version" : "7.22.0", + "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", + "test.status" : "fail", + "test.suite" : "classpath:datadog/smoke/basic_arithmetic.feature:Basic Arithmetic", + "test.type" : "test", + "test_session.name" : "mvn -B test" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_3}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id_2} + }, + "name" : "cucumber.test_suite", + "resource" : "classpath:datadog/smoke/basic_arithmetic.feature:Basic Arithmetic", + "service" : "test-maven-service", + "start" : ${content_start_17}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id} + }, + "type" : "test_suite_end", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_18}, + "error" : 1, + "meta" : { + "_dd.library_capabilities.auto_test_retries" : "1", + "_dd.library_capabilities.coverage_report_upload" : "1", + "_dd.library_capabilities.early_flake_detection" : "1", + "_dd.library_capabilities.failed_test_replay" : "1", + "_dd.library_capabilities.test_impact_analysis" : "1", + "_dd.library_capabilities.test_management.attempt_to_fix" : "5", + "_dd.library_capabilities.test_management.disable" : "1", + "_dd.library_capabilities.test_management.quarantine" : "1", + "_dd.p.tid" : ${content_meta__dd_p_tid_18}, + "_dd.test.is_user_provided_service" : "true", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "ci.workspace_path" : ${content_meta_ci_workspace_path}, + "component" : "cucumber", + "env" : "integration-test", + "error.message" : ${content_meta_error_message_2}, + "error.stack" : ${content_meta_error_stack_3}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.framework" : "cucumber", + "test.framework_version" : "7.22.0", + "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", + "test.name" : "Basic Arithmetic - Addition", + "test.status" : "fail", + "test.suite" : "classpath:datadog/smoke/basic_arithmetic.feature:Basic Arithmetic", + "test.type" : "test", + "test_session.name" : "mvn -B test" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_4}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id_2} + }, + "name" : "cucumber.test", + "parent_id" : ${content_parent_id_6}, + "resource" : "classpath:datadog/smoke/basic_arithmetic.feature:Basic Arithmetic.Basic Arithmetic - Addition", + "service" : "test-maven-service", + "span_id" : ${content_parent_id}, + "start" : ${content_start_18}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_19}, + "error" : 1, + "meta" : { + "_dd.library_capabilities.auto_test_retries" : "1", + "_dd.library_capabilities.coverage_report_upload" : "1", + "_dd.library_capabilities.early_flake_detection" : "1", + "_dd.library_capabilities.failed_test_replay" : "1", + "_dd.library_capabilities.test_impact_analysis" : "1", + "_dd.library_capabilities.test_management.attempt_to_fix" : "5", + "_dd.library_capabilities.test_management.disable" : "1", + "_dd.library_capabilities.test_management.quarantine" : "1", + "_dd.p.tid" : ${content_meta__dd_p_tid_19}, + "_dd.test.is_user_provided_service" : "true", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "ci.workspace_path" : ${content_meta_ci_workspace_path}, + "component" : "cucumber", + "env" : "integration-test", + "error.message" : ${content_meta_error_message_2}, + "error.stack" : ${content_meta_error_stack_4}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.framework" : "cucumber", + "test.framework_version" : "7.22.0", + "test.is_retry" : "true", + "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", + "test.name" : "Basic Arithmetic - Addition", + "test.retry_reason" : "auto_test_retry", + "test.status" : "fail", + "test.suite" : "classpath:datadog/smoke/basic_arithmetic.feature:Basic Arithmetic", + "test.type" : "test", + "test_session.name" : "mvn -B test" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_5}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id_2} + }, + "name" : "cucumber.test", + "parent_id" : ${content_parent_id_6}, + "resource" : "classpath:datadog/smoke/basic_arithmetic.feature:Basic Arithmetic.Basic Arithmetic - Addition", + "service" : "test-maven-service", + "span_id" : ${content_parent_id_2}, + "start" : ${content_start_19}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_20}, + "error" : 1, + "meta" : { + "_dd.library_capabilities.auto_test_retries" : "1", + "_dd.library_capabilities.coverage_report_upload" : "1", + "_dd.library_capabilities.early_flake_detection" : "1", + "_dd.library_capabilities.failed_test_replay" : "1", + "_dd.library_capabilities.test_impact_analysis" : "1", + "_dd.library_capabilities.test_management.attempt_to_fix" : "5", + "_dd.library_capabilities.test_management.disable" : "1", + "_dd.library_capabilities.test_management.quarantine" : "1", + "_dd.p.tid" : ${content_meta__dd_p_tid_20}, + "_dd.test.is_user_provided_service" : "true", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "ci.workspace_path" : ${content_meta_ci_workspace_path}, + "component" : "cucumber", + "env" : "integration-test", + "error.message" : ${content_meta_error_message_2}, + "error.stack" : ${content_meta_error_stack_5}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.framework" : "cucumber", + "test.framework_version" : "7.22.0", + "test.is_retry" : "true", + "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", + "test.name" : "Basic Arithmetic - Addition", + "test.retry_reason" : "auto_test_retry", + "test.status" : "fail", + "test.suite" : "classpath:datadog/smoke/basic_arithmetic.feature:Basic Arithmetic", + "test.type" : "test", + "test_session.name" : "mvn -B test" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_6}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id_2} + }, + "name" : "cucumber.test", + "parent_id" : ${content_parent_id_6}, + "resource" : "classpath:datadog/smoke/basic_arithmetic.feature:Basic Arithmetic.Basic Arithmetic - Addition", + "service" : "test-maven-service", + "span_id" : ${content_parent_id_3}, + "start" : ${content_start_20}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_21}, + "error" : 1, + "meta" : { + "_dd.library_capabilities.auto_test_retries" : "1", + "_dd.library_capabilities.coverage_report_upload" : "1", + "_dd.library_capabilities.early_flake_detection" : "1", + "_dd.library_capabilities.failed_test_replay" : "1", + "_dd.library_capabilities.test_impact_analysis" : "1", + "_dd.library_capabilities.test_management.attempt_to_fix" : "5", + "_dd.library_capabilities.test_management.disable" : "1", + "_dd.library_capabilities.test_management.quarantine" : "1", + "_dd.p.tid" : ${content_meta__dd_p_tid_21}, + "_dd.test.is_user_provided_service" : "true", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "ci.workspace_path" : ${content_meta_ci_workspace_path}, + "component" : "cucumber", + "env" : "integration-test", + "error.message" : ${content_meta_error_message_2}, + "error.stack" : ${content_meta_error_stack_6}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "span.kind" : "test", + "test.failure_suppressed" : "true", + "test.framework" : "cucumber", + "test.framework_version" : "7.22.0", + "test.is_retry" : "true", + "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", + "test.name" : "Basic Arithmetic - Addition", + "test.retry_reason" : "auto_test_retry", + "test.status" : "fail", + "test.suite" : "classpath:datadog/smoke/basic_arithmetic.feature:Basic Arithmetic", + "test.type" : "test", + "test_session.name" : "mvn -B test" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_7}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id_2} + }, + "name" : "cucumber.test", + "parent_id" : ${content_parent_id_6}, + "resource" : "classpath:datadog/smoke/basic_arithmetic.feature:Basic Arithmetic.Basic Arithmetic - Addition", + "service" : "test-maven-service", + "span_id" : ${content_parent_id_4}, + "start" : ${content_start_21}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_22}, + "error" : 1, + "meta" : { + "_dd.library_capabilities.auto_test_retries" : "1", + "_dd.library_capabilities.coverage_report_upload" : "1", + "_dd.library_capabilities.early_flake_detection" : "1", + "_dd.library_capabilities.failed_test_replay" : "1", + "_dd.library_capabilities.test_impact_analysis" : "1", + "_dd.library_capabilities.test_management.attempt_to_fix" : "5", + "_dd.library_capabilities.test_management.disable" : "1", + "_dd.library_capabilities.test_management.quarantine" : "1", + "_dd.p.tid" : ${content_meta__dd_p_tid_22}, + "_dd.test.is_user_provided_service" : "true", + "_dd.tracer_host" : ${content_meta__dd_tracer_host}, + "ci.workspace_path" : ${content_meta_ci_workspace_path}, + "component" : "cucumber", + "env" : "integration-test", + "error.message" : ${content_meta_error_message_2}, + "error.stack" : ${content_meta_error_stack_7}, + "error.type" : "java.lang.AssertionError", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "span.kind" : "test", + "test.final_status" : "fail", + "test.framework" : "cucumber", + "test.framework_version" : "7.22.0", + "test.has_failed_all_retries" : "true", + "test.is_retry" : "true", + "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", + "test.name" : "Basic Arithmetic - Addition", + "test.retry_reason" : "auto_test_retry", + "test.status" : "fail", + "test.suite" : "classpath:datadog/smoke/basic_arithmetic.feature:Basic Arithmetic", + "test.type" : "test", + "test_session.name" : "mvn -B test" + }, + "metrics" : { + "_dd.host.vcpu_count" : ${content_metrics__dd_host_vcpu_count_8}, + "_dd.profiling.enabled" : 0, + "_dd.trace_span_attribute_schema" : 0, + "process_id" : ${content_metrics_process_id_2} + }, + "name" : "cucumber.test", + "parent_id" : ${content_parent_id_6}, + "resource" : "classpath:datadog/smoke/basic_arithmetic.feature:Basic Arithmetic.Basic Arithmetic - Addition", + "service" : "test-maven-service", + "span_id" : ${content_parent_id_5}, + "start" : ${content_start_22}, + "test_module_id" : ${content_test_module_id}, + "test_session_id" : ${content_test_session_id}, + "test_suite_id" : ${content_test_suite_id}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "test", + "version" : 2 +}, { + "content" : { + "duration" : ${content_duration_23}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_23}, + "_dd.test.is_user_provided_service" : "true", + "component" : "cucumber", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "step.arguments" : "[8]", + "step.location" : "datadog.smoke.calculator.CalculatorSteps.the_result_is(int)", + "step.name" : "the result is {int}", + "step.type" : "io.cucumber.java.JavaStepDefinition" + }, + "metrics" : { }, + "name" : "cucumber.step", + "parent_id" : ${content_parent_id}, + "resource" : "the result is {int}", + "service" : "test-maven-service", + "span_id" : ${content_span_id_15}, + "start" : ${content_start_23}, + "trace_id" : ${content_trace_id} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_24}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_24}, + "_dd.test.is_user_provided_service" : "true", + "component" : "cucumber", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "step.arguments" : "[8]", + "step.location" : "datadog.smoke.calculator.CalculatorSteps.the_result_is(int)", + "step.name" : "the result is {int}", + "step.type" : "io.cucumber.java.JavaStepDefinition" + }, + "metrics" : { }, + "name" : "cucumber.step", + "parent_id" : ${content_parent_id_2}, + "resource" : "the result is {int}", + "service" : "test-maven-service", + "span_id" : ${content_span_id_16}, + "start" : ${content_start_24}, + "trace_id" : ${content_trace_id_2} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_25}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_25}, + "_dd.test.is_user_provided_service" : "true", + "component" : "cucumber", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "step.arguments" : "[8]", + "step.location" : "datadog.smoke.calculator.CalculatorSteps.the_result_is(int)", + "step.name" : "the result is {int}", + "step.type" : "io.cucumber.java.JavaStepDefinition" + }, + "metrics" : { }, + "name" : "cucumber.step", + "parent_id" : ${content_parent_id_3}, + "resource" : "the result is {int}", + "service" : "test-maven-service", + "span_id" : ${content_span_id_17}, + "start" : ${content_start_25}, + "trace_id" : ${content_trace_id_3} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_26}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_26}, + "_dd.test.is_user_provided_service" : "true", + "component" : "cucumber", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "step.arguments" : "[8]", + "step.location" : "datadog.smoke.calculator.CalculatorSteps.the_result_is(int)", + "step.name" : "the result is {int}", + "step.type" : "io.cucumber.java.JavaStepDefinition" + }, + "metrics" : { }, + "name" : "cucumber.step", + "parent_id" : ${content_parent_id_4}, + "resource" : "the result is {int}", + "service" : "test-maven-service", + "span_id" : ${content_span_id_18}, + "start" : ${content_start_26}, + "trace_id" : ${content_trace_id_4} + }, + "type" : "span", + "version" : 1 +}, { + "content" : { + "duration" : ${content_duration_27}, + "error" : 0, + "meta" : { + "_dd.p.tid" : ${content_meta__dd_p_tid_27}, + "_dd.test.is_user_provided_service" : "true", + "component" : "cucumber", + "env" : "integration-test", + "language" : "jvm", + "library_version" : ${content_meta_library_version}, + "os.architecture" : ${content_meta_os_architecture}, + "os.platform" : ${content_meta_os_platform}, + "os.version" : ${content_meta_os_version}, + "runtime-id" : ${content_meta_runtime_id}, + "runtime.name" : ${content_meta_runtime_name}, + "runtime.vendor" : ${content_meta_runtime_vendor}, + "runtime.version" : ${content_meta_runtime_version}, + "step.arguments" : "[8]", + "step.location" : "datadog.smoke.calculator.CalculatorSteps.the_result_is(int)", + "step.name" : "the result is {int}", + "step.type" : "io.cucumber.java.JavaStepDefinition" + }, + "metrics" : { }, + "name" : "cucumber.step", + "parent_id" : ${content_parent_id_5}, + "resource" : "the result is {int}", + "service" : "test-maven-service", + "span_id" : ${content_span_id_19}, + "start" : ${content_start_27}, + "trace_id" : ${content_trace_id_5} + }, + "type" : "span", + "version" : 1 +} ] \ No newline at end of file diff --git a/dd-smoke-tests/maven/src/test/resources/test_maven_run_cucumber_suite_flaky_retries/pom.xml b/dd-smoke-tests/maven/src/test/resources/test_maven_run_cucumber_suite_flaky_retries/pom.xml new file mode 100644 index 00000000000..41d66c7a639 --- /dev/null +++ b/dd-smoke-tests/maven/src/test/resources/test_maven_run_cucumber_suite_flaky_retries/pom.xml @@ -0,0 +1,107 @@ + + + + 4.0.0 + com.datadog.ci.test + maven-smoke-test + 1.0-SNAPSHOT + Maven Smoke Tests Project + + + + 17 + UTF-8 + 7.22.0 + + + + + + false + + central + Central Repository + https://repo.maven.apache.org/maven2 + + + + + + never + + + false + + central + Central Repository + https://repo.maven.apache.org/maven2 + + + + + + + org.junit + junit-bom + 5.13.0 + pom + import + + + + + + + io.cucumber + cucumber-java + ${cucumber.version} + test + + + io.cucumber + cucumber-junit-platform-engine + ${cucumber.version} + test + + + org.junit.platform + junit-platform-suite + test + + + junit + junit + 4.13.2 + test + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + 3.5.6 + + + + + cucumber.junit-platform.naming-strategy=long + + + + + + + + diff --git a/dd-smoke-tests/maven/src/test/resources/test_maven_run_cucumber_suite_flaky_retries/src/test/java/datadog/smoke/RunCucumberTest.java b/dd-smoke-tests/maven/src/test/resources/test_maven_run_cucumber_suite_flaky_retries/src/test/java/datadog/smoke/RunCucumberTest.java new file mode 100644 index 00000000000..4d069ff78ce --- /dev/null +++ b/dd-smoke-tests/maven/src/test/resources/test_maven_run_cucumber_suite_flaky_retries/src/test/java/datadog/smoke/RunCucumberTest.java @@ -0,0 +1,14 @@ +package datadog.smoke; + +import static io.cucumber.junit.platform.engine.Constants.GLUE_PROPERTY_NAME; + +import org.junit.platform.suite.api.ConfigurationParameter; +import org.junit.platform.suite.api.IncludeEngines; +import org.junit.platform.suite.api.SelectClasspathResource; +import org.junit.platform.suite.api.Suite; + +@Suite +@IncludeEngines("cucumber") +@SelectClasspathResource("datadog/smoke") +@ConfigurationParameter(key = GLUE_PROPERTY_NAME, value = "datadog.smoke.calculator") +public class RunCucumberTest {} diff --git a/dd-smoke-tests/maven/src/test/resources/test_maven_run_cucumber_suite_flaky_retries/src/test/java/datadog/smoke/calculator/CalculatorSteps.java b/dd-smoke-tests/maven/src/test/resources/test_maven_run_cucumber_suite_flaky_retries/src/test/java/datadog/smoke/calculator/CalculatorSteps.java new file mode 100644 index 00000000000..62affeea4fc --- /dev/null +++ b/dd-smoke-tests/maven/src/test/resources/test_maven_run_cucumber_suite_flaky_retries/src/test/java/datadog/smoke/calculator/CalculatorSteps.java @@ -0,0 +1,28 @@ +package datadog.smoke.calculator; + +import static org.junit.Assert.assertEquals; + +import io.cucumber.java.en.Given; +import io.cucumber.java.en.Then; +import io.cucumber.java.en.When; + +public class CalculatorSteps { + + private int result; + + @Given("a calculator I just turned on") + public void a_calculator_I_just_turned_on() { + result = 0; + } + + @When("I add {int} and {int}") + public void adding(int a, int b) { + result = a + b; + } + + @Then("the result is {int}") + public void the_result_is(int expected) { + // Deterministically fails (4 + 5 != 8), so auto-test-retry re-runs the scenario. + assertEquals(expected, result); + } +} diff --git a/dd-smoke-tests/maven/src/test/resources/test_maven_run_cucumber_suite_flaky_retries/src/test/resources/datadog/smoke/basic_arithmetic.feature b/dd-smoke-tests/maven/src/test/resources/test_maven_run_cucumber_suite_flaky_retries/src/test/resources/datadog/smoke/basic_arithmetic.feature new file mode 100644 index 00000000000..046b08f7833 --- /dev/null +++ b/dd-smoke-tests/maven/src/test/resources/test_maven_run_cucumber_suite_flaky_retries/src/test/resources/datadog/smoke/basic_arithmetic.feature @@ -0,0 +1,8 @@ +Feature: Basic Arithmetic + + Background: A Calculator + Given a calculator I just turned on + + Scenario: Addition + When I add 4 and 5 + Then the result is 8 diff --git a/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run/events.ftl b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run/events.ftl index de28439b093..3ce7410d542 100644 --- a/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run/events.ftl +++ b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run/events.ftl @@ -279,6 +279,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", "test.status" : "pass", @@ -338,6 +339,7 @@ "test.final_status" : "pass", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_succeed", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", @@ -402,6 +404,7 @@ "test.final_status" : "skip", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_to_skip_with_itr", "test.skip_reason" : "Skipped by Datadog Test Impact Analysis", diff --git a/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_builtin_coverage/events.ftl b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_builtin_coverage/events.ftl index e6a97ab492c..e166040a268 100644 --- a/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_builtin_coverage/events.ftl +++ b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_builtin_coverage/events.ftl @@ -243,6 +243,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", "test.status" : "pass", @@ -302,6 +303,7 @@ "test.final_status" : "pass", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_succeed", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", @@ -366,6 +368,7 @@ "test.final_status" : "skip", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_to_skip_with_itr", "test.skip_reason" : "Skipped by Datadog Test Impact Analysis", diff --git a/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_child_service_propagation/events.ftl b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_child_service_propagation/events.ftl index 3bfd277008f..10d0f2f1dc8 100644 --- a/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_child_service_propagation/events.ftl +++ b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_child_service_propagation/events.ftl @@ -241,6 +241,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", "test.status" : "pass", @@ -300,6 +301,7 @@ "test.final_status" : "pass", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_succeed", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", diff --git a/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_multiple_forks/events.ftl b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_multiple_forks/events.ftl index 8868dd0e19c..8296cebb7dc 100644 --- a/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_multiple_forks/events.ftl +++ b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_multiple_forks/events.ftl @@ -279,6 +279,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit5", "test.framework_version" : "5.9.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", "test.status" : "pass", @@ -338,6 +339,7 @@ "test.final_status" : "pass", "test.framework" : "junit5", "test.framework_version" : "5.9.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_succeed", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", @@ -402,6 +404,7 @@ "test.final_status" : "skip", "test.framework" : "junit5", "test.framework_version" : "5.9.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_to_skip_with_itr", "test.skip_reason" : "Skipped by Datadog Test Impact Analysis", diff --git a/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_surefire_3_0_0/events.ftl b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_surefire_3_0_0/events.ftl index de28439b093..3ce7410d542 100644 --- a/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_surefire_3_0_0/events.ftl +++ b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_surefire_3_0_0/events.ftl @@ -279,6 +279,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", "test.status" : "pass", @@ -338,6 +339,7 @@ "test.final_status" : "pass", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_succeed", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", @@ -402,6 +404,7 @@ "test.final_status" : "skip", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_to_skip_with_itr", "test.skip_reason" : "Skipped by Datadog Test Impact Analysis", diff --git a/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_surefire_3_5_0/events.ftl b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_surefire_3_5_0/events.ftl index de28439b093..3ce7410d542 100644 --- a/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_surefire_3_5_0/events.ftl +++ b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_surefire_3_5_0/events.ftl @@ -279,6 +279,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", "test.status" : "pass", @@ -338,6 +339,7 @@ "test.final_status" : "pass", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_succeed", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", @@ -402,6 +404,7 @@ "test.final_status" : "skip", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_to_skip_with_itr", "test.skip_reason" : "Skipped by Datadog Test Impact Analysis", diff --git a/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_test_management/events.ftl b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_test_management/events.ftl index 79afac0c22d..1ece6a2c99b 100644 --- a/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_test_management/events.ftl +++ b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_test_management/events.ftl @@ -243,6 +243,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.source.file" : "src/test/java/datadog/smoke/TestFailed.java", "test.status" : "pass", @@ -305,6 +306,7 @@ "test.final_status" : "pass", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_failed", "test.source.file" : "src/test/java/datadog/smoke/TestFailed.java", @@ -359,6 +361,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.source.file" : "src/test/java/datadog/smoke/TestSucceeded.java", "test.status" : "pass", @@ -417,6 +420,7 @@ "span.kind" : "test", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_another_succeeded", "test.source.file" : "src/test/java/datadog/smoke/TestSucceeded.java", @@ -482,6 +486,7 @@ "test.framework" : "junit4", "test.framework_version" : "4.13.2", "test.is_retry" : "true", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_another_succeeded", "test.retry_reason" : "attempt_to_fix", @@ -548,6 +553,7 @@ "test.framework" : "junit4", "test.framework_version" : "4.13.2", "test.is_retry" : "true", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_another_succeeded", "test.retry_reason" : "attempt_to_fix", @@ -614,6 +620,7 @@ "test.framework" : "junit4", "test.framework_version" : "4.13.2", "test.is_retry" : "true", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_another_succeeded", "test.retry_reason" : "attempt_to_fix", @@ -681,6 +688,7 @@ "test.framework" : "junit4", "test.framework_version" : "4.13.2", "test.is_retry" : "true", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_another_succeeded", "test.retry_reason" : "attempt_to_fix", @@ -748,6 +756,7 @@ "test.final_status" : "skip", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_succeeded", "test.skip_reason" : "Flaky test is disabled by Datadog", diff --git a/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_with_jacoco_and_argline/events.ftl b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_with_jacoco_and_argline/events.ftl index 8386bc1b380..1dd47554009 100644 --- a/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_with_jacoco_and_argline/events.ftl +++ b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_with_jacoco_and_argline/events.ftl @@ -279,6 +279,7 @@ "span.kind" : "test_suite_end", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", "test.status" : "pass", @@ -338,6 +339,7 @@ "test.final_status" : "pass", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_succeed", "test.source.file" : "src/test/java/datadog/smoke/TestSucceed.java", @@ -402,6 +404,7 @@ "test.final_status" : "skip", "test.framework" : "junit4", "test.framework_version" : "4.13.2", + "test.itr.tests_skipping.enabled" : "true", "test.module" : "Maven Smoke Tests Project maven-surefire-plugin default-test", "test.name" : "test_to_skip_with_itr", "test.skip_reason" : "Skipped by Datadog Test Impact Analysis", diff --git a/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_with_jacoco_and_argline/pom.xml b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_with_jacoco_and_argline/pom.xml index c83da8e6a6c..616a0b4fa5d 100644 --- a/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_with_jacoco_and_argline/pom.xml +++ b/dd-smoke-tests/maven/src/test/resources/test_successful_maven_run_with_jacoco_and_argline/pom.xml @@ -62,7 +62,7 @@ org.jacoco jacoco-maven-plugin - 0.8.14 + 0.8.15 default-prepare-agent diff --git a/dd-smoke-tests/openfeature/application/build.gradle b/dd-smoke-tests/openfeature/application/build.gradle new file mode 100644 index 00000000000..9f7f9558e9b --- /dev/null +++ b/dd-smoke-tests/openfeature/application/build.gradle @@ -0,0 +1,38 @@ +plugins { + id 'java' + id 'org.springframework.boot' version '2.7.15' + id 'io.spring.dependency-management' version '1.0.15.RELEASE' +} + +def sharedRootDir = "$rootDir/../../../" +def sharedConfigDirectory = "$sharedRootDir/gradle" +rootProject.ext.sharedConfigDirectory = sharedConfigDirectory + +apply from: "$sharedConfigDirectory/repositories.gradle" + +if (hasProperty('appBuildDir')) { + buildDir = property('appBuildDir') +} + +version = "" + +// Java 11 (not Java 8 like the other Spring Boot 2.x smoke tests): the OpenFeature SDK +// requires Java 11+. This matches what the outer (pre-nested) build was doing before +// the application was extracted into this nested build. +java { + sourceCompatibility = 11 + targetCompatibility = 11 +} + +if (hasProperty('featureFlaggingApiJar')) { + dependencies { + implementation files(property('featureFlaggingApiJar')) + } +} + +dependencies { + // OpenFeature SDK is an API dependency of feature-flagging-api but is not + // transitively resolved when the jar is passed as a files() dependency. + implementation 'dev.openfeature:sdk:1.20.1' + implementation 'org.springframework.boot:spring-boot-starter-web' +} diff --git a/dd-smoke-tests/openfeature/application/settings.gradle b/dd-smoke-tests/openfeature/application/settings.gradle new file mode 100644 index 00000000000..467bf8a6e1a --- /dev/null +++ b/dd-smoke-tests/openfeature/application/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'openfeature-smoketest' diff --git a/dd-smoke-tests/openfeature/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java b/dd-smoke-tests/openfeature/application/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java similarity index 100% rename from dd-smoke-tests/openfeature/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java rename to dd-smoke-tests/openfeature/application/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java diff --git a/dd-smoke-tests/openfeature/src/main/java/datadog/smoketest/springboot/openfeature/OpenFeatureConfiguration.java b/dd-smoke-tests/openfeature/application/src/main/java/datadog/smoketest/springboot/openfeature/OpenFeatureConfiguration.java similarity index 100% rename from dd-smoke-tests/openfeature/src/main/java/datadog/smoketest/springboot/openfeature/OpenFeatureConfiguration.java rename to dd-smoke-tests/openfeature/application/src/main/java/datadog/smoketest/springboot/openfeature/OpenFeatureConfiguration.java diff --git a/dd-smoke-tests/openfeature/src/main/java/datadog/smoketest/springboot/openfeature/OpenFeatureController.java b/dd-smoke-tests/openfeature/application/src/main/java/datadog/smoketest/springboot/openfeature/OpenFeatureController.java similarity index 100% rename from dd-smoke-tests/openfeature/src/main/java/datadog/smoketest/springboot/openfeature/OpenFeatureController.java rename to dd-smoke-tests/openfeature/application/src/main/java/datadog/smoketest/springboot/openfeature/OpenFeatureController.java diff --git a/dd-smoke-tests/openfeature/build.gradle b/dd-smoke-tests/openfeature/build.gradle index a38696418ef..fb3a68a2638 100644 --- a/dd-smoke-tests/openfeature/build.gradle +++ b/dd-smoke-tests/openfeature/build.gradle @@ -1,38 +1,35 @@ -import org.springframework.boot.gradle.tasks.bundling.BootJar - plugins { - id 'java' - id 'org.springframework.boot' version '2.7.15' - id 'io.spring.dependency-management' version '1.0.15.RELEASE' + id 'dd-trace-java.smoke-test-app' } apply from: "$rootDir/gradle/java.gradle" -apply from: "$rootDir/gradle/spring-boot-plugin.gradle" + description = 'Open Feature provider Smoke Tests.' testJvmConstraints { minJavaVersion = JavaVersion.VERSION_11 } -tasks.named("compileJava", JavaCompile) { - configureCompiler(it, 11, JavaVersion.VERSION_11) +smokeTestApp { + gradleApp { + taskName = 'bootJar' + artifactPath = 'libs/openfeature-smoketest.jar' + sysProperty = 'datadog.smoketest.springboot.shadowJar.path' + } + projectJar('featureFlaggingApiJar', project(':products:feature-flagging:feature-flagging-api')) } dependencies { - implementation project(':products:feature-flagging:feature-flagging-api') - implementation 'org.springframework.boot:spring-boot-starter-web' - testImplementation project(':dd-smoke-tests') testImplementation project(':products:feature-flagging:feature-flagging-lib') } -tasks.withType(Test).configureEach { - dependsOn "bootJar" - def bootJarTask = tasks.named('bootJar', BootJar) - jvmArgumentProviders.add(new CommandLineArgumentProvider() { - @Override - Iterable asArguments() { - return bootJarTask.map { ["-Ddatadog.smoketest.springboot.shadowJar.path=${it.archiveFile.get()}"] }.get() - } - }) +spotless { + java { + target "**/*.java" + } + + groovyGradle { + target '*.gradle', "**/*.gradle" + } } diff --git a/dd-smoke-tests/openfeature/gradle.lockfile b/dd-smoke-tests/openfeature/gradle.lockfile index cca8165677d..f741129c6fb 100644 --- a/dd-smoke-tests/openfeature/gradle.lockfile +++ b/dd-smoke-tests/openfeature/gradle.lockfile @@ -1,99 +1,87 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:openfeature:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath -ch.qos.logback:logback-classic:1.2.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.javaparser:javaparser-core:3.25.4=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.javaparser:javaparser-core:3.25.6=codenarc +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath -com.google.code.gson:gson:2.9.1=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.code.gson:gson:2.13.2=spotbugs +com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:logging-interceptor:4.9.3=testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:okhttp:4.9.3=testCompileClasspath,testRuntimeClasspath -com.squareup.okio:okio:2.8.0=testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okio:okio:1.17.5=testCompileClasspath,testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath -dev.openfeature:sdk:1.20.1=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath -jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -javax.servlet:javax.servlet-api:4.0.1=testCompileClasspath,testRuntimeClasspath -jaxen:jaxen:1.2.0=spotbugs +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath +javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath +jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.12.23=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.12.23=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs -org.apache.ant:ant-antlr:1.10.12=codenarc -org.apache.ant:ant-junit:1.10.12=codenarc +org.apache.ant:ant-antlr:1.10.14=codenarc +org.apache.ant:ant-junit:1.10.14=codenarc org.apache.bcel:bcel:6.11.0=spotbugs -org.apache.commons:commons-lang3:3.12.0=spotbugs +org.apache.commons:commons-lang3:3.19.0=spotbugs org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.logging.log4j:log4j-api:2.17.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath -org.apache.logging.log4j:log4j-core:2.17.2=spotbugs -org.apache.logging.log4j:log4j-to-slf4j:2.17.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-core:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-el:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-websocket:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.apache.logging.log4j:log4j-api:2.25.2=spotbugs +org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath -org.codehaus.groovy:groovy-ant:3.0.19=codenarc -org.codehaus.groovy:groovy-docgenerator:3.0.19=codenarc -org.codehaus.groovy:groovy-groovydoc:3.0.19=codenarc -org.codehaus.groovy:groovy-json:3.0.19=codenarc +org.codehaus.groovy:groovy-ant:3.0.23=codenarc +org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc +org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.23=codenarc org.codehaus.groovy:groovy-json:3.0.25=testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-templates:3.0.19=codenarc -org.codehaus.groovy:groovy-xml:3.0.19=codenarc -org.codehaus.groovy:groovy:3.0.19=codenarc +org.codehaus.groovy:groovy-templates:3.0.23=codenarc +org.codehaus.groovy:groovy-xml:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc -org.hamcrest:hamcrest-core:2.2=testRuntimeClasspath -org.hamcrest:hamcrest:2.2=testCompileClasspath,testRuntimeClasspath +org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath +org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains:annotations:13.0=testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter:5.8.2=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath @@ -114,34 +102,18 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:jul-to-slf4j:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,spotbugs,spotbugsSlf4j,testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.snakeyaml:snakeyaml-engine:2.9=testRuntimeClasspath org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-autoconfigure:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-json:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-logging:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-tomcat:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-web:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-aop:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-beans:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-context:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-core:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-expression:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-jcl:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-web:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-webmvc:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -org.yaml:snakeyaml:1.30=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -empty=annotationProcessor,developmentOnly,spotbugsPlugins,testAnnotationProcessor +empty=annotationProcessor,runtimeClasspath,smokeTestAppExtraJarFeatureFlaggingApiJar,spotbugsPlugins,testAnnotationProcessor diff --git a/dd-smoke-tests/openfeature/src/test/groovy/datadog/smoketest/springboot/OpenFeatureProviderSmokeTest.groovy b/dd-smoke-tests/openfeature/src/test/groovy/datadog/smoketest/springboot/OpenFeatureProviderSmokeTest.groovy index 656bbf4b77e..cb4c641d667 100644 --- a/dd-smoke-tests/openfeature/src/test/groovy/datadog/smoketest/springboot/OpenFeatureProviderSmokeTest.groovy +++ b/dd-smoke-tests/openfeature/src/test/groovy/datadog/smoketest/springboot/OpenFeatureProviderSmokeTest.groovy @@ -21,9 +21,13 @@ import spock.util.concurrent.PollingConditions class OpenFeatureProviderSmokeTest extends AbstractServerSmokeTest { @Shared - private final rcPayload = new JsonSlurper().parse(fetchResource("config/flags-v1.json")).with { json -> - return JsonOutput.toJson(json.data.attributes) - } + private final rcConfig = new JsonSlurper().parse(fetchResource("ffe-system-test-data/ufc-config.json")) as Map + + @Shared + private final rcPayload = JsonOutput.toJson(rcConfig) + + @Shared + private final loggedAllocations = buildLoggedAllocations(rcConfig) @Override ProcessBuilder createProcessBuilder() { @@ -51,14 +55,18 @@ class OpenFeatureProviderSmokeTest extends AbstractServerSmokeTest { } } - void 'test remote config'() { + void 'test first remote config poll asks agent for feature flags'() { when: - final rcRequest = waitForRcClientRequest { req -> - decodeProducts(req).find { it == Product.FFE_FLAGS } != null + final firstRcRequest = waitForRcClientRequest { req -> + return true } then: - final capabilities = decodeCapabilities(rcRequest) + firstRcRequest == rcClientMessages.first() + // An already-running Agent gives a newly-started tracer one new-client cache bypass. If + // FFE_FLAGS is missing here and only appears on a later poll, the Agent can miss the fast path. + decodeProducts(firstRcRequest).find { it == Product.FFE_FLAGS } != null + final capabilities = decodeCapabilities(firstRcRequest) hasCapability(capabilities, Capabilities.CAPABILITY_FFE_FLAG_CONFIGURATION_RULES) } @@ -66,34 +74,40 @@ class OpenFeatureProviderSmokeTest extends AbstractServerSmokeTest { setup: setRemoteConfig("datadog/2/FFE_FLAGS/1/config", rcPayload) final url = "http://localhost:${httpPort}/openfeature/evaluate" - final testCases = parseTestCases().findAll { - it.result.flagMetadata?.doLog - } + final testCases = parseTestCases() + assert !testCases.isEmpty() when: - final responses = testCases.collect { + final results = testCases.collect { testCase -> final request = new Request.Builder() .url(url) .post(RequestBody.create(MediaType.parse('application/json'), JsonOutput.toJson(testCase))) .build() - client.newCall(request).execute() + final response = client.newCall(request).execute() + final responseBody = new JsonSlurper().parse(response.body().byteStream()) + return [testCase: testCase, response: response, body: responseBody] } + final expectedExposures = uniqueExpectedExposures(results) then: - responses.every { - it.code() == 200 + results.every { + it.response.code() == 200 } + !expectedExposures.isEmpty() new PollingConditions(timeout: 10).eventually { final requests = evpProxyMessages*.getV2() as List> final events = requests*.exposures.flatten() - assert events.size() == testCases.size() - testCases.each { - testCase -> + assert events.size() == expectedExposures.size() + expectedExposures.each { + expected -> assert events.find { event -> - event.flag.key == testCase.flag && event.subject.id == testCase.targetingKey - } != null : "Unable to find exposure with flag=${testCase.flag} and targetingKey=${testCase.targetingKey}" + event.flag.key == expected.flag && + event.allocation.key == expected.allocation && + event.variant.key == expected.variant && + event.subject.id == expected.targetingKey + } != null : "Unable to find exposure ${expected}" } } } @@ -115,8 +129,16 @@ class OpenFeatureProviderSmokeTest extends AbstractServerSmokeTest { response.code() == 200 final responseBody = new JsonSlurper().parse(response.body().byteStream()) responseBody.value == testCase.result.value - responseBody.variant == testCase.result.variant - responseBody.flagMetadata?.allocationKey == testCase.result.flagMetadata?.allocationKey + responseBody.reason == testCase.result.reason + if (testCase.result.containsKey('errorCode')) { + assert responseBody.errorCode == testCase.result.errorCode + } + if (testCase.result.containsKey('variant')) { + assert responseBody.variant == testCase.result.variant + } + if (testCase.result.flagMetadata?.allocationKey) { + assert responseBody.flagMetadata?.allocationKey == testCase.result.flagMetadata?.allocationKey + } where: testCase << parseTestCases() @@ -127,11 +149,12 @@ class OpenFeatureProviderSmokeTest extends AbstractServerSmokeTest { } private static List> parseTestCases() { - final folder = fetchResource('data') + final folder = fetchResource('ffe-system-test-data/evaluation-cases') final uri = folder.toURI() final testsPath = Paths.get(uri) final files = Files.list(testsPath) .filter(path -> path.toString().endsWith('.json')) + .sorted(Comparator.comparing(path -> path.fileName.toString())) final result = [] final slurper = new JsonSlurper() files.each { @@ -144,9 +167,51 @@ class OpenFeatureProviderSmokeTest extends AbstractServerSmokeTest { } result.addAll(testCases) } + assert !result.isEmpty() return result } + private List> uniqueExpectedExposures(final List> results) { + final expected = [] + final seen = [] as Set + results.each { result -> + final testCase = result.testCase as Map + final body = result.body as Map + final flag = testCase.flag as String + final allocation = body.flagMetadata?.allocationKey as String + final variant = body.variant as String + if (!variant || !allocation || !allocationLogs(flag, allocation)) { + return + } + + final exposure = [ + flag: flag, + allocation: allocation, + variant: variant, + targetingKey: testCase.targetingKey + ] + final key = "${exposure.flag}\u0000${exposure.targetingKey}\u0000${exposure.allocation}\u0000${exposure.variant}" + if (seen.add(key)) { + expected.add(exposure) + } + } + return expected + } + + private boolean allocationLogs(final String flag, final String allocation) { + return loggedAllocations["${flag}\u0000${allocation}"] == true + } + + private static Map buildLoggedAllocations(final Map config) { + final logged = [:] + (config.flags as Map).each { flag, definition -> + (definition.allocations ?: []).each { allocation -> + logged["${flag}\u0000${allocation.key}"] = allocation.doLog == true + } + } + return logged + } + private static Set decodeProducts(final Map request) { return request.client.products.collect { Product.valueOf(it) } } diff --git a/dd-smoke-tests/openfeature/src/test/resources/config/flags-v1.json b/dd-smoke-tests/openfeature/src/test/resources/config/flags-v1.json deleted file mode 100644 index 5b21a9f3661..00000000000 --- a/dd-smoke-tests/openfeature/src/test/resources/config/flags-v1.json +++ /dev/null @@ -1,2953 +0,0 @@ -{ - "data": { - "type": "universal-flag-configuration", - "id": "1", - "attributes": { - "createdAt": "2024-04-17T19:40:53.716Z", - "format": "SERVER", - "environment": { - "name": "Test" - }, - "flags": { - "empty_flag": { - "key": "empty_flag", - "enabled": true, - "variationType": "STRING", - "variations": {}, - "allocations": [] - }, - "disabled_flag": { - "key": "disabled_flag", - "enabled": false, - "variationType": "INTEGER", - "variations": {}, - "allocations": [] - }, - "no_allocations_flag": { - "key": "no_allocations_flag", - "enabled": true, - "variationType": "JSON", - "variations": { - "control": { - "key": "control", - "value": { "variant": "control" } - }, - "treatment": { - "key": "treatment", - "value": { "variant": "treatment" } - } - }, - "allocations": [] - }, - "numeric_flag": { - "key": "numeric_flag", - "enabled": true, - "variationType": "NUMERIC", - "variations": { - "e": { - "key": "e", - "value": 2.7182818 - }, - "pi": { - "key": "pi", - "value": 3.1415926 - } - }, - "allocations": [ - { - "key": "rollout", - "splits": [ - { - "variationKey": "pi", - "shards": [] - } - ], - "doLog": true - } - ] - }, - "regex-flag": { - "key": "regex-flag", - "enabled": true, - "variationType": "STRING", - "variations": { - "partial-example": { - "key": "partial-example", - "value": "partial-example" - }, - "test": { - "key": "test", - "value": "test" - } - }, - "allocations": [ - { - "key": "partial-example", - "rules": [ - { - "conditions": [ - { - "attribute": "email", - "operator": "MATCHES", - "value": "@example\\.com" - } - ] - } - ], - "splits": [ - { - "variationKey": "partial-example", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "test", - "rules": [ - { - "conditions": [ - { - "attribute": "email", - "operator": "MATCHES", - "value": ".*@test\\.com" - } - ] - } - ], - "splits": [ - { - "variationKey": "test", - "shards": [] - } - ], - "doLog": true - } - ] - }, - "numeric-one-of": { - "key": "numeric-one-of", - "enabled": true, - "variationType": "INTEGER", - "variations": { - "1": { - "key": "1", - "value": 1 - }, - "2": { - "key": "2", - "value": 2 - }, - "3": { - "key": "3", - "value": 3 - } - }, - "allocations": [ - { - "key": "1-for-1", - "rules": [ - { - "conditions": [ - { - "attribute": "number", - "operator": "ONE_OF", - "value": ["1"] - } - ] - } - ], - "splits": [ - { - "variationKey": "1", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "2-for-123456789", - "rules": [ - { - "conditions": [ - { - "attribute": "number", - "operator": "ONE_OF", - "value": ["123456789"] - } - ] - } - ], - "splits": [ - { - "variationKey": "2", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "3-for-not-2", - "rules": [ - { - "conditions": [ - { - "attribute": "number", - "operator": "NOT_ONE_OF", - "value": ["2"] - } - ] - } - ], - "splits": [ - { - "variationKey": "3", - "shards": [] - } - ], - "doLog": true - } - ] - }, - "boolean-one-of-matches": { - "key": "boolean-one-of-matches", - "enabled": true, - "variationType": "INTEGER", - "variations": { - "1": { - "key": "1", - "value": 1 - }, - "2": { - "key": "2", - "value": 2 - }, - "3": { - "key": "3", - "value": 3 - }, - "4": { - "key": "4", - "value": 4 - }, - "5": { - "key": "5", - "value": 5 - } - }, - "allocations": [ - { - "key": "1-for-one-of", - "rules": [ - { - "conditions": [ - { - "attribute": "one_of_flag", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "1", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "2-for-matches", - "rules": [ - { - "conditions": [ - { - "attribute": "matches_flag", - "operator": "MATCHES", - "value": "true" - } - ] - } - ], - "splits": [ - { - "variationKey": "2", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "3-for-not-one-of", - "rules": [ - { - "conditions": [ - { - "attribute": "not_one_of_flag", - "operator": "NOT_ONE_OF", - "value": ["false"] - } - ] - } - ], - "splits": [ - { - "variationKey": "3", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "4-for-not-matches", - "rules": [ - { - "conditions": [ - { - "attribute": "not_matches_flag", - "operator": "NOT_MATCHES", - "value": "false" - } - ] - } - ], - "splits": [ - { - "variationKey": "4", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "5-for-matches-null", - "rules": [ - { - "conditions": [ - { - "attribute": "null_flag", - "operator": "ONE_OF", - "value": ["null"] - } - ] - } - ], - "splits": [ - { - "variationKey": "5", - "shards": [] - } - ], - "doLog": true - } - ] - }, - "empty_string_flag": { - "key": "empty_string_flag", - "enabled": true, - "comment": "Testing the empty string as a variation value", - "variationType": "STRING", - "variations": { - "empty_string": { - "key": "empty_string", - "value": "" - }, - "non_empty": { - "key": "non_empty", - "value": "non_empty" - } - }, - "allocations": [ - { - "key": "allocation-empty", - "rules": [ - { - "conditions": [ - { - "attribute": "country", - "operator": "MATCHES", - "value": "US" - } - ] - } - ], - "splits": [ - { - "variationKey": "empty_string", - "shards": [ - { - "salt": "allocation-empty-shards", - "totalShards": 10000, - "ranges": [ - { - "start": 0, - "end": 10000 - } - ] - } - ] - } - ], - "doLog": true - }, - { - "key": "allocation-test", - "rules": [], - "splits": [ - { - "variationKey": "non_empty", - "shards": [ - { - "salt": "allocation-empty-shards", - "totalShards": 10000, - "ranges": [ - { - "start": 0, - "end": 10000 - } - ] - } - ] - } - ], - "doLog": true - } - ] - }, - "kill-switch": { - "key": "kill-switch", - "enabled": true, - "variationType": "BOOLEAN", - "variations": { - "on": { - "key": "on", - "value": true - }, - "off": { - "key": "off", - "value": false - } - }, - "allocations": [ - { - "key": "on-for-NA", - "rules": [ - { - "conditions": [ - { - "attribute": "country", - "operator": "ONE_OF", - "value": ["US", "Canada", "Mexico"] - } - ] - } - ], - "splits": [ - { - "variationKey": "on", - "shards": [ - { - "salt": "some-salt", - "totalShards": 10000, - "ranges": [ - { - "start": 0, - "end": 10000 - } - ] - } - ] - } - ], - "doLog": true - }, - { - "key": "on-for-age-50+", - "rules": [ - { - "conditions": [ - { - "attribute": "age", - "operator": "GTE", - "value": 50 - } - ] - } - ], - "splits": [ - { - "variationKey": "on", - "shards": [ - { - "salt": "some-salt", - "totalShards": 10000, - "ranges": [ - { - "start": 0, - "end": 10000 - } - ] - } - ] - } - ], - "doLog": true - }, - { - "key": "off-for-all", - "rules": [], - "splits": [ - { - "variationKey": "off", - "shards": [] - } - ], - "doLog": true - } - ] - }, - "comparator-operator-test": { - "key": "comparator-operator-test", - "enabled": true, - "variationType": "STRING", - "variations": { - "small": { - "key": "small", - "value": "small" - }, - "medium": { - "key": "medium", - "value": "medium" - }, - "large": { - "key": "large", - "value": "large" - } - }, - "allocations": [ - { - "key": "small-size", - "rules": [ - { - "conditions": [ - { - "attribute": "size", - "operator": "LT", - "value": 10 - } - ] - } - ], - "splits": [ - { - "variationKey": "small", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "medum-size", - "rules": [ - { - "conditions": [ - { - "attribute": "size", - "operator": "GTE", - "value": 10 - }, - { - "attribute": "size", - "operator": "LTE", - "value": 20 - } - ] - } - ], - "splits": [ - { - "variationKey": "medium", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "large-size", - "rules": [ - { - "conditions": [ - { - "attribute": "size", - "operator": "GT", - "value": 25 - } - ] - } - ], - "splits": [ - { - "variationKey": "large", - "shards": [] - } - ], - "doLog": true - } - ] - }, - "start-and-end-date-test": { - "key": "start-and-end-date-test", - "enabled": true, - "variationType": "STRING", - "variations": { - "old": { - "key": "old", - "value": "old" - }, - "current": { - "key": "current", - "value": "current" - }, - "new": { - "key": "new", - "value": "new" - } - }, - "allocations": [ - { - "key": "old-versions", - "splits": [ - { - "variationKey": "old", - "shards": [] - } - ], - "endAt": "2002-10-31T09:00:00.594Z", - "doLog": true - }, - { - "key": "future-versions", - "splits": [ - { - "variationKey": "new", - "shards": [] - } - ], - "startAt": "2052-10-31T09:00:00.594Z", - "doLog": true - }, - { - "key": "current-versions", - "splits": [ - { - "variationKey": "current", - "shards": [] - } - ], - "startAt": "2022-10-31T09:00:00.594Z", - "endAt": "2050-10-31T09:00:00.594Z", - "doLog": true - } - ] - }, - "null-operator-test": { - "key": "null-operator-test", - "enabled": true, - "variationType": "STRING", - "variations": { - "old": { - "key": "old", - "value": "old" - }, - "new": { - "key": "new", - "value": "new" - } - }, - "allocations": [ - { - "key": "null-operator", - "rules": [ - { - "conditions": [ - { - "attribute": "size", - "operator": "IS_NULL", - "value": true - } - ] - }, - { - "conditions": [ - { - "attribute": "size", - "operator": "LT", - "value": 10 - } - ] - } - ], - "splits": [ - { - "variationKey": "old", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "not-null-operator", - "rules": [ - { - "conditions": [ - { - "attribute": "size", - "operator": "IS_NULL", - "value": false - } - ] - } - ], - "splits": [ - { - "variationKey": "new", - "shards": [] - } - ], - "doLog": true - } - ] - }, - "new-user-onboarding": { - "key": "new-user-onboarding", - "enabled": true, - "variationType": "STRING", - "variations": { - "control": { - "key": "control", - "value": "control" - }, - "red": { - "key": "red", - "value": "red" - }, - "blue": { - "key": "blue", - "value": "blue" - }, - "green": { - "key": "green", - "value": "green" - }, - "yellow": { - "key": "yellow", - "value": "yellow" - }, - "purple": { - "key": "purple", - "value": "purple" - } - }, - "allocations": [ - { - "key": "id rule", - "rules": [ - { - "conditions": [ - { - "attribute": "id", - "operator": "MATCHES", - "value": "zach" - } - ] - } - ], - "splits": [ - { - "variationKey": "purple", - "shards": [] - } - ], - "doLog": false - }, - { - "key": "internal users", - "rules": [ - { - "conditions": [ - { - "attribute": "email", - "operator": "MATCHES", - "value": "@mycompany.com" - } - ] - } - ], - "splits": [ - { - "variationKey": "green", - "shards": [] - } - ], - "doLog": false - }, - { - "key": "experiment", - "rules": [ - { - "conditions": [ - { - "attribute": "country", - "operator": "NOT_ONE_OF", - "value": ["US", "Canada", "Mexico"] - } - ] - } - ], - "splits": [ - { - "variationKey": "control", - "shards": [ - { - "salt": "traffic-new-user-onboarding-experiment", - "totalShards": 10000, - "ranges": [ - { - "start": 0, - "end": 6000 - } - ] - }, - { - "salt": "split-new-user-onboarding-experiment", - "totalShards": 10000, - "ranges": [ - { - "start": 0, - "end": 5000 - } - ] - } - ] - }, - { - "variationKey": "red", - "shards": [ - { - "salt": "traffic-new-user-onboarding-experiment", - "totalShards": 10000, - "ranges": [ - { - "start": 0, - "end": 6000 - } - ] - }, - { - "salt": "split-new-user-onboarding-experiment", - "totalShards": 10000, - "ranges": [ - { - "start": 5000, - "end": 8000 - } - ] - } - ] - }, - { - "variationKey": "yellow", - "shards": [ - { - "salt": "traffic-new-user-onboarding-experiment", - "totalShards": 10000, - "ranges": [ - { - "start": 0, - "end": 6000 - } - ] - }, - { - "salt": "split-new-user-onboarding-experiment", - "totalShards": 10000, - "ranges": [ - { - "start": 8000, - "end": 10000 - } - ] - } - ] - } - ], - "doLog": true - }, - { - "key": "rollout", - "rules": [ - { - "conditions": [ - { - "attribute": "country", - "operator": "ONE_OF", - "value": ["US", "Canada", "Mexico"] - } - ] - } - ], - "splits": [ - { - "variationKey": "blue", - "shards": [ - { - "salt": "split-new-user-onboarding-rollout", - "totalShards": 10000, - "ranges": [ - { - "start": 0, - "end": 8000 - } - ] - } - ], - "extraLogging": { - "allocationvalue_type": "rollout", - "owner": "hippo" - } - } - ], - "doLog": true - } - ] - }, - "integer-flag": { - "key": "integer-flag", - "enabled": true, - "variationType": "INTEGER", - "variations": { - "one": { - "key": "one", - "value": 1 - }, - "two": { - "key": "two", - "value": 2 - }, - "three": { - "key": "three", - "value": 3 - } - }, - "allocations": [ - { - "key": "targeted allocation", - "rules": [ - { - "conditions": [ - { - "attribute": "country", - "operator": "ONE_OF", - "value": ["US", "Canada", "Mexico"] - } - ] - }, - { - "conditions": [ - { - "attribute": "email", - "operator": "MATCHES", - "value": ".*@example.com" - } - ] - } - ], - "splits": [ - { - "variationKey": "three", - "shards": [ - { - "salt": "full-range-salt", - "totalShards": 10000, - "ranges": [ - { - "start": 0, - "end": 10000 - } - ] - } - ] - } - ], - "doLog": true - }, - { - "key": "50/50 split", - "rules": [], - "splits": [ - { - "variationKey": "one", - "shards": [ - { - "salt": "split-numeric-flag-some-allocation", - "totalShards": 10000, - "ranges": [ - { - "start": 0, - "end": 5000 - } - ] - } - ] - }, - { - "variationKey": "two", - "shards": [ - { - "salt": "split-numeric-flag-some-allocation", - "totalShards": 10000, - "ranges": [ - { - "start": 5000, - "end": 10000 - } - ] - } - ] - } - ], - "doLog": true - } - ] - }, - "json-config-flag": { - "key": "json-config-flag", - "enabled": true, - "variationType": "JSON", - "variations": { - "one": { - "key": "one", - "value": { "integer": 1, "string": "one", "float": 1.0 } - }, - "two": { - "key": "two", - "value": { "integer": 2, "string": "two", "float": 2.0 } - }, - "empty": { - "key": "empty", - "value": {} - } - }, - "allocations": [ - { - "key": "Optionally Force Empty", - "rules": [ - { - "conditions": [ - { - "attribute": "Force Empty", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "empty", - "shards": [ - { - "salt": "full-range-salt", - "totalShards": 10000, - "ranges": [ - { - "start": 0, - "end": 10000 - } - ] - } - ] - } - ], - "doLog": true - }, - { - "key": "50/50 split", - "rules": [], - "splits": [ - { - "variationKey": "one", - "shards": [ - { - "salt": "traffic-json-flag", - "totalShards": 10000, - "ranges": [ - { - "start": 0, - "end": 10000 - } - ] - }, - { - "salt": "split-json-flag", - "totalShards": 10000, - "ranges": [ - { - "start": 0, - "end": 5000 - } - ] - } - ] - }, - { - "variationKey": "two", - "shards": [ - { - "salt": "traffic-json-flag", - "totalShards": 10000, - "ranges": [ - { - "start": 0, - "end": 10000 - } - ] - }, - { - "salt": "split-json-flag", - "totalShards": 10000, - "ranges": [ - { - "start": 5000, - "end": 10000 - } - ] - } - ] - } - ], - "doLog": true - } - ] - }, - "special-characters": { - "key": "special-characters", - "enabled": true, - "variationType": "JSON", - "variations": { - "de": { - "key": "de", - "value": { "a": "kümmert", "b": "schön" } - }, - "ua": { - "key": "ua", - "value": { "a": "піклуватися", "b": "любов" } - }, - "zh": { - "key": "zh", - "value": { "a": "照顾", "b": "漂亮" } - }, - "emoji": { - "key": "emoji", - "value": { "a": "🤗", "b": "🌸" } - } - }, - "allocations": [ - { - "key": "allocation-test", - "splits": [ - { - "variationKey": "de", - "shards": [ - { - "salt": "split-json-flag", - "totalShards": 10000, - "ranges": [ - { - "start": 0, - "end": 2500 - } - ] - } - ] - }, - { - "variationKey": "ua", - "shards": [ - { - "salt": "split-json-flag", - "totalShards": 10000, - "ranges": [ - { - "start": 2500, - "end": 5000 - } - ] - } - ] - }, - { - "variationKey": "zh", - "shards": [ - { - "salt": "split-json-flag", - "totalShards": 10000, - "ranges": [ - { - "start": 5000, - "end": 7500 - } - ] - } - ] - }, - { - "variationKey": "emoji", - "shards": [ - { - "salt": "split-json-flag", - "totalShards": 10000, - "ranges": [ - { - "start": 7500, - "end": 10000 - } - ] - } - ] - } - ], - "doLog": true - }, - { - "key": "allocation-default", - "splits": [ - { - "variationKey": "de", - "shards": [] - } - ], - "doLog": false - } - ] - }, - "string_flag_with_special_characters": { - "key": "string_flag_with_special_characters", - "enabled": true, - "comment": "Testing the string with special characters and spaces", - "variationType": "STRING", - "variations": { - "string_with_spaces": { - "key": "string_with_spaces", - "value": " a b c d e f " - }, - "string_with_only_one_space": { - "key": "string_with_only_one_space", - "value": " " - }, - "string_with_only_multiple_spaces": { - "key": "string_with_only_multiple_spaces", - "value": " " - }, - "string_with_dots": { - "key": "string_with_dots", - "value": ".a.b.c.d.e.f." - }, - "string_with_only_one_dot": { - "key": "string_with_only_one_dot", - "value": "." - }, - "string_with_only_multiple_dots": { - "key": "string_with_only_multiple_dots", - "value": "......." - }, - "string_with_comas": { - "key": "string_with_comas", - "value": ",a,b,c,d,e,f," - }, - "string_with_only_one_coma": { - "key": "string_with_only_one_coma", - "value": "," - }, - "string_with_only_multiple_comas": { - "key": "string_with_only_multiple_comas", - "value": ",,,,,,," - }, - "string_with_colons": { - "key": "string_with_colons", - "value": ":a:b:c:d:e:f:" - }, - "string_with_only_one_colon": { - "key": "string_with_only_one_colon", - "value": ":" - }, - "string_with_only_multiple_colons": { - "key": "string_with_only_multiple_colons", - "value": ":::::::" - }, - "string_with_semicolons": { - "key": "string_with_semicolons", - "value": ";a;b;c;d;e;f;" - }, - "string_with_only_one_semicolon": { - "key": "string_with_only_one_semicolon", - "value": ";" - }, - "string_with_only_multiple_semicolons": { - "key": "string_with_only_multiple_semicolons", - "value": ";;;;;;;" - }, - "string_with_slashes": { - "key": "string_with_slashes", - "value": "/a/b/c/d/e/f/" - }, - "string_with_only_one_slash": { - "key": "string_with_only_one_slash", - "value": "/" - }, - "string_with_only_multiple_slashes": { - "key": "string_with_only_multiple_slashes", - "value": "///////" - }, - "string_with_dashes": { - "key": "string_with_dashes", - "value": "-a-b-c-d-e-f-" - }, - "string_with_only_one_dash": { - "key": "string_with_only_one_dash", - "value": "-" - }, - "string_with_only_multiple_dashes": { - "key": "string_with_only_multiple_dashes", - "value": "-------" - }, - "string_with_underscores": { - "key": "string_with_underscores", - "value": "_a_b_c_d_e_f_" - }, - "string_with_only_one_underscore": { - "key": "string_with_only_one_underscore", - "value": "_" - }, - "string_with_only_multiple_underscores": { - "key": "string_with_only_multiple_underscores", - "value": "_______" - }, - "string_with_plus_signs": { - "key": "string_with_plus_signs", - "value": "+a+b+c+d+e+f+" - }, - "string_with_only_one_plus_sign": { - "key": "string_with_only_one_plus_sign", - "value": "+" - }, - "string_with_only_multiple_plus_signs": { - "key": "string_with_only_multiple_plus_signs", - "value": "+++++++" - }, - "string_with_equal_signs": { - "key": "string_with_equal_signs", - "value": "=a=b=c=d=e=f=" - }, - "string_with_only_one_equal_sign": { - "key": "string_with_only_one_equal_sign", - "value": "=" - }, - "string_with_only_multiple_equal_signs": { - "key": "string_with_only_multiple_equal_signs", - "value": "=======" - }, - "string_with_dollar_signs": { - "key": "string_with_dollar_signs", - "value": "$a$b$c$d$e$f$" - }, - "string_with_only_one_dollar_sign": { - "key": "string_with_only_one_dollar_sign", - "value": "$" - }, - "string_with_only_multiple_dollar_signs": { - "key": "string_with_only_multiple_dollar_signs", - "value": "$$$$$$$" - }, - "string_with_at_signs": { - "key": "string_with_at_signs", - "value": "@a@b@c@d@e@f@" - }, - "string_with_only_one_at_sign": { - "key": "string_with_only_one_at_sign", - "value": "@" - }, - "string_with_only_multiple_at_signs": { - "key": "string_with_only_multiple_at_signs", - "value": "@@@@@@@" - }, - "string_with_amp_signs": { - "key": "string_with_amp_signs", - "value": "&a&b&c&d&e&f&" - }, - "string_with_only_one_amp_sign": { - "key": "string_with_only_one_amp_sign", - "value": "&" - }, - "string_with_only_multiple_amp_signs": { - "key": "string_with_only_multiple_amp_signs", - "value": "&&&&&&&" - }, - "string_with_hash_signs": { - "key": "string_with_hash_signs", - "value": "#a#b#c#d#e#f#" - }, - "string_with_only_one_hash_sign": { - "key": "string_with_only_one_hash_sign", - "value": "#" - }, - "string_with_only_multiple_hash_signs": { - "key": "string_with_only_multiple_hash_signs", - "value": "#######" - }, - "string_with_percentage_signs": { - "key": "string_with_percentage_signs", - "value": "%a%b%c%d%e%f%" - }, - "string_with_only_one_percentage_sign": { - "key": "string_with_only_one_percentage_sign", - "value": "%" - }, - "string_with_only_multiple_percentage_signs": { - "key": "string_with_only_multiple_percentage_signs", - "value": "%%%%%%%" - }, - "string_with_tilde_signs": { - "key": "string_with_tilde_signs", - "value": "~a~b~c~d~e~f~" - }, - "string_with_only_one_tilde_sign": { - "key": "string_with_only_one_tilde_sign", - "value": "~" - }, - "string_with_only_multiple_tilde_signs": { - "key": "string_with_only_multiple_tilde_signs", - "value": "~~~~~~~" - }, - "string_with_asterix_signs": { - "key": "string_with_asterix_signs", - "value": "*a*b*c*d*e*f*" - }, - "string_with_only_one_asterix_sign": { - "key": "string_with_only_one_asterix_sign", - "value": "*" - }, - "string_with_only_multiple_asterix_signs": { - "key": "string_with_only_multiple_asterix_signs", - "value": "*******" - }, - "string_with_single_quotes": { - "key": "string_with_single_quotes", - "value": "'a'b'c'd'e'f'" - }, - "string_with_only_one_single_quote": { - "key": "string_with_only_one_single_quote", - "value": "'" - }, - "string_with_only_multiple_single_quotes": { - "key": "string_with_only_multiple_single_quotes", - "value": "'''''''" - }, - "string_with_question_marks": { - "key": "string_with_question_marks", - "value": "?a?b?c?d?e?f?" - }, - "string_with_only_one_question_mark": { - "key": "string_with_only_one_question_mark", - "value": "?" - }, - "string_with_only_multiple_question_marks": { - "key": "string_with_only_multiple_question_marks", - "value": "???????" - }, - "string_with_exclamation_marks": { - "key": "string_with_exclamation_marks", - "value": "!a!b!c!d!e!f!" - }, - "string_with_only_one_exclamation_mark": { - "key": "string_with_only_one_exclamation_mark", - "value": "!" - }, - "string_with_only_multiple_exclamation_marks": { - "key": "string_with_only_multiple_exclamation_marks", - "value": "!!!!!!!" - }, - "string_with_opening_parentheses": { - "key": "string_with_opening_parentheses", - "value": "(a(b(c(d(e(f(" - }, - "string_with_only_one_opening_parenthese": { - "key": "string_with_only_one_opening_parenthese", - "value": "(" - }, - "string_with_only_multiple_opening_parentheses": { - "key": "string_with_only_multiple_opening_parentheses", - "value": "(((((((" - }, - "string_with_closing_parentheses": { - "key": "string_with_closing_parentheses", - "value": ")a)b)c)d)e)f)" - }, - "string_with_only_one_closing_parenthese": { - "key": "string_with_only_one_closing_parenthese", - "value": ")" - }, - "string_with_only_multiple_closing_parentheses": { - "key": "string_with_only_multiple_closing_parentheses", - "value": ")))))))" - } - }, - "allocations": [ - { - "key": "allocation-test-string_with_spaces", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_spaces", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_spaces", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_one_space", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_one_space", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_one_space", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_multiple_spaces", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_multiple_spaces", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_multiple_spaces", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_dots", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_dots", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_dots", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_one_dot", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_one_dot", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_one_dot", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_multiple_dots", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_multiple_dots", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_multiple_dots", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_comas", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_comas", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_comas", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_one_coma", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_one_coma", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_one_coma", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_multiple_comas", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_multiple_comas", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_multiple_comas", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_colons", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_colons", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_colons", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_one_colon", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_one_colon", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_one_colon", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_multiple_colons", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_multiple_colons", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_multiple_colons", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_semicolons", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_semicolons", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_semicolons", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_one_semicolon", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_one_semicolon", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_one_semicolon", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_multiple_semicolons", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_multiple_semicolons", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_multiple_semicolons", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_slashes", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_slashes", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_slashes", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_one_slash", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_one_slash", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_one_slash", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_multiple_slashes", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_multiple_slashes", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_multiple_slashes", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_dashes", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_dashes", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_dashes", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_one_dash", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_one_dash", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_one_dash", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_multiple_dashes", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_multiple_dashes", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_multiple_dashes", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_underscores", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_underscores", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_underscores", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_one_underscore", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_one_underscore", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_one_underscore", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_multiple_underscores", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_multiple_underscores", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_multiple_underscores", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_plus_signs", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_plus_signs", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_plus_signs", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_one_plus_sign", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_one_plus_sign", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_one_plus_sign", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_multiple_plus_signs", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_multiple_plus_signs", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_multiple_plus_signs", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_equal_signs", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_equal_signs", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_equal_signs", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_one_equal_sign", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_one_equal_sign", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_one_equal_sign", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_multiple_equal_signs", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_multiple_equal_signs", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_multiple_equal_signs", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_dollar_signs", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_dollar_signs", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_dollar_signs", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_one_dollar_sign", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_one_dollar_sign", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_one_dollar_sign", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_multiple_dollar_signs", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_multiple_dollar_signs", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_multiple_dollar_signs", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_at_signs", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_at_signs", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_at_signs", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_one_at_sign", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_one_at_sign", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_one_at_sign", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_multiple_at_signs", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_multiple_at_signs", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_multiple_at_signs", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_amp_signs", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_amp_signs", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_amp_signs", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_one_amp_sign", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_one_amp_sign", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_one_amp_sign", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_multiple_amp_signs", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_multiple_amp_signs", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_multiple_amp_signs", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_hash_signs", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_hash_signs", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_hash_signs", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_one_hash_sign", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_one_hash_sign", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_one_hash_sign", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_multiple_hash_signs", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_multiple_hash_signs", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_multiple_hash_signs", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_percentage_signs", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_percentage_signs", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_percentage_signs", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_one_percentage_sign", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_one_percentage_sign", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_one_percentage_sign", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_multiple_percentage_signs", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_multiple_percentage_signs", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_multiple_percentage_signs", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_tilde_signs", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_tilde_signs", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_tilde_signs", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_one_tilde_sign", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_one_tilde_sign", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_one_tilde_sign", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_multiple_tilde_signs", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_multiple_tilde_signs", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_multiple_tilde_signs", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_asterix_signs", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_asterix_signs", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_asterix_signs", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_one_asterix_sign", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_one_asterix_sign", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_one_asterix_sign", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_multiple_asterix_signs", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_multiple_asterix_signs", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_multiple_asterix_signs", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_single_quotes", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_single_quotes", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_single_quotes", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_one_single_quote", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_one_single_quote", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_one_single_quote", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_multiple_single_quotes", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_multiple_single_quotes", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_multiple_single_quotes", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_question_marks", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_question_marks", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_question_marks", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_one_question_mark", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_one_question_mark", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_one_question_mark", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_multiple_question_marks", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_multiple_question_marks", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_multiple_question_marks", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_exclamation_marks", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_exclamation_marks", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_exclamation_marks", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_one_exclamation_mark", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_one_exclamation_mark", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_one_exclamation_mark", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_multiple_exclamation_marks", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_multiple_exclamation_marks", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_multiple_exclamation_marks", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_opening_parentheses", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_opening_parentheses", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_opening_parentheses", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_one_opening_parenthese", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_one_opening_parenthese", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_one_opening_parenthese", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_multiple_opening_parentheses", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_multiple_opening_parentheses", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_multiple_opening_parentheses", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_closing_parentheses", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_closing_parentheses", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_closing_parentheses", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_one_closing_parenthese", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_one_closing_parenthese", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_one_closing_parenthese", - "shards": [] - } - ], - "doLog": true - }, - { - "key": "allocation-test-string_with_only_multiple_closing_parentheses", - "rules": [ - { - "conditions": [ - { - "attribute": "string_with_only_multiple_closing_parentheses", - "operator": "ONE_OF", - "value": ["true"] - } - ] - } - ], - "splits": [ - { - "variationKey": "string_with_only_multiple_closing_parentheses", - "shards": [] - } - ], - "doLog": true - } - ] - }, - "microsecond-date-test": { - "key": "microsecond-date-test", - "enabled": true, - "variationType": "STRING", - "variations": { - "expired": { - "key": "expired", - "value": "expired" - }, - "active": { - "key": "active", - "value": "active" - }, - "future": { - "key": "future", - "value": "future" - } - }, - "allocations": [ - { - "key": "expired-allocation", - "splits": [ - { - "variationKey": "expired", - "shards": [] - } - ], - "endAt": "2002-10-31T09:00:00.594321Z", - "doLog": true - }, - { - "key": "future-allocation", - "splits": [ - { - "variationKey": "future", - "shards": [] - } - ], - "startAt": "2052-10-31T09:00:00.123456Z", - "doLog": true - }, - { - "key": "active-allocation", - "splits": [ - { - "variationKey": "active", - "shards": [] - } - ], - "startAt": "2022-10-31T09:00:00.235982Z", - "endAt": "2050-10-31T09:00:00.987654Z", - "doLog": true - } - ] - } - } - } - } -} diff --git a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-boolean-one-of-matches.json b/dd-smoke-tests/openfeature/src/test/resources/data/test-case-boolean-one-of-matches.json deleted file mode 100644 index 6bfbf0effad..00000000000 --- a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-boolean-one-of-matches.json +++ /dev/null @@ -1,240 +0,0 @@ -[ - { - "flag": "boolean-one-of-matches", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "alice", - "attributes": { - "one_of_flag": true - }, - "result": { - "value": 1, - "variant": "1", - "flagMetadata": { - "allocationKey": "1-for-one-of", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "boolean-one-of-matches", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "bob", - "attributes": { - "one_of_flag": false - }, - "result": { - "value": 0 - } - }, - { - "flag": "boolean-one-of-matches", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "charlie", - "attributes": { - "one_of_flag": "True" - }, - "result": { - "value": 0 - } - }, - { - "flag": "boolean-one-of-matches", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "derek", - "attributes": { - "matches_flag": true - }, - "result": { - "value": 2, - "variant": "2", - "flagMetadata": { - "allocationKey": "2-for-matches", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "boolean-one-of-matches", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "erica", - "attributes": { - "matches_flag": false - }, - "result": { - "value": 0 - } - }, - { - "flag": "boolean-one-of-matches", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "frank", - "attributes": { - "not_matches_flag": false - }, - "result": { - "value": 0 - } - }, - { - "flag": "boolean-one-of-matches", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "george", - "attributes": { - "not_matches_flag": true - }, - "result": { - "value": 4, - "variant": "4", - "flagMetadata": { - "allocationKey": "4-for-not-matches", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "boolean-one-of-matches", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "haley", - "attributes": { - "not_matches_flag": "False" - }, - "result": { - "value": 4, - "variant": "4", - "flagMetadata": { - "allocationKey": "4-for-not-matches", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "boolean-one-of-matches", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "ivy", - "attributes": { - "not_one_of_flag": true - }, - "result": { - "value": 3, - "variant": "3", - "flagMetadata": { - "allocationKey": "3-for-not-one-of", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "boolean-one-of-matches", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "julia", - "attributes": { - "not_one_of_flag": false - }, - "result": { - "value": 0 - } - }, - { - "flag": "boolean-one-of-matches", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "kim", - "attributes": { - "not_one_of_flag": "False" - }, - "result": { - "value": 3, - "variant": "3", - "flagMetadata": { - "allocationKey": "3-for-not-one-of", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "boolean-one-of-matches", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "lucas", - "attributes": { - "not_one_of_flag": "true" - }, - "result": { - "value": 3, - "variant": "3", - "flagMetadata": { - "allocationKey": "3-for-not-one-of", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "boolean-one-of-matches", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "mike", - "attributes": { - "not_one_of_flag": "false" - }, - "result": { - "value": 0 - } - }, - { - "flag": "boolean-one-of-matches", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "nicole", - "attributes": { - "null_flag": "null" - }, - "result": { - "value": 5, - "variant": "5", - "flagMetadata": { - "allocationKey": "5-for-matches-null", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "boolean-one-of-matches", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "owen", - "attributes": { - "null_flag": null - }, - "result": { - "value": 0 - } - }, - { - "flag": "boolean-one-of-matches", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "pete", - "attributes": {}, - "result": { - "value": 0 - } - } -] diff --git a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-comparator-operator-flag.json b/dd-smoke-tests/openfeature/src/test/resources/data/test-case-comparator-operator-flag.json deleted file mode 100644 index a5c8ef07cd4..00000000000 --- a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-comparator-operator-flag.json +++ /dev/null @@ -1,82 +0,0 @@ -[ - { - "flag": "comparator-operator-test", - "variationType": "STRING", - "defaultValue": "unknown", - "targetingKey": "alice", - "attributes": { - "size": 5, - "country": "US" - }, - "result": { - "value": "small", - "variant": "small", - "flagMetadata": { - "allocationKey": "small-size", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "comparator-operator-test", - "variationType": "STRING", - "defaultValue": "unknown", - "targetingKey": "bob", - "attributes": { - "size": 10, - "country": "Canada" - }, - "result": { - "value": "medium", - "variant": "medium", - "flagMetadata": { - "allocationKey": "medum-size", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "comparator-operator-test", - "variationType": "STRING", - "defaultValue": "unknown", - "targetingKey": "charlie", - "attributes": { - "size": 25 - }, - "result": { - "value": "unknown" - } - }, - { - "flag": "comparator-operator-test", - "variationType": "STRING", - "defaultValue": "unknown", - "targetingKey": "david", - "attributes": { - "size": 26 - }, - "result": { - "value": "large", - "variant": "large", - "flagMetadata": { - "allocationKey": "large-size", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "comparator-operator-test", - "variationType": "STRING", - "defaultValue": "unknown", - "targetingKey": "elize", - "attributes": { - "country": "UK" - }, - "result": { - "value": "unknown" - } - } -] diff --git a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-disabled-flag.json b/dd-smoke-tests/openfeature/src/test/resources/data/test-case-disabled-flag.json deleted file mode 100644 index 0da79189ade..00000000000 --- a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-disabled-flag.json +++ /dev/null @@ -1,40 +0,0 @@ -[ - { - "flag": "disabled_flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "alice", - "attributes": { - "email": "alice@mycompany.com", - "country": "US" - }, - "result": { - "value": 0 - } - }, - { - "flag": "disabled_flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "bob", - "attributes": { - "email": "bob@example.com", - "country": "Canada" - }, - "result": { - "value": 0 - } - }, - { - "flag": "disabled_flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "charlie", - "attributes": { - "age": 50 - }, - "result": { - "value": 0 - } - } -] diff --git a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-empty-flag.json b/dd-smoke-tests/openfeature/src/test/resources/data/test-case-empty-flag.json deleted file mode 100644 index 52100b1fe47..00000000000 --- a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-empty-flag.json +++ /dev/null @@ -1,40 +0,0 @@ -[ - { - "flag": "empty_flag", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "alice", - "attributes": { - "email": "alice@mycompany.com", - "country": "US" - }, - "result": { - "value": "default_value" - } - }, - { - "flag": "empty_flag", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "bob", - "attributes": { - "email": "bob@example.com", - "country": "Canada" - }, - "result": { - "value": "default_value" - } - }, - { - "flag": "empty_flag", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "charlie", - "attributes": { - "age": 50 - }, - "result": { - "value": "default_value" - } - } -] diff --git a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-flag-with-empty-string.json b/dd-smoke-tests/openfeature/src/test/resources/data/test-case-flag-with-empty-string.json deleted file mode 100644 index 32a1c1febb7..00000000000 --- a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-flag-with-empty-string.json +++ /dev/null @@ -1,36 +0,0 @@ -[ - { - "flag": "empty_string_flag", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "alice", - "attributes": { - "country": "US" - }, - "result": { - "value": "", - "variant": "empty_string", - "flagMetadata": { - "allocationKey": "allocation-empty", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "empty_string_flag", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "bob", - "attributes": {}, - "result": { - "value": "non_empty", - "variant": "non_empty", - "flagMetadata": { - "allocationKey": "allocation-test", - "variationType": "string", - "doLog": true - } - } - } -] diff --git a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-integer-flag.json b/dd-smoke-tests/openfeature/src/test/resources/data/test-case-integer-flag.json deleted file mode 100644 index 4a41d042f62..00000000000 --- a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-integer-flag.json +++ /dev/null @@ -1,382 +0,0 @@ -[ - { - "flag": "integer-flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "alice", - "attributes": { - "email": "alice@mycompany.com", - "country": "US" - }, - "result": { - "value": 3, - "variant": "three", - "flagMetadata": { - "allocationKey": "targeted allocation", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "integer-flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "bob", - "attributes": { - "email": "bob@example.com", - "country": "Canada" - }, - "result": { - "value": 3, - "variant": "three", - "flagMetadata": { - "allocationKey": "targeted allocation", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "integer-flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "charlie", - "attributes": { - "age": 50 - }, - "result": { - "value": 2, - "variant": "two", - "flagMetadata": { - "allocationKey": "50/50 split", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "integer-flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "debra", - "attributes": { - "email": "test@test.com", - "country": "Mexico", - "age": 25 - }, - "result": { - "value": 3, - "variant": "three", - "flagMetadata": { - "allocationKey": "targeted allocation", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "integer-flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "1", - "attributes": {}, - "result": { - "value": 2, - "variant": "two", - "flagMetadata": { - "allocationKey": "50/50 split", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "integer-flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "2", - "attributes": {}, - "result": { - "value": 2, - "variant": "two", - "flagMetadata": { - "allocationKey": "50/50 split", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "integer-flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "3", - "attributes": {}, - "result": { - "value": 2, - "variant": "two", - "flagMetadata": { - "allocationKey": "50/50 split", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "integer-flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "4", - "attributes": {}, - "result": { - "value": 2, - "variant": "two", - "flagMetadata": { - "allocationKey": "50/50 split", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "integer-flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "5", - "attributes": {}, - "result": { - "value": 1, - "variant": "one", - "flagMetadata": { - "allocationKey": "50/50 split", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "integer-flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "6", - "attributes": {}, - "result": { - "value": 2, - "variant": "two", - "flagMetadata": { - "allocationKey": "50/50 split", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "integer-flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "7", - "attributes": {}, - "result": { - "value": 1, - "variant": "one", - "flagMetadata": { - "allocationKey": "50/50 split", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "integer-flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "8", - "attributes": {}, - "result": { - "value": 1, - "variant": "one", - "flagMetadata": { - "allocationKey": "50/50 split", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "integer-flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "9", - "attributes": {}, - "result": { - "value": 2, - "variant": "two", - "flagMetadata": { - "allocationKey": "50/50 split", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "integer-flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "10", - "attributes": {}, - "result": { - "value": 2, - "variant": "two", - "flagMetadata": { - "allocationKey": "50/50 split", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "integer-flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "11", - "attributes": {}, - "result": { - "value": 1, - "variant": "one", - "flagMetadata": { - "allocationKey": "50/50 split", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "integer-flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "12", - "attributes": {}, - "result": { - "value": 1, - "variant": "one", - "flagMetadata": { - "allocationKey": "50/50 split", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "integer-flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "13", - "attributes": {}, - "result": { - "value": 2, - "variant": "two", - "flagMetadata": { - "allocationKey": "50/50 split", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "integer-flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "14", - "attributes": {}, - "result": { - "value": 1, - "variant": "one", - "flagMetadata": { - "allocationKey": "50/50 split", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "integer-flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "15", - "attributes": {}, - "result": { - "value": 2, - "variant": "two", - "flagMetadata": { - "allocationKey": "50/50 split", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "integer-flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "16", - "attributes": {}, - "result": { - "value": 2, - "variant": "two", - "flagMetadata": { - "allocationKey": "50/50 split", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "integer-flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "17", - "attributes": {}, - "result": { - "value": 1, - "variant": "one", - "flagMetadata": { - "allocationKey": "50/50 split", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "integer-flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "18", - "attributes": {}, - "result": { - "value": 1, - "variant": "one", - "flagMetadata": { - "allocationKey": "50/50 split", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "integer-flag", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "19", - "attributes": {}, - "result": { - "value": 1, - "variant": "one", - "flagMetadata": { - "allocationKey": "50/50 split", - "variationType": "number", - "doLog": true - } - } - } -] diff --git a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-kill-switch-flag.json b/dd-smoke-tests/openfeature/src/test/resources/data/test-case-kill-switch-flag.json deleted file mode 100644 index 29e65ba5bb4..00000000000 --- a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-kill-switch-flag.json +++ /dev/null @@ -1,434 +0,0 @@ -[ - { - "flag": "kill-switch", - "variationType": "BOOLEAN", - "defaultValue": false, - "targetingKey": "alice", - "attributes": { - "email": "alice@mycompany.com", - "country": "US" - }, - "result": { - "value": true, - "variant": "on", - "flagMetadata": { - "allocationKey": "on-for-NA", - "variationType": "boolean", - "doLog": true - } - } - }, - { - "flag": "kill-switch", - "variationType": "BOOLEAN", - "defaultValue": false, - "targetingKey": "bob", - "attributes": { - "email": "bob@example.com", - "country": "Canada" - }, - "result": { - "value": true, - "variant": "on", - "flagMetadata": { - "allocationKey": "on-for-NA", - "variationType": "boolean", - "doLog": true - } - } - }, - { - "flag": "kill-switch", - "variationType": "BOOLEAN", - "defaultValue": false, - "targetingKey": "barbara", - "attributes": { - "email": "barbara@example.com", - "country": "canada" - }, - "result": { - "value": false, - "variant": "off", - "flagMetadata": { - "allocationKey": "off-for-all", - "variationType": "boolean", - "doLog": true - } - } - }, - { - "flag": "kill-switch", - "variationType": "BOOLEAN", - "defaultValue": false, - "targetingKey": "charlie", - "attributes": { - "age": 40 - }, - "result": { - "value": false, - "variant": "off", - "flagMetadata": { - "allocationKey": "off-for-all", - "variationType": "boolean", - "doLog": true - } - } - }, - { - "flag": "kill-switch", - "variationType": "BOOLEAN", - "defaultValue": false, - "targetingKey": "debra", - "attributes": { - "email": "test@test.com", - "country": "Mexico", - "age": 25 - }, - "result": { - "value": true, - "variant": "on", - "flagMetadata": { - "allocationKey": "on-for-NA", - "variationType": "boolean", - "doLog": true - } - } - }, - { - "flag": "kill-switch", - "variationType": "BOOLEAN", - "defaultValue": false, - "targetingKey": "1", - "attributes": {}, - "result": { - "value": false, - "variant": "off", - "flagMetadata": { - "allocationKey": "off-for-all", - "variationType": "boolean", - "doLog": true - } - } - }, - { - "flag": "kill-switch", - "variationType": "BOOLEAN", - "defaultValue": false, - "targetingKey": "2", - "attributes": { - "country": "Mexico" - }, - "result": { - "value": true, - "variant": "on", - "flagMetadata": { - "allocationKey": "on-for-NA", - "variationType": "boolean", - "doLog": true - } - } - }, - { - "flag": "kill-switch", - "variationType": "BOOLEAN", - "defaultValue": false, - "targetingKey": "3", - "attributes": { - "country": "UK", - "age": 50 - }, - "result": { - "value": true, - "variant": "on", - "flagMetadata": { - "allocationKey": "on-for-age-50+", - "variationType": "boolean", - "doLog": true - } - } - }, - { - "flag": "kill-switch", - "variationType": "BOOLEAN", - "defaultValue": false, - "targetingKey": "4", - "attributes": { - "country": "Germany" - }, - "result": { - "value": false, - "variant": "off", - "flagMetadata": { - "allocationKey": "off-for-all", - "variationType": "boolean", - "doLog": true - } - } - }, - { - "flag": "kill-switch", - "variationType": "BOOLEAN", - "defaultValue": false, - "targetingKey": "5", - "attributes": { - "country": "Germany" - }, - "result": { - "value": false, - "variant": "off", - "flagMetadata": { - "allocationKey": "off-for-all", - "variationType": "boolean", - "doLog": true - } - } - }, - { - "flag": "kill-switch", - "variationType": "BOOLEAN", - "defaultValue": false, - "targetingKey": "6", - "attributes": { - "country": "Germany" - }, - "result": { - "value": false, - "variant": "off", - "flagMetadata": { - "allocationKey": "off-for-all", - "variationType": "boolean", - "doLog": true - } - } - }, - { - "flag": "kill-switch", - "variationType": "BOOLEAN", - "defaultValue": false, - "targetingKey": "7", - "attributes": { - "country": "US", - "age": 12 - }, - "result": { - "value": true, - "variant": "on", - "flagMetadata": { - "allocationKey": "on-for-NA", - "variationType": "boolean", - "doLog": true - } - } - }, - { - "flag": "kill-switch", - "variationType": "BOOLEAN", - "defaultValue": false, - "targetingKey": "8", - "attributes": { - "country": "Italy", - "age": 60 - }, - "result": { - "value": true, - "variant": "on", - "flagMetadata": { - "allocationKey": "on-for-age-50+", - "variationType": "boolean", - "doLog": true - } - } - }, - { - "flag": "kill-switch", - "variationType": "BOOLEAN", - "defaultValue": false, - "targetingKey": "9", - "attributes": { - "email": "email@email.com" - }, - "result": { - "value": false, - "variant": "off", - "flagMetadata": { - "allocationKey": "off-for-all", - "variationType": "boolean", - "doLog": true - } - } - }, - { - "flag": "kill-switch", - "variationType": "BOOLEAN", - "defaultValue": false, - "targetingKey": "10", - "attributes": {}, - "result": { - "value": false, - "variant": "off", - "flagMetadata": { - "allocationKey": "off-for-all", - "variationType": "boolean", - "doLog": true - } - } - }, - { - "flag": "kill-switch", - "variationType": "BOOLEAN", - "defaultValue": false, - "targetingKey": "11", - "attributes": {}, - "result": { - "value": false, - "variant": "off", - "flagMetadata": { - "allocationKey": "off-for-all", - "variationType": "boolean", - "doLog": true - } - } - }, - { - "flag": "kill-switch", - "variationType": "BOOLEAN", - "defaultValue": false, - "targetingKey": "12", - "attributes": { - "country": "US" - }, - "result": { - "value": true, - "variant": "on", - "flagMetadata": { - "allocationKey": "on-for-NA", - "variationType": "boolean", - "doLog": true - } - } - }, - { - "flag": "kill-switch", - "variationType": "BOOLEAN", - "defaultValue": false, - "targetingKey": "13", - "attributes": { - "country": "Canada" - }, - "result": { - "value": true, - "variant": "on", - "flagMetadata": { - "allocationKey": "on-for-NA", - "variationType": "boolean", - "doLog": true - } - } - }, - { - "flag": "kill-switch", - "variationType": "BOOLEAN", - "defaultValue": false, - "targetingKey": "14", - "attributes": {}, - "result": { - "value": false, - "variant": "off", - "flagMetadata": { - "allocationKey": "off-for-all", - "variationType": "boolean", - "doLog": true - } - } - }, - { - "flag": "kill-switch", - "variationType": "BOOLEAN", - "defaultValue": false, - "targetingKey": "15", - "attributes": { - "country": "Denmark" - }, - "result": { - "value": false, - "variant": "off", - "flagMetadata": { - "allocationKey": "off-for-all", - "variationType": "boolean", - "doLog": true - } - } - }, - { - "flag": "kill-switch", - "variationType": "BOOLEAN", - "defaultValue": false, - "targetingKey": "16", - "attributes": { - "country": "Norway" - }, - "result": { - "value": false, - "variant": "off", - "flagMetadata": { - "allocationKey": "off-for-all", - "variationType": "boolean", - "doLog": true - } - } - }, - { - "flag": "kill-switch", - "variationType": "BOOLEAN", - "defaultValue": false, - "targetingKey": "17", - "attributes": { - "country": "UK" - }, - "result": { - "value": false, - "variant": "off", - "flagMetadata": { - "allocationKey": "off-for-all", - "variationType": "boolean", - "doLog": true - } - } - }, - { - "flag": "kill-switch", - "variationType": "BOOLEAN", - "defaultValue": false, - "targetingKey": "18", - "attributes": { - "country": "UK" - }, - "result": { - "value": false, - "variant": "off", - "flagMetadata": { - "allocationKey": "off-for-all", - "variationType": "boolean", - "doLog": true - } - } - }, - { - "flag": "kill-switch", - "variationType": "BOOLEAN", - "defaultValue": false, - "targetingKey": "19", - "attributes": { - "country": "UK" - }, - "result": { - "value": false, - "variant": "off", - "flagMetadata": { - "allocationKey": "off-for-all", - "variationType": "boolean", - "doLog": true - } - } - } -] diff --git a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-microsecond-date-flag.json b/dd-smoke-tests/openfeature/src/test/resources/data/test-case-microsecond-date-flag.json deleted file mode 100644 index d363b260c42..00000000000 --- a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-microsecond-date-flag.json +++ /dev/null @@ -1,54 +0,0 @@ -[ - { - "flag": "microsecond-date-test", - "variationType": "STRING", - "defaultValue": "unknown", - "targetingKey": "alice", - "attributes": {}, - "result": { - "value": "active", - "variant": "active", - "flagMetadata": { - "allocationKey": "active-allocation", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "microsecond-date-test", - "variationType": "STRING", - "defaultValue": "unknown", - "targetingKey": "bob", - "attributes": { - "country": "US" - }, - "result": { - "value": "active", - "variant": "active", - "flagMetadata": { - "allocationKey": "active-allocation", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "microsecond-date-test", - "variationType": "STRING", - "defaultValue": "unknown", - "targetingKey": "charlie", - "attributes": { - "version": "1.0.0" - }, - "result": { - "value": "active", - "variant": "active", - "flagMetadata": { - "allocationKey": "active-allocation", - "variationType": "string", - "doLog": true - } - } - } -] diff --git a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-new-user-onboarding-flag.json b/dd-smoke-tests/openfeature/src/test/resources/data/test-case-new-user-onboarding-flag.json deleted file mode 100644 index 3845597270e..00000000000 --- a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-new-user-onboarding-flag.json +++ /dev/null @@ -1,420 +0,0 @@ -[ - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "alice", - "attributes": { - "email": "alice@mycompany.com", - "country": "US" - }, - "result": { - "value": "green", - "variant": "green", - "flagMetadata": { - "allocationKey": "internal users", - "variationType": "string", - "doLog": false - } - } - }, - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "bob", - "attributes": { - "email": "bob@example.com", - "country": "Canada" - }, - "result": { - "value": "default" - } - }, - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "charlie", - "attributes": { - "age": 50 - }, - "result": { - "value": "default" - } - }, - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "debra", - "attributes": { - "email": "test@test.com", - "country": "Mexico", - "age": 25 - }, - "result": { - "value": "blue", - "variant": "blue", - "flagMetadata": { - "allocationKey": "rollout", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "zach", - "attributes": { - "email": "test@test.com", - "country": "Mexico", - "age": 25 - }, - "result": { - "value": "purple", - "variant": "purple", - "flagMetadata": { - "allocationKey": "id rule", - "variationType": "string", - "doLog": false - } - } - }, - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "zach", - "attributes": { - "id": "override-id", - "email": "test@test.com", - "country": "Mexico", - "age": 25 - }, - "result": { - "value": "blue", - "variant": "blue", - "flagMetadata": { - "allocationKey": "rollout", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "Zach", - "attributes": { - "email": "test@test.com", - "country": "Mexico", - "age": 25 - }, - "result": { - "value": "default" - } - }, - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "1", - "attributes": {}, - "result": { - "value": "default" - } - }, - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "2", - "attributes": { - "country": "Mexico" - }, - "result": { - "value": "blue", - "variant": "blue", - "flagMetadata": { - "allocationKey": "rollout", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "3", - "attributes": { - "country": "UK", - "age": 33 - }, - "result": { - "value": "control", - "variant": "control", - "flagMetadata": { - "allocationKey": "experiment", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "4", - "attributes": { - "country": "Germany" - }, - "result": { - "value": "red", - "variant": "red", - "flagMetadata": { - "allocationKey": "experiment", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "5", - "attributes": { - "country": "Germany" - }, - "result": { - "value": "yellow", - "variant": "yellow", - "flagMetadata": { - "allocationKey": "experiment", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "6", - "attributes": { - "country": "Germany" - }, - "result": { - "value": "yellow", - "variant": "yellow", - "flagMetadata": { - "allocationKey": "experiment", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "7", - "attributes": { - "country": "US" - }, - "result": { - "value": "blue", - "variant": "blue", - "flagMetadata": { - "allocationKey": "rollout", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "8", - "attributes": { - "country": "Italy" - }, - "result": { - "value": "red", - "variant": "red", - "flagMetadata": { - "allocationKey": "experiment", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "9", - "attributes": { - "email": "email@email.com" - }, - "result": { - "value": "default" - } - }, - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "10", - "attributes": {}, - "result": { - "value": "default" - } - }, - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "11", - "attributes": {}, - "result": { - "value": "default" - } - }, - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "12", - "attributes": { - "country": "US" - }, - "result": { - "value": "blue", - "variant": "blue", - "flagMetadata": { - "allocationKey": "rollout", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "13", - "attributes": { - "country": "Canada" - }, - "result": { - "value": "blue", - "variant": "blue", - "flagMetadata": { - "allocationKey": "rollout", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "14", - "attributes": {}, - "result": { - "value": "default" - } - }, - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "15", - "attributes": { - "country": "Denmark" - }, - "result": { - "value": "yellow", - "variant": "yellow", - "flagMetadata": { - "allocationKey": "experiment", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "16", - "attributes": { - "country": "Norway" - }, - "result": { - "value": "control", - "variant": "control", - "flagMetadata": { - "allocationKey": "experiment", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "17", - "attributes": { - "country": "UK" - }, - "result": { - "value": "control", - "variant": "control", - "flagMetadata": { - "allocationKey": "experiment", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "18", - "attributes": { - "country": "UK" - }, - "result": { - "value": "default" - } - }, - { - "flag": "new-user-onboarding", - "variationType": "STRING", - "defaultValue": "default", - "targetingKey": "19", - "attributes": { - "country": "UK" - }, - "result": { - "value": "red", - "variant": "red", - "flagMetadata": { - "allocationKey": "experiment", - "variationType": "string", - "doLog": true - } - } - } -] diff --git a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-no-allocations-flag.json b/dd-smoke-tests/openfeature/src/test/resources/data/test-case-no-allocations-flag.json deleted file mode 100644 index 132c39db32a..00000000000 --- a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-no-allocations-flag.json +++ /dev/null @@ -1,52 +0,0 @@ -[ - { - "flag": "no_allocations_flag", - "variationType": "JSON", - "defaultValue": { - "hello": "world" - }, - "targetingKey": "alice", - "attributes": { - "email": "alice@mycompany.com", - "country": "US" - }, - "result": { - "value": { - "hello": "world" - } - } - }, - { - "flag": "no_allocations_flag", - "variationType": "JSON", - "defaultValue": { - "hello": "world" - }, - "targetingKey": "bob", - "attributes": { - "email": "bob@example.com", - "country": "Canada" - }, - "result": { - "value": { - "hello": "world" - } - } - }, - { - "flag": "no_allocations_flag", - "variationType": "JSON", - "defaultValue": { - "hello": "world" - }, - "targetingKey": "charlie", - "attributes": { - "age": 50 - }, - "result": { - "value": { - "hello": "world" - } - } - } -] diff --git a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-null-operator-flag.json b/dd-smoke-tests/openfeature/src/test/resources/data/test-case-null-operator-flag.json deleted file mode 100644 index dd5c687b893..00000000000 --- a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-null-operator-flag.json +++ /dev/null @@ -1,94 +0,0 @@ -[ - { - "flag": "null-operator-test", - "variationType": "STRING", - "defaultValue": "default-null", - "targetingKey": "alice", - "attributes": { - "size": 5, - "country": "US" - }, - "result": { - "value": "old", - "variant": "old", - "flagMetadata": { - "allocationKey": "null-operator", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "null-operator-test", - "variationType": "STRING", - "defaultValue": "default-null", - "targetingKey": "bob", - "attributes": { - "size": 10, - "country": "Canada" - }, - "result": { - "value": "new", - "variant": "new", - "flagMetadata": { - "allocationKey": "not-null-operator", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "null-operator-test", - "variationType": "STRING", - "defaultValue": "default-null", - "targetingKey": "charlie", - "attributes": { - "size": null - }, - "result": { - "value": "old", - "variant": "old", - "flagMetadata": { - "allocationKey": "null-operator", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "null-operator-test", - "variationType": "STRING", - "defaultValue": "default-null", - "targetingKey": "david", - "attributes": { - "size": 26 - }, - "result": { - "value": "new", - "variant": "new", - "flagMetadata": { - "allocationKey": "not-null-operator", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "null-operator-test", - "variationType": "STRING", - "defaultValue": "default-null", - "targetingKey": "elize", - "attributes": { - "country": "UK" - }, - "result": { - "value": "old", - "variant": "old", - "flagMetadata": { - "allocationKey": "null-operator", - "variationType": "string", - "doLog": true - } - } - } -] diff --git a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-numeric-flag.json b/dd-smoke-tests/openfeature/src/test/resources/data/test-case-numeric-flag.json deleted file mode 100644 index 0e6ed8b1b3a..00000000000 --- a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-numeric-flag.json +++ /dev/null @@ -1,58 +0,0 @@ -[ - { - "flag": "numeric_flag", - "variationType": "NUMERIC", - "defaultValue": 0.0, - "targetingKey": "alice", - "attributes": { - "email": "alice@mycompany.com", - "country": "US" - }, - "result": { - "value": 3.1415926, - "variant": "pi", - "flagMetadata": { - "allocationKey": "rollout", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "numeric_flag", - "variationType": "NUMERIC", - "defaultValue": 0.0, - "targetingKey": "bob", - "attributes": { - "email": "bob@example.com", - "country": "Canada" - }, - "result": { - "value": 3.1415926, - "variant": "pi", - "flagMetadata": { - "allocationKey": "rollout", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "numeric_flag", - "variationType": "NUMERIC", - "defaultValue": 0.0, - "targetingKey": "charlie", - "attributes": { - "age": 50 - }, - "result": { - "value": 3.1415926, - "variant": "pi", - "flagMetadata": { - "allocationKey": "rollout", - "variationType": "number", - "doLog": true - } - } - } -] diff --git a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-numeric-one-of.json b/dd-smoke-tests/openfeature/src/test/resources/data/test-case-numeric-one-of.json deleted file mode 100644 index 5ab68af5196..00000000000 --- a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-numeric-one-of.json +++ /dev/null @@ -1,122 +0,0 @@ -[ - { - "flag": "numeric-one-of", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "alice", - "attributes": { - "number": 1 - }, - "result": { - "value": 1, - "variant": "1", - "flagMetadata": { - "allocationKey": "1-for-1", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "numeric-one-of", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "bob", - "attributes": { - "number": 2 - }, - "result": { - "value": 0 - } - }, - { - "flag": "numeric-one-of", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "charlie", - "attributes": { - "number": 3 - }, - "result": { - "value": 3, - "variant": "3", - "flagMetadata": { - "allocationKey": "3-for-not-2", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "numeric-one-of", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "derek", - "attributes": { - "number": 4 - }, - "result": { - "value": 3, - "variant": "3", - "flagMetadata": { - "allocationKey": "3-for-not-2", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "numeric-one-of", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "erica", - "attributes": { - "number": "1" - }, - "result": { - "value": 1, - "variant": "1", - "flagMetadata": { - "allocationKey": "1-for-1", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "numeric-one-of", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "frank", - "attributes": { - "number": 1 - }, - "result": { - "value": 1, - "variant": "1", - "flagMetadata": { - "allocationKey": "1-for-1", - "variationType": "number", - "doLog": true - } - } - }, - { - "flag": "numeric-one-of", - "variationType": "INTEGER", - "defaultValue": 0, - "targetingKey": "george", - "attributes": { - "number": 123456789 - }, - "result": { - "value": 2, - "variant": "2", - "flagMetadata": { - "allocationKey": "2-for-123456789", - "variationType": "number", - "doLog": true - } - } - } -] diff --git a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-race-conditions.json b/dd-smoke-tests/openfeature/src/test/resources/data/test-case-race-conditions.json deleted file mode 100644 index fa940c843b4..00000000000 --- a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-race-conditions.json +++ /dev/null @@ -1,10 +0,0 @@ -[ - { - "flag": "numeric-one-of", - "variationType": "INTEGER", - "defaultValue": 0, - "result": { - "value": 0 - } - } -] diff --git a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-regex-flag.json b/dd-smoke-tests/openfeature/src/test/resources/data/test-case-regex-flag.json deleted file mode 100644 index 952a37aabcf..00000000000 --- a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-regex-flag.json +++ /dev/null @@ -1,65 +0,0 @@ -[ - { - "flag": "regex-flag", - "variationType": "STRING", - "defaultValue": "none", - "targetingKey": "alice", - "attributes": { - "version": "1.15.0", - "email": "alice@example.com" - }, - "result": { - "value": "partial-example", - "variant": "partial-example", - "flagMetadata": { - "allocationKey": "partial-example", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "regex-flag", - "variationType": "STRING", - "defaultValue": "none", - "targetingKey": "bob", - "attributes": { - "version": "0.20.1", - "email": "bob@test.com" - }, - "result": { - "value": "test", - "variant": "test", - "flagMetadata": { - "allocationKey": "test", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "regex-flag", - "variationType": "STRING", - "defaultValue": "none", - "targetingKey": "charlie", - "attributes": { - "version": "2.1.13" - }, - "result": { - "value": "none" - } - }, - { - "flag": "regex-flag", - "variationType": "STRING", - "defaultValue": "none", - "targetingKey": "derek", - "attributes": { - "version": "2.1.13", - "email": "derek@gmail.com" - }, - "result": { - "value": "none" - } - } -] diff --git a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-start-and-end-date-flag.json b/dd-smoke-tests/openfeature/src/test/resources/data/test-case-start-and-end-date-flag.json deleted file mode 100644 index caf805d1432..00000000000 --- a/dd-smoke-tests/openfeature/src/test/resources/data/test-case-start-and-end-date-flag.json +++ /dev/null @@ -1,58 +0,0 @@ -[ - { - "flag": "start-and-end-date-test", - "variationType": "STRING", - "defaultValue": "unknown", - "targetingKey": "alice", - "attributes": { - "version": "1.15.0", - "country": "US" - }, - "result": { - "value": "current", - "variant": "current", - "flagMetadata": { - "allocationKey": "current-versions", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "start-and-end-date-test", - "variationType": "STRING", - "defaultValue": "unknown", - "targetingKey": "bob", - "attributes": { - "version": "0.20.1", - "country": "Canada" - }, - "result": { - "value": "current", - "variant": "current", - "flagMetadata": { - "allocationKey": "current-versions", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "start-and-end-date-test", - "variationType": "STRING", - "defaultValue": "unknown", - "targetingKey": "charlie", - "attributes": { - "version": "2.1.13" - }, - "result": { - "value": "current", - "variant": "current", - "flagMetadata": { - "allocationKey": "current-versions", - "variationType": "string", - "doLog": true - } - } - } -] diff --git a/dd-smoke-tests/openfeature/src/test/resources/data/test-flag-that-does-not-exist.json b/dd-smoke-tests/openfeature/src/test/resources/data/test-flag-that-does-not-exist.json deleted file mode 100644 index 7499bba1c50..00000000000 --- a/dd-smoke-tests/openfeature/src/test/resources/data/test-flag-that-does-not-exist.json +++ /dev/null @@ -1,40 +0,0 @@ -[ - { - "flag": "flag-that-does-not-exist", - "variationType": "NUMERIC", - "defaultValue": 0.0, - "targetingKey": "alice", - "attributes": { - "email": "alice@mycompany.com", - "country": "US" - }, - "result": { - "value": 0.0 - } - }, - { - "flag": "flag-that-does-not-exist", - "variationType": "NUMERIC", - "defaultValue": 0.0, - "targetingKey": "bob", - "attributes": { - "email": "bob@example.com", - "country": "Canada" - }, - "result": { - "value": 0.0 - } - }, - { - "flag": "flag-that-does-not-exist", - "variationType": "NUMERIC", - "defaultValue": 0.0, - "targetingKey": "charlie", - "attributes": { - "age": 50 - }, - "result": { - "value": 0.0 - } - } -] diff --git a/dd-smoke-tests/openfeature/src/test/resources/data/test-json-config-flag.json b/dd-smoke-tests/openfeature/src/test/resources/data/test-json-config-flag.json deleted file mode 100644 index 3d4478ff711..00000000000 --- a/dd-smoke-tests/openfeature/src/test/resources/data/test-json-config-flag.json +++ /dev/null @@ -1,96 +0,0 @@ -[ - { - "flag": "json-config-flag", - "variationType": "JSON", - "defaultValue": { - "foo": "bar" - }, - "targetingKey": "alice", - "attributes": { - "email": "alice@mycompany.com", - "country": "US" - }, - "result": { - "value": { - "integer": 1, - "string": "one", - "float": 1.0 - }, - "variant": "one", - "flagMetadata": { - "allocationKey": "50/50 split", - "variationType": "object", - "doLog": true - } - } - }, - { - "flag": "json-config-flag", - "variationType": "JSON", - "defaultValue": { - "foo": "bar" - }, - "targetingKey": "bob", - "attributes": { - "email": "bob@example.com", - "country": "Canada" - }, - "result": { - "value": { - "integer": 2, - "string": "two", - "float": 2.0 - }, - "variant": "two", - "flagMetadata": { - "allocationKey": "50/50 split", - "variationType": "object", - "doLog": true - } - } - }, - { - "flag": "json-config-flag", - "variationType": "JSON", - "defaultValue": { - "foo": "bar" - }, - "targetingKey": "charlie", - "attributes": { - "age": 50 - }, - "result": { - "value": { - "integer": 2, - "string": "two", - "float": 2.0 - }, - "variant": "two", - "flagMetadata": { - "allocationKey": "50/50 split", - "variationType": "object", - "doLog": true - } - } - }, - { - "flag": "json-config-flag", - "variationType": "JSON", - "defaultValue": { - "foo": "bar" - }, - "targetingKey": "diana", - "attributes": { - "Force Empty": true - }, - "result": { - "value": {}, - "variant": "empty", - "flagMetadata": { - "allocationKey": "Optionally Force Empty", - "variationType": "object", - "doLog": true - } - } - } -] diff --git a/dd-smoke-tests/openfeature/src/test/resources/data/test-no-allocations-flag.json b/dd-smoke-tests/openfeature/src/test/resources/data/test-no-allocations-flag.json deleted file mode 100644 index 45867e5897c..00000000000 --- a/dd-smoke-tests/openfeature/src/test/resources/data/test-no-allocations-flag.json +++ /dev/null @@ -1,52 +0,0 @@ -[ - { - "flag": "no_allocations_flag", - "variationType": "JSON", - "defaultValue": { - "message": "Hello, world!" - }, - "targetingKey": "alice", - "attributes": { - "email": "alice@mycompany.com", - "country": "US" - }, - "result": { - "value": { - "message": "Hello, world!" - } - } - }, - { - "flag": "no_allocations_flag", - "variationType": "JSON", - "defaultValue": { - "message": "Hello, world!" - }, - "targetingKey": "bob", - "attributes": { - "email": "bob@example.com", - "country": "Canada" - }, - "result": { - "value": { - "message": "Hello, world!" - } - } - }, - { - "flag": "no_allocations_flag", - "variationType": "JSON", - "defaultValue": { - "message": "Hello, world!" - }, - "targetingKey": "charlie", - "attributes": { - "age": 50 - }, - "result": { - "value": { - "message": "Hello, world!" - } - } - } -] diff --git a/dd-smoke-tests/openfeature/src/test/resources/data/test-special-characters.json b/dd-smoke-tests/openfeature/src/test/resources/data/test-special-characters.json deleted file mode 100644 index 59ef5cbe87d..00000000000 --- a/dd-smoke-tests/openfeature/src/test/resources/data/test-special-characters.json +++ /dev/null @@ -1,78 +0,0 @@ -[ - { - "flag": "special-characters", - "variationType": "JSON", - "defaultValue": {}, - "targetingKey": "ash", - "attributes": {}, - "result": { - "value": { - "a": "kümmert", - "b": "schön" - }, - "variant": "de", - "flagMetadata": { - "allocationKey": "allocation-test", - "variationType": "object", - "doLog": true - } - } - }, - { - "flag": "special-characters", - "variationType": "JSON", - "defaultValue": {}, - "targetingKey": "ben", - "attributes": {}, - "result": { - "value": { - "a": "піклуватися", - "b": "любов" - }, - "variant": "ua", - "flagMetadata": { - "allocationKey": "allocation-test", - "variationType": "object", - "doLog": true - } - } - }, - { - "flag": "special-characters", - "variationType": "JSON", - "defaultValue": {}, - "targetingKey": "cameron", - "attributes": {}, - "result": { - "value": { - "a": "照顾", - "b": "漂亮" - }, - "variant": "zh", - "flagMetadata": { - "allocationKey": "allocation-test", - "variationType": "object", - "doLog": true - } - } - }, - { - "flag": "special-characters", - "variationType": "JSON", - "defaultValue": {}, - "targetingKey": "darryl", - "attributes": {}, - "result": { - "value": { - "a": "🤗", - "b": "🌸" - }, - "variant": "emoji", - "flagMetadata": { - "allocationKey": "allocation-test", - "variationType": "object", - "doLog": true - } - } - } -] diff --git a/dd-smoke-tests/openfeature/src/test/resources/data/test-string-with-special-characters.json b/dd-smoke-tests/openfeature/src/test/resources/data/test-string-with-special-characters.json deleted file mode 100644 index 27d063122c0..00000000000 --- a/dd-smoke-tests/openfeature/src/test/resources/data/test-string-with-special-characters.json +++ /dev/null @@ -1,1190 +0,0 @@ -[ - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_spaces", - "attributes": { - "string_with_spaces": true - }, - "result": { - "value": " a b c d e f ", - "variant": "string_with_spaces", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_spaces", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_one_space", - "attributes": { - "string_with_only_one_space": true - }, - "result": { - "value": " ", - "variant": "string_with_only_one_space", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_one_space", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_multiple_spaces", - "attributes": { - "string_with_only_multiple_spaces": true - }, - "result": { - "value": " ", - "variant": "string_with_only_multiple_spaces", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_multiple_spaces", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_dots", - "attributes": { - "string_with_dots": true - }, - "result": { - "value": ".a.b.c.d.e.f.", - "variant": "string_with_dots", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_dots", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_one_dot", - "attributes": { - "string_with_only_one_dot": true - }, - "result": { - "value": ".", - "variant": "string_with_only_one_dot", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_one_dot", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_multiple_dots", - "attributes": { - "string_with_only_multiple_dots": true - }, - "result": { - "value": ".......", - "variant": "string_with_only_multiple_dots", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_multiple_dots", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_comas", - "attributes": { - "string_with_comas": true - }, - "result": { - "value": ",a,b,c,d,e,f,", - "variant": "string_with_comas", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_comas", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_one_coma", - "attributes": { - "string_with_only_one_coma": true - }, - "result": { - "value": ",", - "variant": "string_with_only_one_coma", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_one_coma", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_multiple_comas", - "attributes": { - "string_with_only_multiple_comas": true - }, - "result": { - "value": ",,,,,,,", - "variant": "string_with_only_multiple_comas", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_multiple_comas", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_colons", - "attributes": { - "string_with_colons": true - }, - "result": { - "value": ":a:b:c:d:e:f:", - "variant": "string_with_colons", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_colons", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_one_colon", - "attributes": { - "string_with_only_one_colon": true - }, - "result": { - "value": ":", - "variant": "string_with_only_one_colon", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_one_colon", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_multiple_colons", - "attributes": { - "string_with_only_multiple_colons": true - }, - "result": { - "value": ":::::::", - "variant": "string_with_only_multiple_colons", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_multiple_colons", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_semicolons", - "attributes": { - "string_with_semicolons": true - }, - "result": { - "value": ";a;b;c;d;e;f;", - "variant": "string_with_semicolons", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_semicolons", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_one_semicolon", - "attributes": { - "string_with_only_one_semicolon": true - }, - "result": { - "value": ";", - "variant": "string_with_only_one_semicolon", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_one_semicolon", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_multiple_semicolons", - "attributes": { - "string_with_only_multiple_semicolons": true - }, - "result": { - "value": ";;;;;;;", - "variant": "string_with_only_multiple_semicolons", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_multiple_semicolons", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_slashes", - "attributes": { - "string_with_slashes": true - }, - "result": { - "value": "/a/b/c/d/e/f/", - "variant": "string_with_slashes", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_slashes", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_one_slash", - "attributes": { - "string_with_only_one_slash": true - }, - "result": { - "value": "/", - "variant": "string_with_only_one_slash", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_one_slash", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_multiple_slashes", - "attributes": { - "string_with_only_multiple_slashes": true - }, - "result": { - "value": "///////", - "variant": "string_with_only_multiple_slashes", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_multiple_slashes", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_dashes", - "attributes": { - "string_with_dashes": true - }, - "result": { - "value": "-a-b-c-d-e-f-", - "variant": "string_with_dashes", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_dashes", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_one_dash", - "attributes": { - "string_with_only_one_dash": true - }, - "result": { - "value": "-", - "variant": "string_with_only_one_dash", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_one_dash", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_multiple_dashes", - "attributes": { - "string_with_only_multiple_dashes": true - }, - "result": { - "value": "-------", - "variant": "string_with_only_multiple_dashes", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_multiple_dashes", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_underscores", - "attributes": { - "string_with_underscores": true - }, - "result": { - "value": "_a_b_c_d_e_f_", - "variant": "string_with_underscores", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_underscores", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_one_underscore", - "attributes": { - "string_with_only_one_underscore": true - }, - "result": { - "value": "_", - "variant": "string_with_only_one_underscore", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_one_underscore", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_multiple_underscores", - "attributes": { - "string_with_only_multiple_underscores": true - }, - "result": { - "value": "_______", - "variant": "string_with_only_multiple_underscores", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_multiple_underscores", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_plus_signs", - "attributes": { - "string_with_plus_signs": true - }, - "result": { - "value": "+a+b+c+d+e+f+", - "variant": "string_with_plus_signs", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_plus_signs", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_one_plus_sign", - "attributes": { - "string_with_only_one_plus_sign": true - }, - "result": { - "value": "+", - "variant": "string_with_only_one_plus_sign", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_one_plus_sign", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_multiple_plus_signs", - "attributes": { - "string_with_only_multiple_plus_signs": true - }, - "result": { - "value": "+++++++", - "variant": "string_with_only_multiple_plus_signs", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_multiple_plus_signs", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_equal_signs", - "attributes": { - "string_with_equal_signs": true - }, - "result": { - "value": "=a=b=c=d=e=f=", - "variant": "string_with_equal_signs", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_equal_signs", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_one_equal_sign", - "attributes": { - "string_with_only_one_equal_sign": true - }, - "result": { - "value": "=", - "variant": "string_with_only_one_equal_sign", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_one_equal_sign", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_multiple_equal_signs", - "attributes": { - "string_with_only_multiple_equal_signs": true - }, - "result": { - "value": "=======", - "variant": "string_with_only_multiple_equal_signs", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_multiple_equal_signs", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_dollar_signs", - "attributes": { - "string_with_dollar_signs": true - }, - "result": { - "value": "$a$b$c$d$e$f$", - "variant": "string_with_dollar_signs", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_dollar_signs", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_one_dollar_sign", - "attributes": { - "string_with_only_one_dollar_sign": true - }, - "result": { - "value": "$", - "variant": "string_with_only_one_dollar_sign", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_one_dollar_sign", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_multiple_dollar_signs", - "attributes": { - "string_with_only_multiple_dollar_signs": true - }, - "result": { - "value": "$$$$$$$", - "variant": "string_with_only_multiple_dollar_signs", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_multiple_dollar_signs", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_at_signs", - "attributes": { - "string_with_at_signs": true - }, - "result": { - "value": "@a@b@c@d@e@f@", - "variant": "string_with_at_signs", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_at_signs", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_one_at_sign", - "attributes": { - "string_with_only_one_at_sign": true - }, - "result": { - "value": "@", - "variant": "string_with_only_one_at_sign", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_one_at_sign", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_multiple_at_signs", - "attributes": { - "string_with_only_multiple_at_signs": true - }, - "result": { - "value": "@@@@@@@", - "variant": "string_with_only_multiple_at_signs", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_multiple_at_signs", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_amp_signs", - "attributes": { - "string_with_amp_signs": true - }, - "result": { - "value": "&a&b&c&d&e&f&", - "variant": "string_with_amp_signs", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_amp_signs", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_one_amp_sign", - "attributes": { - "string_with_only_one_amp_sign": true - }, - "result": { - "value": "&", - "variant": "string_with_only_one_amp_sign", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_one_amp_sign", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_multiple_amp_signs", - "attributes": { - "string_with_only_multiple_amp_signs": true - }, - "result": { - "value": "&&&&&&&", - "variant": "string_with_only_multiple_amp_signs", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_multiple_amp_signs", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_hash_signs", - "attributes": { - "string_with_hash_signs": true - }, - "result": { - "value": "#a#b#c#d#e#f#", - "variant": "string_with_hash_signs", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_hash_signs", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_one_hash_sign", - "attributes": { - "string_with_only_one_hash_sign": true - }, - "result": { - "value": "#", - "variant": "string_with_only_one_hash_sign", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_one_hash_sign", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_multiple_hash_signs", - "attributes": { - "string_with_only_multiple_hash_signs": true - }, - "result": { - "value": "#######", - "variant": "string_with_only_multiple_hash_signs", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_multiple_hash_signs", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_percentage_signs", - "attributes": { - "string_with_percentage_signs": true - }, - "result": { - "value": "%a%b%c%d%e%f%", - "variant": "string_with_percentage_signs", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_percentage_signs", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_one_percentage_sign", - "attributes": { - "string_with_only_one_percentage_sign": true - }, - "result": { - "value": "%", - "variant": "string_with_only_one_percentage_sign", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_one_percentage_sign", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_multiple_percentage_signs", - "attributes": { - "string_with_only_multiple_percentage_signs": true - }, - "result": { - "value": "%%%%%%%", - "variant": "string_with_only_multiple_percentage_signs", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_multiple_percentage_signs", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_tilde_signs", - "attributes": { - "string_with_tilde_signs": true - }, - "result": { - "value": "~a~b~c~d~e~f~", - "variant": "string_with_tilde_signs", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_tilde_signs", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_one_tilde_sign", - "attributes": { - "string_with_only_one_tilde_sign": true - }, - "result": { - "value": "~", - "variant": "string_with_only_one_tilde_sign", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_one_tilde_sign", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_multiple_tilde_signs", - "attributes": { - "string_with_only_multiple_tilde_signs": true - }, - "result": { - "value": "~~~~~~~", - "variant": "string_with_only_multiple_tilde_signs", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_multiple_tilde_signs", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_asterix_signs", - "attributes": { - "string_with_asterix_signs": true - }, - "result": { - "value": "*a*b*c*d*e*f*", - "variant": "string_with_asterix_signs", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_asterix_signs", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_one_asterix_sign", - "attributes": { - "string_with_only_one_asterix_sign": true - }, - "result": { - "value": "*", - "variant": "string_with_only_one_asterix_sign", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_one_asterix_sign", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_multiple_asterix_signs", - "attributes": { - "string_with_only_multiple_asterix_signs": true - }, - "result": { - "value": "*******", - "variant": "string_with_only_multiple_asterix_signs", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_multiple_asterix_signs", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_single_quotes", - "attributes": { - "string_with_single_quotes": true - }, - "result": { - "value": "'a'b'c'd'e'f'", - "variant": "string_with_single_quotes", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_single_quotes", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_one_single_quote", - "attributes": { - "string_with_only_one_single_quote": true - }, - "result": { - "value": "'", - "variant": "string_with_only_one_single_quote", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_one_single_quote", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_multiple_single_quotes", - "attributes": { - "string_with_only_multiple_single_quotes": true - }, - "result": { - "value": "'''''''", - "variant": "string_with_only_multiple_single_quotes", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_multiple_single_quotes", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_question_marks", - "attributes": { - "string_with_question_marks": true - }, - "result": { - "value": "?a?b?c?d?e?f?", - "variant": "string_with_question_marks", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_question_marks", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_one_question_mark", - "attributes": { - "string_with_only_one_question_mark": true - }, - "result": { - "value": "?", - "variant": "string_with_only_one_question_mark", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_one_question_mark", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_multiple_question_marks", - "attributes": { - "string_with_only_multiple_question_marks": true - }, - "result": { - "value": "???????", - "variant": "string_with_only_multiple_question_marks", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_multiple_question_marks", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_exclamation_marks", - "attributes": { - "string_with_exclamation_marks": true - }, - "result": { - "value": "!a!b!c!d!e!f!", - "variant": "string_with_exclamation_marks", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_exclamation_marks", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_one_exclamation_mark", - "attributes": { - "string_with_only_one_exclamation_mark": true - }, - "result": { - "value": "!", - "variant": "string_with_only_one_exclamation_mark", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_one_exclamation_mark", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_multiple_exclamation_marks", - "attributes": { - "string_with_only_multiple_exclamation_marks": true - }, - "result": { - "value": "!!!!!!!", - "variant": "string_with_only_multiple_exclamation_marks", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_multiple_exclamation_marks", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_opening_parentheses", - "attributes": { - "string_with_opening_parentheses": true - }, - "result": { - "value": "(a(b(c(d(e(f(", - "variant": "string_with_opening_parentheses", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_opening_parentheses", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_one_opening_parenthese", - "attributes": { - "string_with_only_one_opening_parenthese": true - }, - "result": { - "value": "(", - "variant": "string_with_only_one_opening_parenthese", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_one_opening_parenthese", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_multiple_opening_parentheses", - "attributes": { - "string_with_only_multiple_opening_parentheses": true - }, - "result": { - "value": "(((((((", - "variant": "string_with_only_multiple_opening_parentheses", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_multiple_opening_parentheses", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_closing_parentheses", - "attributes": { - "string_with_closing_parentheses": true - }, - "result": { - "value": ")a)b)c)d)e)f)", - "variant": "string_with_closing_parentheses", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_closing_parentheses", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_one_closing_parenthese", - "attributes": { - "string_with_only_one_closing_parenthese": true - }, - "result": { - "value": ")", - "variant": "string_with_only_one_closing_parenthese", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_one_closing_parenthese", - "variationType": "string", - "doLog": true - } - } - }, - { - "flag": "string_flag_with_special_characters", - "variationType": "STRING", - "defaultValue": "default_value", - "targetingKey": "string_with_only_multiple_closing_parentheses", - "attributes": { - "string_with_only_multiple_closing_parentheses": true - }, - "result": { - "value": ")))))))", - "variant": "string_with_only_multiple_closing_parentheses", - "flagMetadata": { - "allocationKey": "allocation-test-string_with_only_multiple_closing_parentheses", - "variationType": "string", - "doLog": true - } - } - } -] diff --git a/dd-smoke-tests/openfeature/src/test/resources/ffe-system-test-data b/dd-smoke-tests/openfeature/src/test/resources/ffe-system-test-data new file mode 160000 index 00000000000..b42c4a104ea --- /dev/null +++ b/dd-smoke-tests/openfeature/src/test/resources/ffe-system-test-data @@ -0,0 +1 @@ +Subproject commit b42c4a104ea70695c8fc3516780951f7434b7906 diff --git a/dd-smoke-tests/opentelemetry/gradle.lockfile b/dd-smoke-tests/opentelemetry/gradle.lockfile index 38f434647fc..4c2601b6c61 100644 --- a/dd-smoke-tests/opentelemetry/gradle.lockfile +++ b/dd-smoke-tests/opentelemetry/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:opentelemetry:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -42,12 +47,12 @@ io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath io.opentelemetry.instrumentation:opentelemetry-instrumentation-annotations:1.20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentelemetry:opentelemetry-api:1.19.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentelemetry:opentelemetry-context:1.19.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -75,6 +80,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -99,8 +105,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/opentracing/gradle.lockfile b/dd-smoke-tests/opentracing/gradle.lockfile index 12edbb498a5..eaa526354e9 100644 --- a/dd-smoke-tests/opentracing/gradle.lockfile +++ b/dd-smoke-tests/opentracing/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:opentracing:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -43,12 +48,12 @@ io.opentracing.contrib:opentracing-tracerresolver:0.1.0=compileClasspath,runtime io.opentracing:opentracing-api:0.32.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentracing:opentracing-noop:0.32.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentracing:opentracing-util:0.32.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -76,6 +81,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -100,8 +106,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/osgi/build.gradle b/dd-smoke-tests/osgi/build.gradle index 30eff243064..ab5752613ce 100644 --- a/dd-smoke-tests/osgi/build.gradle +++ b/dd-smoke-tests/osgi/build.gradle @@ -1,7 +1,7 @@ import aQute.bnd.gradle.Bundle plugins { - id 'biz.aQute.bnd.builder' version '6.4.0' apply true + id 'biz.aQute.bnd.builder' version '7.2.3' apply true } repositories { diff --git a/dd-smoke-tests/osgi/gradle.lockfile b/dd-smoke-tests/osgi/gradle.lockfile index 10ac36b8182..37413421a13 100644 --- a/dd-smoke-tests/osgi/gradle.lockfile +++ b/dd-smoke-tests/osgi/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:osgi:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,32 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=bundles,compileClasspath,testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:20.0=bundles,compileClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -41,12 +47,12 @@ commons-io:commons-io:2.20.0=spotbugs commons-logging:commons-logging:1.2=compileClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -82,6 +88,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -110,8 +117,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/play-2.4/build.gradle b/dd-smoke-tests/play-2.4/build.gradle index 1a0de08b58b..d035365979a 100644 --- a/dd-smoke-tests/play-2.4/build.gradle +++ b/dd-smoke-tests/play-2.4/build.gradle @@ -10,6 +10,7 @@ testJvmConstraints { } apply from: "$rootDir/dd-smoke-tests/play-common/fix-play-routes.gradle" +apply from: "$rootDir/dd-smoke-tests/play-common/fix-play-linux-arm64.gradle" def playVer = "2.4.11" def scalaVer = System.getProperty("scala.binary.version", /* default = */ "2.11") diff --git a/dd-smoke-tests/play-2.4/gradle.lockfile b/dd-smoke-tests/play-2.4/gradle.lockfile index 3d93ecc7eba..d6d50b4ab7d 100644 --- a/dd-smoke-tests/play-2.4/gradle.lockfile +++ b/dd-smoke-tests/play-2.4/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:play-2.4:dependencies --write-locks aopalliance:aopalliance:1.0=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath args4j:args4j:2.0.26=javaScriptCompiler cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath @@ -12,7 +13,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -27,15 +28,15 @@ com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.5.4=compileClasspath,play com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.5.4=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml:classmate:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:1.3.9=javaScriptCompiler @@ -44,14 +45,19 @@ com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClass com.google.code.gson:gson:2.13.2=spotbugs com.google.code.gson:gson:2.2.4=javaScriptCompiler com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:16.0.1=play -com.google.guava:guava:18.0=compileClasspath,javaScriptCompiler,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:18.0=compileClasspath,javaScriptCompiler,runtimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath com.google.inject.extensions:guice-assistedinject:4.0=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.inject:guice:4.0=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath com.google.javascript:closure-compiler-externs:v20141215=javaScriptCompiler com.google.javascript:closure-compiler:v20141215=javaScriptCompiler com.google.protobuf:protobuf-java:2.5.0=javaScriptCompiler -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.ning:async-http-client:1.9.40=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath @@ -93,7 +99,7 @@ commons-io:commons-io:2.20.0=spotbugs commons-io:commons-io:2.4=routesCompiler,runtimeClasspath commons-logging:commons-logging:1.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath io.netty:netty:3.10.6.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentracing:opentracing-api:0.32.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -110,10 +116,9 @@ javax.xml.bind:jaxb-api:2.3.1=compileClasspath,runtimeClasspath,testCompileClass jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.8.1=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.jodah:typetools:0.4.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.openhft:zero-allocation-hashing:0.16=zinc @@ -147,7 +152,7 @@ org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath @@ -159,8 +164,9 @@ org.jctools:jctools-core:4.0.6=testRuntimeClasspath org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc org.joda:joda-convert:1.7=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -189,8 +195,8 @@ org.ow2.asm:asm-util:4.1=runtimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs org.ow2.asm:asm:4.1=runtimeClasspath +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.parboiled:parboiled-core:1.1.5=runtimeClasspath,testRuntimeClasspath org.parboiled:parboiled-java:1.1.5=runtimeClasspath,testRuntimeClasspath org.pegdown:pegdown:1.4.0=runtimeClasspath,testRuntimeClasspath @@ -204,32 +210,32 @@ org.scala-lang.modules:scala-xml_2.11:1.0.1=compileClasspath,play,routesCompiler org.scala-lang.modules:scala-xml_2.11:1.0.3=twirlCompiler org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc org.scala-lang:scala-compiler:2.11.6=twirlCompiler -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.11.6=compileClasspath,play,routesCompiler,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,twirlCompiler -org.scala-lang:scala-library:2.13.15=zinc +org.scala-lang:scala-library:2.13.16=zinc org.scala-lang:scala-reflect:2.11.6=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,twirlCompiler -org.scala-lang:scala-reflect:2.13.15=zinc -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-lang:scala-reflect:2.13.16=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.scala-stm:scala-stm_2.11:0.7=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.21=compileClasspath,play,runtimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/play-2.5/build.gradle b/dd-smoke-tests/play-2.5/build.gradle index f0e71773b3a..d1084044680 100644 --- a/dd-smoke-tests/play-2.5/build.gradle +++ b/dd-smoke-tests/play-2.5/build.gradle @@ -4,6 +4,7 @@ plugins { apply from: "$rootDir/gradle/java.gradle" apply from: "$rootDir/dd-smoke-tests/play-common/fix-play-routes.gradle" +apply from: "$rootDir/dd-smoke-tests/play-common/fix-play-linux-arm64.gradle" testJvmConstraints { // TODO Java 17: This version of play doesn't support Java 17 diff --git a/dd-smoke-tests/play-2.5/gradle.lockfile b/dd-smoke-tests/play-2.5/gradle.lockfile index 693c2fefaff..4fe79010891 100644 --- a/dd-smoke-tests/play-2.5/gradle.lockfile +++ b/dd-smoke-tests/play-2.5/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:play-2.5:dependencies --write-locks aopalliance:aopalliance:1.0=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath args4j:args4j:2.0.26=javaScriptCompiler cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath @@ -12,7 +13,7 @@ ch.qos.logback:logback-core:1.2.3=compileClasspath,runtimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -27,15 +28,15 @@ com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.7.8=compileClasspath,play com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.7.8=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml:classmate:1.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:1.3.9=javaScriptCompiler @@ -44,15 +45,20 @@ com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClass com.google.code.gson:gson:2.13.2=spotbugs com.google.code.gson:gson:2.2.4=javaScriptCompiler com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:16.0.1=play com.google.guava:guava:18.0=javaScriptCompiler -com.google.guava:guava:19.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:19.0=compileClasspath,runtimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath com.google.inject.extensions:guice-assistedinject:4.0=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.inject:guice:4.0=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath com.google.javascript:closure-compiler-externs:v20141215=javaScriptCompiler com.google.javascript:closure-compiler:v20141215=javaScriptCompiler com.google.protobuf:protobuf-java:2.5.0=javaScriptCompiler -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -98,7 +104,7 @@ commons-io:commons-io:2.20.0=spotbugs commons-io:commons-io:2.4=routesCompiler,runtimeClasspath commons-logging:commons-logging:1.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath io.netty:netty-buffer:4.0.51.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.netty:netty-codec-http:4.0.51.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -122,10 +128,9 @@ javax.xml.bind:jaxb-api:2.3.1=compileClasspath,runtimeClasspath,testCompileClass jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.9.6=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.jodah:typetools:0.4.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.openhft:zero-allocation-hashing:0.16=zinc @@ -164,7 +169,7 @@ org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath @@ -176,8 +181,9 @@ org.jctools:jctools-core:4.0.6=testRuntimeClasspath org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc org.joda:joda-convert:1.8.1=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -206,8 +212,8 @@ org.ow2.asm:asm-util:4.1=runtimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs org.ow2.asm:asm:4.1=runtimeClasspath +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.parboiled:parboiled-core:1.1.5=runtimeClasspath,testRuntimeClasspath org.parboiled:parboiled-java:1.1.5=runtimeClasspath,testRuntimeClasspath org.pegdown:pegdown:1.4.0=runtimeClasspath,testRuntimeClasspath @@ -222,35 +228,35 @@ org.scala-lang.modules:scala-xml_2.11:1.0.1=compileClasspath,play,routesCompiler org.scala-lang.modules:scala-xml_2.11:1.0.3=twirlCompiler org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc org.scala-lang:scala-compiler:2.11.6=twirlCompiler -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.11.11=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang:scala-library:2.11.6=twirlCompiler org.scala-lang:scala-library:2.11.7=routesCompiler -org.scala-lang:scala-library:2.13.15=zinc +org.scala-lang:scala-library:2.13.16=zinc org.scala-lang:scala-reflect:2.11.6=twirlCompiler org.scala-lang:scala-reflect:2.11.7=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-lang:scala-reflect:2.13.15=zinc -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-lang:scala-reflect:2.13.16=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.scala-stm:scala-stm_2.11:0.7=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.21=compileClasspath,play,runtimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/play-2.6/build.gradle b/dd-smoke-tests/play-2.6/build.gradle index 2d95b942697..54272256723 100644 --- a/dd-smoke-tests/play-2.6/build.gradle +++ b/dd-smoke-tests/play-2.6/build.gradle @@ -4,6 +4,7 @@ plugins { apply from: "$rootDir/gradle/java.gradle" apply from: "$rootDir/dd-smoke-tests/play-common/fix-play-routes.gradle" +apply from: "$rootDir/dd-smoke-tests/play-common/fix-play-linux-arm64.gradle" testJvmConstraints { // TODO Java 17: This version of play doesn't support Java 17 diff --git a/dd-smoke-tests/play-2.6/gradle.lockfile b/dd-smoke-tests/play-2.6/gradle.lockfile index 256ba1c84ec..cf8ab5c299b 100644 --- a/dd-smoke-tests/play-2.6/gradle.lockfile +++ b/dd-smoke-tests/play-2.6/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:play-2.6:dependencies --write-locks aopalliance:aopalliance:1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath args4j:args4j:2.0.26=javaScriptCompiler cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath @@ -12,7 +13,7 @@ ch.qos.logback:logback-core:1.2.3=compileClasspath,runtimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -27,32 +28,37 @@ com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.8.11=compileClasspath,pla com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.8.11=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml:classmate:1.3.1=compileClasspath,play com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:1.3.9=javaScriptCompiler,play,runtimeClasspath com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.code.gson:gson:2.2.4=javaScriptCompiler -com.google.errorprone:error_prone_annotations:2.1.3=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.1.3=compileClasspath,play,runtimeClasspath com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:18.0=javaScriptCompiler -com.google.guava:guava:23.6.1-jre=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:23.6.1-jre=compileClasspath,play,runtimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath com.google.inject.extensions:guice-assistedinject:4.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.inject:guice:4.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.j2objc:j2objc-annotations:1.1=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:1.1=compileClasspath,play,runtimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath com.google.javascript:closure-compiler-externs:v20141215=javaScriptCompiler com.google.javascript:closure-compiler:v20141215=javaScriptCompiler com.google.protobuf:protobuf-java:2.5.0=javaScriptCompiler -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -110,7 +116,7 @@ commons-io:commons-io:2.20.0=spotbugs commons-io:commons-io:2.5=routesCompiler commons-io:commons-io:2.6=runtimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.jsonwebtoken:jjwt:0.7.0=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath io.netty:netty-buffer:4.1.43.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -137,10 +143,9 @@ javax.xml.bind:jaxb-api:2.3.1=compileClasspath,play,runtimeClasspath,testCompile jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.9.9=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.jodah:typetools:0.5.0=compileClasspath,play net.openhft:zero-allocation-hashing:0.16=zinc @@ -157,7 +162,7 @@ org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.17.1=zinc org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath -org.checkerframework:checker-compat-qual:2.0.0=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.checkerframework:checker-compat-qual:2.0.0=compileClasspath,play,runtimeClasspath org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc @@ -167,10 +172,10 @@ org.codehaus.groovy:groovy-templates:3.0.23=codenarc org.codehaus.groovy:groovy-xml:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath -org.codehaus.mojo:animal-sniffer-annotations:1.14=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.mojo:animal-sniffer-annotations:1.14=compileClasspath,play,runtimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath @@ -182,8 +187,9 @@ org.jctools:jctools-core:4.0.6=testRuntimeClasspath org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc org.joda:joda-convert:1.9.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -212,8 +218,8 @@ org.ow2.asm:asm-util:5.0.3=runtimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs org.ow2.asm:asm:5.0.3=runtimeClasspath +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.parboiled:parboiled-core:1.1.7=runtimeClasspath,testRuntimeClasspath org.parboiled:parboiled-java:1.1.7=runtimeClasspath,testRuntimeClasspath org.pegdown:pegdown:1.6.0=runtimeClasspath,testRuntimeClasspath @@ -227,34 +233,34 @@ org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=zinc org.scala-lang.modules:scala-xml_2.12:1.0.6=compileClasspath,play,routesCompiler,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,twirlCompiler org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc org.scala-lang:scala-compiler:2.12.4=twirlCompiler -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-library:2.12.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang:scala-library:2.12.8=play,routesCompiler,twirlCompiler -org.scala-lang:scala-library:2.13.15=zinc +org.scala-lang:scala-library:2.13.16=zinc org.scala-lang:scala-reflect:2.12.4=twirlCompiler org.scala-lang:scala-reflect:2.12.8=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-lang:scala-reflect:2.13.15=zinc -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-lang:scala-reflect:2.13.16=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.slf4j:jcl-over-slf4j:1.7.29=compileClasspath,play,runtimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.29=compileClasspath,play,runtimeClasspath diff --git a/dd-smoke-tests/play-2.7/build.gradle b/dd-smoke-tests/play-2.7/build.gradle index 32001a18e7e..a4a6c127de4 100644 --- a/dd-smoke-tests/play-2.7/build.gradle +++ b/dd-smoke-tests/play-2.7/build.gradle @@ -4,6 +4,7 @@ plugins { apply from: "$rootDir/gradle/java.gradle" apply from: "$rootDir/dd-smoke-tests/play-common/fix-play-routes.gradle" +apply from: "$rootDir/dd-smoke-tests/play-common/fix-play-linux-arm64.gradle" testJvmConstraints { // TODO Java 17: This version of play doesn't support Java 17 diff --git a/dd-smoke-tests/play-2.7/gradle.lockfile b/dd-smoke-tests/play-2.7/gradle.lockfile index bd2d325b8c1..3378b9b9728 100644 --- a/dd-smoke-tests/play-2.7/gradle.lockfile +++ b/dd-smoke-tests/play-2.7/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:play-2.7:dependencies --write-locks aopalliance:aopalliance:1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath args4j:args4j:2.0.26=javaScriptCompiler cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath @@ -12,7 +13,7 @@ ch.qos.logback:logback-core:1.2.3=compileClasspath,runtimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -27,34 +28,38 @@ com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.10=compileClasspath,pla com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.10=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml:classmate:1.3.4=compileClasspath,play com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:1.3.9=javaScriptCompiler com.google.code.findbugs:jsr305:3.0.2=compileClasspath,play,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.code.gson:gson:2.2.4=javaScriptCompiler -com.google.errorprone:error_prone_annotations:2.2.0=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.2.0=compileClasspath,play,runtimeClasspath com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:failureaccess:1.0.1=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.1=compileClasspath,play,runtimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:18.0=javaScriptCompiler -com.google.guava:guava:27.1-jre=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:27.1-jre=compileClasspath,play,runtimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.inject.extensions:guice-assistedinject:4.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.inject:guice:4.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.j2objc:j2objc-annotations:1.1=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:1.1=compileClasspath,play,runtimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath com.google.javascript:closure-compiler-externs:v20141215=javaScriptCompiler com.google.javascript:closure-compiler:v20141215=javaScriptCompiler com.google.protobuf:protobuf-java:2.5.0=javaScriptCompiler -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -109,7 +114,7 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs commons-io:commons-io:2.6=runtimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.jsonwebtoken:jjwt:0.9.1=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath io.netty:netty-buffer:4.1.45.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -136,10 +141,9 @@ javax.xml.bind:jaxb-api:2.3.1=compileClasspath,play,runtimeClasspath,testCompile jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.10.1=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.3.1=twirlCompiler net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.jodah:typetools:0.5.0=compileClasspath,play @@ -157,7 +161,7 @@ org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.17.1=zinc org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath -org.checkerframework:checker-qual:2.5.2=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.checkerframework:checker-qual:2.5.2=compileClasspath,play,runtimeClasspath org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc @@ -167,10 +171,10 @@ org.codehaus.groovy:groovy-templates:3.0.23=codenarc org.codehaus.groovy:groovy-xml:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath -org.codehaus.mojo:animal-sniffer-annotations:1.17=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.codehaus.mojo:animal-sniffer-annotations:1.17=compileClasspath,play,runtimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath @@ -182,8 +186,9 @@ org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc org.jline:jline:3.16.0=twirlCompiler -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc org.joda:joda-convert:1.9.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -212,8 +217,8 @@ org.ow2.asm:asm-util:5.0.3=runtimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs org.ow2.asm:asm:5.0.3=runtimeClasspath +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.parboiled:parboiled-core:1.1.7=runtimeClasspath,testRuntimeClasspath org.parboiled:parboiled-java:1.1.7=runtimeClasspath,testRuntimeClasspath org.pegdown:pegdown:1.6.0=runtimeClasspath,testRuntimeClasspath @@ -223,35 +228,35 @@ org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=compileClasspath,play,routesCompiler,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,twirlCompiler,zinc org.scala-lang.modules:scala-xml_2.13:1.2.0=compileClasspath,play,routesCompiler,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,twirlCompiler org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-compiler:2.13.4=twirlCompiler -org.scala-lang:scala-library:2.13.15=zinc +org.scala-lang:scala-library:2.13.16=zinc org.scala-lang:scala-library:2.13.2=compileClasspath,play,routesCompiler,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang:scala-library:2.13.4=twirlCompiler -org.scala-lang:scala-reflect:2.13.15=zinc +org.scala-lang:scala-reflect:2.13.16=zinc org.scala-lang:scala-reflect:2.13.2=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang:scala-reflect:2.13.4=twirlCompiler -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.slf4j:jcl-over-slf4j:1.7.26=compileClasspath,play,runtimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.26=compileClasspath,play,runtimeClasspath diff --git a/dd-smoke-tests/play-2.8-otel/build.gradle b/dd-smoke-tests/play-2.8-otel/build.gradle index 689d177c9dd..420e60e2899 100644 --- a/dd-smoke-tests/play-2.8-otel/build.gradle +++ b/dd-smoke-tests/play-2.8-otel/build.gradle @@ -4,6 +4,7 @@ plugins { apply from: "$rootDir/gradle/java.gradle" apply from: "$rootDir/dd-smoke-tests/play-common/fix-play-routes.gradle" +apply from: "$rootDir/dd-smoke-tests/play-common/fix-play-linux-arm64.gradle" def playVer = "2.8.15" def scalaVer = System.getProperty("scala.version", /* default = */ "2.13") diff --git a/dd-smoke-tests/play-2.8-otel/gradle.lockfile b/dd-smoke-tests/play-2.8-otel/gradle.lockfile index 736c105982b..c213a5af1d2 100644 --- a/dd-smoke-tests/play-2.8-otel/gradle.lockfile +++ b/dd-smoke-tests/play-2.8-otel/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:play-2.8-otel:dependencies --write-locks aopalliance:aopalliance:1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath args4j:args4j:2.0.26=javaScriptCompiler cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath @@ -12,7 +13,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -31,15 +32,15 @@ com.fasterxml.jackson.module:jackson-module-paranamer:2.11.4=compileClasspath,pl com.fasterxml.jackson.module:jackson-module-scala_2.13:2.11.4=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml:classmate:1.3.4=compileClasspath,play com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:1.3.9=javaScriptCompiler @@ -47,18 +48,22 @@ com.google.code.findbugs:jsr305:3.0.2=compileClasspath,play,runtimeClasspath,spo com.google.code.gson:gson:2.13.2=spotbugs com.google.code.gson:gson:2.2.4=javaScriptCompiler com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.errorprone:error_prone_annotations:2.5.1=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.guava:failureaccess:1.0.1=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.5.1=compileClasspath,play,runtimeClasspath +com.google.guava:failureaccess:1.0.1=compileClasspath,play,runtimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:18.0=javaScriptCompiler -com.google.guava:guava:30.1.1-jre=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:30.1.1-jre=compileClasspath,play,runtimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.inject.extensions:guice-assistedinject:5.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.inject:guice:5.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.j2objc:j2objc-annotations:1.3=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:1.3=compileClasspath,play,runtimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath com.google.javascript:closure-compiler-externs:v20141215=javaScriptCompiler com.google.javascript:closure-compiler:v20141215=javaScriptCompiler com.google.protobuf:protobuf-java:2.5.0=javaScriptCompiler -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -113,7 +118,7 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs commons-io:commons-io:2.6=runtimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.jsonwebtoken:jjwt:0.9.1=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath io.netty:netty-buffer:4.1.75.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -128,7 +133,7 @@ io.netty:netty-transport-native-unix-common:4.1.75.Final=compileClasspath,runtim io.netty:netty-transport:4.1.75.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentelemetry:opentelemetry-api:1.24.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentelemetry:opentelemetry-context:1.24.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath jakarta.activation:jakarta.activation-api:1.2.2=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.transaction:jakarta.transaction-api:1.3.3=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.validation:jakarta.validation-api:2.0.2=compileClasspath,play @@ -139,10 +144,9 @@ javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.10.5=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.3.1=twirlCompiler net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.jodah:typetools:0.5.0=compileClasspath,play @@ -158,7 +162,7 @@ org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.17.1=zinc org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath -org.checkerframework:checker-qual:3.8.0=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.checkerframework:checker-qual:3.8.0=compileClasspath,play,runtimeClasspath org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc @@ -170,7 +174,7 @@ org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath @@ -182,7 +186,8 @@ org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc org.jline:jline:3.16.0=twirlCompiler -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -212,8 +217,8 @@ org.ow2.asm:asm-util:5.0.3=runtimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs org.ow2.asm:asm:5.0.3=runtimeClasspath +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.parboiled:parboiled-core:1.1.7=runtimeClasspath,testRuntimeClasspath org.parboiled:parboiled-java:1.1.7=runtimeClasspath,testRuntimeClasspath org.pegdown:pegdown:1.6.0=runtimeClasspath,testRuntimeClasspath @@ -223,36 +228,36 @@ org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=compileClasspath,play,routesCompiler,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,twirlCompiler,zinc org.scala-lang.modules:scala-xml_2.13:1.2.0=compileClasspath,play,routesCompiler,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,twirlCompiler org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-compiler:2.13.4=twirlCompiler -org.scala-lang:scala-library:2.13.15=zinc +org.scala-lang:scala-library:2.13.16=zinc org.scala-lang:scala-library:2.13.4=twirlCompiler org.scala-lang:scala-library:2.13.5=routesCompiler org.scala-lang:scala-library:2.13.8=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang:scala-reflect:2.13.1=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-lang:scala-reflect:2.13.15=zinc +org.scala-lang:scala-reflect:2.13.16=zinc org.scala-lang:scala-reflect:2.13.4=twirlCompiler -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.slf4j:jcl-over-slf4j:1.7.36=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.36=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/play-2.8-split-routes/build.gradle b/dd-smoke-tests/play-2.8-split-routes/build.gradle index 838c9aee693..2721c99b3e0 100644 --- a/dd-smoke-tests/play-2.8-split-routes/build.gradle +++ b/dd-smoke-tests/play-2.8-split-routes/build.gradle @@ -4,6 +4,7 @@ plugins { apply from: "$rootDir/gradle/java.gradle" apply from: "$rootDir/dd-smoke-tests/play-common/fix-play-routes.gradle" +apply from: "$rootDir/dd-smoke-tests/play-common/fix-play-linux-arm64.gradle" def playVer = "2.8.15" def scalaVer = System.getProperty("scala.version", /* default = */ "2.13") diff --git a/dd-smoke-tests/play-2.8-split-routes/gradle.lockfile b/dd-smoke-tests/play-2.8-split-routes/gradle.lockfile index ab84406ccd2..7d1bf92de54 100644 --- a/dd-smoke-tests/play-2.8-split-routes/gradle.lockfile +++ b/dd-smoke-tests/play-2.8-split-routes/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:play-2.8-split-routes:dependencies --write-locks aopalliance:aopalliance:1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath args4j:args4j:2.0.26=javaScriptCompiler cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath @@ -12,7 +13,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -31,15 +32,15 @@ com.fasterxml.jackson.module:jackson-module-paranamer:2.11.4=compileClasspath,pl com.fasterxml.jackson.module:jackson-module-scala_2.13:2.11.4=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml:classmate:1.3.4=compileClasspath,play com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:1.3.9=javaScriptCompiler @@ -47,18 +48,22 @@ com.google.code.findbugs:jsr305:3.0.2=compileClasspath,play,runtimeClasspath,spo com.google.code.gson:gson:2.13.2=spotbugs com.google.code.gson:gson:2.2.4=javaScriptCompiler com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.errorprone:error_prone_annotations:2.5.1=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.guava:failureaccess:1.0.1=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.5.1=compileClasspath,play,runtimeClasspath +com.google.guava:failureaccess:1.0.1=compileClasspath,play,runtimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:18.0=javaScriptCompiler -com.google.guava:guava:30.1.1-jre=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:30.1.1-jre=compileClasspath,play,runtimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.inject.extensions:guice-assistedinject:5.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.inject:guice:5.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.j2objc:j2objc-annotations:1.3=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:1.3=compileClasspath,play,runtimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath com.google.javascript:closure-compiler-externs:v20141215=javaScriptCompiler com.google.javascript:closure-compiler:v20141215=javaScriptCompiler com.google.protobuf:protobuf-java:2.5.0=javaScriptCompiler -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -112,7 +117,7 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs commons-io:commons-io:2.6=runtimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.jsonwebtoken:jjwt:0.9.1=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath io.netty:netty-buffer:4.1.75.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -128,7 +133,7 @@ io.netty:netty-transport:4.1.75.Final=compileClasspath,runtimeClasspath,testComp io.opentracing:opentracing-api:0.32.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentracing:opentracing-noop:0.32.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentracing:opentracing-util:0.32.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath jakarta.activation:jakarta.activation-api:1.2.2=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.transaction:jakarta.transaction-api:1.3.3=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.validation:jakarta.validation-api:2.0.2=compileClasspath,play @@ -139,10 +144,9 @@ javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.10.5=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.3.1=twirlCompiler net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.jodah:typetools:0.5.0=compileClasspath,play @@ -158,7 +162,7 @@ org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.17.1=zinc org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath -org.checkerframework:checker-qual:3.8.0=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.checkerframework:checker-qual:3.8.0=compileClasspath,play,runtimeClasspath org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc @@ -170,7 +174,7 @@ org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath @@ -182,7 +186,8 @@ org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc org.jline:jline:3.16.0=twirlCompiler -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -212,8 +217,8 @@ org.ow2.asm:asm-util:5.0.3=runtimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs org.ow2.asm:asm:5.0.3=runtimeClasspath +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.parboiled:parboiled-core:1.1.7=runtimeClasspath,testRuntimeClasspath org.parboiled:parboiled-java:1.1.7=runtimeClasspath,testRuntimeClasspath org.pegdown:pegdown:1.6.0=runtimeClasspath,testRuntimeClasspath @@ -223,36 +228,36 @@ org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=compileClasspath,play,routesCompiler,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,twirlCompiler,zinc org.scala-lang.modules:scala-xml_2.13:1.2.0=compileClasspath,play,routesCompiler,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,twirlCompiler org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-compiler:2.13.4=twirlCompiler -org.scala-lang:scala-library:2.13.15=zinc +org.scala-lang:scala-library:2.13.16=zinc org.scala-lang:scala-library:2.13.4=twirlCompiler org.scala-lang:scala-library:2.13.5=routesCompiler org.scala-lang:scala-library:2.13.8=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang:scala-reflect:2.13.1=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-lang:scala-reflect:2.13.15=zinc +org.scala-lang:scala-reflect:2.13.16=zinc org.scala-lang:scala-reflect:2.13.4=twirlCompiler -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.slf4j:jcl-over-slf4j:1.7.36=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.36=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/play-2.8/build.gradle b/dd-smoke-tests/play-2.8/build.gradle index 3cf6e17d7f7..95cf5e8c82d 100644 --- a/dd-smoke-tests/play-2.8/build.gradle +++ b/dd-smoke-tests/play-2.8/build.gradle @@ -4,6 +4,7 @@ plugins { apply from: "$rootDir/gradle/java.gradle" apply from: "$rootDir/dd-smoke-tests/play-common/fix-play-routes.gradle" +apply from: "$rootDir/dd-smoke-tests/play-common/fix-play-linux-arm64.gradle" def playVer = "2.8.15" def scalaVer = System.getProperty("scala.version", /* default = */ "2.13") diff --git a/dd-smoke-tests/play-2.8/gradle.lockfile b/dd-smoke-tests/play-2.8/gradle.lockfile index 6a6e694ad46..7c0d09d55e9 100644 --- a/dd-smoke-tests/play-2.8/gradle.lockfile +++ b/dd-smoke-tests/play-2.8/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:play-2.8:dependencies --write-locks aopalliance:aopalliance:1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath args4j:args4j:2.0.26=javaScriptCompiler cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath @@ -12,7 +13,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -31,15 +32,15 @@ com.fasterxml.jackson.module:jackson-module-paranamer:2.11.4=compileClasspath,pl com.fasterxml.jackson.module:jackson-module-scala_2.13:2.11.4=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml:classmate:1.3.4=compileClasspath,play com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:1.3.9=javaScriptCompiler @@ -47,18 +48,22 @@ com.google.code.findbugs:jsr305:3.0.2=compileClasspath,play,runtimeClasspath,spo com.google.code.gson:gson:2.13.2=spotbugs com.google.code.gson:gson:2.2.4=javaScriptCompiler com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.errorprone:error_prone_annotations:2.5.1=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.guava:failureaccess:1.0.1=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.5.1=compileClasspath,play,runtimeClasspath +com.google.guava:failureaccess:1.0.1=compileClasspath,play,runtimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath com.google.guava:guava:18.0=javaScriptCompiler -com.google.guava:guava:30.1.1-jre=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:30.1.1-jre=compileClasspath,play,runtimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.inject.extensions:guice-assistedinject:5.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.inject:guice:5.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.j2objc:j2objc-annotations:1.3=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:1.3=compileClasspath,play,runtimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath com.google.javascript:closure-compiler-externs:v20141215=javaScriptCompiler com.google.javascript:closure-compiler:v20141215=javaScriptCompiler com.google.protobuf:protobuf-java:2.5.0=javaScriptCompiler -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.lmax:disruptor:3.4.2=zinc com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -115,7 +120,7 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs commons-io:commons-io:2.6=runtimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.github.java-diff-utils:java-diff-utils:4.12=zinc +io.github.java-diff-utils:java-diff-utils:4.15=zinc io.jsonwebtoken:jjwt:0.9.1=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath io.netty:netty-buffer:4.1.75.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -143,10 +148,9 @@ javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.10.5=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath -net.java.dev.jna:jna:5.14.0=zinc net.java.dev.jna:jna:5.3.1=twirlCompiler net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.jodah:typetools:0.5.0=compileClasspath,play @@ -164,7 +168,7 @@ org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.17.1=zinc org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath -org.checkerframework:checker-qual:3.8.0=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.checkerframework:checker-qual:3.8.0=compileClasspath,play,runtimeClasspath org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc @@ -176,7 +180,7 @@ org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.fusesource.jansi:jansi:2.4.0=zinc +org.fusesource.jansi:jansi:2.4.1=zinc org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath @@ -188,7 +192,8 @@ org.jline:jline-native:3.27.1=zinc org.jline:jline-terminal-jni:3.27.1=zinc org.jline:jline-terminal:3.27.1=zinc org.jline:jline:3.16.0=twirlCompiler -org.jline:jline:3.26.3=zinc +org.jline:jline:3.27.1=zinc +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -218,8 +223,8 @@ org.ow2.asm:asm-util:5.0.3=runtimeClasspath org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs org.ow2.asm:asm:5.0.3=runtimeClasspath +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.parboiled:parboiled-core:1.1.7=runtimeClasspath,testRuntimeClasspath org.parboiled:parboiled-java:1.1.7=runtimeClasspath,testRuntimeClasspath org.pegdown:pegdown:1.6.0=runtimeClasspath,testRuntimeClasspath @@ -229,36 +234,36 @@ org.scala-lang.modules:scala-parallel-collections_2.13:0.2.0=zinc org.scala-lang.modules:scala-parser-combinators_2.13:1.1.2=compileClasspath,play,routesCompiler,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,twirlCompiler,zinc org.scala-lang.modules:scala-xml_2.13:1.2.0=compileClasspath,play,routesCompiler,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,twirlCompiler org.scala-lang.modules:scala-xml_2.13:2.3.0=zinc -org.scala-lang:scala-compiler:2.13.15=zinc +org.scala-lang:scala-compiler:2.13.16=zinc org.scala-lang:scala-compiler:2.13.4=twirlCompiler -org.scala-lang:scala-library:2.13.15=zinc +org.scala-lang:scala-library:2.13.16=zinc org.scala-lang:scala-library:2.13.4=twirlCompiler org.scala-lang:scala-library:2.13.5=routesCompiler org.scala-lang:scala-library:2.13.8=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.scala-lang:scala-reflect:2.13.1=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.scala-lang:scala-reflect:2.13.15=zinc +org.scala-lang:scala-reflect:2.13.16=zinc org.scala-lang:scala-reflect:2.13.4=twirlCompiler -org.scala-sbt.jline:jline:2.14.7-sbt-9c3b6aca11c57e339441442bbf58e550cdfecb79=zinc -org.scala-sbt:collections_2.13:1.10.4=zinc -org.scala-sbt:compiler-bridge_2.13:1.10.4=zinc -org.scala-sbt:compiler-interface:1.10.4=zinc -org.scala-sbt:core-macros_2.13:1.10.4=zinc -org.scala-sbt:io_2.13:1.10.1=zinc +org.scala-sbt.jline:jline:2.14.7-sbt-9a88bc413e2b34a4580c001c654d1a7f4f65bf18=zinc +org.scala-sbt:collections_2.13:1.11.5=zinc +org.scala-sbt:compiler-bridge_2.13:1.12.0=zinc +org.scala-sbt:compiler-interface:1.12.0=zinc +org.scala-sbt:core-macros_2.13:1.11.5=zinc +org.scala-sbt:io_2.13:1.10.5=zinc org.scala-sbt:launcher-interface:1.4.4=zinc org.scala-sbt:sbinary_2.13:0.5.1=zinc -org.scala-sbt:util-control_2.13:1.10.4=zinc -org.scala-sbt:util-interface:1.10.4=zinc -org.scala-sbt:util-logging_2.13:1.10.4=zinc -org.scala-sbt:util-position_2.13:1.10.4=zinc -org.scala-sbt:util-relation_2.13:1.10.4=zinc -org.scala-sbt:zinc-apiinfo_2.13:1.10.4=zinc -org.scala-sbt:zinc-classfile_2.13:1.10.4=zinc -org.scala-sbt:zinc-classpath_2.13:1.10.4=zinc -org.scala-sbt:zinc-compile-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-core_2.13:1.10.4=zinc -org.scala-sbt:zinc-persist-core-assembly:1.10.4=zinc -org.scala-sbt:zinc-persist_2.13:1.10.4=zinc -org.scala-sbt:zinc_2.13:1.10.4=zinc +org.scala-sbt:util-control_2.13:1.11.5=zinc +org.scala-sbt:util-interface:1.11.5=zinc +org.scala-sbt:util-logging_2.13:1.11.5=zinc +org.scala-sbt:util-position_2.13:1.11.5=zinc +org.scala-sbt:util-relation_2.13:1.11.5=zinc +org.scala-sbt:zinc-apiinfo_2.13:1.12.0=zinc +org.scala-sbt:zinc-classfile_2.13:1.12.0=zinc +org.scala-sbt:zinc-classpath_2.13:1.12.0=zinc +org.scala-sbt:zinc-compile-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-core_2.13:1.12.0=zinc +org.scala-sbt:zinc-persist-core-assembly:1.12.0=zinc +org.scala-sbt:zinc-persist_2.13:1.12.0=zinc +org.scala-sbt:zinc_2.13:1.12.0=zinc org.slf4j:jcl-over-slf4j:1.7.36=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.36=compileClasspath,play,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/play-common/fix-play-linux-arm64.gradle b/dd-smoke-tests/play-common/fix-play-linux-arm64.gradle new file mode 100644 index 00000000000..1c3e27fabc0 --- /dev/null +++ b/dd-smoke-tests/play-common/fix-play-linux-arm64.gradle @@ -0,0 +1,61 @@ +import datadog.gradle.plugin.HostPlatform + +// Fix for JVM crashes (SIGSEGV / SIGABRT, exit 134) when the +// org.gradle.playframework `compilePlayRoutes` Worker Daemon starts up on Linux arm64. +// No-op on every other host/arch combination. +if (HostPlatform.isLinuxArm64()) { + tasks.named("compilePlayRoutes").configure { task -> + // Find the class in the hierarchy that declares the private `workerExecutor` field. + def workerExecutorField = null + def declaringClass = task.getClass() + while (declaringClass != null && workerExecutorField == null) { + try { + workerExecutorField = declaringClass.getDeclaredField("workerExecutor") + } catch (NoSuchFieldException ignored) { + declaringClass = declaringClass.getSuperclass() + } + } + if (workerExecutorField == null) { + throw new GradleException( + "compilePlayRoutes task class ${task.getClass().name} has no workerExecutor field; " + + "fix-play-linux-arm64 needs to be updated for this version of the play plugin.") + } + workerExecutorField.accessible = true + + def cl = declaringClass.getClassLoader() + def specClass = cl.loadClass('org.gradle.playframework.tools.internal.routes.DefaultRoutesCompileSpec') + def workActionClass = cl.loadClass('org.gradle.playframework.tasks.internal.RoutesCompileWorkAction') + def factoryClass = cl.loadClass('org.gradle.playframework.tools.internal.routes.RoutesCompilerFactory') + // The `platform` value at runtime is `PlayPlatform_Decorated` (Gradle's generated subclass). + // `Class.getMethod` requires an exact parameter-type match, so look up the undecorated type. + def platformClass = cl.loadClass('org.gradle.playframework.extensions.PlayPlatform') + + task.actions.clear() + task.doLast { + def spec = specClass.getConstructors()[0].newInstance( + task.source.files, + task.outputDirectory.get().asFile, + task.javaProject, + task.namespaceReverseRouter.get(), + task.generateReverseRoutes.get(), + task.injectedRoutesGenerator.get(), + task.additionalImports.get(), + projectDir + ) + + def workerExecutor = workerExecutorField.get(task) + def platform = task.platform.get() + def compiler = factoryClass.getMethod('create', platformClass).invoke(null, platform) + + workerExecutor.processIsolation { workerSpec -> + workerSpec.forkOptions { options -> + options.jvmArgs("-XX:MaxMetaspaceSize=256m", "-Xshare:off") + } + workerSpec.classpath.from(task.routesCompilerClasspath) + }.submit(workActionClass) { parameters -> + parameters.compiler.set(compiler) + parameters.spec.set(spec) + } + } + } +} diff --git a/dd-smoke-tests/profiling-integration-tests/gradle.lockfile b/dd-smoke-tests/profiling-integration-tests/gradle.lockfile index 1b857582f84..761f736d5ba 100644 --- a/dd-smoke-tests/profiling-integration-tests/gradle.lockfile +++ b/dd-smoke-tests/profiling-integration-tests/gradle.lockfile @@ -1,6 +1,8 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:profiling-integration-tests:dependencies --write-locks +at.yawk.lz4:lz4-java:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,7 +10,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testRuntimeClasspath @@ -17,22 +19,26 @@ com.fasterxml.jackson.core:jackson-core:2.20.0=testCompileClasspath,testRuntimeC com.fasterxml.jackson.core:jackson-databind:2.20.0=testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.20.0=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=runtimeClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=runtimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:mockwebserver:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -49,13 +55,13 @@ io.opentracing.contrib:opentracing-tracerresolver:0.1.6=compileClasspath,runtime io.opentracing:opentracing-api:0.32.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentracing:opentracing-noop:0.32.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentracing:opentracing-util:0.32.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:4.0.1=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.12=testCompileClasspath junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -85,6 +91,7 @@ org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.javadelight:delight-fileupload:0.0.5=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=runtimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -97,7 +104,6 @@ org.junit.platform:junit-platform-suite-api:1.14.1=testRuntimeClasspath org.junit.platform:junit-platform-suite-commons:1.14.1=testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath -org.lz4:lz4-java:1.7.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.mockito:mockito-core:4.4.0=testCompileClasspath,testRuntimeClasspath org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspath org.msgpack:msgpack-core:0.8.24=testRuntimeClasspath @@ -113,9 +119,9 @@ org.ow2.asm:asm-tree:9.7.1=compileClasspath,runtimeClasspath,testCompileClasspat org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.7.1=compileClasspath,runtimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.owasp.encoder:encoder:1.2.3=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/profiling-integration-tests/src/main/java/datadog/smoketest/profiling/ProfilingTestApplication.java b/dd-smoke-tests/profiling-integration-tests/src/main/java/datadog/smoketest/profiling/ProfilingTestApplication.java index 8d7a5d67c0c..5db03d485a2 100644 --- a/dd-smoke-tests/profiling-integration-tests/src/main/java/datadog/smoketest/profiling/ProfilingTestApplication.java +++ b/dd-smoke-tests/profiling-integration-tests/src/main/java/datadog/smoketest/profiling/ProfilingTestApplication.java @@ -4,7 +4,6 @@ import datadog.trace.api.profiling.Profiling; import datadog.trace.api.profiling.ProfilingContextAttribute; import datadog.trace.api.profiling.ProfilingScope; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.lang.management.ManagementFactory; import java.lang.management.ThreadMXBean; import java.util.List; @@ -54,7 +53,6 @@ public static void main(final String[] args) throws Exception { } @Trace - @SuppressFBWarnings("DM_GC") private static void tracedMethod() throws InterruptedException { System.out.println("Tracing"); tracedBusyMethod(); @@ -68,7 +66,6 @@ private static void tracedMethod() throws InterruptedException { } @Trace - @SuppressFBWarnings("DMI_RANDOM_USED_ONLY_ONCE") private static void tracedBusyMethod() { long startTime = THREAD_MX_BEAN.getCurrentThreadCpuTime(); Random random = new Random(); diff --git a/dd-smoke-tests/quarkus-native/application/build.gradle b/dd-smoke-tests/quarkus-native/application/build.gradle index 50e12545671..65beb08e810 100644 --- a/dd-smoke-tests/quarkus-native/application/build.gradle +++ b/dd-smoke-tests/quarkus-native/application/build.gradle @@ -15,6 +15,10 @@ if (hasProperty('appBuildDir')) { version = "" +// Avoid unlimited CPU usage on CI. +def isCI = providers.environmentVariable("CI").isPresent() +def ciBuildCpuCount = providers.environmentVariable("KUBERNETES_CPU_REQUEST").getOrElse("4") + dependencies { implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}") implementation 'io.quarkus:quarkus-resteasy' @@ -25,3 +29,26 @@ dependencies { } } +if (hasProperty('agentJar')) { + // The Quarkus Gradle plugin reads `quarkus.native.additional-build-args` from + // MicroProfile Config, which honours system properties. Setting it at script + // evaluation time is equivalent to passing `-Dquarkus.native.additional-build-args=...` + // on the gradle invocation, but keeps the agent jar path resolution inside this + // script (where `agentJar` is forwarded by the outer smoke-test plugin). + // + // Note, however, the way these system properties are set in this nested project + // are not properly tracked by this nested gradle build cache, it needs to be tracked + // from the outside (see smokeTestApp). + final agentJar = property('agentJar') + def nativeBuildArgs = [ + "-J-javaagent:${agentJar}", + "-J-Ddatadog.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd'T'HH:mm:ss.SSS'Z [dd.trace]'", + "-J-Ddd.profiling.enabled=true", + "-march=native", + ] + if (isCI) { + nativeBuildArgs.add("-H:NumberOfThreads=$ciBuildCpuCount") + nativeBuildArgs.add("-J-XX:ActiveProcessorCount=$ciBuildCpuCount") + } + System.setProperty('quarkus.native.additional-build-args', nativeBuildArgs.join(',')) +} diff --git a/dd-smoke-tests/quarkus-native/application/settings.gradle b/dd-smoke-tests/quarkus-native/application/settings.gradle index 0354c75957a..b638bdb51d2 100644 --- a/dd-smoke-tests/quarkus-native/application/settings.gradle +++ b/dd-smoke-tests/quarkus-native/application/settings.gradle @@ -1,37 +1,7 @@ pluginManagement { - repositories { - mavenLocal() - if (settings.hasProperty("gradlePluginProxy")) { - maven { - url settings["gradlePluginProxy"] - allowInsecureProtocol = true - } - } - if (settings.hasProperty("mavenRepositoryProxy")) { - maven { - url settings["mavenRepositoryProxy"] - allowInsecureProtocol = true - } - } - gradlePluginPortal() - mavenCentral() - } plugins { id 'io.quarkus' version "${quarkusPluginVersion}" } } -def isCI = providers.environmentVariable("CI").isPresent() - -// Don't pollute the dependency cache with the build cache -if (isCI) { - def sharedRootDir = "$rootDir/../../../" - buildCache { - local { - // This needs to line up with the code in the outer project settings.gradle - directory = "$sharedRootDir/workspace/build-cache" - } - } -} - rootProject.name='quarkus-native-smoketest' diff --git a/dd-smoke-tests/quarkus-native/application/src/main/resources/application.properties b/dd-smoke-tests/quarkus-native/application/src/main/resources/application.properties index c913c3f19fe..2e3c80d417d 100644 --- a/dd-smoke-tests/quarkus-native/application/src/main/resources/application.properties +++ b/dd-smoke-tests/quarkus-native/application/src/main/resources/application.properties @@ -1,4 +1,5 @@ quarkus.log.level=INFO quarkus.log.category."datadog.smoketest".level=DEBUG quarkus.log.console.format=%d %-5p [%c] '%t' |MT|%X{dd.trace_id}|MS|%X{dd.span_id}|%m%e%n +quarkus.native.native-image-xmx=4g diff --git a/dd-smoke-tests/quarkus-native/build.gradle b/dd-smoke-tests/quarkus-native/build.gradle index 89d43864d70..d06e823c2d1 100644 --- a/dd-smoke-tests/quarkus-native/build.gradle +++ b/dd-smoke-tests/quarkus-native/build.gradle @@ -1,81 +1,78 @@ +import java.util.concurrent.Callable import java.util.regex.Pattern +plugins { + id 'dd-trace-java.smoke-test-app' +} + apply from: "$rootDir/gradle/java.gradle" +description = 'Quarkus Native Smoke Tests.' + dependencies { testImplementation project(':dd-smoke-tests') testImplementation libs.bundles.jmc } -// Check 'testJvm' gradle command parameter is GraalVM (e.g., -PtestJvm=graalvm21), -// if not nothing is done + +// Quarkus 3.12.1's native-image step requires at least Mandrel/GraalVM 23.1 (JDK 21-based) +// No `maxJavaVersion` as it currently runs on GraalVM25 +testJvmConstraints { + minJavaVersion = JavaVersion.VERSION_21 + nativeImageCapable = true +} + +// The following makes `quarkusNativeBuild` only run when Gradle is passed `-PtestJvm=graalvm21` or later. def testJvm = gradle.startParameter.projectProperties.getOrDefault('testJvm', '') def graalvmMatcher = Pattern.compile("graalvm([0-9]+)").matcher(testJvm?.toLowerCase(Locale.ROOT) ?: '') def testGraalvmVersion = graalvmMatcher.find() ? Integer.parseInt(graalvmMatcher.group(1)) : -1 +def isSupportedGraalvm = testGraalvmVersion >= 21 +Provider graalvmHome = providers.provider({ + if (!isSupportedGraalvm) { + throw new GradleException("Set -PtestJvm=graalvm (N >= 21) to build the native image for this smoke test.") + } + getLazyJavaHomeFor(testGraalvmVersion, true).toString() +} as Callable) -if (testGraalvmVersion >= 17) { - // GraalVM with native-image capability for native compilation - def graalvmHome = getLazyJavaHomeFor(testGraalvmVersion, true) - // For GraalVM 21+ we need Java 17+ to run Gradle, for earlier versions use GraalVM itself - def gradleJavaHome = testGraalvmVersion >= 21 ? getLazyJavaHomeFor(17) : graalvmHome - // Configure build directory for application - def appDir = "$projectDir/application" - def appBuildDir = "$buildDir/application" - def isWindows = System.getProperty('os.name').toLowerCase().contains('win') - def gradlewCommand = isWindows ? 'gradlew.bat' : 'gradlew' - - // Define the task that builds the project - tasks.register('quarkusNativeBuild', Exec) { - workingDir "$appDir" - environment += [ - 'GRADLE_OPTS' : "-Dorg.gradle.jvmargs='-Xmx512M'", - 'JAVA_HOME' : gradleJavaHome, - 'GRAALVM_HOME': graalvmHome - ] - commandLine( - "$rootDir/${gradlewCommand}", - 'build', - '--no-daemon', +smokeTestApp { + gradleApp { + taskName = 'quarkusNativeBuild' + nestedTasks = ['build'] + artifactPath = 'quarkus-native-smoketest--runner' + sysProperty = 'datadog.smoketest.quarkus.native.executable' + buildArguments.addAll( '--max-workers=4', - "-Dquarkus.native.enabled=true", - "-Dquarkus.package.jar.enabled=false", - "-PappBuildDir=$appBuildDir", - "-PapiJar=${project(':dd-trace-api').tasks.jar.archiveFile.get()}", - "-Dquarkus.native.additional-build-args=-J-javaagent:${project(':dd-java-agent').tasks.shadowJar.archiveFile.get()}," + - "-J-Ddatadog.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd'T'HH:mm:ss.SSS'Z [dd.trace]'," + - "-J-Ddd.profiling.enabled=true,-march=native" + '-Dquarkus.native.enabled=true', + '-Dquarkus.package.jar.enabled=false', ) - outputs.cacheIf { true } - outputs.dir(appBuildDir) - .withPropertyName('nativeApplication') - inputs.files(fileTree(appDir) { - include '**/*' - exclude '.gradle/**' - }).withPropertyName('application') - .withPathSensitivity(PathSensitivity.RELATIVE) - inputs.file(project(':dd-trace-api').tasks.jar.archiveFile.get()).withPropertyName('apiJar') - inputs.file(project(':dd-java-agent').tasks.shadowJar.archiveFile.get()).withPropertyName('agentJar') + environment.put('GRAALVM_HOME', graalvmHome) } + projectJar('apiJar', project(':dd-trace-api')) + projectJar('agentJar', project(':dd-java-agent'), 'shadow') +} - tasks.named('quarkusNativeBuild') { - dependsOn project(':dd-trace-api').tasks.named("jar") // Use dev @Trace annotation - dependsOn project(':dd-java-agent').tasks.named('shadowJar') // Use dev agent - } +tasks.named('quarkusNativeBuild') { + onlyIf("Requires -PtestJvm=graalvm (N >= 21)") { isSupportedGraalvm } +} - tasks.named('compileTestGroovy') { - dependsOn 'quarkusNativeBuild' - outputs.upToDateWhen { - !quarkusNativeBuild.didWork - } +tasks.named('compileTestGroovy', GroovyCompile) { + dependsOn 'quarkusNativeBuild' + onlyIf { isSupportedGraalvm } + outputs.upToDateWhen { + !tasks.named('quarkusNativeBuild').get().didWork } +} - tasks.withType(Test).configureEach { - jvmArgs "-Ddatadog.smoketest.quarkus.native.executable=$appBuildDir/quarkus-native-smoketest--runner" - jvmArgs "-Ddd.profiling.enabled=true" - } -} else { - tasks.withType(Test).configureEach { - enabled = false - } +tasks.withType(Test).configureEach { + // Skip when no supported GraalVM was selected — `testJvmConstraints` only checks for a + // native-image-capable launcher, so a daemon JVM that happens to be GraalVM 21 would + // Keep the tests tied to the explicit GraalVM selection used to build the native + // executable. Without this, `testJvmConstraints` may allow the `Test` task when the + // daemon itself is native-image capable, even though `quarkusNativeBuild` was skipped. + onlyIf("Requires -PtestJvm=graalvm (N >= 21)") { isSupportedGraalvm } + // The test JVM is only a harness that starts the native executable, so run it with + // the default project toolchain instead of the selected GraalVM. + javaLauncher = javaToolchains.launcherFor(java.toolchain) + jvmArgs "-Ddd.profiling.enabled=true" } spotless { diff --git a/dd-smoke-tests/quarkus-native/gradle.lockfile b/dd-smoke-tests/quarkus-native/gradle.lockfile index 9806a1c5cb6..96954ce3e62 100644 --- a/dd-smoke-tests/quarkus-native/gradle.lockfile +++ b/dd-smoke-tests/quarkus-native/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:quarkus-native:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -72,6 +77,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -99,8 +105,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.owasp.encoder:encoder:1.2.3=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath @@ -113,4 +119,4 @@ org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeCla org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -empty=annotationProcessor,runtimeClasspath,spotbugsPlugins,testAnnotationProcessor +empty=annotationProcessor,runtimeClasspath,smokeTestAppExtraJarAgentJar,smokeTestAppExtraJarApiJar,spotbugsPlugins,testAnnotationProcessor diff --git a/dd-smoke-tests/quarkus/application/build.gradle b/dd-smoke-tests/quarkus/application/build.gradle index 40d01f03d90..7fa5badaf5e 100644 --- a/dd-smoke-tests/quarkus/application/build.gradle +++ b/dd-smoke-tests/quarkus/application/build.gradle @@ -15,6 +15,11 @@ if (hasProperty('appBuildDir')) { version = "" +// Pin bytecode target: the nested daemon now runs on JDK 21, but Quarkus 1.9 supports Java 8. +java { + sourceCompatibility = JavaVersion.VERSION_1_8 +} + dependencies { implementation enforcedPlatform("${quarkusPlatformGroupId}:${quarkusPlatformArtifactId}:${quarkusPlatformVersion}") implementation 'io.quarkus:quarkus-resteasy' diff --git a/dd-smoke-tests/quarkus/application/settings.gradle b/dd-smoke-tests/quarkus/application/settings.gradle index fcd4ec7366b..ba43aae92d5 100644 --- a/dd-smoke-tests/quarkus/application/settings.gradle +++ b/dd-smoke-tests/quarkus/application/settings.gradle @@ -1,37 +1,9 @@ +// The inner `plugins { id 'io.quarkus' ... }` block resolves the Quarkus version from a +// `quarkusPluginVersion` Gradle property forwarded by the outer build. pluginManagement { - repositories { - mavenLocal() - if (settings.hasProperty("gradlePluginProxy")) { - maven { - url settings["gradlePluginProxy"] - allowInsecureProtocol = true - } - } - if (settings.hasProperty("mavenRepositoryProxy")) { - maven { - url settings["mavenRepositoryProxy"] - allowInsecureProtocol = true - } - } - gradlePluginPortal() - mavenCentral() - } plugins { id 'io.quarkus' version "${quarkusPluginVersion}" } } -def isCI = providers.environmentVariable("CI").isPresent() - -// Don't pollute the dependency cache with the build cache -if (isCI) { - def sharedRootDir = "$rootDir/../../../" - buildCache { - local { - // This needs to line up with the code in the outer project settings.gradle - directory = "$sharedRootDir/workspace/build-cache" - } - } -} - rootProject.name='quarkus-smoketest' diff --git a/dd-smoke-tests/quarkus/build.gradle b/dd-smoke-tests/quarkus/build.gradle index 56f0cee613a..f9967bbd48f 100644 --- a/dd-smoke-tests/quarkus/build.gradle +++ b/dd-smoke-tests/quarkus/build.gradle @@ -1,3 +1,7 @@ +plugins { + id 'dd-trace-java.smoke-test-app' +} + apply from: "$rootDir/gradle/java.gradle" testJvmConstraints { @@ -5,54 +9,35 @@ testJvmConstraints { maxJavaVersion = JavaVersion.VERSION_21 } -dependencies { - testImplementation project(':dd-smoke-tests') -} - -def appDir = "$projectDir/application" -def appBuildDir = "$buildDir/application" -def isWindows = System.getProperty("os.name").toLowerCase().contains("win") -def gradlewCommand = isWindows ? 'gradlew.bat' : 'gradlew' - -// define the task that builds the quarkus project -tasks.register('quarkusBuild', Exec) { - workingDir "$appDir" - environment += [ - "GRADLE_OPTS": "-Dorg.gradle.jvmargs='-Xmx512M'", - "JAVA_HOME": getLazyJavaHomeFor(8) - ] - commandLine "${rootDir}/${gradlewCommand}", "build", "--no-daemon", "--max-workers=4", "-PappBuildDir=$appBuildDir", "-PapiJar=${project(':dd-trace-api').tasks.jar.archiveFile.get()}" - - outputs.cacheIf { true } +description = 'Quarkus Smoke Tests.' - outputs.dir(appBuildDir) - .withPropertyName("applicationJar") - - inputs.files(fileTree(appDir) { - include '**/*' - exclude '.gradle/**' - }) - .withPropertyName("application") - .withPathSensitivity(PathSensitivity.RELATIVE) +smokeTestApp { + // Quarkus 1.9.2 (Sep 2020) cannot run on JDK 21; use Java 11 launcher + javaLauncher = javaToolchains.launcherFor { + languageVersion = JavaLanguageVersion.of(11) + } + gradleApp { + taskName = 'quarkusBuild' + nestedTasks = ['build'] + // Quarkus' uber-jar is named `-runner.jar`; here the inner project has no + // version, so the artifact name is `quarkus-smoketest--runner.jar`. + artifactPath = 'quarkus-smoketest--runner.jar' + sysProperty = 'datadog.smoketest.quarkus.uberJar.path' + } + projectJar('apiJar', project(':dd-trace-api')) } -evaluationDependsOn ':dd-trace-api' - -tasks.named("quarkusBuild", Exec) { - dependsOn project(':dd-trace-api').tasks.named("jar") +dependencies { + testImplementation project(':dd-smoke-tests') } tasks.named("compileTestGroovy", GroovyCompile) { dependsOn 'quarkusBuild' outputs.upToDateWhen { - !quarkusBuild.didWork + !tasks.named('quarkusBuild').get().didWork } } -tasks.withType(Test).configureEach { - jvmArgs "-Ddatadog.smoketest.quarkus.uberJar.path=$appBuildDir/quarkus-smoketest--runner.jar" -} - spotless { java { target "**/*.java" diff --git a/dd-smoke-tests/quarkus/gradle.lockfile b/dd-smoke-tests/quarkus/gradle.lockfile index 5b801a39bfb..b31cf3dd860 100644 --- a/dd-smoke-tests/quarkus/gradle.lockfile +++ b/dd-smoke-tests/quarkus/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:quarkus:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -72,6 +77,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -96,8 +102,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath @@ -109,4 +115,4 @@ org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeCla org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -empty=annotationProcessor,runtimeClasspath,spotbugsPlugins,testAnnotationProcessor +empty=annotationProcessor,runtimeClasspath,smokeTestAppExtraJarApiJar,spotbugsPlugins,testAnnotationProcessor diff --git a/dd-smoke-tests/ratpack-1.5/gradle.lockfile b/dd-smoke-tests/ratpack-1.5/gradle.lockfile index 0b2f5e4e077..6d33384caac 100644 --- a/dd-smoke-tests/ratpack-1.5/gradle.lockfile +++ b/dd-smoke-tests/ratpack-1.5/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:ratpack-1.5:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -21,22 +22,27 @@ com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.8.7=compileClasspath,runt com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.8.7=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.ben-manes.caffeine:caffeine:2.4.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:21.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:21.0=compileClasspath,runtimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -62,8 +68,8 @@ io.ratpack:ratpack-exec:1.5.0=compileClasspath,runtimeClasspath,testCompileClass javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -92,6 +98,7 @@ org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.javassist:javassist:3.19.0-GA=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -116,8 +123,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.0.final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/resteasy/gradle.lockfile b/dd-smoke-tests/resteasy/gradle.lockfile index 64b6e59c0f3..722b1e74470 100644 --- a/dd-smoke-tests/resteasy/gradle.lockfile +++ b/dd-smoke-tests/resteasy/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:resteasy:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -19,22 +20,26 @@ com.fasterxml.jackson.jaxrs:jackson-jaxrs-base:2.8.3=compileClasspath,runtimeCla com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider:2.8.3=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.fasterxml.jackson.module:jackson-module-jaxb-annotations:2.8.3=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -64,8 +69,8 @@ javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath javax.validation:validation-api:1.1.0.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.jcip:jcip-annotations:1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -113,6 +118,7 @@ org.jboss.xnio:xnio-api:3.3.6.Final=compileClasspath,runtimeClasspath,testCompil org.jboss.xnio:xnio-nio:3.3.6.Final=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -138,8 +144,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/rum/gradle.lockfile b/dd-smoke-tests/rum/gradle.lockfile index 271a8d75872..12e898901ec 100644 --- a/dd-smoke-tests/rum/gradle.lockfile +++ b/dd-smoke-tests/rum/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:rum:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=compileClasspath,runtimeClasspath,testCompile com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=runtimeClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=runtimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=compileClasspath,runtimeClasspath,testCompileClassp commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=runtimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=runtimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=runtimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=runtimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=runtimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -72,6 +77,7 @@ org.hamcrest:hamcrest-core:1.3=runtimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=runtimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -96,8 +102,8 @@ org.ow2.asm:asm-tree:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/rum/tomcat-10/gradle.lockfile b/dd-smoke-tests/rum/tomcat-10/gradle.lockfile index bf0151c96b8..ef6a6fdc629 100644 --- a/dd-smoke-tests/rum/tomcat-10/gradle.lockfile +++ b/dd-smoke-tests/rum/tomcat-10/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:rum:tomcat-10:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -39,13 +44,13 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath jakarta.servlet:jakarta.servlet-api:5.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -78,6 +83,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -102,8 +108,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/rum/tomcat-11/gradle.lockfile b/dd-smoke-tests/rum/tomcat-11/gradle.lockfile index b1b6cde25c1..0f68d8f1333 100644 --- a/dd-smoke-tests/rum/tomcat-11/gradle.lockfile +++ b/dd-smoke-tests/rum/tomcat-11/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:rum:tomcat-11:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -39,13 +44,13 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath jakarta.servlet:jakarta.servlet-api:6.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -78,6 +83,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -102,8 +108,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/rum/tomcat-9/gradle.lockfile b/dd-smoke-tests/rum/tomcat-9/gradle.lockfile index 182612e1e88..15164270697 100644 --- a/dd-smoke-tests/rum/tomcat-9/gradle.lockfile +++ b/dd-smoke-tests/rum/tomcat-9/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:rum:tomcat-9:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:4.0.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -77,6 +82,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -101,8 +107,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/rum/wildfly-15/build.gradle b/dd-smoke-tests/rum/wildfly-15/build.gradle index 00cc72f1b01..2be56770cd8 100644 --- a/dd-smoke-tests/rum/wildfly-15/build.gradle +++ b/dd-smoke-tests/rum/wildfly-15/build.gradle @@ -1,3 +1,10 @@ +import datadog.buildlogic.smoketest.NestedGradleBuild + +plugins { + id 'dd-trace-java.smoke-test-app' + id 'dd-trace-java.mass' +} + ext { serverName = 'wildfly' //serverModule = 'servlet' @@ -8,7 +15,7 @@ ext { repositories { ivy { - url = 'https://github.com/wildfly/wildfly/releases/download/' + url = mass.artifactUrl('github.com/wildfly/wildfly/releases/download/') // Restrict this repository to WildFly distribution artifacts only. // Without this filter, Gradle may probe this host for unrelated dependencies // (for example JUnit/Mockito), which makes the build flaky when the host is unreachable. @@ -49,29 +56,17 @@ dependencies { testImplementation project(':dd-smoke-tests') } -def appDir = "$projectDir/rum-ear" -def appBuildDir = "$buildDir/rm-ear" -def isWindows = System.getProperty("os.name").toLowerCase().contains("win") -def gradlewCommand = isWindows ? 'gradlew.bat' : 'gradlew' -// define the task that builds the quarkus project -tasks.register('earBuild', Exec) { - workingDir "$appDir" - environment += ["GRADLE_OPTS": "-Dorg.gradle.jvmargs='-Xmx512M'"] - commandLine "$rootDir/${gradlewCommand}", "assemble", "--no-daemon", "--max-workers=4", "-PappBuildDir=$appBuildDir", "-PapiJar=${project(':dd-trace-api').tasks.jar.archiveFile.get()}" - - outputs.cacheIf { true } - - outputs.dir(appBuildDir) - .withPropertyName("applicationEar") - - inputs.files(fileTree(appDir) { - include '**/*' - exclude '.gradle/**' - }) - .withPropertyName("application") - .withPathSensitivity(PathSensitivity.RELATIVE) - - dependsOn project(':dd-trace-api').tasks.named("jar") +def appBuildDir = layout.buildDirectory.dir("rm-ear") +evaluationDependsOn(':dd-trace-api') +def apiJarTask = project(':dd-trace-api').tasks.named('jar') + +// Run the nested EAR build through the Gradle Tooling API. +tasks.register('earBuild', NestedGradleBuild) { + applicationDir = layout.projectDirectory.dir("rum-ear") + applicationBuildDir = appBuildDir + tasksToRun = ['assemble'] + projectJar('apiJar', apiJarTask.flatMap { it.archiveFile }) + dependsOn apiJarTask } tasks.named("compileTestGroovy", GroovyCompile) { @@ -121,8 +116,8 @@ tasks.withType(Jar).configureEach { def wildflyDir = "${buildDir}/${serverName}-${serverVersion}" tasks.register("deploy", Copy) { - dependsOn 'unzip' - from "${appBuildDir}/libs/wildfly-rum-ear-smoketest.ear" + dependsOn 'unzip', 'earBuild' + from appBuildDir.map { it.file("libs/wildfly-rum-ear-smoketest.ear") } into "${wildflyDir}/standalone/deployments" } diff --git a/dd-smoke-tests/rum/wildfly-15/gradle.lockfile b/dd-smoke-tests/rum/wildfly-15/gradle.lockfile index 0711c09078d..b2b143facee 100644 --- a/dd-smoke-tests/rum/wildfly-15/gradle.lockfile +++ b/dd-smoke-tests/rum/wildfly-15/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:rum:wildfly-15:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -72,6 +77,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -96,8 +102,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/rum/wildfly-15/rum-ear/build.gradle b/dd-smoke-tests/rum/wildfly-15/rum-ear/build.gradle index 74d2ad6687f..325bad58510 100644 --- a/dd-smoke-tests/rum/wildfly-15/rum-ear/build.gradle +++ b/dd-smoke-tests/rum/wildfly-15/rum-ear/build.gradle @@ -14,6 +14,12 @@ if (hasProperty('appBuildDir')) { buildDir = property('appBuildDir') } +// Pin bytecode target: the nested daemon now runs on JDK 21, but the deployed EAR runs in +// WildFly on Java 8. +java { + sourceCompatibility = JavaVersion.VERSION_1_8 +} + dependencies { deploy project(path: ':war', configuration: 'archives') } diff --git a/dd-smoke-tests/rum/wildfly-15/rum-ear/settings.gradle b/dd-smoke-tests/rum/wildfly-15/rum-ear/settings.gradle index 3a73f18a9c6..6ed979cd530 100644 --- a/dd-smoke-tests/rum/wildfly-15/rum-ear/settings.gradle +++ b/dd-smoke-tests/rum/wildfly-15/rum-ear/settings.gradle @@ -1,36 +1,3 @@ -pluginManagement { - repositories { - mavenLocal() - if (settings.hasProperty("gradlePluginProxy")) { - maven { - url settings["gradlePluginProxy"] - allowInsecureProtocol = true - } - } - if (settings.hasProperty("mavenRepositoryProxy")) { - maven { - url settings["mavenRepositoryProxy"] - allowInsecureProtocol = true - } - } - gradlePluginPortal() - mavenCentral() - } -} - -def isCI = providers.environmentVariable("CI").isPresent() - -// Don't pollute the dependency cache with the build cache -if (isCI) { - def sharedRootDir = "$rootDir/../../../../" - buildCache { - local { - // This needs to line up with the code in the outer project settings.gradle - directory = "$sharedRootDir/workspace/build-cache" - } - } -} - rootProject.name='wildfly-rum-ear-smoketest' include 'war' diff --git a/dd-smoke-tests/rum/wildfly-15/rum-ear/war/build.gradle b/dd-smoke-tests/rum/wildfly-15/rum-ear/war/build.gradle index d27749a97de..03c4f6f35e9 100644 --- a/dd-smoke-tests/rum/wildfly-15/rum-ear/war/build.gradle +++ b/dd-smoke-tests/rum/wildfly-15/rum-ear/war/build.gradle @@ -1,6 +1,12 @@ apply plugin: 'java' apply plugin: 'war' +// Pin bytecode target: the nested daemon now runs on JDK 21, but the WAR is deployed in +// WildFly on Java 8. +java { + sourceCompatibility = JavaVersion.VERSION_1_8 +} + repositories { mavenLocal() if (project.rootProject.hasProperty("mavenRepositoryProxy")) { diff --git a/dd-smoke-tests/sample-trace/gradle.lockfile b/dd-smoke-tests/sample-trace/gradle.lockfile index 5b801a39bfb..59fd1c9462b 100644 --- a/dd-smoke-tests/sample-trace/gradle.lockfile +++ b/dd-smoke-tests/sample-trace/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:sample-trace:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -72,6 +77,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -96,8 +102,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/spring-boot-2.3-webmvc-jetty/build.gradle b/dd-smoke-tests/spring-boot-2.3-webmvc-jetty/build.gradle index 40289a9b80f..4b81b679eb6 100644 --- a/dd-smoke-tests/spring-boot-2.3-webmvc-jetty/build.gradle +++ b/dd-smoke-tests/spring-boot-2.3-webmvc-jetty/build.gradle @@ -17,7 +17,8 @@ tasks.named("jar", Jar) { } tasks.named("shadowJar", ShadowJar) { - configurations = [project.configurations.runtimeClasspath] + configurations.add(project.configurations.named('runtimeClasspath')) + duplicatesStrategy = DuplicatesStrategy.INCLUDE mergeServiceFiles() append 'META-INF/spring.handlers' append 'META-INF/spring.schemas' @@ -26,6 +27,15 @@ tasks.named("shadowJar", ShadowJar) { paths = ['META-INF/spring.factories'] mergeStrategy = "append" } + filesNotMatching([ + 'META-INF/services/**', + 'META-INF/spring.handlers', + 'META-INF/spring.schemas', + 'META-INF/spring.tooling', + 'META-INF/spring.factories', + ]) { + duplicatesStrategy = DuplicatesStrategy.EXCLUDE + } } dependencies { diff --git a/dd-smoke-tests/spring-boot-2.3-webmvc-jetty/gradle.lockfile b/dd-smoke-tests/spring-boot-2.3-webmvc-jetty/gradle.lockfile index 3973b586ff7..2dc9a29e615 100644 --- a/dd-smoke-tests/spring-boot-2.3-webmvc-jetty/gradle.lockfile +++ b/dd-smoke-tests/spring-boot-2.3-webmvc-jetty/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:spring-boot-2.3-webmvc-jetty:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -10,7 +11,7 @@ ch.qos.logback:logback-core:1.2.3=compileClasspath,runtimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -21,22 +22,26 @@ com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.0=compileClasspath,run com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.14.9=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.14.9=testCompileClasspath,testRuntimeClasspath @@ -47,15 +52,15 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.servlet:jakarta.servlet-api:4.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.websocket:jakarta.websocket-api:1.1.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:4.0.1=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -109,6 +114,7 @@ org.hamcrest:hamcrest-core:2.2=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -137,8 +143,8 @@ org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs org.ow2.asm:asm:7.3.1=compileClasspath,runtimeClasspath +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/spring-boot-2.4-webflux/build.gradle b/dd-smoke-tests/spring-boot-2.4-webflux/build.gradle index bef36cc4224..14b06473a6a 100644 --- a/dd-smoke-tests/spring-boot-2.4-webflux/build.gradle +++ b/dd-smoke-tests/spring-boot-2.4-webflux/build.gradle @@ -16,7 +16,7 @@ tasks.named("jar", Jar) { } tasks.named("shadowJar", ShadowJar) { - configurations = [project.configurations.runtimeClasspath] + configurations.add(project.configurations.named('runtimeClasspath')) } dependencies { diff --git a/dd-smoke-tests/spring-boot-2.4-webflux/gradle.lockfile b/dd-smoke-tests/spring-boot-2.4-webflux/gradle.lockfile index e5cda768a83..7b77cab2421 100644 --- a/dd-smoke-tests/spring-boot-2.4-webflux/gradle.lockfile +++ b/dd-smoke-tests/spring-boot-2.4-webflux/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:spring-boot-2.4-webflux:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -10,7 +11,7 @@ ch.qos.logback:logback-core:1.2.3=compileClasspath,runtimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -21,22 +22,26 @@ com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.11.3=compileClasspath,run com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson.module:jackson-module-parameter-names:2.11.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -64,13 +69,13 @@ io.netty:netty-transport:4.1.53.Final=compileClasspath,runtimeClasspath,testComp io.projectreactor.netty:reactor-netty-core:1.0.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.projectreactor.netty:reactor-netty-http:1.0.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.projectreactor:reactor-core:3.4.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -100,6 +105,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -124,8 +130,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/spring-boot-2.5-webflux/build.gradle b/dd-smoke-tests/spring-boot-2.5-webflux/build.gradle index 39212e8f4ae..55be4f6c8d2 100644 --- a/dd-smoke-tests/spring-boot-2.5-webflux/build.gradle +++ b/dd-smoke-tests/spring-boot-2.5-webflux/build.gradle @@ -16,7 +16,7 @@ tasks.named("jar", Jar) { } tasks.named("shadowJar", ShadowJar) { - configurations = [project.configurations.runtimeClasspath] + configurations.add(project.configurations.named('runtimeClasspath')) } dependencies { diff --git a/dd-smoke-tests/spring-boot-2.5-webflux/gradle.lockfile b/dd-smoke-tests/spring-boot-2.5-webflux/gradle.lockfile index 1ed1dd42eb5..2a0c9be5bc6 100644 --- a/dd-smoke-tests/spring-boot-2.5-webflux/gradle.lockfile +++ b/dd-smoke-tests/spring-boot-2.5-webflux/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:spring-boot-2.5-webflux:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -10,7 +11,7 @@ ch.qos.logback:logback-core:1.2.3=compileClasspath,runtimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -22,22 +23,26 @@ com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.12.3=compileClasspath,r com.fasterxml.jackson.module:jackson-module-parameter-names:2.12.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.12.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -66,13 +71,13 @@ io.netty:netty-transport:4.1.63.Final=compileClasspath,runtimeClasspath,testComp io.projectreactor.netty:reactor-netty-core:1.0.7=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.projectreactor.netty:reactor-netty-http:1.0.7=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.projectreactor:reactor-core:3.4.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -102,6 +107,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -126,8 +132,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/spring-boot-2.6-webflux/build.gradle b/dd-smoke-tests/spring-boot-2.6-webflux/build.gradle index 516a2b79890..9effa4ad620 100644 --- a/dd-smoke-tests/spring-boot-2.6-webflux/build.gradle +++ b/dd-smoke-tests/spring-boot-2.6-webflux/build.gradle @@ -17,7 +17,8 @@ tasks.named("jar", Jar) { } tasks.named("shadowJar", ShadowJar) { - configurations = [project.configurations.runtimeClasspath] + configurations.add(project.configurations.named('runtimeClasspath')) + duplicatesStrategy = DuplicatesStrategy.INCLUDE mergeServiceFiles() append 'META-INF/spring.handlers' append 'META-INF/spring.schemas' @@ -26,6 +27,15 @@ tasks.named("shadowJar", ShadowJar) { paths = ['META-INF/spring.factories'] mergeStrategy = "append" } + filesNotMatching([ + 'META-INF/services/**', + 'META-INF/spring.handlers', + 'META-INF/spring.schemas', + 'META-INF/spring.tooling', + 'META-INF/spring.factories', + ]) { + duplicatesStrategy = DuplicatesStrategy.EXCLUDE + } } dependencies { diff --git a/dd-smoke-tests/spring-boot-2.6-webflux/gradle.lockfile b/dd-smoke-tests/spring-boot-2.6-webflux/gradle.lockfile index 8a700caf23b..08cb911eb91 100644 --- a/dd-smoke-tests/spring-boot-2.6-webflux/gradle.lockfile +++ b/dd-smoke-tests/spring-boot-2.6-webflux/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:spring-boot-2.6-webflux:dependencies --write-locks antlr:antlr:2.7.7=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath @@ -11,7 +12,7 @@ ch.qos.logback:logback-core:1.2.7=compileClasspath,runtimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -24,22 +25,26 @@ com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.0=compileClassp com.fasterxml.jackson:jackson-bom:2.13.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.fasterxml:classmate:1.5.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.h2database:h2:2.1.214=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -81,7 +86,7 @@ io.netty:netty-transport:4.1.70.Final=compileClasspath,runtimeClasspath,testComp io.projectreactor.netty:reactor-netty-core:1.0.13=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.projectreactor.netty:reactor-netty-http:1.0.13=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.projectreactor:reactor-core:3.4.12=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath jakarta.activation:jakarta.activation-api:1.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath jakarta.persistence:jakarta.persistence-api:2.2.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -90,9 +95,9 @@ jakarta.xml.bind:jakarta.xml.bind-api:2.3.3=compileClasspath,runtimeClasspath,te javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath net.bytebuddy:byte-buddy:1.11.20=compileClasspath,runtimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -129,6 +134,7 @@ org.jboss.logging:jboss-logging:3.4.2.Final=compileClasspath,runtimeClasspath,te org.jboss:jandex:2.2.3.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -154,8 +160,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.reactivestreams:reactive-streams:1.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.32=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/spring-boot-2.6-webmvc/build.gradle b/dd-smoke-tests/spring-boot-2.6-webmvc/build.gradle index e1526a84512..9bd8b15c896 100644 --- a/dd-smoke-tests/spring-boot-2.6-webmvc/build.gradle +++ b/dd-smoke-tests/spring-boot-2.6-webmvc/build.gradle @@ -18,7 +18,8 @@ tasks.named("jar", Jar) { } tasks.named("shadowJar", ShadowJar) { - configurations = [project.configurations.runtimeClasspath] + configurations.add(project.configurations.named('runtimeClasspath')) + duplicatesStrategy = DuplicatesStrategy.INCLUDE mergeServiceFiles() append 'META-INF/spring.handlers' append 'META-INF/spring.schemas' @@ -27,6 +28,15 @@ tasks.named("shadowJar", ShadowJar) { paths = ['META-INF/spring.factories'] mergeStrategy = "append" } + filesNotMatching([ + 'META-INF/services/**', + 'META-INF/spring.handlers', + 'META-INF/spring.schemas', + 'META-INF/spring.tooling', + 'META-INF/spring.factories', + ]) { + duplicatesStrategy = DuplicatesStrategy.EXCLUDE + } } dependencies { diff --git a/dd-smoke-tests/spring-boot-2.6-webmvc/gradle.lockfile b/dd-smoke-tests/spring-boot-2.6-webmvc/gradle.lockfile index 5cf07cd7433..c356a920d69 100644 --- a/dd-smoke-tests/spring-boot-2.6-webmvc/gradle.lockfile +++ b/dd-smoke-tests/spring-boot-2.6-webmvc/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:spring-boot-2.6-webmvc:dependencies --write-locks antlr:antlr:2.7.7=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -9,7 +10,7 @@ ch.qos.logback:logback-core:1.2.13=compileClasspath,runtimeClasspath,testCompile com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -22,23 +23,27 @@ com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.0=compileClassp com.fasterxml.jackson:jackson-bom:2.13.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.fasterxml:classmate:1.5.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.10=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.h2database:h2:2.1.214=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -66,7 +71,7 @@ commons-lang:commons-lang:1.0.1=compileClasspath,runtimeClasspath,testCompileCla commons-logging:commons-logging:1.1.3=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:2.1.3=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jakarta.mail:jakarta.mail-api:2.0.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -76,8 +81,8 @@ jakarta.xml.bind:jakarta.xml.bind-api:2.3.3=compileClasspath,runtimeClasspath,te javax.servlet:javax.servlet-api:3.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -126,6 +131,7 @@ org.jboss.logging:jboss-logging:3.4.2.Final=compileClasspath,runtimeClasspath,te org.jboss:jandex:2.2.3.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -151,8 +157,8 @@ org.ow2.asm:asm-tree:9.7.1=runtimeClasspath,testFixturesRuntimeClasspath,testRun org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.32=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/spring-boot-2.7-webflux/application/build.gradle b/dd-smoke-tests/spring-boot-2.7-webflux/application/build.gradle index 0b434bb8aac..58a25bc14e9 100644 --- a/dd-smoke-tests/spring-boot-2.7-webflux/application/build.gradle +++ b/dd-smoke-tests/spring-boot-2.7-webflux/application/build.gradle @@ -16,6 +16,11 @@ if (hasProperty('appBuildDir')) { version = "" +// Target Java 8 bytecode as daemon can run on JDK 21 +java { + sourceCompatibility = JavaVersion.VERSION_1_8 +} + dependencies { implementation 'org.springframework.boot:spring-boot-starter-webflux' implementation 'org.springframework.boot:spring-boot-starter-data-jpa' diff --git a/dd-smoke-tests/spring-boot-2.7-webflux/application/settings.gradle b/dd-smoke-tests/spring-boot-2.7-webflux/application/settings.gradle index a265d2effdb..9b9ee52f7cb 100644 --- a/dd-smoke-tests/spring-boot-2.7-webflux/application/settings.gradle +++ b/dd-smoke-tests/spring-boot-2.7-webflux/application/settings.gradle @@ -1,34 +1 @@ -pluginManagement { - repositories { - mavenLocal() - if (settings.hasProperty("gradlePluginProxy")) { - maven { - url settings["gradlePluginProxy"] - allowInsecureProtocol = true - } - } - if (settings.hasProperty("mavenRepositoryProxy")) { - maven { - url settings["mavenRepositoryProxy"] - allowInsecureProtocol = true - } - } - gradlePluginPortal() - mavenCentral() - } -} - -def isCI = providers.environmentVariable("CI").isPresent() - -// Don't pollute the dependency cache with the build cache -if (isCI) { - def sharedRootDir = "$rootDir/../../../" - buildCache { - local { - // This needs to line up with the code in the outer project settings.gradle - directory = "$sharedRootDir/workspace/build-cache" - } - } -} - rootProject.name='webflux-2.7-smoketest' diff --git a/dd-smoke-tests/spring-boot-2.7-webflux/build.gradle b/dd-smoke-tests/spring-boot-2.7-webflux/build.gradle index ec403dc3c20..adae38e89e8 100644 --- a/dd-smoke-tests/spring-boot-2.7-webflux/build.gradle +++ b/dd-smoke-tests/spring-boot-2.7-webflux/build.gradle @@ -1,40 +1,23 @@ -apply from: "$rootDir/gradle/java.gradle" - -description = 'Spring Boot 2.7 Webflux Smoke Tests.' - -dependencies { - testImplementation project(':dd-smoke-tests') +plugins { + id 'dd-trace-java.smoke-test-app' } -def appDir = "$projectDir/application" -def appBuildDir = "$buildDir/application" -def isWindows = System.getProperty("os.name").toLowerCase().contains("win") -def gradlewCommand = isWindows ? 'gradlew.bat' : 'gradlew' - -// define the task that builds the project -tasks.register('webfluxBuild', Exec) { - workingDir "$appDir" - environment += [ - "GRADLE_OPTS": "-Dorg.gradle.jvmargs='-Xmx512M'", - "JAVA_HOME": getLazyJavaHomeFor(8) - ] - commandLine "$rootDir/${gradlewCommand}", "bootJar", "--no-daemon", "--max-workers=4", "-PappBuildDir=$appBuildDir", "-PapiJar=${project(':dd-trace-api').tasks.jar.archiveFile.get()}" - - outputs.cacheIf { true } +apply from: "$rootDir/gradle/java.gradle" - outputs.dir(appBuildDir) - .withPropertyName("applicationJar") +description = 'Spring Boot 2.7 Webflux Smoke Tests.' - inputs.files(fileTree(appDir) { - include '**/*' - exclude '.gradle/**' - }) - .withPropertyName("application") - .withPathSensitivity(PathSensitivity.RELATIVE) +smokeTestApp { + gradleApp { + taskName = 'webfluxBuild' + nestedTasks = ['bootJar'] + artifactPath = 'libs/webflux-2.7-smoketest.jar' + sysProperty = 'datadog.smoketest.webflux.uberJar.path' + } + projectJar('apiJar', project(':dd-trace-api')) } -tasks.named("webfluxBuild", Exec) { - dependsOn project(':dd-trace-api').tasks.named("jar") +dependencies { + testImplementation project(':dd-smoke-tests') } tasks.named("compileTestGroovy", GroovyCompile) { @@ -44,10 +27,6 @@ tasks.named("compileTestGroovy", GroovyCompile) { } } -tasks.withType(Test).configureEach { - jvmArgs "-Ddatadog.smoketest.webflux.uberJar.path=$appBuildDir/libs/webflux-2.7-smoketest.jar" -} - spotless { java { target "**/*.java" diff --git a/dd-smoke-tests/spring-boot-2.7-webflux/gradle.lockfile b/dd-smoke-tests/spring-boot-2.7-webflux/gradle.lockfile index 5b801a39bfb..c6548adc0a8 100644 --- a/dd-smoke-tests/spring-boot-2.7-webflux/gradle.lockfile +++ b/dd-smoke-tests/spring-boot-2.7-webflux/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:spring-boot-2.7-webflux:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -72,6 +77,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -96,8 +102,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath @@ -109,4 +115,4 @@ org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeCla org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -empty=annotationProcessor,runtimeClasspath,spotbugsPlugins,testAnnotationProcessor +empty=annotationProcessor,runtimeClasspath,smokeTestAppExtraJarApiJar,spotbugsPlugins,testAnnotationProcessor diff --git a/dd-smoke-tests/spring-boot-3.0-native/application/build.gradle b/dd-smoke-tests/spring-boot-3.0-native/application/build.gradle index 59a758aa5bc..08545cf1e16 100644 --- a/dd-smoke-tests/spring-boot-3.0-native/application/build.gradle +++ b/dd-smoke-tests/spring-boot-3.0-native/application/build.gradle @@ -13,10 +13,21 @@ apply from: "$sharedConfigDirectory/repositories.gradle" ext.withProfiler = hasProperty('profiler') +// Avoid unlimited CPU usage on CI. +def isCI = providers.environmentVariable("CI").isPresent() +def ciBuildCpuCount = providers.environmentVariable("KUBERNETES_CPU_REQUEST").getOrElse("4") + if (hasProperty('appBuildDir')) { buildDir = property('appBuildDir') } +// Spring Boot 3.0's bundled ASM 9.4 only parses class files up to major 64 (Java 20), so +// target release 17 here regardless of the daemon JDK — keeps the inner app's class files +// at major 61 and avoids needing a separate Java 17 toolchain for the nested build. +tasks.withType(JavaCompile).configureEach { + options.release = 17 +} + dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' if (hasProperty('apiJar')) { @@ -40,6 +51,10 @@ if (hasProperty('agentPath')) { buildArgs.add("-J-Ddd.profiling.scrub.enabled=true") buildArgs.add("-J-Ddd.profiling.start-force-first=true") } + if (isCI) { + buildArgs.add("-H:NumberOfThreads=$ciBuildCpuCount") + buildArgs.add("-J-XX:ActiveProcessorCount=$ciBuildCpuCount") + } jvmArgs.add("-Xmx4096M") } } diff --git a/dd-smoke-tests/spring-boot-3.0-native/application/settings.gradle b/dd-smoke-tests/spring-boot-3.0-native/application/settings.gradle index 7fcf0cee762..6a385f675d4 100644 --- a/dd-smoke-tests/spring-boot-3.0-native/application/settings.gradle +++ b/dd-smoke-tests/spring-boot-3.0-native/application/settings.gradle @@ -1,34 +1 @@ -pluginManagement { - repositories { - mavenLocal() - if (settings.hasProperty("gradlePluginProxy")) { - maven { - url settings["gradlePluginProxy"] - allowInsecureProtocol = true - } - } - if (settings.hasProperty("mavenRepositoryProxy")) { - maven { - url settings["mavenRepositoryProxy"] - allowInsecureProtocol = true - } - } - gradlePluginPortal() - mavenCentral() - } -} - -def isCI = providers.environmentVariable("CI").isPresent() - -// Don't pollute the dependency cache with the build cache -if (isCI) { - def sharedRootDir = "$rootDir/../../../" - buildCache { - local { - // This needs to line up with the code in the outer project settings.gradle - directory = "$sharedRootDir/workspace/build-cache" - } - } -} - rootProject.name='native-3.0-smoketest' diff --git a/dd-smoke-tests/spring-boot-3.0-native/build.gradle b/dd-smoke-tests/spring-boot-3.0-native/build.gradle index e0dda4c6db6..c986996bfd3 100644 --- a/dd-smoke-tests/spring-boot-3.0-native/build.gradle +++ b/dd-smoke-tests/spring-boot-3.0-native/build.gradle @@ -1,5 +1,10 @@ +import java.util.concurrent.Callable import java.util.regex.Pattern +plugins { + id 'dd-trace-java.smoke-test-app' +} + apply from: "$rootDir/gradle/java.gradle" description = 'Spring Boot 3.0 Native Smoke Tests.' @@ -9,77 +14,63 @@ dependencies { testImplementation libs.bundles.jmc } -// Check 'testJvm' gradle command parameter is GraalVM (e.g., -PtestJvm=graalvm21), -// if not nothing is done +// The nested build compiles the application with `--release 17`, so Spring Boot 3.0's +// build-time classpath scanners don't see class files from the selected GraalVM release. +testJvmConstraints { + minJavaVersion = JavaVersion.VERSION_17 + nativeImageCapable = true +} + +// The following makes `springNativeBuild` only run when Gradle is passed `-PtestJvm=graalvm17` or later. def testJvm = gradle.startParameter.projectProperties.getOrDefault('testJvm', '') def graalvmMatcher = Pattern.compile("graalvm([0-9]+)").matcher(testJvm?.toLowerCase(Locale.ROOT) ?: '') def testGraalvmVersion = graalvmMatcher.find() ? Integer.parseInt(graalvmMatcher.group(1)) : -1 - -if (testGraalvmVersion >= 17) { - // GraalVM with native-image capability for native compilation - def graalvmHome = getLazyJavaHomeFor(testGraalvmVersion, true) - // For GraalVM 21+ we need Java 17+ to run Gradle, for earlier versions use GraalVM itself - def gradleJavaHome = testGraalvmVersion >= 21 ? getLazyJavaHomeFor(17) : graalvmHome - // Configure build directory for application - def appDir = "$projectDir/application" - def appBuildDir = "$buildDir/application" - def isWindows = System.getProperty('os.name').toLowerCase().contains('win') - def gradlewCommand = isWindows ? 'gradlew.bat' : 'gradlew' - - // Define the task that builds the project - tasks.register('springNativeBuild', Exec) { - workingDir "$appDir" - environment += [ - 'GRADLE_OPTS': "-Dorg.gradle.jvmargs='-Xmx1024M'", - 'JAVA_HOME': gradleJavaHome, - 'GRAALVM_HOME': graalvmHome, - 'DD_TRACE_METHODS' : 'datadog.smoketest.springboot.controller.WebController[sayHello]', - 'NATIVE_IMAGE_DEPRECATED_BUILDER_SANITATION' : 'true' - ] - commandLine( - "$rootDir/${gradlewCommand}", - 'nativeCompile', - '--no-daemon', - '--max-workers=4', - "-PappBuildDir=$appBuildDir", - "-PapiJar=${project(':dd-trace-api').tasks.jar.archiveFile.get()}", - "-PagentPath=${project(':dd-java-agent').tasks.shadowJar.archiveFile.get()}", - "-Pprofiler=true" - ) - outputs.cacheIf { true } - outputs.dir(appBuildDir) - .withPropertyName('nativeApplication') - inputs.files(fileTree(appDir) { - include '**/*' - exclude '.gradle/**' - }).withPropertyName('application') - .withPathSensitivity(PathSensitivity.RELATIVE) - inputs.file(project(':dd-trace-api').tasks.jar.archiveFile.get()).withPropertyName('apiJar') - inputs.file(project(':dd-java-agent').tasks.shadowJar.archiveFile.get()).withPropertyName('agentJar') +def isSupportedGraalvm = testGraalvmVersion >= 17 +Provider graalvmHome = providers.provider({ + if (!isSupportedGraalvm) { + throw new GradleException("Set -PtestJvm=graalvm (N >= 17) to build the native image for this smoke test.") } + getLazyJavaHomeFor(testGraalvmVersion, true).toString() +} as Callable) - springNativeBuild { - dependsOn project(':dd-trace-api').tasks.named("jar") // Use dev @Trace annotation - dependsOn project(':dd-java-agent').tasks.named('shadowJar') // Use dev agent +smokeTestApp { + gradleApp { + taskName = 'springNativeBuild' + nestedTasks = ['nativeCompile'] + artifactPath = 'native/nativeCompile/native-3.0-smoketest' + sysProperty = 'datadog.smoketest.spring.native.executable' + buildArguments.addAll('--max-workers=4', '-Pprofiler=true') + environment.put('GRAALVM_HOME', graalvmHome) + environment.put('DD_TRACE_METHODS', 'datadog.smoketest.springboot.controller.WebController[sayHello]') + environment.put('NATIVE_IMAGE_DEPRECATED_BUILDER_SANITATION', 'true') } + projectJar('apiJar', project(':dd-trace-api')) + projectJar('agentPath', project(':dd-java-agent'), 'shadow') +} - tasks.named('compileTestGroovy') { - dependsOn 'springNativeBuild' - outputs.upToDateWhen { - !springNativeBuild.didWork - } - } +tasks.named('springNativeBuild') { + onlyIf("Requires -PtestJvm=graalvm (N >= 17)") { isSupportedGraalvm } +} - tasks.withType(Test).configureEach { - jvmArgs "-Ddatadog.smoketest.spring.native.executable=$appBuildDir/native/nativeCompile/native-3.0-smoketest" - jvmArgs "-Ddd.profiling.enabled=true" - } -} else { - tasks.withType(Test).configureEach { - enabled = false +tasks.named('compileTestGroovy', GroovyCompile) { + dependsOn 'springNativeBuild' + onlyIf { isSupportedGraalvm } + outputs.upToDateWhen { + !tasks.named('springNativeBuild').get().didWork } } +tasks.withType(Test).configureEach { + // Keep the tests tied to the explicit GraalVM selection used to build the native + // executable. Without this, `testJvmConstraints` may allow the Test task when the + // daemon itself is native-image capable, even though `springNativeBuild` was skipped. + onlyIf("Requires -PtestJvm=graalvm (N >= 17)") { isSupportedGraalvm } + // The test JVM is only a harness that starts the native executable, so run it with + // the default project toolchain instead of the selected GraalVM. + javaLauncher = javaToolchains.launcherFor(java.toolchain) + jvmArgs "-Ddd.profiling.enabled=true" +} + spotless { java { target "**/*.java" diff --git a/dd-smoke-tests/spring-boot-3.0-native/gradle.lockfile b/dd-smoke-tests/spring-boot-3.0-native/gradle.lockfile index 9806a1c5cb6..bce626b0e81 100644 --- a/dd-smoke-tests/spring-boot-3.0-native/gradle.lockfile +++ b/dd-smoke-tests/spring-boot-3.0-native/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:spring-boot-3.0-native:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -72,6 +77,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -99,8 +105,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.owasp.encoder:encoder:1.2.3=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath @@ -113,4 +119,4 @@ org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeCla org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -empty=annotationProcessor,runtimeClasspath,spotbugsPlugins,testAnnotationProcessor +empty=annotationProcessor,runtimeClasspath,smokeTestAppExtraJarAgentPath,smokeTestAppExtraJarApiJar,spotbugsPlugins,testAnnotationProcessor diff --git a/dd-smoke-tests/spring-boot-3.0-webflux/application/build.gradle b/dd-smoke-tests/spring-boot-3.0-webflux/application/build.gradle index 416dea657d2..76dcf9c3da2 100644 --- a/dd-smoke-tests/spring-boot-3.0-webflux/application/build.gradle +++ b/dd-smoke-tests/spring-boot-3.0-webflux/application/build.gradle @@ -16,6 +16,12 @@ if (hasProperty('appBuildDir')) { version = "" +// Pin bytecode target: the nested daemon now runs on JDK 21, but the smoke test launches +// the produced jar on Java 17 (per testJvmConstraints). +java { + sourceCompatibility = JavaVersion.VERSION_17 +} + dependencies { implementation 'org.springframework.boot:spring-boot-starter-webflux' implementation 'org.springframework.boot:spring-boot-starter-data-jpa' diff --git a/dd-smoke-tests/spring-boot-3.0-webflux/application/settings.gradle b/dd-smoke-tests/spring-boot-3.0-webflux/application/settings.gradle index 3e4297888f9..eaaebc83945 100644 --- a/dd-smoke-tests/spring-boot-3.0-webflux/application/settings.gradle +++ b/dd-smoke-tests/spring-boot-3.0-webflux/application/settings.gradle @@ -1,34 +1 @@ -pluginManagement { - repositories { - mavenLocal() - if (settings.hasProperty("gradlePluginProxy")) { - maven { - url settings["gradlePluginProxy"] - allowInsecureProtocol = true - } - } - if (settings.hasProperty("mavenRepositoryProxy")) { - maven { - url settings["mavenRepositoryProxy"] - allowInsecureProtocol = true - } - } - gradlePluginPortal() - mavenCentral() - } -} - -def isCI = providers.environmentVariable("CI").isPresent() - -// Don't pollute the dependency cache with the build cache -if (isCI) { - def sharedRootDir = "$rootDir/../../../" - buildCache { - local { - // This needs to line up with the code in the outer project settings.gradle - directory = "$sharedRootDir/workspace/build-cache" - } - } -} - rootProject.name='webflux-3.0-smoketest' diff --git a/dd-smoke-tests/spring-boot-3.0-webflux/build.gradle b/dd-smoke-tests/spring-boot-3.0-webflux/build.gradle index 6138aef945d..2479e28ac89 100644 --- a/dd-smoke-tests/spring-boot-3.0-webflux/build.gradle +++ b/dd-smoke-tests/spring-boot-3.0-webflux/build.gradle @@ -1,3 +1,7 @@ +plugins { + id 'dd-trace-java.smoke-test-app' +} + apply from: "$rootDir/gradle/java.gradle" testJvmConstraints { @@ -6,39 +10,18 @@ testJvmConstraints { description = 'Spring Boot 3.0 Webflux Smoke Tests.' -dependencies { - testImplementation project(':dd-smoke-tests') -} - -def appDir = "$projectDir/application" -def appBuildDir = "$buildDir/application" -def isWindows = System.getProperty("os.name").toLowerCase().contains("win") -def gradlewCommand = isWindows ? 'gradlew.bat' : 'gradlew' - -// define the task that builds the project -tasks.register('webfluxBuild30', Exec) { - workingDir "$appDir" - environment += [ - "GRADLE_OPTS": "-Dorg.gradle.jvmargs='-Xmx512M'", - "JAVA_HOME": getLazyJavaHomeFor(17) - ] - commandLine "$rootDir/${gradlewCommand}", "bootJar", "--no-daemon", "--max-workers=4", "-PappBuildDir=$appBuildDir", "-PapiJar=${project(':dd-trace-api').tasks.jar.archiveFile.get()}" - - outputs.cacheIf { true } - - outputs.dir(appBuildDir) - .withPropertyName("applicationJar") - - inputs.files(fileTree(appDir) { - include '**/*' - exclude '.gradle/**' - }) - .withPropertyName("application") - .withPathSensitivity(PathSensitivity.RELATIVE) +smokeTestApp { + gradleApp { + taskName = 'webfluxBuild30' + nestedTasks = ['bootJar'] + artifactPath = 'libs/webflux-3.0-smoketest.jar' + sysProperty = 'datadog.smoketest.webflux.uberJar.path' + } + projectJar('apiJar', project(':dd-trace-api')) } -tasks.named("webfluxBuild30", Exec) { - dependsOn project(':dd-trace-api').tasks.named("jar") +dependencies { + testImplementation project(':dd-smoke-tests') } tasks.named("compileTestGroovy", GroovyCompile) { @@ -48,10 +31,6 @@ tasks.named("compileTestGroovy", GroovyCompile) { } } -tasks.withType(Test).configureEach { - jvmArgs "-Ddatadog.smoketest.webflux.uberJar.path=$appBuildDir/libs/webflux-3.0-smoketest.jar" -} - spotless { java { target "**/*.java" diff --git a/dd-smoke-tests/spring-boot-3.0-webflux/gradle.lockfile b/dd-smoke-tests/spring-boot-3.0-webflux/gradle.lockfile index 5b801a39bfb..70dcda2389e 100644 --- a/dd-smoke-tests/spring-boot-3.0-webflux/gradle.lockfile +++ b/dd-smoke-tests/spring-boot-3.0-webflux/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:spring-boot-3.0-webflux:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -72,6 +77,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -96,8 +102,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath @@ -109,4 +115,4 @@ org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeCla org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -empty=annotationProcessor,runtimeClasspath,spotbugsPlugins,testAnnotationProcessor +empty=annotationProcessor,runtimeClasspath,smokeTestAppExtraJarApiJar,spotbugsPlugins,testAnnotationProcessor diff --git a/dd-smoke-tests/spring-boot-3.0-webmvc/application/build.gradle b/dd-smoke-tests/spring-boot-3.0-webmvc/application/build.gradle index d7cc7b40f60..c94214d70ba 100644 --- a/dd-smoke-tests/spring-boot-3.0-webmvc/application/build.gradle +++ b/dd-smoke-tests/spring-boot-3.0-webmvc/application/build.gradle @@ -16,6 +16,12 @@ if (hasProperty('appBuildDir')) { version = "" +// Pin bytecode target: the nested daemon now runs on JDK 21, but the smoke test launches +// the produced jar on Java 17 (per testJvmConstraints). +java { + sourceCompatibility = JavaVersion.VERSION_17 +} + dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' implementation 'org.springframework.boot:spring-boot-starter-data-jpa' diff --git a/dd-smoke-tests/spring-boot-3.0-webmvc/application/settings.gradle b/dd-smoke-tests/spring-boot-3.0-webmvc/application/settings.gradle index 0c9295cedb4..000c60beac4 100644 --- a/dd-smoke-tests/spring-boot-3.0-webmvc/application/settings.gradle +++ b/dd-smoke-tests/spring-boot-3.0-webmvc/application/settings.gradle @@ -1,34 +1 @@ -pluginManagement { - repositories { - mavenLocal() - if (settings.hasProperty("gradlePluginProxy")) { - maven { - url settings["gradlePluginProxy"] - allowInsecureProtocol = true - } - } - if (settings.hasProperty("mavenRepositoryProxy")) { - maven { - url settings["mavenRepositoryProxy"] - allowInsecureProtocol = true - } - } - gradlePluginPortal() - mavenCentral() - } -} - -def isCI = providers.environmentVariable("CI").isPresent() - -// Don't pollute the dependency cache with the build cache -if (isCI) { - def sharedRootDir = "$rootDir/../../../" - buildCache { - local { - // This needs to line up with the code in the outer project settings.gradle - directory = "$sharedRootDir/workspace/build-cache" - } - } -} - rootProject.name='webmvc-3.0-smoketest' diff --git a/dd-smoke-tests/spring-boot-3.0-webmvc/build.gradle b/dd-smoke-tests/spring-boot-3.0-webmvc/build.gradle index 46c00fbcec8..07e850c365a 100644 --- a/dd-smoke-tests/spring-boot-3.0-webmvc/build.gradle +++ b/dd-smoke-tests/spring-boot-3.0-webmvc/build.gradle @@ -1,3 +1,7 @@ +plugins { + id 'dd-trace-java.smoke-test-app' +} + apply from: "$rootDir/gradle/java.gradle" testJvmConstraints { @@ -6,49 +10,27 @@ testJvmConstraints { description = 'Spring Boot 3.0 WebMvc Smoke Tests.' -dependencies { - testImplementation project(':dd-smoke-tests') +smokeTestApp { + gradleApp { + taskName = 'webmvcBuild30' + nestedTasks = ['bootJar'] + artifactPath = 'libs/webmvc-3.0-smoketest.jar' + sysProperty = 'datadog.smoketest.springboot.uberJar.path' + } + projectJar('apiJar', project(':dd-trace-api')) } -def appDir = "$projectDir/application" -def appBuildDir = "$buildDir/application" -def isWindows = System.getProperty("os.name").toLowerCase().contains("win") -def gradlewCommand = isWindows ? 'gradlew.bat' : 'gradlew' - -// define the task that builds the project -tasks.register('webmvcBuild30', Exec) { - workingDir "$appDir" - environment += [ - "GRADLE_OPTS": "-Dorg.gradle.jvmargs='-Xmx512M'", - "JAVA_HOME": getLazyJavaHomeFor(17) - ] - commandLine "$rootDir/${gradlewCommand}", "bootJar", "--no-daemon", "--max-workers=4", "-PappBuildDir=$appBuildDir", "-PapiJar=${project(':dd-trace-api').tasks.jar.archiveFile.get()}" - - outputs.cacheIf { true } - - outputs.dir(appBuildDir) - .withPropertyName("applicationJar") - - inputs.files(fileTree(appDir) { - include '**/*' - exclude '.gradle/**' - }) - .withPropertyName("application") - .withPathSensitivity(PathSensitivity.RELATIVE) +dependencies { + testImplementation project(':dd-smoke-tests') } tasks.named("compileTestGroovy", GroovyCompile) { - dependsOn project(':dd-trace-api').tasks.named("jar") dependsOn 'webmvcBuild30' outputs.upToDateWhen { - !webmvcBuild30.didWork + !tasks.named('webmvcBuild30').get().didWork } } -tasks.withType(Test).configureEach { - jvmArgs "-Ddatadog.smoketest.springboot.uberJar.path=$appBuildDir/libs/webmvc-3.0-smoketest.jar" -} - spotless { java { target "**/*.java" diff --git a/dd-smoke-tests/spring-boot-3.0-webmvc/gradle.lockfile b/dd-smoke-tests/spring-boot-3.0-webmvc/gradle.lockfile index 5b801a39bfb..a94f21def9f 100644 --- a/dd-smoke-tests/spring-boot-3.0-webmvc/gradle.lockfile +++ b/dd-smoke-tests/spring-boot-3.0-webmvc/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:spring-boot-3.0-webmvc:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -72,6 +77,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -96,8 +102,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath @@ -109,4 +115,4 @@ org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeCla org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -empty=annotationProcessor,runtimeClasspath,spotbugsPlugins,testAnnotationProcessor +empty=annotationProcessor,runtimeClasspath,smokeTestAppExtraJarApiJar,spotbugsPlugins,testAnnotationProcessor diff --git a/dd-smoke-tests/spring-boot-3.3-webmvc/application/build.gradle b/dd-smoke-tests/spring-boot-3.3-webmvc/application/build.gradle index 1b75d137b24..0ab5e0481a4 100644 --- a/dd-smoke-tests/spring-boot-3.3-webmvc/application/build.gradle +++ b/dd-smoke-tests/spring-boot-3.3-webmvc/application/build.gradle @@ -16,8 +16,15 @@ if (hasProperty('appBuildDir')) { version = "" +// Pin bytecode target: the nested daemon now runs on JDK 21, but the smoke test launches +// the produced jar on Java 17 (per testJvmConstraints). +java { + sourceCompatibility = JavaVersion.VERSION_17 +} + dependencies { implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' implementation 'org.springframework.boot:spring-boot-starter-data-jpa' implementation group: 'com.h2database', name: 'h2', version: '2.1.214' compileOnly group:"com.google.code.findbugs", name:"jsr305", version:"3.0.2" diff --git a/dd-smoke-tests/spring-boot-3.3-webmvc/application/settings.gradle b/dd-smoke-tests/spring-boot-3.3-webmvc/application/settings.gradle index cedaf8d6b03..865944fcf62 100644 --- a/dd-smoke-tests/spring-boot-3.3-webmvc/application/settings.gradle +++ b/dd-smoke-tests/spring-boot-3.3-webmvc/application/settings.gradle @@ -1,34 +1 @@ -pluginManagement { - repositories { - mavenLocal() - if (settings.hasProperty("gradlePluginProxy")) { - maven { - url settings["gradlePluginProxy"] - allowInsecureProtocol = true - } - } - if (settings.hasProperty("mavenRepositoryProxy")) { - maven { - url settings["mavenRepositoryProxy"] - allowInsecureProtocol = true - } - } - gradlePluginPortal() - mavenCentral() - } -} - -def isCI = providers.environmentVariable("CI").isPresent() - -// Don't pollute the dependency cache with the build cache -if (isCI) { - def sharedRootDir = "$rootDir/../../../" - buildCache { - local { - // This needs to line up with the code in the outer project settings.gradle - directory = "$sharedRootDir/workspace/build-cache" - } - } -} - rootProject.name='webmvc-3.3-smoketest' diff --git a/dd-smoke-tests/spring-boot-3.3-webmvc/application/src/main/java/datadog/smoketest/springboot/controller/FormResponseController.java b/dd-smoke-tests/spring-boot-3.3-webmvc/application/src/main/java/datadog/smoketest/springboot/controller/FormResponseController.java new file mode 100644 index 00000000000..7dc045b0aac --- /dev/null +++ b/dd-smoke-tests/spring-boot-3.3-webmvc/application/src/main/java/datadog/smoketest/springboot/controller/FormResponseController.java @@ -0,0 +1,36 @@ +package datadog.smoketest.springboot.controller; + +import jakarta.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.Locale; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.thymeleaf.context.Context; +import org.thymeleaf.spring6.SpringTemplateEngine; + +@Controller +public class FormResponseController { + private static final int RESPONSE_OFFSET = 6; + + private final SpringTemplateEngine templateEngine; + + public FormResponseController(SpringTemplateEngine templateEngine) { + this.templateEngine = templateEngine; + } + + @GetMapping("/form-response") + public void formResponse(HttpServletResponse response) throws IOException { + Context context = new Context(Locale.ROOT); + context.setVariable("returnUrl", "https://app.example.test/flows/complete?request=request-123"); + context.setVariable("formAction", "https://provider.example.test/flows/continue"); + context.setVariable("requestId", "request-123"); + + String content = templateEngine.process("form-response", context); + // Exercise response writers that receive a slice of a reusable buffer. + char[] responseBuffer = new char[RESPONSE_OFFSET + content.length()]; + content.getChars(0, content.length(), responseBuffer, RESPONSE_OFFSET); + + response.setContentType("text/html"); + response.getWriter().write(responseBuffer, RESPONSE_OFFSET, content.length()); + } +} diff --git a/dd-smoke-tests/spring-boot-3.3-webmvc/application/src/main/resources/templates/form-response.html b/dd-smoke-tests/spring-boot-3.3-webmvc/application/src/main/resources/templates/form-response.html new file mode 100644 index 00000000000..ba05b5c3467 --- /dev/null +++ b/dd-smoke-tests/spring-boot-3.3-webmvc/application/src/main/resources/templates/form-response.html @@ -0,0 +1,16 @@ + + + + + Continue request + + + +

      + +
      + + diff --git a/dd-smoke-tests/spring-boot-3.3-webmvc/build.gradle b/dd-smoke-tests/spring-boot-3.3-webmvc/build.gradle index 484ecfc5668..188088ad129 100644 --- a/dd-smoke-tests/spring-boot-3.3-webmvc/build.gradle +++ b/dd-smoke-tests/spring-boot-3.3-webmvc/build.gradle @@ -1,3 +1,7 @@ +plugins { + id 'dd-trace-java.smoke-test-app' +} + apply from: "$rootDir/gradle/java.gradle" testJvmConstraints { @@ -6,49 +10,27 @@ testJvmConstraints { description = 'Spring Boot 3.3 WebMvc Smoke Tests.' -dependencies { - testImplementation project(':dd-smoke-tests') +smokeTestApp { + gradleApp { + taskName = 'webmvcBuild3' + nestedTasks = ['bootJar'] + artifactPath = 'libs/webmvc-3.3-smoketest.jar' + sysProperty = 'datadog.smoketest.springboot.uberJar.path' + } + projectJar('apiJar', project(':dd-trace-api')) } -def appDir = "$projectDir/application" -def appBuildDir = "$buildDir/application" -def isWindows = System.getProperty("os.name").toLowerCase().contains("win") -def gradlewCommand = isWindows ? 'gradlew.bat' : 'gradlew' - -// define the task that builds the project -tasks.register('webmvcBuild3', Exec) { - workingDir "$appDir" - environment += [ - "GRADLE_OPTS": "-Dorg.gradle.jvmargs='-Xmx512M'", - "JAVA_HOME": getLazyJavaHomeFor(17) - ] - commandLine "$rootDir/${gradlewCommand}", "bootJar", "--no-daemon", "--max-workers=4", "-PappBuildDir=$appBuildDir", "-PapiJar=${project(':dd-trace-api').tasks.jar.archiveFile.get()}" - - outputs.cacheIf { true } - - outputs.dir(appBuildDir) - .withPropertyName("applicationJar") - - inputs.files(fileTree(appDir) { - include '**/*' - exclude '.gradle/**' - }) - .withPropertyName("application") - .withPathSensitivity(PathSensitivity.RELATIVE) +dependencies { + testImplementation project(':dd-smoke-tests') } tasks.named("compileTestGroovy", GroovyCompile) { - dependsOn project(':dd-trace-api').tasks.named("jar") dependsOn 'webmvcBuild3' outputs.upToDateWhen { - !webmvcBuild3.didWork + !tasks.named('webmvcBuild3').get().didWork } } -tasks.withType(Test).configureEach { - jvmArgs "-Ddatadog.smoketest.springboot.uberJar.path=$appBuildDir/libs/webmvc-3.3-smoketest.jar" -} - spotless { java { target "**/*.java" diff --git a/dd-smoke-tests/spring-boot-3.3-webmvc/gradle.lockfile b/dd-smoke-tests/spring-boot-3.3-webmvc/gradle.lockfile index 5b801a39bfb..b9eacf9ce45 100644 --- a/dd-smoke-tests/spring-boot-3.3-webmvc/gradle.lockfile +++ b/dd-smoke-tests/spring-boot-3.3-webmvc/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:spring-boot-3.3-webmvc:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -72,6 +77,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -96,8 +102,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath @@ -109,4 +115,4 @@ org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeCla org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -empty=annotationProcessor,runtimeClasspath,spotbugsPlugins,testAnnotationProcessor +empty=annotationProcessor,runtimeClasspath,smokeTestAppExtraJarApiJar,spotbugsPlugins,testAnnotationProcessor diff --git a/dd-smoke-tests/spring-boot-3.3-webmvc/src/test/groovy/SpringBootWebmvcIntegrationTest.groovy b/dd-smoke-tests/spring-boot-3.3-webmvc/src/test/groovy/SpringBootWebmvcIntegrationTest.groovy index 362a365a00f..42d8db55947 100644 --- a/dd-smoke-tests/spring-boot-3.3-webmvc/src/test/groovy/SpringBootWebmvcIntegrationTest.groovy +++ b/dd-smoke-tests/spring-boot-3.3-webmvc/src/test/groovy/SpringBootWebmvcIntegrationTest.groovy @@ -4,7 +4,11 @@ import okhttp3.Request import java.util.concurrent.atomic.AtomicInteger import java.util.regex.Pattern -class SpringBootWebmvcIntegrationTest extends AbstractServerSmokeTest { +abstract class AbstractSpringBootWebmvcIntegrationTest extends AbstractServerSmokeTest { + + protected List additionalJavaProperties() { + [] + } @Override ProcessBuilder createProcessBuilder() { @@ -13,6 +17,7 @@ class SpringBootWebmvcIntegrationTest extends AbstractServerSmokeTest { List command = new ArrayList<>() command.add(javaPath()) command.addAll(defaultJavaProperties) + command.addAll(additionalJavaProperties()) command.addAll((String[]) [ "-Ddd.writer.type=MultiWriter:TraceStructureWriter:${output.getAbsolutePath()}:includeResource,DDAgentWriter", "-jar", @@ -28,14 +33,6 @@ class SpringBootWebmvcIntegrationTest extends AbstractServerSmokeTest { return File.createTempFile("trace-structure-docs", "out") } - @Override - protected Set expectedTraces() { - return [ - "\\[servlet\\.request:GET /fruits\\[spring\\.handler:FruitController\\.listFruits\\[repository\\.operation:FruitRepository\\.findAll\\[h2\\.query:.*", - "\\[servlet\\.request:GET /fruits/\\{name}\\[spring\\.handler:FruitController\\.findOneFruit\\[repository\\.operation:FruitRepository\\.findByName\\[h2\\.query:.*" - ] - } - @Override protected Set assertTraceCounts(Set expected, Map traceCounts) { List remaining = expected.collect { Pattern.compile(it) }.toList() @@ -50,6 +47,22 @@ class SpringBootWebmvcIntegrationTest extends AbstractServerSmokeTest { return remaining.collect { it.pattern() }.toSet() } + @Override + List expectedTelemetryDependencies() { + ['spring-core'] + } +} + +class SpringBootWebmvcIntegrationTest extends AbstractSpringBootWebmvcIntegrationTest { + + @Override + protected Set expectedTraces() { + return [ + "\\[servlet\\.request:GET /fruits\\[spring\\.handler:FruitController\\.listFruits\\[repository\\.operation:FruitRepository\\.findAll\\[h2\\.query:.*", + "\\[servlet\\.request:GET /fruits/\\{name\\}\\[spring\\.handler:FruitController\\.findOneFruit\\[repository\\.operation:FruitRepository\\.findByName\\[h2\\.query:.*" + ] + } + def "find all fruits"() { setup: String url = "http://localhost:${httpPort}/fruits" @@ -78,9 +91,48 @@ class SpringBootWebmvcIntegrationTest extends AbstractServerSmokeTest { responseBodyStr.contains("banana") waitForTraceCount(1) } +} + +class SpringBootWebmvcRumInjectionTest extends AbstractSpringBootWebmvcIntegrationTest { @Override - List expectedTelemetryDependencies() { - ['spring-core'] + protected List additionalJavaProperties() { + [ + "-Ddd.rum.enabled=true", + "-Ddd.rum.application.id=appid", + "-Ddd.rum.client.token=token", + "-Ddd.rum.remote.configuration.id=12345" + ] + } + + @Override + protected Set expectedTraces() { + [ + "\\[servlet\\.request:GET /form-response\\[spring\\.handler:FormResponseController\\.formResponse.*" + ] + } + + def "inject RUM without corrupting a Thymeleaf form response"() { + setup: + String url = "http://localhost:${httpPort}/form-response" + + when: + def response = client.newCall(new Request.Builder().url(url).get().build()).execute() + + then: + response.code() == 200 + response.header("x-datadog-rum-injected") == "1" + def responseBodyStr = response.body().string() + responseBodyStr.contains('const returnUrl = "https:\\/\\/app.example.test\\/flows\\/complete?request=request-123";') + responseBodyStr.contains('window.formResponse = { returnUrl: returnUrl };') + responseBodyStr.contains('onload="document.getElementById(\'response-form\').submit()"') + responseBodyStr.contains('action="https://provider.example.test/flows/continue"') + responseBodyStr.contains('value="request-123"') + responseBodyStr.count("DD_RUM.init(") == 1 + responseBodyStr.contains("https://www.datadoghq-browser-agent.com") + responseBodyStr.count("") == 1 + responseBodyStr.indexOf("DD_RUM.init(") < responseBodyStr.indexOf("") + responseBodyStr.trim().endsWith("") + waitForTraceCount(1) } } diff --git a/dd-smoke-tests/spring-boot-rabbit/build.gradle b/dd-smoke-tests/spring-boot-rabbit/build.gradle index 6e260acb8fa..e7b91d57bfb 100644 --- a/dd-smoke-tests/spring-boot-rabbit/build.gradle +++ b/dd-smoke-tests/spring-boot-rabbit/build.gradle @@ -16,7 +16,7 @@ tasks.named("jar", Jar) { } tasks.named("shadowJar", ShadowJar) { - configurations = [project.configurations.runtimeClasspath] + configurations.add(project.configurations.named('runtimeClasspath')) } dependencies { diff --git a/dd-smoke-tests/spring-boot-rabbit/gradle.lockfile b/dd-smoke-tests/spring-boot-rabbit/gradle.lockfile index b372323daf0..f7fe086e170 100644 --- a/dd-smoke-tests/spring-boot-rabbit/gradle.lockfile +++ b/dd-smoke-tests/spring-boot-rabbit/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:spring-boot-rabbit:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -10,7 +11,7 @@ ch.qos.logback:logback-core:1.2.5=compileClasspath,runtimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -25,22 +26,26 @@ com.github.docker-java:docker-java-api:3.4.2=testCompileClasspath,testRuntimeCla com.github.docker-java:docker-java-transport-zerodep:3.4.2=testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.rabbitmq:amqp-client:5.9.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -52,13 +57,13 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.13.0=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -93,6 +98,7 @@ org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath org.jetbrains:annotations:17.0.0=testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -117,8 +123,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.32=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/spring-security/gradle.lockfile b/dd-smoke-tests/spring-security/gradle.lockfile index ef5a9c82110..a5f2d3b0f48 100644 --- a/dd-smoke-tests/spring-security/gradle.lockfile +++ b/dd-smoke-tests/spring-security/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:spring-security:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=compileClasspath,runtimeClasspath,testCompile com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -20,22 +21,26 @@ com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.3=compileClasspath,r com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.3=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.fasterxml.jackson:jackson-bom:2.13.3=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=compileClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.nimbusds:nimbus-jose-jwt:9.24.4=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -50,15 +55,15 @@ commons-io:commons-io:2.11.0=compileClasspath,runtimeClasspath,testCompileClassp commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:2.1.3=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jakarta.mail:jakarta.mail-api:2.0.1=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -93,6 +98,7 @@ org.hamcrest:hamcrest-core:1.3=runtimeClasspath,testFixturesRuntimeClasspath,tes org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -117,8 +123,8 @@ org.ow2.asm:asm-tree:9.7.1=runtimeClasspath,testFixturesRuntimeClasspath,testRun org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.36=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/springboot-freemarker/application/build.gradle b/dd-smoke-tests/springboot-freemarker/application/build.gradle new file mode 100644 index 00000000000..3a0220c4ca8 --- /dev/null +++ b/dd-smoke-tests/springboot-freemarker/application/build.gradle @@ -0,0 +1,26 @@ +plugins { + id 'java' + id 'org.springframework.boot' version '2.7.15' + id 'io.spring.dependency-management' version '1.0.15.RELEASE' +} + +def sharedRootDir = "$rootDir/../../../" +def sharedConfigDirectory = "$sharedRootDir/gradle" +rootProject.ext.sharedConfigDirectory = sharedConfigDirectory + +apply from: "$sharedConfigDirectory/repositories.gradle" + +if (hasProperty('appBuildDir')) { + buildDir = property('appBuildDir') +} + +version = "" + +java { + sourceCompatibility = '1.8' +} + +dependencies { + implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '1.5.18.RELEASE' + implementation group: 'org.freemarker', name: 'freemarker', version: '2.3.24-incubating' +} diff --git a/dd-smoke-tests/springboot-freemarker/application/settings.gradle b/dd-smoke-tests/springboot-freemarker/application/settings.gradle new file mode 100644 index 00000000000..8754dec7bbe --- /dev/null +++ b/dd-smoke-tests/springboot-freemarker/application/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'springboot-freemarker-smoketest' diff --git a/dd-smoke-tests/springboot-freemarker/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java b/dd-smoke-tests/springboot-freemarker/application/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java similarity index 100% rename from dd-smoke-tests/springboot-freemarker/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java rename to dd-smoke-tests/springboot-freemarker/application/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java diff --git a/dd-smoke-tests/springboot-freemarker/src/main/java/datadog/smoketest/springboot/XssController.java b/dd-smoke-tests/springboot-freemarker/application/src/main/java/datadog/smoketest/springboot/XssController.java similarity index 100% rename from dd-smoke-tests/springboot-freemarker/src/main/java/datadog/smoketest/springboot/XssController.java rename to dd-smoke-tests/springboot-freemarker/application/src/main/java/datadog/smoketest/springboot/XssController.java diff --git a/dd-smoke-tests/springboot-freemarker/src/main/resources/templates/freemarker-2.3.24-insecure.ftlh b/dd-smoke-tests/springboot-freemarker/application/src/main/resources/templates/freemarker-2.3.24-insecure.ftlh similarity index 100% rename from dd-smoke-tests/springboot-freemarker/src/main/resources/templates/freemarker-2.3.24-insecure.ftlh rename to dd-smoke-tests/springboot-freemarker/application/src/main/resources/templates/freemarker-2.3.24-insecure.ftlh diff --git a/dd-smoke-tests/springboot-freemarker/src/main/resources/templates/freemarker-2.3.24-secure.ftlh b/dd-smoke-tests/springboot-freemarker/application/src/main/resources/templates/freemarker-2.3.24-secure.ftlh similarity index 100% rename from dd-smoke-tests/springboot-freemarker/src/main/resources/templates/freemarker-2.3.24-secure.ftlh rename to dd-smoke-tests/springboot-freemarker/application/src/main/resources/templates/freemarker-2.3.24-secure.ftlh diff --git a/dd-smoke-tests/springboot-freemarker/src/main/resources/templates/freemarker-2.3.9-insecure.ftlh b/dd-smoke-tests/springboot-freemarker/application/src/main/resources/templates/freemarker-2.3.9-insecure.ftlh similarity index 100% rename from dd-smoke-tests/springboot-freemarker/src/main/resources/templates/freemarker-2.3.9-insecure.ftlh rename to dd-smoke-tests/springboot-freemarker/application/src/main/resources/templates/freemarker-2.3.9-insecure.ftlh diff --git a/dd-smoke-tests/springboot-freemarker/src/main/resources/templates/freemarker-2.3.9-secure.ftlh b/dd-smoke-tests/springboot-freemarker/application/src/main/resources/templates/freemarker-2.3.9-secure.ftlh similarity index 100% rename from dd-smoke-tests/springboot-freemarker/src/main/resources/templates/freemarker-2.3.9-secure.ftlh rename to dd-smoke-tests/springboot-freemarker/application/src/main/resources/templates/freemarker-2.3.9-secure.ftlh diff --git a/dd-smoke-tests/springboot-freemarker/build.gradle b/dd-smoke-tests/springboot-freemarker/build.gradle index 57c7a4e9eb1..3094e88112b 100644 --- a/dd-smoke-tests/springboot-freemarker/build.gradle +++ b/dd-smoke-tests/springboot-freemarker/build.gradle @@ -1,35 +1,52 @@ -import org.springframework.boot.gradle.tasks.bundling.BootJar - plugins { - id 'java' - id 'org.springframework.boot' version '2.7.15' - id 'io.spring.dependency-management' version '1.0.15.RELEASE' + id 'dd-trace-java.smoke-test-app' id 'java-test-fixtures' } apply from: "$rootDir/gradle/java.gradle" -apply from: "$rootDir/gradle/spring-boot-plugin.gradle" + description = 'SpringBoot Freemarker Smoke Tests.' -java { - sourceCompatibility = '1.8' +smokeTestApp { + gradleApp { + taskName = 'bootJar' + artifactPath = 'libs/springboot-freemarker-smoketest.jar' + sysProperty = 'datadog.smoketest.springboot.shadowJar.path' + } } dependencies { - implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '1.5.18.RELEASE' - implementation group: 'org.freemarker', name: 'freemarker', version: '2.3.24-incubating' - testImplementation project(':dd-smoke-tests') testImplementation(testFixtures(project(":dd-smoke-tests:iast-util"))) } +// XssController loads templates from the filesystem at "resources/main/templates" relative to +// the test JVM's working directory (this module's build dir). Mirror the nested app's +// processed resources so that path resolves at runtime. +def applicationResourcesProvider = layout.buildDirectory.dir("application/resources/main") +tasks.register('copyAppResources', Copy) { + dependsOn 'bootJar' + from applicationResourcesProvider + into layout.buildDirectory.dir("resources/main") +} + +// `java.gradle` applies the `java` plugin so an empty `jar` task is created with +// `build/resources/main` as one of its inputs. Wire the dependency so Gradle knows +// `copyAppResources` writes there. +tasks.named('jar') { + dependsOn 'copyAppResources' +} + tasks.withType(Test).configureEach { - dependsOn "bootJar" - def bootJarTask = tasks.named('bootJar', BootJar) - jvmArgumentProviders.add(new CommandLineArgumentProvider() { - @Override - Iterable asArguments() { - return bootJarTask.map { ["-Ddatadog.smoketest.springboot.shadowJar.path=${it.archiveFile.get()}"] }.get() - } - }) + dependsOn 'copyAppResources' +} + +spotless { + java { + target "**/*.java" + } + + groovyGradle { + target '*.gradle', "**/*.gradle" + } } diff --git a/dd-smoke-tests/springboot-freemarker/gradle.lockfile b/dd-smoke-tests/springboot-freemarker/gradle.lockfile index 913ba6d2b74..9be499462a0 100644 --- a/dd-smoke-tests/springboot-freemarker/gradle.lockfile +++ b/dd-smoke-tests/springboot-freemarker/gradle.lockfile @@ -1,109 +1,93 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:springboot-freemarker:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath -ch.qos.logback:logback-classic:1.2.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.5=testFixturesRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.5=testFixturesRuntimeClasspath -com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.5=testFixturesRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml:classmate:1.5.1=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.javaparser:javaparser-core:3.25.4=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.javaparser:javaparser-core:3.25.6=codenarc +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath -com.google.code.gson:gson:2.9.1=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.code.gson:gson:2.13.2=spotbugs +com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:logging-interceptor:4.9.3=testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:okhttp:4.9.3=testCompileClasspath,testRuntimeClasspath -com.squareup.okio:okio:2.8.0=testCompileClasspath,testRuntimeClasspath -com.sun.activation:jakarta.activation:1.2.2=testRuntimeClasspath -com.sun.mail:jakarta.mail:1.6.7=testRuntimeClasspath +com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okio:okio:1.17.5=testCompileClasspath,testRuntimeClasspath +com.sun.activation:jakarta.activation:2.0.1=testRuntimeClasspath +com.sun.mail:jakarta.mail:2.0.1=testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath -jakarta.activation:jakarta.activation-api:1.2.2=testRuntimeClasspath -jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -jakarta.mail:jakarta.mail-api:1.6.7=testRuntimeClasspath -javax.servlet:javax.servlet-api:4.0.1=testCompileClasspath,testRuntimeClasspath -javax.validation:validation-api:2.0.1.Final=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -jaxen:jaxen:1.2.0=spotbugs +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath +jakarta.activation:jakarta.activation-api:2.1.3=testRuntimeClasspath +jakarta.mail:jakarta.mail-api:2.0.1=testRuntimeClasspath +javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath +jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.12.23=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.12.23=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs -org.apache.ant:ant-antlr:1.10.12=codenarc -org.apache.ant:ant-junit:1.10.12=codenarc +org.apache.ant:ant-antlr:1.10.14=codenarc +org.apache.ant:ant-junit:1.10.14=codenarc org.apache.bcel:bcel:6.11.0=spotbugs -org.apache.commons:commons-lang3:3.12.0=spotbugs,testRuntimeClasspath +org.apache.commons:commons-lang3:3.19.0=spotbugs +org.apache.commons:commons-lang3:3.5=testRuntimeClasspath org.apache.commons:commons-text:1.0=testRuntimeClasspath org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.logging.log4j:log4j-api:2.17.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.logging.log4j:log4j-core:2.17.2=spotbugs -org.apache.logging.log4j:log4j-to-slf4j:2.17.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-core:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-el:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-websocket:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.apache.logging.log4j:log4j-api:2.25.2=spotbugs +org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath -org.codehaus.groovy:groovy-ant:3.0.19=codenarc -org.codehaus.groovy:groovy-docgenerator:3.0.19=codenarc -org.codehaus.groovy:groovy-groovydoc:3.0.19=codenarc -org.codehaus.groovy:groovy-json:3.0.19=codenarc +org.codehaus.groovy:groovy-ant:3.0.23=codenarc +org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc +org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.23=codenarc org.codehaus.groovy:groovy-json:3.0.25=testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-templates:3.0.19=codenarc -org.codehaus.groovy:groovy-xml:3.0.19=codenarc -org.codehaus.groovy:groovy:3.0.19=codenarc +org.codehaus.groovy:groovy-templates:3.0.23=codenarc +org.codehaus.groovy:groovy-xml:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.freemarker:freemarker:2.3.24-incubating=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.freemarker:freemarker:2.3.32=testFixturesRuntimeClasspath org.gmetrics:GMetrics:2.1.0=codenarc -org.hamcrest:hamcrest-core:2.2=testRuntimeClasspath -org.hamcrest:hamcrest:2.2=testCompileClasspath,testRuntimeClasspath -org.hibernate:hibernate-validator:5.3.6.Final=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jboss.logging:jboss-logging:3.4.3.Final=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath +org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains:annotations:13.0=testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter:5.8.2=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath @@ -124,34 +108,17 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:jul-to-slf4j:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,spotbugs,spotbugsSlf4j,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-autoconfigure:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-json:2.7.15=testFixturesRuntimeClasspath -org.springframework.boot:spring-boot-starter-logging:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-tomcat:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-web:1.5.18.RELEASE=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-web:2.7.15=testFixturesRuntimeClasspath -org.springframework.boot:spring-boot-starter:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-aop:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-beans:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-context:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-core:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-expression:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-jcl:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-web:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-webmvc:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -org.yaml:snakeyaml:1.30=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -empty=annotationProcessor,developmentOnly,spotbugsPlugins,testAnnotationProcessor,testFixturesAnnotationProcessor,testFixturesCompileClasspath +empty=annotationProcessor,runtimeClasspath,spotbugsPlugins,testAnnotationProcessor,testFixturesAnnotationProcessor,testFixturesCompileClasspath,testFixturesRuntimeClasspath diff --git a/dd-smoke-tests/springboot-grpc/build.gradle b/dd-smoke-tests/springboot-grpc/build.gradle index 2968ee2ae4a..e341073bc70 100644 --- a/dd-smoke-tests/springboot-grpc/build.gradle +++ b/dd-smoke-tests/springboot-grpc/build.gradle @@ -41,7 +41,7 @@ tasks.named("jar", Jar) { } tasks.named("shadowJar", ShadowJar) { - configurations = [project.configurations.runtimeClasspath] + configurations.add(project.configurations.named('runtimeClasspath')) } dependencies { diff --git a/dd-smoke-tests/springboot-grpc/gradle.lockfile b/dd-smoke-tests/springboot-grpc/gradle.lockfile index 75ecb51eb5b..dad10674220 100644 --- a/dd-smoke-tests/springboot-grpc/gradle.lockfile +++ b/dd-smoke-tests/springboot-grpc/gradle.lockfile @@ -1,17 +1,18 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:springboot-grpc:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testCompileProtoPath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testCompileProtoPath,testRuntimeClasspath ch.qos.logback:logback-classic:1.1.11=compileClasspath,compileProtoPath,runtimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath ch.qos.logback:logback-core:1.1.11=compileClasspath,runtimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -ch.qos.logback:logback-core:1.5.32=compileProtoPath +ch.qos.logback:logback-core:1.5.38=compileProtoPath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testCompileProtoPath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testCompileProtoPath,testRuntimeClasspath @@ -20,15 +21,15 @@ com.fasterxml.jackson.core:jackson-core:2.11.1=compileClasspath,compileProtoPath com.fasterxml.jackson.core:jackson-databind:2.8.11.3=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.fasterxml:classmate:1.3.1=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testCompileProtoPath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testCompileProtoPath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testCompileProtoPath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testCompileProtoPath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testCompileProtoPath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testCompileProtoPath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testCompileProtoPath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testCompileProtoPath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testCompileProtoPath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,compileProtoPath,spotbugs,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,compileProtoPath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.android:annotations:4.1.1.4=compileProtoPath,runtimeClasspath,testCompileProtoPath,testRuntimeClasspath @@ -54,18 +55,22 @@ com.google.code.findbugs:jsr305:3.0.2=compileClasspath,compileProtoPath,runtimeC com.google.code.gson:gson:2.13.2=spotbugs com.google.code.gson:gson:2.8.6=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.errorprone:error_prone_annotations:2.5.1=compileClasspath,testCompileClasspath -com.google.errorprone:error_prone_annotations:2.9.0=compileProtoPath,runtimeClasspath,testCompileProtoPath,testRuntimeClasspath -com.google.guava:failureaccess:1.0.1=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -com.google.guava:guava:30.1.1-android=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.5.1=compileClasspath +com.google.errorprone:error_prone_annotations:2.9.0=compileProtoPath,runtimeClasspath +com.google.guava:failureaccess:1.0.1=compileClasspath,compileProtoPath,runtimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.google.guava:guava:30.1.1-android=compileClasspath,compileProtoPath,runtimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.http-client:google-http-client-jackson2:1.36.0=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.http-client:google-http-client:1.36.0=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -com.google.j2objc:j2objc-annotations:1.3=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:1.3=compileClasspath,compileProtoPath,runtimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.protobuf:protobuf-java-util:3.13.0=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.protobuf:protobuf-java:3.18.2=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.google.protobuf:protoc:3.17.3=protobufToolsLocator_protoc -com.google.re2j:re2j:1.7=testCompileProtoPath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testCompileProtoPath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath @@ -93,14 +98,14 @@ io.opencensus:opencensus-api:0.24.0=compileClasspath,compileProtoPath,runtimeCla io.opencensus:opencensus-contrib-grpc-util:0.24.0=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath io.opencensus:opencensus-contrib-http-util:0.24.0=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath io.perfmark:perfmark-api:0.23.0=compileProtoPath,runtimeClasspath,testCompileProtoPath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testCompileProtoPath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testCompileProtoPath,testRuntimeClasspath javax.annotation:javax.annotation-api:1.3.2=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath javax.validation:validation-api:1.1.0.Final=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testCompileProtoPath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testCompileProtoPath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testCompileProtoPath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -141,6 +146,7 @@ org.hibernate:hibernate-validator:5.3.6.Final=compileClasspath,compileProtoPath, org.jboss.logging:jboss-logging:3.3.0.Final=compileClasspath,compileProtoPath,runtimeClasspath,testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testCompileProtoPath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=testCompileProtoPath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testCompileProtoPath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath @@ -165,8 +171,8 @@ org.ow2.asm:asm-tree:9.7.1=testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.25=compileClasspath,compileProtoPath,runtimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testCompileProtoPath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.25=compileClasspath,compileProtoPath,runtimeClasspath diff --git a/dd-smoke-tests/springboot-java-11/application/build.gradle b/dd-smoke-tests/springboot-java-11/application/build.gradle new file mode 100644 index 00000000000..ea12bb0cdc4 --- /dev/null +++ b/dd-smoke-tests/springboot-java-11/application/build.gradle @@ -0,0 +1,31 @@ +plugins { + id 'java' + id 'org.springframework.boot' version '2.7.15' + id 'io.spring.dependency-management' version '1.0.15.RELEASE' +} + +def sharedRootDir = "$rootDir/../../../" +def sharedConfigDirectory = "$sharedRootDir/gradle" +rootProject.ext.sharedConfigDirectory = sharedConfigDirectory + +apply from: "$sharedConfigDirectory/repositories.gradle" + +if (hasProperty('appBuildDir')) { + buildDir = property('appBuildDir') +} + +version = "" + +java { + sourceCompatibility = 11 +} + +if (hasProperty('iastUtil11Jar')) { + dependencies { + implementation files(property('iastUtil11Jar')) + } +} + +dependencies { + implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.2.0.RELEASE' +} diff --git a/dd-smoke-tests/springboot-java-11/application/settings.gradle b/dd-smoke-tests/springboot-java-11/application/settings.gradle new file mode 100644 index 00000000000..42e7096d2fb --- /dev/null +++ b/dd-smoke-tests/springboot-java-11/application/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'springboot-java-11-smoketest' diff --git a/dd-smoke-tests/springboot-java-11/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java b/dd-smoke-tests/springboot-java-11/application/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java similarity index 100% rename from dd-smoke-tests/springboot-java-11/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java rename to dd-smoke-tests/springboot-java-11/application/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java diff --git a/dd-smoke-tests/springboot-java-11/build.gradle b/dd-smoke-tests/springboot-java-11/build.gradle index 029df98dbd8..3d1d775edaa 100644 --- a/dd-smoke-tests/springboot-java-11/build.gradle +++ b/dd-smoke-tests/springboot-java-11/build.gradle @@ -1,42 +1,37 @@ -import org.springframework.boot.gradle.tasks.bundling.BootJar - plugins { - id 'java' - id 'org.springframework.boot' version '2.7.15' - id 'io.spring.dependency-management' version '1.0.15.RELEASE' + id 'dd-trace-java.smoke-test-app' id 'java-test-fixtures' } apply from: "$rootDir/gradle/java.gradle" +description = 'SpringBoot Java 11 Smoke Tests.' + testJvmConstraints { minJavaVersion = JavaVersion.VERSION_11 } -apply from: "$rootDir/gradle/spring-boot-plugin.gradle" -description = 'SpringBoot Java 11 Smoke Tests.' +smokeTestApp { + gradleApp { + taskName = 'bootJar' + artifactPath = 'libs/springboot-java-11-smoketest.jar' + sysProperty = 'datadog.smoketest.springboot.shadowJar.path' + } + projectJar('iastUtil11Jar', project(':dd-smoke-tests:iast-util:iast-util-11')) +} dependencies { - implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.2.0.RELEASE' - testImplementation project(':dd-smoke-tests') testImplementation testFixtures(project(":dd-smoke-tests:iast-util:iast-util-11")) testImplementation testFixtures(project(':dd-smoke-tests:iast-util')) - - implementation project(':dd-smoke-tests:iast-util:iast-util-11') } -tasks.named("compileJava", JavaCompile) { - configureCompiler(it, 11, JavaVersion.VERSION_11) -} +spotless { + java { + target "**/*.java" + } -tasks.withType(Test).configureEach { - dependsOn "bootJar" - def bootJarTask = tasks.named('bootJar', BootJar) - jvmArgumentProviders.add(new CommandLineArgumentProvider() { - @Override - Iterable asArguments() { - return bootJarTask.map { ["-Ddatadog.smoketest.springboot.shadowJar.path=${it.archiveFile.get()}"] }.get() - } - }) + groovyGradle { + target '*.gradle', "**/*.gradle" + } } diff --git a/dd-smoke-tests/springboot-java-11/gradle.lockfile b/dd-smoke-tests/springboot-java-11/gradle.lockfile index 6286f0438e6..6793f82e4b9 100644 --- a/dd-smoke-tests/springboot-java-11/gradle.lockfile +++ b/dd-smoke-tests/springboot-java-11/gradle.lockfile @@ -1,158 +1,124 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. -cafe.cryptography:curve25519-elisabeth:0.1.0=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -cafe.cryptography:ed25519-elisabeth:0.1.0=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -ch.qos.logback:logback-classic:1.2.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath +# To regenerate this file, run: ./gradlew :dd-smoke-tests:springboot-java-11:dependencies --write-locks +cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath +cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq.okio:okio:1.17.6=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:java-dogstatsd-client:4.4.5=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:sketches-java:0.8.3=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml:classmate:1.5.1=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.javaparser:javaparser-core:3.25.4=codenarc -com.github.jnr:jffi:1.3.14=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-a64asm:1.0.0=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-constants:0.10.4=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-x86asm:1.0.2=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath +com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath +com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath +com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath +com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath +com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath +com.github.javaparser:javaparser-core:3.25.6=codenarc +com.github.jnr:jffi:1.3.15=testRuntimeClasspath +com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath +com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath +com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath -com.google.code.gson:gson:2.9.1=spotbugs -com.google.guava:guava:20.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.squareup.moshi:moshi:1.11.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.squareup.okhttp3:logging-interceptor:4.9.3=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.squareup.okhttp3:okhttp:4.9.3=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.squareup.okio:okio:2.8.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.sun.activation:jakarta.activation:1.2.2=testRuntimeClasspath -com.sun.mail:jakarta.mail:1.6.7=testRuntimeClasspath +com.google.code.gson:gson:2.13.2=spotbugs +com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath +com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okio:okio:1.17.5=testCompileClasspath,testRuntimeClasspath +com.sun.activation:jakarta.activation:2.0.1=testRuntimeClasspath +com.sun.mail:jakarta.mail:2.0.1=testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc -commons-fileupload:commons-fileupload:1.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -commons-io:commons-io:2.11.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testRuntimeClasspath +commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs -de.thetaphi:forbiddenapis:3.10=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -jakarta.activation:jakarta.activation-api:1.2.2=testRuntimeClasspath -jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -jakarta.mail:jakarta.mail-api:1.6.7=testRuntimeClasspath -jakarta.validation:jakarta.validation-api:2.0.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -javax.servlet:javax.servlet-api:4.0.1=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -jaxen:jaxen:1.2.0=spotbugs -junit:junit:4.13.2=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.12.23=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.12.23=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna-platform:5.8.0=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.8.0=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath +jakarta.activation:jakarta.activation-api:2.1.3=testRuntimeClasspath +jakarta.mail:jakarta.mail-api:2.0.1=testRuntimeClasspath +javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath +jaxen:jaxen:2.0.0=spotbugs +junit:junit:4.13.2=testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath +net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath +net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs -org.apache.ant:ant-antlr:1.10.12=codenarc -org.apache.ant:ant-junit:1.10.12=codenarc +org.apache.ant:ant-antlr:1.10.14=codenarc +org.apache.ant:ant-junit:1.10.14=codenarc org.apache.bcel:bcel:6.11.0=spotbugs -org.apache.commons:commons-lang3:3.12.0=spotbugs,testRuntimeClasspath +org.apache.commons:commons-lang3:3.19.0=spotbugs +org.apache.commons:commons-lang3:3.5=testRuntimeClasspath org.apache.commons:commons-text:1.0=testRuntimeClasspath org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.logging.log4j:log4j-api:2.17.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.logging.log4j:log4j-core:2.17.2=spotbugs -org.apache.logging.log4j:log4j-to-slf4j:2.17.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-core:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-el:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-websocket:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.apache.logging.log4j:log4j-api:2.25.2=spotbugs +org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath -org.codehaus.groovy:groovy-ant:3.0.19=codenarc -org.codehaus.groovy:groovy-docgenerator:3.0.19=codenarc -org.codehaus.groovy:groovy-groovydoc:3.0.19=codenarc -org.codehaus.groovy:groovy-json:3.0.19=codenarc +org.codehaus.groovy:groovy-ant:3.0.23=codenarc +org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc +org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.23=codenarc org.codehaus.groovy:groovy-json:3.0.25=testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-templates:3.0.19=codenarc -org.codehaus.groovy:groovy-xml:3.0.19=codenarc -org.codehaus.groovy:groovy:3.0.19=codenarc +org.codehaus.groovy:groovy-templates:3.0.23=codenarc +org.codehaus.groovy:groovy-xml:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc -org.hamcrest:hamcrest-core:2.2=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.hamcrest:hamcrest:2.2=productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.hibernate.validator:hibernate-validator:6.2.5.Final=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jboss.logging:jboss-logging:3.4.3.Final=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jctools:jctools-core-jdk11:4.0.6=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.jctools:jctools-core:4.0.6=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib:1.6.21=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.jetbrains:annotations:13.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath +org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath +org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath +org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter:5.8.2=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-commons:1.14.1=productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-engine:1.14.1=productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-launcher:1.14.1=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-runner:1.14.1=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-api:1.14.1=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-commons:1.14.1=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath +org.junit.platform:junit-platform-runner:1.14.1=testRuntimeClasspath +org.junit.platform:junit-platform-suite-api:1.14.1=testRuntimeClasspath +org.junit.platform:junit-platform-suite-commons:1.14.1=testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs -org.junit:junit-bom:5.14.1=productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath org.mockito:mockito-core:4.4.0=testRuntimeClasspath -org.msgpack:msgpack-core:0.8.24=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.msgpack:msgpack-core:0.8.24=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath -org.opentest4j:opentest4j:1.3.0=productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-analysis:9.7.1=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.7.1=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-commons:9.7.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-tree:9.7.1=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-util:9.7.1=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:jcl-over-slf4j:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:jul-to-slf4j:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:log4j-over-slf4j:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath -org.slf4j:slf4j-api:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,spotbugs,spotbugsSlf4j,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-autoconfigure:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-json:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-logging:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-tomcat:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-validation:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-web:2.2.0.RELEASE=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-web:2.7.15=testFixturesRuntimeClasspath -org.springframework.boot:spring-boot-starter:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-aop:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-beans:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-context:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-core:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-expression:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-jcl:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-web:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-webmvc:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -org.yaml:snakeyaml:1.30=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -empty=annotationProcessor,developmentOnly,spotbugsPlugins,testAnnotationProcessor,testFixturesAnnotationProcessor,testFixturesCompileClasspath +empty=annotationProcessor,runtimeClasspath,smokeTestAppExtraJarIastUtil11Jar,spotbugsPlugins,testAnnotationProcessor,testFixturesAnnotationProcessor,testFixturesCompileClasspath,testFixturesRuntimeClasspath diff --git a/dd-smoke-tests/springboot-java-17/application/build.gradle b/dd-smoke-tests/springboot-java-17/application/build.gradle new file mode 100644 index 00000000000..413f24ce06d --- /dev/null +++ b/dd-smoke-tests/springboot-java-17/application/build.gradle @@ -0,0 +1,31 @@ +plugins { + id 'java' + id 'org.springframework.boot' version '2.7.15' + id 'io.spring.dependency-management' version '1.0.15.RELEASE' +} + +def sharedRootDir = "$rootDir/../../../" +def sharedConfigDirectory = "$sharedRootDir/gradle" +rootProject.ext.sharedConfigDirectory = sharedConfigDirectory + +apply from: "$sharedConfigDirectory/repositories.gradle" + +if (hasProperty('appBuildDir')) { + buildDir = property('appBuildDir') +} + +version = "" + +java { + sourceCompatibility = 17 +} + +if (hasProperty('iastUtil17Jar')) { + dependencies { + implementation files(property('iastUtil17Jar')) + } +} + +dependencies { + implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.2.0.RELEASE' +} diff --git a/dd-smoke-tests/springboot-java-17/application/settings.gradle b/dd-smoke-tests/springboot-java-17/application/settings.gradle new file mode 100644 index 00000000000..6821d57be3a --- /dev/null +++ b/dd-smoke-tests/springboot-java-17/application/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'springboot-java-17-smoketest' diff --git a/dd-smoke-tests/springboot-java-17/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java b/dd-smoke-tests/springboot-java-17/application/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java similarity index 100% rename from dd-smoke-tests/springboot-java-17/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java rename to dd-smoke-tests/springboot-java-17/application/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java diff --git a/dd-smoke-tests/springboot-java-17/build.gradle b/dd-smoke-tests/springboot-java-17/build.gradle index cb878a92c7f..ca3a160449d 100644 --- a/dd-smoke-tests/springboot-java-17/build.gradle +++ b/dd-smoke-tests/springboot-java-17/build.gradle @@ -1,42 +1,37 @@ -import org.springframework.boot.gradle.tasks.bundling.BootJar - plugins { - id 'java' - id 'org.springframework.boot' version '2.7.15' - id 'io.spring.dependency-management' version '1.0.15.RELEASE' + id 'dd-trace-java.smoke-test-app' id 'java-test-fixtures' } apply from: "$rootDir/gradle/java.gradle" +description = 'SpringBoot Java 17 Smoke Tests.' + testJvmConstraints { minJavaVersion = JavaVersion.VERSION_17 } -apply from: "$rootDir/gradle/spring-boot-plugin.gradle" -description = 'SpringBoot Java 17 Smoke Tests.' +smokeTestApp { + gradleApp { + taskName = 'bootJar' + artifactPath = 'libs/springboot-java-17-smoketest.jar' + sysProperty = 'datadog.smoketest.springboot.shadowJar.path' + } + projectJar('iastUtil17Jar', project(':dd-smoke-tests:iast-util:iast-util-17')) +} dependencies { - implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.2.0.RELEASE' - testImplementation project(':dd-smoke-tests') testImplementation testFixtures(project(":dd-smoke-tests:iast-util:iast-util-17")) testImplementation testFixtures(project(':dd-smoke-tests:iast-util')) - - implementation project(':dd-smoke-tests:iast-util:iast-util-17') } -tasks.named("compileJava", JavaCompile) { - configureCompiler(it, 17, JavaVersion.VERSION_17) -} +spotless { + java { + target "**/*.java" + } -tasks.withType(Test).configureEach { - dependsOn "bootJar" - def bootJarTask = tasks.named('bootJar', BootJar) - jvmArgumentProviders.add(new CommandLineArgumentProvider() { - @Override - Iterable asArguments() { - return bootJarTask.map { ["-Ddatadog.smoketest.springboot.shadowJar.path=${it.archiveFile.get()}"] }.get() - } - }) + groovyGradle { + target '*.gradle', "**/*.gradle" + } } diff --git a/dd-smoke-tests/springboot-java-17/gradle.lockfile b/dd-smoke-tests/springboot-java-17/gradle.lockfile index 6e0854e2347..aa3e6babd24 100644 --- a/dd-smoke-tests/springboot-java-17/gradle.lockfile +++ b/dd-smoke-tests/springboot-java-17/gradle.lockfile @@ -1,159 +1,125 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. -cafe.cryptography:curve25519-elisabeth:0.1.0=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -cafe.cryptography:ed25519-elisabeth:0.1.0=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -ch.qos.logback:logback-classic:1.2.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath +# To regenerate this file, run: ./gradlew :dd-smoke-tests:springboot-java-17:dependencies --write-locks +cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath +cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq.okio:okio:1.17.6=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:java-dogstatsd-client:4.4.5=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:sketches-java:0.8.3=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml:classmate:1.5.1=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.javaparser:javaparser-core:3.24.4=testRuntimeClasspath -com.github.javaparser:javaparser-core:3.25.4=codenarc -com.github.jnr:jffi:1.3.14=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-a64asm:1.0.0=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-constants:0.10.4=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-x86asm:1.0.2=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath +com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath +com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath +com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath +com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath +com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath +com.github.javaparser:javaparser-core:3.25.6=codenarc +com.github.javaparser:javaparser-core:3.28.2=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath +com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath +com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath +com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath -com.google.code.gson:gson:2.9.1=spotbugs -com.google.guava:guava:20.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.squareup.moshi:moshi:1.11.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.squareup.okhttp3:logging-interceptor:4.9.3=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.squareup.okhttp3:okhttp:4.9.3=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.squareup.okio:okio:2.8.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.sun.activation:jakarta.activation:1.2.2=testRuntimeClasspath -com.sun.mail:jakarta.mail:1.6.7=testRuntimeClasspath +com.google.code.gson:gson:2.13.2=spotbugs +com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath +com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okio:okio:1.17.5=testCompileClasspath,testRuntimeClasspath +com.sun.activation:jakarta.activation:2.0.1=testRuntimeClasspath +com.sun.mail:jakarta.mail:2.0.1=testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc -commons-fileupload:commons-fileupload:1.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -commons-io:commons-io:2.11.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testRuntimeClasspath +commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs -de.thetaphi:forbiddenapis:3.10=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -jakarta.activation:jakarta.activation-api:1.2.2=testRuntimeClasspath -jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -jakarta.mail:jakarta.mail-api:1.6.7=testRuntimeClasspath -jakarta.validation:jakarta.validation-api:2.0.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -javax.servlet:javax.servlet-api:4.0.1=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -jaxen:jaxen:1.2.0=spotbugs -junit:junit:4.13.2=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.12.23=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.12.23=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna-platform:5.8.0=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.java.dev.jna:jna:5.8.0=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath +jakarta.activation:jakarta.activation-api:2.1.3=testRuntimeClasspath +jakarta.mail:jakarta.mail-api:2.0.1=testRuntimeClasspath +javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath +jaxen:jaxen:2.0.0=spotbugs +junit:junit:4.13.2=testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath +net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath +net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs -org.apache.ant:ant-antlr:1.10.12=codenarc -org.apache.ant:ant-junit:1.10.12=codenarc +org.apache.ant:ant-antlr:1.10.14=codenarc +org.apache.ant:ant-junit:1.10.14=codenarc org.apache.bcel:bcel:6.11.0=spotbugs -org.apache.commons:commons-lang3:3.12.0=spotbugs,testRuntimeClasspath +org.apache.commons:commons-lang3:3.19.0=spotbugs +org.apache.commons:commons-lang3:3.5=testRuntimeClasspath org.apache.commons:commons-text:1.0=testRuntimeClasspath org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.logging.log4j:log4j-api:2.17.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.logging.log4j:log4j-core:2.17.2=spotbugs -org.apache.logging.log4j:log4j-to-slf4j:2.17.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-core:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-el:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-websocket:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.apache.logging.log4j:log4j-api:2.25.2=spotbugs +org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath -org.codehaus.groovy:groovy-ant:3.0.19=codenarc -org.codehaus.groovy:groovy-docgenerator:3.0.19=codenarc -org.codehaus.groovy:groovy-groovydoc:3.0.19=codenarc -org.codehaus.groovy:groovy-json:3.0.19=codenarc +org.codehaus.groovy:groovy-ant:3.0.23=codenarc +org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc +org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.23=codenarc org.codehaus.groovy:groovy-json:3.0.25=testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-templates:3.0.19=codenarc -org.codehaus.groovy:groovy-xml:3.0.19=codenarc -org.codehaus.groovy:groovy:3.0.19=codenarc +org.codehaus.groovy:groovy-templates:3.0.23=codenarc +org.codehaus.groovy:groovy-xml:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc -org.hamcrest:hamcrest-core:2.2=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.hamcrest:hamcrest:2.2=productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.hibernate.validator:hibernate-validator:6.2.5.Final=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jboss.logging:jboss-logging:3.4.3.Final=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jctools:jctools-core-jdk11:4.0.6=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.jctools:jctools-core:4.0.6=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib:1.6.21=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.jetbrains:annotations:13.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath +org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath +org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath +org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter:5.8.2=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-commons:1.14.1=productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-engine:1.14.1=productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-launcher:1.14.1=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-runner:1.14.1=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-api:1.14.1=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-suite-commons:1.14.1=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath +org.junit.platform:junit-platform-runner:1.14.1=testRuntimeClasspath +org.junit.platform:junit-platform-suite-api:1.14.1=testRuntimeClasspath +org.junit.platform:junit-platform-suite-commons:1.14.1=testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs -org.junit:junit-bom:5.14.1=productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath org.mockito:mockito-core:4.4.0=testRuntimeClasspath -org.msgpack:msgpack-core:0.8.24=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.msgpack:msgpack-core:0.8.24=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath -org.opentest4j:opentest4j:1.3.0=productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-analysis:9.7.1=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.7.1=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-commons:9.7.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-tree:9.7.1=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs -org.ow2.asm:asm-util:9.7.1=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:jcl-over-slf4j:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:jul-to-slf4j:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:log4j-over-slf4j:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath -org.slf4j:slf4j-api:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,spotbugs,spotbugsSlf4j,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-autoconfigure:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-json:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-logging:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-tomcat:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-validation:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-web:2.2.0.RELEASE=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-web:2.7.15=testFixturesRuntimeClasspath -org.springframework.boot:spring-boot-starter:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-aop:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-beans:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-context:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-core:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-expression:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-jcl:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-web:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-webmvc:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -org.yaml:snakeyaml:1.30=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -empty=annotationProcessor,developmentOnly,spotbugsPlugins,testAnnotationProcessor,testFixturesAnnotationProcessor,testFixturesCompileClasspath +empty=annotationProcessor,runtimeClasspath,smokeTestAppExtraJarIastUtil17Jar,spotbugsPlugins,testAnnotationProcessor,testFixturesAnnotationProcessor,testFixturesCompileClasspath,testFixturesRuntimeClasspath diff --git a/dd-smoke-tests/springboot-jetty-jsp/application/build.gradle b/dd-smoke-tests/springboot-jetty-jsp/application/build.gradle new file mode 100644 index 00000000000..4c68c426f93 --- /dev/null +++ b/dd-smoke-tests/springboot-jetty-jsp/application/build.gradle @@ -0,0 +1,37 @@ +plugins { + id 'java' + id 'war' + id 'org.springframework.boot' version '2.7.15' + id 'io.spring.dependency-management' version '1.0.15.RELEASE' +} + +def sharedRootDir = "$rootDir/../../../" +def sharedConfigDirectory = "$sharedRootDir/gradle" +rootProject.ext.sharedConfigDirectory = sharedConfigDirectory + +apply from: "$sharedConfigDirectory/repositories.gradle" + +if (hasProperty('appBuildDir')) { + buildDir = property('appBuildDir') +} + +version = "" + +java { + sourceCompatibility = '1.8' +} + +sourceSets { + main { + resources.srcDir("src/main/webapp") + } +} + +dependencies { + implementation 'org.springframework.boot:spring-boot-starter-web' + + runtimeOnly("javax.servlet:jstl") + runtimeOnly("org.apache.tomcat.embed:tomcat-embed-jasper") + + providedRuntime("org.springframework.boot:spring-boot-starter-jetty") +} diff --git a/dd-smoke-tests/springboot-jetty-jsp/application/settings.gradle b/dd-smoke-tests/springboot-jetty-jsp/application/settings.gradle new file mode 100644 index 00000000000..4f91064eb73 --- /dev/null +++ b/dd-smoke-tests/springboot-jetty-jsp/application/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'springboot-jetty-jsp-smoketest' diff --git a/dd-smoke-tests/springboot-jetty-jsp/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java b/dd-smoke-tests/springboot-jetty-jsp/application/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java similarity index 100% rename from dd-smoke-tests/springboot-jetty-jsp/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java rename to dd-smoke-tests/springboot-jetty-jsp/application/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java diff --git a/dd-smoke-tests/springboot-jetty-jsp/src/main/java/datadog/smoketest/springboot/ViewController.java b/dd-smoke-tests/springboot-jetty-jsp/application/src/main/java/datadog/smoketest/springboot/ViewController.java similarity index 100% rename from dd-smoke-tests/springboot-jetty-jsp/src/main/java/datadog/smoketest/springboot/ViewController.java rename to dd-smoke-tests/springboot-jetty-jsp/application/src/main/java/datadog/smoketest/springboot/ViewController.java diff --git a/dd-smoke-tests/springboot-jetty-jsp/src/main/resources/application.properties b/dd-smoke-tests/springboot-jetty-jsp/application/src/main/resources/application.properties similarity index 100% rename from dd-smoke-tests/springboot-jetty-jsp/src/main/resources/application.properties rename to dd-smoke-tests/springboot-jetty-jsp/application/src/main/resources/application.properties diff --git a/dd-smoke-tests/springboot-jetty-jsp/src/main/webapp/WEB-INF/jsp/test_xss.jsp b/dd-smoke-tests/springboot-jetty-jsp/application/src/main/webapp/WEB-INF/jsp/test_xss.jsp similarity index 100% rename from dd-smoke-tests/springboot-jetty-jsp/src/main/webapp/WEB-INF/jsp/test_xss.jsp rename to dd-smoke-tests/springboot-jetty-jsp/application/src/main/webapp/WEB-INF/jsp/test_xss.jsp diff --git a/dd-smoke-tests/springboot-jetty-jsp/build.gradle b/dd-smoke-tests/springboot-jetty-jsp/build.gradle index d8fdc4fbab4..09dbde5de64 100644 --- a/dd-smoke-tests/springboot-jetty-jsp/build.gradle +++ b/dd-smoke-tests/springboot-jetty-jsp/build.gradle @@ -1,47 +1,31 @@ -import org.springframework.boot.gradle.tasks.bundling.BootWar - plugins { - id 'java' - id 'war' - id 'org.springframework.boot' version '2.7.15' - id 'io.spring.dependency-management' version '1.0.15.RELEASE' + id 'dd-trace-java.smoke-test-app' id 'java-test-fixtures' } apply from: "$rootDir/gradle/java.gradle" -apply from: "$rootDir/gradle/spring-boot-plugin.gradle" -description = 'SpringBoot Jetty JSP Smoke Tests.' -java { - sourceCompatibility = '1.8' -} +description = 'SpringBoot Jetty JSP Smoke Tests.' -sourceSets { - main { - resources.srcDir("src/main/webapp") +smokeTestApp { + gradleApp { + taskName = 'bootWar' + artifactPath = 'libs/springboot-jetty-jsp-smoketest.war' + sysProperty = 'datadog.smoketest.springboot.war.path' } } dependencies { - implementation 'org.springframework.boot:spring-boot-starter-web' - - runtimeOnly("javax.servlet:jstl") - runtimeOnly("org.apache.tomcat.embed:tomcat-embed-jasper") - - providedRuntime("org.springframework.boot:spring-boot-starter-jetty") - testImplementation project(':dd-smoke-tests') testImplementation(testFixtures(project(":dd-smoke-tests:iast-util"))) } -tasks.withType(Test).configureEach { - dependsOn "war", "bootWar" +spotless { + java { + target "**/*.java" + } - jvmArgumentProviders.add(new CommandLineArgumentProvider() { - @Override - Iterable asArguments() { - def bootWarTask = tasks.named('bootWar', BootWar).get() - return ["-Ddatadog.smoketest.springboot.war.path=${bootWarTask.archiveFile.get().getAsFile()}"] - } - }) + groovyGradle { + target '*.gradle', "**/*.gradle" + } } diff --git a/dd-smoke-tests/springboot-jetty-jsp/gradle.lockfile b/dd-smoke-tests/springboot-jetty-jsp/gradle.lockfile index d3a5760b096..3ceb89f0966 100644 --- a/dd-smoke-tests/springboot-jetty-jsp/gradle.lockfile +++ b/dd-smoke-tests/springboot-jetty-jsp/gradle.lockfile @@ -1,130 +1,93 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:springboot-jetty-jsp:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath -ch.qos.logback:logback-classic:1.2.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.javaparser:javaparser-core:3.25.4=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.javaparser:javaparser-core:3.25.6=codenarc +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath -com.google.code.gson:gson:2.9.1=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.code.gson:gson:2.13.2=spotbugs +com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:logging-interceptor:4.9.3=testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:okhttp:4.9.3=testCompileClasspath,testRuntimeClasspath -com.squareup.okio:okio:2.8.0=testCompileClasspath,testRuntimeClasspath -com.sun.activation:jakarta.activation:1.2.2=testRuntimeClasspath -com.sun.mail:jakarta.mail:1.6.7=testRuntimeClasspath +com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okio:okio:1.17.5=testCompileClasspath,testRuntimeClasspath +com.sun.activation:jakarta.activation:2.0.1=testRuntimeClasspath +com.sun.mail:jakarta.mail:2.0.1=testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath -jakarta.activation:jakarta.activation-api:1.2.2=testRuntimeClasspath -jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -jakarta.mail:jakarta.mail-api:1.6.7=testRuntimeClasspath -jakarta.servlet:jakarta.servlet-api:4.0.4=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -jakarta.websocket:jakarta.websocket-api:1.1.2=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -javax.servlet:javax.servlet-api:4.0.1=testCompileClasspath,testRuntimeClasspath -javax.servlet:jstl:1.2=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -jaxen:jaxen:1.2.0=spotbugs +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath +jakarta.activation:jakarta.activation-api:2.1.3=testRuntimeClasspath +jakarta.mail:jakarta.mail-api:2.0.1=testRuntimeClasspath +javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath +jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.12.23=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.12.23=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs -org.apache.ant:ant-antlr:1.10.12=codenarc -org.apache.ant:ant-junit:1.10.12=codenarc +org.apache.ant:ant-antlr:1.10.14=codenarc +org.apache.ant:ant-junit:1.10.14=codenarc org.apache.bcel:bcel:6.11.0=spotbugs -org.apache.commons:commons-lang3:3.12.0=spotbugs,testRuntimeClasspath +org.apache.commons:commons-lang3:3.19.0=spotbugs +org.apache.commons:commons-lang3:3.5=testRuntimeClasspath org.apache.commons:commons-text:1.0=testRuntimeClasspath org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.logging.log4j:log4j-api:2.17.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.logging.log4j:log4j-core:2.17.2=spotbugs -org.apache.logging.log4j:log4j-to-slf4j:2.17.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-core:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-el:9.0.79=compileClasspath,productionRuntimeClasspath,providedRuntime,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-jasper:9.0.79=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-websocket:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat:tomcat-annotations-api:9.0.79=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.apache.logging.log4j:log4j-api:2.25.2=spotbugs +org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath -org.codehaus.groovy:groovy-ant:3.0.19=codenarc -org.codehaus.groovy:groovy-docgenerator:3.0.19=codenarc -org.codehaus.groovy:groovy-groovydoc:3.0.19=codenarc -org.codehaus.groovy:groovy-json:3.0.19=codenarc +org.codehaus.groovy:groovy-ant:3.0.23=codenarc +org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc +org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.23=codenarc org.codehaus.groovy:groovy-json:3.0.25=testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-templates:3.0.19=codenarc -org.codehaus.groovy:groovy-xml:3.0.19=codenarc -org.codehaus.groovy:groovy:3.0.19=codenarc +org.codehaus.groovy:groovy-templates:3.0.23=codenarc +org.codehaus.groovy:groovy-xml:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.eclipse.jdt:ecj:3.26.0=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.eclipse.jetty.websocket:javax-websocket-client-impl:9.4.51.v20230217=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.eclipse.jetty.websocket:javax-websocket-server-impl:9.4.51.v20230217=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.eclipse.jetty.websocket:websocket-api:9.4.51.v20230217=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.eclipse.jetty.websocket:websocket-client:9.4.51.v20230217=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.eclipse.jetty.websocket:websocket-common:9.4.51.v20230217=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.eclipse.jetty.websocket:websocket-server:9.4.51.v20230217=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.eclipse.jetty.websocket:websocket-servlet:9.4.51.v20230217=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-annotations:9.4.51.v20230217=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-client:9.4.51.v20230217=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-continuation:9.4.51.v20230217=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-http:9.4.51.v20230217=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-io:9.4.51.v20230217=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-plus:9.4.51.v20230217=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-security:9.4.51.v20230217=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-server:9.4.51.v20230217=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-servlet:9.4.51.v20230217=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-servlets:9.4.51.v20230217=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-util-ajax:9.4.51.v20230217=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-util:9.4.51.v20230217=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-webapp:9.4.51.v20230217=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.eclipse.jetty:jetty-xml:9.4.51.v20230217=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.gmetrics:GMetrics:2.1.0=codenarc -org.hamcrest:hamcrest-core:2.2=testRuntimeClasspath -org.hamcrest:hamcrest:2.2=testCompileClasspath,testRuntimeClasspath +org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath +org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains:annotations:13.0=testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter:5.8.2=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath @@ -139,43 +102,23 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.4=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath org.ow2.asm:asm-commons:9.7.1=testRuntimeClasspath org.ow2.asm:asm-commons:9.9=spotbugs -org.ow2.asm:asm-tree:9.4=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.4=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:jul-to-slf4j:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,spotbugs,spotbugsSlf4j,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-autoconfigure:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-jetty:2.7.15=productionRuntimeClasspath,providedRuntime,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-json:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-logging:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-tomcat:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-web:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-aop:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-beans:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-context:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-core:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-expression:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-jcl:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-web:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-webmvc:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -org.yaml:snakeyaml:1.30=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -empty=annotationProcessor,developmentOnly,providedCompile,spotbugsPlugins,testAnnotationProcessor,testFixturesAnnotationProcessor,testFixturesCompileClasspath +empty=annotationProcessor,runtimeClasspath,spotbugsPlugins,testAnnotationProcessor,testFixturesAnnotationProcessor,testFixturesCompileClasspath,testFixturesRuntimeClasspath diff --git a/dd-smoke-tests/springboot-jpa/application/build.gradle b/dd-smoke-tests/springboot-jpa/application/build.gradle new file mode 100644 index 00000000000..73438253bb8 --- /dev/null +++ b/dd-smoke-tests/springboot-jpa/application/build.gradle @@ -0,0 +1,36 @@ +plugins { + id 'java' + id 'war' + id 'org.springframework.boot' version '2.6.0' +} + +apply plugin: 'io.spring.dependency-management' + +def sharedRootDir = "$rootDir/../../../" +def sharedConfigDirectory = "$sharedRootDir/gradle" +rootProject.ext.sharedConfigDirectory = sharedConfigDirectory + +apply from: "$sharedConfigDirectory/repositories.gradle" + +if (hasProperty('appBuildDir')) { + buildDir = property('appBuildDir') +} + +version = "" + +// Pin bytecode target: the nested daemon now runs on JDK 21, but the smoke test launches +// the produced jar/war on Java 8. +java { + sourceCompatibility = JavaVersion.VERSION_1_8 +} + +dependencies { + implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-data-jpa' + implementation 'org.apache.tomcat.embed:tomcat-embed-jasper' + implementation 'javax.servlet:jstl:1.2' + implementation 'com.h2database:h2:2.1.214' + + compileOnly 'org.projectlombok:lombok:1.18.34' + annotationProcessor 'org.projectlombok:lombok:1.18.34' +} diff --git a/dd-smoke-tests/springboot-jpa/application/settings.gradle b/dd-smoke-tests/springboot-jpa/application/settings.gradle new file mode 100644 index 00000000000..f3bbc9915fc --- /dev/null +++ b/dd-smoke-tests/springboot-jpa/application/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'springboot-jpa-smoketest' diff --git a/dd-smoke-tests/springboot-jpa/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java b/dd-smoke-tests/springboot-jpa/application/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java similarity index 100% rename from dd-smoke-tests/springboot-jpa/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java rename to dd-smoke-tests/springboot-jpa/application/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java diff --git a/dd-smoke-tests/springboot-jpa/src/main/java/datadog/smoketest/springboot/controller/LibraryController.java b/dd-smoke-tests/springboot-jpa/application/src/main/java/datadog/smoketest/springboot/controller/LibraryController.java similarity index 100% rename from dd-smoke-tests/springboot-jpa/src/main/java/datadog/smoketest/springboot/controller/LibraryController.java rename to dd-smoke-tests/springboot-jpa/application/src/main/java/datadog/smoketest/springboot/controller/LibraryController.java diff --git a/dd-smoke-tests/springboot-jpa/src/main/java/datadog/smoketest/springboot/entity/Author.java b/dd-smoke-tests/springboot-jpa/application/src/main/java/datadog/smoketest/springboot/entity/Author.java similarity index 100% rename from dd-smoke-tests/springboot-jpa/src/main/java/datadog/smoketest/springboot/entity/Author.java rename to dd-smoke-tests/springboot-jpa/application/src/main/java/datadog/smoketest/springboot/entity/Author.java diff --git a/dd-smoke-tests/springboot-jpa/src/main/java/datadog/smoketest/springboot/entity/Book.java b/dd-smoke-tests/springboot-jpa/application/src/main/java/datadog/smoketest/springboot/entity/Book.java similarity index 100% rename from dd-smoke-tests/springboot-jpa/src/main/java/datadog/smoketest/springboot/entity/Book.java rename to dd-smoke-tests/springboot-jpa/application/src/main/java/datadog/smoketest/springboot/entity/Book.java diff --git a/dd-smoke-tests/springboot-jpa/src/main/java/datadog/smoketest/springboot/entity/Library.java b/dd-smoke-tests/springboot-jpa/application/src/main/java/datadog/smoketest/springboot/entity/Library.java similarity index 100% rename from dd-smoke-tests/springboot-jpa/src/main/java/datadog/smoketest/springboot/entity/Library.java rename to dd-smoke-tests/springboot-jpa/application/src/main/java/datadog/smoketest/springboot/entity/Library.java diff --git a/dd-smoke-tests/springboot-jpa/src/main/java/datadog/smoketest/springboot/entity/Owner.java b/dd-smoke-tests/springboot-jpa/application/src/main/java/datadog/smoketest/springboot/entity/Owner.java similarity index 100% rename from dd-smoke-tests/springboot-jpa/src/main/java/datadog/smoketest/springboot/entity/Owner.java rename to dd-smoke-tests/springboot-jpa/application/src/main/java/datadog/smoketest/springboot/entity/Owner.java diff --git a/dd-smoke-tests/springboot-jpa/src/main/java/datadog/smoketest/springboot/filter/SessionVisitorFilter.java b/dd-smoke-tests/springboot-jpa/application/src/main/java/datadog/smoketest/springboot/filter/SessionVisitorFilter.java similarity index 100% rename from dd-smoke-tests/springboot-jpa/src/main/java/datadog/smoketest/springboot/filter/SessionVisitorFilter.java rename to dd-smoke-tests/springboot-jpa/application/src/main/java/datadog/smoketest/springboot/filter/SessionVisitorFilter.java diff --git a/dd-smoke-tests/springboot-jpa/src/main/java/datadog/smoketest/springboot/service/LibraryService.java b/dd-smoke-tests/springboot-jpa/application/src/main/java/datadog/smoketest/springboot/service/LibraryService.java similarity index 100% rename from dd-smoke-tests/springboot-jpa/src/main/java/datadog/smoketest/springboot/service/LibraryService.java rename to dd-smoke-tests/springboot-jpa/application/src/main/java/datadog/smoketest/springboot/service/LibraryService.java diff --git a/dd-smoke-tests/springboot-jpa/src/main/resources/application.yml b/dd-smoke-tests/springboot-jpa/application/src/main/resources/application.yml similarity index 100% rename from dd-smoke-tests/springboot-jpa/src/main/resources/application.yml rename to dd-smoke-tests/springboot-jpa/application/src/main/resources/application.yml diff --git a/dd-smoke-tests/springboot-jpa/src/main/webapp/WEB-INF/jsp/update.jsp b/dd-smoke-tests/springboot-jpa/application/src/main/webapp/WEB-INF/jsp/update.jsp similarity index 100% rename from dd-smoke-tests/springboot-jpa/src/main/webapp/WEB-INF/jsp/update.jsp rename to dd-smoke-tests/springboot-jpa/application/src/main/webapp/WEB-INF/jsp/update.jsp diff --git a/dd-smoke-tests/springboot-jpa/build.gradle b/dd-smoke-tests/springboot-jpa/build.gradle index af9c22ff235..130752d60fc 100644 --- a/dd-smoke-tests/springboot-jpa/build.gradle +++ b/dd-smoke-tests/springboot-jpa/build.gradle @@ -1,44 +1,29 @@ -import org.springframework.boot.gradle.tasks.bundling.BootWar - plugins { - id 'java' - id 'war' - id 'org.springframework.boot' version '2.6.0' + id 'dd-trace-java.smoke-test-app' } -apply plugin: 'io.spring.dependency-management' apply from: "$rootDir/gradle/java.gradle" -apply from: "$rootDir/gradle/spring-boot-plugin.gradle" + description = 'SpringBoot JPA Smoke Tests.' -dependencies { - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-data-jpa' - implementation 'org.apache.tomcat.embed:tomcat-embed-jasper' - implementation 'javax.servlet:jstl:1.2' - implementation 'com.h2database:h2:2.1.214' +smokeTestApp { + gradleApp { + taskName = 'bootWar' + artifactPath = 'libs/springboot-jpa-smoketest.war' + sysProperty = 'datadog.smoketest.springboot.bootWar.path' + } +} +dependencies { testImplementation project(':dd-smoke-tests') - - compileOnly 'org.projectlombok:lombok:1.18.34' - annotationProcessor 'org.projectlombok:lombok:1.18.34' - - testCompileOnly 'org.projectlombok:lombok:1.18.34' - testAnnotationProcessor 'org.projectlombok:lombok:1.18.34' } -tasks.withType(Test).configureEach { - dependsOn "bootWar" - - jvmArgumentProviders.add(new CommandLineArgumentProvider() { - @Override - Iterable asArguments() { - def bootWarTask = tasks.named('bootWar', BootWar).get() - return ["-Ddatadog.smoketest.springboot.bootWar.path=${bootWarTask.archiveFile.get()}"] - } - }) -} +spotless { + java { + target "**/*.java" + } -tasks.withType(GroovyCompile).configureEach { - configureCompiler(it, 8) + groovyGradle { + target '*.gradle', "**/*.gradle" + } } diff --git a/dd-smoke-tests/springboot-jpa/gradle.lockfile b/dd-smoke-tests/springboot-jpa/gradle.lockfile index 40fceda9598..51a95a4bf7c 100644 --- a/dd-smoke-tests/springboot-jpa/gradle.lockfile +++ b/dd-smoke-tests/springboot-jpa/gradle.lockfile @@ -1,113 +1,87 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. -antlr:antlr:2.7.7=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +# To regenerate this file, run: ./gradlew :dd-smoke-tests:springboot-jpa:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-classic:1.2.7=compileClasspath,productionRuntimeClasspath,runtimeClasspath -ch.qos.logback:logback-core:1.2.7=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.13.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.13.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.13.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.13.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.fasterxml:classmate:1.5.1=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.javaparser:javaparser-core:3.23.0=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.javaparser:javaparser-core:3.25.6=codenarc +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath -com.google.code.gson:gson:2.8.9=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath -com.h2database:h2:2.1.214=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.code.gson:gson:2.13.2=spotbugs +com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:logging-interceptor:3.14.9=testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:okhttp:3.14.9=testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okio:okio:1.17.5=testCompileClasspath,testRuntimeClasspath -com.sun.activation:jakarta.activation:1.2.2=productionRuntimeClasspath,runtimeClasspath,testRuntimeClasspath -com.sun.istack:istack-commons-runtime:3.0.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc -com.zaxxer:HikariCP:4.0.3=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath -jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -jakarta.persistence:jakarta.persistence-api:2.2.3=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -jakarta.transaction:jakarta.transaction-api:1.3.3=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -jakarta.xml.bind:jakarta.xml.bind-api:2.3.3=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -javax.servlet:javax.servlet-api:4.0.1=testCompileClasspath,testRuntimeClasspath -javax.servlet:jstl:1.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -jaxen:jaxen:1.2.0=spotbugs +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath +javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath +jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.11.22=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.11.22=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs -org.apache.ant:ant-antlr:1.10.11=codenarc -org.apache.ant:ant-junit:1.10.11=codenarc +org.apache.ant:ant-antlr:1.10.14=codenarc +org.apache.ant:ant-junit:1.10.14=codenarc org.apache.bcel:bcel:6.11.0=spotbugs -org.apache.commons:commons-lang3:3.12.0=spotbugs +org.apache.commons:commons-lang3:3.19.0=spotbugs org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.logging.log4j:log4j-api:2.14.1=compileClasspath,productionRuntimeClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath -org.apache.logging.log4j:log4j-core:2.14.1=spotbugs -org.apache.logging.log4j:log4j-to-slf4j:2.14.1=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-core:9.0.55=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-el:9.0.55=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-jasper:9.0.55=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-websocket:9.0.55=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.apache.tomcat:tomcat-annotations-api:9.0.55=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.apache.logging.log4j:log4j-api:2.25.2=spotbugs +org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath -org.aspectj:aspectjweaver:1.9.7=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-ant:3.0.9=codenarc -org.codehaus.groovy:groovy-docgenerator:3.0.9=codenarc -org.codehaus.groovy:groovy-groovydoc:3.0.9=codenarc +org.codehaus.groovy:groovy-ant:3.0.23=codenarc +org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc +org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.23=codenarc org.codehaus.groovy:groovy-json:3.0.25=testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-json:3.0.9=codenarc -org.codehaus.groovy:groovy-templates:3.0.9=codenarc -org.codehaus.groovy:groovy-xml:3.0.9=codenarc +org.codehaus.groovy:groovy-templates:3.0.23=codenarc +org.codehaus.groovy:groovy-xml:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy:3.0.9=codenarc org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.eclipse.jdt:ecj:3.18.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.glassfish.jaxb:jaxb-runtime:2.3.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.glassfish.jaxb:txw2:2.3.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.gmetrics:GMetrics:2.1.0=codenarc -org.hamcrest:hamcrest-core:2.2=testRuntimeClasspath -org.hamcrest:hamcrest:2.2=testCompileClasspath,testRuntimeClasspath -org.hibernate.common:hibernate-commons-annotations:5.1.2.Final=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.hibernate:hibernate-core:5.6.1.Final=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jboss.logging:jboss-logging:3.4.2.Final=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jboss:jandex:2.2.3.Final=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath +org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter:5.8.2=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath @@ -128,43 +102,17 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath -org.projectlombok:lombok:1.18.34=annotationProcessor,compileClasspath,testAnnotationProcessor,testCompileClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:jul-to-slf4j:1.7.32=compileClasspath,productionRuntimeClasspath,runtimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.32=compileClasspath,productionRuntimeClasspath,runtimeClasspath,spotbugs,spotbugsSlf4j,testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-autoconfigure:2.6.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-aop:2.6.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-data-jpa:2.6.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-jdbc:2.6.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-json:2.6.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-logging:2.6.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-tomcat:2.6.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-web:2.6.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter:2.6.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot:2.6.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework.data:spring-data-commons:2.6.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework.data:spring-data-jpa:2.6.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-aop:5.3.13=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-aspects:5.3.13=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-beans:5.3.13=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-context:5.3.13=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-core:5.3.13=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-expression:5.3.13=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-jcl:5.3.13=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-jdbc:5.3.13=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-orm:5.3.13=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-tx:5.3.13=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-web:5.3.13=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-webmvc:5.3.13=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -org.yaml:snakeyaml:1.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -empty=developmentOnly,providedCompile,providedRuntime,spotbugsPlugins +empty=annotationProcessor,runtimeClasspath,spotbugsPlugins,testAnnotationProcessor diff --git a/dd-smoke-tests/springboot-mongo/build.gradle b/dd-smoke-tests/springboot-mongo/build.gradle index f5aeec45530..c86f67ffa0c 100644 --- a/dd-smoke-tests/springboot-mongo/build.gradle +++ b/dd-smoke-tests/springboot-mongo/build.gradle @@ -16,7 +16,7 @@ tasks.named("jar", Jar) { } tasks.named("shadowJar", ShadowJar) { - configurations = [project.configurations.runtimeClasspath] + configurations.add(project.configurations.named('runtimeClasspath')) } dependencies { diff --git a/dd-smoke-tests/springboot-mongo/gradle.lockfile b/dd-smoke-tests/springboot-mongo/gradle.lockfile index 560a78da03a..dbe4c4c29ab 100644 --- a/dd-smoke-tests/springboot-mongo/gradle.lockfile +++ b/dd-smoke-tests/springboot-mongo/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:springboot-mongo:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -10,7 +11,7 @@ ch.qos.logback:logback-core:1.2.3=compileClasspath,runtimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -24,22 +25,26 @@ com.github.docker-java:docker-java-api:3.4.2=testCompileClasspath,testRuntimeCla com.github.docker-java:docker-java-transport-zerodep:3.4.2=testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -50,13 +55,13 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.13.0=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -91,6 +96,7 @@ org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath org.jetbrains:annotations:17.0.0=testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -118,8 +124,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/springboot-openliberty-20/build.gradle b/dd-smoke-tests/springboot-openliberty-20/build.gradle index b8a4f0c8c5f..a277ba1ec49 100644 --- a/dd-smoke-tests/springboot-openliberty-20/build.gradle +++ b/dd-smoke-tests/springboot-openliberty-20/build.gradle @@ -1,3 +1,7 @@ +plugins { + id 'dd-trace-java.smoke-test-app' +} + apply from: "$rootDir/gradle/java.gradle" description = 'SpringBoot Open Liberty 20-22 Smoke Tests' @@ -5,50 +9,30 @@ dependencies { testImplementation project(':dd-smoke-tests') } -def appDir = "$projectDir/application" def jarName = "demo-open-liberty-app.jar" -def jarPath = "$buildDir/application/target/${jarName}" -def isWindows = System.getProperty("os.name").toLowerCase().contains("win") -def mvnwCommand = isWindows ? 'mvnw.cmd' : 'mvnw' - -// compile the Open liberty spring boot server -tasks.register('mvnStage', Exec) { - workingDir("$appDir") - environment += [ - "MAVEN_OPTS": "-Xmx512M", - "JAVA_HOME": getLazyJavaHomeFor(8) - ] - List mvnArgs = ["$rootDir/${mvnwCommand}", "-Dtarget.dir=${buildDir}/application/target", "package"] - - // Specify caches folder on CI. - if (providers.environmentVariable("CI").isPresent()) { - mvnArgs.add(1, "-Dmaven.repo.local=$rootDir/.mvn/caches") +smokeTestApp { + javaLauncher = javaToolchains.launcherFor { + languageVersion = JavaLanguageVersion.of(8) + } + mavenApp { + taskName = 'mvnStage' + artifactPath = "target/${jarName}" + sysProperty = 'datadog.smoketest.openliberty.jar.path' + mavenOpts = '-Xmx512M' } - - commandLine(mvnArgs) - - inputs.dir "$appDir/src" - inputs.file "$appDir/pom.xml" - outputs.file jarPath } tasks.named("compileTestGroovy", GroovyCompile) { dependsOn 'mvnStage' outputs.upToDateWhen { - !mvnStage.didWork + !tasks.named('mvnStage').get().didWork } } -// compiled dir of the packaged spring boot app with embedded openliberty -tasks.withType(Test).configureEach { - jvmArgs "-Ddatadog.smoketest.openliberty.jar.path=${jarPath}" -} - - spotless { java { - target fileTree("$appDir") { + target fileTree("$projectDir/application") { include "**/*.java" } } diff --git a/dd-smoke-tests/springboot-openliberty-20/gradle.lockfile b/dd-smoke-tests/springboot-openliberty-20/gradle.lockfile index 5b801a39bfb..065743a5aed 100644 --- a/dd-smoke-tests/springboot-openliberty-20/gradle.lockfile +++ b/dd-smoke-tests/springboot-openliberty-20/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:springboot-openliberty-20:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -72,6 +77,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -96,8 +102,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/springboot-openliberty-23/build.gradle b/dd-smoke-tests/springboot-openliberty-23/build.gradle index 68dc1ec98c7..73e290faf2e 100644 --- a/dd-smoke-tests/springboot-openliberty-23/build.gradle +++ b/dd-smoke-tests/springboot-openliberty-23/build.gradle @@ -1,3 +1,7 @@ +plugins { + id 'dd-trace-java.smoke-test-app' +} + apply from: "$rootDir/gradle/java.gradle" description = 'SpringBoot Open Liberty Smoke Tests' @@ -5,50 +9,30 @@ dependencies { testImplementation project(':dd-smoke-tests') } -def appDir = "$projectDir/application" def jarName = "demo-open-liberty-app.jar" -def jarPath = "$buildDir/application/target/${jarName}" -def isWindows = System.getProperty("os.name").toLowerCase().contains("win") -def mvnwCommand = isWindows ? 'mvnw.cmd' : 'mvnw' - -// compile the Open liberty spring boot server -tasks.register('mvnStage', Exec) { - workingDir("$appDir") - environment += [ - "MAVEN_OPTS": "-Xmx512M", - "JAVA_HOME": getLazyJavaHomeFor(8) - ] - List mvnArgs = ["$rootDir/${mvnwCommand}", "-Dtarget.dir=${buildDir}/application/target", "package"] - - // Specify caches folder on CI. - if (providers.environmentVariable("CI").isPresent()) { - mvnArgs.add(1, "-Dmaven.repo.local=$rootDir/.mvn/caches") +smokeTestApp { + javaLauncher = javaToolchains.launcherFor { + languageVersion = JavaLanguageVersion.of(8) + } + mavenApp { + taskName = 'mvnStage' + artifactPath = "target/${jarName}" + sysProperty = 'datadog.smoketest.openliberty.jar.path' + mavenOpts = '-Xmx512M' } - - commandLine(mvnArgs) - - inputs.dir "$appDir/src" - inputs.file "$appDir/pom.xml" - outputs.file jarPath } tasks.named("compileTestGroovy", GroovyCompile) { dependsOn 'mvnStage' outputs.upToDateWhen { - !mvnStage.didWork + !tasks.named('mvnStage').get().didWork } } -// compiled dir of the packaged spring boot app with embedded openliberty -tasks.withType(Test).configureEach { - jvmArgs "-Ddatadog.smoketest.openliberty.jar.path=${jarPath}" -} - - spotless { java { - target fileTree("$appDir") { + target fileTree("$projectDir/application") { include "**/*.java" } } diff --git a/dd-smoke-tests/springboot-openliberty-23/gradle.lockfile b/dd-smoke-tests/springboot-openliberty-23/gradle.lockfile index 5b801a39bfb..b7b5aee5164 100644 --- a/dd-smoke-tests/springboot-openliberty-23/gradle.lockfile +++ b/dd-smoke-tests/springboot-openliberty-23/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:springboot-openliberty-23:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -72,6 +77,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -96,8 +102,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/springboot-thymeleaf/application/build.gradle b/dd-smoke-tests/springboot-thymeleaf/application/build.gradle new file mode 100644 index 00000000000..77f8e57d848 --- /dev/null +++ b/dd-smoke-tests/springboot-thymeleaf/application/build.gradle @@ -0,0 +1,26 @@ +plugins { + id 'java' + id 'org.springframework.boot' version '2.7.15' + id 'io.spring.dependency-management' version '1.0.15.RELEASE' +} + +def sharedRootDir = "$rootDir/../../../" +def sharedConfigDirectory = "$sharedRootDir/gradle" +rootProject.ext.sharedConfigDirectory = sharedConfigDirectory + +apply from: "$sharedConfigDirectory/repositories.gradle" + +if (hasProperty('appBuildDir')) { + buildDir = property('appBuildDir') +} + +version = "" + +java { + sourceCompatibility = '1.8' +} + +dependencies { + implementation 'org.springframework.boot:spring-boot-starter-web' + implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' +} diff --git a/dd-smoke-tests/springboot-thymeleaf/application/settings.gradle b/dd-smoke-tests/springboot-thymeleaf/application/settings.gradle new file mode 100644 index 00000000000..995da126473 --- /dev/null +++ b/dd-smoke-tests/springboot-thymeleaf/application/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'springboot-thymeleaf-smoketest' diff --git a/dd-smoke-tests/springboot-thymeleaf/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java b/dd-smoke-tests/springboot-thymeleaf/application/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java similarity index 100% rename from dd-smoke-tests/springboot-thymeleaf/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java rename to dd-smoke-tests/springboot-thymeleaf/application/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java diff --git a/dd-smoke-tests/springboot-thymeleaf/src/main/java/datadog/smoketest/springboot/XssController.java b/dd-smoke-tests/springboot-thymeleaf/application/src/main/java/datadog/smoketest/springboot/XssController.java similarity index 100% rename from dd-smoke-tests/springboot-thymeleaf/src/main/java/datadog/smoketest/springboot/XssController.java rename to dd-smoke-tests/springboot-thymeleaf/application/src/main/java/datadog/smoketest/springboot/XssController.java diff --git a/dd-smoke-tests/springboot-thymeleaf/src/main/resources/templates/utext.html b/dd-smoke-tests/springboot-thymeleaf/application/src/main/resources/templates/utext.html similarity index 100% rename from dd-smoke-tests/springboot-thymeleaf/src/main/resources/templates/utext.html rename to dd-smoke-tests/springboot-thymeleaf/application/src/main/resources/templates/utext.html diff --git a/dd-smoke-tests/springboot-thymeleaf/build.gradle b/dd-smoke-tests/springboot-thymeleaf/build.gradle index 7de0a0833e5..a92caa4098b 100644 --- a/dd-smoke-tests/springboot-thymeleaf/build.gradle +++ b/dd-smoke-tests/springboot-thymeleaf/build.gradle @@ -1,35 +1,31 @@ -import org.springframework.boot.gradle.tasks.bundling.BootJar - plugins { - id 'java' - id 'org.springframework.boot' version '2.7.15' - id 'io.spring.dependency-management' version '1.0.15.RELEASE' + id 'dd-trace-java.smoke-test-app' id 'java-test-fixtures' } apply from: "$rootDir/gradle/java.gradle" -apply from: "$rootDir/gradle/spring-boot-plugin.gradle" + description = 'SpringBoot thymeleaf 3 Smoke Tests.' -java { - sourceCompatibility = '1.8' +smokeTestApp { + gradleApp { + taskName = 'bootJar' + artifactPath = 'libs/springboot-thymeleaf-smoketest.jar' + sysProperty = 'datadog.smoketest.springboot.shadowJar.path' + } } dependencies { - implementation 'org.springframework.boot:spring-boot-starter-web' - implementation 'org.springframework.boot:spring-boot-starter-thymeleaf' - testImplementation project(':dd-smoke-tests') testImplementation(testFixtures(project(":dd-smoke-tests:iast-util"))) } -tasks.withType(Test).configureEach { - dependsOn "bootJar" - def bootJarTask = tasks.named('bootJar', BootJar) - jvmArgumentProviders.add(new CommandLineArgumentProvider() { - @Override - Iterable asArguments() { - return bootJarTask.map { ["-Ddatadog.smoketest.springboot.shadowJar.path=${it.archiveFile.get()}"] }.get() - } - }) +spotless { + java { + target "**/*.java" + } + + groovyGradle { + target '*.gradle', "**/*.gradle" + } } diff --git a/dd-smoke-tests/springboot-thymeleaf/gradle.lockfile b/dd-smoke-tests/springboot-thymeleaf/gradle.lockfile index 5c63b1e6c8b..28b14c19506 100644 --- a/dd-smoke-tests/springboot-thymeleaf/gradle.lockfile +++ b/dd-smoke-tests/springboot-thymeleaf/gradle.lockfile @@ -1,104 +1,93 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:springboot-thymeleaf:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath -ch.qos.logback:logback-classic:1.2.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.javaparser:javaparser-core:3.25.4=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.javaparser:javaparser-core:3.25.6=codenarc +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath -com.google.code.gson:gson:2.9.1=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.code.gson:gson:2.13.2=spotbugs +com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:logging-interceptor:4.9.3=testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:okhttp:4.9.3=testCompileClasspath,testRuntimeClasspath -com.squareup.okio:okio:2.8.0=testCompileClasspath,testRuntimeClasspath -com.sun.activation:jakarta.activation:1.2.2=testRuntimeClasspath -com.sun.mail:jakarta.mail:1.6.7=testRuntimeClasspath +com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okio:okio:1.17.5=testCompileClasspath,testRuntimeClasspath +com.sun.activation:jakarta.activation:2.0.1=testRuntimeClasspath +com.sun.mail:jakarta.mail:2.0.1=testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath -jakarta.activation:jakarta.activation-api:1.2.2=testRuntimeClasspath -jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -jakarta.mail:jakarta.mail-api:1.6.7=testRuntimeClasspath -javax.servlet:javax.servlet-api:4.0.1=testCompileClasspath,testRuntimeClasspath -jaxen:jaxen:1.2.0=spotbugs +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath +jakarta.activation:jakarta.activation-api:2.1.3=testRuntimeClasspath +jakarta.mail:jakarta.mail-api:2.0.1=testRuntimeClasspath +javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath +jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.12.23=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.12.23=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs -org.apache.ant:ant-antlr:1.10.12=codenarc -org.apache.ant:ant-junit:1.10.12=codenarc +org.apache.ant:ant-antlr:1.10.14=codenarc +org.apache.ant:ant-junit:1.10.14=codenarc org.apache.bcel:bcel:6.11.0=spotbugs -org.apache.commons:commons-lang3:3.12.0=spotbugs,testRuntimeClasspath +org.apache.commons:commons-lang3:3.19.0=spotbugs +org.apache.commons:commons-lang3:3.5=testRuntimeClasspath org.apache.commons:commons-text:1.0=testRuntimeClasspath org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.logging.log4j:log4j-api:2.17.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.logging.log4j:log4j-core:2.17.2=spotbugs -org.apache.logging.log4j:log4j-to-slf4j:2.17.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-core:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-el:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-websocket:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.apache.logging.log4j:log4j-api:2.25.2=spotbugs +org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath -org.attoparser:attoparser:2.0.5.RELEASE=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-ant:3.0.19=codenarc -org.codehaus.groovy:groovy-docgenerator:3.0.19=codenarc -org.codehaus.groovy:groovy-groovydoc:3.0.19=codenarc -org.codehaus.groovy:groovy-json:3.0.19=codenarc +org.codehaus.groovy:groovy-ant:3.0.23=codenarc +org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc +org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.23=codenarc org.codehaus.groovy:groovy-json:3.0.25=testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-templates:3.0.19=codenarc -org.codehaus.groovy:groovy-xml:3.0.19=codenarc -org.codehaus.groovy:groovy:3.0.19=codenarc +org.codehaus.groovy:groovy-templates:3.0.23=codenarc +org.codehaus.groovy:groovy-xml:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc -org.hamcrest:hamcrest-core:2.2=testRuntimeClasspath -org.hamcrest:hamcrest:2.2=testCompileClasspath,testRuntimeClasspath +org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath +org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains:annotations:13.0=testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter:5.8.2=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath @@ -119,38 +108,17 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:jul-to-slf4j:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,spotbugs,spotbugsSlf4j,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-autoconfigure:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-json:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-logging:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-thymeleaf:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-tomcat:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-web:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-aop:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-beans:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-context:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-core:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-expression:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-jcl:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-web:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-webmvc:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath -org.thymeleaf.extras:thymeleaf-extras-java8time:3.0.4.RELEASE=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.thymeleaf:thymeleaf-spring5:3.0.15.RELEASE=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.thymeleaf:thymeleaf:3.0.15.RELEASE=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.unbescape:unbescape:1.1.6.RELEASE=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -org.yaml:snakeyaml:1.30=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -empty=annotationProcessor,developmentOnly,spotbugsPlugins,testAnnotationProcessor,testFixturesAnnotationProcessor,testFixturesCompileClasspath +empty=annotationProcessor,runtimeClasspath,spotbugsPlugins,testAnnotationProcessor,testFixturesAnnotationProcessor,testFixturesCompileClasspath,testFixturesRuntimeClasspath diff --git a/dd-smoke-tests/springboot-tomcat-jsp/application/build.gradle b/dd-smoke-tests/springboot-tomcat-jsp/application/build.gradle new file mode 100644 index 00000000000..8632e7afc64 --- /dev/null +++ b/dd-smoke-tests/springboot-tomcat-jsp/application/build.gradle @@ -0,0 +1,37 @@ +plugins { + id 'java' + id 'war' + id 'org.springframework.boot' version '2.7.15' + id 'io.spring.dependency-management' version '1.0.15.RELEASE' +} + +def sharedRootDir = "$rootDir/../../../" +def sharedConfigDirectory = "$sharedRootDir/gradle" +rootProject.ext.sharedConfigDirectory = sharedConfigDirectory + +apply from: "$sharedConfigDirectory/repositories.gradle" + +if (hasProperty('appBuildDir')) { + buildDir = property('appBuildDir') +} + +version = "" + +java { + sourceCompatibility = '1.8' +} + +sourceSets { + main { + resources.srcDir("src/main/webapp") + } +} + +dependencies { + implementation 'org.springframework.boot:spring-boot-starter-web' + + runtimeOnly("javax.servlet:jstl") + runtimeOnly("org.apache.tomcat.embed:tomcat-embed-jasper") + + providedRuntime("org.springframework.boot:spring-boot-starter-tomcat") +} diff --git a/dd-smoke-tests/springboot-tomcat-jsp/application/settings.gradle b/dd-smoke-tests/springboot-tomcat-jsp/application/settings.gradle new file mode 100644 index 00000000000..1861e72bcc6 --- /dev/null +++ b/dd-smoke-tests/springboot-tomcat-jsp/application/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'springboot-tomcat-jsp-smoketest' diff --git a/dd-smoke-tests/springboot-tomcat-jsp/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java b/dd-smoke-tests/springboot-tomcat-jsp/application/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java similarity index 100% rename from dd-smoke-tests/springboot-tomcat-jsp/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java rename to dd-smoke-tests/springboot-tomcat-jsp/application/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java diff --git a/dd-smoke-tests/springboot-tomcat-jsp/src/main/java/datadog/smoketest/springboot/ViewController.java b/dd-smoke-tests/springboot-tomcat-jsp/application/src/main/java/datadog/smoketest/springboot/ViewController.java similarity index 100% rename from dd-smoke-tests/springboot-tomcat-jsp/src/main/java/datadog/smoketest/springboot/ViewController.java rename to dd-smoke-tests/springboot-tomcat-jsp/application/src/main/java/datadog/smoketest/springboot/ViewController.java diff --git a/dd-smoke-tests/springboot-tomcat-jsp/src/main/resources/application.properties b/dd-smoke-tests/springboot-tomcat-jsp/application/src/main/resources/application.properties similarity index 100% rename from dd-smoke-tests/springboot-tomcat-jsp/src/main/resources/application.properties rename to dd-smoke-tests/springboot-tomcat-jsp/application/src/main/resources/application.properties diff --git a/dd-smoke-tests/springboot-tomcat-jsp/src/main/webapp/WEB-INF/jsp/test_xss.jsp b/dd-smoke-tests/springboot-tomcat-jsp/application/src/main/webapp/WEB-INF/jsp/test_xss.jsp similarity index 100% rename from dd-smoke-tests/springboot-tomcat-jsp/src/main/webapp/WEB-INF/jsp/test_xss.jsp rename to dd-smoke-tests/springboot-tomcat-jsp/application/src/main/webapp/WEB-INF/jsp/test_xss.jsp diff --git a/dd-smoke-tests/springboot-tomcat-jsp/build.gradle b/dd-smoke-tests/springboot-tomcat-jsp/build.gradle index 224274ece2a..b82c8fcdda7 100644 --- a/dd-smoke-tests/springboot-tomcat-jsp/build.gradle +++ b/dd-smoke-tests/springboot-tomcat-jsp/build.gradle @@ -1,47 +1,31 @@ -import org.springframework.boot.gradle.tasks.bundling.BootWar - plugins { - id 'java' - id 'war' - id 'org.springframework.boot' version '2.7.15' - id 'io.spring.dependency-management' version '1.0.15.RELEASE' + id 'dd-trace-java.smoke-test-app' id 'java-test-fixtures' } apply from: "$rootDir/gradle/java.gradle" -apply from: "$rootDir/gradle/spring-boot-plugin.gradle" -description = 'SpringBoot Tomcat JSP Smoke Tests.' -java { - sourceCompatibility = '1.8' -} +description = 'SpringBoot Tomcat JSP Smoke Tests.' -sourceSets { - main { - resources.srcDir("src/main/webapp") +smokeTestApp { + gradleApp { + taskName = 'bootWar' + artifactPath = 'libs/springboot-tomcat-jsp-smoketest.war' + sysProperty = 'datadog.smoketest.springboot.war.path' } } dependencies { - implementation 'org.springframework.boot:spring-boot-starter-web' - - runtimeOnly("javax.servlet:jstl") - runtimeOnly("org.apache.tomcat.embed:tomcat-embed-jasper") - - providedRuntime("org.springframework.boot:spring-boot-starter-tomcat") - testImplementation project(':dd-smoke-tests') testImplementation(testFixtures(project(":dd-smoke-tests:iast-util"))) } -tasks.withType(Test).configureEach { - dependsOn "war", "bootWar" +spotless { + java { + target "**/*.java" + } - jvmArgumentProviders.add(new CommandLineArgumentProvider() { - @Override - Iterable asArguments() { - def bootWarTask = tasks.named('bootWar', BootWar).get() - return ["-Ddatadog.smoketest.springboot.war.path=${bootWarTask.archiveFile.get().getAsFile()}"] - } - }) + groovyGradle { + target '*.gradle', "**/*.gradle" + } } diff --git a/dd-smoke-tests/springboot-tomcat-jsp/gradle.lockfile b/dd-smoke-tests/springboot-tomcat-jsp/gradle.lockfile index c42e289d6b1..3caccd2f98b 100644 --- a/dd-smoke-tests/springboot-tomcat-jsp/gradle.lockfile +++ b/dd-smoke-tests/springboot-tomcat-jsp/gradle.lockfile @@ -1,107 +1,93 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:springboot-tomcat-jsp:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath -ch.qos.logback:logback-classic:1.2.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.javaparser:javaparser-core:3.25.4=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.javaparser:javaparser-core:3.25.6=codenarc +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath -com.google.code.gson:gson:2.9.1=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.code.gson:gson:2.13.2=spotbugs +com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:logging-interceptor:4.9.3=testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:okhttp:4.9.3=testCompileClasspath,testRuntimeClasspath -com.squareup.okio:okio:2.8.0=testCompileClasspath,testRuntimeClasspath -com.sun.activation:jakarta.activation:1.2.2=testRuntimeClasspath -com.sun.mail:jakarta.mail:1.6.7=testRuntimeClasspath +com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okio:okio:1.17.5=testCompileClasspath,testRuntimeClasspath +com.sun.activation:jakarta.activation:2.0.1=testRuntimeClasspath +com.sun.mail:jakarta.mail:2.0.1=testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath -jakarta.activation:jakarta.activation-api:1.2.2=testRuntimeClasspath -jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,productionRuntimeClasspath,providedRuntime,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -jakarta.mail:jakarta.mail-api:1.6.7=testRuntimeClasspath -javax.servlet:javax.servlet-api:4.0.1=testCompileClasspath,testRuntimeClasspath -javax.servlet:jstl:1.2=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -jaxen:jaxen:1.2.0=spotbugs +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath +jakarta.activation:jakarta.activation-api:2.1.3=testRuntimeClasspath +jakarta.mail:jakarta.mail-api:2.0.1=testRuntimeClasspath +javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath +jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.12.23=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.12.23=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs -org.apache.ant:ant-antlr:1.10.12=codenarc -org.apache.ant:ant-junit:1.10.12=codenarc +org.apache.ant:ant-antlr:1.10.14=codenarc +org.apache.ant:ant-junit:1.10.14=codenarc org.apache.bcel:bcel:6.11.0=spotbugs -org.apache.commons:commons-lang3:3.12.0=spotbugs,testRuntimeClasspath +org.apache.commons:commons-lang3:3.19.0=spotbugs +org.apache.commons:commons-lang3:3.5=testRuntimeClasspath org.apache.commons:commons-text:1.0=testRuntimeClasspath org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.logging.log4j:log4j-api:2.17.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.logging.log4j:log4j-core:2.17.2=spotbugs -org.apache.logging.log4j:log4j-to-slf4j:2.17.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-core:9.0.79=compileClasspath,productionRuntimeClasspath,providedRuntime,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-el:9.0.79=compileClasspath,productionRuntimeClasspath,providedRuntime,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-jasper:9.0.79=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-websocket:9.0.79=compileClasspath,productionRuntimeClasspath,providedRuntime,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat:tomcat-annotations-api:9.0.79=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.apache.logging.log4j:log4j-api:2.25.2=spotbugs +org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath -org.codehaus.groovy:groovy-ant:3.0.19=codenarc -org.codehaus.groovy:groovy-docgenerator:3.0.19=codenarc -org.codehaus.groovy:groovy-groovydoc:3.0.19=codenarc -org.codehaus.groovy:groovy-json:3.0.19=codenarc +org.codehaus.groovy:groovy-ant:3.0.23=codenarc +org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc +org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.23=codenarc org.codehaus.groovy:groovy-json:3.0.25=testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-templates:3.0.19=codenarc -org.codehaus.groovy:groovy-xml:3.0.19=codenarc -org.codehaus.groovy:groovy:3.0.19=codenarc +org.codehaus.groovy:groovy-templates:3.0.23=codenarc +org.codehaus.groovy:groovy-xml:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs -org.eclipse.jdt:ecj:3.26.0=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.gmetrics:GMetrics:2.1.0=codenarc -org.hamcrest:hamcrest-core:2.2=testRuntimeClasspath -org.hamcrest:hamcrest:2.2=testCompileClasspath,testRuntimeClasspath +org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath +org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains:annotations:13.0=testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter:5.8.2=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath @@ -122,33 +108,17 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:jul-to-slf4j:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,spotbugs,spotbugsSlf4j,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-autoconfigure:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-json:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-logging:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-tomcat:2.7.15=compileClasspath,productionRuntimeClasspath,providedRuntime,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-web:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-aop:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-beans:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-context:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-core:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-expression:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-jcl:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-web:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-webmvc:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -org.yaml:snakeyaml:1.30=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -empty=annotationProcessor,developmentOnly,providedCompile,spotbugsPlugins,testAnnotationProcessor,testFixturesAnnotationProcessor,testFixturesCompileClasspath +empty=annotationProcessor,runtimeClasspath,spotbugsPlugins,testAnnotationProcessor,testFixturesAnnotationProcessor,testFixturesCompileClasspath,testFixturesRuntimeClasspath diff --git a/dd-smoke-tests/springboot-tomcat/application/build.gradle b/dd-smoke-tests/springboot-tomcat/application/build.gradle new file mode 100644 index 00000000000..7e9833cc85a --- /dev/null +++ b/dd-smoke-tests/springboot-tomcat/application/build.gradle @@ -0,0 +1,27 @@ +plugins { + id 'war' + id 'org.springframework.boot' version '2.5.12' +} + +def sharedRootDir = "$rootDir/../../../" +def sharedConfigDirectory = "$sharedRootDir/gradle" +rootProject.ext.sharedConfigDirectory = sharedConfigDirectory + +apply from: "$sharedConfigDirectory/repositories.gradle" + +if (hasProperty('appBuildDir')) { + buildDir = property('appBuildDir') +} + +version = "" + +// Pin bytecode target: the nested daemon now runs on JDK 21, but the smoke test launches +// the produced war on Java 8. +java { + sourceCompatibility = JavaVersion.VERSION_1_8 +} + +dependencies { + implementation 'org.springframework.boot:spring-boot-starter-web:2.5.12' + providedRuntime 'org.springframework.boot:spring-boot-starter-tomcat:2.5.12' +} diff --git a/dd-smoke-tests/springboot-tomcat/application/settings.gradle b/dd-smoke-tests/springboot-tomcat/application/settings.gradle new file mode 100644 index 00000000000..20dc3c0222b --- /dev/null +++ b/dd-smoke-tests/springboot-tomcat/application/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'springboot-tomcat-smoketest' diff --git a/dd-smoke-tests/springboot-tomcat/src/main/java/datadog/smoketest/springboot/SpringbootTomcatApplication.java b/dd-smoke-tests/springboot-tomcat/application/src/main/java/datadog/smoketest/springboot/SpringbootTomcatApplication.java similarity index 100% rename from dd-smoke-tests/springboot-tomcat/src/main/java/datadog/smoketest/springboot/SpringbootTomcatApplication.java rename to dd-smoke-tests/springboot-tomcat/application/src/main/java/datadog/smoketest/springboot/SpringbootTomcatApplication.java diff --git a/dd-smoke-tests/springboot-tomcat/src/main/java/datadog/smoketest/springboot/controller/TestSuite.java b/dd-smoke-tests/springboot-tomcat/application/src/main/java/datadog/smoketest/springboot/controller/TestSuite.java similarity index 100% rename from dd-smoke-tests/springboot-tomcat/src/main/java/datadog/smoketest/springboot/controller/TestSuite.java rename to dd-smoke-tests/springboot-tomcat/application/src/main/java/datadog/smoketest/springboot/controller/TestSuite.java diff --git a/dd-smoke-tests/springboot-tomcat/src/main/java/datadog/smoketest/springboot/controller/ViewController.java b/dd-smoke-tests/springboot-tomcat/application/src/main/java/datadog/smoketest/springboot/controller/ViewController.java similarity index 100% rename from dd-smoke-tests/springboot-tomcat/src/main/java/datadog/smoketest/springboot/controller/ViewController.java rename to dd-smoke-tests/springboot-tomcat/application/src/main/java/datadog/smoketest/springboot/controller/ViewController.java diff --git a/dd-smoke-tests/springboot-tomcat/src/main/resources/application.properties b/dd-smoke-tests/springboot-tomcat/application/src/main/resources/application.properties similarity index 100% rename from dd-smoke-tests/springboot-tomcat/src/main/resources/application.properties rename to dd-smoke-tests/springboot-tomcat/application/src/main/resources/application.properties diff --git a/dd-smoke-tests/springboot-tomcat/build.gradle b/dd-smoke-tests/springboot-tomcat/build.gradle index 14d0705eeca..5c506614081 100644 --- a/dd-smoke-tests/springboot-tomcat/build.gradle +++ b/dd-smoke-tests/springboot-tomcat/build.gradle @@ -1,24 +1,23 @@ -import org.springframework.boot.gradle.tasks.bundling.BootWar - plugins { - id 'war' - id 'org.springframework.boot' version '2.5.12' -} - -ext { - serverName = 'tomcat' - serverModule = 'tomcat-9' - serverVersion = '9.0.117' - serverExtension = 'zip' + id 'dd-trace-java.smoke-test-app' + id 'dd-trace-java.mass' } apply from: "$rootDir/gradle/java.gradle" -apply from: "$rootDir/gradle/spring-boot-plugin.gradle" + description = 'SpringBoot Tomcat Smoke Tests.' +def serverName = 'tomcat' +def serverModule = 'tomcat-9' +def serverVersion = '9.0.117' +def serverExtension = 'zip' + repositories { ivy { - url = 'https://dlcdn.apache.org' + url = mass.artifactUrl('dlcdn.apache.org') + content { + includeGroup serverName + } patternLayout { artifact '/[organisation]/[module]/v[revision]/bin/apache-[organisation]-[revision].[ext]' } @@ -29,20 +28,32 @@ repositories { } configurations { - serverFile { - extendsFrom implementation + register('serverFile') { + canBeConsumed = false canBeResolved = true } } +smokeTestApp { + gradleApp { + taskName = 'bootWar' + artifactPath = 'libs/springboot-tomcat-smoketest.war' + sysProperty = 'datadog.smoketest.springboot.war.path' + } +} + dependencies { - // uses the ivy repository url to download the tomcat server - // organisation = serverName, revision = serverVersion, module = serverModule, ext = serverExtension + // Uses the ivy repository url to download the Tomcat server zip. + // organisation = serverName, module = serverModule, revision = serverVersion, + // ext = serverExtension serverFile "${serverName}:${serverModule}:${serverVersion}@${serverExtension}" testImplementation project(':dd-smoke-tests') + testImplementation group: 'commons-io', name: 'commons-io', version: '2.11.0' } +def serverDirectory = layout.buildDirectory.dir("server") + tasks.register("unzip", Copy) { def zipFileNamePrefix = "tomcat" def serverZipTree = providers.provider { @@ -57,70 +68,35 @@ tasks.register("unzip", Copy) { } from serverZipTree - into layout.buildDirectory + into serverDirectory // When tests are disabled this would still be run, so disable this manually onlyIf { !project.rootProject.hasProperty("skipTests") } } -dependencies { - implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '2.5.12' - providedRuntime group: 'org.springframework.boot', name: 'spring-boot-starter-tomcat', version: '2.5.12' - testImplementation group: 'commons-io', name: 'commons-io', version: '2.11.0' - testImplementation project(':dd-smoke-tests') -} - -tasks.named('sourcesJar') { - dependsOn 'unzip' -} - -tasks.named('javadocJar') { - dependsOn 'unzip' -} - -tasks.named('bootWar') { - dependsOn 'unzip' -} - -tasks.named('bootWarMainClassName') { - dependsOn 'unzip' -} - -tasks.named('war') { - dependsOn 'unzip' -} - -tasks.named('javadocJar') { - dependsOn 'unzip' -} - -tasks.named('sourcesJar') { - dependsOn 'unzip' -} - -tasks.named('forbiddenApisMain') { - dependsOn 'unzip' -} - -tasks.named('spotbugsMain') { - dependsOn 'unzip' -} - -tasks.matching({it.name.startsWith('compileTest')}).configureEach { - dependsOn 'war', 'bootWar', 'unzip' +def tomcatDir = serverDirectory.map { + it.dir("apache-${serverName}-${serverVersion}") } tasks.withType(Test).configureEach { - dependsOn "war", "bootWar", "unzip" + dependsOn 'unzip' jvmArgumentProviders.add(new CommandLineArgumentProvider() { @Override Iterable asArguments() { - def bootWarTask = tasks.named('bootWar', BootWar).get() - return [ - "-Ddatadog.smoketest.springboot.war.path=${bootWarTask.archiveFile.get().getAsFile()}", - "-Ddatadog.smoketest.tomcatDir=${layout.buildDirectory.get()}/apache-${serverName}-${serverVersion}" - ] + return tomcatDir.map { + ["-Ddatadog.smoketest.tomcatDir=${it.asFile.absolutePath}"] + }.get() } }) } + +spotless { + java { + target "**/*.java" + } + + groovyGradle { + target '*.gradle', "**/*.gradle" + } +} diff --git a/dd-smoke-tests/springboot-tomcat/gradle.lockfile b/dd-smoke-tests/springboot-tomcat/gradle.lockfile index b9f3aea75dd..d5b30ebad45 100644 --- a/dd-smoke-tests/springboot-tomcat/gradle.lockfile +++ b/dd-smoke-tests/springboot-tomcat/gradle.lockfile @@ -1,43 +1,39 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:springboot-tomcat:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath -ch.qos.logback:logback-classic:1.2.11=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.11=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.12.6=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.12.6=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.12.6.1=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.12.6=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.12.6=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson.module:jackson-module-parameter-names:2.12.6=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.12.6=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -48,13 +44,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath -jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,productionRuntimeClasspath,providedRuntime,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -63,13 +58,8 @@ org.apache.ant:ant-junit:1.10.14=codenarc org.apache.bcel:bcel:6.11.0=spotbugs org.apache.commons:commons-lang3:3.19.0=spotbugs org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.logging.log4j:log4j-api:2.17.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs -org.apache.logging.log4j:log4j-to-slf4j:2.17.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-core:9.0.60=compileClasspath,productionRuntimeClasspath,providedRuntime,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-el:9.0.60=compileClasspath,productionRuntimeClasspath,providedRuntime,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-websocket:9.0.60=compileClasspath,productionRuntimeClasspath,providedRuntime,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc @@ -87,6 +77,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -111,34 +102,18 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:jul-to-slf4j:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath +org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-autoconfigure:2.5.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-json:2.5.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-logging:2.5.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-tomcat:2.5.12=compileClasspath,productionRuntimeClasspath,providedRuntime,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-web:2.5.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter:2.5.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot:2.5.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-aop:5.3.18=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-beans:5.3.18=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-context:5.3.18=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-core:5.3.18=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-expression:5.3.18=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-jcl:5.3.18=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-web:5.3.18=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath -org.springframework:spring-webmvc:5.3.18=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -org.yaml:snakeyaml:1.28=compileClasspath,productionRuntimeClasspath,runtimeClasspath,serverFile,testCompileClasspath,testRuntimeClasspath tomcat:tomcat-9:9.0.117=serverFile -empty=annotationProcessor,developmentOnly,providedCompile,spotbugsPlugins,testAnnotationProcessor +empty=annotationProcessor,runtimeClasspath,spotbugsPlugins,testAnnotationProcessor diff --git a/dd-smoke-tests/springboot-velocity/application/build.gradle b/dd-smoke-tests/springboot-velocity/application/build.gradle new file mode 100644 index 00000000000..866c726b521 --- /dev/null +++ b/dd-smoke-tests/springboot-velocity/application/build.gradle @@ -0,0 +1,31 @@ +plugins { + id 'java' + id 'org.springframework.boot' version '2.7.15' + id 'io.spring.dependency-management' version '1.0.15.RELEASE' +} + +def sharedRootDir = "$rootDir/../../../" +def sharedConfigDirectory = "$sharedRootDir/gradle" +rootProject.ext.sharedConfigDirectory = sharedConfigDirectory + +apply from: "$sharedConfigDirectory/repositories.gradle" + +if (hasProperty('appBuildDir')) { + buildDir = property('appBuildDir') +} + +version = "" + +// Pin bytecode target: the nested daemon now runs on JDK 21, but the smoke test launches +// the produced jar on Java 8. +java { + sourceCompatibility = JavaVersion.VERSION_1_8 +} + +dependencies { + implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '1.5.18.RELEASE' + implementation group: 'org.apache.velocity', name: 'velocity', version: '1.5' + implementation(group: 'org.apache.velocity', name: 'velocity-tools', version: '1.3') { + exclude group: 'javax.servlet', module: 'servlet-api' + } +} diff --git a/dd-smoke-tests/springboot-velocity/application/settings.gradle b/dd-smoke-tests/springboot-velocity/application/settings.gradle new file mode 100644 index 00000000000..9a60bc37ec2 --- /dev/null +++ b/dd-smoke-tests/springboot-velocity/application/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'springboot-velocity-smoketest' diff --git a/dd-smoke-tests/springboot-velocity/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java b/dd-smoke-tests/springboot-velocity/application/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java similarity index 100% rename from dd-smoke-tests/springboot-velocity/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java rename to dd-smoke-tests/springboot-velocity/application/src/main/java/datadog/smoketest/springboot/SpringbootApplication.java diff --git a/dd-smoke-tests/springboot-velocity/src/main/java/datadog/smoketest/springboot/XssController.java b/dd-smoke-tests/springboot-velocity/application/src/main/java/datadog/smoketest/springboot/XssController.java similarity index 100% rename from dd-smoke-tests/springboot-velocity/src/main/java/datadog/smoketest/springboot/XssController.java rename to dd-smoke-tests/springboot-velocity/application/src/main/java/datadog/smoketest/springboot/XssController.java diff --git a/dd-smoke-tests/springboot-velocity/src/main/resources/templates/velocity-insecure.vm b/dd-smoke-tests/springboot-velocity/application/src/main/resources/templates/velocity-insecure.vm similarity index 100% rename from dd-smoke-tests/springboot-velocity/src/main/resources/templates/velocity-insecure.vm rename to dd-smoke-tests/springboot-velocity/application/src/main/resources/templates/velocity-insecure.vm diff --git a/dd-smoke-tests/springboot-velocity/src/main/resources/templates/velocity-secure.vm b/dd-smoke-tests/springboot-velocity/application/src/main/resources/templates/velocity-secure.vm similarity index 100% rename from dd-smoke-tests/springboot-velocity/src/main/resources/templates/velocity-secure.vm rename to dd-smoke-tests/springboot-velocity/application/src/main/resources/templates/velocity-secure.vm diff --git a/dd-smoke-tests/springboot-velocity/build.gradle b/dd-smoke-tests/springboot-velocity/build.gradle index 76881a53bc1..7e18918b074 100644 --- a/dd-smoke-tests/springboot-velocity/build.gradle +++ b/dd-smoke-tests/springboot-velocity/build.gradle @@ -1,34 +1,52 @@ -import org.springframework.boot.gradle.tasks.bundling.BootJar - plugins { - id 'java' - id 'org.springframework.boot' version '2.7.15' - id 'io.spring.dependency-management' version '1.0.15.RELEASE' + id 'dd-trace-java.smoke-test-app' id 'java-test-fixtures' } apply from: "$rootDir/gradle/java.gradle" -apply from: "$rootDir/gradle/spring-boot-plugin.gradle" + description = 'SpringBoot Velocity Smoke Tests.' -dependencies { - implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web', version: '1.5.18.RELEASE' - implementation group: 'org.apache.velocity', name: 'velocity', version: '1.5' - implementation(group: 'org.apache.velocity', name: 'velocity-tools', version: '1.3') { - exclude group: 'javax.servlet', module: 'servlet-api' +smokeTestApp { + gradleApp { + taskName = 'bootJar' + artifactPath = 'libs/springboot-velocity-smoketest.jar' + sysProperty = 'datadog.smoketest.springboot.shadowJar.path' } +} +dependencies { testImplementation project(':dd-smoke-tests') testImplementation(testFixtures(project(":dd-smoke-tests:iast-util"))) } +// XssController loads templates from the filesystem at "resources/main/templates" relative to +// the test JVM's working directory (this module's build dir). Mirror the nested app's +// processed resources so that path resolves at runtime. +def applicationResourcesProvider = layout.buildDirectory.dir("application/resources/main") +tasks.register('copyAppResources', Copy) { + dependsOn 'bootJar' + from applicationResourcesProvider + into layout.buildDirectory.dir("resources/main") +} + +// `java.gradle` applies the `java` plugin so an empty `jar` task is created with +// `build/resources/main` as one of its inputs. Wire the dependency so Gradle knows +// `copyAppResources` writes there. +tasks.named('jar') { + dependsOn 'copyAppResources' +} + tasks.withType(Test).configureEach { - dependsOn "bootJar" - def bootJarTask = tasks.named('bootJar', BootJar) - jvmArgumentProviders.add(new CommandLineArgumentProvider() { - @Override - Iterable asArguments() { - return bootJarTask.map { ["-Ddatadog.smoketest.springboot.shadowJar.path=${it.archiveFile.get()}"] }.get() - } - }) + dependsOn 'copyAppResources' +} + +spotless { + java { + target "**/*.java" + } + + groovyGradle { + target '*.gradle', "**/*.gradle" + } } diff --git a/dd-smoke-tests/springboot-velocity/gradle.lockfile b/dd-smoke-tests/springboot-velocity/gradle.lockfile index 398dae0f220..da0f473e856 100644 --- a/dd-smoke-tests/springboot-velocity/gradle.lockfile +++ b/dd-smoke-tests/springboot-velocity/gradle.lockfile @@ -1,120 +1,93 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. -antlr:antlr:2.7.7=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -avalon-framework:avalon-framework:4.1.3=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +# To regenerate this file, run: ./gradlew :dd-smoke-tests:springboot-velocity:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath -ch.qos.logback:logback-classic:1.2.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath -com.fasterxml.jackson.core:jackson-annotations:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-core:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.core:jackson-databind:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.13.5=testFixturesRuntimeClasspath -com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.13.5=testFixturesRuntimeClasspath -com.fasterxml.jackson.module:jackson-module-parameter-names:2.13.5=testFixturesRuntimeClasspath -com.fasterxml.jackson:jackson-bom:2.13.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.fasterxml:classmate:1.5.1=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.javaparser:javaparser-core:3.25.4=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.javaparser:javaparser-core:3.25.6=codenarc +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath -com.google.code.gson:gson:2.9.1=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.code.gson:gson:2.13.2=spotbugs +com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:logging-interceptor:4.9.3=testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:okhttp:4.9.3=testCompileClasspath,testRuntimeClasspath -com.squareup.okio:okio:2.8.0=testCompileClasspath,testRuntimeClasspath -com.sun.activation:jakarta.activation:1.2.2=testRuntimeClasspath -com.sun.mail:jakarta.mail:1.6.7=testRuntimeClasspath +com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath +com.squareup.okio:okio:1.17.5=testCompileClasspath,testRuntimeClasspath +com.sun.activation:jakarta.activation:2.0.1=testRuntimeClasspath +com.sun.mail:jakarta.mail:2.0.1=testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc -commons-beanutils:commons-beanutils:1.7.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -commons-collections:commons-collections:3.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -commons-digester:commons-digester:1.8=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -commons-fileupload:commons-fileupload:1.0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs -commons-lang:commons-lang:2.1=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -commons-logging:commons-logging:1.1=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -commons-validator:commons-validator:1.3.1=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath -jakarta.activation:jakarta.activation-api:1.2.2=testRuntimeClasspath -jakarta.annotation:jakarta.annotation-api:1.3.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -jakarta.mail:jakarta.mail-api:1.6.7=testRuntimeClasspath -javax.servlet:javax.servlet-api:4.0.1=testCompileClasspath,testRuntimeClasspath -javax.validation:validation-api:2.0.1.Final=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -jaxen:jaxen:1.2.0=spotbugs +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath +jakarta.activation:jakarta.activation-api:2.1.3=testRuntimeClasspath +jakarta.mail:jakarta.mail-api:2.0.1=testRuntimeClasspath +javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath +jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -log4j:log4j:1.2.12=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -logkit:logkit:1.0.1=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.12.23=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.12.23=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs -org.apache.ant:ant-antlr:1.10.12=codenarc -org.apache.ant:ant-junit:1.10.12=codenarc +org.apache.ant:ant-antlr:1.10.14=codenarc +org.apache.ant:ant-junit:1.10.14=codenarc org.apache.bcel:bcel:6.11.0=spotbugs -org.apache.commons:commons-lang3:3.12.0=spotbugs,testRuntimeClasspath +org.apache.commons:commons-lang3:3.19.0=spotbugs +org.apache.commons:commons-lang3:3.5=testRuntimeClasspath org.apache.commons:commons-text:1.0=testRuntimeClasspath org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.logging.log4j:log4j-api:2.17.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.logging.log4j:log4j-core:2.17.2=spotbugs -org.apache.logging.log4j:log4j-to-slf4j:2.17.2=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-core:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-el:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.tomcat.embed:tomcat-embed-websocket:9.0.79=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.velocity:velocity-tools:1.3=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.apache.velocity:velocity:1.5=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.apache.logging.log4j:log4j-api:2.25.2=spotbugs +org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath -org.codehaus.groovy:groovy-ant:3.0.19=codenarc -org.codehaus.groovy:groovy-docgenerator:3.0.19=codenarc -org.codehaus.groovy:groovy-groovydoc:3.0.19=codenarc -org.codehaus.groovy:groovy-json:3.0.19=codenarc +org.codehaus.groovy:groovy-ant:3.0.23=codenarc +org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc +org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.23=codenarc org.codehaus.groovy:groovy-json:3.0.25=testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-templates:3.0.19=codenarc -org.codehaus.groovy:groovy-xml:3.0.19=codenarc -org.codehaus.groovy:groovy:3.0.19=codenarc +org.codehaus.groovy:groovy-templates:3.0.23=codenarc +org.codehaus.groovy:groovy-xml:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.23=codenarc org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc -org.hamcrest:hamcrest-core:2.2=testRuntimeClasspath -org.hamcrest:hamcrest:2.2=testCompileClasspath,testRuntimeClasspath -org.hibernate:hibernate-validator:5.3.6.Final=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jboss.logging:jboss-logging:3.4.3.Final=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath +org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-common:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib:1.6.21=testCompileClasspath,testRuntimeClasspath -org.jetbrains:annotations:13.0=testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter:5.8.2=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath @@ -135,40 +108,17 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:jul-to-slf4j:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.36=compileClasspath,productionRuntimeClasspath,runtimeClasspath,spotbugs,spotbugsSlf4j,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-autoconfigure:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-json:2.7.15=testFixturesRuntimeClasspath -org.springframework.boot:spring-boot-starter-logging:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-tomcat:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-web:1.5.18.RELEASE=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot-starter-web:2.7.15=testFixturesRuntimeClasspath -org.springframework.boot:spring-boot-starter:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework.boot:spring-boot:2.7.15=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-aop:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-beans:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-context:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-core:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-expression:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-jcl:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-web:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -org.springframework:spring-webmvc:5.3.29=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -org.yaml:snakeyaml:1.30=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -oro:oro:2.0.8=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -sslext:sslext:1.2-0=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -struts:struts:1.2.9=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -velocity:velocity-dep:1.4=productionRuntimeClasspath,runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -velocity:velocity:1.4=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -xalan:xalan:2.5.1=compileClasspath,productionRuntimeClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -empty=annotationProcessor,developmentOnly,spotbugsPlugins,testAnnotationProcessor,testFixturesAnnotationProcessor,testFixturesCompileClasspath +empty=annotationProcessor,runtimeClasspath,spotbugsPlugins,testAnnotationProcessor,testFixturesAnnotationProcessor,testFixturesCompileClasspath,testFixturesRuntimeClasspath diff --git a/dd-smoke-tests/springboot/gradle.lockfile b/dd-smoke-tests/springboot/gradle.lockfile index 05dcf701f34..82956acce2c 100644 --- a/dd-smoke-tests/springboot/gradle.lockfile +++ b/dd-smoke-tests/springboot/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:springboot:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -10,7 +11,7 @@ com.auth0:jwks-rsa:0.21.1=compileClasspath,runtimeClasspath,testCompileClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -23,28 +24,27 @@ com.fasterxml.jackson.core:jackson-databind:2.8.11.3=compileClasspath,testCompil com.fasterxml.jackson:jackson-bom:2.13.2=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.fasterxml:classmate:1.3.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=compileClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.google.code.findbugs:jsr305:3.0.2=compileClasspath,runtimeClasspath,spotbugs,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.10=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs -com.google.errorprone:error_prone_annotations:2.3.4=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:failureaccess:1.0.1=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.google.guava:guava:20.0=compileClasspath,testCompileClasspath -com.google.guava:guava:30.0-jre=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.google.j2objc:j2objc-annotations:1.3=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.nimbusds:nimbus-jose-jwt:9.22=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -63,15 +63,15 @@ commons-lang:commons-lang:1.0.1=compileClasspath,runtimeClasspath,testCompileCla commons-logging:commons-logging:1.2=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath de.thetaphi:forbiddenapis:3.10=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jakarta.activation:jakarta.activation-api:2.1.3=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jakarta.mail:jakarta.mail-api:2.0.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath javax.validation:validation-api:1.1.0.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -96,7 +96,6 @@ org.apache.tomcat.embed:tomcat-embed-el:8.5.35=compileClasspath,runtimeClasspath org.apache.tomcat.embed:tomcat-embed-websocket:8.5.35=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.apache.tomcat:tomcat-annotations-api:8.5.35=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath -org.checkerframework:checker-qual:3.5.0=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc @@ -115,6 +114,7 @@ org.hibernate:hibernate-validator:5.3.6.Final=compileClasspath,runtimeClasspath, org.jboss.logging:jboss-logging:3.3.0.Final=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -139,8 +139,8 @@ org.ow2.asm:asm-tree:9.7.1=runtimeClasspath,testFixturesRuntimeClasspath,testRun org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=compileClasspath,runtimeClasspath,testCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/src/main/groovy/datadog/smoketest/AbstractSmokeTest.groovy b/dd-smoke-tests/src/main/groovy/datadog/smoketest/AbstractSmokeTest.groovy index 25aba9b9660..28b71306349 100644 --- a/dd-smoke-tests/src/main/groovy/datadog/smoketest/AbstractSmokeTest.groovy +++ b/dd-smoke-tests/src/main/groovy/datadog/smoketest/AbstractSmokeTest.groovy @@ -252,6 +252,11 @@ abstract class AbstractSmokeTest extends ProcessManager { // Unlike crash tracking smoke test, keep the default delay; otherwise, otherwise other tests will fail // ret += "-Ddd.dogstatsd.start-delay=0" } + + // Disable CDS to avoid SIGSEGVs on Linux arm64. + if (OperatingSystem.isLinux() && OperatingSystem.architecture().isArm64()) { + ret += "-Xshare:off" + } ret as String[] } diff --git a/dd-smoke-tests/src/main/groovy/datadog/smoketest/ProcessManager.groovy b/dd-smoke-tests/src/main/groovy/datadog/smoketest/ProcessManager.groovy index 55dd4a03a78..fc771e842bd 100644 --- a/dd-smoke-tests/src/main/groovy/datadog/smoketest/ProcessManager.groovy +++ b/dd-smoke-tests/src/main/groovy/datadog/smoketest/ProcessManager.groovy @@ -19,7 +19,10 @@ abstract class ProcessManager extends Specification { public static final String SERVICE_NAME = "smoke-test-java-app" public static final String ENV = "smoketest" public static final String VERSION = "99" - public static final Set NOISY_ENVIRONMENT_VARIABLES = ImmutableSet.of('CI_COMMIT_MESSAGE', 'CI_COMMIT_DESCRIPTION') + public static final Set NOISY_ENVIRONMENT_VARIABLES = ImmutableSet.of( + 'CI_COMMIT_TITLE', + 'CI_COMMIT_MESSAGE', + 'CI_COMMIT_DESCRIPTION') private static final DateTimeFormatter LOG_FILE_TIMESTAMP_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd-HHmmss.SSS", Locale.ROOT).withZone(ZoneOffset.UTC) diff --git a/dd-smoke-tests/tracer-flare/gradle.lockfile b/dd-smoke-tests/tracer-flare/gradle.lockfile index 5b801a39bfb..2a0a508bc02 100644 --- a/dd-smoke-tests/tracer-flare/gradle.lockfile +++ b/dd-smoke-tests/tracer-flare/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:tracer-flare:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -72,6 +77,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -96,8 +102,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/vertx-3.4/application/gradle/wrapper/gradle-wrapper.jar b/dd-smoke-tests/vertx-3.4/application/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index e708b1c023e..00000000000 Binary files a/dd-smoke-tests/vertx-3.4/application/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/dd-smoke-tests/vertx-3.4/application/gradle/wrapper/gradle-wrapper.properties b/dd-smoke-tests/vertx-3.4/application/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index a4cf193f638..00000000000 --- a/dd-smoke-tests/vertx-3.4/application/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,8 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionSha256Sum=6f74b601422d6d6fc4e1f9a1ab6522f642c2fdcbc15ae33ebd30ba3d7198e854 -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.5-bin.zip -networkTimeout=10000 -validateDistributionUrl=true -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/dd-smoke-tests/vertx-3.4/application/gradlew b/dd-smoke-tests/vertx-3.4/application/gradlew deleted file mode 100755 index 965aff38453..00000000000 --- a/dd-smoke-tests/vertx-3.4/application/gradlew +++ /dev/null @@ -1,183 +0,0 @@ -#!/usr/bin/env sh - -# -# Copyright 2015 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=`expr $i + 1` - done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -exec "$JAVACMD" "$@" diff --git a/dd-smoke-tests/vertx-3.4/application/gradlew.bat b/dd-smoke-tests/vertx-3.4/application/gradlew.bat deleted file mode 100644 index 107acd32c4e..00000000000 --- a/dd-smoke-tests/vertx-3.4/application/gradlew.bat +++ /dev/null @@ -1,89 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/dd-smoke-tests/vertx-3.4/build.gradle b/dd-smoke-tests/vertx-3.4/build.gradle index a912e7b34e4..3f268d856b6 100644 --- a/dd-smoke-tests/vertx-3.4/build.gradle +++ b/dd-smoke-tests/vertx-3.4/build.gradle @@ -1,57 +1,36 @@ plugins { + id 'dd-trace-java.smoke-test-app' id 'idea' id 'java-test-fixtures' } apply from: "$rootDir/gradle/java.gradle" +description = 'Vert.x 3.4 Smoke Tests.' + +smokeTestApp { + gradleApp { + taskName = 'vertxBuild' + nestedTasks = ['assemble'] + artifactPath = 'libs/vertx-3.4-1.0.0-SNAPSHOT-fat.jar' + sysProperty = 'datadog.smoketest.vertx.uberJar.path' + } + projectJar('apiJar', project(':dd-trace-api')) +} + dependencies { testImplementation project(':dd-smoke-tests') testImplementation(testFixtures(project(":dd-smoke-tests:iast-util"))) testImplementation project(':dd-smoke-tests:appsec') } -def appDir = "$projectDir/application" -def appBuildDir = "$buildDir/application" -def isWindows = System.getProperty("os.name").toLowerCase().contains("win") -def gradlewCommand = isWindows ? 'gradlew.bat' : 'gradlew' -// define the task that builds the quarkus project -tasks.register('vertxBuild', Exec) { - workingDir "$appDir" - environment += [ - "GRADLE_OPTS": "-Dorg.gradle.jvmargs='-Xmx512M'", - "JAVA_HOME": getLazyJavaHomeFor(8) - ] - commandLine "$appDir/${gradlewCommand}", "assemble", "--no-daemon", "--max-workers=4", "-PappBuildDir=$appBuildDir", "-PapiJar=${project(':dd-trace-api').tasks.jar.archiveFile.get()}" - - outputs.cacheIf { true } - - outputs.dir(appBuildDir) - .withPropertyName("applicationJar") - - inputs.files(fileTree(appDir) { - include '**/*' - exclude '.gradle/**' - }) - .withPropertyName("application") - .withPathSensitivity(PathSensitivity.RELATIVE) -} - -tasks.named("vertxBuild", Exec) { - dependsOn project(':dd-trace-api').tasks.named("jar") -} - tasks.named("compileTestGroovy", GroovyCompile) { dependsOn 'vertxBuild' outputs.upToDateWhen { - !vertxBuild.didWork + !tasks.named('vertxBuild').get().didWork } } -tasks.withType(Test).configureEach { - jvmArgs "-Ddatadog.smoketest.vertx.uberJar.path=$appBuildDir/libs/vertx-3.4-1.0.0-SNAPSHOT-fat.jar" -} - spotless { java { target "**/*.java" @@ -64,6 +43,6 @@ spotless { idea { module { - excludeDirs += [file("$appDir")] + excludeDirs += [file("$projectDir/application")] } } diff --git a/dd-smoke-tests/vertx-3.4/gradle.lockfile b/dd-smoke-tests/vertx-3.4/gradle.lockfile index 9dd0d2a55dc..7e21781d135 100644 --- a/dd-smoke-tests/vertx-3.4/gradle.lockfile +++ b/dd-smoke-tests/vertx-3.4/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:vertx-3.4:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -46,8 +51,8 @@ jakarta.mail:jakarta.mail-api:2.0.1=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -77,6 +82,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -101,8 +107,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath @@ -114,4 +120,4 @@ org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeCla org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -empty=annotationProcessor,runtimeClasspath,spotbugsPlugins,testAnnotationProcessor,testFixturesAnnotationProcessor,testFixturesCompileClasspath,testFixturesRuntimeClasspath +empty=annotationProcessor,runtimeClasspath,smokeTestAppExtraJarApiJar,spotbugsPlugins,testAnnotationProcessor,testFixturesAnnotationProcessor,testFixturesCompileClasspath,testFixturesRuntimeClasspath diff --git a/dd-smoke-tests/vertx-3.9-resteasy/application/gradle/wrapper/gradle-wrapper.jar b/dd-smoke-tests/vertx-3.9-resteasy/application/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index e708b1c023e..00000000000 Binary files a/dd-smoke-tests/vertx-3.9-resteasy/application/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/dd-smoke-tests/vertx-3.9-resteasy/application/gradle/wrapper/gradle-wrapper.properties b/dd-smoke-tests/vertx-3.9-resteasy/application/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index a4cf193f638..00000000000 --- a/dd-smoke-tests/vertx-3.9-resteasy/application/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,8 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionSha256Sum=6f74b601422d6d6fc4e1f9a1ab6522f642c2fdcbc15ae33ebd30ba3d7198e854 -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.5-bin.zip -networkTimeout=10000 -validateDistributionUrl=true -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/dd-smoke-tests/vertx-3.9-resteasy/application/gradlew b/dd-smoke-tests/vertx-3.9-resteasy/application/gradlew deleted file mode 100755 index 965aff38453..00000000000 --- a/dd-smoke-tests/vertx-3.9-resteasy/application/gradlew +++ /dev/null @@ -1,183 +0,0 @@ -#!/usr/bin/env sh - -# -# Copyright 2015 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=`expr $i + 1` - done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -exec "$JAVACMD" "$@" diff --git a/dd-smoke-tests/vertx-3.9-resteasy/application/gradlew.bat b/dd-smoke-tests/vertx-3.9-resteasy/application/gradlew.bat deleted file mode 100644 index ac1b06f9382..00000000000 --- a/dd-smoke-tests/vertx-3.9-resteasy/application/gradlew.bat +++ /dev/null @@ -1,89 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/dd-smoke-tests/vertx-3.9-resteasy/build.gradle b/dd-smoke-tests/vertx-3.9-resteasy/build.gradle index c7e3dd90565..b99c1f8ac74 100644 --- a/dd-smoke-tests/vertx-3.9-resteasy/build.gradle +++ b/dd-smoke-tests/vertx-3.9-resteasy/build.gradle @@ -1,54 +1,33 @@ plugins { + id 'dd-trace-java.smoke-test-app' id 'idea' } apply from: "$rootDir/gradle/java.gradle" -dependencies { - testImplementation project(':dd-smoke-tests') -} - -def appDir = "$projectDir/application" -def appBuildDir = "$buildDir/application" -def isWindows = System.getProperty("os.name").toLowerCase().contains("win") -def gradlewCommand = isWindows ? 'gradlew.bat' : 'gradlew' -// define the task that builds the quarkus project -tasks.register('vertxBuild', Exec) { - workingDir "$appDir" - environment += [ - "GRADLE_OPTS": "-Dorg.gradle.jvmargs='-Xmx512M'", - "JAVA_HOME": getLazyJavaHomeFor(8) - ] - commandLine "$appDir/${gradlewCommand}", "assemble", "--no-daemon", "--max-workers=4", "-PappBuildDir=$appBuildDir", "-PapiJar=${project(':dd-trace-api').tasks.jar.archiveFile.get()}" - - outputs.cacheIf { true } - - outputs.dir(appBuildDir) - .withPropertyName("applicationJar") +description = 'Vert.x 3.9 RestEasy Smoke Tests.' - inputs.files(fileTree(appDir) { - include '**/*' - exclude '.gradle/**' - }) - .withPropertyName("application") - .withPathSensitivity(PathSensitivity.RELATIVE) +smokeTestApp { + gradleApp { + taskName = 'vertxBuild' + nestedTasks = ['assemble'] + artifactPath = 'libs/vertx-3.9-resteasy-1.0.0-SNAPSHOT-fat.jar' + sysProperty = 'datadog.smoketest.vertx.uberJar.path' + } + projectJar('apiJar', project(':dd-trace-api')) } -tasks.named("vertxBuild", Exec) { - dependsOn project(':dd-trace-api').tasks.named("jar") +dependencies { + testImplementation project(':dd-smoke-tests') } tasks.named("compileTestGroovy", GroovyCompile) { dependsOn 'vertxBuild' outputs.upToDateWhen { - !vertxBuild.didWork + !tasks.named('vertxBuild').get().didWork } } -tasks.withType(Test).configureEach { - jvmArgs "-Ddatadog.smoketest.vertx.uberJar.path=$appBuildDir/libs/vertx-3.9-resteasy-1.0.0-SNAPSHOT-fat.jar" -} - spotless { java { target "**/*.java" @@ -61,6 +40,6 @@ spotless { idea { module { - excludeDirs += [file("$appDir")] + excludeDirs += [file("$projectDir/application")] } } diff --git a/dd-smoke-tests/vertx-3.9-resteasy/gradle.lockfile b/dd-smoke-tests/vertx-3.9-resteasy/gradle.lockfile index 5b801a39bfb..85bc6a3e30f 100644 --- a/dd-smoke-tests/vertx-3.9-resteasy/gradle.lockfile +++ b/dd-smoke-tests/vertx-3.9-resteasy/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:vertx-3.9-resteasy:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -72,6 +77,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -96,8 +102,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath @@ -109,4 +115,4 @@ org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeCla org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -empty=annotationProcessor,runtimeClasspath,spotbugsPlugins,testAnnotationProcessor +empty=annotationProcessor,runtimeClasspath,smokeTestAppExtraJarApiJar,spotbugsPlugins,testAnnotationProcessor diff --git a/dd-smoke-tests/vertx-3.9/application/gradle/wrapper/gradle-wrapper.jar b/dd-smoke-tests/vertx-3.9/application/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index e708b1c023e..00000000000 Binary files a/dd-smoke-tests/vertx-3.9/application/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/dd-smoke-tests/vertx-3.9/application/gradle/wrapper/gradle-wrapper.properties b/dd-smoke-tests/vertx-3.9/application/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index a4cf193f638..00000000000 --- a/dd-smoke-tests/vertx-3.9/application/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,8 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionSha256Sum=6f74b601422d6d6fc4e1f9a1ab6522f642c2fdcbc15ae33ebd30ba3d7198e854 -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.5-bin.zip -networkTimeout=10000 -validateDistributionUrl=true -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/dd-smoke-tests/vertx-3.9/application/gradlew b/dd-smoke-tests/vertx-3.9/application/gradlew deleted file mode 100755 index 965aff38453..00000000000 --- a/dd-smoke-tests/vertx-3.9/application/gradlew +++ /dev/null @@ -1,183 +0,0 @@ -#!/usr/bin/env sh - -# -# Copyright 2015 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=`expr $i + 1` - done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -exec "$JAVACMD" "$@" diff --git a/dd-smoke-tests/vertx-3.9/application/gradlew.bat b/dd-smoke-tests/vertx-3.9/application/gradlew.bat deleted file mode 100644 index ac1b06f9382..00000000000 --- a/dd-smoke-tests/vertx-3.9/application/gradlew.bat +++ /dev/null @@ -1,89 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/dd-smoke-tests/vertx-3.9/build.gradle b/dd-smoke-tests/vertx-3.9/build.gradle index 2f374a5c699..0747b1f6c35 100644 --- a/dd-smoke-tests/vertx-3.9/build.gradle +++ b/dd-smoke-tests/vertx-3.9/build.gradle @@ -1,55 +1,34 @@ plugins { + id 'dd-trace-java.smoke-test-app' id 'idea' } apply from: "$rootDir/gradle/java.gradle" -dependencies { - testImplementation project(':dd-smoke-tests') - testImplementation(testFixtures(project(":dd-smoke-tests:iast-util"))) -} - -def appDir = "$projectDir/application" -def appBuildDir = "$buildDir/application" -def isWindows = System.getProperty("os.name").toLowerCase().contains("win") -def gradlewCommand = isWindows ? 'gradlew.bat' : 'gradlew' -// define the task that builds the vertx project -tasks.register('vertxBuild', Exec) { - workingDir "$appDir" - environment += [ - "GRADLE_OPTS": "-Dorg.gradle.jvmargs='-Xmx512M'", - "JAVA_HOME": getLazyJavaHomeFor(8) - ] - commandLine "$appDir/${gradlewCommand}", "assemble", "--no-daemon", "--max-workers=4", "-PappBuildDir=$appBuildDir", "-PapiJar=${project(':dd-trace-api').tasks.jar.archiveFile.get()}" - - outputs.cacheIf { true } - - outputs.dir(appBuildDir) - .withPropertyName("applicationJar") +description = 'Vert.x 3.9 Smoke Tests.' - inputs.files(fileTree(appDir) { - include '**/*' - exclude '.gradle/**' - }) - .withPropertyName("application") - .withPathSensitivity(PathSensitivity.RELATIVE) +smokeTestApp { + gradleApp { + taskName = 'vertxBuild' + nestedTasks = ['assemble'] + artifactPath = 'libs/vertx-3.9-1.0.0-SNAPSHOT-fat.jar' + sysProperty = 'datadog.smoketest.vertx.uberJar.path' + } + projectJar('apiJar', project(':dd-trace-api')) } -tasks.named("vertxBuild", Exec) { - dependsOn project(':dd-trace-api').tasks.named("jar") +dependencies { + testImplementation project(':dd-smoke-tests') + testImplementation(testFixtures(project(":dd-smoke-tests:iast-util"))) } tasks.named("compileTestGroovy", GroovyCompile) { dependsOn 'vertxBuild' outputs.upToDateWhen { - !vertxBuild.didWork + !tasks.named('vertxBuild').get().didWork } } -tasks.withType(Test).configureEach { - jvmArgs "-Ddatadog.smoketest.vertx.uberJar.path=$appBuildDir/libs/vertx-3.9-1.0.0-SNAPSHOT-fat.jar" -} - spotless { java { target "**/*.java" @@ -62,6 +41,6 @@ spotless { idea { module { - excludeDirs += [file("$appDir")] + excludeDirs += [file("$projectDir/application")] } } diff --git a/dd-smoke-tests/vertx-3.9/gradle.lockfile b/dd-smoke-tests/vertx-3.9/gradle.lockfile index 6654660a645..76ac83f2b5a 100644 --- a/dd-smoke-tests/vertx-3.9/gradle.lockfile +++ b/dd-smoke-tests/vertx-3.9/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:vertx-3.9:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -41,14 +46,14 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath jakarta.activation:jakarta.activation-api:2.1.3=testRuntimeClasspath jakarta.mail:jakarta.mail-api:2.0.1=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -78,6 +83,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -102,8 +108,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath @@ -115,4 +121,4 @@ org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeCla org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -empty=annotationProcessor,runtimeClasspath,spotbugsPlugins,testAnnotationProcessor +empty=annotationProcessor,runtimeClasspath,smokeTestAppExtraJarApiJar,spotbugsPlugins,testAnnotationProcessor diff --git a/dd-smoke-tests/vertx-4.2/application/gradle/wrapper/gradle-wrapper.jar b/dd-smoke-tests/vertx-4.2/application/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index e708b1c023e..00000000000 Binary files a/dd-smoke-tests/vertx-4.2/application/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/dd-smoke-tests/vertx-4.2/application/gradle/wrapper/gradle-wrapper.properties b/dd-smoke-tests/vertx-4.2/application/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index a4cf193f638..00000000000 --- a/dd-smoke-tests/vertx-4.2/application/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,8 +0,0 @@ -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -distributionSha256Sum=6f74b601422d6d6fc4e1f9a1ab6522f642c2fdcbc15ae33ebd30ba3d7198e854 -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.5-bin.zip -networkTimeout=10000 -validateDistributionUrl=true -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists diff --git a/dd-smoke-tests/vertx-4.2/application/gradlew b/dd-smoke-tests/vertx-4.2/application/gradlew deleted file mode 100755 index 965aff38453..00000000000 --- a/dd-smoke-tests/vertx-4.2/application/gradlew +++ /dev/null @@ -1,183 +0,0 @@ -#!/usr/bin/env sh - -# -# Copyright 2015 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn () { - echo "$*" -} - -die () { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -nonstop=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; - NONSTOP* ) - nonstop=true - ;; -esac - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin or MSYS, switch paths to Windows format before running java -if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=`expr $i + 1` - done - case $i in - 0) set -- ;; - 1) set -- "$args0" ;; - 2) set -- "$args0" "$args1" ;; - 3) set -- "$args0" "$args1" "$args2" ;; - 4) set -- "$args0" "$args1" "$args2" "$args3" ;; - 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Escape application args -save () { - for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done - echo " " -} -APP_ARGS=`save "$@"` - -# Collect all arguments for the java command, following the shell quoting and substitution rules -eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" - -exec "$JAVACMD" "$@" diff --git a/dd-smoke-tests/vertx-4.2/application/gradlew.bat b/dd-smoke-tests/vertx-4.2/application/gradlew.bat deleted file mode 100644 index 107acd32c4e..00000000000 --- a/dd-smoke-tests/vertx-4.2/application/gradlew.bat +++ /dev/null @@ -1,89 +0,0 @@ -@rem -@rem Copyright 2015 the original author or authors. -@rem -@rem Licensed under the Apache License, Version 2.0 (the "License"); -@rem you may not use this file except in compliance with the License. -@rem You may obtain a copy of the License at -@rem -@rem https://www.apache.org/licenses/LICENSE-2.0 -@rem -@rem Unless required by applicable law or agreed to in writing, software -@rem distributed under the License is distributed on an "AS IS" BASIS, -@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -@rem See the License for the specific language governing permissions and -@rem limitations under the License. -@rem - -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Resolve any "." and ".." in APP_HOME to make it shorter. -for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi - -@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto execute - -echo. -echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto execute - -echo. -echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% -echo. -echo Please set the JAVA_HOME variable in your environment to match the -echo location of your Java installation. - -goto fail - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/dd-smoke-tests/vertx-4.2/build.gradle b/dd-smoke-tests/vertx-4.2/build.gradle index bc36d08acb0..57cba56c827 100644 --- a/dd-smoke-tests/vertx-4.2/build.gradle +++ b/dd-smoke-tests/vertx-4.2/build.gradle @@ -1,56 +1,35 @@ plugins { + id 'dd-trace-java.smoke-test-app' id 'idea' } apply from: "$rootDir/gradle/java.gradle" +description = 'Vert.x 4.2 Smoke Tests.' + +smokeTestApp { + gradleApp { + taskName = 'vertxBuild' + nestedTasks = ['assemble'] + artifactPath = 'libs/vertx-4.2-1.0.0-SNAPSHOT-fat.jar' + sysProperty = 'datadog.smoketest.vertx.uberJar.path' + } + projectJar('apiJar', project(':dd-trace-api')) +} + dependencies { testImplementation project(':dd-smoke-tests') testImplementation(testFixtures(project(":dd-smoke-tests:iast-util"))) testImplementation project(':dd-smoke-tests:appsec') } -def appDir = "$projectDir/application" -def appBuildDir = "$buildDir/application" -def isWindows = System.getProperty("os.name").toLowerCase().contains("win") -def gradlewCommand = isWindows ? 'gradlew.bat' : 'gradlew' -// define the task that builds the quarkus project -tasks.register('vertxBuild', Exec) { - workingDir "$appDir" - environment += [ - "GRADLE_OPTS": "-Dorg.gradle.jvmargs='-Xmx512M'", - "JAVA_HOME": getLazyJavaHomeFor(8) - ] - commandLine "$appDir/${gradlewCommand}", "assemble", "--no-daemon", "--max-workers=4", "-PappBuildDir=$appBuildDir", "-PapiJar=${project(':dd-trace-api').tasks.jar.archiveFile.get()}" - - outputs.cacheIf { true } - - outputs.dir(appBuildDir) - .withPropertyName("applicationJar") - - inputs.files(fileTree(appDir) { - include '**/*' - exclude '.gradle/**' - }) - .withPropertyName("application") - .withPathSensitivity(PathSensitivity.RELATIVE) -} - -tasks.named("vertxBuild", Exec) { - dependsOn project(':dd-trace-api').tasks.named("jar") -} - tasks.named("compileTestGroovy", GroovyCompile) { dependsOn 'vertxBuild' outputs.upToDateWhen { - !vertxBuild.didWork + !tasks.named('vertxBuild').get().didWork } } -tasks.withType(Test).configureEach { - jvmArgs "-Ddatadog.smoketest.vertx.uberJar.path=$appBuildDir/libs/vertx-4.2-1.0.0-SNAPSHOT-fat.jar" -} - spotless { java { target "**/*.java" @@ -63,6 +42,6 @@ spotless { idea { module { - excludeDirs += [file("$appDir")] + excludeDirs += [file("$projectDir/application")] } } diff --git a/dd-smoke-tests/vertx-4.2/gradle.lockfile b/dd-smoke-tests/vertx-4.2/gradle.lockfile index 7164dedcc1b..1db8cddbbad 100644 --- a/dd-smoke-tests/vertx-4.2/gradle.lockfile +++ b/dd-smoke-tests/vertx-4.2/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:vertx-4.2:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -46,8 +51,8 @@ jakarta.mail:jakarta.mail-api:2.0.1=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -77,6 +82,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -101,8 +107,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath @@ -114,4 +120,4 @@ org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeCla org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -empty=annotationProcessor,runtimeClasspath,spotbugsPlugins,testAnnotationProcessor +empty=annotationProcessor,runtimeClasspath,smokeTestAppExtraJarApiJar,spotbugsPlugins,testAnnotationProcessor diff --git a/dd-smoke-tests/websphere-jmx/gradle.lockfile b/dd-smoke-tests/websphere-jmx/gradle.lockfile index dd1cff62a1c..b210f8fe506 100644 --- a/dd-smoke-tests/websphere-jmx/gradle.lockfile +++ b/dd-smoke-tests/websphere-jmx/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:websphere-jmx:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,7 +9,7 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath @@ -17,22 +18,26 @@ com.github.docker-java:docker-java-api:3.4.2=testCompileClasspath,testRuntimeCla com.github.docker-java:docker-java-transport-zerodep:3.4.2=testCompileClasspath,testRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -43,12 +48,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.13.0=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -78,6 +83,7 @@ org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath org.jetbrains:annotations:17.0.0=testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -102,8 +108,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.rnorth.duct-tape:duct-tape:1.0.8=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/websphere-jmx/src/test/groovy/datadog/smoketest/WebSphereJmxSmokeTest.groovy b/dd-smoke-tests/websphere-jmx/src/test/groovy/datadog/smoketest/WebSphereJmxSmokeTest.groovy index 28b72c111c7..81dde64229d 100644 --- a/dd-smoke-tests/websphere-jmx/src/test/groovy/datadog/smoketest/WebSphereJmxSmokeTest.groovy +++ b/dd-smoke-tests/websphere-jmx/src/test/groovy/datadog/smoketest/WebSphereJmxSmokeTest.groovy @@ -1,6 +1,6 @@ package datadog.smoketest - +import datadog.environment.OperatingSystem import java.time.Duration import java.util.concurrent.ArrayBlockingQueue import java.util.concurrent.BlockingQueue @@ -11,6 +11,7 @@ import org.testcontainers.containers.GenericContainer import org.testcontainers.containers.output.Slf4jLogConsumer import org.testcontainers.containers.wait.strategy.Wait import org.testcontainers.utility.MountableFile +import spock.lang.IgnoreIf import spock.lang.Shared /** @@ -22,6 +23,10 @@ import spock.lang.Shared * * Note that the websphere related metrics will only arrive if our instrumentation is applied. */ +// There is no arm64 docker image for IBM icr.io/appcafe/websphere-traditional. +@IgnoreIf({ + OperatingSystem.isLinux() && OperatingSystem.architecture().isArm64() +}) class WebSphereJmxSmokeTest extends AbstractSmokeTest { private static final Logger LOG = LoggerFactory.getLogger(WebSphereJmxSmokeTest) diff --git a/dd-smoke-tests/wildfly/build.gradle b/dd-smoke-tests/wildfly/build.gradle index 75941ba0288..cc8d48bf5a9 100644 --- a/dd-smoke-tests/wildfly/build.gradle +++ b/dd-smoke-tests/wildfly/build.gradle @@ -1,3 +1,10 @@ +import datadog.buildlogic.smoketest.NestedGradleBuild + +plugins { + id 'dd-trace-java.smoke-test-app' + id 'dd-trace-java.mass' +} + ext { serverName = 'wildfly' //serverModule = 'servlet' @@ -8,7 +15,7 @@ ext { repositories { ivy { - url = 'https://github.com/wildfly/wildfly/releases/download/' + url = mass.artifactUrl('github.com/wildfly/wildfly/releases/download/') // Restrict this repository to WildFly distribution artifacts only. // Without this filter, Gradle may probe this host for unrelated dependencies // (for example JUnit/Mockito), which makes the build flaky when the host is unreachable. @@ -49,32 +56,17 @@ dependencies { testImplementation project(':dd-smoke-tests') } -def appDir = "$projectDir/spring-ear" -def appBuildDir = "$buildDir/spring-ear" -def isWindows = System.getProperty("os.name").toLowerCase().contains("win") -def gradlewCommand = isWindows ? 'gradlew.bat' : 'gradlew' -// define the task that builds the quarkus project -tasks.register('earBuild', Exec) { - workingDir "$appDir" - environment += [ - "GRADLE_OPTS": "-Dorg.gradle.jvmargs='-Xmx512M'", - "JAVA_HOME": getLazyJavaHomeFor(8) - ] - commandLine "$rootDir/${gradlewCommand}", "assemble", "--no-daemon", "--max-workers=4", "-PappBuildDir=$appBuildDir", "-PapiJar=${project(':dd-trace-api').tasks.jar.archiveFile.get()}" - - outputs.cacheIf { true } - - outputs.dir(appBuildDir) - .withPropertyName("applicationEar") - - inputs.files(fileTree(appDir) { - include '**/*' - exclude '.gradle/**' - }) - .withPropertyName("application") - .withPathSensitivity(PathSensitivity.RELATIVE) - - dependsOn project(':dd-trace-api').tasks.named("jar") +def appBuildDir = layout.buildDirectory.dir("spring-ear") +evaluationDependsOn(':dd-trace-api') +def apiJarTask = project(':dd-trace-api').tasks.named('jar') + +// Run the nested EAR build through the Gradle Tooling API. +tasks.register('earBuild', NestedGradleBuild) { + applicationDir = layout.projectDirectory.dir("spring-ear") + applicationBuildDir = appBuildDir + tasksToRun = ['assemble'] + projectJar('apiJar', apiJarTask.flatMap { it.archiveFile }) + dependsOn apiJarTask } tasks.named("compileTestGroovy", GroovyCompile) { @@ -124,8 +116,8 @@ tasks.withType(Jar).configureEach { def wildflyDir = "${buildDir}/${serverName}-${serverVersion}" tasks.register("deploy", Copy) { - dependsOn 'unzip' - from "${appBuildDir}/libs/wildfly-spring-ear-smoketest.ear" + dependsOn 'unzip', 'earBuild' + from appBuildDir.map { it.file("libs/wildfly-spring-ear-smoketest.ear") } into "${wildflyDir}/standalone/deployments" } diff --git a/dd-smoke-tests/wildfly/gradle.lockfile b/dd-smoke-tests/wildfly/gradle.lockfile index 0711c09078d..b6972ca284d 100644 --- a/dd-smoke-tests/wildfly/gradle.lockfile +++ b/dd-smoke-tests/wildfly/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-smoke-tests:wildfly:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -72,6 +77,7 @@ org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -96,8 +102,8 @@ org.ow2.asm:asm-tree:9.7.1=testRuntimeClasspath org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.9=spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-smoke-tests/wildfly/spring-ear/build.gradle b/dd-smoke-tests/wildfly/spring-ear/build.gradle index fae476be498..df6b5a82cb0 100644 --- a/dd-smoke-tests/wildfly/spring-ear/build.gradle +++ b/dd-smoke-tests/wildfly/spring-ear/build.gradle @@ -15,6 +15,13 @@ if (hasProperty('appBuildDir')) { } version = "" + +// Pin bytecode target: the nested daemon now runs on JDK 21, but the deployed EAR runs in +// WildFly on Java 8. +java { + sourceCompatibility = JavaVersion.VERSION_1_8 +} + dependencies { earlib 'org.springframework:spring-webmvc:5.3.0' deploy project(path: ':war', configuration: 'archives') diff --git a/dd-smoke-tests/wildfly/spring-ear/settings.gradle b/dd-smoke-tests/wildfly/spring-ear/settings.gradle index b829474a50b..23e16079c29 100644 --- a/dd-smoke-tests/wildfly/spring-ear/settings.gradle +++ b/dd-smoke-tests/wildfly/spring-ear/settings.gradle @@ -1,36 +1,3 @@ -pluginManagement { - repositories { - mavenLocal() - if (settings.hasProperty("gradlePluginProxy")) { - maven { - url settings["gradlePluginProxy"] - allowInsecureProtocol = true - } - } - if (settings.hasProperty("mavenRepositoryProxy")) { - maven { - url settings["mavenRepositoryProxy"] - allowInsecureProtocol = true - } - } - gradlePluginPortal() - mavenCentral() - } -} - -def isCI = providers.environmentVariable("CI").isPresent() - -// Don't pollute the dependency cache with the build cache -if (isCI) { - def sharedRootDir = "$rootDir/../../../" - buildCache { - local { - // This needs to line up with the code in the outer project settings.gradle - directory = "$sharedRootDir/workspace/build-cache" - } - } -} - rootProject.name='wildfly-spring-ear-smoketest' include 'war' diff --git a/dd-smoke-tests/wildfly/spring-ear/war/build.gradle b/dd-smoke-tests/wildfly/spring-ear/war/build.gradle index f17d59edf16..5f929755dcb 100644 --- a/dd-smoke-tests/wildfly/spring-ear/war/build.gradle +++ b/dd-smoke-tests/wildfly/spring-ear/war/build.gradle @@ -1,6 +1,12 @@ apply plugin: 'java' apply plugin: 'war' +// Pin bytecode target: the nested daemon now runs on JDK 21, but the WAR is deployed in +// WildFly on Java 8. +java { + sourceCompatibility = JavaVersion.VERSION_1_8 +} + repositories { mavenLocal() if (project.rootProject.hasProperty("mavenRepositoryProxy")) { diff --git a/dd-trace-api/build.gradle.kts b/dd-trace-api/build.gradle.kts index bc05a8753a4..70a003348c9 100644 --- a/dd-trace-api/build.gradle.kts +++ b/dd-trace-api/build.gradle.kts @@ -5,75 +5,83 @@ plugins { apply(from = "$rootDir/gradle/java.gradle") apply(from = "$rootDir/gradle/publish.gradle") -val minimumBranchCoverage by extra(0.8) +configure { + // jar is not cacheable, and may differ + ignoreHashCheck = true +} + +extra["minimumBranchCoverage"] = 0.8 // These are tested outside of this module since this module mainly just defines 'API' -val excludedClassesCoverage by extra( - listOf( - "datadog.trace.api.ConfigDefaults", - "datadog.trace.api.CorrelationIdentifier", - "datadog.trace.api.DDSpanTypes", - "datadog.trace.api.DDTags", - "datadog.trace.api.DDTraceApiInfo", - "datadog.trace.api.DDTraceId", - "datadog.trace.api.EventTracker", - "datadog.trace.api.GlobalTracer*", - "datadog.trace.api.PropagationStyle", - "datadog.trace.api.TracePropagationStyle", - "datadog.trace.api.TracePropagationBehaviorExtract", - "datadog.trace.api.SpanCorrelation*", - "datadog.trace.api.internal.TraceSegment", - "datadog.trace.api.internal.TraceSegment.NoOp", - "datadog.trace.api.aiguard.AIGuard", - "datadog.trace.api.aiguard.AIGuard.AIGuardAbortError", - "datadog.trace.api.aiguard.AIGuard.AIGuardClientError", - "datadog.trace.api.aiguard.AIGuard.Options", - "datadog.trace.api.civisibility.CIVisibility", - "datadog.trace.api.civisibility.DDTestModule", - "datadog.trace.api.civisibility.noop.NoOpDDTest", - "datadog.trace.api.civisibility.noop.NoOpDDTestModule", - "datadog.trace.api.civisibility.noop.NoOpDDTestSession", - "datadog.trace.api.civisibility.noop.NoOpDDTestSuite", - "datadog.trace.api.config.AIGuardConfig", - "datadog.trace.api.config.FeatureFlaggingConfig", - "datadog.trace.api.config.ProfilingConfig", - "datadog.trace.api.interceptor.MutableSpan", - "datadog.trace.api.profiling.Profiling", - "datadog.trace.api.profiling.Profiling.NoOp", - "datadog.trace.api.profiling.ProfilingScope", - "datadog.trace.api.profiling.ProfilingContext", - "datadog.trace.api.profiling.ProfilingContextAttribute.NoOp", - "datadog.trace.api.llmobs.LLMObs", - "datadog.trace.api.llmobs.LLMObs.LLMMessage", - "datadog.trace.api.llmobs.LLMObs.ToolCall", - "datadog.trace.api.llmobs.LLMObsSpan", - "datadog.trace.api.llmobs.noop.NoOpLLMObsSpan", - "datadog.trace.api.llmobs.noop.NoOpLLMObsSpanFactory", - "datadog.trace.api.llmobs.noop.NoOpLLMObsEvalProcessor", - "datadog.trace.api.experimental.DataStreamsCheckpointer", - "datadog.trace.api.experimental.DataStreamsCheckpointer.NoOp", - "datadog.trace.api.experimental.DataStreamsContextCarrier", - "datadog.trace.api.experimental.DataStreamsContextCarrier.NoOp", - "datadog.appsec.api.blocking.*", - "datadog.appsec.api.user.*", - "datadog.appsec.api.login.*", - // Default fallback methods to not break legacy API - "datadog.trace.context.TraceScope", - "datadog.trace.context.NoopTraceScope.NoopContinuation", - "datadog.trace.context.NoopTraceScope", - "datadog.trace.payloadtags.PayloadTagsData", - "datadog.trace.payloadtags.PayloadTagsData.PathAndValue", - "datadog.trace.api.llmobs.LLMObsTags", - "datadog.trace.api.config.OtlpConfig.Protocol", - "datadog.trace.api.config.OtlpConfig.Temporality", - ) +extra["excludedClassesCoverage"] = listOf( + "datadog.trace.api.ConfigDefaults", + "datadog.trace.api.CorrelationIdentifier", + "datadog.trace.api.DDSpanTypes", + "datadog.trace.api.DDTags", + "datadog.trace.api.DDTraceApiInfo", + "datadog.trace.api.DDTraceId", + "datadog.trace.api.EventTracker", + "datadog.trace.api.GlobalTracer*", + "datadog.trace.api.PropagationStyle", + "datadog.trace.api.TracePropagationStyle", + "datadog.trace.api.TracePropagationBehaviorExtract", + "datadog.trace.api.SpanCorrelation*", + "datadog.trace.api.internal.TraceSegment", + "datadog.trace.api.internal.TraceSegment.NoOp", + "datadog.trace.api.aiguard.AIGuard", + "datadog.trace.api.aiguard.AIGuard.AIGuardAbortError", + "datadog.trace.api.aiguard.AIGuard.AIGuardClientError", + "datadog.trace.api.aiguard.AIGuard.ContentPart", + "datadog.trace.api.aiguard.AIGuard.ContentPart.Type", + "datadog.trace.api.aiguard.AIGuard.Evaluation", + "datadog.trace.api.aiguard.AIGuard.Message", + "datadog.trace.api.aiguard.AIGuard.Options", + "datadog.trace.api.civisibility.CIVisibility", + "datadog.trace.api.civisibility.DDTestModule", + "datadog.trace.api.civisibility.noop.NoOpDDTest", + "datadog.trace.api.civisibility.noop.NoOpDDTestModule", + "datadog.trace.api.civisibility.noop.NoOpDDTestSession", + "datadog.trace.api.civisibility.noop.NoOpDDTestSuite", + "datadog.trace.api.config.AIGuardConfig", + "datadog.trace.api.config.ProfilingConfig", + "datadog.trace.api.interceptor.MutableSpan", + "datadog.trace.api.profiling.Profiling", + "datadog.trace.api.profiling.Profiling.NoOp", + "datadog.trace.api.profiling.ProfilingScope", + "datadog.trace.api.profiling.ProfilingContext", + "datadog.trace.api.profiling.ProfilingContextAttribute.NoOp", + "datadog.trace.api.llmobs.LLMObs", + "datadog.trace.api.llmobs.LLMObs.Document", + "datadog.trace.api.llmobs.LLMObs.LLMMessage", + "datadog.trace.api.llmobs.LLMObs.ToolCall", + "datadog.trace.api.llmobs.LLMObs.ToolResult", + "datadog.trace.api.llmobs.LLMObsSpan", + "datadog.trace.api.llmobs.noop.NoOpLLMObsSpan", + "datadog.trace.api.llmobs.noop.NoOpLLMObsSpanFactory", + "datadog.trace.api.llmobs.noop.NoOpLLMObsEvalProcessor", + "datadog.trace.api.experimental.DataStreamsCheckpointer", + "datadog.trace.api.experimental.DataStreamsCheckpointer.NoOp", + "datadog.trace.api.experimental.DataStreamsContextCarrier", + "datadog.trace.api.experimental.DataStreamsContextCarrier.NoOp", + "datadog.appsec.api.blocking.*", + "datadog.appsec.api.user.*", + "datadog.appsec.api.login.*", + // Default fallback methods to not break legacy API + "datadog.trace.context.TraceScope", + "datadog.trace.context.NoopTraceScope.NoopContinuation", + "datadog.trace.context.NoopTraceScope", + "datadog.trace.payloadtags.PayloadTagsData", + "datadog.trace.payloadtags.PayloadTagsData.PathAndValue", + "datadog.trace.api.llmobs.LLMObsTags", + "datadog.trace.api.config.OtlpConfig.Compression", + "datadog.trace.api.config.OtlpConfig.Protocol", + "datadog.trace.api.config.OtlpConfig.Temporality", ) description = "dd-trace-api" dependencies { api(libs.slf4j) - testImplementation(libs.guava) testImplementation(libs.bundles.mockito) testImplementation(project(":utils:test-utils")) } diff --git a/dd-trace-api/gradle.lockfile b/dd-trace-api/gradle.lockfile index 006aef8ae87..736422bf7f3 100644 --- a/dd-trace-api/gradle.lockfile +++ b/dd-trace-api/gradle.lockfile @@ -1,16 +1,17 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-trace-api:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc commons-fileupload:commons-fileupload:1.5=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath @@ -18,8 +19,8 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -42,10 +43,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -60,10 +61,13 @@ org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspat org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath @@ -77,4 +81,4 @@ org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeCla org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -empty=annotationProcessor,signatures,spotbugsPlugins,testAnnotationProcessor +empty=annotationProcessor,spotbugsPlugins,testAnnotationProcessor diff --git a/dd-trace-api/src/main/java/datadog/appsec/api/blocking/Blocking.java b/dd-trace-api/src/main/java/datadog/appsec/api/blocking/Blocking.java index 370863f8e99..c902ce83582 100644 --- a/dd-trace-api/src/main/java/datadog/appsec/api/blocking/Blocking.java +++ b/dd-trace-api/src/main/java/datadog/appsec/api/blocking/Blocking.java @@ -61,8 +61,8 @@ public static boolean tryCommitBlockingResponse( } /** - * Equivalent to calling {@link #tryCommitBlockingResponse(int, BlockingContentType, Map)} with the last parameter being an empty map. + * Equivalent to calling {@link #tryCommitBlockingResponse(int, BlockingContentType, Map)} with + * the last parameter being an empty map. * * @param statusCode the status code of the response * @param contentType the content-type of the response. diff --git a/dd-trace-api/src/main/java/datadog/trace/api/ConfigDefaults.java b/dd-trace-api/src/main/java/datadog/trace/api/ConfigDefaults.java index 12381a03aa5..40d5753c478 100644 --- a/dd-trace-api/src/main/java/datadog/trace/api/ConfigDefaults.java +++ b/dd-trace-api/src/main/java/datadog/trace/api/ConfigDefaults.java @@ -82,6 +82,7 @@ public final class ConfigDefaults { new LinkedHashSet<>(asList(DATADOG, TRACECONTEXT, BAGGAGE)); static final Set DEFAULT_PROPAGATION_STYLE = new LinkedHashSet<>(asList(PropagationStyle.DATADOG)); + public static final boolean DEFAULT_PROPAGATION_B3_PADDING_ENABLED = true; static final int DEFAULT_TRACE_BAGGAGE_MAX_ITEMS = 64; static final int DEFAULT_TRACE_BAGGAGE_MAX_BYTES = 8192; static final List DEFAULT_TRACE_BAGGAGE_TAG_KEYS = @@ -114,6 +115,10 @@ public final class ConfigDefaults { static final int DEFAULT_METRICS_OTEL_TIMEOUT = 7_500; // ms static final int DEFAULT_METRICS_OTEL_CARDINALITY_LIMIT = 2_000; + static final int DEFAULT_TRACE_STATS_INTERVAL = 10_000; // ms + + public static final boolean DEFAULT_METRICS_OTEL_EXPERIMENTAL_ENABLED = true; + public static final int DEFAULT_OTLP_TRACES_TIMEOUT = 10_000; // ms static final String DEFAULT_OTLP_HTTP_LOGS_ENDPOINT = "v1/logs"; @@ -137,7 +142,7 @@ public final class ConfigDefaults { static final boolean DEFAULT_APP_LOGS_COLLECTION_ENABLED = false; static final String DEFAULT_APPSEC_ENABLED = "inactive"; - static final boolean DEFAULT_APPSEC_REPORTING_INBAND = false; + static final String DEFAULT_APPSEC_AGENTIC_ONBOARDING = ""; static final int DEFAULT_APPSEC_TRACE_RATE_LIMIT = 100; static final boolean DEFAULT_APPSEC_WAF_METRICS = true; static final int DEFAULT_APPSEC_WAF_TIMEOUT = 100000; // 0.1 s @@ -155,6 +160,7 @@ public final class ConfigDefaults { static final int DEFAULT_APPSEC_BODY_PARSING_SIZE_LIMIT = 10_000_000; static final int DEFAULT_APPSEC_MAX_FILE_CONTENT_BYTES = 4096; static final int DEFAULT_APPSEC_MAX_FILE_CONTENT_COUNT = 25; + static final int DEFAULT_APPSEC_SCA_MAX_TRACKED_DEPENDENCIES = 1_000; static final String DEFAULT_IAST_ENABLED = "false"; static final boolean DEFAULT_IAST_DEBUG_ENABLED = false; public static final int DEFAULT_IAST_MAX_CONCURRENT_REQUESTS = 4; @@ -165,9 +171,9 @@ public final class ConfigDefaults { static final String DEFAULT_IAST_WEAK_CIPHER_ALGORITHMS = "^(?:PBEWITH(?:HMACSHA(?:2(?:24ANDAES_(?:128|256)|56ANDAES_(?:128|256))|384ANDAES_(?:128|256)|512ANDAES_(?:128|256)|1ANDAES_(?:128|256))|SHA1AND(?:RC(?:2_(?:128|40)|4_(?:128|40))|DESEDE)|MD5AND(?:TRIPLEDES|DES))|DES(?:EDE(?:WRAP)?)?|BLOWFISH|ARCFOUR|RC2).*$"; static final boolean DEFAULT_IAST_REDACTION_ENABLED = true; - static final String DEFAULT_IAST_REDACTION_NAME_PATTERN = + public static final String DEFAULT_IAST_REDACTION_NAME_PATTERN = "(?:p(?:ass)?w(?:or)?d|pass(?:_?phrase)?|secret|(?:api_?|private_?|public_?|access_?|secret_?)key(?:_?id)?|token|consumer_?(?:id|key|secret)|sign(?:ed|ature)?|auth(?:entication|orization)?)"; - static final String DEFAULT_IAST_REDACTION_VALUE_PATTERN = + public static final String DEFAULT_IAST_REDACTION_VALUE_PATTERN = "(?:bearer\\s+[a-z0-9\\._\\-]+|glpat-[\\w\\-]{20}|gh[opsu]_[0-9a-zA-Z]{36}|ey[I-L][\\w=\\-]+\\.ey[I-L][\\w=\\-]+(?:\\.[\\w.+/=\\-]+)?|(?:[\\-]{5}BEGIN[a-z\\s]+PRIVATE\\sKEY[\\-]{5}[^\\-]+[\\-]{5}END[a-z\\s]+PRIVATE\\sKEY[\\-]{5}|ssh-rsa\\s*[a-z0-9/\\.+]{100,}))"; public static final int DEFAULT_IAST_MAX_RANGE_COUNT = 10; static final boolean DEFAULT_IAST_STACKTRACE_LEAK_SUPPRESS = false; @@ -193,7 +199,7 @@ public final class ConfigDefaults { static final boolean DEFAULT_CIVISIBILITY_AUTO_CONFIGURATION_ENABLED = true; static final boolean DEFAULT_CIVISIBILITY_COMPILER_PLUGIN_AUTO_CONFIGURATION_ENABLED = true; static final String DEFAULT_CIVISIBILITY_COMPILER_PLUGIN_VERSION = "0.2.4"; - static final String DEFAULT_CIVISIBILITY_JACOCO_PLUGIN_VERSION = "0.8.14"; + static final String DEFAULT_CIVISIBILITY_JACOCO_PLUGIN_VERSION = "0.8.15"; static final String DEFAULT_CIVISIBILITY_JACOCO_PLUGIN_EXCLUDES = "datadog.trace.*:org.apache.commons.*:org.mockito.*"; static final boolean DEFAULT_CIVISIBILITY_GIT_UPLOAD_ENABLED = true; @@ -226,7 +232,9 @@ public final class ConfigDefaults { static final int DEFAULT_DYNAMIC_INSTRUMENTATION_UPLOAD_BATCH_SIZE = 100; static final int DEFAULT_DYNAMIC_INSTRUMENTATION_MAX_PAYLOAD_SIZE = 1024; // KiB static final boolean DEFAULT_DYNAMIC_INSTRUMENTATION_VERIFY_BYTECODE = true; + static final String DEFAULT_DYNAMIC_INSTRUMENTATION_TIMEOUT_CHECKER_MODE = "WALL"; static final int DEFAULT_DYNAMIC_INSTRUMENTATION_CAPTURE_TIMEOUT = 100; // milliseconds + static final int DEFAULT_DYNAMIC_INSTRUMENTATION_EVAL_TIMEOUT = 50; // milliseconds static final int DEFAULT_DYNAMIC_INSTRUMENTATION_LOCALVAR_HOISTING_LEVEL = 1; static final boolean DEFAULT_SYMBOL_DATABASE_ENABLED = true; static final boolean DEFAULT_SYMBOL_DATABASE_FORCE_UPLOAD = false; diff --git a/dd-trace-api/src/main/java/datadog/trace/api/GlobalTracer.java b/dd-trace-api/src/main/java/datadog/trace/api/GlobalTracer.java index 74e1bd7f274..b3f73c18fba 100644 --- a/dd-trace-api/src/main/java/datadog/trace/api/GlobalTracer.java +++ b/dd-trace-api/src/main/java/datadog/trace/api/GlobalTracer.java @@ -86,7 +86,7 @@ public static Tracer get() { } /** - * @deprecated use static methods in {@link EventTrackerV2} directly + * @deprecated use static methods in {@link datadog.appsec.api.login.EventTrackerV2} directly */ @Deprecated public static EventTracker getEventTracker() { diff --git a/dd-trace-api/src/main/java/datadog/trace/api/IdGenerationStrategy.java b/dd-trace-api/src/main/java/datadog/trace/api/IdGenerationStrategy.java index 31c1b78a239..34956222e3d 100644 --- a/dd-trace-api/src/main/java/datadog/trace/api/IdGenerationStrategy.java +++ b/dd-trace-api/src/main/java/datadog/trace/api/IdGenerationStrategy.java @@ -13,6 +13,15 @@ * configuration based, for example 128 bit trace ids et.c., without changing the public API. */ public abstract class IdGenerationStrategy { + static { + // Eagerly load DDTraceId.ZERO _before_ calling any public DD64bTraceId methods below. + // This avoids a potential 'clinit' deadlock between DDTraceId and DD64bTraceId caused + // by one thread touching DD64bTraceId before the static initializer in DDTraceId has + // finished setting up the ZERO constant (which in turn uses DD64bTraceId) + @SuppressWarnings("unused") + DDTraceId init = DDTraceId.ZERO; + } + protected final boolean traceId128BitGenerationEnabled; private IdGenerationStrategy(boolean traceId128BitGenerationEnabled) { diff --git a/dd-trace-api/src/main/java/datadog/trace/api/config/AppSecConfig.java b/dd-trace-api/src/main/java/datadog/trace/api/config/AppSecConfig.java index 370813aa190..67a2705e984 100644 --- a/dd-trace-api/src/main/java/datadog/trace/api/config/AppSecConfig.java +++ b/dd-trace-api/src/main/java/datadog/trace/api/config/AppSecConfig.java @@ -4,9 +4,8 @@ public final class AppSecConfig { public static final String APPSEC_ENABLED = "appsec.enabled"; - public static final String APPSEC_REPORTING_INBAND = "appsec.reporting.inband"; + public static final String APPSEC_AGENTIC_ONBOARDING = "appsec.agentic_onboarding"; public static final String APPSEC_RULES_FILE = "appsec.rules"; - public static final String APPSEC_REPORT_TIMEOUT_SEC = "appsec.report.timeout"; public static final String APPSEC_IP_ADDR_HEADER = "appsec.ipheader"; public static final String APPSEC_TRACE_RATE_LIMIT = "appsec.trace.rate.limit"; public static final String APPSEC_WAF_METRICS = "appsec.waf.metrics"; @@ -32,6 +31,8 @@ public final class AppSecConfig { "api-security.endpoint.collection.enabled"; public static final String API_SECURITY_ENDPOINT_COLLECTION_MESSAGE_LIMIT = "api-security.endpoint.collection.message.limit"; + public static final String API_SECURITY_DOWNSTREAM_BODY_ANALYSIS_SAMPLE_RATE = + "api-security.downstream.body.analysis.sample_rate"; public static final String API_SECURITY_DOWNSTREAM_REQUEST_ANALYSIS_SAMPLE_RATE = "api-security.downstream.request.analysis.sample_rate"; public static final String API_SECURITY_DOWNSTREAM_REQUEST_BODY_ANALYSIS_SAMPLE_RATE = @@ -52,6 +53,8 @@ public final class AppSecConfig { "appsec.max.stacktrace.depth"; // old non-standard as a fallback alias public static final String APPSEC_MAX_FILE_CONTENT_BYTES = "appsec.max.file-content.bytes"; public static final String APPSEC_MAX_FILE_CONTENT_COUNT = "appsec.max.file-content.count"; + public static final String APPSEC_SCA_MAX_TRACKED_DEPENDENCIES = + "appsec.sca.max-tracked-dependencies"; private AppSecConfig() {} } diff --git a/dd-trace-api/src/main/java/datadog/trace/api/config/CiVisibilityConfig.java b/dd-trace-api/src/main/java/datadog/trace/api/config/CiVisibilityConfig.java index 05a1075f57d..7aa7be07380 100644 --- a/dd-trace-api/src/main/java/datadog/trace/api/config/CiVisibilityConfig.java +++ b/dd-trace-api/src/main/java/datadog/trace/api/config/CiVisibilityConfig.java @@ -90,6 +90,7 @@ public final class CiVisibilityConfig { public static final String GIT_COMMIT_HEAD_SHA = "git.commit.head.sha"; /* COVERAGE SETTINGS */ + public static final String CODE_COVERAGE_FLAGS = "code.coverage.flags"; public static final String CIVISIBILITY_CODE_COVERAGE_ENABLED = "civisibility.code.coverage.enabled"; public static final String CIVISIBILITY_CODE_COVERAGE_LINES_ENABLED = diff --git a/dd-trace-api/src/main/java/datadog/trace/api/config/DebuggerConfig.java b/dd-trace-api/src/main/java/datadog/trace/api/config/DebuggerConfig.java index 606267fa285..1e9d90c2e43 100644 --- a/dd-trace-api/src/main/java/datadog/trace/api/config/DebuggerConfig.java +++ b/dd-trace-api/src/main/java/datadog/trace/api/config/DebuggerConfig.java @@ -32,8 +32,14 @@ public final class DebuggerConfig { "dynamic.instrumentation.exclude.files"; public static final String DYNAMIC_INSTRUMENTATION_INCLUDE_FILES = "dynamic.instrumentation.include.files"; + public static final String DYNAMIC_INSTRUMENTATION_TIMEOUT_CHECKER_MODE = + "internal.dynamic.instrumentation.timeout.checker.mode"; public static final String DYNAMIC_INSTRUMENTATION_CAPTURE_TIMEOUT = "dynamic.instrumentation.capture.timeout"; + public static final String DYNAMIC_INSTRUMENTATION_CAPTURE_TIMEOUT_MS = + "dynamic.instrumentation.capture.timeout.ms"; + public static final String DYNAMIC_INSTRUMENTATION_EVAL_TIMEOUT_MS = + "dynamic.instrumentation.evaluation.timeout.ms"; public static final String DYNAMIC_INSTRUMENTATION_REDACTED_IDENTIFIERS = "dynamic.instrumentation.redacted.identifiers"; public static final String DYNAMIC_INSTRUMENTATION_REDACTION_EXCLUDED_IDENTIFIERS = diff --git a/dd-trace-api/src/main/java/datadog/trace/api/config/FeatureFlaggingConfig.java b/dd-trace-api/src/main/java/datadog/trace/api/config/FeatureFlaggingConfig.java deleted file mode 100644 index 28151f88864..00000000000 --- a/dd-trace-api/src/main/java/datadog/trace/api/config/FeatureFlaggingConfig.java +++ /dev/null @@ -1,6 +0,0 @@ -package datadog.trace.api.config; - -public class FeatureFlaggingConfig { - - public static final String FLAGGING_PROVIDER_ENABLED = "experimental.flagging.provider.enabled"; -} diff --git a/dd-trace-api/src/main/java/datadog/trace/api/config/GeneralConfig.java b/dd-trace-api/src/main/java/datadog/trace/api/config/GeneralConfig.java index 60af53815fc..aa87269f964 100644 --- a/dd-trace-api/src/main/java/datadog/trace/api/config/GeneralConfig.java +++ b/dd-trace-api/src/main/java/datadog/trace/api/config/GeneralConfig.java @@ -69,6 +69,17 @@ public final class GeneralConfig { public static final String TRACE_STATS_COMPUTATION_ENABLED = "trace.stats.computation.enabled"; public static final String TRACE_STATS_COMPUTATION_IGNORE_AGENT_VERSION = "trace.stats.computation.ignore.agent.version"; + + public static final String TRACE_STATS_CARDINALITY_LIMIT = "trace.stats.cardinality.limit"; + public static final String TRACE_STATS_RESOURCE_CARDINALITY_LIMIT = + "trace.stats.resource.cardinality.limit"; + public static final String TRACE_STATS_HTTP_ENDPOINT_CARDINALITY_LIMIT = + "trace.stats.http_endpoint.cardinality.limit"; + public static final String TRACE_STATS_PEER_TAGS_CARDINALITY_LIMIT = + "trace.stats.peer_tags.cardinality.limit"; + + public static final String TRACE_OTEL_SEMANTICS_ENABLED = "trace.otel.semantics.enabled"; + public static final String TRACER_METRICS_ENABLED = "trace.tracer.metrics.enabled"; public static final String TRACER_METRICS_BUFFERING_ENABLED = "trace.tracer.metrics.buffering.enabled"; @@ -118,7 +129,6 @@ public final class GeneralConfig { public static final String APM_TRACING_ENABLED = "apm.tracing.enabled"; public static final String JDK_SOCKET_ENABLED = "jdk.socket.enabled"; - public static final String OPTIMIZED_MAP_ENABLED = "optimized.map.enabled"; public static final String TAG_NAME_UTF8_CACHE_SIZE = "tag.name.utf8.cache.size"; public static final String TAG_VALUE_UTF8_CACHE_SIZE = "tag.value.utf8.cache.size"; public static final String SPAN_BUILDER_REUSE_ENABLED = "span.builder.reuse.enabled"; diff --git a/dd-trace-api/src/main/java/datadog/trace/api/config/OtlpConfig.java b/dd-trace-api/src/main/java/datadog/trace/api/config/OtlpConfig.java index 46aa07303f2..90fd9fd046f 100644 --- a/dd-trace-api/src/main/java/datadog/trace/api/config/OtlpConfig.java +++ b/dd-trace-api/src/main/java/datadog/trace/api/config/OtlpConfig.java @@ -20,6 +20,8 @@ public final class OtlpConfig { public static final String METRICS_OTEL_INTERVAL = "metrics.otel.interval"; public static final String METRICS_OTEL_TIMEOUT = "metrics.otel.timeout"; public static final String METRICS_OTEL_CARDINALITY_LIMIT = "metrics.otel.cardinality.limit"; + public static final String METRICS_OTEL_EXPERIMENTAL_ENABLED = + "metrics.otel.experimental.enabled"; public static final String OTLP_METRICS_ENDPOINT = "otlp.metrics.endpoint"; public static final String OTLP_METRICS_HEADERS = "otlp.metrics.headers"; @@ -29,6 +31,8 @@ public final class OtlpConfig { public static final String OTLP_METRICS_TEMPORALITY_PREFERENCE = "otlp.metrics.temporality.preference"; + public static final String OTEL_TRACES_SPAN_METRICS_ENABLED = "otel.traces.span.metrics.enabled"; + public static final String TRACE_OTEL_ENABLED = "trace.otel.enabled"; public static final String TRACE_OTEL_EXPORTER = "trace.otel.exporter"; diff --git a/dd-trace-api/src/main/java/datadog/trace/api/config/ProfilingConfig.java b/dd-trace-api/src/main/java/datadog/trace/api/config/ProfilingConfig.java index 4076f4aae30..6d60ab686a7 100644 --- a/dd-trace-api/src/main/java/datadog/trace/api/config/ProfilingConfig.java +++ b/dd-trace-api/src/main/java/datadog/trace/api/config/ProfilingConfig.java @@ -34,6 +34,12 @@ public final class ProfilingConfig { public static final String PROFILING_UPLOAD_TIMEOUT = "profiling.upload.timeout"; public static final int PROFILING_UPLOAD_TIMEOUT_DEFAULT = 30; + // When set to false, ddprof skips preloading jmethodIDs for eligible system classes to reduce + // native memory usage. Default is true to preserve current behavior (force preloading). + public static final String PROFILING_DATADOG_PROFILER_JMETHODID_OPTIM_ENABLED = + "profiling.experimental.ddprof.jmethodid_optim.enabled"; + public static final boolean PROFILING_DATADOG_PROFILER_JMETHODID_OPTIM_ENABLED_DEFAULT = false; + /** * @deprecated Use {@link #PROFILING_DEBUG_UPLOAD_COMPRESSION} instead. This will be removed in a * future release. diff --git a/dd-trace-api/src/main/java/datadog/trace/api/config/TraceInstrumentationConfig.java b/dd-trace-api/src/main/java/datadog/trace/api/config/TraceInstrumentationConfig.java index 0d21a7e371d..6d44cf8b249 100644 --- a/dd-trace-api/src/main/java/datadog/trace/api/config/TraceInstrumentationConfig.java +++ b/dd-trace-api/src/main/java/datadog/trace/api/config/TraceInstrumentationConfig.java @@ -15,6 +15,7 @@ public final class TraceInstrumentationConfig { public static final String CODE_ORIGIN_MAX_USER_FRAMES = "code.origin.max.user.frames"; public static final String TRACE_ENABLED = "trace.enabled"; public static final String INTEGRATIONS_ENABLED = "integrations.enabled"; + public static final String DETAILED_INSTRUMENTATION_ERRORS = "detailed.instrumentation.errors"; public static final String TRACE_EXTENSIONS_PATH = "trace.extensions.path"; diff --git a/dd-trace-api/src/main/java/datadog/trace/api/config/TracerConfig.java b/dd-trace-api/src/main/java/datadog/trace/api/config/TracerConfig.java index 78c0f4b5908..9faf4f4ea8e 100644 --- a/dd-trace-api/src/main/java/datadog/trace/api/config/TracerConfig.java +++ b/dd-trace-api/src/main/java/datadog/trace/api/config/TracerConfig.java @@ -169,5 +169,9 @@ public final class TracerConfig { "trace.cloud.payload.tagging.max-tags"; public static final String TRACE_SERVICE_DISCOVERY_ENABLED = "trace.service.discovery.enabled"; + public static final String TRACE_ORG_GUARD_ENABLED = "trace.org.guard.enabled"; + public static final String TRACE_ORG_GUARD_STRICT = "trace.org.guard.strict"; + public static final String TRACE_ORG_GUARD_TRUSTED_OPMS = "trace.org.guard.trusted.opms"; + private TracerConfig() {} } diff --git a/dd-trace-api/src/main/java/datadog/trace/api/interceptor/MutableSpan.java b/dd-trace-api/src/main/java/datadog/trace/api/interceptor/MutableSpan.java index e5ef4cef73c..97f32852a80 100644 --- a/dd-trace-api/src/main/java/datadog/trace/api/interceptor/MutableSpan.java +++ b/dd-trace-api/src/main/java/datadog/trace/api/interceptor/MutableSpan.java @@ -29,9 +29,9 @@ public interface MutableSpan { Integer getSamplingPriority(); /** - * @param newPriority - * @return - * @deprecated Use {@link io.opentracing.Span#setTag(String, boolean)} instead using either tag + * @param newPriority the sampling priority to set + * @return this {@link MutableSpan} instance, for chaining + * @deprecated Use {@code io.opentracing.Span#setTag(String, boolean)} instead using either tag * names {@link datadog.trace.api.DDTags#MANUAL_KEEP} or {@link * datadog.trace.api.DDTags#MANUAL_DROP}. */ diff --git a/dd-trace-api/src/main/java/datadog/trace/api/internal/TraceSegment.java b/dd-trace-api/src/main/java/datadog/trace/api/internal/TraceSegment.java index 0015c59452c..d6e262cfc78 100644 --- a/dd-trace-api/src/main/java/datadog/trace/api/internal/TraceSegment.java +++ b/dd-trace-api/src/main/java/datadog/trace/api/internal/TraceSegment.java @@ -132,8 +132,8 @@ default Object getTagCurrent(String key) { * * @param field field name * @param value value of the data - * @see datadog.trace.common.writer.ddagent.TraceMapperV0_4.MetaStructWriter - * @see datadog.trace.core.CoreSpan#setMetaStruct(String, Object) + * @see "datadog.trace.common.writer.ddagent.TraceMapperV0_4.MetaStructWriter" + * @see "datadog.trace.core.CoreSpan#setMetaStruct(String, Object)" */ void setMetaStructCurrent(String field, Object value); diff --git a/dd-trace-api/src/test/java/datadog/trace/api/DDTraceApiTableTestConverters.java b/dd-trace-api/src/test/java/datadog/trace/api/DDTraceApiTableTestConverters.java index bb21c3aac04..28f5dfc480b 100644 --- a/dd-trace-api/src/test/java/datadog/trace/api/DDTraceApiTableTestConverters.java +++ b/dd-trace-api/src/test/java/datadog/trace/api/DDTraceApiTableTestConverters.java @@ -1,6 +1,6 @@ package datadog.trace.api; -import datadog.trace.junit.utils.tabletest.TableTestTypeConverters; +import datadog.trace.test.junit.utils.tabletest.TableTestTypeConverters; import org.tabletest.junit.TypeConverter; /** TableTest converters shared by dd-trace-api test classes for unparsable constants. */ diff --git a/dd-trace-api/src/test/java/datadog/trace/api/DDTraceIdClinitDeadlockForkedTest.java b/dd-trace-api/src/test/java/datadog/trace/api/DDTraceIdClinitDeadlockForkedTest.java new file mode 100644 index 00000000000..6878a5fb1fd --- /dev/null +++ b/dd-trace-api/src/test/java/datadog/trace/api/DDTraceIdClinitDeadlockForkedTest.java @@ -0,0 +1,96 @@ +package datadog.trace.api; + +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.junit.jupiter.api.Assertions.fail; + +import java.util.concurrent.CyclicBarrier; +import java.util.concurrent.atomic.AtomicReference; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; + +/** + * Regression test for the {@code DDTraceId} <-> {@code DD64bTraceId} class-initialization + * deadlock. + * + *

      {@code DD64bTraceId} is a subclass of {@code DDTraceId}, so the JVM must initialize {@code + * DDTraceId} before {@code DD64bTraceId}. The bug was that {@code DDTraceId.} in turn + * initialized {@code DD64bTraceId} by building its {@code ZERO}/{@code ONE} constants via {@code + * DD64bTraceId.from(...)}. When the two classes were first touched concurrently from opposite ends + * (one thread initializing {@code DDTraceId}, another initializing {@code DD64bTraceId}), each + * thread held one class-initialization lock and waited for the other, hanging trace creation. This + * surfaced as 30s {@code LogInjectionSmokeTest} timeouts in CI. + * + *

      We now eagerly initialize {@code DDTraceId.ZERO} in {@code IdGenerationStrategy} - this class + * is touched very early on in config before the tracer is installed, which is enough to break the + * original cycle. An alternative fix would have been to introduce another subclass just for these + * constants, but that has wide repercussions across the codebase. Furthermore, if that new class + * was ever touched early on then a similar clinit deadlock could still occur. The only way to fix + * this without breaking API compatibility is therefore to arrange for {@code DDTraceId.ZERO} to be + * accessed as early as possible when configuring the trace id strategy. + * + *

      This test initializes the two classes for the first time concurrently from opposite ends after + * first touching {@code IdGenerationStrategy} and asserts neither thread hangs. + * + *

      Runs forked ({@code forkEvery = 1}) so it gets a fresh JVM in which these classes have not yet + * been initialized by another test. Without the fix it deadlocks and fails via the join check (and + * the {@code @Timeout} backstop); with the fix it completes immediately. + */ +class DDTraceIdClinitDeadlockForkedTest { + + @Test + @Timeout(value = 60, unit = SECONDS) // backstop; the join below is the primary guard + void traceIdClassPairInitializesConcurrentlyWithoutDeadlock() throws Exception { + final ClassLoader cl = getClass().getClassLoader(); + final CyclicBarrier barrier = new CyclicBarrier(2); + final AtomicReference error = new AtomicReference<>(); + + // One thread enters via the superclass (mirrors blackholeSpan() -> DDTraceId.ZERO), the other + // via the subclass (mirrors IdGenerationStrategy.generateTraceId() -> DD64bTraceId.from()). + + Thread viaSuper = + new Thread( + () -> { + try { + barrier.await(); + Class.forName("datadog.trace.api.DDTraceId", true, cl); + } catch (Throwable t) { + error.compareAndSet(null, t); + } + }, + "init-DDTraceId"); + Thread viaSub = + new Thread( + () -> { + try { + barrier.await(); + Class.forName("datadog.trace.api.IdGenerationStrategy", true, cl); + Class.forName("datadog.trace.api.DD64bTraceId", true, cl); + } catch (Throwable t) { + error.compareAndSet(null, t); + } + }, + "init-DD64bTraceId"); + // Daemon so a deadlock cannot block forked-JVM shutdown. + viaSuper.setDaemon(true); + viaSub.setDaemon(true); + + viaSuper.start(); + viaSub.start(); + viaSuper.join(SECONDS.toMillis(15)); + viaSub.join(SECONDS.toMillis(15)); + + if (viaSuper.isAlive() || viaSub.isAlive()) { + fail( + "DDTraceId/DD64bTraceId class-initialization deadlock: DDTraceId. must not " + + "reference DD64bTraceId (init-DDTraceId.alive=" + + viaSuper.isAlive() + + ", init-DD64bTraceId.alive=" + + viaSub.isAlive() + + ")."); + } + if (error.get() != null) { + throw new AssertionError( + "Unexpected error during concurrent class initialization", error.get()); + } + } +} diff --git a/dd-trace-api/src/test/java/datadog/trace/api/DDTraceIdTest.java b/dd-trace-api/src/test/java/datadog/trace/api/DDTraceIdTest.java index 3820b17c256..98225bb9698 100644 --- a/dd-trace-api/src/test/java/datadog/trace/api/DDTraceIdTest.java +++ b/dd-trace-api/src/test/java/datadog/trace/api/DDTraceIdTest.java @@ -140,6 +140,33 @@ void convert128BitIdsFromToHexadecimalStringRepresentation( assertEquals(Long.toUnsignedString(lowOrderBits), parsedId.toString()); } + @TableTest({ + "scenario | hexId | start | length | lowerCaseOnly | expectedHexId ", + "default bounds | 0123456789abcdeffedcba9876543210 | 0 | 32 | true | 0123456789abcdeffedcba9876543210", + "starting bounds | 0123456789abcdeffedcba9876543210 | 0 | 16 | true | 00000000000000000123456789abcdef", + "ending bounds | 0123456789abcdeffedcba9876543210 | 16 | 16 | true | 0000000000000000fedcba9876543210", + "middle bounds | 0123456789abcdeffedcba9876543210 | 8 | 4 | true | 000000000000000000000000000089ab", + "with padding | ---0123456789abcdeffedcba9876543210--- | 3 | 32 | true | 0123456789abcdeffedcba9876543210", + "upper case | 0123456789ABCDEFFEDCBA9876543210 | 0 | 32 | false | 0123456789abcdeffedcba9876543210", + "mixed case | 0123456789ABCDEFfedcba9876543210 | 0 | 32 | false | 0123456789abcdeffedcba9876543210", + "negative position | 0123456789abcdeffedcba9876543210 | -1 | 32 | false | ", + "negative length | 0123456789abcdeffedcba9876543210 | 0 | -1 | false | ", + "invalid length | 0123456789abcdeffedcba9876543210 | 0 | 33 | false | ", + "invalid ending bound | 0123456789abcdeffedcba9876543210 | 1 | 32 | false | ", + "invalid case | 0123456789ABCDEFFEDCBA9876543210 | 0 | 32 | true | " + }) + void converting128BitIdsFromHexadecimalStringRepresentation( + String hexId, int start, int length, boolean lowerCaseOnly, String expectedHexId) { + if (expectedHexId == null) { + assertThrows( + NumberFormatException.class, + () -> DD128bTraceId.fromHex(hexId, start, length, lowerCaseOnly)); + return; + } + DD128bTraceId parsedId = DD128bTraceId.fromHex(hexId, start, length, lowerCaseOnly); + assertEquals(expectedHexId, parsedId.toHexString()); + } + @ParameterizedTest( name = "fail parsing illegal 128-bit id hexadecimal String representation [{index}]") @NullSource @@ -185,14 +212,12 @@ private static String leftPadWithZeros(String value, int size) { if (value.length() >= size) { return value; } - return repeat("0", size - value.length()) + value; - } - - private static String repeat(String value, int count) { - StringBuilder builder = new StringBuilder(value.length() * count); + StringBuilder builder = new StringBuilder(size); + int count = size - value.length(); for (int index = 0; index < count; index++) { - builder.append(value); + builder.append('0'); } + builder.append(value); return builder.toString(); } } diff --git a/dd-trace-api/src/test/java/datadog/trace/api/ProtocolVersionTest.java b/dd-trace-api/src/test/java/datadog/trace/api/ProtocolVersionTest.java index 92d42691f37..18d14322388 100644 --- a/dd-trace-api/src/test/java/datadog/trace/api/ProtocolVersionTest.java +++ b/dd-trace-api/src/test/java/datadog/trace/api/ProtocolVersionTest.java @@ -3,15 +3,28 @@ import static datadog.trace.api.ProtocolVersion.V0_4; import static datadog.trace.api.ProtocolVersion.V0_5; import static datadog.trace.api.ProtocolVersion.V1_0; +import static datadog.trace.api.ProtocolVersion.fromConfigValue; +import static datadog.trace.api.ProtocolVersion.fromTraceEndpoint; import static java.util.Arrays.asList; import static java.util.Collections.singletonList; import static org.junit.jupiter.api.Assertions.assertEquals; +import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +@DisplayName("trace agent protocol versions") class ProtocolVersionTest { @Test + @DisplayName("expose configuration values") + void exposesConfigValues() { + assertEquals("0.4", V0_4.asConfigValue()); + assertEquals("0.5", V0_5.asConfigValue()); + assertEquals("1.0", V1_0.asConfigValue()); + } + + @Test + @DisplayName("expose primary endpoints and fallbacks") void exposesPrimaryEndpointAndFallbacks() { assertEquals("v0.4/traces", V0_4.endpoint()); assertEquals(singletonList("v0.3/traces"), V0_4.fallback()); @@ -24,9 +37,30 @@ void exposesPrimaryEndpointAndFallbacks() { } @Test + @DisplayName("preserve endpoint probe ordering") void preservesProbeOrdering() { assertEquals(asList("v0.4/traces", "v0.3/traces"), V0_4.endpointsToProbe()); assertEquals(asList("v0.5/traces", "v0.4/traces", "v0.3/traces"), V0_5.endpointsToProbe()); assertEquals(asList("v1.0/traces", "v0.4/traces", "v0.3/traces"), V1_0.endpointsToProbe()); } + + @Test + @DisplayName("map configuration values to protocol versions") + void mapsConfigValueToVersion() { + assertEquals(V0_4, fromConfigValue(null)); + assertEquals(V0_4, fromConfigValue("0.4")); + assertEquals(V0_5, fromConfigValue("0.5")); + assertEquals(V1_0, fromConfigValue("1.0")); + assertEquals(V0_4, fromConfigValue("unsupported")); + } + + @Test + @DisplayName("map trace endpoints to protocol versions") + void mapsTraceEndpointToVersion() { + assertEquals(V0_4, fromTraceEndpoint(null)); + assertEquals(V1_0, fromTraceEndpoint("http://localhost:8126/v1.0/traces")); + assertEquals(V0_5, fromTraceEndpoint("HTTP://LOCALHOST:8126/V0.5/TRACES")); + assertEquals(V0_4, fromTraceEndpoint("v0.4/traces")); + assertEquals(V0_4, fromTraceEndpoint("http://localhost:8126/unsupported")); + } } diff --git a/dd-trace-core/build.gradle b/dd-trace-core/build.gradle index 48544e2984f..a5ec602366e 100644 --- a/dd-trace-core/build.gradle +++ b/dd-trace-core/build.gradle @@ -1,11 +1,13 @@ +import datadog.gradle.plugin.testJvmConstraints.TestJvmSpec + plugins { id 'me.champeau.jmh' + id 'dd-trace-java.version-file' } description = 'dd-trace-core' apply from: "$rootDir/gradle/java.gradle" -apply from: "$rootDir/gradle/version.gradle" minimumBranchCoverage = 0.5 minimumInstructionCoverage = 0.6 @@ -49,10 +51,22 @@ excludedClassesCoverage += [ 'datadog.trace.core.TracingConfigPoller.Updater', // covered with dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/CheckpointerTest.groovy 'datadog.trace.core.datastreams.DefaultDataStreamsMonitoring', + // no-op + 'datadog.trace.core.datastreams.DisabledDataStreamsMonitoring', + // pojo + 'datadog.trace.core.datastreams.DataStreamsTransactionExtractors.DataStreamsTransactionExtractorImpl', + // it's a private inner class. Tested indirectly via deserialize in DataStreamsTransactionExtractorsTest + 'datadog.trace.core.datastreams.DataStreamsTransactionExtractors.JsonDataStreamsTransactionExtractor', // TODO CorePropagation will be removed during context refactoring 'datadog.trace.core.propagation.CorePropagation', // TODO DSM propagator will be tested once fully migrated - 'datadog.trace.core.datastreams.DataStreamPropagator' + 'datadog.trace.core.datastreams.DataStreamPropagator', + // send() requires live HTTP/2 server + 'datadog.trace.core.otlp.common.OtlpGrpcSender', + // covered by OTLP system-tests + 'datadog.trace.core.otlp.logs.OtlpLogsService', + 'datadog.trace.core.otlp.metrics.OtlpMetricsSenderFactory', + 'datadog.trace.core.otlp.metrics.OtlpMetricsService' ] addTestSuite('traceAgentTest') @@ -83,8 +97,7 @@ dependencies { implementation libs.slf4j implementation libs.moshi implementation libs.jctools - - implementation group: 'com.google.re2j', name: 're2j', version: '1.7' + implementation libs.re2j // sketches-java is shared compileOnly group: 'com.datadoghq', name: 'sketches-java', version: '0.8.3' @@ -107,7 +120,8 @@ dependencies { testImplementation group: 'com.amazonaws', name: 'aws-lambda-java-events', version:'3.11.0' testImplementation group: 'com.google.protobuf', name: 'protobuf-java', version: '3.14.0' testImplementation libs.testcontainers - testImplementation project(':utils:junit-utils') + testImplementation project(':utils:test-junit-utils') + testImplementation project(':utils:test-junit-converter-utils') traceAgentTestImplementation libs.testcontainers } @@ -115,4 +129,14 @@ dependencies { jmh { jmhVersion = libs.versions.jmh.get() duplicateClassesStrategy = DuplicatesStrategy.EXCLUDE + if (project.hasProperty('jmh.includes')) { + includes = [project.property('jmh.includes').replace(',', '|')] + } + if (project.hasProperty('jmh.profilers')) { + profilers = project.property('jmh.profilers').tokenize(',') + } + if (project.hasProperty('testJvm')) { + def testJvmSpec = new TestJvmSpec(project) + jvm = testJvmSpec.javaTestLauncher.map { it.executablePath.asFile.absolutePath } + } } diff --git a/dd-trace-core/gradle.lockfile b/dd-trace-core/gradle.lockfile index ce3567cda1f..63710602213 100644 --- a/dd-trace-core/gradle.lockfile +++ b/dd-trace-core/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-trace-core:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath @@ -9,7 +10,7 @@ com.amazonaws:aws-lambda-java-events:3.11.0=jmhRuntimeClasspath,testCompileClass com.blogspot.mydailyjava:weak-lock-free:0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath com.datadoghq:sketches-java:0.8.3=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath @@ -20,15 +21,15 @@ com.github.docker-java:docker-java-api:3.4.2=jmhRuntimeClasspath,testCompileClas com.github.docker-java:docker-java-transport-zerodep:3.4.2=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath com.github.docker-java:docker-java-transport:3.4.2=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath +com.github.jnr:jffi:1.3.15=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,jmhCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=testAnnotationProcessor,testCompileClasspath,traceAgentTestAnnotationProcessor,traceAgentTestCompileClasspath @@ -38,13 +39,16 @@ com.google.code.findbugs:jsr305:3.0.2=compileClasspath,jmhCompileClasspath,jmhRu com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=testAnnotationProcessor,traceAgentTestAnnotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath com.google.guava:failureaccess:1.0.1=testAnnotationProcessor,traceAgentTestAnnotationProcessor -com.google.guava:guava:20.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath +com.google.guava:failureaccess:1.0.3=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath com.google.guava:guava:32.0.1-jre=testAnnotationProcessor,traceAgentTestAnnotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testAnnotationProcessor,traceAgentTestAnnotationProcessor +com.google.guava:guava:33.6.0-jre=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=jmhRuntimeClasspath,testAnnotationProcessor,testCompileClasspath,testRuntimeClasspath,traceAgentTestAnnotationProcessor,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=testAnnotationProcessor,traceAgentTestAnnotationProcessor +com.google.j2objc:j2objc-annotations:3.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath com.google.protobuf:protobuf-java:3.14.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath -com.google.re2j:re2j:1.7=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath +com.google.re2j:re2j:1.8=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath @@ -56,13 +60,13 @@ commons-io:commons-io:2.11.0=jmhRuntimeClasspath,testCompileClasspath,testRuntim commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=jmhRuntimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=jmhRuntimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath +io.sqreen:libsqreen:17.4.0=jmhRuntimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs joda-time:joda-time:2.6=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath junit:junit:4.13.2=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=jmhRuntimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath net.java.dev.jna:jna:5.13.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath net.sf.jopt-simple:jopt-simple:5.0.4=jmh,jmhCompileClasspath,jmhRuntimeClasspath @@ -92,13 +96,14 @@ org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath org.hamcrest:hamcrest:3.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.jctools:jctools-core-jdk11:4.0.6=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath org.jctools:jctools-core:4.0.6=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath org.jetbrains:annotations:17.0.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath +org.jspecify:jspecify:1.0.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=jmhRuntimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath @@ -124,16 +129,18 @@ org.openjdk.jol:jol-core:0.17=jmhRuntimeClasspath,testCompileClasspath,testRunti org.opentest4j:opentest4j:1.3.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt org.ow2.asm:asm-commons:9.7.1=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt org.ow2.asm:asm-tree:9.7.1=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=jmhRuntimeClasspath,runtimeClasspath,testRuntimeClasspath,traceAgentTestRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs org.ow2.asm:asm:9.0=jmh,jmhCompileClasspath +org.ow2.asm:asm:9.10.1=jacocoAnt,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath org.ow2.asm:asm:9.7.1=runtimeClasspath -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm:9.9.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs org.rnorth.duct-tape:duct-tape:1.0.8=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath org.slf4j:jcl-over-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath,traceAgentTestCompileClasspath,traceAgentTestRuntimeClasspath diff --git a/dd-trace-core/src/jmh/java/datadog/context/ContextManagerBenchmark.java b/dd-trace-core/src/jmh/java/datadog/context/ContextManagerBenchmark.java new file mode 100644 index 00000000000..0128535a9d0 --- /dev/null +++ b/dd-trace-core/src/jmh/java/datadog/context/ContextManagerBenchmark.java @@ -0,0 +1,377 @@ +package datadog.context; + +import static java.util.concurrent.TimeUnit.MICROSECONDS; +import static java.util.concurrent.TimeUnit.SECONDS; + +import datadog.trace.core.scopemanager.ContinuableScopeManager; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Semaphore; +import java.util.concurrent.ThreadFactory; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Param; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.TearDown; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.annotations.Warmup; + +/** + * Compares {@link ThreadLocalContextManager} vs {@link ContinuableScopeManager} across context + * attach, swap, and cross-thread continuation scenarios — including virtual threads (requires JDK + * 21+). + * + *

      For the same-non-root-context stack-depth scenario see {@link ContextManagerDepthBenchmark}. + * + *

      Run with: + * + *

      + * {@code ./gradlew :dd-trace-core:jmh -Pjmh.includes=ContextManagerBenchmark -PtestJvm=25 -Pjmh.profilers=gc}
      + * 
      + */ +@State(Scope.Benchmark) +@Warmup(iterations = 3, time = 1) +@Measurement(iterations = 5, time = 1) +@BenchmarkMode(Mode.Throughput) +@Threads(8) +@OutputTimeUnit(MICROSECONDS) +@Fork(value = 1) +public class ContextManagerBenchmark { + + // ── Constants ────────────────────────────────────────────────────────────── + + // Reflective access to Thread.ofVirtual().factory() (Java 21+). + // Used to create fixed-size pools of virtual threads so no new VT is spawned per task. + // Falls back to platform threads on older JVMs — the benchmark still runs, but + // captureAndResumeOnVirtualThread and captureAndFanOutToVirtualThreads will measure + // platform-thread overhead instead. + static final boolean VIRTUAL_THREADS_AVAILABLE; + static final ThreadFactory VIRTUAL_OR_PLATFORM_FACTORY; + + static { + ThreadFactory factory = null; + try { + Object builder = Thread.class.getMethod("ofVirtual").invoke(null); + factory = (ThreadFactory) builder.getClass().getMethod("factory").invoke(builder); + } catch (Exception ignored) { + } + VIRTUAL_THREADS_AVAILABLE = factory != null; + VIRTUAL_OR_PLATFORM_FACTORY = factory != null ? factory : Thread::new; + } + + // Creates a fixed pool whose threads are virtual (Java 21+) or platform (older JVMs). + // Using a fixed pool rather than newVirtualThreadPerTaskExecutor avoids spawning a + // fresh virtual thread on every task submission, keeping thread-creation cost out of + // the measured critical path. + static ExecutorService newFixedVirtualPool(int nThreads) { + return Executors.newFixedThreadPool(nThreads, VIRTUAL_OR_PLATFORM_FACTORY); + } + + static final ContextKey KEY = ContextKey.named("benchmark-key"); + // power of 2 so cycling wraps cheaply with bit-mask + static final int CONTEXT_COUNT = 16; + // virtual threads spawned per continuation fan-out + static final int FAN_OUT = 8; + + // ── Parameters ───────────────────────────────────────────────────────────── + + /** + * Which {@link ContextManager} implementation to benchmark. + * + *

      {@code ThreadLocal} — {@link ThreadLocalContextManager} (the lightweight default). + * + *

      {@code Continuable} — {@link ContinuableScopeManager} (the full scope/span manager). + */ + @Param({"ThreadLocal", "Continuable"}) + public String managerType; + + // ── Benchmark-scoped shared state ───────────────────────────────────────── + + ContextManager manager; + // CONTEXT_COUNT distinct non-root contexts; threads cycle through them to + // avoid artificial same-context hits in benchmarks that don't want them + Context[] contexts; + + @Setup + public void setup() { + manager = createManager(managerType); + contexts = createContexts(); + } + + static ContextManager createManager(String type) { + if ("Continuable".equals(type)) { + ContinuableScopeManager csm = new ContinuableScopeManager(0, false); + return new ContextManager() { + @Override + public Context current() { + return csm.currentContext(); + } + + @Override + public ContextScope attach(Context ctx) { + return csm.attach(ctx); + } + + @Override + public Context swap(Context ctx) { + return csm.swap(ctx); + } + + @Override + public ContextContinuation capture(Context ctx) { + return csm.capture(ctx); + } + + @Override + public void addListener(ContextListener l) {} + }; + } + return ThreadLocalContextManager.INSTANCE; + } + + static Context[] createContexts() { + Context[] contexts = new Context[CONTEXT_COUNT]; + for (int i = 0; i < CONTEXT_COUNT; i++) { + contexts[i] = Context.root().with(KEY, "value-" + i); + } + return contexts; + } + + // ── Per-thread state ─────────────────────────────────────────────────────── + + @State(Scope.Thread) + public static class ThreadState { + int index; + // Pre-allocated barrier reused across fan-out invocations. + // Avoids a new CountDownLatch allocation per invocation that would inflate gc.alloc.rate.norm. + final Semaphore fanOutBarrier = new Semaphore(0); + ExecutorService platformExecutor; + ExecutorService virtualExecutor; + + @Setup(Level.Trial) + public void setup() { + // Both pools are fixed-size so no new thread is created per submitted task. + // The virtual pool uses virtual threads (Java 21+) or falls back to platform threads. + // Pool size is intentionally larger than the JMH thread count to avoid executor starvation + // when benchmark threads all submit tasks concurrently. + platformExecutor = Executors.newFixedThreadPool(16); + virtualExecutor = newFixedVirtualPool(16); + } + + @TearDown(Level.Trial) + public void tearDown() throws InterruptedException { + platformExecutor.shutdown(); + virtualExecutor.shutdown(); + platformExecutor.awaitTermination(10, SECONDS); + virtualExecutor.awaitTermination(10, SECONDS); + } + + Context nextContext(Context[] contexts) { + return contexts[(index++) & (CONTEXT_COUNT - 1)]; + } + } + + // ── Thread state with a pre-attached context (for read benchmarks) ───────── + + /** + * Attaches a context once per trial so that {@link #current} and {@link #currentAndGet} measure + * only the read path, not the attach overhead. + */ + @State(Scope.Thread) + public static class ActiveContextState { + ContextScope scope; + + @Setup(Level.Trial) + public void setup(ContextManagerBenchmark benchmark) { + scope = benchmark.manager.attach(benchmark.contexts[0]); + } + + @TearDown(Level.Trial) + public void tearDown() { + scope.close(); + } + } + + // ── Scenario 1: attach a different context, close scope ─────────────────── + + /** Attach one distinct context then close its scope. The hot path for most instrumentations. */ + @Benchmark + public void attachAndClose(ThreadState thread) { + Context ctx = thread.nextContext(contexts); + try (ContextScope scope = manager.attach(ctx)) { + // scope is active + } + } + + // ── Scenario 2: nested attach of two different contexts ─────────────────── + + /** + * Attach two distinct contexts in sequence and close both. Exercises the stack push/pop cycle + * that occurs at every instrumented method boundary. + */ + @Benchmark + public void nestedAttachAndClose(ThreadState thread) { + Context outer = thread.nextContext(contexts); + Context inner = thread.nextContext(contexts); + try (ContextScope outerScope = manager.attach(outer)) { + try (ContextScope innerScope = manager.attach(inner)) { + // inner is active + } + } + } + + // ── Scenario 3: swap different contexts ─────────────────────────────────── + + /** + * Swap in a new context then swap back the previous one. {@link + * ContinuableScopeManager#swap(Context)} replaces the entire scope stack, making this a heavier + * operation than in {@link ThreadLocalContextManager}. + * + *

      Note: GCProfiler will show allocation asymmetry here by design. {@link + * ContinuableScopeManager} swap allocates a {@code ScopeStack}, a {@code ContinuableScope}, and a + * {@code ScopeContext} per invocation; {@link ThreadLocalContextManager} swap is a plain field + * write. That asymmetry is the real cost of each manager's swap operation, not scaffolding. + */ + @Benchmark + public void swapContexts(ThreadState thread) { + Context ctx = thread.nextContext(contexts); + Context previous = manager.swap(ctx); + manager.swap(previous); + } + + // ── Scenario 4: capture + same-thread resume (continuation baseline) ─────── + + /** + * Capture the current context as a continuation and immediately resume it on the same thread. + * Establishes the allocation and atomic-counter cost of the continuation mechanism without any + * cross-thread scheduling overhead. + */ + @Benchmark + public void captureThenResumeSameThread(ThreadState thread) { + Context ctx = thread.nextContext(contexts); + try (ContextScope scope = manager.attach(ctx)) { + ContextContinuation cont = manager.capture(ctx); + try (ContextScope resumed = cont.resume()) { + // context restored on the same thread + } + } + } + + // ── Scenario 5: capture, resume on a platform thread ───────────────────── + + /** + * Capture the current context as a continuation and resume it on a pooled platform thread. + * Measures cross-thread handoff latency (submit + schedule + execute) for each manager. + * + *

      Fewer JMH threads than the default so the platform executor is never saturated. + */ + @Benchmark + @Threads(4) + public void captureAndResumeOnPlatformThread(ThreadState thread) throws Exception { + captureAndResumeOnExecutor(thread, thread.platformExecutor); + } + + // ── Scenario 6: capture, resume on a virtual thread ────────────────────── + + /** + * Capture the current context as a continuation and resume it on a fixed-pool virtual thread. + * Shows how well each manager scales when continuations are used for structured concurrency or + * reactive pipelines on virtual threads. + */ + @Benchmark + @Threads(4) + public void captureAndResumeOnVirtualThread(ThreadState thread) throws Exception { + captureAndResumeOnExecutor(thread, thread.virtualExecutor); + } + + private void captureAndResumeOnExecutor(ThreadState thread, ExecutorService executor) + throws Exception { + Context ctx = thread.nextContext(contexts); + try (ContextScope scope = manager.attach(ctx)) { + ContextContinuation cont = manager.capture(ctx); + CompletableFuture.runAsync( + () -> { + try (ContextScope resumed = cont.resume()) { + // context propagated to executor thread + } + }, + executor) + .get(10, SECONDS); + } + } + + // ── Scenario 7: fan-out — one held continuation resumed on N virtual threads + + /** + * Capture one context, hold the continuation, then fan it out to {@value #FAN_OUT} virtual + * threads concurrently. Each virtual thread resumes the same continuation and closes its scope; + * only the explicit {@link ContextContinuation#release()} after the barrier completes the + * lifecycle. + * + *

      This reflects async frameworks that dispatch a single request context to a pool of worker + * coroutines / virtual threads. + * + *

      Uses {@link Mode#SampleTime} to capture percentile tail latency in addition to the mean. + * Warmup and measurement windows are extended because each invocation waits for {@value #FAN_OUT} + * round-trips before returning. + */ + @Benchmark + @Threads(2) + @BenchmarkMode(Mode.SampleTime) + @Warmup(iterations = 3, time = 3) + @Measurement(iterations = 5, time = 5) + public void captureAndFanOutToVirtualThreads(ThreadState thread) throws Exception { + Context ctx = thread.nextContext(contexts); + try (ContextScope scope = manager.attach(ctx)) { + ContextContinuation cont = manager.capture(ctx).hold(); + Semaphore barrier = thread.fanOutBarrier; + for (int i = 0; i < FAN_OUT; i++) { + thread.virtualExecutor.execute( + () -> { + try (ContextScope resumed = cont.resume()) { + // each virtual thread sees the same captured context + } finally { + barrier.release(); + } + }); + } + try { + if (!barrier.tryAcquire(FAN_OUT, 10, SECONDS)) { + throw new IllegalStateException("fan-out timed out"); + } + } finally { + cont.release(); + } + } + } + + // ── Scenario 8: read the current context ───────────────────────────────── + + /** + * Returns the currently active context. The most frequent operation in any traced application — + * called at every instrumented method boundary before reading a span or key. + */ + @Benchmark + public Context current(ActiveContextState active) { + return manager.current(); + } + + // ── Scenario 9: read a value from the current context ──────────────────── + + /** + * Returns a value from the currently active context. The full "read active span" path that + * instrumentation executes at every traced method boundary. + */ + @Benchmark + public Object currentAndGet(ActiveContextState active) { + return manager.current().get(KEY); + } +} diff --git a/dd-trace-core/src/jmh/java/datadog/context/ContextManagerDepthBenchmark.java b/dd-trace-core/src/jmh/java/datadog/context/ContextManagerDepthBenchmark.java new file mode 100644 index 00000000000..04da28efc9c --- /dev/null +++ b/dd-trace-core/src/jmh/java/datadog/context/ContextManagerDepthBenchmark.java @@ -0,0 +1,88 @@ +package datadog.context; + +import static java.util.concurrent.TimeUnit.MICROSECONDS; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Param; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.annotations.Warmup; + +/** + * Benchmarks attaching the same non-root context {@code depth} times then closing all scopes in + * LIFO order, isolating the same-context fast-path cost from the general attach/close benchmarks in + * {@link ContextManagerBenchmark}. + * + *

      In {@link ThreadLocalContextManager} each re-attach after the first returns a no-op scope. In + * {@link datadog.trace.core.scopemanager.ContinuableScopeManager} the first attach creates the + * scope and subsequent re-attaches increment its reference count; each close decrements it, with + * the final close doing the real work. + * + *

      Run with: + * + *

      + * {@code ./gradlew :dd-trace-core:jmh -Pjmh.includes=ContextManagerDepthBenchmark -PtestJvm=25 -Pjmh.profilers=gc}
      + * 
      + */ +@State(Scope.Benchmark) +@Warmup(iterations = 3, time = 1) +@Measurement(iterations = 5, time = 1) +@BenchmarkMode(Mode.Throughput) +@Threads(8) +@OutputTimeUnit(MICROSECONDS) +@Fork(value = 1) +public class ContextManagerDepthBenchmark { + + /** + * Which {@link ContextManager} implementation to benchmark. + * + * @see ContextManagerBenchmark#managerType + */ + @Param({"ThreadLocal", "Continuable"}) + public String managerType; + + @Param({"1", "4", "8", "100"}) + public int depth; + + ContextManager manager; + Context[] contexts; + + @Setup + public void setup() { + manager = ContextManagerBenchmark.createManager(managerType); + contexts = ContextManagerBenchmark.createContexts(); + } + + @State(Scope.Thread) + public static class ThreadState { + final ContextScope[] scopes = new ContextScope[100]; + + int nextContextIndex; + + Context nextContext(Context[] contexts) { + return contexts[(nextContextIndex++) & (ContextManagerBenchmark.CONTEXT_COUNT - 1)]; + } + } + + // ── Benchmark ───────────────────────────────────────────────────────────── + + /** Attach the same context {@code depth} times then close all scopes in LIFO order. */ + @Benchmark + public void attachSameContextDepth(ThreadState thread) { + Context ctx = thread.nextContext(contexts); + ContextScope[] scopes = thread.scopes; + for (int i = 0; i < depth; i++) { + scopes[i] = manager.attach(ctx); + } + for (int i = depth - 1; i >= 0; i--) { + scopes[i].close(); + } + } +} diff --git a/dd-trace-core/src/jmh/java/datadog/trace/common/metrics/AdversarialMetricsBenchmark.java b/dd-trace-core/src/jmh/java/datadog/trace/common/metrics/AdversarialMetricsBenchmark.java new file mode 100644 index 00000000000..01ba90097a4 --- /dev/null +++ b/dd-trace-core/src/jmh/java/datadog/trace/common/metrics/AdversarialMetricsBenchmark.java @@ -0,0 +1,153 @@ +package datadog.trace.common.metrics; + +import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND; +import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_CLIENT; +import static java.util.concurrent.TimeUnit.SECONDS; + +import datadog.trace.api.WellKnownTags; +import datadog.trace.core.CoreSpan; +import datadog.trace.core.monitor.HealthMetrics; +import de.thetaphi.forbiddenapis.SuppressForbidden; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.ThreadLocalRandom; +import java.util.concurrent.atomic.LongAdder; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.TearDown; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; + +/** + * Adversarial JMH benchmark designed to stress the metrics subsystem's capacity bounds. + * + *

      The metrics aggregator is bounded at every layer: + * + *

        + *
      • The aggregate cache caps total entries at {@code tracerMetricsMaxAggregates} (default + * 2048). Beyond that LRU eviction kicks in. + *
      • The producer/consumer inbox is a fixed-size MPSC queue ({@code tracerMetricsMaxPending}); + * when full, producer {@code offer} returns false and the snapshot is dropped via {@link + * HealthMetrics#onStatsInboxFull()}. + *
      • Histograms use a bounded dense store -- per-histogram memory is fixed. + *
      + * + *

      The benchmark hammers all of these simultaneously with 8 producer threads, unique labels per + * op (so the aggregate cache fills+evicts repeatedly), random durations across a wide range (so + * histograms accept many distinct bins), and random {@code error}/{@code topLevel} flags (so both + * histograms are exercised). After the run, drop counters are printed so you can see how the + * subsystem absorbed the burst. + * + *

      What "OOM the metrics subsystem" would look like if the bounds break: producer-thread + * allocation would grow unbounded (snapshots faster than the inbox can drain produces dropped + * snapshots, not heap growth); aggregator-thread heap would grow if entries weren't capped or + * histograms grew past their dense-store limit. + */ +@State(Scope.Benchmark) +@Warmup(iterations = 2, time = 15, timeUnit = SECONDS) +@Measurement(iterations = 5, time = 15, timeUnit = SECONDS) +@BenchmarkMode(Mode.Throughput) +@OutputTimeUnit(SECONDS) +@Threads(8) +@Fork(value = 1) +public class AdversarialMetricsBenchmark { + + private ClientStatsAggregator aggregator; + private CountingHealthMetrics health; + + @State(Scope.Thread) + public static class ThreadState { + int cursor; + } + + @Setup + public void setup() { + this.health = new CountingHealthMetrics(); + this.aggregator = + new ClientStatsAggregator( + new WellKnownTags("", "", "", "", "", ""), + Collections.emptySet(), + new ClientStatsAggregatorBenchmark.FixedAgentFeaturesDiscovery( + Collections.singleton("peer.hostname"), Collections.emptySet()), + this.health, + new ClientStatsAggregatorBenchmark.NullSink(), + 2048, + 2048, + false); + this.aggregator.start(); + } + + @TearDown + @SuppressForbidden + public void tearDown() { + aggregator.close(); + // Counters accumulate across the trial (warmup + measurement iterations), since the + // CountingHealthMetrics instance is created once in @Setup and never reset. + System.err.println( + "[ADVERSARIAL] drops over the trial (8 threads, warmup + measurement combined):"); + System.err.println( + " onStatsInboxFull = " + + health.inboxFull.sum() + + " (snapshots dropped because the MPSC inbox was full)"); + System.err.println( + " onStatsAggregateDropped = " + + health.aggregateDropped.sum() + + " (snapshots dropped because the aggregate cache was full with no stale entry)"); + } + + @Benchmark + public void publish(ThreadState ts, Blackhole blackhole) { + int idx = ts.cursor++; + ThreadLocalRandom rng = ThreadLocalRandom.current(); + + // Mix indices so labels don't fall into linear order. Distinct labels exceed every reasonable + // working-set bound, so the aggregate cache evicts continuously and most ops force a fresh + // MetricKey construction on the consumer thread. + int scrambled = idx * 0x9E3779B1; // golden ratio multiplier + String service = "svc-" + (scrambled & 0xFFFF); + String operation = "op-" + ((scrambled >>> 8) & 0x3FFFF); + String resource = "res-" + ((scrambled ^ 0x5A5A5A) & 0xFFFFF); + String hostname = "host-" + ((scrambled >>> 12) & 0x7FFF); + boolean error = (idx & 7) == 0; + boolean topLevel = (idx & 3) == 0; + // Wide duration spread forces histogram bins to populate broadly. + long durationNanos = 1L + (rng.nextLong() & 0x3FFFFFFFL); // 1 ns .. ~1.07 s + + SimpleSpan span = + new SimpleSpan( + service, operation, resource, "web", true, topLevel, error, 0, durationNanos, 200); + span.setTag(SPAN_KIND, SPAN_KIND_CLIENT); + span.setTag("peer.hostname", hostname); + + List> trace = Collections.singletonList(span); + blackhole.consume(aggregator.publish(trace)); + } + + /** + * Counts what gets dropped. Uses {@link LongAdder} so the printed totals hold up under 8-way + * contention -- {@code volatile long ++} loses ~20% of updates here, which would mask the + * order-of-magnitude shape the bench is trying to surface (inbox-full vs aggregate-dropped). + */ + static final class CountingHealthMetrics extends HealthMetrics { + final LongAdder inboxFull = new LongAdder(); + final LongAdder aggregateDropped = new LongAdder(); + + @Override + public void onStatsInboxFull() { + inboxFull.increment(); + } + + @Override + public void onStatsAggregateDropped() { + aggregateDropped.increment(); + } + } +} diff --git a/dd-trace-core/src/jmh/java/datadog/trace/common/metrics/ClientStatsAggregatorBenchmark.java b/dd-trace-core/src/jmh/java/datadog/trace/common/metrics/ClientStatsAggregatorBenchmark.java new file mode 100644 index 00000000000..b9d72eaf3ab --- /dev/null +++ b/dd-trace-core/src/jmh/java/datadog/trace/common/metrics/ClientStatsAggregatorBenchmark.java @@ -0,0 +1,104 @@ +package datadog.trace.common.metrics; + +import static datadog.trace.api.ProtocolVersion.V0_4; +import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND; +import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_CLIENT; +import static java.util.concurrent.TimeUnit.MICROSECONDS; +import static java.util.concurrent.TimeUnit.SECONDS; + +import datadog.communication.ddagent.DDAgentFeaturesDiscovery; +import datadog.metrics.api.Monitoring; +import datadog.trace.api.WellKnownTags; +import datadog.trace.core.CoreSpan; +import datadog.trace.core.monitor.HealthMetrics; +import datadog.trace.util.Strings; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Set; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; + +@State(Scope.Benchmark) +@Warmup(iterations = 1, time = 30, timeUnit = SECONDS) +@Measurement(iterations = 3, time = 30, timeUnit = SECONDS) +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(MICROSECONDS) +@Fork(value = 1) +public class ClientStatsAggregatorBenchmark { + private final DDAgentFeaturesDiscovery featuresDiscovery = + new FixedAgentFeaturesDiscovery( + Collections.singleton("peer.hostname"), Collections.emptySet()); + private final ClientStatsAggregator aggregator = + new ClientStatsAggregator( + new WellKnownTags("", "", "", "", "", ""), + Collections.emptySet(), + featuresDiscovery, + HealthMetrics.NO_OP, + new NullSink(), + 2048, + 2048, + false); + private final List> spans = generateTrace(64); + + static List> generateTrace(int len) { + final List> trace = new ArrayList<>(); + for (int i = 0; i < len; i++) { + SimpleSpan span = new SimpleSpan("", "", "", "", true, true, false, 0, 10, -1); + span.setTag(SPAN_KIND, SPAN_KIND_CLIENT); + span.setTag("peer.hostname", Strings.random(10)); + trace.add(span); + } + return trace; + } + + static class NullSink implements Sink { + + @Override + public void register(EventListener listener) {} + + @Override + public void accept(int messageCount, ByteBuffer buffer) {} + } + + static class FixedAgentFeaturesDiscovery extends DDAgentFeaturesDiscovery { + private final Set peerTags; + private final Set spanKinds; + + public FixedAgentFeaturesDiscovery(Set peerTags, Set spanKinds) { + // create a fixed discovery with metrics enabled + super(null, Monitoring.DISABLED, null, V0_4, true, false); + this.peerTags = peerTags; + this.spanKinds = spanKinds; + } + + @Override + public void discover() { + // do nothing + } + + @Override + public boolean supportsMetrics() { + return true; + } + + @Override + public Set peerTags() { + return peerTags; + } + } + + @Benchmark + public void benchmark(Blackhole blackhole) { + blackhole.consume(aggregator.publish(spans)); + } +} diff --git a/dd-trace-core/src/jmh/java/datadog/trace/common/metrics/ClientStatsAggregatorDDSpanBenchmark.java b/dd-trace-core/src/jmh/java/datadog/trace/common/metrics/ClientStatsAggregatorDDSpanBenchmark.java new file mode 100644 index 00000000000..0453b8888db --- /dev/null +++ b/dd-trace-core/src/jmh/java/datadog/trace/common/metrics/ClientStatsAggregatorDDSpanBenchmark.java @@ -0,0 +1,109 @@ +package datadog.trace.common.metrics; + +import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND; +import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_CLIENT; +import static java.util.concurrent.TimeUnit.MICROSECONDS; +import static java.util.concurrent.TimeUnit.SECONDS; + +import datadog.communication.ddagent.DDAgentFeaturesDiscovery; +import datadog.trace.api.WellKnownTags; +import datadog.trace.common.writer.Writer; +import datadog.trace.core.CoreSpan; +import datadog.trace.core.CoreTracer; +import datadog.trace.core.DDSpan; +import datadog.trace.core.monitor.HealthMetrics; +import datadog.trace.util.Strings; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; + +/** + * Parallels {@link ClientStatsAggregatorBenchmark} but uses real {@link DDSpan} instances instead + * of the lightweight {@code SimpleSpan} mock, so the JIT exercises the production {@link + * CoreSpan#isKind} path (cached span.kind ordinal + bit-test) rather than the groovy mock's + * dispatch. + * + *

      SpanKindFilter rollout result vs. the pre-bitmask code on master: ~1.3% faster on the + * production path, with tighter fork-to-fork variance. The CIs overlap so the headline number sits + * inside noise, but the centers move the right way and the new path is structurally cheaper (byte + * read + bit-test vs tag-map read + HashSet.contains). + * MacBook M1 (Java 21), 2 forks x 5 iterations x 15s, AverageTime + * + * Branch Score (avg) CI (99.9%) + * master 6.428 ± 0.189 µs/op [6.239, 6.617] + * this branch 6.343 ± 0.115 µs/op [6.228, 6.458] + * + */ +@State(Scope.Benchmark) +@Warmup(iterations = 1, time = 30, timeUnit = SECONDS) +@Measurement(iterations = 3, time = 30, timeUnit = SECONDS) +@BenchmarkMode(Mode.AverageTime) +@OutputTimeUnit(MICROSECONDS) +@Fork(value = 1) +public class ClientStatsAggregatorDDSpanBenchmark { + + private static final CoreTracer TRACER = + CoreTracer.builder().writer(new NoopWriter()).strictTraceWrites(false).build(); + + private final DDAgentFeaturesDiscovery featuresDiscovery = + new ClientStatsAggregatorBenchmark.FixedAgentFeaturesDiscovery( + Collections.singleton("peer.hostname"), Collections.emptySet()); + private final ClientStatsAggregator aggregator = + new ClientStatsAggregator( + new WellKnownTags("", "", "", "", "", ""), + Collections.emptySet(), + featuresDiscovery, + HealthMetrics.NO_OP, + new ClientStatsAggregatorBenchmark.NullSink(), + 2048, + 2048, + false); + private final List> spans = generateTrace(64); + + static List> generateTrace(int len) { + final List> trace = new ArrayList<>(); + for (int i = 0; i < len; i++) { + DDSpan span = (DDSpan) TRACER.startSpan("benchmark", "op"); + span.setTag(SPAN_KIND, SPAN_KIND_CLIENT); + span.setTag("peer.hostname", Strings.random(10)); + // Fix duration; bypasses the wall clock and avoids per-fork drift. + span.finishWithDuration(10); + trace.add(span); + } + return trace; + } + + static class NoopWriter implements Writer { + @Override + public void write(List trace) {} + + @Override + public void start() {} + + @Override + public boolean flush() { + return true; + } + + @Override + public void close() {} + + @Override + public void incrementDropCounts(int spanCount) {} + } + + @Benchmark + public void benchmark(Blackhole blackhole) { + blackhole.consume(aggregator.publish(spans)); + } +} diff --git a/dd-trace-core/src/jmh/java/datadog/trace/common/metrics/ConflatingMetricsAggregatorBenchmark.java b/dd-trace-core/src/jmh/java/datadog/trace/common/metrics/ConflatingMetricsAggregatorBenchmark.java deleted file mode 100644 index 971ee5cf6e4..00000000000 --- a/dd-trace-core/src/jmh/java/datadog/trace/common/metrics/ConflatingMetricsAggregatorBenchmark.java +++ /dev/null @@ -1,101 +0,0 @@ -package datadog.trace.common.metrics; - -import static datadog.trace.api.ProtocolVersion.V0_4; -import static java.util.concurrent.TimeUnit.MICROSECONDS; -import static java.util.concurrent.TimeUnit.SECONDS; - -import datadog.communication.ddagent.DDAgentFeaturesDiscovery; -import datadog.metrics.api.Monitoring; -import datadog.trace.api.WellKnownTags; -import datadog.trace.core.CoreSpan; -import datadog.trace.core.monitor.HealthMetrics; -import datadog.trace.util.Strings; -import java.nio.ByteBuffer; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Set; -import org.openjdk.jmh.annotations.Benchmark; -import org.openjdk.jmh.annotations.BenchmarkMode; -import org.openjdk.jmh.annotations.Fork; -import org.openjdk.jmh.annotations.Measurement; -import org.openjdk.jmh.annotations.Mode; -import org.openjdk.jmh.annotations.OutputTimeUnit; -import org.openjdk.jmh.annotations.Scope; -import org.openjdk.jmh.annotations.State; -import org.openjdk.jmh.annotations.Warmup; -import org.openjdk.jmh.infra.Blackhole; - -@State(Scope.Benchmark) -@Warmup(iterations = 1, time = 30, timeUnit = SECONDS) -@Measurement(iterations = 3, time = 30, timeUnit = SECONDS) -@BenchmarkMode(Mode.AverageTime) -@OutputTimeUnit(MICROSECONDS) -@Fork(value = 1) -public class ConflatingMetricsAggregatorBenchmark { - private final DDAgentFeaturesDiscovery featuresDiscovery = - new FixedAgentFeaturesDiscovery( - Collections.singleton("peer.hostname"), Collections.emptySet()); - private final ConflatingMetricsAggregator aggregator = - new ConflatingMetricsAggregator( - new WellKnownTags("", "", "", "", "", ""), - Collections.emptySet(), - featuresDiscovery, - HealthMetrics.NO_OP, - new NullSink(), - 2048, - 2048, - false); - private final List> spans = generateTrace(64); - - static List> generateTrace(int len) { - final List> trace = new ArrayList<>(); - for (int i = 0; i < len; i++) { - SimpleSpan span = new SimpleSpan("", "", "", "", true, true, false, 0, 10, -1); - span.setTag("peer.hostname", Strings.random(10)); - trace.add(span); - } - return trace; - } - - static class NullSink implements Sink { - - @Override - public void register(EventListener listener) {} - - @Override - public void accept(int messageCount, ByteBuffer buffer) {} - } - - static class FixedAgentFeaturesDiscovery extends DDAgentFeaturesDiscovery { - private final Set peerTags; - private final Set spanKinds; - - public FixedAgentFeaturesDiscovery(Set peerTags, Set spanKinds) { - // create a fixed discovery with metrics enabled - super(null, Monitoring.DISABLED, null, V0_4, true, false); - this.peerTags = peerTags; - this.spanKinds = spanKinds; - } - - @Override - public void discover() { - // do nothing - } - - @Override - public boolean supportsMetrics() { - return true; - } - - @Override - public Set peerTags() { - return peerTags; - } - } - - @Benchmark - public void benchmark(Blackhole blackhole) { - blackhole.consume(aggregator.publish(spans)); - } -} diff --git a/dd-trace-core/src/jmh/java/datadog/trace/common/metrics/HighCardinalityPeerMetricsBenchmark.java b/dd-trace-core/src/jmh/java/datadog/trace/common/metrics/HighCardinalityPeerMetricsBenchmark.java new file mode 100644 index 00000000000..8fc45b4acd8 --- /dev/null +++ b/dd-trace-core/src/jmh/java/datadog/trace/common/metrics/HighCardinalityPeerMetricsBenchmark.java @@ -0,0 +1,107 @@ +package datadog.trace.common.metrics; + +import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND; +import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_CLIENT; +import static java.util.concurrent.TimeUnit.SECONDS; + +import datadog.trace.api.WellKnownTags; +import datadog.trace.common.metrics.AdversarialMetricsBenchmark.CountingHealthMetrics; +import datadog.trace.core.CoreSpan; +import de.thetaphi.forbiddenapis.SuppressForbidden; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.ThreadLocalRandom; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.TearDown; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; + +/** + * Cardinality-isolation companion to {@link AdversarialMetricsBenchmark}: only the {@code + * peer.hostname} tag value varies; {@code service}, {@code operation}, and {@code resource} are + * pinned to single values. Pairing this with the adversarial bench (all four dimensions + * high-cardinality) and {@link HighCardinalityResourceMetricsBenchmark} (only resource + * high-cardinality) lets you attribute any throughput delta to a specific axis. + * + *

      This isolates the peer-tag-encoding hot path: {@code PEER_TAGS_CACHE} lookups, the per-tag + * UTF8 encoding of {@code "name:value"}, and the parallel-array capture inside the producer's + * {@code SpanSnapshot} build. With {@code 0x7FFF} (~32K) distinct hostnames the cache thrashes + * heavily and exceeds the default {@code tracerMetricsMaxAggregates=2048} so the LRU evicts + * continuously. + * + *

      Random {@code error}/{@code topLevel}/duration to keep histogram load comparable; only the + * cardinality profile changes. + */ +@State(Scope.Benchmark) +@Warmup(iterations = 2, time = 15, timeUnit = SECONDS) +@Measurement(iterations = 5, time = 15, timeUnit = SECONDS) +@BenchmarkMode(Mode.Throughput) +@OutputTimeUnit(SECONDS) +@Threads(8) +@Fork(value = 1) +public class HighCardinalityPeerMetricsBenchmark { + + private ClientStatsAggregator aggregator; + private CountingHealthMetrics health; + + @State(Scope.Thread) + public static class ThreadState { + int cursor; + } + + @Setup + public void setup() { + this.health = new CountingHealthMetrics(); + this.aggregator = + new ClientStatsAggregator( + new WellKnownTags("", "", "", "", "", ""), + Collections.emptySet(), + new ClientStatsAggregatorBenchmark.FixedAgentFeaturesDiscovery( + Collections.singleton("peer.hostname"), Collections.emptySet()), + this.health, + new ClientStatsAggregatorBenchmark.NullSink(), + 2048, + 2048, + false); + this.aggregator.start(); + } + + @TearDown + @SuppressForbidden + public void tearDown() { + aggregator.close(); + System.err.println( + "[HIGH_CARD_PEER] drops over the trial (8 threads, warmup + measurement combined):"); + System.err.println(" onStatsInboxFull = " + health.inboxFull.sum()); + System.err.println(" onStatsAggregateDropped = " + health.aggregateDropped.sum()); + } + + @Benchmark + public void publish(ThreadState ts, Blackhole blackhole) { + int idx = ts.cursor++; + ThreadLocalRandom rng = ThreadLocalRandom.current(); + + int scrambled = idx * 0x9E3779B1; + String hostname = "host-" + ((scrambled >>> 12) & 0x7FFF); + boolean error = (idx & 7) == 0; + boolean topLevel = (idx & 3) == 0; + long durationNanos = 1L + (rng.nextLong() & 0x3FFFFFFFL); + + SimpleSpan span = + new SimpleSpan("svc", "op", "res", "web", true, topLevel, error, 0, durationNanos, 200); + span.setTag(SPAN_KIND, SPAN_KIND_CLIENT); + span.setTag("peer.hostname", hostname); + + List> trace = Collections.singletonList(span); + blackhole.consume(aggregator.publish(trace)); + } +} diff --git a/dd-trace-core/src/jmh/java/datadog/trace/common/metrics/HighCardinalityResourceMetricsBenchmark.java b/dd-trace-core/src/jmh/java/datadog/trace/common/metrics/HighCardinalityResourceMetricsBenchmark.java new file mode 100644 index 00000000000..90c1f088935 --- /dev/null +++ b/dd-trace-core/src/jmh/java/datadog/trace/common/metrics/HighCardinalityResourceMetricsBenchmark.java @@ -0,0 +1,103 @@ +package datadog.trace.common.metrics; + +import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND; +import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_CLIENT; +import static java.util.concurrent.TimeUnit.SECONDS; + +import datadog.trace.api.WellKnownTags; +import datadog.trace.common.metrics.AdversarialMetricsBenchmark.CountingHealthMetrics; +import datadog.trace.core.CoreSpan; +import de.thetaphi.forbiddenapis.SuppressForbidden; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.ThreadLocalRandom; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.TearDown; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; + +/** + * Cardinality-isolation companion to {@link AdversarialMetricsBenchmark}: only the {@code resource} + * dimension varies; {@code service}, {@code operation}, and {@code peer.hostname} are pinned to + * single values. Pairing this with the adversarial bench (all four dimensions high-cardinality) and + * {@link HighCardinalityPeerMetricsBenchmark} (only peer-tag high-cardinality) lets you attribute + * any throughput delta to a specific axis. + * + *

      Same shape as the adversarial bench -- 8 producer threads, {@code 0xFFFFF} (~1M) distinct + * resource values which exceeds the default {@code tracerMetricsMaxAggregates=2048}, so the LRU + * cache evicts continuously. Random {@code error}/{@code topLevel}/duration to keep histogram load + * comparable; only the cardinality profile changes. + */ +@State(Scope.Benchmark) +@Warmup(iterations = 2, time = 15, timeUnit = SECONDS) +@Measurement(iterations = 5, time = 15, timeUnit = SECONDS) +@BenchmarkMode(Mode.Throughput) +@OutputTimeUnit(SECONDS) +@Threads(8) +@Fork(value = 1) +public class HighCardinalityResourceMetricsBenchmark { + + private ClientStatsAggregator aggregator; + private CountingHealthMetrics health; + + @State(Scope.Thread) + public static class ThreadState { + int cursor; + } + + @Setup + public void setup() { + this.health = new CountingHealthMetrics(); + this.aggregator = + new ClientStatsAggregator( + new WellKnownTags("", "", "", "", "", ""), + Collections.emptySet(), + new ClientStatsAggregatorBenchmark.FixedAgentFeaturesDiscovery( + Collections.singleton("peer.hostname"), Collections.emptySet()), + this.health, + new ClientStatsAggregatorBenchmark.NullSink(), + 2048, + 2048, + false); + this.aggregator.start(); + } + + @TearDown + @SuppressForbidden + public void tearDown() { + aggregator.close(); + System.err.println( + "[HIGH_CARD_RESOURCE] drops over the trial (8 threads, warmup + measurement combined):"); + System.err.println(" onStatsInboxFull = " + health.inboxFull.sum()); + System.err.println(" onStatsAggregateDropped = " + health.aggregateDropped.sum()); + } + + @Benchmark + public void publish(ThreadState ts, Blackhole blackhole) { + int idx = ts.cursor++; + ThreadLocalRandom rng = ThreadLocalRandom.current(); + + int scrambled = idx * 0x9E3779B1; + String resource = "res-" + ((scrambled ^ 0x5A5A5A) & 0xFFFFF); + boolean error = (idx & 7) == 0; + boolean topLevel = (idx & 3) == 0; + long durationNanos = 1L + (rng.nextLong() & 0x3FFFFFFFL); + + SimpleSpan span = + new SimpleSpan("svc", "op", resource, "web", true, topLevel, error, 0, durationNanos, 200); + span.setTag(SPAN_KIND, SPAN_KIND_CLIENT); + span.setTag("peer.hostname", "localhost"); + + List> trace = Collections.singletonList(span); + blackhole.consume(aggregator.publish(trace)); + } +} diff --git a/dd-trace-core/src/jmh/java/datadog/trace/common/writer/ddagent/Utf8Benchmark.java b/dd-trace-core/src/jmh/java/datadog/trace/common/writer/ddagent/Utf8Benchmark.java index 71f309388ab..69631eba694 100644 --- a/dd-trace-core/src/jmh/java/datadog/trace/common/writer/ddagent/Utf8Benchmark.java +++ b/dd-trace-core/src/jmh/java/datadog/trace/common/writer/ddagent/Utf8Benchmark.java @@ -1,75 +1,31 @@ package datadog.trace.common.writer.ddagent; +import static datadog.trace.common.writer.ddagent.Utf8Workload.NUM_LOOKUPS; +import static datadog.trace.common.writer.ddagent.Utf8Workload.nextTag; +import static datadog.trace.common.writer.ddagent.Utf8Workload.nextValue; + import datadog.communication.serialization.GenerationalUtf8Cache; import datadog.communication.serialization.SimpleUtf8Cache; import java.nio.charset.StandardCharsets; -import java.util.concurrent.ThreadLocalRandom; import org.openjdk.jmh.annotations.Benchmark; import org.openjdk.jmh.annotations.BenchmarkMode; import org.openjdk.jmh.annotations.Mode; import org.openjdk.jmh.infra.Blackhole; /** - * This benchmark isn't really intended to used to measure throughput, but rather to be used with - * "-prof gc" to check bytes / op. + * Single-threaded UTF8 cache benchmark. This reflects how the caches are actually driven today: + * trace serialization runs on a single thread, so one thread performs the lookups and drives {@link + * GenerationalUtf8Cache#recalibrate()} inline at a natural transaction boundary (here, once per + * op). This is the representative allocation/throughput number. See {@link Utf8ConcurrentBenchmark} + * for the multi-threaded contract/guardrail variant. * - *

      Since {@link String#getBytes(java.nio.charset.Charset)} is intrinsified the caches typically - * perform worse throughput wise, the benefit of the caches is to reduce allocation. Intention of - * this benchmark is to create data that roughly resembles what might be seen in a trace payload. - * Tag names are quite static, tag values are mostly low cardinality, but some tag values have - * infinite cardinality. + *

      This benchmark isn't really intended to measure throughput, but rather to be used with "-prof + * gc" to check bytes / op. Since {@link String#getBytes(java.nio.charset.Charset)} is intrinsified + * the caches typically perform worse throughput wise; the benefit of the caches is to reduce + * allocation. */ @BenchmarkMode(Mode.Throughput) public class Utf8Benchmark { - static final int NUM_LOOKUPS = 10_000; - - static final String[] TAGS = { - "_dd.asm.keep", - "ci.provider", - "language", - "db.statement", - "ci.job.url", - "ci.pipeline.url", - "db.pool", - "http.forwarder", - "db.warehouse", - "custom" - }; - - static int pos = 0; - static int standardVal = 0; - - static final String nextTag() { - if (pos == TAGS.length - 1) { - pos = 0; - } else { - pos += 1; - } - return TAGS[pos]; - } - - static final String nextValue(String tag) { - if (tag.equals("custom")) { - return nextCustomValue(tag); - } else { - return nextStandardValue(tag); - } - } - - /* - * Produces a high cardinality value - > thousands of distinct values per tag - many 1-time values - */ - static final String nextCustomValue(String tag) { - return tag + ThreadLocalRandom.current().nextInt(); - } - - /* - * Produces a moderate cardinality value - tens of distinct values per tag - */ - static final String nextStandardValue(String tag) { - return tag + ThreadLocalRandom.current().nextInt(20); - } - @Benchmark public static final String tagUtf8_baseline() { return nextTag(); @@ -109,7 +65,7 @@ public static final void valueUtf8_baseline(Blackhole bh) { @Benchmark public static final void valueUtf8_cache_generational(Blackhole bh) { GenerationalUtf8Cache valueCache = VALUE_CACHE; - valueCache.recalibrate(); + valueCache.recalibrate(); // single thread drives recalibrate inline, at a transaction boundary for (int i = 0; i < NUM_LOOKUPS; ++i) { String tag = nextTag(); @@ -125,7 +81,7 @@ public static final void valueUtf8_cache_generational(Blackhole bh) { @Benchmark public static final void valueUtf8_cache_simple(Blackhole bh) { SimpleUtf8Cache valueCache = SIMPLE_VALUE_CACHE; - valueCache.recalibrate(); + valueCache.recalibrate(); // single thread drives recalibrate inline, at a transaction boundary for (int i = 0; i < NUM_LOOKUPS; ++i) { String tag = nextTag(); diff --git a/dd-trace-core/src/jmh/java/datadog/trace/common/writer/ddagent/Utf8ConcurrentBenchmark.java b/dd-trace-core/src/jmh/java/datadog/trace/common/writer/ddagent/Utf8ConcurrentBenchmark.java new file mode 100644 index 00000000000..51080906bec --- /dev/null +++ b/dd-trace-core/src/jmh/java/datadog/trace/common/writer/ddagent/Utf8ConcurrentBenchmark.java @@ -0,0 +1,72 @@ +package datadog.trace.common.writer.ddagent; + +import static datadog.trace.common.writer.ddagent.Utf8Workload.NUM_LOOKUPS; +import static datadog.trace.common.writer.ddagent.Utf8Workload.nextTag; +import static datadog.trace.common.writer.ddagent.Utf8Workload.nextValue; + +import datadog.communication.serialization.GenerationalUtf8Cache; +import datadog.communication.serialization.SimpleUtf8Cache; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Group; +import org.openjdk.jmh.annotations.GroupThreads; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.infra.Blackhole; + +/** + * Multi-threaded companion to {@link Utf8Benchmark}, exercising the caches' intended thread-safety + * contract against the shared caches. + * + *

      The point of this variant is to illustrate how {@code recalibrate()} is driven under + * concurrency. Unlike the single-threaded case — where the lone serializer thread recalibrates + * inline — you would not have every worker recalibrate (that needlessly churns the shared + * cache and widens the lookup-then-read race window). Instead a single dedicated thread drives + * {@code recalibrate()} while the remaining threads perform lookups. JMH's {@code @Group} / + * {@code @GroupThreads} expresses exactly that: 7 lookup threads + 1 recalibrate thread on the same + * cache. + * + *

      The recalibrate thread runs continuously, which is deliberately more aggressive than a real + * periodic cadence — it maximizes contention so this doubles as a concurrency guardrail. + */ +@BenchmarkMode(Mode.Throughput) +@State(Scope.Group) +public class Utf8ConcurrentBenchmark { + static final GenerationalUtf8Cache VALUE_CACHE = new GenerationalUtf8Cache(64, 128); + static final SimpleUtf8Cache SIMPLE_VALUE_CACHE = new SimpleUtf8Cache(128); + + @Benchmark + @Group("generational") + @GroupThreads(7) + public void generational_lookup(Blackhole bh) { + for (int i = 0; i < NUM_LOOKUPS; ++i) { + String tag = nextTag(); + bh.consume(VALUE_CACHE.getUtf8(nextValue(tag))); + } + } + + @Benchmark + @Group("generational") + @GroupThreads(1) + public void generational_recalibrate() { + VALUE_CACHE.recalibrate(); + } + + @Benchmark + @Group("simple") + @GroupThreads(7) + public void simple_lookup(Blackhole bh) { + for (int i = 0; i < NUM_LOOKUPS; ++i) { + String tag = nextTag(); + bh.consume(SIMPLE_VALUE_CACHE.getUtf8(nextValue(tag))); + } + } + + @Benchmark + @Group("simple") + @GroupThreads(1) + public void simple_recalibrate() { + SIMPLE_VALUE_CACHE.recalibrate(); + } +} diff --git a/dd-trace-core/src/jmh/java/datadog/trace/common/writer/ddagent/Utf8Workload.java b/dd-trace-core/src/jmh/java/datadog/trace/common/writer/ddagent/Utf8Workload.java new file mode 100644 index 00000000000..80d652c4942 --- /dev/null +++ b/dd-trace-core/src/jmh/java/datadog/trace/common/writer/ddagent/Utf8Workload.java @@ -0,0 +1,54 @@ +package datadog.trace.common.writer.ddagent; + +import java.util.concurrent.ThreadLocalRandom; + +/** + * Shared workload for the UTF8 cache benchmarks, so the single-threaded ({@link Utf8Benchmark}) and + * multi-threaded ({@link Utf8ConcurrentBenchmark}) variants measure identical inputs and can't + * drift apart. + * + *

      Roughly resembles a trace payload: tag names are quite static, tag values are mostly low + * cardinality, but some ("custom") have effectively infinite cardinality. + */ +final class Utf8Workload { + private Utf8Workload() {} + + static final int NUM_LOOKUPS = 10_000; + + static final String[] TAGS = { + "_dd.asm.keep", + "ci.provider", + "language", + "db.statement", + "ci.job.url", + "ci.pipeline.url", + "db.pool", + "http.forwarder", + "db.warehouse", + "custom" + }; + + // Randomized rather than a shared counter so the concurrent variant stays thread-safe (a shared + // ++ index races and can walk off the end of TAGS under multiple threads). + static String nextTag() { + return TAGS[ThreadLocalRandom.current().nextInt(TAGS.length)]; + } + + static String nextValue(String tag) { + if (tag.equals("custom")) { + return nextCustomValue(tag); + } else { + return nextStandardValue(tag); + } + } + + /** High cardinality - thousands of distinct values per tag, many one-time values. */ + static String nextCustomValue(String tag) { + return tag + ThreadLocalRandom.current().nextInt(); + } + + /** Moderate cardinality - tens of distinct values per tag. */ + static String nextStandardValue(String tag) { + return tag + ThreadLocalRandom.current().nextInt(20); + } +} diff --git a/dd-trace-core/src/jmh/java/datadog/trace/core/DropWriter.java b/dd-trace-core/src/jmh/java/datadog/trace/core/DropWriter.java new file mode 100644 index 00000000000..6e375ee828b --- /dev/null +++ b/dd-trace-core/src/jmh/java/datadog/trace/core/DropWriter.java @@ -0,0 +1,42 @@ +package datadog.trace.core; + +import datadog.trace.common.writer.Writer; +import java.util.List; +import org.openjdk.jmh.infra.Blackhole; + +/** + * Near-no-op {@link Writer}: drops finished traces (no serialization, no agent I/O, no {@link + * TraceCounters} bookkeeping) so span-creation benchmarks measure only the application-thread + * (front-half) allocation — create, tag, finish, PendingTrace completion. {@link #write} still + * hands the trace to a {@link Blackhole} rather than truly doing nothing with it, so the JIT can't + * treat the finish()-triggered write as dead code and eliminate work the real path performs. + * + *

      Drift-stable: implements only the five-method {@link Writer} interface, unchanged + * v1.53→master. + */ +final class DropWriter implements Writer { + private final Blackhole blackhole; + + DropWriter(Blackhole blackhole) { + this.blackhole = blackhole; + } + + @Override + public void write(List trace) { + blackhole.consume(trace); + } + + @Override + public void start() {} + + @Override + public boolean flush() { + return true; + } + + @Override + public void close() {} + + @Override + public void incrementDropCounts(int spanCount) {} +} diff --git a/dd-trace-core/src/jmh/java/datadog/trace/core/SpanCreationBenchmark.java b/dd-trace-core/src/jmh/java/datadog/trace/core/SpanCreationBenchmark.java new file mode 100644 index 00000000000..d288463faad --- /dev/null +++ b/dd-trace-core/src/jmh/java/datadog/trace/core/SpanCreationBenchmark.java @@ -0,0 +1,214 @@ +package datadog.trace.core; + +import static java.util.concurrent.TimeUnit.MICROSECONDS; + +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.api.Tags; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.TearDown; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; + +/** + * Grounding benchmark for the full span-creation lifecycle: create -> (set tags) -> finish. + * + *

      This is the "micro-ish" reference the TagMap 2.0 / SpanPrototype work is measured against. It + * pairs a tag-free baseline with two known-tag shapes — a web-server span (7 tags) and a JDBC/DB + * client span (9 tags) — so the dense-store and SpanPrototype allocation wins are actually + * exercised (a tag-free or custom-tag benchmark would be dense-neutral and show nothing), and so + * the marginal per-tag cost is visible across two realistic tag counts. It also covers the builder + * tag path ({@code withTag} before {@code start()}, the OTel-bridge shape) alongside the + * set-after-start path, so the startSpan/buildSpan lineages can be tracked as they diverge across + * releases. + * + *

      Read the allocation columns, not just throughput. Run with {@code -prof gc}: {@code + * gc.alloc.rate.norm} (B/op) is deterministic run-to-run and is the primary signal; throughput is + * thermal/contention-fragile on a laptop and should be treated as directional. Multi-fork + * ({@code @Fork(3)}) guards against per-fork inlining bimodality. + * + *

      Deliberately drift-stable so it can be copied onto past release tags and back-checked. + * It touches only API that is byte-identical from v1.53.0 to master: {@link + * CoreTracer#buildSpan(String, CharSequence)} / {@link CoreTracer#startSpan(String, CharSequence)}, + * {@code AgentSpan.setTag(String, ...)} / {@code finish()}, the {@link Tags} constants, and the + * five-method {@code Writer} interface (implemented as a no-op {@link DropWriter}). If you add to + * it, keep it inside that stable surface or grafting it onto old tags for the historical curve will + * stop compiling. (Source rebuilds only reach ~v1.53 — older tags hit dead build-time dependencies; + * deeper history is a published-jar job.) + * + *

      Spans are finished against {@link DropWriter} so the create/tag/finish allocation is isolated + * from serialization and agent I/O — those live on a different lever and would otherwise leak into + * the {@code -prof gc} number via the writer's background threads. + * + *

      Multi-threaded on purpose ({@code @Threads(8)}); some tracer optimizations only show under + * contention. Use {@code -t 1} for a single-threaded run. + * + *

      Historical allocation (B/op, {@code gc.alloc.rate.norm}), this benchmark grafted onto + * each release tag and run {@code @Threads(8) -f3 -wi5 -i5 -prof gc} (measured 2026-07). The ~1.59 + * drop is the TagMap 1.0 shared-Entry default flip; the ~1.61 drop is the interceptor/links + * cluster. Net 1.53 → 1.64 is -20% to -31% per arm. + * + *

      + * ver    bareStart bareBuild webServer viaBuilder jdbcClient
      + * 1.53      1330.7    1331.1    2058.7     2434.7     1821.3
      + * 1.54      1423.8    1423.8    2131.4     2491.1     2037.8
      + * 1.55      1308.8    1422.0    2098.1     2477.2     2029.4
      + * 1.56      1322.2    1393.0    2131.5     2464.2     2016.6
      + * 1.57      1321.6    1363.3    2063.3     2410.6     2073.8
      + * 1.58      1312.6    1310.5    2018.0     2442.1     2065.3
      + * 1.59      1174.9    1166.1    1869.0     1987.2     1866.0
      + * 1.60      1180.6    1192.1    1858.9     1963.3     1818.0
      + * 1.61       959.2     951.7    1639.2     1774.1     1619.4
      + * 1.62       948.0     948.7    1674.9     1787.1     1614.1
      + * 1.63       927.0     926.7    1626.8     1737.7     1429.8
      + * 1.64       923.3     958.4    1636.6     1751.1     1421.5
      + * Δ%         -30.6     -28.0     -20.5      -28.1      -22.0
      + * 
      + * + *

      Throughput (ops/us) from the same runs — noisier, treat as directional only (laptop + * thermals + per-fork inlining bimodality; no Δ% given because there is no reliable trend): + * + *

      + * ver    bareStart bareBuild webServer viaBuilder jdbcClient
      + * 1.53        5.69      5.49      4.00       3.99       5.33
      + * 1.54        4.26      4.25      3.47       3.55       3.15
      + * 1.55        3.87      4.13      3.37       3.52       3.14
      + * 1.56        3.92      4.03      3.79       3.33       3.15
      + * 1.57        4.21      4.11      3.31       3.49       3.37
      + * 1.58        4.16      4.19      3.34       3.52       3.27
      + * 1.59        4.20      4.66      3.43       3.52       3.45
      + * 1.60        5.48      5.66      3.42       3.54       3.77
      + * 1.61        4.17      4.31      3.46       3.58       3.46
      + * 1.62        5.53      5.72      4.20       4.37       4.49
      + * 1.63        6.03      5.97      4.66       5.13       4.49
      + * 1.64        5.37      5.26      4.62       5.29       5.06
      + * 
      + */ +@State(Scope.Benchmark) +@Warmup(iterations = 5) +@Measurement(iterations = 5) +@BenchmarkMode(Mode.Throughput) +@Threads(8) +@OutputTimeUnit(MICROSECONDS) +@Fork(value = 3, jvmArgsAppend = "-DTEST_LOG_LEVEL=warn") +public class SpanCreationBenchmark { + private static final String INSTRUMENTATION_NAME = "bench"; + private static final String SERVER_OPERATION_NAME = "servlet.request"; + // The DB-shaped span gets its own operation name -- a real jdbc span is never "servlet.request", + // and keeping the two shapes distinct by operation avoids conflating them. + private static final String JDBC_OPERATION_NAME = "database.query"; + + // int tag values are deliberately kept inside Integer's built-in cache (-128..127) so valueOf + // returns a shared box and boxing does not allocate — the bench then measures tag storage / path + // cost, not incidental boxing (which differs between setTag(int) and the builder's + // withTag(Number)). + + // Web-server-shaped known tags — the profile the dense store / SpanPrototype target. + private static final String COMPONENT_VALUE = "tomcat-server"; + private static final String HTTP_METHOD_VALUE = "GET"; + private static final String HTTP_ROUTE_VALUE = "/owners/{ownerId}"; + private static final String HTTP_URL_VALUE = "http://localhost:8080/owners/42"; + private static final int HTTP_STATUS_VALUE = 100; // in-cache; value itself is immaterial here + private static final int PEER_PORT_VALUE = 80; + + // JDBC/DB-client-shaped known tags — a higher-tag-count shape (9 vs the web shape's 7), matching + // what DatabaseClientDecorator + JDBCDecorator set on a statement span. + private static final String DB_COMPONENT_VALUE = "java-jdbc-statement"; + private static final String DB_TYPE_VALUE = "postgresql"; + private static final String DB_INSTANCE_VALUE = "petclinic"; + private static final String DB_USER_VALUE = "app"; + private static final String DB_OPERATION_VALUE = "SELECT"; + private static final String DB_STATEMENT_VALUE = "SELECT * FROM owners WHERE id = ?"; + private static final String DB_PEER_HOSTNAME_VALUE = "db.internal"; + private static final int DB_PEER_PORT_VALUE = 90; // in-cache; value itself is immaterial here + + CoreTracer tracer; + + @Setup + public void setup(Blackhole blackhole) { + // DropWriter keeps finish() from pulling in serialization / agent I/O, so -prof gc reflects + // span creation + tagging + PendingTrace completion only. + this.tracer = CoreTracer.builder().writer(new DropWriter(blackhole)).build(); + } + + @TearDown + public void tearDown() { + this.tracer.close(); + } + + /** Baseline: create + finish a bare span via startSpan, no tags. */ + @Benchmark + public void bareStartSpan() { + AgentSpan span = tracer.startSpan(INSTRUMENTATION_NAME, SERVER_OPERATION_NAME); + span.finish(); + } + + /** Baseline: create + finish a bare span via the builder path, no tags. */ + @Benchmark + public void bareBuildSpan() { + AgentSpan span = tracer.buildSpan(INSTRUMENTATION_NAME, SERVER_OPERATION_NAME).start(); + span.finish(); + } + + /** Web-server-shaped span: create -> set the typical known tags -> finish. */ + @Benchmark + public void webServerSpan() { + AgentSpan span = tracer.buildSpan(INSTRUMENTATION_NAME, SERVER_OPERATION_NAME).start(); + span.setTag(Tags.COMPONENT, COMPONENT_VALUE); + span.setTag(Tags.SPAN_KIND, Tags.SPAN_KIND_SERVER); + span.setTag(Tags.HTTP_METHOD, HTTP_METHOD_VALUE); + span.setTag(Tags.HTTP_ROUTE, HTTP_ROUTE_VALUE); + span.setTag(Tags.HTTP_URL, HTTP_URL_VALUE); + span.setTag(Tags.HTTP_STATUS, HTTP_STATUS_VALUE); + span.setTag(Tags.PEER_PORT, PEER_PORT_VALUE); + span.finish(); + } + + /** + * Web-server-shaped span via the builder tag path: tags accumulated on the builder with + * {@code withTag} and applied at {@code start()}, rather than set on the span afterward. This is + * the shape the OTel bridge takes (OTel {@code SpanBuilder.setAttribute} → dd builder), still + * live today for manual OTel and OTel-bridge auto-instrumentation. Compare against {@link + * #webServerSpan} (same tags, set after start) to track how the startSpan/buildSpan paths diverge + * across releases. + */ + @Benchmark + public void webServerSpanViaBuilder() { + AgentSpan span = + tracer + .buildSpan(INSTRUMENTATION_NAME, SERVER_OPERATION_NAME) + .withTag(Tags.COMPONENT, COMPONENT_VALUE) + .withTag(Tags.SPAN_KIND, Tags.SPAN_KIND_SERVER) + .withTag(Tags.HTTP_METHOD, HTTP_METHOD_VALUE) + .withTag(Tags.HTTP_ROUTE, HTTP_ROUTE_VALUE) + .withTag(Tags.HTTP_URL, HTTP_URL_VALUE) + .withTag(Tags.HTTP_STATUS, HTTP_STATUS_VALUE) + .withTag(Tags.PEER_PORT, PEER_PORT_VALUE) + .start(); + span.finish(); + } + + /** JDBC/DB-client-shaped span: create -> set the typical DB known tags (9) -> finish. */ + @Benchmark + public void jdbcClientSpan() { + AgentSpan span = tracer.buildSpan(INSTRUMENTATION_NAME, JDBC_OPERATION_NAME).start(); + span.setTag(Tags.COMPONENT, DB_COMPONENT_VALUE); + span.setTag(Tags.SPAN_KIND, Tags.SPAN_KIND_CLIENT); + span.setTag(Tags.DB_TYPE, DB_TYPE_VALUE); + span.setTag(Tags.DB_INSTANCE, DB_INSTANCE_VALUE); + span.setTag(Tags.DB_USER, DB_USER_VALUE); + span.setTag(Tags.DB_OPERATION, DB_OPERATION_VALUE); + span.setTag(Tags.DB_STATEMENT, DB_STATEMENT_VALUE); + span.setTag(Tags.PEER_HOSTNAME, DB_PEER_HOSTNAME_VALUE); + span.setTag(Tags.PEER_PORT, DB_PEER_PORT_VALUE); + span.finish(); + } +} diff --git a/dd-trace-core/src/jmh/java/datadog/trace/core/SpanCreationVirtualThreadBenchmark.java b/dd-trace-core/src/jmh/java/datadog/trace/core/SpanCreationVirtualThreadBenchmark.java new file mode 100644 index 00000000000..9c7c43fc9d1 --- /dev/null +++ b/dd-trace-core/src/jmh/java/datadog/trace/core/SpanCreationVirtualThreadBenchmark.java @@ -0,0 +1,85 @@ +package datadog.trace.core; + +import static java.util.concurrent.TimeUnit.MICROSECONDS; + +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import java.lang.invoke.MethodHandle; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.TearDown; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; + +/** + * Runs span creation on a virtual thread — the regime the platform-thread {@link + * SpanCreationBenchmark} is blind to. + * + *

      Why this exists: {@code startSpan}'s thread-local {@code SpanBuilder} reuse (1.55, #9537) is + * deliberately disabled on virtual threads (an {@code isVirtualThread} guard — thread-local + * caching on numerous short-lived virtual threads is an anti-pattern), so on a virtual thread 1.55 + * still allocates a builder per {@code startSpan}. The full builder bypass (1.57, #9998) removes + * that allocation for everyone, including virtual threads. On platform threads the reuse already + * ate the allocation, so 1.57 shows nothing there; on virtual threads it should show as a per-span + * allocation drop at 1.57. This bench is where that appears. + * + *

      Requires a JDK with virtual threads (21+) at run time. To keep the jmh source set + * compilable on older toolchains, the virtual thread is started via reflection ({@code + * Thread.startVirtualThread}); {@link #setup()} fails fast on a pre-21 JDK. The per-op vthread + * spawn + join cost is constant across tracer versions, so it cancels in the 1.55→1.57 delta (read + * the delta, not the absolute B/op). + */ +@State(Scope.Benchmark) +@Warmup(iterations = 5) +@Measurement(iterations = 5) +@BenchmarkMode(Mode.Throughput) +@Threads(4) +@OutputTimeUnit(MICROSECONDS) +@Fork(value = 3, jvmArgsAppend = "-DTEST_LOG_LEVEL=warn") +public class SpanCreationVirtualThreadBenchmark { + private static final String INSTRUMENTATION_NAME = "bench"; + private static final String OPERATION_NAME = "servlet.request"; + + CoreTracer tracer; + // Thread.startVirtualThread(Runnable) -> Thread, resolved reflectively (JDK 21+). + private MethodHandle startVirtualThread; + // Reused so no per-op capturing-lambda allocation muddies the measurement. + private Runnable spanTask; + + @Setup + public void setup(Blackhole blackhole) throws Throwable { + this.tracer = CoreTracer.builder().writer(new DropWriter(blackhole)).build(); + this.startVirtualThread = + MethodHandles.publicLookup() + .findStatic( + Thread.class, + "startVirtualThread", + MethodType.methodType(Thread.class, Runnable.class)); + this.spanTask = + () -> { + AgentSpan span = tracer.startSpan(INSTRUMENTATION_NAME, OPERATION_NAME); + span.finish(); + }; + } + + @TearDown + public void tearDown() { + this.tracer.close(); + } + + /** create + finish a bare span on a fresh virtual thread; join. */ + @Benchmark + public void bareStartSpanOnVirtualThread() throws Throwable { + Thread vthread = (Thread) startVirtualThread.invokeExact(spanTask); + vthread.join(); + } +} diff --git a/dd-trace-core/src/jmh/java/datadog/trace/core/TraceAssemblyBenchmark.java b/dd-trace-core/src/jmh/java/datadog/trace/core/TraceAssemblyBenchmark.java new file mode 100644 index 00000000000..c49f234dda5 --- /dev/null +++ b/dd-trace-core/src/jmh/java/datadog/trace/core/TraceAssemblyBenchmark.java @@ -0,0 +1,140 @@ +package datadog.trace.core; + +import static java.util.concurrent.TimeUnit.MICROSECONDS; + +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.api.Tags; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Param; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.TearDown; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; + +/** + * Front-half (application-thread) benchmark for multi-span trace assembly: a + * web-server-shaped parent plus N children, each finished, whole trace dropped. + * + *

      Where {@link SpanCreationBenchmark} measures a single span (front-A), this measures the cost + * that scales with trace size (front-B): every span created copies the tracer's baseline / + * trace-level tags into its own storage, so an N-span trace pays that copy N+1 times. That per-span + * copy is exactly what the map-to-map copy optimization (TagMap 1.0) and the trace/span tag split + * (level-split read-through) target — this bench is how their win shows up as it scales, which a + * single-span bench cannot show. + * + *

      Sweeping {@code childCount} turns the per-child marginal cost into the slope: the level-split + * win should flatten it (children stop re-copying trace-level tags). + * + *

      Same conventions as {@link SpanCreationBenchmark}: {@link DropWriter} isolates front-half + * allocation; read alloc ({@code -prof gc}) as the anchor, throughput as directional; logging must + * be forced to WARN or DEBUG-line allocation corrupts the numbers. Drift-stable v1.53→master + * ({@code buildSpan}/{@code asChildOf}/{@code setTag}/{@code finish}, {@link Tags}, {@link + * datadog.trace.common.writer.Writer}) so it can be grafted onto old tags for the historical curve. + * + *

      Historical allocation (B/op, {@code gc.alloc.rate.norm}) per {@code childCount}, + * grafted onto each release tag, {@code @Threads(8) -f3 -wi5 -i5 -prof gc} (measured 2026-07). The + * per-child slope is the level-split target: note the total falls far less than the single-span + * arms (net -13% to -20% vs -20% to -31%), because most of an N-span trace's allocation is the + * per-child trace-level-tag copy that TagMap 1.0 does not yet remove — the level-split read-through + * is what should flatten it. + * + *

      + * ver    trace[1] trace[5] trace[20]
      + * 1.53     2792.0   5701.3   16674.7
      + * 1.54     2874.7   5773.3   16728.0
      + * 1.55     2816.7   5752.0   16733.4
      + * 1.56     2826.7   5762.7   16728.0
      + * 1.57     2746.7   5301.3   15058.7
      + * 1.58     2640.0   5642.7   15072.0
      + * 1.59     2504.0   5376.0   15370.7
      + * 1.60     2519.2   5264.0   14986.7
      + * 1.61     2240.0   4634.7   14258.7
      + * 1.62     2256.2   4650.7   13688.7
      + * 1.63     2238.6   4868.9   14992.0
      + * 1.64     2241.3   4720.5   14592.0
      + * Δ%        -19.7    -17.2     -12.5
      + * 
      + * + *

      Throughput (ops/us) from the same runs — noisier, treat as directional only (laptop + * thermals + per-fork inlining bimodality; no Δ% given because there is no reliable trend): + * + *

      + * ver    trace[1] trace[5] trace[20]
      + * 1.53      2.428    0.781     0.247
      + * 1.54      2.318    0.840     0.260
      + * 1.55      2.355    0.931     0.254
      + * 1.56      2.515    0.904     0.278
      + * 1.57      2.296    0.953     0.305
      + * 1.58      2.481    1.049     0.301
      + * 1.59      2.285    1.022     0.276
      + * 1.60      2.297    0.980     0.303
      + * 1.61      2.371    0.884     0.258
      + * 1.62      2.341    1.141     0.296
      + * 1.63      2.911    1.039     0.247
      + * 1.64      2.422    0.944     0.253
      + * 
      + */ +@State(Scope.Benchmark) +@Warmup(iterations = 5) +@Measurement(iterations = 5) +@BenchmarkMode(Mode.Throughput) +@Threads(8) +@OutputTimeUnit(MICROSECONDS) +@Fork(value = 3, jvmArgsAppend = "-DTEST_LOG_LEVEL=warn") +public class TraceAssemblyBenchmark { + private static final String INSTRUMENTATION_NAME = "bench"; + private static final String ROOT_OPERATION = "servlet.request"; + private static final String CHILD_OPERATION = "servlet.handler"; + + private static final String COMPONENT_VALUE = "tomcat-server"; + private static final String HTTP_METHOD_VALUE = "GET"; + private static final String HTTP_ROUTE_VALUE = "/owners/{ownerId}"; + private static final String HTTP_URL_VALUE = "http://localhost:8080/owners/42"; + private static final int HTTP_STATUS_VALUE = 200; + + /** Number of child spans under the root — the axis that turns per-child cost into a slope. */ + @Param({"1", "5", "20"}) + int childCount; + + CoreTracer tracer; + + @Setup + public void setup(Blackhole blackhole) { + this.tracer = CoreTracer.builder().writer(new DropWriter(blackhole)).build(); + } + + @TearDown + public void tearDown() { + this.tracer.close(); + } + + /** Web-server root + {@code childCount} children, each finished; whole trace dropped. */ + @Benchmark + public void webServerTrace() { + AgentSpan root = tracer.buildSpan(INSTRUMENTATION_NAME, ROOT_OPERATION).start(); + root.setTag(Tags.COMPONENT, COMPONENT_VALUE); + root.setTag(Tags.SPAN_KIND, Tags.SPAN_KIND_SERVER); + root.setTag(Tags.HTTP_METHOD, HTTP_METHOD_VALUE); + root.setTag(Tags.HTTP_ROUTE, HTTP_ROUTE_VALUE); + root.setTag(Tags.HTTP_URL, HTTP_URL_VALUE); + root.setTag(Tags.HTTP_STATUS, HTTP_STATUS_VALUE); + + for (int i = 0; i < childCount; i++) { + AgentSpan child = + tracer.buildSpan(INSTRUMENTATION_NAME, CHILD_OPERATION).asChildOf(root).start(); + child.setTag(Tags.COMPONENT, COMPONENT_VALUE); + child.setTag(Tags.SPAN_KIND, Tags.SPAN_KIND_INTERNAL); + child.finish(); + } + + root.finish(); + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/civisibility/writer/ddintake/CiTestCycleMapperV1.java b/dd-trace-core/src/main/java/datadog/trace/civisibility/writer/ddintake/CiTestCycleMapperV1.java index 7593ce9b9dd..0cd3f854130 100644 --- a/dd-trace-core/src/main/java/datadog/trace/civisibility/writer/ddintake/CiTestCycleMapperV1.java +++ b/dd-trace-core/src/main/java/datadog/trace/civisibility/writer/ddintake/CiTestCycleMapperV1.java @@ -3,6 +3,8 @@ import static datadog.communication.http.OkHttpUtils.gzippedMsgpackRequestBodyOf; import static datadog.communication.http.OkHttpUtils.msgpackRequestBodyOf; import static datadog.json.JsonMapper.toJson; +import static datadog.trace.api.civisibility.CIConstants.MAX_META_STRING_VALUE_LENGTH; +import static datadog.trace.util.Strings.truncate; import datadog.communication.serialization.GrowableBuffer; import datadog.communication.serialization.Writable; @@ -350,21 +352,22 @@ public void accept(Metadata metadata) { // we just need to be sure that the size is the same as the number of elements for (Map.Entry entry : metadata.getBaggage().entrySet()) { writable.writeString(entry.getKey(), null); - writable.writeString(entry.getValue(), null); + writable.writeString(truncate(entry.getValue(), MAX_META_STRING_VALUE_LENGTH), null); } if (null != metadata.getHttpStatusCode()) { writable.writeUTF8(HTTP_STATUS); - writable.writeUTF8(metadata.getHttpStatusCode()); + writable.writeUTF8(truncate(metadata.getHttpStatusCode(), MAX_META_STRING_VALUE_LENGTH)); } for (Map.Entry entry : tags.entrySet()) { Object value = entry.getValue(); if (!(value instanceof Number)) { writable.writeString(entry.getKey(), null); if (!(value instanceof Iterable)) { - writable.writeObjectString(value, null); + writable.writeString( + truncate(String.valueOf(value), MAX_META_STRING_VALUE_LENGTH), null); } else { String serializedValue = toJson((Collection) value); - writable.writeString(serializedValue, null); + writable.writeString(truncate(serializedValue, MAX_META_STRING_VALUE_LENGTH), null); } } } diff --git a/dd-trace-core/src/main/java/datadog/trace/common/metrics/AggregateEntry.java b/dd-trace-core/src/main/java/datadog/trace/common/metrics/AggregateEntry.java new file mode 100644 index 00000000000..f2d93ac09d0 --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/common/metrics/AggregateEntry.java @@ -0,0 +1,552 @@ +package datadog.trace.common.metrics; + +import datadog.metrics.api.Histogram; +import datadog.trace.api.Config; +import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; +import datadog.trace.util.Hashtable; +import datadog.trace.util.LongHashingUtils; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import javax.annotation.Nullable; + +/** + * {@link datadog.trace.util.Hashtable} entry used by the aggregator thread. + * + *

      Stores the canonical UTF8 label values that identify one aggregate row, plus the mutable + * counter and histogram state for that row. Labels are canonicalized before hashing, so overflow + * values replaced with the sentinel use the same hash and map to the same row. + * + *

      Not thread-safe — all mutation is on the aggregator thread. Tests must call {@link + * #resetCardinalityHandlers()} in setup to avoid cross-test handler pollution (handlers are + * static); tests using {@link PeerTagSchema} must also call {@code PeerTagSchema#resetHandlers} on + * the schema instance. + */ +public final class AggregateEntry extends Hashtable.Entry { + + static final long ERROR_TAG = 0x8000000000000000L; + static final long TOP_LEVEL_TAG = 0x4000000000000000L; + + private static final UTF8BytesString[] EMPTY_TAGS = new UTF8BytesString[0]; + + // Configurable per-field cardinality handlers — tunable via env var. + static final PropertyCardinalityHandler RESOURCE_HANDLER = + new PropertyCardinalityHandler( + "resource", + Config.get().getTraceStatsCardinalityLimit("resource", MetricCardinalityLimits.RESOURCE)); + static final PropertyCardinalityHandler HTTP_ENDPOINT_HANDLER = + new PropertyCardinalityHandler( + "http_endpoint", + Config.get() + .getTraceStatsCardinalityLimit( + "http_endpoint", MetricCardinalityLimits.HTTP_ENDPOINT)); + + // Fixed per-field cardinality handlers — hardcoded, not user-configurable. + static final PropertyCardinalityHandler SERVICE_HANDLER = + new PropertyCardinalityHandler("service", MetricCardinalityLimits.SERVICE); + static final PropertyCardinalityHandler OPERATION_HANDLER = + new PropertyCardinalityHandler("operation", MetricCardinalityLimits.OPERATION); + static final PropertyCardinalityHandler SERVICE_SOURCE_HANDLER = + new PropertyCardinalityHandler("service_source", MetricCardinalityLimits.SERVICE_SOURCE); + static final PropertyCardinalityHandler TYPE_HANDLER = + new PropertyCardinalityHandler("type", MetricCardinalityLimits.TYPE); + static final PropertyCardinalityHandler SPAN_KIND_HANDLER = + new PropertyCardinalityHandler("span_kind", MetricCardinalityLimits.SPAN_KIND); + static final PropertyCardinalityHandler HTTP_METHOD_HANDLER = + new PropertyCardinalityHandler("http_method", MetricCardinalityLimits.HTTP_METHOD); + static final PropertyCardinalityHandler GRPC_STATUS_CODE_HANDLER = + new PropertyCardinalityHandler("grpc_status_code", MetricCardinalityLimits.GRPC_STATUS_CODE); + + // Single authoritative list used by resetCardinalityHandlers(). populateFrom() and hashOf() keep + // named access for readability and to avoid per-span iteration overhead; this array ensures the + // reset site stays in sync even if a new field is added without updating the loop by name. + static final PropertyCardinalityHandler[] FIELD_HANDLERS = { + RESOURCE_HANDLER, + SERVICE_HANDLER, + OPERATION_HANDLER, + SERVICE_SOURCE_HANDLER, + TYPE_HANDLER, + SPAN_KIND_HANDLER, + HTTP_METHOD_HANDLER, + HTTP_ENDPOINT_HANDLER, + GRPC_STATUS_CODE_HANDLER, + }; + + final UTF8BytesString resource; + final UTF8BytesString service; + final UTF8BytesString operationName; + // Optional fields use UTF8BytesString.EMPTY as the "absent" sentinel rather than null. The + // cardinality handlers map null inputs to EMPTY, and createUtf8 does the same for the of(...) + // factory, so callers don't need to special-case absence. + final UTF8BytesString serviceSource; + final UTF8BytesString type; + final UTF8BytesString spanKind; + final UTF8BytesString httpMethod; + final UTF8BytesString httpEndpoint; + final UTF8BytesString grpcStatusCode; + final short httpStatusCode; + final boolean synthetic; + final boolean traceRoot; + final List peerTags; + + // Mutable aggregate state -- single-thread (aggregator) writer. + private final Histogram okLatencies = Histogram.newHistogram(); + + /** + * Lazily allocated on the first recorded error. Most entries never see an error and keep this + * null for life; {@link SerializingMetricWriter} writes a cached empty-histogram form when null + * to keep the wire payload identical. Once allocated, it survives {@link #clear()} (cleared, not + * nulled) since an entry that errored once tends to error again. + */ + @Nullable private Histogram errorLatencies; + + private int errorCount; + private int hitCount; + private int topLevelCount; + private long okDuration; + private long errorDuration; + + /** + * Field-bearing constructor. Package-private so {@link AggregateEntryTestUtils} can build + * expected entries. + */ + AggregateEntry( + long keyHash, + UTF8BytesString resource, + UTF8BytesString service, + UTF8BytesString operationName, + UTF8BytesString serviceSource, + UTF8BytesString type, + UTF8BytesString spanKind, + UTF8BytesString httpMethod, + UTF8BytesString httpEndpoint, + UTF8BytesString grpcStatusCode, + short httpStatusCode, + boolean synthetic, + boolean traceRoot, + List peerTags) { + super(keyHash); + this.resource = resource; + this.service = service; + this.operationName = operationName; + this.serviceSource = serviceSource; + this.type = type; + this.spanKind = spanKind; + this.httpMethod = httpMethod; + this.httpEndpoint = httpEndpoint; + this.grpcStatusCode = grpcStatusCode; + this.httpStatusCode = httpStatusCode; + this.synthetic = synthetic; + this.traceRoot = traceRoot; + this.peerTags = peerTags; + } + + /** + * Records a single hit. {@code tagAndDuration} carries the duration nanos with optional {@link + * #ERROR_TAG} / {@link #TOP_LEVEL_TAG} bits OR-ed in. + */ + AggregateEntry recordOneDuration(long tagAndDuration) { + ++hitCount; + if ((tagAndDuration & TOP_LEVEL_TAG) == TOP_LEVEL_TAG) { + tagAndDuration ^= TOP_LEVEL_TAG; + ++topLevelCount; + } + if ((tagAndDuration & ERROR_TAG) == ERROR_TAG) { + tagAndDuration ^= ERROR_TAG; + errorLatenciesForWrite().accept(tagAndDuration); + errorDuration += tagAndDuration; + ++errorCount; + } else { + okLatencies.accept(tagAndDuration); + okDuration += tagAndDuration; + } + return this; + } + + public int getErrorCount() { + return errorCount; + } + + public int getHitCount() { + return hitCount; + } + + public int getTopLevelCount() { + return topLevelCount; + } + + public long getDuration() { + return okDuration + errorDuration; + } + + public long getOkDuration() { + return okDuration; + } + + public long getErrorDuration() { + return errorDuration; + } + + public Histogram getOkLatencies() { + return okLatencies; + } + + /** + * Returns the entry's error-latency histogram, or {@code null} if no error has been recorded. + * Callers serializing this should treat {@code null} as "emit a cached empty histogram"; see + * {@link SerializingMetricWriter}. + */ + @Nullable + public Histogram getErrorLatencies() { + return errorLatencies; + } + + /** Lazy-allocates {@link #errorLatencies} on the first error. */ + private Histogram errorLatenciesForWrite() { + Histogram h = errorLatencies; + if (h == null) { + h = Histogram.newHistogram(); + errorLatencies = h; + } + return h; + } + + /** + * Resets the per-cycle counters and histograms. Label fields ({@code resource}, {@code service}, + * ..., {@code peerTags}) are deliberately left intact -- they're the entry's bucket identity and + * must persist so a subsequent snapshot with the same key reuses this entry instead of allocating + * a fresh one. Entries that stay at {@code hitCount == 0} across a cycle are reaped by {@link + * AggregateTable#expungeStaleAggregates}. + */ + void clear() { + this.errorCount = 0; + this.hitCount = 0; + this.topLevelCount = 0; + this.okDuration = 0; + this.errorDuration = 0; + this.okLatencies.clear(); + // errorLatencies stays null on entries that never errored. Only clear if it was allocated. + if (this.errorLatencies != null) { + this.errorLatencies.clear(); + } + } + + /** Resets the static per-field cardinality handlers. Does not cover {@link PeerTagSchema}. */ + static void resetCardinalityHandlers() { + for (PropertyCardinalityHandler handler : FIELD_HANDLERS) { + handler.reset(); + } + } + + /** + * 64-bit lookup hash, computed over UTF8-encoded fields so that cardinality-blocked values (which + * all canonicalize to the same sentinel {@link UTF8BytesString}) collide in the same bucket. + * {@link UTF8BytesString#hashCode()} returns the underlying String hash, so entries built via + * {@link #of} produce the same hash as entries built from a snapshot with matching content. + * + *

      Field order intentionally mirrors {@link Canonical#matches} -- UTF8 fields first (highest + * cardinality first for matches' short-circuit benefit), then the peer-tag list, then the + * primitives. The hash itself is order-stable across all callers; the lockstep ordering is purely + * for readability when reasoning about lookup and equality in tandem. + */ + static long hashOf( + UTF8BytesString resource, + UTF8BytesString service, + UTF8BytesString operationName, + UTF8BytesString serviceSource, + UTF8BytesString type, + UTF8BytesString spanKind, + UTF8BytesString httpMethod, + UTF8BytesString httpEndpoint, + UTF8BytesString grpcStatusCode, + short httpStatusCode, + boolean synthetic, + boolean traceRoot, + UTF8BytesString[] peerTags, + int peerTagCount) { + long h = 0; + h = LongHashingUtils.addToHash(h, resource); + h = LongHashingUtils.addToHash(h, service); + h = LongHashingUtils.addToHash(h, operationName); + h = LongHashingUtils.addToHash(h, serviceSource); + h = LongHashingUtils.addToHash(h, type); + h = LongHashingUtils.addToHash(h, spanKind); + h = LongHashingUtils.addToHash(h, httpMethod); + h = LongHashingUtils.addToHash(h, httpEndpoint); + h = LongHashingUtils.addToHash(h, grpcStatusCode); + for (int i = 0; i < peerTagCount; i++) { + h = LongHashingUtils.addToHash(h, peerTags[i]); + } + h = LongHashingUtils.addToHash(h, httpStatusCode); + h = LongHashingUtils.addToHash(h, synthetic); + h = LongHashingUtils.addToHash(h, traceRoot); + return h; + } + + // Accessors for SerializingMetricWriter. + public UTF8BytesString getResource() { + return resource; + } + + public UTF8BytesString getService() { + return service; + } + + public UTF8BytesString getOperationName() { + return operationName; + } + + public UTF8BytesString getServiceSource() { + return serviceSource; + } + + /** + * Whether the snapshot carried a service-source value. Encapsulates the EMPTY-as-absent + * convention: optional fields use {@link UTF8BytesString#EMPTY} as the sentinel for "no value + * captured" (see field comment) -- callers that need a presence check should go through this + * predicate rather than comparing against {@code EMPTY} directly. + */ + public boolean hasServiceSource() { + return serviceSource.length() > 0; + } + + public UTF8BytesString getType() { + return type; + } + + public UTF8BytesString getSpanKind() { + return spanKind; + } + + public UTF8BytesString getHttpMethod() { + return httpMethod; + } + + /** + * Whether the snapshot carried an HTTP method. See {@link #hasServiceSource} for the contract. + */ + public boolean hasHttpMethod() { + return httpMethod.length() > 0; + } + + public UTF8BytesString getHttpEndpoint() { + return httpEndpoint; + } + + /** + * Whether the snapshot carried an HTTP endpoint. See {@link #hasServiceSource} for the contract. + */ + public boolean hasHttpEndpoint() { + return httpEndpoint.length() > 0; + } + + public UTF8BytesString getGrpcStatusCode() { + return grpcStatusCode; + } + + /** + * Whether the snapshot carried a gRPC status code. See {@link #hasServiceSource} for the + * contract. + */ + public boolean hasGrpcStatusCode() { + return grpcStatusCode.length() > 0; + } + + public int getHttpStatusCode() { + return httpStatusCode; + } + + public boolean isSynthetics() { + return synthetic; + } + + public boolean isTraceRoot() { + return traceRoot; + } + + public List getPeerTags() { + return peerTags; + } + + // Production AggregateEntry intentionally has no equals/hashCode override -- AggregateTable + // bucketing uses keyHash + Canonical.matches and never invokes Object.equals. For tests that + // need value-equality (Spock argument matchers), use AggregateEntryTestUtils in src/test. + + /** + * Reusable scratch buffer for canonicalizing a {@link SpanSnapshot} into UTF8 fields, computing + * its lookup hash, comparing against existing entries, and building a fresh entry on miss. + * + *

      One instance is held by an {@link AggregateTable} and reused on every {@code findOrInsert} + * call. Single-threaded use only. Fields are deliberately mutable -- this is a hot-path scratch + * area, not a value class. + */ + static final class Canonical { + UTF8BytesString resource; + UTF8BytesString service; + UTF8BytesString operationName; + UTF8BytesString serviceSource; + UTF8BytesString type; + UTF8BytesString spanKind; + UTF8BytesString httpMethod; + UTF8BytesString httpEndpoint; + UTF8BytesString grpcStatusCode; + short httpStatusCode; + boolean synthetic; + boolean traceRoot; + + /** + * Reusable buffer of canonicalized peer-tag UTF8 forms. Cleared and refilled in {@link + * #populate}; on miss, {@link #createEntry} copies it into an immutable list for the entry to + * own. Zero allocation on the hit path. Sized lazily to the schema's tag count; resized if the + * schema grows. + */ + UTF8BytesString[] peerTagsBuffer = EMPTY_TAGS; + + int peerTagsSize = 0; + + long keyHash; + + /** Canonicalize all fields from {@code s} through the handlers into this buffer. */ + void populateFrom(SpanSnapshot s) { + this.resource = RESOURCE_HANDLER.register(s.resourceName); + this.service = SERVICE_HANDLER.register(s.serviceName); + this.operationName = OPERATION_HANDLER.register(s.operationName); + this.serviceSource = SERVICE_SOURCE_HANDLER.register(s.serviceNameSource); + this.type = TYPE_HANDLER.register(s.spanType); + this.spanKind = SPAN_KIND_HANDLER.register(s.spanKind); + this.httpMethod = HTTP_METHOD_HANDLER.register(s.httpMethod); + this.httpEndpoint = HTTP_ENDPOINT_HANDLER.register(s.httpEndpoint); + this.grpcStatusCode = GRPC_STATUS_CODE_HANDLER.register(s.grpcStatusCode); + this.httpStatusCode = s.httpStatusCode; + this.synthetic = s.synthetic; + this.traceRoot = s.traceRoot; + populatePeerTags(s.peerTagSchema, s.peerTagValues); + this.keyHash = + hashOf( + resource, + service, + operationName, + serviceSource, + type, + spanKind, + httpMethod, + httpEndpoint, + grpcStatusCode, + httpStatusCode, + synthetic, + traceRoot, + peerTagsBuffer, + peerTagsSize); + } + + /** + * Replaces the current peer-tag buffer contents with the canonical UTF8 forms for this + * snapshot. + * + *

      Each non-null value is canonicalized with the handler at the same schema index. Null + * values are skipped because they would canonicalize to {@link UTF8BytesString#EMPTY} and be + * filtered out anyway. Producer-side {@code capturePeerTagValues} produces sparse-null arrays, + * so the skip pays off whenever a span carries only a subset of the configured peer tags. + */ + private void populatePeerTags(PeerTagSchema schema, String[] values) { + peerTagsSize = 0; + if (schema == null || values == null) { + return; + } + int n = Math.min(schema.size(), values.length); + if (peerTagsBuffer.length < n) { + peerTagsBuffer = new UTF8BytesString[n]; + } + for (int i = 0; i < n; i++) { + String value = values[i]; + if (value == null) { + continue; + } + peerTagsBuffer[peerTagsSize++] = schema.register(i, value); + } + } + + /** + * Whether this canonicalized snapshot matches the given entry. Compares UTF8 fields via + * content-equality (so an entry surviving a handler reset still matches a freshly-canonicalized + * snapshot of the same content). + * + *

      Field order is cardinality-tuned: resource / service / operationName first because they + * vary most across collisions, then the remaining UTF8 fields, then the peer-tag list + * comparison (slowest), then the primitives. All UTF8 fields are non-null by the EMPTY- + * sentinel invariant (see field comments above), so direct {@code a.equals(b)} is safe. + */ + boolean matches(AggregateEntry e) { + return resource.equals(e.resource) + && service.equals(e.service) + && operationName.equals(e.operationName) + && serviceSource.equals(e.serviceSource) + && type.equals(e.type) + && spanKind.equals(e.spanKind) + && httpMethod.equals(e.httpMethod) + && httpEndpoint.equals(e.httpEndpoint) + && grpcStatusCode.equals(e.grpcStatusCode) + && peerTagsEqual(peerTagsBuffer, peerTagsSize, e.peerTags) + && httpStatusCode == e.httpStatusCode + && synthetic == e.synthetic + && traceRoot == e.traceRoot; + } + + private static boolean peerTagsEqual(UTF8BytesString[] a, int aSize, List b) { + if (aSize != b.size()) { + return false; + } + for (int i = 0; i < aSize; i++) { + if (!a[i].equals(b.get(i))) { + return false; + } + } + return true; + } + + /** + * Build a new entry from the currently-populated canonical fields. The peer-tag buffer is + * copied into an immutable list so the entry's reference stays stable across subsequent {@link + * #populate} calls. + */ + AggregateEntry createEntry() { + List snapshottedPeerTags; + int n = peerTagsSize; + if (n == 0) { + snapshottedPeerTags = Collections.emptyList(); + } else if (n == 1) { + snapshottedPeerTags = Collections.singletonList(peerTagsBuffer[0]); + } else { + snapshottedPeerTags = Arrays.asList(Arrays.copyOf(peerTagsBuffer, n)); + } + return new AggregateEntry( + keyHash, + resource, + service, + operationName, + serviceSource, + type, + spanKind, + httpMethod, + httpEndpoint, + grpcStatusCode, + httpStatusCode, + synthetic, + traceRoot, + snapshottedPeerTags); + } + } + + // ----- helpers ----- + + /** Direct {@link UTF8BytesString} creation that bypasses the cardinality handlers. */ + static UTF8BytesString createUtf8(CharSequence cs) { + if (cs == null) { + return UTF8BytesString.EMPTY; + } + if (cs instanceof UTF8BytesString) { + return (UTF8BytesString) cs; + } + return UTF8BytesString.create(cs.toString()); + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/common/metrics/AggregateMetric.java b/dd-trace-core/src/main/java/datadog/trace/common/metrics/AggregateMetric.java deleted file mode 100644 index 478ff520a37..00000000000 --- a/dd-trace-core/src/main/java/datadog/trace/common/metrics/AggregateMetric.java +++ /dev/null @@ -1,82 +0,0 @@ -package datadog.trace.common.metrics; - -import datadog.metrics.api.Histogram; -import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import java.util.concurrent.atomic.AtomicLongArray; - -/** Not thread-safe. Accumulates counts and durations. */ -@SuppressFBWarnings( - value = {"AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE", "AT_STALE_THREAD_WRITE_OF_PRIMITIVE"}, - justification = "Explicitly not thread-safe. Accumulates counts and durations.") -public final class AggregateMetric { - - static final long ERROR_TAG = 0x8000000000000000L; - static final long TOP_LEVEL_TAG = 0x4000000000000000L; - - private final Histogram okLatencies; - private final Histogram errorLatencies; - private int errorCount; - private int hitCount; - private int topLevelCount; - private long duration; - - public AggregateMetric() { - okLatencies = Histogram.newHistogram(); - errorLatencies = Histogram.newHistogram(); - } - - public AggregateMetric recordDurations(int count, AtomicLongArray durations) { - this.hitCount += count; - for (int i = 0; i < count && i < durations.length(); ++i) { - long duration = durations.getAndSet(i, 0); - if ((duration & TOP_LEVEL_TAG) == TOP_LEVEL_TAG) { - duration ^= TOP_LEVEL_TAG; - ++topLevelCount; - } - if ((duration & ERROR_TAG) == ERROR_TAG) { - // then it's an error - duration ^= ERROR_TAG; - errorLatencies.accept(duration); - ++errorCount; - } else { - okLatencies.accept(duration); - } - this.duration += duration; - } - return this; - } - - public int getErrorCount() { - return errorCount; - } - - public int getHitCount() { - return hitCount; - } - - public int getTopLevelCount() { - return topLevelCount; - } - - public long getDuration() { - return duration; - } - - public Histogram getOkLatencies() { - return okLatencies; - } - - public Histogram getErrorLatencies() { - return errorLatencies; - } - - @SuppressFBWarnings("AT_NONATOMIC_64BIT_PRIMITIVE") - public void clear() { - this.errorCount = 0; - this.hitCount = 0; - this.topLevelCount = 0; - this.duration = 0; - this.okLatencies.clear(); - this.errorLatencies.clear(); - } -} diff --git a/dd-trace-core/src/main/java/datadog/trace/common/metrics/AggregateTable.java b/dd-trace-core/src/main/java/datadog/trace/common/metrics/AggregateTable.java new file mode 100644 index 00000000000..6f2072f6495 --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/common/metrics/AggregateTable.java @@ -0,0 +1,147 @@ +package datadog.trace.common.metrics; + +import datadog.trace.util.Hashtable; +import datadog.trace.util.Hashtable.MutatingTableIterator; +import java.util.function.BiConsumer; +import java.util.function.Consumer; + +/** + * The {@link AggregateEntry} store of the consuming aggregator thread, keyed on the canonical + * UTF8-encoded labels of a {@link SpanSnapshot}. + * + *

      {@link #findOrInsert} canonicalizes the snapshot's fields through the cardinality handlers (so + * cardinality-blocked values share a sentinel and collapse into one entry) and then computes the + * lookup hash from that canonical form. Canonicalization runs into a reusable {@link + * AggregateEntry.Canonical} scratch buffer; on a hit nothing is allocated, on a miss the buffer's + * references are copied into a fresh entry and the buffer is overwritten on the next call. + * + *

      Not thread-safe. The aggregator thread is the sole writer of both this table and its + * contained {@link AggregateEntry} state. Any cross-thread request that needs to mutate -- e.g. + * {@link ClientStatsAggregator#disable()} -- must funnel onto the aggregator thread via the inbox + * (see the {@code ClearSignal} routing in {@link Aggregator}). The invariant is convention- + * enforced; nothing here checks the calling thread at runtime, so a wrong-thread call would corrupt + * bucket chains silently. + */ +final class AggregateTable { + + private final Hashtable.Entry[] buckets; + private final int maxAggregates; + private final AggregateEntry.Canonical canonical = new AggregateEntry.Canonical(); + private int size; + + /** + * Bucket index where the last {@link #evictOneStale} successfully removed an entry. The next call + * resumes from this bucket so a fast-evicting workload doesn't repeatedly re-walk the same hot + * entries clustered near bucket 0. Reset to {@code 0} by {@link #clear}. + */ + private int evictCursor; + + AggregateTable(int maxAggregates) { + this.buckets = Hashtable.Support.create(maxAggregates, Hashtable.Support.MAX_RATIO); + this.maxAggregates = maxAggregates; + } + + int size() { + return size; + } + + boolean isEmpty() { + return size == 0; + } + + /** + * Returns the {@link AggregateEntry} to update for {@code snapshot}, lazily creating one on miss. + * Returns {@code null} when the table is at capacity and no stale entry can be evicted -- the + * caller should drop the data point in that case. + */ + AggregateEntry findOrInsert(SpanSnapshot snapshot) { + canonical.populateFrom(snapshot); + long keyHash = canonical.keyHash; + for (AggregateEntry candidate = Hashtable.Support.bucket(buckets, keyHash); + candidate != null; + candidate = candidate.next()) { + if (candidate.keyHash == keyHash && canonical.matches(candidate)) { + return candidate; + } + } + if (size >= maxAggregates && !evictOneStale()) { + return null; + } + AggregateEntry entry = canonical.createEntry(); + Hashtable.Support.insertHeadEntry(buckets, keyHash, entry); + size++; + return entry; + } + + /** + * Unlinks the first entry whose {@code getHitCount() == 0}, resuming the scan from {@link + * #evictCursor} so consecutive evictions amortize to O(1) per call. Worst case for a single call + * is still O(N) when nearly every entry is hot, but a sustained eviction stream never re-scans + * the hot prefix more than twice across N evictions. + * + *

      If the table is full and every entry was used in this cycle, drop the new key (reported via + * {@code onStatsAggregateDropped}) rather than evicting an established one. Cap is sized to the + * steady-state working set, so eviction is rare in the common case. + * + *

      With per-field cardinality limits enabled, over-cap values for a given field collapse into a + * shared {@code tracer_blocked_value} bucket, so the table itself rarely reaches {@code + * maxAggregates}. Without per-field limits, over-cap values flow to distinct buckets and {@code + * maxAggregates} becomes the load-bearing backstop -- the cursor-resumed scan was added + * specifically for this regime. + */ + private boolean evictOneStale() { + // Two passes -- [cursor, length) then [0, cursor) -- using the half-open-range iterator. The + // second pass is naturally empty when cursor==0, so no extra check needed. + return evictOneStaleInRange(evictCursor, buckets.length) + || evictOneStaleInRange(0, evictCursor); + } + + /** Scans {@code [startBucket, endBucket)} for the first stale entry and unlinks it. */ + private boolean evictOneStaleInRange(int startBucket, int endBucket) { + MutatingTableIterator iter = + Hashtable.Support.mutatingTableIterator(buckets, startBucket, endBucket); + while (iter.hasNext()) { + AggregateEntry e = iter.next(); + if (e.getHitCount() == 0) { + int bucket = iter.currentBucket(); + iter.remove(); + size--; + evictCursor = bucket; + return true; + } + } + return false; + } + + void forEach(Consumer consumer) { + Hashtable.Support.forEach(buckets, consumer); + } + + /** + * Context-passing forEach. Useful for callers that want to avoid a capturing-lambda allocation on + * each invocation -- pass a non-capturing {@link BiConsumer} (typically a {@code static final}) + * plus whatever side-band state it needs as {@code context}. + */ + void forEach(T context, BiConsumer consumer) { + Hashtable.Support.forEach(buckets, context, consumer); + } + + /** Removes entries whose {@code getHitCount() == 0}. */ + void expungeStaleAggregates() { + for (MutatingTableIterator iter = + Hashtable.Support.mutatingTableIterator(buckets); + iter.hasNext(); ) { + AggregateEntry e = iter.next(); + if (e.getHitCount() == 0) { + iter.remove(); + size--; + } + } + } + + void clear() { + Hashtable.Support.clear(buckets); + size = 0; + evictCursor = 0; + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/common/metrics/Aggregator.java b/dd-trace-core/src/main/java/datadog/trace/common/metrics/Aggregator.java index 8a69dbc6e56..8a33d3f1ea7 100644 --- a/dd-trace-core/src/main/java/datadog/trace/common/metrics/Aggregator.java +++ b/dd-trace-core/src/main/java/datadog/trace/common/metrics/Aggregator.java @@ -2,14 +2,10 @@ import static java.util.concurrent.TimeUnit.MILLISECONDS; +import datadog.trace.common.metrics.SignalItem.ClearSignal; import datadog.trace.common.metrics.SignalItem.StopSignal; import datadog.trace.core.monitor.HealthMetrics; -import datadog.trace.core.util.LRUCache; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; -import java.util.Iterator; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.ConcurrentMap; import java.util.concurrent.TimeUnit; import org.jctools.queues.MessagePassingQueue; import org.slf4j.Logger; @@ -21,12 +17,10 @@ final class Aggregator implements Runnable { private static final Logger log = LoggerFactory.getLogger(Aggregator.class); - private final MessagePassingQueue batchPool; private final MessagePassingQueue inbox; - private final LRUCache aggregates; - private final ConcurrentMap pending; - private final Set commonKeys; + private final AggregateTable aggregates; private final MetricWriter writer; + private final HealthMetrics healthMetrics; // the reporting interval controls how much history will be buffered // when the agent is unresponsive (only 10 pending requests will be // buffered by OkHttpSink) @@ -34,6 +28,15 @@ final class Aggregator implements Runnable { private final long sleepMillis; + /** + * Per-cycle hook run on the aggregator thread at the start of each report cycle, before the + * flush. Used by {@link ClientStatsAggregator} to reconcile its cached peer-tag schema against + * {@link datadog.communication.ddagent.DDAgentFeaturesDiscovery}; running before the flush + * guarantees that any test awaiting {@code writer.finishBucket()} observes the schema in its + * post-reconcile state. May be {@code null}. + */ + private final Runnable onReportCycle; + @SuppressFBWarnings( value = "AT_STALE_THREAD_WRITE_OF_PRIMITIVE", justification = "the field is confined to the agent thread running the Aggregator") @@ -41,55 +44,39 @@ final class Aggregator implements Runnable { Aggregator( MetricWriter writer, - MessagePassingQueue batchPool, MessagePassingQueue inbox, - ConcurrentMap pending, - final Set commonKeys, int maxAggregates, long reportingInterval, TimeUnit reportingIntervalTimeUnit, - HealthMetrics healthMetrics) { + HealthMetrics healthMetrics, + Runnable onReportCycle) { this( writer, - batchPool, inbox, - pending, - commonKeys, maxAggregates, reportingInterval, reportingIntervalTimeUnit, DEFAULT_SLEEP_MILLIS, - healthMetrics); + healthMetrics, + onReportCycle); } Aggregator( MetricWriter writer, - MessagePassingQueue batchPool, MessagePassingQueue inbox, - ConcurrentMap pending, - final Set commonKeys, int maxAggregates, long reportingInterval, TimeUnit reportingIntervalTimeUnit, long sleepMillis, - HealthMetrics healthMetrics) { + HealthMetrics healthMetrics, + Runnable onReportCycle) { this.writer = writer; - this.batchPool = batchPool; this.inbox = inbox; - this.commonKeys = commonKeys; - this.aggregates = - new LRUCache<>( - new CommonKeyCleaner(commonKeys, healthMetrics), - maxAggregates * 4 / 3, - 0.75f, - maxAggregates); - this.pending = pending; + this.aggregates = new AggregateTable(maxAggregates); this.reportingIntervalNanos = reportingIntervalTimeUnit.toNanos(reportingInterval); this.sleepMillis = sleepMillis; - } - - public void clearAggregates() { - this.aggregates.clear(); + this.healthMetrics = healthMetrics; + this.onReportCycle = onReportCycle; } @Override @@ -118,7 +105,31 @@ private final class Drainer implements MessagePassingQueue.Consumer { @Override public void accept(InboxItem item) { - if (item instanceof SignalItem) { + if (item == ClearSignal.CLEAR) { + // ClearSignal is routed through the inbox (rather than letting the caller mutate + // AggregateTable directly) so the aggregator thread stays the sole writer. AggregateTable + // is not thread-safe; a direct clear() from e.g. the OkHttpSink callback thread would + // race with Drainer.accept on this thread. + // + // We deliberately do NOT call inbox.clear() here. Doing so would erase any queued STOP + // (or REPORT) signals that happen to sit behind CLEAR -- a real concern when a + // downgrade is followed quickly by close(), where the trampled STOP leaves the + // aggregator thread spinning until thread.join times out. features.supportsMetrics() is + // already false by the time CLEAR was offered, so producers have stopped publishing; + // any in-flight snapshots will drain naturally into the just-cleared table, get + // re-aggregated, and flushed on the next report -- where the agent rejects them again, + // triggering another DOWNGRADED -> disable() -> CLEAR cycle. Worst case: one extra + // reporting cycle of wasted work, which we accept for the safety of preserving STOP. + if (!stopped) { + aggregates.clear(); + // Clear dirty too -- without this, the next report() would see dirty=true, run + // expungeStaleAggregates against the (now-empty) table, find isEmpty()=true, and skip + // the flush anyway. Same observable outcome, but resetting here keeps the invariant + // "dirty implies there's data to flush" honest. + dirty = false; + } + ((SignalItem) item).complete(); + } else if (item instanceof SignalItem) { SignalItem signal = (SignalItem) item; if (!stopped) { report(wallClockTime(), signal); @@ -129,32 +140,42 @@ public void accept(InboxItem item) { } else { signal.ignore(); } - } else if (item instanceof Batch && !stopped) { - Batch batch = (Batch) item; - MetricKey key = batch.getKey(); - // important that it is still *this* batch pending, must not remove otherwise - pending.remove(key, batch); - AggregateMetric aggregate = aggregates.computeIfAbsent(key, k -> new AggregateMetric()); - batch.contributeTo(aggregate); - dirty = true; - // return the batch for reuse - batchPool.offer(batch); + } else if (item instanceof SpanSnapshot && !stopped) { + SpanSnapshot snapshot = (SpanSnapshot) item; + AggregateEntry entry = aggregates.findOrInsert(snapshot); + if (entry != null) { + entry.recordOneDuration(snapshot.tagAndDuration); + dirty = true; + } else { + // table at cap with no stale entry available to evict + healthMetrics.onStatsAggregateDropped(); + } } } } private void report(long when, SignalItem signal) { + // Per-cycle hook on the aggregator thread -- used by ClientStatsAggregator to reconcile the + // cached peer-tag schema against feature discovery. Runs before the flush so any test that + // awaits writer.finishBucket() observes the schema in its post-reconcile state, and so + // subsequent producer publishes (which may happen as soon as the flush completes) see the new + // schema without an additional handoff. + if (onReportCycle != null) { + onReportCycle.run(); + } boolean skipped = true; if (dirty) { try { - expungeStaleAggregates(); + aggregates.expungeStaleAggregates(); if (!aggregates.isEmpty()) { skipped = false; writer.startBucket(aggregates.size(), when, reportingIntervalNanos); - for (Map.Entry aggregate : aggregates.entrySet()) { - writer.add(aggregate.getKey(), aggregate.getValue()); - aggregate.getValue().clear(); - } + aggregates.forEach( + writer, + (w, entry) -> { + w.add(entry); + entry.clear(); + }); // note that this may do IO and block writer.finishBucket(); } @@ -170,39 +191,7 @@ private void report(long when, SignalItem signal) { } } - private void expungeStaleAggregates() { - Iterator> it = aggregates.entrySet().iterator(); - while (it.hasNext()) { - Map.Entry pair = it.next(); - AggregateMetric metric = pair.getValue(); - if (metric.getHitCount() == 0) { - it.remove(); - commonKeys.remove(pair.getKey()); - } - } - } - private long wallClockTime() { return MILLISECONDS.toNanos(System.currentTimeMillis()); } - - private static final class CommonKeyCleaner - implements LRUCache.ExpiryListener { - - private final Set commonKeys; - private final HealthMetrics healthMetrics; - - private CommonKeyCleaner(Set commonKeys, HealthMetrics healthMetrics) { - this.commonKeys = commonKeys; - this.healthMetrics = healthMetrics; - } - - @Override - public void accept(Map.Entry expired) { - commonKeys.remove(expired.getKey()); - if (expired.getValue().getHitCount() > 0) { - healthMetrics.onStatsAggregateDropped(); - } - } - } } diff --git a/dd-trace-core/src/main/java/datadog/trace/common/metrics/Batch.java b/dd-trace-core/src/main/java/datadog/trace/common/metrics/Batch.java deleted file mode 100644 index 5f103805e98..00000000000 --- a/dd-trace-core/src/main/java/datadog/trace/common/metrics/Batch.java +++ /dev/null @@ -1,90 +0,0 @@ -package datadog.trace.common.metrics; - -import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; -import java.util.concurrent.atomic.AtomicLongArray; - -/** - * This is a thread-safe container for partial conflating and accumulating partial aggregates on the - * same key. - * - *

      Updates to an already consumed batch are rejected. - * - *

      A batch can currently take at most 64 values. Attempts to add the 65th update will be - * rejected. - */ -public final class Batch implements InboxItem { - - private static final int MAX_BATCH_SIZE = 64; - private static final AtomicIntegerFieldUpdater COUNT = - AtomicIntegerFieldUpdater.newUpdater(Batch.class, "count"); - private static final AtomicIntegerFieldUpdater COMMITTED = - AtomicIntegerFieldUpdater.newUpdater(Batch.class, "committed"); - - /** - * This counter has two states: - * - *

        - *
      1. negative: the batch has been used, must not add values - *
      2. otherwise: the number of values added to the batch - *
      - */ - private volatile int count = 0; - - /** incremented when a duration has been added. */ - private volatile int committed = 0; - - private MetricKey key; - private final AtomicLongArray durations; - - Batch(MetricKey key) { - this(new AtomicLongArray(MAX_BATCH_SIZE)); - this.key = key; - } - - Batch() { - this(new AtomicLongArray(MAX_BATCH_SIZE)); - } - - private Batch(AtomicLongArray durations) { - this.durations = durations; - } - - public MetricKey getKey() { - return key; - } - - public Batch reset(MetricKey key) { - this.key = key; - COUNT.lazySet(this, 0); - return this; - } - - public boolean isUsed() { - return count < 0; - } - - public boolean add(long tag, long durationNanos) { - // technically this would be wrong if there were 2^31 unsuccessful - // attempts to add a value, but this an acceptable risk - int position = COUNT.getAndIncrement(this); - if (position >= 0 && position < durations.length()) { - durations.set(position, tag | durationNanos); - COMMITTED.getAndIncrement(this); - return true; - } - return false; - } - - public void contributeTo(AggregateMetric aggregate) { - int count = Math.min(COUNT.getAndSet(this, Integer.MIN_VALUE), MAX_BATCH_SIZE); - if (count >= 0) { - // wait for the duration to have been set. - // note this mechanism only supports a single reader - while (committed != count) { - Thread.yield(); - } - COMMITTED.lazySet(this, 0); - aggregate.recordDurations(count, durations); - } - } -} diff --git a/dd-trace-core/src/main/java/datadog/trace/common/metrics/ClientStatsAggregator.java b/dd-trace-core/src/main/java/datadog/trace/common/metrics/ClientStatsAggregator.java new file mode 100644 index 00000000000..e7f4c5ac160 --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/common/metrics/ClientStatsAggregator.java @@ -0,0 +1,664 @@ +package datadog.trace.common.metrics; + +import static datadog.communication.ddagent.DDAgentFeaturesDiscovery.V06_METRICS_ENDPOINT; +import static datadog.trace.api.DDSpanTypes.RPC; +import static datadog.trace.bootstrap.instrumentation.api.Tags.HTTP_ENDPOINT; +import static datadog.trace.bootstrap.instrumentation.api.Tags.HTTP_METHOD; +import static datadog.trace.bootstrap.instrumentation.api.Tags.HTTP_ROUTE; +import static datadog.trace.common.metrics.AggregateEntry.ERROR_TAG; +import static datadog.trace.common.metrics.AggregateEntry.TOP_LEVEL_TAG; +import static datadog.trace.common.metrics.SignalItem.ClearSignal.CLEAR; +import static datadog.trace.common.metrics.SignalItem.ReportSignal.REPORT; +import static datadog.trace.common.metrics.SignalItem.StopSignal.STOP; +import static datadog.trace.util.AgentThreadFactory.AgentThread.METRICS_AGGREGATOR; +import static datadog.trace.util.AgentThreadFactory.THREAD_JOIN_TIMOUT_MS; +import static datadog.trace.util.AgentThreadFactory.newAgentThread; +import static java.util.concurrent.TimeUnit.MILLISECONDS; +import static java.util.concurrent.TimeUnit.SECONDS; + +import datadog.common.queue.Queues; +import datadog.communication.ddagent.DDAgentFeaturesDiscovery; +import datadog.communication.ddagent.SharedCommunicationObjects; +import datadog.trace.api.Config; +import datadog.trace.api.WellKnownTags; +import datadog.trace.bootstrap.instrumentation.api.InstrumentationTags; +import datadog.trace.common.metrics.SignalItem.ReportSignal; +import datadog.trace.common.writer.ddagent.DDAgentApi; +import datadog.trace.core.CoreSpan; +import datadog.trace.core.DDTraceCoreInfo; +import datadog.trace.core.SpanKindFilter; +import datadog.trace.core.monitor.HealthMetrics; +import datadog.trace.core.otlp.metrics.OtlpStatsMetricWriter; +import datadog.trace.util.AgentTaskScheduler; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import org.jctools.queues.MessagePassingQueue; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public final class ClientStatsAggregator implements MetricsAggregator, EventListener { + + private static final Logger log = LoggerFactory.getLogger(ClientStatsAggregator.class); + + private static final Map DEFAULT_HEADERS = + Collections.singletonMap(DDAgentApi.DATADOG_META_TRACER_VERSION, DDTraceCoreInfo.VERSION); + + private static final String SYNTHETICS_ORIGIN = "synthetics"; + + private static final SpanKindFilter METRICS_ELIGIBLE_KINDS = + SpanKindFilter.builder() + .includeServer() + .includeClient() + .includeProducer() + .includeConsumer() + .build(); + + private static final SpanKindFilter PEER_AGGREGATION_KINDS = + SpanKindFilter.builder().includeClient().includeProducer().includeConsumer().build(); + + private static final SpanKindFilter INTERNAL_KIND = + SpanKindFilter.builder().includeInternal().build(); + + // gRPC status-code source tags, probed in priority order on the OTLP export path + private static final String[] GRPC_STATUS_CODE_KEYS = { + InstrumentationTags.GRPC_STATUS_CODE, // "rpc.grpc.status_code" + "grpc.code", + "rpc.grpc.status.code", + "grpc.status.code", + "rpc.response.status_code", + }; + + private final Set ignoredResources; + private final Thread thread; + private final MessagePassingQueue inbox; + private final Sink sink; + private final MetricWriter metricWriter; + private final Aggregator aggregator; + private final long reportingInterval; + private final TimeUnit reportingIntervalTimeUnit; + private final DDAgentFeaturesDiscovery features; + private final HealthMetrics healthMetrics; + private final boolean includeEndpointInMetrics; + private final boolean otlpStatsExportEnabled; + + /** + * Cached peer-aggregation schema read by producer threads. + * + *

      Producers read this reference once per trace and store it on each {@link SpanSnapshot}. They + * do not inspect the schema's discovery state or rebuild it. The aggregator thread reconciles the + * schema once per reporting cycle in {@link #resetCardinalityHandlers()}: if feature discovery + * has a new state but the tag set is unchanged, it updates {@link PeerTagSchema#state} in-place + * to preserve the warm cardinality handlers; otherwise it swaps in a freshly-built schema. + * + *

      An empty schema (size 0) represents the "peer tags unconfigured" state; {@code null} only on + * the bootstrap window before {@link #bootstrapPeerTagSchema()} runs on the first publish. + * + *

      {@code volatile} so producer threads always see the latest replacement. The schema's own + * internal mutable state (handlers, block counters, {@link PeerTagSchema#state}) is exercised + * only on the aggregator thread. + */ + private volatile PeerTagSchema cachedPeerTagSchema; + + private volatile AgentTaskScheduler.Scheduled cancellation; + + public ClientStatsAggregator( + Config config, + SharedCommunicationObjects sharedCommunicationObjects, + HealthMetrics healthMetrics) { + this( + config.getWellKnownTags(), + config.getMetricsIgnoredResources(), + sharedCommunicationObjects.featuresDiscovery(config), + healthMetrics, + new OkHttpSink( + sharedCommunicationObjects.agentHttpClient, + sharedCommunicationObjects.agentUrl.toString(), + V06_METRICS_ENDPOINT, + config.isTracerMetricsBufferingEnabled(), + false, + DEFAULT_HEADERS), + config.getTracerMetricsMaxAggregates(), + config.getTracerMetricsMaxPending(), + config.isTraceResourceRenamingEnabled()); + } + + /** + * OTLP span-metrics export variant. Reuses the same span selection + DDSketch aggregation as the + * native path, but emits via the injected {@link OtlpStatsMetricWriter} instead of msgpack. No + * agent {@link Sink} is needed, so a {@link NoOpSink} satisfies the register()/backpressure + * contract, and the reporting interval comes from {@code trace.stats.interval} (milliseconds). + */ + public ClientStatsAggregator( + Config config, + SharedCommunicationObjects sharedCommunicationObjects, + HealthMetrics healthMetrics, + OtlpStatsMetricWriter metricWriter) { + this( + config.getMetricsIgnoredResources(), + sharedCommunicationObjects.featuresDiscovery(config), + healthMetrics, + NoOpSink.INSTANCE, + metricWriter, + config.getTracerMetricsMaxAggregates(), + config.getTracerMetricsMaxPending(), + config.getTraceStatsInterval(), + MILLISECONDS, + true); + } + + ClientStatsAggregator( + WellKnownTags wellKnownTags, + Set ignoredResources, + DDAgentFeaturesDiscovery features, + HealthMetrics healthMetric, + Sink sink, + int maxAggregates, + int queueSize, + boolean includeEndpointInMetrics) { + this( + wellKnownTags, + ignoredResources, + features, + healthMetric, + sink, + maxAggregates, + queueSize, + 10, + SECONDS, + includeEndpointInMetrics); + } + + ClientStatsAggregator( + WellKnownTags wellKnownTags, + Set ignoredResources, + DDAgentFeaturesDiscovery features, + HealthMetrics healthMetric, + Sink sink, + int maxAggregates, + int queueSize, + long reportingInterval, + TimeUnit timeUnit, + boolean includeEndpointInMetrics) { + this( + ignoredResources, + features, + healthMetric, + sink, + new SerializingMetricWriter(wellKnownTags, sink), + maxAggregates, + queueSize, + reportingInterval, + timeUnit, + includeEndpointInMetrics); + } + + ClientStatsAggregator( + Set ignoredResources, + DDAgentFeaturesDiscovery features, + HealthMetrics healthMetric, + Sink sink, + MetricWriter metricWriter, + int maxAggregates, + int queueSize, + long reportingInterval, + TimeUnit timeUnit, + boolean includeEndpointInMetrics) { + this.ignoredResources = ignoredResources; + this.includeEndpointInMetrics = includeEndpointInMetrics; + this.otlpStatsExportEnabled = metricWriter instanceof OtlpStatsMetricWriter; + this.inbox = Queues.mpscArrayQueue(queueSize); + this.features = features; + this.healthMetrics = healthMetric; + this.sink = sink; + this.metricWriter = metricWriter; + this.aggregator = + new Aggregator( + metricWriter, + inbox, + maxAggregates, + reportingInterval, + timeUnit, + healthMetric, + this::resetCardinalityHandlers); + this.thread = newAgentThread(METRICS_AGGREGATOR, aggregator); + this.reportingInterval = reportingInterval; + this.reportingIntervalTimeUnit = timeUnit; + } + + // ── visible for testing ───────────────────────────────────────────────────── + // Expose the writer-selection outcome and reporting cadence so tests can assert + // the native-vs-OTLP XOR choice without reflecting into private fields. + + boolean isOtlpStatsExportEnabled() { + return otlpStatsExportEnabled; + } + + long reportingInterval() { + return reportingInterval; + } + + TimeUnit reportingIntervalTimeUnit() { + return reportingIntervalTimeUnit; + } + + @Override + public void start() { + sink.register(this); + thread.start(); + cancellation = + AgentTaskScheduler.get() + .scheduleAtFixedRate( + new ReportTask(), + this, + reportingInterval, + reportingInterval, + reportingIntervalTimeUnit); + log.debug("started metrics aggregator"); + } + + private boolean statsExportEnabled() { + return otlpStatsExportEnabled || features.supportsMetrics(); + } + + private boolean isMetricsEnabled() { + // The discovery refresh only helps the native path. + if (!otlpStatsExportEnabled && features.getMetricsEndpoint() == null) { + features.discoverIfOutdated(); + } + return statsExportEnabled(); + } + + @Override + public boolean report() { + boolean published; + int attempts = 0; + do { + published = inbox.offer(REPORT); + ++attempts; + } while (!published && attempts < 10); + if (!published) { + log.debug("Skipped metrics reporting because the queue is full"); + } + return published; + } + + @Override + public Future forceReport() { + // Ensure the feature is enabled + if (!isMetricsEnabled()) { + return CompletableFuture.completedFuture(false); + } + // Wait for the thread to start + while (cancellation == null || (cancellation.get() != null && !thread.isAlive())) { + try { + Thread.sleep(10); + } catch (InterruptedException e) { + return CompletableFuture.completedFuture(false); + } + } + // Try to send the report signal + ReportSignal reportSignal = new ReportSignal(); + boolean published = false; + while (thread.isAlive() && !published) { + published = inbox.offer(reportSignal); + if (!published) { + try { + Thread.sleep(10); + } catch (InterruptedException e) { + log.debug("Failed to ask for report"); + break; + } + } + } + if (published) { + return reportSignal.future; + } else { + return CompletableFuture.completedFuture(false); + } + } + + @Override + public boolean publish(List> trace) { + boolean forceKeep = false; + int counted = 0; + if (statsExportEnabled()) { + // Producer-side fast path: one volatile read and use whatever schema is currently cached. + // The aggregator thread keeps this schema in sync with feature discovery in + // resetCardinalityHandlers(). The only producer-side rebuild is the one-time bootstrap on + // the first publish. + PeerTagSchema peerTagSchema = cachedPeerTagSchema; + if (peerTagSchema == null) { + peerTagSchema = bootstrapPeerTagSchema(); + } + for (CoreSpan span : trace) { + boolean isTopLevel = span.isTopLevel(); + if (shouldComputeMetric(span, isTopLevel)) { + final CharSequence resourceName = span.getResourceName(); + if (resourceName != null + && !ignoredResources.isEmpty() + && ignoredResources.contains(resourceName.toString())) { + // skip publishing all children + break; + } + counted++; + forceKeep |= publish(span, isTopLevel, peerTagSchema); + } + } + healthMetrics.onClientStatTraceComputed(counted, trace.size(), !forceKeep); + } + return forceKeep; + } + + private boolean shouldComputeMetric(CoreSpan span, boolean isTopLevel) { + return (span.isMeasured() || isTopLevel || span.isKind(METRICS_ELIGIBLE_KINDS)) + && span.getLongRunningVersion() + <= 0 // either not long-running or unpublished long-running span + && span.getDurationNano() > 0; + } + + private boolean publish(CoreSpan span, boolean isTopLevel, PeerTagSchema peerTagSchema) { + boolean error = span.getError() > 0; + // size() is approximate on jctools MPSC queues but good enough for a fast-path overflow check. + if (inbox.size() >= inbox.capacity()) { + healthMetrics.onStatsInboxFull(); + return error; + } + // Extract HTTP method and endpoint only if the feature is enabled + String httpMethod = null; + String httpEndpoint = null; + if (includeEndpointInMetrics) { + Object httpMethodObj = span.unsafeGetTag(HTTP_METHOD); + httpMethod = httpMethodObj != null ? httpMethodObj.toString() : null; + Object httpEndpointObj = span.unsafeGetTag(HTTP_ENDPOINT); + // OTLP path falls back to http.route (mirrors libdatadog). The native v0.6 path keeps its + // http.endpoint-only lookup so this doesn't change its aggregation key / wire output. + if (otlpStatsExportEnabled && httpEndpointObj == null) { + httpEndpointObj = span.unsafeGetTag(HTTP_ROUTE); + } + httpEndpoint = httpEndpointObj != null ? httpEndpointObj.toString() : null; + } + + CharSequence spanType = span.getType(); + String grpcStatusCode = null; + if (otlpStatsExportEnabled) { + // OTLP path: probe every known gRPC status-code convention, no span-type gate, so a span + // typed "grpc" (or carrying an OTel-style key) still surfaces rpc.response.status_code. + grpcStatusCode = firstTag(span, GRPC_STATUS_CODE_KEYS); + } else if (spanType != null && RPC.contentEquals(spanType)) { + Object grpcStatusObj = span.unsafeGetTag(InstrumentationTags.GRPC_STATUS_CODE); + grpcStatusCode = grpcStatusObj != null ? grpcStatusObj.toString() : null; + } + // DDSpan resolves this from a cached span.kind ordinal via a small lookup array, skipping a + // tag-map lookup. Other CoreSpan impls fall back to the tag map by default. + String spanKind = span.getSpanKindString(); + if (spanKind == null) { + spanKind = ""; + } + + long tagAndDuration = + span.getDurationNano() | (error ? ERROR_TAG : 0L) | (isTopLevel ? TOP_LEVEL_TAG : 0L); + + PeerTagSchema spanPeerTagSchema = peerTagSchemaFor(spanKind, peerTagSchema); + String[] peerTagValues = + spanPeerTagSchema == null ? null : capturePeerTagValues(span, spanPeerTagSchema); + if (peerTagValues == null) { + // capture returned no non-null values -- drop the schema reference so the consumer doesn't + // bother iterating an all-null array. + spanPeerTagSchema = null; + } + + SpanSnapshot snapshot = + new SpanSnapshot( + span.getResourceName(), + span.getServiceName(), + span.getOperationName(), + span.getServiceNameSource(), + spanType, + span.getHttpStatusCode(), + isSynthetic(span), + span.getParentId() == 0, + spanKind, + spanPeerTagSchema, + peerTagValues, + httpMethod, + httpEndpoint, + grpcStatusCode, + tagAndDuration); + if (!inbox.offer(snapshot)) { + healthMetrics.onStatsInboxFull(); + } + // force keep keys if there are errors + return error; + } + + /** Returns the first non-null span tag among {@code keys}, in order, or {@code null} if none. */ + private static String firstTag(CoreSpan span, String[] keys) { + for (String key : keys) { + Object value = span.unsafeGetTag(key); + if (value != null) { + return value.toString(); + } + } + return null; + } + + /** + * One-time producer-side bootstrap of {@link #cachedPeerTagSchema}. Synchronized double-check + * guards against two producers racing on the very first publish; after this returns, {@code + * cachedPeerTagSchema} is non-null forever and the aggregator thread is the sole subsequent + * mutator (see {@link #reconcilePeerTagSchema()}). + */ + private synchronized PeerTagSchema bootstrapPeerTagSchema() { + PeerTagSchema cached = cachedPeerTagSchema; + if (cached != null) { + return cached; + } + PeerTagSchema schema = buildPeerTagSchema(); + cachedPeerTagSchema = schema; + return schema; + } + + /** + * Builds a fresh {@link PeerTagSchema} from the current state of feature discovery. + * + *

      Read order matters: {@code DDAgentFeaturesDiscovery} exposes {@code peerTags()} and {@code + * state()} as two separate accessors, each reading its volatile {@code discoveryState} + * independently. If a discovery refresh interleaves between the two reads, we want to be left + * with a schema whose embedded state is *stale* relative to its tag set rather than the other way + * around -- that way the next reconcile sees a state mismatch and re-runs the deep compare to + * pick up the change, instead of short-circuiting on a too-fresh state and missing it. + * + *

      So read {@code state()} first, then {@code peerTags()}. + */ + private PeerTagSchema buildPeerTagSchema() { + String state = features.state(); + Set names = features.peerTags(); + return PeerTagSchema.of(names == null ? Collections.emptySet() : names, state); + } + + /** + * Single reset hook invoked on the aggregator thread at the end of each report cycle. Reconciles + * the cached peer-tag schema against the latest feature discovery, then resets all cardinality + * state in lockstep: the static property handlers, {@code PeerTagSchema.INTERNAL}, and the cached + * peer-tag schema. New handlers added anywhere in this pipeline should be reset from here. + */ + private void resetCardinalityHandlers() { + reconcilePeerTagSchema(); + for (PropertyCardinalityHandler handler : AggregateEntry.FIELD_HANDLERS) { + long blocked = handler.reset(); + if (blocked > 0) { + log.warn( + "Cardinality limit reached for stats field '{}'; further values will be reported as tracer_blocked_value", + handler.name); + healthMetrics.onTagCardinalityBlocked(handler.statsDTag(), blocked); + } + } + resetPeerTagSchema(PeerTagSchema.INTERNAL); + PeerTagSchema schema = cachedPeerTagSchema; + if (schema != null) { + resetPeerTagSchema(schema); + } + } + + private void resetPeerTagSchema(PeerTagSchema schema) { + for (int i = 0; i < schema.handlers.length; i++) { + long blocked = schema.handlers[i].reset(); + if (blocked > 0) { + log.warn( + "Cardinality limit reached for peer tag '{}'; further values are reported as" + + " 'tracer_blocked_value' until the next reporting cycle", + schema.names[i]); + healthMetrics.onTagCardinalityBlocked(schema.handlers[i].statsDTag(), blocked); + } + } + } + + /** + * Reconciles {@link #cachedPeerTagSchema} with the latest feature discovery. Runs on the + * aggregator thread once per reporting cycle via the reset hook passed to {@link Aggregator}. + * Cheap fast path: an equality check against the cached schema's embedded {@link + * DDAgentFeaturesDiscovery#state()} hash short-circuits when discovery's response hasn't changed + * since the schema was built. On mismatch, a set compare distinguishes "discovery response + * changed but peer tags are the same" (just update the cached state in place to preserve the warm + * cardinality handlers) from "tags actually changed" (build a new schema and swap the volatile + * reference). + */ + private void reconcilePeerTagSchema() { + PeerTagSchema cached = cachedPeerTagSchema; + if (cached == null) { + // First reset before the first publish -- producer-side bootstrap hasn't run yet. + return; + } + String latestState = features.state(); + if (Objects.equals(cached.state, latestState)) { + return; + } + Set latestNames = features.peerTags(); + Set normalized = latestNames == null ? Collections.emptySet() : latestNames; + if (cached.hasSameTagsAs(normalized)) { + cached.state = latestState; + } else { + // Tags actually changed: flush the outgoing schema's accumulated block telemetry before + // discarding it, otherwise the partial-cycle blockedCounts would silently disappear. + resetPeerTagSchema(cached); + cachedPeerTagSchema = PeerTagSchema.of(normalized, latestState); + } + } + + /** + * Picks the peer-tag schema for a span. The {@code peerTagSchema} argument is the per-trace + * cached schema (read once in {@link #publish(List)} via the volatile {@link + * #cachedPeerTagSchema}, with {@link #bootstrapPeerTagSchema()} taking care of the first-publish + * window) -- always non-null but possibly empty when peer tags are unconfigured. For + * internal-kind spans the static {@link PeerTagSchema#INTERNAL} schema is used regardless. + */ + private static PeerTagSchema peerTagSchemaFor(String spanKind, PeerTagSchema peerTagSchema) { + if (peerTagSchema.size() > 0 && PEER_AGGREGATION_KINDS.matches(spanKind)) { + return peerTagSchema; + } + if (INTERNAL_KIND.matches(spanKind)) { + return PeerTagSchema.INTERNAL; + } + return null; + } + + /** + * Captures the span's peer tag values into a {@code String[]} parallel to {@code schema.names}. + * Returns {@code null} when none of the configured peer tags are set on the span. + */ + private static String[] capturePeerTagValues(CoreSpan span, PeerTagSchema schema) { + String[] names = schema.names; + int n = names.length; + String[] values = null; + for (int i = 0; i < n; i++) { + Object v = span.unsafeGetTag(names[i]); + if (v != null) { + if (values == null) { + values = new String[n]; + } + values[i] = v.toString(); + } + } + return values; + } + + private static boolean isSynthetic(CoreSpan span) { + CharSequence origin = span.getOrigin(); + return origin != null && SYNTHETICS_ORIGIN.contentEquals(origin); + } + + public void stop() { + if (null != cancellation) { + cancellation.cancel(); + } + inbox.offer(STOP); + } + + @Override + public void close() { + stop(); + try { + thread.join(THREAD_JOIN_TIMOUT_MS); + } catch (InterruptedException ignored) { + } + // The OTLP stats writer owns a dedicated OTLP sender. Evict it now that the aggregator thread + // has stopped, so no in-flight finishBucket() flush is still using the sender. + if (metricWriter instanceof OtlpStatsMetricWriter) { + ((OtlpStatsMetricWriter) metricWriter).shutdown(); + } + } + + @Override + public void onEvent(EventType eventType, String message) { + healthMetrics.onClientStatPayloadSent(); + switch (eventType) { + case DOWNGRADED: + log.debug("Agent downgrade was detected"); + disable(); + healthMetrics.onClientStatDowngraded(); + break; + case BAD_PAYLOAD: + log.debug("bad metrics payload sent to trace agent: {}", message); + healthMetrics.onClientStatErrorReceived(); + break; + case ERROR: + log.debug("trace agent errored receiving metrics payload: {}", message); + healthMetrics.onClientStatErrorReceived(); + break; + default: + break; + } + } + + private void disable() { + features.discover(); + if (!features.supportsMetrics()) { + log.debug("Disabling metric reporting because an agent downgrade was detected"); + // Route the clear through the inbox so the aggregator thread is the only writer. + // AggregateTable is not thread-safe; mutating it directly from this thread would race + // with Drainer.accept on the aggregator thread. + // + // Best-effort single offer rather than the retry-loop pattern in report(). If the inbox is + // full at downgrade time the clear is dropped, but the system self-heals: features.discover() + // already flipped supportsMetrics() false, so producer publish() calls now skip the inbox; + // the aggregator drains existing snapshots and ships them on the next report cycle; the + // sink rejects that payload and fires DOWNGRADED again, which retries disable() against a + // now-empty inbox. Worst case: one extra reporting cycle of stale data. + inbox.offer(CLEAR); + } + } + + private static final class ReportTask implements AgentTaskScheduler.Task { + + @Override + public void run(ClientStatsAggregator target) { + target.report(); + } + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/common/metrics/ConflatingMetricsAggregator.java b/dd-trace-core/src/main/java/datadog/trace/common/metrics/ConflatingMetricsAggregator.java deleted file mode 100644 index f60edf1d700..00000000000 --- a/dd-trace-core/src/main/java/datadog/trace/common/metrics/ConflatingMetricsAggregator.java +++ /dev/null @@ -1,485 +0,0 @@ -package datadog.trace.common.metrics; - -import static datadog.communication.ddagent.DDAgentFeaturesDiscovery.V06_METRICS_ENDPOINT; -import static datadog.trace.api.DDSpanTypes.RPC; -import static datadog.trace.api.DDTags.BASE_SERVICE; -import static datadog.trace.api.Functions.UTF8_ENCODE; -import static datadog.trace.bootstrap.instrumentation.api.Tags.HTTP_ENDPOINT; -import static datadog.trace.bootstrap.instrumentation.api.Tags.HTTP_METHOD; -import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND; -import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_CLIENT; -import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_CONSUMER; -import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_INTERNAL; -import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_PRODUCER; -import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_SERVER; -import static datadog.trace.common.metrics.AggregateMetric.ERROR_TAG; -import static datadog.trace.common.metrics.AggregateMetric.TOP_LEVEL_TAG; -import static datadog.trace.common.metrics.SignalItem.ReportSignal.REPORT; -import static datadog.trace.common.metrics.SignalItem.StopSignal.STOP; -import static datadog.trace.util.AgentThreadFactory.AgentThread.METRICS_AGGREGATOR; -import static datadog.trace.util.AgentThreadFactory.THREAD_JOIN_TIMOUT_MS; -import static datadog.trace.util.AgentThreadFactory.newAgentThread; -import static java.util.Collections.unmodifiableSet; -import static java.util.concurrent.TimeUnit.SECONDS; - -import datadog.common.queue.Queues; -import datadog.communication.ddagent.DDAgentFeaturesDiscovery; -import datadog.communication.ddagent.SharedCommunicationObjects; -import datadog.trace.api.Config; -import datadog.trace.api.Pair; -import datadog.trace.api.WellKnownTags; -import datadog.trace.api.cache.DDCache; -import datadog.trace.api.cache.DDCaches; -import datadog.trace.bootstrap.instrumentation.api.InstrumentationTags; -import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; -import datadog.trace.common.metrics.SignalItem.ReportSignal; -import datadog.trace.common.writer.ddagent.DDAgentApi; -import datadog.trace.core.CoreSpan; -import datadog.trace.core.DDTraceCoreInfo; -import datadog.trace.core.monitor.HealthMetrics; -import datadog.trace.util.AgentTaskScheduler; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; -import java.util.function.Function; -import javax.annotation.Nonnull; -import org.jctools.queues.MessagePassingQueue; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public final class ConflatingMetricsAggregator implements MetricsAggregator, EventListener { - - private static final Logger log = LoggerFactory.getLogger(ConflatingMetricsAggregator.class); - - private static final Map DEFAULT_HEADERS = - Collections.singletonMap(DDAgentApi.DATADOG_META_TRACER_VERSION, DDTraceCoreInfo.VERSION); - - private static final DDCache SERVICE_NAMES = - DDCaches.newFixedSizeCache(32); - - private static final DDCache SPAN_KINDS = - DDCaches.newFixedSizeCache(16); - private static final DDCache< - String, Pair, Function>> - PEER_TAGS_CACHE = - DDCaches.newFixedSizeCache( - 64); // it can be unbounded since those values are returned by the agent and should be - // under control. 64 entries is enough in this case to contain all the peer tags. - private static final Function< - String, Pair, Function>> - PEER_TAGS_CACHE_ADDER = - key -> - Pair.of( - DDCaches.newFixedSizeCache(512), - value -> UTF8BytesString.create(key + ":" + value)); - private static final CharSequence SYNTHETICS_ORIGIN = "synthetics"; - - private static final Set ELIGIBLE_SPAN_KINDS_FOR_METRICS = - unmodifiableSet( - new HashSet<>( - Arrays.asList( - SPAN_KIND_SERVER, SPAN_KIND_CLIENT, SPAN_KIND_CONSUMER, SPAN_KIND_PRODUCER))); - - private static final Set ELIGIBLE_SPAN_KINDS_FOR_PEER_AGGREGATION = - unmodifiableSet( - new HashSet<>(Arrays.asList(SPAN_KIND_CLIENT, SPAN_KIND_PRODUCER, SPAN_KIND_CONSUMER))); - - private final Set ignoredResources; - private final MessagePassingQueue batchPool; - private final ConcurrentHashMap pending; - private final ConcurrentHashMap keys; - private final Thread thread; - private final MessagePassingQueue inbox; - private final Sink sink; - private final Aggregator aggregator; - private final long reportingInterval; - private final TimeUnit reportingIntervalTimeUnit; - private final DDAgentFeaturesDiscovery features; - private final HealthMetrics healthMetrics; - private final boolean includeEndpointInMetrics; - - private volatile AgentTaskScheduler.Scheduled cancellation; - - public ConflatingMetricsAggregator( - Config config, - SharedCommunicationObjects sharedCommunicationObjects, - HealthMetrics healthMetrics) { - this( - config.getWellKnownTags(), - config.getMetricsIgnoredResources(), - sharedCommunicationObjects.featuresDiscovery(config), - healthMetrics, - new OkHttpSink( - sharedCommunicationObjects.agentHttpClient, - sharedCommunicationObjects.agentUrl.toString(), - V06_METRICS_ENDPOINT, - config.isTracerMetricsBufferingEnabled(), - false, - DEFAULT_HEADERS), - config.getTracerMetricsMaxAggregates(), - config.getTracerMetricsMaxPending(), - config.isTraceResourceRenamingEnabled()); - } - - ConflatingMetricsAggregator( - WellKnownTags wellKnownTags, - Set ignoredResources, - DDAgentFeaturesDiscovery features, - HealthMetrics healthMetric, - Sink sink, - int maxAggregates, - int queueSize, - boolean includeEndpointInMetrics) { - this( - wellKnownTags, - ignoredResources, - features, - healthMetric, - sink, - maxAggregates, - queueSize, - 10, - SECONDS, - includeEndpointInMetrics); - } - - ConflatingMetricsAggregator( - WellKnownTags wellKnownTags, - Set ignoredResources, - DDAgentFeaturesDiscovery features, - HealthMetrics healthMetric, - Sink sink, - int maxAggregates, - int queueSize, - long reportingInterval, - TimeUnit timeUnit, - boolean includeEndpointInMetrics) { - this( - ignoredResources, - features, - healthMetric, - sink, - new SerializingMetricWriter(wellKnownTags, sink), - maxAggregates, - queueSize, - reportingInterval, - timeUnit, - includeEndpointInMetrics); - } - - ConflatingMetricsAggregator( - Set ignoredResources, - DDAgentFeaturesDiscovery features, - HealthMetrics healthMetric, - Sink sink, - MetricWriter metricWriter, - int maxAggregates, - int queueSize, - long reportingInterval, - TimeUnit timeUnit, - boolean includeEndpointInMetrics) { - this.ignoredResources = ignoredResources; - this.includeEndpointInMetrics = includeEndpointInMetrics; - this.inbox = Queues.mpscArrayQueue(queueSize); - this.batchPool = Queues.spmcArrayQueue(maxAggregates); - this.pending = new ConcurrentHashMap<>(maxAggregates * 4 / 3); - this.keys = new ConcurrentHashMap<>(); - this.features = features; - this.healthMetrics = healthMetric; - this.sink = sink; - this.aggregator = - new Aggregator( - metricWriter, - batchPool, - inbox, - pending, - keys.keySet(), - maxAggregates, - reportingInterval, - timeUnit, - healthMetric); - this.thread = newAgentThread(METRICS_AGGREGATOR, aggregator); - this.reportingInterval = reportingInterval; - this.reportingIntervalTimeUnit = timeUnit; - } - - @Override - public void start() { - sink.register(this); - thread.start(); - cancellation = - AgentTaskScheduler.get() - .scheduleAtFixedRate( - new ReportTask(), - this, - reportingInterval, - reportingInterval, - reportingIntervalTimeUnit); - log.debug("started metrics aggregator"); - } - - private boolean isMetricsEnabled() { - if (features.getMetricsEndpoint() == null) { - features.discoverIfOutdated(); - } - return features.supportsMetrics(); - } - - @Override - public boolean report() { - boolean published; - int attempts = 0; - do { - published = inbox.offer(REPORT); - ++attempts; - } while (!published && attempts < 10); - if (!published) { - log.debug("Skipped metrics reporting because the queue is full"); - } - return published; - } - - @Override - public Future forceReport() { - // Ensure the feature is enabled - if (!isMetricsEnabled()) { - return CompletableFuture.completedFuture(false); - } - // Wait for the thread to start - while (cancellation == null || (cancellation.get() != null && !thread.isAlive())) { - try { - Thread.sleep(10); - } catch (InterruptedException e) { - return CompletableFuture.completedFuture(false); - } - } - // Try to send the report signal - ReportSignal reportSignal = new ReportSignal(); - boolean published = false; - while (thread.isAlive() && !published) { - published = inbox.offer(reportSignal); - if (!published) { - try { - Thread.sleep(10); - } catch (InterruptedException e) { - log.debug("Failed to ask for report"); - break; - } - } - } - if (published) { - return reportSignal.future; - } else { - return CompletableFuture.completedFuture(false); - } - } - - @Override - public boolean publish(List> trace) { - boolean forceKeep = false; - int counted = 0; - if (features.supportsMetrics()) { - for (CoreSpan span : trace) { - boolean isTopLevel = span.isTopLevel(); - final CharSequence spanKind = span.unsafeGetTag(SPAN_KIND, ""); - if (shouldComputeMetric(span, spanKind)) { - final CharSequence resourceName = span.getResourceName(); - if (resourceName != null && ignoredResources.contains(resourceName.toString())) { - // skip publishing all children - forceKeep = false; - break; - } - counted++; - forceKeep |= publish(span, isTopLevel, spanKind); - } - } - healthMetrics.onClientStatTraceComputed(counted, trace.size(), !forceKeep); - } - return forceKeep; - } - - private boolean shouldComputeMetric(CoreSpan span, @Nonnull CharSequence spanKind) { - return (span.isMeasured() || span.isTopLevel() || spanKindEligible(spanKind)) - && span.getLongRunningVersion() - <= 0 // either not long-running or unpublished long-running span - && span.getDurationNano() > 0; - } - - private boolean spanKindEligible(@Nonnull CharSequence spanKind) { - // use toString since it could be a CharSequence... - return ELIGIBLE_SPAN_KINDS_FOR_METRICS.contains(spanKind.toString()); - } - - private boolean publish(CoreSpan span, boolean isTopLevel, CharSequence spanKind) { - // Extract HTTP method and endpoint only if the feature is enabled - String httpMethod = null; - String httpEndpoint = null; - if (includeEndpointInMetrics) { - Object httpMethodObj = span.unsafeGetTag(HTTP_METHOD); - httpMethod = httpMethodObj != null ? httpMethodObj.toString() : null; - Object httpEndpointObj = span.unsafeGetTag(HTTP_ENDPOINT); - httpEndpoint = httpEndpointObj != null ? httpEndpointObj.toString() : null; - } - - CharSequence spanType = span.getType(); - String grpcStatusCode = null; - if (spanType != null && RPC.contentEquals(spanType)) { - Object grpcStatusObj = span.unsafeGetTag(InstrumentationTags.GRPC_STATUS_CODE); - grpcStatusCode = grpcStatusObj != null ? grpcStatusObj.toString() : null; - } - MetricKey newKey = - new MetricKey( - span.getResourceName(), - SERVICE_NAMES.computeIfAbsent(span.getServiceName(), UTF8_ENCODE), - span.getOperationName(), - span.getServiceNameSource(), - spanType, - span.getHttpStatusCode(), - isSynthetic(span), - span.getParentId() == 0, - SPAN_KINDS.computeIfAbsent( - spanKind, UTF8BytesString::create), // save repeated utf8 conversions - getPeerTags(span, spanKind.toString()), - httpMethod, - httpEndpoint, - grpcStatusCode); - MetricKey key = keys.putIfAbsent(newKey, newKey); - if (null == key) { - key = newKey; - } - long tag = (span.getError() > 0 ? ERROR_TAG : 0L) | (isTopLevel ? TOP_LEVEL_TAG : 0L); - long durationNanos = span.getDurationNano(); - Batch batch = pending.get(key); - if (null != batch) { - // there is a pending batch, try to win the race to add to it - // returning false means that either the batch can't take any - // more data, or it has already been consumed - if (batch.add(tag, durationNanos)) { - // added to a pending batch prior to consumption, - // so skip publishing to the queue (we also know - // the key isn't rare enough to override the sampler) - return false; - } - // recycle the older key - key = batch.getKey(); - } - batch = newBatch(key); - batch.add(tag, durationNanos); - // overwrite the last one if present, it was already full - // or had been consumed by the time we tried to add to it - pending.put(key, batch); - // must offer to the queue after adding to pending - inbox.offer(batch); - // force keep keys if there are errors - return span.getError() > 0; - } - - private List getPeerTags(CoreSpan span, String spanKind) { - if (ELIGIBLE_SPAN_KINDS_FOR_PEER_AGGREGATION.contains(spanKind)) { - final Set eligiblePeerTags = features.peerTags(); - List peerTags = new ArrayList<>(eligiblePeerTags.size()); - for (String peerTag : eligiblePeerTags) { - Object value = span.unsafeGetTag(peerTag); - if (value != null) { - final Pair, Function> - cacheAndCreator = PEER_TAGS_CACHE.computeIfAbsent(peerTag, PEER_TAGS_CACHE_ADDER); - peerTags.add( - cacheAndCreator - .getLeft() - .computeIfAbsent(value.toString(), cacheAndCreator.getRight())); - } - } - return peerTags; - } else if (SPAN_KIND_INTERNAL.equals(spanKind)) { - // in this case only the base service should be aggregated if present - final Object baseService = span.unsafeGetTag(BASE_SERVICE); - if (baseService != null) { - final Pair, Function> - cacheAndCreator = PEER_TAGS_CACHE.computeIfAbsent(BASE_SERVICE, PEER_TAGS_CACHE_ADDER); - return Collections.singletonList( - cacheAndCreator - .getLeft() - .computeIfAbsent(baseService.toString(), cacheAndCreator.getRight())); - } - } - return Collections.emptyList(); - } - - private static boolean isSynthetic(CoreSpan span) { - return span.getOrigin() != null && SYNTHETICS_ORIGIN.equals(span.getOrigin().toString()); - } - - private Batch newBatch(MetricKey key) { - Batch batch = batchPool.poll(); - if (null == batch) { - return new Batch(key); - } - return batch.reset(key); - } - - public void stop() { - if (null != cancellation) { - cancellation.cancel(); - } - inbox.offer(STOP); - } - - @Override - public void close() { - stop(); - try { - thread.join(THREAD_JOIN_TIMOUT_MS); - } catch (InterruptedException ignored) { - } - } - - @Override - public void onEvent(EventType eventType, String message) { - healthMetrics.onClientStatPayloadSent(); - switch (eventType) { - case DOWNGRADED: - log.debug("Agent downgrade was detected"); - disable(); - healthMetrics.onClientStatDowngraded(); - break; - case BAD_PAYLOAD: - log.debug("bad metrics payload sent to trace agent: {}", message); - healthMetrics.onClientStatErrorReceived(); - break; - case ERROR: - log.debug("trace agent errored receiving metrics payload: {}", message); - healthMetrics.onClientStatErrorReceived(); - break; - default: - break; - } - } - - private void disable() { - features.discover(); - if (!features.supportsMetrics()) { - log.debug("Disabling metric reporting because an agent downgrade was detected"); - this.pending.clear(); - this.batchPool.clear(); - this.inbox.clear(); - this.aggregator.clearAggregates(); - } - } - - private static final class ReportTask - implements AgentTaskScheduler.Task { - - @Override - public void run(ConflatingMetricsAggregator target) { - target.report(); - } - } -} diff --git a/dd-trace-core/src/main/java/datadog/trace/common/metrics/InboxItem.java b/dd-trace-core/src/main/java/datadog/trace/common/metrics/InboxItem.java index 7d66cad6a15..e7c37f91768 100644 --- a/dd-trace-core/src/main/java/datadog/trace/common/metrics/InboxItem.java +++ b/dd-trace-core/src/main/java/datadog/trace/common/metrics/InboxItem.java @@ -4,6 +4,17 @@ interface InboxItem {} +/** + * Inbox-routed control message. Each subclass exposes a process-wide {@code static final} singleton + * ({@link StopSignal#STOP}, {@link ReportSignal#REPORT}, {@link ClearSignal#CLEAR}) for the common + * fire-and-forget case and is also directly instantiable when a caller needs to await handling. + * + *

      Singletons are fire-and-forget. The inherited {@link #future} is completed on first + * handling by the aggregator thread and never reset, so a second posting of the same singleton + * cannot signal completion to a fresh awaiter -- the future is already done. Callers that want + * one-shot completion semantics (e.g. {@code forceReport()}) must allocate a fresh instance ({@code + * new ReportSignal()}) rather than reusing the singleton. + */ abstract class SignalItem implements InboxItem { final CompletableFuture future; @@ -20,12 +31,26 @@ void ignore() { } static final class StopSignal extends SignalItem { + /** Fire-and-forget singleton. See class-level note on {@link SignalItem}. */ static final StopSignal STOP = new StopSignal(); private StopSignal() {} } static final class ReportSignal extends SignalItem { + /** Fire-and-forget singleton; {@code forceReport()} allocates fresh instances. */ static final ReportSignal REPORT = new ReportSignal(); } + + /** + * Posted from arbitrary threads (e.g. the Sink event thread during agent downgrade) so the + * aggregator thread is the one that actually performs the table reset. Keeps {@link + * AggregateTable} and {@code inbox.clear()} single-writer. + */ + static final class ClearSignal extends SignalItem { + /** Fire-and-forget singleton. See class-level note on {@link SignalItem}. */ + static final ClearSignal CLEAR = new ClearSignal(); + + private ClearSignal() {} + } } diff --git a/dd-trace-core/src/main/java/datadog/trace/common/metrics/MetricCardinalityLimits.java b/dd-trace-core/src/main/java/datadog/trace/common/metrics/MetricCardinalityLimits.java new file mode 100644 index 00000000000..6a679e98133 --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/common/metrics/MetricCardinalityLimits.java @@ -0,0 +1,74 @@ +package datadog.trace.common.metrics; + +/** + * Per-field limits for distinct metric-key values seen during one reporting cycle. When a field + * exceeds its limit, additional values are replaced with {@code tracer_blocked_value} so they share + * one aggregate row instead of creating more rows in the table. + * + *

      Values are sized to the typical-service workload with headroom; "typical" estimates are noted + * inline. Raise if a workload routinely hits the sentinel; lower carries proportional memory + * savings but risks suppressing legitimate distinctions. + */ +final class MetricCardinalityLimits { + private MetricCardinalityLimits() {} + + /** + * Distinct {@code resource.name} values per cycle. Highest-cardinality field by far: DB-query + * obfuscations, HTTP route templates, custom resources. Typical service: 30-200 unique; 1024 + * leaves headroom for high-cardinality SQL/HTTP workloads without risking premature collapse. + */ + static final int RESOURCE = 1024; + + /** + * Distinct {@code service.name} values per cycle. Local service plus downstream peer-service + * names. Microservice meshes typically reference 10-50 distinct services. + */ + static final int SERVICE = 32; + + /** + * Distinct {@code operation.name} values per cycle. Names like {@code http.request}, {@code + * db.query}, etc. Typical service: 10-30 across integrations. + */ + static final int OPERATION = 64; + + /** + * Distinct {@code _dd.base_service} override values per cycle. Used rarely; usually empty or one + * of a handful per service. + */ + static final int SERVICE_SOURCE = 16; + + /** + * Distinct {@code span.type} values per cycle. {@code DDSpanTypes} catalog is ~30; a single + * service usually spans 5-10 integration types. + */ + static final int TYPE = 16; + + /** + * Distinct {@code span.kind} values per cycle. OTel defines exactly 5 (server/client/producer/ + * consumer/internal); 8 still leaves 60% headroom in case a producer invents new kinds. + */ + static final int SPAN_KIND = 8; + + /** + * Distinct HTTP method values per cycle. Standard verbs are 7-9; WebDAV/custom adds a few more. + */ + static final int HTTP_METHOD = 16; + + /** + * Distinct {@code http.endpoint} values per cycle. Path templates -- same shape as {@code + * RESOURCE} for HTTP-heavy services. Only used when {@code includeEndpointInMetrics} is enabled. + */ + static final int HTTP_ENDPOINT = 512; + + /** + * Distinct gRPC status code values per cycle. gRPC spec defines exactly 17 codes (0-16); 24 + * leaves headroom for unknown-code edge cases without wasting space. + */ + static final int GRPC_STATUS_CODE = 24; + + /** + * Distinct values per peer-tag name (e.g. distinct {@code peer.hostname} values). Each configured + * peer tag gets its own handler at this limit. + */ + static final int PEER_TAG_VALUE = 512; +} diff --git a/dd-trace-core/src/main/java/datadog/trace/common/metrics/MetricKey.java b/dd-trace-core/src/main/java/datadog/trace/common/metrics/MetricKey.java deleted file mode 100644 index 9e2e2098d1f..00000000000 --- a/dd-trace-core/src/main/java/datadog/trace/common/metrics/MetricKey.java +++ /dev/null @@ -1,178 +0,0 @@ -package datadog.trace.common.metrics; - -import static datadog.trace.bootstrap.instrumentation.api.UTF8BytesString.EMPTY; - -import datadog.trace.api.cache.DDCache; -import datadog.trace.api.cache.DDCaches; -import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; -import datadog.trace.util.HashingUtils; -import java.util.Collections; -import java.util.List; -import java.util.Objects; - -/** The aggregation key for tracked metrics. */ -public final class MetricKey { - static final DDCache RESOURCE_CACHE = DDCaches.newFixedSizeCache(32); - static final DDCache SERVICE_CACHE = DDCaches.newFixedSizeCache(8); - static final DDCache SERVICE_SOURCE_CACHE = - DDCaches.newFixedSizeCache(16); - static final DDCache OPERATION_CACHE = DDCaches.newFixedSizeCache(64); - static final DDCache TYPE_CACHE = DDCaches.newFixedSizeCache(8); - static final DDCache KIND_CACHE = DDCaches.newFixedSizeCache(8); - static final DDCache HTTP_METHOD_CACHE = DDCaches.newFixedSizeCache(8); - static final DDCache HTTP_ENDPOINT_CACHE = - DDCaches.newFixedSizeCache(32); - static final DDCache GRPC_STATUS_CODE_CACHE = - DDCaches.newFixedSizeCache(32); - - private final UTF8BytesString resource; - private final UTF8BytesString service; - private final UTF8BytesString serviceSource; - private final UTF8BytesString operationName; - private final UTF8BytesString type; - private final int httpStatusCode; - private final boolean synthetics; - private final int hash; - private final boolean isTraceRoot; - private final UTF8BytesString spanKind; - private final List peerTags; - private final UTF8BytesString httpMethod; - private final UTF8BytesString httpEndpoint; - private final UTF8BytesString grpcStatusCode; - - public MetricKey( - CharSequence resource, - CharSequence service, - CharSequence operationName, - CharSequence serviceSource, - CharSequence type, - int httpStatusCode, - boolean synthetics, - boolean isTraceRoot, - CharSequence spanKind, - List peerTags, - CharSequence httpMethod, - CharSequence httpEndpoint, - CharSequence grpcStatusCode) { - this.resource = null == resource ? EMPTY : utf8(RESOURCE_CACHE, resource); - this.service = null == service ? EMPTY : utf8(SERVICE_CACHE, service); - this.serviceSource = null == serviceSource ? null : utf8(SERVICE_SOURCE_CACHE, serviceSource); - this.operationName = null == operationName ? EMPTY : utf8(OPERATION_CACHE, operationName); - this.type = null == type ? EMPTY : utf8(TYPE_CACHE, type); - this.httpStatusCode = httpStatusCode; - this.synthetics = synthetics; - this.isTraceRoot = isTraceRoot; - this.spanKind = null == spanKind ? EMPTY : utf8(KIND_CACHE, spanKind); - this.peerTags = peerTags == null ? Collections.emptyList() : peerTags; - this.httpMethod = httpMethod == null ? null : utf8(HTTP_METHOD_CACHE, httpMethod); - this.httpEndpoint = httpEndpoint == null ? null : utf8(HTTP_ENDPOINT_CACHE, httpEndpoint); - this.grpcStatusCode = - grpcStatusCode == null ? null : utf8(GRPC_STATUS_CODE_CACHE, grpcStatusCode); - - int tmpHash = 0; - tmpHash = HashingUtils.addToHash(tmpHash, this.isTraceRoot); - tmpHash = HashingUtils.addToHash(tmpHash, this.spanKind); - tmpHash = HashingUtils.addToHash(tmpHash, this.peerTags); - tmpHash = HashingUtils.addToHash(tmpHash, this.resource); - tmpHash = HashingUtils.addToHash(tmpHash, this.service); - tmpHash = HashingUtils.addToHash(tmpHash, this.operationName); - tmpHash = HashingUtils.addToHash(tmpHash, this.type); - tmpHash = HashingUtils.addToHash(tmpHash, this.httpStatusCode); - tmpHash = HashingUtils.addToHash(tmpHash, this.synthetics); - tmpHash = HashingUtils.addToHash(tmpHash, this.serviceSource); - tmpHash = HashingUtils.addToHash(tmpHash, this.httpEndpoint); - tmpHash = HashingUtils.addToHash(tmpHash, this.httpMethod); - tmpHash = HashingUtils.addToHash(tmpHash, this.grpcStatusCode); - this.hash = tmpHash; - } - - static UTF8BytesString utf8(DDCache cache, CharSequence charSeq) { - if (charSeq instanceof UTF8BytesString) { - return (UTF8BytesString) charSeq; - } else { - return cache.computeIfAbsent(charSeq.toString(), UTF8BytesString::create); - } - } - - public UTF8BytesString getResource() { - return resource; - } - - public UTF8BytesString getService() { - return service; - } - - public UTF8BytesString getServiceSource() { - return serviceSource; - } - - public UTF8BytesString getOperationName() { - return operationName; - } - - public UTF8BytesString getType() { - return type; - } - - public int getHttpStatusCode() { - return httpStatusCode; - } - - public boolean isSynthetics() { - return synthetics; - } - - public boolean isTraceRoot() { - return isTraceRoot; - } - - public UTF8BytesString getSpanKind() { - return spanKind; - } - - public List getPeerTags() { - return peerTags; - } - - public UTF8BytesString getHttpMethod() { - return httpMethod; - } - - public UTF8BytesString getHttpEndpoint() { - return httpEndpoint; - } - - public UTF8BytesString getGrpcStatusCode() { - return grpcStatusCode; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if ((o instanceof MetricKey)) { - MetricKey metricKey = (MetricKey) o; - return hash == metricKey.hash - && synthetics == metricKey.synthetics - && httpStatusCode == metricKey.httpStatusCode - && resource.equals(metricKey.resource) - && service.equals(metricKey.service) - && operationName.equals(metricKey.operationName) - && type.equals(metricKey.type) - && isTraceRoot == metricKey.isTraceRoot - && spanKind.equals(metricKey.spanKind) - && peerTags.equals(metricKey.peerTags) - && Objects.equals(serviceSource, metricKey.serviceSource) - && Objects.equals(httpMethod, metricKey.httpMethod) - && Objects.equals(httpEndpoint, metricKey.httpEndpoint) - && Objects.equals(grpcStatusCode, metricKey.grpcStatusCode); - } - return false; - } - - @Override - public int hashCode() { - return hash; - } -} diff --git a/dd-trace-core/src/main/java/datadog/trace/common/metrics/MetricWriter.java b/dd-trace-core/src/main/java/datadog/trace/common/metrics/MetricWriter.java index fa26ed2e5db..905ba498760 100644 --- a/dd-trace-core/src/main/java/datadog/trace/common/metrics/MetricWriter.java +++ b/dd-trace-core/src/main/java/datadog/trace/common/metrics/MetricWriter.java @@ -3,7 +3,11 @@ public interface MetricWriter { void startBucket(int metricCount, long start, long duration); - void add(MetricKey key, AggregateMetric aggregate); + /** + * Serialize one aggregate. The {@link AggregateEntry} carries both the label fields (resource, + * service, span.kind, peer tags, etc.) and the counters being reported. + */ + void add(AggregateEntry entry); void finishBucket(); diff --git a/dd-trace-core/src/main/java/datadog/trace/common/metrics/MetricsAggregatorFactory.java b/dd-trace-core/src/main/java/datadog/trace/common/metrics/MetricsAggregatorFactory.java index 09464310113..afd25d9566a 100644 --- a/dd-trace-core/src/main/java/datadog/trace/common/metrics/MetricsAggregatorFactory.java +++ b/dd-trace-core/src/main/java/datadog/trace/common/metrics/MetricsAggregatorFactory.java @@ -1,8 +1,12 @@ package datadog.trace.common.metrics; +import static datadog.trace.api.config.OtlpConfig.METRICS_OTEL_EXPORTER; +import static datadog.trace.api.config.OtlpConfig.OTEL_TRACES_SPAN_METRICS_ENABLED; + import datadog.communication.ddagent.SharedCommunicationObjects; import datadog.trace.api.Config; import datadog.trace.core.monitor.HealthMetrics; +import datadog.trace.core.otlp.metrics.OtlpStatsMetricWriter; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -13,9 +17,36 @@ public static MetricsAggregator createMetricsAggregator( Config config, SharedCommunicationObjects sharedCommunicationObjects, HealthMetrics healthMetrics) { + // OTLP span-metrics export and native msgpack stats are mutually exclusive (XOR): both hang off + // the same ClientStatsAggregator span selection + DDSketch aggregation, differing only in + // the injected MetricWriter. + if (config.isOtelTracesSpanMetricsEnabled()) { + if (config.isTracerMetricsEnabled()) { + log.warn( + "Both OTLP trace span metrics and native tracer metrics are enabled; " + + "using OTLP export and ignoring native tracer metrics (the two are mutually " + + "exclusive)."); + } + if (!config.isMetricsOtlpExporterEnabled()) { + log.warn( + "OTLP trace span metrics are enabled but the OTLP metrics exporter is not enabled " + + "(" + + METRICS_OTEL_EXPORTER + + " is not 'otlp'); span metrics will still be exported over " + + "OTLP using the otlp.metrics.* transport settings. Set " + + METRICS_OTEL_EXPORTER + + "=otlp " + + "to make this explicit, or disable " + + OTEL_TRACES_SPAN_METRICS_ENABLED + + " to suppress them."); + } + log.debug("OTLP trace span metrics enabled"); + return new ClientStatsAggregator( + config, sharedCommunicationObjects, healthMetrics, new OtlpStatsMetricWriter(config)); + } if (config.isTracerMetricsEnabled()) { log.debug("tracer metrics enabled"); - return new ConflatingMetricsAggregator(config, sharedCommunicationObjects, healthMetrics); + return new ClientStatsAggregator(config, sharedCommunicationObjects, healthMetrics); } log.debug("tracer metrics disabled"); return NoOpMetricsAggregator.INSTANCE; diff --git a/dd-trace-core/src/main/java/datadog/trace/common/metrics/NoOpSink.java b/dd-trace-core/src/main/java/datadog/trace/common/metrics/NoOpSink.java new file mode 100644 index 00000000000..75236791324 --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/common/metrics/NoOpSink.java @@ -0,0 +1,17 @@ +package datadog.trace.common.metrics; + +import java.nio.ByteBuffer; + +/** A {@link Sink} that discards everything. */ +public final class NoOpSink implements Sink { + + public static final NoOpSink INSTANCE = new NoOpSink(); + + private NoOpSink() {} + + @Override + public void accept(int messageCount, ByteBuffer buffer) {} + + @Override + public void register(EventListener listener) {} +} diff --git a/dd-trace-core/src/main/java/datadog/trace/common/metrics/PeerTagSchema.java b/dd-trace-core/src/main/java/datadog/trace/common/metrics/PeerTagSchema.java new file mode 100644 index 00000000000..1e0d51e84c8 --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/common/metrics/PeerTagSchema.java @@ -0,0 +1,119 @@ +package datadog.trace.common.metrics; + +import static datadog.trace.api.DDTags.BASE_SERVICE; + +import datadog.communication.ddagent.DDAgentFeaturesDiscovery; +import datadog.trace.api.Config; +import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; +import java.util.Set; + +/** + * Parallel arrays of peer-tag names and their {@link TagCardinalityHandler}s, using matching + * indexes. + * + *

      Each schema stores peer-tag names and their cardinality handlers by index. Producers capture + * span tag values into a {@code String[]} with the same ordering as {@link #names}. Consumers pass + * the index and captured value to {@link #register(int, String)} to canonicalize it through the + * per-tag cardinality handler. + * + *

      Two schemas exist: + * + *

        + *
      • {@link #INTERNAL} -- a singleton with one entry for {@code base.service}, used for + * internal-kind spans where only the base service is aggregated. + *
      • A peer-aggregation schema built via {@link #of(Set, String)} for {@code client}/{@code + * producer}/{@code consumer} spans. {@link ClientStatsAggregator} caches the most recently + * built schema and reconciles it on the aggregator thread once per reporting cycle by + * comparing {@link #state} against {@link DDAgentFeaturesDiscovery#state()}. + *
      + * + *

      Cardinality blocks are counted inside each {@link TagCardinalityHandler} and flushed once per + * cycle (with a warn log) via {@code ClientStatsAggregator#resetCardinalityHandlers}. + * + *

      Each {@link SpanSnapshot} captures its own schema reference so producer and consumer agree on + * the indexing even if the current schema is replaced between capture and consumption. + * + *

      Thread-safety: the aggregator thread is the only thread that mutates this schema, + * including its {@link TagCardinalityHandler}s and {@link #state}. Producer threads may read {@link + * #names} and {@link #handlers} because they are final and published through the volatile {@code + * cachedPeerTagSchema} reference in {@link ClientStatsAggregator}. + */ +final class PeerTagSchema { + + /** + * Sentinel {@link #state} for schemas that are never reconciled against feature discovery: the + * {@link #INTERNAL} singleton and test-built schemas. A {@code null} state always mismatches a + * real discovery hash, so a schema built with it would rebuild on first reconcile -- but neither + * of these schemas takes that path. + */ + static final String NO_STATE = null; + + /** Singleton schema for internal-kind spans -- only {@code base.service}. */ + static final PeerTagSchema INTERNAL = new PeerTagSchema(new String[] {BASE_SERVICE}, NO_STATE); + + final String[] names; + final TagCardinalityHandler[] handlers; + + /** + * The {@code DDAgentFeaturesDiscovery.state()} hash this schema was built from. The aggregator + * thread reads and updates this once per reporting cycle when reconciling against the latest + * discovery; producer threads never touch it. Plain (non-volatile, non-final) because the + * aggregator is the sole reader/writer. May be {@code null} before discovery has produced a + * response. + */ + String state; + + /** Builds a schema for the given peer-tag names. Order is determined by the {@link Set}. */ + static PeerTagSchema of(Set names, String state) { + return new PeerTagSchema(names.toArray(new String[0]), state); + } + + PeerTagSchema(String[] names, String state) { + this.names = names; + this.state = state; + this.handlers = new TagCardinalityHandler[names.length]; + for (int i = 0; i < names.length; i++) { + this.handlers[i] = + new TagCardinalityHandler( + names[i], + Config.get() + .getTraceStatsCardinalityLimit( + "peer_tags", MetricCardinalityLimits.PEER_TAG_VALUE)); + } + } + + /** + * Whether this schema contains exactly the same tag names as {@code other}. Used during + * reconciliation: if feature discovery has a new {@link DDAgentFeaturesDiscovery#state()} but the + * peer-tag set is unchanged, the aggregator can reuse this schema and update {@link #state} + * instead of rebuilding the handlers. + */ + boolean hasSameTagsAs(Set other) { + if (this.names.length != other.size()) { + return false; + } + for (String name : this.names) { + if (!other.contains(name)) { + return false; + } + } + return true; + } + + /** + * Canonicalizes the peer-tag value at slot {@code i}. Returns {@link UTF8BytesString#EMPTY} for + * null inputs and the handler's {@code ":tracer_blocked_value"} sentinel when the per-tag + * cardinality budget is exhausted. + */ + UTF8BytesString register(int i, String value) { + return handlers[i].register(value); + } + + int size() { + return names.length; + } + + String name(int i) { + return names[i]; + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/common/metrics/PropertyCardinalityHandler.java b/dd-trace-core/src/main/java/datadog/trace/common/metrics/PropertyCardinalityHandler.java new file mode 100644 index 00000000000..ca86f0be8f6 --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/common/metrics/PropertyCardinalityHandler.java @@ -0,0 +1,181 @@ +package datadog.trace.common.metrics; + +import datadog.trace.api.internal.VisibleForTesting; +import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; +import java.util.Arrays; + +/** + * Cardinality-capped UTF8 encoder and cache for one aggregate-key field ({@code value} → + * {@code UTF8(value)}). + * + *

      Each reporting cycle (interval between client-stats flushes) has its own cardinality budget. + * Once the budget is exhausted, new values get the {@code tracer_blocked_value} sentinel (or a + * fresh allocation when sentinel mode is disabled). A prior-cycle table preserves {@link + * UTF8BytesString} instances across the reset, so stable workloads pay zero allocations after the + * first cycle. + * + *

      Dual role -- limiter and cache. Prior versions ran a per-field {@code DDCache} for UTF8 + * reuse with a separate global cardinality cap on top. Under high load that wasn't enough to stave + * off long GC cycles: every miss still concatenated / UTF8-encoded the value before the cache could + * store it. A cardinality limiter and a recent-value cache are both sets of recently used + * values, so this class collapses them into one structure. Cardinality limiting happens first, + * which lets the blocked path skip the concatenation and encoding entirely. + * + *

      A pure limiter would fully reset each reporting cycle and destroy the cache. To preserve UTF8 + * reuse across resets, the handler keeps the previous cycle's entries verbatim in a parallel table + * and reuses any matching {@link UTF8BytesString} when a value first appears in the new cycle. + */ +final class PropertyCardinalityHandler { + // Upper bound prevents int overflow in the (cardinalityLimit * 2 - 1) capacity calculation. + // Practical limits are 8..512; this cap is well beyond any realistic configuration. + private static final int MAX_CARDINALITY_LIMIT = 1 << 29; + + final String name; + private final int cardinalityLimit; + private final int capacityMask; + + /** + * Whether to substitute the {@code tracer_blocked_value} sentinel when the per-cycle budget is + * exhausted. With limits enabled (sentinel mode), overflow values collapse to one bucket; with + * limits disabled, the cache size is still bounded by {@link #cardinalityLimit} but over-budget + * values get freshly-allocated {@link UTF8BytesString}s instead, so the wire format carries the + * real value and entries don't collapse. Prior-cycle reuse runs in either mode. + */ + private final boolean useBlockedSentinel; + + // Single open-addressed table per cycle. The stored UTF8BytesString IS the slot identity -- + // equality is checked by comparing its underlying String against the incoming CharSequence. + private UTF8BytesString[] curValues; + // Values from the previous reporting cycle, kept so values that persist across cycles can reuse + // their UTF8BytesString instance without re-allocating. + private UTF8BytesString[] priorValues; + private int curSize; + + private UTF8BytesString cacheBlocked = null; + private String[] statsDTag = null; + + /** Accumulated block count for the current cycle. Returned and zeroed by {@link #reset()}. */ + private long blockedCount; + + /** + * Test convenience: limits-enabled mode (blocked sentinel substitution active). Production uses + * the three-argument constructor with the flag from {@code Config}. + */ + @VisibleForTesting + PropertyCardinalityHandler(String name, int cardinalityLimit) { + this(name, cardinalityLimit, true); + } + + PropertyCardinalityHandler(String name, int cardinalityLimit, boolean useBlockedSentinel) { + this.name = name; + if (cardinalityLimit <= 0) { + throw new IllegalArgumentException("cardinalityLimit must be positive: " + cardinalityLimit); + } + if (cardinalityLimit > MAX_CARDINALITY_LIMIT) { + throw new IllegalArgumentException( + "cardinalityLimit must be at most " + MAX_CARDINALITY_LIMIT + ": " + cardinalityLimit); + } + this.cardinalityLimit = cardinalityLimit; + this.useBlockedSentinel = useBlockedSentinel; + // Capacity = next power of two >= 2 * cardinalityLimit. Linear-probing load factor stays + // <= 0.5 even when the budget is full, which keeps probe chains short. + final int capacity = Integer.highestOneBit(cardinalityLimit * 2 - 1) << 1; + this.capacityMask = capacity - 1; + this.curValues = new UTF8BytesString[capacity]; + this.priorValues = new UTF8BytesString[capacity]; + } + + /** + * Canonicalizes {@code value} through the cardinality budget and per-cycle reuse cache. Null + * inputs map to {@link UTF8BytesString#EMPTY} -- {@link AggregateEntry} doesn't need to + * pre-check. + * + *

      The value hash is computed once and used as the initial probe slot in both tables. {@code h + * ^ (h >>> 16)} folds high hash bits into the low bits to reduce collisions for inputs that share + * a common low-bit pattern. {@link UTF8BytesString#hashCode} is content-stable with the + * underlying String, so a String input and a UTF8BytesString of the same content map to the same + * slot. + */ + UTF8BytesString register(CharSequence value) { + if (value == null) { + return UTF8BytesString.EMPTY; + } + // Initial table slot, used to probe current and prior tables. + int h = value.hashCode(); + int start = (h ^ (h >>> 16)) & this.capacityMask; + + // First, look in the current-cycle table. + // If found, this value already consumed cardinality budget in this cycle. + int slot = start; + UTF8BytesString existing; + while ((existing = this.curValues[slot]) != null + && existing != value + && !existing.toString().contentEquals(value)) { + slot = (slot + 1) & this.capacityMask; + } + if (existing != null) { + return existing; + } + // This value is new for the current cycle. + boolean capExhausted = this.curSize >= this.cardinalityLimit; + // If sentinel mode is enabled and the field is over budget, collapse this + // value to tracer_blocked_value and count it as blocked. + if (capExhausted && this.useBlockedSentinel) { + this.blockedCount++; + return this.tracerBlockedValue(); + } + // Otherwise, try to reuse from the prior cycle if possible to avoid re-allocation. + // Runs whether or not the current budget is exhausted, so persistent values keep their + // UTF8BytesString instance across cycles. + int priorSlot = start; + UTF8BytesString priorMatch; + while ((priorMatch = this.priorValues[priorSlot]) != null + && priorMatch != value + && !priorMatch.toString().contentEquals(value)) { + priorSlot = (priorSlot + 1) & this.capacityMask; + } + UTF8BytesString utf8 = priorMatch != null ? priorMatch : UTF8BytesString.create(value); + // If there is still budget, remember this value in the current-cycle table. + if (!capExhausted) { + this.curValues[slot] = utf8; + this.curSize += 1; + } + // If capExhausted && !useBlockedSentinel, this returns the real value but + // does not cache it in the current cycle. + return utf8; + } + + private UTF8BytesString tracerBlockedValue() { + UTF8BytesString cacheBlocked = this.cacheBlocked; + if (cacheBlocked != null) return cacheBlocked; + + this.cacheBlocked = cacheBlocked = UTF8BytesString.create("tracer_blocked_value"); + return cacheBlocked; + } + + /** + * Resets the per-cycle working set and returns the accumulated block count for this cycle. The + * caller is responsible for reporting the count to health metrics if non-zero. + */ + String[] statsDTag() { + if (statsDTag == null) { + statsDTag = new String[] {"collapsed:" + name}; + } + return statsDTag; + } + + long reset() { + long count = this.blockedCount; + this.blockedCount = 0; + // Flip pointers: the just-completed cycle becomes prior; what was prior (2 cycles ago) is + // recycled into the new (empty) current. + final UTF8BytesString[] tmp = this.priorValues; + this.priorValues = this.curValues; + this.curValues = tmp; + // Null the new current. The values pulled out of prior are still reachable through any + // AggregateEntry rows they ended up populating; this just drops the handler's references. + Arrays.fill(this.curValues, null); + this.curSize = 0; + return count; + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/common/metrics/SerializingMetricWriter.java b/dd-trace-core/src/main/java/datadog/trace/common/metrics/SerializingMetricWriter.java index 0f84964e9db..622a4a14cb0 100644 --- a/dd-trace-core/src/main/java/datadog/trace/common/metrics/SerializingMetricWriter.java +++ b/dd-trace-core/src/main/java/datadog/trace/common/metrics/SerializingMetricWriter.java @@ -6,6 +6,7 @@ import datadog.communication.serialization.GrowableBuffer; import datadog.communication.serialization.WritableFormatter; import datadog.communication.serialization.msgpack.MsgPackWriter; +import datadog.metrics.api.Histogram; import datadog.trace.api.ProcessTags; import datadog.trace.api.WellKnownTags; import datadog.trace.api.cache.DDCache; @@ -13,6 +14,7 @@ import datadog.trace.api.git.GitInfo; import datadog.trace.api.git.GitInfoProvider; import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; +import java.nio.ByteBuffer; import java.util.List; import java.util.function.Function; @@ -65,6 +67,12 @@ public final class SerializingMetricWriter implements MetricWriter { DDCaches.newFixedSizeWeakKeyCache(4); private long sequence = 0; private final GitInfoProvider gitInfoProvider; + // Not final/eager: Histogram.newHistogram() requires the Histograms factory to be + // registered first. SerializingMetricWriter is constructed during tracer startup before that + // registration completes, so eager init would throw. Lazy init on first add() call is safe + // because add() only runs on the aggregator thread, which starts after factory registration. + // The single-writer invariant also means no synchronization is needed on this field. + private byte[] emptyHistogramBytesCache; public SerializingMetricWriter(WellKnownTags wellKnownTags, Sink sink) { this(wellKnownTags, sink, 512 * 1024); @@ -83,7 +91,7 @@ public SerializingMetricWriter( this.buffer = new GrowableBuffer(initialCapacity); this.writer = new MsgPackWriter(buffer); this.sink = sink; - this.gitInfoProvider = new GitInfoProvider(); + this.gitInfoProvider = gitInfoProvider; } @Override @@ -142,12 +150,13 @@ public void startBucket(int metricCount, long start, long duration) { } @Override - public void add(MetricKey key, AggregateMetric aggregate) { - // Calculate dynamic map size based on optional fields - final boolean hasHttpMethod = key.getHttpMethod() != null; - final boolean hasHttpEndpoint = key.getHttpEndpoint() != null; - final boolean hasServiceSource = key.getServiceSource() != null; - final boolean hasGrpcStatusCode = key.getGrpcStatusCode() != null; + public void add(AggregateEntry entry) { + // Dynamic map size based on optional fields; AggregateEntry encapsulates the EMPTY-as-absent + // sentinel via its hasFoo() predicates so the serializer doesn't depend on the storage choice. + final boolean hasHttpMethod = entry.hasHttpMethod(); + final boolean hasHttpEndpoint = entry.hasHttpEndpoint(); + final boolean hasServiceSource = entry.hasServiceSource(); + final boolean hasGrpcStatusCode = entry.hasGrpcStatusCode(); final int mapSize = 15 + (hasServiceSource ? 1 : 0) @@ -158,31 +167,31 @@ public void add(MetricKey key, AggregateMetric aggregate) { writer.startMap(mapSize); writer.writeUTF8(NAME); - writer.writeUTF8(key.getOperationName()); + writer.writeUTF8(entry.getOperationName()); writer.writeUTF8(SERVICE); - writer.writeUTF8(key.getService()); + writer.writeUTF8(entry.getService()); writer.writeUTF8(RESOURCE); - writer.writeUTF8(key.getResource()); + writer.writeUTF8(entry.getResource()); writer.writeUTF8(TYPE); - writer.writeUTF8(key.getType()); + writer.writeUTF8(entry.getType()); writer.writeUTF8(HTTP_STATUS_CODE); - writer.writeInt(key.getHttpStatusCode()); + writer.writeInt(entry.getHttpStatusCode()); writer.writeUTF8(SYNTHETICS); - writer.writeBoolean(key.isSynthetics()); + writer.writeBoolean(entry.isSynthetics()); writer.writeUTF8(IS_TRACE_ROOT); - writer.writeInt(key.isTraceRoot() ? TRISTATE_TRUE : TRISTATE_FALSE); + writer.writeInt(entry.isTraceRoot() ? TRISTATE_TRUE : TRISTATE_FALSE); writer.writeUTF8(SPAN_KIND); - writer.writeUTF8(key.getSpanKind()); + writer.writeUTF8(entry.getSpanKind()); writer.writeUTF8(PEER_TAGS); - final List peerTags = key.getPeerTags(); + final List peerTags = entry.getPeerTags(); writer.startArray(peerTags.size()); for (UTF8BytesString peerTag : peerTags) { @@ -191,43 +200,66 @@ public void add(MetricKey key, AggregateMetric aggregate) { if (hasServiceSource) { writer.writeUTF8(SERVICE_SOURCE); - writer.writeUTF8(key.getServiceSource()); + writer.writeUTF8(entry.getServiceSource()); } // Only include HTTPMethod if present if (hasHttpMethod) { writer.writeUTF8(HTTP_METHOD); - writer.writeUTF8(key.getHttpMethod()); + writer.writeUTF8(entry.getHttpMethod()); } // Only include HTTPEndpoint if present if (hasHttpEndpoint) { writer.writeUTF8(HTTP_ENDPOINT); - writer.writeUTF8(key.getHttpEndpoint()); + writer.writeUTF8(entry.getHttpEndpoint()); } // Only include GRPCStatusCode if present (rpc-type spans) if (hasGrpcStatusCode) { writer.writeUTF8(GRPC_STATUS_CODE); - writer.writeUTF8(key.getGrpcStatusCode()); + writer.writeUTF8(entry.getGrpcStatusCode()); } writer.writeUTF8(HITS); - writer.writeInt(aggregate.getHitCount()); + writer.writeInt(entry.getHitCount()); writer.writeUTF8(ERRORS); - writer.writeInt(aggregate.getErrorCount()); + writer.writeInt(entry.getErrorCount()); writer.writeUTF8(TOP_LEVEL_HITS); - writer.writeInt(aggregate.getTopLevelCount()); + writer.writeInt(entry.getTopLevelCount()); writer.writeUTF8(DURATION); - writer.writeLong(aggregate.getDuration()); + writer.writeLong(entry.getDuration()); writer.writeUTF8(OK_SUMMARY); - writer.writeBinary(aggregate.getOkLatencies().serialize()); + writer.writeBinary(entry.getOkLatencies().serialize()); writer.writeUTF8(ERROR_SUMMARY); - writer.writeBinary(aggregate.getErrorLatencies().serialize()); + final datadog.metrics.api.Histogram errorLatencies = entry.getErrorLatencies(); + if (errorLatencies != null) { + writer.writeBinary(errorLatencies.serialize()); + } else { + // Entry never saw an error; emit a cached empty-histogram payload so the wire format is + // unchanged without allocating a histogram per entry. + writer.writeBinary(emptyErrorHistogramBytes()); + } + } + + /** + * Returns the cached serialized form of an empty histogram. Computed lazily on first call so the + * {@link datadog.metrics.api.Histograms} factory has been registered (by the producer-side tracer + * startup or test setup) before we sample its output. + */ + private byte[] emptyErrorHistogramBytes() { + byte[] cached = emptyHistogramBytesCache; + if (cached == null) { + ByteBuffer buf = Histogram.newHistogram().serialize(); + cached = new byte[buf.remaining()]; + buf.get(cached); + emptyHistogramBytesCache = cached; + } + return cached; } @Override diff --git a/dd-trace-core/src/main/java/datadog/trace/common/metrics/SpanSnapshot.java b/dd-trace-core/src/main/java/datadog/trace/common/metrics/SpanSnapshot.java new file mode 100644 index 00000000000..8bbc6a29edb --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/common/metrics/SpanSnapshot.java @@ -0,0 +1,78 @@ +package datadog.trace.common.metrics; + +import javax.annotation.Nullable; + +/** + * Immutable per-span value posted from the producer to the aggregator thread. Carries the raw + * inputs the aggregator needs to look up or build an {@link AggregateEntry} and update its + * counters. + * + *

      All cache-canonicalization (service-name, span-kind, peer-tag string interning) happens on the + * aggregator thread; the producer just shuffles references. + */ +final class SpanSnapshot implements InboxItem { + + final CharSequence resourceName; + final String serviceName; + final CharSequence operationName; + final CharSequence serviceNameSource; + final CharSequence spanType; + final short httpStatusCode; + final boolean synthetic; + final boolean traceRoot; + final String spanKind; + + /** + * Schema for {@link #peerTagValues}. {@code null} when the span has no peer tags. The schema + * carries the names + {@link TagCardinalityHandler}s in parallel array form; {@code + * peerTagValues} holds the per-span tag values at the same indices. + */ + @Nullable final PeerTagSchema peerTagSchema; + + /** + * Peer tag values captured from the span, parallel to {@code peerTagSchema.names}. A {@code null} + * entry means the span didn't have that peer tag set. {@code null} (the whole array) when {@link + * #peerTagSchema} is {@code null}. + */ + @Nullable final String[] peerTagValues; + + @Nullable final String httpMethod; + @Nullable final String httpEndpoint; + @Nullable final String grpcStatusCode; + + /** Duration in nanoseconds, OR-ed with {@code ERROR_TAG} / {@code TOP_LEVEL_TAG} as needed. */ + final long tagAndDuration; + + SpanSnapshot( + CharSequence resourceName, + String serviceName, + CharSequence operationName, + CharSequence serviceNameSource, + CharSequence spanType, + short httpStatusCode, + boolean synthetic, + boolean traceRoot, + String spanKind, + @Nullable PeerTagSchema peerTagSchema, + @Nullable String[] peerTagValues, + @Nullable String httpMethod, + @Nullable String httpEndpoint, + @Nullable String grpcStatusCode, + long tagAndDuration) { + this.resourceName = resourceName; + this.serviceName = serviceName; + this.operationName = operationName; + this.serviceNameSource = serviceNameSource; + this.spanType = spanType; + this.httpStatusCode = httpStatusCode; + this.synthetic = synthetic; + this.traceRoot = traceRoot; + this.spanKind = spanKind; + this.peerTagSchema = peerTagSchema; + this.peerTagValues = peerTagValues; + this.httpMethod = httpMethod; + this.httpEndpoint = httpEndpoint; + this.grpcStatusCode = grpcStatusCode; + this.tagAndDuration = tagAndDuration; + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/common/metrics/TagCardinalityHandler.java b/dd-trace-core/src/main/java/datadog/trace/common/metrics/TagCardinalityHandler.java new file mode 100644 index 00000000000..3c3d151142c --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/common/metrics/TagCardinalityHandler.java @@ -0,0 +1,170 @@ +package datadog.trace.common.metrics; + +import datadog.trace.api.internal.VisibleForTesting; +import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.util.Arrays; + +/** + * Cardinality-capped UTF8 encoder and cache for one peer-tag name ({@code value} → {@code + * UTF8("tag:value")}). + * + *

      Same per-cycle budget and prior-cycle reuse as {@link PropertyCardinalityHandler}. The + * difference is that the cached output is the pre-encoded {@code "tag:value"} string, so a parallel + * raw-value keys table is needed alongside the UTF8 values table. + */ +final class TagCardinalityHandler { + // Upper bound prevents int overflow in the (cardinalityLimit * 2 - 1) capacity calculation. + // Practical limits are 8..512; this cap is well beyond any realistic configuration. + private static final int MAX_CARDINALITY_LIMIT = 1 << 29; + + private final String tag; + private String[] statsDTag = null; + private final int cardinalityLimit; + private final int capacityMask; + + /** See {@link PropertyCardinalityHandler}'s field of the same name. */ + private final boolean useBlockedSentinel; + + private String[] curKeys; + private UTF8BytesString[] curValues; + private String[] priorKeys; + private UTF8BytesString[] priorValues; + private int curSize; + + private UTF8BytesString cacheBlocked = null; + + /** Accumulated block count for the current cycle. Returned and zeroed by {@link #reset()}. */ + private long blockedCount; + + /** + * Test convenience: limits-enabled mode. Production uses the three-argument constructor with the + * flag from {@code Config}. + */ + @VisibleForTesting + TagCardinalityHandler(String tag, int cardinalityLimit) { + this(tag, cardinalityLimit, true); + } + + TagCardinalityHandler(String tag, int cardinalityLimit, boolean useBlockedSentinel) { + if (cardinalityLimit <= 0) { + throw new IllegalArgumentException("cardinalityLimit must be positive: " + cardinalityLimit); + } + if (cardinalityLimit > MAX_CARDINALITY_LIMIT) { + throw new IllegalArgumentException( + "cardinalityLimit must be at most " + MAX_CARDINALITY_LIMIT + ": " + cardinalityLimit); + } + this.tag = tag; + this.cardinalityLimit = cardinalityLimit; + this.useBlockedSentinel = useBlockedSentinel; + final int capacity = Integer.highestOneBit(cardinalityLimit * 2 - 1) << 1; + this.capacityMask = capacity - 1; + this.curKeys = new String[capacity]; + this.curValues = new UTF8BytesString[capacity]; + this.priorKeys = new String[capacity]; + this.priorValues = new UTF8BytesString[capacity]; + } + + /** + * Returns the UTF8 value to use for {@code value} in the current reporting cycle. Null inputs are + * returned as {@link UTF8BytesString#EMPTY}. + * + *

      The value hash is computed once and used as the initial probe slot in both tables. The + * {@code h ^ (h >>> 16)} calculation folds high hash bits into the low bits, which reduces + * clustering when values share similar low-bit hash patterns. + */ + @SuppressFBWarnings( + value = "ES_COMPARING_PARAMETER_STRING_WITH_EQ", + justification = + "Intentional identity fast-path: the reference check short-circuits the .equals() call" + + " when the stored key and probe value are the same instance.") + UTF8BytesString register(String value) { + if (value == null) { + return UTF8BytesString.EMPTY; + } + // Compute the initial probe slot once. The same start slot is used for the + // current-cycle table and, on miss, for the prior-cycle table. + int h = value.hashCode(); + int start = (h ^ (h >>> 16)) & this.capacityMask; + + // Look for the raw value in the current-cycle table. + int slot = start; + String existing; + while ((existing = this.curKeys[slot]) != null + && existing != value + && !existing.equals(value)) { + slot = (slot + 1) & this.capacityMask; + } + // If found, return the already encoded "tag:value" UTF8 value. + if (existing != null) { + return this.curValues[slot]; + } + // This value is new for the current cycle. + boolean capExhausted = this.curSize >= this.cardinalityLimit; + // If sentinel mode is enabled and the tag has reached its value budget, + // collapse this value to "tag:tracer_blocked_value" and record the block. + if (capExhausted && this.useBlockedSentinel) { + this.blockedCount++; + return this.tracerBlockedValue(); + } + // Try to find the same raw value in the previous-cycle table so the encoded + // UTF8 object can be reused after a reset. + int priorSlot = start; + String priorKey; + while ((priorKey = this.priorKeys[priorSlot]) != null + && priorKey != value + && !priorKey.equals(value)) { + priorSlot = (priorSlot + 1) & this.capacityMask; + } + // Reuse the previous encoded "tag:value" UTF8 value if present; otherwise + // create it from the fixed tag name and the raw value. + UTF8BytesString utf8 = + priorKey != null + ? this.priorValues[priorSlot] + : UTF8BytesString.create(this.tag + ":" + value); + // If still within budget, remember the raw value and its encoded UTF8 + // output in the current-cycle table. + if (!capExhausted) { + this.curKeys[slot] = value; + this.curValues[slot] = utf8; + this.curSize += 1; + } + // If capExhausted && !useBlockedSentinel, return the real "tag:value" value + // without caching it in the current cycle. + return utf8; + } + + private UTF8BytesString tracerBlockedValue() { + UTF8BytesString cacheBlocked = this.cacheBlocked; + if (cacheBlocked != null) return cacheBlocked; + + this.cacheBlocked = cacheBlocked = UTF8BytesString.create(this.tag + ":tracer_blocked_value"); + return cacheBlocked; + } + + String[] statsDTag() { + if (statsDTag == null) { + statsDTag = new String[] {"collapsed:" + tag}; + } + return statsDTag; + } + + /** + * Resets the per-cycle working set and returns the accumulated block count for this cycle. The + * caller is responsible for reporting the count to health metrics if non-zero. + */ + long reset() { + long count = this.blockedCount; + this.blockedCount = 0; + final String[] tmpKeys = this.priorKeys; + final UTF8BytesString[] tmpValues = this.priorValues; + this.priorKeys = this.curKeys; + this.priorValues = this.curValues; + this.curKeys = tmpKeys; + this.curValues = tmpValues; + Arrays.fill(this.curKeys, null); + Arrays.fill(this.curValues, null); + this.curSize = 0; + return count; + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/common/sampling/SpanSamplingRules.java b/dd-trace-core/src/main/java/datadog/trace/common/sampling/SpanSamplingRules.java index b148c9a82f0..d4950c5e8f1 100644 --- a/dd-trace-core/src/main/java/datadog/trace/common/sampling/SpanSamplingRules.java +++ b/dd-trace-core/src/main/java/datadog/trace/common/sampling/SpanSamplingRules.java @@ -108,10 +108,10 @@ private Rule( } /** - * Validate and create a {@link Rule} from its {@link JsonRule} representation. + * Validate and create a {@link Rule} from its {@code JsonRule} representation. * - * @param jsonRule The {@link JsonRule} to validate. - * @return A {@link Rule} if the {@link JsonRule} is valid, {@code null} otherwise. + * @param jsonRule The {@code JsonRule} to validate. + * @return A {@link Rule} if the {@code JsonRule} is valid, {@code null} otherwise. */ public static Rule create(JsonRule jsonRule) { String service = SamplingRule.normalizeGlob(jsonRule.service); diff --git a/dd-trace-core/src/main/java/datadog/trace/common/sampling/TraceSamplingRules.java b/dd-trace-core/src/main/java/datadog/trace/common/sampling/TraceSamplingRules.java index 16df3534c3e..455b66443fe 100644 --- a/dd-trace-core/src/main/java/datadog/trace/common/sampling/TraceSamplingRules.java +++ b/dd-trace-core/src/main/java/datadog/trace/common/sampling/TraceSamplingRules.java @@ -87,10 +87,10 @@ private Rule( } /** - * Validate and create a {@link Rule} from its {@link JsonRule} representation. + * Validate and create a {@link Rule} from its {@code JsonRule} representation. * - * @param jsonRule The {@link JsonRule} to validate. - * @return A {@link Rule} if the {@link JsonRule} is valid, {@code null} otherwise. + * @param jsonRule The {@code JsonRule} to validate. + * @return A {@link Rule} if the {@code JsonRule} is valid, {@code null} otherwise. */ public static Rule create(JsonRule jsonRule) { String service = SamplingRule.normalizeGlob(jsonRule.service); diff --git a/dd-trace-core/src/main/java/datadog/trace/common/writer/DDAgentWriter.java b/dd-trace-core/src/main/java/datadog/trace/common/writer/DDAgentWriter.java index 12e6d74b719..d0fbc11cda8 100644 --- a/dd-trace-core/src/main/java/datadog/trace/common/writer/DDAgentWriter.java +++ b/dd-trace-core/src/main/java/datadog/trace/common/writer/DDAgentWriter.java @@ -7,6 +7,7 @@ import static datadog.trace.common.writer.ddagent.Prioritization.FAST_LANE; import datadog.communication.ddagent.DDAgentFeaturesDiscovery; +import datadog.communication.ddagent.DroppingPolicy; import datadog.metrics.api.Monitoring; import datadog.trace.api.Config; import datadog.trace.api.ProtocolVersion; @@ -39,7 +40,7 @@ public static class DDAgentWriterBuilder { int flushIntervalMilliseconds = 1000; Monitoring monitoring = Monitoring.DISABLED; ProtocolVersion protocolVersion = Config.get().getProtocolVersion(); - boolean metricsReportingEnabled = Config.get().isTracerMetricsEnabled(); + boolean nativeMetricsReportingEnabled = Config.get().isTracerMetricsEnabled(); boolean metricsIgnoreAgentVersion = Config.get().isTracerMetricsIgnoreAgentVersion(); private int flushTimeout = 1; private TimeUnit flushTimeoutUnit = TimeUnit.SECONDS; @@ -48,6 +49,7 @@ public static class DDAgentWriterBuilder { private DDAgentApi agentApi; private Prioritization prioritization; private DDAgentFeaturesDiscovery featureDiscovery; + private DroppingPolicy droppingPolicy; private SingleSpanSampler singleSpanSampler; public DDAgentWriterBuilder agentApi(DDAgentApi agentApi) { @@ -110,8 +112,9 @@ public DDAgentWriterBuilder traceAgentProtocolVersion(ProtocolVersion protocolVe return this; } - public DDAgentWriterBuilder metricsReportingEnabled(boolean metricsReportingEnabled) { - this.metricsReportingEnabled = metricsReportingEnabled; + public DDAgentWriterBuilder nativeMetricsReportingEnabled( + boolean nativeMetricsReportingEnabled) { + this.nativeMetricsReportingEnabled = nativeMetricsReportingEnabled; return this; } @@ -125,6 +128,11 @@ public DDAgentWriterBuilder featureDiscovery(DDAgentFeaturesDiscovery featureDis return this; } + public DDAgentWriterBuilder droppingPolicy(DroppingPolicy droppingPolicy) { + this.droppingPolicy = droppingPolicy; + return this; + } + public DDAgentWriterBuilder flushTimeout(int flushTimeout, TimeUnit flushTimeoutUnit) { this.flushTimeout = flushTimeout; this.flushTimeoutUnit = flushTimeoutUnit; @@ -154,12 +162,13 @@ public DDAgentWriter build() { monitoring, agentUrl, protocolVersion, - metricsReportingEnabled, + nativeMetricsReportingEnabled, metricsIgnoreAgentVersion); } if (null == agentApi) { agentApi = - new DDAgentApi(client, agentUrl, featureDiscovery, monitoring, metricsReportingEnabled); + new DDAgentApi( + client, agentUrl, featureDiscovery, monitoring, nativeMetricsReportingEnabled); } final DDAgentMapperDiscovery mapperDiscovery = new DDAgentMapperDiscovery(featureDiscovery); @@ -170,7 +179,8 @@ public DDAgentWriter build() { traceBufferSize, healthMetrics, dispatcher, - featureDiscovery, + // allow custom dropping policy for OTLP; otherwise fall back to feature discovery + droppingPolicy != null ? droppingPolicy : featureDiscovery, null == prioritization ? FAST_LANE : prioritization, flushIntervalMilliseconds, TimeUnit.MILLISECONDS, diff --git a/dd-trace-core/src/main/java/datadog/trace/common/writer/DDSpanJsonAdapter.java b/dd-trace-core/src/main/java/datadog/trace/common/writer/DDSpanJsonAdapter.java index 93c6995d4e8..c1e5cb4db1c 100644 --- a/dd-trace-core/src/main/java/datadog/trace/common/writer/DDSpanJsonAdapter.java +++ b/dd-trace-core/src/main/java/datadog/trace/common/writer/DDSpanJsonAdapter.java @@ -75,7 +75,7 @@ public void toJson(final com.squareup.moshi.JsonWriter writer, final DDSpan span writer.name("meta"); writer.beginObject(); final Map tags = span.getTags(); - for (final Map.Entry entry : span.context().getBaggageItems().entrySet()) { + for (final Map.Entry entry : span.spanContext().getBaggageItems().entrySet()) { if (!tags.containsKey(entry.getKey())) { writer.name(entry.getKey()); writer.value(entry.getValue()); diff --git a/dd-trace-core/src/main/java/datadog/trace/common/writer/FileBasedPayloadDispatcher.java b/dd-trace-core/src/main/java/datadog/trace/common/writer/FileBasedPayloadDispatcher.java index 34e37cc3c1c..810952292b8 100644 --- a/dd-trace-core/src/main/java/datadog/trace/common/writer/FileBasedPayloadDispatcher.java +++ b/dd-trace-core/src/main/java/datadog/trace/common/writer/FileBasedPayloadDispatcher.java @@ -1,6 +1,8 @@ package datadog.trace.common.writer; import static datadog.json.JsonMapper.toJson; +import static datadog.trace.api.civisibility.CIConstants.MAX_META_STRING_VALUE_LENGTH; +import static datadog.trace.util.Strings.truncate; import datadog.json.JsonWriter; import datadog.trace.api.Config; @@ -383,20 +385,21 @@ public void accept(Metadata metadata) { w.beginObject(); for (Map.Entry entry : metadata.getBaggage().entrySet()) { if (!isExcludedTag(entry.getKey())) { - w.name(entry.getKey()).value(entry.getValue()); + w.name(entry.getKey()).value(truncate(entry.getValue(), MAX_META_STRING_VALUE_LENGTH)); } } if (metadata.getHttpStatusCode() != null) { - w.name(Tags.HTTP_STATUS).value(metadata.getHttpStatusCode().toString()); + w.name(Tags.HTTP_STATUS) + .value(truncate(metadata.getHttpStatusCode().toString(), MAX_META_STRING_VALUE_LENGTH)); } for (Map.Entry entry : tags.entrySet()) { Object value = entry.getValue(); if (!(value instanceof Number) && !isExcludedTag(entry.getKey())) { w.name(entry.getKey()); if (value instanceof Iterable) { - w.value(toJson((Collection) value)); + w.value(truncate(toJson((Collection) value), MAX_META_STRING_VALUE_LENGTH)); } else { - w.value(String.valueOf(value)); + w.value(truncate(String.valueOf(value), MAX_META_STRING_VALUE_LENGTH)); } } } diff --git a/dd-trace-core/src/main/java/datadog/trace/common/writer/ListWriter.java b/dd-trace-core/src/main/java/datadog/trace/common/writer/ListWriter.java index dec3a8eb9e5..7c151dab5c4 100644 --- a/dd-trace-core/src/main/java/datadog/trace/common/writer/ListWriter.java +++ b/dd-trace-core/src/main/java/datadog/trace/common/writer/ListWriter.java @@ -33,6 +33,10 @@ public List firstTrace() { return get(0); } + public int getTraceCount() { + return traceCount.get(); + } + @SuppressFBWarnings("NN_NAKED_NOTIFY") @Override public void write(List trace) { diff --git a/dd-trace-core/src/main/java/datadog/trace/common/writer/OtlpPayloadDispatcher.java b/dd-trace-core/src/main/java/datadog/trace/common/writer/OtlpPayloadDispatcher.java index 4f198f1e508..b2817b46dbc 100644 --- a/dd-trace-core/src/main/java/datadog/trace/common/writer/OtlpPayloadDispatcher.java +++ b/dd-trace-core/src/main/java/datadog/trace/common/writer/OtlpPayloadDispatcher.java @@ -4,7 +4,6 @@ import datadog.trace.core.otlp.common.OtlpPayload; import datadog.trace.core.otlp.common.OtlpSender; import datadog.trace.core.otlp.trace.OtlpTraceCollector; -import datadog.trace.core.otlp.trace.OtlpTraceProtoCollector; import java.util.Collection; import java.util.Collections; import java.util.List; @@ -13,10 +12,6 @@ final class OtlpPayloadDispatcher implements PayloadDispatcher { private final OtlpTraceCollector collector; private final OtlpSender sender; - OtlpPayloadDispatcher(OtlpSender sender) { - this(sender, new OtlpTraceProtoCollector()); - } - OtlpPayloadDispatcher(OtlpSender sender, OtlpTraceCollector collector) { this.sender = sender; this.collector = collector; diff --git a/dd-trace-core/src/main/java/datadog/trace/common/writer/OtlpWriter.java b/dd-trace-core/src/main/java/datadog/trace/common/writer/OtlpWriter.java index 2e8f7556232..8118ff7b2bb 100644 --- a/dd-trace-core/src/main/java/datadog/trace/common/writer/OtlpWriter.java +++ b/dd-trace-core/src/main/java/datadog/trace/common/writer/OtlpWriter.java @@ -13,6 +13,9 @@ import datadog.trace.core.otlp.common.OtlpGrpcSender; import datadog.trace.core.otlp.common.OtlpHttpSender; import datadog.trace.core.otlp.common.OtlpSender; +import datadog.trace.core.otlp.trace.OtlpTraceCollector; +import datadog.trace.core.otlp.trace.OtlpTraceJsonCollector; +import datadog.trace.core.otlp.trace.OtlpTraceProtoCollector; import java.util.Collections; import java.util.Map; import java.util.concurrent.TimeUnit; @@ -140,14 +143,18 @@ public OtlpWriter build() { endpoint, HTTP_TRACES_SIGNAL_PATH, headers, timeoutMillis, compression); } - final OtlpPayloadDispatcher dispatcher = new OtlpPayloadDispatcher(sender); + final OtlpTraceCollector collector = + protocol == OtlpConfig.Protocol.HTTP_JSON + ? new OtlpTraceJsonCollector() + : new OtlpTraceProtoCollector(); + final OtlpPayloadDispatcher dispatcher = new OtlpPayloadDispatcher(sender, collector); final TraceProcessingWorker worker = new TraceProcessingWorker( traceBufferSize, healthMetrics, dispatcher, DroppingPolicy.DISABLED, - Prioritization.ENSURE_TRACE, + Prioritization.FAST_LANE, flushIntervalMilliseconds, TimeUnit.MILLISECONDS, singleSpanSampler); diff --git a/dd-trace-core/src/main/java/datadog/trace/common/writer/TraceStructureWriter.java b/dd-trace-core/src/main/java/datadog/trace/common/writer/TraceStructureWriter.java index afeaebf2772..f5cb0d2a978 100644 --- a/dd-trace-core/src/main/java/datadog/trace/common/writer/TraceStructureWriter.java +++ b/dd-trace-core/src/main/java/datadog/trace/common/writer/TraceStructureWriter.java @@ -3,6 +3,7 @@ import datadog.environment.OperatingSystem; import datadog.trace.api.DDSpanId; import datadog.trace.api.DDTraceId; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.core.DDSpan; import de.thetaphi.forbiddenapis.SuppressForbidden; import java.io.FileOutputStream; @@ -82,7 +83,7 @@ private static String[] parseArgs(String outputFile) { return parseArgs(outputFile, OperatingSystem.isWindows()); } - // package visibility for testing + @VisibleForTesting static String[] parseArgs(String outputFile, boolean windows) { String[] args = ARGS_DELIMITER.split(outputFile); // Check Windows absolute paths (:) as column is used as arg delimiter diff --git a/dd-trace-core/src/main/java/datadog/trace/common/writer/WriterFactory.java b/dd-trace-core/src/main/java/datadog/trace/common/writer/WriterFactory.java index 3f38d45881f..23b15c39544 100644 --- a/dd-trace-core/src/main/java/datadog/trace/common/writer/WriterFactory.java +++ b/dd-trace-core/src/main/java/datadog/trace/common/writer/WriterFactory.java @@ -193,10 +193,17 @@ public static Writer createWriter( ddAgentApi.addResponseListener((RemoteResponseListener) sampler); } + // Drop p0 (sampled-out) traces when client-side stats are being computed -- either via the + // native agent-stats path (featuresDiscovery) or the OTLP trace metrics path + final boolean otlpSpanMetricsEnabled = config.isOtelTracesSpanMetricsEnabled(); + final DroppingPolicy droppingPolicy = + () -> otlpSpanMetricsEnabled || featuresDiscovery.active(); + DDAgentWriter.DDAgentWriterBuilder builder = DDAgentWriter.builder() .agentApi(ddAgentApi) .featureDiscovery(featuresDiscovery) + .droppingPolicy(droppingPolicy) .prioritization(prioritization) .healthMetrics(healthMetrics) .monitoring(commObjects.monitoring) diff --git a/dd-trace-core/src/main/java/datadog/trace/common/writer/ddagent/DDAgentApi.java b/dd-trace-core/src/main/java/datadog/trace/common/writer/ddagent/DDAgentApi.java index d65b2f77b80..8907e634cfc 100644 --- a/dd-trace-core/src/main/java/datadog/trace/common/writer/ddagent/DDAgentApi.java +++ b/dd-trace-core/src/main/java/datadog/trace/common/writer/ddagent/DDAgentApi.java @@ -43,7 +43,7 @@ public class DDAgentApi extends RemoteApi { private static final String DATADOG_AGENT_STATE = "Datadog-Agent-State"; private final List responseListeners = new ArrayList<>(); - private final boolean metricsEnabled; + private final boolean nativeMetricsEnabled; private final Recording sendPayloadTimer; private final Counter agentErrorCounter; @@ -67,14 +67,14 @@ public DDAgentApi( HttpUrl agentUrl, DDAgentFeaturesDiscovery featuresDiscovery, Monitoring monitoring, - boolean metricsEnabled) { + boolean nativeMetricsEnabled) { super(false); this.featuresDiscovery = featuresDiscovery; this.agentUrl = agentUrl; this.httpClient = client; this.sendPayloadTimer = monitoring.newTimer("trace.agent.send.time"); this.agentErrorCounter = monitoring.newCounter("trace.agent.error.counter"); - this.metricsEnabled = metricsEnabled; + this.nativeMetricsEnabled = nativeMetricsEnabled; this.headers = new HashMap<>(); this.headers.put(DATADOG_CLIENT_COMPUTED_TOP_LEVEL, "true"); @@ -109,7 +109,8 @@ public Response sendSerializedTraces(final Payload payload) { .addHeader(DATADOG_DROPPED_SPAN_COUNT, Long.toString(payload.droppedSpans())) .addHeader( DATADOG_CLIENT_COMPUTED_STATS, - (metricsEnabled && featuresDiscovery.supportsMetrics()) + Config.get().isOtelTracesSpanMetricsEnabled() + || (nativeMetricsEnabled && featuresDiscovery.supportsMetrics()) // Disabling the computation agent-side of the APM trace metrics by // pretending it was already done by the library || !Config.get().isApmTracingEnabled() diff --git a/dd-trace-core/src/main/java/datadog/trace/common/writer/ddagent/TraceMapperV0_5.java b/dd-trace-core/src/main/java/datadog/trace/common/writer/ddagent/TraceMapperV0_5.java index 288b08fc542..a993fdb3c26 100644 --- a/dd-trace-core/src/main/java/datadog/trace/common/writer/ddagent/TraceMapperV0_5.java +++ b/dd-trace-core/src/main/java/datadog/trace/common/writer/ddagent/TraceMapperV0_5.java @@ -9,6 +9,7 @@ import datadog.communication.serialization.msgpack.MsgPackWriter; import datadog.trace.api.TagMap; import datadog.trace.api.TagMap.EntryReader; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.bootstrap.instrumentation.api.InstrumentationTags; import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; import datadog.trace.common.writer.Payload; @@ -125,6 +126,16 @@ public String endpoint() { return "v0.5"; } + @VisibleForTesting + Map getEncoding() { + return encoding; + } + + @VisibleForTesting + GrowableBuffer getDictionary() { + return dictionary; + } + private static class DictionaryMapper implements Mapper { @Override diff --git a/dd-trace-core/src/main/java/datadog/trace/common/writer/ddagent/TraceMapperV1.java b/dd-trace-core/src/main/java/datadog/trace/common/writer/ddagent/TraceMapperV1.java index 4cb41c597f4..819ff2021be 100644 --- a/dd-trace-core/src/main/java/datadog/trace/common/writer/ddagent/TraceMapperV1.java +++ b/dd-trace-core/src/main/java/datadog/trace/common/writer/ddagent/TraceMapperV1.java @@ -89,7 +89,7 @@ public void map(List> trace, Writable writable) { } CoreSpan firstSpan = trace.get(0); - firstSpan.processTagsAndBaggage(spanMetadata, false, false); + firstSpan.processTagsAndBaggageWithStructuredLinks(spanMetadata); Metadata firstSpanMeta = spanMetadata.metadata; // encoded fields: 1..7, but skipping #5, as not required by tracers and set by the agent. @@ -128,7 +128,7 @@ private void encodeSpans(Writable writable, int fieldId, List span : spans) { if (meta == null) { - span.processTagsAndBaggage(spanMetadata, false, false); + span.processTagsAndBaggageWithStructuredLinks(spanMetadata); meta = spanMetadata.metadata; } TagMap tags = meta.getTags(); diff --git a/dd-trace-core/src/main/java/datadog/trace/common/writer/ddintake/DDEvpProxyApi.java b/dd-trace-core/src/main/java/datadog/trace/common/writer/ddintake/DDEvpProxyApi.java index 8926d17e200..e911a980c31 100644 --- a/dd-trace-core/src/main/java/datadog/trace/common/writer/ddintake/DDEvpProxyApi.java +++ b/dd-trace-core/src/main/java/datadog/trace/common/writer/ddintake/DDEvpProxyApi.java @@ -10,11 +10,11 @@ import datadog.trace.api.intake.TrackType; import datadog.trace.common.writer.Payload; import datadog.trace.common.writer.RemoteApi; -import edu.umd.cs.findbugs.annotations.NonNull; import java.io.IOException; import java.net.ConnectException; import java.util.Locale; import java.util.concurrent.TimeUnit; +import javax.annotation.Nonnull; import okhttp3.HttpUrl; import okhttp3.OkHttpClient; import okhttp3.Request; @@ -36,7 +36,7 @@ public static DDEvpProxyApiBuilder builder() { public static class DDEvpProxyApiBuilder { private String apiVersion = DEFAULT_INTAKE_VERSION; - @NonNull private TrackType trackType = TrackType.NOOP; + @Nonnull private TrackType trackType = TrackType.NOOP; private long timeoutMillis = TimeUnit.SECONDS.toMillis(DEFAULT_INTAKE_TIMEOUT); HttpUrl agentUrl = null; @@ -44,7 +44,7 @@ public static class DDEvpProxyApiBuilder { String evpProxyEndpoint; boolean compressionEnabled; - public DDEvpProxyApiBuilder trackType(@NonNull final TrackType trackType) { + public DDEvpProxyApiBuilder trackType(@Nonnull final TrackType trackType) { this.trackType = trackType; return this; } diff --git a/dd-trace-core/src/main/java/datadog/trace/core/CoreSpan.java b/dd-trace-core/src/main/java/datadog/trace/core/CoreSpan.java index 8c98cbbc58a..da163c2f871 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/CoreSpan.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/CoreSpan.java @@ -1,6 +1,7 @@ package datadog.trace.core; import datadog.trace.api.DDTraceId; +import datadog.trace.bootstrap.instrumentation.api.Tags; import java.util.Map; public interface CoreSpan> { @@ -9,9 +10,7 @@ public interface CoreSpan> { String getServiceName(); - default CharSequence getServiceNameSource() { - return null; - } + CharSequence getServiceNameSource(); CharSequence getOperationName(); @@ -61,13 +60,9 @@ default CharSequence getServiceNameSource() { U getTag(CharSequence name); - default U unsafeGetTag(CharSequence name, U defaultValue) { - return getTag(name, defaultValue); - } + U unsafeGetTag(CharSequence name, U defaultValue); - default U unsafeGetTag(CharSequence name) { - return getTag(name); - } + U unsafeGetTag(CharSequence name); boolean hasSamplingPriority(); @@ -80,6 +75,18 @@ default U unsafeGetTag(CharSequence name) { boolean isForceKeep(); + boolean isKind(SpanKindFilter filter); + + /** + * Returns the {@code span.kind} tag value as a String, or {@code null} if not set. Default + * implementation reads the tag map; {@link DDSpan} overrides to use a cached ordinal that + * resolves via a small lookup array, skipping the tag-map lookup on the hot path. + */ + default String getSpanKindString() { + Object v = unsafeGetTag(Tags.SPAN_KIND); + return v == null ? null : v.toString(); + } + CharSequence getType(); /** @@ -91,8 +98,17 @@ default U unsafeGetTag(CharSequence name) { void processTagsAndBaggage(MetadataConsumer consumer); - void processTagsAndBaggage( - MetadataConsumer consumer, boolean injectLinksAsTags, boolean injectBaggageAsTags); + /** + * Variant of {@link #processTagsAndBaggage(MetadataConsumer)} for protocols that serialize span + * links as first-class structured data rather than tags. Baggage tag injection still follows the + * tracer configuration. + * + *

      To simplify tests, by default delegating to {@link + * #processTagsAndBaggage(MetadataConsumer)}. + */ + default void processTagsAndBaggageWithStructuredLinks(MetadataConsumer consumer) { + processTagsAndBaggage(consumer); + } T setSamplingPriority(int samplingPriority, int samplingMechanism); diff --git a/dd-trace-core/src/main/java/datadog/trace/core/CoreTracer.java b/dd-trace-core/src/main/java/datadog/trace/core/CoreTracer.java index 6c5efb4a0d1..c48d8f94df6 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/CoreTracer.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/CoreTracer.java @@ -22,6 +22,9 @@ import datadog.communication.ddagent.DDAgentFeaturesDiscovery; import datadog.communication.ddagent.ExternalAgentLauncher; import datadog.communication.ddagent.SharedCommunicationObjects; +import datadog.context.Context; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; import datadog.context.propagation.Propagators; import datadog.environment.ThreadSupport; import datadog.logging.RatelimitedLogger; @@ -53,6 +56,7 @@ import datadog.trace.api.interceptor.MutableSpan; import datadog.trace.api.interceptor.TraceInterceptor; import datadog.trace.api.internal.TraceSegment; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.api.metrics.SpanMetricRegistry; import datadog.trace.api.naming.SpanNaming; import datadog.trace.api.remoteconfig.ServiceNameCollector; @@ -102,6 +106,7 @@ import datadog.trace.core.propagation.PropagationTags; import datadog.trace.core.propagation.TracingPropagator; import datadog.trace.core.propagation.XRayPropagator; +import datadog.trace.core.propagation.opg.OrgGuard; import datadog.trace.core.scopemanager.ContinuableScopeManager; import datadog.trace.core.servicediscovery.ServiceDiscovery; import datadog.trace.core.servicediscovery.ServiceDiscoveryFactory; @@ -113,7 +118,6 @@ import datadog.trace.util.AgentTaskScheduler; import java.io.IOException; import java.lang.ref.WeakReference; -import java.math.BigInteger; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -138,11 +142,8 @@ */ public class CoreTracer implements AgentTracer.TracerAPI, TracerFlare.Reporter { private static final Logger log = LoggerFactory.getLogger(CoreTracer.class); - // UINT64 max value - public static final BigInteger TRACE_ID_MAX = - BigInteger.valueOf(2).pow(64).subtract(BigInteger.ONE); - public static final CoreTracerBuilder builder() { + public static CoreTracerBuilder builder() { return new CoreTracerBuilder(); } @@ -827,11 +828,21 @@ private CoreTracer( sharedCommunicationObjects.whenReady(this.dataStreamsMonitoring::start); + propagationTagsFactory = PropagationTags.factory(config); + // Register context propagators - HttpCodec.Extractor tracingExtractor = + HttpCodec.Extractor baseExtractor = extractor == null ? HttpCodec.createExtractor(config, this::captureTraceConfig) : extractor; + OrgGuard orgGuard = + OrgGuard.create( + config, + featuresDiscovery::getOrgPropagationMarker, + propagationTagsFactory, + this.healthMetrics); + HttpCodec.Extractor tracingExtractor = orgGuard.decorateExtractor(baseExtractor); + HttpCodec.Injector tracingInjector = orgGuard.decorateInjector(injector); TracingPropagator tracingPropagator = - new TracingPropagator(config.isApmTracingEnabled(), injector, tracingExtractor); + new TracingPropagator(config.isApmTracingEnabled(), tracingInjector, tracingExtractor); Propagators.register(TRACING_CONCERN, tracingPropagator); Propagators.register(XRAY_TRACING_CONCERN, new XRayPropagator(config), false); if (config.isDataStreamsEnabled()) { @@ -889,7 +900,6 @@ private CoreTracer( StatusLogger.logStatus(config); - propagationTagsFactory = PropagationTags.factory(config); this.profilingContextIntegration = profilingContextIntegration; this.injectBaggageAsTags = injectBaggageAsTags; this.injectLinksAsTags = injectLinksAsTags; @@ -897,7 +907,7 @@ private CoreTracer( this.allowInferredServices = SpanNaming.instance().namingSchema().allowInferredServices(); if (profilingContextIntegration != ProfilingContextIntegration.NoOp.INSTANCE) { TagMap tmp = TagMap.fromMap(localRootSpanTags); - tmp.put(PROFILING_CONTEXT_ENGINE, profilingContextIntegration.name()); + tmp.set(PROFILING_CONTEXT_ENGINE, profilingContextIntegration.name()); this.localRootSpanTags = tmp.freeze(); } else { this.localRootSpanTags = TagMap.fromMapImmutable(localRootSpanTags); @@ -1153,12 +1163,13 @@ public void activateSpanWithoutScope(AgentSpan span) { } @Override + @SuppressWarnings("deprecation") public AgentScope.Continuation captureActiveSpan() { return scopeManager.captureActiveSpan(); } @Override - public AgentScope.Continuation captureSpan(final AgentSpan span) { + public ContextContinuation captureSpan(final AgentSpan span) { return scopeManager.captureSpan(span); } @@ -1248,7 +1259,8 @@ public void notifyExtensionEnd( } @Override - public void notifyAppSecEnd(AgentSpan span) { + public void notifyAppSecEnd(AgentSpan span, Object result) { + LambdaAppSecHandler.processResponseData(span, result); LambdaAppSecHandler.processRequestEnd(span); } @@ -1282,7 +1294,7 @@ void write(final SpanList trace) { boolean forceKeep = metricsAggregator.publish(writtenTrace); - TraceCollector traceCollector = writtenTrace.get(0).context().getTraceCollector(); + TraceCollector traceCollector = writtenTrace.get(0).spanContext().getTraceCollector(); traceCollector.setSamplingPriorityIfNecessary(); DDSpan rootSpan = traceCollector.getRootSpan(); @@ -1391,6 +1403,11 @@ public String getSpanId(AgentSpan span) { return "0"; } + @VisibleForTesting + TraceInterceptors getInterceptors() { + return interceptors; + } + @Override public boolean addTraceInterceptor(final TraceInterceptor interceptor) { TraceInterceptor conflictingInterceptor = interceptors.add(interceptor); @@ -1530,9 +1547,9 @@ public TraceSegment getTraceSegment() { if (activeSpan == null) { return null; } - AgentSpanContext ctx = activeSpan.context(); - if (ctx instanceof DDSpanContext) { - return ((DDSpanContext) ctx).getTraceSegment(); + AgentSpanContext spanContext = activeSpan.spanContext(); + if (spanContext instanceof DDSpanContext) { + return ((DDSpanContext) spanContext).getTraceSegment(); } return null; } @@ -1604,7 +1621,7 @@ protected static final DDSpan buildSpan( String serviceName, CharSequence operationName, String resourceName, - AgentSpanContext resolvedParentContext, + AgentSpanContext resolvedParentSpanContext, boolean ignoreScope, boolean errorFlag, CharSequence spanType, @@ -1624,7 +1641,7 @@ protected static final DDSpan buildSpan( serviceName, operationName, resourceName, - resolvedParentContext, + resolvedParentSpanContext, errorFlag, spanType, tagLedger, @@ -1650,30 +1667,30 @@ protected static final DDSpan buildSpanImpl( return span; } - private static final List addParentContextLink( - List links, AgentSpanContext parentContext) { + private static final List addParentSpanLink( + List links, AgentSpanContext parentSpanContext) { SpanLink link; - if (parentContext instanceof ExtractedContext) { - String headers = ((ExtractedContext) parentContext).getPropagationStyle().toString(); + if (parentSpanContext instanceof ExtractedContext) { + String headers = ((ExtractedContext) parentSpanContext).getPropagationStyle().toString(); SpanAttributes attributes = SpanAttributes.builder() .put("reason", "propagation_behavior_extract") .put("context_headers", headers) .build(); - link = DDSpanLink.from((ExtractedContext) parentContext, attributes); + link = DDSpanLink.from((ExtractedContext) parentSpanContext, attributes); } else { - link = SpanLink.from(parentContext); + link = SpanLink.from(parentSpanContext); } return addLink(links, link); } - protected static final List addTerminatedContextAsLinks( - List links, AgentSpanContext parentContext) { - if (parentContext instanceof TagContext) { - List terminatedContextLinks = - ((TagContext) parentContext).getTerminatedContextLinks(); - if (!terminatedContextLinks.isEmpty()) { - return addLinks(links, terminatedContextLinks); + protected static final List addTerminatedSpanAsLinks( + List links, AgentSpanContext parentSpanContext) { + if (parentSpanContext instanceof TagContext) { + List terminatedSpanLinks = + ((TagContext) parentSpanContext).getTerminatedSpanLinks(); + if (!terminatedSpanLinks.isEmpty()) { + return addLinks(links, terminatedSpanLinks); } } return links; @@ -1723,7 +1740,7 @@ protected static final AgentSpan startSpan( final CoreTracer tracer, String instrumentationName, CharSequence operationName, - AgentSpanContext specifiedParentContext, + AgentSpanContext specifiedParentSpanContext, boolean ignoreScope, long timestampMicros) { return startSpan( @@ -1734,7 +1751,7 @@ protected static final AgentSpan startSpan( null /* serviceName */, operationName, null /* resourceName */, - specifiedParentContext, + specifiedParentSpanContext, ignoreScope, false /* errorFlag */, null /* spanType */, @@ -1753,7 +1770,7 @@ protected static final AgentSpan startSpan( String serviceName, CharSequence operationName, String resourceName, - AgentSpanContext specifiedParentContext, + AgentSpanContext specifiedParentSpanContext, boolean ignoreScope, boolean errorFlag, CharSequence spanType, @@ -1763,34 +1780,46 @@ protected static final AgentSpan startSpan( Object builderRequestContextDataIast, Object builderCiVisibilityContextData) { // Find the parent context - AgentSpanContext parentContext = specifiedParentContext; - if (parentContext == null && !ignoreScope) { + AgentSpanContext parentSpanContext = specifiedParentSpanContext; + if (parentSpanContext == null && !ignoreScope) { // use the Scope as parent unless overridden or ignored. final AgentSpan activeSpan = tracer.scopeManager.activeSpan(); if (activeSpan != null) { - parentContext = activeSpan.context(); + parentSpanContext = activeSpan.spanContext(); } } - if (parentContext == BlackHoleSpan.Context.INSTANCE) { - return new BlackHoleSpan(parentContext.getTraceId()); + if (parentSpanContext == BlackHoleSpan.Context.INSTANCE) { + return new BlackHoleSpan(parentSpanContext.getTraceId()); } - // Handle remote terminated context as span links - if (parentContext != null && parentContext.isRemote()) { + // Handle remote terminated span context as span links + if (parentSpanContext != null && parentSpanContext.isRemote()) { + // Preserve AppSec/IAST request context before dropping the remote parent: when + // extract=IGNORE or RESTART the TagContext parent is nulled before buildSpanContext + // can copy requestContextDataAppSec/Iast into DDSpanContext. + if (parentSpanContext instanceof TagContext) { + TagContext tc = (TagContext) parentSpanContext; + if (builderRequestContextDataAppSec == null) { + builderRequestContextDataAppSec = tc.getRequestContextDataAppSec(); + } + if (builderRequestContextDataIast == null) { + builderRequestContextDataIast = tc.getRequestContextDataIast(); + } + } switch (Config.get().getTracePropagationBehaviorExtract()) { case RESTART: - links = addParentContextLink(links, parentContext); - parentContext = null; + links = addParentSpanLink(links, parentSpanContext); + parentSpanContext = null; break; case IGNORE: - parentContext = null; + parentSpanContext = null; break; case CONTINUE: default: - links = addTerminatedContextAsLinks(links, specifiedParentContext); + links = addTerminatedSpanAsLinks(links, specifiedParentSpanContext); break; } } @@ -1803,7 +1832,7 @@ protected static final AgentSpan startSpan( serviceName, operationName, resourceName, - parentContext, + parentSpanContext, ignoreScope, errorFlag, spanType, @@ -1868,7 +1897,7 @@ public final CoreSpanBuilder asChildOf(final AgentSpanContext spanContext) { } public final CoreSpanBuilder asChildOf(final AgentSpan agentSpan) { - parent = agentSpan.context(); + parent = agentSpan.spanContext(); return this; } @@ -1942,7 +1971,7 @@ protected static final DDSpanContext buildSpanContext( String serviceName, CharSequence operationName, String resourceName, - AgentSpanContext resolvedParentContext, + AgentSpanContext resolvedParentSpanContext, boolean errorFlag, CharSequence spanType, TagMap.Ledger tagLedger, @@ -1976,9 +2005,9 @@ protected static final DDSpanContext buildSpanContext( CharSequence serviceNameSource = MANUAL; // Propagate internal trace. // Note: if we are not in the context of distributed tracing, and we are starting the first - // root span, parentContext will be null at this point. - if (resolvedParentContext instanceof DDSpanContext) { - final DDSpanContext ddsc = (DDSpanContext) resolvedParentContext; + // root span, parentSpanContext will be null at this point. + if (resolvedParentSpanContext instanceof DDSpanContext) { + final DDSpanContext ddsc = (DDSpanContext) resolvedParentSpanContext; traceId = ddsc.getTraceId(); parentSpanId = ddsc.getSpanId(); baggage = ddsc.getBaggageItems(); @@ -1995,7 +2024,8 @@ protected static final DDSpanContext buildSpanContext( if (serviceName == null) { serviceName = parentServiceName; } - RequestContext requestContext = ((DDSpanContext) resolvedParentContext).getRequestContext(); + RequestContext requestContext = + ((DDSpanContext) resolvedParentSpanContext).getRequestContext(); if (requestContext != null) { requestContextDataAppSec = requestContext.getData(RequestContextSlot.APPSEC); requestContextDataIast = requestContext.getData(RequestContextSlot.IAST); @@ -2009,21 +2039,21 @@ protected static final DDSpanContext buildSpanContext( } else { long endToEndStartTime; - if (resolvedParentContext instanceof ExtractedContext) { + if (resolvedParentSpanContext instanceof ExtractedContext) { // Propagate external trace - final ExtractedContext extractedContext = (ExtractedContext) resolvedParentContext; + final ExtractedContext extractedContext = (ExtractedContext) resolvedParentSpanContext; traceId = extractedContext.getTraceId(); parentSpanId = extractedContext.getSpanId(); samplingPriority = extractedContext.getSamplingPriority(); endToEndStartTime = extractedContext.getEndToEndStartTime(); propagationTags = extractedContext.getPropagationTags(); - } else if (resolvedParentContext != null) { + } else if (resolvedParentSpanContext != null) { traceId = - resolvedParentContext.getTraceId() == DDTraceId.ZERO + resolvedParentSpanContext.getTraceId() == DDTraceId.ZERO ? tracer.idGenerationStrategy.generateTraceId() - : resolvedParentContext.getTraceId(); - parentSpanId = resolvedParentContext.getSpanId(); - samplingPriority = resolvedParentContext.getSamplingPriority(); + : resolvedParentSpanContext.getTraceId(); + parentSpanId = resolvedParentSpanContext.getSpanId(); + samplingPriority = resolvedParentSpanContext.getSamplingPriority(); endToEndStartTime = 0; propagationTags = tracer.propagationTagsFactory.empty(); } else { @@ -2038,8 +2068,8 @@ protected static final DDSpanContext buildSpanContext( ConfigSnapshot traceConfig; // Get header tags and set origin whether propagating or not. - if (resolvedParentContext instanceof TagContext) { - TagContext tc = (TagContext) resolvedParentContext; + if (resolvedParentSpanContext instanceof TagContext) { + TagContext tc = (TagContext) resolvedParentSpanContext; traceConfig = (ConfigSnapshot) tc.getTraceConfig(); coreTags = tc.getTags(); coreTagsNeedsIntercept = true; // maybe intercept isn't needed? @@ -2075,10 +2105,10 @@ protected static final DDSpanContext buildSpanContext( // Use parent pathwayContext if present and started pathwayContext = - resolvedParentContext != null - && resolvedParentContext.getPathwayContext() != null - && resolvedParentContext.getPathwayContext().isStarted() - ? resolvedParentContext.getPathwayContext() + resolvedParentSpanContext != null + && resolvedParentSpanContext.getPathwayContext() != null + && resolvedParentSpanContext.getPathwayContext().isStarted() + ? resolvedParentSpanContext.getPathwayContext() : tracer.dataStreamsMonitoring.newPathwayContext(); // when removing fake services the best upward service name to pick is the local root one @@ -2439,4 +2469,24 @@ static TagMap withTracerTags( } return result.freeze(); } + + @Override + public Context currentContext() { + return scopeManager.currentContext(); + } + + @Override + public ContextScope attach(Context context) { + return scopeManager.attach(context); + } + + @Override + public Context swap(Context context) { + return scopeManager.swap(context); + } + + @Override + public ContextContinuation capture(Context context) { + return scopeManager.capture(context); + } } diff --git a/dd-trace-core/src/main/java/datadog/trace/core/DDSpan.java b/dd-trace-core/src/main/java/datadog/trace/core/DDSpan.java index 6949ddf31de..a288c405e6f 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/DDSpan.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/DDSpan.java @@ -9,6 +9,7 @@ import static java.util.concurrent.TimeUnit.MILLISECONDS; import static java.util.concurrent.TimeUnit.NANOSECONDS; +import datadog.context.SelfScopedContext; import datadog.trace.api.Config; import datadog.trace.api.DDSpanId; import datadog.trace.api.DDTags; @@ -19,6 +20,7 @@ import datadog.trace.api.debugger.DebuggerConfigBridge; import datadog.trace.api.gateway.Flow; import datadog.trace.api.gateway.RequestContext; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.api.metrics.SpanMetricRegistry; import datadog.trace.api.metrics.SpanMetrics; import datadog.trace.api.sampling.PrioritySampling; @@ -31,7 +33,6 @@ import datadog.trace.bootstrap.instrumentation.api.ResourceNamePriorities; import datadog.trace.bootstrap.instrumentation.api.SpanWrapper; import datadog.trace.core.util.StackTraces; -import edu.umd.cs.findbugs.annotations.NonNull; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.util.Collections; import java.util.List; @@ -50,7 +51,8 @@ *

      Spans are created by the {@link CoreTracer#buildSpan}. This implementation adds some features * according to the DD agent. */ -public class DDSpan implements AgentSpan, CoreSpan, AttachableWrapper { +@SuppressWarnings("resource") +public class DDSpan implements AgentSpan, CoreSpan, AttachableWrapper, SelfScopedContext { private static final Logger log = LoggerFactory.getLogger(DDSpan.class); static DDSpan create( @@ -125,7 +127,8 @@ static DDSpan create( * @param timestampMicro if greater than zero, use this time instead of the current time * @param context the context used for the span */ - private DDSpan( + @VisibleForTesting + DDSpan( @Nonnull String instrumentationName, final long timestampMicro, @Nonnull DDSpanContext context, @@ -353,10 +356,10 @@ public DDSpan addThrowable(final Throwable error) { @Override public DDSpan addThrowable(Throwable error, byte errorPriority) { if (null != error) { - String message = error.getMessage(); + String message = StackTraces.safeGetMessage(error); if (!"broken pipe".equalsIgnoreCase(message) && (error.getCause() == null - || !"broken pipe".equalsIgnoreCase(error.getCause().getMessage()))) { + || !"broken pipe".equalsIgnoreCase(StackTraces.safeGetMessage(error.getCause())))) { // broken pipes happen when clients abort connections, // which might happen because the application is overloaded // or warming up - capturing the stack trace and keeping @@ -543,7 +546,7 @@ public U unsafeGetTag(CharSequence name) { @Override @Nonnull - public final DDSpanContext context() { + public final DDSpanContext spanContext() { return context; } @@ -680,6 +683,11 @@ public long getDurationNano() { return durationNano; } + @VisibleForTesting + void setDurationNano(long duration) { + DURATION_NANO_UPDATER.set(this, duration); + } + @Override public String getServiceName() { return context.getServiceName(); @@ -773,10 +781,8 @@ public void processTagsAndBaggage(final MetadataConsumer consumer) { } @Override - public void processTagsAndBaggage( - final MetadataConsumer consumer, boolean injectLinksAsTags, boolean injectBaggageAsTags) { - context.processTagsAndBaggage( - consumer, longRunningVersion, this, injectLinksAsTags, injectBaggageAsTags); + public void processTagsAndBaggageWithStructuredLinks(final MetadataConsumer consumer) { + context.processTagsAndBaggageWithStructuredLinks(consumer, longRunningVersion, this); } @Override @@ -869,7 +875,7 @@ public String toString() { } @Override - public void attachWrapper(@NonNull SpanWrapper wrapper) { + public void attachWrapper(@Nonnull SpanWrapper wrapper) { WRAPPER_FIELD_UPDATER.compareAndSet(this, null, wrapper); } @@ -953,10 +959,20 @@ public boolean isOutbound() { return ordinal == DDSpanContext.SPAN_KIND_CLIENT || ordinal == DDSpanContext.SPAN_KIND_PRODUCER; } + @Override + public boolean isKind(SpanKindFilter filter) { + return filter.matches(context.getSpanKindOrdinal()); + } + + @Override + public String getSpanKindString() { + return context.getSpanKindString(); + } + @Override public void copyPropagationAndBaggage(final AgentSpan source) { if (source instanceof DDSpan) { - final DDSpanContext sourceSpanContext = ((DDSpan) source).context(); + final DDSpanContext sourceSpanContext = ((DDSpan) source).spanContext(); // align the sampling priority for this span context setSamplingPriority(sourceSpanContext.getSamplingPriority(), DEFAULT); // the sampling mechanism determine the dm tag hence we need to override and lock the current diff --git a/dd-trace-core/src/main/java/datadog/trace/core/DDSpanContext.java b/dd-trace-core/src/main/java/datadog/trace/core/DDSpanContext.java index f2eb17fe8a2..6120502ec09 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/DDSpanContext.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/DDSpanContext.java @@ -582,8 +582,8 @@ private DDSpanContext getRootSpanContextOrThis() { private DDSpanContext getRootSpanContextIfDifferent() { if (traceCollector != null) { final DDSpan rootSpan = traceCollector.getRootSpan(); - if (null != rootSpan && rootSpan.context() != this) { - return rootSpan.context(); + if (null != rootSpan && rootSpan.spanContext() != this) { + return rootSpan.spanContext(); } } return null; @@ -669,8 +669,8 @@ public boolean lockSamplingPriority() { // the priority is just CAS'd against UNSET/UNKNOWN, unless it's forced to USER_KEEP/MANUAL // but is maintained for backwards compatibility, and returns false when it used to final DDSpan rootSpan = traceCollector.getRootSpan(); - if (null != rootSpan && rootSpan.context() != this) { - return rootSpan.context().lockSamplingPriority(); + if (null != rootSpan && rootSpan.spanContext() != this) { + return rootSpan.spanContext().lockSamplingPriority(); } return SAMPLING_PRIORITY_UPDATER.get(this) != PrioritySampling.UNSET; @@ -771,22 +771,26 @@ static boolean tagEquals(String tagValue, String tagLiteral) { * span.kind is set. */ public void setSpanKindOrdinal(String kind) { + spanKindOrdinal = spanKindOrdinalOf(kind); + } + + static byte spanKindOrdinalOf(String kind) { if (kind == null) { - spanKindOrdinal = SPAN_KIND_UNSET; + return SPAN_KIND_UNSET; } else if (tagEquals(kind, Tags.SPAN_KIND_SERVER)) { - spanKindOrdinal = SPAN_KIND_SERVER; + return SPAN_KIND_SERVER; } else if (tagEquals(kind, Tags.SPAN_KIND_CLIENT)) { - spanKindOrdinal = SPAN_KIND_CLIENT; + return SPAN_KIND_CLIENT; } else if (tagEquals(kind, Tags.SPAN_KIND_PRODUCER)) { - spanKindOrdinal = SPAN_KIND_PRODUCER; + return SPAN_KIND_PRODUCER; } else if (tagEquals(kind, Tags.SPAN_KIND_CONSUMER)) { - spanKindOrdinal = SPAN_KIND_CONSUMER; + return SPAN_KIND_CONSUMER; } else if (tagEquals(kind, Tags.SPAN_KIND_INTERNAL)) { - spanKindOrdinal = SPAN_KIND_INTERNAL; + return SPAN_KIND_INTERNAL; } else if (tagEquals(kind, Tags.SPAN_KIND_BROKER)) { - spanKindOrdinal = SPAN_KIND_BROKER; + return SPAN_KIND_BROKER; } else { - spanKindOrdinal = SPAN_KIND_CUSTOM; + return SPAN_KIND_CUSTOM; } } @@ -1048,12 +1052,16 @@ void setAllTags(final TagMap.Ledger ledger) { synchronized (unsafeTags) { for (final TagMap.EntryChange entryChange : ledger) { + String tag = entryChange.tag(); if (entryChange.isRemoval()) { - unsafeTags.remove(entryChange.tag()); + if (tagEquals(tag, Tags.SPAN_KIND)) { + // mirror removeTag(String): keep the cached ordinal in sync with unsafeTags + spanKindOrdinal = SPAN_KIND_UNSET; + } + unsafeTags.remove(tag); } else { TagMap.Entry entry = (TagMap.Entry) entryChange; - String tag = entry.tag(); Object value = entry.objectValue(); if (!tagInterceptor.interceptTag(this, tag, value)) { @@ -1191,6 +1199,20 @@ void processTagsAndBaggage( consumer, longRunningVersion, restrictedSpan, injectLinksAsTags, injectBaggageAsTags); } + /** + * Serialize span links as first-class structured data rather than tags. While baggage tag + * injection keeps following the tracer configuration. + */ + void processTagsAndBaggageWithStructuredLinks( + final MetadataConsumer consumer, int longRunningVersion, DDSpan restrictedSpan) { + processTagsAndBaggage( + consumer, + longRunningVersion, + restrictedSpan, + false, // injectLinksAsTags + injectBaggageAsTags); + } + void processTagsAndBaggage( final MetadataConsumer consumer, int longRunningVersion, diff --git a/dd-trace-core/src/main/java/datadog/trace/core/LongRunningTracesTracker.java b/dd-trace-core/src/main/java/datadog/trace/core/LongRunningTracesTracker.java index dbbd57b0c48..6002fce5415 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/LongRunningTracesTracker.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/LongRunningTracesTracker.java @@ -3,6 +3,7 @@ import datadog.communication.ddagent.DDAgentFeaturesDiscovery; import datadog.communication.ddagent.SharedCommunicationObjects; import datadog.trace.api.Config; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.core.monitor.HealthMetrics; import java.util.ArrayList; import java.util.List; @@ -140,12 +141,12 @@ private void flushStats() { expired = 0; } - // @VisibleForTesting + @VisibleForTesting int trackedCount() { return traceArray.size(); } - // @VisibleForTesting + @VisibleForTesting int getDropped() { return dropped; } diff --git a/dd-trace-core/src/main/java/datadog/trace/core/PendingTrace.java b/dd-trace-core/src/main/java/datadog/trace/core/PendingTrace.java index 47e60f6310a..d2f7a058ab5 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/PendingTrace.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/PendingTrace.java @@ -1,9 +1,10 @@ package datadog.trace.core; +import datadog.context.ContextContinuation; import datadog.metrics.api.Recording; import datadog.trace.api.DDTraceId; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.api.time.TimeSource; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.core.CoreTracer.ConfigSnapshot; import datadog.trace.core.monitor.HealthMetrics; import java.util.ArrayList; @@ -139,7 +140,8 @@ public PendingTrace create(@Nonnull DDTraceId traceId, ConfigSnapshot traceConfi private static final AtomicLongFieldUpdater LAST_REFERENCED = AtomicLongFieldUpdater.newUpdater(PendingTrace.class, "lastReferenced"); - private PendingTrace( + @VisibleForTesting + PendingTrace( @Nonnull CoreTracer tracer, @Nonnull DDTraceId traceId, @Nonnull PendingTraceBuffer pendingTraceBuffer, @@ -208,6 +210,7 @@ private void trackRunningTrace(final DDSpan span) { } Integer evaluateSamplingPriority() { + @SuppressWarnings("resource") DDSpan span = spans.peek(); if (span == null) { return null; @@ -223,16 +226,41 @@ boolean compareAndSetLongRunningState(int expected, int newState) { return LONG_RUNNING_STATE.compareAndSet(this, expected, newState); } - // @VisibleForTesting + @VisibleForTesting int getLongRunningTrackedState() { return longRunningTrackedState; } - // @VisibleForTesting + @VisibleForTesting void setLongRunningTrackedState(int state) { LONG_RUNNING_STATE.set(this, state); } + @VisibleForTesting + int getPendingReferenceCount() { + return pendingReferenceCount; + } + + @VisibleForTesting + PendingTraceBuffer getPendingTraceBuffer() { + return pendingTraceBuffer; + } + + @VisibleForTesting + DDTraceId getTraceId() { + return traceId; + } + + @VisibleForTesting + boolean isRootSpanWritten() { + return rootSpanWritten; + } + + @VisibleForTesting + int getIsEnqueued() { + return isEnqueued; + } + boolean empty() { return 0 >= COMPLETED_SPAN_COUNT.get(this) + PENDING_REFERENCE_COUNT.get(this); } @@ -277,12 +305,12 @@ public long oldestFinishedTime() { * completed, so we need to wait till continuations are de-referenced before reporting. */ @Override - public void registerContinuation(final AgentScope.Continuation continuation) { + public void registerContinuation(final ContextContinuation continuation) { PENDING_REFERENCE_COUNT.incrementAndGet(this); } @Override - public void removeContinuation(final AgentScope.Continuation continuation) { + public void removeContinuation(final ContextContinuation continuation) { decrementRefAndMaybeWrite(false, false); } @@ -466,7 +494,7 @@ public static long getDurationNano(CoreSpan span) { return duration; } DDSpan ddSpan = (DDSpan) span; - TraceCollector traceCollector = ddSpan.context().getTraceCollector(); + TraceCollector traceCollector = ddSpan.spanContext().getTraceCollector(); if (!(traceCollector instanceof PendingTrace)) { throw new IllegalArgumentException( "Expected " diff --git a/dd-trace-core/src/main/java/datadog/trace/core/PendingTraceBuffer.java b/dd-trace-core/src/main/java/datadog/trace/core/PendingTraceBuffer.java index ad89c996d90..c0e8de95a5c 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/PendingTraceBuffer.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/PendingTraceBuffer.java @@ -11,6 +11,7 @@ import datadog.communication.ddagent.SharedCommunicationObjects; import datadog.trace.api.Config; import datadog.trace.api.flare.TracerFlare; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.api.time.TimeSource; import datadog.trace.common.writer.TraceDumpJsonExporter; import datadog.trace.core.monitor.HealthMetrics; @@ -304,10 +305,20 @@ public DelayingPendingTraceBuffer( : null; } - // @VisibleForTesting + @VisibleForTesting LongRunningTracesTracker getRunningTracesTracker() { return runningTracesTracker; } + + @VisibleForTesting + Thread getWorker() { + return worker; + } + + @VisibleForTesting + MessagePassingBlockingQueue getQueue() { + return queue; + } } static class DiscardingPendingTraceBuffer extends PendingTraceBuffer { diff --git a/dd-trace-core/src/main/java/datadog/trace/core/SpanKindFilter.java b/dd-trace-core/src/main/java/datadog/trace/core/SpanKindFilter.java new file mode 100644 index 00000000000..bc236768c26 --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/core/SpanKindFilter.java @@ -0,0 +1,70 @@ +package datadog.trace.core; + +/** + * Bitmask-based eligibility test over the six recognized {@code span.kind} values (server, client, + * producer, consumer, internal, broker). A filter is built once via {@link #builder()} and then + * applied per span by either matching a cached kind ordinal (fast path on {@link DDSpan}) or + * looking up the {@code span.kind} tag (default path on {@link CoreSpan#isKind}). + * + *

      Arbitrary {@code span.kind} strings outside the six recognized values collapse to {@link + * DDSpanContext#SPAN_KIND_CUSTOM} and never match — by design. Callers that need custom-string + * matching should read the tag directly via {@link CoreSpan#unsafeGetTag} instead. + */ +public final class SpanKindFilter { + public static final class Builder { + private int kindMask; + + public Builder includeServer() { + return this.include(DDSpanContext.SPAN_KIND_SERVER); + } + + public Builder includeClient() { + return this.include(DDSpanContext.SPAN_KIND_CLIENT); + } + + public Builder includeProducer() { + return this.include(DDSpanContext.SPAN_KIND_PRODUCER); + } + + public Builder includeConsumer() { + return this.include(DDSpanContext.SPAN_KIND_CONSUMER); + } + + public Builder includeInternal() { + return this.include(DDSpanContext.SPAN_KIND_INTERNAL); + } + + public Builder includeBroker() { + return this.include(DDSpanContext.SPAN_KIND_BROKER); + } + + public final SpanKindFilter build() { + return new SpanKindFilter(this.kindMask); + } + + private Builder include(int spanKindConstant) { + this.kindMask |= (1 << spanKindConstant); + return this; + } + } + + public static final Builder builder() { + return new Builder(); + } + + private final int kindMask; + + private SpanKindFilter(int kindMask) { + this.kindMask = kindMask; + } + + /** Test whether a span with the given span.kind string passes this filter. */ + public boolean matches(String spanKind) { + return matches(DDSpanContext.spanKindOrdinalOf(spanKind)); + } + + /** Fast-path test for callers that already hold the span's cached kind ordinal. */ + public boolean matches(byte spanKindOrdinal) { + return (kindMask & (1 << spanKindOrdinal)) != 0; + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/core/StreamingTraceCollector.java b/dd-trace-core/src/main/java/datadog/trace/core/StreamingTraceCollector.java index e886682f05b..40392df7b2d 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/StreamingTraceCollector.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/StreamingTraceCollector.java @@ -1,8 +1,8 @@ package datadog.trace.core; +import datadog.context.ContextContinuation; import datadog.trace.api.DDTraceId; import datadog.trace.api.time.TimeSource; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.core.monitor.HealthMetrics; import java.util.concurrent.atomic.AtomicReferenceFieldUpdater; import javax.annotation.Nonnull; @@ -76,12 +76,12 @@ PublishState onPublish(DDSpan span) { } @Override - public void registerContinuation(AgentScope.Continuation continuation) { + public void registerContinuation(ContextContinuation continuation) { // do nothing } @Override - public void removeContinuation(AgentScope.Continuation continuation) { + public void removeContinuation(ContextContinuation continuation) { // do nothing } } diff --git a/dd-trace-core/src/main/java/datadog/trace/core/TraceCollector.java b/dd-trace-core/src/main/java/datadog/trace/core/TraceCollector.java index 777fc3889bf..4cb9a3edb42 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/TraceCollector.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/TraceCollector.java @@ -64,12 +64,13 @@ public void setSamplingPriorityIfNecessary() { // Locks inside DDSpanContext ensure the correct behavior in the race case DDSpan rootSpan = getRootSpan(); if (traceConfig.sampler instanceof PrioritySampler && rootSpan != null) { - // Ignore the force-keep priority in the absence of propagated _dd.p.ts span tag marked for - // ASM. + // Skip sampler override when _dd.p.ts is marked for ASM or AI Guard. if ((!Config.get().isApmTracingEnabled() && !ProductTraceSource.isProductMarked( - rootSpan.context().getPropagationTags().getTraceSource(), ProductTraceSource.ASM)) - || rootSpan.context().getSamplingPriority() == PrioritySampling.UNSET) { + rootSpan.spanContext().getPropagationTags().getTraceSource(), + ProductTraceSource.ASM, + ProductTraceSource.AI_GUARD)) + || rootSpan.spanContext().getSamplingPriority() == PrioritySampling.UNSET) { ((PrioritySampler) traceConfig.sampler).setSamplingPriority(rootSpan); } } diff --git a/dd-trace-core/src/main/java/datadog/trace/core/baggage/BaggagePropagator.java b/dd-trace-core/src/main/java/datadog/trace/core/baggage/BaggagePropagator.java index f0375af964f..114f2668790 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/baggage/BaggagePropagator.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/baggage/BaggagePropagator.java @@ -129,7 +129,7 @@ public Context extract(Context context, C carrier, CarrierVisitor visitor // TODO: consider a better way to link baggage with the extracted (legacy) TagContext AgentSpan extractedSpan = AgentSpan.fromContext(context); if (extractedSpan != null) { - AgentSpanContext extractedSpanContext = extractedSpan.context(); + AgentSpanContext extractedSpanContext = extractedSpan.spanContext(); if (extractedSpanContext instanceof TagContext) { ((TagContext) extractedSpanContext).setW3CBaggage(baggage); } @@ -209,7 +209,10 @@ private Baggage parseBaggageHeaders(String input) { } @Override - public void accept(String key, String value) { + public void accept(String key, @Nullable String value) { + if (value == null) { + return; + } // Only process tags that are relevant to baggage if (BAGGAGE_KEY.equalsIgnoreCase(key)) { Baggage parsed = parseBaggageHeaders(value); diff --git a/dd-trace-core/src/main/java/datadog/trace/core/datastreams/DataStreamsPropagator.java b/dd-trace-core/src/main/java/datadog/trace/core/datastreams/DataStreamsPropagator.java index 3aba15aca42..4258adce274 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/datastreams/DataStreamsPropagator.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/datastreams/DataStreamsPropagator.java @@ -43,7 +43,7 @@ public void inject(Context context, C carrier, CarrierSetter setter) { PathwayContext pathwayContext; DataStreamsContext dsmContext; if ((span = AgentSpan.fromContext(context)) == null - || (pathwayContext = span.context().getPathwayContext()) == null + || (pathwayContext = span.spanContext().getPathwayContext()) == null || (dsmContext = DataStreamsContext.fromContext(context)) == null || !traceConfig().isDataStreamsEnabled()) { return; @@ -97,7 +97,7 @@ private TagContext getSpanContextOrNull(Context context) { AgentSpan extractedSpan = AgentSpan.fromContext(context); AgentSpanContext extractedSpanContext; if (extractedSpan != null - && (extractedSpanContext = extractedSpan.context()) instanceof TagContext) { + && (extractedSpanContext = extractedSpan.spanContext()) instanceof TagContext) { return (TagContext) extractedSpanContext; } return null; diff --git a/dd-trace-core/src/main/java/datadog/trace/core/datastreams/DefaultDataStreamsMonitoring.java b/dd-trace-core/src/main/java/datadog/trace/core/datastreams/DefaultDataStreamsMonitoring.java index 32db178bc1a..b6487c2c99d 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/datastreams/DefaultDataStreamsMonitoring.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/datastreams/DefaultDataStreamsMonitoring.java @@ -1,6 +1,7 @@ package datadog.trace.core.datastreams; import static datadog.communication.ddagent.DDAgentFeaturesDiscovery.V01_DATASTREAMS_ENDPOINT; +import static datadog.trace.api.DDTags.PATHWAY_HASH; import static datadog.trace.api.datastreams.DataStreamsContext.fromTags; import static datadog.trace.api.datastreams.DataStreamsTags.Direction.INBOUND; import static datadog.trace.api.datastreams.DataStreamsTags.Direction.OUTBOUND; @@ -262,7 +263,7 @@ public void mergePathwayContextIntoSpan(AgentSpan span, DataStreamsContextCarrie DataStreamsContextCarrierAdapter.INSTANCE, this.timeSource, getThreadServiceName()); - ((DDSpan) span).context().mergePathwayContext(pathwayContext); + ((DDSpan) span).spanContext().mergePathwayContext(pathwayContext); } } @@ -306,9 +307,13 @@ public void reportKafkaConfig( @Override public void setCheckpoint(AgentSpan span, DataStreamsContext context) { - PathwayContext pathwayContext = span.context().getPathwayContext(); + PathwayContext pathwayContext = span.spanContext().getPathwayContext(); if (pathwayContext != null) { pathwayContext.setCheckpoint(context, this::add); + long pathwayHash = pathwayContext.getHash(); + if (pathwayHash != 0) { + span.setTag(PATHWAY_HASH, Long.toUnsignedString(pathwayHash)); + } } } diff --git a/dd-trace-core/src/main/java/datadog/trace/core/monitor/HealthMetrics.java b/dd-trace-core/src/main/java/datadog/trace/core/monitor/HealthMetrics.java index 257d887029b..e506732777f 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/monitor/HealthMetrics.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/monitor/HealthMetrics.java @@ -2,6 +2,7 @@ import datadog.trace.common.writer.RemoteApi; import datadog.trace.core.DDSpan; +import datadog.trace.core.propagation.opg.OrgGuard; import java.util.List; /** @@ -65,6 +66,12 @@ public void onCloseScope() {} public void onScopeStackOverflow() {} + /** + * Reports that the Org Propagation Guard dropped the inbound Datadog context for an extracted + * trace. + */ + public void onOrgGuardEnforce(OrgGuard.Reason reason) {} + public void onSend( final int traceCount, final int sizeInBytes, final RemoteApi.Response response) {} @@ -93,6 +100,20 @@ public void onClientStatDowngraded() {} public void onStatsAggregateDropped() {} + /** + * Reports a single span whose stats snapshot was dropped because the aggregator inbox was full. + */ + public void onStatsInboxFull() {} + + /** + * Reports a batch of {@code count} tag values collapsed into the {@code blocked_by_tracer} + * sentinel for {@code tag} during the just-completed reporting cycle (per-tag cardinality budget + * exhausted, or per-value length cap exceeded). Called from the aggregator thread once per + * affected tag at cycle reset, so the implementation can do a single counter update rather than + * one per blocked value. + */ + public void onTagCardinalityBlocked(String[] statsDTag, long count) {} + /** * @return Human-readable summary of the current health metrics. */ diff --git a/dd-trace-core/src/main/java/datadog/trace/core/monitor/TracerHealthMetrics.java b/dd-trace-core/src/main/java/datadog/trace/core/monitor/TracerHealthMetrics.java index 2df54241e56..f9c76ff0766 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/monitor/TracerHealthMetrics.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/monitor/TracerHealthMetrics.java @@ -13,6 +13,7 @@ import datadog.trace.api.cache.RadixTreeCache; import datadog.trace.common.writer.RemoteApi; import datadog.trace.core.DDSpan; +import datadog.trace.core.propagation.opg.OrgGuard; import datadog.trace.util.AgentTaskScheduler; import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; import java.util.List; @@ -30,6 +31,7 @@ public class TracerHealthMetrics extends HealthMetrics implements AutoCloseable httpStatus -> new String[] {"status:" + httpStatus}; private static final String[] NO_TAGS = new String[0]; + private static final String[] COLLAPSED_WHOLE_KEY_TAGS = new String[] {"collapsed:whole_key"}; private static final String[] STATUS_OK_TAGS = STATUS_TAGS.apply(200); private final RadixTreeCache statusTagsCache = new RadixTreeCache<>(16, 32, STATUS_TAGS, 200, 400); @@ -89,6 +91,9 @@ public class TracerHealthMetrics extends HealthMetrics implements AutoCloseable private final LongAdder longRunningTracesDropped = new LongAdder(); private final LongAdder longRunningTracesExpired = new LongAdder(); + private final LongAdder orgGuardEnforceMismatch = new LongAdder(); + private final LongAdder orgGuardEnforceStrictMissing = new LongAdder(); + private final LongAdder clientStatsProcessedSpans = new LongAdder(); private final LongAdder clientStatsProcessedTraces = new LongAdder(); private final LongAdder clientStatsP0DroppedSpans = new LongAdder(); @@ -98,6 +103,7 @@ public class TracerHealthMetrics extends HealthMetrics implements AutoCloseable private final LongAdder clientStatsDowngrades = new LongAdder(); private final LongAdder statsAggregateDropped = new LongAdder(); + private final LongAdder statsInboxFull = new LongAdder(); private final StatsDClient statsd; private final long interval; @@ -285,6 +291,18 @@ public void onScopeStackOverflow() { scopeStackOverflow.increment(); } + @Override + public void onOrgGuardEnforce(OrgGuard.Reason reason) { + switch (reason) { + case MISMATCH: + orgGuardEnforceMismatch.increment(); + break; + case STRICT_MISSING: + orgGuardEnforceStrictMissing.increment(); + break; + } + } + @Override public void onSend( final int traceCount, final int sizeInBytes, final RemoteApi.Response response) { @@ -355,6 +373,17 @@ public void onClientStatErrorReceived() { @Override public void onStatsAggregateDropped() { statsAggregateDropped.increment(); + statsd.count("datadog.tracer.stats.collapsed_spans", 1, COLLAPSED_WHOLE_KEY_TAGS); + } + + @Override + public void onStatsInboxFull() { + statsInboxFull.increment(); + } + + @Override + public void onTagCardinalityBlocked(String[] statsDTag, long count) { + statsd.count("datadog.tracer.stats.collapsed_spans", count, statsDTag); } @Override @@ -374,8 +403,12 @@ private static class Flush implements AgentTaskScheduler.Task) value); + break; + case BOOLEAN_ARRAY_ATTRIBUTE: + writeArrayValue(writer, BOOLEAN_ATTRIBUTE, (List) value); + break; + case LONG_ARRAY_ATTRIBUTE: + writeArrayValue(writer, LONG_ATTRIBUTE, (List) value); + break; + case DOUBLE_ARRAY_ATTRIBUTE: + writeArrayValue(writer, DOUBLE_ATTRIBUTE, (List) value); + break; + default: + throw new IllegalArgumentException("Unknown attribute type: " + type); + } + writer.endObject(); + } + + public static void writeAttribute(JsonWriter writer, UTF8BytesString key, String value) { + writeAttribute(writer, STRING_ATTRIBUTE, key.toString(), value); + } + + public static void writeAttribute(JsonWriter writer, UTF8BytesString key, long value) { + writeAttributeKey(writer, key); + writeIntValue(writer, value); + writer.endObject(); + } + + private static void writeAttributeKey(JsonWriter writer, CharSequence key) { + writer.beginObject(); + writer.name("key").value(key.toString()); + writer.name("value"); + } + + private static void writeArrayValue(JsonWriter writer, int elementType, List values) { + writer.beginObject(); + writer.name("arrayValue").beginObject(); + writer.name("values").beginArray(); + for (Object value : values) { + writeAnyValue(writer, elementType, value); + } + writer.endArray(); + writer.endObject(); + writer.endObject(); + } + + private static void writeAnyValue(JsonWriter writer, int type, Object value) { + switch (type) { + case STRING_ATTRIBUTE: + writeStringValue(writer, (String) value); + break; + case BOOLEAN_ATTRIBUTE: + writeBooleanValue(writer, (boolean) value); + break; + case LONG_ATTRIBUTE: + writeIntValue(writer, ((Number) value).longValue()); + break; + case DOUBLE_ATTRIBUTE: + writeDoubleValue(writer, ((Number) value).doubleValue()); + break; + default: + throw new IllegalArgumentException("Unknown attribute type: " + type); + } + } + + private static void writeStringValue(JsonWriter writer, String value) { + writer.beginObject().name("stringValue").value(value).endObject(); + } + + private static void writeBooleanValue(JsonWriter writer, boolean value) { + writer.beginObject().name("boolValue").value(value).endObject(); + } + + private static void writeIntValue(JsonWriter writer, long value) { + // int64 fields are encoded as decimal strings, per the OTLP JSON encoding spec + writer.beginObject().name("intValue").value(Long.toString(value)).endObject(); + } + + private static void writeDoubleValue(JsonWriter writer, double value) { + writer.beginObject().name("doubleValue"); + writeDouble(writer, value); + writer.endObject(); + } + + /** Writes a double per the OTLP/ProtoJSON encoding spec: NaN/Infinity as JSON strings. */ + public static void writeDouble(JsonWriter writer, double value) { + if (Double.isNaN(value)) { + writer.value("NaN"); + } else if (Double.isInfinite(value)) { + writer.value(value > 0 ? "Infinity" : "-Infinity"); + } else { + writer.value(value); + } + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpHttpSender.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpHttpSender.java index 5f8a199b278..9f6bd3b05c3 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpHttpSender.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpHttpSender.java @@ -54,6 +54,10 @@ public OtlpHttpSender( this.client = buildHttpClient(isPlainHttp(url), unixDomainSocketPath, null, timeoutMillis); } + public HttpUrl url() { + return url; + } + @Override public void send(OtlpPayload payload) { Request request = makeRequest(payload); diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpPayload.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpPayload.java index a846fdb4ecf..87c2adf760d 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpPayload.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpPayload.java @@ -3,6 +3,9 @@ import java.nio.ByteBuffer; public final class OtlpPayload { + public static final String PROTOBUF_CONTENT_TYPE = "application/x-protobuf"; + public static final String JSON_CONTENT_TYPE = "application/json"; + public static final OtlpPayload EMPTY = new OtlpPayload(ByteBuffer.allocate(0), ""); private final ByteBuffer content; diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpProtoBuffer.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpProtoBuffer.java index f60a3cda6be..eab87bf6096 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpProtoBuffer.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpProtoBuffer.java @@ -3,6 +3,7 @@ import static datadog.trace.core.otlp.common.OtlpCommonProto.LEN_WIRE_TYPE; import static datadog.trace.core.otlp.common.OtlpCommonProto.sizeVarInt; import static datadog.trace.core.otlp.common.OtlpCommonProto.writeVarInt; +import static datadog.trace.core.otlp.common.OtlpPayload.PROTOBUF_CONTENT_TYPE; import static datadog.trace.util.BitUtils.nextPowerOfTwo; import datadog.communication.serialization.GrowableBuffer; @@ -17,8 +18,6 @@ * @see GrowableBuffer */ public final class OtlpProtoBuffer { - private static final String PROTOBUF_CONTENT_TYPE = "application/x-protobuf"; - private final int initialCapacity; private ByteBuffer buffer; private int remaining; diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpResourceAttributes.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpResourceAttributes.java new file mode 100644 index 00000000000..1a56ad2216e --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpResourceAttributes.java @@ -0,0 +1,107 @@ +package datadog.trace.core.otlp.common; + +import static datadog.communication.ddagent.TracerVersion.TRACER_VERSION; +import static java.util.Arrays.asList; + +import datadog.trace.api.Config; +import datadog.trace.api.ProcessTags; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; +import java.util.function.BiConsumer; + +/** Enumerates the resource attributes shared by the proto and JSON "resource.proto" encoders. */ +final class OtlpResourceAttributes { + private OtlpResourceAttributes() {} + + /** Prefix applied to {@code datadog.runtime_id} and process-tag resource attributes. */ + private static final String DATADOG_PREFIX = "datadog."; + + /** Marks that the Agent should not recompute trace metrics from the exported spans. */ + private static final String STATS_COMPUTED_KEY = "_dd.stats_computed"; + + private static final Set IGNORED_GLOBAL_TAGS = + new HashSet<>( + asList( + "service", + "env", + "version", + "service.name", + "deployment.environment.name", + "service.version", + "telemetry.sdk.name", + "telemetry.sdk.version", + "telemetry.sdk.language")); + + /** Visits each resource attribute key/value pair with {@code visitor}. */ + static void visitResourceAttributes( + Config config, Map extraAttributes, BiConsumer visitor) { + String serviceName = config.getServiceName(); + String env = config.getEnv(); + String version = config.getVersion(); + + visitor.accept("service.name", serviceName); + if (!env.isEmpty()) { + visitor.accept("deployment.environment.name", env); + } + if (!version.isEmpty()) { + visitor.accept("service.version", version); + } + if (config.isReportHostName()) { + String hostName = config.getHostName(); + if (hostName != null && !hostName.isEmpty()) { + visitor.accept("host.name", hostName); + } + } + visitor.accept("telemetry.sdk.name", "datadog"); + visitor.accept("telemetry.sdk.version", TRACER_VERSION); + visitor.accept("telemetry.sdk.language", "java"); + + config + .getGlobalTags() + .forEach( + (key, value) -> { + // ignore datadog tags and their otel equivalents that we map above + if (!IGNORED_GLOBAL_TAGS.contains(key.toLowerCase(Locale.ROOT))) { + visitor.accept(key, value); + } + }); + + extraAttributes.forEach(visitor); + } + + /** + * Builds the extra resource attributes for the OTLP trace export: the {@code _dd.stats_computed} + * marker when the SDK is computing OTLP span metrics, so a downstream Agent does not recompute + * them from the exported spans. + */ + static Map traceResourceAttributes(Config config) { + Map attributes = new LinkedHashMap<>(); + if (config.isOtelTracesSpanMetricsEnabled()) { + attributes.put(STATS_COMPUTED_KEY, "true"); + } + return attributes; + } + + static Map datadogResourceAttributes(Config config) { + Map attributes = new LinkedHashMap<>(); + String runtimeId = config.getRuntimeId(); + if (runtimeId != null && !runtimeId.isEmpty()) { + attributes.put(DATADOG_PREFIX + "runtime_id", runtimeId); + } + // Process tags arrive as "key:value" pairs; emit each as datadog. = value. + List processTags = ProcessTags.getTagsAsStringList(); + if (processTags != null) { + for (String tag : processTags) { + int colon = tag.indexOf(':'); + if (colon > 0) { + attributes.put(DATADOG_PREFIX + tag.substring(0, colon), tag.substring(colon + 1)); + } + } + } + return attributes; + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpResourceJson.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpResourceJson.java new file mode 100644 index 00000000000..4731bcd592a --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpResourceJson.java @@ -0,0 +1,55 @@ +package datadog.trace.core.otlp.common; + +import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.STRING_ATTRIBUTE; +import static datadog.trace.core.otlp.common.OtlpCommonJson.writeAttribute; +import static datadog.trace.core.otlp.common.OtlpResourceAttributes.datadogResourceAttributes; +import static datadog.trace.core.otlp.common.OtlpResourceAttributes.traceResourceAttributes; +import static datadog.trace.core.otlp.common.OtlpResourceAttributes.visitResourceAttributes; + +import datadog.json.JsonWriter; +import datadog.trace.api.Config; +import java.util.Collections; +import java.util.Map; + +/** Provides a canned JSON fragment for OpenTelemetry's "resource.proto" JSON encoding. */ +public final class OtlpResourceJson { + private OtlpResourceJson() {} + + /** Vendor-neutral resource (no {@code datadog.*}). Used by the OTLP metric export. */ + public static final String RESOURCE_FRAGMENT = + buildResourceFragment(Config.get(), Collections.emptyMap()); + + /** + * Resource that additionally carries {@code datadog.runtime_id} and process tags (each prefixed + * {@code datadog.}). Used by the default-mode SDK trace-metrics export; omitted in OTel-semantics + * mode. + */ + public static final String RESOURCE_FRAGMENT_WITH_DATADOG_ATTRS = + buildResourceFragment(Config.get(), datadogResourceAttributes(Config.get())); + + /** + * Resource used by the OTLP trace export. Identical to {@link #RESOURCE_FRAGMENT} but adds the + * {@code _dd.stats_computed} marker when the SDK is computing OTLP span metrics, so a downstream + * Agent does not recompute them from the exported spans. + */ + public static final String TRACE_RESOURCE_FRAGMENT = + buildResourceFragment(Config.get(), traceResourceAttributes(Config.get())); + + static String buildResourceFragment(Config config, Map extraAttributes) { + try (JsonWriter writer = new JsonWriter()) { + writer.beginObject(); + writer.name("attributes").beginArray(); + + visitResourceAttributes( + config, extraAttributes, (key, value) -> writeResourceAttribute(writer, key, value)); + + writer.endArray(); + writer.endObject(); + return writer.toString(); + } + } + + private static void writeResourceAttribute(JsonWriter writer, String key, String value) { + writeAttribute(writer, STRING_ATTRIBUTE, key, value); + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpResourceProto.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpResourceProto.java index 0e45aa22ab7..91a6cf7193c 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpResourceProto.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpResourceProto.java @@ -1,65 +1,48 @@ package datadog.trace.core.otlp.common; -import static datadog.communication.ddagent.TracerVersion.TRACER_VERSION; import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.STRING_ATTRIBUTE; import static datadog.trace.core.otlp.common.OtlpCommonProto.LEN_WIRE_TYPE; import static datadog.trace.core.otlp.common.OtlpCommonProto.writeAttribute; import static datadog.trace.core.otlp.common.OtlpCommonProto.writeTag; +import static datadog.trace.core.otlp.common.OtlpResourceAttributes.datadogResourceAttributes; +import static datadog.trace.core.otlp.common.OtlpResourceAttributes.traceResourceAttributes; +import static datadog.trace.core.otlp.common.OtlpResourceAttributes.visitResourceAttributes; import datadog.communication.serialization.GrowableBuffer; import datadog.communication.serialization.StreamingBuffer; import datadog.trace.api.Config; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Locale; -import java.util.Set; +import java.util.Collections; +import java.util.Map; /** Provides a canned message for OpenTelemetry's "resource.proto" wire protocol. */ public final class OtlpResourceProto { private OtlpResourceProto() {} - private static final Set IGNORED_GLOBAL_TAGS = - new HashSet<>( - Arrays.asList( - "service", - "env", - "version", - "service.name", - "deployment.environment.name", - "service.version", - "telemetry.sdk.name", - "telemetry.sdk.version", - "telemetry.sdk.language")); - - public static final byte[] RESOURCE_MESSAGE = buildResourceMessage(Config.get()); - - static byte[] buildResourceMessage(Config config) { + /** Vendor-neutral resource (no {@code datadog.*}). Used by the OTLP metric export. */ + public static final byte[] RESOURCE_MESSAGE = + buildResourceMessage(Config.get(), Collections.emptyMap()); + + /** + * Resource that additionally carries {@code datadog.runtime_id} and process tags (each prefixed + * {@code datadog.}). Used by the default-mode SDK trace-metrics export; omitted in OTel-semantics + * mode. + */ + public static final byte[] RESOURCE_MESSAGE_WITH_DATADOG_ATTRS = + buildResourceMessage(Config.get(), datadogResourceAttributes(Config.get())); + + /** + * Resource used by the OTLP trace export. Identical to {@link #RESOURCE_MESSAGE} but adds the + * {@code _dd.stats_computed} marker when the SDK is computing OTLP span metrics, so a downstream + * Agent does not recompute them from the exported spans. + */ + public static final byte[] TRACE_RESOURCE_MESSAGE = + buildResourceMessage(Config.get(), traceResourceAttributes(Config.get())); + + static byte[] buildResourceMessage(Config config, Map extraAttributes) { GrowableBuffer buf = new GrowableBuffer(512); - String serviceName = config.getServiceName(); - String env = config.getEnv(); - String version = config.getVersion(); - - writeResourceAttribute(buf, "service.name", serviceName); - if (!env.isEmpty()) { - writeResourceAttribute(buf, "deployment.environment.name", env); - } - if (!version.isEmpty()) { - writeResourceAttribute(buf, "service.version", version); - } - writeResourceAttribute(buf, "telemetry.sdk.name", "datadog"); - writeResourceAttribute(buf, "telemetry.sdk.version", TRACER_VERSION); - writeResourceAttribute(buf, "telemetry.sdk.language", "java"); - - config - .getGlobalTags() - .forEach( - (key, value) -> { - // ignore datadog tags and their otel equivalents that we map above - if (!IGNORED_GLOBAL_TAGS.contains(key.toLowerCase(Locale.ROOT))) { - writeResourceAttribute(buf, key, value); - } - }); + visitResourceAttributes( + config, extraAttributes, (key, value) -> writeResourceAttribute(buf, key, value)); OtlpProtoBuffer protobuf = new OtlpProtoBuffer(buf.capacity()); int numBytes = protobuf.recordMessage(buf, 1); diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpTraceFlags.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpTraceFlags.java new file mode 100644 index 00000000000..eb9d4d5b389 --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/common/OtlpTraceFlags.java @@ -0,0 +1,10 @@ +package datadog.trace.core.otlp.common; + +/** OTLP's {@code Span.flags} bit values, shared by the trace and logs proto/JSON encoders. */ +public final class OtlpTraceFlags { + private OtlpTraceFlags() {} + + public static final int NO_TRACE_FLAGS = 0x00000000; + public static final int SAMPLED_TRACE_FLAG = 0x00000001; + public static final int REMOTE_TRACE_FLAG = 0x00000300; +} diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/logs/OtlpLogsJson.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/logs/OtlpLogsJson.java new file mode 100644 index 00000000000..d356a53ab46 --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/logs/OtlpLogsJson.java @@ -0,0 +1,42 @@ +package datadog.trace.core.otlp.logs; + +import static datadog.trace.core.otlp.common.OtlpCommonJson.hexSpanId; +import static datadog.trace.core.otlp.common.OtlpCommonJson.hexTraceId; +import static datadog.trace.core.otlp.common.OtlpTraceFlags.SAMPLED_TRACE_FLAG; + +import datadog.json.JsonWriter; +import datadog.trace.bootstrap.otlp.logs.OtlpLogRecord; + +/** Provides writers for OpenTelemetry's "logs.proto" JSON encoding. */ +public final class OtlpLogsJson { + private OtlpLogsJson() {} + + /** + * Writes a log record's non-attribute fields into the currently open {@code LogRecord} object. + */ + public static void writeLogRecordFields(JsonWriter writer, OtlpLogRecord logRecord) { + writer.name("timeUnixNano").value(Long.toString(logRecord.timestampNanos)); + writer.name("observedTimeUnixNano").value(Long.toString(logRecord.observedNanos)); + writer.name("severityNumber").value(logRecord.severityNumber); + + if (logRecord.severityText != null) { + writer.name("severityText").value(logRecord.severityText); + } + + if (logRecord.body != null) { + writer.name("body").beginObject().name("stringValue").value(logRecord.body).endObject(); + } + + if (logRecord.spanContext != null) { + writer.name("traceId").value(hexTraceId(logRecord.spanContext.getTraceId())); + writer.name("spanId").value(hexSpanId(logRecord.spanContext.getSpanId())); + if (logRecord.spanContext.getSamplingPriority() > 0) { + writer.name("flags").value(SAMPLED_TRACE_FLAG); + } + } + + if (logRecord.eventName != null) { + writer.name("eventName").value(logRecord.eventName); + } + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/logs/OtlpLogsJsonCollector.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/logs/OtlpLogsJsonCollector.java new file mode 100644 index 00000000000..00136bbd80e --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/logs/OtlpLogsJsonCollector.java @@ -0,0 +1,159 @@ +package datadog.trace.core.otlp.logs; + +import static datadog.trace.core.otlp.common.OtlpCommonJson.writeAttribute; +import static datadog.trace.core.otlp.common.OtlpCommonJson.writeScopeAndSchema; +import static datadog.trace.core.otlp.common.OtlpPayload.JSON_CONTENT_TYPE; +import static datadog.trace.core.otlp.common.OtlpResourceJson.RESOURCE_FRAGMENT; +import static datadog.trace.core.otlp.logs.OtlpLogsJson.writeLogRecordFields; + +import datadog.json.JsonWriter; +import datadog.trace.bootstrap.otel.common.OtelInstrumentationScope; +import datadog.trace.bootstrap.otel.logs.data.OtelLogRecordProcessor; +import datadog.trace.bootstrap.otlp.logs.OtlpLogRecord; +import datadog.trace.bootstrap.otlp.logs.OtlpLogsVisitor; +import datadog.trace.bootstrap.otlp.logs.OtlpScopedLogsVisitor; +import datadog.trace.core.otlp.common.LazyJsonArray; +import datadog.trace.core.otlp.common.OtlpPayload; +import java.nio.ByteBuffer; +import java.util.function.ObjIntConsumer; + +/** + * Collects OpenTelemetry logs and marshals them into a 'logs.proto' JSON payload. + * + *

      This collector is designed to be called by a single thread. To minimize allocations each + * collection returns a payload only to be used by the calling thread until the next collection. + * (The payload should be copied before passing it onto another thread.) + * + *

      Attributes for a log record are written directly into the currently open log record object as + * {@code visitAttribute} is called, then {@code visitLogRecord} writes the rest of its fields and + * closes it. + */ +public final class OtlpLogsJsonCollector extends OtlpLogsCollector + implements OtlpLogsVisitor, OtlpScopedLogsVisitor { + + public static final OtlpLogsJsonCollector INSTANCE = new OtlpLogsJsonCollector(); + + private JsonWriter writer; + private boolean anyLogRecordWritten; + private boolean logRecordStarted; + + private final LazyJsonArray attributesArray = new LazyJsonArray(); + + private OtelInstrumentationScope currentScope; + + private OtlpLogsJsonCollector() {} + + /** + * Collects OpenTelemetry logs and marshals them into a JSON payload. + * + *

      This payload is only valid for the calling thread until the next collection. + */ + @Override + public OtlpPayload waitForLogs(int intervalMillis) { + return collectLogs(OtelLogRecordProcessor.INSTANCE::waitForLogs, intervalMillis); + } + + OtlpPayload collectLogs(ObjIntConsumer processor, int intervalMillis) { + start(); + try { + processor.accept(this, intervalMillis); + return completePayload(); + } finally { + stop(); + } + } + + /** Prepare temporary elements to collect logs data. */ + private void start() { + writer = new JsonWriter(); + writer.beginObject(); + writer.name("resourceLogs").beginArray(); + writer.beginObject(); + writer.name("resource").jsonValue(RESOURCE_FRAGMENT); + writer.name("scopeLogs").beginArray(); + } + + /** Cleanup elements used to collect logs data. */ + private void stop() { + attributesArray.reset(); + + anyLogRecordWritten = false; + + writer = null; + + logRecordStarted = false; + + currentScope = null; + } + + @Override + public OtlpScopedLogsVisitor visitScopedLogs(OtelInstrumentationScope scope) { + if (currentScope != null) { + completeScope(); + } + currentScope = scope; + + writer.beginObject(); + writeScopeAndSchema(writer, scope); + writer.name("logRecords").beginArray(); + + return this; + } + + @Override + public void visitAttribute(int type, String key, Object value) { + // add attribute to the log record currently being collected + ensureLogRecordStarted(); + attributesArray.ensureOpen(writer, "attributes"); + writeAttribute(writer, type, key, value); + } + + @Override + public void visitLogRecord(OtlpLogRecord logRecord) { + ensureLogRecordStarted(); + attributesArray.closeIfOpen(writer); + + writeLogRecordFields(writer, logRecord); + + writer.endObject(); // log record + + logRecordStarted = false; + anyLogRecordWritten = true; + } + + // opens the log record object on first attribute or value written for it + private void ensureLogRecordStarted() { + if (!logRecordStarted) { + writer.beginObject(); + logRecordStarted = true; + } + } + + // called once we've processed all scopes and log record messages + private OtlpPayload completePayload() { + if (currentScope != null) { + completeScope(); + } + + writer.endArray(); // scopeLogs + writer.endObject(); // resourceLogs[0] + writer.endArray(); // resourceLogs + writer.endObject(); // root + + if (!anyLogRecordWritten) { + return OtlpPayload.EMPTY; + } + + byte[] bytes = writer.toByteArray(); + return new OtlpPayload(ByteBuffer.wrap(bytes), JSON_CONTENT_TYPE); + } + + // called once we've processed all log records in a specific scope + private void completeScope() { + writer.endArray(); // logRecords + writer.endObject(); // scopeLogs[0] + + // reset temporary elements for next scope + currentScope = null; + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/logs/OtlpLogsProto.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/logs/OtlpLogsProto.java index 62e4964c854..ab74985c7b6 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/otlp/logs/OtlpLogsProto.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/logs/OtlpLogsProto.java @@ -12,7 +12,7 @@ import static datadog.trace.core.otlp.common.OtlpCommonProto.writeStringCached; import static datadog.trace.core.otlp.common.OtlpCommonProto.writeTag; import static datadog.trace.core.otlp.common.OtlpCommonProto.writeVarInt; -import static datadog.trace.core.otlp.trace.OtlpTraceProto.SAMPLED_TRACE_FLAG; +import static datadog.trace.core.otlp.common.OtlpTraceFlags.SAMPLED_TRACE_FLAG; import static datadog.trace.core.otlp.trace.OtlpTraceProto.writeSpanId; import static datadog.trace.core.otlp.trace.OtlpTraceProto.writeTraceId; import static java.nio.charset.StandardCharsets.UTF_8; diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/logs/OtlpLogsProtoCollector.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/logs/OtlpLogsProtoCollector.java index e702fcde10b..bdd8436f58f 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/otlp/logs/OtlpLogsProtoCollector.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/logs/OtlpLogsProtoCollector.java @@ -35,8 +35,6 @@ public final class OtlpLogsProtoCollector extends OtlpLogsCollector public static final OtlpLogsProtoCollector INSTANCE = new OtlpLogsProtoCollector(); - private static final String PROTOBUF_CONTENT_TYPE = "application/x-protobuf"; - private final GrowableBuffer buf = new GrowableBuffer(512); private final OtlpProtoBuffer protobuf = new OtlpProtoBuffer(8192); diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/logs/OtlpLogsService.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/logs/OtlpLogsService.java index a52bbf912d1..195f77efdf7 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/otlp/logs/OtlpLogsService.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/logs/OtlpLogsService.java @@ -23,7 +23,7 @@ public final class OtlpLogsService { private volatile Thread exporterThread; - private OtlpLogsService(Config config) { + OtlpLogsService(Config config) { intervalMillis = config.getLogsOtelInterval(); switch (config.getOtlpLogsProtocol()) { case GRPC: @@ -46,6 +46,16 @@ private OtlpLogsService(Config config) { config.getOtlpLogsTimeout(), config.getOtlpLogsCompression()); break; + case HTTP_JSON: + this.collector = OtlpLogsJsonCollector.INSTANCE; + this.sender = + new OtlpHttpSender( + config.getOtlpLogsEndpoint(), + "/v1/logs", + config.getOtlpLogsHeaders(), + config.getOtlpLogsTimeout(), + config.getOtlpLogsCompression()); + break; default: LOGGER.debug("Unsupported OTLP logs protocol: {}", config.getOtlpLogsProtocol()); this.collector = null; @@ -53,6 +63,14 @@ private OtlpLogsService(Config config) { } } + OtlpSender getSender() { + return sender; + } + + OtlpLogsCollector getCollector() { + return collector; + } + public void start() { if (sender == null) { return; diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsCollector.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsCollector.java index 5e528d7e9de..3809160aadb 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsCollector.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsCollector.java @@ -1,10 +1,16 @@ package datadog.trace.core.otlp.metrics; +import datadog.trace.bootstrap.otlp.metrics.OtlpMetricsVisitor; import datadog.trace.core.otlp.common.OtlpPayload; +import java.util.function.Consumer; /** Collects metrics ready for export. */ public abstract class OtlpMetricsCollector { /** Collects all metrics recorded since the last collection. */ public abstract OtlpPayload collectMetrics(); + + /** Collects metrics from {@code registry} over an explicit time window. */ + abstract OtlpPayload collectMetrics( + Consumer registry, long startNanos, long endNanos); } diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsJson.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsJson.java new file mode 100644 index 00000000000..1a8e0943aeb --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsJson.java @@ -0,0 +1,128 @@ +package datadog.trace.core.otlp.metrics; + +import static datadog.trace.bootstrap.otel.metrics.OtelInstrumentType.GAUGE; +import static datadog.trace.bootstrap.otel.metrics.OtelInstrumentType.OBSERVABLE_GAUGE; +import static datadog.trace.core.otlp.common.OtlpCommonJson.writeDouble; +import static datadog.trace.core.otlp.metrics.OtlpMetricsTemporality.COUNTER_TEMPORALITY; +import static datadog.trace.core.otlp.metrics.OtlpMetricsTemporality.HISTOGRAM_TEMPORALITY; +import static datadog.trace.core.otlp.metrics.OtlpMetricsTemporality.OBSERVABLE_COUNTER_TEMPORALITY; +import static datadog.trace.core.otlp.metrics.OtlpMetricsTemporality.TEMPORALITY_CUMULATIVE; +import static datadog.trace.core.otlp.metrics.OtlpMetricsTemporality.TEMPORALITY_DELTA; + +import datadog.json.JsonWriter; +import datadog.trace.bootstrap.otel.metrics.OtelInstrumentDescriptor; +import datadog.trace.bootstrap.otlp.metrics.OtlpDataPoint; +import datadog.trace.bootstrap.otlp.metrics.OtlpDoublePoint; +import datadog.trace.bootstrap.otlp.metrics.OtlpHistogramPoint; +import datadog.trace.bootstrap.otlp.metrics.OtlpLongPoint; + +/** Provides writers for OpenTelemetry's "metrics.proto" JSON encoding. */ +public final class OtlpMetricsJson { + private OtlpMetricsJson() {} + + /** Opens a {@code Metric} JSON object, up to and including its {@code dataPoints} array. */ + public static void openMetric(JsonWriter writer, OtelInstrumentDescriptor descriptor) { + openMetric(writer, descriptor, false); + } + + /** + * Opens a {@code Metric} JSON object, up to and including its {@code dataPoints} array. When + * {@code forceDelta} is {@code true}, a histogram is encoded as DELTA regardless of the + * configured temporality preference (for sources whose data points are inherently per-interval + * deltas). + */ + public static void openMetric( + JsonWriter writer, OtelInstrumentDescriptor descriptor, boolean forceDelta) { + writer.beginObject(); + writer.name("name").value(descriptor.getName().toString()); + if (descriptor.getDescription() != null) { + writer.name("description").value(descriptor.getDescription().toString()); + } + if (descriptor.getUnit() != null) { + writer.name("unit").value(descriptor.getUnit().toString()); + } + + switch (descriptor.getType()) { + case GAUGE: + case OBSERVABLE_GAUGE: + writer.name("gauge").beginObject(); + // gauges have no aggregation temporality + break; + case COUNTER: + writer.name("sum").beginObject(); + writer.name("aggregationTemporality").value(COUNTER_TEMPORALITY); + writer.name("isMonotonic").value(true); + break; + case OBSERVABLE_COUNTER: + writer.name("sum").beginObject(); + writer.name("aggregationTemporality").value(OBSERVABLE_COUNTER_TEMPORALITY); + writer.name("isMonotonic").value(true); + break; + case UP_DOWN_COUNTER: + case OBSERVABLE_UP_DOWN_COUNTER: + writer.name("sum").beginObject(); + // up/down counters are always cumulative + writer.name("aggregationTemporality").value(TEMPORALITY_CUMULATIVE); + writer.name("isMonotonic").value(false); + break; + case HISTOGRAM: + writer.name("histogram").beginObject(); + writer + .name("aggregationTemporality") + .value(forceDelta ? TEMPORALITY_DELTA : HISTOGRAM_TEMPORALITY); + break; + default: + throw new IllegalArgumentException("Unknown instrument type: " + descriptor.getType()); + } + + writer.name("dataPoints").beginArray(); + } + + /** Closes a {@code Metric} JSON object previously opened by {@link #openMetric}. */ + public static void closeMetric(JsonWriter writer) { + writer.endArray(); // dataPoints + writer.endObject(); // gauge|sum|histogram + writer.endObject(); // metric + } + + /** Writes a data point's value fields into the currently open data point object. */ + public static void writeDataPointValue(JsonWriter writer, OtlpDataPoint point) { + if (point instanceof OtlpDoublePoint) { + writer.name("asDouble"); + writeDouble(writer, ((OtlpDoublePoint) point).value); + } else if (point instanceof OtlpLongPoint) { + // int64 fields are encoded as decimal strings, per the OTLP JSON encoding spec + writer.name("asInt").value(Long.toString(((OtlpLongPoint) point).value)); + } else { // must be a histogram point + OtlpHistogramPoint histogram = (OtlpHistogramPoint) point; + writer.name("count").value(Long.toString((long) histogram.count)); + writer.name("sum"); + writeDouble(writer, histogram.sum); + writer.name("min"); + writeDouble(writer, histogram.min); + writer.name("max"); + writeDouble(writer, histogram.max); + if (!histogram.bucketCounts.isEmpty()) { + boolean hasOverflow = false; + writer.name("explicitBounds").beginArray(); + for (double bucketBoundary : histogram.bucketBoundaries) { + if (!Double.isInfinite(bucketBoundary)) { + writer.value(bucketBoundary); + } else { + hasOverflow = true; // don't write the overflow boundary + } + } + writer.endArray(); + + writer.name("bucketCounts").beginArray(); + for (double bucketCount : histogram.bucketCounts) { + writer.value(Long.toString((long) bucketCount)); + } + if (!hasOverflow) { // write one more count than boundaries + writer.value("0"); + } + writer.endArray(); + } + } + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsJsonCollector.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsJsonCollector.java new file mode 100644 index 00000000000..46fe6ae0abe --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsJsonCollector.java @@ -0,0 +1,277 @@ +package datadog.trace.core.otlp.metrics; + +import static datadog.trace.bootstrap.otel.metrics.OtelInstrumentType.GAUGE; +import static datadog.trace.bootstrap.otel.metrics.OtelInstrumentType.OBSERVABLE_GAUGE; +import static datadog.trace.core.otlp.common.OtlpCommonJson.writeAttribute; +import static datadog.trace.core.otlp.common.OtlpCommonJson.writeScopeAndSchema; +import static datadog.trace.core.otlp.common.OtlpPayload.JSON_CONTENT_TYPE; +import static datadog.trace.core.otlp.common.OtlpResourceJson.RESOURCE_FRAGMENT; +import static datadog.trace.core.otlp.metrics.OtlpMetricsJson.closeMetric; +import static datadog.trace.core.otlp.metrics.OtlpMetricsJson.openMetric; +import static datadog.trace.core.otlp.metrics.OtlpMetricsJson.writeDataPointValue; + +import datadog.json.JsonWriter; +import datadog.trace.api.time.TimeSource; +import datadog.trace.bootstrap.otel.common.OtelInstrumentationScope; +import datadog.trace.bootstrap.otel.metrics.OtelInstrumentDescriptor; +import datadog.trace.bootstrap.otel.metrics.OtelInstrumentType; +import datadog.trace.bootstrap.otel.metrics.data.OtelMetricRegistry; +import datadog.trace.bootstrap.otlp.metrics.OtlpDataPoint; +import datadog.trace.bootstrap.otlp.metrics.OtlpMetricVisitor; +import datadog.trace.bootstrap.otlp.metrics.OtlpMetricsVisitor; +import datadog.trace.bootstrap.otlp.metrics.OtlpScopedMetricsVisitor; +import datadog.trace.core.otlp.common.LazyJsonArray; +import datadog.trace.core.otlp.common.OtlpPayload; +import java.nio.ByteBuffer; +import java.util.function.Consumer; + +/** + * Collects OpenTelemetry metrics and marshals them into a 'metrics.proto' JSON payload. + * + *

      This collector is designed to be called by a single thread. To minimize allocations each + * collection returns a payload only to be used by the calling thread until the next collection. + * (The payload should be copied before passing it onto another thread.) + * + *

      Unlike the protobuf collector, attributes for a data point are written directly into the + * currently open data point object as {@code visitAttribute} is called. A scope's header (and its + * {@code metrics} array) and a metric's header (and its {@code gauge}/{@code sum}/{@code histogram} + * wrapper) are only opened lazily, on the first attribute or data point visited for them, so scopes + * and metrics with no data points contribute nothing to the payload — matching the protobuf + * collector's behavior. + */ +public final class OtlpMetricsJsonCollector extends OtlpMetricsCollector + implements OtlpMetricsVisitor, OtlpScopedMetricsVisitor, OtlpMetricVisitor { + + private final TimeSource timeSource; + + private final boolean forceHistogramDelta; + + // resource fragment prepended to every payload; lets callers pick the plain vendor-neutral + // resource or the datadog-attrs variant (datadog.runtime_id / process tags) + private final String resourceFragment; + + private long startNanos; + private long endNanos; + private String startNanosStr; + private String endNanosStr; + + private JsonWriter writer; + private boolean anyDataPointWritten; + private boolean scopeStarted; + private boolean metricStarted; + private boolean dataPointStarted; + + private final LazyJsonArray attributesArray = new LazyJsonArray(); + + private OtelInstrumentationScope currentScope; + private OtelInstrumentDescriptor currentMetric; + + public OtlpMetricsJsonCollector(TimeSource timeSource) { + this(timeSource, false); + } + + OtlpMetricsJsonCollector(TimeSource timeSource, boolean forceHistogramDelta) { + this(timeSource, forceHistogramDelta, RESOURCE_FRAGMENT); + } + + OtlpMetricsJsonCollector( + TimeSource timeSource, boolean forceHistogramDelta, String resourceFragment) { + this.timeSource = timeSource; + this.endNanos = timeSource.getCurrentTimeNanos(); + this.forceHistogramDelta = forceHistogramDelta; + this.resourceFragment = resourceFragment; + } + + /** + * Collects OpenTelemetry metrics and marshals them into a JSON payload. + * + *

      This payload is only valid for the calling thread until the next collection. + */ + @Override + public OtlpPayload collectMetrics() { + return collectMetrics(OtelMetricRegistry.INSTANCE::collectMetrics); + } + + OtlpPayload collectMetrics(Consumer registry) { + start(); + return run(registry); + } + + @Override + OtlpPayload collectMetrics( + Consumer registry, long startNanos, long endNanos) { + startWithWindow(startNanos, endNanos); + return run(registry); + } + + private OtlpPayload run(Consumer registry) { + try { + registry.accept(this); + return completePayload(); + } finally { + stop(); + } + } + + /** Prepare temporary elements to collect metrics data. */ + private void start() { + // shift interval to cover last collection to now + startNanos = endNanos; + endNanos = timeSource.getCurrentTimeNanos(); + beginPayload(); + } + + private void startWithWindow(long startNanos, long endNanos) { + this.startNanos = startNanos; + this.endNanos = endNanos; + beginPayload(); + } + + private void beginPayload() { + startNanosStr = Long.toString(startNanos); + endNanosStr = Long.toString(endNanos); + + writer = new JsonWriter(); + writer.beginObject(); + writer.name("resourceMetrics").beginArray(); + writer.beginObject(); + writer.name("resource").jsonValue(resourceFragment); + writer.name("scopeMetrics").beginArray(); + } + + /** Cleanup elements used to collect metrics data. */ + private void stop() { + attributesArray.reset(); + + anyDataPointWritten = false; + + writer = null; + + scopeStarted = false; + metricStarted = false; + dataPointStarted = false; + + currentScope = null; + currentMetric = null; + } + + @Override + public OtlpScopedMetricsVisitor visitScopedMetrics(OtelInstrumentationScope scope) { + if (currentScope != null) { + completeScope(); + } + currentScope = scope; + return this; + } + + @Override + public OtlpMetricVisitor visitMetric(OtelInstrumentDescriptor metric) { + if (currentMetric != null) { + completeMetric(); + } + currentMetric = metric; + return this; + } + + @Override + public void visitAttribute(int type, String key, Object value) { + ensureMetricStarted(); + ensureDataPointStarted(); + attributesArray.ensureOpen(writer, "attributes"); + writeAttribute(writer, type, key, value); + } + + @Override + public void visitDataPoint(OtlpDataPoint point) { + ensureMetricStarted(); + ensureDataPointStarted(); + attributesArray.closeIfOpen(writer); + + OtelInstrumentType metricType = currentMetric.getType(); + + // gauges don't have a start time (no aggregation temporality) + if (metricType != GAUGE && metricType != OBSERVABLE_GAUGE) { + writer.name("startTimeUnixNano").value(startNanosStr); + } + writer.name("timeUnixNano").value(endNanosStr); + writeDataPointValue(writer, point); + + writer.endObject(); // data point + + dataPointStarted = false; + anyDataPointWritten = true; + } + + // opens the scope header (and its metrics array) on first use + private void ensureScopeStarted() { + if (!scopeStarted) { + writer.beginObject(); + writeScopeAndSchema(writer, currentScope); + writer.name("metrics").beginArray(); + scopeStarted = true; + } + } + + // opens the metric header (and its gauge/sum/histogram wrapper) on first use + private void ensureMetricStarted() { + if (!metricStarted) { + ensureScopeStarted(); + openMetric(writer, currentMetric, forceHistogramDelta); + metricStarted = true; + } + } + + // opens the data point object on first attribute or value written for it + private void ensureDataPointStarted() { + if (!dataPointStarted) { + writer.beginObject(); + dataPointStarted = true; + } + } + + // called once we've processed all scopes and metric messages + private OtlpPayload completePayload() { + if (currentScope != null) { + completeScope(); + } + + writer.endArray(); // scopeMetrics + writer.endObject(); // resourceMetrics[0] + writer.endArray(); // resourceMetrics + writer.endObject(); // root + + if (!anyDataPointWritten) { + return OtlpPayload.EMPTY; + } + + byte[] bytes = writer.toByteArray(); + return new OtlpPayload(ByteBuffer.wrap(bytes), JSON_CONTENT_TYPE); + } + + // called once we've processed all metrics in a specific scope + private void completeScope() { + if (currentMetric != null) { + completeMetric(); + } + + if (scopeStarted) { + writer.endArray(); // metrics + writer.endObject(); // scopeMetrics[0] + scopeStarted = false; + } + + // reset temporary elements for next scope + currentScope = null; + } + + // called once we've processed all data points in a specific metric + private void completeMetric() { + if (metricStarted) { + closeMetric(writer); + metricStarted = false; + } + + // reset temporary elements for next metric + currentMetric = null; + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsProto.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsProto.java index 751649940ba..f151b79c8df 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsProto.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsProto.java @@ -1,10 +1,5 @@ package datadog.trace.core.otlp.metrics; -import static datadog.trace.api.config.OtlpConfig.Temporality.DELTA; -import static datadog.trace.api.config.OtlpConfig.Temporality.LOWMEMORY; -import static datadog.trace.bootstrap.otel.metrics.OtelInstrumentType.COUNTER; -import static datadog.trace.bootstrap.otel.metrics.OtelInstrumentType.HISTOGRAM; -import static datadog.trace.bootstrap.otel.metrics.OtelInstrumentType.OBSERVABLE_COUNTER; import static datadog.trace.core.otlp.common.OtlpCommonProto.I64_WIRE_TYPE; import static datadog.trace.core.otlp.common.OtlpCommonProto.LEN_WIRE_TYPE; import static datadog.trace.core.otlp.common.OtlpCommonProto.VARINT_WIRE_TYPE; @@ -13,13 +8,15 @@ import static datadog.trace.core.otlp.common.OtlpCommonProto.writeString; import static datadog.trace.core.otlp.common.OtlpCommonProto.writeTag; import static datadog.trace.core.otlp.common.OtlpCommonProto.writeVarInt; +import static datadog.trace.core.otlp.metrics.OtlpMetricsTemporality.COUNTER_TEMPORALITY; +import static datadog.trace.core.otlp.metrics.OtlpMetricsTemporality.HISTOGRAM_TEMPORALITY; +import static datadog.trace.core.otlp.metrics.OtlpMetricsTemporality.OBSERVABLE_COUNTER_TEMPORALITY; +import static datadog.trace.core.otlp.metrics.OtlpMetricsTemporality.TEMPORALITY_CUMULATIVE; +import static datadog.trace.core.otlp.metrics.OtlpMetricsTemporality.TEMPORALITY_DELTA; import datadog.communication.serialization.GrowableBuffer; -import datadog.trace.api.Config; -import datadog.trace.api.config.OtlpConfig; import datadog.trace.bootstrap.otel.common.OtelInstrumentationScope; import datadog.trace.bootstrap.otel.metrics.OtelInstrumentDescriptor; -import datadog.trace.bootstrap.otel.metrics.OtelInstrumentType; import datadog.trace.bootstrap.otlp.metrics.OtlpDataPoint; import datadog.trace.bootstrap.otlp.metrics.OtlpDoublePoint; import datadog.trace.bootstrap.otlp.metrics.OtlpHistogramPoint; @@ -30,13 +27,6 @@ public final class OtlpMetricsProto { private OtlpMetricsProto() {} - private static final int TEMPORALITY_DELTA = 1; - private static final int TEMPORALITY_CUMULATIVE = 2; - - private static final int COUNTER_TEMPORALITY = temporality(COUNTER); - private static final int OBSERVABLE_COUNTER_TEMPORALITY = temporality(OBSERVABLE_COUNTER); - private static final int HISTOGRAM_TEMPORALITY = temporality(HISTOGRAM); - /** Records a scoped metrics message after its nested metric messages have been recorded. */ public static int recordScopedMetricsMessage( GrowableBuffer buf, @@ -60,6 +50,20 @@ public static int recordMetricMessage( OtelInstrumentDescriptor descriptor, int nestedDataPointBytes, OtlpProtoBuffer protobuf) { + return recordMetricMessage(buf, descriptor, nestedDataPointBytes, protobuf, false); + } + + /** + * Records a metric message after its nested data point messages have been recorded. When {@code + * forceDelta} is {@code true}, a histogram is encoded as DELTA regardless of the configured + * temporality preference (for sources whose data points are inherently per-interval deltas). + */ + public static int recordMetricMessage( + GrowableBuffer buf, + OtelInstrumentDescriptor descriptor, + int nestedDataPointBytes, + OtlpProtoBuffer protobuf, + boolean forceDelta) { writeTag(buf, 1, LEN_WIRE_TYPE); writeString(buf, descriptor.getName().getUtf8Bytes()); @@ -107,7 +111,7 @@ public static int recordMetricMessage( writeTag(buf, 9, LEN_WIRE_TYPE); writeVarInt(buf, nestedDataPointBytes + 2); writeTag(buf, 2, VARINT_WIRE_TYPE); - writeVarInt(buf, HISTOGRAM_TEMPORALITY); + writeVarInt(buf, forceDelta ? TEMPORALITY_DELTA : HISTOGRAM_TEMPORALITY); break; default: throw new IllegalArgumentException("Unknown instrument type: " + descriptor.getType()); @@ -158,20 +162,4 @@ public static int recordDataPointMessage( return protobuf.recordMessage(buf, 1); } - - private static int temporality(OtelInstrumentType type) { - OtlpConfig.Temporality preference = Config.get().getOtlpMetricsTemporalityPreference(); - if (preference == DELTA) { - // gauges and up/down counters stay as cumulative - if (type == HISTOGRAM || type == COUNTER || type == OBSERVABLE_COUNTER) { - return TEMPORALITY_DELTA; - } - } else if (preference == LOWMEMORY) { - // observable counters, gauges, and up/down counters stay as cumulative - if (type == HISTOGRAM || type == COUNTER) { - return TEMPORALITY_DELTA; - } - } - return TEMPORALITY_CUMULATIVE; - } } diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsProtoCollector.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsProtoCollector.java index bf819668733..82029367669 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsProtoCollector.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsProtoCollector.java @@ -14,7 +14,6 @@ import static datadog.trace.core.otlp.metrics.OtlpMetricsProto.recordScopedMetricsMessage; import datadog.communication.serialization.GrowableBuffer; -import datadog.trace.api.time.SystemTimeSource; import datadog.trace.api.time.TimeSource; import datadog.trace.bootstrap.otel.common.OtelInstrumentationScope; import datadog.trace.bootstrap.otel.metrics.OtelInstrumentDescriptor; @@ -46,14 +45,17 @@ public final class OtlpMetricsProtoCollector extends OtlpMetricsCollector implements OtlpMetricsVisitor, OtlpScopedMetricsVisitor, OtlpMetricVisitor { - public static final OtlpMetricsProtoCollector INSTANCE = - new OtlpMetricsProtoCollector(SystemTimeSource.INSTANCE); - private final GrowableBuffer buf = new GrowableBuffer(512); private final OtlpProtoBuffer protobuf = new OtlpProtoBuffer(8192); private final TimeSource timeSource; + private final boolean forceHistogramDelta; + + // resource chunk prepended to every payload; lets callers pick the plain vendor-neutral resource + // or the datadog-attrs variant (datadog.runtime_id / process tags) + private final byte[] resourceMessage; + private long startNanos; private long endNanos; @@ -66,8 +68,19 @@ public final class OtlpMetricsProtoCollector extends OtlpMetricsCollector private OtelInstrumentDescriptor currentMetric; public OtlpMetricsProtoCollector(TimeSource timeSource) { + this(timeSource, false); + } + + OtlpMetricsProtoCollector(TimeSource timeSource, boolean forceHistogramDelta) { + this(timeSource, forceHistogramDelta, RESOURCE_MESSAGE); + } + + OtlpMetricsProtoCollector( + TimeSource timeSource, boolean forceHistogramDelta, byte[] resourceMessage) { this.timeSource = timeSource; this.endNanos = timeSource.getCurrentTimeNanos(); + this.forceHistogramDelta = forceHistogramDelta; + this.resourceMessage = resourceMessage; } /** @@ -82,6 +95,17 @@ public OtlpPayload collectMetrics() { OtlpPayload collectMetrics(Consumer registry) { start(); + return run(registry); + } + + @Override + OtlpPayload collectMetrics( + Consumer registry, long startNanos, long endNanos) { + startWithWindow(startNanos, endNanos); + return run(registry); + } + + private OtlpPayload run(Consumer registry) { try { registry.accept(this); return completePayload(); @@ -93,8 +117,17 @@ OtlpPayload collectMetrics(Consumer registry) { /** Prepare temporary elements to collect metrics data. */ private void start() { // shift interval to cover last collection to now - startNanos = endNanos; - endNanos = timeSource.getCurrentTimeNanos(); + this.startNanos = endNanos; + this.endNanos = timeSource.getCurrentTimeNanos(); + + // remove stale entries from caches + OtlpCommonProto.recalibrateCaches(); + } + + /** Prepare temporary elements to collect metrics over an explicit window. */ + private void startWithWindow(long startNanos, long endNanos) { + this.startNanos = startNanos; + this.endNanos = endNanos; // remove stale entries from caches OtlpCommonProto.recalibrateCaches(); @@ -165,7 +198,7 @@ private OtlpPayload completePayload() { } // prepend the canned resource chunk - payloadBytes += protobuf.recordMessage(RESOURCE_MESSAGE); + payloadBytes += protobuf.recordMessage(resourceMessage); // finally prepend the total length of all collected chunks protobuf.recordMessage(buf, 1, payloadBytes); @@ -193,7 +226,8 @@ private void completeMetric() { // add metric message prefix to its nested chunks and promote to scoped if (metricBytes > 0) { - scopedBytes += recordMetricMessage(buf, currentMetric, metricBytes, protobuf); + scopedBytes += + recordMetricMessage(buf, currentMetric, metricBytes, protobuf, forceHistogramDelta); } // reset temporary elements for next metric diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsSenderFactory.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsSenderFactory.java new file mode 100644 index 00000000000..6ab62caeb8d --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsSenderFactory.java @@ -0,0 +1,44 @@ +package datadog.trace.core.otlp.metrics; + +import datadog.trace.api.Config; +import datadog.trace.core.otlp.common.OtlpGrpcSender; +import datadog.trace.core.otlp.common.OtlpHttpSender; +import datadog.trace.core.otlp.common.OtlpSender; +import javax.annotation.Nullable; + +/** + * Selects the {@link OtlpSender} for the configured OTLP metrics protocol. Shared by every OTLP + * metrics export path ({@code OtlpMetricsService} for OpenTelemetry-API metrics, {@code + * OtlpStatsMetricWriter} for trace stats) so they all pick their transport identically and stay in + * sync as protocols/endpoints evolve. + */ +final class OtlpMetricsSenderFactory { + private OtlpMetricsSenderFactory() {} + + /** + * Builds the sender for {@code config}'s OTLP metrics protocol, or {@code null} if the protocol + * is unsupported. + */ + @Nullable + static OtlpSender create(Config config) { + switch (config.getOtlpMetricsProtocol()) { + case GRPC: + return new OtlpGrpcSender( + config.getOtlpMetricsEndpoint(), + "/opentelemetry.proto.collector.metrics.v1.MetricsService/Export", + config.getOtlpMetricsHeaders(), + config.getOtlpMetricsTimeout(), + config.getOtlpMetricsCompression()); + case HTTP_PROTOBUF: + case HTTP_JSON: + return new OtlpHttpSender( + config.getOtlpMetricsEndpoint(), + "/v1/metrics", + config.getOtlpMetricsHeaders(), + config.getOtlpMetricsTimeout(), + config.getOtlpMetricsCompression()); + default: + return null; + } + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsService.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsService.java index ea6e28f47f9..98a65618d45 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsService.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsService.java @@ -3,8 +3,8 @@ import static datadog.trace.util.AgentThreadFactory.AgentThread.OTLP_METRICS_EXPORTER; import datadog.trace.api.Config; -import datadog.trace.core.otlp.common.OtlpGrpcSender; -import datadog.trace.core.otlp.common.OtlpHttpSender; +import datadog.trace.api.config.OtlpConfig; +import datadog.trace.api.time.SystemTimeSource; import datadog.trace.core.otlp.common.OtlpPayload; import datadog.trace.core.otlp.common.OtlpSender; import datadog.trace.util.AgentTaskScheduler; @@ -27,39 +27,31 @@ public final class OtlpMetricsService { private AgentTaskScheduler.Scheduled scheduledTask = null; - private OtlpMetricsService(Config config) { + OtlpMetricsService(Config config) { this.scheduler = new AgentTaskScheduler(OTLP_METRICS_EXPORTER); - switch (config.getOtlpMetricsProtocol()) { - case GRPC: - this.collector = OtlpMetricsProtoCollector.INSTANCE; - this.sender = - new OtlpGrpcSender( - config.getOtlpMetricsEndpoint(), - "/opentelemetry.proto.collector.metrics.v1.MetricsService/Export", - config.getOtlpMetricsHeaders(), - config.getOtlpMetricsTimeout(), - config.getOtlpMetricsCompression()); - break; - case HTTP_PROTOBUF: - this.collector = OtlpMetricsProtoCollector.INSTANCE; - this.sender = - new OtlpHttpSender( - config.getOtlpMetricsEndpoint(), - "/v1/metrics", - config.getOtlpMetricsHeaders(), - config.getOtlpMetricsTimeout(), - config.getOtlpMetricsCompression()); - break; - default: - LOGGER.debug("Unsupported OTLP metrics protocol: {}", config.getOtlpMetricsProtocol()); - this.collector = null; - this.sender = null; + this.sender = OtlpMetricsSenderFactory.create(config); + if (this.sender == null) { + LOGGER.debug("Unsupported OTLP metrics protocol: {}", config.getOtlpMetricsProtocol()); + this.collector = null; + } else { + this.collector = + config.getOtlpMetricsProtocol() == OtlpConfig.Protocol.HTTP_JSON + ? new OtlpMetricsJsonCollector(SystemTimeSource.INSTANCE) + : new OtlpMetricsProtoCollector(SystemTimeSource.INSTANCE); } this.intervalMillis = config.getMetricsOtelInterval(); } + OtlpSender getSender() { + return sender; + } + + OtlpMetricsCollector getCollector() { + return collector; + } + public void start() { if (sender == null) { return; diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsTemporality.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsTemporality.java new file mode 100644 index 00000000000..09fc243780e --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpMetricsTemporality.java @@ -0,0 +1,41 @@ +package datadog.trace.core.otlp.metrics; + +import static datadog.trace.api.config.OtlpConfig.Temporality.DELTA; +import static datadog.trace.api.config.OtlpConfig.Temporality.LOWMEMORY; +import static datadog.trace.bootstrap.otel.metrics.OtelInstrumentType.COUNTER; +import static datadog.trace.bootstrap.otel.metrics.OtelInstrumentType.HISTOGRAM; +import static datadog.trace.bootstrap.otel.metrics.OtelInstrumentType.OBSERVABLE_COUNTER; + +import datadog.trace.api.Config; +import datadog.trace.api.config.OtlpConfig; +import datadog.trace.bootstrap.otel.metrics.OtelInstrumentType; + +/** Maps instrument types to OTLP's {@code AggregationTemporality} enum values. */ +final class OtlpMetricsTemporality { + private OtlpMetricsTemporality() {} + + static final int TEMPORALITY_DELTA = 1; + static final int TEMPORALITY_CUMULATIVE = 2; + + private static final OtlpConfig.Temporality PREFERENCE = + Config.get().getOtlpMetricsTemporalityPreference(); + + static final int COUNTER_TEMPORALITY = temporality(PREFERENCE, COUNTER); + static final int OBSERVABLE_COUNTER_TEMPORALITY = temporality(PREFERENCE, OBSERVABLE_COUNTER); + static final int HISTOGRAM_TEMPORALITY = temporality(PREFERENCE, HISTOGRAM); + + static int temporality(OtlpConfig.Temporality preference, OtelInstrumentType type) { + if (preference == DELTA) { + // gauges and up/down counters stay as cumulative + if (type == HISTOGRAM || type == COUNTER || type == OBSERVABLE_COUNTER) { + return TEMPORALITY_DELTA; + } + } else if (preference == LOWMEMORY) { + // observable counters, gauges, and up/down counters stay as cumulative + if (type == HISTOGRAM || type == COUNTER) { + return TEMPORALITY_DELTA; + } + } + return TEMPORALITY_CUMULATIVE; + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpStatsHistogramBuckets.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpStatsHistogramBuckets.java new file mode 100644 index 00000000000..87768705a1a --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpStatsHistogramBuckets.java @@ -0,0 +1,70 @@ +package datadog.trace.core.otlp.metrics; + +import datadog.metrics.api.Histogram; +import datadog.trace.bootstrap.otlp.metrics.OtlpHistogramPoint; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +/** + * Projects a client-side-stats {@link Histogram} (a DDSketch over span durations recorded in + * nanoseconds) onto the fixed explicit-bounds histogram layout mandated by the OTLP Trace + * Metrics Export RFC. + */ +final class OtlpStatsHistogramBuckets { + private OtlpStatsHistogramBuckets() {} + + private static final double NANOS_PER_SECOND = 1_000_000_000d; + + static final double[] BOUNDS_SECONDS = { + 0.002, 0.004, 0.006, 0.008, 0.01, 0.05, 0.1, 0.2, 0.4, 0.8, 1, 1.4, 2, 5, 10, 15 + }; + + static final List EXPLICIT_BOUNDS; + + static { + List bounds = new ArrayList<>(BOUNDS_SECONDS.length + 1); + for (double bound : BOUNDS_SECONDS) { + bounds.add(bound); + } + bounds.add(Double.POSITIVE_INFINITY); + EXPLICIT_BOUNDS = Collections.unmodifiableList(bounds); + } + + static int bucketIndex(double seconds) { + for (int i = 0; i < BOUNDS_SECONDS.length; i++) { + if (seconds <= BOUNDS_SECONDS[i]) { + return i; + } + } + return BOUNDS_SECONDS.length; // overflow + } + + /** + * Re-bins {@code histogram} (nanosecond-valued) into an {@link OtlpHistogramPoint} expressed in + * seconds with OTLP's fixed bucket layout. + */ + static OtlpHistogramPoint toHistogramPoint(Histogram histogram, long sumNanos) { + long[] bucketCounts = new long[BOUNDS_SECONDS.length + 1]; + + List binBoundaries = histogram.getBinBoundaries(); + List binCounts = histogram.getBinCounts(); + for (int i = 0; i < binBoundaries.size(); i++) { + double upperSeconds = binBoundaries.get(i) / NANOS_PER_SECOND; + long count = (long) binCounts.get(i).doubleValue(); + bucketCounts[bucketIndex(upperSeconds)] += count; + } + + List counts = new ArrayList<>(bucketCounts.length); + for (long count : bucketCounts) { + counts.add((double) count); + } + + double sumSeconds = sumNanos / NANOS_PER_SECOND; + double minSeconds = histogram.isEmpty() ? 0d : histogram.getMinValue() / NANOS_PER_SECOND; + double maxSeconds = histogram.isEmpty() ? 0d : histogram.getMaxValue() / NANOS_PER_SECOND; + + return new OtlpHistogramPoint( + histogram.getCount(), EXPLICIT_BOUNDS, counts, sumSeconds, minSeconds, maxSeconds); + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpStatsMetricWriter.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpStatsMetricWriter.java new file mode 100644 index 00000000000..5d926b527e5 --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/metrics/OtlpStatsMetricWriter.java @@ -0,0 +1,249 @@ +package datadog.trace.core.otlp.metrics; + +import static datadog.trace.bootstrap.otel.metrics.OtelInstrumentType.HISTOGRAM; +import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.LONG_ATTRIBUTE; +import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.STRING_ATTRIBUTE; + +import datadog.metrics.api.Histogram; +import datadog.trace.api.Config; +import datadog.trace.api.config.OtlpConfig; +import datadog.trace.api.time.SystemTimeSource; +import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; +import datadog.trace.bootstrap.otel.common.OtelInstrumentationScope; +import datadog.trace.bootstrap.otel.metrics.OtelInstrumentDescriptor; +import datadog.trace.bootstrap.otlp.metrics.OtlpDataPoint; +import datadog.trace.bootstrap.otlp.metrics.OtlpMetricVisitor; +import datadog.trace.bootstrap.otlp.metrics.OtlpMetricsVisitor; +import datadog.trace.common.metrics.AggregateEntry; +import datadog.trace.common.metrics.MetricWriter; +import datadog.trace.core.otlp.common.OtlpPayload; +import datadog.trace.core.otlp.common.OtlpResourceJson; +import datadog.trace.core.otlp.common.OtlpResourceProto; +import datadog.trace.core.otlp.common.OtlpSender; +import java.util.ArrayList; +import java.util.List; +import javax.annotation.Nullable; + +/** + * A {@link MetricWriter} that exports the client-side trace metrics as a delta-temporality OTLP + * histogram ({@code traces.span.sdk.metrics.duration}, unit {@code s}), the OTLP-native alternative + * to {@code SerializingMetricWriter}'s msgpack. It transforms each {@link AggregateEntry} into an + * OTLP histogram data point and pushes it through the shared {@link OtlpMetricsProtoCollector}. + */ +public final class OtlpStatsMetricWriter implements MetricWriter { + static final String METRIC_NAME = "traces.span.sdk.metrics.duration"; + static final String METRIC_UNIT = "s"; + + private static final OtelInstrumentDescriptor METRIC_DESCRIPTOR = + new OtelInstrumentDescriptor(METRIC_NAME, HISTOGRAM, false, null, METRIC_UNIT); + private static final OtelInstrumentationScope SCOPE = + new OtelInstrumentationScope("datadog.trace.metrics", null, null); + + private static final String SERVICE_NAME = "service.name"; + private static final String SPAN_NAME = "span.name"; + private static final String SPAN_KIND = "span.kind"; + private static final String HTTP_REQUEST_METHOD = "http.request.method"; + private static final String HTTP_RESPONSE_STATUS_CODE = "http.response.status_code"; + private static final String HTTP_ROUTE = "http.route"; + private static final String RPC_RESPONSE_STATUS_CODE = "rpc.response.status_code"; + private static final String STATUS_CODE = "status.code"; + private static final String STATUS_CODE_ERROR = "ERROR"; + private static final String DATADOG_OPERATION_NAME = "datadog.operation.name"; + private static final String DATADOG_SPAN_TYPE = "datadog.span.type"; + private static final String DATADOG_SPAN_TOP_LEVEL = "datadog.span.top_level"; + private static final String DATADOG_ORIGIN = "datadog.origin"; + private static final String SYNTHETICS_ORIGIN = "synthetics"; + + @Nullable private final OtlpSender sender; + private final boolean otelSemanticsMode; + + @Nullable private final String defaultService; + + // own single-thread collector; forced to DELTA since trace-stats buckets are per-interval deltas. + private final OtlpMetricsCollector collector; + + // data points snapshotted during add(), replayed through the visitor in finishBucket() + private final List pending = new ArrayList<>(); + + private long startNanos; + private long endNanos; + + // Represent a single datapoint from Aggregator.add + private static final class PendingPoint { + final AggregateEntry entry; + final OtlpDataPoint point; + final boolean error; + final boolean allTopLevel; + + PendingPoint(AggregateEntry entry, OtlpDataPoint point, boolean error, boolean allTopLevel) { + this.entry = entry; + this.point = point; + this.error = error; + this.allTopLevel = allTopLevel; + } + } + + public OtlpStatsMetricWriter(Config config) { + // shared protocol-based sender selection so both OTLP metrics export paths agree + this( + OtlpMetricsSenderFactory.create(config), + config.getOtlpMetricsProtocol(), + config.isTraceOtelSemanticsEnabled(), + config.getServiceName()); + } + + // visible for testing: lets tests inject a capturing sender to decode the emitted payload and + // control the semantics mode and default service + OtlpStatsMetricWriter( + @Nullable OtlpSender sender, boolean otelSemanticsMode, @Nullable String defaultService) { + this(sender, OtlpConfig.Protocol.HTTP_PROTOBUF, otelSemanticsMode, defaultService); + } + + private OtlpStatsMetricWriter( + @Nullable OtlpSender sender, + OtlpConfig.Protocol protocol, + boolean otelSemanticsMode, + @Nullable String defaultService) { + this.sender = sender; + this.otelSemanticsMode = otelSemanticsMode; + this.defaultService = defaultService; + // Default mode carries datadog.runtime_id / process tags on the Resource; OTel-semantics mode + // uses the plain vendor-neutral resource (no datadog.*). + this.collector = + protocol == OtlpConfig.Protocol.HTTP_JSON + ? new OtlpMetricsJsonCollector( + SystemTimeSource.INSTANCE, + true, + otelSemanticsMode + ? OtlpResourceJson.RESOURCE_FRAGMENT + : OtlpResourceJson.RESOURCE_FRAGMENT_WITH_DATADOG_ATTRS) + : new OtlpMetricsProtoCollector( + SystemTimeSource.INSTANCE, + true, + otelSemanticsMode + ? OtlpResourceProto.RESOURCE_MESSAGE + : OtlpResourceProto.RESOURCE_MESSAGE_WITH_DATADOG_ATTRS); + } + + @Override + public void startBucket(int metricCount, long start, long duration) { + // start/duration arrive as epoch nanos / interval nanos (see Aggregator#report) + this.startNanos = start; + this.endNanos = start + duration; + pending.clear(); + } + + @Override + public void add(AggregateEntry entry) { + // Value gets wiped when Aggregator clears the entry. Need to save it here + boolean allTopLevel = entry.getTopLevelCount() == entry.getHitCount(); + + Histogram okLatencies = entry.getOkLatencies(); + if (!okLatencies.isEmpty()) { + pending.add( + new PendingPoint( + entry, + OtlpStatsHistogramBuckets.toHistogramPoint(okLatencies, entry.getOkDuration()), + false, + allTopLevel)); + } + + Histogram errorLatencies = entry.getErrorLatencies(); + if (errorLatencies != null && !errorLatencies.isEmpty()) { + pending.add( + new PendingPoint( + entry, + OtlpStatsHistogramBuckets.toHistogramPoint(errorLatencies, entry.getErrorDuration()), + true, + allTopLevel)); + } + } + + @Override + public void finishBucket() { + try { + if (pending.isEmpty() || sender == null) { + return; + } + OtlpPayload payload = collector.collectMetrics(this::emit, startNanos, endNanos); + if (payload != OtlpPayload.EMPTY) { + sender.send(payload); + } + } finally { + pending.clear(); + } + } + + @Override + public void reset() { + pending.clear(); + } + + public void shutdown() { + if (sender != null) { + sender.shutdown(); + } + } + + /** + * Pushes the buffered entries through the metric visitor: one OTLP histogram data point per + * non-empty ok/error latency series. Called by {@link OtlpMetricsProtoCollector#collectMetrics} + * with the collector itself as the visitor. + */ + private void emit(OtlpMetricsVisitor visitor) { + OtlpMetricVisitor metric = visitor.visitScopedMetrics(SCOPE).visitMetric(METRIC_DESCRIPTOR); + for (PendingPoint p : pending) { + // attributes must precede the data point (OtlpMetricVisitor contract) + emitDataPointAttributes(metric, p.entry, p.error, p.allTopLevel); + metric.visitDataPoint(p.point); + } + } + + private void emitDataPointAttributes( + OtlpMetricVisitor metric, AggregateEntry entry, boolean error, boolean allTopLevel) { + if (error) { + emitStringAttribute(metric, STATUS_CODE, STATUS_CODE_ERROR); + } + // OTel semconv attrs are emitted in both modes + emitStringAttribute(metric, SPAN_NAME, entry.getResource()); + emitStringAttribute(metric, SPAN_KIND, entry.getSpanKind()); + // service.name on the point only when the span's service differs from the resource's default + UTF8BytesString service = entry.getService(); + if (service != null && service.length() > 0 && !service.toString().equals(defaultService)) { + emitStringAttribute(metric, SERVICE_NAME, service); + } + if (entry.hasHttpMethod()) { + emitStringAttribute(metric, HTTP_REQUEST_METHOD, entry.getHttpMethod()); + } + if (entry.getHttpStatusCode() != 0) { + emitLongAttribute(metric, HTTP_RESPONSE_STATUS_CODE, entry.getHttpStatusCode()); + } + if (entry.hasHttpEndpoint()) { + emitStringAttribute(metric, HTTP_ROUTE, entry.getHttpEndpoint()); + } + if (entry.hasGrpcStatusCode()) { + emitStringAttribute(metric, RPC_RESPONSE_STATUS_CODE, entry.getGrpcStatusCode()); + } + // Default (Datadog) mode: emit datadog.* per-point attributes + if (!otelSemanticsMode) { + emitStringAttribute(metric, DATADOG_OPERATION_NAME, entry.getOperationName()); + emitStringAttribute(metric, DATADOG_SPAN_TYPE, entry.getType()); + emitLongAttribute(metric, DATADOG_SPAN_TOP_LEVEL, allTopLevel ? 1L : 0L); + if (entry.isSynthetics()) { + emitStringAttribute(metric, DATADOG_ORIGIN, SYNTHETICS_ORIGIN); + } + } + } + + // accepts both String literals and UTF8BytesString (both CharSequence); skips null values + private static void emitStringAttribute( + OtlpMetricVisitor metric, String key, @Nullable CharSequence value) { + if (value != null) { + metric.visitAttribute(STRING_ATTRIBUTE, key, value.toString()); + } + } + + private static void emitLongAttribute(OtlpMetricVisitor metric, String key, long value) { + metric.visitAttribute(LONG_ATTRIBUTE, key, value); + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/trace/OtlpSpanKind.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/trace/OtlpSpanKind.java new file mode 100644 index 00000000000..c2d85c63e4c --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/trace/OtlpSpanKind.java @@ -0,0 +1,27 @@ +package datadog.trace.core.otlp.trace; + +import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_CLIENT; +import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_CONSUMER; +import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_PRODUCER; +import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_SERVER; + +/** Maps Datadog span-kind tags to OTLP's {@code Span.SpanKind} enum values. */ +final class OtlpSpanKind { + private OtlpSpanKind() {} + + static int spanKind(CharSequence spanKind) { + if (spanKind == null) { + return 0; // UNSPECIFIED + } else if (SPAN_KIND_SERVER.contentEquals(spanKind)) { + return 2; // SERVER + } else if (SPAN_KIND_CLIENT.contentEquals(spanKind)) { + return 3; // CLIENT + } else if (SPAN_KIND_PRODUCER.contentEquals(spanKind)) { + return 4; // PRODUCER + } else if (SPAN_KIND_CONSUMER.contentEquals(spanKind)) { + return 5; // CONSUMER + } else { + return 1; // INTERNAL + } + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/trace/OtlpTraceJson.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/trace/OtlpTraceJson.java new file mode 100644 index 00000000000..d9c5e9c3d90 --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/trace/OtlpTraceJson.java @@ -0,0 +1,227 @@ +package datadog.trace.core.otlp.trace; + +import static datadog.trace.bootstrap.instrumentation.api.InstrumentationTags.DD_MEASURED; +import static datadog.trace.bootstrap.instrumentation.api.InstrumentationTags.DD_PARTIAL_VERSION; +import static datadog.trace.bootstrap.instrumentation.api.InstrumentationTags.DD_TOP_LEVEL; +import static datadog.trace.bootstrap.instrumentation.api.InstrumentationTags.DD_WAS_LONG_RUNNING; +import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.BOOLEAN_ATTRIBUTE; +import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.DOUBLE_ATTRIBUTE; +import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.LONG_ATTRIBUTE; +import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.STRING_ATTRIBUTE; +import static datadog.trace.common.writer.RemoteMapper.HTTP_STATUS; +import static datadog.trace.common.writer.ddagent.TraceMapper.ORIGIN_KEY; +import static datadog.trace.common.writer.ddagent.TraceMapper.PROCESS_TAGS_KEY; +import static datadog.trace.common.writer.ddagent.TraceMapper.SAMPLING_PRIORITY_KEY; +import static datadog.trace.common.writer.ddagent.TraceMapper.THREAD_ID; +import static datadog.trace.common.writer.ddagent.TraceMapper.THREAD_NAME; +import static datadog.trace.core.otlp.common.OtlpCommonJson.hexSpanId; +import static datadog.trace.core.otlp.common.OtlpCommonJson.hexTraceId; +import static datadog.trace.core.otlp.common.OtlpCommonJson.writeAttribute; +import static datadog.trace.core.otlp.common.OtlpTraceFlags.NO_TRACE_FLAGS; +import static datadog.trace.core.otlp.common.OtlpTraceFlags.REMOTE_TRACE_FLAG; +import static datadog.trace.core.otlp.common.OtlpTraceFlags.SAMPLED_TRACE_FLAG; +import static datadog.trace.core.otlp.trace.OtlpSpanKind.spanKind; + +import datadog.json.JsonWriter; +import datadog.trace.api.Config; +import datadog.trace.api.DDTags; +import datadog.trace.api.TagMap; +import datadog.trace.bootstrap.instrumentation.api.AgentSpanLink; +import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; +import datadog.trace.core.DDSpan; +import datadog.trace.core.Metadata; +import datadog.trace.core.MetadataConsumer; +import datadog.trace.core.PendingTrace; +import datadog.trace.core.propagation.PropagationTags; +import java.util.List; +import java.util.Map; + +/** Provides writers for OpenTelemetry's "trace.proto" JSON encoding. */ +public final class OtlpTraceJson { + + private static final UTF8BytesString SERVICE_NAME = UTF8BytesString.create("service.name"); + private static final UTF8BytesString RESOURCE_NAME = UTF8BytesString.create("resource.name"); + private static final UTF8BytesString OPERATION_NAME = UTF8BytesString.create("operation.name"); + private static final UTF8BytesString SPAN_TYPE = UTF8BytesString.create("span.type"); + + private OtlpTraceJson() {} + + /** Writes one complete {@code Span} JSON object. */ + public static void writeSpan( + JsonWriter writer, DDSpan span, MetaWriter metaWriter, List links) { + PropagationTags propagationTags = span.spanContext().getPropagationTags(); + + writer.beginObject(); + + writer.name("traceId").value(hexTraceId(span.getTraceId())); + writer.name("spanId").value(hexSpanId(span.getSpanId())); + + String tracestate = propagationTags.getW3CTracestate(); + if (tracestate != null) { + writer.name("traceState").value(tracestate); + } + + if (span.getParentId() != 0) { + writer.name("parentSpanId").value(hexSpanId(span.getParentId())); + } + + int traceFlags = NO_TRACE_FLAGS; + if (span.samplingPriority() > 0) { + traceFlags |= SAMPLED_TRACE_FLAG; + } + if (span.spanContext().isRemote()) { + traceFlags |= REMOTE_TRACE_FLAG; + } + if (traceFlags != NO_TRACE_FLAGS) { + writer.name("flags").value(traceFlags); + } + + writer.name("name").value(span.getResourceName().toString()); + writer.name("kind").value(spanKind(span.spanContext().getSpanKindString())); + writer.name("startTimeUnixNano").value(Long.toString(span.getStartTime())); + writer + .name("endTimeUnixNano") + .value(Long.toString(span.getStartTime() + PendingTrace.getDurationNano(span))); + + writer.name("attributes").beginArray(); + if (!Config.get().getServiceName().equals(span.getServiceName())) { + writeSpanTag(writer, SERVICE_NAME, span.getServiceName()); + } + writeSpanTag(writer, RESOURCE_NAME, span.getResourceName()); + writeSpanTag(writer, OPERATION_NAME, span.getOperationName()); + if (span.getSpanType() != null) { + writeSpanTag(writer, SPAN_TYPE, span.getSpanType()); + } + span.processTagsAndBaggage(metaWriter); + writer.endArray(); + + if (!links.isEmpty()) { + writer.name("links").beginArray(); + for (AgentSpanLink link : links) { + writeSpanLink(writer, link); + } + writer.endArray(); + } + + if (span.isError()) { + writer.name("status").beginObject(); + Object errorMessage = span.getTag(DDTags.ERROR_MSG); + if (errorMessage instanceof String) { + writer.name("message").value((String) errorMessage); + } + writer.name("code").value(2); // STATUS_CODE_ERROR + writer.endObject(); + } + + writer.endObject(); + } + + /** Writes one complete {@code SpanLink} JSON object. */ + public static void writeSpanLink(JsonWriter writer, AgentSpanLink spanLink) { + writer.beginObject(); + + writer.name("traceId").value(hexTraceId(spanLink.traceId())); + writer.name("spanId").value(hexSpanId(spanLink.spanId())); + if (!spanLink.traceState().isEmpty()) { + writer.name("traceState").value(spanLink.traceState()); + } + + Map attributes = spanLink.attributes().asMap(); + if (!attributes.isEmpty()) { + writer.name("attributes").beginArray(); + attributes.forEach( + (key, value) -> writeAttribute(writer, STRING_ATTRIBUTE, key.toString(), value)); + writer.endArray(); + } + + writer.name("flags").value(spanLink.traceFlags() & 0xff); + + writer.endObject(); + } + + private static void writeSpanTag(JsonWriter writer, TagMap.EntryReader tagEntry) { + switch (tagEntry.type()) { + case TagMap.EntryReader.BOOLEAN: + writeAttribute(writer, BOOLEAN_ATTRIBUTE, tagEntry.tag(), tagEntry.objectValue()); + break; + case TagMap.EntryReader.INT: + case TagMap.EntryReader.LONG: + writeAttribute(writer, LONG_ATTRIBUTE, tagEntry.tag(), tagEntry.objectValue()); + break; + case TagMap.EntryReader.FLOAT: + case TagMap.EntryReader.DOUBLE: + writeAttribute(writer, DOUBLE_ATTRIBUTE, tagEntry.tag(), tagEntry.objectValue()); + break; + default: + writeAttribute(writer, STRING_ATTRIBUTE, tagEntry.tag(), tagEntry.stringValue()); + } + } + + private static void writeSpanTag(JsonWriter writer, UTF8BytesString key, CharSequence value) { + writeAttribute(writer, key, value.toString()); + } + + private static void writeSpanTag(JsonWriter writer, UTF8BytesString key, long value) { + writeAttribute(writer, key, value); + } + + public static class MetaWriter implements MetadataConsumer { + private final JsonWriter writer; + + private boolean includeProcessTags; + private boolean includeSamplingTags; + + public MetaWriter(JsonWriter writer) { + this.writer = writer; + } + + /** Call this to ensure process tags are written out for the next span. */ + public void includeProcessTags() { + includeProcessTags = true; + } + + /** Call this to ensure sampling tags are written out for the next span. */ + public void includeSamplingTags() { + includeSamplingTags = true; + } + + @Override + public void accept(Metadata metadata) { + if ((includeSamplingTags || metadata.topLevel()) && metadata.hasSamplingPriority()) { + writeSpanTag(writer, SAMPLING_PRIORITY_KEY, metadata.samplingPriority()); + } + if (metadata.measured()) { + writeSpanTag(writer, DD_MEASURED, 1); + } + if (metadata.topLevel()) { + writeSpanTag(writer, DD_TOP_LEVEL, 1); + } + + if (metadata.longRunningVersion() != 0) { + if (metadata.longRunningVersion() > 0) { + writeSpanTag(writer, DD_PARTIAL_VERSION, metadata.longRunningVersion()); + } else { + writeSpanTag(writer, DD_WAS_LONG_RUNNING, 1); + } + } + + writeSpanTag(writer, THREAD_ID, metadata.getThreadId()); + writeSpanTag(writer, THREAD_NAME, metadata.getThreadName()); + if (metadata.getHttpStatusCode() != null) { + writeSpanTag(writer, HTTP_STATUS, metadata.getHttpStatusCode()); + } + if (metadata.getOrigin() != null) { + writeSpanTag(writer, ORIGIN_KEY, metadata.getOrigin()); + } + if (includeProcessTags && metadata.processTags() != null) { + writeSpanTag(writer, PROCESS_TAGS_KEY, metadata.processTags()); + } + + metadata.getTags().forEach(writer, OtlpTraceJson::writeSpanTag); + + // reset for next span + includeProcessTags = false; + includeSamplingTags = false; + } + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/trace/OtlpTraceJsonCollector.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/trace/OtlpTraceJsonCollector.java new file mode 100644 index 00000000000..c5da9bcddaf --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/trace/OtlpTraceJsonCollector.java @@ -0,0 +1,182 @@ +package datadog.trace.core.otlp.trace; + +import static datadog.trace.core.otlp.common.OtlpCommonJson.writeScopeAndSchema; +import static datadog.trace.core.otlp.common.OtlpPayload.JSON_CONTENT_TYPE; +import static datadog.trace.core.otlp.common.OtlpResourceJson.TRACE_RESOURCE_FRAGMENT; +import static datadog.trace.core.otlp.trace.OtlpTraceJson.writeSpan; + +import datadog.json.JsonWriter; +import datadog.trace.bootstrap.instrumentation.api.AgentSpanLink; +import datadog.trace.bootstrap.otel.common.OtelInstrumentationScope; +import datadog.trace.core.CoreSpan; +import datadog.trace.core.DDSpan; +import datadog.trace.core.otlp.common.OtlpPayload; +import java.nio.ByteBuffer; +import java.util.Collections; +import java.util.List; + +/** + * Collects Datadog traces and marshals them into a 'trace.proto' JSON payload. + * + *

      This collector is designed to be called by a single thread. To minimize allocations each + * collection returns a payload only to be used by the calling thread until the next collection. + * (The payload should be copied before passing it onto another thread.) + * + *

      Unlike the protobuf collector, JSON doesn't need message lengths computed ahead of time, so + * spans are written directly and in order into the currently open JSON arrays as they're completed. + * Process tags are attached to the first span written in a scope, matching the {@code + * firstSpanInPayload} convention used by the other trace mappers. Sampling tags still need a + * one-span lookahead: that decision (and the corresponding {@code MetadataConsumer.accept} call) + * can only be made once we see the next span (or reach a scope/payload boundary), since it depends + * on whether the held-back span is the last one in its trace. + */ +public final class OtlpTraceJsonCollector extends OtlpTraceCollector { + + private static final OtelInstrumentationScope DEFAULT_TRACE_SCOPE = + new OtelInstrumentationScope("", null, null); + + private JsonWriter writer; + private OtlpTraceJson.MetaWriter metaWriter; + + private boolean payloadStarted; + private boolean anySpanWritten; + private boolean firstSpanInScope; + + private OtelInstrumentationScope currentScope; + private DDSpan currentSpan; + private List currentSpanLinks = Collections.emptyList(); + + /** Adds the given trace spans to the collector. */ + @Override + public void addTrace(List> spans) { + if (!payloadStarted) { + start(); + payloadStarted = true; + } + + for (CoreSpan span : spans) { + visitSpan(span); + } + } + + /** + * Marshals the traces collected so far into a JSON payload. + * + *

      This payload is only valid for the calling thread until the next collection. + */ + @Override + public OtlpPayload collectTraces() { + if (!payloadStarted) { + return OtlpPayload.EMPTY; + } + try { + return completePayload(); + } finally { + stop(); + } + } + + /** Prepare temporary elements to collect trace data. */ + private void start() { + writer = new JsonWriter(); + metaWriter = new OtlpTraceJson.MetaWriter(writer); + + writer.beginObject(); + writer.name("resourceSpans").beginArray(); + writer.beginObject(); + writer.name("resource").jsonValue(TRACE_RESOURCE_FRAGMENT); + writer.name("scopeSpans").beginArray(); + + // for now put all spans under the default scope + visitScopedSpans(DEFAULT_TRACE_SCOPE); + } + + /** Cleanup elements used to collect trace data. */ + private void stop() { + payloadStarted = false; + anySpanWritten = false; + + writer = null; + metaWriter = null; + + currentScope = null; + currentSpan = null; + currentSpanLinks = Collections.emptyList(); + } + + private void visitScopedSpans(OtelInstrumentationScope scope) { + if (currentScope != null) { + completeScope(); + } + currentScope = scope; + firstSpanInScope = true; + + writer.beginObject(); + writeScopeAndSchema(writer, scope); + writer.name("spans").beginArray(); + } + + private void visitSpan(CoreSpan span) { + if (shouldExport(span)) { + if (currentSpan != null) { + // ensure last span written at trace boundary includes sampling tags + if (!span.getTraceId().equals(currentSpan.getTraceId())) { + metaWriter.includeSamplingTags(); + } + completeSpan(); + } + currentSpan = (DDSpan) span; + currentSpanLinks = currentSpan.getLinks(); + } + } + + // called once we've processed all scopes and span messages + private OtlpPayload completePayload() { + if (currentScope != null) { + completeScope(); + } + + writer.endArray(); // scopeSpans + writer.endObject(); // resourceSpans[0] + writer.endArray(); // resourceSpans + writer.endObject(); // root + + if (!anySpanWritten) { + return OtlpPayload.EMPTY; + } + + byte[] bytes = writer.toByteArray(); + return new OtlpPayload(ByteBuffer.wrap(bytes), JSON_CONTENT_TYPE); + } + + // called once we've processed all spans in a specific scope + private void completeScope() { + if (currentSpan != null) { + // ensure last span written at scope boundary includes sampling tags + metaWriter.includeSamplingTags(); + completeSpan(); + } + + writer.endArray(); // spans + writer.endObject(); // scopeSpans[0] + + // reset temporary elements for next scope + currentScope = null; + } + + // called once we've processed all span-links in a specific span + private void completeSpan() { + if (firstSpanInScope) { + // ensure first span written in the scope includes process tags, + // matching the firstSpanInPayload convention used by the other trace mappers + metaWriter.includeProcessTags(); + firstSpanInScope = false; + } + writeSpan(writer, currentSpan, metaWriter, currentSpanLinks); + anySpanWritten = true; + + // reset temporary elements for next span + currentSpan = null; + currentSpanLinks = Collections.emptyList(); + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/trace/OtlpTraceProto.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/trace/OtlpTraceProto.java index 5f317b40730..f97d05c388d 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/otlp/trace/OtlpTraceProto.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/trace/OtlpTraceProto.java @@ -4,10 +4,6 @@ import static datadog.trace.bootstrap.instrumentation.api.InstrumentationTags.DD_PARTIAL_VERSION; import static datadog.trace.bootstrap.instrumentation.api.InstrumentationTags.DD_TOP_LEVEL; import static datadog.trace.bootstrap.instrumentation.api.InstrumentationTags.DD_WAS_LONG_RUNNING; -import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_CLIENT; -import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_CONSUMER; -import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_PRODUCER; -import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_SERVER; import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.BOOLEAN_ATTRIBUTE; import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.DOUBLE_ATTRIBUTE; import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.LONG_ATTRIBUTE; @@ -30,6 +26,10 @@ import static datadog.trace.core.otlp.common.OtlpCommonProto.writeString; import static datadog.trace.core.otlp.common.OtlpCommonProto.writeTag; import static datadog.trace.core.otlp.common.OtlpCommonProto.writeVarInt; +import static datadog.trace.core.otlp.common.OtlpTraceFlags.NO_TRACE_FLAGS; +import static datadog.trace.core.otlp.common.OtlpTraceFlags.REMOTE_TRACE_FLAG; +import static datadog.trace.core.otlp.common.OtlpTraceFlags.SAMPLED_TRACE_FLAG; +import static datadog.trace.core.otlp.trace.OtlpSpanKind.spanKind; import static java.nio.charset.StandardCharsets.UTF_8; import datadog.communication.serialization.GrowableBuffer; @@ -56,10 +56,6 @@ public final class OtlpTraceProto { private static final UTF8BytesString OPERATION_NAME = UTF8BytesString.create("operation.name"); private static final UTF8BytesString SPAN_TYPE = UTF8BytesString.create("span.type"); - public static final int NO_TRACE_FLAGS = 0x00000000; - public static final int SAMPLED_TRACE_FLAG = 0x00000001; - public static final int REMOTE_TRACE_FLAG = 0x00000300; - private OtlpTraceProto() {} /** Records a scoped spans message after its nested span messages have been recorded. */ @@ -86,7 +82,7 @@ public static int recordSpanMessage( MetaWriter metaWriter, int nestedSpanLinkBytes, OtlpProtoBuffer protobuf) { - PropagationTags propagationTags = span.context().getPropagationTags(); + PropagationTags propagationTags = span.spanContext().getPropagationTags(); writeTag(buf, 1, LEN_WIRE_TYPE); writeTraceId(buf, span.getTraceId()); @@ -109,7 +105,7 @@ public static int recordSpanMessage( if (span.samplingPriority() > 0) { traceFlags |= SAMPLED_TRACE_FLAG; } - if (span.context().isRemote()) { + if (span.spanContext().isRemote()) { traceFlags |= REMOTE_TRACE_FLAG; } if (traceFlags != NO_TRACE_FLAGS) { @@ -126,7 +122,7 @@ public static int recordSpanMessage( } writeTag(buf, 6, VARINT_WIRE_TYPE); - writeVarInt(buf, spanKind(span.context().getSpanKindString())); + writeVarInt(buf, spanKind(span.spanContext().getSpanKindString())); writeTag(buf, 7, I64_WIRE_TYPE); writeI64(buf, span.getStartTime()); @@ -176,8 +172,10 @@ public static int recordSpanLinkMessage( writeTag(buf, 2, LEN_WIRE_TYPE); writeSpanId(buf, spanLink.spanId()); - writeTag(buf, 3, LEN_WIRE_TYPE); - writeString(buf, spanLink.traceState()); + if (!spanLink.traceState().isEmpty()) { + writeTag(buf, 3, LEN_WIRE_TYPE); + writeString(buf, spanLink.traceState()); + } spanLink .attributes() @@ -189,7 +187,7 @@ public static int recordSpanLinkMessage( }); writeTag(buf, 6, I32_WIRE_TYPE); - writeI32(buf, spanLink.traceFlags()); + writeI32(buf, spanLink.traceFlags() & 0xff); return protobuf.recordMessage(buf, 13); } @@ -244,22 +242,6 @@ private static void writeSpanTag(StreamingBuffer buf, UTF8BytesString key, long writeAttribute(buf, key, value); } - private static int spanKind(CharSequence spanKind) { - if (spanKind == null) { - return 0; // UNSPECIFIED - } else if (SPAN_KIND_SERVER.contentEquals(spanKind)) { - return 2; // SERVER - } else if (SPAN_KIND_CLIENT.contentEquals(spanKind)) { - return 3; // CLIENT - } else if (SPAN_KIND_PRODUCER.contentEquals(spanKind)) { - return 4; // PRODUCER - } else if (SPAN_KIND_CONSUMER.contentEquals(spanKind)) { - return 5; // CONSUMER - } else { - return 1; // INTERNAL - } - } - public static class MetaWriter implements MetadataConsumer { private final StreamingBuffer buf; diff --git a/dd-trace-core/src/main/java/datadog/trace/core/otlp/trace/OtlpTraceProtoCollector.java b/dd-trace-core/src/main/java/datadog/trace/core/otlp/trace/OtlpTraceProtoCollector.java index f37b7a5aea2..fa1efa87fba 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/otlp/trace/OtlpTraceProtoCollector.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/otlp/trace/OtlpTraceProtoCollector.java @@ -1,6 +1,6 @@ package datadog.trace.core.otlp.trace; -import static datadog.trace.core.otlp.common.OtlpResourceProto.RESOURCE_MESSAGE; +import static datadog.trace.core.otlp.common.OtlpResourceProto.TRACE_RESOURCE_MESSAGE; import static datadog.trace.core.otlp.trace.OtlpTraceProto.recordScopedSpansMessage; import static datadog.trace.core.otlp.trace.OtlpTraceProto.recordSpanLinkMessage; import static datadog.trace.core.otlp.trace.OtlpTraceProto.recordSpanMessage; @@ -138,7 +138,7 @@ private OtlpPayload completePayload() { } // prepend the canned resource chunk - payloadBytes += protobuf.recordMessage(RESOURCE_MESSAGE); + payloadBytes += protobuf.recordMessage(TRACE_RESOURCE_MESSAGE); // finally prepend the total length of all collected chunks protobuf.recordMessage(buf, 1, payloadBytes); diff --git a/dd-trace-core/src/main/java/datadog/trace/core/propagation/B3HttpCodec.java b/dd-trace-core/src/main/java/datadog/trace/core/propagation/B3HttpCodec.java index 75f3e280c89..7d6d132541a 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/propagation/B3HttpCodec.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/propagation/B3HttpCodec.java @@ -25,15 +25,15 @@ class B3HttpCodec { private static final Logger log = LoggerFactory.getLogger(B3HttpCodec.class); - private static final String B3_TRACE_ID = "b3.traceid"; - private static final String B3_SPAN_ID = "b3.spanid"; + static final String B3_TRACE_ID = "b3.traceid"; + static final String B3_SPAN_ID = "b3.spanid"; static final String TRACE_ID_KEY = "X-B3-TraceId"; static final String SPAN_ID_KEY = "X-B3-SpanId"; - private static final String SAMPLING_PRIORITY_KEY = "X-B3-Sampled"; + static final String SAMPLING_PRIORITY_KEY = "X-B3-Sampled"; // See https://github.com/openzipkin/b3-propagation#single-header for b3 header documentation - private static final String B3_KEY = "b3"; - private static final String SAMPLING_PRIORITY_ACCEPT = String.valueOf(1); - private static final String SAMPLING_PRIORITY_DROP = String.valueOf(0); + static final String B3_KEY = "b3"; + static final String SAMPLING_PRIORITY_ACCEPT = String.valueOf(1); + static final String SAMPLING_PRIORITY_DROP = String.valueOf(0); private B3HttpCodec() { // This class should not be created. This also makes code coverage checks happy. @@ -282,7 +282,7 @@ public boolean accept(String key, String value) { if (LOG_EXTRACT_HEADER_NAMES) { log.debug("Header: {}", key); } - if (B3_KEY.equals(key)) { + if (B3_KEY.equalsIgnoreCase(key)) { return extractB3(firstHeaderValue(value)); } else { char first = Character.toLowerCase(key.charAt(0)); diff --git a/dd-trace-core/src/main/java/datadog/trace/core/propagation/HaystackHttpCodec.java b/dd-trace-core/src/main/java/datadog/trace/core/propagation/HaystackHttpCodec.java index f7b8b04a0b9..90573ea763b 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/propagation/HaystackHttpCodec.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/propagation/HaystackHttpCodec.java @@ -29,17 +29,17 @@ class HaystackHttpCodec { private static final Logger log = LoggerFactory.getLogger(HaystackHttpCodec.class); // https://github.com/ExpediaDotCom/haystack-client-java/blob/master/core/src/main/java/com/expedia/www/haystack/client/propagation/DefaultKeyConvention.java - private static final String OT_BAGGAGE_PREFIX = "Baggage-"; - private static final String TRACE_ID_KEY = "Trace-ID"; - private static final String SPAN_ID_KEY = "Span-ID"; - private static final String PARENT_ID_KEY = "Parent-ID"; + static final String OT_BAGGAGE_PREFIX = "Baggage-"; + static final String TRACE_ID_KEY = "Trace-ID"; + static final String SPAN_ID_KEY = "Span-ID"; + static final String PARENT_ID_KEY = "Parent-ID"; - private static final String DD_TRACE_ID_BAGGAGE_KEY = OT_BAGGAGE_PREFIX + "Datadog-Trace-Id"; - private static final String DD_SPAN_ID_BAGGAGE_KEY = OT_BAGGAGE_PREFIX + "Datadog-Span-Id"; - private static final String DD_PARENT_ID_BAGGAGE_KEY = OT_BAGGAGE_PREFIX + "Datadog-Parent-Id"; + static final String DD_TRACE_ID_BAGGAGE_KEY = OT_BAGGAGE_PREFIX + "Datadog-Trace-Id"; + static final String DD_SPAN_ID_BAGGAGE_KEY = OT_BAGGAGE_PREFIX + "Datadog-Span-Id"; + static final String DD_PARENT_ID_BAGGAGE_KEY = OT_BAGGAGE_PREFIX + "Datadog-Parent-Id"; - private static final String HAYSTACK_TRACE_ID_BAGGAGE_KEY = "Haystack-Trace-ID"; - private static final String HAYSTACK_SPAN_ID_BAGGAGE_KEY = "Haystack-Span-ID"; + static final String HAYSTACK_TRACE_ID_BAGGAGE_KEY = "Haystack-Trace-ID"; + static final String HAYSTACK_SPAN_ID_BAGGAGE_KEY = "Haystack-Span-ID"; private static final String HAYSTACK_PARENT_ID_BAGGAGE_KEY = "Haystack-Parent-ID"; // public static final long DATADOG = new BigInteger("Datadog!".getBytes()).longValue(); diff --git a/dd-trace-core/src/main/java/datadog/trace/core/propagation/HttpCodec.java b/dd-trace-core/src/main/java/datadog/trace/core/propagation/HttpCodec.java index d98245b443a..38783860e9b 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/propagation/HttpCodec.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/propagation/HttpCodec.java @@ -244,7 +244,7 @@ public TagContext extract( } } else { // Terminate extracted context and add it as span link - context.addTerminatedContextLink( + context.addTerminatedSpanLink( DDSpanLink.from( (ExtractedContext) extracted, SpanAttributes.builder() diff --git a/dd-trace-core/src/main/java/datadog/trace/core/propagation/PropagationTags.java b/dd-trace-core/src/main/java/datadog/trace/core/propagation/PropagationTags.java index 05576f9cceb..3a0c57a4dd8 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/propagation/PropagationTags.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/propagation/PropagationTags.java @@ -49,6 +49,14 @@ public interface Factory { PropagationTags empty(); PropagationTags fromHeaderValue(HeaderType headerType, String value); + + /** + * Returns a fresh PropagationTags that re-encodes only the non-{@code dd} vendor sections of + * the supplied W3C tracestate. All Datadog-side state (sampling priority, origin, {@code + * _dd.p.*} tags) is dropped. If {@code originalTracestate} is {@code null} or empty, behaves + * like {@link #empty()}. + */ + PropagationTags emptyW3C(String originalTracestate); } /** @@ -71,8 +79,6 @@ public interface Factory { public abstract CharSequence getLastParentId(); - public abstract void updateLastParentId(CharSequence lastParentId); - /** * Gets the original W3C * tracestate header value. @@ -96,6 +102,15 @@ public interface Factory { */ public abstract String headerValue(HeaderType headerType); + /** + * Like {@link #headerValue(HeaderType)} but uses {@code lastParentIdOverride} for the W3C {@code + * p:} (last-parent-id) instead of the stored {@link #getLastParentId() last-parent-id}. Used at + * inject so the injecting span's id is supplied as a parameter rather than mutated into these + * (possibly trace-level, shared) tags — keeping transient per-injection identity out of shared + * state. A {@code null} override falls back to {@link #headerValue(HeaderType)}. + */ + public abstract String headerValue(HeaderType headerType, CharSequence lastParentIdOverride); + /** * Fills a provided tagMap with valid propagated _dd.p.* tags and possibly a new sampling decision * tags _dd.p.dm (root span only) based on the current state, or sets only an error tag if the @@ -140,6 +155,20 @@ public interface Factory { */ public abstract void updateKnuthSamplingRate(double rate); + /** + * Returns the Org Propagation Marker (OPM) currently held in these tags, encoded as {@code + * _dd.p.opm} in Datadog headers and {@code t.opm} in W3C tracestate. Returns {@code null} if no + * OPM is set. + */ + public abstract CharSequence getOrgPropagationMarker(); + + /** + * Sets the Org Propagation Marker (OPM). Passing {@code null} clears the marker. The injection + * codecs call this just before serializing so that, when the local tracer knows its own OPM, it + * overrides any inbound OPM. + */ + public abstract void updateOrgPropagationMarker(CharSequence opm); + public HashMap createTagMap() { HashMap result = new HashMap<>(); fillTagMap(result); diff --git a/dd-trace-core/src/main/java/datadog/trace/core/propagation/TracingPropagator.java b/dd-trace-core/src/main/java/datadog/trace/core/propagation/TracingPropagator.java index 89bb8ea5d59..f9267c355d7 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/propagation/TracingPropagator.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/propagation/TracingPropagator.java @@ -47,7 +47,7 @@ public void inject(Context context, C carrier, CarrierSetter setter) { || (span = fromContext(context)) == null) { return; } - AgentSpanContext spanContext = span.context(); + AgentSpanContext spanContext = span.spanContext(); if (spanContext instanceof DDSpanContext) { DDSpanContext ddSpanContext = (DDSpanContext) spanContext; // Stop injection if tracing is disabled and tracing span is coming from tracing only diff --git a/dd-trace-core/src/main/java/datadog/trace/core/propagation/W3CHttpCodec.java b/dd-trace-core/src/main/java/datadog/trace/core/propagation/W3CHttpCodec.java index 52037859cb2..1d1d55cecc4 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/propagation/W3CHttpCodec.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/propagation/W3CHttpCodec.java @@ -16,6 +16,7 @@ import datadog.trace.api.DDTraceId; import datadog.trace.api.TraceConfig; import datadog.trace.api.TracePropagationStyle; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.api.internal.util.LongStringUtils; import datadog.trace.api.propagation.W3CTraceParent; import datadog.trace.api.sampling.PrioritySampling; @@ -40,10 +41,9 @@ class W3CHttpCodec { private static final int TRACE_PARENT_FLAGS_SAMPLED = 1; private static final int TRACE_PARENT_LENGTH = TRACE_PARENT_FLAGS_START + 2; - // Package-protected for testing - static final String TRACE_PARENT_KEY = "traceparent"; - static final String TRACE_STATE_KEY = "tracestate"; - static final String OT_BAGGAGE_PREFIX = "ot-baggage-"; + @VisibleForTesting static final String TRACE_PARENT_KEY = "traceparent"; + @VisibleForTesting static final String TRACE_STATE_KEY = "tracestate"; + @VisibleForTesting static final String OT_BAGGAGE_PREFIX = "ot-baggage-"; static final String E2E_START_KEY = OT_BAGGAGE_PREFIX + DDTags.TRACE_START_TIME; private W3CHttpCodec() { @@ -80,8 +80,11 @@ private void injectTraceParent(DDSpanContext context, C carrier, CarrierSett private void injectTraceState(DDSpanContext context, C carrier, CarrierSetter setter) { PropagationTags propagationTags = context.getPropagationTags(); - propagationTags.updateLastParentId(DDSpanId.toHexStringPadded(context.getSpanId())); - String tracestate = propagationTags.headerValue(W3C); + // Supply the injecting span's id for the W3C `p:` as a parameter rather than mutating it into + // the (possibly trace-level, shared) tags — keeps transient per-injection identity out of + // shared state, so concurrent sibling injects can't race on it. + String tracestate = + propagationTags.headerValue(W3C, DDSpanId.toHexStringPadded(context.getSpanId())); if (tracestate != null && !tracestate.isEmpty()) { setter.set(carrier, TRACE_STATE_KEY, tracestate); } diff --git a/dd-trace-core/src/main/java/datadog/trace/core/propagation/XRayHttpCodec.java b/dd-trace-core/src/main/java/datadog/trace/core/propagation/XRayHttpCodec.java index f2396d83706..8b1c20f19af 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/propagation/XRayHttpCodec.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/propagation/XRayHttpCodec.java @@ -30,7 +30,7 @@ class XRayHttpCodec { private static final Logger log = LoggerFactory.getLogger(XRayHttpCodec.class); - static final String X_AMZN_TRACE_ID = "X-Amzn-Trace-Id"; + public static final String X_AMZN_TRACE_ID = "X-Amzn-Trace-Id"; static final String ROOT = "Root"; static final String PARENT = "Parent"; diff --git a/dd-trace-core/src/main/java/datadog/trace/core/propagation/XRayPropagator.java b/dd-trace-core/src/main/java/datadog/trace/core/propagation/XRayPropagator.java index 1a706306781..bffb5835bd9 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/propagation/XRayPropagator.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/propagation/XRayPropagator.java @@ -43,7 +43,7 @@ public void inject(Context context, C carrier, CarrierSetter setter) { || (span = fromContext(context)) == null) { return; } - AgentSpanContext spanContext = span.context(); + AgentSpanContext spanContext = span.spanContext(); if (spanContext instanceof DDSpanContext) { DDSpanContext ddSpanContext = (DDSpanContext) spanContext; ddSpanContext.getTraceCollector().setSamplingPriorityIfNecessary(); diff --git a/dd-trace-core/src/main/java/datadog/trace/core/propagation/opg/OpmStampingInjector.java b/dd-trace-core/src/main/java/datadog/trace/core/propagation/opg/OpmStampingInjector.java new file mode 100644 index 00000000000..6ee131b8df5 --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/core/propagation/opg/OpmStampingInjector.java @@ -0,0 +1,35 @@ +package datadog.trace.core.propagation.opg; + +import datadog.context.propagation.CarrierSetter; +import datadog.trace.core.DDSpanContext; +import datadog.trace.core.propagation.HttpCodec; +import java.util.function.Supplier; + +/** + * Decorates an {@link HttpCodec.Injector} so that, just before delegating to the underlying codecs, + * it stamps the local Org Propagation Marker (OPM) onto the span's propagation tags. The codecs + * (Datadog, W3C tracecontext) then serialize whatever is in the propagation tags, which causes the + * local OPM to overwrite any inbound OPM in {@code _dd.p.opm} / {@code t.opm}. + * + *

      If the supplier returns {@code null} (the agent hasn't reported an OPM yet), this is a no-op + * and any inbound OPM is forwarded as-is, per the RFC. + */ +final class OpmStampingInjector implements HttpCodec.Injector { + + private final HttpCodec.Injector delegate; + private final Supplier localOpmSupplier; + + OpmStampingInjector(HttpCodec.Injector delegate, Supplier localOpmSupplier) { + this.delegate = delegate; + this.localOpmSupplier = localOpmSupplier; + } + + @Override + public void inject(DDSpanContext context, C carrier, CarrierSetter setter) { + String localOpm = localOpmSupplier.get(); + if (localOpm != null) { + context.getPropagationTags().updateOrgPropagationMarker(localOpm); + } + delegate.inject(context, carrier, setter); + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/core/propagation/opg/OrgGuard.java b/dd-trace-core/src/main/java/datadog/trace/core/propagation/opg/OrgGuard.java new file mode 100644 index 00000000000..870bb80fd61 --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/core/propagation/opg/OrgGuard.java @@ -0,0 +1,63 @@ +package datadog.trace.core.propagation.opg; + +import datadog.trace.api.Config; +import datadog.trace.core.monitor.HealthMetrics; +import datadog.trace.core.propagation.HttpCodec; +import datadog.trace.core.propagation.PropagationTags; +import java.util.function.Supplier; +import javax.annotation.Nullable; + +/** + * Single entry point for the Org Propagation Guard (OPG). Owns the gating decision and constructs + * the extract-side and inject-side decorators when OPG is enabled. When disabled, {@link + * #decorateExtractor} and {@link #decorateInjector} return their argument unchanged so the + * propagation chain pays zero overhead and any inbound OPM passes through the codec layer + * untouched. + */ +public final class OrgGuard { + + @Nullable private final OrgGuardEnforcer enforcer; + + public static OrgGuard create( + Config config, + Supplier localOpmSupplier, + PropagationTags.Factory propagationTagsFactory, + HealthMetrics healthMetrics) { + if (!config.isTraceOrgGuardEnabled()) { + return new OrgGuard(null); + } + return new OrgGuard( + new OrgGuardEnforcer(config, localOpmSupplier, propagationTagsFactory, healthMetrics)); + } + + private OrgGuard(@Nullable OrgGuardEnforcer enforcer) { + this.enforcer = enforcer; + } + + public HttpCodec.Extractor decorateExtractor(HttpCodec.Extractor delegate) { + return enforcer == null ? delegate : new OrgGuardEnforcingExtractor(delegate, enforcer); + } + + public HttpCodec.Injector decorateInjector(HttpCodec.Injector delegate) { + return enforcer == null + ? delegate + : new OpmStampingInjector(delegate, enforcer.localOpmSupplier()); + } + + /** Reason an extracted Datadog context was dropped by the OPG enforcer. */ + public enum Reason { + MISMATCH("mismatch"), + STRICT_MISSING("strict_missing"); + + private final String tag; + + Reason(String tag) { + this.tag = tag; + } + + /** Statsd tag value for the {@code reason} dimension on {@code org_guard.enforce} metrics. */ + public String tag() { + return tag; + } + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/core/propagation/opg/OrgGuardEnforcer.java b/dd-trace-core/src/main/java/datadog/trace/core/propagation/opg/OrgGuardEnforcer.java new file mode 100644 index 00000000000..2bf37d87324 --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/core/propagation/opg/OrgGuardEnforcer.java @@ -0,0 +1,125 @@ +package datadog.trace.core.propagation.opg; + +import datadog.trace.api.Config; +import datadog.trace.api.sampling.PrioritySampling; +import datadog.trace.bootstrap.instrumentation.api.TagContext; +import datadog.trace.core.monitor.HealthMetrics; +import datadog.trace.core.propagation.ExtractedContext; +import datadog.trace.core.propagation.PropagationTags; +import java.util.Set; +import java.util.function.Supplier; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Enforces the Org Propagation Guard (OPG) on extracted contexts. When an inbound trace carries an + * Org Propagation Marker (OPM) that does not match the local one, the Datadog-side context + * (sampling priority, origin, {@code _dd.p.*} propagated tags) is dropped while parent identifiers, + * baggage, and non-{@code dd} tracestate vendor sections are preserved. + * + *

      The master {@code DD_TRACE_ORG_GUARD_ENABLED} switch is handled at the {@link OrgGuard} + * factory; when disabled this class is never instantiated. Two configuration knobs shape behavior + * once enabled: + * + *

        + *
      • {@code DD_TRACE_ORG_GUARD_STRICT} — when {@code true}, also enforces when the inbound OPM + * is absent. + *
      • {@code DD_TRACE_ORG_GUARD_TRUSTED_OPMS} — comma-separated allow-list of inbound OPMs that + * should be treated as trusted. + *
      + * + *

      Enforcement never runs when the local OPM is unknown (the agent has not yet reported one). + */ +final class OrgGuardEnforcer { + + private static final Logger log = LoggerFactory.getLogger(OrgGuardEnforcer.class); + + private final boolean strict; + private final Set trustedOpms; + private final Supplier localOpmSupplier; + private final PropagationTags.Factory factory; + private final HealthMetrics healthMetrics; + + OrgGuardEnforcer( + Config config, + Supplier localOpmSupplier, + PropagationTags.Factory factory, + HealthMetrics healthMetrics) { + this( + config.isTraceOrgGuardStrict(), + config.getTraceOrgGuardTrustedOpms(), + localOpmSupplier, + factory, + healthMetrics); + } + + // Visible for testing. + OrgGuardEnforcer( + boolean strict, + Set trustedOpms, + Supplier localOpmSupplier, + PropagationTags.Factory factory, + HealthMetrics healthMetrics) { + this.strict = strict; + this.trustedOpms = trustedOpms; + this.localOpmSupplier = localOpmSupplier; + this.factory = factory; + this.healthMetrics = healthMetrics; + } + + Supplier localOpmSupplier() { + return localOpmSupplier; + } + + /** + * Returns {@code extracted} unchanged unless OPG enforcement applies, in which case it returns a + * fresh {@link ExtractedContext} with the Datadog-side context dropped. + */ + public TagContext enforce(TagContext extracted) { + if (!(extracted instanceof ExtractedContext)) { + return extracted; + } + ExtractedContext ctx = (ExtractedContext) extracted; + String localOpm = localOpmSupplier.get(); + if (localOpm == null) { + // We don't know our own OPM yet — never enforce. + return extracted; + } + CharSequence opmChars = ctx.getPropagationTags().getOrgPropagationMarker(); + if (opmChars == null) { + if (!strict) { + return extracted; + } + return strip(ctx, OrgGuard.Reason.STRICT_MISSING, localOpm, null); + } + String inboundOpm = opmChars.toString(); + if (localOpm.equals(inboundOpm) || trustedOpms.contains(inboundOpm)) { + return extracted; + } + return strip(ctx, OrgGuard.Reason.MISMATCH, localOpm, inboundOpm); + } + + private ExtractedContext strip( + ExtractedContext ctx, OrgGuard.Reason reason, String localOpm, String inboundOpm) { + log.debug( + "OPG enforcement: dropping dd context (reason={}, inbound={}, local={})", + reason.tag(), + inboundOpm, + localOpm); + healthMetrics.onOrgGuardEnforce(reason); + + PropagationTags stripped = factory.emptyW3C(ctx.getPropagationTags().getW3CTracestate()); + return new ExtractedContext( + ctx.getTraceId(), + ctx.getSpanId(), + PrioritySampling.UNSET, + null, + ctx.getEndToEndStartTime(), + ctx.getBaggage(), + ctx.getTags(), + null, + stripped, + ctx.getTraceConfig(), + ctx.getPropagationStyle()); + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/core/propagation/opg/OrgGuardEnforcingExtractor.java b/dd-trace-core/src/main/java/datadog/trace/core/propagation/opg/OrgGuardEnforcingExtractor.java new file mode 100644 index 00000000000..c0526bf6dd8 --- /dev/null +++ b/dd-trace-core/src/main/java/datadog/trace/core/propagation/opg/OrgGuardEnforcingExtractor.java @@ -0,0 +1,31 @@ +package datadog.trace.core.propagation.opg; + +import datadog.trace.bootstrap.instrumentation.api.AgentPropagation; +import datadog.trace.bootstrap.instrumentation.api.TagContext; +import datadog.trace.core.propagation.HttpCodec; + +/** + * Decorates an {@link HttpCodec.Extractor} so that, after the underlying codec extracts a context, + * it is run through the {@link OrgGuardEnforcer} which may strip the Datadog-side context when the + * inbound Org Propagation Marker (OPM) does not match the local one. + */ +final class OrgGuardEnforcingExtractor implements HttpCodec.Extractor { + + private final HttpCodec.Extractor delegate; + private final OrgGuardEnforcer enforcer; + + OrgGuardEnforcingExtractor(HttpCodec.Extractor delegate, OrgGuardEnforcer enforcer) { + this.delegate = delegate; + this.enforcer = enforcer; + } + + @Override + public TagContext extract(C carrier, AgentPropagation.ContextVisitor getter) { + return enforcer.enforce(delegate.extract(carrier, getter)); + } + + @Override + public void cleanup() { + delegate.cleanup(); + } +} diff --git a/dd-trace-core/src/main/java/datadog/trace/core/propagation/ptags/DatadogPTagsCodec.java b/dd-trace-core/src/main/java/datadog/trace/core/propagation/ptags/DatadogPTagsCodec.java index c1bcd4535a7..ec7a9a05feb 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/propagation/ptags/DatadogPTagsCodec.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/propagation/ptags/DatadogPTagsCodec.java @@ -63,6 +63,7 @@ PropagationTags fromHeaderValue(PTagsFactory tagsFactory, String value) { TagValue decisionMakerTagValue = null; TagValue traceIdTagValue = null; int traceSource = 0; + TagValue orgPropagationMarkerTagValue = null; while (tagPos < len) { int tagKeyEndsAt = validateCharsUntilSeparatorOrEnd( @@ -99,6 +100,8 @@ PropagationTags fromHeaderValue(PTagsFactory tagsFactory, String value) { traceIdTagValue = tagValue; } else if (tagKey.equals(TRACE_SOURCE_TAG)) { traceSource = ProductTraceSource.parseBitfieldHex(tagValue.toString()); + } else if (tagKey.equals(ORG_PROPAGATION_MARKER_TAG)) { + orgPropagationMarkerTagValue = tagValue; } else { if (tagPairs == null) { // This is roughly the size of a two element linked list but can hold six @@ -111,7 +114,12 @@ PropagationTags fromHeaderValue(PTagsFactory tagsFactory, String value) { } tagPos = tagValueEndsAt + 1; } - return tagsFactory.createValid(tagPairs, decisionMakerTagValue, traceIdTagValue, traceSource); + return tagsFactory.createValid( + tagPairs, + decisionMakerTagValue, + traceIdTagValue, + traceSource, + orgPropagationMarkerTagValue); } @Override diff --git a/dd-trace-core/src/main/java/datadog/trace/core/propagation/ptags/PTagsCodec.java b/dd-trace-core/src/main/java/datadog/trace/core/propagation/ptags/PTagsCodec.java index 9447cb5d021..e2c0658a1d2 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/propagation/ptags/PTagsCodec.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/propagation/ptags/PTagsCodec.java @@ -19,11 +19,16 @@ abstract class PTagsCodec { protected static final TagKey TRACE_SOURCE_TAG = TagKey.from("ts"); protected static final TagKey DEBUG_TAG = TagKey.from("debug"); protected static final TagKey KNUTH_SAMPLING_RATE_TAG = TagKey.from("ksr"); + protected static final TagKey ORG_PROPAGATION_MARKER_TAG = TagKey.from("opm"); protected static final String PROPAGATION_ERROR_MALFORMED_TID = "malformed_tid "; protected static final String PROPAGATION_ERROR_INCONSISTENT_TID = "inconsistent_tid "; protected static final TagKey UPSTREAM_SERVICES_DEPRECATED_TAG = TagKey.from("upstream_services"); static String headerValue(PTagsCodec codec, PTags ptags) { + return headerValue(codec, ptags, null); + } + + static String headerValue(PTagsCodec codec, PTags ptags, CharSequence lastParentIdOverride) { int estimate = codec.estimateHeaderSize(ptags); if (estimate == 0) { return ""; @@ -31,7 +36,7 @@ static String headerValue(PTagsCodec codec, PTags ptags) { // No encoding validation here because we don't allow arbitrary tag change StringBuilder sb = new StringBuilder(estimate); - int size = codec.appendPrefix(sb, ptags); + int size = codec.appendPrefix(sb, ptags, lastParentIdOverride); if (!ptags.isPropagationTagsDisabled()) { if (ptags.getDecisionMakerTagValue() != null) { size = codec.appendTag(sb, DECISION_MAKER_TAG, ptags.getDecisionMakerTagValue(), size); @@ -55,6 +60,11 @@ static String headerValue(PTagsCodec codec, PTags ptags) { codec.appendTag( sb, KNUTH_SAMPLING_RATE_TAG, ptags.getKnuthSamplingRateTagValue(), size); } + if (ptags.getOrgPropagationMarkerTagValue() != null) { + size = + codec.appendTag( + sb, ORG_PROPAGATION_MARKER_TAG, ptags.getOrgPropagationMarkerTagValue(), size); + } Iterator it = ptags.getTagPairs().iterator(); while (it.hasNext() && !codec.isTooLarge(sb, size)) { TagElement tagKey = it.next(); @@ -114,6 +124,11 @@ static void fillTagMap(PTags propagationTags, Map tagMap) { KNUTH_SAMPLING_RATE_TAG.forType(Encoding.DATADOG).toString(), propagationTags.getKnuthSamplingRateTagValue().forType(Encoding.DATADOG).toString()); } + if (propagationTags.getOrgPropagationMarkerTagValue() != null) { + tagMap.put( + ORG_PROPAGATION_MARKER_TAG.forType(Encoding.DATADOG).toString(), + propagationTags.getOrgPropagationMarkerTagValue().forType(Encoding.DATADOG).toString()); + } if (propagationTags.getTraceIdHighOrderBitsHexTagValue() != null) { tagMap.put( TRACE_ID_TAG.forType(Encoding.DATADOG).toString(), @@ -163,6 +178,14 @@ static int calcXDatadogTagsSize(int size, TagKey tagKey, TagValue tagValue) { protected abstract int appendPrefix(StringBuilder sb, PTags ptags); + /** + * Encode the prefix, using {@code lastParentIdOverride} for the W3C {@code p:} when non-null + * (inject-time). Codecs without a last-parent-id (e.g. Datadog) ignore the override. + */ + protected int appendPrefix(StringBuilder sb, PTags ptags, CharSequence lastParentIdOverride) { + return appendPrefix(sb, ptags); + } + protected abstract int appendTag(StringBuilder sb, TagElement key, TagElement value, int size); protected abstract int appendSuffix(StringBuilder sb, PTags ptags, int size); diff --git a/dd-trace-core/src/main/java/datadog/trace/core/propagation/ptags/PTagsFactory.java b/dd-trace-core/src/main/java/datadog/trace/core/propagation/ptags/PTagsFactory.java index bb544f926ac..0b5184d448a 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/propagation/ptags/PTagsFactory.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/propagation/ptags/PTagsFactory.java @@ -4,6 +4,7 @@ import static datadog.trace.core.propagation.PropagationTags.HeaderType.W3C; import static datadog.trace.core.propagation.ptags.PTagsCodec.DECISION_MAKER_TAG; import static datadog.trace.core.propagation.ptags.PTagsCodec.KNUTH_SAMPLING_RATE_TAG; +import static datadog.trace.core.propagation.ptags.PTagsCodec.ORG_PROPAGATION_MARKER_TAG; import static datadog.trace.core.propagation.ptags.PTagsCodec.TRACE_ID_TAG; import static datadog.trace.core.propagation.ptags.PTagsCodec.TRACE_SOURCE_TAG; @@ -49,7 +50,7 @@ PTagsCodec getDecoderEncoder(@Nonnull HeaderType headerType) { @Override public final PropagationTags empty() { - return createValid(null, null, null, ProductTraceSource.UNSET); + return createValid(null, null, null, ProductTraceSource.UNSET, null); } @Override @@ -57,12 +58,27 @@ public final PropagationTags fromHeaderValue(@Nonnull HeaderType headerType, Str return DEC_ENC_MAP.get(headerType).fromHeaderValue(this, value); } + @Override + public final PropagationTags emptyW3C(String originalTracestate) { + if (originalTracestate == null || originalTracestate.isEmpty()) { + return empty(); + } + return W3CPTagsCodec.empty(this, originalTracestate); + } + PropagationTags createValid( List tagPairs, TagValue decisionMakerTagValue, TagValue traceIdTagValue, - int productTraceSource) { - return new PTags(this, tagPairs, decisionMakerTagValue, traceIdTagValue, productTraceSource); + int productTraceSource, + TagValue orgPropagationMarkerTagValue) { + return new PTags( + this, + tagPairs, + decisionMakerTagValue, + traceIdTagValue, + productTraceSource, + orgPropagationMarkerTagValue); } PropagationTags createInvalid(String error) { @@ -94,6 +110,8 @@ static class PTags extends PropagationTags { private volatile double knuthSamplingRate = Double.NaN; private volatile TagValue knuthSamplingRateTagValue; + private volatile TagValue orgPropagationMarkerTagValue; + // Static cache for the most-recently-seen rate → TagValue. In steady state a service uses one // rate, so this eliminates the char[] + String allocation on every new PTags instance. // Writes are benign-racy: two threads computing the same rate produce equal TagValues. @@ -134,12 +152,13 @@ static class PTags extends PropagationTags { */ private volatile CharSequence lastParentId; - public PTags( + PTags( PTagsFactory factory, List tagPairs, TagValue decisionMakerTagValue, TagValue traceIdTagValue, - int traceSource) { + int traceSource, + TagValue orgPropagationMarkerTagValue) { this( factory, tagPairs, @@ -148,7 +167,8 @@ public PTags( traceSource, PrioritySampling.UNSET, null, - null); + null, + orgPropagationMarkerTagValue); } PTags( @@ -159,7 +179,8 @@ public PTags( int traceSource, int samplingPriority, CharSequence origin, - CharSequence lastParentId) { + CharSequence lastParentId, + TagValue orgPropagationMarkerTagValue) { assert tagPairs == null || tagPairs.size() % 2 == 0; this.factory = factory; this.tagPairs = tagPairs; @@ -169,6 +190,7 @@ public PTags( this.samplingPriority = samplingPriority; this.origin = origin; this.lastParentId = lastParentId; + this.orgPropagationMarkerTagValue = orgPropagationMarkerTagValue; if (traceIdTagValue != null) { CharSequence traceIdHighOrderBitsHex = traceIdTagValue.forType(TagElement.Encoding.DATADOG); this.traceIdHighOrderBits = @@ -189,6 +211,7 @@ static PTags withError(PTagsFactory factory, String error) { ProductTraceSource.UNSET, PrioritySampling.UNSET, null, + null, null); pTags.error = error; return pTags; @@ -335,6 +358,25 @@ TagValue getKnuthSamplingRateTagValue() { return knuthSamplingRateTagValue; } + @Override + public CharSequence getOrgPropagationMarker() { + return orgPropagationMarkerTagValue; + } + + @Override + public void updateOrgPropagationMarker(CharSequence opm) { + TagValue newValue = opm == null ? null : TagValue.from(opm); + if (!Objects.equals(this.orgPropagationMarkerTagValue, newValue)) { + clearCachedHeader(DATADOG); + clearCachedHeader(W3C); + this.orgPropagationMarkerTagValue = newValue; + } + } + + TagValue getOrgPropagationMarkerTagValue() { + return orgPropagationMarkerTagValue; + } + @Override public int getSamplingPriority() { return samplingPriority; @@ -378,14 +420,6 @@ public CharSequence getLastParentId() { return lastParentId; } - @Override - public void updateLastParentId(CharSequence lastParentId) { - if (!Objects.equals(this.lastParentId, lastParentId)) { - clearCachedHeader(W3C); - this.lastParentId = TagValue.from(lastParentId); - } - } - @Override @SuppressWarnings("StringEquality") @SuppressFBWarnings("ES_COMPARING_STRINGS_WITH_EQ") @@ -406,6 +440,18 @@ public String headerValue(HeaderType headerType) { return header; } + @Override + public String headerValue(HeaderType headerType, CharSequence lastParentIdOverride) { + if (lastParentIdOverride == null) { + return headerValue(headerType); + } + // Inject-time path: encode fresh with the override; do NOT cache — the W3C `p:` is + // per-injecting-span and these tags may be shared across sibling spans. + String header = + PTagsCodec.headerValue(factory.getDecoderEncoder(headerType), this, lastParentIdOverride); + return (header == null || header.isEmpty()) ? null : header; + } + @Override public void fillTagMap(Map tagMap) { PTagsCodec.fillTagMap(this, tagMap); @@ -463,6 +509,9 @@ int getXDatadogTagsSize() { size = PTagsCodec.calcXDatadogTagsSize( size, KNUTH_SAMPLING_RATE_TAG, getKnuthSamplingRateTagValue()); + size = + PTagsCodec.calcXDatadogTagsSize( + size, ORG_PROPAGATION_MARKER_TAG, getOrgPropagationMarkerTagValue()); int currentProductTraceSource = traceSource; if (currentProductTraceSource != ProductTraceSource.UNSET) { size = diff --git a/dd-trace-core/src/main/java/datadog/trace/core/propagation/ptags/W3CPTagsCodec.java b/dd-trace-core/src/main/java/datadog/trace/core/propagation/ptags/W3CPTagsCodec.java index 8fe534ccfd4..0430bbc3a2c 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/propagation/ptags/W3CPTagsCodec.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/propagation/ptags/W3CPTagsCodec.java @@ -4,6 +4,7 @@ import datadog.logging.RatelimitedLogger; import datadog.trace.api.ProductTraceSource; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.api.sampling.PrioritySampling; import datadog.trace.core.propagation.PropagationTags; import datadog.trace.core.propagation.ptags.PTagsFactory.PTags; @@ -26,7 +27,7 @@ public class W3CPTagsCodec extends PTagsCodec { private static final char KEY_VALUE_SEPARATOR = ':'; private static final int MIN_ALLOWED_CHAR = 32; private static final int MAX_ALLOWED_CHAR = 126; - private static final int MAX_MEMBER_COUNT = 32; + @VisibleForTesting public static final int MAX_MEMBER_COUNT = 32; @Override PropagationTags fromHeaderValue(PTagsFactory tagsFactory, String value) { @@ -97,6 +98,7 @@ PropagationTags fromHeaderValue(PTagsFactory tagsFactory, String value) { int traceSource = ProductTraceSource.UNSET; int maxUnknownSize = 0; CharSequence lastParentId = null; + TagValue orgPropagationMarkerTagValue = null; while (tagPos < ddMemberValueEnd) { int tagKeyEndsAt = validateCharsUntilSeparatorOrEnd( @@ -159,6 +161,8 @@ PropagationTags fromHeaderValue(PTagsFactory tagsFactory, String value) { traceIdTagValue = tagValue; } else if (tagKey.equals(TRACE_SOURCE_TAG)) { traceSource = ProductTraceSource.parseBitfieldHex(tagValue.toString()); + } else if (tagKey.equals(ORG_PROPAGATION_MARKER_TAG)) { + orgPropagationMarkerTagValue = tagValue; } else { if (tagPairs == null) { // This is roughly the size of a two element linked list but can hold six @@ -191,7 +195,8 @@ PropagationTags fromHeaderValue(PTagsFactory tagsFactory, String value) { ddMemberStart, ddMemberValueEnd, maxUnknownSize, - lastParentId); + lastParentId, + orgPropagationMarkerTagValue); } @Override @@ -221,6 +226,11 @@ protected int estimateHeaderSize(PTags pTags) { @Override protected int appendPrefix(StringBuilder sb, PTags ptags) { + return appendPrefix(sb, ptags, null); + } + + @Override + protected int appendPrefix(StringBuilder sb, PTags ptags, CharSequence lastParentIdOverride) { sb.append(DATADOG_MEMBER_KEY); // Append sampling priority (s) if (ptags.getSamplingPriority() != PrioritySampling.UNSET) { @@ -241,7 +251,8 @@ protected int appendPrefix(StringBuilder sb, PTags ptags) { } } // append last ParentId (p) - CharSequence lastParent = ptags.getLastParentId(); + CharSequence lastParent = + lastParentIdOverride != null ? lastParentIdOverride : ptags.getLastParentId(); if (lastParent != null) { if (sb.length() > EMPTY_SIZE) { sb.append(';'); @@ -693,7 +704,7 @@ private static int cleanUpAndAppendSuffix(StringBuilder sb, PTags ptags, int siz return size; } - private static W3CPTags empty(PTagsFactory factory, String original) { + static W3CPTags empty(PTagsFactory factory, String original) { return empty(factory, original, 0, -1, -1); } @@ -716,6 +727,7 @@ private static W3CPTags empty( ddMemberStart, ddMemberValueEnd, 0, + null, null); } @@ -750,7 +762,8 @@ public W3CPTags( int ddMemberStart, int ddMemberValueEnd, int maxUnknownSize, - CharSequence lastParentId) { + CharSequence lastParentId, + TagValue orgPropagationMarkerTagValue) { super( factory, tagPairs, @@ -759,7 +772,8 @@ public W3CPTags( traceSource, samplingPriority, origin, - lastParentId); + lastParentId, + orgPropagationMarkerTagValue); this.tracestate = original; this.firstMemberStart = firstMemberStart; this.ddMemberStart = ddMemberStart; diff --git a/dd-trace-core/src/main/java/datadog/trace/core/scopemanager/ContinuableScope.java b/dd-trace-core/src/main/java/datadog/trace/core/scopemanager/ContinuableScope.java index d4e7e332586..ba7e5288a68 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/scopemanager/ContinuableScope.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/scopemanager/ContinuableScope.java @@ -170,7 +170,7 @@ public final void beforeActivated() { return; } try { - scopeState.activate(span.context()); + scopeState.activate(span.spanContext()); } catch (Throwable e) { ContinuableScopeManager.ratelimitedLog.warn( "ScopeState {} threw exception in beforeActivated()", scopeState.getClass(), e); diff --git a/dd-trace-core/src/main/java/datadog/trace/core/scopemanager/ContinuableScopeManager.java b/dd-trace-core/src/main/java/datadog/trace/core/scopemanager/ContinuableScopeManager.java index 5d997f87b39..399ac55e528 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/scopemanager/ContinuableScopeManager.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/scopemanager/ContinuableScopeManager.java @@ -13,7 +13,7 @@ import static java.util.concurrent.TimeUnit.SECONDS; import datadog.context.Context; -import datadog.context.ContextManager; +import datadog.context.ContextContinuation; import datadog.context.ContextScope; import datadog.logging.RatelimitedLogger; import datadog.trace.api.Config; @@ -24,10 +24,12 @@ import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentTraceCollector; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import datadog.trace.bootstrap.instrumentation.api.NoopContinuation; import datadog.trace.bootstrap.instrumentation.api.ProfilerContext; import datadog.trace.bootstrap.instrumentation.api.ProfilingContextIntegration; import datadog.trace.core.monitor.HealthMetrics; import datadog.trace.util.AgentTaskScheduler; +import edu.umd.cs.findbugs.annotations.NonNull; import java.util.Iterator; import java.util.List; import java.util.Map; @@ -44,10 +46,13 @@ * from being reported even if all related spans are finished. It also delegates to other * ScopeInterceptors to provide additional functionality. */ -public final class ContinuableScopeManager implements ContextManager { +public final class ContinuableScopeManager { static final Logger log = LoggerFactory.getLogger(ContinuableScopeManager.class); static final RatelimitedLogger ratelimitedLog = new RatelimitedLogger(log, 1, MINUTES); + + private static final NoopContinuation ROOT_CONTINUATION = NoopContinuation.INSTANCE; + static final long iterationKeepAlive = SECONDS.toMillis(Config.get().getScopeIterationKeepAlive()); volatile ConcurrentMap rootIterationScopes; @@ -92,8 +97,6 @@ public ContinuableScopeManager( this.profilingContextIntegration = profilingContextIntegration; this.profilingEnabled = !(profilingContextIntegration instanceof ProfilingContextIntegration.NoOp); - - ContextManager.register(this); } public AgentScope activateSpan(final AgentSpan span) { @@ -104,6 +107,7 @@ public AgentScope activateManualSpan(final AgentSpan span) { return activate(span, MANUAL, false, /* ignored */ false); } + @SuppressWarnings("deprecation") public AgentScope.Continuation captureActiveSpan() { ContinuableScope activeScope = scopeStack().active(); if (null != activeScope && activeScope.isAsyncPropagating()) { @@ -112,17 +116,18 @@ public AgentScope.Continuation captureActiveSpan() { return captureSpan(activeScope.context, activeScope.source(), span); } } - return AgentTracer.noopContinuation(); + return ROOT_CONTINUATION; } - public AgentScope.Continuation captureSpan(final AgentSpan span) { + public ContextContinuation captureSpan(final AgentSpan span) { ContinuableScope top = scopeStack().top; Context context = top != null ? top.context.with(span) : span; return captureSpan(context, INSTRUMENTATION, span); } + @SuppressWarnings("deprecation") private AgentScope.Continuation captureSpan(Context context, byte source, AgentSpan span) { - AgentTraceCollector traceCollector = span.context().getTraceCollector(); + AgentTraceCollector traceCollector = span.spanContext().getTraceCollector(); return new ScopeContinuation(this, context, source, traceCollector).register(); } @@ -357,8 +362,8 @@ private Stateful createScopeState(Context context) { // to encapsulate other scope lifecycle activities // FIXME DDSpanContext is always a ProfilerContext anyway... AgentSpan span = AgentSpan.fromContext(context); - if (span != null && span.context() instanceof ProfilerContext) { - return profilingContextIntegration.newScopeState((ProfilerContext) span.context()); + if (span != null && span.spanContext() instanceof ProfilerContext) { + return profilingContextIntegration.newScopeState((ProfilerContext) span.spanContext()); } return Stateful.DEFAULT; } @@ -367,19 +372,16 @@ ScopeStack scopeStack() { return this.tlsScopeStack.get(); } - @Override - public Context current() { + public Context currentContext() { final ContinuableScope active = scopeStack().active(); return active == null ? Context.root() : active.context; } - @Override - public ContextScope attach(Context context) { + public ContextScope attach(@NonNull Context context) { return activate(context); } - @Override - public Context swap(Context context) { + public Context swap(@NonNull Context context) { ScopeStack oldStack = tlsScopeStack.get(); ContinuableScope oldScope = oldStack.top; @@ -409,6 +411,28 @@ public Context swap(Context context) { return new ScopeContext(oldStack); } + public ContextContinuation capture(@NonNull Context context) { + if (context == Context.root()) { + return ROOT_CONTINUATION; + } + + // respect async propagation flag for Context.current().capture() + ContinuableScope activeScope = scopeStack().active(); + if (activeScope != null + && !activeScope.isAsyncPropagating() + && activeScope.context == context) { + return ROOT_CONTINUATION; + } + AgentSpan span = AgentSpan.fromContext(context); + AgentTraceCollector traceCollector; + if (span != null) { + traceCollector = span.spanContext().getTraceCollector(); + } else { + traceCollector = AgentTracer.NoopAgentTraceCollector.INSTANCE; + } + return new ScopeContinuation(this, context, CONTEXT, traceCollector).register(); + } + static final class ScopeStackThreadLocal extends ThreadLocal { private final ProfilingContextIntegration profilingContextIntegration; diff --git a/dd-trace-core/src/main/java/datadog/trace/core/scopemanager/ScopeContinuation.java b/dd-trace-core/src/main/java/datadog/trace/core/scopemanager/ScopeContinuation.java index 364f1ac402b..be30cdd2150 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/scopemanager/ScopeContinuation.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/scopemanager/ScopeContinuation.java @@ -3,19 +3,20 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopScope; import datadog.context.Context; +import datadog.context.ContextScope; import datadog.trace.bootstrap.instrumentation.api.AgentScope; -import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentTraceCollector; import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; /** * Used to pass async context between workers. A trace will not be reported until all spans and - * continuations are resolved. You must call activate (and close on the returned scope) or cancel on + * continuations are resolved. You must call resume (and close on the returned scope) or release on * each continuation to avoid discarding traces. * *

      This class must not be a nested class of ContinuableScope to avoid an unconstrained chain of * references (using too much memory). */ +@SuppressWarnings("deprecation") final class ScopeContinuation implements AgentScope.Continuation { private static final AtomicIntegerFieldUpdater COUNT = AtomicIntegerFieldUpdater.newUpdater(ScopeContinuation.class, "count"); @@ -45,8 +46,8 @@ final class ScopeContinuation implements AgentScope.Continuation { * *

      A negative value of CANCELLED reflects that the continuation has either been activated and * all associated scopes are now closed, or it has been explicitly cancelled. This value was - * chosen to be half the size of MIN_INT to avoid speculative additions in {@link #activate()} - * from overflowing to a positive count. + * chosen to be half the size of MIN_INT to avoid speculative additions in {@link #resume()} from + * overflowing to a positive count. */ private volatile int count = 0; @@ -68,14 +69,14 @@ ScopeContinuation register() { } @Override - public AgentScope.Continuation hold() { + public ScopeContinuation hold() { // update initial count to record that this continuation has a hold COUNT.compareAndSet(this, 0, HELD); return this; } @Override - public AgentScope activate() { + public ContextScope resume() { if (COUNT.incrementAndGet(this) > 0) { // speculative update succeeded, continuation can be activated return scopeManager.continueSpan(this, context, source); @@ -87,7 +88,12 @@ public AgentScope activate() { } @Override - public void cancel() { + public Context context() { + return context; + } + + @Override + public void release() { int current = count; while (current >= HELD) { // remove the hold on this continuation by removing the offset @@ -113,18 +119,18 @@ void cancelFromContinuedScopeClose() { scopeManager.healthMetrics.onFinishContinuation(); } else if (COUNT.decrementAndGet(this) == 0) { // slow path: multiple activations, all have now closed (no hold) - cancel(); + release(); } /* else there are outstanding activations or hold is in place */ } @Override - public AgentSpan span() { - return AgentSpan.fromContext(context); + public AgentScope activate() { + return (AgentScope) resume(); } @Override - public Context context() { - return context; + public void cancel() { + release(); } @Override diff --git a/dd-trace-core/src/main/java/datadog/trace/core/servicediscovery/ServiceDiscovery.java b/dd-trace-core/src/main/java/datadog/trace/core/servicediscovery/ServiceDiscovery.java index a121c7543c1..7b2c4c1737f 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/servicediscovery/ServiceDiscovery.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/servicediscovery/ServiceDiscovery.java @@ -43,7 +43,7 @@ public void writeTracerMetadata(Config config) { } } - private static String generateFileName() { + static String generateFileName() { String suffix = RandomUtils.randomUUID().toString().substring(0, 8); return "datadog-tracer-info-" + suffix; } diff --git a/dd-trace-core/src/main/java/datadog/trace/core/taginterceptor/TagInterceptor.java b/dd-trace-core/src/main/java/datadog/trace/core/taginterceptor/TagInterceptor.java index 18a88fd7b4a..d81a9cc8441 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/taginterceptor/TagInterceptor.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/taginterceptor/TagInterceptor.java @@ -5,7 +5,6 @@ import static datadog.trace.api.DDTags.ORIGIN_KEY; import static datadog.trace.api.DDTags.SPAN_TYPE; import static datadog.trace.api.sampling.PrioritySampling.USER_DROP; -import static datadog.trace.api.sampling.PrioritySampling.USER_KEEP; import static datadog.trace.bootstrap.instrumentation.api.InstrumentationTags.SERVLET_CONTEXT; import static datadog.trace.bootstrap.instrumentation.api.ServiceNameSources.SPLIT_BY_SERVLET_CONTEXT; import static datadog.trace.bootstrap.instrumentation.api.ServiceNameSources.SPLIT_BY_TAGS; @@ -298,8 +297,7 @@ private boolean interceptSpanType(DDSpanContext span, Object value) { return true; } - private boolean interceptServiceName( - RuleFlags.Feature feature, DDSpanContext span, Object value) { + boolean interceptServiceName(RuleFlags.Feature feature, DDSpanContext span, Object value) { if (ruleFlags.isEnabled(feature)) { String serviceName = String.valueOf(value); span.setServiceName(serviceName); @@ -328,15 +326,18 @@ private boolean interceptSamplingPriority(DDSpanContext span, Object value) { if (ruleFlags.isEnabled(FORCE_SAMPLING_PRIORITY)) { Number samplingPriority = getOrTryParse(value); if (null != samplingPriority) { - span.setSamplingPriority( - samplingPriority.intValue() > 0 ? USER_KEEP : USER_DROP, SamplingMechanism.MANUAL); + if (samplingPriority.intValue() > 0) { + span.forceKeep(SamplingMechanism.MANUAL); + } else { + span.setSamplingPriority(USER_DROP, SamplingMechanism.MANUAL); + } } return true; } return false; } - private boolean interceptServletContext(DDSpanContext span, Object value) { + boolean interceptServletContext(DDSpanContext span, Object value) { // even though this tag is sometimes used to set the service name // (which has the side effect of marking the span as eligible for metrics // in the trace agent) we also want to store it in the tags no matter what, diff --git a/dd-trace-core/src/main/java/datadog/trace/core/tagprocessor/HttpEndpointPostProcessor.java b/dd-trace-core/src/main/java/datadog/trace/core/tagprocessor/HttpEndpointPostProcessor.java index 340a5d82649..c2e0dd72761 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/tagprocessor/HttpEndpointPostProcessor.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/tagprocessor/HttpEndpointPostProcessor.java @@ -6,6 +6,7 @@ import datadog.trace.api.TagMap; import datadog.trace.api.endpoint.EndpointResolver; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.bootstrap.instrumentation.api.AppendableSpanLinks; import datadog.trace.core.DDSpanContext; import org.slf4j.Logger; @@ -45,10 +46,9 @@ public HttpEndpointPostProcessor() { /** * Creates a new HttpEndpointPostProcessor with the given endpoint resolver. * - *

      Visible for testing. - * * @param endpointResolver the resolver to use for endpoint inference */ + @VisibleForTesting HttpEndpointPostProcessor(EndpointResolver endpointResolver) { this.endpointResolver = endpointResolver; } diff --git a/dd-trace-core/src/main/java/datadog/trace/core/tagprocessor/InternalTagsAdder.java b/dd-trace-core/src/main/java/datadog/trace/core/tagprocessor/InternalTagsAdder.java index 68b13d19faf..3e6b8b13192 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/tagprocessor/InternalTagsAdder.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/tagprocessor/InternalTagsAdder.java @@ -7,32 +7,42 @@ import datadog.trace.bootstrap.instrumentation.api.AppendableSpanLinks; import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; import datadog.trace.core.DDSpanContext; +import javax.annotation.Nonnull; import javax.annotation.Nullable; public final class InternalTagsAdder extends TagsPostProcessor { private final UTF8BytesString ddService; - private final UTF8BytesString version; - public InternalTagsAdder(@Nullable final String ddService, @Nullable final String version) { - this.ddService = ddService != null ? UTF8BytesString.create(ddService) : null; - this.version = version != null && !version.isEmpty() ? UTF8BytesString.create(version) : null; + // Prebuilt once to avoid per-span Entry allocation. + private final TagMap.Entry baseServiceEntry; + @Nullable private final TagMap.Entry versionEntry; + + public InternalTagsAdder(@Nonnull final String ddService, @Nullable final String version) { + this.ddService = UTF8BytesString.create(ddService); + this.baseServiceEntry = TagMap.Entry.create(DDTags.BASE_SERVICE, this.ddService); + this.versionEntry = + version != null && !version.isEmpty() + ? TagMap.Entry.create(VERSION, UTF8BytesString.create(version)) + : null; } @Override public void processTags( TagMap unsafeTags, DDSpanContext spanContext, AppendableSpanLinks spanLinks) { - if (spanContext == null || ddService == null) { + if (spanContext == null) { return; } if (!ddService.toString().equalsIgnoreCase(spanContext.getServiceName())) { - // service name != DD_SERVICE - unsafeTags.set(DDTags.BASE_SERVICE, ddService); + if (baseServiceEntry != null) { + // service name != DD_SERVICE + unsafeTags.set(baseServiceEntry); + } } else { // as per config consistency, the version tag is added across tracers only if // the service name is DD_SERVICE and version tag is not manually set - if (version != null && !unsafeTags.containsKey(VERSION)) { - unsafeTags.set(VERSION, version); + if (versionEntry != null && !unsafeTags.containsKey(VERSION)) { + unsafeTags.set(versionEntry); } } } diff --git a/dd-trace-core/src/main/java/datadog/trace/core/tagprocessor/PeerServiceCalculator.java b/dd-trace-core/src/main/java/datadog/trace/core/tagprocessor/PeerServiceCalculator.java index ed1fee8b2d6..198e2c78f1c 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/tagprocessor/PeerServiceCalculator.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/tagprocessor/PeerServiceCalculator.java @@ -3,6 +3,7 @@ import datadog.trace.api.Config; import datadog.trace.api.DDTags; import datadog.trace.api.TagMap; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.api.naming.NamingSchema; import datadog.trace.api.naming.SpanNaming; import datadog.trace.bootstrap.instrumentation.api.AppendableSpanLinks; @@ -22,7 +23,7 @@ public PeerServiceCalculator() { this(SpanNaming.instance().namingSchema().peerService(), Config.get().getPeerServiceMapping()); } - // Visible for testing + @VisibleForTesting PeerServiceCalculator( @Nonnull final NamingSchema.ForPeerService peerServiceNaming, @Nonnull final Map peerServiceMapping) { diff --git a/dd-trace-core/src/main/java/datadog/trace/core/tagprocessor/QueryObfuscator.java b/dd-trace-core/src/main/java/datadog/trace/core/tagprocessor/QueryObfuscator.java index a1594e33eb6..2c99c50244b 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/tagprocessor/QueryObfuscator.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/tagprocessor/QueryObfuscator.java @@ -8,7 +8,6 @@ import datadog.trace.bootstrap.instrumentation.api.AppendableSpanLinks; import datadog.trace.bootstrap.instrumentation.api.Tags; import datadog.trace.core.DDSpanContext; -import datadog.trace.util.Strings; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -47,13 +46,20 @@ public QueryObfuscator(String regex) { } private String obfuscate(String query) { - if (pattern != null) { - Matcher matcher = pattern.matcher(query); - while (matcher.find()) { - query = Strings.replace(query, matcher.group(), ""); - } + if (pattern == null) { + return query; + } + final Matcher matcher = pattern.matcher(query); + if (!matcher.find()) { + return query; } - return query; + // TODO consider an upstream length cap too + final StringBuffer sb = new StringBuffer(query.length()); + do { + matcher.appendReplacement(sb, ""); + } while (matcher.find()); + matcher.appendTail(sb); + return sb.toString(); } @Override diff --git a/dd-trace-core/src/main/java/datadog/trace/core/util/GlobPattern.java b/dd-trace-core/src/main/java/datadog/trace/core/util/GlobPattern.java index 2b46a2181d4..7049f958b7a 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/util/GlobPattern.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/util/GlobPattern.java @@ -9,7 +9,7 @@ public static Pattern globToRegexPattern(String globPattern) { return Pattern.compile(regex, Pattern.CASE_INSENSITIVE); } - private static String globToRegex(String globPattern) { + static String globToRegex(String globPattern) { StringBuilder sb = new StringBuilder(64); sb.append('^'); for (int i = 0; i < globPattern.length(); i++) { diff --git a/dd-trace-core/src/main/java/datadog/trace/core/util/StackTraces.java b/dd-trace-core/src/main/java/datadog/trace/core/util/StackTraces.java index 3c6a00e599b..c39d3fba63b 100644 --- a/dd-trace-core/src/main/java/datadog/trace/core/util/StackTraces.java +++ b/dd-trace-core/src/main/java/datadog/trace/core/util/StackTraces.java @@ -5,6 +5,7 @@ import java.io.StringReader; import java.io.StringWriter; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -13,10 +14,66 @@ public final class StackTraces { private StackTraces() {} + /** + * Safely retrieves the message from a throwable. + * + *

      Third-party exception classes occasionally use formatting utilities (e.g. {@code + * java.text.MessageFormat}) inside {@code getMessage()}, which can throw when the pattern + * contains non-integer placeholders. + * + * @param t the throwable to retrieve the message from + * @return {@code null} if {@code t} is {@code null}; the result of {@link Throwable#getMessage()} + * on success; or a diagnostic string of the form {@code "(Exception message unavailable for + * ClassName: getMessage() threw ExceptionType)"} if {@code getMessage()} throws + */ + public static String safeGetMessage(Throwable t) { + if (t == null) { + return null; + } + try { + return t.getMessage(); + } catch (Exception e) { + return "(Exception message unavailable for " + + t.getClass().getSimpleName() + + ": getMessage() threw " + + e.getClass().getSimpleName() + + ")"; + } + } + + /** + * Returns the stack trace of {@code t} as a string, truncated to {@code maxChars} characters. + * + *

      Uses {@link Throwable#printStackTrace(java.io.PrintWriter)} to produce the full trace + * including {@code Caused by} and {@code Suppressed} chains. If {@code printStackTrace} itself + * throws (e.g. because {@link Throwable#getMessage()} throws inside {@code toString()}), falls + * back to reconstructing the trace from {@link Throwable#getStackTrace()} so the call site + * remains locatable. + * + * @param t the throwable to format + * @param maxChars maximum length of the returned string + * @return the stack trace string, truncated if necessary + */ public static String getStackTrace(Throwable t, int maxChars) { - StringWriter sw = new StringWriter(); - t.printStackTrace(new PrintWriter(sw)); - String trace = sw.toString(); + String trace; + try { + StringWriter sw = new StringWriter(); + t.printStackTrace(new PrintWriter(sw)); + trace = sw.toString(); + } catch (Exception ignored) { + // printStackTrace() failed (e.g. getMessage() throws inside toString()). + // Reconstruct from getStackTrace() so the call site is still locatable. + try { + trace = + t.getClass().getName() + + System.lineSeparator() + + Arrays.stream(t.getStackTrace()) + .map(f -> "\tat " + f) + .collect(Collectors.joining(System.lineSeparator())); + } catch (Exception ignored2) { + trace = t.getClass().getName(); + } + } try { return truncate(trace, maxChars); } catch (Exception e) { @@ -43,6 +100,9 @@ static String truncate(String trace, int maxChars) { /* last-ditch centre cut to guarantee the limit */ String cutMessage = "\t... trace centre-cut to " + maxChars + " chars ..."; int retainedLength = maxChars - cutMessage.length() - 2; // 2 for the newlines + if (retainedLength <= 0) { + return cutMessage + System.lineSeparator(); + } int half = retainedLength / 2; return trace.substring(0, half) + System.lineSeparator() diff --git a/dd-trace-core/src/main/java/datadog/trace/lambda/LambdaAppSecHandler.java b/dd-trace-core/src/main/java/datadog/trace/lambda/LambdaAppSecHandler.java index 32bfa7fad6e..c67a316b659 100644 --- a/dd-trace-core/src/main/java/datadog/trace/lambda/LambdaAppSecHandler.java +++ b/dd-trace-core/src/main/java/datadog/trace/lambda/LambdaAppSecHandler.java @@ -6,8 +6,11 @@ import com.squareup.moshi.Moshi; import datadog.logging.RatelimitedLogger; import datadog.trace.api.Config; +import datadog.trace.api.ProductTraceSource; +import datadog.trace.api.appsec.AppSecContext; import datadog.trace.api.function.TriConsumer; import datadog.trace.api.gateway.BlockResponseFunction; +import datadog.trace.api.gateway.CallbackProvider; import datadog.trace.api.gateway.Flow; import datadog.trace.api.gateway.IGSpanInfo; import datadog.trace.api.gateway.RequestContext; @@ -19,19 +22,26 @@ import datadog.trace.bootstrap.instrumentation.api.AgentTracer; import datadog.trace.bootstrap.instrumentation.api.ClientIpAddressData; import datadog.trace.bootstrap.instrumentation.api.TagContext; +import datadog.trace.bootstrap.instrumentation.api.Tags; import datadog.trace.bootstrap.instrumentation.api.URIDataAdapter; import datadog.trace.bootstrap.instrumentation.api.URIDataAdapterBase; import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; import java.io.IOException; +import java.net.URLEncoder; import java.nio.charset.StandardCharsets; +import java.util.ArrayList; import java.util.Base64; import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.function.BiFunction; import java.util.function.Function; import java.util.function.Supplier; +import java.util.stream.Collectors; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -50,6 +60,10 @@ public class LambdaAppSecHandler { private static final int MAX_EVENT_SIZE = Config.get().getAppSecBodyParsingSizeLimit(); + // Carries the detected trigger type from processRequestStart to processResponseData within the + // same Lambda invocation. Cleared in processRequestEnd. + private static final ThreadLocal CURRENT_TRIGGER_TYPE = new ThreadLocal<>(); + /** * Process AppSec request data at the start of a Lambda invocation. Extract event data and invokes * all relevant AppSec gateway callbacks. @@ -64,6 +78,8 @@ public static AgentSpanContext processRequestStart(Object event) { return null; } + CURRENT_TRIGGER_TYPE.set(LambdaTriggerType.UNKNOWN); + if (!(event instanceof ByteArrayInputStream)) { log.debug( "Event is not a ByteArrayInputStream, type: {}", @@ -76,6 +92,7 @@ public static AgentSpanContext processRequestStart(Object event) { if (eventData == LambdaEventData.EMPTY) { return null; } + CURRENT_TRIGGER_TYPE.set(eventData.triggerType); return processAppSecRequestData(eventData); } catch (Exception e) { log.debug("Failed to process AppSec request data", e); @@ -89,6 +106,8 @@ public static AgentSpanContext processRequestStart(Object event) { * @param span the current span */ public static void processRequestEnd(AgentSpan span) { + CURRENT_TRIGGER_TYPE.remove(); + if (!ActiveSubsystems.APPSEC_ACTIVE || span == null) { return; } @@ -103,6 +122,205 @@ public static void processRequestEnd(AgentSpan span) { } else { log.debug("requestEnded callback is null"); } + + // In Lambda, the WAF runs in processRequestStart before the span exists. + // GatewayBridge propagates ASM_KEEP based on WAF attack events, but not on + // isManuallyKept(), which is set by trace-tagging rules that produce no events. + // Apply it here so those traces are not silently dropped. + Object rawAppSecCtx = requestContext.getData(RequestContextSlot.APPSEC); + AppSecContext appSecCtx = + rawAppSecCtx instanceof AppSecContext ? (AppSecContext) rawAppSecCtx : null; + if (appSecCtx != null && appSecCtx.isManuallyKept()) { + TraceSegment traceSeg = requestContext.getTraceSegment(); + traceSeg.setTagTop(Tags.ASM_KEEP, true); + traceSeg.setTagTop(Tags.PROPAGATED_TRACE_SOURCE, ProductTraceSource.ASM); + } + } + } + + /** + * Process response data through WAF before the request context is closed. Extracts status code, + * headers, and body from the Lambda response and fires the corresponding gateway events. + * + * @param span the current span + * @param result the Lambda handler result (expected to be a ByteArrayOutputStream) + */ + public static void processResponseData(AgentSpan span, Object result) { + if (!ActiveSubsystems.APPSEC_ACTIVE + || span == null + || !(result instanceof ByteArrayOutputStream)) { + return; + } + + try { + byte[] bytes = ((ByteArrayOutputStream) result).toByteArray(); + if (bytes.length == 0 || bytes.length > MAX_EVENT_SIZE) { + log.debug( + "Response size {} exceeds limit {} or is empty, skipping response processing", + bytes.length, + MAX_EVENT_SIZE); + return; + } + + String json = new String(bytes, StandardCharsets.UTF_8); + LambdaResponseData responseData = extractResponseData(json); + + // Only process responses for known HTTP trigger types + LambdaTriggerType triggerType = CURRENT_TRIGGER_TYPE.get(); + if (triggerType == null || !triggerType.isHttp()) { + return; + } + + if (responseData == null || responseData.statusCode == 0) { + // No statusCode means this is not an API-GW formatted response, or JSON parsing failed. + if (responseData == null || (responseData.headers.isEmpty() && responseData.body == null)) { + // Parse failed or response has no API-GW structure (plain JSON body). + // Treat the full response as the body + Object fallbackBody; + String fallbackContentType; + try { + fallbackBody = OBJECT_ADAPTER.fromJson(json); + fallbackContentType = "application/json"; + } catch (Exception e) { + fallbackBody = json; + fallbackContentType = "text/plain"; + } + Map fallbackHeaders = + Collections.singletonMap("content-type", fallbackContentType); + responseData = new LambdaResponseData(0, fallbackHeaders, fallbackBody); + } + // else: responseData has explicit headers/body fields — keep them, just skip + // responseStarted + // (statusCode remains 0, so the responseStarted guard below will not fire). + } + + RequestContext requestContext = span.getRequestContext(); + if (requestContext == null) { + log.debug("Span has no RequestContext, skipping response processing"); + return; + } + + AgentTracer.TracerAPI tracer = AgentTracer.get(); + CallbackProvider cbp = tracer.getCallbackProvider(RequestContextSlot.APPSEC); + + // Fire response gateway events. Flow results are intentionally ignored: blocking on response + // is not supported for Lambda because remote config is unavailable in that environment. + + // Fire responseStarted + if (responseData.statusCode > 0) { + BiFunction> responseStartedCb = + cbp.getCallback(EVENTS.responseStarted()); + if (responseStartedCb != null) { + responseStartedCb.apply(requestContext, responseData.statusCode); + } + } + + // Fire responseHeader for each allowed header + if (responseData.headers != null && !responseData.headers.isEmpty()) { + TriConsumer responseHeaderCb = + cbp.getCallback(EVENTS.responseHeader()); + if (responseHeaderCb != null) { + for (Map.Entry header : responseData.headers.entrySet()) { + responseHeaderCb.accept(requestContext, header.getKey(), header.getValue()); + } + } + } + + // Fire responseHeaderDone + Function> responseHeaderDoneCb = + cbp.getCallback(EVENTS.responseHeaderDone()); + if (responseHeaderDoneCb != null) { + responseHeaderDoneCb.apply(requestContext); + } + + // Fire responseBody + if (responseData.body != null) { + BiFunction> responseBodyCb = + cbp.getCallback(EVENTS.responseBody()); + if (responseBodyCb != null) { + responseBodyCb.apply(requestContext, responseData.body); + } + } + } catch (Exception e) { + log.debug("Failed to process AppSec response data", e); + } + } + + static LambdaResponseData extractResponseData(String json) { + try { + Map response = MAP_ADAPTER.fromJson(json); + if (response == null) { + return null; + } + + // Extract status code + int statusCode = 0; + Object statusCodeObj = response.get("statusCode"); + if (statusCodeObj instanceof Number) { + statusCode = ((Number) statusCodeObj).intValue(); + } + + // Extract headers — keys are lowercased to normalise casing across API GW / ALB variants + Map headers = new HashMap<>(); + Map rawHeaders = extractStringMap(response.get("headers")); + for (Map.Entry entry : rawHeaders.entrySet()) { + headers.put(entry.getKey().toLowerCase(Locale.ROOT), entry.getValue()); + } + + // Merge multiValueHeaders if present (API GW v1 / ALB), also lowercasing keys + Object multiValueHeadersObj = response.get("multiValueHeaders"); + if (multiValueHeadersObj instanceof Map) { + Map multiValueHeaders = (Map) multiValueHeadersObj; + for (Map.Entry entry : multiValueHeaders.entrySet()) { + if (entry.getKey() != null && entry.getValue() instanceof List) { + String key = String.valueOf(entry.getKey()).toLowerCase(Locale.ROOT); + List values = (List) entry.getValue(); + String joinedValue = + values.stream().map(String::valueOf).collect(Collectors.joining(", ")); + headers.put(key, joinedValue); + } + } + } + + // Extract body + Object body = null; + Object bodyObj = response.get("body"); + if (bodyObj != null) { + String bodyString = String.valueOf(bodyObj); + + // Handle base64 encoding + Object isBase64EncodedObj = response.get("isBase64Encoded"); + if (Boolean.TRUE.equals(isBase64EncodedObj) || "true".equals(isBase64EncodedObj)) { + try { + bodyString = new String(Base64.getDecoder().decode(bodyString), StandardCharsets.UTF_8); + } catch (Exception e) { + log.debug("Failed to decode base64 response body", e); + bodyString = null; + } + } + + if (bodyString != null) { + String contentType = headers.get("content-type"); + + // If JSON content-type or unknown, attempt JSON parsing + // Normalise casing: media type tokens are case-insensitive per RFC 7231 + String contentTypeLower = + contentType == null ? null : contentType.toLowerCase(Locale.ROOT); + if (contentTypeLower == null + || contentTypeLower.contains("json") + || contentTypeLower.contains("javascript")) { + Object parsed = parseBodyAsJson(bodyString); + body = parsed != null ? parsed : bodyString; + } else { + body = bodyString; + } + } + } + + return new LambdaResponseData(statusCode, headers, body); + } catch (Exception e) { + log.debug("Failed to parse response data from JSON", e); + return null; } } @@ -459,20 +677,18 @@ private static LambdaEventData extractAlbData( if (triggerType == LambdaTriggerType.ALB_MULTI_VALUE) { // Handle multi-value headers (combine multiple values with comma) - headers = new java.util.HashMap<>(); + headers = new HashMap<>(); Object multiValueHeadersObj = event.get("multiValueHeaders"); if (multiValueHeadersObj instanceof Map) { Map rawHeaders = (Map) multiValueHeadersObj; for (Map.Entry entry : rawHeaders.entrySet()) { if (entry.getKey() != null && entry.getValue() != null) { String key = String.valueOf(entry.getKey()); - if (entry.getValue() instanceof java.util.List) { - java.util.List values = (java.util.List) entry.getValue(); + if (entry.getValue() instanceof List) { + List values = (List) entry.getValue(); // Join multiple values with comma String joinedValue = - values.stream() - .map(String::valueOf) - .collect(java.util.stream.Collectors.joining(", ")); + values.stream().map(String::valueOf).collect(Collectors.joining(", ")); headers.put(key, joinedValue); } else { headers.put(key, String.valueOf(entry.getValue())); @@ -578,7 +794,7 @@ private static LambdaEventData extractGenericData(Map event) { * values to strings, filtering out null entries. */ private static Map extractStringMap(Object mapObj) { - Map result = new java.util.HashMap<>(); + Map result = new HashMap<>(); if (mapObj instanceof Map) { Map rawMap = (Map) mapObj; for (Map.Entry entry : rawMap.entrySet()) { @@ -614,14 +830,14 @@ private static Map extractPathParameters(Object pathParamsObj) { * Map> format expected by AppSec. */ private static Map> extractQueryParameters(Object queryParamsObj) { - Map> result = new java.util.HashMap<>(); + Map> result = new HashMap<>(); if (queryParamsObj instanceof Map) { Map rawMap = (Map) queryParamsObj; for (Map.Entry entry : rawMap.entrySet()) { if (entry.getKey() != null && entry.getValue() != null) { String key = String.valueOf(entry.getKey()); String value = String.valueOf(entry.getValue()); - result.put(key, java.util.Collections.singletonList(value)); + result.put(key, Collections.singletonList(value)); } } } @@ -634,15 +850,15 @@ private static Map> extractQueryParameters(Object queryPara * List> format directly. */ private static Map> extractMultiValueQueryParameters(Object queryParamsObj) { - Map> result = new java.util.HashMap<>(); + Map> result = new HashMap<>(); if (queryParamsObj instanceof Map) { Map rawMap = (Map) queryParamsObj; for (Map.Entry entry : rawMap.entrySet()) { if (entry.getKey() != null && entry.getValue() != null) { String key = String.valueOf(entry.getKey()); - if (entry.getValue() instanceof java.util.List) { - java.util.List values = (java.util.List) entry.getValue(); - java.util.List stringValues = new java.util.ArrayList<>(); + if (entry.getValue() instanceof List) { + List values = (List) entry.getValue(); + List stringValues = new ArrayList<>(); for (Object value : values) { if (value != null) { stringValues.add(String.valueOf(value)); @@ -650,7 +866,7 @@ private static Map> extractMultiValueQueryParameters(Object } result.put(key, stringValues); } else { - result.put(key, java.util.Collections.singletonList(String.valueOf(entry.getValue()))); + result.put(key, Collections.singletonList(String.valueOf(entry.getValue()))); } } } @@ -679,9 +895,19 @@ private static String buildFullPath(String path, Map> query fullPath.append('&'); } first = false; - fullPath.append(key); - if (value != null) { - fullPath.append('=').append(value); + try { + // URL-encode key and value so that special characters (e.g. '&' inside a value) are not + // mistaken for query string delimiters when AppSec parses the raw query string. + fullPath.append(URLEncoder.encode(key, "UTF-8")); + if (value != null) { + fullPath.append('=').append(URLEncoder.encode(value, "UTF-8")); + } + } catch (java.io.UnsupportedEncodingException e) { + // UTF-8 is always available; fall back to unencoded + fullPath.append(key); + if (value != null) { + fullPath.append('=').append(value); + } } } } @@ -698,14 +924,12 @@ private static Map extractHeadersWithCookies(Map // API Gateway v2 provides a pre-parsed cookies array Object cookiesObj = event.get("cookies"); - if (cookiesObj instanceof java.util.List) { - java.util.List cookiesList = (java.util.List) cookiesObj; + if (cookiesObj instanceof List) { + List cookiesList = (List) cookiesObj; if (!cookiesList.isEmpty()) { // Join cookies with "; " separator per RFC 6265 String cookieValue = - cookiesList.stream() - .map(String::valueOf) - .collect(java.util.stream.Collectors.joining("; ")); + cookiesList.stream().map(String::valueOf).collect(Collectors.joining("; ")); // Merge with existing cookie header if present String existingCookie = headers.get("cookie"); @@ -730,8 +954,8 @@ private static Object extractBody(Map event) { String bodyString = String.valueOf(bodyObj); // Check if body is base64 encoded (API Gateway feature) - Boolean isBase64Encoded = (Boolean) event.get("isBase64Encoded"); - if (Boolean.TRUE.equals(isBase64Encoded)) { + Object isBase64EncodedObj = event.get("isBase64Encoded"); + if (Boolean.TRUE.equals(isBase64EncodedObj) || "true".equals(isBase64EncodedObj)) { try { bodyString = new String(Base64.getDecoder().decode(bodyString), StandardCharsets.UTF_8); } catch (Exception e) { @@ -765,6 +989,15 @@ private static Object parseBodyAsJson(String body) { } } + /** Sets the current trigger type thread-local. Package-private for use in tests only. */ + static void setCurrentTriggerType(LambdaTriggerType type) { + if (type == null) { + CURRENT_TRIGGER_TYPE.remove(); + } else { + CURRENT_TRIGGER_TYPE.set(type); + } + } + /** * Temporary RequestContext implementation to hold AppSecRequestContext before a span is created. */ @@ -827,7 +1060,11 @@ enum LambdaTriggerType { ALB, // Application Load Balancer ALB_MULTI_VALUE, // ALB with multi-value headers LAMBDA_URL, // Lambda Function URL - UNKNOWN // Unknown or unsupported trigger + UNKNOWN; // Unknown or unsupported trigger + + boolean isHttp() { + return this != UNKNOWN; + } } /** Object for Lambda event data needed for AppSec processing */ @@ -876,6 +1113,19 @@ static class LambdaEventData { } } + /** Data extracted from a Lambda response for WAF analysis */ + static class LambdaResponseData { + final int statusCode; + final Map headers; + final Object body; + + LambdaResponseData(int statusCode, Map headers, Object body) { + this.statusCode = statusCode; + this.headers = headers; + this.body = body; + } + } + /** URIDataAdapter implementation for Lambda events. */ private static class LambdaURIDataAdapter extends URIDataAdapterBase { private final String path; diff --git a/dd-trace-core/src/main/java/datadog/trace/lambda/LambdaHandler.java b/dd-trace-core/src/main/java/datadog/trace/lambda/LambdaHandler.java index c5f47f6554e..7e693ed82c8 100644 --- a/dd-trace-core/src/main/java/datadog/trace/lambda/LambdaHandler.java +++ b/dd-trace-core/src/main/java/datadog/trace/lambda/LambdaHandler.java @@ -9,6 +9,7 @@ import datadog.trace.api.DDTags; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext; +import datadog.trace.util.Strings; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.nio.charset.StandardCharsets; @@ -120,22 +121,17 @@ public static boolean notifyEndInvocation( .addHeader(LAMBDA_RUNTIME_AWS_REQUEST_ID, lambdaRequestId) .post(body); - Object errorMessage = span.getTag(DDTags.ERROR_MSG); - if (errorMessage != null) { - builder.addHeader(DATADOG_INVOCATION_ERROR_MSG, errorMessage.toString()); - } - - Object errorType = span.getTag(DDTags.ERROR_TYPE); - if (errorType != null) { - builder.addHeader(DATADOG_INVOCATION_ERROR_TYPE, errorType.toString()); - } + addHeaderIfValid(builder, DATADOG_INVOCATION_ERROR_MSG, span.getTag(DDTags.ERROR_MSG)); + addHeaderIfValid(builder, DATADOG_INVOCATION_ERROR_TYPE, span.getTag(DDTags.ERROR_TYPE)); Object errorStack = span.getTag(DDTags.ERROR_STACK); if (errorStack != null) { String encodedErrStack = Base64.getEncoder() .encodeToString(errorStack.toString().getBytes(StandardCharsets.UTF_8)); - builder.addHeader(DATADOG_INVOCATION_ERROR_STACK, encodedErrStack); + if (Strings.isNotBlank(encodedErrStack)) { + builder.addHeader(DATADOG_INVOCATION_ERROR_STACK, encodedErrStack); + } } if (isError) { @@ -165,6 +161,15 @@ public static String writeValueAsString(Object obj) { return json; } + private static void addHeaderIfValid(Request.Builder builder, String name, Object value) { + if (value != null) { + final String stringValue = value.toString(); + if (Strings.isNotBlank(stringValue)) { + builder.addHeader(name, stringValue); + } + } + } + public static void setExtensionBaseUrl(String extensionBaseUrl) { EXTENSION_BASE_URL = extensionBaseUrl; } diff --git a/dd-trace-core/src/main/java/datadog/trace/llmobs/writer/ddintake/LLMObsSpanMapper.java b/dd-trace-core/src/main/java/datadog/trace/llmobs/writer/ddintake/LLMObsSpanMapper.java index cb8ebd3d8a1..7849052b9d3 100644 --- a/dd-trace-core/src/main/java/datadog/trace/llmobs/writer/ddintake/LLMObsSpanMapper.java +++ b/dd-trace-core/src/main/java/datadog/trace/llmobs/writer/ddintake/LLMObsSpanMapper.java @@ -55,6 +55,7 @@ public class LLMObsSpanMapper implements RemoteMapper { private static final byte[] DD = "_dd".getBytes(StandardCharsets.UTF_8); private static final byte[] APM_TRACE_ID = "apm_trace_id".getBytes(StandardCharsets.UTF_8); private static final byte[] PARENT_ID = "parent_id".getBytes(StandardCharsets.UTF_8); + private static final byte[] SESSION_ID = "session_id".getBytes(StandardCharsets.UTF_8); private static final byte[] NAME = "name".getBytes(StandardCharsets.UTF_8); private static final byte[] DURATION = "duration".getBytes(StandardCharsets.UTF_8); private static final byte[] START_NS = "start_ns".getBytes(StandardCharsets.UTF_8); @@ -88,6 +89,8 @@ public class LLMObsSpanMapper implements RemoteMapper { private static final byte[] LLM_TOOL_RESULT_RESULT = "result".getBytes(StandardCharsets.UTF_8); private static final String PARENT_ID_TAG_INTERNAL_FULL = LLMOBS_TAG_PREFIX + "parent_id"; + private static final String SESSION_ID_TAG_INTERNAL_FULL = + LLMOBS_TAG_PREFIX + LLMObsTags.SESSION_ID; private final MetaWriter metaWriter = new MetaWriter(); private final int size; @@ -126,7 +129,17 @@ public void map(List> trace, Writable writable) { } for (CoreSpan span : llmobsSpans) { - writable.startMap(11); + // Read session_id off the span before opening the map so we can size it correctly. + // We deliberately do NOT remove the tag (unlike parent_id) — the session_id: + // entry must remain in the tags[] array to match dd-trace-py and dd-trace-js behavior. + // span.getTag returns Object — guard against generic tag APIs setting a non-string + // session_id value, which would otherwise throw ClassCastException here and drop + // the entire LLMObs payload for the trace. + Object rawSessionId = span.getTag(SESSION_ID_TAG_INTERNAL_FULL); + String sessionId = rawSessionId instanceof String ? (String) rawSessionId : null; + boolean hasSessionId = sessionId != null && !sessionId.isEmpty(); + + writable.startMap(hasSessionId ? 12 : 11); // 1 writable.writeUTF8(SPAN_ID); writable.writeString(String.valueOf(span.getSpanId()), null); @@ -166,7 +179,14 @@ public void map(List> trace, Writable writable) { writable.writeUTF8(APM_TRACE_ID); writable.writeString(span.getTraceId().toHexString(), null); - /* 9 (metrics), 10 (tags), 11 meta */ + // 9 — optional top-level session_id field. Required by the LLMObs HTTP intake schema + // and by the LLM Trace Explorer's Sessions filter, which keys off this field. + if (hasSessionId) { + writable.writeUTF8(SESSION_ID); + writable.writeString(sessionId, null); + } + + /* 10 (metrics), 11 (tags), 12 meta — shift down 1 if session_id absent */ span.processTagsAndBaggage(metaWriter.withWritable(writable, getErrorsMap(span))); } diff --git a/dd-trace-core/src/test/groovy/datadog/trace/TracerConnectionReliabilityTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/TracerConnectionReliabilityTest.groovy deleted file mode 100644 index d744a6fc7cd..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/TracerConnectionReliabilityTest.groovy +++ /dev/null @@ -1,167 +0,0 @@ -package datadog.trace - -import static datadog.trace.api.ConfigDefaults.DEFAULT_TRACE_AGENT_PORT -import static datadog.trace.api.ProtocolVersion.V0_4 - -import com.squareup.moshi.JsonAdapter -import com.squareup.moshi.Moshi -import com.squareup.moshi.Types -import datadog.communication.ddagent.DDAgentFeaturesDiscovery -import datadog.communication.ddagent.SharedCommunicationObjects -import datadog.metrics.api.Monitoring -import datadog.trace.agent.test.utils.PortUtils -import datadog.trace.api.IdGenerationStrategy -import datadog.trace.core.CoreTracer -import datadog.trace.test.util.DDSpecification -import java.lang.reflect.Type -import okhttp3.HttpUrl -import okhttp3.OkHttpClient -import okhttp3.Request -import org.testcontainers.containers.FixedHostPortGenericContainer -import org.testcontainers.containers.GenericContainer -import org.testcontainers.containers.wait.strategy.Wait -import spock.lang.AutoCleanup -import spock.lang.Shared - -class TracerConnectionReliabilityTest extends DDSpecification { - final static FEATURES_DISCOVERY_MIN_DELAY = 10 - - @Shared - OkHttpClient client - @Shared - JsonAdapter> traceJsonAdapter - - int agentContainerPort - @AutoCleanup - CoreTracer tracer - - def setupSpec() { - client = new OkHttpClient() - // Create body parser for /test/traces route - def moshi = new Moshi.Builder().build() - Type type = Types.newParameterizedType(List, Types.newParameterizedType(List, SentTraces)) - traceJsonAdapter = moshi.adapter(type) - } - - def setup() { - // Pick a random port for the test agent - agentContainerPort = PortUtils.randomOpenPort() - // Build a tracer talking to the test agent (with the right port and traces endpoint) - def properties = new Properties() - properties.put("trace.agent.port", Integer.toString(agentContainerPort)) - def sharedCommunicationObjects = new SharedCommunicationObjects() - sharedCommunicationObjects.agentUrl = HttpUrl.get("http://localhost:" + agentContainerPort) - sharedCommunicationObjects.agentHttpClient = client - def fixedFeaturesDiscovery = new FixedTraceEndpointFeaturesDiscovery(sharedCommunicationObjects) - sharedCommunicationObjects.setFeaturesDiscovery(fixedFeaturesDiscovery) - - tracer = CoreTracer.builder() - .idGenerationStrategy(IdGenerationStrategy.fromName("SEQUENTIAL")) - .withProperties(properties) - .sharedCommunicationObjects(sharedCommunicationObjects) - .build() - } - - def "test late agent start"() { - setup: - createSpans(10, 100) - tracer.flush() - - when: - def agentContainer = startTestAgentContainer() - def noAgentCount = getTraceCount(agentContainer) - waitForDiscoveryTimeout() - - createSpans(20, 100) - tracer.flush() - def withAgentCount = getTraceCount(agentContainer) - agentContainer.stop() - - then: - !agentContainer.running - noAgentCount == 0 - withAgentCount == 20 - } - - def "test agent restart"() { - setup: - def agentContainer = startTestAgentContainer() - - when: - createSpans(10, 100) - tracer.flush() - def withAgentCount = getTraceCount(agentContainer) - - then: - withAgentCount == 10 - - when: - agentContainer.stop() - createSpans(10, 100) - tracer.flush() - - waitForDiscoveryTimeout() - agentContainer = startTestAgentContainer() - def noTraceCount = getTraceCount(agentContainer) - createSpans(10, 100) - tracer.flush() - withAgentCount = getTraceCount(agentContainer) - agentContainer.stop() - - then: - !agentContainer.running - noTraceCount == 0 - withAgentCount == 10 - } - - def startTestAgentContainer() { - //noinspection GrDeprecatedAPIUsage Use FixedHostPortGenericContainer against deprecation because we need to know the exposed to configure the tracer at start - def agentContainer = new FixedHostPortGenericContainer("registry.ddbuild.io/images/mirror/dd-apm-test-agent/ddapm-test-agent:v1.44.0") - .withFixedExposedPort(agentContainerPort, DEFAULT_TRACE_AGENT_PORT) - .withEnv("ENABLED_CHECKS", "trace_count_header,meta_tracer_version_header,trace_content_length") - .waitingFor(Wait.forHttp("/test/traces")) - agentContainer.start() - return agentContainer - } - - def createSpans(int count, int delay) { - for (def index: 1..count) { - def span = tracer.buildSpan("operation-${index}").start() - Thread.sleep(delay) - span.finish() - } - } - - static waitForDiscoveryTimeout() { - Thread.sleep(FEATURES_DISCOVERY_MIN_DELAY * 1.5 as long) - } - - def getTraceCount(GenericContainer agentContainer) { - def request = new Request.Builder() - .url("http://${agentContainer.host}:${agentContainerPort}/test/traces") - .build() - def execute = client.newCall(request).execute() - def body = execute.body().string() - return traceJsonAdapter.fromJson(body).size() - } - - class FixedTraceEndpointFeaturesDiscovery extends DDAgentFeaturesDiscovery { - FixedTraceEndpointFeaturesDiscovery(SharedCommunicationObjects objects) { - super(objects.agentHttpClient, Monitoring.DISABLED, objects.agentUrl, V0_4, false, false) - } - - @Override - String getTraceEndpoint() { - return V04_ENDPOINT - } - - @Override - protected long getFeaturesDiscoveryMinDelayMillis() { - FEATURES_DISCOVERY_MIN_DELAY - } - } - - static class SentTraces { - String name - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/api/writer/PrintingWriterTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/api/writer/PrintingWriterTest.groovy deleted file mode 100644 index ea0245f8f0d..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/api/writer/PrintingWriterTest.groovy +++ /dev/null @@ -1,155 +0,0 @@ -package datadog.trace.api.writer - -import com.squareup.moshi.Moshi -import com.squareup.moshi.Types -import datadog.trace.common.writer.ListWriter -import datadog.trace.common.writer.PrintingWriter -import datadog.trace.core.test.DDCoreSpecification -import okio.Buffer - -import java.nio.charset.StandardCharsets - -class PrintingWriterTest extends DDCoreSpecification { - - def tracer = tracerBuilder().writer(new ListWriter()).build() - def sampleTrace - def secondTrace - - def adapter = new Moshi.Builder().build().adapter(Types.newParameterizedType(Map, String, - Types.newParameterizedType(List, - Types.newParameterizedType(List, Map)))) - - def setup() { - def builder = tracer.buildSpan("fakeOperation") - .withServiceName("fakeService") - .withResourceName("fakeResource") - .withSpanType("fakeType") - - sampleTrace = [builder.start(), builder.start()] - secondTrace = [builder.start()] - } - - def cleanup() { - tracer?.close() - } - - def "test printing regular ids"() { - given: - def buffer = new Buffer() - def writer = new PrintingWriter(buffer.outputStream(), false) - - when: - writer.write(sampleTrace) - Map>> result = adapter.fromJson(buffer.readString(StandardCharsets.UTF_8)) - - then: - result["traces"][0].size() == sampleTrace.size() - result["traces"][0].each { - assert it["service"] == "fakeService" - assert it["name"] == "fakeOperation" - assert it["resource"] == "fakeResource" - assert it["type"] == "fakeType" - assert it["trace_id"] instanceof Number - assert it["span_id"] instanceof Number - assert it["parent_id"] instanceof Number - assert it["start"] instanceof Number - assert it["duration"] instanceof Number - assert it["error"] == 0 - assert it["metrics"] instanceof Map - assert it["meta"] instanceof Map - } - - when: - writer.write(secondTrace) - result = adapter.fromJson(buffer.readString(StandardCharsets.UTF_8)) - - then: - result["traces"][0].size() == secondTrace.size() - result["traces"][0].each { - assert it["service"] == "fakeService" - assert it["name"] == "fakeOperation" - assert it["resource"] == "fakeResource" - assert it["type"] == "fakeType" - assert it["trace_id"] instanceof Number - assert it["span_id"] instanceof Number - assert it["parent_id"] instanceof Number - assert it["start"] instanceof Number - assert it["duration"] instanceof Number - assert it["error"] == 0 - assert it["metrics"] instanceof Map - assert it["meta"] instanceof Map - } - } - - def "test printing regular hex ids"() { - - given: - def buffer = new Buffer() - def writer = new PrintingWriter(buffer.outputStream(), true) - - when: - writer.write(sampleTrace) - Map>> result = adapter.fromJson(buffer.readString(StandardCharsets.UTF_8)) - - then: - result["traces"][0].size() == sampleTrace.size() - result["traces"][0].each { - assert it["service"] == "fakeService" - assert it["name"] == "fakeOperation" - assert it["resource"] == "fakeResource" - assert it["type"] == "fakeType" - assert it["trace_id"] instanceof String - assert it["span_id"] instanceof String - assert it["parent_id"] instanceof String - assert it["start"] instanceof Number - assert it["duration"] instanceof Number - assert it["error"] == 0 - assert it["metrics"] instanceof Map - assert it["meta"] instanceof Map - } - } - - def "test printing multiple traces"() { - given: - def buffer = new Buffer() - def writer = new PrintingWriter(buffer.outputStream(), false) - - when: - writer.write(sampleTrace) - writer.write(secondTrace) - Map>> result1 = adapter.fromJson(buffer.readUtf8Line()) - Map>> result2 = adapter.fromJson(buffer.readUtf8Line()) - - then: - result1["traces"][0].size() == sampleTrace.size() - result2["traces"][0].each { - assert it["service"] == "fakeService" - assert it["name"] == "fakeOperation" - assert it["resource"] == "fakeResource" - assert it["type"] == "fakeType" - assert it["trace_id"] instanceof Number - assert it["span_id"] instanceof Number - assert it["parent_id"] instanceof Number - assert it["start"] instanceof Number - assert it["duration"] instanceof Number - assert it["error"] == 0 - assert it["metrics"] instanceof Map - assert it["meta"] instanceof Map - } - result2["traces"][0].size() == secondTrace.size() - result2["traces"][0].each { - assert it["service"] == "fakeService" - assert it["name"] == "fakeOperation" - assert it["resource"] == "fakeResource" - assert it["type"] == "fakeType" - assert it["trace_id"] instanceof Number - assert it["span_id"] instanceof Number - assert it["parent_id"] instanceof Number - assert it["start"] instanceof Number - assert it["duration"] instanceof Number - assert it["error"] == 0 - assert it["metrics"] instanceof Map - assert it["meta"] instanceof Map - } - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/api/writer/TraceStructureWriterTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/api/writer/TraceStructureWriterTest.groovy deleted file mode 100644 index 00dd1fe65dd..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/api/writer/TraceStructureWriterTest.groovy +++ /dev/null @@ -1,29 +0,0 @@ -package datadog.trace.api.writer - - -import datadog.trace.common.writer.TraceStructureWriter -import datadog.trace.core.test.DDCoreSpecification - -class TraceStructureWriterTest extends DDCoreSpecification { - def "parse CLI args"() { - when: - def args = TraceStructureWriter.parseArgs(cli, windows) - - then: - args.length > 0 - args[0] == path - - where: - windows | cli | path - true | 'C:/tmp/file' | 'C:/tmp/file' - true | 'C:\\tmp\\file' | 'C:\\tmp\\file' - true | 'file' | 'file' - true | 'C:/tmp/file:includeresource' | 'C:/tmp/file' - true | 'C:\\tmp\\file:includeresource' | 'C:\\tmp\\file' - true | 'file:includeresource' | 'file' - false | '/var/tmp/file' | '/var/tmp/file' - false | 'file' | 'file' - false | '/var/tmp/file' | '/var/tmp/file' - false | 'file' | 'file' - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/civisibility/interceptor/CiVisibilityApmProtocolInterceptorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/civisibility/interceptor/CiVisibilityApmProtocolInterceptorTest.groovy deleted file mode 100644 index 519bb0c3881..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/civisibility/interceptor/CiVisibilityApmProtocolInterceptorTest.groovy +++ /dev/null @@ -1,61 +0,0 @@ -package datadog.trace.civisibility.interceptor - -import datadog.trace.api.DDSpanTypes -import datadog.trace.bootstrap.instrumentation.api.Tags -import datadog.trace.common.writer.ListWriter -import datadog.trace.core.test.DDCoreSpecification -import spock.lang.Timeout - -@Timeout(10) -class CiVisibilityApmProtocolInterceptorTest extends DDCoreSpecification { - - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - - def cleanup() { - tracer?.close() - } - - def "test suite and test module spans are filtered out"() { - setup: - tracer.addTraceInterceptor(CiVisibilityApmProtocolInterceptor.INSTANCE) - - tracer.buildSpan("test-module").withSpanType(DDSpanTypes.TEST_MODULE_END).start().finish() - tracer.buildSpan("test-suite").withSpanType(DDSpanTypes.TEST_SUITE_END).start().finish() - tracer.buildSpan("test").withSpanType(DDSpanTypes.TEST).start().finish() - - writer.waitForTraces(1) - - expect: - def trace = writer.firstTrace() - trace.size() == 1 - - def span = trace[0] - span.operationName == "test" - } - - def "test session, test module and test suite IDs are nullified"() { - setup: - tracer.addTraceInterceptor(CiVisibilityApmProtocolInterceptor.INSTANCE) - - def testSpan = tracer.buildSpan("test").withSpanType(DDSpanTypes.TEST).start() - testSpan.setTag(Tags.TEST_SESSION_ID, "session ID") - testSpan.setTag(Tags.TEST_MODULE_ID, "module ID") - testSpan.setTag(Tags.TEST_SUITE_ID, "suite ID") - testSpan.setTag("random tag", "random value") - testSpan.finish() - - writer.waitForTraces(1) - - expect: - def trace = writer.firstTrace() - trace.size() == 1 - - def span = trace[0] - - span.getTag(Tags.TEST_SESSION_ID) == null - span.getTag(Tags.TEST_MODULE_ID) == null - span.getTag(Tags.TEST_SUITE_ID) == null - span.getTag("random tag") == "random value" - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/civisibility/interceptor/CiVisibilityTraceInterceptorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/civisibility/interceptor/CiVisibilityTraceInterceptorTest.groovy deleted file mode 100644 index f9d2f46e1e6..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/civisibility/interceptor/CiVisibilityTraceInterceptorTest.groovy +++ /dev/null @@ -1,66 +0,0 @@ -package datadog.trace.civisibility.interceptor - -import datadog.trace.api.DDSpanTypes -import datadog.trace.api.DDTags -import datadog.trace.api.civisibility.CIConstants -import datadog.trace.common.writer.ListWriter -import datadog.trace.core.DDSpanContext -import datadog.trace.core.test.DDCoreSpecification -import spock.lang.Timeout - -@Timeout(10) -class CiVisibilityTraceInterceptorTest extends DDCoreSpecification { - - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - - def cleanup() { - tracer?.close() - } - - def "discard a trace that does not come from ci app"() { - tracer.addTraceInterceptor(CiVisibilityTraceInterceptor.INSTANCE) - tracer.buildSpan("sample-span").start().finish() - - expect: - writer.size() == 0 - } - - def "do not discard a trace that comes from ci app"() { - tracer.addTraceInterceptor(CiVisibilityTraceInterceptor.INSTANCE) - - def span = tracer.buildSpan("sample-span").start() - ((DDSpanContext) span.context()).origin = CIConstants.CIAPP_TEST_ORIGIN - span.finish() - - expect: - writer.size() == 1 - } - - def "add tracer version to spans of type #spanType"() { - setup: - tracer.addTraceInterceptor(CiVisibilityTraceInterceptor.INSTANCE) - - - def span = tracer.buildSpan("sample-span").withSpanType(spanType).start() - ((DDSpanContext) span.context()).origin = CIConstants.CIAPP_TEST_ORIGIN - span.finish() - writer.waitForTraces(1) - - expect: - def trace = writer.firstTrace() - trace.size() == 1 - - def receivedSpan = trace[0] - - receivedSpan.getTag(DDTags.LIBRARY_VERSION_TAG_KEY) != null - - where: - spanType << [ - DDSpanTypes.TEST, - DDSpanTypes.TEST_SUITE_END, - DDSpanTypes.TEST_MODULE_END, - DDSpanTypes.TEST_SESSION_END - ] - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/civisibility/writer/ddintake/CiTestCovMapperV2Test.groovy b/dd-trace-core/src/test/groovy/datadog/trace/civisibility/writer/ddintake/CiTestCovMapperV2Test.groovy deleted file mode 100644 index cdbe02fb3cc..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/civisibility/writer/ddintake/CiTestCovMapperV2Test.groovy +++ /dev/null @@ -1,333 +0,0 @@ -package datadog.trace.civisibility.writer.ddintake - -import com.fasterxml.jackson.databind.ObjectMapper -import datadog.communication.serialization.GrowableBuffer -import datadog.communication.serialization.msgpack.MsgPackWriter -import datadog.trace.api.DDTraceId -import datadog.trace.api.civisibility.coverage.CoverageProbes -import datadog.trace.api.civisibility.coverage.CoverageStore -import datadog.trace.api.civisibility.coverage.NoOpProbes -import datadog.trace.api.civisibility.coverage.TestReport -import datadog.trace.api.civisibility.coverage.TestReportFileEntry -import datadog.trace.api.civisibility.domain.TestContext -import datadog.trace.api.sampling.PrioritySampling -import datadog.trace.bootstrap.instrumentation.api.InternalSpanTypes -import datadog.trace.core.CoreSpan -import datadog.trace.core.propagation.PropagationTags -import datadog.trace.core.test.DDCoreSpecification -import org.msgpack.jackson.dataformat.MessagePackFactory -import spock.lang.Shared - -import java.nio.ByteBuffer -import java.nio.channels.WritableByteChannel - -class CiTestCovMapperV2Test extends DDCoreSpecification { - - @Shared - ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory()) - - def "test writes message"() { - given: - def trace = givenTrace(new TestReport(DDTraceId.from(1), 2, 3, [new TestReportFileEntry("source", BitSet.valueOf(new long[] { - 3, 5, 8 - }))])) - - when: - def message = getMappedMessage(trace) - - then: - message == [ - version : 2, - coverages: [ - [ - test_session_id: 1, - test_suite_id : 2, - span_id : 3, - files : [ - [ - filename: "source", - bitmap: [3, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 8] - ] - ] - ] - ] - ] - } - - def "test writes message with multiple files and multiple lines"() { - given: - def trace = givenTrace(new TestReport(DDTraceId.from(1), 2, 3, [ - new TestReportFileEntry("sourceA", BitSet.valueOf(new long[] { - 3, 5, 8 - })), - new TestReportFileEntry("sourceB", BitSet.valueOf(new long[] { - 1, 255, 7 - })) - ])) - - when: - def message = getMappedMessage(trace) - - then: - message == [ - version : 2, - coverages: [ - [ - test_session_id: 1, - test_suite_id : 2, - span_id : 3, - files : [ - [ - filename: "sourceA", - bitmap:[3, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 8] - ], - [ - filename: "sourceB", - bitmap:[1, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 7] - ] - ] - ] - ] - ] - } - - def "test writes message with multiple reports"() { - given: - def trace = givenTrace( - new TestReport(DDTraceId.from(1), 2, 3, [ - new TestReportFileEntry("sourceA", BitSet.valueOf(new long[] { - 2, 17, 41 - })) - ]), - new TestReport(DDTraceId.from(1), 2, 4, [ - new TestReportFileEntry("sourceB", BitSet.valueOf(new long[] { - 11, 13, 55 - })) - ]), - ) - - when: - def message = getMappedMessage(trace) - - then: - message == [ - version : 2, - coverages: [ - [ - test_session_id: 1, - test_suite_id : 2, - span_id : 3, - files : [ - [ - filename: "sourceA", - bitmap:[2, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 41] - ] - ] - ], - [ - test_session_id: 1, - test_suite_id : 2, - span_id : 4, - files : [ - [ - filename: "sourceB", - bitmap:[11, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 55] - ] - ] - ] - ] - ] - } - - def "skips spans that have no reports"() { - given: - def trace = givenTrace(null, new TestReport(DDTraceId.from(1), 2, 3, [new TestReportFileEntry("source", BitSet.valueOf(new long[] { - 83, 25, 48 - }))]), null) - - when: - def message = getMappedMessage(trace) - - then: - message == [ - version : 2, - coverages: [ - [ - test_session_id: 1, - test_suite_id : 2, - span_id : 3, - files : [ - [ - filename: "source", - bitmap:[83, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 48] - ] - ] - ] - ] - ] - } - - def "skips empty reports"() { - given: - def trace = givenTrace( - new TestReport(DDTraceId.from(1), 2, 3, [ - new TestReportFileEntry("source", BitSet.valueOf(new long[] { - 33, 53, 87 - })) - ]), - new TestReport(DDTraceId.from(1), 2, 4, []) - ) - - when: - def message = getMappedMessage(trace) - - then: - message == [ - version : 2, - coverages: [ - [ - test_session_id: 1, - test_suite_id : 2, - span_id : 3, - files : [ - [ - filename: "source", - bitmap:[33, 0, 0, 0, 0, 0, 0, 0, 53, 0, 0, 0, 0, 0, 0, 0, 87] - ] - ] - ] - ] - ] - } - - def "skips duplicate reports"() { - given: - def trace = new ArrayList() - - def report = new TestReport(DDTraceId.from(1), 2, 3, [new TestReportFileEntry("source", BitSet.valueOf(new long[] { - 3, 5, 8 - }))]) - - trace.add(buildSpan(0, InternalSpanTypes.TEST, PropagationTags.factory().empty(), [:], PrioritySampling.SAMPLER_KEEP, new DummyTestContext(new DummyReportHolder(report)))) - trace.add(buildSpan(0, "testChild", PropagationTags.factory().empty(), [:], PrioritySampling.SAMPLER_KEEP, new DummyTestContext(new DummyReportHolder(report)))) - - when: - def message = getMappedMessage(trace) - - then: - message == [ - version : 2, - coverages: [ - [ - test_session_id: 1, - test_suite_id : 2, - span_id : 3, - files : [ - [ - filename: "source", - bitmap:[3, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 8] - ] - ] - ] - ] - ] - } - - private List> givenTrace(TestReport... testReports) { - def trace = new ArrayList() - for (TestReport testReport : testReports) { - def testReportHolder = new DummyReportHolder(testReport) - trace.add(buildSpan(0, InternalSpanTypes.TEST, PropagationTags.factory().empty(), [:], PrioritySampling.SAMPLER_KEEP, new DummyTestContext(testReportHolder))) - } - return trace - } - - private Map getMappedMessage(List> trace) { - def buffer = new GrowableBuffer(1024) - def mapper = new CiTestCovMapperV2(false) - mapper.map(trace, new MsgPackWriter(buffer)) - - WritableByteChannel channel = new ByteArrayWritableByteChannel() - - def slice = buffer.slice() - def payload = mapper.newPayload().withBody(1, slice) - payload.writeTo(channel) - - def writtenBytes = channel.toByteArray() - return objectMapper.readValue(writtenBytes, Map) - } - - private static final class DummyReportHolder implements CoverageStore { - private final testReport - - DummyReportHolder(testReport) { - this.testReport = testReport - } - - @Override - TestReport getReport() { - testReport - } - - @Override - boolean report(DDTraceId testSessionId, Long testSuiteId, long spanId) { - return false - } - - @Override - CoverageProbes getProbes() { - return NoOpProbes.INSTANCE - } - } - - private static final class DummyTestContext implements TestContext { - private final CoverageStore coverageStore - - DummyTestContext(CoverageStore coverageStore) { - this.coverageStore = coverageStore - } - - @Override - CoverageStore getCoverageStore() { - return coverageStore - } - - @Override - def void set(Class key, T value) { - } - - @Override - def T get(Class key) { - return null - } - } - - - private static final class ByteArrayWritableByteChannel implements WritableByteChannel { - - private final ByteArrayOutputStream outputStream = new ByteArrayOutputStream() - - @Override - int write(ByteBuffer src) throws IOException { - int remaining = src.remaining() - byte[] buffer = new byte[remaining] - src.get(buffer) - outputStream.write(buffer) - return remaining - } - - @Override - boolean isOpen() { - return true - } - - @Override - void close() throws IOException { - outputStream.close() - } - - byte[] toByteArray() { - return outputStream.toByteArray() - } - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/civisibility/writer/ddintake/CiTestCycleMapperV1PayloadTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/civisibility/writer/ddintake/CiTestCycleMapperV1PayloadTest.groovy deleted file mode 100644 index 1129987f695..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/civisibility/writer/ddintake/CiTestCycleMapperV1PayloadTest.groovy +++ /dev/null @@ -1,455 +0,0 @@ -package datadog.trace.civisibility.writer.ddintake - -import com.fasterxml.jackson.databind.ObjectMapper -import datadog.communication.serialization.ByteBufferConsumer -import datadog.communication.serialization.FlushingBuffer -import datadog.communication.serialization.msgpack.MsgPackWriter -import datadog.trace.api.DDTags -import datadog.trace.api.DDTraceId -import datadog.trace.api.civisibility.CiVisibilityWellKnownTags -import datadog.trace.bootstrap.instrumentation.api.InternalSpanTypes -import datadog.trace.bootstrap.instrumentation.api.Tags -import datadog.trace.common.writer.Payload -import datadog.trace.common.writer.TraceGenerator -import datadog.trace.core.DDSpanContext -import datadog.trace.test.util.DDSpecification -import org.junit.jupiter.api.Assertions -import org.msgpack.core.MessageFormat -import org.msgpack.core.MessagePack -import org.msgpack.core.MessageUnpacker -import org.msgpack.jackson.dataformat.MessagePackFactory - -import java.nio.ByteBuffer -import java.nio.channels.WritableByteChannel - -import static datadog.trace.bootstrap.instrumentation.api.InstrumentationTags.DD_MEASURED -import static datadog.trace.common.writer.TraceGenerator.generateRandomSpan -import static datadog.trace.common.writer.TraceGenerator.generateRandomTraces -import static org.junit.jupiter.api.Assertions.assertEquals -import static org.junit.jupiter.api.Assertions.assertFalse -import static org.junit.jupiter.api.Assertions.assertNotNull -import static org.msgpack.core.MessageFormat.FLOAT32 -import static org.msgpack.core.MessageFormat.FLOAT64 -import static org.msgpack.core.MessageFormat.INT16 -import static org.msgpack.core.MessageFormat.INT32 -import static org.msgpack.core.MessageFormat.INT64 -import static org.msgpack.core.MessageFormat.INT8 -import static org.msgpack.core.MessageFormat.NEGFIXINT -import static org.msgpack.core.MessageFormat.POSFIXINT -import static org.msgpack.core.MessageFormat.UINT16 -import static org.msgpack.core.MessageFormat.UINT32 -import static org.msgpack.core.MessageFormat.UINT64 -import static org.msgpack.core.MessageFormat.UINT8 - -class CiTestCycleMapperV1PayloadTest extends DDSpecification { - - def "test traces written correctly with bufferSize=#bufferSize, traceCount=#traceCount, lowCardinality=#lowCardinality"() { - setup: - CiVisibilityWellKnownTags wellKnownTags = new CiVisibilityWellKnownTags( - "runtimeid", "my-env", "language", - "my-runtime-name", "my-runtime-version", "my-runtime-vendor", - "my-os-arch", "my-os-platform", "my-os-version", "false") - CiTestCycleMapperV1 mapper = new CiTestCycleMapperV1(wellKnownTags, false) - - List> traces = generateRandomTraces(traceCount, lowCardinality) - PayloadVerifier verifier = new PayloadVerifier(wellKnownTags, traces, mapper) - - MsgPackWriter packer = new MsgPackWriter(new FlushingBuffer(bufferSize, verifier)) - when: - boolean tracesFitInBuffer = true - for (List trace : traces) { - if (!packer.format(trace, mapper)) { - verifier.skipLargeTrace() - tracesFitInBuffer = false - } - } - packer.flush() - then: - if (tracesFitInBuffer) { - verifier.verifyTracesConsumed() - } - where: - bufferSize | traceCount | lowCardinality - 20 << 10 | 0 | true - 20 << 10 | 1 | true - 30 << 10 | 1 | true - 30 << 10 | 2 | true - 20 << 10 | 0 | false - 20 << 10 | 1 | false - 30 << 10 | 1 | false - 30 << 10 | 2 | false - 100 << 10 | 0 | true - 100 << 10 | 1 | true - 100 << 10 | 10 | true - 100 << 10 | 100 | true - 100 << 10 | 1000 | true - 100 << 10 | 0 | false - 100 << 10 | 1 | false - 100 << 10 | 10 | false - 100 << 10 | 100 | false - 100 << 10 | 1000 | false - } - - def "verify test_suite_id, test_module_id, and test_session_id are written as top level tags in test event"() { - setup: - def span = generateRandomSpan(InternalSpanTypes.TEST, [ - (Tags.TEST_SESSION_ID): DDTraceId.from(123), - (Tags.TEST_MODULE_ID) : 456, - (Tags.TEST_SUITE_ID) : 789, - ]) - - when: - Map deserializedSpan = whenASpanIsWritten(span) - - then: - verifyTopLevelTags(deserializedSpan, DDTraceId.from(123), 456, 789) - - def spanContent = (Map) deserializedSpan.get("content") - assert spanContent.containsKey("trace_id") - assert spanContent.containsKey("span_id") - assert spanContent.containsKey("parent_id") - } - - def "verify test_suite_end event is written correctly"() { - setup: - def span = generateRandomSpan(InternalSpanTypes.TEST_SUITE_END, [ - (Tags.TEST_SESSION_ID): DDTraceId.from(123), - (Tags.TEST_MODULE_ID) : 456, - (Tags.TEST_SUITE_ID) : 789, - ]) - - when: - Map deserializedSpan = whenASpanIsWritten(span) - - then: - verifyTopLevelTags(deserializedSpan, DDTraceId.from(123), 456, 789) - - def spanContent = (Map) deserializedSpan.get("content") - assert !spanContent.containsKey("trace_id") - assert !spanContent.containsKey("span_id") - assert !spanContent.containsKey("parent_id") - } - - def "verify test_module_end event is written correctly"() { - setup: - def span = generateRandomSpan(InternalSpanTypes.TEST_MODULE_END, [ - (Tags.TEST_SESSION_ID): DDTraceId.from(123), - (Tags.TEST_MODULE_ID) : 456, - ]) - - when: - Map deserializedSpan = whenASpanIsWritten(span) - - then: - verifyTopLevelTags(deserializedSpan, DDTraceId.from(123), 456, null) - - def spanContent = (Map) deserializedSpan.get("content") - assert !spanContent.containsKey("trace_id") - assert !spanContent.containsKey("span_id") - assert !spanContent.containsKey("parent_id") - } - - def "verify result is not affected by successive mapping calls"(){ - setup: - def span = generateRandomSpan(InternalSpanTypes.TEST, [ - (Tags.TEST_SESSION_ID): DDTraceId.from(123), - (Tags.TEST_MODULE_ID) : 456, - (Tags.TEST_SUITE_ID) : 789, - ]) - - when: - whenASpanIsWritten(span) - Map deserializedSpan = whenASpanIsWritten(span) - - then: - verifyTopLevelTags(deserializedSpan, DDTraceId.from(123), 456, 789) - - def spanContent = (Map) deserializedSpan.get("content") - assert spanContent.containsKey("trace_id") - assert spanContent.containsKey("span_id") - assert spanContent.containsKey("parent_id") - } - - private static void verifyTopLevelTags(Map deserializedSpan, DDTraceId testSessionId, Long testModuleId, Long testSuiteId) { - Map deserializedSpanContent = (Map) deserializedSpan.get("content") - Map deserializedMetrics = (Map) deserializedSpanContent.get("metrics") - Map deserializedMeta = (Map) deserializedSpanContent.get("meta") - - if (testSessionId != null) { - assert deserializedSpanContent.get(Tags.TEST_SESSION_ID) == testSessionId.toLong() - } else { - assert !deserializedSpanContent.containsKey(Tags.TEST_SESSION_ID) - } - - if (testModuleId != null) { - assert deserializedSpanContent.get(Tags.TEST_MODULE_ID) == testModuleId - } else { - assert !deserializedSpanContent.containsKey(Tags.TEST_MODULE_ID) - } - - if (testSuiteId != null) { - assert deserializedSpanContent.get(Tags.TEST_SUITE_ID) == testSuiteId - } else { - assert !deserializedSpanContent.containsKey(Tags.TEST_SUITE_ID) - } - - assert !deserializedMetrics.containsKey(Tags.TEST_SESSION_ID) - assert !deserializedMetrics.containsKey(Tags.TEST_MODULE_ID) - assert !deserializedMetrics.containsKey(Tags.TEST_SUITE_ID) - - assert !deserializedMeta.containsKey(Tags.TEST_SESSION_ID) - assert !deserializedMeta.containsKey(Tags.TEST_MODULE_ID) - assert !deserializedMeta.containsKey(Tags.TEST_SUITE_ID) - } - - private static Map whenASpanIsWritten(TraceGenerator.PojoSpan span) { - List trace = Collections.singletonList(span) - - CiVisibilityWellKnownTags wellKnownTags = new CiVisibilityWellKnownTags( - "runtimeid", "my-env", "language", - "my-runtime-name", "my-runtime-version", "my-runtime-vendor", - "my-os-arch", "my-os-platform", "my-os-version", "false") - CiTestCycleMapperV1 mapper = new CiTestCycleMapperV1(wellKnownTags, false) - - ByteBufferConsumer consumer = new CaptureConsumer() - MsgPackWriter packer = new MsgPackWriter(new FlushingBuffer(100 << 10, consumer)) - - packer.format(trace, mapper) - packer.flush() - - ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory()) - return (Map) objectMapper.readValue(consumer.bytes, Object) - } - - private static class CaptureConsumer implements ByteBufferConsumer { - private byte[] bytes - - @Override - void accept(int messageCount, ByteBuffer buffer) { - this.bytes = new byte[buffer.limit() - buffer.position()] - buffer.get(bytes) - } - } - - private static final class PayloadVerifier implements ByteBufferConsumer, WritableByteChannel { - - private final List> expectedTraces - private final CiTestCycleMapperV1 mapper - private final CiVisibilityWellKnownTags wellKnownTags - private ByteBuffer captured = ByteBuffer.allocate(200 << 10) - - private int position = 0 - - private PayloadVerifier(CiVisibilityWellKnownTags wellKnownTags, List> traces, CiTestCycleMapperV1 mapper) { - this.expectedTraces = traces - this.mapper = mapper - this.wellKnownTags = wellKnownTags - } - - void skipLargeTrace() { - ++position - } - - void verifyTracesConsumed() { - assertEquals(expectedTraces.size(), position) - } - - @Override - void accept(int messageCount, ByteBuffer buffer) { - if (expectedTraces.isEmpty() && messageCount == 0) { - return - } - - try { - Payload payload = mapper.newPayload().withBody(messageCount, buffer) - payload.writeTo(this) - captured.flip() - assertNotNull(payload.toRequest()) - MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(captured) - assertEquals(3, unpacker.unpackMapHeader()) - assertEquals("version", unpacker.unpackString()) - assertEquals(1, unpacker.unpackInt()) - assertEquals("metadata", unpacker.unpackString()) - assertEquals(1, unpacker.unpackMapHeader()) - assertEquals("*", unpacker.unpackString()) - - assertEquals(10, unpacker.unpackMapHeader()) - assertEquals("env", unpacker.unpackString()) - assertEquals(wellKnownTags.env as String, unpacker.unpackString()) - assertEquals("runtime-id", unpacker.unpackString()) - assertEquals(wellKnownTags.runtimeId as String, unpacker.unpackString()) - assertEquals("language", unpacker.unpackString()) - assertEquals(wellKnownTags.language as String, unpacker.unpackString()) - assertEquals(Tags.RUNTIME_NAME, unpacker.unpackString()) - assertEquals(wellKnownTags.runtimeName as String, unpacker.unpackString()) - assertEquals(Tags.RUNTIME_VENDOR, unpacker.unpackString()) - assertEquals(wellKnownTags.runtimeVendor as String, unpacker.unpackString()) - assertEquals(Tags.RUNTIME_VERSION, unpacker.unpackString()) - assertEquals(wellKnownTags.runtimeVersion as String, unpacker.unpackString()) - assertEquals(Tags.OS_ARCHITECTURE, unpacker.unpackString()) - assertEquals(wellKnownTags.osArch as String, unpacker.unpackString()) - assertEquals(Tags.OS_PLATFORM, unpacker.unpackString()) - assertEquals(wellKnownTags.osPlatform as String, unpacker.unpackString()) - assertEquals(Tags.OS_VERSION, unpacker.unpackString()) - assertEquals(wellKnownTags.osVersion as String, unpacker.unpackString()) - assertEquals(DDTags.TEST_IS_USER_PROVIDED_SERVICE, unpacker.unpackString()) - assertEquals(wellKnownTags.isUserProvidedService as String, unpacker.unpackString()) - - assertEquals("events", unpacker.unpackString()) - - List expectedTrace = expectedTraces.get(position++) - int eventCount = unpacker.unpackArrayHeader() - while (expectedTrace.size() < eventCount) { - expectedTrace.addAll(expectedTraces.get(position++)) - } - assertEquals(expectedTrace.size(), eventCount) - for (int k = 0; k < eventCount; ++k) { - TraceGenerator.PojoSpan expectedSpan = expectedTrace.get(k) - assertEquals(3, unpacker.unpackMapHeader()) - assertEquals("type", unpacker.unpackString()) - if ("test" == expectedSpan.getType()) { - assertEquals("test", unpacker.unpackString()) - } else { - assertEquals("span", unpacker.unpackString()) - } - assertEquals("version", unpacker.unpackString()) - assertEquals(1, unpacker.unpackInt()) - assertEquals("content", unpacker.unpackString()) - assertEquals(11, unpacker.unpackMapHeader()) - assertEquals("trace_id", unpacker.unpackString()) - long traceId = unpacker.unpackValue().asNumberValue().toLong() - assertEquals(expectedSpan.getTraceId().toLong(), traceId) - assertEquals("span_id", unpacker.unpackString()) - long spanId = unpacker.unpackValue().asNumberValue().toLong() - assertEquals(expectedSpan.getSpanId(), spanId) - assertEquals("parent_id", unpacker.unpackString()) - long parentId = unpacker.unpackValue().asNumberValue().toLong() - assertEquals(expectedSpan.getParentId(), parentId) - assertEquals("service", unpacker.unpackString()) - String serviceName = unpacker.unpackString() - assertEqualsWithNullAsEmpty(expectedSpan.getServiceName(), serviceName) - assertEquals("name", unpacker.unpackString()) - String operationName = unpacker.unpackString() - assertEqualsWithNullAsEmpty(expectedSpan.getOperationName(), operationName) - assertEquals("resource", unpacker.unpackString()) - String resourceName = unpacker.unpackString() - assertEqualsWithNullAsEmpty(expectedSpan.getResourceName(), resourceName) - - assertEquals("start", unpacker.unpackString()) - long startTime = unpacker.unpackLong() - assertEquals(expectedSpan.getStartTime(), startTime) - assertEquals("duration", unpacker.unpackString()) - long duration = unpacker.unpackLong() - assertEquals(expectedSpan.getDurationNano(), duration) - assertEquals("error", unpacker.unpackString()) - int error = unpacker.unpackInt() - assertEquals(expectedSpan.getError(), error) - assertEquals("metrics", unpacker.unpackString()) - int metricsSize = unpacker.unpackMapHeader() - HashMap metrics = new HashMap<>() - for (int j = 0; j < metricsSize; ++j) { - String key = unpacker.unpackString() - Number n = null - MessageFormat format = unpacker.getNextFormat() - switch (format) { - case NEGFIXINT: - case POSFIXINT: - case INT8: - case UINT8: - case INT16: - case UINT16: - case INT32: - case UINT32: - n = unpacker.unpackInt() - break - case INT64: - case UINT64: - n = unpacker.unpackLong() - break - case FLOAT32: - n = unpacker.unpackFloat() - break - case FLOAT64: - n = unpacker.unpackDouble() - break - default: - Assertions.fail("Unexpected type in metrics values: " + format) - } - if (DD_MEASURED.toString() == key) { - assert ((n == 1) && expectedSpan.isMeasured()) || !expectedSpan.isMeasured() - } else if (DDSpanContext.PRIORITY_SAMPLING_KEY == key) { - //check that priority sampling is only on first and last span - if (k == 0 || k == eventCount - 1) { - assertEquals(expectedSpan.samplingPriority(), n.intValue()) - } else { - assertFalse(expectedSpan.hasSamplingPriority()) - } - } else { - metrics.put(key, n) - } - } - for (Map.Entry metric : metrics.entrySet()) { - if (metric.getValue() instanceof Double || metric.getValue() instanceof Float) { - assertEquals(((Number) expectedSpan.getTag(metric.getKey())).doubleValue(), metric.getValue().doubleValue(), 0.001) - } else { - assertEquals(expectedSpan.getTag(metric.getKey()), metric.getValue()) - } - } - assertEquals("meta", unpacker.unpackString()) - int metaSize = unpacker.unpackMapHeader() - HashMap meta = new HashMap<>() - for (int j = 0; j < metaSize; ++j) { - meta.put(unpacker.unpackString(), unpacker.unpackString()) - } - for (Map.Entry entry : meta.entrySet()) { - if (Tags.HTTP_STATUS.equals(entry.getKey())) { - assertEquals(String.valueOf(expectedSpan.getHttpStatusCode()), entry.getValue()) - } else { - Object tag = expectedSpan.getTag(entry.getKey()) - if (null != tag) { - assertEquals(String.valueOf(tag), entry.getValue()) - } else { - assertEquals(expectedSpan.getBaggage().get(entry.getKey()), entry.getValue()) - } - } - } - } - } catch (IOException e) { - Assertions.fail(e.getMessage()) - } finally { - mapper.reset() - captured.position(0) - captured.limit(captured.capacity()) - } - } - - @Override - int write(ByteBuffer src) throws IOException { - if (captured.remaining() < src.remaining()) { - ByteBuffer newBuffer = ByteBuffer.allocate(captured.capacity() + src.capacity()) - captured.flip() - newBuffer.put(captured) - captured = newBuffer - return write(src) - } - captured.put(src) - return src.position() - } - - @Override - boolean isOpen() { - return true - } - - @Override - void close() throws IOException {} - } - - private static void assertEqualsWithNullAsEmpty(CharSequence expected, CharSequence actual) { - if (null == expected) { - assertEquals("", actual) - } else { - assertEquals(expected.toString(), actual.toString()) - } - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/common/metrics/AggregateMetricTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/common/metrics/AggregateMetricTest.groovy deleted file mode 100644 index 0b245552db3..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/common/metrics/AggregateMetricTest.groovy +++ /dev/null @@ -1,188 +0,0 @@ -package datadog.trace.common.metrics - -import datadog.metrics.agent.AgentMeter -import datadog.metrics.impl.DDSketchHistograms -import datadog.metrics.impl.MonitoringImpl -import datadog.metrics.api.statsd.StatsDClient -import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString -import datadog.trace.test.util.DDSpecification - -import java.util.concurrent.BlockingDeque -import java.util.concurrent.CountDownLatch -import java.util.concurrent.ExecutorService -import java.util.concurrent.Executors -import java.util.concurrent.LinkedBlockingDeque -import java.util.concurrent.TimeUnit -import java.util.concurrent.atomic.AtomicInteger -import java.util.concurrent.atomic.AtomicLongArray - -import static datadog.trace.common.metrics.AggregateMetric.ERROR_TAG -import static datadog.trace.common.metrics.AggregateMetric.TOP_LEVEL_TAG - -class AggregateMetricTest extends DDSpecification { - - def setupSpec() { - // Initialize AgentMeter with monitoring - this is the standard mechanism used in production - def monitoring = new MonitoringImpl(StatsDClient.NO_OP, 1, TimeUnit.SECONDS) - AgentMeter.registerIfAbsent(StatsDClient.NO_OP, monitoring, DDSketchHistograms.FACTORY) - // Create a timer to trigger DDSketchHistograms loading and Factory registration - // This simulates what happens during CoreTracer initialization (traceWriteTimer) - monitoring.newTimer("test.init") - } - - def "record durations sums up to total"() { - given: - AggregateMetric aggregate = new AggregateMetric() - when: - aggregate.recordDurations(3, new AtomicLongArray(1, 2, 3)) - then: - aggregate.getDuration() == 6 - } - - def "total durations include errors"() { - given: - AggregateMetric aggregate = new AggregateMetric() - when: - aggregate.recordDurations(3, new AtomicLongArray(1, 2, 3)) - then: - aggregate.getDuration() == 6 - } - - def "clear"() { - given: - AggregateMetric aggregate = new AggregateMetric() - .recordDurations(3, new AtomicLongArray(5, ERROR_TAG | 6, TOP_LEVEL_TAG | 7)) - when: - aggregate.clear() - then: - aggregate.getDuration() == 0 - aggregate.getErrorCount() == 0 - aggregate.getTopLevelCount() == 0 - aggregate.getHitCount() == 0 - } - - def "contribute batch with key to aggregate"() { - given: - AggregateMetric aggregate = new AggregateMetric().recordDurations(3, new AtomicLongArray(0L, 0L, 0L | ERROR_TAG | TOP_LEVEL_TAG)) - - Batch batch = new Batch().reset(new MetricKey("foo", "bar", "qux", null, "type", 0, false, true, "corge", [UTF8BytesString.create("grault:quux")], null, null, null)) - batch.add(0L, 10) - batch.add(0L, 10) - batch.add(0L, 10) - - when: - batch.contributeTo(aggregate) - - then: "batch used and values contributed to existing aggregate" - batch.isUsed() - aggregate.getDuration() == 30 - aggregate.getHitCount() == 6 - aggregate.getErrorCount() == 1 - aggregate.getTopLevelCount() == 1 - } - - def "ignore used batches"() { - given: - AggregateMetric aggregate = new AggregateMetric().recordDurations(10, - new AtomicLongArray(1L, 1L, 1L, 1L, 1L, 1L, 1L | TOP_LEVEL_TAG, 1L, 1L, 1L | ERROR_TAG)) - - - Batch batch = new Batch() - batch.contributeTo(aggregate) - // must be used now - batch.add(0L, 10) - - when: - batch.contributeTo(aggregate) - - then: "batch ignored" - aggregate.getDuration() == 10 - aggregate.getHitCount() == 10 - aggregate.getErrorCount() == 1 - aggregate.getTopLevelCount() == 1 - } - - def "ignore trailing zeros"() { - given: - AggregateMetric aggregate = new AggregateMetric() - when: - aggregate.recordDurations(3, new AtomicLongArray(1, 2, 3, 0, 0, 0)) - then: - aggregate.getDuration() == 6 - aggregate.getHitCount() == 3 - aggregate.getErrorCount() == 0 - } - - def "hit count includes errors"() { - given: - AggregateMetric aggregate = new AggregateMetric() - when: - aggregate.recordDurations(3, new AtomicLongArray(1, 2, 3 | ERROR_TAG)) - then: - aggregate.getHitCount() == 3 - aggregate.getErrorCount() == 1 - } - - def "ok and error durations tracked separately"() { - given: - AggregateMetric aggregate = new AggregateMetric() - when: - aggregate.recordDurations(10, - new AtomicLongArray(1, 100 | ERROR_TAG, 2, 99 | ERROR_TAG, 3, - 98 | ERROR_TAG, 4, 97 | ERROR_TAG)) - then: - def errorLatencies = aggregate.getErrorLatencies() - def okLatencies = aggregate.getOkLatencies() - errorLatencies.getMaxValue() >= 99 - okLatencies.getMaxValue() <= 5 - } - - def "consistent under concurrent attempts to read and write"() { - given: - AggregateMetric aggregate = new AggregateMetric() - MetricKey key = new MetricKey("foo", "bar", "qux", null, "type", 0, false, true, "corge", [UTF8BytesString.create("grault:quux")], null, null, null) - BlockingDeque queue = new LinkedBlockingDeque<>(1000) - ExecutorService reader = Executors.newSingleThreadExecutor() - int writerCount = 10 - ExecutorService writers = Executors.newFixedThreadPool(writerCount) - CountDownLatch readerLatch = new CountDownLatch(1) - CountDownLatch writerLatch = new CountDownLatch(writerCount) - CountDownLatch queueEmptyLatch = new CountDownLatch(1) - - AtomicInteger written = new AtomicInteger(0) - - when: - for (int i = 0; i < writerCount; ++i) { - writers.submit({ - readerLatch.await() - for (int j = 0; j < 10_000; ++j) { - Batch batch = queue.peekLast() - if (batch?.add(0L, 1)) { - written.incrementAndGet() - } else { - queue.offer(new Batch().reset(key)) - } - } - writerLatch.countDown() - }) - } - def future = reader.submit({ - readerLatch.countDown() - while (!Thread.currentThread().isInterrupted()) { - Batch batch = queue.poll(100, TimeUnit.MILLISECONDS) - if (null == batch && writerLatch.count == 0) { - queueEmptyLatch.countDown() - } else if (null != batch) { - batch.contributeTo(aggregate) - } - } - }) - assert writerLatch.await(10, TimeUnit.SECONDS) - // Wait here until we know that the queue is empty - assert queueEmptyLatch.await(10, TimeUnit.SECONDS) - future.cancel(true) - - then: - aggregate.getHitCount() == written.get() - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/common/metrics/ClientStatsAggregatorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/common/metrics/ClientStatsAggregatorTest.groovy new file mode 100644 index 00000000000..2f409d7baa5 --- /dev/null +++ b/dd-trace-core/src/test/groovy/datadog/trace/common/metrics/ClientStatsAggregatorTest.groovy @@ -0,0 +1,1717 @@ +package datadog.trace.common.metrics + +import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND +import datadog.trace.bootstrap.instrumentation.api.InstrumentationTags +import static java.util.concurrent.TimeUnit.MILLISECONDS +import static java.util.concurrent.TimeUnit.SECONDS + +import datadog.communication.ddagent.DDAgentFeaturesDiscovery +import datadog.trace.api.WellKnownTags +import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString +import datadog.trace.core.CoreSpan +import datadog.trace.core.monitor.HealthMetrics +import datadog.trace.test.util.DDSpecification +import java.util.concurrent.CompletableFuture +import java.util.concurrent.CountDownLatch +import java.util.concurrent.TimeUnit +import java.util.concurrent.TimeoutException +import java.util.function.Supplier +import spock.lang.Shared + +class ClientStatsAggregatorTest extends DDSpecification { + + def setup() { + AggregateEntry.resetCardinalityHandlers() + } + + static Set empty = new HashSet<>() + + static final int HTTP_OK = 200 + + @Shared + long reportingInterval = 1 + @Shared + int queueSize = 256 + + def "should ignore traces with no measured spans"() { + setup: + Sink sink = Mock(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> true + WellKnownTags wellKnownTags = new WellKnownTags("runtimeid", "hostname", "env", "service", "version", "language") + ClientStatsAggregator aggregator = new ClientStatsAggregator( + wellKnownTags, + empty, + features, + HealthMetrics.NO_OP, + sink, + 10, + queueSize, + 1, + MILLISECONDS, false + ) + aggregator.start() + + aggregator.publish([new SimpleSpan("", "", "", "", false, false, false, 0, 0, HTTP_OK)]) + when: + reportAndWaitUntilEmpty(aggregator) + then: + 0 * sink._ + + cleanup: + aggregator.close() + } + + def "should ignore traces with ignored resource names"() { + setup: + String ignoredResourceName = "foo" + Sink sink = Mock(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> true + WellKnownTags wellKnownTags = new WellKnownTags("runtimeid", "hostname", "env", "service", "version", "language") + ClientStatsAggregator aggregator = new ClientStatsAggregator( + wellKnownTags, + [ignoredResourceName].toSet(), + features, + HealthMetrics.NO_OP, + sink, + 10, + queueSize, + 1, + MILLISECONDS, false + ) + aggregator.start() + + when: "publish ignored resource names" + aggregator.publish([new SimpleSpan("", "", ignoredResourceName, "", true, true, false, 0, 0, HTTP_OK)]) + aggregator.publish([ + new SimpleSpan("", "", UTF8BytesString.create(ignoredResourceName), "", true, true, false, 0, 0, HTTP_OK) + ]) + aggregator.publish([ + new SimpleSpan("", "", ignoredResourceName, "", true, true, false, 0, 0, HTTP_OK), + new SimpleSpan("", "", + "measured, not ignored, but child of ignored, so should be ignored", "", true, true, false, 0, 0, HTTP_OK) + ]) + reportAndWaitUntilEmpty(aggregator) + then: + 0 * sink._ + + cleanup: + aggregator.close() + } + + def "should be resilient to null resource names"() { + setup: + MetricWriter writer = Mock(MetricWriter) + Sink sink = Stub(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> true + features.peerTags() >> [] + ClientStatsAggregator aggregator = new ClientStatsAggregator(empty, + features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, false) + aggregator.start() + + when: + CountDownLatch latch = new CountDownLatch(1) + aggregator.publish([ + new SimpleSpan("service", "operation", null, "type", false, true, false, 0, 100, HTTP_OK) + .setTag(SPAN_KIND, "baz") + ]) + aggregator.report() + def latchTriggered = latch.await(2, SECONDS) + + then: + latchTriggered + 1 * writer.startBucket(1, _, _) + 1 * writer.add({ + AggregateEntryTestUtils.equals(it,AggregateEntryTestUtils.of( + null, + "service", + "operation", + null, + "type", + HTTP_OK, + false, + false, + "baz", + [], + null, + null, + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getTopLevelCount() == 1 && e.getDuration() == 100 + } + 1 * writer.finishBucket() >> { latch.countDown() } + + cleanup: + aggregator.close() + } + + def "unmeasured top level spans have metrics computed"() { + setup: + MetricWriter writer = Mock(MetricWriter) + Sink sink = Stub(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> true + features.peerTags() >> [] + ClientStatsAggregator aggregator = new ClientStatsAggregator(empty, + features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, false) + aggregator.start() + + when: + CountDownLatch latch = new CountDownLatch(1) + aggregator.publish([ + new SimpleSpan("service", "operation", "resource", "type", false, true, false, 0, 100, HTTP_OK) + .setTag(SPAN_KIND, "baz") + ]) + aggregator.report() + def latchTriggered = latch.await(2, SECONDS) + + then: + latchTriggered + 1 * writer.startBucket(1, _, _) + 1 * writer.add({ + AggregateEntryTestUtils.equals(it,AggregateEntryTestUtils.of( + "resource", + "service", + "operation", + null, + "type", + HTTP_OK, + false, + false, + "baz", + [], + null, + null, + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getTopLevelCount() == 1 && e.getDuration() == 100 + } + 1 * writer.finishBucket() >> { latch.countDown() } + + cleanup: + aggregator.close() + } + + def "should compute stats for span kind #kind"() { + setup: + MetricWriter writer = Mock(MetricWriter) + Sink sink = Stub(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> true + features.peerTags() >> [] + ClientStatsAggregator aggregator = new ClientStatsAggregator(empty, + features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, true) + aggregator.start() + + when: + CountDownLatch latch = new CountDownLatch(1) + def span = new SimpleSpan("service", "operation", "resource", "type", false, false, false, 0, 100, HTTP_OK) + .setTag(SPAN_KIND, kind) + if (httpMethod != null) { + span.setTag("http.method", httpMethod) + } + if (httpEndpoint != null) { + span.setTag("http.endpoint", httpEndpoint) + } + aggregator.publish([span]) + aggregator.report() + def latchTriggered = latch.await(2, SECONDS) + + then: + latchTriggered == statsComputed + (statsComputed ? 1 : 0) * writer.startBucket(1, _, _) + (statsComputed ? 1 : 0) * writer.add({ + AggregateEntryTestUtils.equals(it, + AggregateEntryTestUtils.of( + "resource", + "service", + "operation", + null, + "type", + HTTP_OK, + false, + false, + kind, + [], + httpMethod, + httpEndpoint, + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getTopLevelCount() == 0 && e.getDuration() == 100 + } + (statsComputed ? 1 : 0) * writer.finishBucket() >> { latch.countDown() } + + cleanup: + aggregator.close() + + where: + kind | httpMethod | httpEndpoint | statsComputed + "client" | null | null | true + "producer" | null | null | true + "consumer" | null | null | true + UTF8BytesString.create("server") | null | null | true + "internal" | null | null | false + null | null | null | false + "server" | "GET" | "/api/users/:id" | true + "server" | "POST" | "/api/orders" | true + "server" | "DELETE" | "/api/products/:id" | true + "client" | "GET" | "/external/api" | true + } + + def "should create separate buckets for distinct peer tag values"() { + // Peer-tag NAMES are configured per-tracer and stable for the duration of a trace publish; + // peer-tag VALUES vary per-span. Two spans with the same names but different values should + // produce two distinct aggregate buckets. + setup: + MetricWriter writer = Mock(MetricWriter) + Sink sink = Stub(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> true + features.peerTags() >> ["country", "georegion"] + ClientStatsAggregator aggregator = new ClientStatsAggregator(empty, + features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, false) + aggregator.start() + + when: + CountDownLatch latch = new CountDownLatch(1) + aggregator.publish([ + new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, 100, HTTP_OK) + .setTag(SPAN_KIND, "client").setTag("country", "france").setTag("georegion", "europe"), + new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, 100, HTTP_OK) + .setTag(SPAN_KIND, "client").setTag("country", "germany").setTag("georegion", "europe") + ]) + aggregator.report() + def latchTriggered = latch.await(2, SECONDS) + + then: + latchTriggered + 1 * writer.startBucket(2, _, _) + 1 * writer.add({ + AggregateEntryTestUtils.equals(it, + AggregateEntryTestUtils.of( + "resource", + "service", + "operation", + null, + "type", + HTTP_OK, + false, + false, + "client", + [UTF8BytesString.create("country:france"), UTF8BytesString.create("georegion:europe")], + null, + null, + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getTopLevelCount() == 0 && e.getDuration() == 100 + } + 1 * writer.add({ + AggregateEntryTestUtils.equals(it, + AggregateEntryTestUtils.of( + "resource", + "service", + "operation", + null, + "type", + HTTP_OK, + false, + false, + "client", + [UTF8BytesString.create("country:germany"), UTF8BytesString.create("georegion:europe")], + null, + null, + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getTopLevelCount() == 0 && e.getDuration() == 100 + } + 1 * writer.finishBucket() >> { latch.countDown() } + + cleanup: + aggregator.close() + } + + def "should aggregate the right peer tags for kind #kind"() { + setup: + MetricWriter writer = Mock(MetricWriter) + Sink sink = Stub(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> true + features.peerTags() >> ["peer.hostname", "_dd.base_service"] + ClientStatsAggregator aggregator = new ClientStatsAggregator(empty, + features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, false) + aggregator.start() + + when: + CountDownLatch latch = new CountDownLatch(1) + aggregator.publish([ + new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, 100, HTTP_OK) + .setTag(SPAN_KIND, kind).setTag("peer.hostname", "localhost").setTag("_dd.base_service", UTF8BytesString.create("test")) + ]) + aggregator.report() + def latchTriggered = latch.await(2, SECONDS) + + then: + latchTriggered + 1 * writer.startBucket(1, _, _) + 1 * writer.add({ + AggregateEntryTestUtils.equals(it, + AggregateEntryTestUtils.of( + "resource", + "service", + "operation", + null, + "type", + HTTP_OK, + false, + false, + kind, + expectedPeerTags, + null, + null, + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getTopLevelCount() == 0 && e.getDuration() == 100 + } + 1 * writer.finishBucket() >> { latch.countDown() } + + cleanup: + aggregator.close() + + where: + kind | expectedPeerTags + "client" | [UTF8BytesString.create("peer.hostname:localhost"), UTF8BytesString.create("_dd.base_service:test")] + "internal" | [UTF8BytesString.create("_dd.base_service:test")] + "server" | [] + } + + def "measured spans do not contribute to top level count"() { + setup: + MetricWriter writer = Mock(MetricWriter) + Sink sink = Stub(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> true + features.peerTags() >> [] + ClientStatsAggregator aggregator = new ClientStatsAggregator(empty, features, HealthMetrics.NO_OP, + sink, writer, 10, queueSize, reportingInterval, SECONDS, false) + aggregator.start() + + when: + CountDownLatch latch = new CountDownLatch(1) + aggregator.publish([ + new SimpleSpan("service", "operation", "resource", "type", measured, topLevel, false, 0, 100, HTTP_OK) + .setTag(SPAN_KIND, "baz") + ]) + aggregator.report() + def latchTriggered = latch.await(2, SECONDS) + + then: + latchTriggered + 1 * writer.startBucket(1, _, _) + 1 * writer.add({ + AggregateEntryTestUtils.equals(it,AggregateEntryTestUtils.of( + "resource", + "service", + "operation", + null, + "type", + HTTP_OK, + false, + false, + "baz", + [], + null, + null, + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getTopLevelCount() == topLevelCount && e.getDuration() == 100 + } + 1 * writer.finishBucket() >> { latch.countDown() } + + cleanup: + aggregator.close() + + where: + measured | topLevel | topLevelCount + true | false | 0 + true | true | 1 + false | true | 1 + } + + def "aggregate repetitive spans"() { + setup: + MetricWriter writer = Mock(MetricWriter) + Sink sink = Stub(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> true + features.peerTags() >> [] + ClientStatsAggregator aggregator = new ClientStatsAggregator(empty, + features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, false) + long duration = 100 + List trace = [ + new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, duration, HTTP_OK).setTag(SPAN_KIND, "baz"), + new SimpleSpan("service1", "operation1", "resource1", "type", false, false, false, 0, 0, HTTP_OK).setTag(SPAN_KIND, "baz"), + new SimpleSpan("service2", "operation2", "resource2", "type", true, false, false, 0, duration * 2, HTTP_OK).setTag(SPAN_KIND, "baz") + ] + aggregator.start() + + + when: + CountDownLatch latch = new CountDownLatch(1) + for (int i = 0; i < count; ++i) { + aggregator.publish(trace) + } + aggregator.report() + def latchTriggered = latch.await(2, SECONDS) + + then: "metrics should be conflated" + latchTriggered + 1 * writer.finishBucket() >> { latch.countDown() } + 1 * writer.startBucket(2, _, SECONDS.toNanos(reportingInterval)) + 1 * writer.add({ + AggregateEntryTestUtils.equals(it,AggregateEntryTestUtils.of( + "resource", + "service", + "operation", + null, + "type", + HTTP_OK, + false, + false, + "baz", + [], + null, + null, + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == count && e.getDuration() == count * duration + } + 1 * writer.add({ + AggregateEntryTestUtils.equals(it,AggregateEntryTestUtils.of( + "resource2", + "service2", + "operation2", + null, + "type", + HTTP_OK, + false, + false, + "baz", + [], + null, + null, + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == count && e.getDuration() == count * duration * 2 + } + + cleanup: + aggregator.close() + + where: + count << [10, 100] + } + + def "aggregate spans with same HTTP endpoint together, separate different endpoints"() { + setup: + MetricWriter writer = Mock(MetricWriter) + Sink sink = Stub(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> true + features.peerTags() >> [] + ClientStatsAggregator aggregator = new ClientStatsAggregator(empty, + features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, true) + aggregator.start() + + when: "publish multiple spans with same endpoint" + CountDownLatch latch = new CountDownLatch(1) + int count = 5 + long duration = 100 + for (int i = 0; i < count; ++i) { + aggregator.publish([ + new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, duration, HTTP_OK) + .setTag(SPAN_KIND, "server") + .setTag("http.method", "GET") + .setTag("http.endpoint", "/api/users/:id") + ]) + } + aggregator.report() + def latchTriggered = latch.await(2, SECONDS) + + then: "should aggregate into single metric" + latchTriggered + 1 * writer.startBucket(1, _, _) + 1 * writer.add({ + AggregateEntryTestUtils.equals(it,AggregateEntryTestUtils.of( + "resource", + "service", + "operation", + null, + "type", + HTTP_OK, + false, + false, + "server", + [], + "GET", + "/api/users/:id", + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == count && e.getDuration() == count * duration + } + 1 * writer.finishBucket() >> { latch.countDown() } + + when: "publish spans with different endpoints" + CountDownLatch latch2 = new CountDownLatch(1) + aggregator.publish([ + new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, duration, HTTP_OK) + .setTag(SPAN_KIND, "server") + .setTag("http.method", "GET") + .setTag("http.endpoint", "/api/users/:id"), + new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, duration * 2, HTTP_OK) + .setTag(SPAN_KIND, "server") + .setTag("http.method", "GET") + .setTag("http.endpoint", "/api/orders/:id"), + new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, duration * 3, HTTP_OK) + .setTag(SPAN_KIND, "server") + .setTag("http.method", "POST") + .setTag("http.endpoint", "/api/users/:id") + ]) + aggregator.report() + def latchTriggered2 = latch2.await(2, SECONDS) + + then: "should create separate metrics for each endpoint/method combination" + latchTriggered2 + 1 * writer.startBucket(3, _, _) + 1 * writer.add({ + AggregateEntryTestUtils.equals(it,AggregateEntryTestUtils.of( + "resource", + "service", + "operation", + null, + "type", + HTTP_OK, + false, + false, + "server", + [], + "GET", + "/api/users/:id", + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getDuration() == duration + } + 1 * writer.add({ + AggregateEntryTestUtils.equals(it,AggregateEntryTestUtils.of( + "resource", + "service", + "operation", + null, + "type", + HTTP_OK, + false, + false, + "server", + [], + "GET", + "/api/orders/:id", + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getDuration() == duration * 2 + } + 1 * writer.add({ + AggregateEntryTestUtils.equals(it,AggregateEntryTestUtils.of( + "resource", + "service", + "operation", + null, + "type", + HTTP_OK, + false, + false, + "server", + [], + "POST", + "/api/users/:id", + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getDuration() == duration * 3 + } + 1 * writer.finishBucket() >> { latch2.countDown() } + + cleanup: + aggregator.close() + } + + def "create separate metrics for different HTTP method/endpoint/status combinations"() { + setup: + MetricWriter writer = Mock(MetricWriter) + Sink sink = Stub(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> true + features.peerTags() >> [] + ClientStatsAggregator aggregator = new ClientStatsAggregator(empty, + features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, true) + aggregator.start() + + when: "publish spans with different combinations" + CountDownLatch latch = new CountDownLatch(1) + long duration = 100 + aggregator.publish([ + // Same endpoint, different methods + new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, duration, 200) + .setTag(SPAN_KIND, "server") + .setTag("http.method", "GET") + .setTag("http.endpoint", "/api/users/:id"), + new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, duration * 2, 200) + .setTag(SPAN_KIND, "server") + .setTag("http.method", "POST") + .setTag("http.endpoint", "/api/users/:id"), + // Same method/endpoint, different status + new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, duration * 3, 404) + .setTag(SPAN_KIND, "server") + .setTag("http.method", "GET") + .setTag("http.endpoint", "/api/users/:id"), + // Different endpoint + new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, duration * 4, 200) + .setTag(SPAN_KIND, "server") + .setTag("http.method", "GET") + .setTag("http.endpoint", "/api/orders/:id") + ]) + aggregator.report() + def latchTriggered = latch.await(2, SECONDS) + + then: "should create 4 separate metrics" + latchTriggered + 1 * writer.startBucket(4, _, _) + 1 * writer.add({ + AggregateEntryTestUtils.equals(it,AggregateEntryTestUtils.of( + "resource", + "service", + "operation", + null, + "type", + 200, + false, + false, + "server", + [], + "GET", + "/api/users/:id", + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getDuration() == duration + } + 1 * writer.add({ + AggregateEntryTestUtils.equals(it,AggregateEntryTestUtils.of( + "resource", + "service", + "operation", + null, + "type", + 200, + false, + false, + "server", + [], + "POST", + "/api/users/:id", + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getDuration() == duration * 2 + } + 1 * writer.add({ + AggregateEntryTestUtils.equals(it,AggregateEntryTestUtils.of( + "resource", + "service", + "operation", + null, + "type", + 404, + false, + false, + "server", + [], + "GET", + "/api/users/:id", + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getDuration() == duration * 3 + } + 1 * writer.add({ + AggregateEntryTestUtils.equals(it,AggregateEntryTestUtils.of( + "resource", + "service", + "operation", + null, + "type", + 200, + false, + false, + "server", + [], + "GET", + "/api/orders/:id", + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getDuration() == duration * 4 + } + 1 * writer.finishBucket() >> { latch.countDown() } + + cleanup: + aggregator.close() + } + + def "handle spans without HTTP endpoint tags for backward compatibility"() { + setup: + MetricWriter writer = Mock(MetricWriter) + Sink sink = Stub(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> true + features.peerTags() >> [] + ClientStatsAggregator aggregator = new ClientStatsAggregator(empty, + features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, true) + aggregator.start() + + when: "publish spans with and without HTTP tags" + CountDownLatch latch = new CountDownLatch(1) + long duration = 100 + aggregator.publish([ + // Span without HTTP tags (legacy behavior) + new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, duration, 200) + .setTag(SPAN_KIND, "server"), + // Span with HTTP tags (new behavior) + new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, duration * 2, 200) + .setTag(SPAN_KIND, "server") + .setTag("http.method", "GET") + .setTag("http.endpoint", "/api/users/:id") + ]) + aggregator.report() + def latchTriggered = latch.await(2, SECONDS) + + then: "should create separate metric keys for spans with and without HTTP tags" + latchTriggered + 1 * writer.startBucket(2, _, _) + 1 * writer.add({ + AggregateEntryTestUtils.equals(it,AggregateEntryTestUtils.of( + "resource", + "service", + "operation", + null, + "type", + 200, + false, + false, + "server", + [], + null, + null, + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getDuration() == duration + } + 1 * writer.add({ + AggregateEntryTestUtils.equals(it,AggregateEntryTestUtils.of( + "resource", + "service", + "operation", + null, + "type", + 200, + false, + false, + "server", + [], + "GET", + "/api/users/:id", + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getDuration() == duration * 2 + } + 1 * writer.finishBucket() >> { latch.countDown() } + + cleanup: + aggregator.close() + } + + def "gather the service name source when the span is published"() { + setup: + MetricWriter writer = Mock(MetricWriter) + Sink sink = Stub(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> true + features.peerTags() >> [] + ClientStatsAggregator aggregator = new ClientStatsAggregator(empty, + features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, false) + aggregator.start() + + when: "publish spans with different service name source" + CountDownLatch latch = new CountDownLatch(1) + long duration = 100 + aggregator.publish([ + new SimpleSpan("service", "operation", "resource", "type", true, true, false, 0, duration, 200, false, 0, "source") + .setTag(SPAN_KIND, "server"), + new SimpleSpan("service", "operation", "resource", "type", true, true, false, 0, duration, 200, false, 0, null) + .setTag(SPAN_KIND, "server"), + new SimpleSpan("service", "operation", "resource", "type", true, true, false, 0, duration, 200, false, 0, "source") + .setTag(SPAN_KIND, "server") + ]) + aggregator.report() + def latchTriggered = latch.await(2, SECONDS) + + then: "should create the different metric keys for spans with and without sources" + latchTriggered + 1 * writer.startBucket(2, _, _) + 1 * writer.add({ + AggregateEntryTestUtils.equals(it,AggregateEntryTestUtils.of( + "resource", + "service", + "operation", + "source", + "type", + 200, + false, + false, + "server", + [], + null, + null, + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == 2 && e.getDuration() == 2 * duration + } + 1 * writer.add({ + AggregateEntryTestUtils.equals(it,AggregateEntryTestUtils.of( + "resource", + "service", + "operation", + null, + "type", + 200, + false, + false, + "server", + [], + null, + null, + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getDuration() == duration + } + 1 * writer.finishBucket() >> { latch.countDown() } + + cleanup: + aggregator.close() + } + + def "new aggregates beyond size limit are dropped when no stale entries can be evicted"() { + // The table only evicts entries with hitCount == 0 to make room. When all entries are live + // (all have been recorded against), an over-cap insert drops the new key rather than evicting + // an established one. This protects the data we've already collected from a burst of new keys. + setup: + int maxAggregates = 10 + MetricWriter writer = Mock(MetricWriter) + Sink sink = Stub(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> true + features.peerTags() >> [] + ClientStatsAggregator aggregator = new ClientStatsAggregator(empty, + features, HealthMetrics.NO_OP, sink, writer, maxAggregates, queueSize, reportingInterval, SECONDS, false) + long duration = 100 + aggregator.start() + + when: + CountDownLatch latch = new CountDownLatch(1) + for (int i = 0; i < 11; ++i) { + aggregator.publish([ + new SimpleSpan("service" + i, "operation", "resource", "type", false, true, false, 0, duration, HTTP_OK) + .setTag(SPAN_KIND, "baz") + ]) + } + aggregator.report() + def latchTriggered = latch.await(2, SECONDS) + + then: "the established service0..service9 are reported; service10 is dropped" + latchTriggered + 1 * writer.startBucket(10, _, SECONDS.toNanos(reportingInterval)) + for (int i = 0; i < 10; ++i) { + def expected = AggregateEntryTestUtils.of( + "resource", + "service" + i, + "operation", + null, + "type", + HTTP_OK, + false, + false, + "baz", + [], + null, + null, + null) + 1 * writer.add({ AggregateEntryTestUtils.equals(it, expected) }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getDuration() == duration + } + } + 0 * writer.add({ + AggregateEntryTestUtils.equals(it,AggregateEntryTestUtils.of( + "resource", + "service10", + "operation", + null, + "type", + HTTP_OK, + false, + false, + "baz", + [], + null, + null, + null + )) + }) + 1 * writer.finishBucket() >> { latch.countDown() } + + cleanup: + aggregator.close() + } + + def "should report dropped aggregate to health metrics on LRU eviction"() { + setup: + int maxAggregates = 10 + MetricWriter writer = Mock(MetricWriter) + Sink sink = Stub(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> true + features.peerTags() >> [] + HealthMetrics healthMetrics = Mock(HealthMetrics) + ClientStatsAggregator aggregator = new ClientStatsAggregator(empty, + features, healthMetrics, sink, writer, maxAggregates, queueSize, reportingInterval, SECONDS, false) + long duration = 100 + aggregator.start() + + when: + CountDownLatch latch = new CountDownLatch(1) + for (int i = 0; i < maxAggregates + 1; ++i) { + aggregator.publish([ + new SimpleSpan("service" + i, "operation", "resource", "type", false, true, false, 0, duration, HTTP_OK) + .setTag(SPAN_KIND, "baz") + ]) + } + aggregator.report() + def latchTriggered = latch.await(2, SECONDS) + + then: + latchTriggered + 1 * writer.finishBucket() >> { latch.countDown() } + 1 * healthMetrics.onStatsAggregateDropped() + + cleanup: + aggregator.close() + } + + def "should not report dropped aggregate when evicted entry was already flushed"() { + setup: + int maxAggregates = 5 + MetricWriter writer = Mock(MetricWriter) + Sink sink = Stub(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> true + features.peerTags() >> [] + HealthMetrics healthMetrics = Mock(HealthMetrics) + ClientStatsAggregator aggregator = new ClientStatsAggregator(empty, + features, healthMetrics, sink, writer, maxAggregates, queueSize, reportingInterval, SECONDS, false) + aggregator.start() + + when: "fill cache and flush — entries are cleared (hitCount=0) but stay in the LRU" + CountDownLatch latch1 = new CountDownLatch(1) + for (int i = 0; i < maxAggregates; ++i) { + aggregator.publish([ + new SimpleSpan("service" + i, "operation", "resource", "type", false, true, false, 0, 100, HTTP_OK) + .setTag(SPAN_KIND, "baz") + ]) + } + aggregator.report() + latch1.await(2, SECONDS) + + then: + 1 * writer.finishBucket() >> { latch1.countDown() } + + when: "publish new distinct spans — LRU evicts the cleared entries before the next report" + CountDownLatch latch2 = new CountDownLatch(1) + for (int i = maxAggregates; i < maxAggregates * 2; ++i) { + aggregator.publish([ + new SimpleSpan("service" + i, "operation", "resource", "type", false, true, false, 0, 100, HTTP_OK) + .setTag(SPAN_KIND, "baz") + ]) + } + aggregator.report() + latch2.await(2, SECONDS) + + then: "no drop metric because all evicted entries had hitCount=0 (already reported)" + 1 * writer.finishBucket() >> { latch2.countDown() } + 0 * healthMetrics.onStatsAggregateDropped() + + cleanup: + aggregator.close() + } + + def "aggregate not updated in reporting interval not reported"() { + setup: + int maxAggregates = 10 + MetricWriter writer = Mock(MetricWriter) + Sink sink = Stub(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> true + features.peerTags() >> [] + ClientStatsAggregator aggregator = new ClientStatsAggregator(empty, + features, HealthMetrics.NO_OP, sink, writer, maxAggregates, queueSize, reportingInterval, SECONDS, false) + long duration = 100 + aggregator.start() + + when: + CountDownLatch latch = new CountDownLatch(1) + for (int i = 0; i < 5; ++i) { + aggregator.publish([ + new SimpleSpan("service" + i, "operation", "resource", "type", false, true, false, 0, duration, HTTP_OK) + .setTag(SPAN_KIND, "baz") + ]) + } + aggregator.report() + def latchTriggered = latch.await(2, SECONDS) + + then: "all aggregates should be reported" + latchTriggered + 1 * writer.startBucket(5, _, SECONDS.toNanos(reportingInterval)) + for (int i = 0; i < 5; ++i) { + def expected = AggregateEntryTestUtils.of( + "resource", + "service" + i, + "operation", + null, + "type", + HTTP_OK, + false, + false, + "baz", + [], + null, + null, + null) + 1 * writer.add({ AggregateEntryTestUtils.equals(it, expected) }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getDuration() == duration + } + } + 1 * writer.finishBucket() >> { latch.countDown() } + + when: + latch = new CountDownLatch(1) + for (int i = 1; i < 5; ++i) { + aggregator.publish([ + new SimpleSpan("service" + i, "operation", "resource", "type", false, true, false, 0, duration, HTTP_OK) + .setTag(SPAN_KIND, "baz") + ]) + } + aggregator.report() + latchTriggered = latch.await(2, SECONDS) + + then: "aggregate not updated in cycle is not reported" + latchTriggered + 1 * writer.startBucket(4, _, SECONDS.toNanos(reportingInterval)) + for (int i = 1; i < 5; ++i) { + def expected = AggregateEntryTestUtils.of( + "resource", + "service" + i, + "operation", + null, + "type", + HTTP_OK, + false, + false, + "baz", + [], + null, + null, + null) + 1 * writer.add({ AggregateEntryTestUtils.equals(it, expected) }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getDuration() == duration + } + } + 0 * writer.add({ + AggregateEntryTestUtils.equals(it,AggregateEntryTestUtils.of( + "resource", + "service0", + "operation", + null, + "type", + HTTP_OK, + false, + false, + "baz", + [], + null, + null, + null + )) + }) + 1 * writer.finishBucket() >> { latch.countDown() } + + cleanup: + aggregator.close() + } + + def "when no aggregate is updated in reporting interval nothing is reported"() { + setup: + int maxAggregates = 10 + MetricWriter writer = Mock(MetricWriter) + Sink sink = Stub(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> true + features.peerTags() >> [] + ClientStatsAggregator aggregator = new ClientStatsAggregator(empty, + features, HealthMetrics.NO_OP, sink, writer, maxAggregates, queueSize, reportingInterval, SECONDS, false) + long duration = 100 + aggregator.start() + + when: + CountDownLatch latch = new CountDownLatch(1) + for (int i = 0; i < 5; ++i) { + aggregator.publish([ + new SimpleSpan("service" + i, "operation", "resource", "type", false, true, false, 0, duration, HTTP_OK) + .setTag(SPAN_KIND, "quux") + ]) + } + aggregator.report() + def latchTriggered = latch.await(2, SECONDS) + + then: "all aggregates should be reported" + latchTriggered + 1 * writer.startBucket(5, _, SECONDS.toNanos(reportingInterval)) + for (int i = 0; i < 5; ++i) { + def expected = AggregateEntryTestUtils.of( + "resource", + "service" + i, + "operation", + null, + "type", + HTTP_OK, + false, + false, + "quux", + [], + null, + null, + null) + 1 * writer.add({ AggregateEntryTestUtils.equals(it, expected) }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getDuration() == duration + } + } + 1 * writer.finishBucket() >> { latch.countDown() } + + when: + reportAndWaitUntilEmpty(aggregator) + + then: "aggregate not updated in cycle is not reported" + 0 * writer.finishBucket() + 0 * writer.startBucket(_, _, _) + 0 * writer.add(_) + + cleanup: + aggregator.close() + } + + def "should report periodically"() { + setup: + int maxAggregates = 10 + MetricWriter writer = Mock(MetricWriter) + Sink sink = Stub(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> true + features.peerTags() >> [] + ClientStatsAggregator aggregator = new ClientStatsAggregator(empty, + features, HealthMetrics.NO_OP, sink, writer, maxAggregates, queueSize, 1, SECONDS, false) + long duration = 100 + aggregator.start() + + when: + CountDownLatch latch = new CountDownLatch(1) + for (int i = 0; i < 5; ++i) { + aggregator.publish([ + new SimpleSpan("service" + i, "operation", "resource", "type", false, true, false, 0, duration, HTTP_OK, true) + .setTag(SPAN_KIND, "garply") + ]) + } + def latchTriggered = latch.await(2, SECONDS) + + then: "all aggregates should be reported" + latchTriggered + 1 * writer.startBucket(5, _, SECONDS.toNanos(1)) + for (int i = 0; i < 5; ++i) { + def expected = AggregateEntryTestUtils.of( + "resource", + "service" + i, + "operation", + null, + "type", + HTTP_OK, + false, + true, + "garply", + [], + null, + null, + null) + 1 * writer.add({ AggregateEntryTestUtils.equals(it, expected) }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getDuration() == duration + } + } + 1 * writer.finishBucket() >> { latch.countDown() } + + cleanup: + aggregator.close() + } + + def "should be resilient to serialization errors"() { + setup: + int maxAggregates = 10 + MetricWriter writer = Mock(MetricWriter) + Sink sink = Stub(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> true + features.peerTags() >> [] + ClientStatsAggregator aggregator = new ClientStatsAggregator(empty, + features, HealthMetrics.NO_OP, sink, writer, maxAggregates, queueSize, 1, SECONDS, false) + long duration = 100 + aggregator.start() + + when: + CountDownLatch latch = new CountDownLatch(1) + for (int i = 0; i < 5; ++i) { + aggregator.publish([ + new SimpleSpan("service" + i, "operation", "resource", "type", false, true, false, 0, duration, HTTP_OK) + ]) + } + def latchTriggered = latch.await(2, SECONDS) + + then: "writer should be reset if reporting fails" + latchTriggered + 1 * writer.startBucket(_, _, _) >> { + throw new IllegalArgumentException("something went wrong") + } + 1 * writer.reset() >> { latch.countDown() } + + cleanup: + aggregator.close() + } + + def "force flush should not block if metrics are disabled"() { + setup: + int maxAggregates = 10 + MetricWriter writer = Mock(MetricWriter) + Sink sink = Stub(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + ClientStatsAggregator aggregator = new ClientStatsAggregator(empty, + features, HealthMetrics.NO_OP, sink, writer, maxAggregates, queueSize, 1, SECONDS, false) + aggregator.start() + + when: + def flushed = aggregator.forceReport().get(10, SECONDS) + + then: + notThrown(TimeoutException) + !flushed + + cleanup: + aggregator.close() + } + + def "should start even if the agent is not available"() { + setup: + MetricWriter writer = Mock(MetricWriter) + Sink sink = Stub(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> false + features.peerTags() >> [] + ClientStatsAggregator aggregator = new ClientStatsAggregator(empty, + features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, 200, MILLISECONDS, false) + final spans = [ + new SimpleSpan("service", "operation", "resource", "type", false, true, false, 0, 10, HTTP_OK) + ] + aggregator.start() + + when: + aggregator.publish(spans) + Thread.sleep(1_000) + + then: + 0 * writer._ + when: + features.supportsMetrics() >> true + aggregator.publish(spans) + Thread.sleep(1_000) + + then: + (1.._) * writer._ + + cleanup: + aggregator.close() + } + + def "force flush should wait for aggregator to start"() { + setup: + int maxAggregates = 10 + MetricWriter writer = Mock(MetricWriter) + Sink sink = Stub(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> true + ClientStatsAggregator aggregator = new ClientStatsAggregator(empty, + features, HealthMetrics.NO_OP, sink, writer, maxAggregates, queueSize, 1, SECONDS, false) + + when: + def async = CompletableFuture.supplyAsync(new Supplier() { + @Override + Boolean get() { + return aggregator.forceReport().get() + } + }) + async.get(3, SECONDS) + + then: + thrown(TimeoutException) + + when: + aggregator.start() + def flushed = async.get(3, TimeUnit.SECONDS) + + then: + notThrown(TimeoutException) + flushed + + cleanup: + aggregator.close() + } + + def "should not count partial snapshot(long running)"() { + setup: + MetricWriter writer = Mock(MetricWriter) + Sink sink = Stub(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> true + ClientStatsAggregator aggregator = new ClientStatsAggregator(empty, + features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, false) + aggregator.start() + + when: + CountDownLatch latch = new CountDownLatch(1) + aggregator.publish([ + new SimpleSpan("service", "operation", "resource", "type", true, true, false, 0, 100, HTTP_OK, true, 12345), + new SimpleSpan("service", "operation", "resource", "type", true, true, false, 0, 100, HTTP_OK, true, 0) + ]) + aggregator.report() + def latchTriggered = latch.await(2, SECONDS) + + then: + latchTriggered + 1 * writer.startBucket(1, _, _) + 1 * writer.add({ + AggregateEntryTestUtils.equals(it, + AggregateEntryTestUtils.of( + "resource", + "service", + "operation", + null, + "type", + HTTP_OK, + false, + true, + "", + [], + null, + null, + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getTopLevelCount() == 1 && e.getDuration() == 100 + } + 1 * writer.finishBucket() >> { latch.countDown() } + + cleanup: + aggregator.close() + } + + def "should not change metric buckets when includeEndpointInMetrics is disabled"() { + setup: + MetricWriter writer = Mock(MetricWriter) + Sink sink = Stub(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> true + features.peerTags() >> [] + ClientStatsAggregator aggregator = new ClientStatsAggregator(empty, + features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, false) + aggregator.start() + + when: "publishing spans with different http.method and http.endpoint" + CountDownLatch latch = new CountDownLatch(1) + aggregator.publish([ + new SimpleSpan("service", "operation", "resource", "type", false, true, false, 0, 100, HTTP_OK) + .setTag(SPAN_KIND, "server") + .setTag("http.method", "GET") + .setTag("http.endpoint", "/api/users/:id"), + new SimpleSpan("service", "operation", "resource", "type", false, true, false, 0, 200, HTTP_OK) + .setTag(SPAN_KIND, "server") + .setTag("http.method", "POST") + .setTag("http.endpoint", "/api/orders"), + new SimpleSpan("service", "operation", "resource", "type", false, true, false, 0, 150, HTTP_OK) + .setTag(SPAN_KIND, "server") + ]) + reportAndWaitUntilEmpty(aggregator) + def latchTriggered = latch.await(2, SECONDS) + + then: "all spans should go to the same bucket (httpMethod and httpEndpoint are ignored)" + latchTriggered + 1 * writer.startBucket(1, _, _) + 1 * writer.add({ + AggregateEntryTestUtils.equals(it, + AggregateEntryTestUtils.of( + "resource", + "service", + "operation", + null, + "type", + HTTP_OK, + false, + false, + "server", + [], + null, + null, + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == 3 && e.getTopLevelCount() == 3 && e.getDuration() == 450 + } + 1 * writer.finishBucket() >> { latch.countDown() } + + cleanup: + aggregator.close() + } + + def "should separate metric buckets when includeEndpointInMetrics is enabled"() { + setup: + MetricWriter writer = Mock(MetricWriter) + Sink sink = Stub(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> true + features.peerTags() >> [] + ClientStatsAggregator aggregator = new ClientStatsAggregator(empty, + features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, true) + aggregator.start() + + when: "publishing spans with different http.method and http.endpoint" + CountDownLatch latch = new CountDownLatch(1) + aggregator.publish([ + new SimpleSpan("service", "operation", "resource", "type", false, true, false, 0, 100, HTTP_OK) + .setTag(SPAN_KIND, "server") + .setTag("http.method", "GET") + .setTag("http.endpoint", "/api/users/:id"), + new SimpleSpan("service", "operation", "resource", "type", false, true, false, 0, 200, HTTP_OK) + .setTag(SPAN_KIND, "server") + .setTag("http.method", "POST") + .setTag("http.endpoint", "/api/orders"), + new SimpleSpan("service", "operation", "resource", "type", false, true, false, 0, 150, HTTP_OK) + .setTag(SPAN_KIND, "server") + ]) + reportAndWaitUntilEmpty(aggregator) + def latchTriggered = latch.await(2, SECONDS) + + then: "spans should go to separate buckets based on httpMethod and httpEndpoint" + latchTriggered + 1 * writer.startBucket(3, _, _) + 1 * writer.add({ + AggregateEntryTestUtils.equals(it, + AggregateEntryTestUtils.of( + "resource", + "service", + "operation", + null, + "type", + HTTP_OK, + false, + false, + "server", + [], + "GET", + "/api/users/:id", + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getTopLevelCount() == 1 && e.getDuration() == 100 + } + 1 * writer.add({ + AggregateEntryTestUtils.equals(it, + AggregateEntryTestUtils.of( + "resource", + "service", + "operation", + null, + "type", + HTTP_OK, + false, + false, + "server", + [], + "POST", + "/api/orders", + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getTopLevelCount() == 1 && e.getDuration() == 200 + } + 1 * writer.add({ + AggregateEntryTestUtils.equals(it, + AggregateEntryTestUtils.of( + "resource", + "service", + "operation", + null, + "type", + HTTP_OK, + false, + false, + "server", + [], + null, + null, + null + )) + }) >> { AggregateEntry e -> + assert e.getHitCount() == 1 && e.getTopLevelCount() == 1 && e.getDuration() == 150 + } + 1 * writer.finishBucket() >> { latch.countDown() } + + cleanup: + aggregator.close() + } + + def "should include grpc status code in metric key for rpc spans"() { + setup: + MetricWriter writer = Mock(MetricWriter) + Sink sink = Stub(Sink) + DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) + features.supportsMetrics() >> true + features.peerTags() >> [] + ClientStatsAggregator aggregator = new ClientStatsAggregator(empty, + features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, false) + aggregator.start() + + when: + CountDownLatch latch = new CountDownLatch(1) + aggregator.publish([ + new SimpleSpan("service", "grpc.server", "grpc.service/Method", "rpc", true, false, false, 0, 100, 0) + .setTag(SPAN_KIND, "server") + .setTag(InstrumentationTags.GRPC_STATUS_CODE, 0), + new SimpleSpan("service", "grpc.server", "grpc.service/Method", "rpc", true, false, false, 0, 50, 0) + .setTag(SPAN_KIND, "server") + .setTag(InstrumentationTags.GRPC_STATUS_CODE, 5), + new SimpleSpan("service", "http.request", "GET /api", "web", true, false, false, 0, 75, 200) + .setTag(SPAN_KIND, "server") + ]) + aggregator.report() + def latchTriggered = latch.await(2, SECONDS) + + then: + latchTriggered + 1 * writer.startBucket(3, _, _) + 1 * writer.add({ + AggregateEntryTestUtils.equals(it,AggregateEntryTestUtils.of( + "grpc.service/Method", + "service", + "grpc.server", + null, + "rpc", + 0, + false, + false, + "server", + [], + null, + null, + "0" + )) + }) + 1 * writer.add({ + AggregateEntryTestUtils.equals(it,AggregateEntryTestUtils.of( + "grpc.service/Method", + "service", + "grpc.server", + null, + "rpc", + 0, + false, + false, + "server", + [], + null, + null, + "5" + )) + }) + 1 * writer.add({ + AggregateEntryTestUtils.equals(it,AggregateEntryTestUtils.of( + "GET /api", + "service", + "http.request", + null, + "web", + 200, + false, + false, + "server", + [], + null, + null, + null + )) + }) + 1 * writer.finishBucket() >> { latch.countDown() } + + cleanup: + aggregator.close() + } + + def reportAndWaitUntilEmpty(ClientStatsAggregator aggregator) { + waitUntilEmpty(aggregator) + aggregator.report() + waitUntilEmpty(aggregator) + } + + + def waitUntilEmpty(ClientStatsAggregator aggregator) { + int i = 0 + while (!aggregator.inbox.isEmpty() && i++ < 100) { + Thread.sleep(10) + } + } +} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/common/metrics/ConflatingMetricAggregatorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/common/metrics/ConflatingMetricAggregatorTest.groovy deleted file mode 100644 index 962ad2ce892..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/common/metrics/ConflatingMetricAggregatorTest.groovy +++ /dev/null @@ -1,1645 +0,0 @@ -package datadog.trace.common.metrics - -import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND -import datadog.trace.bootstrap.instrumentation.api.InstrumentationTags -import static java.util.concurrent.TimeUnit.MILLISECONDS -import static java.util.concurrent.TimeUnit.SECONDS - -import datadog.communication.ddagent.DDAgentFeaturesDiscovery -import datadog.trace.api.WellKnownTags -import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString -import datadog.trace.core.CoreSpan -import datadog.trace.core.monitor.HealthMetrics -import datadog.trace.test.util.DDSpecification -import java.util.concurrent.CompletableFuture -import java.util.concurrent.CountDownLatch -import java.util.concurrent.TimeUnit -import java.util.concurrent.TimeoutException -import java.util.function.Supplier -import spock.lang.Shared - -class ConflatingMetricAggregatorTest extends DDSpecification { - - static Set empty = new HashSet<>() - - static final int HTTP_OK = 200 - - @Shared - long reportingInterval = 1 - @Shared - int queueSize = 256 - - def "should ignore traces with no measured spans"() { - setup: - Sink sink = Mock(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> true - WellKnownTags wellKnownTags = new WellKnownTags("runtimeid", "hostname", "env", "service", "version", "language") - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator( - wellKnownTags, - empty, - features, - HealthMetrics.NO_OP, - sink, - 10, - queueSize, - 1, - MILLISECONDS, false - ) - aggregator.start() - - aggregator.publish([new SimpleSpan("", "", "", "", false, false, false, 0, 0, HTTP_OK)]) - when: - reportAndWaitUntilEmpty(aggregator) - then: - 0 * sink._ - - cleanup: - aggregator.close() - } - - def "should ignore traces with ignored resource names"() { - setup: - String ignoredResourceName = "foo" - Sink sink = Mock(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> true - WellKnownTags wellKnownTags = new WellKnownTags("runtimeid", "hostname", "env", "service", "version", "language") - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator( - wellKnownTags, - [ignoredResourceName].toSet(), - features, - HealthMetrics.NO_OP, - sink, - 10, - queueSize, - 1, - MILLISECONDS, false - ) - aggregator.start() - - when: "publish ignored resource names" - aggregator.publish([new SimpleSpan("", "", ignoredResourceName, "", true, true, false, 0, 0, HTTP_OK)]) - aggregator.publish([ - new SimpleSpan("", "", UTF8BytesString.create(ignoredResourceName), "", true, true, false, 0, 0, HTTP_OK) - ]) - aggregator.publish([ - new SimpleSpan("", "", ignoredResourceName, "", true, true, false, 0, 0, HTTP_OK), - new SimpleSpan("", "", - "measured, not ignored, but child of ignored, so should be ignored", "", true, true, false, 0, 0, HTTP_OK) - ]) - reportAndWaitUntilEmpty(aggregator) - then: - 0 * sink._ - - cleanup: - aggregator.close() - } - - def "should be resilient to null resource names"() { - setup: - MetricWriter writer = Mock(MetricWriter) - Sink sink = Stub(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> true - features.peerTags() >> [] - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty, - features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, false) - aggregator.start() - - when: - CountDownLatch latch = new CountDownLatch(1) - aggregator.publish([ - new SimpleSpan("service", "operation", null, "type", false, true, false, 0, 100, HTTP_OK) - .setTag(SPAN_KIND, "baz") - ]) - aggregator.report() - def latchTriggered = latch.await(2, SECONDS) - - then: - latchTriggered - 1 * writer.startBucket(1, _, _) - 1 * writer.add(new MetricKey( - null, - "service", - "operation", - null, - "type", - HTTP_OK, - false, - false, - "baz", - [], - null, - null, - null - ), _) >> { MetricKey key, AggregateMetric value -> - value.getHitCount() == 1 && value.getTopLevelCount() == 1 && value.getDuration() == 100 - } - 1 * writer.finishBucket() >> { latch.countDown() } - - cleanup: - aggregator.close() - } - - def "unmeasured top level spans have metrics computed"() { - setup: - MetricWriter writer = Mock(MetricWriter) - Sink sink = Stub(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> true - features.peerTags() >> [] - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty, - features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, false) - aggregator.start() - - when: - CountDownLatch latch = new CountDownLatch(1) - aggregator.publish([ - new SimpleSpan("service", "operation", "resource", "type", false, true, false, 0, 100, HTTP_OK) - .setTag(SPAN_KIND, "baz") - ]) - aggregator.report() - def latchTriggered = latch.await(2, SECONDS) - - then: - latchTriggered - 1 * writer.startBucket(1, _, _) - 1 * writer.add(new MetricKey( - "resource", - "service", - "operation", - null, - "type", - HTTP_OK, - false, - false, - "baz", - [], - null, - null, - null - ), _) >> { MetricKey key, AggregateMetric value -> - value.getHitCount() == 1 && value.getTopLevelCount() == 1 && value.getDuration() == 100 - } - 1 * writer.finishBucket() >> { latch.countDown() } - - cleanup: - aggregator.close() - } - - def "should compute stats for span kind #kind"() { - setup: - MetricWriter writer = Mock(MetricWriter) - Sink sink = Stub(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> true - features.peerTags() >> [] - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty, - features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, true) - aggregator.start() - - when: - CountDownLatch latch = new CountDownLatch(1) - def span = new SimpleSpan("service", "operation", "resource", "type", false, false, false, 0, 100, HTTP_OK) - .setTag(SPAN_KIND, kind) - if (httpMethod != null) { - span.setTag("http.method", httpMethod) - } - if (httpEndpoint != null) { - span.setTag("http.endpoint", httpEndpoint) - } - aggregator.publish([span]) - aggregator.report() - def latchTriggered = latch.await(2, SECONDS) - - then: - latchTriggered == statsComputed - (statsComputed ? 1 : 0) * writer.startBucket(1, _, _) - (statsComputed ? 1 : 0) * writer.add( - new MetricKey( - "resource", - "service", - "operation", - null, - "type", - HTTP_OK, - false, - false, - kind, - [], - httpMethod, - httpEndpoint, - null - ), { AggregateMetric aggregateMetric -> - aggregateMetric.getHitCount() == 1 && aggregateMetric.getTopLevelCount() == 0 && aggregateMetric.getDuration() == 100 - }) - (statsComputed ? 1 : 0) * writer.finishBucket() >> { latch.countDown() } - - cleanup: - aggregator.close() - - where: - kind | httpMethod | httpEndpoint | statsComputed - "client" | null | null | true - "producer" | null | null | true - "consumer" | null | null | true - UTF8BytesString.create("server") | null | null | true - "internal" | null | null | false - null | null | null | false - "server" | "GET" | "/api/users/:id" | true - "server" | "POST" | "/api/orders" | true - "server" | "DELETE" | "/api/products/:id" | true - "client" | "GET" | "/external/api" | true - } - - def "should create bucket for each set of peer tags"() { - setup: - MetricWriter writer = Mock(MetricWriter) - Sink sink = Stub(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> true - features.peerTags() >>> [["country"], ["country", "georegion"],] - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty, - features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, false) - aggregator.start() - - when: - CountDownLatch latch = new CountDownLatch(1) - aggregator.publish([ - new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, 100, HTTP_OK) - .setTag(SPAN_KIND, "client").setTag("country", "france").setTag("georegion", "europe"), - new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, 100, HTTP_OK) - .setTag(SPAN_KIND, "client").setTag("country", "france").setTag("georegion", "europe") - ]) - aggregator.report() - def latchTriggered = latch.await(2, SECONDS) - - then: - latchTriggered - 1 * writer.startBucket(2, _, _) - 1 * writer.add( - new MetricKey( - "resource", - "service", - "operation", - null, - "type", - HTTP_OK, - false, - false, - "client", - [UTF8BytesString.create("country:france")], - null, - null, - null - ), { AggregateMetric aggregateMetric -> - aggregateMetric.getHitCount() == 1 && aggregateMetric.getTopLevelCount() == 0 && aggregateMetric.getDuration() == 100 - }) - 1 * writer.add( - new MetricKey( - "resource", - "service", - "operation", - null, - "type", - HTTP_OK, - false, - false, - "client", - [UTF8BytesString.create("country:france"), UTF8BytesString.create("georegion:europe")], - null, - null, - null - ), { AggregateMetric aggregateMetric -> - aggregateMetric.getHitCount() == 1 && aggregateMetric.getTopLevelCount() == 0 && aggregateMetric.getDuration() == 100 - }) - 1 * writer.finishBucket() >> { latch.countDown() } - - cleanup: - aggregator.close() - } - - def "should aggregate the right peer tags for kind #kind"() { - setup: - MetricWriter writer = Mock(MetricWriter) - Sink sink = Stub(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> true - features.peerTags() >> ["peer.hostname", "_dd.base_service"] - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty, - features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, false) - aggregator.start() - - when: - CountDownLatch latch = new CountDownLatch(1) - aggregator.publish([ - new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, 100, HTTP_OK) - .setTag(SPAN_KIND, kind).setTag("peer.hostname", "localhost").setTag("_dd.base_service", UTF8BytesString.create("test")) - ]) - aggregator.report() - def latchTriggered = latch.await(2, SECONDS) - - then: - latchTriggered - 1 * writer.startBucket(1, _, _) - 1 * writer.add( - new MetricKey( - "resource", - "service", - "operation", - null, - "type", - HTTP_OK, - false, - false, - kind, - expectedPeerTags, - null, - null, - null - ), { AggregateMetric aggregateMetric -> - aggregateMetric.getHitCount() == 1 && aggregateMetric.getTopLevelCount() == 0 && aggregateMetric.getDuration() == 100 - }) - 1 * writer.finishBucket() >> { latch.countDown() } - - cleanup: - aggregator.close() - - where: - kind | expectedPeerTags - "client" | [UTF8BytesString.create("peer.hostname:localhost"), UTF8BytesString.create("_dd.base_service:test")] - "internal" | [UTF8BytesString.create("_dd.base_service:test")] - "server" | [] - } - - def "measured spans do not contribute to top level count"() { - setup: - MetricWriter writer = Mock(MetricWriter) - Sink sink = Stub(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> true - features.peerTags() >> [] - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty, features, HealthMetrics.NO_OP, - sink, writer, 10, queueSize, reportingInterval, SECONDS, false) - aggregator.start() - - when: - CountDownLatch latch = new CountDownLatch(1) - aggregator.publish([ - new SimpleSpan("service", "operation", "resource", "type", measured, topLevel, false, 0, 100, HTTP_OK) - .setTag(SPAN_KIND, "baz") - ]) - aggregator.report() - def latchTriggered = latch.await(2, SECONDS) - - then: - latchTriggered - 1 * writer.startBucket(1, _, _) - 1 * writer.add(new MetricKey( - "resource", - "service", - "operation", - null, - "type", - HTTP_OK, - false, - false, - "baz", - [], - null, - null, - null - ), { AggregateMetric value -> - value.getHitCount() == 1 && value.getTopLevelCount() == topLevelCount && value.getDuration() == 100 - }) - 1 * writer.finishBucket() >> { latch.countDown() } - - cleanup: - aggregator.close() - - where: - measured | topLevel | topLevelCount - true | false | 0 - true | true | 1 - false | true | 1 - } - - def "aggregate repetitive spans"() { - setup: - MetricWriter writer = Mock(MetricWriter) - Sink sink = Stub(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> true - features.peerTags() >> [] - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty, - features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, false) - long duration = 100 - List trace = [ - new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, duration, HTTP_OK).setTag(SPAN_KIND, "baz"), - new SimpleSpan("service1", "operation1", "resource1", "type", false, false, false, 0, 0, HTTP_OK).setTag(SPAN_KIND, "baz"), - new SimpleSpan("service2", "operation2", "resource2", "type", true, false, false, 0, duration * 2, HTTP_OK).setTag(SPAN_KIND, "baz") - ] - aggregator.start() - - - when: - CountDownLatch latch = new CountDownLatch(1) - for (int i = 0; i < count; ++i) { - aggregator.publish(trace) - } - aggregator.report() - def latchTriggered = latch.await(2, SECONDS) - - then: "metrics should be conflated" - latchTriggered - 1 * writer.finishBucket() >> { latch.countDown() } - 1 * writer.startBucket(2, _, SECONDS.toNanos(reportingInterval)) - 1 * writer.add(new MetricKey( - "resource", - "service", - "operation", - null, - "type", - HTTP_OK, - false, - false, - "baz", - [], - null, - null, - null - ), { AggregateMetric value -> - value.getHitCount() == count && value.getDuration() == count * duration - }) - 1 * writer.add(new MetricKey( - "resource2", - "service2", - "operation2", - null, - "type", - HTTP_OK, - false, - false, - "baz", - [], - null, - null, - null - ), { AggregateMetric value -> - value.getHitCount() == count && value.getDuration() == count * duration * 2 - }) - - cleanup: - aggregator.close() - - where: - count << [10, 100] - } - - def "aggregate spans with same HTTP endpoint together, separate different endpoints"() { - setup: - MetricWriter writer = Mock(MetricWriter) - Sink sink = Stub(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> true - features.peerTags() >> [] - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty, - features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, true) - aggregator.start() - - when: "publish multiple spans with same endpoint" - CountDownLatch latch = new CountDownLatch(1) - int count = 5 - long duration = 100 - for (int i = 0; i < count; ++i) { - aggregator.publish([ - new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, duration, HTTP_OK) - .setTag(SPAN_KIND, "server") - .setTag("http.method", "GET") - .setTag("http.endpoint", "/api/users/:id") - ]) - } - aggregator.report() - def latchTriggered = latch.await(2, SECONDS) - - then: "should aggregate into single metric" - latchTriggered - 1 * writer.startBucket(1, _, _) - 1 * writer.add(new MetricKey( - "resource", - "service", - "operation", - null, - "type", - HTTP_OK, - false, - false, - "server", - [], - "GET", - "/api/users/:id", - null - ), { AggregateMetric value -> - value.getHitCount() == count && value.getDuration() == count * duration - }) - 1 * writer.finishBucket() >> { latch.countDown() } - - when: "publish spans with different endpoints" - CountDownLatch latch2 = new CountDownLatch(1) - aggregator.publish([ - new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, duration, HTTP_OK) - .setTag(SPAN_KIND, "server") - .setTag("http.method", "GET") - .setTag("http.endpoint", "/api/users/:id"), - new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, duration * 2, HTTP_OK) - .setTag(SPAN_KIND, "server") - .setTag("http.method", "GET") - .setTag("http.endpoint", "/api/orders/:id"), - new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, duration * 3, HTTP_OK) - .setTag(SPAN_KIND, "server") - .setTag("http.method", "POST") - .setTag("http.endpoint", "/api/users/:id") - ]) - aggregator.report() - def latchTriggered2 = latch2.await(2, SECONDS) - - then: "should create separate metrics for each endpoint/method combination" - latchTriggered2 - 1 * writer.startBucket(3, _, _) - 1 * writer.add(new MetricKey( - "resource", - "service", - "operation", - null, - "type", - HTTP_OK, - false, - false, - "server", - [], - "GET", - "/api/users/:id", - null - ), { AggregateMetric value -> - value.getHitCount() == 1 && value.getDuration() == duration - }) - 1 * writer.add(new MetricKey( - "resource", - "service", - "operation", - null, - "type", - HTTP_OK, - false, - false, - "server", - [], - "GET", - "/api/orders/:id", - null - ), { AggregateMetric value -> - value.getHitCount() == 1 && value.getDuration() == duration * 2 - }) - 1 * writer.add(new MetricKey( - "resource", - "service", - "operation", - null, - "type", - HTTP_OK, - false, - false, - "server", - [], - "POST", - "/api/users/:id", - null - ), { AggregateMetric value -> - value.getHitCount() == 1 && value.getDuration() == duration * 3 - }) - 1 * writer.finishBucket() >> { latch2.countDown() } - - cleanup: - aggregator.close() - } - - def "create separate metrics for different HTTP method/endpoint/status combinations"() { - setup: - MetricWriter writer = Mock(MetricWriter) - Sink sink = Stub(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> true - features.peerTags() >> [] - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty, - features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, true) - aggregator.start() - - when: "publish spans with different combinations" - CountDownLatch latch = new CountDownLatch(1) - long duration = 100 - aggregator.publish([ - // Same endpoint, different methods - new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, duration, 200) - .setTag(SPAN_KIND, "server") - .setTag("http.method", "GET") - .setTag("http.endpoint", "/api/users/:id"), - new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, duration * 2, 200) - .setTag(SPAN_KIND, "server") - .setTag("http.method", "POST") - .setTag("http.endpoint", "/api/users/:id"), - // Same method/endpoint, different status - new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, duration * 3, 404) - .setTag(SPAN_KIND, "server") - .setTag("http.method", "GET") - .setTag("http.endpoint", "/api/users/:id"), - // Different endpoint - new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, duration * 4, 200) - .setTag(SPAN_KIND, "server") - .setTag("http.method", "GET") - .setTag("http.endpoint", "/api/orders/:id") - ]) - aggregator.report() - def latchTriggered = latch.await(2, SECONDS) - - then: "should create 4 separate metrics" - latchTriggered - 1 * writer.startBucket(4, _, _) - 1 * writer.add(new MetricKey( - "resource", - "service", - "operation", - null, - "type", - 200, - false, - false, - "server", - [], - "GET", - "/api/users/:id", - null - ), { AggregateMetric value -> - value.getHitCount() == 1 && value.getDuration() == duration - }) - 1 * writer.add(new MetricKey( - "resource", - "service", - "operation", - null, - "type", - 200, - false, - false, - "server", - [], - "POST", - "/api/users/:id", - null - ), { AggregateMetric value -> - value.getHitCount() == 1 && value.getDuration() == duration * 2 - }) - 1 * writer.add(new MetricKey( - "resource", - "service", - "operation", - null, - "type", - 404, - false, - false, - "server", - [], - "GET", - "/api/users/:id", - null - ), { AggregateMetric value -> - value.getHitCount() == 1 && value.getDuration() == duration * 3 - }) - 1 * writer.add(new MetricKey( - "resource", - "service", - "operation", - null, - "type", - 200, - false, - false, - "server", - [], - "GET", - "/api/orders/:id", - null - ), { AggregateMetric value -> - value.getHitCount() == 1 && value.getDuration() == duration * 4 - }) - 1 * writer.finishBucket() >> { latch.countDown() } - - cleanup: - aggregator.close() - } - - def "handle spans without HTTP endpoint tags for backward compatibility"() { - setup: - MetricWriter writer = Mock(MetricWriter) - Sink sink = Stub(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> true - features.peerTags() >> [] - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty, - features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, true) - aggregator.start() - - when: "publish spans with and without HTTP tags" - CountDownLatch latch = new CountDownLatch(1) - long duration = 100 - aggregator.publish([ - // Span without HTTP tags (legacy behavior) - new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, duration, 200) - .setTag(SPAN_KIND, "server"), - // Span with HTTP tags (new behavior) - new SimpleSpan("service", "operation", "resource", "type", true, false, false, 0, duration * 2, 200) - .setTag(SPAN_KIND, "server") - .setTag("http.method", "GET") - .setTag("http.endpoint", "/api/users/:id") - ]) - aggregator.report() - def latchTriggered = latch.await(2, SECONDS) - - then: "should create separate metric keys for spans with and without HTTP tags" - latchTriggered - 1 * writer.startBucket(2, _, _) - 1 * writer.add(new MetricKey( - "resource", - "service", - "operation", - null, - "type", - 200, - false, - false, - "server", - [], - null, - null, - null - ), { AggregateMetric value -> - value.getHitCount() == 1 && value.getDuration() == duration - }) - 1 * writer.add(new MetricKey( - "resource", - "service", - "operation", - null, - "type", - 200, - false, - false, - "server", - [], - "GET", - "/api/users/:id", - null - ), { AggregateMetric value -> - value.getHitCount() == 1 && value.getDuration() == duration * 2 - }) - 1 * writer.finishBucket() >> { latch.countDown() } - - cleanup: - aggregator.close() - } - - def "gather the service name source when the span is published"() { - setup: - MetricWriter writer = Mock(MetricWriter) - Sink sink = Stub(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> true - features.peerTags() >> [] - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty, - features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, false) - aggregator.start() - - when: "publish spans with different service name source" - CountDownLatch latch = new CountDownLatch(1) - long duration = 100 - aggregator.publish([ - new SimpleSpan("service", "operation", "resource", "type", true, true, false, 0, duration, 200, false, 0, "source") - .setTag(SPAN_KIND, "server"), - new SimpleSpan("service", "operation", "resource", "type", true, true, false, 0, duration, 200, false, 0, null) - .setTag(SPAN_KIND, "server"), - new SimpleSpan("service", "operation", "resource", "type", true, true, false, 0, duration, 200, false, 0, "source") - .setTag(SPAN_KIND, "server") - ]) - aggregator.report() - def latchTriggered = latch.await(2, SECONDS) - - then: "should create the different metric keys for spans with and without sources" - latchTriggered - 1 * writer.startBucket(2, _, _) - 1 * writer.add(new MetricKey( - "resource", - "service", - "operation", - "source", - "type", - 200, - false, - false, - "server", - [], - null, - null, - null - ), { AggregateMetric value -> - value.getHitCount() == 2 && value.getDuration() == 2 * duration - }) - 1 * writer.add(new MetricKey( - "resource", - "service", - "operation", - null, - "type", - 200, - false, - false, - "server", - [], - null, - null, - null - ), { AggregateMetric value -> - value.getHitCount() == 1 && value.getDuration() == duration - }) - 1 * writer.finishBucket() >> { latch.countDown() } - - cleanup: - aggregator.close() - } - - def "test least recently written to aggregate flushed when size limit exceeded"() { - setup: - int maxAggregates = 10 - MetricWriter writer = Mock(MetricWriter) - Sink sink = Stub(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> true - features.peerTags() >> [] - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty, - features, HealthMetrics.NO_OP, sink, writer, maxAggregates, queueSize, reportingInterval, SECONDS, false) - long duration = 100 - aggregator.start() - - when: - CountDownLatch latch = new CountDownLatch(1) - for (int i = 0; i < 11; ++i) { - aggregator.publish([ - new SimpleSpan("service" + i, "operation", "resource", "type", false, true, false, 0, duration, HTTP_OK) - .setTag(SPAN_KIND, "baz") - ]) - } - aggregator.report() - def latchTriggered = latch.await(2, SECONDS) - - then: "the first aggregate should be dropped but the rest reported" - latchTriggered - 1 * writer.startBucket(10, _, SECONDS.toNanos(reportingInterval)) - for (int i = 1; i < 11; ++i) { - 1 * writer.add(new MetricKey( - "resource", - "service" + i, - "operation", - null, - "type", - HTTP_OK, - false, - false, - "baz", - [], - null, - null, - null - ), _) >> { MetricKey key, AggregateMetric value -> - value.getHitCount() == 1 && value.getDuration() == duration - } - } - 0 * writer.add(new MetricKey( - "resource", - "service0", - "operation", - null, - "type", - HTTP_OK, - false, - false, - "baz", - [], - null, - null, - null - ), _) - 1 * writer.finishBucket() >> { latch.countDown() } - - cleanup: - aggregator.close() - } - - def "should report dropped aggregate to health metrics on LRU eviction"() { - setup: - int maxAggregates = 10 - MetricWriter writer = Mock(MetricWriter) - Sink sink = Stub(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> true - features.peerTags() >> [] - HealthMetrics healthMetrics = Mock(HealthMetrics) - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty, - features, healthMetrics, sink, writer, maxAggregates, queueSize, reportingInterval, SECONDS, false) - long duration = 100 - aggregator.start() - - when: - CountDownLatch latch = new CountDownLatch(1) - for (int i = 0; i < maxAggregates + 1; ++i) { - aggregator.publish([ - new SimpleSpan("service" + i, "operation", "resource", "type", false, true, false, 0, duration, HTTP_OK) - .setTag(SPAN_KIND, "baz") - ]) - } - aggregator.report() - def latchTriggered = latch.await(2, SECONDS) - - then: - latchTriggered - 1 * writer.finishBucket() >> { latch.countDown() } - 1 * healthMetrics.onStatsAggregateDropped() - - cleanup: - aggregator.close() - } - - def "should not report dropped aggregate when evicted entry was already flushed"() { - setup: - int maxAggregates = 5 - MetricWriter writer = Mock(MetricWriter) - Sink sink = Stub(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> true - features.peerTags() >> [] - HealthMetrics healthMetrics = Mock(HealthMetrics) - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty, - features, healthMetrics, sink, writer, maxAggregates, queueSize, reportingInterval, SECONDS, false) - aggregator.start() - - when: "fill cache and flush — entries are cleared (hitCount=0) but stay in the LRU" - CountDownLatch latch1 = new CountDownLatch(1) - for (int i = 0; i < maxAggregates; ++i) { - aggregator.publish([ - new SimpleSpan("service" + i, "operation", "resource", "type", false, true, false, 0, 100, HTTP_OK) - .setTag(SPAN_KIND, "baz") - ]) - } - aggregator.report() - latch1.await(2, SECONDS) - - then: - 1 * writer.finishBucket() >> { latch1.countDown() } - - when: "publish new distinct spans — LRU evicts the cleared entries before the next report" - CountDownLatch latch2 = new CountDownLatch(1) - for (int i = maxAggregates; i < maxAggregates * 2; ++i) { - aggregator.publish([ - new SimpleSpan("service" + i, "operation", "resource", "type", false, true, false, 0, 100, HTTP_OK) - .setTag(SPAN_KIND, "baz") - ]) - } - aggregator.report() - latch2.await(2, SECONDS) - - then: "no drop metric because all evicted entries had hitCount=0 (already reported)" - 1 * writer.finishBucket() >> { latch2.countDown() } - 0 * healthMetrics.onStatsAggregateDropped() - - cleanup: - aggregator.close() - } - - def "aggregate not updated in reporting interval not reported"() { - setup: - int maxAggregates = 10 - MetricWriter writer = Mock(MetricWriter) - Sink sink = Stub(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> true - features.peerTags() >> [] - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty, - features, HealthMetrics.NO_OP, sink, writer, maxAggregates, queueSize, reportingInterval, SECONDS, false) - long duration = 100 - aggregator.start() - - when: - CountDownLatch latch = new CountDownLatch(1) - for (int i = 0; i < 5; ++i) { - aggregator.publish([ - new SimpleSpan("service" + i, "operation", "resource", "type", false, true, false, 0, duration, HTTP_OK) - .setTag(SPAN_KIND, "baz") - ]) - } - aggregator.report() - def latchTriggered = latch.await(2, SECONDS) - - then: "all aggregates should be reported" - latchTriggered - 1 * writer.startBucket(5, _, SECONDS.toNanos(reportingInterval)) - for (int i = 0; i < 5; ++i) { - 1 * writer.add(new MetricKey( - "resource", - "service" + i, - "operation", - null, - "type", - HTTP_OK, - false, - false, - "baz", - [], - null, - null, - null - ), { AggregateMetric value -> - value.getHitCount() == 1 && value.getDuration() == duration - }) - } - 1 * writer.finishBucket() >> { latch.countDown() } - - when: - latch = new CountDownLatch(1) - for (int i = 1; i < 5; ++i) { - aggregator.publish([ - new SimpleSpan("service" + i, "operation", "resource", "type", false, true, false, 0, duration, HTTP_OK) - .setTag(SPAN_KIND, "baz") - ]) - } - aggregator.report() - latchTriggered = latch.await(2, SECONDS) - - then: "aggregate not updated in cycle is not reported" - latchTriggered - 1 * writer.startBucket(4, _, SECONDS.toNanos(reportingInterval)) - for (int i = 1; i < 5; ++i) { - 1 * writer.add(new MetricKey( - "resource", - "service" + i, - "operation", - null, - "type", - HTTP_OK, - false, - false, - "baz", - [], - null, - null, - null - ), { AggregateMetric value -> - value.getHitCount() == 1 && value.getDuration() == duration - }) - } - 0 * writer.add(new MetricKey( - "resource", - "service0", - "operation", - null, - "type", - HTTP_OK, - false, - false, - "baz", - [], - null, - null, - null - ), _) - 1 * writer.finishBucket() >> { latch.countDown() } - - cleanup: - aggregator.close() - } - - def "when no aggregate is updated in reporting interval nothing is reported"() { - setup: - int maxAggregates = 10 - MetricWriter writer = Mock(MetricWriter) - Sink sink = Stub(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> true - features.peerTags() >> [] - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty, - features, HealthMetrics.NO_OP, sink, writer, maxAggregates, queueSize, reportingInterval, SECONDS, false) - long duration = 100 - aggregator.start() - - when: - CountDownLatch latch = new CountDownLatch(1) - for (int i = 0; i < 5; ++i) { - aggregator.publish([ - new SimpleSpan("service" + i, "operation", "resource", "type", false, true, false, 0, duration, HTTP_OK) - .setTag(SPAN_KIND, "quux") - ]) - } - aggregator.report() - def latchTriggered = latch.await(2, SECONDS) - - then: "all aggregates should be reported" - latchTriggered - 1 * writer.startBucket(5, _, SECONDS.toNanos(reportingInterval)) - for (int i = 0; i < 5; ++i) { - 1 * writer.add(new MetricKey( - "resource", - "service" + i, - "operation", - null, - "type", - HTTP_OK, - false, - false, - "quux", - [], - null, - null, - null - ), { AggregateMetric value -> - value.getHitCount() == 1 && value.getDuration() == duration - }) - } - 1 * writer.finishBucket() >> { latch.countDown() } - - when: - reportAndWaitUntilEmpty(aggregator) - - then: "aggregate not updated in cycle is not reported" - 0 * writer.finishBucket() - 0 * writer.startBucket(_, _, _) - 0 * writer.add(_, _) - - cleanup: - aggregator.close() - } - - def "should report periodically"() { - setup: - int maxAggregates = 10 - MetricWriter writer = Mock(MetricWriter) - Sink sink = Stub(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> true - features.peerTags() >> [] - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty, - features, HealthMetrics.NO_OP, sink, writer, maxAggregates, queueSize, 1, SECONDS, false) - long duration = 100 - aggregator.start() - - when: - CountDownLatch latch = new CountDownLatch(1) - for (int i = 0; i < 5; ++i) { - aggregator.publish([ - new SimpleSpan("service" + i, "operation", "resource", "type", false, true, false, 0, duration, HTTP_OK, true) - .setTag(SPAN_KIND, "garply") - ]) - } - def latchTriggered = latch.await(2, SECONDS) - - then: "all aggregates should be reported" - latchTriggered - 1 * writer.startBucket(5, _, SECONDS.toNanos(1)) - for (int i = 0; i < 5; ++i) { - 1 * writer.add(new MetricKey( - "resource", - "service" + i, - "operation", - null, - "type", - HTTP_OK, - false, - true, - "garply", - [], - null, - null, - null - ), { AggregateMetric value -> - value.getHitCount() == 1 && value.getDuration() == duration - }) - } - 1 * writer.finishBucket() >> { latch.countDown() } - - cleanup: - aggregator.close() - } - - def "should be resilient to serialization errors"() { - setup: - int maxAggregates = 10 - MetricWriter writer = Mock(MetricWriter) - Sink sink = Stub(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> true - features.peerTags() >> [] - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty, - features, HealthMetrics.NO_OP, sink, writer, maxAggregates, queueSize, 1, SECONDS, false) - long duration = 100 - aggregator.start() - - when: - CountDownLatch latch = new CountDownLatch(1) - for (int i = 0; i < 5; ++i) { - aggregator.publish([ - new SimpleSpan("service" + i, "operation", "resource", "type", false, true, false, 0, duration, HTTP_OK) - ]) - } - def latchTriggered = latch.await(2, SECONDS) - - then: "writer should be reset if reporting fails" - latchTriggered - 1 * writer.startBucket(_, _, _) >> { - throw new IllegalArgumentException("something went wrong") - } - 1 * writer.reset() >> { latch.countDown() } - - cleanup: - aggregator.close() - } - - def "force flush should not block if metrics are disabled"() { - setup: - int maxAggregates = 10 - MetricWriter writer = Mock(MetricWriter) - Sink sink = Stub(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty, - features, HealthMetrics.NO_OP, sink, writer, maxAggregates, queueSize, 1, SECONDS, false) - aggregator.start() - - when: - def flushed = aggregator.forceReport().get(10, SECONDS) - - then: - notThrown(TimeoutException) - !flushed - - cleanup: - aggregator.close() - } - - def "should start even if the agent is not available"() { - setup: - MetricWriter writer = Mock(MetricWriter) - Sink sink = Stub(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> false - features.peerTags() >> [] - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty, - features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, 200, MILLISECONDS, false) - final spans = [ - new SimpleSpan("service", "operation", "resource", "type", false, true, false, 0, 10, HTTP_OK) - ] - aggregator.start() - - when: - aggregator.publish(spans) - Thread.sleep(1_000) - - then: - 0 * writer._ - when: - features.supportsMetrics() >> true - aggregator.publish(spans) - Thread.sleep(1_000) - - then: - (1.._) * writer._ - - cleanup: - aggregator.close() - } - - def "force flush should wait for aggregator to start"() { - setup: - int maxAggregates = 10 - MetricWriter writer = Mock(MetricWriter) - Sink sink = Stub(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> true - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty, - features, HealthMetrics.NO_OP, sink, writer, maxAggregates, queueSize, 1, SECONDS, false) - - when: - def async = CompletableFuture.supplyAsync(new Supplier() { - @Override - Boolean get() { - return aggregator.forceReport().get() - } - }) - async.get(3, SECONDS) - - then: - thrown(TimeoutException) - - when: - aggregator.start() - def flushed = async.get(3, TimeUnit.SECONDS) - - then: - notThrown(TimeoutException) - flushed - - cleanup: - aggregator.close() - } - - def "should not count partial snapshot(long running)"() { - setup: - MetricWriter writer = Mock(MetricWriter) - Sink sink = Stub(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> true - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty, - features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, false) - aggregator.start() - - when: - CountDownLatch latch = new CountDownLatch(1) - aggregator.publish([ - new SimpleSpan("service", "operation", "resource", "type", true, true, false, 0, 100, HTTP_OK, true, 12345), - new SimpleSpan("service", "operation", "resource", "type", true, true, false, 0, 100, HTTP_OK, true, 0) - ]) - aggregator.report() - def latchTriggered = latch.await(2, SECONDS) - - then: - latchTriggered - 1 * writer.startBucket(1, _, _) - 1 * writer.add( - new MetricKey( - "resource", - "service", - "operation", - null, - "type", - HTTP_OK, - false, - true, - "", - [], - null, - null, - null - ), { AggregateMetric aggregateMetric -> - aggregateMetric.getHitCount() == 1 && aggregateMetric.getTopLevelCount() == 1 && aggregateMetric.getDuration() == 100 - }) - 1 * writer.finishBucket() >> { latch.countDown() } - - cleanup: - aggregator.close() - } - - def "should not change metric buckets when includeEndpointInMetrics is disabled"() { - setup: - MetricWriter writer = Mock(MetricWriter) - Sink sink = Stub(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> true - features.peerTags() >> [] - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty, - features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, false) - aggregator.start() - - when: "publishing spans with different http.method and http.endpoint" - CountDownLatch latch = new CountDownLatch(1) - aggregator.publish([ - new SimpleSpan("service", "operation", "resource", "type", false, true, false, 0, 100, HTTP_OK) - .setTag(SPAN_KIND, "server") - .setTag("http.method", "GET") - .setTag("http.endpoint", "/api/users/:id"), - new SimpleSpan("service", "operation", "resource", "type", false, true, false, 0, 200, HTTP_OK) - .setTag(SPAN_KIND, "server") - .setTag("http.method", "POST") - .setTag("http.endpoint", "/api/orders"), - new SimpleSpan("service", "operation", "resource", "type", false, true, false, 0, 150, HTTP_OK) - .setTag(SPAN_KIND, "server") - ]) - reportAndWaitUntilEmpty(aggregator) - def latchTriggered = latch.await(2, SECONDS) - - then: "all spans should go to the same bucket (httpMethod and httpEndpoint are ignored)" - latchTriggered - 1 * writer.startBucket(1, _, _) - 1 * writer.add( - new MetricKey( - "resource", - "service", - "operation", - null, - "type", - HTTP_OK, - false, - false, - "server", - [], - null, - null, - null - ), { AggregateMetric aggregateMetric -> - aggregateMetric.getHitCount() == 3 && aggregateMetric.getTopLevelCount() == 3 && aggregateMetric.getDuration() == 450 - }) - 1 * writer.finishBucket() >> { latch.countDown() } - - cleanup: - aggregator.close() - } - - def "should separate metric buckets when includeEndpointInMetrics is enabled"() { - setup: - MetricWriter writer = Mock(MetricWriter) - Sink sink = Stub(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> true - features.peerTags() >> [] - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty, - features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, true) - aggregator.start() - - when: "publishing spans with different http.method and http.endpoint" - CountDownLatch latch = new CountDownLatch(1) - aggregator.publish([ - new SimpleSpan("service", "operation", "resource", "type", false, true, false, 0, 100, HTTP_OK) - .setTag(SPAN_KIND, "server") - .setTag("http.method", "GET") - .setTag("http.endpoint", "/api/users/:id"), - new SimpleSpan("service", "operation", "resource", "type", false, true, false, 0, 200, HTTP_OK) - .setTag(SPAN_KIND, "server") - .setTag("http.method", "POST") - .setTag("http.endpoint", "/api/orders"), - new SimpleSpan("service", "operation", "resource", "type", false, true, false, 0, 150, HTTP_OK) - .setTag(SPAN_KIND, "server") - ]) - reportAndWaitUntilEmpty(aggregator) - def latchTriggered = latch.await(2, SECONDS) - - then: "spans should go to separate buckets based on httpMethod and httpEndpoint" - latchTriggered - 1 * writer.startBucket(3, _, _) - 1 * writer.add( - new MetricKey( - "resource", - "service", - "operation", - null, - "type", - HTTP_OK, - false, - false, - "server", - [], - "GET", - "/api/users/:id", - null - ), { AggregateMetric aggregateMetric -> - aggregateMetric.getHitCount() == 1 && aggregateMetric.getTopLevelCount() == 1 && aggregateMetric.getDuration() == 100 - }) - 1 * writer.add( - new MetricKey( - "resource", - "service", - "operation", - null, - "type", - HTTP_OK, - false, - false, - "server", - [], - "POST", - "/api/orders", - null - ), { AggregateMetric aggregateMetric -> - aggregateMetric.getHitCount() == 1 && aggregateMetric.getTopLevelCount() == 1 && aggregateMetric.getDuration() == 200 - }) - 1 * writer.add( - new MetricKey( - "resource", - "service", - "operation", - null, - "type", - HTTP_OK, - false, - false, - "server", - [], - null, - null, - null - ), { AggregateMetric aggregateMetric -> - aggregateMetric.getHitCount() == 1 && aggregateMetric.getTopLevelCount() == 1 && aggregateMetric.getDuration() == 150 - }) - 1 * writer.finishBucket() >> { latch.countDown() } - - cleanup: - aggregator.close() - } - - def "should include grpc status code in metric key for rpc spans"() { - setup: - MetricWriter writer = Mock(MetricWriter) - Sink sink = Stub(Sink) - DDAgentFeaturesDiscovery features = Mock(DDAgentFeaturesDiscovery) - features.supportsMetrics() >> true - features.peerTags() >> [] - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator(empty, - features, HealthMetrics.NO_OP, sink, writer, 10, queueSize, reportingInterval, SECONDS, false) - aggregator.start() - - when: - CountDownLatch latch = new CountDownLatch(1) - aggregator.publish([ - new SimpleSpan("service", "grpc.server", "grpc.service/Method", "rpc", true, false, false, 0, 100, 0) - .setTag(SPAN_KIND, "server") - .setTag(InstrumentationTags.GRPC_STATUS_CODE, 0), - new SimpleSpan("service", "grpc.server", "grpc.service/Method", "rpc", true, false, false, 0, 50, 0) - .setTag(SPAN_KIND, "server") - .setTag(InstrumentationTags.GRPC_STATUS_CODE, 5), - new SimpleSpan("service", "http.request", "GET /api", "web", true, false, false, 0, 75, 200) - .setTag(SPAN_KIND, "server") - ]) - aggregator.report() - def latchTriggered = latch.await(2, SECONDS) - - then: - latchTriggered - 1 * writer.startBucket(3, _, _) - 1 * writer.add(new MetricKey( - "grpc.service/Method", - "service", - "grpc.server", - null, - "rpc", - 0, - false, - false, - "server", - [], - null, - null, - "0" - ), _) - 1 * writer.add(new MetricKey( - "grpc.service/Method", - "service", - "grpc.server", - null, - "rpc", - 0, - false, - false, - "server", - [], - null, - null, - "5" - ), _) - 1 * writer.add(new MetricKey( - "GET /api", - "service", - "http.request", - null, - "web", - 200, - false, - false, - "server", - [], - null, - null, - null - ), _) - 1 * writer.finishBucket() >> { latch.countDown() } - - cleanup: - aggregator.close() - } - - def reportAndWaitUntilEmpty(ConflatingMetricsAggregator aggregator) { - waitUntilEmpty(aggregator) - aggregator.report() - waitUntilEmpty(aggregator) - } - - - def waitUntilEmpty(ConflatingMetricsAggregator aggregator) { - int i = 0 - while (!aggregator.inbox.isEmpty() && i++ < 100) { - Thread.sleep(10) - } - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/common/metrics/FootprintForkedTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/common/metrics/FootprintForkedTest.groovy index eceedeb1935..86a91c23b3f 100644 --- a/dd-trace-core/src/test/groovy/datadog/trace/common/metrics/FootprintForkedTest.groovy +++ b/dd-trace-core/src/test/groovy/datadog/trace/common/metrics/FootprintForkedTest.groovy @@ -37,7 +37,7 @@ class FootprintForkedTest extends DDSpecification { it.supportsMetrics() >> true it.peerTags() >> [] } - ConflatingMetricsAggregator aggregator = new ConflatingMetricsAggregator( + ClientStatsAggregator aggregator = new ClientStatsAggregator( new WellKnownTags("runtimeid","hostname", "env", "service", "version","language"), [].toSet() as Set, features, diff --git a/dd-trace-core/src/test/groovy/datadog/trace/common/metrics/MetricsAggregatorFactoryTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/common/metrics/MetricsAggregatorFactoryTest.groovy deleted file mode 100644 index 07f246bf9a9..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/common/metrics/MetricsAggregatorFactoryTest.groovy +++ /dev/null @@ -1,33 +0,0 @@ -package datadog.trace.common.metrics - -import datadog.communication.ddagent.SharedCommunicationObjects -import datadog.trace.api.Config -import datadog.trace.core.monitor.HealthMetrics -import datadog.trace.test.util.DDSpecification -import okhttp3.HttpUrl - -class MetricsAggregatorFactoryTest extends DDSpecification { - - def "when metrics disabled no-op aggregator created"() { - setup: - Config config = Mock(Config) - config.isTracerMetricsEnabled() >> false - def sco = Mock(SharedCommunicationObjects) - sco.agentUrl = HttpUrl.parse("http://localhost:8126") - expect: - def aggregator = MetricsAggregatorFactory.createMetricsAggregator(config, sco, HealthMetrics.NO_OP,) - assert aggregator instanceof NoOpMetricsAggregator - } - - def "when metrics enabled conflating aggregator created"() { - setup: - Config config = Spy(Config.get()) - config.isTracerMetricsEnabled() >> true - def sco = Mock(SharedCommunicationObjects) - sco.agentUrl = HttpUrl.parse("http://localhost:8126") - expect: - def aggregator = MetricsAggregatorFactory.createMetricsAggregator(config, sco, HealthMetrics.NO_OP, - ) - assert aggregator instanceof ConflatingMetricsAggregator - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/common/metrics/SerializingMetricWriterTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/common/metrics/SerializingMetricWriterTest.groovy index 3ff81de9851..080a77238e4 100644 --- a/dd-trace-core/src/test/groovy/datadog/trace/common/metrics/SerializingMetricWriterTest.groovy +++ b/dd-trace-core/src/test/groovy/datadog/trace/common/metrics/SerializingMetricWriterTest.groovy @@ -7,7 +7,6 @@ import static java.util.concurrent.TimeUnit.SECONDS import datadog.metrics.api.Histograms import datadog.metrics.impl.DDSketchHistograms import datadog.trace.api.Config -import datadog.trace.api.Pair import datadog.trace.api.ProcessTags import datadog.trace.api.WellKnownTags import datadog.trace.api.git.CommitInfo @@ -16,7 +15,6 @@ import datadog.trace.api.git.GitInfoProvider import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString import datadog.trace.test.util.DDSpecification import java.nio.ByteBuffer -import java.util.concurrent.atomic.AtomicLongArray import org.msgpack.core.MessagePack import org.msgpack.core.MessageUnpacker @@ -26,6 +24,30 @@ class SerializingMetricWriterTest extends DDSpecification { Histograms.register(DDSketchHistograms.FACTORY) } + /** Build an {@link AggregateEntry} with a pre-recorded duration count. */ + private static AggregateEntry entry( + CharSequence resource, + CharSequence service, + CharSequence operationName, + CharSequence serviceSource, + CharSequence type, + int httpStatusCode, + boolean synthetic, + boolean traceRoot, + CharSequence spanKind, + List peerTags, + CharSequence httpMethod, + CharSequence httpEndpoint, + CharSequence grpcStatusCode, + int hitCount) { + AggregateEntry e = AggregateEntryTestUtils.of( + resource, service, operationName, serviceSource, type, + httpStatusCode, synthetic, traceRoot, spanKind, peerTags, + httpMethod, httpEndpoint, grpcStatusCode) + hitCount.times { e.recordOneDuration(1L) } + return e + } + def "should produce correct message #iterationIndex with process tags enabled #withProcessTags" () { setup: if (!withProcessTags) { @@ -40,8 +62,8 @@ class SerializingMetricWriterTest extends DDSpecification { when: writer.startBucket(content.size(), startTime, duration) - for (Pair pair : content) { - writer.add(pair.getLeft(), pair.getRight()) + for (AggregateEntry e : content) { + writer.add(e) } writer.finishBucket() @@ -55,88 +77,40 @@ class SerializingMetricWriterTest extends DDSpecification { where: content << [ [ - Pair.of( - new MetricKey( - "resource1", - "service1", - "operation1", - null, - "type", - 0, - false, - false, - "client", + entry( + "resource1", "service1", "operation1", null, "type", 0, + false, false, "client", [ UTF8BytesString.create("country:canada"), UTF8BytesString.create("georegion:amer"), UTF8BytesString.create("peer.service:remote-service") ], - null, - null, - null - ), - new AggregateMetric().recordDurations(10, new AtomicLongArray(1L)) - ), - Pair.of( - new MetricKey( - "resource2", - "service2", - "operation2", - null, - "type2", - 200, - true, - false, - "producer", + null, null, null, + 10), + entry( + "resource2", "service2", "operation2", null, "type2", 200, + true, false, "producer", [ UTF8BytesString.create("country:canada"), UTF8BytesString.create("georegion:amer"), UTF8BytesString.create("peer.service:remote-service") ], - null, - null, - null - ), - new AggregateMetric().recordDurations(9, new AtomicLongArray(1L)) - ), - Pair.of( - new MetricKey( - "GET /api/users/:id", - "web-service", - "http.request", - null, - "web", - 200, - false, - true, - "server", + null, null, null, + 9), + entry( + "GET /api/users/:id", "web-service", "http.request", null, "web", 200, + false, true, "server", [], - "GET", - "/api/users/:id", - null - ), - new AggregateMetric().recordDurations(5, new AtomicLongArray(1L)) - ) + null, null, null, + 5) ], (0..10000).collect({ i -> - Pair.of( - new MetricKey( - "resource" + i, - "service" + i, - "operation" + i, - null, - "type", - 0, - false, - false, - "producer", + entry( + "resource" + i, "service" + i, "operation" + i, null, "type", 0, + false, false, "producer", [UTF8BytesString.create("messaging.destination:dest" + i)], - null, - null, - null - ), - new AggregateMetric().recordDurations(10, new AtomicLongArray(1L)) - ) + null, null, null, + 10) }) ] withProcessTags << [true, false] @@ -148,22 +122,18 @@ class SerializingMetricWriterTest extends DDSpecification { long duration = SECONDS.toNanos(10) WellKnownTags wellKnownTags = new WellKnownTags("runtimeid", "hostname", "env", "service", "version", "language") - // Create keys with different combinations of HTTP fields - def keyWithNoSource = new MetricKey("resource", "service", "operation", null, "type", 200, false, false, "server", [], "GET", "/api/users", null) - def keyWithSource = new MetricKey("resource", "service", "operation", "source", "type", 200, false, false, "server", [], "POST", null, null) + def entryNoSource = entry("resource", "service", "operation", null, "type", 200, false, false, "server", [], "GET", "/api/users", null, 1) + def entryWithSource = entry("resource", "service", "operation", "source", "type", 200, false, false, "server", [], "POST", null, null, 1) - def content = [ - Pair.of(keyWithNoSource, new AggregateMetric().recordDurations(1, new AtomicLongArray(1L))), - Pair.of(keyWithSource, new AggregateMetric().recordDurations(1, new AtomicLongArray(1L))), - ] + def content = [entryNoSource, entryWithSource] ValidatingSink sink = new ValidatingSink(wellKnownTags, startTime, duration, content) SerializingMetricWriter writer = new SerializingMetricWriter(wellKnownTags, sink, 128) when: writer.startBucket(content.size(), startTime, duration) - for (Pair pair : content) { - writer.add(pair.getLeft(), pair.getRight()) + for (AggregateEntry e : content) { + writer.add(e) } writer.finishBucket() @@ -177,34 +147,25 @@ class SerializingMetricWriterTest extends DDSpecification { long duration = SECONDS.toNanos(10) WellKnownTags wellKnownTags = new WellKnownTags("runtimeid", "hostname", "env", "service", "version", "language") - // Create keys with different combinations of HTTP fields - def keyWithBoth = new MetricKey("resource", "service", "operation", null, "type", 200, false, false, "server", [], "GET", "/api/users", null) - def keyWithMethodOnly = new MetricKey("resource", "service", "operation", null, "type", 200, false, false, "server", [], "POST", null,null) - def keyWithEndpointOnly = new MetricKey("resource", "service", "operation", null, "type", 200, false, false, "server", [], null, "/api/orders",null) - def keyWithNeither = new MetricKey("resource", "service", "operation", null, "type", 200, false, false, "client", [], null, null, null) - - def content = [ - Pair.of(keyWithBoth, new AggregateMetric().recordDurations(1, new AtomicLongArray(1L))), - Pair.of(keyWithMethodOnly, new AggregateMetric().recordDurations(1, new AtomicLongArray(1L))), - Pair.of(keyWithEndpointOnly, new AggregateMetric().recordDurations(1, new AtomicLongArray(1L))), - Pair.of(keyWithNeither, new AggregateMetric().recordDurations(1, new AtomicLongArray(1L))) - ] + def entryWithBoth = entry("resource", "service", "operation", null, "type", 200, false, false, "server", [], "GET", "/api/users", null, 1) + def entryWithMethodOnly = entry("resource", "service", "operation", null, "type", 200, false, false, "server", [], "POST", null, null, 1) + def entryWithEndpointOnly = entry("resource", "service", "operation", null, "type", 200, false, false, "server", [], null, "/api/orders", null, 1) + def entryWithNeither = entry("resource", "service", "operation", null, "type", 200, false, false, "client", [], null, null, null, 1) + + def content = [entryWithBoth, entryWithMethodOnly, entryWithEndpointOnly, entryWithNeither] ValidatingSink sink = new ValidatingSink(wellKnownTags, startTime, duration, content) SerializingMetricWriter writer = new SerializingMetricWriter(wellKnownTags, sink, 128) when: writer.startBucket(content.size(), startTime, duration) - for (Pair pair : content) { - writer.add(pair.getLeft(), pair.getRight()) + for (AggregateEntry e : content) { + writer.add(e) } writer.finishBucket() then: sink.validatedInput() - // Test passes if validation in ValidatingSink succeeds - // ValidatingSink verifies that map size matches actual number of fields - // and that HTTPMethod/HTTPEndpoint are only present when non-empty } def "add git sha commit info when sha commit is #shaCommit"() { @@ -216,44 +177,69 @@ class SerializingMetricWriterTest extends DDSpecification { long duration = SECONDS.toNanos(10) WellKnownTags wellKnownTags = new WellKnownTags("runtimeid", "hostname", "env", "service", "version", "language") - // Create keys with different combinations of HTTP fields - def key = new MetricKey("resource", "service", "operation", null, "type", 200, false, false, "server", [], "GET", "/api/users", null) + def e = entry("resource", "service", "operation", null, "type", 200, false, false, "server", [], "GET", "/api/users", null, 1) - def content = [Pair.of(key, new AggregateMetric().recordDurations(1, new AtomicLongArray(1L))),] + def content = [e] - ValidatingSink sink = new ValidatingSink(wellKnownTags, startTime, duration, content) + ValidatingSink sink = new ValidatingSink(wellKnownTags, startTime, duration, content, shaCommit) SerializingMetricWriter writer = new SerializingMetricWriter(wellKnownTags, sink, 128, gitInfoProvider) when: - writer.startBucket(content.size(), startTime, duration) - for (Pair pair : content) { - writer.add(pair.getLeft(), pair.getRight()) + for (AggregateEntry entryItem : content) { + writer.add(entryItem) } writer.finishBucket() then: - sink.validatedInput() where: shaCommit << [null, "123456"] } + def "GRPCStatusCode field is present in payload for rpc-type spans"() { + setup: + long startTime = MILLISECONDS.toNanos(System.currentTimeMillis()) + long duration = SECONDS.toNanos(10) + WellKnownTags wellKnownTags = new WellKnownTags("runtimeid", "hostname", "env", "service", "version", "language") + + def entryWithGrpc = entry("grpc.service/Method", "grpc-service", "grpc.server", null, "rpc", 0, false, false, "server", [], null, null, "OK", 1) + def entryWithGrpcError = entry("grpc.service/Method", "grpc-service", "grpc.server", null, "rpc", 0, false, false, "client", [], null, null, "NOT_FOUND", 1) + def entryWithoutGrpc = entry("resource", "service", "operation", null, "web", 200, false, false, "server", [], null, null, null, 1) + + def content = [entryWithGrpc, entryWithGrpcError, entryWithoutGrpc] + + ValidatingSink sink = new ValidatingSink(wellKnownTags, startTime, duration, content) + SerializingMetricWriter writer = new SerializingMetricWriter(wellKnownTags, sink, 128) + + when: + writer.startBucket(content.size(), startTime, duration) + for (AggregateEntry e : content) { + writer.add(e) + } + writer.finishBucket() + + then: + sink.validatedInput() + } + static class ValidatingSink implements Sink { private final WellKnownTags wellKnownTags private final long startTimeNanos private final long duration private boolean validated = false - private List> content + private List content + private final String expectedGitCommitSha ValidatingSink(WellKnownTags wellKnownTags, long startTimeNanos, long duration, - List> content) { + List content, String expectedGitCommitSha = null) { this.wellKnownTags = wellKnownTags this.startTimeNanos = startTimeNanos this.duration = duration this.content = content + this.expectedGitCommitSha = expectedGitCommitSha } @Override @@ -264,7 +250,7 @@ class SerializingMetricWriterTest extends DDSpecification { void accept(int messageCount, ByteBuffer buffer) { MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(buffer) int mapSize = unpacker.unpackMapHeader() - String gitCommitSha = GitInfoProvider.INSTANCE.getGitInfo()?.getCommit()?.getSha() + String gitCommitSha = expectedGitCommitSha assert mapSize == (7 + (Config.get().isExperimentalPropagateProcessTagsEnabled() ? 1 : 0) + (gitCommitSha != null ? 1 : 0)) assert unpacker.unpackString() == "RuntimeID" @@ -298,83 +284,82 @@ class SerializingMetricWriterTest extends DDSpecification { assert unpacker.unpackString() == "Stats" int statCount = unpacker.unpackArrayHeader() assert statCount == content.size() - for (Pair pair : content) { - MetricKey key = pair.getLeft() - AggregateMetric value = pair.getRight() + for (AggregateEntry entry : content) { + // counters now live on AggregateEntry int metricMapSize = unpacker.unpackMapHeader() // Calculate expected map size based on optional fields - boolean hasHttpMethod = key.getHttpMethod() != null - boolean hasHttpEndpoint = key.getHttpEndpoint() != null - boolean hasServiceSource = key.getServiceSource() != null - boolean hasGrpcStatusCode = key.getGrpcStatusCode() != null + boolean hasHttpMethod = entry.hasHttpMethod() + boolean hasHttpEndpoint = entry.hasHttpEndpoint() + boolean hasServiceSource = entry.hasServiceSource() + boolean hasGrpcStatusCode = entry.hasGrpcStatusCode() int expectedMapSize = 15 + (hasServiceSource ? 1 : 0) + (hasHttpMethod ? 1 : 0) + (hasHttpEndpoint ? 1 : 0) + (hasGrpcStatusCode ? 1 : 0) assert metricMapSize == expectedMapSize int elementCount = 0 assert unpacker.unpackString() == "Name" - assert unpacker.unpackString() == key.getOperationName() as String + assert unpacker.unpackString() == entry.getOperationName() as String ++elementCount assert unpacker.unpackString() == "Service" - assert unpacker.unpackString() == key.getService() as String + assert unpacker.unpackString() == entry.getService() as String ++elementCount assert unpacker.unpackString() == "Resource" - assert unpacker.unpackString() == key.getResource() as String + assert unpacker.unpackString() == entry.getResource() as String ++elementCount assert unpacker.unpackString() == "Type" - assert unpacker.unpackString() == key.getType() as String + assert unpacker.unpackString() == entry.getType() as String ++elementCount assert unpacker.unpackString() == "HTTPStatusCode" - assert unpacker.unpackInt() == key.getHttpStatusCode() + assert unpacker.unpackInt() == entry.getHttpStatusCode() ++elementCount assert unpacker.unpackString() == "Synthetics" - assert unpacker.unpackBoolean() == key.isSynthetics() + assert unpacker.unpackBoolean() == entry.isSynthetics() ++elementCount assert unpacker.unpackString() == "IsTraceRoot" - assert unpacker.unpackInt() == (key.isTraceRoot() ? TriState.TRUE.serialValue : TriState.FALSE.serialValue) + assert unpacker.unpackInt() == (entry.isTraceRoot() ? TriState.TRUE.serialValue : TriState.FALSE.serialValue) ++elementCount assert unpacker.unpackString() == "SpanKind" - assert unpacker.unpackString() == key.getSpanKind() as String + assert unpacker.unpackString() == entry.getSpanKind() as String ++elementCount assert unpacker.unpackString() == "PeerTags" int peerTagsLength = unpacker.unpackArrayHeader() - assert peerTagsLength == key.getPeerTags().size() + assert peerTagsLength == entry.getPeerTags().size() for (int i = 0; i < peerTagsLength; i++) { def unpackedPeerTag = unpacker.unpackString() - assert unpackedPeerTag == key.getPeerTags()[i].toString() + assert unpackedPeerTag == entry.getPeerTags()[i].toString() } ++elementCount // Service source is only present when the service name has been overridden by the tracer if (hasServiceSource) { assert unpacker.unpackString() == "srv_src" - assert unpacker.unpackString() == key.getServiceSource().toString() + assert unpacker.unpackString() == entry.getServiceSource().toString() ++elementCount } // HTTPMethod and HTTPEndpoint are optional - only present if non-null if (hasHttpMethod) { assert unpacker.unpackString() == "HTTPMethod" - assert unpacker.unpackString() == key.getHttpMethod() as String + assert unpacker.unpackString() == entry.getHttpMethod() as String ++elementCount } if (hasHttpEndpoint) { assert unpacker.unpackString() == "HTTPEndpoint" - assert unpacker.unpackString() == key.getHttpEndpoint() as String + assert unpacker.unpackString() == entry.getHttpEndpoint() as String ++elementCount } if (hasGrpcStatusCode) { assert unpacker.unpackString() == "GRPCStatusCode" - assert unpacker.unpackString() == key.getGrpcStatusCode() as String + assert unpacker.unpackString() == entry.getGrpcStatusCode() as String ++elementCount } assert unpacker.unpackString() == "Hits" - assert unpacker.unpackInt() == value.getHitCount() + assert unpacker.unpackInt() == entry.getHitCount() ++elementCount assert unpacker.unpackString() == "Errors" - assert unpacker.unpackInt() == value.getErrorCount() + assert unpacker.unpackInt() == entry.getErrorCount() ++elementCount assert unpacker.unpackString() == "TopLevelHits" - assert unpacker.unpackInt() == value.getTopLevelCount() + assert unpacker.unpackInt() == entry.getTopLevelCount() ++elementCount assert unpacker.unpackString() == "Duration" - assert unpacker.unpackLong() == value.getDuration() + assert unpacker.unpackLong() == entry.getDuration() ++elementCount assert unpacker.unpackString() == "OkSummary" validateSketch(unpacker) @@ -397,99 +382,4 @@ class SerializingMetricWriterTest extends DDSpecification { return validated } } - - def "ServiceSource optional in the payload"() { - setup: - long startTime = MILLISECONDS.toNanos(System.currentTimeMillis()) - long duration = SECONDS.toNanos(10) - WellKnownTags wellKnownTags = new WellKnownTags("runtimeid", "hostname", "env", "service", "version", "language") - - // Create keys with different combinations of HTTP fields - def keyWithNoSource = new MetricKey("resource", "service", "operation", null, "type", 200, false, false, "server", [], "GET", "/api/users", null) - def keyWithSource = new MetricKey("resource", "service", "operation", "source", "type", 200, false, false, "server", [], "POST", null, null) - - def content = [ - Pair.of(keyWithNoSource, new AggregateMetric().recordDurations(1, new AtomicLongArray(1L))), - Pair.of(keyWithSource, new AggregateMetric().recordDurations(1, new AtomicLongArray(1L))), - ] - - ValidatingSink sink = new ValidatingSink(wellKnownTags, startTime, duration, content) - SerializingMetricWriter writer = new SerializingMetricWriter(wellKnownTags, sink, 128) - - when: - writer.startBucket(content.size(), startTime, duration) - for (Pair pair : content) { - writer.add(pair.getLeft(), pair.getRight()) - } - writer.finishBucket() - - then: - sink.validatedInput() - } - - def "GRPCStatusCode field is present in payload for rpc-type spans"() { - setup: - long startTime = MILLISECONDS.toNanos(System.currentTimeMillis()) - long duration = SECONDS.toNanos(10) - WellKnownTags wellKnownTags = new WellKnownTags("runtimeid", "hostname", "env", "service", "version", "language") - - def keyWithGrpc = new MetricKey("grpc.service/Method", "grpc-service", "grpc.server", null, "rpc", 0, false, false, "server", [], null, null, "OK") - def keyWithGrpcError = new MetricKey("grpc.service/Method", "grpc-service", "grpc.server", null, "rpc", 0, false, false, "client", [], null, null, "NOT_FOUND") - def keyWithoutGrpc = new MetricKey("resource", "service", "operation", null, "web", 200, false, false, "server", [], null, null, null) - - def content = [ - Pair.of(keyWithGrpc, new AggregateMetric().recordDurations(1, new AtomicLongArray(1L))), - Pair.of(keyWithGrpcError, new AggregateMetric().recordDurations(1, new AtomicLongArray(1L))), - Pair.of(keyWithoutGrpc, new AggregateMetric().recordDurations(1, new AtomicLongArray(1L))) - ] - - ValidatingSink sink = new ValidatingSink(wellKnownTags, startTime, duration, content) - SerializingMetricWriter writer = new SerializingMetricWriter(wellKnownTags, sink, 128) - - when: - writer.startBucket(content.size(), startTime, duration) - for (Pair pair : content) { - writer.add(pair.getLeft(), pair.getRight()) - } - writer.finishBucket() - - then: - sink.validatedInput() - } - - def "HTTPMethod and HTTPEndpoint fields are optional in payload"() { - setup: - long startTime = MILLISECONDS.toNanos(System.currentTimeMillis()) - long duration = SECONDS.toNanos(10) - WellKnownTags wellKnownTags = new WellKnownTags("runtimeid", "hostname", "env", "service", "version", "language") - - // Create keys with different combinations of HTTP fields - def keyWithBoth = new MetricKey("resource", "service", "operation", null, "type", 200, false, false, "server", [], "GET", "/api/users", null) - def keyWithMethodOnly = new MetricKey("resource", "service", "operation", null, "type", 200, false, false, "server", [], "POST", null, null) - def keyWithEndpointOnly = new MetricKey("resource", "service", "operation", null, "type", 200, false, false, "server", [], null, "/api/orders", null) - def keyWithNeither = new MetricKey("resource", "service", "operation", null, "type", 200, false, false, "client", [], null, null, null) - - def content = [ - Pair.of(keyWithBoth, new AggregateMetric().recordDurations(1, new AtomicLongArray(1L))), - Pair.of(keyWithMethodOnly, new AggregateMetric().recordDurations(1, new AtomicLongArray(1L))), - Pair.of(keyWithEndpointOnly, new AggregateMetric().recordDurations(1, new AtomicLongArray(1L))), - Pair.of(keyWithNeither, new AggregateMetric().recordDurations(1, new AtomicLongArray(1L))) - ] - - ValidatingSink sink = new ValidatingSink(wellKnownTags, startTime, duration, content) - SerializingMetricWriter writer = new SerializingMetricWriter(wellKnownTags, sink, 128) - - when: - writer.startBucket(content.size(), startTime, duration) - for (Pair pair : content) { - writer.add(pair.getLeft(), pair.getRight()) - } - writer.finishBucket() - - then: - sink.validatedInput() - // Test passes if validation in ValidatingSink succeeds - // ValidatingSink verifies that map size matches actual number of fields - // and that HTTPMethod/HTTPEndpoint are only present when non-empty - } } diff --git a/dd-trace-core/src/test/groovy/datadog/trace/common/metrics/SimpleSpan.groovy b/dd-trace-core/src/test/groovy/datadog/trace/common/metrics/SimpleSpan.groovy index bfc1ee2f4e7..8cb37243790 100644 --- a/dd-trace-core/src/test/groovy/datadog/trace/common/metrics/SimpleSpan.groovy +++ b/dd-trace-core/src/test/groovy/datadog/trace/common/metrics/SimpleSpan.groovy @@ -2,8 +2,11 @@ package datadog.trace.common.metrics import datadog.trace.api.DDSpanId import datadog.trace.api.DDTraceId +import datadog.trace.bootstrap.instrumentation.api.Tags import datadog.trace.core.CoreSpan +import datadog.trace.core.DDSpanContext import datadog.trace.core.MetadataConsumer +import datadog.trace.core.SpanKindFilter class SimpleSpan implements CoreSpan { @@ -24,6 +27,8 @@ class SimpleSpan implements CoreSpan { private final Map tags = [:] + private byte spanKindOrdinal = 0 // SPAN_KIND_UNSET + SimpleSpan( String serviceName, String operationName, @@ -171,6 +176,9 @@ class SimpleSpan implements CoreSpan { @Override SimpleSpan setTag(String tag, Object value) { tags.put(tag, value) + if (Tags.SPAN_KIND == tag) { + spanKindOrdinal = DDSpanContext.spanKindOrdinalOf(value == null ? null : value.toString()) + } return this } @@ -191,6 +199,16 @@ class SimpleSpan implements CoreSpan { return getTag(name, null) } + @Override + U unsafeGetTag(CharSequence name, U defaultValue) { + return getTag(name, defaultValue) + } + + @Override + U unsafeGetTag(CharSequence name) { + return getTag(name) + } + @Override boolean hasSamplingPriority() { return false @@ -211,6 +229,11 @@ class SimpleSpan implements CoreSpan { return false } + @Override + boolean isKind(SpanKindFilter filter) { + return filter.matches(spanKindOrdinal) + } + @Override CharSequence getType() { return type @@ -222,9 +245,6 @@ class SimpleSpan implements CoreSpan { @Override void processTagsAndBaggage(MetadataConsumer consumer) {} - @Override - void processTagsAndBaggage(MetadataConsumer consumer, boolean injectLinksAsTags, boolean injectBaggageAsTags) {} - @Override SimpleSpan setSamplingPriority(int samplingPriority, int samplingMechanism) { return this diff --git a/dd-trace-core/src/test/groovy/datadog/trace/common/sampling/AsmStandaloneSamplerTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/common/sampling/AsmStandaloneSamplerTest.groovy index c97d6f47013..7ec7579f77b 100644 --- a/dd-trace-core/src/test/groovy/datadog/trace/common/sampling/AsmStandaloneSamplerTest.groovy +++ b/dd-trace-core/src/test/groovy/datadog/trace/common/sampling/AsmStandaloneSamplerTest.groovy @@ -23,7 +23,7 @@ class AsmStandaloneSamplerTest extends DDCoreSpecification{ def tracer = tracerBuilder().writer(writer).sampler(sampler).build() when: - def span1 = tracer.buildSpan("test").start() + def span1 = tracer.buildSpan("datadog", "test").start() sampler.setSamplingPriority(span1) then: @@ -33,7 +33,7 @@ class AsmStandaloneSamplerTest extends DDCoreSpecification{ span1.getSamplingPriority() == PrioritySampling.SAMPLER_KEEP when: - def span2 = tracer.buildSpan("test2").start() + def span2 = tracer.buildSpan("datadog", "test2").start() sampler.setSamplingPriority(span2) then: @@ -43,7 +43,7 @@ class AsmStandaloneSamplerTest extends DDCoreSpecification{ span2.getSamplingPriority() == PrioritySampling.SAMPLER_DROP when: - def span3 = tracer.buildSpan("test3").start() + def span3 = tracer.buildSpan("datadog", "test3").start() sampler.setSamplingPriority(span3) then: "Mock one minute later" diff --git a/dd-trace-core/src/test/groovy/datadog/trace/common/sampling/ForcePrioritySamplerTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/common/sampling/ForcePrioritySamplerTest.groovy index 546714d5cd5..c2111c7d36f 100644 --- a/dd-trace-core/src/test/groovy/datadog/trace/common/sampling/ForcePrioritySamplerTest.groovy +++ b/dd-trace-core/src/test/groovy/datadog/trace/common/sampling/ForcePrioritySamplerTest.groovy @@ -17,7 +17,7 @@ class ForcePrioritySamplerTest extends DDCoreSpecification { def tracer = tracerBuilder().writer(writer).sampler(sampler).build() when: - def span1 = tracer.buildSpan("test").start() + def span1 = tracer.buildSpan("datadog", "test").start() sampler.setSamplingPriority(span1) then: @@ -43,7 +43,7 @@ class ForcePrioritySamplerTest extends DDCoreSpecification { def tracer = tracerBuilder().writer(writer).sampler(sampler).build() when: - def span = tracer.buildSpan("test").start() + def span = tracer.buildSpan("datadog", "test").start() then: span.getSamplingPriority() == null @@ -69,7 +69,7 @@ class ForcePrioritySamplerTest extends DDCoreSpecification { when: def sampler = new ForcePrioritySampler(SAMPLER_KEEP, DEFAULT) def tracer = tracerBuilder().writer(new LoggingWriter()).sampler(sampler).build() - def span = tracer.buildSpan("root").start() + def span = tracer.buildSpan("datadog", "root").start() if (tagName) { span.setTag(tagName, tagValue) } @@ -91,7 +91,7 @@ class ForcePrioritySamplerTest extends DDCoreSpecification { setup: def sampler = new ForcePrioritySampler(SAMPLER_KEEP, DEFAULT) def tracer = tracerBuilder().writer(new LoggingWriter()).sampler(sampler).build() - def span = tracer.buildSpan("root").start() + def span = tracer.buildSpan("datadog", "root").start() if (tagName) { span.setTag(tagName, tagValue) } diff --git a/dd-trace-core/src/test/groovy/datadog/trace/common/sampling/RateByServiceTraceSamplerTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/common/sampling/RateByServiceTraceSamplerTest.groovy index 123d93adafb..1bfb099670a 100644 --- a/dd-trace-core/src/test/groovy/datadog/trace/common/sampling/RateByServiceTraceSamplerTest.groovy +++ b/dd-trace-core/src/test/groovy/datadog/trace/common/sampling/RateByServiceTraceSamplerTest.groovy @@ -90,7 +90,7 @@ class RateByServiceTraceSamplerTest extends DDCoreSpecification { when: String response = '{"rate_by_service": {"service:spock,env:test":0.0}}' serviceSampler.onResponse("traces", serializer.fromJson(response)) - DDSpan span1 = tracer.buildSpan("fakeOperation") + DDSpan span1 = tracer.buildSpan("datadog", "fakeOperation") .withServiceName("foo") .withTag("env", "bar") .ignoreActiveSpan().start() @@ -106,7 +106,7 @@ class RateByServiceTraceSamplerTest extends DDCoreSpecification { response = '{"rate_by_service": {"service:spock,env:test":1.0, "service:SPOCK,env:Test": 0.0}}' serviceSampler.onResponse("traces", serializer.fromJson(response)) - DDSpan span2 = tracer.buildSpan("fakeOperation") + DDSpan span2 = tracer.buildSpan("datadog", "fakeOperation") .withServiceName("spock") .withTag("env", "test") .ignoreActiveSpan().start() @@ -129,7 +129,7 @@ class RateByServiceTraceSamplerTest extends DDCoreSpecification { def response = '{"rate_by_service": {"service:spock,env:test":1.0}}' serviceSampler.onResponse("traces", serializer.fromJson(response)) - DDSpan span = tracer.buildSpan("fakeOperation") + DDSpan span = tracer.buildSpan("datadog", "fakeOperation") .withServiceName("SPOCK") .withTag("env", "Test") .ignoreActiveSpan().start() @@ -151,7 +151,7 @@ class RateByServiceTraceSamplerTest extends DDCoreSpecification { serviceSampler.onResponse("traces", serializer.fromJson(response)) when: - DDSpan span = tracer.buildSpan("fakeOperation") + DDSpan span = tracer.buildSpan("datadog", "fakeOperation") .withServiceName("spock") .withTag("env", "test") .ignoreActiveSpan().start() @@ -176,7 +176,7 @@ class RateByServiceTraceSamplerTest extends DDCoreSpecification { .fromJson('{"rate_by_service":{"service:,env:":1.0,"service:spock,env:":0.0}}')) when: - def span = tracer.buildSpan("test").start() + def span = tracer.buildSpan("datadog", "test").start() then: span.getSamplingPriority() == null @@ -190,7 +190,7 @@ class RateByServiceTraceSamplerTest extends DDCoreSpecification { span.getSamplingPriority() == PrioritySampling.SAMPLER_DROP when: - span = tracer.buildSpan("test").withTag(DDTags.SERVICE_NAME, "spock").start() + span = tracer.buildSpan("datadog", "test").withTag(DDTags.SERVICE_NAME, "spock").start() span.finish() writer.waitForTraces(2) @@ -205,7 +205,7 @@ class RateByServiceTraceSamplerTest extends DDCoreSpecification { when: def sampler = new RateByServiceTraceSampler() def tracer = tracerBuilder().writer(new LoggingWriter()).sampler(sampler).build() - def span = tracer.buildSpan("root").start() + def span = tracer.buildSpan("datadog", "root").start() if (tagName) { span.setTag(tagName, tagValue) } @@ -392,7 +392,7 @@ class RateByServiceTraceSamplerTest extends DDCoreSpecification { setup: def sampler = new RateByServiceTraceSampler() def tracer = tracerBuilder().writer(new LoggingWriter()).sampler(sampler).build() - def span = tracer.buildSpan("root").start() + def span = tracer.buildSpan("datadog", "root").start() if (tagName) { span.setTag(tagName, tagValue) } diff --git a/dd-trace-core/src/test/groovy/datadog/trace/common/sampling/RuleBasedSamplingTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/common/sampling/RuleBasedSamplingTest.groovy index 8d82fc14a14..8d4416d6bf7 100644 --- a/dd-trace-core/src/test/groovy/datadog/trace/common/sampling/RuleBasedSamplingTest.groovy +++ b/dd-trace-core/src/test/groovy/datadog/trace/common/sampling/RuleBasedSamplingTest.groovy @@ -61,7 +61,7 @@ class RuleBasedSamplingTest extends DDCoreSpecification { sampler instanceof PrioritySampler when: - DDSpan span = tracer.buildSpan("operation") + DDSpan span = tracer.buildSpan("datadog", "operation") .withServiceName("service") .withTag("env", "bar") .ignoreActiveSpan().start() @@ -167,7 +167,7 @@ class RuleBasedSamplingTest extends DDCoreSpecification { sampler instanceof PrioritySampler when: - DDSpan span = tracer.buildSpan("operation") + DDSpan span = tracer.buildSpan("datadog", "operation") .withServiceName("service") .withTag("env", "bar") .withTag("tag", "foo") @@ -305,7 +305,7 @@ class RuleBasedSamplingTest extends DDCoreSpecification { PrioritySampler sampler = (PrioritySampler)Sampler.Builder.forConfig(properties) when: - DDSpan span = tracer.buildSpan("operation") + DDSpan span = tracer.buildSpan("datadog", "operation") .withServiceName("service") .withResourceName("resource") .withTag("env", "bar") @@ -370,12 +370,12 @@ class RuleBasedSamplingTest extends DDCoreSpecification { properties.setProperty(TRACE_RATE_LIMIT, "1") Sampler sampler = Sampler.Builder.forConfig(properties) - DDSpan span1 = tracer.buildSpan("operation") + DDSpan span1 = tracer.buildSpan("datadog", "operation") .withServiceName("service") .withTag("env", "bar") .ignoreActiveSpan().start() - DDSpan span2 = tracer.buildSpan("operation") + DDSpan span2 = tracer.buildSpan("datadog", "operation") .withServiceName("service") .withTag("env", "bar") .ignoreActiveSpan().start() @@ -409,12 +409,12 @@ class RuleBasedSamplingTest extends DDCoreSpecification { properties.setProperty(TRACE_RATE_LIMIT, "1") Sampler sampler = Sampler.Builder.forConfig(properties) - DDSpan span1 = tracer.buildSpan("operation") + DDSpan span1 = tracer.buildSpan("datadog", "operation") .withServiceName("service") .withTag("env", "bar") .ignoreActiveSpan().start() - DDSpan span2 = tracer.buildSpan("operation") + DDSpan span2 = tracer.buildSpan("datadog", "operation") .withServiceName("service") .withTag("env", "bar") .ignoreActiveSpan().start() @@ -448,11 +448,11 @@ class RuleBasedSamplingTest extends DDCoreSpecification { properties.setProperty(TRACE_RATE_LIMIT, "1") Sampler sampler = Sampler.Builder.forConfig(properties) - DDSpan span1 = tracer.buildSpan("operation") + DDSpan span1 = tracer.buildSpan("datadog", "operation") .withServiceName("service") .withTag("env", "bar") .ignoreActiveSpan().start() - DDSpan span2 = tracer.buildSpan("operation") + DDSpan span2 = tracer.buildSpan("datadog", "operation") .withServiceName("foo") .withTag("env", "bar") .ignoreActiveSpan().start() diff --git a/dd-trace-core/src/test/groovy/datadog/trace/common/sampling/SamplerTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/common/sampling/SamplerTest.groovy index f3804a23124..d5dbbdf6df8 100644 --- a/dd-trace-core/src/test/groovy/datadog/trace/common/sampling/SamplerTest.groovy +++ b/dd-trace-core/src/test/groovy/datadog/trace/common/sampling/SamplerTest.groovy @@ -161,7 +161,7 @@ class SamplerTest extends DDSpecification{ CoreTracer tracer = CoreTracer.builder().writer(new ListWriter()).sampler(sampler).build() when: - DDSpan span = (DDSpan) tracer.buildSpan("test").start() + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "test").start() ((PrioritySampler) sampler).setSamplingPriority(span) then: diff --git a/dd-trace-core/src/test/groovy/datadog/trace/common/sampling/SingleSpanSamplerTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/common/sampling/SingleSpanSamplerTest.groovy index 355fc618023..ac33a48cc80 100644 --- a/dd-trace-core/src/test/groovy/datadog/trace/common/sampling/SingleSpanSamplerTest.groovy +++ b/dd-trace-core/src/test/groovy/datadog/trace/common/sampling/SingleSpanSamplerTest.groovy @@ -51,7 +51,7 @@ class SingleSpanSamplerTest extends DDCoreSpecification { when: SingleSpanSampler sampler = SingleSpanSampler.Builder.forConfig(Config.get(properties)) - DDSpan span = tracer.buildSpan("operation") + DDSpan span = tracer.buildSpan("datadog", "operation") .withServiceName("service") .withTag("env", "bar") .ignoreActiveSpan().start() as DDSpan @@ -87,11 +87,11 @@ class SingleSpanSamplerTest extends DDCoreSpecification { when: SingleSpanSampler sampler = SingleSpanSampler.Builder.forConfig(Config.get(properties)) - DDSpan rootSpan = tracer.buildSpan("web.request") + DDSpan rootSpan = tracer.buildSpan("datadog", "web.request") .withServiceName("webserver") .ignoreActiveSpan().start() as DDSpan - DDSpan childSpan = tracer.buildSpan("web.handler") + DDSpan childSpan = tracer.buildSpan("datadog", "web.handler") .withServiceName("webserver") .asChildOf(rootSpan) .ignoreActiveSpan().start() as DDSpan @@ -127,12 +127,12 @@ class SingleSpanSamplerTest extends DDCoreSpecification { when: SingleSpanSampler sampler = SingleSpanSampler.Builder.forConfig(Config.get(properties)) - DDSpan span1 = tracer.buildSpan("operation") + DDSpan span1 = tracer.buildSpan("datadog", "operation") .withServiceName("service") .withTag("env", "bar") .ignoreActiveSpan().start() as DDSpan - DDSpan span2 = tracer.buildSpan("operation") + DDSpan span2 = tracer.buildSpan("datadog", "operation") .withServiceName("service") .withTag("env", "bar") .ignoreActiveSpan().start() as DDSpan @@ -167,7 +167,7 @@ class SingleSpanSamplerTest extends DDCoreSpecification { when: SingleSpanSampler sampler = SingleSpanSampler.Builder.forConfig(Config.get(properties)) - DDSpan span1 = tracer.buildSpan("operation") + DDSpan span1 = tracer.buildSpan("datadog", "operation") .withServiceName("service") .withTag("env", "bar") .ignoreActiveSpan().start() as DDSpan @@ -189,7 +189,7 @@ class SingleSpanSamplerTest extends DDCoreSpecification { when: SingleSpanSampler sampler = SingleSpanSampler.Builder.forConfig(Config.get(properties)) - DDSpan span1 = tracer.buildSpan("operation") + DDSpan span1 = tracer.buildSpan("datadog", "operation") .withServiceName("service") .withTag("env", "bar") .ignoreActiveSpan().start() as DDSpan diff --git a/dd-trace-core/src/test/groovy/datadog/trace/common/writer/DDAgentApiTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/common/writer/DDAgentApiTest.groovy index e4cc7d88fd3..0306de5ae39 100644 --- a/dd-trace-core/src/test/groovy/datadog/trace/common/writer/DDAgentApiTest.groovy +++ b/dd-trace-core/src/test/groovy/datadog/trace/common/writer/DDAgentApiTest.groovy @@ -18,6 +18,7 @@ import datadog.metrics.impl.MonitoringImpl import datadog.trace.api.Config import datadog.trace.api.ProcessTags import datadog.trace.api.ProtocolVersion +import datadog.trace.api.config.OtlpConfig import datadog.trace.bootstrap.instrumentation.api.InstrumentationTags import datadog.trace.common.sampling.RateByServiceTraceSampler import datadog.trace.common.writer.ddagent.DDAgentApi @@ -454,6 +455,50 @@ class DDAgentApiTest extends DDCoreSpecification { return maps } + def "Datadog-Client-Computed-Stats header set when either stats pipeline is enabled (otlpSpanMetrics=#otlpSpanMetrics, nativeMetrics=#nativeMetrics)"() { + setup: + injectSysConfig(OtlpConfig.OTEL_TRACES_SPAN_METRICS_ENABLED, "$otlpSpanMetrics") + + def agent = httpServer { + handlers { + put("v0.4/traces") { + response.status(200).send() + } + } + } + def agentUrl = HttpUrl.get(agent.address.toString()) + + // Mock feature discovery so the native-stats pipeline signal can be controlled independently of + // what the (embedded) agent advertises. supportsMetrics() reflects agent-side client stats support. + def discovery = Mock(DDAgentFeaturesDiscovery) + discovery.getTraceEndpoint() >> "v0.4/traces" + discovery.supportsMetrics() >> nativeMetrics + discovery.state() >> null + + def client = OkHttpUtils.buildHttpClient(agentUrl, 1000) + // nativeMetricsEnabled is the constructor flag WriterFactory sets from Config.isTracerMetricsEnabled(). + def api = new DDAgentApi(client, agentUrl, discovery, monitoring, nativeMetrics) + def payload = prepareTraces("v0.4/traces", []) + + when: + // Named clientResponse (not response) to avoid shadowing the httpServer handler closure's `response`. + def clientResponse = api.sendSerializedTraces(payload) + + then: + clientResponse.success() + (agent.lastRequest.headers.get("Datadog-Client-Computed-Stats") == "true") == expectedComputesStats + + cleanup: + agent.close() + + where: + otlpSpanMetrics | nativeMetrics | expectedComputesStats + true | false | true // gap case: OTLP span metrics on, native stats off + false | false | false // neither pipeline computes stats + false | true | true // native stats on (regression guard) + true | true | true // both on + } + Payload prepareTraces(String agentVersion, List> traces) { Traces traceCapture = new Traces() def packer = new MsgPackWriter(new FlushingBuffer(1 << 20, traceCapture)) diff --git a/dd-trace-core/src/test/groovy/datadog/trace/common/writer/DDAgentWriterCombinedTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/common/writer/DDAgentWriterCombinedTest.groovy index faa9b0db3de..1659ab44da3 100644 --- a/dd-trace-core/src/test/groovy/datadog/trace/common/writer/DDAgentWriterCombinedTest.groovy +++ b/dd-trace-core/src/test/groovy/datadog/trace/common/writer/DDAgentWriterCombinedTest.groovy @@ -101,7 +101,7 @@ class DDAgentWriterCombinedTest extends DDCoreSpecification { .flushIntervalMilliseconds(-1) .build() writer.start() - def trace = [dummyTracer.buildSpan("fakeOperation").start()] + def trace = [dummyTracer.buildSpan("datadog", "fakeOperation").start()] when: writer.write(trace) @@ -132,7 +132,7 @@ class DDAgentWriterCombinedTest extends DDCoreSpecification { .flushIntervalMilliseconds(-1) .build() writer.start() - def trace = [dummyTracer.buildSpan("fakeOperation").start()] + def trace = [dummyTracer.buildSpan("datadog", "fakeOperation").start()] when: (1..traceCount).each { @@ -167,7 +167,7 @@ class DDAgentWriterCombinedTest extends DDCoreSpecification { .flushIntervalMilliseconds(1000) .build() writer.start() - def span = dummyTracer.buildSpan("fakeOperation").start() + def span = dummyTracer.buildSpan("datadog", "fakeOperation").start() def trace = (1..10).collect { span } when: diff --git a/dd-trace-core/src/test/groovy/datadog/trace/common/writer/DDAgentWriterTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/common/writer/DDAgentWriterTest.groovy index b08e70e3fae..965f3a88d5e 100644 --- a/dd-trace-core/src/test/groovy/datadog/trace/common/writer/DDAgentWriterTest.groovy +++ b/dd-trace-core/src/test/groovy/datadog/trace/common/writer/DDAgentWriterTest.groovy @@ -109,7 +109,7 @@ class DDAgentWriterTest extends DDCoreSpecification { def "test writer.write publish succeeds"() { setup: - def trace = [dummyTracer.buildSpan("fakeOperation").start()] + def trace = [dummyTracer.buildSpan("datadog", "fakeOperation").start()] when: "publish succeeds" writer.write(trace) @@ -122,7 +122,7 @@ class DDAgentWriterTest extends DDCoreSpecification { def "test writer.write publish for single span sampling"() { setup: - def trace = [dummyTracer.buildSpan("fakeOperation").start()] + def trace = [dummyTracer.buildSpan("datadog", "fakeOperation").start()] when: "publish succeeds" writer.write(trace) @@ -135,7 +135,7 @@ class DDAgentWriterTest extends DDCoreSpecification { def "test writer.write publish fails"() { setup: - def trace = [dummyTracer.buildSpan("fakeOperation").start()] + def trace = [dummyTracer.buildSpan("datadog", "fakeOperation").start()] when: "publish fails" writer.write(trace) @@ -161,7 +161,7 @@ class DDAgentWriterTest extends DDCoreSpecification { def "test writer.write closed"() { setup: writer.close() - def trace = [dummyTracer.buildSpan("fakeOperation").start()] + def trace = [dummyTracer.buildSpan("datadog", "fakeOperation").start()] when: writer.write(trace) diff --git a/dd-trace-core/src/test/groovy/datadog/trace/common/writer/DDIntakeWriterCombinedTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/common/writer/DDIntakeWriterCombinedTest.groovy index b3d53917ea5..966d4e91ecb 100644 --- a/dd-trace-core/src/test/groovy/datadog/trace/common/writer/DDIntakeWriterCombinedTest.groovy +++ b/dd-trace-core/src/test/groovy/datadog/trace/common/writer/DDIntakeWriterCombinedTest.groovy @@ -98,7 +98,7 @@ class DDIntakeWriterCombinedTest extends DDCoreSpecification { .alwaysFlush(false) .build() writer.start() - def trace = [dummyTracer.buildSpan("fakeOperation").start()] + def trace = [dummyTracer.buildSpan("datadog", "fakeOperation").start()] when: writer.write(trace) @@ -127,7 +127,7 @@ class DDIntakeWriterCombinedTest extends DDCoreSpecification { .alwaysFlush(false) .build() writer.start() - def trace = [dummyTracer.buildSpan("fakeOperation").start()] + def trace = [dummyTracer.buildSpan("datadog", "fakeOperation").start()] when: (1..traceCount).each { @@ -160,7 +160,7 @@ class DDIntakeWriterCombinedTest extends DDCoreSpecification { .alwaysFlush(false) .build() writer.start() - def span = dummyTracer.buildSpan("fakeOperation").start() + def span = dummyTracer.buildSpan("datadog", "fakeOperation").start() def trace = (1..10).collect { span } when: diff --git a/dd-trace-core/src/test/groovy/datadog/trace/common/writer/DDIntakeWriterTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/common/writer/DDIntakeWriterTest.groovy index da522531dcf..e0a347841a1 100644 --- a/dd-trace-core/src/test/groovy/datadog/trace/common/writer/DDIntakeWriterTest.groovy +++ b/dd-trace-core/src/test/groovy/datadog/trace/common/writer/DDIntakeWriterTest.groovy @@ -99,7 +99,7 @@ class DDIntakeWriterTest extends DDCoreSpecification { def "test writer.write publish succeeds"() { setup: - def trace = [dummyTracer.buildSpan("fakeOperation").start()] + def trace = [dummyTracer.buildSpan("datadog", "fakeOperation").start()] when: "publish succeeds" writer.write(trace) @@ -113,7 +113,7 @@ class DDIntakeWriterTest extends DDCoreSpecification { def "test writer.write publish for single span sampling"() { setup: - def trace = [dummyTracer.buildSpan("fakeOperation").start()] + def trace = [dummyTracer.buildSpan("datadog", "fakeOperation").start()] when: "publish succeeds" writer.write(trace) @@ -127,7 +127,7 @@ class DDIntakeWriterTest extends DDCoreSpecification { def "test writer.write publish fails"() { setup: - def trace = [dummyTracer.buildSpan("fakeOperation").start()] + def trace = [dummyTracer.buildSpan("datadog", "fakeOperation").start()] when: "publish fails" writer.write(trace) @@ -155,7 +155,7 @@ class DDIntakeWriterTest extends DDCoreSpecification { def "test writer.write closed"() { setup: writer.close() - def trace = [dummyTracer.buildSpan("fakeOperation").start()] + def trace = [dummyTracer.buildSpan("datadog", "fakeOperation").start()] when: writer.write(trace) diff --git a/dd-trace-core/src/test/groovy/datadog/trace/common/writer/PayloadDispatcherImplTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/common/writer/PayloadDispatcherImplTest.groovy index 6826c4db310..8aaa47062fa 100644 --- a/dd-trace-core/src/test/groovy/datadog/trace/common/writer/PayloadDispatcherImplTest.groovy +++ b/dd-trace-core/src/test/groovy/datadog/trace/common/writer/PayloadDispatcherImplTest.groovy @@ -171,6 +171,9 @@ class PayloadDispatcherImplTest extends DDSpecification { NoopPathwayContext.INSTANCE, false, PropagationTags.factory().empty()) - return new DDSpan("test", 0, context, null) + def span = new DDSpan("test", 0, context, null) + // Stub explicitly to avoid Spock fabricating a dummy DDSpan per call (slow reflection fallback). + trace.getRootSpan() >> span + return span } } diff --git a/dd-trace-core/src/test/groovy/datadog/trace/common/writer/TraceGenerator.groovy b/dd-trace-core/src/test/groovy/datadog/trace/common/writer/TraceGenerator.groovy deleted file mode 100644 index 66bdbab137b..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/common/writer/TraceGenerator.groovy +++ /dev/null @@ -1,455 +0,0 @@ -package datadog.trace.common.writer - -import static datadog.trace.api.sampling.PrioritySampling.UNSET -import static java.util.Collections.emptyList - -import datadog.trace.api.DDSpanId -import datadog.trace.api.DDTags -import datadog.trace.api.DDTraceId -import datadog.trace.api.IdGenerationStrategy -import datadog.trace.api.ProcessTags -import datadog.trace.api.TagMap -import datadog.trace.api.sampling.PrioritySampling -import datadog.trace.bootstrap.instrumentation.api.AgentSpanLink -import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString -import datadog.trace.core.CoreSpan -import datadog.trace.core.Metadata -import datadog.trace.core.MetadataConsumer -import java.util.concurrent.ThreadLocalRandom -import java.util.concurrent.TimeUnit - -class TraceGenerator { - - static List> generateRandomTraces(int howMany, boolean lowCardinality) { - List> traces = new ArrayList<>(howMany) - for (int i = 0; i < howMany; ++i) { - int traceSize = ThreadLocalRandom.current().nextInt(2, 20) - traces.add(generateRandomTrace(traceSize, lowCardinality)) - } - return traces - } - - private static List generateRandomTrace(int size, boolean lowCardinality) { - List trace = new ArrayList<>(size) - long traceId = ThreadLocalRandom.current().nextLong(1, Long.MAX_VALUE) - for (int i = 0; i < size; ++i) { - def spanType = "type-" + ThreadLocalRandom.current().nextInt(lowCardinality ? 1 : 100) - trace.add(randomSpan(traceId, lowCardinality, spanType, Collections.emptyMap())) - } - return trace - } - - private static final IdGenerationStrategy ID_GENERATION_STRATEGY = IdGenerationStrategy.fromName("RANDOM") - - static CoreSpan generateRandomSpan(CharSequence type, Map extraTags) { - long traceId = ThreadLocalRandom.current().nextLong(1, Long.MAX_VALUE) - return randomSpan(traceId, true, type, extraTags) - } - - private static CoreSpan randomSpan(long traceId, boolean lowCardinality, CharSequence type, Map extraTags) { - ThreadLocalRandom random = ThreadLocalRandom.current() - Map baggage = new HashMap<>() - if (random.nextBoolean()) { - baggage.put("baggage-key", lowCardinality ? "x" : randomString(100)) - if (random.nextBoolean()) { - baggage.put("tag.1", "bar") - baggage.put("tag.2", "qux") - } - } - Map tags = new HashMap<>(extraTags) - int tagCount = random.nextInt(0, 20) - for (int i = 0; i < tagCount; ++i) { - tags.put("tag." + i, random.nextBoolean() ? "foo" : randomString(2000)) - tags.put("tag.1." + i, lowCardinality ? "y" : UUID.randomUUID()) - tags.put("tag.2." + i, random.nextBoolean()) - switch (random.nextInt(8)) { - case 0: - tags.put("tag.3." + i, BigDecimal.valueOf(random.nextDouble())) - break - case 1: - tags.put("tag.3." + i, BigInteger.valueOf(random.nextLong())) - break - default: - break - } - } - int metricCount = random.nextInt(0, 20) - for (int i = 0; i < metricCount; ++i) { - String name = "metric." + i - Number metric = null - switch (random.nextInt(4)) { - case 0: - metric = random.nextInt() - break - case 1: - metric = random.nextLong() - break - case 2: - metric = random.nextFloat() - break - case 3: - metric = random.nextDouble() - break - } - tags.put(name, metric) - } - - return new PojoSpan( - "service-" + random.nextInt(lowCardinality ? 1 : 10), - "operation-" + random.nextInt(lowCardinality ? 1 : 100), - UTF8BytesString.create("resource-" + random.nextInt(lowCardinality ? 1 : 100)), - DDTraceId.from(traceId), - ID_GENERATION_STRATEGY.generateSpanId(), - DDSpanId.ZERO, - TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis()), - random.nextLong(500, 10_000_000), - random.nextInt(2), - baggage, - tags, - type, - random.nextBoolean(), - PrioritySampling.SAMPLER_KEEP, - 200, - "some-origin") - } - - private static String randomString(int maxLength) { - char[] chars = new char[ThreadLocalRandom.current().nextInt(maxLength)] - for (int i = 0; i < chars.length; ++i) { - char next = (char) ThreadLocalRandom.current().nextInt((int) Character.MAX_VALUE) - if (Character.isSurrogate(next)) { - if (i < chars.length - 1) { - chars[i++] = '\uD801' - chars[i] = '\uDC01' - } else { - chars[i] = 'a' - } - } else { - chars[i] = next - } - } - return new String(chars) - } - - static class PojoSpan implements CoreSpan { - - private final CharSequence serviceName - private final CharSequence operationName - private final CharSequence resourceName - private final DDTraceId traceId - private final long spanId - private final long parentId - private final long start - private final long duration - private final int error - private final CharSequence type - private final boolean measured - private final Metadata metadata - private short httpStatusCode - private final int samplingPriority - private final Map metaStruct = [:] - - PojoSpan( - String serviceName, - String operationName, - CharSequence resourceName, - DDTraceId traceId, - long spanId, - long parentId, - long start, - long duration, - int error, - Map baggage, - Map tags, - CharSequence type, - boolean measured, - int samplingPriority, - int statusCode, - CharSequence origin, - List spanLinks = emptyList()) { - this.serviceName = UTF8BytesString.create(serviceName) - this.operationName = UTF8BytesString.create(operationName) - this.resourceName = UTF8BytesString.create(resourceName) - this.traceId = traceId - this.spanId = spanId - this.parentId = parentId - this.start = start - this.duration = duration - this.error = error - this.type = type - this.measured = measured - this.samplingPriority = samplingPriority - this.httpStatusCode = (short) statusCode - this.metadata = new Metadata( - Thread.currentThread().getId(), - UTF8BytesString.create(Thread.currentThread().getName()), - TagMap.fromMap(tags), - baggage, - samplingPriority, - measured, - topLevel, - statusCode == 0 ? null : UTF8BytesString.create(Integer.toString(statusCode)), - origin, - 0, - ProcessTags.tagsForSerialization, - spanLinks) - } - - @Override - PojoSpan getLocalRootSpan() { - return this - } - - @Override - String getServiceName() { - return serviceName - } - - @Override - CharSequence getOperationName() { - return operationName - } - - @Override - CharSequence getResourceName() { - return resourceName - } - - @Override - DDTraceId getTraceId() { - return traceId - } - - @Override - long getSpanId() { - return spanId - } - - @Override - long getParentId() { - return parentId - } - - @Override - long getStartTime() { - return start - } - - @Override - long getDurationNano() { - return duration - } - - @Override - int getError() { - return error - } - - @Override - PojoSpan setMeasured(boolean measured) { - return this - } - - @Override - PojoSpan setErrorMessage(String errorMessage) { - return this - } - - @Override - PojoSpan addThrowable(Throwable error) { - return this - } - - @Override - PojoSpan setTag(String tag, String value) { - return this - } - - @Override - PojoSpan setTag(String tag, boolean value) { - return this - } - - @Override - PojoSpan setTag(String tag, int value) { - return this - } - - @Override - PojoSpan setTag(String tag, long value) { - return this - } - - @Override - PojoSpan setTag(String tag, double value) { - return this - } - - @Override - PojoSpan setTag(String tag, Number value) { - return this - } - - @Override - PojoSpan setTag(String tag, CharSequence value) { - return this - } - - @Override - PojoSpan setTag(String tag, Object value) { - return this - } - - @Override - PojoSpan removeTag(String tag) { - metadata.getTags().remove(tag) - return this - } - - @Override - boolean isMeasured() { - return measured - } - - @Override - boolean isTopLevel() { - return false - } - - @Override - boolean isForceKeep() { - return false - } - - @Override - short getHttpStatusCode() { - return httpStatusCode - } - - @Override - CharSequence getOrigin() { - return metadata.getOrigin() - } - - Map getBaggage() { - return metadata.getBaggage() - } - - Map getTags() { - return metadata.getTags() - } - - @Override - CharSequence getType() { - return this.type - } - - @Override - void processServiceTags() {} - - @Override - void processTagsAndBaggage(MetadataConsumer consumer) { - consumer.accept(metadata) - } - - @Override - void processTagsAndBaggage(MetadataConsumer consumer, boolean injectLinksAsTags, boolean injectBaggageAsTags) { - consumer.accept(metadata) - } - - @Override - PojoSpan setSamplingPriority(int samplingPriority, int samplingMechanism) { - return this - } - - @Override - PojoSpan setSamplingPriority(int samplingPriority, CharSequence rate, double sampleRate, int samplingMechanism) { - return this - } - - @Override - PojoSpan setSpanSamplingPriority(double rate, int limit) { - return this - } - - @Override - PojoSpan setMetric(CharSequence name, int value) { - return this - } - - @Override - PojoSpan setMetric(CharSequence name, long value) { - return this - } - - @Override - PojoSpan setMetric(CharSequence name, float value) { - return this - } - - @Override - PojoSpan setMetric(CharSequence name, double value) { - return this - } - - @Override - PojoSpan setFlag(CharSequence name, boolean value) { - return this - } - - @Override - int samplingPriority() { - return samplingPriority - } - - @Override - U getTag(CharSequence name, U defaultValue) { - U value = getTag(name) - return null == value ? defaultValue : value - } - - @Override - U getTag(CharSequence name) { - // replicate logic here because DDSpanContext has to pretend some of its - // fields are elements of a map for backward compatibility reasons - String tag = String.valueOf(name) - Object value = null - switch (tag) { - case DDTags.THREAD_ID: - value = metadata.getThreadId() - break - case DDTags.THREAD_NAME: - value = metadata.getThreadName() - break - default: - value = tags.get(tag) - } - return value as U - } - - @Override - boolean hasSamplingPriority() { - return samplingPriority != UNSET - } - - @Override - Map getMetaStruct() { - return metaStruct - } - - @Override - PojoSpan setMetaStruct(String field, Object value) { - if (value == null) { - metaStruct.remove(field) - } else { - metaStruct[field] = value - } - return this - } - - @Override - int getLongRunningVersion() { - return 0 - } - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/common/writer/TraceMapperTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/common/writer/TraceMapperTest.groovy index 7d4d0b709cf..6f2173e8374 100644 --- a/dd-trace-core/src/test/groovy/datadog/trace/common/writer/TraceMapperTest.groovy +++ b/dd-trace-core/src/test/groovy/datadog/trace/common/writer/TraceMapperTest.groovy @@ -17,10 +17,10 @@ class TraceMapperTest extends DDCoreSpecification { def "test trace mapper v0.5"() { setup: def tracer = tracerBuilder().writer(new ListWriter()).build() - DDSpan span = (DDSpan) tracer.buildSpan(null).withTag("service.name", "my-service") + DDSpan span = (DDSpan) tracer.buildSpan("datadog", null).withTag("service.name", "my-service") .withTag("elasticsearch.version", "7.0").start() span.setBaggageItem("baggage", "item") - span.context().setDataTop("mydata", "[1,2,3]") + span.spanContext().setDataTop("mydata", "[1,2,3]") def trace = [span] when: diff --git a/dd-trace-core/src/test/groovy/datadog/trace/common/writer/ddagent/TraceMapperV1PayloadTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/common/writer/ddagent/TraceMapperV1PayloadTest.groovy index a1350a7538c..b9975dd3038 100644 --- a/dd-trace-core/src/test/groovy/datadog/trace/common/writer/ddagent/TraceMapperV1PayloadTest.groovy +++ b/dd-trace-core/src/test/groovy/datadog/trace/common/writer/ddagent/TraceMapperV1PayloadTest.groovy @@ -1,14 +1,17 @@ package datadog.trace.common.writer.ddagent import static datadog.trace.common.writer.TraceGenerator.generateRandomTraces +import static datadog.trace.common.writer.ddagent.V1PayloadReader.readAttributes +import static datadog.trace.common.writer.ddagent.V1PayloadReader.readFirstSpan +import static datadog.trace.common.writer.ddagent.V1PayloadReader.readStreamingString +import static datadog.trace.common.writer.ddagent.V1PayloadReader.skipChunkField +import static datadog.trace.common.writer.ddagent.V1PayloadReader.skipPayloadField +import static datadog.trace.common.writer.ddagent.V1PayloadReader.skipSpanField +import static datadog.trace.common.writer.ddagent.V1PayloadReader.unpackUnsignedLong import static org.junit.jupiter.api.Assertions.assertArrayEquals import static org.junit.jupiter.api.Assertions.assertEquals import static org.junit.jupiter.api.Assertions.assertNotNull import static org.junit.jupiter.api.Assertions.assertTrue -import static org.msgpack.core.MessageFormat.FIXSTR -import static org.msgpack.core.MessageFormat.STR16 -import static org.msgpack.core.MessageFormat.STR32 -import static org.msgpack.core.MessageFormat.STR8 import datadog.communication.serialization.ByteBufferConsumer import datadog.communication.serialization.FlushingBuffer @@ -345,20 +348,20 @@ class TraceMapperV1PayloadTest extends DDSpecification { stringTable.add("") when: - List> links = readFirstSpanLinks(unpacker, stringTable) + List> links = readFirstSpan(unpacker, stringTable).links then: assertEquals(2, links.size()) assertArrayEquals(traceIdBytes(DDTraceId.fromHex("11223344556677889900aabbccddeeff")), links[0].traceId as byte[]) assertEquals(DDSpanId.fromHex("000000000000002a"), links[0].spanId) - assertEquals("dd=s:1", links[0].tracestate) - assertEquals(1L, links[0].flags) + assertEquals("dd=s:1", links[0].traceState) + assertEquals(1L, links[0].traceFlags) assertEquals(["link.kind": "follows_from", "context_headers": "tracecontext"], links[0].attributes) assertArrayEquals(traceIdBytes(DDTraceId.fromHex("00000000000000000000000000000001")), links[1].traceId as byte[]) assertEquals(DDSpanId.fromHex("0000000000000002"), links[1].spanId) - assertEquals("", links[1].tracestate) - assertEquals(0L, links[1].flags) + assertEquals("", links[1].traceState) + assertEquals(0L, links[1].traceFlags) assertEquals([:], links[1].attributes) } @@ -437,7 +440,7 @@ class TraceMapperV1PayloadTest extends DDSpecification { stringTable.add("") when: - List> links = readFirstSpanLinks(unpacker, stringTable) + List> links = readFirstSpan(unpacker, stringTable).links then: assertTrue(links.isEmpty()) @@ -487,7 +490,7 @@ class TraceMapperV1PayloadTest extends DDSpecification { stringTable.add("") when: - List> events = readFirstSpanEvents(unpacker, stringTable) + List> events = readFirstSpan(unpacker, stringTable).events then: assertEquals(2, events.size()) @@ -531,7 +534,7 @@ class TraceMapperV1PayloadTest extends DDSpecification { stringTable.add("") when: - List> events = readFirstSpanEvents(unpacker, stringTable) + List> events = readFirstSpan(unpacker, stringTable).events then: assertTrue(events.isEmpty()) @@ -565,7 +568,7 @@ class TraceMapperV1PayloadTest extends DDSpecification { stringTable.add("") when: - Map attributes = readFirstSpanAttributes(unpacker, stringTable) + Map attributes = readFirstSpan(unpacker, stringTable).attributes byte[] metaStructBytes = attributes["meta_key"] as byte[] MessageUnpacker metaStructUnpacker = MessagePack.newDefaultUnpacker(metaStructBytes) int metaStructFieldCount = metaStructUnpacker.unpackMapHeader() @@ -635,7 +638,7 @@ class TraceMapperV1PayloadTest extends DDSpecification { stringTable.add("") when: - Map attributes = readFirstSpanAttributes(unpacker, stringTable) + Map attributes = readFirstSpan(unpacker, stringTable).attributes then: assertTrue(attributes.containsKey("usr.id")) @@ -691,7 +694,7 @@ class TraceMapperV1PayloadTest extends DDSpecification { stringTable.add("") when: - Map attributes = readFirstSpanAttributes(unpacker, stringTable) + Map attributes = readFirstSpan(unpacker, stringTable).attributes then: assertEquals(true, attributes.get("tag.bool")) @@ -728,7 +731,7 @@ class TraceMapperV1PayloadTest extends DDSpecification { stringTable.add("") when: - Map attributes = readFirstSpanAttributes(unpacker, stringTable) + Map attributes = readFirstSpan(unpacker, stringTable).attributes then: assertAttributeValueEquals(span.getTag(DDTags.THREAD_ID), attributes.get(DDTags.THREAD_ID), DDTags.THREAD_ID) @@ -1031,40 +1034,6 @@ class TraceMapperV1PayloadTest extends DDSpecification { } } - private static Map readAttributes(MessageUnpacker unpacker, List stringTable) { - int attrArraySize = unpacker.unpackArrayHeader() - assertEquals(0, attrArraySize % 3) - int attrCount = attrArraySize / 3 - - Map attributes = new HashMap<>() - for (int i = 0; i < attrCount; i++) { - String key = readStreamingString(unpacker, stringTable) - int attrType = unpacker.unpackInt() - Object value - switch (attrType) { - case TraceMapperV1.VALUE_TYPE_STRING: - value = readStreamingString(unpacker, stringTable) - break - case TraceMapperV1.VALUE_TYPE_BOOLEAN: - value = unpacker.unpackBoolean() - break - case TraceMapperV1.VALUE_TYPE_FLOAT: - value = unpacker.unpackDouble() - break - case TraceMapperV1.VALUE_TYPE_BYTES: - int len = unpacker.unpackBinaryHeader() - byte[] data = new byte[len] - unpacker.readPayload(data) - value = data - break - default: - Assertions.fail("Unknown attribute value type: " + attrType) - } - attributes.put(key, value) - } - return attributes - } - private static void assertAttributeValueEquals(Object expected, Object actual, String key) { if (expected instanceof Number) { assertTrue(actual instanceof Number, "Attribute $key should be numeric") @@ -1079,14 +1048,6 @@ class TraceMapperV1PayloadTest extends DDSpecification { } } - private static long unpackUnsignedLong(MessageUnpacker unpacker) { - MessageFormat format = unpacker.nextFormat - if (format == MessageFormat.UINT64) { - return DDSpanId.from("${unpacker.unpackBigInteger()}") - } - return unpacker.unpackLong() - } - private static void addFlattenedExpectedAttribute( Map expectedAttributes, String key, @@ -1126,498 +1087,6 @@ class TraceMapperV1PayloadTest extends DDSpecification { } } - private static String readStreamingString(MessageUnpacker unpacker, List stringTable) { - MessageFormat format = unpacker.getNextFormat() - if (format == FIXSTR || format == STR8 || format == STR16 || format == STR32) { - String value = unpacker.unpackString() - if (!stringTable.contains(value)) { - stringTable.add(value) - } - return value - } - - int index = unpacker.unpackInt() - assertTrue(index >= 0 && index < stringTable.size(), "Invalid string-table index: " + index) - return stringTable.get(index) - } - - private static void skipPayloadField(MessageUnpacker unpacker, int fieldId, List stringTable) { - switch (fieldId) { - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - readStreamingString(unpacker, stringTable) - break - case 10: - readAttributes(unpacker, stringTable) - break - default: - Assertions.fail("Unexpected payload field id while skipping: " + fieldId) - } - } - - private static void skipChunkField(MessageUnpacker unpacker, int fieldId, List stringTable) { - switch (fieldId) { - case 1: - unpacker.unpackInt() - break - case 2: - readStreamingString(unpacker, stringTable) - break - case 3: - readAttributes(unpacker, stringTable) - break - case 4: - int spanCount = unpacker.unpackArrayHeader() - for (int i = 0; i < spanCount; i++) { - skipSpan(unpacker, stringTable) - } - break - case 5: - unpacker.unpackBoolean() - break - case 6: - int len = unpacker.unpackBinaryHeader() - byte[] ignored = new byte[len] - unpacker.readPayload(ignored) - break - case 7: - unpacker.unpackInt() - break - default: - Assertions.fail("Unexpected chunk field id while skipping: " + fieldId) - } - } - - private static void skipSpan(MessageUnpacker unpacker, List stringTable) { - int fieldCount = unpacker.unpackMapHeader() - for (int i = 0; i < fieldCount; i++) { - int fieldId = unpacker.unpackInt() - switch (fieldId) { - case 1: - case 2: - case 3: - case 10: - case 13: - case 14: - case 15: - readStreamingString(unpacker, stringTable) - break - case 4: - case 5: - unpacker.unpackValue().asNumberValue().toLong() - break - case 6: - case 7: - unpacker.unpackLong() - break - case 8: - unpacker.unpackBoolean() - break - case 9: - int attrArraySize = unpacker.unpackArrayHeader() - int attrCount = attrArraySize / 3 - for (int j = 0; j < attrCount; j++) { - readStreamingString(unpacker, stringTable) - int type = unpacker.unpackInt() - switch (type) { - case TraceMapperV1.VALUE_TYPE_STRING: - readStreamingString(unpacker, stringTable) - break - case TraceMapperV1.VALUE_TYPE_BOOLEAN: - unpacker.unpackBoolean() - break - case TraceMapperV1.VALUE_TYPE_FLOAT: - unpacker.unpackDouble() - break - case TraceMapperV1.VALUE_TYPE_BYTES: - int len = unpacker.unpackBinaryHeader() - byte[] ignored = new byte[len] - unpacker.readPayload(ignored) - break - default: - Assertions.fail("Unexpected attribute type while skipping: " + type) - } - } - break - case 11: - case 12: - unpacker.unpackArrayHeader() - break - case 16: - unpacker.unpackInt() - break - default: - Assertions.fail("Unexpected span field id while skipping: " + fieldId) - } - } - } - - private static Map readFirstSpanAttributes( - MessageUnpacker unpacker, - List stringTable) { - int payloadFieldCount = unpacker.unpackMapHeader() - for (int i = 0; i < payloadFieldCount; i++) { - int payloadFieldId = unpacker.unpackInt() - if (payloadFieldId != 11) { - skipPayloadField(unpacker, payloadFieldId, stringTable) - continue - } - - int chunkCount = unpacker.unpackArrayHeader() - assertEquals(1, chunkCount) - - int chunkFieldCount = unpacker.unpackMapHeader() - for (int chunkFieldIndex = 0; chunkFieldIndex < chunkFieldCount; chunkFieldIndex++) { - int chunkFieldId = unpacker.unpackInt() - if (chunkFieldId != 4) { - skipChunkField(unpacker, chunkFieldId, stringTable) - continue - } - - int spanCount = unpacker.unpackArrayHeader() - assertEquals(1, spanCount) - - int spanFieldCount = unpacker.unpackMapHeader() - for (int spanFieldIndex = 0; spanFieldIndex < spanFieldCount; spanFieldIndex++) { - int spanFieldId = unpacker.unpackInt() - if (spanFieldId == 9) { - return readAttributes(unpacker, stringTable) - } - skipSpanField(unpacker, spanFieldId, stringTable) - } - } - } - Assertions.fail("Could not find span attributes field in first span") - return [:] - } - - private static List> readFirstSpanLinks( - MessageUnpacker unpacker, - List stringTable) { - int payloadFieldCount = unpacker.unpackMapHeader() - for (int i = 0; i < payloadFieldCount; i++) { - int payloadFieldId = unpacker.unpackInt() - if (payloadFieldId != 11) { - skipPayloadField(unpacker, payloadFieldId, stringTable) - continue - } - - int chunkCount = unpacker.unpackArrayHeader() - assertEquals(1, chunkCount) - - int chunkFieldCount = unpacker.unpackMapHeader() - for (int chunkFieldIndex = 0; chunkFieldIndex < chunkFieldCount; chunkFieldIndex++) { - int chunkFieldId = unpacker.unpackInt() - if (chunkFieldId != 4) { - skipChunkField(unpacker, chunkFieldId, stringTable) - continue - } - - int spanCount = unpacker.unpackArrayHeader() - assertEquals(1, spanCount) - - int spanFieldCount = unpacker.unpackMapHeader() - for (int spanFieldIndex = 0; spanFieldIndex < spanFieldCount; spanFieldIndex++) { - int spanFieldId = unpacker.unpackInt() - if (spanFieldId == 11) { - return readSpanLinks(unpacker, stringTable) - } - skipSpanField(unpacker, spanFieldId, stringTable) - } - } - } - Assertions.fail("Could not find span links field in first span") - return [] - } - - private static void skipSpanField(MessageUnpacker unpacker, int fieldId, List stringTable) { - switch (fieldId) { - case 1: - case 2: - case 3: - case 10: - case 13: - case 14: - case 15: - readStreamingString(unpacker, stringTable) - break - case 4: - case 5: - unpacker.unpackValue().asNumberValue().toLong() - break - case 6: - case 7: - unpacker.unpackLong() - break - case 8: - unpacker.unpackBoolean() - break - case 9: - readAttributes(unpacker, stringTable) - break - case 12: - int eventsCount = unpacker.unpackArrayHeader() - for (int j = 0; j < eventsCount; j++) { - skipSpanEvent(unpacker, stringTable) - } - break - case 11: - int linksCount = unpacker.unpackArrayHeader() - for (int j = 0; j < linksCount; j++) { - int linkFieldCount = unpacker.unpackMapHeader() - for (int k = 0; k < linkFieldCount; k++) { - int linkFieldId = unpacker.unpackInt() - switch (linkFieldId) { - case 1: - int traceIdLen = unpacker.unpackBinaryHeader() - byte[] ignored = new byte[traceIdLen] - unpacker.readPayload(ignored) - break - case 2: - case 5: - unpacker.unpackValue().asNumberValue().toLong() - break - case 3: - readAttributes(unpacker, stringTable) - break - case 4: - readStreamingString(unpacker, stringTable) - break - default: - Assertions.fail("Unexpected span link field id while skipping: " + linkFieldId) - } - } - } - break - case 16: - unpacker.unpackInt() - break - default: - Assertions.fail("Unexpected span field id while skipping: " + fieldId) - } - } - - private static List> readSpanLinks( - MessageUnpacker unpacker, - List stringTable) { - int linksCount = unpacker.unpackArrayHeader() - List> links = [] - - for (int i = 0; i < linksCount; i++) { - int linkFieldCount = unpacker.unpackMapHeader() - assertEquals(5, linkFieldCount) - - byte[] traceId = null - Long spanId = null - Map attributes = null - String tracestate = null - Long flags = null - - for (int j = 0; j < linkFieldCount; j++) { - int linkFieldId = unpacker.unpackInt() - switch (linkFieldId) { - case 1: - int traceIdLen = unpacker.unpackBinaryHeader() - traceId = new byte[traceIdLen] - unpacker.readPayload(traceId) - break - case 2: - spanId = unpacker.unpackValue().asNumberValue().toLong() - break - case 3: - attributes = readAttributes(unpacker, stringTable) - break - case 4: - tracestate = readStreamingString(unpacker, stringTable) - break - case 5: - flags = unpacker.unpackValue().asNumberValue().toLong() - break - default: - Assertions.fail("Unexpected span link field id: " + linkFieldId) - } - } - - links.add([ - traceId : traceId, - spanId : spanId, - attributes: attributes, - tracestate: tracestate, - flags : flags - ]) - } - - return links - } - - private static List> readFirstSpanEvents( - MessageUnpacker unpacker, - List stringTable) { - int payloadFieldCount = unpacker.unpackMapHeader() - for (int i = 0; i < payloadFieldCount; i++) { - int payloadFieldId = unpacker.unpackInt() - if (payloadFieldId != 11) { - skipPayloadField(unpacker, payloadFieldId, stringTable) - continue - } - - int chunkCount = unpacker.unpackArrayHeader() - assertEquals(1, chunkCount) - - int chunkFieldCount = unpacker.unpackMapHeader() - for (int chunkFieldIndex = 0; chunkFieldIndex < chunkFieldCount; chunkFieldIndex++) { - int chunkFieldId = unpacker.unpackInt() - if (chunkFieldId != 4) { - skipChunkField(unpacker, chunkFieldId, stringTable) - continue - } - - int spanCount = unpacker.unpackArrayHeader() - assertEquals(1, spanCount) - - int spanFieldCount = unpacker.unpackMapHeader() - for (int spanFieldIndex = 0; spanFieldIndex < spanFieldCount; spanFieldIndex++) { - int spanFieldId = unpacker.unpackInt() - if (spanFieldId == 12) { - return readSpanEvents(unpacker, stringTable) - } - skipSpanField(unpacker, spanFieldId, stringTable) - } - } - } - Assertions.fail("Could not find span events field in first span") - return [] - } - - private static List> readSpanEvents( - MessageUnpacker unpacker, - List stringTable) { - int eventsCount = unpacker.unpackArrayHeader() - List> events = [] - - for (int i = 0; i < eventsCount; i++) { - int eventFieldCount = unpacker.unpackMapHeader() - assertEquals(3, eventFieldCount) - - Long timeUnixNano = null - String name = null - Map attributes = null - - for (int j = 0; j < eventFieldCount; j++) { - int eventFieldId = unpacker.unpackInt() - switch (eventFieldId) { - case 1: - timeUnixNano = unpacker.unpackLong() - break - case 2: - name = readStreamingString(unpacker, stringTable) - break - case 3: - attributes = readEventAttributes(unpacker, stringTable) - break - default: - Assertions.fail("Unexpected span event field id: " + eventFieldId) - } - } - - events.add([ - timeUnixNano: timeUnixNano, - name : name, - attributes : attributes - ]) - } - return events - } - - private static Map readEventAttributes( - MessageUnpacker unpacker, - List stringTable) { - int attrArraySize = unpacker.unpackArrayHeader() - assertEquals(0, attrArraySize % 3) - int attrCount = attrArraySize / 3 - Map attributes = new HashMap<>() - - for (int i = 0; i < attrCount; i++) { - String key = readStreamingString(unpacker, stringTable) - int attrType = unpacker.unpackInt() - Object value - switch (attrType) { - case TraceMapperV1.VALUE_TYPE_STRING: - value = readStreamingString(unpacker, stringTable) - break - case TraceMapperV1.VALUE_TYPE_BOOLEAN: - value = unpacker.unpackBoolean() - break - case TraceMapperV1.VALUE_TYPE_FLOAT: - value = unpacker.unpackDouble() - break - case TraceMapperV1.VALUE_TYPE_INT: - value = unpacker.unpackLong() - break - case TraceMapperV1.VALUE_TYPE_ARRAY: - value = readEventArrayValue(unpacker, stringTable) - break - default: - Assertions.fail("Unknown event attribute value type: " + attrType) - } - attributes.put(key, value) - } - return attributes - } - - private static List readEventArrayValue(MessageUnpacker unpacker, List stringTable) { - int itemArraySize = unpacker.unpackArrayHeader() - assertEquals(0, itemArraySize % 2) - int itemCount = itemArraySize / 2 - List values = [] - for (int i = 0; i < itemCount; i++) { - int itemType = unpacker.unpackInt() - switch (itemType) { - case TraceMapperV1.VALUE_TYPE_STRING: - values.add(readStreamingString(unpacker, stringTable)) - break - case TraceMapperV1.VALUE_TYPE_BOOLEAN: - values.add(unpacker.unpackBoolean()) - break - case TraceMapperV1.VALUE_TYPE_FLOAT: - values.add(unpacker.unpackDouble()) - break - case TraceMapperV1.VALUE_TYPE_INT: - values.add(unpacker.unpackLong()) - break - default: - Assertions.fail("Unknown event array item type: " + itemType) - } - } - return values - } - - private static void skipSpanEvent(MessageUnpacker unpacker, List stringTable) { - int fieldCount = unpacker.unpackMapHeader() - for (int i = 0; i < fieldCount; i++) { - int fieldId = unpacker.unpackInt() - switch (fieldId) { - case 1: - unpacker.unpackLong() - break - case 2: - readStreamingString(unpacker, stringTable) - break - case 3: - readEventAttributes(unpacker, stringTable) - break - default: - Assertions.fail("Unexpected event field id while skipping: " + fieldId) - } - } - } - private static byte[] serializeMappedPayload( TraceMapperV1 mapper, List> traces) { @@ -1699,12 +1168,6 @@ class TraceMapperV1PayloadTest extends DDSpecification { processTagsAndBaggageCount++ super.processTagsAndBaggage(consumer) } - - @Override - void processTagsAndBaggage(MetadataConsumer consumer, boolean injectLinksAsTags, boolean injectBaggageAsTags) { - processTagsAndBaggageCount++ - super.processTagsAndBaggage(consumer, injectLinksAsTags, injectBaggageAsTags) - } } private static class ByteArrayChannel implements WritableByteChannel { diff --git a/dd-trace-core/src/test/groovy/datadog/trace/common/writer/ddintake/DDIntakeTraceInterceptorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/common/writer/ddintake/DDIntakeTraceInterceptorTest.groovy index b55c559e57d..31c5c1c68ee 100644 --- a/dd-trace-core/src/test/groovy/datadog/trace/common/writer/ddintake/DDIntakeTraceInterceptorTest.groovy +++ b/dd-trace-core/src/test/groovy/datadog/trace/common/writer/ddintake/DDIntakeTraceInterceptorTest.groovy @@ -22,7 +22,7 @@ class DDIntakeTraceInterceptorTest extends DDCoreSpecification { def "test normalization for dd intake"() { setup: - tracer.buildSpan("my-operation-name") + tracer.buildSpan("datadog", "my-operation-name") .withResourceName("my-resource-name") .withSpanType("my-span-type") .withServiceName("my-service-name") @@ -58,7 +58,7 @@ class DDIntakeTraceInterceptorTest extends DDCoreSpecification { def "test normalization does not implicitly convert span type"() { setup: def originalSpanType = UTF8BytesString.create("a UTF8 span type") - tracer.buildSpan("my-operation-name") + tracer.buildSpan("datadog", "my-operation-name") .withSpanType(originalSpanType) .start().finish() @@ -75,7 +75,7 @@ class DDIntakeTraceInterceptorTest extends DDCoreSpecification { def "test default env setting"() { setup: - tracer.buildSpan("my-operation-name").start().finish() + tracer.buildSpan("datadog", "my-operation-name").start().finish() writer.waitForTraces(1) expect: diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/DDSpanContextTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/DDSpanContextTest.groovy deleted file mode 100644 index fc7d4ce93a4..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/DDSpanContextTest.groovy +++ /dev/null @@ -1,469 +0,0 @@ -package datadog.trace.core - -import datadog.trace.api.DDTags -import datadog.trace.api.DDTraceId -import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext -import datadog.trace.bootstrap.instrumentation.api.ErrorPriorities -import datadog.trace.bootstrap.instrumentation.api.ProfilingContextIntegration -import datadog.trace.bootstrap.instrumentation.api.ServiceNameSources -import datadog.trace.bootstrap.instrumentation.api.Tags -import datadog.trace.common.writer.ListWriter -import datadog.trace.core.propagation.ExtractedContext -import datadog.trace.core.test.DDCoreSpecification - -import static datadog.trace.api.TracePropagationStyle.DATADOG -import static datadog.trace.api.sampling.PrioritySampling.* -import static datadog.trace.api.sampling.SamplingMechanism.* -import static datadog.trace.core.DDSpanContext.SPAN_SAMPLING_MECHANISM_TAG -import static datadog.trace.core.DDSpanContext.SPAN_SAMPLING_RULE_RATE_TAG -import static datadog.trace.core.DDSpanContext.SPAN_SAMPLING_MAX_PER_SECOND_TAG - -class DDSpanContextTest extends DDCoreSpecification { - - def writer - CoreTracer tracer - def profilingContextIntegration - - def setup() { - writer = new ListWriter() - profilingContextIntegration = Mock(ProfilingContextIntegration) - tracer = tracerBuilder().writer(writer) - .profilingContextIntegration(profilingContextIntegration).build() - } - - def cleanup() { - tracer.close() - } - - def "null values for tags delete existing tags"() { - setup: - def span = tracer.buildSpan("fakeOperation") - .withServiceName("fakeService") - .withResourceName("fakeResource") - .withSpanType("fakeType") - .start() - def context = span.context() - - when: - context.setTag("some.tag", "asdf") - context.setTag(name, null) - context.setErrorFlag(true, ErrorPriorities.DEFAULT) - span.finish() - - writer.waitForTraces(1) - - then: - assertTagmap(context.getTags(), tags) - context.serviceName == "fakeService" - context.resourceName.toString() == "fakeResource" - context.spanType == "fakeType" - - where: - name | tags - DDTags.SERVICE_NAME | ["some.tag": "asdf", (DDTags.THREAD_NAME): Thread.currentThread().name, (DDTags.THREAD_ID): Thread.currentThread().id, (DDTags.DD_SVC_SRC): ServiceNameSources.MANUAL] - DDTags.RESOURCE_NAME | ["some.tag": "asdf", (DDTags.THREAD_NAME): Thread.currentThread().name, (DDTags.THREAD_ID): Thread.currentThread().id, (DDTags.DD_SVC_SRC): ServiceNameSources.MANUAL] - DDTags.SPAN_TYPE | ["some.tag": "asdf", (DDTags.THREAD_NAME): Thread.currentThread().name, (DDTags.THREAD_ID): Thread.currentThread().id, (DDTags.DD_SVC_SRC): ServiceNameSources.MANUAL] - "some.tag" | [(DDTags.THREAD_NAME): Thread.currentThread().name, (DDTags.THREAD_ID): Thread.currentThread().id, (DDTags.DD_SVC_SRC): ServiceNameSources.MANUAL] - } - - def "special tags set certain values"() { - setup: - def span = tracer.buildSpan("fakeOperation") - .withServiceName("fakeService") - .withResourceName("fakeResource") - .withSpanType("fakeType") - .start() - def context = span.context() - - when: - context.setTag(name, value) - span.finish() - writer.waitForTraces(1) - - then: - def thread = Thread.currentThread() - assertTagmap(context.getTags(), [(DDTags.THREAD_NAME): thread.name, (DDTags.THREAD_ID): thread.id, (DDTags.DD_SVC_SRC): ServiceNameSources.MANUAL]) - context."$method" == value - - where: - name | value | method | details - DDTags.SERVICE_NAME | "different service" | "serviceName" | "different service/fakeOperation/fakeResource" - DDTags.RESOURCE_NAME | "different resource" | "resourceName" | "fakeService/fakeOperation/different resource" - DDTags.SPAN_TYPE | "different type" | "spanType" | "fakeService/fakeOperation/fakeResource" - } - - def "tags can be added to the context"() { - setup: - def span = tracer.buildSpan("fakeOperation") - .withServiceName("fakeService") - .withResourceName("fakeResource") - .withSpanType("fakeType") - .start() - def context = span.context() - - when: - context.setTag(name, value) - span.finish() - writer.waitForTraces(1) - def thread = Thread.currentThread() - - then: - assertTagmap(context.getTags(), [ - (name) : value, - (DDTags.THREAD_NAME) : thread.name, - (DDTags.THREAD_ID) : thread.id, - (DDTags.DD_SVC_SRC): ServiceNameSources.MANUAL - ]) - - where: - name | value - "tag.name" | "some value" - "tag with int" | 1234 - "tag-with-bool" | false - "tag_with_float" | 0.321 - } - - def "metrics use the expected types"() { - // floats should be converted to doubles. - setup: - def span = tracer.buildSpan("fakeOperation") - .withServiceName("fakeService") - .withResourceName("fakeResource") - .start() - def context = span.context() - - when: - context.setMetric("test", (Number)value) - - then: - type.isInstance(context.getTag("test")) - - where: - type | value - Integer | 0 - Integer | Integer.MAX_VALUE - Integer | Integer.MIN_VALUE - Short | Short.MAX_VALUE - Short | Short.MIN_VALUE - Float | Float.MAX_VALUE - Float | Float.MIN_VALUE - Double | Double.MAX_VALUE - Double | Double.MIN_VALUE - Float | 1f - Double | 1d - Float | 0.5f - Double | 0.5d - Integer | 0x55 - } - - def "force keep really keeps the trace"() { - setup: - def span = tracer.buildSpan("fakeOperation") - .withServiceName("fakeService") - .withResourceName("fakeResource") - .start() - def context = span.context() - when: - context.setSamplingPriority(SAMPLER_DROP, DEFAULT) - then: "priority should be set" - context.getSamplingPriority() == SAMPLER_DROP - - when: "sampling priority locked" - context.lockSamplingPriority() - then: "override ignored" - !context.setSamplingPriority(USER_DROP, MANUAL) - context.getSamplingPriority() == SAMPLER_DROP - - when: - context.forceKeep() - then: "lock is bypassed and priority set to USER_KEEP" - context.getSamplingPriority() == USER_KEEP - - cleanup: - span.finish() - } - - def "set TraceSegment tags and data on correct span"() { - setup: - def extracted = new ExtractedContext(DDTraceId.from(123), 456, SAMPLER_KEEP, "789", tracer.getPropagationTagsFactory().empty(), DATADOG) - .withRequestContextDataAppSec("dummy") - - def top = tracer.buildSpan("top").asChildOf((AgentSpanContext) extracted).start() - def topC = (DDSpanContext) top.context() - def topTS = top.getRequestContext().getTraceSegment() - def current = tracer.buildSpan("current").asChildOf(top).start() - def currentTS = current.getRequestContext().getTraceSegment() - def currentC = (DDSpanContext) current.context() - - when: - currentTS.setDataTop("ctd", "[1]") - currentTS.setTagTop("ctt", "t1") - currentTS.setDataCurrent("ccd", "[2]") - currentTS.setTagCurrent("cct", "t2") - topTS.setDataTop("ttd", "[3]") - topTS.setTagTop("ttt", "t3") - topTS.setDataCurrent("tcd", "[4]") - topTS.setTagCurrent("tct", "t4") - - then: - assertTagmap(topC.getTags(), [(dataTag("ctd")): "[1]", "ctt": "t1", - (dataTag("ttd")): "[3]", "ttt": "t3", - (dataTag("tcd")): "[4]", "tct": "t4"], true) - assertTagmap(currentC.getTags(), [(dataTag("ccd")): "[2]", "cct": "t2"], true) - - cleanup: - current.finish() - top.finish() - } - - def "set single span sampling tags"() { - setup: - def span = tracer.buildSpan("fakeOperation") - .withServiceName("fakeService") - .withResourceName("fakeResource") - .start() - def context = span.context() as DDSpanContext - - expect: - context.getSamplingPriority() == UNSET - - when: - context.setSpanSamplingPriority(rate, limit) - - then: - context.getTag(SPAN_SAMPLING_MECHANISM_TAG) == SPAN_SAMPLING_RATE - context.getTag(SPAN_SAMPLING_RULE_RATE_TAG) == rate - context.getTag(SPAN_SAMPLING_MAX_PER_SECOND_TAG) == (limit == Integer.MAX_VALUE ? null : limit) - // single span sampling should not change the trace sampling priority - context.getSamplingPriority() == UNSET - // make sure the `_dd.p.dm` tag has not been set by single span sampling - !context.getPropagationTags().createTagMap().containsKey("_dd.p.dm") - - where: - rate | limit - 1.0 | 10 - 0.5 | 100 - 0.25 | Integer.MAX_VALUE - } - - def "setting resource name to null is ignored"() { - setup: - def span = tracer.buildSpan("fakeOperation") - .withServiceName("fakeService") - .withResourceName("fakeResource") - .start() - - when: - span.setResourceName(null) - - then: - span.resourceName == "fakeResource" - } - - def "setting operation name triggers constant encoding"() { - when: - def span = tracer.buildSpan("fakeOperation") - .withServiceName("fakeService") - .withResourceName("fakeResource") - .start() - - then: "encoded operation name matches operation name" - 1 * profilingContextIntegration.encodeOperationName("fakeOperation") >> 1 - 1 * profilingContextIntegration.encodeResourceName("fakeResource") >> -1 - span.context.encodedOperationName == 1 - span.context.encodedResourceName == -1 - - when: - span.setOperationName("newOperationName") - - then: - 1 * profilingContextIntegration.encodeOperationName("newOperationName") >> 2 - span.context.encodedOperationName == 2 - - when: - span.setResourceName("newResourceName") - - then: - 1 * profilingContextIntegration.encodeResourceName("newResourceName") >> -2 - span.context.encodedResourceName == -2 - } - - private static String dataTag(String tag) { - "_dd.${tag}.json" - } - - def "Span IDs printed as unsigned long"() { - setup: - def parent = tracer.buildSpan("fakeOperation") - .withServiceName("fakeService") - .withResourceName("fakeResource") - .withSpanId(-987654321) - .start() - - def span = tracer.buildSpan("fakeOperation") - .withServiceName("fakeService") - .withResourceName("fakeResource") - .withSpanId(-123456789) - .asChildOf(parent.context()) - .start() - - def context = span.context() as DDSpanContext - - expect: - // even though span ID and parent ID are setup as negative numbers, they should be printed as their unsigned value - // asserting there is no negative sign after ids is the best I can do. - context.toString().contains("id=-") == false - } - - def "service name source is propagated from parent to child span"() { - setup: - def parent = tracer.buildSpan("parentOperation") - .withServiceName("fakeService") - .start() - - when: - def child = tracer.buildSpan("childOperation") - .asChildOf(parent.context()) - .start() - def childContext = child.context() as DDSpanContext - - then: - childContext.getServiceNameSource() == ServiceNameSources.MANUAL - - cleanup: - child.finish() - parent.finish() - } - - static void assertTagmap(Map source, Map comparison, boolean removeThread = false) { - def sourceWithoutCommonTags = new HashMap(source) - sourceWithoutCommonTags.remove("runtime-id") - sourceWithoutCommonTags.remove("language") - sourceWithoutCommonTags.remove("_dd.agent_psr") - sourceWithoutCommonTags.remove("_sample_rate") - sourceWithoutCommonTags.remove("process_id") - sourceWithoutCommonTags.remove("_dd.trace_span_attribute_schema") - sourceWithoutCommonTags.remove(DDTags.PROFILING_ENABLED) - sourceWithoutCommonTags.remove(DDTags.PROFILING_CONTEXT_ENGINE) - sourceWithoutCommonTags.remove(DDTags.DSM_ENABLED) - sourceWithoutCommonTags.remove(DDTags.DJM_ENABLED) - if (removeThread) { - sourceWithoutCommonTags.remove(DDTags.THREAD_ID) - sourceWithoutCommonTags.remove(DDTags.THREAD_NAME) - } - assert sourceWithoutCommonTags == comparison - } - - def "span kind ordinal constants and SPAN_KIND_VALUES array stay in sync"() { - expect: "SPAN_KIND_VALUES array covers all ordinals" - DDSpanContext.SPAN_KIND_VALUES.length == DDSpanContext.SPAN_KIND_CUSTOM + 1 - - and: "each known ordinal maps to the correct Tags constant" - DDSpanContext.SPAN_KIND_VALUES[DDSpanContext.SPAN_KIND_SERVER] == Tags.SPAN_KIND_SERVER - DDSpanContext.SPAN_KIND_VALUES[DDSpanContext.SPAN_KIND_CLIENT] == Tags.SPAN_KIND_CLIENT - DDSpanContext.SPAN_KIND_VALUES[DDSpanContext.SPAN_KIND_PRODUCER] == Tags.SPAN_KIND_PRODUCER - DDSpanContext.SPAN_KIND_VALUES[DDSpanContext.SPAN_KIND_CONSUMER] == Tags.SPAN_KIND_CONSUMER - DDSpanContext.SPAN_KIND_VALUES[DDSpanContext.SPAN_KIND_INTERNAL] == Tags.SPAN_KIND_INTERNAL - DDSpanContext.SPAN_KIND_VALUES[DDSpanContext.SPAN_KIND_BROKER] == Tags.SPAN_KIND_BROKER - - and: "UNSET and CUSTOM map to null" - DDSpanContext.SPAN_KIND_VALUES[DDSpanContext.SPAN_KIND_UNSET] == null - DDSpanContext.SPAN_KIND_VALUES[DDSpanContext.SPAN_KIND_CUSTOM] == null - } - - def "setSpanKindOrdinal round-trips with SPAN_KIND_VALUES for all known kinds"() { - when: - def span = tracer.buildSpan("test", "test").start() - def context = (DDSpanContext) span.context() - context.setSpanKindOrdinal(kindString) - - then: - context.getSpanKindOrdinal() == expectedOrdinal - DDSpanContext.SPAN_KIND_VALUES[expectedOrdinal] == kindString - - cleanup: - span.finish() - - where: - kindString | expectedOrdinal - Tags.SPAN_KIND_SERVER | DDSpanContext.SPAN_KIND_SERVER - Tags.SPAN_KIND_CLIENT | DDSpanContext.SPAN_KIND_CLIENT - Tags.SPAN_KIND_PRODUCER | DDSpanContext.SPAN_KIND_PRODUCER - Tags.SPAN_KIND_CONSUMER | DDSpanContext.SPAN_KIND_CONSUMER - Tags.SPAN_KIND_INTERNAL | DDSpanContext.SPAN_KIND_INTERNAL - Tags.SPAN_KIND_BROKER | DDSpanContext.SPAN_KIND_BROKER - } - - def "setTag and getTag round-trip for span.kind"() { - when: - def span = tracer.buildSpan("test", "test").start() - span.setTag(Tags.SPAN_KIND, kindString) - - then: - span.getTag(Tags.SPAN_KIND) == kindString - - cleanup: - span.finish() - - where: - kindString << [ - Tags.SPAN_KIND_SERVER, - Tags.SPAN_KIND_CLIENT, - Tags.SPAN_KIND_PRODUCER, - Tags.SPAN_KIND_CONSUMER, - Tags.SPAN_KIND_INTERNAL, - Tags.SPAN_KIND_BROKER, - ] - } - - def "getTag returns null when span.kind is not set"() { - when: - def span = tracer.buildSpan("test", "test").start() - - then: - span.getTag(Tags.SPAN_KIND) == null - - cleanup: - span.finish() - } - - def "setTag then removeTag clears span.kind"() { - when: - def span = tracer.buildSpan("test", "test").start() - span.setTag(Tags.SPAN_KIND, kindString) - - then: - span.getTag(Tags.SPAN_KIND) == kindString - - when: - ((DDSpan) span).context().removeTag(Tags.SPAN_KIND) - - then: - span.getTag(Tags.SPAN_KIND) == null - - cleanup: - span.finish() - - where: - kindString << [ - Tags.SPAN_KIND_SERVER, - Tags.SPAN_KIND_CLIENT, - Tags.SPAN_KIND_PRODUCER, - Tags.SPAN_KIND_CONSUMER, - Tags.SPAN_KIND_INTERNAL, - Tags.SPAN_KIND_BROKER, - ] - } - - def "setTag with custom span.kind falls back to tag map"() { - when: - def span = tracer.buildSpan("test", "test").start() - span.setTag(Tags.SPAN_KIND, "custom-kind") - - then: - span.getTag(Tags.SPAN_KIND) == "custom-kind" - - cleanup: - span.finish() - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/DDSpanSerializationTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/DDSpanSerializationTest.groovy deleted file mode 100644 index 3613743e9ff..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/DDSpanSerializationTest.groovy +++ /dev/null @@ -1,496 +0,0 @@ -package datadog.trace.core - -import static datadog.trace.api.config.GeneralConfig.EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED - -import datadog.communication.serialization.ByteBufferConsumer -import datadog.communication.serialization.FlushingBuffer -import datadog.communication.serialization.msgpack.MsgPackWriter -import datadog.trace.api.DDSpanId -import datadog.trace.api.DDTraceId -import datadog.trace.api.ProcessTags -import datadog.trace.api.sampling.PrioritySampling -import datadog.trace.api.datastreams.NoopPathwayContext -import datadog.trace.common.writer.ListWriter -import datadog.trace.common.writer.ddagent.TraceMapperV0_4 -import datadog.trace.common.writer.ddagent.TraceMapperV0_5 -import datadog.trace.core.test.DDCoreSpecification -import org.msgpack.core.MessageFormat -import org.msgpack.core.MessagePack -import org.msgpack.core.buffer.ArrayBufferInput -import org.msgpack.value.ValueType - -import java.nio.ByteBuffer - -class DDSpanSerializationTest extends DDCoreSpecification { - - def setupSpec() { - //disable process tags since will generate noise on the meta - injectSysConfig(EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED, "false") - ProcessTags.reset() - } - - def cleanupSpec() { - //disable process tags since will generate noise on the meta - injectSysConfig(EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED, "true") - ProcessTags.reset() - } - - def "serialize trace with id #value as int"() { - setup: - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - def traceId = DDTraceId.from(value) - def spanId = DDSpanId.from(value) - def context = createContext(spanType, tracer, traceId, spanId) - def span = DDSpan.create("test", 0, context, null) - CaptureBuffer capture = new CaptureBuffer() - def packer = new MsgPackWriter(new FlushingBuffer(1024, capture)) - packer.format(Collections.singletonList(span), new TraceMapperV0_4()) - packer.flush() - def unpacker = MessagePack.newDefaultUnpacker(new ArrayBufferInput(capture.bytes)) - int traceCount = capture.messageCount - int spanCount = unpacker.unpackArrayHeader() - int size = unpacker.unpackMapHeader() - - expect: - traceCount == 1 - spanCount == 1 - size == 12 - for (int i = 0; i < size; i++) { - String key = unpacker.unpackString() - - switch (key) { - case "trace_id": - MessageFormat next = unpacker.nextFormat - assert next.valueType == ValueType.INTEGER - if (next == MessageFormat.UINT64) { - assert traceId == DDTraceId.from("${unpacker.unpackBigInteger()}") - } else { - assert traceId == DDTraceId.from(unpacker.unpackLong()) - } - break - case "span_id": - MessageFormat next = unpacker.nextFormat - assert next.valueType == ValueType.INTEGER - if (next == MessageFormat.UINT64) { - assert spanId == DDSpanId.from("${unpacker.unpackBigInteger()}") - } else { - assert spanId == unpacker.unpackLong() - } - break - default: - unpacker.unpackValue() - } - } - - cleanup: - tracer.close() - - where: - value | spanType - "0" | null - "1" | "some-type" - "8223372036854775807" | null - "${BigInteger.valueOf(Long.MAX_VALUE).subtract(1G)}" | "some-type" - "${BigInteger.valueOf(Long.MAX_VALUE).add(1G)}" | null - "${2G.pow(64).subtract(1G)}" | "some-type" - } - - def "serialize trace with id #value as int v0.5"() { - setup: - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - def traceId = DDTraceId.from(value) - def spanId = DDSpanId.from(value) - def context = createContext(spanType, tracer, traceId, spanId) - def span = DDSpan.create("test", 0, context, null) - CaptureBuffer capture = new CaptureBuffer() - def packer = new MsgPackWriter(new FlushingBuffer(1024, capture)) - def traceMapper = new TraceMapperV0_5() - packer.format(Collections.singletonList(span), traceMapper) - packer.flush() - def dictionaryUnpacker = MessagePack.newDefaultUnpacker(traceMapper.dictionary.slice()) - String[] dictionary = new String[traceMapper.encoding.size()] - for (int i = 0; i < dictionary.length; ++i) { - dictionary[i] = dictionaryUnpacker.unpackString() - } - def unpacker = MessagePack.newDefaultUnpacker(new ArrayBufferInput(capture.bytes)) - int traceCount = capture.messageCount - - int spanCount = unpacker.unpackArrayHeader() - int size = unpacker.unpackArrayHeader() - - expect: - traceCount == 1 - spanCount == 1 - size == 12 - for (int i = 0; i < size; i++) { - switch (i) { - case 3: - MessageFormat next = unpacker.nextFormat - assert next.valueType == ValueType.INTEGER - if (next == MessageFormat.UINT64) { - assert traceId == DDTraceId.from("${unpacker.unpackBigInteger()}") - } else { - assert traceId == DDTraceId.from(unpacker.unpackLong()) - } - break - case 4: - MessageFormat next = unpacker.nextFormat - assert next.valueType == ValueType.INTEGER - if (next == MessageFormat.UINT64) { - assert spanId == DDSpanId.from("${unpacker.unpackBigInteger()}") - } else { - assert spanId == unpacker.unpackLong() - } - break - default: - unpacker.unpackValue() - } - } - - cleanup: - tracer.close() - - where: - value | spanType - "0" | null - "1" | "some-type" - "8223372036854775807" | null - "${BigInteger.valueOf(Long.MAX_VALUE).subtract(1G)}" | "some-type" - "${BigInteger.valueOf(Long.MAX_VALUE).add(1G)}" | null - "${2G.pow(64).subtract(1G)}" | "some-type" - } - - def "serialize trace with baggage and tags correctly v0.4"() { - setup: - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - def context = new DDSpanContext( - DDTraceId.ONE, - 1, - DDSpanId.ZERO, - null, - "fakeService", - "fakeOperation", - "fakeResource", - PrioritySampling.UNSET, - null, - baggage, - false, - null, - tags.size(), - tracer.traceCollectorFactory.create(DDTraceId.ONE), - null, - null, - NoopPathwayContext.INSTANCE, - false, - null, - injectBaggage, - true) - context.setAllTags(tags) - def span = DDSpan.create("test", 0, context, null) - CaptureBuffer capture = new CaptureBuffer() - def packer = new MsgPackWriter(new FlushingBuffer(1024, capture)) - packer.format(Collections.singletonList(span), new TraceMapperV0_4()) - packer.flush() - def unpacker = MessagePack.newDefaultUnpacker(new ArrayBufferInput(capture.bytes)) - int traceCount = capture.messageCount - int spanCount = unpacker.unpackArrayHeader() - int size = unpacker.unpackMapHeader() - - expect: - traceCount == 1 - spanCount == 1 - size == 12 - for (int i = 0; i < size; i++) { - String key = unpacker.unpackString() - - switch (key) { - case "meta": - int packedSize = unpacker.unpackMapHeader() - Map unpackedMeta = [:] - for (int j = 0; j < packedSize; j++) { - def k = unpacker.unpackString() - def v = unpacker.unpackString() - if (k != "thread.name" && k != "thread.id") { - unpackedMeta.put(k, v) - } - } - assert unpackedMeta == expected - break - default: - unpacker.unpackValue() - } - } - - cleanup: - tracer.close() - - where: - baggage | tags | expected | injectBaggage - [:] | [:] | [:] | true - [foo: "bbar"] | [:] | [foo: "bbar"] | true - [foo: "bbar"] | [bar: "tfoo"] | [foo: "bbar", bar: "tfoo"] | true - [foo: "bbar"] | [foo: "tbar"] | [foo: "tbar"] | true - [:] | [:] | [:] | false - [foo: "bbar"] | [:] | [:] | false - [foo: "bbar"] | [bar: "tfoo"] | [bar: "tfoo"] | false - [foo: "bbar"] | [foo: "tbar"] | [foo: "tbar"] | false - } - - def "serialize trace with baggage and tags correctly v0.5"() { - setup: - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - def context = new DDSpanContext( - DDTraceId.ONE, - 1, - DDSpanId.ZERO, - null, - "fakeService", - "fakeOperation", - "fakeResource", - PrioritySampling.UNSET, - null, - baggage, - false, - null, - tags.size(), - tracer.traceCollectorFactory.create(DDTraceId.ONE), - null, - null, - NoopPathwayContext.INSTANCE, - false, - null, - injectBaggage, - true) - context.setAllTags(tags) - def span = DDSpan.create("test", 0, context, null) - CaptureBuffer capture = new CaptureBuffer() - def packer = new MsgPackWriter(new FlushingBuffer(1024, capture)) - def mapper = new TraceMapperV0_5() - packer.format(Collections.singletonList(span), mapper) - packer.flush() - def unpacker = MessagePack.newDefaultUnpacker(new ArrayBufferInput(capture.bytes)) - int traceCount = capture.messageCount - int spanCount = unpacker.unpackArrayHeader() - int size = unpacker.unpackArrayHeader() - def dictionaryUnpacker = MessagePack.newDefaultUnpacker(mapper.dictionary.slice()) - String[] dictionary = new String[mapper.encoding.size()] - for (int i = 0; i < dictionary.length; ++i) { - dictionary[i] = dictionaryUnpacker.unpackString() - } - - expect: - traceCount == 1 - spanCount == 1 - size == 12 - for (int i = 0; i < 9; ++i) { - unpacker.skipValue() - } - - int packedSize = unpacker.unpackMapHeader() - Map unpackedMeta = [:] - for (int j = 0; j < packedSize; j++) { - def k = dictionary[unpacker.unpackInt()] - def v = dictionary[unpacker.unpackInt()] - if (k != "thread.name" && k != "thread.id") { - unpackedMeta.put(k, v) - } - } - assert unpackedMeta == expected - - cleanup: - tracer.close() - - where: - baggage | tags | expected | injectBaggage - [:] | [:] | [:] | true - [foo: "bbar"] | [:] | [foo: "bbar"] | true - [foo: "bbar"] | [bar: "tfoo"] | [foo: "bbar", bar: "tfoo"] | true - [foo: "bbar"] | [foo: "tbar"] | [foo: "tbar"] | true - [:] | [:] | [:] | false - [foo: "bbar"] | [:] | [:] | false - [foo: "bbar"] | [bar: "tfoo"] | [bar: "tfoo"] | false - [foo: "bbar"] | [foo: "tbar"] | [foo: "tbar"] | false - } - - def "serialize trace with flat map tag v0.4"() { - setup: - def tracer = tracerBuilder().writer(new ListWriter()).build() - def context = new DDSpanContext( - DDTraceId.ONE, - 1, - DDSpanId.ZERO, - null, - "fakeService", - "fakeOperation", - "fakeResource", - PrioritySampling.UNSET, - null, - null, - false, - null, - 0, - tracer.traceCollectorFactory.create(DDTraceId.ONE), - null, - null, - NoopPathwayContext.INSTANCE, - false, - null) - context.setTag('key1', 'value1') - context.setTag('key2', [ - 'sub1': 'v1', - 'sub2': 'v2' - ]) - def span = DDSpan.create("test", 0, context, null) - - CaptureBuffer capture = new CaptureBuffer() - def packer = new MsgPackWriter(new FlushingBuffer(1024, capture)) - packer.format(Collections.singletonList(span), new TraceMapperV0_4()) - packer.flush() - def unpacker = MessagePack.newDefaultUnpacker(new ArrayBufferInput(capture.bytes)) - int traceCount = capture.messageCount - int spanCount = unpacker.unpackArrayHeader() - int size = unpacker.unpackMapHeader() - - def expectedMeta = ['key1': 'value1', 'key2.sub1': 'v1', 'key2.sub2': 'v2'] - - expect: - traceCount == 1 - spanCount == 1 - - for (int i = 0; i < size; i++) { - String key = unpacker.unpackString() - - switch (key) { - case "meta": - int packedSize = unpacker.unpackMapHeader() - Map unpackedMeta = [:] - for (int j = 0; j < packedSize; j++) { - def k = unpacker.unpackString() - def v = unpacker.unpackString() - if (k != "thread.name" && k != "thread.id") { - unpackedMeta.put(k, v) - } - } - assert unpackedMeta == expectedMeta - break - default: - unpacker.unpackValue() - } - } - - cleanup: - tracer.close() - } - - def "serialize trace with flat map tag v0.5"() { - setup: - def tracer = tracerBuilder().writer(new ListWriter()).build() - def context = new DDSpanContext( - DDTraceId.ONE, - 1, - DDSpanId.ZERO, - null, - "fakeService", - "fakeOperation", - "fakeResource", - PrioritySampling.UNSET, - null, - null, - false, - null, - 0, - tracer.traceCollectorFactory.create(DDTraceId.ONE), - null, - null, - NoopPathwayContext.INSTANCE, - false, - null) - context.setTag('key1', 'value1') - context.setTag('key2', [ - 'sub1': 'v1', - 'sub2': 'v2' - ]) - def span = DDSpan.create("test", 0, context, null) - - CaptureBuffer capture = new CaptureBuffer() - def packer = new MsgPackWriter(new FlushingBuffer(1024, capture)) - def mapper = new TraceMapperV0_5() - packer.format(Collections.singletonList(span), mapper) - packer.flush() - def unpacker = MessagePack.newDefaultUnpacker(new ArrayBufferInput(capture.bytes)) - int traceCount = capture.messageCount - int spanCount = unpacker.unpackArrayHeader() - int size = unpacker.unpackArrayHeader() - def dictionaryUnpacker = MessagePack.newDefaultUnpacker(mapper.dictionary.slice()) - String[] dictionary = new String[mapper.encoding.size()] - for (int i = 0; i < dictionary.length; ++i) { - dictionary[i] = dictionaryUnpacker.unpackString() - } - - def expectedMeta = ['key1': 'value1', 'key2.sub1': 'v1', 'key2.sub2': 'v2'] - - expect: - traceCount == 1 - spanCount == 1 - size == 12 - for (int i = 0; i < 9; ++i) { - unpacker.skipValue() - } - - int packedSize = unpacker.unpackMapHeader() - Map unpackedMeta = [:] - for (int j = 0; j < packedSize; j++) { - def k = dictionary[unpacker.unpackInt()] - def v = dictionary[unpacker.unpackInt()] - if (k != "thread.name" && k != "thread.id") { - unpackedMeta.put(k, v) - } - } - assert unpackedMeta == expectedMeta - - cleanup: - tracer.close() - } - - private class CaptureBuffer implements ByteBufferConsumer { - - private byte[] bytes - int messageCount - - @Override - void accept(int messageCount, ByteBuffer buffer) { - this.messageCount = messageCount - this.bytes = new byte[buffer.limit() - buffer.position()] - buffer.get(bytes) - } - } - - def createContext(String spanType, CoreTracer tracer, DDTraceId traceId, long spanId) { - DDSpanContext ctx = new DDSpanContext( - traceId, - spanId, - DDSpanId.ZERO, - null, - "fakeService", - "fakeOperation", - "fakeResource", - PrioritySampling.UNSET, - null, - ["a-baggage": "value"], - false, - spanType, - 1, - tracer.traceCollectorFactory.create(DDTraceId.ONE), - null, - null, - NoopPathwayContext.INSTANCE, - false, - null) - ctx.setAllTags(["k1": "v1"]) - return ctx - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/DDSpanTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/DDSpanTest.groovy deleted file mode 100644 index e7882432d9c..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/DDSpanTest.groovy +++ /dev/null @@ -1,470 +0,0 @@ -package datadog.trace.core - -import datadog.trace.api.DDSpanId -import datadog.trace.api.DDTags -import datadog.trace.api.DDTraceId -import datadog.trace.api.TagMap -import datadog.trace.api.gateway.RequestContextSlot -import datadog.trace.api.sampling.PrioritySampling -import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext -import datadog.trace.api.datastreams.NoopPathwayContext -import datadog.trace.bootstrap.instrumentation.api.ErrorPriorities -import datadog.trace.bootstrap.instrumentation.api.TagContext -import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString -import datadog.trace.common.sampling.RateByServiceTraceSampler -import datadog.trace.common.writer.ListWriter -import datadog.trace.core.propagation.ExtractedContext -import datadog.trace.core.test.DDCoreSpecification -import spock.lang.Shared - -import java.util.concurrent.TimeUnit - -import static datadog.trace.api.TracePropagationStyle.DATADOG -import static datadog.trace.api.sampling.PrioritySampling.UNSET -import static datadog.trace.api.sampling.SamplingMechanism.SPAN_SAMPLING_RATE -import static datadog.trace.core.DDSpanContext.SPAN_SAMPLING_MAX_PER_SECOND_TAG -import static datadog.trace.core.DDSpanContext.SPAN_SAMPLING_MECHANISM_TAG -import static datadog.trace.core.DDSpanContext.SPAN_SAMPLING_RULE_RATE_TAG - -class DDSpanTest extends DDCoreSpecification { - - @Shared def writer = new ListWriter() - @Shared def sampler = new RateByServiceTraceSampler() - @Shared def tracer = tracerBuilder().writer(writer).sampler(sampler).build() - @Shared def propagationTagsFactory = tracer.getPropagationTagsFactory() - - def cleanup() { - tracer?.close() - } - - def "getters and setters"() { - setup: - def span = tracer.buildSpan("fakeOperation") - .withServiceName("fakeService") - .withResourceName("fakeResource") - .withSpanType("fakeType") - .start() - - when: - span.setServiceName("service") - then: - span.getServiceName() == "service" - - when: - span.setOperationName("operation") - then: - span.getOperationName() == "operation" - - when: - span.setResourceName("resource") - then: - span.getResourceName() == "resource" - - when: - span.setSpanType("type") - then: - span.getType() == "type" - - when: - span.setSamplingPriority(PrioritySampling.UNSET) - then: - span.getSamplingPriority() == null - - when: - span.setSamplingPriority(PrioritySampling.SAMPLER_KEEP) - then: - span.getSamplingPriority() == PrioritySampling.SAMPLER_KEEP - - when: - span.context().lockSamplingPriority() - span.setSamplingPriority(PrioritySampling.USER_KEEP) - then: - span.getSamplingPriority() == PrioritySampling.SAMPLER_KEEP - } - - def "resource name equals operation name if null"() { - setup: - final String opName = "operationName" - def span - - when: - span = tracer.buildSpan(opName).start() - then: - span.getResourceName() == opName - span.getServiceName() != "" - - when: - final String resourceName = "fake" - final String serviceName = "myService" - span = tracer - .buildSpan(opName) - .withResourceName(resourceName) - .withServiceName(serviceName) - .start() - then: - span.getResourceName() == resourceName - span.getServiceName() == serviceName - } - - def "duration measured in nanoseconds"() { - setup: - def mod = TimeUnit.MILLISECONDS.toNanos(1) - def builder = tracer.buildSpan("test") - def start = System.nanoTime() - def span = builder.start() - def between = System.nanoTime() - def betweenDur = System.nanoTime() - between - span.finish() - def total = System.nanoTime() - start - - expect: - // Generous 5 seconds to execute this test - Math.abs(TimeUnit.NANOSECONDS.toSeconds(span.startTime) - TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())) < 5 - span.durationNano > betweenDur - span.durationNano < total - span.durationNano % mod > 0 // Very slim chance of a false negative. - } - - def "phasedFinish captures duration but doesn't publish immediately"() { - setup: - def mod = TimeUnit.MILLISECONDS.toNanos(1) - def builder = tracer.buildSpan("test") - def start = System.nanoTime() - def span = builder.start() - def between = System.nanoTime() - def betweenDur = System.nanoTime() - between - - when: "calling publish before phasedFinish" - span.publish() - - then: "has no effect" - span.durationNano == 0 - span.context().traceCollector.pendingReferenceCount == 1 - writer.size() == 0 - - when: - def finish = span.phasedFinish() - def total = System.nanoTime() - start - - then: - finish - span.context().traceCollector.pendingReferenceCount == 1 - span.context().traceCollector.spans.isEmpty() - writer.isEmpty() - - and: "duration is recorded as negative to allow publishing" - span.durationNano < 0 - def actualDurationNano = span.durationNano & Long.MAX_VALUE - // Generous 5 seconds to execute this test - Math.abs(TimeUnit.NANOSECONDS.toSeconds(span.startTime) - TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())) < 5 - actualDurationNano > betweenDur - actualDurationNano < total - actualDurationNano % mod > 0 // Very slim chance of a false negative. - - when: "extra finishes" - finish = span.phasedFinish() - span.finish() // verify conflicting finishes are ignored - - then: "have no effect" - !finish - span.context().traceCollector.pendingReferenceCount == 1 - span.context().traceCollector.spans.isEmpty() - writer.isEmpty() - - when: - span.publish() - - then: "duration is flipped to positive" - span.durationNano > 0 - span.durationNano == actualDurationNano - span.context().traceCollector.pendingReferenceCount == 0 - writer.size() == 1 - - when: "duplicate call to publish" - span.publish() - - then: "has no effect" - span.context().traceCollector.pendingReferenceCount == 0 - writer.size() == 1 - } - - def "starting with a timestamp disables nanotime"() { - setup: - def mod = TimeUnit.MILLISECONDS.toNanos(1) - def start = System.currentTimeMillis() - def builder = tracer.buildSpan("test") - .withStartTimestamp(TimeUnit.MILLISECONDS.toMicros(System.currentTimeMillis())) - def span = builder.start() - def between = System.currentTimeMillis() - def betweenDur = System.currentTimeMillis() - between - span.finish() - def total = Math.max(1, System.currentTimeMillis() - start) - - expect: - // Generous 5 seconds to execute this test - Math.abs(TimeUnit.NANOSECONDS.toSeconds(span.startTime) - TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())) < 5 - span.durationNano >= TimeUnit.MILLISECONDS.toNanos(betweenDur) - span.durationNano <= TimeUnit.MILLISECONDS.toNanos(total) - span.durationNano % mod == 0 || span.durationNano == 1 - } - - def "stopping with a timestamp disables nanotime"() { - setup: - def mod = TimeUnit.MILLISECONDS.toNanos(1) - def builder = tracer.buildSpan("test") - def start = System.currentTimeMillis() - def span = builder.start() - def between = System.currentTimeMillis() - def betweenDur = System.currentTimeMillis() - between - span.finish(TimeUnit.MILLISECONDS.toMicros(System.currentTimeMillis() + 1)) - def total = System.currentTimeMillis() - start + 1 - - expect: - // Generous 5 seconds to execute this test - Math.abs(TimeUnit.NANOSECONDS.toSeconds(span.startTime) - TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())) < 5 - span.durationNano >= TimeUnit.MILLISECONDS.toNanos(betweenDur) - span.durationNano <= TimeUnit.MILLISECONDS.toNanos(total) - // true span duration can be <1ms if clock was about to tick over, so allow for that - (span.durationNano % mod == 0) || (span.durationNano == 1) - } - - def "stopping with a timestamp before start time yields a min duration of 1"() { - setup: - def span = tracer.buildSpan("test").start() - - // remove tick precision part of our internal time to match previous test condition - span.finish(TimeUnit.MILLISECONDS.toMicros(TimeUnit.NANOSECONDS.toMillis(span.startTimeNano)) - 10) - - expect: - span.durationNano == 1 - } - - def "priority sampling metric set only on root span"() { - setup: - def parent = tracer.buildSpan("testParent").start() - def child1 = tracer.buildSpan("testChild1").asChildOf(parent).start() - - child1.setSamplingPriority(PrioritySampling.SAMPLER_KEEP) - child1.context().lockSamplingPriority() - parent.setSamplingPriority(PrioritySampling.SAMPLER_DROP) - child1.finish() - def child2 = tracer.buildSpan("testChild2").asChildOf(parent).start() - child2.finish() - parent.finish() - - expect: - parent.context().samplingPriority == PrioritySampling.SAMPLER_KEEP - parent.getSamplingPriority() == PrioritySampling.SAMPLER_KEEP - parent.hasSamplingPriority() - child1.getSamplingPriority() == parent.getSamplingPriority() - child2.getSamplingPriority() == parent.getSamplingPriority() - !child1.hasSamplingPriority() - !child2.hasSamplingPriority() - } - - def "origin set only on root span"() { - setup: - def parent = tracer.buildSpan("testParent").asChildOf(extractedContext).start().context() - def child = tracer.buildSpan("testChild1").asChildOf(parent).start().context() - - expect: - parent.origin == "some-origin" - parent.@origin == "some-origin" // Access field directly instead of getter. - child.origin == "some-origin" - child.@origin == null // Access field directly instead of getter. - - where: - extractedContext | _ - new TagContext("some-origin", TagMap.fromMap([:])) | _ - new ExtractedContext(DDTraceId.ONE, 2, PrioritySampling.SAMPLER_DROP, "some-origin", propagationTagsFactory.empty(), DATADOG) | _ - } - - def "isRootSpan() in and not in the context of distributed tracing"() { - setup: - def root = tracer.buildSpan("root").asChildOf((AgentSpanContext) extractedContext).start() - def child = tracer.buildSpan("child").asChildOf(root).start() - - expect: - root.isRootSpan() == isTraceRootSpan - !child.isRootSpan() - - cleanup: - child.finish() - root.finish() - - where: - extractedContext | isTraceRootSpan - null | true - new ExtractedContext(DDTraceId.from(123), 456, PrioritySampling.SAMPLER_KEEP, "789", propagationTagsFactory.empty(), DATADOG) | false - } - - def "getApplicationRootSpan() in and not in the context of distributed tracing"() { - setup: - def root = tracer.buildSpan("root").asChildOf((AgentSpanContext) extractedContext).start() - def child = tracer.buildSpan("child").asChildOf(root).start() - - expect: - root.localRootSpan == root - child.localRootSpan == root - // Checking for backward compatibility method names - root.rootSpan == root - child.rootSpan == root - - cleanup: - child.finish() - root.finish() - - where: - extractedContext | isTraceRootSpan - null | true - new ExtractedContext(DDTraceId.from(123), 456, PrioritySampling.SAMPLER_KEEP, "789", propagationTagsFactory.empty(), DATADOG) | false - } - - def 'publishing of root span closes the request context data'() { - setup: - def reqContextData = Mock(Closeable) - def context = new TagContext().withRequestContextDataAppSec(reqContextData) - def root = tracer.buildSpan("root").asChildOf(context).start() - def child = tracer.buildSpan("child").asChildOf(root).start() - - expect: - root.requestContext.getData(RequestContextSlot.APPSEC).is(reqContextData) - child.requestContext.getData(RequestContextSlot.APPSEC).is(reqContextData) - - when: - child.finish() - - then: - 0 * reqContextData.close() - - when: - root.finish() - - then: - 1 * reqContextData.close() - } - - def "infer top level from parent service name"() { - setup: - def propagationTagsFactory = tracer.getPropagationTagsFactory() - when: - DDSpanContext context = - new DDSpanContext( - DDTraceId.ONE, - 1, - DDSpanId.ZERO, - parentServiceName, - "fakeService", - "fakeOperation", - "fakeResource", - PrioritySampling.UNSET, - null, - Collections. emptyMap(), - false, - "fakeType", - 0, - tracer.traceCollectorFactory.create(DDTraceId.ONE), - null, - null, - NoopPathwayContext.INSTANCE, - false, - propagationTagsFactory.empty()) - then: - context.isTopLevel() == expectTopLevel - - where: - parentServiceName | expectTopLevel - "foo" | true - UTF8BytesString.create("foo") | true - "fakeService" | false - UTF8BytesString.create("fakeService") | false - "" | true - null | true - } - - def "broken pipe exception does not create error span"() { - when: - def span = tracer.buildSpan("root").start() - span.addThrowable(new IOException("Broken pipe")) - then: - !span.isError() - span.getTag(DDTags.ERROR_STACK) == null - span.getTag(DDTags.ERROR_MSG) == "Broken pipe" - } - - def "wrapped broken pipe exception does not create error span"() { - when: - def span = tracer.buildSpan("root").start() - span.addThrowable(new RuntimeException(new IOException("Broken pipe"))) - then: - !span.isError() - span.getTag(DDTags.ERROR_STACK) == null - span.getTag(DDTags.ERROR_MSG) == "java.io.IOException: Broken pipe" - } - - def "null exception safe to add"() { - when: - def span = tracer.buildSpan("root").start() - span.addThrowable(null) - then: - !span.isError() - span.getTag(DDTags.ERROR_STACK) == null - } - - def "set single span sampling tags"() { - setup: - def span = tracer.buildSpan("testSpan").start() as DDSpan - - expect: - span.samplingPriority() == UNSET - - when: - span.setSpanSamplingPriority(rate, limit) - - then: - span.getTag(SPAN_SAMPLING_MECHANISM_TAG) == SPAN_SAMPLING_RATE - span.getTag(SPAN_SAMPLING_RULE_RATE_TAG) == rate - span.getTag(SPAN_SAMPLING_MAX_PER_SECOND_TAG) == (limit == Integer.MAX_VALUE ? null : limit) - // single span sampling should not change the trace sampling priority - span.samplingPriority() == UNSET - - where: - rate | limit - 1.0 | 10 - 0.5 | 100 - 0.25 | Integer.MAX_VALUE - } - - def "error priorities should be respected"() { - setup: - def span = tracer.buildSpan("testSpan").start() as DDSpan - - expect: - !span.isError() - - when: - span.setError(true) - then: - span.isError() - - when: - span.setError(false) - then: - !span.isError() - - when: - span.setError(true, ErrorPriorities.HTTP_SERVER_DECORATOR) - then: - !span.isError() - - when: - span.setError(true, ErrorPriorities.MANUAL_INSTRUMENTATION) - then: - span.isError() - - when: - span.setError(true, Byte.MAX_VALUE) - then: - span.isError() - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/KnuthSamplingRateTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/KnuthSamplingRateTest.groovy deleted file mode 100644 index 74cad1573f7..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/KnuthSamplingRateTest.groovy +++ /dev/null @@ -1,234 +0,0 @@ -package datadog.trace.core - -import datadog.trace.common.sampling.PrioritySampler -import datadog.trace.common.sampling.RateByServiceTraceSampler -import datadog.trace.common.sampling.Sampler -import datadog.trace.common.writer.ListWriter -import datadog.trace.common.writer.ddagent.DDAgentApi -import datadog.trace.core.propagation.PropagationTags -import datadog.trace.core.test.DDCoreSpecification - -import static datadog.trace.api.config.TracerConfig.TRACE_RATE_LIMIT -import static datadog.trace.api.config.TracerConfig.TRACE_SAMPLE_RATE -import static datadog.trace.api.config.TracerConfig.TRACE_SAMPLING_RULES -import static datadog.trace.api.config.TracerConfig.TRACE_SAMPLING_SERVICE_RULES -import static datadog.trace.api.sampling.PrioritySampling.SAMPLER_KEEP - -class KnuthSamplingRateTest extends DDCoreSpecification { - static serializer = DDAgentApi.RESPONSE_ADAPTER - - def "updateKnuthSamplingRate formats rate correctly"() { - setup: - def pTags = PropagationTags.factory().empty() - - when: - pTags.updateKnuthSamplingRate(rate) - def tagMap = pTags.createTagMap() - - then: - tagMap.get('_dd.p.ksr') == expected - - where: - rate | expected - 1.0d | "1" - 0.5d | "0.5" - 0.1d | "0.1" - 0.0d | "0" - 0.765432d | "0.765432" - 0.7654321d | "0.765432" - 0.123456d | "0.123456" - 0.100000d | "0.1" - 0.250d | "0.25" - 0.05d | "0.05" - // 6 decimal places: round(0.0123456789 * 1e6) = round(12345.6789) = 12346 - 0.0123456789d | "0.012346" - 0.001d | "0.001" - 0.00500d | "0.005" - // 6 decimal places: round(0.00123456789 * 1e6) = round(1234.56789) = 1235 - 0.00123456789d | "0.001235" - 0.0001d | "0.0001" - 0.000500d | "0.0005" - // 6 decimal places: round(0.000123456789 * 1e6) = round(123.456789) = 123 - 0.000123456789d | "0.000123" - // rounding boundary: round(0.9999995 * 1e6) = round(999999.5) = 1000000 >= 1e6 -> "1" - 0.9999995d | "1" - // values in (0, 1e-4): fixed 6 decimal places, no scientific notation - 0.00001d | "0.00001" - 0.000050d | "0.00005" - // round(1.23456789e-5 * 1e6) = round(12.3456789) = 12 - 1.23456789e-5d | "0.000012" - // below 6-decimal-place precision: round to 0 - 1e-7d | "0" - 5.5e-10d | "0" - // system-tests Test_Knuth_Sample_Rate boundary cases - 0.000001d | "0.000001" // six_decimal_precision_boundary - 0.00000051d | "0.000001" // rounds_up_to_one_millionth - } - - def "agent rate sampler sets ksr propagated tag"() { - setup: - def serviceSampler = new RateByServiceTraceSampler() - def tracer = tracerBuilder().writer(new ListWriter()).build() - String response = '{"rate_by_service": {"service:,env:":' + rate + '}}' - serviceSampler.onResponse("traces", serializer.fromJson(response)) - - when: - DDSpan span = tracer.buildSpan("fakeOperation") - .withServiceName("spock") - .withTag("env", "test") - .ignoreActiveSpan().start() - serviceSampler.setSamplingPriority(span) - - def propagationMap = span.context.propagationTags.createTagMap() - def ksr = propagationMap.get('_dd.p.ksr') - - then: - ksr == expectedKsr - - cleanup: - tracer.close() - - where: - rate | expectedKsr - 1.0 | "1" - 0.5 | "0.5" - 0.0 | "0" - } - - def "rule-based sampler sets ksr propagated tag when rule matches"() { - setup: - Properties properties = new Properties() - properties.setProperty(TRACE_SAMPLING_RULES, jsonRules) - properties.setProperty(TRACE_RATE_LIMIT, "50") - def tracer = tracerBuilder().writer(new ListWriter()).build() - - when: - Sampler sampler = Sampler.Builder.forConfig(properties) - DDSpan span = tracer.buildSpan("operation") - .withServiceName("service") - .withTag("env", "bar") - .ignoreActiveSpan().start() - ((PrioritySampler) sampler).setSamplingPriority(span) - - def propagationMap = span.context.propagationTags.createTagMap() - def ksr = propagationMap.get('_dd.p.ksr') - - then: - ksr == expectedKsr - - cleanup: - tracer.close() - - where: - jsonRules | expectedKsr - // Matching rule with rate 1 -> ksr is "1" - '[{"service": "service", "sample_rate": 1}]' | "1" - // Matching rule with rate 0.5 -> ksr is "0.5" - '[{"service": "service", "sample_rate": 0.5}]' | "0.5" - // Matching rule with rate 0 -> ksr is "0" (drop, but ksr still set) - '[{"service": "service", "sample_rate": 0}]' | "0" - } - - def "rule-based sampler fallback to agent sampler sets ksr"() { - setup: - Properties properties = new Properties() - // Rule that does NOT match "service" - properties.setProperty(TRACE_SAMPLING_RULES, '[{"service": "nomatch", "sample_rate": 0.5}]') - properties.setProperty(TRACE_RATE_LIMIT, "50") - def tracer = tracerBuilder().writer(new ListWriter()).build() - - when: - Sampler sampler = Sampler.Builder.forConfig(properties) - DDSpan span = tracer.buildSpan("operation") - .withServiceName("service") - .withTag("env", "bar") - .ignoreActiveSpan().start() - ((PrioritySampler) sampler).setSamplingPriority(span) - - def propagationMap = span.context.propagationTags.createTagMap() - def ksr = propagationMap.get('_dd.p.ksr') - - then: - // When falling back to agent sampler, ksr should still be set (agent rate = 1.0 by default) - ksr == "1" - span.getSamplingPriority() == SAMPLER_KEEP - - cleanup: - tracer.close() - } - - def "service rule sampler sets ksr propagated tag"() { - setup: - Properties properties = new Properties() - properties.setProperty(TRACE_SAMPLING_SERVICE_RULES, "service:0.75") - properties.setProperty(TRACE_RATE_LIMIT, "50") - def tracer = tracerBuilder().writer(new ListWriter()).build() - - when: - Sampler sampler = Sampler.Builder.forConfig(properties) - DDSpan span = tracer.buildSpan("operation") - .withServiceName("service") - .withTag("env", "bar") - .ignoreActiveSpan().start() - ((PrioritySampler) sampler).setSamplingPriority(span) - - def propagationMap = span.context.propagationTags.createTagMap() - def ksr = propagationMap.get('_dd.p.ksr') - - then: - ksr == "0.75" - - cleanup: - tracer.close() - } - - def "default rate sampler sets ksr propagated tag"() { - setup: - Properties properties = new Properties() - properties.setProperty(TRACE_SAMPLE_RATE, "0.25") - properties.setProperty(TRACE_RATE_LIMIT, "50") - def tracer = tracerBuilder().writer(new ListWriter()).build() - - when: - Sampler sampler = Sampler.Builder.forConfig(properties) - DDSpan span = tracer.buildSpan("operation") - .withServiceName("service") - .withTag("env", "bar") - .ignoreActiveSpan().start() - ((PrioritySampler) sampler).setSamplingPriority(span) - - def propagationMap = span.context.propagationTags.createTagMap() - def ksr = propagationMap.get('_dd.p.ksr') - - then: - ksr == "0.25" - - cleanup: - tracer.close() - } - - def "ksr is propagated via x-datadog-tags header"() { - setup: - def serviceSampler = new RateByServiceTraceSampler() - def tracer = tracerBuilder().writer(new ListWriter()).build() - String response = '{"rate_by_service": {"service:,env:":0.5}}' - serviceSampler.onResponse("traces", serializer.fromJson(response)) - - when: - DDSpan span = tracer.buildSpan("fakeOperation") - .withServiceName("spock") - .withTag("env", "test") - .ignoreActiveSpan().start() - serviceSampler.setSamplingPriority(span) - - def headerValue = span.context.propagationTags.headerValue( - datadog.trace.core.propagation.PropagationTags.HeaderType.DATADOG) - - then: - headerValue != null - headerValue.contains("_dd.p.ksr=0.5") - - cleanup: - tracer.close() - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/PendingTraceBufferTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/PendingTraceBufferTest.groovy deleted file mode 100644 index 62738a2ff0a..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/PendingTraceBufferTest.groovy +++ /dev/null @@ -1,629 +0,0 @@ -package datadog.trace.core - -import datadog.environment.JavaVirtualMachine -import datadog.metrics.api.Monitoring -import datadog.trace.api.Config -import datadog.trace.SamplingPriorityMetadataChecker -import datadog.trace.api.DDSpanId -import datadog.trace.api.DDTraceId -import datadog.trace.api.flare.TracerFlare -import datadog.trace.api.time.SystemTimeSource -import datadog.trace.api.datastreams.NoopPathwayContext -import datadog.trace.context.TraceScope -import datadog.trace.core.monitor.HealthMetrics -import datadog.trace.core.propagation.PropagationTags -import datadog.trace.core.scopemanager.ContinuableScopeManager -import datadog.trace.test.util.DDSpecification -import groovy.json.JsonSlurper -import spock.lang.IgnoreIf -import spock.lang.Subject -import spock.lang.Timeout -import spock.util.concurrent.PollingConditions -import java.util.concurrent.CountDownLatch -import java.util.concurrent.TimeUnit -import java.util.concurrent.atomic.AtomicInteger -import java.util.zip.ZipInputStream -import java.util.zip.ZipOutputStream - -import static datadog.trace.api.sampling.PrioritySampling.UNSET -import static datadog.trace.api.sampling.PrioritySampling.USER_KEEP -import static datadog.trace.core.PendingTraceBuffer.BUFFER_SIZE -import static java.nio.charset.StandardCharsets.UTF_8 - -@IgnoreIf(reason = """ -Oracle JDK 1.8 did not merge the fix in JDK-8058322, leading to the JVM failing to correctly -extract method parameters without args, when the code is compiled on a later JDK (targeting 8). -This can manifest when creating mocks. -""", value = { - JavaVirtualMachine.isOracleJDK8() -}) -@Timeout(5) -class PendingTraceBufferTest extends DDSpecification { - @Subject - def buffer = PendingTraceBuffer.delaying(SystemTimeSource.INSTANCE, Mock(Config), null, null) - def bufferSpy = Spy(buffer) - - def tracer = Mock(CoreTracer) - def traceConfig = Mock(CoreTracer.ConfigSnapshot) - def scopeManager = new ContinuableScopeManager(10, true) - def factory = new PendingTrace.Factory(tracer, bufferSpy, SystemTimeSource.INSTANCE, false, HealthMetrics.NO_OP) - List continuations = [] - - def setup() { - tracer.captureTraceConfig() >> traceConfig - traceConfig.getServiceMapping() >> [:] - } - - def cleanup() { - buffer.close() - buffer.worker.join(1000) - } - - def "test buffer lifecycle"() { - expect: - !buffer.worker.alive - - when: - buffer.start() - - then: - buffer.worker.alive - buffer.worker.daemon - - when: "start called again" - buffer.start() - - then: - thrown IllegalThreadStateException - buffer.worker.alive - buffer.worker.daemon - - when: - buffer.close() - buffer.worker.join(1000) - - then: - !buffer.worker.alive - } - - def "continuation buffers root"() { - setup: - def trace = factory.create(DDTraceId.ONE) - def span = newSpanOf(trace) - - expect: - !trace.rootSpanWritten - - when: - addContinuation(span) - span.finish() // This should enqueue - - then: - continuations.size() == 1 - trace.pendingReferenceCount == 1 - 1 * bufferSpy.longRunningSpansEnabled() - 1 * bufferSpy.enqueue(trace) - _ * tracer.getPartialFlushMinSpans() >> 10 - _ * tracer.getTagInterceptor() - 1 * tracer.getTimeWithNanoTicks(_) - 1 * tracer.onRootSpanPublished(span) - 0 * _ - - when: - continuations[0].cancel() - - then: - trace.pendingReferenceCount == 0 - 1 * tracer.write({ it.size() == 1 }) - 1 * tracer.writeTimer() >> Monitoring.DISABLED.newTimer("") - _ * tracer.getPartialFlushMinSpans() >> 10 - 0 * _ - } - - def "unfinished child buffers root"() { - setup: - def trace = factory.create(DDTraceId.ONE) - def parent = newSpanOf(trace) - def child = newSpanOf(parent) - - expect: - !trace.rootSpanWritten - - when: - parent.finish() // This should enqueue - - then: - trace.size() == 1 - trace.pendingReferenceCount == 1 - 1 * bufferSpy.enqueue(trace) - _ * bufferSpy.longRunningSpansEnabled() - _ * tracer.getPartialFlushMinSpans() >> 10 - _ * tracer.getTagInterceptor() - 1 * tracer.getTimeWithNanoTicks(_) - 1 * tracer.onRootSpanPublished(parent) - 0 * _ - - when: - child.finish() - - then: - trace.size() == 0 - trace.pendingReferenceCount == 0 - _ * bufferSpy.longRunningSpansEnabled() - 1 * tracer.write({ it.size() == 2 }) - 1 * tracer.writeTimer() >> Monitoring.DISABLED.newTimer("") - _ * tracer.getPartialFlushMinSpans() >> 10 - _ * tracer.getTagInterceptor() - 1 * tracer.getTimeWithNanoTicks(_) - 0 * _ - } - - def "priority sampling is always sent"() { - setup: - def parent = addContinuation(newSpanOf(factory.create(DDTraceId.ONE), USER_KEEP, 0)) - def metadataChecker = new SamplingPriorityMetadataChecker() - - when: "Fill the buffer - Only children - Priority taken from root" - - for (int i = 0; i < 11; i++) { - newSpanOf(parent).finish() - } - - then: - _ * tracer.getPartialFlushMinSpans() >> 10 - _ * tracer.getTagInterceptor() - _ * traceConfig.getServiceMapping() >> [:] - _ * tracer.getTimeWithNanoTicks(_) - 1 * tracer.writeTimer() >> Monitoring.DISABLED.newTimer("") - _ * bufferSpy.longRunningSpansEnabled() - 1 * tracer.write(_) >> { List> spans -> - spans.first().first().processTagsAndBaggage(metadataChecker) - } - 0 * _ - metadataChecker.hasSamplingPriority - } - - def "buffer full yields immediate write"() { - setup: - // Don't start the buffer thread - - when: "Fill the buffer" - for (i in 1..buffer.queue.capacity()) { - addContinuation(newSpanOf(factory.create(DDTraceId.ONE))).finish() - } - - then: - _ * tracer.captureTraceConfig() >> traceConfig - buffer.queue.size() == BUFFER_SIZE - buffer.queue.capacity() * bufferSpy.enqueue(_) - _ * bufferSpy.longRunningSpansEnabled() - _ * tracer.getPartialFlushMinSpans() >> 10 - _ * tracer.getTagInterceptor() - _ * traceConfig.getServiceMapping() >> [:] - _ * tracer.getTimeWithNanoTicks(_) - buffer.queue.capacity() * tracer.onRootSpanPublished(_) - 0 * _ - - when: - def pendingTrace = factory.create(DDTraceId.ONE) - addContinuation(newSpanOf(pendingTrace)).finish() - - then: - 1 * tracer.captureTraceConfig() >> traceConfig - 1 * bufferSpy.enqueue(_) - 1 * tracer.writeTimer() >> Monitoring.DISABLED.newTimer("") - _ * bufferSpy.longRunningSpansEnabled() - 1 * tracer.write({ it.size() == 1 }) - _ * tracer.getPartialFlushMinSpans() >> 10 - _ * tracer.getTagInterceptor() - _ * traceConfig.getServiceMapping() >> [:] - 2 * tracer.getTimeWithNanoTicks(_) - 1 * tracer.onRootSpanPublished(_) - 0 * _ - pendingTrace.isEnqueued == 0 - } - - def "long-running trace: buffer full does not trigger write"() { - setup: - // Don't start the buffer thread - - when: "Fill the buffer" - for (i in 1..buffer.queue.capacity()) { - addContinuation(newSpanOf(factory.create(DDTraceId.ONE))).finish() - } - - then: - _ * tracer.captureTraceConfig() >> traceConfig - buffer.queue.size() == BUFFER_SIZE - buffer.queue.capacity() * bufferSpy.enqueue(_) - _ * bufferSpy.longRunningSpansEnabled() - _ * tracer.getPartialFlushMinSpans() >> 10 - _ * tracer.getTagInterceptor() - _ * traceConfig.getServiceMapping() >> [:] - _ * tracer.getTimeWithNanoTicks(_) - buffer.queue.capacity() * tracer.onRootSpanPublished(_) - 0 * _ - - when: - def pendingTrace = factory.create(DDTraceId.ONE) - pendingTrace.longRunningTrackedState = LongRunningTracesTracker.TO_TRACK - addContinuation(newSpanOf(pendingTrace)).finish() - - then: - 1 * tracer.captureTraceConfig() >> traceConfig - 1 * bufferSpy.enqueue(_) - _ * bufferSpy.longRunningSpansEnabled() - 0 * tracer.writeTimer() >> Monitoring.DISABLED.newTimer("") - _ * bufferSpy.longRunningSpansEnabled() - 0 * tracer.write({ it.size() == 1 }) - _ * tracer.getPartialFlushMinSpans() >> 10 - _ * tracer.getTagInterceptor() - _ * traceConfig.getServiceMapping() >> [:] - _ * tracer.getTimeWithNanoTicks(_) - 1 * tracer.onRootSpanPublished(_) - 0 * _ - - pendingTrace.isEnqueued == 0 - } - - def "continuation allows adding after root finished"() { - setup: - def trace = factory.create(DDTraceId.ONE) - def parent = addContinuation(newSpanOf(trace)) - TraceScope.Continuation continuation = continuations[0] - - expect: - continuations.size() == 1 - - when: - parent.finish() // This should enqueue - - then: - trace.size() == 1 - trace.pendingReferenceCount == 1 - !trace.rootSpanWritten - _ * bufferSpy.longRunningSpansEnabled() - 1 * bufferSpy.enqueue(trace) - _ * tracer.getPartialFlushMinSpans() >> 10 - _ * tracer.getTagInterceptor() - 1 * tracer.getTimeWithNanoTicks(_) - 1 * tracer.onRootSpanPublished(parent) - 0 * _ - - when: - def child = newSpanOf(parent) - child.finish() - - then: - trace.size() == 2 - trace.pendingReferenceCount == 1 - !trace.rootSpanWritten - - when: - // Don't start the buffer thread here. When the continuation is cancelled, - // pendingReferenceCount drops to 0 with rootSpanWritten still false, so - // write() is called synchronously on this thread. Starting the buffer - // would introduce a race where the worker thread could process the - // enqueued trace before continuation.cancel(), causing extra mock - // invocations (TooManyInvocationsError). - continuation.cancel() - - then: - trace.size() == 0 - trace.pendingReferenceCount == 0 - trace.rootSpanWritten - 1 * tracer.writeTimer() >> Monitoring.DISABLED.newTimer("") - 1 * tracer.write({ it.size() == 2 }) - _ * tracer.getPartialFlushMinSpans() >> 10 - _ * tracer.getTagInterceptor() - 0 * _ - } - - def "late arrival span requeues pending trace"() { - setup: - buffer.start() - def parentLatch = new CountDownLatch(1) - def childLatch = new CountDownLatch(1) - - def trace = factory.create(DDTraceId.ONE) - def parent = newSpanOf(trace) - - when: - parent.finish() // This should enqueue - parentLatch.await() - - then: - trace.size() == 0 - trace.pendingReferenceCount == 0 - trace.rootSpanWritten - _ * bufferSpy.longRunningSpansEnabled() - 1 * tracer.writeTimer() >> Monitoring.DISABLED.newTimer("") - 1 * tracer.write({ it.size() == 1 }) >> { - parentLatch.countDown() - } - _ * tracer.getPartialFlushMinSpans() >> 10 - _ * tracer.getTagInterceptor() - 1 * tracer.getTimeWithNanoTicks(_) - 1 * tracer.onRootSpanPublished(parent) - 0 * _ - - when: - def child = newSpanOf(parent) - child.finish() - childLatch.await() - - then: - trace.size() == 0 - trace.pendingReferenceCount == 0 - trace.rootSpanWritten - 1 * bufferSpy.enqueue(trace) - _ * bufferSpy.longRunningSpansEnabled() - _ * tracer.getPartialFlushMinSpans() >> 10 - _ * tracer.getTagInterceptor() - 1 * tracer.writeTimer() >> Monitoring.DISABLED.newTimer("") - 1 * tracer.write({ it.size() == 1 }) >> { - childLatch.countDown() - } - _ * traceConfig.getServiceMapping() >> [:] - _ * tracer.getTimeWithNanoTicks(_) - _ * bufferSpy.longRunningSpansEnabled() - 0 * _ - } - - def "flush clears the buffer"() { - setup: - buffer.start() - def counter = new AtomicInteger(0) - // Create a fake element that newer gets written - def element = new PendingTraceBuffer.Element() { - @Override - long oldestFinishedTime() { - return TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis()) - } - - @Override - boolean lastReferencedNanosAgo(long nanos) { - return false - } - - @Override - void write() { - counter.incrementAndGet() - } - - @Override - DDSpan getRootSpan() { - return null - } - - @Override - boolean setEnqueued(boolean enqueued) { - return true - } - @Override - boolean writeOnBufferFull() { - return true - } - } - - when: - buffer.enqueue(element) - buffer.enqueue(element) - buffer.enqueue(element) - - then: - counter.get() == 0 - - when: - buffer.flush() - - then: - counter.get() == 3 - } - - def "the same pending trace is not enqueued multiple times"() { - setup: - // Don't start the buffer thread - - when: "finish the root span" - def pendingTrace = factory.create(DDTraceId.ONE) - def span = newSpanOf(pendingTrace) - span.finish() - - then: - 1 * tracer.captureTraceConfig() >> traceConfig - pendingTrace.rootSpanWritten - pendingTrace.isEnqueued == 0 - buffer.queue.size() == 0 - _ * bufferSpy.longRunningSpansEnabled() - 1 * tracer.writeTimer() >> Monitoring.DISABLED.newTimer("") - 1 * tracer.write({ it.size() == 1 }) - 1 * tracer.getPartialFlushMinSpans() >> 10000 - _ * tracer.getTagInterceptor() - 1 * traceConfig.getServiceMapping() >> [:] - 2 * tracer.getTimeWithNanoTicks(_) - 1 * tracer.onRootSpanPublished(_) - 0 * _ - - when: "fail to fill the buffer" - for (i in 1..buffer.queue.capacity()) { - addContinuation(newSpanOf(span)).finish() - } - - then: - pendingTrace.isEnqueued == 1 - buffer.queue.size() == 1 - buffer.queue.capacity() * bufferSpy.enqueue(_) - _ * bufferSpy.longRunningSpansEnabled() - _ * tracer.getPartialFlushMinSpans() >> 10000 - _ * tracer.getTagInterceptor() - _ * traceConfig.getServiceMapping() >> [:] - _ * tracer.getTimeWithNanoTicks(_) - 0 * _ - - when: "process the buffer" - buffer.start() - - then: - new PollingConditions(timeout: 3, initialDelay: 0, delay: 0.5, factor: 1).eventually { - assert pendingTrace.isEnqueued == 0 - } - } - - def "testing tracer flare dump with multiple traces"() { - setup: - TracerFlare.addReporter {} // exercises default methods - def dumpReporter = Mock(PendingTraceBuffer.TracerDump) - TracerFlare.addReporter(dumpReporter) - def trace1 = factory.create(DDTraceId.ONE) - def parent1 = newSpanOf(trace1, UNSET, System.currentTimeMillis() * 1000) - def child1 = newSpanOf(parent1) - def trace2 = factory.create(DDTraceId.from(2)) - def parent2 = newSpanOf(trace2, UNSET, System.currentTimeMillis() * 2000) - def child2 = newSpanOf(parent2) - - when: "first flare dump with two traces" - parent1.finish() - parent2.finish() - buffer.start() - def entries1 = buildAndExtractZip() - - then: - 1 * dumpReporter.prepareForFlare() - 1 * dumpReporter.addReportToFlare(_) - 1 * dumpReporter.cleanupAfterFlare() - entries1.size() == 1 - def pendingTraceText1 = entries1["pending_traces.txt"] as String - pendingTraceText1.startsWith('[{"service":"fakeService","name":"fakeOperation","resource":"fakeResource","trace_id":1,"span_id":1,"parent_id":0') // Rest of dump is timestamp specific - - def parsedTraces1 = pendingTraceText1.split('\n').collect { new JsonSlurper().parseText(it) }.flatten() - parsedTraces1.size() == 2 - parsedTraces1[0]["trace_id"] == 1 //Asserting both traces exist - parsedTraces1[1]["trace_id"] == 2 - parsedTraces1[0]["start"] < parsedTraces1[1]["start"] //Asserting the dump has the oldest trace first - - // New pending traces are needed here because generating the first flare takes long enough that the - // earlier pending traces are flushed (within 500ms). - when: "second flare dump with new pending traces" - // Finish the first set of traces - child1.finish() - child2.finish() - // Create new pending traces - def trace3 = factory.create(DDTraceId.from(3)) - def parent3 = newSpanOf(trace3, UNSET, System.currentTimeMillis() * 3000) - def child3 = newSpanOf(parent3) - def trace4 = factory.create(DDTraceId.from(4)) - def parent4 = newSpanOf(trace4, UNSET, System.currentTimeMillis() * 4000) - def child4 = newSpanOf(parent4) - parent3.finish() - parent4.finish() - def entries2 = buildAndExtractZip() - - then: - 1 * dumpReporter.prepareForFlare() - 1 * dumpReporter.addReportToFlare(_) - 1 * dumpReporter.cleanupAfterFlare() - entries2.size() == 1 - def pendingTraceText2 = entries2["pending_traces.txt"] as String - def parsedTraces2 = pendingTraceText2.split('\n').collect { new JsonSlurper().parseText(it) }.flatten() - parsedTraces2.size() == 2 - - then: - child3.finish() - child4.finish() - - then: - trace1.size() == 0 - trace1.pendingReferenceCount == 0 - trace2.size() == 0 - trace2.pendingReferenceCount == 0 - trace3.size() == 0 - trace3.pendingReferenceCount == 0 - trace4.size() == 0 - trace4.pendingReferenceCount == 0 - } - - - def addContinuation(DDSpan span) { - def scope = scopeManager.activateSpan(span) - continuations << scopeManager.captureSpan(span) - scope.close() - return span - } - - static DDSpan newSpanOf(PendingTrace trace) { - return newSpanOf(trace, UNSET, 0) - } - - static DDSpan newSpanOf(PendingTrace trace, int samplingPriority, long timestampMicro) { - def context = new DDSpanContext( - trace.traceId, - 1, - DDSpanId.ZERO, - null, - "fakeService", - "fakeOperation", - "fakeResource", - samplingPriority, - null, - Collections.emptyMap(), - false, - "fakeType", - 0, - trace, - null, - null, - NoopPathwayContext.INSTANCE, - false, - PropagationTags.factory().empty()) - return DDSpan.create("test", timestampMicro, context, null) - } - - static DDSpan newSpanOf(DDSpan parent) { - def traceCollector = parent.context().traceCollector - def context = new DDSpanContext( - traceCollector.traceId, - 2, - parent.context().spanId, - null, - "fakeService", - "fakeOperation", - "fakeResource", - UNSET, - null, - Collections.emptyMap(), - false, - "fakeType", - 0, - traceCollector, - null, - null, - NoopPathwayContext.INSTANCE, - false, - PropagationTags.factory().empty()) - return DDSpan.create("test", 0, context, null) - } - - def buildAndExtractZip() { - TracerFlare.prepareForFlare() - def out = new ByteArrayOutputStream() - try (ZipOutputStream zip = new ZipOutputStream(out)) { - TracerFlare.addReportsToFlare(zip) - } finally { - TracerFlare.cleanupAfterFlare() - } - - def entries = [:] - - def zip = new ZipInputStream(new ByteArrayInputStream(out.toByteArray())) - def entry - while (entry = zip.nextEntry) { - def bytes = new ByteArrayOutputStream() - bytes << zip - entries.put(entry.name, entry.name.endsWith(".bin") - ? bytes.toByteArray() : new String(bytes.toByteArray(), UTF_8)) - } - - return entries - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/PendingTraceStrictWriteTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/PendingTraceStrictWriteTest.groovy deleted file mode 100644 index 0a51d6f2ead..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/PendingTraceStrictWriteTest.groovy +++ /dev/null @@ -1,65 +0,0 @@ -package datadog.trace.core - -class PendingTraceStrictWriteTest extends PendingTraceTestBase { - - def "trace is not reported until unfinished continuation is closed"() { - when: - def scope = tracer.activateSpan(rootSpan) - def continuation = tracer.captureActiveSpan() - scope.close() - rootSpan.finish() - - then: - traceCollector.pendingReferenceCount == 1 - traceCollector.spans.asList() == [rootSpan] - writer == [] - - when: "root span buffer delay expires" - writer.waitForTracesMax(1, 1) - - then: - traceCollector.pendingReferenceCount == 1 - traceCollector.spans.asList() == [rootSpan] - writer == [] - writer.traceCount.get() == 0 - - when: "continuation is closed" - continuation.cancel() - - then: - traceCollector.pendingReferenceCount == 0 - traceCollector.spans.isEmpty() - writer == [[rootSpan]] - writer.traceCount.get() == 1 - } - - def "negative reference count throws an exception"() { - when: - def scope = tracer.activateSpan(rootSpan) - def continuation = tracer.captureActiveSpan() - scope.close() - rootSpan.finish() - - then: - traceCollector.pendingReferenceCount == 1 - traceCollector.spans.asList() == [rootSpan] - writer == [] - - when: "continuation is finished the first time" - continuation.cancel() - - then: - traceCollector.pendingReferenceCount == 0 - traceCollector.spans.isEmpty() - writer == [[rootSpan]] - writer.traceCount.get() == 1 - - when: "continuation is finished the second time" - // Yes this should be guarded by the used flag in the continuation, - // so remove it anyway to trigger the exception - traceCollector.removeContinuation(continuation) - - then: - thrown IllegalStateException - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/PendingTraceTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/PendingTraceTest.groovy deleted file mode 100644 index 20ccaaeb680..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/PendingTraceTest.groovy +++ /dev/null @@ -1,177 +0,0 @@ -package datadog.trace.core - -import datadog.environment.JavaVirtualMachine -import datadog.trace.api.DDTraceId -import datadog.trace.api.sampling.PrioritySampling -import datadog.trace.api.time.TimeSource -import datadog.trace.api.datastreams.NoopPathwayContext -import datadog.trace.core.monitor.HealthMetrics -import datadog.trace.core.propagation.PropagationTags -import spock.lang.IgnoreIf -import spock.lang.Timeout - -import java.util.concurrent.TimeUnit - -@IgnoreIf(reason = """ -Oracle JDK 1.8 did not merge the fix in JDK-8058322, leading to the JVM failing to correctly -extract method parameters without args, when the code is compiled on a later JDK (targeting 8). -This can manifest when creating mocks. -""", value = { - JavaVirtualMachine.isOracleJDK8() -}) -class PendingTraceTest extends PendingTraceTestBase { - - @Override - protected boolean useStrictTraceWrites() { - // This tests the behavior of the relaxed pending trace implementation - return false - } - protected DDSpan createSimpleSpan(PendingTrace trace){ - return createSimpleSpanWithID(trace,1) - } - - protected DDSpan createSimpleSpanWithID(PendingTrace trace, long id){ - return new DDSpan("test", 0L, new DDSpanContext( - DDTraceId.from(1), - id, - 0, - null, - "", - "", - "", - PrioritySampling.UNSET, - "", - [:], - false, - "", - 0, - trace, - null, - null, - NoopPathwayContext.INSTANCE, - false, - PropagationTags.factory().empty()), - null) - } - - @Timeout(value = 60, unit = TimeUnit.SECONDS) - def "trace is still reported when unfinished continuation discarded"() { - when: - def scope = tracer.activateSpan(rootSpan) - tracer.captureActiveSpan() - scope.close() - rootSpan.finish() - - then: - traceCollector.pendingReferenceCount == 1 - traceCollector.spans.asList() == [rootSpan] - writer == [] - - when: "root span buffer delay expires" - writer.waitForTraces(1) - - then: - traceCollector.pendingReferenceCount == 1 - traceCollector.spans.isEmpty() - writer == [[rootSpan]] - writer.traceCount.get() == 1 - } - def "verify healthmetrics called"() { - setup: - def tracer = Stub(CoreTracer) - def traceConfig = Stub(CoreTracer.ConfigSnapshot) - def buffer = Stub(PendingTraceBuffer) - def healthMetrics = Mock(HealthMetrics) - tracer.captureTraceConfig() >> traceConfig - traceConfig.getServiceMapping() >> [:] - PendingTrace trace = new PendingTrace(tracer, DDTraceId.from(0), buffer, Mock(TimeSource), null, false, healthMetrics) - - when: - rootSpan = createSimpleSpan(trace) - trace.registerSpan(rootSpan) - - then: - 1 * healthMetrics.onCreateSpan() - - when: - rootSpan.finish() - - then: - 1 * healthMetrics.onCreateTrace() - } - - def "write when writeRunningSpans is disabled: only completed spans are written"() { - setup: - def tracer = Stub(CoreTracer) - def traceConfig = Stub(CoreTracer.ConfigSnapshot) - def buffer = Stub(PendingTraceBuffer) - def healthMetrics = Stub(HealthMetrics) - tracer.captureTraceConfig() >> traceConfig - traceConfig.getServiceMapping() >> [:] - PendingTrace trace = new PendingTrace(tracer, DDTraceId.from(0), buffer, Mock(TimeSource), null, false, healthMetrics) - buffer.longRunningSpansEnabled() >> true - - def span1 = createSimpleSpanWithID(trace,39) - span1.durationNano = 31 - span1.samplingPriority = PrioritySampling.USER_KEEP - trace.registerSpan(span1) - - def unfinishedSpan = createSimpleSpanWithID(trace, 191) - trace.registerSpan(unfinishedSpan) - - def span2 = createSimpleSpanWithID(trace, 9999) - span2.durationNano = 9191 - trace.registerSpan(span2) - def traceToWrite = new ArrayList<>(0) - - when: - def completedSpans = trace.enqueueSpansToWrite(traceToWrite, false) - - then: - completedSpans == 2 - traceToWrite.size() == 2 - traceToWrite.containsAll([span1, span2]) - trace.spans.size() == 1 - trace.spans.pop() == unfinishedSpan - } - - def "write when writeRunningSpans is enabled: complete and running spans are written"() { - setup: - def tracer = Stub(CoreTracer) - def traceConfig = Stub(CoreTracer.ConfigSnapshot) - def buffer = Stub(PendingTraceBuffer) - def healthMetrics = Stub(HealthMetrics) - tracer.captureTraceConfig() >> traceConfig - traceConfig.getServiceMapping() >> [:] - PendingTrace trace = new PendingTrace(tracer, DDTraceId.from(0), buffer, Mock(TimeSource), null, false, healthMetrics) - buffer.longRunningSpansEnabled() >> true - - def span1 = createSimpleSpanWithID(trace,39) - span1.durationNano = 31 - span1.samplingPriority = PrioritySampling.USER_KEEP - trace.registerSpan(span1) - - def unfinishedSpan = createSimpleSpanWithID(trace, 191) - trace.registerSpan(unfinishedSpan) - - def span2 = createSimpleSpanWithID(trace, 9999) - span2.setServiceName("9191") - span2.durationNano = 9191 - trace.registerSpan(span2) - - def unfinishedSpan2 = createSimpleSpanWithID(trace, 77771) - trace.registerSpan(unfinishedSpan2) - - def traceToWrite = new ArrayList<>(0) - - when: - def completedSpans = trace.enqueueSpansToWrite(traceToWrite, true) - - then: - completedSpans == 2 - traceToWrite.size() == 4 - traceToWrite.containsAll([span1, span2, unfinishedSpan, unfinishedSpan2]) - trace.spans.size() == 2 - trace.spans.containsAll([unfinishedSpan, unfinishedSpan2]) - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/PendingTraceTestBase.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/PendingTraceTestBase.groovy deleted file mode 100644 index d67efee76b8..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/PendingTraceTestBase.groovy +++ /dev/null @@ -1,267 +0,0 @@ -package datadog.trace.core - -import ch.qos.logback.classic.Level -import ch.qos.logback.classic.Logger -import datadog.trace.common.writer.ListWriter -import datadog.trace.core.test.DDCoreSpecification -import org.slf4j.LoggerFactory - -import java.util.concurrent.CountDownLatch -import java.util.concurrent.TimeUnit - -import static datadog.trace.api.config.TracerConfig.PARTIAL_FLUSH_MIN_SPANS - -abstract class PendingTraceTestBase extends DDCoreSpecification { - - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - - DDSpan rootSpan = tracer.buildSpan("fakeOperation").start() - PendingTrace traceCollector = rootSpan.context().traceCollector - - def setup() { - assert traceCollector.size() == 0 - assert traceCollector.pendingReferenceCount == 1 - assert traceCollector.rootSpanWritten == false - } - - def cleanup() { - tracer?.close() - } - - def "single span gets added to trace and written when finished"() { - when: - rootSpan.finish() - writer.waitForTraces(1) - - then: - traceCollector.spans.isEmpty() - writer == [[rootSpan]] - writer.traceCount.get() == 1 - } - - def "child finishes before parent"() { - when: - def child = tracer.buildSpan("child").asChildOf(rootSpan).start() - - then: - traceCollector.pendingReferenceCount == 2 - - when: - child.finish() - - then: - traceCollector.pendingReferenceCount == 1 - traceCollector.spans.asList() == [child] - writer == [] - - when: - rootSpan.finish() - writer.waitForTraces(1) - - then: - traceCollector.pendingReferenceCount == 0 - traceCollector.spans.isEmpty() - writer == [[rootSpan, child]] - writer.traceCount.get() == 1 - } - - def "parent finishes before child which holds up trace"() { - when: - def child = tracer.buildSpan("child").asChildOf(rootSpan).start() - - then: - traceCollector.pendingReferenceCount == 2 - - when: - rootSpan.finish() - - then: - traceCollector.pendingReferenceCount == 1 - traceCollector.spans.asList() == [rootSpan] - writer == [] - - when: - child.finish() - writer.waitForTraces(1) - - then: - traceCollector.pendingReferenceCount == 0 - traceCollector.spans.isEmpty() - writer == [[child, rootSpan]] - writer.traceCount.get() == 1 - } - - def "child spans created after trace written reported separately"() { - setup: - rootSpan.finish() - // this shouldn't happen, but it's possible users of the api - // may incorrectly add spans after the trace is reported. - // in those cases we should still decrement the pending trace count - DDSpan childSpan = tracer.buildSpan("child").asChildOf(rootSpan).start() - childSpan.finish() - writer.waitForTraces(2) - - expect: - traceCollector.pendingReferenceCount == 0 - traceCollector.spans.isEmpty() - writer == [[rootSpan], [childSpan]] - } - - def "test getCurrentTimeNano"() { - expect: - // Generous 5 seconds to execute this test - Math.abs(TimeUnit.NANOSECONDS.toSeconds(traceCollector.currentTimeNano) - TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())) < 5 - } - - def "partial flush"() { - when: - injectSysConfig(PARTIAL_FLUSH_MIN_SPANS, "2") - def quickTracer = tracerBuilder().writer(writer).build() - def rootSpan = quickTracer.buildSpan("root").start() - def traceCollector = rootSpan.context().traceCollector - def child1 = quickTracer.buildSpan("child1").asChildOf(rootSpan).start() - def child2 = quickTracer.buildSpan("child2").asChildOf(rootSpan).start() - - then: - traceCollector.pendingReferenceCount == 3 - - when: - child2.finish() - - then: - traceCollector.pendingReferenceCount == 2 - traceCollector.spans.asList() == [child2] - writer == [] - writer.traceCount.get() == 0 - - when: - child1.finish() - writer.waitForTraces(1) - - then: - traceCollector.pendingReferenceCount == 1 - traceCollector.spans.asList() == [] - writer == [[child1, child2]] - writer.traceCount.get() == 1 - - when: - rootSpan.finish() - writer.waitForTraces(2) - - then: - traceCollector.pendingReferenceCount == 0 - traceCollector.spans.isEmpty() - writer == [[child1, child2], [rootSpan]] - writer.traceCount.get() == 2 - - cleanup: - quickTracer.close() - } - - def "partial flush with root span closed last"() { - when: - injectSysConfig(PARTIAL_FLUSH_MIN_SPANS, "2") - def quickTracer = tracerBuilder().writer(writer).build() - def rootSpan = quickTracer.buildSpan("root").start() - def trace = rootSpan.context().traceCollector - def child1 = quickTracer.buildSpan("child1").asChildOf(rootSpan).start() - def child2 = quickTracer.buildSpan("child2").asChildOf(rootSpan).start() - - then: - trace.pendingReferenceCount == 3 - - when: - child1.finish() - - then: - trace.pendingReferenceCount == 2 - trace.spans.asList() == [child1] - writer == [] - writer.traceCount.get() == 0 - - when: - child2.finish() - writer.waitForTraces(1) - - then: - trace.pendingReferenceCount == 1 - trace.spans.isEmpty() - writer == [[child2, child1]] - writer.traceCount.get() == 1 - - when: - rootSpan.finish() - writer.waitForTraces(2) - - then: - trace.pendingReferenceCount == 0 - trace.spans.isEmpty() - writer == [[child2, child1], [rootSpan]] - writer.traceCount.get() == 2 - - cleanup: - quickTracer.close() - } - - def "partial flush concurrency test"() { - // reduce logging noise - def logger = (Logger) LoggerFactory.getLogger("datadog.trace") - def previousLevel = logger.level - logger.setLevel(Level.OFF) - - setup: - def latch = new CountDownLatch(1) - def rootSpan = tracer.buildSpan("test", "root").start() - PendingTrace traceCollector = rootSpan.context().traceCollector - def exceptions = [] - def threads = (1..threadCount).collect { - Thread.start { - try { - latch.await() - def spans = (1..spanCount).collect { - tracer.startSpan("test", "child", rootSpan.context()) - } - spans.each { - it.finish() - } - } catch (Throwable ex) { - exceptions << ex - } - } - } - - when: - // Finish root span so other spans are queued automatically - rootSpan.finish() - - then: - writer.waitForTraces(1) - - when: - latch.countDown() - threads.each { - it.join() - } - traceCollector.pendingTraceBuffer.flush() - logger.setLevel(previousLevel) - - then: - exceptions.isEmpty() - traceCollector.pendingReferenceCount == 0 - writer.sum { it.size() } == threadCount * spanCount + 1 - - cleanup: - logger.setLevel(previousLevel) - - where: - threadCount | spanCount - 1 | 1 - 2 | 1 - 1 | 2 - // Sufficiently large to fill the buffer: - 5 | 2000 - 10 | 1000 - 50 | 500 - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/TraceInterceptorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/TraceInterceptorTest.groovy deleted file mode 100644 index 723b7cab9f1..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/TraceInterceptorTest.groovy +++ /dev/null @@ -1,221 +0,0 @@ -package datadog.trace.core - -import datadog.trace.TestInterceptor -import datadog.trace.api.GlobalTracer -import datadog.trace.api.config.TracerConfig -import datadog.trace.api.interceptor.MutableSpan -import datadog.trace.api.interceptor.TraceInterceptor -import datadog.trace.common.writer.ListWriter -import datadog.trace.core.test.DDCoreSpecification -import spock.lang.Timeout - -import java.util.concurrent.CountDownLatch -import java.util.concurrent.TimeUnit -import java.util.concurrent.atomic.AtomicBoolean - -@Timeout(10) -class TraceInterceptorTest extends DDCoreSpecification { - - def writer = new ListWriter() - def tracer - - def setup() { - injectSysConfig(TracerConfig.TRACE_GIT_METADATA_ENABLED, "false") - tracer = tracerBuilder().writer(writer).build() - } - - def cleanup() { - tracer?.close() - } - - def "interceptor is registered as a service"() { - expect: - tracer.interceptors.interceptors()[0] instanceof TestInterceptor - } - - def "interceptors with the same priority replaced"() { - setup: - int priority = 999 - ((TestInterceptor) tracer.interceptors.interceptors()[0]).priority = priority - tracer.interceptors.add(new TraceInterceptor() { - @Override - Collection onTraceComplete(Collection trace) { - return [] - } - - @Override - int priority() { - return priority - } - }) - - when: - def interceptors = tracer.interceptors.interceptors() - - then: - interceptors.length == 1 - interceptors[0] instanceof TestInterceptor - } - - def "interceptors with different priority sorted"() { - setup: - def priority = score - def existingInterceptor = tracer.interceptors.interceptors()[0] - def newInterceptor = new TraceInterceptor() { - @Override - Collection onTraceComplete(Collection trace) { - return [] - } - - @Override - int priority() { - return priority - } - } - tracer.interceptors.add(newInterceptor) - - expect: - Arrays.asList(tracer.interceptors.interceptors()) == reverse ? [newInterceptor, existingInterceptor]: [existingInterceptor, newInterceptor] - - where: - score | reverse - -1 | false - 1 | true - } - - def "interceptor can discard a trace (p=#score)"() { - setup: - def called = new AtomicBoolean(false) - def latch = new CountDownLatch(1) - def priority = score - tracer.interceptors.add(new TraceInterceptor() { - @Override - Collection onTraceComplete(Collection trace) { - called.set(true) - latch.countDown() - return [] - } - - @Override - int priority() { - return priority - } - }) - tracer.buildSpan("test " + score).start().finish() - if (score == TestInterceptor.priority) { - // the interceptor didn't get added, so latch will never be released. - writer.waitForTraces(1) - } else { - latch.await(5, TimeUnit.SECONDS) - } - - when: - def interceptors = tracer.interceptors.interceptors() - - then: - interceptors.length == expectedSize - (called.get()) == (score != TestInterceptor.priority) - (writer == []) == (score != TestInterceptor.priority) - - where: - score | expectedSize| _ - TestInterceptor.priority-1 | 2| _ - TestInterceptor.priority | 1| _ // This conflicts with TestInterceptor, so it won't be added. - TestInterceptor.priority+1 | 2| _ - } - - def "interceptor can modify a span"() { - setup: - tracer.interceptors.add(new TraceInterceptor() { - @Override - Collection onTraceComplete(Collection trace) { - for (MutableSpan span : trace) { - span - .setOperationName("modifiedON-" + span.getOperationName()) - .setServiceName("modifiedSN-" + span.getServiceName()) - .setResourceName("modifiedRN-" + span.getResourceName()) - .setSpanType("modifiedST-" + span.getSpanType()) - .setTag("boolean-tag", true) - .setTag("number-tag", 5.0) - .setTag("string-tag", "howdy") - .setError(true) - } - return trace - } - - @Override - int priority() { - return 1 - } - }) - tracer.buildSpan("test").start().finish() - writer.waitForTraces(1) - - expect: - def trace = writer.firstTrace() - trace.size() == 1 - - def span = trace[0] - - span.context().operationName == "modifiedON-test" - span.serviceName.startsWith("modifiedSN-") - span.resourceName.toString() == "modifiedRN-modifiedON-test" - span.type == "modifiedST-null" - span.context().getErrorFlag() - - def tags = span.context().tags - - tags["boolean-tag"] == true - tags["number-tag"] == 5.0 - tags["string-tag"] == "howdy" - - tags["thread.name"] != null - tags["thread.id"] != null - tags["runtime-id"] != null - tags["language"] != null - tags.size() >= 7 - } - - def "should be robust when interceptor return a null trace"() { - setup: - tracer.interceptors.add(new TraceInterceptor() { - @Override - Collection onTraceComplete(Collection trace) { - null - } - - @Override - int priority() { - return 0 - } - }) - - when: - DDSpan span = (DDSpan) tracer.startSpan("test", "test") - span.phasedFinish() - tracer.write(SpanList.of(span)) - - then: - notThrown(Throwable) - } - - def "register interceptor through bridge"() { - setup: - GlobalTracer.registerIfAbsent(tracer) - def interceptor = new TraceInterceptor() { - @Override - Collection onTraceComplete(Collection trace) { - return trace - } - - @Override - int priority() { - return 38 - } - } - - expect: - GlobalTracer.get().addTraceInterceptor(interceptor) - Arrays.asList(tracer.interceptors.interceptors()).contains(interceptor) - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/TracingConfigPollerTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/TracingConfigPollerTest.groovy deleted file mode 100644 index 2858fa61f4f..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/TracingConfigPollerTest.groovy +++ /dev/null @@ -1,291 +0,0 @@ -package datadog.trace.core - -import datadog.communication.ddagent.DDAgentFeaturesDiscovery -import datadog.communication.ddagent.SharedCommunicationObjects -import datadog.metrics.api.Monitoring -import datadog.remoteconfig.ConfigurationPoller -import datadog.remoteconfig.Product -import datadog.remoteconfig.state.ParsedConfigKey -import datadog.remoteconfig.state.ProductListener -import datadog.trace.api.datastreams.DataStreamsTransactionExtractor -import datadog.trace.core.test.DDCoreSpecification -import java.nio.charset.StandardCharsets -import okhttp3.HttpUrl -import okhttp3.OkHttpClient -import spock.lang.Timeout - -@Timeout(10) -class TracingConfigPollerTest extends DDCoreSpecification { - - def "test mergeLibConfigs with null and non-null values"() { - setup: - def config1 = new TracingConfigPoller.LibConfig() // all nulls - def config2 = new TracingConfigPoller.LibConfig( - tracingEnabled: true, - debugEnabled: false, - runtimeMetricsEnabled: true, - logsInjectionEnabled: false, - dataStreamsEnabled: true, - traceSampleRate: 0.5, - dynamicInstrumentationEnabled: true, - exceptionReplayEnabled: false, - codeOriginEnabled: true, - liveDebuggingEnabled: false - ) - def config3 = new TracingConfigPoller.LibConfig( - tracingEnabled: false, - debugEnabled: true, - runtimeMetricsEnabled: false, - logsInjectionEnabled: true, - dataStreamsEnabled: false, - traceSampleRate: 0.8, - dynamicInstrumentationEnabled: false, - exceptionReplayEnabled: true, - codeOriginEnabled: false, - liveDebuggingEnabled: true - ) - - when: - def merged = TracingConfigPoller.LibConfig.mergeLibConfigs([config1, config2, config3]) - - then: - merged != null - // Should take first non-null values from config2 - merged.tracingEnabled == true - merged.debugEnabled == false - merged.runtimeMetricsEnabled == true - merged.logsInjectionEnabled == false - merged.dataStreamsEnabled == true - merged.traceSampleRate == 0.5 - merged.dynamicInstrumentationEnabled == true - merged.exceptionReplayEnabled == false - merged.codeOriginEnabled == true - merged.liveDebuggingEnabled == false - } - - def "test config priority calculation"() { - setup: - def configOverrides = new TracingConfigPoller.ConfigOverrides() - if (service != null || env != null) { - configOverrides.serviceTarget = new TracingConfigPoller.ServiceTarget( - service: service, - env: env, - ) - } - if (clusterName != null) { - configOverrides.k8sTargetV2 = new TracingConfigPoller.K8sTargetV2( - clusterTargets: [ - new TracingConfigPoller.ClusterTarget( - clusterName: clusterName, - enabled: true, - ) - ] - ) - } - configOverrides.libConfig = new TracingConfigPoller.LibConfig() - - when: - def priority = configOverrides.getOverridePriority() - - then: - priority == expectedPriority - - where: - service | env | clusterName | expectedPriority - "test-service" | "staging" | null | 5 - "test-service" | "*" | null | 4 - "*" | "staging" | null | 3 - null | null | "test-cluster" | 2 - "*" | "*" | null | 1 - } - - - def "test actual config commit with service and org level configs"() { - setup: - def orgKey = ParsedConfigKey.parse("datadog/2/APM_TRACING/org_config/config") - def serviceKey = ParsedConfigKey.parse("datadog/2/APM_TRACING/service_config/config") - def poller = Mock(ConfigurationPoller) - def sco = new SharedCommunicationObjects( - agentHttpClient: Mock(OkHttpClient), - monitoring: Mock(Monitoring), - agentUrl: HttpUrl.get('https://example.com'), - featuresDiscovery: Mock(DDAgentFeaturesDiscovery), - configurationPoller: poller - ) - - def updater - - when: - def tracer = CoreTracer.builder() - .sharedCommunicationObjects(sco) - .pollForTracingConfiguration() - .build() - - then: - 1 * poller.addListener(Product.APM_TRACING, _ as ProductListener) >> { - updater = it[1] // capture config updater for further testing - } - and: - tracer.captureTraceConfig().serviceMapping == [:] - tracer.captureTraceConfig().traceSampleRate == null - - when: - // Add org level config (priority 1) - should set service mapping - updater.accept(orgKey, """ - { - "service_target": { - "service": "*", - "env": "*" - }, - "lib_config": { - "tracing_service_mapping": [ - { - "from_key": "org-service", - "to_name": "org-mapped" - } - ], - "tracing_sampling_rate": 0.7 - } - } - """.getBytes(StandardCharsets.UTF_8), null) - - // Add service level config (priority 4) - should override service mapping and add header tags - updater.accept(serviceKey, """ - { - "service_target": { - "service": "test-service", - "env": "*" - }, - "lib_config": { - "tracing_service_mapping": [ - { - "from_key": "service-specific", - "to_name": "service-mapped" - } - ], - "tracing_header_tags": [ - { - "header": "X-Custom-Header", - "tag_name": "custom.header" - } - ], - "tracing_sampling_rate": 1.3, - "data_streams_transaction_extractors": [ - { - "name": "test", - "type": "unknown", - "value": "value" - } - ] - } - } - """.getBytes(StandardCharsets.UTF_8), null) - - // Commit both configs - updater.commit() - - then: - // Service level config should take precedence due to higher priority (4 vs 1) - tracer.captureTraceConfig().serviceMapping == ["service-specific": "service-mapped"] - tracer.captureTraceConfig().traceSampleRate == 1.0 // should be clamped to 1.0 - tracer.captureTraceConfig().requestHeaderTags == ["x-custom-header": "custom.header"] - tracer.captureTraceConfig().responseHeaderTags == ["x-custom-header": "custom.header"] - tracer.captureTraceConfig().getDataStreamsTransactionExtractors().size() == 1 - tracer.captureTraceConfig().getDataStreamsTransactionExtractors()[0].name == "test" - tracer.captureTraceConfig().getDataStreamsTransactionExtractors()[0].type == DataStreamsTransactionExtractor.Type.UNKNOWN - tracer.captureTraceConfig().getDataStreamsTransactionExtractors()[0].value == "value" - - when: - // Remove service level config - updater.remove(serviceKey, null) - updater.commit() - - then: - // Should fall back to org level config - tracer.captureTraceConfig().serviceMapping == ["org-service": "org-mapped"] - tracer.captureTraceConfig().traceSampleRate == 0.7 - tracer.captureTraceConfig().requestHeaderTags == [:] - tracer.captureTraceConfig().responseHeaderTags == [:] - - when: - // Remove org level config - updater.remove(orgKey, null) - updater.commit() - - then: - // Should have no configs - tracer.captureTraceConfig().serviceMapping == [:] - tracer.captureTraceConfig().traceSampleRate == null - - cleanup: - tracer?.close() - } - - def "test two org levels config setting different flags works"() { - setup: - def orgConfig1Key = ParsedConfigKey.parse("datadog/2/APM_TRACING/org_config/config1") - def orgConfig2Key = ParsedConfigKey.parse("datadog/2/APM_TRACING/org_config/config2") - def poller = Mock(ConfigurationPoller) - def sco = new SharedCommunicationObjects( - agentHttpClient: Mock(OkHttpClient), - monitoring: Mock(Monitoring), - agentUrl: HttpUrl.get('https://example.com'), - featuresDiscovery: Mock(DDAgentFeaturesDiscovery), - configurationPoller: poller - ) - - def updater - - when: - def tracer = CoreTracer.builder() - .sharedCommunicationObjects(sco) - .pollForTracingConfiguration() - .build() - - then: - 1 * poller.addListener(Product.APM_TRACING, _ as ProductListener) >> { - updater = it[1] // capture config updater for further testing - } - and: - tracer.captureTraceConfig().isTraceEnabled() == true - tracer.captureTraceConfig().isDataStreamsEnabled() == false - - when: - // Add org level config with ApmTracing enabled - updater.accept(orgConfig1Key, """ - { - "service_target": { - "service": "*", - "env": "*" - }, - "lib_config": { - "tracing_enabled": true - } - } - """.getBytes(StandardCharsets.UTF_8), null) - - // Add second org level config with DataStreams enabled - updater.accept(orgConfig2Key, """ - { - "service_target": { - "service": "*", - "env": "*" - }, - "lib_config": { - "data_streams_enabled": true - } - } - """.getBytes(StandardCharsets.UTF_8), null) - - // Commit both configs - updater.commit() - - then: - // Both org level configs should be merged, with data streams enabled - tracer.captureTraceConfig().isTraceEnabled() == true - tracer.captureTraceConfig().isDataStreamsEnabled() == true - - cleanup: - tracer?.close() - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/baggage/BaggagePropagatorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/baggage/BaggagePropagatorTest.groovy deleted file mode 100644 index 29eb3519aea..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/baggage/BaggagePropagatorTest.groovy +++ /dev/null @@ -1,295 +0,0 @@ -package datadog.trace.core.baggage - -import datadog.context.Context -import datadog.context.propagation.CarrierSetter -import datadog.context.propagation.CarrierVisitor -import datadog.trace.bootstrap.instrumentation.api.Baggage -import datadog.trace.bootstrap.instrumentation.api.ContextVisitors -import datadog.trace.test.util.DDSpecification - -import java.util.function.BiConsumer - -import static datadog.trace.api.ConfigDefaults.DEFAULT_TRACE_BAGGAGE_MAX_BYTES -import static datadog.trace.api.ConfigDefaults.DEFAULT_TRACE_BAGGAGE_MAX_ITEMS -import static datadog.trace.core.baggage.BaggagePropagator.BAGGAGE_KEY - -class BaggagePropagatorTest extends DDSpecification { - BaggagePropagator propagator - CarrierSetter setter - Map carrier - Context context - - static class MapCarrierAccessor - implements CarrierSetter>, CarrierVisitor> { - @Override - void set(Map carrier, String key, String value) { - if (carrier != null && key != null && value != null) { - carrier.put(key, value) - } - } - - @Override - void forEachKeyValue(Map carrier, BiConsumer visitor) { - carrier.forEach(visitor) - } - } - - def setup() { - this.propagator = new BaggagePropagator(true, true, DEFAULT_TRACE_BAGGAGE_MAX_ITEMS, DEFAULT_TRACE_BAGGAGE_MAX_BYTES) - this.setter = new MapCarrierAccessor() - this.carrier = [:] - this.context = Context.root() - } - - def 'test baggage propagator context injection'() { - setup: - this.context = Baggage.create(baggageMap).storeInto(this.context) - - when: - this.propagator.inject(context, carrier, setter) - - then: - assert carrier[BAGGAGE_KEY] == baggageHeader - - where: - baggageMap | baggageHeader - ["key1": "val1", "key2": "val2", "foo": "bar"] | "key1=val1,key2=val2,foo=bar" - ['",;\\()/:<=>?@[]{}': '",;\\'] | "%22%2C%3B%5C%28%29%2F%3A%3C%3D%3E%3F%40%5B%5D%7B%7D=%22%2C%3B%5C" - [key1: "val1"] | "key1=val1" - [key1: "val1", key2: "val2"] | "key1=val1,key2=val2" - [serverNode: "DF 28"] | "serverNode=DF%2028" - [userId: "Amélie"] | "userId=Am%C3%A9lie" - ["user!d(me)": "false"] | "user!d%28me%29=false" - ["abcdefg": "hijklmnopq♥"] | "abcdefg=hijklmnopq%E2%99%A5" - } - - def "test baggage inject item limit"() { - setup: - propagator = new BaggagePropagator(true, true, 2, DEFAULT_TRACE_BAGGAGE_MAX_BYTES) //creating a new instance after injecting config - context = Baggage.create(baggage).storeInto(context) - - when: - this.propagator.inject(context, carrier, setter) - - then: - assert carrier[BAGGAGE_KEY] == baggageHeader - - where: - baggage | baggageHeader - [key1: "val1", key2: "val2"] | "key1=val1,key2=val2" - [key1: "val1", key2: "val2", key3: "val3"] | "key1=val1,key2=val2" - } - - def "test baggage inject bytes limit"() { - setup: - propagator = new BaggagePropagator(true, true, DEFAULT_TRACE_BAGGAGE_MAX_ITEMS, 20) //creating a new instance after injecting config - context = Baggage.create(baggage).storeInto(context) - - when: - this.propagator.inject(context, carrier, setter) - - then: - assert carrier[BAGGAGE_KEY] == baggageHeader - - where: - baggage | baggageHeader - [key1: "val1", key2: "val2"] | "key1=val1,key2=val2" - [key1: "val1", key2: "val2", key3: "val3"] | "key1=val1,key2=val2" - ["abcdefg": "hijklmnopq♥"] | "" - } - - def 'test tracing propagator context extractor'() { - setup: - def headers = [ - (BAGGAGE_KEY) : baggageHeader, - ] - - when: - context = this.propagator.extract(context, headers, ContextVisitors.stringValuesMap()) - - then: - Baggage.fromContext(context).asMap() == baggageMap - - where: - baggageHeader | baggageMap - "key1=val1,key2=val2,foo=bar" | ["key1": "val1", "key2": "val2", "foo": "bar"] - "%22%2C%3B%5C%28%29%2F%3A%3C%3D%3E%3F%40%5B%5D%7B%7D=%22%2C%3B%5C" | ['",;\\()/:<=>?@[]{}': '",;\\'] - } - - def "test extracting non ASCII headers"() { - setup: - def headers = [ - (BAGGAGE_KEY) : "key1=vallée,clé2=value", - ] - - when: - context = this.propagator.extract(context, headers, ContextVisitors.stringValuesMap()) - def baggage = Baggage.fromContext(context) - - then: 'non ASCII values data are still accessible as part of the API' - baggage != null - baggage.asMap().get('key1') == 'vallée' - baggage.asMap().get('clé2') == 'value' - baggage.w3cHeader == null - - - when: - this.propagator.inject(Context.root().with(baggage), carrier, setter) - - then: 'baggage are URL encoded if not valid, even if not modified' - assert carrier[BAGGAGE_KEY] == 'key1=vall%C3%A9e,cl%C3%A92=value' - } - - def "extract invalid baggage headers"() { - setup: - def headers = [ - (BAGGAGE_KEY) : baggageHeader, - ] - - when: - context = this.propagator.extract(context, headers, ContextVisitors.stringValuesMap()) - - then: - Baggage.fromContext(context) == null - - where: - baggageHeader | _ - "no-equal-sign,foo=gets-dropped-because-previous-pair-is-malformed" | _ - "foo=gets-dropped-because-subsequent-pair-is-malformed,=" | _ - "=no-key" | _ - "no-value=" | _ - "" | _ - ",," | _ - "=" | _ - } - - def "test baggage cache"(){ - setup: - def headers = [ - (BAGGAGE_KEY) : baggageHeader, - ] - - when: - context = this.propagator.extract(context, headers, ContextVisitors.stringValuesMap()) - - then: - Baggage baggageContext = Baggage.fromContext(context) - baggageContext.w3cHeader == cachedString - - where: - baggageHeader | cachedString - "key1=val1,key2=val2,foo=bar" | "key1=val1,key2=val2,foo=bar" - '";\\()/:<=>?@[]{}=";\\' | null - } - - def "test baggage cache items limit"(){ - setup: - propagator = new BaggagePropagator(true, true, 2, DEFAULT_TRACE_BAGGAGE_MAX_BYTES) //creating a new instance after injecting config - def headers = [ - (BAGGAGE_KEY) : baggageHeader, - ] - - when: - context = this.propagator.extract(context, headers, ContextVisitors.stringValuesMap()) - - then: - Baggage baggageContext = Baggage.fromContext(context) - baggageContext.getW3cHeader() as String == cachedString - - where: - baggageHeader | cachedString - "key1=val1,key2=val2" | "key1=val1,key2=val2" - "key1=val1,key2=val2,key3=val3" | "key1=val1,key2=val2" - "key1=val1,key2=val2,key3=val3,key4=val4" | "key1=val1,key2=val2" - } - - def "test baggage cache bytes limit"(){ - setup: - propagator = new BaggagePropagator(true, true, DEFAULT_TRACE_BAGGAGE_MAX_ITEMS, 20) //creating a new instance after injecting config - def headers = [ - (BAGGAGE_KEY) : baggageHeader, - ] - - when: - context = this.propagator.extract(context, headers, ContextVisitors.stringValuesMap()) - - then: - Baggage baggageContext = Baggage.fromContext(context) - baggageContext.getW3cHeader() as String == cachedString - - where: - baggageHeader | cachedString - "key1=val1,key2=val2" | "key1=val1,key2=val2" - "key1=val1,key2=val2,key3=val3" | "key1=val1,key2=val2" - } - - def "test baggage extract items limit"() { - setup: - propagator = new BaggagePropagator(true, true, 2, DEFAULT_TRACE_BAGGAGE_MAX_BYTES) //creating a new instance after injecting config - def headers = [ - (BAGGAGE_KEY) : baggageHeader, - ] - - when: - context = this.propagator.extract(context, headers, ContextVisitors.stringValuesMap()) - - then: 'parsing stops once the item limit is exceeded' - Baggage.fromContext(context).asMap() == baggageMap - - where: - baggageHeader | baggageMap - "key1=val1" | [key1: "val1"] - "key1=val1,key2=val2" | [key1: "val1", key2: "val2"] - "key1=val1,key2=val2,key3=val3" | [key1: "val1", key2: "val2"] - } - - def "test baggage extract bytes limit"() { - setup: - propagator = new BaggagePropagator(true, true, DEFAULT_TRACE_BAGGAGE_MAX_ITEMS, 20) //creating a new instance after injecting config - def headers = [ - (BAGGAGE_KEY) : baggageHeader, - ] - - when: - context = this.propagator.extract(context, headers, ContextVisitors.stringValuesMap()) - - then: 'parsing stops once the byte limit is exceeded' - Baggage.fromContext(context).asMap() == baggageMap - - where: - baggageHeader | baggageMap - "key1=val1" | [key1: "val1"] - "key1=val1,key2=val2" | [key1: "val1", key2: "val2"] - "key1=val1,key2=val2,key3=val3" | [key1: "val1", key2: "val2"] - } - - def "test baggage extract 0 item limit"() { - setup: - propagator = new BaggagePropagator(true, true, 0, DEFAULT_TRACE_BAGGAGE_MAX_BYTES) //creating a new instance after injecting config - def headers = [ - (BAGGAGE_KEY) : "key1=value1", - ] - - when: - context = this.propagator.extract(context, headers, ContextVisitors.stringValuesMap()) - - then: - Baggage.fromContext(context) == null - } - - - - def "test baggage extract 0 byte limit"() { - setup: - propagator = new BaggagePropagator(true, true, DEFAULT_TRACE_BAGGAGE_MAX_ITEMS, 0) //creating a new instance after injecting config - def headers = [ - (BAGGAGE_KEY) : "key1=value1", - ] - - when: - context = this.propagator.extract(context, headers, ContextVisitors.stringValuesMap()) - - then: - Baggage.fromContext(context) == null - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/CheckpointerTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/CheckpointerTest.groovy deleted file mode 100644 index b41a8d3ad13..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/CheckpointerTest.groovy +++ /dev/null @@ -1,53 +0,0 @@ -package datadog.trace.core.datastreams - - -import datadog.trace.api.experimental.DataStreamsContextCarrier -import datadog.trace.bootstrap.instrumentation.api.AgentTracer -import datadog.trace.core.test.DDCoreSpecification - -import static datadog.trace.api.config.GeneralConfig.DATA_STREAMS_ENABLED - -class CheckpointerTest extends DDCoreSpecification { - void 'test setting produce & consume checkpoint'() { - setup: - // Enable DSM - injectSysConfig(DATA_STREAMS_ENABLED, 'true') - // Create a test tracer - def tracer = tracerBuilder().build() - AgentTracer.forceRegister(tracer) - // Get the test checkpointer - def checkpointer = tracer.getDataStreamsCheckpointer() - // Declare the carrier to test injected data - def carrier = new CustomContextCarrier() - // Start and activate a span - def span = tracer.buildSpan('test', 'dsm-checkpoint').start() - def scope = tracer.activateSpan(span) - - when: - // Trigger produce checkpoint - checkpointer.setProduceCheckpoint('kafka', 'testTopic', carrier) - checkpointer.setConsumeCheckpoint('kafka', 'testTopic', carrier) - // Clean up span - scope.close() - span.finish() - - then: - carrier.entries().any { entry -> entry.getKey() == "dd-pathway-ctx-base64" } - span.context().pathwayContext.hash != 0 - } - - class CustomContextCarrier implements DataStreamsContextCarrier { - - private Map data = new HashMap<>() - - @Override - Set> entries() { - return data.entrySet() - } - - @Override - void set(String key, String value) { - data.put(key, value) - } - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/DataStreamsTransactionExtractorsTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/DataStreamsTransactionExtractorsTest.groovy deleted file mode 100644 index be3bdc9d003..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/DataStreamsTransactionExtractorsTest.groovy +++ /dev/null @@ -1,23 +0,0 @@ -package datadog.trace.core.datastreams - -import datadog.trace.api.datastreams.DataStreamsTransactionExtractor -import datadog.trace.core.test.DDCoreSpecification - -class DataStreamsTransactionExtractorsTest extends DDCoreSpecification { - def "Deserialize from json"() { - when: - def list = DataStreamsTransactionExtractors.deserialize("""[ - {"name": "extractor", "type": "HTTP_OUT_HEADERS", "value": "transaction_id"}, - {"name": "second_extractor", "type": "HTTP_IN_HEADERS", "value": "transaction_id"} - ]""") - def extractors = list.getExtractors() - then: - extractors.size() == 2 - extractors[0].getName() == "extractor" - extractors[0].getType() == DataStreamsTransactionExtractor.Type.HTTP_OUT_HEADERS - extractors[0].getValue() == "transaction_id" - extractors[1].getName() == "second_extractor" - extractors[1].getType() == DataStreamsTransactionExtractor.Type.HTTP_IN_HEADERS - extractors[1].getValue() == "transaction_id" - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/DataStreamsWritingTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/DataStreamsWritingTest.groovy deleted file mode 100644 index f47904f522b..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/DataStreamsWritingTest.groovy +++ /dev/null @@ -1,537 +0,0 @@ -package datadog.trace.core.datastreams - -import datadog.communication.ddagent.DDAgentFeaturesDiscovery -import datadog.communication.ddagent.SharedCommunicationObjects -import datadog.communication.http.OkHttpUtils -import datadog.trace.api.Config -import datadog.trace.api.ProcessTags -import datadog.trace.api.TraceConfig -import datadog.trace.api.WellKnownTags -import datadog.trace.api.datastreams.DataStreamsTags -import datadog.trace.api.time.ControllableTimeSource -import datadog.trace.api.datastreams.StatsPoint -import datadog.trace.core.DDTraceCoreInfo -import datadog.trace.core.test.DDCoreSpecification -import okhttp3.HttpUrl -import okio.BufferedSource -import okio.GzipSource -import okio.Okio -import org.msgpack.core.MessagePack -import org.msgpack.core.MessageUnpacker -import spock.lang.AutoCleanup -import spock.lang.Shared -import spock.util.concurrent.PollingConditions - -import static datadog.trace.agent.test.server.http.TestHttpServer.httpServer -import static datadog.trace.api.config.GeneralConfig.EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED -import static java.util.concurrent.TimeUnit.SECONDS - -/** - * This test class exists because a real integration test is not possible. see DataStreamsIntegrationTest - */ -class DataStreamsWritingTest extends DDCoreSpecification { - @Shared - List requestBodies - - @AutoCleanup - @Shared - def server = httpServer { - handlers { - post(DDAgentFeaturesDiscovery.V01_DATASTREAMS_ENDPOINT) { - owner.owner.owner.requestBodies.add(request.body) - response.status(200).send() - } - } - } - - static final DEFAULT_BUCKET_DURATION_NANOS = Config.get().getDataStreamsBucketDurationNanoseconds() - def setup() { - requestBodies = [] - } - - def "Service overrides split buckets"() { - given: - def conditions = new PollingConditions(timeout: 2) - - def testOkhttpClient = OkHttpUtils.buildHttpClient(HttpUrl.get(server.address), 5000L) - - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> true - } - - def wellKnownTags = new WellKnownTags("runtimeid", "hostname", "test", Config.get().getServiceName(), "version", "java") - - def fakeConfig = Stub(Config) { - getAgentUrl() >> server.address.toString() - getWellKnownTags() >> wellKnownTags - getPrimaryTag() >> "region-1" - } - - def sharedCommObjects = new SharedCommunicationObjects() - sharedCommObjects.featuresDiscovery = features - sharedCommObjects.agentHttpClient = testOkhttpClient - sharedCommObjects.createRemaining(fakeConfig) - - def timeSource = new ControllableTimeSource() - - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> true - } - def serviceNameOverride = "service-name-override" - - when: - def dataStreams = new DefaultDataStreamsMonitoring(fakeConfig, sharedCommObjects, timeSource, { traceConfig }) - dataStreams.start() - dataStreams.setThreadServiceName(serviceNameOverride) - dataStreams.add(new StatsPoint(DataStreamsTags.create(null, null), 9, 0, 10, timeSource.currentTimeNanos, 0, 0, 0, serviceNameOverride)) - dataStreams.trackBacklog(DataStreamsTags.createWithPartition("kafka_produce", "testTopic", "1", null, null), 130) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - // force flush - dataStreams.report() - dataStreams.close() - dataStreams.clearThreadServiceName() - then: - conditions.eventually { - assert requestBodies.size() == 1 - } - GzipSource gzipSource = new GzipSource(Okio.source(new ByteArrayInputStream(requestBodies[0]))) - - BufferedSource bufferedSource = Okio.buffer(gzipSource) - MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(bufferedSource.inputStream()) - - assert unpacker.unpackMapHeader() == 9 - assert unpacker.unpackString() == "Env" - assert unpacker.unpackString() == "test" - assert unpacker.unpackString() == "Service" - assert unpacker.unpackString() == serviceNameOverride - } - - def "Write bucket to mock server with process tags enabled #processTagsEnabled"() { - setup: - injectSysConfig(EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED, "$processTagsEnabled") - ProcessTags.reset() - - def conditions = new PollingConditions(timeout: 2) - - def testOkhttpClient = OkHttpUtils.buildHttpClient(HttpUrl.get(server.address), 5000L) - - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> true - } - - def wellKnownTags = new WellKnownTags("runtimeid", "hostname", "test", Config.get().getServiceName(), "version", "java") - - def fakeConfig = Stub(Config) { - getAgentUrl() >> server.address.toString() - getWellKnownTags() >> wellKnownTags - getPrimaryTag() >> "region-1" - } - - def sharedCommObjects = new SharedCommunicationObjects() - sharedCommObjects.featuresDiscovery = features - sharedCommObjects.agentHttpClient = testOkhttpClient - sharedCommObjects.createRemaining(fakeConfig) - - def timeSource = new ControllableTimeSource() - - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> true - } - - when: - def dataStreams = new DefaultDataStreamsMonitoring(fakeConfig, sharedCommObjects, timeSource, { traceConfig }) - dataStreams.start() - dataStreams.add(new StatsPoint(DataStreamsTags.create(null, null), 9, 0, 10, timeSource.currentTimeNanos, 0, 0, 0, null)) - dataStreams.add(new StatsPoint(DataStreamsTags.create("testType", DataStreamsTags.Direction.INBOUND, "testTopic", "testGroup", null), 1, 2, 5, timeSource.currentTimeNanos, 0, 0, 0, null)) - dataStreams.trackBacklog(DataStreamsTags.createWithPartition("kafka_produce", "testTopic", "1", null, null), 100) - dataStreams.trackBacklog(DataStreamsTags.createWithPartition("kafka_produce", "testTopic", "1", null, null), 130) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS - 100l) - dataStreams.add(new StatsPoint(DataStreamsTags.create("testType", DataStreamsTags.Direction.INBOUND, "testTopic", "testGroup", null), 1, 2, 5, timeSource.currentTimeNanos, SECONDS.toNanos(10), SECONDS.toNanos(10), 10, null)) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.add(new StatsPoint(DataStreamsTags.create("testType", DataStreamsTags.Direction.INBOUND, "testTopic", "testGroup", null), 1, 2, 5, timeSource.currentTimeNanos, SECONDS.toNanos(5), SECONDS.toNanos(5), 5, null)) - dataStreams.add(new StatsPoint(DataStreamsTags.create("testType", DataStreamsTags.Direction.INBOUND, "testTopic2", "testGroup", null), 3, 4, 6, timeSource.currentTimeNanos, SECONDS.toNanos(2), 0, 2, null)) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.close() - - then: - conditions.eventually { - assert requestBodies.size() == 1 - } - - validateMessage(requestBodies[0], processTagsEnabled) - - cleanup: - injectSysConfig(EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED, "true") - ProcessTags.reset() - - where: - processTagsEnabled << [true, false] - } - - def "Write Kafka configs to mock server"() { - given: - def conditions = new PollingConditions(timeout: 2) - - def testOkhttpClient = OkHttpUtils.buildHttpClient(HttpUrl.get(server.address), 5000L) - - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> true - } - - def wellKnownTags = new WellKnownTags("runtimeid", "hostname", "test", Config.get().getServiceName(), "version", "java") - - def fakeConfig = Stub(Config) { - getAgentUrl() >> server.address.toString() - getWellKnownTags() >> wellKnownTags - getPrimaryTag() >> "region-1" - } - - def sharedCommObjects = new SharedCommunicationObjects() - sharedCommObjects.featuresDiscovery = features - sharedCommObjects.agentHttpClient = testOkhttpClient - sharedCommObjects.createRemaining(fakeConfig) - - def timeSource = new ControllableTimeSource() - - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> true - } - - when: - def dataStreams = new DefaultDataStreamsMonitoring(fakeConfig, sharedCommObjects, timeSource, { traceConfig }) - dataStreams.start() - - // Report a producer and consumer config - dataStreams.reportKafkaConfig("kafka_producer", "", "", ["bootstrap.servers": "localhost:9092", "acks": "all", "linger.ms": "5"]) - dataStreams.reportKafkaConfig("kafka_consumer", "", "test-group", ["bootstrap.servers": "localhost:9092", "group.id": "test-group", "auto.offset.reset": "earliest"]) - - // Also add a stats point so the bucket is not empty of stats - dataStreams.add(new StatsPoint(DataStreamsTags.create(null, null), 9, 0, 10, timeSource.currentTimeNanos, 0, 0, 0, null)) - - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.close() - - then: - conditions.eventually { - assert requestBodies.size() == 1 - } - - validateKafkaConfigMessage(requestBodies[0]) - } - - def "Duplicate Kafka configs are each serialized in the payload"() { - given: - def conditions = new PollingConditions(timeout: 2) - - def testOkhttpClient = OkHttpUtils.buildHttpClient(HttpUrl.get(server.address), 5000L) - - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> true - } - - def wellKnownTags = new WellKnownTags("runtimeid", "hostname", "test", Config.get().getServiceName(), "version", "java") - - def fakeConfig = Stub(Config) { - getAgentUrl() >> server.address.toString() - getWellKnownTags() >> wellKnownTags - getPrimaryTag() >> "region-1" - } - - def sharedCommObjects = new SharedCommunicationObjects() - sharedCommObjects.featuresDiscovery = features - sharedCommObjects.agentHttpClient = testOkhttpClient - sharedCommObjects.createRemaining(fakeConfig) - - def timeSource = new ControllableTimeSource() - - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> true - } - - when: - def dataStreams = new DefaultDataStreamsMonitoring(fakeConfig, sharedCommObjects, timeSource, { traceConfig }) - dataStreams.start() - - // Report the same producer config twice — both should be serialized - dataStreams.reportKafkaConfig("kafka_producer", "", "", ["bootstrap.servers": "localhost:9092", "acks": "all"]) - dataStreams.reportKafkaConfig("kafka_producer", "", "", ["bootstrap.servers": "localhost:9092", "acks": "all"]) - - // Also add a stats point so the bucket has content - dataStreams.add(new StatsPoint(DataStreamsTags.create(null, null), 9, 0, 10, timeSource.currentTimeNanos, 0, 0, 0, null)) - - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.close() - - then: - conditions.eventually { - assert requestBodies.size() == 1 - } - - validateDuplicateKafkaConfigMessage(requestBodies[0]) - } - - def validateKafkaConfigMessage(byte[] message) { - GzipSource gzipSource = new GzipSource(Okio.source(new ByteArrayInputStream(message))) - BufferedSource bufferedSource = Okio.buffer(gzipSource) - MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(bufferedSource.inputStream()) - - // Outer map (same structure as other payloads) - def outerMapSize = unpacker.unpackMapHeader() - // Skip to Stats array - boolean foundStats = false - for (int i = 0; i < outerMapSize; i++) { - def key = unpacker.unpackString() - if (key == "Stats") { - foundStats = true - def numBuckets = unpacker.unpackArrayHeader() - assert numBuckets >= 1 - - // Parse first bucket - def bucketMapSize = unpacker.unpackMapHeader() - boolean foundConfigs = false - for (int j = 0; j < bucketMapSize; j++) { - def bucketKey = unpacker.unpackString() - if (bucketKey == "Configs") { - foundConfigs = true - def numConfigs = unpacker.unpackArrayHeader() - assert numConfigs == 2 - - // Collect configs in a map keyed by type - Map> configsByType = [:] - numConfigs.times { - assert unpacker.unpackMapHeader() == 4 - assert unpacker.unpackString() == "Type" - def type = unpacker.unpackString() - assert unpacker.unpackString() == "KafkaClusterId" - unpacker.unpackString() // skip cluster id value - assert unpacker.unpackString() == "ConsumerGroup" - unpacker.unpackString() // skip consumer group value - assert unpacker.unpackString() == "Config" - def configSize = unpacker.unpackMapHeader() - Map configEntries = [:] - configSize.times { - def ck = unpacker.unpackString() - def cv = unpacker.unpackString() - configEntries[ck] = cv - } - configsByType[type] = configEntries - } - - // Verify producer config - assert configsByType.containsKey("kafka_producer") - assert configsByType["kafka_producer"]["bootstrap.servers"] == "localhost:9092" - assert configsByType["kafka_producer"]["acks"] == "all" - assert configsByType["kafka_producer"]["linger.ms"] == "5" - - // Verify consumer config - assert configsByType.containsKey("kafka_consumer") - assert configsByType["kafka_consumer"]["bootstrap.servers"] == "localhost:9092" - assert configsByType["kafka_consumer"]["group.id"] == "test-group" - assert configsByType["kafka_consumer"]["auto.offset.reset"] == "earliest" - } else { - unpacker.skipValue() - } - } - assert foundConfigs : "Configs field not found in bucket" - - // Skip remaining buckets - for (int b = 1; b < numBuckets; b++) { - unpacker.skipValue() - } - } else { - unpacker.skipValue() - } - } - assert foundStats : "Stats field not found in payload" - return true - } - - def validateDuplicateKafkaConfigMessage(byte[] message) { - GzipSource gzipSource = new GzipSource(Okio.source(new ByteArrayInputStream(message))) - BufferedSource bufferedSource = Okio.buffer(gzipSource) - MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(bufferedSource.inputStream()) - - def outerMapSize = unpacker.unpackMapHeader() - boolean foundStats = false - for (int i = 0; i < outerMapSize; i++) { - def key = unpacker.unpackString() - if (key == "Stats") { - foundStats = true - def numBuckets = unpacker.unpackArrayHeader() - assert numBuckets >= 1 - - // Parse first bucket - def bucketMapSize = unpacker.unpackMapHeader() - boolean foundConfigs = false - for (int j = 0; j < bucketMapSize; j++) { - def bucketKey = unpacker.unpackString() - if (bucketKey == "Configs") { - foundConfigs = true - def numConfigs = unpacker.unpackArrayHeader() - // Both configs should be present (no deduplication) - assert numConfigs == 2 - - numConfigs.times { - assert unpacker.unpackMapHeader() == 4 - assert unpacker.unpackString() == "Type" - assert unpacker.unpackString() == "kafka_producer" - assert unpacker.unpackString() == "KafkaClusterId" - unpacker.unpackString() // skip cluster id value - assert unpacker.unpackString() == "ConsumerGroup" - unpacker.unpackString() // skip consumer group value - assert unpacker.unpackString() == "Config" - def configSize = unpacker.unpackMapHeader() - Map configEntries = [:] - configSize.times { - def ck = unpacker.unpackString() - def cv = unpacker.unpackString() - configEntries[ck] = cv - } - assert configEntries["bootstrap.servers"] == "localhost:9092" - assert configEntries["acks"] == "all" - } - } else { - unpacker.skipValue() - } - } - assert foundConfigs : "Configs field not found in bucket" - - for (int b = 1; b < numBuckets; b++) { - unpacker.skipValue() - } - } else { - unpacker.skipValue() - } - } - assert foundStats : "Stats field not found in payload" - return true - } - - def validateMessage(byte[] message, boolean processTagsEnabled) { - GzipSource gzipSource = new GzipSource(Okio.source(new ByteArrayInputStream(message))) - - BufferedSource bufferedSource = Okio.buffer(gzipSource) - MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(bufferedSource.inputStream()) - - assert unpacker.unpackMapHeader() == 8 + (processTagsEnabled ? 1 : 0) - assert unpacker.unpackString() == "Env" - assert unpacker.unpackString() == "test" - assert unpacker.unpackString() == "Service" - assert unpacker.unpackString() == Config.get().getServiceName() - assert unpacker.unpackString() == "Lang" - assert unpacker.unpackString() == "java" - assert unpacker.unpackString() == "PrimaryTag" - assert unpacker.unpackString() == "region-1" - assert unpacker.unpackString() == "TracerVersion" - assert unpacker.unpackString() == DDTraceCoreInfo.VERSION - assert unpacker.unpackString() == "Version" - assert unpacker.unpackString() == "version" - assert unpacker.unpackString() == "Stats" - assert unpacker.unpackArrayHeader() == 2 // 2 time buckets - - // FIRST BUCKET - assert unpacker.unpackMapHeader() == 4 - assert unpacker.unpackString() == "Start" - unpacker.skipValue() - assert unpacker.unpackString() == "Duration" - assert unpacker.unpackLong() == DEFAULT_BUCKET_DURATION_NANOS - assert unpacker.unpackString() == "Stats" - assert unpacker.unpackArrayHeader() == 2 // 2 groups in first bucket - - Set availableSizes = [5, 6] // we don't know the order the groups will be reported - 2.times { - int mapHeaderSize = unpacker.unpackMapHeader() - assert availableSizes.remove(mapHeaderSize) - if (mapHeaderSize == 5) { - // empty topic group - assert unpacker.unpackString() == "PathwayLatency" - unpacker.skipValue() - assert unpacker.unpackString() == "EdgeLatency" - unpacker.skipValue() - assert unpacker.unpackString() == "PayloadSize" - unpacker.skipValue() - assert unpacker.unpackString() == "Hash" - assert unpacker.unpackLong() == 9 - assert unpacker.unpackString() == "ParentHash" - assert unpacker.unpackLong() == 0 - } else { - //other group - assert unpacker.unpackString() == "PathwayLatency" - unpacker.skipValue() - assert unpacker.unpackString() == "EdgeLatency" - unpacker.skipValue() - assert unpacker.unpackString() == "PayloadSize" - unpacker.skipValue() - assert unpacker.unpackString() == "Hash" - assert unpacker.unpackLong() == 1 - assert unpacker.unpackString() == "ParentHash" - assert unpacker.unpackLong() == 2 - assert unpacker.unpackString() == "EdgeTags" - assert unpacker.unpackArrayHeader() == 4 - assert unpacker.unpackString() == "direction:in" - assert unpacker.unpackString() == "topic:testTopic" - assert unpacker.unpackString() == "type:testType" - assert unpacker.unpackString() == "group:testGroup" - } - } - - // Kafka stats - assert unpacker.unpackString() == "Backlogs" - assert unpacker.unpackArrayHeader() == 1 - assert unpacker.unpackMapHeader() == 2 - assert unpacker.unpackString() == "Tags" - assert unpacker.unpackArrayHeader() == 3 - assert unpacker.unpackString() == "topic:testTopic" - assert unpacker.unpackString() == "type:kafka_produce" - assert unpacker.unpackString() == "partition:1" - assert unpacker.unpackString() == "Value" - assert unpacker.unpackLong() == 130 - - // SECOND BUCKET - assert unpacker.unpackMapHeader() == 3 - assert unpacker.unpackString() == "Start" - unpacker.skipValue() - assert unpacker.unpackString() == "Duration" - assert unpacker.unpackLong() == DEFAULT_BUCKET_DURATION_NANOS - assert unpacker.unpackString() == "Stats" - assert unpacker.unpackArrayHeader() == 2 // 2 groups in second bucket - - Set availableHashes = [1L, 3L] // we don't know the order the groups will be reported - 2.times { - assert unpacker.unpackMapHeader() == 6 - assert unpacker.unpackString() == "PathwayLatency" - unpacker.skipValue() - assert unpacker.unpackString() == "EdgeLatency" - unpacker.skipValue() - assert unpacker.unpackString() == "PayloadSize" - unpacker.skipValue() - assert unpacker.unpackString() == "Hash" - def hash = unpacker.unpackLong() - assert availableHashes.remove(hash) - assert unpacker.unpackString() == "ParentHash" - assert unpacker.unpackLong() == (hash == 1 ? 2 : 4) - assert unpacker.unpackString() == "EdgeTags" - assert unpacker.unpackArrayHeader() == 4 - assert unpacker.unpackString() == "direction:in" - assert unpacker.unpackString() == (hash == 1 ? "topic:testTopic" : "topic:testTopic2") - assert unpacker.unpackString() == "type:testType" - assert unpacker.unpackString() == "group:testGroup" - } - - assert unpacker.unpackString() == "ProductMask" - assert unpacker.unpackLong() == 1 - - def processTags = ProcessTags.getTagsAsStringList() - assert unpacker.hasNext() == (processTags != null) - if (processTags != null) { - assert unpacker.unpackString() == "ProcessTags" - assert unpacker.unpackArrayHeader() == processTags.size() - processTags.each { - assert unpacker.unpackString() == it - } - } - - return true - } -} - diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/DefaultDataStreamsMonitoringTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/DefaultDataStreamsMonitoringTest.groovy deleted file mode 100644 index 217dd721d08..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/DefaultDataStreamsMonitoringTest.groovy +++ /dev/null @@ -1,1513 +0,0 @@ -package datadog.trace.core.datastreams - -import datadog.communication.ddagent.DDAgentFeaturesDiscovery -import datadog.trace.api.Config -import datadog.trace.api.TraceConfig -import datadog.trace.api.datastreams.DataStreamsTags -import datadog.trace.api.datastreams.KafkaConfigReport -import datadog.trace.api.datastreams.SchemaRegistryUsage -import datadog.trace.api.datastreams.StatsPoint -import datadog.trace.api.experimental.DataStreamsContextCarrier -import datadog.trace.api.time.ControllableTimeSource -import datadog.trace.common.metrics.EventListener -import datadog.trace.common.metrics.Sink -import datadog.trace.core.test.DDCoreSpecification -import spock.util.concurrent.PollingConditions - -import java.util.concurrent.TimeUnit -import java.util.function.BiConsumer - -import static DefaultDataStreamsMonitoring.FEATURE_CHECK_INTERVAL_NANOS -import static java.util.concurrent.TimeUnit.SECONDS - -class DefaultDataStreamsMonitoringTest extends DDCoreSpecification { - static final DEFAULT_BUCKET_DURATION_NANOS = Config.get().getDataStreamsBucketDurationNanoseconds() - - def "No payloads written if data streams not supported or not enabled"() { - given: - def conditions = new PollingConditions(timeout: 1) - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> enabledAtAgent - } - def timeSource = new ControllableTimeSource() - def payloadWriter = Mock(DatastreamsPayloadWriter) - def sink = Mock(Sink) - - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> enabledInConfig - } - - when: - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { traceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.start() - dataStreams.add(new StatsPoint(DataStreamsTags.create("testType", null, "testTopic", "testGroup", null), 0, 0, 0, timeSource.currentTimeNanos, 0, 0, 0, null)) - dataStreams.report() - - then: - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert dataStreams.thread.state != Thread.State.RUNNABLE - } - 0 * payloadWriter.writePayload(_) - - cleanup: - dataStreams.close() - - where: - enabledAtAgent | enabledInConfig - false | true - true | false - false | false - } - - def "Schema sampler samples with correct weights"() { - given: - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> true - } - def timeSource = new ControllableTimeSource() - timeSource.set(1e12 as long) - def payloadWriter = Mock(DatastreamsPayloadWriter) - def sink = Mock(Sink) - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> true - } - - when: - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { traceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - - then: - // the first received schema is sampled, with a weight of one. - dataStreams.canSampleSchema("schema1") - dataStreams.trySampleSchema("schema1") == 1 - // the sampling is done by topic, so a schema on a different topic will also be sampled at once, also with a weight of one. - dataStreams.canSampleSchema("schema2") - dataStreams.trySampleSchema("schema2") == 1 - // no time has passed from the last sampling, so the same schema is not sampled again (two times in a row). - !dataStreams.canSampleSchema("schema1") - !dataStreams.canSampleSchema("schema1") - timeSource.advance(30*1e9 as long) - // now, 30 seconds have passed, so the schema is sampled again, with a weight of 3 (so it includes the two times the schema was not sampled). - dataStreams.canSampleSchema("schema1") - dataStreams.trySampleSchema("schema1") == 3 - } - - def "Context carrier adapter test"() { - given: - def carrier = new CustomContextCarrier() - def keyName = "keyName" - def keyValue = "keyValue" - def extracted = "" - - when: - DataStreamsContextCarrierAdapter.INSTANCE.set(carrier, keyName, keyValue) - DataStreamsContextCarrierAdapter.INSTANCE.forEachKeyValue(carrier, new BiConsumer() { - @Override - void accept(String key, String value) { - if (key == keyName) { - extracted = value - } - } - }) - then: - extracted == keyValue - } - - def "Write group after a delay"() { - given: - def conditions = new PollingConditions(timeout: 1) - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> true - } - def timeSource = new ControllableTimeSource() - def sink = Mock(Sink) - def payloadWriter = new CapturingPayloadWriter() - - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> true - } - - when: - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { traceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.start() - def tg = DataStreamsTags.create("testType", null, "testTopic", "testGroup", null) - dataStreams.add(new StatsPoint(tg, 1, 2, 3, timeSource.currentTimeNanos, 0, 0, 0, null)) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert dataStreams.thread.state != Thread.State.RUNNABLE - assert payloadWriter.buckets.size() == 1 - } - - with(payloadWriter.buckets.get(0)) { - groups.size() == 1 - - with(groups.iterator().next()) { - tags.type == "type:testType" - tags.group == "group:testGroup" - tags.topic == "topic:testTopic" - tags.nonNullSize() == 3 - hash == 1 - parentHash == 2 - } - } - - cleanup: - payloadWriter.close() - dataStreams.close() - } - - // This test relies on automatic reporting instead of manually calling report - def "SLOW Write group after a delay"() { - given: - def conditions = new PollingConditions(timeout: 1) - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> true - } - def timeSource = new ControllableTimeSource() - def sink = Mock(Sink) - def payloadWriter = new CapturingPayloadWriter() - def bucketDuration = TimeUnit.MILLISECONDS.toNanos(200) - - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> true - } - - when: - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { traceConfig }, payloadWriter, bucketDuration) - dataStreams.start() - def tg = DataStreamsTags.create("testType", null, "testTopic", "testGroup", null) - dataStreams.add(new StatsPoint(tg, 1, 2, 3, timeSource.currentTimeNanos, 0, 0, 0, null)) - timeSource.advance(bucketDuration) - - then: - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert dataStreams.thread.state != Thread.State.RUNNABLE - assert payloadWriter.buckets.size() == 1 - } - - with(payloadWriter.buckets.get(0)) { - groups.size() == 1 - - with(groups.iterator().next()) { - tags.type == "type:testType" - tags.group == "group:testGroup" - tags.topic == "topic:testTopic" - tags.nonNullSize() == 3 - hash == 1 - parentHash == 2 - } - } - - cleanup: - payloadWriter.close() - dataStreams.close() - } - - def "Groups for current bucket are not reported"() { - given: - def conditions = new PollingConditions(timeout: 1) - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> true - } - def timeSource = new ControllableTimeSource() - def sink = Mock(Sink) - def payloadWriter = new CapturingPayloadWriter() - - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> true - } - - when: - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { traceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.start() - def tg = DataStreamsTags.create("testType", null, "testTopic", "testGroup", null) - dataStreams.add(new StatsPoint(tg, 1, 2, 3, timeSource.currentTimeNanos, 0, 0, 0, null)) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.add(new StatsPoint(tg, 3, 4, 3, timeSource.currentTimeNanos, 0, 0, 0, null)) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS - 100l) - dataStreams.report() - - then: - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert dataStreams.thread.state != Thread.State.RUNNABLE - assert payloadWriter.buckets.size() == 1 - } - - with(payloadWriter.buckets.get(0)) { - groups.size() == 1 - - with(groups.iterator().next()) { - tags.type == "type:testType" - tags.group == "group:testGroup" - tags.topic == "topic:testTopic" - tags.nonNullSize() == 3 - hash == 1 - parentHash == 2 - } - } - - cleanup: - payloadWriter.close() - dataStreams.close() - } - - def "All groups written in close"() { - given: - def conditions = new PollingConditions(timeout: 1) - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> true - } - def timeSource = new ControllableTimeSource() - def sink = Mock(Sink) - def payloadWriter = new CapturingPayloadWriter() - - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> true - } - - when: - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { traceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.start() - def tg = DataStreamsTags.create("testType", null, "testTopic", "testGroup", null) - def tg2 = DataStreamsTags.create("testType", null, "testTopic2", "testGroup", null) - dataStreams.add(new StatsPoint(tg, 1, 2, 5, timeSource.currentTimeNanos, 0, 0, 0, null)) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.add(new StatsPoint(tg2, 3, 4, 6, timeSource.currentTimeNanos, 0, 0, 0, null)) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS - 100l) - dataStreams.close() - - then: - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert dataStreams.thread.state != Thread.State.RUNNABLE - assert payloadWriter.buckets.size() == 2 - } - - with(payloadWriter.buckets.get(0)) { - groups.size() == 1 - - with(groups.iterator().next()) { - tags.type == "type:testType" - tags.group == "group:testGroup" - tags.topic == "topic:testTopic" - tags.nonNullSize() == 3 - hash == 1 - parentHash == 2 - } - } - - with(payloadWriter.buckets.get(1)) { - groups.size() == 1 - - with(groups.iterator().next()) { - tags.type == "type:testType" - tags.group == "group:testGroup" - tags.topic == "topic:testTopic2" - tags.nonNullSize() == 3 - hash == 3 - parentHash == 4 - } - } - - cleanup: - payloadWriter.close() - } - - def "Kafka offsets are tracked"() { - given: - def conditions = new PollingConditions(timeout: 1) - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> true - } - def timeSource = new ControllableTimeSource() - def sink = Mock(Sink) - def payloadWriter = new CapturingPayloadWriter() - - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> true - } - - when: - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { traceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.start() - dataStreams.trackBacklog(DataStreamsTags.createWithPartition("kafka_commit", "testTopic", "2", null, "testGroup"), 23) - dataStreams.trackBacklog(DataStreamsTags.createWithPartition("kafka_commit", "testTopic", "2", null, "testGroup"), 24) - dataStreams.trackBacklog(DataStreamsTags.createWithPartition("kafka_produce", "testTopic", "2", null, null), 23) - dataStreams.trackBacklog(DataStreamsTags.createWithPartition("kafka_produce", "testTopic2", "2", null, null), 23) - dataStreams.trackBacklog(DataStreamsTags.createWithPartition("kafka_produce", "testTopic", "2", null, null), 45) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert dataStreams.thread.state != Thread.State.RUNNABLE - assert payloadWriter.buckets.size() == 1 - } - - with(payloadWriter.buckets.get(0)) { - backlogs.size() == 3 - def list = backlogs.sort({ it.key.toString() }) - with(list[0]) { - it.key == DataStreamsTags.createWithPartition("kafka_commit", "testTopic", "2", null, "testGroup") - it.value == 24 - } - with(list[1]) { - it.key == DataStreamsTags.createWithPartition("kafka_produce", "testTopic", "2", null, null) - it.value == 45 - } - with(list[2]) { - it.key == DataStreamsTags.createWithPartition("kafka_produce", "testTopic2", "2", null, null) - it.value == 23 - } - } - - cleanup: - payloadWriter.close() - dataStreams.close() - } - - def "Groups from multiple buckets are reported"() { - given: - def conditions = new PollingConditions(timeout: 1) - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> true - } - def timeSource = new ControllableTimeSource() - def sink = Mock(Sink) - def payloadWriter = new CapturingPayloadWriter() - - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> true - } - - when: - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { traceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.start() - def tg = DataStreamsTags.create("testType", null, "testTopic", "testGroup", null) - dataStreams.add(new StatsPoint(tg, 1, 2, 5, timeSource.currentTimeNanos, 0, 0, 0, null)) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS*10) - def tg2 = DataStreamsTags.create("testType", null, "testTopic2", "testGroup", null) - dataStreams.add(new StatsPoint(tg2, 3, 4, 6, timeSource.currentTimeNanos, 0, 0, 0, null)) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert dataStreams.thread.state != Thread.State.RUNNABLE - assert payloadWriter.buckets.size() == 2 - } - - with(payloadWriter.buckets.get(0)) { - groups.size() == 1 - groups - with(groups.iterator().next()) { - tags.nonNullSize() == 3 - tags.getType() == "type:testType" - tags.getGroup() == "group:testGroup" - tags.getTopic() == "topic:testTopic" - hash == 1 - parentHash == 2 - } - } - - with(payloadWriter.buckets.get(1)) { - groups.size() == 1 - - with(groups.iterator().next()) { - tags.getType() == "type:testType" - tags.getGroup() == "group:testGroup" - tags.getTopic() == "topic:testTopic2" - tags.nonNullSize() == 3 - hash == 3 - parentHash == 4 - } - } - - cleanup: - payloadWriter.close() - dataStreams.close() - } - - def "Multiple points are correctly grouped in multiple buckets"() { - given: - def conditions = new PollingConditions(timeout: 1) - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> true - } - def timeSource = new ControllableTimeSource() - def sink = Mock(Sink) - def payloadWriter = new CapturingPayloadWriter() - - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> true - } - - when: - def tg = DataStreamsTags.create("testType", null, "testTopic", "testGroup", null) - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { traceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.start() - dataStreams.add(new StatsPoint(tg, 1, 2, 1, timeSource.currentTimeNanos, 0, 0, 0, null)) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS - 100l) - dataStreams.add(new StatsPoint(tg, 1, 2, 1, timeSource.currentTimeNanos, SECONDS.toNanos(10), SECONDS.toNanos(10), 10, null)) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.add(new StatsPoint(tg, 1, 2,1, timeSource.currentTimeNanos, SECONDS.toNanos(5), SECONDS.toNanos(5), 5, null)) - dataStreams.add(new StatsPoint(tg, 3, 4, 5, timeSource.currentTimeNanos, SECONDS.toNanos(2), 0, 0, null)) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert dataStreams.thread.state != Thread.State.RUNNABLE - assert payloadWriter.buckets.size() == 2 - } - - with(payloadWriter.buckets.get(0)) { - groups.size() == 1 - - with(groups.iterator().next()) { - tags.type == "type:testType" - tags.group == "group:testGroup" - tags.topic == "topic:testTopic" - tags.nonNullSize() == 3 - hash == 1 - parentHash == 2 - Math.abs((pathwayLatency.getMaxValue()-10)/10) < 0.01 - } - } - - with(payloadWriter.buckets.get(1)) { - groups.size() == 2 - - List sortedGroups = new ArrayList<>(groups) - sortedGroups.sort({ it.hash }) - - with(sortedGroups[0]) { - hash == 1 - parentHash == 2 - tags.type == "type:testType" - tags.group == "group:testGroup" - tags.topic == "topic:testTopic" - tags.nonNullSize() == 3 - Math.abs((pathwayLatency.getMaxValue()-5)/5) < 0.01 - } - - with(sortedGroups[1]) { - hash == 3 - parentHash == 4 - tags.type == "type:testType" - tags.group == "group:testGroup" - tags.topic == "topic:testTopic" - tags.nonNullSize() == 3 - Math.abs((pathwayLatency.getMaxValue()-2)/2) < 0.01 - } - } - - cleanup: - payloadWriter.close() - dataStreams.close() - } - - def "feature upgrade"() { - given: - def conditions = new PollingConditions(timeout: 1) - boolean supportsDataStreaming = false - def features = Mock(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> { return supportsDataStreaming } - } - def timeSource = new ControllableTimeSource() - def sink = Mock(Sink) - def payloadWriter = new CapturingPayloadWriter() - - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> true - } - - when: "reporting points when data streams is not supported" - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { traceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.start() - def tg = DataStreamsTags.create("testType", null, "testTopic", "testGroup", null) - dataStreams.add(new StatsPoint(tg, 1, 2, 3, timeSource.currentTimeNanos, 0, 0, 0, null)) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: "no buckets are reported" - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert dataStreams.thread.state != Thread.State.RUNNABLE - } - - payloadWriter.buckets.isEmpty() - - when: "report called multiple times without advancing past check interval" - dataStreams.report() - dataStreams.report() - dataStreams.report() - - then: "features are not rechecked" - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert dataStreams.thread.state != Thread.State.RUNNABLE - } - 0 * features.discover() - payloadWriter.buckets.isEmpty() - - when: "submitting points after an upgrade" - supportsDataStreaming = true - timeSource.advance(FEATURE_CHECK_INTERVAL_NANOS) - dataStreams.report() - - dataStreams.add(new StatsPoint(tg, 1, 2, 3, timeSource.currentTimeNanos, 0, 0, 0, null)) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: "points are now reported" - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert payloadWriter.buckets.size() == 1 - } - - with(payloadWriter.buckets.get(0)) { - groups.size() == 1 - - with(groups.iterator().next()) { - tags.type == "type:testType" - tags.group == "group:testGroup" - tags.topic == "topic:testTopic" - tags.nonNullSize() == 3 - hash == 1 - parentHash == 2 - } - } - - cleanup: - payloadWriter.close() - dataStreams.close() - } - - def "feature downgrade then upgrade"() { - given: - def conditions = new PollingConditions(timeout: 1) - boolean supportsDataStreaming = true - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> { return supportsDataStreaming } - } - def timeSource = new ControllableTimeSource() - def sink = Mock(Sink) - def payloadWriter = new CapturingPayloadWriter() - - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> true - } - - when: "reporting points after a downgrade" - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { traceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.start() - supportsDataStreaming = false - dataStreams.onEvent(EventListener.EventType.DOWNGRADED, "") - def tg = DataStreamsTags.create("testType", null, "testTopic", "testGroup", null) - dataStreams.add(new StatsPoint(tg, 1, 2, 3, timeSource.currentTimeNanos, 0, 0, 0, null)) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: "no buckets are reported" - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert dataStreams.thread.state != Thread.State.RUNNABLE - } - - payloadWriter.buckets.isEmpty() - - when: "submitting points after an upgrade" - supportsDataStreaming = true - timeSource.advance(FEATURE_CHECK_INTERVAL_NANOS) - dataStreams.report() - - dataStreams.add(new StatsPoint(tg, 1, 2, 3, timeSource.currentTimeNanos, 0, 0, 0, null)) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: "points are now reported" - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert payloadWriter.buckets.size() == 1 - } - - with(payloadWriter.buckets.get(0)) { - groups.size() == 1 - - with(groups.iterator().next()) { - tags.type == "type:testType" - tags.group == "group:testGroup" - tags.topic == "topic:testTopic" - tags.nonNullSize() == 3 - hash == 1 - parentHash == 2 - } - } - - cleanup: - payloadWriter.close() - dataStreams.close() - } - - def "dynamic config enable and disable"() { - given: - def conditions = new PollingConditions(timeout: 1) - boolean supportsDataStreaming = true - def features = Mock(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> { return supportsDataStreaming } - } - def timeSource = new ControllableTimeSource() - def sink = Mock(Sink) - def payloadWriter = new CapturingPayloadWriter() - - boolean dsmEnabled = false - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> { return dsmEnabled } - } - - when: "reporting points when data streams is not enabled" - def tg = DataStreamsTags.create("testType", null, "testTopic", "testGroup", null) - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { traceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.start() - dataStreams.add(new StatsPoint(tg, 1, 2, 3, timeSource.currentTimeNanos, 0, 0, 0, null)) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: "no buckets are reported" - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert dataStreams.thread.state != Thread.State.RUNNABLE - } - - payloadWriter.buckets.isEmpty() - - when: "submitting points after dynamically enabled" - dsmEnabled = true - dataStreams.report() - - dataStreams.add(new StatsPoint(tg, 1, 2, 3, timeSource.currentTimeNanos, 0, 0, 0, null)) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: "points are now reported" - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert payloadWriter.buckets.size() == 1 - } - - with(payloadWriter.buckets.get(0)) { - groups.size() == 1 - - with(groups.iterator().next()) { - tags.type == "type:testType" - tags.group == "group:testGroup" - tags.topic == "topic:testTopic" - tags.nonNullSize() == 3 - hash == 1 - parentHash == 2 - } - } - - when: "disabling data streams dynamically" - dsmEnabled = false - dataStreams.report() - - then: "inbox is processed" - conditions.eventually { - assert dataStreams.inbox.isEmpty() - } - - when: "submitting points after being disabled" - payloadWriter.buckets.clear() - - dataStreams.add(new StatsPoint(tg, 1, 2, 3, timeSource.currentTimeNanos, 0, 0, 0, null)) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: "points are no longer reported" - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert payloadWriter.buckets.isEmpty() - } - - cleanup: - payloadWriter.close() - dataStreams.close() - } - - def "feature and dynamic config upgrade interactions"() { - given: - def conditions = new PollingConditions(timeout: 1) - boolean supportsDataStreaming = false - def features = Mock(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> { return supportsDataStreaming } - } - def timeSource = new ControllableTimeSource() - def sink = Mock(Sink) - def payloadWriter = new CapturingPayloadWriter() - - boolean dsmEnabled = false - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> { return dsmEnabled } - } - - when: "reporting points when data streams is not supported" - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { traceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.start() - def tg = DataStreamsTags.create("testType", null, "testTopic", "testGroup", null) - dataStreams.add(new StatsPoint(tg, 1, 2, 3, timeSource.currentTimeNanos, 0, 0, 0, null)) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: "no buckets are reported" - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert dataStreams.thread.state != Thread.State.RUNNABLE - } - - payloadWriter.buckets.isEmpty() - - when: "submitting points after an upgrade with dsm disabled" - supportsDataStreaming = true - timeSource.advance(FEATURE_CHECK_INTERVAL_NANOS) - dataStreams.report() - - dataStreams.add(new StatsPoint(tg, 1, 2, 3, timeSource.currentTimeNanos, 0, 0, 0, null)) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: "points are not reported" - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert payloadWriter.buckets.isEmpty() - } - - when: "dsm is enabled dynamically" - dsmEnabled = true - dataStreams.report() - - dataStreams.add(new StatsPoint(tg, 1, 2, 3, timeSource.currentTimeNanos, 0, 0, 0, null)) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: "points are now reported" - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert payloadWriter.buckets.size() == 1 - } - - with(payloadWriter.buckets.get(0)) { - groups.size() == 1 - - with(groups.iterator().next()) { - tags.type == "type:testType" - tags.group == "group:testGroup" - tags.topic == "topic:testTopic" - tags.nonNullSize() == 3 - hash == 1 - parentHash == 2 - } - } - - cleanup: - payloadWriter.close() - dataStreams.close() - } - - def "more feature and dynamic config upgrade interactions"() { - given: - def conditions = new PollingConditions(timeout: 1) - boolean supportsDataStreaming = false - def features = Mock(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> { return supportsDataStreaming } - } - def timeSource = new ControllableTimeSource() - def sink = Mock(Sink) - def payloadWriter = new CapturingPayloadWriter() - - boolean dsmEnabled = false - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> { return dsmEnabled } - } - - when: "reporting points when data streams is not supported" - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { traceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.start() - def tg = DataStreamsTags.create("testType", null, "testTopic", "testGroup", null) - dataStreams.add(new StatsPoint(tg, 1, 2, 3, timeSource.currentTimeNanos, 0, 0, 0, null)) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: "no buckets are reported" - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert dataStreams.thread.state != Thread.State.RUNNABLE - } - - payloadWriter.buckets.isEmpty() - - when: "enabling dsm when not supported by agent" - dsmEnabled = true - dataStreams.report() - - dataStreams.add(new StatsPoint(tg, 1, 2, 3, timeSource.currentTimeNanos, 0, 0, 0, null)) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: "points are not reported" - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert payloadWriter.buckets.isEmpty() - } - - cleanup: - payloadWriter.close() - dataStreams.close() - } - - def "Schema registry usages are aggregated by operation"() { - given: - def conditions = new PollingConditions(timeout: 2) - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> true - } - def timeSource = new ControllableTimeSource() - def payloadWriter = new CapturingPayloadWriter() - def sink = Mock(Sink) - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> true - } - - when: - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { traceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.start() - - // Record serialize and deserialize operations - dataStreams.reportSchemaRegistryUsage("test-topic", "test-cluster", 123, true, false, "serialize") - dataStreams.reportSchemaRegistryUsage("test-topic", "test-cluster", 123, true, false, "serialize") // duplicate serialize - dataStreams.reportSchemaRegistryUsage("test-topic", "test-cluster", 123, true, false, "deserialize") - dataStreams.reportSchemaRegistryUsage("test-topic", "test-cluster", 456, true, true, "serialize") // different schema/key - - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert dataStreams.thread.state != Thread.State.RUNNABLE - assert payloadWriter.buckets.size() == 1 - } - - with(payloadWriter.buckets.get(0)) { - schemaRegistryUsages.size() == 3 // 3 unique combinations - - // Find serialize operation for schema 123 (should have count 2) - def serializeUsage = schemaRegistryUsages.find { e -> - e.key.schemaId == 123 && e.key.operation == "serialize" && !e.key.isKey - } - serializeUsage != null - serializeUsage.value == 2L // Aggregated 2 serialize operations - - // Find deserialize operation for schema 123 (should have count 1) - def deserializeUsage = schemaRegistryUsages.find { e -> - e.key.schemaId == 123 && e.key.operation == "deserialize" && !e.key.isKey - } - deserializeUsage != null - deserializeUsage.value == 1L - - // Find serialize operation for schema 456 with isKey=true (should have count 1) - def keySerializeUsage = schemaRegistryUsages.find { e -> - e.key.schemaId == 456 && e.key.operation == "serialize" && e.key.isKey - } - keySerializeUsage != null - keySerializeUsage.value == 1L - } - - cleanup: - payloadWriter.close() - dataStreams.close() - } - - def "SchemaKey equals and hashCode work correctly"() { - given: - def key1 = new StatsBucket.SchemaKey("topic1", "cluster1", 123, true, false, "serialize") - def key2 = new StatsBucket.SchemaKey("topic1", "cluster1", 123, true, false, "serialize") - def key3 = new StatsBucket.SchemaKey("topic2", "cluster1", 123, true, false, "serialize") // different topic - def key4 = new StatsBucket.SchemaKey("topic1", "cluster2", 123, true, false, "serialize") // different cluster - def key5 = new StatsBucket.SchemaKey("topic1", "cluster1", 456, true, false, "serialize") // different schema - def key6 = new StatsBucket.SchemaKey("topic1", "cluster1", 123, false, false, "serialize") // different success - def key7 = new StatsBucket.SchemaKey("topic1", "cluster1", 123, true, true, "serialize") // different isKey - def key8 = new StatsBucket.SchemaKey("topic1", "cluster1", 123, true, false, "deserialize") // different operation - - expect: - // Reflexive - key1.equals(key1) - key1.hashCode() == key1.hashCode() - - // Symmetric - key1.equals(key2) - key2.equals(key1) - key1.hashCode() == key2.hashCode() - - // Different topic - !key1.equals(key3) - !key3.equals(key1) - - // Different cluster - !key1.equals(key4) - !key4.equals(key1) - - // Different schema ID - !key1.equals(key5) - !key5.equals(key1) - - // Different success - !key1.equals(key6) - !key6.equals(key1) - - // Different isKey - !key1.equals(key7) - !key7.equals(key1) - - // Different operation - !key1.equals(key8) - !key8.equals(key1) - - // Null check - !key1.equals(null) - - // Different class - !key1.equals("not a schema key") - } - - def "StatsBucket aggregates schema registry usages correctly"() { - given: - def bucket = new StatsBucket(1000L, 10000L) - def usage1 = new SchemaRegistryUsage("topic1", "cluster1", 123, true, false, "serialize", 1000L, null) - def usage2 = new SchemaRegistryUsage("topic1", "cluster1", 123, true, false, "serialize", 2000L, null) - def usage3 = new SchemaRegistryUsage("topic1", "cluster1", 123, true, false, "deserialize", 3000L, null) - - when: - bucket.addSchemaRegistryUsage(usage1) - bucket.addSchemaRegistryUsage(usage2) // should increment count for same key - bucket.addSchemaRegistryUsage(usage3) // different operation, new key - - def usages = bucket.getSchemaRegistryUsages() - def usageMap = usages.collectEntries { [(it.key): it.value] } - - then: - usages.size() == 2 - - // Check serialize count - def serializeKey = new StatsBucket.SchemaKey("topic1", "cluster1", 123, true, false, "serialize") - usageMap[serializeKey] == 2L - - // Check deserialize count - def deserializeKey = new StatsBucket.SchemaKey("topic1", "cluster1", 123, true, false, "deserialize") - usageMap[deserializeKey] == 1L - - // Check that different operations create different keys - serializeKey != deserializeKey - } - - def "Kafka producer config is reported in bucket"() { - given: - def conditions = new PollingConditions(timeout: 1) - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> true - } - def timeSource = new ControllableTimeSource() - def sink = Mock(Sink) - def payloadWriter = new CapturingPayloadWriter() - - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> true - } - - when: - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { traceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.start() - dataStreams.reportKafkaConfig("kafka_producer", "", "", ["bootstrap.servers": "localhost:9092", "acks": "all"]) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert dataStreams.thread.state != Thread.State.RUNNABLE - assert payloadWriter.buckets.size() == 1 - } - - with(payloadWriter.buckets.get(0)) { - kafkaConfigs.size() == 1 - with(kafkaConfigs.get(0)) { - type == "kafka_producer" - config["bootstrap.servers"] == "localhost:9092" - config["acks"] == "all" - } - } - - cleanup: - payloadWriter.close() - dataStreams.close() - } - - def "Kafka consumer config is reported in bucket"() { - given: - def conditions = new PollingConditions(timeout: 1) - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> true - } - def timeSource = new ControllableTimeSource() - def sink = Mock(Sink) - def payloadWriter = new CapturingPayloadWriter() - - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> true - } - - when: - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { traceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.start() - dataStreams.reportKafkaConfig("kafka_consumer", "", "test-group", ["bootstrap.servers": "localhost:9092", "group.id": "test-group", "auto.offset.reset": "earliest"]) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert dataStreams.thread.state != Thread.State.RUNNABLE - assert payloadWriter.buckets.size() == 1 - } - - with(payloadWriter.buckets.get(0)) { - kafkaConfigs.size() == 1 - with(kafkaConfigs.get(0)) { - type == "kafka_consumer" - config["bootstrap.servers"] == "localhost:9092" - config["group.id"] == "test-group" - config["auto.offset.reset"] == "earliest" - } - } - - cleanup: - payloadWriter.close() - dataStreams.close() - } - - def "Duplicate Kafka configs are each reported in the bucket"() { - given: - def conditions = new PollingConditions(timeout: 1) - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> true - } - def timeSource = new ControllableTimeSource() - def sink = Mock(Sink) - def payloadWriter = new CapturingPayloadWriter() - - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> true - } - - when: "reporting the same config twice" - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { traceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.start() - def config1 = ["bootstrap.servers": "localhost:9092", "acks": "all"] - def config2 = ["bootstrap.servers": "localhost:9092", "acks": "all"] - dataStreams.reportKafkaConfig("kafka_producer", "", "", config1) - dataStreams.reportKafkaConfig("kafka_producer", "", "", config2) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: "both configs are reported in the bucket" - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert dataStreams.thread.state != Thread.State.RUNNABLE - assert payloadWriter.buckets.size() == 1 - } - - with(payloadWriter.buckets.get(0)) { - kafkaConfigs.size() == 2 - kafkaConfigs.every { it.type == "kafka_producer" } - kafkaConfigs.every { it.config["bootstrap.servers"] == "localhost:9092" } - kafkaConfigs.every { it.config["acks"] == "all" } - } - - cleanup: - payloadWriter.close() - dataStreams.close() - } - - def "Kafka configs reported in separate buckets appear in each bucket"() { - given: - def conditions = new PollingConditions(timeout: 1) - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> true - } - def timeSource = new ControllableTimeSource() - def sink = Mock(Sink) - def payloadWriter = new CapturingPayloadWriter() - - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> true - } - - when: "reporting a config in the first bucket" - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { traceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.start() - def config = ["bootstrap.servers": "localhost:9092", "acks": "all"] - dataStreams.reportKafkaConfig("kafka_producer", "", "", config) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: "first bucket has the config" - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert dataStreams.thread.state != Thread.State.RUNNABLE - assert payloadWriter.buckets.size() == 1 - } - - with(payloadWriter.buckets.get(0)) { - kafkaConfigs.size() == 1 - } - - when: "reporting the same config again in a new bucket" - payloadWriter.buckets.clear() - dataStreams.reportKafkaConfig("kafka_producer", "", "", config) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: "second bucket also has the config" - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert dataStreams.thread.state != Thread.State.RUNNABLE - assert payloadWriter.buckets.size() == 1 - } - - with(payloadWriter.buckets.get(0)) { - kafkaConfigs.size() == 1 - with(kafkaConfigs.get(0)) { - type == "kafka_producer" - config["bootstrap.servers"] == "localhost:9092" - config["acks"] == "all" - } - } - - cleanup: - payloadWriter.close() - dataStreams.close() - } - - def "Different Kafka configs are both reported"() { - given: - def conditions = new PollingConditions(timeout: 1) - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> true - } - def timeSource = new ControllableTimeSource() - def sink = Mock(Sink) - def payloadWriter = new CapturingPayloadWriter() - - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> true - } - - when: "reporting producer and consumer configs" - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { traceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.start() - dataStreams.reportKafkaConfig("kafka_producer", "", "", ["bootstrap.servers": "localhost:9092", "acks": "all"]) - dataStreams.reportKafkaConfig("kafka_consumer", "", "my-group", ["bootstrap.servers": "localhost:9092", "group.id": "my-group"]) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: "both configs are reported" - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert dataStreams.thread.state != Thread.State.RUNNABLE - assert payloadWriter.buckets.size() == 1 - } - - with(payloadWriter.buckets.get(0)) { - kafkaConfigs.size() == 2 - - def producerConfig = kafkaConfigs.find { it.type == "kafka_producer" } - producerConfig != null - producerConfig.config["bootstrap.servers"] == "localhost:9092" - producerConfig.config["acks"] == "all" - - def consumerConfig = kafkaConfigs.find { it.type == "kafka_consumer" } - consumerConfig != null - consumerConfig.config["bootstrap.servers"] == "localhost:9092" - consumerConfig.config["group.id"] == "my-group" - } - - cleanup: - payloadWriter.close() - dataStreams.close() - } - - def "Kafka configs with different values for same type are not deduplicated"() { - given: - def conditions = new PollingConditions(timeout: 1) - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> true - } - def timeSource = new ControllableTimeSource() - def sink = Mock(Sink) - def payloadWriter = new CapturingPayloadWriter() - - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> true - } - - when: "reporting two producer configs with different settings" - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { traceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.start() - dataStreams.reportKafkaConfig("kafka_producer", "", "", ["bootstrap.servers": "localhost:9092", "acks": "all"]) - dataStreams.reportKafkaConfig("kafka_producer", "", "", ["bootstrap.servers": "localhost:9093", "acks": "1"]) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: "both configs are reported because they have different values" - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert dataStreams.thread.state != Thread.State.RUNNABLE - assert payloadWriter.buckets.size() == 1 - } - - with(payloadWriter.buckets.get(0)) { - kafkaConfigs.size() == 2 - } - - cleanup: - payloadWriter.close() - dataStreams.close() - } - - def "Kafka configs are reported alongside stats points"() { - given: - def conditions = new PollingConditions(timeout: 1) - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> true - } - def timeSource = new ControllableTimeSource() - def sink = Mock(Sink) - def payloadWriter = new CapturingPayloadWriter() - - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> true - } - - when: "reporting both stats points and kafka configs" - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { traceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.start() - def tg = DataStreamsTags.create("testType", null, "testTopic", "testGroup", null) - dataStreams.add(new StatsPoint(tg, 1, 2, 3, timeSource.currentTimeNanos, 0, 0, 0, null)) - dataStreams.reportKafkaConfig("kafka_producer", "", "", ["bootstrap.servers": "localhost:9092"]) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: "bucket contains both stats groups and kafka configs" - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert dataStreams.thread.state != Thread.State.RUNNABLE - assert payloadWriter.buckets.size() == 1 - } - - with(payloadWriter.buckets.get(0)) { - groups.size() == 1 - kafkaConfigs.size() == 1 - - with(groups.iterator().next()) { - tags.type == "type:testType" - hash == 1 - parentHash == 2 - } - - with(kafkaConfigs.get(0)) { - type == "kafka_producer" - config["bootstrap.servers"] == "localhost:9092" - } - } - - cleanup: - payloadWriter.close() - dataStreams.close() - } - - def "Kafka configs not reported when DSM is disabled"() { - given: - def conditions = new PollingConditions(timeout: 1) - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> enabledAtAgent - } - def timeSource = new ControllableTimeSource() - def payloadWriter = new CapturingPayloadWriter() - def sink = Mock(Sink) - - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> enabledInConfig - } - - when: - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { traceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.start() - dataStreams.reportKafkaConfig("kafka_producer", "", "", ["bootstrap.servers": "localhost:9092"]) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.report() - - then: - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert dataStreams.thread.state != Thread.State.RUNNABLE - } - payloadWriter.buckets.isEmpty() - - cleanup: - payloadWriter.close() - dataStreams.close() - - where: - enabledAtAgent | enabledInConfig - false | true - true | false - false | false - } - - def "Kafka configs flushed on close"() { - given: - def conditions = new PollingConditions(timeout: 1) - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> true - } - def timeSource = new ControllableTimeSource() - def sink = Mock(Sink) - def payloadWriter = new CapturingPayloadWriter() - - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> true - } - - when: - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { traceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - dataStreams.start() - dataStreams.reportKafkaConfig("kafka_producer", "", "", ["bootstrap.servers": "localhost:9092"]) - timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS - 100l) - dataStreams.close() - - then: "configs in the current bucket are flushed on close" - conditions.eventually { - assert dataStreams.inbox.isEmpty() - assert dataStreams.thread.state != Thread.State.RUNNABLE - assert payloadWriter.buckets.size() == 1 - } - - with(payloadWriter.buckets.get(0)) { - kafkaConfigs.size() == 1 - with(kafkaConfigs.get(0)) { - type == "kafka_producer" - config["bootstrap.servers"] == "localhost:9092" - } - } - - cleanup: - payloadWriter.close() - } - - def "KafkaConfigReport equals and hashCode work correctly"() { - given: - def config1 = new KafkaConfigReport("kafka_producer", "", "", ["bootstrap.servers": "localhost:9092", "acks": "all"], 1000L, null) - def config2 = new KafkaConfigReport("kafka_producer", "", "", ["bootstrap.servers": "localhost:9092", "acks": "all"], 2000L, null) - def config3 = new KafkaConfigReport("kafka_consumer", "", "", ["bootstrap.servers": "localhost:9092", "acks": "all"], 1000L, null) - def config4 = new KafkaConfigReport("kafka_producer", "", "", ["bootstrap.servers": "localhost:9093"], 1000L, null) - def config5 = new KafkaConfigReport("kafka_producer", "", "", ["bootstrap.servers": "localhost:9092", "acks": "all"], 1000L, "other-service") - - expect: - // Reflexive - config1.equals(config1) - config1.hashCode() == config1.hashCode() - - // Same type and config, different timestamp -- equals (timestamp is NOT part of equals) - config1.equals(config2) - config2.equals(config1) - config1.hashCode() == config2.hashCode() - - // Same type and config, different serviceNameOverride -- equals (serviceNameOverride is NOT part of equals) - config1.equals(config5) - config5.equals(config1) - config1.hashCode() == config5.hashCode() - - // Different type - !config1.equals(config3) - !config3.equals(config1) - - // Different config values - !config1.equals(config4) - !config4.equals(config1) - - // Null check - !config1.equals(null) - - // Different class - !config1.equals("not a config report") - } - - def "StatsBucket stores Kafka configs"() { - given: - def bucket = new StatsBucket(1000L, 10000L) - def config1 = new KafkaConfigReport("kafka_producer", "", "", ["acks": "all"], 1000L, null) - def config2 = new KafkaConfigReport("kafka_consumer", "", "test", ["group.id": "test"], 2000L, null) - - when: - bucket.addKafkaConfig(config1) - bucket.addKafkaConfig(config2) - - then: - bucket.getKafkaConfigs().size() == 2 - bucket.getKafkaConfigs().get(0).type == "kafka_producer" - bucket.getKafkaConfigs().get(0).config["acks"] == "all" - bucket.getKafkaConfigs().get(1).type == "kafka_consumer" - bucket.getKafkaConfigs().get(1).config["group.id"] == "test" - } -} - -class CapturingPayloadWriter implements DatastreamsPayloadWriter { - boolean accepting = true - List buckets = new ArrayList<>() - - void writePayload(Collection payload, String serviceNameOverride) { - if (accepting) { - buckets.addAll(payload) - } - } - - void close() { - // Stop accepting new buckets so any late submissions by the reporting thread aren't seen - accepting = false - } -} - -class CustomContextCarrier implements DataStreamsContextCarrier { - - private Map data = new HashMap<>() - - @Override - Set> entries() { - return data.entrySet() - } - - @Override - void set(String key, String value) { - data.put(key, value) - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/DefaultPathwayContextTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/DefaultPathwayContextTest.groovy deleted file mode 100644 index 43f75f5052b..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/DefaultPathwayContextTest.groovy +++ /dev/null @@ -1,653 +0,0 @@ -package datadog.trace.core.datastreams - -import datadog.communication.ddagent.DDAgentFeaturesDiscovery -import datadog.trace.api.BaseHash -import datadog.trace.api.Config -import datadog.trace.api.DDTraceId -import datadog.trace.api.TagMap -import datadog.trace.api.TraceConfig -import datadog.trace.api.datastreams.DataStreamsTags -import datadog.trace.api.datastreams.StatsPoint -import datadog.trace.api.time.ControllableTimeSource -import datadog.trace.bootstrap.instrumentation.api.AgentPropagation -import datadog.trace.bootstrap.instrumentation.api.AgentSpan -import datadog.trace.bootstrap.instrumentation.api.AgentTracer -import datadog.trace.common.metrics.Sink -import datadog.trace.core.propagation.ExtractedContext -import datadog.trace.core.test.DDCoreSpecification -import java.util.function.Consumer -import static datadog.context.Context.root -import static datadog.trace.api.TracePropagationStyle.DATADOG -import static datadog.trace.api.datastreams.DataStreamsContext.create -import static datadog.trace.api.datastreams.DataStreamsContext.fromTags -import static datadog.trace.api.datastreams.PathwayContext.PROPAGATION_KEY_BASE64 -import static java.util.concurrent.TimeUnit.MILLISECONDS - -class DefaultPathwayContextTest extends DDCoreSpecification { - long baseHash = 12 - - static final DEFAULT_BUCKET_DURATION_NANOS = Config.get().getDataStreamsBucketDurationNanoseconds() - def pointConsumer = new Consumer() { - List points = [] - - @Override - void accept(StatsPoint point) { - points.add(point) - } - } - - void verifyFirstPoint(StatsPoint point) { - assert point.parentHash == 0 - assert point.pathwayLatencyNano == 0 - assert point.edgeLatencyNano == 0 - assert point.payloadSizeBytes == 0 - } - - def "First Set checkpoint starts the context."() { - given: - def timeSource = new ControllableTimeSource() - def context = new DefaultPathwayContext(timeSource, null) - - when: - timeSource.advance(50) - context.setCheckpoint(fromTags(DataStreamsTags.create("internal", null)), pointConsumer) - - then: - context.isStarted() - pointConsumer.points.size() == 1 - verifyFirstPoint(pointConsumer.points[0]) - } - - def "Checkpoint generated"() { - given: - def timeSource = new ControllableTimeSource() - def context = new DefaultPathwayContext(timeSource, null) - - when: - timeSource.advance(50) - context.setCheckpoint(fromTags(DataStreamsTags.create("internal", DataStreamsTags.Direction.INBOUND)), pointConsumer) - timeSource.advance(25) - def tags = DataStreamsTags.create("kafka", DataStreamsTags.Direction.OUTBOUND, "topic", "group", null) - context.setCheckpoint(fromTags(tags), pointConsumer) - - then: - context.isStarted() - pointConsumer.points.size() == 2 - verifyFirstPoint(pointConsumer.points[0]) - with(pointConsumer.points[1]) { - tags.group == "group:group" - tags.topic == "topic:topic" - tags.type == "type:kafka" - tags.getDirection() == "direction:out" - tags.nonNullSize() == 4 - parentHash == pointConsumer.points[0].hash - hash != 0 - pathwayLatencyNano == 25 - edgeLatencyNano == 25 - } - } - - def "Checkpoint with payload size"() { - given: - def timeSource = new ControllableTimeSource() - def context = new DefaultPathwayContext(timeSource, null) - - when: - timeSource.advance(25) - context.setCheckpoint( - create(DataStreamsTags.create("kafka", null, "topic", "group", null), 0, 72), - pointConsumer) - - then: - context.isStarted() - pointConsumer.points.size() == 1 - with(pointConsumer.points[0]) { - tags.getGroup() == "group:group" - tags.getTopic() == "topic:topic" - tags.getType() == "type:kafka" - tags.nonNullSize() == 3 - hash != 0 - payloadSizeBytes == 72 - } - } - - def "Multiple checkpoints generated"() { - given: - def timeSource = new ControllableTimeSource() - def context = new DefaultPathwayContext(timeSource, null) - - when: - timeSource.advance(50) - context.setCheckpoint(fromTags(DataStreamsTags.create("kafka", DataStreamsTags.Direction.OUTBOUND)), pointConsumer) - timeSource.advance(25) - def tg = DataStreamsTags.create("kafka", DataStreamsTags.Direction.INBOUND, "topic", "group", null) - context.setCheckpoint(fromTags(tg), pointConsumer) - timeSource.advance(30) - context.setCheckpoint(fromTags(tg), pointConsumer) - - then: - context.isStarted() - pointConsumer.points.size() == 3 - verifyFirstPoint(pointConsumer.points[0]) - with(pointConsumer.points[1]) { - tags.nonNullSize() == 4 - tags.direction == "direction:in" - tags.group == "group:group" - tags.topic == "topic:topic" - tags.type == "type:kafka" - parentHash == pointConsumer.points[0].hash - hash != 0 - pathwayLatencyNano == 25 - edgeLatencyNano == 25 - } - with(pointConsumer.points[2]) { - tags.nonNullSize() == 4 - tags.direction == "direction:in" - tags.group == "group:group" - tags.topic == "topic:topic" - tags.type == "type:kafka" - // this point should have the first point as parent, - // as the loop protection will reset the parent if two identical - // points (same hash for tag values) are about to form a hierarchy - parentHash == pointConsumer.points[0].hash - hash != 0 - pathwayLatencyNano == 55 - edgeLatencyNano == 30 - } - } - - def "Exception thrown when trying to encode unstarted context"() { - given: - def timeSource = new ControllableTimeSource() - def context = new DefaultPathwayContext(timeSource, null) - - when: - context.encode() - - then: - thrown(IllegalStateException) - } - - def "Set checkpoint with dataset tags"() { - given: - def timeSource = new ControllableTimeSource() - def context = new DefaultPathwayContext(timeSource, null) - - when: - timeSource.advance(MILLISECONDS.toNanos(50)) - context.setCheckpoint(fromTags(DataStreamsTags.createWithDataset("s3", DataStreamsTags.Direction.INBOUND, null, "my_object.csv", "my_bucket")), pointConsumer) - def encoded = context.encode() - timeSource.advance(MILLISECONDS.toNanos(2)) - def decodedContext = DefaultPathwayContext.decode(timeSource, null, encoded) - timeSource.advance(MILLISECONDS.toNanos(25)) - def tg = DataStreamsTags.createWithDataset("s3", DataStreamsTags.Direction.OUTBOUND, null, "my_object.csv", "my_bucket") - context.setCheckpoint(fromTags(tg), pointConsumer) - - then: - decodedContext.isStarted() - pointConsumer.points.size() == 2 - - // all points should have datasetHash, which is not equal to hash or 0 - for (def i = 0; i < pointConsumer.points.size(); i++){ - pointConsumer.points[i].aggregationHash != pointConsumer.points[i].hash - pointConsumer.points[i].aggregationHash != 0 - } - } - - def "Encoding and decoding (base64) a context"() { - // Timesource needs to be advanced in milliseconds because encoding truncates to millis - given: - def timeSource = new ControllableTimeSource() - def context = new DefaultPathwayContext(timeSource, null) - - when: - timeSource.advance(MILLISECONDS.toNanos(50)) - context.setCheckpoint(fromTags(DataStreamsTags.create("internal", DataStreamsTags.Direction.INBOUND)), pointConsumer) - def encoded = context.encode() - timeSource.advance(MILLISECONDS.toNanos(2)) - def decodedContext = DefaultPathwayContext.decode(timeSource, null, encoded) - timeSource.advance(MILLISECONDS.toNanos(25)) - context.setCheckpoint(fromTags(DataStreamsTags.create("kafka", null, "topic", "group", null)), pointConsumer) - - then: - decodedContext.isStarted() - pointConsumer.points.size() == 2 - - with(pointConsumer.points[1]) { - tags.nonNullSize() == 3 - tags.getGroup() == "group:group" - tags.getType() == "type:kafka" - tags.getTopic() == "topic:topic" - parentHash == pointConsumer.points[0].hash - hash != 0 - pathwayLatencyNano == MILLISECONDS.toNanos(27) - edgeLatencyNano == MILLISECONDS.toNanos(27) - } - } - - def "Set checkpoint with timestamp"() { - given: - def timeSource = new ControllableTimeSource() - def context = new DefaultPathwayContext(timeSource, null) - def timeFromQueue = timeSource.getCurrentTimeMillis() - 200 - when: - context.setCheckpoint(create(DataStreamsTags.create("internal", null), timeFromQueue, 0), pointConsumer) - then: - context.isStarted() - pointConsumer.points.size() == 1 - with(pointConsumer.points[0]) { - tags.getType() == "type:internal" - tags.nonNullSize() == 1 - parentHash == 0 - hash != 0 - pathwayLatencyNano == MILLISECONDS.toNanos(200) - edgeLatencyNano == MILLISECONDS.toNanos(200) - } - } - - def "Encoding and decoding (base64) with contexts and checkpoints"() { - // Timesource needs to be advanced in milliseconds because encoding truncates to millis - given: - def timeSource = new ControllableTimeSource() - def context = new DefaultPathwayContext(timeSource, null) - - when: - timeSource.advance(MILLISECONDS.toNanos(50)) - context.setCheckpoint(fromTags(DataStreamsTags.create("internal", DataStreamsTags.Direction.INBOUND)), pointConsumer) - - def encoded = context.encode() - timeSource.advance(MILLISECONDS.toNanos(1)) - def decodedContext = DefaultPathwayContext.decode(timeSource, null, encoded) - timeSource.advance(MILLISECONDS.toNanos(25)) - context.setCheckpoint(fromTags(DataStreamsTags.create("kafka", DataStreamsTags.Direction.OUTBOUND, "topic", "group", null)), pointConsumer) - - then: - decodedContext.isStarted() - pointConsumer.points.size() == 2 - with(pointConsumer.points[1]) { - tags.group == "group:group" - tags.topic == "topic:topic" - tags.type == "type:kafka" - tags.direction == "direction:out" - tags.nonNullSize() == 4 - parentHash == pointConsumer.points[0].hash - hash != 0 - pathwayLatencyNano == MILLISECONDS.toNanos(26) - edgeLatencyNano == MILLISECONDS.toNanos(26) - } - - when: - def secondEncode = decodedContext.encode() - timeSource.advance(MILLISECONDS.toNanos(2)) - def secondDecode = DefaultPathwayContext.decode(timeSource, null, secondEncode) - timeSource.advance(MILLISECONDS.toNanos(30)) - context.setCheckpoint(fromTags(DataStreamsTags.create("kafka", DataStreamsTags.Direction.INBOUND, "topicB", "group", null)), pointConsumer) - - then: - secondDecode.isStarted() - pointConsumer.points.size() == 3 - with(pointConsumer.points[2]) { - tags.group == "group:group" - tags.topic == "topic:topicB" - tags.type == "type:kafka" - tags.direction == "direction:in" - tags.nonNullSize() == 4 - parentHash == pointConsumer.points[1].hash - hash != 0 - pathwayLatencyNano == MILLISECONDS.toNanos(58) - edgeLatencyNano == MILLISECONDS.toNanos(32) - } - } - - def "Encoding and decoding (base64) with injects and extracts"() { - // Timesource needs to be advanced in milliseconds because encoding truncates to millis - given: - def timeSource = new ControllableTimeSource() - def context = new DefaultPathwayContext(timeSource, null) - def contextVisitor = new Base64MapContextVisitor() - - when: - timeSource.advance(MILLISECONDS.toNanos(50)) - context.setCheckpoint(fromTags(DataStreamsTags.create("internal", DataStreamsTags.Direction.INBOUND)), pointConsumer) - - def encoded = context.encode() - Map carrier = [(PROPAGATION_KEY_BASE64): encoded, "someotherkey": "someothervalue"] - timeSource.advance(MILLISECONDS.toNanos(1)) - def decodedContext = DefaultPathwayContext.extract(carrier, contextVisitor, timeSource, null) - timeSource.advance(MILLISECONDS.toNanos(25)) - context.setCheckpoint(fromTags(DataStreamsTags.create("kafka", DataStreamsTags.Direction.OUTBOUND, "topic", "group", null)), pointConsumer) - - then: - decodedContext.isStarted() - pointConsumer.points.size() == 2 - with(pointConsumer.points[1]) { - tags.nonNullSize() == 4 - tags.group == "group:group" - tags.topic == "topic:topic" - tags.type == "type:kafka" - tags.direction == "direction:out" - parentHash == pointConsumer.points[0].hash - hash != 0 - pathwayLatencyNano == MILLISECONDS.toNanos(26) - edgeLatencyNano == MILLISECONDS.toNanos(26) - } - - when: - def secondEncode = decodedContext.encode() - carrier = [(PROPAGATION_KEY_BASE64): secondEncode] - timeSource.advance(MILLISECONDS.toNanos(2)) - def secondDecode = DefaultPathwayContext.extract(carrier, contextVisitor, timeSource, null) - timeSource.advance(MILLISECONDS.toNanos(30)) - context.setCheckpoint(fromTags(DataStreamsTags.create("kafka", DataStreamsTags.Direction.INBOUND, "topicB", "group", null)), pointConsumer) - - then: - secondDecode.isStarted() - pointConsumer.points.size() == 3 - with(pointConsumer.points[2]) { - tags.nonNullSize() == 4 - tags.group == "group:group" - tags.topic == "topic:topicB" - tags.type == "type:kafka" - tags.direction == "direction:in" - parentHash == pointConsumer.points[1].hash - hash != 0 - pathwayLatencyNano == MILLISECONDS.toNanos(58) - edgeLatencyNano == MILLISECONDS.toNanos(32) - } - } - - def "Encoding and decoding (SQS-formatted) with injects and extracts"() { - // Timesource needs to be advanced in milliseconds because encoding truncates to millis - given: - def timeSource = new ControllableTimeSource() - def context = new DefaultPathwayContext(timeSource, null) - def contextVisitor = new Base64MapContextVisitor() - - when: - timeSource.advance(MILLISECONDS.toNanos(50)) - context.setCheckpoint(fromTags(DataStreamsTags.create("internal", DataStreamsTags.Direction.INBOUND)), pointConsumer) - - def encoded = context.encode() - Map carrier = [(PROPAGATION_KEY_BASE64): encoded, "someotherkey": "someothervalue"] - timeSource.advance(MILLISECONDS.toNanos(1)) - def decodedContext = DefaultPathwayContext.extract(carrier, contextVisitor, timeSource, null) - timeSource.advance(MILLISECONDS.toNanos(25)) - context.setCheckpoint(fromTags(DataStreamsTags.create("sqs", DataStreamsTags.Direction.OUTBOUND, "topic", null, null)), pointConsumer) - - then: - decodedContext.isStarted() - pointConsumer.points.size() == 2 - with(pointConsumer.points[1]) { - tags.direction == "direction:out" - tags.topic == "topic:topic" - tags.type == "type:sqs" - tags.nonNullSize() == 3 - parentHash == pointConsumer.points[0].hash - hash != 0 - pathwayLatencyNano == MILLISECONDS.toNanos(26) - edgeLatencyNano == MILLISECONDS.toNanos(26) - } - - when: - def secondEncode = decodedContext.encode() - carrier = [(PROPAGATION_KEY_BASE64): secondEncode] - timeSource.advance(MILLISECONDS.toNanos(2)) - def secondDecode = DefaultPathwayContext.extract(carrier, contextVisitor, timeSource, null) - timeSource.advance(MILLISECONDS.toNanos(30)) - context.setCheckpoint(fromTags(DataStreamsTags.create("sqs", DataStreamsTags.Direction.INBOUND, "topicB", null, null)), pointConsumer) - - then: - secondDecode.isStarted() - pointConsumer.points.size() == 3 - with(pointConsumer.points[2]) { - tags.type == "type:sqs" - tags.topic == "topic:topicB" - tags.nonNullSize() == 3 - parentHash == pointConsumer.points[1].hash - hash != 0 - pathwayLatencyNano == MILLISECONDS.toNanos(58) - edgeLatencyNano == MILLISECONDS.toNanos(32) - } - } - - def "Empty tags not set"() { - given: - def timeSource = new ControllableTimeSource() - def context = new DefaultPathwayContext(timeSource, null) - - when: - timeSource.advance(50) - context.setCheckpoint(fromTags(DataStreamsTags.create("internal", DataStreamsTags.Direction.INBOUND)), pointConsumer) - timeSource.advance(25) - context.setCheckpoint(fromTags(DataStreamsTags.create("type", DataStreamsTags.Direction.OUTBOUND, "topic", "group", null)), pointConsumer) - timeSource.advance(25) - context.setCheckpoint(fromTags(DataStreamsTags.create(null, null)), pointConsumer) - - then: - context.isStarted() - pointConsumer.points.size() == 3 - verifyFirstPoint(pointConsumer.points[0]) - with(pointConsumer.points[1]) { - tags.type == "type:type" - tags.topic == "topic:topic" - tags.group == "group:group" - tags.direction == "direction:out" - tags.nonNullSize() == 4 - parentHash == pointConsumer.points[0].hash - hash != 0 - pathwayLatencyNano == 25 - edgeLatencyNano == 25 - } - with(pointConsumer.points[2]) { - tags.nonNullSize() == 0 - parentHash == pointConsumer.points[1].hash - hash != 0 - pathwayLatencyNano == 50 - edgeLatencyNano == 25 - } - } - - def "Check context extractor decorator behavior"() { - given: - def sink = Mock(Sink) - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> true - } - def timeSource = new ControllableTimeSource() - def payloadWriter = Mock(DatastreamsPayloadWriter) - - def globalTraceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> { return dynamicConfigEnabled } - } - - def tracerApi = Mock(AgentTracer.TracerAPI) { - captureTraceConfig() >> globalTraceConfig - } - AgentTracer.TracerAPI originalTracer = AgentTracer.get() - AgentTracer.forceRegister(tracerApi) - - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { globalTraceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - - BaseHash.updateBaseHash(baseHash) - def context = new DefaultPathwayContext(timeSource, null) - timeSource.advance(MILLISECONDS.toNanos(50)) - context.setCheckpoint(fromTags(DataStreamsTags.create("internal", DataStreamsTags.Direction.INBOUND)), pointConsumer) - def encoded = context.encode() - Map carrier = [ - (PROPAGATION_KEY_BASE64): encoded, - "someotherkey": "someothervalue" - ] - def contextVisitor = new Base64MapContextVisitor() - def propagator = dataStreams.propagator() - - when: - def extractedContext = propagator.extract(root(), carrier, contextVisitor) - def extractedSpan = AgentSpan.fromContext(extractedContext) - - then: - encoded == "L+lDG/Pa9hRkZA==" - !dynamicConfigEnabled || extractedSpan != null - if (dynamicConfigEnabled) { - def extracted = extractedSpan.context() - assert extracted != null - assert extracted.pathwayContext != null - assert extracted.pathwayContext.isStarted() - } - - cleanup: - AgentTracer.forceRegister(originalTracer) - - where: - dynamicConfigEnabled << [true, false] - } - - def "Check context extractor decorator behavior when trace data is null"() { - given: - def sink = Mock(Sink) - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> true - } - def timeSource = new ControllableTimeSource() - def payloadWriter = Mock(DatastreamsPayloadWriter) - - def globalTraceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> { return globalDsmEnabled } - } - - def tracerApi = Mock(AgentTracer.TracerAPI) { - captureTraceConfig() >> globalTraceConfig - } - AgentTracer.TracerAPI originalTracer = AgentTracer.get() - AgentTracer.forceRegister(tracerApi) - - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { globalTraceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - - BaseHash.updateBaseHash(baseHash) - def context = new DefaultPathwayContext(timeSource, null) - timeSource.advance(MILLISECONDS.toNanos(50)) - context.setCheckpoint(fromTags(DataStreamsTags.create("internal", DataStreamsTags.Direction.INBOUND)), pointConsumer) - def encoded = context.encode() - - Map carrier = [(PROPAGATION_KEY_BASE64): encoded, "someotherkey": "someothervalue"] - def contextVisitor = new Base64MapContextVisitor() - def propagator = dataStreams.propagator() - - when: - def extractedContext = propagator.extract(root(), carrier, contextVisitor) - def extractedSpan = AgentSpan.fromContext(extractedContext) - - then: - encoded == "L+lDG/Pa9hRkZA==" - if (globalDsmEnabled) { - extractedSpan != null - def extracted = extractedSpan.context() - extracted != null - extracted.pathwayContext != null - extracted.pathwayContext.isStarted() - } else { - extractedSpan == null - } - - cleanup: - AgentTracer.forceRegister(originalTracer) - - where: - globalDsmEnabled << [true, false] - } - - def "Check context extractor decorator behavior when local trace config is null"() { - given: - def sink = Mock(Sink) - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> true - } - def timeSource = new ControllableTimeSource() - def payloadWriter = Mock(DatastreamsPayloadWriter) - - def globalTraceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> { return globalDsmEnabled } - } - - def tracerApi = Mock(AgentTracer.TracerAPI) { - captureTraceConfig() >> globalTraceConfig - } - AgentTracer.TracerAPI originalTracer = AgentTracer.get() - AgentTracer.forceRegister(tracerApi) - - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { globalTraceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - - BaseHash.updateBaseHash(baseHash) - def context = new DefaultPathwayContext(timeSource, null) - timeSource.advance(MILLISECONDS.toNanos(50)) - context.setCheckpoint(fromTags(DataStreamsTags.create("internal", DataStreamsTags.Direction.INBOUND)), pointConsumer) - def encoded = context.encode() - Map carrier = [(PROPAGATION_KEY_BASE64): encoded, "someotherkey": "someothervalue"] - def contextVisitor = new Base64MapContextVisitor() - def spanContext = new ExtractedContext(DDTraceId.ONE, 1, 0, null, 0, - null, (TagMap)null, null, null, globalTraceConfig, DATADOG) - def baseContext = AgentSpan.fromSpanContext(spanContext).storeInto(root()) - def propagator = dataStreams.propagator() - - when: - def extractedContext = propagator.extract(baseContext, carrier, contextVisitor) - def extractedSpan = AgentSpan.fromContext(extractedContext) - - then: - extractedSpan != null - - when: - def extracted = extractedSpan.context() - - then: - extracted != null - encoded == "L+lDG/Pa9hRkZA==" - if (globalDsmEnabled) { - extracted.pathwayContext != null - extracted.pathwayContext.isStarted() - } else { - extracted.pathwayContext == null - } - - cleanup: - AgentTracer.forceRegister(originalTracer) - - where: - globalDsmEnabled << [true, false] - } - - def "Check context extractor decorator behavior when trace data and dsm data are null"() { - given: - def sink = Mock(Sink) - def features = Stub(DDAgentFeaturesDiscovery) { - supportsDataStreams() >> true - } - def timeSource = new ControllableTimeSource() - def payloadWriter = Mock(DatastreamsPayloadWriter) - - def traceConfig = Mock(TraceConfig) { - isDataStreamsEnabled() >> true - } - - def dataStreams = new DefaultDataStreamsMonitoring(sink, features, timeSource, { traceConfig }, payloadWriter, DEFAULT_BUCKET_DURATION_NANOS) - - Map carrier = ["someotherkey": "someothervalue"] - def contextVisitor = new Base64MapContextVisitor() - def propagator = dataStreams.propagator() - - when: - def extractedContext = propagator.extract(root(), carrier, contextVisitor) - def extractedSpan = AgentSpan.fromContext(extractedContext) - - then: - extractedSpan == null - } - - class Base64MapContextVisitor implements AgentPropagation.ContextVisitor> { - @Override - void forEachKey(Map carrier, AgentPropagation.KeyClassifier classifier) { - for (Map.Entry entry : carrier.entrySet()) { - classifier.accept(entry.key, entry.value) - } - } - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/SchemaBuilderTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/SchemaBuilderTest.groovy deleted file mode 100644 index b18e56dcf9c..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/SchemaBuilderTest.groovy +++ /dev/null @@ -1,44 +0,0 @@ -package datadog.trace.core.datastreams - -import datadog.trace.bootstrap.instrumentation.api.Schema -import datadog.trace.bootstrap.instrumentation.api.SchemaIterator -import datadog.trace.core.test.DDCoreSpecification - -class SchemaBuilderTest extends DDCoreSpecification { - - class Iterator implements SchemaIterator{ - - @Override - void iterateOverSchema(datadog.trace.bootstrap.instrumentation.api.SchemaBuilder builder) { - HashMap extension = new HashMap(1) - extension.put("x-test-extension-1", "hello") - extension.put("x-test-extension-2", "world") - builder.addProperty("person", "name", false, "string", "name of the person", null, null, null, null) - builder.addProperty("person", "phone_numbers", true, "string", null, null, null, null, null) - builder.addProperty("person", "person_name", false, "string", null, null, null, null, null) - builder.addProperty("person", "address", false, "object", null, "#/components/schemas/address", null, null, null) - builder.addProperty("address", "zip", false, "number", null, null, "int", null, null) - builder.addProperty("address", "street", false, "string", null, null, null, null, extension) - } - } - - def "schema is converted correctly to JSON"() { - given: - SchemaBuilder builder = new SchemaBuilder(new Iterator()) - - when: - boolean shouldExtractPerson = builder.shouldExtractSchema("person", 0) - boolean shouldExtractAddress = builder.shouldExtractSchema("address", 1) - boolean shouldExtractPerson2 = builder.shouldExtractSchema("person", 0) - boolean shouldExtractTooDeep = builder.shouldExtractSchema("city", 11) - Schema schema = builder.build() - - then: - "{\"components\":{\"schemas\":{\"person\":{\"properties\":{\"name\":{\"description\":\"name of the person\",\"type\":\"string\"},\"phone_numbers\":{\"items\":{\"type\":\"string\"},\"type\":\"array\"},\"person_name\":{\"type\":\"string\"},\"address\":{\"\$ref\":\"#/components/schemas/address\",\"type\":\"object\"}},\"type\":\"object\"},\"address\":{\"properties\":{\"zip\":{\"format\":\"int\",\"type\":\"number\"},\"street\":{\"extensions\":{\"x-test-extension-1\":\"hello\",\"x-test-extension-2\":\"world\"},\"type\":\"string\"}},\"type\":\"object\"}}},\"openapi\":\"3.0.0\"}" == schema.definition - "16548065305426330543" == schema.id - shouldExtractPerson - shouldExtractAddress - !shouldExtractPerson2 - !shouldExtractTooDeep - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/SchemaSamplerTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/SchemaSamplerTest.groovy deleted file mode 100644 index 41615e95542..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/SchemaSamplerTest.groovy +++ /dev/null @@ -1,30 +0,0 @@ -package datadog.trace.core.datastreams - -import datadog.trace.core.test.DDCoreSpecification - -class SchemaSamplerTest extends DDCoreSpecification { - - def "schema sampler samples with correct weights"() { - given: - long currentTimeMillis = 100000 - SchemaSampler sampler = new SchemaSampler() - - when: - boolean canSample1 = sampler.canSample(currentTimeMillis) - int weight1 = sampler.trySample(currentTimeMillis) - boolean canSample2= sampler.canSample(currentTimeMillis + 1000) - boolean canSample3 = sampler.canSample(currentTimeMillis + 2000) - boolean canSample4 = sampler.canSample(currentTimeMillis + 30000) - int weight4 = sampler.trySample(currentTimeMillis + 30000) - boolean canSample5 = sampler.canSample(currentTimeMillis + 30001) - - then: - canSample1 - weight1 == 1 - !canSample2 - !canSample3 - canSample4 - weight4 == 3 - !canSample5 - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/TransactionContainerTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/TransactionContainerTest.groovy deleted file mode 100644 index a7593acb19e..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/datastreams/TransactionContainerTest.groovy +++ /dev/null @@ -1,49 +0,0 @@ -package datadog.trace.core.datastreams - -import datadog.trace.api.datastreams.TransactionInfo -import datadog.trace.core.test.DDCoreSpecification - -class TransactionContainerTest extends DDCoreSpecification { - def "test with no resize"() { - given: - TransactionInfo.resetCache() - def container = new TransactionContainer(1024) - container.add(new TransactionInfo("1", 1, "1")) - container.add(new TransactionInfo("2", 2, "2")) - def data = container.getData() - - expect: - data.size() == 22 - data == new byte[] { - 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 49, 2, 0, 0, 0, 0, 0, 0, 0, 2, 1, 50 - } - } - - def "test with with resize"() { - given: - TransactionInfo.resetCache() - def container = new TransactionContainer(10) - container.add(new TransactionInfo("1", 1, "1")) - container.add(new TransactionInfo("2", 2, "2")) - def data = container.getData() - - expect: - data.size() == 22 - data == new byte[] { - 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 49, 2, 0, 0, 0, 0, 0, 0, 0, 2, 1, 50 - } - } - - def "test checkpoint map"() { - given: - TransactionInfo.resetCache() - new TransactionInfo("1", 1, "1") - new TransactionInfo("2", 2, "2") - def data = TransactionInfo.getCheckpointIdCacheBytes() - expect: - data.size() == 6 - data == new byte[] { - 1, 1, 49, 2, 1, 50 - } - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/B3HttpExtractorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/B3HttpExtractorTest.groovy deleted file mode 100644 index ce4eb188e5b..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/B3HttpExtractorTest.groovy +++ /dev/null @@ -1,391 +0,0 @@ -package datadog.trace.core.propagation - -import datadog.trace.api.Config -import datadog.trace.api.DDSpanId -import datadog.trace.api.DynamicConfig -import datadog.trace.bootstrap.ActiveSubsystems -import datadog.trace.bootstrap.instrumentation.api.TagContext -import datadog.trace.api.sampling.PrioritySampling -import datadog.trace.bootstrap.instrumentation.api.ContextVisitors -import datadog.trace.test.util.DDSpecification - -import static datadog.trace.api.config.TracerConfig.PROPAGATION_EXTRACT_LOG_HEADER_NAMES_ENABLED -import static datadog.trace.core.CoreTracer.TRACE_ID_MAX -import static datadog.trace.core.propagation.B3HttpCodec.B3_KEY -import static datadog.trace.core.propagation.B3HttpCodec.SAMPLING_PRIORITY_KEY -import static datadog.trace.core.propagation.B3HttpCodec.SPAN_ID_KEY -import static datadog.trace.core.propagation.B3HttpCodec.TRACE_ID_KEY - -class B3HttpExtractorTest extends DDSpecification { - - DynamicConfig dynamicConfig - HttpCodec.Extractor extractor - boolean origAppSecActive - - void setup() { - dynamicConfig = DynamicConfig.create() - .setHeaderTags(["SOME_HEADER": "some-tag"]) - .setBaggageMapping([:]) - .apply() - extractor = B3HttpCodec.newExtractor(Config.get(), { dynamicConfig.captureTraceConfig() }) - origAppSecActive = ActiveSubsystems.APPSEC_ACTIVE - ActiveSubsystems.APPSEC_ACTIVE = true - - injectSysConfig(PROPAGATION_EXTRACT_LOG_HEADER_NAMES_ENABLED, "true") - } - - void cleanup() { - ActiveSubsystems.APPSEC_ACTIVE = origAppSecActive - } - - def "extract http headers"() { - setup: - def traceIdHex = traceId.toString(16).toLowerCase() - def headers = [ - "" : "empty key", - (TRACE_ID_KEY.toUpperCase()): traceIdHex, - (SPAN_ID_KEY.toUpperCase()) : spanId.toString(16).toLowerCase(), - SOME_HEADER : "my-interesting-info", - ] - - if (samplingPriority != null) { - headers.put(SAMPLING_PRIORITY_KEY, "$samplingPriority".toString()) - } - - when: - final ExtractedContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - context.traceId == B3TraceId.fromHex(traceIdHex) - context.spanId == DDSpanId.from("$spanId") - context.baggage == [:] - context.tags == [ - "b3.traceid": context.traceId.original, - "b3.spanid" : DDSpanId.toHexString(context.spanId), - "some-tag" : "my-interesting-info" - ] - context.samplingPriority == expectedSamplingPriority - context.origin == null - - where: - traceId | spanId | samplingPriority | expectedSamplingPriority - 1G | 2G | null | PrioritySampling.UNSET - 2G | 3G | 1 | PrioritySampling.SAMPLER_KEEP - 3G | 4G | 0 | PrioritySampling.SAMPLER_DROP - TRACE_ID_MAX | TRACE_ID_MAX - 1 | 0 | PrioritySampling.SAMPLER_DROP - TRACE_ID_MAX - 1 | TRACE_ID_MAX | 1 | PrioritySampling.SAMPLER_KEEP - } - - def "extract http headers with b3 header at the beginning"() { - setup: - def headers = [ - "" : "empty key", - (B3_KEY) : b3, - (TRACE_ID_KEY.toUpperCase()): traceId.toString(16).toLowerCase(), - (SPAN_ID_KEY.toUpperCase()) : spanId.toString(16).toLowerCase(), - SOME_HEADER : "my-interesting-info", - ] - - if (samplingPriority != null) { - headers.put(SAMPLING_PRIORITY_KEY, "$samplingPriority".toString()) - } - - when: - final ExtractedContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - context.traceId == B3TraceId.fromHex(expectedTraceIdHex) - context.spanId == DDSpanId.from("$expectedSpanId") - context.baggage == [:] - context.tags == [ - "b3.traceid": context.traceId.original, - "b3.spanid" : DDSpanId.toHexString(context.spanId), - "some-tag" : "my-interesting-info" - ] - context.samplingPriority == expectedSamplingPriority - context.origin == null - - where: - b3 | expectedTraceId | expectedSpanId | expectedSamplingPriority - "2-3-0" | 2G | 3G | PrioritySampling.SAMPLER_DROP - "2-3" | 2G | 3G | PrioritySampling.UNSET - "0" | 1G | 2G | PrioritySampling.SAMPLER_KEEP // B3 Multi used instead - null | 1G | 2G | PrioritySampling.SAMPLER_KEEP // B3 Multi used instead - - traceId = 1G - expectedTraceIdHex = expectedTraceId.toString(16).toLowerCase() - spanId = 2G - samplingPriority = 1 - } - - def "extract http headers with b3 header at the end"() { - setup: - def headers = [ - "" : "empty key", - (TRACE_ID_KEY.toUpperCase()): traceId.toString(16).toLowerCase(), - (SPAN_ID_KEY.toUpperCase()) : spanId.toString(16).toLowerCase(), - (B3_KEY) : b3, - SOME_HEADER : "my-interesting-info", - ] - - if (samplingPriority != null) { - headers.put(SAMPLING_PRIORITY_KEY, "$samplingPriority".toString()) - } - - when: - final TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - context.traceId == B3TraceId.fromHex(expectedTraceIdHex) - context.spanId == DDSpanId.from("$expectedSpanId") - context.baggageItems().empty - context.tags == [ - "b3.traceid": context.traceId.original, - "b3.spanid" : DDSpanId.toHexString(context.spanId), - "some-tag" : "my-interesting-info" - ] - context.samplingPriority == expectedSamplingPriority - context.origin == null - - where: - b3 | expectedTraceId | expectedSpanId | expectedSamplingPriority - "2-3-0" | 2G | 3G | PrioritySampling.SAMPLER_DROP - "2-3" | 2G | 3G | PrioritySampling.UNSET - "0" | 1G | 2G | PrioritySampling.SAMPLER_KEEP // B3 Multi used instead - null | 1G | 2G | PrioritySampling.SAMPLER_KEEP // B3 Multi used instead - - traceId = 1G - expectedTraceIdHex = expectedTraceId.toString(16).toLowerCase() - spanId = 2G - samplingPriority = 1 - } - - def "extract 128 bit id truncates id to 64 bit"() { - setup: - def headers = [ - (TRACE_ID_KEY.toUpperCase()): traceId, - (SPAN_ID_KEY.toUpperCase()) : spanId, - ] - - when: - def context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - if (expectedTraceId) { - assert context instanceof ExtractedContext - assert context.traceId == expectedTraceId - assert context.spanId == (expectedSpanId == null ? 0 : expectedSpanId) - assert context.tags["b3.traceid"] == expectedTraceId.original - assert context.tags["b3.spanid"] == (expectedSpanId == null ? null : DDSpanId.toHexString(expectedSpanId)) - } else { - assert context == null || (context instanceof TagContext && !(context instanceof ExtractedContext)) - } - - where: - traceId | spanId | expectedTraceId | expectedSpanId - "-1" | "1" | null | null - "1" | "-1" | null | null - "0" | "1" | null | null - "00001" | "1" | B3TraceId.fromHex("00001") | DDSpanId.fromHex("00001") - "463ac35c9f6413ad" | "463ac35c9f6413ad" | B3TraceId.fromHex("463ac35c9f6413ad") | DDSpanId.from("5060571933882717101") - "463ac35c9f6413ad48485a3953bb6124" | "1" | B3TraceId.fromHex("463ac35c9f6413ad48485a3953bb6124") | 1 - "f" * 16 | "1" | B3TraceId.fromHex("f" * 16) | 1 - "a" * 16 + "f" * 16 | "1" | B3TraceId.fromHex("a" * 16 + "f" * 16) | 1 - "1" + "f" * 32 | "1" | null | null - "0" + "f" * 32 | "1" | null | null - "1" | "f" * 16 | B3TraceId.fromHex("1") | DDSpanId.MAX - "1" | "1" + "f" * 16 | null | null - } - - def "extract header tags with no propagation"() { - when: - TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - !(context instanceof ExtractedContext) - context.getTags() == ["some-tag": "my-interesting-info"] - - where: - headers | _ - [SOME_HEADER: "my-interesting-info"] | _ - } - - def "extract headers with forwarding"() { - when: - TagContext context = extractor.extract(tagOnlyCtx, ContextVisitors.stringValuesMap()) - - then: - context != null - !(context instanceof ExtractedContext) - context.forwarded == "for=$forwardedIp:$forwardedPort" - - when: - context = extractor.extract(fullCtx, ContextVisitors.stringValuesMap()) - - then: - context instanceof ExtractedContext - context.traceId.toLong() == 1 - context.spanId.toLong() == 2 - context.forwarded == "for=$forwardedIp:$forwardedPort" - - where: - forwardedIp = "1.2.3.4" - forwardedPort = "1234" - tagOnlyCtx = [ - "Forwarded" : "for=$forwardedIp:$forwardedPort" - ] - fullCtx = [ - (TRACE_ID_KEY.toUpperCase()): 1, - (SPAN_ID_KEY.toUpperCase()) : 2, - "Forwarded" : "for=$forwardedIp:$forwardedPort" - ] - } - - def "extract headers with x-forwarding"() { - when: - TagContext context = extractor.extract(tagOnlyCtx, ContextVisitors.stringValuesMap()) - - then: - context != null - context instanceof TagContext - context.XForwardedFor == forwardedIp - context.XForwardedPort == forwardedPort - - when: - context = extractor.extract(fullCtx, ContextVisitors.stringValuesMap()) - - then: - context instanceof ExtractedContext - context.traceId.toLong() == 1 - context.spanId.toLong() == 2 - context.XForwardedFor == forwardedIp - context.XForwardedPort == forwardedPort - - where: - forwardedIp = "1.2.3.4" - forwardedPort = "1234" - tagOnlyCtx = [ - "X-Forwarded-For" : forwardedIp, - "X-Forwarded-Port": forwardedPort - ] - fullCtx = [ - (TRACE_ID_KEY.toUpperCase()): 1, - (SPAN_ID_KEY.toUpperCase()) : 2, - "x-forwarded-for" : forwardedIp, - "x-forwarded-port" : forwardedPort - ] - } - - def "extract empty headers returns null"() { - expect: - extractor.extract(["ignored-header": "ignored-value"], ContextVisitors.stringValuesMap()) == null - } - - def "extract http headers with invalid non-numeric ID"() { - setup: - def headers = [ - (TRACE_ID_KEY.toUpperCase()): "traceId", - (SPAN_ID_KEY.toUpperCase()) : "spanId", - SOME_HEADER : "my-interesting-info", - ] - - when: - TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - !(context instanceof ExtractedContext) - context.getTags() == ["some-tag": "my-interesting-info"] - } - - def "extract http headers with out of range span ID"() { - setup: - def headers = [ - (TRACE_ID_KEY.toUpperCase()): "0", - (SPAN_ID_KEY.toUpperCase()) : "-1", - SOME_HEADER : "my-interesting-info", - ] - - when: - TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - !(context instanceof ExtractedContext) - context.getTags() == ["some-tag": "my-interesting-info"] - } - - def "extract ids while retaining the original string"() { - setup: - def headers = [ - (TRACE_ID_KEY.toUpperCase()): traceId, - (SPAN_ID_KEY.toUpperCase()) : spanId, - ] - - when: - final ExtractedContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - if (expectedTraceId) { - assert context.traceId == expectedTraceId - assert context.traceId.original == traceId - assert context.spanId == expectedSpanId - assert DDSpanId.toHexString(context.spanId) == trimmed(spanId) - } else { - assert context == null - } - - where: - traceId | spanId | expectedSpanId - "00001" | "00001" | 1 - "463ac35c9f6413ad" | "463ac35c9f6413ad" | DDSpanId.from("5060571933882717101") - "463ac35c9f6413ad48485a3953bb6124" | "1" | 1 - "f" * 16 | "1" | 1 - "a" * 16 + "f" * 16 | "1" | 1 - "1" | "f" * 16 | DDSpanId.MAX - "1" | "000" + "f" * 16 | DDSpanId.MAX - - expectedTraceId = B3TraceId.fromHex(traceId) - } - - String trimmed(String hex) { - int length = hex.length() - int i = 0 - while (i < length && hex.charAt(i) == '0') { - i++ - } - if (i == length) { - return "0" - } - return hex.substring(i, length) - } - - def "extract common http headers"() { - setup: - def headers = [ - (HttpCodec.USER_AGENT_KEY): 'some-user-agent', - (HttpCodec.X_CLUSTER_CLIENT_IP_KEY): '1.1.1.1', - (HttpCodec.X_REAL_IP_KEY): '2.2.2.2', - (HttpCodec.X_CLIENT_IP_KEY): '3.3.3.3', - (HttpCodec.TRUE_CLIENT_IP_KEY): '4.4.4.4', - (HttpCodec.FORWARDED_FOR_KEY): '5.5.5.5', - (HttpCodec.FORWARDED_KEY): '6.6.6.6', - (HttpCodec.FASTLY_CLIENT_IP_KEY): '7.7.7.7', - (HttpCodec.CF_CONNECTING_IP_KEY): '8.8.8.8', - (HttpCodec.CF_CONNECTING_IP_V6_KEY): '9.9.9.9', - ] - - when: - final TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - assert context.userAgent == 'some-user-agent' - assert context.XClusterClientIp == '1.1.1.1' - assert context.XRealIp == '2.2.2.2' - assert context.XClientIp == '3.3.3.3' - assert context.trueClientIp == '4.4.4.4' - assert context.forwardedFor == '5.5.5.5' - assert context.forwarded == '6.6.6.6' - assert context.fastlyClientIp == '7.7.7.7' - assert context.cfConnectingIp == '8.8.8.8' - assert context.cfConnectingIpv6 == '9.9.9.9' - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/B3HttpInjectorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/B3HttpInjectorTest.groovy deleted file mode 100644 index 71e67ce55dc..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/B3HttpInjectorTest.groovy +++ /dev/null @@ -1,158 +0,0 @@ -package datadog.trace.core.propagation - -import datadog.trace.api.Config -import datadog.trace.api.DDSpanId -import datadog.trace.api.DDTraceId -import datadog.trace.api.DynamicConfig -import datadog.trace.api.datastreams.NoopPathwayContext -import datadog.trace.core.CoreTracer -import datadog.trace.test.util.StringUtils - -import static datadog.trace.api.sampling.PrioritySampling.* -import datadog.trace.bootstrap.instrumentation.api.TagContext -import datadog.trace.bootstrap.instrumentation.api.ContextVisitors -import datadog.trace.common.writer.ListWriter -import datadog.trace.core.DDSpanContext -import datadog.trace.core.test.DDCoreSpecification - -import static datadog.trace.core.CoreTracer.TRACE_ID_MAX -import static datadog.trace.core.propagation.B3HttpCodec.B3_KEY -import static datadog.trace.core.propagation.B3HttpCodec.SAMPLING_PRIORITY_KEY -import static datadog.trace.core.propagation.B3HttpCodec.SPAN_ID_KEY -import static datadog.trace.core.propagation.B3HttpCodec.TRACE_ID_KEY -import static datadog.trace.test.util.StringUtils.trimHex - -class B3HttpInjectorTest extends DDCoreSpecification { - - boolean tracePropagationB3Padding() { - return false - } - - String idOrPadded(BigInteger id, int size) { - return idOrPadded(id.toString(16), size) - } - - String idOrPadded(String id, int size) { - if (!tracePropagationB3Padding()) { - return id.toLowerCase() - } - return StringUtils.padHexLower(id, size) - } - - def "inject http headers"() { - setup: - HttpCodec.Injector injector = B3HttpCodec.newCombinedInjector(tracePropagationB3Padding()) - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - final DDSpanContext mockedContext = mockedContext(tracer, DDTraceId.from("$traceId"), DDSpanId.from("$spanId"), samplingPriority) - final Map carrier = Mock() - - when: - injector.inject(mockedContext, carrier, MapSetter.INSTANCE) - - then: - 1 * carrier.put(TRACE_ID_KEY, traceIdHex) - 1 * carrier.put(SPAN_ID_KEY, spanIdHex) - if (expectedSamplingPriority != null) { - 1 * carrier.put(SAMPLING_PRIORITY_KEY, "$expectedSamplingPriority") - 1 * carrier.put(B3_KEY, "$traceIdHex-$spanIdHex-$expectedSamplingPriority") - } else { - 1 * carrier.put(B3_KEY, "$traceIdHex-$spanIdHex") - } - 0 * _ - - cleanup: - tracer.close() - - where: - traceId | spanId | samplingPriority | expectedSamplingPriority - 1G | 2G | UNSET | null - 2G | 3G | SAMPLER_KEEP | SAMPLER_KEEP - 4G | 5G | SAMPLER_DROP | SAMPLER_DROP - 5G | 6G | USER_KEEP | SAMPLER_KEEP - 6G | 7G | USER_DROP | SAMPLER_DROP - TRACE_ID_MAX | TRACE_ID_MAX - 1 | UNSET | null - TRACE_ID_MAX - 1 | TRACE_ID_MAX | SAMPLER_KEEP | SAMPLER_KEEP - - traceIdHex = idOrPadded(traceId, 32) - spanIdHex = idOrPadded(spanId, 16) - } - - def "inject http headers with extracted original"() { - setup: - HttpCodec.Injector injector = B3HttpCodec.newCombinedInjector(tracePropagationB3Padding()) - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - def headers = [ - (TRACE_ID_KEY.toUpperCase()): traceId, - (SPAN_ID_KEY.toUpperCase()) : spanId, - ] - DynamicConfig dynamicConfig = DynamicConfig.create() - .setHeaderTags([:]) - .setBaggageMapping([:]) - .apply() - HttpCodec.Extractor extractor = B3HttpCodec.newExtractor(Config.get(), { dynamicConfig.captureTraceConfig() }) - final TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - final DDSpanContext mockedContext = mockedContext(tracer, context) - final Map carrier = Mock() - - when: - injector.inject(mockedContext, carrier, MapSetter.INSTANCE) - - then: - 1 * carrier.put(TRACE_ID_KEY, traceIdHex) - 1 * carrier.put(SPAN_ID_KEY, spanIdHex) - 1 * carrier.put(B3_KEY, "$traceIdHex-$spanIdHex") - 0 * _ - - cleanup: - tracer.close() - - where: - traceId | spanId - "00001" | "00001" - "463ac35c9f6413ad" | "463ac35c9f6413ad" - "463ac35c9f6413ad48485a3953bb6124" | "1" - "f" * 16 | "1" - "a" * 16 + "f" * 16 | "1" - "1" | "f" * 16 - "1" | "000" + "f" * 16 - - traceIdHex = idOrPadded(traceId, 32) - spanIdHex = idOrPadded(trimHex(spanId), 16) - } - - static DDSpanContext mockedContext(CoreTracer tracer, TagContext context) { - return mockedContext(tracer, context.traceId, context.spanId, UNSET) - } - - static DDSpanContext mockedContext(CoreTracer tracer, DDTraceId traceId, long spanId, int samplingPriority) { - return new DDSpanContext( - traceId, - spanId, - DDSpanId.ZERO, - null, - "fakeService", - "fakeOperation", - "fakeResource", - samplingPriority, - "fakeOrigin", - ["k1": "v1", "k2": "v2"], - false, - "fakeType", - 0, - tracer.traceCollectorFactory.create(DDTraceId.ONE), - null, - null, - NoopPathwayContext.INSTANCE, - false, - PropagationTags.factory().empty()) - } -} - -class B3HttpInjectorPaddedTest extends B3HttpInjectorTest { - @Override - boolean tracePropagationB3Padding() { - return true - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/DatadogHttpExtractorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/DatadogHttpExtractorTest.groovy deleted file mode 100644 index 4541d264cfa..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/DatadogHttpExtractorTest.groovy +++ /dev/null @@ -1,462 +0,0 @@ -package datadog.trace.core.propagation - -import datadog.trace.api.Config -import datadog.trace.api.DD128bTraceId -import datadog.trace.api.DD64bTraceId -import datadog.trace.api.DDSpanId -import datadog.trace.api.DDTraceId -import datadog.trace.api.DynamicConfig -import datadog.trace.api.config.TracerConfig -import datadog.trace.api.internal.util.LongStringUtils -import datadog.trace.bootstrap.ActiveSubsystems -import datadog.trace.bootstrap.instrumentation.api.TagContext -import datadog.trace.api.sampling.PrioritySampling -import datadog.trace.bootstrap.instrumentation.api.ContextVisitors -import datadog.trace.test.util.DDSpecification - -import static datadog.trace.api.config.TracerConfig.PROPAGATION_EXTRACT_LOG_HEADER_NAMES_ENABLED -import static datadog.trace.core.CoreTracer.TRACE_ID_MAX -import static datadog.trace.core.propagation.DatadogHttpCodec.DATADOG_TAGS_KEY -import static datadog.trace.core.propagation.DatadogHttpCodec.ORIGIN_KEY -import static datadog.trace.core.propagation.DatadogHttpCodec.OT_BAGGAGE_PREFIX -import static datadog.trace.core.propagation.DatadogHttpCodec.SAMPLING_PRIORITY_KEY -import static datadog.trace.core.propagation.DatadogHttpCodec.SPAN_ID_KEY -import static datadog.trace.core.propagation.DatadogHttpCodec.TRACE_ID_KEY - -class DatadogHttpExtractorTest extends DDSpecification { - - private DynamicConfig dynamicConfig - private HttpCodec.Extractor _extractor - - private HttpCodec.Extractor getExtractor() { - _extractor ?: (_extractor = createExtractor(Config.get())) - } - - private HttpCodec.Extractor createExtractor(Config config) { - DatadogHttpCodec.newExtractor(config, { dynamicConfig.captureTraceConfig() }) - } - - boolean origAppSecActive - - void setup() { - dynamicConfig = DynamicConfig.create() - .setHeaderTags(["SOME_HEADER": "some-tag"]) - .setBaggageMapping(["SOME_CUSTOM_BAGGAGE_HEADER": "some-baggage", "SOME_CUSTOM_BAGGAGE_HEADER_2": "some-CaseSensitive-baggage"]) - .apply() - origAppSecActive = ActiveSubsystems.APPSEC_ACTIVE - ActiveSubsystems.APPSEC_ACTIVE = true - - injectSysConfig(PROPAGATION_EXTRACT_LOG_HEADER_NAMES_ENABLED, "true") - } - - void cleanup() { - ActiveSubsystems.APPSEC_ACTIVE = origAppSecActive - extractor.cleanup() - } - - def "extract http headers"() { - setup: - injectEnvConfig("DD_TRACE_REQUEST_HEADER_TAGS_COMMA_ALLOWED", "$allowComma") - def extractor = createExtractor(Config.get()) - def headers = [ - "" : "empty key", - (TRACE_ID_KEY.toUpperCase()) : traceId, - (SPAN_ID_KEY.toUpperCase()) : spanId, - (OT_BAGGAGE_PREFIX.toUpperCase() + "k1"): "v1", - (OT_BAGGAGE_PREFIX.toUpperCase() + "k2"): "v2", - SOME_HEADER : "my-interesting-info,and-more", - SOME_CUSTOM_BAGGAGE_HEADER : "my-interesting-baggage-info", - SOME_CUSTOM_BAGGAGE_HEADER_2 : "my-interesting-baggage-info-2", - ] - def expectedTagValue = allowComma ? "my-interesting-info,and-more" : "my-interesting-info" - - if (samplingPriority != PrioritySampling.UNSET) { - headers.put(SAMPLING_PRIORITY_KEY, "$samplingPriority".toString()) - } - - if (origin) { - headers.put(ORIGIN_KEY, origin) - } - - when: - final ExtractedContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - context.traceId == DDTraceId.from(traceId) - context.spanId == DDSpanId.from(spanId) - context.baggage == ["k1" : "v1", - "k2" : "v2", - "some-baggage" : "my-interesting-baggage-info", - "some-CaseSensitive-baggage": "my-interesting-baggage-info-2"] - context.tags == ["some-tag": "$expectedTagValue"] - context.samplingPriority == samplingPriority - context.origin == origin - - cleanup: - extractor.cleanup() - - where: - traceId | spanId | samplingPriority | origin | allowComma - "1" | "2" | PrioritySampling.UNSET | null | true - "2" | "3" | PrioritySampling.SAMPLER_KEEP | "saipan" | false - "$TRACE_ID_MAX" | "${TRACE_ID_MAX - 1}" | PrioritySampling.UNSET | "saipan" | true - "${TRACE_ID_MAX - 1}" | "$TRACE_ID_MAX" | PrioritySampling.SAMPLER_KEEP | "saipan" | false - } - - def "extract header tags with no propagation"() { - when: - TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - !(context instanceof ExtractedContext) - context.getTags() == ["some-tag": "my-interesting-info"] - if (headers.containsKey(ORIGIN_KEY)) { - assert ((TagContext) context).origin == "my-origin" - } - - where: - headers << [ - [SOME_HEADER: "my-interesting-info"], - [(ORIGIN_KEY): "my-origin", SOME_HEADER: "my-interesting-info"], - ] - } - - def "extract headers with forwarding"() { - when: - TagContext context = extractor.extract(tagOnlyCtx, ContextVisitors.stringValuesMap()) - - then: - context != null - !(context instanceof ExtractedContext) - context.forwarded == "for=$forwardedIp:$forwardedPort" - - when: - context = extractor.extract(fullCtx, ContextVisitors.stringValuesMap()) - - then: - context instanceof ExtractedContext - context.traceId.toLong() == 1 - context.spanId.toLong() == 2 - context.forwarded == "for=$forwardedIp:$forwardedPort" - - where: - forwardedIp = "1.2.3.4" - forwardedPort = "1234" - tagOnlyCtx = [ - "Forwarded" : "for=$forwardedIp:$forwardedPort" - ] - fullCtx = [ - (TRACE_ID_KEY.toUpperCase()): 1, - (SPAN_ID_KEY.toUpperCase()) : 2, - "Forwarded" : "for=$forwardedIp:$forwardedPort" - ] - } - - def "extract headers with x-forwarding"() { - setup: - String forwardedIp = '1.2.3.4' - String forwardedPort = '1234' - def tagOnlyCtx = [ - "X-Forwarded-For" : forwardedIp, - "X-Forwarded-Port": forwardedPort - ] - def fullCtx = [ - (TRACE_ID_KEY.toUpperCase()): 1, - (SPAN_ID_KEY.toUpperCase()) : 2, - "x-forwarded-for" : forwardedIp, - "x-forwarded-port" : forwardedPort - ] - - when: - TagContext context = extractor.extract(tagOnlyCtx, ContextVisitors.stringValuesMap()) - - then: - context != null - context instanceof TagContext - context.XForwardedFor == forwardedIp - context.XForwardedPort == forwardedPort - - when: - context = extractor.extract(fullCtx, ContextVisitors.stringValuesMap()) - - then: - context instanceof ExtractedContext - context.traceId.toLong() == 1 - context.spanId.toLong() == 2 - context.XForwardedFor == forwardedIp - context.XForwardedPort == forwardedPort - } - - def "extract empty headers returns null"() { - expect: - extractor.extract(["ignored-header": "ignored-value"], ContextVisitors.stringValuesMap()) == null - } - - void 'extract headers with ip resolution disabled'() { - setup: - injectSysConfig(TracerConfig.TRACE_CLIENT_IP_RESOLVER_ENABLED, 'false') - - def tagOnlyCtx = [ - 'X-Forwarded-For': '::1', - 'User-agent': 'foo/bar', - ] - - when: - TagContext ctx = extractor.extract(tagOnlyCtx, ContextVisitors.stringValuesMap()) - - then: - ctx != null - ctx.XForwardedFor == null - ctx.userAgent == 'foo/bar' - } - - - void 'extract headers with ip resolution disabled — appsec disabled variant'() { - setup: - ActiveSubsystems.APPSEC_ACTIVE = false - - def tagOnlyCtx = [ - 'X-Forwarded-For': '::1', - 'User-agent': 'foo/bar', - ] - - when: - TagContext ctx = extractor.extract(tagOnlyCtx, ContextVisitors.stringValuesMap()) - - then: - ctx != null - ctx.XForwardedFor == null - } - - void 'custom IP header collection does not disable standard ip header collection'() { - setup: - injectSysConfig(TracerConfig.TRACE_CLIENT_IP_HEADER, "my-header") - - def tagOnlyCtx = [ - 'X-Forwarded-For': '::1', - 'My-Header': '8.8.8.8', - ] - - when: - def ctx = extractor.extract(tagOnlyCtx, ContextVisitors.stringValuesMap()) - - then: - ctx != null - ctx.XForwardedFor == '::1' - ctx.customIpHeader == '8.8.8.8' - } - - def "extract http headers with 128-bit trace ID"() { - setup: - def headers = [ - (TRACE_ID_KEY.toUpperCase()) : traceId.toString(), - (SPAN_ID_KEY.toUpperCase()) : "2", - (OT_BAGGAGE_PREFIX.toUpperCase() + "k1"): "v1", - (OT_BAGGAGE_PREFIX.toUpperCase() + "k2"): "v2", - SOME_HEADER : "my-interesting-info" - ] + additionalHeader - - when: - final ExtractedContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - context.traceId == expectedTraceId - context.spanId == DDSpanId.from("2") - context.baggage == ["k1": "v1", - "k2": "v2"] - context.tags == ["some-tag": "my-interesting-info"] - - where: - hexId << [ - "1", - "123456789abcdef0", - "123456789abcdef0123456789abcdef0", - "64184f2400000000123456789abcdef0", - "f" * 32 - ] - traceId = DD128bTraceId.fromHex(hexId) - is128bTrace = traceId.toHighOrderLong() != 0 - expectedTraceId = is128bTrace ? traceId : DD64bTraceId.from(traceId.toLong()) - additionalHeader = is128bTrace ? [(DATADOG_TAGS_KEY.toUpperCase()) : '_dd.p.tid=' + LongStringUtils.toHexStringPadded(traceId.toHighOrderLong(), 16)] : [:] - } - - def "extract http headers with invalid non-numeric ID"() { - setup: - def headers = [ - (TRACE_ID_KEY.toUpperCase()) : "traceId", - (SPAN_ID_KEY.toUpperCase()) : "spanId", - (OT_BAGGAGE_PREFIX.toUpperCase() + "k1"): "v1", - (OT_BAGGAGE_PREFIX.toUpperCase() + "k2"): "v2", - SOME_HEADER : "my-interesting-info", - ] - - when: - TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - context == null - } - - def "extract http headers with out of range trace ID"() { - setup: - String outOfRangeTraceId = (TRACE_ID_MAX + 1).toString() - def headers = [ - (TRACE_ID_KEY.toUpperCase()) : outOfRangeTraceId, - (SPAN_ID_KEY.toUpperCase()) : "0", - (OT_BAGGAGE_PREFIX.toUpperCase() + "k1"): "v1", - (OT_BAGGAGE_PREFIX.toUpperCase() + "k2"): "v2", - SOME_HEADER : "my-interesting-info", - ] - - when: - TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - context == null - } - - def "extract http headers with out of range span ID"() { - setup: - def headers = [ - (TRACE_ID_KEY.toUpperCase()) : "0", - (SPAN_ID_KEY.toUpperCase()) : "-1", - (OT_BAGGAGE_PREFIX.toUpperCase() + "k1"): "v1", - (OT_BAGGAGE_PREFIX.toUpperCase() + "k2"): "v2", - SOME_HEADER : "my-interesting-info", - ] - - when: - TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - context == null - } - - def "more ID range validation"() { - setup: - def headers = [ - (TRACE_ID_KEY.toUpperCase()): traceId, - (SPAN_ID_KEY.toUpperCase()) : spanId, - ] - - when: - final ExtractedContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - if (expectedTraceId) { - assert context.traceId == expectedTraceId - assert context.spanId == expectedSpanId - } else { - assert context == null - } - - where: - traceId | spanId | expectedTraceId | expectedSpanId - "-1" | "1" | null | null - "1" | "-1" | null | null - "0" | "1" | null | null - "1" | "0" | DD64bTraceId.ONE | DDSpanId.ZERO - "$TRACE_ID_MAX" | "1" | DD64bTraceId.MAX | 1 - "${TRACE_ID_MAX + 1}" | "1" | null | null - "1" | "$TRACE_ID_MAX" | DD64bTraceId.ONE | DDSpanId.MAX - "1" | "${TRACE_ID_MAX + 1}" | null | null - } - - def "extract http headers with end to end"() { - setup: - def headers = [ - "" : "empty key", - (TRACE_ID_KEY.toUpperCase()) : traceId, - (SPAN_ID_KEY.toUpperCase()) : spanId, - (OT_BAGGAGE_PREFIX.toUpperCase() + "k1"): "v1", - (OT_BAGGAGE_PREFIX.toUpperCase() + "t0"): endToEndStartTime, - (OT_BAGGAGE_PREFIX.toUpperCase() + "k2"): "v2", - SOME_HEADER : "my-interesting-info", - SOME_CUSTOM_BAGGAGE_HEADER : "my-interesting-baggage-info", - SOME_CUSTOM_BAGGAGE_HEADER_2 : "my-interesting-baggage-info-2", - ] - - when: - final ExtractedContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - context.traceId == DDTraceId.from(traceId) - context.spanId == DDSpanId.from(spanId) - context.baggage == ["k1": "v1", - "k2": "v2", - "some-baggage": "my-interesting-baggage-info", - "some-CaseSensitive-baggage": "my-interesting-baggage-info-2"] - context.tags == ["some-tag": "my-interesting-info"] - context.endToEndStartTime == endToEndStartTime * 1000000L - - where: - traceId | spanId | endToEndStartTime - "1" | "2" | 0 - "2" | "3" | 1610001234 - } - - def "baggage is mapped on context creation"() { - setup: - def headers = [ - (TRACE_ID_KEY.toUpperCase()) : traceId, - (SPAN_ID_KEY.toUpperCase()) : spanId, - SOME_CUSTOM_BAGGAGE_HEADER : "mappedBaggageValue", - (OT_BAGGAGE_PREFIX.toUpperCase() + "k1"): "v1", - (OT_BAGGAGE_PREFIX.toUpperCase() + "k2"): "v2", - SOME_ARBITRARY_HEADER : "my-interesting-info", - ] - - when: - final TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - if (ctxCreated) { - assert context != null - assert context.getBaggage() == [ - "some-baggage" : "mappedBaggageValue", - "k1" : "v1", - "k2" : "v2", - ] - } else { - assert context == null - } - - where: - ctxCreated | traceId | spanId - false | "-1" | "1" - false | "1" | "-1" - true | "0" | "1" - true | "${TRACE_ID_MAX - 1}" | "${TRACE_ID_MAX - 1}" - } - - def "extract common http headers"() { - setup: - def headers = [ - (HttpCodec.USER_AGENT_KEY): 'some-user-agent', - (HttpCodec.X_CLUSTER_CLIENT_IP_KEY): '1.1.1.1', - (HttpCodec.X_REAL_IP_KEY): '2.2.2.2', - (HttpCodec.X_CLIENT_IP_KEY): '3.3.3.3', - (HttpCodec.TRUE_CLIENT_IP_KEY): '4.4.4.4', - (HttpCodec.FORWARDED_FOR_KEY): '5.5.5.5', - (HttpCodec.FORWARDED_KEY): '6.6.6.6', - (HttpCodec.FASTLY_CLIENT_IP_KEY): '7.7.7.7', - (HttpCodec.CF_CONNECTING_IP_KEY): '8.8.8.8', - (HttpCodec.CF_CONNECTING_IP_V6_KEY): '9.9.9.9', - ] - - when: - final TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - assert context.userAgent == 'some-user-agent' - assert context.XClusterClientIp == '1.1.1.1' - assert context.XRealIp == '2.2.2.2' - assert context.XClientIp == '3.3.3.3' - assert context.trueClientIp == '4.4.4.4' - assert context.forwardedFor == '5.5.5.5' - assert context.forwarded == '6.6.6.6' - assert context.fastlyClientIp == '7.7.7.7' - assert context.cfConnectingIp == '8.8.8.8' - assert context.cfConnectingIpv6 == '9.9.9.9' - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/DatadogHttpInjectorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/DatadogHttpInjectorTest.groovy deleted file mode 100644 index a51a37fd929..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/DatadogHttpInjectorTest.groovy +++ /dev/null @@ -1,233 +0,0 @@ -package datadog.trace.core.propagation - -import datadog.trace.api.DD128bTraceId -import datadog.trace.api.DDSpanId -import datadog.trace.api.DDTraceId -import datadog.trace.api.internal.util.LongStringUtils -import datadog.trace.api.datastreams.NoopPathwayContext -import datadog.trace.common.writer.ListWriter -import datadog.trace.core.DDSpanContext -import datadog.trace.core.test.DDCoreSpecification - -import static datadog.trace.api.sampling.PrioritySampling.* -import static datadog.trace.api.sampling.SamplingMechanism.* -import static datadog.trace.core.CoreTracer.TRACE_ID_MAX -import static datadog.trace.core.propagation.DatadogHttpCodec.* - - -class DatadogHttpInjectorTest extends DDCoreSpecification { - - HttpCodec.Injector injector = newInjector(["some-baggage-key":"SOME_CUSTOM_HEADER"]) - - def "inject http headers"() { - setup: - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - final DDSpanContext mockedContext = - new DDSpanContext( - DDTraceId.from(traceId), - DDSpanId.from(spanId), - DDSpanId.ZERO, - null, - "fakeService", - "fakeOperation", - "fakeResource", - samplingPriority, - origin, - ["k1" : "v1", "k2" : "v2","some-baggage-key": "some-value"], - false, - "fakeType", - 0, - tracer.traceCollectorFactory.create(DDTraceId.ONE), - null, - null, - NoopPathwayContext.INSTANCE, - false, - PropagationTags.factory().fromHeaderValue(PropagationTags.HeaderType.DATADOG, "_dd.p.usr=123")) - - final Map carrier = Mock() - - when: - injector.inject(mockedContext, carrier, MapSetter.INSTANCE) - - then: - 1 * carrier.put(TRACE_ID_KEY, traceId.toString()) - 1 * carrier.put(SPAN_ID_KEY, spanId.toString()) - if (samplingPriority != UNSET) { - 1 * carrier.put(SAMPLING_PRIORITY_KEY, "$samplingPriority") - } - if (origin) { - 1 * carrier.put(ORIGIN_KEY, origin) - } - 1 * carrier.put(OT_BAGGAGE_PREFIX + "k1", "v1") - 1 * carrier.put(OT_BAGGAGE_PREFIX + "k2", "v2") - 1 * carrier.put("SOME_CUSTOM_HEADER", "some-value") - 1 * carrier.put(DATADOG_TAGS_KEY, "_dd.p.usr=123") - 0 * _ - - cleanup: - tracer.close() - - where: - traceId | spanId | samplingPriority | samplingMechanism | origin - "1" | "2" | UNSET | UNKNOWN | null - "1" | "2" | SAMPLER_KEEP | DEFAULT | "saipan" - "$TRACE_ID_MAX" | "${TRACE_ID_MAX - 1}" | UNSET | UNKNOWN | "saipan" - "${TRACE_ID_MAX - 1}" | "$TRACE_ID_MAX" | SAMPLER_KEEP | DEFAULT | null - } - - def "inject http headers with end-to-end"() { - setup: - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - final DDSpanContext mockedContext = - new DDSpanContext( - DDTraceId.from("1"), - DDSpanId.from("2"), - DDSpanId.ZERO, - null, - "fakeService", - "fakeOperation", - "fakeResource", - UNSET, - "fakeOrigin", - ["k1" : "v1", "k2" : "v2"], - false, - "fakeType", - 0, - tracer.traceCollectorFactory.create(DDTraceId.ONE), - null, - null, - NoopPathwayContext.INSTANCE, - false, - PropagationTags.factory().fromHeaderValue(PropagationTags.HeaderType.DATADOG, "_dd.p.dm=-4,_dd.p.anytag=value")) - - mockedContext.beginEndToEnd() - - final Map carrier = Mock() - - when: - injector.inject(mockedContext, carrier, MapSetter.INSTANCE) - - then: - 1 * carrier.put(TRACE_ID_KEY, "1") - 1 * carrier.put(SPAN_ID_KEY, "2") - 1 * carrier.put(ORIGIN_KEY, "fakeOrigin") - 1 * carrier.put(OT_BAGGAGE_PREFIX + "t0", "${(long) (mockedContext.endToEndStartTime / 1000000L)}") - 1 * carrier.put(OT_BAGGAGE_PREFIX + "k1", "v1") - 1 * carrier.put(OT_BAGGAGE_PREFIX + "k2", "v2") - 1 * carrier.put(DATADOG_TAGS_KEY, '_dd.p.dm=-4,_dd.p.anytag=value') - 0 * _ - - cleanup: - tracer.close() - } - - def "inject the decision maker tag"() { - setup: - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - final DDSpanContext mockedContext = - new DDSpanContext( - DDTraceId.from("1"), - DDSpanId.from("2"), - DDSpanId.ZERO, - null, - "fakeService", - "fakeOperation", - "fakeResource", - UNSET, - "fakeOrigin", - ["k1" : "v1", "k2" : "v2"], - false, - "fakeType", - 0, - tracer.traceCollectorFactory.create(DDTraceId.ONE), - null, - null, - NoopPathwayContext.INSTANCE, - false, - PropagationTags.factory().empty()) - - mockedContext.setSamplingPriority(USER_KEEP, MANUAL) - - final Map carrier = Mock() - - when: - injector.inject(mockedContext, carrier, MapSetter.INSTANCE) - - then: - 1 * carrier.put(TRACE_ID_KEY, "1") - 1 * carrier.put(SPAN_ID_KEY, "2") - 1 * carrier.put(ORIGIN_KEY, "fakeOrigin") - 1 * carrier.put(OT_BAGGAGE_PREFIX + "k1", "v1") - 1 * carrier.put(OT_BAGGAGE_PREFIX + "k2", "v2") - 1 * carrier.put('x-datadog-sampling-priority', '2') - 1 * carrier.put(DATADOG_TAGS_KEY, '_dd.p.dm=-4') - 0 * _ - - cleanup: - tracer.close() - } - - def "inject http headers with 128-bit TraceId"() { - setup: - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - def traceId = DD128bTraceId.fromHex(hexId) - final DDSpanContext mockedContext = - new DDSpanContext( - traceId, - DDSpanId.from("2"), - DDSpanId.ZERO, - null, - "fakeService", - "fakeOperation", - "fakeResource", - UNSET, - null, - ["k1" : "v1", "k2" : "v2"], - false, - "fakeType", - 0, - tracer.traceCollectorFactory.create(DDTraceId.ONE), - null, - null, - NoopPathwayContext.INSTANCE, - false, - PropagationTags.factory().fromHeaderValue(PropagationTags.HeaderType.DATADOG, "_dd.p.dm=-4,_dd.p.anytag=value")) - - mockedContext.beginEndToEnd() - - final Map carrier = Mock() - - when: - injector.inject(mockedContext, carrier, MapSetter.INSTANCE) - - then: - 1 * carrier.put(TRACE_ID_KEY, traceId.toString()) - 1 * carrier.put(SPAN_ID_KEY, "2") - 1 * carrier.put(OT_BAGGAGE_PREFIX + "t0", "${(long) (mockedContext.endToEndStartTime / 1000000L)}") - 1 * carrier.put(OT_BAGGAGE_PREFIX + "k1", "v1") - 1 * carrier.put(OT_BAGGAGE_PREFIX + "k2", "v2") - if (traceId.toHighOrderLong() == 0) { - 1 * carrier.put(DATADOG_TAGS_KEY, '_dd.p.dm=-4,_dd.p.anytag=value') - } else { - def tId = LongStringUtils.toHexStringPadded(traceId.toHighOrderLong(), 16) - 1 * carrier.put(DATADOG_TAGS_KEY, "_dd.p.dm=-4,_dd.p.tid=${tId},_dd.p.anytag=value") - } - 0 * _ - - cleanup: - tracer.close() - - where: - hexId << [ - "1", - "123456789abcdef0", - "123456789abcdef0123456789abcdef0", - "64184f2400000000123456789abcdef0", - "f" * 32 - ] - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/DatadogPropagationTagsTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/DatadogPropagationTagsTest.groovy deleted file mode 100644 index 60a56900a36..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/DatadogPropagationTagsTest.groovy +++ /dev/null @@ -1,211 +0,0 @@ -package datadog.trace.core.propagation - -import datadog.trace.api.Config -import datadog.trace.api.ProductTraceSource -import datadog.trace.core.test.DDCoreSpecification - -import static datadog.trace.api.sampling.PrioritySampling.* -import static datadog.trace.api.sampling.SamplingMechanism.* - -class DatadogPropagationTagsTest extends DDCoreSpecification { - - def "create propagation tags from header value '#headerValue'"() { - setup: - def config = Mock(Config) - config.getxDatadogTagsMaxLength() >> 512 - def propagationTagsFactory = PropagationTags.factory(config) - - when: - def propagationTags = propagationTagsFactory.fromHeaderValue(PropagationTags.HeaderType.DATADOG, headerValue) - - then: - propagationTags.headerValue(PropagationTags.HeaderType.DATADOG) == expectedHeaderValue - propagationTags.createTagMap() == tags - - where: - headerValue | expectedHeaderValue | tags - null | null | [:] - "" | null | [:] - "_dd.p.dm=934086a686-4" | "_dd.p.dm=934086a686-4" | ["_dd.p.dm": "934086a686-4"] - "_dd.p.dm=934086a686-10" | "_dd.p.dm=934086a686-10" | ["_dd.p.dm": "934086a686-10"] - "_dd.p.dm=934086a686-102" | "_dd.p.dm=934086a686-102" | ["_dd.p.dm": "934086a686-102"] - "_dd.p.dm=-1" | "_dd.p.dm=-1" | ["_dd.p.dm": "-1"] - "_dd.p.anytag=value" | "_dd.p.anytag=value" | ["_dd.p.anytag": "value"] - // drop _dd.p.upstream_services and any other but _dd.p.* - "_dd.b.somekey=value" | null | [:] - "_dd.p.upstream_services=bWNudWx0eS13ZWI|0|1|0.1" | null | [:] - "_dd.p.dm=934086a686-4,_dd.p.anytag=value" | "_dd.p.dm=934086a686-4,_dd.p.anytag=value" | ["_dd.p.dm": "934086a686-4", "_dd.p.anytag": "value"] - "_dd.p.dm=934086a686-4,_dd.p.upstream_services=bWNudWx0eS13ZWI|0|1|0.1,_dd.p.anytag=value" | "_dd.p.dm=934086a686-4,_dd.p.anytag=value" | ["_dd.p.dm": "934086a686-4", "_dd.p.anytag": "value"] - "_dd.b.keyonly=value,_dd.p.dm=934086a686-4,_dd.p.upstream_services=bWNudWx0eS13ZWI|0|1|0.1,_dd.p.anytag=value" | "_dd.p.dm=934086a686-4,_dd.p.anytag=value" | ["_dd.p.dm": "934086a686-4", "_dd.p.anytag": "value"] - // valid tag value containing spaces - "_dd.p.ab=1 2 3" | "_dd.p.ab=1 2 3" | ["_dd.p.ab": "1 2 3"] - "_dd.p.ab= 123 " | "_dd.p.ab= 123 " | ["_dd.p.ab": " 123 "] - // decoding error - "_dd.p.keyonly" | null | ["_dd.propagation_error": "decoding_error"] - ",_dd.p.dm=Value" | null | ["_dd.propagation_error": "decoding_error"] - "," | null | ["_dd.propagation_error": "decoding_error"] // invalid comma only tagSet - "_dd.b.somekey=value,_dd.p.dm=934086a686-4,_dd.p.keyonly,_dd.p.upstream_services=bWNudWx0eS13ZWI|0|1|0.1,_dd.p.anytag=value" | null | ["_dd.propagation_error": "decoding_error"] // invalid _dd.p.keyonly tag without a value - "_dd.p.keyonly,_dd.p.dm=934086a686-4,_dd.p.upstream_services=bWNudWx0eS13ZWI|0|1|0.1,_dd.p.anytag=value" | null | ["_dd.propagation_error": "decoding_error"] // - ",_dd.p.dm=934086a686-4,_dd.p.upstream_services=bWNudWx0eS13ZWI|0|1|0.1,_dd.p.anytag=value" | null | ["_dd.propagation_error": "decoding_error"] // invalid tagSet with a leading comma - "_dd.p.dm=934086a686-4,,_dd.p.upstream_services=bWNudWx0eS13ZWI|0|1|0.1,_dd.p.anytag=value" | null | ["_dd.propagation_error": "decoding_error"] // invalid tagSet with two commas in a row - "_dd.p.dm=934086a686-4, ,_dd.p.upstream_services=bWNudWx0eS13ZWI|0|1|0.1,_dd.p.anytag=value" | null | ["_dd.propagation_error": "decoding_error"] // invalid tagSet with a space instead of a tag - // do not validate tag value if the tag is dropped - "_dd.p.upstream_services=bmV1dHJvbg==|0|1|0.2253" | null | [:] - " _dd.p.ab=123" | null | ["_dd.propagation_error": "decoding_error"] // invalid tag set containing leading space - "_dd.p.a b=123" | null | ["_dd.propagation_error": "decoding_error"] // invalid tag key containing space - "_dd.p.ab =123" | null | ["_dd.propagation_error": "decoding_error"] // invalid tag key containing space - "_dd.p. ab=123" | null | ["_dd.propagation_error": "decoding_error"] // invalid tag key containing space - "_dd.p.a=b=1=2" | "_dd.p.a=b=1=2" | ["_dd.p.a": "b=1=2"] - "_dd.p.1ö2=value" | null | ["_dd.propagation_error": "decoding_error"] // invalid tag key containing not allowed char - "_dd.p.ab=1=2" | "_dd.p.ab=1=2" | ["_dd.p.ab": "1=2"] - "_dd.p.ab=1ô2" | null | ["_dd.propagation_error": "decoding_error"] // invalid tag value containing not allowed char - "_dd.p.dm=934086A686-4" | null | ["_dd.propagation_error": "decoding_error"] // invalid dm tag value contains invalid char - "_dd.p.dm=934086a66-4" | null | ["_dd.propagation_error": "decoding_error"] // invalid dm tag value shorter than 10 chars - "_dd.p.dm=934086a6653-4" | null | ["_dd.propagation_error": "decoding_error"] // invalid dm tag value longer than 10 chars - "_dd.p.dm=934086a66534" | null | ["_dd.propagation_error": "decoding_error"] // invalid dm tag value missing separator - "_dd.p.dm=934086a665-" | null | ["_dd.propagation_error": "decoding_error"] // invalid dm tag value missing sampling mechanism - "_dd.p.dm=934086a665-a" | null | ["_dd.propagation_error": "decoding_error"] // invalid dm tag value sampling mechanism contains invalid char - "_dd.p.dm=934086a665-12b" | null | ["_dd.propagation_error": "decoding_error"] // invalid dm tag value sampling mechanism contains invalid char - "_dd.p.tid=" | null | ["_dd.propagation_error": "decoding_error"] // invalid tid tag value: empty value - "_dd.p.tid=" + "1" * 1 | null | ["_dd.propagation_error": "malformed_tid 1"] // invalid tid tag value: invalid length - "_dd.p.tid=" + "1" * 15 | null | ["_dd.propagation_error": "malformed_tid 111111111111111"] // invalid tid tag value: invalid length - "_dd.p.tid=" + "1" * 17 | null | ["_dd.propagation_error": "malformed_tid 11111111111111111"] // invalid tid tag value: invalid length - "_dd.p.tid=123456789ABCDEF0" | null | ["_dd.propagation_error": "malformed_tid 123456789ABCDEF0"] // invalid tid tag value: upper-case characters - "_dd.p.tid=123456789abcdefg" | null | ["_dd.propagation_error": "malformed_tid 123456789abcdefg"] // invalid tid tag value: non-hexadecimal characters - "_dd.p.tid=-123456789abcdef" | null | ["_dd.propagation_error": "malformed_tid -123456789abcdef"] // invalid tid tag value: non-hexadecimal characters - "_dd.p.ts=02" | "_dd.p.ts=02" | ["_dd.p.ts": "02"] - "_dd.p.ts=00" | null | [:] - "_dd.p.ts=foo" | null | ["_dd.propagation_error": "decoding_error"] - } - - def "datadog propagation tags should translate to w3c tags #headerValue"() { - setup: - def config = Mock(Config) - config.getxDatadogTagsMaxLength() >> 512 - def propagationTagsFactory = PropagationTags.factory(config) - - when: - def propagationTags = propagationTagsFactory.fromHeaderValue(PropagationTags.HeaderType.DATADOG, headerValue) - - then: - propagationTags.headerValue(PropagationTags.HeaderType.W3C) == expectedHeaderValue - propagationTags.createTagMap() == tags - - where: - headerValue | expectedHeaderValue | tags - '_dd.p.dm=934086a686-4' | 'dd=t.dm:934086a686-4' | ['_dd.p.dm': '934086a686-4'] - '_dd.p.dm=934086a686-4,_dd.p.f=w00t==' | 'dd=t.dm:934086a686-4;t.f:w00t~~' | ['_dd.p.dm': '934086a686-4', '_dd.p.f': 'w00t=='] - '_dd.p.dm=934086a686-4,_dd.p.appsec=1' | 'dd=t.dm:934086a686-4;t.appsec:1' | ['_dd.p.dm': '934086a686-4', '_dd.p.appsec': '1'] - } - - def "update propagation tags sampling mechanism #originalTagSet"() { - setup: - def config = Mock(Config) - config.getxDatadogTagsMaxLength() >> 512 - def propagationTagsFactory = PropagationTags.factory(config) - def propagationTags = propagationTagsFactory.fromHeaderValue(PropagationTags.HeaderType.DATADOG, originalTagSet) - - when: - propagationTags.updateTraceSamplingPriority(priority, mechanism) - - then: - propagationTags.headerValue(PropagationTags.HeaderType.DATADOG) == expectedHeaderValue - propagationTags.createTagMap() == tags - - where: - originalTagSet | priority | mechanism | expectedHeaderValue | tags - // keep the existing dm tag as is - "_dd.p.dm=934086a686-4" | UNSET | UNKNOWN | "_dd.p.dm=934086a686-4" | ["_dd.p.dm": "934086a686-4"] - "_dd.p.dm=934086a686-3" | SAMPLER_KEEP | AGENT_RATE | "_dd.p.dm=934086a686-3" | ["_dd.p.dm": "934086a686-3"] - "_dd.p.dm=93485302ab-1" | SAMPLER_KEEP | APPSEC | "_dd.p.dm=93485302ab-1" | ["_dd.p.dm": "93485302ab-1"] - "_dd.p.dm=934086a686-4,_dd.p.anytag=value" | SAMPLER_KEEP | AGENT_RATE | "_dd.p.dm=934086a686-4,_dd.p.anytag=value" | ["_dd.p.dm": "934086a686-4", "_dd.p.anytag": "value"] - "_dd.p.dm=93485302ab-2,_dd.p.anytag=value" | SAMPLER_KEEP | APPSEC | "_dd.p.dm=93485302ab-2,_dd.p.anytag=value" | ["_dd.p.dm": "93485302ab-2", "_dd.p.anytag": "value"] - "_dd.p.anytag=value,_dd.p.dm=934086a686-4" | SAMPLER_KEEP | AGENT_RATE | "_dd.p.dm=934086a686-4,_dd.p.anytag=value" | ["_dd.p.anytag": "value", "_dd.p.dm": "934086a686-4"] - "_dd.p.anytag=value,_dd.p.dm=93485302ab-2" | SAMPLER_KEEP | APPSEC | "_dd.p.dm=93485302ab-2,_dd.p.anytag=value" | ["_dd.p.anytag": "value", "_dd.p.dm": "93485302ab-2"] - "_dd.p.anytag=value,_dd.p.dm=934086a686-4,_dd.p.atag=value" | SAMPLER_KEEP | AGENT_RATE | "_dd.p.dm=934086a686-4,_dd.p.anytag=value,_dd.p.atag=value" | ["_dd.p.anytag": "value", "_dd.p.dm": "934086a686-4", "_dd.p.atag": "value"] - "_dd.p.anytag=value,_dd.p.dm=93485302ab-2,_dd.p.atag=value" | SAMPLER_KEEP | APPSEC | "_dd.p.dm=93485302ab-2,_dd.p.anytag=value,_dd.p.atag=value" | ["_dd.p.anytag": "value", "_dd.p.dm": "93485302ab-2", "_dd.p.atag": "value"] - "_dd.p.dm=93485302ab-2" | USER_DROP | MANUAL | "_dd.p.dm=93485302ab-2" | ["_dd.p.dm": "93485302ab-2"] - "_dd.p.anytag=value,_dd.p.dm=93485302ab-2" | SAMPLER_DROP | MANUAL | "_dd.p.dm=93485302ab-2,_dd.p.anytag=value" | ["_dd.p.anytag": "value", "_dd.p.dm": "93485302ab-2"] - "_dd.p.dm=93485302ab-2,_dd.p.anytag=value" | USER_DROP | MANUAL | "_dd.p.dm=93485302ab-2,_dd.p.anytag=value" | ["_dd.p.dm": "93485302ab-2", "_dd.p.anytag": "value"] - "_dd.p.atag=value,_dd.p.dm=93485302ab-2,_dd.p.anytag=value" | USER_DROP | MANUAL | "_dd.p.dm=93485302ab-2,_dd.p.atag=value,_dd.p.anytag=value" | ["_dd.p.atag": "value", "_dd.p.dm": "93485302ab-2", "_dd.p.anytag": "value"] - // propagate sampling mechanism only - "" | SAMPLER_KEEP | DEFAULT | "_dd.p.dm=-0" | ["_dd.p.dm": "-0"] - "" | SAMPLER_KEEP | AGENT_RATE | "_dd.p.dm=-1" | ["_dd.p.dm": "-1"] - "_dd.p.anytag=value" | USER_KEEP | MANUAL | "_dd.p.dm=-4,_dd.p.anytag=value" | ["_dd.p.anytag": "value", "_dd.p.dm": "-4"] - "_dd.p.anytag=value,_dd.p.atag=value" | SAMPLER_DROP | MANUAL | "_dd.p.anytag=value,_dd.p.atag=value" | ["_dd.p.anytag": "value", "_dd.p.atag": "value"] - // do not set the dm tags when mechanism is UNKNOWN - "_dd.p.anytag=123" | SAMPLER_KEEP | UNKNOWN | "_dd.p.anytag=123" | ["_dd.p.anytag": "123"] - // invalid input - ",_dd.p.dm=Value" | SAMPLER_KEEP | AGENT_RATE | "_dd.p.dm=-1" | ["_dd.propagation_error": "decoding_error", "_dd.p.dm": "-1"] - } - - def "update propagation tags trace source propagation #originalTagSet"() { - setup: - def config = Mock(Config) - config.getxDatadogTagsMaxLength() >> 512 - def propagationTagsFactory = PropagationTags.factory(config) - def propagationTags = propagationTagsFactory.fromHeaderValue(PropagationTags.HeaderType.DATADOG, originalTagSet) - - when: - propagationTags.addTraceSource(product) - - then: - propagationTags.headerValue(PropagationTags.HeaderType.DATADOG) == expectedHeaderValue - propagationTags.createTagMap() == tags - - where: - originalTagSet | product | expectedHeaderValue | tags - // keep the existing dm tag as is - "" | ProductTraceSource.ASM | "_dd.p.ts=02" | ["_dd.p.ts": "02"] - "_dd.p.ts=00" | ProductTraceSource.ASM | "_dd.p.ts=02" | ["_dd.p.ts": "02"] - "_dd.p.ts=FFC00000" | ProductTraceSource.ASM | "_dd.p.ts=02" | ["_dd.p.ts": "02"] - "_dd.p.ts=02" | ProductTraceSource.DBM | "_dd.p.ts=12" | ["_dd.p.ts": "12"] - //Invalid input - "_dd.p.ts=" | ProductTraceSource.UNSET | null | ["_dd.propagation_error": "decoding_error"] - "_dd.p.ts=0" | ProductTraceSource.UNSET | null | ["_dd.propagation_error": "decoding_error"] - "_dd.p.ts=0G" | ProductTraceSource.UNSET | null | ["_dd.propagation_error": "decoding_error"] - "_dd.p.ts=GG" | ProductTraceSource.UNSET | null | ["_dd.propagation_error": "decoding_error"] - "_dd.p.ts=foo" | ProductTraceSource.UNSET | null | ["_dd.propagation_error": "decoding_error"] - "_dd.p.ts=000000002" | ProductTraceSource.UNSET | null | ["_dd.propagation_error": "decoding_error"] - } - - def extractionLimitExceeded() { - setup: - def tags = "_dd.p.anytag=value" - def limit = tags.length() - 1 - def propagationTags = PropagationTags.factory(limit).fromHeaderValue(PropagationTags.HeaderType.DATADOG, tags) - - when: - propagationTags.updateTraceSamplingPriority(USER_KEEP, MANUAL) - - then: - propagationTags.headerValue(PropagationTags.HeaderType.DATADOG) == "_dd.p.dm=-4" - propagationTags.createTagMap() == ["_dd.propagation_error": "extract_max_size", "_dd.p.dm": "-4"] - } - - def injectionLimitExceeded() { - setup: - def tags = "_dd.p.anytag=value" - def limit = tags.length() - def propagationTags = PropagationTags.factory(limit).fromHeaderValue(PropagationTags.HeaderType.DATADOG, tags) - - when: - propagationTags.updateTraceSamplingPriority(USER_KEEP, MANUAL) - - then: - propagationTags.headerValue(PropagationTags.HeaderType.DATADOG) == null - propagationTags.createTagMap() == ["_dd.propagation_error": "inject_max_size"] - } - - def injectionLimitExceededLimit0() { - setup: - def propagationTags = PropagationTags.factory(0).fromHeaderValue(PropagationTags.HeaderType.DATADOG, "") - - when: - propagationTags.updateTraceSamplingPriority(USER_KEEP, MANUAL) - - then: - propagationTags.headerValue(PropagationTags.HeaderType.DATADOG) == null - propagationTags.createTagMap() == ["_dd.propagation_error": "disabled"] - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/HaystackHttpExtractorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/HaystackHttpExtractorTest.groovy deleted file mode 100644 index b3b7080cf14..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/HaystackHttpExtractorTest.groovy +++ /dev/null @@ -1,324 +0,0 @@ -package datadog.trace.core.propagation - -import datadog.trace.api.Config -import datadog.trace.api.DD64bTraceId -import datadog.trace.api.DynamicConfig - -import static datadog.trace.api.config.TracerConfig.PROPAGATION_EXTRACT_LOG_HEADER_NAMES_ENABLED -import static datadog.trace.core.CoreTracer.TRACE_ID_MAX -import static datadog.trace.core.propagation.HaystackHttpCodec.OT_BAGGAGE_PREFIX -import static datadog.trace.core.propagation.HaystackHttpCodec.SPAN_ID_KEY -import static datadog.trace.core.propagation.HaystackHttpCodec.TRACE_ID_KEY - -import datadog.trace.api.DDSpanId -import datadog.trace.api.DDTraceId -import datadog.trace.api.sampling.PrioritySampling -import datadog.trace.bootstrap.ActiveSubsystems -import datadog.trace.bootstrap.instrumentation.api.ContextVisitors -import datadog.trace.bootstrap.instrumentation.api.TagContext -import datadog.trace.test.util.DDSpecification - -class HaystackHttpExtractorTest extends DDSpecification { - - DynamicConfig dynamicConfig - HttpCodec.Extractor extractor - - boolean origAppSecActive - - void setup() { - DynamicConfig dynamicConfig = DynamicConfig.create() - .setHeaderTags(["SOME_HEADER": "some-tag"]) - .setBaggageMapping(["SOME_CUSTOM_BAGGAGE_HEADER": "some-baggage", "SOME_CUSTOM_BAGGAGE_HEADER_2": "some-CaseSensitive-baggage"]) - .apply() - extractor = HaystackHttpCodec.newExtractor(Config.get(), { dynamicConfig.captureTraceConfig() }) - origAppSecActive = ActiveSubsystems.APPSEC_ACTIVE - ActiveSubsystems.APPSEC_ACTIVE = true - - injectSysConfig(PROPAGATION_EXTRACT_LOG_HEADER_NAMES_ENABLED, "true") - } - - void cleanup() { - ActiveSubsystems.APPSEC_ACTIVE = origAppSecActive - } - - def "extract http headers"() { - setup: - def headers = [ - "" : "empty key", - (TRACE_ID_KEY.toUpperCase()) : traceUuid, - (SPAN_ID_KEY.toUpperCase()) : spanUuid, - (OT_BAGGAGE_PREFIX.toUpperCase() + "k1"): "v1", - (OT_BAGGAGE_PREFIX.toUpperCase() + "k2"): "%76%32", // v2 encoded once - (OT_BAGGAGE_PREFIX.toUpperCase() + "k3"): "%25%37%36%25%33%33", // v3 encoded twice - SOME_HEADER : "my-interesting-info", - SOME_CUSTOM_BAGGAGE_HEADER : "my-interesting-baggage-info", - SOME_CUSTOM_BAGGAGE_HEADER_2 : "my-interesting-baggage-info-2", - ] - - when: - final ExtractedContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - context.traceId == DDTraceId.from(traceId) - context.spanId == DDSpanId.from(spanId) - context.baggage == ["k1": "v1", "k2": "v2", - "k3": "%76%33", // expect value decoded only once - "Haystack-Trace-ID": traceUuid, "Haystack-Span-ID": spanUuid, - "some-baggage": "my-interesting-baggage-info", - "some-CaseSensitive-baggage": "my-interesting-baggage-info-2"] - context.tags == ["some-tag": "my-interesting-info"] - context.samplingPriority == samplingPriority - context.origin == origin - - where: - traceId | spanId | samplingPriority | origin | traceUuid | spanUuid - "1" | "2" | PrioritySampling.SAMPLER_KEEP | null | "44617461-646f-6721-0000-000000000001" | "44617461-646f-6721-0000-000000000002" - "2" | "3" | PrioritySampling.SAMPLER_KEEP | null | "44617461-646f-6721-0000-000000000002" | "44617461-646f-6721-0000-000000000003" - "${TRACE_ID_MAX}" | "${TRACE_ID_MAX - 6}" | PrioritySampling.SAMPLER_KEEP | null | "44617461-646f-6721-ffff-ffffffffffff" | "44617461-646f-6721-ffff-fffffffffff9" - "${TRACE_ID_MAX - 1}" | "${TRACE_ID_MAX - 7}" | PrioritySampling.SAMPLER_KEEP | null | "44617461-646f-6721-ffff-fffffffffffe" | "44617461-646f-6721-ffff-fffffffffff8" - } - - def "extract header tags with no propagation"() { - when: - TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - !(context instanceof ExtractedContext) - context.getTags() == ["some-tag": "my-interesting-info"] - - - where: - headers | _ - [SOME_HEADER: "my-interesting-info"] | _ - } - - def "extract headers with forwarding"() { - when: - TagContext context = extractor.extract(tagOnlyCtx, ContextVisitors.stringValuesMap()) - - then: - context != null - !(context instanceof ExtractedContext) - context.forwarded == "for=$forwardedIp:$forwardedPort" - - when: - context = extractor.extract(fullCtx, ContextVisitors.stringValuesMap()) - - then: - context instanceof ExtractedContext - context.traceId.toLong() == 1 - context.spanId == 2 - context.forwarded == "for=$forwardedIp:$forwardedPort" - - where: - forwardedIp = "1.2.3.4" - forwardedPort = "123" - tagOnlyCtx = [ - "Forwarded" : "for=$forwardedIp:$forwardedPort" - ] - fullCtx = [ - (TRACE_ID_KEY.toUpperCase()): 1, - (SPAN_ID_KEY.toUpperCase()) : 2, - "Forwarded" : "for=$forwardedIp:$forwardedPort" - ] - } - - def "extract headers with x-forwarding"() { - when: - TagContext context = extractor.extract(tagOnlyCtx, ContextVisitors.stringValuesMap()) - - then: - context != null - context instanceof TagContext - context.XForwardedFor == forwardedIp - context.XForwardedPort == forwardedPort - - when: - context = extractor.extract(fullCtx, ContextVisitors.stringValuesMap()) - - then: - context instanceof ExtractedContext - context.traceId.toLong() == 1 - context.spanId == 2 - context.XForwardedFor == forwardedIp - context.XForwardedPort == forwardedPort - - where: - forwardedIp = "1.2.3.4" - forwardedPort = "123" - tagOnlyCtx = [ - "X-Forwarded-For" : forwardedIp, - "X-Forwarded-Port": forwardedPort - ] - fullCtx = [ - (TRACE_ID_KEY.toUpperCase()): 1, - (SPAN_ID_KEY.toUpperCase()) : 2, - "x-forwarded-for" : forwardedIp, - "x-forwarded-port" : forwardedPort - ] - } - - def "extract empty headers returns null"() { - expect: - extractor.extract(["ignored-header": "ignored-value"], ContextVisitors.stringValuesMap()) == null - } - - def "extract http headers with invalid non-numeric ID"() { - setup: - def headers = [ - (TRACE_ID_KEY.toUpperCase()) : "traceId", - (SPAN_ID_KEY.toUpperCase()) : "spanId", - (OT_BAGGAGE_PREFIX.toUpperCase() + "k1"): "v1", - (OT_BAGGAGE_PREFIX.toUpperCase() + "k2"): "v2", - SOME_HEADER : "my-interesting-info", - ] - - when: - TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - context == null - } - - def "extract http headers with out of range trace ID"() { - setup: - String outOfRangeTraceId = (TRACE_ID_MAX + 1).toString() - def headers = [ - (TRACE_ID_KEY.toUpperCase()) : outOfRangeTraceId, - (SPAN_ID_KEY.toUpperCase()) : "0", - (OT_BAGGAGE_PREFIX.toUpperCase() + "k1"): "v1", - (OT_BAGGAGE_PREFIX.toUpperCase() + "k2"): "v2", - SOME_HEADER : "my-interesting-info", - ] - - when: - TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - context == null - } - - def "extract http headers with out of range span ID"() { - setup: - def headers = [ - (TRACE_ID_KEY.toUpperCase()) : "0", - (SPAN_ID_KEY.toUpperCase()) : "-1", - (OT_BAGGAGE_PREFIX.toUpperCase() + "k1"): "v1", - (OT_BAGGAGE_PREFIX.toUpperCase() + "k2"): "v2", - SOME_HEADER : "my-interesting-info", - ] - - when: - TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - context == null - } - - def "baggage is mapped on context creation"() { - setup: - def headers = [ - (TRACE_ID_KEY.toUpperCase()) : traceId, - (SPAN_ID_KEY.toUpperCase()) : spanId, - SOME_CUSTOM_BAGGAGE_HEADER : "mappedBaggageValue", - (OT_BAGGAGE_PREFIX.toUpperCase() + "k1"): "v1", - (OT_BAGGAGE_PREFIX.toUpperCase() + "k2"): "v2", - SOME_ARBITRARY_HEADER : "my-interesting-info", - ] - - when: - final TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - if (ctxCreated) { - assert context != null - assert context.getBaggage() == [ - "Haystack-Trace-ID": traceId, - "Haystack-Span-ID" : spanId, - "some-baggage" : "mappedBaggageValue", - "k1" : "v1", - "k2" : "v2", - ] - } else { - assert context == null - } - - where: - ctxCreated | traceId | spanId - false | "-1" | "1" - false | "1" | "-1" - true | "0" | "1" - true | "44617461-646f-6721-463a-c35c9f6413ad" | "44617461-646f-6721-463a-c35c9f6413ad" - } - - def "extract 128 bit id truncates id to 64 bit"() { - setup: - def headers = [ - (TRACE_ID_KEY.toUpperCase()) : traceId, - (SPAN_ID_KEY.toUpperCase()) : spanId, - ] - - when: - final TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - if (expectedTraceId) { - assert context.traceId == expectedTraceId - assert context.spanId == expectedSpanId - } - if (ctxCreated) { - assert context != null - } else { - assert context == null - } - - where: - ctxCreated | traceId | spanId | expectedTraceId | expectedSpanId - false | "-1" | "1" | null | DDSpanId.ZERO - false | "1" | "-1" | null | DDSpanId.ZERO - true | "0" | "1" | null | DDSpanId.ZERO - true | "00001" | "00001" | DDTraceId.ONE | 1 - true | "463ac35c9f6413ad" | "463ac35c9f6413ad" | DDTraceId.from(5060571933882717101) | 5060571933882717101 - true | "463ac35c9f6413ad48485a3953bb6124" | "1" | DDTraceId.from(5208512171318403364) | 1 - true | "44617461-646f-6721-463a-c35c9f6413ad" | "44617461-646f-6721-463a-c35c9f6413ad" | DDTraceId.from(5060571933882717101) | 5060571933882717101 - true | "f" * 16 | "1" | DD64bTraceId.MAX | 1 - true | "a" * 16 + "f" * 16 | "1" | DD64bTraceId.MAX | 1 - false | "1" + "f" * 32 | "1" | null | 1 - false | "0" + "f" * 32 | "1" | null | 1 - true | "1" | "f" * 16 | DDTraceId.ONE | DDSpanId.MAX - false | "1" | "1" + "f" * 16 | null | DDSpanId.ZERO - true | "1" | "000" + "f" * 16 | DDTraceId.ONE | DDSpanId.MAX - } - - - def "extract common http headers"() { - setup: - def headers = [ - (HttpCodec.USER_AGENT_KEY): 'some-user-agent', - (HttpCodec.X_CLUSTER_CLIENT_IP_KEY): '1.1.1.1', - (HttpCodec.X_REAL_IP_KEY): '2.2.2.2', - (HttpCodec.X_CLIENT_IP_KEY): '3.3.3.3', - (HttpCodec.TRUE_CLIENT_IP_KEY): '4.4.4.4', - (HttpCodec.FORWARDED_FOR_KEY): '5.5.5.5', - (HttpCodec.FORWARDED_KEY): '6.6.6.6', - (HttpCodec.FASTLY_CLIENT_IP_KEY): '7.7.7.7', - (HttpCodec.CF_CONNECTING_IP_KEY): '8.8.8.8', - (HttpCodec.CF_CONNECTING_IP_V6_KEY): '9.9.9.9', - ] - - when: - final TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - assert context.userAgent == 'some-user-agent' - assert context.XClusterClientIp == '1.1.1.1' - assert context.XRealIp == '2.2.2.2' - assert context.XClientIp == '3.3.3.3' - assert context.trueClientIp == '4.4.4.4' - assert context.forwardedFor == '5.5.5.5' - assert context.forwarded == '6.6.6.6' - assert context.fastlyClientIp == '7.7.7.7' - assert context.cfConnectingIp == '8.8.8.8' - assert context.cfConnectingIpv6 == '9.9.9.9' - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/HaystackHttpInjectorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/HaystackHttpInjectorTest.groovy deleted file mode 100644 index 8c32e0a8c9b..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/HaystackHttpInjectorTest.groovy +++ /dev/null @@ -1,123 +0,0 @@ -package datadog.trace.core.propagation - -import datadog.trace.api.DDSpanId -import datadog.trace.api.DDTraceId - -import static datadog.trace.api.sampling.PrioritySampling.* -import static datadog.trace.api.sampling.SamplingMechanism.* -import datadog.trace.api.datastreams.NoopPathwayContext -import datadog.trace.common.writer.ListWriter -import datadog.trace.core.DDSpanContext -import datadog.trace.core.test.DDCoreSpecification - -import static datadog.trace.core.CoreTracer.TRACE_ID_MAX -import static datadog.trace.core.propagation.HaystackHttpCodec.* - -class HaystackHttpInjectorTest extends DDCoreSpecification { - - HttpCodec.Injector injector = HaystackHttpCodec.newInjector(["some-baggage-key":"SOME_CUSTOM_HEADER"]) - - def "inject http headers"() { - setup: - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - final DDSpanContext mockedContext = - new DDSpanContext( - DDTraceId.from(traceId), - DDSpanId.from(spanId), - DDSpanId.ZERO, - null, - "fakeService", - "fakeOperation", - "fakeResource", - samplingPriority, - origin, - ["k1" : "v1", "k2" : "v2", "some-baggage-key": "some-value"], - false, - "fakeType", - 0, - tracer.traceCollectorFactory.create(DDTraceId.ONE), - null, - null, - NoopPathwayContext.INSTANCE, - false, - null) - - final Map carrier = Mock() - - when: - injector.inject(mockedContext, carrier, MapSetter.INSTANCE) - - then: - 1 * carrier.put(TRACE_ID_KEY, traceUuid) - mockedContext.getTags().get(HAYSTACK_TRACE_ID_BAGGAGE_KEY) == traceUuid - 1 * carrier.put(DD_TRACE_ID_BAGGAGE_KEY, traceId.toString()) - 1 * carrier.put(SPAN_ID_KEY, spanUuid) - 1 * carrier.put(DD_SPAN_ID_BAGGAGE_KEY, spanId.toString()) - 1 * carrier.put(OT_BAGGAGE_PREFIX + "k1", "v1") - 1 * carrier.put(OT_BAGGAGE_PREFIX + "k2", "v2") - 1 * carrier.put("SOME_CUSTOM_HEADER", "some-value") - 1 * carrier.put(DD_PARENT_ID_BAGGAGE_KEY, "0") - - cleanup: - tracer.close() - - where: - traceId | spanId | samplingPriority | samplingMechanism | origin | traceUuid | spanUuid - "1" | "2" | SAMPLER_KEEP | DEFAULT | null | "44617461-646f-6721-0000-000000000001" | "44617461-646f-6721-0000-000000000002" - "1" | "2" | SAMPLER_KEEP | DEFAULT | null | "44617461-646f-6721-0000-000000000001" | "44617461-646f-6721-0000-000000000002" - "$TRACE_ID_MAX" | "${TRACE_ID_MAX - 1}" | SAMPLER_KEEP | DEFAULT | null | "44617461-646f-6721-ffff-ffffffffffff" | "44617461-646f-6721-ffff-fffffffffffe" - "${TRACE_ID_MAX - 1}" | "$TRACE_ID_MAX" | SAMPLER_KEEP | DEFAULT | null | "44617461-646f-6721-ffff-fffffffffffe" | "44617461-646f-6721-ffff-ffffffffffff" - } - - def "inject http headers with haystack traceId in baggage"() { - setup: - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - def haystackUuid = traceUuid - final DDSpanContext mockedContext = - new DDSpanContext( - DDTraceId.from(traceId), - DDSpanId.from(spanId), - DDSpanId.ZERO, - null, - "fakeService", - "fakeOperation", - "fakeResource", - samplingPriority, - origin, - ["k1" : "v1", "k2" : "v2", (HAYSTACK_TRACE_ID_BAGGAGE_KEY) : haystackUuid], - false, - "fakeType", - 0, - tracer.traceCollectorFactory.create(DDTraceId.ONE), - null, - null, - NoopPathwayContext.INSTANCE, - false, - null) - - final Map carrier = Mock() - - when: - injector.inject(mockedContext, carrier, MapSetter.INSTANCE) - - then: - 1 * carrier.put(TRACE_ID_KEY, traceUuid) - 1 * carrier.put(DD_TRACE_ID_BAGGAGE_KEY, traceId.toString()) - 1 * carrier.put(SPAN_ID_KEY, spanUuid) - 1 * carrier.put(DD_SPAN_ID_BAGGAGE_KEY, spanId.toString()) - 1 * carrier.put(OT_BAGGAGE_PREFIX + "k1", "v1") - 1 * carrier.put(OT_BAGGAGE_PREFIX + "k2", "v2") - - cleanup: - tracer.close() - - where: - traceId | spanId | samplingPriority | samplingMechanism | origin | traceUuid | spanUuid - "1" | "2" | SAMPLER_KEEP | DEFAULT | null | "54617461-646f-6721-0000-000000000001" | "44617461-646f-6721-0000-000000000002" - "1" | "2" | SAMPLER_KEEP | DEFAULT | null | "54617461-646f-6721-0000-000000000001" | "44617461-646f-6721-0000-000000000002" - "$TRACE_ID_MAX" | "${TRACE_ID_MAX - 1}" | SAMPLER_KEEP | DEFAULT | null | "54617461-646f-6721-ffff-ffffffffffff" | "44617461-646f-6721-ffff-fffffffffffe" - "${TRACE_ID_MAX - 1}" | "$TRACE_ID_MAX" | SAMPLER_KEEP | DEFAULT | null | "54617461-646f-6721-ffff-fffffffffffe" | "44617461-646f-6721-ffff-ffffffffffff" - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/HttpExtractorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/HttpExtractorTest.groovy deleted file mode 100644 index e9642463fe9..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/HttpExtractorTest.groovy +++ /dev/null @@ -1,209 +0,0 @@ -package datadog.trace.core.propagation - -import static datadog.trace.api.DDTags.PARENT_ID -import static datadog.trace.api.TracePropagationStyle.NONE - -import datadog.trace.api.Config -import datadog.trace.api.DDSpanId -import datadog.trace.api.DDTraceId -import datadog.trace.api.DynamicConfig -import datadog.trace.bootstrap.instrumentation.api.TagContext -import datadog.trace.bootstrap.instrumentation.api.ContextVisitors -import datadog.trace.test.util.DDSpecification -import spock.lang.Shared - -import static datadog.trace.api.TracePropagationStyle.B3MULTI -import static datadog.trace.api.TracePropagationStyle.DATADOG -import static datadog.trace.api.TracePropagationStyle.TRACECONTEXT -import static datadog.trace.core.CoreTracer.TRACE_ID_MAX - -class HttpExtractorTest extends DDSpecification { - static final W3C_TRACE_ID = "00000000000000000000000000000001" - static final W3C_SPAN_ID = "123456789abcdef0" - static final W3C_TRACE_PARENT = "00-$W3C_TRACE_ID-$W3C_SPAN_ID-01" - static final W3C_TRACE_STATE_WITH_P = "dd=p:456789abcdef0123" - static final W3C_TRACE_STATE_NO_P = "dd=s:2,foo=1" - static final W3C_SPAN_ID_LSTR = DDSpanId.fromHex(W3C_SPAN_ID).toString() - - @Shared - String outOfRangeTraceId = (TRACE_ID_MAX + 1).toString() - - def "extract http headers using #styles"() { - setup: - Config config = Mock(Config) { - getTracePropagationStylesToExtract() >> styles - isTracePropagationExtractFirst() >> extractFirst - } - DynamicConfig dynamicConfig = DynamicConfig.create() - .setHeaderTags(["SOME_HEADER": "some-tag"]) - .setBaggageMapping([:]) - .apply() - HttpCodec.Extractor extractor = HttpCodec.createExtractor(config, { dynamicConfig.captureTraceConfig() }) - - final Map actual = [:] - if (datadogTraceId != null) { - actual.put(DatadogHttpCodec.TRACE_ID_KEY.toUpperCase(), datadogTraceId) - } - if (datadogSpanId != null) { - actual.put(DatadogHttpCodec.SPAN_ID_KEY.toUpperCase(), datadogSpanId) - } - if (b3TraceId != null) { - actual.put(B3HttpCodec.TRACE_ID_KEY.toUpperCase(), b3TraceId) - } - if (b3SpanId != null) { - actual.put(B3HttpCodec.SPAN_ID_KEY.toUpperCase(), b3SpanId) - } - if (w3cTraceParent != null) { - actual.put(W3CHttpCodec.TRACE_PARENT_KEY.toUpperCase(), w3cTraceParent) - } - - if (putDatadogFields) { - actual.put("SOME_HEADER", "my-interesting-info") - } - - when: - final TagContext context = extractor.extract(actual, ContextVisitors.stringValuesMap()) - - then: - if (tagContext) { - assert context instanceof TagContext - } else { - if (expectedTraceId == null) { - assert context == null - } else { - assert context.traceId.toLong() == DDTraceId.from(expectedTraceId).toLong() - assert context.spanId == DDSpanId.from(expectedSpanId) - } - } - - if (expectDatadogFields) { - if (tagContext && b3TraceId != null) { - assert context.tags == ["b3.traceid": b3TraceId, "b3.spanid": b3SpanId, "some-tag": "my-interesting-info"] - } else { - assert context.tags == ["some-tag": "my-interesting-info"] - } - } - - where: - // spotless:off - styles | datadogTraceId | datadogSpanId | b3TraceId | b3SpanId | w3cTraceParent | expectedTraceId | expectedSpanId | putDatadogFields | expectDatadogFields | tagContext | extractFirst - [DATADOG, B3MULTI] | "1" | "2" | "a" | "b" | null | "1" | "2" | true | true | false | false - [DATADOG, B3MULTI] | null | null | "a" | "b" | null | "10" | "11" | false | false | true | false - [DATADOG, B3MULTI] | null | null | "a" | "b" | null | null | null | true | true | true | false - [DATADOG] | "1" | "2" | "a" | "b" | null | "1" | "2" | true | true | false | false - [B3MULTI] | "1" | "2" | "a" | "b" | null | "10" | "11" | false | false | false | false - [B3MULTI, DATADOG] | "1" | "2" | "a" | "b" | null | "10" | "11" | false | false | false | false - [] | "1" | "2" | "a" | "b" | null | null | null | false | false | false | false - [DATADOG, B3MULTI] | "abc" | "2" | "a" | "b" | null | "10" | "11" | false | false | false | false - [DATADOG] | "abc" | "2" | "a" | "b" | null | null | null | false | false | false | false - [DATADOG, B3MULTI] | outOfRangeTraceId | "2" | "a" | "b" | null | "10" | "11" | false | false | false | false - [DATADOG, B3MULTI] | "1" | outOfRangeTraceId | "a" | "b" | null | "10" | "11" | false | false | false | false - [DATADOG] | outOfRangeTraceId | "2" | "a" | "b" | null | null | null | false | false | false | false - [DATADOG] | "1" | outOfRangeTraceId | "a" | "b" | null | null | null | false | false | false | false - [DATADOG, B3MULTI] | "1" | "2" | outOfRangeTraceId | "b" | null | "1" | "2" | true | false | false | false - [DATADOG, B3MULTI] | "1" | "2" | "a" | outOfRangeTraceId | null | "1" | "2" | true | false | false | false - [NONE] | "1" | "2" | null | null | null | null | null | true | false | true | false - [DATADOG, TRACECONTEXT] | "1" | "2" | null | null | W3C_TRACE_PARENT | "1" | W3C_SPAN_ID_LSTR | false | false | false | false - [DATADOG, TRACECONTEXT, B3MULTI] | "1" | "2" | "1" | "2" | W3C_TRACE_PARENT | "1" | W3C_SPAN_ID_LSTR | false | false | false | false - [TRACECONTEXT, DATADOG] | "1" | "2" | null | null | W3C_TRACE_PARENT | "1" | W3C_SPAN_ID_LSTR | false | false | false | false - [TRACECONTEXT, B3MULTI] | null | null | "1" | "2" | W3C_TRACE_PARENT | "1" | W3C_SPAN_ID_LSTR | false | false | false | false - [TRACECONTEXT, B3MULTI, DATADOG] | "1" | "2" | "1" | "4" | W3C_TRACE_PARENT | "1" | W3C_SPAN_ID_LSTR | false | false | false | false - [B3MULTI, DATADOG, TRACECONTEXT] | "1" | "2" | "1" | "4" | W3C_TRACE_PARENT | "1" | W3C_SPAN_ID_LSTR | false | false | false | false - [TRACECONTEXT] | null | null | null | null | W3C_TRACE_PARENT | "1" | W3C_SPAN_ID_LSTR | false | false | false | false - [DATADOG, TRACECONTEXT] | "1" | null | null | null | W3C_TRACE_PARENT | "1" | W3C_SPAN_ID_LSTR | false | false | false | false - [DATADOG, TRACECONTEXT] | "1" | "2" | null | null | W3C_TRACE_PARENT | "1" | "2" | false | false | false | true - // spotless:on - } - - def 'check W3C trace context override'() { - setup: - Config config = Mock(Config) { - getTracePropagationStylesToExtract() >> styles - } - DynamicConfig dynamicConfig = DynamicConfig.create().apply() - HttpCodec.Extractor extractor = HttpCodec.createExtractor(config, { dynamicConfig.captureTraceConfig() }) - - final Map actual = [:] - actual.put(W3CHttpCodec.TRACE_PARENT_KEY.toUpperCase(), W3C_TRACE_PARENT) - if (datadogTraceId != null) { - actual.put(DatadogHttpCodec.TRACE_ID_KEY.toUpperCase(), datadogTraceId) - } - if (datadogSpanId != null) { - actual.put(DatadogHttpCodec.SPAN_ID_KEY.toUpperCase(), datadogSpanId) - } - if (b3TraceId != null) { - actual.put(B3HttpCodec.TRACE_ID_KEY.toUpperCase(), b3TraceId) - } - if (b3SpanId != null) { - actual.put(B3HttpCodec.SPAN_ID_KEY.toUpperCase(), b3SpanId) - } - if (traceState != null) { - actual.put(W3CHttpCodec.TRACE_STATE_KEY.toUpperCase(), traceState) - } - - when: - final TagContext context = extractor.extract(actual, ContextVisitors.stringValuesMap()) - - then: - assert context.traceId.toLong() == DDTraceId.from(expectedTraceId).toLong() - assert context.spanId == DDSpanId.from(expectedSpanId) - assert context.tags[PARENT_ID] == expectedParentId - // TODO Add some more W3C override checks - - where: - // spotless:off - styles | datadogTraceId | datadogSpanId | b3TraceId | b3SpanId | traceState | expectedTraceId | expectedSpanId | expectedParentId - [DATADOG, TRACECONTEXT] | "1" | "2" | null | null | W3C_TRACE_STATE_WITH_P | "1" | W3C_SPAN_ID_LSTR | "456789abcdef0123" - [DATADOG, TRACECONTEXT] | "1" | "2" | null | null | null | "1" | W3C_SPAN_ID_LSTR | "0000000000000002" - [DATADOG, TRACECONTEXT, B3MULTI] | "1" | "2" | "1" | "2" | W3C_TRACE_STATE_WITH_P | "1" | W3C_SPAN_ID_LSTR | "456789abcdef0123" - [TRACECONTEXT, DATADOG] | "1" | "2" | null | null | W3C_TRACE_STATE_WITH_P | "1" | W3C_SPAN_ID_LSTR | null - [TRACECONTEXT, B3MULTI] | null | null | "1" | "2" | W3C_TRACE_STATE_WITH_P | "1" | W3C_SPAN_ID_LSTR | null - [TRACECONTEXT, B3MULTI, DATADOG] | "1" | "2" | "1" | "4" | W3C_TRACE_STATE_WITH_P | "1" | W3C_SPAN_ID_LSTR | null - [B3MULTI, DATADOG, TRACECONTEXT] | "1" | "2" | "1" | "4" | W3C_TRACE_STATE_WITH_P | "1" | W3C_SPAN_ID_LSTR | "456789abcdef0123" - [TRACECONTEXT] | null | null | null | null | W3C_TRACE_STATE_WITH_P | "1" | W3C_SPAN_ID_LSTR | null - [B3MULTI, TRACECONTEXT] | null | null | "1" | "2" | W3C_TRACE_STATE_WITH_P | "1" | W3C_SPAN_ID_LSTR | "456789abcdef0123" - [B3MULTI, DATADOG, TRACECONTEXT] | "1" | "2" | "1" | "4" | null | "1" | W3C_SPAN_ID_LSTR | "0000000000000002" - [DATADOG, TRACECONTEXT] | "1" | "2" | null | null | W3C_TRACE_STATE_NO_P | "1" | W3C_SPAN_ID_LSTR | "0000000000000002" - // spotless:on - } - - def "verify existence of span links when extracting compound http headers"() { - setup: - Config config = Mock(Config) { - getTracePropagationStylesToExtract() >> styles - } - DynamicConfig dynamicConfig = DynamicConfig.create().apply() - HttpCodec.Extractor extractor = HttpCodec.createExtractor(config, { dynamicConfig.captureTraceConfig() }) - - final Map actual = [ - (DatadogHttpCodec.TRACE_ID_KEY.toUpperCase()): datadogTraceId, - (DatadogHttpCodec.SPAN_ID_KEY.toUpperCase()) : datadogSpanId, - (B3HttpCodec.TRACE_ID_KEY.toUpperCase()) : b3TraceId, - (B3HttpCodec.SPAN_ID_KEY.toUpperCase()) : b3SpanId, - (W3CHttpCodec.TRACE_PARENT_KEY.toUpperCase()): w3cTraceParent, - (W3CHttpCodec.TRACE_STATE_KEY.toUpperCase()) : traceState - ] - - when: - final TagContext context = extractor.extract(actual, ContextVisitors.stringValuesMap()) - - then: - def links = context.getTerminatedContextLinks() - assert links.size() == expectedSpanLinks.size() - for (int i = 0; i < links.size(); i++) { - if (expectedSpanLinks[i] == TRACECONTEXT) { - assert links[i].traceState() == W3C_TRACE_STATE_NO_P - } - assert links[i].attributes().asMap()["context_headers"] == expectedSpanLinks[i].toString() - } - - where: - // spotless:off - styles | datadogTraceId | datadogSpanId | b3TraceId | b3SpanId | w3cTraceParent | traceState | expectedSpanLinks - [DATADOG, B3MULTI, TRACECONTEXT] | "1" | "2" | "1" | "b" | W3C_TRACE_PARENT | W3C_TRACE_STATE_NO_P | [] - [DATADOG, B3MULTI, TRACECONTEXT] | "2" | "2" | "2" | "b" | W3C_TRACE_PARENT | W3C_TRACE_STATE_NO_P | [TRACECONTEXT] - [DATADOG, B3MULTI, TRACECONTEXT] | "2" | "2" | "1" | "b" | W3C_TRACE_PARENT | W3C_TRACE_STATE_NO_P | [B3MULTI, TRACECONTEXT] - [TRACECONTEXT, B3MULTI, DATADOG] | "2" | "2" | "1" | "b" | W3C_TRACE_PARENT | W3C_TRACE_STATE_NO_P | [DATADOG] - // spotless:on - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/HttpInjectorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/HttpInjectorTest.groovy deleted file mode 100644 index 4274be2af55..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/HttpInjectorTest.groovy +++ /dev/null @@ -1,250 +0,0 @@ -package datadog.trace.core.propagation - -import datadog.trace.api.Config -import datadog.trace.api.DDSpanId -import datadog.trace.api.DDTraceId -import datadog.trace.core.CoreTracer -import datadog.trace.test.util.StringUtils - -import static datadog.trace.api.TracePropagationStyle.HAYSTACK -import static datadog.trace.api.TracePropagationStyle.TRACECONTEXT -import static datadog.trace.api.sampling.PrioritySampling.* -import datadog.trace.api.datastreams.NoopPathwayContext -import datadog.trace.common.writer.ListWriter -import datadog.trace.core.DDSpanContext -import datadog.trace.core.test.DDCoreSpecification - -import static datadog.trace.api.TracePropagationStyle.B3SINGLE -import static datadog.trace.api.TracePropagationStyle.B3MULTI -import static datadog.trace.api.TracePropagationStyle.DATADOG -import static datadog.trace.core.propagation.B3HttpCodec.B3_KEY - -class HttpInjectorTest extends DDCoreSpecification { - - boolean tracePropagationB3Padding() { - return false - } - - String idOrPadded(DDTraceId id) { - if (id.toHighOrderLong() == 0) { - return idOrPadded(DDSpanId.toHexString(id.toLong()), 32) - } - return id.toHexString() - } - - String idOrPadded(long id) { - return idOrPadded(DDSpanId.toHexString(id), 16) - } - - String idOrPadded(String id, int size) { - if (!tracePropagationB3Padding()) { - return id.toLowerCase() - } - return StringUtils.padHexLower(id, size) - } - - def "inject http headers using #styles"() { - setup: - Config config = Mock(Config) { - getTracePropagationStylesToInject() >> styles - isTracePropagationStyleB3PaddingEnabled() >> tracePropagationB3Padding() - } - HttpCodec.Injector injector = HttpCodec.createInjector(config, config.getTracePropagationStylesToInject(), [:]) - def traceId = DDTraceId.ONE - def spanId = 2 - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - final DDSpanContext mockedContext = mockedContext(tracer, traceId, spanId, samplingPriority, origin, ["k1": "v1", "k2": "v2"]) - final Map carrier = Mock() - def b3TraceIdHex = idOrPadded(traceId) - def b3SpanIdHex = idOrPadded(spanId) - - when: - injector.inject(mockedContext, carrier, MapSetter.INSTANCE) - - then: - if (styles.contains(DATADOG)) { - 1 * carrier.put(DatadogHttpCodec.TRACE_ID_KEY, traceId.toString()) - 1 * carrier.put(DatadogHttpCodec.SPAN_ID_KEY, spanId.toString()) - 1 * carrier.put(DatadogHttpCodec.OT_BAGGAGE_PREFIX + "k1", "v1") - 1 * carrier.put(DatadogHttpCodec.OT_BAGGAGE_PREFIX + "k2", "v2") - if (samplingPriority != UNSET) { - 1 * carrier.put(DatadogHttpCodec.SAMPLING_PRIORITY_KEY, "$samplingPriority") - } - if (origin) { - 1 * carrier.put(DatadogHttpCodec.ORIGIN_KEY, origin) - } - 1 * carrier.put('x-datadog-tags', '_dd.p.usr=123') - } - if (styles.contains(B3MULTI)) { - 1 * carrier.put(B3HttpCodec.TRACE_ID_KEY, b3TraceIdHex) - 1 * carrier.put(B3HttpCodec.SPAN_ID_KEY, b3SpanIdHex) - if (samplingPriority != UNSET) { - 1 * carrier.put(B3HttpCodec.SAMPLING_PRIORITY_KEY, "1") - } - } - if (styles.contains(B3SINGLE)) { - if (samplingPriority != UNSET) { - 1 * carrier.put(B3_KEY, "$b3TraceIdHex-$b3SpanIdHex-1") - } else { - 1 * carrier.put(B3_KEY, "$b3TraceIdHex-$b3SpanIdHex") - } - } - 0 * _ - - cleanup: - tracer.close() - - where: - // spotless:off - styles | samplingPriority | origin - [DATADOG, B3SINGLE] | UNSET | null - [DATADOG, B3SINGLE] | SAMPLER_KEEP | "saipan" - [DATADOG] | UNSET | null - [DATADOG] | SAMPLER_KEEP | "saipan" - [B3SINGLE] | UNSET | null - [B3SINGLE] | SAMPLER_KEEP | "saipan" - [B3SINGLE, DATADOG] | SAMPLER_KEEP | "saipan" - [DATADOG, B3MULTI, B3SINGLE] | UNSET | null - [DATADOG, B3MULTI, B3SINGLE] | SAMPLER_KEEP | "saipan" - [DATADOG, B3MULTI] | UNSET | null - [DATADOG, B3MULTI] | SAMPLER_KEEP | "saipan" - [B3MULTI] | UNSET | null - [B3MULTI] | SAMPLER_KEEP | "saipan" - [B3MULTI, DATADOG] | SAMPLER_KEEP | "saipan" - // spotless:on - } - - def "inject http headers using #style"() { - setup: - Config config = Mock(Config) { - isTracePropagationStyleB3PaddingEnabled() >> tracePropagationB3Padding() - } - def injector = HttpCodec.createInjector(config, [style].toSet(), ["some-baggage-item": "SOME_HEADER"],) - def traceId = DDTraceId.ONE - def spanId = 2 - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - final DDSpanContext mockedContext = mockedContext(tracer, traceId, spanId, samplingPriority, origin, ["k1": "v1", "k2": "v2","some-baggage-item":"some-baggage-value"]) - final Map carrier = Mock() - def b3TraceIdHex = idOrPadded(traceId) - def b3SpanIdHex = idOrPadded(spanId) - - when: - injector.inject(mockedContext, carrier, MapSetter.INSTANCE) - - then: - if (style == DATADOG) { - 1 * carrier.put(DatadogHttpCodec.TRACE_ID_KEY, traceId.toString()) - 1 * carrier.put(DatadogHttpCodec.SPAN_ID_KEY, spanId.toString()) - 1 * carrier.put(DatadogHttpCodec.OT_BAGGAGE_PREFIX + "k1", "v1") - 1 * carrier.put(DatadogHttpCodec.OT_BAGGAGE_PREFIX + "k2", "v2") - 1 * carrier.put("SOME_HEADER", "some-baggage-value") - if (samplingPriority != UNSET) { - 1 * carrier.put(DatadogHttpCodec.SAMPLING_PRIORITY_KEY, "$samplingPriority") - } - if (origin) { - 1 * carrier.put(DatadogHttpCodec.ORIGIN_KEY, origin) - } - 1 * carrier.put('x-datadog-tags', '_dd.p.usr=123') - } else if (style == B3MULTI) { - 1 * carrier.put(B3HttpCodec.TRACE_ID_KEY, b3TraceIdHex) - 1 * carrier.put(B3HttpCodec.SPAN_ID_KEY, b3SpanIdHex) - if (samplingPriority != UNSET) { - 1 * carrier.put(B3HttpCodec.SAMPLING_PRIORITY_KEY, "1") - } - } else if (style == B3SINGLE) { - if (samplingPriority != UNSET) { - 1 * carrier.put(B3_KEY, "$b3TraceIdHex-$b3SpanIdHex-1") - } else { - 1 * carrier.put(B3_KEY, "$b3TraceIdHex-$b3SpanIdHex") - } - } - 0 * _ - - cleanup: - tracer.close() - - where: - // spotless:off - style | samplingPriority | origin - DATADOG | UNSET | null - DATADOG | SAMPLER_KEEP | null - DATADOG | SAMPLER_KEEP | "saipan" - B3SINGLE | UNSET | null - B3SINGLE | SAMPLER_KEEP | null - B3SINGLE | SAMPLER_KEEP | "saipan" - B3MULTI | UNSET | null - B3MULTI | SAMPLER_KEEP | null - B3MULTI | SAMPLER_KEEP | "saipan" - // spotless:on - } - - def "encode baggage in http headers using #style"() { - setup: - Config config = Mock(Config) { - isTracePropagationStyleB3PaddingEnabled() >> tracePropagationB3Padding() - } - def baggage = [ - 'alpha': 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', - 'num': '01234567890', - 'whitespace': 'ab \tcd', - 'specials': 'ab.-*_cd', - 'excluded': 'ab\',:\\cd', - ] - def mapping = baggage.keySet().collectEntries { [(it):it]} as Map - def injector = HttpCodec.createInjector(config, [style].toSet(), mapping) - def traceId = DDTraceId.ONE - def spanId = 2 - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - final DDSpanContext mockedContext = mockedContext(tracer, traceId, spanId, UNSET, null, baggage) - final Map carrier = Mock() - - when: - injector.inject(mockedContext, carrier, MapSetter.INSTANCE) - - then: - 1 * carrier.put('alpha', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ') - 1 * carrier.put('num', '01234567890') - 1 * carrier.put('whitespace', 'ab%20%09cd') - 1 * carrier.put('specials', 'ab.-*_cd') - 1 * carrier.put('excluded', 'ab%27%2C%3A%5Ccd') - - cleanup: - tracer.close() - - where: - style << [DATADOG, TRACECONTEXT, HAYSTACK] - } - - static DDSpanContext mockedContext(CoreTracer tracer, DDTraceId traceId, long spanId, int samplingPriority, String origin, Map baggage) { - return new DDSpanContext( - traceId, - spanId, - DDSpanId.ZERO, - null, - "fakeService", - "fakeOperation", - "fakeResource", - samplingPriority, - origin, - baggage, - false, - "fakeType", - 0, - tracer.traceCollectorFactory.create(DDTraceId.ONE), - null, - null, - NoopPathwayContext.INSTANCE, - false, - PropagationTags.factory().fromHeaderValue(PropagationTags.HeaderType.DATADOG, "_dd.p.usr=123")) - } -} - -class HttpInjectorB3PaddingTest extends HttpInjectorTest { - @Override - boolean tracePropagationB3Padding() { - return true - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/MapSetter.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/MapSetter.groovy deleted file mode 100644 index b38482e3c6d..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/MapSetter.groovy +++ /dev/null @@ -1,15 +0,0 @@ -package datadog.trace.core.propagation - -import datadog.context.propagation.CarrierSetter - -import javax.annotation.ParametersAreNonnullByDefault - -@ParametersAreNonnullByDefault -class MapSetter implements CarrierSetter> { - static final INSTANCE = new MapSetter() - - @Override - void set(Map carrier, String key, String value) { - carrier.put(key, value) - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/NoneHttpExtractorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/NoneHttpExtractorTest.groovy deleted file mode 100644 index 29295b3b584..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/NoneHttpExtractorTest.groovy +++ /dev/null @@ -1,327 +0,0 @@ -package datadog.trace.core.propagation - -import static datadog.trace.api.config.TracerConfig.PROPAGATION_EXTRACT_LOG_HEADER_NAMES_ENABLED -import static datadog.trace.core.CoreTracer.TRACE_ID_MAX -import static datadog.trace.core.propagation.DatadogHttpCodec.DATADOG_TAGS_KEY -import static datadog.trace.core.propagation.DatadogHttpCodec.ORIGIN_KEY -import static datadog.trace.core.propagation.DatadogHttpCodec.OT_BAGGAGE_PREFIX -import static datadog.trace.core.propagation.DatadogHttpCodec.SAMPLING_PRIORITY_KEY -import static datadog.trace.core.propagation.DatadogHttpCodec.SPAN_ID_KEY -import static datadog.trace.core.propagation.DatadogHttpCodec.TRACE_ID_KEY - -import datadog.trace.api.Config -import datadog.trace.api.DD128bTraceId -import datadog.trace.api.DD64bTraceId -import datadog.trace.api.DDSpanId -import datadog.trace.api.DDTraceId -import datadog.trace.api.DynamicConfig -import datadog.trace.api.config.TracerConfig -import datadog.trace.api.internal.util.LongStringUtils -import datadog.trace.api.sampling.PrioritySampling -import datadog.trace.bootstrap.ActiveSubsystems -import datadog.trace.bootstrap.instrumentation.api.ContextVisitors -import datadog.trace.bootstrap.instrumentation.api.TagContext -import datadog.trace.test.util.DDSpecification - -class NoneHttpExtractorTest extends DDSpecification { - - private DynamicConfig dynamicConfig - private HttpCodec.Extractor _extractor - - private HttpCodec.Extractor getExtractor() { - _extractor ?: (_extractor = createExtractor(Config.get())) - } - - private HttpCodec.Extractor createExtractor(Config config) { - NoneCodec.newExtractor(config, { dynamicConfig.captureTraceConfig() }) - } - - boolean origAppSecActive - - void setup() { - dynamicConfig = DynamicConfig.create() - .setHeaderTags(["SOME_HEADER": "some-tag"]) - .setBaggageMapping(["SOME_CUSTOM_BAGGAGE_HEADER": "some-baggage", "SOME_CUSTOM_BAGGAGE_HEADER_2": "some-CaseSensitive-baggage"]) - .apply() - origAppSecActive = ActiveSubsystems.APPSEC_ACTIVE - ActiveSubsystems.APPSEC_ACTIVE = true - - injectSysConfig(PROPAGATION_EXTRACT_LOG_HEADER_NAMES_ENABLED, "true") - } - - void cleanup() { - ActiveSubsystems.APPSEC_ACTIVE = origAppSecActive - extractor.cleanup() - } - - def "extract http headers"() { - setup: - injectEnvConfig("DD_TRACE_REQUEST_HEADER_TAGS_COMMA_ALLOWED", "$allowComma") - def extractor = createExtractor(Config.get()) - def headers = [ - "" : "empty key", - (TRACE_ID_KEY.toUpperCase()) : traceId, - (SPAN_ID_KEY.toUpperCase()) : spanId, - (OT_BAGGAGE_PREFIX.toUpperCase() + "k1"): "v1", - (OT_BAGGAGE_PREFIX.toUpperCase() + "k2"): "v2", - SOME_HEADER : "my-interesting-info,and-more", - SOME_CUSTOM_BAGGAGE_HEADER : "my-interesting-baggage-info", - SOME_CUSTOM_BAGGAGE_HEADER_2 : "my-interesting-baggage-info-2", - ] - def expectedTagValue = allowComma ? "my-interesting-info,and-more" : "my-interesting-info" - - if (samplingPriority != PrioritySampling.UNSET) { - headers.put(SAMPLING_PRIORITY_KEY, "$samplingPriority".toString()) - } - - if (origin) { - headers.put(ORIGIN_KEY, origin) - } - - when: - final TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - context.traceId == DDTraceId.ZERO - context.spanId == DDSpanId.ZERO - context.baggage == [ - "some-baggage" : "my-interesting-baggage-info", - "some-CaseSensitive-baggage": "my-interesting-baggage-info-2"] - context.tags == ["some-tag": "$expectedTagValue"] - context.samplingPriority == samplingPriority - context.origin == origin - - cleanup: - extractor.cleanup() - - where: - traceId | spanId | samplingPriority | origin | allowComma - "1" | "2" | PrioritySampling.UNSET | null | true - "2" | "3" | PrioritySampling.UNSET | null | false - "$TRACE_ID_MAX" | "${TRACE_ID_MAX - 1}" | PrioritySampling.UNSET | null | true - "${TRACE_ID_MAX - 1}" | "$TRACE_ID_MAX" | PrioritySampling.UNSET | null | false - } - - def "extract header tags with no propagation"() { - when: - TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - !(context instanceof ExtractedContext) - context.getTags() == ["some-tag": "my-interesting-info"] - assert ((TagContext) context).origin == null - - where: - headers << [ - [SOME_HEADER: "my-interesting-info"], - [(ORIGIN_KEY): "my-origin", SOME_HEADER: "my-interesting-info"], - ] - } - - def "extract headers with forwarding"() { - when: - TagContext context = extractor.extract(tagOnlyCtx, ContextVisitors.stringValuesMap()) - - then: - context != null - !(context instanceof ExtractedContext) - context.forwarded == "for=$forwardedIp:$forwardedPort" - - when: - context = extractor.extract(fullCtx, ContextVisitors.stringValuesMap()) - - then: - !(context instanceof ExtractedContext) - context.traceId == DDTraceId.ZERO - context.spanId == DDSpanId.ZERO - context.forwarded == "for=$forwardedIp:$forwardedPort" - - where: - forwardedIp = "1.2.3.4" - forwardedPort = "1234" - tagOnlyCtx = [ - "Forwarded" : "for=$forwardedIp:$forwardedPort" - ] - fullCtx = [ - (TRACE_ID_KEY.toUpperCase()): 1, - (SPAN_ID_KEY.toUpperCase()) : 2, - "Forwarded" : "for=$forwardedIp:$forwardedPort" - ] - } - - def "extract headers with x-forwarding"() { - setup: - String forwardedIp = '1.2.3.4' - String forwardedPort = '1234' - def tagOnlyCtx = [ - "X-Forwarded-For" : forwardedIp, - "X-Forwarded-Port": forwardedPort - ] - def fullCtx = [ - (TRACE_ID_KEY.toUpperCase()): 1, - (SPAN_ID_KEY.toUpperCase()) : 2, - "x-forwarded-for" : forwardedIp, - "x-forwarded-port" : forwardedPort - ] - - when: - TagContext context = extractor.extract(tagOnlyCtx, ContextVisitors.stringValuesMap()) - - then: - context != null - !(context instanceof ExtractedContext) - context.XForwardedFor == forwardedIp - context.XForwardedPort == forwardedPort - - when: - context = extractor.extract(fullCtx, ContextVisitors.stringValuesMap()) - - then: - !(context instanceof ExtractedContext) - context.traceId == DDTraceId.ZERO - context.spanId.toLong() == 0 - context.XForwardedFor == forwardedIp - context.XForwardedPort == forwardedPort - } - - def "extract empty headers returns null"() { - expect: - extractor.extract(["ignored-header": "ignored-value"], ContextVisitors.stringValuesMap()) == null - } - - void 'extract headers with ip resolution disabled'() { - setup: - injectSysConfig(TracerConfig.TRACE_CLIENT_IP_RESOLVER_ENABLED, 'false') - - def tagOnlyCtx = [ - 'X-Forwarded-For': '::1', - 'User-agent': 'foo/bar', - ] - - when: - TagContext ctx = extractor.extract(tagOnlyCtx, ContextVisitors.stringValuesMap()) - - then: - ctx != null - ctx.XForwardedFor == null - ctx.userAgent == 'foo/bar' - } - - - void 'extract headers with ip resolution disabled — appsec disabled variant'() { - setup: - ActiveSubsystems.APPSEC_ACTIVE = false - - def tagOnlyCtx = [ - 'X-Forwarded-For': '::1', - 'User-agent': 'foo/bar', - ] - - when: - TagContext ctx = extractor.extract(tagOnlyCtx, ContextVisitors.stringValuesMap()) - - then: - ctx != null - ctx.XForwardedFor == null - } - - void 'custom IP header collection does not disable standard ip header collection'() { - setup: - injectSysConfig(TracerConfig.TRACE_CLIENT_IP_HEADER, "my-header") - - def tagOnlyCtx = [ - 'X-Forwarded-For': '::1', - 'My-Header': '8.8.8.8', - ] - - when: - def ctx = extractor.extract(tagOnlyCtx, ContextVisitors.stringValuesMap()) - - then: - ctx != null - ctx.XForwardedFor == '::1' - ctx.customIpHeader == '8.8.8.8' - } - - def "extract http headers with 128-bit trace ID"() { - setup: - def headers = [ - (TRACE_ID_KEY.toUpperCase()) : traceId.toString(), - (SPAN_ID_KEY.toUpperCase()) : "2", - (OT_BAGGAGE_PREFIX.toUpperCase() + "k1"): "v1", - (OT_BAGGAGE_PREFIX.toUpperCase() + "k2"): "v2", - SOME_HEADER : "my-interesting-info" - ] + additionalHeader - - when: - final TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - context.traceId == DDTraceId.ZERO - context.spanId == DDSpanId.ZERO - context.baggage.isEmpty() - context.tags == ["some-tag": "my-interesting-info"] - - where: - hexId << [ - "1", - "123456789abcdef0", - "123456789abcdef0123456789abcdef0", - "64184f2400000000123456789abcdef0", - "f" * 32 - ] - traceId = DD128bTraceId.fromHex(hexId) - is128bTrace = traceId.toHighOrderLong() != 0 - expectedTraceId = is128bTrace ? traceId : DD64bTraceId.from(traceId.toLong()) - additionalHeader = is128bTrace ? [(DATADOG_TAGS_KEY.toUpperCase()) : '_dd.p.tid=' + LongStringUtils.toHexStringPadded(traceId.toHighOrderLong(), 16)] : [:] - } - - def "extract http headers with invalid non-numeric ID"() { - setup: - def headers = [ - (TRACE_ID_KEY.toUpperCase()) : "traceId", - (SPAN_ID_KEY.toUpperCase()) : "spanId", - (OT_BAGGAGE_PREFIX.toUpperCase() + "k1"): "v1", - (OT_BAGGAGE_PREFIX.toUpperCase() + "k2"): "v2", - SOME_HEADER : "my-interesting-info", - ] - - when: - TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - context instanceof TagContext - context.tags == ["some-tag": "my-interesting-info"] - } - - def "extract common http headers"() { - setup: - def headers = [ - (HttpCodec.USER_AGENT_KEY): 'some-user-agent', - (HttpCodec.X_CLUSTER_CLIENT_IP_KEY): '1.1.1.1', - (HttpCodec.X_REAL_IP_KEY): '2.2.2.2', - (HttpCodec.X_CLIENT_IP_KEY): '3.3.3.3', - (HttpCodec.TRUE_CLIENT_IP_KEY): '4.4.4.4', - (HttpCodec.FORWARDED_FOR_KEY): '5.5.5.5', - (HttpCodec.FORWARDED_KEY): '6.6.6.6', - (HttpCodec.FASTLY_CLIENT_IP_KEY): '7.7.7.7', - (HttpCodec.CF_CONNECTING_IP_KEY): '8.8.8.8', - (HttpCodec.CF_CONNECTING_IP_V6_KEY): '9.9.9.9', - ] - - when: - final TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - assert context.userAgent == 'some-user-agent' - assert context.XClusterClientIp == '1.1.1.1' - assert context.XRealIp == '2.2.2.2' - assert context.XClientIp == '3.3.3.3' - assert context.trueClientIp == '4.4.4.4' - assert context.forwardedFor == '5.5.5.5' - assert context.forwarded == '6.6.6.6' - assert context.fastlyClientIp == '7.7.7.7' - assert context.cfConnectingIp == '8.8.8.8' - assert context.cfConnectingIpv6 == '9.9.9.9' - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/TracingPropagatorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/TracingPropagatorTest.groovy deleted file mode 100644 index 2b700f8c6e8..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/TracingPropagatorTest.groovy +++ /dev/null @@ -1,217 +0,0 @@ -package datadog.trace.core.propagation - -import datadog.context.Context -import datadog.context.propagation.CarrierSetter -import datadog.context.propagation.Propagators -import datadog.trace.api.sampling.PrioritySampling -import datadog.trace.bootstrap.instrumentation.api.AgentPropagation -import datadog.trace.common.writer.LoggingWriter -import datadog.trace.core.ControllableSampler -import datadog.trace.core.test.DDCoreSpecification - -import static datadog.trace.api.ProductTraceSource.ASM -import static datadog.trace.api.ProductTraceSource.UNSET -import static datadog.trace.api.sampling.PrioritySampling.SAMPLER_KEEP -import static datadog.trace.api.sampling.PrioritySampling.USER_DROP -import static datadog.trace.bootstrap.instrumentation.api.AgentPropagation.XRAY_TRACING_CONCERN -import static datadog.trace.bootstrap.instrumentation.api.Tags.PROPAGATED_TRACE_SOURCE -import static datadog.trace.core.propagation.DatadogHttpCodec.SAMPLING_PRIORITY_KEY - -class TracingPropagatorTest extends DDCoreSpecification { - HttpCodec.Injector injector - HttpCodec.Extractor extractor - TracingPropagator propagator - - def setup() { - this.injector = Mock(HttpCodec.Injector) - this.extractor = Mock(HttpCodec.Extractor) - this.propagator = new TracingPropagator(true, injector, extractor) - } - - def 'test tracing propagator context injection'() { - setup: - def tracer = tracerBuilder().build() - def span = tracer.buildSpan('test', 'operation').start() - def setter = Mock(CarrierSetter) - def carrier = new Object() - - when: - this.propagator.inject(span, carrier, setter) - - then: - 1 * this.injector.inject(span.context(), carrier, _) - - cleanup: - span.finish() - tracer.close() - } - - def 'test tracing propagator context extractor'() { - setup: - def context = Context.root() - // TODO Use ContextVisitor mock as getter once extractor API is refactored - def getter = Mock(AgentPropagation.ContextVisitor) - def carrier = new Object() - - when: - this.propagator.extract(context, carrier, getter) - - then: - 1 * this.extractor.extract(carrier, _) - } - - def 'span priority set when injecting'() { - given: - injectSysConfig('writer.type', 'LoggingWriter') - def tracer = tracerBuilder().build() - def setter = Mock(CarrierSetter) - def carrier = new Object() - - when: - def root = tracer.buildSpan('test', 'parent').start() - def child = tracer.buildSpan('test', 'child').asChildOf(root).start() - Propagators.defaultPropagator().inject(child, carrier, setter) - - then: - root.getSamplingPriority() == SAMPLER_KEEP as int - child.getSamplingPriority() == root.getSamplingPriority() - 1 * setter.set(carrier, SAMPLING_PRIORITY_KEY, String.valueOf(SAMPLER_KEEP)) - - cleanup: - child.finish() - root.finish() - tracer.close() - } - - def 'span priority only set after first injection'() { - given: - def sampler = new ControllableSampler() - def tracer = tracerBuilder().writer(new LoggingWriter()).sampler(sampler).build() - def setter = Mock(CarrierSetter) - def carrier = new Object() - - when: - def root = tracer.buildSpan('test', 'parent').start() - def child = tracer.buildSpan('test', 'child').asChildOf(root).start() - Propagators.defaultPropagator().inject(child, carrier, setter) - - then: - root.getSamplingPriority() == SAMPLER_KEEP as int - child.getSamplingPriority() == root.getSamplingPriority() - 1 * setter.set(carrier, SAMPLING_PRIORITY_KEY, String.valueOf(SAMPLER_KEEP)) - - when: - sampler.nextSamplingPriority = PrioritySampling.SAMPLER_DROP as int - def child2 = tracer.buildSpan('test', 'child2').asChildOf(root).start() - Propagators.defaultPropagator().inject(child2, carrier, setter) - - then: - root.getSamplingPriority() == SAMPLER_KEEP as int - child.getSamplingPriority() == root.getSamplingPriority() - child2.getSamplingPriority() == root.getSamplingPriority() - 1 * setter.set(carrier, SAMPLING_PRIORITY_KEY, String.valueOf(SAMPLER_KEEP)) - - cleanup: - child.finish() - child2.finish() - root.finish() - tracer.close() - } - - def 'injection does not override set priority'() { - given: - def sampler = new ControllableSampler() - def tracer = tracerBuilder().writer(new LoggingWriter()).sampler(sampler).build() - def setter = Mock(CarrierSetter) - def carrier = new Object() - - when: - def root = tracer.buildSpan('test', 'root').start() - def child = tracer.buildSpan('test', 'child').asChildOf(root).start() - child.setSamplingPriority(USER_DROP) - Propagators.defaultPropagator().inject(child, carrier, setter) - - then: - root.getSamplingPriority() == USER_DROP as int - child.getSamplingPriority() == root.getSamplingPriority() - 1 * setter.set(carrier, SAMPLING_PRIORITY_KEY, String.valueOf(USER_DROP)) - - cleanup: - child.finish() - root.finish() - tracer.close() - } - - def 'test propagation when tracing is disabled'() { - setup: - this.propagator = new TracingPropagator(tracingEnabled, injector, extractor) - def tracer = tracerBuilder().build() - def span = tracer.buildSpan('test', 'operation').start() - span.setTag(PROPAGATED_TRACE_SOURCE, product) - def setter = Mock(CarrierSetter) - def carrier = new Object() - - when: - this.propagator.inject(span, carrier, setter) - - then: - injected * this.injector.inject(span.context(), carrier, _) - - cleanup: - span.finish() - tracer.close() - - where: - tracingEnabled | product - true | ASM - true | UNSET - false | ASM - false | UNSET - injected = tracingEnabled || product != UNSET ? 1 : 0 - } - - def 'test AWS X-Ray propagator'() { - setup: - def tracer = tracerBuilder().build() - def span = tracer.buildSpan('test', 'operation').start() - def propagator = Propagators.forConcerns(XRAY_TRACING_CONCERN) - def setter = Mock(CarrierSetter) - def carrier = new Object() - - when: - propagator.inject(span, carrier, setter) - - then: - 1 * setter.set(carrier, 'X-Amzn-Trace-Id', _) - - cleanup: - span.finish() - tracer.close() - } - - def 'test APM Tracing disabled propagator stop propagation'() { - setup: - injectSysConfig('apm.tracing.enabled', apmTracingEnabled.toString()) - def tracer = tracerBuilder().build() - def span = tracer.buildSpan('test', 'operation').start() - def setter = Mock(CarrierSetter) - def carrier = new Object() - - when: - Propagators.defaultPropagator().inject(span, carrier, setter) - - then: - if (apmTracingEnabled) { - (1.._) * setter.set(_, _, _) - } else { - 0 * setter.set(_, _, _) - } - - cleanup: - span.finish() - tracer.close() - - where: - apmTracingEnabled << [true, false] - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/W3CHttpExtractorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/W3CHttpExtractorTest.groovy deleted file mode 100644 index a0c7e7ee01b..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/W3CHttpExtractorTest.groovy +++ /dev/null @@ -1,412 +0,0 @@ -package datadog.trace.core.propagation - -import datadog.trace.api.Config -import datadog.trace.api.DD64bTraceId -import datadog.trace.api.DDSpanId -import datadog.trace.api.DDTraceId -import datadog.trace.api.DynamicConfig -import datadog.trace.api.config.TracerConfig -import datadog.trace.api.sampling.SamplingMechanism -import datadog.trace.bootstrap.ActiveSubsystems -import datadog.trace.bootstrap.instrumentation.api.ContextVisitors -import datadog.trace.bootstrap.instrumentation.api.TagContext -import datadog.trace.test.util.DDSpecification - -import static datadog.trace.api.config.TracerConfig.PROPAGATION_EXTRACT_LOG_HEADER_NAMES_ENABLED -import static datadog.trace.api.sampling.PrioritySampling.SAMPLER_DROP -import static datadog.trace.api.sampling.PrioritySampling.SAMPLER_KEEP -import static datadog.trace.api.sampling.PrioritySampling.USER_DROP -import static datadog.trace.api.sampling.PrioritySampling.USER_KEEP -import static datadog.trace.core.propagation.W3CHttpCodec.OT_BAGGAGE_PREFIX -import static datadog.trace.core.propagation.W3CHttpCodec.TRACE_PARENT_KEY -import static datadog.trace.core.propagation.W3CHttpCodec.TRACE_STATE_KEY - -class W3CHttpExtractorTest extends DDSpecification { - - private static final String TEST_TP_DROP = "00-00000000000000000000000000000001-123456789abcdef0-00" - private static final String TEST_TP_KEEP = "00-00000000000000000000000000000001-123456789abcdef0-01" - private static final long TEST_SPAN_ID = 1311768467463790320L - private static final DDTraceId TRACE_ID_ONE = DDTraceId.fromHex("00000000000000000000000000000001") - private static final DDTraceId TRACE_ID_NO_HIGH_LOW_MAX = DDTraceId.fromHex("0000000000000000ffffffffffffffff") - private static final DDTraceId TRACE_ID_LOW_MAX = DDTraceId.fromHex("123456789abcdef0ffffffffffffffff") - - private DynamicConfig dynamicConfig - private HttpCodec.Extractor _extractor - - private HttpCodec.Extractor getExtractor() { - _extractor ?: (_extractor = W3CHttpCodec.newExtractor(Config.get(), { dynamicConfig.captureTraceConfig() })) - } - - boolean origAppSecActive - - void setup() { - dynamicConfig = DynamicConfig.create() - .setHeaderTags(["SOME_HEADER": "some-tag"]) - .setBaggageMapping(["SOME_CUSTOM_BAGGAGE_HEADER": "some-baggage", "SOME_CUSTOM_BAGGAGE_HEADER_2": "some-CaseSensitive-baggage"]) - .apply() - origAppSecActive = ActiveSubsystems.APPSEC_ACTIVE - ActiveSubsystems.APPSEC_ACTIVE = true - - injectSysConfig(PROPAGATION_EXTRACT_LOG_HEADER_NAMES_ENABLED, "true") - } - - void cleanup() { - ActiveSubsystems.APPSEC_ACTIVE = origAppSecActive - } - - def "extract traceparent '#traceparent'"() { - setup: - HashMap headers = [] - if (traceparent) { - headers.put(W3CHttpCodec.TRACE_PARENT_KEY, traceparent) - } - - when: - final ExtractedContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - if (tpValid) { - assert context.traceId == traceId - assert context.spanId == spanId - assert context.samplingPriority == priority - } else { - assert context == null - } - - where: - traceparent | tpValid | traceId | spanId | priority - null | false | null | null | null - '00-00000000000000000000000000000000-123456789abcdef0-01' | false | null | null | null - '00-123456789abcdef00000000000000000-123456789abcdef0-01' | false | null | null | null - '00-00000000000000000000000000000001-0000000000000000-01' | false | null | null | null - '00-00000000000000000000000000000001-123456789abcdef0-01' | true | TRACE_ID_ONE | TEST_SPAN_ID | SAMPLER_KEEP - '\t00-00000000000000000000000000000001-123456789abcdef0-01' | true | TRACE_ID_ONE | TEST_SPAN_ID | SAMPLER_KEEP - '00-00000000000000000000000000000001-123456789abcdef0-01\t' | true | TRACE_ID_ONE | TEST_SPAN_ID | SAMPLER_KEEP - ' 00-00000000000000000000000000000001-123456789abcdef0-01 ' | true | TRACE_ID_ONE | TEST_SPAN_ID | SAMPLER_KEEP - '00-0000000000000000ffffffffffffffff-ffffffffffffffff-01' | true | TRACE_ID_NO_HIGH_LOW_MAX | DDSpanId.MAX | SAMPLER_KEEP - '00-0000000000000000ffffffffffffffff-ffffffffffffffff-00' | true | TRACE_ID_NO_HIGH_LOW_MAX | DDSpanId.MAX | SAMPLER_DROP - '00-123456789abcdef0ffffffffffffffff-123456789abcdef0-00' | true | TRACE_ID_LOW_MAX | TEST_SPAN_ID | SAMPLER_DROP - '00-123456789abcdef0ffffffffffffffFf-123456789abcdef0-00' | false | null | null | null - '00-123456789abcdeF0ffffffffffffffff-123456789abcdef0-00' | false | null | null | null - '00-123456789abcdef0fffffffffFffffff-123456789abcdef0-00' | false | null | null | null - '00-123456789abcdef0ffffffffffffffff-123456789Abcdef0-00' | false | null | null | null - '00-123456789äbcdef0ffffffffffffffff-123456789abcdef0-00' | false | null | null | null - '00-123456789abcdef0ffffffffäfffffff-123456789abcdef0-00' | false | null | null | null - '00-123456789abcdef0ffffffffffffffff-123456789äbcdef0-00' | false | null | null | null - '01-00000000000000000000000000000001-0000000000000001-02' | true | TRACE_ID_ONE | 1 | SAMPLER_DROP - '000-0000000000000000000000000000001-0000000000000001-01' | false | null | null | null - '00-0000000000000000000000000000001 -0000000000000001-01' | false | null | null | null - '00-0000000000000000000000000000001-0000000000000001-01' | false | null | null | null - '00-00000000000000000000000000000001-000000000000001-01' | false | null | null | null - '00-00000000000000000000000000000001-0000000000000001-0' | false | null | null | null - 'ff-00000000000000000000000000000001-0000000000000001-00' | false | null | null | null - 'fe-00000000000000000000000000000001-0000000000000001-02' | true | TRACE_ID_ONE | 1 | SAMPLER_DROP - '00-00000000000000000000000000000001-0000000000000001-03-0' | false | null | null | null - 'fe-00000000000000000000000000000001-0000000000000001-02.0' | false | null | null | null - } - - def "check max from W3C trace ids"() { - expect: - traceId.toLong() == DD64bTraceId.MAX.toLong() - - where: - traceId << [TRACE_ID_LOW_MAX, TRACE_ID_NO_HIGH_LOW_MAX] - } - - def "extract traceparent, tracestate, and http headers (#traceparent #tracestate)"() { - setup: - def headers = [ - "" : 'empty key', - (TRACE_PARENT_KEY.toUpperCase()) : traceparent, - (TRACE_STATE_KEY.toUpperCase()) : tracestate, - (OT_BAGGAGE_PREFIX.toUpperCase() + 'k1'): 'v1', - (OT_BAGGAGE_PREFIX.toUpperCase() + 'k2'): 'v2', - SOME_HEADER : 'my-interesting-info', - SOME_CUSTOM_BAGGAGE_HEADER : 'my-interesting-baggage-info', - SOME_CUSTOM_BAGGAGE_HEADER_2 : 'my-interesting-baggage-info-2', - ] - - when: - final ExtractedContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - context.traceId == TRACE_ID_ONE - context.spanId == TEST_SPAN_ID - context.baggage == ['k1' : 'v1', - 'k2' : 'v2', - 'some-baggage' : 'my-interesting-baggage-info', - 'some-CaseSensitive-baggage': 'my-interesting-baggage-info-2'] - context.tags == ['some-tag': 'my-interesting-info'] - context.samplingPriority == priority - if (decisionMaker != null) { - assert context.propagationTags.createTagMap() == ['_dd.p.dm': "-$decisionMaker"] - } else { - assert context.propagationTags.createTagMap() == [:] - } - if (origin) { - assert context.origin.toString() == origin - } - - where: - traceparent | tracestate | priority | decisionMaker | origin - TEST_TP_KEEP | '' | SAMPLER_KEEP | SamplingMechanism.DEFAULT | null - TEST_TP_DROP | '' | SAMPLER_DROP | null | null - TEST_TP_KEEP | "dd=s:2;o:some" | USER_KEEP | null | 'some' - TEST_TP_KEEP | "dd=s:2;o:some;t.dm:-4" | USER_KEEP | SamplingMechanism.MANUAL | 'some' - TEST_TP_DROP | "dd=s:2;o:some;t.dm:-4" | SAMPLER_DROP | null | 'some' - TEST_TP_DROP | "dd=s:-1;o:some" | USER_DROP | null | 'some' - TEST_TP_DROP | "dd=s:-1;o:some;t.dm:-4" | USER_DROP | SamplingMechanism.MANUAL | 'some' - TEST_TP_KEEP | "dd=s:-1;o:some;t.dm:-4" | SAMPLER_KEEP | SamplingMechanism.DEFAULT | 'some' - } - - def "extract header tags with no propagation"() { - when: - TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - !(context instanceof ExtractedContext) - context.getTags() == ['some-tag': 'my-interesting-info'] - - where: - headers << [[SOME_HEADER: 'my-interesting-info'],] - } - - def "extract headers with forwarding"() { - when: - TagContext context = extractor.extract(tagOnlyCtx, ContextVisitors.stringValuesMap()) - - then: - context != null - !(context instanceof ExtractedContext) - context.forwarded == "for=$forwardedIp:$forwardedPort" - - when: - context = extractor.extract(fullCtx, ContextVisitors.stringValuesMap()) - - then: - context instanceof ExtractedContext - context.traceId.toLong() == 1 - context.spanId.toLong() == 2 - context.forwarded == "for=$forwardedIp:$forwardedPort" - - where: - forwardedIp = "1.2.3.4" - forwardedPort = "1234" - tagOnlyCtx = [ - 'Forwarded' : "for=$forwardedIp:$forwardedPort" - ] - fullCtx = [ - (TRACE_PARENT_KEY.toUpperCase()) : '00-00000000000000000000000000000001-0000000000000002-01', - 'Forwarded' : "for=$forwardedIp:$forwardedPort" - ] - } - - def "extract headers with x-forwarding"() { - setup: - String forwardedIp = '1.2.3.4' - String forwardedPort = '1234' - def tagOnlyCtx = [ - 'X-Forwarded-For' : forwardedIp, - 'X-Forwarded-Port': forwardedPort - ] - def fullCtx = [ - (TRACE_PARENT_KEY.toUpperCase()) : '00-00000000000000000000000000000001-0000000000000002-01', - 'x-forwarded-for' : forwardedIp, - 'x-forwarded-port' : forwardedPort - ] - - when: - TagContext context = extractor.extract(tagOnlyCtx, ContextVisitors.stringValuesMap()) - - then: - context != null - context instanceof TagContext - context.XForwardedFor == forwardedIp - context.XForwardedPort == forwardedPort - - when: - context = extractor.extract(fullCtx, ContextVisitors.stringValuesMap()) - - then: - context instanceof ExtractedContext - context.traceId.toLong() == 1 - context.spanId.toLong() == 2 - context.XForwardedFor == forwardedIp - context.XForwardedPort == forwardedPort - } - - def "extract empty headers returns null"() { - expect: - extractor.extract(["ignored-header": "ignored-value"], ContextVisitors.stringValuesMap()) == null - } - - void 'extract headers with ip resolution disabled'() { - setup: - injectSysConfig(TracerConfig.TRACE_CLIENT_IP_RESOLVER_ENABLED, 'false') - - def tagOnlyCtx = [ - 'X-Forwarded-For': '::1', - 'User-agent': 'foo/bar', - ] - - when: - TagContext ctx = extractor.extract(tagOnlyCtx, ContextVisitors.stringValuesMap()) - - then: - ctx != null - ctx.XForwardedFor == null - ctx.userAgent == 'foo/bar' - } - - - void 'extract headers with ip resolution disabled — appsec disabled variant'() { - setup: - ActiveSubsystems.APPSEC_ACTIVE = false - - def tagOnlyCtx = [ - 'X-Forwarded-For': '::1', - 'User-agent': 'foo/bar', - ] - - when: - TagContext ctx = extractor.extract(tagOnlyCtx, ContextVisitors.stringValuesMap()) - - then: - ctx != null - ctx.XForwardedFor == null - } - - void 'custom IP header collection does not disable standard ip header collection'() { - setup: - injectSysConfig(TracerConfig.TRACE_CLIENT_IP_HEADER, "my-header") - - def tagOnlyCtx = [ - 'X-Forwarded-For': '::1', - 'My-Header': '8.8.8.8', - ] - - when: - def ctx = extractor.extract(tagOnlyCtx, ContextVisitors.stringValuesMap()) - - then: - ctx != null - ctx.XForwardedFor == '::1' - ctx.customIpHeader == '8.8.8.8' - } - - def "extract http headers with end to end #endToEndStartTime"() { - setup: - def headers = [ - '' : 'empty key', - (TRACE_PARENT_KEY.toUpperCase()) : '00-00000000000000000000000000000001-123456789abcdef0-01', - (OT_BAGGAGE_PREFIX.toUpperCase() + 'k1'): 'v1', - (OT_BAGGAGE_PREFIX.toUpperCase() + 't0'): endToEndStartTime, - (OT_BAGGAGE_PREFIX.toUpperCase() + 'k2'): 'v2', - SOME_HEADER : 'my-interesting-info', - SOME_CUSTOM_BAGGAGE_HEADER : 'my-interesting-baggage-info', - SOME_CUSTOM_BAGGAGE_HEADER_2 : 'my-interesting-baggage-info-2', - ] - - when: - final ExtractedContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - context.traceId == TRACE_ID_ONE - context.spanId == TEST_SPAN_ID - context.baggage == ['k1': 'v1', - 'k2': 'v2', - 'some-baggage': 'my-interesting-baggage-info', - 'some-CaseSensitive-baggage': 'my-interesting-baggage-info-2'] - context.tags == ['some-tag': 'my-interesting-info'] - context.endToEndStartTime == endToEndStartTime * 1000000L - - where: - endToEndStartTime << [0, 1610001234] - } - - def "baggage is mapped on context creation"() { - setup: - def headers = [ - (TRACE_PARENT_KEY) : traceparent, - SOME_CUSTOM_BAGGAGE_HEADER : 'mappedBaggageValue', - (OT_BAGGAGE_PREFIX.toUpperCase() + 'k1'): 'v1', - (OT_BAGGAGE_PREFIX.toUpperCase() + 'k2'): 'v2', - SOME_ARBITRARY_HEADER : 'my-interesting-info', - ] - - when: - final TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - assert context != null - if (tpValid) { - assert context.getTraceId() == TRACE_ID_ONE - assert context.getSpanId() == 1 - } - context.getBaggage() == [ - 'some-baggage' : 'mappedBaggageValue', - 'k1' : 'v1', - 'k2' : 'v2', - ] - - where: - tpValid | traceparent - false | '00-00000000000000000000000000000000-123456789abcdef0-01' - false | '00-00000000000000000000000000000001-0000000000000000-01' - true | '00-00000000000000000000000000000001-0000000000000001-01' - } - - def "extract common http headers"() { - setup: - def headers = [ - (HttpCodec.USER_AGENT_KEY): 'some-user-agent', - (HttpCodec.X_CLUSTER_CLIENT_IP_KEY): '1.1.1.1', - (HttpCodec.X_REAL_IP_KEY): '2.2.2.2', - (HttpCodec.X_CLIENT_IP_KEY): '3.3.3.3', - (HttpCodec.TRUE_CLIENT_IP_KEY): '4.4.4.4', - (HttpCodec.FORWARDED_FOR_KEY): '5.5.5.5', - (HttpCodec.FORWARDED_KEY): '6.6.6.6', - (HttpCodec.FASTLY_CLIENT_IP_KEY): '7.7.7.7', - (HttpCodec.CF_CONNECTING_IP_KEY): '8.8.8.8', - (HttpCodec.CF_CONNECTING_IP_V6_KEY): '9.9.9.9', - ] - - when: - final TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - assert context.userAgent == 'some-user-agent' - assert context.XClusterClientIp == '1.1.1.1' - assert context.XRealIp == '2.2.2.2' - assert context.XClientIp == '3.3.3.3' - assert context.trueClientIp == '4.4.4.4' - assert context.forwardedFor == '5.5.5.5' - assert context.forwarded == '6.6.6.6' - assert context.fastlyClientIp == '7.7.7.7' - assert context.cfConnectingIp == '8.8.8.8' - assert context.cfConnectingIpv6 == '9.9.9.9' - } - - def "mark inconsistent tid as propagation error"() { - setup: - def headers = [ - (TRACE_PARENT_KEY.toUpperCase()) : traceparent, - (TRACE_STATE_KEY.toUpperCase()) : tracestate, - ] - - when: - final ExtractedContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - context.getPropagationTags().createTagMap() == expectedTags - - where: - traceparent | tracestate | consitent - '00-123456789abcdef00fedcba987654321-123456789abcdef0-01' | '' | true - '00-123456789abcdef00fedcba987654321-123456789abcdef0-01' | "dd=t.tid:123456789abcdef0" | true - '00-123456789abcdef00fedcba987654321-123456789abcdef0-01' | "dd=t.tid:123456789abcdef1" | false - tid = tracestate.empty ? '' : tracestate.substring(9) - defaultTags = ['_dd.p.dm': '-0', '_dd.p.tid': '123456789abcdef0'] - expectedTags = consitent ? defaultTags : defaultTags + ['_dd.propagation_error': "inconsistent_tid $tid"] - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/W3CHttpInjectorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/W3CHttpInjectorTest.groovy deleted file mode 100644 index 06c41767168..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/W3CHttpInjectorTest.groovy +++ /dev/null @@ -1,222 +0,0 @@ -package datadog.trace.core.propagation - -import datadog.trace.api.DDSpanId -import datadog.trace.api.DDTraceId -import datadog.trace.api.datastreams.NoopPathwayContext -import datadog.trace.common.writer.ListWriter -import datadog.trace.core.DDSpanContext -import datadog.trace.core.test.DDCoreSpecification - -import static datadog.trace.api.sampling.PrioritySampling.SAMPLER_KEEP -import static datadog.trace.api.sampling.PrioritySampling.SAMPLER_DROP -import static datadog.trace.api.sampling.PrioritySampling.UNSET -import static datadog.trace.api.sampling.PrioritySampling.USER_KEEP -import static datadog.trace.api.sampling.SamplingMechanism.MANUAL -import static datadog.trace.core.CoreTracer.TRACE_ID_MAX -import static datadog.trace.core.propagation.W3CHttpCodec.OT_BAGGAGE_PREFIX -import static datadog.trace.core.propagation.W3CHttpCodec.TRACE_PARENT_KEY -import static datadog.trace.core.propagation.W3CHttpCodec.TRACE_STATE_KEY -import static datadog.trace.core.propagation.W3CHttpCodec.newInjector - - -class W3CHttpInjectorTest extends DDCoreSpecification { - - HttpCodec.Injector injector = newInjector(["some-baggage-key":"SOME_CUSTOM_HEADER"]) - - def "inject http headers"() { - setup: - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - final DDSpanContext mockedContext = - new DDSpanContext( - DDTraceId.from(traceId), - DDSpanId.from(spanId), - DDSpanId.ZERO, - null, - "fakeService", - "fakeOperation", - "fakeResource", - samplingPriority, - origin, - ["k1" : "v1", "k2" : "v2","some-baggage-key": "some-value"], - false, - "fakeType", - 0, - tracer.traceCollectorFactory.create(DDTraceId.ONE), - null, - null, - NoopPathwayContext.INSTANCE, - false, - PropagationTags.factory().fromHeaderValue(PropagationTags.HeaderType.DATADOG, "_dd.p.usr=123")) - final Map carrier = [:] - Map expected = [ - (TRACE_PARENT_KEY) : buildTraceParent(traceId, spanId, samplingPriority), - (TRACE_STATE_KEY) : tracestate, - (OT_BAGGAGE_PREFIX + "k1"): "v1", - (OT_BAGGAGE_PREFIX + "k2"): "v2", - "SOME_CUSTOM_HEADER" : "some-value", - ] - - when: - injector.inject(mockedContext, carrier, MapSetter.INSTANCE) - - then: - carrier == expected - - cleanup: - tracer.close() - - where: - traceId | spanId | samplingPriority | origin | tracestate - "1" | "2" | UNSET | null | "dd=p:0000000000000002;t.usr:123" - "1" | "4" | SAMPLER_KEEP | "saipan" | "dd=s:1;o:saipan;p:0000000000000004;t.usr:123" - "$TRACE_ID_MAX" | "${TRACE_ID_MAX - 1}" | UNSET | "saipan" | "dd=o:saipan;p:fffffffffffffffe;t.usr:123" - "${TRACE_ID_MAX - 1}" | "$TRACE_ID_MAX" | SAMPLER_KEEP | null | "dd=s:1;p:ffffffffffffffff;t.usr:123" - "${TRACE_ID_MAX - 1}" | "$TRACE_ID_MAX" | SAMPLER_DROP | null | "dd=s:0;p:ffffffffffffffff;t.usr:123" - } - - def "inject http headers with end-to-end"() { - setup: - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - final DDSpanContext mockedContext = - new DDSpanContext( - DDTraceId.from("1"), - DDSpanId.from("2"), - DDSpanId.ZERO, - null, - "fakeService", - "fakeOperation", - "fakeResource", - UNSET, - "fakeOrigin", - ["k1" : "v1", "k2" : "v2"], - false, - "fakeType", - 0, - tracer.traceCollectorFactory.create(DDTraceId.ONE), - null, - null, - NoopPathwayContext.INSTANCE, - false, - PropagationTags.factory().fromHeaderValue(PropagationTags.HeaderType.DATADOG, "_dd.p.dm=-4,_dd.p.anytag=value")) - - mockedContext.beginEndToEnd() - - final Map carrier = [:] - - when: - injector.inject(mockedContext, carrier, MapSetter.INSTANCE) - - then: - carrier == [ - (TRACE_PARENT_KEY): buildTraceParent('1', '2', UNSET), - (TRACE_STATE_KEY): "dd=o:fakeOrigin;p:0000000000000002;t.dm:-4;t.anytag:value", - (OT_BAGGAGE_PREFIX + "t0"): "${(long) (mockedContext.endToEndStartTime / 1000000L)}", - (OT_BAGGAGE_PREFIX + "k1"): "v1", - (OT_BAGGAGE_PREFIX + "k2"): "v2", - ] - - cleanup: - tracer.close() - } - - def "inject the decision maker tag"() { - setup: - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - final DDSpanContext mockedContext = - new DDSpanContext( - DDTraceId.from("1"), - DDSpanId.from("2"), - DDSpanId.ZERO, - null, - "fakeService", - "fakeOperation", - "fakeResource", - UNSET, - "fakeOrigin", - ["k1" : "v1", "k2" : "v2"], - false, - "fakeType", - 0, - tracer.traceCollectorFactory.create(DDTraceId.ONE), - null, - null, - NoopPathwayContext.INSTANCE, - false, - PropagationTags.factory().empty()) - - mockedContext.setSamplingPriority(USER_KEEP, MANUAL) - - final Map carrier = [:] - - when: - injector.inject(mockedContext, carrier, MapSetter.INSTANCE) - - then: - carrier == [ - (TRACE_PARENT_KEY): buildTraceParent('1', '2', USER_KEEP), - (TRACE_STATE_KEY): "dd=s:2;o:fakeOrigin;p:0000000000000002;t.dm:-4", - (OT_BAGGAGE_PREFIX + "k1"): "v1", - (OT_BAGGAGE_PREFIX + "k2"): "v2", - ] - - cleanup: - tracer.close() - } - - def "update last parent id on child span"() { - setup: - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - final Map carrier = [:] - - when: 'injecting root span context' - def rootSpan = tracer.startSpan('test', 'root') - def rootSpanId = rootSpan.spanId - def rootScope = tracer.activateSpan(rootSpan) - - injector.inject(rootSpan.context() as DDSpanContext, carrier, MapSetter.INSTANCE) - def lastParentId = extractLastParentId(carrier) - - then: 'trace state has root span id as last parent' - lastParentId == rootSpanId - - when: 'injecting child span context' - def childSpan = tracer.startSpan('test', 'child') - def childSpanId = childSpan.spanId - carrier.clear() - injector.inject(childSpan.context() as DDSpanContext, carrier, MapSetter.INSTANCE) - lastParentId = extractLastParentId(carrier) - - then: 'trace state has child span id as last parent' - lastParentId == childSpanId - - when: 'injecting root span again' - childSpan.finish() - carrier.clear() - injector.inject(rootSpan.context() as DDSpanContext, carrier, MapSetter.INSTANCE) - lastParentId = extractLastParentId(carrier) - - then: 'trace state has root span is as last parent again' - lastParentId == rootSpanId - - cleanup: - rootScope.close() - rootSpan.finish() - } - - static String buildTraceParent(String traceId, String spanId, int samplingPriority) { - return "00-${DDTraceId.from(traceId).toHexString()}-${DDSpanId.toHexStringPadded(DDSpanId.from(spanId))}-${samplingPriority > 0 ? '01': '00'}" - } - - static long extractLastParentId(Map carrier) { - def traceState = carrier[TRACE_STATE_KEY] - def traceStateMembers = traceState.split(',') - def ddTraceStateMember = traceStateMembers.find { it.startsWith("dd=")}.substring(3) - def parts = ddTraceStateMember.split(';') - def spanIdHex = parts.find { it.startsWith('p:')}.substring(2) - DDSpanId.fromHex(spanIdHex) - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/W3CPropagationTagsTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/W3CPropagationTagsTest.groovy deleted file mode 100644 index 6f6540249cb..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/W3CPropagationTagsTest.groovy +++ /dev/null @@ -1,356 +0,0 @@ -package datadog.trace.core.propagation - -import datadog.trace.api.Config -import datadog.trace.api.ProductTraceSource -import datadog.trace.api.sampling.PrioritySampling -import datadog.trace.api.sampling.SamplingMechanism -import datadog.trace.core.test.DDCoreSpecification - -import static datadog.trace.core.propagation.PropagationTags.HeaderType - -class W3CPropagationTagsTest extends DDCoreSpecification { - - def "validate tracestate header limits #headerValue"() { - setup: - def config = Mock(Config) - config.getxDatadogTagsMaxLength() >> 512 - def propagationTagsFactory = PropagationTags.factory(config) - - when: - def propagationTags = propagationTagsFactory.fromHeaderValue(HeaderType.W3C, headerValue) - - then: - if (valid) { - assert propagationTags.headerValue(HeaderType.W3C) == headerValue.trim() - } else { - assert propagationTags.headerValue(HeaderType.W3C) == null - } - // we're not using any dd members in the tests - propagationTags.createTagMap() == [:] - - where: - headerValue | valid - null | false - '' | false - // check basic key length limit - 'k' * 251 + '0_-*/=1' | true - 'k' * 252 + '0_-*/=1' | false - // check multi key length limit - 't' * 241 + '@' + 's' * 14 + '=1' | true - 't' * 242 + '@' + 's' * 14 + '=1' | false - 't' * 241 + '@' + 's' * 15 + '=1' | false - // check value length limit - 'k=' + 'v' * 256 | true - 'k=' + 'v' * 257 | false - // check value length limit with some trailing whitespace - 'k=' + 'v' * 256 + ' \t \t' | true - 'k=' + 'v' * 257 + ' \t \t' | false - } - - def "validate tracestate header valid key contents '#headerChar'"() { - setup: - def config = Mock(Config) - config.getxDatadogTagsMaxLength() >> 512 - def propagationTagsFactory = PropagationTags.factory(config) - def lcAlpha = toLcAlpha(headerChar) - def simpleKeyHeader = lcAlpha + headerChar + '_-*/=1' - def multiKeyHeader = headerChar + '@' + lcAlpha + headerChar + '_-*/=1' - - - when: - def simpleKeyPT = propagationTagsFactory.fromHeaderValue(HeaderType.W3C, simpleKeyHeader) - def multiKeyPT = propagationTagsFactory.fromHeaderValue(HeaderType.W3C, multiKeyHeader) - - then: - simpleKeyPT.headerValue(HeaderType.W3C) == simpleKeyHeader - multiKeyPT.headerValue(HeaderType.W3C) == multiKeyHeader - // we're not using any dd members in the tests - simpleKeyPT.createTagMap() == [:] - multiKeyPT.createTagMap() == [:] - - where: - headerChar << ('a'..'z') + ('0'..'9') - } - - def "validate tracestate header invalid key contents '#headerChar'"() { - setup: - def config = Mock(Config) - config.getxDatadogTagsMaxLength() >> 512 - def propagationTagsFactory = PropagationTags.factory(config) - def lcAlpha = toLcAlpha(headerChar) - def simpleKeyHeader = lcAlpha + headerChar + '_-*/=1' - def multiKeyHeader = lcAlpha + headerChar + '@' + lcAlpha + headerChar + '_-*/=1' - - - when: - def simpleKeyPT = propagationTagsFactory.fromHeaderValue(HeaderType.W3C, simpleKeyHeader) - def multiKeyPT = propagationTagsFactory.fromHeaderValue(HeaderType.W3C, multiKeyHeader) - - then: - simpleKeyPT.headerValue(HeaderType.W3C) == null - multiKeyPT.headerValue(HeaderType.W3C) == null - // we're not using any dd members in the tests - simpleKeyPT.createTagMap() == [:] - multiKeyPT.createTagMap() == [:] - - where: - headerChar << (' '..'ÿ') - (('a'..'z') + ('0'..'9') + '_' + '-' + '*' + '/') - } - - - def "validate tracestate header valid value contents '#valueChar'"() { - setup: - def config = Mock(Config) - config.getxDatadogTagsMaxLength() >> 512 - def propagationTagsFactory = PropagationTags.factory(config) - def lcAlpha = toLcAlpha(valueChar) - def mostlyOkHeader = lcAlpha + '=' + valueChar - def alwaysOkHeader = lcAlpha + '=' + lcAlpha + valueChar + lcAlpha - - when: - def mostlyOkPT = propagationTagsFactory.fromHeaderValue(HeaderType.W3C, mostlyOkHeader) - def alwaysOkPT = propagationTagsFactory.fromHeaderValue(HeaderType.W3C, alwaysOkHeader) - - then: - if (valueChar == ' ') { - assert mostlyOkPT.headerValue(HeaderType.W3C) == null - } else { - assert mostlyOkPT.headerValue(HeaderType.W3C) == mostlyOkHeader - } - alwaysOkPT.headerValue(HeaderType.W3C) == alwaysOkHeader - // we're not using any dd members in the tests - mostlyOkPT.createTagMap() == [:] - alwaysOkPT.createTagMap() == [:] - - where: - valueChar << (' '..'~') - [',', '='] - } - - def "validate tracestate header invalid value contents '#valueChar'"() { - setup: - def config = Mock(Config) - config.getxDatadogTagsMaxLength() >> 512 - def propagationTagsFactory = PropagationTags.factory(config) - def lcAlpha = toLcAlpha(valueChar) - def alwaysBadHeader = lcAlpha + '=' + lcAlpha + valueChar + lcAlpha - - when: - def alwaysBadPT = propagationTagsFactory.fromHeaderValue(HeaderType.W3C, alwaysBadHeader) - - then: - alwaysBadPT.headerValue(HeaderType.W3C) == null - // we're not using any dd members in the tests - alwaysBadPT.createTagMap() == [:] - - where: - valueChar << (' '..'ÿ') - ((' '..'~') - [',', '=']) - } - - def "validate tracestate header number of members #memberCount without Datadog member"() { - setup: - def config = Mock(Config) - config.getxDatadogTagsMaxLength() >> 512 - def propagationTagsFactory = PropagationTags.factory(config) - def header = (1..memberCount).collect { "k$it=v$it" }.join(',') - - when: - def headerPT = propagationTagsFactory.fromHeaderValue(HeaderType.W3C, header) - - then: - if (memberCount <= 32) { - assert headerPT.headerValue(HeaderType.W3C) == header - } else { - assert headerPT.headerValue(HeaderType.W3C) == null - } - // we're not using any dd members in the tests - headerPT.createTagMap() == [:] - - where: - memberCount << (1..37) // some arbitrary number larger than 32 - } - - def "validate tracestate header number of members #memberCount with Datadog member"() { - setup: - def config = Mock(Config) - config.getxDatadogTagsMaxLength() >> 512 - def propagationTagsFactory = PropagationTags.factory(config) - def header = 'dd=s:1,'+(1..memberCount).collect { "k$it=v$it" }.join(',') - - when: - def headerPT = propagationTagsFactory.fromHeaderValue(HeaderType.W3C, header) - - then: - if (memberCount + 1 <= 32) { - assert headerPT.headerValue(HeaderType.W3C) == header - } else { - assert headerPT.headerValue(HeaderType.W3C) == null - } - // we're not using any dd members in the tests - headerPT.createTagMap() == [:] - - where: - memberCount << (1..37) // some arbitrary number larger than 32 - } - - def "validate tracestate header number of members #memberCount when propagating original tracestate"() { - setup: - def config = Mock(Config) - config.getxDatadogTagsMaxLength() >> 512 - def propagationTagsFactory = PropagationTags.factory(config) - def header = (1..memberCount).collect { "k$it=v$it" }.join(',') - def expectedHeader = 'dd=t.dm:-4,' + ( - memberCount > 32 ? - '' : - (1..Math.min(memberCount, 31)).collect { "k$it=v$it" }.join(',')) - - when: - def datadogHeaderPT = propagationTagsFactory.fromHeaderValue(HeaderType.DATADOG, '_dd.p.dm=-4') - def headerPT = propagationTagsFactory.fromHeaderValue(HeaderType.W3C, header) - datadogHeaderPT.updateW3CTracestate(headerPT.getW3CTracestate()) - - then: - if (memberCount <= 32) { - assert datadogHeaderPT.headerValue(HeaderType.W3C) == expectedHeader // 'dd=t.dm:-4,' + header - } else { - assert datadogHeaderPT.headerValue(HeaderType.W3C) == 'dd=t.dm:-4' - } - datadogHeaderPT.createTagMap() == ['_dd.p.dm':'-4'] - - where: - memberCount << (1..37) // some arbitrary number larger than 32 - } - - def "create propagation tags from header value #headerValue"() { - setup: - def config = Mock(Config) - config.getxDatadogTagsMaxLength() >> 512 - def propagationTagsFactory = PropagationTags.factory(config) - - when: - def propagationTags = propagationTagsFactory.fromHeaderValue(HeaderType.W3C, headerValue) - - then: - propagationTags.headerValue(HeaderType.W3C) == expectedHeaderValue - propagationTags.createTagMap() == tags - - where: - headerValue | expectedHeaderValue | tags - null | null | [:] - '' | null | [:] - 'dd=s:0;t.dm:934086a686-4' | 'dd=s:0;t.dm:934086a686-4' | ['_dd.p.dm': '934086a686-4'] - 'dd=s:0;t.ts:02' | 'dd=s:0;t.ts:02' | ['_dd.p.ts': '02'] - 'dd=s:0;t.ts:00' | 'dd=s:0' | [:] - 'dd=s:0;t.dm:934086a686-4;t.ts:02' | 'dd=s:0;t.dm:934086a686-4;t.ts:02' | ['_dd.p.dm': '934086a686-4', '_dd.p.ts': '02'] - 'other=whatever,dd=s:0;t.dm:934086a686-4' | 'dd=s:0;t.dm:934086a686-4,other=whatever' | ['_dd.p.dm': '934086a686-4'] - 'dd=s:0;t.dm:934086a687-3,other=whatever' | 'dd=s:0;t.dm:934086a687-3,other=whatever' | ['_dd.p.dm': '934086a687-3'] - 'some=thing,dd=s:0;t.dm:934086a687-3,other=whatever' | 'dd=s:0;t.dm:934086a687-3,some=thing,other=whatever' | ['_dd.p.dm': '934086a687-3'] - 'some=thing,other=whatever' | 'some=thing,other=whatever' | [:] - 'dd=s:0;o:some;t.dm:934086a686-4' | 'dd=s:0;o:some;t.dm:934086a686-4' | ['_dd.p.dm': '934086a686-4'] - 'dd=s:0;x:unknown;t.dm:934086a686-4' | 'dd=s:0;t.dm:934086a686-4;x:unknown' | ['_dd.p.dm': '934086a686-4'] - 'other=whatever,dd=s:0;x:unknown;t.dm:934086a686-4' | 'dd=s:0;t.dm:934086a686-4;x:unknown,other=whatever' | ['_dd.p.dm': '934086a686-4'] - 'other=whatever,dd=xyz:unknown;t.dm:934086a686-4' | 'dd=t.dm:934086a686-4;xyz:unknown,other=whatever' | ['_dd.p.dm': '934086a686-4'] - 'other=whatever,dd=t.dm:934086a686-4;xyz:unknown ' | 'dd=t.dm:934086a686-4;xyz:unknown,other=whatever' | ['_dd.p.dm': '934086a686-4'] - '\tsome=thing \t , dd=s:0;t.dm:934086a687-3\t\t, other=whatever\t\t ' | 'dd=s:0;t.dm:934086a687-3,some=thing,other=whatever' | ['_dd.p.dm': '934086a687-3'] - 'dd=s:0;t.a:b;t.x:y' | 'dd=s:0;t.a:b;t.x:y' | ['_dd.p.a': 'b', '_dd.p.x': 'y'] - 'dd=s:0;t.a:b;t.x:y \t' | 'dd=s:0;t.a:b;t.x:y' | ['_dd.p.a': 'b', '_dd.p.x': 'y'] - 'dd=s:0;t.a:b ;t.x:y \t' | 'dd=s:0;t.a:b ;t.x:y' | ['_dd.p.a': 'b ', '_dd.p.x': 'y'] - 'dd=s:0;t.a:b \t;t.x:y \t' | null | [:] - 'dd=s:0;t.tid:123456789abcdef0' | 'dd=s:0;t.tid:123456789abcdef0' | ['_dd.p.tid': '123456789abcdef0'] - "dd=t.tid:" | null | [:] // invalid tid tag value: empty value - "dd=t.tid:" + "1" * 1 | null | ['_dd.propagation_error': 'malformed_tid 1'] // invalid tid tag value: invalid length - "dd=t.tid:" + "1" * 15 | null | ['_dd.propagation_error': 'malformed_tid 111111111111111'] // invalid tid tag value: invalid length - "dd=t.tid:" + "1" * 17 | null | ['_dd.propagation_error': 'malformed_tid 11111111111111111'] // invalid tid tag value: invalid length - "dd=t.tid:123456789ABCDEF0" | null | ['_dd.propagation_error': 'malformed_tid 123456789ABCDEF0'] // invalid tid tag value: upper-case characters - "dd=t.tid:123456789abcdefg" | null | ['_dd.propagation_error': 'malformed_tid 123456789abcdefg'] // invalid tid tag value: non-hexadecimal characters - "dd=t.tid:-123456789abcdef" | null | ['_dd.propagation_error': 'malformed_tid -123456789abcdef'] // invalid tid tag value: non-hexadecimal characters - } - - def "w3c propagation tags should translate to datadog tags #headerValue"() { - setup: - def config = Mock(Config) - config.getxDatadogTagsMaxLength() >> 512 - def propagationTagsFactory = PropagationTags.factory(config) - - when: - def propagationTags = propagationTagsFactory.fromHeaderValue(HeaderType.W3C, headerValue) - - then: - propagationTags.headerValue(HeaderType.DATADOG) == expectedHeaderValue - propagationTags.createTagMap() == tags - - where: - headerValue | expectedHeaderValue | tags - 'dd=s:0;t.dm:934086a686-4' | '_dd.p.dm=934086a686-4' | ['_dd.p.dm': '934086a686-4'] - 'other=whatever,dd=s:0;t.dm:934086a686-4;t.f:w00t~~' | '_dd.p.dm=934086a686-4,_dd.p.f=w00t==' | ['_dd.p.dm': '934086a686-4', '_dd.p.f': 'w00t=='] - 'dd=s:0;t.ts:02' | '_dd.p.ts=02' | ['_dd.p.ts': '02'] - 'dd=s:0;t.ts:00' | null | [:] - 'dd=s:0;t.ts:0' | null | [:] - 'dd=s:0;t.ts:invalid' | null | [:] - 'other=whatever,dd=s:0;t.dm:934086a686-4;t.f:w00t~~;t.ts:02' | '_dd.p.dm=934086a686-4,_dd.p.ts=02,_dd.p.f=w00t==' | ['_dd.p.dm': '934086a686-4', '_dd.p.f': 'w00t==', '_dd.p.ts': '02'] - 'some=thing,other=whatever' | null | [:] - } - - def "propagation tags should be updated by sampling and origin #headerValue #priority #mechanism #origin"() { - setup: - def config = Mock(Config) - config.getxDatadogTagsMaxLength() >> 512 - def propagationTagsFactory = PropagationTags.factory(config) - - when: - def propagationTags = propagationTagsFactory.fromHeaderValue(HeaderType.W3C, headerValue) - - then: - propagationTags.headerValue(HeaderType.W3C) != expectedHeaderValue - - when: - propagationTags.updateTraceSamplingPriority(priority, mechanism) - propagationTags.updateTraceOrigin(origin) - - then: - propagationTags.headerValue(HeaderType.W3C) == expectedHeaderValue - propagationTags.createTagMap() == tags - - where: - headerValue | priority | mechanism | origin | expectedHeaderValue | tags - 'dd=s:0;o:some;t.dm:934086a686-4' | PrioritySampling.SAMPLER_KEEP | SamplingMechanism.DEFAULT | "other" | 'dd=s:0;o:other;t.dm:934086a686-4' | ['_dd.p.dm': '934086a686-4'] - 'dd=s:0;o:some;x:unknown' | PrioritySampling.USER_KEEP | SamplingMechanism.LOCAL_USER_RULE | "same" | 'dd=s:2;o:same;t.dm:-3;x:unknown' | ['_dd.p.dm': '-3'] - 'dd=s:0;o:some;x:unknown' | PrioritySampling.USER_DROP | SamplingMechanism.MANUAL | null | 'dd=s:-1;x:unknown' | [:] - 'dd=s:0;o:some;t.dm:934086a686-4' | PrioritySampling.SAMPLER_KEEP | SamplingMechanism.EXTERNAL_OVERRIDE | "other" | 'dd=s:1;o:other;t.dm:-0' | ['_dd.p.dm': '-0'] - 'dd=s:1;o:some;t.dm:934086a686-4' | PrioritySampling.SAMPLER_DROP | SamplingMechanism.EXTERNAL_OVERRIDE | "other" | 'dd=s:0;o:other' | [:] - } - - def "propagation tags should be updated by product trace source propagation #product"() { - setup: - def config = Mock(Config) - config.getxDatadogTagsMaxLength() >> 512 - def propagationTagsFactory = PropagationTags.factory(config) - - when: - def propagationTags = propagationTagsFactory.fromHeaderValue(HeaderType.W3C, headerValue) - - then: - propagationTags.headerValue(HeaderType.W3C) != expectedHeaderValue - - when: - propagationTags.addTraceSource(product) - - then: - propagationTags.headerValue(HeaderType.W3C) == expectedHeaderValue - propagationTags.createTagMap() == tags - - where: - headerValue | product | expectedHeaderValue | tags - 'dd=x:unknown' | ProductTraceSource.ASM | 'dd=t.ts:02;x:unknown' | ['_dd.p.ts': '02'] - 'dd=t.ts:02;x:unknown' | ProductTraceSource.DBM | 'dd=t.ts:12;x:unknown' | ['_dd.p.ts': '12'] - "dd=t.ts:00" | ProductTraceSource.ASM | 'dd=t.ts:02' | ["_dd.p.ts": "02"] - "dd=t.ts:FFC00000" | ProductTraceSource.ASM | 'dd=t.ts:02' | ["_dd.p.ts": "02"] - } - - static private String toLcAlpha(String cs) { - // Argh groovy and characters - char c = cs - char a = 'a' - char z = 'z' - "${Character.valueOf((a + (Math.abs(c - a) % (z - a))) as char)}" - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/XRayHttpExtractorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/XRayHttpExtractorTest.groovy deleted file mode 100644 index 78b6d5c60d5..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/XRayHttpExtractorTest.groovy +++ /dev/null @@ -1,280 +0,0 @@ -package datadog.trace.core.propagation - -import datadog.trace.api.Config -import datadog.trace.api.DD64bTraceId -import datadog.trace.api.DDSpanId -import datadog.trace.api.DDTraceId -import datadog.trace.api.DynamicConfig -import datadog.trace.api.sampling.PrioritySampling -import datadog.trace.bootstrap.ActiveSubsystems -import datadog.trace.bootstrap.instrumentation.api.ContextVisitors -import datadog.trace.bootstrap.instrumentation.api.TagContext -import datadog.trace.test.util.DDSpecification - -import static datadog.trace.api.config.TracerConfig.PROPAGATION_EXTRACT_LOG_HEADER_NAMES_ENABLED - -class XRayHttpExtractorTest extends DDSpecification { - - DynamicConfig dynamicConfig - HttpCodec.Extractor extractor - - boolean origAppSecActive - - void setup() { - dynamicConfig = DynamicConfig.create() - .setHeaderTags(["SOME_HEADER": "some-tag"]) - .setBaggageMapping(["SOME_CUSTOM_BAGGAGE_HEADER": "some-baggage", "SOME_CUSTOM_BAGGAGE_HEADER_2": "some-CaseSensitive-baggage"]) - .apply() - extractor = XRayHttpCodec.newExtractor(Config.get(), { dynamicConfig.captureTraceConfig() }) - origAppSecActive = ActiveSubsystems.APPSEC_ACTIVE - ActiveSubsystems.APPSEC_ACTIVE = true - - injectSysConfig(PROPAGATION_EXTRACT_LOG_HEADER_NAMES_ENABLED, "true") - } - - void cleanup() { - ActiveSubsystems.APPSEC_ACTIVE = origAppSecActive - } - - def "extract http headers"() { - setup: - def headers = [ - 'X-Amzn-Trace-Id' : "Root=1-00000000-00000000${traceId.padLeft(16, '0')};" + - "Parent=${spanId.padLeft(16, '0')}${samplingPriority};=empty key;empty value=;=;;", - SOME_HEADER : "my-interesting-info", - SOME_CUSTOM_BAGGAGE_HEADER : "my-interesting-baggage-info", - SOME_CUSTOM_BAGGAGE_HEADER_2 : "my-interesting-baggage-info-2", - ] - - when: - final ExtractedContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - context.traceId == DDTraceId.fromHex("$traceId") - context.spanId == DDSpanId.fromHex("$spanId") - context.baggage == [ - "empty value" : "", - "some-baggage": "my-interesting-baggage-info", - "some-CaseSensitive-baggage": "my-interesting-baggage-info-2" - ] - context.tags == [ - "some-tag" : "my-interesting-info" - ] - context.samplingPriority == expectedSamplingPriority - context.origin == null - - where: - traceId | spanId | samplingPriority | expectedSamplingPriority - "1" | "2" | "" | PrioritySampling.UNSET - "2" | "3" | ";Sampled=1" | PrioritySampling.SAMPLER_KEEP - "3" | "4" | ";Sampled=0" | PrioritySampling.SAMPLER_DROP - "f" * 16 | "f" * 15 + "e" | ";Sampled=0" | PrioritySampling.SAMPLER_DROP - "f" * 15 + "e" | "f" * 16 | ";Sampled=1" | PrioritySampling.SAMPLER_KEEP - } - - def "extract header tags with no propagation"() { - when: - TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - !(context instanceof ExtractedContext) - context.getTags() == ["some-tag": "my-interesting-info"] - - where: - headers | _ - [SOME_HEADER: "my-interesting-info"] | _ - } - - def "extract headers with forwarding"() { - when: - TagContext context = extractor.extract(tagOnlyCtx, ContextVisitors.stringValuesMap()) - - then: - context != null - !(context instanceof ExtractedContext) - context.forwarded == "for=$forwardedIp:$forwardedPort" - - when: - context = extractor.extract(fullCtx, ContextVisitors.stringValuesMap()) - - then: - context instanceof ExtractedContext - context.traceId.toLong() == 1 - context.spanId.toLong() == 2 - context.forwarded == "for=$forwardedIp:$forwardedPort" - - where: - forwardedIp = "1.2.3.4" - forwardedPort = "1234" - tagOnlyCtx = [ - "Forwarded" : "for=$forwardedIp:$forwardedPort" - ] - fullCtx = [ - "x-amzn-trace-id" : "Root=1-00000000-000000000000000000000001;Parent=0000000000000002", - "Forwarded" : "for=$forwardedIp:$forwardedPort" - ] - } - - def "extract headers with x-forwarding"() { - when: - TagContext context = extractor.extract(tagOnlyCtx, ContextVisitors.stringValuesMap()) - - then: - context != null - context instanceof TagContext - context.XForwardedFor == forwardedIp - context.XForwardedPort == forwardedPort - - when: - context = extractor.extract(fullCtx, ContextVisitors.stringValuesMap()) - - then: - context instanceof ExtractedContext - context.traceId.toLong() == 1 - context.spanId.toLong() == 2 - context.XForwardedFor == forwardedIp - context.XForwardedPort == forwardedPort - - where: - forwardedIp = "1.2.3.4" - forwardedPort = "1234" - tagOnlyCtx = [ - "X-Forwarded-For" : forwardedIp, - "X-Forwarded-Port": forwardedPort - ] - fullCtx = [ - "x-amzn-trace-id" : "Root=1-00000000-000000000000000000000001;Parent=0000000000000002", - "x-forwarded-for" : forwardedIp, - "x-forwarded-port" : forwardedPort - ] - } - - def "no context with empty headers"() { - expect: - extractor.extract(["ignored-header": "ignored-value"], ContextVisitors.stringValuesMap()) == null - } - - def "no context with invalid non-numeric ID"() { - setup: - def headers = [ - "x-amzn-trace-Id" : "Root=1-00000000-00000000000000000traceId;Parent=0000000000spanId", - SOME_HEADER : "my-interesting-info", - ] - - when: - TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - context == null - } - - def "no context with too large trace-id"() { - setup: - def headers = [ - 'X-Amzn-Trace-Id' : "Root=1-5759e988-bd862e3fe1be46a994272793;Parent=53995c3f42cd8ad8" - ] - - when: - TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - context == null - } - - def "extract http headers with non-zero epoch"() { - setup: - def headers = [ - 'X-Amzn-Trace-Id' : "Root=1-5759e988-00000000e1be46a994272793;Parent=53995c3f42cd8ad8" - ] - - when: - TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - context.traceId == DDTraceId.fromHex("e1be46a994272793") - context.spanId == DDSpanId.fromHex("53995c3f42cd8ad8") - context.origin == null - } - - def "extract ids while retaining the original string"() { - setup: - def headers = [ - 'X-Amzn-Trace-Id' : "Root=1-00000000-00000000${traceId.padLeft(16, '0')};Parent=${spanId.padLeft(16, '0')}" - ] - - when: - final ExtractedContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - if (expectedTraceId) { - assert context.traceId == expectedTraceId - assert context.traceId.toHexStringPadded(16) == traceId.padLeft(16, '0') - assert context.spanId == expectedSpanId - assert DDSpanId.toHexStringPadded(context.spanId) == spanId.padLeft(16, '0') - } else { - assert context == null - } - - where: - traceId | spanId | expectedTraceId | expectedSpanId - "00001" | "00001" | DD64bTraceId.ONE | 1 - "463ac35c9f6413ad" | "463ac35c9f6413ad" | DD64bTraceId.fromHex("463ac35c9f6413ad") | DDSpanId.from("5060571933882717101") - "48485a3953bb6124" | "1" | DD64bTraceId.fromHex("48485a3953bb6124") | 1 - "f" * 16 | "1" | DD64bTraceId.MAX | 1 - "1" | "f" * 16 | DD64bTraceId.ONE | DDSpanId.MAX - } - - def "extract headers with end-to-end"() { - setup: - def ctx = [ - 'X-Amzn-Trace-Id' : "Root=1-00000000-00000000${traceId.padLeft(16, '0')}" + - ";Parent=${spanId.padLeft(16, '0')};k1=v1;t0=${endToEndStartTime};k2=v2" - ] - - when: - ExtractedContext context = extractor.extract(ctx, ContextVisitors.stringValuesMap()) - - then: - context.traceId == DDTraceId.from(traceId) - context.spanId == DDSpanId.from(spanId) - context.baggage == ["k1": "v1", "k2": "v2"] - context.endToEndStartTime == endToEndStartTime * 1000000L - - where: - traceId | spanId | endToEndStartTime - "1" | "2" | 0 - "2" | "3" | 1610001234 - } - - - def "extract common http headers"() { - setup: - def headers = [ - (HttpCodec.USER_AGENT_KEY): 'some-user-agent', - (HttpCodec.X_CLUSTER_CLIENT_IP_KEY): '1.1.1.1', - (HttpCodec.X_REAL_IP_KEY): '2.2.2.2', - (HttpCodec.X_CLIENT_IP_KEY): '3.3.3.3', - (HttpCodec.TRUE_CLIENT_IP_KEY): '4.4.4.4', - (HttpCodec.FORWARDED_FOR_KEY): '5.5.5.5', - (HttpCodec.FORWARDED_KEY): '6.6.6.6', - (HttpCodec.FASTLY_CLIENT_IP_KEY): '7.7.7.7', - (HttpCodec.CF_CONNECTING_IP_KEY): '8.8.8.8', - (HttpCodec.CF_CONNECTING_IP_V6_KEY): '9.9.9.9', - ] - - when: - final TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - - then: - assert context.userAgent == 'some-user-agent' - assert context.XClusterClientIp == '1.1.1.1' - assert context.XRealIp == '2.2.2.2' - assert context.XClientIp == '3.3.3.3' - assert context.trueClientIp == '4.4.4.4' - assert context.forwardedFor == '5.5.5.5' - assert context.forwarded == '6.6.6.6' - assert context.fastlyClientIp == '7.7.7.7' - assert context.cfConnectingIp == '8.8.8.8' - assert context.cfConnectingIpv6 == '9.9.9.9' - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/XRayHttpInjectorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/XRayHttpInjectorTest.groovy deleted file mode 100644 index f8ecf31c1f7..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/XRayHttpInjectorTest.groovy +++ /dev/null @@ -1,189 +0,0 @@ -package datadog.trace.core.propagation - -import datadog.trace.api.Config -import datadog.trace.api.DDSpanId -import datadog.trace.api.DDTraceId -import datadog.trace.api.DynamicConfig -import datadog.trace.api.time.TimeSource -import datadog.trace.api.datastreams.NoopPathwayContext -import datadog.trace.core.datastreams.DataStreamsMonitoring - -import static datadog.trace.api.sampling.PrioritySampling.* -import static datadog.trace.api.sampling.SamplingMechanism.* -import datadog.trace.bootstrap.instrumentation.api.ContextVisitors -import datadog.trace.bootstrap.instrumentation.api.TagContext -import datadog.trace.common.writer.ListWriter -import datadog.trace.core.DDSpanContext -import datadog.trace.core.test.DDCoreSpecification - -import static datadog.trace.core.CoreTracer.TRACE_ID_MAX - -class XRayHttpInjectorTest extends DDCoreSpecification { - - HttpCodec.Injector injector = XRayHttpCodec.newInjector(["some-baggage-key":"SOME_CUSTOM_HEADER"]) - - def "inject http headers"() { - setup: - def writer = new ListWriter() - def timeSource = Mock(TimeSource) - def tracer = tracerBuilder() - .dataStreamsMonitoring(Mock(DataStreamsMonitoring)) - .writer(writer) - .timeSource(timeSource) - .build() - final DDSpanContext mockedContext = - new DDSpanContext( - DDTraceId.from("$traceId"), - DDSpanId.from("$spanId"), - DDSpanId.ZERO, - null, - "fakeService", - "fakeOperation", - "fakeResource", - samplingPriority, - "fakeOrigin", - ["k": "v", "some-baggage-key": "some-value"], - false, - "fakeType", - 0, - tracer.traceCollectorFactory.create(DDTraceId.ONE), - null, - null, - NoopPathwayContext.INSTANCE, - false, - null) - - final Map carrier = Mock() - - when: - injector.inject(mockedContext, carrier, MapSetter.INSTANCE) - - then: - 1 * timeSource.getCurrentTimeMillis() >> 1_664_906_869_196 - 1 * carrier.put('X-Amzn-Trace-Id', "$expectedTraceHeader") - 0 * _ - - cleanup: - tracer.close() - - where: - traceId | spanId | samplingPriority | samplingMechanism | expectedTraceHeader - 1G | 2G | UNSET | UNKNOWN | 'Root=1-633c7675-000000000000000000000001;Parent=0000000000000002;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v' - 2G | 3G | SAMPLER_KEEP | DEFAULT | 'Root=1-633c7675-000000000000000000000002;Parent=0000000000000003;Sampled=1;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v' - 4G | 5G | SAMPLER_DROP | DEFAULT | 'Root=1-633c7675-000000000000000000000004;Parent=0000000000000005;Sampled=0;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v' - 5G | 6G | USER_KEEP | MANUAL | 'Root=1-633c7675-000000000000000000000005;Parent=0000000000000006;Sampled=1;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v' - 6G | 7G | USER_DROP | MANUAL | 'Root=1-633c7675-000000000000000000000006;Parent=0000000000000007;Sampled=0;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v' - TRACE_ID_MAX | TRACE_ID_MAX - 1 | UNSET | UNKNOWN | 'Root=1-633c7675-00000000ffffffffffffffff;Parent=fffffffffffffffe;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v' - TRACE_ID_MAX - 1 | TRACE_ID_MAX | SAMPLER_KEEP | DEFAULT | 'Root=1-633c7675-00000000fffffffffffffffe;Parent=ffffffffffffffff;Sampled=1;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v' - } - - def "inject http headers with extracted original"() { - setup: - def writer = new ListWriter() - def timeSource = Mock(TimeSource) - def tracer = tracerBuilder() - .dataStreamsMonitoring(Mock(DataStreamsMonitoring)) - .writer(writer) - .timeSource(timeSource) - .build() - def headers = [ - 'X-Amzn-Trace-Id' : "Root=1-00000000-00000000${traceId.padLeft(16, '0')};Parent=${spanId.padLeft(16, '0')}" - ] - DynamicConfig dynamicConfig = DynamicConfig.create() - .setHeaderTags([:]) - .setBaggageMapping([:]) - .apply() - HttpCodec.Extractor extractor = XRayHttpCodec.newExtractor(Config.get(), { dynamicConfig.captureTraceConfig() }) - final TagContext context = extractor.extract(headers, ContextVisitors.stringValuesMap()) - final DDSpanContext mockedContext = - new DDSpanContext( - context.traceId, - context.spanId, - DDSpanId.ZERO, - null, - "fakeService", - "fakeOperation", - "fakeResource", - UNSET, - "fakeOrigin", - ["k": "v", "some-baggage-key": "some-value"], - false, - "fakeType", - 0, - tracer.traceCollectorFactory.create(DDTraceId.ONE), - null, - null, - NoopPathwayContext.INSTANCE, - false, - null) - final Map carrier = Mock() - - when: - injector.inject(mockedContext, carrier, MapSetter.INSTANCE) - - then: - 1 * timeSource.getCurrentTimeMillis() >> 1_664_906_869_196 - 1 * carrier.put('X-Amzn-Trace-Id', "$expectedTraceHeader") - 0 * _ - - println carrier.toString() - - cleanup: - tracer.close() - - where: - traceId | spanId | expectedTraceHeader - "00001" | "00001" | 'Root=1-633c7675-000000000000000000000001;Parent=0000000000000001;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v' - "463ac35c9f6413ad" | "463ac35c9f6413ad" | 'Root=1-633c7675-00000000463ac35c9f6413ad;Parent=463ac35c9f6413ad;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v' - "48485a3953bb6124" | "1" | 'Root=1-633c7675-0000000048485a3953bb6124;Parent=0000000000000001;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v' - "f" * 16 | "1" | 'Root=1-633c7675-00000000ffffffffffffffff;Parent=0000000000000001;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v' - "a" * 8 + "f" * 8 | "1" | 'Root=1-633c7675-00000000aaaaaaaaffffffff;Parent=0000000000000001;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v' - "1" | "f" * 16 | 'Root=1-633c7675-000000000000000000000001;Parent=ffffffffffffffff;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v' - } - - def "inject http headers with end-to-end"() { - setup: - def writer = new ListWriter() - def timeSource = Mock(TimeSource) - def tracer = tracerBuilder() - .dataStreamsMonitoring(Mock(DataStreamsMonitoring)) - .writer(writer) - .timeSource(timeSource) - .build() - final DDSpanContext mockedContext = - new DDSpanContext( - DDTraceId.from("1"), - DDSpanId.from("2"), - DDSpanId.ZERO, - null, - "fakeService", - "fakeOperation", - "fakeResource", - UNSET, - "fakeOrigin", - ["k": "v"], - false, - "fakeType", - 0, - tracer.traceCollectorFactory.create(DDTraceId.ONE), - null, - null, - NoopPathwayContext.INSTANCE, - false, - null) - final Map carrier = Mock() - - when: - mockedContext.beginEndToEnd() - injector.inject(mockedContext, carrier, MapSetter.INSTANCE) - - then: - 1 * timeSource.getCurrentTimeNanos() >> 1_664_906_869_196_787_813 - 1 * timeSource.getNanoTicks() >> 1_664_906_869_196 - 1 * carrier.put('X-Amzn-Trace-Id', "Root=1-633c7675-000000000000000000000001;Parent=0000000000000002;_dd.origin=fakeOrigin;t0=1664906869195;k=v") - 0 * _ - - cleanup: - tracer.close() - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/ptags/TagKeyTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/ptags/TagKeyTest.groovy deleted file mode 100644 index 4acbd543d16..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/ptags/TagKeyTest.groovy +++ /dev/null @@ -1,63 +0,0 @@ -package datadog.trace.core.propagation.ptags - -import datadog.trace.core.test.DDCoreSpecification - -import static datadog.trace.core.propagation.ptags.TagElement.Encoding.DATADOG -import static datadog.trace.core.propagation.ptags.TagElement.Encoding.W3C - -class TagKeyTest extends DDCoreSpecification { - - - def 'tag keys should use cached values when appropriate #seq1 #seq2'() { - when: - def tk1 = TagKey.from(enc1, seq1) - def tk2 = TagKey.from(enc2, seq2) - - then: - tk1.forType(enc1) == seq1 - tk2.forType(enc2) == seq2 - if (same) { - assert tk1.is(tk2) - assert tk1.forType(enc2) == seq2 - } else { - assert !tk1.is(tk2) - } - - where: - seq1 | enc1 | seq2 | enc2 | same - '_dd.p.foo1' | DATADOG | '_dd.p.foo1' | DATADOG | true - 't.foo2' | W3C | 't.foo2' | W3C | true - '_dd.p.foo3' | DATADOG | 't.foo3' | W3C | true - 't.foo4' | W3C | '_dd.p.foo4' | DATADOG | true - 't.foo5~' | W3C | '_dd.p.foo5=' | DATADOG | false - '_dd.p.foo6~' | DATADOG | 't.foo6~' | W3C | true - '_dd.p.foo7~' | DATADOG | 't.foo7=' | W3C | false - '_dd.p.foo81' | DATADOG | 't.foo82' | W3C | false - } - - def 'tag values should use cached values from sub sequences #seq1 #seq2'() { - when: - def tv1 = TagKey.from(enc1, seq1, s1, e1) - def sub1 = seq1.substring(s1, e1) - def tv2 = TagKey.from(enc2, seq2, s2, e2) - def sub2 = seq2.substring(s2, e2) - - then: - tv1.forType(enc1) == sub1 - tv2.forType(enc2) == sub2 - if (same) { - assert tv1.is(tv2) - assert tv1.forType(enc2) == sub2 - } else { - assert !tv1.is(tv2) - } - - where: - seq1 | enc1 | s1 | e1 | seq2 | enc2 | s2 | e2 | same - 'bb_dd.p.bar1' | DATADOG | 2 | 12 | 'r_dd.p.bar1r' | DATADOG | 1 | 11 | true - 't.bar2ss' | W3C | 0 | 6 | 't_dd.p.bar2t' | DATADOG | 1 | 11 | true - 't.bar3~s' | W3C | 0 | 7 | 't_dd.p.bar3=' | DATADOG | 1 | 12 | false - 't.bar4~s' | W3C | 0 | 7 | 'tt.bar4~' | W3C | 1 | 8 | true - 's_dd.p.bar5=' | DATADOG | 1 | 12 | 't.bar5~t' | W3C | 0 | 7 | false - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/ptags/TagValueTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/ptags/TagValueTest.groovy deleted file mode 100644 index a4d8212a903..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/propagation/ptags/TagValueTest.groovy +++ /dev/null @@ -1,66 +0,0 @@ -package datadog.trace.core.propagation.ptags - -import datadog.trace.core.test.DDCoreSpecification - -import static datadog.trace.core.propagation.ptags.TagElement.Encoding.DATADOG -import static datadog.trace.core.propagation.ptags.TagElement.Encoding.W3C - -class TagValueTest extends DDCoreSpecification { - - - def 'tag values should use cached values when appropriate #seq1 #seq2'() { - when: - def tv1 = TagValue.from(enc1, seq1) - def tv2 = TagValue.from(enc2, seq2) - - then: - tv1.forType(enc1) == seq1 - tv2.forType(enc2) == seq2 - if (same) { - assert tv1.is(tv2) - assert tv1.forType(enc2) == seq2 - } else { - assert !tv1.is(tv2) - } - - where: - seq1 | enc1 | seq2 | enc2 | same - 'foo1' | DATADOG | 'foo1' | DATADOG | true - 'foo2' | W3C | 'foo2' | W3C | true - 'foo3' | DATADOG | 'foo3' | W3C | true - 'foo4' | W3C | 'foo4' | DATADOG | true - 'foo5~' | W3C | 'foo5=' | DATADOG | true - 'foo6=' | DATADOG | 'foo6~' | W3C | true - 'foo7~' | DATADOG | 'foo7~' | W3C | false - 'foo81' | DATADOG | 'foo82' | W3C | false - 'foo9;' | DATADOG | 'foo9_' | W3C | false - } - - def 'tag values should use cached values from sub sequences #seq1 #seq2'() { - when: - def tv1 = TagValue.from(enc1, seq1, s1, e1) - def sub1 = seq1.substring(s1, e1) - def tv2 = TagValue.from(enc2, seq2, s2, e2) - def sub2 = seq2.substring(s2, e2) - - then: - tv1.forType(enc1) == sub1 - tv2.forType(enc2) == sub2 - if (same) { - assert tv1.is(tv2) - assert tv1.forType(enc2) == sub2 - } else { - assert !tv1.is(tv2) - } - - where: - seq1 | enc1 | s1 | e1 | seq2 | enc2 | s2 | e2 | same - 'bbbar1' | DATADOG | 2 | 6 | 'rbar1r' | DATADOG | 1 | 5 | true - 'bar2ss' | W3C | 0 | 4 | 'tbar2t' | DATADOG | 1 | 5 | true - 'bar3~s' | W3C | 0 | 5 | 'tbar3=' | DATADOG | 1 | 6 | true - 'bar4~s' | W3C | 0 | 5 | 'tbar4~' | W3C | 1 | 6 | true - 'sbar5=' | DATADOG | 1 | 6 | 'bar5~t' | W3C | 0 | 5 | true - 'sbar6?' | DATADOG | 1 | 6 | 'bar5!t' | W3C | 0 | 5 | false - 'sbar6,' | DATADOG | 1 | 6 | 'bar6_t' | W3C | 0 | 5 | false - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/scopemanager/IterationSpansForkedTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/scopemanager/IterationSpansForkedTest.groovy deleted file mode 100644 index f9b47b55da9..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/scopemanager/IterationSpansForkedTest.groovy +++ /dev/null @@ -1,225 +0,0 @@ -package datadog.trace.core.scopemanager - -import datadog.metrics.api.statsd.StatsDClient -import datadog.trace.bootstrap.instrumentation.api.AgentSpan -import datadog.trace.common.writer.ListWriter -import datadog.trace.core.CoreTracer -import datadog.trace.core.DDSpan -import datadog.trace.core.test.DDCoreSpecification - -class IterationSpansForkedTest extends DDCoreSpecification { - - ListWriter writer - CoreTracer tracer - ContinuableScopeManager scopeManager - StatsDClient statsDClient - - def setup() { - injectSysConfig("dd.trace.scope.iteration.keep.alive", "1") - - writer = new ListWriter() - statsDClient = Mock() - tracer = tracerBuilder().writer(writer).statsDClient(statsDClient).build() - scopeManager = tracer.scopeManager - } - - def cleanup() { - tracer.close() - } - - def "root iteration scope lifecycle"() { - when: - tracer.closePrevious(true) - def span1 = tracer.buildSpan("next1").start() - def scope1 = tracer.activateNext(span1) - - then: - writer.empty - - and: - scope1.span() == span1 - scopeManager.active() == scope1 - !spanFinished(span1) - - when: - tracer.closePrevious(true) - def span2 = tracer.buildSpan("next2").start() - def scope2 = tracer.activateNext(span2) - - then: - spanFinished(span1) - writer == [[span1]] - - and: - scope2.span() == span2 - scopeManager.active() == scope2 - !spanFinished(span2) - - when: - tracer.closePrevious(true) - def span3 = tracer.buildSpan("next3").start() - def scope3 = tracer.activateNext(span3) - - then: - spanFinished(span2) - writer == [[span1], [span2]] - - and: - scope3.span() == span3 - scopeManager.active() == scope3 - !spanFinished(span3) - - when: - // 'next3' should time out & finish after 1s - writer.waitForTraces(3) - - then: - spanFinished(span3) - writer == [[span1], [span2], [span3]] - - and: - scopeManager.active() == null - } - - def "non-root iteration scope lifecycle"() { - setup: - def span0 = tracer.buildSpan("parent").start() - def scope0 = tracer.activateSpan(span0) - - when: - tracer.closePrevious(true) - def span1 = tracer.buildSpan("next1").start() - def scope1 = tracer.activateNext(span1) - - then: - writer.empty - - and: - scope1.span() == span1 - scopeManager.active() == scope1 - !spanFinished(span1) - - when: - tracer.closePrevious(true) - def span2 = tracer.buildSpan("next2").start() - def scope2 = tracer.activateNext(span2) - - then: - spanFinished(span1) - writer.empty - - and: - scope2.span() == span2 - scopeManager.active() == scope2 - !spanFinished(span2) - - when: - tracer.closePrevious(true) - def span3 = tracer.buildSpan("next3").start() - def scope3 = tracer.activateNext(span3) - - then: - spanFinished(span2) - writer.empty - - and: - scope3.span() == span3 - scopeManager.active() == scope3 - !spanFinished(span3) - - when: - scope0.close() - span0.finish() - // closing the parent scope will close & finish 'next3' - writer.waitForTraces(1) - - then: - spanFinished(span3) - spanFinished(span0) - sortSpansByStart() - writer == [[span0, span1, span2, span3]] - - and: - scopeManager.active() == null - } - - def "nested iteration scope lifecycle"() { - when: - tracer.closePrevious(true) - def span1 = tracer.buildSpan("next").start() - def scope1 = tracer.activateNext(span1) - - then: - writer.empty - - and: - scope1.span() == span1 - scopeManager.active() == scope1 - !spanFinished(span1) - - when: - def span1A = tracer.buildSpan("method").start() - def scope1A = tracer.activateSpan(span1A) - - and: - tracer.closePrevious(true) - def span1A1 = tracer.buildSpan("next").start() - def scope1A1 = tracer.activateNext(span1A1) - - then: - !spanFinished(span1) - writer.empty - - and: - scope1A1.span() == span1A1 - scopeManager.active() == scope1A1 - !spanFinished(span1A1) - - when: - tracer.closePrevious(true) - def span1A2 = tracer.buildSpan("next").start() - def scope1A2 = tracer.activateNext(span1A2) - - then: - spanFinished(span1A1) - writer.empty - - and: - scope1A2.span() == span1A2 - scopeManager.active() == scope1A2 - !spanFinished(span1A2) - - when: - scope1A.close() - span1A.finish() - // closing the intervening scope will close & finish 'next1_2' - - then: - spanFinished(span1A2) - spanFinished(span1A) - !spanFinished(span1) - writer.empty - - when: - // 'next1' should time out & finish after 1s to complete the trace - writer.waitForTraces(1) - - then: - spanFinished(span1) - sortSpansByStart() - writer == [[span1, span1A, span1A1, span1A2]] - - and: - scopeManager.active() == null - } - - boolean spanFinished(AgentSpan span) { - return ((DDSpan) span)?.isFinished() - } - - private List sortSpansByStart() { - writer.firstTrace().sort { a, b -> - return a.startTimeNano <=> b.startTimeNano - } - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/scopemanager/ScopeAndContinuationLayoutTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/scopemanager/ScopeAndContinuationLayoutTest.groovy deleted file mode 100644 index bba8f7d0028..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/scopemanager/ScopeAndContinuationLayoutTest.groovy +++ /dev/null @@ -1,25 +0,0 @@ -package datadog.trace.core.scopemanager - -import datadog.trace.test.util.DDSpecification -import org.openjdk.jol.info.ClassLayout -import spock.lang.Requires - -@Requires({ - !System.getProperty("java.vendor").toUpperCase().contains("IBM") -}) -class ScopeAndContinuationLayoutTest extends DDSpecification { - - def "continuable scope layout"() { - expect: layoutAcceptable(ContinuableScope, 32) - } - - def "single continuation layout"() { - expect: layoutAcceptable(ScopeContinuation, 32) - } - - def layoutAcceptable(Class klass, int acceptableSize) { - def layout = ClassLayout.parseClass(klass) - System.err.println(layout.toPrintable()) - return layout.instanceSize() <= acceptableSize - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/scopemanager/ScopeManagerDepthTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/scopemanager/ScopeManagerDepthTest.groovy deleted file mode 100644 index 4c7a1176ee7..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/scopemanager/ScopeManagerDepthTest.groovy +++ /dev/null @@ -1,130 +0,0 @@ -package datadog.trace.core.scopemanager - -import datadog.trace.api.config.TracerConfig -import datadog.trace.bootstrap.instrumentation.api.AgentScope -import datadog.trace.bootstrap.instrumentation.api.AgentSpan -import datadog.trace.common.writer.ListWriter -import datadog.trace.core.test.DDCoreSpecification - -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopScope -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpan - -class ScopeManagerDepthTest extends DDCoreSpecification { - def "scopemanager returns noop scope if depth exceeded"() { - given: - def tracer = tracerBuilder().writer(new ListWriter()).build() - def scopeManager = tracer.scopeManager - - when: "fill up the scope stack" - AgentScope scope - for (int i = 0; i < depth; i++) { - def testSpan = tracer.buildSpan("test", "test").start() - scope = tracer.activateSpan(testSpan) - assert scope instanceof ContinuableScope - } - - then: "last scope is still valid" - scopeManager.scopeStack().depth() == depth - - when: "activate span over limit" - def span = tracer.buildSpan("test", "test").start() - scope = tracer.activateSpan(span) - - then: "a noop instance is returned" - scope == noopScope() - - when: "activate a noop scope over the limit" - scope = scopeManager.activateManualSpan(noopSpan()) - - then: "still have a noop instance" - scope == noopScope() - - and: "scope stack not effected." - scopeManager.scopeStack().depth() == depth - - cleanup: - scopeManager.scopeStack().clear() - tracer.close() - - where: - depth = 100 // Using ConfigDefaults here causes classloading issues - } - - def "scopemanager ignores depth limit when 0"() { - given: - injectSysConfig(TracerConfig.SCOPE_DEPTH_LIMIT, "0") - def tracer = tracerBuilder().writer(new ListWriter()).build() - def scopeManager = tracer.scopeManager - - when: "fill up the scope stack" - AgentScope scope - for (int i = 0; i < defaultLimit; i++) { - def testSpan = tracer.buildSpan("test", "test").start() - scope = tracer.activateSpan(testSpan) - assert scope instanceof ContinuableScope - } - - then: "last scope is still valid" - scopeManager.scopeStack().depth() == defaultLimit - - when: "activate a scope" - def span = tracer.buildSpan("test", "test").start() - scope = tracer.activateSpan(span) - - then: "a real scope is returned" - scope != noopScope() - scopeManager.scopeStack().depth() == defaultLimit + 1 - - when: "activate a noop span" - scope = scopeManager.activateManualSpan(noopSpan()) - - then: "a real instance is still returned" - scope != noopScope() - - and: "scope stack not effected." - scopeManager.scopeStack().depth() == defaultLimit + 2 - - cleanup: - scopeManager.scopeStack().clear() - tracer.close() - - where: - defaultLimit = 100 // Using ConfigDefaults here causes classloading issues - } - - def "depth is correctly updated with out of order closing"() { - // The decision here is that depth is the top-most open scope - // Closed scopes that are not on top still count for depth - - given: - def tracer = tracerBuilder().writer(new ListWriter()).build() - def scopeManager = tracer.scopeManager - - when: - AgentSpan firstSpan = tracer.buildSpan("test", "foo").start() - AgentScope firstScope = tracer.activateSpan(firstSpan) - - AgentSpan secondSpan = tracer.buildSpan("test", "foo").start() - AgentScope secondScope = tracer.activateSpan(secondSpan) - - then: - scopeManager.scopeStack().depth() == 2 - - when: - firstSpan.finish() - firstScope.close() - - then: - scopeManager.scopeStack().depth() == 2 - - when: - secondSpan.finish() - secondScope.close() - - then: - scopeManager.scopeStack().depth() == 0 - - cleanup: - tracer.close() - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/scopemanager/ScopeManagerTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/scopemanager/ScopeManagerTest.groovy deleted file mode 100644 index be70ceec92c..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/scopemanager/ScopeManagerTest.groovy +++ /dev/null @@ -1,1289 +0,0 @@ -package datadog.trace.core.scopemanager - -import datadog.context.Context -import datadog.context.ContextKey -import datadog.trace.test.util.ThreadUtils -import datadog.trace.api.DDTraceId -import datadog.trace.api.Stateful -import datadog.trace.api.interceptor.MutableSpan -import datadog.trace.api.interceptor.TraceInterceptor -import datadog.trace.api.scopemanager.ExtendedScopeListener -import datadog.trace.bootstrap.instrumentation.api.AgentScope -import datadog.trace.bootstrap.instrumentation.api.AgentSpan -import datadog.trace.bootstrap.instrumentation.api.ProfilingContextIntegration -import datadog.trace.common.writer.ListWriter -import datadog.trace.api.scopemanager.ScopeListener -import datadog.trace.context.TraceScope -import datadog.trace.core.CoreTracer -import datadog.trace.core.DDSpan -import datadog.trace.core.test.DDCoreSpecification -import spock.lang.Shared - -import java.lang.ref.WeakReference -import java.util.concurrent.ExecutorService -import java.util.concurrent.Executors -import java.util.concurrent.Future -import java.util.concurrent.TimeUnit -import java.util.concurrent.atomic.AtomicInteger -import java.util.concurrent.atomic.AtomicReference - -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopContinuation -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpan -import static datadog.trace.core.scopemanager.EVENT.ACTIVATE -import static datadog.trace.core.scopemanager.EVENT.CLOSE -import static datadog.trace.test.util.GCUtils.awaitGC - -enum EVENT { - ACTIVATE, CLOSE -} - -class ScopeManagerTest extends DDCoreSpecification { - @Override - protected boolean useStrictTraceWrites() { - // This tests the behavior of the relaxed pending trace implementation - return false - } - - ListWriter writer - CoreTracer tracer - ContinuableScopeManager scopeManager - EventCountingListener eventCountingListener - EventCountingExtendedListener eventCountingExtendedListener - ProfilingContextIntegration profilingContext - - def setup() { - def state = Stub(Stateful) - profilingContext = Mock(ProfilingContextIntegration, { - newScopeState(_) >> state - name() >> "mock" - }) - writer = new ListWriter() - tracer = tracerBuilder().writer(writer).profilingContextIntegration(profilingContext).build() - scopeManager = tracer.scopeManager - eventCountingListener = new EventCountingListener() - scopeManager.addScopeListener(eventCountingListener) - eventCountingExtendedListener = new EventCountingExtendedListener() - scopeManager.addScopeListener(eventCountingExtendedListener) - } - - def cleanup() { - tracer.close() - } - - def "non-ddspan activation results in a continuable scope"() { - when: - def scope = scopeManager.activateSpan(noopSpan()) - - then: - scopeManager.active() == scope - scope instanceof ContinuableScope - - when: - scope.close() - - then: - scopeManager.active() == null - } - - def "no scope is active before activation"() { - setup: - def builder = tracer.buildSpan("test", "test") - builder.start() - - expect: - scopeManager.active() == null - writer.empty - } - - def "simple scope and span lifecycle"() { - when: - def span = tracer.buildSpan("test", "test").start() - def scope = tracer.activateSpan(span) - - then: - scope.span() == span - !spanFinished(scope.span()) - scopeManager.active() == scope - scope instanceof ContinuableScope - writer.empty - - when: - scope.close() - - then: - !spanFinished(scope.span()) - writer == [] - scopeManager.active() == null - - when: - span.finish() - writer.waitForTraces(1) - - then: - spanFinished(scope.span()) - writer == [[scope.span()]] - scopeManager.active() == null - } - - def "sets parent as current upon close"() { - when: - def parentSpan = tracer.buildSpan("test", "parent").start() - def parentScope = tracer.activateSpan(parentSpan) - def childSpan = tracer.buildSpan("test", "child").start() - def childScope = tracer.activateSpan(childSpan) - - then: - scopeManager.active() == childScope - childScope.span().context().parentId == parentScope.span().context().spanId - childScope.span().context().traceCollector == parentScope.span().context().traceCollector - - when: - childScope.close() - - then: - scopeManager.active() == parentScope - !spanFinished(childScope.span()) - !spanFinished(parentScope.span()) - writer == [] - } - - def "sets parent as current upon close with noop child"() { - when: - def parentSpan = tracer.buildSpan("test", "parent").start() - def parentScope = tracer.activateSpan(parentSpan) - def childSpan = noopSpan() - def childScope = tracer.activateSpan(childSpan) - - then: - scopeManager.active() == childScope - - when: - childScope.close() - - then: - scopeManager.active() == parentScope - !spanFinished(parentScope.span()) - writer == [] - } - - def "DDScope creates no-op continuations when propagation is not set"() { - when: - def span = tracer.buildSpan("test", "test").start() - tracer.activateSpan(span) - tracer.setAsyncPropagationEnabled(false) - def continuation = tracer.captureActiveSpan() - - then: - continuation == noopContinuation() - - when: - tracer.setAsyncPropagationEnabled(true) - continuation = tracer.captureActiveSpan() - - then: - continuation != noopContinuation() && continuation != null - - cleanup: - continuation.cancel() - } - - def "Continuation.cancel doesn't close parent scope"() { - when: - def span = tracer.buildSpan("test", "test").start() - def scope = tracer.activateSpan(span) - def continuation = tracer.captureActiveSpan() - - then: - continuation != null - - when: - continuation.cancel() - - then: - scopeManager.active() == scope - } - - // @Flaky("awaitGC is flaky") - def "test continuation doesn't have hard reference on scope"() { - when: - def span = tracer.buildSpan("test", "test").start() - def scopeRef = new AtomicReference(tracer.activateSpan(span)) - def continuation = tracer.captureActiveSpan() - - then: - continuation != null - - when: - scopeRef.get().close() - - then: - scopeManager.active() == null - - when: - def ref = new WeakReference(scopeRef.get()) - scopeRef.set(null) - awaitGC(ref) - - then: - continuation != null - ref.get() == null - !spanFinished(span) - writer == [] - } - - def "hard reference on continuation does not prevent trace from reporting"() { - when: - def span = tracer.buildSpan("test", "test").start() - def scope = tracer.activateSpan(span) - def continuation = tracer.captureActiveSpan() - - then: - continuation != null - - when: - scope.close() - span.finish() - if (autoClose) { - continuation.cancel() - } - - then: - scopeManager.active() == null - spanFinished(span) - - when: - writer.waitForTraces(1) - - then: - writer == [[span]] - - where: - autoClose << [true, false] - } - - def "continuation restores trace"() { - when: - def parentSpan = tracer.buildSpan("test", "parent").start() - def parentScope = tracer.activateSpan(parentSpan) - def childSpan = tracer.buildSpan("test", "child").start() - def childScope = tracer.activateSpan(childSpan) - - def continuation = tracer.captureActiveSpan() - childScope.close() - - then: - continuation != null - scopeManager.active() == parentScope - !spanFinished(childSpan) - !spanFinished(parentSpan) - - when: - parentScope.close() - parentSpan.finish() - - then: "parent span is finished, but trace is not reported" - scopeManager.active() == null - !spanFinished(childSpan) - spanFinished(parentSpan) - writer == [] - - when: "activating the continuation" - def newScope = continuation.activate() - - then: "the continued scope becomes active and span state doesnt change" - newScope instanceof ContinuableScope - tracer.isAsyncPropagationEnabled() - scopeManager.active() == newScope - newScope != childScope - newScope != parentScope - newScope.span() == childSpan - !spanFinished(childSpan) - spanFinished(parentSpan) - writer == [] - - when: "creating and activating a second continuation" - def newContinuation = tracer.captureActiveSpan() - newScope.close() - def secondContinuedScope = newContinuation.activate() - secondContinuedScope.close() - childSpan.finish() - writer.waitForTraces(1) - - then: "spans are all finished and trace is reported" - scopeManager.active() == null - spanFinished(childSpan) - spanFinished(parentSpan) - writer == [[childSpan, parentSpan]] - } - - def "continuation allows adding spans even after other spans were completed"() { - when: "creating and activating a continuation" - def span = tracer.buildSpan("test", "test").start() - def scope = tracer.activateSpan(span) - def continuation = tracer.captureActiveSpan() - scope.close() - span.finish() - - def newScope = continuation.activate() - - then: "the continuation sets the active scope" - newScope instanceof ContinuableScope - newScope != scope - scopeManager.active() == newScope - spanFinished(span) - writer == [] - - when: "creating a new child span under a continued scope" - def childSpan = tracer.buildSpan("test", "child").start() - def childScope = tracer.activateSpan(childSpan) - childScope.close() - childSpan.finish() - - then: - scopeManager.active() == newScope - - when: - scopeManager.active().close() - writer.waitForTraces(1) - - then: "the child has the correct parent" - scopeManager.active() == null - spanFinished(childSpan) - childSpan.context().parentId == span.context().spanId - writer == [[childSpan, span]] - } - - def "test activating same span multiple times"() { - setup: - def span = tracer.buildSpan("test", "test").start() - def state = Mock(Stateful) - - when: - AgentScope scope1 = scopeManager.activateSpan(span) - - then: - assertEvents([ACTIVATE]) - 1 * profilingContext.newScopeState(_) >> state - - when: - AgentScope scope2 = scopeManager.activateSpan(span) - - then: 'Activating the same span multiple times does not create a new scope' - assertEvents([ACTIVATE]) - 0 * profilingContext.newScopeState(_) - - when: - scope2.close() - - then: 'Closing a scope once that has been activated multiple times does not close' - assertEvents([ACTIVATE]) - 0 * state.close() - - when: - scope1.close() - - then: - assertEvents([ACTIVATE, CLOSE]) - 1 * state.close() - } - - def "opening and closing multiple scopes"() { - when: - AgentSpan span = tracer.buildSpan("test", "foo").start() - AgentScope continuableScope = tracer.activateSpan(span) - - then: - continuableScope instanceof ContinuableScope - assertEvents([ACTIVATE]) - - when: - AgentSpan childSpan = tracer.buildSpan("test", "foo").start() - AgentScope childDDScope = tracer.activateSpan(childSpan) - - then: - childDDScope instanceof ContinuableScope - assertEvents([ACTIVATE, ACTIVATE]) - - when: - childDDScope.close() - childSpan.finish() - - then: - assertEvents([ACTIVATE, ACTIVATE, CLOSE, ACTIVATE]) - - when: - continuableScope.close() - span.finish() - - then: - assertEvents([ACTIVATE, ACTIVATE, CLOSE, ACTIVATE, CLOSE]) - } - - def "closing scope out of order - simple"() { - when: - AgentSpan firstSpan = tracer.buildSpan("test", "foo").start() - AgentScope firstScope = tracer.activateSpan(firstSpan) - - AgentSpan secondSpan = tracer.buildSpan("test", "bar").start() - AgentScope secondScope = tracer.activateSpan(secondSpan) - - firstSpan.finish() - firstScope.close() - - then: - assertEvents([ACTIVATE, ACTIVATE]) - 1 * profilingContext.onRootSpanStarted(_) - 1 * profilingContext.onAttach() - 1 * profilingContext.encodeOperationName("foo") - 1 * profilingContext.encodeOperationName("bar") - 2 * profilingContext.newScopeState(_) >> Stub(Stateful) - 0 * _ - - when: - secondSpan.finish() - secondScope.close() - - then: - 1 * profilingContext.onRootSpanFinished(_, _) - 1 * profilingContext.onDetach() - assertEvents([ACTIVATE, ACTIVATE, CLOSE, CLOSE]) - 0 * _ - - when: - firstScope.close() - - then: - assertEvents([ACTIVATE, ACTIVATE, CLOSE, CLOSE]) - } - - def "closing scope out of order - complex"() { - // Events are checked twice in each case to ensure a call to - // scopeManager.active() or tracer.activeSpan() doesn't change the count - - when: - AgentSpan firstSpan = tracer.buildSpan("test", "foo").start() - AgentScope firstScope = tracer.activateSpan(firstSpan) - - then: - assertEvents([ACTIVATE]) - tracer.activeSpan() == firstSpan - scopeManager.active() == firstScope - assertEvents([ACTIVATE]) - 1 * profilingContext.onRootSpanStarted(_) - 1 * profilingContext.onAttach() - 1 * profilingContext.encodeOperationName("foo") - 1 * profilingContext.newScopeState(_) >> Stub(Stateful) - 0 * _ - - when: - AgentSpan secondSpan = tracer.buildSpan("test", "bar").start() - AgentScope secondScope = tracer.activateSpan(secondSpan) - - then: - assertEvents([ACTIVATE, ACTIVATE]) - tracer.activeSpan() == secondSpan - scopeManager.active() == secondScope - assertEvents([ACTIVATE, ACTIVATE]) - 1 * profilingContext.encodeOperationName("bar") - 1 * profilingContext.newScopeState(_) >> Stub(Stateful) - 0 * _ - - when: - AgentSpan thirdSpan = tracer.buildSpan("test", "quux").start() - AgentScope thirdScope = tracer.activateSpan(thirdSpan) - - then: - assertEvents([ACTIVATE, ACTIVATE, ACTIVATE]) - tracer.activeSpan() == thirdSpan - scopeManager.active() == thirdScope - assertEvents([ACTIVATE, ACTIVATE, ACTIVATE]) - 1 * profilingContext.encodeOperationName("quux") - 1 * profilingContext.newScopeState(_) >> Stub(Stateful) - 0 * _ - - when: - secondScope.close() - - then: - assertEvents([ACTIVATE, ACTIVATE, ACTIVATE]) - tracer.activeSpan() == thirdSpan - scopeManager.active() == thirdScope - assertEvents([ACTIVATE, ACTIVATE, ACTIVATE]) - 0 * _ - - when: - thirdScope.close() - - then: - assertEvents([ACTIVATE, ACTIVATE, ACTIVATE, CLOSE, CLOSE, ACTIVATE]) - tracer.activeSpan() == firstSpan - scopeManager.active() == firstScope - - assertEvents([ACTIVATE, ACTIVATE, ACTIVATE, CLOSE, CLOSE, ACTIVATE]) - 0 * _ - - when: - firstScope.close() - - then: - assertEvents([ - ACTIVATE, - ACTIVATE, - ACTIVATE, - CLOSE, - CLOSE, - ACTIVATE, - CLOSE - ]) - scopeManager.active() == null - assertEvents([ - ACTIVATE, - ACTIVATE, - ACTIVATE, - CLOSE, - CLOSE, - ACTIVATE, - CLOSE - ]) - 1 * profilingContext.onDetach() - 0 * _ - } - - def "closing scope out of order - multiple activations"() { - setup: - def span = tracer.buildSpan("test", "test").start() - - when: - AgentScope scope1 = scopeManager.activateSpan(span) - - then: - assertEvents([ACTIVATE]) - - when: - AgentScope scope2 = scopeManager.activateSpan(span) - - then: 'Activating the same span multiple times does not create a new scope' - assertEvents([ACTIVATE]) - - when: - AgentSpan thirdSpan = tracer.buildSpan("test", "quux").start() - AgentScope thirdScope = tracer.activateSpan(thirdSpan) - 0 * _ - - then: - assertEvents([ACTIVATE, ACTIVATE]) - tracer.activeSpan() == thirdSpan - scopeManager.active() == thirdScope - assertEvents([ACTIVATE, ACTIVATE]) - 1 * profilingContext.encodeOperationName("quux") - 1 * profilingContext.newScopeState(_) >> Stub(Stateful) - 0 * _ - - when: - scope2.close() - - then: 'Closing a scope once that has been activated multiple times does not close' - assertEvents([ACTIVATE, ACTIVATE]) - 0 * _ - - when: - thirdScope.close() - thirdSpan.finish() - - then: 'Closing scope above multiple activated scope does not close it' - assertEvents([ACTIVATE, ACTIVATE, CLOSE, ACTIVATE]) - 0 * _ - - when: - scope1.close() - - then: - assertEvents([ACTIVATE, ACTIVATE, CLOSE, ACTIVATE, CLOSE]) - } - - def "Closing a continued scope out of order cancels the continuation"() { - when: - def span = tracer.buildSpan("test", "test").start() - def scope = tracer.activateSpan(span) - def continuation = tracer.captureActiveSpan() - scope.close() - span.finish() - - then: - scopeManager.active() == null - spanFinished(span) - writer == [] - - when: - def continuedScope = continuation.activate() - - AgentSpan secondSpan = tracer.buildSpan("test", "test2").start() - AgentScope secondScope = (ContinuableScope) tracer.activateSpan(secondSpan) - - then: - scopeManager.active() == secondScope - - when: - continuedScope.close() - - then: - scopeManager.active() == secondScope - writer == [] - - when: - secondScope.close() - secondSpan.finish() - writer.waitForTraces(1) - - then: - writer == [[secondSpan, span]] - } - - def "exception thrown in TraceInterceptor does not leave scope manager in bad state "() { - setup: - def interceptor = new ExceptionThrowingInterceptor() - tracer.addTraceInterceptor(interceptor) - - when: - def span = tracer.buildSpan("test", "test").start() - def scope = tracer.activateSpan(span) - scope.close() - span.finish() - - then: "exception is thrown in same thread" - interceptor.lastTrace == [span] - - and: "scopeManager in good state" - scopeManager.active() == null - spanFinished(span) - scopeManager.scopeStack().depth() == 0 - writer == [[span]] - - when: "completing another scope lifecycle" - def span2 = tracer.buildSpan("test", "test").start() - def scope2 = tracer.activateSpan(span2) - - then: - scopeManager.active() == scope2 - - when: - interceptor.shouldThrowException = false - scope2.close() - span2.finish() - writer.waitForTraces(1) - - then: "second lifecycle gets reported" - scopeManager.active() == null - spanFinished(span2) - scopeManager.scopeStack().depth() == 0 - writer == [[span], [span2]] - } - - def "exception thrown in TraceInterceptor does not leave scope manager in bad state when reporting through PendingTraceBuffer"() { - setup: - def interceptor = new ExceptionThrowingInterceptor() - tracer.addTraceInterceptor(interceptor) - - when: - def span = tracer.buildSpan("test", "test").start() - def scope = tracer.activateSpan(span) - def continuation = tracer.captureActiveSpan() - scope.close() - span.finish() - - then: - continuation != null - scopeManager.active() == null - spanFinished(span) - scopeManager.scopeStack().depth() == 0 - writer == [] - - when: "wait for root span to be reported from PendingTraceBuffer" - writer.waitForTraces(1) - - then: - interceptor.lastTrace == [span] - - and: "scopeManager in good state" - scopeManager.active() == null - spanFinished(span) - scopeManager.scopeStack().depth() == 0 - writer == [[span]] - - when: "completing another async scope lifecycle" - def span2 = tracer.buildSpan("test", "test").start() - def scope2 = tracer.activateSpan(span2) - def continuation2 = tracer.captureActiveSpan() - - then: - continuation2 != null - scopeManager.active() == scope2 - - when: - interceptor.shouldThrowException = false - scope2.close() - span2.finish() - - writer.waitForTraces(2) - - then: "second lifecycle gets reported as well" - scopeManager.active() == null - spanFinished(span2) - scopeManager.scopeStack().depth() == 0 - writer == [[span], [span2]] - } - - @Shared - TraceScope.Continuation continuation = null - - @Shared - AtomicInteger iteration = new AtomicInteger(0) - - def "continuation can be activated and closed in multiple threads"() { - setup: - long sendDelayNanos = TimeUnit.MILLISECONDS.toNanos(500 - 100) - - when: - def span = tracer.buildSpan("test", "test").start() - def start = System.nanoTime() - def scope = (ContinuableScope) tracer.activateSpan(span) - continuation = tracer.captureActiveSpan() - scope.close() - span.finish() - - continuation.hold() - - then: - ThreadUtils.runConcurrently(8, 512) { - int iter = iteration.incrementAndGet() - if (iter & 1) { - Thread.sleep(1) - } - TraceScope s = continuation.activate() - assert scopeManager.active() == s - if (iter & 2) { - Thread.sleep(1) - } - s.close() - } - - when: - def written = writer - def duration = System.nanoTime() - start - - then: - // Since we can't rely on that nothing gets written to the tracer for verification, - // we only check for empty if we are faster than the flush interval - if (duration < sendDelayNanos) { - assert written == [] - } - - when: - continuation.cancel() - - then: - writer == [[span]] - } - - def "scope listener should be notified about the currently active scope"() { - setup: - def span = tracer.buildSpan("test", "test").start() - - when: - AgentScope scope = scopeManager.activateSpan(span) - - then: - assertEvents([ACTIVATE]) - - when: - def listener = new EventCountingListener() - - then: - listener.events == [] - - when: - scopeManager.addScopeListener(listener) - - then: - listener.events == [ACTIVATE] - - when: - scope.close() - - then: - assertEvents([ACTIVATE, CLOSE]) - listener.events == [ACTIVATE, CLOSE] - } - - def "extended scope listener should be notified about the currently active scope"() { - setup: - def span = tracer.buildSpan("test", "test").start() - - when: - AgentScope scope = scopeManager.activateSpan(span) - - then: - assertEvents([ACTIVATE]) - - when: - def listener = new EventCountingExtendedListener() - - then: - listener.events == [] - - when: - scopeManager.addScopeListener(listener) - - then: - listener.events == [ACTIVATE] - - when: - scope.close() - - then: - assertEvents([ACTIVATE, CLOSE]) - listener.events == [ACTIVATE, CLOSE] - } - - def "scope listener should not be notified when there is no active scope"() { - when: - def listener = new EventCountingListener() - - then: - listener.events == [] - - when: - scopeManager.addScopeListener(listener) - - then: - listener.events == [] - } - - def "misbehaving ScopeListener should not affect others"() { - setup: - def exceptionThrowingScopeLister = new ExceptionThrowingScopeListener() - exceptionThrowingScopeLister.throwOnScopeActivated = activationException - exceptionThrowingScopeLister.throwOnScopeClosed = closeException - - def secondEventCountingListener = new EventCountingListener() - scopeManager.addScopeListener(exceptionThrowingScopeLister) - scopeManager.addScopeListener(secondEventCountingListener) - - when: - AgentSpan span = tracer.buildSpan("test", "foo").start() - AgentScope continuableScope = tracer.activateSpan(span) - - then: - assertEvents([ACTIVATE]) - secondEventCountingListener.events == [ACTIVATE] - - when: - AgentSpan childSpan = tracer.buildSpan("test", "foo").start() - AgentScope childDDScope = tracer.activateSpan(childSpan) - - then: - assertEvents([ACTIVATE, ACTIVATE]) - secondEventCountingListener.events == [ACTIVATE, ACTIVATE] - - when: - childDDScope.close() - childSpan.finish() - - then: - assertEvents([ACTIVATE, ACTIVATE, CLOSE, ACTIVATE]) - secondEventCountingListener.events == [ACTIVATE, ACTIVATE, CLOSE, ACTIVATE] - - when: - continuableScope.close() - span.finish() - - then: - assertEvents([ACTIVATE, ACTIVATE, CLOSE, ACTIVATE, CLOSE]) - secondEventCountingListener.events == [ACTIVATE, ACTIVATE, CLOSE, ACTIVATE, CLOSE] - - where: - activationException | closeException - false | false - false | true - true | false - true | true - } - - def "context thread listener notified when scope activated on thread for the first time"() { - setup: - def numThreads = 5 - def numTasks = 20 - ExecutorService executor = Executors.newFixedThreadPool(numThreads) - - when: "usage of an instrumented executor results in scopestack initialisation but not scope creation" - executor.submit({ - assert scopeManager.active() == null - }).get() - then: "the listener is not notified" - 0 * profilingContext.onAttach() - - when: "scopes activate on threads" - AgentSpan span = tracer.buildSpan("test", "foo").start() - def futures = new Future[numTasks] - for (int i = 0; i < numTasks; i++) { - futures[i] = executor.submit({ - AgentScope scope = tracer.activateSpan(span) - def child = tracer.buildSpan("test", "foo" + i).start() - def childScope = tracer.activateSpan(child) - try { - Thread.sleep(100) - } catch (InterruptedException ignored) { - Thread.currentThread().interrupt() - } - childScope.close() - scope.close() - }) - } - for (Future future : futures) { - future.get() - } - - then: "the activation notifies the listener whenever the stack becomes non-empty" - numTasks * profilingContext.onAttach() - - cleanup: - executor.shutdown() - } - - def "activating a span merges it with existing context"() { - when: - def span = tracer.buildSpan("test", "test").start() - def testKey = ContextKey.named("test") - def context = Context.root().with(testKey, "test-value") - def contextScope = scopeManager.attach(context) - - then: - scopeManager.active() == contextScope - scopeManager.current() == context - scopeManager.activeSpan() == null - scopeManager.current().get(testKey) == "test-value" - - when: - def scope = tracer.activateSpan(span) - - then: - scopeManager.active() == scope - scopeManager.current() != context - scopeManager.activeSpan() == span - scopeManager.current().get(testKey) == "test-value" - - when: - scope.close() - - then: - scopeManager.active() == contextScope - scopeManager.current() == context - scopeManager.activeSpan() == null - scopeManager.current().get(testKey) == "test-value" - - when: - contextScope.close() - - then: - scopeManager.active() == null - scopeManager.current() == Context.root() - scopeManager.activeSpan() == null - } - - def "capturing and continuing a span merges it with existing context"() { - when: - def span = tracer.buildSpan("test", "test").start() - def testKey = ContextKey.named("test") - def context = Context.root().with(testKey, "test-value") - def contextScope = scopeManager.attach(context) - - then: - scopeManager.active() == contextScope - scopeManager.current() == context - scopeManager.activeSpan() == null - scopeManager.current().get(testKey) == "test-value" - - when: - def scope = tracer.captureSpan(span).activate() - - then: - scopeManager.active() == scope - scopeManager.current() != context - scopeManager.activeSpan() == span - scopeManager.current().get(testKey) == "test-value" - - when: - scope.close() - - then: - scopeManager.active() == contextScope - scopeManager.current() == context - scopeManager.activeSpan() == null - scopeManager.current().get(testKey) == "test-value" - - when: - contextScope.close() - - then: - scopeManager.active() == null - scopeManager.current() == Context.root() - scopeManager.activeSpan() == null - } - - def "capturing and continuing the active span merges it with existing context"() { - when: - def span = tracer.buildSpan("test", "test").start() - def testKey = ContextKey.named("test") - def context = Context.root().with(testKey, "test-value") - def contextScope = scopeManager.attach(context) - - then: - scopeManager.active() == contextScope - scopeManager.current() == context - scopeManager.activeSpan() == null - scopeManager.current().get(testKey) == "test-value" - - when: - def scope = tracer.activateSpan(span).withCloseable { - tracer.captureActiveSpan().activate() - } - - then: - scopeManager.active() == scope - scopeManager.current() != context - scopeManager.activeSpan() == span - scopeManager.current().get(testKey) == "test-value" - - when: - scope.close() - - then: - scopeManager.active() == contextScope - scopeManager.current() == context - scopeManager.activeSpan() == null - scopeManager.current().get(testKey) == "test-value" - - when: - contextScope.close() - - then: - scopeManager.active() == null - scopeManager.current() == Context.root() - scopeManager.activeSpan() == null - } - - def "rollback stops at most recent checkpoint"() { - when: - def span1 = tracer.buildSpan("test1", "test1").start() - def span2 = tracer.buildSpan("test2", "test2").start() - def span3 = tracer.buildSpan("test3", "test3").start() - then: - scopeManager.activeSpan() == null - - when: - tracer.checkpointActiveForRollback() - tracer.activateSpan(span1) - tracer.checkpointActiveForRollback() - tracer.activateSpan(span2) - tracer.checkpointActiveForRollback() - tracer.activateSpan(span1) - tracer.checkpointActiveForRollback() - tracer.activateSpan(span2) - tracer.checkpointActiveForRollback() - tracer.activateSpan(span2) - tracer.checkpointActiveForRollback() - tracer.activateSpan(span1) - tracer.activateSpan(span2) - tracer.activateSpan(span3) - then: - scopeManager.activeSpan() == span3 - - when: - tracer.rollbackActiveToCheckpoint() - then: - scopeManager.activeSpan() == span2 - - when: - tracer.rollbackActiveToCheckpoint() - then: - scopeManager.activeSpan() == span2 - - when: - tracer.rollbackActiveToCheckpoint() - then: - scopeManager.activeSpan() == span1 - - when: - tracer.rollbackActiveToCheckpoint() - then: - scopeManager.activeSpan() == span2 - - when: - tracer.rollbackActiveToCheckpoint() - then: - scopeManager.activeSpan() == span1 - - when: - tracer.rollbackActiveToCheckpoint() - then: - scopeManager.activeSpan() == null - } - - def "contexts can be swapped out and back"() { - setup: - def testKey = ContextKey.named("test") - def context1 = Context.root().with(testKey, "first-value") - def context2 = context1.with(testKey, "second-value") - - when: - def swappedOut = scopeManager.swap(Context.root()) - - then: - scopeManager.active() == null - scopeManager.current() == Context.root() - - when: - scopeManager.swap(context1) - - then: - scopeManager.active() != null - scopeManager.current() == context1 - - when: - scopeManager.swap(swappedOut) - - then: - scopeManager.active() == null - scopeManager.current() == Context.root() - - when: - def contextScope = scopeManager.attach(context1) - - then: - scopeManager.active() == contextScope - scopeManager.current() == context1 - - when: - swappedOut = scopeManager.swap(context2) - - then: - scopeManager.active() != null - scopeManager.active() != contextScope - scopeManager.current() == context2 - swappedOut.get(testKey) == "first-value" - - when: - def context3 = swappedOut.with(testKey, "third-value") - scopeManager.swap(context3) - - then: - scopeManager.active() != null - scopeManager.active() != contextScope - scopeManager.current() == context3 - - when: - scopeManager.swap(swappedOut) - - then: - scopeManager.active() == contextScope - scopeManager.current() == context1 - - when: - contextScope.close() - - then: - scopeManager.active() == null - scopeManager.current() == Context.root() - } - - boolean spanFinished(AgentSpan span) { - return ((DDSpan) span)?.isFinished() - } - - def assertEvents(List events) { - assert eventCountingListener.events == events - assert eventCountingExtendedListener.events == events - return true - } -} - -class EventCountingListener implements ScopeListener { - public final List events = new ArrayList<>() - - @Override - void afterScopeActivated() { - synchronized (events) { - events.add(ACTIVATE) - } - } - - @Override - void afterScopeClosed() { - synchronized (events) { - events.add(CLOSE) - } - } -} - -class EventCountingExtendedListener implements ExtendedScopeListener { - public final List events = new ArrayList<>() - - @Override - void afterScopeActivated() { - throw new IllegalArgumentException("This should not be called") - } - - @Override - void afterScopeActivated(DDTraceId traceId, long spanId) { - synchronized (events) { - events.add(ACTIVATE) - } - } - - @Override - void afterScopeClosed() { - synchronized (events) { - events.add(CLOSE) - } - } -} - -class ExceptionThrowingScopeListener implements ScopeListener { - boolean throwOnScopeActivated = false - boolean throwOnScopeClosed = false - - @Override - void afterScopeActivated() { - if (throwOnScopeActivated) { - throw new RuntimeException("Exception on activated") - } - } - - @Override - void afterScopeClosed() { - if (throwOnScopeClosed) { - throw new RuntimeException("Exception on closed") - } - } -} - -class ExceptionThrowingInterceptor implements TraceInterceptor { - def shouldThrowException = true - - Collection lastTrace - - @Override - Collection onTraceComplete(Collection trace) { - lastTrace = trace - if (shouldThrowException) { - throw new RuntimeException("Always throws exception") - } else { - return trace - } - } - - @Override - int priority() { - return 55 - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/servicediscovery/ServiceDiscoveryTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/servicediscovery/ServiceDiscoveryTest.groovy deleted file mode 100644 index 3e8386867b2..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/servicediscovery/ServiceDiscoveryTest.groovy +++ /dev/null @@ -1,56 +0,0 @@ -package datadog.trace.core.servicediscovery - -import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString -import datadog.trace.core.test.DDCoreSpecification -import spock.lang.Timeout -import org.msgpack.core.MessagePack -import org.msgpack.value.MapValue - - -@Timeout(10) -class ServiceDiscoveryTest extends DDCoreSpecification { - def "encodePayload with all optional fields"() { - given: - String tracerVersion = "1.2.3" - String hostname = "test-host" - String runtimeID = "rid-123" - String service = "orders" - String env = "prod" - String serviceVersion = "1.1.1" - UTF8BytesString processTags = UTF8BytesString.create("key1:val1,key2:val2") - String containerID = "containerID" - boolean appLogsCollectionEnabled = true - - when: - byte[] out = ServiceDiscovery.encodePayload(tracerVersion, hostname, appLogsCollectionEnabled, runtimeID, service, env, serviceVersion, processTags, containerID) - MapValue map = MessagePack.newDefaultUnpacker(out).unpackValue().asMapValue() - - then: - map.size() == 11 - and: - map.toString() == '{"schema_version":2,"tracer_language":"java","tracer_version":"1.2.3","hostname":"test-host","logs_collected":true,"runtime_id":"rid-123","service_name":"orders","service_env":"prod","service_version":"1.1.1","process_tags":"key1:val1,key2:val2","container_id":"containerID"}' - } - - def "encodePayload only required fields"() { - given: - String tracerVersion = "1.2.3" - String hostname = "my_host" - - when: - byte[] out = ServiceDiscovery.encodePayload(tracerVersion, hostname, false, null, null, null, null, null, null) - MapValue map = MessagePack.newDefaultUnpacker(out).unpackValue().asMapValue() - - then: - map.size() == 5 - and: - map.toString() == '{"schema_version":2,"tracer_language":"java","tracer_version":"1.2.3","hostname":"my_host","logs_collected":false}' - } - def "generateFileName"() { - when: - String name = ServiceDiscovery.generateFileName() - - then: - name.startsWith("datadog-tracer-info-") - name.length() == "datadog-tracer-info-".length() + 8 - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/taginterceptor/TagInterceptorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/taginterceptor/TagInterceptorTest.groovy deleted file mode 100644 index 0bb65ac4919..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/taginterceptor/TagInterceptorTest.groovy +++ /dev/null @@ -1,755 +0,0 @@ -package datadog.trace.core.taginterceptor - -import static datadog.trace.api.ConfigDefaults.DEFAULT_SERVICE_NAME -import static datadog.trace.api.ConfigDefaults.DEFAULT_SERVLET_ROOT_CONTEXT_SERVICE_NAME -import static datadog.trace.api.DDTags.ANALYTICS_SAMPLE_RATE -import datadog.trace.api.ProductTraceSource -import static datadog.trace.api.config.TracerConfig.SPLIT_BY_TAGS - -import datadog.trace.api.DDSpanTypes -import datadog.trace.api.DDTags -import datadog.trace.api.config.GeneralConfig -import datadog.trace.api.env.CapturedEnvironment -import datadog.trace.api.remoteconfig.ServiceNameCollector -import datadog.trace.api.sampling.PrioritySampling -import datadog.trace.bootstrap.instrumentation.api.AgentSpan -import datadog.trace.bootstrap.instrumentation.api.InstrumentationTags -import datadog.trace.bootstrap.instrumentation.api.Tags -import datadog.trace.common.sampling.AllSampler -import datadog.trace.common.writer.ListWriter -import datadog.trace.common.writer.LoggingWriter -import datadog.trace.core.CoreSpan -import datadog.trace.core.DDSpanContext -import datadog.trace.core.test.DDCoreSpecification - -class TagInterceptorTest extends DDCoreSpecification { - def setup() { - injectSysConfig(SPLIT_BY_TAGS, "sn.tag1,sn.tag2") - } - - def "set service name"() { - setup: - injectSysConfig("dd.trace.PeerServiceTagInterceptor.enabled", "true") - def tracer = tracerBuilder() - .serviceName("wrong-service") - .writer(new LoggingWriter()) - .sampler(new AllSampler()) - .serviceNameMappings(mapping) - .build() - - when: - def span = tracer.buildSpan("some span").withTag(tag, name).start() - span.finish() - - then: - span.getServiceName() == expected - - cleanup: - tracer.close() - - where: - tag | name | expected - DDTags.SERVICE_NAME | "some-service" | "new-service" - DDTags.SERVICE_NAME | "other-service" | "other-service" - "service" | "some-service" | "new-service" - "service" | "other-service" | "other-service" - Tags.PEER_SERVICE | "some-service" | "new-service" - Tags.PEER_SERVICE | "other-service" | "other-service" - "sn.tag1" | "some-service" | "new-service" - "sn.tag1" | "other-service" | "other-service" - "sn.tag2" | "some-service" | "new-service" - "sn.tag2" | "other-service" | "other-service" - - mapping = ["some-service": "new-service"] - } - - def "default or configured service name can be remapped without setting tag"() { - setup: - def tracer = tracerBuilder() - .serviceName(serviceName) - .writer(new LoggingWriter()) - .sampler(new AllSampler()) - .serviceNameMappings(mapping) - .build() - - when: - def span = tracer.buildSpan("some span").start() - span.finish() - - then: - span.serviceName == expected - - cleanup: - tracer.close() - - where: - serviceName | expected | mapping - DEFAULT_SERVICE_NAME | DEFAULT_SERVICE_NAME | ["other-service-name": "other-service"] - DEFAULT_SERVICE_NAME | "new-service" | [(DEFAULT_SERVICE_NAME): "new-service"] - "other-service-name" | "other-service" | ["other-service-name": "other-service"] - } - - def "set service name from servlet.context with context '#context'"() { - when: - def tracer = tracerBuilder().writer(new ListWriter()).build() - def span = tracer.buildSpan("test").start() - span.setTag(DDTags.SERVICE_NAME, serviceName) - span.setTag("servlet.context", context) - - then: - span.serviceName == expected - - cleanup: - tracer.close() - - where: - context | serviceName | expected - "/" | DEFAULT_SERVLET_ROOT_CONTEXT_SERVICE_NAME | DEFAULT_SERVLET_ROOT_CONTEXT_SERVICE_NAME - "" | DEFAULT_SERVICE_NAME | DEFAULT_SERVICE_NAME - "/some-context" | DEFAULT_SERVICE_NAME | "some-context" - "other-context" | DEFAULT_SERVICE_NAME | "other-context" - "/" | "my-service" | "my-service" - "" | "my-service" | "my-service" - "/some-context" | "my-service" | "my-service" - "other-context" | "my-service" | "my-service" - } - - def "setting service name as a property disables servlet.context with context '#context'"() { - when: - injectSysConfig("service", serviceName) - def tracer = tracerBuilder().writer(new ListWriter()).build() - def span = tracer.buildSpan("test").start() - span.setTag("servlet.context", context) - - then: - span.serviceName == serviceName - - cleanup: - tracer.close() - - where: - context | serviceName - "/" | DEFAULT_SERVICE_NAME - "" | DEFAULT_SERVICE_NAME - "/some-context" | DEFAULT_SERVICE_NAME - "other-context" | DEFAULT_SERVICE_NAME - "/" | CapturedEnvironment.get().getProperties().get(GeneralConfig.SERVICE_NAME) - "" | CapturedEnvironment.get().getProperties().get(GeneralConfig.SERVICE_NAME) - "/some-context" | CapturedEnvironment.get().getProperties().get(GeneralConfig.SERVICE_NAME) - "other-context" | CapturedEnvironment.get().getProperties().get(GeneralConfig.SERVICE_NAME) - "/" | "my-service" - "" | "my-service" - "/some-context" | "my-service" - "other-context" | "my-service" - } - - def "mapping causes servlet.context to not change service name"() { - setup: - def tracer = tracerBuilder() - .serviceName(serviceName) - .writer(new LoggingWriter()) - .sampler(new AllSampler()) - .serviceNameMappings(mapping) - .build() - - when: - def span = tracer.buildSpan("some span").start() - span.setTag("servlet.context", context) - span.finish() - - then: - span.serviceName == "new-service" - - cleanup: - tracer.close() - - where: - context | serviceName - "/some-context" | DEFAULT_SERVICE_NAME - "/some-context" | "my-service" - - mapping = [(serviceName): "new-service"] - } - - def createSplittingTracer(tag) { - return tracerBuilder() - .serviceName("my-service") - .writer(new LoggingWriter()) - .sampler(new AllSampler()) - // equivalent to split-by-tags: tag - .tagInterceptor(new TagInterceptor(true, "my-service", - Collections.singleton(tag), new RuleFlags(), false)) - .build() - } - - def "split-by-tags for servlet.context and experimental jee split by deployment is #jeeActive"() { - setup: - def tracer = tracerBuilder() - .serviceName("my-service") - .writer(new LoggingWriter()) - .sampler(new AllSampler()) - .tagInterceptor(new TagInterceptor(false, "my-service", - Collections.emptySet(), new RuleFlags(), jeeActive)) - .build() - when: - def span = tracer.buildSpan("some span").start() - span.setTag(InstrumentationTags.SERVLET_CONTEXT, "some-context") - span.finish() - - then: - span.serviceName == expected - - cleanup: - tracer.close() - - where: - expected | jeeActive - "some-context" | false - "my-service" | true - } - - def "peer.service then split-by-tags via builder"() { - setup: - def tracer = createSplittingTracer(Tags.MESSAGE_BUS_DESTINATION) - - when: - def span = tracer.buildSpan("some span") - .withTag(Tags.PEER_SERVICE, "peer-service") - .withTag(Tags.MESSAGE_BUS_DESTINATION, "some-queue") - .start() - span.finish() - - then: - span.serviceName == "some-queue" - - cleanup: - tracer.close() - } - - def "peer.service then split-by-tags via setTag"() { - setup: - def tracer = createSplittingTracer(Tags.MESSAGE_BUS_DESTINATION) - - when: - def span = tracer.buildSpan("some span").start() - span.setTag(Tags.PEER_SERVICE, "peer-service") - span.setTag(Tags.MESSAGE_BUS_DESTINATION, "some-queue") - span.finish() - - then: - span.serviceName == "some-queue" - - cleanup: - tracer.close() - } - - def "split-by-tags then peer-service via builder"() { - setup: - injectSysConfig("dd.trace.PeerServiceTagInterceptor.enabled", "$enabled") - def tracer = createSplittingTracer(Tags.MESSAGE_BUS_DESTINATION) - - when: - def span = tracer.buildSpan("some span") - .withTag(Tags.MESSAGE_BUS_DESTINATION, "some-queue") - .withTag(Tags.PEER_SERVICE, "peer-service") - .start() - span.finish() - - then: - (span.serviceName == "peer-service") == enabled - - cleanup: - tracer.close() - - where: - enabled << [true, false] - } - - def "split-by-tags then peer-service via setTag"() { - setup: - injectSysConfig("dd.trace.PeerServiceTagInterceptor.enabled", "true") - def tracer = createSplittingTracer(Tags.MESSAGE_BUS_DESTINATION) - - when: - def span = tracer.buildSpan("some span").start() - span.setTag(Tags.MESSAGE_BUS_DESTINATION, "some-queue") - span.setTag(Tags.PEER_SERVICE, "peer-service") - span.finish() - - then: - span.serviceName == "peer-service" - - cleanup: - tracer.close() - } - - def "set resource name"() { - when: - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - - def span = tracer.buildSpan("test").start() - span.setTag(DDTags.RESOURCE_NAME, name) - span.finish() - writer.waitForTraces(1) - - then: - span.getResourceName() == name - - cleanup: - tracer.close() - - where: - name = "my resource name" - } - - def "set resource name ignores null"() { - when: - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - - def span = tracer.buildSpan("test").withResourceName("keep").start() - span.setTag(DDTags.RESOURCE_NAME, null) - span.finish() - writer.waitForTraces(1) - - then: - span.getResourceName() == "keep" - - cleanup: - tracer.close() - } - - def "set span type"() { - when: - def tracer = tracerBuilder().writer(new ListWriter()).build() - def span = tracer.buildSpan("test").start() - span.setSpanType(type) - span.finish() - - then: - span.getSpanType() == type - - cleanup: - tracer.close() - - where: - type = DDSpanTypes.HTTP_CLIENT - } - - def "set span type with tag"() { - when: - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - def span = tracer.buildSpan("test").start() - span.setTag(DDTags.SPAN_TYPE, type) - span.finish() - writer.waitForTraces(1) - - then: - span.getSpanType() == type - - cleanup: - tracer.close() - - where: - type = DDSpanTypes.HTTP_CLIENT - } - - def "span metrics starts empty but added with rate limiting value of #rate"() { - when: - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - def span = tracer.buildSpan("test").start() - - then: - span.getTag(ANALYTICS_SAMPLE_RATE) == null - - when: - span.setTag(ANALYTICS_SAMPLE_RATE, rate) - span.finish() - writer.waitForTraces(1) - - then: - span.getTag(ANALYTICS_SAMPLE_RATE) == result - - cleanup: - tracer.close() - - where: - rate | result - 00 | 0 - 1 | 1 - 0f | 0 - 1f | 1 - 0.1 | 0.1 - 1.1 | 1.1 - -1 | -1 - 10 | 10 - "00" | 0 - "1" | 1 - "1.0" | 1 - "0" | 0 - "0.1" | 0.1 - "1.1" | 1.1 - "-1" | -1 - "str" | null - } - - def "set priority sampling via tag"() { - when: - def tracer = tracerBuilder().writer(new ListWriter()).build() - def span = tracer.buildSpan("test").start() - span.setTag(tag, value) - - then: - span.samplingPriority == expected - - cleanup: - tracer.close() - - where: - tag | value | expected - DDTags.MANUAL_KEEP | true | PrioritySampling.USER_KEEP - DDTags.MANUAL_KEEP | false | null - DDTags.MANUAL_KEEP | "true" | PrioritySampling.USER_KEEP - DDTags.MANUAL_KEEP | "false" | null - DDTags.MANUAL_KEEP | "asdf" | null - - DDTags.MANUAL_DROP | true | PrioritySampling.USER_DROP - DDTags.MANUAL_DROP | false | null - DDTags.MANUAL_DROP | "true" | PrioritySampling.USER_DROP - DDTags.MANUAL_DROP | "false" | null - DDTags.MANUAL_DROP | "asdf" | null - - Tags.ASM_KEEP | true | PrioritySampling.USER_KEEP - Tags.ASM_KEEP | false | null - Tags.ASM_KEEP | "true" | PrioritySampling.USER_KEEP - Tags.ASM_KEEP | "false" | null - Tags.ASM_KEEP | "asdf" | null - - Tags.SAMPLING_PRIORITY | -1 | PrioritySampling.USER_DROP - Tags.SAMPLING_PRIORITY | 0 | PrioritySampling.USER_DROP - Tags.SAMPLING_PRIORITY | 1 | PrioritySampling.USER_KEEP - Tags.SAMPLING_PRIORITY | 2 | PrioritySampling.USER_KEEP - Tags.SAMPLING_PRIORITY | "-1" | PrioritySampling.USER_DROP - Tags.SAMPLING_PRIORITY | "0" | PrioritySampling.USER_DROP - Tags.SAMPLING_PRIORITY | "1" | PrioritySampling.USER_KEEP - Tags.SAMPLING_PRIORITY | "2" | PrioritySampling.USER_KEEP - Tags.SAMPLING_PRIORITY | "asdf" | null - } - - def "set error flag when error tag reported"() { - when: - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - def span = tracer.buildSpan("test").start() - span.setTag(Tags.ERROR, error) - span.finish() - writer.waitForTraces(1) - - then: - span.isError() == error - - cleanup: - tracer.close() - - where: - error | _ - true | _ - false | _ - } - - def "#attribute interceptors apply to builder too"() { - setup: - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - - when: - def span = tracer.buildSpan("interceptor.test").withTag(name, value).start() - span.finish() - writer.waitForTraces(1) - - then: - span.context()."$attribute" == value - - cleanup: - tracer.close() - - where: - attribute | name | value - "serviceName" | DDTags.SERVICE_NAME | "my-service" - "resourceName" | DDTags.RESOURCE_NAME | "my-resource" - "spanType" | DDTags.SPAN_TYPE | "my-span-type" - } - - def "decorators apply to builder too"() { - setup: - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - - when: - def span = tracer.buildSpan("decorator.test").withTag("sn.tag1", "some val").start() - span.finish() - writer.waitForTraces(1) - - then: - span.serviceName == "some val" - - when: - span = tracer.buildSpan("decorator.test").withTag("servlet.context", "/my-servlet").start() - - then: - span.serviceName == "my-servlet" - - when: - span = tracer.buildSpan("decorator.test").withTag("error", "true").start() - span.finish() - writer.waitForTraces(2) - - then: - span.error - - when: - span = tracer.buildSpan("decorator.test").withTag(Tags.DB_STATEMENT, "some-statement").start() - span.finish() - writer.waitForTraces(3) - - then: - span.resourceName.toString() == "some-statement" - - cleanup: - tracer.close() - } - - def "disable decorator via config"() { - setup: - injectSysConfig("dd.trace.${decorator}.enabled", "$enabled") - - def tracer = tracerBuilder() - .serviceName("some-service") - .writer(new LoggingWriter()) - .sampler(new AllSampler()) - .build() - - when: - def span = tracer.buildSpan("some span").withTag(DDTags.SERVICE_NAME, "other-service").start() - span.finish() - - then: - span.getServiceName() == enabled ? "other-service" : "some-service" - - cleanup: - tracer.close() - - where: - decorator | enabled - "servicenametaginterceptor" | true - "ServiceNameTagInterceptor" | true - "serviceNametaginterceptor" | false - "ServiceNameTagInterceptor" | false - } - - def "disabling service decorator does not disable split by tags"() { - setup: - injectSysConfig("dd.trace.ServiceNameTagInterceptor.enabled", "false") - - def tracer = tracerBuilder() - .serviceName("some-service") - .writer(new LoggingWriter()) - .sampler(new AllSampler()) - .build() - - when: - def span = tracer.buildSpan("some span").withTag(tag, name).start() - span.finish() - - then: - span.getServiceName() == expected - - cleanup: - tracer.close() - - where: - tag | name | expected - DDTags.SERVICE_NAME | "new-service" | "some-service" - "service" | "new-service" | "some-service" - "sn.tag1" | "new-service" | "new-service" - } - - def "change top level status when changing service name"() { - setup: - def tracer = tracerBuilder() - .serviceName("some-service") - .writer(new LoggingWriter()) - .sampler(new AllSampler()) - .build() - - AgentSpan parent = tracer.buildSpan("parent") - .withServiceName("parent").start() - - when: "the service name doesn't match the parent" - AgentSpan child = tracer.buildSpan("child") - .withServiceName("child") - .asChildOf(parent) - .start() - - then: - (child as CoreSpan).isTopLevel() - - when: "the service name is changed to match the parent" - child.setTag(DDTags.SERVICE_NAME, "parent") - - then: - !(child as CoreSpan).isTopLevel() - - when: "the service name is changed to no longer match the parent" - child.setTag(DDTags.SERVICE_NAME, "foo") - - then: - (child as CoreSpan).isTopLevel() - - cleanup: - tracer.close() - } - - def "treat `1` value as `true` for boolean tag values"() { - setup: - def tracer = tracerBuilder() - .serviceName("some-service") - .writer(new LoggingWriter()) - .sampler(new AllSampler()) - .build() - - when: - AgentSpan span = tracer.buildSpan("test").start() - - then: - span.getSamplingPriority() == null - - when: - span.setTag(tag, value) - - then: - span.getSamplingPriority() == samplingPriority - - where: - tag | value | samplingPriority - DDTags.MANUAL_DROP | true | PrioritySampling.USER_DROP - DDTags.MANUAL_DROP | "1" | PrioritySampling.USER_DROP - DDTags.MANUAL_DROP | false | null - DDTags.MANUAL_DROP | "0" | null - DDTags.MANUAL_KEEP | true | PrioritySampling.USER_KEEP - DDTags.MANUAL_KEEP | "1" | PrioritySampling.USER_KEEP - DDTags.MANUAL_KEEP | false | null - DDTags.MANUAL_KEEP | "0" | null - } - - def "URLAsResourceNameRule sets the resource name"() { - setup: - def tracer = tracerBuilder().writer(new ListWriter()).build() - - def span = tracer.buildSpan("fakeOperation").start() - meta.each { - span.setTag(it.key, (String) it.value) - } - - when: - span.setTag(Tags.HTTP_URL, value) - - then: - span.resourceName.toString() == resourceName - - cleanup: - span.finish() - tracer.close() - - where: - value | resourceName | meta - null | "fakeOperation" | [:] - " " | "/" | [:] - "\t" | "/" | [:] - "/path" | "/path" | [:] - "/ABC/a-1/b_2/c.3/d4d/5f/6" | "/ABC/?/?/?/?/?/?" | [:] - "/not-found" | "404" | [(Tags.HTTP_STATUS): "404"] - "/with-method" | "POST /with-method" | [(Tags.HTTP_METHOD): "Post"] - - ignore = meta.put(Tags.HTTP_URL, value) - } - - def "when user sets peer.service the source should be peer.service"() { - setup: - def tracer = tracerBuilder().writer(new ListWriter()).build() - - def span = tracer.buildSpan("fakeOperation").start() - - - when: - span.setTag(Tags.PEER_SERVICE, "test") - - then: - span.getTag(DDTags.PEER_SERVICE_SOURCE) == "peer.service" - - cleanup: - span.finish() - tracer.close() - } - - void "when interceptServiceName extraServiceProvider is called"() { - def origServiceNameCollector = ServiceNameCollector.INSTANCE - setup: - final extraServiceProvider = Mock(ServiceNameCollector) - ServiceNameCollector.INSTANCE = extraServiceProvider - final ruleFlags = Mock(RuleFlags) - ruleFlags.isEnabled(_) >> true - final interceptor = new TagInterceptor(true, "my-service", Collections.singleton(DDTags.SERVICE_NAME), ruleFlags, false) - - when: - interceptor.interceptServiceName(null, Mock(DDSpanContext), "some-service") - - then: - 1 * extraServiceProvider.addService("some-service") - - cleanup: - ServiceNameCollector.INSTANCE = origServiceNameCollector - } - - void "when interceptServletContext extraServiceProvider is called"() { - def origServiceNameCollector = ServiceNameCollector.INSTANCE - setup: - final extraServiceProvider = Mock(ServiceNameCollector) - ServiceNameCollector.INSTANCE = extraServiceProvider - final ruleFlags = Mock(RuleFlags) - ruleFlags.isEnabled(_) >> true - final interceptor = new TagInterceptor(true, "my-service", Collections.singleton("servlet.context"), ruleFlags, false) - - when: - interceptor.interceptServletContext(Mock(DDSpanContext), value) - - then: - 1 * extraServiceProvider.addService(expected) - - cleanup: - ServiceNameCollector.INSTANCE = origServiceNameCollector - - where: - value | expected - "/" | "root-servlet" - "/test" | "test" - "test" | "test" - } - - void "When intercepts product trace source propagation tag updatePropagatedTraceSource is called"() { - setup: - final ruleFlags = Mock(RuleFlags) - ruleFlags.isEnabled(_) >> true - final interceptor = new TagInterceptor(ruleFlags) - final context = Mock(DDSpanContext) - - when: - interceptor.interceptTag(context, Tags.PROPAGATED_TRACE_SOURCE, ProductTraceSource.ASM) - - then: - 1 * context.addPropagatedTraceSource(ProductTraceSource.ASM) - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/tagprocessor/IntegrationAdderTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/tagprocessor/IntegrationAdderTest.groovy deleted file mode 100644 index e8a17de339f..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/tagprocessor/IntegrationAdderTest.groovy +++ /dev/null @@ -1,26 +0,0 @@ -package datadog.trace.core.tagprocessor - -import datadog.trace.api.TagMap -import datadog.trace.core.DDSpanContext -import datadog.trace.test.util.DDSpecification - -class IntegrationAdderTest extends DDSpecification { - def "should add or remove _dd.integration when set (#isSet) on the span context"() { - setup: - def calculator = new IntegrationAdder() - def spanContext = Mock(DDSpanContext) - - when: - def unsafeTags = TagMap.fromMap(["_dd.integration": "bad"]) - calculator.processTags(unsafeTags, spanContext, {link -> }) - - then: - 1 * spanContext.getIntegrationName() >> (isSet ? "test" : null) - - and: - assert unsafeTags == (isSet ? ["_dd.integration": "test"] : [:]) - - where: - isSet << [true, false] - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/tagprocessor/InternalTagsAdderTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/tagprocessor/InternalTagsAdderTest.groovy deleted file mode 100644 index 5429a9e8b24..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/tagprocessor/InternalTagsAdderTest.groovy +++ /dev/null @@ -1,61 +0,0 @@ -package datadog.trace.core.tagprocessor - -import static datadog.trace.bootstrap.instrumentation.api.Tags.VERSION - -import datadog.trace.api.TagMap -import datadog.trace.bootstrap.instrumentation.api.AppendableSpanLinks -import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString -import datadog.trace.core.DDSpanContext -import datadog.trace.test.util.DDSpecification - -class InternalTagsAdderTest extends DDSpecification { - def "should add _dd.base_service when service differs to ddService"() { - setup: - def calculator = new InternalTagsAdder("test", null) - def spanContext = Mock(DDSpanContext) - def links = Mock(AppendableSpanLinks) - - when: - def unsafeTags = TagMap.fromMap([:]) - calculator.processTags(unsafeTags, spanContext, links) - - then: - 1 * spanContext.getServiceName() >> serviceName - - and: - assert unsafeTags == expectedTags - - where: - serviceName | expectedTags - "anotherOne" | ["_dd.base_service": UTF8BytesString.create("test")] - "test" | [:] - "TeSt" | [:] - } - - def "should add version when DD_SERVICE = #serviceName and version = #ddVersion"() { - setup: - def calculator = new InternalTagsAdder("same", ddVersion) - def spanContext = Mock(DDSpanContext) - def links = Mock(AppendableSpanLinks) - - when: - def unsafeTags = TagMap.fromMap(tags) - calculator.processTags(unsafeTags, spanContext, links) - - then: - 1 * spanContext.getServiceName() >> serviceName - - and: - assert unsafeTags?.get(VERSION)?.toString() == expected - - - where: - serviceName | ddVersion | tags | expected - "same" | null | [:] | null - "different" | "1.0" | [:] | null - "different" | "1.0" | ["version": "2.0"] | "2.0" - "same" | null | ["version": "2.0"] | "2.0" - "same" | "1.0" | ["version": "2.0"] | "2.0" - "same" | "1.0" | [:] | "1.0" - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/tagprocessor/PayloadTagsProcessorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/tagprocessor/PayloadTagsProcessorTest.groovy deleted file mode 100644 index 5b871052d99..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/tagprocessor/PayloadTagsProcessorTest.groovy +++ /dev/null @@ -1,413 +0,0 @@ -package datadog.trace.core.tagprocessor - -import com.squareup.moshi.JsonWriter -import datadog.trace.payloadtags.PayloadTagsData -import datadog.trace.payloadtags.PayloadTagsData.PathAndValue -import datadog.trace.util.json.PathCursor -import datadog.trace.test.util.DDSpecification -import datadog.trace.api.Config -import datadog.trace.api.TagMap -import okio.Buffer -import java.time.Instant - -class PayloadTagsProcessorTest extends DDSpecification { - - PathCursor pc() { - new PathCursor(10) - } - - def "disabled by default"() { - expect: - !PayloadTagsProcessor.create(Config.get()) - } - - def "enabled with defaults when configured req #requestPayloadTagging resp #responsePayloadTagging"() { - setup: - requestPayloadTagging && injectSysConfig("trace.cloud.request.payload.tagging", requestPayloadTagging) - responsePayloadTagging && injectSysConfig("trace.cloud.response.payload.tagging", responsePayloadTagging) - - when: - def ptp = PayloadTagsProcessor.create(Config.get()) - - then: - ptp != null - ptp.maxDepth == 10 - ptp.maxTags == 758 - ptp.redactionRulesByTagPrefix.get(tagPrefix).findMatching(pathMatchingDefaultRules) != null - ptp.redactionRulesByTagPrefix.get(tagPrefix).findMatching(pc().push("non-matching-path")) == null - - where: - requestPayloadTagging | responsePayloadTagging | tagPrefix | pathMatchingDefaultRules - "all" | "all" | "aws.request.body" | pc().push("phoneNumber") - "all" | "\$[33].baz" | "aws.request.body" | pc().push("AWSAccountId") - "\$.bar" | "all" | "aws.response.body" | pc().push("Endpoints").push("foobar").push("Token") - "\$.foo.bar" | "\$..bar.*" | "aws.request.body" | pc().push("phoneNumber") - null | "all" | "aws.response.body" | pc().push("phoneNumbers").push(5) - "all" | null | "aws.request.body" | pc().push("Attributes").push("KmsMasterKeyId") - } - - def "enabled with custom limits"() { - setup: - requestPayloadTagging && injectSysConfig("trace.cloud.request.payload.tagging", requestPayloadTagging) - responsePayloadTagging && injectSysConfig("trace.cloud.response.payload.tagging", responsePayloadTagging) - injectSysConfig("trace.cloud.payload.tagging.max-depth", "$maxDepth") - injectSysConfig("trace.cloud.payload.tagging.max-tags", "$maxTags") - - when: - def ptp = PayloadTagsProcessor.create(Config.get()) - - then: - ptp.maxDepth == maxDepth - ptp.maxTags == maxTags - - where: - requestPayloadTagging | responsePayloadTagging | maxDepth | maxTags - "all" | "all" | 10 | 10 - "\$.bar" | null | 7 | 42 - "all" | "\$.*" | 12 | 50 - null | "all" | 8 | 33 - } - - static PayloadTagsProcessor tagsProcessor(String tagPrefix, List redactionRules, int maxDepth, int maxTags) { - def rules = new PayloadTagsProcessor.RedactionRules.Builder().addRedactionJsonPaths(redactionRules).build() - new PayloadTagsProcessor([(tagPrefix): rules], maxDepth, maxTags) - } - - def "preserve all span tags except for payloadData"() { - setup: - def ptp = tagsProcessor("payload", [], 10, 758) - def spanTags = [ - "foo": "bar", - "tag1": 1, - "payload": new PayloadTagsData([] as PathAndValue[]) - ] - - when: - def unsafeTags = TagMap.fromMap(spanTags) - ptp.processTags(unsafeTags, null, {link -> }) - - then: - unsafeTags == ["foo": "bar", "tag1": 1] - } - - static PathAndValue pv(PathCursor path, Object value) { - new PathAndValue(path.toPath(), value) - } - - static PayloadTagsData payloadData(List pathAndValues) { - new PayloadTagsData(pathAndValues as PathAndValue[]) - } - - static LinkedHashMap spanTags(String tagPrefix, List pathAndValues) { - [(tagPrefix): payloadData(pathAndValues)] - } - - def "expand payload to tags"() { - setup: - def ptp = tagsProcessor("payload", [], 10, 758) - def spanTags = [ - "foo": "bar", - "tag1": 1, - "payload": payloadData([pv(pc().push("tag1"), 0)]) - ] - - when: - def unsafeTags = TagMap.fromMap(spanTags) - ptp.processTags(unsafeTags, null, {link -> }) - - then: - unsafeTags == ["foo": "bar", "tag1": 1, "payload.tag1": 0] - } - - def "expand preserving tag types"() { - setup: - def ptp = tagsProcessor("payload", [], 10, 758) - - def st = spanTags("payload", [ - pv(pc().push("tag1"), 11), - pv(pc().push("tag2").push("Value"), 2342l), - pv(pc().push("tag3").push(0), 3.14d), - pv(pc().push("tag4").push("Value").push(0), "string"), - pv(pc().push("tag5"), null), - pv(pc().push("tag6"), false), - ]) - - when: - def unsafeTags = TagMap.fromMap(st) - ptp.processTags(unsafeTags, null, {link -> }) - - then: - unsafeTags == [ - "payload.tag1": 11, - "payload.tag2.Value": 2342l, - "payload.tag3.0": 3.14d, - "payload.tag4.Value.0": "string", - "payload.tag5": null, - "payload.tag6": false, - ] - } - - def "expand unknown tag values to string"() { - setup: - def ptp = tagsProcessor("payload", [], 10, 758) - def unknownValue = Instant.now() - - def st = spanTags("payload", [pv(pc().push("tag7"), unknownValue),]) - - when: - def unsafeTags = TagMap.fromMap(st) - ptp.processTags(unsafeTags, null, {link ->}) - - then: - unsafeTags == [ - "payload.tag7": unknownValue.toString(), - ] - } - - def "expand stringified JSON tags"() { - setup: - def ptp = tagsProcessor("p", [], 10, 758) - - def st = spanTags("p", [ - pv(pc().push("j1"), "{}"), - pv(pc().push("j2"), "[]"), - pv(pc().push("j3"), "['1', 2, 3.14, null, true]"), - pv(pc().push("j4"), "{'foo': 'bar', 'baz': 42}"), - ]) - - when: - def unsafeTags = TagMap.fromMap(st) - ptp.processTags(unsafeTags, null, {link ->}) - - then: - unsafeTags == [ - "p.j3.0": "1", - "p.j3.1": 2, - "p.j3.2": 3.14d, - "p.j3.3": null, - "p.j3.4": true, - "p.j4.foo": "bar", - "p.j4.baz": 42, - ] - } - - def "expand serialized escaped inner json within inner json"() { - Buffer b0 = new Buffer() - JsonWriter.of(b0) - .beginObject() - .name("a").value(1.15) - .name("password").value("my-secret-password") - .endObject() - .close() - - Buffer b1 = new Buffer() - JsonWriter.of(b1) - .beginObject() - .name("id").value(45) - .name("user").value(b0.readUtf8()) - .endObject() - .close() - - Buffer b2 = new Buffer() - JsonWriter.of(b2) - .beginObject() - .name("a").value(33) - .name("Message").value(b1.readUtf8()) - .name("b").value(true) - .endObject() - .close() - - String json = b2.readUtf8() - - setup: - def ptp = tagsProcessor("dd", [], 10, 758) - - def st = spanTags("dd", [pv(pc(), json),]) - - when: - def unsafeTags = TagMap.fromMap(st) - ptp.processTags(unsafeTags, null, {link ->}) - - then: - unsafeTags == [ - 'dd.a' : 33, - 'dd.Message.id' : 45, - 'dd.Message.user.a' : 1.15d, - 'dd.Message.user.password': 'my-secret-password', - 'dd.b' : true - ] - } - - def "keep failed to parse JSON as-is"() { - setup: - def ptp = tagsProcessor("p", [], 10, 758) - - def st = spanTags("p", [pv(pc().push("key"), invalidJson),]) - - when: - def unsafeTags = TagMap.fromMap(st) - ptp.processTags(unsafeTags, null, {link ->}) - - then: - unsafeTags == [ - "p.key": invalidJson, - ] - - where: - invalidJson << [ - "{'foo: 'bar'", - "[1, 2", - "[1, 2] ", - " [1, 2]", - "{'foo: 'bar'} ", - " {'foo: 'bar'}", - ] - } - - def "expand binary if JSON"() { - setup: - def ptp = tagsProcessor("p", [], 10, 758) - - def st = spanTags("p", [ - pv(pc().push("j0"), new ByteArrayInputStream("{}".bytes)), - pv(pc().push("j1"), new ByteArrayInputStream("{'foo': 'bar'}".bytes)), - pv(pc().push("j2"), new ByteArrayInputStream("[1, true]".bytes)), - ]) - - when: - def unsafeTags = TagMap.fromMap(st) - ptp.processTags(unsafeTags, null, {link ->}) - - then: - unsafeTags == [ - "p.j1.foo": "bar", - "p.j2.0": 1, - "p.j2.1": true, - ] - } - - def "expand binary escaped JSON tags"() { - setup: - def ptp = tagsProcessor("p", [], 10, 758) - - when: - def st = spanTags("p", [pv(pc().push("v"), new ByteArrayInputStream("""{ "inner": $innerJson}""".bytes))]) - - def unsafeTags = TagMap.fromMap(st) - ptp.processTags(unsafeTags, null, {link ->}) - - then: - unsafeTags == [ - "p.v.inner.a": 1.15d, - "p.v.inner.password": "my-secret-password", - ] - - where: - innerJson << [ - "{ \"a\": 1.15, \"password\": \"my-secret-password\" }", - "\"{ 'a': 1.15, 'password': 'my-secret-password' }\"", - '"{ \\"a\\": 1.15, \\"password\\": \\"my-secret-password\\" }"', - "'{ \"a\": 1.15, \"password\": \"my-secret-password\" }'", - '''"{ \\"a\\": 1.15, \\"password\\": \\"my-secret-password\\" }"''' - ] - } - - def "use value if not JSON or couldn't be parsed"() { - setup: - def ptp = tagsProcessor("p", [], 10, 758) - - def st = spanTags("p", [pv(pc().push("key"), new ByteArrayInputStream(invalidJson.bytes)),]) - - when: - def unsafeTags = TagMap.fromMap(st) - ptp.processTags(unsafeTags, null, {link ->}) - - then: - unsafeTags == [ - "p.key": "", - ] - - where: - invalidJson << [" [1]", " {'foo': 'bar'}", "invalid:"] - } - - def "apply redaction rules"() { - setup: - def ptp = tagsProcessor("p", ["\$.j3[0]", "\$.j4.baz"], 10, 758) - - def st = spanTags("p", [ - pv(pc().push("j1"), "{}"), - pv(pc().push("j2"), "[]"), - pv(pc().push("j3"), "['1', 2, 3.14, null, true]"), - pv(pc().push("j4"), "{'foo': 'bar', 'baz': 42}"), - ]) - - when: - def unsafeTags = TagMap.fromMap(st) - ptp.processTags(unsafeTags, null, {link ->}) - - then: - unsafeTags == [ - "p.j3.0": "redacted", - "p.j3.1": 2, - "p.j3.2": 3.14d, - "p.j3.3": null, - "p.j3.4": true, - "p.j4.foo": "bar", - "p.j4.baz": "redacted", - ] - } - - def "respect max tags limit"() { - setup: - def ptp = tagsProcessor("p", ["\$.j3[0]", "\$.j4.baz"], 10, 4) - - def st = spanTags("p", [ - pv(pc().push("j1"), "{}"), - pv(pc().push("j2"), "[]"), - pv(pc().push("j3"), "['1', 2, 3.14, null, true]"), - pv(pc().push("j4"), "{'foo': 'bar', 'baz': 42}"), - ]) - - when: - def unsafeTags = TagMap.fromMap(st) - ptp.processTags(unsafeTags, null, {link ->}) - - then: - unsafeTags == [ - "p.j3.0": "redacted", - "p.j3.1": 2, - "p.j3.2": 3.14d, - "p.j3.3": null, - "_dd.payload_tags_incomplete": true - ] - } - - def "respect max depth limit"() { - setup: - def ptp = tagsProcessor("p", ["\$.j3[0]", "\$.j4.baz"], 3, 800) - - def st = spanTags("p", [ - pv(pc().push("j3"), "['1', 2, 3.14, null, true, [ 1, [ 2, 3 ] ]]"), - pv(pc().push("j4"), "{'foo': 'bar', 'baz': 42, 'nested': { 'a': 1, 'b': { 'c': 2 } } }"), - ]) - - when: - def unsafeTags = TagMap.fromMap(st) - ptp.processTags(unsafeTags, null, {link -> }) - - then: - unsafeTags == [ - "p.j3.0": "redacted", - "p.j3.1": 2, - "p.j3.2": 3.14d, - "p.j3.3": null, - "p.j3.4": true, - "p.j3.5.0": 1, - "p.j4.foo": "bar", - "p.j4.baz": "redacted", - "p.j4.nested.a": 1, - ] - } -} - diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/tagprocessor/PeerServiceCalculatorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/tagprocessor/PeerServiceCalculatorTest.groovy deleted file mode 100644 index 2ddf8770d1e..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/tagprocessor/PeerServiceCalculatorTest.groovy +++ /dev/null @@ -1,136 +0,0 @@ -package datadog.trace.core.tagprocessor - -import datadog.trace.api.Config -import datadog.trace.api.DDTags -import datadog.trace.api.TagMap -import datadog.trace.api.config.TracerConfig -import datadog.trace.api.naming.v0.NamingSchemaV0 -import datadog.trace.api.naming.v1.NamingSchemaV1 -import datadog.trace.bootstrap.instrumentation.api.Tags -import datadog.trace.test.util.DDSpecification - -class PeerServiceCalculatorTest extends DDSpecification { - def "schema v0 : peer service is not calculated by default"() { - setup: - def calculator = new PeerServiceCalculator(new NamingSchemaV0().peerService(), Collections.emptyMap()) - when: - def unsafeTags = TagMap.fromMap(tags) - calculator.processTags(unsafeTags, null, {link ->}) - - then: - // tags are not modified - assert unsafeTags == tags - - where: - tags | _ - [:] | _ - ["peer.hostname": "test"] | _ - ["peer.hostname": "test", "db.instance": "instance"] | _ - ["db.instance": "instance", "peer.hostname": "test"] | _ - ["peer.hostname": "test", "rpc.service": "svc"] | _ - ["rpc.service": "svc", "peer.hostname": "test"] | _ - } - - def "schema v1: test peer service default logic and precursors"() { - setup: - def calculator = new PeerServiceCalculator(new NamingSchemaV1().peerService(), Collections.emptyMap()) - - when: - tags.put(Tags.SPAN_KIND, Tags.SPAN_KIND_CLIENT) - - def unsafeTags = TagMap.fromMap(tags) - calculator.processTags(unsafeTags, null, {link ->}) - - then: - unsafeTags.get(DDTags.PEER_SERVICE_SOURCE) == provenance - unsafeTags.get(Tags.PEER_SERVICE) == peerService - - where: - tags | provenance | peerService - [:] | null | null - ["peer.hostname": "test"] | Tags.PEER_HOSTNAME | "test" - ["peer.hostname": "test"] | Tags.PEER_HOSTNAME | "test" - ["peer.hostname": "test", "db.instance": "instance"] | Tags.DB_INSTANCE | "instance" - ["db.instance": "instance", "peer.hostname": "test"] | Tags.DB_INSTANCE | "instance" - ["peer.hostname": "test", "rpc.service": "svc", "component": "grpc-client"] | Tags.RPC_SERVICE | "svc" - ["rpc.service": "svc", "peer.hostname": "test", "component": "grpc-client"] | Tags.RPC_SERVICE | "svc" - ["peer.hostname": "test", "peer.service": "userService"] | null | "userService" - } - - def "schema v0: should calculate defaults if enabled"() { - setup: - injectSysConfig(TracerConfig.TRACE_PEER_SERVICE_DEFAULTS_ENABLED, "true") - def calculator = new PeerServiceCalculator(new NamingSchemaV0().peerService(), Collections.emptyMap()) - - when: - def unsafeTags = TagMap.fromMap(["span.kind": "client", "peer.hostname": "test"]) - calculator.processTags(unsafeTags, null, {link ->}) - - then: - assert unsafeTags.get(Tags.PEER_SERVICE) == "test" - } - - - def "calculate only for span kind client or producer"() { - setup: - def calculator = new PeerServiceCalculator(new NamingSchemaV1().peerService(), Collections.emptyMap()) - - when: - def tags = ["span.kind": kind, "peer.hostname": "test"] - def unsafeTags = TagMap.fromMap(tags) - - calculator.processTags(unsafeTags, null, {link -> }) - - then: - assert unsafeTags.containsKey(Tags.PEER_SERVICE) == calculate - - where: - kind | calculate - "client" | true - "producer" | true - "server" | false - } - - def "should apply peer service mappings if configured"() { - setup: - injectSysConfig(TracerConfig.TRACE_PEER_SERVICE_MAPPING, "service1:best_service,userService:my_service") - injectSysConfig(TracerConfig.TRACE_PEER_SERVICE_DEFAULTS_ENABLED, "true") - - def calculator = new PeerServiceCalculator(new NamingSchemaV0().peerService(), Config.get().getPeerServiceMapping()) - - when: - def unsafeTags = TagMap.fromMap(tags) - calculator.processTags(unsafeTags, null, {link ->}) - - then: - assert unsafeTags.get(Tags.PEER_SERVICE) == expected - assert unsafeTags.get(DDTags.PEER_SERVICE_REMAPPED_FROM) == original - - where: - tags | expected | original - ["peer.service": "userService"] | "my_service" | "userService" - ["peer.hostname": "test", "span.kind": "client"] | "test" | null - ["peer.hostname": "service1", "span.kind": "producer"] | "best_service" | "service1" - } - - def "should override peer service values if configured"() { - setup: - injectSysConfig(TracerConfig.TRACE_PEER_SERVICE_COMPONENT_OVERRIDES, "java-couchbase:couchbase") - injectSysConfig(TracerConfig.TRACE_PEER_SERVICE_DEFAULTS_ENABLED, "true") - - def calculator = new PeerServiceCalculator(new NamingSchemaV0().peerService(), Config.get().getPeerServiceComponentOverrides()) - - when: - def unsafeTags = TagMap.fromMap(tags) - calculator.processTags(unsafeTags, null, {link -> }) - - then: - assert unsafeTags.get(Tags.PEER_SERVICE) == expected - assert unsafeTags.get(DDTags.PEER_SERVICE_SOURCE) == source - - where: - tags | expected | source - ["component": "java-couchbase", "span.kind": "client"] | "couchbase" | "_component_override" - ["peer.hostname": "host1", "span.kind": "client", "component" : "my-http-client"] | "host1" | "peer.hostname" - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/tagprocessor/PostProcessorChainTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/tagprocessor/PostProcessorChainTest.groovy deleted file mode 100644 index 3d62f0b29da..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/tagprocessor/PostProcessorChainTest.groovy +++ /dev/null @@ -1,68 +0,0 @@ -package datadog.trace.core.tagprocessor - -import datadog.trace.api.TagMap -import datadog.trace.bootstrap.instrumentation.api.AppendableSpanLinks -import datadog.trace.core.DDSpanContext -import datadog.trace.test.util.DDSpecification - -class PostProcessorChainTest extends DDSpecification { - def "chain works"() { - setup: - def processor1 = new TagsPostProcessor() { - @Override - void processTags(TagMap unsafeTags, DDSpanContext spanContext, AppendableSpanLinks spanLinks) { - unsafeTags.put("key1", "processor1") - unsafeTags.put("key2", "processor1") - } - } - def processor2 = new TagsPostProcessor() { - @Override - void processTags(TagMap unsafeTags, DDSpanContext spanContext, AppendableSpanLinks spanLinks) { - unsafeTags.put("key1", "processor2") - } - } - - def chain = new PostProcessorChain(processor1, processor2) - - def links = [] - def tags = TagMap.fromMap(["key1": "overwrite", "key3": "unchanged"]) - - when: - chain.processTags(tags, null, {link -> links.add(link)}) - - then: - assert tags == ["key1": "processor2", "key2": "processor1", "key3": "unchanged"] - assert links == [] - } - - def "processor can hide tags to next one()"() { - setup: - def processor1 = new TagsPostProcessor() { - @Override - void processTags(TagMap unsafeTags, DDSpanContext spanContext, AppendableSpanLinks spanLinks) { - unsafeTags.clear() - unsafeTags.put("my", "tag") - } - } - def processor2 = new TagsPostProcessor() { - @Override - void processTags(TagMap unsafeTags, DDSpanContext spanContext, AppendableSpanLinks spanLinks) { - if (unsafeTags.containsKey("test")) { - unsafeTags.put("found", "true") - } - } - } - - def chain = new PostProcessorChain(processor1, processor2) - - def links = [] - def tags = TagMap.fromMap(["test": "test"]) - - when: - chain.processTags(tags, null, {link -> links.add(link)}) - - then: - assert tags == ["my": "tag"] - assert links == [] - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/tagprocessor/QueryObfuscatorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/tagprocessor/QueryObfuscatorTest.groovy deleted file mode 100644 index 1e4332477ed..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/tagprocessor/QueryObfuscatorTest.groovy +++ /dev/null @@ -1,54 +0,0 @@ -package datadog.trace.core.tagprocessor - -import datadog.trace.api.DDTags -import datadog.trace.api.TagMap -import datadog.trace.bootstrap.instrumentation.api.Tags -import datadog.trace.test.util.DDSpecification - -class QueryObfuscatorTest extends DDSpecification { - def "tags processing"() { - setup: - def obfuscator = new QueryObfuscator() - def tags = [ - (Tags.HTTP_URL): 'http://site.com/index', - (DDTags.HTTP_QUERY): query - ] - - when: - def unsafeTags = TagMap.fromMap(tags) - obfuscator.processTags(unsafeTags, null, {link ->}) - - then: - assert unsafeTags.get(DDTags.HTTP_QUERY) == expectedQuery - assert unsafeTags.get(Tags.HTTP_URL) == 'http://site.com/index?' + expectedQuery - - where: - query | expectedQuery - 'key1=val1&token=a0b21ce2-006f-4cc6-95d5-d7b550698482&key2=val2' | 'key1=val1&&key2=val2' - 'app_key=1111&application_key=2222' | '&' - 'email=foo@bar.com' | 'email=foo@bar.com' - } - - def "tags processing with custom regexp for email"() { - setup: - def obfuscator = new QueryObfuscator("(?i)(?:(?:\"|%22)?)(?:(?:old[-_]?|new[-_]?)?p(?:ass)?w(?:or)?d(?:1|2)?|pass(?:[-_]?phrase)?|email|secret|(?:api[-_]?|private[-_]?|public[-_]?|access[-_]?|secret[-_]?|app(?:lication)?[-_]?)key(?:[-_]?id)?|token|consumer[-_]?(?:id|key|secret)|sign(?:ed|ature)?|auth(?:entication|orization)?)(?:(?:\\s|%20)*(?:=|%3D)[^&]+|(?:\"|%22)(?:\\s|%20)*(?::|%3A)(?:\\s|%20)*(?:\"|%22)(?:%2[^2]|%[^2]|[^\"%])+(?:\"|%22))|(?:bearer(?:\\s|%20)+[a-z0-9._\\-]+|token(?::|%3A)[a-z0-9]{13}|gh[opsu]_[0-9a-zA-Z]{36}|ey[I-L](?:[\\w=-]|%3D)+\\.ey[I-L](?:[\\w=-]|%3D)+(?:\\.(?:[\\w.+/=-]|%3D|%2F|%2B)+)?|-{5}BEGIN(?:[a-z\\s]|%20)+PRIVATE(?:\\s|%20)KEY-{5}[^\\-]+-{5}END(?:[a-z\\s]|%20)+PRIVATE(?:\\s|%20)KEY(?:-{5})?(?:\\n|%0A)?|(?:ssh-(?:rsa|dss)|ecdsa-[a-z0-9]+-[a-z0-9]+)(?:\\s|%20|%09)+(?:[a-z0-9/.+]|%2F|%5C|%2B){100,}(?:=|%3D)*(?:(?:\\s|%20|%09)+[a-z0-9._-]+)?)") - def tags = [ - (Tags.HTTP_URL): 'http://site.com/index', - (DDTags.HTTP_QUERY): query - ] - - when: - def unsafeTags = TagMap.fromMap(tags) - obfuscator.processTags(unsafeTags, null, {link ->}) - - then: - assert unsafeTags.get(DDTags.HTTP_QUERY) == expectedQuery - assert unsafeTags.get(Tags.HTTP_URL) == 'http://site.com/index?' + expectedQuery - - where: - query | expectedQuery - 'key1=val1&token=a0b21ce2-006f-4cc6-95d5-d7b550698482&key2=val2' | 'key1=val1&&key2=val2' - 'app_key=1111&application_key=2222' | '&' - 'email=foo@bar.com' | '' - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/tagprocessor/SpanPointersProcessorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/tagprocessor/SpanPointersProcessorTest.groovy deleted file mode 100644 index a3407e30a02..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/tagprocessor/SpanPointersProcessorTest.groovy +++ /dev/null @@ -1,101 +0,0 @@ -package datadog.trace.core.tagprocessor - -import datadog.trace.api.DDSpanId -import datadog.trace.api.DDTraceId -import datadog.trace.api.TagMap -import datadog.trace.bootstrap.instrumentation.api.InstrumentationTags -import datadog.trace.bootstrap.instrumentation.api.SpanLink -import datadog.trace.core.DDSpanContext -import datadog.trace.test.util.DDSpecification - -class SpanPointersProcessorTest extends DDSpecification{ - def "SpanPointersProcessor adds correct link with basic values"() { - given: - def processor = new SpanPointersProcessor() - def unsafeTags = TagMap.fromMap([ - (InstrumentationTags.AWS_BUCKET_NAME): "some-bucket", - (InstrumentationTags.AWS_OBJECT_KEY) : "some-key.data", - "s3.eTag" : "ab12ef34" - ]) - def spanContext = Mock(DDSpanContext) - def spanLinks = [] - def expectedHash = "e721375466d4116ab551213fdea08413" - - when: - // Process the tags; the processor should remove 's3.eTag' and add one link - processor.processTags(unsafeTags, spanContext, {link -> spanLinks.add(link)}) - - then: - // 1. s3.eTag was removed - !unsafeTags.containsKey("s3.eTag") - // 2. Exactly one link was added - spanLinks.size() == 1 - // 3. Check link - def link = spanLinks[0] - link instanceof SpanLink - link.traceId() == DDTraceId.ZERO - link.spanId() == DDSpanId.ZERO - link.attributes.asMap().get("ptr.kind") == SpanPointersProcessor.S3_PTR_KIND - link.attributes.asMap().get("ptr.dir") == SpanPointersProcessor.DOWN_DIRECTION - link.attributes.asMap().get("ptr.hash") == expectedHash - link.attributes.asMap().get("link.kind") == SpanPointersProcessor.LINK_KIND - } - - def "SpanPointersProcessor adds correct link with non-ascii key"() { - given: - def processor = new SpanPointersProcessor() - def unsafeTags = TagMap.fromMap([ - (InstrumentationTags.AWS_BUCKET_NAME): "some-bucket", - (InstrumentationTags.AWS_OBJECT_KEY) : "some-key.你好", - "s3.eTag" : "ab12ef34" - ]) - def spanContext = Mock(DDSpanContext) - def spanLinks = [] - - // From the original test, expected hash for these components - def expectedHash = "d1333a04b9928ab462b5c6cadfa401f4" - - when: - processor.processTags(unsafeTags, spanContext, {link -> spanLinks.add(link)}) - - then: - !unsafeTags.containsKey("s3.eTag") - spanLinks.size() == 1 - def link = spanLinks[0] - link.traceId() == DDTraceId.ZERO - link.spanId() == DDSpanId.ZERO - link.attributes.asMap().get("ptr.kind") == SpanPointersProcessor.S3_PTR_KIND - link.attributes.asMap().get("ptr.dir") == SpanPointersProcessor.DOWN_DIRECTION - link.attributes.asMap().get("ptr.hash") == expectedHash - link.attributes.asMap().get("link.kind") == SpanPointersProcessor.LINK_KIND - } - - def "SpanPointersProcessor adds correct link with multipart-upload ETag"() { - given: - def processor = new SpanPointersProcessor() - def unsafeTags = TagMap.fromMap([ - (InstrumentationTags.AWS_BUCKET_NAME): "some-bucket", - (InstrumentationTags.AWS_OBJECT_KEY) : "some-key.data", - "s3.eTag" : "ab12ef34-5" - ]) - def spanContext = Mock(DDSpanContext) - def spanLinks = [] - - // From the original test, expected hash for these components - def expectedHash = "2b90dffc37ebc7bc610152c3dc72af9f" - - when: - processor.processTags(unsafeTags, spanContext, {link -> spanLinks.add(link)}) - - then: - !unsafeTags.containsKey("s3.eTag") - spanLinks.size() == 1 - def link = spanLinks[0] - link.traceId() == DDTraceId.ZERO - link.spanId() == DDSpanId.ZERO - link.attributes.asMap().get("ptr.kind") == SpanPointersProcessor.S3_PTR_KIND - link.attributes.asMap().get("ptr.dir") == SpanPointersProcessor.DOWN_DIRECTION - link.attributes.asMap().get("ptr.hash") == expectedHash - link.attributes.asMap().get("link.kind") == SpanPointersProcessor.LINK_KIND - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/traceinterceptor/LatencyTraceInterceptorTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/traceinterceptor/LatencyTraceInterceptorTest.groovy deleted file mode 100644 index e0ed91db723..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/traceinterceptor/LatencyTraceInterceptorTest.groovy +++ /dev/null @@ -1,48 +0,0 @@ -package datadog.trace.core.traceinterceptor - -import datadog.trace.api.DDTags -import datadog.trace.common.writer.ListWriter - -import datadog.trace.core.test.DDCoreSpecification - -import spock.lang.Timeout - -@Timeout(10) -class LatencyTraceInterceptorTest extends DDCoreSpecification { - - - def "test set sampling priority according to latency"() { - setup: - - injectSysConfig("trace.partial.flush.enabled", partialFlushEnabled) - injectSysConfig("trace.experimental.keep.latency.threshold.ms", latencyThreshold) - - when: - def writer = new ListWriter() - def tracer = tracerBuilder().writer(writer).build() - - def spanSetup = tracer.buildSpan("test","my_operation_name").withTag(priorityTag, true).start() - sleep(minDuration) - spanSetup.finish() - - then: - def trace = writer.firstTrace() - trace.size() == 1 - def span = trace[0] - span.context().getSamplingPriority() == expected - - cleanup: - tracer.close() - - where: - partialFlushEnabled | latencyThreshold | priorityTag | minDuration | expected - "true" | "200" | DDTags.MANUAL_KEEP | 10 | 2 - "true" | "200" | DDTags.MANUAL_DROP | 10 | -1 - "true" | "200" | DDTags.MANUAL_KEEP | 300 | 2 - "true" | "200" | DDTags.MANUAL_DROP | 300 | -1 - "false" | "200" | DDTags.MANUAL_KEEP | 10 | 2 - "false" | "200" | DDTags.MANUAL_DROP | 10 | -1 - "false" | "200" | DDTags.MANUAL_KEEP | 300 | 2 - "false" | "200" | DDTags.MANUAL_DROP | 300 | 2 - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/util/GlobPatternTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/util/GlobPatternTest.groovy deleted file mode 100644 index 9af94dc894c..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/util/GlobPatternTest.groovy +++ /dev/null @@ -1,22 +0,0 @@ -package datadog.trace.core.util - -import datadog.trace.test.util.DDSpecification - -class GlobPatternTest extends DDSpecification { - - def "Convert glob pattern to regex"() { - expect: - GlobPattern.globToRegex(globPattern) == expectedRegex - - where: - globPattern | expectedRegex - "*" | "^.*\$" - "?" | "^.\$" - "??" | "^..\$" - "Foo*" | "^Foo.*\$" - "abc" | "^abc\$" - "?" | "^.\$" - "F?o" | "^F.o\$" - "Bar*" | "^Bar.*\$" - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/util/LRUCacheTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/util/LRUCacheTest.groovy deleted file mode 100644 index baa4d195691..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/util/LRUCacheTest.groovy +++ /dev/null @@ -1,45 +0,0 @@ -package datadog.trace.core.util - -import datadog.trace.test.util.DDSpecification - -class LRUCacheTest extends DDSpecification { - def "Should eject least recently used element"() { - when: - def lruCache = new LRUCache(5) - for (int i = 1; i <= 5; i++) { - lruCache.put(i, String.valueOf(i)) - } - // now look at 2 values - lruCache.get(1) - lruCache.get(3) - // now insert 2 new values - lruCache.put(6, "6") - lruCache.put(7, "7") - - then: - lruCache.size() == 5 - lruCache.values().containsAll(Arrays.asList("1", "3", "5", "6", "7")) - } - - def "Should notify listener when ejecting least recently used element"() { - setup: - List ejected = new ArrayList<>() - LRUCache.ExpiryListener listener = { Map.Entry entry -> - ejected.add(entry.getKey()) - } - when: - def lruCache = new LRUCache(listener, 10, 0.75f, 5) - for (int i = 1; i <= 5; i++) { - lruCache.put(i, String.valueOf(i)) - } - // now look at 2 values - lruCache.get(1) - lruCache.get(3) - // now insert 2 new values - lruCache.put(6, "6") - lruCache.put(7, "7") - - then: - ejected == [2, 4] - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/util/MatchersTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/util/MatchersTest.groovy deleted file mode 100644 index 1b4cd0c95a9..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/util/MatchersTest.groovy +++ /dev/null @@ -1,119 +0,0 @@ -package datadog.trace.core.util - -import datadog.trace.test.util.DDSpecification - -class MatchersTest extends DDSpecification { - - def "match-all scenarios must return an any matcher"() { - expect: - Matchers.compileGlob(glob) instanceof Matchers.AnyMatcher - - where: - glob << [null, "*", "**"] - } - - def "pattern without * or ? must be an EqualsMatcher"() { - expect: - Matchers.compileGlob(glob) instanceof Matchers.InsensitiveEqualsMatcher - - where: - glob << ["a", "ogre", "bcoho34e2"] - } - - def "pattern with either * or ? must be a PatternMatcher"() { - expect: - Matchers.compileGlob(glob) instanceof Matchers.PatternMatcher - - where: - glob << ["?", "foo*", "*bar", "F?oB?r", "F?o*", "?*", "*?"] - } - - def "an exact matcher is self matching"() { - expect: - Matchers.compileGlob(pattern).matches(pattern) - - where: - pattern << ["", "a", "abc", "cde"] - } - - def "a pattern matcher test #iterationIndex #pattern"() { - when: - def matcher = Matchers.compileGlob(pattern) - - then: - matcher.matches(value) == matches - - where: - pattern | value | matches - "fo?" | "Foo" | true - "Fo?" | "Foo" | true - "Fo?" | new StringBuilder("Foo") | true - "Fo?" | new StringBuilder("foo") | true - "Foo" | new StringBuilder("foo") | true - "bar" | new StringBuilder("Baz") | false - "Fo?" | "Fooo" | false - "Fo*" | "Fo" | true - "Fo*" | "Fa" | false - "F*B?r" | "FooBar" | true - "F*B?r" | "FooFar" | false - "f*b?r" | "FooBar" | true - "*" | true | true - "true" | true | true - "false" | false | true - "TRUE" | true | true - "FALSE" | false | true - "True" | true | true - "False" | false | true - "T*" | true | true - "F*" | false | true - "" | "" | true - "" | "non-empty" | false - "*" | "foo" | true - "**" | "foo" | true - "???" | "foo" | true - "*" | 20 | true - "20" | 20 | true - "-20" | -20 | true - "*" | (byte)20 | true - "20" | (byte)20 | true - "*" | (short)20 | true - "20" | (short)20 | true - "*" | 20L | true - "20" | 20L | true - "*" | 20F | true - "20" | 20F | true - "*" | 20D | true - "20" | 20D | true - "20" | bigInteger("20") | true - "20" | bigDecimal("20") | true - "2*" | 20.1F | false - "2*" | 20.1D | false - "2*" | bigDecimal("20.1") | false - "*" | new Object() {} | true - "**" | new Object() {} | true - "?" | new Object() {} | false - "*" | null | true - "?" | null | false - "[a-z]" | "[a-z]" | true - "[a-z]" | "a" | false - "[abc]" | "[abc]" | true - "[AbC]" | "[abc]" | true - "[Ab]" | new StringBuffer("[ab]") | true - "[abc]" | "a" | false - "[!ab]" | "[!ab]" | true - "[!ab]" | "c" | false - "^" | "^" | true - "()" | "()" | true - "(*)" | "(-)" | true - "\$" | "\$" | true - } - - // helper functions - to subvert codenarc - static bigInteger(str) { - return new BigInteger(str) - } - - static bigDecimal(str) { - return new BigDecimal(str) - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/util/SimpleRateLimiterTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/util/SimpleRateLimiterTest.groovy deleted file mode 100644 index eb2d505071e..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/util/SimpleRateLimiterTest.groovy +++ /dev/null @@ -1,71 +0,0 @@ -package datadog.trace.core.util - -import datadog.trace.api.time.ControllableTimeSource -import datadog.trace.test.util.DDSpecification - -import java.util.concurrent.TimeUnit - -class SimpleRateLimiterTest extends DDSpecification { - def "initial rate available at creation"() { - setup: - def timeSource = new ControllableTimeSource() - def limiter = new SimpleRateLimiter(rate, timeSource) - - when: - rate.times { - assert limiter.tryAcquire(): "failed for $it" - } - - then: - assert !limiter.tryAcquire() - - where: - rate << [10, 100, 1000] - } - - def "tokens never go beyond rate"() { - setup: - def timeSource = new ControllableTimeSource() - def limiter = new SimpleRateLimiter(rate, timeSource) - - when: - timeSource.advance(TimeUnit.SECONDS.toNanos(5)) - rate.times { - assert limiter.tryAcquire(): "failed for $it" - } - - then: - assert !limiter.tryAcquire() - - where: - rate << [10, 100, 1000] - } - - def "tokens are consumed and replenished"() { - setup: - def timeSource = new ControllableTimeSource() - def limiter = new SimpleRateLimiter(rate, timeSource) - long nanosIncrement = (long) (TimeUnit.SECONDS.toNanos(1) / (rate + 1)) + 1 - - when: - rate.times { - timeSource.advance(nanosIncrement) - assert limiter.tryAcquire(): "failed for $it" - } - - then: - assert !limiter.tryAcquire() - - when: - rate.times { - timeSource.advance(nanosIncrement) - assert limiter.tryAcquire(): "failed for $it" - } - - then: - assert !limiter.tryAcquire() - - where: - rate << [10, 100, 1000] - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/core/util/SystemAccessTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/core/util/SystemAccessTest.groovy deleted file mode 100644 index 4f908c1862a..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/core/util/SystemAccessTest.groovy +++ /dev/null @@ -1,56 +0,0 @@ -package datadog.trace.core.util - -import datadog.trace.test.util.DDSpecification - -import static datadog.trace.api.config.GeneralConfig.HEALTH_METRICS_ENABLED -import static datadog.trace.api.config.ProfilingConfig.PROFILING_ENABLED - -class SystemAccessTest extends DDSpecification { - def cleanup() { - SystemAccess.disableJmx() - } - - def "Test cpu time"() { - setup: - injectSysConfig(PROFILING_ENABLED, profilingEnabled.toString()) - injectSysConfig(HEALTH_METRICS_ENABLED, healthMetricsEnabled.toString()) - - if (providerEnabled) { - SystemAccess.enableJmx() - } else { - SystemAccess.disableJmx() - } - - when: - def threadCpuTime1 = SystemAccess.getCurrentThreadCpuTime() - // burn some cpu - def sum = 0 - for (int i = 0; i < 10_000; i++) { - sum += i - } - def threadCpuTime2 = SystemAccess.getCurrentThreadCpuTime() - - then: - sum > 0 - - if (hasCpuTime) { - assert threadCpuTime1 != Long.MIN_VALUE - assert threadCpuTime2 != Long.MIN_VALUE - assert threadCpuTime2 > threadCpuTime1 - } else { - assert threadCpuTime1 == Long.MIN_VALUE - assert threadCpuTime2 == Long.MIN_VALUE - } - - where: - providerEnabled | profilingEnabled | healthMetricsEnabled | hasCpuTime - false | false | false | false - false | false | true | false - false | true | false | false - false | true | true | false - true | false | false | false - true | false | true | true - true | true | false | true - true | true | true | true - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/lambda/LambdaAppSecHandlerTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/lambda/LambdaAppSecHandlerTest.groovy deleted file mode 100644 index 81410905dc3..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/lambda/LambdaAppSecHandlerTest.groovy +++ /dev/null @@ -1,1447 +0,0 @@ -package datadog.trace.lambda - -import datadog.trace.api.Config -import datadog.trace.api.function.TriConsumer -import datadog.trace.api.function.TriFunction -import datadog.trace.api.gateway.CallbackProvider -import datadog.trace.api.gateway.Flow -import datadog.trace.api.gateway.RequestContext -import datadog.trace.api.gateway.RequestContextSlot -import datadog.trace.bootstrap.ActiveSubsystems -import datadog.trace.bootstrap.instrumentation.api.AgentSpan -import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext -import datadog.trace.bootstrap.instrumentation.api.AgentTracer -import datadog.trace.bootstrap.instrumentation.api.TagContext -import datadog.trace.bootstrap.instrumentation.api.URIDataAdapter -import datadog.trace.core.test.DDCoreSpecification -import spock.lang.Shared - -import java.nio.charset.StandardCharsets -import java.util.function.BiFunction -import java.util.function.Function -import java.util.function.Supplier - -import static datadog.trace.api.gateway.Events.EVENTS - -class LambdaAppSecHandlerTest extends DDCoreSpecification { - - @Shared - def originalAppSecActive - - @Shared - AgentTracer.TracerAPI originalTracer - - def setupSpec() { - originalAppSecActive = ActiveSubsystems.APPSEC_ACTIVE - originalTracer = AgentTracer.get() - } - - def cleanupSpec() { - ActiveSubsystems.APPSEC_ACTIVE = originalAppSecActive - } - - def setup() { - ActiveSubsystems.APPSEC_ACTIVE = true - } - - def "processRequestStart returns null when AppSec is disabled"() { - given: - ActiveSubsystems.APPSEC_ACTIVE = false - def event = createInputStream('{"test": "data"}') - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result == null - } - - def "processRequestStart returns null for non-ByteArrayInputStream"() { - when: - def result = LambdaAppSecHandler.processRequestStart("not a stream") - - then: - result == null - } - - def "processRequestStart returns null for null event"() { - when: - def result = LambdaAppSecHandler.processRequestStart(null) - - then: - result == null - } - - def "processRequestStart returns null for oversized event"() { - given: - def maxSize = Config.get().getAppSecBodyParsingSizeLimit() - def largeBody = "x" * (maxSize + 1) - def event = createInputStream(largeBody) - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result == null - } - - def "processRequestStart returns null for zero-size event"() { - given: - def event = createInputStream('') - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result == null - } - - def "processRequestStart returns null for malformed JSON"() { - given: - def event = createInputStream('{invalid json') - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result == null - } - - def "stream can be read multiple times after processing"() { - given: - def jsonData = '{"test": "data", "requestContext": {"httpMethod": "GET"}}' - def event = createInputStream(jsonData) - - when: - LambdaAppSecHandler.processRequestStart(event) - event.reset() - def content = new String(event.bytes, StandardCharsets.UTF_8) - - then: - content == jsonData - } - - - // ============================================================================ - // Trigger Type Detection Tests - // ============================================================================ - - def "detects API Gateway v1 REST trigger type"() { - given: - def event = [ - requestContext: [ - httpMethod: "GET", - requestId: "abc123" - ] - ] - - when: - def triggerType = LambdaAppSecHandler.detectTriggerType(event) - - then: - triggerType == LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V1_REST - } - - def "detects API Gateway v2 HTTP trigger type"() { - given: - def event = [ - requestContext: [ - http: [ - method: "POST", - path: "/api" - ], - domainName: "api.example.com" - ] - ] - - when: - def triggerType = LambdaAppSecHandler.detectTriggerType(event) - - then: - triggerType == LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V2_HTTP - } - - def "detects Lambda Function URL trigger type"() { - given: - def event = [ - requestContext: [ - http: [ - method: "GET", - path: "/" - ], - domainName: "xyz123.lambda-url.us-east-1.on.aws" - ] - ] - - when: - def triggerType = LambdaAppSecHandler.detectTriggerType(event) - - then: - triggerType == LambdaAppSecHandler.LambdaTriggerType.LAMBDA_URL - } - - def "detects ALB trigger type without multi-value headers"() { - given: - def event = [ - httpMethod: "GET", - path: "/", - requestContext: [ - elb: [ - targetGroupArn: "arn:aws:..." - ] - ] - ] - - when: - def triggerType = LambdaAppSecHandler.detectTriggerType(event) - - then: - triggerType == LambdaAppSecHandler.LambdaTriggerType.ALB - } - - def "detects ALB trigger type with multi-value headers"() { - given: - def event = [ - httpMethod: "GET", - path: "/", - multiValueHeaders: [ - accept: ["text/html", "application/json"] - ], - requestContext: [ - elb: [ - targetGroupArn: "arn:aws:..." - ] - ] - ] - - when: - def triggerType = LambdaAppSecHandler.detectTriggerType(event) - - then: - triggerType == LambdaAppSecHandler.LambdaTriggerType.ALB_MULTI_VALUE - } - - def "detects WebSocket trigger type with routeKey"() { - given: - def event = [ - requestContext: [ - connectionId: "conn-123", - routeKey: "\$connect" - ] - ] - - when: - def triggerType = LambdaAppSecHandler.detectTriggerType(event) - - then: - triggerType == LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V2_WEBSOCKET - } - - def "detects WebSocket trigger type with eventType"() { - given: - def event = [ - requestContext: [ - connectionId: "conn-456", - eventType: "CONNECT" - ] - ] - - when: - def triggerType = LambdaAppSecHandler.detectTriggerType(event) - - then: - triggerType == LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V2_WEBSOCKET - } - - def "detects unknown trigger type for unrecognized events"() { - given: - def event = [ - someUnknownField: "value" - ] - - when: - def triggerType = LambdaAppSecHandler.detectTriggerType(event) - - then: - triggerType == LambdaAppSecHandler.LambdaTriggerType.UNKNOWN - } - - def "detects unknown trigger type for empty requestContext"() { - given: - def event = [ - requestContext: [:] - ] - - when: - def triggerType = LambdaAppSecHandler.detectTriggerType(event) - - then: - triggerType == LambdaAppSecHandler.LambdaTriggerType.UNKNOWN - } - - def "detects Lambda URL when http present but no domainName"() { - given: - def event = [ - requestContext: [ - http: [ - method: "GET", - path: "/ambiguous" - ] - ] - ] - - when: - def triggerType = LambdaAppSecHandler.detectTriggerType(event) - - then: - triggerType == LambdaAppSecHandler.LambdaTriggerType.LAMBDA_URL - } - - // ============================================================================ - // Data Extraction Tests with Mocked Callbacks - // ============================================================================ - - def "extracts API Gateway v1 REST data correctly"() { - given: - def eventJson = ''' - { - "path": "/api/users/123", - "httpMethod": "POST", - "headers": { - "Content-Type": "application/json", - "Authorization": "Bearer token123" - }, - "pathParameters": { - "userId": "123" - }, - "body": "{\\"name\\": \\"John\\"}", - "requestContext": { - "httpMethod": "POST", - "requestId": "req-123", - "identity": { - "sourceIp": "192.168.1.100" - } - } - } - ''' - def event = createInputStream(eventJson) - - // Track callback invocations - def capturedMethod = null - def capturedPath = null - def capturedHeaders = [:] - def capturedSourceIp = null - def capturedSourcePort = null - def capturedPathParams = null - def capturedBody = null - - setupMockCallbacks( - onMethodUri: { method, uri -> - capturedMethod = method - capturedPath = uri.path() - }, - onHeader: { name, value -> - capturedHeaders[name] = value - }, - onSocketAddress: { ip, port -> - capturedSourceIp = ip - capturedSourcePort = port - }, - onPathParams: { params -> - capturedPathParams = params - }, - onBody: { body -> - capturedBody = body - } - ) - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result != null - result instanceof TagContext - - capturedMethod == "POST" - capturedPath == "/api/users/123" - capturedHeaders["Content-Type"] == "application/json" - capturedHeaders["Authorization"] == "Bearer token123" - capturedSourceIp == "192.168.1.100" - capturedSourcePort == 0 - capturedPathParams == ["userId": "123"] - capturedBody instanceof Map - capturedBody.name == "John" - } - - def "extracts API Gateway v2 HTTP data correctly"() { - given: - def eventJson = ''' - { - "version": "2.0", - "headers": { - "content-type": "application/json", - "x-custom-header": "custom-value" - }, - "cookies": ["session=abc123", "user=john"], - "pathParameters": { - "id": "456" - }, - "body": "test body", - "requestContext": { - "http": { - "method": "PUT", - "path": "/api/items/456", - "sourceIp": "10.0.0.50", - "sourcePort": 54321 - }, - "domainName": "api.example.com" - } - } - ''' - def event = createInputStream(eventJson) - - def capturedMethod = null - def capturedPath = null - def capturedHeaders = [:] - def capturedSourceIp = null - def capturedSourcePort = null - def capturedPathParams = null - - setupMockCallbacks( - onMethodUri: { method, uri -> - capturedMethod = method - capturedPath = uri.path() - }, - onHeader: { name, value -> - capturedHeaders[name] = value - }, - onSocketAddress: { ip, port -> - capturedSourceIp = ip - capturedSourcePort = port - }, - onPathParams: { params -> - capturedPathParams = params - } - ) - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result != null - capturedMethod == "PUT" - capturedPath == "/api/items/456" - capturedHeaders["content-type"] == "application/json" - capturedHeaders["x-custom-header"] == "custom-value" - capturedHeaders["cookie"] == "session=abc123; user=john" - capturedSourceIp == "10.0.0.50" - capturedSourcePort == 54321 - capturedPathParams == ["id": "456"] - } - - def "extracts Lambda Function URL data correctly"() { - given: - def eventJson = ''' - { - "version": "2.0", - "headers": { - "host": "xyz.lambda-url.us-east-1.on.aws" - }, - "requestContext": { - "http": { - "method": "GET", - "path": "/function/path", - "sourceIp": "1.2.3.4" - }, - "domainName": "xyz.lambda-url.us-east-1.on.aws" - } - } - ''' - def event = createInputStream(eventJson) - - def capturedMethod = null - def capturedPath = null - - setupMockCallbacks( - onMethodUri: { method, uri -> - capturedMethod = method - capturedPath = uri.path() - } - ) - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result != null - capturedMethod == "GET" - capturedPath == "/function/path" - } - - def "extracts ALB data correctly"() { - given: - def eventJson = ''' - { - "path": "/alb/test", - "httpMethod": "DELETE", - "headers": { - "x-forwarded-for": "203.0.113.42", - "user-agent": "curl/7.64.1" - }, - "requestContext": { - "elb": { - "targetGroupArn": "arn:aws:elasticloadbalancing:us-east-1:123456789012:targetgroup/my-target-group/50dc6c495c0c9188" - } - } - } - ''' - def event = createInputStream(eventJson) - - def capturedMethod = null - def capturedPath = null - def capturedSourceIp = null - - setupMockCallbacks( - onMethodUri: { method, uri -> - capturedMethod = method - capturedPath = uri.path() - }, - onSocketAddress: { ip, port -> - capturedSourceIp = ip - } - ) - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result != null - capturedMethod == "DELETE" - capturedPath == "/alb/test" - capturedSourceIp == "203.0.113.42" - } - - def "extracts ALB multi-value headers correctly"() { - given: - def eventJson = ''' - { - "path": "/test", - "httpMethod": "GET", - "multiValueHeaders": { - "accept": ["text/html", "application/json"], - "x-custom": ["value1", "value2"] - }, - "requestContext": { - "elb": { - "targetGroupArn": "arn:aws:..." - } - } - } - ''' - def event = createInputStream(eventJson) - - def capturedHeaders = [:] - - setupMockCallbacks( - onHeader: { name, value -> - capturedHeaders[name] = value - } - ) - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result != null - capturedHeaders["accept"] == "text/html, application/json" - capturedHeaders["x-custom"] == "value1, value2" - } - - def "handles multi-value headers with empty list"() { - given: - def eventJson = ''' - { - "path": "/test", - "httpMethod": "GET", - "multiValueHeaders": { - "accept": [], - "x-custom": ["value1"] - }, - "requestContext": { - "elb": { - "targetGroupArn": "arn:aws:..." - } - } - } - ''' - def event = createInputStream(eventJson) - - def capturedHeaders = [:] - - setupMockCallbacks( - onHeader: { name, value -> - capturedHeaders[name] = value - } - ) - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result != null - capturedHeaders["accept"] == "" // Empty list should result in empty string - capturedHeaders["x-custom"] == "value1" - } - - def "extracts WebSocket data correctly"() { - given: - def eventJson = ''' - { - "requestContext": { - "routeKey": "$connect", - "connectionId": "conn-abc123", - "identity": { - "sourceIp": "192.168.0.100" - } - } - } - ''' - def event = createInputStream(eventJson) - - def capturedMethod = null - def capturedPath = null - def capturedSourceIp = null - - setupMockCallbacks( - onMethodUri: { method, uri -> - capturedMethod = method - capturedPath = uri.path() - }, - onSocketAddress: { ip, port -> - capturedSourceIp = ip - } - ) - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result != null - capturedMethod == "WEBSOCKET" - capturedPath == "\$connect" - capturedSourceIp == "192.168.0.100" - } - - def "handles base64 encoded body correctly"() { - given: - def originalBody = "This is test data" - def base64Body = Base64.getEncoder().encodeToString(originalBody.getBytes()) - def eventJson = """ - { - "body": "${base64Body}", - "isBase64Encoded": true, - "requestContext": { - "httpMethod": "POST" - } - } - """ - def event = createInputStream(eventJson) - - def capturedBody = null - - setupMockCallbacks( - onBody: { body -> - capturedBody = body - } - ) - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result != null - capturedBody == originalBody - } - - def "handles null body correctly"() { - given: - def event = createInputStream('{"body": null, "requestContext": {"httpMethod": "GET"}}') - - def capturedBody = "NOT_CALLED" - - setupMockCallbacks( - onBody: { body -> - capturedBody = body - } - ) - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result != null - capturedBody == "NOT_CALLED" // Callback should not be invoked for null body - } - - def "handles empty body correctly"() { - given: - def event = createInputStream('{"body": "", "requestContext": {"httpMethod": "POST"}}') - - def capturedBody = null - - setupMockCallbacks( - onBody: { body -> - capturedBody = body - } - ) - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result != null - capturedBody == "" // Empty body is passed as empty string to WAF - } - - def "handles path with query string correctly"() { - given: - def eventJson = ''' - { - "path": "/api/users?id=123&filter=active", - "requestContext": { - "httpMethod": "GET" - } - } - ''' - def event = createInputStream(eventJson) - - def capturedPath = null - def capturedQuery = null - - setupMockCallbacks( - onMethodUri: { method, uri -> - capturedPath = uri.path() - capturedQuery = uri.query() - } - ) - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result != null - capturedPath == "/api/users" - capturedQuery == "id=123&filter=active" - } - - def "extracts scheme and port from X-Forwarded headers"() { - given: - def eventJson = ''' - { - "path": "/api/test", - "headers": { - "x-forwarded-proto": "http", - "x-forwarded-port": "8080" - }, - "requestContext": { - "httpMethod": "GET", - "requestId": "req-123" - } - } - ''' - def event = createInputStream(eventJson) - - def capturedScheme = null - def capturedPort = null - - setupMockCallbacks( - onMethodUri: { method, uri -> - capturedScheme = uri.scheme() - capturedPort = uri.port() - } - ) - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result != null - capturedScheme == "http" - capturedPort == 8080 - } - - def "falls back to https/443 when X-Forwarded headers are absent"() { - given: - def eventJson = ''' - { - "path": "/api/test", - "headers": {}, - "requestContext": { - "httpMethod": "GET", - "requestId": "req-123" - } - } - ''' - def event = createInputStream(eventJson) - - def capturedScheme = null - def capturedPort = null - - setupMockCallbacks( - onMethodUri: { method, uri -> - capturedScheme = uri.scheme() - capturedPort = uri.port() - } - ) - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result != null - capturedScheme == "https" - capturedPort == 443 - } - - def "handles invalid X-Forwarded-Port gracefully"() { - given: - def eventJson = ''' - { - "path": "/api/test", - "headers": { - "x-forwarded-proto": "https", - "x-forwarded-port": "not-a-number" - }, - "requestContext": { - "httpMethod": "GET", - "requestId": "req-123" - } - } - ''' - def event = createInputStream(eventJson) - - def capturedScheme = null - def capturedPort = null - - setupMockCallbacks( - onMethodUri: { method, uri -> - capturedScheme = uri.scheme() - capturedPort = uri.port() - } - ) - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result != null - capturedScheme == "https" - capturedPort == 443 - } - - def "handles invalid base64 body gracefully"() { - given: - def eventJson = ''' - { - "body": "not-valid-base64", - "isBase64Encoded": true, - "requestContext": { - "httpMethod": "POST" - } - } - ''' - def event = createInputStream(eventJson) - - def capturedBody = "NOT_CALLED" - - setupMockCallbacks( - onBody: { body -> - capturedBody = body - } - ) - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result != null - capturedBody == "NOT_CALLED" // Should not call body callback when decode fails - } - - def "handles base64 decoded empty string body"() { - given: - def base64Empty = Base64.getEncoder().encodeToString("".getBytes()) - def eventJson = """ - { - "body": "${base64Empty}", - "isBase64Encoded": true, - "requestContext": { - "httpMethod": "POST" - } - } - """ - def event = createInputStream(eventJson) - - def capturedBody = "NOT_CALLED" - - setupMockCallbacks( - onBody: { body -> - capturedBody = body - } - ) - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result != null - capturedBody == "" // Should pass empty string after decoding - } - - def "handles body with special characters"() { - given: - def eventJson = ''' - { - "body": "{\\"text\\": \\"Hello 世界 🌍\\"}", - "requestContext": { - "httpMethod": "POST" - } - } - ''' - def event = createInputStream(eventJson) - - def capturedBody = null - - setupMockCallbacks( - onBody: { body -> - capturedBody = body - } - ) - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result != null - capturedBody instanceof Map - capturedBody.text == "Hello 世界 🌍" - } - - // ============================================================================ - // Generic Data Extraction Tests - // ============================================================================ - - def "extracts data from unknown trigger type using generic extraction"() { - given: - def eventJson = ''' - { - "path": "/generic/path", - "httpMethod": "PATCH", - "headers": { - "x-custom-header": "generic-value" - }, - "unknownField": "should be ignored", - "requestContext": { - "identity": { - "sourceIp": "203.0.113.1" - } - } - } - ''' - def event = createInputStream(eventJson) - - def capturedMethod = null - def capturedPath = null - def capturedHeaders = [:] - def capturedSourceIp = null - - setupMockCallbacks( - onMethodUri: { method, uri -> - capturedMethod = method - capturedPath = uri.path() - }, - onHeader: { name, value -> - capturedHeaders[name] = value - }, - onSocketAddress: { ip, port -> - capturedSourceIp = ip - } - ) - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result != null - capturedMethod == "PATCH" - capturedPath == "/generic/path" - capturedHeaders["x-custom-header"] == "generic-value" - capturedSourceIp == "203.0.113.1" - } - - def "extracts data from unknown trigger with http in requestContext"() { - given: - def eventJson = ''' - { - "requestContext": { - "http": { - "method": "OPTIONS", - "path": "/options/path", - "sourceIp": "198.51.100.50" - } - } - } - ''' - def event = createInputStream(eventJson) - - def capturedMethod = null - def capturedPath = null - def capturedSourceIp = null - - setupMockCallbacks( - onMethodUri: { method, uri -> - capturedMethod = method - capturedPath = uri.path() - }, - onSocketAddress: { ip, port -> - capturedSourceIp = ip - } - ) - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result != null - capturedMethod == "OPTIONS" - capturedPath == "/options/path" - capturedSourceIp == "198.51.100.50" - } - - def "handles cookies merging with existing cookie header"() { - given: - def eventJson = ''' - { - "headers": { - "cookie": "existing=value" - }, - "cookies": ["new=cookie1", "another=cookie2"], - "requestContext": { - "http": { - "method": "GET", - "path": "/" - } - } - } - ''' - def event = createInputStream(eventJson) - - def capturedHeaders = [:] - - setupMockCallbacks( - onHeader: { name, value -> - capturedHeaders[name] = value - } - ) - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result != null - capturedHeaders["cookie"] == "existing=value; new=cookie1; another=cookie2" - } - - def "handles empty cookies array correctly"() { - given: - def eventJson = ''' - { - "headers": { - "content-type": "application/json" - }, - "cookies": [], - "requestContext": { - "http": { - "method": "GET", - "path": "/" - } - } - } - ''' - def event = createInputStream(eventJson) - - def capturedHeaders = [:] - - setupMockCallbacks( - onHeader: { name, value -> - capturedHeaders[name] = value - } - ) - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result != null - !capturedHeaders.containsKey("cookie") // Empty array should not add cookie header - } - - // ============================================================================ - // processRequestEnd Tests - // ============================================================================ - - def "processRequestEnd does nothing when span is null"() { - when: - LambdaAppSecHandler.processRequestEnd(null) - - then: - noExceptionThrown() - } - - def "processRequestEnd does nothing when AppSec is disabled"() { - given: - ActiveSubsystems.APPSEC_ACTIVE = false - def span = Mock(AgentSpan) - - when: - LambdaAppSecHandler.processRequestEnd(span) - - then: - 0 * span._ - } - - def "processRequestEnd does nothing when span has no RequestContext"() { - given: - def span = Mock(AgentSpan) { - getRequestContext() >> null - } - - when: - LambdaAppSecHandler.processRequestEnd(span) - - then: - noExceptionThrown() - } - - def "processRequestEnd invokes requestEnded callback with RequestContext"() { - given: - def mockAppSecContext = new Object() - def mockRequestContext = Mock(RequestContext) { - getData(RequestContextSlot.APPSEC) >> mockAppSecContext - } - def span = Mock(AgentSpan) { - getRequestContext() >> mockRequestContext - } - - def callbackInvoked = false - def capturedContext = null - def capturedSpan = null - - def mockRequestEndedCallback = Mock(BiFunction) { - apply(_ as RequestContext, _ as AgentSpan) >> { - RequestContext ctx, AgentSpan s -> - callbackInvoked = true - capturedContext = ctx - capturedSpan = s - return new Flow.ResultFlow<>(null) - } - } - - def mockCallbackProvider = Mock(CallbackProvider) { - getCallback(EVENTS.requestEnded()) >> mockRequestEndedCallback - } - - def mockTracer = Mock(AgentTracer.TracerAPI) { - getCallbackProvider(RequestContextSlot.APPSEC) >> mockCallbackProvider - } - - AgentTracer.forceRegister(mockTracer) - - when: - LambdaAppSecHandler.processRequestEnd(span) - - then: - callbackInvoked - capturedContext == mockRequestContext - capturedSpan == span - } - - def "processRequestEnd handles null requestEnded callback gracefully"() { - given: - def mockRequestContext = Mock(RequestContext) - def span = Mock(AgentSpan) { - getRequestContext() >> mockRequestContext - } - - def mockCallbackProvider = Mock(CallbackProvider) { - getCallback(EVENTS.requestEnded()) >> null - } - - def mockTracer = Mock(AgentTracer.TracerAPI) { - getCallbackProvider(RequestContextSlot.APPSEC) >> mockCallbackProvider - } - - AgentTracer.forceRegister(mockTracer) - - when: - LambdaAppSecHandler.processRequestEnd(span) - - then: - noExceptionThrown() // Should log warning but not throw - } - - // ============================================================================ - // mergeContexts Tests - // ============================================================================ - - def "mergeContexts returns null when both contexts are null"() { - when: - def result = LambdaAppSecHandler.mergeContexts(null, null) - - then: - result == null - } - - def "mergeContexts returns extensionContext when appSecContext is null"() { - given: - def extensionContext = Mock(TagContext) - - when: - def result = LambdaAppSecHandler.mergeContexts(extensionContext, null) - - then: - result == extensionContext - } - - def "mergeContexts returns appSecContext when extensionContext is null"() { - given: - def appSecContext = Mock(TagContext) - - when: - def result = LambdaAppSecHandler.mergeContexts(null, appSecContext) - - then: - result == appSecContext - } - - def "mergeContexts merges AppSec data into TagContext"() { - given: - def appSecData = new Object() - - // Create real TagContext instances since methods are final - def appSecContext = new TagContext() - appSecContext.withRequestContextDataAppSec(appSecData) - - def extensionContext = new TagContext() - - when: - def result = LambdaAppSecHandler.mergeContexts(extensionContext, appSecContext) - - then: - result == extensionContext - result.getRequestContextDataAppSec() == appSecData - } - - def "mergeContexts returns extensionContext when appSecContext is not TagContext"() { - given: - def extensionContext = Mock(TagContext) - def appSecContext = Mock(AgentSpanContext) - - when: - def result = LambdaAppSecHandler.mergeContexts(extensionContext, appSecContext) - - then: - result == extensionContext - } - - def "mergeContexts returns extensionContext when it is not TagContext"() { - given: - def extensionContext = Mock(AgentSpanContext) - def appSecContext = Mock(TagContext) - - when: - def result = LambdaAppSecHandler.mergeContexts(extensionContext, appSecContext) - - then: - result == extensionContext - } - - // ============================================================================ - // Error Handling and Null Callback Tests - // ============================================================================ - - def "processRequestStart handles null requestStarted callback gracefully"() { - given: - def eventJson = '{"requestContext": {"httpMethod": "GET"}}' - def event = createInputStream(eventJson) - - def mockCallbackProvider = Mock(CallbackProvider) { - getCallback(EVENTS.requestStarted()) >> null - } - - def mockTracer = Mock(AgentTracer.TracerAPI) { - getCallbackProvider(RequestContextSlot.APPSEC) >> mockCallbackProvider - } - - AgentTracer.forceRegister(mockTracer) - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result == null // Should return null when requestStarted callback is missing - } - - def "processRequestStart handles null methodUri callback gracefully"() { - given: - def eventJson = ''' - { - "path": "/test", - "requestContext": { - "httpMethod": "GET" - } - } - ''' - def event = createInputStream(eventJson) - - def mockAppSecContext = new Object() - - def mockRequestStartedCallback = Mock(Supplier) { - get() >> new Flow.ResultFlow<>(mockAppSecContext) - } - - def mockCallbackProvider = Mock(CallbackProvider) { - getCallback(EVENTS.requestStarted()) >> mockRequestStartedCallback - getCallback(EVENTS.requestMethodUriRaw()) >> null // Null callback - getCallback(EVENTS.requestHeader()) >> null - getCallback(EVENTS.requestClientSocketAddress()) >> null - getCallback(EVENTS.requestHeaderDone()) >> Mock(Function) { - apply(_ as RequestContext) >> new Flow.ResultFlow<>(null) - } - getCallback(EVENTS.requestPathParams()) >> null - getCallback(EVENTS.requestBodyProcessed()) >> null - } - - def mockTracer = Mock(AgentTracer.TracerAPI) { - getCallbackProvider(RequestContextSlot.APPSEC) >> mockCallbackProvider - } - - AgentTracer.forceRegister(mockTracer) - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result != null // Should continue processing even if methodUri callback is null - result instanceof TagContext - } - - def "processRequestStart handles exception during JSON parsing"() { - given: - def invalidJson = '{this is not valid JSON at all' - def event = createInputStream(invalidJson) - - when: - def result = LambdaAppSecHandler.processRequestStart(event) - - then: - result == null // Should return null on parse error - } - - def "processRequestStart handles exception during stream reading"() { - given: - def mockStream = Mock(ByteArrayInputStream) { - available() >> { throw new IOException("Stream error") } - } - - when: - def result = LambdaAppSecHandler.processRequestStart(mockStream) - - then: - result == null // Should return null on IO error - } - - // ============================================================================ - // Helper Methods - // ============================================================================ - - private ByteArrayInputStream createInputStream(String json) { - return new ByteArrayInputStream(json.getBytes(StandardCharsets.UTF_8)) - } - - /** - * Set up mock callbacks to capture invocations and verify data extraction. - * This mocks the AgentTracer and callback provider to intercept gateway calls. - */ - private void setupMockCallbacks(Map callbacks) { - def mockAppSecContext = new Object() - - def mockRequestStartedCallback = Mock(Supplier) { - get() >> new Flow.ResultFlow<>(mockAppSecContext) - } - - def mockMethodUriCallback = callbacks.onMethodUri ? Mock(TriFunction) { - apply(_ as RequestContext, _ as String, _ as URIDataAdapter) >> { - RequestContext ctx, String method, URIDataAdapter uri -> - callbacks.onMethodUri(method, uri) - return new Flow.ResultFlow<>(null) - } - } : null - - def mockHeaderCallback = callbacks.onHeader ? Mock(TriConsumer) { - accept(_ as RequestContext, _ as String, _ as String) >> { - RequestContext ctx, String name, String value -> - callbacks.onHeader(name, value) - } - } : null - - def mockSocketAddressCallback = callbacks.onSocketAddress ? Mock(TriFunction) { - apply(_ as RequestContext, _ as String, _ as Integer) >> { - RequestContext ctx, String ip, Integer port -> - callbacks.onSocketAddress(ip, port) - return new Flow.ResultFlow<>(null) - } - } : null - - def mockHeaderDoneCallback = Mock(Function) { - apply(_ as RequestContext) >> new Flow.ResultFlow<>(null) - } - - def mockPathParamsCallback = callbacks.onPathParams ? Mock(BiFunction) { - apply(_ as RequestContext, _ as Map) >> { - RequestContext ctx, Map params -> - callbacks.onPathParams(params) - return new Flow.ResultFlow<>(null) - } - } : null - - def mockBodyCallback = callbacks.onBody ? Mock(BiFunction) { - apply(_ as RequestContext, _ as Object) >> { - RequestContext ctx, Object body -> - callbacks.onBody(body) - return new Flow.ResultFlow<>(null) - } - } : null - - def mockCallbackProvider = Mock(CallbackProvider) { - getCallback(EVENTS.requestStarted()) >> mockRequestStartedCallback - getCallback(EVENTS.requestMethodUriRaw()) >> mockMethodUriCallback - getCallback(EVENTS.requestHeader()) >> mockHeaderCallback - getCallback(EVENTS.requestClientSocketAddress()) >> mockSocketAddressCallback - getCallback(EVENTS.requestHeaderDone()) >> mockHeaderDoneCallback - getCallback(EVENTS.requestPathParams()) >> mockPathParamsCallback - getCallback(EVENTS.requestBodyProcessed()) >> mockBodyCallback - } - - def mockTracer = Mock(AgentTracer.TracerAPI) { - getCallbackProvider(RequestContextSlot.APPSEC) >> mockCallbackProvider - } - - // Install the mock tracer - AgentTracer.forceRegister(mockTracer) - } - - def cleanup() { - AgentTracer.forceRegister(originalTracer) - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/lambda/LambdaHandlerTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/lambda/LambdaHandlerTest.groovy deleted file mode 100644 index ab8b188eb8b..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/lambda/LambdaHandlerTest.groovy +++ /dev/null @@ -1,330 +0,0 @@ -package datadog.trace.lambda - -import datadog.trace.api.DDSpanId -import datadog.trace.api.DDTags -import datadog.trace.api.DDTraceId -import datadog.trace.core.CoreTracer -import datadog.trace.core.test.DDCoreSpecification -import datadog.trace.core.DDSpan -import com.amazonaws.services.lambda.runtime.events.SQSEvent -import com.amazonaws.services.lambda.runtime.events.SNSEvent -import com.amazonaws.services.lambda.runtime.events.S3Event -import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent -import com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification - -import static datadog.trace.agent.test.server.http.TestHttpServer.httpServer - -class LambdaHandlerTest extends DDCoreSpecification { - - class TestObject { - - public String field1 - public boolean field2 - - TestObject() { - this.field1 = "toto" - this.field2 = true - } - - @Override - String toString() { - "$field1 / $field2}" - } - } - - def "test start invocation success"() { - given: - CoreTracer ct = tracerBuilder().build() - - def server = httpServer { - handlers { - post("/lambda/start-invocation") { - response - .status(200) - .addHeader("x-datadog-trace-id", "1234") - .addHeader("x-datadog-sampling-priority", "2") - .send() - } - } - } - LambdaHandler.setExtensionBaseUrl(server.address.toString()) - - when: - def objTest = LambdaHandler.notifyStartInvocation(obj, "lambda-request-123") - - then: - objTest.getTraceId().toString() == traceId - objTest.getSamplingPriority() == samplingPriority - server.lastRequest.headers.get("lambda-runtime-aws-request-id") == "lambda-request-123" - - cleanup: - server.close() - ct.close() - - where: - traceId | samplingPriority | obj - "1234" | 2 | new TestObject() - } - - def "test start invocation with 128 bit trace ID"() { - given: - CoreTracer ct = tracerBuilder().build() - - def server = httpServer { - handlers { - post("/lambda/start-invocation") { - response - .status(200) - .addHeader("x-datadog-trace-id", "5744042798732701615") - .addHeader("x-datadog-sampling-priority", "2") - .addHeader("x-datadog-tags", "_dd.p.tid=1914fe7789eb32be") - .send() - } - } - } - LambdaHandler.setExtensionBaseUrl(server.address.toString()) - - when: - def objTest = LambdaHandler.notifyStartInvocation(obj, "lambda-request-123") - - then: - objTest.getTraceId().toHexString() == traceId - objTest.getSamplingPriority() == samplingPriority - server.lastRequest.headers.get("lambda-runtime-aws-request-id") == "lambda-request-123" - - cleanup: - server.close() - ct.close() - - where: - traceId | samplingPriority | obj - "1914fe7789eb32be4fb6f07e011a6faf" | 2 | new TestObject() - } - - def "test start invocation failure"() { - given: - CoreTracer ct = tracerBuilder().build() - - def server = httpServer { - handlers { - post("/lambda/start-invocation") { - response - .status(500) - .send() - } - } - } - LambdaHandler.setExtensionBaseUrl(server.address.toString()) - - when: - def objTest = LambdaHandler.notifyStartInvocation(obj, "my-lambda-request") - - then: - objTest == expected - server.lastRequest.headers.get("lambda-runtime-aws-request-id") == "my-lambda-request" - - cleanup: - server.close() - ct.close() - - where: - expected | obj - null | new TestObject() - } - - def "test end invocation success"() { - given: - def server = httpServer { - handlers { - post("/lambda/end-invocation") { - response - .status(200) - .send() - } - } - } - LambdaHandler.setExtensionBaseUrl(server.address.toString()) - DDSpan span = Mock(DDSpan) { - getTraceId() >> DDTraceId.from("1234") - getSpanId() >> DDSpanId.from("5678") - getSamplingPriority() >> 2 - } - - when: - def result = LambdaHandler.notifyEndInvocation(span, lambdaResult, boolValue, lambdaReqIdHeaderValue) - - then: - server.lastRequest.headers.get("x-datadog-invocation-error") == eHeaderValue - server.lastRequest.headers.get("x-datadog-trace-id") == tIdHeaderValue - server.lastRequest.headers.get("x-datadog-span-id") == sIdHeaderValue - server.lastRequest.headers.get("x-datadog-sampling-priority") == sPIdHeaderValue - server.lastRequest.headers.get("lambda-runtime-aws-request-id") == lambdaReqIdHeaderValue - result == expected - - cleanup: - server.close() - - where: - expected | eHeaderValue | tIdHeaderValue | sIdHeaderValue | sPIdHeaderValue | lambdaResult | boolValue | lambdaReqIdHeaderValue - true | "true" | "1234" | "5678" | "2" | {} | true | "request123" - true | null | "1234" | "5678" | "2" | "12345" | false | "request456" - } - - def "test end invocation failure"() { - given: - def server = httpServer { - handlers { - post("/lambda/end-invocation") { - response - .status(500) - .send() - } - } - } - LambdaHandler.setExtensionBaseUrl(server.address.toString()) - DDSpan span = Mock(DDSpan) { - getTraceId() >> DDTraceId.from("1234") - getSpanId() >> DDSpanId.from("5678") - getSamplingPriority() >> 2 - } - - when: - def result = LambdaHandler.notifyEndInvocation(span, lambdaResult, boolValue, lambdaReqIdHeaderValue) - - then: - result == expected - server.lastRequest.headers.get("x-datadog-invocation-error") == headerValue - server.lastRequest.headers.get("lambda-runtime-aws-request-id") == lambdaReqIdHeaderValue - - cleanup: - server.close() - - where: - expected | headerValue | lambdaResult | boolValue | lambdaReqIdHeaderValue - false | "true" | {} | true | "request123" - false | null | "12345" | false | "request456" - } - - def "test end invocation success with error metadata"() { - given: - def server = httpServer { - handlers { - post("/lambda/end-invocation") { - response - .status(200) - .send() - } - } - } - LambdaHandler.setExtensionBaseUrl(server.address.toString()) - DDSpan span = Mock(DDSpan) { - getTraceId() >> DDTraceId.from("1234") - getSpanId() >> DDSpanId.from("5678") - getSamplingPriority() >> 2 - getTag(DDTags.ERROR_MSG) >> "custom error message" - getTag(DDTags.ERROR_TYPE) >> "java.lang.Throwable" - getTag(DDTags.ERROR_STACK) >> "errorStack\n \ttest" - } - - when: - LambdaHandler.notifyEndInvocation(span, {}, true, "lambda-request-123") - - then: - server.lastRequest.headers.get("x-datadog-invocation-error") == "true" - server.lastRequest.headers.get("x-datadog-invocation-error-msg") == "custom error message" - server.lastRequest.headers.get("x-datadog-invocation-error-type") == "java.lang.Throwable" - server.lastRequest.headers.get("x-datadog-invocation-error-stack") == "ZXJyb3JTdGFjawogCXRlc3Q=" - server.lastRequest.headers.get("lambda-runtime-aws-request-id") == "lambda-request-123" - - cleanup: - server.close() - } - - def "test moshi toJson SQSEvent"() { - given: - def myEvent = new SQSEvent() - List records = new ArrayList<>() - SQSEvent.SQSMessage message = new SQSEvent.SQSMessage() - message.setMessageId("myId") - message.setAwsRegion("myRegion") - records.add(message) - myEvent.setRecords(records) - - when: - def result = LambdaHandler.writeValueAsString(myEvent) - - then: - result == "{\"records\":[{\"awsRegion\":\"myRegion\",\"messageId\":\"myId\"}]}" - } - - def "test moshi toJson S3Event"() { - given: - List list = new ArrayList<>() - S3EventNotification.S3EventNotificationRecord item0 = new S3EventNotification.S3EventNotificationRecord( - "region", "eventName", "mySource", null, "3.4", - null, null, null, null) - list.add(item0) - def myEvent = new S3Event(list) - - when: - def result = LambdaHandler.writeValueAsString(myEvent) - - then: - result == "{\"records\":[{\"awsRegion\":\"region\",\"eventName\":\"eventName\",\"eventSource\":\"mySource\",\"eventVersion\":\"3.4\"}]}" - } - - def "test moshi toJson SNSEvent"() { - given: - def myEvent = new SNSEvent() - List records = new ArrayList<>() - SNSEvent.SNSRecord message = new SNSEvent.SNSRecord() - message.setEventSource("mySource") - message.setEventVersion("myVersion") - records.add(message) - myEvent.setRecords(records) - - when: - def result = LambdaHandler.writeValueAsString(myEvent) - - then: - result == "{\"records\":[{\"eventSource\":\"mySource\",\"eventVersion\":\"myVersion\"}]}" - } - - def "test moshi toJson APIGatewayProxyRequestEvent"() { - given: - def myEvent = new APIGatewayProxyRequestEvent() - myEvent.setBody("bababango") - myEvent.setHttpMethod("POST") - - when: - def result = LambdaHandler.writeValueAsString(myEvent) - - then: - result == "{\"body\":\"bababango\",\"httpMethod\":\"POST\"}" - } - - def "test moshi toJson InputStream"() { - given: - def body = "{\"body\":\"bababango\",\"httpMethod\":\"POST\"}" - def myEvent = new ByteArrayInputStream(body.getBytes()) - - when: - def result = LambdaHandler.writeValueAsString(myEvent) - - then: - result == body - } - - def "test moshi toJson OutputStream"() { - given: - def body = "{\"body\":\"bababango\",\"statusCode\":\"200\"}" - def myEvent = new ByteArrayOutputStream() - myEvent.write(body.getBytes(), 0, body.length()) - - when: - def result = LambdaHandler.writeValueAsString(myEvent) - - then: - result == body - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/lambda/SkipTypeJsonSerializerTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/lambda/SkipTypeJsonSerializerTest.groovy deleted file mode 100644 index ab1712bb308..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/lambda/SkipTypeJsonSerializerTest.groovy +++ /dev/null @@ -1,184 +0,0 @@ -package datadog.trace.lambda - -import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent -import com.amazonaws.services.lambda.runtime.events.SNSEvent -import com.amazonaws.services.lambda.runtime.events.SQSEvent -import datadog.trace.core.test.DDCoreSpecification -import com.squareup.moshi.Moshi - -abstract class AbstractSerialize { - public String randomString -} - -class SubClass extends AbstractSerialize { - SubClass() { - this.randomString = "tutu" - } -} - -class CustomRequest

      extends LambdaRequest { - public P path - public B body -} -interface ApiRequestPath {} -class LambdaRequest { - public boolean testBool - public String emptyStr - public Map emptyHeaders -} - -class SkipUnhandledTypeJsonSerializerTest extends DDCoreSpecification { - - static class TestJsonObject { - - public String field1 - public boolean field2 - public AbstractSerialize field3 - public NestedJsonObject field4 - public ByteArrayInputStream field5 - - TestJsonObject() { - this.field1 = "toto" - this.field2 = true - this.field3 = new SubClass() - this.field4 = new NestedJsonObject() - this.field5 = new ByteArrayInputStream() - } - } - - static class NestedJsonObject { - - public AbstractSerialize field - - NestedJsonObject() { - this.field = new SubClass() - } - } - - def "test string serialization"() { - given: - def adapter = new Moshi.Builder() - .add(SkipUnsupportedTypeJsonAdapter.newFactory()) - .build() - .adapter(Object) - - when: - def result = adapter.toJson(new TestJsonObject()) - - then: - result == "{\"field1\":\"toto\",\"field2\":true,\"field3\":{},\"field4\":{\"field\":{}},\"field5\":{}}" - } - - def "test simple case"() { - given: - def adapter = new Moshi.Builder() - .add(SkipUnsupportedTypeJsonAdapter.newFactory()) - .build() - .adapter(Object) - - when: - def list = new LinkedHashMap() - list.put("key0","item0") - list.put("key1","item1") - list.put("key2","item2") - def result = adapter.toJson(list) - - then: - result == "{\"key0\":\"item0\",\"key1\":\"item1\",\"key2\":\"item2\"}" - } - - def "test SQS event "() { - given: - def adapter = new Moshi.Builder() - .add(SkipUnsupportedTypeJsonAdapter.newFactory()) - .build() - .adapter(Object) - - when: - def myEvent = new SQSEvent() - List records = new ArrayList<>() - SQSEvent.SQSMessage message = new SQSEvent.SQSMessage() - message.setMessageId("myId") - message.setAwsRegion("myRegion") - records.add(message) - myEvent.setRecords(records) - def result = adapter.toJson(myEvent) - - then: - result == "{\"records\":[{\"awsRegion\":\"myRegion\",\"messageId\":\"myId\"}]}" - } - - def "test SNS Event"() { - given: - def adapter = new Moshi.Builder() - .add(SkipUnsupportedTypeJsonAdapter.newFactory()) - .build() - .adapter(Object) - - when: - def myEvent = new SNSEvent() - List records = new ArrayList<>() - SNSEvent.SNSRecord message = new SNSEvent.SNSRecord() - message.setEventSource("mySource") - message.setEventVersion("myVersion") - records.add(message) - myEvent.setRecords(records) - def result = adapter.toJson(myEvent) - - then: - result == "{\"records\":[{\"eventSource\":\"mySource\",\"eventVersion\":\"myVersion\"}]}" - } - - def "test APIGatewayProxyRequest Event"() { - given: - def adapter = new Moshi.Builder() - .add(SkipUnsupportedTypeJsonAdapter.newFactory()) - .build() - .adapter(Object) - - when: - def myEvent = new APIGatewayProxyRequestEvent() - myEvent.setBody("bababango") - myEvent.setHttpMethod("POST") - def result = adapter.toJson(myEvent) - - then: - result == "{\"body\":\"bababango\",\"httpMethod\":\"POST\"}" - } - - def "test MapStringObject Event"() { - given: - def adapter = new Moshi.Builder() - .add(SkipUnsupportedTypeJsonAdapter.newFactory()) - .build() - .adapter(Object) - - when: - def myEvent = new HashMap() - def myNestedEvent = new HashMap() - myNestedEvent.put("nestedKey0", "nestedValue1") - myNestedEvent.put("nestedKey1", true) - myNestedEvent.put("nestedKey2", ["aaa", "bbb", "ccc", "dddd"]) - myEvent.put("firstKey", new TestJsonObject()) - myEvent.put("secondKey", myNestedEvent) - def result = adapter.toJson(myEvent) - - then: - result == "{\"firstKey\":{\"field1\":\"toto\",\"field2\":true,\"field3\":{},\"field4\":{\"field\":{}},\"field5\":{}},\"secondKey\":{\"nestedKey2\":[\"aaa\",\"bbb\",\"ccc\",\"dddd\"],\"nestedKey0\":\"nestedValue1\",\"nestedKey1\":true}}" - } - - def "test custom payload"() { - given: - def adapter = new Moshi.Builder() - .add(SkipUnsupportedTypeJsonAdapter.newFactory()) - .build() - .adapter(Object) - - when: - def customPayload = new CustomRequest() - def result = adapter.toJson(customPayload) - - then: - result == "{\"body\":{},\"path\":{},\"testBool\":false}" - } -} diff --git a/dd-trace-core/src/test/groovy/datadog/trace/llmobs/writer/ddintake/LLMObsSpanMapperTest.groovy b/dd-trace-core/src/test/groovy/datadog/trace/llmobs/writer/ddintake/LLMObsSpanMapperTest.groovy deleted file mode 100644 index fc254458920..00000000000 --- a/dd-trace-core/src/test/groovy/datadog/trace/llmobs/writer/ddintake/LLMObsSpanMapperTest.groovy +++ /dev/null @@ -1,309 +0,0 @@ -package datadog.trace.llmobs.writer.ddintake - -import com.fasterxml.jackson.databind.ObjectMapper -import datadog.communication.serialization.ByteBufferConsumer -import datadog.communication.serialization.FlushingBuffer -import datadog.communication.serialization.msgpack.MsgPackWriter -import datadog.trace.api.DDTags -import datadog.trace.api.llmobs.LLMObs -import datadog.trace.bootstrap.instrumentation.api.InternalSpanTypes -import datadog.trace.bootstrap.instrumentation.api.Tags -import datadog.trace.common.writer.ListWriter -import datadog.trace.core.test.DDCoreSpecification -import org.msgpack.jackson.dataformat.MessagePackFactory -import spock.lang.Shared - -import java.nio.ByteBuffer -import java.nio.channels.WritableByteChannel - -class LLMObsSpanMapperTest extends DDCoreSpecification { - - @Shared - ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory()) - - def "test LLMObsSpanMapper serialization"() { - setup: - def mapper = new LLMObsSpanMapper() - def tracer = tracerBuilder().writer(new ListWriter()).build() - - - // Create a real LLMObs span using the tracer - def llmSpan = tracer.buildSpan("openai.request") - .withResourceName("createCompletion") - .withTag("_ml_obs_tag.span.kind", Tags.LLMOBS_LLM_SPAN_KIND) - .withTag("_ml_obs_tag.model_name", "gpt-4") - .withTag("_ml_obs_tag.model_provider", "openai") - .withTag("_ml_obs_metric.input_tokens", 50) - .withTag("_ml_obs_metric.output_tokens", 25) - .withTag("_ml_obs_metric.total_tokens", 75) - .start() - - llmSpan.setSpanType(InternalSpanTypes.LLMOBS) - - def toolCall = LLMObs.ToolCall.from("get_weather", "function_call", "call_123", [location: "San Francisco"]) - def toolResult = LLMObs.ToolResult.from("get_weather", "function_call_output", "call_123", '{"temperature":"72F"}') - def inputMessages = [ - LLMObs.LLMMessage.from("user", "Hello, what's the weather like?"), - LLMObs.LLMMessage.from("assistant", null, [toolCall], [toolResult]) - ] - def outputMessages = [LLMObs.LLMMessage.from("assistant", "I'll help you check the weather.")] - llmSpan.setTag("_ml_obs_tag.input", [ - messages: inputMessages, - prompt: [ - id: "prompt_123", - version: "1", - variables: [city: "San Francisco"], - chat_template: [[role: "user", content: "Hello, what's the weather like in {{city}}?"]] - ] - ]) - llmSpan.setTag("_ml_obs_tag.output", outputMessages) - llmSpan.setTag("_ml_obs_tag.metadata", [temperature: 0.7, max_tokens: 100]) - llmSpan.setTag("_ml_obs_tag.tool_definitions", [ - [ - name: "get_weather", - description: "Get weather by city", - schema: [type: "object", properties: [city: [type: "string"]]] - ] - ]) - llmSpan.setError(true) - llmSpan.setTag(DDTags.ERROR_MSG, "boom") - llmSpan.setTag(DDTags.ERROR_TYPE, "java.lang.IllegalStateException") - llmSpan.setTag(DDTags.ERROR_STACK, "stacktrace") - - llmSpan.finish() - - def trace = [llmSpan] - CapturingByteBufferConsumer sink = new CapturingByteBufferConsumer() - // Keep all formatted spans in a single flush for this assertion. - MsgPackWriter packer = new MsgPackWriter(new FlushingBuffer(16 * 1024, sink)) - - when: - packer.format(trace, mapper) - packer.flush() - - then: - sink.captured != null - def payload = mapper.newPayload() - payload.withBody(1, sink.captured) - - // Capture the size before the buffer is written and the body buffer is emptied. - def sizeInBytes = payload.sizeInBytes() - - def channel = new ByteArrayOutputStream() - payload.writeTo(new WritableByteChannel() { - @Override - int write(ByteBuffer src) throws IOException { - def bytes = new byte[src.remaining()] - src.get(bytes) - channel.write(bytes) - return bytes.length - } - - @Override - boolean isOpen() { - return true - } - - @Override - void close() throws IOException { } - }) - - def bytesWritten = channel.toByteArray() - sizeInBytes == bytesWritten.length - def result = objectMapper.readValue(bytesWritten, Map) - - then: - result.containsKey("event_type") - result["event_type"] == "span" - result.containsKey("_dd.stage") - result["_dd.stage"] == "raw" - result.containsKey("spans") - result["spans"] instanceof List - result["spans"].size() == 1 - - def spanData = result["spans"][0] - spanData["name"] == "OpenAI.createCompletion" - spanData.containsKey("span_id") - spanData.containsKey("trace_id") - spanData.containsKey("start_ns") - spanData.containsKey("duration") - spanData.containsKey("_dd") - spanData["_dd"]["span_id"] == spanData["span_id"] - spanData["_dd"]["trace_id"] == spanData["trace_id"] - spanData["_dd"]["apm_trace_id"] == spanData["trace_id"] - - spanData.containsKey("meta") - spanData["meta"]["span.kind"] == "llm" - spanData["meta"].containsKey("error") - spanData["meta"]["error"]["message"] == "boom" - spanData["meta"]["error"]["type"] == "java.lang.IllegalStateException" - spanData["meta"]["error"]["stack"] == "stacktrace" - spanData["meta"].containsKey("input") - spanData["meta"]["input"].containsKey("messages") - spanData["meta"]["input"]["messages"][0].containsKey("content") - spanData["meta"]["input"]["messages"][0]["content"] == "Hello, what's the weather like?" - spanData["meta"]["input"]["messages"][0].containsKey("role") - spanData["meta"]["input"]["messages"][0]["role"] == "user" - spanData["meta"]["input"]["messages"][1]["role"] == "assistant" - !spanData["meta"]["input"]["messages"][1].containsKey("content") - spanData["meta"]["input"]["messages"][1]["tool_calls"][0]["name"] == "get_weather" - spanData["meta"]["input"]["messages"][1]["tool_calls"][0]["type"] == "function_call" - spanData["meta"]["input"]["messages"][1]["tool_calls"][0]["tool_id"] == "call_123" - spanData["meta"]["input"]["messages"][1]["tool_calls"][0]["arguments"] == [location: "San Francisco"] - spanData["meta"]["input"]["messages"][1]["tool_results"][0]["name"] == "get_weather" - spanData["meta"]["input"]["messages"][1]["tool_results"][0]["type"] == "function_call_output" - spanData["meta"]["input"]["messages"][1]["tool_results"][0]["tool_id"] == "call_123" - spanData["meta"]["input"]["messages"][1]["tool_results"][0]["result"] == '{"temperature":"72F"}' - spanData["meta"]["input"]["prompt"]["id"] == "prompt_123" - spanData["meta"]["input"]["prompt"]["version"] == "1" - spanData["meta"]["input"]["prompt"]["variables"] == [city: "San Francisco"] - spanData["meta"]["input"]["prompt"]["chat_template"] == [[role: "user", content: "Hello, what's the weather like in {{city}}?"]] - spanData["meta"].containsKey("output") - spanData["meta"]["output"].containsKey("messages") - spanData["meta"]["output"]["messages"][0].containsKey("content") - spanData["meta"]["output"]["messages"][0]["content"] == "I'll help you check the weather." - spanData["meta"]["output"]["messages"][0].containsKey("role") - spanData["meta"]["output"]["messages"][0]["role"] == "assistant" - spanData["meta"]["tool_definitions"][0]["name"] == "get_weather" - spanData["meta"]["tool_definitions"][0]["description"] == "Get weather by city" - spanData["meta"]["tool_definitions"][0]["schema"] == [type: "object", properties: [city: [type: "string"]]] - spanData["meta"].containsKey("metadata") - - spanData.containsKey("metrics") - spanData["metrics"]["input_tokens"] == 50.0 - spanData["metrics"]["output_tokens"] == 25.0 - spanData["metrics"]["total_tokens"] == 75.0 - - spanData.containsKey("tags") - spanData["tags"].contains("language:jvm") - } - - def "test LLMObsSpanMapper writes no spans when none are LLMObs spans"() { - setup: - def mapper = new LLMObsSpanMapper() - def tracer = tracerBuilder().writer(new ListWriter()).build() - - def regularSpan1 = tracer.buildSpan("http.request") - .withResourceName("GET /api/users") - .withTag("http.method", "GET") - .withTag("http.url", "https://example.com/api/users") - .start() - regularSpan1.finish() - - def regularSpan2 = tracer.buildSpan("database.query") - .withResourceName("SELECT * FROM users") - .withTag("db.type", "postgresql") - .start() - regularSpan2.finish() - - def trace = [regularSpan1, regularSpan2] - CapturingByteBufferConsumer sink = new CapturingByteBufferConsumer() - // Keep all formatted spans in a single flush for this assertion. - MsgPackWriter packer = new MsgPackWriter(new FlushingBuffer(16 * 1024, sink)) - - when: - packer.format(trace, mapper) - packer.flush() - - then: - sink.captured == null - } - - def "test consecutive packer.format calls accumulate spans from multiple traces"() { - setup: - def mapper = new LLMObsSpanMapper() - def tracer = tracerBuilder().writer(new ListWriter()).build() - - // First trace with 2 LLMObs spans - def llmSpan1 = tracer.buildSpan("chat-completion-1") - .withTag("_ml_obs_tag.span.kind", Tags.LLMOBS_LLM_SPAN_KIND) - .withTag("_ml_obs_tag.model_name", "gpt-4") - .withTag("_ml_obs_tag.model_provider", "openai") - .start() - llmSpan1.setSpanType(InternalSpanTypes.LLMOBS) - llmSpan1.finish() - - def llmSpan2 = tracer.buildSpan("chat-completion-2") - .withTag("_ml_obs_tag.span.kind", Tags.LLMOBS_LLM_SPAN_KIND) - .withTag("_ml_obs_tag.model_name", "gpt-3.5") - .withTag("_ml_obs_tag.model_provider", "openai") - .start() - llmSpan2.setSpanType(InternalSpanTypes.LLMOBS) - llmSpan2.finish() - - // Second trace with 1 LLMObs span - def llmSpan3 = tracer.buildSpan("chat-completion-3") - .withTag("_ml_obs_tag.span.kind", Tags.LLMOBS_LLM_SPAN_KIND) - .withTag("_ml_obs_tag.model_name", "claude-3") - .withTag("_ml_obs_tag.model_provider", "anthropic") - .start() - llmSpan3.setSpanType(InternalSpanTypes.LLMOBS) - llmSpan3.finish() - - def trace1 = [llmSpan1, llmSpan2] - def trace2 = [llmSpan3] - CapturingByteBufferConsumer sink = new CapturingByteBufferConsumer() - // Keep all formatted spans in a single flush for this assertion. - MsgPackWriter packer = new MsgPackWriter(new FlushingBuffer(16 * 1024, sink)) - - when: - packer.format(trace1, mapper) - packer.format(trace2, mapper) - packer.flush() - - then: - sink.captured != null - def payload = mapper.newPayload() - payload.withBody(3, sink.captured) - - // Capture the size before the buffer is written and the body buffer is emptied. - def sizeInBytes = payload.sizeInBytes() - - def channel = new ByteArrayOutputStream() - payload.writeTo(new WritableByteChannel() { - @Override - int write(ByteBuffer src) throws IOException { - def bytes = new byte[src.remaining()] - src.get(bytes) - channel.write(bytes) - return bytes.length - } - - @Override - boolean isOpen() { - return true - } - - @Override - void close() throws IOException { } - }) - - def bytesWritten = channel.toByteArray() - sizeInBytes == bytesWritten.length - def result = objectMapper.readValue(bytesWritten, Map) - - then: - result.containsKey("event_type") - result["event_type"] == "span" - result.containsKey("_dd.stage") - result["_dd.stage"] == "raw" - result.containsKey("spans") - result["spans"] instanceof List - result["spans"].size() == 3 - - def spanNames = result["spans"].collect { it["name"] } - spanNames.contains("chat-completion-1") - spanNames.contains("chat-completion-2") - spanNames.contains("chat-completion-3") - } - - static class CapturingByteBufferConsumer implements ByteBufferConsumer { - - ByteBuffer captured - - @Override - void accept(int messageCount, ByteBuffer buffer) { - captured = buffer - } - } -} diff --git a/dd-trace-core/src/test/java/datadog/trace/TracerConnectionReliabilityTest.java b/dd-trace-core/src/test/java/datadog/trace/TracerConnectionReliabilityTest.java new file mode 100644 index 00000000000..eecd93bb2b5 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/TracerConnectionReliabilityTest.java @@ -0,0 +1,186 @@ +package datadog.trace; + +import static datadog.trace.api.ConfigDefaults.DEFAULT_TRACE_AGENT_PORT; +import static datadog.trace.api.ProtocolVersion.V0_4; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; + +import com.squareup.moshi.JsonAdapter; +import com.squareup.moshi.Moshi; +import com.squareup.moshi.Types; +import datadog.communication.ddagent.DDAgentFeaturesDiscovery; +import datadog.communication.ddagent.SharedCommunicationObjects; +import datadog.metrics.api.Monitoring; +import datadog.trace.agent.test.utils.PortUtils; +import datadog.trace.api.IdGenerationStrategy; +import datadog.trace.core.CoreTracer; +import datadog.trace.test.util.DDJavaSpecification; +import java.io.IOException; +import java.lang.reflect.Type; +import java.util.List; +import java.util.Properties; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.testcontainers.containers.FixedHostPortGenericContainer; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.wait.strategy.Wait; + +public class TracerConnectionReliabilityTest extends DDJavaSpecification { + + static final int FEATURES_DISCOVERY_MIN_DELAY = 10; + + static OkHttpClient client; + static JsonAdapter>> traceJsonAdapter; + + int agentContainerPort; + CoreTracer tracer; + + @BeforeAll + static void setupSpec() { + client = new OkHttpClient(); + // Create body parser for /test/traces route + Moshi moshi = new Moshi.Builder().build(); + Type type = + Types.newParameterizedType( + List.class, Types.newParameterizedType(List.class, SentTraces.class)); + traceJsonAdapter = moshi.adapter(type); + } + + @BeforeEach + void setup() { + // Pick a random port for the test agent + agentContainerPort = PortUtils.randomOpenPort(); + // Build a tracer talking to the test agent (with the right port and traces endpoint) + Properties properties = new Properties(); + properties.put("trace.agent.port", Integer.toString(agentContainerPort)); + SharedCommunicationObjects sharedCommunicationObjects = new SharedCommunicationObjects(); + sharedCommunicationObjects.agentUrl = HttpUrl.get("http://localhost:" + agentContainerPort); + sharedCommunicationObjects.agentHttpClient = client; + FixedTraceEndpointFeaturesDiscovery fixedFeaturesDiscovery = + new FixedTraceEndpointFeaturesDiscovery(sharedCommunicationObjects); + sharedCommunicationObjects.setFeaturesDiscovery(fixedFeaturesDiscovery); + + tracer = + CoreTracer.builder() + .idGenerationStrategy(IdGenerationStrategy.fromName("SEQUENTIAL")) + .withProperties(properties) + .sharedCommunicationObjects(sharedCommunicationObjects) + .build(); + } + + @AfterEach + void cleanup() { + if (tracer != null) { + tracer.close(); + } + } + + @Test + void testLateAgentStart() throws Exception { + createSpans(10, 100); + tracer.flush(); + + GenericContainer agentContainer = startTestAgentContainer(); + int noAgentCount = getTraceCount(agentContainer); + waitForDiscoveryTimeout(); + + createSpans(20, 100); + tracer.flush(); + int withAgentCount = getTraceCount(agentContainer); + agentContainer.stop(); + + assertFalse(agentContainer.isRunning()); + assertEquals(0, noAgentCount); + assertEquals(20, withAgentCount); + } + + @Test + void testAgentRestart() throws Exception { + GenericContainer agentContainer = startTestAgentContainer(); + + createSpans(10, 100); + tracer.flush(); + int withAgentCount = getTraceCount(agentContainer); + + assertEquals(10, withAgentCount); + + agentContainer.stop(); + createSpans(10, 100); + tracer.flush(); + + waitForDiscoveryTimeout(); + agentContainer = startTestAgentContainer(); + int noTraceCount = getTraceCount(agentContainer); + createSpans(10, 100); + tracer.flush(); + withAgentCount = getTraceCount(agentContainer); + agentContainer.stop(); + + assertFalse(agentContainer.isRunning()); + assertEquals(0, noTraceCount); + assertEquals(10, withAgentCount); + } + + @SuppressWarnings({"deprecation", "rawtypes", "unchecked"}) + GenericContainer startTestAgentContainer() { + //noinspection GrDeprecatedAPIUsage Use FixedHostPortGenericContainer against deprecation + // because we need to know the exposed to configure the tracer at start + GenericContainer agentContainer = + new FixedHostPortGenericContainer( + "registry.ddbuild.io/images/mirror/dd-apm-test-agent/ddapm-test-agent:v1.44.0") + .withFixedExposedPort(agentContainerPort, DEFAULT_TRACE_AGENT_PORT) + .withEnv( + "ENABLED_CHECKS", + "trace_count_header,meta_tracer_version_header,trace_content_length") + .waitingFor(Wait.forHttp("/test/traces")); + agentContainer.start(); + return agentContainer; + } + + void createSpans(int count, int delay) throws InterruptedException { + for (int index = 1; index <= count; index++) { + datadog.trace.bootstrap.instrumentation.api.AgentSpan span = + tracer.buildSpan("datadog", "operation-" + index).start(); + Thread.sleep(delay); + span.finish(); + } + } + + static void waitForDiscoveryTimeout() throws InterruptedException { + Thread.sleep((long) (FEATURES_DISCOVERY_MIN_DELAY * 1.5)); + } + + int getTraceCount(GenericContainer agentContainer) throws IOException { + Request request = + new Request.Builder() + .url("http://" + agentContainer.getHost() + ":" + agentContainerPort + "/test/traces") + .build(); + String body = client.newCall(request).execute().body().string(); + return traceJsonAdapter.fromJson(body).size(); + } + + static class FixedTraceEndpointFeaturesDiscovery extends DDAgentFeaturesDiscovery { + FixedTraceEndpointFeaturesDiscovery(SharedCommunicationObjects objects) { + super(objects.agentHttpClient, Monitoring.DISABLED, objects.agentUrl, V0_4, false, false); + } + + @Override + public String getTraceEndpoint() { + return V04_ENDPOINT; + } + + @Override + protected long getFeaturesDiscoveryMinDelayMillis() { + return FEATURES_DISCOVERY_MIN_DELAY; + } + } + + static class SentTraces { + String name; + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/api/datastreams/TransactionInfoTestBridge.java b/dd-trace-core/src/test/java/datadog/trace/api/datastreams/TransactionInfoTestBridge.java new file mode 100644 index 00000000000..9cd65594f25 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/api/datastreams/TransactionInfoTestBridge.java @@ -0,0 +1,11 @@ +package datadog.trace.api.datastreams; + +/** + * Bridge class to allow tests to access package-private method exposed by the {@code + * TransactionInfo} + */ +public class TransactionInfoTestBridge { + public static void resetCache() { + TransactionInfo.resetCache(); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/api/remoteconfig/ServiceNameCollectorTestBridge.java b/dd-trace-core/src/test/java/datadog/trace/api/remoteconfig/ServiceNameCollectorTestBridge.java new file mode 100644 index 00000000000..8d66cdb4f83 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/api/remoteconfig/ServiceNameCollectorTestBridge.java @@ -0,0 +1,11 @@ +package datadog.trace.api.remoteconfig; + +/** + * Bridge class to allow tests to access package-private method exposed by the {@code + * ServiceNameCollector} + */ +public class ServiceNameCollectorTestBridge { + public static void setInstance(ServiceNameCollector instance) { + ServiceNameCollector.setInstance(instance); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/api/writer/PrintingWriterTest.java b/dd-trace-core/src/test/java/datadog/trace/api/writer/PrintingWriterTest.java new file mode 100644 index 00000000000..8289bfe35a0 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/api/writer/PrintingWriterTest.java @@ -0,0 +1,145 @@ +package datadog.trace.api.writer; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; + +import com.squareup.moshi.JsonAdapter; +import com.squareup.moshi.Moshi; +import com.squareup.moshi.Types; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import datadog.trace.common.writer.ListWriter; +import datadog.trace.common.writer.PrintingWriter; +import datadog.trace.core.CoreTracer; +import datadog.trace.core.DDCoreJavaSpecification; +import datadog.trace.core.DDSpan; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import okio.Buffer; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +@SuppressWarnings({"unchecked", "rawtypes"}) +public class PrintingWriterTest extends DDCoreJavaSpecification { + + private CoreTracer tracer; + private List sampleTrace; + private List secondTrace; + private JsonAdapter adapter; + + @BeforeEach + void setup() { + tracer = tracerBuilder().writer(new ListWriter()).build(); + adapter = + new Moshi.Builder() + .build() + .adapter( + Types.newParameterizedType( + Map.class, + String.class, + Types.newParameterizedType( + List.class, Types.newParameterizedType(List.class, Map.class)))); + + AgentTracer.SpanBuilder builder = + tracer + .buildSpan("datadog", "fakeOperation") + .withServiceName("fakeService") + .withResourceName("fakeResource") + .withSpanType("fakeType"); + + sampleTrace = Arrays.asList((DDSpan) builder.start(), (DDSpan) builder.start()); + secondTrace = Collections.singletonList((DDSpan) builder.start()); + } + + @AfterEach + void cleanup() { + if (tracer != null) { + tracer.close(); + } + } + + @Test + void testPrintingRegularIds() throws Exception { + Buffer buffer = new Buffer(); + PrintingWriter writer = new PrintingWriter(buffer.outputStream(), false); + + writer.write(sampleTrace); + Map>> result = + (Map>>) adapter.fromJson(buffer.readString(StandardCharsets.UTF_8)); + + assertEquals(sampleTrace.size(), result.get("traces").get(0).size()); + for (Map span : result.get("traces").get(0)) { + assertRegularSpanFields(span, false); + } + + writer.write(secondTrace); + result = + (Map>>) adapter.fromJson(buffer.readString(StandardCharsets.UTF_8)); + + assertEquals(secondTrace.size(), result.get("traces").get(0).size()); + for (Map span : result.get("traces").get(0)) { + assertRegularSpanFields(span, false); + } + } + + @Test + void testPrintingRegularHexIds() throws Exception { + Buffer buffer = new Buffer(); + PrintingWriter writer = new PrintingWriter(buffer.outputStream(), true); + + writer.write(sampleTrace); + Map>> result = + (Map>>) adapter.fromJson(buffer.readString(StandardCharsets.UTF_8)); + + assertEquals(sampleTrace.size(), result.get("traces").get(0).size()); + for (Map span : result.get("traces").get(0)) { + assertRegularSpanFields(span, true); + } + } + + @Test + void testPrintingMultipleTraces() throws Exception { + Buffer buffer = new Buffer(); + PrintingWriter writer = new PrintingWriter(buffer.outputStream(), false); + + writer.write(sampleTrace); + writer.write(secondTrace); + Map>> result1 = + (Map>>) adapter.fromJson(buffer.readUtf8Line()); + Map>> result2 = + (Map>>) adapter.fromJson(buffer.readUtf8Line()); + + assertEquals(sampleTrace.size(), result1.get("traces").get(0).size()); + for (Map span : result2.get("traces").get(0)) { + assertRegularSpanFields(span, false); + } + assertEquals(secondTrace.size(), result2.get("traces").get(0).size()); + for (Map span : result2.get("traces").get(0)) { + assertRegularSpanFields(span, false); + } + } + + private void assertRegularSpanFields(Map span, boolean hexIds) { + assertEquals("fakeService", span.get("service")); + assertEquals("fakeOperation", span.get("name")); + assertEquals("fakeResource", span.get("resource")); + assertEquals("fakeType", span.get("type")); + if (hexIds) { + assertInstanceOf(String.class, span.get("trace_id")); + assertInstanceOf(String.class, span.get("span_id")); + assertInstanceOf(String.class, span.get("parent_id")); + } else { + assertInstanceOf(Number.class, span.get("trace_id")); + assertInstanceOf(Number.class, span.get("span_id")); + assertInstanceOf(Number.class, span.get("parent_id")); + } + assertInstanceOf(Number.class, span.get("start")); + assertInstanceOf(Number.class, span.get("duration")); + assertEquals(0, ((Number) span.get("error")).intValue()); + assertInstanceOf(Map.class, span.get("metrics")); + assertInstanceOf(Map.class, span.get("meta")); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/civisibility/interceptor/CiVisibilityApmProtocolInterceptorTest.java b/dd-trace-core/src/test/java/datadog/trace/civisibility/interceptor/CiVisibilityApmProtocolInterceptorTest.java new file mode 100644 index 00000000000..1ffc71e7ed3 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/civisibility/interceptor/CiVisibilityApmProtocolInterceptorTest.java @@ -0,0 +1,89 @@ +package datadog.trace.civisibility.interceptor; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; + +import datadog.trace.api.DDSpanTypes; +import datadog.trace.bootstrap.instrumentation.api.Tags; +import datadog.trace.common.writer.ListWriter; +import datadog.trace.core.CoreTracer; +import datadog.trace.core.DDCoreJavaSpecification; +import datadog.trace.core.DDSpan; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; + +@Timeout(value = 10, unit = TimeUnit.SECONDS) +public class CiVisibilityApmProtocolInterceptorTest extends DDCoreJavaSpecification { + + private ListWriter writer; + private CoreTracer tracer; + + @BeforeEach + void setup() { + writer = new ListWriter(); + tracer = tracerBuilder().writer(writer).build(); + } + + @AfterEach + void cleanup() { + if (tracer != null) { + tracer.close(); + } + } + + @Test + void testSuiteAndTestModuleSpansAreFilteredOut() throws InterruptedException, TimeoutException { + tracer.addTraceInterceptor(CiVisibilityApmProtocolInterceptor.INSTANCE); + + tracer + .buildSpan("datadog", "test-module") + .withSpanType(DDSpanTypes.TEST_MODULE_END) + .start() + .finish(); + tracer + .buildSpan("datadog", "test-suite") + .withSpanType(DDSpanTypes.TEST_SUITE_END) + .start() + .finish(); + tracer.buildSpan("datadog", "test").withSpanType(DDSpanTypes.TEST).start().finish(); + + writer.waitForTraces(1); + + List trace = writer.firstTrace(); + assertEquals(1, trace.size()); + + DDSpan span = trace.get(0); + assertEquals("test", span.getOperationName().toString()); + } + + @Test + void testSessionTestModuleAndTestSuiteIdsAreNullified() + throws InterruptedException, TimeoutException { + tracer.addTraceInterceptor(CiVisibilityApmProtocolInterceptor.INSTANCE); + + DDSpan testSpan = + (DDSpan) tracer.buildSpan("datadog", "test").withSpanType(DDSpanTypes.TEST).start(); + testSpan.setTag(Tags.TEST_SESSION_ID, "session ID"); + testSpan.setTag(Tags.TEST_MODULE_ID, "module ID"); + testSpan.setTag(Tags.TEST_SUITE_ID, "suite ID"); + testSpan.setTag("random tag", "random value"); + testSpan.finish(); + + writer.waitForTraces(1); + + List trace = writer.firstTrace(); + assertEquals(1, trace.size()); + + DDSpan span = trace.get(0); + + assertNull(span.getTag(Tags.TEST_SESSION_ID)); + assertNull(span.getTag(Tags.TEST_MODULE_ID)); + assertNull(span.getTag(Tags.TEST_SUITE_ID)); + assertEquals("random value", span.getTag("random tag")); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/civisibility/interceptor/CiVisibilityTraceInterceptorTest.java b/dd-trace-core/src/test/java/datadog/trace/civisibility/interceptor/CiVisibilityTraceInterceptorTest.java new file mode 100644 index 00000000000..dcc81fe9908 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/civisibility/interceptor/CiVisibilityTraceInterceptorTest.java @@ -0,0 +1,85 @@ +package datadog.trace.civisibility.interceptor; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import datadog.trace.api.DDTags; +import datadog.trace.api.civisibility.CIConstants; +import datadog.trace.common.writer.ListWriter; +import datadog.trace.core.CoreTracer; +import datadog.trace.core.DDCoreJavaSpecification; +import datadog.trace.core.DDSpan; +import datadog.trace.test.junit.utils.converter.DDSpanTypesConverter; +import java.util.List; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; +import org.junit.jupiter.params.converter.ConvertWith; +import org.tabletest.junit.TableTest; + +@Timeout(value = 10, unit = TimeUnit.SECONDS) +public class CiVisibilityTraceInterceptorTest extends DDCoreJavaSpecification { + + private ListWriter writer; + private CoreTracer tracer; + + @BeforeEach + void setup() { + writer = new ListWriter(); + tracer = tracerBuilder().writer(writer).build(); + } + + @AfterEach + void cleanup() { + if (tracer != null) { + tracer.close(); + } + } + + @Test + void discardATraceThatDoesNotComeFromCiApp() { + tracer.addTraceInterceptor(CiVisibilityTraceInterceptor.INSTANCE); + tracer.buildSpan("datadog", "sample-span").start().finish(); + + assertEquals(0, writer.size()); + } + + @Test + void doNotDiscardATraceThatComesFromCiApp() { + tracer.addTraceInterceptor(CiVisibilityTraceInterceptor.INSTANCE); + + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "sample-span").start(); + span.spanContext().setOrigin(CIConstants.CIAPP_TEST_ORIGIN); + span.finish(); + + // expect: + assertEquals(1, writer.size()); + } + + @TableTest({ + "scenario | spanType ", + "test | DDSpanTypes.TEST ", + "test suite end | DDSpanTypes.TEST_SUITE_END ", + "test module end | DDSpanTypes.TEST_MODULE_END ", + "test session end | DDSpanTypes.TEST_SESSION_END" + }) + void addTracerVersionToSpansOfType(@ConvertWith(DDSpanTypesConverter.class) String spanType) + throws InterruptedException, TimeoutException { + tracer.addTraceInterceptor(CiVisibilityTraceInterceptor.INSTANCE); + + DDSpan span = + (DDSpan) tracer.buildSpan("datadog", "sample-span").withSpanType(spanType).start(); + span.spanContext().setOrigin(CIConstants.CIAPP_TEST_ORIGIN); + span.finish(); + writer.waitForTraces(1); + + List trace = writer.firstTrace(); + assertEquals(1, trace.size()); + + DDSpan receivedSpan = trace.get(0); + assertNotNull(receivedSpan.getTag(DDTags.LIBRARY_VERSION_TAG_KEY)); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/civisibility/writer/ddintake/CiTestCovMapperV2Test.java b/dd-trace-core/src/test/java/datadog/trace/civisibility/writer/ddintake/CiTestCovMapperV2Test.java new file mode 100644 index 00000000000..b6c42fc9388 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/civisibility/writer/ddintake/CiTestCovMapperV2Test.java @@ -0,0 +1,340 @@ +package datadog.trace.civisibility.writer.ddintake; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.fasterxml.jackson.databind.ObjectMapper; +import datadog.communication.serialization.GrowableBuffer; +import datadog.communication.serialization.msgpack.MsgPackWriter; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.civisibility.coverage.CoverageProbes; +import datadog.trace.api.civisibility.coverage.CoverageStore; +import datadog.trace.api.civisibility.coverage.NoOpProbes; +import datadog.trace.api.civisibility.coverage.TestReport; +import datadog.trace.api.civisibility.coverage.TestReportFileEntry; +import datadog.trace.api.civisibility.domain.TestContext; +import datadog.trace.api.sampling.PrioritySampling; +import datadog.trace.bootstrap.instrumentation.api.InternalSpanTypes; +import datadog.trace.core.DDCoreJavaSpecification; +import datadog.trace.core.DDSpan; +import datadog.trace.core.propagation.PropagationTags; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.channels.WritableByteChannel; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.BitSet; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.Test; +import org.msgpack.jackson.dataformat.MessagePackFactory; + +@SuppressWarnings("unchecked") +public class CiTestCovMapperV2Test extends DDCoreJavaSpecification { + + private static final ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory()); + + @Test + void testWritesMessage() throws Exception { + List trace = + givenTrace( + new TestReport( + DDTraceId.from(1), + 2L, + 3L, + Arrays.asList( + new TestReportFileEntry("source", BitSet.valueOf(new long[] {3, 5, 8}))))); + + Map message = getMappedMessage(trace); + + List> coverages = assertVersionAndGetCoverages(message, 2); + assertEquals(1, coverages.size()); + + Map coverage = coverages.get(0); + assertCoverage(coverage, 1, 2, 3); + + List> files = (List>) coverage.get("files"); + assertEquals(1, files.size()); + assertFile( + files.get(0), "source", new byte[] {3, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 8}); + } + + @Test + void testWritesMessageWithMultipleFilesAndMultipleLines() throws Exception { + List trace = + givenTrace( + new TestReport( + DDTraceId.from(1), + 2L, + 3L, + Arrays.asList( + new TestReportFileEntry("sourceA", BitSet.valueOf(new long[] {3, 5, 8})), + new TestReportFileEntry("sourceB", BitSet.valueOf(new long[] {1, 255, 7}))))); + + Map message = getMappedMessage(trace); + + List> coverages = assertVersionAndGetCoverages(message, 2); + assertEquals(1, coverages.size()); + + Map coverage = coverages.get(0); + assertCoverage(coverage, 1, 2, 3); + + List> files = (List>) coverage.get("files"); + assertEquals(2, files.size()); + assertFile( + files.get(0), "sourceA", new byte[] {3, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 8}); + assertFile( + files.get(1), "sourceB", new byte[] {1, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 7}); + } + + @Test + void testWritesMessageWithMultipleReports() throws Exception { + List trace = + givenTrace( + new TestReport( + DDTraceId.from(1), + 2L, + 3L, + Arrays.asList( + new TestReportFileEntry("sourceA", BitSet.valueOf(new long[] {2, 17, 41})))), + new TestReport( + DDTraceId.from(1), + 2L, + 4L, + Arrays.asList( + new TestReportFileEntry("sourceB", BitSet.valueOf(new long[] {11, 13, 55}))))); + + Map message = getMappedMessage(trace); + + List> coverages = assertVersionAndGetCoverages(message, 2); + assertEquals(2, coverages.size()); + + Map coverage0 = coverages.get(0); + assertCoverage(coverage0, 1, 2, 3); + List> files0 = (List>) coverage0.get("files"); + assertEquals(1, files0.size()); + assertFile( + files0.get(0), "sourceA", new byte[] {2, 0, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 41}); + + Map coverage1 = coverages.get(1); + assertCoverage(coverage1, 1, 2, 4); + List> files1 = (List>) coverage1.get("files"); + assertEquals(1, files1.size()); + assertFile( + files1.get(0), + "sourceB", + new byte[] {11, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 55}); + } + + @Test + void skipsSpansThatHaveNoReports() throws Exception { + List trace = + givenTrace( + null, + new TestReport( + DDTraceId.from(1), + 2L, + 3L, + Arrays.asList( + new TestReportFileEntry("source", BitSet.valueOf(new long[] {83, 25, 48})))), + null); + + Map message = getMappedMessage(trace); + + List> coverages = assertVersionAndGetCoverages(message, 2); + assertEquals(1, coverages.size()); + + Map coverage = coverages.get(0); + assertCoverage(coverage, 1, 2, 3); + + List> files = (List>) coverage.get("files"); + assertEquals(1, files.size()); + assertFile( + files.get(0), "source", new byte[] {83, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 48}); + } + + @Test + void skipsEmptyReports() throws Exception { + List trace = + givenTrace( + new TestReport( + DDTraceId.from(1), + 2L, + 3L, + Arrays.asList( + new TestReportFileEntry("source", BitSet.valueOf(new long[] {33, 53, 87})))), + new TestReport(DDTraceId.from(1), 2L, 4L, Collections.emptyList())); + + Map message = getMappedMessage(trace); + + List> coverages = assertVersionAndGetCoverages(message, 2); + assertEquals(1, coverages.size()); + + Map coverage = coverages.get(0); + assertCoverage(coverage, 1, 2, 3); + + List> files = (List>) coverage.get("files"); + assertEquals(1, files.size()); + assertFile( + files.get(0), "source", new byte[] {33, 0, 0, 0, 0, 0, 0, 0, 53, 0, 0, 0, 0, 0, 0, 0, 87}); + } + + @Test + void skipsDuplicateReports() throws Exception { + List trace = new ArrayList<>(); + TestReport report = + new TestReport( + DDTraceId.from(1), + 2L, + 3L, + Arrays.asList(new TestReportFileEntry("source", BitSet.valueOf(new long[] {3, 5, 8})))); + + trace.add( + buildSpan( + 0, + InternalSpanTypes.TEST, + PropagationTags.factory().empty(), + Collections.emptyMap(), + PrioritySampling.SAMPLER_KEEP, + new DummyTestContext(new DummyReportHolder(report)))); + trace.add( + buildSpan( + 0, + "testChild", + PropagationTags.factory().empty(), + Collections.emptyMap(), + PrioritySampling.SAMPLER_KEEP, + new DummyTestContext(new DummyReportHolder(report)))); + + Map message = getMappedMessage(trace); + + List> coverages = assertVersionAndGetCoverages(message, 2); + assertEquals(1, coverages.size()); + + Map coverage = coverages.get(0); + assertCoverage(coverage, 1, 2, 3); + + List> files = (List>) coverage.get("files"); + assertEquals(1, files.size()); + assertFile( + files.get(0), "source", new byte[] {3, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 8}); + } + + private List givenTrace(TestReport... testReports) { + List trace = new ArrayList<>(); + for (TestReport testReport : testReports) { + DummyReportHolder testReportHolder = new DummyReportHolder(testReport); + trace.add( + buildSpan( + 0, + InternalSpanTypes.TEST, + PropagationTags.factory().empty(), + Collections.emptyMap(), + PrioritySampling.SAMPLER_KEEP, + new DummyTestContext(testReportHolder))); + } + return trace; + } + + private Map getMappedMessage(List trace) throws IOException { + GrowableBuffer buffer = new GrowableBuffer(1024); + CiTestCovMapperV2 mapper = new CiTestCovMapperV2(false); + mapper.map(trace, new MsgPackWriter(buffer)); + + ByteArrayWritableByteChannel channel = new ByteArrayWritableByteChannel(); + mapper.newPayload().withBody(1, buffer.slice()).writeTo(channel); + + return objectMapper.readValue(channel.toByteArray(), Map.class); + } + + private List> assertVersionAndGetCoverages( + Map message, int version) { + assertEquals(version, message.get("version")); + return (List>) message.get("coverages"); + } + + private void assertCoverage( + Map coverage, int sessionId, int suiteId, int spanId) { + assertEquals(sessionId, coverage.get("test_session_id")); + assertEquals(suiteId, coverage.get("test_suite_id")); + assertEquals(spanId, coverage.get("span_id")); + } + + private void assertFile(Map file, String filename, byte[] bitmap) { + assertEquals(filename, file.get("filename")); + assertArrayEquals(bitmap, (byte[]) file.get("bitmap")); + } + + private static final class DummyReportHolder implements CoverageStore { + private final TestReport testReport; + + DummyReportHolder(TestReport testReport) { + this.testReport = testReport; + } + + @Override + public TestReport getReport() { + return testReport; + } + + @Override + public boolean report(DDTraceId testSessionId, Long testSuiteId, long spanId) { + return false; + } + + @Override + public CoverageProbes getProbes() { + return NoOpProbes.INSTANCE; + } + } + + private static final class DummyTestContext implements TestContext { + private final CoverageStore coverageStore; + + DummyTestContext(CoverageStore coverageStore) { + this.coverageStore = coverageStore; + } + + @Override + public CoverageStore getCoverageStore() { + return coverageStore; + } + + @Override + public void set(Class key, T value) {} + + @Override + public T get(Class key) { + return null; + } + } + + private static final class ByteArrayWritableByteChannel implements WritableByteChannel { + private final ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); + + @Override + public int write(ByteBuffer src) throws IOException { + int remaining = src.remaining(); + byte[] buffer = new byte[remaining]; + src.get(buffer); + outputStream.write(buffer); + return remaining; + } + + @Override + public boolean isOpen() { + return true; + } + + @Override + public void close() throws IOException { + outputStream.close(); + } + + byte[] toByteArray() { + return outputStream.toByteArray(); + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/civisibility/writer/ddintake/CiTestCycleMapperV1PayloadTest.java b/dd-trace-core/src/test/java/datadog/trace/civisibility/writer/ddintake/CiTestCycleMapperV1PayloadTest.java new file mode 100644 index 00000000000..e59f758056e --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/civisibility/writer/ddintake/CiTestCycleMapperV1PayloadTest.java @@ -0,0 +1,581 @@ +package datadog.trace.civisibility.writer.ddintake; + +import static datadog.trace.api.civisibility.CIConstants.MAX_META_STRING_VALUE_LENGTH; +import static datadog.trace.bootstrap.instrumentation.api.InstrumentationTags.DD_MEASURED; +import static datadog.trace.common.writer.TraceGenerator.generateRandomSpan; +import static datadog.trace.common.writer.TraceGenerator.generateRandomTraces; +import static datadog.trace.util.Strings.truncate; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +import static org.msgpack.core.MessageFormat.FLOAT32; +import static org.msgpack.core.MessageFormat.FLOAT64; +import static org.msgpack.core.MessageFormat.INT16; +import static org.msgpack.core.MessageFormat.INT32; +import static org.msgpack.core.MessageFormat.INT64; +import static org.msgpack.core.MessageFormat.INT8; +import static org.msgpack.core.MessageFormat.NEGFIXINT; +import static org.msgpack.core.MessageFormat.POSFIXINT; +import static org.msgpack.core.MessageFormat.UINT16; +import static org.msgpack.core.MessageFormat.UINT32; +import static org.msgpack.core.MessageFormat.UINT64; +import static org.msgpack.core.MessageFormat.UINT8; + +import com.fasterxml.jackson.databind.ObjectMapper; +import datadog.communication.serialization.ByteBufferConsumer; +import datadog.communication.serialization.FlushingBuffer; +import datadog.communication.serialization.msgpack.MsgPackWriter; +import datadog.trace.api.DDTags; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.civisibility.CiVisibilityWellKnownTags; +import datadog.trace.bootstrap.instrumentation.api.InternalSpanTypes; +import datadog.trace.bootstrap.instrumentation.api.Tags; +import datadog.trace.common.writer.Payload; +import datadog.trace.common.writer.TraceGenerator; +import datadog.trace.core.DDSpanContext; +import datadog.trace.test.util.DDJavaSpecification; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.channels.WritableByteChannel; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.Test; +import org.msgpack.core.MessageFormat; +import org.msgpack.core.MessagePack; +import org.msgpack.core.MessageUnpacker; +import org.msgpack.jackson.dataformat.MessagePackFactory; +import org.tabletest.junit.TableTest; + +public class CiTestCycleMapperV1PayloadTest extends DDJavaSpecification { + + @TableTest({ + "scenario | bufferSize | traceCount | lowCardinality", + "20k buffer, 0 traces, low cardinality | 20480 | 0 | true ", + "20k buffer, 1 trace, low cardinality | 20480 | 1 | true ", + "30k buffer, 1 trace, low cardinality | 30720 | 1 | true ", + "30k buffer, 2 traces, low cardinality | 30720 | 2 | true ", + "20k buffer, 0 traces, high cardinality | 20480 | 0 | false ", + "20k buffer, 1 trace, high cardinality | 20480 | 1 | false ", + "30k buffer, 1 trace, high cardinality | 30720 | 1 | false ", + "30k buffer, 2 traces, high cardinality | 30720 | 2 | false ", + "100k buffer, 0 traces, low cardinality | 102400 | 0 | true ", + "100k buffer, 1 trace, low cardinality | 102400 | 1 | true ", + "100k buffer, 10 traces, low cardinality | 102400 | 10 | true ", + "100k buffer, 100 traces, low cardinality | 102400 | 100 | true ", + "100k buffer, 1000 traces, low cardinality | 102400 | 1000 | true ", + "100k buffer, 0 traces, high cardinality | 102400 | 0 | false ", + "100k buffer, 1 trace, high cardinality | 102400 | 1 | false ", + "100k buffer, 10 traces, high cardinality | 102400 | 10 | false ", + "100k buffer, 100 traces, high cardinality | 102400 | 100 | false ", + "100k buffer, 1000 traces, high cardinality | 102400 | 1000 | false " + }) + void testTracesWrittenCorrectly(int bufferSize, int traceCount, boolean lowCardinality) { + CiVisibilityWellKnownTags wellKnownTags = + new CiVisibilityWellKnownTags( + "runtimeid", + "my-env", + "language", + "my-runtime-name", + "my-runtime-version", + "my-runtime-vendor", + "my-os-arch", + "my-os-platform", + "my-os-version", + "false"); + CiTestCycleMapperV1 mapper = new CiTestCycleMapperV1(wellKnownTags, false); + + List> traces = generateRandomTraces(traceCount, lowCardinality); + PayloadVerifier verifier = new PayloadVerifier(wellKnownTags, traces, mapper); + + MsgPackWriter packer = new MsgPackWriter(new FlushingBuffer(bufferSize, verifier)); + + boolean tracesFitInBuffer = true; + for (List trace : traces) { + if (!packer.format(trace, mapper)) { + verifier.skipLargeTrace(); + tracesFitInBuffer = false; + } + } + packer.flush(); + + if (tracesFitInBuffer) { + verifier.verifyTracesConsumed(); + } + } + + @Test + void verifyTestSuiteIdTestModuleIdAndTestSessionIdAreWrittenAsTopLevelTagsInTestEvent() { + Map extraTags = new HashMap<>(); + extraTags.put(Tags.TEST_SESSION_ID, DDTraceId.from(123)); + extraTags.put(Tags.TEST_MODULE_ID, 456L); + extraTags.put(Tags.TEST_SUITE_ID, 789L); + TraceGenerator.PojoSpan span = generateRandomSpan(InternalSpanTypes.TEST, extraTags); + + Map deserializedSpan = whenASpanIsWritten(span); + + verifyTopLevelTags(deserializedSpan, DDTraceId.from(123), 456L, 789L); + + Map spanContent = getContent(deserializedSpan); + assertTrue(spanContent.containsKey("trace_id")); + assertTrue(spanContent.containsKey("span_id")); + assertTrue(spanContent.containsKey("parent_id")); + } + + @Test + void truncatesMetaStringValuesAndPreservesMetricsAndTopLevelIds() { + String longValue = repeat("a", MAX_META_STRING_VALUE_LENGTH + 1); + String exactValue = repeat("b", MAX_META_STRING_VALUE_LENGTH); + Map extraTags = new HashMap<>(); + extraTags.put(Tags.TEST_SESSION_ID, DDTraceId.from(123)); + extraTags.put(Tags.TEST_MODULE_ID, 456L); + extraTags.put(Tags.TEST_SUITE_ID, 789L); + extraTags.put("custom.tag", longValue); + extraTags.put("exact.tag", exactValue); + extraTags.put("custom.metric", 42); + TraceGenerator.PojoSpan span = generateRandomSpan(InternalSpanTypes.TEST, extraTags); + + Map deserializedSpan = whenASpanIsWritten(span); + + verifyTopLevelTags(deserializedSpan, DDTraceId.from(123), 456L, 789L); + + Map spanContent = getContent(deserializedSpan); + Map deserializedMetrics = getMetrics(spanContent); + Map deserializedMeta = getMeta(spanContent); + + assertEquals( + longValue.substring(0, MAX_META_STRING_VALUE_LENGTH), deserializedMeta.get("custom.tag")); + assertEquals( + MAX_META_STRING_VALUE_LENGTH, ((String) deserializedMeta.get("custom.tag")).length()); + assertEquals(exactValue, deserializedMeta.get("exact.tag")); + assertEquals(42, deserializedMetrics.get("custom.metric")); + } + + @Test + void truncatesPayloadMetadataValues() { + String longValue = repeat("m", MAX_META_STRING_VALUE_LENGTH + 1); + CiVisibilityWellKnownTags wellKnownTags = + new CiVisibilityWellKnownTags( + longValue, longValue, longValue, longValue, longValue, longValue, longValue, longValue, + longValue, longValue); + CiTestCycleMapperV1 mapper = new CiTestCycleMapperV1(wellKnownTags, false); + List> traces = + Collections.singletonList( + Collections.singletonList( + generateRandomSpan(InternalSpanTypes.TEST, Collections.emptyMap()))); + PayloadVerifier verifier = new PayloadVerifier(wellKnownTags, traces, mapper); + MsgPackWriter packer = new MsgPackWriter(new FlushingBuffer(100 << 10, verifier)); + + packer.format(traces.get(0), mapper); + packer.flush(); + + verifier.verifyTracesConsumed(); + } + + @Test + void verifyTestSuiteEndEventIsWrittenCorrectly() { + Map extraTags = new HashMap<>(); + extraTags.put(Tags.TEST_SESSION_ID, DDTraceId.from(123)); + extraTags.put(Tags.TEST_MODULE_ID, 456L); + extraTags.put(Tags.TEST_SUITE_ID, 789L); + TraceGenerator.PojoSpan span = generateRandomSpan(InternalSpanTypes.TEST_SUITE_END, extraTags); + + Map deserializedSpan = whenASpanIsWritten(span); + + verifyTopLevelTags(deserializedSpan, DDTraceId.from(123), 456L, 789L); + + Map spanContent = getContent(deserializedSpan); + assertFalse(spanContent.containsKey("trace_id")); + assertFalse(spanContent.containsKey("span_id")); + assertFalse(spanContent.containsKey("parent_id")); + } + + @Test + void verifyTestModuleEndEventIsWrittenCorrectly() { + Map extraTags = new HashMap<>(); + extraTags.put(Tags.TEST_SESSION_ID, DDTraceId.from(123)); + extraTags.put(Tags.TEST_MODULE_ID, 456L); + TraceGenerator.PojoSpan span = generateRandomSpan(InternalSpanTypes.TEST_MODULE_END, extraTags); + + Map deserializedSpan = whenASpanIsWritten(span); + + verifyTopLevelTags(deserializedSpan, DDTraceId.from(123), 456L, null); + + Map spanContent = getContent(deserializedSpan); + assertFalse(spanContent.containsKey("trace_id")); + assertFalse(spanContent.containsKey("span_id")); + assertFalse(spanContent.containsKey("parent_id")); + } + + @Test + void verifyResultIsNotAffectedBySuccessiveMappingCalls() { + Map extraTags = new HashMap<>(); + extraTags.put(Tags.TEST_SESSION_ID, DDTraceId.from(123)); + extraTags.put(Tags.TEST_MODULE_ID, 456L); + extraTags.put(Tags.TEST_SUITE_ID, 789L); + TraceGenerator.PojoSpan span = generateRandomSpan(InternalSpanTypes.TEST, extraTags); + + whenASpanIsWritten(span); + Map deserializedSpan = whenASpanIsWritten(span); + + verifyTopLevelTags(deserializedSpan, DDTraceId.from(123), 456L, 789L); + + Map spanContent = getContent(deserializedSpan); + assertTrue(spanContent.containsKey("trace_id")); + assertTrue(spanContent.containsKey("span_id")); + assertTrue(spanContent.containsKey("parent_id")); + } + + @SuppressWarnings("unchecked") + private static Map getContent(Map deserializedSpan) { + return (Map) deserializedSpan.get("content"); + } + + @SuppressWarnings("unchecked") + private static Map getMetrics(Map spanContent) { + return (Map) spanContent.get("metrics"); + } + + @SuppressWarnings("unchecked") + private static Map getMeta(Map spanContent) { + return (Map) spanContent.get("meta"); + } + + private static void verifyTopLevelTags( + Map deserializedSpan, + DDTraceId testSessionId, + Long testModuleId, + Long testSuiteId) { + Map spanContent = getContent(deserializedSpan); + Map deserializedMetrics = getMetrics(spanContent); + Map deserializedMeta = getMeta(spanContent); + + if (testSessionId != null) { + assertEquals( + testSessionId.toLong(), ((Number) spanContent.get(Tags.TEST_SESSION_ID)).longValue()); + } else { + assertFalse(spanContent.containsKey(Tags.TEST_SESSION_ID)); + } + + if (testModuleId != null) { + assertEquals( + testModuleId.longValue(), ((Number) spanContent.get(Tags.TEST_MODULE_ID)).longValue()); + } else { + assertFalse(spanContent.containsKey(Tags.TEST_MODULE_ID)); + } + + if (testSuiteId != null) { + assertEquals( + testSuiteId.longValue(), ((Number) spanContent.get(Tags.TEST_SUITE_ID)).longValue()); + } else { + assertFalse(spanContent.containsKey(Tags.TEST_SUITE_ID)); + } + + assertFalse(deserializedMetrics.containsKey(Tags.TEST_SESSION_ID)); + assertFalse(deserializedMetrics.containsKey(Tags.TEST_MODULE_ID)); + assertFalse(deserializedMetrics.containsKey(Tags.TEST_SUITE_ID)); + + assertFalse(deserializedMeta.containsKey(Tags.TEST_SESSION_ID)); + assertFalse(deserializedMeta.containsKey(Tags.TEST_MODULE_ID)); + assertFalse(deserializedMeta.containsKey(Tags.TEST_SUITE_ID)); + } + + @SuppressWarnings("unchecked") + private static Map whenASpanIsWritten(TraceGenerator.PojoSpan span) { + List trace = Collections.singletonList(span); + + CiVisibilityWellKnownTags wellKnownTags = + new CiVisibilityWellKnownTags( + "runtimeid", + "my-env", + "language", + "my-runtime-name", + "my-runtime-version", + "my-runtime-vendor", + "my-os-arch", + "my-os-platform", + "my-os-version", + "false"); + CiTestCycleMapperV1 mapper = new CiTestCycleMapperV1(wellKnownTags, false); + + CaptureConsumer consumer = new CaptureConsumer(); + MsgPackWriter packer = new MsgPackWriter(new FlushingBuffer(100 << 10, consumer)); + + packer.format(trace, mapper); + packer.flush(); + + ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory()); + try { + return (Map) objectMapper.readValue(consumer.bytes, Object.class); + } catch (IOException e) { + fail("Failed to deserialize span: " + e.getMessage()); + return null; + } + } + + private static String repeat(String s, int count) { + StringBuilder sb = new StringBuilder(s.length() * count); + for (int i = 0; i < count; i++) { + sb.append(s); + } + return sb.toString(); + } + + private static void assertEqualsWithNullAsEmpty(CharSequence expected, CharSequence actual) { + if (null == expected) { + assertEquals("", actual); + } else { + assertEquals(expected.toString(), actual.toString()); + } + } + + private static final class CaptureConsumer implements ByteBufferConsumer { + private byte[] bytes; + + @Override + public void accept(int messageCount, ByteBuffer buffer) { + this.bytes = new byte[buffer.limit() - buffer.position()]; + buffer.get(bytes); + } + } + + private static final class PayloadVerifier implements ByteBufferConsumer, WritableByteChannel { + + private final List> expectedTraces; + private final CiTestCycleMapperV1 mapper; + private final CiVisibilityWellKnownTags wellKnownTags; + private ByteBuffer captured = ByteBuffer.allocate(200 << 10); + + private int position = 0; + + private PayloadVerifier( + CiVisibilityWellKnownTags wellKnownTags, + List> traces, + CiTestCycleMapperV1 mapper) { + this.expectedTraces = traces; + this.mapper = mapper; + this.wellKnownTags = wellKnownTags; + } + + void skipLargeTrace() { + ++position; + } + + void verifyTracesConsumed() { + assertEquals(expectedTraces.size(), position); + } + + @Override + public void accept(int messageCount, ByteBuffer buffer) { + if (expectedTraces.isEmpty() && messageCount == 0) { + return; + } + + try { + Payload payload = mapper.newPayload().withBody(messageCount, buffer); + payload.writeTo(this); + captured.flip(); + assertNotNull(payload.toRequest()); + MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(captured); + assertEquals(3, unpacker.unpackMapHeader()); + assertEquals("version", unpacker.unpackString()); + assertEquals(1, unpacker.unpackInt()); + assertEquals("metadata", unpacker.unpackString()); + assertEquals(1, unpacker.unpackMapHeader()); + assertEquals("*", unpacker.unpackString()); + + assertEquals(10, unpacker.unpackMapHeader()); + assertEquals("env", unpacker.unpackString()); + assertEquals( + truncate(wellKnownTags.getEnv().toString(), MAX_META_STRING_VALUE_LENGTH), + unpacker.unpackString()); + assertEquals("runtime-id", unpacker.unpackString()); + assertEquals( + truncate(wellKnownTags.getRuntimeId().toString(), MAX_META_STRING_VALUE_LENGTH), + unpacker.unpackString()); + assertEquals("language", unpacker.unpackString()); + assertEquals( + truncate(wellKnownTags.getLanguage().toString(), MAX_META_STRING_VALUE_LENGTH), + unpacker.unpackString()); + assertEquals(Tags.RUNTIME_NAME, unpacker.unpackString()); + assertEquals( + truncate(wellKnownTags.getRuntimeName().toString(), MAX_META_STRING_VALUE_LENGTH), + unpacker.unpackString()); + assertEquals(Tags.RUNTIME_VENDOR, unpacker.unpackString()); + assertEquals( + truncate(wellKnownTags.getRuntimeVendor().toString(), MAX_META_STRING_VALUE_LENGTH), + unpacker.unpackString()); + assertEquals(Tags.RUNTIME_VERSION, unpacker.unpackString()); + assertEquals( + truncate(wellKnownTags.getRuntimeVersion().toString(), MAX_META_STRING_VALUE_LENGTH), + unpacker.unpackString()); + assertEquals(Tags.OS_ARCHITECTURE, unpacker.unpackString()); + assertEquals( + truncate(wellKnownTags.getOsArch().toString(), MAX_META_STRING_VALUE_LENGTH), + unpacker.unpackString()); + assertEquals(Tags.OS_PLATFORM, unpacker.unpackString()); + assertEquals( + truncate(wellKnownTags.getOsPlatform().toString(), MAX_META_STRING_VALUE_LENGTH), + unpacker.unpackString()); + assertEquals(Tags.OS_VERSION, unpacker.unpackString()); + assertEquals( + truncate(wellKnownTags.getOsVersion().toString(), MAX_META_STRING_VALUE_LENGTH), + unpacker.unpackString()); + assertEquals(DDTags.TEST_IS_USER_PROVIDED_SERVICE, unpacker.unpackString()); + assertEquals( + truncate( + wellKnownTags.getIsUserProvidedService().toString(), MAX_META_STRING_VALUE_LENGTH), + unpacker.unpackString()); + + assertEquals("events", unpacker.unpackString()); + + List expectedTrace = expectedTraces.get(position++); + int eventCount = unpacker.unpackArrayHeader(); + while (expectedTrace.size() < eventCount) { + expectedTrace.addAll(expectedTraces.get(position++)); + } + assertEquals(expectedTrace.size(), eventCount); + for (int k = 0; k < eventCount; ++k) { + TraceGenerator.PojoSpan expectedSpan = expectedTrace.get(k); + assertEquals(3, unpacker.unpackMapHeader()); + assertEquals("type", unpacker.unpackString()); + if ("test".equals(String.valueOf(expectedSpan.getType()))) { + assertEquals("test", unpacker.unpackString()); + } else { + assertEquals("span", unpacker.unpackString()); + } + assertEquals("version", unpacker.unpackString()); + assertEquals(1, unpacker.unpackInt()); + assertEquals("content", unpacker.unpackString()); + assertEquals(11, unpacker.unpackMapHeader()); + assertEquals("trace_id", unpacker.unpackString()); + long traceId = unpacker.unpackValue().asNumberValue().toLong(); + assertEquals(expectedSpan.getTraceId().toLong(), traceId); + assertEquals("span_id", unpacker.unpackString()); + long spanId = unpacker.unpackValue().asNumberValue().toLong(); + assertEquals(expectedSpan.getSpanId(), spanId); + assertEquals("parent_id", unpacker.unpackString()); + long parentId = unpacker.unpackValue().asNumberValue().toLong(); + assertEquals(expectedSpan.getParentId(), parentId); + assertEquals("service", unpacker.unpackString()); + String serviceName = unpacker.unpackString(); + assertEqualsWithNullAsEmpty(expectedSpan.getServiceName(), serviceName); + assertEquals("name", unpacker.unpackString()); + String operationName = unpacker.unpackString(); + assertEqualsWithNullAsEmpty(expectedSpan.getOperationName(), operationName); + assertEquals("resource", unpacker.unpackString()); + String resourceName = unpacker.unpackString(); + assertEqualsWithNullAsEmpty(expectedSpan.getResourceName(), resourceName); + + assertEquals("start", unpacker.unpackString()); + long startTime = unpacker.unpackLong(); + assertEquals(expectedSpan.getStartTime(), startTime); + assertEquals("duration", unpacker.unpackString()); + long duration = unpacker.unpackLong(); + assertEquals(expectedSpan.getDurationNano(), duration); + assertEquals("error", unpacker.unpackString()); + int error = unpacker.unpackInt(); + assertEquals(expectedSpan.getError(), error); + assertEquals("metrics", unpacker.unpackString()); + int metricsSize = unpacker.unpackMapHeader(); + HashMap metrics = new HashMap<>(); + for (int j = 0; j < metricsSize; ++j) { + String key = unpacker.unpackString(); + Number n = null; + MessageFormat format = unpacker.getNextFormat(); + if (format == NEGFIXINT + || format == POSFIXINT + || format == INT8 + || format == UINT8 + || format == INT16 + || format == UINT16 + || format == INT32 + || format == UINT32) { + n = unpacker.unpackInt(); + } else if (format == INT64 || format == UINT64) { + n = unpacker.unpackLong(); + } else if (format == FLOAT32) { + n = unpacker.unpackFloat(); + } else if (format == FLOAT64) { + n = unpacker.unpackDouble(); + } else { + fail("Unexpected type in metrics values: " + format); + } + if (DD_MEASURED.toString().equals(key)) { + assertTrue( + (n != null && n.intValue() == 1 && expectedSpan.isMeasured()) + || !expectedSpan.isMeasured()); + } else if (DDSpanContext.PRIORITY_SAMPLING_KEY.equals(key)) { + // check that priority sampling is only on first and last span + if (k == 0 || k == eventCount - 1) { + assertEquals(expectedSpan.samplingPriority(), n.intValue()); + } else { + assertFalse(expectedSpan.hasSamplingPriority()); + } + } else { + metrics.put(key, n); + } + } + for (Map.Entry metric : metrics.entrySet()) { + if (metric.getValue() instanceof Double || metric.getValue() instanceof Float) { + assertEquals( + ((Number) expectedSpan.getTag(metric.getKey())).doubleValue(), + metric.getValue().doubleValue(), + 0.001); + } else { + assertEquals(expectedSpan.getTag(metric.getKey()), metric.getValue()); + } + } + assertEquals("meta", unpacker.unpackString()); + int metaSize = unpacker.unpackMapHeader(); + HashMap meta = new HashMap<>(); + for (int j = 0; j < metaSize; ++j) { + meta.put(unpacker.unpackString(), unpacker.unpackString()); + } + for (Map.Entry entry : meta.entrySet()) { + if (Tags.HTTP_STATUS.equals(entry.getKey())) { + assertEquals(String.valueOf(expectedSpan.getHttpStatusCode()), entry.getValue()); + } else { + Object tag = expectedSpan.getTag(entry.getKey()); + if (null != tag) { + assertEquals(String.valueOf(tag), entry.getValue()); + } else { + assertEquals(expectedSpan.getBaggage().get(entry.getKey()), entry.getValue()); + } + } + } + } + } catch (IOException e) { + fail(e.getMessage()); + } finally { + mapper.reset(); + captured.position(0); + captured.limit(captured.capacity()); + } + } + + @Override + public int write(ByteBuffer src) throws IOException { + if (captured.remaining() < src.remaining()) { + ByteBuffer newBuffer = ByteBuffer.allocate(captured.capacity() + src.capacity()); + captured.flip(); + newBuffer.put(captured); + captured = newBuffer; + return write(src); + } + captured.put(src); + return src.position(); + } + + @Override + public boolean isOpen() { + return true; + } + + @Override + public void close() throws IOException {} + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/common/metrics/AggregateEntryTest.java b/dd-trace-core/src/test/java/datadog/trace/common/metrics/AggregateEntryTest.java new file mode 100644 index 00000000000..dd70083d9d4 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/common/metrics/AggregateEntryTest.java @@ -0,0 +1,136 @@ +package datadog.trace.common.metrics; + +import static datadog.trace.bootstrap.instrumentation.api.UTF8BytesString.EMPTY; +import static datadog.trace.common.metrics.AggregateEntry.ERROR_TAG; +import static datadog.trace.common.metrics.AggregateEntry.TOP_LEVEL_TAG; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.metrics.agent.AgentMeter; +import datadog.metrics.api.statsd.StatsDClient; +import datadog.metrics.impl.DDSketchHistograms; +import datadog.metrics.impl.MonitoringImpl; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class AggregateEntryTest { + + @BeforeEach + void resetCardinalityHandlers() { + AggregateEntry.resetCardinalityHandlers(); + } + + @BeforeAll + static void initAgentMeter() { + // recordOneDuration -> Histogram.accept needs AgentMeter to be initialized. + MonitoringImpl monitoring = new MonitoringImpl(StatsDClient.NO_OP, 1, TimeUnit.SECONDS); + AgentMeter.registerIfAbsent(StatsDClient.NO_OP, monitoring, DDSketchHistograms.FACTORY); + monitoring.newTimer("test.init"); + } + + @Test + void recordOneDurationSumsToTotal() { + AggregateEntry entry = newEntry(); + entry.recordOneDuration(1L); + entry.recordOneDuration(2L); + entry.recordOneDuration(3L); + assertEquals(6, entry.getDuration()); + } + + @Test + void clearResetsAllCounters() { + AggregateEntry entry = newEntry(); + entry.recordOneDuration(5L); + entry.recordOneDuration(ERROR_TAG | 6L); + entry.recordOneDuration(TOP_LEVEL_TAG | 7L); + entry.clear(); + assertEquals(0, entry.getDuration()); + assertEquals(0, entry.getErrorCount()); + assertEquals(0, entry.getTopLevelCount()); + assertEquals(0, entry.getHitCount()); + } + + @Test + void recordOneDurationAccumulatesOkErrorAndTopLevel() { + AggregateEntry entry = newEntry(); + entry.recordOneDuration(10L); + entry.recordOneDuration(10L | TOP_LEVEL_TAG); + entry.recordOneDuration(10L | ERROR_TAG); + + assertEquals(3, entry.getHitCount()); + assertEquals(30, entry.getDuration()); + assertEquals(1, entry.getErrorCount()); + assertEquals(1, entry.getTopLevelCount()); + } + + @Test + void hitCountIncludesErrors() { + AggregateEntry entry = newEntry(); + entry.recordOneDuration(1L); + entry.recordOneDuration(2L); + entry.recordOneDuration(3L | ERROR_TAG); + assertEquals(3, entry.getHitCount()); + assertEquals(1, entry.getErrorCount()); + } + + @Test + void okAndErrorLatenciesTrackedSeparately() { + AggregateEntry entry = newEntry(); + long[] durations = { + 1L, 100L | ERROR_TAG, 2L, 99L | ERROR_TAG, 3L, 98L | ERROR_TAG, 4L, 97L | ERROR_TAG + }; + for (long d : durations) { + entry.recordOneDuration(d); + } + assertTrue(entry.getErrorLatencies().getMaxValue() >= 99); + assertTrue(entry.getOkLatencies().getMaxValue() <= 5); + } + + @Test + void absentOptionalFieldsResolveToEmptySentinel() { + // serviceSource / httpMethod / httpEndpoint / grpcStatusCode = null on input -> EMPTY on the + // entry. EMPTY is the universal "absent" sentinel; SerializingMetricWriter and equality use + // identity comparison against it. + AggregateEntry entry = newEntry(); + assertSame(EMPTY, entry.getServiceSource()); + assertSame(EMPTY, entry.getHttpMethod()); + assertSame(EMPTY, entry.getHttpEndpoint()); + assertSame(EMPTY, entry.getGrpcStatusCode()); + } + + @Test + void presentOptionalFieldsCarryTheirValue() { + AggregateEntry entry = + AggregateEntryTestUtils.of( + "resource", + "svc", + "op", + "src", + "type", + 200, + false, + true, + "client", + null, + "GET", + "/api/v1/foo", + "0"); + assertNotSame(EMPTY, entry.getServiceSource()); + assertNotSame(EMPTY, entry.getHttpMethod()); + assertNotSame(EMPTY, entry.getHttpEndpoint()); + assertNotSame(EMPTY, entry.getGrpcStatusCode()); + assertEquals("src", entry.getServiceSource().toString()); + assertEquals("GET", entry.getHttpMethod().toString()); + assertEquals("/api/v1/foo", entry.getHttpEndpoint().toString()); + assertEquals("0", entry.getGrpcStatusCode().toString()); + } + + private static AggregateEntry newEntry() { + return AggregateEntryTestUtils.of( + "resource", "svc", "op", null, "type", 200, false, true, "client", null, null, null, null); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/common/metrics/AggregateEntryTestUtils.java b/dd-trace-core/src/test/java/datadog/trace/common/metrics/AggregateEntryTestUtils.java new file mode 100644 index 00000000000..60e0badcb7f --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/common/metrics/AggregateEntryTestUtils.java @@ -0,0 +1,146 @@ +package datadog.trace.common.metrics; + +import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; +import java.util.Collections; +import java.util.List; +import java.util.Objects; +import javax.annotation.Nullable; + +/** + * Test-side helpers for {@link AggregateEntry}: a positional-args fixture factory plus a field-wise + * equality contract for use with Spock mock argument matchers and JUnit assertions. Lives in {@code + * src/test} so the production class stays free of test-only API; same {@code + * datadog.trace.common.metrics} package so this helper can reach package-private members. + * + *

      Production {@code AggregateEntry} intentionally has no {@code equals}/{@code hashCode} + * override -- {@link AggregateTable} bucketing goes through the {@code Canonical} scratch buffer + * keyed on {@link AggregateEntry#keyHash}, and no production code path invokes {@link + * Object#equals}. + * + *

      Peer tags live as a single pre-encoded {@code List} on the entry + * (canonicalization through {@link PeerTagSchema#register} already collapsed identical values), so + * equality compares the list directly. The hash side (computed in {@link AggregateEntry#hashOf}) + * folds in the encoded list, so the contract stays consistent. + */ +public final class AggregateEntryTestUtils { + private AggregateEntryTestUtils() {} + + /** + * Builds an {@link AggregateEntry} from positional args. Bypasses the cardinality handlers so + * tests can create expected values without mutating shared handler state. Content-equal entries + * from {@link AggregateEntry.Canonical#createEntry} still compare equal via {@link + * #equals(AggregateEntry, AggregateEntry)}. + */ + public static AggregateEntry of( + CharSequence resource, + CharSequence service, + CharSequence operationName, + @Nullable CharSequence serviceSource, + CharSequence type, + int httpStatusCode, + boolean synthetic, + boolean traceRoot, + CharSequence spanKind, + @Nullable List peerTags, + @Nullable CharSequence httpMethod, + @Nullable CharSequence httpEndpoint, + @Nullable CharSequence grpcStatusCode) { + UTF8BytesString resourceUtf = AggregateEntry.createUtf8(resource); + UTF8BytesString serviceUtf = AggregateEntry.createUtf8(service); + UTF8BytesString operationNameUtf = AggregateEntry.createUtf8(operationName); + UTF8BytesString serviceSourceUtf = AggregateEntry.createUtf8(serviceSource); + UTF8BytesString typeUtf = AggregateEntry.createUtf8(type); + UTF8BytesString spanKindUtf = AggregateEntry.createUtf8(spanKind); + UTF8BytesString httpMethodUtf = AggregateEntry.createUtf8(httpMethod); + UTF8BytesString httpEndpointUtf = AggregateEntry.createUtf8(httpEndpoint); + UTF8BytesString grpcUtf = AggregateEntry.createUtf8(grpcStatusCode); + List peerTagsList = peerTags == null ? Collections.emptyList() : peerTags; + UTF8BytesString[] peerTagsArr = peerTagsList.toArray(new UTF8BytesString[0]); + long keyHash = + AggregateEntry.hashOf( + resourceUtf, + serviceUtf, + operationNameUtf, + serviceSourceUtf, + typeUtf, + spanKindUtf, + httpMethodUtf, + httpEndpointUtf, + grpcUtf, + (short) httpStatusCode, + synthetic, + traceRoot, + peerTagsArr, + peerTagsArr.length); + return new AggregateEntry( + keyHash, + resourceUtf, + serviceUtf, + operationNameUtf, + serviceSourceUtf, + typeUtf, + spanKindUtf, + httpMethodUtf, + httpEndpointUtf, + grpcUtf, + (short) httpStatusCode, + synthetic, + traceRoot, + peerTagsList); + } + + /** + * Records one OK hit of {@code durationNanos} on {@code e}. Exposes the package-private {@link + * AggregateEntry#recordOneDuration} to tests in other packages (e.g. the OTLP metrics writer + * tests) without widening the production mutation API. + */ + public static AggregateEntry recordOk(AggregateEntry e, long durationNanos) { + return e.recordOneDuration(durationNanos); + } + + /** Records one error hit of {@code durationNanos} on {@code e}. See {@link #recordOk}. */ + public static AggregateEntry recordError(AggregateEntry e, long durationNanos) { + return e.recordOneDuration(durationNanos | AggregateEntry.ERROR_TAG); + } + + /** Records one top-level OK hit of {@code durationNanos} on {@code e}. See {@link #recordOk}. */ + public static AggregateEntry recordTopLevel(AggregateEntry e, long durationNanos) { + return e.recordOneDuration(durationNanos | AggregateEntry.TOP_LEVEL_TAG); + } + + /** Clears the per-cycle counters and histograms on {@code e}. See {@link #recordOk}. */ + public static void clear(AggregateEntry e) { + e.clear(); + } + + /** + * Whether {@code a} and {@code b} carry identical label fields. Counter and histogram state is + * intentionally excluded -- this compares the key identity, not the aggregate. + */ + public static boolean equals(AggregateEntry a, AggregateEntry b) { + if (a == b) return true; + if (a == null || b == null) return false; + return a.getHttpStatusCode() == b.getHttpStatusCode() + && a.isSynthetics() == b.isSynthetics() + && a.isTraceRoot() == b.isTraceRoot() + && Objects.equals(a.getResource(), b.getResource()) + && Objects.equals(a.getService(), b.getService()) + && Objects.equals(a.getOperationName(), b.getOperationName()) + && Objects.equals(a.getServiceSource(), b.getServiceSource()) + && Objects.equals(a.getType(), b.getType()) + && Objects.equals(a.getSpanKind(), b.getSpanKind()) + && a.getPeerTags().equals(b.getPeerTags()) + && Objects.equals(a.getHttpMethod(), b.getHttpMethod()) + && Objects.equals(a.getHttpEndpoint(), b.getHttpEndpoint()) + && Objects.equals(a.getGrpcStatusCode(), b.getGrpcStatusCode()); + } + + /** + * Stable hash matching {@link #equals(AggregateEntry, AggregateEntry)} -- derived from {@link + * AggregateEntry#keyHash}, which {@link AggregateEntry#hashOf} computes from the same fields the + * helper's {@code equals} compares. + */ + public static int hashCode(AggregateEntry e) { + return e == null ? 0 : (int) e.keyHash; + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/common/metrics/AggregateTableTest.java b/dd-trace-core/src/test/java/datadog/trace/common/metrics/AggregateTableTest.java new file mode 100644 index 00000000000..05acd57985d --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/common/metrics/AggregateTableTest.java @@ -0,0 +1,374 @@ +package datadog.trace.common.metrics; + +import static datadog.trace.common.metrics.AggregateEntry.ERROR_TAG; +import static datadog.trace.common.metrics.AggregateEntry.TOP_LEVEL_TAG; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.metrics.agent.AgentMeter; +import datadog.metrics.api.statsd.StatsDClient; +import datadog.metrics.impl.DDSketchHistograms; +import datadog.metrics.impl.MonitoringImpl; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class AggregateTableTest { + + @BeforeAll + static void initAgentMeter() { + // AggregateEntry.recordOneDuration -> Histogram.accept needs AgentMeter to be initialized. + MonitoringImpl monitoring = new MonitoringImpl(StatsDClient.NO_OP, 1, TimeUnit.SECONDS); + AgentMeter.registerIfAbsent(StatsDClient.NO_OP, monitoring, DDSketchHistograms.FACTORY); + monitoring.newTimer("test.init"); + } + + @BeforeEach + void resetCardinalityHandlers() { + // AggregateEntry's property handlers are static and accumulate state across tests. Some tests + // in this class (e.g. backToBackEvictionsAllSucceed) drive 40 distinct services, which exceeds + // MetricCardinalityLimits.SERVICE (32) and leaves later tests seeing a shared "blocked" + // canonical for "a"/"b"/"c"-style services -- collapsing distinct snapshots into one entry. + AggregateEntry.resetCardinalityHandlers(); + } + + @Test + void insertOnMissReturnsNewAggregate() { + AggregateTable table = new AggregateTable(8); + SpanSnapshot s = snapshot("svc", "op", "client"); + + AggregateEntry agg = table.findOrInsert(s); + + assertNotNull(agg); + assertEquals(1, table.size()); + assertEquals(0, agg.getHitCount()); + } + + @Test + void hitReturnsSameAggregateInstance() { + AggregateTable table = new AggregateTable(8); + SpanSnapshot s1 = snapshot("svc", "op", "client"); + SpanSnapshot s2 = snapshot("svc", "op", "client"); + + AggregateEntry first = table.findOrInsert(s1); + AggregateEntry second = table.findOrInsert(s2); + + assertSame(first, second); + assertEquals(1, table.size()); + } + + @Test + void differentKindFieldsAreDistinct() { + AggregateTable table = new AggregateTable(8); + + AggregateEntry clientAgg = table.findOrInsert(snapshot("svc", "op", "client")); + AggregateEntry serverAgg = table.findOrInsert(snapshot("svc", "op", "server")); + + assertNotSame(clientAgg, serverAgg); + assertEquals(2, table.size()); + } + + @Test + void peerTagPairsParticipateInIdentity() { + AggregateTable table = new AggregateTable(8); + SpanSnapshot withTags = + builder("svc", "op", "client").peerTags("peer.hostname", "host-a").build(); + SpanSnapshot otherTags = + builder("svc", "op", "client").peerTags("peer.hostname", "host-b").build(); + SpanSnapshot noTags = builder("svc", "op", "client").build(); + + AggregateEntry a = table.findOrInsert(withTags); + AggregateEntry b = table.findOrInsert(otherTags); + AggregateEntry c = table.findOrInsert(noTags); + + assertNotSame(a, b); + assertNotSame(a, c); + assertNotSame(b, c); + assertEquals(3, table.size()); + } + + @Test + void capOverrunEvictsStaleEntry() { + AggregateTable table = new AggregateTable(2); + + AggregateEntry stale = table.findOrInsert(snapshot("svc-a", "op", "client")); + // do not record on stale -> hitCount stays at 0 + + AggregateEntry live = table.findOrInsert(snapshot("svc-b", "op", "client")); + live.recordOneDuration(10L | TOP_LEVEL_TAG); // hitCount=1, not evictable + + // table is full (size=2). Inserting a third should evict the stale one and succeed. + AggregateEntry newcomer = table.findOrInsert(snapshot("svc-c", "op", "client")); + assertNotNull(newcomer); + assertEquals(2, table.size()); + + // re-inserting the stale snapshot should miss now (it was evicted) and produce a fresh entry + AggregateEntry staleAgain = table.findOrInsert(snapshot("svc-a", "op", "client")); + assertNotSame(stale, staleAgain); + } + + @Test + void backToBackEvictionsAllSucceed() { + // Cursor amortization regression: cap the table, fill with stale entries, then force a + // sequence of cap-overrun inserts. Each insert must succeed (evicting one stale entry and + // inserting one new). The cursor field is internal, but if it were ever wedged (e.g. + // pointing past the end of buckets, or not advancing after a successful eviction), some + // later insert would fail to find a stale entry. Drives ~3x the capacity worth of inserts to + // give wrap-around plenty of chances to misbehave. + AggregateTable table = new AggregateTable(8); + for (int i = 0; i < 8; i++) { + table.findOrInsert(snapshot("init-" + i, "op", "client")); + } + for (int i = 0; i < 32; i++) { + AggregateEntry inserted = table.findOrInsert(snapshot("post-" + i, "op", "client")); + assertNotNull( + inserted, "insert #" + i + " should evict a stale entry and succeed (table full)"); + } + assertEquals(8, table.size()); + } + + @Test + void clearResetsCursorForSubsequentEvictions() { + // The cursor must reset to 0 on clear so a re-filled table doesn't start eviction at a + // stale bucket index. Verified indirectly: clear and re-fill, then force an eviction; the + // newcomer must successfully take a slot (which only works if a stale entry was found). + AggregateTable table = new AggregateTable(4); + + // Fill, age, evict once -- cursor lands at some non-zero bucket + for (int i = 0; i < 4; i++) { + table.findOrInsert(snapshot("warm-" + i, "op", "client")); + } + table.findOrInsert(snapshot("evict-trigger", "op", "client")); + + table.clear(); + assertEquals(0, table.size()); + + // Re-fill, age, force eviction -- should still find a stale entry from bucket 0 onward + for (int i = 0; i < 4; i++) { + table.findOrInsert(snapshot("fresh-" + i, "op", "client")); + } + AggregateEntry newcomer = table.findOrInsert(snapshot("post-clear", "op", "client")); + assertNotNull(newcomer, "post-clear cap-overrun insert must succeed via cursor-reset evict"); + } + + @Test + void capOverrunWithNoStaleReturnsNull() { + AggregateTable table = new AggregateTable(2); + + AggregateEntry a = table.findOrInsert(snapshot("svc-a", "op", "client")); + AggregateEntry b = table.findOrInsert(snapshot("svc-b", "op", "client")); + a.recordOneDuration(10L); + b.recordOneDuration(20L); + + AggregateEntry c = table.findOrInsert(snapshot("svc-c", "op", "client")); + assertNull(c); + assertEquals(2, table.size()); + } + + @Test + void expungeStaleAggregatesRemovesZeroHitsOnly() { + AggregateTable table = new AggregateTable(16); + + AggregateEntry live = table.findOrInsert(snapshot("svc-live", "op", "client")); + live.recordOneDuration(10L); + AggregateEntry stale1 = table.findOrInsert(snapshot("svc-stale1", "op", "client")); + AggregateEntry stale2 = table.findOrInsert(snapshot("svc-stale2", "op", "client")); + assertEquals(3, table.size()); + assertEquals(0, stale1.getHitCount()); + assertEquals(0, stale2.getHitCount()); + + table.expungeStaleAggregates(); + + assertEquals(1, table.size()); + // the live entry must still be reachable + assertSame(live, table.findOrInsert(snapshot("svc-live", "op", "client"))); + } + + @Test + void forEachVisitsEveryEntry() { + AggregateTable table = new AggregateTable(8); + table.findOrInsert(snapshot("a", "op", "client")).recordOneDuration(1L); + table.findOrInsert(snapshot("b", "op", "client")).recordOneDuration(2L); + table.findOrInsert(snapshot("c", "op", "client")).recordOneDuration(3L | ERROR_TAG); + + Map visited = new HashMap<>(); + table.forEach(e -> visited.put(e.getService().toString(), e.getDuration())); + + assertEquals(3, visited.size()); + assertEquals(1L, visited.get("a")); + assertEquals(2L, visited.get("b")); + assertEquals(3L, visited.get("c")); + } + + @Test + void clearEmptiesTheTable() { + AggregateTable table = new AggregateTable(8); + table.findOrInsert(snapshot("a", "op", "client")); + table.findOrInsert(snapshot("b", "op", "client")); + assertEquals(2, table.size()); + + table.clear(); + + assertTrue(table.isEmpty()); + assertEquals(0, table.size()); + // and re-insertion works after clear + assertNotNull(table.findOrInsert(snapshot("a", "op", "client"))); + } + + @Test + void encodedLabelsAreBuiltOnInsert() { + AggregateTable table = new AggregateTable(4); + List seen = new ArrayList<>(); + table.findOrInsert(snapshot("svc", "op", "client")); + table.forEach(seen::add); + + assertEquals(1, seen.size()); + AggregateEntry e = seen.get(0); + assertEquals("svc", e.getService().toString()); + assertEquals("op", e.getOperationName().toString()); + assertEquals("client", e.getSpanKind().toString()); + } + + @Test + void nullAndEmptyOptionalFieldsCollapseToOneEntry() { + // null and length-zero are treated as equivalent for optional fields, so snapshots that + // differ only in null-vs-"" land on the same entry. + AggregateTable table = new AggregateTable(8); + + SpanSnapshot snapNull = nullableSnapshot(null, null, null, null); + SpanSnapshot snapEmpty = nullableSnapshot("", "", "", ""); + + AggregateEntry first = table.findOrInsert(snapNull); + AggregateEntry secondNull = table.findOrInsert(nullableSnapshot(null, null, null, null)); + AggregateEntry forEmpty = table.findOrInsert(snapEmpty); + + assertSame(first, secondNull, "two null-fielded snapshots must hit the same entry"); + assertSame(first, forEmpty, "null- and empty-fielded snapshots must hit the same entry"); + assertEquals(1, table.size()); + } + + @Test + void nullServiceAndSpanKindDoNotNpeAndCollapseWithEmpty() { + // Null service and spanKind are accepted (canonicalize to length-zero) and collapse with + // empty-string variants onto the same entry. + AggregateTable table = new AggregateTable(8); + + SpanSnapshot allNulls = nullServiceKindSnapshot(null, null); + SpanSnapshot allEmpty = nullServiceKindSnapshot("", ""); + + AggregateEntry first = table.findOrInsert(allNulls); + AggregateEntry secondNull = table.findOrInsert(nullServiceKindSnapshot(null, null)); + AggregateEntry forEmpty = table.findOrInsert(allEmpty); + + assertSame(first, secondNull, "two null-service/-kind snapshots must hit the same entry"); + assertSame(first, forEmpty, "null- and empty-service/-kind snapshots must hit the same entry"); + assertEquals(1, table.size()); + assertEquals(0, first.getService().length(), "null serviceName should canonicalize to EMPTY"); + assertEquals(0, first.getSpanKind().length(), "null spanKind should canonicalize to EMPTY"); + } + + private static SpanSnapshot nullServiceKindSnapshot(String service, String spanKind) { + return new SpanSnapshot( + "resource", + service, + "op", + null, + "web", + (short) 200, + false, + true, + spanKind, + null, + null, + null, + null, + null, + 0L); + } + + private static SpanSnapshot nullableSnapshot( + String resource, String operation, String type, String serviceNameSource) { + return new SpanSnapshot( + resource, + "svc", + operation, + serviceNameSource, + type, + (short) 200, + false, + true, + "client", + null, + null, + null, + null, + null, + 0L); + } + + // ---------- helpers ---------- + + private static SpanSnapshot snapshot(String service, String operation, String spanKind) { + return builder(service, operation, spanKind).build(); + } + + private static SnapshotBuilder builder(String service, String operation, String spanKind) { + return new SnapshotBuilder(service, operation, spanKind); + } + + private static final class SnapshotBuilder { + private final String service; + private final String operation; + private final String spanKind; + private PeerTagSchema peerTagSchema; + private String[] peerTagValues; + private long tagAndDuration = 0L; + + SnapshotBuilder(String service, String operation, String spanKind) { + this.service = service; + this.operation = operation; + this.spanKind = spanKind; + } + + SnapshotBuilder peerTags(String... namesAndValues) { + int pairCount = namesAndValues.length / 2; + String[] names = new String[pairCount]; + String[] values = new String[pairCount]; + for (int i = 0; i < pairCount; i++) { + names[i] = namesAndValues[2 * i]; + values[i] = namesAndValues[2 * i + 1]; + } + this.peerTagSchema = new PeerTagSchema(names, PeerTagSchema.NO_STATE); + this.peerTagValues = values; + return this; + } + + SpanSnapshot build() { + return new SpanSnapshot( + "resource", + service, + operation, + null, + "web", + (short) 200, + false, + true, + spanKind, + peerTagSchema, + peerTagValues, + null, + null, + null, + tagAndDuration); + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/common/metrics/CardinalityHandlerTest.java b/dd-trace-core/src/test/java/datadog/trace/common/metrics/CardinalityHandlerTest.java new file mode 100644 index 00000000000..5a882aba11b --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/common/metrics/CardinalityHandlerTest.java @@ -0,0 +1,260 @@ +package datadog.trace.common.metrics; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertSame; + +import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; +import org.junit.jupiter.api.Test; + +class CardinalityHandlerTest { + + @Test + void propertyReturnsSameInstanceForRepeatedValueUntilLimit() { + PropertyCardinalityHandler h = new PropertyCardinalityHandler("test", 3); + UTF8BytesString a1 = h.register("a"); + UTF8BytesString a2 = h.register("a"); + assertSame(a1, a2); + assertEquals("a", a1.toString()); + } + + @Test + void propertyOverLimitReturnsBlockedSentinel() { + PropertyCardinalityHandler h = new PropertyCardinalityHandler("test", 2); + UTF8BytesString a = h.register("a"); + UTF8BytesString b = h.register("b"); + UTF8BytesString blocked1 = h.register("c"); + UTF8BytesString blocked2 = h.register("d"); + + assertEquals("tracer_blocked_value", blocked1.toString()); + assertSame(blocked1, blocked2); // same sentinel for all overflow values + assertNotSame(blocked1, a); + assertNotSame(blocked1, b); + } + + @Test + void propertyResetRefreshesBudget() { + PropertyCardinalityHandler h = new PropertyCardinalityHandler("test", 2); + h.register("a"); + h.register("b"); + UTF8BytesString blocked = h.register("c"); + assertEquals("tracer_blocked_value", blocked.toString()); + + h.reset(); + + // After reset, three distinct values fit again. Prior-cycle instances are reused + // (see propertyPriorCycleInstancesAreReusedAcrossReset for the dedicated check); here + // we just confirm that the budget refreshed so values previously blocked now have + // a slot. + UTF8BytesString afterReset = h.register("a"); + assertEquals("a", afterReset.toString()); + UTF8BytesString c = h.register("c"); + assertEquals("c", c.toString()); + UTF8BytesString blockedAgain = h.register("d"); + UTF8BytesString blockedYetAgain = h.register("e"); + assertEquals("tracer_blocked_value", blockedAgain.toString()); + assertSame(blockedAgain, blockedYetAgain); + } + + @Test + void propertyPriorCycleInstancesAreReusedAcrossReset() { + // Dual role: the handler is also a UTF8 cache. Values held in the prior cycle are + // reused on the first registration in the new cycle, so aggregate entries that hold a + // reference to a UTF8BytesString still match on identity after the per-cycle reset. + // This is the cache-survives-reset property the canonical-key lookup depends on. + PropertyCardinalityHandler h = new PropertyCardinalityHandler("test", 4); + UTF8BytesString aBefore = h.register("a"); + UTF8BytesString bBefore = h.register("b"); + + h.reset(); + + assertSame(aBefore, h.register("a")); + assertSame(bBefore, h.register("b")); + // Same-cycle subsequent registration continues to return the reused instance. + assertSame(aBefore, h.register("a")); + } + + @Test + void propertyPriorCycleReuseSurvivesOneResetButNotTwo() { + // Reuse window is one cycle deep -- the handler swaps current/prior on reset, so a + // value last seen two cycles ago is no longer cached and will be re-allocated. + PropertyCardinalityHandler h = new PropertyCardinalityHandler("test", 4); + UTF8BytesString first = h.register("a"); + + h.reset(); + h.reset(); + + UTF8BytesString afterTwoResets = h.register("a"); + assertNotSame(first, afterTwoResets); + assertEquals("a", afterTwoResets.toString()); + } + + @Test + void tagPrefixesValuesAndReusesUnderLimit() { + TagCardinalityHandler h = new TagCardinalityHandler("peer.hostname", 4); + UTF8BytesString first = h.register("host-a"); + UTF8BytesString second = h.register("host-a"); + UTF8BytesString other = h.register("host-b"); + + assertSame(first, second); + assertNotSame(first, other); + assertEquals("peer.hostname:host-a", first.toString()); + assertEquals("peer.hostname:host-b", other.toString()); + } + + @Test + void tagOverLimitReturnsTaggedSentinel() { + TagCardinalityHandler h = new TagCardinalityHandler("peer.service", 1); + h.register("svc-1"); + UTF8BytesString blocked = h.register("svc-2"); + assertEquals("peer.service:tracer_blocked_value", blocked.toString()); + } + + @Test + void tagResetRefreshesBudgetAndSentinelStaysStable() { + TagCardinalityHandler h = new TagCardinalityHandler("x", 1); + h.register("v1"); + UTF8BytesString blockedBefore = h.register("v2"); + h.reset(); + h.register("v1"); + UTF8BytesString blockedAfter = h.register("v2"); + // Both are the same sentinel instance (cacheBlocked is not cleared on reset). + assertSame(blockedBefore, blockedAfter); + } + + @Test + void tagPriorCycleInstancesAreReusedAcrossReset() { + // Mirrors propertyPriorCycleInstancesAreReusedAcrossReset: the pre-built "tag:value" + // UTF8BytesString from the prior cycle is reused on the first registration in the new + // cycle -- no re-concatenation, no re-encoding. + TagCardinalityHandler h = new TagCardinalityHandler("peer.hostname", 4); + UTF8BytesString hostABefore = h.register("host-a"); + UTF8BytesString hostBBefore = h.register("host-b"); + + h.reset(); + + assertSame(hostABefore, h.register("host-a")); + assertSame(hostBBefore, h.register("host-b")); + } + + @Test + void propertyRegisterOfNullReturnsEmpty() { + PropertyCardinalityHandler h = new PropertyCardinalityHandler("test", 4); + // Null input short-circuits to UTF8BytesString.EMPTY -- the universal "absent" sentinel that + // AggregateEntry's optional UTF8 fields use in place of null. + assertSame(UTF8BytesString.EMPTY, h.register(null)); + } + + @Test + void propertyRegisterOfNullDoesNotConsumeBudget() { + PropertyCardinalityHandler h = new PropertyCardinalityHandler("test", 2); + h.register(null); + h.register(null); + h.register(null); + // Three null registrations didn't consume the budget; two real values still fit. + assertEquals("a", h.register("a").toString()); + assertEquals("b", h.register("b").toString()); + // Third real value spills to the blocked sentinel (limit = 2). + assertEquals("tracer_blocked_value", h.register("c").toString()); + } + + @Test + void tagRegisterOfNullReturnsEmpty() { + TagCardinalityHandler h = new TagCardinalityHandler("peer.hostname", 4); + // Null returns EMPTY (no "tag:" prefix applied -- the sentinel is the same EMPTY singleton + // every handler returns for null input). + assertSame(UTF8BytesString.EMPTY, h.register(null)); + } + + @Test + void tagRegisterOfNullDoesNotConsumeBudget() { + TagCardinalityHandler h = new TagCardinalityHandler("peer.hostname", 2); + h.register(null); + h.register(null); + h.register(null); + // Three null registrations didn't consume the budget; two real values still fit. + assertEquals("peer.hostname:a", h.register("a").toString()); + assertEquals("peer.hostname:b", h.register("b").toString()); + // Third real value spills to the blocked sentinel (limit = 2). + assertEquals("peer.hostname:tracer_blocked_value", h.register("c").toString()); + } + + @Test + void propertyResetReturnsBlockedCount() { + PropertyCardinalityHandler h = new PropertyCardinalityHandler("test", 1); + h.register("a"); // within limit + h.register("b"); // blocked + h.register("c"); // blocked + assertEquals(2, h.reset()); + assertEquals(0, h.reset()); // no blocks in the empty new cycle + } + + @Test + void tagResetReturnsBlockedCount() { + TagCardinalityHandler h = new TagCardinalityHandler("peer.hostname", 1); + h.register("a"); // within limit + h.register("b"); // blocked + h.register("c"); // blocked + assertEquals(2, h.reset()); + assertEquals(0, h.reset()); // no blocks in the empty new cycle + } + + // ---- limits-disabled mode (Config flag off): cache size still capped, but over-cap values + // get freshly-allocated UTF8 rather than the blocked sentinel. + + @Test + void propertyOverLimitWithSentinelDisabledReturnsFreshUtf8() { + PropertyCardinalityHandler h = new PropertyCardinalityHandler("test", 2, false); + UTF8BytesString a = h.register("a"); + UTF8BytesString b = h.register("b"); + UTF8BytesString c = h.register("c"); + UTF8BytesString d = h.register("d"); + + // Real values (not the "tracer_blocked_value" sentinel) so the wire format carries them. + assertEquals("c", c.toString()); + assertEquals("d", d.toString()); + // The first two stay cached and identity-stable. + assertSame(a, h.register("a")); + assertSame(b, h.register("b")); + // Over-cap values are NOT cached -- a second call allocates a fresh instance. + assertNotSame(c, h.register("c")); + assertEquals("c", h.register("c").toString()); + } + + @Test + void propertyOverLimitWithSentinelDisabledReusesPriorCycleInstances() { + // Prior-cycle reuse runs in disabled mode too: a value that was seen last cycle but is now + // over-budget still gets its prior-cycle UTF8BytesString back instead of an allocation. + PropertyCardinalityHandler h = new PropertyCardinalityHandler("test", 2, false); + UTF8BytesString cBeforeReset = h.register("c"); + + h.reset(); + + // Fill the budget with two different values so "c" lands over-cap. + h.register("x"); + h.register("y"); + UTF8BytesString cAfterReset = h.register("c"); + assertSame(cBeforeReset, cAfterReset); + } + + @Test + void tagOverLimitWithSentinelDisabledReturnsFreshUtf8() { + TagCardinalityHandler h = new TagCardinalityHandler("peer.hostname", 1, false); + h.register("host-a"); + UTF8BytesString hostB = h.register("host-b"); + UTF8BytesString hostC = h.register("host-c"); + + assertEquals("peer.hostname:host-b", hostB.toString()); + assertEquals("peer.hostname:host-c", hostC.toString()); + } + + @Test + void tagOverLimitWithSentinelDisabledNeverSubstitutesBlockedSentinel() { + // The sentinel should never materialize in disabled mode -- over-cap values carry their real + // "tag:value" content rather than the blocked sentinel. + TagCardinalityHandler h = new TagCardinalityHandler("peer.service", 1, false); + h.register("svc-1"); + UTF8BytesString overCap = h.register("svc-2"); + assertEquals("peer.service:svc-2", overCap.toString()); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/common/metrics/ClientStatsAggregatorBootstrapTest.java b/dd-trace-core/src/test/java/datadog/trace/common/metrics/ClientStatsAggregatorBootstrapTest.java new file mode 100644 index 00000000000..758f5db9910 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/common/metrics/ClientStatsAggregatorBootstrapTest.java @@ -0,0 +1,342 @@ +package datadog.trace.common.metrics; + +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.atLeastOnce; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import datadog.communication.ddagent.DDAgentFeaturesDiscovery; +import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; +import datadog.trace.core.CoreSpan; +import datadog.trace.core.SpanKindFilter; +import datadog.trace.core.monitor.HealthMetrics; +import java.util.Arrays; +import java.util.Collections; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.concurrent.CountDownLatch; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; + +/** + * Coverage for the {@code ClientStatsAggregator} peer-tag schema bootstrap and reconcile paths. + * + *

        + *
      • {@link #bootstrapHappensOnceOnFirstPublish()} -- verifies the synchronized producer-side + * bootstrap runs exactly once and is skipped on subsequent publishes. + *
      • {@link #reconcileSkipsDeepCompareWhenStateMatches()} -- verifies the aggregator-thread + * reconcile's state-only fast path: when the cached schema's {@code state} matches {@code + * features.state()}, reconcile returns without calling {@code features.peerTags()}. + *
      • {@link #reconcileSurvivesStateChangeWhenTagsUnchanged()} -- verifies that when the + * discovery state hash changes but the tag set is identical, the schema continues to function + * correctly across cycles. + *
      • {@link #reconcileSwapsSchemaWhenTagSetChanges()} -- verifies the slow-path swap branch: + * when discovery refreshes with a new tag set, the cached schema is replaced and subsequent + * publishes see the new tags. + *
      + */ +class ClientStatsAggregatorBootstrapTest { + + @Test + void bootstrapHappensOnceOnFirstPublish() { + // Producer-side bootstrap is synchronized; we want to confirm only the first publish + // queries features and subsequent publishes hit the cached schema. + HealthMetrics healthMetrics = mock(HealthMetrics.class); + MetricWriter writer = mock(MetricWriter.class); + Sink sink = mock(Sink.class); + DDAgentFeaturesDiscovery features = mock(DDAgentFeaturesDiscovery.class); + when(features.supportsMetrics()).thenReturn(true); + when(features.peerTags()).thenReturn(Collections.singleton("peer.hostname")); + when(features.state()).thenReturn("state-1"); + + ClientStatsAggregator aggregator = + new ClientStatsAggregator( + Collections.emptySet(), + features, + healthMetrics, + sink, + writer, + /* maxAggregates */ 16, + /* queueSize */ 64, + /* reportingInterval */ 10, + SECONDS, + /* includeEndpointInMetrics */ false); + + // Do not start the aggregator thread -- reconcile must not run, only bootstrap. + aggregator.publish(Collections.>singletonList(peerAggregationSpan())); + aggregator.publish(Collections.>singletonList(peerAggregationSpan())); + aggregator.publish(Collections.>singletonList(peerAggregationSpan())); + + // Bootstrap is the only path that queries features for peer-tag schema, and it runs + // exactly once across three publishes. + verify(features, times(1)).peerTags(); + verify(features, times(1)).state(); + aggregator.close(); + } + + @Test + void reconcileSkipsDeepCompareWhenStateMatches() throws Exception { + // Two reporting cycles with the same (mocked-constant) discovery state -- the second + // reconcile must short-circuit on the state compare and avoid touching peerTags(). + HealthMetrics healthMetrics = mock(HealthMetrics.class); + MetricWriter writer = mock(MetricWriter.class); + Sink sink = mock(Sink.class); + DDAgentFeaturesDiscovery features = mock(DDAgentFeaturesDiscovery.class); + when(features.supportsMetrics()).thenReturn(true); + when(features.peerTags()).thenReturn(Collections.singleton("peer.hostname")); + when(features.state()).thenReturn("state-1"); + + ClientStatsAggregator aggregator = + new ClientStatsAggregator( + Collections.emptySet(), + features, + healthMetrics, + sink, + writer, + /* maxAggregates */ 16, + /* queueSize */ 64, + /* reportingInterval */ 10, + SECONDS, + /* includeEndpointInMetrics */ false); + aggregator.start(); + try { + CountDownLatch cycle1 = new CountDownLatch(1); + CountDownLatch cycle2 = new CountDownLatch(1); + // Both reports flush a bucket; the cycle1/cycle2 countdowns synchronize the test thread + // with the aggregator thread's per-cycle completion. + org.mockito.Mockito.doAnswer( + invocation -> { + cycle1.countDown(); + return null; + }) + .doAnswer( + invocation -> { + cycle2.countDown(); + return null; + }) + .when(writer) + .finishBucket(); + + aggregator.publish(Collections.>singletonList(peerAggregationSpan())); + aggregator.report(); + assertTrue(cycle1.await(2, SECONDS)); + + aggregator.publish(Collections.>singletonList(peerAggregationSpan())); + aggregator.report(); + assertTrue(cycle2.await(2, SECONDS)); + + // peerTags() is called only by bootstrap; both reconciles short-circuit on the state + // fast path (cached state == features.state() == "state-1"), so neither reconcile reaches + // the deep set compare. Total peerTags() calls: 1. + verify(features, times(1)).peerTags(); + // state() is called by bootstrap (1) + each reconcile (2) = 3 total. + verify(features, times(3)).state(); + } finally { + aggregator.close(); + } + } + + @Test + void reconcileSurvivesStateChangeWhenTagsUnchanged() throws Exception { + // Behavioral cross-check on the "set is unchanged, just update state" branch: discovery + // refreshes (state hash moves) but the underlying tag set is identical. The aggregator must + // continue producing valid buckets for the same logical peer tag across cycles. + HealthMetrics healthMetrics = mock(HealthMetrics.class); + MetricWriter writer = mock(MetricWriter.class); + Sink sink = mock(Sink.class); + DDAgentFeaturesDiscovery features = mock(DDAgentFeaturesDiscovery.class); + when(features.supportsMetrics()).thenReturn(true); + // peerTags() returns content-equal sets across calls -- the reconcile slow path's + // hasSameTagsAs check should return true. + when(features.peerTags()) + .thenReturn(new LinkedHashSet<>(Collections.singleton("peer.hostname"))) + .thenReturn(new LinkedHashSet<>(Collections.singleton("peer.hostname"))) + .thenReturn(new LinkedHashSet<>(Collections.singleton("peer.hostname"))); + // State hash changes every reconcile -- forces reconcile into the slow path each time. + when(features.state()).thenReturn("state-1", "state-2", "state-3"); + + ClientStatsAggregator aggregator = + new ClientStatsAggregator( + Collections.emptySet(), + features, + healthMetrics, + sink, + writer, + /* maxAggregates */ 16, + /* queueSize */ 64, + /* reportingInterval */ 10, + SECONDS, + /* includeEndpointInMetrics */ false); + aggregator.start(); + try { + CountDownLatch cycle1 = new CountDownLatch(1); + CountDownLatch cycle2 = new CountDownLatch(1); + org.mockito.Mockito.doAnswer( + invocation -> { + cycle1.countDown(); + return null; + }) + .doAnswer( + invocation -> { + cycle2.countDown(); + return null; + }) + .when(writer) + .finishBucket(); + + aggregator.publish(Collections.>singletonList(peerAggregationSpan())); + aggregator.report(); + assertTrue(cycle1.await(2, SECONDS)); + + aggregator.publish(Collections.>singletonList(peerAggregationSpan())); + aggregator.report(); + assertTrue(cycle2.await(2, SECONDS)); + + // Both cycles flushed (both latches counted down via writer.finishBucket). The schema kept + // producing buckets across the state-hash changes; if the schema had been broken by the + // update-in-place path, the second cycle's flush would not have happened. + verify(writer, times(2)).finishBucket(); + // Bootstrap (1) + two reconciles (2) -- each reconcile saw a state mismatch and went + // through the deep compare, calling peerTags() once = 3 total. + verify(features, times(3)).peerTags(); + verify(features, atLeastOnce()).state(); + } finally { + aggregator.close(); + } + } + + @Test + void reconcileSwapsSchemaWhenTagSetChanges() throws Exception { + // The reconcile slow-path's swap branch: discovery refreshes the state AND the tag set + // grows. Cached schema is rebuilt and the volatile reference points at the new schema. + // Verification is end-to-end -- we look at the AggregateEntry the writer receives. Pre-swap + // the span snapshot was pinned to the old schema so only peer.hostname appears; post-swap a + // new publish reads the new schema and the next flush carries both peer tags. + HealthMetrics healthMetrics = mock(HealthMetrics.class); + MetricWriter writer = mock(MetricWriter.class); + Sink sink = mock(Sink.class); + DDAgentFeaturesDiscovery features = mock(DDAgentFeaturesDiscovery.class); + when(features.supportsMetrics()).thenReturn(true); + // peerTags() shape evolves across calls: + // - bootstrap reads {peer.hostname} + // - cycle 1 reconcile slow-path reads {peer.hostname, peer.service} + // - cycle 2 reconcile is state fast-path (no peerTags call) + when(features.peerTags()) + .thenReturn(Collections.singleton("peer.hostname")) + .thenReturn(new LinkedHashSet<>(Arrays.asList("peer.hostname", "peer.service"))); + // state() evolves: bootstrap = "state-1", then changes to "state-2" for cycle 1's reconcile + // (mismatch -> slow path), stable at "state-2" for cycle 2's reconcile (match -> fast path). + when(features.state()).thenReturn("state-1", "state-2", "state-2"); + + ClientStatsAggregator aggregator = + new ClientStatsAggregator( + Collections.emptySet(), + features, + healthMetrics, + sink, + writer, + /* maxAggregates */ 16, + /* queueSize */ 64, + /* reportingInterval */ 10, + SECONDS, + /* includeEndpointInMetrics */ false); + aggregator.start(); + try { + CountDownLatch cycle1 = new CountDownLatch(1); + CountDownLatch cycle2 = new CountDownLatch(1); + org.mockito.Mockito.doAnswer( + invocation -> { + cycle1.countDown(); + return null; + }) + .doAnswer( + invocation -> { + cycle2.countDown(); + return null; + }) + .when(writer) + .finishBucket(); + + // Publish 1: snapshot pinned to the original {peer.hostname} schema. cycle 1's reconcile + // will swap the cached schema BEFORE the flush, but this snapshot is already pinned so the + // resulting AggregateEntry will still carry only peer.hostname. + aggregator.publish( + Collections.>singletonList(peerAggregationSpanWithBothPeerTags())); + aggregator.report(); + assertTrue(cycle1.await(2, SECONDS)); + + // Publish 2: now reads the post-swap schema {peer.hostname, peer.service} so the snapshot + // captures both tag values. cycle 2's reconcile short-circuits on timestamp match. + aggregator.publish( + Collections.>singletonList(peerAggregationSpanWithBothPeerTags())); + aggregator.report(); + assertTrue(cycle2.await(2, SECONDS)); + + // Capture every AggregateEntry the writer saw across both cycles. Pre-swap snapshot has 1 + // peer tag, post-swap has 2. + ArgumentCaptor entryCaptor = ArgumentCaptor.forClass(AggregateEntry.class); + verify(writer, times(2)).add(entryCaptor.capture()); + List entries = entryCaptor.getAllValues(); + assertEquals( + Collections.singletonList(UTF8BytesString.create("peer.hostname:localhost")), + entries.get(0).getPeerTags(), + "pre-swap snapshot should encode only peer.hostname"); + assertEquals( + Arrays.asList( + UTF8BytesString.create("peer.hostname:localhost"), + UTF8BytesString.create("peer.service:billing")), + entries.get(1).getPeerTags(), + "post-swap snapshot should encode both peer.hostname and peer.service"); + + // Bootstrap (1) + cycle 1 slow-path (1) -- cycle 2 is fast-path so doesn't reach peerTags(). + verify(features, times(2)).peerTags(); + verify(features, atLeastOnce()).state(); + } finally { + aggregator.close(); + } + } + + @SuppressWarnings({"rawtypes", "unchecked"}) + private static CoreSpan peerAggregationSpan() { + CoreSpan span = mock(CoreSpan.class); + when(span.isMeasured()).thenReturn(false); + when(span.isTopLevel()).thenReturn(true); + // Return true for any SpanKindFilter -- shouldComputeMetric will see METRICS_ELIGIBLE_KINDS + // match, and peerTagSchemaFor will see PEER_AGGREGATION_KINDS match (checked first), which + // routes the span through the bootstrap path. + when(span.isKind(any(SpanKindFilter.class))).thenReturn(true); + when(span.getLongRunningVersion()).thenReturn(0); + when(span.getDurationNano()).thenReturn(100L); + when(span.getError()).thenReturn(0); + when(span.getResourceName()).thenReturn("resource"); + when(span.getServiceName()).thenReturn("svc"); + when(span.getOperationName()).thenReturn("op"); + when(span.getServiceNameSource()).thenReturn(null); + when(span.getType()).thenReturn("web"); + when(span.getHttpStatusCode()).thenReturn((short) 200); + when(span.getParentId()).thenReturn(0L); + when(span.getOrigin()).thenReturn(null); + when(span.getSpanKindString()).thenReturn("client"); + // peer.hostname tag is set so capturePeerTagValues fires for the bootstrapped schema. + when(span.unsafeGetTag("peer.hostname")).thenReturn("localhost"); + return span; + } + + /** + * Variant of {@link #peerAggregationSpan()} that sets both {@code peer.hostname} and {@code + * peer.service}. Used by {@link #reconcileSwapsSchemaWhenTagSetChanges()} where the schema + * evolves from {@code {peer.hostname}} to {@code {peer.hostname, peer.service}} mid-test, and the + * post-swap snapshot must be able to capture the newly-relevant tag value. + */ + @SuppressWarnings({"rawtypes", "unchecked"}) + private static CoreSpan peerAggregationSpanWithBothPeerTags() { + CoreSpan span = peerAggregationSpan(); + when(span.unsafeGetTag("peer.service")).thenReturn("billing"); + return span; + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/common/metrics/ClientStatsAggregatorDisableTest.java b/dd-trace-core/src/test/java/datadog/trace/common/metrics/ClientStatsAggregatorDisableTest.java new file mode 100644 index 00000000000..3239cca4e90 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/common/metrics/ClientStatsAggregatorDisableTest.java @@ -0,0 +1,232 @@ +package datadog.trace.common.metrics; + +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.anyLong; +import static org.mockito.Mockito.after; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.reset; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import datadog.communication.ddagent.DDAgentFeaturesDiscovery; +import datadog.trace.core.CoreSpan; +import datadog.trace.core.SpanKindFilter; +import datadog.trace.core.monitor.HealthMetrics; +import java.util.Collections; +import java.util.concurrent.CountDownLatch; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; + +/** + * Coverage for the {@code disable() -> ClearSignal.CLEAR} threading routing introduced in this PR. + * + *

      The bundled fix routes the agent-downgrade clear through the inbox so the aggregator thread + * stays the sole writer to {@link AggregateTable} (which is not thread-safe). The behavioral + * contract this test pins: + * + *

        + *
      • {@code onEvent(DOWNGRADED)} can fire from a non-aggregator thread (in production, the + * OkHttpSink callback thread). + *
      • By the time the next report cycle reconciles peer-tag schema on the aggregator thread, the + * {@code AggregateTable} has been cleared -- {@code CLEAR} arrived in the FIFO inbox before + * the {@code REPORT} signal triggered by {@code aggregator.report()}. + *
      • The aggregator therefore flushes nothing on that next report cycle: no {@code startBucket}, + * no {@code add}, no {@code finishBucket}. + *
      + * + *

      The test would fail if {@code disable()} reverted to mutating {@code AggregateTable} directly + * (the pre-fix path) only via races -- not deterministically -- so the assertions here are about + * the observable end-to-end shape rather than thread identity. + */ +class ClientStatsAggregatorDisableTest { + + @Test + void downgradeRoutesClearThroughInboxBeforeNextReport() throws Exception { + HealthMetrics healthMetrics = mock(HealthMetrics.class); + MetricWriter writer = mock(MetricWriter.class); + Sink sink = mock(Sink.class); + DDAgentFeaturesDiscovery features = mock(DDAgentFeaturesDiscovery.class); + when(features.supportsMetrics()).thenReturn(true); + when(features.peerTags()).thenReturn(Collections.emptySet()); + when(features.state()).thenReturn("state-1"); + + ClientStatsAggregator aggregator = + new ClientStatsAggregator( + Collections.emptySet(), + features, + healthMetrics, + sink, + writer, + /* maxAggregates */ 16, + /* queueSize */ 64, + /* reportingInterval */ 10, + SECONDS, + /* includeEndpointInMetrics */ false); + aggregator.start(); + try { + // Baseline: publish a span, run a report, verify the table flushes normally. This gives + // us a clean post-first-report state with the aggregator's reconcile already having fired + // once on the aggregator thread. + CountDownLatch firstFlush = new CountDownLatch(1); + org.mockito.Mockito.doAnswer( + invocation -> { + firstFlush.countDown(); + return null; + }) + .when(writer) + .finishBucket(); + + aggregator.publish(Collections.>singletonList(metricsEligibleSpan())); + aggregator.report(); + assertTrue(firstFlush.await(2, SECONDS)); + + // Reset writer-side mock interactions so the post-disable verify() blocks below only see + // what happens after the downgrade. features mock keeps accumulating call counts -- we use + // those counts as a latch on aggregator-thread reconcile timing. + reset(writer); + + // Flip the discovery state. disable()'s first action is features.discover() followed by a + // features.supportsMetrics() check; returning false here selects the clear path. + when(features.supportsMetrics()).thenReturn(false); + + // Fire DOWNGRADED on the test thread. This is the production scenario where the OkHttpSink + // callback thread triggers onEvent. disable() offers ClearSignal.CLEAR to the inbox but + // does not (and must not) mutate AggregateTable directly here. + aggregator.onEvent(EventListener.EventType.DOWNGRADED, ""); + + // First: verify nothing flushes immediately after disable. We can't pin reconcile-on-the- + // aggregator-thread as a latch here because CLEAR's inbox.clear() drops any REPORT we'd + // queue behind it -- so we just wait a window for any flush attempt to materialize. + verify(writer, after(500).never()).startBucket(anyInt(), anyLong(), anyLong()); + + // Stronger contract: prove the table is actually empty after CLEAR by re-enabling metrics + // and publishing a *marker* span with a distinct resource name. The next report should + // flush exactly one entry -- the marker -- with the original "resource" gone. If disable() + // had failed to clear the table (or had cleared it from the wrong thread and corrupted + // bucket chains), this assertion would catch it. + when(features.supportsMetrics()).thenReturn(true); + CountDownLatch postClearFlush = new CountDownLatch(1); + org.mockito.Mockito.doAnswer( + invocation -> { + postClearFlush.countDown(); + return null; + }) + .when(writer) + .finishBucket(); + aggregator.publish(Collections.>singletonList(markerSpan())); + aggregator.report(); + assertTrue(postClearFlush.await(2, SECONDS)); + + ArgumentCaptor entryCaptor = ArgumentCaptor.forClass(AggregateEntry.class); + verify(writer, times(1)).add(entryCaptor.capture()); + assertEquals( + "marker-resource", + entryCaptor.getValue().getResource().toString(), + "post-CLEAR bucket should contain only the marker -- the original entry was wiped"); + } finally { + aggregator.close(); + } + } + + @Test + void clearDoesNotTrampleQueuedStopSignal() throws Exception { + // CLEAR handler clears only the aggregates table; queued signals (STOP, REPORT) survive and + // get processed normally. + HealthMetrics healthMetrics = mock(HealthMetrics.class); + MetricWriter writer = mock(MetricWriter.class); + Sink sink = mock(Sink.class); + DDAgentFeaturesDiscovery features = mock(DDAgentFeaturesDiscovery.class); + when(features.supportsMetrics()).thenReturn(true); + when(features.peerTags()).thenReturn(Collections.emptySet()); + when(features.state()).thenReturn("state-1"); + + ClientStatsAggregator aggregator = + new ClientStatsAggregator( + Collections.emptySet(), + features, + healthMetrics, + sink, + writer, + /* maxAggregates */ 16, + /* queueSize */ 64, + /* reportingInterval */ 10, + SECONDS, + /* includeEndpointInMetrics */ false); + aggregator.start(); + + // Force at least one snapshot into the inbox so the aggregator has something to drain. + aggregator.publish(Collections.>singletonList(metricsEligibleSpan())); + + // Fire DOWNGRADED on this thread. disable() flips supportsMetrics() to false and offers + // CLEAR. Then immediately call close() which offers STOP. If CLEAR's handler clears the + // inbox, STOP gets trampled and close() hangs until the join timeout. + when(features.supportsMetrics()).thenReturn(false); + aggregator.onEvent(EventListener.EventType.DOWNGRADED, ""); + + // close() is synchronous; bound it ourselves rather than trusting THREAD_JOIN_TIMEOUT_MS. + long deadlineNanos = System.nanoTime() + java.util.concurrent.TimeUnit.SECONDS.toNanos(2); + Thread closer = new Thread(aggregator::close, "test-closer"); + closer.start(); + while (closer.isAlive() && System.nanoTime() < deadlineNanos) { + closer.join(50); + } + assertTrue( + !closer.isAlive(), + "close() must return promptly -- if CLEAR trampled STOP, this hangs out the join timeout"); + } + + @SuppressWarnings({"rawtypes", "unchecked"}) + private static CoreSpan metricsEligibleSpan() { + CoreSpan span = mock(CoreSpan.class); + when(span.isMeasured()).thenReturn(false); + when(span.isTopLevel()).thenReturn(true); + // Return true for any SpanKindFilter so peerTagSchemaFor enters the bootstrap path on the + // first publish. We want that bootstrap to fire (it's what makes features.state() + // observable), even though peerTags() returns emptySet here and the resulting schema has + // size 0. + when(span.isKind(any(SpanKindFilter.class))).thenReturn(true); + when(span.getLongRunningVersion()).thenReturn(0); + when(span.getDurationNano()).thenReturn(100L); + when(span.getError()).thenReturn(0); + when(span.getResourceName()).thenReturn("resource"); + when(span.getServiceName()).thenReturn("svc"); + when(span.getOperationName()).thenReturn("op"); + when(span.getServiceNameSource()).thenReturn(null); + when(span.getType()).thenReturn("web"); + when(span.getHttpStatusCode()).thenReturn((short) 200); + when(span.getParentId()).thenReturn(0L); + when(span.getOrigin()).thenReturn(null); + when(span.getSpanKindString()).thenReturn("client"); + return span; + } + + /** + * Distinct from {@link #metricsEligibleSpan()} via the resource name: post-CLEAR the writer + * should see "marker-resource", proving the original "resource" entry is gone from the table. + */ + @SuppressWarnings({"rawtypes", "unchecked"}) + private static CoreSpan markerSpan() { + CoreSpan span = mock(CoreSpan.class); + when(span.isMeasured()).thenReturn(false); + when(span.isTopLevel()).thenReturn(true); + when(span.isKind(any(SpanKindFilter.class))).thenReturn(true); + when(span.getLongRunningVersion()).thenReturn(0); + when(span.getDurationNano()).thenReturn(100L); + when(span.getError()).thenReturn(0); + when(span.getResourceName()).thenReturn("marker-resource"); + when(span.getServiceName()).thenReturn("svc"); + when(span.getOperationName()).thenReturn("op"); + when(span.getServiceNameSource()).thenReturn(null); + when(span.getType()).thenReturn("web"); + when(span.getHttpStatusCode()).thenReturn((short) 200); + when(span.getParentId()).thenReturn(0L); + when(span.getOrigin()).thenReturn(null); + when(span.getSpanKindString()).thenReturn("client"); + return span; + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/common/metrics/ClientStatsAggregatorInboxFullTest.java b/dd-trace-core/src/test/java/datadog/trace/common/metrics/ClientStatsAggregatorInboxFullTest.java new file mode 100644 index 00000000000..3683bef7f42 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/common/metrics/ClientStatsAggregatorInboxFullTest.java @@ -0,0 +1,82 @@ +package datadog.trace.common.metrics; + +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.atLeastOnce; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import datadog.communication.ddagent.DDAgentFeaturesDiscovery; +import datadog.trace.core.CoreSpan; +import datadog.trace.core.SpanKindFilter; +import datadog.trace.core.monitor.HealthMetrics; +import java.util.Collections; +import org.junit.jupiter.api.Test; + +/** + * Coverage for the inbox-full fast-path in {@code ClientStatsAggregator.publish}: when the + * producer-side inbox is at capacity, the next {@code publish} call short-circuits before any tag + * extraction or {@code SpanSnapshot} allocation and reports {@code onStatsInboxFull()} to health + * metrics. + */ +class ClientStatsAggregatorInboxFullTest { + + @Test + void publishFiresOnStatsInboxFullOnceInboxIsAtCapacity() { + HealthMetrics healthMetrics = mock(HealthMetrics.class); + MetricWriter writer = mock(MetricWriter.class); + Sink sink = mock(Sink.class); + DDAgentFeaturesDiscovery features = mock(DDAgentFeaturesDiscovery.class); + when(features.supportsMetrics()).thenReturn(true); + when(features.peerTags()).thenReturn(Collections.emptySet()); + + // Small inbox; jctools MPSC array queue rounds up to the next power of two, so use a power of + // two directly. Note: we deliberately do NOT call aggregator.start() so the consumer thread + // never drains -- snapshots accumulate in the inbox until capacity, then the next publish hits + // the size-vs-capacity fast path. + int queueSize = 8; + ClientStatsAggregator aggregator = + new ClientStatsAggregator( + Collections.emptySet(), + features, + healthMetrics, + sink, + writer, + /* maxAggregates */ 16, + queueSize, + /* reportingInterval */ 10, + SECONDS, + /* includeEndpointInMetrics */ false); + + // Publish well past capacity. The first `queueSize` calls land in the inbox; subsequent calls + // see size >= capacity and hit the fast path. + for (int i = 0; i < queueSize * 4; i++) { + aggregator.publish(Collections.>singletonList(metricsEligibleSpan())); + } + + verify(healthMetrics, atLeastOnce()).onStatsInboxFull(); + aggregator.close(); + } + + @SuppressWarnings({"rawtypes", "unchecked"}) + private static CoreSpan metricsEligibleSpan() { + CoreSpan span = mock(CoreSpan.class); + when(span.isMeasured()).thenReturn(false); + when(span.isTopLevel()).thenReturn(true); + when(span.isKind(any(SpanKindFilter.class))).thenReturn(false); + when(span.getLongRunningVersion()).thenReturn(0); + when(span.getDurationNano()).thenReturn(100L); + when(span.getError()).thenReturn(0); + when(span.getResourceName()).thenReturn("resource"); + when(span.getServiceName()).thenReturn("svc"); + when(span.getOperationName()).thenReturn("op"); + when(span.getServiceNameSource()).thenReturn(null); + when(span.getType()).thenReturn("web"); + when(span.getHttpStatusCode()).thenReturn((short) 200); + when(span.getParentId()).thenReturn(0L); + when(span.getOrigin()).thenReturn(null); + when(span.getSpanKindString()).thenReturn("client"); + return span; + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/common/metrics/ClientStatsAggregatorOtlpExportTest.java b/dd-trace-core/src/test/java/datadog/trace/common/metrics/ClientStatsAggregatorOtlpExportTest.java new file mode 100644 index 00000000000..b8d56bde658 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/common/metrics/ClientStatsAggregatorOtlpExportTest.java @@ -0,0 +1,85 @@ +package datadog.trace.common.metrics; + +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import datadog.communication.ddagent.DDAgentFeaturesDiscovery; +import datadog.trace.bootstrap.instrumentation.api.Tags; +import datadog.trace.core.CoreSpan; +import datadog.trace.core.SpanKindFilter; +import datadog.trace.core.monitor.HealthMetrics; +import datadog.trace.core.otlp.metrics.OtlpStatsMetricWriter; +import java.util.Collections; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; + +/** + * Coverage for the OTLP-export aggregation path added alongside {@link OtlpStatsMetricWriter}. The + * OTLP path (selected because the injected writer {@code instanceof OtlpStatsMetricWriter}) probes + * every known gRPC status-code convention with no span-type gate, unlike the native v0.6 path's + * single-key {@code rpc.grpc.status_code} lookup gated on {@code rpc}-typed spans. + */ +class ClientStatsAggregatorOtlpExportTest { + + @Test + void grpcStatusExtractedFromGrpcTypedSpanOnOtlpPath() throws Exception { + OtlpStatsMetricWriter writer = mock(OtlpStatsMetricWriter.class); + DDAgentFeaturesDiscovery features = mock(DDAgentFeaturesDiscovery.class); + when(features.peerTags()).thenReturn(Collections.emptySet()); + Sink sink = mock(Sink.class); + + ClientStatsAggregator aggregator = + new ClientStatsAggregator( + Collections.emptySet(), + features, + HealthMetrics.NO_OP, + sink, + writer, + /* maxAggregates */ 16, + /* queueSize */ 16, + /* reportingInterval */ 10, + SECONDS, + /* includeEndpointInMetrics */ false); + aggregator.start(); + try { + // A span typed "grpc" (not "rpc") carrying grpc.status.code -- a key + type combo the native + // v0.6 path would not surface. On the OTLP path it must still be extracted. + aggregator.publish(Collections.>singletonList(grpcSpan("grpc.status.code", "0"))); + aggregator.forceReport().get(5, SECONDS); + + ArgumentCaptor captor = ArgumentCaptor.forClass(AggregateEntry.class); + verify(writer).add(captor.capture()); + assertEquals("0", captor.getValue().getGrpcStatusCode().toString()); + } finally { + aggregator.close(); + } + } + + /** A metrics-eligible, top-level span typed {@code grpc} carrying a single tag. */ + @SuppressWarnings({"rawtypes", "unchecked"}) + private static CoreSpan grpcSpan(String tagKey, String tagValue) { + CoreSpan span = mock(CoreSpan.class); + when(span.isMeasured()).thenReturn(false); + when(span.isTopLevel()).thenReturn(true); + when(span.isKind(any(SpanKindFilter.class))).thenReturn(false); + when(span.getLongRunningVersion()).thenReturn(0); + when(span.getDurationNano()).thenReturn(SECONDS.toNanos(1)); + when(span.getError()).thenReturn(0); + when(span.getResourceName()).thenReturn("grpc.request"); + when(span.getServiceName()).thenReturn("svc"); + when(span.getOperationName()).thenReturn("grpc.request"); + when(span.getServiceNameSource()).thenReturn(null); + when(span.getType()).thenReturn("grpc"); + when(span.getHttpStatusCode()).thenReturn((short) 0); + when(span.getParentId()).thenReturn(0L); + when(span.getOrigin()).thenReturn(null); + when(span.unsafeGetTag(eq(Tags.SPAN_KIND), any(CharSequence.class))).thenReturn(""); + when(span.unsafeGetTag(tagKey)).thenReturn(tagValue); + return span; + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/common/metrics/MetricsAggregatorFactoryTest.java b/dd-trace-core/src/test/java/datadog/trace/common/metrics/MetricsAggregatorFactoryTest.java new file mode 100644 index 00000000000..e9d981df389 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/common/metrics/MetricsAggregatorFactoryTest.java @@ -0,0 +1,89 @@ +package datadog.trace.common.metrics; + +import static datadog.trace.api.config.GeneralConfig.TRACE_STATS_COMPUTATION_ENABLED; +import static datadog.trace.api.config.OtlpConfig.OTEL_TRACES_SPAN_METRICS_ENABLED; +import static datadog.trace.api.config.OtlpConfig.OTLP_METRICS_PROTOCOL; +import static java.util.concurrent.TimeUnit.MILLISECONDS; +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import datadog.communication.ddagent.DDAgentFeaturesDiscovery; +import datadog.communication.ddagent.SharedCommunicationObjects; +import datadog.trace.api.Config; +import datadog.trace.core.monitor.HealthMetrics; +import java.util.Properties; +import okhttp3.HttpUrl; +import org.junit.jupiter.api.Test; + +/** + * Tests the native-vs-OTLP XOR writer selection in {@link MetricsAggregatorFactory}. The selected + * writer is not exposed directly, but {@link ClientStatsAggregator} publishes the selection outcome + * via {@code isOtlpStatsExportEnabled()} plus the reporting cadence getters. + */ +class MetricsAggregatorFactoryTest { + + private static SharedCommunicationObjects sharedCommunicationObjects() { + SharedCommunicationObjects sco = mock(SharedCommunicationObjects.class); + sco.agentUrl = HttpUrl.parse("http://localhost:8126"); + when(sco.featuresDiscovery(any())).thenReturn(mock(DDAgentFeaturesDiscovery.class)); + return sco; + } + + private static Properties props(String... keyValues) { + Properties props = new Properties(); + for (int i = 0; i < keyValues.length; i += 2) { + props.setProperty(keyValues[i], keyValues[i + 1]); + } + return props; + } + + @Test + void whenAllMetricsDisabledNoOpAggregatorCreated() { + Config config = Config.get(props(TRACE_STATS_COMPUTATION_ENABLED, "false")); + + MetricsAggregator aggregator = + MetricsAggregatorFactory.createMetricsAggregator( + config, sharedCommunicationObjects(), HealthMetrics.NO_OP); + + assertInstanceOf(NoOpMetricsAggregator.class, aggregator); + } + + @Test + void whenNativeTracerMetricsEnabledSerializingWriterSelected() { + // tracer metrics default to enabled; OTLP span metrics default off (no OTLP trace export). + Config config = Config.get(props()); + + MetricsAggregator aggregator = + MetricsAggregatorFactory.createMetricsAggregator( + config, sharedCommunicationObjects(), HealthMetrics.NO_OP); + + ClientStatsAggregator conflating = assertInstanceOf(ClientStatsAggregator.class, aggregator); + assertFalse(conflating.isOtlpStatsExportEnabled()); + // native path uses a hardcoded 10s cadence, not trace.stats.interval. + assertEquals(10, conflating.reportingInterval()); + assertEquals(SECONDS, conflating.reportingIntervalTimeUnit()); + } + + @Test + void whenOtlpTraceMetricsEnabledOtlpStatsMetricWriterSelected() { + Config config = + Config.get( + props(OTEL_TRACES_SPAN_METRICS_ENABLED, "true", OTLP_METRICS_PROTOCOL, "http/json")); + + MetricsAggregator aggregator = + MetricsAggregatorFactory.createMetricsAggregator( + config, sharedCommunicationObjects(), HealthMetrics.NO_OP); + + ClientStatsAggregator conflating = assertInstanceOf(ClientStatsAggregator.class, aggregator); + assertTrue(conflating.isOtlpStatsExportEnabled()); + // OTLP path sources the cadence from trace.stats.interval (ms), default 10s. + assertEquals(config.getTraceStatsInterval(), conflating.reportingInterval()); + assertEquals(MILLISECONDS, conflating.reportingIntervalTimeUnit()); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/common/metrics/PeerTagSchemaTest.java b/dd-trace-core/src/test/java/datadog/trace/common/metrics/PeerTagSchemaTest.java new file mode 100644 index 00000000000..710e78a175b --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/common/metrics/PeerTagSchemaTest.java @@ -0,0 +1,105 @@ +package datadog.trace.common.metrics; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.Set; +import org.junit.jupiter.api.Test; + +class PeerTagSchemaTest { + + @Test + void ofBuildsSchemaFromSetWithState() { + Set tags = new LinkedHashSet<>(Arrays.asList("peer.hostname", "peer.service")); + PeerTagSchema schema = PeerTagSchema.of(tags, "state-1234"); + + assertArrayEquals(new String[] {"peer.hostname", "peer.service"}, schema.names); + assertEquals("state-1234", schema.state); + assertEquals(2, schema.size()); + } + + @Test + void ofHandlesEmptySet() { + PeerTagSchema schema = PeerTagSchema.of(Collections.emptySet(), null); + + assertEquals(0, schema.size()); + assertEquals(0, schema.names.length); + } + + @Test + void internalSingletonCarriesBaseService() { + assertEquals(1, PeerTagSchema.INTERNAL.size()); + assertEquals("_dd.base_service", PeerTagSchema.INTERNAL.names[0]); + } + + @Test + void hasSameTagsAsReturnsTrueForExactMatch() { + PeerTagSchema schema = + PeerTagSchema.of( + new LinkedHashSet<>(Arrays.asList("peer.hostname", "peer.service")), "state-1"); + + // Same content via a different Set reference -- this is the case the reconcile fast-path + // depends on (Set returned from a fresh discovery cycle is content-equal to the prior one). + Set equivalentSet = new HashSet<>(Arrays.asList("peer.service", "peer.hostname")); + assertTrue(schema.hasSameTagsAs(equivalentSet)); + } + + @Test + void hasSameTagsAsReturnsFalseWhenSetGrew() { + PeerTagSchema schema = + PeerTagSchema.of(Collections.singleton("peer.hostname"), "state-1"); + + Set larger = new HashSet<>(Arrays.asList("peer.hostname", "peer.service")); + assertFalse(schema.hasSameTagsAs(larger)); + } + + @Test + void hasSameTagsAsReturnsFalseWhenSetShrank() { + PeerTagSchema schema = + PeerTagSchema.of( + new LinkedHashSet<>(Arrays.asList("peer.hostname", "peer.service")), "state-1"); + + assertFalse(schema.hasSameTagsAs(Collections.singleton("peer.hostname"))); + } + + @Test + void hasSameTagsAsReturnsFalseWhenContentDifferent() { + PeerTagSchema schema = + PeerTagSchema.of(Collections.singleton("peer.hostname"), "state-1"); + + assertFalse(schema.hasSameTagsAs(Collections.singleton("peer.service"))); + } + + @Test + void hasSameTagsAsHandlesEmpty() { + PeerTagSchema empty = PeerTagSchema.of(Collections.emptySet(), "state-1"); + + assertTrue(empty.hasSameTagsAs(Collections.emptySet())); + assertFalse(empty.hasSameTagsAs(Collections.singleton("peer.hostname"))); + } + + @Test + void handlerAccumulatesBlockedCountsAcrossRegistrations() { + // Build a schema then replace its handler with a sentinel-mode instance at a low limit. + // (Production schemas use AggregateEntry.LIMITS_ENABLED which is currently false; this test + // exercises the blocked-count path directly so it stays valid before and after the flag flips.) + PeerTagSchema schema = + new PeerTagSchema(new String[] {"peer.hostname"}, PeerTagSchema.NO_STATE); + schema.handlers[0] = new TagCardinalityHandler("peer.hostname", 1, true); + + schema.register(0, "host-a"); // within limit + schema.register(0, "host-b"); // blocked + schema.register(0, "host-c"); // blocked + + assertEquals(2, schema.handlers[0].reset()); + + // After the reset, no new values were registered so the next reset reports nothing. + assertEquals(0, schema.handlers[0].reset()); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/common/sampling/AIGuardSamplingTest.java b/dd-trace-core/src/test/java/datadog/trace/common/sampling/AIGuardSamplingTest.java new file mode 100644 index 00000000000..4240ebc604c --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/common/sampling/AIGuardSamplingTest.java @@ -0,0 +1,114 @@ +package datadog.trace.common.sampling; + +import static datadog.trace.api.config.AppSecConfig.APPSEC_ENABLED; +import static datadog.trace.api.config.GeneralConfig.APM_TRACING_ENABLED; +import static datadog.trace.api.sampling.PrioritySampling.USER_KEEP; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; + +import datadog.trace.api.ProductTraceSource; +import datadog.trace.bootstrap.instrumentation.api.Tags; +import datadog.trace.common.writer.ListWriter; +import datadog.trace.core.CoreTracer; +import datadog.trace.core.DDCoreJavaSpecification; +import datadog.trace.core.DDSpan; +import datadog.trace.test.junit.utils.config.WithConfig; +import java.util.Map; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** Verifies that AI Guard traces are kept regardless of APM/ASM configuration. */ +public class AIGuardSamplingTest extends DDCoreJavaSpecification { + + private ListWriter writer; + private CoreTracer tracer; + + @BeforeEach + void setUp() { + writer = new ListWriter(); + tracer = tracerBuilder().writer(writer).build(); + } + + @Test + void aiGuardTraceIsKeptWhenApmEnabled() throws Exception { + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "operation").start(); + span.setTag(Tags.AI_GUARD_KEEP, true); + span.setTag(Tags.AI_GUARD_EVENT, true); + span.setTag(Tags.PROPAGATED_TRACE_SOURCE, ProductTraceSource.AI_GUARD); + span.finish(); + writer.waitForTraces(1); + assertEquals(USER_KEEP, (int) span.getSamplingPriority()); + assertDecisionMakerIsAiGuard(span); + } + + @Test + @WithConfig(key = APM_TRACING_ENABLED, value = "false") + void aiGuardTraceIsKeptWhenApmAndAsmDisabled() throws Exception { + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "operation").start(); + span.setTag(Tags.AI_GUARD_KEEP, true); + span.setTag(Tags.AI_GUARD_EVENT, true); + span.setTag(Tags.PROPAGATED_TRACE_SOURCE, ProductTraceSource.AI_GUARD); + span.finish(); + writer.waitForTraces(1); + assertEquals(USER_KEEP, (int) span.getSamplingPriority()); + assertDecisionMakerIsAiGuard(span); + } + + @Test + @WithConfig(key = APM_TRACING_ENABLED, value = "false") + @WithConfig(key = APPSEC_ENABLED, value = "true") + void aiGuardTraceIsKeptInAsmStandaloneMode() throws Exception { + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "operation").start(); + span.setTag(Tags.AI_GUARD_KEEP, true); + span.setTag(Tags.AI_GUARD_EVENT, true); + span.setTag(Tags.PROPAGATED_TRACE_SOURCE, ProductTraceSource.AI_GUARD); + span.finish(); + writer.waitForTraces(1); + assertEquals(USER_KEEP, (int) span.getSamplingPriority()); + assertDecisionMakerIsAiGuard(span); + } + + /** _dd.p.ts alone (without AI_GUARD_KEEP) must not bypass the sampler. */ + @Test + @WithConfig(key = APM_TRACING_ENABLED, value = "false") + @WithConfig(key = APPSEC_ENABLED, value = "true") + void propagatedTraceSourceAloneDoesNotBypassSampler() throws Exception { + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "op").start(); + span.setTag(Tags.PROPAGATED_TRACE_SOURCE, ProductTraceSource.AI_GUARD); + span.finish(); + writer.waitForTraces(1); + + // _dd.p.ts alone must not force-keep the trace; only AI_GUARD_KEEP does that. + assertNotEquals(USER_KEEP, (int) span.getSamplingPriority()); + } + + /** + * AI Guard traces must be kept even when AsmStandaloneSampler has exhausted its rate-limit slot. + */ + @Test + @WithConfig(key = APM_TRACING_ENABLED, value = "false") + @WithConfig(key = APPSEC_ENABLED, value = "true") + void aiGuardTraceIsKeptAfterRateLimitSlotIsExhausted() throws Exception { + // consume the first allowed slot + DDSpan first = (DDSpan) tracer.buildSpan("datadog", "op").start(); + first.finish(); + writer.waitForTraces(1); + + // AI Guard trace must still be force-kept even though the rate-limit slot is gone + DDSpan aiGuard = (DDSpan) tracer.buildSpan("datadog", "op").start(); + aiGuard.setTag(Tags.AI_GUARD_KEEP, true); + aiGuard.setTag(Tags.AI_GUARD_EVENT, true); + aiGuard.setTag(Tags.PROPAGATED_TRACE_SOURCE, ProductTraceSource.AI_GUARD); + aiGuard.finish(); + writer.waitForTraces(2); + + assertEquals(USER_KEEP, (int) aiGuard.getSamplingPriority()); + assertDecisionMakerIsAiGuard(aiGuard); + } + + private static void assertDecisionMakerIsAiGuard(DDSpan span) { + Map ptags = span.spanContext().getPropagationTags().createTagMap(); + assertEquals("-13", ptags.get("_dd.p.dm"), "_dd.p.dm must be -13 (AI Guard decision maker)"); + assertEquals("20", ptags.get("_dd.p.ts"), "_dd.p.ts must have AI Guard bit set (0x20)"); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/common/sampling/ParentBasedAlwaysOnSamplerTest.java b/dd-trace-core/src/test/java/datadog/trace/common/sampling/ParentBasedAlwaysOnSamplerTest.java index e515975edfe..19369beeac9 100644 --- a/dd-trace-core/src/test/java/datadog/trace/common/sampling/ParentBasedAlwaysOnSamplerTest.java +++ b/dd-trace-core/src/test/java/datadog/trace/common/sampling/ParentBasedAlwaysOnSamplerTest.java @@ -40,7 +40,7 @@ void alwaysSamplesSpans() { ParentBasedAlwaysOnSampler sampler = new ParentBasedAlwaysOnSampler(); CoreTracer tracer = buildTracer(sampler); - DDSpan span = (DDSpan) tracer.buildSpan("test").start(); + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "test").start(); try { assertTrue(sampler.sample(span)); } finally { @@ -53,7 +53,7 @@ void setsSamplingPriorityToSamplerKeep() { ParentBasedAlwaysOnSampler sampler = new ParentBasedAlwaysOnSampler(); CoreTracer tracer = buildTracer(sampler); - DDSpan span = (DDSpan) tracer.buildSpan("test").start(); + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "test").start(); try { sampler.setSamplingPriority(span); assertEquals(SAMPLER_KEEP, span.getSamplingPriority()); @@ -67,9 +67,10 @@ void childSpanInheritsSamplingPriorityFromLocalParent() { ParentBasedAlwaysOnSampler sampler = new ParentBasedAlwaysOnSampler(); CoreTracer tracer = buildTracer(sampler); - DDSpan rootSpan = (DDSpan) tracer.buildSpan("root").start(); + DDSpan rootSpan = (DDSpan) tracer.buildSpan("datadog", "root").start(); sampler.setSamplingPriority(rootSpan); - DDSpan childSpan = (DDSpan) tracer.buildSpan("child").asChildOf(rootSpan.context()).start(); + DDSpan childSpan = + (DDSpan) tracer.buildSpan("datadog", "child").asChildOf(rootSpan.spanContext()).start(); try { assertEquals(SAMPLER_KEEP, rootSpan.getSamplingPriority()); assertEquals(SAMPLER_KEEP, childSpan.getSamplingPriority()); @@ -95,7 +96,7 @@ void childSpanInheritsSamplingDecisionFromRemoteParent(int parentPriority) { new ExtractedContext( DDTraceId.ONE, 2, parentPriority, null, PropagationTags.factory().empty(), DATADOG); - DDSpan span = (DDSpan) tracer.buildSpan("child").asChildOf(extractedContext).start(); + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "child").asChildOf(extractedContext).start(); try { assertEquals(parentPriority, span.getSamplingPriority()); } finally { diff --git a/dd-trace-core/src/test/java/datadog/trace/common/writer/FileBasedPayloadDispatcherTest.java b/dd-trace-core/src/test/java/datadog/trace/common/writer/FileBasedPayloadDispatcherTest.java index 15fe095ec03..2040f685fdc 100644 --- a/dd-trace-core/src/test/java/datadog/trace/common/writer/FileBasedPayloadDispatcherTest.java +++ b/dd-trace-core/src/test/java/datadog/trace/common/writer/FileBasedPayloadDispatcherTest.java @@ -12,6 +12,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import datadog.trace.api.DDTraceId; import datadog.trace.api.TagMap; +import datadog.trace.api.civisibility.CIConstants; import datadog.trace.api.intake.TrackType; import datadog.trace.bootstrap.instrumentation.api.InternalSpanTypes; import datadog.trace.bootstrap.instrumentation.api.Tags; @@ -143,6 +144,45 @@ void citestcycleStripsCiGitOsRuntimeTagsAndWellKnownFields(@TempDir Path outputD assertEquals(99L, metrics.get("kept.metric").asLong()); } + @Test + void citestcycleTruncatesMetaValuesAndPreservesMetricsAndTopLevelIds(@TempDir Path outputDir) + throws IOException { + FileBasedPayloadDispatcher dispatcher = + new FileBasedPayloadDispatcher(outputDir.toString(), "tests", TrackType.CITESTCYCLE); + String longValue = longString(CIConstants.MAX_META_STRING_VALUE_LENGTH + 1, 'a'); + String exactValue = longString(CIConstants.MAX_META_STRING_VALUE_LENGTH, 'b'); + Map tags = new HashMap<>(); + tags.put(Tags.TEST_SESSION_ID, DDTraceId.from(123)); + tags.put(Tags.TEST_MODULE_ID, 456L); + tags.put(Tags.TEST_SUITE_ID, 789L); + tags.put("custom.tag", longValue); + tags.put("exact.tag", exactValue); + tags.put("custom.metric", 42L); + CoreSpan span = mockSpan(InternalSpanTypes.TEST, tags); + + dispatcher.addTrace(Collections.singletonList(span)); + dispatcher.flush(); + + JsonNode content = + JSON.readTree(listFiles(outputDir).get(0).toFile()).get("events").get(0).get("content"); + JsonNode meta = content.get("meta"); + JsonNode metrics = content.get("metrics"); + + assertEquals( + longValue.substring(0, CIConstants.MAX_META_STRING_VALUE_LENGTH), + meta.get("custom.tag").asText()); + assertEquals( + CIConstants.MAX_META_STRING_VALUE_LENGTH, meta.get("custom.tag").asText().length()); + assertEquals(exactValue, meta.get("exact.tag").asText()); + assertEquals(42L, metrics.get("custom.metric").asLong()); + assertFalse(meta.has(Tags.TEST_SESSION_ID)); + assertFalse(meta.has(Tags.TEST_MODULE_ID)); + assertFalse(meta.has(Tags.TEST_SUITE_ID)); + assertEquals(123L, content.get(Tags.TEST_SESSION_ID).asLong()); + assertEquals(456L, content.get(Tags.TEST_MODULE_ID).asLong()); + assertEquals(789L, content.get(Tags.TEST_SUITE_ID).asLong()); + } + @Test void citestcycleAssignsEventTypesForSessionModuleSuiteTestSpanSpans(@TempDir Path outputDir) throws IOException { @@ -295,4 +335,10 @@ private static List listFiles(Path dir) throws IOException { } return files; } + + private static String longString(int length, char value) { + char[] chars = new char[length]; + Arrays.fill(chars, value); + return new String(chars); + } } diff --git a/dd-trace-core/src/test/java/datadog/trace/common/writer/OtlpWriterCombinedTest.java b/dd-trace-core/src/test/java/datadog/trace/common/writer/OtlpWriterCombinedTest.java index b00b424427f..3da45b1b1e4 100644 --- a/dd-trace-core/src/test/java/datadog/trace/common/writer/OtlpWriterCombinedTest.java +++ b/dd-trace-core/src/test/java/datadog/trace/common/writer/OtlpWriterCombinedTest.java @@ -1,7 +1,7 @@ package datadog.trace.common.writer; import static datadog.trace.api.config.OtlpConfig.TRACE_OTEL_EXPORTER; -import static datadog.trace.junit.utils.config.WithConfigExtension.injectSysConfig; +import static datadog.trace.test.junit.utils.config.WithConfigExtension.injectSysConfig; import static org.junit.jupiter.api.Assertions.assertTrue; import com.sun.net.httpserver.HttpServer; diff --git a/dd-trace-core/src/test/java/datadog/trace/common/writer/TraceGenerator.java b/dd-trace-core/src/test/java/datadog/trace/common/writer/TraceGenerator.java new file mode 100644 index 00000000000..c8fad4ab0ee --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/common/writer/TraceGenerator.java @@ -0,0 +1,523 @@ +package datadog.trace.common.writer; + +import static datadog.trace.api.sampling.PrioritySampling.UNSET; +import static java.util.Collections.emptyList; + +import datadog.trace.api.DDSpanId; +import datadog.trace.api.DDTags; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.IdGenerationStrategy; +import datadog.trace.api.ProcessTags; +import datadog.trace.api.TagMap; +import datadog.trace.api.sampling.PrioritySampling; +import datadog.trace.bootstrap.instrumentation.api.AgentSpanLink; +import datadog.trace.bootstrap.instrumentation.api.Tags; +import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; +import datadog.trace.core.CoreSpan; +import datadog.trace.core.Metadata; +import datadog.trace.core.MetadataConsumer; +import datadog.trace.core.SpanKindFilter; +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.concurrent.ThreadLocalRandom; +import java.util.concurrent.TimeUnit; + +public class TraceGenerator { + + public static List> generateRandomTraces(int howMany, boolean lowCardinality) { + List> traces = new ArrayList<>(howMany); + for (int i = 0; i < howMany; ++i) { + int traceSize = ThreadLocalRandom.current().nextInt(2, 20); + traces.add(generateRandomTrace(traceSize, lowCardinality)); + } + return traces; + } + + private static List generateRandomTrace(int size, boolean lowCardinality) { + List trace = new ArrayList<>(size); + long traceId = ThreadLocalRandom.current().nextLong(1, Long.MAX_VALUE); + for (int i = 0; i < size; ++i) { + String spanType = "type-" + ThreadLocalRandom.current().nextInt(lowCardinality ? 1 : 100); + trace.add(randomSpan(traceId, lowCardinality, spanType, Collections.emptyMap())); + } + return trace; + } + + private static final IdGenerationStrategy ID_GENERATION_STRATEGY = + IdGenerationStrategy.fromName("RANDOM"); + + public static PojoSpan generateRandomSpan(CharSequence type, Map extraTags) { + long traceId = ThreadLocalRandom.current().nextLong(1, Long.MAX_VALUE); + return randomSpan(traceId, true, type, extraTags); + } + + private static PojoSpan randomSpan( + long traceId, boolean lowCardinality, CharSequence type, Map extraTags) { + ThreadLocalRandom random = ThreadLocalRandom.current(); + Map baggage = new HashMap<>(); + if (random.nextBoolean()) { + baggage.put("baggage-key", lowCardinality ? "x" : randomString(100)); + if (random.nextBoolean()) { + baggage.put("tag.1", "bar"); + baggage.put("tag.2", "qux"); + } + } + Map tags = new HashMap<>(extraTags); + int tagCount = random.nextInt(0, 20); + for (int i = 0; i < tagCount; ++i) { + tags.put("tag." + i, random.nextBoolean() ? "foo" : randomString(2000)); + tags.put("tag.1." + i, lowCardinality ? "y" : UUID.randomUUID()); + tags.put("tag.2." + i, random.nextBoolean()); + switch (random.nextInt(8)) { + case 0: + tags.put("tag.3." + i, BigDecimal.valueOf(random.nextDouble())); + break; + case 1: + tags.put("tag.3." + i, BigInteger.valueOf(random.nextLong())); + break; + default: + break; + } + } + int metricCount = random.nextInt(0, 20); + for (int i = 0; i < metricCount; ++i) { + String name = "metric." + i; + Number metric = null; + switch (random.nextInt(4)) { + case 0: + metric = random.nextInt(); + break; + case 1: + metric = random.nextLong(); + break; + case 2: + metric = random.nextFloat(); + break; + case 3: + metric = random.nextDouble(); + break; + } + tags.put(name, metric); + } + + return new PojoSpan( + "service-" + random.nextInt(lowCardinality ? 1 : 10), + "operation-" + random.nextInt(lowCardinality ? 1 : 100), + UTF8BytesString.create("resource-" + random.nextInt(lowCardinality ? 1 : 100)), + DDTraceId.from(traceId), + ID_GENERATION_STRATEGY.generateSpanId(), + DDSpanId.ZERO, + TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis()), + random.nextLong(500, 10_000_000), + random.nextInt(2), + baggage, + tags, + type, + random.nextBoolean(), + PrioritySampling.SAMPLER_KEEP, + 200, + "some-origin"); + } + + private static String randomString(int maxLength) { + char[] chars = new char[ThreadLocalRandom.current().nextInt(maxLength)]; + for (int i = 0; i < chars.length; ++i) { + char next = (char) ThreadLocalRandom.current().nextInt((int) Character.MAX_VALUE); + if (Character.isSurrogate(next)) { + if (i < chars.length - 1) { + chars[i++] = '\uD801'; + chars[i] = '\uDC01'; + } else { + chars[i] = 'a'; + } + } else { + chars[i] = next; + } + } + return new String(chars); + } + + public static class PojoSpan implements CoreSpan { + + private final CharSequence serviceName; + private final CharSequence operationName; + private final CharSequence resourceName; + private final DDTraceId traceId; + private final long spanId; + private final long parentId; + private final long start; + private final long duration; + private final int error; + private final CharSequence type; + private final boolean measured; + private final Metadata metadata; + private short httpStatusCode; + private final int samplingPriority; + private final Map metaStruct = new HashMap<>(); + + public PojoSpan( + String serviceName, + String operationName, + CharSequence resourceName, + DDTraceId traceId, + long spanId, + long parentId, + long start, + long duration, + int error, + Map baggage, + Map tags, + CharSequence type, + boolean measured, + int samplingPriority, + int statusCode, + CharSequence origin) { + this( + serviceName, + operationName, + resourceName, + traceId, + spanId, + parentId, + start, + duration, + error, + baggage, + tags, + type, + measured, + samplingPriority, + statusCode, + origin, + emptyList()); + } + + public PojoSpan( + String serviceName, + String operationName, + CharSequence resourceName, + DDTraceId traceId, + long spanId, + long parentId, + long start, + long duration, + int error, + Map baggage, + Map tags, + CharSequence type, + boolean measured, + int samplingPriority, + int statusCode, + CharSequence origin, + List spanLinks) { + this.serviceName = UTF8BytesString.create(serviceName); + this.operationName = UTF8BytesString.create(operationName); + this.resourceName = UTF8BytesString.create(resourceName); + this.traceId = traceId; + this.spanId = spanId; + this.parentId = parentId; + this.start = start; + this.duration = duration; + this.error = error; + this.type = type; + this.measured = measured; + this.samplingPriority = samplingPriority; + this.httpStatusCode = (short) statusCode; + this.metadata = + new Metadata( + Thread.currentThread().getId(), + UTF8BytesString.create(Thread.currentThread().getName()), + TagMap.fromMap(tags), + baggage, + samplingPriority, + measured, + isTopLevel(), + statusCode == 0 ? null : UTF8BytesString.create(Integer.toString(statusCode)), + origin, + 0, + ProcessTags.getTagsForSerialization(), + spanLinks); + } + + @Override + public PojoSpan getLocalRootSpan() { + return this; + } + + @Override + public String getServiceName() { + return serviceName.toString(); + } + + @Override + public CharSequence getOperationName() { + return operationName; + } + + @Override + public CharSequence getResourceName() { + return resourceName; + } + + @Override + public DDTraceId getTraceId() { + return traceId; + } + + @Override + public long getSpanId() { + return spanId; + } + + @Override + public long getParentId() { + return parentId; + } + + @Override + public long getStartTime() { + return start; + } + + @Override + public long getDurationNano() { + return duration; + } + + @Override + public int getError() { + return error; + } + + @Override + public PojoSpan setMeasured(boolean measured) { + return this; + } + + @Override + public PojoSpan setErrorMessage(String errorMessage) { + return this; + } + + @Override + public PojoSpan addThrowable(Throwable error) { + return this; + } + + @Override + public PojoSpan setTag(String tag, String value) { + return this; + } + + @Override + public PojoSpan setTag(String tag, boolean value) { + return this; + } + + @Override + public PojoSpan setTag(String tag, int value) { + return this; + } + + @Override + public PojoSpan setTag(String tag, long value) { + return this; + } + + @Override + public PojoSpan setTag(String tag, double value) { + return this; + } + + @Override + public PojoSpan setTag(String tag, Number value) { + return this; + } + + @Override + public PojoSpan setTag(String tag, CharSequence value) { + return this; + } + + @Override + public PojoSpan setTag(String tag, Object value) { + return this; + } + + @Override + public PojoSpan removeTag(String tag) { + metadata.getTags().remove(tag); + return this; + } + + @Override + public boolean isMeasured() { + return measured; + } + + @Override + public boolean isTopLevel() { + return false; + } + + @Override + public boolean isForceKeep() { + return false; + } + + @Override + public short getHttpStatusCode() { + return httpStatusCode; + } + + @Override + public CharSequence getOrigin() { + return metadata.getOrigin(); + } + + public Map getBaggage() { + return metadata.getBaggage(); + } + + public Map getTags() { + return metadata.getTags(); + } + + @Override + public CharSequence getType() { + return this.type; + } + + @Override + public void processServiceTags() {} + + @Override + public void processTagsAndBaggage(MetadataConsumer consumer) { + consumer.accept(metadata); + } + + @Override + public PojoSpan setSamplingPriority(int samplingPriority, int samplingMechanism) { + return this; + } + + @Override + public PojoSpan setSamplingPriority( + int samplingPriority, CharSequence rate, double sampleRate, int samplingMechanism) { + return this; + } + + @Override + public PojoSpan setSpanSamplingPriority(double rate, int limit) { + return this; + } + + @Override + public PojoSpan setMetric(CharSequence name, int value) { + return this; + } + + @Override + public PojoSpan setMetric(CharSequence name, long value) { + return this; + } + + @Override + public PojoSpan setMetric(CharSequence name, float value) { + return this; + } + + @Override + public PojoSpan setMetric(CharSequence name, double value) { + return this; + } + + @Override + public PojoSpan setFlag(CharSequence name, boolean value) { + return this; + } + + @Override + public int samplingPriority() { + return samplingPriority; + } + + @Override + public U getTag(CharSequence name, U defaultValue) { + U value = getTag(name); + return null == value ? defaultValue : value; + } + + @Override + @SuppressWarnings("unchecked") + public U getTag(CharSequence name) { + // replicate logic here because DDSpanContext has to pretend some of its + // fields are elements of a map for backward compatibility reasons + String tag = String.valueOf(name); + Object value = null; + switch (tag) { + case DDTags.THREAD_ID: + value = metadata.getThreadId(); + break; + case DDTags.THREAD_NAME: + value = metadata.getThreadName(); + break; + default: + value = metadata.getTags().get(tag); + } + return (U) value; + } + + @Override + public boolean hasSamplingPriority() { + return samplingPriority != UNSET; + } + + @Override + public Map getMetaStruct() { + return metaStruct; + } + + @Override + public PojoSpan setMetaStruct(String field, Object value) { + if (value == null) { + metaStruct.remove(field); + } else { + metaStruct.put(field, value); + } + return this; + } + + @Override + public int getLongRunningVersion() { + return 0; + } + + @Override + public CharSequence getServiceNameSource() { + return null; + } + + @Override + public boolean isKind(SpanKindFilter filter) { + Object kind = unsafeGetTag(Tags.SPAN_KIND); + return filter.matches(kind == null ? null : kind.toString()); + } + + @Override + public U unsafeGetTag(CharSequence name, U defaultValue) { + return getTag(name, defaultValue); + } + + @Override + public U unsafeGetTag(CharSequence name) { + return getTag(name); + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/common/writer/TraceStructureWriterTest.java b/dd-trace-core/src/test/java/datadog/trace/common/writer/TraceStructureWriterTest.java new file mode 100644 index 00000000000..67a83d58e01 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/common/writer/TraceStructureWriterTest.java @@ -0,0 +1,30 @@ +package datadog.trace.common.writer; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.core.DDCoreJavaSpecification; +import org.tabletest.junit.TableTest; + +public class TraceStructureWriterTest extends DDCoreJavaSpecification { + + @TableTest({ + "scenario | windows | cli | path ", + "windows path | true | C:/tmp/file | C:/tmp/file ", + "windows backslash path | true | C:\\tmp\\file | C:\\tmp\\file", + "windows file | true | file | file ", + "windows path with option | true | C:/tmp/file:includeresource | C:/tmp/file ", + "windows backslash path with option | true | C:\\tmp\\file:includeresource | C:\\tmp\\file", + "windows file with option | true | file:includeresource | file ", + "unix absolute path 1 | false | /var/tmp/file | /var/tmp/file", + "unix file 1 | false | file | file ", + "unix absolute path 2 | false | /var/tmp/file | /var/tmp/file", + "unix file 2 | false | file | file " + }) + void parseCliArgs(boolean windows, String cli, String path) { + String[] args = TraceStructureWriter.parseArgs(cli, windows); + + assertTrue(args.length > 0); + assertEquals(path, args[0]); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/common/writer/ddagent/TraceMapperTestBridge.java b/dd-trace-core/src/test/java/datadog/trace/common/writer/ddagent/TraceMapperTestBridge.java new file mode 100644 index 00000000000..5632ee2e047 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/common/writer/ddagent/TraceMapperTestBridge.java @@ -0,0 +1,17 @@ +package datadog.trace.common.writer.ddagent; + +import datadog.communication.serialization.GrowableBuffer; +import java.util.Map; + +/** + * Bridge class to allow tests to access package-private method exposed by the {@code TraceMapper} + */ +public class TraceMapperTestBridge { + public static GrowableBuffer getDictionary(TraceMapperV0_5 traceMapperV05) { + return traceMapperV05.getDictionary(); + } + + public static Map getEncoding(TraceMapperV0_5 traceMapperV05) { + return traceMapperV05.getEncoding(); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/common/writer/ddagent/V1PayloadReader.java b/dd-trace-core/src/test/java/datadog/trace/common/writer/ddagent/V1PayloadReader.java new file mode 100644 index 00000000000..4d1af7bbfca --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/common/writer/ddagent/V1PayloadReader.java @@ -0,0 +1,558 @@ +package datadog.trace.common.writer.ddagent; + +import static datadog.trace.common.writer.ddagent.TraceMapperV1.VALUE_TYPE_ARRAY; +import static datadog.trace.common.writer.ddagent.TraceMapperV1.VALUE_TYPE_BOOLEAN; +import static datadog.trace.common.writer.ddagent.TraceMapperV1.VALUE_TYPE_BYTES; +import static datadog.trace.common.writer.ddagent.TraceMapperV1.VALUE_TYPE_FLOAT; +import static datadog.trace.common.writer.ddagent.TraceMapperV1.VALUE_TYPE_INT; +import static datadog.trace.common.writer.ddagent.TraceMapperV1.VALUE_TYPE_STRING; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.api.DDSpanId; +import datadog.trace.api.DDTraceId; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.msgpack.core.MessageFormat; +import org.msgpack.core.MessagePack; +import org.msgpack.core.MessageUnpacker; +import org.msgpack.core.buffer.ArrayBufferInput; +import org.msgpack.value.ValueType; + +/** + * Shared decoder for the msgpack V1 trace payload wire format produced by {@link TraceMapperV1}. + * + *

      This is the single source of truth for the low-level parse primitives used by the V1 payload + * tests (both {@code TraceMapperV1PayloadTest} and {@code DDSpanSerializationTest}). Methods take + * an explicit {@link MessageUnpacker} and {@code stringTable} so callers that need to assert on + * wire-level details can interleave their own reads while keeping the streaming-string table in + * sync. The string table must be seeded with the empty string at index 0, mirroring {@code + * TraceMapperV1}. + */ +public final class V1PayloadReader { + + /** msgpack field ids of the top-level payload (header) map, mirroring {@code buildHeader}. */ + private static final class PayloadField { + static final int CONTAINER_ID = 2; + static final int LANGUAGE_NAME = 3; + static final int LANGUAGE_VERSION = 4; + static final int TRACER_VERSION = 5; + static final int RUNTIME_ID = 6; + static final int ENV = 7; + static final int HOSTNAME = 8; + static final int APP_VERSION = 9; + static final int ATTRIBUTES = 10; + static final int CHUNKS = 11; + + private PayloadField() {} + } + + /** msgpack field ids of a trace chunk map, mirroring {@code TraceMapperV1.map} (no field 5). */ + private static final class ChunkField { + static final int PRIORITY = 1; + static final int ORIGIN = 2; + static final int ATTRIBUTES = 3; + static final int SPANS = 4; + static final int TRACE_ID = 6; + static final int SAMPLING_MECHANISM = 7; + + private ChunkField() {} + } + + /** msgpack field ids of a span map, mirroring {@code encodeSpans} (16 fields). */ + private static final class SpanField { + static final int SERVICE = 1; + static final int NAME = 2; + static final int RESOURCE = 3; + static final int SPAN_ID = 4; + static final int PARENT_ID = 5; + static final int START = 6; + static final int DURATION = 7; + static final int ERROR = 8; + static final int ATTRIBUTES = 9; + static final int TYPE = 10; + static final int LINKS = 11; + static final int EVENTS = 12; + static final int ENV = 13; + static final int VERSION = 14; + static final int COMPONENT = 15; + static final int KIND = 16; + + private SpanField() {} + } + + /** msgpack field ids of a span link map, mirroring {@code encodeSpanLinks} (5 fields). */ + private static final class LinkField { + static final int TRACE_ID = 1; + static final int SPAN_ID = 2; + static final int ATTRIBUTES = 3; + static final int TRACE_STATE = 4; + static final int TRACE_FLAGS = 5; + + private LinkField() {} + } + + /** msgpack field ids of a span event map, mirroring {@code encodeSpanEvents} (3 fields). */ + private static final class EventField { + static final int TIME_UNIX_NANO = 1; + static final int NAME = 2; + static final int ATTRIBUTES = 3; + + private EventField() {} + } + + private V1PayloadReader() {} + + /** Decodes the first span of the first chunk of an encoded V1 payload. */ + public static V1Span readFirstSpan(byte[] encoded) throws IOException { + MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(new ArrayBufferInput(encoded)); + List stringTable = newStringTable(); + return readFirstSpan(unpacker, stringTable); + } + + /** Creates a string table seeded with the empty string at index 0, as the writer expects. */ + public static List newStringTable() { + List stringTable = new ArrayList<>(); + stringTable.add(""); + return stringTable; + } + + public static V1Span readFirstSpan(MessageUnpacker unpacker, List stringTable) + throws IOException { + int payloadFieldCount = unpacker.unpackMapHeader(); + for (int i = 0; i < payloadFieldCount; i++) { + int payloadFieldId = unpacker.unpackInt(); + if (payloadFieldId != PayloadField.CHUNKS) { + skipPayloadField(unpacker, payloadFieldId, stringTable); + continue; + } + int chunkCount = unpacker.unpackArrayHeader(); + assertEquals(1, chunkCount); + int chunkFieldCount = unpacker.unpackMapHeader(); + for (int j = 0; j < chunkFieldCount; j++) { + int chunkFieldId = unpacker.unpackInt(); + if (chunkFieldId != ChunkField.SPANS) { + skipChunkField(unpacker, chunkFieldId, stringTable); + continue; + } + int spanCount = unpacker.unpackArrayHeader(); + assertEquals(1, spanCount); + return decodeSpan(unpacker, stringTable); + } + } + throw new AssertionError("Could not find first span in v1 payload"); + } + + private static V1Span decodeSpan(MessageUnpacker unpacker, List stringTable) + throws IOException { + int spanFieldCount = unpacker.unpackMapHeader(); + Map attributes = Collections.emptyMap(); + List links = Collections.emptyList(); + List events = Collections.emptyList(); + for (int i = 0; i < spanFieldCount; i++) { + int spanFieldId = unpacker.unpackInt(); + switch (spanFieldId) { + case SpanField.ATTRIBUTES: + attributes = readAttributes(unpacker, stringTable); + break; + case SpanField.LINKS: + links = readSpanLinks(unpacker, stringTable); + break; + case SpanField.EVENTS: + events = readSpanEvents(unpacker, stringTable); + break; + default: + skipSpanField(unpacker, spanFieldId, stringTable); + } + } + return new V1Span(attributes, links, events); + } + + public static Map readAttributes( + MessageUnpacker unpacker, List stringTable) throws IOException { + int arraySize = unpacker.unpackArrayHeader(); + assertEquals(0, arraySize % 3); + int attributeCount = arraySize / 3; + Map attributes = new HashMap<>(); + for (int i = 0; i < attributeCount; i++) { + String key = readStreamingString(unpacker, stringTable); + int valueType = unpacker.unpackInt(); + attributes.put(key, readAttributeValue(unpacker, stringTable, valueType)); + } + return attributes; + } + + private static Object readAttributeValue( + MessageUnpacker unpacker, List stringTable, int valueType) throws IOException { + switch (valueType) { + case VALUE_TYPE_STRING: + return readStreamingString(unpacker, stringTable); + case VALUE_TYPE_BOOLEAN: + return unpacker.unpackBoolean(); + case VALUE_TYPE_FLOAT: + return unpacker.unpackDouble(); + case VALUE_TYPE_BYTES: + return readBinary(unpacker); + default: + throw new IllegalArgumentException("Unknown v1 attribute value type: " + valueType); + } + } + + public static List readSpanLinks(MessageUnpacker unpacker, List stringTable) + throws IOException { + int linkCount = unpacker.unpackArrayHeader(); + List links = new ArrayList<>(linkCount); + for (int i = 0; i < linkCount; i++) { + int linkFieldCount = unpacker.unpackMapHeader(); + byte[] traceId = null; + long spanId = 0; + Map attributes = Collections.emptyMap(); + String traceState = ""; + long traceFlags = 0; + for (int j = 0; j < linkFieldCount; j++) { + int linkFieldId = unpacker.unpackInt(); + switch (linkFieldId) { + case LinkField.TRACE_ID: + traceId = readBinary(unpacker); + break; + case LinkField.SPAN_ID: + spanId = unpackUnsignedLong(unpacker); + break; + case LinkField.ATTRIBUTES: + attributes = readAttributes(unpacker, stringTable); + break; + case LinkField.TRACE_STATE: + traceState = readStreamingString(unpacker, stringTable); + break; + case LinkField.TRACE_FLAGS: + traceFlags = unpackUnsignedLong(unpacker); + break; + default: + throw new IllegalArgumentException("Unexpected v1 span link field id: " + linkFieldId); + } + } + links.add(new V1SpanLink(traceId, spanId, attributes, traceState, traceFlags)); + } + return links; + } + + public static List readSpanEvents(MessageUnpacker unpacker, List stringTable) + throws IOException { + int eventCount = unpacker.unpackArrayHeader(); + List events = new ArrayList<>(eventCount); + for (int i = 0; i < eventCount; i++) { + int eventFieldCount = unpacker.unpackMapHeader(); + long timeUnixNano = 0; + String name = null; + Map attributes = Collections.emptyMap(); + for (int j = 0; j < eventFieldCount; j++) { + int eventFieldId = unpacker.unpackInt(); + switch (eventFieldId) { + case EventField.TIME_UNIX_NANO: + timeUnixNano = unpacker.unpackLong(); + break; + case EventField.NAME: + name = readStreamingString(unpacker, stringTable); + break; + case EventField.ATTRIBUTES: + attributes = readEventAttributes(unpacker, stringTable); + break; + default: + throw new IllegalArgumentException( + "Unexpected v1 span event field id: " + eventFieldId); + } + } + events.add(new V1SpanEvent(timeUnixNano, name, attributes)); + } + return events; + } + + private static Map readEventAttributes( + MessageUnpacker unpacker, List stringTable) throws IOException { + int arraySize = unpacker.unpackArrayHeader(); + assertEquals(0, arraySize % 3); + int attributeCount = arraySize / 3; + Map attributes = new HashMap<>(); + for (int i = 0; i < attributeCount; i++) { + String key = readStreamingString(unpacker, stringTable); + int valueType = unpacker.unpackInt(); + Object value; + switch (valueType) { + case VALUE_TYPE_STRING: + value = readStreamingString(unpacker, stringTable); + break; + case VALUE_TYPE_BOOLEAN: + value = unpacker.unpackBoolean(); + break; + case VALUE_TYPE_FLOAT: + value = unpacker.unpackDouble(); + break; + case VALUE_TYPE_INT: + value = unpacker.unpackLong(); + break; + case VALUE_TYPE_ARRAY: + value = readEventArrayValue(unpacker, stringTable); + break; + default: + throw new IllegalArgumentException("Unknown v1 event attribute value type: " + valueType); + } + attributes.put(key, value); + } + return attributes; + } + + private static List readEventArrayValue( + MessageUnpacker unpacker, List stringTable) throws IOException { + int arraySize = unpacker.unpackArrayHeader(); + assertEquals(0, arraySize % 2); + int itemCount = arraySize / 2; + List values = new ArrayList<>(itemCount); + for (int i = 0; i < itemCount; i++) { + int itemType = unpacker.unpackInt(); + switch (itemType) { + case VALUE_TYPE_STRING: + values.add(readStreamingString(unpacker, stringTable)); + break; + case VALUE_TYPE_BOOLEAN: + values.add(unpacker.unpackBoolean()); + break; + case VALUE_TYPE_FLOAT: + values.add(unpacker.unpackDouble()); + break; + case VALUE_TYPE_INT: + values.add(unpacker.unpackLong()); + break; + default: + throw new IllegalArgumentException("Unknown v1 event array item type: " + itemType); + } + } + return values; + } + + public static void skipPayloadField( + MessageUnpacker unpacker, int fieldId, List stringTable) throws IOException { + switch (fieldId) { + case PayloadField.CONTAINER_ID: + case PayloadField.LANGUAGE_NAME: + case PayloadField.LANGUAGE_VERSION: + case PayloadField.TRACER_VERSION: + case PayloadField.RUNTIME_ID: + case PayloadField.ENV: + case PayloadField.HOSTNAME: + case PayloadField.APP_VERSION: + readStreamingString(unpacker, stringTable); + break; + case PayloadField.ATTRIBUTES: + readAttributes(unpacker, stringTable); + break; + default: + throw new IllegalArgumentException("Unexpected v1 payload field id: " + fieldId); + } + } + + public static void skipChunkField(MessageUnpacker unpacker, int fieldId, List stringTable) + throws IOException { + switch (fieldId) { + case ChunkField.PRIORITY: + case ChunkField.SAMPLING_MECHANISM: + unpacker.unpackInt(); + break; + case ChunkField.ORIGIN: + readStreamingString(unpacker, stringTable); + break; + case ChunkField.ATTRIBUTES: + readAttributes(unpacker, stringTable); + break; + case ChunkField.SPANS: + int spanCount = unpacker.unpackArrayHeader(); + for (int i = 0; i < spanCount; i++) { + decodeSpan(unpacker, stringTable); + } + break; + case ChunkField.TRACE_ID: + readBinary(unpacker); + break; + default: + throw new IllegalArgumentException("Unexpected v1 chunk field id: " + fieldId); + } + } + + public static void skipSpanField(MessageUnpacker unpacker, int fieldId, List stringTable) + throws IOException { + switch (fieldId) { + case SpanField.SERVICE: + case SpanField.NAME: + case SpanField.RESOURCE: + case SpanField.TYPE: + case SpanField.ENV: + case SpanField.VERSION: + case SpanField.COMPONENT: + readStreamingString(unpacker, stringTable); + break; + case SpanField.SPAN_ID: + case SpanField.PARENT_ID: + unpackUnsignedLong(unpacker); + break; + case SpanField.START: + case SpanField.DURATION: + unpacker.unpackLong(); + break; + case SpanField.ERROR: + unpacker.unpackBoolean(); + break; + case SpanField.ATTRIBUTES: + readAttributes(unpacker, stringTable); + break; + case SpanField.LINKS: + readSpanLinks(unpacker, stringTable); + break; + case SpanField.EVENTS: + readSpanEvents(unpacker, stringTable); + break; + case SpanField.KIND: + unpacker.unpackInt(); + break; + default: + throw new IllegalArgumentException("Unexpected v1 span field id: " + fieldId); + } + } + + /** + * Reads a streaming string: either an inline literal (which is appended to the table) or an + * integer index into the table populated by earlier literals. + */ + public static String readStreamingString(MessageUnpacker unpacker, List stringTable) + throws IOException { + ValueType valueType = unpacker.getNextFormat().getValueType(); + if (valueType == ValueType.STRING) { + String value = unpacker.unpackString(); + stringTable.add(value); + return value; + } + if (valueType == ValueType.INTEGER) { + int index = unpacker.unpackInt(); + assertTrue(index >= 0 && index < stringTable.size(), "Invalid string-table index: " + index); + return stringTable.get(index); + } + throw new IllegalArgumentException("Expected v1 streaming string, got: " + valueType); + } + + public static long unpackUnsignedLong(MessageUnpacker unpacker) throws IOException { + if (unpacker.getNextFormat() == MessageFormat.UINT64) { + return DDSpanId.from(unpacker.unpackBigInteger().toString()); + } + return unpacker.unpackLong(); + } + + public static byte[] readBinary(MessageUnpacker unpacker) throws IOException { + byte[] bytes = new byte[unpacker.unpackBinaryHeader()]; + unpacker.readPayload(bytes); + return bytes; + } + + /** Encodes a trace id the same way {@link TraceMapperV1} serializes it (16 big-endian bytes). */ + public static byte[] traceIdBytes(DDTraceId traceId) { + return ByteBuffer.allocate(16) + .putLong(traceId.toHighOrderLong()) + .putLong(traceId.toLong()) + .array(); + } + + /** A decoded V1 span, exposing only the fields the tests assert on. */ + public static final class V1Span { + private final Map attributes; + private final List links; + private final List events; + + private V1Span( + Map attributes, List links, List events) { + this.attributes = attributes; + this.links = links; + this.events = events; + } + + public Map getAttributes() { + return attributes; + } + + public List getLinks() { + return links; + } + + public List getEvents() { + return events; + } + } + + /** A decoded V1 structured span link. */ + public static final class V1SpanLink { + private final byte[] traceId; + private final long spanId; + private final Map attributes; + private final String traceState; + private final long traceFlags; + + private V1SpanLink( + byte[] traceId, + long spanId, + Map attributes, + String traceState, + long traceFlags) { + this.traceId = traceId; + this.spanId = spanId; + this.attributes = attributes; + this.traceState = traceState; + this.traceFlags = traceFlags; + } + + public byte[] getTraceId() { + return traceId; + } + + public long getSpanId() { + return spanId; + } + + public Map getAttributes() { + return attributes; + } + + public String getTraceState() { + return traceState; + } + + public long getTraceFlags() { + return traceFlags; + } + } + + /** A decoded V1 structured span event. */ + public static final class V1SpanEvent { + private final long timeUnixNano; + private final String name; + private final Map attributes; + + private V1SpanEvent(long timeUnixNano, String name, Map attributes) { + this.timeUnixNano = timeUnixNano; + this.name = name; + this.attributes = attributes; + } + + public long getTimeUnixNano() { + return timeUnixNano; + } + + public String getName() { + return name; + } + + public Map getAttributes() { + return attributes; + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/BlackholeSpanTest.java b/dd-trace-core/src/test/java/datadog/trace/core/BlackholeSpanTest.java index b13389ee32f..d6b35bc93dc 100644 --- a/dd-trace-core/src/test/java/datadog/trace/core/BlackholeSpanTest.java +++ b/dd-trace-core/src/test/java/datadog/trace/core/BlackholeSpanTest.java @@ -1,6 +1,6 @@ package datadog.trace.core; -import static datadog.trace.junit.utils.config.WithConfigExtension.injectSysConfig; +import static datadog.trace.test.junit.utils.config.WithConfigExtension.injectSysConfig; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; diff --git a/dd-trace-core/src/test/java/datadog/trace/core/ControllableSampler.java b/dd-trace-core/src/test/java/datadog/trace/core/ControllableSampler.java deleted file mode 100644 index 4941fc0894a..00000000000 --- a/dd-trace-core/src/test/java/datadog/trace/core/ControllableSampler.java +++ /dev/null @@ -1,20 +0,0 @@ -package datadog.trace.core; - -import datadog.trace.api.sampling.PrioritySampling; -import datadog.trace.api.sampling.SamplingMechanism; -import datadog.trace.common.sampling.PrioritySampler; -import datadog.trace.common.sampling.Sampler; - -public class ControllableSampler implements Sampler, PrioritySampler { - protected int nextSamplingPriority = PrioritySampling.SAMPLER_KEEP; - - @Override - public > void setSamplingPriority(T span) { - span.setSamplingPriority(nextSamplingPriority, SamplingMechanism.DEFAULT); - } - - @Override - public > boolean sample(T span) { - return true; - } -} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/CoreSpanBuilderTest.java b/dd-trace-core/src/test/java/datadog/trace/core/CoreSpanBuilderTest.java index 05c9cd87222..9d9367551a7 100644 --- a/dd-trace-core/src/test/java/datadog/trace/core/CoreSpanBuilderTest.java +++ b/dd-trace-core/src/test/java/datadog/trace/core/CoreSpanBuilderTest.java @@ -13,7 +13,7 @@ import static datadog.trace.api.DDTags.THREAD_NAME; import static datadog.trace.api.TracePropagationStyle.DATADOG; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpan; -import static datadog.trace.junit.utils.config.WithConfigExtension.injectSysConfig; +import static datadog.trace.test.junit.utils.config.WithConfigExtension.injectSysConfig; import static java.util.concurrent.TimeUnit.MILLISECONDS; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; @@ -39,7 +39,7 @@ import datadog.trace.common.writer.ListWriter; import datadog.trace.core.propagation.ExtractedContext; import datadog.trace.core.propagation.PropagationTags; -import datadog.trace.junit.utils.config.WithConfig; +import datadog.trace.test.junit.utils.config.WithConfig; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; @@ -78,7 +78,8 @@ void buildComplexSpan() { tags.put("2", "fakeString"); tags.put("3", 42.0); - AgentTracer.SpanBuilder builder = tracer.buildSpan(expectedName).withServiceName("foo"); + AgentTracer.SpanBuilder builder = + tracer.buildSpan("datadog", expectedName).withServiceName("foo"); for (Map.Entry entry : tags.entrySet()) { builder = builder.withTag(entry.getKey(), entry.getValue()); } @@ -117,14 +118,14 @@ void buildComplexSpan() { .withSpanType(expectedType) .start(); - DDSpanContext context = span.context(); + DDSpanContext spanContext = span.spanContext(); - assertEquals(expectedResource, context.getResourceName()); - assertTrue(context.getErrorFlag()); - assertEquals(expectedService, context.getServiceName()); - assertEquals(expectedType, context.getSpanType()); - assertEquals(Thread.currentThread().getName(), context.getTag(THREAD_NAME)); - assertEquals(Thread.currentThread().getId(), context.getTag(THREAD_ID)); + assertEquals(expectedResource, spanContext.getResourceName()); + assertTrue(spanContext.getErrorFlag()); + assertEquals(expectedService, spanContext.getServiceName()); + assertEquals(expectedType, spanContext.getSpanType()); + assertEquals(Thread.currentThread().getName(), spanContext.getTag(THREAD_NAME)); + assertEquals(Thread.currentThread().getId(), spanContext.getTag(THREAD_ID)); } @TableTest({ @@ -195,9 +196,9 @@ void shouldLinkToParentSpan() { .asChildOf(mockedContext) .start(); - DDSpanContext actualContext = span.context(); - assertEquals(expectedParentId, actualContext.getParentId()); - assertEquals(traceId, actualContext.getTraceId()); + DDSpanContext actualSpanContext = span.spanContext(); + assertEquals(expectedParentId, actualSpanContext.getParentId()); + assertEquals(traceId, actualSpanContext.getTraceId()); } @TableTest({ @@ -214,13 +215,13 @@ void shouldLinkToParentSpanImplicitly( noopParent ? noopSpan() : tracer.buildSpan("test", "parent").withServiceName("service").start())) { - long expectedParentId = noopParent ? DDSpanId.ZERO : parent.span().context().getSpanId(); + long expectedParentId = noopParent ? DDSpanId.ZERO : parent.span().spanContext().getSpanId(); DDSpan span = (DDSpan) tracer.buildSpan("test", "fakeName").withServiceName(serviceName).start(); - DDSpanContext actualContext = span.context(); - assertEquals(expectedParentId, actualContext.getParentId()); + DDSpanContext actualSpanContext = span.spanContext(); + assertEquals(expectedParentId, actualSpanContext.getParentId()); assertEquals(expectTopLevel, span.isTopLevel()); } } @@ -259,9 +260,9 @@ void shouldInheritTheDDParentAttributes() { assertEquals(expectedName, span.getOperationName()); assertEquals(expectedBaggageItemValue, span.getBaggageItem(expectedBaggageItemKey)); - assertEquals(expectedParentServiceName, span.context().getServiceName()); - assertEquals(expectedName, span.context().getResourceName()); - assertNull(span.context().getSpanType()); + assertEquals(expectedParentServiceName, span.spanContext().getServiceName()); + assertEquals(expectedName, span.spanContext().getResourceName()); + assertNull(span.spanContext().getSpanType()); assertTrue(span.isTopLevel()); // service names differ between parent and child // ServiceName and SpanType are always overwritten by the child if they are present @@ -277,9 +278,9 @@ void shouldInheritTheDDParentAttributes() { assertEquals(expectedName, span.getOperationName()); assertEquals(expectedBaggageItemValue, span.getBaggageItem(expectedBaggageItemKey)); - assertEquals(expectedChildServiceName, span.context().getServiceName()); - assertEquals(expectedChildResourceName, span.context().getResourceName()); - assertEquals(expectedChildType, span.context().getSpanType()); + assertEquals(expectedChildServiceName, span.spanContext().getServiceName()); + assertEquals(expectedChildResourceName, span.spanContext().getResourceName()); + assertEquals(expectedChildType, span.spanContext().getSpanType()); } @Test @@ -302,13 +303,15 @@ void shouldTrackAllSpansInTrace() { lastSpan.finish(); } - PendingTrace traceCollector = (PendingTrace) root.context().getTraceCollector(); + PendingTrace traceCollector = (PendingTrace) root.spanContext().getTraceCollector(); assertEquals(root, traceCollector.getRootSpan()); assertEquals(nbSamples, traceCollector.size()); assertTrue(traceCollector.getSpans().containsAll(spans)); DDSpan randomSpan = spans.get((int) (Math.random() * nbSamples)); assertTrue( - ((PendingTrace) randomSpan.context().getTraceCollector()).getSpans().containsAll(spans)); + ((PendingTrace) randomSpan.spanContext().getTraceCollector()) + .getSpans() + .containsAll(spans)); } static Stream extractedContextShouldPopulateNewSpanDetailsArguments() { @@ -350,13 +353,13 @@ void extractedContextShouldPopulateNewSpanDetails(ExtractedContext extractedCont assertEquals(extractedContext.getTraceId(), span.getTraceId()); assertEquals(extractedContext.getSpanId(), span.getParentId()); assertEquals(extractedContext.getSamplingPriority(), (int) span.getSamplingPriority()); - assertEquals(extractedContext.getOrigin(), span.context().getOrigin()); - assertEquals(extractedContext.getBaggage(), span.context().getBaggageItems()); + assertEquals(extractedContext.getOrigin(), span.spanContext().getOrigin()); + assertEquals(extractedContext.getBaggage(), span.spanContext().getBaggageItems()); assertEquals(thread.getId(), span.getTag(THREAD_ID)); assertEquals(thread.getName(), span.getTag(THREAD_NAME)); assertEquals( extractedContext.getPropagationTags().headerValue(PropagationTags.HeaderType.DATADOG), - span.context().getPropagationTags().headerValue(PropagationTags.HeaderType.DATADOG)); + span.spanContext().getPropagationTags().headerValue(PropagationTags.HeaderType.DATADOG)); } @Test @@ -419,6 +422,40 @@ void buildContextFromExtractedContextWithIgnoreBehavior() { assertTrue(span.getLinks().isEmpty()); } + @Test + @WithConfig(key = "trace.propagation.behavior.extract", value = "ignore") + void appSecContextPreservedFromTagContextWithIgnoreBehavior() { + Object appSecData = new Object(); + Object iastData = new Object(); + TagContext tagContext = + new TagContext() + .withRequestContextDataAppSec(appSecData) + .withRequestContextDataIast(iastData); + + DDSpan span = (DDSpan) tracer.buildSpan("test", "op name").asChildOf(tagContext).start(); + + assertEquals(appSecData, span.getRequestContext().getData(RequestContextSlot.APPSEC)); + assertEquals(iastData, span.getRequestContext().getData(RequestContextSlot.IAST)); + span.finish(); + } + + @Test + @WithConfig(key = "trace.propagation.behavior.extract", value = "restart") + void appSecContextPreservedFromTagContextWithRestartBehavior() { + Object appSecData = new Object(); + Object iastData = new Object(); + TagContext tagContext = + new TagContext() + .withRequestContextDataAppSec(appSecData) + .withRequestContextDataIast(iastData); + + DDSpan span = (DDSpan) tracer.buildSpan("test", "op name").asChildOf(tagContext).start(); + + assertEquals(appSecData, span.getRequestContext().getData(RequestContextSlot.APPSEC)); + assertEquals(iastData, span.getRequestContext().getData(RequestContextSlot.IAST)); + span.finish(); + } + @TableTest({ "scenario | origin | tagMap ", "empty tag map | | [:] ", @@ -433,8 +470,8 @@ void tagContextShouldPopulateDefaultSpanDetails( assertNotEquals(DDTraceId.ZERO, span.getTraceId()); assertEquals(DDSpanId.ZERO, span.getParentId()); assertNull(span.getSamplingPriority()); - assertEquals(tagContext.getOrigin(), span.context().getOrigin()); - assertEquals(Collections.emptyMap(), span.context().getBaggageItems()); + assertEquals(tagContext.getOrigin(), span.spanContext().getOrigin()); + assertEquals(Collections.emptyMap(), span.spanContext().getBaggageItems()); Map expectedTags = new HashMap<>(); if (tagContext.getTags() != null) { @@ -447,7 +484,7 @@ void tagContextShouldPopulateDefaultSpanDetails( expectedTags.put(PID_TAG, Config.get().getProcessId()); expectedTags.put(SCHEMA_VERSION_TAG_KEY, SpanNaming.instance().version()); expectedTags.putAll(productTags()); - assertEquals(expectedTags, span.context().getTags()); + assertEquals(expectedTags, span.spanContext().getTags()); } static Stream globalSpanTagsPopulatedOnEachSpanArguments() { @@ -494,7 +531,7 @@ void canOverwriteRequestContextDataWithBuilderFromEmpty() { AgentSpan span2 = tracer .buildSpan("test", "span2") - .asChildOf(span1.context()) + .asChildOf(span1.spanContext()) .withRequestContextData(RequestContextSlot.APPSEC, "override") .withRequestContextData(RequestContextSlot.CI_VISIBILITY, "override") .withRequestContextData(RequestContextSlot.IAST, "override") @@ -517,7 +554,7 @@ void canOverwriteRequestContextDataWithBuilder() { .withRequestContextDataAppSec("value"); AgentSpan span1 = tracer.buildSpan("test", "span1").asChildOf(context).start(); - AgentSpan span2 = tracer.buildSpan("test", "span2").asChildOf(span1.context()).start(); + AgentSpan span2 = tracer.buildSpan("test", "span2").asChildOf(span1.spanContext()).start(); assertEquals("value", span2.getRequestContext().getData(RequestContextSlot.APPSEC)); assertEquals("value", span2.getRequestContext().getData(RequestContextSlot.CI_VISIBILITY)); @@ -526,7 +563,7 @@ void canOverwriteRequestContextDataWithBuilder() { AgentSpan span3 = tracer .buildSpan("test", "span3") - .asChildOf(span2.context()) + .asChildOf(span2.spanContext()) .withRequestContextData(RequestContextSlot.APPSEC, "override") .withRequestContextData(RequestContextSlot.CI_VISIBILITY, "override") .withRequestContextData(RequestContextSlot.IAST, "override") diff --git a/dd-trace-core/src/test/java/datadog/trace/core/CoreTracerTest.java b/dd-trace-core/src/test/java/datadog/trace/core/CoreTracerTest.java index 3fed68f16eb..7ec13d1bea9 100644 --- a/dd-trace-core/src/test/java/datadog/trace/core/CoreTracerTest.java +++ b/dd-trace-core/src/test/java/datadog/trace/core/CoreTracerTest.java @@ -1,6 +1,6 @@ package datadog.trace.core; -import static datadog.trace.junit.utils.config.WithConfigExtension.injectSysConfig; +import static datadog.trace.test.junit.utils.config.WithConfigExtension.injectSysConfig; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertInstanceOf; @@ -37,7 +37,7 @@ import datadog.trace.common.writer.LoggingWriter; import datadog.trace.core.CoreTracer.ConfigSnapshot; import datadog.trace.core.tagprocessor.TagsPostProcessorFactory; -import datadog.trace.junit.utils.config.WithConfig; +import datadog.trace.test.junit.utils.config.WithConfig; import java.lang.reflect.Field; import java.nio.charset.StandardCharsets; import java.util.Collections; @@ -199,8 +199,8 @@ void rootTagsAppliedOnlyToRootSpans() { Map localRootSpanTags = new LinkedHashMap<>(); localRootSpanTags.put("only_root", "value"); CoreTracer tracer = tracerBuilder().localRootSpanTags(localRootSpanTags).build(); - AgentSpan root = tracer.buildSpan("my_root").start(); - AgentSpan child = tracer.buildSpan("my_child").asChildOf(root.context()).start(); + AgentSpan root = tracer.buildSpan("datadog", "my_root").start(); + AgentSpan child = tracer.buildSpan("datadog", "my_child").asChildOf(root.spanContext()).start(); try { assertTrue(root.getTags().containsKey("only_root")); assertFalse(child.getTags().containsKey("only_root")); @@ -216,7 +216,7 @@ void prioritySamplingWhenSpanFinishes() throws Exception { ListWriter writer = new ListWriter(); CoreTracer tracer = tracerBuilder().writer(writer).build(); try { - DDSpan span = (DDSpan) tracer.buildSpan("operation").start(); + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "operation").start(); span.finish(); writer.waitForTraces(1); assertEquals(PrioritySampling.SAMPLER_KEEP, (int) span.getSamplingPriority()); @@ -230,8 +230,9 @@ void prioritySamplingSetWhenChildSpanComplete() throws Exception { ListWriter writer = new ListWriter(); CoreTracer tracer = tracerBuilder().writer(writer).build(); try { - DDSpan root = (DDSpan) tracer.buildSpan("operation").start(); - DDSpan child = (DDSpan) tracer.buildSpan("my_child").asChildOf(root.context()).start(); + DDSpan root = (DDSpan) tracer.buildSpan("datadog", "operation").start(); + DDSpan child = + (DDSpan) tracer.buildSpan("datadog", "my_child").asChildOf(root.spanContext()).start(); root.finish(); assertNull(root.getSamplingPriority()); @@ -476,12 +477,13 @@ void testDdVersionExistsOnlyIfServiceEqDdService() { CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); try { DDSpan span = - (DDSpan) tracer.buildSpan("def").withTag(GeneralConfig.SERVICE_NAME, "foo").start(); + (DDSpan) + tracer.buildSpan("datadog", "def").withTag(GeneralConfig.SERVICE_NAME, "foo").start(); span.finish(); assertEquals("foo", span.getServiceName()); assertFalse(span.getTags().containsKey("version")); - DDSpan span2 = (DDSpan) tracer.buildSpan("abc").start(); + DDSpan span2 = (DDSpan) tracer.buildSpan("datadog", "abc").start(); span2.finish(); assertEquals("dd_service_name", span2.getServiceName()); assertEquals("1.0.0", String.valueOf(span2.getTags().get("version"))); @@ -494,7 +496,7 @@ void testDdVersionExistsOnlyIfServiceEqDdService() { void flushesOnTracerCloseIfConfiguredToDoSo() { WriterWithExplicitFlush writer = new WriterWithExplicitFlush(); CoreTracer tracer = tracerBuilder().writer(writer).flushOnClose(true).build(); - tracer.buildSpan("my_span").start().finish(); + tracer.buildSpan("datadog", "my_span").start().finish(); tracer.close(); assertFalse(writer.flushedTraces.isEmpty()); } @@ -553,9 +555,9 @@ void verifyNoFilteringOfServiceEnvWhenMismatchedWithDdServiceDdEnv( void serviceNameSourceIsRecordedWhenUsingTwoParameterSetServiceName() { CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); try { - DDSpan span = (DDSpan) tracer.buildSpan("operation").start(); + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "operation").start(); span.setServiceName("custom-service", "my-integration"); - DDSpan child = (DDSpan) tracer.buildSpan("child").start(); + DDSpan child = (DDSpan) tracer.buildSpan("datadog", "child").start(); child.finish(); span.finish(); @@ -570,7 +572,7 @@ void serviceNameSourceIsRecordedWhenUsingTwoParameterSetServiceName() { void serviceNameSourceIsMarkedAsManualWhenUsingOneParameterSetServiceName() { CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); try { - DDSpan span = (DDSpan) tracer.buildSpan("operation").start(); + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "operation").start(); span.setServiceName("custom-service", "my-integration"); span.setServiceName("another"); span.finish(); @@ -586,7 +588,7 @@ void serviceNameSourceIsMarkedAsManualWhenUsingOneParameterSetServiceName() { void serviceNameSourceIsMissingWhenNotExplicitlySettingServiceName() { CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); try { - DDSpan span = (DDSpan) tracer.buildSpan("operation").start(); + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "operation").start(); span.finish(); assertEquals(tracer.serviceName, span.getServiceName()); diff --git a/dd-trace-core/src/test/java/datadog/trace/core/DDSpanContextPropagationTagsTest.java b/dd-trace-core/src/test/java/datadog/trace/core/DDSpanContextPropagationTagsTest.java index 12cc53e8abb..522b0da3463 100644 --- a/dd-trace-core/src/test/java/datadog/trace/core/DDSpanContextPropagationTagsTest.java +++ b/dd-trace-core/src/test/java/datadog/trace/core/DDSpanContextPropagationTagsTest.java @@ -15,7 +15,7 @@ import datadog.trace.common.writer.ListWriter; import datadog.trace.core.propagation.ExtractedContext; import datadog.trace.core.propagation.PropagationTags; -import datadog.trace.junit.utils.tabletest.TableTestTypeConverters; +import datadog.trace.test.junit.utils.tabletest.TableTestTypeConverters; import java.util.Map; import org.junit.jupiter.api.BeforeEach; import org.tabletest.junit.TableTest; @@ -57,8 +57,8 @@ void updateSpanPropagationTags( AgentSpanContext extracted = new ExtractedContext(DDTraceId.from(123), 456, priority, "789", propagationTags, DATADOG) .withRequestContextDataAppSec("dummy"); - DDSpan span = (DDSpan) tracer.buildSpan("top").asChildOf(extracted).start(); - PropagationTags dd = span.context().getPropagationTags(); + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "top").asChildOf(extracted).start(); + PropagationTags dd = span.spanContext().getPropagationTags(); span.setSamplingPriority(newPriority, newMechanism); @@ -89,9 +89,10 @@ void updateTracePropagationTags( AgentSpanContext extracted = new ExtractedContext(DDTraceId.from(123), 456, priority, "789", propagationTags, DATADOG) .withRequestContextDataAppSec("dummy"); - DDSpan rootSpan = (DDSpan) tracer.buildSpan("top").asChildOf(extracted).start(); - PropagationTags ddRoot = rootSpan.context().getPropagationTags(); - DDSpan span = (DDSpan) tracer.buildSpan("current").asChildOf(rootSpan.context()).start(); + DDSpan rootSpan = (DDSpan) tracer.buildSpan("datadog", "top").asChildOf(extracted).start(); + PropagationTags ddRoot = rootSpan.spanContext().getPropagationTags(); + DDSpan span = + (DDSpan) tracer.buildSpan("datadog", "current").asChildOf(rootSpan.spanContext()).start(); span.setSamplingPriority(newPriority, newMechanism); @@ -114,10 +115,10 @@ void forceKeepSpanPropagationTags( AgentSpanContext extracted = new ExtractedContext(DDTraceId.from(123), 456, priority, "789", propagationTags, DATADOG) .withRequestContextDataAppSec("dummy"); - DDSpan span = (DDSpan) tracer.buildSpan("top").asChildOf(extracted).start(); - PropagationTags dd = span.context().getPropagationTags(); + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "top").asChildOf(extracted).start(); + PropagationTags dd = span.spanContext().getPropagationTags(); - span.context().forceKeep(); + span.spanContext().forceKeep(); assertEquals(newHeader, dd.headerValue(PropagationTags.HeaderType.DATADOG)); assertEquals(tagMap, dd.createTagMap()); @@ -142,11 +143,12 @@ void forceKeepTracePropagationTags( AgentSpanContext extracted = new ExtractedContext(DDTraceId.from(123), 456, priority, "789", propagationTags, DATADOG) .withRequestContextDataAppSec("dummy"); - DDSpan rootSpan = (DDSpan) tracer.buildSpan("top").asChildOf(extracted).start(); - PropagationTags ddRoot = rootSpan.context().getPropagationTags(); - DDSpan span = (DDSpan) tracer.buildSpan("current").asChildOf(rootSpan.context()).start(); + DDSpan rootSpan = (DDSpan) tracer.buildSpan("datadog", "top").asChildOf(extracted).start(); + PropagationTags ddRoot = rootSpan.spanContext().getPropagationTags(); + DDSpan span = + (DDSpan) tracer.buildSpan("datadog", "current").asChildOf(rootSpan.spanContext()).start(); - span.context().forceKeep(); + span.spanContext().forceKeep(); assertEquals(rootHeader, ddRoot.headerValue(PropagationTags.HeaderType.DATADOG)); assertEquals(rootTagMap, ddRoot.createTagMap()); diff --git a/dd-trace-core/src/test/java/datadog/trace/core/DDSpanContextTest.java b/dd-trace-core/src/test/java/datadog/trace/core/DDSpanContextTest.java new file mode 100644 index 00000000000..030687c06ec --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/DDSpanContextTest.java @@ -0,0 +1,583 @@ +package datadog.trace.core; + +import static datadog.trace.api.DDTags.DJM_ENABLED; +import static datadog.trace.api.DDTags.DSM_ENABLED; +import static datadog.trace.api.DDTags.PROFILING_CONTEXT_ENGINE; +import static datadog.trace.api.DDTags.PROFILING_ENABLED; +import static datadog.trace.api.DDTags.THREAD_ID; +import static datadog.trace.api.DDTags.THREAD_NAME; +import static datadog.trace.api.TracePropagationStyle.DATADOG; +import static datadog.trace.api.sampling.PrioritySampling.SAMPLER_DROP; +import static datadog.trace.api.sampling.PrioritySampling.SAMPLER_KEEP; +import static datadog.trace.api.sampling.PrioritySampling.UNSET; +import static datadog.trace.api.sampling.PrioritySampling.USER_DROP; +import static datadog.trace.api.sampling.PrioritySampling.USER_KEEP; +import static datadog.trace.api.sampling.SamplingMechanism.DEFAULT; +import static datadog.trace.api.sampling.SamplingMechanism.MANUAL; +import static datadog.trace.api.sampling.SamplingMechanism.SPAN_SAMPLING_RATE; +import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND; +import static datadog.trace.core.DDSpanContext.SPAN_KIND_VALUES; +import static datadog.trace.core.DDSpanContext.SPAN_SAMPLING_MAX_PER_SECOND_TAG; +import static datadog.trace.core.DDSpanContext.SPAN_SAMPLING_MECHANISM_TAG; +import static datadog.trace.core.DDSpanContext.SPAN_SAMPLING_RULE_RATE_TAG; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import datadog.trace.api.DDTags; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.internal.TraceSegment; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext; +import datadog.trace.bootstrap.instrumentation.api.ErrorPriorities; +import datadog.trace.bootstrap.instrumentation.api.ProfilingContextIntegration; +import datadog.trace.bootstrap.instrumentation.api.ServiceNameSources; +import datadog.trace.bootstrap.instrumentation.api.Tags; +import datadog.trace.common.writer.ListWriter; +import datadog.trace.core.propagation.ExtractedContext; +import datadog.trace.test.junit.utils.tabletest.TableTestTypeConverters; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.params.provider.ValueSource; +import org.tabletest.junit.TableTest; +import org.tabletest.junit.TypeConverter; +import org.tabletest.junit.TypeConverterSources; + +@TypeConverterSources(TableTestTypeConverters.class) +public class DDSpanContextTest extends DDCoreJavaSpecification { + + private ListWriter writer; + private CoreTracer tracer; + private ProfilingContextIntegration profilingContextIntegration; + + @BeforeEach + void setup() { + writer = new ListWriter(); + profilingContextIntegration = mock(ProfilingContextIntegration.class); + tracer = + tracerBuilder() + .writer(writer) + .profilingContextIntegration(profilingContextIntegration) + .build(); + } + + @ParameterizedTest + @ValueSource(strings = {DDTags.SERVICE_NAME, DDTags.RESOURCE_NAME, DDTags.SPAN_TYPE, "some.tag"}) + void nullValuesForTagsDeleteExistingTags(String name) throws Exception { + AgentSpan span = + tracer + .buildSpan("datadog", "fakeOperation") + .withServiceName("fakeService") + .withResourceName("fakeResource") + .withSpanType("fakeType") + .start(); + DDSpanContext context = (DDSpanContext) span.spanContext(); + + context.setTag("some.tag", "asdf"); + context.setTag(name, null); + context.setErrorFlag(true, ErrorPriorities.DEFAULT); + span.finish(); + writer.waitForTraces(1); + + Map expectedTags = createExpectedTagsFromCurrentThread(); + if (!"some.tag".equals(name)) { + expectedTags.put("some.tag", "asdf"); + } + + assertTagmap(context.getTags(), expectedTags); + assertEquals("fakeService", context.getServiceName()); + assertEquals("fakeResource", context.getResourceName().toString()); + assertEquals("fakeType", context.getSpanType().toString()); + } + + private static Map createExpectedTagsFromCurrentThread() { + Thread thread = Thread.currentThread(); + Map expectedTags = new HashMap<>(); + expectedTags.put(THREAD_NAME, thread.getName()); + expectedTags.put(THREAD_ID, thread.getId()); + expectedTags.put(DDTags.DD_SVC_SRC, ServiceNameSources.MANUAL); + return expectedTags; + } + + // spotless:off + @TableTest({ + "scenario | name | expected | method ", + "SERVICE_NAME tag | " + DDTags.SERVICE_NAME + " | different service | serviceName ", + "RESOURCE_NAME tag | " + DDTags.RESOURCE_NAME + " | different resource | resourceName ", + "SPAN_TYPE tag | " + DDTags.SPAN_TYPE + " | different type | spanType " + }) + //spotless:on + void specialTagsSetCertainValues(String scenario, String name, String expected, String method) + throws Exception { + AgentSpan span = + tracer + .buildSpan("datadog", "fakeOperation") + .withServiceName("fakeService") + .withResourceName("fakeResource") + .withSpanType("fakeType") + .start(); + DDSpanContext context = (DDSpanContext) span.spanContext(); + + context.setTag(name, expected); + span.finish(); + writer.waitForTraces(1); + + Map expectedTags = createExpectedTagsFromCurrentThread(); + assertTagmap(context.getTags(), expectedTags); + + String value; + switch (method) { + case "serviceName": + value = context.getServiceName(); + break; + case "resourceName": + value = context.getResourceName().toString(); + break; + case "spanType": + value = context.getSpanType().toString(); + break; + default: + throw new IllegalArgumentException("Unknown method: " + method); + } + assertEquals(expected, value); + } + + static Object[][] tagsCanBeAddedToContextArguments() { + return new Object[][] { + {"tag.name", "some value"}, + {"tag with int", 1234}, + {"tag-with-bool", false}, + {"tag_with_float", 0.321} + }; + } + + @ParameterizedTest + @MethodSource("tagsCanBeAddedToContextArguments") + void tagsCanBeAddedToContext(String name, Object value) throws Exception { + AgentSpan span = + tracer + .buildSpan("datadog", "fakeOperation") + .withServiceName("fakeService") + .withResourceName("fakeResource") + .withSpanType("fakeType") + .start(); + DDSpanContext context = (DDSpanContext) span.spanContext(); + + context.setTag(name, value); + span.finish(); + writer.waitForTraces(1); + + Map expectedTags = createExpectedTagsFromCurrentThread(); + expectedTags.put(name, value); + assertTagmap(context.getTags(), expectedTags); + } + + @TableTest({ + "expectedType | value ", + "java.lang.Integer | 0 ", + "java.lang.Integer | Integer.MAX_VALUE", + "java.lang.Integer | Integer.MIN_VALUE", + "java.lang.Short | Short.MAX_VALUE ", + "java.lang.Short | Short.MIN_VALUE ", + "java.lang.Float | Float.MAX_VALUE ", + "java.lang.Float | Float.MIN_VALUE ", + "java.lang.Double | Double.MAX_VALUE ", + "java.lang.Double | Double.MIN_VALUE ", + "java.lang.Float | 1f ", + "java.lang.Double | 1d ", + "java.lang.Float | 0.5f ", + "java.lang.Double | 0.5d ", + "java.lang.Integer | 0x55 " + }) + void metricsUseExpectedTypes(Class expectedType, Number value) { + // floats should be converted to doubles. + AgentSpan span = + tracer + .buildSpan("datadog", "fakeOperation") + .withServiceName("fakeService") + .withResourceName("fakeResource") + .start(); + DDSpanContext context = (DDSpanContext) span.spanContext(); + + context.setMetric("test", value); + + assertInstanceOf(expectedType, context.getTag("test")); + + span.finish(); + } + + @Test + void forceKeepReallyKeepsTrace() { + AgentSpan span = + tracer + .buildSpan("datadog", "fakeOperation") + .withServiceName("fakeService") + .withResourceName("fakeResource") + .start(); + DDSpanContext context = (DDSpanContext) span.spanContext(); + + context.setSamplingPriority(SAMPLER_DROP, DEFAULT); + assertEquals(SAMPLER_DROP, context.getSamplingPriority()); + + context.lockSamplingPriority(); + assertFalse(context.setSamplingPriority(USER_DROP, MANUAL)); + assertEquals(SAMPLER_DROP, context.getSamplingPriority()); + + context.forceKeep(); + assertEquals(USER_KEEP, context.getSamplingPriority()); + + span.finish(); + } + + @Test + void setTraceSegmentTagsAndDataOnCorrectSpan() { + ExtractedContext extracted = + (ExtractedContext) + new ExtractedContext( + DDTraceId.from(123), + 456, + SAMPLER_KEEP, + "789", + tracer.getPropagationTagsFactory().empty(), + DATADOG) + .withRequestContextDataAppSec("dummy"); + + AgentSpan top = + tracer.buildSpan("datadog", "top").asChildOf((AgentSpanContext) extracted).start(); + DDSpanContext topC = (DDSpanContext) top.spanContext(); + TraceSegment topTS = top.getRequestContext().getTraceSegment(); + + AgentSpan current = tracer.buildSpan("datadog", "current").asChildOf(top.spanContext()).start(); + TraceSegment currentTS = current.getRequestContext().getTraceSegment(); + DDSpanContext currentC = (DDSpanContext) current.spanContext(); + + currentTS.setDataTop("ctd", "[1]"); + currentTS.setTagTop("ctt", "t1"); + currentTS.setDataCurrent("ccd", "[2]"); + currentTS.setTagCurrent("cct", "t2"); + topTS.setDataTop("ttd", "[3]"); + topTS.setTagTop("ttt", "t3"); + topTS.setDataCurrent("tcd", "[4]"); + topTS.setTagCurrent("tct", "t4"); + + Map expectedTopTags = new HashMap<>(); + expectedTopTags.put(dataTag("ctd"), "[1]"); + expectedTopTags.put("ctt", "t1"); + expectedTopTags.put(dataTag("ttd"), "[3]"); + expectedTopTags.put("ttt", "t3"); + expectedTopTags.put(dataTag("tcd"), "[4]"); + expectedTopTags.put("tct", "t4"); + assertTagmap(topC.getTags(), expectedTopTags, true); + + Map expectedCurrentTags = new HashMap<>(); + expectedCurrentTags.put(dataTag("ccd"), "[2]"); + expectedCurrentTags.put("cct", "t2"); + assertTagmap(currentC.getTags(), expectedCurrentTags, true); + + current.finish(); + top.finish(); + } + + @TableTest({ + "rate | limit ", + "1.0 | 10 ", + "0.5 | 100 ", + "0.25 | Integer.MAX_VALUE" + }) + void setSingleSpanSamplingTags(double rate, int limit) { + AgentSpan span = + tracer + .buildSpan("datadog", "fakeOperation") + .withServiceName("fakeService") + .withResourceName("fakeResource") + .start(); + DDSpanContext context = (DDSpanContext) span.spanContext(); + assertEquals(UNSET, context.getSamplingPriority()); + + context.setSpanSamplingPriority(rate, limit); + + assertEquals((int) SPAN_SAMPLING_RATE, context.getTag(SPAN_SAMPLING_MECHANISM_TAG)); + assertEquals(rate, context.getTag(SPAN_SAMPLING_RULE_RATE_TAG)); + assertEquals( + limit == Integer.MAX_VALUE ? null : Double.valueOf(limit), + context.getTag(SPAN_SAMPLING_MAX_PER_SECOND_TAG)); + // single span sampling should not change the trace sampling priority + assertEquals(UNSET, context.getSamplingPriority()); + // make sure the `_dd.p.dm` tag has not been set by single span sampling + assertFalse(context.getPropagationTags().createTagMap().containsKey("_dd.p.dm")); + + span.finish(); + } + + @Test + void settingResourceNameToNullIsIgnored() { + AgentSpan span = + tracer + .buildSpan("datadog", "fakeOperation") + .withServiceName("fakeService") + .withResourceName("fakeResource") + .start(); + + span.setResourceName(null); + + assertEquals("fakeResource", ((DDSpan) span).getResourceName().toString()); + + span.finish(); + } + + @Test + void settingOperationNameTriggersConstantEncoding() { + when(profilingContextIntegration.encodeOperationName("fakeOperation")).thenReturn(1); + when(profilingContextIntegration.encodeResourceName("fakeResource")).thenReturn(-1); + + AgentSpan span = + tracer + .buildSpan("datadog", "fakeOperation") + .withServiceName("fakeService") + .withResourceName("fakeResource") + .start(); + + verify(profilingContextIntegration, times(1)).encodeOperationName("fakeOperation"); + verify(profilingContextIntegration, times(1)).encodeResourceName("fakeResource"); + assertEquals(1, ((DDSpanContext) span.spanContext()).getEncodedOperationName()); + assertEquals(-1, ((DDSpanContext) span.spanContext()).getEncodedResourceName()); + + when(profilingContextIntegration.encodeOperationName("newOperationName")).thenReturn(2); + span.setOperationName("newOperationName"); + + verify(profilingContextIntegration, times(1)).encodeOperationName("newOperationName"); + assertEquals(2, ((DDSpanContext) span.spanContext()).getEncodedOperationName()); + + when(profilingContextIntegration.encodeResourceName("newResourceName")).thenReturn(-2); + span.setResourceName("newResourceName"); + + verify(profilingContextIntegration, times(1)).encodeResourceName("newResourceName"); + assertEquals(-2, ((DDSpanContext) span.spanContext()).getEncodedResourceName()); + + span.finish(); + } + + @Test + void spanIdsPrintedAsUnsignedLong() { + AgentSpan parent = + tracer + .buildSpan("datadog", "fakeOperation") + .withServiceName("fakeService") + .withResourceName("fakeResource") + .withSpanId(-987654321) + .start(); + + AgentSpan span = + tracer + .buildSpan("datadog", "fakeOperation") + .withServiceName("fakeService") + .withResourceName("fakeResource") + .withSpanId(-123456789) + .asChildOf(parent.spanContext()) + .start(); + + DDSpanContext context = (DDSpanContext) span.spanContext(); + + // even though span ID and parent ID are setup as negative numbers, they should be printed as + // their unsigned value + // asserting there is no negative sign after ids is the best I can do. + assertFalse(context.toString().contains("id=-")); + + span.finish(); + parent.finish(); + } + + @Test + void serviceNameSourceIsPropagatedFromParentToChildSpan() { + AgentSpan parent = + tracer.buildSpan("datadog", "parentOperation").withServiceName("fakeService").start(); + + AgentSpan child = + tracer.buildSpan("datadog", "childOperation").asChildOf(parent.spanContext()).start(); + DDSpanContext childContext = (DDSpanContext) child.spanContext(); + + assertEquals(ServiceNameSources.MANUAL, childContext.getServiceNameSource()); + + child.finish(); + parent.finish(); + } + + @Test + void spanKindOrdinalConstantsAndSpanKindValuesArrayStayInSync() { + // SPAN_KIND_VALUES array covers all ordinals + assertEquals(DDSpanContext.SPAN_KIND_CUSTOM + 1, SPAN_KIND_VALUES.length); + + // each known ordinal maps to the correct Tags constant" + assertEquals(Tags.SPAN_KIND_SERVER, SPAN_KIND_VALUES[DDSpanContext.SPAN_KIND_SERVER]); + assertEquals(Tags.SPAN_KIND_CLIENT, SPAN_KIND_VALUES[DDSpanContext.SPAN_KIND_CLIENT]); + assertEquals(Tags.SPAN_KIND_PRODUCER, SPAN_KIND_VALUES[DDSpanContext.SPAN_KIND_PRODUCER]); + assertEquals(Tags.SPAN_KIND_CONSUMER, SPAN_KIND_VALUES[DDSpanContext.SPAN_KIND_CONSUMER]); + assertEquals(Tags.SPAN_KIND_INTERNAL, SPAN_KIND_VALUES[DDSpanContext.SPAN_KIND_INTERNAL]); + assertEquals(Tags.SPAN_KIND_BROKER, SPAN_KIND_VALUES[DDSpanContext.SPAN_KIND_BROKER]); + + // UNSET and CUSTOM map to null + assertNull(SPAN_KIND_VALUES[DDSpanContext.SPAN_KIND_UNSET]); + assertNull(SPAN_KIND_VALUES[DDSpanContext.SPAN_KIND_CUSTOM]); + } + + @TableTest({ + "scenario | kindString | expectedOrdinal ", + "server | server | DDSpanContext.SPAN_KIND_SERVER ", + "client | client | DDSpanContext.SPAN_KIND_CLIENT ", + "producer | producer | DDSpanContext.SPAN_KIND_PRODUCER", + "consumer | consumer | DDSpanContext.SPAN_KIND_CONSUMER", + "internal | internal | DDSpanContext.SPAN_KIND_INTERNAL", + "broker | broker | DDSpanContext.SPAN_KIND_BROKER " + }) + void setSpanKindOrdinalRoundTripsWithSpanKindValues( + String scenario, String kindString, int expectedOrdinal) { + AgentSpan span = tracer.buildSpan("test", "test").start(); + DDSpanContext context = (DDSpanContext) span.spanContext(); + context.setSpanKindOrdinal(kindString); + + assertEquals(expectedOrdinal, context.getSpanKindOrdinal()); + assertEquals(kindString, SPAN_KIND_VALUES[expectedOrdinal]); + + span.finish(); + } + + @Test + void builderLedgerRemovalOfSpanKindClearsCachedOrdinal() { + // Setting then nulling span.kind on the same builder routes through + // setAllTags(TagMap.Ledger) at construction time. The removal path must + // keep the cached ordinal in sync with unsafeTags, otherwise eligibility + // checks that read the cached byte see a stale kind. + AgentSpan span = + tracer + .buildSpan("datadog", "test") + .withTag(SPAN_KIND, Tags.SPAN_KIND_CLIENT) + .withTag(SPAN_KIND, (Object) null) + .start(); + DDSpanContext context = (DDSpanContext) span.spanContext(); + + assertNull(context.getTag(SPAN_KIND)); + assertEquals(DDSpanContext.SPAN_KIND_UNSET, context.getSpanKindOrdinal()); + + span.finish(); + } + + @TypeConverter + public static int toInt(String value) { + if (value == null) { + throw new IllegalArgumentException("Value cannot be null"); + } + switch (value) { + case "DDSpanContext.SPAN_KIND_SERVER": + return DDSpanContext.SPAN_KIND_SERVER; + case "DDSpanContext.SPAN_KIND_CLIENT": + return DDSpanContext.SPAN_KIND_CLIENT; + case "DDSpanContext.SPAN_KIND_PRODUCER": + return DDSpanContext.SPAN_KIND_PRODUCER; + case "DDSpanContext.SPAN_KIND_CONSUMER": + return DDSpanContext.SPAN_KIND_CONSUMER; + case "DDSpanContext.SPAN_KIND_BROKER": + return DDSpanContext.SPAN_KIND_BROKER; + case "DDSpanContext.SPAN_KIND_INTERNAL": + return DDSpanContext.SPAN_KIND_INTERNAL; + default: + return TableTestTypeConverters.toInt(value); + } + } + + @ParameterizedTest + @ValueSource( + strings = { + Tags.SPAN_KIND_SERVER, + Tags.SPAN_KIND_CLIENT, + Tags.SPAN_KIND_PRODUCER, + Tags.SPAN_KIND_CONSUMER, + Tags.SPAN_KIND_INTERNAL, + Tags.SPAN_KIND_BROKER + }) + void setTagAndGetTagRoundTripForSpanKind(String kindString) { + AgentSpan span = tracer.buildSpan("test", "test").start(); + span.setTag(SPAN_KIND, kindString); + + assertEquals(kindString, span.getTag(SPAN_KIND)); + + span.finish(); + } + + @Test + void getTagReturnsNullWhenSpanKindNotSet() { + AgentSpan span = tracer.buildSpan("test", "test").start(); + + assertNull(span.getTag(SPAN_KIND)); + + span.finish(); + } + + @ParameterizedTest + @ValueSource( + strings = { + Tags.SPAN_KIND_SERVER, + Tags.SPAN_KIND_CLIENT, + Tags.SPAN_KIND_PRODUCER, + Tags.SPAN_KIND_CONSUMER, + Tags.SPAN_KIND_INTERNAL, + Tags.SPAN_KIND_BROKER + }) + void setTagThenRemoveTagClearsSpanKind(String kindString) { + AgentSpan span = tracer.buildSpan("test", "test").start(); + span.setTag(SPAN_KIND, kindString); + + assertEquals(kindString, span.getTag(SPAN_KIND)); + + ((DDSpan) span).spanContext().removeTag(SPAN_KIND); + + assertNull(span.getTag(SPAN_KIND)); + + span.finish(); + } + + @Test + void setTagWithCustomSpanKindFallsBackToTagMap() { + AgentSpan span = tracer.buildSpan("test", "test").start(); + span.setTag(SPAN_KIND, "custom-kind"); + + assertEquals("custom-kind", span.getTag(SPAN_KIND)); + + span.finish(); + } + + static void assertTagmap(Map source, Map comparison) { + assertTagmap(source, comparison, false); + } + + static void assertTagmap(Map source, Map comparison, boolean removeThread) { + Map sourceWithoutCommonTags = new HashMap<>(source); + sourceWithoutCommonTags.remove("runtime-id"); + sourceWithoutCommonTags.remove("language"); + sourceWithoutCommonTags.remove("_dd.agent_psr"); + sourceWithoutCommonTags.remove("_sample_rate"); + sourceWithoutCommonTags.remove("process_id"); + sourceWithoutCommonTags.remove("_dd.trace_span_attribute_schema"); + sourceWithoutCommonTags.remove(PROFILING_ENABLED); + sourceWithoutCommonTags.remove(PROFILING_CONTEXT_ENGINE); + sourceWithoutCommonTags.remove(DSM_ENABLED); + sourceWithoutCommonTags.remove(DJM_ENABLED); + if (removeThread) { + sourceWithoutCommonTags.remove(THREAD_ID); + sourceWithoutCommonTags.remove(THREAD_NAME); + } + assertEquals(comparison, sourceWithoutCommonTags); + } + + private static String dataTag(String tag) { + return "_dd." + tag + ".json"; + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/DDSpanSerializationTest.java b/dd-trace-core/src/test/java/datadog/trace/core/DDSpanSerializationTest.java new file mode 100644 index 00000000000..aecf3517072 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/DDSpanSerializationTest.java @@ -0,0 +1,651 @@ +package datadog.trace.core; + +import static datadog.trace.api.DDTags.SPAN_LINKS; +import static datadog.trace.api.config.GeneralConfig.EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED; +import static datadog.trace.api.config.TracerConfig.TRACE_BAGGAGE_TAG_KEYS; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; + +import datadog.communication.serialization.ByteBufferConsumer; +import datadog.communication.serialization.FlushingBuffer; +import datadog.communication.serialization.GrowableBuffer; +import datadog.communication.serialization.msgpack.MsgPackWriter; +import datadog.trace.api.Config; +import datadog.trace.api.DDSpanId; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.ProcessTags; +import datadog.trace.api.datastreams.NoopPathwayContext; +import datadog.trace.api.sampling.PrioritySampling; +import datadog.trace.bootstrap.instrumentation.api.Baggage; +import datadog.trace.bootstrap.instrumentation.api.ProfilingContextIntegration; +import datadog.trace.bootstrap.instrumentation.api.SpanAttributes; +import datadog.trace.common.writer.ListWriter; +import datadog.trace.common.writer.Payload; +import datadog.trace.common.writer.ddagent.TraceMapperTestBridge; +import datadog.trace.common.writer.ddagent.TraceMapperV0_4; +import datadog.trace.common.writer.ddagent.TraceMapperV0_5; +import datadog.trace.common.writer.ddagent.TraceMapperV1; +import datadog.trace.common.writer.ddagent.V1PayloadReader; +import datadog.trace.test.junit.utils.config.WithConfig; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.channels.Channels; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.msgpack.core.MessageFormat; +import org.msgpack.core.MessagePack; +import org.msgpack.core.MessageUnpacker; +import org.msgpack.core.buffer.ArrayBufferInput; +import org.msgpack.value.ValueType; +import org.tabletest.junit.TableTest; + +@WithConfig(key = EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED, value = "false") +public class DDSpanSerializationTest extends DDCoreJavaSpecification { + + @BeforeAll + static void beforeAll() { + ProcessTags.reset(Config.get()); + } + + @AfterAll + static void afterAll() { + ProcessTags.reset(Config.get()); + } + + @TableTest({ + "scenario | value | spanType ", + "zero | 0 | ", + "one with type | 1 | some-type", + "max long minus one billion | 8223372036854775807 | ", + "Long.MAX_VALUE minus one | 9223372036854775806 | some-type", + "Long.MAX_VALUE plus one | 9223372036854775808 | ", + "2^64 minus one | 18446744073709551615 | some-type" + }) + void serializeTraceWithIdAsInt(String scenario, String value, String spanType) throws Exception { + ListWriter writer = new ListWriter(); + CoreTracer tracer = tracerBuilder().writer(writer).build(); + DDTraceId traceId = DDTraceId.from(value); + long spanId = DDSpanId.from(value); + DDSpanContext context = createSpanContext(spanType, tracer, traceId, spanId); + DDSpan span = DDSpan.create("test", 0, context, null); + CaptureBuffer capture = new CaptureBuffer(); + MsgPackWriter packer = new MsgPackWriter(new FlushingBuffer(1024, capture)); + packer.format(Collections.singletonList(span), new TraceMapperV0_4()); + packer.flush(); + MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(new ArrayBufferInput(capture.bytes)); + int traceCount = capture.messageCount; + int spanCount = unpacker.unpackArrayHeader(); + int size = unpacker.unpackMapHeader(); + + assertEquals(1, traceCount); + assertEquals(1, spanCount); + assertEquals(12, size); + for (int i = 0; i < size; i++) { + String key = unpacker.unpackString(); + switch (key) { + case "trace_id": + MessageFormat traceIdFormat = unpacker.getNextFormat(); + assertEquals(ValueType.INTEGER, traceIdFormat.getValueType()); + if (traceIdFormat == MessageFormat.UINT64) { + assertEquals(traceId, DDTraceId.from(unpacker.unpackBigInteger().toString())); + } else { + assertEquals(traceId, DDTraceId.from(unpacker.unpackLong())); + } + break; + case "span_id": + MessageFormat spanIdFormat = unpacker.getNextFormat(); + assertEquals(ValueType.INTEGER, spanIdFormat.getValueType()); + if (spanIdFormat == MessageFormat.UINT64) { + assertEquals(spanId, DDSpanId.from(unpacker.unpackBigInteger().toString())); + } else { + assertEquals(spanId, unpacker.unpackLong()); + } + break; + default: + unpacker.unpackValue(); + } + } + tracer.close(); + } + + @TableTest({ + "scenario | value | spanType ", + "zero | 0 | ", + "one with type | 1 | some-type", + "max long minus one billion | 8223372036854775807 | ", + "Long.MAX_VALUE minus one | 9223372036854775806 | some-type", + "Long.MAX_VALUE plus one | 9223372036854775808 | ", + "2^64 minus one | 18446744073709551615 | some-type" + }) + void serializeTraceWithIdAsIntV05(String scenario, String value, String spanType) + throws Exception { + ListWriter writer = new ListWriter(); + CoreTracer tracer = tracerBuilder().writer(writer).build(); + DDTraceId traceId = DDTraceId.from(value); + long spanId = DDSpanId.from(value); + DDSpanContext context = createSpanContext(spanType, tracer, traceId, spanId); + DDSpan span = DDSpan.create("test", 0, context, null); + CaptureBuffer capture = new CaptureBuffer(); + MsgPackWriter packer = new MsgPackWriter(new FlushingBuffer(1024, capture)); + TraceMapperV0_5 traceMapper = new TraceMapperV0_5(); + packer.format(Collections.singletonList(span), traceMapper); + packer.flush(); + MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(new ArrayBufferInput(capture.bytes)); + int traceCount = capture.messageCount; + int spanCount = unpacker.unpackArrayHeader(); + int size = unpacker.unpackArrayHeader(); + + assertEquals(1, traceCount); + assertEquals(1, spanCount); + assertEquals(12, size); + for (int i = 0; i < size; i++) { + switch (i) { + case 3: + MessageFormat traceIdFormat = unpacker.getNextFormat(); + assertEquals(ValueType.INTEGER, traceIdFormat.getValueType()); + if (traceIdFormat == MessageFormat.UINT64) { + assertEquals(traceId, DDTraceId.from(unpacker.unpackBigInteger().toString())); + } else { + assertEquals(traceId, DDTraceId.from(unpacker.unpackLong())); + } + break; + case 4: + MessageFormat spanIdFormat = unpacker.getNextFormat(); + assertEquals(ValueType.INTEGER, spanIdFormat.getValueType()); + if (spanIdFormat == MessageFormat.UINT64) { + assertEquals(spanId, DDSpanId.from(unpacker.unpackBigInteger().toString())); + } else { + assertEquals(spanId, unpacker.unpackLong()); + } + break; + default: + unpacker.unpackValue(); + } + } + tracer.close(); + } + + @TableTest({ + "scenario | baggage | tags | expected | injectBaggage", + "empty baggage and tags inject | [:] | [:] | [:] | true ", + "baggage only inject | [foo: bbar] | [:] | [foo: bbar] | true ", + "baggage and tags inject no overlap | [foo: bbar] | [bar: tfoo] | [foo: bbar, bar: tfoo] | true ", + "baggage and tags inject tag wins | [foo: bbar] | [foo: tbar] | [foo: tbar] | true ", + "empty baggage and tags no inject | [:] | [:] | [:] | false ", + "baggage only no inject | [foo: bbar] | [:] | [:] | false ", + "baggage and tags no inject no overlap | [foo: bbar] | [bar: tfoo] | [bar: tfoo] | false ", + "baggage and tags no inject tag wins | [foo: bbar] | [foo: tbar] | [foo: tbar] | false " + }) + void serializeTraceWithBaggageAndTagsCorrectlyV04( + String scenario, + Map baggage, + Map tags, + Map expected, + boolean injectBaggage) + throws Exception { + ListWriter writer = new ListWriter(); + CoreTracer tracer = tracerBuilder().writer(writer).build(); + DDSpanContext context = + new DDSpanContext( + DDTraceId.ONE, + 1, + DDSpanId.ZERO, + null, + "fakeService", + "fakeOperation", + "fakeResource", + PrioritySampling.UNSET, + null, + baggage, + false, + null, + tags.size(), + tracer.createTraceCollector(DDTraceId.ONE), + null, + null, + NoopPathwayContext.INSTANCE, + false, + null, + injectBaggage, + true); + context.setAllTags(tags); + DDSpan span = DDSpan.create("test", 0, context, null); + CaptureBuffer capture = new CaptureBuffer(); + MsgPackWriter packer = new MsgPackWriter(new FlushingBuffer(1024, capture)); + packer.format(Collections.singletonList(span), new TraceMapperV0_4()); + packer.flush(); + MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(new ArrayBufferInput(capture.bytes)); + int traceCount = capture.messageCount; + int spanCount = unpacker.unpackArrayHeader(); + int size = unpacker.unpackMapHeader(); + + assertEquals(1, traceCount); + assertEquals(1, spanCount); + assertEquals(12, size); + for (int i = 0; i < size; i++) { + String key = unpacker.unpackString(); + if ("meta".equals(key)) { + int packedSize = unpacker.unpackMapHeader(); + Map unpackedMeta = new HashMap<>(); + for (int j = 0; j < packedSize; j++) { + String k = unpacker.unpackString(); + String v = unpacker.unpackString(); + if (!"thread.name".equals(k) && !"thread.id".equals(k)) { + unpackedMeta.put(k, v); + } + } + assertEquals(expected, unpackedMeta); + } else { + unpacker.unpackValue(); + } + } + tracer.close(); + } + + @TableTest({ + "scenario | baggage | tags | expected | injectBaggage", + "empty baggage and tags inject | [:] | [:] | [:] | true ", + "baggage only inject | [foo: bbar] | [:] | [foo: bbar] | true ", + "baggage and tags inject no overlap | [foo: bbar] | [bar: tfoo] | [foo: bbar, bar: tfoo] | true ", + "baggage and tags inject tag wins | [foo: bbar] | [foo: tbar] | [foo: tbar] | true ", + "empty baggage and tags no inject | [:] | [:] | [:] | false ", + "baggage only no inject | [foo: bbar] | [:] | [:] | false ", + "baggage and tags no inject no overlap | [foo: bbar] | [bar: tfoo] | [bar: tfoo] | false ", + "baggage and tags no inject tag wins | [foo: bbar] | [foo: tbar] | [foo: tbar] | false " + }) + void serializeTraceWithBaggageAndTagsCorrectlyV05( + String scenario, + Map baggage, + Map tags, + Map expected, + boolean injectBaggage) + throws Exception { + ListWriter writer = new ListWriter(); + CoreTracer tracer = tracerBuilder().writer(writer).build(); + DDSpanContext context = + new DDSpanContext( + DDTraceId.ONE, + 1, + DDSpanId.ZERO, + null, + "fakeService", + "fakeOperation", + "fakeResource", + PrioritySampling.UNSET, + null, + baggage, + false, + null, + tags.size(), + tracer.createTraceCollector(DDTraceId.ONE), + null, + null, + NoopPathwayContext.INSTANCE, + false, + null, + injectBaggage, + true); + context.setAllTags(tags); + DDSpan span = DDSpan.create("test", 0, context, null); + CaptureBuffer capture = new CaptureBuffer(); + MsgPackWriter packer = new MsgPackWriter(new FlushingBuffer(1024, capture)); + TraceMapperV0_5 mapper = new TraceMapperV0_5(); + packer.format(Collections.singletonList(span), mapper); + packer.flush(); + MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(new ArrayBufferInput(capture.bytes)); + int traceCount = capture.messageCount; + int spanCount = unpacker.unpackArrayHeader(); + int size = unpacker.unpackArrayHeader(); + String[] dictionary = buildDictionary(mapper); + + assertEquals(1, traceCount); + assertEquals(1, spanCount); + assertEquals(12, size); + for (int i = 0; i < 9; ++i) { + unpacker.skipValue(); + } + int packedSize = unpacker.unpackMapHeader(); + Map unpackedMeta = new HashMap<>(); + for (int j = 0; j < packedSize; j++) { + String k = dictionary[unpacker.unpackInt()]; + String v = dictionary[unpacker.unpackInt()]; + if (!"thread.name".equals(k) && !"thread.id".equals(k)) { + unpackedMeta.put(k, v); + } + } + assertEquals(expected, unpackedMeta); + tracer.close(); + } + + @TableTest({ + "scenario | injectBaggage", + "baggage enabled | true ", + "baggage disabled | false " + }) + @WithConfig(key = TRACE_BAGGAGE_TAG_KEYS, value = "user.id,custom") + void serializeTraceWithConfiguredBaggageAndTagsCorrectlyV1(String scenario, boolean injectBaggage) + throws Exception { + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + Map baggage = new HashMap<>(); + baggage.put("legacy-baggage", "legacy-value"); + + Map w3cBaggageItems = new HashMap<>(); + w3cBaggageItems.put("user.id", "user-1"); + w3cBaggageItems.put("custom", "custom-value"); + w3cBaggageItems.put("ignored", "ignored-value"); + + DDSpanContext context = + createSpanContext(tracer, baggage, Baggage.create(w3cBaggageItems), injectBaggage, true, 1); + context.setTag("span-tag", "span-value"); + DDSpan span = DDSpan.create("test", 0, context, null); + + V1PayloadReader.V1Span payload = V1PayloadReader.readFirstSpan(serializeV1Payload(span)); + Map attributes = payload.getAttributes(); + + assertEquals("span-value", attributes.get("span-tag")); + if (injectBaggage) { + assertEquals("legacy-value", attributes.get("legacy-baggage")); + assertEquals("user-1", attributes.get("baggage.user.id")); + assertEquals("custom-value", attributes.get("baggage.custom")); + } else { + assertFalse(attributes.containsKey("legacy-baggage")); + assertFalse(attributes.containsKey("baggage.user.id")); + assertFalse(attributes.containsKey("baggage.custom")); + } + assertFalse(attributes.containsKey("baggage.ignored")); + tracer.close(); + } + + @Test + void serializeTraceWithSpanLinksAsStructuredLinksOnlyV1() throws Exception { + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + DDSpanContext context = createSpanContext(tracer, Collections.emptyMap(), null, true, true, 0); + DDSpan span = DDSpan.create("test", 0, context, null); + + Map linkAttributes = new HashMap<>(); + linkAttributes.put("link.source", "unit-test"); + DDSpanLink link = + new DDSpanLink( + DDTraceId.fromHex("11223344556677889900aabbccddeeff"), + DDSpanId.fromHex("123456789abcdef0"), + (byte) 1, + "dd=s:1", + SpanAttributes.fromMap(linkAttributes)); + span.addLink(link); + + V1PayloadReader.V1Span payload = V1PayloadReader.readFirstSpan(serializeV1Payload(span)); + + assertFalse(payload.getAttributes().containsKey(SPAN_LINKS)); + assertEquals(1, payload.getLinks().size()); + V1PayloadReader.V1SpanLink actualLink = payload.getLinks().get(0); + assertArrayEquals(V1PayloadReader.traceIdBytes(link.traceId()), actualLink.getTraceId()); + assertEquals(link.spanId(), actualLink.getSpanId()); + assertEquals(link.traceState(), actualLink.getTraceState()); + assertEquals((long) (link.traceFlags() & 0xFF), actualLink.getTraceFlags()); + assertEquals("unit-test", actualLink.getAttributes().get("link.source")); + tracer.close(); + } + + @Test + void serializeTraceWithFlatMapTagV04() throws Exception { + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + DDSpanContext context = + new DDSpanContext( + DDTraceId.ONE, + 1, + DDSpanId.ZERO, + null, + "fakeService", + "fakeOperation", + "fakeResource", + PrioritySampling.UNSET, + null, + null, + false, + null, + 0, + tracer.createTraceCollector(DDTraceId.ONE), + null, + null, + NoopPathwayContext.INSTANCE, + false, + null); + context.setTag("key1", "value1"); + Map nested = new HashMap<>(); + nested.put("sub1", "v1"); + nested.put("sub2", "v2"); + context.setTag("key2", nested); + DDSpan span = DDSpan.create("test", 0, context, null); + + CaptureBuffer capture = new CaptureBuffer(); + MsgPackWriter packer = new MsgPackWriter(new FlushingBuffer(1024, capture)); + packer.format(Collections.singletonList(span), new TraceMapperV0_4()); + packer.flush(); + MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(new ArrayBufferInput(capture.bytes)); + int traceCount = capture.messageCount; + int spanCount = unpacker.unpackArrayHeader(); + int size = unpacker.unpackMapHeader(); + + Map expectedMeta = new HashMap<>(); + expectedMeta.put("key1", "value1"); + expectedMeta.put("key2.sub1", "v1"); + expectedMeta.put("key2.sub2", "v2"); + + assertEquals(1, traceCount); + assertEquals(1, spanCount); + for (int i = 0; i < size; i++) { + String key = unpacker.unpackString(); + if ("meta".equals(key)) { + int packedSize = unpacker.unpackMapHeader(); + Map unpackedMeta = new HashMap<>(); + for (int j = 0; j < packedSize; j++) { + String k = unpacker.unpackString(); + String v = unpacker.unpackString(); + if (!"thread.name".equals(k) && !"thread.id".equals(k)) { + unpackedMeta.put(k, v); + } + } + assertEquals(expectedMeta, unpackedMeta); + } else { + unpacker.unpackValue(); + } + } + tracer.close(); + } + + @Test + void serializeTraceWithFlatMapTagV05() throws Exception { + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + DDSpanContext context = + new DDSpanContext( + DDTraceId.ONE, + 1, + DDSpanId.ZERO, + null, + "fakeService", + "fakeOperation", + "fakeResource", + PrioritySampling.UNSET, + null, + null, + false, + null, + 0, + tracer.createTraceCollector(DDTraceId.ONE), + null, + null, + NoopPathwayContext.INSTANCE, + false, + null); + context.setTag("key1", "value1"); + Map nested = new HashMap<>(); + nested.put("sub1", "v1"); + nested.put("sub2", "v2"); + context.setTag("key2", nested); + DDSpan span = DDSpan.create("test", 0, context, null); + + CaptureBuffer capture = new CaptureBuffer(); + MsgPackWriter packer = new MsgPackWriter(new FlushingBuffer(1024, capture)); + TraceMapperV0_5 mapper = new TraceMapperV0_5(); + packer.format(Collections.singletonList(span), mapper); + packer.flush(); + MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(new ArrayBufferInput(capture.bytes)); + int traceCount = capture.messageCount; + int spanCount = unpacker.unpackArrayHeader(); + int size = unpacker.unpackArrayHeader(); + String[] dictionary = buildDictionary(mapper); + + Map expectedMeta = new HashMap<>(); + expectedMeta.put("key1", "value1"); + expectedMeta.put("key2.sub1", "v1"); + expectedMeta.put("key2.sub2", "v2"); + + assertEquals(1, traceCount); + assertEquals(1, spanCount); + assertEquals(12, size); + for (int i = 0; i < 9; ++i) { + unpacker.skipValue(); + } + int packedSize = unpacker.unpackMapHeader(); + Map unpackedMeta = new HashMap<>(); + for (int j = 0; j < packedSize; j++) { + String k = dictionary[unpacker.unpackInt()]; + String v = dictionary[unpacker.unpackInt()]; + if (!"thread.name".equals(k) && !"thread.id".equals(k)) { + unpackedMeta.put(k, v); + } + } + assertEquals(expectedMeta, unpackedMeta); + tracer.close(); + } + + private static class CaptureBuffer implements ByteBufferConsumer { + private byte[] bytes; + int messageCount; + + @Override + public void accept(int messageCount, ByteBuffer buffer) { + this.messageCount = messageCount; + this.bytes = new byte[buffer.limit() - buffer.position()]; + buffer.get(bytes); + } + } + + private DDSpanContext createSpanContext( + String spanType, CoreTracer tracer, DDTraceId traceId, long spanId) { + Map baggage = new HashMap<>(); + baggage.put("a-baggage", "value"); + DDSpanContext ctx = + new DDSpanContext( + traceId, + spanId, + DDSpanId.ZERO, + null, + "fakeService", + "fakeOperation", + "fakeResource", + PrioritySampling.UNSET, + null, + baggage, + false, + spanType, + 1, + tracer.createTraceCollector(DDTraceId.ONE), + null, + null, + NoopPathwayContext.INSTANCE, + false, + null); + Map tags = new HashMap<>(); + tags.put("k1", "v1"); + ctx.setAllTags(tags); + return ctx; + } + + private DDSpanContext createSpanContext( + CoreTracer tracer, + Map baggage, + Baggage w3cBaggage, + boolean injectBaggage, + boolean injectLinks, + int tagsSize) { + return new DDSpanContext( + DDTraceId.ONE, + 1, + DDSpanId.ZERO, + null, + null, + "fakeService", + "fakeOperation", + "fakeResource", + PrioritySampling.UNSET, + null, + baggage, + w3cBaggage, + false, + "fakeType", + tagsSize, + tracer.createTraceCollector(DDTraceId.ONE), + null, + null, + null, + NoopPathwayContext.INSTANCE, + false, + null, + ProfilingContextIntegration.NoOp.INSTANCE, + injectBaggage, + injectLinks); + } + + private static byte[] serializeV1Payload(DDSpan span) throws Exception { + TraceMapperV1 mapper = new TraceMapperV1(); + CapturePayloadBuffer capture = new CapturePayloadBuffer(mapper); + MsgPackWriter packer = new MsgPackWriter(new FlushingBuffer(1024, capture)); + packer.format(Collections.singletonList(span), mapper); + packer.flush(); + assertNotNull(capture.bytes); + return capture.bytes; + } + + private static String[] buildDictionary(TraceMapperV0_5 mapper) throws Exception { + GrowableBuffer dictionaryBuffer = TraceMapperTestBridge.getDictionary(mapper); + Map encoding = TraceMapperTestBridge.getEncoding(mapper); + + String[] dictionary = new String[encoding.size()]; + MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(dictionaryBuffer.slice()); + for (int i = 0; i < dictionary.length; ++i) { + dictionary[i] = unpacker.unpackString(); + } + return dictionary; + } + + private static final class CapturePayloadBuffer implements ByteBufferConsumer { + private final TraceMapperV1 mapper; + private byte[] bytes; + + private CapturePayloadBuffer(TraceMapperV1 mapper) { + this.mapper = mapper; + } + + @Override + public void accept(int messageCount, ByteBuffer buffer) { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + try { + Payload payload = mapper.newPayload().withBody(messageCount, buffer); + payload.writeTo(Channels.newChannel(out)); + bytes = out.toByteArray(); + } catch (IOException e) { + throw new IllegalStateException(e); + } finally { + mapper.reset(); + } + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/DDSpanTest.java b/dd-trace-core/src/test/java/datadog/trace/core/DDSpanTest.java new file mode 100644 index 00000000000..a05e9d982c4 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/DDSpanTest.java @@ -0,0 +1,543 @@ +package datadog.trace.core; + +import static datadog.trace.api.TracePropagationStyle.DATADOG; +import static datadog.trace.api.sampling.PrioritySampling.SAMPLER_DROP; +import static datadog.trace.api.sampling.PrioritySampling.SAMPLER_KEEP; +import static datadog.trace.api.sampling.PrioritySampling.UNSET; +import static datadog.trace.api.sampling.SamplingMechanism.SPAN_SAMPLING_RATE; +import static datadog.trace.core.DDSpanContext.SPAN_SAMPLING_MAX_PER_SECOND_TAG; +import static datadog.trace.core.DDSpanContext.SPAN_SAMPLING_MECHANISM_TAG; +import static datadog.trace.core.DDSpanContext.SPAN_SAMPLING_RULE_RATE_TAG; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.params.provider.Arguments.arguments; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +import datadog.trace.api.DDSpanId; +import datadog.trace.api.DDTags; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.TagMap; +import datadog.trace.api.datastreams.NoopPathwayContext; +import datadog.trace.api.gateway.RequestContextSlot; +import datadog.trace.api.sampling.PrioritySampling; +import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext; +import datadog.trace.bootstrap.instrumentation.api.ErrorPriorities; +import datadog.trace.bootstrap.instrumentation.api.TagContext; +import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; +import datadog.trace.common.sampling.RateByServiceTraceSampler; +import datadog.trace.common.writer.ListWriter; +import datadog.trace.core.propagation.ExtractedContext; +import datadog.trace.core.propagation.PropagationTags; +import datadog.trace.core.util.TestThrowables; +import java.io.Closeable; +import java.io.IOException; +import java.lang.reflect.Field; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.concurrent.TimeUnit; +import java.util.stream.Stream; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import org.tabletest.junit.TableTest; + +public class DDSpanTest extends DDCoreJavaSpecification { + + private ListWriter writer; + private CoreTracer tracer; + + @BeforeEach + void setup() { + writer = new ListWriter(); + tracer = tracerBuilder().writer(writer).sampler(new RateByServiceTraceSampler()).build(); + } + + @Test + void gettersAndSetters() { + DDSpan span = + (DDSpan) + tracer + .buildSpan("datadog", "fakeOperation") + .withServiceName("fakeService") + .withResourceName("fakeResource") + .withSpanType("fakeType") + .start(); + + span.setServiceName("service"); + assertEquals("service", span.getServiceName()); + + span.setOperationName("operation"); + assertEquals("operation", span.getOperationName().toString()); + + span.setResourceName("resource"); + assertEquals("resource", span.getResourceName().toString()); + + span.setSpanType("type"); + assertEquals("type", span.getType()); + + span.setSamplingPriority(PrioritySampling.UNSET); + assertNull(span.getSamplingPriority()); + + span.setSamplingPriority(PrioritySampling.SAMPLER_KEEP); + assertEquals(PrioritySampling.SAMPLER_KEEP, (int) span.getSamplingPriority()); + + span.spanContext().lockSamplingPriority(); + span.setSamplingPriority(PrioritySampling.USER_KEEP); + assertEquals(PrioritySampling.SAMPLER_KEEP, (int) span.getSamplingPriority()); + } + + @Test + void resourceNameEqualsOperationNameIfNull() { + String opName = "operationName"; + DDSpan span = (DDSpan) tracer.buildSpan("datadog", opName).start(); + assertEquals(opName, span.getResourceName().toString()); + assertFalse(span.getServiceName().isEmpty()); + + String resourceName = "fake"; + String serviceName = "myService"; + span = + (DDSpan) + tracer + .buildSpan("datadog", opName) + .withResourceName(resourceName) + .withServiceName(serviceName) + .start(); + assertEquals(resourceName, span.getResourceName().toString()); + assertEquals(serviceName, span.getServiceName()); + } + + @Test + void durationMeasuredInNanoseconds() { + long mod = TimeUnit.MILLISECONDS.toNanos(1); + long start = System.nanoTime(); + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "test").start(); + long between = System.nanoTime(); + long betweenDur = System.nanoTime() - between; + span.finish(); + long total = System.nanoTime() - start; + + // Generous 5 seconds to execute this test + assertTrue( + Math.abs( + TimeUnit.NANOSECONDS.toSeconds(span.getStartTime()) + - TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())) + < 5); + assertTrue(span.getDurationNano() > betweenDur); + assertTrue(span.getDurationNano() < total); + assertTrue(span.getDurationNano() % mod > 0); + } + + @Test + void phasedFinishCapturesDurationButDoesNotPublishImmediately() throws Exception { + long mod = TimeUnit.MILLISECONDS.toNanos(1); + long start = System.nanoTime(); + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "test").start(); + long between = System.nanoTime(); + long betweenDur = System.nanoTime() - between; + // calling publish before phasedFinish + span.publish(); + // has no effect + assertEquals(0, span.getDurationNano()); + assertEquals(1, pendingReferenceCount(span)); + assertEquals(0, writer.size()); + + boolean finish = span.phasedFinish(); + long total = System.nanoTime() - start; + + assertTrue(finish); + assertEquals(1, pendingReferenceCount(span)); + assertTrue(spans(span).isEmpty()); + assertTrue(writer.isEmpty()); + // duration is recorded as negative to allow publishing + assertTrue(span.getDurationNano() < 0); + long actualDurationNano = span.getDurationNano() & Long.MAX_VALUE; + // Generous 5 seconds to execute this test + assertTrue( + Math.abs( + TimeUnit.NANOSECONDS.toSeconds(span.getStartTime()) + - TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())) + < 5); + assertTrue(actualDurationNano > betweenDur); + assertTrue(actualDurationNano < total); + assertTrue(actualDurationNano % mod > 0); // Very slim chance of a false negative. + // extra finishes + finish = span.phasedFinish(); + // have no effect + span.finish(); // verify conflicting finishes are ignored + assertFalse(finish); + assertEquals(1, pendingReferenceCount(span)); + assertTrue(spans(span).isEmpty()); + assertTrue(writer.isEmpty()); + + span.publish(); + // duration is flipped to positive + assertTrue(span.getDurationNano() > 0); + assertEquals(actualDurationNano, span.getDurationNano()); + assertEquals(0, pendingReferenceCount(span)); + assertEquals(1, writer.size()); + // duplicate call to publish" + span.publish(); + // has no effect + assertEquals(0, pendingReferenceCount(span)); + assertEquals(1, writer.size()); + } + + @Test + void startingWithTimestampDisablesNanotime() { + long mod = TimeUnit.MILLISECONDS.toNanos(1); + long start = System.currentTimeMillis(); + DDSpan span = + (DDSpan) + tracer + .buildSpan("datadog", "test") + .withStartTimestamp(TimeUnit.MILLISECONDS.toMicros(System.currentTimeMillis())) + .start(); + long between = System.currentTimeMillis(); + long betweenDur = System.currentTimeMillis() - between; + span.finish(); + long total = Math.max(1, System.currentTimeMillis() - start); + + // Generous 5 seconds to execute this test + assertTrue( + Math.abs( + TimeUnit.NANOSECONDS.toSeconds(span.getStartTime()) + - TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())) + < 5); + assertTrue(span.getDurationNano() >= TimeUnit.MILLISECONDS.toNanos(betweenDur)); + assertTrue(span.getDurationNano() <= TimeUnit.MILLISECONDS.toNanos(total)); + assertTrue(span.getDurationNano() % mod == 0 || span.getDurationNano() == 1); + } + + @Test + void stoppingWithTimestampDisablesNanotime() { + long mod = TimeUnit.MILLISECONDS.toNanos(1); + long start = System.currentTimeMillis(); + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "test").start(); + long between = System.currentTimeMillis(); + long betweenDur = System.currentTimeMillis() - between; + span.finish(TimeUnit.MILLISECONDS.toMicros(System.currentTimeMillis() + 1)); + long total = System.currentTimeMillis() - start + 1; + + // Generous 5 seconds to execute this test + assertTrue( + Math.abs( + TimeUnit.NANOSECONDS.toSeconds(span.getStartTime()) + - TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())) + < 5); + assertTrue(span.getDurationNano() >= TimeUnit.MILLISECONDS.toNanos(betweenDur)); + assertTrue(span.getDurationNano() <= TimeUnit.MILLISECONDS.toNanos(total)); + // true span duration can be <1ms if clock was about to tick over, so allow for that + assertTrue(span.getDurationNano() % mod == 0 || span.getDurationNano() == 1); + } + + @Test + void stoppingWithTimestampBeforeStartTimeYieldsMinDurationOfOne() { + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "test").start(); + // remove tick precision part of our internal time to match previous test condition + span.finish( + TimeUnit.MILLISECONDS.toMicros(TimeUnit.NANOSECONDS.toMillis(span.getStartTimeNano())) + - 10); + assertEquals(1, span.getDurationNano()); + } + + @Test + void prioritySamplingMetricSetOnlyOnRootSpan() { + DDSpan parent = (DDSpan) tracer.buildSpan("datadog", "testParent").start(); + DDSpan child1 = + (DDSpan) tracer.buildSpan("datadog", "testChild1").asChildOf(parent.spanContext()).start(); + + child1.setSamplingPriority(PrioritySampling.SAMPLER_KEEP); + child1.spanContext().lockSamplingPriority(); + parent.setSamplingPriority(PrioritySampling.SAMPLER_DROP); + child1.finish(); + DDSpan child2 = + (DDSpan) tracer.buildSpan("datadog", "testChild2").asChildOf(parent.spanContext()).start(); + child2.finish(); + parent.finish(); + + assertEquals(PrioritySampling.SAMPLER_KEEP, parent.spanContext().getSamplingPriority()); + assertEquals(PrioritySampling.SAMPLER_KEEP, (int) parent.getSamplingPriority()); + assertTrue(parent.hasSamplingPriority()); + assertEquals(parent.getSamplingPriority(), child1.getSamplingPriority()); + assertEquals(parent.getSamplingPriority(), child2.getSamplingPriority()); + assertFalse(child1.hasSamplingPriority()); + assertFalse(child2.hasSamplingPriority()); + } + + static Stream originSetOnlyOnRootSpanArguments() { + return Stream.of( + arguments("TagContext", new TagContext("some-origin", TagMap.fromMap(new HashMap<>()))), + arguments( + "ExtractedContext", + new ExtractedContext( + DDTraceId.ONE, + 2, + SAMPLER_DROP, + "some-origin", + PropagationTags.factory().empty(), + DATADOG))); + } + + @ParameterizedTest + @MethodSource("originSetOnlyOnRootSpanArguments") + void originSetOnlyOnRootSpan(String scenario, AgentSpanContext extractedContext) + throws Exception { + DDSpanContext parent = + (DDSpanContext) + tracer + .buildSpan("datadog", "testParent") + .asChildOf(extractedContext) + .start() + .spanContext(); + DDSpanContext child = + (DDSpanContext) + tracer.buildSpan("datadog", "testChild1").asChildOf(parent).start().spanContext(); + + assertEquals("some-origin", parent.getOrigin().toString()); + // Access field directly instead of getter. + Field originField = DDSpanContext.class.getDeclaredField("origin"); + originField.setAccessible(true); + assertEquals("some-origin", originField.get(parent).toString()); + assertEquals("some-origin", child.getOrigin().toString()); + // Access field directly instead of getter. + assertNull(originField.get(child)); + } + + static Stream isRootSpanArguments() { + return Stream.of( + arguments("no parent", null, true), + arguments( + "distributed parent", + new ExtractedContext( + DDTraceId.from(123), + 456, + SAMPLER_KEEP, + "789", + PropagationTags.factory().empty(), + DATADOG), + false)); + } + + @ParameterizedTest + @MethodSource("isRootSpanArguments") + void isRootSpanInAndNotInContextOfDistributedTracing( + String scenario, AgentSpanContext extractedContext, boolean isTraceRootSpan) { + DDSpan root = (DDSpan) tracer.buildSpan("datadog", "root").asChildOf(extractedContext).start(); + DDSpan child = + (DDSpan) tracer.buildSpan("datadog", "child").asChildOf(root.spanContext()).start(); + + assertEquals(isTraceRootSpan, root.isRootSpan()); + assertFalse(child.isRootSpan()); + + child.finish(); + root.finish(); + } + + static Stream getApplicationRootSpanArguments() { + return Stream.of( + arguments("no parent", null), + arguments( + "distributed parent", + new ExtractedContext( + DDTraceId.from(123), + 456, + SAMPLER_KEEP, + "789", + PropagationTags.factory().empty(), + DATADOG))); + } + + @ParameterizedTest + @MethodSource("getApplicationRootSpanArguments") + void getApplicationRootSpanInAndNotInContextOfDistributedTracing( + String scenario, AgentSpanContext extractedContext) { + DDSpan root = (DDSpan) tracer.buildSpan("datadog", "root").asChildOf(extractedContext).start(); + DDSpan child = + (DDSpan) tracer.buildSpan("datadog", "child").asChildOf(root.spanContext()).start(); + + assertEquals(root, root.getLocalRootSpan()); + assertEquals(root, child.getLocalRootSpan()); + // Checking for backward compatibility method names + assertEquals(root, root.getRootSpan()); + assertEquals(root, child.getRootSpan()); + + child.finish(); + root.finish(); + } + + @Test + void publishingOfRootSpanClosesRequestContextData() throws Exception { + Closeable reqContextData = mock(Closeable.class); + TagContext context = new TagContext().withRequestContextDataAppSec(reqContextData); + DDSpan root = (DDSpan) tracer.buildSpan("datadog", "root").asChildOf(context).start(); + DDSpan child = + (DDSpan) tracer.buildSpan("datadog", "child").asChildOf(root.spanContext()).start(); + + assertEquals(reqContextData, root.getRequestContext().getData(RequestContextSlot.APPSEC)); + assertEquals(reqContextData, child.getRequestContext().getData(RequestContextSlot.APPSEC)); + + child.finish(); + verify(reqContextData, never()).close(); + + root.finish(); + verify(reqContextData, times(1)).close(); + } + + static Stream inferTopLevelFromParentServiceNameArguments() { + return Stream.of( + arguments("String foo", "foo", true), + arguments("UTF8BytesString foo", UTF8BytesString.create("foo"), true), + arguments("String fakeService", "fakeService", false), + arguments("UTF8BytesString fakeService", UTF8BytesString.create("fakeService"), false), + arguments("empty string", "", true), + arguments("null", null, true)); + } + + @ParameterizedTest + @MethodSource("inferTopLevelFromParentServiceNameArguments") + void inferTopLevelFromParentServiceName( + String scenario, CharSequence parentServiceName, boolean expectTopLevel) { + DDSpanContext context = + new DDSpanContext( + DDTraceId.ONE, + 1, + DDSpanId.ZERO, + parentServiceName, + "fakeService", + "fakeOperation", + "fakeResource", + PrioritySampling.UNSET, + null, + Collections.emptyMap(), + false, + "fakeType", + 0, + tracer.createTraceCollector(DDTraceId.ONE), + null, + null, + NoopPathwayContext.INSTANCE, + false, + PropagationTags.factory().empty()); + assertEquals(expectTopLevel, context.isTopLevel()); + } + + @Test + void brokenPipeExceptionDoesNotCreateErrorSpan() { + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "root").start(); + span.addThrowable(new IOException("Broken pipe")); + assertFalse(span.isError()); + assertNull(span.getTag(DDTags.ERROR_STACK)); + assertEquals("Broken pipe", span.getTag(DDTags.ERROR_MSG)); + } + + @Test + void wrappedBrokenPipeExceptionDoesNotCreateErrorSpan() { + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "root").start(); + span.addThrowable(new RuntimeException(new IOException("Broken pipe"))); + assertFalse(span.isError()); + assertNull(span.getTag(DDTags.ERROR_STACK)); + assertEquals("java.io.IOException: Broken pipe", span.getTag(DDTags.ERROR_MSG)); + } + + @Test + void nullExceptionSafeToAdd() { + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "root").start(); + span.addThrowable(null); + assertFalse(span.isError()); + assertNull(span.getTag(DDTags.ERROR_STACK)); + } + + @Test + void addThrowableDoesNotFailWhenGetMessageThrows() { + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "root").start(); + + span.addThrowable(TestThrowables.throwingGetMessage()); + + assertTrue(span.isError()); + assertNotNull(span.getTag(DDTags.ERROR_TYPE)); + assertNotNull( + span.getTag(DDTags.ERROR_STACK), + "stack trace must be captured even when getMessage() throws"); + assertTrue(((String) span.getTag(DDTags.ERROR_MSG)).contains("Exception message unavailable")); + } + + @Test + void addThrowableDoesNotFailWhenGetCauseMessageThrows() { + // Outer exception has a normal message, so the broken-pipe check reaches + // getCause().getMessage() + RuntimeException error = + new RuntimeException("outer message", TestThrowables.throwingGetMessage()); + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "root").start(); + + span.addThrowable(error); + + assertTrue(span.isError()); + assertNotNull(span.getTag(DDTags.ERROR_TYPE)); + assertNotNull( + span.getTag(DDTags.ERROR_STACK), + "stack trace must be captured even when cause's getMessage() throws"); + // Outer getMessage() works normally — message must be recorded + assertEquals("outer message", span.getTag(DDTags.ERROR_MSG)); + } + + @TableTest({ + "scenario | rate | limit ", + "rate=1.0 lim=10 | 1.0 | 10 ", + "rate=0.5 lim=100 | 0.5 | 100 ", + "rate=0.25 no lim | 0.25 | 2147483647" + }) + void setSingleSpanSamplingTags(String scenario, double rate, int limit) { + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "testSpan").start(); + assertEquals(UNSET, span.samplingPriority()); + + span.setSpanSamplingPriority(rate, limit); + + assertEquals((int) SPAN_SAMPLING_RATE, span.getTag(SPAN_SAMPLING_MECHANISM_TAG)); + assertEquals(rate, span.getTag(SPAN_SAMPLING_RULE_RATE_TAG)); + assertEquals( + limit == Integer.MAX_VALUE ? null : (double) limit, + span.getTag(SPAN_SAMPLING_MAX_PER_SECOND_TAG)); + // single span sampling should not change the trace sampling priority + assertEquals(UNSET, span.samplingPriority()); + } + + @Test + void errorPrioritiesShouldBeRespected() { + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "testSpan").start(); + assertFalse(span.isError()); + + span.setError(true); + assertTrue(span.isError()); + + span.setError(false); + assertFalse(span.isError()); + + span.setError(true, ErrorPriorities.HTTP_SERVER_DECORATOR); + assertFalse(span.isError()); + + span.setError(true, ErrorPriorities.MANUAL_INSTRUMENTATION); + assertTrue(span.isError()); + + span.setError(true, Byte.MAX_VALUE); + assertTrue(span.isError()); + } + + private static int pendingReferenceCount(DDSpan span) { + PendingTrace trace = (PendingTrace) span.spanContext().getTraceCollector(); + return PendingTraceTestBridge.getPendingReferenceCount(trace); + } + + private static Collection spans(DDSpan span) { + PendingTrace trace = (PendingTrace) span.spanContext().getTraceCollector(); + return trace.getSpans(); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/KnuthSamplingRateTest.java b/dd-trace-core/src/test/java/datadog/trace/core/KnuthSamplingRateTest.java new file mode 100644 index 00000000000..324b50ecfe2 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/KnuthSamplingRateTest.java @@ -0,0 +1,230 @@ +package datadog.trace.core; + +import static datadog.trace.api.config.TracerConfig.TRACE_RATE_LIMIT; +import static datadog.trace.api.config.TracerConfig.TRACE_SAMPLE_RATE; +import static datadog.trace.api.config.TracerConfig.TRACE_SAMPLING_RULES; +import static datadog.trace.api.config.TracerConfig.TRACE_SAMPLING_SERVICE_RULES; +import static datadog.trace.api.sampling.PrioritySampling.SAMPLER_KEEP; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.common.sampling.PrioritySampler; +import datadog.trace.common.sampling.RateByServiceTraceSampler; +import datadog.trace.common.sampling.Sampler; +import datadog.trace.common.writer.ListWriter; +import datadog.trace.core.propagation.PropagationTags; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; +import org.junit.jupiter.api.Test; +import org.tabletest.junit.TableTest; + +public class KnuthSamplingRateTest extends DDCoreJavaSpecification { + + @TableTest({ + "scenario | rate | expected", + "1.0 | 1.0 | 1 ", + "0.5 | 0.5 | 0.5 ", + "0.1 | 0.1 | 0.1 ", + "0.0 | 0.0 | 0 ", + "0.765432 | 0.765432 | 0.765432", + "0.7654321 rounds to 6 decimal | 0.7654321 | 0.765432", + "0.123456 | 0.123456 | 0.123456", + "0.100000 trailing zeros | 0.100000 | 0.1 ", + "0.250 trailing zero | 0.250 | 0.25 ", + "0.05 | 0.05 | 0.05 ", + "0.0123456789 rounds at 6 decimal places | 0.0123456789 | 0.012346", + "0.001 | 0.001 | 0.001 ", + "0.00500 trailing zeros | 0.00500 | 0.005 ", + "0.00123456789 rounds at 6 decimal places | 0.00123456789 | 0.001235", + "0.0001 | 0.0001 | 0.0001 ", + "0.000500 trailing zeros | 0.000500 | 0.0005 ", + "0.000123456789 rounds at 6 decimal places | 0.000123456789 | 0.000123", + "0.9999995 rounds up to 1 | 0.9999995 | 1 ", + "0.00001 | 0.00001 | 0.00001 ", + "0.000050 trailing zeros | 0.000050 | 0.00005 ", + "1.23456789e-5 rounds at 6dp | 0.0000123456789 | 0.000012", + "1e-7 below precision rounds to 0 | 0.0000001 | 0 ", + "5.5e-10 below precision | 0.00000000055 | 0 ", + "0.000001 six decimal boundary | 0.000001 | 0.000001", + "0.00000051 rounds up | 0.00000051 | 0.000001" + }) + void updateKnuthSamplingRateFormatsRateCorrectly(String scenario, double rate, String expected) { + PropagationTags pTags = PropagationTags.factory().empty(); + pTags.updateKnuthSamplingRate(rate); + Map tagMap = pTags.createTagMap(); + assertEquals(expected, tagMap.get("_dd.p.ksr")); + } + + @TableTest({ + "scenario | rate | expectedKsr", + "rate 1.0 | 1.0 | 1 ", + "rate 0.5 | 0.5 | 0.5 ", + "rate 0.0 | 0.0 | 0 " + }) + void agentRateSamplerSetsKsrPropagatedTag(String scenario, double rate, String expectedKsr) { + RateByServiceTraceSampler serviceSampler = new RateByServiceTraceSampler(); + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + + Map rates = new HashMap<>(); + rates.put("service:,env:", rate); + Map> response = new HashMap<>(); + response.put("rate_by_service", rates); + serviceSampler.onResponse("traces", response); + + DDSpan span = + (DDSpan) + tracer + .buildSpan("datadog", "fakeOperation") + .withServiceName("spock") + .withTag("env", "test") + .ignoreActiveSpan() + .start(); + serviceSampler.setSamplingPriority(span); + + Map propagationMap = span.spanContext().getPropagationTags().createTagMap(); + String ksr = propagationMap.get("_dd.p.ksr"); + + assertEquals(expectedKsr, ksr); + tracer.close(); + } + + @TableTest({ + "scenario | jsonRules | expectedKsr", + "Matching rule with rate 1 -> ksr is 1 | '[{\"service\": \"service\", \"sample_rate\": 1}]' | 1 ", + "Matching rule with rate 0.5 -> ksr is 0.5 | '[{\"service\": \"service\", \"sample_rate\": 0.5}]' | 0.5 ", + "Matching rule with rate 0 -> ksr is 0 (drop, but ksr still set) | '[{\"service\": \"service\", \"sample_rate\": 0}]' | 0 " + }) + void ruleBasedSamplerSetsKsrPropagatedTagWhenRuleMatches( + String scenario, String jsonRules, String expectedKsr) { + Properties properties = new Properties(); + properties.setProperty(TRACE_SAMPLING_RULES, jsonRules); + properties.setProperty(TRACE_RATE_LIMIT, "50"); + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + + Sampler sampler = Sampler.Builder.forConfig(properties); + DDSpan span = + (DDSpan) + tracer + .buildSpan("datadog", "operation") + .withServiceName("service") + .withTag("env", "bar") + .ignoreActiveSpan() + .start(); + ((PrioritySampler) sampler).setSamplingPriority(span); + + Map propagationMap = span.spanContext().getPropagationTags().createTagMap(); + String ksr = propagationMap.get("_dd.p.ksr"); + + assertEquals(expectedKsr, ksr); + tracer.close(); + } + + @Test + void ruleBasedSamplerFallbackToAgentSamplerSetsKsr() { + Properties properties = new Properties(); + // Rule that does NOT match "service" + properties.setProperty( + TRACE_SAMPLING_RULES, "[{\"service\": \"nomatch\", \"sample_rate\": 0.5}]"); + properties.setProperty(TRACE_RATE_LIMIT, "50"); + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + + Sampler sampler = Sampler.Builder.forConfig(properties); + DDSpan span = + (DDSpan) + tracer + .buildSpan("datadog", "operation") + .withServiceName("service") + .withTag("env", "bar") + .ignoreActiveSpan() + .start(); + ((PrioritySampler) sampler).setSamplingPriority(span); + + Map propagationMap = span.spanContext().getPropagationTags().createTagMap(); + String ksr = propagationMap.get("_dd.p.ksr"); + // When falling back to agent sampler, ksr should still be set (agent rate = 1.0 by default) + assertEquals("1", ksr); + assertEquals(SAMPLER_KEEP, (int) span.getSamplingPriority()); + tracer.close(); + } + + @Test + void serviceRuleSamplerSetsKsrPropagatedTag() { + Properties properties = new Properties(); + properties.setProperty(TRACE_SAMPLING_SERVICE_RULES, "service:0.75"); + properties.setProperty(TRACE_RATE_LIMIT, "50"); + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + + Sampler sampler = Sampler.Builder.forConfig(properties); + DDSpan span = + (DDSpan) + tracer + .buildSpan("datadog", "operation") + .withServiceName("service") + .withTag("env", "bar") + .ignoreActiveSpan() + .start(); + ((PrioritySampler) sampler).setSamplingPriority(span); + + Map propagationMap = span.spanContext().getPropagationTags().createTagMap(); + String ksr = propagationMap.get("_dd.p.ksr"); + + assertEquals("0.75", ksr); + tracer.close(); + } + + @Test + void defaultRateSamplerSetsKsrPropagatedTag() { + Properties properties = new Properties(); + properties.setProperty(TRACE_SAMPLE_RATE, "0.25"); + properties.setProperty(TRACE_RATE_LIMIT, "50"); + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + + Sampler sampler = Sampler.Builder.forConfig(properties); + DDSpan span = + (DDSpan) + tracer + .buildSpan("datadog", "operation") + .withServiceName("service") + .withTag("env", "bar") + .ignoreActiveSpan() + .start(); + ((PrioritySampler) sampler).setSamplingPriority(span); + + Map propagationMap = span.spanContext().getPropagationTags().createTagMap(); + String ksr = propagationMap.get("_dd.p.ksr"); + + assertEquals("0.25", ksr); + tracer.close(); + } + + @Test + void ksrIsPropagatedViaXDatadogTagsHeader() { + RateByServiceTraceSampler serviceSampler = new RateByServiceTraceSampler(); + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + + Map rates = new HashMap<>(); + rates.put("service:,env:", 0.5); + Map> response = new HashMap<>(); + response.put("rate_by_service", rates); + serviceSampler.onResponse("traces", response); + + DDSpan span = + (DDSpan) + tracer + .buildSpan("datadog", "fakeOperation") + .withServiceName("spock") + .withTag("env", "test") + .ignoreActiveSpan() + .start(); + serviceSampler.setSamplingPriority(span); + + String headerValue = + span.spanContext().getPropagationTags().headerValue(PropagationTags.HeaderType.DATADOG); + + assertNotNull(headerValue); + assertTrue(headerValue.contains("_dd.p.ksr=0.5")); + tracer.close(); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/LongRunningTracesTrackerTest.java b/dd-trace-core/src/test/java/datadog/trace/core/LongRunningTracesTrackerTest.java index 40e21d97f7b..27c8156e27f 100644 --- a/dd-trace-core/src/test/java/datadog/trace/core/LongRunningTracesTrackerTest.java +++ b/dd-trace-core/src/test/java/datadog/trace/core/LongRunningTracesTrackerTest.java @@ -21,7 +21,7 @@ import datadog.trace.api.time.ControllableTimeSource; import datadog.trace.core.monitor.HealthMetrics; import datadog.trace.core.propagation.PropagationTags; -import datadog.trace.junit.utils.config.WithConfig; +import datadog.trace.test.junit.utils.config.WithConfig; import datadog.trace.test.util.DDJavaSpecification; import java.util.Arrays; import java.util.Collections; diff --git a/dd-trace-core/src/test/java/datadog/trace/core/PendingTraceBufferTest.java b/dd-trace-core/src/test/java/datadog/trace/core/PendingTraceBufferTest.java new file mode 100644 index 00000000000..b94a8e0898e --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/PendingTraceBufferTest.java @@ -0,0 +1,609 @@ +package datadog.trace.core; + +import static datadog.trace.api.sampling.PrioritySampling.UNSET; +import static datadog.trace.api.sampling.PrioritySampling.USER_KEEP; +import static java.nio.charset.StandardCharsets.UTF_8; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyLong; +import static org.mockito.ArgumentMatchers.argThat; +import static org.mockito.Mockito.clearInvocations; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.ObjectMapper; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; +import datadog.environment.JavaVirtualMachine; +import datadog.metrics.api.Monitoring; +import datadog.trace.SamplingPriorityMetadataChecker; +import datadog.trace.api.Config; +import datadog.trace.api.DDSpanId; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.datastreams.NoopPathwayContext; +import datadog.trace.api.flare.TracerFlare; +import datadog.trace.api.time.SystemTimeSource; +import datadog.trace.core.monitor.HealthMetrics; +import datadog.trace.core.propagation.PropagationTags; +import datadog.trace.core.scopemanager.ContinuableScopeManager; +import datadog.trace.test.util.DDJavaSpecification; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; +import java.util.zip.ZipOutputStream; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; + +@Timeout(10) +public class PendingTraceBufferTest extends DDJavaSpecification { + + private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); + + private PendingTraceBuffer buffer; + private PendingTraceBuffer bufferSpy; + private PendingTraceBuffer.DelayingPendingTraceBuffer delayingBuffer; + private CoreTracer tracer; + private CoreTracer.ConfigSnapshot traceConfig; + private ContinuableScopeManager scopeManager; + private PendingTrace.Factory factory; + private List continuations; + + @BeforeAll + static void checkJvm() { + Assumptions.assumeFalse( + JavaVirtualMachine.isOracleJDK8(), + "Oracle JDK 1.8 did not merge the fix in JDK-8058322, leading to the JVM failing to" + + " correctly extract method parameters without args, when the code is compiled on a" + + " later JDK (targeting 8). This can manifest when creating mocks."); + } + + @BeforeEach + void setup() { + tracer = mock(CoreTracer.class); + traceConfig = mock(CoreTracer.ConfigSnapshot.class); + buffer = PendingTraceBuffer.delaying(SystemTimeSource.INSTANCE, mock(Config.class), null, null); + bufferSpy = spy(buffer); + delayingBuffer = (PendingTraceBuffer.DelayingPendingTraceBuffer) buffer; + scopeManager = new ContinuableScopeManager(10, true); + factory = + new PendingTrace.Factory( + tracer, bufferSpy, SystemTimeSource.INSTANCE, false, HealthMetrics.NO_OP); + continuations = new ArrayList<>(); + + when(tracer.captureTraceConfig()).thenReturn(traceConfig); + when(traceConfig.getServiceMapping()).thenReturn(Collections.emptyMap()); + when(tracer.getPartialFlushMinSpans()).thenReturn(10); + when(tracer.writeTimer()).thenReturn(Monitoring.DISABLED.newTimer("")); + when(tracer.getTimeWithNanoTicks(anyLong())).thenAnswer(inv -> inv.getArgument(0)); + } + + @AfterEach + void cleanup() throws InterruptedException { + buffer.close(); + delayingBuffer.getWorker().join(1000); + } + + @Test + void testBufferLifecycle() throws InterruptedException { + assertFalse(delayingBuffer.getWorker().isAlive()); + + buffer.start(); + + assertTrue(delayingBuffer.getWorker().isAlive()); + assertTrue(delayingBuffer.getWorker().isDaemon()); + + assertThrows(IllegalThreadStateException.class, () -> buffer.start()); + assertTrue(delayingBuffer.getWorker().isAlive()); + assertTrue(delayingBuffer.getWorker().isDaemon()); + + buffer.close(); + delayingBuffer.getWorker().join(1000); + + assertFalse(delayingBuffer.getWorker().isAlive()); + } + + @Test + void continuationBuffersRoot() { + PendingTrace trace = factory.create(DDTraceId.ONE); + DDSpan span = newSpanOf(trace); + + assertFalse(trace.isRootSpanWritten()); + + addContinuation(span); + span.finish(); // This should enqueue + + assertEquals(1, continuations.size()); + assertEquals(1, trace.getPendingReferenceCount()); + verify(bufferSpy).enqueue(trace); + verify(tracer).onRootSpanPublished(span); + + clearInvocations(bufferSpy, tracer, traceConfig); + + continuations.get(0).release(); + + assertEquals(0, trace.getPendingReferenceCount()); + verify(tracer).write(argThat(it -> it.size() == 1)); + verify(tracer).writeTimer(); + } + + @Test + void unfinishedChildBuffersRoot() { + PendingTrace trace = factory.create(DDTraceId.ONE); + DDSpan parent = newSpanOf(trace); + DDSpan child = newSpanOf(parent); + + assertFalse(trace.isRootSpanWritten()); + + parent.finish(); // This should enqueue + + assertEquals(1, trace.size()); + assertEquals(1, trace.getPendingReferenceCount()); + verify(bufferSpy).enqueue(trace); + verify(tracer).onRootSpanPublished(parent); + + clearInvocations(bufferSpy, tracer); + + child.finish(); + + assertEquals(0, trace.size()); + assertEquals(0, trace.getPendingReferenceCount()); + verify(tracer).write(argThat(it -> it.size() == 2)); + verify(tracer).writeTimer(); + } + + @Test + void prioritySamplingIsAlwaysSent() { + SamplingPriorityMetadataChecker metadataChecker = new SamplingPriorityMetadataChecker(); + doAnswer( + invocation -> { + List spans = invocation.getArgument(0); + spans.get(0).processTagsAndBaggage(metadataChecker); + return null; + }) + .when(tracer) + .write(any()); + + DDSpan parent = addContinuation(newSpanOf(factory.create(DDTraceId.ONE), USER_KEEP, 0)); + // Fill the buffer - Only children - Priority taken from root + for (int i = 0; i < 11; i++) { + newSpanOf(parent).finish(); + } + + verify(tracer).write(any()); + assertTrue(metadataChecker.hasSamplingPriority); + } + + @Test + void bufferFullYieldsImmediateWrite() { + int capacity = delayingBuffer.getQueue().capacity(); + + // Fill the buffer + for (int i = 0; i < capacity; i++) { + addContinuation(newSpanOf(factory.create(DDTraceId.ONE))).finish(); + } + + assertEquals(capacity, delayingBuffer.getQueue().size()); + verify(bufferSpy, times(capacity)).enqueue(any()); + verify(tracer, times(capacity)).onRootSpanPublished(any()); + + clearInvocations(bufferSpy, tracer, traceConfig); + + PendingTrace pendingTrace = factory.create(DDTraceId.ONE); + addContinuation(newSpanOf(pendingTrace)).finish(); + + verify(bufferSpy).enqueue(any()); + verify(tracer).write(argThat(it -> it.size() == 1)); + verify(tracer).onRootSpanPublished(any()); + assertEquals(0, pendingTrace.getIsEnqueued()); + } + + @Test + void longRunningTraceBufferFullDoesNotTriggerWrite() { + int capacity = delayingBuffer.getQueue().capacity(); + + // Fill the buffer + for (int i = 0; i < capacity; i++) { + addContinuation(newSpanOf(factory.create(DDTraceId.ONE))).finish(); + } + + assertEquals(capacity, delayingBuffer.getQueue().size()); + verify(bufferSpy, times(capacity)).enqueue(any()); + verify(tracer, times(capacity)).onRootSpanPublished(any()); + + clearInvocations(bufferSpy, tracer, traceConfig); + + PendingTrace pendingTrace = factory.create(DDTraceId.ONE); + pendingTrace.setLongRunningTrackedState(LongRunningTracesTracker.TO_TRACK); + addContinuation(newSpanOf(pendingTrace)).finish(); + + verify(tracer).captureTraceConfig(); + verify(bufferSpy).enqueue(any()); + verify(tracer, never()).writeTimer(); + verify(tracer, never()).write(argThat(it -> it.size() == 1)); + verify(tracer).onRootSpanPublished(any()); + assertEquals(0, pendingTrace.getIsEnqueued()); + } + + @Test + void continuationAllowsAddingAfterRootFinished() { + PendingTrace trace = factory.create(DDTraceId.ONE); + DDSpan parent = addContinuation(newSpanOf(trace)); + ContextContinuation continuation = continuations.get(0); + + assertEquals(1, continuations.size()); + + parent.finish(); // This should enqueue + + assertEquals(1, trace.size()); + assertEquals(1, trace.getPendingReferenceCount()); + assertFalse(trace.isRootSpanWritten()); + verify(bufferSpy).enqueue(trace); + verify(tracer).onRootSpanPublished(parent); + + clearInvocations(bufferSpy, tracer); + + DDSpan child = newSpanOf(parent); + child.finish(); + + assertEquals(2, trace.size()); + assertEquals(1, trace.getPendingReferenceCount()); + assertFalse(trace.isRootSpanWritten()); + + // Don't start the buffer thread here. When the continuation is cancelled, + // pendingReferenceCount drops to 0 with rootSpanWritten still false, so + // write() is called synchronously on this thread. Starting the buffer + // would introduce a race where the worker thread could process the + // enqueued trace before continuation.cancel(), causing unexpected interactions. + continuation.release(); + + assertEquals(0, trace.size()); + assertEquals(0, trace.getPendingReferenceCount()); + assertTrue(trace.isRootSpanWritten()); + verify(tracer).write(argThat(it -> it.size() == 2)); + verify(tracer).writeTimer(); + } + + @Test + void lateArrivalSpanRequeuesPendingTrace() throws InterruptedException { + buffer.start(); + CountDownLatch parentLatch = new CountDownLatch(1); + CountDownLatch childLatch = new CountDownLatch(1); + + PendingTrace trace = factory.create(DDTraceId.ONE); + DDSpan parent = newSpanOf(trace); + + doAnswer( + invocation -> { + parentLatch.countDown(); + return null; + }) + .doAnswer( + invocation -> { + childLatch.countDown(); + return null; + }) + .when(tracer) + .write(any()); + + parent.finish(); // This should enqueue + assertTrue(parentLatch.await(3, TimeUnit.SECONDS)); + + assertEquals(0, trace.size()); + assertEquals(0, trace.getPendingReferenceCount()); + assertTrue(trace.isRootSpanWritten()); + verify(tracer).write(argThat(it -> it.size() == 1)); + verify(tracer).onRootSpanPublished(parent); + + clearInvocations(bufferSpy, tracer, traceConfig); + + DDSpan child = newSpanOf(parent); + child.finish(); + assertTrue(childLatch.await(3, TimeUnit.SECONDS)); + + assertEquals(0, trace.size()); + assertEquals(0, trace.getPendingReferenceCount()); + assertTrue(trace.isRootSpanWritten()); + verify(bufferSpy).enqueue(trace); + verify(tracer).write(argThat(it -> it.size() == 1)); + } + + @Test + void flushClearsTheBuffer() throws InterruptedException { + buffer.start(); + AtomicInteger counter = new AtomicInteger(0); + // Create a fake element that newer gets written + PendingTraceBuffer.Element element = + new PendingTraceBuffer.Element() { + @Override + public long oldestFinishedTime() { + return TimeUnit.MILLISECONDS.toNanos(System.currentTimeMillis()); + } + + @Override + public boolean lastReferencedNanosAgo(long nanos) { + return false; + } + + @Override + public void write() { + counter.incrementAndGet(); + } + + @Override + public DDSpan getRootSpan() { + return null; + } + + @Override + public boolean setEnqueued(boolean enqueued) { + return true; + } + + @Override + public boolean writeOnBufferFull() { + return true; + } + }; + + bufferSpy.enqueue(element); + bufferSpy.enqueue(element); + bufferSpy.enqueue(element); + + assertEquals(0, counter.get()); + + buffer.flush(); + + assertEquals(3, counter.get()); + } + + @Test + void samePendingTraceIsNotEnqueuedMultipleTimes() { + when(tracer.getPartialFlushMinSpans()).thenReturn(10000); + + PendingTrace pendingTrace = factory.create(DDTraceId.ONE); + DDSpan span = newSpanOf(pendingTrace); + span.finish(); + + assertTrue(pendingTrace.isRootSpanWritten()); + assertEquals(0, pendingTrace.getIsEnqueued()); + assertEquals(0, delayingBuffer.getQueue().size()); + verify(tracer).write(argThat(it -> it.size() == 1)); + + clearInvocations(bufferSpy, tracer, traceConfig); + + int capacity = delayingBuffer.getQueue().capacity(); + // fail to fill the buffer + for (int i = 0; i < capacity; i++) { + addContinuation(newSpanOf(span)).finish(); + } + + assertEquals(1, pendingTrace.getIsEnqueued()); + assertEquals(1, delayingBuffer.getQueue().size()); + verify(bufferSpy, times(capacity)).enqueue(any()); + + // process the buffer + buffer.start(); + + long deadline = System.currentTimeMillis() + 3000; + while (pendingTrace.getIsEnqueued() != 0 && System.currentTimeMillis() < deadline) { + try { + Thread.sleep(100); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + break; + } + } + assertEquals(0, pendingTrace.getIsEnqueued()); + } + + @Test + void testingTracerFlareDumpWithMultipleTraces() throws IOException, InterruptedException { + TracerFlare.addReporter(zip -> {}); // exercises default methods + TracerFlare.Reporter dumpReporter = mock(TracerFlare.Reporter.class); + TracerFlare.addReporter(dumpReporter); + + PendingTrace trace1 = factory.create(DDTraceId.ONE); + DDSpan parent1 = newSpanOf(trace1, UNSET, System.currentTimeMillis() * 1000); + DDSpan child1 = newSpanOf(parent1); + PendingTrace trace2 = factory.create(DDTraceId.from(2)); + DDSpan parent2 = newSpanOf(trace2, UNSET, System.currentTimeMillis() * 2000); + DDSpan child2 = newSpanOf(parent2); + // first flare dump with two traces + parent1.finish(); + parent2.finish(); + buffer.start(); + Map entries1 = buildAndExtractZip(); + + verify(dumpReporter).prepareForFlare(); + verify(dumpReporter).addReportToFlare(any()); + verify(dumpReporter).cleanupAfterFlare(); + + assertEquals(1, entries1.size()); + String pendingTraceText1 = (String) entries1.get("pending_traces.txt"); + assertTrue( + pendingTraceText1.startsWith( + "[{\"service\":\"fakeService\",\"name\":\"fakeOperation\",\"resource\":\"fakeResource\",\"trace_id\":1,\"span_id\":1,\"parent_id\":0")); + + List> parsedTraces1 = parseTraceLines(pendingTraceText1); + assertEquals(2, parsedTraces1.size()); + assertEquals(1L, ((Number) parsedTraces1.get(0).get("trace_id")).longValue()); + assertEquals(2L, ((Number) parsedTraces1.get(1).get("trace_id")).longValue()); + assertTrue( + ((Number) parsedTraces1.get(0).get("start")).longValue() + < ((Number) parsedTraces1.get(1).get("start")).longValue()); + + clearInvocations(dumpReporter); + + // New pending traces are needed here because generating the first flare takes long enough that + // the + // earlier pending traces are flushed (within 500ms). + // second flare dump with new pending traces + // Finish the first set of traces + child1.finish(); + child2.finish(); + // Create new pending traces + PendingTrace trace3 = factory.create(DDTraceId.from(3)); + DDSpan parent3 = newSpanOf(trace3, UNSET, System.currentTimeMillis() * 3000); + DDSpan child3 = newSpanOf(parent3); + PendingTrace trace4 = factory.create(DDTraceId.from(4)); + DDSpan parent4 = newSpanOf(trace4, UNSET, System.currentTimeMillis() * 4000); + DDSpan child4 = newSpanOf(parent4); + parent3.finish(); + parent4.finish(); + Map entries2 = buildAndExtractZip(); + + verify(dumpReporter).prepareForFlare(); + verify(dumpReporter).addReportToFlare(any()); + verify(dumpReporter).cleanupAfterFlare(); + + assertEquals(1, entries2.size()); + String pendingTraceText2 = (String) entries2.get("pending_traces.txt"); + List> parsedTraces2 = parseTraceLines(pendingTraceText2); + assertEquals(2, parsedTraces2.size()); + + child3.finish(); + child4.finish(); + + long deadline = System.currentTimeMillis() + 3000; + while ((trace1.size() != 0 || trace2.size() != 0 || trace3.size() != 0 || trace4.size() != 0) + && System.currentTimeMillis() < deadline) { + Thread.sleep(50); + } + + assertEquals(0, trace1.size()); + assertEquals(0, trace1.getPendingReferenceCount()); + assertEquals(0, trace2.size()); + assertEquals(0, trace2.getPendingReferenceCount()); + assertEquals(0, trace3.size()); + assertEquals(0, trace3.getPendingReferenceCount()); + assertEquals(0, trace4.size()); + assertEquals(0, trace4.getPendingReferenceCount()); + } + + private DDSpan addContinuation(DDSpan span) { + ContextScope scope = scopeManager.activateSpan(span); + continuations.add(scopeManager.captureSpan(span)); + scope.close(); + return span; + } + + private static DDSpan newSpanOf(PendingTrace trace) { + return newSpanOf(trace, UNSET, 0); + } + + private static DDSpan newSpanOf(PendingTrace trace, int samplingPriority, long timestampMicro) { + DDSpanContext context = + new DDSpanContext( + trace.getTraceId(), + 1, + DDSpanId.ZERO, + null, + "fakeService", + "fakeOperation", + "fakeResource", + samplingPriority, + null, + Collections.emptyMap(), + false, + "fakeType", + 0, + trace, + null, + null, + NoopPathwayContext.INSTANCE, + false, + PropagationTags.factory().empty()); + return DDSpan.create("test", timestampMicro, context, null); + } + + private static DDSpan newSpanOf(DDSpan parent) { + TraceCollector traceCollector = parent.spanContext().getTraceCollector(); + DDSpanContext context = + new DDSpanContext( + parent.spanContext().getTraceId(), + 2, + parent.spanContext().getSpanId(), + null, + "fakeService", + "fakeOperation", + "fakeResource", + UNSET, + null, + Collections.emptyMap(), + false, + "fakeType", + 0, + traceCollector, + null, + null, + NoopPathwayContext.INSTANCE, + false, + PropagationTags.factory().empty()); + return DDSpan.create("test", 0, context, null); + } + + private Map buildAndExtractZip() throws IOException { + TracerFlare.prepareForFlare(); + ByteArrayOutputStream out = new ByteArrayOutputStream(); + try (ZipOutputStream zip = new ZipOutputStream(out)) { + TracerFlare.addReportsToFlare(zip); + } finally { + TracerFlare.cleanupAfterFlare(); + } + + Map entries = new LinkedHashMap<>(); + try (ZipInputStream zip = new ZipInputStream(new ByteArrayInputStream(out.toByteArray()))) { + ZipEntry entry; + byte[] buf = new byte[4096]; + while ((entry = zip.getNextEntry()) != null) { + ByteArrayOutputStream bytes = new ByteArrayOutputStream(); + int read; + while ((read = zip.read(buf)) != -1) { + bytes.write(buf, 0, read); + } + String name = entry.getName(); + if (name.endsWith(".bin")) { + entries.put(name, bytes.toByteArray()); + } else { + entries.put(name, new String(bytes.toByteArray(), UTF_8)); + } + } + } + return entries; + } + + private static List> parseTraceLines(String text) throws IOException { + List> allSpans = new ArrayList<>(); + for (String line : text.split("\n")) { + if (!line.isEmpty()) { + List> lineSpans = + OBJECT_MAPPER.readValue(line, new TypeReference>>() {}); + allSpans.addAll(lineSpans); + } + } + return allSpans; + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/PendingTraceStrictWriteTest.java b/dd-trace-core/src/test/java/datadog/trace/core/PendingTraceStrictWriteTest.java new file mode 100644 index 00000000000..aff3894c7fc --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/PendingTraceStrictWriteTest.java @@ -0,0 +1,64 @@ +package datadog.trace.core; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.context.ContextContinuation; +import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import java.util.ArrayList; +import java.util.Arrays; +import org.junit.jupiter.api.Test; + +public class PendingTraceStrictWriteTest extends PendingTraceTestBase { + + @Test + void traceNotReportedUntilContinuationClosed() throws InterruptedException { + AgentScope scope = tracer.activateSpan(rootSpan); + ContextContinuation continuation = tracer.captureActiveSpan(); + scope.close(); + rootSpan.finish(); + + assertEquals(1, traceCollector.getPendingReferenceCount()); + assertEquals(Arrays.asList(rootSpan), new ArrayList<>(traceCollector.getSpans())); + assertTrue(writer.isEmpty()); + // root span buffer delay expires + writer.waitForTracesMax(1, 1); + + assertEquals(1, traceCollector.getPendingReferenceCount()); + assertEquals(Arrays.asList(rootSpan), new ArrayList<>(traceCollector.getSpans())); + assertTrue(writer.isEmpty()); + assertEquals(0, writer.getTraceCount()); + // continuation is closed + continuation.release(); + + assertEquals(0, traceCollector.getPendingReferenceCount()); + assertTrue(traceCollector.getSpans().isEmpty()); + assertEquals(Arrays.asList(Arrays.asList(rootSpan)), new ArrayList<>(writer)); + assertEquals(1, writer.getTraceCount()); + } + + @Test + void negativeReferenceCountThrowsException() { + AgentScope scope = tracer.activateSpan(rootSpan); + ContextContinuation continuation = tracer.captureActiveSpan(); + scope.close(); + rootSpan.finish(); + + assertEquals(1, traceCollector.getPendingReferenceCount()); + assertEquals(Arrays.asList(rootSpan), new ArrayList<>(traceCollector.getSpans())); + assertTrue(writer.isEmpty()); + // continuation is finished the first time + continuation.release(); + + assertEquals(0, traceCollector.getPendingReferenceCount()); + assertTrue(traceCollector.getSpans().isEmpty()); + assertEquals(Arrays.asList(Arrays.asList(rootSpan)), new ArrayList<>(writer)); + assertEquals(1, writer.getTraceCount()); + // continuation is finished the second time + // Yes this should be guarded by the used flag in the continuation, + // so remove it anyway to trigger the exception + assertThrows( + IllegalStateException.class, () -> traceCollector.removeContinuation(continuation)); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/PendingTraceTest.java b/dd-trace-core/src/test/java/datadog/trace/core/PendingTraceTest.java new file mode 100644 index 00000000000..0020fa3a157 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/PendingTraceTest.java @@ -0,0 +1,221 @@ +package datadog.trace.core; + +import static datadog.trace.api.sampling.PrioritySampling.UNSET; +import static datadog.trace.api.sampling.PrioritySampling.USER_KEEP; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import datadog.environment.JavaVirtualMachine; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.datastreams.NoopPathwayContext; +import datadog.trace.api.time.TimeSource; +import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.trace.core.monitor.HealthMetrics; +import datadog.trace.core.propagation.PropagationTags; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.TimeoutException; +import org.junit.jupiter.api.Assumptions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; + +@Timeout(60) +public class PendingTraceTest extends PendingTraceTestBase { + + @BeforeAll + static void checkJvm() { + Assumptions.assumeFalse( + JavaVirtualMachine.isOracleJDK8(), + "Oracle JDK 1.8 did not merge the fix in JDK-8058322, leading to the JVM failing to" + + " correctly extract method parameters without args, when the code is compiled on a" + + " later JDK (targeting 8). This can manifest when creating mocks."); + } + + @Override + protected boolean useStrictTraceWrites() { + // This tests the behavior of the relaxed pending trace implementation + return false; + } + + private DDSpan createSimpleSpan(PendingTrace trace) { + return createSimpleSpanWithID(trace, 1); + } + + private DDSpan createSimpleSpanWithID(PendingTrace trace, long id) { + return new DDSpan( + "test", + 0L, + new DDSpanContext( + DDTraceId.from(1), + id, + 0, + null, + "", + "", + "", + UNSET, + "", + Collections.emptyMap(), + false, + "", + 0, + trace, + null, + null, + NoopPathwayContext.INSTANCE, + false, + PropagationTags.factory().empty()), + null); + } + + @Test + void traceStillReportedWhenUnfinishedContinuationDiscarded() + throws InterruptedException, TimeoutException { + AgentScope scope = tracer.activateSpan(rootSpan); + tracer.captureActiveSpan(); + scope.close(); + + rootSpan.finish(); + + assertEquals(1, traceCollector.getPendingReferenceCount()); + assertEquals(Arrays.asList(rootSpan), new ArrayList<>(traceCollector.getSpans())); + assertTrue(writer.isEmpty()); + // root span buffer delay expires + writer.waitForTraces(1); + + assertEquals(1, traceCollector.getPendingReferenceCount()); + assertTrue(traceCollector.getSpans().isEmpty()); + assertEquals(Arrays.asList(Arrays.asList(rootSpan)), new ArrayList<>(writer)); + assertEquals(1, writer.getTraceCount()); + } + + @Test + void verifyHealthMetricsCalled() { + CoreTracer stubTracer = mock(CoreTracer.class); + CoreTracer.ConfigSnapshot traceConfig = mock(CoreTracer.ConfigSnapshot.class); + PendingTraceBuffer buffer = mock(PendingTraceBuffer.class); + HealthMetrics healthMetrics = mock(HealthMetrics.class); + + when(stubTracer.captureTraceConfig()).thenReturn(traceConfig); + when(traceConfig.getServiceMapping()).thenReturn(Collections.emptyMap()); + + PendingTrace trace = + new PendingTrace( + stubTracer, + DDTraceId.from(0), + buffer, + mock(TimeSource.class), + null, + false, + healthMetrics); + + DDSpan span = createSimpleSpan(trace); + trace.registerSpan(span); + + verify(healthMetrics, times(1)).onCreateSpan(); + + span.finish(); + + verify(healthMetrics, times(1)).onCreateTrace(); + } + + @Test + void writeWhenRunningSpansDisabledOnlyCompletedSpansWritten() { + CoreTracer stubTracer = mock(CoreTracer.class); + CoreTracer.ConfigSnapshot traceConfig = mock(CoreTracer.ConfigSnapshot.class); + PendingTraceBuffer buffer = mock(PendingTraceBuffer.class); + HealthMetrics healthMetrics = mock(HealthMetrics.class); + + when(stubTracer.captureTraceConfig()).thenReturn(traceConfig); + when(traceConfig.getServiceMapping()).thenReturn(Collections.emptyMap()); + when(buffer.longRunningSpansEnabled()).thenReturn(true); + + PendingTrace trace = + new PendingTrace( + stubTracer, + DDTraceId.from(0), + buffer, + mock(TimeSource.class), + null, + false, + healthMetrics); + + DDSpan span1 = createSimpleSpanWithID(trace, 39); + span1.setDurationNano(31); + span1.setSamplingPriority(USER_KEEP); + trace.registerSpan(span1); + + DDSpan unfinishedSpan = createSimpleSpanWithID(trace, 191); + trace.registerSpan(unfinishedSpan); + + DDSpan span2 = createSimpleSpanWithID(trace, 9999); + span2.setDurationNano(9191); + trace.registerSpan(span2); + + List traceToWrite = new ArrayList<>(0); + int completedSpans = trace.enqueueSpansToWrite(traceToWrite, false); + + assertEquals(2, completedSpans); + assertEquals(2, traceToWrite.size()); + assertTrue(traceToWrite.containsAll(Arrays.asList(span1, span2))); + assertEquals(1, trace.getSpans().size()); + assertEquals(unfinishedSpan, trace.getSpans().iterator().next()); + } + + @Test + void writeWhenRunningSpansEnabledCompleteAndRunningSpansWritten() { + CoreTracer stubTracer = mock(CoreTracer.class); + CoreTracer.ConfigSnapshot traceConfig = mock(CoreTracer.ConfigSnapshot.class); + PendingTraceBuffer buffer = mock(PendingTraceBuffer.class); + HealthMetrics healthMetrics = mock(HealthMetrics.class); + + when(stubTracer.captureTraceConfig()).thenReturn(traceConfig); + when(traceConfig.getServiceMapping()).thenReturn(Collections.emptyMap()); + when(buffer.longRunningSpansEnabled()).thenReturn(true); + + PendingTrace trace = + new PendingTrace( + stubTracer, + DDTraceId.from(0), + buffer, + mock(TimeSource.class), + null, + false, + healthMetrics); + + DDSpan span1 = createSimpleSpanWithID(trace, 39); + span1.setDurationNano(31); + span1.setSamplingPriority(USER_KEEP); + trace.registerSpan(span1); + + DDSpan unfinishedSpan = createSimpleSpanWithID(trace, 191); + trace.registerSpan(unfinishedSpan); + + DDSpan span2 = createSimpleSpanWithID(trace, 9999); + span2.setServiceName("9191"); + span2.setDurationNano(9191); + trace.registerSpan(span2); + + DDSpan unfinishedSpan2 = createSimpleSpanWithID(trace, 77771); + trace.registerSpan(unfinishedSpan2); + + List traceToWrite = new ArrayList<>(0); + int completedSpans = trace.enqueueSpansToWrite(traceToWrite, true); + + assertEquals(2, completedSpans); + assertEquals(4, traceToWrite.size()); + assertTrue( + traceToWrite.containsAll(Arrays.asList(span1, span2, unfinishedSpan, unfinishedSpan2))); + assertEquals(2, trace.getSpans().size()); + assertTrue( + new ArrayList<>(trace.getSpans()) + .containsAll(Arrays.asList(unfinishedSpan, unfinishedSpan2))); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/PendingTraceTestBase.java b/dd-trace-core/src/test/java/datadog/trace/core/PendingTraceTestBase.java new file mode 100644 index 00000000000..aa986faa0e4 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/PendingTraceTestBase.java @@ -0,0 +1,286 @@ +package datadog.trace.core; + +import static datadog.trace.api.config.TracerConfig.PARTIAL_FLUSH_MIN_SPANS; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.Logger; +import datadog.trace.common.writer.ListWriter; +import datadog.trace.test.junit.utils.config.WithConfig; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.slf4j.LoggerFactory; +import org.tabletest.junit.TableTest; + +public abstract class PendingTraceTestBase extends DDCoreJavaSpecification { + + protected ListWriter writer; + protected CoreTracer tracer; + protected DDSpan rootSpan; + protected PendingTrace traceCollector; + + @BeforeEach + void setup() throws Exception { + writer = new ListWriter(); + tracer = tracerBuilder().writer(writer).build(); + rootSpan = (DDSpan) tracer.buildSpan("datadog", "fakeOperation").start(); + traceCollector = (PendingTrace) rootSpan.spanContext().getTraceCollector(); + + assertEquals(0, traceCollector.size()); + assertEquals(1, traceCollector.getPendingReferenceCount()); + assertFalse(traceCollector.isRootSpanWritten()); + } + + @AfterEach + void cleanup() { + if (tracer != null) { + tracer.close(); + } + } + + @Test + void singleSpanWrittenWhenFinished() throws InterruptedException, TimeoutException { + rootSpan.finish(); + writer.waitForTraces(1); + + assertTrue(traceCollector.getSpans().isEmpty()); + assertEquals(Arrays.asList(Arrays.asList(rootSpan)), new ArrayList<>(writer)); + assertEquals(1, writer.getTraceCount()); + } + + @Test + void childFinishesBeforeParent() throws InterruptedException, TimeoutException { + DDSpan child = + (DDSpan) tracer.buildSpan("datadog", "child").asChildOf(rootSpan.spanContext()).start(); + + assertEquals(2, traceCollector.getPendingReferenceCount()); + + child.finish(); + + assertEquals(1, traceCollector.getPendingReferenceCount()); + assertEquals(Arrays.asList(child), new ArrayList<>(traceCollector.getSpans())); + assertTrue(writer.isEmpty()); + + rootSpan.finish(); + writer.waitForTraces(1); + + assertEquals(0, traceCollector.getPendingReferenceCount()); + assertTrue(traceCollector.getSpans().isEmpty()); + assertEquals(Arrays.asList(Arrays.asList(rootSpan, child)), new ArrayList<>(writer)); + assertEquals(1, writer.getTraceCount()); + } + + @Test + void parentFinishesBeforeChild() throws InterruptedException, TimeoutException { + DDSpan child = + (DDSpan) tracer.buildSpan("datadog", "child").asChildOf(rootSpan.spanContext()).start(); + + assertEquals(2, traceCollector.getPendingReferenceCount()); + + rootSpan.finish(); + + assertEquals(1, traceCollector.getPendingReferenceCount()); + assertEquals(Arrays.asList(rootSpan), new ArrayList<>(traceCollector.getSpans())); + assertTrue(writer.isEmpty()); + + child.finish(); + writer.waitForTraces(1); + + assertEquals(0, traceCollector.getPendingReferenceCount()); + assertTrue(traceCollector.getSpans().isEmpty()); + assertEquals(Arrays.asList(Arrays.asList(child, rootSpan)), new ArrayList<>(writer)); + assertEquals(1, writer.getTraceCount()); + } + + @Test + void childSpansCreatedAfterWrittenReportedSeparately() + throws InterruptedException, TimeoutException { + rootSpan.finish(); + // this shouldn't happen, but it's possible users of the api + // may incorrectly add spans after the trace is reported. + // in those cases we should still decrement the pending trace count + DDSpan childSpan = + (DDSpan) tracer.buildSpan("datadog", "child").asChildOf(rootSpan.spanContext()).start(); + childSpan.finish(); + writer.waitForTraces(2); + + assertEquals(0, traceCollector.getPendingReferenceCount()); + assertTrue(traceCollector.getSpans().isEmpty()); + assertEquals( + Arrays.asList(Arrays.asList(rootSpan), Arrays.asList(childSpan)), new ArrayList<>(writer)); + } + + @Test + void testGetCurrentTimeNano() { + long diffSeconds = + Math.abs( + TimeUnit.NANOSECONDS.toSeconds(traceCollector.getCurrentTimeNano()) + - TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis())); + // Generous 5 seconds to execute this test + assertTrue(diffSeconds < 5, "Expected time difference < 5 seconds, got: " + diffSeconds); + } + + @Test + @WithConfig(key = PARTIAL_FLUSH_MIN_SPANS, value = "2") + void partialFlush() throws InterruptedException, TimeoutException { + CoreTracer quickTracer = tracerBuilder().writer(writer).build(); + try { + DDSpan localRoot = (DDSpan) quickTracer.buildSpan("datadog", "root").start(); + PendingTrace trace = (PendingTrace) localRoot.spanContext().getTraceCollector(); + DDSpan child1 = + (DDSpan) + quickTracer.buildSpan("datadog", "child1").asChildOf(localRoot.spanContext()).start(); + DDSpan child2 = + (DDSpan) + quickTracer.buildSpan("datadog", "child2").asChildOf(localRoot.spanContext()).start(); + + assertEquals(3, trace.getPendingReferenceCount()); + + child2.finish(); + + assertEquals(2, trace.getPendingReferenceCount()); + assertEquals(Arrays.asList(child2), new ArrayList<>(trace.getSpans())); + assertTrue(writer.isEmpty()); + assertEquals(0, writer.getTraceCount()); + + child1.finish(); + writer.waitForTraces(1); + + assertEquals(1, trace.getPendingReferenceCount()); + assertEquals(Arrays.asList(), new ArrayList<>(trace.getSpans())); + assertEquals(Arrays.asList(Arrays.asList(child1, child2)), new ArrayList<>(writer)); + assertEquals(1, writer.getTraceCount()); + + localRoot.finish(); + writer.waitForTraces(2); + + assertEquals(0, trace.getPendingReferenceCount()); + assertTrue(trace.getSpans().isEmpty()); + assertEquals( + Arrays.asList(Arrays.asList(child1, child2), Arrays.asList(localRoot)), + new ArrayList<>(writer)); + assertEquals(2, writer.getTraceCount()); + } finally { + quickTracer.close(); + } + } + + @Test + @WithConfig(key = PARTIAL_FLUSH_MIN_SPANS, value = "2") + void partialFlushWithRootSpanClosedLast() throws InterruptedException, TimeoutException { + CoreTracer quickTracer = tracerBuilder().writer(writer).build(); + try { + DDSpan localRoot = (DDSpan) quickTracer.buildSpan("datadog", "root").start(); + PendingTrace trace = (PendingTrace) localRoot.spanContext().getTraceCollector(); + DDSpan child1 = + (DDSpan) + quickTracer.buildSpan("datadog", "child1").asChildOf(localRoot.spanContext()).start(); + DDSpan child2 = + (DDSpan) + quickTracer.buildSpan("datadog", "child2").asChildOf(localRoot.spanContext()).start(); + + assertEquals(3, trace.getPendingReferenceCount()); + + child1.finish(); + + assertEquals(2, trace.getPendingReferenceCount()); + assertEquals(Arrays.asList(child1), new ArrayList<>(trace.getSpans())); + assertTrue(writer.isEmpty()); + assertEquals(0, writer.getTraceCount()); + + child2.finish(); + writer.waitForTraces(1); + + assertEquals(1, trace.getPendingReferenceCount()); + assertTrue(trace.getSpans().isEmpty()); + assertEquals(Arrays.asList(Arrays.asList(child2, child1)), new ArrayList<>(writer)); + assertEquals(1, writer.getTraceCount()); + + localRoot.finish(); + writer.waitForTraces(2); + + assertEquals(0, trace.getPendingReferenceCount()); + assertTrue(trace.getSpans().isEmpty()); + assertEquals( + Arrays.asList(Arrays.asList(child2, child1), Arrays.asList(localRoot)), + new ArrayList<>(writer)); + assertEquals(2, writer.getTraceCount()); + } finally { + quickTracer.close(); + } + } + + // spotless:off + @TableTest({ + "scenario | threadCount | spanCount", + "1 thread 1 span | 1 | 1 ", + "2 threads 1 span | 2 | 1 ", + "1 thread 2 spans | 1 | 2 ", + // Sufficiently large to fill the buffer: + "5 threads 2000 | 5 | 2000 ", + "10 threads 1000 | 10 | 1000 ", + "50 threads 500 | 50 | 500 " + }) + // spotless:on + void partialFlushConcurrencyTest(int threadCount, int spanCount) + throws InterruptedException, TimeoutException { + // reduce logging noise + Logger logger = (Logger) LoggerFactory.getLogger("datadog.trace"); + Level previousLevel = logger.getLevel(); + logger.setLevel(Level.OFF); + try { + CountDownLatch latch = new CountDownLatch(1); + DDSpan localRoot = (DDSpan) tracer.buildSpan("test", "root").start(); + PendingTrace localTraceCollector = (PendingTrace) localRoot.spanContext().getTraceCollector(); + List exceptions = new ArrayList<>(); + + List threads = new ArrayList<>(threadCount); + for (int t = 0; t < threadCount; t++) { + Thread thread = + new Thread( + () -> { + try { + latch.await(); + List spans = new ArrayList<>(spanCount); + for (int s = 0; s < spanCount; s++) { + spans.add( + (DDSpan) tracer.startSpan("test", "child", localRoot.spanContext())); + } + for (DDSpan span : spans) { + span.finish(); + } + } catch (Throwable ex) { + exceptions.add(ex); + } + }); + thread.start(); + threads.add(thread); + } + // Finish root span so other spans are queued automatically + localRoot.finish(); + writer.waitForTraces(1); + + latch.countDown(); + for (Thread thread : threads) { + thread.join(); + } + localTraceCollector.getPendingTraceBuffer().flush(); + + assertTrue(exceptions.isEmpty(), "Exceptions in worker threads: " + exceptions); + assertEquals(0, localTraceCollector.getPendingReferenceCount()); + int totalSpans = writer.stream().mapToInt(List::size).sum(); + assertEquals(threadCount * spanCount + 1, totalSpans); + } finally { + logger.setLevel(previousLevel); + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/PendingTraceTestBridge.java b/dd-trace-core/src/test/java/datadog/trace/core/PendingTraceTestBridge.java new file mode 100644 index 00000000000..0d4fc04a9ac --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/PendingTraceTestBridge.java @@ -0,0 +1,10 @@ +package datadog.trace.core; + +/** + * Bridge class to allow tests to access package-private method exposed by the {@code PendingTrace} + */ +public class PendingTraceTestBridge { + public static int getPendingReferenceCount(PendingTrace pendingTrace) { + return pendingTrace.getPendingReferenceCount(); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/ScopeManagerTestBridge.java b/dd-trace-core/src/test/java/datadog/trace/core/ScopeManagerTestBridge.java new file mode 100644 index 00000000000..4c0682b4023 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/ScopeManagerTestBridge.java @@ -0,0 +1,10 @@ +package datadog.trace.core; + +import datadog.trace.core.scopemanager.ContinuableScopeManager; + +/** Bridge to expose package-private {@code CoreTracer.scopeManager} to tests in other packages. */ +public class ScopeManagerTestBridge { + public static ContinuableScopeManager getScopeManager(CoreTracer tracer) { + return tracer.scopeManager; + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/TraceCorrelationTest.java b/dd-trace-core/src/test/java/datadog/trace/core/TraceCorrelationTest.java index b4edeed98de..1310d0f5820 100644 --- a/dd-trace-core/src/test/java/datadog/trace/core/TraceCorrelationTest.java +++ b/dd-trace-core/src/test/java/datadog/trace/core/TraceCorrelationTest.java @@ -8,7 +8,7 @@ import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.common.writer.ListWriter; -import datadog.trace.junit.utils.config.WithConfigExtension; +import datadog.trace.test.junit.utils.config.WithConfigExtension; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -24,7 +24,7 @@ void getTraceIdWithoutTrace(boolean log128bTraceId) { TRACE_128_BIT_TRACEID_LOGGING_ENABLED, String.valueOf(log128bTraceId)); CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); - AgentSpan span = tracer.buildSpan("test").start(); + AgentSpan span = tracer.buildSpan("datadog", "test").start(); AgentScope scope = tracer.activateSpan(span); scope.close(); @@ -43,7 +43,7 @@ void getTraceIdWithTrace(boolean log128bTraceId) { TRACE_128_BIT_TRACEID_LOGGING_ENABLED, String.valueOf(log128bTraceId)); CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); - AgentSpan span = tracer.buildSpan("test").start(); + AgentSpan span = tracer.buildSpan("datadog", "test").start(); AgentScope scope = tracer.activateSpan(span); DDTraceId traceId = ((DDSpan) scope.span()).getTraceId(); @@ -58,7 +58,7 @@ void getTraceIdWithTrace(boolean log128bTraceId) { @Test void getSpanIdWithoutSpan() { CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); - AgentSpan span = tracer.buildSpan("test").start(); + AgentSpan span = tracer.buildSpan("datadog", "test").start(); AgentScope scope = tracer.activateSpan(span); scope.close(); @@ -71,7 +71,7 @@ void getSpanIdWithoutSpan() { @Test void getSpanIdWithTrace() { CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); - AgentSpan span = tracer.buildSpan("test").start(); + AgentSpan span = tracer.buildSpan("datadog", "test").start(); AgentScope scope = tracer.activateSpan(span); assertEquals(Long.toString(((DDSpan) scope.span()).getSpanId()), tracer.getSpanId()); diff --git a/dd-trace-core/src/test/java/datadog/trace/core/TraceInterceptorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/TraceInterceptorTest.java new file mode 100644 index 00000000000..503038d1405 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/TraceInterceptorTest.java @@ -0,0 +1,251 @@ +package datadog.trace.core; + +import static java.util.Collections.emptyList; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.TestInterceptor; +import datadog.trace.api.GlobalTracer; +import datadog.trace.api.TagMap; +import datadog.trace.api.config.TracerConfig; +import datadog.trace.api.interceptor.MutableSpan; +import datadog.trace.api.interceptor.TraceInterceptor; +import datadog.trace.common.writer.ListWriter; +import datadog.trace.test.junit.utils.config.WithConfig; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.TimeoutException; +import java.util.concurrent.atomic.AtomicBoolean; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; +import org.tabletest.junit.TableTest; + +@Timeout(10) +@WithConfig(key = TracerConfig.TRACE_GIT_METADATA_ENABLED, value = "false") +public class TraceInterceptorTest extends DDCoreJavaSpecification { + + private ListWriter writer; + private CoreTracer tracer; + + @BeforeEach + void setup() { + writer = new ListWriter(); + tracer = tracerBuilder().writer(writer).build(); + } + + @AfterEach + void cleanup() { + if (tracer != null) { + tracer.close(); + } + } + + @Test + void interceptorIsRegisteredAsService() { + assertInstanceOf(TestInterceptor.class, tracer.getInterceptors().interceptors()[0]); + } + + @Test + void interceptorsWithSamePriorityReplaced() { + int priority = 999; + TestInterceptor.priority = priority; + tracer + .getInterceptors() + .add( + new TraceInterceptor() { + @Override + public Collection onTraceComplete( + Collection trace) { + return emptyList(); + } + + @Override + public int priority() { + return priority; + } + }); + + TraceInterceptor[] interceptors = tracer.getInterceptors().interceptors(); + assertEquals(1, interceptors.length); + assertInstanceOf(TestInterceptor.class, interceptors[0]); + } + + @TableTest({ + "scenario | score | reverse", + "lower than existing | -1 | false ", + "higher than existing | 1000 | true " + }) + void interceptorsWithDifferentPrioritySorted(int score, boolean reverse) { + TraceInterceptor existingInterceptor = tracer.getInterceptors().interceptors()[0]; + TraceInterceptor newInterceptor = + new TraceInterceptor() { + @Override + public Collection onTraceComplete( + Collection trace) { + return emptyList(); + } + + @Override + public int priority() { + return score; + } + }; + tracer.getInterceptors().add(newInterceptor); + + List sorted = Arrays.asList(tracer.getInterceptors().interceptors()); + assertEquals(2, sorted.size()); + if (reverse) { + assertEquals(existingInterceptor, sorted.get(0)); + assertEquals(newInterceptor, sorted.get(1)); + } else { + assertEquals(newInterceptor, sorted.get(0)); + assertEquals(existingInterceptor, sorted.get(1)); + } + } + + @TableTest({ + "scenario | deltaPriority | expectedSize", + "below priority | -1 | 2 ", + "same priority | 0 | 1 ", + "above priority | 1 | 2 " + }) + void interceptorCanDiscardTrace(int deltaPriority, int expectedSize) + throws InterruptedException, TimeoutException { + int score = TestInterceptor.priority + deltaPriority; + AtomicBoolean called = new AtomicBoolean(false); + CountDownLatch latch = new CountDownLatch(1); + tracer + .getInterceptors() + .add( + new TraceInterceptor() { + @Override + public Collection onTraceComplete( + Collection trace) { + called.set(true); + latch.countDown(); + return emptyList(); + } + + @Override + public int priority() { + return score; + } + }); + + tracer.buildSpan("datadog", "test " + score).start().finish(); + if (score == TestInterceptor.priority) { + writer.waitForTraces(1); + } else { + latch.await(5, TimeUnit.SECONDS); + } + + TraceInterceptor[] interceptors = tracer.getInterceptors().interceptors(); + assertEquals(expectedSize, interceptors.length); + assertEquals(score != TestInterceptor.priority, called.get()); + assertEquals(score != TestInterceptor.priority, writer.isEmpty()); + } + + @Test + void interceptorCanModifySpan() throws InterruptedException, TimeoutException { + tracer + .getInterceptors() + .add( + new TraceInterceptor() { + @Override + public Collection onTraceComplete( + Collection trace) { + for (MutableSpan span : trace) { + span.setOperationName("modifiedON-" + span.getOperationName()) + .setServiceName("modifiedSN-" + span.getServiceName()) + .setResourceName("modifiedRN-" + span.getResourceName()) + .setSpanType("modifiedST-" + span.getSpanType()) + .setTag("boolean-tag", true) + .setTag("number-tag", 5.0) + .setTag("string-tag", "howdy") + .setError(true); + } + return trace; + } + + @Override + public int priority() { + return 1; + } + }); + + tracer.buildSpan("datadog", "test").start().finish(); + writer.waitForTraces(1); + + List trace = writer.firstTrace(); + assertEquals(1, trace.size()); + + DDSpan span = trace.get(0); + assertEquals("modifiedON-test", span.spanContext().getOperationName().toString()); + assertTrue(span.getServiceName().startsWith("modifiedSN-")); + assertEquals("modifiedRN-modifiedON-test", span.getResourceName().toString()); + assertEquals("modifiedST-null", span.getSpanType()); + assertTrue(span.spanContext().getErrorFlag()); + + TagMap tags = span.spanContext().getTags(); + assertEquals(true, tags.get("boolean-tag")); + assertEquals(5.0, tags.get("number-tag")); + assertEquals("howdy", tags.get("string-tag")); + assertNotNull(tags.get("thread.name")); + assertNotNull(tags.get("thread.id")); + assertNotNull(tags.get("runtime-id")); + assertNotNull(tags.get("language")); + assertTrue(tags.size() >= 7); + } + + @Test + void robustWhenInterceptorReturnsNull() { + tracer + .getInterceptors() + .add( + new TraceInterceptor() { + @Override + public Collection onTraceComplete( + Collection trace) { + return null; + } + + @Override + public int priority() { + return 0; + } + }); + + DDSpan span = (DDSpan) tracer.startSpan("test", "test"); + span.phasedFinish(); + assertDoesNotThrow(() -> tracer.write(SpanList.of(span))); + } + + @Test + void registerInterceptorThroughBridge() { + GlobalTracer.registerIfAbsent(tracer); + TraceInterceptor interceptor = + new TraceInterceptor() { + @Override + public Collection onTraceComplete( + Collection trace) { + return trace; + } + + @Override + public int priority() { + return 38; + } + }; + + assertTrue(GlobalTracer.get().addTraceInterceptor(interceptor)); + assertTrue(Arrays.asList(tracer.getInterceptors().interceptors()).contains(interceptor)); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/TracingConfigPollerTest.java b/dd-trace-core/src/test/java/datadog/trace/core/TracingConfigPollerTest.java new file mode 100644 index 00000000000..a5105d326c9 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/TracingConfigPollerTest.java @@ -0,0 +1,301 @@ +package datadog.trace.core; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + +import datadog.communication.ddagent.DDAgentFeaturesDiscovery; +import datadog.communication.ddagent.SharedCommunicationObjects; +import datadog.metrics.api.Monitoring; +import datadog.remoteconfig.ConfigurationPoller; +import datadog.remoteconfig.Product; +import datadog.remoteconfig.state.ParsedConfigKey; +import datadog.remoteconfig.state.ProductListener; +import datadog.trace.api.datastreams.DataStreamsTransactionExtractor; +import java.lang.reflect.Field; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; +import org.tabletest.junit.TableTest; + +@Timeout(10) +public class TracingConfigPollerTest extends DDCoreJavaSpecification { + + @Test + void mergeLibConfigsWithNullAndNonNullValues() { + TracingConfigPoller.LibConfig config1 = new TracingConfigPoller.LibConfig(); // all nulls + TracingConfigPoller.LibConfig config2 = new TracingConfigPoller.LibConfig(); + config2.tracingEnabled = true; + config2.debugEnabled = false; + config2.runtimeMetricsEnabled = true; + config2.logsInjectionEnabled = false; + config2.dataStreamsEnabled = true; + config2.traceSampleRate = 0.5; + config2.dynamicInstrumentationEnabled = true; + config2.exceptionReplayEnabled = false; + config2.codeOriginEnabled = true; + config2.liveDebuggingEnabled = false; + + TracingConfigPoller.LibConfig config3 = new TracingConfigPoller.LibConfig(); + config3.tracingEnabled = false; + config3.debugEnabled = true; + config3.runtimeMetricsEnabled = false; + config3.logsInjectionEnabled = true; + config3.dataStreamsEnabled = false; + config3.traceSampleRate = 0.8; + config3.dynamicInstrumentationEnabled = false; + config3.exceptionReplayEnabled = true; + config3.codeOriginEnabled = false; + config3.liveDebuggingEnabled = true; + + TracingConfigPoller.LibConfig merged = + TracingConfigPoller.LibConfig.mergeLibConfigs(Arrays.asList(config1, config2, config3)); + + assertNotNull(merged); + // Should take first non-null values from config2 + assertEquals(Boolean.TRUE, merged.tracingEnabled); + assertEquals(Boolean.FALSE, merged.debugEnabled); + assertEquals(Boolean.TRUE, merged.runtimeMetricsEnabled); + assertEquals(Boolean.FALSE, merged.logsInjectionEnabled); + assertEquals(Boolean.TRUE, merged.dataStreamsEnabled); + assertEquals(0.5, merged.traceSampleRate); + assertEquals(Boolean.TRUE, merged.dynamicInstrumentationEnabled); + assertEquals(Boolean.FALSE, merged.exceptionReplayEnabled); + assertEquals(Boolean.TRUE, merged.codeOriginEnabled); + assertEquals(Boolean.FALSE, merged.liveDebuggingEnabled); + } + + @TableTest({ + "scenario | service | env | clusterName | expectedPriority", + "service and env | test-service | staging | | 5 ", + "service and wildcard | test-service | * | | 4 ", + "wildcard and env | * | staging | | 3 ", + "cluster target | | | test-cluster | 2 ", + "wildcard org level | * | * | | 1 " + }) + void configPriorityCalculation( + String service, String env, String clusterName, int expectedPriority) { + TracingConfigPoller.ConfigOverrides configOverrides = new TracingConfigPoller.ConfigOverrides(); + if (service != null || env != null) { + configOverrides.serviceTarget = new TracingConfigPoller.ServiceTarget(); + configOverrides.serviceTarget.service = service; + configOverrides.serviceTarget.env = env; + } + if (clusterName != null) { + TracingConfigPoller.ClusterTarget clusterTarget = new TracingConfigPoller.ClusterTarget(); + clusterTarget.clusterName = clusterName; + clusterTarget.enabled = true; + configOverrides.k8sTargetV2 = new TracingConfigPoller.K8sTargetV2(); + configOverrides.k8sTargetV2.clusterTargets = Collections.singletonList(clusterTarget); + } + configOverrides.libConfig = new TracingConfigPoller.LibConfig(); + + assertEquals(expectedPriority, configOverrides.getOverridePriority()); + } + + @Test + void actualConfigCommitWithServiceAndOrgLevelConfigs() throws Exception { + ParsedConfigKey orgKey = ParsedConfigKey.parse("datadog/2/APM_TRACING/org_config/config"); + ParsedConfigKey serviceKey = + ParsedConfigKey.parse("datadog/2/APM_TRACING/service_config/config"); + ConfigurationPoller poller = mock(ConfigurationPoller.class); + SharedCommunicationObjects sco = createScoWithPoller(poller); + + ProductListener[] capturedUpdater = {null}; + doAnswer( + inv -> { + // capture config updater for further testing + capturedUpdater[0] = inv.getArgument(1, ProductListener.class); + return null; + }) + .when(poller) + .addListener(eq(Product.APM_TRACING), any(ProductListener.class)); + + CoreTracer tracer = + CoreTracer.builder().sharedCommunicationObjects(sco).pollForTracingConfiguration().build(); + unclosedTracers.add(tracer); + + try { + verify(poller).addListener(eq(Product.APM_TRACING), any(ProductListener.class)); + assertNotNull(capturedUpdater[0]); + assertEquals(Collections.emptyMap(), tracer.captureTraceConfig().getServiceMapping()); + assertNull(tracer.captureTraceConfig().getTraceSampleRate()); + + ProductListener updater = capturedUpdater[0]; + // Add org level config (priority 1) - should set service mapping + updater.accept( + orgKey, + ("{\n" + + " \"service_target\": {\n" + + " \"service\": \"*\",\n" + + " \"env\": \"*\"\n" + + " },\n" + + " \"lib_config\": {\n" + + " \"tracing_service_mapping\": [{\n" + + " \"from_key\": \"org-service\",\n" + + " \"to_name\": \"org-mapped\"\n" + + " }],\n" + + " \"tracing_sampling_rate\": 0.7\n" + + " }\n" + + "}") + .getBytes(StandardCharsets.UTF_8), + null); + // Add service level config (priority 4) - should override service mapping and add header tags + updater.accept( + serviceKey, + ("{\n" + + " \"service_target\": {\n" + + " \"service\": \"test-service\",\n" + + " \"env\": \"*\"\n" + + " },\n" + + " \"lib_config\": {\n" + + " \"tracing_service_mapping\": [{\n" + + " \"from_key\": \"service-specific\",\n" + + " \"to_name\": \"service-mapped\"\n" + + " }],\n" + + " \"tracing_header_tags\": [{\n" + + " \"header\": \"X-Custom-Header\",\n" + + " \"tag_name\": \"custom.header\"\n" + + " }],\n" + + " \"tracing_sampling_rate\": 1.3,\n" + + " \"data_streams_transaction_extractors\": [{\n" + + " \"name\": \"test\",\n" + + " \"type\": \"unknown\",\n" + + " \"value\": \"value\"\n" + + " }]\n" + + " }\n" + + "}") + .getBytes(StandardCharsets.UTF_8), + null); + // Commit both configs + updater.commit(null); + // Service level config should take precedence due to higher priority (4 vs 1) + assertEquals( + Collections.singletonMap("service-specific", "service-mapped"), + tracer.captureTraceConfig().getServiceMapping()); + assertEquals(1.0, tracer.captureTraceConfig().getTraceSampleRate()); + assertEquals( + Collections.singletonMap("x-custom-header", "custom.header"), + tracer.captureTraceConfig().getRequestHeaderTags()); + assertEquals( + Collections.singletonMap("x-custom-header", "custom.header"), + tracer.captureTraceConfig().getResponseHeaderTags()); + List extractors = + tracer.captureTraceConfig().getDataStreamsTransactionExtractors(); + assertEquals(1, extractors.size()); + assertEquals("test", extractors.get(0).getName()); + assertEquals(DataStreamsTransactionExtractor.Type.UNKNOWN, extractors.get(0).getType()); + assertEquals("value", extractors.get(0).getValue()); + // Remove service level config + updater.remove(serviceKey, null); + updater.commit(null); + // Should fall back to org level config + assertEquals( + Collections.singletonMap("org-service", "org-mapped"), + tracer.captureTraceConfig().getServiceMapping()); + assertEquals(0.7, tracer.captureTraceConfig().getTraceSampleRate()); + assertEquals(Collections.emptyMap(), tracer.captureTraceConfig().getRequestHeaderTags()); + assertEquals(Collections.emptyMap(), tracer.captureTraceConfig().getResponseHeaderTags()); + // Remove org level config + updater.remove(orgKey, null); + updater.commit(null); + // Should have no configs + assertEquals(Collections.emptyMap(), tracer.captureTraceConfig().getServiceMapping()); + assertNull(tracer.captureTraceConfig().getTraceSampleRate()); + } finally { + tracer.close(); + } + } + + @Test + void twoOrgLevelsConfigSettingDifferentFlagsWorks() throws Exception { + ParsedConfigKey orgConfig1Key = + ParsedConfigKey.parse("datadog/2/APM_TRACING/org_config/config1"); + ParsedConfigKey orgConfig2Key = + ParsedConfigKey.parse("datadog/2/APM_TRACING/org_config/config2"); + ConfigurationPoller poller = mock(ConfigurationPoller.class); + SharedCommunicationObjects sco = createScoWithPoller(poller); + + ProductListener[] capturedUpdater = {null}; + doAnswer( + inv -> { + // capture config updater for further testing + capturedUpdater[0] = inv.getArgument(1, ProductListener.class); + return null; + }) + .when(poller) + .addListener(eq(Product.APM_TRACING), any(ProductListener.class)); + + CoreTracer tracer = + CoreTracer.builder().sharedCommunicationObjects(sco).pollForTracingConfiguration().build(); + unclosedTracers.add(tracer); + + try { + verify(poller).addListener(eq(Product.APM_TRACING), any(ProductListener.class)); + assertTrue(tracer.captureTraceConfig().isTraceEnabled()); + assertFalse(tracer.captureTraceConfig().isDataStreamsEnabled()); + + ProductListener updater = capturedUpdater[0]; + // Add org level config with ApmTracing enabled + updater.accept( + orgConfig1Key, + ("{\n" + + " \"service_target\": {\n" + + " \"service\": \"*\",\n" + + " \"env\": \"*\"\n" + + " },\n" + + " \"lib_config\": {\n" + + " \"tracing_enabled\": true\n" + + " }\n" + + "}") + .getBytes(StandardCharsets.UTF_8), + null); + // Add second org level config with DataStreams enabled + updater.accept( + orgConfig2Key, + ("{\n" + + " \"service_target\": {\n" + + " \"service\": \"*\",\n" + + " \"env\": \"*\"\n" + + " },\n" + + " \"lib_config\": {\n" + + " \"data_streams_enabled\": true\n" + + " }\n" + + "}") + .getBytes(StandardCharsets.UTF_8), + null); + // Commit both configs + updater.commit(null); + // Both org level configs should be merged, with data streams enabled + assertTrue(tracer.captureTraceConfig().isTraceEnabled()); + assertTrue(tracer.captureTraceConfig().isDataStreamsEnabled()); + } finally { + tracer.close(); + } + } + + private SharedCommunicationObjects createScoWithPoller(ConfigurationPoller poller) + throws Exception { + SharedCommunicationObjects sco = new SharedCommunicationObjects(); + sco.agentHttpClient = mock(OkHttpClient.class); + sco.monitoring = mock(Monitoring.class); + sco.agentUrl = HttpUrl.get("https://example.com"); + sco.setFeaturesDiscovery(mock(DDAgentFeaturesDiscovery.class)); + Field pollerField = SharedCommunicationObjects.class.getDeclaredField("configurationPoller"); + pollerField.setAccessible(true); + pollerField.set(sco, poller); + return sco; + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/baggage/BaggagePropagatorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/baggage/BaggagePropagatorTest.java new file mode 100644 index 00000000000..56f26321935 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/baggage/BaggagePropagatorTest.java @@ -0,0 +1,269 @@ +package datadog.trace.core.baggage; + +import static datadog.trace.core.baggage.BaggagePropagator.BAGGAGE_KEY; +import static java.util.Collections.singletonMap; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; + +import datadog.context.Context; +import datadog.context.propagation.CarrierSetter; +import datadog.context.propagation.CarrierVisitor; +import datadog.trace.bootstrap.instrumentation.api.Baggage; +import datadog.trace.bootstrap.instrumentation.api.ContextVisitors; +import datadog.trace.test.util.DDJavaSpecification; +import java.util.HashMap; +import java.util.Map; +import java.util.function.BiConsumer; +import javax.annotation.ParametersAreNonnullByDefault; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.tabletest.junit.TableTest; + +class BaggagePropagatorTest extends DDJavaSpecification { + private static final int DEFAULT_TRACE_BAGGAGE_MAX_ITEMS = 64; + private static final int DEFAULT_TRACE_BAGGAGE_MAX_BYTES = 8192; + + private BaggagePropagator propagator; + private CarrierSetter> setter; + private Map carrier; + private Context context; + + @ParametersAreNonnullByDefault + static class MapCarrierAccessor + implements CarrierSetter>, CarrierVisitor> { + @Override + public void set(Map carrier, String key, String value) { + if (carrier != null && key != null && value != null) { + carrier.put(key, value); + } + } + + @Override + public void forEachKeyValue(Map carrier, BiConsumer visitor) { + carrier.forEach(visitor); + } + } + + @BeforeEach + void setup() { + this.propagator = + new BaggagePropagator( + true, true, DEFAULT_TRACE_BAGGAGE_MAX_ITEMS, DEFAULT_TRACE_BAGGAGE_MAX_BYTES); + this.setter = new MapCarrierAccessor(); + this.carrier = new HashMap<>(); + this.context = Context.root(); + } + + @TableTest({ + "scenario | baggageMap | baggageHeader ", + "three entries | [key1: val1, key2: val2, foo: bar] | 'key1=val1,key2=val2,foo=bar' ", + "special chars are URL encoded | ['\",;\\()/:<=>?@[]{}': '\",;\\'] | '%22%2C%3B%5C%28%29%2F%3A%3C%3D%3E%3F%40%5B%5D%7B%7D=%22%2C%3B%5C'", + "single entry | [key1: val1] | 'key1=val1' ", + "two entries | [key1: val1, key2: val2] | 'key1=val1,key2=val2' ", + "space is encoded | [serverNode: 'DF 28'] | 'serverNode=DF%2028' ", + "non ASCII value | [userId: Amélie] | 'userId=Am%C3%A9lie' ", + "parenthesis in key | ['user!d(me)': false] | 'user!d%28me%29=false' ", + "non ASCII heart symbol | [abcdefg: 'hijklmnopq♥'] | 'abcdefg=hijklmnopq%E2%99%A5' " + }) + void testBaggagePropagatorContextInjection(Map baggageMap, String baggageHeader) { + this.context = Baggage.create(baggageMap).storeInto(this.context); + + this.propagator.inject(context, carrier, setter); + + assertEquals(baggageHeader, carrier.get(BAGGAGE_KEY)); + } + + @TableTest({ + "scenario | baggage | baggageHeader ", + "limit not reached | [key1: val1, key2: val2] | 'key1=val1,key2=val2'", + "third entry dropped | [key1: val1, key2: val2, key3: val3] | 'key1=val1,key2=val2'" + }) + void testBaggageInjectItemLimit(Map baggage, String baggageHeader) { + // Creating propagator with test item limit + propagator = new BaggagePropagator(true, true, 2, DEFAULT_TRACE_BAGGAGE_MAX_BYTES); + context = Baggage.create(baggage).storeInto(context); + + this.propagator.inject(context, carrier, setter); + + assertEquals(baggageHeader, carrier.get(BAGGAGE_KEY)); + } + + @TableTest({ + "scenario | baggage | baggageHeader ", + "limit not reached | [key1: val1, key2: val2] | 'key1=val1,key2=val2'", + "third entry exceeds bytes | [key1: val1, key2: val2, key3: val3] | 'key1=val1,key2=val2'", + "single entry exceeds bytes once encoded | [abcdefg: 'hijklmnopq♥'] | '' " + }) + void testBaggageInjectBytesLimit(Map baggage, String baggageHeader) { + // Creating propagator with test bytes limit + propagator = new BaggagePropagator(true, true, DEFAULT_TRACE_BAGGAGE_MAX_ITEMS, 20); + context = Baggage.create(baggage).storeInto(context); + + this.propagator.inject(context, carrier, setter); + + assertEquals(baggageHeader, carrier.get(BAGGAGE_KEY)); + } + + @TableTest({ + "scenario | baggageHeader | baggageMap ", + "three entries | 'key1=val1,key2=val2,foo=bar' | [key1: val1, key2: val2, foo: bar]", + "URL encoded special chars | '%22%2C%3B%5C%28%29%2F%3A%3C%3D%3E%3F%40%5B%5D%7B%7D=%22%2C%3B%5C' | ['\",;\\()/:<=>?@[]{}': '\",;\\'] " + }) + void testTracingPropagatorContextExtractor(String baggageHeader, Map baggageMap) { + Map headers = singletonMap(BAGGAGE_KEY, baggageHeader); + + context = this.propagator.extract(context, headers, ContextVisitors.stringValuesMap()); + + Baggage baggage = Baggage.fromContext(context); + assertNotNull(baggage); + assertEquals(baggageMap, baggage.asMap()); + } + + @Test + void testExtractingNonAsciiHeaders() { + Map headers = singletonMap(BAGGAGE_KEY, "key1=vallée,clé2=value"); + + context = this.propagator.extract(context, headers, ContextVisitors.stringValuesMap()); + Baggage baggage = Baggage.fromContext(context); + + // non-ASCII values data are still accessible as part of the API + assertNotNull(baggage); + assertEquals("vallée", baggage.asMap().get("key1")); + assertEquals("value", baggage.asMap().get("clé2")); + assertNull(baggage.getW3cHeader()); + + this.propagator.inject(Context.root().with(baggage), carrier, setter); + + // baggage are URL encoded if not valid, even if not modified + assertEquals("key1=vall%C3%A9e,cl%C3%A92=value", carrier.get(BAGGAGE_KEY)); + } + + @TableTest({ + "scenario | baggageHeader ", + "no equal sign in first pair | 'no-equal-sign,foo=gets-dropped-because-previous-pair-is-malformed'", + "trailing equals only | 'foo=gets-dropped-because-subsequent-pair-is-malformed,=' ", + "empty key | '=no-key' ", + "empty value | 'no-value=' ", + "empty header | '' ", + "only delimiters | ',,' ", + "single equal sign | '=' " + }) + void extractInvalidBaggageHeaders(String baggageHeader) { + Map headers = singletonMap(BAGGAGE_KEY, baggageHeader); + + context = this.propagator.extract(context, headers, ContextVisitors.stringValuesMap()); + + assertNull(Baggage.fromContext(context)); + } + + @TableTest({ + "scenario | baggageHeader | cachedString ", + "valid header is cached | 'key1=val1,key2=val2,foo=bar' | 'key1=val1,key2=val2,foo=bar'", + "invalid chars => no cache | '\";\\()/:<=>?@[]{}=\";\\' | " + }) + void testBaggageCache(String baggageHeader, String cachedString) { + Map headers = singletonMap(BAGGAGE_KEY, baggageHeader); + + context = this.propagator.extract(context, headers, ContextVisitors.stringValuesMap()); + + Baggage baggage = Baggage.fromContext(context); + assertNotNull(baggage); + assertEquals(cachedString, baggage.getW3cHeader()); + } + + @TableTest({ + "scenario | baggageHeader | cachedString ", + "limit not reached | 'key1=val1,key2=val2' | 'key1=val1,key2=val2'", + "third entry truncates | 'key1=val1,key2=val2,key3=val3' | 'key1=val1,key2=val2'", + "fourth entry truncates | 'key1=val1,key2=val2,key3=val3,key4=val4' | 'key1=val1,key2=val2'" + }) + void testBaggageCacheItemsLimit(String baggageHeader, String cachedString) { + // creating a new instance after injecting config + propagator = new BaggagePropagator(true, true, 2, DEFAULT_TRACE_BAGGAGE_MAX_BYTES); + Map headers = singletonMap(BAGGAGE_KEY, baggageHeader); + + context = this.propagator.extract(context, headers, ContextVisitors.stringValuesMap()); + + Baggage baggage = Baggage.fromContext(context); + assertNotNull(baggage); + assertEquals(cachedString, baggage.getW3cHeader()); + } + + @TableTest({ + "scenario | baggageHeader | cachedString ", + "limit not reached | 'key1=val1,key2=val2' | 'key1=val1,key2=val2'", + "third entry truncates | 'key1=val1,key2=val2,key3=val3' | 'key1=val1,key2=val2'" + }) + void testBaggageCacheBytesLimit(String baggageHeader, String cachedString) { + // Creating propagator with test bytes limit + propagator = new BaggagePropagator(true, true, DEFAULT_TRACE_BAGGAGE_MAX_ITEMS, 20); + Map headers = singletonMap(BAGGAGE_KEY, baggageHeader); + + context = this.propagator.extract(context, headers, ContextVisitors.stringValuesMap()); + + Baggage baggage = Baggage.fromContext(context); + assertNotNull(baggage); + assertEquals(cachedString, baggage.getW3cHeader()); + } + + @TableTest({ + "scenario | baggageHeader | baggageMap ", + "single entry | 'key1=val1' | [key1: val1] ", + "two entries | 'key1=val1,key2=val2' | [key1: val1, key2: val2]", + "third entry dropped | 'key1=val1,key2=val2,key3=val3' | [key1: val1, key2: val2]" + }) + void testBaggageExtractItemsLimit(String baggageHeader, Map baggageMap) { + // Creating propagator with test item limit + propagator = new BaggagePropagator(true, true, 2, DEFAULT_TRACE_BAGGAGE_MAX_BYTES); + Map headers = singletonMap(BAGGAGE_KEY, baggageHeader); + + context = this.propagator.extract(context, headers, ContextVisitors.stringValuesMap()); + + // parsing stops once the item limit is exceeded + Baggage baggage = Baggage.fromContext(context); + assertNotNull(baggage); + assertEquals(baggageMap, baggage.asMap()); + } + + @TableTest({ + "scenario | baggageHeader | baggageMap ", + "single entry | 'key1=val1' | [key1: val1] ", + "two entries | 'key1=val1,key2=val2' | [key1: val1, key2: val2]", + "third entry dropped | 'key1=val1,key2=val2,key3=val3' | [key1: val1, key2: val2]" + }) + void testBaggageExtractBytesLimit(String baggageHeader, Map baggageMap) { + // Creating propagator with test bytes limit + propagator = new BaggagePropagator(true, true, DEFAULT_TRACE_BAGGAGE_MAX_ITEMS, 20); + Map headers = singletonMap(BAGGAGE_KEY, baggageHeader); + + context = this.propagator.extract(context, headers, ContextVisitors.stringValuesMap()); + + // parsing stops once the byte limit is exceeded + Baggage baggage = Baggage.fromContext(context); + assertNotNull(baggage); + assertEquals(baggageMap, baggage.asMap()); + } + + @Test + void testBaggageExtract0ItemLimit() { + // creating a new instance after injecting config + propagator = new BaggagePropagator(true, true, 0, DEFAULT_TRACE_BAGGAGE_MAX_BYTES); + Map headers = singletonMap(BAGGAGE_KEY, "key1=value1"); + + context = this.propagator.extract(context, headers, ContextVisitors.stringValuesMap()); + + assertNull(Baggage.fromContext(context)); + } + + @Test + void testBaggageExtract0ByteLimit() { + // creating a new instance after injecting config + propagator = new BaggagePropagator(true, true, DEFAULT_TRACE_BAGGAGE_MAX_ITEMS, 0); + Map headers = singletonMap(BAGGAGE_KEY, "key1=value1"); + + context = this.propagator.extract(context, headers, ContextVisitors.stringValuesMap()); + + assertNull(Baggage.fromContext(context)); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/datastreams/CheckpointerTest.java b/dd-trace-core/src/test/java/datadog/trace/core/datastreams/CheckpointerTest.java new file mode 100644 index 00000000000..07681335c4c --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/datastreams/CheckpointerTest.java @@ -0,0 +1,64 @@ +package datadog.trace.core.datastreams; + +import static datadog.trace.api.config.GeneralConfig.DATA_STREAMS_ENABLED; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.api.experimental.DataStreamsCheckpointer; +import datadog.trace.api.experimental.DataStreamsContextCarrier; +import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import datadog.trace.core.CoreTracer; +import datadog.trace.core.DDCoreJavaSpecification; +import datadog.trace.core.DDSpan; +import datadog.trace.test.junit.utils.config.WithConfig; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import org.junit.jupiter.api.Test; + +// Enable DSM +@WithConfig(key = DATA_STREAMS_ENABLED, value = "true") +public class CheckpointerTest extends DDCoreJavaSpecification { + @Test + void testSettingProduceAndConsumeCheckpoint() { + // Create a test tracer + CoreTracer tracer = tracerBuilder().build(); + AgentTracer.forceRegister(tracer); + // Get the test checkpointer + DataStreamsCheckpointer checkpointer = tracer.getDataStreamsCheckpointer(); + // Declare the carrier to test injected data + CustomContextCarrier carrier = new CustomContextCarrier(); + // Start and activate a span + AgentSpan span = tracer.buildSpan("test", "dsm-checkpoint").start(); + AgentScope scope = tracer.activateSpan(span); + + // Trigger produce checkpoint + checkpointer.setProduceCheckpoint("kafka", "testTopic", carrier); + checkpointer.setConsumeCheckpoint("kafka", "testTopic", carrier); + // Clean up span + scope.close(); + span.finish(); + + boolean hasPathwayCtxBase64 = + carrier.entries().stream() + .anyMatch(entry -> "dd-pathway-ctx-base64".equals(entry.getKey())); + assertTrue(hasPathwayCtxBase64); + assertNotEquals(0L, ((DDSpan) span).spanContext().getPathwayContext().getHash()); + } + + static class CustomContextCarrier implements DataStreamsContextCarrier { + private final Map data = new HashMap<>(); + + @Override + public Set> entries() { + return data.entrySet(); + } + + @Override + public void set(String key, String value) { + data.put(key, value); + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/datastreams/DataStreamsTransactionExtractorsTest.java b/dd-trace-core/src/test/java/datadog/trace/core/datastreams/DataStreamsTransactionExtractorsTest.java new file mode 100644 index 00000000000..51205505225 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/datastreams/DataStreamsTransactionExtractorsTest.java @@ -0,0 +1,95 @@ +package datadog.trace.core.datastreams; + +import static datadog.trace.api.datastreams.DataStreamsTransactionExtractor.Type.HTTP_IN_HEADERS; +import static datadog.trace.api.datastreams.DataStreamsTransactionExtractor.Type.HTTP_OUT_HEADERS; +import static datadog.trace.api.datastreams.DataStreamsTransactionExtractor.Type.KAFKA_CONSUME_HEADERS; +import static datadog.trace.api.datastreams.DataStreamsTransactionExtractor.Type.KAFKA_PRODUCE_HEADERS; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.api.datastreams.DataStreamsTransactionExtractor; +import datadog.trace.core.DDCoreJavaSpecification; +import java.util.List; +import org.junit.jupiter.api.Test; + +public class DataStreamsTransactionExtractorsTest extends DDCoreJavaSpecification { + @Test + void deserializeFromJson() { + DataStreamsTransactionExtractors list = + DataStreamsTransactionExtractors.deserialize( + "[\n" + + " {\"name\": \"extractor\", \"type\": \"HTTP_OUT_HEADERS\", \"value\": \"transaction_id\"},\n" + + " {\"name\": \"second_extractor\", \"type\": \"HTTP_IN_HEADERS\", \"value\": \"transaction_id\"}\n" + + "]"); + List extractors = list.getExtractors(); + + assertEquals(2, extractors.size()); + assertEquals("extractor", extractors.get(0).getName()); + assertEquals(HTTP_OUT_HEADERS, extractors.get(0).getType()); + assertEquals("transaction_id", extractors.get(0).getValue()); + assertEquals("second_extractor", extractors.get(1).getName()); + assertEquals(HTTP_IN_HEADERS, extractors.get(1).getType()); + assertEquals("transaction_id", extractors.get(1).getValue()); + } + + @Test + void deserializeKafkaTypes() { + DataStreamsTransactionExtractors list = + DataStreamsTransactionExtractors.deserialize( + "[" + + "{\"name\": \"consume\", \"type\": \"KAFKA_CONSUME_HEADERS\", \"value\": \"txn\"}," + + "{\"name\": \"produce\", \"type\": \"KAFKA_PRODUCE_HEADERS\", \"value\": \"txn\"}" + + "]"); + List extractors = list.getExtractors(); + + assertEquals(2, extractors.size()); + assertEquals(KAFKA_CONSUME_HEADERS, extractors.get(0).getType()); + assertEquals(KAFKA_PRODUCE_HEADERS, extractors.get(1).getType()); + } + + @Test + void deserializeUnknownTypeReturnsEmpty() { + DataStreamsTransactionExtractors list = + DataStreamsTransactionExtractors.deserialize( + "[{\"name\": \"ext\", \"type\": \"NOT_A_REAL_TYPE\", \"value\": \"v\"}]"); + + assertSame(DataStreamsTransactionExtractors.EMPTY, list); + assertTrue(list.getExtractors().isEmpty()); + } + + @Test + void deserializeEmptyArrayReturnsEmptyList() { + DataStreamsTransactionExtractors list = DataStreamsTransactionExtractors.deserialize("[]"); + + assertTrue(list.getExtractors().isEmpty()); + } + + @Test + void deserializeInvalidJsonReturnsEmpty() { + DataStreamsTransactionExtractors list = + DataStreamsTransactionExtractors.deserialize("not valid json"); + + assertSame(DataStreamsTransactionExtractors.EMPTY, list); + assertTrue(list.getExtractors().isEmpty()); + } + + @Test + void deserializeNullJsonReturnsEmpty() { + DataStreamsTransactionExtractors list = DataStreamsTransactionExtractors.deserialize("null"); + + assertTrue(list.getExtractors().isEmpty()); + } + + @Test + void implToStringContainsFields() { + DataStreamsTransactionExtractors list = + DataStreamsTransactionExtractors.deserialize( + "[{\"name\": \"myext\", \"type\": \"HTTP_OUT_HEADERS\", \"value\": \"myval\"}]"); + String str = list.getExtractors().get(0).toString(); + + assertTrue(str.contains("myext")); + assertTrue(str.contains("HTTP_OUT_HEADERS")); + assertTrue(str.contains("myval")); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/datastreams/DataStreamsWritingTest.java b/dd-trace-core/src/test/java/datadog/trace/core/datastreams/DataStreamsWritingTest.java new file mode 100644 index 00000000000..35fef530c54 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/datastreams/DataStreamsWritingTest.java @@ -0,0 +1,649 @@ +package datadog.trace.core.datastreams; + +import static datadog.trace.api.config.GeneralConfig.EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED; +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import datadog.communication.ddagent.DDAgentFeaturesDiscovery; +import datadog.communication.ddagent.SharedCommunicationObjects; +import datadog.communication.http.OkHttpUtils; +import datadog.trace.agent.test.server.http.JavaTestHttpServer; +import datadog.trace.api.Config; +import datadog.trace.api.ProcessTags; +import datadog.trace.api.TraceConfig; +import datadog.trace.api.WellKnownTags; +import datadog.trace.api.datastreams.DataStreamsTags; +import datadog.trace.api.datastreams.StatsPoint; +import datadog.trace.api.time.ControllableTimeSource; +import datadog.trace.core.DDCoreJavaSpecification; +import datadog.trace.core.DDTraceCoreInfo; +import datadog.trace.test.junit.utils.config.WithConfigExtension; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.CopyOnWriteArrayList; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okio.BufferedSource; +import okio.GzipSource; +import okio.Okio; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; +import org.msgpack.core.MessagePack; +import org.msgpack.core.MessageUnpacker; + +/** + * This test class exists because a real integration test is not possible. see + * DataStreamsIntegrationTest + */ +public class DataStreamsWritingTest extends DDCoreJavaSpecification { + + private static long defaultBucketDurationNanos; + + private static JavaTestHttpServer server; + private static HttpUrl serverAddress; + private static List requestBodies; + + @BeforeAll + static void startServer() { + defaultBucketDurationNanos = Config.get().getDataStreamsBucketDurationNanoseconds(); + requestBodies = new CopyOnWriteArrayList<>(); + server = + JavaTestHttpServer.httpServer( + s -> + s.handlers( + h -> + h.post( + DDAgentFeaturesDiscovery.V01_DATASTREAMS_ENDPOINT, + api -> { + requestBodies.add(api.getRequest().getBody()); + api.getResponse().status(200).send(); + }))); + serverAddress = HttpUrl.get(server.getAddress()); + } + + @AfterAll + static void stopServer() { + if (server != null) { + server.close(); + } + } + + @BeforeEach + void resetRequestBodies() { + requestBodies.clear(); + } + + private static void awaitOneRequestBody() throws InterruptedException { + long deadline = System.currentTimeMillis() + 2000; + while (requestBodies.size() < 1 && System.currentTimeMillis() < deadline) { + Thread.sleep(20); + } + assertEquals(1, requestBodies.size()); + } + + @Test + void serviceOverridesSplitBuckets() throws InterruptedException, IOException { + WellKnownTags wellKnownTags = + new WellKnownTags( + "runtimeid", "hostname", "test", Config.get().getServiceName(), "version", "java"); + Config fakeConfig = mock(Config.class); + when(fakeConfig.getAgentUrl()).thenReturn(serverAddress.toString()); + when(fakeConfig.getWellKnownTags()).thenReturn(wellKnownTags); + when(fakeConfig.getPrimaryTag()).thenReturn("region-1"); + + OkHttpClient testOkhttpClient = OkHttpUtils.buildHttpClient(serverAddress, 5000L); + DDAgentFeaturesDiscovery features = mock(DDAgentFeaturesDiscovery.class); + when(features.supportsDataStreams()).thenReturn(true); + SharedCommunicationObjects sharedCommObjects = new SharedCommunicationObjects(); + sharedCommObjects.setFeaturesDiscovery(features); + sharedCommObjects.agentHttpClient = testOkhttpClient; + sharedCommObjects.createRemaining(fakeConfig); + + ControllableTimeSource timeSource = new ControllableTimeSource(); + TraceConfig traceConfig = mock(TraceConfig.class); + when(traceConfig.isDataStreamsEnabled()).thenReturn(true); + String serviceNameOverride = "service-name-override"; + + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + fakeConfig, sharedCommObjects, timeSource, () -> traceConfig); + dataStreams.start(); + dataStreams.setThreadServiceName(serviceNameOverride); + dataStreams.add( + new StatsPoint( + DataStreamsTags.create(null, null), + 9, + 0, + 10, + timeSource.getCurrentTimeNanos(), + 0, + 0, + 0, + serviceNameOverride)); + dataStreams.trackBacklog( + DataStreamsTags.createWithPartition("kafka_produce", "testTopic", "1", null, null), 130); + timeSource.advance(defaultBucketDurationNanos); + // force flush + dataStreams.report(); + dataStreams.close(); + dataStreams.clearThreadServiceName(); + + awaitOneRequestBody(); + GzipSource gzipSource = + new GzipSource(Okio.source(new ByteArrayInputStream(requestBodies.get(0)))); + BufferedSource bufferedSource = Okio.buffer(gzipSource); + MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(bufferedSource.inputStream()); + + assertEquals(9, unpacker.unpackMapHeader()); + assertEquals("Env", unpacker.unpackString()); + assertEquals("test", unpacker.unpackString()); + assertEquals("Service", unpacker.unpackString()); + assertEquals(serviceNameOverride, unpacker.unpackString()); + } + + @ParameterizedTest(name = "Write bucket to mock server with process tags enabled {0}") + @ValueSource(booleans = {true, false}) + void writeBucketToMockServer(boolean processTagsEnabled) + throws InterruptedException, IOException { + WithConfigExtension.injectSysConfig( + EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED, Boolean.toString(processTagsEnabled)); + ProcessTags.reset(Config.get()); + + WellKnownTags wellKnownTags = + new WellKnownTags( + "runtimeid", "hostname", "test", Config.get().getServiceName(), "version", "java"); + Config fakeConfig = mock(Config.class); + when(fakeConfig.getAgentUrl()).thenReturn(serverAddress.toString()); + when(fakeConfig.getWellKnownTags()).thenReturn(wellKnownTags); + when(fakeConfig.getPrimaryTag()).thenReturn("region-1"); + + OkHttpClient testOkhttpClient = OkHttpUtils.buildHttpClient(serverAddress, 5000L); + DDAgentFeaturesDiscovery features = mock(DDAgentFeaturesDiscovery.class); + when(features.supportsDataStreams()).thenReturn(true); + SharedCommunicationObjects sharedCommObjects = new SharedCommunicationObjects(); + sharedCommObjects.setFeaturesDiscovery(features); + sharedCommObjects.agentHttpClient = testOkhttpClient; + sharedCommObjects.createRemaining(fakeConfig); + + ControllableTimeSource timeSource = new ControllableTimeSource(); + TraceConfig traceConfig = mock(TraceConfig.class); + when(traceConfig.isDataStreamsEnabled()).thenReturn(true); + + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + fakeConfig, sharedCommObjects, timeSource, () -> traceConfig); + try { + dataStreams.start(); + dataStreams.add( + new StatsPoint( + DataStreamsTags.create(null, null), + 9, + 0, + 10, + timeSource.getCurrentTimeNanos(), + 0, + 0, + 0, + null)); + dataStreams.add( + new StatsPoint( + DataStreamsTags.create( + "testType", DataStreamsTags.Direction.INBOUND, "testTopic", "testGroup", null), + 1, + 2, + 5, + timeSource.getCurrentTimeNanos(), + 0, + 0, + 0, + null)); + dataStreams.trackBacklog( + DataStreamsTags.createWithPartition("kafka_produce", "testTopic", "1", null, null), 100); + dataStreams.trackBacklog( + DataStreamsTags.createWithPartition("kafka_produce", "testTopic", "1", null, null), 130); + timeSource.advance(defaultBucketDurationNanos - 100L); + dataStreams.add( + new StatsPoint( + DataStreamsTags.create( + "testType", DataStreamsTags.Direction.INBOUND, "testTopic", "testGroup", null), + 1, + 2, + 5, + timeSource.getCurrentTimeNanos(), + SECONDS.toNanos(10), + SECONDS.toNanos(10), + 10, + null)); + timeSource.advance(defaultBucketDurationNanos); + dataStreams.add( + new StatsPoint( + DataStreamsTags.create( + "testType", DataStreamsTags.Direction.INBOUND, "testTopic", "testGroup", null), + 1, + 2, + 5, + timeSource.getCurrentTimeNanos(), + SECONDS.toNanos(5), + SECONDS.toNanos(5), + 5, + null)); + dataStreams.add( + new StatsPoint( + DataStreamsTags.create( + "testType", DataStreamsTags.Direction.INBOUND, "testTopic2", "testGroup", null), + 3, + 4, + 6, + timeSource.getCurrentTimeNanos(), + SECONDS.toNanos(2), + 0, + 2, + null)); + timeSource.advance(defaultBucketDurationNanos); + dataStreams.close(); + + awaitOneRequestBody(); + validateMessage(requestBodies.get(0), processTagsEnabled); + } finally { + // cleanup + WithConfigExtension.injectSysConfig(EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED, "true"); + ProcessTags.reset(Config.get()); + } + } + + @Test + void writeKafkaConfigsToMockServer() throws InterruptedException, IOException { + WellKnownTags wellKnownTags = + new WellKnownTags( + "runtimeid", "hostname", "test", Config.get().getServiceName(), "version", "java"); + Config fakeConfig = mock(Config.class); + when(fakeConfig.getAgentUrl()).thenReturn(serverAddress.toString()); + when(fakeConfig.getWellKnownTags()).thenReturn(wellKnownTags); + when(fakeConfig.getPrimaryTag()).thenReturn("region-1"); + + OkHttpClient testOkhttpClient = OkHttpUtils.buildHttpClient(serverAddress, 5000L); + DDAgentFeaturesDiscovery features = mock(DDAgentFeaturesDiscovery.class); + when(features.supportsDataStreams()).thenReturn(true); + SharedCommunicationObjects sharedCommObjects = new SharedCommunicationObjects(); + sharedCommObjects.setFeaturesDiscovery(features); + sharedCommObjects.agentHttpClient = testOkhttpClient; + sharedCommObjects.createRemaining(fakeConfig); + + ControllableTimeSource timeSource = new ControllableTimeSource(); + TraceConfig traceConfig = mock(TraceConfig.class); + when(traceConfig.isDataStreamsEnabled()).thenReturn(true); + + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + fakeConfig, sharedCommObjects, timeSource, () -> traceConfig); + dataStreams.start(); + + // Report a producer and consumer config + Map producerConfig = new HashMap<>(); + producerConfig.put("bootstrap.servers", "localhost:9092"); + producerConfig.put("acks", "all"); + producerConfig.put("linger.ms", "5"); + dataStreams.reportKafkaConfig("kafka_producer", "", "", producerConfig); + + Map consumerConfig = new HashMap<>(); + consumerConfig.put("bootstrap.servers", "localhost:9092"); + consumerConfig.put("group.id", "test-group"); + consumerConfig.put("auto.offset.reset", "earliest"); + dataStreams.reportKafkaConfig("kafka_consumer", "", "test-group", consumerConfig); + + // Also add a stats point so the bucket is not empty of stats + dataStreams.add( + new StatsPoint( + DataStreamsTags.create(null, null), + 9, + 0, + 10, + timeSource.getCurrentTimeNanos(), + 0, + 0, + 0, + null)); + + timeSource.advance(defaultBucketDurationNanos); + dataStreams.close(); + + awaitOneRequestBody(); + validateKafkaConfigMessage(requestBodies.get(0)); + } + + @Test + void duplicateKafkaConfigsAreEachSerializedInPayload() throws InterruptedException, IOException { + WellKnownTags wellKnownTags = + new WellKnownTags( + "runtimeid", "hostname", "test", Config.get().getServiceName(), "version", "java"); + Config fakeConfig = mock(Config.class); + when(fakeConfig.getAgentUrl()).thenReturn(serverAddress.toString()); + when(fakeConfig.getWellKnownTags()).thenReturn(wellKnownTags); + when(fakeConfig.getPrimaryTag()).thenReturn("region-1"); + + OkHttpClient testOkhttpClient = OkHttpUtils.buildHttpClient(serverAddress, 5000L); + DDAgentFeaturesDiscovery features = mock(DDAgentFeaturesDiscovery.class); + when(features.supportsDataStreams()).thenReturn(true); + SharedCommunicationObjects sharedCommObjects = new SharedCommunicationObjects(); + sharedCommObjects.setFeaturesDiscovery(features); + sharedCommObjects.agentHttpClient = testOkhttpClient; + sharedCommObjects.createRemaining(fakeConfig); + + ControllableTimeSource timeSource = new ControllableTimeSource(); + TraceConfig traceConfig = mock(TraceConfig.class); + when(traceConfig.isDataStreamsEnabled()).thenReturn(true); + + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + fakeConfig, sharedCommObjects, timeSource, () -> traceConfig); + dataStreams.start(); + + // Report the same producer config twice — both should be serialized + Map producerConfig = new HashMap<>(); + producerConfig.put("bootstrap.servers", "localhost:9092"); + producerConfig.put("acks", "all"); + dataStreams.reportKafkaConfig("kafka_producer", "", "", producerConfig); + dataStreams.reportKafkaConfig("kafka_producer", "", "", producerConfig); + + // Also add a stats point so the bucket has content + dataStreams.add( + new StatsPoint( + DataStreamsTags.create(null, null), + 9, + 0, + 10, + timeSource.getCurrentTimeNanos(), + 0, + 0, + 0, + null)); + + timeSource.advance(defaultBucketDurationNanos); + dataStreams.close(); + + awaitOneRequestBody(); + validateDuplicateKafkaConfigMessage(requestBodies.get(0)); + } + + private void validateKafkaConfigMessage(byte[] message) throws IOException { + GzipSource gzipSource = new GzipSource(Okio.source(new ByteArrayInputStream(message))); + BufferedSource bufferedSource = Okio.buffer(gzipSource); + MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(bufferedSource.inputStream()); + + // Outer map (same structure as other payloads) + int outerMapSize = unpacker.unpackMapHeader(); + // Skip to Stats array + boolean foundStats = false; + for (int i = 0; i < outerMapSize; i++) { + String key = unpacker.unpackString(); + if ("Stats".equals(key)) { + foundStats = true; + int numBuckets = unpacker.unpackArrayHeader(); + assertTrue(numBuckets >= 1); + + // Parse first bucket + int bucketMapSize = unpacker.unpackMapHeader(); + boolean foundConfigs = false; + for (int j = 0; j < bucketMapSize; j++) { + String bucketKey = unpacker.unpackString(); + if ("Configs".equals(bucketKey)) { + foundConfigs = true; + int numConfigs = unpacker.unpackArrayHeader(); + assertEquals(2, numConfigs); + + // Collect configs in a map keyed by type + Map> configsByType = new HashMap<>(); + for (int n = 0; n < numConfigs; n++) { + assertEquals(4, unpacker.unpackMapHeader()); + assertEquals("Type", unpacker.unpackString()); + String type = unpacker.unpackString(); + assertEquals("KafkaClusterId", unpacker.unpackString()); + unpacker.unpackString(); // skip cluster id value + assertEquals("ConsumerGroup", unpacker.unpackString()); + unpacker.unpackString(); // skip consumer group value + assertEquals("Config", unpacker.unpackString()); + int configSize = unpacker.unpackMapHeader(); + Map configEntries = new HashMap<>(); + for (int c = 0; c < configSize; c++) { + String ck = unpacker.unpackString(); + String cv = unpacker.unpackString(); + configEntries.put(ck, cv); + } + configsByType.put(type, configEntries); + } + + // Verify producer config + assertTrue(configsByType.containsKey("kafka_producer")); + assertEquals( + "localhost:9092", configsByType.get("kafka_producer").get("bootstrap.servers")); + assertEquals("all", configsByType.get("kafka_producer").get("acks")); + assertEquals("5", configsByType.get("kafka_producer").get("linger.ms")); + + // Verify consumer config + assertTrue(configsByType.containsKey("kafka_consumer")); + assertEquals( + "localhost:9092", configsByType.get("kafka_consumer").get("bootstrap.servers")); + assertEquals("test-group", configsByType.get("kafka_consumer").get("group.id")); + assertEquals("earliest", configsByType.get("kafka_consumer").get("auto.offset.reset")); + } else { + unpacker.skipValue(); + } + } + assertTrue(foundConfigs, "Configs field not found in bucket"); + + // Skip remaining buckets + for (int b = 1; b < numBuckets; b++) { + unpacker.skipValue(); + } + } else { + unpacker.skipValue(); + } + } + assertTrue(foundStats, "Stats field not found in payload"); + } + + private void validateDuplicateKafkaConfigMessage(byte[] message) throws IOException { + GzipSource gzipSource = new GzipSource(Okio.source(new ByteArrayInputStream(message))); + BufferedSource bufferedSource = Okio.buffer(gzipSource); + MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(bufferedSource.inputStream()); + + int outerMapSize = unpacker.unpackMapHeader(); + boolean foundStats = false; + for (int i = 0; i < outerMapSize; i++) { + String key = unpacker.unpackString(); + if ("Stats".equals(key)) { + foundStats = true; + int numBuckets = unpacker.unpackArrayHeader(); + assertTrue(numBuckets >= 1); + + // Parse first bucket + int bucketMapSize = unpacker.unpackMapHeader(); + boolean foundConfigs = false; + for (int j = 0; j < bucketMapSize; j++) { + String bucketKey = unpacker.unpackString(); + if ("Configs".equals(bucketKey)) { + foundConfigs = true; + int numConfigs = unpacker.unpackArrayHeader(); + // Both configs should be present (no deduplication) + assertEquals(2, numConfigs); + + for (int n = 0; n < numConfigs; n++) { + assertEquals(4, unpacker.unpackMapHeader()); + assertEquals("Type", unpacker.unpackString()); + assertEquals("kafka_producer", unpacker.unpackString()); + assertEquals("KafkaClusterId", unpacker.unpackString()); + unpacker.unpackString(); // skip cluster id value + assertEquals("ConsumerGroup", unpacker.unpackString()); + unpacker.unpackString(); // skip consumer group value + assertEquals("Config", unpacker.unpackString()); + int configSize = unpacker.unpackMapHeader(); + Map configEntries = new HashMap<>(); + for (int c = 0; c < configSize; c++) { + String ck = unpacker.unpackString(); + String cv = unpacker.unpackString(); + configEntries.put(ck, cv); + } + assertEquals("localhost:9092", configEntries.get("bootstrap.servers")); + assertEquals("all", configEntries.get("acks")); + } + } else { + unpacker.skipValue(); + } + } + assertTrue(foundConfigs, "Configs field not found in bucket"); + + for (int b = 1; b < numBuckets; b++) { + unpacker.skipValue(); + } + } else { + unpacker.skipValue(); + } + } + assertTrue(foundStats, "Stats field not found in payload"); + } + + private void validateMessage(byte[] message, boolean processTagsEnabled) throws IOException { + GzipSource gzipSource = new GzipSource(Okio.source(new ByteArrayInputStream(message))); + BufferedSource bufferedSource = Okio.buffer(gzipSource); + MessageUnpacker unpacker = MessagePack.newDefaultUnpacker(bufferedSource.inputStream()); + + assertEquals(8 + (processTagsEnabled ? 1 : 0), unpacker.unpackMapHeader()); + assertEquals("Env", unpacker.unpackString()); + assertEquals("test", unpacker.unpackString()); + assertEquals("Service", unpacker.unpackString()); + assertEquals(Config.get().getServiceName(), unpacker.unpackString()); + assertEquals("Lang", unpacker.unpackString()); + assertEquals("java", unpacker.unpackString()); + assertEquals("PrimaryTag", unpacker.unpackString()); + assertEquals("region-1", unpacker.unpackString()); + assertEquals("TracerVersion", unpacker.unpackString()); + assertEquals(DDTraceCoreInfo.VERSION, unpacker.unpackString()); + assertEquals("Version", unpacker.unpackString()); + assertEquals("version", unpacker.unpackString()); + assertEquals("Stats", unpacker.unpackString()); + assertEquals(2, unpacker.unpackArrayHeader()); // 2 time buckets + + // FIRST BUCKET + assertEquals(4, unpacker.unpackMapHeader()); + assertEquals("Start", unpacker.unpackString()); + unpacker.skipValue(); + assertEquals("Duration", unpacker.unpackString()); + assertEquals(defaultBucketDurationNanos, unpacker.unpackLong()); + assertEquals("Stats", unpacker.unpackString()); + assertEquals(2, unpacker.unpackArrayHeader()); // 2 groups in first bucket + + // we don't know the order the groups will be reported + Set availableSizes = new HashSet<>(); + availableSizes.add(5); + availableSizes.add(6); + for (int g = 0; g < 2; g++) { + int mapHeaderSize = unpacker.unpackMapHeader(); + assertTrue(availableSizes.remove(mapHeaderSize)); + if (mapHeaderSize == 5) { + // empty topic group + assertEquals("PathwayLatency", unpacker.unpackString()); + unpacker.skipValue(); + assertEquals("EdgeLatency", unpacker.unpackString()); + unpacker.skipValue(); + assertEquals("PayloadSize", unpacker.unpackString()); + unpacker.skipValue(); + assertEquals("Hash", unpacker.unpackString()); + assertEquals(9L, unpacker.unpackLong()); + assertEquals("ParentHash", unpacker.unpackString()); + assertEquals(0L, unpacker.unpackLong()); + } else { + // other group + assertEquals("PathwayLatency", unpacker.unpackString()); + unpacker.skipValue(); + assertEquals("EdgeLatency", unpacker.unpackString()); + unpacker.skipValue(); + assertEquals("PayloadSize", unpacker.unpackString()); + unpacker.skipValue(); + assertEquals("Hash", unpacker.unpackString()); + assertEquals(1L, unpacker.unpackLong()); + assertEquals("ParentHash", unpacker.unpackString()); + assertEquals(2L, unpacker.unpackLong()); + assertEquals("EdgeTags", unpacker.unpackString()); + assertEquals(4, unpacker.unpackArrayHeader()); + assertEquals("direction:in", unpacker.unpackString()); + assertEquals("topic:testTopic", unpacker.unpackString()); + assertEquals("type:testType", unpacker.unpackString()); + assertEquals("group:testGroup", unpacker.unpackString()); + } + } + + // Kafka stats + assertEquals("Backlogs", unpacker.unpackString()); + assertEquals(1, unpacker.unpackArrayHeader()); + assertEquals(2, unpacker.unpackMapHeader()); + assertEquals("Tags", unpacker.unpackString()); + assertEquals(3, unpacker.unpackArrayHeader()); + assertEquals("topic:testTopic", unpacker.unpackString()); + assertEquals("type:kafka_produce", unpacker.unpackString()); + assertEquals("partition:1", unpacker.unpackString()); + assertEquals("Value", unpacker.unpackString()); + assertEquals(130L, unpacker.unpackLong()); + + // SECOND BUCKET + assertEquals(3, unpacker.unpackMapHeader()); + assertEquals("Start", unpacker.unpackString()); + unpacker.skipValue(); + assertEquals("Duration", unpacker.unpackString()); + assertEquals(defaultBucketDurationNanos, unpacker.unpackLong()); + assertEquals("Stats", unpacker.unpackString()); + assertEquals(2, unpacker.unpackArrayHeader()); // 2 groups in second bucket + + // we don't know the order the groups will be reported + Set availableHashes = new HashSet<>(); + availableHashes.add(1L); + availableHashes.add(3L); + for (int g = 0; g < 2; g++) { + assertEquals(6, unpacker.unpackMapHeader()); + assertEquals("PathwayLatency", unpacker.unpackString()); + unpacker.skipValue(); + assertEquals("EdgeLatency", unpacker.unpackString()); + unpacker.skipValue(); + assertEquals("PayloadSize", unpacker.unpackString()); + unpacker.skipValue(); + assertEquals("Hash", unpacker.unpackString()); + long hash = unpacker.unpackLong(); + assertTrue(availableHashes.remove(hash)); + assertEquals("ParentHash", unpacker.unpackString()); + assertEquals(hash == 1L ? 2L : 4L, unpacker.unpackLong()); + assertEquals("EdgeTags", unpacker.unpackString()); + assertEquals(4, unpacker.unpackArrayHeader()); + assertEquals("direction:in", unpacker.unpackString()); + assertEquals(hash == 1L ? "topic:testTopic" : "topic:testTopic2", unpacker.unpackString()); + assertEquals("type:testType", unpacker.unpackString()); + assertEquals("group:testGroup", unpacker.unpackString()); + } + + assertEquals("ProductMask", unpacker.unpackString()); + assertEquals(1L, unpacker.unpackLong()); + + List processTags = ProcessTags.getTagsAsStringList(); + if (processTags == null) { + assertFalse(unpacker.hasNext()); + } else { + assertTrue(unpacker.hasNext()); + assertEquals("ProcessTags", unpacker.unpackString()); + assertEquals(processTags.size(), unpacker.unpackArrayHeader()); + for (String tag : processTags) { + assertEquals(tag, unpacker.unpackString()); + } + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/datastreams/DefaultDataStreamsMonitoringTest.java b/dd-trace-core/src/test/java/datadog/trace/core/datastreams/DefaultDataStreamsMonitoringTest.java new file mode 100644 index 00000000000..6648e1a8c36 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/datastreams/DefaultDataStreamsMonitoringTest.java @@ -0,0 +1,1643 @@ +package datadog.trace.core.datastreams; + +import static datadog.trace.core.datastreams.DefaultDataStreamsMonitoring.FEATURE_CHECK_INTERVAL_NANOS; +import static datadog.trace.core.datastreams.DefaultDataStreamsMonitoringTestBridge.getThreadState; +import static datadog.trace.core.datastreams.DefaultDataStreamsMonitoringTestBridge.isInboxEmpty; +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.RETURNS_SMART_NULLS; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import datadog.communication.ddagent.DDAgentFeaturesDiscovery; +import datadog.metrics.api.Histograms; +import datadog.metrics.impl.DDSketchHistograms; +import datadog.trace.api.Config; +import datadog.trace.api.DDTags; +import datadog.trace.api.TraceConfig; +import datadog.trace.api.datastreams.DataStreamsContext; +import datadog.trace.api.datastreams.DataStreamsTags; +import datadog.trace.api.datastreams.KafkaConfigReport; +import datadog.trace.api.datastreams.PathwayContext; +import datadog.trace.api.datastreams.SchemaRegistryUsage; +import datadog.trace.api.datastreams.StatsPoint; +import datadog.trace.api.experimental.DataStreamsContextCarrier; +import datadog.trace.api.time.ControllableTimeSource; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext; +import datadog.trace.common.metrics.EventListener; +import datadog.trace.common.metrics.Sink; +import datadog.trace.core.DDCoreJavaSpecification; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.tabletest.junit.TableTest; + +public class DefaultDataStreamsMonitoringTest extends DDCoreJavaSpecification { + + private static final long DEFAULT_BUCKET_DURATION_NANOS = + Config.get().getDataStreamsBucketDurationNanoseconds(); + + @BeforeAll + static void registerHistograms() { + Histograms.register(DDSketchHistograms.FACTORY); + } + + private static void awaitIdle(DefaultDataStreamsMonitoring dataStreams) + throws InterruptedException { + long deadline = System.currentTimeMillis() + 1000; + while (System.currentTimeMillis() < deadline) { + if (isInboxEmpty(dataStreams) && getThreadState(dataStreams) != Thread.State.RUNNABLE) { + return; + } + Thread.sleep(10); + } + assertTrue(isInboxEmpty(dataStreams)); + assertNotEquals(Thread.State.RUNNABLE, getThreadState(dataStreams)); + } + + private static void awaitBuckets( + DefaultDataStreamsMonitoring dataStreams, CapturingPayloadWriter writer, int expectedBuckets) + throws InterruptedException { + long deadline = System.currentTimeMillis() + 1000; + while (System.currentTimeMillis() < deadline) { + if (writer.buckets.size() == expectedBuckets + && isInboxEmpty(dataStreams) + && getThreadState(dataStreams) != Thread.State.RUNNABLE) { + return; + } + Thread.sleep(10); + } + assertTrue(isInboxEmpty(dataStreams)); + assertNotEquals(Thread.State.RUNNABLE, getThreadState(dataStreams)); + assertEquals(expectedBuckets, writer.buckets.size()); + } + + private static DDAgentFeaturesDiscovery stubFeatures(boolean supportsDataStreams) { + DDAgentFeaturesDiscovery features = mock(DDAgentFeaturesDiscovery.class, RETURNS_SMART_NULLS); + when(features.supportsDataStreams()).thenReturn(supportsDataStreams); + return features; + } + + private static TraceConfig stubTraceConfig(boolean dataStreamsEnabled) { + TraceConfig traceConfig = mock(TraceConfig.class, RETURNS_SMART_NULLS); + when(traceConfig.isDataStreamsEnabled()).thenReturn(dataStreamsEnabled); + return traceConfig; + } + + @TableTest({ + "scenario | enabledAtAgent | enabledInConfig", + "agent off, config on | false | true ", + "agent on, config off | true | false ", + "both off | false | false " + }) + void noPayloadsWrittenIfDataStreamsNotSupportedOrNotEnabled( + boolean enabledAtAgent, boolean enabledInConfig) throws InterruptedException { + DDAgentFeaturesDiscovery features = stubFeatures(enabledAtAgent); + ControllableTimeSource timeSource = new ControllableTimeSource(); + DatastreamsPayloadWriter payloadWriter = mock(DatastreamsPayloadWriter.class); + Sink sink = mock(Sink.class); + TraceConfig traceConfig = stubTraceConfig(enabledInConfig); + + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> traceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.start(); + dataStreams.add( + new StatsPoint( + DataStreamsTags.create("testType", null, "testTopic", "testGroup", null), + 0, + 0, + 0, + timeSource.getCurrentTimeNanos(), + 0, + 0, + 0, + null)); + dataStreams.report(); + + awaitIdle(dataStreams); + verify(payloadWriter, org.mockito.Mockito.never()).writePayload(any(), any()); + + // cleanup + dataStreams.close(); + } + + @Test + void schemaSamplerSamplesWithCorrectWeights() { + DDAgentFeaturesDiscovery features = stubFeatures(true); + ControllableTimeSource timeSource = new ControllableTimeSource(); + timeSource.set(1000000000000L); + DatastreamsPayloadWriter payloadWriter = mock(DatastreamsPayloadWriter.class); + Sink sink = mock(Sink.class); + TraceConfig traceConfig = stubTraceConfig(true); + + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> traceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + + // the first received schema is sampled, with a weight of one. + assertTrue(dataStreams.canSampleSchema("schema1")); + assertEquals(1, dataStreams.trySampleSchema("schema1")); + // the sampling is done by topic, so a schema on a different topic will also be sampled at once, + // also with a weight of one. + assertTrue(dataStreams.canSampleSchema("schema2")); + assertEquals(1, dataStreams.trySampleSchema("schema2")); + // no time has passed from the last sampling, so the same schema is not sampled again (two times + // in a row). + assertFalse(dataStreams.canSampleSchema("schema1")); + assertFalse(dataStreams.canSampleSchema("schema1")); + timeSource.advance((long) (30 * 1e9)); + // now, 30 seconds have passed, so the schema is sampled again, with a weight of 3 (so it + // includes the two times the schema was not sampled). + assertTrue(dataStreams.canSampleSchema("schema1")); + assertEquals(3, dataStreams.trySampleSchema("schema1")); + } + + @Test + void contextCarrierAdapterTest() { + CustomContextCarrier carrier = new CustomContextCarrier(); + String keyName = "keyName"; + String keyValue = "keyValue"; + String[] extracted = new String[] {""}; + + DataStreamsContextCarrierAdapter.INSTANCE.set(carrier, keyName, keyValue); + DataStreamsContextCarrierAdapter.INSTANCE.forEachKeyValue( + carrier, + (key, value) -> { + if (keyName.equals(key)) { + extracted[0] = value; + } + }); + + assertEquals(keyValue, extracted[0]); + } + + @Test + void writeGroupAfterADelay() throws InterruptedException { + DDAgentFeaturesDiscovery features = stubFeatures(true); + ControllableTimeSource timeSource = new ControllableTimeSource(); + Sink sink = mock(Sink.class); + CapturingPayloadWriter payloadWriter = new CapturingPayloadWriter(); + TraceConfig traceConfig = stubTraceConfig(true); + + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> traceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.start(); + DataStreamsTags tags = DataStreamsTags.create("testType", null, "testTopic", "testGroup", null); + dataStreams.add(new StatsPoint(tags, 1, 2, 3, timeSource.getCurrentTimeNanos(), 0, 0, 0, null)); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + awaitBuckets(dataStreams, payloadWriter, 1); + + StatsBucket bucket = payloadWriter.buckets.get(0); + assertEquals(1, bucket.getGroups().size()); + StatsGroup group = bucket.getGroups().iterator().next(); + assertEquals("type:testType", group.getTags().getType()); + assertEquals("group:testGroup", group.getTags().getGroup()); + assertEquals("topic:testTopic", group.getTags().getTopic()); + assertEquals(3, group.getTags().nonNullSize()); + assertEquals(1L, group.getHash()); + assertEquals(2L, group.getParentHash()); + + // cleanup + payloadWriter.close(); + dataStreams.close(); + } + + // This test relies on automatic reporting instead of manually calling report + @Test + void slowWriteGroupAfterADelay() throws InterruptedException { + DDAgentFeaturesDiscovery features = stubFeatures(true); + ControllableTimeSource timeSource = new ControllableTimeSource(); + Sink sink = mock(Sink.class); + CapturingPayloadWriter payloadWriter = new CapturingPayloadWriter(); + long bucketDuration = TimeUnit.MILLISECONDS.toNanos(200); + TraceConfig traceConfig = stubTraceConfig(true); + + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, features, timeSource, () -> traceConfig, payloadWriter, bucketDuration); + dataStreams.start(); + DataStreamsTags tags = DataStreamsTags.create("testType", null, "testTopic", "testGroup", null); + dataStreams.add(new StatsPoint(tags, 1, 2, 3, timeSource.getCurrentTimeNanos(), 0, 0, 0, null)); + timeSource.advance(bucketDuration); + + awaitBuckets(dataStreams, payloadWriter, 1); + + StatsBucket bucket = payloadWriter.buckets.get(0); + assertEquals(1, bucket.getGroups().size()); + StatsGroup group = bucket.getGroups().iterator().next(); + assertEquals("type:testType", group.getTags().getType()); + assertEquals("group:testGroup", group.getTags().getGroup()); + assertEquals("topic:testTopic", group.getTags().getTopic()); + assertEquals(3, group.getTags().nonNullSize()); + assertEquals(1L, group.getHash()); + assertEquals(2L, group.getParentHash()); + + // cleanup + payloadWriter.close(); + dataStreams.close(); + } + + @Test + void groupsForCurrentBucketAreNotReported() throws InterruptedException { + DDAgentFeaturesDiscovery features = stubFeatures(true); + ControllableTimeSource timeSource = new ControllableTimeSource(); + Sink sink = mock(Sink.class); + CapturingPayloadWriter payloadWriter = new CapturingPayloadWriter(); + TraceConfig traceConfig = stubTraceConfig(true); + + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> traceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.start(); + DataStreamsTags tags = DataStreamsTags.create("testType", null, "testTopic", "testGroup", null); + dataStreams.add(new StatsPoint(tags, 1, 2, 3, timeSource.getCurrentTimeNanos(), 0, 0, 0, null)); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.add(new StatsPoint(tags, 3, 4, 3, timeSource.getCurrentTimeNanos(), 0, 0, 0, null)); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS - 100L); + dataStreams.report(); + + awaitBuckets(dataStreams, payloadWriter, 1); + + StatsBucket bucket = payloadWriter.buckets.get(0); + assertEquals(1, bucket.getGroups().size()); + StatsGroup group = bucket.getGroups().iterator().next(); + assertEquals("type:testType", group.getTags().getType()); + assertEquals("group:testGroup", group.getTags().getGroup()); + assertEquals("topic:testTopic", group.getTags().getTopic()); + assertEquals(3, group.getTags().nonNullSize()); + assertEquals(1L, group.getHash()); + assertEquals(2L, group.getParentHash()); + + // cleanup + payloadWriter.close(); + dataStreams.close(); + } + + @Test + void allGroupsWrittenInClose() throws InterruptedException { + DDAgentFeaturesDiscovery features = stubFeatures(true); + ControllableTimeSource timeSource = new ControllableTimeSource(); + Sink sink = mock(Sink.class); + CapturingPayloadWriter payloadWriter = new CapturingPayloadWriter(); + TraceConfig traceConfig = stubTraceConfig(true); + + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> traceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.start(); + DataStreamsTags tags1 = + DataStreamsTags.create("testType", null, "testTopic", "testGroup", null); + DataStreamsTags tags2 = + DataStreamsTags.create("testType", null, "testTopic2", "testGroup", null); + dataStreams.add( + new StatsPoint(tags1, 1, 2, 5, timeSource.getCurrentTimeNanos(), 0, 0, 0, null)); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.add( + new StatsPoint(tags2, 3, 4, 6, timeSource.getCurrentTimeNanos(), 0, 0, 0, null)); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS - 100L); + dataStreams.close(); + + awaitBuckets(dataStreams, payloadWriter, 2); + + StatsBucket bucket0 = payloadWriter.buckets.get(0); + assertEquals(1, bucket0.getGroups().size()); + StatsGroup group0 = bucket0.getGroups().iterator().next(); + assertEquals("type:testType", group0.getTags().getType()); + assertEquals("group:testGroup", group0.getTags().getGroup()); + assertEquals("topic:testTopic", group0.getTags().getTopic()); + assertEquals(3, group0.getTags().nonNullSize()); + assertEquals(1L, group0.getHash()); + assertEquals(2L, group0.getParentHash()); + + StatsBucket bucket1 = payloadWriter.buckets.get(1); + assertEquals(1, bucket1.getGroups().size()); + StatsGroup group1 = bucket1.getGroups().iterator().next(); + assertEquals("type:testType", group1.getTags().getType()); + assertEquals("group:testGroup", group1.getTags().getGroup()); + assertEquals("topic:testTopic2", group1.getTags().getTopic()); + assertEquals(3, group1.getTags().nonNullSize()); + assertEquals(3L, group1.getHash()); + assertEquals(4L, group1.getParentHash()); + + // cleanup + payloadWriter.close(); + } + + @Test + void kafkaOffsetsAreTracked() throws InterruptedException { + DDAgentFeaturesDiscovery features = stubFeatures(true); + ControllableTimeSource timeSource = new ControllableTimeSource(); + Sink sink = mock(Sink.class); + CapturingPayloadWriter payloadWriter = new CapturingPayloadWriter(); + TraceConfig traceConfig = stubTraceConfig(true); + + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> traceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.start(); + dataStreams.trackBacklog( + DataStreamsTags.createWithPartition("kafka_commit", "testTopic", "2", null, "testGroup"), + 23); + dataStreams.trackBacklog( + DataStreamsTags.createWithPartition("kafka_commit", "testTopic", "2", null, "testGroup"), + 24); + dataStreams.trackBacklog( + DataStreamsTags.createWithPartition("kafka_produce", "testTopic", "2", null, null), 23); + dataStreams.trackBacklog( + DataStreamsTags.createWithPartition("kafka_produce", "testTopic2", "2", null, null), 23); + dataStreams.trackBacklog( + DataStreamsTags.createWithPartition("kafka_produce", "testTopic", "2", null, null), 45); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + awaitBuckets(dataStreams, payloadWriter, 1); + + StatsBucket bucket = payloadWriter.buckets.get(0); + Collection> backlogs = bucket.getBacklogs(); + assertEquals(3, backlogs.size()); + List> sortedBacklogs = new ArrayList<>(backlogs); + sortedBacklogs.sort(Comparator.comparing(e -> e.getKey().toString())); + assertEquals( + DataStreamsTags.createWithPartition("kafka_commit", "testTopic", "2", null, "testGroup"), + sortedBacklogs.get(0).getKey()); + assertEquals(24L, sortedBacklogs.get(0).getValue()); + assertEquals( + DataStreamsTags.createWithPartition("kafka_produce", "testTopic", "2", null, null), + sortedBacklogs.get(1).getKey()); + assertEquals(45L, sortedBacklogs.get(1).getValue()); + assertEquals( + DataStreamsTags.createWithPartition("kafka_produce", "testTopic2", "2", null, null), + sortedBacklogs.get(2).getKey()); + assertEquals(23L, sortedBacklogs.get(2).getValue()); + + // cleanup + payloadWriter.close(); + dataStreams.close(); + } + + @Test + void groupsFromMultipleBucketsAreReported() throws InterruptedException { + DDAgentFeaturesDiscovery features = stubFeatures(true); + ControllableTimeSource timeSource = new ControllableTimeSource(); + Sink sink = mock(Sink.class); + CapturingPayloadWriter payloadWriter = new CapturingPayloadWriter(); + TraceConfig traceConfig = stubTraceConfig(true); + + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> traceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.start(); + DataStreamsTags tags1 = + DataStreamsTags.create("testType", null, "testTopic", "testGroup", null); + dataStreams.add( + new StatsPoint(tags1, 1, 2, 5, timeSource.getCurrentTimeNanos(), 0, 0, 0, null)); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS * 10); + DataStreamsTags tags2 = + DataStreamsTags.create("testType", null, "testTopic2", "testGroup", null); + dataStreams.add( + new StatsPoint(tags2, 3, 4, 6, timeSource.getCurrentTimeNanos(), 0, 0, 0, null)); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + awaitBuckets(dataStreams, payloadWriter, 2); + + StatsBucket bucket0 = payloadWriter.buckets.get(0); + assertEquals(1, bucket0.getGroups().size()); + StatsGroup group0 = bucket0.getGroups().iterator().next(); + assertEquals(3, group0.getTags().nonNullSize()); + assertEquals("type:testType", group0.getTags().getType()); + assertEquals("group:testGroup", group0.getTags().getGroup()); + assertEquals("topic:testTopic", group0.getTags().getTopic()); + assertEquals(1L, group0.getHash()); + assertEquals(2L, group0.getParentHash()); + + StatsBucket bucket1 = payloadWriter.buckets.get(1); + assertEquals(1, bucket1.getGroups().size()); + StatsGroup group1 = bucket1.getGroups().iterator().next(); + assertEquals("type:testType", group1.getTags().getType()); + assertEquals("group:testGroup", group1.getTags().getGroup()); + assertEquals("topic:testTopic2", group1.getTags().getTopic()); + assertEquals(3, group1.getTags().nonNullSize()); + assertEquals(3L, group1.getHash()); + assertEquals(4L, group1.getParentHash()); + + // cleanup + payloadWriter.close(); + dataStreams.close(); + } + + @Test + void multiplePointsAreCorrectlyGroupedInMultipleBuckets() throws InterruptedException { + DDAgentFeaturesDiscovery features = stubFeatures(true); + ControllableTimeSource timeSource = new ControllableTimeSource(); + Sink sink = mock(Sink.class); + CapturingPayloadWriter payloadWriter = new CapturingPayloadWriter(); + TraceConfig traceConfig = stubTraceConfig(true); + + DataStreamsTags tags = DataStreamsTags.create("testType", null, "testTopic", "testGroup", null); + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> traceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.start(); + dataStreams.add(new StatsPoint(tags, 1, 2, 1, timeSource.getCurrentTimeNanos(), 0, 0, 0, null)); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS - 100L); + dataStreams.add( + new StatsPoint( + tags, + 1, + 2, + 1, + timeSource.getCurrentTimeNanos(), + SECONDS.toNanos(10), + SECONDS.toNanos(10), + 10, + null)); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.add( + new StatsPoint( + tags, + 1, + 2, + 1, + timeSource.getCurrentTimeNanos(), + SECONDS.toNanos(5), + SECONDS.toNanos(5), + 5, + null)); + dataStreams.add( + new StatsPoint( + tags, 3, 4, 5, timeSource.getCurrentTimeNanos(), SECONDS.toNanos(2), 0, 0, null)); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + awaitBuckets(dataStreams, payloadWriter, 2); + + StatsBucket bucket0 = payloadWriter.buckets.get(0); + assertEquals(1, bucket0.getGroups().size()); + StatsGroup group0 = bucket0.getGroups().iterator().next(); + assertEquals("type:testType", group0.getTags().getType()); + assertEquals("group:testGroup", group0.getTags().getGroup()); + assertEquals("topic:testTopic", group0.getTags().getTopic()); + assertEquals(3, group0.getTags().nonNullSize()); + assertEquals(1L, group0.getHash()); + assertEquals(2L, group0.getParentHash()); + assertTrue(Math.abs((group0.getPathwayLatency().getMaxValue() - 10) / 10) < 0.01); + + StatsBucket bucket1 = payloadWriter.buckets.get(1); + assertEquals(2, bucket1.getGroups().size()); + List sortedGroups = new ArrayList<>(bucket1.getGroups()); + sortedGroups.sort(Comparator.comparingLong(StatsGroup::getHash)); + + StatsGroup sortedGroup0 = sortedGroups.get(0); + assertEquals(1L, sortedGroup0.getHash()); + assertEquals(2L, sortedGroup0.getParentHash()); + assertEquals("type:testType", sortedGroup0.getTags().getType()); + assertEquals("group:testGroup", sortedGroup0.getTags().getGroup()); + assertEquals("topic:testTopic", sortedGroup0.getTags().getTopic()); + assertEquals(3, sortedGroup0.getTags().nonNullSize()); + assertTrue(Math.abs((sortedGroup0.getPathwayLatency().getMaxValue() - 5) / 5) < 0.01); + + StatsGroup sortedGroup1 = sortedGroups.get(1); + assertEquals(3L, sortedGroup1.getHash()); + assertEquals(4L, sortedGroup1.getParentHash()); + assertEquals("type:testType", sortedGroup1.getTags().getType()); + assertEquals("group:testGroup", sortedGroup1.getTags().getGroup()); + assertEquals("topic:testTopic", sortedGroup1.getTags().getTopic()); + assertEquals(3, sortedGroup1.getTags().nonNullSize()); + assertTrue(Math.abs((sortedGroup1.getPathwayLatency().getMaxValue() - 2) / 2) < 0.01); + + // cleanup + payloadWriter.close(); + dataStreams.close(); + } + + @Test + void featureUpgrade() throws InterruptedException { + boolean[] supportsDataStreaming = new boolean[] {false}; + DDAgentFeaturesDiscovery features = mock(DDAgentFeaturesDiscovery.class, RETURNS_SMART_NULLS); + when(features.supportsDataStreams()).thenAnswer(invocation -> supportsDataStreaming[0]); + + ControllableTimeSource timeSource = new ControllableTimeSource(); + Sink sink = mock(Sink.class); + CapturingPayloadWriter payloadWriter = new CapturingPayloadWriter(); + TraceConfig traceConfig = stubTraceConfig(true); + + // reporting points when data streams is not supported + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> traceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.start(); + DataStreamsTags tags = DataStreamsTags.create("testType", null, "testTopic", "testGroup", null); + dataStreams.add(new StatsPoint(tags, 1, 2, 3, timeSource.getCurrentTimeNanos(), 0, 0, 0, null)); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + // no buckets are reported + awaitIdle(dataStreams); + assertTrue(payloadWriter.buckets.isEmpty()); + + // report called multiple times without advancing past check interval + dataStreams.report(); + dataStreams.report(); + dataStreams.report(); + + // features are not rechecked + awaitIdle(dataStreams); + verify(features, org.mockito.Mockito.never()).discover(); + assertTrue(payloadWriter.buckets.isEmpty()); + + // submitting points after an upgrade + supportsDataStreaming[0] = true; + timeSource.advance(FEATURE_CHECK_INTERVAL_NANOS); + dataStreams.report(); + + dataStreams.add(new StatsPoint(tags, 1, 2, 3, timeSource.getCurrentTimeNanos(), 0, 0, 0, null)); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + // points are now reported + awaitBuckets(dataStreams, payloadWriter, 1); + + StatsBucket bucket = payloadWriter.buckets.get(0); + assertEquals(1, bucket.getGroups().size()); + StatsGroup group = bucket.getGroups().iterator().next(); + assertEquals("type:testType", group.getTags().getType()); + assertEquals("group:testGroup", group.getTags().getGroup()); + assertEquals("topic:testTopic", group.getTags().getTopic()); + assertEquals(3, group.getTags().nonNullSize()); + assertEquals(1L, group.getHash()); + assertEquals(2L, group.getParentHash()); + + // cleanup + payloadWriter.close(); + dataStreams.close(); + } + + @Test + void featureDowngradeThenUpgrade() throws InterruptedException { + boolean[] supportsDataStreaming = new boolean[] {true}; + DDAgentFeaturesDiscovery features = mock(DDAgentFeaturesDiscovery.class, RETURNS_SMART_NULLS); + when(features.supportsDataStreams()).thenAnswer(invocation -> supportsDataStreaming[0]); + + ControllableTimeSource timeSource = new ControllableTimeSource(); + Sink sink = mock(Sink.class); + CapturingPayloadWriter payloadWriter = new CapturingPayloadWriter(); + TraceConfig traceConfig = stubTraceConfig(true); + + // reporting points after a downgrade + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> traceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.start(); + supportsDataStreaming[0] = false; + dataStreams.onEvent(EventListener.EventType.DOWNGRADED, ""); + DataStreamsTags tags = DataStreamsTags.create("testType", null, "testTopic", "testGroup", null); + dataStreams.add(new StatsPoint(tags, 1, 2, 3, timeSource.getCurrentTimeNanos(), 0, 0, 0, null)); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + // no buckets are reported + awaitIdle(dataStreams); + assertTrue(payloadWriter.buckets.isEmpty()); + + // submitting points after an upgrade + supportsDataStreaming[0] = true; + timeSource.advance(FEATURE_CHECK_INTERVAL_NANOS); + dataStreams.report(); + + dataStreams.add(new StatsPoint(tags, 1, 2, 3, timeSource.getCurrentTimeNanos(), 0, 0, 0, null)); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + // points are now reported + awaitBuckets(dataStreams, payloadWriter, 1); + + StatsBucket bucket = payloadWriter.buckets.get(0); + assertEquals(1, bucket.getGroups().size()); + StatsGroup group = bucket.getGroups().iterator().next(); + assertEquals("type:testType", group.getTags().getType()); + assertEquals("group:testGroup", group.getTags().getGroup()); + assertEquals("topic:testTopic", group.getTags().getTopic()); + assertEquals(3, group.getTags().nonNullSize()); + assertEquals(1L, group.getHash()); + assertEquals(2L, group.getParentHash()); + + // cleanup + payloadWriter.close(); + dataStreams.close(); + } + + @Test + void dynamicConfigEnableAndDisable() throws InterruptedException { + boolean[] supportsDataStreaming = new boolean[] {true}; + DDAgentFeaturesDiscovery features = mock(DDAgentFeaturesDiscovery.class, RETURNS_SMART_NULLS); + when(features.supportsDataStreams()).thenAnswer(invocation -> supportsDataStreaming[0]); + + ControllableTimeSource timeSource = new ControllableTimeSource(); + Sink sink = mock(Sink.class); + CapturingPayloadWriter payloadWriter = new CapturingPayloadWriter(); + boolean[] dsmEnabled = new boolean[] {false}; + TraceConfig traceConfig = mock(TraceConfig.class, RETURNS_SMART_NULLS); + when(traceConfig.isDataStreamsEnabled()).thenAnswer(invocation -> dsmEnabled[0]); + + // reporting points when data streams is not enabled + DataStreamsTags tags = DataStreamsTags.create("testType", null, "testTopic", "testGroup", null); + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> traceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.start(); + dataStreams.add(new StatsPoint(tags, 1, 2, 3, timeSource.getCurrentTimeNanos(), 0, 0, 0, null)); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + // no buckets are reported + awaitIdle(dataStreams); + assertTrue(payloadWriter.buckets.isEmpty()); + + // submitting points after dynamically enabled + dsmEnabled[0] = true; + dataStreams.report(); + + dataStreams.add(new StatsPoint(tags, 1, 2, 3, timeSource.getCurrentTimeNanos(), 0, 0, 0, null)); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + // points are now reported + awaitBuckets(dataStreams, payloadWriter, 1); + + StatsBucket bucket = payloadWriter.buckets.get(0); + assertEquals(1, bucket.getGroups().size()); + StatsGroup group = bucket.getGroups().iterator().next(); + assertEquals("type:testType", group.getTags().getType()); + assertEquals("group:testGroup", group.getTags().getGroup()); + assertEquals("topic:testTopic", group.getTags().getTopic()); + assertEquals(3, group.getTags().nonNullSize()); + assertEquals(1L, group.getHash()); + assertEquals(2L, group.getParentHash()); + + // disabling data streams dynamically + dsmEnabled[0] = false; + dataStreams.report(); + + // inbox is processed + awaitIdle(dataStreams); + + // submitting points after being disabled + payloadWriter.buckets.clear(); + + dataStreams.add(new StatsPoint(tags, 1, 2, 3, timeSource.getCurrentTimeNanos(), 0, 0, 0, null)); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + // points are no longer reported + awaitIdle(dataStreams); + assertTrue(payloadWriter.buckets.isEmpty()); + + // cleanup + payloadWriter.close(); + dataStreams.close(); + } + + @Test + void featureAndDynamicConfigUpgradeInteractions() throws InterruptedException { + boolean[] supportsDataStreaming = new boolean[] {false}; + DDAgentFeaturesDiscovery features = mock(DDAgentFeaturesDiscovery.class, RETURNS_SMART_NULLS); + when(features.supportsDataStreams()).thenAnswer(invocation -> supportsDataStreaming[0]); + + ControllableTimeSource timeSource = new ControllableTimeSource(); + Sink sink = mock(Sink.class); + CapturingPayloadWriter payloadWriter = new CapturingPayloadWriter(); + boolean[] dsmEnabled = new boolean[] {false}; + TraceConfig traceConfig = mock(TraceConfig.class, RETURNS_SMART_NULLS); + when(traceConfig.isDataStreamsEnabled()).thenAnswer(invocation -> dsmEnabled[0]); + + // reporting points when data streams is not supported + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> traceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.start(); + DataStreamsTags tags = DataStreamsTags.create("testType", null, "testTopic", "testGroup", null); + dataStreams.add(new StatsPoint(tags, 1, 2, 3, timeSource.getCurrentTimeNanos(), 0, 0, 0, null)); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + // no buckets are reported + awaitIdle(dataStreams); + assertTrue(payloadWriter.buckets.isEmpty()); + + // submitting points after an upgrade with dsm disabled + supportsDataStreaming[0] = true; + timeSource.advance(FEATURE_CHECK_INTERVAL_NANOS); + dataStreams.report(); + + dataStreams.add(new StatsPoint(tags, 1, 2, 3, timeSource.getCurrentTimeNanos(), 0, 0, 0, null)); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + // points are not reported + awaitIdle(dataStreams); + assertTrue(payloadWriter.buckets.isEmpty()); + + // dsm is enabled dynamically + dsmEnabled[0] = true; + dataStreams.report(); + + dataStreams.add(new StatsPoint(tags, 1, 2, 3, timeSource.getCurrentTimeNanos(), 0, 0, 0, null)); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + // points are now reported + awaitBuckets(dataStreams, payloadWriter, 1); + + StatsBucket bucket = payloadWriter.buckets.get(0); + assertEquals(1, bucket.getGroups().size()); + StatsGroup group = bucket.getGroups().iterator().next(); + assertEquals("type:testType", group.getTags().getType()); + assertEquals("group:testGroup", group.getTags().getGroup()); + assertEquals("topic:testTopic", group.getTags().getTopic()); + assertEquals(3, group.getTags().nonNullSize()); + assertEquals(1L, group.getHash()); + assertEquals(2L, group.getParentHash()); + + // cleanup + payloadWriter.close(); + dataStreams.close(); + } + + @Test + void moreFeatureAndDynamicConfigUpgradeInteractions() throws InterruptedException { + boolean[] supportsDataStreaming = new boolean[] {false}; + DDAgentFeaturesDiscovery features = mock(DDAgentFeaturesDiscovery.class, RETURNS_SMART_NULLS); + when(features.supportsDataStreams()).thenAnswer(invocation -> supportsDataStreaming[0]); + + ControllableTimeSource timeSource = new ControllableTimeSource(); + Sink sink = mock(Sink.class); + CapturingPayloadWriter payloadWriter = new CapturingPayloadWriter(); + boolean[] dsmEnabled = new boolean[] {false}; + TraceConfig traceConfig = mock(TraceConfig.class, RETURNS_SMART_NULLS); + when(traceConfig.isDataStreamsEnabled()).thenAnswer(invocation -> dsmEnabled[0]); + + // reporting points when data streams is not supported + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> traceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.start(); + DataStreamsTags tags = DataStreamsTags.create("testType", null, "testTopic", "testGroup", null); + dataStreams.add(new StatsPoint(tags, 1, 2, 3, timeSource.getCurrentTimeNanos(), 0, 0, 0, null)); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + // no buckets are reported + awaitIdle(dataStreams); + assertTrue(payloadWriter.buckets.isEmpty()); + + // enabling dsm when not supported by agent + dsmEnabled[0] = true; + dataStreams.report(); + + dataStreams.add(new StatsPoint(tags, 1, 2, 3, timeSource.getCurrentTimeNanos(), 0, 0, 0, null)); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + // points are not reported + awaitIdle(dataStreams); + assertTrue(payloadWriter.buckets.isEmpty()); + + // cleanup + payloadWriter.close(); + dataStreams.close(); + } + + @Test + void schemaRegistryUsagesAreAggregatedByOperation() throws InterruptedException { + DDAgentFeaturesDiscovery features = stubFeatures(true); + ControllableTimeSource timeSource = new ControllableTimeSource(); + CapturingPayloadWriter payloadWriter = new CapturingPayloadWriter(); + Sink sink = mock(Sink.class); + TraceConfig traceConfig = stubTraceConfig(true); + + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> traceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.start(); + + // Record serialize and deserialize operations + dataStreams.reportSchemaRegistryUsage( + "test-topic", "test-cluster", 123, true, false, "serialize"); + // duplicate serialize + dataStreams.reportSchemaRegistryUsage( + "test-topic", "test-cluster", 123, true, false, "serialize"); + dataStreams.reportSchemaRegistryUsage( + "test-topic", "test-cluster", 123, true, false, "deserialize"); + // different schema/key + dataStreams.reportSchemaRegistryUsage( + "test-topic", "test-cluster", 456, true, true, "serialize"); + + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + awaitBuckets(dataStreams, payloadWriter, 1); + + StatsBucket bucket = payloadWriter.buckets.get(0); + Collection> usages = bucket.getSchemaRegistryUsages(); + assertEquals(3, usages.size()); // 3 unique combinations + + // Find serialize operation for schema 123 (should have count 2) + Entry serializeUsage = findUsage(usages, 123, "serialize", false); + assertNotNull(serializeUsage); + assertEquals(2L, serializeUsage.getValue()); // Aggregated 2 serialize operations + + // Find deserialize operation for schema 123 (should have count 1) + Entry deserializeUsage = + findUsage(usages, 123, "deserialize", false); + assertNotNull(deserializeUsage); + assertEquals(1L, deserializeUsage.getValue()); + + // Find serialize operation for schema 456 with isKey=true (should have count 1) + Entry keySerializeUsage = + findUsage(usages, 456, "serialize", true); + assertNotNull(keySerializeUsage); + assertEquals(1L, keySerializeUsage.getValue()); + + // cleanup + payloadWriter.close(); + dataStreams.close(); + } + + private static Entry findUsage( + Collection> usages, + int schemaId, + String operation, + boolean isKey) { + for (Entry entry : usages) { + StatsBucket.SchemaKey key = entry.getKey(); + if (key.getSchemaId() == schemaId + && operation.equals(key.getOperation()) + && key.isKey() == isKey) { + return entry; + } + } + return null; + } + + @Test + void schemaKeyEqualsAndHashCodeWorkCorrectly() { + StatsBucket.SchemaKey key1 = + new StatsBucket.SchemaKey("topic1", "cluster1", 123, true, false, "serialize"); + StatsBucket.SchemaKey key2 = + new StatsBucket.SchemaKey("topic1", "cluster1", 123, true, false, "serialize"); + // different topic + StatsBucket.SchemaKey key3 = + new StatsBucket.SchemaKey("topic2", "cluster1", 123, true, false, "serialize"); + // different cluster + StatsBucket.SchemaKey key4 = + new StatsBucket.SchemaKey("topic1", "cluster2", 123, true, false, "serialize"); + // different schema + StatsBucket.SchemaKey key5 = + new StatsBucket.SchemaKey("topic1", "cluster1", 456, true, false, "serialize"); + // different success + StatsBucket.SchemaKey key6 = + new StatsBucket.SchemaKey("topic1", "cluster1", 123, false, false, "serialize"); + // different isKey + StatsBucket.SchemaKey key7 = + new StatsBucket.SchemaKey("topic1", "cluster1", 123, true, true, "serialize"); + // different operation + StatsBucket.SchemaKey key8 = + new StatsBucket.SchemaKey("topic1", "cluster1", 123, true, false, "deserialize"); + + // Reflexive + assertEquals(key1, key1); + assertEquals(key1.hashCode(), key1.hashCode()); + + // Symmetric + assertEquals(key1, key2); + assertEquals(key2, key1); + assertEquals(key1.hashCode(), key2.hashCode()); + + // Different topic + assertNotEquals(key1, key3); + assertNotEquals(key3, key1); + + // Different cluster + assertNotEquals(key1, key4); + assertNotEquals(key4, key1); + + // Different schema ID + assertNotEquals(key1, key5); + assertNotEquals(key5, key1); + + // Different success + assertNotEquals(key1, key6); + assertNotEquals(key6, key1); + + // Different isKey + assertNotEquals(key1, key7); + assertNotEquals(key7, key1); + + // Different operation + assertNotEquals(key1, key8); + assertNotEquals(key8, key1); + + // Null check + assertNotEquals(null, key1); + + // Different class + assertNotEquals("not a schema key", key1); + } + + @Test + void statsBucketAggregatesSchemaRegistryUsagesCorrectly() { + StatsBucket bucket = new StatsBucket(1000L, 10000L); + SchemaRegistryUsage usage1 = + new SchemaRegistryUsage("topic1", "cluster1", 123, true, false, "serialize", 1000L, null); + SchemaRegistryUsage usage2 = + new SchemaRegistryUsage("topic1", "cluster1", 123, true, false, "serialize", 2000L, null); + SchemaRegistryUsage usage3 = + new SchemaRegistryUsage("topic1", "cluster1", 123, true, false, "deserialize", 3000L, null); + + bucket.addSchemaRegistryUsage(usage1); + // should increment count for same key + bucket.addSchemaRegistryUsage(usage2); + // different operation, new key + bucket.addSchemaRegistryUsage(usage3); + + Collection> usages = bucket.getSchemaRegistryUsages(); + Map usageMap = new HashMap<>(); + for (Entry entry : usages) { + usageMap.put(entry.getKey(), entry.getValue()); + } + + assertEquals(2, usages.size()); + + // Check serialize count + StatsBucket.SchemaKey serializeKey = + new StatsBucket.SchemaKey("topic1", "cluster1", 123, true, false, "serialize"); + assertEquals(2L, usageMap.get(serializeKey)); + + // Check deserialize count + StatsBucket.SchemaKey deserializeKey = + new StatsBucket.SchemaKey("topic1", "cluster1", 123, true, false, "deserialize"); + assertEquals(1L, usageMap.get(deserializeKey)); + + // Check that different operations create different keys + assertNotEquals(serializeKey, deserializeKey); + } + + @Test + void kafkaProducerConfigIsReportedInBucket() throws InterruptedException { + DDAgentFeaturesDiscovery features = stubFeatures(true); + ControllableTimeSource timeSource = new ControllableTimeSource(); + Sink sink = mock(Sink.class); + CapturingPayloadWriter payloadWriter = new CapturingPayloadWriter(); + TraceConfig traceConfig = stubTraceConfig(true); + + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> traceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.start(); + Map kafkaConfig = new HashMap<>(); + kafkaConfig.put("bootstrap.servers", "localhost:9092"); + kafkaConfig.put("acks", "all"); + dataStreams.reportKafkaConfig("kafka_producer", "", "", kafkaConfig); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + awaitBuckets(dataStreams, payloadWriter, 1); + + StatsBucket bucket = payloadWriter.buckets.get(0); + List kafkaConfigs = bucket.getKafkaConfigs(); + assertEquals(1, kafkaConfigs.size()); + KafkaConfigReport report = kafkaConfigs.get(0); + assertEquals("kafka_producer", report.getType()); + assertEquals("localhost:9092", report.getConfig().get("bootstrap.servers")); + assertEquals("all", report.getConfig().get("acks")); + + // cleanup + payloadWriter.close(); + dataStreams.close(); + } + + @Test + void kafkaConsumerConfigIsReportedInBucket() throws InterruptedException { + DDAgentFeaturesDiscovery features = stubFeatures(true); + ControllableTimeSource timeSource = new ControllableTimeSource(); + Sink sink = mock(Sink.class); + CapturingPayloadWriter payloadWriter = new CapturingPayloadWriter(); + TraceConfig traceConfig = stubTraceConfig(true); + + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> traceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.start(); + Map kafkaConfig = new HashMap<>(); + kafkaConfig.put("bootstrap.servers", "localhost:9092"); + kafkaConfig.put("group.id", "test-group"); + kafkaConfig.put("auto.offset.reset", "earliest"); + dataStreams.reportKafkaConfig("kafka_consumer", "", "test-group", kafkaConfig); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + awaitBuckets(dataStreams, payloadWriter, 1); + + StatsBucket bucket = payloadWriter.buckets.get(0); + List kafkaConfigs = bucket.getKafkaConfigs(); + assertEquals(1, kafkaConfigs.size()); + KafkaConfigReport report = kafkaConfigs.get(0); + assertEquals("kafka_consumer", report.getType()); + assertEquals("localhost:9092", report.getConfig().get("bootstrap.servers")); + assertEquals("test-group", report.getConfig().get("group.id")); + assertEquals("earliest", report.getConfig().get("auto.offset.reset")); + + // cleanup + payloadWriter.close(); + dataStreams.close(); + } + + @Test + void duplicateKafkaConfigsAreEachReportedInTheBucket() throws InterruptedException { + DDAgentFeaturesDiscovery features = stubFeatures(true); + ControllableTimeSource timeSource = new ControllableTimeSource(); + Sink sink = mock(Sink.class); + CapturingPayloadWriter payloadWriter = new CapturingPayloadWriter(); + TraceConfig traceConfig = stubTraceConfig(true); + + // reporting the same config twice + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> traceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.start(); + Map config1 = new HashMap<>(); + config1.put("bootstrap.servers", "localhost:9092"); + config1.put("acks", "all"); + Map config2 = new HashMap<>(); + config2.put("bootstrap.servers", "localhost:9092"); + config2.put("acks", "all"); + dataStreams.reportKafkaConfig("kafka_producer", "", "", config1); + dataStreams.reportKafkaConfig("kafka_producer", "", "", config2); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + // both configs are reported in the bucket + awaitBuckets(dataStreams, payloadWriter, 1); + + StatsBucket bucket = payloadWriter.buckets.get(0); + List kafkaConfigs = bucket.getKafkaConfigs(); + assertEquals(2, kafkaConfigs.size()); + for (KafkaConfigReport report : kafkaConfigs) { + assertEquals("kafka_producer", report.getType()); + assertEquals("localhost:9092", report.getConfig().get("bootstrap.servers")); + assertEquals("all", report.getConfig().get("acks")); + } + + // cleanup + payloadWriter.close(); + dataStreams.close(); + } + + @Test + void kafkaConfigsReportedInSeparateBucketsAppearInEachBucket() throws InterruptedException { + DDAgentFeaturesDiscovery features = stubFeatures(true); + ControllableTimeSource timeSource = new ControllableTimeSource(); + Sink sink = mock(Sink.class); + CapturingPayloadWriter payloadWriter = new CapturingPayloadWriter(); + TraceConfig traceConfig = stubTraceConfig(true); + + // reporting a config in the first bucket + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> traceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.start(); + Map kafkaConfig = new HashMap<>(); + kafkaConfig.put("bootstrap.servers", "localhost:9092"); + kafkaConfig.put("acks", "all"); + dataStreams.reportKafkaConfig("kafka_producer", "", "", kafkaConfig); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + // first bucket has the config + awaitBuckets(dataStreams, payloadWriter, 1); + assertEquals(1, payloadWriter.buckets.get(0).getKafkaConfigs().size()); + + // reporting the same config again in a new bucket + payloadWriter.buckets.clear(); + dataStreams.reportKafkaConfig("kafka_producer", "", "", kafkaConfig); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + // second bucket also has the config + awaitBuckets(dataStreams, payloadWriter, 1); + + StatsBucket bucket = payloadWriter.buckets.get(0); + List kafkaConfigs = bucket.getKafkaConfigs(); + assertEquals(1, kafkaConfigs.size()); + KafkaConfigReport report = kafkaConfigs.get(0); + assertEquals("kafka_producer", report.getType()); + assertEquals("localhost:9092", report.getConfig().get("bootstrap.servers")); + assertEquals("all", report.getConfig().get("acks")); + + // cleanup + payloadWriter.close(); + dataStreams.close(); + } + + @Test + void differentKafkaConfigsAreBothReported() throws InterruptedException { + DDAgentFeaturesDiscovery features = stubFeatures(true); + ControllableTimeSource timeSource = new ControllableTimeSource(); + Sink sink = mock(Sink.class); + CapturingPayloadWriter payloadWriter = new CapturingPayloadWriter(); + TraceConfig traceConfig = stubTraceConfig(true); + + // reporting producer and consumer configs + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> traceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.start(); + Map producerConfig = new HashMap<>(); + producerConfig.put("bootstrap.servers", "localhost:9092"); + producerConfig.put("acks", "all"); + dataStreams.reportKafkaConfig("kafka_producer", "", "", producerConfig); + Map consumerConfig = new HashMap<>(); + consumerConfig.put("bootstrap.servers", "localhost:9092"); + consumerConfig.put("group.id", "my-group"); + dataStreams.reportKafkaConfig("kafka_consumer", "", "my-group", consumerConfig); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + // both configs are reported + awaitBuckets(dataStreams, payloadWriter, 1); + + StatsBucket bucket = payloadWriter.buckets.get(0); + List kafkaConfigs = bucket.getKafkaConfigs(); + assertEquals(2, kafkaConfigs.size()); + + KafkaConfigReport producerReport = findReport(kafkaConfigs, "kafka_producer"); + assertNotNull(producerReport); + assertEquals("localhost:9092", producerReport.getConfig().get("bootstrap.servers")); + assertEquals("all", producerReport.getConfig().get("acks")); + + KafkaConfigReport consumerReport = findReport(kafkaConfigs, "kafka_consumer"); + assertNotNull(consumerReport); + assertEquals("localhost:9092", consumerReport.getConfig().get("bootstrap.servers")); + assertEquals("my-group", consumerReport.getConfig().get("group.id")); + + // cleanup + payloadWriter.close(); + dataStreams.close(); + } + + private static KafkaConfigReport findReport(List configs, String type) { + for (KafkaConfigReport report : configs) { + if (type.equals(report.getType())) { + return report; + } + } + return null; + } + + @Test + void kafkaConfigsWithDifferentValuesForSameTypeAreNotDeduplicated() throws InterruptedException { + DDAgentFeaturesDiscovery features = stubFeatures(true); + ControllableTimeSource timeSource = new ControllableTimeSource(); + Sink sink = mock(Sink.class); + CapturingPayloadWriter payloadWriter = new CapturingPayloadWriter(); + TraceConfig traceConfig = stubTraceConfig(true); + + // reporting two producer configs with different settings + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> traceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.start(); + Map config1 = new HashMap<>(); + config1.put("bootstrap.servers", "localhost:9092"); + config1.put("acks", "all"); + dataStreams.reportKafkaConfig("kafka_producer", "", "", config1); + Map config2 = new HashMap<>(); + config2.put("bootstrap.servers", "localhost:9093"); + config2.put("acks", "1"); + dataStreams.reportKafkaConfig("kafka_producer", "", "", config2); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + // both configs are reported because they have different values + awaitBuckets(dataStreams, payloadWriter, 1); + assertEquals(2, payloadWriter.buckets.get(0).getKafkaConfigs().size()); + + // cleanup + payloadWriter.close(); + dataStreams.close(); + } + + @Test + void kafkaConfigsAreReportedAlongsideStatsPoints() throws InterruptedException { + DDAgentFeaturesDiscovery features = stubFeatures(true); + ControllableTimeSource timeSource = new ControllableTimeSource(); + Sink sink = mock(Sink.class); + CapturingPayloadWriter payloadWriter = new CapturingPayloadWriter(); + TraceConfig traceConfig = stubTraceConfig(true); + + // reporting both stats points and kafka configs + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> traceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.start(); + DataStreamsTags tags = DataStreamsTags.create("testType", null, "testTopic", "testGroup", null); + dataStreams.add(new StatsPoint(tags, 1, 2, 3, timeSource.getCurrentTimeNanos(), 0, 0, 0, null)); + Map kafkaConfig = new HashMap<>(); + kafkaConfig.put("bootstrap.servers", "localhost:9092"); + dataStreams.reportKafkaConfig("kafka_producer", "", "", kafkaConfig); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + // bucket contains both stats groups and kafka configs + awaitBuckets(dataStreams, payloadWriter, 1); + + StatsBucket bucket = payloadWriter.buckets.get(0); + assertEquals(1, bucket.getGroups().size()); + List kafkaConfigs = bucket.getKafkaConfigs(); + assertEquals(1, kafkaConfigs.size()); + + StatsGroup group = bucket.getGroups().iterator().next(); + assertEquals("type:testType", group.getTags().getType()); + assertEquals(1L, group.getHash()); + assertEquals(2L, group.getParentHash()); + + KafkaConfigReport report = kafkaConfigs.get(0); + assertEquals("kafka_producer", report.getType()); + assertEquals("localhost:9092", report.getConfig().get("bootstrap.servers")); + + // cleanup + payloadWriter.close(); + dataStreams.close(); + } + + @TableTest({ + "scenario | enabledAtAgent | enabledInConfig", + "agent off, config on | false | true ", + "agent on, config off | true | false ", + "both off | false | false " + }) + void kafkaConfigsNotReportedWhenDSMIsDisabled(boolean enabledAtAgent, boolean enabledInConfig) + throws InterruptedException { + DDAgentFeaturesDiscovery features = stubFeatures(enabledAtAgent); + ControllableTimeSource timeSource = new ControllableTimeSource(); + CapturingPayloadWriter payloadWriter = new CapturingPayloadWriter(); + Sink sink = mock(Sink.class); + TraceConfig traceConfig = stubTraceConfig(enabledInConfig); + + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> traceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.start(); + Map kafkaConfig = new HashMap<>(); + kafkaConfig.put("bootstrap.servers", "localhost:9092"); + dataStreams.reportKafkaConfig("kafka_producer", "", "", kafkaConfig); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.report(); + + awaitIdle(dataStreams); + assertTrue(payloadWriter.buckets.isEmpty()); + + // cleanup + payloadWriter.close(); + dataStreams.close(); + } + + @Test + void kafkaConfigsFlushedOnClose() throws InterruptedException { + DDAgentFeaturesDiscovery features = stubFeatures(true); + ControllableTimeSource timeSource = new ControllableTimeSource(); + Sink sink = mock(Sink.class); + CapturingPayloadWriter payloadWriter = new CapturingPayloadWriter(); + TraceConfig traceConfig = stubTraceConfig(true); + + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> traceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + dataStreams.start(); + Map kafkaConfig = new HashMap<>(); + kafkaConfig.put("bootstrap.servers", "localhost:9092"); + dataStreams.reportKafkaConfig("kafka_producer", "", "", kafkaConfig); + timeSource.advance(DEFAULT_BUCKET_DURATION_NANOS - 100L); + dataStreams.close(); + + // configs in the current bucket are flushed on close + awaitBuckets(dataStreams, payloadWriter, 1); + + StatsBucket bucket = payloadWriter.buckets.get(0); + List kafkaConfigs = bucket.getKafkaConfigs(); + assertEquals(1, kafkaConfigs.size()); + KafkaConfigReport report = kafkaConfigs.get(0); + assertEquals("kafka_producer", report.getType()); + assertEquals("localhost:9092", report.getConfig().get("bootstrap.servers")); + + // cleanup + payloadWriter.close(); + } + + @Test + void kafkaConfigReportEqualsAndHashCodeWorkCorrectly() { + Map sameConfig = new HashMap<>(); + sameConfig.put("bootstrap.servers", "localhost:9092"); + sameConfig.put("acks", "all"); + Map sameConfig2 = new HashMap<>(); + sameConfig2.put("bootstrap.servers", "localhost:9092"); + sameConfig2.put("acks", "all"); + Map differentConfig = new HashMap<>(); + differentConfig.put("bootstrap.servers", "localhost:9093"); + + KafkaConfigReport config1 = + new KafkaConfigReport("kafka_producer", "", "", sameConfig, 1000L, null); + // different timestamp + KafkaConfigReport config2 = + new KafkaConfigReport("kafka_producer", "", "", sameConfig2, 2000L, null); + // different type + KafkaConfigReport config3 = + new KafkaConfigReport("kafka_consumer", "", "", sameConfig, 1000L, null); + // different config values + KafkaConfigReport config4 = + new KafkaConfigReport("kafka_producer", "", "", differentConfig, 1000L, null); + // different serviceNameOverride + KafkaConfigReport config5 = + new KafkaConfigReport("kafka_producer", "", "", sameConfig, 1000L, "other-service"); + + // Reflexive + assertEquals(config1, config1); + assertEquals(config1.hashCode(), config1.hashCode()); + + // Same type and config, different timestamp -- equals (timestamp is NOT part of equals) + assertEquals(config1, config2); + assertEquals(config2, config1); + assertEquals(config1.hashCode(), config2.hashCode()); + + // Same type and config, different serviceNameOverride -- equals (serviceNameOverride is NOT + // part of equals) + assertEquals(config1, config5); + assertEquals(config5, config1); + assertEquals(config1.hashCode(), config5.hashCode()); + + // Different type + assertNotEquals(config1, config3); + assertNotEquals(config3, config1); + + // Different config values + assertNotEquals(config1, config4); + assertNotEquals(config4, config1); + + // Null check + assertNotEquals(null, config1); + + // Different class + assertNotEquals("not a config report", config1); + } + + @Test + void statsBucketStoresKafkaConfigs() { + StatsBucket bucket = new StatsBucket(1000L, 10000L); + Map producerCfg = new HashMap<>(); + producerCfg.put("acks", "all"); + KafkaConfigReport config1 = + new KafkaConfigReport("kafka_producer", "", "", producerCfg, 1000L, null); + Map consumerCfg = new HashMap<>(); + consumerCfg.put("group.id", "test"); + KafkaConfigReport config2 = + new KafkaConfigReport("kafka_consumer", "", "test", consumerCfg, 2000L, null); + + bucket.addKafkaConfig(config1); + bucket.addKafkaConfig(config2); + + assertEquals(2, bucket.getKafkaConfigs().size()); + assertEquals("kafka_producer", bucket.getKafkaConfigs().get(0).getType()); + assertEquals("all", bucket.getKafkaConfigs().get(0).getConfig().get("acks")); + assertEquals("kafka_consumer", bucket.getKafkaConfigs().get(1).getType()); + assertEquals("test", bucket.getKafkaConfigs().get(1).getConfig().get("group.id")); + } + + static class CapturingPayloadWriter implements DatastreamsPayloadWriter { + boolean accepting = true; + final List buckets = new ArrayList<>(); + + @Override + public void writePayload(Collection payload, String serviceNameOverride) { + if (accepting) { + buckets.addAll(payload); + } + } + + void close() { + // Stop accepting new buckets so any late submissions by the reporting thread aren't seen + accepting = false; + } + } + + private DefaultDataStreamsMonitoring newDataStreamsMonitoring() { + return new DefaultDataStreamsMonitoring( + mock(Sink.class), + stubFeatures(true), + new ControllableTimeSource(), + () -> stubTraceConfig(true), + mock(DatastreamsPayloadWriter.class), + DEFAULT_BUCKET_DURATION_NANOS); + } + + @Test + void setCheckpointTagsTheSpanWithThePathwayHash() { + DefaultDataStreamsMonitoring dataStreams = newDataStreamsMonitoring(); + + // Negative so the signed and unsigned string representations differ, proving the tag uses + // Long.toUnsignedString (pathway hashes are unsigned 64-bit values). + long hash = -1234567890123456789L; + PathwayContext pathwayContext = mock(PathwayContext.class); + when(pathwayContext.getHash()).thenReturn(hash); + AgentSpanContext spanContext = mock(AgentSpanContext.class); + when(spanContext.getPathwayContext()).thenReturn(pathwayContext); + AgentSpan span = mock(AgentSpan.class); + when(span.spanContext()).thenReturn(spanContext); + DataStreamsContext context = mock(DataStreamsContext.class); + + dataStreams.setCheckpoint(span, context); + + verify(pathwayContext).setCheckpoint(eq(context), any()); + verify(span).setTag(DDTags.PATHWAY_HASH, Long.toUnsignedString(hash)); + } + + @Test + void setCheckpointDoesNotTagTheSpanWhenThePathwayHashIsZero() { + DefaultDataStreamsMonitoring dataStreams = newDataStreamsMonitoring(); + + PathwayContext pathwayContext = mock(PathwayContext.class); + when(pathwayContext.getHash()).thenReturn(0L); + AgentSpanContext spanContext = mock(AgentSpanContext.class); + when(spanContext.getPathwayContext()).thenReturn(pathwayContext); + AgentSpan span = mock(AgentSpan.class); + when(span.spanContext()).thenReturn(spanContext); + + dataStreams.setCheckpoint(span, mock(DataStreamsContext.class)); + + verify(span, never()).setTag(eq(DDTags.PATHWAY_HASH), any(String.class)); + } + + @Test + void setCheckpointDoesNotTagTheSpanWhenThereIsNoPathwayContext() { + DefaultDataStreamsMonitoring dataStreams = newDataStreamsMonitoring(); + + AgentSpanContext spanContext = mock(AgentSpanContext.class); + when(spanContext.getPathwayContext()).thenReturn(null); + AgentSpan span = mock(AgentSpan.class); + when(span.spanContext()).thenReturn(spanContext); + + dataStreams.setCheckpoint(span, mock(DataStreamsContext.class)); + + verify(span, never()).setTag(eq(DDTags.PATHWAY_HASH), any(String.class)); + } + + static class CustomContextCarrier implements DataStreamsContextCarrier { + private final Map data = new HashMap<>(); + + @Override + public Set> entries() { + return data.entrySet(); + } + + @Override + public void set(String key, String value) { + data.put(key, value); + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/datastreams/DefaultDataStreamsMonitoringTestBridge.java b/dd-trace-core/src/test/java/datadog/trace/core/datastreams/DefaultDataStreamsMonitoringTestBridge.java new file mode 100644 index 00000000000..37c204757fd --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/datastreams/DefaultDataStreamsMonitoringTestBridge.java @@ -0,0 +1,40 @@ +package datadog.trace.core.datastreams; + +import java.lang.reflect.Field; +import org.jctools.queues.MessagePassingQueue; + +final class DefaultDataStreamsMonitoringTestBridge { + private static final Field INBOX_FIELD; + private static final Field THREAD_FIELD; + + static { + try { + INBOX_FIELD = DefaultDataStreamsMonitoring.class.getDeclaredField("inbox"); + INBOX_FIELD.setAccessible(true); + THREAD_FIELD = DefaultDataStreamsMonitoring.class.getDeclaredField("thread"); + THREAD_FIELD.setAccessible(true); + } catch (NoSuchFieldException e) { + throw new IllegalStateException(e); + } + } + + private DefaultDataStreamsMonitoringTestBridge() {} + + static boolean isInboxEmpty(DefaultDataStreamsMonitoring monitoring) { + try { + MessagePassingQueue inbox = (MessagePassingQueue) INBOX_FIELD.get(monitoring); + return inbox.isEmpty(); + } catch (IllegalAccessException e) { + throw new IllegalStateException(e); + } + } + + static Thread.State getThreadState(DefaultDataStreamsMonitoring monitoring) { + try { + Thread thread = (Thread) THREAD_FIELD.get(monitoring); + return thread.getState(); + } catch (IllegalAccessException e) { + throw new IllegalStateException(e); + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/datastreams/DefaultPathwayContextTest.java b/dd-trace-core/src/test/java/datadog/trace/core/datastreams/DefaultPathwayContextTest.java new file mode 100644 index 00000000000..8860cf1571c --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/datastreams/DefaultPathwayContextTest.java @@ -0,0 +1,735 @@ +package datadog.trace.core.datastreams; + +import static datadog.context.Context.root; +import static datadog.trace.api.TracePropagationStyle.DATADOG; +import static datadog.trace.api.datastreams.DataStreamsContext.create; +import static datadog.trace.api.datastreams.DataStreamsContext.fromTags; +import static datadog.trace.api.datastreams.PathwayContext.PROPAGATION_KEY_BASE64; +import static java.util.concurrent.TimeUnit.MILLISECONDS; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.RETURNS_SMART_NULLS; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import datadog.communication.ddagent.DDAgentFeaturesDiscovery; +import datadog.context.Context; +import datadog.context.propagation.Propagator; +import datadog.trace.api.BaseHash; +import datadog.trace.api.Config; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.TagMap; +import datadog.trace.api.TraceConfig; +import datadog.trace.api.datastreams.DataStreamsTags; +import datadog.trace.api.datastreams.StatsPoint; +import datadog.trace.api.time.ControllableTimeSource; +import datadog.trace.bootstrap.instrumentation.api.AgentPropagation; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import datadog.trace.common.metrics.Sink; +import datadog.trace.core.DDCoreJavaSpecification; +import datadog.trace.core.propagation.ExtractedContext; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.function.Consumer; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; +import org.tabletest.junit.TableTest; + +public class DefaultPathwayContextTest extends DDCoreJavaSpecification { + private static final long DEFAULT_BUCKET_DURATION_NANOS = + Config.get().getDataStreamsBucketDurationNanoseconds(); + private static final long BASE_HASH = 12L; + + private CapturingPointConsumer pointConsumer; + + @BeforeEach + void setupConsumer() { + pointConsumer = new CapturingPointConsumer(); + } + + private static void verifyFirstPoint(StatsPoint point) { + assertEquals(0L, point.getParentHash()); + assertEquals(0L, point.getPathwayLatencyNano()); + assertEquals(0L, point.getEdgeLatencyNano()); + assertEquals(0L, point.getPayloadSizeBytes()); + } + + @Test + void firstSetCheckpointStartsTheContext() { + ControllableTimeSource timeSource = new ControllableTimeSource(); + DefaultPathwayContext context = new DefaultPathwayContext(timeSource, null); + + timeSource.advance(50); + context.setCheckpoint(fromTags(DataStreamsTags.create("internal", null)), pointConsumer); + + assertTrue(context.isStarted()); + assertEquals(1, pointConsumer.points.size()); + verifyFirstPoint(pointConsumer.points.get(0)); + } + + @Test + void checkpointGenerated() { + ControllableTimeSource timeSource = new ControllableTimeSource(); + DefaultPathwayContext context = new DefaultPathwayContext(timeSource, null); + + timeSource.advance(50); + context.setCheckpoint( + fromTags(DataStreamsTags.create("internal", DataStreamsTags.Direction.INBOUND)), + pointConsumer); + timeSource.advance(25); + DataStreamsTags tags = + DataStreamsTags.create("kafka", DataStreamsTags.Direction.OUTBOUND, "topic", "group", null); + context.setCheckpoint(fromTags(tags), pointConsumer); + + assertTrue(context.isStarted()); + assertEquals(2, pointConsumer.points.size()); + verifyFirstPoint(pointConsumer.points.get(0)); + StatsPoint second = pointConsumer.points.get(1); + assertEquals("group:group", second.getTags().getGroup()); + assertEquals("topic:topic", second.getTags().getTopic()); + assertEquals("type:kafka", second.getTags().getType()); + assertEquals("direction:out", second.getTags().getDirection()); + assertEquals(4, second.getTags().nonNullSize()); + assertEquals(pointConsumer.points.get(0).getHash(), second.getParentHash()); + assertNotEquals(0L, second.getHash()); + assertEquals(25L, second.getPathwayLatencyNano()); + assertEquals(25L, second.getEdgeLatencyNano()); + } + + @Test + void checkpointWithPayloadSize() { + ControllableTimeSource timeSource = new ControllableTimeSource(); + DefaultPathwayContext context = new DefaultPathwayContext(timeSource, null); + + timeSource.advance(25); + context.setCheckpoint( + create(DataStreamsTags.create("kafka", null, "topic", "group", null), 0, 72), + pointConsumer); + + assertTrue(context.isStarted()); + assertEquals(1, pointConsumer.points.size()); + StatsPoint first = pointConsumer.points.get(0); + assertEquals("group:group", first.getTags().getGroup()); + assertEquals("topic:topic", first.getTags().getTopic()); + assertEquals("type:kafka", first.getTags().getType()); + assertEquals(3, first.getTags().nonNullSize()); + assertNotEquals(0L, first.getHash()); + assertEquals(72L, first.getPayloadSizeBytes()); + } + + @Test + void multipleCheckpointsGenerated() { + ControllableTimeSource timeSource = new ControllableTimeSource(); + DefaultPathwayContext context = new DefaultPathwayContext(timeSource, null); + + timeSource.advance(50); + context.setCheckpoint( + fromTags(DataStreamsTags.create("kafka", DataStreamsTags.Direction.OUTBOUND)), + pointConsumer); + timeSource.advance(25); + DataStreamsTags tags = + DataStreamsTags.create("kafka", DataStreamsTags.Direction.INBOUND, "topic", "group", null); + context.setCheckpoint(fromTags(tags), pointConsumer); + timeSource.advance(30); + context.setCheckpoint(fromTags(tags), pointConsumer); + + assertTrue(context.isStarted()); + assertEquals(3, pointConsumer.points.size()); + verifyFirstPoint(pointConsumer.points.get(0)); + StatsPoint second = pointConsumer.points.get(1); + assertEquals(4, second.getTags().nonNullSize()); + assertEquals("direction:in", second.getTags().getDirection()); + assertEquals("group:group", second.getTags().getGroup()); + assertEquals("topic:topic", second.getTags().getTopic()); + assertEquals("type:kafka", second.getTags().getType()); + assertEquals(pointConsumer.points.get(0).getHash(), second.getParentHash()); + assertNotEquals(0L, second.getHash()); + assertEquals(25L, second.getPathwayLatencyNano()); + assertEquals(25L, second.getEdgeLatencyNano()); + StatsPoint third = pointConsumer.points.get(2); + assertEquals(4, third.getTags().nonNullSize()); + assertEquals("direction:in", third.getTags().getDirection()); + assertEquals("group:group", third.getTags().getGroup()); + assertEquals("topic:topic", third.getTags().getTopic()); + assertEquals("type:kafka", third.getTags().getType()); + // this point should have the first point as parent, + // as the loop protection will reset the parent if two identical + // points (same hash for tag values) are about to form a hierarchy + assertEquals(pointConsumer.points.get(0).getHash(), third.getParentHash()); + assertNotEquals(0L, third.getHash()); + assertEquals(55L, third.getPathwayLatencyNano()); + assertEquals(30L, third.getEdgeLatencyNano()); + } + + @Test + void exceptionThrownWhenTryingToEncodeUnstartedContext() { + ControllableTimeSource timeSource = new ControllableTimeSource(); + DefaultPathwayContext context = new DefaultPathwayContext(timeSource, null); + + assertThrows(IllegalStateException.class, context::encode); + } + + @Test + void setCheckpointWithDatasetTags() throws IOException { + ControllableTimeSource timeSource = new ControllableTimeSource(); + DefaultPathwayContext context = new DefaultPathwayContext(timeSource, null); + + timeSource.advance(MILLISECONDS.toNanos(50)); + context.setCheckpoint( + fromTags( + DataStreamsTags.createWithDataset( + "s3", DataStreamsTags.Direction.INBOUND, null, "my_object.csv", "my_bucket")), + pointConsumer); + String encoded = context.encode(); + timeSource.advance(MILLISECONDS.toNanos(2)); + DefaultPathwayContext decodedContext = DefaultPathwayContext.decode(timeSource, null, encoded); + timeSource.advance(MILLISECONDS.toNanos(25)); + DataStreamsTags tags = + DataStreamsTags.createWithDataset( + "s3", DataStreamsTags.Direction.OUTBOUND, null, "my_object.csv", "my_bucket"); + context.setCheckpoint(fromTags(tags), pointConsumer); + + assertTrue(decodedContext.isStarted()); + assertEquals(2, pointConsumer.points.size()); + + // all points should have datasetHash, which is not equal to hash or 0 + for (StatsPoint point : pointConsumer.points) { + assertNotEquals(point.getHash(), point.getAggregationHash()); + assertNotEquals(0L, point.getAggregationHash()); + } + } + + @Test + void encodingAndDecodingBase64AContext() throws IOException { + // Timesource needs to be advanced in milliseconds because encoding truncates to millis + ControllableTimeSource timeSource = new ControllableTimeSource(); + DefaultPathwayContext context = new DefaultPathwayContext(timeSource, null); + + timeSource.advance(MILLISECONDS.toNanos(50)); + context.setCheckpoint( + fromTags(DataStreamsTags.create("internal", DataStreamsTags.Direction.INBOUND)), + pointConsumer); + String encoded = context.encode(); + timeSource.advance(MILLISECONDS.toNanos(2)); + DefaultPathwayContext decodedContext = DefaultPathwayContext.decode(timeSource, null, encoded); + timeSource.advance(MILLISECONDS.toNanos(25)); + context.setCheckpoint( + fromTags(DataStreamsTags.create("kafka", null, "topic", "group", null)), pointConsumer); + + assertTrue(decodedContext.isStarted()); + assertEquals(2, pointConsumer.points.size()); + + StatsPoint second = pointConsumer.points.get(1); + assertEquals(3, second.getTags().nonNullSize()); + assertEquals("group:group", second.getTags().getGroup()); + assertEquals("type:kafka", second.getTags().getType()); + assertEquals("topic:topic", second.getTags().getTopic()); + assertEquals(pointConsumer.points.get(0).getHash(), second.getParentHash()); + assertNotEquals(0L, second.getHash()); + assertEquals(MILLISECONDS.toNanos(27), second.getPathwayLatencyNano()); + assertEquals(MILLISECONDS.toNanos(27), second.getEdgeLatencyNano()); + } + + @Test + void setCheckpointWithTimestamp() { + ControllableTimeSource timeSource = new ControllableTimeSource(); + DefaultPathwayContext context = new DefaultPathwayContext(timeSource, null); + long timeFromQueue = timeSource.getCurrentTimeMillis() - 200; + + context.setCheckpoint( + create(DataStreamsTags.create("internal", null), timeFromQueue, 0), pointConsumer); + + assertTrue(context.isStarted()); + assertEquals(1, pointConsumer.points.size()); + StatsPoint first = pointConsumer.points.get(0); + assertEquals("type:internal", first.getTags().getType()); + assertEquals(1, first.getTags().nonNullSize()); + assertEquals(0L, first.getParentHash()); + assertNotEquals(0L, first.getHash()); + assertEquals(MILLISECONDS.toNanos(200), first.getPathwayLatencyNano()); + assertEquals(MILLISECONDS.toNanos(200), first.getEdgeLatencyNano()); + } + + @Test + void encodingAndDecodingBase64WithContextsAndCheckpoints() throws IOException { + // Timesource needs to be advanced in milliseconds because encoding truncates to millis + ControllableTimeSource timeSource = new ControllableTimeSource(); + DefaultPathwayContext context = new DefaultPathwayContext(timeSource, null); + + timeSource.advance(MILLISECONDS.toNanos(50)); + context.setCheckpoint( + fromTags(DataStreamsTags.create("internal", DataStreamsTags.Direction.INBOUND)), + pointConsumer); + + String encoded = context.encode(); + timeSource.advance(MILLISECONDS.toNanos(1)); + DefaultPathwayContext decodedContext = DefaultPathwayContext.decode(timeSource, null, encoded); + timeSource.advance(MILLISECONDS.toNanos(25)); + context.setCheckpoint( + fromTags( + DataStreamsTags.create( + "kafka", DataStreamsTags.Direction.OUTBOUND, "topic", "group", null)), + pointConsumer); + + assertTrue(decodedContext.isStarted()); + assertEquals(2, pointConsumer.points.size()); + StatsPoint second = pointConsumer.points.get(1); + assertEquals("group:group", second.getTags().getGroup()); + assertEquals("topic:topic", second.getTags().getTopic()); + assertEquals("type:kafka", second.getTags().getType()); + assertEquals("direction:out", second.getTags().getDirection()); + assertEquals(4, second.getTags().nonNullSize()); + assertEquals(pointConsumer.points.get(0).getHash(), second.getParentHash()); + assertNotEquals(0L, second.getHash()); + assertEquals(MILLISECONDS.toNanos(26), second.getPathwayLatencyNano()); + assertEquals(MILLISECONDS.toNanos(26), second.getEdgeLatencyNano()); + + String secondEncode = decodedContext.encode(); + timeSource.advance(MILLISECONDS.toNanos(2)); + DefaultPathwayContext secondDecode = + DefaultPathwayContext.decode(timeSource, null, secondEncode); + timeSource.advance(MILLISECONDS.toNanos(30)); + context.setCheckpoint( + fromTags( + DataStreamsTags.create( + "kafka", DataStreamsTags.Direction.INBOUND, "topicB", "group", null)), + pointConsumer); + + assertTrue(secondDecode.isStarted()); + assertEquals(3, pointConsumer.points.size()); + StatsPoint third = pointConsumer.points.get(2); + assertEquals("group:group", third.getTags().getGroup()); + assertEquals("topic:topicB", third.getTags().getTopic()); + assertEquals("type:kafka", third.getTags().getType()); + assertEquals("direction:in", third.getTags().getDirection()); + assertEquals(4, third.getTags().nonNullSize()); + assertEquals(pointConsumer.points.get(1).getHash(), third.getParentHash()); + assertNotEquals(0L, third.getHash()); + assertEquals(MILLISECONDS.toNanos(58), third.getPathwayLatencyNano()); + assertEquals(MILLISECONDS.toNanos(32), third.getEdgeLatencyNano()); + } + + @Test + void encodingAndDecodingBase64WithInjectsAndExtracts() throws IOException { + // Timesource needs to be advanced in milliseconds because encoding truncates to millis + ControllableTimeSource timeSource = new ControllableTimeSource(); + DefaultPathwayContext context = new DefaultPathwayContext(timeSource, null); + Base64MapContextVisitor contextVisitor = new Base64MapContextVisitor(); + + timeSource.advance(MILLISECONDS.toNanos(50)); + context.setCheckpoint( + fromTags(DataStreamsTags.create("internal", DataStreamsTags.Direction.INBOUND)), + pointConsumer); + + String encoded = context.encode(); + Map carrier = new HashMap<>(); + carrier.put(PROPAGATION_KEY_BASE64, encoded); + carrier.put("someotherkey", "someothervalue"); + timeSource.advance(MILLISECONDS.toNanos(1)); + DefaultPathwayContext decodedContext = + DefaultPathwayContext.extract(carrier, contextVisitor, timeSource, null); + timeSource.advance(MILLISECONDS.toNanos(25)); + context.setCheckpoint( + fromTags( + DataStreamsTags.create( + "kafka", DataStreamsTags.Direction.OUTBOUND, "topic", "group", null)), + pointConsumer); + + assertTrue(decodedContext.isStarted()); + assertEquals(2, pointConsumer.points.size()); + StatsPoint second = pointConsumer.points.get(1); + assertEquals(4, second.getTags().nonNullSize()); + assertEquals("group:group", second.getTags().getGroup()); + assertEquals("topic:topic", second.getTags().getTopic()); + assertEquals("type:kafka", second.getTags().getType()); + assertEquals("direction:out", second.getTags().getDirection()); + assertEquals(pointConsumer.points.get(0).getHash(), second.getParentHash()); + assertNotEquals(0L, second.getHash()); + assertEquals(MILLISECONDS.toNanos(26), second.getPathwayLatencyNano()); + assertEquals(MILLISECONDS.toNanos(26), second.getEdgeLatencyNano()); + + String secondEncode = decodedContext.encode(); + carrier = new HashMap<>(); + carrier.put(PROPAGATION_KEY_BASE64, secondEncode); + timeSource.advance(MILLISECONDS.toNanos(2)); + DefaultPathwayContext secondDecode = + DefaultPathwayContext.extract(carrier, contextVisitor, timeSource, null); + timeSource.advance(MILLISECONDS.toNanos(30)); + context.setCheckpoint( + fromTags( + DataStreamsTags.create( + "kafka", DataStreamsTags.Direction.INBOUND, "topicB", "group", null)), + pointConsumer); + + assertTrue(secondDecode.isStarted()); + assertEquals(3, pointConsumer.points.size()); + StatsPoint third = pointConsumer.points.get(2); + assertEquals(4, third.getTags().nonNullSize()); + assertEquals("group:group", third.getTags().getGroup()); + assertEquals("topic:topicB", third.getTags().getTopic()); + assertEquals("type:kafka", third.getTags().getType()); + assertEquals("direction:in", third.getTags().getDirection()); + assertEquals(pointConsumer.points.get(1).getHash(), third.getParentHash()); + assertNotEquals(0L, third.getHash()); + assertEquals(MILLISECONDS.toNanos(58), third.getPathwayLatencyNano()); + assertEquals(MILLISECONDS.toNanos(32), third.getEdgeLatencyNano()); + } + + @Test + void encodingAndDecodingSqsFormattedWithInjectsAndExtracts() throws IOException { + // Timesource needs to be advanced in milliseconds because encoding truncates to millis + ControllableTimeSource timeSource = new ControllableTimeSource(); + DefaultPathwayContext context = new DefaultPathwayContext(timeSource, null); + Base64MapContextVisitor contextVisitor = new Base64MapContextVisitor(); + + timeSource.advance(MILLISECONDS.toNanos(50)); + context.setCheckpoint( + fromTags(DataStreamsTags.create("internal", DataStreamsTags.Direction.INBOUND)), + pointConsumer); + + String encoded = context.encode(); + Map carrier = new HashMap<>(); + carrier.put(PROPAGATION_KEY_BASE64, encoded); + carrier.put("someotherkey", "someothervalue"); + timeSource.advance(MILLISECONDS.toNanos(1)); + DefaultPathwayContext decodedContext = + DefaultPathwayContext.extract(carrier, contextVisitor, timeSource, null); + timeSource.advance(MILLISECONDS.toNanos(25)); + context.setCheckpoint( + fromTags( + DataStreamsTags.create("sqs", DataStreamsTags.Direction.OUTBOUND, "topic", null, null)), + pointConsumer); + + assertTrue(decodedContext.isStarted()); + assertEquals(2, pointConsumer.points.size()); + StatsPoint second = pointConsumer.points.get(1); + assertEquals("direction:out", second.getTags().getDirection()); + assertEquals("topic:topic", second.getTags().getTopic()); + assertEquals("type:sqs", second.getTags().getType()); + assertEquals(3, second.getTags().nonNullSize()); + assertEquals(pointConsumer.points.get(0).getHash(), second.getParentHash()); + assertNotEquals(0L, second.getHash()); + assertEquals(MILLISECONDS.toNanos(26), second.getPathwayLatencyNano()); + assertEquals(MILLISECONDS.toNanos(26), second.getEdgeLatencyNano()); + + String secondEncode = decodedContext.encode(); + carrier = new HashMap<>(); + carrier.put(PROPAGATION_KEY_BASE64, secondEncode); + timeSource.advance(MILLISECONDS.toNanos(2)); + DefaultPathwayContext secondDecode = + DefaultPathwayContext.extract(carrier, contextVisitor, timeSource, null); + timeSource.advance(MILLISECONDS.toNanos(30)); + context.setCheckpoint( + fromTags( + DataStreamsTags.create("sqs", DataStreamsTags.Direction.INBOUND, "topicB", null, null)), + pointConsumer); + + assertTrue(secondDecode.isStarted()); + assertEquals(3, pointConsumer.points.size()); + StatsPoint third = pointConsumer.points.get(2); + assertEquals("type:sqs", third.getTags().getType()); + assertEquals("topic:topicB", third.getTags().getTopic()); + assertEquals(3, third.getTags().nonNullSize()); + assertEquals(pointConsumer.points.get(1).getHash(), third.getParentHash()); + assertNotEquals(0L, third.getHash()); + assertEquals(MILLISECONDS.toNanos(58), third.getPathwayLatencyNano()); + assertEquals(MILLISECONDS.toNanos(32), third.getEdgeLatencyNano()); + } + + @Test + void emptyTagsNotSet() { + ControllableTimeSource timeSource = new ControllableTimeSource(); + DefaultPathwayContext context = new DefaultPathwayContext(timeSource, null); + + timeSource.advance(50); + context.setCheckpoint( + fromTags(DataStreamsTags.create("internal", DataStreamsTags.Direction.INBOUND)), + pointConsumer); + timeSource.advance(25); + context.setCheckpoint( + fromTags( + DataStreamsTags.create( + "type", DataStreamsTags.Direction.OUTBOUND, "topic", "group", null)), + pointConsumer); + timeSource.advance(25); + context.setCheckpoint(fromTags(DataStreamsTags.create(null, null)), pointConsumer); + + assertTrue(context.isStarted()); + assertEquals(3, pointConsumer.points.size()); + verifyFirstPoint(pointConsumer.points.get(0)); + StatsPoint second = pointConsumer.points.get(1); + assertEquals("type:type", second.getTags().getType()); + assertEquals("topic:topic", second.getTags().getTopic()); + assertEquals("group:group", second.getTags().getGroup()); + assertEquals("direction:out", second.getTags().getDirection()); + assertEquals(4, second.getTags().nonNullSize()); + assertEquals(pointConsumer.points.get(0).getHash(), second.getParentHash()); + assertNotEquals(0L, second.getHash()); + assertEquals(25L, second.getPathwayLatencyNano()); + assertEquals(25L, second.getEdgeLatencyNano()); + StatsPoint third = pointConsumer.points.get(2); + assertEquals(0, third.getTags().nonNullSize()); + assertEquals(pointConsumer.points.get(1).getHash(), third.getParentHash()); + assertNotEquals(0L, third.getHash()); + assertEquals(50L, third.getPathwayLatencyNano()); + assertEquals(25L, third.getEdgeLatencyNano()); + } + + @TableTest({ + "scenario | dynamicConfigEnabled", + "enabled | true ", + "disabled | false " + }) + void checkContextExtractorDecoratorBehavior(boolean dynamicConfigEnabled) throws IOException { + Sink sink = mock(Sink.class); + DDAgentFeaturesDiscovery features = mock(DDAgentFeaturesDiscovery.class, RETURNS_SMART_NULLS); + when(features.supportsDataStreams()).thenReturn(true); + ControllableTimeSource timeSource = new ControllableTimeSource(); + DatastreamsPayloadWriter payloadWriter = mock(DatastreamsPayloadWriter.class); + + TraceConfig globalTraceConfig = mock(TraceConfig.class, RETURNS_SMART_NULLS); + when(globalTraceConfig.isDataStreamsEnabled()).thenReturn(dynamicConfigEnabled); + + AgentTracer.TracerAPI tracerApi = mock(AgentTracer.TracerAPI.class, RETURNS_SMART_NULLS); + when(tracerApi.captureTraceConfig()).thenReturn(globalTraceConfig); + AgentTracer.TracerAPI originalTracer = AgentTracer.get(); + AgentTracer.forceRegister(tracerApi); + + try { + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> globalTraceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + + BaseHash.updateBaseHash(BASE_HASH); + DefaultPathwayContext context = new DefaultPathwayContext(timeSource, null); + timeSource.advance(MILLISECONDS.toNanos(50)); + context.setCheckpoint( + fromTags(DataStreamsTags.create("internal", DataStreamsTags.Direction.INBOUND)), + pointConsumer); + String encoded = context.encode(); + Map carrier = new HashMap<>(); + carrier.put(PROPAGATION_KEY_BASE64, encoded); + carrier.put("someotherkey", "someothervalue"); + Base64MapContextVisitor contextVisitor = new Base64MapContextVisitor(); + Propagator propagator = dataStreams.propagator(); + + Context extractedContext = propagator.extract(root(), carrier, contextVisitor); + AgentSpan extractedSpan = AgentSpan.fromContext(extractedContext); + + assertEquals("L+lDG/Pa9hRkZA==", encoded); + if (dynamicConfigEnabled) { + assertNotNull(extractedSpan); + assertNotNull(extractedSpan.spanContext()); + assertNotNull(extractedSpan.spanContext().getPathwayContext()); + assertTrue(extractedSpan.spanContext().getPathwayContext().isStarted()); + } + } finally { + // cleanup + AgentTracer.forceRegister(originalTracer); + } + } + + @TableTest({ + "scenario | globalDsmEnabled", + "enabled | true ", + "disabled | false " + }) + void checkContextExtractorDecoratorBehaviorWhenTraceDataIsNull(boolean globalDsmEnabled) + throws IOException { + Sink sink = mock(Sink.class); + DDAgentFeaturesDiscovery features = mock(DDAgentFeaturesDiscovery.class, RETURNS_SMART_NULLS); + when(features.supportsDataStreams()).thenReturn(true); + ControllableTimeSource timeSource = new ControllableTimeSource(); + DatastreamsPayloadWriter payloadWriter = mock(DatastreamsPayloadWriter.class); + + TraceConfig globalTraceConfig = mock(TraceConfig.class, RETURNS_SMART_NULLS); + when(globalTraceConfig.isDataStreamsEnabled()).thenReturn(globalDsmEnabled); + + AgentTracer.TracerAPI tracerApi = mock(AgentTracer.TracerAPI.class, RETURNS_SMART_NULLS); + when(tracerApi.captureTraceConfig()).thenReturn(globalTraceConfig); + AgentTracer.TracerAPI originalTracer = AgentTracer.get(); + AgentTracer.forceRegister(tracerApi); + + try { + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> globalTraceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + + BaseHash.updateBaseHash(BASE_HASH); + DefaultPathwayContext context = new DefaultPathwayContext(timeSource, null); + timeSource.advance(MILLISECONDS.toNanos(50)); + context.setCheckpoint( + fromTags(DataStreamsTags.create("internal", DataStreamsTags.Direction.INBOUND)), + pointConsumer); + String encoded = context.encode(); + + Map carrier = new HashMap<>(); + carrier.put(PROPAGATION_KEY_BASE64, encoded); + carrier.put("someotherkey", "someothervalue"); + Base64MapContextVisitor contextVisitor = new Base64MapContextVisitor(); + Propagator propagator = dataStreams.propagator(); + + Context extractedContext = propagator.extract(root(), carrier, contextVisitor); + AgentSpan extractedSpan = AgentSpan.fromContext(extractedContext); + + assertEquals("L+lDG/Pa9hRkZA==", encoded); + if (globalDsmEnabled) { + assertNotNull(extractedSpan); + assertNotNull(extractedSpan.spanContext()); + assertNotNull(extractedSpan.spanContext().getPathwayContext()); + assertTrue(extractedSpan.spanContext().getPathwayContext().isStarted()); + } else { + assertNull(extractedSpan); + } + } finally { + // cleanup + AgentTracer.forceRegister(originalTracer); + } + } + + @ParameterizedTest + @ValueSource(booleans = {true, false}) + void checkContextExtractorDecoratorBehaviorWhenLocalTraceConfigIsNull(boolean globalDsmEnabled) + throws IOException { + Sink sink = mock(Sink.class); + DDAgentFeaturesDiscovery features = mock(DDAgentFeaturesDiscovery.class, RETURNS_SMART_NULLS); + when(features.supportsDataStreams()).thenReturn(true); + ControllableTimeSource timeSource = new ControllableTimeSource(); + DatastreamsPayloadWriter payloadWriter = mock(DatastreamsPayloadWriter.class); + + TraceConfig globalTraceConfig = mock(TraceConfig.class, RETURNS_SMART_NULLS); + when(globalTraceConfig.isDataStreamsEnabled()).thenReturn(globalDsmEnabled); + + AgentTracer.TracerAPI tracerApi = mock(AgentTracer.TracerAPI.class, RETURNS_SMART_NULLS); + when(tracerApi.captureTraceConfig()).thenReturn(globalTraceConfig); + AgentTracer.TracerAPI originalTracer = AgentTracer.get(); + AgentTracer.forceRegister(tracerApi); + + try { + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> globalTraceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + + BaseHash.updateBaseHash(BASE_HASH); + DefaultPathwayContext context = new DefaultPathwayContext(timeSource, null); + timeSource.advance(MILLISECONDS.toNanos(50)); + context.setCheckpoint( + fromTags(DataStreamsTags.create("internal", DataStreamsTags.Direction.INBOUND)), + pointConsumer); + String encoded = context.encode(); + Map carrier = new HashMap<>(); + carrier.put(PROPAGATION_KEY_BASE64, encoded); + carrier.put("someotherkey", "someothervalue"); + Base64MapContextVisitor contextVisitor = new Base64MapContextVisitor(); + ExtractedContext spanContext = + new ExtractedContext( + DDTraceId.ONE, + 1, + 0, + null, + 0, + null, + (TagMap) null, + null, + null, + globalTraceConfig, + DATADOG); + Context baseContext = AgentSpan.fromSpanContext(spanContext).storeInto(root()); + Propagator propagator = dataStreams.propagator(); + + Context extractedContext = propagator.extract(baseContext, carrier, contextVisitor); + AgentSpan extractedSpan = AgentSpan.fromContext(extractedContext); + + assertNotNull(extractedSpan); + + Object extracted = extractedSpan.spanContext(); + + assertNotNull(extracted); + assertEquals("L+lDG/Pa9hRkZA==", encoded); + if (globalDsmEnabled) { + assertNotNull(extractedSpan.spanContext().getPathwayContext()); + assertTrue(extractedSpan.spanContext().getPathwayContext().isStarted()); + } else { + assertNull(extractedSpan.spanContext().getPathwayContext()); + } + } finally { + // cleanup + AgentTracer.forceRegister(originalTracer); + } + } + + @Test + void checkContextExtractorDecoratorBehaviorWhenTraceDataAndDsmDataAreNull() { + Sink sink = mock(Sink.class); + DDAgentFeaturesDiscovery features = mock(DDAgentFeaturesDiscovery.class, RETURNS_SMART_NULLS); + when(features.supportsDataStreams()).thenReturn(true); + ControllableTimeSource timeSource = new ControllableTimeSource(); + DatastreamsPayloadWriter payloadWriter = mock(DatastreamsPayloadWriter.class); + + TraceConfig traceConfig = mock(TraceConfig.class, RETURNS_SMART_NULLS); + when(traceConfig.isDataStreamsEnabled()).thenReturn(true); + + DefaultDataStreamsMonitoring dataStreams = + new DefaultDataStreamsMonitoring( + sink, + features, + timeSource, + () -> traceConfig, + payloadWriter, + DEFAULT_BUCKET_DURATION_NANOS); + + Map carrier = new HashMap<>(); + carrier.put("someotherkey", "someothervalue"); + Base64MapContextVisitor contextVisitor = new Base64MapContextVisitor(); + Propagator propagator = dataStreams.propagator(); + + Context extractedContext = propagator.extract(root(), carrier, contextVisitor); + AgentSpan extractedSpan = AgentSpan.fromContext(extractedContext); + + assertNull(extractedSpan); + } + + static class CapturingPointConsumer implements Consumer { + final List points = new ArrayList<>(); + + @Override + public void accept(StatsPoint point) { + points.add(point); + } + } + + static class Base64MapContextVisitor + implements AgentPropagation.ContextVisitor> { + @Override + public void forEachKey(Map carrier, AgentPropagation.KeyClassifier classifier) { + for (Map.Entry entry : carrier.entrySet()) { + classifier.accept(entry.getKey(), entry.getValue()); + } + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/datastreams/SchemaBuilderTest.java b/dd-trace-core/src/test/java/datadog/trace/core/datastreams/SchemaBuilderTest.java new file mode 100644 index 00000000000..51f000363d2 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/datastreams/SchemaBuilderTest.java @@ -0,0 +1,60 @@ +package datadog.trace.core.datastreams; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.bootstrap.instrumentation.api.Schema; +import datadog.trace.bootstrap.instrumentation.api.SchemaIterator; +import datadog.trace.core.DDCoreJavaSpecification; +import java.util.HashMap; +import org.junit.jupiter.api.Test; + +public class SchemaBuilderTest extends DDCoreJavaSpecification { + + static class Iterator implements SchemaIterator { + @Override + public void iterateOverSchema( + datadog.trace.bootstrap.instrumentation.api.SchemaBuilder builder) { + HashMap extension = new HashMap<>(1); + extension.put("x-test-extension-1", "hello"); + extension.put("x-test-extension-2", "world"); + builder.addProperty( + "person", "name", false, "string", "name of the person", null, null, null, null); + builder.addProperty("person", "phone_numbers", true, "string", null, null, null, null, null); + builder.addProperty("person", "person_name", false, "string", null, null, null, null, null); + builder.addProperty( + "person", + "address", + false, + "object", + null, + "#/components/schemas/address", + null, + null, + null); + builder.addProperty("address", "zip", false, "number", null, null, "int", null, null); + builder.addProperty("address", "street", false, "string", null, null, null, null, extension); + } + } + + @Test + void schemaIsConvertedCorrectlyToJson() { + SchemaBuilder builder = new SchemaBuilder(new Iterator()); + + boolean shouldExtractPerson = builder.shouldExtractSchema("person", 0); + boolean shouldExtractAddress = builder.shouldExtractSchema("address", 1); + boolean shouldExtractPerson2 = builder.shouldExtractSchema("person", 0); + boolean shouldExtractTooDeep = builder.shouldExtractSchema("city", 11); + Schema schema = builder.build(); + + String expectedDefinition = + "{\"components\":{\"schemas\":{\"person\":{\"properties\":{\"name\":{\"description\":\"name of the person\",\"type\":\"string\"},\"phone_numbers\":{\"items\":{\"type\":\"string\"},\"type\":\"array\"},\"person_name\":{\"type\":\"string\"},\"address\":{\"$ref\":\"#/components/schemas/address\",\"type\":\"object\"}},\"type\":\"object\"},\"address\":{\"properties\":{\"zip\":{\"format\":\"int\",\"type\":\"number\"},\"street\":{\"extensions\":{\"x-test-extension-1\":\"hello\",\"x-test-extension-2\":\"world\"},\"type\":\"string\"}},\"type\":\"object\"}}},\"openapi\":\"3.0.0\"}"; + assertEquals(expectedDefinition, schema.definition); + assertEquals("16548065305426330543", schema.id); + assertTrue(shouldExtractPerson); + assertTrue(shouldExtractAddress); + assertFalse(shouldExtractPerson2); + assertFalse(shouldExtractTooDeep); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/datastreams/SchemaSamplerTest.java b/dd-trace-core/src/test/java/datadog/trace/core/datastreams/SchemaSamplerTest.java new file mode 100644 index 00000000000..42479eb85cc --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/datastreams/SchemaSamplerTest.java @@ -0,0 +1,33 @@ +package datadog.trace.core.datastreams; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.core.DDCoreJavaSpecification; +import org.junit.jupiter.api.Test; + +public class SchemaSamplerTest extends DDCoreJavaSpecification { + + @Test + void schemaSamplerSamplesWithCorrectWeights() { + long currentTimeMillis = 100000; + SchemaSampler sampler = new SchemaSampler(); + + boolean canSample1 = sampler.canSample(currentTimeMillis); + int weight1 = sampler.trySample(currentTimeMillis); + boolean canSample2 = sampler.canSample(currentTimeMillis + 1000); + boolean canSample3 = sampler.canSample(currentTimeMillis + 2000); + boolean canSample4 = sampler.canSample(currentTimeMillis + 30000); + int weight4 = sampler.trySample(currentTimeMillis + 30000); + boolean canSample5 = sampler.canSample(currentTimeMillis + 30001); + + assertTrue(canSample1); + assertEquals(1, weight1); + assertFalse(canSample2); + assertFalse(canSample3); + assertTrue(canSample4); + assertEquals(3, weight4); + assertFalse(canSample5); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/datastreams/TransactionContainerTest.java b/dd-trace-core/src/test/java/datadog/trace/core/datastreams/TransactionContainerTest.java new file mode 100644 index 00000000000..5f37096515e --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/datastreams/TransactionContainerTest.java @@ -0,0 +1,50 @@ +package datadog.trace.core.datastreams; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import datadog.trace.api.datastreams.TransactionInfo; +import datadog.trace.api.datastreams.TransactionInfoTestBridge; +import datadog.trace.core.DDCoreJavaSpecification; +import org.junit.jupiter.api.Test; + +public class TransactionContainerTest extends DDCoreJavaSpecification { + + private static final byte[] EXPECTED_CONTAINER_DATA = + new byte[] {1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 49, 2, 0, 0, 0, 0, 0, 0, 0, 2, 1, 50}; + + @Test + void testWithNoResize() { + TransactionInfoTestBridge.resetCache(); + TransactionContainer container = new TransactionContainer(1024); + container.add(new TransactionInfo("1", 1, "1")); + container.add(new TransactionInfo("2", 2, "2")); + byte[] data = container.getData(); + + assertEquals(22, data.length); + assertArrayEquals(EXPECTED_CONTAINER_DATA, data); + } + + @Test + void testWithResize() { + TransactionInfoTestBridge.resetCache(); + TransactionContainer container = new TransactionContainer(10); + container.add(new TransactionInfo("1", 1, "1")); + container.add(new TransactionInfo("2", 2, "2")); + byte[] data = container.getData(); + + assertEquals(22, data.length); + assertArrayEquals(EXPECTED_CONTAINER_DATA, data); + } + + @Test + void testCheckpointMap() { + TransactionInfoTestBridge.resetCache(); + new TransactionInfo("1", 1, "1"); + new TransactionInfo("2", 2, "2"); + byte[] data = TransactionInfo.getCheckpointIdCacheBytes(); + + assertEquals(6, data.length); + assertArrayEquals(new byte[] {1, 1, 49, 2, 1, 50}, data); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/monitor/HealthMetricsTest.java b/dd-trace-core/src/test/java/datadog/trace/core/monitor/HealthMetricsTest.java index 670c4cda113..03f2384f179 100644 --- a/dd-trace-core/src/test/java/datadog/trace/core/monitor/HealthMetricsTest.java +++ b/dd-trace-core/src/test/java/datadog/trace/core/monitor/HealthMetricsTest.java @@ -387,17 +387,33 @@ void testOnLongRunningUpdate() throws InterruptedException { @Test void testOnStatsAggregateDropped() throws InterruptedException { - CountDownLatch latch = new CountDownLatch(1); + // onStatsAggregateDropped emits two statsd calls: an immediate collapsed_spans count and the + // periodic stats.dropped_aggregates report — wait for both before verifying. + CountDownLatch latch = new CountDownLatch(2); try (TracerHealthMetrics healthMetrics = new TracerHealthMetrics(new Latched(statsD, latch), 100, TimeUnit.MILLISECONDS)) { healthMetrics.start(); healthMetrics.onStatsAggregateDropped(); assertTrue(latch.await(5, TimeUnit.SECONDS)); } + verify(statsD).count("datadog.tracer.stats.collapsed_spans", 1L, "collapsed:whole_key"); verify(statsD).count("stats.dropped_aggregates", 1L, "reason:lru_eviction"); verifyNoMoreInteractions(statsD); } + @Test + void testOnStatsInboxFull() throws InterruptedException { + CountDownLatch latch = new CountDownLatch(1); + try (TracerHealthMetrics healthMetrics = + new TracerHealthMetrics(new Latched(statsD, latch), 100, TimeUnit.MILLISECONDS)) { + healthMetrics.start(); + healthMetrics.onStatsInboxFull(); + assertTrue(latch.await(5, TimeUnit.SECONDS)); + } + verify(statsD).count("stats.dropped_aggregates", 1L, "reason:inbox_full"); + verifyNoMoreInteractions(statsD); + } + private static class Latched implements StatsDClient { private final StatsDClient delegate; private final CountDownLatch latch; diff --git a/dd-trace-core/src/test/java/datadog/trace/core/otlp/common/OtlpCommonJsonTest.java b/dd-trace-core/src/test/java/datadog/trace/core/otlp/common/OtlpCommonJsonTest.java new file mode 100644 index 00000000000..ac77655d613 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/otlp/common/OtlpCommonJsonTest.java @@ -0,0 +1,108 @@ +package datadog.trace.core.otlp.common; + +import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.BOOLEAN_ARRAY_ATTRIBUTE; +import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.BOOLEAN_ATTRIBUTE; +import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.DOUBLE_ATTRIBUTE; +import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.LONG_ARRAY_ATTRIBUTE; +import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.LONG_ATTRIBUTE; +import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.STRING_ARRAY_ATTRIBUTE; +import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.STRING_ATTRIBUTE; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import datadog.json.JsonMapper; +import datadog.json.JsonWriter; +import datadog.trace.api.DD128bTraceId; +import java.io.IOException; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.Test; + +class OtlpCommonJsonTest { + + @Test + void hexTraceIdEncodesHighAndLowOrderBytes() { + DD128bTraceId traceId = DD128bTraceId.from(0x0123456789abcdefL, 0xfedcba9876543210L); + assertEquals("0123456789abcdeffedcba9876543210", OtlpCommonJson.hexTraceId(traceId)); + } + + @Test + void hexSpanIdEncodes64Bits() { + assertEquals("0000000000000001", OtlpCommonJson.hexSpanId(1L)); + assertEquals("00000000000004d2", OtlpCommonJson.hexSpanId(1234L)); + } + + @Test + void stringAttribute() throws IOException { + Map keyValue = writeAndParseAttribute(STRING_ATTRIBUTE, "k", "v"); + assertEquals("k", keyValue.get("key")); + assertEquals("v", valueOf(keyValue).get("stringValue")); + } + + @Test + void booleanAttribute() throws IOException { + Map keyValue = writeAndParseAttribute(BOOLEAN_ATTRIBUTE, "flag", true); + assertEquals(Boolean.TRUE, valueOf(keyValue).get("boolValue")); + } + + @Test + void longAttributeIsEncodedAsDecimalString() throws IOException { + Map keyValue = writeAndParseAttribute(LONG_ATTRIBUTE, "n", 42L); + assertEquals("42", valueOf(keyValue).get("intValue")); + } + + @Test + void doubleAttributeIsEncodedAsNumber() throws IOException { + Map keyValue = writeAndParseAttribute(DOUBLE_ATTRIBUTE, "d", 3.14); + assertEquals(3.14, ((Number) valueOf(keyValue).get("doubleValue")).doubleValue()); + } + + @Test + void stringArrayAttributeWrapsValuesInArrayValue() throws IOException { + Map keyValue = + writeAndParseAttribute(STRING_ARRAY_ATTRIBUTE, "tags", Arrays.asList("a", "b")); + + Map value = valueOf(keyValue); + Map arrayValue = (Map) value.get("arrayValue"); + List values = (List) arrayValue.get("values"); + assertEquals(2, values.size()); + assertEquals("a", ((Map) values.get(0)).get("stringValue")); + assertEquals("b", ((Map) values.get(1)).get("stringValue")); + } + + @Test + void longArrayAttributeEncodesEachElementAsDecimalString() throws IOException { + Map keyValue = + writeAndParseAttribute(LONG_ARRAY_ATTRIBUTE, "ns", Arrays.asList(1L, 2L, 3L)); + + Map arrayValue = (Map) valueOf(keyValue).get("arrayValue"); + List values = (List) arrayValue.get("values"); + assertEquals("1", ((Map) values.get(0)).get("intValue")); + assertEquals("2", ((Map) values.get(1)).get("intValue")); + assertEquals("3", ((Map) values.get(2)).get("intValue")); + } + + @Test + void booleanArrayAttribute() throws IOException { + Map keyValue = + writeAndParseAttribute(BOOLEAN_ARRAY_ATTRIBUTE, "flags", Arrays.asList(true, false)); + + Map arrayValue = (Map) valueOf(keyValue).get("arrayValue"); + List values = (List) arrayValue.get("values"); + assertEquals(Boolean.TRUE, ((Map) values.get(0)).get("boolValue")); + assertEquals(Boolean.FALSE, ((Map) values.get(1)).get("boolValue")); + } + + @SuppressWarnings("unchecked") + private static Map valueOf(Map keyValue) { + return (Map) keyValue.get("value"); + } + + private static Map writeAndParseAttribute(int type, String key, Object value) + throws IOException { + try (JsonWriter writer = new JsonWriter()) { + OtlpCommonJson.writeAttribute(writer, type, key, value); + return JsonMapper.fromJsonToMap(writer.toString()); + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/otlp/common/OtlpGrpcRequestBodyTest.java b/dd-trace-core/src/test/java/datadog/trace/core/otlp/common/OtlpGrpcRequestBodyTest.java new file mode 100644 index 00000000000..702be21873c --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/otlp/common/OtlpGrpcRequestBodyTest.java @@ -0,0 +1,91 @@ +package datadog.trace.core.otlp.common; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.nio.ByteBuffer; +import java.util.zip.GZIPInputStream; +import okhttp3.MediaType; +import okio.Buffer; +import org.junit.jupiter.api.Test; + +class OtlpGrpcRequestBodyTest { + + @Test + void contentTypeIsApplicationGrpc() { + OtlpGrpcRequestBody body = + new OtlpGrpcRequestBody( + new OtlpPayload(ByteBuffer.wrap(new byte[] {1, 2, 3}), "application/grpc+proto"), + false); + + assertEquals(MediaType.get("application/grpc"), body.contentType()); + } + + @Test + void contentLengthIsHeaderPlusPayloadWhenUncompressed() { + OtlpGrpcRequestBody body = + new OtlpGrpcRequestBody( + new OtlpPayload(ByteBuffer.wrap(new byte[] {1, 2, 3, 4}), "application/grpc+proto"), + false); + + // 5-byte header (1 flag + 4 length) + 4-byte payload = 9 + assertEquals(9, body.contentLength()); + } + + @Test + void contentLengthIsNegativeOneWhenGzipped() { + OtlpGrpcRequestBody body = + new OtlpGrpcRequestBody( + new OtlpPayload(ByteBuffer.wrap(new byte[] {1, 2, 3, 4}), "application/grpc+proto"), + true); + + assertEquals(-1, body.contentLength()); + } + + @Test + void writeToProducesGrpcFrameWithUncompressedFlagWhenNotGzipped() throws IOException { + byte[] data = {10, 20, 30, 40, 50}; + OtlpGrpcRequestBody body = + new OtlpGrpcRequestBody( + new OtlpPayload(ByteBuffer.wrap(data), "application/grpc+proto"), false); + Buffer sink = new Buffer(); + + body.writeTo(sink); + + assertEquals(0, sink.readByte()); // uncompressed flag + assertEquals(data.length, sink.readInt()); // 4-byte big-endian length + assertArrayEquals(data, sink.readByteArray()); // payload + } + + @Test + void writeToProducesGrpcFrameWithCompressedFlagAndGzipDataWhenGzipped() throws IOException { + byte[] data = "the quick brown fox jumps over the lazy dog".getBytes(); + OtlpGrpcRequestBody body = + new OtlpGrpcRequestBody( + new OtlpPayload(ByteBuffer.wrap(data), "application/grpc+proto"), true); + Buffer sink = new Buffer(); + + body.writeTo(sink); + + assertEquals(1, sink.readByte()); // compressed flag + int gzipLength = sink.readInt(); // 4-byte big-endian gzip content length + byte[] gzipped = sink.readByteArray(gzipLength); + assertArrayEquals(data, gunzip(gzipped)); + } + + private static byte[] gunzip(byte[] gzipped) throws IOException { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + try (InputStream gz = new GZIPInputStream(new ByteArrayInputStream(gzipped))) { + byte[] buf = new byte[256]; + int n; + while ((n = gz.read(buf)) > 0) { + out.write(buf, 0, n); + } + } + return out.toByteArray(); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/otlp/common/OtlpResourceJsonTest.java b/dd-trace-core/src/test/java/datadog/trace/core/otlp/common/OtlpResourceJsonTest.java new file mode 100644 index 00000000000..84ef6a9c3ae --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/otlp/common/OtlpResourceJsonTest.java @@ -0,0 +1,237 @@ +package datadog.trace.core.otlp.common; + +import static datadog.communication.ddagent.TracerVersion.TRACER_VERSION; +import static datadog.trace.api.config.GeneralConfig.ENV; +import static datadog.trace.api.config.GeneralConfig.SERVICE_NAME; +import static datadog.trace.api.config.GeneralConfig.TAGS; +import static datadog.trace.api.config.GeneralConfig.VERSION; +import static datadog.trace.api.config.OtlpConfig.OTEL_TRACES_SPAN_METRICS_ENABLED; +import static datadog.trace.api.config.TracerConfig.TRACE_REPORT_HOSTNAME; +import static datadog.trace.core.otlp.common.OtlpResourceAttributes.datadogResourceAttributes; +import static datadog.trace.core.otlp.common.OtlpResourceAttributes.traceResourceAttributes; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.json.JsonMapper; +import datadog.trace.api.Config; +import java.io.IOException; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.stream.Stream; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +/** + * Tests for {@link OtlpResourceJson#buildResourceFragment}, mirroring {@link OtlpResourceProtoTest} + * to keep the proto and JSON encoders in parity. + */ +class OtlpResourceJsonTest { + + // ── test data ───────────────────────────────────────────────────────────── + + private static Properties props(String... keyValues) { + Properties props = new Properties(); + for (int i = 0; i < keyValues.length; i += 2) { + props.setProperty(keyValues[i], keyValues[i + 1]); + } + return props; + } + + private static Map attrs(String... keyValues) { + Map map = new LinkedHashMap<>(); + for (int i = 0; i < keyValues.length; i += 2) { + map.put(keyValues[i], keyValues[i + 1]); + } + map.put("telemetry.sdk.name", "datadog"); + map.put("telemetry.sdk.version", TRACER_VERSION); + map.put("telemetry.sdk.language", "java"); + return map; + } + + static Stream resourceFragmentCases() { + return Stream.of( + Arguments.of( + "service not set, no env, no version, no tags", + props(), + attrs("service.name", Config.get().getServiceName())), + Arguments.of( + "custom service name, no env, no version, no tags", + props(SERVICE_NAME, "my-service"), + attrs("service.name", "my-service")), + Arguments.of( + "env set to empty string", + props(SERVICE_NAME, "my-service", ENV, ""), + attrs("service.name", "my-service")), + Arguments.of( + "env set to non-empty value", + props(SERVICE_NAME, "my-service", ENV, "prod"), + attrs("service.name", "my-service", "deployment.environment.name", "prod")), + Arguments.of( + "version set to empty string", + props(SERVICE_NAME, "my-service", VERSION, ""), + attrs("service.name", "my-service")), + Arguments.of( + "version set to non-empty value", + props(SERVICE_NAME, "my-service", VERSION, "1.0.0"), + attrs("service.name", "my-service", "service.version", "1.0.0")), + Arguments.of( + "tags as comma-separated key:value pairs", + props(SERVICE_NAME, "my-service", TAGS, "region:us-east,team:platform"), + attrs( + "service.name", "my-service", + "region", "us-east", + "team", "platform")), + Arguments.of( + "report-hostname enabled", + props(SERVICE_NAME, "my-service", TRACE_REPORT_HOSTNAME, "true"), + attrs("service.name", "my-service", "host.name", Config.get().getHostName())), + Arguments.of( + "service, env, version, and tags all set", + props( + SERVICE_NAME, + "my-service", + ENV, + "staging", + VERSION, + "2.0.0", + TAGS, + "region:eu-west," + + "service:ignored-service," + + "env:ignored-env," + + "version:ignored-version," + + "SERVICE:ignored-service," + + "ENV:ignored-env," + + "VERSION:ignored-version," + + "service.name:ignored-service," + + "deployment.environment.name:ignored-env," + + "service.version:ignored-version," + + "SERVICE.NAME:ignored-service," + + "DEPLOYMENT.ENVIRONMENT.NAME:ignored-env," + + "SERVICE.VERSION:ignored-version," + + "telemetry.sdk.name:ignored-sdk," + + "telemetry.sdk.version:ignored-version," + + "telemetry.sdk.language:ignored-language"), + attrs( + "service.name", "my-service", + "deployment.environment.name", "staging", + "service.version", "2.0.0", + "region", "eu-west"))); + } + + // ── tests ───────────────────────────────────────────────────────────────── + + @ParameterizedTest(name = "{0}") + @MethodSource("resourceFragmentCases") + void testBuildResourceFragment( + String caseName, Properties properties, Map expectedAttributes) + throws IOException { + Config config = Config.get(properties); + String fragment = OtlpResourceJson.buildResourceFragment(config, Collections.emptyMap()); + + Map actualAttributes = parseResourceAttributes(fragment); + assertEquals(expectedAttributes, actualAttributes, "For case: " + caseName); + } + + /** + * The datadog-attrs variant carries {@code datadog.runtime_id}; the plain variant omits it. + * (Process tags are emitted only when the experimental process-tag propagation is enabled, so + * they aren't asserted here.) + */ + @Test + void datadogResourceAttributesVariantCarriesRuntimeId() throws IOException { + Config config = Config.get(props(SERVICE_NAME, "my-service")); + + Map withDatadog = + parseResourceAttributes( + OtlpResourceJson.buildResourceFragment(config, datadogResourceAttributes(config))); + Map plain = + parseResourceAttributes( + OtlpResourceJson.buildResourceFragment(config, Collections.emptyMap())); + + assertTrue( + withDatadog.containsKey("datadog.runtime_id"), + "datadog-attrs variant carries datadog.runtime_id"); + assertEquals( + config.getRuntimeId(), + withDatadog.get("datadog.runtime_id"), + "runtime id matches the config value"); + assertFalse(plain.containsKey("datadog.runtime_id"), "plain variant omits datadog.runtime_id"); + } + + @Test + void statsComputedVariantCarriesMarker() throws IOException { + Config withMetrics = + Config.get(props(SERVICE_NAME, "my-service", OTEL_TRACES_SPAN_METRICS_ENABLED, "true")); + Config withoutMetrics = Config.get(props(SERVICE_NAME, "my-service")); + + Map withMarker = + parseResourceAttributes( + OtlpResourceJson.buildResourceFragment( + withMetrics, traceResourceAttributes(withMetrics))); + Map without = + parseResourceAttributes( + OtlpResourceJson.buildResourceFragment( + withoutMetrics, traceResourceAttributes(withoutMetrics))); + + assertEquals( + "true", withMarker.get("_dd.stats_computed"), "marker present when stats computed"); + assertFalse(without.containsKey("_dd.stats_computed"), "marker absent when stats not computed"); + } + + @Test + void cannedFragmentsMatchTheirProtoCounterparts() throws IOException { + assertEquals( + parseResourceAttributesFromProto(OtlpResourceProto.RESOURCE_MESSAGE), + parseResourceAttributes(OtlpResourceJson.RESOURCE_FRAGMENT)); + assertEquals( + parseResourceAttributesFromProto(OtlpResourceProto.RESOURCE_MESSAGE_WITH_DATADOG_ATTRS), + parseResourceAttributes(OtlpResourceJson.RESOURCE_FRAGMENT_WITH_DATADOG_ATTRS)); + assertEquals( + parseResourceAttributesFromProto(OtlpResourceProto.TRACE_RESOURCE_MESSAGE), + parseResourceAttributes(OtlpResourceJson.TRACE_RESOURCE_FRAGMENT)); + } + + // ── parsing helpers ─────────────────────────────────────────────────────── + + @SuppressWarnings("unchecked") + private static Map parseResourceAttributes(String fragment) throws IOException { + Map resource = JsonMapper.fromJsonToMap(fragment); + List attributes = (List) resource.get("attributes"); + + Map result = new LinkedHashMap<>(); + for (Object attribute : attributes) { + Map keyValue = (Map) attribute; + Map value = (Map) keyValue.get("value"); + result.put((String) keyValue.get("key"), (String) value.get("stringValue")); + } + return result; + } + + private static Map parseResourceAttributesFromProto(byte[] bytes) + throws IOException { + com.google.protobuf.CodedInputStream outer = + com.google.protobuf.CodedInputStream.newInstance(bytes); + outer.readTag(); + com.google.protobuf.CodedInputStream resource = outer.readBytes().newCodedInput(); + + Map attributes = new LinkedHashMap<>(); + while (!resource.isAtEnd()) { + resource.readTag(); + com.google.protobuf.CodedInputStream kv = resource.readBytes().newCodedInput(); + kv.readTag(); + String key = kv.readString(); + kv.readTag(); + com.google.protobuf.CodedInputStream av = kv.readBytes().newCodedInput(); + av.readTag(); + String value = av.readString(); + attributes.put(key, value); + } + return attributes; + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/otlp/common/OtlpResourceProtoTest.java b/dd-trace-core/src/test/java/datadog/trace/core/otlp/common/OtlpResourceProtoTest.java index 541f1750554..d9bfe5d9616 100644 --- a/dd-trace-core/src/test/java/datadog/trace/core/otlp/common/OtlpResourceProtoTest.java +++ b/dd-trace-core/src/test/java/datadog/trace/core/otlp/common/OtlpResourceProtoTest.java @@ -5,17 +5,24 @@ import static datadog.trace.api.config.GeneralConfig.SERVICE_NAME; import static datadog.trace.api.config.GeneralConfig.TAGS; import static datadog.trace.api.config.GeneralConfig.VERSION; +import static datadog.trace.api.config.OtlpConfig.OTEL_TRACES_SPAN_METRICS_ENABLED; +import static datadog.trace.api.config.TracerConfig.TRACE_REPORT_HOSTNAME; +import static datadog.trace.core.otlp.common.OtlpResourceAttributes.datadogResourceAttributes; +import static datadog.trace.core.otlp.common.OtlpResourceAttributes.traceResourceAttributes; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import com.google.protobuf.CodedInputStream; import com.google.protobuf.WireFormat; import datadog.trace.api.Config; import java.io.IOException; +import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; import java.util.Properties; import java.util.stream.Stream; +import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -99,6 +106,11 @@ static Stream resourceMessageCases() { "service.name", "my-service", "region", "us-east", "team", "platform")), + // report-hostname enabled: host.name written with the detected hostname + Arguments.of( + "report-hostname enabled", + props(SERVICE_NAME, "my-service", TRACE_REPORT_HOSTNAME, "true"), + attrs("service.name", "my-service", "host.name", Config.get().getHostName())), // all config values set together; telemetry.sdk.* keys in tags must be ignored Arguments.of( "service, env, version, and tags all set", @@ -141,12 +153,58 @@ void testBuildResourceMessage( String caseName, Properties properties, Map expectedAttributes) throws IOException { Config config = Config.get(properties); - byte[] bytes = OtlpResourceProto.buildResourceMessage(config); + byte[] bytes = OtlpResourceProto.buildResourceMessage(config, Collections.emptyMap()); Map actualAttributes = parseResourceAttributes(bytes); assertEquals(expectedAttributes, actualAttributes, "For case: " + caseName); } + /** + * The datadog-attrs variant ({@code buildResourceMessage(config, datadogResourceAttributes)}) + * carries {@code datadog.runtime_id}; the plain variant omits it. (Process tags are emitted only + * when the experimental process-tag propagation is enabled, so they aren't asserted here.) + */ + @Test + void datadogResourceAttributesVariantCarriesRuntimeId() throws IOException { + Config config = Config.get(props(SERVICE_NAME, "my-service")); + + Map withDatadog = + parseResourceAttributes( + OtlpResourceProto.buildResourceMessage(config, datadogResourceAttributes(config))); + Map plain = + parseResourceAttributes( + OtlpResourceProto.buildResourceMessage(config, Collections.emptyMap())); + + assertTrue( + withDatadog.containsKey("datadog.runtime_id"), + "datadog-attrs variant carries datadog.runtime_id"); + assertEquals( + config.getRuntimeId(), + withDatadog.get("datadog.runtime_id"), + "runtime id matches the config value"); + assertFalse(plain.containsKey("datadog.runtime_id"), "plain variant omits datadog.runtime_id"); + } + + @Test + void statsComputedVariantCarriesMarker() throws IOException { + Config withMetrics = + Config.get(props(SERVICE_NAME, "my-service", OTEL_TRACES_SPAN_METRICS_ENABLED, "true")); + Config withoutMetrics = Config.get(props(SERVICE_NAME, "my-service")); + + Map withMarker = + parseResourceAttributes( + OtlpResourceProto.buildResourceMessage( + withMetrics, traceResourceAttributes(withMetrics))); + Map without = + parseResourceAttributes( + OtlpResourceProto.buildResourceMessage( + withoutMetrics, traceResourceAttributes(withoutMetrics))); + + assertEquals( + "true", withMarker.get("_dd.stats_computed"), "marker present when stats computed"); + assertFalse(without.containsKey("_dd.stats_computed"), "marker absent when stats not computed"); + } + // ── parsing helpers ─────────────────────────────────────────────────────── /** diff --git a/dd-trace-core/src/test/java/datadog/trace/core/otlp/logs/OtlpLogsJsonCollectorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/otlp/logs/OtlpLogsJsonCollectorTest.java new file mode 100644 index 00000000000..75c4cef2978 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/otlp/logs/OtlpLogsJsonCollectorTest.java @@ -0,0 +1,170 @@ +package datadog.trace.core.otlp.logs; + +import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.STRING_ATTRIBUTE; +import static datadog.trace.core.otlp.common.OtlpCommonJson.hexSpanId; +import static datadog.trace.core.otlp.common.OtlpCommonJson.hexTraceId; +import static java.util.Collections.emptyMap; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.json.JsonMapper; +import datadog.trace.api.sampling.PrioritySampling; +import datadog.trace.api.sampling.SamplingMechanism; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext; +import datadog.trace.bootstrap.otel.common.OtelInstrumentationScope; +import datadog.trace.bootstrap.otlp.logs.OtlpLogRecord; +import datadog.trace.bootstrap.otlp.logs.OtlpScopedLogsVisitor; +import datadog.trace.common.writer.LoggingWriter; +import datadog.trace.core.CoreTracer; +import datadog.trace.core.DDSpan; +import datadog.trace.core.otlp.common.OtlpPayload; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.Test; + +/** + * Tests for {@link OtlpLogsJsonCollector}, parsing the produced JSON back with {@link JsonMapper} + * to verify the OTLP JSON encoding: lowerCamelCase keys, hex trace/span ids, decimal-string + * timestamps, and integer severity/flags. + */ +class OtlpLogsJsonCollectorTest { + + private static final CoreTracer TRACER = CoreTracer.builder().writer(new LoggingWriter()).build(); + private static final OtelInstrumentationScope SCOPE = + new OtelInstrumentationScope("test.logger", null, null); + + @Test + void emptyBatchProducesEmptyPayload() { + OtlpLogsJsonCollector collector = OtlpLogsJsonCollector.INSTANCE; + OtlpPayload payload = collector.collectLogs((visitor, interval) -> {}, 0); + assertEquals(OtlpPayload.EMPTY, payload); + } + + @Test + void logRecordWithoutSpanContextHasNoTraceOrSpanId() throws IOException { + OtlpLogRecord record = logRecord("hello", null, null); + + Map parsed = onlyLogRecord(collect(record, emptyMap())); + + assertEquals("hello", ((Map) parsed.get("body")).get("stringValue")); + assertEquals("9", String.valueOf(parsed.get("severityNumber"))); + assertEquals("INFO", parsed.get("severityText")); + assertTrue(parsed.get("timeUnixNano") instanceof String); + assertTrue(parsed.get("observedTimeUnixNano") instanceof String); + assertFalse(parsed.containsKey("traceId")); + assertFalse(parsed.containsKey("spanId")); + assertFalse(parsed.containsKey("flags")); + } + + @Test + void logRecordWithSpanContextHasHexTraceAndSpanIdAndSampledFlag() throws IOException { + AgentSpan span = TRACER.startSpan("test", "test.op"); + span.setSamplingPriority(PrioritySampling.USER_KEEP, SamplingMechanism.DEFAULT); + span.finish(); + DDSpan ddSpan = (DDSpan) span; + + OtlpLogRecord record = logRecord("with context", ddSpan.spanContext(), null); + Map parsed = onlyLogRecord(collect(record, emptyMap())); + + assertEquals(hexTraceId(ddSpan.getTraceId()), parsed.get("traceId")); + assertEquals(hexSpanId(ddSpan.getSpanId()), parsed.get("spanId")); + assertEquals(1, ((Number) parsed.get("flags")).intValue(), "SAMPLED_TRACE_FLAG = 1"); + } + + @Test + void logRecordWithEventNameHasEventNameField() throws IOException { + OtlpLogRecord record = logRecord("clicked", null, "user.interaction"); + Map parsed = onlyLogRecord(collect(record, emptyMap())); + + assertEquals("user.interaction", parsed.get("eventName")); + } + + @Test + void logRecordWithAttributesWritesAttributesArray() throws IOException { + OtlpLogRecord record = logRecord("tagged", null, null); + Map parsed = + onlyLogRecord(collect(record, Collections.singletonMap("service.name", "svc"))); + + List attributes = (List) parsed.get("attributes"); + assertEquals(1, attributes.size()); + Map attr = (Map) attributes.get(0); + assertEquals("service.name", attr.get("key")); + } + + @Test + void collectionAfterFailedAttributeWriteIsStillWellFormed() throws IOException { + OtlpLogsJsonCollector collector = OtlpLogsJsonCollector.INSTANCE; + + // open the attributes array on the shared/reused collector, then blow up before it's closed + assertThrows( + RuntimeException.class, + () -> + collector.collectLogs( + (visitor, interval) -> { + OtlpScopedLogsVisitor scoped = visitor.visitScopedLogs(SCOPE); + scoped.visitAttribute(STRING_ATTRIBUTE, "service.name", "svc"); + throw new RuntimeException("boom"); + }, + 0)); + + // a subsequent, successful collection must still emit a well-formed attributes array + OtlpLogRecord record = logRecord("tagged", null, null); + Map parsed = + onlyLogRecord(collect(record, Collections.singletonMap("service.name", "svc"))); + + List attributes = (List) parsed.get("attributes"); + assertEquals(1, attributes.size()); + Map attr = (Map) attributes.get(0); + assertEquals("service.name", attr.get("key")); + } + + // ── helpers ────────────────────────────────────────────────────────────── + + private static OtlpLogRecord logRecord(String body, AgentSpanContext ctx, String eventName) { + return new OtlpLogRecord( + SCOPE, + 1_700_000_000_000_000_000L, + 1_700_000_000_001_000_000L, + 9, + "INFO", + body, + emptyMap(), + ctx, + eventName); + } + + private static OtlpPayload collect(OtlpLogRecord record, Map attrs) { + OtlpLogsJsonCollector collector = OtlpLogsJsonCollector.INSTANCE; + return collector.collectLogs( + (visitor, interval) -> { + OtlpScopedLogsVisitor scoped = visitor.visitScopedLogs(SCOPE); + for (Map.Entry attr : attrs.entrySet()) { + scoped.visitAttribute(STRING_ATTRIBUTE, attr.getKey(), attr.getValue()); + } + scoped.visitLogRecord(record); + }, + 0); + } + + @SuppressWarnings("unchecked") + private static Map onlyLogRecord(OtlpPayload payload) throws IOException { + byte[] bytes = new byte[payload.getContentLength()]; + payload.getContent().get(bytes); + String json = new String(bytes, StandardCharsets.UTF_8); + Map root = JsonMapper.fromJsonToMap(json); + + List resourceLogs = (List) root.get("resourceLogs"); + Map resourceLog = (Map) resourceLogs.get(0); + List scopeLogs = (List) resourceLog.get("scopeLogs"); + Map scopeLog = (Map) scopeLogs.get(0); + List logRecords = (List) scopeLog.get("logRecords"); + assertEquals(1, logRecords.size()); + return (Map) logRecords.get(0); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/otlp/logs/OtlpLogsProtoTest.java b/dd-trace-core/src/test/java/datadog/trace/core/otlp/logs/OtlpLogsProtoTest.java index a9ddef32e35..735653921cb 100644 --- a/dd-trace-core/src/test/java/datadog/trace/core/otlp/logs/OtlpLogsProtoTest.java +++ b/dd-trace-core/src/test/java/datadog/trace/core/otlp/logs/OtlpLogsProtoTest.java @@ -4,7 +4,7 @@ import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.DOUBLE_ATTRIBUTE; import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.LONG_ATTRIBUTE; import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.STRING_ATTRIBUTE; -import static datadog.trace.core.otlp.trace.OtlpTraceProto.SAMPLED_TRACE_FLAG; +import static datadog.trace.core.otlp.common.OtlpTraceFlags.SAMPLED_TRACE_FLAG; import static java.util.Arrays.asList; import static java.util.Collections.emptyList; import static java.util.Collections.emptyMap; @@ -473,7 +473,7 @@ private static AgentSpanContext resolveContext(List spans, LogSpec spec) return null; } DDSpan span = spans.get(spec.spanContextIndex); - return span.context(); + return span.spanContext(); } // ── grouping helper ─────────────────────────────────────────────────────── diff --git a/dd-trace-core/src/test/java/datadog/trace/core/otlp/logs/OtlpLogsServiceTest.java b/dd-trace-core/src/test/java/datadog/trace/core/otlp/logs/OtlpLogsServiceTest.java new file mode 100644 index 00000000000..0954e0e56d2 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/otlp/logs/OtlpLogsServiceTest.java @@ -0,0 +1,27 @@ +package datadog.trace.core.otlp.logs; + +import static datadog.trace.api.config.OtlpConfig.OTLP_LOGS_ENDPOINT; +import static datadog.trace.api.config.OtlpConfig.OTLP_LOGS_PROTOCOL; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; + +import datadog.trace.api.Config; +import datadog.trace.core.otlp.common.OtlpHttpSender; +import java.util.Properties; +import org.junit.jupiter.api.Test; + +class OtlpLogsServiceTest { + + @Test + void httpJsonProtocolUsesJsonCollectorAndConfiguredEndpoint() { + Properties properties = new Properties(); + properties.setProperty(OTLP_LOGS_PROTOCOL, "http/json"); + properties.setProperty(OTLP_LOGS_ENDPOINT, "http://localhost:4318/v1/logs"); + + OtlpLogsService service = new OtlpLogsService(Config.get(properties)); + + assertInstanceOf(OtlpLogsJsonCollector.class, service.getCollector()); + OtlpHttpSender sender = assertInstanceOf(OtlpHttpSender.class, service.getSender()); + assertEquals("http://localhost:4318/v1/logs", sender.url().toString()); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/otlp/metrics/OtlpMetricsJsonCollectorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/otlp/metrics/OtlpMetricsJsonCollectorTest.java new file mode 100644 index 00000000000..a3cbf6a0637 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/otlp/metrics/OtlpMetricsJsonCollectorTest.java @@ -0,0 +1,250 @@ +package datadog.trace.core.otlp.metrics; + +import static datadog.trace.bootstrap.otel.metrics.OtelInstrumentType.COUNTER; +import static datadog.trace.bootstrap.otel.metrics.OtelInstrumentType.GAUGE; +import static datadog.trace.bootstrap.otel.metrics.OtelInstrumentType.HISTOGRAM; +import static datadog.trace.bootstrap.otlp.common.OtlpAttributeVisitor.STRING_ATTRIBUTE; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.json.JsonMapper; +import datadog.trace.api.time.ControllableTimeSource; +import datadog.trace.bootstrap.otel.common.OtelInstrumentationScope; +import datadog.trace.bootstrap.otel.metrics.OtelInstrumentDescriptor; +import datadog.trace.bootstrap.otlp.metrics.OtlpDoublePoint; +import datadog.trace.bootstrap.otlp.metrics.OtlpHistogramPoint; +import datadog.trace.bootstrap.otlp.metrics.OtlpLongPoint; +import datadog.trace.bootstrap.otlp.metrics.OtlpMetricVisitor; +import datadog.trace.bootstrap.otlp.metrics.OtlpMetricsVisitor; +import datadog.trace.bootstrap.otlp.metrics.OtlpScopedMetricsVisitor; +import datadog.trace.core.otlp.common.OtlpPayload; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import java.util.function.Consumer; +import org.junit.jupiter.api.Test; + +/** + * Tests for {@link OtlpMetricsJsonCollector}, parsing the produced JSON back with {@link + * JsonMapper} to verify the OTLP JSON encoding: lowerCamelCase keys, integer aggregation + * temporality, decimal-string timestamps/counts, and the overflow-bucket handling for histograms. + */ +class OtlpMetricsJsonCollectorTest { + + private static final long START_EPOCH_NS = TimeUnit.SECONDS.toNanos(1330837567); + private static final long END_EPOCH_NS = START_EPOCH_NS + TimeUnit.MINUTES.toNanos(30); + + @Test + void emptyRegistryProducesEmptyPayload() { + OtlpMetricsJsonCollector collector = new OtlpMetricsJsonCollector(new ControllableTimeSource()); + OtlpPayload payload = collector.collectMetrics(visitor -> {}); + assertEquals(OtlpPayload.EMPTY, payload); + } + + @Test + void metricWithNoDataPointsContributesNothing() throws IOException { + OtelInstrumentDescriptor descriptor = + new OtelInstrumentDescriptor("unused", COUNTER, true, null, null); + + OtlpPayload payload = + collect( + visitor -> { + OtlpScopedMetricsVisitor scoped = + visitor.visitScopedMetrics(new OtelInstrumentationScope("io.test", null, null)); + scoped.visitMetric(descriptor); // never visited with an attribute or data point + }); + + assertEquals(OtlpPayload.EMPTY, payload); + } + + @Test + void scopeWithNoDataPointsContributesNothingWhenAnotherScopeHasData() throws IOException { + OtelInstrumentDescriptor emptyDescriptor = + new OtelInstrumentDescriptor("unused", COUNTER, true, null, null); + + OtlpPayload payload = + collect( + visitor -> { + OtlpScopedMetricsVisitor emptyScope = + visitor.visitScopedMetrics(new OtelInstrumentationScope("io.empty", null, null)); + emptyScope.visitMetric(emptyDescriptor); // never visited with a data point + + OtlpScopedMetricsVisitor dataScope = + visitor.visitScopedMetrics(new OtelInstrumentationScope("io.data", null, null)); + OtlpMetricVisitor mv = + dataScope.visitMetric( + new OtelInstrumentDescriptor("requests", COUNTER, true, null, null)); + mv.visitDataPoint(new OtlpLongPoint(1L)); + }); + + List scopeMetrics = onlyScopeMetrics(payload); + assertEquals(1, scopeMetrics.size(), "the empty scope must not appear in the payload"); + + Map scopeMetric = (Map) scopeMetrics.get(0); + Map scope = (Map) scopeMetric.get("scope"); + assertEquals("io.data", scope.get("name")); + } + + @Test + void gaugeHasNoStartTimeOrTemporality() throws IOException { + Map metric = + onlyMetric( + collect( + visitor -> { + OtlpScopedMetricsVisitor scoped = + visitor.visitScopedMetrics( + new OtelInstrumentationScope("io.gauge", null, null)); + OtlpMetricVisitor mv = + scoped.visitMetric( + new OtelInstrumentDescriptor("connections", GAUGE, false, null, null)); + mv.visitDataPoint(new OtlpDoublePoint(5.0)); + })); + + assertEquals("connections", metric.get("name")); + Map gauge = (Map) metric.get("gauge"); + List dataPoints = (List) gauge.get("dataPoints"); + assertEquals(1, dataPoints.size()); + Map point = (Map) dataPoints.get(0); + assertFalse(point.containsKey("startTimeUnixNano"), "gauges have no start time"); + assertEquals(Long.toString(END_EPOCH_NS), point.get("timeUnixNano")); + assertEquals(5.0, ((Number) point.get("asDouble")).doubleValue()); + } + + @Test + void counterIsMonotonicSumWithIntegerTemporalityAndDecimalStringValue() throws IOException { + Map metric = + onlyMetric( + collect( + visitor -> { + OtlpScopedMetricsVisitor scoped = + visitor.visitScopedMetrics( + new OtelInstrumentationScope("io.test", null, null)); + OtlpMetricVisitor mv = + scoped.visitMetric( + new OtelInstrumentDescriptor("requests", COUNTER, true, null, null)); + mv.visitAttribute(STRING_ATTRIBUTE, "method", "GET"); + mv.visitDataPoint(new OtlpLongPoint(42L)); + })); + + Map sum = (Map) metric.get("sum"); + assertTrue(((Number) sum.get("aggregationTemporality")).intValue() >= 1); + assertEquals(Boolean.TRUE, sum.get("isMonotonic")); + + List dataPoints = (List) sum.get("dataPoints"); + Map point = (Map) dataPoints.get(0); + assertEquals(Long.toString(START_EPOCH_NS), point.get("startTimeUnixNano")); + assertEquals(Long.toString(END_EPOCH_NS), point.get("timeUnixNano")); + assertEquals("42", point.get("asInt")); + + List attributes = (List) point.get("attributes"); + Map attr = (Map) attributes.get(0); + assertEquals("method", attr.get("key")); + } + + @Test + void histogramWithOverflowBoundaryOmitsInfinityAndAppendsNoExtraZero() throws IOException { + Map metric = + onlyMetric( + collect( + visitor -> { + OtlpScopedMetricsVisitor scoped = + visitor.visitScopedMetrics( + new OtelInstrumentationScope("io.hist", null, null)); + OtlpMetricVisitor mv = + scoped.visitMetric( + new OtelInstrumentDescriptor( + "request.size", HISTOGRAM, false, null, null)); + mv.visitDataPoint( + new OtlpHistogramPoint( + 5.0, + Arrays.asList(100.0, Double.POSITIVE_INFINITY), + Arrays.asList(4.0, 1.0), + 280.0, + 20.0, + 200.0)); + })); + + Map histogram = (Map) metric.get("histogram"); + List dataPoints = (List) histogram.get("dataPoints"); + Map point = (Map) dataPoints.get(0); + + assertEquals("5", point.get("count")); + assertEquals(280.0, ((Number) point.get("sum")).doubleValue()); + assertEquals(20.0, ((Number) point.get("min")).doubleValue()); + assertEquals(200.0, ((Number) point.get("max")).doubleValue()); + + List bounds = (List) point.get("explicitBounds"); + assertEquals(Arrays.asList(100.0), bounds); + + List counts = (List) point.get("bucketCounts"); + assertEquals(Arrays.asList("4", "1"), counts); + } + + @Test + void histogramWithoutOverflowBoundaryAppendsExtraZeroCount() throws IOException { + Map metric = + onlyMetric( + collect( + visitor -> { + OtlpScopedMetricsVisitor scoped = + visitor.visitScopedMetrics( + new OtelInstrumentationScope("io.hist", null, null)); + OtlpMetricVisitor mv = + scoped.visitMetric( + new OtelInstrumentDescriptor("queue.size", HISTOGRAM, false, null, null)); + mv.visitDataPoint( + new OtlpHistogramPoint( + 8.0, + Arrays.asList(50.0, 100.0), + Arrays.asList(3.0, 5.0), + 750.0, + 10.0, + 95.0)); + })); + + Map histogram = (Map) metric.get("histogram"); + Map point = + (Map) ((List) histogram.get("dataPoints")).get(0); + + List bounds = (List) point.get("explicitBounds"); + assertEquals(Arrays.asList(50.0, 100.0), bounds); + + List counts = (List) point.get("bucketCounts"); + assertEquals(Arrays.asList("3", "5", "0"), counts, "extra zero count appended, no overflow"); + } + + // ── helpers ────────────────────────────────────────────────────────────── + + private static OtlpPayload collect(Consumer body) { + ControllableTimeSource timeSource = new ControllableTimeSource(); + timeSource.set(START_EPOCH_NS); // captured in constructor + OtlpMetricsJsonCollector collector = new OtlpMetricsJsonCollector(timeSource); + timeSource.set(END_EPOCH_NS); // captured during collection + return collector.collectMetrics(body::accept); + } + + @SuppressWarnings("unchecked") + private static Map onlyMetric(OtlpPayload payload) throws IOException { + List scopeMetrics = onlyScopeMetrics(payload); + Map scopeMetric = (Map) scopeMetrics.get(0); + List metrics = (List) scopeMetric.get("metrics"); + assertEquals(1, metrics.size()); + return (Map) metrics.get(0); + } + + @SuppressWarnings("unchecked") + private static List onlyScopeMetrics(OtlpPayload payload) throws IOException { + byte[] bytes = new byte[payload.getContentLength()]; + payload.getContent().get(bytes); + String json = new String(bytes, StandardCharsets.UTF_8); + Map root = JsonMapper.fromJsonToMap(json); + + List resourceMetrics = (List) root.get("resourceMetrics"); + Map resourceMetric = (Map) resourceMetrics.get(0); + return (List) resourceMetric.get("scopeMetrics"); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/otlp/metrics/OtlpMetricsServiceTest.java b/dd-trace-core/src/test/java/datadog/trace/core/otlp/metrics/OtlpMetricsServiceTest.java new file mode 100644 index 00000000000..70e719a3dbb --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/otlp/metrics/OtlpMetricsServiceTest.java @@ -0,0 +1,27 @@ +package datadog.trace.core.otlp.metrics; + +import static datadog.trace.api.config.OtlpConfig.OTLP_METRICS_ENDPOINT; +import static datadog.trace.api.config.OtlpConfig.OTLP_METRICS_PROTOCOL; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; + +import datadog.trace.api.Config; +import datadog.trace.core.otlp.common.OtlpHttpSender; +import java.util.Properties; +import org.junit.jupiter.api.Test; + +class OtlpMetricsServiceTest { + + @Test + void httpJsonProtocolUsesJsonCollectorAndConfiguredEndpoint() { + Properties properties = new Properties(); + properties.setProperty(OTLP_METRICS_PROTOCOL, "http/json"); + properties.setProperty(OTLP_METRICS_ENDPOINT, "http://localhost:4318/v1/metrics"); + + OtlpMetricsService service = new OtlpMetricsService(Config.get(properties)); + + assertInstanceOf(OtlpMetricsJsonCollector.class, service.getCollector()); + OtlpHttpSender sender = assertInstanceOf(OtlpHttpSender.class, service.getSender()); + assertEquals("http://localhost:4318/v1/metrics", sender.url().toString()); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/otlp/metrics/OtlpMetricsTemporalityTest.java b/dd-trace-core/src/test/java/datadog/trace/core/otlp/metrics/OtlpMetricsTemporalityTest.java new file mode 100644 index 00000000000..2ff24664d2f --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/otlp/metrics/OtlpMetricsTemporalityTest.java @@ -0,0 +1,46 @@ +package datadog.trace.core.otlp.metrics; + +import static datadog.trace.api.config.OtlpConfig.Temporality.CUMULATIVE; +import static datadog.trace.api.config.OtlpConfig.Temporality.DELTA; +import static datadog.trace.api.config.OtlpConfig.Temporality.LOWMEMORY; +import static datadog.trace.bootstrap.otel.metrics.OtelInstrumentType.COUNTER; +import static datadog.trace.bootstrap.otel.metrics.OtelInstrumentType.GAUGE; +import static datadog.trace.bootstrap.otel.metrics.OtelInstrumentType.HISTOGRAM; +import static datadog.trace.bootstrap.otel.metrics.OtelInstrumentType.OBSERVABLE_COUNTER; +import static datadog.trace.core.otlp.metrics.OtlpMetricsTemporality.TEMPORALITY_CUMULATIVE; +import static datadog.trace.core.otlp.metrics.OtlpMetricsTemporality.TEMPORALITY_DELTA; +import static datadog.trace.core.otlp.metrics.OtlpMetricsTemporality.temporality; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +class OtlpMetricsTemporalityTest { + + @Test + void deltaPreferenceMakesEligibleTypesDelta() { + assertEquals(TEMPORALITY_DELTA, temporality(DELTA, HISTOGRAM)); + assertEquals(TEMPORALITY_DELTA, temporality(DELTA, COUNTER)); + assertEquals(TEMPORALITY_DELTA, temporality(DELTA, OBSERVABLE_COUNTER)); + } + + @Test + void deltaPreferenceKeepsIneligibleTypesCumulative() { + assertEquals(TEMPORALITY_CUMULATIVE, temporality(DELTA, GAUGE)); + } + + @Test + void lowMemoryPreferenceMakesEligibleTypesDelta() { + assertEquals(TEMPORALITY_DELTA, temporality(LOWMEMORY, HISTOGRAM)); + assertEquals(TEMPORALITY_DELTA, temporality(LOWMEMORY, COUNTER)); + } + + @Test + void lowMemoryPreferenceKeepsObservableCounterCumulative() { + assertEquals(TEMPORALITY_CUMULATIVE, temporality(LOWMEMORY, OBSERVABLE_COUNTER)); + } + + @Test + void cumulativePreferenceIsAlwaysCumulative() { + assertEquals(TEMPORALITY_CUMULATIVE, temporality(CUMULATIVE, COUNTER)); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/otlp/metrics/OtlpStatsHistogramBucketsTest.java b/dd-trace-core/src/test/java/datadog/trace/core/otlp/metrics/OtlpStatsHistogramBucketsTest.java new file mode 100644 index 00000000000..a24fe5d64b1 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/otlp/metrics/OtlpStatsHistogramBucketsTest.java @@ -0,0 +1,145 @@ +package datadog.trace.core.otlp.metrics; + +import static datadog.trace.core.otlp.metrics.OtlpStatsHistogramBuckets.BOUNDS_SECONDS; +import static datadog.trace.core.otlp.metrics.OtlpStatsHistogramBuckets.EXPLICIT_BOUNDS; +import static datadog.trace.core.otlp.metrics.OtlpStatsHistogramBuckets.bucketIndex; +import static datadog.trace.core.otlp.metrics.OtlpStatsHistogramBuckets.toHistogramPoint; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.metrics.api.Histogram; +import datadog.metrics.api.Histograms; +import datadog.metrics.impl.DDSketchHistograms; +import datadog.trace.bootstrap.otlp.metrics.OtlpHistogramPoint; +import java.util.stream.IntStream; +import java.util.stream.Stream; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +/** + * Unit tests for {@link OtlpStatsHistogramBuckets}, the helper that re-bins a nanosecond-valued + * DDSketch onto the fixed OTLP explicit-bounds histogram layout (in seconds). + */ +class OtlpStatsHistogramBucketsTest { + + private static final double NANOS_PER_SECOND = 1_000_000_000d; + + // Tolerance for double assertions on exactly-computed values (e.g. sum from sumNanos, integer + // counts). DDSketch-derived values like min/max use looser tolerances inline, since the sketch + // only preserves values to within its relative accuracy. + private static final double EPS = 1e-9; + + @BeforeAll + static void registerHistogramFactory() { + Histograms.register(DDSketchHistograms.FACTORY); + } + + // ── bucketIndex ────────────────────────────────────────────────────────── + + static Stream boundsWithIndex() { + return IntStream.range(0, BOUNDS_SECONDS.length) + .mapToObj(i -> Arguments.of(i, BOUNDS_SECONDS[i])); + } + + @ParameterizedTest(name = "value exactly on BOUNDS_SECONDS[{0}]={1} returns index {0}") + @MethodSource("boundsWithIndex") + void valueExactlyOnBoundReturnsThatIndex(int index, double bound) { + // <= semantics: a value exactly on a bound falls in that bound's bucket. + assertEquals(index, bucketIndex(bound)); + } + + @Test + void valueJustAboveSmallBoundFallsInNextBucket() { + // 0.002 is the first bound; a value just above it but below the second bound (0.004) + // must roll into the next index. + assertEquals(0, bucketIndex(0.002)); + assertEquals(1, bucketIndex(0.0020001)); + assertEquals(1, bucketIndex(0.004)); + } + + @Test + void valueAboveLargestBoundIsOverflow() { + // > 15s overflows to the final (16th) index. + assertEquals(BOUNDS_SECONDS.length, bucketIndex(15.0000001)); + assertEquals(BOUNDS_SECONDS.length, bucketIndex(100.0)); + // exactly 15 (the largest non-overflow bound) is the last non-overflow index. + assertEquals(BOUNDS_SECONDS.length - 1, bucketIndex(15.0)); + } + + // ── EXPLICIT_BOUNDS layout ──────────────────────────────────────────────── + + @Test + void explicitBoundsHas17EntriesEndingInInfinity() { + assertEquals(17, EXPLICIT_BOUNDS.size()); + assertEquals(Double.POSITIVE_INFINITY, EXPLICIT_BOUNDS.get(EXPLICIT_BOUNDS.size() - 1)); + } + + // ── toHistogramPoint ────────────────────────────────────────────────────── + + @Test + void toHistogramPointSummary() { + Histogram h = Histogram.newHistogram(); + // 1ns and 1ms are below the smallest bound (0.002s) and must land in bucket 0; 100ms → bucket + // 6, 3s → bucket 13. + long[] samplesNanos = { + 1L, + (long) (0.001 * NANOS_PER_SECOND), + (long) (0.1 * NANOS_PER_SECOND), + (long) (3.0 * NANOS_PER_SECOND) + }; + for (long s : samplesNanos) { + h.accept(s); + } + + // Use a sumNanos that deliberately differs from the sketch's implied sum to prove the + // returned sum comes from the ARGUMENT, not the sketch. + long sumNanos = 42L * (long) NANOS_PER_SECOND; + OtlpHistogramPoint point = toHistogramPoint(h, sumNanos); + + // 17 bucket counts (the EXPLICIT_BOUNDS layout itself is covered by its own test). + assertEquals(17, point.bucketCounts.size()); + + // total count == number of samples. + assertEquals(samplesNanos.length, (long) point.count); + + // max is the 3s sample (CollapsingLowestDenseStore collapses the LOWEST bins, so the top is + // preserved accurately). The exact 1ns min is NOT recoverable: over this wide value range the + // lowest bins collapse, so getMinValue reports the collapsed bin (sub-2ms here), not 1ns. The + // tiny sample isn't lost though — that's proven by the count and bucket-0 assertions below. + // DDSketch is relative-accuracy, so min/max use loose tolerances. + assertTrue( + point.min > 0 && point.min <= BOUNDS_SECONDS[0], "min collapses into bucket 0 range"); + assertEquals(3.0, point.max, 1e-2); + + // sum equals the sumNanos ARGUMENT converted to seconds, not the sketch sum. + assertEquals(42.0, point.sum, EPS); + + long bucketTotal = 0; + for (int i = 0; i < point.bucketCounts.size(); i++) { + long c = (long) point.bucketCounts.get(i).doubleValue(); + bucketTotal += c; + if (i == 0) { + assertEquals(2L, c, "1ns + 1ms both land in bucket 0 (<= 0.002s)"); + } + } + assertEquals(samplesNanos.length, bucketTotal); + } + + @Test + void emptyHistogramHasZeroMinMaxAndCount() { + Histogram h = Histogram.newHistogram(); + OtlpHistogramPoint point = toHistogramPoint(h, 0L); + + assertEquals(0.0, point.count, EPS); + assertEquals(0.0, point.min, EPS); + assertEquals(0.0, point.max, EPS); + long bucketTotal = 0; + for (double c : point.bucketCounts) { + bucketTotal += (long) c; + } + assertEquals(0L, bucketTotal); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/otlp/metrics/OtlpStatsMetricWriterTest.java b/dd-trace-core/src/test/java/datadog/trace/core/otlp/metrics/OtlpStatsMetricWriterTest.java new file mode 100644 index 00000000000..670f9098a14 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/otlp/metrics/OtlpStatsMetricWriterTest.java @@ -0,0 +1,633 @@ +package datadog.trace.core.otlp.metrics; + +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + +import com.google.protobuf.CodedInputStream; +import com.google.protobuf.WireFormat; +import datadog.metrics.api.Histograms; +import datadog.metrics.impl.DDSketchHistograms; +import datadog.trace.common.metrics.AggregateEntry; +import datadog.trace.common.metrics.AggregateEntryTestUtils; +import datadog.trace.core.otlp.common.OtlpPayload; +import datadog.trace.core.otlp.common.OtlpSender; +import java.io.IOException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import javax.annotation.Nullable; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; + +/** + * Tests for {@link OtlpStatsMetricWriter}. Drives the writer through {@code startBucket} → {@code + * add} → {@code finishBucket} with a capturing {@link OtlpSender}, then decodes the emitted + * protobuf {@code ExportMetricsServiceRequest} ({@code MetricsData}) using protobuf's {@link + * CodedInputStream}, reusing the decode idioms from {@code OtlpMetricsProtoTest}. + * + *

      Wire layout (OTLP metrics proto): + * + *

      + *   MetricsData        { ResourceMetrics resource_metrics = 1; }
      + *   ResourceMetrics    { Resource resource = 1; ScopeMetrics scope_metrics = 2; }
      + *   ScopeMetrics       { InstrumentationScope scope = 1; Metric metrics = 2; }
      + *   Metric             { string name = 1; string unit = 3; Histogram histogram = 9; }
      + *   Histogram          { HistogramDataPoint data_points = 1; AggregationTemporality = 2; }
      + *   HistogramDataPoint { fixed64 start = 2; fixed64 time = 3; fixed64 count = 4; double sum = 5;
      + *                        fixed64 bucket_counts = 6; double explicit_bounds = 7;
      + *                        KeyValue attributes = 9; double min = 11; double max = 12; }
      + * 
      + */ +class OtlpStatsMetricWriterTest { + + private static final int TEMPORALITY_DELTA = 1; + private static final long BUCKET_START = SECONDS.toNanos(1_700_000_000L); + private static final long BUCKET_DURATION = SECONDS.toNanos(10); + + @BeforeAll + static void registerHistogramFactory() { + Histograms.register(DDSketchHistograms.FACTORY); + } + + // ── capturing sender ────────────────────────────────────────────────────── + + private static final class CapturingSender implements OtlpSender { + int sendCount; + byte[] lastPayload; + + @Override + public void send(OtlpPayload payload) { + sendCount++; + java.nio.ByteBuffer content = payload.getContent(); + byte[] bytes = new byte[content.remaining()]; + content.get(bytes); + lastPayload = bytes; + } + + @Override + public void shutdown() {} + } + + // ── entry builders ────────────────────────────────────────────────────── + + private static AggregateEntry entry( + String resource, + boolean synthetic, + int httpStatusCode, + @Nullable String httpMethod, + @Nullable String httpEndpoint, + @Nullable String grpcStatusCode) { + return AggregateEntryTestUtils.of( + resource, + "web", + "servlet.request", + null, + "web", + httpStatusCode, + synthetic, + true, + "server", + null, + httpMethod, + httpEndpoint, + grpcStatusCode); + } + + /** Build an entry and record {@code hits} ok durations of {@code durationNanos} each. */ + private static AggregateEntry okEntry(long durationNanos, int hits) { + AggregateEntry e = entry("GET /users", false, 0, null, null, null); + for (int i = 0; i < hits; i++) { + AggregateEntryTestUtils.recordOk(e, durationNanos); + } + return e; + } + + // ── decode helpers (adapted from OtlpMetricsProtoTest) ────────────────────── + + /** + * A decoded histogram data point. Only the fields this test asserts on are decoded: the window + * timestamps, the total count, and the attributes. Per-bucket contents (bucket_counts, + * explicit_bounds), sum, min, and max are intentionally not decoded here. + */ + private static final class DataPoint { + long start; + long end; + long count; + final Map attributes = new HashMap<>(); + } + + /** A decoded metric: name, unit, temporality, and its histogram data points. */ + private static final class DecodedMetric { + String name; + String unit; + int temporality = -1; + final List dataPoints = new ArrayList<>(); + } + + /** Decodes a full {@code MetricsData} payload into the single histogram metric it carries. */ + private static DecodedMetric decode(byte[] payload) throws IOException { + CodedInputStream metricsData = CodedInputStream.newInstance(payload); + int metricsTag = metricsData.readTag(); + assertEquals(1, WireFormat.getTagFieldNumber(metricsTag), "MetricsData.resource_metrics = 1"); + CodedInputStream resourceMetrics = metricsData.readBytes().newCodedInput(); + assertTrue(metricsData.isAtEnd(), "expected exactly one ResourceMetrics"); + + DecodedMetric metric = null; + while (!resourceMetrics.isAtEnd()) { + int tag = resourceMetrics.readTag(); + int field = WireFormat.getTagFieldNumber(tag); + if (field == 2) { // ScopeMetrics + metric = parseScopeMetrics(resourceMetrics.readBytes().newCodedInput()); + } else { + resourceMetrics.skipField(tag); // Resource (field 1) etc. + } + } + assertNotNull(metric, "no ScopeMetrics found"); + return metric; + } + + /** + * Decodes the {@code Resource.attributes} ({@code ResourceMetrics.resource = 1} → {@code + * Resource.attributes = 1}) into a key→value map, for asserting the {@code datadog.*} resource + * attributes emitted in default mode. + */ + private static Map decodeResourceAttributes(byte[] payload) throws IOException { + CodedInputStream metricsData = CodedInputStream.newInstance(payload); + metricsData.readTag(); // MetricsData.resource_metrics = 1 + CodedInputStream resourceMetrics = metricsData.readBytes().newCodedInput(); + Map attrs = new HashMap<>(); + while (!resourceMetrics.isAtEnd()) { + int tag = resourceMetrics.readTag(); + if (WireFormat.getTagFieldNumber(tag) == 1) { // Resource + CodedInputStream resource = resourceMetrics.readBytes().newCodedInput(); + while (!resource.isAtEnd()) { + int rtag = resource.readTag(); + if (WireFormat.getTagFieldNumber(rtag) == 1) { // KeyValue attributes + readKeyValue(resource.readBytes().newCodedInput(), attrs); + } else { + resource.skipField(rtag); + } + } + } else { + resourceMetrics.skipField(tag); + } + } + return attrs; + } + + private static DecodedMetric parseScopeMetrics(CodedInputStream scopeMetrics) throws IOException { + DecodedMetric metric = null; + while (!scopeMetrics.isAtEnd()) { + int tag = scopeMetrics.readTag(); + if (WireFormat.getTagFieldNumber(tag) == 2) { // Metric + metric = parseMetric(scopeMetrics.readBytes().newCodedInput()); + } else { + scopeMetrics.skipField(tag); + } + } + return metric; + } + + private static DecodedMetric parseMetric(CodedInputStream m) throws IOException { + DecodedMetric metric = new DecodedMetric(); + while (!m.isAtEnd()) { + int tag = m.readTag(); + switch (WireFormat.getTagFieldNumber(tag)) { + case 1: + metric.name = m.readString(); + break; + case 3: + metric.unit = m.readString(); + break; + case 9: // Histogram + parseHistogram(m.readBytes().newCodedInput(), metric); + break; + default: + m.skipField(tag); + } + } + return metric; + } + + private static void parseHistogram(CodedInputStream h, DecodedMetric metric) throws IOException { + while (!h.isAtEnd()) { + int tag = h.readTag(); + switch (WireFormat.getTagFieldNumber(tag)) { + case 1: // HistogramDataPoint (repeated) + metric.dataPoints.add(parseDataPoint(h.readBytes().newCodedInput())); + break; + case 2: // aggregation_temporality + metric.temporality = h.readEnum(); + break; + default: + h.skipField(tag); + } + } + } + + private static DataPoint parseDataPoint(CodedInputStream dp) throws IOException { + DataPoint p = new DataPoint(); + while (!dp.isAtEnd()) { + int tag = dp.readTag(); + switch (WireFormat.getTagFieldNumber(tag)) { + case 2: + p.start = dp.readFixed64(); + break; + case 3: + p.end = dp.readFixed64(); + break; + case 4: + p.count = dp.readFixed64(); + break; + case 9: // attributes (KeyValue) + readKeyValue(dp.readBytes().newCodedInput(), p.attributes); + break; + default: // sum, bucket_counts, explicit_bounds, min, max — not asserted here + dp.skipField(tag); + } + } + return p; + } + + /** + * Reads a {@code KeyValue} into {@code out}: key (field 1) → value. Value is an {@code AnyValue} + * (field 2); we decode string (field 1) and int (field 3) variants used by this writer. + */ + private static void readKeyValue(CodedInputStream kv, Map out) + throws IOException { + String key = null; + Object value = null; + while (!kv.isAtEnd()) { + int tag = kv.readTag(); + switch (WireFormat.getTagFieldNumber(tag)) { + case 1: + key = kv.readString(); + break; + case 2: // AnyValue + value = readAnyValue(kv.readBytes().newCodedInput()); + break; + default: + kv.skipField(tag); + } + } + if (key != null) { + out.put(key, value); + } + } + + private static Object readAnyValue(CodedInputStream any) throws IOException { + Object value = null; + while (!any.isAtEnd()) { + int tag = any.readTag(); + switch (WireFormat.getTagFieldNumber(tag)) { + case 1: // string_value + value = any.readString(); + break; + case 3: // int_value + value = any.readInt64(); + break; + default: + any.skipField(tag); + } + } + return value; + } + + // ── writer driver ───────────────────────────────────────────────────────── + + /** + * Drives the writer through one full {@code startBucket → add → finishBucket} cycle for {@code + * entry} over the fixed {@link #BUCKET_START}/{@link #BUCKET_DURATION} window, asserts that + * exactly one payload was sent, and returns the decoded metric. + */ + private static DecodedMetric writeAndDecode(boolean otelSemanticsMode, AggregateEntry entry) + throws IOException { + CapturingSender sender = new CapturingSender(); + OtlpStatsMetricWriter writer = new OtlpStatsMetricWriter(sender, otelSemanticsMode, null); + writer.startBucket(1, BUCKET_START, BUCKET_DURATION); + writer.add(entry); + writer.finishBucket(); + assertEquals(1, sender.sendCount, "exactly one payload sent"); + return decode(sender.lastPayload); + } + + // ── test cases ────────────────────────────────────────────────────────── + + @Test + void okOnlyEntryProducesExactlyOneDataPoint() throws IOException { + DecodedMetric metric = writeAndDecode(false, okEntry(SECONDS.toNanos(1), 3)); + + assertEquals("traces.span.sdk.metrics.duration", metric.name); + assertEquals("s", metric.unit); + assertEquals(TEMPORALITY_DELTA, metric.temporality, "histogram must be delta temporality"); + assertEquals(1, metric.dataPoints.size(), "ok-only → one data point"); + + DataPoint dp = metric.dataPoints.get(0); + assertEquals(BUCKET_START, dp.start, "start_time_unix_nano == startBucket start"); + assertEquals(BUCKET_START + BUCKET_DURATION, dp.end, "time_unix_nano == start + duration"); + assertEquals(3L, dp.count); + assertFalse(dp.attributes.containsKey("status.code"), "ok point carries no status.code"); + } + + @Test + void okPlusErrorEntryProducesTwoDataPointsWithErrorStatus() throws IOException { + AggregateEntry e = entry("GET /users", false, 0, null, null, null); + AggregateEntryTestUtils.recordOk(e, SECONDS.toNanos(1)); // ok + AggregateEntryTestUtils.recordOk(e, SECONDS.toNanos(2)); // ok + AggregateEntryTestUtils.recordError(e, SECONDS.toNanos(3)); // error + + DecodedMetric metric = writeAndDecode(false, e); + assertEquals(2, metric.dataPoints.size(), "ok+error → two data points"); + + long okCount = 0; + long errorCount = 0; + DataPoint errorPoint = null; + DataPoint okPoint = null; + for (DataPoint dp : metric.dataPoints) { + if ("ERROR".equals(dp.attributes.get("status.code"))) { + errorPoint = dp; + errorCount = dp.count; + } else { + okPoint = dp; + okCount = dp.count; + } + } + assertNotNull(errorPoint, "one data point must carry status.code=ERROR"); + assertNotNull(okPoint, "one data point must omit status.code"); + assertEquals(e.getOkLatencies().getCount(), (double) okCount, 1e-9); + assertEquals(e.getErrorLatencies().getCount(), (double) errorCount, 1e-9); + } + + @Test + void errorSeriesDoesNotLingerAfterClearWhenBucketHasOnlyOkHits() throws IOException { + CapturingSender sender = new CapturingSender(); + OtlpStatsMetricWriter writer = new OtlpStatsMetricWriter(sender, false, null); + + // Bucket 1: the entry sees an error, so its error histogram is allocated and emits a point. + AggregateEntry e = entry("GET /users", false, 0, null, null, null); + AggregateEntryTestUtils.recordOk(e, SECONDS.toNanos(1)); // ok + AggregateEntryTestUtils.recordError(e, SECONDS.toNanos(3)); // error + + writer.startBucket(1, BUCKET_START, BUCKET_DURATION); + writer.add(e); + writer.finishBucket(); + DecodedMetric bucket1 = decode(sender.lastPayload); + assertEquals(2, bucket1.dataPoints.size(), "bucket with an error → ok+error data points"); + assertTrue( + bucket1.dataPoints.stream() + .anyMatch(dp -> "ERROR".equals(dp.attributes.get("status.code"))), + "bucket 1 must carry a status.code=ERROR point"); + + // Bucket 2: same entry, reset then only OK hits. errorLatencies survives clear() (cleared, not + // nulled), so a non-null-but-empty histogram must NOT emit a phantom zero-count error series. + AggregateEntryTestUtils.clear(e); + AggregateEntryTestUtils.recordOk(e, SECONDS.toNanos(2)); // ok only + + writer.startBucket(2, BUCKET_START + BUCKET_DURATION, BUCKET_DURATION); + writer.add(e); + writer.finishBucket(); + DecodedMetric bucket2 = decode(sender.lastPayload); + assertEquals(1, bucket2.dataPoints.size(), "ok-only bucket → exactly one data point"); + assertFalse( + bucket2.dataPoints.get(0).attributes.containsKey("status.code"), + "recovered entry must not emit a lingering status.code=ERROR series"); + } + + @Test + void httpAndGrpcAttributesAppearOnlyWhenSet() throws IOException { + AggregateEntry e = entry("GET /users/{id}", false, 200, "GET", "/users/{id}", "0"); + AggregateEntryTestUtils.recordOk(e, SECONDS.toNanos(1)); + + DecodedMetric metric = writeAndDecode(false, e); + assertEquals(1, metric.dataPoints.size()); + Map attrs = metric.dataPoints.get(0).attributes; + + assertEquals("GET", attrs.get("http.request.method")); + assertEquals(200L, attrs.get("http.response.status_code")); + assertEquals("/users/{id}", attrs.get("http.route")); + assertEquals("0", attrs.get("rpc.response.status_code")); + + // a bare entry has none of these + Map bareAttrs = + writeAndDecode(false, okEntry(SECONDS.toNanos(1), 1)).dataPoints.get(0).attributes; + assertFalse(bareAttrs.containsKey("http.request.method")); + assertFalse(bareAttrs.containsKey("http.response.status_code")); + assertFalse(bareAttrs.containsKey("http.route")); + assertFalse(bareAttrs.containsKey("rpc.response.status_code")); + } + + @Test + void serviceNameEmittedOnlyForNonDefaultService() throws IOException { + CapturingSender sender = new CapturingSender(); + // The configured default service ("web") is reported on the resource; only a span whose service + // differs from it repeats service.name on its own data point. + OtlpStatsMetricWriter writer = new OtlpStatsMetricWriter(sender, false, "web"); + + long start = SECONDS.toNanos(1_700_000_000L); + writer.startBucket(2, start, SECONDS.toNanos(10)); + writer.add(serviceEntry("web.request", "web")); // default service + writer.add(serviceEntry("db.query", "postgres")); // custom service + writer.finishBucket(); + + DecodedMetric metric = decode(sender.lastPayload); + assertEquals(2, metric.dataPoints.size()); + + Map defaultAttrs = null; + Map customAttrs = null; + for (DataPoint dp : metric.dataPoints) { + if ("db.query".equals(dp.attributes.get("datadog.operation.name"))) { + customAttrs = dp.attributes; + } else { + defaultAttrs = dp.attributes; + } + } + assertNotNull(customAttrs, "custom-service data point present"); + assertNotNull(defaultAttrs, "default-service data point present"); + assertEquals( + "postgres", + customAttrs.get("service.name"), + "non-default service is carried on its own data point"); + assertFalse( + defaultAttrs.containsKey("service.name"), + "default service must not be repeated on its data point"); + } + + /** An ok-only entry on the given service and operation name, recording a single 1s hit. */ + private static AggregateEntry serviceEntry(String operationName, String service) { + AggregateEntry e = + AggregateEntryTestUtils.of( + "GET /users", + service, + operationName, + null, + "web", + 0, + false, + true, + "server", + null, + null, + null, + null); + AggregateEntryTestUtils.recordOk(e, SECONDS.toNanos(1)); + return e; + } + + @Test + void emptyBucketSendsNothing() { + CapturingSender sender = new CapturingSender(); + OtlpStatsMetricWriter writer = new OtlpStatsMetricWriter(sender, false, null); + + writer.startBucket(0, BUCKET_START, BUCKET_DURATION); + writer.finishBucket(); // no add() + + assertEquals(0, sender.sendCount, "empty bucket must not invoke send"); + assertNull(sender.lastPayload); + } + + @Test + void nullSenderDoesNotThrowOnNonEmptyBucket() { + // mirrors the HTTP_JSON path where createSender(config) returns null. + OtlpStatsMetricWriter writer = new OtlpStatsMetricWriter(null, false, null); + writer.startBucket(1, BUCKET_START, BUCKET_DURATION); + writer.add(okEntry(SECONDS.toNanos(1), 2)); + try { + writer.finishBucket(); + } catch (Exception ex) { + fail("finishBucket must not throw with a null sender, but threw: " + ex); + } + } + + @Test + void defaultModeCarriesDatadogAttributes() throws IOException { + // use an entry where all hits are top-level: OR in TOP_LEVEL_TAG + AggregateEntry e = entry("servlet.request", false, 0, null, null, null); + AggregateEntryTestUtils.recordTopLevel(e, SECONDS.toNanos(1)); + + Map attrs = writeAndDecode(false, e).dataPoints.get(0).attributes; + assertTrue( + attrs.containsKey("datadog.operation.name"), "operation name present in default mode"); + assertTrue(attrs.containsKey("datadog.span.type"), "span type present in default mode"); + assertTrue( + attrs.containsKey("datadog.span.top_level"), "span top-level present in default mode"); + assertEquals(1L, attrs.get("datadog.span.top_level"), "all hits top-level → 1"); + // OTel-semconv attrs are present in both modes + assertTrue(attrs.containsKey("span.name"), "span.name present in both modes"); + // datadog.origin presence/absence is covered by defaultModeEmitsSyntheticOrigin + } + + /** + * In default mode a synthetic entry emits {@code datadog.origin = "synthetics"}; a non-synthetic + * entry omits the attribute. Origin has collapsed to a boolean {@code synthetic} flag upstream, + * so {@code "synthetics"} is the only origin value that can reach the writer. + */ + @ParameterizedTest(name = "synthetic={0} → datadog.origin={1}") + @CsvSource( + nullValues = "NULL", + value = {"false, NULL", "true, synthetics"}) + void defaultModeEmitsSyntheticOrigin(boolean synthetic, String expectedOrigin) + throws IOException { + AggregateEntry e = entry("servlet.request", synthetic, 0, null, null, null); + AggregateEntryTestUtils.recordOk(e, SECONDS.toNanos(1)); + + Map attrs = writeAndDecode(false, e).dataPoints.get(0).attributes; + if (expectedOrigin == null) { + assertFalse(attrs.containsKey("datadog.origin"), "non-synthetic → datadog.origin absent"); + } else { + assertEquals(expectedOrigin, attrs.get("datadog.origin"), "synthetic → datadog.origin"); + } + } + + @Test + void otelSemanticsModeOmitsDatadogAttributes() throws IOException { + // otelSemanticsMode = true → datadog.* must be absent + Map attrs = + writeAndDecode(true, okEntry(SECONDS.toNanos(1), 1)).dataPoints.get(0).attributes; + assertFalse( + attrs.containsKey("datadog.operation.name"), + "operation name absent in otel-semantics mode"); + assertFalse(attrs.containsKey("datadog.span.type"), "span type absent in otel-semantics mode"); + assertFalse( + attrs.containsKey("datadog.span.top_level"), + "span top-level absent in otel-semantics mode"); + assertFalse(attrs.containsKey("datadog.origin"), "origin absent in otel-semantics mode"); + // OTel-semconv attrs must still be present + assertTrue(attrs.containsKey("span.name"), "span.name present even in otel-semantics mode"); + } + + @Test + void snapshotsEntryDataBeforeAggregatorClearsIt() throws IOException { + // The aggregator clears each entry's per-interval data immediately after add() returns + // (Aggregator#report), before finishBucket() runs. The writer must snapshot the latency data + // (and the top-level count) at add() time; if it deferred reading to finishBucket() it would + // encode the already-cleared (empty, zero-count) entry. + CapturingSender sender = new CapturingSender(); + OtlpStatsMetricWriter writer = new OtlpStatsMetricWriter(sender, false, null); + + AggregateEntry e = entry("servlet.request", false, 0, null, null, null); + AggregateEntryTestUtils.recordTopLevel(e, SECONDS.toNanos(1)); + AggregateEntryTestUtils.recordTopLevel(e, SECONDS.toNanos(1)); + AggregateEntryTestUtils.recordTopLevel(e, SECONDS.toNanos(1)); + + writer.startBucket(1, BUCKET_START, BUCKET_DURATION); + writer.add(e); + AggregateEntryTestUtils.clear(e); // mimic Aggregator#report clearing right after add() + writer.finishBucket(); + + assertEquals(1, sender.sendCount, "cleared-after-add entry must still emit its snapshot"); + DecodedMetric metric = decode(sender.lastPayload); + assertEquals(1, metric.dataPoints.size()); + DataPoint dp = metric.dataPoints.get(0); + assertEquals(3L, dp.count, "count must reflect the pre-clear snapshot, not the cleared entry"); + assertEquals( + 1L, dp.attributes.get("datadog.span.top_level"), "all pre-clear hits were top-level"); + } + + // ── resource attributes (datadog.runtime_id / process tags) ──────────────── + + @Test + void defaultModeResourceCarriesRuntimeId() throws IOException { + // runtime-id is enabled by default, so default-mode payloads carry datadog.runtime_id on the + // Resource. + CapturingSender sender = new CapturingSender(); + OtlpStatsMetricWriter writer = new OtlpStatsMetricWriter(sender, false, null); + writer.startBucket(1, SECONDS.toNanos(1_700_000_000L), SECONDS.toNanos(10)); + writer.add(okEntry(SECONDS.toNanos(1), 1)); + writer.finishBucket(); + + Map resourceAttrs = decodeResourceAttributes(sender.lastPayload); + assertTrue( + resourceAttrs.containsKey("datadog.runtime_id"), + "default mode resource carries datadog.runtime_id"); + Object runtimeId = resourceAttrs.get("datadog.runtime_id"); + assertNotNull(runtimeId, "runtime id value present"); + assertFalse(runtimeId.toString().isEmpty(), "runtime id value non-empty"); + } + + @Test + void otelSemanticsModeResourceOmitsDatadogAttributes() throws IOException { + CapturingSender sender = new CapturingSender(); + OtlpStatsMetricWriter writer = new OtlpStatsMetricWriter(sender, true, null); + writer.startBucket(1, SECONDS.toNanos(1_700_000_000L), SECONDS.toNanos(10)); + writer.add(okEntry(SECONDS.toNanos(1), 1)); + writer.finishBucket(); + + Map resourceAttrs = decodeResourceAttributes(sender.lastPayload); + assertFalse( + resourceAttrs.containsKey("datadog.runtime_id"), + "otel-semantics mode resource omits datadog.runtime_id"); + for (String key : resourceAttrs.keySet()) { + assertFalse( + key.startsWith("datadog."), + "otel-semantics mode resource has no datadog.* attrs: " + key); + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/otlp/trace/OtlpTraceJsonCollectorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/otlp/trace/OtlpTraceJsonCollectorTest.java new file mode 100644 index 00000000000..2f7db58c6fd --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/otlp/trace/OtlpTraceJsonCollectorTest.java @@ -0,0 +1,302 @@ +package datadog.trace.core.otlp.trace; + +import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND; +import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_SERVER; +import static datadog.trace.core.DDSpanContext.SPAN_SAMPLING_MECHANISM_TAG; +import static datadog.trace.core.otlp.common.OtlpCommonJson.hexSpanId; +import static datadog.trace.core.otlp.common.OtlpCommonJson.hexTraceId; +import static datadog.trace.core.otlp.common.OtlpTraceFlags.SAMPLED_TRACE_FLAG; +import static java.util.Arrays.asList; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.json.JsonMapper; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.TracePropagationStyle; +import datadog.trace.api.sampling.PrioritySampling; +import datadog.trace.api.sampling.SamplingMechanism; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.api.SpanAttributes; +import datadog.trace.bootstrap.instrumentation.api.SpanLink; +import datadog.trace.common.writer.LoggingWriter; +import datadog.trace.core.CoreSpan; +import datadog.trace.core.CoreTracer; +import datadog.trace.core.DDSpan; +import datadog.trace.core.otlp.common.OtlpPayload; +import datadog.trace.core.propagation.ExtractedContext; +import datadog.trace.core.propagation.PropagationTags; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.junit.jupiter.api.Test; + +/** + * Tests for {@link OtlpTraceJsonCollector}, parsing the produced JSON back with {@link JsonMapper} + * and asserting against the OTLP JSON encoding (hex ids, camelCase keys, integer {@code kind}, + * decimal-string timestamps). + */ +class OtlpTraceJsonCollectorTest { + + private static final CoreTracer TRACER = CoreTracer.builder().writer(new LoggingWriter()).build(); + + @Test + void emptyTraceProducesEmptyPayload() { + OtlpTraceJsonCollector collector = new OtlpTraceJsonCollector(); + OtlpPayload payload = collector.collectTraces(); + assertEquals(OtlpPayload.EMPTY, payload); + } + + @Test + void singleSpanIsEncodedWithHexIdsAndCamelCaseKeys() throws IOException { + DDSpan span = startAndFinish("op.first", "GET /api/users", null); + + OtlpTraceJsonCollector collector = new OtlpTraceJsonCollector(); + collector.addTrace(asList((CoreSpan) span)); + OtlpPayload payload = collector.collectTraces(); + + Map parsedSpan = onlySpan(payload); + + assertEquals(hexTraceId(span.getTraceId()), parsedSpan.get("traceId")); + assertEquals(hexSpanId(span.getSpanId()), parsedSpan.get("spanId")); + assertEquals("GET /api/users", parsedSpan.get("name")); + assertTrue(parsedSpan.get("startTimeUnixNano") instanceof String, "timestamps are strings"); + assertTrue(parsedSpan.get("endTimeUnixNano") instanceof String, "timestamps are strings"); + assertNull(parsedSpan.get("parentSpanId"), "root span has no parentSpanId"); + + Set attrKeys = attributeKeys(parsedSpan); + assertTrue(attrKeys.contains("resource.name")); + assertTrue(attrKeys.contains("operation.name")); + } + + @Test + void spanKindIsEncodedAsInteger() throws IOException { + DDSpan span = startAndFinish("op.server", "GET /api", SPAN_KIND_SERVER); + + OtlpTraceJsonCollector collector = new OtlpTraceJsonCollector(); + collector.addTrace(asList((CoreSpan) span)); + Map parsedSpan = onlySpan(collector.collectTraces()); + + assertEquals(2, ((Number) parsedSpan.get("kind")).intValue(), "SPAN_KIND_SERVER = 2"); + } + + @Test + void errorSpanHasStatusObject() throws IOException { + AgentSpan agentSpan = TRACER.startSpan("test", "op.error"); + agentSpan.setResourceName("POST /api/data"); + agentSpan.setError(true); + agentSpan.setErrorMessage("boom"); + agentSpan.finish(); + + OtlpTraceJsonCollector collector = new OtlpTraceJsonCollector(); + collector.addTrace(asList((CoreSpan) agentSpan)); + Map parsedSpan = onlySpan(collector.collectTraces()); + + @SuppressWarnings("unchecked") + Map status = (Map) parsedSpan.get("status"); + assertEquals("boom", status.get("message")); + assertEquals(2, ((Number) status.get("code")).intValue(), "STATUS_CODE_ERROR = 2"); + } + + @Test + void nonErrorSpanHasNoStatusObject() throws IOException { + DDSpan span = startAndFinish("op.ok", "GET /health", null); + + OtlpTraceJsonCollector collector = new OtlpTraceJsonCollector(); + collector.addTrace(asList((CoreSpan) span)); + Map parsedSpan = onlySpan(collector.collectTraces()); + + assertFalse(parsedSpan.containsKey("status")); + } + + @Test + void spanTraceStateOmittedWhenNotPropagated() throws IOException { + DDSpan span = startAndFinish("op.notracestate", "GET /no-tracestate", null); + + OtlpTraceJsonCollector collector = new OtlpTraceJsonCollector(); + collector.addTrace(asList((CoreSpan) span)); + Map parsedSpan = onlySpan(collector.collectTraces()); + + assertFalse( + parsedSpan.containsKey("traceState"), "no W3C tracestate propagated should be omitted"); + } + + @Test + void spanTraceStateIncludedWhenPropagated() throws IOException { + PropagationTags propagationTags = PropagationTags.factory().empty(); + propagationTags.updateW3CTracestate("vendor=state"); + ExtractedContext parent = + new ExtractedContext( + DDTraceId.ONE, + 0L, + PrioritySampling.UNSET, + null, + propagationTags, + TracePropagationStyle.DATADOG); + + AgentSpan agentSpan = TRACER.startSpan("test", "op.tracestate", parent); + agentSpan.setResourceName("op.tracestate"); + agentSpan.finish(); + + OtlpTraceJsonCollector collector = new OtlpTraceJsonCollector(); + collector.addTrace(asList((CoreSpan) agentSpan)); + Map parsedSpan = onlySpan(collector.collectTraces()); + + assertEquals("vendor=state", parsedSpan.get("traceState")); + } + + @Test + void spanFlagsOmittedWhenNotSampled() throws IOException { + AgentSpan agentSpan = TRACER.startSpan("test", "op.noflags"); + agentSpan.setResourceName("op.noflags"); + agentSpan.setSamplingPriority(PrioritySampling.USER_DROP, SamplingMechanism.MANUAL); + // Force export despite the dropped trace-level priority, via span-level sampling - + // otherwise OtlpTraceCollector#shouldExport would exclude this span entirely. + agentSpan.setTag(SPAN_SAMPLING_MECHANISM_TAG, SamplingMechanism.SPAN_SAMPLING_RATE); + agentSpan.finish(); + + OtlpTraceJsonCollector collector = new OtlpTraceJsonCollector(); + collector.addTrace(asList((CoreSpan) agentSpan)); + Map parsedSpan = onlySpan(collector.collectTraces()); + + assertFalse(parsedSpan.containsKey("flags"), "unsampled span should omit flags"); + } + + @Test + void spanFlagsIncludeSampledBitWhenSampled() throws IOException { + DDSpan span = startAndFinish("op.sampled", "GET /sampled", null); + + OtlpTraceJsonCollector collector = new OtlpTraceJsonCollector(); + collector.addTrace(asList((CoreSpan) span)); + Map parsedSpan = onlySpan(collector.collectTraces()); + + assertEquals(SAMPLED_TRACE_FLAG, ((Number) parsedSpan.get("flags")).intValue()); + } + + @Test + void multipleSpansInATraceAreAllWritten() throws IOException { + AgentSpan parent = TRACER.startSpan("test", "op.parent"); + parent.setResourceName("parent.op"); + AgentSpan child = TRACER.startSpan("test", "op.child", parent.spanContext()); + child.setResourceName("child.op"); + child.finish(); + parent.finish(); + + List> spans = new ArrayList<>(); + spans.add((CoreSpan) parent); + spans.add((CoreSpan) child); + + OtlpTraceJsonCollector collector = new OtlpTraceJsonCollector(); + collector.addTrace(spans); + OtlpPayload payload = collector.collectTraces(); + + List> parsedSpans = allSpans(payload); + assertEquals(2, parsedSpans.size()); + + Map parsedChild = + parsedSpans.stream() + .filter(s -> "child.op".equals(s.get("name"))) + .findFirst() + .orElseThrow(() -> new AssertionError("child span not found")); + assertEquals(hexSpanId(((DDSpan) parent).getSpanId()), parsedChild.get("parentSpanId")); + } + + @Test + void spanLinkOmitsTraceStateWhenEmpty() throws IOException { + AgentSpan linked = TRACER.startSpan("test", "op.linked"); + linked.finish(); + + AgentSpan agentSpan = TRACER.startSpan("test", "op.link"); + agentSpan.setResourceName("op.link"); + agentSpan.addLink(SpanLink.from(linked.spanContext())); + agentSpan.finish(); + + OtlpTraceJsonCollector collector = new OtlpTraceJsonCollector(); + collector.addTrace(asList((CoreSpan) agentSpan)); + Map parsedSpan = onlySpan(collector.collectTraces()); + + Map parsedLink = onlyLink(parsedSpan); + assertFalse(parsedLink.containsKey("traceState"), "empty traceState should be omitted"); + } + + @Test + void spanLinkIncludesTraceStateWhenPresent() throws IOException { + AgentSpan linked = TRACER.startSpan("test", "op.linked"); + linked.finish(); + + AgentSpan agentSpan = TRACER.startSpan("test", "op.link"); + agentSpan.setResourceName("op.link"); + agentSpan.addLink( + SpanLink.from(linked.spanContext(), (byte) 0, "vendor=state", SpanAttributes.EMPTY)); + agentSpan.finish(); + + OtlpTraceJsonCollector collector = new OtlpTraceJsonCollector(); + collector.addTrace(asList((CoreSpan) agentSpan)); + Map parsedSpan = onlySpan(collector.collectTraces()); + + Map parsedLink = onlyLink(parsedSpan); + assertEquals("vendor=state", parsedLink.get("traceState")); + } + + // ── helpers ────────────────────────────────────────────────────────────── + + private static DDSpan startAndFinish(String operationName, String resourceName, String spanKind) { + AgentSpan agentSpan = TRACER.startSpan("test", operationName); + agentSpan.setResourceName(resourceName); + if (spanKind != null) { + agentSpan.setTag(SPAN_KIND, spanKind); + } + agentSpan.setSamplingPriority(PrioritySampling.USER_KEEP, SamplingMechanism.DEFAULT); + agentSpan.finish(); + return (DDSpan) agentSpan; + } + + @SuppressWarnings("unchecked") + private static Map onlySpan(OtlpPayload payload) throws IOException { + List> spans = allSpans(payload); + assertEquals(1, spans.size()); + return spans.get(0); + } + + @SuppressWarnings("unchecked") + private static List> allSpans(OtlpPayload payload) throws IOException { + byte[] bytes = new byte[payload.getContentLength()]; + payload.getContent().get(bytes); + String json = new String(bytes, StandardCharsets.UTF_8); + Map root = JsonMapper.fromJsonToMap(json); + + List resourceSpans = (List) root.get("resourceSpans"); + Map resourceSpan = (Map) resourceSpans.get(0); + List scopeSpans = (List) resourceSpan.get("scopeSpans"); + Map scopeSpan = (Map) scopeSpans.get(0); + List spans = (List) scopeSpan.get("spans"); + + List> result = new ArrayList<>(); + for (Object span : spans) { + result.add((Map) span); + } + return result; + } + + @SuppressWarnings("unchecked") + private static Map onlyLink(Map span) { + List links = (List) span.get("links"); + assertEquals(1, links.size()); + return (Map) links.get(0); + } + + @SuppressWarnings("unchecked") + private static Set attributeKeys(Map span) { + List attributes = (List) span.get("attributes"); + Set keys = new HashSet<>(); + for (Object attribute : attributes) { + keys.add((String) ((Map) attribute).get("key")); + } + return keys; + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/otlp/trace/OtlpTraceProtoTest.java b/dd-trace-core/src/test/java/datadog/trace/core/otlp/trace/OtlpTraceProtoTest.java index 6c8c219cbc6..0acca35beb2 100644 --- a/dd-trace-core/src/test/java/datadog/trace/core/otlp/trace/OtlpTraceProtoTest.java +++ b/dd-trace-core/src/test/java/datadog/trace/core/otlp/trace/OtlpTraceProtoTest.java @@ -6,6 +6,7 @@ import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_INTERNAL; import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_PRODUCER; import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_SERVER; +import static datadog.trace.core.otlp.common.OtlpTraceFlags.SAMPLED_TRACE_FLAG; import static java.util.Arrays.asList; import static java.util.Arrays.copyOfRange; import static java.util.Collections.emptyList; @@ -422,6 +423,11 @@ static Stream cases() { asList( span("anchor.op", "anchor.op", "web"), linkedSpanWithFlags("flags.linked", 0, (byte) 0x02))), + Arguments.of( + "span link with high-bit flags — flags written as unsigned byte, not sign-extended", + asList( + span("anchor.op", "anchor.op", "web"), + linkedSpanWithFlags("flags.highbit.linked", 0, (byte) 0x82))), // ── metadata paths ──────────────────────────────────────────────────── Arguments.of( @@ -714,7 +720,7 @@ private static List buildSpans(List specs) { TRACER.startSpan( "test", spec.operationName, - spans.get(spec.parentIndex).context(), + spans.get(spec.parentIndex).spanContext(), spec.startMicros); } else { agentSpan = TRACER.startSpan("test", spec.operationName, spec.startMicros); @@ -756,7 +762,7 @@ private static List buildSpans(List specs) { for (LinkSpec link : spec.links) { agentSpan.addLink( SpanLink.from( - spans.get(link.targetIndex).context(), + spans.get(link.targetIndex).spanContext(), link.traceFlags, link.traceState, link.attributes)); @@ -966,7 +972,7 @@ private static void verifySpan( // absent otherwise because the default sampler may still set a positive priority. if (spec.samplingPriority > 0) { assertTrue( - (parsedFlags & OtlpTraceProto.SAMPLED_TRACE_FLAG) != 0, + (parsedFlags & SAMPLED_TRACE_FLAG) != 0, "SAMPLED flag must be set in flags [" + caseName + "]"); } @@ -1082,6 +1088,8 @@ private static void verifyLink(CodedInputStream link, LinkSpec linkSpec, String if (!linkSpec.traceState.isEmpty()) { assertEquals( linkSpec.traceState, parsedTraceState, "Link.trace_state mismatch [" + caseName + "]"); + } else { + assertNull(parsedTraceState, "empty Link.trace_state should be omitted [" + caseName + "]"); } // SpanLink.from() ORs in the SAMPLED_FLAG (0x01) when the target context has positive // sampling priority, which all test anchor spans have via the default tracer sampler. diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/AbstractHttpExtractorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/AbstractHttpExtractorTest.java new file mode 100644 index 00000000000..081d9bb77a7 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/AbstractHttpExtractorTest.java @@ -0,0 +1,60 @@ +package datadog.trace.core.propagation; + +import static datadog.trace.api.config.TracerConfig.PROPAGATION_EXTRACT_LOG_HEADER_NAMES_ENABLED; +import static java.util.Collections.singletonMap; + +import datadog.trace.api.Config; +import datadog.trace.api.DynamicConfig; +import datadog.trace.api.TraceConfig; +import datadog.trace.test.junit.utils.config.WithConfig; +import datadog.trace.test.util.DDJavaSpecification; +import java.util.HashMap; +import java.util.Map; +import java.util.function.BiFunction; +import java.util.function.Supplier; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; + +/** This class is a base test class for the {@link HttpCodec.Extractor} tests. */ +@WithConfig(key = PROPAGATION_EXTRACT_LOG_HEADER_NAMES_ENABLED, value = "true") +abstract class AbstractHttpExtractorTest extends DDJavaSpecification { + protected static final String SOME_HEADER = "SOME_HEADER"; + protected static final String SOME_TAG = "some-tag"; + protected static final String SOME_CUSTOM_BAGGAGE_HEADER = "SOME_CUSTOM_BAGGAGE_HEADER"; + protected static final String SOME_CUSTOM_BAGGAGE_HEADER_2 = "SOME_CUSTOM_BAGGAGE_HEADER_2"; + protected static final String SOME_BAGGAGE = "some-baggage"; + protected static final String SOME_CASE_SENSITIVE_BAGGAGE = "some-CaseSensitive-baggage"; + protected static final String SOME_ARBITRARY_HEADER = "SOME_ARBITRARY_HEADER"; + + protected HttpCodec.Extractor extractor; + + /** Creates the extractor for the propagation style under test. */ + protected abstract HttpCodec.Extractor newExtractor( + Config config, Supplier traceConfigSupplier); + + @BeforeEach + void setupExtractor() { + this.extractor = buildExtractor(this::newExtractor); + } + + @AfterEach + void cleanupExtractor() { + if (this.extractor != null) { + this.extractor.cleanup(); + } + } + + /** Builds an extractor with a test trace config (a basic baggage mapping and header tags). */ + static HttpCodec.Extractor buildExtractor( + BiFunction, HttpCodec.Extractor> factory) { + Map baggageMapping = new HashMap<>(); + baggageMapping.put(SOME_CUSTOM_BAGGAGE_HEADER, SOME_BAGGAGE); + baggageMapping.put(SOME_CUSTOM_BAGGAGE_HEADER_2, SOME_CASE_SENSITIVE_BAGGAGE); + DynamicConfig dynamicConfig = + DynamicConfig.create() + .setHeaderTags(singletonMap(SOME_HEADER, SOME_TAG)) + .setBaggageMapping(baggageMapping) + .apply(); + return factory.apply(Config.get(), dynamicConfig::captureTraceConfig); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/AbstractHttpInjectorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/AbstractHttpInjectorTest.java new file mode 100644 index 00000000000..3098ab217ec --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/AbstractHttpInjectorTest.java @@ -0,0 +1,62 @@ +package datadog.trace.core.propagation; + +import datadog.trace.api.DDSpanId; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.datastreams.NoopPathwayContext; +import datadog.trace.common.writer.ListWriter; +import datadog.trace.core.CoreTracer; +import datadog.trace.core.DDCoreJavaSpecification; +import datadog.trace.core.DDSpanContext; +import java.util.Map; +import org.junit.jupiter.api.BeforeEach; + +/** This class is a base test class for the {@link HttpCodec.Injector} tests. */ +abstract class AbstractHttpInjectorTest extends DDCoreJavaSpecification { + protected CoreTracer tracer; + protected HttpCodec.Injector injector; + + /** + * Creates the injector under test. + * + * @return {@code null} by default for tests that build injectors per test case. + */ + protected HttpCodec.Injector newInjector() { + return null; + } + + @BeforeEach + void setupInjectorTest() { + this.tracer = tracerBuilder().writer(new ListWriter()).build(); + this.injector = newInjector(); + } + + /** Builds a span context with the standard fake service/operation/resource values. */ + protected DDSpanContext mockSpanContext( + DDTraceId traceId, + long spanId, + int samplingPriority, + CharSequence origin, + Map baggage, + PropagationTags propagationTags) { + return new DDSpanContext( + traceId, + spanId, + DDSpanId.ZERO, + null, + "fakeService", + "fakeOperation", + "fakeResource", + samplingPriority, + origin, + baggage, + false, + "fakeType", + 0, + this.tracer.createTraceCollector(DDTraceId.ONE), + null, + null, + NoopPathwayContext.INSTANCE, + false, + propagationTags); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/AppSecClientInterpreterClientIpTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/AppSecClientInterpreterClientIpTest.java new file mode 100644 index 00000000000..dc3980ae077 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/AppSecClientInterpreterClientIpTest.java @@ -0,0 +1,270 @@ +package datadog.trace.core.propagation; + +import static datadog.trace.api.config.TracerConfig.PROPAGATION_EXTRACT_LOG_HEADER_NAMES_ENABLED; +import static datadog.trace.api.config.TracerConfig.TRACE_CLIENT_IP_HEADER; +import static datadog.trace.api.config.TracerConfig.TRACE_CLIENT_IP_RESOLVER_ENABLED; +import static datadog.trace.bootstrap.ActiveSubsystems.APPSEC_ACTIVE; +import static datadog.trace.bootstrap.instrumentation.api.ContextVisitors.stringValuesMap; +import static datadog.trace.core.propagation.AbstractHttpExtractorTest.buildExtractor; +import static datadog.trace.core.propagation.HttpCodecTestHelper.headers; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.params.provider.Arguments.arguments; + +import datadog.trace.api.Config; +import datadog.trace.api.DDSpanId; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.TraceConfig; +import datadog.trace.bootstrap.instrumentation.api.TagContext; +import datadog.trace.test.junit.utils.config.WithConfig; +import datadog.trace.test.util.DDJavaSpecification; +import java.util.HashMap; +import java.util.Map; +import java.util.function.BiFunction; +import java.util.function.Supplier; +import java.util.stream.Stream; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +/** + * Verifies client-IP AppSec HTTP header collection. This behavior is implemented in the {@link + * ContextInterpreter} and should work with every propagation style. + */ +@WithConfig(key = PROPAGATION_EXTRACT_LOG_HEADER_NAMES_ENABLED, value = "true") +class AppSecClientInterpreterClientIpTest extends DDJavaSpecification { + private boolean origAppSecActive; + private HttpCodec.Extractor extractor; + + @BeforeEach + void enableAppSec() { + this.origAppSecActive = APPSEC_ACTIVE; + APPSEC_ACTIVE = true; + } + + @AfterEach + void restoreAppSec() { + if (this.extractor != null) { + this.extractor.cleanup(); + } + APPSEC_ACTIVE = this.origAppSecActive; + } + + static Stream styles() { + return Stream.of( + arguments( + new Style( + "Datadog", + DatadogHttpCodec::newExtractor, + headers(DatadogHttpCodec.TRACE_ID_KEY, "1", DatadogHttpCodec.SPAN_ID_KEY, "2"), + true)), + arguments( + new Style( + "B3", + B3HttpCodec::newExtractor, + headers(B3HttpCodec.TRACE_ID_KEY, "1", B3HttpCodec.SPAN_ID_KEY, "2"), + true)), + arguments( + new Style( + "W3C", + W3CHttpCodec::newExtractor, + headers( + W3CHttpCodec.TRACE_PARENT_KEY, + "00-00000000000000000000000000000001-0000000000000002-01"), + true)), + arguments( + new Style( + "Haystack", + HaystackHttpCodec::newExtractor, + headers(HaystackHttpCodec.TRACE_ID_KEY, "1", HaystackHttpCodec.SPAN_ID_KEY, "2"), + true)), + arguments( + new Style( + "XRay", + XRayHttpCodec::newExtractor, + headers( + XRayHttpCodec.X_AMZN_TRACE_ID, + "Root=1-00000000-000000000000000000000001;Parent=0000000000000002"), + true)), + arguments( + new Style( + "None", + NoneCodec::newExtractor, + headers(DatadogHttpCodec.TRACE_ID_KEY, "1", DatadogHttpCodec.SPAN_ID_KEY, "2"), + false))); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("styles") + void extractCommonHttpHeaders(Style style) { + this.extractor = buildExtractor(style.factory); + // spotless:off + Map headers = headers( + HttpCodec.USER_AGENT_KEY, "some-user-agent", + HttpCodec.X_CLUSTER_CLIENT_IP_KEY, "1.1.1.1", + HttpCodec.X_REAL_IP_KEY, "2.2.2.2", + HttpCodec.X_CLIENT_IP_KEY, "3.3.3.3", + HttpCodec.TRUE_CLIENT_IP_KEY, "4.4.4.4", + HttpCodec.FORWARDED_FOR_KEY, "5.5.5.5", + HttpCodec.FORWARDED_KEY, "6.6.6.6", + HttpCodec.FASTLY_CLIENT_IP_KEY, "7.7.7.7", + HttpCodec.CF_CONNECTING_IP_KEY, "8.8.8.8", + HttpCodec.CF_CONNECTING_IP_V6_KEY, "9.9.9.9"); + // spotless:on + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + assertEquals("some-user-agent", context.getUserAgent()); + assertEquals("1.1.1.1", context.getXClusterClientIp()); + assertEquals("2.2.2.2", context.getXRealIp()); + assertEquals("3.3.3.3", context.getXClientIp()); + assertEquals("4.4.4.4", context.getTrueClientIp()); + assertEquals("5.5.5.5", context.getForwardedFor()); + assertEquals("6.6.6.6", context.getForwarded()); + assertEquals("7.7.7.7", context.getFastlyClientIp()); + assertEquals("8.8.8.8", context.getCfConnectingIp()); + assertEquals("9.9.9.9", context.getCfConnectingIpv6()); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("styles") + void extractEmptyHeadersReturnsNull(Style style) { + this.extractor = buildExtractor(style.factory); + assertNull( + this.extractor.extract(headers("ignored-header", "ignored-value"), stringValuesMap())); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("styles") + void extractHeadersWithForwarding(Style style) { + this.extractor = buildExtractor(style.factory); + String forwarded = "for=1.2.3.4:1234"; + + TagContext tagOnly = this.extractor.extract(headers("Forwarded", forwarded), stringValuesMap()); + + assertNotNull(tagOnly); + assertFalse(tagOnly instanceof ExtractedContext); + assertEquals(forwarded, tagOnly.getForwarded()); + + Map fullHeaders = new HashMap<>(style.minimalTraceHeaders); + fullHeaders.putAll(headers("Forwarded", forwarded)); + + TagContext full = this.extractor.extract(fullHeaders, stringValuesMap()); + + assertExpectedTraceContext(full, style); + assertEquals(forwarded, full.getForwarded()); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("styles") + void extractHeadersWithXForwarding(Style style) { + this.extractor = buildExtractor(style.factory); + String forwardedIp = "1.2.3.4"; + String forwardedPort = "1234"; + + TagContext tagOnly = + this.extractor.extract( + headers("X-Forwarded-For", forwardedIp, "X-Forwarded-Port", forwardedPort), + stringValuesMap()); + + assertNotNull(tagOnly); + assertFalse(tagOnly instanceof ExtractedContext); + assertEquals(forwardedIp, tagOnly.getXForwardedFor()); + assertEquals(forwardedPort, tagOnly.getXForwardedPort()); + + Map fullHeaders = new HashMap<>(style.minimalTraceHeaders); + fullHeaders.putAll(headers("X-Forwarded-For", forwardedIp, "X-Forwarded-Port", forwardedPort)); + + TagContext full = this.extractor.extract(fullHeaders, stringValuesMap()); + + assertExpectedTraceContext(full, style); + assertEquals(forwardedIp, full.getXForwardedFor()); + assertEquals(forwardedPort, full.getXForwardedPort()); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("styles") + @WithConfig(key = TRACE_CLIENT_IP_RESOLVER_ENABLED, value = "false") + void extractHeadersWithIpResolutionDisabled(Style style) { + // The extractor must be built after @WithConfig is applied: ContextInterpreter reads the + // client-IP resolution flag in its constructor. + this.extractor = buildExtractor(style.factory); + Map headers = headers("X-Forwarded-For", "::1", "User-agent", "foo/bar"); + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + assertNotNull(context); + assertNull(context.getXForwardedFor()); + assertEquals("foo/bar", context.getUserAgent()); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("styles") + void extractHeadersWithIpResolutionDisabledAppsecDisabled(Style style) { + this.extractor = buildExtractor(style.factory); + // collectIpHeaders is recomputed per extract in ContextInterpreter.reset(), so toggling + // APPSEC_ACTIVE after building the extractor still takes effect. + APPSEC_ACTIVE = false; + Map headers = headers("X-Forwarded-For", "::1", "User-agent", "foo/bar"); + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + assertNotNull(context); + assertNull(context.getXForwardedFor()); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("styles") + @WithConfig(key = TRACE_CLIENT_IP_HEADER, value = "my-header") + void customIpHeaderCollectionDoesNotDisableStandardIpHeaderCollection(Style style) { + this.extractor = buildExtractor(style.factory); + Map headers = headers("X-Forwarded-For", "::1", "My-Header", "8.8.8.8"); + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + assertNotNull(context); + assertEquals("::1", context.getXForwardedFor()); + assertEquals("8.8.8.8", context.getCustomIpHeader()); + } + + private static void assertExpectedTraceContext(TagContext context, Style style) { + if (style.buildsExtractedContext) { + ExtractedContext extracted = assertInstanceOf(ExtractedContext.class, context); + assertEquals(1L, extracted.getTraceId().toLong()); + assertEquals(2L, extracted.getSpanId()); + } else { + assertFalse(context instanceof ExtractedContext); + assertEquals(DDTraceId.ZERO, context.getTraceId()); + assertEquals(DDSpanId.ZERO, context.getSpanId()); + } + } + + /** A propagation style under test: its extractor factory and minimal valid trace headers. */ + static final class Style { + final String name; + final BiFunction, HttpCodec.Extractor> factory; + final Map minimalTraceHeaders; + final boolean buildsExtractedContext; + + Style( + String name, + BiFunction, HttpCodec.Extractor> factory, + Map minimalTraceHeaders, + boolean buildsExtractedContext) { + this.name = name; + this.factory = factory; + this.minimalTraceHeaders = minimalTraceHeaders; + this.buildsExtractedContext = buildsExtractedContext; + } + + @Override + public String toString() { + return this.name; + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/B3HttpExtractorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/B3HttpExtractorTest.java new file mode 100644 index 00000000000..f60136741d5 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/B3HttpExtractorTest.java @@ -0,0 +1,281 @@ +package datadog.trace.core.propagation; + +import static datadog.trace.bootstrap.instrumentation.api.ContextVisitors.stringValuesMap; +import static datadog.trace.core.propagation.B3HttpCodec.B3_KEY; +import static datadog.trace.core.propagation.B3HttpCodec.B3_SPAN_ID; +import static datadog.trace.core.propagation.B3HttpCodec.B3_TRACE_ID; +import static datadog.trace.core.propagation.B3HttpCodec.SAMPLING_PRIORITY_ACCEPT; +import static datadog.trace.core.propagation.B3HttpCodec.SAMPLING_PRIORITY_KEY; +import static datadog.trace.core.propagation.B3HttpCodec.SPAN_ID_KEY; +import static datadog.trace.core.propagation.B3HttpCodec.TRACE_ID_KEY; +import static datadog.trace.core.propagation.HttpCodecTestHelper.headers; +import static java.util.Collections.emptyMap; +import static java.util.Collections.singletonMap; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNull; + +import datadog.trace.api.Config; +import datadog.trace.api.DDSpanId; +import datadog.trace.api.TraceConfig; +import datadog.trace.bootstrap.instrumentation.api.TagContext; +import datadog.trace.test.junit.utils.converter.PrioritySamplingConverter; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Supplier; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.converter.ConvertWith; +import org.tabletest.junit.TableTest; + +class B3HttpExtractorTest extends AbstractHttpExtractorTest { + private static final String SOME_VALUE = "my-interesting-info"; + + @Override + protected HttpCodec.Extractor newExtractor( + Config config, Supplier traceConfigSupplier) { + return B3HttpCodec.newExtractor(config, traceConfigSupplier); + } + + @TableTest({ + "scenario | traceIdHex | spanIdHex | samplingPriority | expectedSamplingPriority", + "no priority | '1' | '2' | | UNSET ", + "sampler keep | '2' | '3' | 1 | SAMPLER_KEEP ", + "sampler drop | '3' | '4' | 0 | SAMPLER_DROP ", + "uint64 max drop | 'ffffffffffffffff' | 'fffffffffffffffe' | 0 | SAMPLER_DROP ", + "uint64 max-1 keep | 'fffffffffffffffe' | 'ffffffffffffffff' | 1 | SAMPLER_KEEP " + }) + void extractHttpHeaders( + String traceIdHex, + String spanIdHex, + Integer samplingPriority, + @ConvertWith(PrioritySamplingConverter.class) byte expectedSamplingPriority) { + // spotless:off + Map headers = headers( + "", "empty key", + TRACE_ID_KEY, traceIdHex, + SPAN_ID_KEY, spanIdHex, + SOME_HEADER, SOME_VALUE, + SAMPLING_PRIORITY_KEY, samplingPriority != null ? samplingPriority.toString() : null); + // spotless:on + + ExtractedContext context = + (ExtractedContext) this.extractor.extract(headers, stringValuesMap()); + + assertEquals(B3TraceId.fromHex(traceIdHex), context.getTraceId()); + assertEquals(DDSpanId.fromHex(spanIdHex), context.getSpanId()); + assertEquals(emptyMap(), context.getBaggage()); + assertEquals(expectedB3Tags(context), context.getTags()); + assertEquals(expectedSamplingPriority, context.getSamplingPriority()); + assertNull(context.getOrigin()); + } + + @TableTest({ + "scenario | b3 | expectedTraceIdHex | expectedSpanId | expectedSamplingPriority", + "b3 takes precedence | '2-3-0' | '2' | 3 | SAMPLER_DROP ", + "b3 without priority | '2-3' | '2' | 3 | UNSET ", + "invalid b3 falls back | '0' | '1' | 2 | SAMPLER_KEEP ", + "absent b3 falls back | | '1' | 2 | SAMPLER_KEEP " + }) + void extractHttpHeadersWithB3HeaderAtTheBeginning( + String b3, + String expectedTraceIdHex, + long expectedSpanId, + @ConvertWith(PrioritySamplingConverter.class) byte expectedSamplingPriority) { + String traceIdHex = "1"; + String spanIdHex = "2"; + // spotless:off + Map headers = headers( + "", "empty key", + B3_KEY, b3, + TRACE_ID_KEY, traceIdHex, + SPAN_ID_KEY, spanIdHex, + SOME_HEADER, SOME_VALUE, + SAMPLING_PRIORITY_KEY, SAMPLING_PRIORITY_ACCEPT + ); + // spotless:on + + ExtractedContext context = + (ExtractedContext) this.extractor.extract(headers, stringValuesMap()); + + assertB3MultiOrSingleContext( + context, expectedTraceIdHex, expectedSpanId, expectedSamplingPriority); + } + + @TableTest({ + "scenario | b3 | expectedTraceIdHex | expectedSpanId | expectedSamplingPriority", + "b3 takes precedence | '2-3-0' | '2' | 3 | SAMPLER_DROP ", + "b3 without priority | '2-3' | '2' | 3 | UNSET ", + "invalid b3 falls back | '0' | '1' | 2 | SAMPLER_KEEP ", + "absent b3 falls back | | '1' | 2 | SAMPLER_KEEP " + }) + void extractHttpHeadersWithB3HeaderAtTheEnd( + String b3, + String expectedTraceIdHex, + long expectedSpanId, + @ConvertWith(PrioritySamplingConverter.class) byte expectedSamplingPriority) { + String traceIdHex = "1"; + String spanIdHex = "2"; + // spotless:off + Map headers = headers( + "", "empty key", + TRACE_ID_KEY, traceIdHex, + SPAN_ID_KEY, spanIdHex, + B3_KEY, b3, + SOME_HEADER, SOME_VALUE, + SAMPLING_PRIORITY_KEY, SAMPLING_PRIORITY_ACCEPT + ); + // spotless:on + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + assertB3MultiOrSingleContext( + context, expectedTraceIdHex, expectedSpanId, expectedSamplingPriority); + } + + private void assertB3MultiOrSingleContext( + TagContext context, + String expectedTraceIdHex, + long expectedSpanId, + int expectedSamplingPriority) { + assertEquals(B3TraceId.fromHex(expectedTraceIdHex), context.getTraceId()); + assertEquals(expectedSpanId, context.getSpanId()); + assertFalse(context.baggageItems().iterator().hasNext()); + assertEquals(expectedB3Tags(context), context.getTags()); + assertEquals(expectedSamplingPriority, context.getSamplingPriority()); + assertNull(context.getOrigin()); + } + + private Map expectedB3Tags(TagContext context) { + Map expected = new HashMap<>(); + expected.put(B3_TRACE_ID, ((B3TraceId) context.getTraceId()).getOriginal()); + expected.put(B3_SPAN_ID, DDSpanId.toHexString(context.getSpanId())); + expected.put(SOME_TAG, SOME_VALUE); + return expected; + } + + @TableTest({ + "scenario | traceId | spanId | expectedTraceIdHex | expectedSpanId ", + "negative traceId | '-1' | '1' | | ", + "negative spanId | '1' | '-1' | | ", + "zero traceId | '0' | '1' | | ", + "padded traceId | '00001' | '1' | '00001' | 1 ", + "64-bit ids | '463ac35c9f6413ad' | '463ac35c9f6413ad' | '463ac35c9f6413ad' | 5060571933882717101", + "128-bit traceId | '463ac35c9f6413ad48485a3953bb6124' | '1' | '463ac35c9f6413ad48485a3953bb6124' | 1 ", + "uint64 max traceId | 'ffffffffffffffff' | '1' | 'ffffffffffffffff' | 1 ", + "128-bit high-low max | 'aaaaaaaaaaaaaaaaffffffffffffffff' | '1' | 'aaaaaaaaaaaaaaaaffffffffffffffff' | 1 ", + "traceId too long high1 | '1ffffffffffffffffffffffffffffffff' | '1' | | ", + "traceId too long high0 | '0ffffffffffffffffffffffffffffffff' | '1' | | ", + "uint64 max spanId | '1' | 'ffffffffffffffff' | '1' | -1 ", + "spanId too long | '1' | '1ffffffffffffffff' | | " + }) + void extract128BitIdTruncatesIdTo64Bit( + String traceId, String spanId, String expectedTraceIdHex, Long expectedSpanId) { + // spotless:off + Map headers = headers( + TRACE_ID_KEY, traceId, + SPAN_ID_KEY, spanId + ); + // spotless:on + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + if (expectedTraceIdHex != null) { + assertInstanceOf(ExtractedContext.class, context); + B3TraceId expectedTraceId = B3TraceId.fromHex(expectedTraceIdHex); + assertEquals(expectedTraceId, context.getTraceId()); + long spanIdValue = expectedSpanId == null ? 0L : expectedSpanId; + assertEquals(spanIdValue, context.getSpanId()); + assertEquals(expectedTraceId.getOriginal(), context.getTags().getString(B3_TRACE_ID)); + if (expectedSpanId == null) { + assertNull(context.getTags().getString(B3_SPAN_ID)); + } else { + assertEquals(DDSpanId.toHexString(expectedSpanId), context.getTags().getString(B3_SPAN_ID)); + } + } else if (context != null) { + assertInstanceOf(TagContext.class, context); + assertFalse(context instanceof ExtractedContext); + } + } + + @Test + void extractHeaderTagsWithNoPropagation() { + TagContext context = + this.extractor.extract(singletonMap(SOME_HEADER, SOME_VALUE), stringValuesMap()); + + assertFalse(context instanceof ExtractedContext); + assertEquals(singletonMap(SOME_TAG, SOME_VALUE), context.getTags()); + } + + @Test + void extractHttpHeadersWithInvalidNonNumericId() { + // spotless:off + Map headers = headers( + TRACE_ID_KEY, "traceId", + SPAN_ID_KEY, "spanId", + SOME_HEADER, SOME_VALUE + ); + // spotless:on + + TagContext context = extractor.extract(headers, stringValuesMap()); + + assertFalse(context instanceof ExtractedContext); + assertEquals(singletonMap(SOME_TAG, SOME_VALUE), context.getTags()); + } + + @Test + void extractHttpHeadersWithOutOfRangeSpanId() { + // spotless:off + Map headers = headers( + TRACE_ID_KEY, "0", + SPAN_ID_KEY, "-1", + SOME_HEADER, SOME_VALUE + ); + // spotless:on + + TagContext context = extractor.extract(headers, stringValuesMap()); + + assertFalse(context instanceof ExtractedContext); + assertEquals(singletonMap(SOME_TAG, SOME_VALUE), context.getTags()); + } + + @TableTest({ + "scenario | traceId | spanId | expectedSpanId ", + "padded 64-bit | '00001' | '00001' | 1 ", + "normal 64-bit | '463ac35c9f6413ad' | '463ac35c9f6413ad' | 5060571933882717101", + "128-bit truncated | '463ac35c9f6413ad48485a3953bb6124' | '1' | 1 ", + "uint64 max traceId | 'ffffffffffffffff' | '1' | 1 ", + "128-bit high+low max | 'aaaaaaaaaaaaaaaaffffffffffffffff' | '1' | 1 ", + "uint64 max spanId | '1' | 'ffffffffffffffff' | -1 ", + "padded uint64 max | '1' | '000ffffffffffffffff' | -1 " + }) + void extractIdsWhileRetainingTheOriginalString( + String traceId, String spanId, long expectedSpanId) { + // spotless:off + Map headers = headers( + TRACE_ID_KEY, traceId, + SPAN_ID_KEY, spanId + ); + // spotless:on + B3TraceId expectedTraceId = B3TraceId.fromHex(traceId); + + ExtractedContext context = (ExtractedContext) extractor.extract(headers, stringValuesMap()); + + assertEquals(expectedTraceId, context.getTraceId()); + assertEquals(traceId, ((B3TraceId) context.getTraceId()).getOriginal()); + assertEquals(expectedSpanId, context.getSpanId()); + assertEquals(trimmed(spanId), DDSpanId.toHexString(context.getSpanId())); + } + + private static String trimmed(String hex) { + int length = hex.length(); + int firstNonZero = 0; + while (firstNonZero < length && hex.charAt(firstNonZero) == '0') { + firstNonZero++; + } + if (firstNonZero == length) { + return "0"; + } + return hex.substring(firstNonZero, length); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/B3HttpInjectorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/B3HttpInjectorTest.java new file mode 100644 index 00000000000..50f607d9c87 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/B3HttpInjectorTest.java @@ -0,0 +1,134 @@ +package datadog.trace.core.propagation; + +import static datadog.trace.api.ConfigDefaults.DEFAULT_PROPAGATION_B3_PADDING_ENABLED; +import static datadog.trace.api.sampling.PrioritySampling.UNSET; +import static datadog.trace.bootstrap.instrumentation.api.ContextVisitors.stringValuesMap; +import static datadog.trace.core.propagation.B3HttpCodec.B3_KEY; +import static datadog.trace.core.propagation.B3HttpCodec.SAMPLING_PRIORITY_KEY; +import static datadog.trace.core.propagation.B3HttpCodec.SPAN_ID_KEY; +import static datadog.trace.core.propagation.B3HttpCodec.TRACE_ID_KEY; +import static datadog.trace.core.propagation.B3TestHelper.spanIdOrPadded; +import static datadog.trace.core.propagation.B3TestHelper.traceIdOrPadded; +import static datadog.trace.core.propagation.B3TestHelper.trimHex; +import static java.util.Collections.emptyMap; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import datadog.context.propagation.CarrierSetter; +import datadog.trace.api.Config; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.DynamicConfig; +import datadog.trace.bootstrap.instrumentation.api.TagContext; +import datadog.trace.core.DDSpanContext; +import datadog.trace.test.junit.utils.converter.PrioritySamplingConverter; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.params.converter.ConvertWith; +import org.tabletest.junit.TableTest; + +class B3HttpInjectorTest extends AbstractHttpInjectorTest { + + private static final CarrierSetter> MAP_SETTER = Map::put; + + protected boolean tracePropagationB3Padding() { + return DEFAULT_PROPAGATION_B3_PADDING_ENABLED; + } + + @Override + protected HttpCodec.Injector newInjector() { + return B3HttpCodec.newCombinedInjector(tracePropagationB3Padding()); + } + + @TableTest({ + "scenario | traceId | spanId | samplingPriority | expectedSamplingPriority", + "unset | 1 | 2 | UNSET | ", + "sampler keep | 2 | 3 | SAMPLER_KEEP | SAMPLER_KEEP ", + "sampler drop | 4 | 5 | SAMPLER_DROP | SAMPLER_DROP ", + "user keep | 5 | 6 | USER_KEEP | SAMPLER_KEEP ", + "user drop | 6 | 7 | USER_DROP | SAMPLER_DROP ", + "uint64 max unset | -1 | -2 | UNSET | ", + "uint64 max-1 keep | -2 | -1 | SAMPLER_KEEP | SAMPLER_KEEP " + }) + void injectHttpHeaders( + long traceId, + long spanId, + @ConvertWith(PrioritySamplingConverter.class) byte samplingPriority, + @ConvertWith(PrioritySamplingConverter.class) Byte expectedSamplingPriority) { + + DDSpanContext spanContext = + mockedSpanContext(DDTraceId.from(traceId), spanId, samplingPriority); + + Map carrier = new HashMap<>(); + this.injector.inject(spanContext, carrier, MAP_SETTER); + + String traceIdHex = traceIdOrPadded(traceId, tracePropagationB3Padding()); + String spanIdHex = spanIdOrPadded(spanId, tracePropagationB3Padding()); + assertEquals(traceIdHex, carrier.get(TRACE_ID_KEY)); + assertEquals(spanIdHex, carrier.get(SPAN_ID_KEY)); + + if (expectedSamplingPriority != null) { + assertEquals(4, carrier.size()); + assertEquals(expectedSamplingPriority.toString(), carrier.get(SAMPLING_PRIORITY_KEY)); + assertEquals( + traceIdHex + "-" + spanIdHex + "-" + expectedSamplingPriority, carrier.get(B3_KEY)); + } else { + assertEquals(3, carrier.size()); + assertEquals(traceIdHex + "-" + spanIdHex, carrier.get(B3_KEY)); + } + } + + @TableTest({ + "scenario | traceId | spanId ", + "padded 64-bit | '00001' | '00001' ", + "64-bit | '463ac35c9f6413ad' | '463ac35c9f6413ad' ", + "128-bit | '463ac35c9f6413ad48485a3953bb6124' | '1' ", + "uint64 max traceId | 'ffffffffffffffff' | '1' ", + "128-bit high+low max | 'aaaaaaaaaaaaaaaaffffffffffffffff' | '1' ", + "uint64 max spanId | '1' | 'ffffffffffffffff' ", + "padded uint64 max | '1' | '000ffffffffffffffff'" + }) + void injectHttpHeadersWithExtractedOriginal(String traceId, String spanId) { + Map headers = new HashMap<>(); + headers.put(TRACE_ID_KEY.toUpperCase(), traceId); + headers.put(SPAN_ID_KEY.toUpperCase(), spanId); + DynamicConfig dynamicConfig = + DynamicConfig.create().setHeaderTags(emptyMap()).setBaggageMapping(emptyMap()).apply(); + HttpCodec.Extractor extractor = + B3HttpCodec.newExtractor(Config.get(), dynamicConfig::captureTraceConfig); + TagContext context = extractor.extract(headers, stringValuesMap()); + + DDSpanContext mockedContext = mockedSpanContext(context); + Map carrier = new HashMap<>(); + this.injector.inject(mockedContext, carrier, MAP_SETTER); + + String traceIdHex = traceIdOrPadded(traceId, tracePropagationB3Padding()); + String spanIdHex = spanIdOrPadded(trimHex(spanId), tracePropagationB3Padding()); + assertEquals(traceIdHex, carrier.get(TRACE_ID_KEY)); + assertEquals(spanIdHex, carrier.get(SPAN_ID_KEY)); + assertEquals(traceIdHex + "-" + spanIdHex, carrier.get(B3_KEY)); + assertEquals(3, carrier.size()); + } + + private DDSpanContext mockedSpanContext(TagContext context) { + return mockedSpanContext(context.getTraceId(), context.getSpanId(), UNSET); + } + + private DDSpanContext mockedSpanContext(DDTraceId traceId, long spanId, int samplingPriority) { + Map baggage = new HashMap<>(); + baggage.put("k1", "v1"); + baggage.put("k2", "v2"); + return mockSpanContext( + traceId, + spanId, + samplingPriority, + "fakeOrigin", + baggage, + PropagationTags.factory().empty()); + } + + static class B3HttpInjectorNonPaddedTest extends B3HttpInjectorTest { + @Override + protected boolean tracePropagationB3Padding() { + return false; + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/B3TestHelper.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/B3TestHelper.java new file mode 100644 index 00000000000..f8867c2b1cf --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/B3TestHelper.java @@ -0,0 +1,72 @@ +package datadog.trace.core.propagation; + +import datadog.trace.api.DDTraceId; + +/** + * This class contains helper methods for formatting trace and span identifiers for B3 propagation + * tests. + */ +public final class B3TestHelper { + + private B3TestHelper() {} + + static String traceIdOrPadded(DDTraceId id, boolean padding) { + if (id.toHighOrderLong() == 0) { + return idOrPadded(Long.toHexString(id.toLong()), 32, padding); + } + return id.toHexString(); + } + + static String traceIdOrPadded(long id, boolean padding) { + return idOrPadded(id, 32, padding); + } + + static String traceIdOrPadded(String hexTraceId, boolean padding) { + return idOrPadded(hexTraceId, 32, padding); + } + + static String spanIdOrPadded(long id, boolean padding) { + return idOrPadded(id, 16, padding); + } + + static String spanIdOrPadded(String hexSpanId, boolean padding) { + return idOrPadded(hexSpanId, 16, padding); + } + + private static String idOrPadded(long id, int size, boolean padding) { + return idOrPadded(Long.toHexString(id), size, padding); + } + + private static String idOrPadded(String id, int size, boolean padding) { + if (!padding) { + return id.toLowerCase(); + } + return padHexLower(id, size); + } + + private static String padHexLower(String hex, int size) { + String lower = hex.toLowerCase(); + int diff = size - lower.length(); + if (diff <= 0) { + return lower; + } + StringBuilder sb = new StringBuilder(size); + for (int i = 0; i < diff; i++) { + sb.append('0'); + } + sb.append(lower); + return sb.toString(); + } + + static String trimHex(String hex) { + int length = hex.length(); + int firstNonZero = 0; + while (firstNonZero < length && hex.charAt(firstNonZero) == '0') { + firstNonZero++; + } + if (firstNonZero == length) { + return "0"; + } + return hex.substring(firstNonZero, length); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/ControllableSampler.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/ControllableSampler.java new file mode 100644 index 00000000000..e649844069f --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/ControllableSampler.java @@ -0,0 +1,22 @@ +package datadog.trace.core.propagation; + +import static datadog.trace.api.sampling.PrioritySampling.SAMPLER_KEEP; +import static datadog.trace.api.sampling.SamplingMechanism.DEFAULT; + +import datadog.trace.common.sampling.PrioritySampler; +import datadog.trace.common.sampling.Sampler; +import datadog.trace.core.CoreSpan; + +public class ControllableSampler implements Sampler, PrioritySampler { + protected int nextSamplingPriority = SAMPLER_KEEP; + + @Override + public > void setSamplingPriority(T span) { + span.setSamplingPriority(nextSamplingPriority, DEFAULT); + } + + @Override + public > boolean sample(T span) { + return true; + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/DatadogHttpExtractorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/DatadogHttpExtractorTest.java new file mode 100644 index 00000000000..4c3644f24ed --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/DatadogHttpExtractorTest.java @@ -0,0 +1,331 @@ +package datadog.trace.core.propagation; + +import static datadog.trace.api.config.TracerConfig.REQUEST_HEADER_TAGS_COMMA_ALLOWED; +import static datadog.trace.api.sampling.PrioritySampling.UNSET; +import static datadog.trace.bootstrap.instrumentation.api.ContextVisitors.stringValuesMap; +import static datadog.trace.core.propagation.DatadogHttpCodec.DATADOG_TAGS_KEY; +import static datadog.trace.core.propagation.DatadogHttpCodec.ORIGIN_KEY; +import static datadog.trace.core.propagation.DatadogHttpCodec.OT_BAGGAGE_PREFIX; +import static datadog.trace.core.propagation.DatadogHttpCodec.SAMPLING_PRIORITY_KEY; +import static datadog.trace.core.propagation.DatadogHttpCodec.SPAN_ID_KEY; +import static datadog.trace.core.propagation.DatadogHttpCodec.TRACE_ID_KEY; +import static datadog.trace.core.propagation.HttpCodecTestHelper.headers; +import static datadog.trace.test.junit.utils.converter.TraceIdConverter.TRACE_ID_MAX_PLUS_1; +import static java.util.Collections.singletonMap; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; + +import datadog.trace.api.Config; +import datadog.trace.api.DD128bTraceId; +import datadog.trace.api.DD64bTraceId; +import datadog.trace.api.DDSpanId; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.DynamicConfig; +import datadog.trace.api.TraceConfig; +import datadog.trace.api.internal.util.LongStringUtils; +import datadog.trace.bootstrap.instrumentation.api.TagContext; +import datadog.trace.test.junit.utils.config.WithConfig; +import datadog.trace.test.junit.utils.converter.PrioritySamplingConverter; +import datadog.trace.test.junit.utils.converter.TraceIdConverter; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Supplier; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.converter.ConvertWith; +import org.junit.jupiter.params.provider.ValueSource; +import org.tabletest.junit.TableTest; + +class DatadogHttpExtractorTest extends AbstractHttpExtractorTest { + @Override + protected HttpCodec.Extractor newExtractor( + Config config, Supplier traceConfigSupplier) { + return DatadogHttpCodec.newExtractor(config, traceConfigSupplier); + } + + @TableTest({ + "scenario | traceId | spanId | samplingPriority | origin ", + "unset no origin | '1' | '2' | UNSET | ", + "keep with origin | '2' | '3' | SAMPLER_KEEP | 'saipan'", + "uint64 max unset | 'MAX' | 'MAX-1' | UNSET | 'saipan'", + "uint64 max-1 keep | 'MAX-1' | 'MAX' | SAMPLER_KEEP | 'saipan'" + }) + void extractHttpHeaders( + @ConvertWith(TraceIdConverter.class) String traceId, + @ConvertWith(TraceIdConverter.class) String spanId, + @ConvertWith(PrioritySamplingConverter.class) byte samplingPriority, + String origin) { + // spotless:off + Map headers = headers( + "", "empty key", + TRACE_ID_KEY, traceId, + SPAN_ID_KEY, spanId, + OT_BAGGAGE_PREFIX + "k1", "v1", + OT_BAGGAGE_PREFIX + "k2", "v2", + SOME_HEADER, "my-interesting-info,and-more", + SOME_CUSTOM_BAGGAGE_HEADER, "my-interesting-baggage-info", + SOME_CUSTOM_BAGGAGE_HEADER_2, "my-interesting-baggage-info-2", + SAMPLING_PRIORITY_KEY, samplingPriority != UNSET ? String.valueOf(samplingPriority) : null, + ORIGIN_KEY, origin + ); + // spotless:on + + ExtractedContext context = (ExtractedContext) extractor.extract(headers, stringValuesMap()); + + assertEquals(DDTraceId.from(traceId), context.getTraceId()); + assertEquals(DDSpanId.from(spanId), context.getSpanId()); + Map expectedBaggage = new HashMap<>(); + expectedBaggage.put("k1", "v1"); + expectedBaggage.put("k2", "v2"); + expectedBaggage.put(SOME_BAGGAGE, "my-interesting-baggage-info"); + expectedBaggage.put(SOME_CASE_SENSITIVE_BAGGAGE, "my-interesting-baggage-info-2"); + assertEquals(expectedBaggage, context.getBaggage()); + assertEquals(singletonMap(SOME_TAG, "my-interesting-info,and-more"), context.getTags()); + assertEquals(samplingPriority, context.getSamplingPriority()); + assertEquals(origin, asString(context.getOrigin())); + } + + @WithConfig(key = REQUEST_HEADER_TAGS_COMMA_ALLOWED, value = "false") + @Test + void extractHttpHeadersWithoutComma() { + // Recreate extractor with the new comma config + this.extractor.cleanup(); + DynamicConfig dynamicConfig = + DynamicConfig.create().setHeaderTags(singletonMap(SOME_HEADER, SOME_TAG)).apply(); + this.extractor = DatadogHttpCodec.newExtractor(Config.get(), dynamicConfig::captureTraceConfig); + + String headerWithComma = "my-interesting-info,and-more"; + // spotless:off + Map headers = headers( + TRACE_ID_KEY, "1", + SPAN_ID_KEY, "2", + SOME_HEADER, headerWithComma + ); + // spotless:on + + ExtractedContext context = + (ExtractedContext) this.extractor.extract(headers, stringValuesMap()); + + String expectedHeader = "my-interesting-info"; + assertEquals(expectedHeader, context.getTags().getString(SOME_TAG)); + } + + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void extractHeaderTagsWithNoPropagation(boolean withOrigin) { + // spotless:off + Map headers = headers( + ORIGIN_KEY, withOrigin ? "my-origin" : null, + SOME_HEADER, "my-interesting-info" + ); + // spotless:on + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + assertFalse(context instanceof ExtractedContext); + assertEquals(singletonMap(SOME_TAG, "my-interesting-info"), context.getTags()); + if (withOrigin) { + assertEquals("my-origin", asString(context.getOrigin())); + } + } + + @TableTest({ + "scenario | hexId ", + "64-bit short | '1' ", + "64-bit max chars | '123456789abcdef0' ", + "128-bit | '123456789abcdef0123456789abcdef0'", + "128-bit zero middle | '64184f2400000000123456789abcdef0'", + "128-bit all f | 'ffffffffffffffffffffffffffffffff'" + }) + void extractHttpHeadersWith128BitTraceId(String hexId) { + DD128bTraceId traceId = DD128bTraceId.fromHex(hexId); + boolean is128bTrace = traceId.toHighOrderLong() != 0; + + // spotless:off + Map headers = headers( + TRACE_ID_KEY, traceId.toString(), + SPAN_ID_KEY, "2", + OT_BAGGAGE_PREFIX + "k1", "v1", + OT_BAGGAGE_PREFIX + "k2", "v2", + SOME_HEADER, "my-interesting-info", + DATADOG_TAGS_KEY, is128bTrace + ? "_dd.p.tid=" + LongStringUtils.toHexStringPadded(traceId.toHighOrderLong(), 16) + : null + ); + // spotless:on + + ExtractedContext context = + (ExtractedContext) this.extractor.extract(headers, stringValuesMap()); + + DDTraceId expectedTraceId = is128bTrace ? traceId : DD64bTraceId.from(traceId.toLong()); + assertEquals(expectedTraceId, context.getTraceId()); + assertEquals(DDSpanId.from("2"), context.getSpanId()); + Map expectedBaggage = new HashMap<>(); + expectedBaggage.put("k1", "v1"); + expectedBaggage.put("k2", "v2"); + assertEquals(expectedBaggage, context.getBaggage()); + assertEquals(singletonMap(SOME_TAG, "my-interesting-info"), context.getTags()); + } + + @Test + void extractHttpHeadersWithInvalidNonNumericId() { + // spotless:off + Map headers = headers( + TRACE_ID_KEY, "traceId", + SPAN_ID_KEY, "spanId", + OT_BAGGAGE_PREFIX + "k1", "v1", + OT_BAGGAGE_PREFIX + "k2", "v2", + SOME_HEADER, "my-interesting-info" + ); + // spotless:on + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + assertNull(context); + } + + @Test + void extractHttpHeadersWithOutOfRangeTraceId() { + // spotless:off + Map headers = headers( + TRACE_ID_KEY, TRACE_ID_MAX_PLUS_1, + SPAN_ID_KEY, "0", + OT_BAGGAGE_PREFIX + "k1", "v1", + OT_BAGGAGE_PREFIX + "k2", "v2", + SOME_HEADER, "my-interesting-info" + ); + // spotless:on + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + assertNull(context); + } + + @Test + void extractHttpHeadersWithOutOfRangeSpanId() { + // spotless:off + Map headers = headers( + TRACE_ID_KEY, "0", + SPAN_ID_KEY, "-1", + OT_BAGGAGE_PREFIX + "k1", "v1", + OT_BAGGAGE_PREFIX + "k2", "v2", + SOME_HEADER, "my-interesting-info" + ); + // spotless:on + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + assertNull(context); + } + + @TableTest({ + "scenario | traceId | spanId | expectExtraction", + "negative traceId | '-1' | '1' | false ", + "negative spanId | '1' | '-1' | false ", + "zero traceId | '0' | '1' | false ", + "zero spanId | '1' | '0' | true ", + "uint64 max traceId | 'MAX' | '1' | true ", + "out-of-range traceId | 'MAX+1' | '1' | false ", + "uint64 max spanId | '1' | 'MAX' | true ", + "out-of-range spanId | '1' | 'MAX+1' | false " + }) + void moreIdRangeValidation( + @ConvertWith(TraceIdConverter.class) String traceId, + @ConvertWith(TraceIdConverter.class) String spanId, + boolean expectExtraction) { + // spotless:off + Map headers = headers( + TRACE_ID_KEY, traceId, + SPAN_ID_KEY, spanId + ); + // spotless:on + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + if (expectExtraction) { + ExtractedContext extracted = assertInstanceOf(ExtractedContext.class, context); + assertEquals(DDTraceId.from(traceId), extracted.getTraceId()); + assertEquals(DDSpanId.from(spanId), extracted.getSpanId()); + } else { + assertNull(context); + } + } + + @TableTest({ + "scenario | traceId | spanId | endToEndStartTime", + "zero | '1' | '2' | 0 ", + "epoch 2021 | '2' | '3' | 1610001234 " + }) + void extractHttpHeadersWithEndToEnd(String traceId, String spanId, long endToEndStartTime) { + // spotless:off + Map headers = headers( + "", "empty key", + TRACE_ID_KEY, traceId, + SPAN_ID_KEY, spanId, + OT_BAGGAGE_PREFIX + "k1", "v1", + OT_BAGGAGE_PREFIX + "t0", String.valueOf(endToEndStartTime), + OT_BAGGAGE_PREFIX + "k2", "v2", + SOME_HEADER, "my-interesting-info", + SOME_CUSTOM_BAGGAGE_HEADER, "my-interesting-baggage-info", + SOME_CUSTOM_BAGGAGE_HEADER_2, "my-interesting-baggage-info-2" + ); + // spotless:on + + ExtractedContext context = + (ExtractedContext) this.extractor.extract(headers, stringValuesMap()); + + assertEquals(DDTraceId.from(traceId), context.getTraceId()); + assertEquals(DDSpanId.from(spanId), context.getSpanId()); + Map expectedBaggage = new HashMap<>(); + expectedBaggage.put("k1", "v1"); + expectedBaggage.put("k2", "v2"); + expectedBaggage.put(SOME_BAGGAGE, "my-interesting-baggage-info"); + expectedBaggage.put(SOME_CASE_SENSITIVE_BAGGAGE, "my-interesting-baggage-info-2"); + assertEquals(expectedBaggage, context.getBaggage()); + assertEquals(singletonMap(SOME_TAG, "my-interesting-info"), context.getTags()); + assertEquals(endToEndStartTime * 1000000L, context.getEndToEndStartTime()); + } + + @TableTest({ + "scenario | traceId | spanId | ctxCreated", + "negative traceId | '-1' | '1' | false ", + "negative spanId | '1' | '-1' | false ", + "zero traceId | '0' | '1' | true ", + "uint64 max-1 ids | 'MAX-1' | 'MAX-1' | true " + }) + void baggageIsMappedOnContextCreation( + @ConvertWith(TraceIdConverter.class) String traceId, + @ConvertWith(TraceIdConverter.class) String spanId, + boolean ctxCreated) { + // spotless:off + Map headers = headers( + TRACE_ID_KEY, traceId, + SPAN_ID_KEY, spanId, + SOME_CUSTOM_BAGGAGE_HEADER, "mappedBaggageValue", + OT_BAGGAGE_PREFIX + "k1", "v1", + OT_BAGGAGE_PREFIX + "k2", "v2", + SOME_ARBITRARY_HEADER, "my-interesting-info" + ); + // spotless:on + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + if (ctxCreated) { + assertNotNull(context); + Map expectedBaggage = new HashMap<>(); + expectedBaggage.put(SOME_BAGGAGE, "mappedBaggageValue"); + expectedBaggage.put("k1", "v1"); + expectedBaggage.put("k2", "v2"); + assertEquals(expectedBaggage, context.getBaggage()); + } else { + assertNull(context); + } + } + + private static String asString(CharSequence cs) { + return cs == null ? null : cs.toString(); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/DatadogHttpInjectorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/DatadogHttpInjectorTest.java new file mode 100644 index 00000000000..20a49f0f901 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/DatadogHttpInjectorTest.java @@ -0,0 +1,185 @@ +package datadog.trace.core.propagation; + +import static datadog.trace.api.internal.util.LongStringUtils.toHexStringPadded; +import static datadog.trace.api.sampling.PrioritySampling.UNSET; +import static datadog.trace.api.sampling.PrioritySampling.USER_KEEP; +import static datadog.trace.api.sampling.SamplingMechanism.MANUAL; +import static datadog.trace.core.propagation.DatadogHttpCodec.DATADOG_TAGS_KEY; +import static datadog.trace.core.propagation.DatadogHttpCodec.ORIGIN_KEY; +import static datadog.trace.core.propagation.DatadogHttpCodec.OT_BAGGAGE_PREFIX; +import static datadog.trace.core.propagation.DatadogHttpCodec.SAMPLING_PRIORITY_KEY; +import static datadog.trace.core.propagation.DatadogHttpCodec.SPAN_ID_KEY; +import static datadog.trace.core.propagation.DatadogHttpCodec.TRACE_ID_KEY; +import static datadog.trace.core.propagation.PropagationTags.HeaderType.DATADOG; +import static java.util.Collections.singletonMap; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import datadog.trace.api.DD128bTraceId; +import datadog.trace.api.DDSpanId; +import datadog.trace.api.DDTraceId; +import datadog.trace.core.DDSpanContext; +import datadog.trace.test.junit.utils.converter.PrioritySamplingConverter; +import datadog.trace.test.junit.utils.converter.TraceIdConverter; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.converter.ConvertWith; +import org.tabletest.junit.TableTest; + +class DatadogHttpInjectorTest extends AbstractHttpInjectorTest { + + @Override + protected HttpCodec.Injector newInjector() { + return DatadogHttpCodec.newInjector(singletonMap("some-baggage-key", "SOME_CUSTOM_HEADER")); + } + + @TableTest({ + "scenario | traceId | spanId | samplingPriority | origin ", + "unset no origin | '1' | '2' | UNSET | ", + "keep with origin | '1' | '2' | SAMPLER_KEEP | 'saipan'", + "uint64 max unset | 'MAX' | 'MAX-1' | UNSET | 'saipan'", + "uint64 max-1 keep | 'MAX-1' | 'MAX' | SAMPLER_KEEP | " + }) + void injectHttpHeaders( + @ConvertWith(TraceIdConverter.class) String traceId, + @ConvertWith(TraceIdConverter.class) String spanId, + @ConvertWith(PrioritySamplingConverter.class) byte samplingPriority, + String origin) { + Map baggage = new HashMap<>(); + baggage.put("k1", "v1"); + baggage.put("k2", "v2"); + baggage.put("some-baggage-key", "some-value"); + + DDSpanContext spanContext = + mockSpanContext(traceId, spanId, samplingPriority, origin, baggage, "_dd.p.usr=123"); + Map carrier = new HashMap<>(); + + this.injector.inject(spanContext, carrier, Map::put); + + int expectedSize = 6; // trace_id, span_id, k1, k2, custom_header, datadog_tags + assertEquals(traceId, carrier.get(TRACE_ID_KEY)); + assertEquals(spanId, carrier.get(SPAN_ID_KEY)); + if (samplingPriority != UNSET) { + assertEquals(String.valueOf(samplingPriority), carrier.get(SAMPLING_PRIORITY_KEY)); + expectedSize++; + } + if (origin != null) { + assertEquals(origin, carrier.get(ORIGIN_KEY)); + expectedSize++; + } + assertEquals("v1", carrier.get(OT_BAGGAGE_PREFIX + "k1")); + assertEquals("v2", carrier.get(OT_BAGGAGE_PREFIX + "k2")); + assertEquals("some-value", carrier.get("SOME_CUSTOM_HEADER")); + assertEquals("_dd.p.usr=123", carrier.get(DATADOG_TAGS_KEY)); + assertEquals(expectedSize, carrier.size()); + } + + @Test + void injectHttpHeadersWithEndToEnd() { + Map baggage = new HashMap<>(); + baggage.put("k1", "v1"); + baggage.put("k2", "v2"); + + DDSpanContext spanContext = + mockSpanContext("1", "2", UNSET, "fakeOrigin", baggage, "_dd.p.dm=-4,_dd.p.anytag=value"); + spanContext.beginEndToEnd(); + Map carrier = new HashMap<>(); + + this.injector.inject(spanContext, carrier, Map::put); + + String expectedT0 = String.valueOf(spanContext.getEndToEndStartTime() / 1_000_000L); + assertEquals("1", carrier.get(TRACE_ID_KEY)); + assertEquals("2", carrier.get(SPAN_ID_KEY)); + assertEquals("fakeOrigin", carrier.get(ORIGIN_KEY)); + assertEquals(expectedT0, carrier.get(OT_BAGGAGE_PREFIX + "t0")); + assertEquals("v1", carrier.get(OT_BAGGAGE_PREFIX + "k1")); + assertEquals("v2", carrier.get(OT_BAGGAGE_PREFIX + "k2")); + assertEquals("_dd.p.dm=-4,_dd.p.anytag=value", carrier.get(DATADOG_TAGS_KEY)); + assertEquals(7, carrier.size()); + } + + @Test + void injectTheDecisionMakerTag() { + Map baggage = new HashMap<>(); + baggage.put("k1", "v1"); + baggage.put("k2", "v2"); + + DDSpanContext spanContext = mockSpanContext("1", "2", UNSET, "fakeOrigin", baggage, null); + spanContext.setSamplingPriority(USER_KEEP, MANUAL); + Map carrier = new HashMap<>(); + + this.injector.inject(spanContext, carrier, Map::put); + + assertEquals("1", carrier.get(TRACE_ID_KEY)); + assertEquals("2", carrier.get(SPAN_ID_KEY)); + assertEquals("fakeOrigin", carrier.get(ORIGIN_KEY)); + assertEquals("v1", carrier.get(OT_BAGGAGE_PREFIX + "k1")); + assertEquals("v2", carrier.get(OT_BAGGAGE_PREFIX + "k2")); + assertEquals("2", carrier.get("x-datadog-sampling-priority")); + assertEquals("_dd.p.dm=-4", carrier.get(DATADOG_TAGS_KEY)); + assertEquals(7, carrier.size()); + } + + @TableTest({ + "scenario | hexId ", + "64-bit short | '1' ", + "64-bit max chars | '123456789abcdef0' ", + "128-bit | '123456789abcdef0123456789abcdef0'", + "128-bit zero middle | '64184f2400000000123456789abcdef0'", + "128-bit all f | 'ffffffffffffffffffffffffffffffff'" + }) + void injectHttpHeadersWith128BitTraceId(String hexId) { + DD128bTraceId traceId = DD128bTraceId.fromHex(hexId); + Map baggage = new HashMap<>(); + baggage.put("k1", "v1"); + baggage.put("k2", "v2"); + + DDSpanContext spanContext = + mockSpanContext(traceId, "2", UNSET, null, baggage, "_dd.p.dm=-4,_dd.p.anytag=value"); + spanContext.beginEndToEnd(); + Map carrier = new HashMap<>(); + + this.injector.inject(spanContext, carrier, Map::put); + + String expectedT0 = String.valueOf(spanContext.getEndToEndStartTime() / 1_000_000L); + String expectDdPTags = + traceId.toHighOrderLong() == 0 + ? "_dd.p.dm=-4,_dd.p.anytag=value" + : "_dd.p.dm=-4,_dd.p.tid=" + + toHexStringPadded(traceId.toHighOrderLong(), 16) + + ",_dd.p.anytag=value"; + assertEquals(traceId.toString(), carrier.get(TRACE_ID_KEY)); + assertEquals("2", carrier.get(SPAN_ID_KEY)); + assertEquals(expectedT0, carrier.get(OT_BAGGAGE_PREFIX + "t0")); + assertEquals("v1", carrier.get(OT_BAGGAGE_PREFIX + "k1")); + assertEquals("v2", carrier.get(OT_BAGGAGE_PREFIX + "k2")); + assertEquals(expectDdPTags, carrier.get(DATADOG_TAGS_KEY)); + assertEquals(6, carrier.size()); + } + + private DDSpanContext mockSpanContext( + String traceId, + String spanId, + byte samplingPriority, + String origin, + Map baggage, + String ddPTags) { + return mockSpanContext( + DDTraceId.from(traceId), spanId, samplingPriority, origin, baggage, ddPTags); + } + + private DDSpanContext mockSpanContext( + DDTraceId traceId, + String spanId, + byte samplingPriority, + String origin, + Map baggage, + String ddPTags) { + PropagationTags propagationTags = + ddPTags == null + ? PropagationTags.factory().empty() + : PropagationTags.factory().fromHeaderValue(DATADOG, ddPTags); + return mockSpanContext( + traceId, DDSpanId.from(spanId), samplingPriority, origin, baggage, propagationTags); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/DatadogPropagationTagsTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/DatadogPropagationTagsTest.java new file mode 100644 index 00000000000..22332709f62 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/DatadogPropagationTagsTest.java @@ -0,0 +1,197 @@ +package datadog.trace.core.propagation; + +import static datadog.trace.api.sampling.PrioritySampling.USER_KEEP; +import static datadog.trace.api.sampling.SamplingMechanism.MANUAL; +import static datadog.trace.core.propagation.PropagationTags.HeaderType.DATADOG; +import static datadog.trace.core.propagation.PropagationTags.HeaderType.W3C; +import static datadog.trace.core.propagation.PropagationTags.factory; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; + +import datadog.trace.test.junit.utils.converter.PrioritySamplingConverter; +import datadog.trace.test.junit.utils.converter.ProductTraceSourceConverter; +import datadog.trace.test.junit.utils.converter.SamplingMechanismConverter; +import datadog.trace.test.util.DDJavaSpecification; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.converter.ConvertWith; +import org.tabletest.junit.TableTest; + +class DatadogPropagationTagsTest extends DDJavaSpecification { + @TableTest({ + "scenario | headerValue | expectedHeaderValue | tags ", + "null input | | | [:] ", + "empty input | '' | | [:] ", + "valid dm tag short | '_dd.p.dm=934086a686-4' | '_dd.p.dm=934086a686-4' | [_dd.p.dm: '934086a686-4'] ", + "valid dm tag 2-digit | '_dd.p.dm=934086a686-10' | '_dd.p.dm=934086a686-10' | [_dd.p.dm: '934086a686-10'] ", + "valid dm tag 3-digit | '_dd.p.dm=934086a686-102' | '_dd.p.dm=934086a686-102' | [_dd.p.dm: '934086a686-102'] ", + "dm tag minus only | '_dd.p.dm=-1' | '_dd.p.dm=-1' | [_dd.p.dm: '-1'] ", + "any p tag | '_dd.p.anytag=value' | '_dd.p.anytag=value' | [_dd.p.anytag: 'value'] ", + "non p tag dropped | '_dd.b.somekey=value' | | [:] ", + "upstream services alone dropped | '_dd.p.upstream_services=bWNudWx0eS13ZWI|0|1|0.1' | | [:] ", + "dm and anytag | '_dd.p.dm=934086a686-4,_dd.p.anytag=value' | '_dd.p.dm=934086a686-4,_dd.p.anytag=value' | [_dd.p.dm: '934086a686-4', _dd.p.anytag: 'value'] ", + "dm with upstream and anytag | '_dd.p.dm=934086a686-4,_dd.p.upstream_services=bWNudWx0eS13ZWI|0|1|0.1,_dd.p.anytag=value' | '_dd.p.dm=934086a686-4,_dd.p.anytag=value' | [_dd.p.dm: '934086a686-4', _dd.p.anytag: 'value'] ", + "ddb keyonly with dm upstream | '_dd.b.keyonly=value,_dd.p.dm=934086a686-4,_dd.p.upstream_services=bWNudWx0eS13ZWI|0|1|0.1,_dd.p.anytag=value' | '_dd.p.dm=934086a686-4,_dd.p.anytag=value' | [_dd.p.dm: '934086a686-4', _dd.p.anytag: 'value'] ", + "valid p tag with spaces | '_dd.p.ab=1 2 3' | '_dd.p.ab=1 2 3' | [_dd.p.ab: '1 2 3'] ", + "valid p tag leading trail spc | '_dd.p.ab= 123 ' | '_dd.p.ab= 123 ' | [_dd.p.ab: ' 123 '] ", + "key only error | '_dd.p.keyonly' | | [_dd.propagation_error: 'decoding_error'] ", + "leading comma error | ',_dd.p.dm=Value' | | [_dd.propagation_error: 'decoding_error'] ", + "comma only error | ',' | | [_dd.propagation_error: 'decoding_error'] ", + "ddb keyonly with embedded keyonly | '_dd.b.somekey=value,_dd.p.dm=934086a686-4,_dd.p.keyonly,_dd.p.upstream_services=bWNudWx0eS13ZWI|0|1|0.1,_dd.p.anytag=value' | | [_dd.propagation_error: 'decoding_error'] ", + "embedded keyonly with dm upstream | '_dd.p.keyonly,_dd.p.dm=934086a686-4,_dd.p.upstream_services=bWNudWx0eS13ZWI|0|1|0.1,_dd.p.anytag=value' | | [_dd.propagation_error: 'decoding_error'] ", + "leading comma with dm upstream | ',_dd.p.dm=934086a686-4,_dd.p.upstream_services=bWNudWx0eS13ZWI|0|1|0.1,_dd.p.anytag=value' | | [_dd.propagation_error: 'decoding_error'] ", + "double comma in tagset | '_dd.p.dm=934086a686-4,,_dd.p.upstream_services=bWNudWx0eS13ZWI|0|1|0.1,_dd.p.anytag=value' | | [_dd.propagation_error: 'decoding_error'] ", + "space tag in tagset | '_dd.p.dm=934086a686-4, ,_dd.p.upstream_services=bWNudWx0eS13ZWI|0|1|0.1,_dd.p.anytag=value' | | [_dd.propagation_error: 'decoding_error'] ", + "upstream variant dropped alone | '_dd.p.upstream_services=bmV1dHJvbg==|0|1|0.2253' | | [:] ", + "leading space error | ' _dd.p.ab=123' | | [_dd.propagation_error: 'decoding_error'] ", + "key with space error | '_dd.p.a b=123' | | [_dd.propagation_error: 'decoding_error'] ", + "trailing key space error | '_dd.p.ab =123' | | [_dd.propagation_error: 'decoding_error'] ", + "space inside key error | '_dd.p. ab=123' | | [_dd.propagation_error: 'decoding_error'] ", + "tag with eq value | '_dd.p.a=b=1=2' | '_dd.p.a=b=1=2' | [_dd.p.a: 'b=1=2'] ", + "invalid key non-ascii | '_dd.p.1ö2=value' | | [_dd.propagation_error: 'decoding_error'] ", + "value with equals | '_dd.p.ab=1=2' | '_dd.p.ab=1=2' | [_dd.p.ab: '1=2'] ", + "invalid value non-ascii | '_dd.p.ab=1ô2' | | [_dd.propagation_error: 'decoding_error'] ", + "dm tag upper case | '_dd.p.dm=934086A686-4' | | [_dd.propagation_error: 'decoding_error'] ", + "dm tag too short | '_dd.p.dm=934086a66-4' | | [_dd.propagation_error: 'decoding_error'] ", + "dm tag too long | '_dd.p.dm=934086a6653-4' | | [_dd.propagation_error: 'decoding_error'] ", + "dm tag missing separator | '_dd.p.dm=934086a66534' | | [_dd.propagation_error: 'decoding_error'] ", + "dm tag missing mechanism | '_dd.p.dm=934086a665-' | | [_dd.propagation_error: 'decoding_error'] ", + "dm tag invalid mechanism char | '_dd.p.dm=934086a665-a' | | [_dd.propagation_error: 'decoding_error'] ", + "dm tag mechanism with letter | '_dd.p.dm=934086a665-12b' | | [_dd.propagation_error: 'decoding_error'] ", + "tid empty | '_dd.p.tid=' | | [_dd.propagation_error: 'decoding_error'] ", + "tid length 1 | '_dd.p.tid=1' | | [_dd.propagation_error: 'malformed_tid 1'] ", + "tid length 15 | '_dd.p.tid=111111111111111' | | [_dd.propagation_error: 'malformed_tid 111111111111111'] ", + "tid length 17 | '_dd.p.tid=11111111111111111' | | [_dd.propagation_error: 'malformed_tid 11111111111111111']", + "tid invalid uppercase | '_dd.p.tid=123456789ABCDEF0' | | [_dd.propagation_error: 'malformed_tid 123456789ABCDEF0'] ", + "tid invalid non-hex | '_dd.p.tid=123456789abcdefg' | | [_dd.propagation_error: 'malformed_tid 123456789abcdefg'] ", + "tid invalid negative | '_dd.p.tid=-123456789abcdef' | | [_dd.propagation_error: 'malformed_tid -123456789abcdef'] ", + "ts valid 02 | '_dd.p.ts=02' | '_dd.p.ts=02' | [_dd.p.ts: '02'] ", + "ts zero dropped | '_dd.p.ts=00' | | [:] ", + "ts invalid foo | '_dd.p.ts=foo' | | [_dd.propagation_error: 'decoding_error'] " + }) + void createPropagationTagsFromHeaderValue( + String headerValue, String expectedHeaderValue, Map tags) { + PropagationTags propagationTags = factory().fromHeaderValue(DATADOG, headerValue); + + assertEquals(expectedHeaderValue, propagationTags.headerValue(DATADOG)); + assertEquals(tags, propagationTags.createTagMap()); + } + + @TableTest({ + "scenario | headerValue | expectedHeaderValue | tags ", + "single dm tag | '_dd.p.dm=934086a686-4' | 'dd=t.dm:934086a686-4' | [_dd.p.dm: '934086a686-4'] ", + "dm and f tag | '_dd.p.dm=934086a686-4,_dd.p.f=w00t==' | 'dd=t.dm:934086a686-4;t.f:w00t~~' | [_dd.p.dm: '934086a686-4', _dd.p.f: 'w00t==']", + "dm and appsec tag | '_dd.p.dm=934086a686-4,_dd.p.appsec=1' | 'dd=t.dm:934086a686-4;t.appsec:1' | [_dd.p.dm: '934086a686-4', _dd.p.appsec: '1']" + }) + void datadogPropagationTagsShouldTranslateToW3cTags( + String headerValue, String expectedHeaderValue, Map tags) { + PropagationTags propagationTags = factory().fromHeaderValue(DATADOG, headerValue); + + assertEquals(expectedHeaderValue, propagationTags.headerValue(W3C)); + assertEquals(tags, propagationTags.createTagMap()); + } + + @TableTest({ + "scenario | originalTagSet | priority | mechanism | expectedHeaderValue | tags ", + "keep dm unchanged unset | '_dd.p.dm=934086a686-4' | UNSET | SamplingMechanism.UNKNOWN | '_dd.p.dm=934086a686-4' | [_dd.p.dm: '934086a686-4'] ", + "keep dm unchanged sampler keep | '_dd.p.dm=934086a686-3' | SAMPLER_KEEP | SamplingMechanism.AGENT_RATE | '_dd.p.dm=934086a686-3' | [_dd.p.dm: '934086a686-3'] ", + "keep dm unchanged appsec | '_dd.p.dm=93485302ab-1' | SAMPLER_KEEP | SamplingMechanism.APPSEC | '_dd.p.dm=93485302ab-1' | [_dd.p.dm: '93485302ab-1'] ", + "keep dm with anytag | '_dd.p.dm=934086a686-4,_dd.p.anytag=value' | SAMPLER_KEEP | SamplingMechanism.AGENT_RATE | '_dd.p.dm=934086a686-4,_dd.p.anytag=value' | [_dd.p.dm: '934086a686-4', _dd.p.anytag: 'value'] ", + "keep dm with anytag appsec | '_dd.p.dm=93485302ab-2,_dd.p.anytag=value' | SAMPLER_KEEP | SamplingMechanism.APPSEC | '_dd.p.dm=93485302ab-2,_dd.p.anytag=value' | [_dd.p.dm: '93485302ab-2', _dd.p.anytag: 'value'] ", + "dm moves to front | '_dd.p.anytag=value,_dd.p.dm=934086a686-4' | SAMPLER_KEEP | SamplingMechanism.AGENT_RATE | '_dd.p.dm=934086a686-4,_dd.p.anytag=value' | [_dd.p.anytag: 'value', _dd.p.dm: '934086a686-4'] ", + "dm moves to front appsec | '_dd.p.anytag=value,_dd.p.dm=93485302ab-2' | SAMPLER_KEEP | SamplingMechanism.APPSEC | '_dd.p.dm=93485302ab-2,_dd.p.anytag=value' | [_dd.p.anytag: 'value', _dd.p.dm: '93485302ab-2'] ", + "dm reordered with multiple tags | '_dd.p.anytag=value,_dd.p.dm=934086a686-4,_dd.p.atag=value' | SAMPLER_KEEP | SamplingMechanism.AGENT_RATE | '_dd.p.dm=934086a686-4,_dd.p.anytag=value,_dd.p.atag=value' | [_dd.p.anytag: 'value', _dd.p.dm: '934086a686-4', _dd.p.atag: 'value']", + "dm reordered multiple tags appsec | '_dd.p.anytag=value,_dd.p.dm=93485302ab-2,_dd.p.atag=value' | SAMPLER_KEEP | SamplingMechanism.APPSEC | '_dd.p.dm=93485302ab-2,_dd.p.anytag=value,_dd.p.atag=value' | [_dd.p.anytag: 'value', _dd.p.dm: '93485302ab-2', _dd.p.atag: 'value']", + "user drop manual single dm | '_dd.p.dm=93485302ab-2' | USER_DROP | SamplingMechanism.MANUAL | '_dd.p.dm=93485302ab-2' | [_dd.p.dm: '93485302ab-2'] ", + "sampler drop manual reorder | '_dd.p.anytag=value,_dd.p.dm=93485302ab-2' | SAMPLER_DROP | SamplingMechanism.MANUAL | '_dd.p.dm=93485302ab-2,_dd.p.anytag=value' | [_dd.p.anytag: 'value', _dd.p.dm: '93485302ab-2'] ", + "user drop manual | '_dd.p.dm=93485302ab-2,_dd.p.anytag=value' | USER_DROP | SamplingMechanism.MANUAL | '_dd.p.dm=93485302ab-2,_dd.p.anytag=value' | [_dd.p.dm: '93485302ab-2', _dd.p.anytag: 'value'] ", + "user drop manual triple | '_dd.p.atag=value,_dd.p.dm=93485302ab-2,_dd.p.anytag=value' | USER_DROP | SamplingMechanism.MANUAL | '_dd.p.dm=93485302ab-2,_dd.p.atag=value,_dd.p.anytag=value' | [_dd.p.atag: 'value', _dd.p.dm: '93485302ab-2', _dd.p.anytag: 'value']", + "empty sampler keep default | '' | SAMPLER_KEEP | SamplingMechanism.DEFAULT | '_dd.p.dm=-0' | [_dd.p.dm: '-0'] ", + "empty sampler keep agent rate | '' | SAMPLER_KEEP | SamplingMechanism.AGENT_RATE | '_dd.p.dm=-1' | [_dd.p.dm: '-1'] ", + "anytag user keep manual | '_dd.p.anytag=value' | USER_KEEP | SamplingMechanism.MANUAL | '_dd.p.dm=-4,_dd.p.anytag=value' | [_dd.p.anytag: 'value', _dd.p.dm: '-4'] ", + "no dm change sampler drop manual | '_dd.p.anytag=value,_dd.p.atag=value' | SAMPLER_DROP | SamplingMechanism.MANUAL | '_dd.p.anytag=value,_dd.p.atag=value' | [_dd.p.anytag: 'value', _dd.p.atag: 'value'] ", + "no dm when mechanism unknown | '_dd.p.anytag=123' | SAMPLER_KEEP | SamplingMechanism.UNKNOWN | '_dd.p.anytag=123' | [_dd.p.anytag: '123'] ", + "invalid input still updates dm | ',_dd.p.dm=Value' | SAMPLER_KEEP | SamplingMechanism.AGENT_RATE | '_dd.p.dm=-1' | [_dd.propagation_error: 'decoding_error', _dd.p.dm: '-1'] " + }) + void updatePropagationTagsSamplingMechanism( + String originalTagSet, + @ConvertWith(PrioritySamplingConverter.class) byte priority, + @ConvertWith(SamplingMechanismConverter.class) byte mechanism, + String expectedHeaderValue, + Map tags) { + PropagationTags propagationTags = factory().fromHeaderValue(DATADOG, originalTagSet); + + propagationTags.updateTraceSamplingPriority(priority, mechanism); + + assertEquals(expectedHeaderValue, propagationTags.headerValue(DATADOG)); + assertEquals(tags, propagationTags.createTagMap()); + } + + @TableTest({ + "scenario | originalTagSet | product | expectedHeaderValue | tags ", + "set ts on empty | '' | ProductTraceSource.ASM | '_dd.p.ts=02' | [_dd.p.ts: '02'] ", + "promote from 00 | '_dd.p.ts=00' | ProductTraceSource.ASM | '_dd.p.ts=02' | [_dd.p.ts: '02'] ", + "demote from FFC00000 | '_dd.p.ts=FFC00000' | ProductTraceSource.ASM | '_dd.p.ts=02' | [_dd.p.ts: '02'] ", + "add dbm on 02 | '_dd.p.ts=02' | ProductTraceSource.DBM | '_dd.p.ts=12' | [_dd.p.ts: '12'] ", + "invalid empty | '_dd.p.ts=' | ProductTraceSource.UNSET | | [_dd.propagation_error: 'decoding_error']", + "invalid single 0 | '_dd.p.ts=0' | ProductTraceSource.UNSET | | [_dd.propagation_error: 'decoding_error']", + "invalid char in pair | '_dd.p.ts=0G' | ProductTraceSource.UNSET | | [_dd.propagation_error: 'decoding_error']", + "invalid chars only | '_dd.p.ts=GG' | ProductTraceSource.UNSET | | [_dd.propagation_error: 'decoding_error']", + "invalid foo | '_dd.p.ts=foo' | ProductTraceSource.UNSET | | [_dd.propagation_error: 'decoding_error']", + "invalid too long | '_dd.p.ts=000000002' | ProductTraceSource.UNSET | | [_dd.propagation_error: 'decoding_error']" + }) + void updatePropagationTagsTraceSourcePropagation( + String originalTagSet, + @ConvertWith(ProductTraceSourceConverter.class) int product, + String expectedHeaderValue, + Map tags) { + PropagationTags propagationTags = factory().fromHeaderValue(DATADOG, originalTagSet); + + propagationTags.addTraceSource(product); + + assertEquals(expectedHeaderValue, propagationTags.headerValue(DATADOG)); + assertEquals(tags, propagationTags.createTagMap()); + } + + @Test + void extractionLimitExceeded() { + String tags = "_dd.p.anytag=value"; + int limit = tags.length() - 1; + PropagationTags propagationTags = factory(limit).fromHeaderValue(DATADOG, tags); + + propagationTags.updateTraceSamplingPriority(USER_KEEP, MANUAL); + + assertEquals("_dd.p.dm=-4", propagationTags.headerValue(DATADOG)); + Map expected = new HashMap<>(); + expected.put("_dd.propagation_error", "extract_max_size"); + expected.put("_dd.p.dm", "-4"); + assertEquals(expected, propagationTags.createTagMap()); + } + + @Test + void injectionLimitExceeded() { + String tags = "_dd.p.anytag=value"; + int limit = tags.length(); + PropagationTags propagationTags = factory(limit).fromHeaderValue(DATADOG, tags); + + propagationTags.updateTraceSamplingPriority(USER_KEEP, MANUAL); + + assertNull(propagationTags.headerValue(DATADOG)); + Map expected = new HashMap<>(); + expected.put("_dd.propagation_error", "inject_max_size"); + assertEquals(expected, propagationTags.createTagMap()); + } + + @Test + void injectionLimitExceededLimit0() { + PropagationTags propagationTags = factory(0).fromHeaderValue(DATADOG, ""); + + propagationTags.updateTraceSamplingPriority(USER_KEEP, MANUAL); + + assertNull(propagationTags.headerValue(DATADOG)); + Map expected = new HashMap<>(); + expected.put("_dd.propagation_error", "disabled"); + assertEquals(expected, propagationTags.createTagMap()); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/HaystackHttpExtractorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/HaystackHttpExtractorTest.java new file mode 100644 index 00000000000..e416ccf1f69 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/HaystackHttpExtractorTest.java @@ -0,0 +1,220 @@ +package datadog.trace.core.propagation; + +import static datadog.trace.api.sampling.PrioritySampling.SAMPLER_KEEP; +import static datadog.trace.bootstrap.instrumentation.api.ContextVisitors.stringValuesMap; +import static datadog.trace.core.propagation.HaystackHttpCodec.HAYSTACK_SPAN_ID_BAGGAGE_KEY; +import static datadog.trace.core.propagation.HaystackHttpCodec.HAYSTACK_TRACE_ID_BAGGAGE_KEY; +import static datadog.trace.core.propagation.HaystackHttpCodec.OT_BAGGAGE_PREFIX; +import static datadog.trace.core.propagation.HaystackHttpCodec.SPAN_ID_KEY; +import static datadog.trace.core.propagation.HaystackHttpCodec.TRACE_ID_KEY; +import static datadog.trace.core.propagation.HttpCodecTestHelper.headers; +import static datadog.trace.test.junit.utils.converter.TraceIdConverter.TRACE_ID_MAX_PLUS_1; +import static java.util.Collections.singletonMap; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; + +import datadog.trace.api.Config; +import datadog.trace.api.DDSpanId; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.TraceConfig; +import datadog.trace.bootstrap.instrumentation.api.TagContext; +import datadog.trace.test.junit.utils.converter.TraceIdConverter; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Supplier; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.converter.ConvertWith; +import org.tabletest.junit.TableTest; + +class HaystackHttpExtractorTest extends AbstractHttpExtractorTest { + @Override + protected HttpCodec.Extractor newExtractor( + Config config, Supplier traceConfigSupplier) { + return HaystackHttpCodec.newExtractor(config, traceConfigSupplier); + } + + @TableTest({ + "scenario | traceId | spanId | traceUuid | spanUuid ", + "small ids | '1' | '2' | '44617461-646f-6721-0000-000000000001' | '44617461-646f-6721-0000-000000000002'", + "incrementing ids | '2' | '3' | '44617461-646f-6721-0000-000000000002' | '44617461-646f-6721-0000-000000000003'", + "uint64 max | 'MAX' | '18446744073709551609' | '44617461-646f-6721-ffff-ffffffffffff' | '44617461-646f-6721-ffff-fffffffffff9'", + "uint64 max-1 | 'MAX-1' | '18446744073709551608' | '44617461-646f-6721-ffff-fffffffffffe' | '44617461-646f-6721-ffff-fffffffffff8'" + }) + void extractHttpHeaders( + @ConvertWith(TraceIdConverter.class) String traceId, + String spanId, + String traceUuid, + String spanUuid) { + // spotless:off + Map headers = headers( + "", "empty key", + TRACE_ID_KEY, traceUuid, + SPAN_ID_KEY, spanUuid, + OT_BAGGAGE_PREFIX + "k1", "v1", + OT_BAGGAGE_PREFIX + "k2", "%76%32", // v2 encoded once + OT_BAGGAGE_PREFIX + "k3", "%25%37%36%25%33%33", // v3 encoded twice + SOME_HEADER, "my-interesting-info", + SOME_CUSTOM_BAGGAGE_HEADER, "my-interesting-baggage-info", + SOME_CUSTOM_BAGGAGE_HEADER_2, "my-interesting-baggage-info-2" + ); + // spotless:on + + ExtractedContext context = + (ExtractedContext) this.extractor.extract(headers, stringValuesMap()); + + assertEquals(DDTraceId.from(traceId), context.getTraceId()); + assertEquals(DDSpanId.from(spanId), context.getSpanId()); + Map expectedBaggage = new HashMap<>(); + expectedBaggage.put("k1", "v1"); + expectedBaggage.put("k2", "v2"); + expectedBaggage.put("k3", "%76%33"); // expect value decoded only once + expectedBaggage.put(HAYSTACK_TRACE_ID_BAGGAGE_KEY, traceUuid); + expectedBaggage.put(HAYSTACK_SPAN_ID_BAGGAGE_KEY, spanUuid); + expectedBaggage.put(SOME_BAGGAGE, "my-interesting-baggage-info"); + expectedBaggage.put(SOME_CASE_SENSITIVE_BAGGAGE, "my-interesting-baggage-info-2"); + assertEquals(expectedBaggage, context.getBaggage()); + assertEquals(singletonMap(SOME_TAG, "my-interesting-info"), context.getTags()); + assertEquals(SAMPLER_KEEP, context.getSamplingPriority()); + assertNull(context.getOrigin()); + } + + @Test + void extractHeaderTagsWithNoPropagation() { + Map headers = headers(SOME_HEADER, "my-interesting-info"); + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + assertFalse(context instanceof ExtractedContext); + assertEquals(singletonMap(SOME_TAG, "my-interesting-info"), context.getTags()); + } + + @Test + void extractHttpHeadersWithInvalidNonNumericId() { + // spotless:off + Map headers = headers( + TRACE_ID_KEY, "traceId", + SPAN_ID_KEY, "spanId", + OT_BAGGAGE_PREFIX + "k1", "v1", + OT_BAGGAGE_PREFIX + "k2", "v2", + SOME_HEADER, "my-interesting-info" + ); + // spotless:on + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + assertNull(context); + } + + @Test + void extractHttpHeadersWithOutOfRangeTraceId() { + // spotless:off + Map headers = headers( + TRACE_ID_KEY, TRACE_ID_MAX_PLUS_1, + SPAN_ID_KEY, "0", + OT_BAGGAGE_PREFIX + "k1", "v1", + OT_BAGGAGE_PREFIX + "k2", "v2", + SOME_HEADER, "my-interesting-info" + ); + // spotless:on + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + assertNull(context); + } + + @Test + void extractHttpHeadersWithOutOfRangeSpanId() { + // spotless:off + Map headers = headers( + TRACE_ID_KEY, "0", + SPAN_ID_KEY, "-1", + OT_BAGGAGE_PREFIX + "k1", "v1", + OT_BAGGAGE_PREFIX + "k2", "v2", + SOME_HEADER, "my-interesting-info" + ); + // spotless:on + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + assertNull(context); + } + + @TableTest({ + "scenario | traceId | spanId | ctxCreated", + "negative trace | '-1' | '1' | false ", + "negative span | '1' | '-1' | false ", + "zero traceId | '0' | '1' | true ", + "uuid format | '44617461-646f-6721-463a-c35c9f6413ad' | '44617461-646f-6721-463a-c35c9f6413ad' | true " + }) + void baggageIsMappedOnContextCreation(String traceId, String spanId, boolean ctxCreated) { + // spotless:off + Map headers = headers( + TRACE_ID_KEY, traceId, + SPAN_ID_KEY, spanId, + SOME_CUSTOM_BAGGAGE_HEADER, "mappedBaggageValue", + OT_BAGGAGE_PREFIX + "k1", "v1", + OT_BAGGAGE_PREFIX + "k2", "v2", + SOME_ARBITRARY_HEADER, "my-interesting-info" + ); + // spotless:on + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + if (ctxCreated) { + assertNotNull(context); + Map expectedBaggage = new HashMap<>(); + expectedBaggage.put(HAYSTACK_TRACE_ID_BAGGAGE_KEY, traceId); + expectedBaggage.put(HAYSTACK_SPAN_ID_BAGGAGE_KEY, spanId); + expectedBaggage.put(SOME_BAGGAGE, "mappedBaggageValue"); + expectedBaggage.put("k1", "v1"); + expectedBaggage.put("k2", "v2"); + assertEquals(expectedBaggage, context.getBaggage()); + } else { + assertNull(context); + } + } + + @TableTest({ + "scenario | traceId | spanId | expectedTraceIdLong | expectedSpanId | ctxCreated", + "negative traceId | '-1' | '1' | | 0 | false ", + "negative spanId | '1' | '-1' | | 0 | false ", + "zero traceId | '0' | '1' | | 0 | true ", + "padded ones | '00001' | '00001' | 1 | 1 | true ", + "64-bit hex | '463ac35c9f6413ad' | '463ac35c9f6413ad' | 5060571933882717101 | 5060571933882717101 | true ", + "128-bit hex truncated | '463ac35c9f6413ad48485a3953bb6124' | '1' | 5208512171318403364 | 1 | true ", + "uuid format same | '44617461-646f-6721-463a-c35c9f6413ad' | '44617461-646f-6721-463a-c35c9f6413ad' | 5060571933882717101 | 5060571933882717101 | true ", + "uint64 max 64-bit | 'ffffffffffffffff' | '1' | -1 | 1 | true ", + "128-bit high+low max | 'aaaaaaaaaaaaaaaaffffffffffffffff' | '1' | -1 | 1 | true ", + "traceId too long high1 | '1ffffffffffffffffffffffffffffffff' | '1' | | 1 | false ", + "traceId too long high0 | '0ffffffffffffffffffffffffffffffff' | '1' | | 1 | false ", + "uint64 max spanId | '1' | 'ffffffffffffffff' | 1 | -1 | true ", + "spanId too long | '1' | '1ffffffffffffffff' | | 0 | false ", + "padded uint64 max span | '1' | '000ffffffffffffffff' | 1 | -1 | true " + }) + void extract128BitIdTruncatesIdTo64Bit( + String traceId, + String spanId, + Long expectedTraceIdLong, + long expectedSpanId, + boolean ctxCreated) { + // spotless:off + Map headers = headers( + TRACE_ID_KEY, traceId, + SPAN_ID_KEY, spanId); + // spotless:on + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + if (expectedTraceIdLong != null) { + assertEquals(DDTraceId.from(expectedTraceIdLong), context.getTraceId()); + assertEquals(expectedSpanId, context.getSpanId()); + } + if (ctxCreated) { + assertNotNull(context); + } else { + assertNull(context); + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/HaystackHttpInjectorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/HaystackHttpInjectorTest.java new file mode 100644 index 00000000000..211663c4381 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/HaystackHttpInjectorTest.java @@ -0,0 +1,106 @@ +package datadog.trace.core.propagation; + +import static datadog.trace.api.sampling.PrioritySampling.SAMPLER_KEEP; +import static datadog.trace.core.propagation.HaystackHttpCodec.DD_PARENT_ID_BAGGAGE_KEY; +import static datadog.trace.core.propagation.HaystackHttpCodec.DD_SPAN_ID_BAGGAGE_KEY; +import static datadog.trace.core.propagation.HaystackHttpCodec.DD_TRACE_ID_BAGGAGE_KEY; +import static datadog.trace.core.propagation.HaystackHttpCodec.HAYSTACK_TRACE_ID_BAGGAGE_KEY; +import static datadog.trace.core.propagation.HaystackHttpCodec.OT_BAGGAGE_PREFIX; +import static datadog.trace.core.propagation.HaystackHttpCodec.PARENT_ID_KEY; +import static datadog.trace.core.propagation.HaystackHttpCodec.SPAN_ID_KEY; +import static datadog.trace.core.propagation.HaystackHttpCodec.TRACE_ID_KEY; +import static java.util.Collections.singletonMap; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import datadog.trace.api.DDSpanId; +import datadog.trace.api.DDTraceId; +import datadog.trace.core.DDSpanContext; +import datadog.trace.test.junit.utils.converter.TraceIdConverter; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.params.converter.ConvertWith; +import org.tabletest.junit.TableTest; + +class HaystackHttpInjectorTest extends AbstractHttpInjectorTest { + // UUID representation of DDSpanId.ZERO + private static final String ZERO_UUID = "44617461-646f-6721-0000-000000000000"; + + @Override + protected HttpCodec.Injector newInjector() { + return HaystackHttpCodec.newInjector(singletonMap("some-baggage-key", "SOME_CUSTOM_HEADER")); + } + + @TableTest({ + "scenario | traceId | spanId | traceUuid | spanUuid ", + "small ids | '1' | '2' | '44617461-646f-6721-0000-000000000001' | '44617461-646f-6721-0000-000000000002'", + "small ids duplicate | '1' | '2' | '44617461-646f-6721-0000-000000000001' | '44617461-646f-6721-0000-000000000002'", + "uint64 max trace | 'MAX' | 'MAX-1' | '44617461-646f-6721-ffff-ffffffffffff' | '44617461-646f-6721-ffff-fffffffffffe'", + "uint64 max-1 trace | 'MAX-1' | 'MAX' | '44617461-646f-6721-ffff-fffffffffffe' | '44617461-646f-6721-ffff-ffffffffffff'" + }) + void injectHttpHeaders( + @ConvertWith(TraceIdConverter.class) String traceId, + @ConvertWith(TraceIdConverter.class) String spanId, + String traceUuid, + String spanUuid) { + Map baggage = new HashMap<>(); + baggage.put("k1", "v1"); + baggage.put("k2", "v2"); + baggage.put("some-baggage-key", "some-value"); + DDSpanContext spanContext = mockSpanContext(traceId, spanId, baggage); + Map carrier = new HashMap<>(); + + this.injector.inject(spanContext, carrier, Map::put); + + assertEquals(traceUuid, carrier.get(TRACE_ID_KEY)); + assertEquals(traceUuid, spanContext.unsafeGetTag(HAYSTACK_TRACE_ID_BAGGAGE_KEY)); + assertEquals(traceId, carrier.get(DD_TRACE_ID_BAGGAGE_KEY)); + assertEquals(spanUuid, carrier.get(SPAN_ID_KEY)); + assertEquals(spanId, carrier.get(DD_SPAN_ID_BAGGAGE_KEY)); + assertEquals(ZERO_UUID, carrier.get(PARENT_ID_KEY)); + assertEquals("0", carrier.get(DD_PARENT_ID_BAGGAGE_KEY)); + assertEquals("v1", carrier.get(OT_BAGGAGE_PREFIX + "k1")); + assertEquals("v2", carrier.get(OT_BAGGAGE_PREFIX + "k2")); + assertEquals("some-value", carrier.get("SOME_CUSTOM_HEADER")); + assertEquals(9, carrier.size()); + } + + @TableTest({ + "scenario | traceId | spanId | traceUuid | spanUuid ", + "small ids | '1' | '2' | '54617461-646f-6721-0000-000000000001' | '44617461-646f-6721-0000-000000000002'", + "small ids duplicate | '1' | '2' | '54617461-646f-6721-0000-000000000001' | '44617461-646f-6721-0000-000000000002'", + "uint64 max trace | 'MAX' | 'MAX-1' | '54617461-646f-6721-ffff-ffffffffffff' | '44617461-646f-6721-ffff-fffffffffffe'", + "uint64 max-1 trace | 'MAX-1' | 'MAX' | '54617461-646f-6721-ffff-fffffffffffe' | '44617461-646f-6721-ffff-ffffffffffff'" + }) + void injectHttpHeadersWithHaystackTraceIdInBaggage( + @ConvertWith(TraceIdConverter.class) String traceId, + @ConvertWith(TraceIdConverter.class) String spanId, + String traceUuid, + String spanUuid) { + Map baggage = new HashMap<>(); + baggage.put("k1", "v1"); + baggage.put("k2", "v2"); + baggage.put(HAYSTACK_TRACE_ID_BAGGAGE_KEY, traceUuid); + DDSpanContext spanContext = mockSpanContext(traceId, spanId, baggage); + Map carrier = new HashMap<>(); + + this.injector.inject(spanContext, carrier, Map::put); + + assertEquals(traceUuid, carrier.get(TRACE_ID_KEY)); + assertEquals(traceUuid, spanContext.unsafeGetTag(HAYSTACK_TRACE_ID_BAGGAGE_KEY)); + assertEquals(traceId, carrier.get(DD_TRACE_ID_BAGGAGE_KEY)); + assertEquals(spanUuid, carrier.get(SPAN_ID_KEY)); + assertEquals(spanId, carrier.get(DD_SPAN_ID_BAGGAGE_KEY)); + assertEquals(ZERO_UUID, carrier.get(PARENT_ID_KEY)); + assertEquals("0", carrier.get(DD_PARENT_ID_BAGGAGE_KEY)); + assertEquals("v1", carrier.get(OT_BAGGAGE_PREFIX + "k1")); + assertEquals("v2", carrier.get(OT_BAGGAGE_PREFIX + "k2")); + assertEquals(traceUuid, carrier.get(OT_BAGGAGE_PREFIX + "Haystack-Trace-ID")); + assertEquals(9, carrier.size()); + } + + private DDSpanContext mockSpanContext( + String traceId, String spanId, Map baggage) { + return mockSpanContext( + DDTraceId.from(traceId), DDSpanId.from(spanId), SAMPLER_KEEP, null, baggage, null); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/HttpCodecTestHelper.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/HttpCodecTestHelper.java index 00e0d460572..a109c935cf7 100644 --- a/dd-trace-core/src/test/java/datadog/trace/core/propagation/HttpCodecTestHelper.java +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/HttpCodecTestHelper.java @@ -2,6 +2,8 @@ import datadog.trace.api.Config; import datadog.trace.api.TraceConfig; +import java.util.HashMap; +import java.util.Map; import java.util.function.Supplier; /** Helper class used only for tests to bridge package-private classes */ @@ -14,4 +16,17 @@ public static HttpCodec.Extractor newW3cHttpCodecExtractor( Config config, Supplier traceConfigSupplier) { return W3CHttpCodec.newExtractor(config, traceConfigSupplier); } + + static Map headers(String... headerKeysAndValues) { + HashMap headers = new HashMap<>(); + for (int i = 0; i < headerKeysAndValues.length / 2; i++) { + String headerValue = headerKeysAndValues[i * 2 + 1]; + if (headerValue == null) { + continue; + } + String headerName = headerKeysAndValues[i * 2].toUpperCase(); + headers.put(headerName, headerValue); + } + return headers; + } } diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/HttpExtractorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/HttpExtractorTest.java new file mode 100644 index 00000000000..a950013ab7a --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/HttpExtractorTest.java @@ -0,0 +1,264 @@ +package datadog.trace.core.propagation; + +import static datadog.trace.api.DDTags.PARENT_ID; +import static datadog.trace.api.TracePropagationStyle.TRACECONTEXT; +import static datadog.trace.bootstrap.instrumentation.api.ContextVisitors.stringValuesMap; +import static datadog.trace.core.propagation.B3HttpCodec.B3_SPAN_ID; +import static datadog.trace.core.propagation.B3HttpCodec.B3_TRACE_ID; +import static datadog.trace.core.propagation.HttpCodecTestHelper.headers; +import static java.util.Collections.emptyMap; +import static java.util.Collections.singletonMap; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import datadog.trace.api.Config; +import datadog.trace.api.DDSpanId; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.DynamicConfig; +import datadog.trace.api.TracePropagationStyle; +import datadog.trace.bootstrap.instrumentation.api.AgentSpanLink; +import datadog.trace.bootstrap.instrumentation.api.TagContext; +import datadog.trace.test.util.DDJavaSpecification; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import org.junit.jupiter.api.extension.ParameterContext; +import org.junit.jupiter.params.converter.ArgumentConversionException; +import org.junit.jupiter.params.converter.ArgumentConverter; +import org.junit.jupiter.params.converter.ConvertWith; +import org.tabletest.junit.TableTest; +import org.tabletest.junit.TypeConverter; + +class HttpExtractorTest extends DDJavaSpecification { + + private static final String W3C_TRACE_ID = "00000000000000000000000000000001"; + private static final String W3C_SPAN_ID = "123456789abcdef0"; + private static final String W3C_TRACE_PARENT = "00-" + W3C_TRACE_ID + "-" + W3C_SPAN_ID + "-01"; + private static final String W3C_PARENT_ID = "456789abcdef0123"; + private static final String W3C_TRACE_STATE_WITH_P = "dd=p:" + W3C_PARENT_ID; + private static final String W3C_TRACE_STATE_NO_P = "dd=s:2,foo=1"; + private static final String W3C_SPAN_ID_LSTR = Long.toString(DDSpanId.fromHex(W3C_SPAN_ID)); + + @TableTest({ + "scenario | styles | datadogTraceId | datadogSpanId | b3TraceId | b3SpanId | w3cTraceParent | expectedTraceId | expectedSpanId | putDatadogFields | expectDatadogFields | tagContext | extractFirst", + "DATADOG,B3MULTI ids | [DATADOG, B3MULTI] | '1' | '2' | 'a' | 'b' | | '1' | '2' | true | true | false | false ", + "DATADOG,B3MULTI b3 only | [DATADOG, B3MULTI] | | | 'a' | 'b' | | '10' | '11' | false | false | true | false ", + "DATADOG,B3MULTI b3 only with dd field | [DATADOG, B3MULTI] | | | 'a' | 'b' | | | | true | true | true | false ", + "DATADOG only | [DATADOG] | '1' | '2' | 'a' | 'b' | | '1' | '2' | true | true | false | false ", + "B3MULTI only | [B3MULTI] | '1' | '2' | 'a' | 'b' | | '10' | '11' | false | false | false | false ", + "B3MULTI,DATADOG | [B3MULTI, DATADOG] | '1' | '2' | 'a' | 'b' | | '10' | '11' | false | false | false | false ", + "no styles | [] | '1' | '2' | 'a' | 'b' | | | | false | false | false | false ", + "DATADOG,B3MULTI invalid datadog trace | [DATADOG, B3MULTI] | 'abc' | '2' | 'a' | 'b' | | '10' | '11' | false | false | false | false ", + "DATADOG only invalid trace | [DATADOG] | 'abc' | '2' | 'a' | 'b' | | | | false | false | false | false ", + "DATADOG,B3MULTI dd trace out of range | [DATADOG, B3MULTI] | '18446744073709551616' | '2' | 'a' | 'b' | | '10' | '11' | false | false | false | false ", + "DATADOG,B3MULTI dd span out of range | [DATADOG, B3MULTI] | '1' | '18446744073709551616' | 'a' | 'b' | | '10' | '11' | false | false | false | false ", + "DATADOG only dd trace out of range | [DATADOG] | '18446744073709551616' | '2' | 'a' | 'b' | | | | false | false | false | false ", + "DATADOG only dd span out of range | [DATADOG] | '1' | '18446744073709551616' | 'a' | 'b' | | | | false | false | false | false ", + "DATADOG,B3MULTI b3 trace out of range | [DATADOG, B3MULTI] | '1' | '2' | '18446744073709551616' | 'b' | | '1' | '2' | true | false | false | false ", + "DATADOG,B3MULTI b3 span out of range | [DATADOG, B3MULTI] | '1' | '2' | 'a' | '18446744073709551616' | | '1' | '2' | true | false | false | false ", + "NONE | [NONE] | '1' | '2' | | | | | | true | false | true | false ", + "DATADOG,TRACECONTEXT w3c override | [DATADOG, TRACECONTEXT] | '1' | '2' | | | 'W3C_TRACE_PARENT' | '1' | 'W3C_SPAN_ID_LSTR' | false | false | false | false ", + "DATADOG,TRACECONTEXT,B3MULTI w3c override | [DATADOG, TRACECONTEXT, B3MULTI] | '1' | '2' | '1' | '2' | 'W3C_TRACE_PARENT' | '1' | 'W3C_SPAN_ID_LSTR' | false | false | false | false ", + "TRACECONTEXT,DATADOG | [TRACECONTEXT, DATADOG] | '1' | '2' | | | 'W3C_TRACE_PARENT' | '1' | 'W3C_SPAN_ID_LSTR' | false | false | false | false ", + "TRACECONTEXT,B3MULTI | [TRACECONTEXT, B3MULTI] | | | '1' | '2' | 'W3C_TRACE_PARENT' | '1' | 'W3C_SPAN_ID_LSTR' | false | false | false | false ", + "TRACECONTEXT,B3MULTI,DATADOG | [TRACECONTEXT, B3MULTI, DATADOG] | '1' | '2' | '1' | '4' | 'W3C_TRACE_PARENT' | '1' | 'W3C_SPAN_ID_LSTR' | false | false | false | false ", + "B3MULTI,DATADOG,TRACECONTEXT | [B3MULTI, DATADOG, TRACECONTEXT] | '1' | '2' | '1' | '4' | 'W3C_TRACE_PARENT' | '1' | 'W3C_SPAN_ID_LSTR' | false | false | false | false ", + "TRACECONTEXT only | [TRACECONTEXT] | | | | | 'W3C_TRACE_PARENT' | '1' | 'W3C_SPAN_ID_LSTR' | false | false | false | false ", + "DATADOG,TRACECONTEXT no dd span | [DATADOG, TRACECONTEXT] | '1' | | | | 'W3C_TRACE_PARENT' | '1' | 'W3C_SPAN_ID_LSTR' | false | false | false | false ", + "DATADOG,TRACECONTEXT extract first | [DATADOG, TRACECONTEXT] | '1' | '2' | | | 'W3C_TRACE_PARENT' | '1' | '2' | false | false | false | true " + }) + void extractHttpHeadersUsingStyles( + List styles, + String datadogTraceId, + String datadogSpanId, + String b3TraceId, + String b3SpanId, + @ConvertWith(W3cConstantConverter.class) String w3cTraceParent, + String expectedTraceId, + @ConvertWith(W3cConstantConverter.class) String expectedSpanId, + boolean putDatadogFields, + boolean expectDatadogFields, + boolean tagContext, + boolean extractFirst) { + HttpCodec.Extractor extractor = + createExtractor(styles, extractFirst, singletonMap("SOME_HEADER", "some-tag")); + + // spotless:off + Map headers = headers( + DatadogHttpCodec.TRACE_ID_KEY, datadogTraceId, + DatadogHttpCodec.SPAN_ID_KEY, datadogSpanId, + B3HttpCodec.TRACE_ID_KEY, b3TraceId, + B3HttpCodec.SPAN_ID_KEY, b3SpanId, + W3CHttpCodec.TRACE_PARENT_KEY, w3cTraceParent, + "SOME_HEADER", putDatadogFields ? "my-interesting-info" : null + ); + // spotless:on + + TagContext context = extractor.extract(headers, stringValuesMap()); + + if (tagContext) { + assertInstanceOf(TagContext.class, context); + } else { + if (expectedTraceId == null) { + assertNull(context); + } else { + assertEquals(DDTraceId.from(expectedTraceId).toLong(), context.getTraceId().toLong()); + assertEquals(DDSpanId.from(expectedSpanId), context.getSpanId()); + } + } + if (expectDatadogFields) { + Map expectedTags = new LinkedHashMap<>(); + if (tagContext && b3TraceId != null) { + expectedTags.put(B3_TRACE_ID, b3TraceId); + expectedTags.put(B3_SPAN_ID, b3SpanId); + } + expectedTags.put("some-tag", "my-interesting-info"); + assertNotNull(context); + assertEquals(expectedTags, context.getTags()); + } + } + + @TableTest({ + "scenario | styles | datadogTraceId | datadogSpanId | b3TraceId | b3SpanId | traceState | expectedTraceId | expectedSpanId | expectedParentId ", + "DATADOG,TRACECONTEXT with traceState p | [DATADOG, TRACECONTEXT] | '1' | '2' | | | 'W3C_TRACE_STATE_WITH_P' | '1' | 'W3C_SPAN_ID_LSTR' | 'W3C_PARENT_ID' ", + "DATADOG,TRACECONTEXT no traceState | [DATADOG, TRACECONTEXT] | '1' | '2' | | | | '1' | 'W3C_SPAN_ID_LSTR' | '0000000000000002'", + "DATADOG,TRACECONTEXT,B3MULTI with traceState p | [DATADOG, TRACECONTEXT, B3MULTI] | '1' | '2' | '1' | '2' | 'W3C_TRACE_STATE_WITH_P' | '1' | 'W3C_SPAN_ID_LSTR' | 'W3C_PARENT_ID' ", + "TRACECONTEXT,DATADOG with traceState p | [TRACECONTEXT, DATADOG] | '1' | '2' | | | 'W3C_TRACE_STATE_WITH_P' | '1' | 'W3C_SPAN_ID_LSTR' | ", + "TRACECONTEXT,B3MULTI with traceState p | [TRACECONTEXT, B3MULTI] | | | '1' | '2' | 'W3C_TRACE_STATE_WITH_P' | '1' | 'W3C_SPAN_ID_LSTR' | ", + "TRACECONTEXT,B3MULTI,DATADOG with traceState p | [TRACECONTEXT, B3MULTI, DATADOG] | '1' | '2' | '1' | '4' | 'W3C_TRACE_STATE_WITH_P' | '1' | 'W3C_SPAN_ID_LSTR' | ", + "B3MULTI,DATADOG,TRACECONTEXT with traceState p | [B3MULTI, DATADOG, TRACECONTEXT] | '1' | '2' | '1' | '4' | 'W3C_TRACE_STATE_WITH_P' | '1' | 'W3C_SPAN_ID_LSTR' | 'W3C_PARENT_ID' ", + "TRACECONTEXT only with traceState p | [TRACECONTEXT] | | | | | 'W3C_TRACE_STATE_WITH_P' | '1' | 'W3C_SPAN_ID_LSTR' | ", + "B3MULTI,TRACECONTEXT with traceState p | [B3MULTI, TRACECONTEXT] | | | '1' | '2' | 'W3C_TRACE_STATE_WITH_P' | '1' | 'W3C_SPAN_ID_LSTR' | 'W3C_PARENT_ID' ", + "B3MULTI,DATADOG,TRACECONTEXT no traceState | [B3MULTI, DATADOG, TRACECONTEXT] | '1' | '2' | '1' | '4' | | '1' | 'W3C_SPAN_ID_LSTR' | '0000000000000002'", + "DATADOG,TRACECONTEXT no p traceState | [DATADOG, TRACECONTEXT] | '1' | '2' | | | 'W3C_TRACE_STATE_NO_P' | '1' | 'W3C_SPAN_ID_LSTR' | '0000000000000002'" + }) + void checkW3CTraceContextOverride( + List styles, + String datadogTraceId, + String datadogSpanId, + String b3TraceId, + String b3SpanId, + @ConvertWith(W3cConstantConverter.class) String traceState, + String expectedTraceId, + @ConvertWith(W3cConstantConverter.class) String expectedSpanId, + @ConvertWith(W3cConstantConverter.class) String expectedParentId) { + HttpCodec.Extractor extractor = createExtractor(styles); + + // spotless:off + Map headers = headers( + W3CHttpCodec.TRACE_PARENT_KEY, W3C_TRACE_PARENT, + DatadogHttpCodec.TRACE_ID_KEY, datadogTraceId, + DatadogHttpCodec.SPAN_ID_KEY, datadogSpanId, + B3HttpCodec.TRACE_ID_KEY, b3TraceId, + B3HttpCodec.SPAN_ID_KEY, b3SpanId, + W3CHttpCodec.TRACE_STATE_KEY, traceState + ); + // spotless:on + + TagContext context = extractor.extract(headers, stringValuesMap()); + + assertEquals(DDTraceId.from(expectedTraceId).toLong(), context.getTraceId().toLong()); + assertEquals(DDSpanId.from(expectedSpanId), context.getSpanId()); + assertEquals(expectedParentId, context.getTags().getString(PARENT_ID)); + // TODO Add some more W3C override checks + } + + @TableTest({ + "scenario | styles | datadogTraceId | datadogSpanId | b3TraceId | b3SpanId | w3cTraceParent | traceState | expectedSpanLinks ", + "matching trace IDs no links | [DATADOG, B3MULTI, TRACECONTEXT] | '1' | '2' | '1' | 'b' | 'W3C_TRACE_PARENT' | 'W3C_TRACE_STATE_NO_P' | [] ", + "only tracecontext mismatch | [DATADOG, B3MULTI, TRACECONTEXT] | '2' | '2' | '2' | 'b' | 'W3C_TRACE_PARENT' | 'W3C_TRACE_STATE_NO_P' | [TRACECONTEXT] ", + "b3 and tracecontext mismatch | [DATADOG, B3MULTI, TRACECONTEXT] | '2' | '2' | '1' | 'b' | 'W3C_TRACE_PARENT' | 'W3C_TRACE_STATE_NO_P' | [B3MULTI, TRACECONTEXT]", + "datadog mismatch from tracecontext | [TRACECONTEXT, B3MULTI, DATADOG] | '2' | '2' | '1' | 'b' | 'W3C_TRACE_PARENT' | 'W3C_TRACE_STATE_NO_P' | [DATADOG] " + }) + void verifyExistenceOfSpanLinks( + List styles, + String datadogTraceId, + String datadogSpanId, + String b3TraceId, + String b3SpanId, + @ConvertWith(W3cConstantConverter.class) String w3cTraceParent, + @ConvertWith(W3cConstantConverter.class) String traceState, + List expectedSpanLinks) { + HttpCodec.Extractor extractor = createExtractor(styles); + + // spotless:off + Map headers = headers( + DatadogHttpCodec.TRACE_ID_KEY, datadogTraceId, + DatadogHttpCodec.SPAN_ID_KEY, datadogSpanId, + B3HttpCodec.TRACE_ID_KEY, b3TraceId, + B3HttpCodec.SPAN_ID_KEY, b3SpanId, + W3CHttpCodec.TRACE_PARENT_KEY, w3cTraceParent, + W3CHttpCodec.TRACE_STATE_KEY, traceState + ); + // spotless:on + + TagContext context = extractor.extract(headers, stringValuesMap()); + + List links = context.getTerminatedSpanLinks(); + assertEquals(expectedSpanLinks.size(), links.size()); + for (int i = 0; i < links.size(); i++) { + TracePropagationStyle style = expectedSpanLinks.get(i); + if (style == TRACECONTEXT) { + assertEquals(W3C_TRACE_STATE_NO_P, links.get(i).traceState()); + } + assertEquals(style.toString(), links.get(i).attributes().asMap().get("context_headers")); + } + } + + private static Set orderedSetOf(List styles) { + return new LinkedHashSet<>(styles); + } + + private static HttpCodec.Extractor createExtractor(List styles) { + return createExtractor(styles, false, emptyMap()); + } + + private static HttpCodec.Extractor createExtractor( + List styles, boolean extractFirst, Map headerTags) { + Config config = mock(Config.class); + when(config.getTracePropagationStylesToExtract()).thenReturn(orderedSetOf(styles)); + when(config.isTracePropagationExtractFirst()).thenReturn(extractFirst); + DynamicConfig dynamicConfig = + DynamicConfig.create().setHeaderTags(headerTags).setBaggageMapping(emptyMap()).apply(); + return HttpCodec.createExtractor(config, dynamicConfig::captureTraceConfig); + } + + @TypeConverter + static TracePropagationStyle parseTracePropagationStyle(String value) { + String name = value.trim(); + if (name.startsWith("TracePropagationStyle.")) { + name = name.substring("TracePropagationStyle.".length()); + } + return TracePropagationStyle.valueOf(name); + } + + static class W3cConstantConverter implements ArgumentConverter { + @Override + public Object convert(Object source, ParameterContext context) + throws ArgumentConversionException { + if (source == null) { + return null; + } + switch (source.toString()) { + case "W3C_TRACE_PARENT": + return W3C_TRACE_PARENT; + case "W3C_TRACE_STATE_WITH_P": + return W3C_TRACE_STATE_WITH_P; + case "W3C_TRACE_STATE_NO_P": + return W3C_TRACE_STATE_NO_P; + case "W3C_SPAN_ID_LSTR": + return W3C_SPAN_ID_LSTR; + case "W3C_PARENT_ID": + return W3C_PARENT_ID; + default: + return source; + } + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/HttpInjectorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/HttpInjectorTest.java new file mode 100644 index 00000000000..2fc5e1628dd --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/HttpInjectorTest.java @@ -0,0 +1,245 @@ +package datadog.trace.core.propagation; + +import static datadog.trace.api.ConfigDefaults.DEFAULT_PROPAGATION_B3_PADDING_ENABLED; +import static datadog.trace.api.sampling.PrioritySampling.UNSET; +import static datadog.trace.core.propagation.B3HttpCodec.B3_KEY; +import static datadog.trace.core.propagation.B3HttpCodec.SAMPLING_PRIORITY_KEY; +import static datadog.trace.core.propagation.B3TestHelper.spanIdOrPadded; +import static datadog.trace.core.propagation.B3TestHelper.traceIdOrPadded; +import static datadog.trace.core.propagation.DatadogHttpCodec.DATADOG_TAGS_KEY; +import static datadog.trace.core.propagation.PropagationTags.HeaderType.DATADOG; +import static java.util.Collections.emptyMap; +import static java.util.Collections.singletonList; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import datadog.trace.api.Config; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.TracePropagationStyle; +import datadog.trace.core.DDSpanContext; +import datadog.trace.test.junit.utils.converter.PrioritySamplingConverter; +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import org.junit.jupiter.params.converter.ConvertWith; +import org.tabletest.junit.TableTest; + +class HttpInjectorTest extends AbstractHttpInjectorTest { + + protected boolean tracePropagationB3Padding() { + return DEFAULT_PROPAGATION_B3_PADDING_ENABLED; + } + + @TableTest({ + "scenario | styles | samplingPriority | origin ", + "DATADOG,B3SINGLE unset | [DATADOG, B3SINGLE] | UNSET | ", + "DATADOG,B3SINGLE keep saipan | [DATADOG, B3SINGLE] | SAMPLER_KEEP | 'saipan'", + "DATADOG only unset | [DATADOG] | UNSET | ", + "DATADOG only keep saipan | [DATADOG] | SAMPLER_KEEP | 'saipan'", + "B3SINGLE only unset | [B3SINGLE] | UNSET | ", + "B3SINGLE only keep saipan | [B3SINGLE] | SAMPLER_KEEP | 'saipan'", + "B3SINGLE,DATADOG keep saipan | [B3SINGLE, DATADOG] | SAMPLER_KEEP | 'saipan'", + "DATADOG,B3MULTI,B3SINGLE unset | [DATADOG, B3MULTI, B3SINGLE] | UNSET | ", + "DATADOG,B3MULTI,B3SINGLE keep | [DATADOG, B3MULTI, B3SINGLE] | SAMPLER_KEEP | 'saipan'", + "DATADOG,B3MULTI unset | [DATADOG, B3MULTI] | UNSET | ", + "DATADOG,B3MULTI keep saipan | [DATADOG, B3MULTI] | SAMPLER_KEEP | 'saipan'", + "B3MULTI only unset | [B3MULTI] | UNSET | ", + "B3MULTI only keep saipan | [B3MULTI] | SAMPLER_KEEP | 'saipan'", + "B3MULTI,DATADOG keep saipan | [B3MULTI, DATADOG] | SAMPLER_KEEP | 'saipan'" + }) + void injectHttpHeadersUsingStyles( + List styles, + @ConvertWith(PrioritySamplingConverter.class) byte samplingPriority, + String origin) { + HttpCodec.Injector injector = createInjector(styles, emptyMap()); + + DDTraceId traceId = DDTraceId.ONE; + long spanId = 2; + Map baggage = new HashMap<>(); + baggage.put("k1", "v1"); + baggage.put("k2", "v2"); + DDSpanContext mockedContext = mockedContext(traceId, spanId, samplingPriority, origin, baggage); + + Map carrier = new HashMap<>(); + injector.inject(mockedContext, carrier, Map::put); + + String b3TraceIdHex = traceIdOrPadded(traceId, tracePropagationB3Padding()); + String b3SpanIdHex = spanIdOrPadded(spanId, tracePropagationB3Padding()); + int expectedSize = 0; + if (styles.contains(TracePropagationStyle.DATADOG)) { + assertEquals(traceId.toString(), carrier.get(DatadogHttpCodec.TRACE_ID_KEY)); + assertEquals(Long.toString(spanId), carrier.get(DatadogHttpCodec.SPAN_ID_KEY)); + assertEquals("v1", carrier.get(DatadogHttpCodec.OT_BAGGAGE_PREFIX + "k1")); + assertEquals("v2", carrier.get(DatadogHttpCodec.OT_BAGGAGE_PREFIX + "k2")); + assertEquals("_dd.p.usr=123", carrier.get(DATADOG_TAGS_KEY)); + expectedSize += 5; + if (samplingPriority != UNSET) { + assertEquals( + Integer.toString(samplingPriority), + carrier.get(DatadogHttpCodec.SAMPLING_PRIORITY_KEY)); + expectedSize++; + } + if (origin != null) { + assertEquals(origin, carrier.get(DatadogHttpCodec.ORIGIN_KEY)); + expectedSize++; + } + } + if (styles.contains(TracePropagationStyle.B3MULTI)) { + assertEquals(b3TraceIdHex, carrier.get(B3HttpCodec.TRACE_ID_KEY)); + assertEquals(b3SpanIdHex, carrier.get(B3HttpCodec.SPAN_ID_KEY)); + expectedSize += 2; + if (samplingPriority != UNSET) { + assertEquals("1", carrier.get(SAMPLING_PRIORITY_KEY)); + expectedSize++; + } + } + if (styles.contains(TracePropagationStyle.B3SINGLE)) { + String expectedB3Value = + samplingPriority != UNSET + ? b3TraceIdHex + "-" + b3SpanIdHex + "-1" + : b3TraceIdHex + "-" + b3SpanIdHex; + assertEquals(expectedB3Value, carrier.get(B3_KEY)); + expectedSize++; + } + assertEquals(expectedSize, carrier.size()); + } + + @TableTest({ + "scenario | style | samplingPriority | origin ", + "DATADOG unset | DATADOG | UNSET | ", + "DATADOG keep no origin | DATADOG | SAMPLER_KEEP | ", + "DATADOG keep saipan | DATADOG | SAMPLER_KEEP | 'saipan'", + "B3SINGLE unset | B3SINGLE | UNSET | ", + "B3SINGLE keep no orig | B3SINGLE | SAMPLER_KEEP | ", + "B3SINGLE keep saipan | B3SINGLE | SAMPLER_KEEP | 'saipan'", + "B3MULTI unset | B3MULTI | UNSET | ", + "B3MULTI keep no origin | B3MULTI | SAMPLER_KEEP | ", + "B3MULTI keep saipan | B3MULTI | SAMPLER_KEEP | 'saipan'" + }) + void injectHttpHeadersUsingStyle( + TracePropagationStyle style, + @ConvertWith(PrioritySamplingConverter.class) byte samplingPriority, + String origin) { + Map mapping = new HashMap<>(); + mapping.put("some-baggage-item", "SOME_HEADER"); + HttpCodec.Injector injector = createInjector(singletonList(style), mapping); + + DDTraceId traceId = DDTraceId.ONE; + long spanId = 2; + Map baggage = new HashMap<>(); + baggage.put("k1", "v1"); + baggage.put("k2", "v2"); + baggage.put("some-baggage-item", "some-baggage-value"); + DDSpanContext mockedContext = mockedContext(traceId, spanId, samplingPriority, origin, baggage); + + Map carrier = new HashMap<>(); + injector.inject(mockedContext, carrier, Map::put); + + String b3TraceIdHex = traceIdOrPadded(traceId, tracePropagationB3Padding()); + String b3SpanIdHex = spanIdOrPadded(spanId, tracePropagationB3Padding()); + int expectedSize = 0; + if (style == TracePropagationStyle.DATADOG) { + assertEquals(traceId.toString(), carrier.get(DatadogHttpCodec.TRACE_ID_KEY)); + assertEquals(Long.toString(spanId), carrier.get(DatadogHttpCodec.SPAN_ID_KEY)); + assertEquals("v1", carrier.get(DatadogHttpCodec.OT_BAGGAGE_PREFIX + "k1")); + assertEquals("v2", carrier.get(DatadogHttpCodec.OT_BAGGAGE_PREFIX + "k2")); + assertEquals("some-baggage-value", carrier.get("SOME_HEADER")); + assertEquals("_dd.p.usr=123", carrier.get(DATADOG_TAGS_KEY)); + expectedSize = 6; + if (samplingPriority != UNSET) { + assertEquals( + Integer.toString(samplingPriority), + carrier.get(DatadogHttpCodec.SAMPLING_PRIORITY_KEY)); + expectedSize++; + } + if (origin != null) { + assertEquals(origin, carrier.get(DatadogHttpCodec.ORIGIN_KEY)); + expectedSize++; + } + } else if (style == TracePropagationStyle.B3MULTI) { + assertEquals(b3TraceIdHex, carrier.get(B3HttpCodec.TRACE_ID_KEY)); + assertEquals(b3SpanIdHex, carrier.get(B3HttpCodec.SPAN_ID_KEY)); + expectedSize = 2; + if (samplingPriority != UNSET) { + assertEquals("1", carrier.get(SAMPLING_PRIORITY_KEY)); + expectedSize++; + } + } else if (style == TracePropagationStyle.B3SINGLE) { + String expectedB3Value = + samplingPriority != UNSET + ? b3TraceIdHex + "-" + b3SpanIdHex + "-1" + : b3TraceIdHex + "-" + b3SpanIdHex; + assertEquals(expectedB3Value, carrier.get(B3_KEY)); + expectedSize++; + } + assertEquals(expectedSize, carrier.size()); + } + + @TableTest({ + "scenario | style ", + "datadog encoding | DATADOG ", + "tracecontext encoding | TRACECONTEXT", + "haystack encoding | HAYSTACK " + }) + void encodeBaggageInHttpHeadersUsingStyle(TracePropagationStyle style) { + Map baggage = new HashMap<>(); + baggage.put("alpha", "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); + baggage.put("num", "01234567890"); + baggage.put("whitespace", "ab \tcd"); + baggage.put("specials", "ab.-*_cd"); + baggage.put("excluded", "ab',:\\cd"); + Map mapping = + baggage.keySet().stream().collect(Collectors.toMap(key -> key, key -> key)); + HttpCodec.Injector injector = createInjector(singletonList(style), mapping); + + DDTraceId traceId = DDTraceId.ONE; + long spanId = 2; + DDSpanContext mockedContext = mockedContext(traceId, spanId, UNSET, null, baggage); + + Map carrier = new HashMap<>(); + injector.inject(mockedContext, carrier, Map::put); + + assertEquals("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ", carrier.get("alpha")); + assertEquals("01234567890", carrier.get("num")); + assertEquals("ab%20%09cd", carrier.get("whitespace")); + assertEquals("ab.-*_cd", carrier.get("specials")); + assertEquals("ab%27%2C%3A%5Ccd", carrier.get("excluded")); + } + + HttpCodec.Injector createInjector( + List overriddenStyles, Map invertedBaggageMapping) { + Config config = mock(Config.class); + if (overriddenStyles != null) { + LinkedHashSet orderedSet = new LinkedHashSet<>(overriddenStyles); + when(config.getTracePropagationStylesToInject()).thenReturn(orderedSet); + } + when(config.isTracePropagationStyleB3PaddingEnabled()).thenReturn(tracePropagationB3Padding()); + return HttpCodec.createInjector( + config, config.getTracePropagationStylesToInject(), invertedBaggageMapping); + } + + DDSpanContext mockedContext( + DDTraceId traceId, + long spanId, + int samplingPriority, + String origin, + Map baggage) { + return mockSpanContext( + traceId, + spanId, + samplingPriority, + origin, + baggage, + PropagationTags.factory().fromHeaderValue(DATADOG, "_dd.p.usr=123")); + } + + static class HttpInjectorNonPaddedTest extends HttpInjectorTest { + @Override + protected boolean tracePropagationB3Padding() { + return false; + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/NoneHttpExtractorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/NoneHttpExtractorTest.java new file mode 100644 index 00000000000..217e6d17ffc --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/NoneHttpExtractorTest.java @@ -0,0 +1,185 @@ +package datadog.trace.core.propagation; + +import static datadog.trace.api.config.TracerConfig.REQUEST_HEADER_TAGS_COMMA_ALLOWED; +import static datadog.trace.api.sampling.PrioritySampling.UNSET; +import static datadog.trace.bootstrap.instrumentation.api.ContextVisitors.stringValuesMap; +import static datadog.trace.core.propagation.DatadogHttpCodec.DATADOG_TAGS_KEY; +import static datadog.trace.core.propagation.DatadogHttpCodec.ORIGIN_KEY; +import static datadog.trace.core.propagation.DatadogHttpCodec.OT_BAGGAGE_PREFIX; +import static datadog.trace.core.propagation.DatadogHttpCodec.SPAN_ID_KEY; +import static datadog.trace.core.propagation.DatadogHttpCodec.TRACE_ID_KEY; +import static datadog.trace.core.propagation.HttpCodecTestHelper.headers; +import static java.util.Collections.singletonMap; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.api.Config; +import datadog.trace.api.DD128bTraceId; +import datadog.trace.api.DDSpanId; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.DynamicConfig; +import datadog.trace.api.TraceConfig; +import datadog.trace.api.internal.util.LongStringUtils; +import datadog.trace.bootstrap.instrumentation.api.TagContext; +import datadog.trace.test.junit.utils.config.WithConfig; +import datadog.trace.test.junit.utils.converter.TraceIdConverter; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Supplier; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.converter.ConvertWith; +import org.junit.jupiter.params.provider.ValueSource; +import org.tabletest.junit.TableTest; + +class NoneHttpExtractorTest extends AbstractHttpExtractorTest { + @Override + protected HttpCodec.Extractor newExtractor( + Config config, Supplier traceConfigSupplier) { + return NoneCodec.newExtractor(config, traceConfigSupplier); + } + + @TableTest({ + "scenario | traceId | spanId ", + "no origin | '1' | '2' ", + "uint64 max | 'MAX' | 'MAX-1'", + "uint64 max-1 | 'MAX-1' | 'MAX' " + }) + void extractHttpHeaders( + @ConvertWith(TraceIdConverter.class) String traceId, + @ConvertWith(TraceIdConverter.class) String spanId) { + // spotless:off + Map headers = headers( + "", "empty key", + TRACE_ID_KEY, traceId, + SPAN_ID_KEY, spanId, + OT_BAGGAGE_PREFIX + "k1", "v1", + OT_BAGGAGE_PREFIX + "k2", "v2", + SOME_HEADER, "my-interesting-info,and-more", + SOME_CUSTOM_BAGGAGE_HEADER, "my-interesting-baggage-info", + SOME_CUSTOM_BAGGAGE_HEADER_2, "my-interesting-baggage-info-2" + ); + // spotless:on + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + assertEquals(DDTraceId.ZERO, context.getTraceId()); + assertEquals(DDSpanId.ZERO, context.getSpanId()); + Map expectedBaggage = new HashMap<>(); + expectedBaggage.put(SOME_BAGGAGE, "my-interesting-baggage-info"); + expectedBaggage.put(SOME_CASE_SENSITIVE_BAGGAGE, "my-interesting-baggage-info-2"); + assertEquals(expectedBaggage, context.getBaggage()); + assertEquals(singletonMap(SOME_TAG, "my-interesting-info,and-more"), context.getTags()); + assertEquals(UNSET, context.getSamplingPriority()); + assertNull(context.getOrigin()); + } + + @WithConfig(key = REQUEST_HEADER_TAGS_COMMA_ALLOWED, value = "false") + @Test + void extractHttpHeadersWithoutComma() { + // Recreate extractor with the comma-disallowed config + this.extractor.cleanup(); + Map baggageMap = new HashMap<>(); + baggageMap.put(SOME_CUSTOM_BAGGAGE_HEADER, SOME_BAGGAGE); + baggageMap.put(SOME_CUSTOM_BAGGAGE_HEADER_2, SOME_CASE_SENSITIVE_BAGGAGE); + DynamicConfig dynamicConfig = + DynamicConfig.create() + .setHeaderTags(singletonMap(SOME_HEADER, SOME_TAG)) + .setBaggageMapping(baggageMap) + .apply(); + this.extractor = NoneCodec.newExtractor(Config.get(), dynamicConfig::captureTraceConfig); + + // spotless:off + Map headers = headers( + "", "empty key", + TRACE_ID_KEY, "2", + SPAN_ID_KEY, "3", + OT_BAGGAGE_PREFIX + "k1", "v1", + OT_BAGGAGE_PREFIX + "k2", "v2", + SOME_HEADER, "my-interesting-info,and-more", + SOME_CUSTOM_BAGGAGE_HEADER, "my-interesting-baggage-info", + SOME_CUSTOM_BAGGAGE_HEADER_2, "my-interesting-baggage-info-2" + ); + // spotless:on + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + assertEquals(DDTraceId.ZERO, context.getTraceId()); + assertEquals(DDSpanId.ZERO, context.getSpanId()); + Map expectedBaggage = new HashMap<>(); + expectedBaggage.put(SOME_BAGGAGE, "my-interesting-baggage-info"); + expectedBaggage.put(SOME_CASE_SENSITIVE_BAGGAGE, "my-interesting-baggage-info-2"); + assertEquals(expectedBaggage, context.getBaggage()); + assertEquals(singletonMap(SOME_TAG, "my-interesting-info"), context.getTags()); + } + + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void extractHeaderTagsWithNoPropagation(boolean withOrigin) { + // spotless:off + Map headers = headers( + ORIGIN_KEY, withOrigin ? "my-origin" : null, + SOME_HEADER, "my-interesting-info" + ); + // spotless:on + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + assertFalse(context instanceof ExtractedContext); + assertEquals(singletonMap(SOME_TAG, "my-interesting-info"), context.getTags()); + assertNull(context.getOrigin()); + } + + @TableTest({ + "scenario | hexId ", + "64-bit short | '1' ", + "64-bit max chars | '123456789abcdef0' ", + "128-bit | '123456789abcdef0123456789abcdef0'", + "128-bit zero middle | '64184f2400000000123456789abcdef0'", + "128-bit all f | 'ffffffffffffffffffffffffffffffff'" + }) + void extractHttpHeadersWith128BitTraceId(String hexId) { + DD128bTraceId traceId = DD128bTraceId.fromHex(hexId); + boolean is128bTrace = traceId.toHighOrderLong() != 0; + // spotless:off + Map headers = headers( + TRACE_ID_KEY, traceId.toString(), + SPAN_ID_KEY, "2", + OT_BAGGAGE_PREFIX + "k1", "v1", + OT_BAGGAGE_PREFIX + "k2", "v2", + SOME_HEADER, "my-interesting-info", + DATADOG_TAGS_KEY, is128bTrace + ? "_dd.p.tid=" + LongStringUtils.toHexStringPadded(traceId.toHighOrderLong(), 16) + : null + ); + // spotless:on + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + assertEquals(DDTraceId.ZERO, context.getTraceId()); + assertEquals(DDSpanId.ZERO, context.getSpanId()); + assertTrue(context.getBaggage().isEmpty()); + assertEquals(singletonMap(SOME_TAG, "my-interesting-info"), context.getTags()); + } + + @Test + void extractHttpHeadersWithInvalidNonNumericId() { + // spotless:off + Map headers = headers( + TRACE_ID_KEY, "traceId", + SPAN_ID_KEY,"spanId", + OT_BAGGAGE_PREFIX + "k1", "v1", + OT_BAGGAGE_PREFIX + "k2", "v2", + SOME_HEADER, "my-interesting-info" + ); + // spotless:on + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + assertInstanceOf(TagContext.class, context); + assertEquals(singletonMap(SOME_TAG, "my-interesting-info"), context.getTags()); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/OrgGuardEndToEndTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/OrgGuardEndToEndTest.java new file mode 100644 index 00000000000..3557ad10e68 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/OrgGuardEndToEndTest.java @@ -0,0 +1,195 @@ +package datadog.trace.core.propagation; + +import static datadog.trace.api.sampling.PrioritySampling.UNSET; +import static datadog.trace.bootstrap.instrumentation.api.ContextVisitors.stringValuesMap; +import static datadog.trace.core.propagation.PropagationTags.HeaderType.W3C; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.RETURNS_DEFAULTS; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import datadog.context.Context; +import datadog.trace.api.Config; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.TraceConfig; +import datadog.trace.api.TracePropagationStyle; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.core.DDSpanContext; +import datadog.trace.core.TraceCollector; +import datadog.trace.core.monitor.HealthMetrics; +import datadog.trace.core.propagation.opg.OrgGuard; +import java.util.Collections; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import java.util.function.Supplier; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +@DisplayName("Org Propagation Guard end-to-end propagator wiring") +class OrgGuardEndToEndTest { + private PropagationTags.Factory factory; + private HealthMetrics healthMetrics; + private Supplier traceConfigSupplier; + + @BeforeEach + void setUp() { + factory = PropagationTags.factory(); + healthMetrics = mock(HealthMetrics.class); + TraceConfig tc = mock(TraceConfig.class); + traceConfigSupplier = () -> tc; + } + + @Test + @DisplayName("inject stamps the local OPM into x-datadog-tags and tracestate") + void injectStampsLocalOpm() { + TracingPropagator propagator = buildPropagator(true, false, Collections.emptySet(), () -> "L1"); + + Map carrier = new HashMap<>(); + Context ctx = Context.root().with(buildSpanForInjection(null)); + propagator.inject(ctx, carrier, Map::put); + + String datadogTags = carrier.get(DatadogHttpCodec.DATADOG_TAGS_KEY); + assertNotNull(datadogTags, "x-datadog-tags missing: " + carrier); + assertTrue(datadogTags.contains("_dd.p.opm=L1"), "datadog-tags = " + datadogTags); + + String tracestate = carrier.get("tracestate"); + assertNotNull(tracestate, "tracestate missing: " + carrier); + assertTrue(tracestate.contains("t.opm:L1"), "tracestate = " + tracestate); + } + + @Test + @DisplayName("inject overrides any inherited OPM with the local one") + void injectOverridesInheritedOpm() { + TracingPropagator propagator = buildPropagator(true, false, Collections.emptySet(), () -> "L1"); + + Map carrier = new HashMap<>(); + Context ctx = Context.root().with(buildSpanForInjection("upstream-X")); + propagator.inject(ctx, carrier, Map::put); + + String datadogTags = carrier.get(DatadogHttpCodec.DATADOG_TAGS_KEY); + assertNotNull(datadogTags); + assertTrue(datadogTags.contains("_dd.p.opm=L1"), "datadog-tags = " + datadogTags); + assertFalse(datadogTags.contains("_dd.p.opm=upstream-X"), "datadog-tags = " + datadogTags); + } + + @Test + @DisplayName("extract drops dd context when OPM mismatches and enforcement is on") + void extractStripsOnMismatch() { + TracingPropagator propagator = buildPropagator(true, false, Collections.emptySet(), () -> "L1"); + + Map headers = new HashMap<>(); + headers.put(DatadogHttpCodec.TRACE_ID_KEY, "123"); + headers.put(DatadogHttpCodec.SPAN_ID_KEY, "456"); + headers.put(DatadogHttpCodec.SAMPLING_PRIORITY_KEY, "2"); + headers.put(DatadogHttpCodec.DATADOG_TAGS_KEY, "_dd.p.opm=X1,_dd.p.dm=-4"); + + Context extracted = propagator.extract(Context.root(), headers, stringValuesMap()); + AgentSpan span = AgentSpan.fromContext(extracted); + assertNotNull(span, "extracted span missing"); + ExtractedContext ec = (ExtractedContext) span.spanContext(); + assertEquals(DDTraceId.from(123L), ec.getTraceId()); + assertEquals(456L, ec.getSpanId()); + assertEquals(UNSET, ec.getSamplingPriority()); + assertNull(ec.getOrigin()); + assertNull(ec.getPropagationTags().getOrgPropagationMarker()); + } + + @Test + @DisplayName("extract honors trusted OPMs even when they differ from the local one") + void extractTrustedOpm() { + Set trusted = new HashSet<>(); + trusted.add("TRUSTED1"); + TracingPropagator propagator = buildPropagator(true, false, trusted, () -> "L1"); + + Map headers = new HashMap<>(); + headers.put(DatadogHttpCodec.TRACE_ID_KEY, "123"); + headers.put(DatadogHttpCodec.SPAN_ID_KEY, "456"); + headers.put(DatadogHttpCodec.SAMPLING_PRIORITY_KEY, "2"); + headers.put(DatadogHttpCodec.DATADOG_TAGS_KEY, "_dd.p.opm=TRUSTED1,_dd.p.dm=-4"); + + Context extracted = propagator.extract(Context.root(), headers, stringValuesMap()); + ExtractedContext ec = (ExtractedContext) AgentSpan.fromContext(extracted).spanContext(); + assertEquals(2, ec.getSamplingPriority()); + assertEquals("TRUSTED1", ec.getPropagationTags().getOrgPropagationMarker().toString()); + } + + @Test + @DisplayName("extract+inject preserves non-dd tracestate vendors after stripping") + void roundTripPreservesForeignVendors() { + TracingPropagator propagator = buildPropagator(true, false, Collections.emptySet(), () -> "L1"); + + Map headers = new HashMap<>(); + headers.put( + "traceparent", + "00-0000000000000000000000000000007b-00000000000001c8-01"); // 0x7b=123, 0x1c8=456 + headers.put("tracestate", "dd=s:2;o:foo;t.opm:upstream-X;t.dm:-4,vendor1=abc,vendor2=def"); + + Context extracted = propagator.extract(Context.root(), headers, stringValuesMap()); + ExtractedContext ec = (ExtractedContext) AgentSpan.fromContext(extracted).spanContext(); + assertEquals(UNSET, ec.getSamplingPriority(), "should be stripped"); + + String reEncoded = ec.getPropagationTags().headerValue(W3C); + assertNotNull(reEncoded, "re-encoded tracestate is null"); + assertTrue(reEncoded.contains("vendor1=abc"), "vendor1 missing: " + reEncoded); + assertTrue(reEncoded.contains("vendor2=def"), "vendor2 missing: " + reEncoded); + } + + // ---- helpers ---- + + private TracingPropagator buildPropagator( + boolean enabled, boolean strict, Set trusted, Supplier localOpmSupplier) { + Config config = mock(Config.class, RETURNS_DEFAULTS); + when(config.getxDatadogTagsMaxLength()).thenReturn(512); + when(config.getTracePropagationStylesToExtract()) + .thenReturn(EnumSet.of(TracePropagationStyle.DATADOG, TracePropagationStyle.TRACECONTEXT)); + when(config.getTracePropagationStylesToInject()) + .thenReturn(EnumSet.of(TracePropagationStyle.DATADOG, TracePropagationStyle.TRACECONTEXT)); + when(config.isTracePropagationExtractFirst()).thenReturn(false); + when(config.isAwsPropagationEnabled()).thenReturn(false); + when(config.getBaggageMapping()).thenReturn(Collections.emptyMap()); + when(config.isTracePropagationStyleB3PaddingEnabled()).thenReturn(false); + when(config.isApmTracingEnabled()).thenReturn(true); + when(config.isTraceOrgGuardEnabled()).thenReturn(enabled); + when(config.isTraceOrgGuardStrict()).thenReturn(strict); + when(config.getTraceOrgGuardTrustedOpms()).thenReturn(trusted); + + HttpCodec.Extractor extractor = HttpCodec.createExtractor(config, traceConfigSupplier); + HttpCodec.Injector injector = + HttpCodec.createInjector( + config, config.getTracePropagationStylesToInject(), Collections.emptyMap()); + OrgGuard orgGuard = OrgGuard.create(config, localOpmSupplier, factory, healthMetrics); + return new TracingPropagator( + true, orgGuard.decorateInjector(injector), orgGuard.decorateExtractor(extractor)); + } + + /** + * Build a minimal AgentSpan wrapping a (mocked) DDSpanContext whose propagation tags can be + * controlled by the test. + */ + private AgentSpan buildSpanForInjection(String preExistingOpm) { + PropagationTags tags = factory.empty(); + if (preExistingOpm != null) { + tags.updateOrgPropagationMarker(preExistingOpm); + } + DDSpanContext ddCtx = mock(DDSpanContext.class); + when(ddCtx.getTraceId()).thenReturn(DDTraceId.from(123L)); + when(ddCtx.getSpanId()).thenReturn(456L); + when(ddCtx.getSamplingPriority()).thenReturn(2); + when(ddCtx.lockSamplingPriority()).thenReturn(true); + when(ddCtx.getOrigin()).thenReturn(null); + when(ddCtx.getEndToEndStartTime()).thenReturn(0L); + when(ddCtx.baggageItems()).thenReturn(Collections.emptySet()); + when(ddCtx.getPropagationTags()).thenReturn(tags); + TraceCollector collector = mock(TraceCollector.class); + when(ddCtx.getTraceCollector()).thenReturn(collector); + return AgentSpan.fromSpanContext(ddCtx); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/PropagationTagsLastParentIdTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/PropagationTagsLastParentIdTest.java new file mode 100644 index 00000000000..643a39126f1 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/PropagationTagsLastParentIdTest.java @@ -0,0 +1,61 @@ +package datadog.trace.core.propagation; + +import static datadog.trace.core.propagation.PropagationTags.HeaderType.W3C; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; + +/** + * The inject-time W3C last-parent-id ({@code p:}) is supplied as a parameter to {@link + * PropagationTags#headerValue(PropagationTags.HeaderType, CharSequence)} rather than mutated into + * the (possibly trace-level, shared) tags. This keeps transient per-injection identity out of + * shared state: a sibling span's inject can't pollute another span's header, and the stored inbound + * last-parent-id is never overwritten. + */ +class PropagationTagsLastParentIdTest { + + private static final String SPAN_A = "00000000000000aa"; + private static final String SPAN_B = "00000000000000bb"; + + private static PropagationTags w3c(String header) { + return PropagationTags.factory().fromHeaderValue(W3C, header); + } + + @Test + void overrideSuppliesW3cLastParentId() { + PropagationTags tags = w3c("dd=s:1;o:rum"); + assertTrue(tags.headerValue(W3C, SPAN_A).contains("p:" + SPAN_A)); + } + + @Test + void overrideDoesNotMutateSharedTags_noCrossTalk() { + // One tags instance, two sibling spans injecting through it (the shared-root scenario). + PropagationTags shared = w3c("dd=s:1;o:rum"); // no inbound p: + + String headerA = shared.headerValue(W3C, SPAN_A); + String headerB = shared.headerValue(W3C, SPAN_B); + String headerAagain = shared.headerValue(W3C, SPAN_A); + + assertTrue(headerA.contains("p:" + SPAN_A)); + assertTrue(headerB.contains("p:" + SPAN_B)); + // Injecting B did not change what A injects — no shared mutation. + assertEquals(headerA, headerAagain, "a sibling inject must not change another span's header"); + // The override is never written into the shared tags (no-override header has no p:). + assertFalse(shared.headerValue(W3C).contains("p:"), "override must not mutate the stored tags"); + } + + @Test + void inboundLastParentIdPreservedAndUnmutatedByOverride() { + PropagationTags tags = w3c("dd=s:1;p:" + SPAN_A); // arrived carrying a last-parent-id + + // No-override path (e.g. span-link traceState) keeps the inbound p:. + assertTrue(tags.headerValue(W3C).contains("p:" + SPAN_A)); + // An inject override replaces it for that produced header... + assertTrue(tags.headerValue(W3C, SPAN_B).contains("p:" + SPAN_B)); + // ...without mutating the stored inbound value. + assertTrue( + tags.headerValue(W3C).contains("p:" + SPAN_A), "inbound p: must survive override use"); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/PropagationTagsOpmTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/PropagationTagsOpmTest.java new file mode 100644 index 00000000000..48935a33195 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/PropagationTagsOpmTest.java @@ -0,0 +1,124 @@ +package datadog.trace.core.propagation; + +import static datadog.trace.core.propagation.PropagationTags.HeaderType.DATADOG; +import static datadog.trace.core.propagation.PropagationTags.HeaderType.W3C; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +@DisplayName("PropagationTags OPM round-trip") +class PropagationTagsOpmTest { + + private PropagationTags.Factory factory; + + @BeforeEach + void setUp() { + factory = PropagationTags.factory(); + } + + @Test + @DisplayName("Datadog: extract _dd.p.opm from x-datadog-tags then re-serialize it") + void datadogRoundTrip() { + PropagationTags tags = factory.fromHeaderValue(DATADOG, "_dd.p.opm=abc123def0"); + assertNotNull(tags.getOrgPropagationMarker()); + assertEquals("abc123def0", tags.getOrgPropagationMarker().toString()); + String header = tags.headerValue(DATADOG); + assertNotNull(header); + assertTrue(header.contains("_dd.p.opm=abc123def0"), "header was: " + header); + } + + @Test + @DisplayName("W3C: extract t.opm from tracestate dd= section then re-serialize it") + void w3cRoundTrip() { + PropagationTags tags = factory.fromHeaderValue(W3C, "dd=t.opm:abc123def0"); + assertNotNull(tags.getOrgPropagationMarker()); + assertEquals("abc123def0", tags.getOrgPropagationMarker().toString()); + String header = tags.headerValue(W3C); + assertNotNull(header); + assertTrue(header.contains("t.opm:abc123def0"), "header was: " + header); + } + + @Test + @DisplayName("update overrides any previously extracted OPM (W3C)") + void updateOverridesExtractedW3C() { + PropagationTags tags = factory.fromHeaderValue(W3C, "dd=t.opm:upstream-abc"); + tags.updateOrgPropagationMarker("local-xyz"); + assertEquals("local-xyz", tags.getOrgPropagationMarker().toString()); + String header = tags.headerValue(W3C); + assertNotNull(header); + assertTrue(header.contains("t.opm:local-xyz"), "header was: " + header); + } + + @Test + @DisplayName("update overrides any previously extracted OPM (Datadog)") + void updateOverridesExtractedDatadog() { + PropagationTags tags = factory.fromHeaderValue(DATADOG, "_dd.p.opm=upstream-abc"); + tags.updateOrgPropagationMarker("local-xyz"); + assertEquals("local-xyz", tags.getOrgPropagationMarker().toString()); + String header = tags.headerValue(DATADOG); + assertNotNull(header); + assertTrue(header.contains("_dd.p.opm=local-xyz"), "header was: " + header); + } + + @Test + @DisplayName("update with null clears the OPM") + void updateWithNullClears() { + PropagationTags tags = factory.fromHeaderValue(W3C, "dd=t.opm:abc"); + tags.updateOrgPropagationMarker(null); + assertNull(tags.getOrgPropagationMarker()); + String header = tags.headerValue(W3C); + if (header != null) { + assertFalse(header.contains("t.opm"), "header still had t.opm: " + header); + } + } + + @Test + @DisplayName("emptyW3C preserves non-dd vendor tracestate sections and drops dd content") + void emptyW3CPreservesNonDdVendors() { + String original = "dd=s:1;o:foo;t.dm:-4;t.opm:upstream-abc,vendor1=abc,vendor2=def"; + PropagationTags stripped = factory.emptyW3C(original); + assertNull(stripped.getOrgPropagationMarker()); + String reEncoded = stripped.headerValue(W3C); + assertNotNull(reEncoded); + assertFalse(reEncoded.contains("dd="), "should drop dd member but was: " + reEncoded); + assertTrue(reEncoded.contains("vendor1=abc"), "vendor1 missing: " + reEncoded); + assertTrue(reEncoded.contains("vendor2=def"), "vendor2 missing: " + reEncoded); + } + + @Test + @DisplayName("emptyW3C with null tracestate behaves like empty()") + void emptyW3CNullTracestate() { + PropagationTags stripped = factory.emptyW3C(null); + assertNull(stripped.getOrgPropagationMarker()); + assertNull(stripped.headerValue(W3C)); + } + + @Test + @DisplayName("emptyW3C with empty string tracestate behaves like empty()") + void emptyW3CEmptyTracestate() { + PropagationTags stripped = factory.emptyW3C(""); + assertNull(stripped.getOrgPropagationMarker()); + assertNull(stripped.headerValue(W3C)); + } + + @Test + @DisplayName("empty tags can have an OPM stamped on them and serialize it") + void emptyTagsCanReceiveOpm() { + PropagationTags tags = factory.empty(); + assertNull(tags.getOrgPropagationMarker()); + tags.updateOrgPropagationMarker("local-xyz"); + assertEquals("local-xyz", tags.getOrgPropagationMarker().toString()); + String datadog = tags.headerValue(DATADOG); + assertNotNull(datadog); + assertTrue(datadog.contains("_dd.p.opm=local-xyz"), "datadog header: " + datadog); + String w3c = tags.headerValue(W3C); + assertNotNull(w3c); + assertTrue(w3c.contains("t.opm:local-xyz"), "w3c header: " + w3c); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/TracingPropagatorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/TracingPropagatorTest.java new file mode 100644 index 00000000000..1660604632a --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/TracingPropagatorTest.java @@ -0,0 +1,201 @@ +package datadog.trace.core.propagation; + +import static datadog.trace.api.ProductTraceSource.UNSET; +import static datadog.trace.api.sampling.PrioritySampling.SAMPLER_DROP; +import static datadog.trace.api.sampling.PrioritySampling.SAMPLER_KEEP; +import static datadog.trace.api.sampling.PrioritySampling.USER_DROP; +import static datadog.trace.bootstrap.instrumentation.api.AgentPropagation.XRAY_TRACING_CONCERN; +import static datadog.trace.bootstrap.instrumentation.api.ContextVisitors.stringValuesMap; +import static datadog.trace.bootstrap.instrumentation.api.Tags.PROPAGATED_TRACE_SOURCE; +import static datadog.trace.core.propagation.DatadogHttpCodec.SAMPLING_PRIORITY_KEY; +import static datadog.trace.core.propagation.XRayHttpCodec.X_AMZN_TRACE_ID; +import static datadog.trace.test.junit.utils.config.WithConfigExtension.injectSysConfig; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.same; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +import datadog.context.Context; +import datadog.context.propagation.Propagator; +import datadog.context.propagation.Propagators; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.core.CoreTracer; +import datadog.trace.core.DDCoreJavaSpecification; +import datadog.trace.core.DDSpanContext; +import datadog.trace.test.junit.utils.converter.ProductTraceSourceConverter; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.converter.ConvertWith; +import org.junit.jupiter.params.provider.ValueSource; +import org.tabletest.junit.TableTest; + +class TracingPropagatorTest extends DDCoreJavaSpecification { + + private HttpCodec.Injector injector; + private HttpCodec.Extractor extractor; + private TracingPropagator propagator; + + @BeforeEach + void setup() { + this.injector = mock(HttpCodec.Injector.class); + this.extractor = mock(HttpCodec.Extractor.class); + this.propagator = new TracingPropagator(true, this.injector, this.extractor); + } + + @Test + void testTracingPropagatorContextInjection() { + CoreTracer tracer = tracerBuilder().build(); + AgentSpan span = tracer.buildSpan("test", "operation").start(); + Map carrier = new HashMap<>(); + + this.propagator.inject(span, carrier, Map::put); + + verify(this.injector).inject(same((DDSpanContext) span.spanContext()), same(carrier), any()); + + span.finish(); + tracer.close(); + } + + @Test + void testTracingPropagatorContextExtractor() { + Context context = Context.root(); + Map carrier = new HashMap<>(); + + this.propagator.extract(context, carrier, stringValuesMap()); + + verify(this.extractor).extract(same(carrier), any()); + } + + @Test + void spanPrioritySetWhenInjecting() { + CoreTracer tracer = tracerBuilder().build(); + Map carrier = new HashMap<>(); + + AgentSpan root = tracer.buildSpan("test", "parent").start(); + AgentSpan child = tracer.buildSpan("test", "child").asChildOf(root).start(); + Propagators.defaultPropagator().inject(child, carrier, Map::put); + + assertEquals(SAMPLER_KEEP, root.getSamplingPriority()); + assertEquals(root.getSamplingPriority(), child.getSamplingPriority()); + assertEquals(String.valueOf(SAMPLER_KEEP), carrier.get(SAMPLING_PRIORITY_KEY)); + + child.finish(); + root.finish(); + tracer.close(); + } + + @Test + void spanPriorityOnlySetAfterFirstInjection() { + ControllableSampler sampler = new ControllableSampler(); + CoreTracer tracer = tracerBuilder().sampler(sampler).build(); + + AgentSpan root = tracer.buildSpan("test", "parent").start(); + AgentSpan child = tracer.buildSpan("test", "child").asChildOf(root).start(); + + Map carrier = new HashMap<>(); + Propagators.defaultPropagator().inject(child, carrier, Map::put); + + assertEquals(SAMPLER_KEEP, root.getSamplingPriority()); + assertEquals(root.getSamplingPriority(), child.getSamplingPriority()); + assertEquals(String.valueOf(SAMPLER_KEEP), carrier.get(SAMPLING_PRIORITY_KEY)); + + sampler.nextSamplingPriority = SAMPLER_DROP; + AgentSpan child2 = tracer.buildSpan("test", "child2").asChildOf(root).start(); + Propagators.defaultPropagator().inject(child2, carrier, Map::put); + + assertEquals(SAMPLER_KEEP, root.getSamplingPriority()); + assertEquals(root.getSamplingPriority(), child.getSamplingPriority()); + assertEquals(root.getSamplingPriority(), child2.getSamplingPriority()); + assertEquals(String.valueOf(SAMPLER_KEEP), carrier.get(SAMPLING_PRIORITY_KEY)); + + child.finish(); + child2.finish(); + root.finish(); + tracer.close(); + } + + @Test + void injectionDoesNotOverrideSetPriority() { + ControllableSampler sampler = new ControllableSampler(); + CoreTracer tracer = tracerBuilder().sampler(sampler).build(); + + AgentSpan root = tracer.buildSpan("test", "root").start(); + AgentSpan child = tracer.buildSpan("test", "child").asChildOf(root).start(); + child.setSamplingPriority(USER_DROP); + + Map carrier = new HashMap<>(); + Propagators.defaultPropagator().inject(child, carrier, Map::put); + + assertEquals(USER_DROP, root.getSamplingPriority()); + assertEquals(root.getSamplingPriority(), child.getSamplingPriority()); + assertEquals(String.valueOf(USER_DROP), carrier.get(SAMPLING_PRIORITY_KEY)); + + child.finish(); + root.finish(); + tracer.close(); + } + + @TableTest({ + "tracingEnabled | product ", + "true | ProductTraceSource.ASM ", + "true | ProductTraceSource.UNSET", + "false | ProductTraceSource.ASM ", + "false | ProductTraceSource.UNSET" + }) + void testPropagationWhenTracingIsDisabled( + boolean tracingEnabled, @ConvertWith(ProductTraceSourceConverter.class) int product) { + // Recreating propagator to apply tracing test flag + this.propagator = new TracingPropagator(tracingEnabled, this.injector, this.extractor); + + CoreTracer tracer = tracerBuilder().build(); + AgentSpan span = tracer.buildSpan("test", "operation").start(); + span.setTag(PROPAGATED_TRACE_SOURCE, product); + + Map carrier = new HashMap<>(); + this.propagator.inject(span, carrier, Map::put); + + int injected = (tracingEnabled || product != UNSET) ? 1 : 0; + verify(this.injector, times(injected)) + .inject(same((DDSpanContext) span.spanContext()), same(carrier), any()); + + span.finish(); + tracer.close(); + } + + @Test + void testAwsXRayPropagator() { + CoreTracer tracer = tracerBuilder().build(); + AgentSpan span = tracer.buildSpan("test", "operation").start(); + Propagator xrayPropagator = Propagators.forConcerns(XRAY_TRACING_CONCERN); + + Map carrier = new HashMap<>(); + xrayPropagator.inject(span, carrier, Map::put); + + assertNotNull(carrier.get(X_AMZN_TRACE_ID)); + + span.finish(); + tracer.close(); + } + + @ParameterizedTest + @ValueSource(booleans = {true, false}) + void testApmTracingDisabledPropagatorStopPropagation(boolean apmTracingEnabled) { + injectSysConfig("apm.tracing.enabled", String.valueOf(apmTracingEnabled)); + CoreTracer tracer = tracerBuilder().build(); + AgentSpan span = tracer.buildSpan("test", "operation").start(); + + Map carrier = new HashMap<>(); + Propagators.defaultPropagator().inject(span, carrier, Map::put); + + assertEquals(apmTracingEnabled, !carrier.isEmpty()); + + span.finish(); + tracer.close(); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/W3CHttpExtractorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/W3CHttpExtractorTest.java new file mode 100644 index 00000000000..d1d80827e74 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/W3CHttpExtractorTest.java @@ -0,0 +1,302 @@ +package datadog.trace.core.propagation; + +import static datadog.trace.bootstrap.instrumentation.api.ContextVisitors.stringValuesMap; +import static datadog.trace.core.propagation.HttpCodecTestHelper.headers; +import static datadog.trace.core.propagation.W3CHttpCodec.OT_BAGGAGE_PREFIX; +import static datadog.trace.core.propagation.W3CHttpCodec.TRACE_PARENT_KEY; +import static datadog.trace.core.propagation.W3CHttpCodec.TRACE_STATE_KEY; +import static java.util.Collections.emptyMap; +import static java.util.Collections.singletonMap; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; + +import datadog.trace.api.Config; +import datadog.trace.api.DD64bTraceId; +import datadog.trace.api.DDSpanId; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.TraceConfig; +import datadog.trace.bootstrap.instrumentation.api.TagContext; +import datadog.trace.test.junit.utils.converter.PrioritySamplingConverter; +import datadog.trace.test.junit.utils.converter.SamplingMechanismConverter; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.function.Supplier; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ParameterContext; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.converter.ArgumentConversionException; +import org.junit.jupiter.params.converter.ArgumentConverter; +import org.junit.jupiter.params.converter.ConvertWith; +import org.junit.jupiter.params.provider.ValueSource; +import org.tabletest.junit.TableTest; + +class W3CHttpExtractorTest extends AbstractHttpExtractorTest { + private static final long TEST_SPAN_ID = 1311768467463790320L; + private static final DDTraceId TRACE_ID_ONE = + DDTraceId.fromHex("00000000000000000000000000000001"); + private static final DDTraceId TRACE_ID_NO_HIGH_LOW_MAX = + DDTraceId.fromHex("0000000000000000ffffffffffffffff"); + private static final DDTraceId TRACE_ID_LOW_MAX = + DDTraceId.fromHex("123456789abcdef0ffffffffffffffff"); + + @Override + protected HttpCodec.Extractor newExtractor( + Config config, Supplier traceConfigSupplier) { + return W3CHttpCodec.newExtractor(config, traceConfigSupplier); + } + + @TableTest({ + "scenario | traceparent | tpValid | traceId | spanId | priority ", + "null traceparent | | false | | 0 | UNSET ", + "all zeros trace id | '00-00000000000000000000000000000000-123456789abcdef0-01' | false | | 0 | UNSET ", + "too long trace id | '00-123456789abcdef00000000000000000-123456789abcdef0-01' | false | | 0 | UNSET ", + "all zeros span id | '00-00000000000000000000000000000001-0000000000000000-01' | false | | 0 | UNSET ", + "valid keep | '00-00000000000000000000000000000001-123456789abcdef0-01' | true | TRACE_ID_ONE | SPAN_ID_TEST | SAMPLER_KEEP", + "leading tab | '\t00-00000000000000000000000000000001-123456789abcdef0-01' | true | TRACE_ID_ONE | SPAN_ID_TEST | SAMPLER_KEEP", + "trailing tab | '00-00000000000000000000000000000001-123456789abcdef0-01\t' | true | TRACE_ID_ONE | SPAN_ID_TEST | SAMPLER_KEEP", + "surrounding spaces | ' 00-00000000000000000000000000000001-123456789abcdef0-01 ' | true | TRACE_ID_ONE | SPAN_ID_TEST | SAMPLER_KEEP", + "max span id keep | '00-0000000000000000ffffffffffffffff-ffffffffffffffff-01' | true | TRACE_ID_NO_HIGH_LOW_MAX | SPAN_ID_MAX | SAMPLER_KEEP", + "max span id drop | '00-0000000000000000ffffffffffffffff-ffffffffffffffff-00' | true | TRACE_ID_NO_HIGH_LOW_MAX | SPAN_ID_MAX | SAMPLER_DROP", + "low max trace id drop | '00-123456789abcdef0ffffffffffffffff-123456789abcdef0-00' | true | TRACE_ID_LOW_MAX | SPAN_ID_TEST | SAMPLER_DROP", + "uppercase F in trace id low part | '00-123456789abcdef0ffffffffffffffFf-123456789abcdef0-00' | false | | 0 | UNSET ", + "uppercase F in trace id high part | '00-123456789abcdeF0ffffffffffffffff-123456789abcdef0-00' | false | | 0 | UNSET ", + "uppercase F in trace id mid | '00-123456789abcdef0fffffffffFffffff-123456789abcdef0-00' | false | | 0 | UNSET ", + "uppercase A in span id | '00-123456789abcdef0ffffffffffffffff-123456789Abcdef0-00' | false | | 0 | UNSET ", + "unicode a-umlaut in trace id start | '00-123456789äbcdef0ffffffffffffffff-123456789abcdef0-00' | false | | 0 | UNSET ", + "unicode a-umlaut in trace id mid | '00-123456789abcdef0ffffffffäfffffff-123456789abcdef0-00' | false | | 0 | UNSET ", + "unicode a-umlaut in span id | '00-123456789abcdef0ffffffffffffffff-123456789äbcdef0-00' | false | | 0 | UNSET ", + "version 01 flags 02 | '01-00000000000000000000000000000001-0000000000000001-02' | true | TRACE_ID_ONE | SPAN_ID_ONE | SAMPLER_DROP", + "too long version | '000-0000000000000000000000000000001-0000000000000001-01' | false | | 0 | UNSET ", + "space inside trace id | '00-0000000000000000000000000000001 -0000000000000001-01' | false | | 0 | UNSET ", + "trace id too short | '00-0000000000000000000000000000001-0000000000000001-01' | false | | 0 | UNSET ", + "span id too short | '00-00000000000000000000000000000001-000000000000001-01' | false | | 0 | UNSET ", + "flags too short | '00-00000000000000000000000000000001-0000000000000001-0' | false | | 0 | UNSET ", + "version ff invalid | 'ff-00000000000000000000000000000001-0000000000000001-00' | false | | 0 | UNSET ", + "version fe flags 02 | 'fe-00000000000000000000000000000001-0000000000000001-02' | true | TRACE_ID_ONE | SPAN_ID_ONE | SAMPLER_DROP", + "extra data with version 00 | '00-00000000000000000000000000000001-0000000000000001-03-0' | false | | 0 | UNSET ", + "invalid separator after flags with fe | 'fe-00000000000000000000000000000001-0000000000000001-02.0' | false | | 0 | UNSET " + }) + void extractTraceparent( + String traceparent, + boolean tpValid, + @ConvertWith(TraceIdTestConverter.class) DDTraceId traceId, + @ConvertWith(SpanIdTestConverter.class) long spanId, + @ConvertWith(PrioritySamplingConverter.class) byte priority) { + Map headers = headers(TRACE_PARENT_KEY, traceparent); + + TagContext result = this.extractor.extract(headers, stringValuesMap()); + + if (tpValid) { + assertInstanceOf(ExtractedContext.class, result); + ExtractedContext context = (ExtractedContext) result; + assertEquals(traceId, context.getTraceId()); + assertEquals(spanId, context.getSpanId()); + assertEquals(priority, context.getSamplingPriority()); + } else { + assertNull(result); + } + } + + @ParameterizedTest + @ValueSource(strings = {"TRACE_ID_LOW_MAX", "TRACE_ID_NO_HIGH_LOW_MAX"}) + void checkMaxFromW3CTraceIds(@ConvertWith(TraceIdTestConverter.class) DDTraceId traceId) { + assertEquals(DD64bTraceId.MAX.toLong(), traceId.toLong()); + } + + @TableTest({ + "scenario | traceparent | tracestate | priority | decisionMaker | origin", + "keep empty state | '00-00000000000000000000000000000001-123456789abcdef0-01' | '' | SAMPLER_KEEP | SamplingMechanism.DEFAULT | ", + "drop empty state | '00-00000000000000000000000000000001-123456789abcdef0-00' | '' | SAMPLER_DROP | | ", + "keep with user keep state | '00-00000000000000000000000000000001-123456789abcdef0-01' | 'dd=s:2;o:some' | USER_KEEP | | some ", + "keep with user keep state and manual dm | '00-00000000000000000000000000000001-123456789abcdef0-01' | 'dd=s:2;o:some;t.dm:-4' | USER_KEEP | SamplingMechanism.MANUAL | some ", + "drop with user keep state and manual dm | '00-00000000000000000000000000000001-123456789abcdef0-00' | 'dd=s:2;o:some;t.dm:-4' | SAMPLER_DROP | | some ", + "drop with user drop state | '00-00000000000000000000000000000001-123456789abcdef0-00' | 'dd=s:-1;o:some' | USER_DROP | | some ", + "drop with user drop state and manual dm | '00-00000000000000000000000000000001-123456789abcdef0-00' | 'dd=s:-1;o:some;t.dm:-4' | USER_DROP | SamplingMechanism.MANUAL | some ", + "keep overrides user drop state with manual dm | '00-00000000000000000000000000000001-123456789abcdef0-01' | 'dd=s:-1;o:some;t.dm:-4' | SAMPLER_KEEP | SamplingMechanism.DEFAULT | some " + }) + void extractTraceparentTracestateAndHttpHeaders( + String traceparent, + String tracestate, + @ConvertWith(PrioritySamplingConverter.class) byte priority, + @ConvertWith(SamplingMechanismConverter.class) Byte decisionMaker, + String origin) { + // spotless:off + Map headers = headers( + "", "empty key", + TRACE_PARENT_KEY, traceparent, + TRACE_STATE_KEY, tracestate, + OT_BAGGAGE_PREFIX + "k1", "v1", + OT_BAGGAGE_PREFIX + "k2", "v2", + SOME_HEADER, "my-interesting-info", + SOME_CUSTOM_BAGGAGE_HEADER, "my-interesting-baggage-info", + SOME_CUSTOM_BAGGAGE_HEADER_2, "my-interesting-baggage-info-2" + ); + // spotless:on + + ExtractedContext context = + (ExtractedContext) this.extractor.extract(headers, stringValuesMap()); + + assertEquals(TRACE_ID_ONE, context.getTraceId()); + assertEquals(TEST_SPAN_ID, context.getSpanId()); + Map expectedBaggage = new HashMap<>(); + expectedBaggage.put("k1", "v1"); + expectedBaggage.put("k2", "v2"); + expectedBaggage.put("some-baggage", "my-interesting-baggage-info"); + expectedBaggage.put("some-CaseSensitive-baggage", "my-interesting-baggage-info-2"); + assertEquals(expectedBaggage, context.getBaggage()); + assertEquals(singletonMap("some-tag", "my-interesting-info"), context.getTags()); + assertEquals(priority, context.getSamplingPriority()); + Map expectedPTags = + decisionMaker != null ? singletonMap("_dd.p.dm", "-" + decisionMaker) : emptyMap(); + assertEquals(expectedPTags, context.getPropagationTags().createTagMap()); + if (origin != null) { + assertEquals(origin, context.getOrigin().toString()); + } + } + + @Test + void extractHeaderTagsWithNoPropagation() { + Map headers = headers(SOME_HEADER, "my-interesting-info"); + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + assertFalse(context instanceof ExtractedContext); + assertEquals(singletonMap("some-tag", "my-interesting-info"), context.getTags()); + } + + @TableTest({ + "scenario | endToEndStartTime", + "zero start time | 0 ", + "non-zero start time | 1610001234 " + }) + void extractHttpHeadersWithEndToEnd(long endToEndStartTime) { + // spotless:off + Map headers = headers( + "", "empty key", + TRACE_PARENT_KEY, "00-00000000000000000000000000000001-123456789abcdef0-01", + OT_BAGGAGE_PREFIX + "k1", "v1", + OT_BAGGAGE_PREFIX + "t0", String.valueOf(endToEndStartTime), + OT_BAGGAGE_PREFIX + "k2", "v2", + SOME_HEADER, "my-interesting-info", + SOME_CUSTOM_BAGGAGE_HEADER, "my-interesting-baggage-info", + SOME_CUSTOM_BAGGAGE_HEADER_2, "my-interesting-baggage-info-2" + ); + // spotless:on + + ExtractedContext context = (ExtractedContext) extractor.extract(headers, stringValuesMap()); + + assertEquals(TRACE_ID_ONE, context.getTraceId()); + assertEquals(TEST_SPAN_ID, context.getSpanId()); + Map expectedBaggage = new LinkedHashMap<>(); + expectedBaggage.put("k1", "v1"); + expectedBaggage.put("k2", "v2"); + expectedBaggage.put("some-baggage", "my-interesting-baggage-info"); + expectedBaggage.put("some-CaseSensitive-baggage", "my-interesting-baggage-info-2"); + assertEquals(expectedBaggage, context.getBaggage()); + assertEquals(singletonMap("some-tag", "my-interesting-info"), context.getTags()); + assertEquals(endToEndStartTime * 1_000_000L, context.getEndToEndStartTime()); + } + + @TableTest({ + "scenario | tpValid | traceparent ", + "invalid all-zeros trace id | false | '00-00000000000000000000000000000000-123456789abcdef0-01'", + "invalid all-zeros span id | false | '00-00000000000000000000000000000001-0000000000000000-01'", + "valid traceparent | true | '00-00000000000000000000000000000001-0000000000000001-01'" + }) + void baggageIsMappedOnContextCreation(boolean tpValid, String traceparent) { + // spotless:off + Map headers = headers( + TRACE_PARENT_KEY, traceparent, + SOME_CUSTOM_BAGGAGE_HEADER, "mappedBaggageValue", + OT_BAGGAGE_PREFIX + "k1", "v1", + OT_BAGGAGE_PREFIX + "k2", "v2", + SOME_ARBITRARY_HEADER, "my-interesting-info" + ); + // spotless:on + + TagContext context = extractor.extract(headers, stringValuesMap()); + + assertNotNull(context); + if (tpValid) { + assertEquals(TRACE_ID_ONE, context.getTraceId()); + assertEquals(1L, context.getSpanId()); + } + Map expectedBaggage = new LinkedHashMap<>(); + expectedBaggage.put("some-baggage", "mappedBaggageValue"); + expectedBaggage.put("k1", "v1"); + expectedBaggage.put("k2", "v2"); + assertEquals(expectedBaggage, context.getBaggage()); + } + + @TableTest({ + "scenario | traceparent | tracestate | consistent", + "empty state | '00-123456789abcdef00fedcba987654321-123456789abcdef0-01' | '' | true ", + "consistent tid | '00-123456789abcdef00fedcba987654321-123456789abcdef0-01' | 'dd=t.tid:123456789abcdef0' | true ", + "inconsistent tid | '00-123456789abcdef00fedcba987654321-123456789abcdef0-01' | 'dd=t.tid:123456789abcdef1' | false " + }) + void markInconsistentTidAsPropagationError( + String traceparent, String tracestate, boolean consistent) { + // spotless:off + Map headers = headers( + TRACE_PARENT_KEY, traceparent, + TRACE_STATE_KEY, tracestate); + // spotless:on + + ExtractedContext context = (ExtractedContext) extractor.extract(headers, stringValuesMap()); + + String tid = tracestate.isEmpty() ? "" : tracestate.substring(9); + Map defaultTags = new LinkedHashMap<>(); + defaultTags.put("_dd.p.dm", "-0"); + defaultTags.put("_dd.p.tid", "123456789abcdef0"); + Map expectedTags = new LinkedHashMap<>(defaultTags); + if (!consistent) { + expectedTags.put("_dd.propagation_error", "inconsistent_tid " + tid); + } + assertEquals(expectedTags, context.getPropagationTags().createTagMap()); + } + + static final class TraceIdTestConverter implements ArgumentConverter { + @Override + public Object convert(Object source, ParameterContext context) + throws ArgumentConversionException { + if (source == null) { + return null; + } + switch (source.toString()) { + case "TRACE_ID_ONE": + return TRACE_ID_ONE; + case "TRACE_ID_NO_HIGH_LOW_MAX": + return TRACE_ID_NO_HIGH_LOW_MAX; + case "TRACE_ID_LOW_MAX": + return TRACE_ID_LOW_MAX; + default: + return source; + } + } + } + + static final class SpanIdTestConverter implements ArgumentConverter { + @Override + public Object convert(Object source, ParameterContext context) + throws ArgumentConversionException { + if (source == null) { + return null; + } + String s = source.toString(); + switch (s) { + case "SPAN_ID_MAX": + return DDSpanId.MAX; + case "SPAN_ID_TEST": + return TEST_SPAN_ID; + case "SPAN_ID_ONE": + return 1; + default: + return Long.parseLong(s); + } + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/W3CHttpInjectorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/W3CHttpInjectorTest.java new file mode 100644 index 00000000000..9903867e1c4 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/W3CHttpInjectorTest.java @@ -0,0 +1,183 @@ +package datadog.trace.core.propagation; + +import static datadog.trace.api.sampling.PrioritySampling.UNSET; +import static datadog.trace.api.sampling.PrioritySampling.USER_KEEP; +import static datadog.trace.api.sampling.SamplingMechanism.MANUAL; +import static datadog.trace.core.propagation.PropagationTags.HeaderType.DATADOG; +import static datadog.trace.core.propagation.W3CHttpCodec.OT_BAGGAGE_PREFIX; +import static datadog.trace.core.propagation.W3CHttpCodec.TRACE_PARENT_KEY; +import static datadog.trace.core.propagation.W3CHttpCodec.TRACE_STATE_KEY; +import static java.util.Collections.singletonMap; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import datadog.trace.api.DDSpanId; +import datadog.trace.api.DDTraceId; +import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.core.DDSpanContext; +import datadog.trace.test.junit.utils.converter.PrioritySamplingConverter; +import datadog.trace.test.junit.utils.converter.TraceIdConverter; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.converter.ConvertWith; +import org.tabletest.junit.TableTest; + +class W3CHttpInjectorTest extends AbstractHttpInjectorTest { + + @Override + protected HttpCodec.Injector newInjector() { + return W3CHttpCodec.newInjector(singletonMap("some-baggage-key", "SOME_CUSTOM_HEADER")); + } + + @TableTest({ + "scenario | traceId | spanId | samplingPriority | origin | tracestate ", + "unset 1->2 | 1 | 2 | UNSET | | 'dd=p:0000000000000002;t.usr:123' ", + "keep 1->4 saipan | 1 | 4 | SAMPLER_KEEP | saipan | 'dd=s:1;o:saipan;p:0000000000000004;t.usr:123'", + "unset max->max-1 saipan | MAX | MAX-1 | UNSET | saipan | 'dd=o:saipan;p:fffffffffffffffe;t.usr:123' ", + "keep max-1->max | MAX-1 | MAX | SAMPLER_KEEP | | 'dd=s:1;p:ffffffffffffffff;t.usr:123' ", + "drop max-1->max | MAX-1 | MAX | SAMPLER_DROP | | 'dd=s:0;p:ffffffffffffffff;t.usr:123' " + }) + void injectHttpHeaders( + @ConvertWith(TraceIdConverter.class) String traceId, + @ConvertWith(TraceIdConverter.class) String spanId, + @ConvertWith(PrioritySamplingConverter.class) byte samplingPriority, + String origin, + String tracestate) { + Map baggage = new HashMap<>(); + baggage.put("k1", "v1"); + baggage.put("k2", "v2"); + baggage.put("some-baggage-key", "some-value"); + DDSpanContext spanContext = + mockSpanContext( + DDTraceId.from(traceId), + DDSpanId.from(spanId), + samplingPriority, + origin, + baggage, + PropagationTags.factory().fromHeaderValue(DATADOG, "_dd.p.usr=123")); + Map carrier = new HashMap<>(); + + this.injector.inject(spanContext, carrier, Map::put); + + Map expected = new HashMap<>(); + expected.put(TRACE_PARENT_KEY, buildTraceParent(traceId, spanId, samplingPriority)); + expected.put(TRACE_STATE_KEY, tracestate); + expected.put(OT_BAGGAGE_PREFIX + "k1", "v1"); + expected.put(OT_BAGGAGE_PREFIX + "k2", "v2"); + expected.put("SOME_CUSTOM_HEADER", "some-value"); + assertEquals(expected, carrier); + } + + @Test + void injectHttpHeadersWithEndToEnd() { + Map baggage = new HashMap<>(); + baggage.put("k1", "v1"); + baggage.put("k2", "v2"); + DDSpanContext mockedContext = + mockSpanContext( + DDTraceId.from("1"), + DDSpanId.from("2"), + UNSET, + "fakeOrigin", + baggage, + PropagationTags.factory().fromHeaderValue(DATADOG, "_dd.p.dm=-4,_dd.p.anytag=value")); + mockedContext.beginEndToEnd(); + Map carrier = new HashMap<>(); + + this.injector.inject(mockedContext, carrier, Map::put); + + Map expected = new HashMap<>(); + expected.put(TRACE_PARENT_KEY, buildTraceParent("1", "2", UNSET)); + expected.put(TRACE_STATE_KEY, "dd=o:fakeOrigin;p:0000000000000002;t.dm:-4;t.anytag:value"); + expected.put( + OT_BAGGAGE_PREFIX + "t0", String.valueOf(mockedContext.getEndToEndStartTime() / 1000000L)); + expected.put(OT_BAGGAGE_PREFIX + "k1", "v1"); + expected.put(OT_BAGGAGE_PREFIX + "k2", "v2"); + assertEquals(expected, carrier); + } + + @Test + void injectTheDecisionMakerTag() { + Map baggage = new HashMap<>(); + baggage.put("k1", "v1"); + baggage.put("k2", "v2"); + DDSpanContext mockedContext = + mockSpanContext( + DDTraceId.from("1"), + DDSpanId.from("2"), + UNSET, + "fakeOrigin", + baggage, + PropagationTags.factory().empty()); + mockedContext.setSamplingPriority(USER_KEEP, MANUAL); + Map carrier = new HashMap<>(); + + this.injector.inject(mockedContext, carrier, Map::put); + + Map expected = new HashMap<>(); + expected.put(TRACE_PARENT_KEY, buildTraceParent("1", "2", USER_KEEP)); + expected.put(TRACE_STATE_KEY, "dd=s:2;o:fakeOrigin;p:0000000000000002;t.dm:-4"); + expected.put(OT_BAGGAGE_PREFIX + "k1", "v1"); + expected.put(OT_BAGGAGE_PREFIX + "k2", "v2"); + assertEquals(expected, carrier); + } + + @Test + void updateLastParentIdOnChildSpan() { + Map carrier = new HashMap<>(); + + // injecting root span context + AgentSpan rootSpan = this.tracer.startSpan("test", "root"); + long rootSpanId = rootSpan.getSpanId(); + AgentScope rootScope = this.tracer.activateSpan(rootSpan); + + this.injector.inject((DDSpanContext) rootSpan.spanContext(), carrier, Map::put); + + // trace state has root span id as last parent + assertEquals(rootSpanId, extractLastParentId(carrier)); + + // injecting child span context + AgentSpan childSpan = this.tracer.startSpan("test", "child"); + long childSpanId = childSpan.getSpanId(); + carrier.clear(); + this.injector.inject((DDSpanContext) childSpan.spanContext(), carrier, Map::put); + + // trace state has child span id as last parent + assertEquals(childSpanId, extractLastParentId(carrier)); + + // injecting root span again + childSpan.finish(); + carrier.clear(); + this.injector.inject((DDSpanContext) rootSpan.spanContext(), carrier, Map::put); + + // trace state has root span is as last parent again + assertEquals(rootSpanId, extractLastParentId(carrier)); + + rootScope.close(); + rootSpan.finish(); + } + + static String buildTraceParent(String traceId, String spanId, int samplingPriority) { + return "00-" + + DDTraceId.from(traceId).toHexString() + + "-" + + DDSpanId.toHexStringPadded(DDSpanId.from(spanId)) + + "-" + + (samplingPriority > 0 ? "01" : "00"); + } + + static long extractLastParentId(Map carrier) { + String traceState = carrier.get(TRACE_STATE_KEY); + for (String member : traceState.split(",")) { + if (member.startsWith("dd=")) { + for (String part : member.substring(3).split(";")) { + if (part.startsWith("p:")) { + return DDSpanId.fromHex(part.substring(2)); + } + } + } + } + throw new AssertionError("No 'p:' in dd tracestate: " + traceState); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/W3CPropagationTagsTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/W3CPropagationTagsTest.java new file mode 100644 index 00000000000..f59c8d36004 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/W3CPropagationTagsTest.java @@ -0,0 +1,359 @@ +package datadog.trace.core.propagation; + +import static datadog.trace.core.propagation.PropagationTags.HeaderType; +import static datadog.trace.core.propagation.PropagationTags.HeaderType.W3C; +import static datadog.trace.core.propagation.PropagationTags.factory; +import static datadog.trace.core.propagation.ptags.W3CPTagsCodec.MAX_MEMBER_COUNT; +import static java.lang.Math.min; +import static java.util.Collections.emptyMap; +import static java.util.Collections.singletonMap; +import static java.util.stream.IntStream.concat; +import static java.util.stream.IntStream.rangeClosed; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.params.provider.Arguments.arguments; + +import datadog.trace.core.DDCoreJavaSpecification; +import datadog.trace.test.junit.utils.converter.PrioritySamplingConverter; +import datadog.trace.test.junit.utils.converter.ProductTraceSourceConverter; +import datadog.trace.test.junit.utils.converter.SamplingMechanismConverter; +import java.util.Map; +import java.util.stream.IntStream; +import java.util.stream.Stream; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.converter.ConvertWith; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import org.tabletest.junit.TableTest; + +class W3CPropagationTagsTest extends DDCoreJavaSpecification { + + @ParameterizedTest + @MethodSource("validateTracestateHeaderLimitsArguments") + void validateTracestateHeaderLimits(String headerValue, boolean valid) { + PropagationTags propagationTags = factory().fromHeaderValue(W3C, headerValue); + + if (valid) { + assertEquals(headerValue.trim(), propagationTags.headerValue(W3C)); + } else { + assertNull(propagationTags.headerValue(W3C)); + } + // we're not using any dd members in the tests + assertTrue(propagationTags.createTagMap().isEmpty()); + } + + static Stream validateTracestateHeaderLimitsArguments() { + return Stream.of( + arguments(null, false), + arguments("", false), + // check basic key length limit + arguments(repeat("k", 251) + "0_-*/=1", true), + arguments(repeat("k", 252) + "0_-*/=1", false), + // check multi key length limit + arguments(repeat("t", 241) + "@" + repeat("s", 14) + "=1", true), + arguments(repeat("t", 242) + "@" + repeat("s", 14) + "=1", false), + arguments(repeat("t", 241) + "@" + repeat("s", 15) + "=1", false), + // check value length limit + arguments("k=" + repeat("v", 256), true), + arguments("k=" + repeat("v", 257), false), + // check value length limit with some trailing whitespace + arguments("k=" + repeat("v", 256) + " \t \t", true), + arguments("k=" + repeat("v", 257) + " \t \t", false)); + } + + @ParameterizedTest + @MethodSource("validateTracestateHeaderValidKeyContentsArguments") + void validateTracestateHeaderValidKeyContents(String headerChar) { + String lcAlpha = toLowerCaseAlpha(headerChar); + String simpleKeyHeader = lcAlpha + headerChar + "_-*/=1"; + String multiKeyHeader = headerChar + "@" + lcAlpha + headerChar + "_-*/=1"; + + PropagationTags simpleKeyPT = factory().fromHeaderValue(W3C, simpleKeyHeader); + PropagationTags multiKeyPT = factory().fromHeaderValue(W3C, multiKeyHeader); + + assertEquals(simpleKeyHeader, simpleKeyPT.headerValue(W3C)); + assertEquals(multiKeyHeader, multiKeyPT.headerValue(W3C)); + // we're not using any dd members in the tests + assertTrue(simpleKeyPT.createTagMap().isEmpty()); + assertTrue(multiKeyPT.createTagMap().isEmpty()); + } + + static Stream validateTracestateHeaderValidKeyContentsArguments() { + return concat(rangeClosed('a', 'z'), rangeClosed('0', '9')) + .mapToObj(c -> arguments(String.valueOf((char) c))); + } + + @ParameterizedTest + @MethodSource("validateTracestateHeaderInvalidKeyContentsArguments") + void validateTracestateHeaderInvalidKeyContents(String headerChar) { + String lcAlpha = toLowerCaseAlpha(headerChar); + String simpleKeyHeader = lcAlpha + headerChar + "_-*/=1"; + String multiKeyHeader = lcAlpha + headerChar + "@" + lcAlpha + headerChar + "_-*/=1"; + + PropagationTags simpleKeyPT = factory().fromHeaderValue(W3C, simpleKeyHeader); + PropagationTags multiKeyPT = factory().fromHeaderValue(W3C, multiKeyHeader); + + assertNull(simpleKeyPT.headerValue(W3C)); + assertNull(multiKeyPT.headerValue(W3C)); + // we're not using any dd members in the tests + assertEquals(emptyMap(), simpleKeyPT.createTagMap()); + assertEquals(emptyMap(), multiKeyPT.createTagMap()); + } + + static Stream validateTracestateHeaderInvalidKeyContentsArguments() { + return rangeClosed(' ', 'ÿ') + .filter(W3CPropagationTagsTest::invalidKeyChar) + .mapToObj(value -> String.valueOf((char) value)) + .map(Arguments::of); + } + + static boolean invalidKeyChar(int i) { + if (i >= 'a' && i <= 'z') { + return false; + } + if (i >= '0' && i <= '9') { + return false; + } + return i != '_' && i != '-' && i != '*' && i != '/'; + } + + @ParameterizedTest + @MethodSource("validateTracestateHeaderValidValueContentsArguments") + void validateTracestateHeaderValidValueContents(String valueChar) { + String lcAlpha = toLowerCaseAlpha(valueChar); + String mostlyOkHeader = lcAlpha + "=" + valueChar; + String alwaysOkHeader = lcAlpha + "=" + lcAlpha + valueChar + lcAlpha; + + PropagationTags mostlyOkPT = factory().fromHeaderValue(W3C, mostlyOkHeader); + PropagationTags alwaysOkPT = factory().fromHeaderValue(W3C, alwaysOkHeader); + + if (" ".equals(valueChar)) { + assertNull(mostlyOkPT.headerValue(W3C)); + } else { + assertEquals(mostlyOkHeader, mostlyOkPT.headerValue(W3C)); + } + assertEquals(alwaysOkHeader, alwaysOkPT.headerValue(W3C)); + // we're not using any dd members in the tests + assertEquals(emptyMap(), mostlyOkPT.createTagMap()); + assertEquals(emptyMap(), alwaysOkPT.createTagMap()); + } + + static Stream validateTracestateHeaderValidValueContentsArguments() { + return rangeClosed(' ', '~') + .filter(c -> c != ',' && c != '=') + .mapToObj(String::valueOf) + .map(Arguments::of); + } + + @ParameterizedTest + @MethodSource("validateTracestateHeaderInvalidValueContentsArguments") + void validateTracestateHeaderInvalidValueContents(String valueChar) { + String lcAlpha = toLowerCaseAlpha(valueChar); + String alwaysBadHeader = lcAlpha + "=" + lcAlpha + valueChar + lcAlpha; + + PropagationTags alwaysBadPT = factory().fromHeaderValue(W3C, alwaysBadHeader); + + assertNull(alwaysBadPT.headerValue(W3C)); + // we're not using any dd members in the tests + assertEquals(emptyMap(), alwaysBadPT.createTagMap()); + } + + static Stream validateTracestateHeaderInvalidValueContentsArguments() { + return rangeClosed(' ', 'ÿ') + .filter(W3CPropagationTagsTest::invalidValueChar) + .mapToObj(value -> String.valueOf((char) value)) + .map(Arguments::of); + } + + static boolean invalidValueChar(int i) { + if (i >= ' ' && i <= '~') { + return i == ',' || i == '='; + } + return true; + } + + @ParameterizedTest(name = "{0} members") + @MethodSource("memberCountArguments") + void validateTracestateHeaderNumberOfMembersWithoutDatadogMember(int memberCount) { + String header = buildHeader(memberCount); + + PropagationTags headerPT = factory().fromHeaderValue(W3C, header); + + if (memberCount <= 32) { + assertEquals(header, headerPT.headerValue(W3C)); + } else { + assertNull(headerPT.headerValue(W3C)); + } + // we're not using any dd members in the tests + assertEquals(emptyMap(), headerPT.createTagMap()); + } + + @ParameterizedTest(name = "{0} members") + @MethodSource("memberCountArguments") + void validateTracestateHeaderNumberOfMembersWithDatadogMember(int memberCount) { + String header = "dd=s:1," + buildHeader(memberCount); + + PropagationTags headerPT = factory().fromHeaderValue(W3C, header); + + if (memberCount + 1 <= 32) { + assertEquals(header, headerPT.headerValue(W3C)); + } else { + assertNull(headerPT.headerValue(W3C)); + } + // we're not using any dd members in the tests + assertEquals(emptyMap(), headerPT.createTagMap()); + } + + @ParameterizedTest(name = "{0} members") + @MethodSource("memberCountArguments") + void validateTracestateHeaderNumberOfMembersWhenPropagatingOriginalTracestate(int memberCount) { + String header = buildHeader(memberCount); + String expectedHeader = + "dd=t.dm:-4," + (memberCount > MAX_MEMBER_COUNT ? "" : buildHeader(min(memberCount, 31))); + + PropagationTags datadogHeaderPT = factory().fromHeaderValue(HeaderType.DATADOG, "_dd.p.dm=-4"); + PropagationTags headerPT = factory().fromHeaderValue(W3C, header); + datadogHeaderPT.updateW3CTracestate(headerPT.getW3CTracestate()); + + if (memberCount <= 32) { + assertEquals(expectedHeader, datadogHeaderPT.headerValue(W3C)); + } else { + assertEquals("dd=t.dm:-4", datadogHeaderPT.headerValue(W3C)); + } + assertEquals(singletonMap("_dd.p.dm", "-4"), datadogHeaderPT.createTagMap()); + } + + static IntStream memberCountArguments() { + return rangeClosed(1, 37); + } + + @TableTest({ + "scenario | headerValue | expectedHeaderValue | tags ", + "null | | | [:] ", + "empty | '' | | [:] ", + "dd only with dm | 'dd=s:0;t.dm:934086a686-4' | 'dd=s:0;t.dm:934086a686-4' | [_dd.p.dm: 934086a686-4] ", + "dd only with ts | 'dd=s:0;t.ts:02' | 'dd=s:0;t.ts:02' | [_dd.p.ts: 02] ", + "dd only with ts zero | 'dd=s:0;t.ts:00' | 'dd=s:0' | [:] ", + "dd only with dm and ts | 'dd=s:0;t.dm:934086a686-4;t.ts:02' | 'dd=s:0;t.dm:934086a686-4;t.ts:02' | [_dd.p.dm: 934086a686-4, _dd.p.ts: 02] ", + "other before dd | 'other=whatever,dd=s:0;t.dm:934086a686-4' | 'dd=s:0;t.dm:934086a686-4,other=whatever' | [_dd.p.dm: 934086a686-4] ", + "dd before other | 'dd=s:0;t.dm:934086a687-3,other=whatever' | 'dd=s:0;t.dm:934086a687-3,other=whatever' | [_dd.p.dm: 934086a687-3] ", + "some before dd before other | 'some=thing,dd=s:0;t.dm:934086a687-3,other=whatever' | 'dd=s:0;t.dm:934086a687-3,some=thing,other=whatever' | [_dd.p.dm: 934086a687-3] ", + "no dd | 'some=thing,other=whatever' | 'some=thing,other=whatever' | [:] ", + "dd with origin and dm | 'dd=s:0;o:some;t.dm:934086a686-4' | 'dd=s:0;o:some;t.dm:934086a686-4' | [_dd.p.dm: 934086a686-4] ", + "dd with unknown key | 'dd=s:0;x:unknown;t.dm:934086a686-4' | 'dd=s:0;t.dm:934086a686-4;x:unknown' | [_dd.p.dm: 934086a686-4] ", + "other before dd with unknown | 'other=whatever,dd=s:0;x:unknown;t.dm:934086a686-4' | 'dd=s:0;t.dm:934086a686-4;x:unknown,other=whatever' | [_dd.p.dm: 934086a686-4] ", + "dd with xyz instead of s | 'other=whatever,dd=xyz:unknown;t.dm:934086a686-4' | 'dd=t.dm:934086a686-4;xyz:unknown,other=whatever' | [_dd.p.dm: 934086a686-4] ", + "dd with trailing whitespace | 'other=whatever,dd=t.dm:934086a686-4;xyz:unknown ' | 'dd=t.dm:934086a686-4;xyz:unknown,other=whatever' | [_dd.p.dm: 934086a686-4] ", + "ws and tabs around members | '\tsome=thing \t , dd=s:0;t.dm:934086a687-3\t\t, other=whatever\t\t ' | 'dd=s:0;t.dm:934086a687-3,some=thing,other=whatever' | [_dd.p.dm: 934086a687-3] ", + "dd with two t. tags | 'dd=s:0;t.a:b;t.x:y' | 'dd=s:0;t.a:b;t.x:y' | [_dd.p.a: b, _dd.p.x: y] ", + "dd with two t. tags trailing whitespace | 'dd=s:0;t.a:b;t.x:y \t' | 'dd=s:0;t.a:b;t.x:y' | [_dd.p.a: b, _dd.p.x: y] ", + "dd with two t. tags inner whitespace | 'dd=s:0;t.a:b ;t.x:y \t' | 'dd=s:0;t.a:b ;t.x:y' | ['_dd.p.a': 'b ', _dd.p.x: y] ", + "dd with two t. tags invalid whitespace | 'dd=s:0;t.a:b \t;t.x:y \t' | | [:] ", + "dd with tid | 'dd=s:0;t.tid:123456789abcdef0' | 'dd=s:0;t.tid:123456789abcdef0' | [_dd.p.tid: 123456789abcdef0] ", + "tid empty value | 'dd=t.tid:' | | [:] ", + "tid too short length 1 | 'dd=t.tid:1' | | ['_dd.propagation_error': 'malformed_tid 1'] ", + "tid too short length 15 | 'dd=t.tid:111111111111111' | | ['_dd.propagation_error': 'malformed_tid 111111111111111'] ", + "tid too long length 17 | 'dd=t.tid:11111111111111111' | | ['_dd.propagation_error': 'malformed_tid 11111111111111111']", + "tid uppercase | 'dd=t.tid:123456789ABCDEF0' | | ['_dd.propagation_error': 'malformed_tid 123456789ABCDEF0'] ", + "tid non-hex character | 'dd=t.tid:123456789abcdefg' | | ['_dd.propagation_error': 'malformed_tid 123456789abcdefg'] ", + "tid negative | 'dd=t.tid:-123456789abcdef' | | ['_dd.propagation_error': 'malformed_tid -123456789abcdef'] " + }) + void createPropagationTagsFromHeaderValue( + String headerValue, String expectedHeaderValue, Map tags) { + PropagationTags propagationTags = factory().fromHeaderValue(W3C, headerValue); + + assertEquals(expectedHeaderValue, propagationTags.headerValue(W3C)); + assertEquals(tags, propagationTags.createTagMap()); + } + + @TableTest({ + "scenario | headerValue | expectedHeaderValue | tags ", + "single dm | 'dd=s:0;t.dm:934086a686-4' | '_dd.p.dm=934086a686-4' | [_dd.p.dm: 934086a686-4] ", + "dm and arbitrary t.f | 'other=whatever,dd=s:0;t.dm:934086a686-4;t.f:w00t~~' | '_dd.p.dm=934086a686-4,_dd.p.f=w00t==' | [_dd.p.dm: 934086a686-4, _dd.p.f: 'w00t=='] ", + "ts only | 'dd=s:0;t.ts:02' | '_dd.p.ts=02' | [_dd.p.ts: 02] ", + "ts zero | 'dd=s:0;t.ts:00' | | [:] ", + "ts too short | 'dd=s:0;t.ts:0' | | [:] ", + "ts invalid | 'dd=s:0;t.ts:invalid' | | [:] ", + "dm and t.f and ts | 'other=whatever,dd=s:0;t.dm:934086a686-4;t.f:w00t~~;t.ts:02' | '_dd.p.dm=934086a686-4,_dd.p.ts=02,_dd.p.f=w00t==' | [_dd.p.dm: 934086a686-4, _dd.p.f: 'w00t==', _dd.p.ts: 02]", + "no dd | 'some=thing,other=whatever' | | [:] " + }) + void w3cPropagationTagsShouldTranslateToDatadogTags( + String headerValue, String expectedHeaderValue, Map tags) { + PropagationTags propagationTags = factory().fromHeaderValue(W3C, headerValue); + + assertEquals(expectedHeaderValue, propagationTags.headerValue(HeaderType.DATADOG)); + assertEquals(tags, propagationTags.createTagMap()); + } + + @TableTest({ + "scenario | headerValue | priority | mechanism | origin | expectedHeaderValue | tags ", + "sampler keep default | 'dd=s:0;o:some;t.dm:934086a686-4' | SAMPLER_KEEP | SamplingMechanism.DEFAULT | other | 'dd=s:0;o:other;t.dm:934086a686-4' | [_dd.p.dm: 934086a686-4]", + "user keep local rule | 'dd=s:0;o:some;x:unknown' | USER_KEEP | SamplingMechanism.LOCAL_USER_RULE | same | 'dd=s:2;o:same;t.dm:-3;x:unknown' | [_dd.p.dm: '-3'] ", + "user drop manual | 'dd=s:0;o:some;x:unknown' | USER_DROP | SamplingMechanism.MANUAL | | 'dd=s:-1;x:unknown' | [:] ", + "keep external override | 'dd=s:0;o:some;t.dm:934086a686-4' | SAMPLER_KEEP | SamplingMechanism.EXTERNAL_OVERRIDE | other | 'dd=s:1;o:other;t.dm:-0' | [_dd.p.dm: '-0'] ", + "drop external override | 'dd=s:1;o:some;t.dm:934086a686-4' | SAMPLER_DROP | SamplingMechanism.EXTERNAL_OVERRIDE | other | 'dd=s:0;o:other' | [:] " + }) + void propagationTagsShouldBeUpdatedBySamplingAndOrigin( + String headerValue, + @ConvertWith(PrioritySamplingConverter.class) byte priority, + @ConvertWith(SamplingMechanismConverter.class) byte mechanism, + String origin, + String expectedHeaderValue, + Map tags) { + PropagationTags propagationTags = factory().fromHeaderValue(W3C, headerValue); + + assertNotEquals(expectedHeaderValue, propagationTags.headerValue(W3C)); + + propagationTags.updateTraceSamplingPriority(priority, mechanism); + propagationTags.updateTraceOrigin(origin); + + assertEquals(expectedHeaderValue, propagationTags.headerValue(W3C)); + assertEquals(tags, propagationTags.createTagMap()); + } + + @TableTest({ + "scenario | headerValue | product | expectedHeaderValue | tags ", + "asm on unknown | 'dd=x:unknown' | ProductTraceSource.ASM | 'dd=t.ts:02;x:unknown' | [_dd.p.ts: 02]", + "dbm on existing | 'dd=t.ts:02;x:unknown' | ProductTraceSource.DBM | 'dd=t.ts:12;x:unknown' | [_dd.p.ts: 12]", + "asm on ts zero | 'dd=t.ts:00' | ProductTraceSource.ASM | 'dd=t.ts:02' | [_dd.p.ts: 02]", + "asm on ts max | 'dd=t.ts:FFC00000' | ProductTraceSource.ASM | 'dd=t.ts:02' | [_dd.p.ts: 02]" + }) + void propagationTagsShouldBeUpdatedByProductTraceSourcePropagation( + String headerValue, + @ConvertWith(ProductTraceSourceConverter.class) int product, + String expectedHeaderValue, + Map tags) { + PropagationTags propagationTags = factory().fromHeaderValue(W3C, headerValue); + + assertNotEquals(expectedHeaderValue, propagationTags.headerValue(W3C)); + + propagationTags.addTraceSource(product); + + assertEquals(expectedHeaderValue, propagationTags.headerValue(W3C)); + assertEquals(tags, propagationTags.createTagMap()); + } + + private static String buildHeader(int memberCount) { + StringBuilder sb = new StringBuilder(); + for (int i = 1; i <= memberCount; i++) { + if (sb.length() > 0) sb.append(','); + sb.append('k').append(i).append("=v").append(i); + } + return sb.toString(); + } + + private static String repeat(String s, int n) { + StringBuilder sb = new StringBuilder(s.length() * n); + for (int i = 0; i < n; i++) sb.append(s); + return sb.toString(); + } + + private static String toLowerCaseAlpha(String cs) { + char c = cs.charAt(0); + char a = 'a'; + char z = 'z'; + return String.valueOf((char) (a + (Math.abs(c - a) % (z - a)))); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/XRayHttpExtractorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/XRayHttpExtractorTest.java new file mode 100644 index 00000000000..ac4566ce015 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/XRayHttpExtractorTest.java @@ -0,0 +1,175 @@ +package datadog.trace.core.propagation; + +import static datadog.trace.bootstrap.instrumentation.api.ContextVisitors.stringValuesMap; +import static datadog.trace.core.propagation.HttpCodecTestHelper.headers; +import static datadog.trace.core.propagation.XRayHttpCodec.X_AMZN_TRACE_ID; +import static java.util.Collections.singletonMap; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; + +import datadog.trace.api.Config; +import datadog.trace.api.DDSpanId; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.TraceConfig; +import datadog.trace.bootstrap.instrumentation.api.TagContext; +import datadog.trace.test.junit.utils.converter.PrioritySamplingConverter; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Supplier; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.converter.ConvertWith; +import org.tabletest.junit.TableTest; + +class XRayHttpExtractorTest extends AbstractHttpExtractorTest { + @Override + protected HttpCodec.Extractor newExtractor( + Config config, Supplier traceConfigSupplier) { + return XRayHttpCodec.newExtractor(config, traceConfigSupplier); + } + + @TableTest({ + "scenario | traceId | spanId | samplingPriority | expectedSamplingPriority", + "no sampling | 1 | 2 | '' | UNSET ", + "sampled 1 | 2 | 3 | ';Sampled=1' | SAMPLER_KEEP ", + "sampled 0 | 3 | 4 | ';Sampled=0' | SAMPLER_DROP ", + "max trace | ffffffffffffffff | fffffffffffffffe | ';Sampled=0' | SAMPLER_DROP ", + "max span | fffffffffffffffe | ffffffffffffffff | ';Sampled=1' | SAMPLER_KEEP " + }) + void extractHttpHeaders( + String traceId, + String spanId, + String samplingPriority, + @ConvertWith(PrioritySamplingConverter.class) byte expectedSamplingPriority) { + // spotless:off + Map headers = headers( + X_AMZN_TRACE_ID, "Root=1-00000000-00000000" + + XRayTestHelper.zeroPadId(traceId) + + ";Parent=" + + XRayTestHelper.zeroPadId(spanId) + + samplingPriority + + ";=empty key;empty value=;=;;", + SOME_HEADER, "my-interesting-info", + SOME_CUSTOM_BAGGAGE_HEADER, "my-interesting-baggage-info", + SOME_CUSTOM_BAGGAGE_HEADER_2,"my-interesting-baggage-info-2" + ); + // spotless:on + + ExtractedContext context = + (ExtractedContext) this.extractor.extract(headers, stringValuesMap()); + + assertEquals(DDTraceId.fromHex(traceId), context.getTraceId()); + assertEquals(DDSpanId.fromHex(spanId), context.getSpanId()); + Map expectedBaggage = new HashMap<>(); + expectedBaggage.put("empty value", ""); + expectedBaggage.put("some-baggage", "my-interesting-baggage-info"); + expectedBaggage.put("some-CaseSensitive-baggage", "my-interesting-baggage-info-2"); + assertEquals(expectedBaggage, context.getBaggage()); + assertEquals(singletonMap("some-tag", "my-interesting-info"), context.getTags()); + assertEquals(expectedSamplingPriority, context.getSamplingPriority()); + assertNull(context.getOrigin()); + } + + @Test + void extractHeaderTagsWithNoPropagation() { + Map headers = headers(SOME_HEADER, "my-interesting-info"); + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + assertFalse(context instanceof ExtractedContext); + assertEquals(singletonMap("some-tag", "my-interesting-info"), context.getTags()); + } + + @Test + void noContextWithInvalidNonNumericId() { + // spotless:off + Map headers = headers( + "x-amzn-trace-Id", "Root=1-00000000-00000000000000000traceId;Parent=0000000000spanId", + SOME_HEADER, "my-interesting-info" + ); + // spotless:on + + TagContext context = this.extractor.extract(headers, stringValuesMap()); + + assertNull(context); + } + + @Test + void noContextWithTooLargeTraceId() { + Map headers = + headers( + X_AMZN_TRACE_ID, "Root=1-5759e988-bd862e3fe1be46a994272793;Parent=53995c3f42cd8ad8"); + + TagContext context = extractor.extract(headers, stringValuesMap()); + + assertNull(context); + } + + @Test + void extractHttpHeadersWithNonZeroEpoch() { + Map headers = + headers( + X_AMZN_TRACE_ID, "Root=1-5759e988-00000000e1be46a994272793;Parent=53995c3f42cd8ad8"); + + TagContext context = extractor.extract(headers, stringValuesMap()); + + assertEquals(DDTraceId.fromHex("e1be46a994272793"), context.getTraceId()); + assertEquals(DDSpanId.fromHex("53995c3f42cd8ad8"), context.getSpanId()); + assertNull(context.getOrigin()); + } + + @TableTest({ + "scenario | traceId | spanId | expectedTraceIdHex | expectedSpanId ", + "short ids | 00001 | 00001 | 0000000000000001 | 1 ", + "long ids | 463ac35c9f6413ad | 463ac35c9f6413ad | 463ac35c9f6413ad | 5060571933882717101", + "long trace | 48485a3953bb6124 | 1 | 48485a3953bb6124 | 1 ", + "max trace | ffffffffffffffff | 1 | ffffffffffffffff | 1 ", + "max span | 1 | ffffffffffffffff | 0000000000000001 | -1 " + }) + void extractIdsWhileRetainingTheOriginalString( + String traceId, String spanId, String expectedTraceIdHex, long expectedSpanId) { + Map headers = + headers( + X_AMZN_TRACE_ID, + "Root=1-00000000-00000000" + + XRayTestHelper.zeroPadId(traceId) + + ";Parent=" + + XRayTestHelper.zeroPadId(spanId)); + + ExtractedContext context = (ExtractedContext) extractor.extract(headers, stringValuesMap()); + + assertEquals(DDTraceId.fromHex(expectedTraceIdHex), context.getTraceId()); + assertEquals(XRayTestHelper.zeroPadId(traceId), context.getTraceId().toHexStringPadded(16)); + assertEquals(expectedSpanId, context.getSpanId()); + assertEquals(XRayTestHelper.zeroPadId(spanId), DDSpanId.toHexStringPadded(context.getSpanId())); + } + + @TableTest({ + "scenario | traceId | spanId | endToEndStartTime", + "zero | 1 | 2 | 0 ", + "non-zero | 2 | 3 | 1610001234 " + }) + void extractHeadersWithEndToEnd(String traceId, String spanId, long endToEndStartTime) { + Map headers = + headers( + X_AMZN_TRACE_ID, + "Root=1-00000000-00000000" + + XRayTestHelper.zeroPadId(traceId) + + ";Parent=" + + XRayTestHelper.zeroPadId(spanId) + + ";k1=v1;t0=" + + endToEndStartTime + + ";k2=v2"); + + ExtractedContext context = + (ExtractedContext) this.extractor.extract(headers, stringValuesMap()); + + assertEquals(DDTraceId.from(traceId), context.getTraceId()); + assertEquals(DDSpanId.from(spanId), context.getSpanId()); + Map expectedBaggage = new HashMap<>(); + expectedBaggage.put("k1", "v1"); + expectedBaggage.put("k2", "v2"); + assertEquals(expectedBaggage, context.getBaggage()); + assertEquals(endToEndStartTime * 1_000_000L, context.getEndToEndStartTime()); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/XRayHttpInjectorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/XRayHttpInjectorTest.java new file mode 100644 index 00000000000..2c88f9e10fe --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/XRayHttpInjectorTest.java @@ -0,0 +1,130 @@ +package datadog.trace.core.propagation; + +import static datadog.trace.api.sampling.PrioritySampling.UNSET; +import static datadog.trace.bootstrap.instrumentation.api.ContextVisitors.stringValuesMap; +import static datadog.trace.core.propagation.HttpCodecTestHelper.headers; +import static datadog.trace.core.propagation.XRayHttpCodec.X_AMZN_TRACE_ID; +import static datadog.trace.core.propagation.XRayTestHelper.zeroPadId; +import static java.util.Collections.emptyMap; +import static java.util.Collections.singletonMap; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import datadog.trace.api.Config; +import datadog.trace.api.DDSpanId; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.DynamicConfig; +import datadog.trace.api.time.TimeSource; +import datadog.trace.bootstrap.instrumentation.api.TagContext; +import datadog.trace.core.CoreTracer.CoreTracerBuilder; +import datadog.trace.core.DDSpanContext; +import datadog.trace.core.datastreams.DataStreamsMonitoring; +import datadog.trace.test.junit.utils.converter.PrioritySamplingConverter; +import datadog.trace.test.junit.utils.converter.TraceIdConverter; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.converter.ConvertWith; +import org.tabletest.junit.TableTest; + +class XRayHttpInjectorTest extends AbstractHttpInjectorTest { + + @Override + protected CoreTracerBuilder tracerBuilder() { + TimeSource timeSource = mock(TimeSource.class); + when(timeSource.getCurrentTimeMillis()).thenReturn(1_664_906_869_196L); + when(timeSource.getCurrentTimeNanos()).thenReturn(1_664_906_869_196_787_813L); + when(timeSource.getNanoTicks()).thenReturn(1_664_906_869_196L); + return super.tracerBuilder() + .dataStreamsMonitoring(mock(DataStreamsMonitoring.class)) + .timeSource(timeSource); + } + + @Override + protected HttpCodec.Injector newInjector() { + return XRayHttpCodec.newInjector(singletonMap("some-baggage-key", "SOME_CUSTOM_HEADER")); + } + + @TableTest({ + "scenario | traceId | spanId | samplingPriority | expectedTraceHeader ", + "unset 1->2 | 1 | 2 | UNSET | 'Root=1-633c7675-000000000000000000000001;Parent=0000000000000002;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v' ", + "keep 2->3 | 2 | 3 | SAMPLER_KEEP | 'Root=1-633c7675-000000000000000000000002;Parent=0000000000000003;Sampled=1;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v'", + "drop 4->5 | 4 | 5 | SAMPLER_DROP | 'Root=1-633c7675-000000000000000000000004;Parent=0000000000000005;Sampled=0;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v'", + "user keep 5->6 | 5 | 6 | USER_KEEP | 'Root=1-633c7675-000000000000000000000005;Parent=0000000000000006;Sampled=1;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v'", + "user drop 6->7 | 6 | 7 | USER_DROP | 'Root=1-633c7675-000000000000000000000006;Parent=0000000000000007;Sampled=0;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v'", + "unset max->max-1 | MAX | MAX-1 | UNSET | 'Root=1-633c7675-00000000ffffffffffffffff;Parent=fffffffffffffffe;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v' ", + "keep max-1->max | MAX-1 | MAX | SAMPLER_KEEP | 'Root=1-633c7675-00000000fffffffffffffffe;Parent=ffffffffffffffff;Sampled=1;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v'" + }) + void injectHttpHeaders( + @ConvertWith(TraceIdConverter.class) String traceId, + @ConvertWith(TraceIdConverter.class) String spanId, + @ConvertWith(PrioritySamplingConverter.class) byte samplingPriority, + String expectedTraceHeader) { + Map baggage = new HashMap<>(); + baggage.put("k", "v"); + baggage.put("some-baggage-key", "some-value"); + DDSpanContext spanContext = + createContext(DDTraceId.from(traceId), DDSpanId.from(spanId), samplingPriority, baggage); + Map carrier = new HashMap<>(); + + this.injector.inject(spanContext, carrier, Map::put); + + assertEquals(1, carrier.size()); + assertEquals(expectedTraceHeader, carrier.get(X_AMZN_TRACE_ID)); + } + + @TableTest({ + "scenario | traceId | spanId | expectedTraceHeader ", + "short ids | 00001 | 00001 | 'Root=1-633c7675-000000000000000000000001;Parent=0000000000000001;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v'", + "long ids same | 463ac35c9f6413ad | 463ac35c9f6413ad | 'Root=1-633c7675-00000000463ac35c9f6413ad;Parent=463ac35c9f6413ad;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v'", + "long trace | 48485a3953bb6124 | 1 | 'Root=1-633c7675-0000000048485a3953bb6124;Parent=0000000000000001;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v'", + "max trace id | ffffffffffffffff | 1 | 'Root=1-633c7675-00000000ffffffffffffffff;Parent=0000000000000001;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v'", + "mixed trace id | aaaaaaaaffffffff | 1 | 'Root=1-633c7675-00000000aaaaaaaaffffffff;Parent=0000000000000001;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v'", + "max span id | 1 | ffffffffffffffff | 'Root=1-633c7675-000000000000000000000001;Parent=ffffffffffffffff;_dd.origin=fakeOrigin;SOME_CUSTOM_HEADER=some-value;k=v'" + }) + void injectHttpHeadersWithExtractedOriginal( + String traceId, String spanId, String expectedTraceHeader) { + // spotless:off + Map headers = headers( + X_AMZN_TRACE_ID, "Root=1-00000000-00000000" + zeroPadId(traceId) + ";Parent=" + zeroPadId(spanId) + ); + // spotless:on + DynamicConfig dynamicConfig = + DynamicConfig.create().setHeaderTags(emptyMap()).setBaggageMapping(emptyMap()).apply(); + HttpCodec.Extractor extractor = + XRayHttpCodec.newExtractor(Config.get(), dynamicConfig::captureTraceConfig); + TagContext context = extractor.extract(headers, stringValuesMap()); + Map baggage = new HashMap<>(); + baggage.put("k", "v"); + baggage.put("some-baggage-key", "some-value"); + DDSpanContext spanContext = + createContext(context.getTraceId(), context.getSpanId(), UNSET, baggage); + Map carrier = new HashMap<>(); + + this.injector.inject(spanContext, carrier, Map::put); + + assertEquals(1, carrier.size()); + assertEquals(expectedTraceHeader, carrier.get(X_AMZN_TRACE_ID)); + } + + @Test + void injectHttpHeadersWithEndToEnd() { + DDSpanContext spanContext = + createContext(DDTraceId.from("1"), DDSpanId.from("2"), UNSET, singletonMap("k", "v")); + spanContext.beginEndToEnd(); + Map carrier = new HashMap<>(); + + this.injector.inject(spanContext, carrier, Map::put); + + String expectedTraceHeader = + "Root=1-633c7675-000000000000000000000001;Parent=0000000000000002;_dd.origin=fakeOrigin;t0=1664906869196;k=v"; + assertEquals(1, carrier.size()); + assertEquals(expectedTraceHeader, carrier.get(X_AMZN_TRACE_ID)); + } + + private DDSpanContext createContext( + DDTraceId traceId, long spanId, int samplingPriority, Map baggage) { + return mockSpanContext(traceId, spanId, samplingPriority, "fakeOrigin", baggage, null); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/XRayTestHelper.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/XRayTestHelper.java new file mode 100644 index 00000000000..d8325552f43 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/XRayTestHelper.java @@ -0,0 +1,15 @@ +package datadog.trace.core.propagation; + +public class XRayTestHelper { + static String zeroPadId(String s) { + if (s.length() >= 16) { + return s; + } + StringBuilder sb = new StringBuilder(16); + for (int i = 0; i < 16 - s.length(); i++) { + sb.append('0'); + } + sb.append(s); + return sb.toString(); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/opg/OpmStampingInjectorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/opg/OpmStampingInjectorTest.java new file mode 100644 index 00000000000..a614cc43783 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/opg/OpmStampingInjectorTest.java @@ -0,0 +1,110 @@ +package datadog.trace.core.propagation.opg; + +import static datadog.trace.core.propagation.PropagationTags.HeaderType.DATADOG; +import static datadog.trace.core.propagation.PropagationTags.HeaderType.W3C; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import datadog.context.propagation.CarrierSetter; +import datadog.trace.core.DDSpanContext; +import datadog.trace.core.propagation.HttpCodec; +import datadog.trace.core.propagation.PropagationTags; +import java.util.HashMap; +import java.util.Map; +import java.util.function.Supplier; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +@DisplayName("OpmStampingInjector") +class OpmStampingInjectorTest { + @Test + @DisplayName("stamps the local OPM into PropagationTags before delegating") + void stampsLocalOpm() { + PropagationTags.Factory factory = PropagationTags.factory(); + PropagationTags tags = factory.fromHeaderValue(W3C, ""); + + DDSpanContext ctx = mock(DDSpanContext.class); + when(ctx.getPropagationTags()).thenReturn(tags); + + HttpCodec.Injector delegate = new NoopInjector(); + Supplier supplier = () -> "local-opm-1"; + OpmStampingInjector wrapped = new OpmStampingInjector(delegate, supplier); + + Map carrier = new HashMap<>(); + wrapped.inject(ctx, carrier, Map::put); + + assertNotNull(tags.getOrgPropagationMarker()); + assertEquals("local-opm-1", tags.getOrgPropagationMarker().toString()); + } + + @Test + @DisplayName("with null supplier value, leaves PropagationTags untouched") + void supplierNullLeavesTagsUntouched() { + PropagationTags.Factory factory = PropagationTags.factory(); + PropagationTags tags = factory.fromHeaderValue(DATADOG, "_dd.p.opm=upstream-abc"); + + DDSpanContext ctx = mock(DDSpanContext.class); + when(ctx.getPropagationTags()).thenReturn(tags); + + HttpCodec.Injector delegate = new NoopInjector(); + OpmStampingInjector wrapped = new OpmStampingInjector(delegate, () -> null); + + Map carrier = new HashMap<>(); + wrapped.inject(ctx, carrier, Map::put); + + assertNotNull(tags.getOrgPropagationMarker()); + assertEquals("upstream-abc", tags.getOrgPropagationMarker().toString()); + } + + @Test + @DisplayName("local supplier value overrides any inherited OPM") + void localOpmOverridesInherited() { + PropagationTags.Factory factory = PropagationTags.factory(); + PropagationTags tags = factory.fromHeaderValue(DATADOG, "_dd.p.opm=upstream-abc"); + + DDSpanContext ctx = mock(DDSpanContext.class); + when(ctx.getPropagationTags()).thenReturn(tags); + + HttpCodec.Injector delegate = new NoopInjector(); + OpmStampingInjector wrapped = new OpmStampingInjector(delegate, () -> "local-xyz"); + + Map carrier = new HashMap<>(); + wrapped.inject(ctx, carrier, Map::put); + + assertEquals("local-xyz", tags.getOrgPropagationMarker().toString()); + } + + @Test + @DisplayName("delegate is invoked exactly once per inject call") + void delegateInvoked() { + PropagationTags.Factory factory = PropagationTags.factory(); + PropagationTags tags = factory.empty(); + + DDSpanContext ctx = mock(DDSpanContext.class); + when(ctx.getPropagationTags()).thenReturn(tags); + + CountingInjector delegate = new CountingInjector(); + OpmStampingInjector wrapped = new OpmStampingInjector(delegate, () -> null); + + wrapped.inject(ctx, new HashMap<>(), Map::put); + assertEquals(1, delegate.calls); + assertNull(tags.getOrgPropagationMarker()); + } + + private static final class NoopInjector implements HttpCodec.Injector { + @Override + public void inject(DDSpanContext context, C carrier, CarrierSetter setter) {} + } + + private static final class CountingInjector implements HttpCodec.Injector { + int calls = 0; + + @Override + public void inject(DDSpanContext context, C carrier, CarrierSetter setter) { + calls++; + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/opg/OrgGuardEnforcerTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/opg/OrgGuardEnforcerTest.java new file mode 100644 index 00000000000..65d7ee271d4 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/opg/OrgGuardEnforcerTest.java @@ -0,0 +1,186 @@ +package datadog.trace.core.propagation.opg; + +import static datadog.trace.api.TracePropagationStyle.DATADOG; +import static datadog.trace.api.sampling.PrioritySampling.SAMPLER_KEEP; +import static datadog.trace.api.sampling.PrioritySampling.UNSET; +import static datadog.trace.api.sampling.SamplingMechanism.MANUAL; +import static datadog.trace.core.propagation.PropagationTags.HeaderType.W3C; +import static java.util.Collections.emptySet; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + +import datadog.trace.api.DDTraceId; +import datadog.trace.api.TracePropagationStyle; +import datadog.trace.bootstrap.instrumentation.api.TagContext; +import datadog.trace.core.monitor.HealthMetrics; +import datadog.trace.core.propagation.ExtractedContext; +import datadog.trace.core.propagation.PropagationTags; +import java.util.HashSet; +import java.util.Set; +import java.util.function.Supplier; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +@DisplayName("OrgGuardEnforcer truth table") +class OrgGuardEnforcerTest { + + private PropagationTags.Factory factory; + private HealthMetrics healthMetrics; + + @BeforeEach + void setUp() { + factory = PropagationTags.factory(); + healthMetrics = mock(HealthMetrics.class); + } + + @Test + @DisplayName("local OPM unknown -> no enforcement") + void localUnknown() { + OrgGuardEnforcer enforcer = enforcer(false, emptySet(), () -> null); + ExtractedContext ctx = ctxWithOpm("X"); + assertSame(ctx, enforcer.enforce(ctx)); + verify(healthMetrics, never()).onOrgGuardEnforce(any(OrgGuard.Reason.class)); + } + + @Test + @DisplayName("lax: inbound OPM missing -> no enforcement") + void laxInboundMissing() { + OrgGuardEnforcer enforcer = enforcer(false, emptySet(), () -> "L"); + ExtractedContext ctx = ctxWithOpm(null); + assertSame(ctx, enforcer.enforce(ctx)); + verify(healthMetrics, never()).onOrgGuardEnforce(any(OrgGuard.Reason.class)); + } + + @Test + @DisplayName("strict: inbound OPM missing -> strip with strict_missing") + void strictInboundMissing() { + OrgGuardEnforcer enforcer = enforcer(true, emptySet(), () -> "L"); + ExtractedContext ctx = ctxWithOpm(null, /*samplingPriority*/ 2, "synthetics"); + TagContext result = enforcer.enforce(ctx); + assertNotSame(ctx, result); + assertStripped((ExtractedContext) result, ctx); + verify(healthMetrics, times(1)).onOrgGuardEnforce(OrgGuard.Reason.STRICT_MISSING); + } + + @Test + @DisplayName("inbound OPM matches local -> no enforcement") + void match() { + OrgGuardEnforcer enforcer = enforcer(false, emptySet(), () -> "L"); + ExtractedContext ctx = ctxWithOpm("L"); + assertSame(ctx, enforcer.enforce(ctx)); + verify(healthMetrics, never()).onOrgGuardEnforce(any(OrgGuard.Reason.class)); + } + + @Test + @DisplayName("inbound OPM is in trusted list -> no enforcement") + void trusted() { + Set trusted = new HashSet<>(); + trusted.add("X"); + trusted.add("Y"); + OrgGuardEnforcer enforcer = enforcer(false, trusted, () -> "L"); + ExtractedContext ctx = ctxWithOpm("X"); + assertSame(ctx, enforcer.enforce(ctx)); + verify(healthMetrics, never()).onOrgGuardEnforce(any(OrgGuard.Reason.class)); + } + + @Test + @DisplayName("lax: inbound != local -> strip with mismatch") + void mismatchLax() { + OrgGuardEnforcer enforcer = enforcer(false, emptySet(), () -> "L"); + ExtractedContext ctx = ctxWithOpm("X", 2, "synthetics"); + TagContext result = enforcer.enforce(ctx); + assertNotSame(ctx, result); + assertStripped((ExtractedContext) result, ctx); + verify(healthMetrics, times(1)).onOrgGuardEnforce(OrgGuard.Reason.MISMATCH); + } + + @Test + @DisplayName("strict: inbound != local -> strip with mismatch") + void mismatchStrict() { + OrgGuardEnforcer enforcer = enforcer(true, emptySet(), () -> "L"); + ExtractedContext ctx = ctxWithOpm("X", 2, "synthetics"); + TagContext result = enforcer.enforce(ctx); + assertNotSame(ctx, result); + assertStripped((ExtractedContext) result, ctx); + verify(healthMetrics, times(1)).onOrgGuardEnforce(OrgGuard.Reason.MISMATCH); + } + + @Test + @DisplayName("partial TagContext (not ExtractedContext) -> always pass through") + void partialContext() { + OrgGuardEnforcer enforcer = enforcer(true, emptySet(), () -> "L"); + TagContext partial = new TagContext("upstream", null); + assertSame(partial, enforcer.enforce(partial)); + verify(healthMetrics, never()).onOrgGuardEnforce(any(OrgGuard.Reason.class)); + } + + @Test + @DisplayName("null input is passed through") + void nullInput() { + OrgGuardEnforcer enforcer = enforcer(true, emptySet(), () -> "L"); + assertNull(enforcer.enforce(null)); + verify(healthMetrics, never()).onOrgGuardEnforce(any(OrgGuard.Reason.class)); + } + + @Test + @DisplayName("strip preserves W3C non-dd vendor tracestate sections") + void stripPreservesNonDdVendors() { + OrgGuardEnforcer enforcer = enforcer(false, emptySet(), () -> "L"); + PropagationTags tags = + factory.fromHeaderValue(W3C, "dd=s:1;o:foo;t.opm:upstream-X,vendor1=abc,vendor2=def"); + ExtractedContext ctx = + new ExtractedContext( + DDTraceId.from(123L), 456L, 2, "origin", tags, TracePropagationStyle.TRACECONTEXT); + TagContext result = enforcer.enforce(ctx); + assertNotSame(ctx, result); + ExtractedContext stripped = (ExtractedContext) result; + String reEncoded = stripped.getPropagationTags().headerValue(W3C); + assertNotNull(reEncoded); + assertFalse(reEncoded.contains("dd="), "dd= should be dropped: " + reEncoded); + assertTrue(reEncoded.contains("vendor1=abc"), "vendor1 missing: " + reEncoded); + assertTrue(reEncoded.contains("vendor2=def"), "vendor2 missing: " + reEncoded); + } + + // ---- helpers ---- + + private OrgGuardEnforcer enforcer( + boolean strict, Set trusted, Supplier localOpmSupplier) { + return new OrgGuardEnforcer(strict, trusted, localOpmSupplier, factory, healthMetrics); + } + + private ExtractedContext ctxWithOpm(String opm) { + return ctxWithOpm(opm, SAMPLER_KEEP, "origin"); + } + + private ExtractedContext ctxWithOpm(String opm, int samplingPriority, String origin) { + PropagationTags tags = factory.empty(); + if (opm != null) { + tags.updateOrgPropagationMarker(opm); + } + tags.updateTraceSamplingPriority(samplingPriority, MANUAL); + tags.updateTraceOrigin(origin); + return new ExtractedContext( + DDTraceId.from(123L), 456L, samplingPriority, origin, tags, DATADOG); + } + + private static void assertStripped(ExtractedContext stripped, ExtractedContext original) { + assertEquals(original.getTraceId(), stripped.getTraceId()); + assertEquals(original.getSpanId(), stripped.getSpanId()); + assertEquals(UNSET, stripped.getSamplingPriority()); + assertNull(stripped.getOrigin()); + assertNull(stripped.getPropagationTags().getOrgPropagationMarker()); + assertNull(stripped.getPropagationTags().getOrigin()); + assertEquals(UNSET, stripped.getPropagationTags().getSamplingPriority()); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/opg/OrgGuardTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/opg/OrgGuardTest.java new file mode 100644 index 00000000000..f8521e34fdf --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/opg/OrgGuardTest.java @@ -0,0 +1,56 @@ +package datadog.trace.core.propagation.opg; + +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.mockito.Mockito.RETURNS_DEFAULTS; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import datadog.trace.api.Config; +import datadog.trace.core.monitor.HealthMetrics; +import datadog.trace.core.propagation.HttpCodec; +import datadog.trace.core.propagation.PropagationTags; +import java.util.Collections; +import java.util.function.Supplier; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +@DisplayName("OrgGuard factory gating") +class OrgGuardTest { + + private static final Supplier LOCAL_OPM = () -> "L"; + + @Test + @DisplayName("disabled: decorate methods return the input unchanged") + void disabledIsZeroCost() { + Config config = mock(Config.class, RETURNS_DEFAULTS); + when(config.isTraceOrgGuardEnabled()).thenReturn(false); + + OrgGuard orgGuard = + OrgGuard.create(config, LOCAL_OPM, PropagationTags.factory(), mock(HealthMetrics.class)); + + HttpCodec.Extractor extractor = mock(HttpCodec.Extractor.class); + HttpCodec.Injector injector = mock(HttpCodec.Injector.class); + + assertSame(extractor, orgGuard.decorateExtractor(extractor)); + assertSame(injector, orgGuard.decorateInjector(injector)); + } + + @Test + @DisplayName("enabled: decorate methods wrap with the OPG decorators") + void enabledWrapsBothSides() { + Config config = mock(Config.class, RETURNS_DEFAULTS); + when(config.isTraceOrgGuardEnabled()).thenReturn(true); + when(config.isTraceOrgGuardStrict()).thenReturn(false); + when(config.getTraceOrgGuardTrustedOpms()).thenReturn(Collections.emptySet()); + + OrgGuard orgGuard = + OrgGuard.create(config, LOCAL_OPM, PropagationTags.factory(), mock(HealthMetrics.class)); + + HttpCodec.Extractor extractor = mock(HttpCodec.Extractor.class); + HttpCodec.Injector injector = mock(HttpCodec.Injector.class); + + assertInstanceOf(OrgGuardEnforcingExtractor.class, orgGuard.decorateExtractor(extractor)); + assertInstanceOf(OpmStampingInjector.class, orgGuard.decorateInjector(injector)); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/ptags/TagKeyTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/ptags/TagKeyTest.java new file mode 100644 index 00000000000..aaa08648799 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/ptags/TagKeyTest.java @@ -0,0 +1,74 @@ +package datadog.trace.core.propagation.ptags; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertSame; + +import datadog.trace.core.propagation.ptags.TagElement.Encoding; +import org.tabletest.junit.TableTest; + +class TagKeyTest { + @TableTest({ + "scenario | seq1 | enc1 | seq2 | enc2 | same ", + "DD/DD same | '_dd.p.foo1' | DATADOG | '_dd.p.foo1' | DATADOG | true ", + "W3C/W3C same | 't.foo2' | W3C | 't.foo2' | W3C | true ", + "DD/W3C same | '_dd.p.foo3' | DATADOG | 't.foo3' | W3C | true ", + "W3C/DD same | 't.foo4' | W3C | '_dd.p.foo4' | DATADOG | true ", + "W3C ~ != DD = | 't.foo5~' | W3C | '_dd.p.foo5=' | DATADOG | false", + "DD ~ == W3C ~ | '_dd.p.foo6~' | DATADOG | 't.foo6~' | W3C | true ", + "DD ~ != W3C = | '_dd.p.foo7~' | DATADOG | 't.foo7=' | W3C | false", + "diff suffixes | '_dd.p.foo81' | DATADOG | 't.foo82' | W3C | false" + }) + void tagKeysShouldUseCachedValuesWhenAppropriate( + String seq1, Encoding enc1, String seq2, Encoding enc2, boolean same) { + TagKey tk1 = TagKey.from(enc1, seq1); + TagKey tk2 = TagKey.from(enc2, seq2); + + assertNotNull(tk1); + assertNotNull(tk2); + assertEquals(seq1, tk1.forType(enc1)); + assertEquals(seq2, tk2.forType(enc2)); + if (same) { + assertSame(tk1, tk2); + assertEquals(seq2, tk1.forType(enc2)); + } else { + assertNotSame(tk1, tk2); + } + } + + @TableTest({ + "scenario | seq1 | enc1 | s1 | e1 | seq2 | enc2 | s2 | e2 | same ", + "DD/DD sub | 'bb_dd.p.bar1' | DATADOG | 2 | 12 | 'r_dd.p.bar1r' | DATADOG | 1 | 11 | true ", + "W3C/DD sub | 't.bar2ss' | W3C | 0 | 6 | 't_dd.p.bar2t' | DATADOG | 1 | 11 | true ", + "W3C ~ != DD = | 't.bar3~s' | W3C | 0 | 7 | 't_dd.p.bar3=' | DATADOG | 1 | 12 | false", + "W3C/W3C ~ sub | 't.bar4~s' | W3C | 0 | 7 | 'tt.bar4~' | W3C | 1 | 8 | true ", + "DD = != W3C ~ | 's_dd.p.bar5=' | DATADOG | 1 | 12 | 't.bar5~t' | W3C | 0 | 7 | false" + }) + void tagKeysShouldUseCachedValuesFromSubSequences( + String seq1, + Encoding enc1, + int s1, + int e1, + String seq2, + Encoding enc2, + int s2, + int e2, + boolean same) { + TagKey tk1 = TagKey.from(enc1, seq1, s1, e1); + String sub1 = seq1.substring(s1, e1); + TagKey tk2 = TagKey.from(enc2, seq2, s2, e2); + String sub2 = seq2.substring(s2, e2); + + assertNotNull(tk1); + assertNotNull(tk2); + assertEquals(sub1, tk1.forType(enc1)); + assertEquals(sub2, tk2.forType(enc2)); + if (same) { + assertSame(tk1, tk2); + assertEquals(sub2, tk1.forType(enc2)); + } else { + assertNotSame(tk1, tk2); + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/propagation/ptags/TagValueTest.java b/dd-trace-core/src/test/java/datadog/trace/core/propagation/ptags/TagValueTest.java new file mode 100644 index 00000000000..e1640ab332c --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/propagation/ptags/TagValueTest.java @@ -0,0 +1,77 @@ +package datadog.trace.core.propagation.ptags; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertSame; + +import datadog.trace.core.propagation.ptags.TagElement.Encoding; +import org.tabletest.junit.TableTest; + +class TagValueTest { + @TableTest({ + "scenario | seq1 | enc1 | seq2 | enc2 | same ", + "DD/DD same | 'foo1' | DATADOG | 'foo1' | DATADOG | true ", + "W3C/W3C same | 'foo2' | W3C | 'foo2' | W3C | true ", + "DD/W3C same | 'foo3' | DATADOG | 'foo3' | W3C | true ", + "W3C/DD same | 'foo4' | W3C | 'foo4' | DATADOG | true ", + "W3C ~ == DD = | 'foo5~' | W3C | 'foo5=' | DATADOG | true ", + "DD = == W3C ~ | 'foo6=' | DATADOG | 'foo6~' | W3C | true ", + "DD ~ != W3C ~ | 'foo7~' | DATADOG | 'foo7~' | W3C | false", + "diff suffixes | 'foo81' | DATADOG | 'foo82' | W3C | false", + "DD ; != W3C _ | 'foo9;' | DATADOG | 'foo9_' | W3C | false" + }) + void tagValuesShouldUseCachedValuesWhenAppropriate( + String seq1, Encoding enc1, String seq2, Encoding enc2, boolean same) { + TagValue tv1 = TagValue.from(enc1, seq1); + TagValue tv2 = TagValue.from(enc2, seq2); + + assertNotNull(tv1); + assertNotNull(tv2); + assertEquals(seq1, tv1.forType(enc1)); + assertEquals(seq2, tv2.forType(enc2)); + if (same) { + assertSame(tv1, tv2); + assertEquals(seq2, tv1.forType(enc2)); + } else { + assertNotSame(tv1, tv2); + } + } + + @TableTest({ + "scenario | seq1 | enc1 | s1 | e1 | seq2 | enc2 | s2 | e2 | same ", + "DD/DD same sub | 'bbbar1' | DATADOG | 2 | 6 | 'rbar1r' | DATADOG | 1 | 5 | true ", + "W3C/DD same sub | 'bar2ss' | W3C | 0 | 4 | 'tbar2t' | DATADOG | 1 | 5 | true ", + "W3C ~ == DD = sub | 'bar3~s' | W3C | 0 | 5 | 'tbar3=' | DATADOG | 1 | 6 | true ", + "W3C/W3C ~ sub | 'bar4~s' | W3C | 0 | 5 | 'tbar4~' | W3C | 1 | 6 | true ", + "DD = == W3C ~ sub | 'sbar5=' | DATADOG | 1 | 6 | 'bar5~t' | W3C | 0 | 5 | true ", + "DD ? != W3C ! sub | 'sbar6?' | DATADOG | 1 | 6 | 'bar5!t' | W3C | 0 | 5 | false", + "DD , != W3C _ sub | 'sbar6,' | DATADOG | 1 | 6 | 'bar6_t' | W3C | 0 | 5 | false" + }) + void tagValuesShouldUseCachedValuesFromSubSequences( + String seq1, + Encoding enc1, + int s1, + int e1, + String seq2, + Encoding enc2, + int s2, + int e2, + boolean same) { + TagValue tv1 = TagValue.from(enc1, seq1, s1, e1); + String sub1 = seq1.substring(s1, e1); + TagValue tv2 = TagValue.from(enc2, seq2, s2, e2); + String sub2 = seq2.substring(s2, e2); + + assertNotNull(tv1); + assertNotNull(tv2); + assertEquals(sub1, tv1.forType(enc1)); + assertEquals(sub2, tv2.forType(enc2)); + if (same) { + assertSame(tv1, tv2); + assertEquals(sub2, tv1.forType(enc2)); + } else { + assertNotSame(tv1, tv2); + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/scopemanager/IterationSpansForkedTest.java b/dd-trace-core/src/test/java/datadog/trace/core/scopemanager/IterationSpansForkedTest.java new file mode 100644 index 00000000000..576864a43e5 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/scopemanager/IterationSpansForkedTest.java @@ -0,0 +1,199 @@ +package datadog.trace.core.scopemanager; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.mock; + +import datadog.metrics.api.statsd.StatsDClient; +import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.common.writer.ListWriter; +import datadog.trace.core.CoreTracer; +import datadog.trace.core.DDCoreJavaSpecification; +import datadog.trace.core.DDSpan; +import datadog.trace.test.junit.utils.config.WithConfig; +import java.util.Comparator; +import java.util.List; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +@WithConfig(key = "trace.scope.iteration.keep.alive", value = "1") +class IterationSpansForkedTest extends DDCoreJavaSpecification { + + ListWriter writer; + CoreTracer tracer; + StatsDClient statsDClient; + + @BeforeEach + void setup() { + writer = new ListWriter(); + statsDClient = mock(StatsDClient.class); + tracer = tracerBuilder().writer(writer).statsDClient(statsDClient).build(); + } + + @AfterEach + void cleanup() throws Exception { + tracer.close(); + } + + @Test + void rootIterationScopeLifecycle() throws Exception { + tracer.closePrevious(true); + AgentSpan span1 = tracer.buildSpan("datadog", "next1").start(); + AgentScope scope1 = tracer.activateNext(span1); + + assertTrue(writer.isEmpty()); + assertSame(span1, scope1.span()); + assertSame(span1, tracer.activeSpan()); + assertFalse(spanFinished(span1)); + + tracer.closePrevious(true); + AgentSpan span2 = tracer.buildSpan("datadog", "next2").start(); + AgentScope scope2 = tracer.activateNext(span2); + + assertTrue(spanFinished(span1)); + assertEquals(1, writer.size()); + assertSame(span1, writer.get(0).get(0)); + assertSame(span2, scope2.span()); + assertSame(span2, tracer.activeSpan()); + assertFalse(spanFinished(span2)); + + tracer.closePrevious(true); + AgentSpan span3 = tracer.buildSpan("datadog", "next3").start(); + AgentScope scope3 = tracer.activateNext(span3); + writer.waitForTraces(2); + + assertTrue(spanFinished(span2)); + assertEquals(2, writer.size()); + assertSame(span3, scope3.span()); + assertSame(span3, tracer.activeSpan()); + assertFalse(spanFinished(span3)); + + // 'next3' should time out & finish after 1s + writer.waitForTraces(3); + + assertTrue(spanFinished(span3)); + assertEquals(3, writer.size()); + assertNull(tracer.activeSpan()); + } + + @Test + void nonRootIterationScopeLifecycle() throws Exception { + AgentSpan span0 = tracer.buildSpan("datadog", "parent").start(); + AgentScope scope0 = tracer.activateSpan(span0); + + tracer.closePrevious(true); + AgentSpan span1 = tracer.buildSpan("datadog", "next1").start(); + AgentScope scope1 = tracer.activateNext(span1); + + assertTrue(writer.isEmpty()); + assertSame(span1, scope1.span()); + assertSame(span1, tracer.activeSpan()); + assertFalse(spanFinished(span1)); + + tracer.closePrevious(true); + AgentSpan span2 = tracer.buildSpan("datadog", "next2").start(); + AgentScope scope2 = tracer.activateNext(span2); + + assertTrue(spanFinished(span1)); + assertTrue(writer.isEmpty()); + assertSame(span2, scope2.span()); + assertSame(span2, tracer.activeSpan()); + assertFalse(spanFinished(span2)); + + tracer.closePrevious(true); + AgentSpan span3 = tracer.buildSpan("datadog", "next3").start(); + AgentScope scope3 = tracer.activateNext(span3); + + assertTrue(spanFinished(span2)); + assertTrue(writer.isEmpty()); + assertSame(span3, scope3.span()); + assertSame(span3, tracer.activeSpan()); + assertFalse(spanFinished(span3)); + + scope0.close(); + span0.finish(); + // closing the parent scope will close & finish 'next3' + writer.waitForTraces(1); + + assertTrue(spanFinished(span3)); + assertTrue(spanFinished(span0)); + sortSpansByStart(); + List trace = writer.get(0); + assertEquals(4, trace.size()); + assertSame(span0, trace.get(0)); + assertSame(span1, trace.get(1)); + assertSame(span2, trace.get(2)); + assertSame(span3, trace.get(3)); + assertNull(tracer.activeSpan()); + } + + @Test + void nestedIterationScopeLifecycle() throws Exception { + tracer.closePrevious(true); + AgentSpan span1 = tracer.buildSpan("datadog", "next").start(); + AgentScope scope1 = tracer.activateNext(span1); + + assertTrue(writer.isEmpty()); + assertSame(span1, scope1.span()); + assertSame(span1, tracer.activeSpan()); + assertFalse(spanFinished(span1)); + + AgentSpan span1A = tracer.buildSpan("datadog", "method").start(); + AgentScope scope1A = tracer.activateSpan(span1A); + + tracer.closePrevious(true); + AgentSpan span1A1 = tracer.buildSpan("datadog", "next").start(); + AgentScope scope1A1 = tracer.activateNext(span1A1); + + assertFalse(spanFinished(span1)); + assertTrue(writer.isEmpty()); + assertSame(span1A1, scope1A1.span()); + assertSame(span1A1, tracer.activeSpan()); + assertFalse(spanFinished(span1A1)); + + tracer.closePrevious(true); + AgentSpan span1A2 = tracer.buildSpan("datadog", "next").start(); + AgentScope scope1A2 = tracer.activateNext(span1A2); + + assertTrue(spanFinished(span1A1)); + assertTrue(writer.isEmpty()); + assertSame(span1A2, scope1A2.span()); + assertSame(span1A2, tracer.activeSpan()); + assertFalse(spanFinished(span1A2)); + + // closing the intervening scope will close & finish 'next1A2' + scope1A.close(); + span1A.finish(); + + assertTrue(spanFinished(span1A2)); + assertTrue(spanFinished(span1A)); + assertFalse(spanFinished(span1)); + assertTrue(writer.isEmpty()); + + // 'next1' should time out & finish after 1s to complete the trace + writer.waitForTraces(1); + + assertTrue(spanFinished(span1)); + sortSpansByStart(); + List trace = writer.get(0); + assertEquals(4, trace.size()); + assertSame(span1, trace.get(0)); + assertSame(span1A, trace.get(1)); + assertSame(span1A1, trace.get(2)); + assertSame(span1A2, trace.get(3)); + assertNull(tracer.activeSpan()); + } + + private boolean spanFinished(AgentSpan span) { + return span instanceof DDSpan && ((DDSpan) span).isFinished(); + } + + private void sortSpansByStart() { + writer.firstTrace().sort(Comparator.comparingLong(DDSpan::getStartTimeNano)); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/scopemanager/ScopeAndContinuationLayoutTest.java b/dd-trace-core/src/test/java/datadog/trace/core/scopemanager/ScopeAndContinuationLayoutTest.java new file mode 100644 index 00000000000..53d40ce391d --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/scopemanager/ScopeAndContinuationLayoutTest.java @@ -0,0 +1,34 @@ +package datadog.trace.core.scopemanager; + +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assumptions.assumeFalse; + +import datadog.environment.JavaVirtualMachine; +import datadog.trace.test.util.DDJavaSpecification; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.openjdk.jol.info.ClassLayout; + +class ScopeAndContinuationLayoutTest extends DDJavaSpecification { + + @BeforeAll + static void assumeNotIbmJvm() { + assumeFalse(JavaVirtualMachine.isJ9()); + } + + @Test + void continuableScopeLayout() { + assertTrue(layoutAcceptable(ContinuableScope.class, 32)); + } + + @Test + void singleContinuationLayout() { + assertTrue(layoutAcceptable(ScopeContinuation.class, 32)); + } + + private boolean layoutAcceptable(Class klass, int acceptableSize) { + ClassLayout layout = ClassLayout.parseClass(klass); + System.err.println(layout.toPrintable()); + return layout.instanceSize() <= acceptableSize; + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/scopemanager/ScopeManagerDepthTest.java b/dd-trace-core/src/test/java/datadog/trace/core/scopemanager/ScopeManagerDepthTest.java new file mode 100644 index 00000000000..25406c47c80 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/scopemanager/ScopeManagerDepthTest.java @@ -0,0 +1,130 @@ +package datadog.trace.core.scopemanager; + +import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopScope; +import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpan; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertSame; + +import datadog.trace.api.config.TracerConfig; +import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.common.writer.ListWriter; +import datadog.trace.core.CoreTracer; +import datadog.trace.core.DDCoreJavaSpecification; +import datadog.trace.core.ScopeManagerTestBridge; +import datadog.trace.test.junit.utils.config.WithConfig; +import org.junit.jupiter.api.Test; + +class ScopeManagerDepthTest extends DDCoreJavaSpecification { + + @Test + void scopeManagerReturnsNoopScopeIfDepthExceeded() { + // Using a local constant here to avoid classloading issues with ConfigDefaults + int depth = 100; + + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + ContinuableScopeManager scopeManager = ScopeManagerTestBridge.getScopeManager(tracer); + + // fill up the scope stack + AgentScope scope = null; + for (int i = 0; i < depth; i++) { + AgentSpan testSpan = tracer.buildSpan("test", "test").start(); + scope = tracer.activateSpan(testSpan); + assertInstanceOf(ContinuableScope.class, scope); + } + + // last scope is still valid + assertEquals(depth, scopeManager.scopeStack().depth()); + + // activate span over limit + AgentSpan span = tracer.buildSpan("test", "test").start(); + scope = tracer.activateSpan(span); + + // a noop instance is returned + assertSame(noopScope(), scope); + + // activate a noop scope over the limit + scope = scopeManager.activateManualSpan(noopSpan()); + + // still have a noop instance + assertSame(noopScope(), scope); + + // scope stack not effected + assertEquals(depth, scopeManager.scopeStack().depth()); + + scopeManager.scopeStack().clear(); + tracer.close(); + } + + @Test + @WithConfig(key = TracerConfig.SCOPE_DEPTH_LIMIT, value = "0") + void scopeManagerIgnoresDepthLimitWhenZero() { + // Using a local constant here to avoid classloading issues with ConfigDefaults + int defaultLimit = 100; + + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + ContinuableScopeManager scopeManager = ScopeManagerTestBridge.getScopeManager(tracer); + + // fill up the scope stack + AgentScope scope = null; + for (int i = 0; i < defaultLimit; i++) { + AgentSpan testSpan = tracer.buildSpan("test", "test").start(); + scope = tracer.activateSpan(testSpan); + assertInstanceOf(ContinuableScope.class, scope); + } + + // last scope is still valid + assertEquals(defaultLimit, scopeManager.scopeStack().depth()); + + // activate a scope + AgentSpan span = tracer.buildSpan("test", "test").start(); + scope = tracer.activateSpan(span); + + // a real scope is returned + assertNotSame(noopScope(), scope); + assertEquals(defaultLimit + 1, scopeManager.scopeStack().depth()); + + // activate a noop span + scope = scopeManager.activateManualSpan(noopSpan()); + + // a real instance is still returned + assertNotSame(noopScope(), scope); + + // scope stack not effected + assertEquals(defaultLimit + 2, scopeManager.scopeStack().depth()); + + scopeManager.scopeStack().clear(); + tracer.close(); + } + + @Test + void depthIsCorrectlyUpdatedWithOutOfOrderClosing() { + // The decision here is that depth is the top-most open scope + // Closed scopes that are not on top still count for depth + + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + ContinuableScopeManager scopeManager = ScopeManagerTestBridge.getScopeManager(tracer); + + AgentSpan firstSpan = tracer.buildSpan("test", "foo").start(); + AgentScope firstScope = tracer.activateSpan(firstSpan); + + AgentSpan secondSpan = tracer.buildSpan("test", "foo").start(); + AgentScope secondScope = tracer.activateSpan(secondSpan); + + assertEquals(2, scopeManager.scopeStack().depth()); + + firstSpan.finish(); + firstScope.close(); + + assertEquals(2, scopeManager.scopeStack().depth()); + + secondSpan.finish(); + secondScope.close(); + + assertEquals(0, scopeManager.scopeStack().depth()); + + tracer.close(); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/scopemanager/ScopeManagerForkedTest.java b/dd-trace-core/src/test/java/datadog/trace/core/scopemanager/ScopeManagerForkedTest.java new file mode 100644 index 00000000000..440259d85b6 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/scopemanager/ScopeManagerForkedTest.java @@ -0,0 +1,1242 @@ +package datadog.trace.core.scopemanager; + +import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpan; +import static datadog.trace.core.scopemanager.ScopeManagerForkedTest.EVENT.ACTIVATE; +import static datadog.trace.core.scopemanager.ScopeManagerForkedTest.EVENT.CLOSE; +import static datadog.trace.test.util.GCUtils.awaitGC; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.clearInvocations; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoMoreInteractions; +import static org.mockito.Mockito.when; + +import datadog.context.Context; +import datadog.context.ContextContinuation; +import datadog.context.ContextKey; +import datadog.context.ContextScope; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.Stateful; +import datadog.trace.api.interceptor.MutableSpan; +import datadog.trace.api.interceptor.TraceInterceptor; +import datadog.trace.api.scopemanager.ExtendedScopeListener; +import datadog.trace.api.scopemanager.ScopeListener; +import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import datadog.trace.bootstrap.instrumentation.api.ProfilingContextIntegration; +import datadog.trace.common.writer.ListWriter; +import datadog.trace.core.CoreTracer; +import datadog.trace.core.DDCoreJavaSpecification; +import datadog.trace.core.DDSpan; +import datadog.trace.core.ScopeManagerTestBridge; +import datadog.trace.test.util.ThreadUtils; +import java.lang.ref.WeakReference; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; +import org.tabletest.junit.TableTest; + +class ScopeManagerForkedTest extends DDCoreJavaSpecification { + + enum EVENT { + ACTIVATE, + CLOSE + } + + @Override + protected boolean useStrictTraceWrites() { + // This tests the behavior of the relaxed pending trace implementation + return false; + } + + ListWriter writer; + CoreTracer tracer; + ContinuableScopeManager scopeManager; + EventCountingListener eventCountingListener; + EventCountingExtendedListener eventCountingExtendedListener; + ProfilingContextIntegration profilingContext; + Stateful state; + + @BeforeAll + static void installLegacyContextManager() { + // this test requires use of legacy context manager + AgentTracer.installLegacyContextManager(); + } + + @BeforeEach + void setup() { + state = mock(Stateful.class); + profilingContext = mock(ProfilingContextIntegration.class); + when(profilingContext.newScopeState(any())).thenReturn(state); + when(profilingContext.name()).thenReturn("mock"); + writer = new ListWriter(); + tracer = tracerBuilder().writer(writer).profilingContextIntegration(profilingContext).build(); + AgentTracer.forceRegister(tracer); + scopeManager = ScopeManagerTestBridge.getScopeManager(tracer); + eventCountingListener = new EventCountingListener(); + scopeManager.addScopeListener(eventCountingListener); + eventCountingExtendedListener = new EventCountingExtendedListener(); + scopeManager.addScopeListener(eventCountingExtendedListener); + // Clear interactions recorded during tracer initialization so each test starts clean + clearInvocations(profilingContext); + } + + @AfterEach + void cleanup() { + tracer.close(); + } + + @Test + void nonDdspanActivationResultsInAContinuableScope() { + AgentScope scope = scopeManager.activateSpan(noopSpan()); + + assertSame(scope, scopeManager.active()); + assertInstanceOf(ContinuableScope.class, scope); + + scope.close(); + + assertNull(scopeManager.active()); + } + + @Test + void noScopeIsActiveBeforeActivation() throws Exception { + tracer.buildSpan("test", "test").start(); + + assertNull(scopeManager.active()); + assertTrue(writer.isEmpty()); + } + + @Test + void simpleScopeAndSpanLifecycle() throws Exception { + AgentSpan span = tracer.buildSpan("test", "test").start(); + AgentScope scope = tracer.activateSpan(span); + + assertSame(span, scope.span()); + assertFalse(spanFinished(scope.span())); + assertSame(scope, scopeManager.active()); + assertInstanceOf(ContinuableScope.class, scope); + assertTrue(writer.isEmpty()); + + scope.close(); + + assertFalse(spanFinished(scope.span())); + assertTrue(writer.isEmpty()); + assertNull(scopeManager.active()); + + span.finish(); + writer.waitForTraces(1); + + assertTrue(spanFinished(scope.span())); + assertEquals(1, writer.size()); + assertSame(scope.span(), writer.get(0).get(0)); + assertNull(scopeManager.active()); + } + + @Test + void setsParentAsCurrentUponClose() { + AgentSpan parentSpan = tracer.buildSpan("test", "parent").start(); + AgentScope parentScope = tracer.activateSpan(parentSpan); + AgentSpan childSpan = tracer.buildSpan("test", "child").start(); + AgentScope childScope = tracer.activateSpan(childSpan); + + assertSame(childScope, scopeManager.active()); + assertEquals( + parentScope.span().spanContext().getSpanId(), + ((DDSpan) childScope.span()).spanContext().getParentId()); + assertSame( + parentScope.span().spanContext().getTraceCollector(), + childScope.span().spanContext().getTraceCollector()); + + childScope.close(); + + assertSame(parentScope, scopeManager.active()); + assertFalse(spanFinished(childScope.span())); + assertFalse(spanFinished(parentScope.span())); + assertTrue(writer.isEmpty()); + } + + @Test + void setsParentAsCurrentUponCloseWithNoopChild() { + AgentSpan parentSpan = tracer.buildSpan("test", "parent").start(); + AgentScope parentScope = tracer.activateSpan(parentSpan); + AgentSpan childSpan = noopSpan(); + AgentScope childScope = tracer.activateSpan(childSpan); + + assertSame(childScope, scopeManager.active()); + + childScope.close(); + + assertSame(parentScope, scopeManager.active()); + assertFalse(spanFinished(parentScope.span())); + assertTrue(writer.isEmpty()); + } + + @Test + void ddScopeCreatesNoOpContinuationsWhenPropagationIsNotSet() { + AgentSpan span = tracer.buildSpan("test", "test").start(); + tracer.activateSpan(span); + tracer.setAsyncPropagationEnabled(false); + ContextContinuation continuation = tracer.captureActiveSpan(); + + assertSame(Context.root(), continuation.context()); + + tracer.setAsyncPropagationEnabled(true); + continuation = tracer.captureActiveSpan(); + + assertNotSame(Context.root(), continuation.context()); + assertNotNull(continuation); + + continuation.release(); + } + + @Test + void continuationCancelDoesNotCloseParentScope() { + AgentSpan span = tracer.buildSpan("test", "test").start(); + AgentScope scope = tracer.activateSpan(span); + ContextContinuation continuation = tracer.captureActiveSpan(); + + assertNotNull(continuation); + + continuation.release(); + + assertSame(scope, scopeManager.active()); + } + + // @Flaky("awaitGC is flaky") + @Test + void testContinuationDoesNotHaveHardReferenceOnScope() throws InterruptedException { + AgentSpan span = tracer.buildSpan("test", "test").start(); + AtomicReference scopeRef = new AtomicReference<>(tracer.activateSpan(span)); + ContextContinuation continuation = tracer.captureActiveSpan(); + + assertNotNull(continuation); + + scopeRef.get().close(); + + assertNull(scopeManager.active()); + + WeakReference ref = new WeakReference<>(scopeRef.get()); + scopeRef.set(null); + awaitGC(ref); + + assertNotNull(continuation); + assertNull(ref.get()); + assertFalse(spanFinished(span)); + assertTrue(writer.isEmpty()); + } + + @ValueSource(booleans = {true, false}) + @ParameterizedTest + void hardReferenceOnContinuationDoesNotPreventTraceFromReporting(boolean autoClose) + throws Exception { + AgentSpan span = tracer.buildSpan("test", "test").start(); + AgentScope scope = tracer.activateSpan(span); + ContextContinuation continuation = tracer.captureActiveSpan(); + + assertNotNull(continuation); + + scope.close(); + span.finish(); + if (autoClose) { + continuation.release(); + } + + assertNull(scopeManager.active()); + assertTrue(spanFinished(span)); + + writer.waitForTraces(1); + + assertEquals(1, writer.size()); + assertSame(span, writer.get(0).get(0)); + } + + @Test + void continuationRestoresTrace() throws Exception { + AgentSpan parentSpan = tracer.buildSpan("test", "parent").start(); + AgentScope parentScope = tracer.activateSpan(parentSpan); + AgentSpan childSpan = tracer.buildSpan("test", "child").start(); + AgentScope childScope = tracer.activateSpan(childSpan); + + ContextContinuation continuation = tracer.captureActiveSpan(); + childScope.close(); + + assertNotNull(continuation); + assertSame(parentScope, scopeManager.active()); + assertFalse(spanFinished(childSpan)); + assertFalse(spanFinished(parentSpan)); + + parentScope.close(); + parentSpan.finish(); + + // parent span is finished, but trace is not reported + assertNull(scopeManager.active()); + assertFalse(spanFinished(childSpan)); + assertTrue(spanFinished(parentSpan)); + assertTrue(writer.isEmpty()); + + // activating the continuation + ContextScope newScope = continuation.resume(); + + // the continued scope becomes active and span state doesn't change + assertInstanceOf(ContinuableScope.class, newScope); + assertTrue(tracer.isAsyncPropagationEnabled()); + assertSame(newScope, scopeManager.active()); + assertNotSame(childScope, newScope); + assertNotSame(parentScope, newScope); + assertSame(childSpan, AgentSpan.fromContext(newScope.context())); + assertFalse(spanFinished(childSpan)); + assertTrue(spanFinished(parentSpan)); + assertTrue(writer.isEmpty()); + + // creating and activating a second continuation + ContextContinuation newContinuation = tracer.captureActiveSpan(); + newScope.close(); + ContextScope secondContinuedScope = newContinuation.resume(); + secondContinuedScope.close(); + childSpan.finish(); + writer.waitForTraces(1); + + // spans are all finished and trace is reported + assertNull(scopeManager.active()); + assertTrue(spanFinished(childSpan)); + assertTrue(spanFinished(parentSpan)); + assertEquals(1, writer.size()); + assertTrue(writer.get(0).containsAll(Arrays.asList(childSpan, parentSpan))); + } + + @Test + void continuationAllowsAddingSpansEvenAfterOtherSpansWereCompleted() throws Exception { + // creating and activating a continuation + AgentSpan span = tracer.buildSpan("test", "test").start(); + AgentScope scope = tracer.activateSpan(span); + ContextContinuation continuation = tracer.captureActiveSpan(); + scope.close(); + span.finish(); + + ContextScope newScope = continuation.resume(); + + // the continuation sets the active scope + assertInstanceOf(ContinuableScope.class, newScope); + assertNotSame(scope, newScope); + assertSame(newScope, scopeManager.active()); + assertTrue(spanFinished(span)); + assertTrue(writer.isEmpty()); + + // creating a new child span under a continued scope + AgentSpan childSpan = tracer.buildSpan("test", "child").start(); + AgentScope childScope = tracer.activateSpan(childSpan); + childScope.close(); + childSpan.finish(); + + assertSame(newScope, scopeManager.active()); + + scopeManager.active().close(); + writer.waitForTraces(1); + + // the child has the correct parent + assertNull(scopeManager.active()); + assertTrue(spanFinished(childSpan)); + assertEquals(span.spanContext().getSpanId(), ((DDSpan) childSpan).spanContext().getParentId()); + assertEquals(1, writer.size()); + assertTrue(writer.get(0).containsAll(Arrays.asList(childSpan, span))); + } + + @Test + void testActivatingSameSpanMultipleTimes() { + AgentSpan span = tracer.buildSpan("test", "test").start(); + Stateful localState = mock(Stateful.class); + when(profilingContext.newScopeState(any())).thenReturn(localState); + clearInvocations(profilingContext); + + AgentScope scope1 = scopeManager.activateSpan(span); + + assertEvents(Arrays.asList(ACTIVATE)); + verify(profilingContext, times(1)).newScopeState(any()); + clearInvocations(profilingContext); + + AgentScope scope2 = scopeManager.activateSpan(span); + + // Activating the same span multiple times does not create a new scope + assertEvents(Arrays.asList(ACTIVATE)); + verify(profilingContext, never()).newScopeState(any()); + clearInvocations(profilingContext); + + scope2.close(); + + // Closing a scope once that has been activated multiple times does not close + assertEvents(Arrays.asList(ACTIVATE)); + verify(localState, never()).close(); + clearInvocations(localState); + + scope1.close(); + + assertEvents(Arrays.asList(ACTIVATE, CLOSE)); + verify(localState, times(1)).close(); + } + + @Test + void openingAndClosingMultipleScopes() { + AgentSpan span = tracer.buildSpan("test", "foo").start(); + AgentScope continuableScope = tracer.activateSpan(span); + + assertInstanceOf(ContinuableScope.class, continuableScope); + assertEvents(Arrays.asList(ACTIVATE)); + + AgentSpan childSpan = tracer.buildSpan("test", "foo").start(); + AgentScope childDDScope = tracer.activateSpan(childSpan); + + assertInstanceOf(ContinuableScope.class, childDDScope); + assertEvents(Arrays.asList(ACTIVATE, ACTIVATE)); + + childDDScope.close(); + childSpan.finish(); + + assertEvents(Arrays.asList(ACTIVATE, ACTIVATE, CLOSE, ACTIVATE)); + + continuableScope.close(); + span.finish(); + + assertEvents(Arrays.asList(ACTIVATE, ACTIVATE, CLOSE, ACTIVATE, CLOSE)); + } + + @Test + void closingScopeOutOfOrderSimple() { + AgentSpan firstSpan = tracer.buildSpan("test", "foo").start(); + AgentScope firstScope = tracer.activateSpan(firstSpan); + + AgentSpan secondSpan = tracer.buildSpan("test", "bar").start(); + AgentScope secondScope = tracer.activateSpan(secondSpan); + + firstSpan.finish(); + firstScope.close(); + + assertEvents(Arrays.asList(ACTIVATE, ACTIVATE)); + verify(profilingContext, times(1)).onRootSpanStarted(any()); + verify(profilingContext, times(1)).onAttach(); + verify(profilingContext, times(1)).encodeOperationName("foo"); + verify(profilingContext, times(1)).encodeOperationName("bar"); + verify(profilingContext, times(2)).newScopeState(any()); + verifyNoMoreInteractions(profilingContext); + clearInvocations(profilingContext); + + secondSpan.finish(); + secondScope.close(); + + verify(profilingContext, times(1)).onRootSpanFinished(any(), any()); + verify(profilingContext, times(1)).onDetach(); + assertEvents(Arrays.asList(ACTIVATE, ACTIVATE, CLOSE, CLOSE)); + verifyNoMoreInteractions(profilingContext); + clearInvocations(profilingContext); + + firstScope.close(); + + assertEvents(Arrays.asList(ACTIVATE, ACTIVATE, CLOSE, CLOSE)); + } + + @Test + void closingScopeOutOfOrderComplex() { + // Events are checked twice in each case to ensure a call to + // scopeManager.active() or tracer.activeSpan() doesn't change the count + + AgentSpan firstSpan = tracer.buildSpan("test", "foo").start(); + AgentScope firstScope = tracer.activateSpan(firstSpan); + + assertEvents(Arrays.asList(ACTIVATE)); + assertSame(firstSpan, tracer.activeSpan()); + assertSame(firstScope, scopeManager.active()); + assertEvents(Arrays.asList(ACTIVATE)); + verify(profilingContext, times(1)).onRootSpanStarted(any()); + verify(profilingContext, times(1)).onAttach(); + verify(profilingContext, times(1)).encodeOperationName("foo"); + verify(profilingContext, times(1)).newScopeState(any()); + verifyNoMoreInteractions(profilingContext); + clearInvocations(profilingContext); + + AgentSpan secondSpan = tracer.buildSpan("test", "bar").start(); + AgentScope secondScope = tracer.activateSpan(secondSpan); + + assertEvents(Arrays.asList(ACTIVATE, ACTIVATE)); + assertSame(secondSpan, tracer.activeSpan()); + assertSame(secondScope, scopeManager.active()); + assertEvents(Arrays.asList(ACTIVATE, ACTIVATE)); + verify(profilingContext, times(1)).encodeOperationName("bar"); + verify(profilingContext, times(1)).newScopeState(any()); + verifyNoMoreInteractions(profilingContext); + clearInvocations(profilingContext); + + AgentSpan thirdSpan = tracer.buildSpan("test", "quux").start(); + AgentScope thirdScope = tracer.activateSpan(thirdSpan); + + assertEvents(Arrays.asList(ACTIVATE, ACTIVATE, ACTIVATE)); + assertSame(thirdSpan, tracer.activeSpan()); + assertSame(thirdScope, scopeManager.active()); + assertEvents(Arrays.asList(ACTIVATE, ACTIVATE, ACTIVATE)); + verify(profilingContext, times(1)).encodeOperationName("quux"); + verify(profilingContext, times(1)).newScopeState(any()); + verifyNoMoreInteractions(profilingContext); + clearInvocations(profilingContext); + + secondScope.close(); + + assertEvents(Arrays.asList(ACTIVATE, ACTIVATE, ACTIVATE)); + assertSame(thirdSpan, tracer.activeSpan()); + assertSame(thirdScope, scopeManager.active()); + assertEvents(Arrays.asList(ACTIVATE, ACTIVATE, ACTIVATE)); + verifyNoMoreInteractions(profilingContext); + clearInvocations(profilingContext); + + thirdScope.close(); + + assertEvents(Arrays.asList(ACTIVATE, ACTIVATE, ACTIVATE, CLOSE, CLOSE, ACTIVATE)); + assertSame(firstSpan, tracer.activeSpan()); + assertSame(firstScope, scopeManager.active()); + assertEvents(Arrays.asList(ACTIVATE, ACTIVATE, ACTIVATE, CLOSE, CLOSE, ACTIVATE)); + verifyNoMoreInteractions(profilingContext); + clearInvocations(profilingContext); + + firstScope.close(); + + assertEvents(Arrays.asList(ACTIVATE, ACTIVATE, ACTIVATE, CLOSE, CLOSE, ACTIVATE, CLOSE)); + assertNull(scopeManager.active()); + assertEvents(Arrays.asList(ACTIVATE, ACTIVATE, ACTIVATE, CLOSE, CLOSE, ACTIVATE, CLOSE)); + verify(profilingContext, times(1)).onDetach(); + verifyNoMoreInteractions(profilingContext); + } + + @Test + void closingScopeOutOfOrderMultipleActivations() { + AgentSpan span = tracer.buildSpan("test", "test").start(); + clearInvocations(profilingContext); + + AgentScope scope1 = scopeManager.activateSpan(span); + + assertEvents(Arrays.asList(ACTIVATE)); + + AgentScope scope2 = scopeManager.activateSpan(span); + + // Activating the same span multiple times does not create a new scope + assertEvents(Arrays.asList(ACTIVATE)); + clearInvocations(profilingContext); + + AgentSpan thirdSpan = tracer.buildSpan("test", "quux").start(); + AgentScope thirdScope = tracer.activateSpan(thirdSpan); + + assertEvents(Arrays.asList(ACTIVATE, ACTIVATE)); + assertSame(thirdSpan, tracer.activeSpan()); + assertSame(thirdScope, scopeManager.active()); + assertEvents(Arrays.asList(ACTIVATE, ACTIVATE)); + verify(profilingContext, times(1)).encodeOperationName("quux"); + verify(profilingContext, times(1)).newScopeState(any()); + verifyNoMoreInteractions(profilingContext); + clearInvocations(profilingContext); + + scope2.close(); + + // Closing a scope once that has been activated multiple times does not close + assertEvents(Arrays.asList(ACTIVATE, ACTIVATE)); + verifyNoMoreInteractions(profilingContext); + clearInvocations(profilingContext); + + thirdScope.close(); + thirdSpan.finish(); + + // Closing scope above multiple activated scope does not close it + assertEvents(Arrays.asList(ACTIVATE, ACTIVATE, CLOSE, ACTIVATE)); + verifyNoMoreInteractions(profilingContext); + clearInvocations(profilingContext); + + scope1.close(); + + assertEvents(Arrays.asList(ACTIVATE, ACTIVATE, CLOSE, ACTIVATE, CLOSE)); + } + + @Test + void closingAContinuedScopeOutOfOrderCancelsTheContinuation() throws Exception { + AgentSpan span = tracer.buildSpan("test", "test").start(); + AgentScope scope = tracer.activateSpan(span); + ContextContinuation continuation = tracer.captureActiveSpan(); + scope.close(); + span.finish(); + + assertNull(scopeManager.active()); + assertTrue(spanFinished(span)); + assertTrue(writer.isEmpty()); + + ContextScope continuedScope = continuation.resume(); + + AgentSpan secondSpan = tracer.buildSpan("test", "test2").start(); + AgentScope secondScope = (ContinuableScope) tracer.activateSpan(secondSpan); + + assertSame(secondScope, scopeManager.active()); + + continuedScope.close(); + + assertSame(secondScope, scopeManager.active()); + assertTrue(writer.isEmpty()); + + secondScope.close(); + secondSpan.finish(); + writer.waitForTraces(1); + + assertEquals(1, writer.size()); + assertTrue(writer.get(0).containsAll(Arrays.asList(secondSpan, span))); + } + + @Test + void exceptionThrownInTraceInterceptorDoesNotLeaveScopeManagerInBadState() throws Exception { + ExceptionThrowingInterceptor interceptor = new ExceptionThrowingInterceptor(); + tracer.addTraceInterceptor(interceptor); + + AgentSpan span = tracer.buildSpan("test", "test").start(); + AgentScope scope = tracer.activateSpan(span); + scope.close(); + span.finish(); + + // exception is thrown in same thread + assertTrue(interceptor.lastTrace.contains(span)); + + // scopeManager in good state + assertNull(scopeManager.active()); + assertTrue(spanFinished(span)); + assertEquals(0, scopeManager.scopeStack().depth()); + assertEquals(1, writer.size()); + assertSame(span, writer.get(0).get(0)); + + // completing another scope lifecycle + AgentSpan span2 = tracer.buildSpan("test", "test").start(); + AgentScope scope2 = tracer.activateSpan(span2); + + assertSame(scope2, scopeManager.active()); + + interceptor.shouldThrowException = false; + scope2.close(); + span2.finish(); + writer.waitForTraces(1); + + // second lifecycle gets reported + assertNull(scopeManager.active()); + assertTrue(spanFinished(span2)); + assertEquals(0, scopeManager.scopeStack().depth()); + assertEquals(2, writer.size()); + assertSame(span2, writer.get(1).get(0)); + } + + @Test + void + exceptionThrownInTraceInterceptorDoesNotLeaveScopeManagerInBadStateWhenReportingThroughPendingTraceBuffer() + throws Exception { + ExceptionThrowingInterceptor interceptor = new ExceptionThrowingInterceptor(); + tracer.addTraceInterceptor(interceptor); + + AgentSpan span = tracer.buildSpan("test", "test").start(); + AgentScope scope = tracer.activateSpan(span); + ContextContinuation continuation = tracer.captureActiveSpan(); + scope.close(); + span.finish(); + + assertNotNull(continuation); + assertNull(scopeManager.active()); + assertTrue(spanFinished(span)); + assertEquals(0, scopeManager.scopeStack().depth()); + assertTrue(writer.isEmpty()); + + // wait for root span to be reported from PendingTraceBuffer + writer.waitForTraces(1); + + assertTrue(interceptor.lastTrace.contains(span)); + + // scopeManager in good state + assertNull(scopeManager.active()); + assertTrue(spanFinished(span)); + assertEquals(0, scopeManager.scopeStack().depth()); + assertEquals(1, writer.size()); + assertSame(span, writer.get(0).get(0)); + + // completing another async scope lifecycle + AgentSpan span2 = tracer.buildSpan("test", "test").start(); + AgentScope scope2 = tracer.activateSpan(span2); + ContextContinuation continuation2 = tracer.captureActiveSpan(); + + assertNotNull(continuation2); + assertSame(scope2, scopeManager.active()); + + interceptor.shouldThrowException = false; + scope2.close(); + span2.finish(); + + writer.waitForTraces(2); + + // second lifecycle gets reported as well + assertNull(scopeManager.active()); + assertTrue(spanFinished(span2)); + assertEquals(0, scopeManager.scopeStack().depth()); + assertEquals(2, writer.size()); + assertSame(span2, writer.get(1).get(0)); + } + + @Test + void continuationCanBeActivatedAndClosedInMultipleThreads() throws Throwable { + long sendDelayNanos = TimeUnit.MILLISECONDS.toNanos(500 - 100); + + AgentSpan span = tracer.buildSpan("test", "test").start(); + long start = System.nanoTime(); + AgentScope scope = tracer.activateSpan(span); + AtomicReference continuation = + new AtomicReference<>(tracer.captureActiveSpan()); + scope.close(); + span.finish(); + + continuation.get().hold(); + + AtomicInteger iteration = new AtomicInteger(0); + ThreadUtils.runConcurrently( + 8, + 512, + () -> { + int iter = iteration.incrementAndGet(); + if ((iter & 1) != 0) { + Thread.sleep(1); + } + ContextScope s = continuation.get().resume(); + assertSame(s, scopeManager.active()); + if ((iter & 2) != 0) { + Thread.sleep(1); + } + s.close(); + }); + + long duration = System.nanoTime() - start; + + // Since we can't rely on that nothing gets written to the tracer for verification, + // we only check for empty if we are faster than the flush interval + if (duration < sendDelayNanos) { + assertTrue(writer.isEmpty()); + } + + continuation.get().release(); + + assertEquals(1, writer.size()); + assertSame(span, writer.get(0).get(0)); + } + + @Test + void scopeListenerShouldBeNotifiedAboutTheCurrentlyActiveScope() { + AgentSpan span = tracer.buildSpan("test", "test").start(); + + AgentScope scope = scopeManager.activateSpan(span); + + assertEvents(Arrays.asList(ACTIVATE)); + + EventCountingListener listener = new EventCountingListener(); + + assertEquals(0, listener.events.size()); + + scopeManager.addScopeListener(listener); + + assertEquals(Arrays.asList(ACTIVATE), listener.events); + + scope.close(); + + assertEvents(Arrays.asList(ACTIVATE, CLOSE)); + assertEquals(Arrays.asList(ACTIVATE, CLOSE), listener.events); + } + + @Test + void extendedScopeListenerShouldBeNotifiedAboutTheCurrentlyActiveScope() { + AgentSpan span = tracer.buildSpan("test", "test").start(); + + AgentScope scope = scopeManager.activateSpan(span); + + assertEvents(Arrays.asList(ACTIVATE)); + + EventCountingExtendedListener listener = new EventCountingExtendedListener(); + + assertEquals(0, listener.events.size()); + + scopeManager.addScopeListener(listener); + + assertEquals(Arrays.asList(ACTIVATE), listener.events); + + scope.close(); + + assertEvents(Arrays.asList(ACTIVATE, CLOSE)); + assertEquals(Arrays.asList(ACTIVATE, CLOSE), listener.events); + } + + @Test + void scopeListenerShouldNotBeNotifiedWhenThereIsNoActiveScope() { + EventCountingListener listener = new EventCountingListener(); + + assertEquals(0, listener.events.size()); + + scopeManager.addScopeListener(listener); + + assertEquals(0, listener.events.size()); + } + + @TableTest({ + "scenario | activationException | closeException", + "no exceptions | false | false ", + "close exception | false | true ", + "activate exception | true | false ", + "both exceptions | true | true " + }) + void misbehavingScopeListenerShouldNotAffectOthers( + boolean activationException, boolean closeException) { + ExceptionThrowingScopeListener exceptionThrowingScopeListener = + new ExceptionThrowingScopeListener(); + exceptionThrowingScopeListener.throwOnScopeActivated = activationException; + exceptionThrowingScopeListener.throwOnScopeClosed = closeException; + + EventCountingListener secondEventCountingListener = new EventCountingListener(); + scopeManager.addScopeListener(exceptionThrowingScopeListener); + scopeManager.addScopeListener(secondEventCountingListener); + + AgentSpan span = tracer.buildSpan("test", "foo").start(); + AgentScope continuableScope = tracer.activateSpan(span); + + assertEvents(Arrays.asList(ACTIVATE)); + assertEquals(Arrays.asList(ACTIVATE), secondEventCountingListener.events); + + AgentSpan childSpan = tracer.buildSpan("test", "foo").start(); + AgentScope childDDScope = tracer.activateSpan(childSpan); + + assertEvents(Arrays.asList(ACTIVATE, ACTIVATE)); + assertEquals(Arrays.asList(ACTIVATE, ACTIVATE), secondEventCountingListener.events); + + childDDScope.close(); + childSpan.finish(); + + assertEvents(Arrays.asList(ACTIVATE, ACTIVATE, CLOSE, ACTIVATE)); + assertEquals( + Arrays.asList(ACTIVATE, ACTIVATE, CLOSE, ACTIVATE), secondEventCountingListener.events); + + continuableScope.close(); + span.finish(); + + assertEvents(Arrays.asList(ACTIVATE, ACTIVATE, CLOSE, ACTIVATE, CLOSE)); + assertEquals( + Arrays.asList(ACTIVATE, ACTIVATE, CLOSE, ACTIVATE, CLOSE), + secondEventCountingListener.events); + } + + @Test + void contextThreadListenerNotifiedWhenScopeActivatedOnThreadForTheFirstTime() throws Exception { + int numThreads = 5; + int numTasks = 20; + ExecutorService executor = Executors.newFixedThreadPool(numThreads); + + // usage of an instrumented executor results in scopestack initialisation but not scope creation + executor.submit(() -> assertNull(scopeManager.active())).get(); + // the listener is not notified + verify(profilingContext, never()).onAttach(); + clearInvocations(profilingContext); + + // scopes activate on threads + AgentSpan span = tracer.buildSpan("test", "foo").start(); + Future[] futures = new Future[numTasks]; + for (int i = 0; i < numTasks; i++) { + final int taskIndex = i; + futures[i] = + executor.submit( + () -> { + AgentScope scope = tracer.activateSpan(span); + AgentSpan child = tracer.buildSpan("test", "foo" + taskIndex).start(); + AgentScope childScope = tracer.activateSpan(child); + try { + Thread.sleep(100); + } catch (InterruptedException ignored) { + Thread.currentThread().interrupt(); + } + childScope.close(); + scope.close(); + }); + } + for (Future future : futures) { + future.get(); + } + + // the activation notifies the listener whenever the stack becomes non-empty + verify(profilingContext, times(numTasks)).onAttach(); + + executor.shutdown(); + } + + @Test + void activatingASpanMergesItWithExistingContext() { + AgentSpan span = tracer.buildSpan("test", "test").start(); + ContextKey testKey = ContextKey.named("test"); + Context context = Context.root().with(testKey, "test-value"); + ContextScope contextScope = scopeManager.attach(context); + + assertSame(contextScope, scopeManager.active()); + assertEquals(context, scopeManager.currentContext()); + assertNull(scopeManager.activeSpan()); + assertEquals("test-value", scopeManager.currentContext().get(testKey)); + + AgentScope scope = tracer.activateSpan(span); + + assertSame(scope, scopeManager.active()); + assertNotEquals(context, scopeManager.currentContext()); + assertSame(span, scopeManager.activeSpan()); + assertEquals("test-value", scopeManager.currentContext().get(testKey)); + + scope.close(); + + assertSame(contextScope, scopeManager.active()); + assertEquals(context, scopeManager.currentContext()); + assertNull(scopeManager.activeSpan()); + assertEquals("test-value", scopeManager.currentContext().get(testKey)); + + contextScope.close(); + + assertNull(scopeManager.active()); + assertEquals(Context.root(), scopeManager.currentContext()); + assertNull(scopeManager.activeSpan()); + } + + @Test + void capturingAndContinuingASpanMergesItWithExistingContext() { + AgentSpan span = tracer.buildSpan("test", "test").start(); + ContextKey testKey = ContextKey.named("test"); + Context context = Context.root().with(testKey, "test-value"); + ContextScope contextScope = scopeManager.attach(context); + + assertSame(contextScope, scopeManager.active()); + assertEquals(context, scopeManager.currentContext()); + assertNull(scopeManager.activeSpan()); + assertEquals("test-value", scopeManager.currentContext().get(testKey)); + + ContextScope scope = tracer.captureSpan(span).resume(); + + assertSame(scope, scopeManager.active()); + assertNotEquals(context, scopeManager.currentContext()); + assertSame(span, scopeManager.activeSpan()); + assertEquals("test-value", scopeManager.currentContext().get(testKey)); + + scope.close(); + + assertSame(contextScope, scopeManager.active()); + assertEquals(context, scopeManager.currentContext()); + assertNull(scopeManager.activeSpan()); + assertEquals("test-value", scopeManager.currentContext().get(testKey)); + + contextScope.close(); + + assertNull(scopeManager.active()); + assertEquals(Context.root(), scopeManager.currentContext()); + assertNull(scopeManager.activeSpan()); + } + + @Test + void capturingAndContinuingTheActiveSpanMergesItWithExistingContext() { + AgentSpan span = tracer.buildSpan("test", "test").start(); + ContextKey testKey = ContextKey.named("test"); + Context context = Context.root().with(testKey, "test-value"); + ContextScope contextScope = scopeManager.attach(context); + + assertSame(contextScope, scopeManager.active()); + assertEquals(context, scopeManager.currentContext()); + assertNull(scopeManager.activeSpan()); + assertEquals("test-value", scopeManager.currentContext().get(testKey)); + + ContextScope innerScope = tracer.activateSpan(span); + ContextScope scope = tracer.captureActiveSpan().resume(); + innerScope.close(); + + assertSame(scope, scopeManager.active()); + assertNotEquals(context, scopeManager.currentContext()); + assertSame(span, scopeManager.activeSpan()); + assertEquals("test-value", scopeManager.currentContext().get(testKey)); + + scope.close(); + + assertSame(contextScope, scopeManager.active()); + assertEquals(context, scopeManager.currentContext()); + assertNull(scopeManager.activeSpan()); + assertEquals("test-value", scopeManager.currentContext().get(testKey)); + + contextScope.close(); + + assertNull(scopeManager.active()); + assertEquals(Context.root(), scopeManager.currentContext()); + assertNull(scopeManager.activeSpan()); + } + + @Test + void rollbackStopsAtMostRecentCheckpoint() { + AgentSpan span1 = tracer.buildSpan("test1", "test1").start(); + AgentSpan span2 = tracer.buildSpan("test2", "test2").start(); + AgentSpan span3 = tracer.buildSpan("test3", "test3").start(); + + assertNull(scopeManager.activeSpan()); + + tracer.checkpointActiveForRollback(); + tracer.activateSpan(span1); + tracer.checkpointActiveForRollback(); + tracer.activateSpan(span2); + tracer.checkpointActiveForRollback(); + tracer.activateSpan(span1); + tracer.checkpointActiveForRollback(); + tracer.activateSpan(span2); + tracer.checkpointActiveForRollback(); + tracer.activateSpan(span2); + tracer.checkpointActiveForRollback(); + tracer.activateSpan(span1); + tracer.activateSpan(span2); + tracer.activateSpan(span3); + + assertSame(span3, scopeManager.activeSpan()); + + tracer.rollbackActiveToCheckpoint(); + assertSame(span2, scopeManager.activeSpan()); + + tracer.rollbackActiveToCheckpoint(); + assertSame(span2, scopeManager.activeSpan()); + + tracer.rollbackActiveToCheckpoint(); + assertSame(span1, scopeManager.activeSpan()); + + tracer.rollbackActiveToCheckpoint(); + assertSame(span2, scopeManager.activeSpan()); + + tracer.rollbackActiveToCheckpoint(); + assertSame(span1, scopeManager.activeSpan()); + + tracer.rollbackActiveToCheckpoint(); + assertNull(scopeManager.activeSpan()); + } + + @Test + void contextsCanBeSwappedOutAndBack() { + ContextKey testKey = ContextKey.named("test"); + Context context1 = Context.root().with(testKey, "first-value"); + Context context2 = context1.with(testKey, "second-value"); + + Context swappedOut = scopeManager.swap(Context.root()); + + assertNull(scopeManager.active()); + assertEquals(Context.root(), scopeManager.currentContext()); + + scopeManager.swap(context1); + + assertNotNull(scopeManager.active()); + assertEquals(context1, scopeManager.currentContext()); + + scopeManager.swap(swappedOut); + + assertNull(scopeManager.active()); + assertEquals(Context.root(), scopeManager.currentContext()); + + ContextScope contextScope = scopeManager.attach(context1); + + assertSame(contextScope, scopeManager.active()); + assertEquals(context1, scopeManager.currentContext()); + + swappedOut = scopeManager.swap(context2); + + assertNotNull(scopeManager.active()); + assertNotSame(contextScope, scopeManager.active()); + assertEquals(context2, scopeManager.currentContext()); + assertEquals("first-value", swappedOut.get(testKey)); + + Context context3 = swappedOut.with(testKey, "third-value"); + scopeManager.swap(context3); + + assertNotNull(scopeManager.active()); + assertNotSame(contextScope, scopeManager.active()); + assertEquals(context3, scopeManager.currentContext()); + + scopeManager.swap(swappedOut); + + assertSame(contextScope, scopeManager.active()); + assertEquals(context1, scopeManager.currentContext()); + + contextScope.close(); + + assertNull(scopeManager.active()); + assertEquals(Context.root(), scopeManager.currentContext()); + } + + @Test + void captureViaContextContinuationAPIHoldsTrace() throws Exception { + AgentSpan span = tracer.buildSpan("test", "test").start(); + AgentScope scope = tracer.activateSpan(span); + + // Context.current().capture() routes through ContinuableScopeManager.capture(Context) + ContextContinuation continuation = Context.current().capture(); + + scope.close(); + span.finish(); + assertTrue(writer.isEmpty()); // trace held pending continuation + + continuation.release(); // delegates to cancel(), unblocks trace reporting + writer.waitForTraces(1); + assertFalse(writer.isEmpty()); + } + + @Test + void continuationResumeActivatesSpan() throws Exception { + AgentSpan span = tracer.buildSpan("test", "test").start(); + AgentScope scope = tracer.activateSpan(span); + ContextContinuation continuation = tracer.captureActiveSpan(); + scope.close(); + span.finish(); + + assertNull(scopeManager.active()); + assertTrue(writer.isEmpty()); // trace held by continuation + + // resume() delegates to activate() + ContextScope resumedScope = continuation.resume(); + assertSame(span, scopeManager.active().span()); + + resumedScope.close(); + assertNull(scopeManager.active()); + writer.waitForTraces(1); + assertFalse(writer.isEmpty()); + } + + @Test + void continuationReleaseIsSameAsCancel() throws Exception { + AgentSpan span = tracer.buildSpan("test", "test").start(); + AgentScope scope = tracer.activateSpan(span); + ContextContinuation continuation = tracer.captureActiveSpan(); + scope.close(); + span.finish(); + + assertTrue(writer.isEmpty()); // trace held by continuation + + continuation.release(); // delegates to cancel() + writer.waitForTraces(1); + assertFalse(writer.isEmpty()); + } + + @Test + void captureContextWithoutSpanUsesNoopTraceCollector() { + ContextKey key = ContextKey.named("test-key"); + Context ctx = Context.root().with(key, "value"); + assertDoesNotThrow( + () -> { + // NoopAgentTraceCollector handles capture/release without throwing + try (ContextScope scope = ctx.attach()) { + Context.current().capture().release(); + } + }); + } + + private boolean spanFinished(AgentSpan span) { + return span instanceof DDSpan && ((DDSpan) span).isFinished(); + } + + private void assertEvents(List events) { + assertEquals(events, eventCountingListener.events); + assertEquals(events, eventCountingExtendedListener.events); + } + + static class EventCountingListener implements ScopeListener { + public final List events = new ArrayList<>(); + + @Override + public void afterScopeActivated() { + synchronized (events) { + events.add(ACTIVATE); + } + } + + @Override + public void afterScopeClosed() { + synchronized (events) { + events.add(CLOSE); + } + } + } + + static class EventCountingExtendedListener implements ExtendedScopeListener { + public final List events = new ArrayList<>(); + + @Override + public void afterScopeActivated() { + throw new IllegalArgumentException("This should not be called"); + } + + @Override + public void afterScopeActivated(DDTraceId traceId, long spanId) { + synchronized (events) { + events.add(ACTIVATE); + } + } + + @Override + public void afterScopeClosed() { + synchronized (events) { + events.add(CLOSE); + } + } + } + + static class ExceptionThrowingScopeListener implements ScopeListener { + boolean throwOnScopeActivated = false; + boolean throwOnScopeClosed = false; + + @Override + public void afterScopeActivated() { + if (throwOnScopeActivated) { + throw new RuntimeException("Exception on activated"); + } + } + + @Override + public void afterScopeClosed() { + if (throwOnScopeClosed) { + throw new RuntimeException("Exception on closed"); + } + } + } + + static class ExceptionThrowingInterceptor implements TraceInterceptor { + boolean shouldThrowException = true; + Collection lastTrace; + + @Override + public Collection onTraceComplete( + Collection trace) { + lastTrace = trace; + if (shouldThrowException) { + throw new RuntimeException("Always throws exception"); + } else { + return trace; + } + } + + @Override + public int priority() { + return 55; + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/servicediscovery/ForeignMemoryWriterFactoryTest.java b/dd-trace-core/src/test/java/datadog/trace/core/servicediscovery/ForeignMemoryWriterFactoryTest.java new file mode 100644 index 00000000000..ff41ce694ff --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/servicediscovery/ForeignMemoryWriterFactoryTest.java @@ -0,0 +1,51 @@ +package datadog.trace.core.servicediscovery; + +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.mockStatic; + +import datadog.environment.JavaVirtualMachine; +import datadog.environment.OperatingSystem; +import org.junit.jupiter.api.Assumptions; +import org.mockito.MockedStatic; +import org.tabletest.junit.TableTest; + +class ForeignMemoryWriterFactoryTest { + + @TableTest({ + "scenario | osType | architecture | javaAtLeast22 | expectedClassFragment", + "macOS | MACOS | X64 | false | ", + "Windows | WINDOWS | X64 | false | ", + "Linux unknown arch | LINUX | UNKNOWN | false | ", + "Linux pre-Java22 | LINUX | X64 | false | JNA ", + "Linux Java22+ | LINUX | X64 | true | FFM " + }) + void get( + String scenario, + String osType, + String architecture, + boolean javaAtLeast22, + String expectedClassFragment) { + // MemFDUnixWriterFFM uses java.lang.foreign and will fail to load on pre-22 JVMs + boolean realJavaAtLeast22 = JavaVirtualMachine.isJavaVersionAtLeast(22); + Assumptions.assumeTrue(!javaAtLeast22 || realJavaAtLeast22, "FFM writer requires Java 22+"); + try (MockedStatic osMock = mockStatic(OperatingSystem.class); + MockedStatic jvmMock = mockStatic(JavaVirtualMachine.class)) { + osMock.when(OperatingSystem::type).thenReturn(OperatingSystem.Type.valueOf(osType)); + osMock + .when(OperatingSystem::architecture) + .thenReturn(OperatingSystem.Architecture.valueOf(architecture)); + jvmMock.when(() -> JavaVirtualMachine.isJavaVersionAtLeast(22)).thenReturn(javaAtLeast22); + + ForeignMemoryWriter writer = new ForeignMemoryWriterFactory().get(); + + if (expectedClassFragment == null) { + assertNull(writer, scenario); + } else { + assertNotNull(writer, scenario); + assertTrue(writer.getClass().getName().contains(expectedClassFragment), scenario); + } + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/servicediscovery/ServiceDiscoveryTest.java b/dd-trace-core/src/test/java/datadog/trace/core/servicediscovery/ServiceDiscoveryTest.java new file mode 100644 index 00000000000..68779317248 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/servicediscovery/ServiceDiscoveryTest.java @@ -0,0 +1,71 @@ +package datadog.trace.core.servicediscovery; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.Timeout; +import org.msgpack.core.MessagePack; +import org.msgpack.value.MapValue; + +@Timeout(value = 10, unit = TimeUnit.SECONDS) +class ServiceDiscoveryTest { + @Test + void encodePayloadWithAllOptionalFields() throws IOException { + String tracerVersion = "1.2.3"; + String hostname = "test-host"; + String runtimeID = "rid-123"; + String service = "orders"; + String env = "prod"; + String serviceVersion = "1.1.1"; + UTF8BytesString processTags = UTF8BytesString.create("key1:val1,key2:val2"); + String containerID = "containerID"; + boolean appLogsCollectionEnabled = true; + + byte[] out = + ServiceDiscovery.encodePayload( + tracerVersion, + hostname, + appLogsCollectionEnabled, + runtimeID, + service, + env, + serviceVersion, + processTags, + containerID); + MapValue map = MessagePack.newDefaultUnpacker(out).unpackValue().asMapValue(); + + assertEquals(11, map.size()); + assertEquals( + "{\"schema_version\":2,\"tracer_language\":\"java\",\"tracer_version\":\"1.2.3\",\"hostname\":\"test-host\",\"logs_collected\":true,\"runtime_id\":\"rid-123\",\"service_name\":\"orders\",\"service_env\":\"prod\",\"service_version\":\"1.1.1\",\"process_tags\":\"key1:val1,key2:val2\",\"container_id\":\"containerID\"}", + map.toString()); + } + + @Test + void encodePayloadOnlyRequiredFields() throws IOException { + String tracerVersion = "1.2.3"; + String hostname = "my_host"; + + byte[] out = + ServiceDiscovery.encodePayload( + tracerVersion, hostname, false, null, null, null, null, null, null); + MapValue map = MessagePack.newDefaultUnpacker(out).unpackValue().asMapValue(); + + assertEquals(5, map.size()); + assertEquals( + "{\"schema_version\":2,\"tracer_language\":\"java\",\"tracer_version\":\"1.2.3\",\"hostname\":\"my_host\",\"logs_collected\":false}", + map.toString()); + } + + @Test + void generateFileName() { + String name = ServiceDiscovery.generateFileName(); + + String prefix = "datadog-tracer-info-"; + assertTrue(name.startsWith(prefix)); + assertEquals(prefix.length() + 8, name.length()); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/taginterceptor/TagInterceptorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/taginterceptor/TagInterceptorTest.java new file mode 100644 index 00000000000..ae85244a729 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/taginterceptor/TagInterceptorTest.java @@ -0,0 +1,779 @@ +package datadog.trace.core.taginterceptor; + +import static datadog.trace.api.ConfigDefaults.DEFAULT_SERVICE_NAME; +import static datadog.trace.api.DDTags.ANALYTICS_SAMPLE_RATE; +import static datadog.trace.api.TracePropagationStyle.DATADOG; +import static datadog.trace.api.config.GeneralConfig.SERVICE_NAME; +import static datadog.trace.api.config.TracerConfig.SPLIT_BY_TAGS; +import static datadog.trace.bootstrap.instrumentation.api.Tags.HTTP_METHOD; +import static datadog.trace.bootstrap.instrumentation.api.Tags.HTTP_STATUS; +import static datadog.trace.bootstrap.instrumentation.api.Tags.HTTP_URL; +import static datadog.trace.test.junit.utils.config.WithConfigExtension.injectSysConfig; +import static java.util.Collections.emptySet; +import static java.util.Collections.singletonMap; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.params.provider.Arguments.arguments; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import datadog.trace.api.DDSpanTypes; +import datadog.trace.api.DDTags; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.ProductTraceSource; +import datadog.trace.api.env.CapturedEnvironment; +import datadog.trace.api.remoteconfig.ServiceNameCollector; +import datadog.trace.api.remoteconfig.ServiceNameCollectorTestBridge; +import datadog.trace.api.sampling.PrioritySampling; +import datadog.trace.api.sampling.SamplingMechanism; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext; +import datadog.trace.bootstrap.instrumentation.api.InstrumentationTags; +import datadog.trace.bootstrap.instrumentation.api.Tags; +import datadog.trace.common.sampling.AllSampler; +import datadog.trace.common.writer.ListWriter; +import datadog.trace.common.writer.LoggingWriter; +import datadog.trace.core.CoreSpan; +import datadog.trace.core.CoreTracer; +import datadog.trace.core.DDCoreJavaSpecification; +import datadog.trace.core.DDSpan; +import datadog.trace.core.DDSpanContext; +import datadog.trace.core.propagation.ExtractedContext; +import datadog.trace.core.propagation.PropagationTags; +import datadog.trace.test.junit.utils.config.WithConfig; +import datadog.trace.test.junit.utils.converter.ConfigDefaultsConverter; +import datadog.trace.test.junit.utils.converter.TagsConverter; +import java.util.Collections; +import java.util.Map; +import java.util.function.Function; +import java.util.stream.Stream; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.converter.ConvertWith; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.params.provider.ValueSource; +import org.tabletest.junit.TableTest; + +@WithConfig(key = SPLIT_BY_TAGS, value = "sn.tag1,sn.tag2") +class TagInterceptorTest extends DDCoreJavaSpecification { + + @TableTest({ + "scenario | tag | name | expected ", + "service.name some | 'DDTags.SERVICE_NAME' | 'some-service' | 'new-service' ", + "service.name other | 'DDTags.SERVICE_NAME' | 'other-service' | 'other-service'", + "service some | 'service' | 'some-service' | 'new-service' ", + "service other | 'service' | 'other-service' | 'other-service'", + "peer.service some | 'Tags.PEER_SERVICE' | 'some-service' | 'new-service' ", + "peer.service other | 'Tags.PEER_SERVICE' | 'other-service' | 'other-service'", + "sn.tag1 some | 'sn.tag1' | 'some-service' | 'new-service' ", + "sn.tag1 other | 'sn.tag1' | 'other-service' | 'other-service'", + "sn.tag2 some | 'sn.tag2' | 'some-service' | 'new-service' ", + "sn.tag2 other | 'sn.tag2' | 'other-service' | 'other-service'" + }) + @WithConfig(key = "dd.trace.PeerServiceTagInterceptor.enabled", value = "true", addPrefix = false) + void setServiceName(@ConvertWith(TagsConverter.class) String tag, String name, String expected) { + Map mapping = singletonMap("some-service", "new-service"); + CoreTracer tracer = + tracerBuilder() + .serviceName("wrong-service") + .writer(new LoggingWriter()) + .sampler(new AllSampler()) + .serviceNameMappings(mapping) + .build(); + + AgentSpan span = tracer.buildSpan("datadog", "some span").withTag(tag, name).start(); + span.finish(); + + assertEquals(expected, span.getServiceName()); + } + + @ParameterizedTest + @MethodSource("defaultOrConfiguredServiceNameCanBeRemappedWithoutSettingTagArguments") + void defaultOrConfiguredServiceNameCanBeRemappedWithoutSettingTag( + String serviceName, String expected, Map mapping) { + CoreTracer tracer = + tracerBuilder() + .serviceName(serviceName) + .writer(new LoggingWriter()) + .sampler(new AllSampler()) + .serviceNameMappings(mapping) + .build(); + AgentSpan span = tracer.buildSpan("datadog", "some span").start(); + span.finish(); + + assertEquals(expected, span.getServiceName()); + } + + static Stream defaultOrConfiguredServiceNameCanBeRemappedWithoutSettingTagArguments() { + return Stream.of( + // spotless:off + arguments(DEFAULT_SERVICE_NAME, DEFAULT_SERVICE_NAME, singletonMap("other-service-name", "other-service")), + arguments(DEFAULT_SERVICE_NAME, "new-service", singletonMap(DEFAULT_SERVICE_NAME, "new-service")), + arguments("other-service-name", "other-service", singletonMap("other-service-name", "other-service")) + // spotless:on + ); + } + + @TableTest({ + "scenario | context | serviceName | expected ", + "root context with default service | '/' | 'DEFAULT_SERVLET_ROOT_CONTEXT_SERVICE_NAME' | 'DEFAULT_SERVLET_ROOT_CONTEXT_SERVICE_NAME'", + "empty context with default service | '' | 'DEFAULT_SERVICE_NAME' | 'DEFAULT_SERVICE_NAME' ", + "/some-context with default service | '/some-context' | 'DEFAULT_SERVICE_NAME' | 'some-context' ", + "other-context with default service | 'other-context' | 'DEFAULT_SERVICE_NAME' | 'other-context' ", + "root context with my-service | '/' | 'my-service' | 'my-service' ", + "empty context with my-service | '' | 'my-service' | 'my-service' ", + "/some-context with my-service | '/some-context' | 'my-service' | 'my-service' ", + "other-context with my-service | 'other-context' | 'my-service' | 'my-service' " + }) + void setServiceNameFromServletContext( + String context, + @ConvertWith(ConfigDefaultsConverter.class) String serviceName, + @ConvertWith(ConfigDefaultsConverter.class) String expected) { + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + AgentSpan span = tracer.buildSpan("datadog", "test").start(); + span.setTag(DDTags.SERVICE_NAME, serviceName); + span.setTag("servlet.context", context); + + assertEquals(expected, span.getServiceName()); + } + + @TableTest({ + "scenario | context | serviceName ", + "root context / default service | '/' | 'DEFAULT_SERVICE_NAME'", + "empty context / default service | '' | 'DEFAULT_SERVICE_NAME'", + "/some-context / default service | '/some-context' | 'DEFAULT_SERVICE_NAME'", + "other-context / default service | 'other-context' | 'DEFAULT_SERVICE_NAME'", + "root context / env service | '/' | 'ENV_SERVICE_NAME' ", + "empty context / env service | '' | 'ENV_SERVICE_NAME' ", + "/some-context / env service | '/some-context' | 'ENV_SERVICE_NAME' ", + "other-context / env service | 'other-context' | 'ENV_SERVICE_NAME' ", + "root context / my-service | '/' | 'my-service' ", + "empty context / my-service | '' | 'my-service' ", + "/some-context / my-service | '/some-context' | 'my-service' ", + "other-context / my-service | 'other-context' | 'my-service' " + }) + void settingServiceNameAsPropertyDisablesServletContext( + String context, @ConvertWith(ConfigDefaultsConverter.class) String serviceName) { + if ("ENV_SERVICE_NAME".equals(serviceName)) { + serviceName = CapturedEnvironment.get().getProperties().get(SERVICE_NAME); + } + injectSysConfig("service", serviceName); + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + AgentSpan span = tracer.buildSpan("datadog", "test").start(); + span.setTag("servlet.context", context); + + assertEquals(serviceName, span.getServiceName()); + } + + @ParameterizedTest + @ValueSource(strings = {DEFAULT_SERVICE_NAME, "my-service"}) + void mappingCausesServletContextToNotChangeServiceName(String serviceName) { + Map mapping = singletonMap(serviceName, "new-service"); + CoreTracer tracer = + tracerBuilder() + .serviceName(serviceName) + .writer(new LoggingWriter()) + .sampler(new AllSampler()) + .serviceNameMappings(mapping) + .build(); + + AgentSpan span = tracer.buildSpan("datadog", "some span").start(); + span.setTag("servlet.context", "/some-context"); + span.finish(); + + assertEquals("new-service", span.getServiceName()); + } + + private CoreTracer createSplittingTracer(String tag) { + return tracerBuilder() + .serviceName("my-service") + .writer(new LoggingWriter()) + .sampler(new AllSampler()) + // equivalent to split-by-tags: tag + .tagInterceptor( + new TagInterceptor( + true, "my-service", Collections.singleton(tag), new RuleFlags(), false)) + .build(); + } + + @TableTest({ + "scenario | expected | jeeActive", + "jee inactive | 'some-context' | false ", + "jee active | 'my-service' | true " + }) + void splitByTagsForServletContextAndExperimentalJeeSplitByDeployment( + String expected, boolean jeeActive) { + CoreTracer tracer = + tracerBuilder() + .serviceName("my-service") + .writer(new LoggingWriter()) + .sampler(new AllSampler()) + .tagInterceptor( + new TagInterceptor(false, "my-service", emptySet(), new RuleFlags(), jeeActive)) + .build(); + + AgentSpan span = tracer.buildSpan("datadog", "some span").start(); + span.setTag(InstrumentationTags.SERVLET_CONTEXT, "some-context"); + span.finish(); + + assertEquals(expected, span.getServiceName()); + } + + @Test + void peerServiceThenSplitByTagsViaBuilder() { + CoreTracer tracer = createSplittingTracer(Tags.MESSAGE_BUS_DESTINATION); + + AgentSpan span = + tracer + .buildSpan("datadog", "some span") + .withTag(Tags.PEER_SERVICE, "peer-service") + .withTag(Tags.MESSAGE_BUS_DESTINATION, "some-queue") + .start(); + span.finish(); + + assertEquals("some-queue", span.getServiceName()); + } + + @Test + void peerServiceThenSplitByTagsViaSetTag() { + CoreTracer tracer = createSplittingTracer(Tags.MESSAGE_BUS_DESTINATION); + + AgentSpan span = tracer.buildSpan("datadog", "some span").start(); + span.setTag(Tags.PEER_SERVICE, "peer-service"); + span.setTag(Tags.MESSAGE_BUS_DESTINATION, "some-queue"); + span.finish(); + + assertEquals("some-queue", span.getServiceName()); + } + + @ParameterizedTest + @ValueSource(booleans = {true, false}) + void splitByTagsThenPeerServiceViaBuilder(boolean enabled) { + injectSysConfig("dd.trace.PeerServiceTagInterceptor.enabled", String.valueOf(enabled), false); + CoreTracer tracer = createSplittingTracer(Tags.MESSAGE_BUS_DESTINATION); + + AgentSpan span = + tracer + .buildSpan("datadog", "some span") + .withTag(Tags.MESSAGE_BUS_DESTINATION, "some-queue") + .withTag(Tags.PEER_SERVICE, "peer-service") + .start(); + span.finish(); + + assertEquals(enabled, "peer-service".equals(span.getServiceName())); + } + + @Test + @WithConfig(key = "dd.trace.PeerServiceTagInterceptor.enabled", value = "true", addPrefix = false) + void splitByTagsThenPeerServiceViaSetTag() { + CoreTracer tracer = createSplittingTracer(Tags.MESSAGE_BUS_DESTINATION); + + AgentSpan span = tracer.buildSpan("datadog", "some span").start(); + span.setTag(Tags.MESSAGE_BUS_DESTINATION, "some-queue"); + span.setTag(Tags.PEER_SERVICE, "peer-service"); + span.finish(); + + assertEquals("peer-service", span.getServiceName()); + } + + @Test + void setResourceName() throws Exception { + ListWriter writer = new ListWriter(); + CoreTracer tracer = tracerBuilder().writer(writer).build(); + + String name = "my resource name"; + AgentSpan span = tracer.buildSpan("datadog", "test").start(); + span.setTag(DDTags.RESOURCE_NAME, name); + span.finish(); + writer.waitForTraces(1); + + assertEquals(name, span.getResourceName().toString()); + } + + @Test + void setResourceNameIgnoresNull() throws Exception { + ListWriter writer = new ListWriter(); + CoreTracer tracer = tracerBuilder().writer(writer).build(); + + AgentSpan span = tracer.buildSpan("datadog", "test").withResourceName("keep").start(); + span.setTag(DDTags.RESOURCE_NAME, (String) null); + span.finish(); + writer.waitForTraces(1); + + assertEquals("keep", span.getResourceName().toString()); + } + + @Test + void setSpanType() { + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + AgentSpan span = tracer.buildSpan("datadog", "test").start(); + String type = DDSpanTypes.HTTP_CLIENT; + span.setSpanType(type); + span.finish(); + + assertEquals(type, span.getSpanType()); + } + + @Test + void setSpanTypeWithTag() throws Exception { + ListWriter writer = new ListWriter(); + CoreTracer tracer = tracerBuilder().writer(writer).build(); + AgentSpan span = tracer.buildSpan("datadog", "test").start(); + String type = DDSpanTypes.HTTP_CLIENT; + span.setTag(DDTags.SPAN_TYPE, type); + span.finish(); + writer.waitForTraces(1); + + assertEquals(type, span.getSpanType()); + } + + static Stream spanMetricsStartsEmptyButAddedWithRateLimitingValueArguments() { + return Stream.of( + arguments("int 0", 0, 0), + arguments("int 1", 1, 1), + arguments("float 0", 0f, 0f), + arguments("float 1", 1f, 1f), + arguments("double 0.1", 0.1, 0.1), + arguments("double 1.1", 1.1, 1.1), + arguments("int -1", -1, -1), + arguments("int 10", 10, 10), + arguments("string '00'", "00", 0.0), + arguments("string '1'", "1", 1.0), + arguments("string '1.0'", "1.0", 1.0), + arguments("string '0'", "0", 0.0), + arguments("string '0.1'", "0.1", 0.1), + arguments("string '1.1'", "1.1", 1.1), + arguments("string '-1'", "-1", -1.0), + arguments("string 'str'", "str", null)); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("spanMetricsStartsEmptyButAddedWithRateLimitingValueArguments") + void spanMetricsStartsEmptyButAddedWithRateLimitingValue( + String scenario, Object rate, Object result) throws Exception { + ListWriter writer = new ListWriter(); + CoreTracer tracer = tracerBuilder().writer(writer).build(); + AgentSpan span = tracer.buildSpan("datadog", "test").start(); + + assertNull(span.getTag(ANALYTICS_SAMPLE_RATE)); + + span.setTag(ANALYTICS_SAMPLE_RATE, rate); + span.finish(); + writer.waitForTraces(1); + + assertEquals(result, span.getTag(ANALYTICS_SAMPLE_RATE)); + } + + static Stream setPrioritySamplingViaTagArguments() { + return Stream.of( + arguments("manual.keep / true", DDTags.MANUAL_KEEP, true, (int) PrioritySampling.USER_KEEP), + arguments("manual.keep / false", DDTags.MANUAL_KEEP, false, null), + arguments( + "manual.keep / 'true'", DDTags.MANUAL_KEEP, "true", (int) PrioritySampling.USER_KEEP), + arguments("manual.keep / 'false'", DDTags.MANUAL_KEEP, "false", null), + arguments("manual.keep / 'asdf'", DDTags.MANUAL_KEEP, "asdf", null), + arguments("manual.drop / true", DDTags.MANUAL_DROP, true, (int) PrioritySampling.USER_DROP), + arguments("manual.drop / false", DDTags.MANUAL_DROP, false, null), + arguments( + "manual.drop / 'true'", DDTags.MANUAL_DROP, "true", (int) PrioritySampling.USER_DROP), + arguments("manual.drop / 'false'", DDTags.MANUAL_DROP, "false", null), + arguments("manual.drop / 'asdf'", DDTags.MANUAL_DROP, "asdf", null), + arguments("asm.keep / true", Tags.ASM_KEEP, true, (int) PrioritySampling.USER_KEEP), + arguments("asm.keep / false", Tags.ASM_KEEP, false, null), + arguments("asm.keep / 'true'", Tags.ASM_KEEP, "true", (int) PrioritySampling.USER_KEEP), + arguments("asm.keep / 'false'", Tags.ASM_KEEP, "false", null), + arguments("asm.keep / 'asdf'", Tags.ASM_KEEP, "asdf", null), + arguments( + "ai_guard.keep / true", Tags.AI_GUARD_KEEP, true, (int) PrioritySampling.USER_KEEP), + arguments("ai_guard.keep / false", Tags.AI_GUARD_KEEP, false, null), + arguments( + "ai_guard.keep / 'true'", Tags.AI_GUARD_KEEP, "true", (int) PrioritySampling.USER_KEEP), + arguments("ai_guard.keep / 'false'", Tags.AI_GUARD_KEEP, "false", null), + arguments("ai_guard.keep / 'asdf'", Tags.AI_GUARD_KEEP, "asdf", null), + arguments( + "sampling.priority / -1", Tags.SAMPLING_PRIORITY, -1, (int) PrioritySampling.USER_DROP), + arguments( + "sampling.priority / 0", Tags.SAMPLING_PRIORITY, 0, (int) PrioritySampling.USER_DROP), + arguments( + "sampling.priority / 1", Tags.SAMPLING_PRIORITY, 1, (int) PrioritySampling.USER_KEEP), + arguments( + "sampling.priority / 2", Tags.SAMPLING_PRIORITY, 2, (int) PrioritySampling.USER_KEEP), + arguments( + "sampling.priority / '-1'", + Tags.SAMPLING_PRIORITY, + "-1", + (int) PrioritySampling.USER_DROP), + arguments( + "sampling.priority / '0'", + Tags.SAMPLING_PRIORITY, + "0", + (int) PrioritySampling.USER_DROP), + arguments( + "sampling.priority / '1'", + Tags.SAMPLING_PRIORITY, + "1", + (int) PrioritySampling.USER_KEEP), + arguments( + "sampling.priority / '2'", + Tags.SAMPLING_PRIORITY, + "2", + (int) PrioritySampling.USER_KEEP), + arguments("sampling.priority / 'asdf'", Tags.SAMPLING_PRIORITY, "asdf", null)); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("setPrioritySamplingViaTagArguments") + void setPrioritySamplingViaTag(String scenario, String tag, Object value, Integer expected) { + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + AgentSpan span = tracer.buildSpan("datadog", "test").start(); + span.setTag(tag, value); + + assertEquals(expected, span.getSamplingPriority()); + } + + @Test + void samplingPriorityPositiveTagOverridesLockedPriority() { + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + AgentSpan span = tracer.buildSpan("datadog", "test").start(); + + // Simulate upstream propagation of x-datadog-sampling-priority: -1 (USER_DROP) + span.setSamplingPriority(PrioritySampling.USER_DROP, SamplingMechanism.UNKNOWN); + assertEquals((int) PrioritySampling.USER_DROP, span.getSamplingPriority()); + + // positive sampling.priority overrides the propagated locked priority + span.setTag(Tags.SAMPLING_PRIORITY, 2); + assertEquals((int) PrioritySampling.USER_KEEP, span.getSamplingPriority()); + } + + @Test + void samplingPriorityNonPositiveTagDoesNotOverrideLockedPriority() { + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + AgentSpan span = tracer.buildSpan("datadog", "test").start(); + + // Simulate upstream propagation of x-datadog-sampling-priority: 2 (USER_KEEP) + span.setSamplingPriority(PrioritySampling.USER_KEEP, SamplingMechanism.UNKNOWN); + assertEquals((int) PrioritySampling.USER_KEEP, span.getSamplingPriority()); + + // non-positive sampling.priority respects the propagated locked priority + span.setTag(Tags.SAMPLING_PRIORITY, 0); + assertEquals((int) PrioritySampling.USER_KEEP, span.getSamplingPriority()); + } + + @Test + void samplingPriorityPositiveTagOverridesDecisionMakerFromUpstreamPropagation() { + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + // Upstream service dropped with LOCAL_USER_RULE and propagated _dd.p.dm=-3 + PropagationTags propagationTags = + PropagationTags.factory() + .fromHeaderValue(PropagationTags.HeaderType.DATADOG, "_dd.p.dm=-3"); + AgentSpanContext extracted = + new ExtractedContext( + DDTraceId.from(123), 456L, PrioritySampling.USER_DROP, null, propagationTags, DATADOG); + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "test").asChildOf(extracted).start(); + + // positive sampling.priority overrides locked priority and sets _dd.p.dm to MANUAL + span.setTag(Tags.SAMPLING_PRIORITY, 2); + + assertEquals((int) PrioritySampling.USER_KEEP, span.getSamplingPriority()); + assertEquals( + "_dd.p.dm=-4", + span.spanContext().getPropagationTags().headerValue(PropagationTags.HeaderType.DATADOG)); + } + + @ParameterizedTest + @ValueSource(booleans = {true, false}) + void setErrorFlagWhenErrorTagReported(boolean error) throws Exception { + ListWriter writer = new ListWriter(); + CoreTracer tracer = tracerBuilder().writer(writer).build(); + AgentSpan span = tracer.buildSpan("datadog", "test").start(); + span.setTag(Tags.ERROR, error); + span.finish(); + writer.waitForTraces(1); + + assertEquals(error, span.isError()); + } + + static Stream interceptorsApplyToBuilderTooArguments() { + return Stream.of( + arguments( + "serviceName", + DDTags.SERVICE_NAME, + "my-service", + (Function) DDSpanContext::getServiceName), + arguments( + "resourceName", + DDTags.RESOURCE_NAME, + "my-resource", + (Function) ctx -> ctx.getResourceName().toString()), + arguments( + "spanType", + DDTags.SPAN_TYPE, + "my-span-type", + (Function) DDSpanContext::getSpanType)); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("interceptorsApplyToBuilderTooArguments") + void interceptorsApplyToBuilderToo( + String attribute, String name, String value, Function getter) + throws Exception { + ListWriter writer = new ListWriter(); + CoreTracer tracer = tracerBuilder().writer(writer).build(); + + AgentSpan span = tracer.buildSpan("datadog", "interceptor.test").withTag(name, value).start(); + span.finish(); + writer.waitForTraces(1); + + assertEquals(value, getter.apply((DDSpanContext) span.spanContext())); + } + + @Test + void decoratorsApplyToBuilderToo() throws Exception { + ListWriter writer = new ListWriter(); + CoreTracer tracer = tracerBuilder().writer(writer).build(); + + AgentSpan span = + tracer.buildSpan("datadog", "decorator.test").withTag("sn.tag1", "some val").start(); + span.finish(); + writer.waitForTraces(1); + assertEquals("some val", span.getServiceName()); + + span = + tracer + .buildSpan("datadog", "decorator.test") + .withTag("servlet.context", "/my-servlet") + .start(); + assertEquals("my-servlet", span.getServiceName()); + + span = tracer.buildSpan("datadog", "decorator.test").withTag("error", "true").start(); + span.finish(); + writer.waitForTraces(2); + assertTrue(span.isError()); + + span = + tracer + .buildSpan("datadog", "decorator.test") + .withTag(Tags.DB_STATEMENT, "some-statement") + .start(); + span.finish(); + writer.waitForTraces(3); + assertEquals("some-statement", span.getResourceName().toString()); + } + + @TableTest({ + "scenario | decorator | enabled", + "lowercase enabled | 'servicenametaginterceptor' | true ", + "camelCase enabled | 'ServiceNameTagInterceptor' | true ", + "lowercase disabled | 'servicenametaginterceptor' | false ", + "camelCase disabled | 'ServiceNameTagInterceptor' | false " + }) + void disableDecoratorViaConfig(String decorator, boolean enabled) { + injectSysConfig("dd.trace." + decorator + ".enabled", String.valueOf(enabled), false); + + CoreTracer tracer = + tracerBuilder() + .serviceName("some-service") + .writer(new LoggingWriter()) + .sampler(new AllSampler()) + .build(); + + AgentSpan span = + tracer + .buildSpan("datadog", "some span") + .withTag(DDTags.SERVICE_NAME, "other-service") + .start(); + span.finish(); + + assertEquals(enabled ? "other-service" : "some-service", span.getServiceName()); + } + + @TableTest({ + "scenario | tag | name | expected ", + "service.name | 'DDTags.SERVICE_NAME' | 'new-service' | 'some-service'", + "service | 'service' | 'new-service' | 'some-service'", + "sn.tag1 | 'sn.tag1' | 'new-service' | 'new-service' " + }) + void disablingServiceDecoratorDoesNotDisableSplitByTags( + @ConvertWith(TagsConverter.class) String tag, String name, String expected) { + injectSysConfig("dd.trace.ServiceNameTagInterceptor.enabled", "false", false); + + CoreTracer tracer = + tracerBuilder() + .serviceName("some-service") + .writer(new LoggingWriter()) + .sampler(new AllSampler()) + .build(); + + AgentSpan span = tracer.buildSpan("datadog", "some span").withTag(tag, name).start(); + span.finish(); + + assertEquals(expected, span.getServiceName()); + } + + @Test + void changeTopLevelStatusWhenChangingServiceName() { + CoreTracer tracer = + tracerBuilder() + .serviceName("some-service") + .writer(new LoggingWriter()) + .sampler(new AllSampler()) + .build(); + + AgentSpan parent = tracer.buildSpan("datadog", "parent").withServiceName("parent").start(); + + // the service name doesn't match the parent + AgentSpan child = + tracer.buildSpan("datadog", "child").withServiceName("child").asChildOf(parent).start(); + assertTrue(((CoreSpan) child).isTopLevel()); + + // the service name is changed to match the parent + child.setTag(DDTags.SERVICE_NAME, "parent"); + assertFalse(((CoreSpan) child).isTopLevel()); + + // the service name is changed to no longer match the parent + child.setTag(DDTags.SERVICE_NAME, "foo"); + assertTrue(((CoreSpan) child).isTopLevel()); + } + + static Stream treat1ValueAsTrueForBooleanTagValuesArguments() { + return Stream.of( + arguments("manual.drop / true", DDTags.MANUAL_DROP, true, (int) PrioritySampling.USER_DROP), + arguments("manual.drop / '1'", DDTags.MANUAL_DROP, "1", (int) PrioritySampling.USER_DROP), + arguments("manual.drop / false", DDTags.MANUAL_DROP, false, null), + arguments("manual.drop / '0'", DDTags.MANUAL_DROP, "0", null), + arguments("manual.keep / true", DDTags.MANUAL_KEEP, true, (int) PrioritySampling.USER_KEEP), + arguments("manual.keep / '1'", DDTags.MANUAL_KEEP, "1", (int) PrioritySampling.USER_KEEP), + arguments("manual.keep / false", DDTags.MANUAL_KEEP, false, null), + arguments("manual.keep / '0'", DDTags.MANUAL_KEEP, "0", null)); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("treat1ValueAsTrueForBooleanTagValuesArguments") + void treat1ValueAsTrueForBooleanTagValues( + String scenario, String tag, Object value, Integer samplingPriority) { + CoreTracer tracer = + tracerBuilder() + .serviceName("some-service") + .writer(new LoggingWriter()) + .sampler(new AllSampler()) + .build(); + + AgentSpan span = tracer.buildSpan("datadog", "test").start(); + assertNull(span.getSamplingPriority()); + + span.setTag(tag, value); + assertEquals(samplingPriority, span.getSamplingPriority()); + } + + @TableTest({ + "scenario | URL | tags | expectedResourceName", + "null url | | | 'fakeOperation' ", + "space url | ' ' | | '/' ", + "tab url | '\t' | | '/' ", + "simple path | '/path' | | '/path' ", + "complex path | '/ABC/a-1/b_2/c.3/d4d/5f/6' | | '/ABC/?/?/?/?/?/?' " + }) + @ParameterizedTest + @MethodSource("urlAsResourceNameRuleSetsTheResourceNameArguments") + void urlAsResourceNameRuleSetsTheResourceName( + String url, Map tags, String expectedResourceName) { + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + + AgentSpan span = tracer.buildSpan("datadog", "fakeOperation").start(); + span.setTag(HTTP_URL, url); + if (tags != null) { + tags.forEach(span::setTag); + } + + try { + assertEquals(expectedResourceName, span.getResourceName().toString()); + } finally { + span.finish(); + } + } + + static Stream urlAsResourceNameRuleSetsTheResourceNameArguments() { + return Stream.of( + // spotless:off + arguments("/not-found", singletonMap(HTTP_STATUS, "404"), "404"), + arguments("/with-method", singletonMap(HTTP_METHOD, "Post"), "POST /with-method") + // spotless:on + ); + } + + @Test + void whenUserSetsPeerServiceTheSourceShouldBePeerService() { + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + + AgentSpan span = tracer.buildSpan("datadog", "fakeOperation").start(); + try { + span.setTag(Tags.PEER_SERVICE, "test"); + assertEquals("peer.service", span.getTag(DDTags.PEER_SERVICE_SOURCE)); + } finally { + span.finish(); + } + } + + @Test + void whenInterceptServiceNameExtraServiceProviderIsCalled() { + ServiceNameCollector origServiceNameCollector = ServiceNameCollector.get(); + ServiceNameCollector extraServiceProvider = mock(ServiceNameCollector.class); + ServiceNameCollectorTestBridge.setInstance(extraServiceProvider); + try { + RuleFlags ruleFlags = mock(RuleFlags.class); + when(ruleFlags.isEnabled(any())).thenReturn(true); + TagInterceptor interceptor = + new TagInterceptor( + true, "my-service", Collections.singleton(DDTags.SERVICE_NAME), ruleFlags, false); + + interceptor.interceptServiceName(null, mock(DDSpanContext.class), "some-service"); + + verify(extraServiceProvider, times(1)).addService("some-service"); + } finally { + ServiceNameCollectorTestBridge.setInstance(origServiceNameCollector); + } + } + + @TableTest({ + "scenario | value | expected ", + "root context | '/' | 'root-servlet'", + "/test path | '/test' | 'test' ", + "test path | 'test' | 'test' " + }) + void whenInterceptServletContextExtraServiceProviderIsCalled(String value, String expected) { + ServiceNameCollector origServiceNameCollector = ServiceNameCollector.get(); + ServiceNameCollector extraServiceProvider = mock(ServiceNameCollector.class); + ServiceNameCollectorTestBridge.setInstance(extraServiceProvider); + try { + RuleFlags ruleFlags = mock(RuleFlags.class); + when(ruleFlags.isEnabled(any())).thenReturn(true); + TagInterceptor interceptor = + new TagInterceptor( + true, "my-service", Collections.singleton("servlet.context"), ruleFlags, false); + + interceptor.interceptServletContext(mock(DDSpanContext.class), value); + + verify(extraServiceProvider, times(1)).addService(expected); + } finally { + ServiceNameCollectorTestBridge.setInstance(origServiceNameCollector); + } + } + + @Test + void whenInterceptsProductTraceSourcePropagationTagUpdatePropagatedTraceSourceIsCalled() { + RuleFlags ruleFlags = mock(RuleFlags.class); + when(ruleFlags.isEnabled(any())).thenReturn(true); + TagInterceptor interceptor = new TagInterceptor(ruleFlags); + DDSpanContext context = mock(DDSpanContext.class); + + interceptor.interceptTag(context, Tags.PROPAGATED_TRACE_SOURCE, ProductTraceSource.ASM); + + verify(context, times(1)).addPropagatedTraceSource(ProductTraceSource.ASM); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/tagprocessor/IntegrationAdderTest.java b/dd-trace-core/src/test/java/datadog/trace/core/tagprocessor/IntegrationAdderTest.java new file mode 100644 index 00000000000..8b6aa9cedae --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/tagprocessor/IntegrationAdderTest.java @@ -0,0 +1,38 @@ +package datadog.trace.core.tagprocessor; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import datadog.trace.api.TagMap; +import datadog.trace.core.DDSpanContext; +import datadog.trace.test.util.DDJavaSpecification; +import java.util.Collections; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; + +class IntegrationAdderTest extends DDJavaSpecification { + + @ValueSource(booleans = {true, false}) + @ParameterizedTest( + name = "should add or remove _dd.integration when set ({0}) on the span context") + void shouldAddOrRemoveDdIntegrationWhenSetOnTheSpanContext(boolean isSet) { + IntegrationAdder calculator = new IntegrationAdder(); + DDSpanContext spanContext = mock(DDSpanContext.class); + when(spanContext.getIntegrationName()).thenReturn(isSet ? "test" : null); + + TagMap unsafeTags = TagMap.fromMap(Collections.singletonMap("_dd.integration", "bad")); + calculator.processTags(unsafeTags, spanContext, link -> {}); + + verify(spanContext, times(1)).getIntegrationName(); + + if (isSet) { + assertEquals(Collections.singletonMap("_dd.integration", "test"), unsafeTags); + } else { + assertTrue(unsafeTags.isEmpty()); + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/tagprocessor/InternalTagsAdderTest.java b/dd-trace-core/src/test/java/datadog/trace/core/tagprocessor/InternalTagsAdderTest.java new file mode 100644 index 00000000000..ea3798a4427 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/tagprocessor/InternalTagsAdderTest.java @@ -0,0 +1,70 @@ +package datadog.trace.core.tagprocessor; + +import static datadog.trace.bootstrap.instrumentation.api.Tags.VERSION; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import datadog.trace.api.TagMap; +import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; +import datadog.trace.core.DDSpanContext; +import datadog.trace.test.util.DDJavaSpecification; +import java.util.Collections; +import java.util.Objects; +import org.tabletest.junit.TableTest; + +class InternalTagsAdderTest extends DDJavaSpecification { + + @TableTest({ + "scenario | serviceName | expectsBaseService", + "different service | anotherOne | true ", + "exact match | test | false ", + "case insensitive | TeSt | false " + }) + void shouldAddBaseServiceWhenServiceDiffersToDdService( + String serviceName, boolean expectsBaseService) { + InternalTagsAdder calculator = new InternalTagsAdder("test", null); + DDSpanContext spanContext = mock(DDSpanContext.class); + when(spanContext.getServiceName()).thenReturn(serviceName); + + TagMap unsafeTags = TagMap.fromMap(Collections.emptyMap()); + calculator.processTags(unsafeTags, spanContext, link -> {}); + + verify(spanContext, times(1)).getServiceName(); + + if (expectsBaseService) { + assertEquals(UTF8BytesString.create("test"), unsafeTags.get("_dd.base_service")); + } else { + assertTrue(unsafeTags.isEmpty()); + } + } + + @TableTest({ + "scenario | serviceName | ddVersion | initialVersion | expected", + "same service, no version | same | | | ", + "different service with ddVersion | different | 1.0 | | ", + "different service, manual version | different | 1.0 | 2.0 | 2.0 ", + "same service, no ddVersion | same | | 2.0 | 2.0 ", + "same service, both versions | same | 1.0 | 2.0 | 2.0 ", + "same service, only ddVersion | same | 1.0 | | 1.0 " + }) + void shouldAddVersionWhenDdServiceEqualsServiceNameAndVersionSet( + String serviceName, String ddVersion, String initialVersion, String expected) { + InternalTagsAdder calculator = new InternalTagsAdder("same", ddVersion); + DDSpanContext spanContext = mock(DDSpanContext.class); + when(spanContext.getServiceName()).thenReturn(serviceName); + + TagMap unsafeTags = + TagMap.fromMap( + initialVersion != null + ? Collections.singletonMap("version", initialVersion) + : Collections.emptyMap()); + calculator.processTags(unsafeTags, spanContext, link -> {}); + + verify(spanContext, times(1)).getServiceName(); + assertEquals(expected, Objects.toString(unsafeTags.get(VERSION), null)); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/tagprocessor/PayloadTagsProcessorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/tagprocessor/PayloadTagsProcessorTest.java new file mode 100644 index 00000000000..1405c6329ae --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/tagprocessor/PayloadTagsProcessorTest.java @@ -0,0 +1,491 @@ +package datadog.trace.core.tagprocessor; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; + +import com.squareup.moshi.JsonWriter; +import datadog.trace.api.Config; +import datadog.trace.api.TagMap; +import datadog.trace.payloadtags.PayloadTagsData; +import datadog.trace.payloadtags.PayloadTagsData.PathAndValue; +import datadog.trace.test.junit.utils.config.WithConfigExtension; +import datadog.trace.test.util.DDJavaSpecification; +import datadog.trace.util.json.PathCursor; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.time.Instant; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Stream; +import okio.Buffer; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.params.provider.ValueSource; +import org.tabletest.junit.TableTest; + +class PayloadTagsProcessorTest extends DDJavaSpecification { + + private static PathCursor pc() { + return new PathCursor(10); + } + + private static PathAndValue pv(PathCursor path, Object value) { + return new PathAndValue(path.toPath(), value); + } + + private static PayloadTagsData payloadData(PathAndValue... pvs) { + return new PayloadTagsData(pvs); + } + + private static Map spanTags(String tagPrefix, PathAndValue... pvs) { + Map map = new LinkedHashMap<>(); + map.put(tagPrefix, payloadData(pvs)); + return map; + } + + private static PayloadTagsProcessor tagsProcessor( + String tagPrefix, List redactionRules, int maxDepth, int maxTags) { + PayloadTagsProcessor.RedactionRules rules = + new PayloadTagsProcessor.RedactionRules.Builder() + .addRedactionJsonPaths(redactionRules) + .build(); + Map rulesMap = new HashMap<>(); + rulesMap.put(tagPrefix, rules); + return new PayloadTagsProcessor(rulesMap, maxDepth, maxTags); + } + + /** Builds a LinkedHashMap from alternating key-value pairs; supports null values. */ + @SafeVarargs + private static Map mapOf(Object... pairs) { + Map result = new LinkedHashMap<>(); + for (int i = 0; i < pairs.length; i += 2) { + @SuppressWarnings("unchecked") + V val = (V) pairs[i + 1]; + result.put((String) pairs[i], val); + } + return result; + } + + @Test + void disabledByDefault() { + assertNull(PayloadTagsProcessor.create(Config.get())); + } + + static Stream enabledWithDefaultsWhenConfiguredArguments() { + return Stream.of( + Arguments.arguments("all", "all", "aws.request.body", pc().push("phoneNumber")), + Arguments.arguments("all", "$[33].baz", "aws.request.body", pc().push("AWSAccountId")), + Arguments.arguments( + "$.bar", + "all", + "aws.response.body", + pc().push("Endpoints").push("foobar").push("Token")), + Arguments.arguments("$.foo.bar", "$..bar.*", "aws.request.body", pc().push("phoneNumber")), + Arguments.arguments(null, "all", "aws.response.body", pc().push("phoneNumbers").push(5)), + Arguments.arguments( + "all", null, "aws.request.body", pc().push("Attributes").push("KmsMasterKeyId"))); + } + + @ParameterizedTest(name = "enabled with defaults when configured req {0} resp {1}") + @MethodSource("enabledWithDefaultsWhenConfiguredArguments") + void enabledWithDefaultsWhenConfigured( + String requestPayloadTagging, + String responsePayloadTagging, + String tagPrefix, + PathCursor pathMatchingDefaultRules) { + if (requestPayloadTagging != null) { + WithConfigExtension.injectSysConfig( + "trace.cloud.request.payload.tagging", requestPayloadTagging); + } + if (responsePayloadTagging != null) { + WithConfigExtension.injectSysConfig( + "trace.cloud.response.payload.tagging", responsePayloadTagging); + } + + PayloadTagsProcessor ptp = PayloadTagsProcessor.create(Config.get()); + + assertNotNull(ptp); + assertEquals(10, ptp.maxDepth); + assertEquals(758, ptp.maxTags); + assertNotNull( + ptp.redactionRulesByTagPrefix.get(tagPrefix).findMatching(pathMatchingDefaultRules)); + assertNull( + ptp.redactionRulesByTagPrefix.get(tagPrefix).findMatching(pc().push("non-matching-path"))); + } + + @TableTest({ + "scenario | requestPayloadTagging | responsePayloadTagging | maxDepth | maxTags", + "both req and resp all | all | all | 10 | 10 ", + "req filter, no resp | $.bar | | 7 | 42 ", + "req all, resp wildcard | all | $.* | 12 | 50 ", + "no req, resp all | | all | 8 | 33 " + }) + void enabledWithCustomLimits( + String requestPayloadTagging, String responsePayloadTagging, int maxDepth, int maxTags) { + if (requestPayloadTagging != null) { + WithConfigExtension.injectSysConfig( + "trace.cloud.request.payload.tagging", requestPayloadTagging); + } + if (responsePayloadTagging != null) { + WithConfigExtension.injectSysConfig( + "trace.cloud.response.payload.tagging", responsePayloadTagging); + } + WithConfigExtension.injectSysConfig( + "trace.cloud.payload.tagging.max-depth", String.valueOf(maxDepth)); + WithConfigExtension.injectSysConfig( + "trace.cloud.payload.tagging.max-tags", String.valueOf(maxTags)); + + PayloadTagsProcessor ptp = PayloadTagsProcessor.create(Config.get()); + + assertEquals(maxDepth, ptp.maxDepth); + assertEquals(maxTags, ptp.maxTags); + } + + @Test + void preserveAllSpanTagsExceptForPayloadData() { + PayloadTagsProcessor ptp = tagsProcessor("payload", Collections.emptyList(), 10, 758); + Map spanTags = new LinkedHashMap<>(); + spanTags.put("foo", "bar"); + spanTags.put("tag1", 1); + spanTags.put("payload", new PayloadTagsData(new PathAndValue[0])); + + TagMap unsafeTags = TagMap.fromMap(spanTags); + ptp.processTags(unsafeTags, null, link -> {}); + + assertEquals(mapOf("foo", "bar", "tag1", 1), unsafeTags); + } + + @Test + void expandPayloadToTags() { + PayloadTagsProcessor ptp = tagsProcessor("payload", Collections.emptyList(), 10, 758); + Map spanTags = new LinkedHashMap<>(); + spanTags.put("foo", "bar"); + spanTags.put("tag1", 1); + spanTags.put("payload", payloadData(pv(pc().push("tag1"), 0))); + + TagMap unsafeTags = TagMap.fromMap(spanTags); + ptp.processTags(unsafeTags, null, link -> {}); + + assertEquals(mapOf("foo", "bar", "tag1", 1, "payload.tag1", 0), unsafeTags); + } + + @Test + void expandPreservingTagTypes() { + PayloadTagsProcessor ptp = tagsProcessor("payload", Collections.emptyList(), 10, 758); + + Map st = + spanTags( + "payload", + pv(pc().push("tag1"), 11), + pv(pc().push("tag2").push("Value"), 2342L), + pv(pc().push("tag3").push(0), 3.14d), + pv(pc().push("tag4").push("Value").push(0), "string"), + pv(pc().push("tag5"), null), + pv(pc().push("tag6"), false)); + + TagMap unsafeTags = TagMap.fromMap(st); + ptp.processTags(unsafeTags, null, link -> {}); + + Map expected = + mapOf( + "payload.tag1", + 11, + "payload.tag2.Value", + 2342L, + "payload.tag3.0", + 3.14d, + "payload.tag4.Value.0", + "string", + "payload.tag5", + null, + "payload.tag6", + false); + assertEquals(expected, unsafeTags); + } + + @Test + void expandUnknownTagValuesToString() { + PayloadTagsProcessor ptp = tagsProcessor("payload", Collections.emptyList(), 10, 758); + Instant unknownValue = Instant.now(); + + Map st = spanTags("payload", pv(pc().push("tag7"), unknownValue)); + + TagMap unsafeTags = TagMap.fromMap(st); + ptp.processTags(unsafeTags, null, link -> {}); + + assertEquals(mapOf("payload.tag7", unknownValue.toString()), unsafeTags); + } + + @Test + void expandStringifiedJsonTags() { + PayloadTagsProcessor ptp = tagsProcessor("p", Collections.emptyList(), 10, 758); + + Map st = + spanTags( + "p", + pv(pc().push("j1"), "{}"), + pv(pc().push("j2"), "[]"), + pv(pc().push("j3"), "['1', 2, 3.14, null, true]"), + pv(pc().push("j4"), "{'foo': 'bar', 'baz': 42}")); + + TagMap unsafeTags = TagMap.fromMap(st); + ptp.processTags(unsafeTags, null, link -> {}); + + Map expected = + mapOf( + "p.j3.0", + "1", + "p.j3.1", + 2, + "p.j3.2", + 3.14d, + "p.j3.3", + null, + "p.j3.4", + true, + "p.j4.foo", + "bar", + "p.j4.baz", + 42); + assertEquals(expected, unsafeTags); + } + + @Test + void expandSerializedEscapedInnerJsonWithinInnerJson() throws IOException { + Buffer b0 = new Buffer(); + JsonWriter.of(b0) + .beginObject() + .name("a") + .value(1.15) + .name("password") + .value("my-secret-password") + .endObject() + .close(); + + Buffer b1 = new Buffer(); + JsonWriter.of(b1) + .beginObject() + .name("id") + .value(45) + .name("user") + .value(b0.readUtf8()) + .endObject() + .close(); + + Buffer b2 = new Buffer(); + JsonWriter.of(b2) + .beginObject() + .name("a") + .value(33) + .name("Message") + .value(b1.readUtf8()) + .name("b") + .value(true) + .endObject() + .close(); + + String json = b2.readUtf8(); + + PayloadTagsProcessor ptp = tagsProcessor("dd", Collections.emptyList(), 10, 758); + Map st = spanTags("dd", pv(pc(), json)); + + TagMap unsafeTags = TagMap.fromMap(st); + ptp.processTags(unsafeTags, null, link -> {}); + + assertEquals( + mapOf( + "dd.a", + 33, + "dd.Message.id", + 45, + "dd.Message.user.a", + 1.15d, + "dd.Message.user.password", + "my-secret-password", + "dd.b", + true), + unsafeTags); + } + + @ValueSource( + strings = {"{'foo: 'bar'", "[1, 2", "[1, 2] ", " [1, 2]", "{'foo: 'bar'} ", " {'foo: 'bar'}"}) + @ParameterizedTest + void keepFailedToParseJsonAsIs(String invalidJson) { + PayloadTagsProcessor ptp = tagsProcessor("p", Collections.emptyList(), 10, 758); + Map st = spanTags("p", pv(pc().push("key"), invalidJson)); + + TagMap unsafeTags = TagMap.fromMap(st); + ptp.processTags(unsafeTags, null, link -> {}); + + assertEquals(mapOf("p.key", invalidJson), unsafeTags); + } + + @Test + void expandBinaryIfJson() { + PayloadTagsProcessor ptp = tagsProcessor("p", Collections.emptyList(), 10, 758); + + Map st = + spanTags( + "p", + pv(pc().push("j0"), new ByteArrayInputStream("{}".getBytes())), + pv(pc().push("j1"), new ByteArrayInputStream("{'foo': 'bar'}".getBytes())), + pv(pc().push("j2"), new ByteArrayInputStream("[1, true]".getBytes()))); + + TagMap unsafeTags = TagMap.fromMap(st); + ptp.processTags(unsafeTags, null, link -> {}); + + assertEquals(mapOf("p.j1.foo", "bar", "p.j2.0", 1, "p.j2.1", true), unsafeTags); + } + + @ParameterizedTest + @ValueSource( + strings = { + // standard JSON + "{ \"a\": 1.15, \"password\": \"my-secret-password\" }", + // JSON wrapped in double quotes (string-quoted) + "\"{ 'a': 1.15, 'password': 'my-secret-password' }\"", + // JSON with escaped quotes, wrapped in double quotes + "\"{ \\\"a\\\": 1.15, \\\"password\\\": \\\"my-secret-password\\\" }\"", + // JSON wrapped in single quotes + "'{ \"a\": 1.15, \"password\": \"my-secret-password\" }'", + // same as case 3, alternate source representation + "\"{ \\\"a\\\": 1.15, \\\"password\\\": \\\"my-secret-password\\\" }\"" + }) + void expandBinaryEscapedJsonTags(String innerJson) { + PayloadTagsProcessor ptp = tagsProcessor("p", Collections.emptyList(), 10, 758); + Map st = + spanTags( + "p", + pv( + pc().push("v"), + new ByteArrayInputStream(("{ \"inner\": " + innerJson + "}").getBytes()))); + + TagMap unsafeTags = TagMap.fromMap(st); + ptp.processTags(unsafeTags, null, link -> {}); + + assertEquals( + mapOf("p.v.inner.a", 1.15d, "p.v.inner.password", "my-secret-password"), unsafeTags); + } + + @ValueSource(strings = {" [1]", " {'foo': 'bar'}", "invalid:"}) + @ParameterizedTest + void useBinaryValueIfNotJsonOrCouldntBeParsed(String invalidJson) { + PayloadTagsProcessor ptp = tagsProcessor("p", Collections.emptyList(), 10, 758); + Map st = + spanTags("p", pv(pc().push("key"), new ByteArrayInputStream(invalidJson.getBytes()))); + + TagMap unsafeTags = TagMap.fromMap(st); + ptp.processTags(unsafeTags, null, link -> {}); + + assertEquals(mapOf("p.key", ""), unsafeTags); + } + + @Test + void applyRedactionRules() { + PayloadTagsProcessor ptp = tagsProcessor("p", Arrays.asList("$.j3[0]", "$.j4.baz"), 10, 758); + + Map st = + spanTags( + "p", + pv(pc().push("j1"), "{}"), + pv(pc().push("j2"), "[]"), + pv(pc().push("j3"), "['1', 2, 3.14, null, true]"), + pv(pc().push("j4"), "{'foo': 'bar', 'baz': 42}")); + + TagMap unsafeTags = TagMap.fromMap(st); + ptp.processTags(unsafeTags, null, link -> {}); + + Map expected = + mapOf( + "p.j3.0", + "redacted", + "p.j3.1", + 2, + "p.j3.2", + 3.14d, + "p.j3.3", + null, + "p.j3.4", + true, + "p.j4.foo", + "bar", + "p.j4.baz", + "redacted"); + assertEquals(expected, unsafeTags); + } + + @Test + void respectMaxTagsLimit() { + PayloadTagsProcessor ptp = tagsProcessor("p", Arrays.asList("$.j3[0]", "$.j4.baz"), 10, 4); + + Map st = + spanTags( + "p", + pv(pc().push("j1"), "{}"), + pv(pc().push("j2"), "[]"), + pv(pc().push("j3"), "['1', 2, 3.14, null, true]"), + pv(pc().push("j4"), "{'foo': 'bar', 'baz': 42}")); + + TagMap unsafeTags = TagMap.fromMap(st); + ptp.processTags(unsafeTags, null, link -> {}); + + assertEquals( + mapOf( + "p.j3.0", + "redacted", + "p.j3.1", + 2, + "p.j3.2", + 3.14d, + "p.j3.3", + null, + "_dd.payload_tags_incomplete", + true), + unsafeTags); + } + + @Test + void respectMaxDepthLimit() { + PayloadTagsProcessor ptp = tagsProcessor("p", Arrays.asList("$.j3[0]", "$.j4.baz"), 3, 800); + + Map st = + spanTags( + "p", + pv(pc().push("j3"), "['1', 2, 3.14, null, true, [ 1, [ 2, 3 ] ]]"), + pv( + pc().push("j4"), + "{'foo': 'bar', 'baz': 42, 'nested': { 'a': 1, 'b': { 'c': 2 } } }")); + + TagMap unsafeTags = TagMap.fromMap(st); + ptp.processTags(unsafeTags, null, link -> {}); + + assertEquals( + mapOf( + "p.j3.0", + "redacted", + "p.j3.1", + 2, + "p.j3.2", + 3.14d, + "p.j3.3", + null, + "p.j3.4", + true, + "p.j3.5.0", + 1, + "p.j4.foo", + "bar", + "p.j4.baz", + "redacted", + "p.j4.nested.a", + 1), + unsafeTags); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/tagprocessor/PeerServiceCalculatorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/tagprocessor/PeerServiceCalculatorTest.java new file mode 100644 index 00000000000..d9707fc0caf --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/tagprocessor/PeerServiceCalculatorTest.java @@ -0,0 +1,146 @@ +package datadog.trace.core.tagprocessor; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import datadog.trace.api.Config; +import datadog.trace.api.DDTags; +import datadog.trace.api.TagMap; +import datadog.trace.api.naming.v0.NamingSchemaV0; +import datadog.trace.api.naming.v1.NamingSchemaV1; +import datadog.trace.bootstrap.instrumentation.api.Tags; +import datadog.trace.test.junit.utils.config.WithConfig; +import datadog.trace.test.util.DDJavaSpecification; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; +import org.tabletest.junit.TableTest; + +class PeerServiceCalculatorTest extends DDJavaSpecification { + + private static LinkedHashMap linkedMap(Object... pairs) { + LinkedHashMap map = new LinkedHashMap<>(); + for (int i = 0; i < pairs.length; i += 2) { + map.put((String) pairs[i], pairs[i + 1]); + } + return map; + } + + @TableTest({ + "scenario | tags ", + "empty | [:] ", + "hostname only | ['peer.hostname': 'test'] ", + "hostname and db instance | ['peer.hostname': 'test', 'db.instance': 'instance']", + "db instance before hostname | ['db.instance': 'instance', 'peer.hostname': 'test']", + "hostname and rpc service | ['peer.hostname': 'test', 'rpc.service': 'svc'] ", + "rpc service before hostname | ['rpc.service': 'svc', 'peer.hostname': 'test'] " + }) + void schemaV0PeerServiceIsNotCalculatedByDefault(Map tags) { + PeerServiceCalculator calculator = + new PeerServiceCalculator(new NamingSchemaV0().peerService(), Collections.emptyMap()); + + TagMap unsafeTags = TagMap.fromMap(tags); + calculator.processTags(unsafeTags, null, link -> {}); + + // tags are not modified + assertEquals(tags, unsafeTags); + } + + @TableTest({ + "scenario | tags | provenance | peerService", + "empty | [:] | | ", + "hostname only (1) | ['peer.hostname': 'test'] | peer.hostname | test ", + "hostname only (2) | ['peer.hostname': 'test'] | peer.hostname | test ", + "hostname and db instance | ['peer.hostname': 'test', 'db.instance': 'instance'] | db.instance | instance ", + "db instance before hostname | ['db.instance': 'instance', 'peer.hostname': 'test'] | db.instance | instance ", + "hostname, rpc service, grpc component | ['peer.hostname': 'test', 'rpc.service': 'svc', 'component': 'grpc-client'] | rpc.service | svc ", + "rpc service before hostname | ['rpc.service': 'svc', 'peer.hostname': 'test', 'component': 'grpc-client'] | rpc.service | svc ", + "hostname and peer service | ['peer.hostname': 'test', 'peer.service': 'userService'] | | userService" + }) + void schemaV1TestPeerServiceDefaultLogicAndPrecursors( + Map tags, String provenance, String peerService) { + PeerServiceCalculator calculator = + new PeerServiceCalculator(new NamingSchemaV1().peerService(), Collections.emptyMap()); + + Map tagsWithSpanKind = new LinkedHashMap<>(tags); + tagsWithSpanKind.put(Tags.SPAN_KIND, Tags.SPAN_KIND_CLIENT); + + TagMap unsafeTags = TagMap.fromMap(tagsWithSpanKind); + calculator.processTags(unsafeTags, null, link -> {}); + + assertEquals(provenance, unsafeTags.get(DDTags.PEER_SERVICE_SOURCE)); + assertEquals(peerService, unsafeTags.get(Tags.PEER_SERVICE)); + } + + @WithConfig(key = "trace.peer.service.defaults.enabled", value = "true") + @Test + void schemaV0ShouldCalculateDefaultsIfEnabled() { + PeerServiceCalculator calculator = + new PeerServiceCalculator(new NamingSchemaV0().peerService(), Collections.emptyMap()); + + TagMap unsafeTags = TagMap.fromMap(linkedMap("span.kind", "client", "peer.hostname", "test")); + calculator.processTags(unsafeTags, null, link -> {}); + + assertEquals("test", unsafeTags.get(Tags.PEER_SERVICE)); + } + + @TableTest({ + "scenario | kind | calculate", + "client | client | true ", + "producer | producer | true ", + "server | server | false " + }) + void calculateOnlyForSpanKindClientOrProducer(String kind, boolean calculate) { + PeerServiceCalculator calculator = + new PeerServiceCalculator(new NamingSchemaV1().peerService(), Collections.emptyMap()); + + Map tags = linkedMap("span.kind", kind, "peer.hostname", "test"); + TagMap unsafeTags = TagMap.fromMap(tags); + calculator.processTags(unsafeTags, null, link -> {}); + + assertEquals(calculate, unsafeTags.containsKey(Tags.PEER_SERVICE)); + } + + @WithConfig( + key = "trace.peer.service.mapping", + value = "service1:best_service,userService:my_service") + @WithConfig(key = "trace.peer.service.defaults.enabled", value = "true") + @TableTest({ + "scenario | tags | expected | original ", + "peer service remapped | ['peer.service': 'userService'] | my_service | userService", + "hostname client, no remap | ['peer.hostname': 'test', 'span.kind': 'client'] | test | ", + "hostname producer, remap service | ['peer.hostname': 'service1', 'span.kind': 'producer'] | best_service | service1 " + }) + void shouldApplyPeerServiceMappingsIfConfigured( + Map tags, String expected, String original) { + PeerServiceCalculator calculator = + new PeerServiceCalculator( + new NamingSchemaV0().peerService(), Config.get().getPeerServiceMapping()); + + TagMap unsafeTags = TagMap.fromMap(tags); + calculator.processTags(unsafeTags, null, link -> {}); + + assertEquals(expected, unsafeTags.get(Tags.PEER_SERVICE)); + assertEquals(original, unsafeTags.get(DDTags.PEER_SERVICE_REMAPPED_FROM)); + } + + @WithConfig(key = "trace.peer.service.component.overrides", value = "java-couchbase:couchbase") + @WithConfig(key = "trace.peer.service.defaults.enabled", value = "true") + @TableTest({ + "scenario | tags | expected | source ", + "component override applies | ['component': 'java-couchbase', 'span.kind': 'client'] | couchbase | _component_override", + "hostname wins over override | ['peer.hostname': 'host1', 'span.kind': 'client', 'component': 'my-http-client'] | host1 | peer.hostname " + }) + void shouldOverridePeerServiceValuesIfConfigured( + Map tags, String expected, String source) { + PeerServiceCalculator calculator = + new PeerServiceCalculator( + new NamingSchemaV0().peerService(), Config.get().getPeerServiceComponentOverrides()); + + TagMap unsafeTags = TagMap.fromMap(tags); + calculator.processTags(unsafeTags, null, link -> {}); + + assertEquals(expected, unsafeTags.get(Tags.PEER_SERVICE)); + assertEquals(source, unsafeTags.get(DDTags.PEER_SERVICE_SOURCE)); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/tagprocessor/PostProcessorChainTest.java b/dd-trace-core/src/test/java/datadog/trace/core/tagprocessor/PostProcessorChainTest.java new file mode 100644 index 00000000000..e1b49cfd5b8 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/tagprocessor/PostProcessorChainTest.java @@ -0,0 +1,91 @@ +package datadog.trace.core.tagprocessor; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.api.TagMap; +import datadog.trace.bootstrap.instrumentation.api.AppendableSpanLinks; +import datadog.trace.core.DDSpanContext; +import datadog.trace.test.util.DDJavaSpecification; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.Test; + +class PostProcessorChainTest extends DDJavaSpecification { + + @Test + void chainWorks() { + TagsPostProcessor processor1 = + new TagsPostProcessor() { + @Override + public void processTags( + TagMap unsafeTags, DDSpanContext spanContext, AppendableSpanLinks spanLinks) { + unsafeTags.put("key1", "processor1"); + unsafeTags.put("key2", "processor1"); + } + }; + TagsPostProcessor processor2 = + new TagsPostProcessor() { + @Override + public void processTags( + TagMap unsafeTags, DDSpanContext spanContext, AppendableSpanLinks spanLinks) { + unsafeTags.put("key1", "processor2"); + } + }; + + PostProcessorChain chain = new PostProcessorChain(processor1, processor2); + + List links = new ArrayList<>(); + TagMap tags = TagMap.fromMap(linkedMap("key1", "overwrite", "key3", "unchanged")); + + chain.processTags(tags, null, link -> links.add(link)); + + Map expected = + linkedMap("key1", "processor2", "key2", "processor1", "key3", "unchanged"); + assertEquals(expected, tags); + assertTrue(links.isEmpty()); + } + + @Test + void processorCanHideTagsToNextOne() { + TagsPostProcessor processor1 = + new TagsPostProcessor() { + @Override + public void processTags( + TagMap unsafeTags, DDSpanContext spanContext, AppendableSpanLinks spanLinks) { + unsafeTags.clear(); + unsafeTags.put("my", "tag"); + } + }; + TagsPostProcessor processor2 = + new TagsPostProcessor() { + @Override + public void processTags( + TagMap unsafeTags, DDSpanContext spanContext, AppendableSpanLinks spanLinks) { + if (unsafeTags.containsKey("test")) { + unsafeTags.put("found", "true"); + } + } + }; + + PostProcessorChain chain = new PostProcessorChain(processor1, processor2); + + List links = new ArrayList<>(); + TagMap tags = TagMap.fromMap(linkedMap("test", "test")); + + chain.processTags(tags, null, link -> links.add(link)); + + assertEquals(linkedMap("my", "tag"), tags); + assertTrue(links.isEmpty()); + } + + private static LinkedHashMap linkedMap(Object... pairs) { + LinkedHashMap map = new LinkedHashMap<>(); + for (int i = 0; i < pairs.length; i += 2) { + map.put((String) pairs[i], pairs[i + 1]); + } + return map; + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/tagprocessor/QueryObfuscatorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/tagprocessor/QueryObfuscatorTest.java new file mode 100644 index 00000000000..59ce3696844 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/tagprocessor/QueryObfuscatorTest.java @@ -0,0 +1,58 @@ +package datadog.trace.core.tagprocessor; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import datadog.trace.api.DDTags; +import datadog.trace.api.TagMap; +import datadog.trace.bootstrap.instrumentation.api.Tags; +import datadog.trace.test.util.DDJavaSpecification; +import java.util.LinkedHashMap; +import java.util.Map; +import org.tabletest.junit.TableTest; + +class QueryObfuscatorTest extends DDJavaSpecification { + + // Default pattern extended with 'email' to match the custom regexp test + private static final String CUSTOM_OBFUSCATION_PATTERN = + "(?i)(?:(?:\"|%22)?)(?:(?:old[-_]?|new[-_]?)?p(?:ass)?w(?:or)?d(?:1|2)?|pass(?:[-_]?phrase)?|email|secret|(?:api[-_]?|private[-_]?|public[-_]?|access[-_]?|secret[-_]?|app(?:lication)?[-_]?)key(?:[-_]?id)?|token|consumer[-_]?(?:id|key|secret)|sign(?:ed|ature)?|auth(?:entication|orization)?)(?:(?:\\s|%20)*(?:=|%3D)[^&]+|(?:\"|%22)(?:\\s|%20)*(?::|%3A)(?:\\s|%20)*(?:\"|%22)(?:%2[^2]|%[^2]|[^\"%])+(?:\"|%22))|(?:bearer(?:\\s|%20)+[a-z0-9._\\-]+|token(?::|%3A)[a-z0-9]{13}|gh[opsu]_[0-9a-zA-Z]{36}|ey[I-L](?:[\\w=-]|%3D)+\\.ey[I-L](?:[\\w=-]|%3D)+(?:\\.(?:[\\w.+/=-]|%3D|%2F|%2B)+)?|-{5}BEGIN(?:[a-z\\s]|%20)+PRIVATE(?:\\s|%20)KEY-{5}[^\\-]+-{5}END(?:[a-z\\s]|%20)+PRIVATE(?:\\s|%20)KEY(?:-{5})?(?:\\n|%0A)?|(?:ssh-(?:rsa|dss)|ecdsa-[a-z0-9]+-[a-z0-9]+)(?:\\s|%20|%09)+(?:[a-z0-9/.+]|%2F|%5C|%2B){100,}(?:=|%3D)*(?:(?:\\s|%20|%09)+[a-z0-9._-]+)?)"; + + @TableTest({ + "scenario | query | expectedQuery ", + "token | key1=val1&token=a0b21ce2-006f-4cc6-95d5-d7b550698482&key2=val2 | 'key1=val1&&key2=val2'", + "app keys | app_key=1111&application_key=2222 | '&' ", + "email | email=foo@bar.com | email=foo@bar.com " + }) + void tagsProcessing(String query, String expectedQuery) { + QueryObfuscator obfuscator = new QueryObfuscator(null); + + Map tags = new LinkedHashMap<>(); + tags.put(Tags.HTTP_URL, "http://site.com/index"); + tags.put(DDTags.HTTP_QUERY, query); + + TagMap unsafeTags = TagMap.fromMap(tags); + obfuscator.processTags(unsafeTags, null, link -> {}); + + assertEquals(expectedQuery, unsafeTags.get(DDTags.HTTP_QUERY)); + assertEquals("http://site.com/index?" + expectedQuery, unsafeTags.get(Tags.HTTP_URL)); + } + + @TableTest({ + "scenario | query | expectedQuery ", + "token | key1=val1&token=a0b21ce2-006f-4cc6-95d5-d7b550698482&key2=val2 | 'key1=val1&&key2=val2'", + "app keys | app_key=1111&application_key=2222 | '&' ", + "email | email=foo@bar.com | '' " + }) + void tagsProcessingWithCustomRegexpForEmail(String query, String expectedQuery) { + QueryObfuscator obfuscator = new QueryObfuscator(CUSTOM_OBFUSCATION_PATTERN); + + Map tags = new LinkedHashMap<>(); + tags.put(Tags.HTTP_URL, "http://site.com/index"); + tags.put(DDTags.HTTP_QUERY, query); + + TagMap unsafeTags = TagMap.fromMap(tags); + obfuscator.processTags(unsafeTags, null, link -> {}); + + assertEquals(expectedQuery, unsafeTags.get(DDTags.HTTP_QUERY)); + assertEquals("http://site.com/index?" + expectedQuery, unsafeTags.get(Tags.HTTP_URL)); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/tagprocessor/SpanPointersProcessorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/tagprocessor/SpanPointersProcessorTest.java new file mode 100644 index 00000000000..0697f27d4f2 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/tagprocessor/SpanPointersProcessorTest.java @@ -0,0 +1,59 @@ +package datadog.trace.core.tagprocessor; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.mockito.Mockito.mock; + +import datadog.trace.api.DDSpanId; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.TagMap; +import datadog.trace.bootstrap.instrumentation.api.AgentSpanLink; +import datadog.trace.bootstrap.instrumentation.api.InstrumentationTags; +import datadog.trace.bootstrap.instrumentation.api.SpanLink; +import datadog.trace.core.DDSpanContext; +import datadog.trace.test.util.DDJavaSpecification; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import org.tabletest.junit.TableTest; + +class SpanPointersProcessorTest extends DDJavaSpecification { + + @TableTest({ + "scenario | objectKey | eTag | expectedHash ", + "basic values | some-key.data | ab12ef34 | e721375466d4116ab551213fdea08413", + "non-ascii key | some-key.你好 | ab12ef34 | d1333a04b9928ab462b5c6cadfa401f4 ", + "multipart etag | some-key.data | ab12ef34-5 | 2b90dffc37ebc7bc610152c3dc72af9f" + }) + void spanPointersProcessorAddsCorrectLink(String objectKey, String eTag, String expectedHash) { + SpanPointersProcessor processor = new SpanPointersProcessor(); + + Map tagMap = new LinkedHashMap<>(); + tagMap.put(InstrumentationTags.AWS_BUCKET_NAME, "some-bucket"); + tagMap.put(InstrumentationTags.AWS_OBJECT_KEY, objectKey); + tagMap.put("s3.eTag", eTag); + + TagMap unsafeTags = TagMap.fromMap(tagMap); + DDSpanContext spanContext = mock(DDSpanContext.class); + List spanLinks = new ArrayList<>(); + + // Process the tags; the processor should remove 's3.eTag' and add one link + processor.processTags(unsafeTags, spanContext, link -> spanLinks.add(link)); + + // 1. s3.eTag was removed + assertFalse(unsafeTags.containsKey("s3.eTag")); + // 2. Exactly one link was added + assertEquals(1, spanLinks.size()); + // 3. Check link + AgentSpanLink link = spanLinks.get(0); + assertInstanceOf(SpanLink.class, link); + assertEquals(DDTraceId.ZERO, link.traceId()); + assertEquals(DDSpanId.ZERO, link.spanId()); + assertEquals(SpanPointersProcessor.S3_PTR_KIND, link.attributes().asMap().get("ptr.kind")); + assertEquals(SpanPointersProcessor.DOWN_DIRECTION, link.attributes().asMap().get("ptr.dir")); + assertEquals(expectedHash, link.attributes().asMap().get("ptr.hash")); + assertEquals(SpanPointersProcessor.LINK_KIND, link.attributes().asMap().get("link.kind")); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/traceinterceptor/LatencyTraceInterceptorTest.java b/dd-trace-core/src/test/java/datadog/trace/core/traceinterceptor/LatencyTraceInterceptorTest.java new file mode 100644 index 00000000000..2fccfe2672d --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/traceinterceptor/LatencyTraceInterceptorTest.java @@ -0,0 +1,55 @@ +package datadog.trace.core.traceinterceptor; + +import static datadog.trace.test.junit.utils.config.WithConfigExtension.injectSysConfig; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.common.writer.ListWriter; +import datadog.trace.core.CoreTracer; +import datadog.trace.core.DDCoreJavaSpecification; +import datadog.trace.core.DDSpan; +import datadog.trace.test.junit.utils.converter.TagsConverter; +import java.util.List; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.Timeout; +import org.junit.jupiter.params.converter.ConvertWith; +import org.tabletest.junit.TableTest; + +@Timeout(value = 10, unit = TimeUnit.SECONDS) +class LatencyTraceInterceptorTest extends DDCoreJavaSpecification { + + @TableTest({ + "scenario | partialFlushEnabled | latencyThreshold | priorityTag | minDuration | expected", + "partial flush / keep / under threshold | 'true' | '200' | 'DDTags.MANUAL_KEEP' | 10 | 2 ", + "partial flush / drop / under threshold | 'true' | '200' | 'DDTags.MANUAL_DROP' | 10 | -1 ", + "partial flush / keep / over threshold | 'true' | '200' | 'DDTags.MANUAL_KEEP' | 300 | 2 ", + "partial flush / drop / over threshold | 'true' | '200' | 'DDTags.MANUAL_DROP' | 300 | -1 ", + "no partial flush / keep / under threshold | 'false' | '200' | 'DDTags.MANUAL_KEEP' | 10 | 2 ", + "no partial flush / drop / under threshold | 'false' | '200' | 'DDTags.MANUAL_DROP' | 10 | -1 ", + "no partial flush / keep / over threshold | 'false' | '200' | 'DDTags.MANUAL_KEEP' | 300 | 2 ", + "no partial flush / drop / over threshold | 'false' | '200' | 'DDTags.MANUAL_DROP' | 300 | 2 " + }) + void testSetSamplingPriorityAccordingToLatency( + String partialFlushEnabled, + String latencyThreshold, + @ConvertWith(TagsConverter.class) String priorityTag, + long minDuration, + int expected) + throws InterruptedException { + injectSysConfig("trace.partial.flush.enabled", partialFlushEnabled); + injectSysConfig("trace.experimental.keep.latency.threshold.ms", latencyThreshold); + + ListWriter writer = new ListWriter(); + CoreTracer tracer = tracerBuilder().writer(writer).build(); + + AgentSpan spanSetup = + tracer.buildSpan("test", "my_operation_name").withTag(priorityTag, true).start(); + Thread.sleep(minDuration); + spanSetup.finish(); + + List trace = writer.firstTrace(); + assertEquals(1, trace.size()); + DDSpan span = trace.get(0); + assertEquals(expected, span.spanContext().getSamplingPriority()); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/util/GlobPatternTest.java b/dd-trace-core/src/test/java/datadog/trace/core/util/GlobPatternTest.java new file mode 100644 index 00000000000..19c92700940 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/util/GlobPatternTest.java @@ -0,0 +1,23 @@ +package datadog.trace.core.util; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.tabletest.junit.TableTest; + +class GlobPatternTest { + + @TableTest({ + "scenario | globPattern | expectedRegex", + "star alone | '*' | '^.*$' ", + "question alone | '?' | '^.$' ", + "two questions | '??' | '^..$' ", + "prefix star | 'Foo*' | '^Foo.*$' ", + "literal abc | 'abc' | '^abc$' ", + "question alone (dup) | '?' | '^.$' ", + "single char | 'F?o' | '^F.o$' ", + "Bar prefix | 'Bar*' | '^Bar.*$' " + }) + void convertGlobPatternToRegex(String globPattern, String expectedRegex) { + assertEquals(expectedRegex, GlobPattern.globToRegex(globPattern)); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/util/LRUCacheTest.java b/dd-trace-core/src/test/java/datadog/trace/core/util/LRUCacheTest.java new file mode 100644 index 00000000000..43daa3620ce --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/util/LRUCacheTest.java @@ -0,0 +1,48 @@ +package datadog.trace.core.util; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.junit.jupiter.api.Test; + +class LRUCacheTest { + + @Test + void shouldEjectLeastRecentlyUsedElement() { + LRUCache lruCache = new LRUCache<>(5); + for (int i = 1; i <= 5; i++) { + lruCache.put(i, String.valueOf(i)); + } + // now look at 2 values + lruCache.get(1); + lruCache.get(3); + // now insert 2 new values + lruCache.put(6, "6"); + lruCache.put(7, "7"); + + assertEquals(5, lruCache.size()); + assertTrue(lruCache.values().containsAll(Arrays.asList("1", "3", "5", "6", "7"))); + } + + @Test + void shouldNotifyListenerWhenEjectingLeastRecentlyUsedElement() { + List ejected = new ArrayList<>(); + LRUCache.ExpiryListener listener = entry -> ejected.add(entry.getKey()); + + LRUCache lruCache = new LRUCache<>(listener, 10, 0.75f, 5); + for (int i = 1; i <= 5; i++) { + lruCache.put(i, String.valueOf(i)); + } + // now look at 2 values + lruCache.get(1); + lruCache.get(3); + // now insert 2 new values + lruCache.put(6, "6"); + lruCache.put(7, "7"); + + assertEquals(Arrays.asList(2, 4), ejected); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/util/MatchersTest.java b/dd-trace-core/src/test/java/datadog/trace/core/util/MatchersTest.java new file mode 100644 index 00000000000..e7a0c96bc35 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/util/MatchersTest.java @@ -0,0 +1,172 @@ +package datadog.trace.core.util; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.params.provider.Arguments.arguments; + +import java.math.BigDecimal; +import java.math.BigInteger; +import java.util.stream.Stream; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import org.junit.jupiter.params.provider.NullSource; +import org.junit.jupiter.params.provider.ValueSource; + +class MatchersTest { + + @ParameterizedTest + @NullSource + @ValueSource(strings = {"*", "**"}) + void matchAllScenariosMustReturnAnAnyMatcher(String glob) { + assertInstanceOf(Matchers.AnyMatcher.class, Matchers.compileGlob(glob)); + } + + @ParameterizedTest + @ValueSource(strings = {"a", "ogre", "bcoho34e2"}) + void patternWithoutStarOrQuestionMustBeAnEqualsMatcher(String glob) { + assertInstanceOf(Matchers.InsensitiveEqualsMatcher.class, Matchers.compileGlob(glob)); + } + + @ParameterizedTest + @ValueSource(strings = {"?", "foo*", "*bar", "F?oB?r", "F?o*", "?*", "*?"}) + void patternWithEitherStarOrQuestionMustBeAPatternMatcher(String glob) { + assertInstanceOf(Matchers.PatternMatcher.class, Matchers.compileGlob(glob)); + } + + @ParameterizedTest + @ValueSource(strings = {"", "a", "abc", "cde"}) + void anExactMatcherIsSelfMatching(String pattern) { + assertTrue(Matchers.compileGlob(pattern).matches(pattern)); + } + + static Stream aPatternMatcherTestArguments() { + return Stream.of( + arguments("fo? matches Foo", "fo?", "Foo", true), + arguments("Fo? matches Foo", "Fo?", "Foo", true), + arguments("Fo? matches StringBuilder Foo", "Fo?", new StringBuilder("Foo"), true), + arguments("Fo? matches StringBuilder foo", "Fo?", new StringBuilder("foo"), true), + arguments("Foo matches StringBuilder foo", "Foo", new StringBuilder("foo"), true), + arguments("bar does not match StringBuilder Baz", "bar", new StringBuilder("Baz"), false), + arguments("Fo? does not match Fooo", "Fo?", "Fooo", false), + arguments("Fo* matches Fo", "Fo*", "Fo", true), + arguments("Fo* does not match Fa", "Fo*", "Fa", false), + arguments("F*B?r matches FooBar", "F*B?r", "FooBar", true), + arguments("F*B?r does not match FooFar", "F*B?r", "FooFar", false), + arguments("f*b?r matches FooBar", "f*b?r", "FooBar", true), + arguments("* matches true", "*", true, true), + arguments("true matches true", "true", true, true), + arguments("false matches false", "false", false, true), + arguments("TRUE matches true", "TRUE", true, true), + arguments("FALSE matches false", "FALSE", false, true), + arguments("True matches true", "True", true, true), + arguments("False matches false", "False", false, true), + arguments("T* matches true", "T*", true, true), + arguments("F* matches false", "F*", false, true), + arguments("empty matches empty", "", "", true), + arguments("empty does not match non-empty", "", "non-empty", false), + arguments("* matches foo", "*", "foo", true), + arguments("** matches foo", "**", "foo", true), + arguments("??? matches foo", "???", "foo", true), + arguments("* matches int 20", "*", 20, true), + arguments("20 matches int 20", "20", 20, true), + arguments("-20 matches int -20", "-20", -20, true), + arguments("* matches byte 20", "*", (byte) 20, true), + arguments("20 matches byte 20", "20", (byte) 20, true), + arguments("* matches short 20", "*", (short) 20, true), + arguments("20 matches short 20", "20", (short) 20, true), + arguments("* matches long 20", "*", 20L, true), + arguments("20 matches long 20", "20", 20L, true), + arguments("* matches float 20", "*", 20F, true), + arguments("20 matches float 20", "20", 20F, true), + arguments("* matches double 20", "*", 20D, true), + arguments("20 matches double 20", "20", 20D, true), + arguments("20 matches BigInteger 20", "20", new BigInteger("20"), true), + arguments("20 matches BigDecimal 20", "20", new BigDecimal("20"), true), + arguments("2* does not match float 20.1", "2*", 20.1F, false), + arguments("2* does not match double 20.1", "2*", 20.1D, false), + arguments("2* does not match BigDecimal 20.1", "2*", new BigDecimal("20.1"), false), + arguments("* matches arbitrary Object", "*", new Object(), true), + arguments("** matches arbitrary Object", "**", new Object(), true), + arguments("? does not match arbitrary Object", "?", new Object(), false), + arguments("* matches null", "*", null, true), + arguments("? does not match null", "?", null, false), + arguments("[a-z] matches [a-z]", "[a-z]", "[a-z]", true), + arguments("[a-z] does not match a", "[a-z]", "a", false), + arguments("[abc] matches [abc]", "[abc]", "[abc]", true), + arguments("[AbC] matches [abc]", "[AbC]", "[abc]", true), + arguments("[Ab] matches StringBuffer [ab]", "[Ab]", new StringBuffer("[ab]"), true), + arguments("[abc] does not match a", "[abc]", "a", false), + arguments("[!ab] matches [!ab]", "[!ab]", "[!ab]", true), + arguments("[!ab] does not match c", "[!ab]", "c", false), + arguments("^ matches ^", "^", "^", true), + arguments("() matches ()", "()", "()", true), + arguments("(*) matches (-)", "(*)", "(-)", true), + arguments("$ matches $", "$", "$", true)); + } + + @ParameterizedTest(name = "{0}") + @MethodSource("aPatternMatcherTestArguments") + void aPatternMatcherTest(String scenario, String pattern, Object value, boolean matches) { + Matcher matcher = Matchers.compileGlob(pattern); + + assertEquals(matches, matcher.matches(value)); + } + + @Test + void anyMatcherMatchesString() { + assertTrue(Matchers.ANY.matches("hello")); + } + + @Test + void anyMatcherMatchesCharSequence() { + assertTrue(Matchers.ANY.matches((CharSequence) new StringBuilder("world"))); + } + + @Test + void anyMatcherMatchesBoolean() { + assertTrue(Matchers.ANY.matches(true)); + } + + @Test + void anyMatcherMatchesByte() { + assertTrue(Matchers.ANY.matches((byte) 1)); + } + + @Test + void anyMatcherMatchesShort() { + assertTrue(Matchers.ANY.matches((short) 2)); + } + + @Test + void anyMatcherMatchesInt() { + assertTrue(Matchers.ANY.matches(42)); + } + + @Test + void anyMatcherMatchesLong() { + assertTrue(Matchers.ANY.matches(100L)); + } + + @Test + void anyMatcherMatchesFloat() { + assertTrue(Matchers.ANY.matches(1.5f)); + } + + @Test + void anyMatcherMatchesDouble() { + assertTrue(Matchers.ANY.matches(3.14)); + } + + @Test + void anyMatcherMatchesBigInteger() { + assertTrue(Matchers.ANY.matches(new BigInteger("123"))); + } + + @Test + void anyMatcherMatchesBigDecimal() { + assertTrue(Matchers.ANY.matches(new BigDecimal("1.23"))); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/util/SimpleRateLimiterTest.java b/dd-trace-core/src/test/java/datadog/trace/core/util/SimpleRateLimiterTest.java new file mode 100644 index 00000000000..4ab8c9a2c4b --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/util/SimpleRateLimiterTest.java @@ -0,0 +1,61 @@ +package datadog.trace.core.util; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.api.time.ControllableTimeSource; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; + +class SimpleRateLimiterTest { + + @ParameterizedTest + @ValueSource(ints = {10, 100, 1000}) + void initialRateAvailableAtCreation(int rate) { + ControllableTimeSource timeSource = new ControllableTimeSource(); + SimpleRateLimiter limiter = new SimpleRateLimiter(rate, timeSource); + + for (int i = 0; i < rate; i++) { + assertTrue(limiter.tryAcquire(), "failed for " + i); + } + + assertFalse(limiter.tryAcquire()); + } + + @ParameterizedTest + @ValueSource(ints = {10, 100, 1000}) + void tokensNeverGoBeyondRate(int rate) { + ControllableTimeSource timeSource = new ControllableTimeSource(); + SimpleRateLimiter limiter = new SimpleRateLimiter(rate, timeSource); + + timeSource.advance(TimeUnit.SECONDS.toNanos(5)); + for (int i = 0; i < rate; i++) { + assertTrue(limiter.tryAcquire(), "failed for " + i); + } + + assertFalse(limiter.tryAcquire()); + } + + @ParameterizedTest + @ValueSource(ints = {10, 100, 1000}) + void tokensAreConsumedAndReplenished(int rate) { + ControllableTimeSource timeSource = new ControllableTimeSource(); + SimpleRateLimiter limiter = new SimpleRateLimiter(rate, timeSource); + long nanosIncrement = TimeUnit.SECONDS.toNanos(1) / (rate + 1) + 1; + + for (int i = 0; i < rate; i++) { + timeSource.advance(nanosIncrement); + assertTrue(limiter.tryAcquire(), "failed for " + i); + } + + assertFalse(limiter.tryAcquire()); + + for (int i = 0; i < rate; i++) { + timeSource.advance(nanosIncrement); + assertTrue(limiter.tryAcquire(), "failed for " + i); + } + + assertFalse(limiter.tryAcquire()); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/util/StackTracesTest.java b/dd-trace-core/src/test/java/datadog/trace/core/util/StackTracesTest.java index 05e14e33f52..ba4bc51d4f2 100644 --- a/dd-trace-core/src/test/java/datadog/trace/core/util/StackTracesTest.java +++ b/dd-trace-core/src/test/java/datadog/trace/core/util/StackTracesTest.java @@ -1,9 +1,12 @@ package datadog.trace.core.util; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.params.provider.Arguments.arguments; import java.util.stream.Stream; +import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; @@ -64,6 +67,24 @@ class StackTracesTest { + " at com.example.util.ResourceManager.close(ResourceManager.java:21)\n" + " ... 3 more\n"; + // --- safeGetMessage --- + + @Test + void safeGetMessageReturnsFallbackWhenGetMessageThrows() { + String message = StackTraces.safeGetMessage(TestThrowables.throwingGetMessage()); + assertTrue( + message.contains("Exception message unavailable"), "must indicate message is unavailable"); + assertTrue( + message.contains("IllegalArgumentException"), "must include secondary exception type"); + } + + @Test + void safeGetMessageReturnsNullForNullInput() { + assertNull(StackTraces.safeGetMessage(null)); + } + + // --- getStackTrace with broken getMessage --- + @ParameterizedTest(name = "truncation limit {0}") @MethodSource("testTruncateArguments") void testTruncate(int limit, String expected) { diff --git a/dd-trace-core/src/test/java/datadog/trace/core/util/SystemAccessTest.java b/dd-trace-core/src/test/java/datadog/trace/core/util/SystemAccessTest.java new file mode 100644 index 00000000000..0f549c07cea --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/util/SystemAccessTest.java @@ -0,0 +1,65 @@ +package datadog.trace.core.util; + +import static datadog.trace.api.config.GeneralConfig.HEALTH_METRICS_ENABLED; +import static datadog.trace.api.config.ProfilingConfig.PROFILING_ENABLED; +import static datadog.trace.test.junit.utils.config.WithConfigExtension.injectSysConfig; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.test.util.DDJavaSpecification; +import org.junit.jupiter.api.AfterEach; +import org.tabletest.junit.TableTest; + +class SystemAccessTest extends DDJavaSpecification { + + @AfterEach + void cleanupJmx() { + SystemAccess.disableJmx(); + } + + @TableTest({ + "scenario | providerEnabled | profilingEnabled | healthMetricsEnabled | hasCpuTime", + "all disabled | false | false | false | false ", + "health metrics only | false | false | true | false ", + "profiling only | false | true | false | false ", + "profiling and health metrics | false | true | true | false ", + "provider only | true | false | false | false ", + "provider and health metrics | true | false | true | true ", + "provider and profiling | true | true | false | true ", + "provider, profiling and health metrics | true | true | true | true " + }) + void testCpuTime( + boolean providerEnabled, + boolean profilingEnabled, + boolean healthMetricsEnabled, + boolean hasCpuTime) { + injectSysConfig(PROFILING_ENABLED, String.valueOf(profilingEnabled)); + injectSysConfig(HEALTH_METRICS_ENABLED, String.valueOf(healthMetricsEnabled)); + + if (providerEnabled) { + SystemAccess.enableJmx(); + } else { + SystemAccess.disableJmx(); + } + + long threadCpuTime1 = SystemAccess.getCurrentThreadCpuTime(); + // burn some cpu + int sum = 0; + for (int i = 0; i < 10_000; i++) { + sum += i; + } + long threadCpuTime2 = SystemAccess.getCurrentThreadCpuTime(); + + assertTrue(sum > 0); + + if (hasCpuTime) { + assertNotEquals(Long.MIN_VALUE, threadCpuTime1); + assertNotEquals(Long.MIN_VALUE, threadCpuTime2); + assertTrue(threadCpuTime2 > threadCpuTime1); + } else { + assertEquals(Long.MIN_VALUE, threadCpuTime1); + assertEquals(Long.MIN_VALUE, threadCpuTime2); + } + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/core/util/TestThrowables.java b/dd-trace-core/src/test/java/datadog/trace/core/util/TestThrowables.java new file mode 100644 index 00000000000..42885a4af45 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/core/util/TestThrowables.java @@ -0,0 +1,23 @@ +package datadog.trace.core.util; + +import java.text.MessageFormat; + +/** Test helpers for throwables with non-standard {@code getMessage()} behaviour. */ +public final class TestThrowables { + private TestThrowables() {} + + /** + * Returns a {@link RuntimeException} whose {@link Throwable#getMessage()} throws {@link + * IllegalArgumentException} via {@link MessageFormat} with non-integer placeholders — simulating + * the third-party exception that triggered the production bug in {@code DDSpan.addThrowable}. + */ + public static RuntimeException throwingGetMessage() { + return new RuntimeException() { + @Override + public String getMessage() { + return MessageFormat.format( + "Timeout after {TotalMilliseconds}ms matching pattern {Pattern}", "arg0", "arg1"); + } + }; + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/lambda/LambdaAppSecHandlerTest.java b/dd-trace-core/src/test/java/datadog/trace/lambda/LambdaAppSecHandlerTest.java new file mode 100644 index 00000000000..75dfb9a6928 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/lambda/LambdaAppSecHandlerTest.java @@ -0,0 +1,2299 @@ +package datadog.trace.lambda; + +import static datadog.trace.api.gateway.Events.EVENTS; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyInt; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoInteractions; +import static org.mockito.Mockito.when; + +import datadog.trace.api.Config; +import datadog.trace.api.ProductTraceSource; +import datadog.trace.api.appsec.AppSecContext; +import datadog.trace.api.function.TriConsumer; +import datadog.trace.api.function.TriFunction; +import datadog.trace.api.gateway.BlockResponseFunction; +import datadog.trace.api.gateway.CallbackProvider; +import datadog.trace.api.gateway.Flow; +import datadog.trace.api.gateway.IGSpanInfo; +import datadog.trace.api.gateway.RequestContext; +import datadog.trace.api.gateway.RequestContextSlot; +import datadog.trace.api.internal.TraceSegment; +import datadog.trace.bootstrap.ActiveSubsystems; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import datadog.trace.bootstrap.instrumentation.api.ClientIpAddressData; +import datadog.trace.bootstrap.instrumentation.api.TagContext; +import datadog.trace.bootstrap.instrumentation.api.Tags; +import datadog.trace.bootstrap.instrumentation.api.URIDataAdapter; +import datadog.trace.core.DDCoreJavaSpecification; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Base64; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.function.BiConsumer; +import java.util.function.BiFunction; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.Supplier; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class LambdaAppSecHandlerTest extends DDCoreJavaSpecification { + + static boolean originalAppSecActive; + static AgentTracer.TracerAPI originalTracer; + + @BeforeAll + static void saveState() { + originalAppSecActive = ActiveSubsystems.APPSEC_ACTIVE; + originalTracer = AgentTracer.get(); + } + + @AfterAll + static void restoreAppSecState() { + ActiveSubsystems.APPSEC_ACTIVE = originalAppSecActive; + } + + @BeforeEach + void enableAppSec() { + ActiveSubsystems.APPSEC_ACTIVE = true; + } + + @AfterEach + void resetTracer() { + AgentTracer.forceRegister(originalTracer); + LambdaAppSecHandler.setCurrentTriggerType(null); + } + + // ============================================================================ + // processRequestStart — guard tests + // ============================================================================ + + @Test + void processRequestStartReturnsNullWhenAppSecIsDisabled() { + ActiveSubsystems.APPSEC_ACTIVE = false; + ByteArrayInputStream event = createInputStream("{\"test\": \"data\"}"); + assertNull(LambdaAppSecHandler.processRequestStart(event)); + } + + @Test + void processRequestStartReturnsNullForNonByteArrayInputStream() { + assertNull(LambdaAppSecHandler.processRequestStart("not a stream")); + } + + @Test + void processRequestStartReturnsNullForNullEvent() { + assertNull(LambdaAppSecHandler.processRequestStart(null)); + } + + @Test + void processRequestStartReturnsNullForOversizedEvent() { + int maxSize = Config.get().getAppSecBodyParsingSizeLimit(); + char[] chars = new char[maxSize + 1]; + java.util.Arrays.fill(chars, 'x'); + ByteArrayInputStream event = createInputStream(new String(chars)); + assertNull(LambdaAppSecHandler.processRequestStart(event)); + } + + @Test + void processRequestStartReturnsNullForZeroSizeEvent() { + ByteArrayInputStream event = createInputStream(""); + assertNull(LambdaAppSecHandler.processRequestStart(event)); + } + + @Test + void processRequestStartReturnsNullForMalformedJson() { + ByteArrayInputStream event = createInputStream("{invalid json"); + assertNull(LambdaAppSecHandler.processRequestStart(event)); + } + + @Test + void streamCanBeReadMultipleTimesAfterProcessing() throws IOException { + String jsonData = "{\"test\": \"data\", \"requestContext\": {\"httpMethod\": \"GET\"}}"; + ByteArrayInputStream event = createInputStream(jsonData); + LambdaAppSecHandler.processRequestStart(event); + event.reset(); + byte[] bytes = new byte[event.available()]; + event.read(bytes); + String content = new String(bytes, StandardCharsets.UTF_8); + assertEquals(jsonData, content); + } + + // ============================================================================ + // Trigger Type Detection Tests + // ============================================================================ + + @Test + void detectsApiGatewayV1RestTriggerType() { + Map event = + mapOf("requestContext", mapOf("httpMethod", "GET", "requestId", "abc123")); + + LambdaAppSecHandler.LambdaTriggerType triggerType = + LambdaAppSecHandler.detectTriggerType(event); + + assertEquals(LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V1_REST, triggerType); + } + + @Test + void detectsApiGatewayV2HttpTriggerType() { + Map event = + mapOf( + "requestContext", + mapOf( + "http", mapOf("method", "POST", "path", "/api"), "domainName", "api.example.com")); + + LambdaAppSecHandler.LambdaTriggerType triggerType = + LambdaAppSecHandler.detectTriggerType(event); + + assertEquals(LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V2_HTTP, triggerType); + } + + @Test + void detectsLambdaFunctionUrlTriggerType() { + Map event = + mapOf( + "requestContext", + mapOf( + "http", + mapOf("method", "GET", "path", "/"), + "domainName", + "xyz123.lambda-url.us-east-1.on.aws")); + + LambdaAppSecHandler.LambdaTriggerType triggerType = + LambdaAppSecHandler.detectTriggerType(event); + + assertEquals(LambdaAppSecHandler.LambdaTriggerType.LAMBDA_URL, triggerType); + } + + @Test + void detectsAlbTriggerTypeWithoutMultiValueHeaders() { + Map event = + mapOf( + "httpMethod", + "GET", + "path", + "/", + "requestContext", + mapOf("elb", mapOf("targetGroupArn", "arn:aws:..."))); + + LambdaAppSecHandler.LambdaTriggerType triggerType = + LambdaAppSecHandler.detectTriggerType(event); + + assertEquals(LambdaAppSecHandler.LambdaTriggerType.ALB, triggerType); + } + + @Test + void detectsAlbTriggerTypeWithMultiValueHeaders() { + Map event = + mapOf( + "httpMethod", + "GET", + "path", + "/", + "multiValueHeaders", + mapOf("accept", Arrays.asList("text/html", "application/json")), + "requestContext", + mapOf("elb", mapOf("targetGroupArn", "arn:aws:..."))); + + LambdaAppSecHandler.LambdaTriggerType triggerType = + LambdaAppSecHandler.detectTriggerType(event); + + assertEquals(LambdaAppSecHandler.LambdaTriggerType.ALB_MULTI_VALUE, triggerType); + } + + @Test + void detectsWebSocketTriggerTypeWithRouteKey() { + Map event = + mapOf("requestContext", mapOf("connectionId", "conn-123", "routeKey", "$connect")); + + LambdaAppSecHandler.LambdaTriggerType triggerType = + LambdaAppSecHandler.detectTriggerType(event); + + assertEquals(LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V2_WEBSOCKET, triggerType); + } + + @Test + void detectsWebSocketTriggerTypeWithEventType() { + Map event = + mapOf("requestContext", mapOf("connectionId", "conn-456", "eventType", "CONNECT")); + + LambdaAppSecHandler.LambdaTriggerType triggerType = + LambdaAppSecHandler.detectTriggerType(event); + + assertEquals(LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V2_WEBSOCKET, triggerType); + } + + @Test + void detectsUnknownTriggerTypeForUnrecognizedEvents() { + Map event = mapOf("someUnknownField", "value"); + + LambdaAppSecHandler.LambdaTriggerType triggerType = + LambdaAppSecHandler.detectTriggerType(event); + + assertEquals(LambdaAppSecHandler.LambdaTriggerType.UNKNOWN, triggerType); + } + + @Test + void detectsUnknownTriggerTypeForEmptyRequestContext() { + Map event = mapOf("requestContext", mapOf()); + + LambdaAppSecHandler.LambdaTriggerType triggerType = + LambdaAppSecHandler.detectTriggerType(event); + + assertEquals(LambdaAppSecHandler.LambdaTriggerType.UNKNOWN, triggerType); + } + + @Test + void detectsLambdaUrlWhenHttpPresentButNoDomainName() { + Map event = + mapOf("requestContext", mapOf("http", mapOf("method", "GET", "path", "/ambiguous"))); + + LambdaAppSecHandler.LambdaTriggerType triggerType = + LambdaAppSecHandler.detectTriggerType(event); + + assertEquals(LambdaAppSecHandler.LambdaTriggerType.LAMBDA_URL, triggerType); + } + + // ============================================================================ + // Data Extraction Tests with Mocked Callbacks + // ============================================================================ + + @Test + @SuppressWarnings("unchecked") + void extractsApiGatewayV1RestDataCorrectly() { + String eventJson = + "{" + + "\"path\": \"/api/users/123\"," + + "\"httpMethod\": \"POST\"," + + "\"headers\": {\"Content-Type\": \"application/json\", \"Authorization\": \"Bearer token123\"}," + + "\"pathParameters\": {\"userId\": \"123\"}," + + "\"body\": \"{\\\"name\\\": \\\"John\\\"}\"," + + "\"requestContext\": {" + + " \"httpMethod\": \"POST\"," + + " \"requestId\": \"req-123\"," + + " \"identity\": {\"sourceIp\": \"192.168.1.100\"}" + + "}" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + String[] capturedMethod = {null}; + String[] capturedPath = {null}; + Map capturedHeaders = new HashMap<>(); + String[] capturedSourceIp = {null}; + int[] capturedSourcePort = {-1}; + Map[] capturedPathParams = {null}; + Object[] capturedBody = {null}; + + setupMockCallbacks( + new Callbacks() + .onMethodUri( + (method, uri) -> { + capturedMethod[0] = method; + capturedPath[0] = uri.path(); + }) + .onHeader(capturedHeaders::put) + .onSocketAddress( + (ip, port) -> { + capturedSourceIp[0] = ip; + capturedSourcePort[0] = port; + }) + .onPathParams(params -> capturedPathParams[0] = params) + .onBody(body -> capturedBody[0] = body)); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertInstanceOf(TagContext.class, result); + assertEquals("POST", capturedMethod[0]); + assertEquals("/api/users/123", capturedPath[0]); + assertEquals("application/json", capturedHeaders.get("Content-Type")); + assertEquals("Bearer token123", capturedHeaders.get("Authorization")); + assertEquals("192.168.1.100", capturedSourceIp[0]); + assertEquals(0, capturedSourcePort[0]); + assertNotNull(capturedPathParams[0]); + assertEquals("123", capturedPathParams[0].get("userId")); + assertInstanceOf(Map.class, capturedBody[0]); + assertEquals("John", ((Map) capturedBody[0]).get("name")); + } + + @Test + void extractsApiGatewayV2HttpDataCorrectly() { + String eventJson = + "{" + + "\"version\": \"2.0\"," + + "\"headers\": {\"content-type\": \"application/json\", \"x-custom-header\": \"custom-value\"}," + + "\"cookies\": [\"session=abc123\", \"user=john\"]," + + "\"pathParameters\": {\"id\": \"456\"}," + + "\"body\": \"test body\"," + + "\"requestContext\": {" + + " \"http\": {\"method\": \"PUT\", \"path\": \"/api/items/456\", \"sourceIp\": \"10.0.0.50\", \"sourcePort\": 54321}," + + " \"domainName\": \"api.example.com\"" + + "}" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + String[] capturedMethod = {null}; + String[] capturedPath = {null}; + Map capturedHeaders = new HashMap<>(); + String[] capturedSourceIp = {null}; + int[] capturedSourcePort = {-1}; + Map[] capturedPathParams = {null}; + + setupMockCallbacks( + new Callbacks() + .onMethodUri( + (method, uri) -> { + capturedMethod[0] = method; + capturedPath[0] = uri.path(); + }) + .onHeader(capturedHeaders::put) + .onSocketAddress( + (ip, port) -> { + capturedSourceIp[0] = ip; + capturedSourcePort[0] = port; + }) + .onPathParams(params -> capturedPathParams[0] = params)); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertEquals("PUT", capturedMethod[0]); + assertEquals("/api/items/456", capturedPath[0]); + assertEquals("application/json", capturedHeaders.get("content-type")); + assertEquals("custom-value", capturedHeaders.get("x-custom-header")); + assertEquals("session=abc123; user=john", capturedHeaders.get("cookie")); + assertEquals("10.0.0.50", capturedSourceIp[0]); + assertEquals(54321, capturedSourcePort[0]); + assertNotNull(capturedPathParams[0]); + assertEquals("456", capturedPathParams[0].get("id")); + } + + @Test + void extractsLambdaFunctionUrlDataCorrectly() { + String eventJson = + "{" + + "\"version\": \"2.0\"," + + "\"headers\": {\"host\": \"xyz.lambda-url.us-east-1.on.aws\"}," + + "\"requestContext\": {" + + " \"http\": {\"method\": \"GET\", \"path\": \"/function/path\", \"sourceIp\": \"1.2.3.4\"}," + + " \"domainName\": \"xyz.lambda-url.us-east-1.on.aws\"" + + "}" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + String[] capturedMethod = {null}; + String[] capturedPath = {null}; + + setupMockCallbacks( + new Callbacks() + .onMethodUri( + (method, uri) -> { + capturedMethod[0] = method; + capturedPath[0] = uri.path(); + })); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertEquals("GET", capturedMethod[0]); + assertEquals("/function/path", capturedPath[0]); + } + + @Test + void extractsAlbDataCorrectly() { + String eventJson = + "{" + + "\"path\": \"/alb/test\"," + + "\"httpMethod\": \"DELETE\"," + + "\"headers\": {\"x-forwarded-for\": \"203.0.113.42\", \"user-agent\": \"curl/7.64.1\"}," + + "\"requestContext\": {" + + " \"elb\": {\"targetGroupArn\": \"arn:aws:elasticloadbalancing:us-east-1:123456789012:targetgroup/tg/50dc6c495c0c9188\"}" + + "}" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + String[] capturedMethod = {null}; + String[] capturedPath = {null}; + String[] capturedSourceIp = {null}; + + setupMockCallbacks( + new Callbacks() + .onMethodUri( + (method, uri) -> { + capturedMethod[0] = method; + capturedPath[0] = uri.path(); + }) + .onSocketAddress((ip, port) -> capturedSourceIp[0] = ip)); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertEquals("DELETE", capturedMethod[0]); + assertEquals("/alb/test", capturedPath[0]); + assertEquals("203.0.113.42", capturedSourceIp[0]); + } + + @Test + void extractsAlbMultiValueHeadersCorrectly() { + String eventJson = + "{" + + "\"path\": \"/test\"," + + "\"httpMethod\": \"GET\"," + + "\"multiValueHeaders\": {\"accept\": [\"text/html\", \"application/json\"], \"x-custom\": [\"value1\", \"value2\"]}," + + "\"requestContext\": {\"elb\": {\"targetGroupArn\": \"arn:aws:...\"}}" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + Map capturedHeaders = new HashMap<>(); + + setupMockCallbacks(new Callbacks().onHeader(capturedHeaders::put)); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertEquals("text/html, application/json", capturedHeaders.get("accept")); + assertEquals("value1, value2", capturedHeaders.get("x-custom")); + } + + @Test + void albMultiValueQueryParamsHandlesListValues() { + String eventJson = + "{" + + "\"path\": \"/test\"," + + "\"httpMethod\": \"GET\"," + + "\"multiValueHeaders\": {\"accept\": [\"text/html\"]}," + + "\"multiValueQueryStringParameters\": {\"foo\": [\"bar\", \"baz\"], \"x\": [null, \"val\"]}," + + "\"requestContext\": {\"elb\": {\"targetGroupArn\": \"arn:aws:...\"}}" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + String[] capturedQuery = {null}; + + setupMockCallbacks( + new Callbacks() + .onMethodUri( + (method, uri) -> { + capturedQuery[0] = uri.query(); + })); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertNotNull(capturedQuery[0]); + assertTrue(capturedQuery[0].contains("foo=bar") || capturedQuery[0].contains("foo=baz")); + assertTrue(capturedQuery[0].contains("x=val")); + } + + @Test + void albMultiValueHeadersHandlesNonListValue() { + String eventJson = + "{" + + "\"path\": \"/test\"," + + "\"httpMethod\": \"GET\"," + + "\"multiValueHeaders\": {\"content-type\": \"text/plain\", \"accept\": [\"application/json\"]}," + + "\"requestContext\": {\"elb\": {\"targetGroupArn\": \"arn:aws:...\"}}" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + Map capturedHeaders = new HashMap<>(); + + setupMockCallbacks(new Callbacks().onHeader(capturedHeaders::put)); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertEquals("text/plain", capturedHeaders.get("content-type")); + assertEquals("application/json", capturedHeaders.get("accept")); + } + + @Test + void nullJsonEventReturnsEmpty() { + // MAP_ADAPTER.fromJson("null") returns null, triggering LambdaEventData.EMPTY path + ByteArrayInputStream event = createInputStream("null"); + + setupMockCallbacks(new Callbacks()); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNull(result); + } + + @Test + void albMultiValueQueryParamsHandlesNonListValue() { + String eventJson = + "{" + + "\"path\": \"/test\"," + + "\"httpMethod\": \"GET\"," + + "\"multiValueHeaders\": {\"accept\": [\"text/html\"]}," + + "\"multiValueQueryStringParameters\": {\"foo\": \"plain-string\"}," + + "\"requestContext\": {\"elb\": {\"targetGroupArn\": \"arn:aws:...\"}}" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + String[] capturedQuery = {null}; + + setupMockCallbacks( + new Callbacks() + .onMethodUri( + (method, uri) -> { + capturedQuery[0] = uri.query(); + })); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertNotNull(capturedQuery[0]); + assertTrue(capturedQuery[0].contains("foo=plain-string")); + } + + @Test + void handlesMultiValueHeadersWithEmptyList() { + String eventJson = + "{" + + "\"path\": \"/test\"," + + "\"httpMethod\": \"GET\"," + + "\"multiValueHeaders\": {\"accept\": [], \"x-custom\": [\"value1\"]}," + + "\"requestContext\": {\"elb\": {\"targetGroupArn\": \"arn:aws:...\"}}" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + Map capturedHeaders = new HashMap<>(); + + setupMockCallbacks(new Callbacks().onHeader(capturedHeaders::put)); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertEquals("", capturedHeaders.get("accept")); + assertEquals("value1", capturedHeaders.get("x-custom")); + } + + @Test + void extractsWebSocketDataCorrectly() { + String eventJson = + "{" + + "\"requestContext\": {" + + " \"routeKey\": \"$connect\"," + + " \"connectionId\": \"conn-abc123\"," + + " \"identity\": {\"sourceIp\": \"192.168.0.100\"}" + + "}" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + String[] capturedMethod = {null}; + String[] capturedPath = {null}; + String[] capturedSourceIp = {null}; + + setupMockCallbacks( + new Callbacks() + .onMethodUri( + (method, uri) -> { + capturedMethod[0] = method; + capturedPath[0] = uri.path(); + }) + .onSocketAddress((ip, port) -> capturedSourceIp[0] = ip)); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertEquals("WEBSOCKET", capturedMethod[0]); + assertEquals("$connect", capturedPath[0]); + assertEquals("192.168.0.100", capturedSourceIp[0]); + } + + @Test + void handlesBase64EncodedBodyCorrectly() { + String originalBody = "This is test data"; + String base64Body = Base64.getEncoder().encodeToString(originalBody.getBytes()); + String eventJson = + "{" + + "\"body\": \"" + + base64Body + + "\"," + + "\"isBase64Encoded\": true," + + "\"requestContext\": {\"httpMethod\": \"POST\"}" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + Object[] capturedBody = {null}; + + setupMockCallbacks(new Callbacks().onBody(body -> capturedBody[0] = body)); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertEquals(originalBody, capturedBody[0]); + } + + @Test + void handlesNullBodyCorrectly() { + ByteArrayInputStream event = + createInputStream("{\"body\": null, \"requestContext\": {\"httpMethod\": \"GET\"}}"); + + String[] capturedBody = {"NOT_CALLED"}; + + setupMockCallbacks(new Callbacks().onBody(body -> capturedBody[0] = String.valueOf(body))); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertEquals("NOT_CALLED", capturedBody[0]); + } + + @Test + void handlesEmptyBodyCorrectly() { + ByteArrayInputStream event = + createInputStream("{\"body\": \"\", \"requestContext\": {\"httpMethod\": \"POST\"}}"); + + Object[] capturedBody = {null}; + + setupMockCallbacks(new Callbacks().onBody(body -> capturedBody[0] = body)); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertEquals("", capturedBody[0]); + } + + @Test + void handlesPathWithQueryStringCorrectly() { + String eventJson = + "{" + + "\"path\": \"/api/users?id=123&filter=active\"," + + "\"requestContext\": {\"httpMethod\": \"GET\"}" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + String[] capturedPath = {null}; + String[] capturedQuery = {null}; + + setupMockCallbacks( + new Callbacks() + .onMethodUri( + (method, uri) -> { + capturedPath[0] = uri.path(); + capturedQuery[0] = uri.query(); + })); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertEquals("/api/users", capturedPath[0]); + assertEquals("id=123&filter=active", capturedQuery[0]); + } + + @Test + void extractsQueryStringParametersAndBuildsFullUri() { + String eventJson = + "{" + + "\"path\": \"/api/items\"," + + "\"queryStringParameters\": {\"page\": \"2\", \"sort\": \"asc\"}," + + "\"requestContext\": {\"httpMethod\": \"GET\", \"requestId\": \"req-456\"}" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + String[] capturedPath = {null}; + String[] capturedQuery = {null}; + String[] capturedRawPath = {null}; + String[] capturedRawQuery = {null}; + String[] capturedHost = {"NOT_CALLED"}; + String[] capturedFragment = {"NOT_CALLED"}; + + setupMockCallbacks( + new Callbacks() + .onMethodUri( + (method, uri) -> { + capturedPath[0] = uri.path(); + capturedQuery[0] = uri.query(); + capturedRawPath[0] = uri.rawPath(); + capturedRawQuery[0] = uri.rawQuery(); + capturedHost[0] = uri.host(); + capturedFragment[0] = uri.fragment(); + })); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertEquals("/api/items", capturedPath[0]); + assertNotNull(capturedQuery[0]); + assertTrue(capturedQuery[0].contains("page=2")); + assertTrue(capturedQuery[0].contains("sort=asc")); + assertEquals("/api/items", capturedRawPath[0]); + assertEquals(capturedQuery[0], capturedRawQuery[0]); + assertNull(capturedHost[0]); + assertNull(capturedFragment[0]); + } + + @Test + void extractQueryParametersFiltersNullEntries() { + String eventJson = + "{" + + "\"path\": \"/filter-test\"," + + "\"queryStringParameters\": {\"valid\": \"keep\", \"nullval\": null}," + + "\"requestContext\": {\"httpMethod\": \"GET\", \"requestId\": \"req-789\"}" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + String[] capturedQuery = {null}; + + setupMockCallbacks( + new Callbacks() + .onMethodUri( + (method, uri) -> { + capturedQuery[0] = uri.query(); + })); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertNotNull(capturedQuery[0]); + assertTrue(capturedQuery[0].contains("valid=keep")); + assertFalse(capturedQuery[0].contains("nullval")); + } + + @Test + void buildFullPathEncodesSpecialCharactersInQueryParams() { + // Keys/values containing '&', '=', and spaces must be percent-encoded so they are not + // misinterpreted as query string delimiters when AppSec parses the raw query string. + String eventJson = + "{" + + "\"path\": \"/search\"," + + "\"queryStringParameters\": {\"q\": \"hello world\", \"filter\": \"a&b\", \"eq\": \"x=y\"}," + + "\"requestContext\": {\"httpMethod\": \"GET\", \"requestId\": \"req-special\"}" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + String[] capturedQuery = {null}; + + setupMockCallbacks( + new Callbacks() + .onMethodUri( + (method, uri) -> { + capturedQuery[0] = uri.query(); + })); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertNotNull(capturedQuery[0]); + // spaces encoded as '+' or '%20', '&' as '%26', '=' as '%3D' + assertFalse(capturedQuery[0].contains("hello world"), "space must be encoded"); + assertFalse(capturedQuery[0].contains("a&b"), "'&' in value must be encoded"); + assertFalse(capturedQuery[0].contains("x=y"), "'=' in value must be encoded"); + assertTrue( + capturedQuery[0].contains("hello+world") || capturedQuery[0].contains("hello%20world"), + "space should be encoded as '+' or '%20'"); + assertTrue(capturedQuery[0].contains("a%26b"), "'&' should be encoded as '%26'"); + assertTrue(capturedQuery[0].contains("x%3Dy"), "'=' should be encoded as '%3D'"); + } + + @Test + void extractsSchemeAndPortFromXForwardedHeaders() { + String eventJson = + "{" + + "\"path\": \"/api/test\"," + + "\"headers\": {\"x-forwarded-proto\": \"http\", \"x-forwarded-port\": \"8080\"}," + + "\"requestContext\": {\"httpMethod\": \"GET\", \"requestId\": \"req-123\"}" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + String[] capturedScheme = {null}; + int[] capturedPort = {-1}; + + setupMockCallbacks( + new Callbacks() + .onMethodUri( + (method, uri) -> { + capturedScheme[0] = uri.scheme(); + capturedPort[0] = uri.port(); + })); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertEquals("http", capturedScheme[0]); + assertEquals(8080, capturedPort[0]); + } + + @Test + void fallsBackToHttps443WhenXForwardedHeadersAreAbsent() { + String eventJson = + "{" + + "\"path\": \"/api/test\"," + + "\"headers\": {}," + + "\"requestContext\": {\"httpMethod\": \"GET\", \"requestId\": \"req-123\"}" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + String[] capturedScheme = {null}; + int[] capturedPort = {-1}; + + setupMockCallbacks( + new Callbacks() + .onMethodUri( + (method, uri) -> { + capturedScheme[0] = uri.scheme(); + capturedPort[0] = uri.port(); + })); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertEquals("https", capturedScheme[0]); + assertEquals(443, capturedPort[0]); + } + + @Test + void handlesInvalidXForwardedPortGracefully() { + String eventJson = + "{" + + "\"path\": \"/api/test\"," + + "\"headers\": {\"x-forwarded-proto\": \"https\", \"x-forwarded-port\": \"not-a-number\"}," + + "\"requestContext\": {\"httpMethod\": \"GET\", \"requestId\": \"req-123\"}" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + String[] capturedScheme = {null}; + int[] capturedPort = {-1}; + + setupMockCallbacks( + new Callbacks() + .onMethodUri( + (method, uri) -> { + capturedScheme[0] = uri.scheme(); + capturedPort[0] = uri.port(); + })); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertEquals("https", capturedScheme[0]); + assertEquals(443, capturedPort[0]); + } + + @Test + void handlesInvalidBase64BodyGracefully() { + String eventJson = + "{" + + "\"body\": \"not-valid-base64\"," + + "\"isBase64Encoded\": true," + + "\"requestContext\": {\"httpMethod\": \"POST\"}" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + String[] capturedBody = {"NOT_CALLED"}; + + setupMockCallbacks(new Callbacks().onBody(body -> capturedBody[0] = String.valueOf(body))); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertEquals("NOT_CALLED", capturedBody[0]); + } + + @Test + void handlesBase64DecodedEmptyStringBody() { + String base64Empty = Base64.getEncoder().encodeToString("".getBytes()); + String eventJson = + "{" + + "\"body\": \"" + + base64Empty + + "\"," + + "\"isBase64Encoded\": true," + + "\"requestContext\": {\"httpMethod\": \"POST\"}" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + Object[] capturedBody = {null}; + + setupMockCallbacks(new Callbacks().onBody(body -> capturedBody[0] = body)); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertEquals("", capturedBody[0]); + } + + @Test + @SuppressWarnings("unchecked") + void handlesBodyWithSpecialCharacters() { + String eventJson = + "{" + + "\"body\": \"{\\\"text\\\": \\\"Hello \\u4e16\\u754c \\uD83C\\uDF0D\\\"}\"," + + "\"requestContext\": {\"httpMethod\": \"POST\"}" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + Object[] capturedBody = {null}; + + setupMockCallbacks(new Callbacks().onBody(body -> capturedBody[0] = body)); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertInstanceOf(Map.class, capturedBody[0]); + assertEquals("Hello 世界 🌍", ((Map) capturedBody[0]).get("text")); + } + + // ============================================================================ + // Generic Data Extraction Tests + // ============================================================================ + + @Test + void extractsDataFromUnknownTriggerTypeUsingGenericExtraction() { + String eventJson = + "{" + + "\"path\": \"/generic/path\"," + + "\"httpMethod\": \"PATCH\"," + + "\"headers\": {\"x-custom-header\": \"generic-value\"}," + + "\"unknownField\": \"should be ignored\"," + + "\"requestContext\": {\"identity\": {\"sourceIp\": \"203.0.113.1\"}}" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + String[] capturedMethod = {null}; + String[] capturedPath = {null}; + Map capturedHeaders = new HashMap<>(); + String[] capturedSourceIp = {null}; + + setupMockCallbacks( + new Callbacks() + .onMethodUri( + (method, uri) -> { + capturedMethod[0] = method; + capturedPath[0] = uri.path(); + }) + .onHeader(capturedHeaders::put) + .onSocketAddress((ip, port) -> capturedSourceIp[0] = ip)); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertEquals("PATCH", capturedMethod[0]); + assertEquals("/generic/path", capturedPath[0]); + assertEquals("generic-value", capturedHeaders.get("x-custom-header")); + assertEquals("203.0.113.1", capturedSourceIp[0]); + } + + @Test + void extractsDataFromUnknownTriggerWithHttpInRequestContext() { + String eventJson = + "{" + + "\"requestContext\": {" + + " \"http\": {\"method\": \"OPTIONS\", \"path\": \"/options/path\", \"sourceIp\": \"198.51.100.50\"}" + + "}" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + String[] capturedMethod = {null}; + String[] capturedPath = {null}; + String[] capturedSourceIp = {null}; + + setupMockCallbacks( + new Callbacks() + .onMethodUri( + (method, uri) -> { + capturedMethod[0] = method; + capturedPath[0] = uri.path(); + }) + .onSocketAddress((ip, port) -> capturedSourceIp[0] = ip)); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertEquals("OPTIONS", capturedMethod[0]); + assertEquals("/options/path", capturedPath[0]); + assertEquals("198.51.100.50", capturedSourceIp[0]); + } + + @Test + void genericExtractionUsesHttpMethodFromRequestContext() { + String eventJson = + "{\"path\": \"/ctx-method\", \"requestContext\": {\"httpMethod\": \"DELETE\"}}"; + ByteArrayInputStream event = createInputStream(eventJson); + + String[] capturedMethod = {null}; + String[] capturedPath = {null}; + + setupMockCallbacks( + new Callbacks() + .onMethodUri( + (method, uri) -> { + capturedMethod[0] = method; + capturedPath[0] = uri.path(); + })); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertEquals("DELETE", capturedMethod[0]); + assertEquals("/ctx-method", capturedPath[0]); + } + + @Test + void handlesCookiesMergingWithExistingCookieHeader() { + String eventJson = + "{" + + "\"headers\": {\"cookie\": \"existing=value\"}," + + "\"cookies\": [\"new=cookie1\", \"another=cookie2\"]," + + "\"requestContext\": {\"http\": {\"method\": \"GET\", \"path\": \"/\"}}" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + Map capturedHeaders = new HashMap<>(); + + setupMockCallbacks(new Callbacks().onHeader(capturedHeaders::put)); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertEquals("existing=value; new=cookie1; another=cookie2", capturedHeaders.get("cookie")); + } + + @Test + void handlesEmptyCookiesArrayCorrectly() { + String eventJson = + "{" + + "\"headers\": {\"content-type\": \"application/json\"}," + + "\"cookies\": []," + + "\"requestContext\": {\"http\": {\"method\": \"GET\", \"path\": \"/\"}}" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + Map capturedHeaders = new HashMap<>(); + + setupMockCallbacks(new Callbacks().onHeader(capturedHeaders::put)); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertFalse(capturedHeaders.containsKey("cookie")); + } + + // ============================================================================ + // processRequestEnd Tests + // ============================================================================ + + @Test + void processRequestEndDoesNothingWhenSpanIsNull() { + LambdaAppSecHandler.processRequestEnd(null); + // no exception expected + } + + @Test + void processRequestEndDoesNothingWhenAppSecIsDisabled() { + ActiveSubsystems.APPSEC_ACTIVE = false; + AgentSpan span = mock(AgentSpan.class); + + LambdaAppSecHandler.processRequestEnd(span); + + verifyNoInteractions(span); + } + + @Test + void processRequestEndDoesNothingWhenSpanHasNoRequestContext() { + AgentSpan span = mock(AgentSpan.class); + when(span.getRequestContext()).thenReturn(null); + LambdaAppSecHandler.processRequestEnd(span); + // no exception expected + } + + @Test + @SuppressWarnings("unchecked") + void processRequestEndInvokesCallbackAndSkipsAsmTagsWhenNotManuallyKept() { + AppSecContext mockAppSecContext = mock(AppSecContext.class); + when(mockAppSecContext.isManuallyKept()).thenReturn(false); + TraceSegment mockTraceSegment = mock(TraceSegment.class); + RequestContext mockRequestContext = mock(RequestContext.class); + when(mockRequestContext.getData(RequestContextSlot.APPSEC)).thenReturn(mockAppSecContext); + when(mockRequestContext.getTraceSegment()).thenReturn(mockTraceSegment); + AgentSpan span = mock(AgentSpan.class); + when(span.getRequestContext()).thenReturn(mockRequestContext); + + BiFunction> requestEndedCallback = + mock(BiFunction.class); + when(requestEndedCallback.apply(any(), any())).thenReturn(new Flow.ResultFlow<>(null)); + + CallbackProvider mockCallbackProvider = mock(CallbackProvider.class); + when(mockCallbackProvider.getCallback(EVENTS.requestEnded())).thenReturn(requestEndedCallback); + + AgentTracer.TracerAPI mockTracer = mock(AgentTracer.TracerAPI.class); + when(mockTracer.getCallbackProvider(RequestContextSlot.APPSEC)) + .thenReturn(mockCallbackProvider); + AgentTracer.forceRegister(mockTracer); + + LambdaAppSecHandler.processRequestEnd(span); + + verify(requestEndedCallback).apply(mockRequestContext, span); + verify(mockTraceSegment, never()).setTagTop(any(), any()); + } + + @Test + void processRequestEndHandlesNullRequestEndedCallbackGracefully() { + RequestContext mockRequestContext = mock(RequestContext.class); + AgentSpan span = mock(AgentSpan.class); + when(span.getRequestContext()).thenReturn(mockRequestContext); + + CallbackProvider mockCallbackProvider = mock(CallbackProvider.class); + when(mockCallbackProvider.getCallback(EVENTS.requestEnded())).thenReturn(null); + + AgentTracer.TracerAPI mockTracer = mock(AgentTracer.TracerAPI.class); + when(mockTracer.getCallbackProvider(RequestContextSlot.APPSEC)) + .thenReturn(mockCallbackProvider); + AgentTracer.forceRegister(mockTracer); + + assertDoesNotThrow(() -> LambdaAppSecHandler.processRequestEnd(span)); + } + + @Test + @SuppressWarnings("unchecked") + void processRequestEndSetsAsmKeepTagWhenAppSecContextIsManuallyKept() { + AppSecContext manuallyKeptCtx = mock(AppSecContext.class); + when(manuallyKeptCtx.isManuallyKept()).thenReturn(true); + + TraceSegment mockTraceSegment = mock(TraceSegment.class); + RequestContext mockRequestContext = mock(RequestContext.class); + when(mockRequestContext.getData(RequestContextSlot.APPSEC)).thenReturn(manuallyKeptCtx); + when(mockRequestContext.getTraceSegment()).thenReturn(mockTraceSegment); + + AgentSpan span = mock(AgentSpan.class); + when(span.getRequestContext()).thenReturn(mockRequestContext); + + BiFunction> requestEndedCallback = + mock(BiFunction.class); + when(requestEndedCallback.apply(any(), any())).thenReturn(new Flow.ResultFlow<>(null)); + + CallbackProvider mockCallbackProvider = mock(CallbackProvider.class); + when(mockCallbackProvider.getCallback(EVENTS.requestEnded())).thenReturn(requestEndedCallback); + + AgentTracer.TracerAPI mockTracer = mock(AgentTracer.TracerAPI.class); + when(mockTracer.getCallbackProvider(RequestContextSlot.APPSEC)) + .thenReturn(mockCallbackProvider); + AgentTracer.forceRegister(mockTracer); + + LambdaAppSecHandler.processRequestEnd(span); + + verify(requestEndedCallback).apply(mockRequestContext, span); + verify(mockTraceSegment).setTagTop(Tags.ASM_KEEP, true); + verify(mockTraceSegment).setTagTop(Tags.PROPAGATED_TRACE_SOURCE, ProductTraceSource.ASM); + } + + // ============================================================================ + // mergeContexts Tests + // ============================================================================ + + @Test + void mergeContextsReturnsNullWhenBothContextsAreNull() { + assertNull(LambdaAppSecHandler.mergeContexts(null, null)); + } + + @Test + void mergeContextsReturnsExtensionContextWhenAppSecContextIsNull() { + TagContext extensionContext = mock(TagContext.class); + assertEquals(extensionContext, LambdaAppSecHandler.mergeContexts(extensionContext, null)); + } + + @Test + void mergeContextsReturnsAppSecContextWhenExtensionContextIsNull() { + TagContext appSecContext = mock(TagContext.class); + assertEquals(appSecContext, LambdaAppSecHandler.mergeContexts(null, appSecContext)); + } + + @Test + void mergeContextsMergesAppSecDataIntoTagContext() { + Object appSecData = new Object(); + TagContext appSecContext = new TagContext(); + appSecContext.withRequestContextDataAppSec(appSecData); + TagContext extensionContext = new TagContext(); + + AgentSpanContext result = LambdaAppSecHandler.mergeContexts(extensionContext, appSecContext); + + assertEquals(extensionContext, result); + assertEquals(appSecData, ((TagContext) result).getRequestContextDataAppSec()); + } + + @Test + void mergeContextsReturnsExtensionContextWhenAppSecContextIsNotTagContext() { + TagContext extensionContext = mock(TagContext.class); + AgentSpanContext appSecContext = mock(AgentSpanContext.class); + assertEquals( + extensionContext, LambdaAppSecHandler.mergeContexts(extensionContext, appSecContext)); + } + + @Test + void mergeContextsReturnsExtensionContextWhenItIsNotTagContext() { + AgentSpanContext extensionContext = mock(AgentSpanContext.class); + TagContext appSecContext = mock(TagContext.class); + assertEquals( + extensionContext, LambdaAppSecHandler.mergeContexts(extensionContext, appSecContext)); + } + + // ============================================================================ + // Error Handling and Null Callback Tests + // ============================================================================ + + @Test + @SuppressWarnings("unchecked") + void processRequestStartHandlesNullRequestStartedCallbackGracefully() { + String eventJson = "{\"requestContext\": {\"httpMethod\": \"GET\"}}"; + ByteArrayInputStream event = createInputStream(eventJson); + + CallbackProvider mockCallbackProvider = mock(CallbackProvider.class); + when(mockCallbackProvider.getCallback(EVENTS.requestStarted())).thenReturn(null); + + AgentTracer.TracerAPI mockTracer = mock(AgentTracer.TracerAPI.class); + when(mockTracer.getCallbackProvider(RequestContextSlot.APPSEC)) + .thenReturn(mockCallbackProvider); + AgentTracer.forceRegister(mockTracer); + + assertNull(LambdaAppSecHandler.processRequestStart(event)); + } + + @Test + @SuppressWarnings("unchecked") + void processRequestStartHandlesNullMethodUriCallbackGracefully() { + String eventJson = "{\"path\": \"/test\", \"requestContext\": {\"httpMethod\": \"GET\"}}"; + ByteArrayInputStream event = createInputStream(eventJson); + + Object mockAppSecContext = new Object(); + Supplier> requestStartedCallback = mock(Supplier.class); + when(requestStartedCallback.get()).thenReturn(new Flow.ResultFlow<>(mockAppSecContext)); + + CallbackProvider mockCallbackProvider = mock(CallbackProvider.class); + when(mockCallbackProvider.getCallback(EVENTS.requestStarted())) + .thenReturn(requestStartedCallback); + when(mockCallbackProvider.getCallback(EVENTS.requestMethodUriRaw())).thenReturn(null); + when(mockCallbackProvider.getCallback(EVENTS.requestHeader())).thenReturn(null); + when(mockCallbackProvider.getCallback(EVENTS.requestClientSocketAddress())).thenReturn(null); + Function> headerDoneCallback = mock(Function.class); + when(headerDoneCallback.apply(any())).thenReturn(new Flow.ResultFlow<>(null)); + when(mockCallbackProvider.getCallback(EVENTS.requestHeaderDone())) + .thenReturn(headerDoneCallback); + when(mockCallbackProvider.getCallback(EVENTS.requestPathParams())).thenReturn(null); + when(mockCallbackProvider.getCallback(EVENTS.requestBodyProcessed())).thenReturn(null); + + AgentTracer.TracerAPI mockTracer = mock(AgentTracer.TracerAPI.class); + when(mockTracer.getCallbackProvider(RequestContextSlot.APPSEC)) + .thenReturn(mockCallbackProvider); + AgentTracer.forceRegister(mockTracer); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertInstanceOf(TagContext.class, result); + } + + @Test + @SuppressWarnings("unchecked") + void processRequestStartHandlesNullHeaderDoneCallbackGracefully() { + String eventJson = "{\"path\": \"/test\", \"requestContext\": {\"httpMethod\": \"GET\"}}"; + ByteArrayInputStream event = createInputStream(eventJson); + + Object mockAppSecContext = new Object(); + Supplier> requestStartedCallback = mock(Supplier.class); + when(requestStartedCallback.get()).thenReturn(new Flow.ResultFlow<>(mockAppSecContext)); + + CallbackProvider mockCallbackProvider = mock(CallbackProvider.class); + when(mockCallbackProvider.getCallback(EVENTS.requestStarted())) + .thenReturn(requestStartedCallback); + when(mockCallbackProvider.getCallback(EVENTS.requestMethodUriRaw())).thenReturn(null); + when(mockCallbackProvider.getCallback(EVENTS.requestHeader())).thenReturn(null); + when(mockCallbackProvider.getCallback(EVENTS.requestClientSocketAddress())).thenReturn(null); + when(mockCallbackProvider.getCallback(EVENTS.requestHeaderDone())).thenReturn(null); + when(mockCallbackProvider.getCallback(EVENTS.requestPathParams())).thenReturn(null); + when(mockCallbackProvider.getCallback(EVENTS.requestBodyProcessed())).thenReturn(null); + + AgentTracer.TracerAPI mockTracer = mock(AgentTracer.TracerAPI.class); + when(mockTracer.getCallbackProvider(RequestContextSlot.APPSEC)) + .thenReturn(mockCallbackProvider); + AgentTracer.forceRegister(mockTracer); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertInstanceOf(TagContext.class, result); + } + + @Test + @SuppressWarnings("unchecked") + void processRequestStartHandlesNullPathParamsCallbackGracefully() { + String eventJson = + "{\"path\": \"/test\", \"pathParameters\": {\"id\": \"42\"}, \"requestContext\": {\"httpMethod\": \"GET\"}}"; + ByteArrayInputStream event = createInputStream(eventJson); + + Object mockAppSecContext = new Object(); + Supplier> requestStartedCallback = mock(Supplier.class); + when(requestStartedCallback.get()).thenReturn(new Flow.ResultFlow<>(mockAppSecContext)); + + Function> headerDoneCallback = mock(Function.class); + when(headerDoneCallback.apply(any())).thenReturn(new Flow.ResultFlow<>(null)); + + CallbackProvider mockCallbackProvider = mock(CallbackProvider.class); + when(mockCallbackProvider.getCallback(EVENTS.requestStarted())) + .thenReturn(requestStartedCallback); + when(mockCallbackProvider.getCallback(EVENTS.requestMethodUriRaw())).thenReturn(null); + when(mockCallbackProvider.getCallback(EVENTS.requestHeader())).thenReturn(null); + when(mockCallbackProvider.getCallback(EVENTS.requestClientSocketAddress())).thenReturn(null); + when(mockCallbackProvider.getCallback(EVENTS.requestHeaderDone())) + .thenReturn(headerDoneCallback); + when(mockCallbackProvider.getCallback(EVENTS.requestPathParams())).thenReturn(null); + when(mockCallbackProvider.getCallback(EVENTS.requestBodyProcessed())).thenReturn(null); + + AgentTracer.TracerAPI mockTracer = mock(AgentTracer.TracerAPI.class); + when(mockTracer.getCallbackProvider(RequestContextSlot.APPSEC)) + .thenReturn(mockCallbackProvider); + AgentTracer.forceRegister(mockTracer); + + AgentSpanContext result = LambdaAppSecHandler.processRequestStart(event); + + assertNotNull(result); + assertInstanceOf(TagContext.class, result); + } + + @Test + void processRequestStartHandlesExceptionDuringJsonParsing() { + ByteArrayInputStream event = createInputStream("{this is not valid JSON at all"); + assertNull(LambdaAppSecHandler.processRequestStart(event)); + } + + @Test + void processRequestStartHandlesExceptionDuringStreamReading() { + ByteArrayInputStream mockStream = + new ByteArrayInputStream("data".getBytes()) { + @Override + public synchronized int available() { + throw new RuntimeException("Stream error"); + } + }; + assertNull(LambdaAppSecHandler.processRequestStart(mockStream)); + } + + // ============================================================================ + // TemporaryRequestContext Tests + // ============================================================================ + + @Test + void temporaryRequestContextProvidesAppSecDataViaGetData() { + Object mockAppSecContext = new Object(); + RequestContext ctx = captureTemporaryRequestContext(mockAppSecContext); + + assertNotNull(ctx); + assertEquals(mockAppSecContext, ctx.getData(RequestContextSlot.APPSEC)); + assertNull(ctx.getData(RequestContextSlot.CI_VISIBILITY)); + assertNull(ctx.getData(RequestContextSlot.IAST)); + } + + @Test + void temporaryRequestContextIsNotCreatedWhenAppSecContextIsNull() { + assertNull(captureTemporaryRequestContext(null)); + } + + @Test + void temporaryRequestContextNoOpMethodsReturnExpectedDefaults() { + RequestContext ctx = captureTemporaryRequestContext(new Object()); + + assertNotNull(ctx); + assertEquals(TraceSegment.NoOp.INSTANCE, ctx.getTraceSegment()); + assertNull(ctx.getBlockResponseFunction()); + assertNull(ctx.getOrCreateMetaStructTop("key", k -> new Object())); + assertNull(ctx.getClientIpAddressData()); + assertDoesNotThrow(() -> ctx.setBlockResponseFunction(mock(BlockResponseFunction.class))); + assertDoesNotThrow(() -> ctx.setClientIpAddressData(mock(ClientIpAddressData.class))); + assertDoesNotThrow(ctx::close); + } + + private RequestContext captureTemporaryRequestContext(Object appSecContext) { + String eventJson = + "{\n" + + " \"path\": \"/test\",\n" + + " \"requestContext\": {\n" + + " \"httpMethod\": \"GET\"\n" + + " }\n" + + "}"; + ByteArrayInputStream event = createInputStream(eventJson); + + RequestContext[] captured = {null}; + + Supplier> requestStartedCallback = mock(Supplier.class); + when(requestStartedCallback.get()).thenReturn(new Flow.ResultFlow<>(appSecContext)); + + TriFunction> methodUriCallback = + mock(TriFunction.class); + doAnswer( + inv -> { + captured[0] = inv.getArgument(0); + return new Flow.ResultFlow<>(null); + }) + .when(methodUriCallback) + .apply(any(), any(), any()); + + Function> headerDoneCallback = mock(Function.class); + when(headerDoneCallback.apply(any())).thenReturn(new Flow.ResultFlow<>(null)); + + CallbackProvider mockCallbackProvider = mock(CallbackProvider.class); + when(mockCallbackProvider.getCallback(EVENTS.requestStarted())) + .thenReturn(requestStartedCallback); + when(mockCallbackProvider.getCallback(EVENTS.requestMethodUriRaw())) + .thenReturn(methodUriCallback); + when(mockCallbackProvider.getCallback(EVENTS.requestHeader())).thenReturn(null); + when(mockCallbackProvider.getCallback(EVENTS.requestClientSocketAddress())).thenReturn(null); + when(mockCallbackProvider.getCallback(EVENTS.requestHeaderDone())) + .thenReturn(headerDoneCallback); + when(mockCallbackProvider.getCallback(EVENTS.requestPathParams())).thenReturn(null); + when(mockCallbackProvider.getCallback(EVENTS.requestBodyProcessed())).thenReturn(null); + + AgentTracer.TracerAPI mockTracer = mock(AgentTracer.TracerAPI.class); + when(mockTracer.getCallbackProvider(RequestContextSlot.APPSEC)) + .thenReturn(mockCallbackProvider); + AgentTracer.forceRegister(mockTracer); + + LambdaAppSecHandler.processRequestStart(event); + return captured[0]; + } + + // ============================================================================ + // processResponseData Tests — guard conditions + // ============================================================================ + + @Test + void processResponseDataDoesNothingWhenAppSecIsDisabled() { + ActiveSubsystems.APPSEC_ACTIVE = false; + AgentSpan span = mock(AgentSpan.class); + ByteArrayOutputStream result = createOutputStream("{\"statusCode\": 200, \"body\": \"ok\"}"); + LambdaAppSecHandler.processResponseData(span, result); + verify(span, never()).getRequestContext(); + } + + @Test + void processResponseDataDoesNothingForNullSpan() { + ByteArrayOutputStream result = createOutputStream("{\"statusCode\": 200}"); + LambdaAppSecHandler.processResponseData(null, result); + // no exception expected + } + + @Test + void processResponseDataDoesNothingForNonByteArrayOutputStreamResult() { + AgentSpan span = mock(AgentSpan.class); + LambdaAppSecHandler.processResponseData(span, "string result"); + verify(span, never()).getRequestContext(); + } + + @Test + void processResponseDataDoesNothingForNullResult() { + AgentSpan span = mock(AgentSpan.class); + LambdaAppSecHandler.processResponseData(span, null); + verify(span, never()).getRequestContext(); + } + + @Test + void processResponseDataDoesNothingWhenSpanHasNoRequestContext() { + AgentSpan span = mock(AgentSpan.class); + when(span.getRequestContext()).thenReturn(null); + ByteArrayOutputStream result = createOutputStream("{\"statusCode\": 200}"); + setupMockResponseCallbacks(null, null, null, null); + LambdaAppSecHandler.processResponseData(span, result); + // no exception expected + } + + @Test + void processResponseDataDoesNothingForOversizedResponse() { + int maxSize = Config.get().getAppSecBodyParsingSizeLimit(); + char[] chars = new char[maxSize + 1]; + java.util.Arrays.fill(chars, 'x'); + ByteArrayOutputStream result = createOutputStream(new String(chars)); + Integer[] capturedStatus = {null}; + AgentSpan span = + setupMockResponseCallbacks(status -> capturedStatus[0] = status, null, null, null); + LambdaAppSecHandler.processResponseData(span, result); + assertNull(capturedStatus[0]); + } + + @Test + void processResponseDataDoesNothingForEmptyByteArrayOutputStream() { + ByteArrayOutputStream result = new ByteArrayOutputStream(); + Integer[] capturedStatus = {null}; + AgentSpan span = + setupMockResponseCallbacks(status -> capturedStatus[0] = status, null, null, null); + LambdaAppSecHandler.processResponseData(span, result); + assertNull(capturedStatus[0]); + } + + // --- Trigger type gating and fallback --- + + @Test + void processResponseDataSkipsNonApiGwResponseWhenTriggerTypeIsUnknown() { + LambdaAppSecHandler.setCurrentTriggerType(LambdaAppSecHandler.LambdaTriggerType.UNKNOWN); + ByteArrayOutputStream result = createOutputStream("{\"result\": \"hello\"}"); + Integer[] capturedStatus = {null}; + boolean[] headerDoneCalled = {false}; + AgentSpan span = + setupMockResponseCallbacks( + status -> capturedStatus[0] = status, null, () -> headerDoneCalled[0] = true, null); + LambdaAppSecHandler.processResponseData(span, result); + assertNull(capturedStatus[0]); + assertFalse(headerDoneCalled[0]); + } + + @Test + @SuppressWarnings("unchecked") + void processResponseDataAppliesFallbackForHttpTriggerWithPlainJsonResponse() { + LambdaAppSecHandler.setCurrentTriggerType(LambdaAppSecHandler.LambdaTriggerType.LAMBDA_URL); + ByteArrayOutputStream result = createOutputStream("{\"result\": \"hello\"}"); + Integer[] capturedStatus = {null}; + Map capturedHeaders = new HashMap<>(); + boolean[] headerDoneCalled = {false}; + Object[] capturedBody = {null}; + AgentSpan span = + setupMockResponseCallbacks( + status -> capturedStatus[0] = status, + capturedHeaders::put, + () -> headerDoneCalled[0] = true, + body -> capturedBody[0] = body); + LambdaAppSecHandler.processResponseData(span, result); + assertNull(capturedStatus[0]); + assertEquals("application/json", capturedHeaders.get("content-type")); + assertTrue(headerDoneCalled[0]); + assertInstanceOf(Map.class, capturedBody[0]); + assertEquals("hello", ((Map) capturedBody[0]).get("result")); + } + + @Test + @SuppressWarnings("unchecked") + void processResponseDataKeepsParsedHeadersAndBodyWhenStatusCodeIsZero() { + // A response that has statusCode:0 with explicit headers/body should use the parsed data, + // not discard it in favour of the plain-response fallback. + LambdaAppSecHandler.setCurrentTriggerType( + LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V1_REST); + ByteArrayOutputStream result = + createOutputStream( + "{\"statusCode\": 0, \"headers\": {\"content-type\": \"text/plain\"}, \"body\": \"hello\"}"); + Integer[] capturedStatus = {null}; + Map capturedHeaders = new HashMap<>(); + boolean[] headerDoneCalled = {false}; + Object[] capturedBody = {null}; + AgentSpan span = + setupMockResponseCallbacks( + status -> capturedStatus[0] = status, + capturedHeaders::put, + () -> headerDoneCalled[0] = true, + body -> capturedBody[0] = body); + LambdaAppSecHandler.processResponseData(span, result); + assertNull(capturedStatus[0]); // statusCode 0 — responseStarted not fired + assertEquals("text/plain", capturedHeaders.get("content-type")); // parsed header kept + assertTrue(headerDoneCalled[0]); + assertEquals("hello", capturedBody[0]); // parsed body kept, not the whole envelope + } + + @Test + void processResponseDataAppliesFallbackForHttpTriggerWithNonJsonStringResponse() { + LambdaAppSecHandler.setCurrentTriggerType( + LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V1_REST); + // JSON-encoded string (as returned by a RequestHandler) + ByteArrayOutputStream result = createOutputStream("\"Hello World!\""); + Integer[] capturedStatus = {null}; + boolean[] headerDoneCalled = {false}; + Object[] capturedBody = {null}; + AgentSpan span = + setupMockResponseCallbacks( + status -> capturedStatus[0] = status, + null, + () -> headerDoneCalled[0] = true, + body -> capturedBody[0] = body); + LambdaAppSecHandler.processResponseData(span, result); + assertNull(capturedStatus[0]); + assertTrue(headerDoneCalled[0]); + assertEquals("Hello World!", capturedBody[0]); + } + + @Test + @SuppressWarnings("unchecked") + void processResponseDataWebSocketWithStatusCodeFiresResponseStarted() { + LambdaAppSecHandler.setCurrentTriggerType( + LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V2_WEBSOCKET); + // $connect handler returning a proper statusCode — should be treated like any API-GW response + ByteArrayOutputStream result = createOutputStream("{\"statusCode\": 200}"); + Integer[] capturedStatus = {null}; + boolean[] headerDoneCalled = {false}; + AgentSpan span = + setupMockResponseCallbacks( + status -> capturedStatus[0] = status, null, () -> headerDoneCalled[0] = true, null); + LambdaAppSecHandler.processResponseData(span, result); + assertEquals(200, capturedStatus[0]); + assertTrue(headerDoneCalled[0]); + } + + @Test + void processResponseDataWebSocketWithoutStatusCodeUsesFallbackWithNoStatus() { + LambdaAppSecHandler.setCurrentTriggerType( + LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V2_WEBSOCKET); + // Message-route handler returning arbitrary data — no statusCode, fallback path + ByteArrayOutputStream result = createOutputStream("{\"message\": \"hello\"}"); + Integer[] capturedStatus = {null}; + boolean[] headerDoneCalled = {false}; + Object[] capturedBody = {null}; + AgentSpan span = + setupMockResponseCallbacks( + status -> capturedStatus[0] = status, + null, + () -> headerDoneCalled[0] = true, + body -> capturedBody[0] = body); + LambdaAppSecHandler.processResponseData(span, result); + assertNull(capturedStatus[0]); // no responseStarted for status-less WebSocket messages + assertTrue(headerDoneCalled[0]); + assertInstanceOf(Map.class, capturedBody[0]); + } + + @Test + void processResponseDataSkipsNonApiGwResponseWhenTriggerTypeIsNull() { + // No processRequestStart called — thread-local is null — behaves like unknown + ByteArrayOutputStream result = createOutputStream("{\"result\": \"hello\"}"); + Integer[] capturedStatus = {null}; + AgentSpan span = + setupMockResponseCallbacks(status -> capturedStatus[0] = status, null, null, null); + LambdaAppSecHandler.processResponseData(span, result); + assertNull(capturedStatus[0]); + } + + // --- Status code extraction --- + + @Test + void processResponseDataExtractsStatusCodeCorrectly() { + LambdaAppSecHandler.setCurrentTriggerType( + LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V1_REST); + ByteArrayOutputStream result = createOutputStream("{\"statusCode\": 200, \"body\": \"ok\"}"); + Integer[] capturedStatus = {null}; + AgentSpan span = + setupMockResponseCallbacks(status -> capturedStatus[0] = status, null, null, null); + LambdaAppSecHandler.processResponseData(span, result); + assertEquals(200, capturedStatus[0]); + } + + @Test + void processResponseDataExtractsStatusCodeAsIntegerFromDouble() { + LambdaAppSecHandler.setCurrentTriggerType( + LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V1_REST); + ByteArrayOutputStream result = + createOutputStream("{\"statusCode\": 404.0, \"body\": \"not found\"}"); + Integer[] capturedStatus = {null}; + AgentSpan span = + setupMockResponseCallbacks(status -> capturedStatus[0] = status, null, null, null); + LambdaAppSecHandler.processResponseData(span, result); + assertEquals(404, capturedStatus[0]); + } + + @Test + void processResponseDataHandlesMissingStatusCode() { + ByteArrayOutputStream result = createOutputStream("{\"body\": \"ok\"}"); + Integer[] capturedStatus = {null}; + AgentSpan span = + setupMockResponseCallbacks(status -> capturedStatus[0] = status, null, null, null); + LambdaAppSecHandler.processResponseData(span, result); + assertNull(capturedStatus[0]); + } + + @Test + void processResponseDataHandlesNonNumericStatusCode() { + ByteArrayOutputStream result = + createOutputStream("{\"statusCode\": \"bad\", \"body\": \"ok\"}"); + Integer[] capturedStatus = {null}; + AgentSpan span = + setupMockResponseCallbacks(status -> capturedStatus[0] = status, null, null, null); + LambdaAppSecHandler.processResponseData(span, result); + assertNull(capturedStatus[0]); + } + + // --- Header extraction --- + + @Test + void processResponseDataForwardsAllResponseHeaders() { + LambdaAppSecHandler.setCurrentTriggerType( + LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V1_REST); + String json = + "{\"statusCode\": 200, \"headers\": {\"content-type\": \"application/json\", \"x-custom\": \"val\", \"content-length\": \"42\", \"set-cookie\": \"a=1\"}}"; + ByteArrayOutputStream result = createOutputStream(json); + Map capturedHeaders = new HashMap<>(); + AgentSpan span = setupMockResponseCallbacks(null, capturedHeaders::put, null, null); + LambdaAppSecHandler.processResponseData(span, result); + assertEquals(4, capturedHeaders.size()); + assertEquals("application/json", capturedHeaders.get("content-type")); + assertEquals("val", capturedHeaders.get("x-custom")); + assertEquals("42", capturedHeaders.get("content-length")); + assertEquals("a=1", capturedHeaders.get("set-cookie")); + } + + @Test + void processResponseDataLowercasesHeaderKeys() { + LambdaAppSecHandler.setCurrentTriggerType( + LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V1_REST); + String json = + "{\"statusCode\": 200, \"headers\": {\"Content-Type\": \"text/html\", \"CONTENT-LENGTH\": \"10\"}}"; + ByteArrayOutputStream result = createOutputStream(json); + Map capturedHeaders = new HashMap<>(); + AgentSpan span = setupMockResponseCallbacks(null, capturedHeaders::put, null, null); + LambdaAppSecHandler.processResponseData(span, result); + assertEquals("text/html", capturedHeaders.get("content-type")); + assertEquals("10", capturedHeaders.get("content-length")); + } + + @Test + void processResponseDataMergesMultiValueHeadersWithSingleValueHeaders() { + LambdaAppSecHandler.setCurrentTriggerType( + LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V1_REST); + String json = + "{\"statusCode\": 200, \"headers\": {\"content-type\": \"text/html\"}, \"multiValueHeaders\": {\"content-encoding\": [\"gzip\", \"br\"]}}"; + ByteArrayOutputStream result = createOutputStream(json); + Map capturedHeaders = new HashMap<>(); + AgentSpan span = setupMockResponseCallbacks(null, capturedHeaders::put, null, null); + LambdaAppSecHandler.processResponseData(span, result); + assertEquals("text/html", capturedHeaders.get("content-type")); + assertEquals("gzip, br", capturedHeaders.get("content-encoding")); + } + + @Test + void processResponseDataHandlesEmptyHeaders() { + LambdaAppSecHandler.setCurrentTriggerType( + LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V1_REST); + ByteArrayOutputStream result = createOutputStream("{\"statusCode\": 200}"); + Map capturedHeaders = new HashMap<>(); + boolean[] headerDoneCalled = {false}; + AgentSpan span = + setupMockResponseCallbacks( + null, capturedHeaders::put, () -> headerDoneCalled[0] = true, null); + LambdaAppSecHandler.processResponseData(span, result); + assertTrue(capturedHeaders.isEmpty()); + assertTrue(headerDoneCalled[0]); + } + + // --- Body extraction --- + + @Test + @SuppressWarnings("unchecked") + void processResponseDataParsesJsonBody() { + LambdaAppSecHandler.setCurrentTriggerType( + LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V1_REST); + String json = + "{\"statusCode\": 200, \"headers\": {\"content-type\": \"application/json\"}, \"body\": \"{\\\"key\\\": \\\"value\\\"}\"}"; + ByteArrayOutputStream result = createOutputStream(json); + Object[] capturedBody = {null}; + AgentSpan span = setupMockResponseCallbacks(null, null, null, body -> capturedBody[0] = body); + LambdaAppSecHandler.processResponseData(span, result); + assertInstanceOf(Map.class, capturedBody[0]); + assertEquals("value", ((Map) capturedBody[0]).get("key")); + } + + @Test + void processResponseDataHandlesNonJsonBodyAsRawString() { + LambdaAppSecHandler.setCurrentTriggerType( + LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V1_REST); + String json = + "{\"statusCode\": 200, \"headers\": {\"content-type\": \"text/plain\"}, \"body\": \"plain text\"}"; + ByteArrayOutputStream result = createOutputStream(json); + Object[] capturedBody = {null}; + AgentSpan span = setupMockResponseCallbacks(null, null, null, body -> capturedBody[0] = body); + LambdaAppSecHandler.processResponseData(span, result); + assertEquals("plain text", capturedBody[0]); + } + + @Test + @SuppressWarnings("unchecked") + void processResponseDataHandlesBase64EncodedBody() { + LambdaAppSecHandler.setCurrentTriggerType( + LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V1_REST); + String originalBody = "{\"decoded\": \"content\"}"; + String base64Body = + Base64.getEncoder().encodeToString(originalBody.getBytes(StandardCharsets.UTF_8)); + String json = + "{\"statusCode\": 200, \"body\": \"" + base64Body + "\", \"isBase64Encoded\": true}"; + ByteArrayOutputStream result = createOutputStream(json); + Object[] capturedBody = {null}; + AgentSpan span = setupMockResponseCallbacks(null, null, null, body -> capturedBody[0] = body); + LambdaAppSecHandler.processResponseData(span, result); + assertInstanceOf(Map.class, capturedBody[0]); + assertEquals("content", ((Map) capturedBody[0]).get("decoded")); + } + + @Test + void processResponseDataHandlesNullBody() { + ByteArrayOutputStream result = createOutputStream("{\"statusCode\": 200, \"body\": null}"); + String[] capturedBody = {"NOT_CALLED"}; + AgentSpan span = + setupMockResponseCallbacks( + null, null, null, body -> capturedBody[0] = String.valueOf(body)); + LambdaAppSecHandler.processResponseData(span, result); + assertEquals("NOT_CALLED", capturedBody[0]); + } + + @Test + void processResponseDataHandlesMissingBodyField() { + ByteArrayOutputStream result = createOutputStream("{\"statusCode\": 200}"); + String[] capturedBody = {"NOT_CALLED"}; + AgentSpan span = + setupMockResponseCallbacks( + null, null, null, body -> capturedBody[0] = String.valueOf(body)); + LambdaAppSecHandler.processResponseData(span, result); + assertEquals("NOT_CALLED", capturedBody[0]); + } + + @Test + @SuppressWarnings("unchecked") + void processResponseDataAttemptsJsonParseWhenNoContentType() { + LambdaAppSecHandler.setCurrentTriggerType( + LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V1_REST); + ByteArrayOutputStream result = + createOutputStream("{\"statusCode\": 200, \"body\": \"{\\\"a\\\": 1}\"}"); + Object[] capturedBody = {null}; + AgentSpan span = setupMockResponseCallbacks(null, null, null, body -> capturedBody[0] = body); + LambdaAppSecHandler.processResponseData(span, result); + assertInstanceOf(Map.class, capturedBody[0]); + assertEquals(1.0d, ((Map) capturedBody[0]).get("a")); + } + + @Test + void processResponseDataFallsBackToRawStringWhenJsonParseFails() { + LambdaAppSecHandler.setCurrentTriggerType( + LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V1_REST); + ByteArrayOutputStream result = + createOutputStream("{\"statusCode\": 200, \"body\": \"not json {\"}"); + Object[] capturedBody = {null}; + AgentSpan span = setupMockResponseCallbacks(null, null, null, body -> capturedBody[0] = body); + LambdaAppSecHandler.processResponseData(span, result); + assertEquals("not json {", capturedBody[0]); + } + + // --- Event ordering --- + + @Test + void processResponseDataFiresEventsInCorrectOrder() { + LambdaAppSecHandler.setCurrentTriggerType( + LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V1_REST); + String json = + "{\"statusCode\": 200, \"headers\": {\"content-type\": \"application/json\"}, \"body\": \"{\\\"k\\\": \\\"v\\\"}\"}"; + ByteArrayOutputStream result = createOutputStream(json); + List order = new ArrayList<>(); + + AgentSpan span = + setupMockResponseCallbacks( + status -> order.add("responseStarted"), + (name, value) -> order.add("responseHeader"), + () -> order.add("responseHeaderDone"), + body -> order.add("responseBody")); + + LambdaAppSecHandler.processResponseData(span, result); + + assertEquals("responseStarted", order.get(0)); + assertTrue(order.stream().filter("responseHeader"::equals).count() >= 1); + int headerDoneIdx = order.indexOf("responseHeaderDone"); + int lastHeaderIdx = order.lastIndexOf("responseHeader"); + assertTrue(headerDoneIdx > lastHeaderIdx); + assertEquals("responseBody", order.get(order.size() - 1)); + } + + @Test + void processResponseDataHandlesInvalidBase64ResponseBodyGracefully() { + String json = + "{\"statusCode\": 200, \"body\": \"not-valid-base64!!!\", \"isBase64Encoded\": true}"; + ByteArrayOutputStream result = createOutputStream(json); + String[] capturedBody = {"NOT_CALLED"}; + AgentSpan span = + setupMockResponseCallbacks( + null, null, null, body -> capturedBody[0] = String.valueOf(body)); + LambdaAppSecHandler.processResponseData(span, result); + assertEquals("NOT_CALLED", capturedBody[0]); + } + + @Test + @SuppressWarnings("unchecked") + void processResponseDataParsesBodyAsJsonForJavascriptContentType() { + LambdaAppSecHandler.setCurrentTriggerType( + LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V1_REST); + String json = + "{\"statusCode\": 200, \"headers\": {\"content-type\": \"application/javascript\"}, \"body\": \"{\\\"key\\\": \\\"val\\\"}\"}"; + ByteArrayOutputStream result = createOutputStream(json); + Object[] capturedBody = {null}; + AgentSpan span = setupMockResponseCallbacks(null, null, null, body -> capturedBody[0] = body); + LambdaAppSecHandler.processResponseData(span, result); + assertInstanceOf(Map.class, capturedBody[0]); + assertEquals("val", ((Map) capturedBody[0]).get("key")); + } + + @Test + void processResponseDataSkipsMultiValueHeadersEntryWithNonListValue() { + LambdaAppSecHandler.setCurrentTriggerType( + LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V1_REST); + String json = + "{\"statusCode\": 200, \"headers\": {\"content-type\": \"text/html\"}, \"multiValueHeaders\": {\"x-scalar\": \"not-a-list\", \"x-valid\": [\"v1\", \"v2\"]}}"; + ByteArrayOutputStream result = createOutputStream(json); + Map capturedHeaders = new HashMap<>(); + AgentSpan span = setupMockResponseCallbacks(null, capturedHeaders::put, null, null); + LambdaAppSecHandler.processResponseData(span, result); + assertEquals("text/html", capturedHeaders.get("content-type")); + assertEquals("v1, v2", capturedHeaders.get("x-valid")); + assertFalse(capturedHeaders.containsKey("x-scalar")); + } + + @Test + void processResponseDataMultiValueHeadersOverrideSingleValueHeaders() { + LambdaAppSecHandler.setCurrentTriggerType( + LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V1_REST); + String json = + "{\"statusCode\": 200, \"headers\": {\"content-type\": \"text/html\"}, \"multiValueHeaders\": {\"content-type\": [\"application/json\", \"charset=utf-8\"]}}"; + ByteArrayOutputStream result = createOutputStream(json); + Map capturedHeaders = new HashMap<>(); + AgentSpan span = setupMockResponseCallbacks(null, capturedHeaders::put, null, null); + LambdaAppSecHandler.processResponseData(span, result); + assertEquals("application/json, charset=utf-8", capturedHeaders.get("content-type")); + } + + // --- Error handling --- + + @Test + void processResponseDataHandlesMalformedJsonResponse() { + ByteArrayOutputStream result = createOutputStream("{not valid json"); + Integer[] capturedStatus = {null}; + AgentSpan span = + setupMockResponseCallbacks(status -> capturedStatus[0] = status, null, null, null); + LambdaAppSecHandler.processResponseData(span, result); + assertNull(capturedStatus[0]); + } + + @Test + void processResponseDataHandlesEmptyStringResponse() { + ByteArrayOutputStream result = createOutputStream(""); + AgentSpan span = mock(AgentSpan.class); + LambdaAppSecHandler.processResponseData(span, result); + // no exception expected + } + + // ============================================================================ + // processResponseData — null individual callback handling + // ============================================================================ + + @Test + void processResponseDataHandlesNullResponseHeaderDoneCallbackGracefully() { + String json = + "{\"statusCode\": 200, \"headers\": {\"content-type\": \"text/plain\"}, \"body\": \"ok\"}"; + ByteArrayOutputStream result = createOutputStream(json); + + RequestContext mockRequestContext = mock(RequestContext.class); + AgentSpan span = mock(AgentSpan.class); + when(span.getRequestContext()).thenReturn(mockRequestContext); + + CallbackProvider cbp = mock(CallbackProvider.class); + when(cbp.getCallback(EVENTS.responseStarted())).thenReturn(null); + when(cbp.getCallback(EVENTS.responseHeader())).thenReturn(null); + when(cbp.getCallback(EVENTS.responseHeaderDone())).thenReturn(null); + when(cbp.getCallback(EVENTS.responseBody())).thenReturn(null); + + AgentTracer.TracerAPI mockTracer = mock(AgentTracer.TracerAPI.class); + when(mockTracer.getCallbackProvider(RequestContextSlot.APPSEC)).thenReturn(cbp); + AgentTracer.forceRegister(mockTracer); + + LambdaAppSecHandler.processResponseData(span, result); + // no exception expected — all null callbacks must be silently skipped + } + + @Test + void processResponseDataSkipsResponseStartedWhenCallbackIsNull() { + LambdaAppSecHandler.setCurrentTriggerType( + LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V1_REST); + String json = "{\"statusCode\": 200, \"headers\": {\"content-type\": \"text/plain\"}}"; + ByteArrayOutputStream result = createOutputStream(json); + Map capturedHeaders = new HashMap<>(); + boolean[] headerDoneCalled = {false}; + AgentSpan span = + setupMockResponseCallbacks( + null, capturedHeaders::put, () -> headerDoneCalled[0] = true, null); + assertDoesNotThrow(() -> LambdaAppSecHandler.processResponseData(span, result)); + assertTrue(headerDoneCalled[0]); + } + + @Test + void processResponseDataSkipsResponseHeaderWhenCallbackIsNull() { + LambdaAppSecHandler.setCurrentTriggerType( + LambdaAppSecHandler.LambdaTriggerType.API_GATEWAY_V1_REST); + String json = "{\"statusCode\": 200, \"headers\": {\"content-type\": \"text/plain\"}}"; + ByteArrayOutputStream result = createOutputStream(json); + Integer[] capturedStatus = {null}; + boolean[] headerDoneCalled = {false}; + AgentSpan span = + setupMockResponseCallbacks( + status -> capturedStatus[0] = status, null, () -> headerDoneCalled[0] = true, null); + assertDoesNotThrow(() -> LambdaAppSecHandler.processResponseData(span, result)); + assertEquals(200, capturedStatus[0]); + assertTrue(headerDoneCalled[0]); + } + + // ============================================================================ + // extractResponseData Unit Tests + // ============================================================================ + + @Test + void extractResponseDataReturnsNullForMalformedJson() { + assertNull(LambdaAppSecHandler.extractResponseData("{bad json")); + } + + @Test + void extractResponseDataReturnsNullForNullJsonParseResult() { + assertNull(LambdaAppSecHandler.extractResponseData("null")); + } + + @Test + void extractResponseDataReturnsNullForEmptyString() { + assertNull(LambdaAppSecHandler.extractResponseData("")); + } + + // ============================================================================ + // Helper Methods + // ============================================================================ + + private static ByteArrayInputStream createInputStream(String json) { + return new ByteArrayInputStream(json.getBytes(StandardCharsets.UTF_8)); + } + + private static ByteArrayOutputStream createOutputStream(String json) { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + try { + baos.write(json.getBytes(StandardCharsets.UTF_8)); + } catch (IOException e) { + throw new RuntimeException(e); + } + return baos; + } + + private static class Callbacks { + BiConsumer onMethodUri; + BiConsumer onHeader; + BiConsumer onSocketAddress; + Consumer> onPathParams; + Consumer onBody; + + Callbacks onMethodUri(BiConsumer cb) { + this.onMethodUri = cb; + return this; + } + + Callbacks onHeader(BiConsumer cb) { + this.onHeader = cb; + return this; + } + + Callbacks onSocketAddress(BiConsumer cb) { + this.onSocketAddress = cb; + return this; + } + + Callbacks onPathParams(Consumer> cb) { + this.onPathParams = cb; + return this; + } + + Callbacks onBody(Consumer cb) { + this.onBody = cb; + return this; + } + } + + @SuppressWarnings("unchecked") + private void setupMockCallbacks(Callbacks callbacks) { + Object mockAppSecContext = new Object(); + Supplier> requestStartedCallback = mock(Supplier.class); + when(requestStartedCallback.get()).thenReturn(new Flow.ResultFlow<>(mockAppSecContext)); + + TriFunction> methodUriCallback = null; + if (callbacks.onMethodUri != null) { + methodUriCallback = mock(TriFunction.class); + BiConsumer capture = callbacks.onMethodUri; + doAnswer( + inv -> { + capture.accept(inv.getArgument(1), inv.getArgument(2)); + return Flow.ResultFlow.empty(); + }) + .when(methodUriCallback) + .apply(any(), anyString(), any(URIDataAdapter.class)); + } + + TriConsumer headerCallback = null; + if (callbacks.onHeader != null) { + headerCallback = mock(TriConsumer.class); + BiConsumer capture = callbacks.onHeader; + doAnswer( + inv -> { + capture.accept(inv.getArgument(1), inv.getArgument(2)); + return null; + }) + .when(headerCallback) + .accept(any(), anyString(), anyString()); + } + + TriFunction> socketAddressCallback = null; + if (callbacks.onSocketAddress != null) { + socketAddressCallback = mock(TriFunction.class); + BiConsumer capture = callbacks.onSocketAddress; + doAnswer( + inv -> { + capture.accept(inv.getArgument(1), (Integer) inv.getArgument(2)); + return Flow.ResultFlow.empty(); + }) + .when(socketAddressCallback) + .apply(any(), anyString(), anyInt()); + } + + Function> headerDoneCallback = mock(Function.class); + when(headerDoneCallback.apply(any())).thenReturn(Flow.ResultFlow.empty()); + + BiFunction, Flow> pathParamsCallback = null; + if (callbacks.onPathParams != null) { + pathParamsCallback = mock(BiFunction.class); + Consumer> capture = callbacks.onPathParams; + doAnswer( + inv -> { + capture.accept(inv.getArgument(1)); + return Flow.ResultFlow.empty(); + }) + .when(pathParamsCallback) + .apply(any(), any(Map.class)); + } + + BiFunction> bodyCallback = null; + if (callbacks.onBody != null) { + bodyCallback = mock(BiFunction.class); + Consumer capture = callbacks.onBody; + doAnswer( + inv -> { + capture.accept(inv.getArgument(1)); + return Flow.ResultFlow.empty(); + }) + .when(bodyCallback) + .apply(any(), any()); + } + + CallbackProvider mockCallbackProvider = mock(CallbackProvider.class); + when(mockCallbackProvider.getCallback(EVENTS.requestStarted())) + .thenReturn(requestStartedCallback); + when(mockCallbackProvider.getCallback(EVENTS.requestMethodUriRaw())) + .thenReturn(methodUriCallback); + when(mockCallbackProvider.getCallback(EVENTS.requestHeader())).thenReturn(headerCallback); + when(mockCallbackProvider.getCallback(EVENTS.requestClientSocketAddress())) + .thenReturn(socketAddressCallback); + when(mockCallbackProvider.getCallback(EVENTS.requestHeaderDone())) + .thenReturn(headerDoneCallback); + when(mockCallbackProvider.getCallback(EVENTS.requestPathParams())) + .thenReturn(pathParamsCallback); + when(mockCallbackProvider.getCallback(EVENTS.requestBodyProcessed())).thenReturn(bodyCallback); + + AgentTracer.TracerAPI mockTracer = mock(AgentTracer.TracerAPI.class); + when(mockTracer.getCallbackProvider(RequestContextSlot.APPSEC)) + .thenReturn(mockCallbackProvider); + AgentTracer.forceRegister(mockTracer); + } + + private static Map mapOf(Object... keysAndValues) { + Map map = new LinkedHashMap<>(); + for (int i = 0; i < keysAndValues.length; i += 2) { + map.put((String) keysAndValues[i], keysAndValues[i + 1]); + } + return map; + } + + @SuppressWarnings("unchecked") + private AgentSpan setupMockResponseCallbacks( + Consumer onResponseStarted, + BiConsumer onResponseHeader, + Runnable onResponseHeaderDone, + Consumer onResponseBody) { + + RequestContext mockRequestContext = mock(RequestContext.class); + AgentSpan mockSpan = mock(AgentSpan.class); + when(mockSpan.getRequestContext()).thenReturn(mockRequestContext); + + BiFunction> responseStartedCb = null; + if (onResponseStarted != null) { + responseStartedCb = mock(BiFunction.class); + Consumer capture = onResponseStarted; + doAnswer( + inv -> { + capture.accept(inv.getArgument(1)); + return new Flow.ResultFlow<>(null); + }) + .when(responseStartedCb) + .apply(any(RequestContext.class), anyInt()); + } + + TriConsumer responseHeaderCb = null; + if (onResponseHeader != null) { + responseHeaderCb = mock(TriConsumer.class); + BiConsumer capture = onResponseHeader; + doAnswer( + inv -> { + capture.accept(inv.getArgument(1), inv.getArgument(2)); + return null; + }) + .when(responseHeaderCb) + .accept(any(), anyString(), anyString()); + } + + Function> responseHeaderDoneCb = mock(Function.class); + if (onResponseHeaderDone != null) { + Runnable capture = onResponseHeaderDone; + doAnswer( + inv -> { + capture.run(); + return new Flow.ResultFlow<>(null); + }) + .when(responseHeaderDoneCb) + .apply(any(RequestContext.class)); + } else { + when(responseHeaderDoneCb.apply(any())).thenReturn(new Flow.ResultFlow<>(null)); + } + + BiFunction> responseBodyCb = null; + if (onResponseBody != null) { + responseBodyCb = mock(BiFunction.class); + Consumer capture = onResponseBody; + doAnswer( + inv -> { + capture.accept(inv.getArgument(1)); + return new Flow.ResultFlow<>(null); + }) + .when(responseBodyCb) + .apply(any(RequestContext.class), any()); + } + + CallbackProvider mockCallbackProvider = mock(CallbackProvider.class); + when(mockCallbackProvider.getCallback(EVENTS.responseStarted())).thenReturn(responseStartedCb); + when(mockCallbackProvider.getCallback(EVENTS.responseHeader())).thenReturn(responseHeaderCb); + when(mockCallbackProvider.getCallback(EVENTS.responseHeaderDone())) + .thenReturn(responseHeaderDoneCb); + when(mockCallbackProvider.getCallback(EVENTS.responseBody())).thenReturn(responseBodyCb); + + AgentTracer.TracerAPI mockTracer = mock(AgentTracer.TracerAPI.class); + when(mockTracer.getCallbackProvider(RequestContextSlot.APPSEC)) + .thenReturn(mockCallbackProvider); + AgentTracer.forceRegister(mockTracer); + + return mockSpan; + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/lambda/LambdaHandlerTest.java b/dd-trace-core/src/test/java/datadog/trace/lambda/LambdaHandlerTest.java new file mode 100644 index 00000000000..89959205585 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/lambda/LambdaHandlerTest.java @@ -0,0 +1,333 @@ +package datadog.trace.lambda; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent; +import com.amazonaws.services.lambda.runtime.events.S3Event; +import com.amazonaws.services.lambda.runtime.events.SNSEvent; +import com.amazonaws.services.lambda.runtime.events.SQSEvent; +import com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification; +import datadog.trace.agent.test.server.http.JavaTestHttpServer; +import datadog.trace.api.DDSpanId; +import datadog.trace.api.DDTags; +import datadog.trace.api.DDTraceId; +import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext; +import datadog.trace.core.CoreTracer; +import datadog.trace.core.DDCoreJavaSpecification; +import datadog.trace.core.DDSpan; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Test; +import org.tabletest.junit.TableTest; + +@SuppressWarnings({"unchecked", "rawtypes"}) +public class LambdaHandlerTest extends DDCoreJavaSpecification { + + static class TestObject { + public String field1; + public boolean field2; + + TestObject() { + this.field1 = "toto"; + this.field2 = true; + } + + @Override + public String toString() { + return field1 + " / " + field2 + "}"; + } + } + + @Test + void testStartInvocationSuccess() { + CoreTracer ct = tracerBuilder().build(); + + JavaTestHttpServer server = + JavaTestHttpServer.httpServer( + s -> + s.handlers( + h -> + h.post( + "/lambda/start-invocation", + api -> + api.getResponse() + .status(200) + .addHeader("x-datadog-trace-id", "1234") + .addHeader("x-datadog-sampling-priority", "2") + .send()))); + LambdaHandler.setExtensionBaseUrl(server.getAddress().toString()); + + AgentSpanContext objTest = + LambdaHandler.notifyStartInvocation(new TestObject(), "lambda-request-123"); + + assertEquals("1234", objTest.getTraceId().toString()); + assertEquals(2, objTest.getSamplingPriority()); + assertEquals( + "lambda-request-123", server.getLastRequest().getHeader("lambda-runtime-aws-request-id")); + + server.close(); + ct.close(); + } + + @Test + void testStartInvocationWith128BitTraceId() { + CoreTracer ct = tracerBuilder().build(); + + JavaTestHttpServer server = + JavaTestHttpServer.httpServer( + s -> + s.handlers( + h -> + h.post( + "/lambda/start-invocation", + api -> + api.getResponse() + .status(200) + .addHeader("x-datadog-trace-id", "5744042798732701615") + .addHeader("x-datadog-sampling-priority", "2") + .addHeader("x-datadog-tags", "_dd.p.tid=1914fe7789eb32be") + .send()))); + LambdaHandler.setExtensionBaseUrl(server.getAddress().toString()); + + AgentSpanContext objTest = + LambdaHandler.notifyStartInvocation(new TestObject(), "lambda-request-123"); + + assertEquals("1914fe7789eb32be4fb6f07e011a6faf", objTest.getTraceId().toHexString()); + assertEquals(2, objTest.getSamplingPriority()); + assertEquals( + "lambda-request-123", server.getLastRequest().getHeader("lambda-runtime-aws-request-id")); + + server.close(); + ct.close(); + } + + @Test + void testStartInvocationFailure() { + CoreTracer ct = tracerBuilder().build(); + + JavaTestHttpServer server = + JavaTestHttpServer.httpServer( + s -> + s.handlers( + h -> + h.post( + "/lambda/start-invocation", + api -> api.getResponse().status(500).send()))); + LambdaHandler.setExtensionBaseUrl(server.getAddress().toString()); + + AgentSpanContext objTest = + LambdaHandler.notifyStartInvocation(new TestObject(), "my-lambda-request"); + + assertNull(objTest); + assertEquals( + "my-lambda-request", server.getLastRequest().getHeader("lambda-runtime-aws-request-id")); + + server.close(); + ct.close(); + } + + @TableTest( + value = { + "scenario | expected | eHeaderValue | tIdHeaderValue | sIdHeaderValue | sPIdHeaderValue | lambdaResult | boolValue | lambdaReqIdHeaderValue", + "error with non-string result | true | 'true' | '1234' | '5678' | 2 | | true | 'request123' ", + "success with string result | true | | '1234' | '5678' | 2 | '12345 ' | false | 'request456' " + }) + void testEndInvocationSuccess( + boolean expected, + String eHeaderValue, + String tIdHeaderValue, + String sIdHeaderValue, + String sPIdHeaderValue, + Object lambdaResult, + boolean boolValue, + String lambdaReqIdHeaderValue) { + JavaTestHttpServer server = + JavaTestHttpServer.httpServer( + s -> + s.handlers( + h -> + h.post( + "/lambda/end-invocation", + api -> api.getResponse().status(200).send()))); + LambdaHandler.setExtensionBaseUrl(server.getAddress().toString()); + + DDSpan span = mock(DDSpan.class); + when(span.getTraceId()).thenReturn(DDTraceId.from("1234")); + when(span.getSpanId()).thenReturn(DDSpanId.from("5678")); + when(span.getSamplingPriority()).thenReturn(2); + + boolean result = + LambdaHandler.notifyEndInvocation(span, lambdaResult, boolValue, lambdaReqIdHeaderValue); + + assertEquals(eHeaderValue, server.getLastRequest().getHeader("x-datadog-invocation-error")); + assertEquals(tIdHeaderValue, server.getLastRequest().getHeader("x-datadog-trace-id")); + assertEquals(sIdHeaderValue, server.getLastRequest().getHeader("x-datadog-span-id")); + assertEquals(sPIdHeaderValue, server.getLastRequest().getHeader("x-datadog-sampling-priority")); + assertEquals( + lambdaReqIdHeaderValue, server.getLastRequest().getHeader("lambda-runtime-aws-request-id")); + assertEquals(expected, result); + + server.close(); + } + + @TableTest( + value = { + "scenario | expected | headerValue | lambdaResult | boolValue | lambdaReqIdHeaderValue", + "error with non-string result | false | 'true' | | true | 'request123' ", + "success with string result | false | | '12345' | false | 'request456' " + }) + void testEndInvocationFailure( + boolean expected, + String headerValue, + Object lambdaResult, + boolean boolValue, + String lambdaReqIdHeaderValue) { + JavaTestHttpServer server = + JavaTestHttpServer.httpServer( + s -> + s.handlers( + h -> + h.post( + "/lambda/end-invocation", + api -> api.getResponse().status(500).send()))); + LambdaHandler.setExtensionBaseUrl(server.getAddress().toString()); + + DDSpan span = mock(DDSpan.class); + when(span.getTraceId()).thenReturn(DDTraceId.from("1234")); + when(span.getSpanId()).thenReturn(DDSpanId.from("5678")); + when(span.getSamplingPriority()).thenReturn(2); + + boolean result = + LambdaHandler.notifyEndInvocation(span, lambdaResult, boolValue, lambdaReqIdHeaderValue); + + assertEquals(expected, result); + assertEquals(headerValue, server.getLastRequest().getHeader("x-datadog-invocation-error")); + assertEquals( + lambdaReqIdHeaderValue, server.getLastRequest().getHeader("lambda-runtime-aws-request-id")); + + server.close(); + } + + @Test + void testEndInvocationSuccessWithErrorMetadata() { + JavaTestHttpServer server = + JavaTestHttpServer.httpServer( + s -> + s.handlers( + h -> + h.post( + "/lambda/end-invocation", + api -> api.getResponse().status(200).send()))); + LambdaHandler.setExtensionBaseUrl(server.getAddress().toString()); + + DDSpan span = mock(DDSpan.class); + when(span.getTraceId()).thenReturn(DDTraceId.from("1234")); + when(span.getSpanId()).thenReturn(DDSpanId.from("5678")); + when(span.getSamplingPriority()).thenReturn(2); + when(span.getTag(DDTags.ERROR_MSG)).thenReturn("custom error message"); + when(span.getTag(DDTags.ERROR_TYPE)).thenReturn("java.lang.Throwable"); + when(span.getTag(DDTags.ERROR_STACK)).thenReturn("errorStack\n \ttest"); + + LambdaHandler.notifyEndInvocation(span, new Object(), true, "lambda-request-123"); + + assertEquals("true", server.getLastRequest().getHeader("x-datadog-invocation-error")); + assertEquals( + "custom error message", + server.getLastRequest().getHeader("x-datadog-invocation-error-msg")); + assertEquals( + "java.lang.Throwable", + server.getLastRequest().getHeader("x-datadog-invocation-error-type")); + assertEquals( + "ZXJyb3JTdGFjawogCXRlc3Q=", + server.getLastRequest().getHeader("x-datadog-invocation-error-stack")); + assertEquals( + "lambda-request-123", server.getLastRequest().getHeader("lambda-runtime-aws-request-id")); + + server.close(); + } + + @Test + void testMoshiToJsonSQSEvent() { + SQSEvent myEvent = new SQSEvent(); + List records = new ArrayList<>(); + SQSEvent.SQSMessage message = new SQSEvent.SQSMessage(); + message.setMessageId("myId"); + message.setAwsRegion("myRegion"); + records.add(message); + myEvent.setRecords(records); + + String result = LambdaHandler.writeValueAsString(myEvent); + + assertEquals("{\"records\":[{\"awsRegion\":\"myRegion\",\"messageId\":\"myId\"}]}", result); + } + + @Test + void testMoshiToJsonS3Event() { + List list = new ArrayList<>(); + S3EventNotification.S3EventNotificationRecord item0 = + new S3EventNotification.S3EventNotificationRecord( + "region", "eventName", "mySource", null, "3.4", null, null, null, null); + list.add(item0); + S3Event myEvent = new S3Event(list); + + String result = LambdaHandler.writeValueAsString(myEvent); + + assertEquals( + "{\"records\":[{\"awsRegion\":\"region\",\"eventName\":\"eventName\",\"eventSource\":\"mySource\",\"eventVersion\":\"3.4\"}]}", + result); + } + + @Test + void testMoshiToJsonSNSEvent() { + SNSEvent myEvent = new SNSEvent(); + List records = new ArrayList<>(); + SNSEvent.SNSRecord message = new SNSEvent.SNSRecord(); + message.setEventSource("mySource"); + message.setEventVersion("myVersion"); + records.add(message); + myEvent.setRecords(records); + + String result = LambdaHandler.writeValueAsString(myEvent); + + assertEquals( + "{\"records\":[{\"eventSource\":\"mySource\",\"eventVersion\":\"myVersion\"}]}", result); + } + + @Test + void testMoshiToJsonAPIGatewayProxyRequestEvent() { + APIGatewayProxyRequestEvent myEvent = new APIGatewayProxyRequestEvent(); + myEvent.setBody("bababango"); + myEvent.setHttpMethod("POST"); + + String result = LambdaHandler.writeValueAsString(myEvent); + + assertEquals("{\"body\":\"bababango\",\"httpMethod\":\"POST\"}", result); + } + + @Test + void testMoshiToJsonInputStream() { + String body = "{\"body\":\"bababango\",\"httpMethod\":\"POST\"}"; + ByteArrayInputStream myEvent = new ByteArrayInputStream(body.getBytes()); + + String result = LambdaHandler.writeValueAsString(myEvent); + + assertEquals(body, result); + } + + @Test + void testMoshiToJsonOutputStream() { + String body = "{\"body\":\"bababango\",\"statusCode\":\"200\"}"; + ByteArrayOutputStream myEvent = new ByteArrayOutputStream(); + byte[] bodyBytes = body.getBytes(); + myEvent.write(bodyBytes, 0, bodyBytes.length); + + String result = LambdaHandler.writeValueAsString(myEvent); + + assertEquals(body, result); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/lambda/SkipUnhandledTypeJsonSerializerTest.java b/dd-trace-core/src/test/java/datadog/trace/lambda/SkipUnhandledTypeJsonSerializerTest.java new file mode 100644 index 00000000000..588a05ca329 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/lambda/SkipUnhandledTypeJsonSerializerTest.java @@ -0,0 +1,173 @@ +package datadog.trace.lambda; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent; +import com.amazonaws.services.lambda.runtime.events.SNSEvent; +import com.amazonaws.services.lambda.runtime.events.SQSEvent; +import com.squareup.moshi.JsonAdapter; +import com.squareup.moshi.Moshi; +import datadog.trace.core.DDCoreJavaSpecification; +import java.io.ByteArrayInputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.Test; + +abstract class AbstractSerialize { + public String randomString; +} + +class SubClass extends AbstractSerialize { + SubClass() { + this.randomString = "tutu"; + } +} + +interface ApiRequestPath {} + +class LambdaRequest { + public boolean testBool; + public String emptyStr; + public Map emptyHeaders; +} + +class CustomRequest

      extends LambdaRequest { + public P path; + public B body; +} + +public class SkipUnhandledTypeJsonSerializerTest extends DDCoreJavaSpecification { + + static class TestJsonObject { + public String field1; + public boolean field2; + public AbstractSerialize field3; + public NestedJsonObject field4; + public ByteArrayInputStream field5; + + TestJsonObject() { + this.field1 = "toto"; + this.field2 = true; + this.field3 = new SubClass(); + this.field4 = new NestedJsonObject(); + this.field5 = new ByteArrayInputStream(new byte[0]); + } + } + + static class NestedJsonObject { + public AbstractSerialize field; + + NestedJsonObject() { + this.field = new SubClass(); + } + } + + private static JsonAdapter buildAdapter() { + return new Moshi.Builder() + .add(SkipUnsupportedTypeJsonAdapter.newFactory()) + .build() + .adapter(Object.class); + } + + @Test + void testStringSerialization() { + JsonAdapter adapter = buildAdapter(); + + String result = adapter.toJson(new TestJsonObject()); + + assertEquals( + "{\"field1\":\"toto\",\"field2\":true,\"field3\":{},\"field4\":{\"field\":{}},\"field5\":{}}", + result); + } + + @Test + void testSimpleCase() { + JsonAdapter adapter = buildAdapter(); + + LinkedHashMap list = new LinkedHashMap<>(); + list.put("key0", "item0"); + list.put("key1", "item1"); + list.put("key2", "item2"); + String result = adapter.toJson(list); + + assertEquals("{\"key0\":\"item0\",\"key1\":\"item1\",\"key2\":\"item2\"}", result); + } + + @Test + void testSQSEvent() { + JsonAdapter adapter = buildAdapter(); + + SQSEvent myEvent = new SQSEvent(); + List records = new ArrayList<>(); + SQSEvent.SQSMessage message = new SQSEvent.SQSMessage(); + message.setMessageId("myId"); + message.setAwsRegion("myRegion"); + records.add(message); + myEvent.setRecords(records); + String result = adapter.toJson(myEvent); + + assertEquals("{\"records\":[{\"awsRegion\":\"myRegion\",\"messageId\":\"myId\"}]}", result); + } + + @Test + void testSNSEvent() { + JsonAdapter adapter = buildAdapter(); + + SNSEvent myEvent = new SNSEvent(); + List records = new ArrayList<>(); + SNSEvent.SNSRecord message = new SNSEvent.SNSRecord(); + message.setEventSource("mySource"); + message.setEventVersion("myVersion"); + records.add(message); + myEvent.setRecords(records); + String result = adapter.toJson(myEvent); + + assertEquals( + "{\"records\":[{\"eventSource\":\"mySource\",\"eventVersion\":\"myVersion\"}]}", result); + } + + @Test + void testAPIGatewayProxyRequestEvent() { + JsonAdapter adapter = buildAdapter(); + + APIGatewayProxyRequestEvent myEvent = new APIGatewayProxyRequestEvent(); + myEvent.setBody("bababango"); + myEvent.setHttpMethod("POST"); + String result = adapter.toJson(myEvent); + + assertEquals("{\"body\":\"bababango\",\"httpMethod\":\"POST\"}", result); + } + + @Test + void testMapStringObjectEvent() { + JsonAdapter adapter = buildAdapter(); + + HashMap myEvent = new HashMap<>(); + HashMap myNestedEvent = new HashMap<>(); + myNestedEvent.put("nestedKey0", "nestedValue1"); + myNestedEvent.put("nestedKey1", true); + myNestedEvent.put("nestedKey2", Arrays.asList("aaa", "bbb", "ccc", "dddd")); + myEvent.put("firstKey", new TestJsonObject()); + myEvent.put("secondKey", myNestedEvent); + String result = adapter.toJson(myEvent); + + assertEquals( + "{\"firstKey\":{\"field1\":\"toto\",\"field2\":true,\"field3\":{},\"field4\":{\"field\":{}},\"field5\":{}},\"secondKey\":{\"nestedKey2\":[\"aaa\",\"bbb\",\"ccc\",\"dddd\"],\"nestedKey0\":\"nestedValue1\",\"nestedKey1\":true}}", + result); + } + + @Test + @SuppressWarnings("rawtypes") + void testCustomPayload() { + JsonAdapter adapter = buildAdapter(); + + CustomRequest customPayload = new CustomRequest(); + String result = adapter.toJson(customPayload); + + assertEquals("{\"body\":{},\"path\":{},\"testBool\":false}", result); + } +} diff --git a/dd-trace-core/src/test/java/datadog/trace/llmobs/writer/ddintake/LLMObsSpanMapperTest.java b/dd-trace-core/src/test/java/datadog/trace/llmobs/writer/ddintake/LLMObsSpanMapperTest.java new file mode 100644 index 00000000000..af0b1476b89 --- /dev/null +++ b/dd-trace-core/src/test/java/datadog/trace/llmobs/writer/ddintake/LLMObsSpanMapperTest.java @@ -0,0 +1,416 @@ +package datadog.trace.llmobs.writer.ddintake; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.fasterxml.jackson.databind.ObjectMapper; +import datadog.communication.serialization.ByteBufferConsumer; +import datadog.communication.serialization.FlushingBuffer; +import datadog.communication.serialization.msgpack.MsgPackWriter; +import datadog.trace.api.DDTags; +import datadog.trace.api.llmobs.LLMObs; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.api.InternalSpanTypes; +import datadog.trace.bootstrap.instrumentation.api.Tags; +import datadog.trace.common.writer.ListWriter; +import datadog.trace.core.CoreTracer; +import datadog.trace.core.DDCoreJavaSpecification; +import datadog.trace.core.DDSpan; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.channels.WritableByteChannel; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.Test; +import org.msgpack.jackson.dataformat.MessagePackFactory; + +@SuppressWarnings("unchecked") +public class LLMObsSpanMapperTest extends DDCoreJavaSpecification { + + private static final ObjectMapper objectMapper = new ObjectMapper(new MessagePackFactory()); + + @Test + void testLLMObsSpanMapperSerialization() throws Exception { + LLMObsSpanMapper mapper = new LLMObsSpanMapper(); + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + + // Create a real LLMObs span using the tracer + AgentSpan llmSpan = + tracer + .buildSpan("datadog", "openai.request") + .withResourceName("createCompletion") + .withTag("_ml_obs_tag.span.kind", Tags.LLMOBS_LLM_SPAN_KIND) + .withTag("_ml_obs_tag.model_name", "gpt-4") + .withTag("_ml_obs_tag.model_provider", "openai") + .withTag("_ml_obs_metric.input_tokens", 50) + .withTag("_ml_obs_metric.output_tokens", 25) + .withTag("_ml_obs_metric.total_tokens", 75) + .withTag("_ml_obs_tag.session_id", "abc-123-session") + .start(); + + llmSpan.setSpanType(InternalSpanTypes.LLMOBS); + + Map toolCallArgs = Collections.singletonMap("location", "San Francisco"); + LLMObs.ToolCall toolCall = + LLMObs.ToolCall.from("get_weather", "function_call", "call_123", toolCallArgs); + LLMObs.ToolResult toolResult = + LLMObs.ToolResult.from( + "get_weather", "function_call_output", "call_123", "{\"temperature\":\"72F\"}"); + List inputMessages = + Arrays.asList( + LLMObs.LLMMessage.from("user", "Hello, what's the weather like?"), + LLMObs.LLMMessage.from( + "assistant", + null, + Collections.singletonList(toolCall), + Collections.singletonList(toolResult))); + List outputMessages = + Collections.singletonList( + LLMObs.LLMMessage.from("assistant", "I'll help you check the weather.")); + + Map chatTemplateEntry = new LinkedHashMap<>(); + chatTemplateEntry.put("role", "user"); + chatTemplateEntry.put("content", "Hello, what's the weather like in {{city}}?"); + Map prompt = new LinkedHashMap<>(); + prompt.put("id", "prompt_123"); + prompt.put("version", "1"); + prompt.put("variables", Collections.singletonMap("city", "San Francisco")); + prompt.put("chat_template", Collections.singletonList(chatTemplateEntry)); + + Map inputMap = new LinkedHashMap<>(); + inputMap.put("messages", inputMessages); + inputMap.put("prompt", prompt); + llmSpan.setTag("_ml_obs_tag.input", inputMap); + llmSpan.setTag("_ml_obs_tag.output", outputMessages); + + Map metadataMap = new LinkedHashMap<>(); + metadataMap.put("temperature", 0.7); + metadataMap.put("max_tokens", 100); + llmSpan.setTag("_ml_obs_tag.metadata", metadataMap); + + Map cityProp = Collections.singletonMap("type", "string"); + Map properties = Collections.singletonMap("city", cityProp); + Map schema = new LinkedHashMap<>(); + schema.put("type", "object"); + schema.put("properties", properties); + Map toolDef = new LinkedHashMap<>(); + toolDef.put("name", "get_weather"); + toolDef.put("description", "Get weather by city"); + toolDef.put("schema", schema); + llmSpan.setTag("_ml_obs_tag.tool_definitions", Collections.singletonList(toolDef)); + + llmSpan.setError(true); + llmSpan.setTag(DDTags.ERROR_MSG, "boom"); + llmSpan.setTag(DDTags.ERROR_TYPE, "java.lang.IllegalStateException"); + llmSpan.setTag(DDTags.ERROR_STACK, "stacktrace"); + + llmSpan.finish(); + + List trace = Collections.singletonList((DDSpan) llmSpan); + CapturingByteBufferConsumer sink = new CapturingByteBufferConsumer(); + // Keep all formatted spans in a single flush for this assertion. + MsgPackWriter packer = new MsgPackWriter(new FlushingBuffer(16 * 1024, sink)); + + packer.format(trace, mapper); + packer.flush(); + + assertNotNull(sink.captured); + datadog.trace.common.writer.Payload payload = mapper.newPayload(); + payload.withBody(1, sink.captured); + + // Capture the size before the buffer is written and the body buffer is emptied. + int sizeInBytes = payload.sizeInBytes(); + + byte[] bytesWritten = writeTo(payload); + assertEquals(sizeInBytes, bytesWritten.length); + Map result = objectMapper.readValue(bytesWritten, Map.class); + + assertTrue(result.containsKey("event_type")); + assertEquals("span", result.get("event_type")); + assertTrue(result.containsKey("_dd.stage")); + assertEquals("raw", result.get("_dd.stage")); + assertTrue(result.containsKey("spans")); + assertNotNull(result.get("spans")); + List> spans = (List>) result.get("spans"); + assertTrue(spans instanceof List); + assertEquals(1, spans.size()); + + Map spanData = spans.get(0); + assertEquals("OpenAI.createCompletion", spanData.get("name")); + assertTrue(spanData.containsKey("span_id")); + assertTrue(spanData.containsKey("trace_id")); + assertTrue(spanData.containsKey("start_ns")); + assertTrue(spanData.containsKey("duration")); + assertTrue(spanData.containsKey("_dd")); + Map dd = (Map) spanData.get("_dd"); + assertEquals(dd.get("span_id"), spanData.get("span_id")); + assertEquals(dd.get("trace_id"), spanData.get("trace_id")); + assertEquals(dd.get("apm_trace_id"), spanData.get("trace_id")); + + // Top-level session_id field — what the LLM Trace Explorer's Sessions filter queries. + assertTrue(spanData.containsKey("session_id")); + assertEquals("abc-123-session", spanData.get("session_id")); + + assertTrue(spanData.containsKey("meta")); + Map meta = (Map) spanData.get("meta"); + assertEquals("llm", meta.get("span.kind")); + assertTrue(meta.containsKey("error")); + Map error = (Map) meta.get("error"); + assertEquals("boom", error.get("message")); + assertEquals("java.lang.IllegalStateException", error.get("type")); + assertEquals("stacktrace", error.get("stack")); + assertTrue(meta.containsKey("input")); + Map inputResult = (Map) meta.get("input"); + assertTrue(inputResult.containsKey("messages")); + List> inputMsgs = (List>) inputResult.get("messages"); + assertTrue(inputMsgs.get(0).containsKey("content")); + assertEquals("Hello, what's the weather like?", inputMsgs.get(0).get("content")); + assertTrue(inputMsgs.get(0).containsKey("role")); + assertEquals("user", inputMsgs.get(0).get("role")); + assertEquals("assistant", inputMsgs.get(1).get("role")); + assertFalse(inputMsgs.get(1).containsKey("content")); + List> toolCalls = + (List>) inputMsgs.get(1).get("tool_calls"); + assertEquals("get_weather", toolCalls.get(0).get("name")); + assertEquals("function_call", toolCalls.get(0).get("type")); + assertEquals("call_123", toolCalls.get(0).get("tool_id")); + assertEquals( + Collections.singletonMap("location", "San Francisco"), toolCalls.get(0).get("arguments")); + List> toolResults = + (List>) inputMsgs.get(1).get("tool_results"); + assertEquals("get_weather", toolResults.get(0).get("name")); + assertEquals("function_call_output", toolResults.get(0).get("type")); + assertEquals("call_123", toolResults.get(0).get("tool_id")); + assertEquals("{\"temperature\":\"72F\"}", toolResults.get(0).get("result")); + Map promptResult = (Map) inputResult.get("prompt"); + assertEquals("prompt_123", promptResult.get("id")); + assertEquals("1", promptResult.get("version")); + assertEquals(Collections.singletonMap("city", "San Francisco"), promptResult.get("variables")); + assertEquals(Collections.singletonList(chatTemplateEntry), promptResult.get("chat_template")); + assertTrue(meta.containsKey("output")); + Map outputResult = (Map) meta.get("output"); + assertTrue(outputResult.containsKey("messages")); + List> outputMsgs = (List>) outputResult.get("messages"); + assertTrue(outputMsgs.get(0).containsKey("content")); + assertEquals("I'll help you check the weather.", outputMsgs.get(0).get("content")); + assertTrue(outputMsgs.get(0).containsKey("role")); + assertEquals("assistant", outputMsgs.get(0).get("role")); + List> toolDefsResult = + (List>) meta.get("tool_definitions"); + assertEquals("get_weather", toolDefsResult.get(0).get("name")); + assertEquals("Get weather by city", toolDefsResult.get(0).get("description")); + assertEquals(schema, toolDefsResult.get(0).get("schema")); + assertTrue(meta.containsKey("metadata")); + + assertTrue(spanData.containsKey("metrics")); + Map metrics = (Map) spanData.get("metrics"); + assertEquals(50.0, ((Number) metrics.get("input_tokens")).doubleValue(), 0.0); + assertEquals(25.0, ((Number) metrics.get("output_tokens")).doubleValue(), 0.0); + assertEquals(75.0, ((Number) metrics.get("total_tokens")).doubleValue(), 0.0); + + assertTrue(spanData.containsKey("tags")); + List tags = (List) spanData.get("tags"); + assertTrue(tags.contains("language:jvm")); + assertTrue(tags.contains("session_id:abc-123-session")); + + tracer.close(); + } + + @Test + void testLLMObsSpanMapperWritesNoSpansWhenNoneAreLLMObsSpans() { + LLMObsSpanMapper mapper = new LLMObsSpanMapper(); + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + + AgentSpan regularSpan1 = + tracer + .buildSpan("datadog", "http.request") + .withResourceName("GET /api/users") + .withTag("http.method", "GET") + .withTag("http.url", "https://example.com/api/users") + .start(); + regularSpan1.finish(); + + AgentSpan regularSpan2 = + tracer + .buildSpan("datadog", "database.query") + .withResourceName("SELECT * FROM users") + .withTag("db.type", "postgresql") + .start(); + regularSpan2.finish(); + + List trace = Arrays.asList((DDSpan) regularSpan1, (DDSpan) regularSpan2); + CapturingByteBufferConsumer sink = new CapturingByteBufferConsumer(); + // Keep all formatted spans in a single flush for this assertion. + MsgPackWriter packer = new MsgPackWriter(new FlushingBuffer(16 * 1024, sink)); + + packer.format(trace, mapper); + packer.flush(); + + assertFalse(sink.captured != null); + + tracer.close(); + } + + @Test + void testConsecutivePackerFormatCallsAccumulateSpansFromMultipleTraces() throws Exception { + LLMObsSpanMapper mapper = new LLMObsSpanMapper(); + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + + // First trace with 2 LLMObs spans + AgentSpan llmSpan1 = + tracer + .buildSpan("datadog", "chat-completion-1") + .withTag("_ml_obs_tag.span.kind", Tags.LLMOBS_LLM_SPAN_KIND) + .withTag("_ml_obs_tag.model_name", "gpt-4") + .withTag("_ml_obs_tag.model_provider", "openai") + .start(); + llmSpan1.setSpanType(InternalSpanTypes.LLMOBS); + llmSpan1.finish(); + + AgentSpan llmSpan2 = + tracer + .buildSpan("datadog", "chat-completion-2") + .withTag("_ml_obs_tag.span.kind", Tags.LLMOBS_LLM_SPAN_KIND) + .withTag("_ml_obs_tag.model_name", "gpt-3.5") + .withTag("_ml_obs_tag.model_provider", "openai") + .start(); + llmSpan2.setSpanType(InternalSpanTypes.LLMOBS); + llmSpan2.finish(); + + // Second trace with 1 LLMObs span + AgentSpan llmSpan3 = + tracer + .buildSpan("datadog", "chat-completion-3") + .withTag("_ml_obs_tag.span.kind", Tags.LLMOBS_LLM_SPAN_KIND) + .withTag("_ml_obs_tag.model_name", "claude-3") + .withTag("_ml_obs_tag.model_provider", "anthropic") + .start(); + llmSpan3.setSpanType(InternalSpanTypes.LLMOBS); + llmSpan3.finish(); + + List trace1 = Arrays.asList((DDSpan) llmSpan1, (DDSpan) llmSpan2); + List trace2 = Collections.singletonList((DDSpan) llmSpan3); + CapturingByteBufferConsumer sink = new CapturingByteBufferConsumer(); + // Keep all formatted spans in a single flush for this assertion. + MsgPackWriter packer = new MsgPackWriter(new FlushingBuffer(16 * 1024, sink)); + + packer.format(trace1, mapper); + packer.format(trace2, mapper); + packer.flush(); + + assertNotNull(sink.captured); + datadog.trace.common.writer.Payload payload = mapper.newPayload(); + payload.withBody(3, sink.captured); + + // Capture the size before the buffer is written and the body buffer is emptied. + int sizeInBytes = payload.sizeInBytes(); + + byte[] bytesWritten = writeTo(payload); + assertEquals(sizeInBytes, bytesWritten.length); + Map result = objectMapper.readValue(bytesWritten, Map.class); + + assertTrue(result.containsKey("event_type")); + assertEquals("span", result.get("event_type")); + assertTrue(result.containsKey("_dd.stage")); + assertEquals("raw", result.get("_dd.stage")); + assertTrue(result.containsKey("spans")); + List> spans = (List>) result.get("spans"); + assertTrue(spans instanceof List); + assertEquals(3, spans.size()); + + List spanNames = new ArrayList<>(); + for (Map span : spans) { + spanNames.add(span.get("name")); + } + assertTrue(spanNames.contains("chat-completion-1")); + assertTrue(spanNames.contains("chat-completion-2")); + assertTrue(spanNames.contains("chat-completion-3")); + + tracer.close(); + } + + @Test + void testLLMObsSpanMapperOmitsTopLevelSessionIdWhenNotSet() throws Exception { + LLMObsSpanMapper mapper = new LLMObsSpanMapper(); + CoreTracer tracer = tracerBuilder().writer(new ListWriter()).build(); + + AgentSpan llmSpan = + tracer + .buildSpan("datadog", "openai.request") + .withResourceName("createCompletion") + .withTag("_ml_obs_tag.span.kind", Tags.LLMOBS_LLM_SPAN_KIND) + .withTag("_ml_obs_tag.model_name", "gpt-4") + .withTag("_ml_obs_tag.model_provider", "openai") + .start(); + llmSpan.setSpanType(InternalSpanTypes.LLMOBS); + llmSpan.finish(); + + List trace = Collections.singletonList((DDSpan) llmSpan); + CapturingByteBufferConsumer sink = new CapturingByteBufferConsumer(); + MsgPackWriter packer = new MsgPackWriter(new FlushingBuffer(16 * 1024, sink)); + + packer.format(trace, mapper); + packer.flush(); + + assertNotNull(sink.captured); + datadog.trace.common.writer.Payload payload = mapper.newPayload(); + payload.withBody(1, sink.captured); + + byte[] bytesWritten = writeTo(payload); + Map result = objectMapper.readValue(bytesWritten, Map.class); + List> spans = (List>) result.get("spans"); + Map spanData = spans.get(0); + + // No top-level session_id field when the tag was never set. + assertFalse(spanData.containsKey("session_id")); + + // And no session_id entry leaks into tags[] either. + List tags = (List) spanData.get("tags"); + for (String tag : tags) { + assertFalse( + tag.startsWith("session_id:"), "tag should not start with session_id: but got: " + tag); + } + + tracer.close(); + } + + private static byte[] writeTo(datadog.trace.common.writer.Payload payload) throws IOException { + ByteArrayOutputStream channel = new ByteArrayOutputStream(); + payload.writeTo( + new WritableByteChannel() { + @Override + public int write(ByteBuffer src) throws IOException { + byte[] bytes = new byte[src.remaining()]; + src.get(bytes); + channel.write(bytes); + return bytes.length; + } + + @Override + public boolean isOpen() { + return true; + } + + @Override + public void close() throws IOException {} + }); + return channel.toByteArray(); + } + + static class CapturingByteBufferConsumer implements ByteBufferConsumer { + + ByteBuffer captured; + + @Override + public void accept(int messageCount, ByteBuffer buffer) { + captured = buffer; + } + } +} diff --git a/dd-trace-core/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker b/dd-trace-core/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker new file mode 100644 index 00000000000..ca6ee9cea8e --- /dev/null +++ b/dd-trace-core/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker @@ -0,0 +1 @@ +mock-maker-inline \ No newline at end of file diff --git a/dd-trace-core/src/traceAgentTest/groovy/DDApiIntegrationTest.groovy b/dd-trace-core/src/traceAgentTest/groovy/DDApiIntegrationTest.groovy index 37a9a7dd289..b2d538a26b4 100644 --- a/dd-trace-core/src/traceAgentTest/groovy/DDApiIntegrationTest.groovy +++ b/dd-trace-core/src/traceAgentTest/groovy/DDApiIntegrationTest.groovy @@ -67,7 +67,7 @@ class DDApiIntegrationTest extends AbstractTraceAgentTest { def setup() { tracer = CoreTracer.builder().writer(new ListWriter()).build() - span = tracer.buildSpan("fakeOperation").start() + span = tracer.buildSpan("datadog", "fakeOperation").start() Thread.sleep(1) span.finish() } diff --git a/dd-trace-core/src/traceAgentTest/groovy/MetricsIntegrationTest.groovy b/dd-trace-core/src/traceAgentTest/groovy/MetricsIntegrationTest.groovy deleted file mode 100644 index 2972ffa2c18..00000000000 --- a/dd-trace-core/src/traceAgentTest/groovy/MetricsIntegrationTest.groovy +++ /dev/null @@ -1,72 +0,0 @@ -import static datadog.communication.ddagent.DDAgentFeaturesDiscovery.V06_METRICS_ENDPOINT -import static datadog.trace.common.metrics.EventListener.EventType.OK -import static java.util.concurrent.TimeUnit.SECONDS - -import datadog.communication.http.OkHttpUtils -import datadog.metrics.api.Histograms -import datadog.metrics.impl.DDSketchHistograms -import datadog.trace.api.Config -import datadog.trace.api.WellKnownTags -import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString -import datadog.trace.common.metrics.AggregateMetric -import datadog.trace.common.metrics.EventListener -import datadog.trace.common.metrics.MetricKey -import datadog.trace.common.metrics.OkHttpSink -import datadog.trace.common.metrics.SerializingMetricWriter -import java.util.concurrent.CopyOnWriteArrayList -import java.util.concurrent.CountDownLatch -import java.util.concurrent.atomic.AtomicLongArray -import okhttp3.HttpUrl - -class MetricsIntegrationTest extends AbstractTraceAgentTest { - - def setupSpec() { - // Initialize metrics-lib histograms to register the DDSketch implementation - Histograms.register(DDSketchHistograms.FACTORY) - } - - def "send metrics to trace agent should notify with OK event"() { - setup: - def latch = new CountDownLatch(1) - def listener = new BlockingListener(latch) - def agentUrl = Config.get().getAgentUrl() - OkHttpSink sink = new OkHttpSink(OkHttpUtils.buildHttpClient(HttpUrl.parse(agentUrl), 5000L), agentUrl, V06_METRICS_ENDPOINT, true, false, [:]) - sink.register(listener) - - when: - SerializingMetricWriter writer = new SerializingMetricWriter( - new WellKnownTags("runtimeid","hostname", "env", "service", "version","language"), - sink - ) - writer.startBucket(2, System.nanoTime(), SECONDS.toNanos(10)) - writer.add( - new MetricKey("resource1", "service1", "operation1", null, "sql", 0, false, true, "xyzzy", [UTF8BytesString.create("grault:quux")], null, null, null), - new AggregateMetric().recordDurations(5, new AtomicLongArray(2, 1, 2, 250, 4, 5)) - ) - writer.add( - new MetricKey("resource2", "service2", "operation2", null, "web", 200, false, true, "xyzzy", [UTF8BytesString.create("grault:quux")], null, null, null), - new AggregateMetric().recordDurations(10, new AtomicLongArray(1, 1, 200, 2, 3, 4, 5, 6, 7, 8, 9)) - ) - writer.finishBucket() - - then: - latch.await(5, SECONDS) - listener.events.size() == 1 && listener.events[0] == OK - } - - static class BlockingListener implements EventListener { - - List events = new CopyOnWriteArrayList<>() - final CountDownLatch latch - - BlockingListener(CountDownLatch latch) { - this.latch = latch - } - - @Override - void onEvent(EventType eventType, String message) { - events.add(eventType) - latch.countDown() - } - } -} diff --git a/dd-trace-core/src/traceAgentTest/groovy/TraceGenerator.groovy b/dd-trace-core/src/traceAgentTest/groovy/TraceGenerator.groovy index e668d0112a6..a0c81cbd0cb 100644 --- a/dd-trace-core/src/traceAgentTest/groovy/TraceGenerator.groovy +++ b/dd-trace-core/src/traceAgentTest/groovy/TraceGenerator.groovy @@ -1,6 +1,7 @@ import static datadog.trace.api.ProcessTags.tagsForSerialization import static datadog.trace.api.TagMap.fromMap import static datadog.trace.api.sampling.PrioritySampling.UNSET +import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND import static java.lang.Thread.currentThread import static java.util.Collections.emptyList @@ -13,6 +14,7 @@ import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString import datadog.trace.core.CoreSpan import datadog.trace.core.Metadata import datadog.trace.core.MetadataConsumer +import datadog.trace.core.SpanKindFilter import java.util.concurrent.ThreadLocalRandom import java.util.concurrent.TimeUnit @@ -173,6 +175,11 @@ class TraceGenerator { return serviceName } + @Override + CharSequence getServiceNameSource() { + return null + } + @Override CharSequence getOperationName() { return operationName @@ -298,6 +305,12 @@ class TraceGenerator { return false } + @Override + boolean isKind(SpanKindFilter filter) { + Object kind = unsafeGetTag(SPAN_KIND) + return filter.matches(kind == null ? null : kind.toString()) + } + Map getBaggage() { return metadata.getBaggage() } @@ -319,11 +332,6 @@ class TraceGenerator { consumer.accept(metadata) } - @Override - void processTagsAndBaggage(MetadataConsumer consumer, boolean injectLinksAsTags, boolean injectBaggageAsTags) { - consumer.accept(metadata) - } - @Override PojoSpan setSamplingPriority(int samplingPriority, int samplingMechanism) { return this @@ -394,6 +402,16 @@ class TraceGenerator { return value as U } + @Override + U unsafeGetTag(CharSequence name, U defaultValue) { + return getTag(name, defaultValue) + } + + @Override + U unsafeGetTag(CharSequence name) { + return getTag(name) + } + @Override boolean hasSamplingPriority() { return false diff --git a/dd-trace-core/src/traceAgentTest/java/datadog/trace/common/metrics/MetricsIntegrationTest.java b/dd-trace-core/src/traceAgentTest/java/datadog/trace/common/metrics/MetricsIntegrationTest.java new file mode 100644 index 00000000000..541bf9080fc --- /dev/null +++ b/dd-trace-core/src/traceAgentTest/java/datadog/trace/common/metrics/MetricsIntegrationTest.java @@ -0,0 +1,187 @@ +package datadog.trace.common.metrics; + +import static datadog.communication.ddagent.DDAgentFeaturesDiscovery.V06_METRICS_ENDPOINT; +import static datadog.trace.test.junit.utils.config.WithConfigExtension.injectSysConfig; +import static java.util.concurrent.TimeUnit.SECONDS; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.communication.http.OkHttpUtils; +import datadog.metrics.agent.AgentMeter; +import datadog.metrics.api.statsd.StatsDClient; +import datadog.metrics.impl.DDSketchHistograms; +import datadog.metrics.impl.MonitoringImpl; +import datadog.trace.api.Config; +import datadog.trace.api.ConfigDefaults; +import datadog.trace.api.WellKnownTags; +import datadog.trace.api.config.TracerConfig; +import datadog.trace.test.junit.utils.config.WithConfigExtension; +import java.time.Duration; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import okhttp3.HttpUrl; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.testcontainers.containers.GenericContainer; +import org.testcontainers.containers.startupcheck.MinimumDurationRunningStartupCheckStrategy; + +@ExtendWith(WithConfigExtension.class) +class MetricsIntegrationTest { + + // CI runs an agent container alongside the build (reached via CI_AGENT_HOST); when building + // locally we start one ourselves with testcontainers. + private static final boolean RUNNING_IN_CI = "true".equals(System.getenv("CI")); + private static GenericContainer agentContainer; + + @BeforeAll + static void setupSpec() { + // recordOneDuration -> Histogram.accept needs the metrics meter / histogram factory registered. + MonitoringImpl monitoring = new MonitoringImpl(StatsDClient.NO_OP, 1, TimeUnit.SECONDS); + AgentMeter.registerIfAbsent(StatsDClient.NO_OP, monitoring, DDSketchHistograms.FACTORY); + + if (!RUNNING_IN_CI) { + Map env = new HashMap<>(); + env.put("DD_APM_ENABLED", "true"); + env.put("DD_BIND_HOST", "0.0.0.0"); + env.put("DD_API_KEY", "invalid_key_but_this_is_fine"); + env.put("DD_HOSTNAME", "doesnotexist"); + env.put("DD_LOGS_STDOUT", "yes"); + agentContainer = + new GenericContainer<>("datadog/agent:7.40.1") + .withEnv(env) + .withExposedPorts(ConfigDefaults.DEFAULT_TRACE_AGENT_PORT) + .withStartupTimeout(Duration.ofSeconds(120)) + // Sleep for a bit so the agent's rate_by_service response is populated -- mirrors the + // race-condition workaround from the original Spock base. + .withStartupCheckStrategy( + new MinimumDurationRunningStartupCheckStrategy(Duration.ofSeconds(10))); + agentContainer.start(); + } + } + + @AfterAll + static void cleanupSpec() { + if (agentContainer != null) { + agentContainer.stop(); + } + } + + @BeforeEach + void setup() { + AggregateEntry.resetCardinalityHandlers(); + injectSysConfig(TracerConfig.AGENT_HOST, agentHost()); + injectSysConfig(TracerConfig.TRACE_AGENT_PORT, agentPort()); + } + + private static String agentHost() { + return agentContainer != null ? agentContainer.getHost() : System.getenv("CI_AGENT_HOST"); + } + + private static String agentPort() { + return agentContainer != null + ? String.valueOf(agentContainer.getMappedPort(ConfigDefaults.DEFAULT_TRACE_AGENT_PORT)) + : String.valueOf(ConfigDefaults.DEFAULT_TRACE_AGENT_PORT); + } + + @Test + void sendMetricsToTraceAgentShouldNotifyWithOkEvent() throws InterruptedException { + // setup + CountDownLatch latch = new CountDownLatch(1); + BlockingListener listener = new BlockingListener(latch); + String agentUrl = Config.get().getAgentUrl(); + OkHttpSink sink = + new OkHttpSink( + OkHttpUtils.buildHttpClient(HttpUrl.parse(agentUrl), 5000L), + agentUrl, + V06_METRICS_ENDPOINT, + true, + false, + Collections.emptyMap()); + sink.register(listener); + + // when + SerializingMetricWriter writer = + new SerializingMetricWriter( + new WellKnownTags("runtimeid", "hostname", "env", "service", "version", "language"), + sink); + writer.startBucket(2, System.nanoTime(), SECONDS.toNanos(10)); + // Build entries through the production AggregateTable.findOrInsert path (canonicalizes the + // snapshot and creates/looks up the entry). Both entries use one peer tag (grault:quux) and no + // additional tags -> schema names=["grault"], values=["quux"]. + AggregateTable table = new AggregateTable(8); + PeerTagSchema schema = new PeerTagSchema(new String[] {"grault"}, PeerTagSchema.NO_STATE); + SpanSnapshot snap1 = + new SpanSnapshot( + "resource1", + "service1", + "operation1", + null, + "sql", + (short) 0, + false, + true, + "xyzzy", + schema, + new String[] {"quux"}, + null, + null, + null, + 0L); + AggregateEntry entry1 = table.findOrInsert(snap1); + for (long duration : new long[] {2, 1, 2, 250, 4}) { + entry1.recordOneDuration(duration); + } + writer.add(entry1); + SpanSnapshot snap2 = + new SpanSnapshot( + "resource2", + "service2", + "operation2", + null, + "web", + (short) 200, + false, + true, + "xyzzy", + schema, + new String[] {"quux"}, + null, + null, + null, + 0L); + AggregateEntry entry2 = table.findOrInsert(snap2); + for (long duration : new long[] {1, 1, 200, 2, 3, 4, 5, 6, 7, 8}) { + entry2.recordOneDuration(duration); + } + writer.add(entry2); + writer.finishBucket(); + + // then + assertTrue(latch.await(5, SECONDS)); + assertEquals(1, listener.events.size()); + assertEquals(EventListener.EventType.OK, listener.events.get(0)); + } + + static class BlockingListener implements EventListener { + final List events = new CopyOnWriteArrayList<>(); + final CountDownLatch latch; + + BlockingListener(CountDownLatch latch) { + this.latch = latch; + } + + @Override + public void onEvent(EventListener.EventType eventType, String message) { + events.add(eventType); + latch.countDown(); + } + } +} diff --git a/dd-trace-ot/build.gradle.kts b/dd-trace-ot/build.gradle.kts index 7c73abef06b..1df2d46087b 100644 --- a/dd-trace-ot/build.gradle.kts +++ b/dd-trace-ot/build.gradle.kts @@ -12,20 +12,18 @@ apply(from = rootDir.resolve("gradle/java.gradle")) apply(from = rootDir.resolve("gradle/publish.gradle")) // TODO raise these when equals() and hashCode() are excluded -val minimumBranchCoverage by extra(0.5) -val minimumInstructionCoverage by extra(0.5) - -val excludedClassesCoverage by extra( - listOf( - // This is mainly equals() and hashCode() - "datadog.opentracing.OTScopeManager.OTScope", - "datadog.opentracing.OTScopeManager.FakeScope", - "datadog.opentracing.OTSpan", - "datadog.opentracing.OTSpanContext", - "datadog.opentracing.CustomScopeManagerWrapper.CustomScopeState", - // The builder is generated - "datadog.opentracing.DDTracer.DDTracerBuilder" - ) +extra["minimumBranchCoverage"] = 0.5 +extra["minimumInstructionCoverage"] = 0.5 + +extra["excludedClassesCoverage"] = listOf( + // This is mainly equals() and hashCode() + "datadog.opentracing.OTScopeManager.OTScope", + "datadog.opentracing.OTScopeManager.FakeScope", + "datadog.opentracing.OTSpan", + "datadog.opentracing.OTSpanContext", + "datadog.opentracing.CustomScopeManagerWrapper.CustomScopeState", + // The builder is generated + "datadog.opentracing.DDTracer.DDTracerBuilder" ) // Helper extensions for custom methods from Groovy DSL @@ -66,6 +64,14 @@ dependencies { implementation(project(":dd-trace-ot:correlation-id-injection")) testImplementation(project(":dd-java-agent:testing")) + testImplementation(project(":utils:test-junit-utils")) + testImplementation(project(":utils:test-junit-converter-utils")) + testImplementation(libs.bundles.mockito) + + add("ot31CompatibilityTestImplementation", project(":utils:test-junit-utils")) + add("ot31CompatibilityTestImplementation", project(":utils:test-junit-converter-utils")) + add("ot33CompatibilityTestImplementation", project(":utils:test-junit-utils")) + add("ot33CompatibilityTestImplementation", project(":utils:test-junit-converter-utils")) // Kotlin accessors not generated if not coming from plugin add("ot33CompatibilityTestImplementation", "io.opentracing:opentracing-api") { @@ -116,12 +122,12 @@ tasks.named("shadowJ dependencies { // direct dependencies exclude(project(":dd-trace-api")) - exclude(dependency("io.opentracing:")) - exclude(dependency("io.opentracing.contrib:")) - exclude(dependency("org.slf4j:")) - exclude(dependency("com.github.jnr:")) + exclude(dependency("io.opentracing:.*:.*")) + exclude(dependency("io.opentracing.contrib:.*:.*")) + exclude(dependency("org.slf4j:.*:.*")) + exclude(dependency("com.github.jnr:.*:.*")) // indirect dependency of JNR, no need to embed - exclude(dependency("org.ow2.asm:")) + exclude(dependency("org.ow2.asm:.*:.*")) } relocate("com.", "ddtrot.com.") { diff --git a/dd-trace-ot/correlation-id-injection/build.gradle.kts b/dd-trace-ot/correlation-id-injection/build.gradle.kts index f2613570972..0a39e67a1eb 100644 --- a/dd-trace-ot/correlation-id-injection/build.gradle.kts +++ b/dd-trace-ot/correlation-id-injection/build.gradle.kts @@ -4,13 +4,11 @@ plugins { apply(from = "$rootDir/gradle/java.gradle") -val minimumBranchCoverage by extra(0.8) +extra["minimumBranchCoverage"] = 0.8 -val excludedClassesCoverage by extra( - listOf( - "datadog.trace.correlation.CorrelationIdInjectors", - "datadog.trace.correlation.CorrelationIdInjectors.InjectorType" - ) +extra["excludedClassesCoverage"] = listOf( + "datadog.trace.correlation.CorrelationIdInjectors", + "datadog.trace.correlation.CorrelationIdInjectors.InjectorType" ) description = "correlation-id-injection" @@ -25,9 +23,9 @@ dependencies { compileOnly("org.apache.logging.log4j:log4j-api:$log4j2") compileOnly("log4j:log4j:$log4j1") - testImplementation(libs.guava) testImplementation(project(":dd-trace-ot")) testImplementation(project(":dd-java-agent:testing")) + testImplementation(libs.bundles.mockito) testImplementation("org.apache.logging.log4j:log4j-core:$log4j2") testImplementation("ch.qos.logback:logback-core:$logback") } diff --git a/dd-trace-ot/correlation-id-injection/gradle.lockfile b/dd-trace-ot/correlation-id-injection/gradle.lockfile index 28414222fe7..03092bc9b91 100644 --- a/dd-trace-ot/correlation-id-injection/gradle.lockfile +++ b/dd-trace-ot/correlation-id-injection/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-trace-ot:correlation-id-injection:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.3.5=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=testCompileClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=testCompileClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=testCompileClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=testCompileClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=testCompileClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=testCompileClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=testCompileClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=testCompileClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=testCompileClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=testCompileClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=testCompileClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=testCompileClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=testCompileClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -43,13 +48,13 @@ io.opentracing.contrib:opentracing-tracerresolver:0.1.6=testCompileClasspath,tes io.opentracing:opentracing-api:0.32.0=testCompileClasspath,testRuntimeClasspath io.opentracing:opentracing-noop:0.32.0=testCompileClasspath,testRuntimeClasspath io.opentracing:opentracing-util:0.32.0=testCompileClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath log4j:log4j:1.2.17=compileClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -77,12 +82,13 @@ org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.jctools:jctools-core-jdk11:4.0.6=testRuntimeClasspath org.jctools:jctools-core:4.0.6=testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -95,19 +101,22 @@ org.junit.platform:junit-platform-suite-api:1.14.1=testRuntimeClasspath org.junit.platform:junit-platform-suite-commons:1.14.1=testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath -org.mockito:mockito-core:4.4.0=testRuntimeClasspath +org.mockito:mockito-core:4.4.0=testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt org.ow2.asm:asm-commons:9.7.1=testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt org.ow2.asm:asm-tree:9.7.1=testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.10.1=jacocoAnt,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/dd-trace-ot/correlation-id-injection/src/test/groovy/CorrelationIdInjectorTest.groovy b/dd-trace-ot/correlation-id-injection/src/test/groovy/CorrelationIdInjectorTest.groovy deleted file mode 100644 index 66969d9cc9f..00000000000 --- a/dd-trace-ot/correlation-id-injection/src/test/groovy/CorrelationIdInjectorTest.groovy +++ /dev/null @@ -1,74 +0,0 @@ -import datadog.opentracing.DDTracer -import datadog.trace.api.CorrelationIdentifier -import datadog.trace.api.GlobalTracer -import datadog.trace.test.util.DDSpecification - -abstract class CorrelationIdInjectorTest extends DDSpecification { - def logPattern = "TRACE_ID=%X{${CorrelationIdentifier.getTraceIdKey()}} SPAN_ID=%X{${CorrelationIdentifier.getSpanIdKey()}} %m" - - def "test correlation id injection"() { - setup: - def tracer = buildTracer() - def journal = buildJournal() - def logger = buildLogger() - - when: - logger.log("Event without context") - - then: - journal.nextLog() == "TRACE_ID= SPAN_ID= Event without context" - - when: - def rootSpan = tracer.buildSpan("operation1").start() - def rootScope = tracer.activateSpan(rootSpan) - logger.log("Event with root span context") - - then: - journal.nextLog() == "TRACE_ID=${CorrelationIdentifier.traceId} SPAN_ID=${CorrelationIdentifier.spanId} Event with root span context" - - when: - def childSpan = tracer.buildSpan("operation1").asChildOf(rootSpan).start() - def childScope = tracer.activateSpan(childSpan) - logger.log("Event with child span context") - - then: - journal.nextLog() == "TRACE_ID=${CorrelationIdentifier.traceId} SPAN_ID=${CorrelationIdentifier.spanId} Event with child span context" - - when: - childScope.close() - childSpan.finish() - logger.log("Event with root span context") - - then: - journal.nextLog() == "TRACE_ID=${CorrelationIdentifier.traceId} SPAN_ID=${CorrelationIdentifier.spanId} Event with root span context" - - when: - rootScope.close() - rootSpan.finish() - logger.log("Event without context") - - then: - journal.nextLog() == "TRACE_ID= SPAN_ID= Event without context" - - cleanup: - tracer.close() - } - - def buildTracer() { - DDTracer tracer = new DDTracer.DDTracerBuilder().build() - GlobalTracer.registerIfAbsent(tracer) - return tracer - } - - abstract LogJournal buildJournal() - - abstract TestLogger buildLogger() - - interface LogJournal { - String nextLog() - } - - interface TestLogger { - void log(String message) - } -} diff --git a/dd-trace-ot/correlation-id-injection/src/test/groovy/Log4j2CorrelationIdInjectorTest.groovy b/dd-trace-ot/correlation-id-injection/src/test/groovy/Log4j2CorrelationIdInjectorTest.groovy deleted file mode 100644 index 0f450f931ea..00000000000 --- a/dd-trace-ot/correlation-id-injection/src/test/groovy/Log4j2CorrelationIdInjectorTest.groovy +++ /dev/null @@ -1,64 +0,0 @@ -import org.apache.logging.log4j.Level -import org.apache.logging.log4j.LogManager -import org.apache.logging.log4j.core.Appender -import org.apache.logging.log4j.core.Filter -import org.apache.logging.log4j.core.LogEvent -import org.apache.logging.log4j.core.LoggerContext -import org.apache.logging.log4j.core.appender.AbstractAppender -import org.apache.logging.log4j.core.config.Configuration -import org.apache.logging.log4j.core.config.LoggerConfig -import org.apache.logging.log4j.core.layout.PatternLayout - -class Log4j2CorrelationIdInjectorTest extends CorrelationIdInjectorTest { - @Override - LogJournal buildJournal() { - final LoggerContext context = LoggerContext.getContext(false) - final Configuration config = context.getConfiguration() - - TestAppender appender = new TestAppender(PatternLayout.newBuilder().withPattern(logPattern).build()) - appender.start() - config.addAppender(appender) - updateLoggers(appender, config) - return appender - } - - @Override - TestLogger buildLogger() { - def logger = LogManager.getLogger("TestLogger") - return { message -> logger.error(message) } - } - - private static void updateLoggers(final Appender appender, final Configuration config) { - final Level level = null - final Filter filter = null - for (final LoggerConfig loggerConfig : config.getLoggers().values()) { - loggerConfig.addAppender(appender, level, filter) - } - config.getRootLogger().addAppender(appender, level, filter) - } - - static class TestAppender extends AbstractAppender implements CorrelationIdInjectorTest.LogJournal { - List events - int read - - protected TestAppender(PatternLayout patternLayout) { - super("TestAppender", null, patternLayout, false, null) - events = [] - read = 0 - } - - @Override - void append(LogEvent event) { - def log = getLayout().toSerializable(event) - events << log - } - - @Override - String nextLog() { - if (events.size() <= read) { - return null - } - return events[read++] - } - } -} diff --git a/dd-trace-ot/correlation-id-injection/src/test/groovy/Slf4jCorrelationIdInjectorTest.groovy b/dd-trace-ot/correlation-id-injection/src/test/groovy/Slf4jCorrelationIdInjectorTest.groovy deleted file mode 100644 index 35821cf5045..00000000000 --- a/dd-trace-ot/correlation-id-injection/src/test/groovy/Slf4jCorrelationIdInjectorTest.groovy +++ /dev/null @@ -1,63 +0,0 @@ -import ch.qos.logback.classic.LoggerContext -import ch.qos.logback.classic.encoder.PatternLayoutEncoder -import ch.qos.logback.classic.spi.ILoggingEvent -import ch.qos.logback.core.AppenderBase -import org.slf4j.Logger -import org.slf4j.LoggerFactory - -class Slf4jCorrelationIdInjectorTest extends CorrelationIdInjectorTest { - - def logger - - @Override - LogJournal buildJournal() { - def logCtx = (LoggerContext) LoggerFactory.getILoggerFactory() - def logger = logCtx.getLogger("TestLogger") - this.logger = logger - def testAppender = new TestAppender(logCtx) - testAppender.start() - logger.addAppender(testAppender) - return testAppender - } - - @Override - TestLogger buildLogger() { - Logger logger = LoggerFactory.getLogger("TestLogger") - return { message -> logger.error(message)} - } - - class TestAppender extends AppenderBase implements CorrelationIdInjectorTest.LogJournal { - List events - int read - PatternLayoutEncoder encoder - - TestAppender(LoggerContext logCtx) { - name = "TestAppender" - encoder = new PatternLayoutEncoder() - encoder.setContext(logCtx) - encoder.setPattern(logPattern) - events = [] - read = 0 - } - - @Override - void start() { - encoder.start() - super.start() - } - - @Override - void append(ILoggingEvent event) { - def log = this.encoder.getLayout().doLayout(event) - events << log - } - - @Override - String nextLog() { - if (events.size() <= read) { - return null - } - return events[read++] - } - } -} diff --git a/dd-trace-ot/correlation-id-injection/src/test/java/CorrelationIdInjectorTest.java b/dd-trace-ot/correlation-id-injection/src/test/java/CorrelationIdInjectorTest.java new file mode 100644 index 00000000000..a3228a7094c --- /dev/null +++ b/dd-trace-ot/correlation-id-injection/src/test/java/CorrelationIdInjectorTest.java @@ -0,0 +1,80 @@ +import static org.junit.jupiter.api.Assertions.assertEquals; + +import datadog.opentracing.DDTracer; +import datadog.trace.api.CorrelationIdentifier; +import datadog.trace.api.GlobalTracer; +import datadog.trace.test.util.DDJavaSpecification; +import io.opentracing.Scope; +import io.opentracing.Span; +import org.junit.jupiter.api.Test; + +abstract class CorrelationIdInjectorTest extends DDJavaSpecification { + + protected static final String LOG_PATTERN = + "TRACE_ID=%X{" + + CorrelationIdentifier.getTraceIdKey() + + "} SPAN_ID=%X{" + + CorrelationIdentifier.getSpanIdKey() + + "} %m"; + + @Test + void testCorrelationIdInjection() throws Exception { + DDTracer tracer = buildTracer(); + LogJournal journal = buildJournal(); + TestLogger logger = buildLogger(); + + logger.log("Event without context"); + + assertEquals("TRACE_ID= SPAN_ID= Event without context", journal.nextLog()); + + Span rootSpan = tracer.buildSpan("operation1").start(); + Scope rootScope = tracer.activateSpan(rootSpan); + logger.log("Event with root span context"); + + assertEquals(expectedLog("Event with root span context"), journal.nextLog()); + + Span childSpan = tracer.buildSpan("operation1").asChildOf(rootSpan).start(); + Scope childScope = tracer.activateSpan(childSpan); + logger.log("Event with child span context"); + + assertEquals(expectedLog("Event with child span context"), journal.nextLog()); + + childScope.close(); + childSpan.finish(); + logger.log("Event with root span context"); + + assertEquals(expectedLog("Event with root span context"), journal.nextLog()); + + rootScope.close(); + rootSpan.finish(); + logger.log("Event without context"); + + assertEquals("TRACE_ID= SPAN_ID= Event without context", journal.nextLog()); + + tracer.close(); + } + + private static String expectedLog(String message) { + return String.format( + "TRACE_ID=%s SPAN_ID=%s %s", + CorrelationIdentifier.getTraceId(), CorrelationIdentifier.getSpanId(), message); + } + + DDTracer buildTracer() { + DDTracer tracer = new DDTracer.DDTracerBuilder().build(); + GlobalTracer.registerIfAbsent(tracer); + return tracer; + } + + abstract LogJournal buildJournal(); + + abstract TestLogger buildLogger(); + + interface LogJournal { + String nextLog(); + } + + interface TestLogger { + void log(String message); + } +} diff --git a/dd-trace-ot/correlation-id-injection/src/test/java/Log4j2CorrelationIdInjectorTest.java b/dd-trace-ot/correlation-id-injection/src/test/java/Log4j2CorrelationIdInjectorTest.java new file mode 100644 index 00000000000..e6bf85b9b18 --- /dev/null +++ b/dd-trace-ot/correlation-id-injection/src/test/java/Log4j2CorrelationIdInjectorTest.java @@ -0,0 +1,70 @@ +import java.util.ArrayList; +import java.util.List; +import org.apache.logging.log4j.Level; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.apache.logging.log4j.core.Appender; +import org.apache.logging.log4j.core.Filter; +import org.apache.logging.log4j.core.LogEvent; +import org.apache.logging.log4j.core.LoggerContext; +import org.apache.logging.log4j.core.appender.AbstractAppender; +import org.apache.logging.log4j.core.config.Configuration; +import org.apache.logging.log4j.core.config.LoggerConfig; +import org.apache.logging.log4j.core.layout.PatternLayout; + +class Log4j2CorrelationIdInjectorTest extends CorrelationIdInjectorTest { + + @Override + LogJournal buildJournal() { + LoggerContext context = LoggerContext.getContext(false); + Configuration config = context.getConfiguration(); + + TestAppender appender = + new TestAppender(PatternLayout.newBuilder().withPattern(LOG_PATTERN).build()); + appender.start(); + config.addAppender(appender); + updateLoggers(appender, config); + return appender; + } + + @Override + TestLogger buildLogger() { + Logger logger = LogManager.getLogger("TestLogger"); + return message -> logger.error(message); + } + + private static void updateLoggers(Appender appender, Configuration config) { + Level level = null; + Filter filter = null; + for (LoggerConfig loggerConfig : config.getLoggers().values()) { + loggerConfig.addAppender(appender, level, filter); + } + config.getRootLogger().addAppender(appender, level, filter); + } + + static class TestAppender extends AbstractAppender + implements CorrelationIdInjectorTest.LogJournal { + List events; + int read; + + protected TestAppender(PatternLayout patternLayout) { + super("TestAppender", null, patternLayout, false, null); + events = new ArrayList<>(); + read = 0; + } + + @Override + public void append(LogEvent event) { + String log = ((PatternLayout) getLayout()).toSerializable(event); + events.add(log); + } + + @Override + public String nextLog() { + if (events.size() <= read) { + return null; + } + return events.get(read++); + } + } +} diff --git a/dd-trace-ot/correlation-id-injection/src/test/java/Slf4jCorrelationIdInjectorTest.java b/dd-trace-ot/correlation-id-injection/src/test/java/Slf4jCorrelationIdInjectorTest.java new file mode 100644 index 00000000000..f6254708ad9 --- /dev/null +++ b/dd-trace-ot/correlation-id-injection/src/test/java/Slf4jCorrelationIdInjectorTest.java @@ -0,0 +1,66 @@ +import ch.qos.logback.classic.LoggerContext; +import ch.qos.logback.classic.encoder.PatternLayoutEncoder; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.AppenderBase; +import java.util.ArrayList; +import java.util.List; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +class Slf4jCorrelationIdInjectorTest extends CorrelationIdInjectorTest { + + ch.qos.logback.classic.Logger logger; + + @Override + LogJournal buildJournal() { + LoggerContext logCtx = (LoggerContext) LoggerFactory.getILoggerFactory(); + ch.qos.logback.classic.Logger log = logCtx.getLogger("TestLogger"); + this.logger = log; + TestAppender testAppender = new TestAppender(logCtx); + testAppender.start(); + log.addAppender(testAppender); + return testAppender; + } + + @Override + TestLogger buildLogger() { + Logger log = LoggerFactory.getLogger("TestLogger"); + return message -> log.error(message); + } + + class TestAppender extends AppenderBase + implements CorrelationIdInjectorTest.LogJournal { + private final List events; + int read; + private final PatternLayoutEncoder encoder; + + TestAppender(LoggerContext logCtx) { + name = "TestAppender"; + encoder = new PatternLayoutEncoder(); + encoder.setContext(logCtx); + encoder.setPattern(LOG_PATTERN); + events = new ArrayList<>(); + read = 0; + } + + @Override + public void start() { + encoder.start(); + super.start(); + } + + @Override + protected void append(ILoggingEvent event) { + String log = this.encoder.getLayout().doLayout(event); + events.add(log); + } + + @Override + public String nextLog() { + if (events.size() <= read) { + return null; + } + return events.get(read++); + } + } +} diff --git a/dd-trace-ot/gradle.lockfile b/dd-trace-ot/gradle.lockfile index 78da50e3d67..cff49e3f484 100644 --- a/dd-trace-ot/gradle.lockfile +++ b/dd-trace-ot/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dd-trace-ot:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=jmhRuntimeClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=jmhRuntimeClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=jmhRuntimeClasspath,ot31CompatibilityTestComp com.blogspot.mydailyjava:weak-lock-free:0.17=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=jmhRuntimeClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=jmhRuntimeClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,jmhCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.auto.service:auto-service-annotations:1.1.1=annotationProcessor,compileClasspath,jmhCompileClasspath @@ -31,12 +32,15 @@ com.google.code.findbugs:jsr305:3.0.2=annotationProcessor,compileClasspath,jmhCo com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.18.0=annotationProcessor com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.google.errorprone:error_prone_annotations:2.47.0=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:failureaccess:1.0.1=annotationProcessor -com.google.guava:guava:20.0=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.guava:guava:32.0.1-jre=annotationProcessor -com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor +com.google.guava:guava:33.6.0-jre=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=annotationProcessor,jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.google.j2objc:j2objc-annotations:2.8=annotationProcessor -com.google.re2j:re2j:1.7=jmhRuntimeClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=jmhRuntimeClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -56,12 +60,12 @@ io.opentracing:opentracing-noop:0.33.0=ot33CompatibilityTestCompileClasspath,ot3 io.opentracing:opentracing-util:0.31.0=ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath io.opentracing:opentracing-util:0.32.0=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.opentracing:opentracing-util:0.33.0=ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath -io.sqreen:libsqreen:17.3.0=jmhRuntimeClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=jmhRuntimeClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=jmhRuntimeClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=jmhRuntimeClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=jmhRuntimeClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestRuntimeClasspath,testRuntimeClasspath net.sf.jopt-simple:jopt-simple:5.0.4=jmh,jmhCompileClasspath,jmhRuntimeClasspath @@ -90,12 +94,13 @@ org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=jmhRuntimeClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.jctools:jctools-core-jdk11:4.0.6=jmhRuntimeClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=jmhRuntimeClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=jmhRuntimeClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -108,7 +113,8 @@ org.junit.platform:junit-platform-suite-api:1.14.1=jmhRuntimeClasspath,ot31Compa org.junit.platform:junit-platform-suite-commons:1.14.1=jmhRuntimeClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestRuntimeClasspath,testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.mockito:mockito-core:4.4.0=jmhRuntimeClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestRuntimeClasspath,testRuntimeClasspath +org.mockito:mockito-core:4.4.0=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-junit-jupiter:4.4.0=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.openjdk.jmh:jmh-core:1.37=jmh,jmhCompileClasspath,jmhRuntimeClasspath org.openjdk.jmh:jmh-generator-asm:1.37=jmh,jmhCompileClasspath,jmhRuntimeClasspath @@ -117,16 +123,18 @@ org.openjdk.jmh:jmh-generator-reflection:1.37=jmh,jmhCompileClasspath,jmhRuntime org.opentest4j:opentest4j:1.3.0=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt org.ow2.asm:asm-commons:9.7.1=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt org.ow2.asm:asm-tree:9.7.1=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs org.ow2.asm:asm:9.0=jmh +org.ow2.asm:asm:9.10.1=jacocoAnt,jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.7.1=compileClasspath,jmhCompileClasspath,runtimeClasspath -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm:9.9.1=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -140,4 +148,4 @@ org.spockframework:spock-core:2.4-groovy-3.0=jmhRuntimeClasspath,ot31Compatibili org.tabletest:tabletest-junit:1.2.1=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=jmhRuntimeClasspath,ot31CompatibilityTestCompileClasspath,ot31CompatibilityTestRuntimeClasspath,ot33CompatibilityTestCompileClasspath,ot33CompatibilityTestRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -empty=jmhAnnotationProcessor,ot31CompatibilityTestAnnotationProcessor,ot33CompatibilityTestAnnotationProcessor,shadow,signatures,spotbugsPlugins,testAnnotationProcessor +empty=jmhAnnotationProcessor,ot31CompatibilityTestAnnotationProcessor,ot33CompatibilityTestAnnotationProcessor,shadow,spotbugsPlugins,testAnnotationProcessor diff --git a/dd-trace-ot/src/main/java/datadog/opentracing/DDTracer.java b/dd-trace-ot/src/main/java/datadog/opentracing/DDTracer.java index fffaad4d8e3..9494c772aee 100644 --- a/dd-trace-ot/src/main/java/datadog/opentracing/DDTracer.java +++ b/dd-trace-ot/src/main/java/datadog/opentracing/DDTracer.java @@ -13,6 +13,7 @@ import datadog.trace.api.interceptor.TraceInterceptor; import datadog.trace.api.internal.InternalTracer; import datadog.trace.api.internal.TraceSegment; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.api.profiling.Profiling; import datadog.trace.bootstrap.instrumentation.api.AgentPropagation; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; @@ -484,8 +485,8 @@ public DDSpanBuilder buildSpan(final String operationName) { @Override public void inject(final SpanContext spanContext, final Format format, final C carrier) { if (carrier instanceof TextMap) { - final AgentSpanContext context = converter.toContext(spanContext); - AgentSpan span = fromSpanContext(context); + final AgentSpanContext convertedSpanContext = converter.toContext(spanContext); + AgentSpan span = fromSpanContext(convertedSpanContext); defaultPropagator().inject(span, (TextMap) carrier, TextMapSetter.INSTANCE); } else { log.debug("Unsupported format for propagation - {}", format.getClass().getName()); @@ -533,9 +534,9 @@ public Profiling getProfilingContext() { @Override public TraceSegment getTraceSegment() { - AgentSpanContext ctx = tracer.activeSpan().context(); - if (ctx instanceof DDSpanContext) { - return ((DDSpanContext) ctx).getTraceSegment(); + AgentSpanContext spanContext = tracer.activeSpan().spanContext(); + if (spanContext instanceof DDSpanContext) { + return ((DDSpanContext) spanContext).getTraceSegment(); } return null; } @@ -545,6 +546,11 @@ public void close() { tracer.close(); } + @VisibleForTesting + AgentTracer.TracerAPI getInternalTracer() { + return tracer; + } + private static class TextMapSetter implements CarrierSetter { static final TextMapSetter INSTANCE = new TextMapSetter(); @@ -587,29 +593,29 @@ public DDSpanBuilder asChildOf(final SpanContext parent) { @Override public DDSpanBuilder asChildOf(final Span parent) { if (parent != null) { - delegate.asChildOf(converter.toAgentSpan(parent).context()); + delegate.asChildOf(converter.toAgentSpan(parent).spanContext()); } return this; } @Override public DDSpanBuilder addReference( - final String referenceType, final SpanContext referencedContext) { - if (referencedContext == null) { + final String referenceType, final SpanContext referencedSpanContext) { + if (referencedSpanContext == null) { return this; } - final AgentSpanContext context = converter.toContext(referencedContext); - if (!(context instanceof ExtractedContext) && !(context instanceof DDSpanContext)) { + final AgentSpanContext spanContext = converter.toContext(referencedSpanContext); + if (!(spanContext instanceof ExtractedContext) && !(spanContext instanceof DDSpanContext)) { log.debug( "Expected to have a DDSpanContext or ExtractedContext but got {}", - context.getClass().getName()); + spanContext.getClass().getName()); return this; } if (References.CHILD_OF.equals(referenceType) || References.FOLLOWS_FROM.equals(referenceType)) { - delegate.asChildOf(context); + delegate.asChildOf(spanContext); } else { log.debug("Only support reference type of CHILD_OF and FOLLOWS_FROM"); } @@ -661,7 +667,7 @@ public Span startManual() { @Override public Span start() { final AgentSpan agentSpan = delegate.start(); - agentSpan.context().setIntegrationName("opentracing"); + agentSpan.spanContext().setIntegrationName("opentracing"); return converter.toSpan(agentSpan); } diff --git a/dd-trace-ot/src/main/java/datadog/opentracing/OTSpan.java b/dd-trace-ot/src/main/java/datadog/opentracing/OTSpan.java index 053dfa50eec..419cf3e4e68 100644 --- a/dd-trace-ot/src/main/java/datadog/opentracing/OTSpan.java +++ b/dd-trace-ot/src/main/java/datadog/opentracing/OTSpan.java @@ -1,6 +1,7 @@ package datadog.opentracing; import datadog.trace.api.interceptor.MutableSpan; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.ErrorPriorities; import datadog.trace.bootstrap.instrumentation.api.ResourceNamePriorities; @@ -29,7 +30,7 @@ class OTSpan implements Span, MutableSpan, WithAgentSpan, SpanWrapper { @Override public SpanContext context() { - return converter.toSpanContext(delegate.context()); + return converter.toSpanContext(delegate.spanContext()); } @Override @@ -248,4 +249,9 @@ public int hashCode() { public AgentSpan asAgentSpan() { return delegate; } + + @VisibleForTesting + AgentSpan getDelegate() { + return delegate; + } } diff --git a/dd-trace-ot/src/main/java/datadog/opentracing/TypeConverter.java b/dd-trace-ot/src/main/java/datadog/opentracing/TypeConverter.java index b02f96a3272..2193eeee980 100644 --- a/dd-trace-ot/src/main/java/datadog/opentracing/TypeConverter.java +++ b/dd-trace-ot/src/main/java/datadog/opentracing/TypeConverter.java @@ -1,6 +1,5 @@ package datadog.opentracing; -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopScope; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpan; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpanContext; @@ -17,13 +16,11 @@ class TypeConverter { private final LogHandler logHandler; private final OTSpan noopSpanWrapper; private final OTSpanContext noopContextWrapper; - private final OTScopeManager.OTScope noopScopeWrapper; public TypeConverter(final LogHandler logHandler) { this.logHandler = logHandler; noopSpanWrapper = new OTSpan(noopSpan(), this, logHandler); noopContextWrapper = new OTSpanContext(noopSpanContext()); - noopScopeWrapper = new OTScopeManager.OTScope(noopScope(), false, this); } public AgentSpan toAgentSpan(final Span span) { @@ -61,9 +58,6 @@ public Scope toScope(final AgentScope scope, final boolean finishSpanOnClose) { if (scope == null) { return null; } - if (scope == noopScope()) { - return noopScopeWrapper; - } return new OTScopeManager.OTScope(scope, finishSpanOnClose, this); } diff --git a/dd-trace-ot/src/ot31CompatibilityTest/groovy/OT31ApiTest.groovy b/dd-trace-ot/src/ot31CompatibilityTest/groovy/OT31ApiTest.groovy deleted file mode 100644 index 10966d67d84..00000000000 --- a/dd-trace-ot/src/ot31CompatibilityTest/groovy/OT31ApiTest.groovy +++ /dev/null @@ -1,162 +0,0 @@ -import datadog.opentracing.DDTracer -import datadog.trace.api.DDSpanId -import datadog.trace.api.DDTraceId -import datadog.trace.api.internal.util.LongStringUtils -import datadog.trace.common.writer.ListWriter -import datadog.trace.core.DDSpan -import datadog.trace.test.util.DDSpecification -import io.opentracing.Tracer -import io.opentracing.propagation.Format -import io.opentracing.propagation.TextMap -import spock.lang.Subject - -import static datadog.trace.agent.test.asserts.ListWriterAssert.assertTraces -import static datadog.trace.agent.test.utils.TraceUtils.basicSpan -import static datadog.trace.api.sampling.PrioritySampling.SAMPLER_DROP -import static datadog.trace.api.sampling.PrioritySampling.SAMPLER_KEEP -import static datadog.trace.api.sampling.PrioritySampling.UNSET -import static datadog.trace.api.sampling.PrioritySampling.USER_DROP -import static datadog.trace.api.sampling.PrioritySampling.USER_KEEP -import static datadog.trace.api.sampling.SamplingMechanism.AGENT_RATE -import static datadog.trace.api.sampling.SamplingMechanism.DEFAULT -import static datadog.trace.api.sampling.SamplingMechanism.MANUAL - -// This test focuses on things that are different between OpenTracing API 0.31.0 and 0.32.0 -class OT31ApiTest extends DDSpecification { - def writer = new ListWriter() - - @Subject - Tracer tracer = DDTracer.builder().writer(writer).build() - - def cleanup() { - tracer?.close() - } - - def "test startActive"() { - when: - def scope = tracer.buildSpan("some name").startActive(finishSpan) - scope.close() - - then: - (scope.span().delegate as DDSpan).isFinished() == finishSpan - - where: - finishSpan << [true, false] - } - - def "test startManual"() { - when: - tracer.buildSpan("some name").startManual().finish() - - then: - assertTraces(writer, 1) { - trace(1) { - basicSpan(it, "some name") - } - } - } - - def "test scopemanager"() { - setup: - def span = tracer.buildSpan("some name").start() - def scope = tracer.scopeManager().activate(span, finishSpan) - - expect: - scope != null - tracer.scopeManager().active().span() == span - - when: "attempting to close the span this way doesn't work because we lost the 'finishSpan' reference" - tracer.scopeManager().active().close() - - then: - !(span.delegate as DDSpan).isFinished() - - when: - scope.close() - - then: - (span.delegate as DDSpan).isFinished() == finishSpan - - where: - finishSpan << [true, false] - } - - def "test inject extract"() { - setup: - def span = tracer.buildSpan("some name").start() - def context = span.context() - def textMap = [:] - def adapter = new TextMapAdapter(textMap) - - when: - context.delegate.setSamplingPriority(contextPriority, samplingMechanism) - tracer.inject(context, Format.Builtin.TEXT_MAP, adapter) - - then: - def traceId = span.delegate.context.traceId as DDTraceId - def spanId = span.delegate.context.spanId - def expectedTraceparent = "00-${traceId.toHexStringPadded(32)}" + - "-${DDSpanId.toHexStringPadded(spanId)}" + - "-" + (propagatedPriority > 0 ? "01" : "00") - def effectiveSamplingMechanism = contextPriority == UNSET ? AGENT_RATE : samplingMechanism - def expectedTracestate = "dd=s:${propagatedPriority};p:${DDSpanId.toHexStringPadded(spanId)}" + - (propagatedPriority > 0 ? ";t.dm:-" + effectiveSamplingMechanism : "") + - ";t.tid:${traceId.toHexStringPadded(32).substring(0, 16)}" + - (contextPriority == UNSET ? ";t.ksr:1" : "") - def expectedTextMap = [ - "x-datadog-trace-id" : context.toTraceId(), - "x-datadog-parent-id" : context.toSpanId(), - "x-datadog-sampling-priority": propagatedPriority.toString(), - "traceparent" : expectedTraceparent, - "tracestate" : expectedTracestate, - ] - def datadogTags = [] - if (propagatedPriority > 0) { - datadogTags << "_dd.p.dm=-$effectiveSamplingMechanism" - } - if (traceId.toHighOrderLong() != 0) { - datadogTags << "_dd.p.tid=" + LongStringUtils.toHexStringPadded(traceId.toHighOrderLong(), 16) - } - if (contextPriority == UNSET) { - datadogTags << "_dd.p.ksr=1" - } - if (!datadogTags.empty) { - expectedTextMap.put("x-datadog-tags", datadogTags.join(',')) - } - textMap == expectedTextMap - - when: - def extract = tracer.extract(Format.Builtin.TEXT_MAP, adapter) - - then: - extract.toTraceId() == context.toTraceId() - extract.toSpanId() == context.toSpanId() - extract.delegate.samplingPriority == propagatedPriority - - where: - contextPriority | samplingMechanism | propagatedPriority - SAMPLER_DROP | DEFAULT | SAMPLER_DROP - SAMPLER_KEEP | DEFAULT | SAMPLER_KEEP - UNSET | DEFAULT | SAMPLER_KEEP - USER_KEEP | MANUAL | USER_KEEP - USER_DROP | MANUAL | USER_DROP - } - - static class TextMapAdapter implements TextMap { - private final Map map - - TextMapAdapter(Map map) { - this.map = map - } - - @Override - Iterator> iterator() { - return map.entrySet().iterator() - } - - @Override - void put(String key, String value) { - map.put(key, value) - } - } -} diff --git a/dd-trace-ot/src/ot31CompatibilityTest/java/datadog/opentracing/OT31ApiTest.java b/dd-trace-ot/src/ot31CompatibilityTest/java/datadog/opentracing/OT31ApiTest.java new file mode 100644 index 00000000000..5f1e873fb8c --- /dev/null +++ b/dd-trace-ot/src/ot31CompatibilityTest/java/datadog/opentracing/OT31ApiTest.java @@ -0,0 +1,180 @@ +package datadog.opentracing; + +import static datadog.trace.api.sampling.PrioritySampling.UNSET; +import static datadog.trace.api.sampling.SamplingMechanism.AGENT_RATE; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.api.DDSpanId; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.internal.util.LongStringUtils; +import datadog.trace.common.writer.ListWriter; +import datadog.trace.core.DDSpan; +import datadog.trace.core.DDSpanContext; +import datadog.trace.test.junit.utils.converter.PrioritySamplingConverter; +import datadog.trace.test.junit.utils.converter.SamplingMechanismConverter; +import datadog.trace.test.util.DDJavaSpecification; +import io.opentracing.Scope; +import io.opentracing.Tracer; +import io.opentracing.propagation.Format; +import io.opentracing.propagation.TextMap; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.converter.ConvertWith; +import org.tabletest.junit.TableTest; + +// This test focuses on things that are different between OpenTracing API 0.31.0 and 0.32.0 +class OT31ApiTest extends DDJavaSpecification { + + private final ListWriter writer = new ListWriter(); + private final Tracer tracer = DDTracer.builder().writer(writer).build(); + + @AfterEach + void cleanup() throws Exception { + if (tracer != null) { + ((DDTracer) tracer).close(); + } + } + + @ParameterizedTest + @TableTest({ + "scenario | finishSpan", + "finish=true | true ", + "finish=false | false " + }) + void testStartActive(String scenario, boolean finishSpan) { + Scope scope = tracer.buildSpan("some name").startActive(finishSpan); + scope.close(); + assertEquals(finishSpan, ((DDSpan) ((OTSpan) scope.span()).getDelegate()).isFinished()); + } + + @Test + void testStartManual() throws Exception { + tracer.buildSpan("some name").startManual().finish(); + + writer.waitForTraces(1); + assertEquals(1, writer.size()); + assertEquals(1, writer.get(0).size()); + assertEquals("some name", writer.get(0).get(0).getOperationName()); + } + + @ParameterizedTest + @TableTest({ + "scenario | finishSpan", + "finish=true | true ", + "finish=false | false " + }) + void testScopeManager(String scenario, boolean finishSpan) { + io.opentracing.Span span = tracer.buildSpan("some name").start(); + Scope scope = tracer.scopeManager().activate(span, finishSpan); + + assertNotNull(scope); + assertEquals(span, tracer.scopeManager().active().span()); + + // attempting to close via active() doesn't work because we lost the 'finishSpan' reference + tracer.scopeManager().active().close(); + assertTrue(!((DDSpan) ((OTSpan) span).getDelegate()).isFinished()); + + scope.close(); + assertEquals(finishSpan, ((DDSpan) ((OTSpan) span).getDelegate()).isFinished()); + } + + @ParameterizedTest + @TableTest({ + "scenario | contextPriority | samplingMechanism | propagatedPriority ", + "sampler drop | PrioritySampling.SAMPLER_DROP | SamplingMechanism.DEFAULT | PrioritySampling.SAMPLER_DROP", + "sampler keep | PrioritySampling.SAMPLER_KEEP | SamplingMechanism.DEFAULT | PrioritySampling.SAMPLER_KEEP", + "unset | PrioritySampling.UNSET | SamplingMechanism.DEFAULT | PrioritySampling.SAMPLER_KEEP", + "user keep | PrioritySampling.USER_KEEP | SamplingMechanism.MANUAL | PrioritySampling.USER_KEEP ", + "user drop | PrioritySampling.USER_DROP | SamplingMechanism.MANUAL | PrioritySampling.USER_DROP " + }) + void testInjectExtract( + String scenario, + @ConvertWith(PrioritySamplingConverter.class) byte contextPriority, + @ConvertWith(SamplingMechanismConverter.class) byte samplingMechanism, + @ConvertWith(PrioritySamplingConverter.class) byte propagatedPriority) + throws Exception { + io.opentracing.Span span = tracer.buildSpan("some name").start(); + io.opentracing.SpanContext context = span.context(); + Map map = new HashMap<>(); + LocalTextMapAdapter adapter = new LocalTextMapAdapter(map); + + DDSpanContext ddContext = (DDSpanContext) ((OTSpanContext) context).getDelegate(); + ddContext.setSamplingPriority(contextPriority, samplingMechanism); + tracer.inject(context, Format.Builtin.TEXT_MAP, adapter); + + DDTraceId traceId = ((OTSpan) span).getDelegate().spanContext().getTraceId(); + long spanId = ((OTSpan) span).getDelegate().spanContext().getSpanId(); + String expectedTraceparent = + "00-" + + traceId.toHexStringPadded(32) + + "-" + + DDSpanId.toHexStringPadded(spanId) + + "-" + + (propagatedPriority > 0 ? "01" : "00"); + int effectiveSamplingMechanism = contextPriority == UNSET ? AGENT_RATE : samplingMechanism; + String expectedTracestate = + "dd=s:" + + propagatedPriority + + ";p:" + + DDSpanId.toHexStringPadded(spanId) + + (propagatedPriority > 0 ? ";t.dm:-" + effectiveSamplingMechanism : "") + + ";t.tid:" + + traceId.toHexStringPadded(32).substring(0, 16) + + (contextPriority == UNSET ? ";t.ksr:1" : ""); + + Map expectedTextMap = new HashMap<>(); + OTSpanContext otContext = (OTSpanContext) context; + expectedTextMap.put("x-datadog-trace-id", otContext.toTraceId()); + expectedTextMap.put("x-datadog-parent-id", otContext.toSpanId()); + expectedTextMap.put("x-datadog-sampling-priority", String.valueOf(propagatedPriority)); + expectedTextMap.put("traceparent", expectedTraceparent); + expectedTextMap.put("tracestate", expectedTracestate); + + ArrayList datadogTags = new ArrayList<>(); + if (propagatedPriority > 0) { + datadogTags.add("_dd.p.dm=-" + effectiveSamplingMechanism); + } + if (traceId.toHighOrderLong() != 0) { + datadogTags.add( + "_dd.p.tid=" + LongStringUtils.toHexStringPadded(traceId.toHighOrderLong(), 16)); + } + if (contextPriority == UNSET) { + datadogTags.add("_dd.p.ksr=1"); + } + if (!datadogTags.isEmpty()) { + expectedTextMap.put("x-datadog-tags", String.join(",", datadogTags)); + } + + assertEquals(expectedTextMap, map); + + OTSpanContext extract = (OTSpanContext) tracer.extract(Format.Builtin.TEXT_MAP, adapter); + assertEquals(otContext.toTraceId(), extract.toTraceId()); + assertEquals(otContext.toSpanId(), extract.toSpanId()); + assertEquals(propagatedPriority, extract.getDelegate().getSamplingPriority()); + } + + static class LocalTextMapAdapter implements TextMap { + private final Map map; + + LocalTextMapAdapter(Map map) { + this.map = map; + } + + @Override + public Iterator> iterator() { + return map.entrySet().iterator(); + } + + @Override + public void put(String key, String value) { + map.put(key, value); + } + } +} diff --git a/dd-trace-ot/src/ot33CompatibilityTest/groovy/OT33ApiTest.groovy b/dd-trace-ot/src/ot33CompatibilityTest/groovy/OT33ApiTest.groovy deleted file mode 100644 index 0ce61afec90..00000000000 --- a/dd-trace-ot/src/ot33CompatibilityTest/groovy/OT33ApiTest.groovy +++ /dev/null @@ -1,150 +0,0 @@ -import datadog.opentracing.DDTracer -import datadog.trace.api.DDSpanId -import datadog.trace.api.DDTraceId -import datadog.trace.api.internal.util.LongStringUtils -import datadog.trace.common.writer.ListWriter -import datadog.trace.core.DDSpan -import datadog.trace.test.util.DDSpecification -import io.opentracing.Tracer -import io.opentracing.propagation.Format -import io.opentracing.propagation.TextMap -import spock.lang.Subject - -import static datadog.trace.agent.test.asserts.ListWriterAssert.assertTraces -import static datadog.trace.agent.test.utils.TraceUtils.basicSpan -import static datadog.trace.api.sampling.PrioritySampling.SAMPLER_DROP -import static datadog.trace.api.sampling.PrioritySampling.SAMPLER_KEEP -import static datadog.trace.api.sampling.PrioritySampling.UNSET -import static datadog.trace.api.sampling.PrioritySampling.USER_DROP -import static datadog.trace.api.sampling.PrioritySampling.USER_KEEP -import static datadog.trace.api.sampling.SamplingMechanism.AGENT_RATE -import static datadog.trace.api.sampling.SamplingMechanism.DEFAULT -import static datadog.trace.api.sampling.SamplingMechanism.MANUAL - -// This test focuses on things that are different between OpenTracing API 0.32.0 and 0.33.0 -class OT33ApiTest extends DDSpecification { - def writer = new ListWriter() - - @Subject - Tracer tracer = DDTracer.builder().writer(writer).build() - - def cleanup() { - tracer?.close() - } - - def "test start"() { - when: - def span = tracer.buildSpan("some name").start() - def scope = tracer.activateSpan(span) - scope.close() - - then: - (scope.span().delegate as DDSpan).isFinished() == false - assertTraces(writer, 0) {} - - when: - span.finish() - - then: - assertTraces(writer, 1) { - trace(1) { - basicSpan(it, "some name") - } - } - } - - def "test scopemanager"() { - setup: - def coreTracer = tracer.tracer - - when: - def span = tracer.buildSpan("some name").start() - def scope = tracer.scopeManager().activate(span) - - then: - tracer.activeSpan().delegate == span.delegate - coreTracer.activeSpan() == span.delegate - - cleanup: - scope.close() - span.finish() - } - - def "test inject extract"() { - setup: - def span = tracer.buildSpan("some name").start() - def context = span.context() - def textMap = [:] - def adapter = new TextMapAdapter(textMap) - - when: - context.delegate.setSamplingPriority(contextPriority, samplingMechanism) - tracer.inject(context, Format.Builtin.TEXT_MAP, adapter) - - then: - def traceId = span.delegate.context.traceId as DDTraceId - def spanId = span.delegate.context.spanId - def expectedTraceparent = "00-${traceId.toHexStringPadded(32)}" + - "-${DDSpanId.toHexStringPadded(spanId)}" + - "-" + (propagatedPriority > 0 ? "01" : "00") - def effectiveSamplingMechanism = contextPriority == UNSET ? AGENT_RATE : samplingMechanism - def expectedTracestate = "dd=s:${propagatedPriority};p:${DDSpanId.toHexStringPadded(spanId)}" + - (propagatedPriority > 0 ? ";t.dm:-" + effectiveSamplingMechanism : "") + - ";t.tid:${traceId.toHexStringPadded(32).substring(0, 16)}" + - (contextPriority == UNSET ? ";t.ksr:1" : "") - def expectedTextMap = [ - "x-datadog-trace-id" : context.toTraceId(), - "x-datadog-parent-id" : context.toSpanId(), - "x-datadog-sampling-priority": propagatedPriority.toString(), - "traceparent" : expectedTraceparent, - "tracestate" : expectedTracestate, - ] - def datadogTags = [] - if (propagatedPriority > 0) { - datadogTags << "_dd.p.dm=-$effectiveSamplingMechanism" - } - if (traceId.toHighOrderLong() != 0) { - datadogTags << "_dd.p.tid=" + LongStringUtils.toHexStringPadded(traceId.toHighOrderLong(), 16) - } - if (contextPriority == UNSET) { - datadogTags << "_dd.p.ksr=1" - } - if (!datadogTags.empty) { - expectedTextMap.put("x-datadog-tags", datadogTags.join(',')) - } - textMap == expectedTextMap - when: - def extract = tracer.extract(Format.Builtin.TEXT_MAP, adapter) - - then: - extract.toTraceId() == context.toTraceId() - extract.toSpanId() == context.toSpanId() - extract.delegate.samplingPriority == propagatedPriority - - where: - contextPriority | samplingMechanism | propagatedPriority | propagatedMechanism | samplingRate - SAMPLER_DROP | DEFAULT | SAMPLER_DROP | DEFAULT | null - SAMPLER_KEEP | DEFAULT | SAMPLER_KEEP | DEFAULT | null - UNSET | DEFAULT | SAMPLER_KEEP | AGENT_RATE | 1 - USER_KEEP | MANUAL | USER_KEEP | MANUAL | null - USER_DROP | MANUAL | USER_DROP | MANUAL | null - } - - static class TextMapAdapter implements TextMap { - private final Map map - - TextMapAdapter(Map map) { - this.map = map - } - - @Override - Iterator> iterator() { - return map.entrySet().iterator() - } - - @Override - void put(String key, String value) { - map.put(key, value) - } - } -} diff --git a/dd-trace-ot/src/ot33CompatibilityTest/java/datadog/opentracing/OT33ApiTest.java b/dd-trace-ot/src/ot33CompatibilityTest/java/datadog/opentracing/OT33ApiTest.java new file mode 100644 index 00000000000..a2d6270bb3a --- /dev/null +++ b/dd-trace-ot/src/ot33CompatibilityTest/java/datadog/opentracing/OT33ApiTest.java @@ -0,0 +1,165 @@ +package datadog.opentracing; + +import static datadog.trace.api.sampling.PrioritySampling.UNSET; +import static datadog.trace.api.sampling.SamplingMechanism.AGENT_RATE; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; + +import datadog.trace.api.DDSpanId; +import datadog.trace.api.DDTraceId; +import datadog.trace.api.internal.util.LongStringUtils; +import datadog.trace.common.writer.ListWriter; +import datadog.trace.core.DDSpanContext; +import datadog.trace.test.junit.utils.converter.PrioritySamplingConverter; +import datadog.trace.test.junit.utils.converter.SamplingMechanismConverter; +import datadog.trace.test.util.DDJavaSpecification; +import io.opentracing.Scope; +import io.opentracing.Tracer; +import io.opentracing.propagation.Format; +import io.opentracing.propagation.TextMap; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.converter.ConvertWith; +import org.tabletest.junit.TableTest; + +// This test focuses on things that are different between OpenTracing API 0.32.0 and 0.33.0 +class OT33ApiTest extends DDJavaSpecification { + + private final ListWriter writer = new ListWriter(); + private final Tracer tracer = DDTracer.builder().writer(writer).build(); + + @AfterEach + void cleanup() throws Exception { + if (tracer != null) { + ((DDTracer) tracer).close(); + } + } + + @Test + void testStart() throws Exception { + io.opentracing.Span span = tracer.buildSpan("some name").start(); + Scope scope = tracer.activateSpan(span); + scope.close(); + + assertFalse(((datadog.trace.core.DDSpan) ((OTSpan) span).getDelegate()).isFinished()); + assertEquals(0, writer.size()); + + span.finish(); + + writer.waitForTraces(1); + assertEquals(1, writer.size()); + assertEquals("some name", writer.get(0).get(0).getOperationName()); + } + + @Test + void testScopeManager() { + datadog.trace.bootstrap.instrumentation.api.AgentTracer.TracerAPI coreTracer = + ((DDTracer) tracer).getInternalTracer(); + + io.opentracing.Span span = tracer.buildSpan("some name").start(); + Scope scope = tracer.scopeManager().activate(span); + + assertEquals(span, tracer.activeSpan()); + assertEquals(((OTSpan) span).getDelegate(), coreTracer.activeSpan()); + + scope.close(); + span.finish(); + } + + @ParameterizedTest + @TableTest({ + "scenario | contextPriority | samplingMechanism | propagatedPriority ", + "sampler drop | PrioritySampling.SAMPLER_DROP | SamplingMechanism.DEFAULT | PrioritySampling.SAMPLER_DROP", + "sampler keep | PrioritySampling.SAMPLER_KEEP | SamplingMechanism.DEFAULT | PrioritySampling.SAMPLER_KEEP", + "unset | PrioritySampling.UNSET | SamplingMechanism.DEFAULT | PrioritySampling.SAMPLER_KEEP", + "user keep | PrioritySampling.USER_KEEP | SamplingMechanism.MANUAL | PrioritySampling.USER_KEEP ", + "user drop | PrioritySampling.USER_DROP | SamplingMechanism.MANUAL | PrioritySampling.USER_DROP " + }) + void testInjectExtract( + String scenario, + @ConvertWith(PrioritySamplingConverter.class) byte contextPriority, + @ConvertWith(SamplingMechanismConverter.class) byte samplingMechanism, + @ConvertWith(PrioritySamplingConverter.class) byte propagatedPriority) + throws Exception { + io.opentracing.Span span = tracer.buildSpan("some name").start(); + io.opentracing.SpanContext context = span.context(); + Map map = new HashMap<>(); + LocalTextMapAdapter adapter = new LocalTextMapAdapter(map); + + DDSpanContext ddContext = (DDSpanContext) ((OTSpanContext) context).getDelegate(); + ddContext.setSamplingPriority(contextPriority, samplingMechanism); + tracer.inject(context, Format.Builtin.TEXT_MAP, adapter); + + DDTraceId traceId = ((OTSpan) span).getDelegate().spanContext().getTraceId(); + long spanId = ((OTSpan) span).getDelegate().spanContext().getSpanId(); + String expectedTraceparent = + "00-" + + traceId.toHexStringPadded(32) + + "-" + + DDSpanId.toHexStringPadded(spanId) + + "-" + + (propagatedPriority > 0 ? "01" : "00"); + int effectiveSamplingMechanism = contextPriority == UNSET ? AGENT_RATE : samplingMechanism; + String expectedTracestate = + "dd=s:" + + propagatedPriority + + ";p:" + + DDSpanId.toHexStringPadded(spanId) + + (propagatedPriority > 0 ? ";t.dm:-" + effectiveSamplingMechanism : "") + + ";t.tid:" + + traceId.toHexStringPadded(32).substring(0, 16) + + (contextPriority == UNSET ? ";t.ksr:1" : ""); + + Map expectedTextMap = new HashMap<>(); + expectedTextMap.put("x-datadog-trace-id", context.toTraceId()); + expectedTextMap.put("x-datadog-parent-id", context.toSpanId()); + expectedTextMap.put("x-datadog-sampling-priority", String.valueOf(propagatedPriority)); + expectedTextMap.put("traceparent", expectedTraceparent); + expectedTextMap.put("tracestate", expectedTracestate); + + ArrayList datadogTags = new ArrayList<>(); + if (propagatedPriority > 0) { + datadogTags.add("_dd.p.dm=-" + effectiveSamplingMechanism); + } + if (traceId.toHighOrderLong() != 0) { + datadogTags.add( + "_dd.p.tid=" + LongStringUtils.toHexStringPadded(traceId.toHighOrderLong(), 16)); + } + if (contextPriority == UNSET) { + datadogTags.add("_dd.p.ksr=1"); + } + if (!datadogTags.isEmpty()) { + expectedTextMap.put("x-datadog-tags", String.join(",", datadogTags)); + } + + assertEquals(expectedTextMap, map); + + io.opentracing.SpanContext extract = tracer.extract(Format.Builtin.TEXT_MAP, adapter); + assertEquals(context.toTraceId(), extract.toTraceId()); + assertEquals(context.toSpanId(), extract.toSpanId()); + assertEquals(propagatedPriority, ((OTSpanContext) extract).getDelegate().getSamplingPriority()); + } + + static class LocalTextMapAdapter implements TextMap { + private final Map map; + + LocalTextMapAdapter(Map map) { + this.map = map; + } + + @Override + public Iterator> iterator() { + return map.entrySet().iterator(); + } + + @Override + public void put(String key, String value) { + map.put(key, value); + } + } +} diff --git a/dd-trace-ot/src/test/groovy/datadog/opentracing/DDTracerAPITest.groovy b/dd-trace-ot/src/test/groovy/datadog/opentracing/DDTracerAPITest.groovy deleted file mode 100644 index 28a77e89cdc..00000000000 --- a/dd-trace-ot/src/test/groovy/datadog/opentracing/DDTracerAPITest.groovy +++ /dev/null @@ -1,33 +0,0 @@ -package datadog.opentracing - - -import datadog.trace.common.sampling.RateByServiceTraceSampler -import datadog.trace.common.writer.ListWriter -import datadog.trace.test.util.DDSpecification - -import static datadog.trace.api.ConfigDefaults.DEFAULT_SERVICE_NAME -import static datadog.trace.api.DDTags.LANGUAGE_TAG_KEY -import static datadog.trace.api.DDTags.LANGUAGE_TAG_VALUE -import static datadog.trace.api.DDTags.RUNTIME_ID_TAG - -class DDTracerAPITest extends DDSpecification { - def "verify sampler/writer constructor"() { - setup: - def writer = new ListWriter() - def sampler = new RateByServiceTraceSampler() - - when: - def tracerOT = new DDTracer(DEFAULT_SERVICE_NAME, writer, sampler) - def tracer = tracerOT.tracer - - then: - tracer.serviceName == DEFAULT_SERVICE_NAME - tracer.initialSampler == sampler - tracer.writer == writer - tracer.localRootSpanTags[RUNTIME_ID_TAG].size() > 0 // not null or empty - tracer.localRootSpanTags[LANGUAGE_TAG_KEY] == LANGUAGE_TAG_VALUE - - cleanup: - tracer.close() - } -} diff --git a/dd-trace-ot/src/test/groovy/datadog/opentracing/DDTracerTest.groovy b/dd-trace-ot/src/test/groovy/datadog/opentracing/DDTracerTest.groovy deleted file mode 100644 index 7a3ba7b377e..00000000000 --- a/dd-trace-ot/src/test/groovy/datadog/opentracing/DDTracerTest.groovy +++ /dev/null @@ -1,96 +0,0 @@ -package datadog.opentracing - -import datadog.trace.common.sampling.Sampler -import datadog.trace.common.writer.DDAgentWriter -import datadog.trace.common.writer.ListWriter -import datadog.trace.common.writer.Writer -import datadog.trace.test.util.DDSpecification - -class DDTracerTest extends DDSpecification { - - def "test tracer builder"() { - when: - def tracer = DDTracer.builder().build() - - then: - tracer != null - - cleanup: - tracer.close() - } - - def "test deprecated tracer constructor"() { - setup: - def tracers = [] - - when: - tracers << new DDTracer() - tracers << new DDTracer('serviceName') - tracers << new DDTracer('serviceName', Mock(Writer), Mock(Sampler)) - tracers << new DDTracer('serviceName', Mock(Writer), Mock(Sampler), [:]) - tracers << new DDTracer(Mock(Writer)) - - then: - tracers.each { assert it != null } - } - - def "test tracer builder with default writer"() { - when: - def tracer = DDTracer.builder().writer(DDAgentWriter.builder().build()).build() - - then: - tracer != null - - cleanup: - tracer.close() - } - - def "test access to TraceSegment"() { - when: - def tracer = DDTracer.builder().writer(DDAgentWriter.builder().build()).build() - def span = tracer.buildSpan("some name").start() - def scope = tracer.scopeManager().activate(span) - - then: - tracer != null - tracer.activeSpan().delegate == span.delegate - - when: - def seg = tracer.getTraceSegment() - - then: - seg != null - scope.close() - - cleanup: - tracer.close() - } - - def "should produce blackhole scopes"() { - setup: - def writer = new ListWriter() - def tracer = DDTracer.builder().writer(writer).build() - - when: - def span = tracer.buildSpan("some name").start() - def scope = tracer.scopeManager().activate(span) - def muteScope = tracer.muteTracing() - def blackholed = tracer.buildSpan("hidden span").start() - blackholed.finish() - muteScope.close() - def visibleSpan = tracer.buildSpan("visible span").start() - visibleSpan.finish() - scope.close() - span.finish() - - then: - writer.waitForTraces(1) - assert writer.size() == 1 - assert writer.firstTrace().size() == 2 - assert Long.toString(writer.firstTrace()[0].context().getSpanId()) == span.context().toSpanId() - assert Long.toString(writer.firstTrace()[1].context().getSpanId()) == visibleSpan.context().toSpanId() - - cleanup: - tracer.close() - } -} diff --git a/dd-trace-ot/src/test/groovy/datadog/opentracing/DefaultLogHandlerTest.groovy b/dd-trace-ot/src/test/groovy/datadog/opentracing/DefaultLogHandlerTest.groovy deleted file mode 100644 index a26db4d7ee9..00000000000 --- a/dd-trace-ot/src/test/groovy/datadog/opentracing/DefaultLogHandlerTest.groovy +++ /dev/null @@ -1,291 +0,0 @@ -package datadog.opentracing - -import datadog.trace.api.DDTags -import datadog.trace.common.writer.ListWriter -import datadog.trace.core.CoreTracer -import datadog.trace.core.DDSpan -import datadog.trace.test.util.DDSpecification -import io.opentracing.Span -import io.opentracing.log.Fields - -class DefaultLogHandlerTest extends DDSpecification { - def writer = new ListWriter() - def tracer = CoreTracer.builder().writer(writer).build() - - def cleanup() { - tracer?.close() - } - - def "handles correctly the error passed in the fields"() { - setup: - final LogHandler underTest = new DefaultLogHandler() - final DDSpan span = tracer.buildSpan("op name").withServiceName("foo").start() - final String errorMessage = "errorMessage" - final String differentMessage = "differentMessage" - final Throwable error = new Throwable(errorMessage) - final Map fields = new HashMap<>() - fields.put(Fields.ERROR_OBJECT, error) - fields.put(Fields.MESSAGE, differentMessage) - - when: - underTest.log(fields, span) - - then: - span.getTags().get(DDTags.ERROR_MSG) == error.getMessage() - span.getTags().get(DDTags.ERROR_TYPE) == error.getClass().getName() - } - - def "handles correctly the error passed in the fields when called with timestamp"() { - setup: - final LogHandler underTest = new DefaultLogHandler() - final DDSpan span = tracer.buildSpan("op name").withServiceName("foo").start() - final String errorMessage = "errorMessage" - final String differentMessage = "differentMessage" - final Throwable error = new Throwable(errorMessage) - final Map fields = new HashMap<>() - fields.put(Fields.ERROR_OBJECT, error) - fields.put(Fields.MESSAGE, differentMessage) - - when: - underTest.log(System.currentTimeMillis(), fields, span) - - then: - span.getTags().get(DDTags.ERROR_MSG) == error.getMessage() - span.getTags().get(DDTags.ERROR_TYPE) == error.getClass().getName() - } - - def "handles correctly the message passed in the fields but the span is not an error"() { - setup: - final LogHandler underTest = new DefaultLogHandler() - final DDSpan span = tracer.buildSpan("op name").withServiceName("foo").start() - final String errorMessage = "errorMessage" - final Map fields = new HashMap<>() - fields.put(Fields.MESSAGE, errorMessage) - - when: - underTest.log(fields, span) - - then: - span.getTags().get(DDTags.ERROR_MSG) is null - } - - def "handles correctly the message passed in the fields when called with timestamp but the span is not an error"() { - setup: - final LogHandler underTest = new DefaultLogHandler() - final DDSpan span = tracer.buildSpan("op name").withServiceName("foo").start() - final String errorMessage = "errorMessage" - final Map fields = new HashMap<>() - fields.put(Fields.MESSAGE, errorMessage) - - when: - underTest.log(System.currentTimeMillis(), fields, span) - - then: - span.getTags().get(DDTags.ERROR_MSG) is null - } - - def "handles correctly the message passed in the fields when the span is error"() { - setup: - final LogHandler underTest = new DefaultLogHandler() - final DDSpan span = tracer.buildSpan("op name").withServiceName("foo").start() - final String errorMessage = "errorMessage" - final Map fields = new HashMap<>() - span.setError(true) - fields.put(Fields.MESSAGE, errorMessage) - - when: - underTest.log(fields, span) - - then: - span.getTags().get(DDTags.ERROR_MSG) == errorMessage - } - - def "handles correctly the message passed in the fields when called with timestamp when the span is error"() { - setup: - final LogHandler underTest = new DefaultLogHandler() - final DDSpan span = tracer.buildSpan("op name").withServiceName("foo").start() - final String errorMessage = "errorMessage" - final Map fields = new HashMap<>() - span.setError(true) - fields.put(Fields.MESSAGE, errorMessage) - - when: - underTest.log(System.currentTimeMillis(), fields, span) - - then: - span.getTags().get(DDTags.ERROR_MSG) == errorMessage - } - - def "handles correctly the message passed in the fields when the event is error"() { - setup: - final LogHandler underTest = new DefaultLogHandler() - final DDSpan span = tracer.buildSpan("op name").withServiceName("foo").start() - final String errorMessage = "errorMessage" - final Map fields = new HashMap<>() - fields.put(Fields.EVENT, "error") - fields.put(Fields.MESSAGE, errorMessage) - - when: - underTest.log(fields, span) - - then: - span.getTags().get(DDTags.ERROR_MSG) == errorMessage - } - - def "handles correctly the message passed in the fields when called with timestampwhen the event is error"() { - setup: - final LogHandler underTest = new DefaultLogHandler() - final DDSpan span = tracer.buildSpan("op name").withServiceName("foo").start() - final String errorMessage = "errorMessage" - final Map fields = new HashMap<>() - fields.put(Fields.EVENT, "error") - fields.put(Fields.MESSAGE, errorMessage) - - when: - underTest.log(System.currentTimeMillis(), fields, span) - - then: - span.getTags().get(DDTags.ERROR_MSG) == errorMessage - } - - def "sanity test with loghandler not set"() { - setup: - final String expectedName = "fakeName" - final String expectedLogEvent = "fakeEvent" - final timeStamp = System.currentTimeMillis() - final Map fieldsMap = new HashMap<>() - - when: - def loggingTracer = DDTracer.builder().writer(writer).build() - final Span span = loggingTracer - .buildSpan(expectedName) - .withServiceName("foo") - .start() - - span.log(expectedLogEvent) - span.log(timeStamp, expectedLogEvent) - span.log(fieldsMap) - span.log(timeStamp, fieldsMap) - - then: - noExceptionThrown() - - cleanup: - loggingTracer.close() - } - - def "sanity test when passed log handler is null"() { - setup: - final String expectedName = "fakeName" - final String expectedLogEvent = "fakeEvent" - final timeStamp = System.currentTimeMillis() - final Map fieldsMap = new HashMap<>() - - when: - def loggingTracer = DDTracer.builder().writer(writer).logHandler(null).build() - final Span span = loggingTracer - .buildSpan(expectedName) - .start() - - span.log(expectedLogEvent) - span.log(timeStamp, expectedLogEvent) - span.log(fieldsMap) - span.log(timeStamp, fieldsMap) - - then: - noExceptionThrown() - - cleanup: - loggingTracer.close() - } - - def "should delegate simple logs to logHandler"() { - setup: - def logHandler = Mock(LogHandler) - final String expectedName = "fakeName" - final String expectedLogEvent = "fakeEvent" - final timeStamp = System.currentTimeMillis() - - def loggingTracer = DDTracer.builder().writer(writer).logHandler(logHandler).build() - def span = loggingTracer - .buildSpan(expectedName) - .withServiceName("foo") - .start() - - when: - span.log(timeStamp, expectedLogEvent) - - then: - 1 * logHandler.log(timeStamp, expectedLogEvent, span.delegate) - - cleanup: - loggingTracer.close() - } - - def "should delegate simple logs with timestamp to logHandler"() { - setup: - def logHandler = Mock(LogHandler) - final String expectedName = "fakeName" - final String expectedLogEvent = "fakeEvent" - - def loggingTracer = DDTracer.builder().writer(writer).logHandler(logHandler).build() - def span = loggingTracer - .buildSpan(expectedName) - .withServiceName("foo") - .start() - - when: - span.log(expectedLogEvent) - - then: - 1 * logHandler.log(expectedLogEvent, span.delegate) - - cleanup: - loggingTracer.close() - } - - def "should delegate logs with fields to logHandler"() { - setup: - def logHandler = Mock(LogHandler) - final String expectedName = "fakeName" - final Map fieldsMap = new HashMap<>() - - def loggingTracer = DDTracer.builder().writer(writer).logHandler(logHandler).build() - def span = loggingTracer - .buildSpan(expectedName) - .withServiceName("foo") - .start() - - when: - span.log(fieldsMap) - - then: - 1 * logHandler.log(fieldsMap, span.delegate) - - cleanup: - loggingTracer.close() - } - - def "should delegate logs with fields and timestamp to logHandler"() { - setup: - def logHandler = Mock(LogHandler) - final String expectedName = "fakeName" - final Map fieldsMap = new HashMap<>() - final timeStamp = System.currentTimeMillis() - - def loggingTracer = DDTracer.builder().writer(writer).logHandler(logHandler).build() - def span = loggingTracer - .buildSpan(expectedName) - .withServiceName("foo") - .start() - - when: - span.log(timeStamp, fieldsMap) - - then: - 1 * logHandler.log(timeStamp, fieldsMap, span.delegate) - - cleanup: - loggingTracer.close() - } -} diff --git a/dd-trace-ot/src/test/groovy/datadog/opentracing/IterationSpansForkedTest.groovy b/dd-trace-ot/src/test/groovy/datadog/opentracing/IterationSpansForkedTest.groovy deleted file mode 100644 index cf61c263206..00000000000 --- a/dd-trace-ot/src/test/groovy/datadog/opentracing/IterationSpansForkedTest.groovy +++ /dev/null @@ -1,212 +0,0 @@ -package datadog.opentracing - -import datadog.metrics.api.statsd.StatsDClient -import datadog.trace.bootstrap.instrumentation.api.AgentSpan -import datadog.trace.common.writer.ListWriter -import datadog.trace.core.CoreTracer -import datadog.trace.core.DDSpan -import datadog.trace.test.util.DDSpecification -import io.opentracing.ScopeManager - -class IterationSpansForkedTest extends DDSpecification { - ListWriter writer - DDTracer tracer - ScopeManager scopeManager - StatsDClient statsDClient - CoreTracer coreTracer - - def setup() { - injectSysConfig("dd.trace.scope.iteration.keep.alive", "1") - - writer = new ListWriter() - statsDClient = Mock() - tracer = DDTracer.builder().writer(writer).statsDClient(statsDClient).build() - scopeManager = tracer.scopeManager() - coreTracer = tracer.tracer - } - - def cleanup() { - coreTracer.close() - } - - def "root iteration scope lifecycle"() { - when: - coreTracer.closePrevious(true) - def span1 = coreTracer.buildSpan("next1").start() - def scope1 = coreTracer.activateNext(span1) - - then: - writer.empty - - and: - scope1.span() == span1 - scopeManager.active().span().delegate == span1 - !spanFinished(span1) - - when: - coreTracer.closePrevious(true) - def span2 = coreTracer.buildSpan("next2").start() - def scope2 = coreTracer.activateNext(span2) - - then: - spanFinished(span1) - writer == [[span1]] - - and: - scope2.span() == span2 - scopeManager.active().span().delegate == span2 - !spanFinished(span2) - - when: - coreTracer.closePrevious(true) - def span3 = coreTracer.buildSpan("next3").start() - def scope3 = coreTracer.activateNext(span3) - writer.waitForTraces(2) - - then: - spanFinished(span2) - writer == [[span1], [span2]] - - and: - scope3.span() == span3 - scopeManager.active().span().delegate == span3 - !spanFinished(span3) - - when: - // 'next3' should time out & finish after 1s - writer.waitForTraces(3) - - then: - spanFinished(span3) - writer == [[span1], [span2], [span3]] - } - - def "non-root iteration scope lifecycle"() { - setup: - def span0 = coreTracer.buildSpan("parent").start() - def scope0 = coreTracer.activateSpan(span0) - - when: - coreTracer.closePrevious(true) - def span1 = coreTracer.buildSpan("next1").start() - def scope1 = coreTracer.activateNext(span1) - - then: - writer.empty - - and: - scope1.span() == span1 - scopeManager.active().span().delegate == span1 - !spanFinished(span1) - - when: - coreTracer.closePrevious(true) - def span2 = coreTracer.buildSpan("next2").start() - def scope2 = coreTracer.activateNext(span2) - - then: - spanFinished(span1) - writer.empty - - and: - scope2.span() == span2 - scopeManager.active().span().delegate == span2 - !spanFinished(span2) - - when: - coreTracer.closePrevious(true) - def span3 = coreTracer.buildSpan("next3").start() - def scope3 = coreTracer.activateNext(span3) - - then: - spanFinished(span2) - writer.empty - - and: - scope3.span() == span3 - scopeManager.active().span().delegate == span3 - !spanFinished(span3) - - // close and finish the surrounding (non-iteration) span to complete the trace - scope0.close() - span0.finish() - writer.waitForTraces(1) - - then: - spanFinished(span3) - spanFinished(span0) - sortSpansByStart() - writer == [[span0, span1, span2, span3]] - } - - def "nested iteration scope lifecycle"() { - when: - coreTracer.closePrevious(true) - def span1 = coreTracer.buildSpan("next1").start() - def scope1 = coreTracer.activateNext(span1) - - then: - writer.empty - - and: - scope1.span() == span1 - scopeManager.active().span().delegate == span1 - !spanFinished(span1) - - when: - def span1A = coreTracer.buildSpan("methodA").start() - def scope1A = coreTracer.activateSpan(span1A) - - and: - coreTracer.closePrevious(true) - def span1A1 = coreTracer.buildSpan("next1A1").start() - def scope1A1 = coreTracer.activateNext(span1A1) - - then: - !spanFinished(span1) - writer.empty - - and: - scope1A1.span() == span1A1 - scopeManager.active().span().delegate == span1A1 - !spanFinished(span1A1) - - when: - coreTracer.closePrevious(true) - def span1A2 = coreTracer.buildSpan("next1A2").start() - def scope1A2 = coreTracer.activateNext(span1A2) - - then: - spanFinished(span1A1) - writer.empty - - and: - scope1A2.span() == span1A2 - scopeManager.active().span().delegate == span1A2 - !spanFinished(span1A2) - - when: - // close and finish the intermediate (non-iteration) span - scope1A.close() - span1A.finish() - // 'next1' (and 'next1A2') should time out & finish after 1s to complete the trace - writer.waitForTraces(1) - - then: - spanFinished(span1A2) - spanFinished(span1A) - spanFinished(span1) - sortSpansByStart() - writer == [[span1, span1A, span1A1, span1A2]] - } - - boolean spanFinished(AgentSpan span) { - return ((DDSpan) span)?.isFinished() - } - - private List sortSpansByStart() { - writer.firstTrace().sort { a, b -> - return a.startTimeNano <=> b.startTimeNano - } - } -} diff --git a/dd-trace-ot/src/test/groovy/datadog/opentracing/OTSpanTest.groovy b/dd-trace-ot/src/test/groovy/datadog/opentracing/OTSpanTest.groovy deleted file mode 100644 index 0b9ffa40f6a..00000000000 --- a/dd-trace-ot/src/test/groovy/datadog/opentracing/OTSpanTest.groovy +++ /dev/null @@ -1,46 +0,0 @@ -package datadog.opentracing - -import datadog.trace.api.interceptor.MutableSpan -import datadog.trace.bootstrap.instrumentation.api.ResourceNamePriorities -import datadog.trace.test.util.DDSpecification -import io.opentracing.Scope -import io.opentracing.Span -import spock.lang.Shared - -class OTSpanTest extends DDSpecification { - @Shared - DDTracer tracer = DDTracer.builder().build() - - def cleanup() { - tracer?.close() - } - - def "test resource name assignment through MutableSpan casting"() { - given: - OTSpan testSpan = tracer.buildSpan("parent").withResourceName("test-resource").start() as OTSpan - OTScopeManager.OTScope testScope = tracer.activateSpan(testSpan) as OTScopeManager.OTScope - - when: - Span active = tracer.activeSpan() - Span child = tracer.buildSpan("child").asChildOf(active).start() - Scope scope = tracer.activateSpan(child) - - MutableSpan localRootSpan = ((MutableSpan) child).getLocalRootSpan() - localRootSpan.setResourceName("correct-resource") - - then: - testSpan.getResourceName() == "correct-resource" - - when: - testSpan.delegate.setResourceName("should-be-ignored", ResourceNamePriorities.HTTP_FRAMEWORK_ROUTE) - - then: - testSpan.getResourceName() == "correct-resource" - - cleanup: - scope.close() - child.finish() - testScope.close() - testSpan.finish() - } -} diff --git a/dd-trace-ot/src/test/groovy/datadog/opentracing/OpenTracingAPITest.groovy b/dd-trace-ot/src/test/groovy/datadog/opentracing/OpenTracingAPITest.groovy deleted file mode 100644 index bc73a1b80df..00000000000 --- a/dd-trace-ot/src/test/groovy/datadog/opentracing/OpenTracingAPITest.groovy +++ /dev/null @@ -1,541 +0,0 @@ -package datadog.opentracing - -import datadog.trace.api.DDTags -import datadog.trace.api.config.TracerConfig -import datadog.trace.api.interceptor.MutableSpan -import datadog.trace.api.interceptor.TraceInterceptor -import datadog.trace.api.scopemanager.ScopeListener -import datadog.trace.bootstrap.instrumentation.api.AgentTracer -import datadog.trace.common.writer.ListWriter -import datadog.trace.context.TraceScope -import datadog.trace.test.util.DDSpecification -import io.opentracing.Scope -import io.opentracing.Span -import io.opentracing.SpanContext -import io.opentracing.propagation.Format -import io.opentracing.propagation.TextMapAdapter -import io.opentracing.tag.Tags - -import static datadog.trace.agent.test.asserts.ListWriterAssert.assertTraces - -class OpenTracingAPITest extends DDSpecification { - def writer = new ListWriter() - - def tracer = DDTracer.builder().writer(writer).build() - - def traceInterceptor = Mock(TraceInterceptor) - def scopeListener = Mock(ScopeListener) - - def setup() { - assert tracer.scopeManager().active() == null - tracer.addTraceInterceptor(traceInterceptor) - tracer.tracer.addScopeListener(scopeListener) - } - - def cleanup() { - tracer.close() - } - - def "tracer/scopeManager returns null for no active span"() { - expect: - tracer.activeSpan() == null - tracer.scopeManager().active() == null - tracer.scopeManager().activeSpan() == null - } - - def "single span"() { - when: - Scope scope - try { - scope = tracer.buildSpan("someOperation").startActive(true) - scope.span().setTag(DDTags.SERVICE_NAME, "someService") - } finally { - scope.close() - } - writer.waitForTraces(1) - - then: - 1 * traceInterceptor.onTraceComplete({ it.size() == 1 }) >> { args -> args[0] } - - assertTraces(writer, 1) { - trace(1) { - span { - serviceName "someService" - operationName "someOperation" - resourceName "someOperation" - tags { - "$DDTags.DD_INTEGRATION" "opentracing" - serviceNameSource "m" // service name was manually set - defaultTags() - } - } - } - } - } - - def "span with builder"() { - when: - Span testSpan = tracer.buildSpan("someOperation") - .withTag(Tags.COMPONENT, "opentracing") - .withTag("someBoolean", true) - .withTag("someNumber", 1) - .withTag(DDTags.SERVICE_NAME, "someService") - .start() - - Scope scope - try { - scope = tracer.activateSpan(testSpan) - testSpan.finish() - } finally { - scope.close() - } - writer.waitForTraces(1) - - then: - 1 * traceInterceptor.onTraceComplete({ it.size() == 1 }) >> { args -> args[0] } - testSpan instanceof MutableSpan - - assertTraces(writer, 1) { - trace(1) { - span { - serviceName "someService" - operationName "someOperation" - resourceName "someOperation" - tags { - "$datadog.trace.bootstrap.instrumentation.api.Tags.COMPONENT" "opentracing" - "$DDTags.DD_INTEGRATION" "opentracing" - "someBoolean" true - "someNumber" 1 - serviceNameSource "m" // service name was manually set - defaultTags() - } - } - } - } - } - - def "single span with manual start/finish"() { - when: - Span testSpan = tracer.buildSpan("someOperation").start() - Scope scope = tracer.activateSpan(testSpan) - - then: - 1 * scopeListener.afterScopeActivated() - testSpan instanceof MutableSpan - scope.span() instanceof MutableSpan - - when: - testSpan.setTag(DDTags.SERVICE_NAME, "someService") - testSpan.setTag(Tags.COMPONENT, "opentracing") - testSpan.setTag("someBoolean", true) - testSpan.setTag("someNumber", 1) - testSpan.setOperationName("someOtherOperation") - scope.close() - testSpan.finish() - writer.waitForTraces(1) - - then: - 1 * traceInterceptor.onTraceComplete({ it.size() == 1 }) >> { args -> args[0] } - 1 * scopeListener.afterScopeClosed() - - assertTraces(writer, 1) { - trace(1) { - span { - serviceName "someService" - operationName("someOtherOperation") - resourceName "someOtherOperation" - tags { - "$datadog.trace.bootstrap.instrumentation.api.Tags.COMPONENT" "opentracing" - "$DDTags.DD_INTEGRATION" "opentracing" - "someBoolean" true - "someNumber" 1 - serviceNameSource "m" // service name was manually set - defaultTags() - } - } - } - } - } - - def "spans and scopes all equal"() { - when: - Span testSpan = tracer.buildSpan("someOperation").start() - Scope testScope = tracer.activateSpan(testSpan) - - Span traceActiveSpan = tracer.activeSpan() - Span scopeManagerActiveSpan = tracer.scopeManager().activeSpan() - Span scopeActiveSpan = testScope.span() - - Scope scopeManagerActiveScope = tracer.scopeManager().active() - testScope.close() - testSpan.finish() - writer.waitForTraces(1) - - then: - 1 * traceInterceptor.onTraceComplete({ it.size() == 1 }) >> { args -> args[0] } - testSpan == traceActiveSpan - testSpan.hashCode() == traceActiveSpan.hashCode() - testSpan == scopeManagerActiveSpan - testSpan.hashCode() == scopeManagerActiveSpan.hashCode() - testSpan == scopeActiveSpan - testSpan.hashCode() == scopeActiveSpan.hashCode() - testScope == scopeManagerActiveScope - testScope.hashCode() == scopeManagerActiveScope.hashCode() - } - - def "nested spans"() { - when: - Scope scope - try { - scope = tracer.buildSpan("someOperation").startActive(true) - scope.span().setTag(DDTags.SERVICE_NAME, "someService") - - Scope scope2 - try { - scope2 = tracer.buildSpan("someOperation2").startActive(true) - } finally { - scope2.close() - } - } finally { - scope.close() - } - writer.waitForTraces(1) - - then: - 1 * traceInterceptor.onTraceComplete({ it.size() == 2 }) >> { args -> args[0] } - - assertTraces(writer, 1) { - trace(2) { - span { - serviceName "someService" - operationName "someOperation" - resourceName "someOperation" - tags { - "$DDTags.DD_INTEGRATION" "opentracing" - serviceNameSource "m" // service name was manually set - defaultTags() - } - } - span { - serviceName "someService" - operationName "someOperation2" - resourceName "someOperation2" - childOf(span(0)) - tags { - serviceNameSource "m" // service name was manually set - defaultTags() - } - } - } - } - } - - def "span with async propagation"() { - setup: - AgentTracer.TracerAPI internalTracer = tracer.tracer - - when: - Scope scope = tracer.buildSpan("someOperation") - .withTag(DDTags.SERVICE_NAME, "someService") - .startActive(true) - internalTracer.setAsyncPropagationEnabled(false) - - then: - scope instanceof TraceScope - !internalTracer.isAsyncPropagationEnabled() - - when: - internalTracer.setAsyncPropagationEnabled(true) - TraceScope.Continuation continuation = ((TraceScope) scope).capture() - - then: - internalTracer.isAsyncPropagationEnabled() - continuation != null - - when: - continuation.cancel() - scope.close() - writer.waitForTraces(1) - - then: - 1 * traceInterceptor.onTraceComplete({ it.size() == 1 }) >> { args -> args[0] } - - assertTraces(writer, 1) { - trace(1) { - span { - serviceName "someService" - operationName "someOperation" - resourceName "someOperation" - tags { - "$DDTags.DD_INTEGRATION" "opentracing" - serviceNameSource "m" // service name was manually set - defaultTags() - } - } - } - } - } - - def "span inherits async propagation"() { - setup: - AgentTracer.TracerAPI internalTracer = tracer.tracer - - when: - Scope outer = tracer.buildSpan("someOperation") - .withTag(DDTags.SERVICE_NAME, "someService") - .startActive(true) - internalTracer.setAsyncPropagationEnabled(false) - - then: - !internalTracer.isAsyncPropagationEnabled() - - when: - internalTracer.setAsyncPropagationEnabled(true) - Scope inner = tracer.buildSpan("otherOperation") - .withTag(DDTags.SERVICE_NAME, "otherService") - .startActive(true) - - then: - internalTracer.isAsyncPropagationEnabled() - - when: - inner.close() - outer.close() - writer.waitForTraces(1) - - then: - 1 * traceInterceptor.onTraceComplete({ it.size() == 2 }) >> { args -> args[0] } - - assertTraces(writer, 1) { - trace(2) { - span { - serviceName "someService" - operationName "someOperation" - resourceName "someOperation" - tags { - serviceNameSource "m" // service name was manually set - defaultTags() - } - } - span { - serviceName "otherService" - operationName "otherOperation" - resourceName "otherOperation" - tags { - serviceNameSource "m" // service name was manually set - defaultTags() - } - } - } - } - } - - def "SpanContext ids equal tracer ids"() { - when: - Span testSpan = tracer.buildSpan("someOperation") - .withServiceName("someService") - .start() - Scope scope = tracer.activateSpan(testSpan) - - then: - 1 * scopeListener.afterScopeActivated() - - testSpan.context().toSpanId() == tracer.getSpanId() - testSpan.context().toTraceId() == tracer.tracer.activeSpan().context().traceId.toString() - - when: - scope.close() - testSpan.finish() - writer.waitForTraces(1) - - then: - 1 * traceInterceptor.onTraceComplete({ it.size() == 1 }) >> { args -> args[0] } - 1 * scopeListener.afterScopeClosed() - - assertTraces(writer, 1) { - trace(1) { - span { - serviceName "someService" - operationName "someOperation" - resourceName "someOperation" - tags { - serviceNameSource "m" // service name was manually set - defaultTags() - } - } - } - } - } - - def "closing scope when not on top"() { - when: - Span firstSpan = tracer.buildSpan("someOperation").start() - Scope firstScope = tracer.activateSpan(firstSpan) - - Span secondSpan = tracer.buildSpan("someOperation").start() - Scope secondScope = tracer.activateSpan(secondSpan) - - firstSpan.finish() - firstScope.close() - - then: - 2 * scopeListener.afterScopeActivated() - 0 * _ - - when: - secondSpan.finish() - secondScope.close() - writer.waitForTraces(1) - - then: - 2 * scopeListener.afterScopeClosed() - 1 * traceInterceptor.onTraceComplete({ it.size() == 2 }) >> { args -> args[0] } - 0 * _ - - when: - firstScope.close() - - then: - 0 * _ - } - - def "closing scope when not on top in strict mode"() { - setup: - injectSysConfig(TracerConfig.SCOPE_STRICT_MODE, "true") - DDTracer strictTracer = DDTracer.builder().writer(writer).build() - strictTracer.addTraceInterceptor(traceInterceptor) - strictTracer.tracer.addScopeListener(scopeListener) - - when: - Span firstSpan = strictTracer.buildSpan("someOperation").start() - Scope firstScope = strictTracer.activateSpan(firstSpan) - - Span secondSpan = strictTracer.buildSpan("someOperation").start() - Scope secondScope = strictTracer.activateSpan(secondSpan) - - then: - 2 * scopeListener.afterScopeActivated() - 0 * _ - - when: - firstSpan.finish() - firstScope.close() - - then: - thrown(RuntimeException) - 0 * _ - - when: - secondSpan.finish() - secondScope.close() - writer.waitForTraces(1) - - then: - 1 * scopeListener.afterScopeClosed() - 1 * traceInterceptor.onTraceComplete({ it.size() == 2 }) >> { args -> args[0] } - 1 * scopeListener.afterScopeActivated() - 0 * _ - - when: - firstScope.close() - - then: - 1 * scopeListener.afterScopeClosed() - 0 * _ - - cleanup: - strictTracer?.close() - } - - def "inject and extract context"() { - given: - def textMap = new TextMapAdapter(new HashMap()) - - when: - Span testSpan = tracer.buildSpan("clientOperation") - .withServiceName("someClientService") - .start() - Scope scope = tracer.activateSpan(testSpan) - - tracer.inject(testSpan.context(), Format.Builtin.HTTP_HEADERS, textMap) - - - SpanContext extractedContext = tracer.extract(Format.Builtin.HTTP_HEADERS, textMap) - Span serverSpan = tracer.buildSpan("serverOperation") - .withServiceName("someService") - .asChildOf(extractedContext) - .start() - tracer.activateSpan(serverSpan).close() - serverSpan.finish() - - scope.close() - testSpan.finish() - writer.waitForTraces(2) - - then: - 2 * traceInterceptor.onTraceComplete({ it.size() == 1 }) >> { args -> args[0] } - extractedContext.toTraceId() == testSpan.context().toTraceId() - extractedContext.toSpanId() == testSpan.context().toSpanId() - - assertTraces(writer, 2) { - trace(1) { - span { - serviceName "someClientService" - operationName "clientOperation" - resourceName "clientOperation" - tags { - serviceNameSource "m" // service name was manually set - defaultTags() - } - } - } - trace(1) { - span { - serviceName "someService" - operationName "serverOperation" - resourceName "serverOperation" - childOf(trace(0).get(0)) - tags { - serviceNameSource "m" // service name was manually set - defaultTags(true) - } - } - } - } - } - - def "tolerate null span activation"() { - when: - try { - tracer.scopeManager().activate(null)?.close() - } catch (Exception ignored) {} - - try { - tracer.activateSpan(null)?.close() - } catch (Exception ignored) {} - - // make sure scope stack has been left in a valid state - Span testSpan = tracer.buildSpan("someOperation").withServiceName("someService").start() - Scope testScope = tracer.scopeManager().activate(testSpan) - testSpan.finish() - testScope.close() - writer.waitForTraces(1) - - then: - 1 * traceInterceptor.onTraceComplete({ it.size() == 1 }) >> { args -> args[0] } - - assertTraces(writer, 1) { - trace(1) { - span { - serviceName "someService" - operationName "someOperation" - resourceName "someOperation" - tags { - serviceNameSource "m" // service name was manually set - defaultTags() - } - } - } - } - } -} diff --git a/dd-trace-ot/src/test/groovy/datadog/opentracing/SpanBuilderTest.groovy b/dd-trace-ot/src/test/groovy/datadog/opentracing/SpanBuilderTest.groovy deleted file mode 100644 index 7b4b6c73c9b..00000000000 --- a/dd-trace-ot/src/test/groovy/datadog/opentracing/SpanBuilderTest.groovy +++ /dev/null @@ -1,129 +0,0 @@ -package datadog.opentracing - -import datadog.trace.common.writer.ListWriter -import datadog.trace.test.util.DDSpecification -import io.opentracing.Span - -class SpanBuilderTest extends DDSpecification { - // TODO more io.opentracing.SpanBuilder specific tests - - def writer = new ListWriter() - def tracer = DDTracer.builder().writer(writer).build() - - def cleanup() { - tracer?.close() - } - - def "should inherit the DD parent attributes addReference CHILD_OF"() { - setup: - def expectedName = "fakeName" - def expectedParentServiceName = "fakeServiceName" - def expectedParentResourceName = "fakeResourceName" - def expectedParentType = "fakeType" - def expectedChildServiceName = "fakeServiceName-child" - def expectedChildResourceName = "fakeResourceName-child" - def expectedChildType = "fakeType-child" - def expectedBaggageItemKey = "fakeKey" - def expectedBaggageItemValue = "fakeValue" - - final Span parent = - tracer - .buildSpan(expectedName) - .withServiceName("foo") - .withResourceName(expectedParentResourceName) - .withSpanType(expectedParentType) - .start() - - parent.setBaggageItem(expectedBaggageItemKey, expectedBaggageItemValue) - - // ServiceName and SpanType are always set by the parent if they are not present in the child - Span span = - tracer - .buildSpan(expectedName) - .withServiceName(expectedParentServiceName) - .addReference("child_of", parent.context()) - .start() - - expect: - span.delegate.getOperationName() == expectedName - span.getBaggageItem(expectedBaggageItemKey) == expectedBaggageItemValue - span.context().delegate.getServiceName() == expectedParentServiceName - span.context().delegate.getResourceName() == expectedName - span.context().delegate.getSpanType() == null - - when: - // ServiceName and SpanType are always overwritten by the child if they are present - span = - tracer - .buildSpan(expectedName) - .withServiceName(expectedChildServiceName) - .withResourceName(expectedChildResourceName) - .withSpanType(expectedChildType) - .addReference("child_of", parent.context()) - .start() - - then: - span.delegate.getOperationName() == expectedName - span.getBaggageItem(expectedBaggageItemKey) == expectedBaggageItemValue - span.context().delegate.getServiceName() == expectedChildServiceName - span.context().delegate.getResourceName() == expectedChildResourceName - span.context().delegate.getSpanType() == expectedChildType - } - - - def "should inherit the DD parent attributes add reference FOLLOWS_FROM"() { - setup: - def expectedName = "fakeName" - def expectedParentServiceName = "fakeServiceName" - def expectedParentResourceName = "fakeResourceName" - def expectedParentType = "fakeType" - def expectedChildServiceName = "fakeServiceName-child" - def expectedChildResourceName = "fakeResourceName-child" - def expectedChildType = "fakeType-child" - def expectedBaggageItemKey = "fakeKey" - def expectedBaggageItemValue = "fakeValue" - - final Span parent = - tracer - .buildSpan(expectedName) - .withServiceName("foo") - .withResourceName(expectedParentResourceName) - .withSpanType(expectedParentType) - .start() - - parent.setBaggageItem(expectedBaggageItemKey, expectedBaggageItemValue) - - // ServiceName and SpanType are always set by the parent if they are not present in the child - Span span = - tracer - .buildSpan(expectedName) - .withServiceName(expectedParentServiceName) - .addReference("follows_from", parent.context()) - .start() - - expect: - span.delegate.getOperationName() == expectedName - span.getBaggageItem(expectedBaggageItemKey) == expectedBaggageItemValue - span.context().delegate.getServiceName() == expectedParentServiceName - span.context().delegate.getResourceName() == expectedName - span.context().delegate.getSpanType() == null - - when: - // ServiceName and SpanType are always overwritten by the child if they are present - span = - tracer - .buildSpan(expectedName) - .withServiceName(expectedChildServiceName) - .withResourceName(expectedChildResourceName) - .withSpanType(expectedChildType) - .addReference("follows_from", parent.context()) - .start() - - then: - span.delegate.getOperationName() == expectedName - span.getBaggageItem(expectedBaggageItemKey) == expectedBaggageItemValue - span.context().delegate.getServiceName() == expectedChildServiceName - span.context().delegate.getResourceName() == expectedChildResourceName - span.context().delegate.getSpanType() == expectedChildType - } -} diff --git a/dd-trace-ot/src/test/groovy/datadog/opentracing/TypeConverterTest.groovy b/dd-trace-ot/src/test/groovy/datadog/opentracing/TypeConverterTest.groovy deleted file mode 100644 index 6646832e1bd..00000000000 --- a/dd-trace-ot/src/test/groovy/datadog/opentracing/TypeConverterTest.groovy +++ /dev/null @@ -1,81 +0,0 @@ -package datadog.opentracing - -import datadog.trace.api.DDSpanId -import datadog.trace.api.DDTraceId -import datadog.trace.api.datastreams.NoopPathwayContext -import datadog.trace.api.sampling.PrioritySampling -import datadog.trace.core.CoreTracer -import datadog.trace.core.DDSpan -import datadog.trace.core.DDSpanContext -import datadog.trace.core.PendingTrace -import datadog.trace.core.propagation.PropagationTags -import datadog.trace.test.util.DDSpecification - -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopScope -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpan -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpanContext - -class TypeConverterTest extends DDSpecification { - TypeConverter typeConverter = new TypeConverter(new DefaultLogHandler()) - - def "should avoid the noop span wrapper allocation"() { - def noopAgentSpan = noopSpan() - expect: - typeConverter.toSpan(noopAgentSpan) is typeConverter.toSpan(noopAgentSpan) - } - - def "should avoid extra allocation for a span wrapper"() { - def context = createTestSpanContext() - def span1 = new DDSpan("test", 0, context, null) - def span2 = new DDSpan("test", 0, context, null) - expect: - // return the same wrapper for the same span - typeConverter.toSpan(span1) is typeConverter.toSpan(span1) - // return a distinct wrapper for another span - !typeConverter.toSpan(span1).is(typeConverter.toSpan(span2)) - } - - def "should avoid the noop context wrapper allocation"() { - def noopContext = noopSpanContext() - expect: - typeConverter.toSpanContext(noopContext) is typeConverter.toSpanContext(noopContext) - } - - def "should avoid the noop scope wrapper allocation"() { - def noopScope = noopScope() - expect: - typeConverter.toScope(noopScope, true) is typeConverter.toScope(noopScope, true) - typeConverter.toScope(noopScope, false) is typeConverter.toScope(noopScope, false) - // noop scopes expected to be the same despite the finishSpanOnClose flag - typeConverter.toScope(noopScope, true) is typeConverter.toScope(noopScope, false) - typeConverter.toScope(noopScope, false) is typeConverter.toScope(noopScope, true) - } - - def createTestSpanContext() { - def tracer = Stub(CoreTracer) - def trace = Stub(PendingTrace) - trace.mapServiceName(_) >> { String serviceName -> serviceName } - trace.getTracer() >> tracer - - return new DDSpanContext( - DDTraceId.ONE, - 1, - DDSpanId.ZERO, - null, - "fakeService", - "fakeOperation", - "fakeResource", - PrioritySampling.UNSET, - null, - [:], - false, - "fakeType", - 0, - trace, - null, - null, - NoopPathwayContext.INSTANCE, - false, - PropagationTags.factory().empty()) - } -} diff --git a/dd-trace-ot/src/test/groovy/datadog/opentracing/resolver/DDTracerResolverTest.groovy b/dd-trace-ot/src/test/groovy/datadog/opentracing/resolver/DDTracerResolverTest.groovy deleted file mode 100644 index 828deefaa3c..00000000000 --- a/dd-trace-ot/src/test/groovy/datadog/opentracing/resolver/DDTracerResolverTest.groovy +++ /dev/null @@ -1,34 +0,0 @@ -package datadog.opentracing.resolver - -import datadog.opentracing.DDTracer -import datadog.trace.test.util.DDSpecification -import io.opentracing.contrib.tracerresolver.TracerResolver - -import static datadog.trace.api.config.TracerConfig.TRACE_RESOLVER_ENABLED - -class DDTracerResolverTest extends DDSpecification { - - def resolver = new DDTracerResolver() - - def "test resolveTracer"() { - when: - def tracer = TracerResolver.resolveTracer() - - then: - tracer instanceof DDTracer - - cleanup: - tracer.close() - } - - def "test disable DDTracerResolver"() { - setup: - injectSysConfig(TRACE_RESOLVER_ENABLED, "false") - - when: - def tracer = resolver.resolve() - - then: - tracer == null - } -} diff --git a/dd-trace-ot/src/test/java/datadog/opentracing/DDTracerAPITest.java b/dd-trace-ot/src/test/java/datadog/opentracing/DDTracerAPITest.java new file mode 100644 index 00000000000..a95cb2b360d --- /dev/null +++ b/dd-trace-ot/src/test/java/datadog/opentracing/DDTracerAPITest.java @@ -0,0 +1,61 @@ +package datadog.opentracing; + +import static datadog.trace.api.ConfigDefaults.DEFAULT_SERVICE_NAME; +import static datadog.trace.api.DDTags.LANGUAGE_TAG_KEY; +import static datadog.trace.api.DDTags.LANGUAGE_TAG_VALUE; +import static datadog.trace.api.DDTags.RUNTIME_ID_TAG; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import datadog.trace.common.sampling.RateByServiceTraceSampler; +import datadog.trace.common.writer.ListWriter; +import datadog.trace.core.CoreTracer; +import datadog.trace.test.util.DDJavaSpecification; +import java.lang.reflect.Field; +import org.junit.jupiter.api.Test; + +class DDTracerAPITest extends DDJavaSpecification { + + @Test + void verifySamplerWriterConstructor() throws Exception { + ListWriter writer = new ListWriter(); + RateByServiceTraceSampler sampler = new RateByServiceTraceSampler(); + DDTracer tracerOT = new DDTracer(DEFAULT_SERVICE_NAME, writer, sampler); + try { + AgentTracer.TracerAPI tracerAPI = tracerOT.getInternalTracer(); + CoreTracer tracer = (CoreTracer) tracerAPI; + + assertEquals(DEFAULT_SERVICE_NAME, getField(tracer, "serviceName")); + assertSame(sampler, getField(tracer, "initialSampler")); + assertSame(writer, getField(tracer, "writer")); + + Object localRootSpanTags = getField(tracer, "localRootSpanTags"); + assertNotNull(localRootSpanTags.toString()); + // Verify runtime-id and language tags are populated + assertTrue( + ((java.util.Map) localRootSpanTags).get(RUNTIME_ID_TAG).toString().length() > 0); + assertEquals( + LANGUAGE_TAG_VALUE, ((java.util.Map) localRootSpanTags).get(LANGUAGE_TAG_KEY)); + } finally { + tracerOT.close(); + } + } + + @SuppressWarnings("unchecked") + private static T getField(Object obj, String fieldName) throws Exception { + Class cls = obj.getClass(); + while (cls != null) { + try { + Field field = cls.getDeclaredField(fieldName); + field.setAccessible(true); + return (T) field.get(obj); + } catch (NoSuchFieldException ignored) { + cls = cls.getSuperclass(); + } + } + throw new NoSuchFieldException("Field " + fieldName + " not found on " + obj.getClass()); + } +} diff --git a/dd-trace-ot/src/test/java/datadog/opentracing/DDTracerTest.java b/dd-trace-ot/src/test/java/datadog/opentracing/DDTracerTest.java new file mode 100644 index 00000000000..ff8704e305e --- /dev/null +++ b/dd-trace-ot/src/test/java/datadog/opentracing/DDTracerTest.java @@ -0,0 +1,96 @@ +package datadog.opentracing; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.mockito.Mockito.mock; + +import datadog.trace.common.sampling.Sampler; +import datadog.trace.common.writer.DDAgentWriter; +import datadog.trace.common.writer.ListWriter; +import datadog.trace.common.writer.Writer; +import datadog.trace.context.TraceScope; +import datadog.trace.test.util.DDJavaSpecification; +import io.opentracing.Scope; +import java.util.HashMap; +import org.junit.jupiter.api.Test; + +class DDTracerTest extends DDJavaSpecification { + + @Test + void testTracerBuilder() throws Exception { + DDTracer tracer = DDTracer.builder().build(); + assertNotNull(tracer); + tracer.close(); + } + + @Test + void testDeprecatedTracerConstructor() throws Exception { + DDTracer tracer1 = new DDTracer(); + DDTracer tracer2 = new DDTracer("serviceName"); + DDTracer tracer3 = new DDTracer("serviceName", mock(Writer.class), mock(Sampler.class)); + DDTracer tracer4 = + new DDTracer("serviceName", mock(Writer.class), mock(Sampler.class), new HashMap<>()); + DDTracer tracer5 = new DDTracer(mock(Writer.class)); + + assertNotNull(tracer1); + assertNotNull(tracer2); + assertNotNull(tracer3); + assertNotNull(tracer4); + assertNotNull(tracer5); + + tracer1.close(); + tracer2.close(); + tracer3.close(); + tracer4.close(); + tracer5.close(); + } + + @Test + void testTracerBuilderWithDefaultWriter() throws Exception { + DDTracer tracer = DDTracer.builder().writer(DDAgentWriter.builder().build()).build(); + assertNotNull(tracer); + tracer.close(); + } + + @Test + void testAccessToTraceSegment() throws Exception { + DDTracer tracer = DDTracer.builder().writer(DDAgentWriter.builder().build()).build(); + OTSpan span = (OTSpan) tracer.buildSpan("some name").start(); + try (Scope scope = tracer.scopeManager().activate(span)) { + assertNotNull(tracer); + assertEquals(span, tracer.activeSpan()); + assertNotNull(tracer.getTraceSegment()); + } + + tracer.close(); + } + + @Test + void shouldProduceBlackholeScopes() throws Exception { + ListWriter writer = new ListWriter(); + DDTracer tracer = DDTracer.builder().writer(writer).build(); + + OTSpan span = (OTSpan) tracer.buildSpan("some name").start(); + Scope scope = tracer.scopeManager().activate(span); + TraceScope muteScope = tracer.muteTracing(); + io.opentracing.Span blackholed = tracer.buildSpan("hidden span").start(); + blackholed.finish(); + muteScope.close(); + io.opentracing.Span visibleSpan = tracer.buildSpan("visible span").start(); + visibleSpan.finish(); + scope.close(); + span.finish(); + + writer.waitForTraces(1); + assertEquals(1, writer.size()); + assertEquals(2, writer.firstTrace().size()); + assertEquals( + Long.toString(writer.firstTrace().get(0).spanContext().getSpanId()), + span.context().toSpanId()); + assertEquals( + Long.toString(writer.firstTrace().get(1).spanContext().getSpanId()), + visibleSpan.context().toSpanId()); + + tracer.close(); + } +} diff --git a/dd-trace-ot/src/test/java/datadog/opentracing/DefaultLogHandlerTest.java b/dd-trace-ot/src/test/java/datadog/opentracing/DefaultLogHandlerTest.java new file mode 100644 index 00000000000..3959d8b9af0 --- /dev/null +++ b/dd-trace-ot/src/test/java/datadog/opentracing/DefaultLogHandlerTest.java @@ -0,0 +1,263 @@ +package datadog.opentracing; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + +import datadog.trace.api.DDTags; +import datadog.trace.common.writer.ListWriter; +import datadog.trace.core.CoreTracer; +import datadog.trace.core.DDSpan; +import datadog.trace.test.util.DDJavaSpecification; +import io.opentracing.log.Fields; +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; + +class DefaultLogHandlerTest extends DDJavaSpecification { + + private final ListWriter writer = new ListWriter(); + private final CoreTracer tracer = CoreTracer.builder().writer(writer).build(); + + @AfterEach + void cleanup() throws Exception { + if (tracer != null) { + tracer.close(); + } + } + + @Test + void handlesCorrectlyTheErrorPassedInTheFields() { + LogHandler underTest = new DefaultLogHandler(); + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "op name").withServiceName("foo").start(); + String errorMessage = "errorMessage"; + String differentMessage = "differentMessage"; + Throwable error = new Throwable(errorMessage); + Map fields = new HashMap<>(); + fields.put(Fields.ERROR_OBJECT, error); + fields.put(Fields.MESSAGE, differentMessage); + + underTest.log(fields, span); + + assertEquals(error.getMessage(), span.getTags().get(DDTags.ERROR_MSG)); + assertEquals(error.getClass().getName(), span.getTags().get(DDTags.ERROR_TYPE)); + } + + @Test + void handlesCorrectlyTheErrorPassedInTheFieldsWhenCalledWithTimestamp() { + LogHandler underTest = new DefaultLogHandler(); + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "op name").withServiceName("foo").start(); + String errorMessage = "errorMessage"; + String differentMessage = "differentMessage"; + Throwable error = new Throwable(errorMessage); + Map fields = new HashMap<>(); + fields.put(Fields.ERROR_OBJECT, error); + fields.put(Fields.MESSAGE, differentMessage); + + underTest.log(System.currentTimeMillis(), fields, span); + + assertEquals(error.getMessage(), span.getTags().get(DDTags.ERROR_MSG)); + assertEquals(error.getClass().getName(), span.getTags().get(DDTags.ERROR_TYPE)); + } + + @Test + void handlesCorrectlyTheMessageInTheFieldsButSpanIsNotAnError() { + LogHandler underTest = new DefaultLogHandler(); + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "op name").withServiceName("foo").start(); + String errorMessage = "errorMessage"; + Map fields = new HashMap<>(); + fields.put(Fields.MESSAGE, errorMessage); + + underTest.log(fields, span); + + assertNull(span.getTags().get(DDTags.ERROR_MSG)); + } + + @Test + void handlesCorrectlyTheMessageInTheFieldsCalledWithTimestampButSpanIsNotAnError() { + LogHandler underTest = new DefaultLogHandler(); + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "op name").withServiceName("foo").start(); + String errorMessage = "errorMessage"; + Map fields = new HashMap<>(); + fields.put(Fields.MESSAGE, errorMessage); + + underTest.log(System.currentTimeMillis(), fields, span); + + assertNull(span.getTags().get(DDTags.ERROR_MSG)); + } + + @Test + void handlesCorrectlyTheMessageInTheFieldsWhenSpanIsError() { + LogHandler underTest = new DefaultLogHandler(); + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "op name").withServiceName("foo").start(); + String errorMessage = "errorMessage"; + Map fields = new HashMap<>(); + span.setError(true); + fields.put(Fields.MESSAGE, errorMessage); + + underTest.log(fields, span); + + assertEquals(errorMessage, span.getTags().get(DDTags.ERROR_MSG)); + } + + @Test + void handlesCorrectlyTheMessageInTheFieldsCalledWithTimestampWhenSpanIsError() { + LogHandler underTest = new DefaultLogHandler(); + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "op name").withServiceName("foo").start(); + String errorMessage = "errorMessage"; + Map fields = new HashMap<>(); + span.setError(true); + fields.put(Fields.MESSAGE, errorMessage); + + underTest.log(System.currentTimeMillis(), fields, span); + + assertEquals(errorMessage, span.getTags().get(DDTags.ERROR_MSG)); + } + + @Test + void handlesCorrectlyTheMessageInTheFieldsWhenEventIsError() { + LogHandler underTest = new DefaultLogHandler(); + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "op name").withServiceName("foo").start(); + String errorMessage = "errorMessage"; + Map fields = new HashMap<>(); + fields.put(Fields.EVENT, "error"); + fields.put(Fields.MESSAGE, errorMessage); + + underTest.log(fields, span); + + assertEquals(errorMessage, span.getTags().get(DDTags.ERROR_MSG)); + } + + @Test + void handlesCorrectlyTheMessageInTheFieldsCalledWithTimestampWhenEventIsError() { + LogHandler underTest = new DefaultLogHandler(); + DDSpan span = (DDSpan) tracer.buildSpan("datadog", "op name").withServiceName("foo").start(); + String errorMessage = "errorMessage"; + Map fields = new HashMap<>(); + fields.put(Fields.EVENT, "error"); + fields.put(Fields.MESSAGE, errorMessage); + + underTest.log(System.currentTimeMillis(), fields, span); + + assertEquals(errorMessage, span.getTags().get(DDTags.ERROR_MSG)); + } + + @Test + void sanityTestWithLoghandlerNotSet() throws Exception { + String expectedName = "fakeName"; + String expectedLogEvent = "fakeEvent"; + long timeStamp = System.currentTimeMillis(); + Map fieldsMap = new HashMap<>(); + + DDTracer loggingTracer = DDTracer.builder().writer(writer).build(); + try { + io.opentracing.Span span = + loggingTracer.buildSpan(expectedName).withServiceName("foo").start(); + + span.log(expectedLogEvent); + span.log(timeStamp, expectedLogEvent); + span.log(fieldsMap); + span.log(timeStamp, fieldsMap); + // no exception thrown + } finally { + loggingTracer.close(); + } + } + + @Test + void sanityTestWhenPassedLogHandlerIsNull() throws Exception { + String expectedName = "fakeName"; + String expectedLogEvent = "fakeEvent"; + long timeStamp = System.currentTimeMillis(); + Map fieldsMap = new HashMap<>(); + + DDTracer loggingTracer = DDTracer.builder().writer(writer).logHandler(null).build(); + try { + io.opentracing.Span span = loggingTracer.buildSpan(expectedName).start(); + + span.log(expectedLogEvent); + span.log(timeStamp, expectedLogEvent); + span.log(fieldsMap); + span.log(timeStamp, fieldsMap); + // no exception thrown + } finally { + loggingTracer.close(); + } + } + + @Test + void shouldDelegateSimpleLogsToLogHandler() throws Exception { + LogHandler logHandler = mock(LogHandler.class); + String expectedName = "fakeName"; + String expectedLogEvent = "fakeEvent"; + long timeStamp = System.currentTimeMillis(); + + DDTracer loggingTracer = DDTracer.builder().writer(writer).logHandler(logHandler).build(); + try { + OTSpan span = (OTSpan) loggingTracer.buildSpan(expectedName).withServiceName("foo").start(); + + span.log(timeStamp, expectedLogEvent); + + verify(logHandler).log(timeStamp, expectedLogEvent, span.getDelegate()); + } finally { + loggingTracer.close(); + } + } + + @Test + void shouldDelegateSimpleLogsWithTimestampToLogHandler() throws Exception { + LogHandler logHandler = mock(LogHandler.class); + String expectedName = "fakeName"; + String expectedLogEvent = "fakeEvent"; + + DDTracer loggingTracer = DDTracer.builder().writer(writer).logHandler(logHandler).build(); + try { + OTSpan span = (OTSpan) loggingTracer.buildSpan(expectedName).withServiceName("foo").start(); + + span.log(expectedLogEvent); + + verify(logHandler).log(expectedLogEvent, span.getDelegate()); + } finally { + loggingTracer.close(); + } + } + + @Test + void shouldDelegateLogsWithFieldsToLogHandler() throws Exception { + LogHandler logHandler = mock(LogHandler.class); + String expectedName = "fakeName"; + Map fieldsMap = new HashMap<>(); + + DDTracer loggingTracer = DDTracer.builder().writer(writer).logHandler(logHandler).build(); + try { + OTSpan span = (OTSpan) loggingTracer.buildSpan(expectedName).withServiceName("foo").start(); + + span.log(fieldsMap); + + verify(logHandler).log(fieldsMap, span.getDelegate()); + } finally { + loggingTracer.close(); + } + } + + @Test + void shouldDelegateLogsWithFieldsAndTimestampToLogHandler() throws Exception { + LogHandler logHandler = mock(LogHandler.class); + String expectedName = "fakeName"; + Map fieldsMap = new HashMap<>(); + long timeStamp = System.currentTimeMillis(); + + DDTracer loggingTracer = DDTracer.builder().writer(writer).logHandler(logHandler).build(); + try { + OTSpan span = (OTSpan) loggingTracer.buildSpan(expectedName).withServiceName("foo").start(); + + span.log(timeStamp, fieldsMap); + + verify(logHandler).log(timeStamp, fieldsMap, span.getDelegate()); + } finally { + loggingTracer.close(); + } + } +} diff --git a/dd-trace-ot/src/test/java/datadog/opentracing/IterationSpansForkedTest.java b/dd-trace-ot/src/test/java/datadog/opentracing/IterationSpansForkedTest.java new file mode 100644 index 00000000000..ac24833a82f --- /dev/null +++ b/dd-trace-ot/src/test/java/datadog/opentracing/IterationSpansForkedTest.java @@ -0,0 +1,196 @@ +package datadog.opentracing; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.mock; + +import datadog.metrics.api.statsd.StatsDClient; +import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.common.writer.ListWriter; +import datadog.trace.core.CoreTracer; +import datadog.trace.core.DDSpan; +import datadog.trace.test.junit.utils.config.WithConfig; +import datadog.trace.test.util.DDJavaSpecification; +import io.opentracing.ScopeManager; +import java.util.Comparator; +import java.util.List; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +@WithConfig(key = "trace.scope.iteration.keep.alive", value = "1") +class IterationSpansForkedTest extends DDJavaSpecification { + + ListWriter writer; + DDTracer tracer; + ScopeManager scopeManager; + StatsDClient statsDClient; + CoreTracer coreTracer; + + @BeforeEach + void setup() { + writer = new ListWriter(); + statsDClient = mock(StatsDClient.class); + tracer = DDTracer.builder().writer(writer).statsDClient(statsDClient).build(); + scopeManager = tracer.scopeManager(); + coreTracer = (CoreTracer) tracer.getInternalTracer(); + } + + @AfterEach + void cleanup() throws Exception { + coreTracer.close(); + } + + @Test + void rootIterationScopeLifecycle() throws Exception { + coreTracer.closePrevious(true); + AgentSpan span1 = coreTracer.buildSpan("datadog", "next1").start(); + AgentScope scope1 = coreTracer.activateNext(span1); + + assertTrue(writer.isEmpty()); + assertSame(span1, scope1.span()); + assertSame(span1, ((OTSpan) tracer.activeSpan()).getDelegate()); + assertFalse(spanFinished(span1)); + + coreTracer.closePrevious(true); + AgentSpan span2 = coreTracer.buildSpan("datadog", "next2").start(); + AgentScope scope2 = coreTracer.activateNext(span2); + + assertTrue(spanFinished(span1)); + assertEquals(1, writer.size()); + assertSame(span1, writer.get(0).get(0)); + assertSame(span2, scope2.span()); + assertSame(span2, ((OTSpan) tracer.activeSpan()).getDelegate()); + assertFalse(spanFinished(span2)); + + coreTracer.closePrevious(true); + AgentSpan span3 = coreTracer.buildSpan("datadog", "next3").start(); + AgentScope scope3 = coreTracer.activateNext(span3); + writer.waitForTraces(2); + + assertTrue(spanFinished(span2)); + assertEquals(2, writer.size()); + assertSame(span3, scope3.span()); + assertSame(span3, ((OTSpan) tracer.activeSpan()).getDelegate()); + assertFalse(spanFinished(span3)); + + // 'next3' should time out & finish after 1s + writer.waitForTraces(3); + + assertTrue(spanFinished(span3)); + assertEquals(3, writer.size()); + } + + @Test + void nonRootIterationScopeLifecycle() throws Exception { + AgentSpan span0 = coreTracer.buildSpan("datadog", "parent").start(); + AgentScope scope0 = coreTracer.activateSpan(span0); + + coreTracer.closePrevious(true); + AgentSpan span1 = coreTracer.buildSpan("datadog", "next1").start(); + AgentScope scope1 = coreTracer.activateNext(span1); + + assertTrue(writer.isEmpty()); + assertSame(span1, scope1.span()); + assertSame(span1, ((OTSpan) tracer.activeSpan()).getDelegate()); + assertFalse(spanFinished(span1)); + + coreTracer.closePrevious(true); + AgentSpan span2 = coreTracer.buildSpan("datadog", "next2").start(); + AgentScope scope2 = coreTracer.activateNext(span2); + + assertTrue(spanFinished(span1)); + assertTrue(writer.isEmpty()); + assertSame(span2, scope2.span()); + assertSame(span2, ((OTSpan) tracer.activeSpan()).getDelegate()); + assertFalse(spanFinished(span2)); + + coreTracer.closePrevious(true); + AgentSpan span3 = coreTracer.buildSpan("datadog", "next3").start(); + AgentScope scope3 = coreTracer.activateNext(span3); + + assertTrue(spanFinished(span2)); + assertTrue(writer.isEmpty()); + assertSame(span3, scope3.span()); + assertSame(span3, ((OTSpan) tracer.activeSpan()).getDelegate()); + assertFalse(spanFinished(span3)); + + // close and finish the surrounding (non-iteration) span to complete the trace + scope0.close(); + span0.finish(); + writer.waitForTraces(1); + + assertTrue(spanFinished(span3)); + assertTrue(spanFinished(span0)); + sortSpansByStart(); + List trace = writer.get(0); + assertEquals(4, trace.size()); + assertSame(span0, trace.get(0)); + assertSame(span1, trace.get(1)); + assertSame(span2, trace.get(2)); + assertSame(span3, trace.get(3)); + } + + @Test + void nestedIterationScopeLifecycle() throws Exception { + coreTracer.closePrevious(true); + AgentSpan span1 = coreTracer.buildSpan("datadog", "next1").start(); + AgentScope scope1 = coreTracer.activateNext(span1); + + assertTrue(writer.isEmpty()); + assertSame(span1, scope1.span()); + assertSame(span1, ((OTSpan) tracer.activeSpan()).getDelegate()); + assertFalse(spanFinished(span1)); + + AgentSpan span1A = coreTracer.buildSpan("datadog", "methodA").start(); + AgentScope scope1A = coreTracer.activateSpan(span1A); + + coreTracer.closePrevious(true); + AgentSpan span1A1 = coreTracer.buildSpan("datadog", "next1A1").start(); + AgentScope scope1A1 = coreTracer.activateNext(span1A1); + + assertFalse(spanFinished(span1)); + assertTrue(writer.isEmpty()); + assertSame(span1A1, scope1A1.span()); + assertSame(span1A1, ((OTSpan) tracer.activeSpan()).getDelegate()); + assertFalse(spanFinished(span1A1)); + + coreTracer.closePrevious(true); + AgentSpan span1A2 = coreTracer.buildSpan("datadog", "next1A2").start(); + AgentScope scope1A2 = coreTracer.activateNext(span1A2); + + assertTrue(spanFinished(span1A1)); + assertTrue(writer.isEmpty()); + assertSame(span1A2, scope1A2.span()); + assertSame(span1A2, ((OTSpan) tracer.activeSpan()).getDelegate()); + assertFalse(spanFinished(span1A2)); + + // close and finish the intermediate (non-iteration) span + scope1A.close(); + span1A.finish(); + // 'next1' (and 'next1A2') should time out & finish after 1s to complete the trace + writer.waitForTraces(1); + + assertTrue(spanFinished(span1A2)); + assertTrue(spanFinished(span1A)); + assertTrue(spanFinished(span1)); + sortSpansByStart(); + List trace = writer.get(0); + assertEquals(4, trace.size()); + assertSame(span1, trace.get(0)); + assertSame(span1A, trace.get(1)); + assertSame(span1A1, trace.get(2)); + assertSame(span1A2, trace.get(3)); + } + + private boolean spanFinished(AgentSpan span) { + return span instanceof DDSpan && ((DDSpan) span).isFinished(); + } + + private void sortSpansByStart() { + writer.firstTrace().sort(Comparator.comparingLong(DDSpan::getStartTime)); + } +} diff --git a/dd-trace-ot/src/test/java/datadog/opentracing/OTSpanTest.java b/dd-trace-ot/src/test/java/datadog/opentracing/OTSpanTest.java new file mode 100644 index 00000000000..de4b33fa919 --- /dev/null +++ b/dd-trace-ot/src/test/java/datadog/opentracing/OTSpanTest.java @@ -0,0 +1,55 @@ +package datadog.opentracing; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import datadog.trace.api.interceptor.MutableSpan; +import datadog.trace.bootstrap.instrumentation.api.ResourceNamePriorities; +import datadog.trace.test.util.DDJavaSpecification; +import io.opentracing.Scope; +import io.opentracing.Span; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; + +class OTSpanTest extends DDJavaSpecification { + + static DDTracer tracer; + + @BeforeAll + static void setUpClass() { + tracer = DDTracer.builder().build(); + } + + @AfterAll + static void tearDownClass() throws Exception { + if (tracer != null) { + tracer.close(); + } + } + + @Test + void testResourceNameAssignmentThroughMutableSpanCasting() { + OTSpan testSpan = (OTSpan) tracer.buildSpan("parent").withResourceName("test-resource").start(); + OTScopeManager.OTScope testScope = (OTScopeManager.OTScope) tracer.activateSpan(testSpan); + + Span active = tracer.activeSpan(); + Span child = tracer.buildSpan("child").asChildOf(active).start(); + Scope scope = tracer.activateSpan(child); + + MutableSpan localRootSpan = ((MutableSpan) child).getLocalRootSpan(); + localRootSpan.setResourceName("correct-resource"); + + assertEquals("correct-resource", testSpan.getResourceName()); + + testSpan + .getDelegate() + .setResourceName("should-be-ignored", ResourceNamePriorities.HTTP_FRAMEWORK_ROUTE); + + assertEquals("correct-resource", testSpan.getResourceName()); + + scope.close(); + child.finish(); + testScope.close(); + testSpan.finish(); + } +} diff --git a/dd-trace-ot/src/test/java/datadog/opentracing/OpenTracingAPITest.java b/dd-trace-ot/src/test/java/datadog/opentracing/OpenTracingAPITest.java new file mode 100644 index 00000000000..72632f84565 --- /dev/null +++ b/dd-trace-ot/src/test/java/datadog/opentracing/OpenTracingAPITest.java @@ -0,0 +1,479 @@ +package datadog.opentracing; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.clearInvocations; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoMoreInteractions; +import static org.mockito.Mockito.when; + +import datadog.trace.api.DDTags; +import datadog.trace.api.interceptor.MutableSpan; +import datadog.trace.api.interceptor.TraceInterceptor; +import datadog.trace.api.scopemanager.ScopeListener; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import datadog.trace.common.writer.ListWriter; +import datadog.trace.context.TraceScope; +import datadog.trace.core.DDSpan; +import datadog.trace.test.junit.utils.config.WithConfig; +import datadog.trace.test.util.DDJavaSpecification; +import io.opentracing.Scope; +import io.opentracing.Span; +import io.opentracing.SpanContext; +import io.opentracing.propagation.Format; +import io.opentracing.propagation.TextMapAdapter; +import io.opentracing.tag.Tags; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class OpenTracingAPITest extends DDJavaSpecification { + + ListWriter writer = new ListWriter(); + DDTracer tracer = DDTracer.builder().writer(writer).build(); + TraceInterceptor traceInterceptor = mock(TraceInterceptor.class); + ScopeListener scopeListener = mock(ScopeListener.class); + + @BeforeEach + void setup() { + assertNull(tracer.scopeManager().active()); + tracer.addTraceInterceptor(traceInterceptor); + tracer.getInternalTracer().addScopeListener(scopeListener); + // stub onTraceComplete to pass traces through (return first argument) + when(traceInterceptor.onTraceComplete(any())).thenAnswer(inv -> inv.getArgument(0)); + // clear interactions from setup (e.g. priority() called during addTraceInterceptor) + clearInvocations(traceInterceptor, scopeListener); + } + + @AfterEach + void tearDown() throws Exception { + tracer.close(); + } + + @Test + void tracerScopeManagerReturnsNullForNoActiveSpan() { + assertNull(tracer.activeSpan()); + assertNull(tracer.scopeManager().active()); + assertNull(tracer.scopeManager().activeSpan()); + } + + @Test + void singleSpan() throws Exception { + Scope scope = null; + try { + scope = tracer.buildSpan("someOperation").startActive(true); + scope.span().setTag(DDTags.SERVICE_NAME, "someService"); + } finally { + if (scope != null) scope.close(); + } + writer.waitForTraces(1); + + verify(traceInterceptor).onTraceComplete(any()); + + assertEquals(1, writer.size()); + List trace = writer.get(0); + assertEquals(1, trace.size()); + DDSpan span = trace.get(0); + assertEquals("someService", span.getServiceName()); + assertEquals("someOperation", span.getOperationName().toString()); + assertEquals("someOperation", span.getResourceName().toString()); + assertEquals("opentracing", span.getTags().get(DDTags.DD_INTEGRATION)); + } + + @Test + void spanWithBuilder() throws Exception { + Span testSpan = + tracer + .buildSpan("someOperation") + .withTag(Tags.COMPONENT, "opentracing") + .withTag("someBoolean", true) + .withTag("someNumber", 1) + .withTag(DDTags.SERVICE_NAME, "someService") + .start(); + + Scope scope = null; + try { + scope = tracer.activateSpan(testSpan); + testSpan.finish(); + } finally { + if (scope != null) scope.close(); + } + writer.waitForTraces(1); + + verify(traceInterceptor).onTraceComplete(any()); + assertTrue(testSpan instanceof MutableSpan); + + assertEquals(1, writer.size()); + List trace = writer.get(0); + assertEquals(1, trace.size()); + DDSpan span = trace.get(0); + assertEquals("someService", span.getServiceName()); + assertEquals("someOperation", span.getOperationName().toString()); + assertEquals("someOperation", span.getResourceName().toString()); + assertEquals("opentracing", span.getTags().get(Tags.COMPONENT.getKey())); + assertEquals("opentracing", span.getTags().get(DDTags.DD_INTEGRATION)); + assertEquals(true, span.getTags().get("someBoolean")); + assertEquals(1, span.getTags().get("someNumber")); + } + + @Test + void singleSpanWithManualStartFinish() throws Exception { + Span testSpan = tracer.buildSpan("someOperation").start(); + Scope scope = tracer.activateSpan(testSpan); + + verify(scopeListener).afterScopeActivated(); + assertTrue(testSpan instanceof MutableSpan); + assertTrue(scope.span() instanceof MutableSpan); + + testSpan.setTag(DDTags.SERVICE_NAME, "someService"); + testSpan.setTag(Tags.COMPONENT, "opentracing"); + testSpan.setTag("someBoolean", true); + testSpan.setTag("someNumber", 1); + testSpan.setOperationName("someOtherOperation"); + scope.close(); + testSpan.finish(); + writer.waitForTraces(1); + + verify(traceInterceptor).onTraceComplete(any()); + verify(scopeListener).afterScopeClosed(); + + assertEquals(1, writer.size()); + List trace = writer.get(0); + assertEquals(1, trace.size()); + DDSpan span = trace.get(0); + assertEquals("someService", span.getServiceName()); + assertEquals("someOtherOperation", span.getOperationName().toString()); + assertEquals("someOtherOperation", span.getResourceName().toString()); + assertEquals("opentracing", span.getTags().get(Tags.COMPONENT.getKey())); + assertEquals("opentracing", span.getTags().get(DDTags.DD_INTEGRATION)); + assertEquals(true, span.getTags().get("someBoolean")); + assertEquals(1, span.getTags().get("someNumber")); + } + + @Test + void spansAndScopesAllEqual() throws Exception { + Span testSpan = tracer.buildSpan("someOperation").start(); + Scope testScope = tracer.activateSpan(testSpan); + + Span traceActiveSpan = tracer.activeSpan(); + Span scopeManagerActiveSpan = tracer.scopeManager().activeSpan(); + Span scopeActiveSpan = testScope.span(); + + Scope scopeManagerActiveScope = tracer.scopeManager().active(); + testScope.close(); + testSpan.finish(); + writer.waitForTraces(1); + + verify(traceInterceptor).onTraceComplete(any()); + assertEquals(testSpan, traceActiveSpan); + assertEquals(testSpan.hashCode(), traceActiveSpan.hashCode()); + assertEquals(testSpan, scopeManagerActiveSpan); + assertEquals(testSpan.hashCode(), scopeManagerActiveSpan.hashCode()); + assertEquals(testSpan, scopeActiveSpan); + assertEquals(testSpan.hashCode(), scopeActiveSpan.hashCode()); + assertEquals(testScope, scopeManagerActiveScope); + assertEquals(testScope.hashCode(), scopeManagerActiveScope.hashCode()); + } + + @Test + void nestedSpans() throws Exception { + Scope scope = null; + try { + scope = tracer.buildSpan("someOperation").startActive(true); + scope.span().setTag(DDTags.SERVICE_NAME, "someService"); + + Scope scope2 = null; + try { + scope2 = tracer.buildSpan("someOperation2").startActive(true); + } finally { + if (scope2 != null) scope2.close(); + } + } finally { + if (scope != null) scope.close(); + } + writer.waitForTraces(1); + + verify(traceInterceptor).onTraceComplete(any()); + + assertEquals(1, writer.size()); + List trace = writer.get(0); + assertEquals(2, trace.size()); + DDSpan parentSpan = trace.get(0); + DDSpan childSpan = trace.get(1); + assertEquals("someService", parentSpan.getServiceName()); + assertEquals("someOperation", parentSpan.getOperationName().toString()); + assertEquals("someOperation", parentSpan.getResourceName().toString()); + assertEquals("someService", childSpan.getServiceName()); + assertEquals("someOperation2", childSpan.getOperationName().toString()); + assertEquals("someOperation2", childSpan.getResourceName().toString()); + assertEquals(parentSpan.getSpanId(), childSpan.getParentId()); + } + + @Test + void spanWithAsyncPropagation() throws Exception { + AgentTracer.TracerAPI internalTracer = tracer.getInternalTracer(); + + Scope scope = + tracer + .buildSpan("someOperation") + .withTag(DDTags.SERVICE_NAME, "someService") + .startActive(true); + internalTracer.setAsyncPropagationEnabled(false); + + assertTrue(scope instanceof TraceScope); + assertTrue(!internalTracer.isAsyncPropagationEnabled()); + + internalTracer.setAsyncPropagationEnabled(true); + TraceScope.Continuation continuation = ((TraceScope) scope).capture(); + + assertTrue(internalTracer.isAsyncPropagationEnabled()); + assertNotNull(continuation); + + continuation.cancel(); + scope.close(); + writer.waitForTraces(1); + + verify(traceInterceptor).onTraceComplete(any()); + + assertEquals(1, writer.size()); + List trace = writer.get(0); + assertEquals(1, trace.size()); + DDSpan span = trace.get(0); + assertEquals("someService", span.getServiceName()); + assertEquals("someOperation", span.getOperationName().toString()); + assertEquals("someOperation", span.getResourceName().toString()); + } + + @Test + void spanInheritsAsyncPropagation() throws Exception { + AgentTracer.TracerAPI internalTracer = tracer.getInternalTracer(); + + Scope outer = + tracer + .buildSpan("someOperation") + .withTag(DDTags.SERVICE_NAME, "someService") + .startActive(true); + internalTracer.setAsyncPropagationEnabled(false); + + assertTrue(!internalTracer.isAsyncPropagationEnabled()); + + internalTracer.setAsyncPropagationEnabled(true); + Scope inner = + tracer + .buildSpan("otherOperation") + .withTag(DDTags.SERVICE_NAME, "otherService") + .startActive(true); + + assertTrue(internalTracer.isAsyncPropagationEnabled()); + + inner.close(); + outer.close(); + writer.waitForTraces(1); + + verify(traceInterceptor).onTraceComplete(any()); + + assertEquals(1, writer.size()); + List trace = writer.get(0); + assertEquals(2, trace.size()); + DDSpan outerSpan = trace.get(0); + DDSpan innerSpan = trace.get(1); + assertEquals("someService", outerSpan.getServiceName()); + assertEquals("someOperation", outerSpan.getOperationName().toString()); + assertEquals("someOperation", outerSpan.getResourceName().toString()); + assertEquals("otherService", innerSpan.getServiceName()); + assertEquals("otherOperation", innerSpan.getOperationName().toString()); + assertEquals("otherOperation", innerSpan.getResourceName().toString()); + } + + @Test + void spanContextIdsEqualTracerIds() throws Exception { + Span testSpan = tracer.buildSpan("someOperation").withServiceName("someService").start(); + Scope scope = tracer.activateSpan(testSpan); + + verify(scopeListener).afterScopeActivated(); + + assertEquals(testSpan.context().toSpanId(), tracer.getSpanId()); + assertEquals( + testSpan.context().toTraceId(), + tracer.getInternalTracer().activeSpan().spanContext().getTraceId().toString()); + + scope.close(); + testSpan.finish(); + writer.waitForTraces(1); + + verify(traceInterceptor).onTraceComplete(any()); + verify(scopeListener).afterScopeClosed(); + + assertEquals(1, writer.size()); + List trace = writer.get(0); + assertEquals(1, trace.size()); + DDSpan span = trace.get(0); + assertEquals("someService", span.getServiceName()); + assertEquals("someOperation", span.getOperationName().toString()); + assertEquals("someOperation", span.getResourceName().toString()); + } + + @Test + void closingScopeWhenNotOnTop() throws Exception { + Span firstSpan = tracer.buildSpan("someOperation").start(); + Scope firstScope = tracer.activateSpan(firstSpan); + Span secondSpan = tracer.buildSpan("someOperation").start(); + Scope secondScope = tracer.activateSpan(secondSpan); + firstSpan.finish(); + firstScope.close(); + + // then: 2 * scopeListener.afterScopeActivated(), 0 * _ + verify(scopeListener, times(2)).afterScopeActivated(); + verifyNoMoreInteractions(scopeListener, traceInterceptor); + clearInvocations(scopeListener, traceInterceptor); + + secondSpan.finish(); + secondScope.close(); + writer.waitForTraces(1); + + // then: 2 * scopeListener.afterScopeClosed(), 1 * traceInterceptor.onTraceComplete(...) + verify(scopeListener, times(2)).afterScopeClosed(); + verify(traceInterceptor).onTraceComplete(any()); + assertEquals(1, writer.size()); + assertEquals(2, writer.get(0).size()); + verifyNoMoreInteractions(scopeListener, traceInterceptor); + clearInvocations(scopeListener, traceInterceptor); + + firstScope.close(); + + // then: 0 * _ + verifyNoMoreInteractions(scopeListener, traceInterceptor); + } + + @Test + @WithConfig(key = "trace.scope.strict.mode", value = "true") + void closingScopeWhenNotOnTopInStrictMode() throws Exception { + DDTracer strictTracer = DDTracer.builder().writer(writer).build(); + strictTracer.addTraceInterceptor(traceInterceptor); + strictTracer.getInternalTracer().addScopeListener(scopeListener); + // clear priority() interaction from addTraceInterceptor + clearInvocations(traceInterceptor, scopeListener); + + Span firstSpan = strictTracer.buildSpan("someOperation").start(); + Scope firstScope = strictTracer.activateSpan(firstSpan); + Span secondSpan = strictTracer.buildSpan("someOperation").start(); + Scope secondScope = strictTracer.activateSpan(secondSpan); + + // then: 2 * scopeListener.afterScopeActivated(), 0 * _ + verify(scopeListener, times(2)).afterScopeActivated(); + verifyNoMoreInteractions(scopeListener, traceInterceptor); + clearInvocations(scopeListener, traceInterceptor); + + firstSpan.finish(); + assertThrows(RuntimeException.class, firstScope::close); + + // then: thrown(RuntimeException), 0 * _ + verifyNoMoreInteractions(scopeListener, traceInterceptor); + clearInvocations(scopeListener, traceInterceptor); + + secondSpan.finish(); + secondScope.close(); + writer.waitForTraces(1); + + // then: 1 * scopeListener.afterScopeClosed(), 1 * traceInterceptor.onTraceComplete(...) + // 1 * scopeListener.afterScopeActivated() (scope restoration after strict mode exception) + verify(scopeListener).afterScopeClosed(); + verify(traceInterceptor).onTraceComplete(any()); + assertEquals(1, writer.size()); + assertEquals(2, writer.get(0).size()); + verify(scopeListener).afterScopeActivated(); + verifyNoMoreInteractions(scopeListener, traceInterceptor); + clearInvocations(scopeListener, traceInterceptor); + + firstScope.close(); + + verify(scopeListener).afterScopeClosed(); + verifyNoMoreInteractions(scopeListener, traceInterceptor); + + strictTracer.close(); + } + + @Test + void injectAndExtractContext() throws Exception { + TextMapAdapter textMap = new TextMapAdapter(new HashMap()); + + Span testSpan = + tracer.buildSpan("clientOperation").withServiceName("someClientService").start(); + Scope scope = tracer.activateSpan(testSpan); + + tracer.inject(testSpan.context(), Format.Builtin.HTTP_HEADERS, textMap); + + SpanContext extractedContext = tracer.extract(Format.Builtin.HTTP_HEADERS, textMap); + Span serverSpan = + tracer + .buildSpan("serverOperation") + .withServiceName("someService") + .asChildOf(extractedContext) + .start(); + tracer.activateSpan(serverSpan).close(); + serverSpan.finish(); + + scope.close(); + testSpan.finish(); + writer.waitForTraces(2); + + verify(traceInterceptor, times(2)).onTraceComplete(any()); + assertEquals(extractedContext.toTraceId(), testSpan.context().toTraceId()); + assertEquals(extractedContext.toSpanId(), testSpan.context().toSpanId()); + + assertEquals(2, writer.size()); + // sort traces by start time to get deterministic order (client started first) + List> sortedTraces = new java.util.ArrayList<>(writer); + sortedTraces.sort(Comparator.comparingLong(t -> t.get(0).getStartTime())); + DDSpan clientSpan = sortedTraces.get(0).get(0); + DDSpan serverSpanDD = sortedTraces.get(1).get(0); + assertEquals("someClientService", clientSpan.getServiceName()); + assertEquals("clientOperation", clientSpan.getOperationName().toString()); + assertEquals("clientOperation", clientSpan.getResourceName().toString()); + assertEquals("someService", serverSpanDD.getServiceName()); + assertEquals("serverOperation", serverSpanDD.getOperationName().toString()); + assertEquals("serverOperation", serverSpanDD.getResourceName().toString()); + assertEquals(clientSpan.spanContext().getSpanId(), serverSpanDD.getParentId()); + } + + @Test + void tolerateNullSpanActivation() throws Exception { + try { + Scope s = tracer.scopeManager().activate(null); + if (s != null) s.close(); + } catch (Exception ignored) { + } + + try { + Scope s = tracer.activateSpan(null); + if (s != null) s.close(); + } catch (Exception ignored) { + } + + // make sure scope stack has been left in a valid state + Span testSpan = tracer.buildSpan("someOperation").withServiceName("someService").start(); + Scope testScope = tracer.scopeManager().activate(testSpan); + testSpan.finish(); + testScope.close(); + writer.waitForTraces(1); + + verify(traceInterceptor).onTraceComplete(any()); + + assertEquals(1, writer.size()); + List trace = writer.get(0); + assertEquals(1, trace.size()); + DDSpan span = trace.get(0); + assertEquals("someService", span.getServiceName()); + assertEquals("someOperation", span.getOperationName().toString()); + assertEquals("someOperation", span.getResourceName().toString()); + } +} diff --git a/dd-trace-ot/src/test/java/datadog/opentracing/SpanBuilderTest.java b/dd-trace-ot/src/test/java/datadog/opentracing/SpanBuilderTest.java new file mode 100644 index 00000000000..47800466751 --- /dev/null +++ b/dd-trace-ot/src/test/java/datadog/opentracing/SpanBuilderTest.java @@ -0,0 +1,155 @@ +package datadog.opentracing; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; + +import datadog.trace.common.writer.ListWriter; +import datadog.trace.core.DDSpanContext; +import datadog.trace.test.util.DDJavaSpecification; +import io.opentracing.Span; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; + +class SpanBuilderTest extends DDJavaSpecification { + // TODO more io.opentracing.SpanBuilder specific tests + + ListWriter writer = new ListWriter(); + DDTracer tracer = DDTracer.builder().writer(writer).build(); + + @AfterEach + void cleanup() throws Exception { + if (tracer != null) { + tracer.close(); + } + } + + @Test + void shouldInheritDDParentAttributesAddReferenceChildOf() { + String expectedName = "fakeName"; + String expectedParentServiceName = "fakeServiceName"; + String expectedParentResourceName = "fakeResourceName"; + String expectedParentType = "fakeType"; + String expectedChildServiceName = "fakeServiceName-child"; + String expectedChildResourceName = "fakeResourceName-child"; + String expectedChildType = "fakeType-child"; + String expectedBaggageItemKey = "fakeKey"; + String expectedBaggageItemValue = "fakeValue"; + + Span parent = + tracer + .buildSpan(expectedName) + .withServiceName("foo") + .withResourceName(expectedParentResourceName) + .withSpanType(expectedParentType) + .start(); + + parent.setBaggageItem(expectedBaggageItemKey, expectedBaggageItemValue); + + // ServiceName and SpanType are always set by the parent if they are not present in the child + OTSpan span = + (OTSpan) + tracer + .buildSpan(expectedName) + .withServiceName(expectedParentServiceName) + .addReference("child_of", parent.context()) + .start(); + + assertEquals(expectedName, span.getDelegate().getOperationName()); + assertEquals(expectedBaggageItemValue, span.getBaggageItem(expectedBaggageItemKey)); + assertEquals( + expectedParentServiceName, + ((DDSpanContext) ((OTSpanContext) span.context()).getDelegate()).getServiceName()); + assertEquals( + expectedName, + ((DDSpanContext) ((OTSpanContext) span.context()).getDelegate()).getResourceName()); + assertNull(((DDSpanContext) ((OTSpanContext) span.context()).getDelegate()).getSpanType()); + + // ServiceName and SpanType are always overwritten by the child if they are present + span = + (OTSpan) + tracer + .buildSpan(expectedName) + .withServiceName(expectedChildServiceName) + .withResourceName(expectedChildResourceName) + .withSpanType(expectedChildType) + .addReference("child_of", parent.context()) + .start(); + + assertEquals(expectedName, span.getDelegate().getOperationName()); + assertEquals(expectedBaggageItemValue, span.getBaggageItem(expectedBaggageItemKey)); + assertEquals( + expectedChildServiceName, + ((DDSpanContext) ((OTSpanContext) span.context()).getDelegate()).getServiceName()); + assertEquals( + expectedChildResourceName, + ((DDSpanContext) ((OTSpanContext) span.context()).getDelegate()).getResourceName()); + assertEquals( + expectedChildType, + ((DDSpanContext) ((OTSpanContext) span.context()).getDelegate()).getSpanType()); + } + + @Test + void shouldInheritDDParentAttributesAddReferenceFollowsFrom() { + String expectedName = "fakeName"; + String expectedParentServiceName = "fakeServiceName"; + String expectedParentResourceName = "fakeResourceName"; + String expectedParentType = "fakeType"; + String expectedChildServiceName = "fakeServiceName-child"; + String expectedChildResourceName = "fakeResourceName-child"; + String expectedChildType = "fakeType-child"; + String expectedBaggageItemKey = "fakeKey"; + String expectedBaggageItemValue = "fakeValue"; + + Span parent = + tracer + .buildSpan(expectedName) + .withServiceName("foo") + .withResourceName(expectedParentResourceName) + .withSpanType(expectedParentType) + .start(); + + parent.setBaggageItem(expectedBaggageItemKey, expectedBaggageItemValue); + + // ServiceName and SpanType are always set by the parent if they are not present in the child + OTSpan span = + (OTSpan) + tracer + .buildSpan(expectedName) + .withServiceName(expectedParentServiceName) + .addReference("follows_from", parent.context()) + .start(); + + assertEquals(expectedName, span.getDelegate().getOperationName()); + assertEquals(expectedBaggageItemValue, span.getBaggageItem(expectedBaggageItemKey)); + assertEquals( + expectedParentServiceName, + ((DDSpanContext) ((OTSpanContext) span.context()).getDelegate()).getServiceName()); + assertEquals( + expectedName, + ((DDSpanContext) ((OTSpanContext) span.context()).getDelegate()).getResourceName()); + assertNull(((DDSpanContext) ((OTSpanContext) span.context()).getDelegate()).getSpanType()); + + // ServiceName and SpanType are always overwritten by the child if they are present + span = + (OTSpan) + tracer + .buildSpan(expectedName) + .withServiceName(expectedChildServiceName) + .withResourceName(expectedChildResourceName) + .withSpanType(expectedChildType) + .addReference("follows_from", parent.context()) + .start(); + + assertEquals(expectedName, span.getDelegate().getOperationName()); + assertEquals(expectedBaggageItemValue, span.getBaggageItem(expectedBaggageItemKey)); + assertEquals( + expectedChildServiceName, + ((DDSpanContext) ((OTSpanContext) span.context()).getDelegate()).getServiceName()); + assertEquals( + expectedChildResourceName, + ((DDSpanContext) ((OTSpanContext) span.context()).getDelegate()).getResourceName()); + assertEquals( + expectedChildType, + ((DDSpanContext) ((OTSpanContext) span.context()).getDelegate()).getSpanType()); + } +} diff --git a/dd-trace-ot/src/test/java/datadog/opentracing/TypeConverterTest.java b/dd-trace-ot/src/test/java/datadog/opentracing/TypeConverterTest.java new file mode 100644 index 00000000000..e506bc44616 --- /dev/null +++ b/dd-trace-ot/src/test/java/datadog/opentracing/TypeConverterTest.java @@ -0,0 +1,57 @@ +package datadog.opentracing; + +import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpan; +import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopSpanContext; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import datadog.trace.bootstrap.instrumentation.api.AgentScope; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.common.writer.ListWriter; +import datadog.trace.core.CoreTracer; +import datadog.trace.test.util.DDJavaSpecification; +import org.junit.jupiter.api.Test; + +class TypeConverterTest extends DDJavaSpecification { + + TypeConverter typeConverter = new TypeConverter(new DefaultLogHandler()); + + @Test + void shouldAvoidTheNoopSpanWrapperAllocation() { + AgentSpan noopAgentSpan = noopSpan(); + assertSame(typeConverter.toSpan(noopAgentSpan), typeConverter.toSpan(noopAgentSpan)); + } + + @Test + void shouldAvoidExtraAllocationForASpanWrapper() throws Exception { + CoreTracer testTracer = CoreTracer.builder().writer(new ListWriter()).build(); + try { + AgentSpan span1 = testTracer.buildSpan("datadog", "test").start(); + AgentSpan span2 = testTracer.buildSpan("datadog", "test").start(); + + // return the same wrapper for the same span + assertSame(typeConverter.toSpan(span1), typeConverter.toSpan(span1)); + // return a distinct wrapper for another span + assertNotSame(typeConverter.toSpan(span1), typeConverter.toSpan(span2)); + } finally { + testTracer.close(); + } + } + + @Test + void shouldAvoidTheNoopContextWrapperAllocation() { + datadog.trace.bootstrap.instrumentation.api.AgentSpanContext noopContext = noopSpanContext(); + assertSame(typeConverter.toSpanContext(noopContext), typeConverter.toSpanContext(noopContext)); + } + + @Test + void shouldReuseNoopSpanWrapperViaScope() { + AgentScope noopScope = mock(AgentScope.class); + when(noopScope.span()).thenReturn(noopSpan()); + OTSpan noopSpanWrapper = typeConverter.toSpan(noopSpan()); + assertSame(typeConverter.toScope(noopScope, true).span(), noopSpanWrapper); + assertSame(typeConverter.toScope(noopScope, false).span(), noopSpanWrapper); + } +} diff --git a/dd-trace-ot/src/test/java/datadog/opentracing/resolver/DDTracerResolverTest.java b/dd-trace-ot/src/test/java/datadog/opentracing/resolver/DDTracerResolverTest.java new file mode 100644 index 00000000000..b49838baf53 --- /dev/null +++ b/dd-trace-ot/src/test/java/datadog/opentracing/resolver/DDTracerResolverTest.java @@ -0,0 +1,28 @@ +package datadog.opentracing.resolver; + +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNull; + +import datadog.opentracing.DDTracer; +import datadog.trace.test.junit.utils.config.WithConfig; +import datadog.trace.test.util.DDJavaSpecification; +import io.opentracing.contrib.tracerresolver.TracerResolver; +import org.junit.jupiter.api.Test; + +class DDTracerResolverTest extends DDJavaSpecification { + + private final DDTracerResolver resolver = new DDTracerResolver(); + + @Test + void testResolveTracer() throws Exception { + io.opentracing.Tracer tracer = TracerResolver.resolveTracer(); + assertInstanceOf(DDTracer.class, tracer); + tracer.close(); + } + + @Test + @WithConfig(key = "trace.resolver.enabled", value = "false") + void testDisableDDTracerResolver() { + assertNull(resolver.resolve()); + } +} diff --git a/docs/add_new_configurations.md b/docs/add_new_configurations.md index f7d09f4c676..2c8eb1c785c 100644 --- a/docs/add_new_configurations.md +++ b/docs/add_new_configurations.md @@ -36,7 +36,7 @@ In order to properly add a new configuration in the library, follow the below st 1. The key is the Environment Variable name, and the value is an array of objects with the following fields: 1. Version. 1. If introducing a new configuration, provide a version of `A`. - 2. If the configuration already exists in the Feature Parity Dashboard and has the same implementation details as an existing Configuration Version, add the version listed on the Feature Parity Dashboard. Else, introduce a new Configuration Version, fill in the proper documentation, and use the version provided. + 2. If the configuration already exists in the Feature Parity Dashboard and has the same implementation details as an existing Configuration Version, add the version listed on the Feature Parity Dashboard. Else, follow Step 8 to introduce a new configuration implementation and use the new auto-generated version. 2. Type. This is a _mandatory_ field and has the options of boolean, int, decimal, string, map, array. If the configuration is eventually converted to an Enum or other class, use type String. 3. Default. This is a _mandatory_ field and accepts null as a valid value. 4. Aliases. This is a _mandatory_ field. If there are no aliases for the configuration, use an empty array as the value. @@ -69,7 +69,7 @@ See below for an example of the `supported-configurations.json` file. } } ``` -8. If the configuration is unique to all tracing libraries, add it to the [Feature Parity Dashboard](https://feature-parity.us1.prod.dog/#/configurations?viewType=configurations). This ensures that we have good documentation of all configurations supported in the library. +8. If the configuration is unique to all tracing libraries, add it to the [Feature Parity Dashboard](https://feature-parity.us1.prod.dog/#/configurations?viewType=configurations). This ensures that we have good documentation of all configurations supported in the library. Note that the `version` is auto-generated by the FPD. For details on adding environment variables to `metadata/supported-configurations.json` or the Feature Parity Dashboard, refer to this [document](https://datadoghq.atlassian.net/wiki/spaces/APMINT/pages/5372248222/APM+-+Centralized+Configuration+Config+inversion#dd-trace-java). diff --git a/docs/add_new_instrumentation.md b/docs/add_new_instrumentation.md index c5375eb397c..141354e43bc 100644 --- a/docs/add_new_instrumentation.md +++ b/docs/add_new_instrumentation.md @@ -17,18 +17,17 @@ named `google-http-client`. (see [Naming](./how_instrumentations_work.md#naming) ## Configuring Gradle -Add the new instrumentation to [`settings.gradle`](../settings.gradle) +Add the new instrumentation to [`settings.gradle.kts`](../settings.gradle.kts) in alpha order with the other instrumentations in this format: -```groovy -include ':dd-java-agent:instrumentation:$framework?:$framework-$minVersion' +```kotlin +include(":dd-java-agent:instrumentation:$framework:$framework-$minVersion") ``` -In this case -we [added](https://github.com/DataDog/dd-trace-java/blob/297b575f0f265c1dc78f9958e7b4b9365c80d1f9/settings.gradle#L209C3-L209C3): +For example, the jedis 3.x instrumentation appears as: -```groovy -include ':dd-java-agent:instrumentation:google-http-client' +```kotlin +include(":dd-java-agent:instrumentation:jedis:jedis-3.0") ``` ## Create the Instrumentation class @@ -59,7 +58,8 @@ include ':dd-java-agent:instrumentation:google-http-client' ```java @AutoService(InstrumenterModule.class) -public class GoogleHttpClientInstrumentation extends InstrumenterModule.Tracing implements Instrumenter.ForSingleType { +public class GoogleHttpClientInstrumentation extends InstrumenterModule.Tracing + implements Instrumenter.ForSingleType, Instrumenter.HasMethodAdvice { public GoogleHttpClientInstrumentation() { super("google-http-client"); } @@ -67,6 +67,17 @@ public class GoogleHttpClientInstrumentation extends InstrumenterModule.Tracing } ``` +> [!IMPORTANT] +> **The instrumentation name controls a config flag that must be registered.** The name passed to +> `super(...)` becomes the config key `dd.trace..enabled` → environment variable +> `DD_TRACE__ENABLED` (`.` and `-` become `_`, then uppercased — e.g. `couchbase-3` → +> `DD_TRACE_COUCHBASE_3_ENABLED`). Every such name must be registered in +> `metadata/supported-configurations.json` with the two standard aliases +> (`DD_TRACE_INTEGRATION__ENABLED` and `DD_INTEGRATION__ENABLED`), or the +> `checkInstrumenterModuleConfigurations` Gradle task fails the build. A module declaring multiple +> names (`super("a", "b")`) needs **one entry per name**. See +> [Add new configurations](./add_new_configurations.md) for the JSON entry shape. + ## Match the target class In this case we target only one known class to instrument. This is the class which contains the method this @@ -91,11 +102,11 @@ public HttpResponse execute() throws IOException {/* */} ``` Target the method using [appropriate Method Matchers](./how_instrumentations_work.md#method-matching) and include the -name String to be used for the Advice class when calling `transformation.applyAdvice()`: +name String to be used for the Advice class when calling `transformer.applyAdvice()`: ```java -public void adviceTransformations(AdviceTransformation transformation) { - transformation.applyAdvice( +public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvice( isMethod() .and(isPublic()) .and(named("execute")) @@ -110,8 +121,8 @@ public void adviceTransformations(AdviceTransformation transformation) { If you need to apply multiple advice classes to the same method (for example, to separate context tracking from tracing logic), you can pass multiple advice class names to `applyAdvices()`: ```java -public void adviceTransformations(AdviceTransformation transformation) { - transformation.applyAdvices( +public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvices( named("service") .and(takesArgument(0, named("org.apache.coyote.Request"))) .and(takesArgument(1, named("org.apache.coyote.Response"))), @@ -241,7 +252,7 @@ public String[] helperClassNames() { ## Add Advice class 1. Add a new static class to the Instrumentation class. The name must match what was passed to - the `adviceTransformations()` method earlier, here `GoogleHttpClientAdvice.` + the `methodAdvice()` method earlier, here `GoogleHttpClientAdvice.` 2. Create two static methods named whatever you like. `methodEnter` and `methodExit` are good choices. These **must** be static. 3. With `methodEnter:` @@ -295,16 +306,16 @@ public static class GoogleHttpClientAdvice { @Advice.Local("inherited") boolean inheritedScope, @Advice.Return final HttpResponse response, @Advice.Thrown final Throwable throwable) { + AgentSpan span = scope.span(); try { - AgentSpan span = scope.span(); DECORATE.onError(span, throwable); DECORATE.onResponse(span, response); DECORATE.beforeFinish(span); - span.finish(); } finally { if (!inheritedScope) { scope.close(); } + span.finish(); } } } @@ -331,7 +342,7 @@ public static class ContextTrackingAdvice { parentScope = parentContext.attach(); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void closeScope(@Advice.Local("parentScope") ContextScope scope) { scope.close(); } @@ -349,8 +360,8 @@ public static class TracingAdvice { Then apply both advices: ```java -public void adviceTransformations(AdviceTransformation transformation) { - transformation.applyAdvice( +public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvices( named("service"), getClass().getName() + "$ContextTrackingAdvice", // Only for CONTEXT_TRACKING getClass().getName() + "$TracingAdvice" // Only for TRACING @@ -438,6 +449,22 @@ There are four verification strategies, three of which are mandatory. - [Latest Dependency Tests](./how_instrumentations_work.md#latest-dependency-tests) (Required) - [Smoke tests](./how_instrumentations_work.md#smoke-tests) (Not required) +### Agent jar integrations golden file + +The agent jar check task `verifyAgentJarIntegrations` verifies that the set of integrations +listed under the `expected.integrations` key in `metadata/agent-jar-checks.properties` +exactly matches the integrations shipped in the built agent jar. This catches accidental additions or removals. + +When you add or remove an integration, update the properties file: + +```shell +./gradlew :dd-java-agent:updateAgentJarIntegrationsGoldenFile +``` + +Then commit `metadata/agent-jar-checks.properties` alongside your instrumentation changes. +The `check` task runs `verifyAgentJarIntegrations` automatically, so CI will fail if the file +is out of date. + All integrations must include sufficient test coverage. This HTTP client integration will include a [standard HTTP test class](../dd-java-agent/instrumentation/google-http-client/src/test/groovy/GoogleHttpClientTest.groovy) and diff --git a/docs/bootstrap_design_guidelines.md b/docs/bootstrap_design_guidelines.md index 8cefe8195a6..24329034e06 100644 --- a/docs/bootstrap_design_guidelines.md +++ b/docs/bootstrap_design_guidelines.md @@ -47,12 +47,12 @@ import org.slf4j.LoggerFactory; private static final Logger log = LoggerFactory.getLogger(MyClass.class); ``` -### 2. Java NIO (`java.nio.*`) +### 2. Java NIO (`java.nio.file.*`) **Why to avoid:** - Calling `FileSystems.getDefault()` during premain can break applications that set the `java.nio.file.spi.DefaultFileSystemProvider` system property in their `main` method - Some applications expect to control the default filesystem implementation, and premature initialization locks in the wrong provider -- Loading `java.nio` also triggers native library initialization (`pthread` on Linux) which can introduce a race condition +- Loading `java.nio.file` also triggers native library initialization (`pthread` on Linux) which can introduce a race condition **Reference:** [Java NIO FileSystems Documentation](https://docs.oracle.com/javase/8/docs/api/java/nio/file/FileSystems.html#getDefault--) @@ -63,7 +63,7 @@ private static final Logger log = LoggerFactory.getLogger(MyClass.class); **Example from issue #9780:** ```java -// BAD - Triggers java.nio initialization in premain +// BAD - Triggers java.nio.file initialization in premain FileSystems.getDefault(); Path.of("/some/path"); @@ -110,6 +110,6 @@ Loading a class during premain can have unintended side effects: **Guideline:** Be aware of native library loading and initialization Some Java classes trigger native library loading: -- `java.nio` - triggers pthread initialization on Linux and may create a [race condition (race conditionJDK-8345810)](https://bugs.openjdk.org/browse/JDK-8345810) +- `java.nio.file` - triggers pthread initialization on Linux and may create a [race condition (race conditionJDK-8345810)](https://bugs.openjdk.org/browse/JDK-8345810) - Socket operations - may trigger native networking libraries - File system operations - platform-specific native code diff --git a/docs/how_instrumentations_work.md b/docs/how_instrumentations_work.md index 3c4aa7a9053..b02666c916f 100644 --- a/docs/how_instrumentations_work.md +++ b/docs/how_instrumentations_work.md @@ -241,7 +241,7 @@ or [`UrlInstrumentation`](https://github.com/DataDog/dd-trace-java/blob/3e81c006 ### Method Matching After the type is selected, the type’s target members(e.g., methods) must next be selected using the Instrumentation -class’s `adviceTransformations()` method. +class’s `methodAdvice()` method. ByteBuddy’s [`ElementMatchers`](https://javadoc.io/doc/net.bytebuddy/byte-buddy/1.4.17/net/bytebuddy/matcher/ElementMatchers.html) are used to describe the target members to be instrumented. Datadog’s [`DDElementMatchers`](../dd-java-agent/agent-installer/src/main/java/datadog/trace/agent/tooling/bytebuddy/matcher/DDElementMatchers.java) @@ -262,8 +262,8 @@ Here, any public `execute()` method taking no arguments will have `PreparedState ```java @Override -public void adviceTransformations(AdviceTransformation transformation) { - transformation.applyAdvice( +public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvice( nameStartsWith("execute") .and(takesArguments(0)) .and(isPublic()), @@ -276,8 +276,8 @@ Here, any matching `connect()` method will have `DriverAdvice` applied: ```java @Override -public void adviceTransformations(AdviceTransformation transformation) { - transformation.applyAdvice( +public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvice( nameStartsWith("connect") .and(takesArgument(0, String.class)) .and(takesArgument(1, Properties.class)) @@ -292,8 +292,8 @@ The `applyAdvices` method supports applying multiple advice classes to the same ```java @Override -public void adviceTransformations(AdviceTransformation transformation) { - transformation.applyAdvices( +public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvices( named("service") .and(takesArgument(0, named("org.apache.coyote.Request"))) .and(takesArgument(1, named("org.apache.coyote.Response"))), @@ -391,10 +391,10 @@ Decorator class names should end in _Decorator._ ## Advice Classes Byte Buddy injects compiled bytecode at runtime to wrap existing methods, so they communicate with Datadog at entry or exit. -These modifications are referred to as _advice transformation_ or just _advice_. +These modifications are referred to as _method advice_ or just _advice_. -Instrumenters register advice transformations by calling `AdviceTransformation.applyAdvice(ElementMatcher, String)` -and Methods are matched by the instrumentation's `adviceTransformations()` method. +Instrumenters register advice transformations by calling `MethodTransformer.applyAdvice(ElementMatcher, String)` +and methods are matched by the instrumentation's `methodAdvice()` method. The Advice is injected into the type so Advice can only refer to those classes on the bootstrap class-path or helpers injected into the application class-loader. @@ -468,7 +468,7 @@ public static class ContextTrackingAdvice { parentScope = parentContext.attach(); } - @Advice.OnMethodExit(suppress = Throwable.class, onThrowable = Throwable.class) + @Advice.OnMethodExit(onThrowable = Throwable.class, suppress = Throwable.class) public static void closeScope(@Advice.Local("parentScope") ContextScope scope) { scope.close(); } @@ -491,8 +491,8 @@ In the Tomcat instrumentation, we apply both context tracking and tracing advice ```java @Override -public void adviceTransformations(AdviceTransformation transformation) { - transformation.applyAdvices( +public void methodAdvice(MethodTransformer transformer) { + transformer.applyAdvices( named("service") .and(takesArgument(0, named("org.apache.coyote.Request"))) .and(takesArgument(1, named("org.apache.coyote.Response"))), @@ -525,9 +525,8 @@ The opposite would be either no `suppress` annotation or equivalently `suppress allow exceptions in Advice code to surface and is usually undesirable. > [!NOTE] -> Don't use `suppress` on an advice hooking a constructor. -> For older JVMs that do not support [flexible constructor bodies](https://openjdk.org/jeps/513), you can't decorate the -> mandatory self or parent constructor call with try/catch, as it must be the first call from the constructor body. +> Don't use `onThrowable` on exit advice hooking a constructor. +> If the constructor throws, `@Advice.This` is a partially initialized object, making exit advice unsafe to run. If the [`Advice.OnMethodEnter`](https://javadoc.io/static/net.bytebuddy/byte-buddy/1.10.2/net/bytebuddy/asm/Advice.OnMethodEnter.html) @@ -755,8 +754,11 @@ The basic span lifecycle in an Advice class looks like: 2. Decorate the span 3. Activate the span and get the AgentScope 4. Run the instrumented target method -5. Close the Agent Scope -6. Finish the span +5. While the scope is still active: call final decorator methods (`DECORATE.beforeFinish`, etc.) and register any async callbacks +6. Close the Agent Scope +7. Finish the span + +Step 5 must complete before step 6: `beforeFinish` fires IAST/AppSec request-end callbacks that resolve the current span via `AgentTracer.activeSpan()`, and async callback frameworks (e.g. `CompletableFuture`) capture the active span at registration time — both break if the scope is closed first. ```java @Advice.OnMethodEnter(suppress = Throwable.class) diff --git a/docs/how_to_test_with_junit.md b/docs/how_to_test_with_junit.md index c5043824e0f..9fe264afb6a 100644 --- a/docs/how_to_test_with_junit.md +++ b/docs/how_to_test_with_junit.md @@ -108,7 +108,7 @@ When a cell references a symbolic constant like `Long.MAX_VALUE` or `DDSpanId.MA Prefer a shared class so converters are reused across tests: ```java -// utils/junit-utils - shared across modules +// utils/test-junit-converter-utils - shared across modules public final class TableTestTypeConverters { @TypeConverter public static long toLong(String value) { diff --git a/docs/instrumentation_design_guidelines.md b/docs/instrumentation_design_guidelines.md new file mode 100644 index 00000000000..305ff651439 --- /dev/null +++ b/docs/instrumentation_design_guidelines.md @@ -0,0 +1,83 @@ +# Instrumentation and Advice Design Guidelines + +This document outlines design constraints and best practices when writing or refactoring instrumentation and advice code. +Following these guidelines will help avoid constant-pool bloat and subtle span/scope lifecycle bugs. + +## Background + +Instrumentation classes wire up type/method matchers and advice once, when the framework loads them. Advice methods +are inlined into the instrumented application's bytecode and run on every invocation of the matched method, so their +ordering directly affects when spans are visible to nested work. + +## Constraints to Follow + +### 1. Instrumentation one-shot methods + +**Why to avoid extracting to constants:** + +- `triggerClasses()`, `contextStore()`, `classLoaderMatcher()`, and `methodAdvice()` are called exactly once by the + framework when the instrumentation is registered +- Extracting their return values into static constants adds constant-pool bloat with no runtime benefit + +**What to do instead:** + +Return the values directly from the method; don't cache them in a field. + +```java +// BAD - unnecessary static constant +private static final ElementMatcher.Junction CL_MATCHER = hasClassesNamed("foo.Bar"); + +@Override +public ElementMatcher.Junction classLoaderMatcher() { + return CL_MATCHER; +} + +// GOOD - construct directly in the one-shot method +@Override +public ElementMatcher.Junction classLoaderMatcher() { + return hasClassesNamed("foo.Bar"); +} +``` + +### 2. Scope lifecycle order + +**Why to avoid closing the scope early:** + +- Keeping the scope open until all work needing the current active span is done ensures decorator calls and async + callback registration see the span as active +- Closing the scope before that work runs can make nested code lose track of the current span + +**What to do instead:** + +Required order: decorator calls and callback registration, then `scope.close()`, then `span.finish()`. + +```java +// GOOD +DECORATE.onOperation(span, request); +registerCallback(span); +scope.close(); +span.finish(); +``` + +### 3. Static interface methods in advice + +**Why to avoid calling them directly:** + +- Advice methods (`@Advice.OnMethodEnter`/`@Advice.OnMethodExit`) are inlined into the instrumented class's bytecode +- Calling a static interface method there, such as `Context.current()` or `Context.root()`, can cause a + `VerifyError` at runtime + +**What to use instead:** + +Use `Java8BytecodeBridge` (`currentContext()`, `rootContext()`, etc.) in place of the static interface method, +static-imported for readability. + +```java +import static datadog.trace.bootstrap.instrumentation.api.Java8BytecodeBridge.currentContext; + +// BAD - static interface method call, can cause VerifyError when inlined +Context ctx = Context.current(); + +// GOOD - use the bytecode bridge, static-imported +Context ctx = currentContext(); +``` diff --git a/docs/reactor/pom.xml b/docs/reactor/pom.xml index f67dfdcfc7f..95454bf6879 100644 --- a/docs/reactor/pom.xml +++ b/docs/reactor/pom.xml @@ -34,7 +34,7 @@ io.opentelemetry opentelemetry-api - 1.43.0 + 1.62.0 com.datadoghq diff --git a/gradle.lockfile b/gradle.lockfile index df1298cd4ec..09ba2813628 100644 --- a/gradle.lockfile +++ b/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :dependencies --write-locks com.github.spotbugs:spotbugs-annotations:4.9.8=spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs diff --git a/gradle/dependencies.gradle b/gradle/dependencies.gradle index 3814c64f559..ff5b4938a5e 100644 --- a/gradle/dependencies.gradle +++ b/gradle/dependencies.gradle @@ -7,72 +7,91 @@ final class CachedData { // Inverse of "shared". These exclude directives are part of shadowJar's DSL // which is similar but not exactly the same as the regular gradle dependency{} block // Also, transitive dependencies have to be explicitly listed - excludeShared : (Closure) { - // projects bundled with shared or on bootstrap - exclude(project(':dd-java-agent:agent-bootstrap')) - exclude(project(':dd-java-agent:agent-debugger:debugger-bootstrap')) - exclude(project(':dd-java-agent:agent-logging')) - exclude(project(':dd-trace-api')) - exclude(project(':internal-api')) - exclude(project(':internal-api:internal-api-9')) - exclude(project(':communication')) - exclude(project(':components:context')) - exclude(project(':components:environment')) - exclude(project(':components:json')) - exclude(project(':products:feature-flagging:feature-flagging-bootstrap')) - exclude(project(':products:metrics:metrics-agent')) - exclude(project(':products:metrics:metrics-api')) - exclude(project(':products:metrics:metrics-lib')) - exclude(project(':remote-config:remote-config-api')) - exclude(project(':remote-config:remote-config-core')) - exclude(project(':telemetry')) - exclude(project(':utils:config-utils')) - exclude(project(':utils:container-utils')) - exclude(project(':utils:filesystem-utils')) - exclude(project(':utils:queue-utils')) - exclude(project(':utils:socket-utils')) - exclude(project(':utils:time-utils')) - exclude(project(':utils:logging-utils')) - exclude(project(':utils:version-utils')) - exclude(project(':dd-java-agent:agent-crashtracking')) - exclude(project(':dd-java-agent:ddprof-lib')) - exclude(dependency('org.slf4j::')) - exclude(dependency(':dd-instrument-java:')) + // Can't use shadow's Action because dependencies.gradle is used in + // projects that don't have this plugin (e.g. the other unrelated declarations) + excludeShared : new Action() { + @Override + void execute(Object filter) { + // projects bundled with shared or on bootstrap + filter.exclude(filter.project(':dd-java-agent:agent-bootstrap')) + filter.exclude(filter.project(':dd-java-agent:agent-debugger:debugger-bootstrap')) + filter.exclude(filter.project(':dd-java-agent:agent-logging')) + filter.exclude(filter.project(':dd-trace-api')) + filter.exclude(filter.project(':internal-api')) + filter.exclude(filter.project(':internal-api:internal-api-9')) + filter.exclude(filter.project(':communication')) + filter.exclude(filter.project(':components:context')) + filter.exclude(filter.project(':components:environment')) + filter.exclude(filter.project(':components:json')) + filter.exclude(filter.project(':products:feature-flagging:feature-flagging-bootstrap')) + filter.exclude(filter.project(':products:feature-flagging:feature-flagging-config')) + filter.exclude(filter.project(':products:metrics:metrics-agent')) + filter.exclude(filter.project(':products:metrics:metrics-api')) + filter.exclude(filter.project(':products:metrics:metrics-lib')) + filter.exclude(filter.project(':remote-config:remote-config-api')) + filter.exclude(filter.project(':remote-config:remote-config-core')) + filter.exclude(filter.project(':telemetry')) + filter.exclude(filter.project(':utils:config-utils')) + filter.exclude(filter.project(':utils:container-utils')) + filter.exclude(filter.project(':utils:filesystem-utils')) + filter.exclude(filter.project(':utils:queue-utils')) + filter.exclude(filter.project(':utils:socket-utils')) + filter.exclude(filter.project(':utils:time-utils')) + filter.exclude(filter.project(':utils:logging-utils')) + filter.exclude(filter.project(':utils:version-utils')) + filter.exclude(filter.project(':dd-java-agent:agent-crashtracking')) + filter.exclude(filter.project(':dd-java-agent:ddprof-lib')) + filter.exclude(filter.dependency('org.slf4j:.*:.*')) + filter.exclude(filter.dependency('.*:dd-instrument-java:.*')) - // okhttp and its transitives (both fork and non-fork) - exclude(dependency('com.datadoghq.okhttp3:okhttp')) - exclude(dependency('com.squareup.okhttp3:okhttp')) - exclude(dependency('com.datadoghq.okio:okio')) - exclude(dependency('com.squareup.okio:okio')) - exclude(dependency('org.lz4:lz4-java')) - exclude(dependency('io.airlift:aircompressor')) + // okhttp and its transitives (both fork and non-fork) + filter.exclude(filter.dependency('com.datadoghq.okhttp3:okhttp')) + filter.exclude(filter.dependency('com.squareup.okhttp3:okhttp')) + filter.exclude(filter.dependency('com.datadoghq.okio:okio')) + filter.exclude(filter.dependency('com.squareup.okio:okio')) + filter.exclude(filter.dependency('at.yawk.lz4:lz4-java')) + filter.exclude(filter.dependency('io.airlift:aircompressor')) - // dogstatsd and its transitives - exclude(dependency('com.datadoghq:java-dogstatsd-client')) - exclude(dependency('com.github.jnr::')) - exclude(dependency('org.ow2.asm::')) + // dogstatsd and its transitives + filter.exclude(filter.dependency('com.datadoghq:java-dogstatsd-client')) + filter.exclude(filter.dependency('com.github.jnr:.*:.*')) + filter.exclude(filter.dependency('org.ow2.asm:.*:.*')) - // sketches-java used by dd-trace-core (DataStreams) and metrics - exclude(dependency('com.datadoghq:sketches-java')) + // sketches-java used by dd-trace-core (DataStreams) and metrics + filter.exclude(filter.dependency('com.datadoghq:sketches-java')) - // javac plugin client - exclude(dependency('com.datadoghq:dd-javac-plugin-client')) + // javac plugin client + filter.exclude(filter.dependency('com.datadoghq:dd-javac-plugin-client')) - // moshi and its transitives - exclude(dependency('com.squareup.moshi::')) + // moshi and its transitives + filter.exclude(filter.dependency('com.squareup.moshi:.*:.*')) - // jctools and its transitives - exclude(dependency('org.jctools::')) + // jctools and its transitives + filter.exclude(filter.dependency('org.jctools:.*:.*')) - // cafe_crypto and its transitives - exclude(dependency('cafe.cryptography::')) + // cafe_crypto and its transitives + filter.exclude(filter.dependency('cafe.cryptography:.*:.*')) - // snakeyaml-engine and its transitives - exclude(dependency('org.snakeyaml:snakeyaml-engine')) + // snakeyaml-engine and its transitives + filter.exclude(filter.dependency('org.snakeyaml:snakeyaml-engine')) + + // re2j and its transitives + filter.exclude(filter.dependency('com.google.re2j:re2j')) + } } ] } +// The upstream `org.lz4:lz4-java` project is no longer maintained (see https://github.com/lz4/lz4-java), +// so we depend on the community fork `at.yawk.lz4:lz4-java`. The fork advertises itself as a drop-in replacement +// via Gradle capabilities (see https://docs.gradle.org/current/userguide/component_capabilities.html). +// This rule resolves conflicts by selecting the highest version. +configurations.configureEach { + resolutionStrategy.capabilitiesResolution.withCapability('org.lz4:lz4-java') { + selectHighestVersion() + } +} + CachedData.deps.shared = [ // Force specific version of okio required by com.squareup.moshi:moshi // When all of the dependencies are declared in dd-trace-core, moshi overrides the okhttp's @@ -85,7 +104,8 @@ CachedData.deps.shared = [ libs.moshi, libs.jctools, libs.lz4, - libs.aircompressor + libs.aircompressor, + libs.re2j ] ext { diff --git a/gradle/forbiddenApiFilters/main.txt b/gradle/forbiddenApiFilters/main.txt index 4890a46b094..d8ddd91df36 100644 --- a/gradle/forbiddenApiFilters/main.txt +++ b/gradle/forbiddenApiFilters/main.txt @@ -56,3 +56,10 @@ java.lang.invoke.MethodHandles.Lookup#unreflectSetter(java.lang.reflect.Field) # avoid Java deserialization entrypoint - see warning in https://docs.oracle.com/en/java/javase/25/docs/api/java.base/java/io/ObjectInputStream.html java.io.ObjectInputStream#readObject() + +# CVE-2021-0341: The internal OkHostnameVerifier.verify(String, SSLSession) does not restrict hostnames to ASCII, +# allowing crafted unicode hostnames to bypass validation. Use the normal (public API) OkHttp connection flow via +# HttpUrl instead, which ensures only ASCII characters reach the verifier. +@defaultMessage Do not use OkHostnameVerifier directly — it is an internal OkHttp class. Use the normal OkHttp connection flow via HttpUrl (CVE-2021-0341) +okhttp3.internal.tls.OkHostnameVerifier +datadog.okhttp3.internal.tls.OkHostnameVerifier diff --git a/gradle/forbiddenapis.gradle b/gradle/forbiddenapis.gradle index 4318766c9ac..788d5b1b979 100644 --- a/gradle/forbiddenapis.gradle +++ b/gradle/forbiddenapis.gradle @@ -1,27 +1,3 @@ -buildscript { - repositories { - mavenLocal() - if (project.rootProject.hasProperty("gradlePluginProxy")) { - maven { - url project.rootProject.property("gradlePluginProxy") - allowInsecureProtocol = true - } - } - if (project.rootProject.hasProperty("mavenRepositoryProxy")) { - maven { - url project.rootProject.property("mavenRepositoryProxy") - allowInsecureProtocol = true - } - } - gradlePluginPortal() - mavenCentral() - } - - dependencies { - classpath libs.forbiddenapis - } -} - apply plugin: "de.thetaphi.forbiddenapis" def mainFilterFile = files("$rootDir/gradle/forbiddenApiFilters/main.txt") diff --git a/gradle/gradle-daemon-jvm.properties b/gradle/gradle-daemon-jvm.properties index aee9a3c9b42..fa4ed510e60 100644 --- a/gradle/gradle-daemon-jvm.properties +++ b/gradle/gradle-daemon-jvm.properties @@ -1,12 +1,12 @@ -#This file is generated by updateDaemonJvm `./gradlew updateDaemonJvm --jvm-version=21` -toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect -toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect -toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect -toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect -toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/46949723aaa20c7b64d7ecfed7207034/redirect -toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/d6690dfd71c4c91e08577437b5b2beb0/redirect -toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/df211d3c3eefdc408b462041881bc575/redirect -toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/b41931cf1e70bc8e08d7dd19c343ef00/redirect -toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/3cd7045fca9a72cd9bc7d14a385e594c/redirect -toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/552c7bffe0370c66410a51c55985b511/redirect -toolchainVersion=21 +#This file is generated by updateDaemonJvm +toolchainUrl.FREE_BSD.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect +toolchainUrl.FREE_BSD.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect +toolchainUrl.LINUX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect +toolchainUrl.LINUX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect +toolchainUrl.MAC_OS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/c2dd35c9d0aaf0ba6ad0791320f99dfc/redirect +toolchainUrl.MAC_OS.X86_64=https\://api.foojay.io/disco/v3.0/ids/e5810bd7fd1f8a586644409d395a7e55/redirect +toolchainUrl.UNIX.AARCH64=https\://api.foojay.io/disco/v3.0/ids/cf726b4a1c84b50457225f9bba6d7650/redirect +toolchainUrl.UNIX.X86_64=https\://api.foojay.io/disco/v3.0/ids/fa1e318c287360478e3c83a9a3ef1007/redirect +toolchainUrl.WINDOWS.AARCH64=https\://api.foojay.io/disco/v3.0/ids/7b3c4877c0749019e6805bb61e421497/redirect +toolchainUrl.WINDOWS.X86_64=https\://api.foojay.io/disco/v3.0/ids/d76df094a9cbbabd3b08251f9e61444a/redirect +toolchainVersion=25 diff --git a/gradle/jacoco.gradle b/gradle/jacoco.gradle index 72dda0fc10b..473a3eceee3 100644 --- a/gradle/jacoco.gradle +++ b/gradle/jacoco.gradle @@ -1,7 +1,7 @@ apply plugin: 'jacoco' jacoco { - toolVersion = '0.8.14' + toolVersion = '0.8.15' } tasks.register('forkedTestJacocoData') { diff --git a/gradle/java_no_deps.gradle b/gradle/java_no_deps.gradle index 4d446e4a610..c61623c39f5 100644 --- a/gradle/java_no_deps.gradle +++ b/gradle/java_no_deps.gradle @@ -1,6 +1,8 @@ import datadog.gradle.plugin.testJvmConstraints.TestJvmConstraintsExtension import datadog.gradle.plugin.testJvmConstraints.ProvideJvmArgsOnJvmLauncherVersion import groovy.transform.CompileStatic +import org.gradle.api.services.BuildService +import org.gradle.api.services.BuildServiceParameters import java.nio.file.Files import java.nio.file.LinkOption @@ -103,13 +105,33 @@ class TracerJavaExtension { } } - // "socket-utils" is only set to compileOnly because the implementation dependency incorrectly adds Java17 classes to all jar prefixes. - // This causes the AgentJarIndex to search for other non-Java17 classes in the wrong prefix location and fail to resolve class names. if (sourceSetConfig.compileOnly.orElse(false).get()) { + // The ":utils:socket-utils" is only set to `compileOnly` because the `implementation` dependency + // adds Java17 classes to all jar prefixes, which is incorrect for this project. + // This causes the AgentJarIndex to search for other non-Java17 classes in the wrong prefix + // location and to fail to resolve class names. project.dependencies.add("compileOnly", mainForJavaVersionSourceSet.output) } else { + // Wire this additional source-set into this project without publishing its raw output + // (handled by the jar configuration). The following + // + // * make this additional source-set's _compile classpath_ visible to **main compilation** through `compileOnly` + // * make this additional source-set's _compiled output_ visible to **main compilation** through `compileOnly` + // * make this additional source-set's _compiled output_ visible to tests through `testImplementation` + // + // The jar task produces the artifact that consumer wants to see, and it is configured + // below to add classes of this additional source-set. + // + // NOTE: + // We don't want to add this source-set's output to the `implementation` configuration! + // Otherwise this additional source-set output directory (where classes are) would end up + // being published as a runtime dependency through `runtimeElements`. + // The `runtimeElements` configuration publishes the jar artifact by default ; thus + // `runtimeElements` would have both the jar, and the added output folder. + // In short this makes classes of this extra source-set in both the jar and the directory. project.dependencies.add("compileOnly", project.files(mainForJavaVersionSourceSet.compileClasspath)) - project.dependencies.add("implementation", mainForJavaVersionSourceSet.output) + project.dependencies.add("compileOnly", mainForJavaVersionSourceSet.output) + project.dependencies.add("testImplementation", mainForJavaVersionSourceSet.output) } project.tasks.named("jar", Jar) { @@ -121,8 +143,10 @@ def tracerJavaExtension = extensions.create(TracerJavaExtension.NAME, TracerJava -// Only run one testcontainers test at a time -ext.testcontainersLimit = gradle.sharedServices.registerIfAbsent("testcontainersLimit", BuildService) { +abstract class TestcontainersLimitService implements BuildService { +} + +ext.testcontainersLimit = gradle.sharedServices.registerIfAbsent("testcontainersLimit", TestcontainersLimitService) { maxParallelUsages = 1 } @@ -130,6 +154,17 @@ ext.testcontainersLimit = gradle.sharedServices.registerIfAbsent("testcontainers tasks.register('forkedTest', Test) { group = LifecycleBasePlugin.VERIFICATION_GROUP useJUnitPlatform() + testClassesDirs = sourceSets.test.output.classesDirs + classpath = sourceSets.test.runtimeClasspath +} + +// testRuntimeActivation is registered in individual module build files after this convention is +// applied, so tasks.named() won't work here — use a lazy hook that intercepts it on registration. +tasks.withType(Test).configureEach { + if (name == 'testRuntimeActivation') { + testClassesDirs = sourceSets.test.output.classesDirs + classpath = sourceSets.test.runtimeClasspath + } } def applyCodeCoverage = !( @@ -196,6 +231,9 @@ tasks.withType(Javadoc).configureEach { } tasks.named("javadoc", Javadoc) { + javadocTool = javaToolchains.javadocToolFor { + languageVersion = JavaLanguageVersion.of(8) + } source = sourceSets.main.java.srcDirs classpath = configurations.compileClasspath diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 5147cb93c35..f718582d883 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,10 +4,13 @@ # Build develocity = "4.4.1" forbiddenapis = "3.10" +gradle-tooling-api = "8.14.5" +jsr305 = "3.0.2" +shadow = "9.4.2" spotbugs_annotations = "4.9.8" # DataDog libs and forks -ddprof = "1.42.0" +ddprof = "1.46.0" dogstatsd = "4.4.5" okhttp = "3.12.15" # Datadog fork to support Java 7 @@ -17,7 +20,7 @@ groovy = "3.0.25" ## Kotlin kotlin = "1.6.21" -kotlin-plugin = "2.0.21" +kotlin-plugin = "2.1.20" kotlinx-coroutines = "1.3.0" ## Scala @@ -29,9 +32,9 @@ scala33 = "3.3.0" # Bytecode manipulations & codegen autoservice = "1.1.1" -asm = "9.9.1" -byte-buddy = "1.18.8" -instrument-java = "0.0.3" +asm = "9.10.1" +byte-buddy = "1.18.10" +instrument-java = "0.0.4" # Benchmarks jmh = "1.37" @@ -41,7 +44,7 @@ jmc = "8.1.0" jafar = "0.16.0" # Web & Network -jnr-unixsocket = "0.38.24" +jnr-unixsocket = "0.38.25" okhttp-legacy = "[3.0,3.12.12]" # 3.12.x is last version to support Java7 okio = "1.17.6" # Datadog fork @@ -50,10 +53,11 @@ cafe_crypto = "0.1.0" # Common utils commons = "3.2" -guava = "[16.0,20.0]" # Last version to support Java 7 -javaparser = "3.24.4" +guava = "33.6.0-jre" +javaparser = "3.28.2" jctools = "4.0.6" -lz4 = "1.7.1" +lz4 = "1.11.0" +re2j = "1.8" # Logging slf4j = "1.7.30" @@ -78,6 +82,8 @@ testcontainers = "1.21.4" # Build develocity = { module = "com.gradle:develocity-gradle-plugin", version.ref = "develocity" } forbiddenapis = { module = "de.thetaphi:forbiddenapis", version.ref = "forbiddenapis" } +gradle-tooling-api = { module = "org.gradle:gradle-tooling-api", version.ref = "gradle-tooling-api" } +jsr305 = { module = "com.google.code.findbugs:jsr305", version.ref = "jsr305" } spotbugs-annotations = { module = "com.github.spotbugs:spotbugs-annotations", version.ref = "spotbugs_annotations" } # DataDog libs and forks @@ -118,7 +124,6 @@ instrument-java = { module = "com.datadoghq:dd-instrument-java", version.ref = " # Profiling jmc-common = { module = "org.openjdk.jmc:common", version.ref = "jmc" } jmc-flightrecorder = { module = "org.openjdk.jmc:flightrecorder", version.ref = "jmc" } -jafar-parser = { module = "io.btrace:jafar-parser", version.ref = "jafar" } jafar-tools = { module = "io.btrace:jafar-tools", version.ref = "jafar" } # Web & Network @@ -136,7 +141,8 @@ guava = { module = "com.google.guava:guava", version.ref = "guava" } javaparser = {module = "com.github.javaparser:javaparser-core", version.ref = "javaparser"} javaparser-symbol-solver = {module = "com.github.javaparser:javaparser-symbol-solver-core", version.ref = "javaparser"} jctools = { module = "org.jctools:jctools-core-jdk11", version.ref = "jctools" } -lz4 = { module = "org.lz4:lz4-java", version.ref = "lz4" } +lz4 = { module = "at.yawk.lz4:lz4-java", version.ref = "lz4" } +re2j = { module = "com.google.re2j:re2j", version.ref = "re2j" } # Logging logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "logback" } @@ -185,3 +191,6 @@ junit-platform = ["junit-platform-launcher"] mockito = ["mokito-core", "mokito-junit-jupiter", "bytebuddy", "bytebuddyagent"] groovy = ["groovy", "groovy-json"] spock = ["spock-core", "objenesis"] + +[plugins] +shadow = { id = "com.gradleup.shadow", version.ref = "shadow" } diff --git a/gradle/publish.gradle b/gradle/publish.gradle index 699e130ed22..b95913eaf07 100644 --- a/gradle/publish.gradle +++ b/gradle/publish.gradle @@ -1,5 +1,7 @@ apply plugin: 'maven-publish' apply plugin: 'signing' +apply plugin: 'dd-trace-java.version-file' +apply plugin: 'dd-trace-java.jardiff' /** * Proper publishing requires the following environment variables: @@ -9,7 +11,6 @@ apply plugin: 'signing' * GPG_PASSWORD */ -apply from: "$rootDir/gradle/version.gradle" apply from: "$rootDir/gradle/maven-pom.gradle" def isGitlabCI = providers.environmentVariable("GITLAB_CI").isPresent() @@ -38,7 +39,7 @@ publishing { def dependenciesNode = xml.asNode().appendNode('dependencies') project.configurations.api.allDependencies.each { - if ((it instanceof ProjectDependency) || !(it instanceof SelfResolvingDependency)) { + if (it instanceof ProjectDependency || it instanceof ExternalModuleDependency) { def dependencyNode = dependenciesNode.appendNode('dependency') dependencyNode.appendNode('groupId', it.group) dependencyNode.appendNode('artifactId', it.name) diff --git a/gradle/repositories.gradle b/gradle/repositories.gradle index 98085e93c50..e7d4824b4c6 100644 --- a/gradle/repositories.gradle +++ b/gradle/repositories.gradle @@ -35,4 +35,12 @@ repositories { includeGroupAndSubgroups "org.springframework" } } + // Hosts gradle-tooling-api, used by build-logic:smoke-test to run nested + // Gradle builds for smoke-test applications pinned to older Gradle versions. + maven { + url = 'https://repo.gradle.org/gradle/libs-releases' + content { + includeGroup "org.gradle" + } + } } diff --git a/gradle/spotbugs.gradle b/gradle/spotbugs.gradle index 2fea20bcdcf..a69304a7728 100644 --- a/gradle/spotbugs.gradle +++ b/gradle/spotbugs.gradle @@ -60,15 +60,5 @@ tasks.matching { it.name.startsWith('spotbugs') }.configureEach { dependencies { compileOnly(libs.spotbugs.annotations) - - testImplementation(libs.spotbugs.annotations) { - // Exclude conflicting JUnit5. - exclude group: 'org.junit' - exclude group: 'org.junit.jupiter' - exclude group: 'org.junit.platform' - // Exclude conflicting logback. - exclude group: 'ch.qos.logback' - // Exclude conflicting log4j. - exclude group: 'org.apache.logging.log4j' - } + testImplementation(libs.jsr305) } diff --git a/gradle/version.gradle b/gradle/version.gradle deleted file mode 100644 index 977f0ae3716..00000000000 --- a/gradle/version.gradle +++ /dev/null @@ -1,34 +0,0 @@ -abstract class WriteVersionNumberFile extends DefaultTask { - @Input - abstract Property getVersion() - - @Input - abstract Property getGitHash() - - @OutputDirectory - abstract DirectoryProperty getOutputDirectory() - - WriteVersionNumberFile() { - // Set conventions (defaults) - this.version.convention(project.provider { project.version.toString() }) - this.gitHash.convention(project.provider { - def stdout = new ByteArrayOutputStream() - project.exec { - commandLine 'git', 'rev-parse', '--short', 'HEAD' - standardOutput = stdout - } - return stdout.toString().trim() - }) - this.outputDirectory.convention(project.layout.buildDirectory.dir("generated/version")) - } - - @TaskAction - void writeVersionFile() { - def versionFile = outputDirectory.file("${project.name}.version").get().asFile - versionFile.parentFile.mkdirs() - versionFile.text = "${version.get()}~${gitHash.get()}" - } -} - -def versionTask = tasks.register("writeVersionNumberFile", WriteVersionNumberFile) -sourceSets.main.resources.srcDir(versionTask) diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 1b33c55baab..b1b8ef56b44 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a4cf193f638..dbe66e1d665 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,8 +1,10 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=6f74b601422d6d6fc4e1f9a1ab6522f642c2fdcbc15ae33ebd30ba3d7198e854 -distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.5-bin.zip +distributionSha256Sum=9c0f7faeeb306cb14e4279a3e084ca6b596894089a0638e68a07c945a32c9e14 +distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip networkTimeout=10000 +retries=0 +retryBackOffMs=500 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 23d15a93670..249efbb032c 100755 --- a/gradlew +++ b/gradlew @@ -1,7 +1,7 @@ #!/bin/sh # -# Copyright © 2015-2021 the original authors. +# Copyright © 2015 the original authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -20,7 +20,7 @@ ############################################################################## # -# Gradle start up script for POSIX generated by Gradle. +# gradlew start up script for POSIX generated by Gradle. # # Important for running: # @@ -29,7 +29,7 @@ # bash, then to run this script, type that shell name before the whole # command line, like: # -# ksh Gradle +# ksh gradlew # # Busybox and similar reduced shells will NOT work, because this script # requires all of these POSIX shell features: @@ -57,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. @@ -114,7 +114,6 @@ case "$( uname )" in #( NONSTOP* ) nonstop=true ;; esac -CLASSPATH="\\\"\\\"" # Determine the Java command to use to start the JVM. @@ -172,7 +171,6 @@ fi # For Cygwin or MSYS, switch paths to Windows format before running java if "$cygwin" || "$msys" ; then APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) - CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) JAVACMD=$( cygpath --unix "$JAVACMD" ) @@ -212,7 +210,6 @@ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' set -- \ "-Dorg.gradle.appname=$APP_BASE_NAME" \ - -classpath "$CLASSPATH" \ -jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \ "$@" diff --git a/gradlew.bat b/gradlew.bat index 5eed7ee8452..8508ef684d4 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -19,12 +19,12 @@ @if "%DEBUG%"=="" @echo off @rem ########################################################################## @rem -@rem Gradle startup script for Windows +@rem gradlew startup script for Windows @rem @rem ########################################################################## -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +@rem Set local scope for the variables, and ensure extensions are enabled +setlocal EnableExtensions set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. @@ -51,7 +51,7 @@ echo. 1>&2 echo Please set the JAVA_HOME variable in your environment to match the 1>&2 echo location of your Java installation. 1>&2 -goto fail +"%COMSPEC%" /c exit 1 :findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% @@ -65,30 +65,18 @@ echo. 1>&2 echo Please set the JAVA_HOME variable in your environment to match the 1>&2 echo location of your Java installation. 1>&2 -goto fail +"%COMSPEC%" /c exit 1 :execute @rem Setup the command line -set CLASSPATH= -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* +@rem Execute gradlew +@rem endlocal doesn't take effect until after the line is parsed and variables are expanded +@rem which allows us to clear the local environment before executing the java command +endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +:exitWithErrorLevel +@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts +"%COMSPEC%" /c exit %ERRORLEVEL% diff --git a/internal-api/build.gradle.kts b/internal-api/build.gradle.kts index b78e5b38b14..65be1563eda 100644 --- a/internal-api/build.gradle.kts +++ b/internal-api/build.gradle.kts @@ -1,3 +1,4 @@ +import datadog.gradle.plugin.testJvmConstraints.TestJvmSpec import de.thetaphi.forbiddenapis.gradle.CheckForbiddenApis import groovy.lang.Closure @@ -27,239 +28,244 @@ tasks.named("forbiddenApisMain") { failOnMissingClasses = false } -val minimumBranchCoverage by extra(0.7) -val minimumInstructionCoverage by extra(0.8) +extra["minimumBranchCoverage"] = 0.7 +extra["minimumInstructionCoverage"] = 0.8 -val excludedClassesCoverage by extra( - listOf( - "datadog.trace.api.ClassloaderConfigurationOverrides", - "datadog.trace.api.ClassloaderConfigurationOverrides.Lazy", - // Interface - "datadog.trace.api.EndpointTracker", - "datadog.trace.api.Platform", - // Noop implementation - "datadog.trace.api.TraceSegment.NoOp", - "datadog.trace.api.WithGlobalTracer.1", - "datadog.trace.api.gateway.Events.ET", - // Noop implementation - "datadog.trace.api.gateway.RequestContext.Noop", - // Enum - "datadog.trace.api.intake.TrackType", - "datadog.trace.api.naming.**", - // Enum - "datadog.trace.api.profiling.ProfilingSnapshot.Kind", - "datadog.trace.api.sampling.AdaptiveSampler", - "datadog.trace.api.sampling.ConstantSampler", - "datadog.trace.api.sampling.SamplingRule.Provenance", - "datadog.trace.api.sampling.SamplingRule.TraceSamplingRule.TargetSpan", - "datadog.trace.api.EndpointCheckpointerHolder", - "datadog.trace.api.iast.IastAdvice.Kind", - "datadog.trace.api.UserEventTrackingMode", - // These are almost fully abstract classes so nothing to test - "datadog.trace.api.profiling.RecordingData", - "datadog.trace.api.appsec.AppSecEventTracker", - // POJOs - "datadog.trace.api.appsec.HttpClientPayload", - "datadog.trace.api.appsec.HttpClientRequest", - "datadog.trace.api.appsec.HttpClientResponse", - // A plain enum - "datadog.trace.api.profiling.RecordingType", - // Data Streams Monitoring - "datadog.trace.api.datastreams.Backlog", - "datadog.trace.api.datastreams.InboxItem", - "datadog.trace.api.datastreams.NoopDataStreamsMonitoring", - "datadog.trace.api.datastreams.NoopPathwayContext", - "datadog.trace.api.datastreams.SchemaRegistryUsage", - "datadog.trace.api.datastreams.StatsPoint", - // Debugger - "datadog.trace.api.debugger.DebuggerConfigUpdate", - // Bootstrap API - "datadog.trace.bootstrap.ActiveSubsystems", - "datadog.trace.bootstrap.ContextStore.Factory", - "datadog.trace.bootstrap.instrumentation.api.java.lang.ProcessImplInstrumentationHelpers", - "datadog.trace.bootstrap.instrumentation.api.Tags", - "datadog.trace.bootstrap.instrumentation.api.CommonTagValues", - // Caused by empty 'default' interface method - "datadog.trace.bootstrap.instrumentation.api.AgentPropagation", - "datadog.trace.bootstrap.instrumentation.api.AgentPropagation.ContextVisitor", - "datadog.trace.bootstrap.instrumentation.api.AgentScope", - "datadog.trace.bootstrap.instrumentation.api.AgentScope.Continuation", - "datadog.trace.bootstrap.instrumentation.api.AgentSpan", - "datadog.trace.bootstrap.instrumentation.api.AgentSpanContext", - "datadog.trace.bootstrap.instrumentation.api.AgentTracer", - "datadog.trace.bootstrap.instrumentation.api.AgentTracer.NoopAgentHistogram", - "datadog.trace.bootstrap.instrumentation.api.AgentTracer.NoopAgentTraceCollector", - "datadog.trace.bootstrap.instrumentation.api.AgentTracer.NoopTraceConfig", - "datadog.trace.bootstrap.instrumentation.api.AgentTracer.NoopTracerAPI", - "datadog.trace.bootstrap.instrumentation.api.AgentTracer.TracerAPI", - "datadog.trace.bootstrap.instrumentation.api.BlackHoleSpan", - "datadog.trace.bootstrap.instrumentation.api.BlackHoleSpan.Context", - "datadog.trace.bootstrap.instrumentation.api.ErrorPriorities", - "datadog.trace.bootstrap.instrumentation.api.ExtractedSpan", - "datadog.trace.bootstrap.instrumentation.api.ImmutableSpan", - "datadog.trace.bootstrap.instrumentation.api.InstrumentationTags", - "datadog.trace.bootstrap.instrumentation.api.InternalContextKeys", - "datadog.trace.bootstrap.instrumentation.api.InternalSpanTypes", - "datadog.trace.bootstrap.instrumentation.api.NoopAgentScope", - "datadog.trace.bootstrap.instrumentation.api.NoopAgentSpan", - "datadog.trace.bootstrap.instrumentation.api.NoopContinuation", - "datadog.trace.bootstrap.instrumentation.api.NoopScope", - "datadog.trace.bootstrap.instrumentation.api.NoopSpan", - "datadog.trace.bootstrap.instrumentation.api.NoopSpanContext", - "datadog.trace.bootstrap.instrumentation.api.NotSampledSpanContext", - "datadog.trace.bootstrap.instrumentation.api.ResourceNamePriorities", - "datadog.trace.bootstrap.instrumentation.api.Schema", - "datadog.trace.bootstrap.instrumentation.api.ScopeSource", - "datadog.trace.bootstrap.instrumentation.api.ScopedContext", - "datadog.trace.bootstrap.instrumentation.api.ScopedContextKey", - "datadog.trace.bootstrap.instrumentation.api.SpanWrapper", - "datadog.trace.bootstrap.instrumentation.api.TagContext", - "datadog.trace.bootstrap.instrumentation.api.TagContext.HttpHeaders", - "datadog.trace.api.civisibility.config.TestIdentifier", - "datadog.trace.api.civisibility.config.TestFQN", - "datadog.trace.api.civisibility.config.TestMetadata", - "datadog.trace.api.civisibility.config.TestSourceData", - "datadog.trace.api.civisibility.config.LibraryCapability", - "datadog.trace.api.civisibility.coverage.CoveragePerTestBridge", - "datadog.trace.api.civisibility.coverage.CoveragePerTestBridge.TotalProbeCount", - "datadog.trace.api.civisibility.coverage.CoveragePercentageBridge", - "datadog.trace.api.civisibility.coverage.NoOpCoverageStore", - "datadog.trace.api.civisibility.coverage.NoOpCoverageStore.Factory", - "datadog.trace.api.civisibility.coverage.NoOpProbes", - "datadog.trace.api.civisibility.coverage.TestReport", - "datadog.trace.api.civisibility.coverage.TestReportFileEntry", - "datadog.trace.api.civisibility.domain.BuildModuleLayout", - "datadog.trace.api.civisibility.domain.BuildModuleSettings", - "datadog.trace.api.civisibility.domain.BuildSessionSettings", - "datadog.trace.api.civisibility.domain.JavaAgent", - "datadog.trace.api.civisibility.domain.Language", - "datadog.trace.api.civisibility.domain.SourceSet", - "datadog.trace.api.civisibility.domain.SourceSet.Type", - "datadog.trace.api.civisibility.events.BuildEventsHandler.ModuleInfo", - "datadog.trace.api.civisibility.events.TestDescriptor", - "datadog.trace.api.civisibility.events.TestSuiteDescriptor", - "datadog.trace.api.civisibility.execution.TestStatus", - "datadog.trace.api.civisibility.telemetry.CiVisibilityCountMetric", - "datadog.trace.api.civisibility.telemetry.CiVisibilityCountMetric.IndexHolder", - "datadog.trace.api.civisibility.telemetry.CiVisibilityDistributionMetric", - "datadog.trace.api.civisibility.telemetry.CiVisibilityMetricData", - "datadog.trace.api.civisibility.telemetry.NoOpMetricCollector", - "datadog.trace.api.civisibility.telemetry.tag.*", - "datadog.trace.api.civisibility.config.Configurations", - "datadog.trace.api.civisibility.CiVisibilityWellKnownTags", - "datadog.trace.api.civisibility.InstrumentationBridge", - "datadog.trace.api.civisibility.InstrumentationTestBridge", - // POJO - "datadog.trace.api.git.GitInfo", - "datadog.trace.api.git.GitInfoProvider", - "datadog.trace.api.git.GitInfoProvider.ShaDiscrepancy", - // POJO - "datadog.trace.api.git.PersonInfo", - // POJO - "datadog.trace.api.git.CommitInfo", - // POJO - "datadog.trace.api.git.GitUtils", - // tested indirectly by dependent modules - "datadog.trace.api.git.RawParseUtils", - // tested indirectly by dependent modules - "datadog.trace.api.Config", - "datadog.trace.api.Config.HostNameHolder", - "datadog.trace.api.Config.RuntimeIdHolder", - "datadog.trace.api.DynamicConfig", - "datadog.trace.api.DynamicConfig.Builder", - "datadog.trace.api.DynamicConfig.Snapshot", - "datadog.trace.api.InstrumenterConfig", - "datadog.trace.api.ResolverCacheConfig.*", - "datadog.trace.api.logging.intake.LogsIntake", - "datadog.trace.logging.LoggingSettingsDescription", - "datadog.trace.util.AgentProxySelector", - "datadog.trace.util.AgentTaskScheduler", - "datadog.trace.util.AgentTaskScheduler.PeriodicTask", - "datadog.trace.util.AgentTaskScheduler.ShutdownHook", - "datadog.trace.util.AgentThreadFactory", - "datadog.trace.util.AgentThreadFactory.1", - "datadog.trace.util.CollectionUtils", - "datadog.trace.util.ComparableVersion", - "datadog.trace.util.ComparableVersion.BigIntegerItem", - "datadog.trace.util.ComparableVersion.IntItem", - "datadog.trace.util.ComparableVersion.ListItem", - "datadog.trace.util.ComparableVersion.LongItem", - "datadog.trace.util.ComparableVersion.StringItem", - "datadog.trace.util.ConcurrentEnumMap", - "datadog.trace.util.JPSUtils", - "datadog.trace.util.MethodHandles", - "datadog.trace.util.PidHelper", - "datadog.trace.util.PidHelper.Fallback", - "datadog.trace.util.ProcessUtils", - "datadog.trace.util.PropagationUtils", - "datadog.trace.util.UnsafeUtils", - // can't reliably force same identity hash for different instance to cover branch - "datadog.trace.api.cache.FixedSizeCache.IdentityHash", - "datadog.trace.api.cache.FixedSizeWeakKeyCache", - // Interface with default method - "datadog.trace.api.iast.Taintable", - "datadog.trace.api.Stateful", - "datadog.trace.api.Stateful.1", - // a stub - "datadog.trace.bootstrap.instrumentation.api.ProfilingContextIntegration", - "datadog.trace.bootstrap.instrumentation.api.ProfilingContextIntegration.NoOp", - // debug - "datadog.trace.api.iast.Taintable.DebugLogger", - // POJO - "datadog.trace.api.iast.util.Cookie", - "datadog.trace.api.iast.util.Cookie.Builder", - "datadog.trace.api.telemetry.Endpoint", - "datadog.trace.api.telemetry.Endpoint.Method", - "datadog.trace.api.telemetry.LogCollector.RawLogMessage", - "datadog.trace.api.telemetry.MetricCollector.DistributionSeriesPoint", - "datadog.trace.api.telemetry.MetricCollector", - // Enum - "datadog.trace.api.telemetry.WafTruncatedType", - // stubs - "datadog.trace.api.profiling.Timing.NoOp", - "datadog.trace.api.profiling.Timer.NoOp", - "datadog.trace.api.profiling.Timer.TimerType", - // tested in agent-logging - "datadog.trace.logging.LogLevel", - "datadog.trace.logging.GlobalLogLevelSwitcher", - // POJO - "datadog.trace.util.stacktrace.StackTraceBatch", - "datadog.trace.util.stacktrace.StackTraceEvent", - "datadog.trace.util.stacktrace.StackTraceFrame", - "datadog.trace.api.iast.VulnerabilityMarks", - "datadog.trace.api.iast.securitycontrol.SecurityControlHelper", - "datadog.trace.api.iast.securitycontrol.SecurityControl", - // Trivial holder and no-op - "datadog.trace.bootstrap.instrumentation.api.SpanPostProcessor.Holder", - "datadog.trace.bootstrap.instrumentation.api.SpanPostProcessor.NoOpSpanPostProcessor", - "datadog.trace.util.TempLocationManager", - "datadog.trace.util.TempLocationManager.*", - ) +extra["excludedClassesCoverage"] = listOf( + "datadog.trace.api.ClassloaderConfigurationOverrides", + "datadog.trace.api.ClassloaderConfigurationOverrides.Lazy", + // Interface + "datadog.trace.api.EndpointTracker", + "datadog.trace.api.Platform", + // Noop implementation + "datadog.trace.api.TraceSegment.NoOp", + "datadog.trace.api.WithGlobalTracer.1", + "datadog.trace.api.gateway.Events.ET", + // Noop implementation + "datadog.trace.api.gateway.RequestContext.Noop", + // Enum + "datadog.trace.api.intake.TrackType", + "datadog.trace.api.naming.**", + // Enum + "datadog.trace.api.profiling.ProfilingSnapshot.Kind", + "datadog.trace.api.sampling.AdaptiveSampler", + "datadog.trace.api.sampling.ConstantSampler", + "datadog.trace.api.sampling.SamplingRule.Provenance", + "datadog.trace.api.sampling.SamplingRule.TraceSamplingRule.TargetSpan", + "datadog.trace.api.EndpointCheckpointerHolder", + "datadog.trace.api.iast.IastAdvice.Kind", + "datadog.trace.api.UserEventTrackingMode", + // Lazy holder idiom; exercised indirectly via TagMap.EMPTY + "datadog.trace.api.OptimizedTagMap.EmptyHolder", + // These are almost fully abstract classes so nothing to test + "datadog.trace.api.profiling.RecordingData", + "datadog.trace.api.appsec.AppSecEventTracker", + // POJOs + "datadog.trace.api.appsec.HttpClientPayload", + "datadog.trace.api.appsec.HttpClientRequest", + "datadog.trace.api.appsec.HttpClientResponse", + // A plain enum + "datadog.trace.api.profiling.RecordingType", + // Data Streams Monitoring + "datadog.trace.api.datastreams.Backlog", + "datadog.trace.api.datastreams.DataStreamsTransactionExtractor.Type", // enum + "datadog.trace.api.datastreams.InboxItem", + "datadog.trace.api.datastreams.KafkaConfigReport", // pojo + "datadog.trace.api.datastreams.NoopDataStreamsMonitoring", + "datadog.trace.api.datastreams.NoopPathwayContext", + "datadog.trace.api.datastreams.SchemaRegistryUsage", + "datadog.trace.api.datastreams.StatsPoint", + // Debugger + "datadog.trace.api.debugger.DebuggerConfigUpdate", + // Bootstrap API + "datadog.trace.bootstrap.ActiveSubsystems", + "datadog.trace.bootstrap.ContextStore.Factory", + "datadog.trace.bootstrap.instrumentation.api.java.lang.ProcessImplInstrumentationHelpers", + "datadog.trace.bootstrap.instrumentation.api.Tags", + "datadog.trace.bootstrap.instrumentation.api.CommonTagValues", + // Caused by empty 'default' interface method + "datadog.trace.bootstrap.instrumentation.api.AgentPropagation", + "datadog.trace.bootstrap.instrumentation.api.AgentPropagation.ContextVisitor", + "datadog.trace.bootstrap.instrumentation.api.AgentScope", + "datadog.trace.bootstrap.instrumentation.api.AgentScope.Continuation", + "datadog.trace.bootstrap.instrumentation.api.AgentSpan", + "datadog.trace.bootstrap.instrumentation.api.AgentSpanContext", + "datadog.trace.bootstrap.instrumentation.api.AgentTracer", + "datadog.trace.bootstrap.instrumentation.api.AgentTracer.LegacyContextManager", + "datadog.trace.bootstrap.instrumentation.api.AgentTracer.NoopAgentHistogram", + "datadog.trace.bootstrap.instrumentation.api.AgentTracer.NoopAgentTraceCollector", + "datadog.trace.bootstrap.instrumentation.api.AgentTracer.NoopTraceConfig", + "datadog.trace.bootstrap.instrumentation.api.AgentTracer.NoopTracerAPI", + "datadog.trace.bootstrap.instrumentation.api.AgentTracer.TracerAPI", + "datadog.trace.bootstrap.instrumentation.api.BlackHoleSpan", + "datadog.trace.bootstrap.instrumentation.api.BlackHoleSpan.Context", + "datadog.trace.bootstrap.instrumentation.api.ErrorPriorities", + "datadog.trace.bootstrap.instrumentation.api.ExtractedSpan", + "datadog.trace.bootstrap.instrumentation.api.ImmutableSpan", + "datadog.trace.bootstrap.instrumentation.api.InstrumentationTags", + "datadog.trace.bootstrap.instrumentation.api.InternalContextKeys", + "datadog.trace.bootstrap.instrumentation.api.InternalSpanTypes", + "datadog.trace.bootstrap.instrumentation.api.NoopAgentScope", + "datadog.trace.bootstrap.instrumentation.api.NoopAgentSpan", + "datadog.trace.bootstrap.instrumentation.api.NoopContinuation", + "datadog.trace.bootstrap.instrumentation.api.NoopScope", + "datadog.trace.bootstrap.instrumentation.api.NoopSpan", + "datadog.trace.bootstrap.instrumentation.api.NoopSpanContext", + "datadog.trace.bootstrap.instrumentation.api.NotSampledSpanContext", + "datadog.trace.bootstrap.instrumentation.api.ResourceNamePriorities", + "datadog.trace.bootstrap.instrumentation.api.Schema", + "datadog.trace.bootstrap.instrumentation.api.ScopeSource", + "datadog.trace.bootstrap.instrumentation.api.ScopedContext", + "datadog.trace.bootstrap.instrumentation.api.ScopedContextKey", + "datadog.trace.bootstrap.instrumentation.api.SpanWrapper", + "datadog.trace.bootstrap.instrumentation.api.TagContext", + "datadog.trace.bootstrap.instrumentation.api.TagContext.HttpHeaders", + "datadog.trace.api.civisibility.config.TestIdentifier", + "datadog.trace.api.civisibility.config.TestFQN", + "datadog.trace.api.civisibility.config.TestMetadata", + "datadog.trace.api.civisibility.config.TestSourceData", + "datadog.trace.api.civisibility.config.LibraryCapability", + "datadog.trace.api.civisibility.coverage.CoveragePerTestBridge", + "datadog.trace.api.civisibility.coverage.CoveragePerTestBridge.TotalProbeCount", + "datadog.trace.api.civisibility.coverage.CoveragePercentageBridge", + "datadog.trace.api.civisibility.coverage.NoOpCoverageStore", + "datadog.trace.api.civisibility.coverage.NoOpCoverageStore.Factory", + "datadog.trace.api.civisibility.coverage.NoOpProbes", + "datadog.trace.api.civisibility.coverage.TestReport", + "datadog.trace.api.civisibility.coverage.TestReportFileEntry", + "datadog.trace.api.civisibility.domain.BuildModuleLayout", + "datadog.trace.api.civisibility.domain.BuildModuleSettings", + "datadog.trace.api.civisibility.domain.BuildSessionSettings", + "datadog.trace.api.civisibility.domain.JavaAgent", + "datadog.trace.api.civisibility.domain.Language", + "datadog.trace.api.civisibility.domain.SourceSet", + "datadog.trace.api.civisibility.domain.SourceSet.Type", + "datadog.trace.api.civisibility.events.BuildEventsHandler.ModuleInfo", + "datadog.trace.api.civisibility.events.TestDescriptor", + "datadog.trace.api.civisibility.events.TestSuiteDescriptor", + "datadog.trace.api.civisibility.execution.TestStatus", + "datadog.trace.api.civisibility.telemetry.CiVisibilityCountMetric", + "datadog.trace.api.civisibility.telemetry.CiVisibilityCountMetric.IndexHolder", + "datadog.trace.api.civisibility.telemetry.CiVisibilityDistributionMetric", + "datadog.trace.api.civisibility.telemetry.CiVisibilityMetricData", + "datadog.trace.api.civisibility.telemetry.NoOpMetricCollector", + "datadog.trace.api.civisibility.telemetry.tag.*", + "datadog.trace.api.civisibility.config.Configurations", + "datadog.trace.api.civisibility.CiVisibilityWellKnownTags", + "datadog.trace.api.civisibility.InstrumentationBridge", + "datadog.trace.api.civisibility.InstrumentationTestBridge", + // POJO + "datadog.trace.api.git.GitInfo", + "datadog.trace.api.git.GitInfoProvider", + "datadog.trace.api.git.GitInfoProvider.ShaDiscrepancy", + // POJO + "datadog.trace.api.git.PersonInfo", + // POJO + "datadog.trace.api.git.CommitInfo", + // POJO + "datadog.trace.api.git.GitUtils", + // tested indirectly by dependent modules + "datadog.trace.api.git.RawParseUtils", + // tested indirectly by dependent modules + "datadog.trace.api.Config", + "datadog.trace.api.Config.HostNameHolder", + "datadog.trace.api.Config.RuntimeIdHolder", + "datadog.trace.api.DynamicConfig", + "datadog.trace.api.DynamicConfig.Builder", + "datadog.trace.api.DynamicConfig.Snapshot", + "datadog.trace.api.InstrumenterConfig", + "datadog.trace.api.ResolverCacheConfig.*", + "datadog.trace.api.logging.intake.LogsIntake", + "datadog.trace.logging.LoggingSettingsDescription", + "datadog.trace.util.AgentProxySelector", + "datadog.trace.util.AgentTaskScheduler", + "datadog.trace.util.AgentTaskScheduler.PeriodicTask", + "datadog.trace.util.AgentTaskScheduler.ShutdownHook", + "datadog.trace.util.AgentThreadFactory", + "datadog.trace.util.AgentThreadFactory.1", + "datadog.trace.util.CollectionUtils", + "datadog.trace.util.ComparableVersion", + "datadog.trace.util.ComparableVersion.BigIntegerItem", + "datadog.trace.util.ComparableVersion.IntItem", + "datadog.trace.util.ComparableVersion.ListItem", + "datadog.trace.util.ComparableVersion.LongItem", + "datadog.trace.util.ComparableVersion.StringItem", + "datadog.trace.util.ConcurrentEnumMap", + "datadog.trace.util.JPSUtils", + "datadog.trace.util.MethodHandles", + "datadog.trace.util.PidHelper", + "datadog.trace.util.PidHelper.Fallback", + "datadog.trace.util.ProcessUtils", + "datadog.trace.util.PropagationUtils", + "datadog.trace.util.UnsafeUtils", + // can't reliably force same identity hash for different instance to cover branch + "datadog.trace.api.cache.FixedSizeCache.IdentityHash", + "datadog.trace.api.cache.FixedSizeWeakKeyCache", + // Interface with default method + "datadog.trace.api.civisibility.execution.TestExecutionPolicy", + "datadog.trace.api.iast.Taintable", + "datadog.trace.api.Stateful", + "datadog.trace.api.Stateful.1", + // an interface + "datadog.trace.bootstrap.instrumentation.api.ProfilerContext", + // a stub + "datadog.trace.bootstrap.instrumentation.api.ProfilingContextIntegration", + "datadog.trace.bootstrap.instrumentation.api.ProfilingContextIntegration.NoOp", + // debug + "datadog.trace.api.iast.Taintable.DebugLogger", + // POJO + "datadog.trace.api.iast.util.Cookie", + "datadog.trace.api.iast.util.Cookie.Builder", + "datadog.trace.api.telemetry.Endpoint", + "datadog.trace.api.telemetry.Endpoint.Method", + "datadog.trace.api.telemetry.LogCollector.RawLogMessage", + "datadog.trace.api.telemetry.MetricCollector.DistributionSeriesPoint", + "datadog.trace.api.telemetry.MetricCollector", + // Enum + "datadog.trace.api.telemetry.WafTruncatedType", + // stubs + "datadog.trace.api.profiling.Timing.NoOp", + "datadog.trace.api.profiling.Timer.NoOp", + "datadog.trace.api.profiling.Timer.TimerType", + // tested in agent-logging + "datadog.trace.logging.LogLevel", + "datadog.trace.logging.GlobalLogLevelSwitcher", + // POJO + "datadog.trace.util.stacktrace.StackTraceBatch", + "datadog.trace.util.stacktrace.StackTraceEvent", + "datadog.trace.util.stacktrace.StackTraceFrame", + "datadog.trace.api.iast.VulnerabilityMarks", + "datadog.trace.api.iast.securitycontrol.SecurityControlHelper", + "datadog.trace.api.iast.securitycontrol.SecurityControl", + // Trivial holder and no-op + "datadog.trace.bootstrap.instrumentation.api.SpanPostProcessor.Holder", + "datadog.trace.bootstrap.instrumentation.api.SpanPostProcessor.NoOpSpanPostProcessor", + "datadog.trace.util.TempLocationManager", + "datadog.trace.util.TempLocationManager.*", + // constants only + "datadog.trace.bootstrap.instrumentation.api.ServiceNameSources", + // POJO, covered by test suites in other gradle submodules (e.g. AIGuardInternalTests, HttpServerDecoratorTest) + "datadog.trace.bootstrap.instrumentation.api.ClientIpAddressData", ) -val excludedClassesBranchCoverage by extra( - listOf( - "datadog.trace.api.ProductActivationConfig", - "datadog.trace.api.ClassloaderConfigurationOverrides.Lazy", - "datadog.trace.util.stacktrace.HotSpotStackWalker", - "datadog.trace.util.stacktrace.StackWalkerFactory", - "datadog.trace.util.TempLocationManager", - "datadog.trace.util.TempLocationManager.*", - // Branches depend on RUM injector state that cannot be reliably controlled in unit tests - "datadog.trace.api.rum.RumInjectorMetrics", - ) +extra["excludedClassesBranchCoverage"] = listOf( + "datadog.trace.api.ProductActivationConfig", + "datadog.trace.api.ClassloaderConfigurationOverrides.Lazy", + "datadog.trace.util.stacktrace.HotSpotStackWalker", + "datadog.trace.util.stacktrace.StackWalkerFactory", + "datadog.trace.util.TempLocationManager", + "datadog.trace.util.TempLocationManager.*", + // Branches depend on RUM injector state that cannot be reliably controlled in unit tests + "datadog.trace.api.rum.RumInjectorMetrics", ) -val excludedClassesInstructionCoverage by extra( - listOf( - "datadog.trace.util.stacktrace.StackWalkerFactory" - ) -) +extra["excludedClassesInstructionCoverage"] = listOf("datadog.trace.util.stacktrace.StackWalkerFactory") dependencies { // references TraceScope and Continuation from public api api(project(":dd-trace-api")) api(libs.slf4j) + compileOnlyApi(project(":components:annotations")) api(project(":components:context")) api(project(":components:environment")) api(project(":components:json")) @@ -281,4 +287,13 @@ dependencies { jmh { jmhVersion = libs.versions.jmh.get() duplicateClassesStrategy = DuplicatesStrategy.EXCLUDE + + if (project.hasProperty("jmh.includes")) { + includes.add(project.property("jmh.includes") as String) + } + + if (project.hasProperty("testJvm")) { + val testJvmSpec = TestJvmSpec(project) + jvm.set(testJvmSpec.javaTestLauncher.map { it.executablePath.asFile.absolutePath }) + } } diff --git a/internal-api/gradle.lockfile b/internal-api/gradle.lockfile index 90063375ad6..11856405c5b 100644 --- a/internal-api/gradle.lockfile +++ b/internal-api/gradle.lockfile @@ -1,11 +1,12 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :internal-api:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,jmhCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -19,8 +20,8 @@ de.thetaphi:forbiddenapis:3.10=compileClasspath,jmhCompileClasspath,jmhRuntimeCl io.leangen.geantyref:geantyref:1.3.16=jmhRuntimeClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.jopt-simple:jopt-simple:5.0.4=jmh,jmhCompileClasspath,jmhRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc @@ -47,10 +48,10 @@ org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=jmhRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -70,11 +71,14 @@ org.openjdk.jmh:jmh-generator-bytecode:1.37=jmh,jmhCompileClasspath,jmhRuntimeCl org.openjdk.jmh:jmh-generator-reflection:1.37=jmh,jmhCompileClasspath,jmhRuntimeClasspath org.opentest4j:opentest4j:1.3.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs org.ow2.asm:asm:9.0=jmh,jmhCompileClasspath,jmhRuntimeClasspath -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/internal-api/internal-api-9/build.gradle.kts b/internal-api/internal-api-9/build.gradle.kts index b4abf186096..07683371538 100644 --- a/internal-api/internal-api-9/build.gradle.kts +++ b/internal-api/internal-api-9/build.gradle.kts @@ -34,8 +34,8 @@ listOf(JavaCompile::class.java, GroovyCompile::class.java).forEach { compileTask } } -val minimumBranchCoverage by extra(0.8) -val minimumInstructionCoverage by extra(0.8) +extra["minimumBranchCoverage"] = 0.8 +extra["minimumInstructionCoverage"] = 0.8 dependencies { api(project(":internal-api")) diff --git a/internal-api/internal-api-9/gradle.lockfile b/internal-api/internal-api-9/gradle.lockfile index a8a1d463565..05fcd7fe1e3 100644 --- a/internal-api/internal-api-9/gradle.lockfile +++ b/internal-api/internal-api-9/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :internal-api:internal-api-9:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=jmhRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=jmhRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=jmhRuntimeClasspath,testCompileClasspath,test com.blogspot.mydailyjava:weak-lock-free:0.17=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=jmhRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=jmhRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=jmhRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=jmhRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=jmhRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=jmhRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=jmhRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=jmhRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=jmhRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=jmhRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=jmhRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=jmhRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=jmhRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=jmhRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=jmhRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,jmhCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=jmhRuntimeClasspath,testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=jmhRuntimeClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=jmhRuntimeClasspath,testCompileClasspath,testRuntim commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=jmhRuntimeClasspath,testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=jmhRuntimeClasspath,testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=jmhRuntimeClasspath,testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=jmhRuntimeClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=jmhRuntimeClasspath,testRuntimeClasspath net.java.dev.jna:jna:5.8.0=jmhRuntimeClasspath,testRuntimeClasspath net.sf.jopt-simple:jopt-simple:5.0.4=jmh,jmhCompileClasspath,jmhRuntimeClasspath @@ -72,12 +77,13 @@ org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=jmhRuntimeClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.jctools:jctools-core-jdk11:4.0.6=jmhRuntimeClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=jmhRuntimeClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=jmhRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -99,15 +105,17 @@ org.openjdk.jmh:jmh-generator-reflection:1.37=jmh,jmhCompileClasspath,jmhRuntime org.opentest4j:opentest4j:1.3.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=jmhRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt org.ow2.asm:asm-commons:9.7.1=jmhRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt org.ow2.asm:asm-tree:9.7.1=jmhRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=jmhRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs org.ow2.asm:asm:9.0=jmh,jmhCompileClasspath -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm:9.9.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.10.1=jacocoAnt,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/internal-api/src/jmh/java/datadog/trace/api/TagMapAccessBenchmark.java b/internal-api/src/jmh/java/datadog/trace/api/TagMapAccessBenchmark.java new file mode 100644 index 00000000000..de33c957e9a --- /dev/null +++ b/internal-api/src/jmh/java/datadog/trace/api/TagMapAccessBenchmark.java @@ -0,0 +1,168 @@ +package datadog.trace.api; + +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; + +/** + * Throughput microbenchmark for the core {@link TagMap} access paths — insert (direct, via Ledger, + * and HashMap variants), raw-value read, and Entry read — over a representative HTTP-server-ish tag + * set. + * + *

      Threading correctness. Runs at {@code @Threads(8)}. All shared state is + * immutable ({@link #NAMES}/{@link #VALUES}); every bit of mutable state lives in a + * {@code @State(Scope.Thread)} holder so threads never contend on a shared map, index, or reader + * flyweight. Earlier TagMap benchmarks shared a cross-thread counter/index, which turned the result + * into a contention measurement rather than a TagMap measurement — this layout avoids that. Indices + * are plain per-invocation locals. + * + *

      Run configuration is baked into annotations rather than relying on {@code -Pjmh.*} flags + * (which the {@code me.champeau.jmh} plugin ignores). + * + *

      Key findings (MacBook M1, 8 threads, Java 17): + * + *

        + *
      • get: TagMap ({@code getObject}/{@code getEntry} ~96M ops/s) is essentially on par + * with HashMap — the slight difference is noise. + *
      • insert: Direct {@code HashMap} put (65M) is faster than {@code TagMap} (52M) for + * plain insertion. However, if a builder pattern is required, {@code TagMap.Ledger} (41M) + * handily beats {@code HashMap} builder style — staging map + defensive copy (28M) — because + * it avoids the second allocation and second fill pass. + *
      • clone: See {@link datadog.trace.util.SingleThreadedMapBenchmark} — TagMap clone is + * ~4.6x faster than HashMap clone (295M vs 64M ops/s), which dominates span lifecycle costs. + *
      + * + * + * MacBook M1 with 8 threads (Java 17) + * + * Benchmark Mode Cnt Score Error Units + * TagMapAccessBenchmark.getEntry thrpt 5 95559437.524 ± 1381678.908 ops/s + * TagMapAccessBenchmark.getObject thrpt 5 95980166.452 ± 2217719.560 ops/s + * TagMapAccessBenchmark.insert thrpt 5 52523529.023 ± 1816998.150 ops/s + * TagMapAccessBenchmark.insert_hashMap thrpt 5 65344306.574 ± 4013136.530 ops/s + * TagMapAccessBenchmark.insert_hashMap_builderStyle thrpt 5 28057827.189 ± 1359655.664 ops/s + * TagMapAccessBenchmark.insert_via_ledger thrpt 5 41169656.095 ± 773264.754 ops/s + * + */ +@BenchmarkMode(Mode.Throughput) +@OutputTimeUnit(TimeUnit.SECONDS) +@Fork(2) +@Warmup(iterations = 3) +@Measurement(iterations = 5) +@Threads(8) +@State(Scope.Benchmark) +public class TagMapAccessBenchmark { + // a representative HTTP-server-ish tag set (immutable -> safe to share across threads) + static final String[] NAMES = { + "http.request.method", + "http.response.status_code", + "http.route", + "url.path", + "url.scheme", + "server.address", + "server.port", + "client.address", + "network.protocol.version", + "user_agent.original", + "span.kind", + "component", + "language", + "error", + "resource.name", + "service.name", + "operation.name", + "env", + }; + + static final Object[] VALUES = new Object[NAMES.length]; + + static { + for (int i = 0; i < NAMES.length; ++i) { + VALUES[i] = "value-" + i; + } + } + + /** + * Pre-populated read map, PER-THREAD ({@code Scope.Thread}): each thread owns its own map so + * reads don't contend on shared mutable state under {@code @Threads(8)}. + */ + @State(Scope.Thread) + public static class ReadMap { + TagMap map; + + @Setup(Level.Trial) + public void build() { + this.map = TagMap.create(); + for (int i = 0; i < NAMES.length; ++i) { + this.map.set(NAMES[i], VALUES[i]); + } + } + } + + @Benchmark + public TagMap insert() { + TagMap map = TagMap.create(); + for (int i = 0; i < NAMES.length; ++i) { + map.set(NAMES[i], VALUES[i]); + } + return map; + } + + @Benchmark + public TagMap insert_via_ledger() { + TagMap.Ledger ledger = TagMap.ledger(); + for (int i = 0; i < NAMES.length; ++i) { + ledger.set(NAMES[i], VALUES[i]); + } + return ledger.build(); + } + + @Benchmark + public Map insert_hashMap() { + HashMap map = new HashMap<>(); + for (int i = 0; i < NAMES.length; ++i) { + map.put(NAMES[i], VALUES[i]); + } + return map; + } + + /** + * Models the builder idiom for HashMap: accumulate into a staging map, then defensively copy. Two + * allocations, two fill passes — the honest cost of a HashMap-based builder pattern. + */ + @Benchmark + public Map insert_hashMap_builderStyle() { + HashMap staging = new HashMap<>(); + for (int i = 0; i < NAMES.length; ++i) { + staging.put(NAMES[i], VALUES[i]); + } + return new HashMap<>(staging); + } + + @Benchmark + public void getObject(ReadMap rm, Blackhole bh) { + for (int i = 0; i < NAMES.length; ++i) { + bh.consume(rm.map.getObject(NAMES[i])); + } + } + + @Benchmark + public void getEntry(ReadMap rm, Blackhole bh) { + for (int i = 0; i < NAMES.length; ++i) { + bh.consume(rm.map.getEntry(NAMES[i]).objectValue()); + } + } +} diff --git a/internal-api/src/jmh/java/datadog/trace/util/AtomicsBenchmark.java b/internal-api/src/jmh/java/datadog/trace/util/AtomicsBenchmark.java new file mode 100644 index 00000000000..b1a7f0d26c1 --- /dev/null +++ b/internal-api/src/jmh/java/datadog/trace/util/AtomicsBenchmark.java @@ -0,0 +1,172 @@ +package datadog.trace.util; + +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; +import java.util.function.Supplier; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.annotations.Warmup; + +/** + * The choice between {@link AtomicInteger} and {@link AtomicIntegerFieldUpdater} depends on the + * access pattern: + * + *
        + *
      • Frequently constructed objects: prefer AtomicFieldUpdater. It saves 16 B/op at + * construction (one fewer object) — the GC impact of that allocation compounds over the + * lifetime of the application. + *
      • Long-lived objects with heavy incrementAndGet use: AtomicInteger is ~33% faster for + * incrementAndGet (121M vs 91M ops/s). AtomicIntegerFieldUpdater carries overhead from its + * reflective field-access path that C2 cannot intrinsify as cleanly. + *
      • Read-heavy paths: essentially a wash (both ~2 B ops/s). + *
      + * + * AtomicFieldUpdater supports {@code int}, {@code long}, and reference types. + * + *

      Future: {@code VarHandle} (Java 9+) is the modern replacement for + * AtomicIntegerFieldUpdater. It avoids the reflective field-access overhead, which should close + * the incrementAndGet gap with AtomicInteger while retaining the construction allocation advantage. + * Not available here because internal-api targets Java 8. + * + * Java 17 - MacBook M1 Pro Max - 8 threads + * Benchmark Mode Cnt Score Error Units + * AtomicsBenchmark.atomicFieldUpdater_construction thrpt 6 2215272588.708 ± 88556141.052 ops/s + * AtomicsBenchmark.atomicFieldUpdater_construction:gc.alloc.rate.norm thrpt 6 16.000 ± 0.001 B/op + * + * AtomicsBenchmark.atomicFieldUpdater_get thrpt 6 2174739788.040 ± 56980971.014 ops/s + * AtomicsBenchmark.atomicFieldUpdater_get:gc.alloc.rate.norm thrpt 6 ≈ 10⁻⁶ B/op + * + * AtomicsBenchmark.atomicFieldUpdater_getVolatile thrpt 6 2157331061.707 ± 136900932.336 ops/s + * AtomicsBenchmark.atomicFieldUpdater_getVolatile:gc.alloc.rate.norm thrpt 6 ≈ 10⁻⁶ B/op + * + * AtomicsBenchmark.atomicFieldUpdater_incrementAndGet thrpt 6 90785783.320 ± 7650837.727 ops/s + * AtomicsBenchmark.atomicFieldUpdater_incrementAndGet:gc.alloc.rate.norm thrpt 6 ≈ 10⁻⁴ B/op + * + * AtomicsBenchmark.atomic_construction thrpt 6 1872153219.594 ± 83252749.463 ops/s + * AtomicsBenchmark.atomic_construction:gc.alloc.rate.norm thrpt 6 32.000 ± 0.001 B/op + * + * AtomicsBenchmark.atomic_incrementAndGet thrpt 6 120835704.294 ± 23025991.947 ops/s + * AtomicsBenchmark.atomic_incrementAndGet:gc.alloc.rate.norm thrpt 6 ≈ 10⁻⁴ B/op + * + * AtomicsBenchmark.atomic_read thrpt 6 1968266961.596 ± 57765039.412 ops/s + * AtomicsBenchmark.atomic_read:gc.alloc.rate.norm thrpt 6 ≈ 10⁻⁶ B/op + */ +@Fork(2) +@Warmup(iterations = 2) +@Measurement(iterations = 3) +@Threads(8) +public class AtomicsBenchmark { + static int SIZE = 32; + + static final class AtomicHolder { + final AtomicInteger atomic; + + AtomicHolder(int num) { + this.atomic = new AtomicInteger(num); + } + + int get() { + return this.atomic.get(); + } + + int incrementAndGet() { + return this.atomic.incrementAndGet(); + } + } + + static final class FieldHolder { + static final AtomicIntegerFieldUpdater AFU_FIELD = + AtomicIntegerFieldUpdater.newUpdater(FieldHolder.class, "field"); + + volatile int field; + + FieldHolder(int num) { + this.field = num; + } + + int getVolatile() { + return this.field; + } + + int get() { + return AFU_FIELD.get(this); + } + + int incrementAndGet() { + return AFU_FIELD.incrementAndGet(this); + } + } + + static final AtomicHolder[] atomicHolders = + init( + () -> { + AtomicHolder[] holders = new AtomicHolder[SIZE]; + for (int i = 0; i < holders.length; ++i) { + holders[i] = new AtomicHolder(i * 2); + } + return holders; + }); + + static final FieldHolder[] fieldHolders = + init( + () -> { + FieldHolder[] holders = new FieldHolder[SIZE]; + for (int i = 0; i < holders.length; ++i) { + holders[i] = new FieldHolder(i * 2); + } + return holders; + }); + + static final T init(Supplier supplier) { + return supplier.get(); + } + + @State(Scope.Thread) + public static class BenchmarkState { + int index = 0; + + T next(T[] holders) { + if (++index >= holders.length) index = 0; + return holders[index]; + } + } + + @Benchmark + public Object atomic_construction() { + return new AtomicHolder(0); + } + + @Benchmark + public int atomic_incrementAndGet(BenchmarkState state) { + return state.next(atomicHolders).incrementAndGet(); + } + + @Benchmark + public Object atomic_read(BenchmarkState state) { + return state.next(atomicHolders).get(); + } + + @Benchmark + public Object atomicFieldUpdater_construction() { + return new FieldHolder(0); + } + + @Benchmark + public Object atomicFieldUpdater_getVolatile(BenchmarkState state) { + return state.next(fieldHolders).getVolatile(); + } + + @Benchmark + public Object atomicFieldUpdater_get(BenchmarkState state) { + return state.next(fieldHolders).get(); + } + + @Benchmark + public int atomicFieldUpdater_incrementAndGet(BenchmarkState state) { + return state.next(fieldHolders).incrementAndGet(); + } +} diff --git a/internal-api/src/jmh/java/datadog/trace/util/HashtableD1Benchmark.java b/internal-api/src/jmh/java/datadog/trace/util/HashtableD1Benchmark.java new file mode 100644 index 00000000000..f8ba7177e88 --- /dev/null +++ b/internal-api/src/jmh/java/datadog/trace/util/HashtableD1Benchmark.java @@ -0,0 +1,169 @@ +package datadog.trace.util; + +import static java.util.concurrent.TimeUnit.MICROSECONDS; + +import java.util.HashMap; +import java.util.Map; +import java.util.function.Consumer; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OperationsPerInvocation; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; + +/** + * Compares {@link Hashtable.D1} against equivalent {@link HashMap} usage for add, update, and + * iterate operations. + * + *

      Each benchmark thread owns its own map ({@link Scope#Thread}), but a non-trivial thread count + * is used so allocation/GC pressure surfaces in the throughput numbers — that pressure is the main + * thing Hashtable is built to avoid. + * + *

        + *
      • add — clear the map then re-insert N fresh entries + * ({@code @OperationsPerInvocation(N_KEYS)}). Captures the steady-state cost of building up a + * map. + *
      • update — for an existing key, increment a counter. Hashtable does {@code get} + + * field mutation (no allocation); HashMap uses {@code merge(k, 1L, Long::sum)}, the idiomatic + * Java 8+ way, which still allocates a {@code Long} per call. + *
      • iterate — walk every entry and consume its key + value. + *
      + * + *

      Update is where Hashtable dominates: D1 is ~14x faster, because the HashMap path + * allocates per call (a {@code Long}) and the resulting GC pressure throttles throughput under + * multiple threads. Add is roughly comparable (both allocate one entry per insert). + * Iterate is essentially a wash — both are bucket walks. + * MacBook M1 8 threads (Java 8) + * + * Benchmark Mode Cnt Score Error Units + * HashtableD1Benchmark.add_hashMap thrpt 6 187.883 ± 189.858 ops/us + * HashtableD1Benchmark.add_hashtable thrpt 6 198.710 ± 273.035 ops/us + * + * HashtableD1Benchmark.update_hashMap thrpt 6 127.392 ± 87.482 ops/us + * HashtableD1Benchmark.update_hashtable thrpt 6 1810.244 ± 44.645 ops/us + * + * HashtableD1Benchmark.iterate_hashMap thrpt 6 20.043 ± 0.752 ops/us + * HashtableD1Benchmark.iterate_hashtable thrpt 6 22.208 ± 0.956 ops/us + * + */ +@Fork(2) +@Warmup(iterations = 2) +@Measurement(iterations = 3) +@BenchmarkMode(Mode.Throughput) +@OutputTimeUnit(MICROSECONDS) +@Threads(8) +public class HashtableD1Benchmark { + + static final int N_KEYS = 64; + static final int CAPACITY = 128; + + static final String[] SOURCE_KEYS = new String[N_KEYS]; + + static { + for (int i = 0; i < N_KEYS; ++i) { + SOURCE_KEYS[i] = "key-" + i; + } + } + + static final class D1Counter extends Hashtable.D1.Entry { + long count; + + D1Counter(String key) { + super(key); + } + } + + /** Reusable iteration consumer — avoids per-call lambda capture allocation. */ + static final class BhD1Consumer implements Consumer { + Blackhole bh; + + @Override + public void accept(D1Counter e) { + bh.consume(e.key); + bh.consume(e.count); + } + } + + @State(Scope.Thread) + public static class D1State { + Hashtable.D1 table; + HashMap hashMap; + String[] keys; + int cursor; + final BhD1Consumer consumer = new BhD1Consumer(); + + @Setup(Level.Iteration) + public void setUp() { + table = new Hashtable.D1<>(CAPACITY); + hashMap = new HashMap<>(CAPACITY); + keys = SOURCE_KEYS; + for (int i = 0; i < N_KEYS; ++i) { + table.insert(new D1Counter(keys[i])); + hashMap.put(keys[i], 0L); + } + cursor = 0; + } + + String nextKey() { + int i = cursor; + cursor = (i + 1) & (N_KEYS - 1); + return keys[i]; + } + } + + @Benchmark + @OperationsPerInvocation(N_KEYS) + public void add_hashtable(D1State s) { + Hashtable.D1 t = s.table; + String[] keys = s.keys; + t.clear(); + for (int i = 0; i < N_KEYS; ++i) { + t.insert(new D1Counter(keys[i])); + } + } + + @Benchmark + @OperationsPerInvocation(N_KEYS) + public void add_hashMap(D1State s) { + HashMap m = s.hashMap; + String[] keys = s.keys; + m.clear(); + for (int i = 0; i < N_KEYS; ++i) { + m.put(keys[i], (long) i); + } + } + + @Benchmark + public long update_hashtable(D1State s) { + D1Counter e = s.table.get(s.nextKey()); + return ++e.count; + } + + @Benchmark + public Long update_hashMap(D1State s) { + return s.hashMap.merge(s.nextKey(), 1L, Long::sum); + } + + @Benchmark + public void iterate_hashtable(D1State s, Blackhole bh) { + s.consumer.bh = bh; + s.table.forEach(s.consumer); + } + + @Benchmark + public void iterate_hashMap(D1State s, Blackhole bh) { + for (Map.Entry entry : s.hashMap.entrySet()) { + bh.consume(entry.getKey()); + bh.consume(entry.getValue()); + } + } +} diff --git a/internal-api/src/jmh/java/datadog/trace/util/HashtableD2Benchmark.java b/internal-api/src/jmh/java/datadog/trace/util/HashtableD2Benchmark.java new file mode 100644 index 00000000000..6f46a702005 --- /dev/null +++ b/internal-api/src/jmh/java/datadog/trace/util/HashtableD2Benchmark.java @@ -0,0 +1,209 @@ +package datadog.trace.util; + +import static java.util.concurrent.TimeUnit.MICROSECONDS; + +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Consumer; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OperationsPerInvocation; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; + +/** + * Compares {@link Hashtable.D2} against equivalent {@link HashMap} usage for add, update, and + * iterate operations. + * + *

      Each benchmark thread owns its own map ({@link Scope#Thread}), but a non-trivial thread count + * is used so allocation/GC pressure surfaces in the throughput numbers — that pressure is the main + * thing Hashtable is built to avoid. + * + *

        + *
      • add — clear the map then re-insert N fresh entries + * ({@code @OperationsPerInvocation(N_KEYS)}). Captures the steady-state cost of building up a + * map. + *
      • update — for an existing key, increment a counter. Hashtable does {@code get} + + * field mutation (no allocation); HashMap uses {@code merge(k, 1L, Long::sum)}, the idiomatic + * Java 8+ way, which still allocates a {@code Long} per call. + *
      • iterate — walk every entry and consume its key + value. + *
      + * + *

      The D2 variants additionally pay for a composite-key wrapper allocation in the HashMap path + * (Java has no built-in tuple-as-key) — D2 sidesteps it by taking both key parts directly. + * + *

      Update is where Hashtable dominates: D2 is ~26x faster, because the HashMap path + * allocates per call (a {@code Long}, plus a {@code Key2}) and the resulting GC pressure throttles + * throughput under multiple threads. Add is ~3x faster for D2 (Hashtable sidesteps the + * {@code Key2} allocation). Iterate is essentially a wash — both are bucket walks. + * MacBook M1 8 threads (Java 8) + * + * Benchmark Mode Cnt Score Error Units + * HashtableD2Benchmark.add_hashMap thrpt 6 77.082 ± 72.278 ops/us + * HashtableD2Benchmark.add_hashtable thrpt 6 216.813 ± 413.236 ops/us + * + * HashtableD2Benchmark.update_hashMap thrpt 6 56.077 ± 23.716 ops/us + * HashtableD2Benchmark.update_hashtable thrpt 6 1445.868 ± 157.705 ops/us + * + * HashtableD2Benchmark.iterate_hashMap thrpt 6 19.508 ± 0.760 ops/us + * HashtableD2Benchmark.iterate_hashtable thrpt 6 16.968 ± 0.371 ops/us + * + */ +@Fork(2) +@Warmup(iterations = 2) +@Measurement(iterations = 3) +@BenchmarkMode(Mode.Throughput) +@OutputTimeUnit(MICROSECONDS) +@Threads(8) +public class HashtableD2Benchmark { + + static final int N_KEYS = 64; + static final int CAPACITY = 128; + + static final String[] SOURCE_K1 = new String[N_KEYS]; + static final Integer[] SOURCE_K2 = new Integer[N_KEYS]; + + static { + for (int i = 0; i < N_KEYS; ++i) { + SOURCE_K1[i] = "key-" + i; + SOURCE_K2[i] = i * 31 + 17; + } + } + + static final class D2Counter extends Hashtable.D2.Entry { + long count; + + D2Counter(String k1, Integer k2) { + super(k1, k2); + } + } + + /** Composite key for the HashMap baseline against D2. */ + static final class Key2 { + final String k1; + final Integer k2; + final int hash; + + Key2(String k1, Integer k2) { + this.k1 = k1; + this.k2 = k2; + this.hash = Objects.hash(k1, k2); + } + + @Override + public boolean equals(Object o) { + if (!(o instanceof Key2)) { + return false; + } + Key2 other = (Key2) o; + return Objects.equals(k1, other.k1) && Objects.equals(k2, other.k2); + } + + @Override + public int hashCode() { + return hash; + } + } + + /** Reusable iteration consumer — avoids per-call lambda capture allocation. */ + static final class BhD2Consumer implements Consumer { + Blackhole bh; + + @Override + public void accept(D2Counter e) { + bh.consume(e.key1); + bh.consume(e.key2); + bh.consume(e.count); + } + } + + @State(Scope.Thread) + public static class D2State { + Hashtable.D2 table; + HashMap hashMap; + String[] k1s; + Integer[] k2s; + int cursor; + final BhD2Consumer consumer = new BhD2Consumer(); + + @Setup(Level.Iteration) + public void setUp() { + table = new Hashtable.D2<>(CAPACITY); + hashMap = new HashMap<>(CAPACITY); + k1s = SOURCE_K1; + k2s = SOURCE_K2; + for (int i = 0; i < N_KEYS; ++i) { + table.insert(new D2Counter(k1s[i], k2s[i])); + hashMap.put(new Key2(k1s[i], k2s[i]), 0L); + } + cursor = 0; + } + + int nextIndex() { + int i = cursor; + cursor = (i + 1) & (N_KEYS - 1); + return i; + } + } + + @Benchmark + @OperationsPerInvocation(N_KEYS) + public void add_hashtable(D2State s) { + Hashtable.D2 t = s.table; + String[] k1s = s.k1s; + Integer[] k2s = s.k2s; + t.clear(); + for (int i = 0; i < N_KEYS; ++i) { + t.insert(new D2Counter(k1s[i], k2s[i])); + } + } + + @Benchmark + @OperationsPerInvocation(N_KEYS) + public void add_hashMap(D2State s) { + HashMap m = s.hashMap; + String[] k1s = s.k1s; + Integer[] k2s = s.k2s; + m.clear(); + for (int i = 0; i < N_KEYS; ++i) { + m.put(new Key2(k1s[i], k2s[i]), (long) i); + } + } + + @Benchmark + public long update_hashtable(D2State s) { + int i = s.nextIndex(); + D2Counter e = s.table.get(s.k1s[i], s.k2s[i]); + return ++e.count; + } + + @Benchmark + public Long update_hashMap(D2State s) { + int i = s.nextIndex(); + return s.hashMap.merge(new Key2(s.k1s[i], s.k2s[i]), 1L, Long::sum); + } + + @Benchmark + public void iterate_hashtable(D2State s, Blackhole bh) { + s.consumer.bh = bh; + s.table.forEach(s.consumer); + } + + @Benchmark + public void iterate_hashMap(D2State s, Blackhole bh) { + for (Map.Entry entry : s.hashMap.entrySet()) { + bh.consume(entry.getKey()); + bh.consume(entry.getValue()); + } + } +} diff --git a/internal-api/src/jmh/java/datadog/trace/util/ImmutableMapBenchmark.java b/internal-api/src/jmh/java/datadog/trace/util/ImmutableMapBenchmark.java new file mode 100644 index 00000000000..e42a67ec9ea --- /dev/null +++ b/internal-api/src/jmh/java/datadog/trace/util/ImmutableMapBenchmark.java @@ -0,0 +1,202 @@ +package datadog.trace.util; + +import datadog.trace.api.TagMap; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.TreeMap; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; + +/** + * Read-side benchmark for precomputed, immutable / read-mostly maps that are shared across + * threads. Models the use case where a map is built once and then only read — often published and + * read concurrently by many threads. + * + *

      Because nothing mutates after construction, a single shared instance ({@link Scope#Benchmark}) + * read by all {@code @Threads} is realistic and contention-free. This is the read-mostly + * counterpart to the per-thread mutable {@link SingleThreadedMapBenchmark} and the contended {@code + * ConcurrentHashtable} / {@code ThreadSafeMap} suites. + * + *

      Compares {@code get} + {@code iterate} across {@link HashMap}, {@link LinkedHashMap}, {@link + * TreeMap}, {@link TagMap}, and {@link java.util.Map#copyOf} (via {@link + * CollectionUtils#tryMakeImmutableMap} — the JDK's compact, array-backed {@code + * ImmutableCollections.MapN}, which is what the agent actually uses for fixed config maps; Java + * 10+, falls back to the input map pre-10). {@code Map.copyOf}/{@code MapN} is the honest + * immutable-map baseline, not {@code HashMap}. + * + *

      Lookups use {@code EQUAL_KEYS} (distinct String instances) to exercise {@code equals()}; + * {@code *_sameKey} variants reuse the original interned key instances to show the identity fast + * path — which is the common tracer case, since map keys are typically interned tag-name constants. + * (Results pending a fresh multi-JVM run — {@code Map.copyOf} only materializes the compact form on + * Java 10+.) + */ +// @Fork(5): get_tracerImmutableMap* (MapN reached via interface dispatch) is JIT-bimodal at fewer +// forks — 5 +// forks resolves it (get_tracerImmutableMap_sameKey measured ±90% at @Fork(2) -> ±1.8% at +// @Fork(5)). +@Fork(5) +@Warmup(iterations = 2) +@Measurement(iterations = 3) +@Threads(8) +@State(Scope.Benchmark) +public class ImmutableMapBenchmark { + static final String[] INSERTION_KEYS = { + "foo", "bar", "baz", "quux", "foobar", "foobaz", "key0", "key1", "key2", "key3" + }; + + // Distinct String instances (not the literals used to build the maps) so lookups exercise + // equals(), not identity -- the realistic case for keys arriving from parsing/decoding. + static final String[] EQUAL_KEYS = newEqualKeys(); + + static String[] newEqualKeys() { + String[] keys = new String[INSERTION_KEYS.length]; + for (int i = 0; i < INSERTION_KEYS.length; ++i) { + keys[i] = new String(INSERTION_KEYS[i]); + } + return keys; + } + + static void fill(Map map) { + for (int i = 0; i < INSERTION_KEYS.length; ++i) { + map.put(INSERTION_KEYS[i], i); + } + } + + // Built once, never mutated -- safe to share across the reader threads. + HashMap hashMap; + LinkedHashMap linkedHashMap; + TreeMap treeMap; + TagMap tagMap; + Map tracerImmutableMap; + + @Setup(Level.Trial) + public void setUp() { + hashMap = new HashMap<>(); + fill(hashMap); + linkedHashMap = new LinkedHashMap<>(); + fill(linkedHashMap); + treeMap = new TreeMap<>(); + fill(treeMap); + tagMap = TagMap.create(); + for (int i = 0; i < INSERTION_KEYS.length; ++i) { + tagMap.set(INSERTION_KEYS[i], i); // primitive support + } + // JDK compact immutable map (MapN on Java 10+); the agent's actual fixed-map representation. + tracerImmutableMap = CollectionUtils.tryMakeImmutableMap(hashMap); + } + + /** Per-thread lookup cursor so each reader thread cycles keys independently. */ + @State(Scope.Thread) + public static class Cursor { + int index = 0; + + String nextKey() { + return nextKey(EQUAL_KEYS); + } + + String nextKey(String[] keys) { + if (++index >= keys.length) index = 0; + return keys[index]; + } + } + + @Benchmark + public Integer get_hashMap(Cursor cursor) { + return hashMap.get(cursor.nextKey()); + } + + @Benchmark + public Integer get_hashMap_sameKey(Cursor cursor) { + return hashMap.get(cursor.nextKey(INSERTION_KEYS)); + } + + @Benchmark + public void iterate_hashMap(Blackhole blackhole) { + for (Map.Entry entry : hashMap.entrySet()) { + blackhole.consume(entry.getKey()); + blackhole.consume(entry.getValue()); + } + } + + @Benchmark + public Integer get_linkedHashMap(Cursor cursor) { + return linkedHashMap.get(cursor.nextKey()); + } + + @Benchmark + public void iterate_linkedHashMap(Blackhole blackhole) { + for (Map.Entry entry : linkedHashMap.entrySet()) { + blackhole.consume(entry.getKey()); + blackhole.consume(entry.getValue()); + } + } + + @Benchmark + public Integer get_treeMap(Cursor cursor) { + return treeMap.get(cursor.nextKey()); + } + + @Benchmark + public void iterate_treeMap(Blackhole blackhole) { + for (Map.Entry entry : treeMap.entrySet()) { + blackhole.consume(entry.getKey()); + blackhole.consume(entry.getValue()); + } + } + + @Benchmark + public int get_tagMap(Cursor cursor) { + return tagMap.getInt(cursor.nextKey()); + } + + @Benchmark + public int get_tagMap_sameKey(Cursor cursor) { + return tagMap.getInt(cursor.nextKey(INSERTION_KEYS)); + } + + @Benchmark + public void iterate_tagMap(Blackhole blackhole) { + for (TagMap.EntryReader entry : tagMap) { + blackhole.consume(entry.tag()); + blackhole.consume(entry.intValue()); + } + } + + @Benchmark + public void iterate_tagMap_forEach(Blackhole blackhole) { + // Taking advantage of passthrough of contextObj to avoid capturing lambda + tagMap.forEach( + blackhole, + (bh, entry) -> { + bh.consume(entry.tag()); + bh.consume(entry.intValue()); + }); + } + + @Benchmark + public Integer get_tracerImmutableMap(Cursor cursor) { + return tracerImmutableMap.get(cursor.nextKey()); + } + + @Benchmark + public Integer get_tracerImmutableMap_sameKey(Cursor cursor) { + return tracerImmutableMap.get(cursor.nextKey(INSERTION_KEYS)); + } + + @Benchmark + public void iterate_tracerImmutableMap(Blackhole blackhole) { + for (Map.Entry entry : tracerImmutableMap.entrySet()) { + blackhole.consume(entry.getKey()); + blackhole.consume(entry.getValue()); + } + } +} diff --git a/internal-api/src/jmh/java/datadog/trace/util/ImmutableSetBenchmark.java b/internal-api/src/jmh/java/datadog/trace/util/ImmutableSetBenchmark.java new file mode 100644 index 00000000000..54b27604f3d --- /dev/null +++ b/internal-api/src/jmh/java/datadog/trace/util/ImmutableSetBenchmark.java @@ -0,0 +1,187 @@ +package datadog.trace.util; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; +import java.util.TreeSet; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.annotations.Warmup; + +/** + * Membership over a small, fixed, read-only string set shared across threads — split into hit and + * miss lookups (different cost shapes per structure). + * + *

      The set is built once and only read, so a single shared instance ({@link Scope#Benchmark}) + * read by all {@code @Threads} is realistic and contention-free. This is the read-mostly + * counterpart to the per-thread mutable {@link SingleThreadedSetBenchmark}, and mirrors {@link + * ImmutableMapBenchmark} on the set side. Sets in the tracer skew strongly toward this fixed, + * read-only shape. + * + *

      Strategies compared: + * + *

        + *
      • {@code array} / {@code sortedArray} — linear scan / binary search; slow on miss. + *
      • {@link HashSet} — idiomatic, fast; node-based, allocates per element. + *
      • {@link TreeSet} — comparator-ordered; worth it only for a custom comparator, not speed. + *
      • {@code tracerImmutableSet} — {@link java.util.Set#copyOf} (via {@link + * CollectionUtils#tryMakeImmutableSet}), the JDK's compact, array-backed immutable set + * ({@code ImmutableCollections.SetN}), which is what the agent actually uses for fixed config + * sets. Java 10+; falls back to {@code HashSet} pre-10. The realistic baseline for any + * flat/immutable set comparison. + *
      + * + *

      Lookups are interned (the {@code ==} fast path where a structure has one); misses are short + * and never present. + * + *

      Java 17 results (Apple M1, {@code @Fork(2)}, {@code @Threads(8)}; M ops/s = millions): + * + *

      {@code
      + * Structure              hit     miss
      + * hashSet               2159     1751    (fastest)
      + * tracerImmutableSet    1946     1633    (Set.copyOf / SetN)
      + * array                  926      584
      + * sortedArray            664      588
      + * treeSet                642      593
      + * }
      + * + *

      Key findings: + * + *

        + *
      • {@code HashSet} is fastest; {@link java.util.Set#copyOf} ({@code SetN}) trails by only ~10% + * on hit and ~7% on miss — and it's the compact, array-backed form the agent already uses for + * fixed config sets, so it's a strong default when the set is immutable. + *
      • {@code array} / {@code sortedArray} / {@code treeSet} cluster at ~0.6–0.9B — they scan, + * binary-search, or tree-walk per lookup, so they trail the hashed structures, most visibly + * on the miss path. + *
      + */ +@Fork(2) +@Warmup(iterations = 2) +@Measurement(iterations = 3) +@Threads(8) +@State(Scope.Benchmark) +public class ImmutableSetBenchmark { + static final String[] STRINGS = { + "foo", "bar", "baz", "quux", "hello", "world", + "service", "queryString", "lorem", "ipsum", "dolem", "sit" + }; + + /** Distinct String instances that are never present, for the miss path. */ + static final String[] MISSES = newMisses(); + + static String[] newMisses() { + String[] misses = new String[STRINGS.length * 4]; + for (int i = 0; i < misses.length; ++i) { + misses[i] = "dne-" + i; + } + return misses; + } + + // Built once, never mutated -- safe to share across the reader threads. + String[] array; + String[] sortedArray; + HashSet hashSet; + TreeSet treeSet; + Set tracerImmutableSet; + + @Setup(Level.Trial) + public void setUp() { + array = STRINGS; + sortedArray = Arrays.copyOf(STRINGS, STRINGS.length); + Arrays.sort(sortedArray); + hashSet = new HashSet<>(Arrays.asList(STRINGS)); + treeSet = new TreeSet<>(Arrays.asList(STRINGS)); + tracerImmutableSet = CollectionUtils.tryMakeImmutableSet(Arrays.asList(STRINGS)); + } + + /** Per-thread lookup cursor so each reader thread cycles keys independently. */ + @State(Scope.Thread) + public static class Cursor { + int hitIndex = 0; + int missIndex = 0; + + String nextHit() { + int i = hitIndex + 1; + if (i >= STRINGS.length) { + i = 0; + } + hitIndex = i; + return STRINGS[i]; + } + + String nextMiss() { + int i = missIndex + 1; + if (i >= MISSES.length) { + i = 0; + } + missIndex = i; + return MISSES[i]; + } + } + + static boolean arrayContains(String[] array, String needle) { + for (String s : array) { + if (needle.equals(s)) { + return true; + } + } + return false; + } + + @Benchmark + public boolean array_hit(Cursor cursor) { + return arrayContains(array, cursor.nextHit()); + } + + @Benchmark + public boolean array_miss(Cursor cursor) { + return arrayContains(array, cursor.nextMiss()); + } + + @Benchmark + public boolean sortedArray_hit(Cursor cursor) { + return Arrays.binarySearch(sortedArray, cursor.nextHit()) >= 0; + } + + @Benchmark + public boolean sortedArray_miss(Cursor cursor) { + return Arrays.binarySearch(sortedArray, cursor.nextMiss()) >= 0; + } + + @Benchmark + public boolean hashSet_hit(Cursor cursor) { + return hashSet.contains(cursor.nextHit()); + } + + @Benchmark + public boolean hashSet_miss(Cursor cursor) { + return hashSet.contains(cursor.nextMiss()); + } + + @Benchmark + public boolean treeSet_hit(Cursor cursor) { + return treeSet.contains(cursor.nextHit()); + } + + @Benchmark + public boolean treeSet_miss(Cursor cursor) { + return treeSet.contains(cursor.nextMiss()); + } + + @Benchmark + public boolean tracerImmutableSet_hit(Cursor cursor) { + return tracerImmutableSet.contains(cursor.nextHit()); + } + + @Benchmark + public boolean tracerImmutableSet_miss(Cursor cursor) { + return tracerImmutableSet.contains(cursor.nextMiss()); + } +} diff --git a/internal-api/src/jmh/java/datadog/trace/util/ListIterationBenchmark.java b/internal-api/src/jmh/java/datadog/trace/util/ListIterationBenchmark.java new file mode 100644 index 00000000000..30580f44719 --- /dev/null +++ b/internal-api/src/jmh/java/datadog/trace/util/ListIterationBenchmark.java @@ -0,0 +1,204 @@ +package datadog.trace.util; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.function.Supplier; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.CompilerControl; +import org.openjdk.jmh.annotations.CompilerControl.Mode; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Param; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.annotations.Warmup; + +/** + * Benchmark comparing different ways to iterate list of different types and sizes -- both with + * simple loop bodies (inline case) and complicated loop bodies (dont inline case). + * + *
        + * Compares... + *
      • (RECOMMENDED) enhanced for loop / iterator - usually most performant, since escape analysis + * usually eliminates iterator allocation + *
      • (SITUATIONAL) List.forEach - good when using a non-capturing lambda, when escape analysis + * fails to eliminate iterator allocation - good alternative + *
      • (SITUATIONAL) c-style i=0; i < list.size() - usually worse than enhanced for - might be + * useful with complicated loop body when escape analysis fails to eliminate the iterator + *
      • (DISCOURAGED) List.stream - always incurs allocation overhead - usually unnecessary + *
      • (DISCOURAGED) List.parallelStream - heavy allocation overhead - only beneficial when + * working with sets (uncommon in the java agent) + *
      • + *
      + * + *

      Java 17 results (Apple M1, {@code @Fork(2)}, {@code @Threads(8)}; {@code ArrayList}, M ops/s = + * millions, shown at two sizes): + * Iteration style size 10 size 100 + * cstyleFor 1050 165 (fastest) + * forEach 995 163 + * enhancedFor 945 153 + * iterator 935 148 (noisier run-to-run) + * streams 158 45 (~3.6x slower; allocates) + * parallelStreams ~1 ~0.3 (catastrophic at these sizes) + * + * + *

      Key findings: + * + *

        + *
      • For {@code ArrayList}, the direct styles -- {@code cstyleFor}, {@code forEach}, + * enhanced-for, and explicit {@code iterator} -- cluster within ~10% of each other; escape + * analysis eliminates the iterator allocation, so enhanced-for/iterator stay competitive + * while reading cleanest (the RECOMMENDED choice). + *
      • {@code stream()} is ~3.6x slower than direct iteration and allocates per call -- avoid on + * hot paths. + *
      • {@code parallelStream()} is catastrophic for small collections (hundreds of times slower): + * ForkJoinPool split/coordinate overhead dwarfs the work, and it is run-to-run erratic. Never + * use it for the small lists typical in the agent. + *
      • {@code _inline} vs {@code _dont_inline} loop bodies barely differ at these sizes -- the + * iteration mechanics dominate, not the body. + *
      + */ +@Fork(2) +@Warmup(iterations = 2) +@Measurement(iterations = 3) +@Threads(8) +@State(Scope.Thread) +public class ListIterationBenchmark { + public static final class Element { + int num = 0; + + @CompilerControl(Mode.INLINE) + void manipulate_inline() { + this.num += 1; + } + + @CompilerControl(Mode.DONT_INLINE) + void manipulate_dont_inline() { + this.num += 1; + } + } + + static ArrayList newArrayList(int size) { + ArrayList newList = new ArrayList<>(size); + for (int i = 0; i < size; ++i) { + newList.add(new Element()); + } + return newList; + } + + /** + * Describes the list under test as a factory rather than a prebuilt instance. Each benchmark + * thread builds its own list (with its own {@link Element}s) in {@link #setUp()}, so the {@code + * manipulate_*} mutations stay thread-local — otherwise, with {@code @Threads(8)} sharing one + * list held in an enum constant, the benchmark would measure cross-thread contention on {@code + * Element.num} rather than iteration cost. + */ + public enum ListSpec { + COLLECTIONS_EMPTY_LIST(Collections::emptyList), + EMPTY_ARRAY_LIST(ArrayList::new), + SINGLETON_LIST(() -> Collections.singletonList(new Element())), + ARRAY_LIST_1(() -> newArrayList(1)), + ARRAY_LIST_5(() -> newArrayList(5)), + ARRAY_LIST_10(() -> newArrayList(10)), + ARRAY_LIST_100(() -> newArrayList(100)); + + private final Supplier> factory; + + ListSpec(Supplier> factory) { + this.factory = factory; + } + + List build() { + return factory.get(); + } + } + + @Param ListSpec listSpec; + + List list; + + @Setup(Level.Trial) + public void setUp() { + // Built per thread (the class is @State(Scope.Thread)) so each thread owns its own Elements. + this.list = this.listSpec.build(); + } + + @Benchmark + public void forEach_inline() { + this.list.forEach(Element::manipulate_inline); + } + + @Benchmark + public void forEach_dont_inline() { + this.list.forEach(Element::manipulate_dont_inline); + } + + @Benchmark + public void enhancedFor_inline() { + // Enhanced for-loop is just syntax sugar for an Iterator + for (Element e : this.list) { + e.manipulate_inline(); + } + } + + @Benchmark + public void enhancedFor_dont_inline() { + // Enhanced for-loop is just syntax sugar for an Iterator + for (Element e : this.list) { + e.manipulate_dont_inline(); + } + } + + @Benchmark + public void iterator_inline() { + for (Iterator iter = this.list.iterator(); iter.hasNext(); ) { + iter.next().manipulate_inline(); + } + } + + @Benchmark + public void iterator_dont_inline() { + for (Iterator iter = this.list.iterator(); iter.hasNext(); ) { + iter.next().manipulate_dont_inline(); + } + } + + @Benchmark + public void cstyleFor_inline() { + for (int i = 0; i < this.list.size(); ++i) { + this.list.get(i).manipulate_inline(); + } + } + + @Benchmark + public void cstyleFor_dont_inline() { + for (int i = 0; i < this.list.size(); ++i) { + this.list.get(i).manipulate_dont_inline(); + } + } + + @Benchmark + public void streams_inline() { + this.list.stream().forEach(Element::manipulate_inline); + } + + @Benchmark + public void streams_dont_inline() { + this.list.stream().forEach(Element::manipulate_dont_inline); + } + + @Benchmark + public void parallelStreams_inline() { + this.list.parallelStream().forEach(Element::manipulate_inline); + } + + @Benchmark + public void parallelStreams_dont_inline() { + this.list.parallelStream().forEach(Element::manipulate_dont_inline); + } +} diff --git a/internal-api/src/jmh/java/datadog/trace/util/SetBenchmark.java b/internal-api/src/jmh/java/datadog/trace/util/SetBenchmark.java deleted file mode 100644 index 144e4748400..00000000000 --- a/internal-api/src/jmh/java/datadog/trace/util/SetBenchmark.java +++ /dev/null @@ -1,128 +0,0 @@ -package datadog.trace.util; - -import java.util.Arrays; -import java.util.Collections; -import java.util.HashSet; -import java.util.TreeSet; -import java.util.concurrent.ThreadLocalRandom; -import java.util.function.Supplier; -import org.openjdk.jmh.annotations.Benchmark; -import org.openjdk.jmh.annotations.Fork; -import org.openjdk.jmh.annotations.Measurement; -import org.openjdk.jmh.annotations.Threads; -import org.openjdk.jmh.annotations.Warmup; - -/** - * - * - *
        - * Benchmark showing possible ways to represent and check if a set includes an elememt... - *
      • (RECOMMENDED) HashSet - on par with TreeSet - idiomatic - *
      • (RECOMMENDED) TreeMap - on par with HashSet - better solution if custom comparator is - * needed (see CaseInsensitiveMapBenchmark) - *
      • array - slower than HashSet - *
      • sortedArray - slowest - slower than array for common case of small arrays - *
      - * - * - * MacBook M1 - 8 threads - Java 21 - * 1/3 not found rate - * - * Benchmark Mode Cnt Score Error Units - * SetBenchmark.contains_array thrpt 6 645561886.327 ± 100781717.494 ops/s - * SetBenchmark.contains_hashSet thrpt 6 1536236680.235 ± 114966961.506 ops/s - * SetBenchmark.contains_sortedArray thrpt 6 571476939.441 ± 21334620.460 ops/s - * SetBenchmark.contains_treeSet thrpt 6 1557663759.411 ± 95343683.124 ops/s - * - */ -@Fork(2) -@Warmup(iterations = 2) -@Measurement(iterations = 3) -@Threads(8) -public class SetBenchmark { - static final String[] STRINGS = - new String[] { - "foo", - "bar", - "baz", - "quux", - "hello", - "world", - "service", - "queryString", - "lorem", - "ipsum", - "dolem", - "sit" - }; - - static T init(Supplier supplier) { - return supplier.get(); - } - - static final String[] LOOKUPS = - init( - () -> { - String[] lookups = Arrays.copyOf(STRINGS, STRINGS.length * 10); - - for (int i = 0; i < STRINGS.length; ++i) { - lookups[STRINGS.length + i] = new String(STRINGS[i]); - } - - // 2 / 3 of the key look-ups miss the set - for (int i = STRINGS.length * 2; i < lookups.length; ++i) { - lookups[i] = "dne-" + ThreadLocalRandom.current().nextInt(); - } - - Collections.shuffle(Arrays.asList(lookups)); - return lookups; - }); - - static int sharedLookupIndex = 0; - - static String nextString() { - int localIndex = ++sharedLookupIndex; - if (localIndex >= LOOKUPS.length) { - sharedLookupIndex = localIndex = 0; - } - return LOOKUPS[localIndex]; - } - - static final String[] ARRAY = STRINGS; - - @Benchmark - public boolean contains_array() { - String needle = nextString(); - for (String str : ARRAY) { - if (needle.equals(str)) return true; - } - return false; - } - - static final String[] SORTED_ARRAY = - init( - () -> { - String[] sorted = Arrays.copyOf(STRINGS, STRINGS.length); - Arrays.sort(sorted); - return sorted; - }); - - @Benchmark - public boolean contains_sortedArray() { - return (Arrays.binarySearch(SORTED_ARRAY, nextString()) != -1); - } - - static final HashSet HASH_SET = new HashSet<>(Arrays.asList(STRINGS)); - - @Benchmark - public boolean contains_hashSet() { - return HASH_SET.contains(nextString()); - } - - static final TreeSet TREE_SET = new TreeSet<>(Arrays.asList(STRINGS)); - - @Benchmark - public boolean contains_treeSet() { - return HASH_SET.contains(nextString()); - } -} diff --git a/internal-api/src/jmh/java/datadog/trace/util/SingleThreadedMapBenchmark.java b/internal-api/src/jmh/java/datadog/trace/util/SingleThreadedMapBenchmark.java new file mode 100644 index 00000000000..11572aa923d --- /dev/null +++ b/internal-api/src/jmh/java/datadog/trace/util/SingleThreadedMapBenchmark.java @@ -0,0 +1,222 @@ +package datadog.trace.util; + +import datadog.trace.api.TagMap; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.TreeMap; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; + +/** + * Benchmark for single-threaded (uncontended) map usage: each thread builds, mutates, reads, and + * discards its own maps. Models the common tracer pattern of assembling a short-lived map + * (e.g. span tags) on a single thread. + * + *

      State is per-thread ({@link Scope#Thread}) so no map is ever shared — the read-mostly shared + * case lives in {@link ImmutableMapBenchmark}, and the contended case in the {@code + * ConcurrentHashtable} / {@code ThreadSafeMap} suites. Running at {@code @Threads(8)} keeps + * allocation / GC interactions visible without introducing lock contention. + * + *

      Comparing different Map types: + * + *

        + *
      • (RECOMMENDED) HashMap — fastest general-purpose lookups + *
      • (RECOMMENDED) TagMap — preferred for storing tags; excels at primitives, copying, and + * builder idioms + *
      • TreeMap — when a custom Comparator is needed (see CaseInsensitiveMapBenchmark) + *
      • LinkedHashMap — only when insertion-order iteration is required; cost is paid at + * construction and in per-entry memory + *
      + * + *

      Uncontended synchronization tax. A {@link Collections#synchronizedMap} case is included + * to measure what synchronization costs when there is no contention: because each thread + * owns its synchronized map, the monitor is only ever locked by one thread. On JVMs with biased + * locking (Java ≤ 11 by default) repeated same-thread locking should be nearly free; on Java 15+ + * (biased locking disabled by default, JEP 374) it pays the full uncontended CAS. The + * unsynchronized {@code hashMap} {@code get}/{@code iterate} methods are the in-harness baseline; + * the tax is the delta to the {@code synchronizedHashMap} equivalents. Comparing across JVM + * versions at stock flags shows the biased-locking effect. (Results pending a fresh multi-JVM run.) + */ +@Fork(2) +@Warmup(iterations = 2) +@Measurement(iterations = 3) +@Threads(8) +@State(Scope.Thread) +public class SingleThreadedMapBenchmark { + static final String[] INSERTION_KEYS = { + "foo", "bar", "baz", "quux", "foobar", "foobaz", "key0", "key1", "key2", "key3" + }; + + // Distinct String instances so lookups exercise equals(), not identity. + static final String[] EQUAL_KEYS = newEqualKeys(); + + static String[] newEqualKeys() { + String[] keys = new String[INSERTION_KEYS.length]; + for (int i = 0; i < INSERTION_KEYS.length; ++i) { + keys[i] = new String(INSERTION_KEYS[i]); + } + return keys; + } + + static void fill(Map map) { + for (int i = 0; i < INSERTION_KEYS.length; ++i) { + map.put(INSERTION_KEYS[i], i); + } + } + + static TagMap fillTagMap(TagMap map) { + for (int i = 0; i < INSERTION_KEYS.length; ++i) { + map.set(INSERTION_KEYS[i], i); // primitive support + } + return map; + } + + // Per-thread prebuilt maps for the read + clone benchmarks (built once per trial, per thread). + HashMap hashMap; + Map synchronizedHashMap; + TreeMap treeMap; + LinkedHashMap linkedHashMap; + TagMap tagMap; + int index = 0; + + @Setup(Level.Trial) + public void setUp() { + hashMap = new HashMap<>(); + fill(hashMap); + synchronizedHashMap = Collections.synchronizedMap(new HashMap<>(hashMap)); + treeMap = new TreeMap<>(); + fill(treeMap); + linkedHashMap = new LinkedHashMap<>(); + fill(linkedHashMap); + tagMap = fillTagMap(TagMap.create()); + } + + String nextLookupKey() { + if (++index >= EQUAL_KEYS.length) index = 0; + return EQUAL_KEYS[index]; + } + + // ---- construction: build cost + allocation ---- + + @Benchmark + public Map create_hashMap() { + HashMap map = new HashMap<>(); + fill(map); + return map; + } + + @Benchmark + public Map create_hashMap_sized() { + // Sizing is preferable for large maps, but in practice most of our maps fall within the + // default. + HashMap map = new HashMap<>(INSERTION_KEYS.length); + fill(map); + return map; + } + + @Benchmark + public Map create_synchronizedHashMap() { + Map map = Collections.synchronizedMap(new HashMap<>()); + fill(map); + return map; + } + + @Benchmark + public TreeMap create_treeMap() { + TreeMap map = new TreeMap<>(); + fill(map); + return map; + } + + @Benchmark + public LinkedHashMap create_linkedHashMap() { + LinkedHashMap map = new LinkedHashMap<>(); + fill(map); + return map; + } + + @Benchmark + public TagMap create_tagMap() { + return fillTagMap(TagMap.create()); + } + + @Benchmark + public TagMap create_tagMap_via_ledger() { + TagMap.Ledger ledger = TagMap.ledger(); + for (int i = 0; i < INSERTION_KEYS.length; ++i) { + ledger.set(INSERTION_KEYS[i], i); // primitive support + } + return ledger.build(); + } + + // ---- copy ---- + + @Benchmark + public Map clone_hashMap() { + return new HashMap<>(hashMap); + } + + @Benchmark + public Map clone_synchronizedHashMap() { + return Collections.synchronizedMap(new HashMap<>(synchronizedHashMap)); + } + + @Benchmark + public TreeMap clone_treeMap() { + TreeMap map = new TreeMap<>(); + map.putAll(treeMap); + return map; + } + + @Benchmark + public LinkedHashMap clone_linkedHashMap() { + return new LinkedHashMap<>(linkedHashMap); + } + + @Benchmark + public TagMap clone_tagMap() { + return tagMap.copy(); + } + + // ---- read: unsynchronized baseline vs uncontended synchronized (biased-locking story) ---- + + @Benchmark + public Integer get_hashMap() { + return hashMap.get(nextLookupKey()); + } + + @Benchmark + public Integer get_synchronizedHashMap() { + return synchronizedHashMap.get(nextLookupKey()); + } + + @Benchmark + public void iterate_hashMap(Blackhole blackhole) { + for (Map.Entry entry : hashMap.entrySet()) { + blackhole.consume(entry.getKey()); + blackhole.consume(entry.getValue()); + } + } + + @Benchmark + public void iterate_synchronizedHashMap(Blackhole blackhole) { + // Collections.synchronizedMap requires the caller to synchronize during iteration; this is the + // correct usage and measures one (uncontended) monitor acquire around the traversal. + synchronized (synchronizedHashMap) { + for (Map.Entry entry : synchronizedHashMap.entrySet()) { + blackhole.consume(entry.getKey()); + blackhole.consume(entry.getValue()); + } + } + } +} diff --git a/internal-api/src/jmh/java/datadog/trace/util/SingleThreadedSetBenchmark.java b/internal-api/src/jmh/java/datadog/trace/util/SingleThreadedSetBenchmark.java new file mode 100644 index 00000000000..e145e6bbe8b --- /dev/null +++ b/internal-api/src/jmh/java/datadog/trace/util/SingleThreadedSetBenchmark.java @@ -0,0 +1,198 @@ +package datadog.trace.util; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.Set; +import java.util.TreeSet; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; + +/** + * Single-threaded (uncontended) set usage: each thread builds, reads, and discards its own + * sets. Per-thread state ({@link Scope#Thread}); mirrors {@link SingleThreadedMapBenchmark} on the + * set side. Running at {@code @Threads(8)} keeps allocation / GC interactions visible without lock + * contention. + * + *

      Sets in the tracer skew read-only/fixed (see {@link ImmutableSetBenchmark}); this covers the + * mutable-lifecycle case for completeness and — via {@link Collections#synchronizedSet} — the + * uncontended synchronization tax. Because each thread owns its synchronized set, the + * monitor is only ever locked by one thread: biased locking ≈ free on Java ≤ 11, full uncontended + * CAS on Java 15+ (biased locking disabled by default, JEP 374). The unsynchronized {@code hashSet} + * {@code contains}/{@code iterate} methods are the in-harness baseline; the tax is the delta. + * + *

      Java 17 results (Apple M1, {@code @Fork(2)}, {@code @Threads(8)}; M ops/s = millions): + * + *

      {@code
      + * contains_hashSet            1291
      + * contains_synchronizedSet     808    (~37% slower — the uncontended sync tax)
      + * iterate_hashSet              91
      + * iterate_synchronizedSet      90    (one monitor acquire amortized over the walk)
      + *
      + * create_hashSet         81    clone_hashSet          48
      + * create_hashSet_sized   78    clone_synchronizedSet  47
      + * create_linkedHashSet   61    clone_linkedHashSet    59
      + * create_synchronizedSet 41    clone_treeSet          83
      + * create_treeSet         36
      + * }
      + * + *

      Key findings: + * + *

        + *
      • Uncontended synchronization tax on {@code contains} is ~37% (1291 → 808M ops/s) even + * with no contention and biased locking disabled (Java 17, JEP 374) — the full per-lock CAS + * cost. On {@code iterate} it nearly vanishes: a single monitor acquire amortized over the + * traversal. + *
      • Construction: {@code TreeSet} is the slowest to build (~36M); the {@code synchronizedSet} + * wrapper adds a modest cost over plain {@code HashSet}. (Allocation-path numbers carry more + * run-to-run variance than the read paths.) + *
      + */ +@Fork(2) +@Warmup(iterations = 2) +@Measurement(iterations = 3) +@Threads(8) +@State(Scope.Thread) +public class SingleThreadedSetBenchmark { + static final String[] ELEMENTS = { + "foo", "bar", "baz", "quux", "hello", "world", + "service", "queryString", "lorem", "ipsum", "dolem", "sit" + }; + + // Distinct String instances so lookups exercise equals(), not identity. + static final String[] EQUAL_ELEMENTS = newEqualElements(); + + static String[] newEqualElements() { + String[] copies = new String[ELEMENTS.length]; + for (int i = 0; i < ELEMENTS.length; ++i) { + copies[i] = new String(ELEMENTS[i]); + } + return copies; + } + + static void fill(Set set) { + for (String s : ELEMENTS) { + set.add(s); + } + } + + // Per-thread prebuilt sets for the read + clone benchmarks (built once per trial, per thread). + HashSet hashSet; + Set synchronizedSet; + TreeSet treeSet; + LinkedHashSet linkedHashSet; + int index = 0; + + @Setup(Level.Trial) + public void setUp() { + hashSet = new HashSet<>(Arrays.asList(ELEMENTS)); + synchronizedSet = Collections.synchronizedSet(new HashSet<>(hashSet)); + treeSet = new TreeSet<>(Arrays.asList(ELEMENTS)); + linkedHashSet = new LinkedHashSet<>(Arrays.asList(ELEMENTS)); + } + + String nextLookup() { + if (++index >= EQUAL_ELEMENTS.length) { + index = 0; + } + return EQUAL_ELEMENTS[index]; + } + + // ---- construction: build cost + allocation ---- + + @Benchmark + public Set create_hashSet() { + HashSet set = new HashSet<>(); + fill(set); + return set; + } + + @Benchmark + public Set create_hashSet_sized() { + HashSet set = new HashSet<>(ELEMENTS.length); + fill(set); + return set; + } + + @Benchmark + public Set create_synchronizedSet() { + Set set = Collections.synchronizedSet(new HashSet<>()); + fill(set); + return set; + } + + @Benchmark + public Set create_treeSet() { + TreeSet set = new TreeSet<>(); + fill(set); + return set; + } + + @Benchmark + public Set create_linkedHashSet() { + LinkedHashSet set = new LinkedHashSet<>(); + fill(set); + return set; + } + + // ---- copy ---- + + @Benchmark + public Set clone_hashSet() { + return new HashSet<>(hashSet); + } + + @Benchmark + public Set clone_synchronizedSet() { + return Collections.synchronizedSet(new HashSet<>(synchronizedSet)); + } + + @Benchmark + public Set clone_treeSet() { + return new TreeSet<>(treeSet); + } + + @Benchmark + public Set clone_linkedHashSet() { + return new LinkedHashSet<>(linkedHashSet); + } + + // ---- read: unsynchronized baseline vs uncontended synchronized (biased-locking story) ---- + + @Benchmark + public boolean contains_hashSet() { + return hashSet.contains(nextLookup()); + } + + @Benchmark + public boolean contains_synchronizedSet() { + return synchronizedSet.contains(nextLookup()); + } + + @Benchmark + public void iterate_hashSet(Blackhole blackhole) { + for (String s : hashSet) { + blackhole.consume(s); + } + } + + @Benchmark + public void iterate_synchronizedSet(Blackhole blackhole) { + // Collections.synchronizedSet requires the caller to synchronize during iteration; this is the + // correct usage and measures one (uncontended) monitor acquire around the traversal. + synchronized (synchronizedSet) { + for (String s : synchronizedSet) { + blackhole.consume(s); + } + } + } +} diff --git a/internal-api/src/jmh/java/datadog/trace/util/StringReplaceAllBenchmark.java b/internal-api/src/jmh/java/datadog/trace/util/StringReplaceAllBenchmark.java new file mode 100644 index 00000000000..492b56bb654 --- /dev/null +++ b/internal-api/src/jmh/java/datadog/trace/util/StringReplaceAllBenchmark.java @@ -0,0 +1,109 @@ +package datadog.trace.util; + +import de.thetaphi.forbiddenapis.SuppressForbidden; +import java.util.regex.Pattern; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.annotations.Warmup; + +/** + *

      For simple replacements, Strings.replaceAll is recommened. + * + *

      + * For simple replacements, Strings.replaceAll or String.replace out performs the regex based + * methods String.replaceAll and regex.Matcher.replaceAll by 3x in terms of throughput. + * + *

      String.replace and Strings.replaceAll also require less allocation. + * + *

      Strings.replaceAll out performs String.replace by 1.2x in terms of throughput, + * but results may vary depending on the JVM version being used. + * + *

      When pattern matching is needed, compiling the regex to Pattern slightly improves overhead, + * but dramatically reduces memory allocation to 1/4x of String.replaceAll. + * MacBook M1 with 8 threads (Java 21) + * + * + * MacBook M1 - 8 Threads - Java 21 + * + * StringReplaceAllBenchmark.regex_replaceAll thrpt 6 15500559.098 ± 8640183.754 ops/s + * StringReplaceAllBenchmark.regex_replaceAll:gc.alloc.rate thrpt 6 4516.464 ± 2561.063 MB/sec + * + * StringReplaceAllBenchmark.string_replace thrpt 6 35429131.963 ± 3203548.932 ops/s + * StringReplaceAllBenchmark.string_replace:gc.alloc.rate thrpt 6 3185.108 ± 152.601 MB/sec + * + * StringReplaceAllBenchmark.string_replaceAll thrpt 6 14253964.929 ± 4060225.866 ops/s + * StringReplaceAllBenchmark.string_replaceAll:gc.alloc.rate thrpt 6 11114.939 ± 3129.891 MB/sec + * + * StringReplaceAllBenchmark.strings_replaceAll thrpt 6 43789250.524 ± 1910948.420 ops/s + * StringReplaceAllBenchmark.strings_replaceAll:gc.alloc.rate thrpt 6 3079.973 ± 134.617 MB/sec + * + */ +@Fork(2) +@Warmup(iterations = 2) +@Measurement(iterations = 3) +@Threads(8) +@SuppressForbidden +public class StringReplaceAllBenchmark { + static final String[] INPUTS = { + "foo", + "baz", + "foobar", + "foobaz", + "foo=baz", + "bar=foo", + "foo=foo&bar=foo", + "lorem ipsum", + "datadog" + }; + + static int sharedInputIndex = 0; + + static String nextInput() { + int localIndex = ++sharedInputIndex; + if (localIndex >= INPUTS.length) { + sharedInputIndex = localIndex = 0; + } + return INPUTS[localIndex]; + } + + @Benchmark + public String string_replaceAll() { + return _string_replaceAll(nextInput()); + } + + static String _string_replaceAll(String input) { + // Underneath, this does Pattern.compile("foo").matcher(str).replaceAll() + return input.replaceAll("foo", "*redacted*"); + } + + @Benchmark + public String string_replace() { + return _string_replace(nextInput()); + } + + static String _string_replace(String input) { + return input.replace("foo", "*redacted*"); + } + + static final Pattern REGEX_COMPILED = Pattern.compile("foo"); + + @Benchmark + public String regex_replaceAll() { + return _regex_replaceAll(nextInput()); + } + + static String _regex_replaceAll(String input) { + return REGEX_COMPILED.matcher(input).replaceAll("*redcated*"); + } + + @Benchmark + public String strings_replaceAll() { + return _strings_replaceAll(nextInput()); + } + + static String _strings_replaceAll(String input) { + return Strings.replaceAll(input, "foo", "*redacted*"); + } +} diff --git a/internal-api/src/jmh/java/datadog/trace/util/StringSplitBenchmark.java b/internal-api/src/jmh/java/datadog/trace/util/StringSplitBenchmark.java new file mode 100644 index 00000000000..584c375cdea --- /dev/null +++ b/internal-api/src/jmh/java/datadog/trace/util/StringSplitBenchmark.java @@ -0,0 +1,94 @@ +package datadog.trace.util; + +import de.thetaphi.forbiddenapis.SuppressForbidden; +import java.util.regex.Pattern; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Param; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; + +/** + * Strings.split is generally faster for String processing, since it creates SubSequences that are + * views into the backing String rather than new String objects. + * Benchmark (testStr) Mode Cnt Score Error Units + * StringSplitBenchmark.pattern_split EMPTY thrpt 6 291274421.621 ± 14834420.899 ops/s + * StringSplitBenchmark.string_split EMPTY thrpt 6 1035461179.368 ± 60212686.921 ops/s + * StringSplitBenchmark.strings_split EMPTY thrpt 6 8161781738.019 ± 178530888.497 ops/s + * + * StringSplitBenchmark.pattern_split TRIVIAL thrpt 6 83982270.075 ± 10250565.633 ops/s + * StringSplitBenchmark.string_split TRIVIAL thrpt 6 848615850.339 ± 42453569.634 ops/s + * StringSplitBenchmark.strings_split TRIVIAL thrpt 6 1765290890.948 ± 160053487.111 ops/s + * + * StringSplitBenchmark.pattern_split SMALL thrpt 6 27383819.756 ± 5454020.100 ops/s + * StringSplitBenchmark.string_split SMALL thrpt 6 149047480.037 ± 6124271.615 ops/s + * StringSplitBenchmark.strings_split SMALL thrpt 6 564058097.162 ± 49305418.971 ops/s + * + * StringSplitBenchmark.pattern_split MEDIUM thrpt 6 14879131.729 ± 1981850.920 ops/s + * StringSplitBenchmark.string_split MEDIUM thrpt 6 51237769.598 ± 1808521.138 ops/s + * StringSplitBenchmark.strings_split MEDIUM thrpt 6 176976970.705 ± 6813886.658 ops/s + * + * StringSplitBenchmark.pattern_split LARGE thrpt 6 482340.838 ± 24903.187 ops/s + * StringSplitBenchmark.string_split LARGE thrpt 6 2460212.879 ± 86911.652 ops/s + * StringSplitBenchmark.strings_split LARGE thrpt 6 4023658.103 ± 30305.699 ops/s + * + */ +@Fork(2) +@Warmup(iterations = 2) +@Measurement(iterations = 3) +@Threads(8) +@State(Scope.Benchmark) +@SuppressForbidden +public class StringSplitBenchmark { + public enum TestString { + EMPTY(""), + TRIVIAL("app_key=1111"), + SMALL("app_key=1111&foo=bar&baz=quux"), + MEDIUM(repeat("app_key=1111", '&', 100)), + LARGE(repeat("app_key=1111&application_key=2222&token=0894-4832", '&', 4096)); + + final String str; + + TestString(String str) { + this.str = str; + } + }; + + @Param TestString testStr; + + static final String repeat(String repeat, char separator, int length) { + StringBuilder builder = new StringBuilder(length); + builder.append(repeat); + while (builder.length() + repeat.length() + 1 < length) { + builder.append(separator).append(repeat); + } + return builder.toString(); + } + + @Benchmark + public void string_split(Blackhole bh) { + for (String substr : this.testStr.str.split("\\&")) { + bh.consume(substr); + } + } + + static final Pattern PATTERN = Pattern.compile("\\&"); + + @Benchmark + public void pattern_split(Blackhole bh) { + for (String str : PATTERN.split(this.testStr.str)) { + bh.consume(str); + } + } + + @Benchmark + public void strings_split(Blackhole bh) { + for (SubSequence subSeq : Strings.split(this.testStr.str, '&')) { + bh.consume(subSeq); + } + } +} diff --git a/internal-api/src/jmh/java/datadog/trace/util/StringSubSequenceBenchmark.java b/internal-api/src/jmh/java/datadog/trace/util/StringSubSequenceBenchmark.java new file mode 100644 index 00000000000..d24755e950b --- /dev/null +++ b/internal-api/src/jmh/java/datadog/trace/util/StringSubSequenceBenchmark.java @@ -0,0 +1,64 @@ +package datadog.trace.util; + +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.Fork; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Threads; +import org.openjdk.jmh.annotations.Warmup; +import org.openjdk.jmh.infra.Blackhole; + +/** + * Strings.substring has 5x throughput. This is primarily achieved through less allocation. + * + *

      NOTE: The higher allocation rate is misleading because 5x the work was performed. After + * accounting for the 5x throughput difference, the actual allocation rate is 0.25x that of + * String.substring or String.subSequence / SubSequence.of. + * Benchmark Mode Cnt Score Error Units + * StringSubSequenceBenchmark.string_subSequence thrpt 6 140369998.493 ± 4387855.861 ops/s + * StringSubSequenceBenchmark.string_subSequence:gc.alloc.rate thrpt 6 88880.463 ± 2778.032 MB/sec + * + * StringSubSequenceBenchmark.string_substring thrpt 6 136916708.207 ± 12299226.575 ops/s + * StringSubSequenceBenchmark.string_substring:gc.alloc.rate thrpt 6 86689.852 ± 7777.642 MB/sec + * + * StringSubSequenceBenchmark.subSequence thrpt 6 679669385.260 ± 7194043.619 ops/s + * StringSubSequenceBenchmark.subSequence:gc.alloc.rate thrpt 6 103702.745 ± 1095.741 MB/sec + * + */ +@Fork(2) +@Warmup(iterations = 2) +@Measurement(iterations = 3) +@Threads(8) +public class StringSubSequenceBenchmark { + static final String LOREM_IPSUM = + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; + + @Benchmark + public void string_substring(Blackhole bh) { + String str = LOREM_IPSUM; + int len = str.length(); + + for (int i = 0; i < str.length(); i += 100) { + bh.consume(str.substring(i, Math.min(i + 100, len))); + } + } + + @Benchmark + public void string_subSequence(Blackhole bh) { + String str = LOREM_IPSUM; + int len = str.length(); + + for (int i = 0; i < str.length(); i += 100) { + bh.consume(str.subSequence(i, Math.min(i + 100, len))); + } + } + + @Benchmark + public void subSequence(Blackhole bh) { + String str = LOREM_IPSUM; + int len = str.length(); + + for (int i = 0; i < str.length(); i += 100) { + bh.consume(SubSequence.of(str, i, Math.min(i + 100, len))); + } + } +} diff --git a/internal-api/src/jmh/java/datadog/trace/util/UnsynchronizedMapBenchmark.java b/internal-api/src/jmh/java/datadog/trace/util/UnsynchronizedMapBenchmark.java deleted file mode 100644 index 42fec2b98e0..00000000000 --- a/internal-api/src/jmh/java/datadog/trace/util/UnsynchronizedMapBenchmark.java +++ /dev/null @@ -1,308 +0,0 @@ -package datadog.trace.util; - -import datadog.trace.api.TagMap; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.TreeMap; -import java.util.function.Supplier; -import org.openjdk.jmh.annotations.Benchmark; -import org.openjdk.jmh.annotations.Fork; -import org.openjdk.jmh.annotations.Measurement; -import org.openjdk.jmh.annotations.Threads; -import org.openjdk.jmh.annotations.Warmup; -import org.openjdk.jmh.infra.Blackhole; - -/** - * - * - *

        - * Benchmark comparing different Map-s... - *
      • (RECOMMENDED) HashMap - for fastest lookups - (not typically needed for tags) - *
      • (RECOMMENDED) TagMap - for storing tags - especially if copying between maps or using - * builders - *
      • TreeMap - better for custom Comparators - case-insensitive Maps (see - * CaseInsensitiveMapBenchmark) - *
      • LinkedHashMap - only when insertion order is needed - *
      - * - *

      TagMap is the preferred way to store tags. - * - *

      TagMap excels at storing primitives, copying between TagMap instances, and builder idioms. - * - *

      Iterator traversal with TagMap is relatively slow, but TagMap#forEach is on par (and slightly) - * faster than traditional map entry iteration. - * - *

      HashMap & LinkedHashMap perform equally well on get operations. - * - *

      HashMap is 2x faster throughput-wise to create and has less memory overhead because there's no - * linked list to capture insertion order. - * - *

      TreeMap is useful when a custom Comparator is needed -- see CaseInsensitiveMapBenchmark - * - *

      HashMap & TagMap also perform exceedingly well in cases where the exact same object is used - * for put & get operations. e.g. when using String literals or Class literals as keys - * MacBook M1 1 thread (Java 21) - * - * Benchmark Mode Cnt Score Error Units - * UnsynchronizedMapBenchmark.clone_hashMap thrpt 6 12482267.775 ± 236852.198 ops/s - * UnsynchronizedMapBenchmark.clone_linkedHashMap thrpt 6 12414187.888 ± 224418.265 ops/s - * UnsynchronizedMapBenchmark.clone_tagMap thrpt 6 49638156.234 ± 2972608.986 ops/s - * UnsynchronizedMapBenchmark.clone_treeMap thrpt 6 16201216.086 ± 619985.352 ops/s - * - * UnsynchronizedMapBenchmark.create_hashMap thrpt 6 22534042.260 ± 819970.046 ops/s - * UnsynchronizedMapBenchmark.create_hashMap_sized thrpt 6 21871270.375 ± 893842.109 ops/s - * UnsynchronizedMapBenchmark.create_linkedHashMap thrpt 6 12905731.242 ± 8930007.156 ops/s - * UnsynchronizedMapBenchmark.create_tagMap thrpt 6 15794277.380 ± 6069426.265 ops/s - * UnsynchronizedMapBenchmark.create_treeMap thrpt 6 4711961.814 ± 48582.934 ops/s - * - * UnsynchronizedMapBenchmark.get_hashMap thrpt 6 212201631.841 ± 6223069.782 ops/s - * UnsynchronizedMapBenchmark.get_hashMap_sameKey thrpt 6 392053406.085 ± 3938305.125 ops/s - * UnsynchronizedMapBenchmark.get_linkedHashMap thrpt 6 210734968.352 ± 3627805.282 ops/s - * UnsynchronizedMapBenchmark.get_tagMap thrpt 6 201864656.534 ± 4596147.771 ops/s - * UnsynchronizedMapBenchmark.get_tagMap_sameKey thrpt 6 256311645.716 ± 13315886.308 ops/s - * UnsynchronizedMapBenchmark.get_treeMap thrpt 6 94606404.423 ± 806879.890 ops/s - * - * MacBook M1 with 8 threads (Java 21) - * - * Benchmark Mode Cnt Score Error Units - * UnsynchronizedMapBenchmark.clone_hashMap thrpt 6 89645484.526 ± 6546683.185 ops/s - * UnsynchronizedMapBenchmark.clone_linkedHashMap thrpt 6 78233577.417 ± 7204526.742 ops/s - * UnsynchronizedMapBenchmark.clone_tagMap thrpt 6 315228772.058 ± 20689692.104 ops/s - * UnsynchronizedMapBenchmark.clone_treeMap thrpt 6 102416350.341 ± 7258040.561 ops/s - * - * UnsynchronizedMapBenchmark.create_hashMap thrpt 6 150462966.692 ± 11243713.572 ops/s - * UnsynchronizedMapBenchmark.create_hashMap_sized thrpt 6 111213025.138 ± 4593366.916 ops/s - * UnsynchronizedMapBenchmark.create_linkedHashMap thrpt 6 80882399.133 ± 19567359.487 ops/s - * UnsynchronizedMapBenchmark.create_tagMap thrpt 6 93026443.634 ± 11831456.794 ops/s - * UnsynchronizedMapBenchmark.create_tagMap_via_ledger thrpt 6 70769351.353 ± 3821543.185 ops/s - * UnsynchronizedMapBenchmark.create_treeMap thrpt 6 32737595.187 ± 2638992.844 ops/s - * - * UnsynchronizedMapBenchmark.get_hashMap thrpt 6 1154522356.093 ± 116525174.735 ops/s - * UnsynchronizedMapBenchmark.get_hashMap_sameKey thrpt 6 1760800709.734 ± 33551896.166 ops/s - * UnsynchronizedMapBenchmark.get_linkedHashMap thrpt 6 1191208257.933 ± 49810465.132 ops/s - * UnsynchronizedMapBenchmark.get_tagMap thrpt 6 933455574.646 ± 154146815.295 ops/s - * UnsynchronizedMapBenchmark.get_tagMap_sameKey thrpt 6 1138764608.359 ± 88352911.617 ops/s - * UnsynchronizedMapBenchmark.get_treeMap thrpt 6 490872723.682 ± 87017311.892 ops/s - * - * UnsynchronizedMapBenchmark.iterate_hashMap thrpt 6 351222668.708 ± 35242914.752 ops/s - * UnsynchronizedMapBenchmark.iterate_linkedHashMap thrpt 6 406635839.285 ± 55990655.235 ops/s - * UnsynchronizedMapBenchmark.iterate_tagMap thrpt 6 185264584.604 ± 15137886.028 ops/s - * UnsynchronizedMapBenchmark.iterate_tagMap_forEach thrpt 6 422407681.630 ± 19493455.109 ops/s - * UnsynchronizedMapBenchmark.iterate_treeMap thrpt 6 392884747.896 ± 80190674.417 ops/s - * - */ -@Fork(2) -@Warmup(iterations = 2) -@Measurement(iterations = 3) -@Threads(8) -public class UnsynchronizedMapBenchmark { - static final String[] INSERTION_KEYS = { - "foo", "bar", "baz", "quux", "foobar", "foobaz", "key0", "key1", "key2", "key3" - }; - - static final String[] EQUAL_KEYS = - init( - () -> { - String[] keys = new String[INSERTION_KEYS.length]; - for (int i = 0; i < INSERTION_KEYS.length; ++i) { - keys[i] = new String(INSERTION_KEYS[i]); - } - return keys; - }); - - static int sharedLookupIndex = 0; - - static String nextLookupKey() { - return nextLookupKey(EQUAL_KEYS); - } - - static String nextLookupKey(String[] keys) { - int localIndex = ++sharedLookupIndex; - if (localIndex >= keys.length) { - sharedLookupIndex = localIndex = 0; - } - return keys[localIndex]; - } - - static T init(Supplier supplier) { - return supplier.get(); - } - - static void fill(Map map) { - for (int i = 0; i < INSERTION_KEYS.length; ++i) { - map.put(INSERTION_KEYS[i], i); - } - } - - static HashMap _create_hashMap() { - HashMap map = new HashMap<>(); - fill(map); - return map; - } - - @Benchmark - public Map create_hashMap() { - return _create_hashMap(); - } - - @Benchmark - public Map create_hashMap_sized() { - return _create_hashMap_sized(); - } - - static final HashMap HASH_MAP = _create_hashMap(); - - @Benchmark - public Integer get_hashMap() { - return HASH_MAP.get(nextLookupKey()); - } - - @Benchmark - public void iterate_hashMap(Blackhole blackhole) { - for (Map.Entry entry : HASH_MAP.entrySet()) { - blackhole.consume(entry.getKey()); - blackhole.consume(entry.getValue()); - } - } - - @Benchmark - public Integer get_hashMap_sameKey() { - return HASH_MAP.get(nextLookupKey(INSERTION_KEYS)); - } - - @Benchmark - public Map clone_hashMap() { - return new HashMap<>(HASH_MAP); - } - - static Map _create_hashMap_sized() { - // Sizing is preferable for large maps, but in practice, most of our maps typically fall within - // the default - HashMap map = new HashMap<>(INSERTION_KEYS.length); - fill(map); - return map; - } - - static TreeMap _create_treeMap() { - TreeMap map = new TreeMap<>(); - fill(map); - return map; - } - - @Benchmark - public TreeMap create_treeMap() { - return _create_treeMap(); - } - - static final TreeMap TREE_MAP = _create_treeMap(); - - @Benchmark - public Integer get_treeMap() { - return TREE_MAP.get(nextLookupKey()); - } - - @Benchmark - public void iterate_treeMap(Blackhole blackhole) { - for (Map.Entry entry : TREE_MAP.entrySet()) { - blackhole.consume(entry.getKey()); - blackhole.consume(entry.getValue()); - } - } - - @Benchmark - public TreeMap clone_treeMap() { - TreeMap map = new TreeMap<>(); - map.putAll(TREE_MAP); - return map; - } - - static LinkedHashMap _create_linkedHashMap() { - LinkedHashMap map = new LinkedHashMap<>(); - fill(map); - return map; - } - - @Benchmark - public LinkedHashMap create_linkedHashMap() { - return _create_linkedHashMap(); - } - - static final LinkedHashMap LINKED_HASH_MAP = _create_linkedHashMap(); - - @Benchmark - public Integer get_linkedHashMap() { - return LINKED_HASH_MAP.get(nextLookupKey()); - } - - @Benchmark - public void iterate_linkedHashMap(Blackhole blackhole) { - for (Map.Entry entry : TREE_MAP.entrySet()) { - blackhole.consume(entry.getKey()); - blackhole.consume(entry.getValue()); - } - } - - @Benchmark - public LinkedHashMap clone_linkedHashMap() { - return new LinkedHashMap<>(LINKED_HASH_MAP); - } - - static TagMap _create_tagMap() { - TagMap map = TagMap.create(); - for (int i = 0; i < INSERTION_KEYS.length; ++i) { - map.set(INSERTION_KEYS[i], i); // taking advantage of primitive support - } - return map; - } - - @Benchmark - public TagMap create_tagMap() { - return _create_tagMap(); - } - - @Benchmark - public TagMap create_tagMap_via_ledger() { - TagMap.Ledger ledger = TagMap.ledger(); - for (int i = 0; i < INSERTION_KEYS.length; ++i) { - ledger.set(INSERTION_KEYS[i], i); // taking advantage of primitive support - } - return ledger.build(); - } - - static final TagMap TAG_MAP = _create_tagMap(); - - @Benchmark - public int get_tagMap() { - return TAG_MAP.getInt(nextLookupKey()); - } - - @Benchmark - public int get_tagMap_sameKey() { - return TAG_MAP.getInt(nextLookupKey(INSERTION_KEYS)); - } - - @Benchmark - public void iterate_tagMap(Blackhole blackhole) { - for (TagMap.EntryReader entry : TAG_MAP) { - blackhole.consume(entry.tag()); - blackhole.consume(entry.intValue()); - } - } - - @Benchmark - public void iterate_tagMap_forEach(Blackhole blackhole) { - // Taking advantage of passthrough of contextObj to avoid capturing lambda - TAG_MAP.forEach( - blackhole, - (bh, entry) -> { - bh.consume(entry.tag()); - bh.consume(entry.intValue()); - }); - } - - @Benchmark - public TagMap clone_tagMap() { - return TAG_MAP.copy(); - } -} diff --git a/internal-api/src/main/java/datadog/trace/api/Config.java b/internal-api/src/main/java/datadog/trace/api/Config.java index a463887f61a..7d6df22df1c 100644 --- a/internal-api/src/main/java/datadog/trace/api/Config.java +++ b/internal-api/src/main/java/datadog/trace/api/Config.java @@ -11,12 +11,13 @@ import static datadog.trace.api.ConfigDefaults.DEFAULT_API_SECURITY_ENDPOINT_COLLECTION_MESSAGE_LIMIT; import static datadog.trace.api.ConfigDefaults.DEFAULT_API_SECURITY_MAX_DOWNSTREAM_REQUEST_BODY_ANALYSIS; import static datadog.trace.api.ConfigDefaults.DEFAULT_API_SECURITY_SAMPLE_DELAY; +import static datadog.trace.api.ConfigDefaults.DEFAULT_APPSEC_AGENTIC_ONBOARDING; import static datadog.trace.api.ConfigDefaults.DEFAULT_APPSEC_BODY_PARSING_SIZE_LIMIT; import static datadog.trace.api.ConfigDefaults.DEFAULT_APPSEC_MAX_FILE_CONTENT_BYTES; import static datadog.trace.api.ConfigDefaults.DEFAULT_APPSEC_MAX_FILE_CONTENT_COUNT; import static datadog.trace.api.ConfigDefaults.DEFAULT_APPSEC_MAX_STACK_TRACES; import static datadog.trace.api.ConfigDefaults.DEFAULT_APPSEC_MAX_STACK_TRACE_DEPTH; -import static datadog.trace.api.ConfigDefaults.DEFAULT_APPSEC_REPORTING_INBAND; +import static datadog.trace.api.ConfigDefaults.DEFAULT_APPSEC_SCA_MAX_TRACKED_DEPENDENCIES; import static datadog.trace.api.ConfigDefaults.DEFAULT_APPSEC_STACK_TRACE_ENABLED; import static datadog.trace.api.ConfigDefaults.DEFAULT_APPSEC_TRACE_RATE_LIMIT; import static datadog.trace.api.ConfigDefaults.DEFAULT_APPSEC_WAF_METRICS; @@ -72,10 +73,12 @@ import static datadog.trace.api.ConfigDefaults.DEFAULT_DYNAMIC_INSTRUMENTATION_CLASSFILE_DUMP_ENABLED; import static datadog.trace.api.ConfigDefaults.DEFAULT_DYNAMIC_INSTRUMENTATION_DIAGNOSTICS_INTERVAL; import static datadog.trace.api.ConfigDefaults.DEFAULT_DYNAMIC_INSTRUMENTATION_ENABLED; +import static datadog.trace.api.ConfigDefaults.DEFAULT_DYNAMIC_INSTRUMENTATION_EVAL_TIMEOUT; import static datadog.trace.api.ConfigDefaults.DEFAULT_DYNAMIC_INSTRUMENTATION_LOCALVAR_HOISTING_LEVEL; import static datadog.trace.api.ConfigDefaults.DEFAULT_DYNAMIC_INSTRUMENTATION_MAX_PAYLOAD_SIZE; import static datadog.trace.api.ConfigDefaults.DEFAULT_DYNAMIC_INSTRUMENTATION_METRICS_ENABLED; import static datadog.trace.api.ConfigDefaults.DEFAULT_DYNAMIC_INSTRUMENTATION_POLL_INTERVAL; +import static datadog.trace.api.ConfigDefaults.DEFAULT_DYNAMIC_INSTRUMENTATION_TIMEOUT_CHECKER_MODE; import static datadog.trace.api.ConfigDefaults.DEFAULT_DYNAMIC_INSTRUMENTATION_UPLOAD_BATCH_SIZE; import static datadog.trace.api.ConfigDefaults.DEFAULT_DYNAMIC_INSTRUMENTATION_UPLOAD_FLUSH_INTERVAL; import static datadog.trace.api.ConfigDefaults.DEFAULT_DYNAMIC_INSTRUMENTATION_UPLOAD_TIMEOUT; @@ -118,6 +121,7 @@ import static datadog.trace.api.ConfigDefaults.DEFAULT_LOGS_OTEL_QUEUE_SIZE; import static datadog.trace.api.ConfigDefaults.DEFAULT_LOGS_OTEL_TIMEOUT; import static datadog.trace.api.ConfigDefaults.DEFAULT_METRICS_OTEL_CARDINALITY_LIMIT; +import static datadog.trace.api.ConfigDefaults.DEFAULT_METRICS_OTEL_EXPERIMENTAL_ENABLED; import static datadog.trace.api.ConfigDefaults.DEFAULT_METRICS_OTEL_INTERVAL; import static datadog.trace.api.ConfigDefaults.DEFAULT_METRICS_OTEL_TIMEOUT; import static datadog.trace.api.ConfigDefaults.DEFAULT_OTLP_GRPC_PORT; @@ -130,6 +134,7 @@ import static datadog.trace.api.ConfigDefaults.DEFAULT_PERF_METRICS_ENABLED; import static datadog.trace.api.ConfigDefaults.DEFAULT_PRIORITY_SAMPLING_ENABLED; import static datadog.trace.api.ConfigDefaults.DEFAULT_PRIORITY_SAMPLING_FORCE; +import static datadog.trace.api.ConfigDefaults.DEFAULT_PROPAGATION_B3_PADDING_ENABLED; import static datadog.trace.api.ConfigDefaults.DEFAULT_PROPAGATION_EXTRACT_LOG_HEADER_NAMES_ENABLED; import static datadog.trace.api.ConfigDefaults.DEFAULT_PROPAGATION_STYLE; import static datadog.trace.api.ConfigDefaults.DEFAULT_REMOTE_CONFIG_ENABLED; @@ -184,6 +189,7 @@ import static datadog.trace.api.ConfigDefaults.DEFAULT_TRACE_RATE_LIMIT; import static datadog.trace.api.ConfigDefaults.DEFAULT_TRACE_REPORT_HOSTNAME; import static datadog.trace.api.ConfigDefaults.DEFAULT_TRACE_RESOLVER_ENABLED; +import static datadog.trace.api.ConfigDefaults.DEFAULT_TRACE_STATS_INTERVAL; import static datadog.trace.api.ConfigDefaults.DEFAULT_TRACE_X_DATADOG_TAGS_MAX_LENGTH; import static datadog.trace.api.ConfigDefaults.DEFAULT_WEBSOCKET_MESSAGES_INHERIT_SAMPLING; import static datadog.trace.api.ConfigDefaults.DEFAULT_WEBSOCKET_MESSAGES_SEPARATE_TRACES; @@ -209,6 +215,7 @@ import static datadog.trace.api.config.AIGuardConfig.DEFAULT_AI_GUARD_MAX_CONTENT_SIZE; import static datadog.trace.api.config.AIGuardConfig.DEFAULT_AI_GUARD_MAX_MESSAGES_LENGTH; import static datadog.trace.api.config.AIGuardConfig.DEFAULT_AI_GUARD_TIMEOUT; +import static datadog.trace.api.config.AppSecConfig.API_SECURITY_DOWNSTREAM_BODY_ANALYSIS_SAMPLE_RATE; import static datadog.trace.api.config.AppSecConfig.API_SECURITY_DOWNSTREAM_REQUEST_ANALYSIS_SAMPLE_RATE; import static datadog.trace.api.config.AppSecConfig.API_SECURITY_DOWNSTREAM_REQUEST_BODY_ANALYSIS_SAMPLE_RATE; import static datadog.trace.api.config.AppSecConfig.API_SECURITY_ENABLED; @@ -216,6 +223,7 @@ import static datadog.trace.api.config.AppSecConfig.API_SECURITY_ENDPOINT_COLLECTION_MESSAGE_LIMIT; import static datadog.trace.api.config.AppSecConfig.API_SECURITY_MAX_DOWNSTREAM_REQUEST_BODY_ANALYSIS; import static datadog.trace.api.config.AppSecConfig.API_SECURITY_SAMPLE_DELAY; +import static datadog.trace.api.config.AppSecConfig.APPSEC_AGENTIC_ONBOARDING; import static datadog.trace.api.config.AppSecConfig.APPSEC_AUTOMATED_USER_EVENTS_TRACKING; import static datadog.trace.api.config.AppSecConfig.APPSEC_AUTO_USER_INSTRUMENTATION_MODE; import static datadog.trace.api.config.AppSecConfig.APPSEC_BODY_PARSING_SIZE_LIMIT; @@ -230,10 +238,9 @@ import static datadog.trace.api.config.AppSecConfig.APPSEC_MAX_STACK_TRACE_DEPTH; import static datadog.trace.api.config.AppSecConfig.APPSEC_OBFUSCATION_PARAMETER_KEY_REGEXP; import static datadog.trace.api.config.AppSecConfig.APPSEC_OBFUSCATION_PARAMETER_VALUE_REGEXP; -import static datadog.trace.api.config.AppSecConfig.APPSEC_REPORTING_INBAND; -import static datadog.trace.api.config.AppSecConfig.APPSEC_REPORT_TIMEOUT_SEC; import static datadog.trace.api.config.AppSecConfig.APPSEC_RULES_FILE; import static datadog.trace.api.config.AppSecConfig.APPSEC_SCA_ENABLED; +import static datadog.trace.api.config.AppSecConfig.APPSEC_SCA_MAX_TRACKED_DEPENDENCIES; import static datadog.trace.api.config.AppSecConfig.APPSEC_STACKTRACE_ENABLED_DEPRECATED; import static datadog.trace.api.config.AppSecConfig.APPSEC_STACK_TRACE_ENABLED; import static datadog.trace.api.config.AppSecConfig.APPSEC_TRACE_RATE_LIMIT; @@ -295,6 +302,7 @@ import static datadog.trace.api.config.CiVisibilityConfig.CIVISIBILITY_TEST_SKIPPING_ENABLED; import static datadog.trace.api.config.CiVisibilityConfig.CIVISIBILITY_TOTAL_FLAKY_RETRY_COUNT; import static datadog.trace.api.config.CiVisibilityConfig.CIVISIBILITY_TRACE_SANITATION_ENABLED; +import static datadog.trace.api.config.CiVisibilityConfig.CODE_COVERAGE_FLAGS; import static datadog.trace.api.config.CiVisibilityConfig.GIT_COMMIT_HEAD_SHA; import static datadog.trace.api.config.CiVisibilityConfig.GIT_PULL_REQUEST_BASE_BRANCH; import static datadog.trace.api.config.CiVisibilityConfig.GIT_PULL_REQUEST_BASE_BRANCH_SHA; @@ -323,9 +331,11 @@ import static datadog.trace.api.config.DebuggerConfig.DEBUGGER_SOURCE_FILE_TRACKING_ENABLED; import static datadog.trace.api.config.DebuggerConfig.DISTRIBUTED_DEBUGGER_ENABLED; import static datadog.trace.api.config.DebuggerConfig.DYNAMIC_INSTRUMENTATION_CAPTURE_TIMEOUT; +import static datadog.trace.api.config.DebuggerConfig.DYNAMIC_INSTRUMENTATION_CAPTURE_TIMEOUT_MS; import static datadog.trace.api.config.DebuggerConfig.DYNAMIC_INSTRUMENTATION_CLASSFILE_DUMP_ENABLED; import static datadog.trace.api.config.DebuggerConfig.DYNAMIC_INSTRUMENTATION_DIAGNOSTICS_INTERVAL; import static datadog.trace.api.config.DebuggerConfig.DYNAMIC_INSTRUMENTATION_ENABLED; +import static datadog.trace.api.config.DebuggerConfig.DYNAMIC_INSTRUMENTATION_EVAL_TIMEOUT_MS; import static datadog.trace.api.config.DebuggerConfig.DYNAMIC_INSTRUMENTATION_EXCLUDE_FILES; import static datadog.trace.api.config.DebuggerConfig.DYNAMIC_INSTRUMENTATION_INCLUDE_FILES; import static datadog.trace.api.config.DebuggerConfig.DYNAMIC_INSTRUMENTATION_INSTRUMENT_THE_WORLD; @@ -338,6 +348,7 @@ import static datadog.trace.api.config.DebuggerConfig.DYNAMIC_INSTRUMENTATION_REDACTED_TYPES; import static datadog.trace.api.config.DebuggerConfig.DYNAMIC_INSTRUMENTATION_REDACTION_EXCLUDED_IDENTIFIERS; import static datadog.trace.api.config.DebuggerConfig.DYNAMIC_INSTRUMENTATION_SNAPSHOT_URL; +import static datadog.trace.api.config.DebuggerConfig.DYNAMIC_INSTRUMENTATION_TIMEOUT_CHECKER_MODE; import static datadog.trace.api.config.DebuggerConfig.DYNAMIC_INSTRUMENTATION_UPLOAD_BATCH_SIZE; import static datadog.trace.api.config.DebuggerConfig.DYNAMIC_INSTRUMENTATION_UPLOAD_FLUSH_INTERVAL; import static datadog.trace.api.config.DebuggerConfig.DYNAMIC_INSTRUMENTATION_UPLOAD_INTERVAL_SECONDS; @@ -417,6 +428,8 @@ import static datadog.trace.api.config.GeneralConfig.TRACER_METRICS_MAX_PENDING; import static datadog.trace.api.config.GeneralConfig.TRACE_DEBUG; import static datadog.trace.api.config.GeneralConfig.TRACE_LOG_LEVEL; +import static datadog.trace.api.config.GeneralConfig.TRACE_OTEL_SEMANTICS_ENABLED; +import static datadog.trace.api.config.GeneralConfig.TRACE_STATS_CARDINALITY_LIMIT; import static datadog.trace.api.config.GeneralConfig.TRACE_STATS_COMPUTATION_ENABLED; import static datadog.trace.api.config.GeneralConfig.TRACE_STATS_COMPUTATION_IGNORE_AGENT_VERSION; import static datadog.trace.api.config.GeneralConfig.TRACE_TAGS; @@ -466,9 +479,11 @@ import static datadog.trace.api.config.OtlpConfig.LOGS_OTEL_QUEUE_SIZE; import static datadog.trace.api.config.OtlpConfig.LOGS_OTEL_TIMEOUT; import static datadog.trace.api.config.OtlpConfig.METRICS_OTEL_CARDINALITY_LIMIT; +import static datadog.trace.api.config.OtlpConfig.METRICS_OTEL_EXPERIMENTAL_ENABLED; import static datadog.trace.api.config.OtlpConfig.METRICS_OTEL_EXPORTER; import static datadog.trace.api.config.OtlpConfig.METRICS_OTEL_INTERVAL; import static datadog.trace.api.config.OtlpConfig.METRICS_OTEL_TIMEOUT; +import static datadog.trace.api.config.OtlpConfig.OTEL_TRACES_SPAN_METRICS_ENABLED; import static datadog.trace.api.config.OtlpConfig.OTLP_LOGS_COMPRESSION; import static datadog.trace.api.config.OtlpConfig.OTLP_LOGS_ENDPOINT; import static datadog.trace.api.config.OtlpConfig.OTLP_LOGS_HEADERS; @@ -683,6 +698,9 @@ import static datadog.trace.api.config.TracerConfig.TRACE_LONG_RUNNING_ENABLED; import static datadog.trace.api.config.TracerConfig.TRACE_LONG_RUNNING_FLUSH_INTERVAL; import static datadog.trace.api.config.TracerConfig.TRACE_LONG_RUNNING_INITIAL_FLUSH_INTERVAL; +import static datadog.trace.api.config.TracerConfig.TRACE_ORG_GUARD_ENABLED; +import static datadog.trace.api.config.TracerConfig.TRACE_ORG_GUARD_STRICT; +import static datadog.trace.api.config.TracerConfig.TRACE_ORG_GUARD_TRUSTED_OPMS; import static datadog.trace.api.config.TracerConfig.TRACE_PEER_HOSTNAME_ENABLED; import static datadog.trace.api.config.TracerConfig.TRACE_PEER_SERVICE_COMPONENT_OVERRIDES; import static datadog.trace.api.config.TracerConfig.TRACE_PEER_SERVICE_DEFAULTS_ENABLED; @@ -718,6 +736,7 @@ import datadog.environment.JavaVirtualMachine; import datadog.environment.OperatingSystem; import datadog.environment.SystemProperties; +import datadog.trace.api.civisibility.CIConstants; import datadog.trace.api.civisibility.CiVisibilityWellKnownTags; import datadog.trace.api.config.GeneralConfig; import datadog.trace.api.config.OtlpConfig; @@ -806,9 +825,20 @@ public class Config { private static final Logger log = LoggerFactory.getLogger(Config.class); + private static final int MAX_CODE_COVERAGE_FLAGS = 32; private static final Pattern COLON = Pattern.compile(":"); + // Historical conflating-Batch size; used to translate TRACER_METRICS_MAX_PENDING (configured in + // legacy batch units) into the new per-SpanSnapshot inbox capacity. + private static final int LEGACY_BATCH_SIZE = 64; + + // Practical upper bound on Object[] allocations. Sits a few bytes below Integer.MAX_VALUE + // because the JVM reserves header slack on array allocations; matches the JDK's own + // {@code java.util.ArraysSupport.SOFT_MAX_ARRAY_LENGTH} convention. Used to clamp computed + // capacities that feed into array-backed collections. + private static final int MAX_SAFE_ARRAY_SIZE = Integer.MAX_VALUE - 8; + private final InstrumenterConfig instrumenterConfig; private final long startTimeMillis = System.currentTimeMillis(); @@ -927,6 +957,9 @@ public static String getHostName() { private final Set tracePropagationStylesToInject; private final TracePropagationBehaviorExtract tracePropagationBehaviorExtract; private final boolean tracePropagationExtractFirst; + private final boolean traceOrgGuardEnabled; + private final boolean traceOrgGuardStrict; + private final Set traceOrgGuardTrustedOpms; private final int traceBaggageMaxItems; private final int traceBaggageMaxBytes; private final List traceBaggageTagKeys; @@ -970,6 +1003,7 @@ public static String getHostName() { private final int metricsOtelInterval; private final int metricsOtelTimeout; private final int metricsOtelCardinalityLimit; + private final boolean metricsOtelExperimentalEnabled; private final String otlpMetricsEndpoint; private final Map otlpMetricsHeaders; private final OtlpConfig.Protocol otlpMetricsProtocol; @@ -977,6 +1011,9 @@ public static String getHostName() { private final int otlpMetricsTimeout; private final OtlpConfig.Temporality otlpMetricsTemporalityPreference; + private final boolean otelTracesSpanMetricsEnabled; + private final boolean traceOtelSemanticsEnabled; + private final String traceOtelExporter; private final String otlpTracesEndpoint; private final Map otlpTracesHeaders; @@ -995,6 +1032,7 @@ public static String getHostName() { private final boolean tracerMetricsBufferingEnabled; private final int tracerMetricsMaxAggregates; private final int tracerMetricsMaxPending; + private final int traceStatsInterval; private final boolean reportHostName; @@ -1048,19 +1086,18 @@ public static String getHostName() { private final boolean clientIpEnabled; - private final boolean appSecReportingInband; private final String appSecRulesFile; - private final int appSecReportMinTimeout; - private final int appSecReportMaxTimeout; private final int appSecTraceRateLimit; private final boolean appSecWafMetrics; private final int appSecWafTimeout; + private final String appSecAgenticOnboarding; private final String appSecObfuscationParameterKeyRegexp; private final String appSecObfuscationParameterValueRegexp; private final String appSecHttpBlockedTemplateHtml; private final String appSecHttpBlockedTemplateJson; private final UserIdCollectionMode appSecUserIdCollectionMode; private final Boolean appSecScaEnabled; + private final int appSecScaMaxTrackedDependencies; private final boolean appSecStackTraceEnabled; private final int appSecMaxStackTraces; private final int appSecMaxStackTraceDepth; @@ -1116,6 +1153,7 @@ public static String getHostName() { private final boolean ciVisibilityCodeCoverageEnabled; private final Boolean ciVisibilityCoverageLinesEnabled; private final String ciVisibilityCodeCoverageReportDumpDir; + private final List codeCoverageFlags; private final String ciVisibilityCompilerPluginVersion; private final String ciVisibilityJacocoPluginVersion; private final boolean ciVisibilityJacocoPluginVersionProvided; @@ -1204,7 +1242,9 @@ public static String getHostName() { private final String dynamicInstrumentationInstrumentTheWorld; private final String dynamicInstrumentationExcludeFiles; private final String dynamicInstrumentationIncludeFiles; + private final String dynamicInstrumentationTimeoutCheckerMode; private final int dynamicInstrumentationCaptureTimeout; + private final int dynamicInstrumentationEvaluationTimeout; private final String dynamicInstrumentationRedactedIdentifiers; private final Set dynamicInstrumentationRedactionExcludedIdentifiers; private final String dynamicInstrumentationRedactedTypes; @@ -1375,7 +1415,6 @@ public static String getHostName() { private final boolean jdkSocketEnabled; - private final boolean optimizedMapEnabled; private final boolean spanBuilderReuseEnabled; private final int tagNameUtf8CacheSize; private final int tagValueUtf8CacheSize; @@ -1484,7 +1523,9 @@ private Config(final ConfigProvider configProvider, final InstrumenterConfig ins configProvider.getBoolean(WRITER_BAGGAGE_INJECT, isDatadogTraceWriter); injectLinksAsTagsEnabled = configProvider.getBoolean(WRITER_LINKS_INJECT, isDatadogTraceWriter); String lambdaInitType = getEnv("AWS_LAMBDA_INITIALIZATION_TYPE"); - if (lambdaInitType != null && lambdaInitType.equals("snap-start")) { + String lambdaMicrovmImageArn = ConfigHelper.env("AWS_LAMBDA_MICROVM_IMAGE_ARN"); + if ((lambdaInitType != null && lambdaInitType.equals("snap-start")) + || (lambdaMicrovmImageArn != null && !lambdaMicrovmImageArn.isEmpty())) { secureRandom = true; } else { secureRandom = configProvider.getBoolean(SECURE_RANDOM, DEFAULT_SECURE_RANDOM); @@ -1780,7 +1821,9 @@ private Config(final ConfigProvider configProvider, final InstrumenterConfig ins configProvider.getBoolean( DB_DBM_ALWAYS_APPEND_SQL_COMMENT, DEFAULT_DB_DBM_ALWAYS_APPEND_SQL_COMMENT); - dbmInjectSqlBaseHash = configProvider.getBoolean(DB_DBM_INJECT_SQL_BASEHASH, false); + dbmInjectSqlBaseHash = + configProvider.getBoolean(DB_DBM_INJECT_SQL_BASEHASH, false) + || DBM_PROPAGATION_MODE_DYNAMIC_SERVICE.equals(dbmPropagationMode); splitByTags = tryMakeImmutableSet(configProvider.getList(SPLIT_BY_TAGS)); @@ -1818,7 +1861,8 @@ private Config(final ConfigProvider configProvider, final InstrumenterConfig ins DEFAULT_PROPAGATION_EXTRACT_LOG_HEADER_NAMES_ENABLED); tracePropagationStyleB3PaddingEnabled = - isEnabled(true, TRACE_PROPAGATION_STYLE, ".b3.padding.enabled"); + isEnabled( + DEFAULT_PROPAGATION_B3_PADDING_ENABLED, TRACE_PROPAGATION_STYLE, ".b3.padding.enabled"); TracePropagationBehaviorExtract tmpTracePropagationBehaviorExtract; try { @@ -1933,6 +1977,10 @@ private Config(final ConfigProvider configProvider, final InstrumenterConfig ins tracePropagationExtractFirst = configProvider.getBoolean( TRACE_PROPAGATION_EXTRACT_FIRST, DEFAULT_TRACE_PROPAGATION_EXTRACT_FIRST); + traceOrgGuardEnabled = configProvider.getBoolean(TRACE_ORG_GUARD_ENABLED, false); + traceOrgGuardStrict = configProvider.getBoolean(TRACE_ORG_GUARD_STRICT, false); + traceOrgGuardTrustedOpms = + configProvider.getSet(TRACE_ORG_GUARD_TRUSTED_OPMS, Collections.emptySet()); traceInferredProxyEnabled = configProvider.getBoolean(TRACE_INFERRED_PROXY_SERVICES_ENABLED, false); @@ -2054,6 +2102,10 @@ private Config(final ConfigProvider configProvider, final InstrumenterConfig ins } metricsOtelTimeout = otelTimeout; + metricsOtelExperimentalEnabled = + configProvider.getBoolean( + METRICS_OTEL_EXPERIMENTAL_ENABLED, DEFAULT_METRICS_OTEL_EXPERIMENTAL_ENABLED); + // keep OTLP default timeout below the overall export timeout int defaultOtlpMetricsTimeout = Math.min(metricsOtelTimeout, DEFAULT_METRICS_OTEL_TIMEOUT); otlpTimeout = configProvider.getInteger(OTLP_METRICS_TIMEOUT, defaultOtlpMetricsTimeout); @@ -2093,6 +2145,16 @@ private Config(final ConfigProvider configProvider, final InstrumenterConfig ins OtlpConfig.Temporality.class, OtlpConfig.Temporality.DELTA); + traceOtelSemanticsEnabled = configProvider.getBoolean(TRACE_OTEL_SEMANTICS_ENABLED, false); + // Tri-state default: when unset, SDK-computed OTLP span metrics are emitted iff OTLP trace + // export and OTLP metrics export are both enabled. + otelTracesSpanMetricsEnabled = + configProvider.getBoolean( + OTEL_TRACES_SPAN_METRICS_ENABLED, + isTraceOtlpExporterEnabled() + && isMetricsOtelEnabled() + && isMetricsOtlpExporterEnabled()); + otlpTimeout = configProvider.getInteger(OTLP_TRACES_TIMEOUT, DEFAULT_OTLP_TRACES_TIMEOUT); if (otlpTimeout < 0) { log.warn("Invalid OTLP traces timeout: {}. The value must be positive", otlpTimeout); @@ -2172,9 +2234,57 @@ private Config(final ConfigProvider configProvider, final InstrumenterConfig ins configProvider.getBoolean(TRACE_STATS_COMPUTATION_IGNORE_AGENT_VERSION, false); tracerMetricsBufferingEnabled = configProvider.getBoolean(TRACER_METRICS_BUFFERING_ENABLED, false); - tracerMetricsMaxAggregates = configProvider.getInteger(TRACER_METRICS_MAX_AGGREGATES, 2048); - tracerMetricsMaxPending = configProvider.getInteger(TRACER_METRICS_MAX_PENDING, 2048); - + // Internal, test-only override of the stats flush interval. Read directly from the + // underscore-prefixed env var so it bypasses config-inversion validation and telemetry. + int statsInterval = DEFAULT_TRACE_STATS_INTERVAL; + String statsIntervalOverride = ConfigHelper.env("_DD_TRACE_STATS_INTERVAL"); + if (statsIntervalOverride != null) { + try { + statsInterval = Integer.parseInt(statsIntervalOverride); + } catch (NumberFormatException ignored) { + // fall back to the default + } + } + traceStatsInterval = statsInterval; + // The metrics inbox is an MpscArrayQueue; each saturated slot holds one + // ~120 B SpanSnapshot. The historical default TRACER_METRICS_MAX_PENDING=2048 (logical) * + // LEGACY_BATCH_SIZE=64 = 131072 slots was sized for the prior conflating-Batch model where + // slot memory was only realized under burst; with one snapshot per slot, the worst-case + // in-flight footprint is ~15 MB. At Xmx <= ~128 MB the G1 survivor region is too small to + // absorb that footprint when the aggregator stalls -- observed catastrophically at Xmx64m + // petclinic where SpanSnapshots overflow young gen and trigger To-space Exhausted -> Full + // GC storms (0 r/s in the worst case). + // + // Cut the default accordingly: + // - normal heap: 128 logical * 64 = 8192 slots, ~1 MB worst-case in-flight. ~0.8 s of + // buffer at 10K spans/s, well above typical GC pause windows. + // - tight heap (Xmx < 128 MB): 64 logical * 64 = 4096 slots, ~500 KB worst case. + // + // Customers who explicitly configured TRACER_METRICS_MAX_PENDING keep their value (the + // LEGACY_BATCH_SIZE multiplier still applies to it) -- only the implicit default shrinks. + final boolean tightHeap = Runtime.getRuntime().maxMemory() < 128L * 1024 * 1024; + final int defaultMaxAggregates = tightHeap ? 256 : 2048; + final int defaultMaxPending = tightHeap ? 64 : 128; + + tracerMetricsMaxAggregates = + configProvider.getInteger( + TRACE_STATS_CARDINALITY_LIMIT, defaultMaxAggregates, TRACER_METRICS_MAX_AGGREGATES); + /* + * TRACER_METRICS_MAX_PENDING historically counted conflating Batch slots (~64 spans per batch + * via Batch.MAX_BATCH_SIZE). The inbox now holds 1 SpanSnapshot per metrics-eligible span, so + * we multiply the configured value by the legacy batch size to preserve the effective + * span-throughput capacity for any existing customer override (e.g. a configured 4096 still + * means "~262144 spans before drops", same as before). + * + * Long-promote the multiplication and clamp to MAX_SAFE_ARRAY_SIZE so an absurd customer + * override (>= ~33M) can't silently wrap to a negative int. MAX_SAFE_ARRAY_SIZE sits a few + * bytes below Integer.MAX_VALUE because the JVM reserves header slack on array allocations; + * see java.util.ArraysSupport.SOFT_MAX_ARRAY_LENGTH for the same convention. + */ + long requestedMaxPending = + (long) configProvider.getInteger(TRACER_METRICS_MAX_PENDING, defaultMaxPending) + * LEGACY_BATCH_SIZE; + tracerMetricsMaxPending = (int) Math.min(requestedMaxPending, MAX_SAFE_ARRAY_SIZE); reportHostName = configProvider.getBoolean(TRACE_REPORT_HOSTNAME, DEFAULT_TRACE_REPORT_HOSTNAME); @@ -2392,14 +2502,8 @@ PROFILING_DATADOG_PROFILER_ENABLED, isDatadogProfilerSafeInCurrentEnvironment()) DEFAULT_TELEMETRY_DEPENDENCY_RESOLUTION_QUEUE_SIZE); clientIpEnabled = configProvider.getBoolean(CLIENT_IP_ENABLED, DEFAULT_CLIENT_IP_ENABLED); - appSecReportingInband = - configProvider.getBoolean(APPSEC_REPORTING_INBAND, DEFAULT_APPSEC_REPORTING_INBAND); appSecRulesFile = configProvider.getString(APPSEC_RULES_FILE, null); - // Default AppSec report timeout min=5, max=60 - appSecReportMaxTimeout = configProvider.getInteger(APPSEC_REPORT_TIMEOUT_SEC, 60); - appSecReportMinTimeout = Math.min(appSecReportMaxTimeout, 5); - appSecTraceRateLimit = configProvider.getInteger(APPSEC_TRACE_RATE_LIMIT, DEFAULT_APPSEC_TRACE_RATE_LIMIT); @@ -2407,6 +2511,10 @@ PROFILING_DATADOG_PROFILER_ENABLED, isDatadogProfilerSafeInCurrentEnvironment()) appSecWafTimeout = configProvider.getInteger(APPSEC_WAF_TIMEOUT, DEFAULT_APPSEC_WAF_TIMEOUT); + // RFC-1113: reported verbatim in configuration telemetry; always emitted (empty when unset). + appSecAgenticOnboarding = + configProvider.getString(APPSEC_AGENTIC_ONBOARDING, DEFAULT_APPSEC_AGENTIC_ONBOARDING); + appSecObfuscationParameterKeyRegexp = configProvider.getString(APPSEC_OBFUSCATION_PARAMETER_KEY_REGEXP, null); appSecObfuscationParameterValueRegexp = @@ -2421,6 +2529,9 @@ PROFILING_DATADOG_PROFILER_ENABLED, isDatadogProfilerSafeInCurrentEnvironment()) configProvider.getStringNotEmpty(APPSEC_AUTO_USER_INSTRUMENTATION_MODE, null), configProvider.getStringNotEmpty(APPSEC_AUTOMATED_USER_EVENTS_TRACKING, null)); appSecScaEnabled = configProvider.getBoolean(APPSEC_SCA_ENABLED); + appSecScaMaxTrackedDependencies = + configProvider.getInteger( + APPSEC_SCA_MAX_TRACKED_DEPENDENCIES, DEFAULT_APPSEC_SCA_MAX_TRACKED_DEPENDENCIES); appSecStackTraceEnabled = configProvider.getBoolean( APPSEC_STACK_TRACE_ENABLED, @@ -2460,9 +2571,10 @@ PROFILING_DATADOG_PROFILER_ENABLED, isDatadogProfilerSafeInCurrentEnvironment()) DEFAULT_API_SECURITY_MAX_DOWNSTREAM_REQUEST_BODY_ANALYSIS); apiSecurityDownstreamRequestBodyAnalysisSampleRate = configProvider.getDouble( - API_SECURITY_DOWNSTREAM_REQUEST_BODY_ANALYSIS_SAMPLE_RATE, + API_SECURITY_DOWNSTREAM_BODY_ANALYSIS_SAMPLE_RATE, DEFAULT_API_SECURITY_DOWNSTREAM_REQUEST_BODY_ANALYSIS_SAMPLE_RATE, - API_SECURITY_DOWNSTREAM_REQUEST_ANALYSIS_SAMPLE_RATE); + API_SECURITY_DOWNSTREAM_REQUEST_ANALYSIS_SAMPLE_RATE, + API_SECURITY_DOWNSTREAM_REQUEST_BODY_ANALYSIS_SAMPLE_RATE); // Trace Resource Renaming (Endpoint Inference) configuration // Default: enabled if AppSec is enabled, otherwise disabled @@ -2598,6 +2710,7 @@ PROFILING_DATADOG_PROFILER_ENABLED, isDatadogProfilerSafeInCurrentEnvironment()) configProvider.getBoolean(CIVISIBILITY_CODE_COVERAGE_LINES_ENABLED); ciVisibilityCodeCoverageReportDumpDir = configProvider.getString(CIVISIBILITY_CODE_COVERAGE_REPORT_DUMP_DIR); + codeCoverageFlags = parseCodeCoverageFlags(configProvider.getList(CODE_COVERAGE_FLAGS)); ciVisibilityCompilerPluginVersion = configProvider.getString( CIVISIBILITY_COMPILER_PLUGIN_VERSION, DEFAULT_CIVISIBILITY_COMPILER_PLUGIN_VERSION); @@ -2797,10 +2910,18 @@ PROFILING_DATADOG_PROFILER_ENABLED, isDatadogProfilerSafeInCurrentEnvironment()) configProvider.getString(DYNAMIC_INSTRUMENTATION_EXCLUDE_FILES); dynamicInstrumentationIncludeFiles = configProvider.getString(DYNAMIC_INSTRUMENTATION_INCLUDE_FILES); + dynamicInstrumentationTimeoutCheckerMode = + configProvider.getString( + DYNAMIC_INSTRUMENTATION_TIMEOUT_CHECKER_MODE, + DEFAULT_DYNAMIC_INSTRUMENTATION_TIMEOUT_CHECKER_MODE); dynamicInstrumentationCaptureTimeout = configProvider.getInteger( DYNAMIC_INSTRUMENTATION_CAPTURE_TIMEOUT, - DEFAULT_DYNAMIC_INSTRUMENTATION_CAPTURE_TIMEOUT); + DEFAULT_DYNAMIC_INSTRUMENTATION_CAPTURE_TIMEOUT, + DYNAMIC_INSTRUMENTATION_CAPTURE_TIMEOUT_MS); + dynamicInstrumentationEvaluationTimeout = + configProvider.getInteger( + DYNAMIC_INSTRUMENTATION_EVAL_TIMEOUT_MS, DEFAULT_DYNAMIC_INSTRUMENTATION_EVAL_TIMEOUT); dynamicInstrumentationRedactedIdentifiers = configProvider.getString(DYNAMIC_INSTRUMENTATION_REDACTED_IDENTIFIERS, null); dynamicInstrumentationRedactionExcludedIdentifiers = @@ -3185,7 +3306,6 @@ PROFILING_DATADOG_PROFILER_ENABLED, isDatadogProfilerSafeInCurrentEnvironment()) this.jdkSocketEnabled = configProvider.getBoolean(JDK_SOCKET_ENABLED, true); - this.optimizedMapEnabled = configProvider.getBoolean(GeneralConfig.OPTIMIZED_MAP_ENABLED, true); this.spanBuilderReuseEnabled = configProvider.getBoolean(GeneralConfig.SPAN_BUILDER_REUSE_ENABLED, true); this.tagNameUtf8CacheSize = @@ -3195,7 +3315,7 @@ PROFILING_DATADOG_PROFILER_ENABLED, isDatadogProfilerSafeInCurrentEnvironment()) int defaultStackTraceLengthLimit = instrumenterConfig.isCiVisibilityEnabled() - ? 5000 // EVP limit + ? CIConstants.MAX_META_STRING_VALUE_LENGTH // EVP limit : Integer.MAX_VALUE; // no effective limit (old behavior) this.stackTraceLengthLimit = configProvider.getInteger(STACK_TRACE_LENGTH_LIMIT, defaultStackTraceLengthLimit); @@ -3626,6 +3746,18 @@ public boolean isTracePropagationExtractFirst() { return tracePropagationExtractFirst; } + public boolean isTraceOrgGuardEnabled() { + return traceOrgGuardEnabled; + } + + public boolean isTraceOrgGuardStrict() { + return traceOrgGuardStrict; + } + + public Set getTraceOrgGuardTrustedOpms() { + return traceOrgGuardTrustedOpms; + } + public boolean isInferredProxyPropagationEnabled() { return traceInferredProxyEnabled; } @@ -3759,6 +3891,20 @@ public int getTracerMetricsMaxPending() { return tracerMetricsMaxPending; } + public int getTraceStatsInterval() { + return traceStatsInterval; + } + + /** + * Returns the per-cycle cardinality limit for the named stats field, following the RFC naming + * pattern {@code DD_TRACE_STATS_{tagName}_CARDINALITY_LIMIT} (e.g. {@code + * DD_TRACE_STATS_RESOURCE_CARDINALITY_LIMIT}). The caller supplies the default from {@code + * MetricCardinalityLimits} so per-field rationale stays co-located with the defaults. + */ + public int getTraceStatsCardinalityLimit(String tagName, int defaultLimit) { + return configProvider.getInteger("trace.stats." + tagName + ".cardinality.limit", defaultLimit); + } + public boolean isLogsInjectionEnabled() { return logsInjectionEnabled; } @@ -4012,18 +4158,6 @@ public ProductActivation getAppSecActivation() { return instrumenterConfig.getAppSecActivation(); } - public boolean isAppSecReportingInband() { - return appSecReportingInband; - } - - public int getAppSecReportMinTimeout() { - return appSecReportMinTimeout; - } - - public int getAppSecReportMaxTimeout() { - return appSecReportMaxTimeout; - } - public int getAppSecTraceRateLimit() { return appSecTraceRateLimit; } @@ -4276,6 +4410,10 @@ public String getCiVisibilityCodeCoverageReportDumpDir() { return ciVisibilityCodeCoverageReportDumpDir; } + public List getCodeCoverageFlags() { + return codeCoverageFlags; + } + public String getCiVisibilityCompilerPluginVersion() { return ciVisibilityCompilerPluginVersion; } @@ -4597,10 +4735,18 @@ public String getDynamicInstrumentationIncludeFiles() { return dynamicInstrumentationIncludeFiles; } + public String getDynamicInstrumentationTimeoutCheckerMode() { + return dynamicInstrumentationTimeoutCheckerMode; + } + public int getDynamicInstrumentationCaptureTimeout() { return dynamicInstrumentationCaptureTimeout; } + public int getDynamicInstrumentationEvalTimeout() { + return dynamicInstrumentationEvaluationTimeout; + } + public boolean isSymbolDatabaseEnabled() { return symbolDatabaseEnabled; } @@ -5010,10 +5156,6 @@ public boolean isJdkSocketEnabled() { return jdkSocketEnabled; } - public boolean isOptimizedMapEnabled() { - return optimizedMapEnabled; - } - public boolean isSpanBuilderReuseEnabled() { return spanBuilderReuseEnabled; } @@ -5479,6 +5621,10 @@ public boolean isMetricsOtlpExporterEnabled() { return "otlp".equalsIgnoreCase(metricsOtelExporter); } + public boolean isMetricsOtelExperimentalEnabled() { + return metricsOtelExperimentalEnabled; + } + public int getMetricsOtelCardinalityLimit() { return metricsOtelCardinalityLimit; } @@ -5515,6 +5661,14 @@ public OtlpConfig.Temporality getOtlpMetricsTemporalityPreference() { return otlpMetricsTemporalityPreference; } + public boolean isOtelTracesSpanMetricsEnabled() { + return otelTracesSpanMetricsEnabled; + } + + public boolean isTraceOtelSemanticsEnabled() { + return traceOtelSemanticsEnabled; + } + public boolean isTraceOtelEnabled() { return instrumenterConfig.isTraceOtelEnabled(); } @@ -5556,9 +5710,9 @@ public boolean isRuleEnabled(final String name, boolean defaultEnabled) { } /** - * @param integrationNames - * @param defaultEnabled - * @return + * @param integrationNames the integration names to check + * @param defaultEnabled the value to return when no integration name is configured + * @return {@code true} if the JMX fetch integration is enabled * @deprecated This method should only be used internally. Use the instance getter instead {@link * #isJmxFetchIntegrationEnabled(Iterable, boolean)}. */ @@ -5656,6 +5810,7 @@ public String getDbmPropagationMode() { // Database monitoring propagation mode constants public static final String DBM_PROPAGATION_MODE_STATIC = "service"; public static final String DBM_PROPAGATION_MODE_FULL = "full"; + public static final String DBM_PROPAGATION_MODE_DYNAMIC_SERVICE = "dynamic_service"; // Helper method to check if comment injection is enabled public boolean isDbmCommentInjectionEnabled() { @@ -5663,7 +5818,8 @@ public boolean isDbmCommentInjectionEnabled() { return false; } return dbmPropagationMode.equals(DBM_PROPAGATION_MODE_FULL) - || dbmPropagationMode.equals(DBM_PROPAGATION_MODE_STATIC); + || dbmPropagationMode.equals(DBM_PROPAGATION_MODE_STATIC) + || dbmPropagationMode.equals(DBM_PROPAGATION_MODE_DYNAMIC_SERVICE); } private void logIgnoredSettingWarning( @@ -5723,9 +5879,9 @@ public > T getEnumValue( } /** - * @param integrationNames - * @param defaultEnabled - * @return + * @param integrationNames the integration names to check + * @param defaultEnabled the value to return when no integration name is configured + * @return {@code true} if the trace analytics integration is enabled * @deprecated This method should only be used internally. Use the instance getter instead {@link * #isTraceAnalyticsIntegrationEnabled(SortedSet, boolean)}. */ @@ -5762,6 +5918,10 @@ public boolean isAppSecScaEnabled() { return appSecScaEnabled != null && appSecScaEnabled; } + public int getAppSecScaMaxTrackedDependencies() { + return appSecScaMaxTrackedDependencies; + } + public boolean isAppSecRaspEnabled() { return instrumenterConfig.isAppSecRaspEnabled(); } @@ -5936,6 +6096,29 @@ private static Set parseStringIntoSetOfNonEmptyStrings( return Collections.unmodifiableSet(result); } + private static List parseCodeCoverageFlags(List configuredFlags) { + if (configuredFlags.isEmpty()) { + return Collections.emptyList(); + } + + List flags = new ArrayList<>(configuredFlags.size()); + for (String configuredFlag : configuredFlags) { + if (!configuredFlag.isEmpty()) { + flags.add(configuredFlag); + } + } + + if (flags.size() > MAX_CODE_COVERAGE_FLAGS) { + log.warn( + "Cannot apply {} code coverage report flags: the maximum supported number is {}. The report will be uploaded without flags.", + flags.size(), + MAX_CODE_COVERAGE_FLAGS); + return Collections.emptyList(); + } + + return Collections.unmodifiableList(flags); + } + private static Set convertStringSetToSet( String setting, final Set input, Function mapper) { if (input.isEmpty()) { @@ -6124,6 +6307,8 @@ public String toString() { + experimentalFeaturesEnabled + ", integrationSynapseLegacyOperationName=" + integrationSynapseLegacyOperationName + + ", codeCoverageFlags=" + + codeCoverageFlags + ", writerType='" + writerType + '\'' @@ -6474,8 +6659,6 @@ public String toString() { + grpcClientErrorStatuses + ", clientIpEnabled=" + clientIpEnabled - + ", appSecReportingInband=" - + appSecReportingInband + ", appSecRulesFile='" + appSecRulesFile + "'" @@ -6483,7 +6666,9 @@ public String toString() { + appSecHttpBlockedTemplateHtml + ", appSecWafTimeout=" + appSecWafTimeout - + " us, appSecHttpBlockedTemplateJson=" + + " us, appSecAgenticOnboarding=" + + appSecAgenticOnboarding + + ", appSecHttpBlockedTemplateJson=" + appSecHttpBlockedTemplateJson + ", apiSecurityEnabled=" + apiSecurityEnabled @@ -6543,6 +6728,8 @@ public String toString() { + telemetryMetricsEnabled + ", appSecScaEnabled=" + appSecScaEnabled + + ", appSecScaMaxTrackedDependencies=" + + appSecScaMaxTrackedDependencies + ", appSecRaspEnabled=" + isAppSecRaspEnabled() + ", dataJobsOpenLineageEnabled=" @@ -6601,6 +6788,8 @@ public String toString() { + metricsOtelTimeout + ", metricsOtelCardinalityLimit=" + metricsOtelCardinalityLimit + + ", metricsOtelExperimentalEnabled=" + + metricsOtelExperimentalEnabled + ", otlpMetricsEndpoint=" + otlpMetricsEndpoint + ", otlpMetricsHeaders=" @@ -6613,6 +6802,12 @@ public String toString() { + otlpMetricsTimeout + ", otlpMetricsTemporalityPreference=" + otlpMetricsTemporalityPreference + + ", otelTracesSpanMetricsEnabled=" + + otelTracesSpanMetricsEnabled + + ", traceOtelSemanticsEnabled=" + + traceOtelSemanticsEnabled + + ", traceStatsInterval=" + + traceStatsInterval + ", traceOtelExporter=" + traceOtelExporter + ", otlpTracesEndpoint=" diff --git a/internal-api/src/main/java/datadog/trace/api/Functions.java b/internal-api/src/main/java/datadog/trace/api/Functions.java index 42c030316d9..731cd711a9a 100644 --- a/internal-api/src/main/java/datadog/trace/api/Functions.java +++ b/internal-api/src/main/java/datadog/trace/api/Functions.java @@ -1,11 +1,13 @@ package datadog.trace.api; +import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.function.Function.identity; import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; import java.lang.invoke.MethodType; +import java.util.Base64; import java.util.Locale; import java.util.function.BiFunction; import java.util.function.Function; @@ -174,4 +176,16 @@ public T apply(Object input) { } } } + + public static final Function UTF8_BYTES_TO_STRING = + bytes -> new String(bytes, UTF_8); + + public static final Function BASE64_DECODE = + bytes -> { + try { + return new String(Base64.getDecoder().decode(bytes), UTF_8); + } catch (final Exception ignored) { + return null; + } + }; } diff --git a/internal-api/src/main/java/datadog/trace/api/InstrumenterConfig.java b/internal-api/src/main/java/datadog/trace/api/InstrumenterConfig.java index e8627a5a852..74bff640024 100644 --- a/internal-api/src/main/java/datadog/trace/api/InstrumenterConfig.java +++ b/internal-api/src/main/java/datadog/trace/api/InstrumenterConfig.java @@ -56,6 +56,7 @@ import static datadog.trace.api.config.TraceInstrumentationConfig.AXIS_TRANSPORT_CLASS_NAME; import static datadog.trace.api.config.TraceInstrumentationConfig.CODE_ORIGIN_FOR_SPANS_ENABLED; import static datadog.trace.api.config.TraceInstrumentationConfig.CODE_ORIGIN_FOR_SPANS_INTERFACE_SUPPORT; +import static datadog.trace.api.config.TraceInstrumentationConfig.DETAILED_INSTRUMENTATION_ERRORS; import static datadog.trace.api.config.TraceInstrumentationConfig.EXPERIMENTAL_DEFER_INTEGRATIONS_UNTIL; import static datadog.trace.api.config.TraceInstrumentationConfig.HTTP_URL_CONNECTION_CLASS_NAME; import static datadog.trace.api.config.TraceInstrumentationConfig.INSTRUMENTATION_CONFIG_ID; @@ -145,6 +146,7 @@ public class InstrumenterConfig { private final boolean triageEnabled; private final boolean integrationsEnabled; + private final boolean detailedInstrumentationErrors; private final boolean codeOriginEnabled; private final boolean codeOriginInterfaceSupport; @@ -249,6 +251,8 @@ private InstrumenterConfig() { integrationsEnabled = configProvider.getBoolean(INTEGRATIONS_ENABLED, DEFAULT_INTEGRATIONS_ENABLED); + detailedInstrumentationErrors = + configProvider.getBoolean(DETAILED_INSTRUMENTATION_ERRORS, false); codeOriginEnabled = configProvider.getBoolean( @@ -408,6 +412,10 @@ public boolean isIntegrationsEnabled() { return integrationsEnabled; } + public boolean isDetailedInstrumentationErrors() { + return detailedInstrumentationErrors; + } + /** * isIntegrationEnabled determines whether an integration under the specified name(s) is enabled * according to the following list of configurations, from highest to lowest precedence: diff --git a/internal-api/src/main/java/datadog/trace/api/ProcessTags.java b/internal-api/src/main/java/datadog/trace/api/ProcessTags.java index 932ec19c565..40b23faa45c 100644 --- a/internal-api/src/main/java/datadog/trace/api/ProcessTags.java +++ b/internal-api/src/main/java/datadog/trace/api/ProcessTags.java @@ -3,6 +3,7 @@ import datadog.environment.EnvironmentVariables; import datadog.environment.SystemProperties; import datadog.trace.api.env.CapturedEnvironment; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; import datadog.trace.util.TraceUtils; import java.nio.file.Path; @@ -30,8 +31,7 @@ public class ProcessTags { public static final String ENTRYPOINT_BASEDIR = "entrypoint.basedir"; public static final String ENTRYPOINT_WORKDIR = "entrypoint.workdir"; - // visible for testing - static Function envGetter = EnvironmentVariables::get; + @VisibleForTesting static Function envGetter = EnvironmentVariables::get; private static class Lazy { // the tags are used to compute a hash for dsm hence that map must be sorted. @@ -269,7 +269,7 @@ public static UTF8BytesString getTagsForSerialization() { return Lazy.serializedForm; } - /** Visible for testing. */ + @VisibleForTesting static void empty() { synchronized (Lazy.TAGS) { Lazy.TAGS.clear(); @@ -279,12 +279,12 @@ static void empty() { } } - /** Visible for testing. */ + @VisibleForTesting static void reset() { reset(Config.get()); } - /** Visible for testing. */ + @VisibleForTesting public static void reset(Config config) { synchronized (Lazy.TAGS) { empty(); diff --git a/internal-api/src/main/java/datadog/trace/api/ProductTraceSource.java b/internal-api/src/main/java/datadog/trace/api/ProductTraceSource.java index 792829dde3a..976623cbd7d 100644 --- a/internal-api/src/main/java/datadog/trace/api/ProductTraceSource.java +++ b/internal-api/src/main/java/datadog/trace/api/ProductTraceSource.java @@ -22,6 +22,7 @@ public class ProductTraceSource { public static final int DSM = 0x04; public static final int DJM = 0x08; public static final int DBM = 0x10; + public static final int AI_GUARD = 0x20; /** Updates the bitfield by setting the bit corresponding to a specific product. */ public static int updateProduct(int bitfield, int product) { @@ -30,7 +31,12 @@ public static int updateProduct(int bitfield, int product) { /** Checks if the bitfield is marked for a specific product. */ public static boolean isProductMarked(final int bitfield, int product) { - return (bitfield & product) != 0; // Check if the bit is set + return (bitfield & product) != 0; + } + + /** Checks if the bitfield is marked for either of the two given products. */ + public static boolean isProductMarked(final int bitfield, int productA, int productB) { + return (bitfield & (productA | productB)) != 0; } /** diff --git a/internal-api/src/main/java/datadog/trace/api/TagMap.java b/internal-api/src/main/java/datadog/trace/api/TagMap.java index 95f676245ef..761320a2205 100644 --- a/internal-api/src/main/java/datadog/trace/api/TagMap.java +++ b/internal-api/src/main/java/datadog/trace/api/TagMap.java @@ -6,7 +6,6 @@ import java.util.Arrays; import java.util.Collection; import java.util.Collections; -import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.NoSuchElementException; @@ -17,6 +16,8 @@ import java.util.function.Function; import java.util.stream.Stream; import java.util.stream.StreamSupport; +import javax.annotation.Nonnull; +import javax.annotation.Nullable; /** * A super simple hash map designed for... @@ -43,19 +44,23 @@ *

    5. adaptive collision * */ -public interface TagMap extends Map, Iterable { +public final class TagMap implements Map, Iterable { /** Immutable empty TagMap - similar to {@link Collections#emptyMap()} */ - TagMap EMPTY = TagMapFactory.INSTANCE.empty(); + // Frozen view over a length-1 array: bucket masking needs a power-of-two array length (size 0 + // would fail with ArrayIndexOutOfBoundsException, size 1 works), and the private constructor + // reads + // no statics, so this is safe to build directly during TagMap's . + public static final TagMap EMPTY = new TagMap(new Object[1], 0); /** Creates a new mutable TagMap that contains the contents of map */ - static TagMap fromMap(Map map) { + public static final TagMap fromMap(@Nonnull Map map) { TagMap tagMap = TagMap.create(map.size()); tagMap.putAll(map); return tagMap; } /** Creates a new immutable TagMap that contains the contents of map */ - static TagMap fromMapImmutable(Map map) { + public static final TagMap fromMapImmutable(@Nonnull Map map) { if (map.isEmpty()) { return TagMap.EMPTY; } else { @@ -63,223 +68,25 @@ static TagMap fromMapImmutable(Map map) { } } - static TagMap create() { - return TagMapFactory.INSTANCE.create(); + public static final TagMap create() { + return new TagMap(); } - static TagMap create(int size) { - return TagMapFactory.INSTANCE.create(size); + public static final TagMap create(int size) { + return new TagMap(); } /** Creates a new TagMap.Ledger */ - static Ledger ledger() { + public static final Ledger ledger() { return new Ledger(); } /** Creates a new TagMap.Ledger which handles size modifications before expansion */ - static Ledger ledger(int size) { + public static final Ledger ledger(int size) { return new Ledger(size); } - boolean isOptimized(); - - /** Inefficiently implemented for optimized TagMap */ - @Deprecated - Set keySet(); - - Iterator tagIterator(); - - /** Inefficiently implemented for optimized TagMap - requires boxing primitives */ - @Deprecated - Collection values(); - - Iterator valueIterator(); - - // @Deprecated -- not deprecated until OptimizedTagMap becomes the default - Set> entrySet(); - - /** - * Deprecated in favor of typed getters like... - * - *
        - *
      • {@link TagMap#getObject(String)} - *
      • {@link TagMap#getString(String)} - *
      • {@link TagMap#getBoolean(String)} - *
      • ... - *
      - */ - @Deprecated - Object get(Object tag); - - /** Provides the corresponding entry value as an Object - boxing if necessary */ - Object getObject(String tag); - - /** Provides the corresponding entry value as a String - calling toString if necessary */ - String getString(String tag); - - boolean getBoolean(String tag); - - boolean getBooleanOrDefault(String tag, boolean defaultValue); - - int getInt(String tag); - - int getIntOrDefault(String tag, int defaultValue); - - long getLong(String tag); - - long getLongOrDefault(String tag, long defaultValue); - - float getFloat(String tag); - - float getFloatOrDefault(String tag, float defaultValue); - - double getDouble(String tag); - - double getDoubleOrDefault(String tag, double defaultValue); - - /** - * Provides the corresponding Entry object - preferable w/ optimized TagMap if the Entry needs to - * have its type checked - */ - Entry getEntry(String tag); - - /** - * Deprecated in favor of {@link TagMap#set} methods. set methods don't return the prior value and - * are implemented efficiently for both the legacy and optimized implementations of TagMap. - */ - @Deprecated - Object put(String tag, Object value); - - /** Sets value without returning prior value - optimal for legacy & optimized implementations */ - void set(String tag, Object value); - - /** - * Similar to {@link TagMap#set(String, Object)} but more efficient when working with - * CharSequences and Strings. Depending on this situation, this methods avoids having to do type - * resolution later on - */ - void set(String tag, CharSequence value); - - void set(String tag, boolean value); - - void set(String tag, int value); - - void set(String tag, long value); - - void set(String tag, float value); - - void set(String tag, double value); - - void set(EntryReader newEntry); - - /** sets the value while returning the prior Entry */ - Entry getAndSet(String tag, Object value); - - Entry getAndSet(String tag, CharSequence value); - - Entry getAndSet(String tag, boolean value); - - Entry getAndSet(String tag, int value); - - Entry getAndSet(String tag, long value); - - Entry getAndSet(String tag, float value); - - Entry getAndSet(String tag, double value); - - /** - * TagMap specific method that places an Entry directly into an optimized TagMap avoiding need to - * allocate a new Entry object - */ - Entry getAndSet(Entry newEntry); - - void putAll(Map map); - - /** - * Similar to {@link Map#putAll(Map)} but optimized to quickly copy from one TagMap to another - * - *

      For optimized TagMaps, this method takes advantage of the consistent TagMap layout to - * quickly handle each bucket. And similar to {@link TagMap#(Entry)} this method shares Entry - * objects from the source TagMap - */ - void putAll(TagMap that); - - void fillMap(Map map); - - void fillStringMap(Map stringMap); - - /** - * Deprecated in favor of {@link TagMap#remove(String)} which returns a boolean and is efficiently - * implemented for both legacy and optimal TagMaps - */ - @Deprecated - Object remove(Object tag); - - /** - * Similar to {@link Map#remove(Object)} but doesn't return the prior value (orEntry). Preferred - * when prior value isn't needed - best for both legacy and optimal TagMaps - */ - boolean remove(String tag); - - /** - * Similar to {@link Map#remove(Object)} but returns the prior Entry object rather than the prior - * value. For optimized TagMap-s, this method is preferred because it avoids additional boxing. - */ - Entry getAndRemove(String tag); - - /** Returns a mutable copy of this TagMap */ - TagMap copy(); - - /** - * Returns an immutable copy of this TagMap This method is more efficient than - * map.copy().freeze() when called on an immutable TagMap - */ - TagMap immutableCopy(); - - /** - * Provides an Iterator over the Entry-s of the TagMap Equivalent to entrySet().iterator() - * , but with less allocation - */ - @Override - Iterator iterator(); - - Stream stream(); - - /** - * Visits each Entry in this TagMap This method is more efficient than {@link TagMap#iterator()} - */ - void forEach(Consumer consumer); - - /** - * Version of forEach that takes an extra context object that is passed as the first argument to - * the consumer - * - *

      The intention is to use this method to avoid using a capturing lambda - */ - void forEach(T thisObj, BiConsumer consumer); - - /** - * Version of forEach that takes two extra context objects that are passed as the first two - * argument to the consumer - * - *

      The intention is to use this method to avoid using a capturing lambda - */ - void forEach( - T thisObj, U otherObj, TriConsumer consumer); - - /** Clears the TagMap */ - void clear(); - - /** Freeze the TagMap preventing further modification - returns this TagMap */ - TagMap freeze(); - - /** Indicates if this map is frozen */ - boolean isFrozen(); - - /** Checks if the TagMap is writable - if not throws {@link IllegalStateException} */ - void checkWriteAccess(); - - abstract class EntryChange { + public abstract static class EntryChange { public static final EntryRemoval newRemoval(String tag) { return new EntryRemoval(tag); } @@ -301,7 +108,7 @@ public final boolean matches(String tag) { public abstract boolean isRemoval(); } - final class EntryRemoval extends EntryChange { + public static final class EntryRemoval extends EntryChange { EntryRemoval(String tag) { super(tag); } @@ -312,7 +119,7 @@ public boolean isRemoval() { } } - interface EntryReader { + public interface EntryReader { public static final byte OBJECT = 1; /* @@ -362,23 +169,33 @@ interface EntryReader { Entry entry(); } - final class Entry extends EntryChange implements Map.Entry, EntryReader { + public static final class Entry extends EntryChange + implements Map.Entry, EntryReader { /* * Special value used for Objects that haven't been type checked yet. * These objects might be primitive box objects. */ static final byte ANY = 0; - /** If value is non-null, returns a new TagMap.Entry If value is null, returns null */ - public static final Entry create(String tag, Object value) { - // NOTE: From the static typing, it is possible that value is a primitive box, so need to call - // Any variant - - return (value == null) ? null : TagMap.Entry.newAnyEntry(tag, value); + /** + * Entry for {@code (tag, value)}, or null when {@code value} is null or an empty {@code + * CharSequence} -- checked by runtime type, so an empty String passed as {@code Object} skips + * the same as via the {@link #create(String, CharSequence)} overload. + */ + @Nullable + public static final Entry create(@Nonnull String tag, Object value) { + if (value == null) { + return null; + } + if (value instanceof CharSequence && ((CharSequence) value).length() == 0) { + return null; + } + return TagMap.Entry.newAnyEntry(tag, value); } /** If value is non-null, returns a new TagMap.Entry If value is null or empty, returns null */ - public static final Entry create(String tag, CharSequence value) { + @Nullable + public static final Entry create(@Nonnull String tag, CharSequence value) { // NOTE: From the static typing, we know that value is not a primitive box return (value == null || value.length() == 0) @@ -386,23 +203,23 @@ public static final Entry create(String tag, CharSequence value) { : TagMap.Entry.newObjectEntry(tag, value); } - public static final Entry create(String tag, boolean value) { + public static final Entry create(@Nonnull String tag, boolean value) { return TagMap.Entry.newBooleanEntry(tag, value); } - public static final Entry create(String tag, int value) { + public static final Entry create(@Nonnull String tag, int value) { return TagMap.Entry.newIntEntry(tag, value); } - public static final Entry create(String tag, long value) { + public static final Entry create(@Nonnull String tag, long value) { return TagMap.Entry.newLongEntry(tag, value); } - public static final Entry create(String tag, float value) { + public static final Entry create(@Nonnull String tag, float value) { return TagMap.Entry.newFloatEntry(tag, value); } - public static final Entry create(String tag, double value) { + public static final Entry create(@Nonnull String tag, double value) { return TagMap.Entry.newDoubleEntry(tag, value); } @@ -969,7 +786,7 @@ static int _hash(String tag) { * An in-order ledger of changes to be made to a TagMap. * Ledger can also serves as a builder for TagMap-s via build & buildImmutable. */ - final class Ledger implements Iterable { + public static final class Ledger implements Iterable { EntryChange[] entryChanges; int nextPos = 0; boolean containsRemovals = false; @@ -990,7 +807,7 @@ public boolean isDefinitelyEmpty() { * Provides the estimated size of the map created by the ledger Doesn't account for overwritten * entries or entry removal * - * @return + * @return the estimated size of the map created by the ledger */ public int estimateSize() { return this.nextPos; @@ -1106,12 +923,6 @@ public TagMap build() { return map; } - TagMap build(TagMapFactory mapFactory) { - TagMap map = mapFactory.create(this.estimateSize()); - fill(map); - return map; - } - void fill(TagMap map) { EntryChange[] entryChanges = this.entryChanges; int size = this.nextPos; @@ -1126,14 +937,6 @@ void fill(TagMap map) { } } - TagMap buildImmutable(TagMapFactory mapFactory) { - if (this.nextPos == 0) { - return mapFactory.empty(); - } else { - return this.build(mapFactory).freeze(); - } - } - public TagMap buildImmutable() { if (this.nextPos == 0) { return TagMap.EMPTY; @@ -1168,99 +971,31 @@ public EntryChange next() { } } } -} - -/* - * Using a class, so class hierarchy analysis kicks in - * That will allow all of the calls to create methods to be devirtualized without a guard - */ -abstract class TagMapFactory { - public static final TagMapFactory INSTANCE = - createFactory(Config.get().isOptimizedMapEnabled()); - - static final TagMapFactory createFactory(boolean useOptimized) { - return useOptimized ? OptimizedTagMapFactory.INSTANCE : LegacyTagMapFactory.INSTANCE; - } - - public abstract MapT create(); - - public abstract MapT create(int size); - - public abstract MapT empty(); -} - -final class OptimizedTagMapFactory extends TagMapFactory { - static final OptimizedTagMapFactory INSTANCE = new OptimizedTagMapFactory(); - - private OptimizedTagMapFactory() {} - - @Override - public OptimizedTagMap create() { - return new OptimizedTagMap(); - } - - @Override - public OptimizedTagMap create(int size) { - return new OptimizedTagMap(); - } - - @Override - public OptimizedTagMap empty() { - return OptimizedTagMap.EMPTY; - } -} - -final class LegacyTagMapFactory extends TagMapFactory { - static final LegacyTagMapFactory INSTANCE = new LegacyTagMapFactory(); - - private LegacyTagMapFactory() {} - - @Override - public LegacyTagMap create() { - return new LegacyTagMap(); - } - - @Override - public LegacyTagMap create(int size) { - return new LegacyTagMap(size); - } - - @Override - public LegacyTagMap empty() { - return LegacyTagMap.EMPTY; - } -} - -/* - * For memory efficiency, OptimizedTagMap uses a rather complicated bucket system. - *

      - * When there is only a single Entry in a particular bucket, the Entry is stored into the bucket directly. - *

      - * Because the Entry objects can be shared between multiple TagMaps, the Entry objects cannot - * directly form a linked list to handle collisions. - *

      - * Instead when multiple entries collide in the same bucket, a BucketGroup is formed to hold multiple entries. - * But a BucketGroup is only formed when a collision occurs to keep allocation low in the common case of no collisions. - *

      - * For efficiency, BucketGroups are a fixed size, so when a BucketGroup fills up another BucketGroup is formed - * to hold the additional Entry-s. And the BucketGroup-s are connected via a linked list instead of the Entry-s. - *

      - * This does introduce some inefficiencies when Entry-s are removed. - * The assumption is that removals are rare, so BucketGroups are never consolidated. - * However as a precaution if a BucketGroup becomes completely empty, then that BucketGroup will be - * removed from the collision chain. - */ -final class OptimizedTagMap implements TagMap { - // Using special constructor that creates a frozen view of an existing array - // Bucket calculation requires that array length is a power of 2 - // e.g. size 0 will not work, it results in ArrayIndexOutOfBoundsException, but size 1 does - static final OptimizedTagMap EMPTY = new OptimizedTagMap(new Object[1], 0); + /* + * For memory efficiency, TagMap uses a rather complicated bucket system. + *

      + * When there is only a single Entry in a particular bucket, the Entry is stored into the bucket directly. + *

      + * Because the Entry objects can be shared between multiple TagMaps, the Entry objects cannot + * directly form a linked list to handle collisions. + *

      + * Instead when multiple entries collide in the same bucket, a BucketGroup is formed to hold multiple entries. + * But a BucketGroup is only formed when a collision occurs to keep allocation low in the common case of no collisions. + *

      + * For efficiency, BucketGroups are a fixed size, so when a BucketGroup fills up another BucketGroup is formed + * to hold the additional Entry-s. And the BucketGroup-s are connected via a linked list instead of the Entry-s. + *

      + * This does introduce some inefficiencies when Entry-s are removed. + * The assumption is that removals are rare, so BucketGroups are never consolidated. + * However as a precaution if a BucketGroup becomes completely empty, then that BucketGroup will be + * removed from the collision chain. + */ private final Object[] buckets; private int size; private boolean frozen; - public OptimizedTagMap() { + public TagMap() { // needs to be a power of 2 for bucket masking calculation to work as intended this.buckets = new Object[1 << 4]; this.size = 0; @@ -1268,13 +1003,12 @@ public OptimizedTagMap() { } /** Used for inexpensive immutable */ - private OptimizedTagMap(Object[] buckets, int size) { + private TagMap(Object[] buckets, int size) { this.buckets = buckets; this.size = size; this.frozen = true; } - @Override public boolean isOptimized() { return true; } @@ -1375,7 +1109,6 @@ public Set keySet() { return new Keys(this); } - @Override public Iterator tagIterator() { return new KeysIterator(this); } @@ -1385,7 +1118,6 @@ public Collection values() { return new Values(this); } - @Override public Iterator valueIterator() { return new ValuesIterator(this); } @@ -1395,7 +1127,6 @@ public Set> entrySet() { return new Entries(this); } - @Override public Entry getEntry(String tag) { Object[] thisBuckets = this.buckets; @@ -1419,53 +1150,58 @@ public Entry getEntry(String tag) { @Deprecated @Override - public Object put(String tag, Object value) { + public Object put(@Nonnull String tag, Object value) { TagMap.Entry entry = this.getAndSet(Entry.newAnyEntry(tag, value)); return entry == null ? null : entry.objectValue(); } - @Override - public void set(TagMap.EntryReader newEntryReader) { + /** A null reader is a no-op (see the null-tolerance contract on {@link #getAndSet(Entry)}). */ + public void set(@Nullable TagMap.EntryReader newEntryReader) { + if (newEntryReader == null) { + return; + } this.getAndSet(newEntryReader.entry()); } - @Override - public void set(String tag, Object value) { + public void set(@Nonnull String tag, @Nonnull Object value) { this.getAndSet(Entry.newAnyEntry(tag, value)); } - @Override - public void set(String tag, CharSequence value) { + public void set(@Nonnull String tag, @Nonnull CharSequence value) { this.getAndSet(Entry.newObjectEntry(tag, value)); } - @Override - public void set(String tag, boolean value) { + public void set(@Nonnull String tag, boolean value) { this.getAndSet(Entry.newBooleanEntry(tag, value)); } - @Override - public void set(String tag, int value) { + public void set(@Nonnull String tag, int value) { this.getAndSet(Entry.newIntEntry(tag, value)); } - @Override - public void set(String tag, long value) { + public void set(@Nonnull String tag, long value) { this.getAndSet(Entry.newLongEntry(tag, value)); } - @Override - public void set(String tag, float value) { + public void set(@Nonnull String tag, float value) { this.getAndSet(Entry.newFloatEntry(tag, value)); } - @Override - public void set(String tag, double value) { + public void set(@Nonnull String tag, double value) { this.getAndSet(Entry.newDoubleEntry(tag, value)); } - @Override - public Entry getAndSet(Entry newEntry) { + /** + * Places an Entry directly into the map, avoiding a new Entry allocation. Null-tolerant: a null + * {@code newEntry} is a no-op returning null, so an Entry producer (e.g. {@link + * Entry#create(String, Object)} for a null/empty value) can emit "no tag" without the caller + * filtering. Contrast the strict {@link Nonnull} {@code set(String, value)} setters. + */ + public Entry getAndSet(@Nullable Entry newEntry) { + if (newEntry == null) { + return null; + } + this.checkWriteAccess(); Object[] thisBuckets = this.buckets; @@ -1513,46 +1249,39 @@ public Entry getAndSet(Entry newEntry) { return null; } - @Override - public Entry getAndSet(String tag, Object value) { + public Entry getAndSet(@Nonnull String tag, Object value) { return this.getAndSet(Entry.newAnyEntry(tag, value)); } - @Override - public Entry getAndSet(String tag, CharSequence value) { + public Entry getAndSet(@Nonnull String tag, CharSequence value) { return this.getAndSet(Entry.newObjectEntry(tag, value)); } - @Override - public TagMap.Entry getAndSet(String tag, boolean value) { + public TagMap.Entry getAndSet(@Nonnull String tag, boolean value) { return this.getAndSet(Entry.newBooleanEntry(tag, value)); } - @Override - public TagMap.Entry getAndSet(String tag, int value) { + public TagMap.Entry getAndSet(@Nonnull String tag, int value) { return this.getAndSet(Entry.newIntEntry(tag, value)); } - @Override - public TagMap.Entry getAndSet(String tag, long value) { + public TagMap.Entry getAndSet(@Nonnull String tag, long value) { return this.getAndSet(Entry.newLongEntry(tag, value)); } - @Override - public TagMap.Entry getAndSet(String tag, float value) { + public TagMap.Entry getAndSet(@Nonnull String tag, float value) { return this.getAndSet(Entry.newFloatEntry(tag, value)); } - @Override - public TagMap.Entry getAndSet(String tag, double value) { + public TagMap.Entry getAndSet(@Nonnull String tag, double value) { return this.getAndSet(Entry.newDoubleEntry(tag, value)); } public void putAll(Map map) { this.checkWriteAccess(); - if (map instanceof OptimizedTagMap) { - this.putAllOptimizedMap((OptimizedTagMap) map); + if (map instanceof TagMap) { + this.putAllOptimizedMap((TagMap) map); } else { this.putAllUnoptimizedMap(map); } @@ -1566,23 +1295,18 @@ private void putAllUnoptimizedMap(Map that) } /** - * Similar to {@link Map#putAll(Map)} but optimized to quickly copy from one TagMap to another + * Similar to {@link Map#putAll(Map)} but optimized to quickly copy from one TagMap to another. * - *

      For optimized TagMaps, this method takes advantage of the consistent TagMap layout to - * quickly handle each bucket. And similar to {@link TagMap#getAndSet(Entry)} this method shares - * Entry objects from the source TagMap + *

      Takes advantage of the consistent TagMap layout to quickly handle each bucket. And similar + * to {@link TagMap#getAndSet(Entry)} this method shares Entry objects from the source TagMap. */ public void putAll(TagMap that) { this.checkWriteAccess(); - if (that instanceof OptimizedTagMap) { - this.putAllOptimizedMap((OptimizedTagMap) that); - } else { - this.putAllUnoptimizedMap(that); - } + this.putAllOptimizedMap(that); } - private void putAllOptimizedMap(OptimizedTagMap that) { + private void putAllOptimizedMap(TagMap that) { if (this.size == 0) { this.putAllIntoEmptyMap(that); } else { @@ -1590,7 +1314,7 @@ private void putAllOptimizedMap(OptimizedTagMap that) { } } - private void putAllMerge(OptimizedTagMap that) { + private void putAllMerge(TagMap that) { Object[] thisBuckets = this.buckets; Object[] thatBuckets = that.buckets; @@ -1707,7 +1431,7 @@ private void putAllMerge(OptimizedTagMap that) { /* * Specially optimized version of putAll for the common case of destination map being empty */ - private void putAllIntoEmptyMap(OptimizedTagMap that) { + private void putAllIntoEmptyMap(TagMap that) { Object[] thisBuckets = this.buckets; Object[] thatBuckets = that.buckets; @@ -1779,7 +1503,6 @@ public boolean remove(String tag) { return (this.getAndRemove(tag) != null); } - @Override public Entry getAndRemove(String tag) { this.checkWriteAccess(); @@ -1819,9 +1542,8 @@ public Entry getAndRemove(String tag) { return null; } - @Override public TagMap copy() { - OptimizedTagMap copy = new OptimizedTagMap(); + TagMap copy = new TagMap(); copy.putAllIntoEmptyMap(this); return copy; } @@ -1839,7 +1561,6 @@ public Iterator iterator() { return new EntryReaderIterator(this); } - @Override public Stream stream() { return StreamSupport.stream(spliterator(), false); } @@ -1863,7 +1584,6 @@ public void forEach(Consumer consumer) { } } - @Override public void forEach(T thisObj, BiConsumer consumer) { Object[] thisBuckets = this.buckets; @@ -1882,7 +1602,6 @@ public void forEach(T thisObj, BiConsumer con } } - @Override public void forEach( T thisObj, U otherObj, TriConsumer consumer) { Object[] thisBuckets = this.buckets; @@ -1909,7 +1628,7 @@ public void clear() { this.size = 0; } - public OptimizedTagMap freeze() { + public TagMap freeze() { this.frozen = true; return this; @@ -2008,7 +1727,7 @@ public Object compute( String key, BiFunction remappingFunction) { this.checkWriteAccess(); - return TagMap.super.compute(key, remappingFunction); + return Map.super.compute(key, remappingFunction); } @Override @@ -2016,7 +1735,7 @@ public Object computeIfAbsent( String key, Function mappingFunction) { this.checkWriteAccess(); - return TagMap.super.computeIfAbsent(key, mappingFunction); + return Map.super.computeIfAbsent(key, mappingFunction); } @Override @@ -2024,7 +1743,7 @@ public Object computeIfPresent( String key, BiFunction remappingFunction) { this.checkWriteAccess(); - return TagMap.super.computeIfPresent(key, remappingFunction); + return Map.super.computeIfPresent(key, remappingFunction); } @Override @@ -2091,7 +1810,7 @@ abstract static class IteratorBase { private BucketGroup group = null; private int groupIndex = 0; - IteratorBase(OptimizedTagMap map) { + IteratorBase(TagMap map) { this.buckets = map.buckets; } @@ -2165,7 +1884,7 @@ private final Entry advance() { } static final class EntryReaderIterator extends IteratorBase implements Iterator { - EntryReaderIterator(OptimizedTagMap map) { + EntryReaderIterator(TagMap map) { super(map); } @@ -2640,9 +2359,9 @@ public String toString() { } static final class Entries extends AbstractSet> { - private final OptimizedTagMap map; + private final TagMap map; - Entries(OptimizedTagMap map) { + Entries(TagMap map) { this.map = map; } @@ -2665,9 +2384,9 @@ public Iterator> iterator() { } static final class Keys extends AbstractSet { - final OptimizedTagMap map; + final TagMap map; - Keys(OptimizedTagMap map) { + Keys(TagMap map) { this.map = map; } @@ -2693,7 +2412,7 @@ public Iterator iterator() { } static final class KeysIterator extends IteratorBase implements Iterator { - KeysIterator(OptimizedTagMap map) { + KeysIterator(TagMap map) { super(map); } @@ -2704,9 +2423,9 @@ public String next() { } static final class Values extends AbstractCollection { - final OptimizedTagMap map; + final TagMap map; - Values(OptimizedTagMap map) { + Values(TagMap map) { this.map = map; } @@ -2732,7 +2451,7 @@ public Iterator iterator() { } static final class ValuesIterator extends IteratorBase implements Iterator { - ValuesIterator(OptimizedTagMap map) { + ValuesIterator(TagMap map) { super(map); } @@ -2837,424 +2556,6 @@ public Map.Entry mapEntry() { } } -final class LegacyTagMap extends HashMap implements TagMap { - private static final long serialVersionUID = 77473435283123683L; - - static final LegacyTagMap EMPTY = new LegacyTagMap().freeze(); - - private boolean frozen = false; - - LegacyTagMap() { - super(); - } - - LegacyTagMap(int capacity) { - super(capacity); - } - - LegacyTagMap(LegacyTagMap that) { - super(that); - } - - @Override - public boolean isOptimized() { - return false; - } - - @Override - public void clear() { - this.checkWriteAccess(); - - super.clear(); - } - - public LegacyTagMap freeze() { - this.frozen = true; - - return this; - } - - public boolean isFrozen() { - return this.frozen; - } - - public void checkWriteAccess() { - if (this.frozen) throw new IllegalStateException("TagMap frozen"); - } - - @Override - public TagMap copy() { - return new LegacyTagMap(this); - } - - @Override - public Iterator tagIterator() { - return this.keySet().iterator(); - } - - @Override - public Iterator valueIterator() { - return this.values().iterator(); - } - - @Override - public void fillMap(Map map) { - map.putAll(this); - } - - @Override - public void fillStringMap(Map stringMap) { - for (Map.Entry entry : this.entrySet()) { - stringMap.put(entry.getKey(), entry.getValue().toString()); - } - } - - @Override - public void forEach(Consumer consumer) { - EntryReadingHelper entryReadingHelper = new EntryReadingHelper(); - - for (Map.Entry entry : this.entrySet()) { - entryReadingHelper.set(entry); - - consumer.accept(entryReadingHelper); - } - } - - @Override - public void forEach(T thisObj, BiConsumer consumer) { - EntryReadingHelper entryReadingHelper = new EntryReadingHelper(); - - for (Map.Entry entry : this.entrySet()) { - entryReadingHelper.set(entry); - - consumer.accept(thisObj, entryReadingHelper); - } - } - - @Override - public void forEach( - T thisObj, U otherObj, TriConsumer consumer) { - EntryReadingHelper entryReadingHelper = new EntryReadingHelper(); - - for (Map.Entry entry : this.entrySet()) { - entryReadingHelper.set(entry); - - consumer.accept(thisObj, otherObj, entryReadingHelper); - } - } - - @Override - public TagMap.Entry getAndSet(String tag, Object value) { - Object prior = this.put(tag, value); - return prior == null ? null : TagMap.Entry.newAnyEntry(tag, prior); - } - - @Override - public TagMap.Entry getAndSet(String tag, CharSequence value) { - Object prior = this.put(tag, value); - return prior == null ? null : TagMap.Entry.newAnyEntry(tag, prior); - } - - @Override - public TagMap.Entry getAndSet(String tag, boolean value) { - return this.getAndSet(tag, Boolean.valueOf(value)); - } - - @Override - public TagMap.Entry getAndSet(String tag, double value) { - return this.getAndSet(tag, Double.valueOf(value)); - } - - @Override - public TagMap.Entry getAndSet(String tag, float value) { - return this.getAndSet(tag, Float.valueOf(value)); - } - - @Override - public TagMap.Entry getAndSet(String tag, int value) { - return this.getAndSet(tag, Integer.valueOf(value)); - } - - @Override - public TagMap.Entry getAndSet(String tag, long value) { - return this.getAndSet(tag, Long.valueOf(value)); - } - - @Override - public TagMap.Entry getAndSet(TagMap.Entry newEntry) { - return this.getAndSet(newEntry.tag(), newEntry.objectValue()); - } - - @Override - public TagMap.Entry getAndRemove(String tag) { - Object prior = this.remove((Object) tag); - return prior == null ? null : TagMap.Entry.newAnyEntry(tag, prior); - } - - @Override - public Object getObject(String tag) { - return this.get(tag); - } - - @Override - public boolean getBoolean(String tag) { - return this.getBooleanOrDefault(tag, false); - } - - @Override - public boolean getBooleanOrDefault(String tag, boolean defaultValue) { - Object result = this.get(tag); - if (result == null) { - return defaultValue; - } else if (result instanceof Boolean) { - return (Boolean) result; - } else if (result instanceof Number) { - Number number = (Number) result; - return (number.intValue() != 0); - } else { - // deliberately doesn't use defaultValue - return true; - } - } - - @Override - public double getDouble(String tag) { - return this.getDoubleOrDefault(tag, 0D); - } - - @Override - public double getDoubleOrDefault(String tag, double defaultValue) { - Object value = this.get(tag); - if (value == null) { - return defaultValue; - } else if (value instanceof Number) { - return ((Number) value).doubleValue(); - } else if (value instanceof Boolean) { - return ((Boolean) value) ? 1D : 0D; - } else { - // deliberately doesn't use defaultValue - return 0D; - } - } - - @Override - public long getLong(String tag) { - return this.getLongOrDefault(tag, 0L); - } - - public long getLongOrDefault(String tag, long defaultValue) { - Object value = this.get(tag); - if (value == null) { - return defaultValue; - } else if (value instanceof Number) { - return ((Number) value).longValue(); - } else if (value instanceof Boolean) { - return ((Boolean) value) ? 1L : 0L; - } else { - // deliberately doesn't use defaultValue - return 0L; - } - } - - @Override - public float getFloat(String tag) { - return this.getFloatOrDefault(tag, 0F); - } - - @Override - public float getFloatOrDefault(String tag, float defaultValue) { - Object value = this.get(tag); - if (value == null) { - return defaultValue; - } else if (value instanceof Number) { - return ((Number) value).floatValue(); - } else if (value instanceof Boolean) { - return ((Boolean) value) ? 1F : 0F; - } else { - // deliberately doesn't use defaultValue - return 0F; - } - } - - @Override - public int getInt(String tag) { - return this.getIntOrDefault(tag, 0); - } - - @Override - public int getIntOrDefault(String tag, int defaultValue) { - Object value = this.get(tag); - if (value == null) { - return defaultValue; - } else if (value instanceof Number) { - return ((Number) value).intValue(); - } else if (value instanceof Boolean) { - return ((Boolean) value) ? 1 : 0; - } else { - // deliberately doesn't use defaultValue - return 0; - } - } - - @Override - public String getString(String tag) { - Object value = this.get(tag); - return value == null ? null : value.toString(); - } - - @Override - public TagMap.Entry getEntry(String tag) { - Object value = this.get(tag); - return value == null ? null : TagMap.Entry.newAnyEntry(tag, value); - } - - @Override - public void set(String tag, boolean value) { - this.put(tag, Boolean.valueOf(value)); - } - - @Override - public void set(String tag, CharSequence value) { - this.put(tag, value); - } - - @Override - public void set(String tag, double value) { - this.put(tag, Double.valueOf(value)); - } - - @Override - public void set(String tag, float value) { - this.put(tag, Float.valueOf(value)); - } - - @Override - public void set(String tag, int value) { - this.put(tag, Integer.valueOf(value)); - } - - @Override - public void set(String tag, long value) { - this.put(tag, Long.valueOf(value)); - } - - @Override - public void set(String tag, Object value) { - this.put(tag, value); - } - - @Override - public void set(TagMap.EntryReader newEntryReader) { - this.put(newEntryReader.tag(), newEntryReader.objectValue()); - } - - @Override - public Object put(String key, Object value) { - this.checkWriteAccess(); - - return super.put(key, value); - } - - @Override - public void putAll(Map m) { - this.checkWriteAccess(); - - super.putAll(m); - } - - @Override - public void putAll(TagMap that) { - this.putAll((Map) that); - } - - @Override - public Object remove(Object key) { - this.checkWriteAccess(); - - return super.remove(key); - } - - @Override - public boolean remove(Object key, Object value) { - this.checkWriteAccess(); - - return super.remove(key, value); - } - - @Override - public boolean remove(String tag) { - this.checkWriteAccess(); - - return (super.remove(tag) != null); - } - - @Override - public Object compute( - String key, BiFunction remappingFunction) { - this.checkWriteAccess(); - - return super.compute(key, remappingFunction); - } - - @Override - public Object computeIfAbsent( - String key, Function mappingFunction) { - this.checkWriteAccess(); - - return super.computeIfAbsent(key, mappingFunction); - } - - @Override - public Object computeIfPresent( - String key, BiFunction remappingFunction) { - this.checkWriteAccess(); - - return super.computeIfPresent(key, remappingFunction); - } - - @Override - public TagMap immutableCopy() { - if (this.isEmpty()) { - return LegacyTagMap.EMPTY; - } else { - return this.copy().freeze(); - } - } - - @Override - public Iterator iterator() { - return new IteratorImpl(this); - } - - @Override - public Stream stream() { - return StreamSupport.stream(this.spliterator(), false); - } - - private static final class IteratorImpl implements Iterator { - private final Iterator> wrappedIter; - private final EntryReadingHelper entryReadingHelper; - - IteratorImpl(LegacyTagMap legacyMap) { - this.wrappedIter = legacyMap.entrySet().iterator(); - this.entryReadingHelper = new EntryReadingHelper(); - } - - @Override - public boolean hasNext() { - return this.wrappedIter.hasNext(); - } - - @Override - public TagMap.EntryReader next() { - Map.Entry entry = this.wrappedIter.next(); - this.entryReadingHelper.set(entry.getKey(), entry.getValue()); - - return this.entryReadingHelper; - } - } -} - final class TagValueConversions { TagValueConversions() {} diff --git a/internal-api/src/main/java/datadog/trace/api/appsec/AppSecContext.java b/internal-api/src/main/java/datadog/trace/api/appsec/AppSecContext.java new file mode 100644 index 00000000000..53cd0ab284a --- /dev/null +++ b/internal-api/src/main/java/datadog/trace/api/appsec/AppSecContext.java @@ -0,0 +1,6 @@ +package datadog.trace.api.appsec; + +/** Minimal view of the AppSec request context accessible across module boundaries. */ +public interface AppSecContext { + boolean isManuallyKept(); +} diff --git a/internal-api/src/main/java/datadog/trace/api/civisibility/CIConstants.java b/internal-api/src/main/java/datadog/trace/api/civisibility/CIConstants.java index a4ed5a1d9c6..648d2cd15c5 100644 --- a/internal-api/src/main/java/datadog/trace/api/civisibility/CIConstants.java +++ b/internal-api/src/main/java/datadog/trace/api/civisibility/CIConstants.java @@ -2,6 +2,12 @@ public interface CIConstants { + /** + * Maximum length (in characters) of a meta string value sent to the CI Visibility intake; longer + * values are truncated. Matches the Event Platform (EVP) per-tag-value limit. + */ + int MAX_META_STRING_VALUE_LENGTH = 5000; + String SELENIUM_BROWSER_DRIVER = "selenium"; String FAIL_FAST_TEST_ORDER = "FAILFAST"; diff --git a/internal-api/src/main/java/datadog/trace/api/civisibility/CiVisibilityWellKnownTags.java b/internal-api/src/main/java/datadog/trace/api/civisibility/CiVisibilityWellKnownTags.java index c51b2a938a7..5edbd908e91 100644 --- a/internal-api/src/main/java/datadog/trace/api/civisibility/CiVisibilityWellKnownTags.java +++ b/internal-api/src/main/java/datadog/trace/api/civisibility/CiVisibilityWellKnownTags.java @@ -1,6 +1,7 @@ package datadog.trace.api.civisibility; import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; +import datadog.trace.util.Strings; public class CiVisibilityWellKnownTags { @@ -26,16 +27,25 @@ public CiVisibilityWellKnownTags( CharSequence osPlatform, CharSequence osVersion, CharSequence isUserProvidedService) { - this.runtimeId = UTF8BytesString.create(runtimeId); - this.env = UTF8BytesString.create(env); - this.language = UTF8BytesString.create(language); - this.runtimeName = UTF8BytesString.create(runtimeName); - this.runtimeVersion = UTF8BytesString.create(runtimeVersion); - this.runtimeVendor = UTF8BytesString.create(runtimeVendor); - this.osArch = UTF8BytesString.create(osArch); - this.osPlatform = UTF8BytesString.create(osPlatform); - this.osVersion = UTF8BytesString.create(osVersion); - this.isUserProvidedService = UTF8BytesString.create(isUserProvidedService); + this.runtimeId = truncated(runtimeId); + this.env = truncated(env); + this.language = truncated(language); + this.runtimeName = truncated(runtimeName); + this.runtimeVersion = truncated(runtimeVersion); + this.runtimeVendor = truncated(runtimeVendor); + this.osArch = truncated(osArch); + this.osPlatform = truncated(osPlatform); + this.osVersion = truncated(osVersion); + this.isUserProvidedService = truncated(isUserProvidedService); + } + + /** + * Truncates a well-known tag value to the EVP per-value limit once, up front, and stores it + * pre-encoded so the intake serializers can marshal it as-is on every payload without truncating. + */ + private static UTF8BytesString truncated(CharSequence value) { + return UTF8BytesString.create( + Strings.truncate(value, CIConstants.MAX_META_STRING_VALUE_LENGTH)); } public UTF8BytesString getEnv() { diff --git a/internal-api/src/main/java/datadog/trace/api/civisibility/config/BazelMode.java b/internal-api/src/main/java/datadog/trace/api/civisibility/config/BazelMode.java index 898dd76129b..56698fe7085 100644 --- a/internal-api/src/main/java/datadog/trace/api/civisibility/config/BazelMode.java +++ b/internal-api/src/main/java/datadog/trace/api/civisibility/config/BazelMode.java @@ -3,6 +3,7 @@ import static java.nio.charset.StandardCharsets.UTF_8; import datadog.trace.api.Config; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.config.inversion.ConfigHelper; import datadog.trace.util.Strings; import java.io.BufferedReader; @@ -51,7 +52,7 @@ public static BazelMode get() { return INSTANCE; } - // visible for testing + @VisibleForTesting BazelMode(Config config) { String manifestRloc = config.getTestOptimizationManifestFile(); if (Strings.isNotBlank(manifestRloc)) { @@ -331,7 +332,7 @@ private static String lookupInRunfilesManifest(String manifestFile, String rloca return null; } - // visible for testing + @VisibleForTesting static void reset() { INSTANCE = null; } diff --git a/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/CiVisibilityCountMetric.java b/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/CiVisibilityCountMetric.java index 2f4336c3711..43d98bf6955 100644 --- a/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/CiVisibilityCountMetric.java +++ b/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/CiVisibilityCountMetric.java @@ -22,6 +22,8 @@ import datadog.trace.api.civisibility.telemetry.tag.HasCodeowner; import datadog.trace.api.civisibility.telemetry.tag.HasFailedAllRetries; import datadog.trace.api.civisibility.telemetry.tag.ImpactedTestsDetectionEnabled; +import datadog.trace.api.civisibility.telemetry.tag.IsAndroid; +import datadog.trace.api.civisibility.telemetry.tag.IsAndroidEmulated; import datadog.trace.api.civisibility.telemetry.tag.IsAttemptToFix; import datadog.trace.api.civisibility.telemetry.tag.IsDisabled; import datadog.trace.api.civisibility.telemetry.tag.IsHeadless; @@ -72,7 +74,8 @@ public enum CiVisibilityCountMetric { HasCodeowner.class, IsUnsupportedCI.class, EarlyFlakeDetectionAbortReason.class, - FailedTestReplayEnabled.SessionMetric.class), + FailedTestReplayEnabled.SessionMetric.class, + IsAndroid.class), /** The number of test events finished */ TEST_EVENT_FINISHED( "event_finished", @@ -88,7 +91,8 @@ public enum CiVisibilityCountMetric { RetryReason.class, FailedTestReplayEnabled.TestMetric.class, IsRum.class, - BrowserDriver.class), + BrowserDriver.class, + IsAndroidEmulated.class), /** The number of successfully collected code coverages that are empty */ CODE_COVERAGE_IS_EMPTY("code_coverage.is_empty"), /** The number of errors while processing code coverage */ diff --git a/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/IsAndroid.java b/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/IsAndroid.java new file mode 100644 index 00000000000..bb079a24763 --- /dev/null +++ b/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/IsAndroid.java @@ -0,0 +1,13 @@ +package datadog.trace.api.civisibility.telemetry.tag; + +import datadog.trace.api.civisibility.telemetry.TagValue; + +/** Whether a test module/session belongs to an Android project. */ +public enum IsAndroid implements TagValue { + TRUE; + + @Override + public String asString() { + return "is_android:true"; + } +} diff --git a/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/IsAndroidEmulated.java b/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/IsAndroidEmulated.java new file mode 100644 index 00000000000..dbf61580911 --- /dev/null +++ b/internal-api/src/main/java/datadog/trace/api/civisibility/telemetry/tag/IsAndroidEmulated.java @@ -0,0 +1,13 @@ +package datadog.trace.api.civisibility.telemetry.tag; + +import datadog.trace.api.civisibility.telemetry.TagValue; + +/** Whether a test ran against an emulated Android SDK (e.g. under Robolectric). */ +public enum IsAndroidEmulated implements TagValue { + TRUE; + + @Override + public String asString() { + return "is_android_emulated:true"; + } +} diff --git a/internal-api/src/main/java/datadog/trace/api/datastreams/TransactionInfo.java b/internal-api/src/main/java/datadog/trace/api/datastreams/TransactionInfo.java index 9f09186d30d..b4755d58342 100644 --- a/internal-api/src/main/java/datadog/trace/api/datastreams/TransactionInfo.java +++ b/internal-api/src/main/java/datadog/trace/api/datastreams/TransactionInfo.java @@ -1,5 +1,6 @@ package datadog.trace.api.datastreams; +import datadog.trace.api.internal.VisibleForTesting; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.charset.StandardCharsets; @@ -71,7 +72,7 @@ public byte[] getBytes() { return buffer.array(); } - // @VisibleForTesting + @VisibleForTesting static synchronized void resetCache() { CACHE.clear(); CACHE_BYTES = new byte[0]; diff --git a/internal-api/src/main/java/datadog/trace/api/function/Strategy.java b/internal-api/src/main/java/datadog/trace/api/function/Strategy.java new file mode 100644 index 00000000000..ef4329ac5e4 --- /dev/null +++ b/internal-api/src/main/java/datadog/trace/api/function/Strategy.java @@ -0,0 +1,50 @@ +package datadog.trace.api.function; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Inherited; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Marks a static-polymorphism strategy: a stateless, concrete-typed policy object that lets + * one shared algorithm specialize to straight-line code per caller, without runtime virtual + * dispatch. + * + *

      What "static polymorphism" means here. Ordinary (dynamic) polymorphism resolves the + * implementation at run time — an {@code invokevirtual}/{@code invokeinterface} that can go + * megamorphic on a shared call site. Static polymorphism instead makes the implementation known to + * the JIT: hold the strategy in a {@code static final} field of its concrete type (a stable + * constant of exact type), keep its methods small, and let the consuming method inline. The call + * site then sees the exact type, so the JIT devirtualizes the strategy's calls and inlines them, + * and the one generic algorithm compiles to specialized, monomorphic, allocation-free code per + * caller — C++-template-like specialization, driven by the JIT rather than a code generator. The + * win is structural (it follows from the exact-typed constant), not a speculative bet on + * class-hierarchy analysis or type profiling that a second implementation or a polluted profile + * could quietly undo. + * + *

      This is a documentation-and-tooling marker; it changes no behavior. It exists to telegraph the + * pattern to readers and to give a future checker something to verify. The discipline it names is + * not yet enforced — hold to it by hand until the checker lands. + * + *

      On a type ({@link ElementType#TYPE}): this type is a strategy. To get the + * specialization a caller must hold it in a {@code static final} field declared with the + * concrete type (not an abstract base or interface), and the consuming method must inline so + * the call site sees the exact type. Keep the methods small so they inline. + * + *

      On a parameter ({@link ElementType#PARAMETER}): this parameter is a strategy slot. The + * argument at each call site should be a {@code static final} constant or a non-capturing + * lambda, so it stays a single monomorphic, allocation-free instance. A parameter can carry this + * marker even when its type cannot — e.g. a {@code java.util.function.Function} slot we don't own. + * + *

      The failure mode is silent. Held at an abstract/interface type, filled with a capturing + * lambda, or called from a site that doesn't inline, it still compiles and runs correctly — it just + * stays megamorphic and/or allocates, quietly losing the win. Verify the hot ones with {@code + * -XX:+PrintInlining}. + */ +@Documented +@Inherited +@Retention(RetentionPolicy.SOURCE) +@Target({ElementType.TYPE, ElementType.PARAMETER}) +public @interface Strategy {} diff --git a/internal-api/src/main/java/datadog/trace/api/function/StrategyConsumer.java b/internal-api/src/main/java/datadog/trace/api/function/StrategyConsumer.java new file mode 100644 index 00000000000..448eba1ea7b --- /dev/null +++ b/internal-api/src/main/java/datadog/trace/api/function/StrategyConsumer.java @@ -0,0 +1,22 @@ +package datadog.trace.api.function; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Marks a higher-order method that consumes {@link Strategy} objects — one whose strategy + * parameters only specialize if this method itself inlines, so each call site sees the exact + * strategy type (see {@link Strategy}). Keep it small so it inlines. + * + *

      Documentation-and-tooling marker; it changes no behavior. It pairs with {@link Strategy}: a + * strategy type/parameter says "I am a strategy / a strategy slot," while this says "I am the site + * where they must specialize." A future checker can enforce that the arguments filling those slots + * at these call sites are {@code static final} constants or non-capturing lambdas. + */ +@Documented +@Retention(RetentionPolicy.SOURCE) +@Target(ElementType.METHOD) +public @interface StrategyConsumer {} diff --git a/internal-api/src/main/java/datadog/trace/api/gateway/InferredProxySpan.java b/internal-api/src/main/java/datadog/trace/api/gateway/InferredProxySpan.java index dce68a41c1d..3aa95465e68 100644 --- a/internal-api/src/main/java/datadog/trace/api/gateway/InferredProxySpan.java +++ b/internal-api/src/main/java/datadog/trace/api/gateway/InferredProxySpan.java @@ -6,6 +6,8 @@ import static datadog.trace.bootstrap.instrumentation.api.ResourceNamePriorities.MANUAL_INSTRUMENTATION; import static datadog.trace.bootstrap.instrumentation.api.Tags.COMPONENT; import static datadog.trace.bootstrap.instrumentation.api.Tags.HTTP_METHOD; +import static datadog.trace.bootstrap.instrumentation.api.Tags.HTTP_REQUEST_HEADERS_X_DATADOG_ENDPOINT_SCAN; +import static datadog.trace.bootstrap.instrumentation.api.Tags.HTTP_REQUEST_HEADERS_X_DATADOG_SECURITY_TEST; import static datadog.trace.bootstrap.instrumentation.api.Tags.HTTP_ROUTE; import static datadog.trace.bootstrap.instrumentation.api.Tags.HTTP_URL; import static datadog.trace.bootstrap.instrumentation.api.Tags.HTTP_USER_AGENT; @@ -16,6 +18,7 @@ import datadog.context.ContextKey; import datadog.context.ImplicitContextKeyed; import datadog.trace.api.Config; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; @@ -44,10 +47,11 @@ public class InferredProxySpan implements ImplicitContextKeyed { SUPPORTED_PROXIES = new HashMap<>(); SUPPORTED_PROXIES.put("aws-apigateway", "aws.apigateway"); SUPPORTED_PROXIES.put("aws-httpapi", "aws.httpapi"); + SUPPORTED_PROXIES.put("azure-apim", "azure.apim"); } private final Map headers; - private AgentSpan span; + @VisibleForTesting AgentSpan span; // Service-entry span registered at startSpan() time; used to guard against premature finishing // by child spans (e.g., Spring MVC handler spans) before the response status is known. private AgentSpan registeredServiceEntrySpan; @@ -164,7 +168,7 @@ public AgentSpanContext start(AgentSpanContext extracted) { // Store inferred span this.span = span; // Return inferred span as new parent context - return this.span.context(); + return this.span.spanContext(); } private String header(String name) { @@ -176,7 +180,8 @@ private String header(String name) { * arn:aws:apigateway:{region}::/restapis/{api-id} Format for v2 HTTP: * arn:aws:apigateway:{region}::/apis/{api-id} */ - private String computeArn(String proxySystem, String region, String apiId) { + @VisibleForTesting + String computeArn(String proxySystem, String region, String apiId) { if (proxySystem == null || region == null || apiId == null) { return null; } @@ -291,6 +296,19 @@ private void copyTagsFromServiceEntry(AgentSpan serviceEntrySpan) { if (userAgent != null) { this.span.setTag(HTTP_USER_AGENT, userAgent.toString()); } + + // Forward the Datadog scan/test markers so the API endpoint reducer can keep + // scan/test traffic out of the inventory even when the local root is the inferred span. + // These markers are only tagged on the service-entry span (by HttpServerDecorator), so + // calls from non-service-entry handler spans during phasedFinish are no-ops here. + Object endpointScan = serviceEntrySpan.getTag(HTTP_REQUEST_HEADERS_X_DATADOG_ENDPOINT_SCAN); + if (endpointScan != null) { + this.span.setTag(HTTP_REQUEST_HEADERS_X_DATADOG_ENDPOINT_SCAN, endpointScan.toString()); + } + Object securityTest = serviceEntrySpan.getTag(HTTP_REQUEST_HEADERS_X_DATADOG_SECURITY_TEST); + if (securityTest != null) { + this.span.setTag(HTTP_REQUEST_HEADERS_X_DATADOG_SECURITY_TEST, securityTest.toString()); + } } @Override diff --git a/internal-api/src/main/java/datadog/trace/api/llmobs/LLMObsContext.java b/internal-api/src/main/java/datadog/trace/api/llmobs/LLMObsContext.java index 09d90417d92..83df56553b8 100644 --- a/internal-api/src/main/java/datadog/trace/api/llmobs/LLMObsContext.java +++ b/internal-api/src/main/java/datadog/trace/api/llmobs/LLMObsContext.java @@ -13,12 +13,33 @@ private LLMObsContext() { } private static final ContextKey CONTEXT_KEY = ContextKey.named("llmobs_span"); + private static final ContextKey SESSION_ID_KEY = ContextKey.named("llmobs_session_id"); public static ContextScope attach(AgentSpanContext ctx) { - return Context.current().with(CONTEXT_KEY, ctx).attach(); + return attach(ctx, null); + } + + /** + * Attach an LLMObs span context, optionally propagating a session_id to descendant LLMObs spans. + * When sessionId is non-null and non-empty, child LLMObs spans started under this context that do + * not specify their own sessionId will inherit it via {@link #currentSessionId()}. + */ + public static ContextScope attach(AgentSpanContext ctx, String sessionId) { + Context updated = Context.current().with(CONTEXT_KEY, ctx); + if (sessionId != null && !sessionId.isEmpty()) { + updated = updated.with(SESSION_ID_KEY, sessionId); + } + return updated.attach(); } public static AgentSpanContext current() { return Context.current().get(CONTEXT_KEY); } + + /** + * Return the session_id propagated from an enclosing LLMObs span, or null if no parent set one. + */ + public static String currentSessionId() { + return Context.current().get(SESSION_ID_KEY); + } } diff --git a/internal-api/src/main/java/datadog/trace/api/naming/NamingSchema.java b/internal-api/src/main/java/datadog/trace/api/naming/NamingSchema.java index 31b610887ee..9ddf3178f3b 100644 --- a/internal-api/src/main/java/datadog/trace/api/naming/NamingSchema.java +++ b/internal-api/src/main/java/datadog/trace/api/naming/NamingSchema.java @@ -51,14 +51,14 @@ public interface NamingSchema { /** * Policy for peer service tags calculation * - * @return + * @return the peer service naming policy */ ForPeerService peerService(); /** * If true, the schema allows having service names != DD_SERVICE * - * @return + * @return {@code true} if the schema allows service names different from {@code DD_SERVICE} */ boolean allowInferredServices(); @@ -222,7 +222,7 @@ interface ForPeerService { /** * Whenever the schema supports peer service calculation * - * @return + * @return {@code true} if the schema supports peer service calculation */ boolean supports(); diff --git a/internal-api/src/main/java/datadog/trace/api/profiling/ProfilerFlareLogger.java b/internal-api/src/main/java/datadog/trace/api/profiling/ProfilerFlareLogger.java index 2672d8e1567..6fc57ae641d 100644 --- a/internal-api/src/main/java/datadog/trace/api/profiling/ProfilerFlareLogger.java +++ b/internal-api/src/main/java/datadog/trace/api/profiling/ProfilerFlareLogger.java @@ -1,6 +1,7 @@ package datadog.trace.api.profiling; import datadog.trace.api.flare.TracerFlare; +import datadog.trace.api.internal.VisibleForTesting; import java.io.IOException; import java.time.Instant; import java.time.ZoneOffset; @@ -23,7 +24,7 @@ private static final class Singleton { private final List flareReportLines = new ArrayList<>(); private int usedReportCapacity = 0; - // @VisibleForTesting + @VisibleForTesting ProfilerFlareLogger() { TracerFlare.addReporter(this); } @@ -76,17 +77,17 @@ public void cleanupAfterFlare() { cleanup(); } - // @VisibleForTesting + @VisibleForTesting int getUsedReportCapacity() { return usedReportCapacity; } - // @VisibleForTesting + @VisibleForTesting int getMaxReportCapacity() { return REPORT_CAPACITY; } - // @VisibleForTesting + @VisibleForTesting int linesSize() { synchronized (flareReportLines) { return flareReportLines.size(); diff --git a/internal-api/src/main/java/datadog/trace/api/propagation/W3CTraceParent.java b/internal-api/src/main/java/datadog/trace/api/propagation/W3CTraceParent.java index e999185a470..c8a15dc67e4 100644 --- a/internal-api/src/main/java/datadog/trace/api/propagation/W3CTraceParent.java +++ b/internal-api/src/main/java/datadog/trace/api/propagation/W3CTraceParent.java @@ -37,6 +37,6 @@ public static String from(DDTraceId traceId, long spanId, boolean isSampled) { } public static String from(AgentSpan span) { - return from(span.getTraceId(), span.getSpanId(), span.context().getSamplingPriority() > 0); + return from(span.getTraceId(), span.getSpanId(), span.spanContext().getSamplingPriority() > 0); } } diff --git a/internal-api/src/main/java/datadog/trace/api/remoteconfig/ServiceNameCollector.java b/internal-api/src/main/java/datadog/trace/api/remoteconfig/ServiceNameCollector.java index f2fcd105dc3..838d3cf3157 100644 --- a/internal-api/src/main/java/datadog/trace/api/remoteconfig/ServiceNameCollector.java +++ b/internal-api/src/main/java/datadog/trace/api/remoteconfig/ServiceNameCollector.java @@ -3,6 +3,7 @@ import static datadog.trace.api.telemetry.LogCollector.SEND_TELEMETRY; import datadog.trace.api.Config; +import datadog.trace.api.internal.VisibleForTesting; import java.util.ArrayList; import java.util.List; import java.util.Set; @@ -56,7 +57,7 @@ public void addService(final String serviceName) { * Get the list of unique services deduplicated by case. There is no locking on the addService map * so, the method is not thread safe. * - * @return + * @return the list of unique services, or {@code null} if none have been collected */ @Nullable public List getServices() { @@ -72,4 +73,9 @@ public List getServices() { public void clear() { services.clear(); } + + @VisibleForTesting + static void setInstance(ServiceNameCollector instance) { + INSTANCE = instance; + } } diff --git a/internal-api/src/main/java/datadog/trace/api/sampling/SamplingMechanism.java b/internal-api/src/main/java/datadog/trace/api/sampling/SamplingMechanism.java index 36f9578709c..40ac7bf4990 100644 --- a/internal-api/src/main/java/datadog/trace/api/sampling/SamplingMechanism.java +++ b/internal-api/src/main/java/datadog/trace/api/sampling/SamplingMechanism.java @@ -74,9 +74,9 @@ public static boolean validateWithSamplingPriority(int mechanism, int priority) /** * Returns true if sampling priority lock can be avoided for the given mechanism and priority * - * @param mechanism - * @param priority - * @return + * @param priority the sampling priority + * @param mechanism the sampling mechanism + * @return {@code true} if the sampling priority lock can be avoided, {@code false} otherwise */ public static boolean canAvoidSamplingPriorityLock(int priority, int mechanism) { return (!Config.get().isApmTracingEnabled() && mechanism == SamplingMechanism.APPSEC) diff --git a/internal-api/src/main/java/datadog/trace/api/telemetry/ScaReachabilityDependencyRegistry.java b/internal-api/src/main/java/datadog/trace/api/telemetry/ScaReachabilityDependencyRegistry.java new file mode 100644 index 00000000000..316e1bce922 --- /dev/null +++ b/internal-api/src/main/java/datadog/trace/api/telemetry/ScaReachabilityDependencyRegistry.java @@ -0,0 +1,248 @@ +package datadog.trace.api.telemetry; + +import datadog.trace.api.Config; +import datadog.trace.api.internal.VisibleForTesting; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicReference; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Stateful registry for SCA Reachability, implementing the RFC heartbeat model. + * + *

      The RFC requires a stateful flow: + * + *

        + *
      1. When a class from a vulnerable version is loaded: register the CVE with {@code reached=[]} + * and mark as pending — the backend learns that SCA is monitoring this dependency. + *
      2. When a vulnerable method is called: record the callsite, mark as pending. + *
      3. On each heartbeat: report ALL CVEs for every dependency that has pending changes (including + * those with empty {@code reached}) then clear pending. Empty heartbeat otherwise. + *
      + * + *

      Pattern mirrors {@code WafMetricCollector}: lives in {@code internal-api}, accessible by both + * the {@code appsec} writer and the {@code telemetry} reader without circular dependencies. + */ +public final class ScaReachabilityDependencyRegistry { + + private static final Logger log = + LoggerFactory.getLogger(ScaReachabilityDependencyRegistry.class); + + public static final ScaReachabilityDependencyRegistry INSTANCE = + new ScaReachabilityDependencyRegistry(); + + private final int maxTrackedDependencies = Config.get().getAppSecScaMaxTrackedDependencies(); + private final AtomicBoolean capWarningLogged = new AtomicBoolean(false); + + /** Keyed by {@link #depKey(String, String)}. */ + private final ConcurrentHashMap dependencies = new ConcurrentHashMap<>(); + + public static String depKey(String artifact, String version) { + return artifact + "@" + version; + } + + /** + * Optional periodic work hook for retransformation of pending method-level classes. Registered by + * {@code ScaReachabilitySystem}, called by {@code ScaReachabilityPeriodicAction}. + */ + private volatile Runnable periodicWorkCallback; + + public void setPeriodicWorkCallback(Runnable callback) { + periodicWorkCallback = callback; + } + + public Runnable getPeriodicWorkCallback() { + return periodicWorkCallback; + } + + /** Clears all state. Used in tests to reset between test cases. */ + @VisibleForTesting + public void resetForTesting() { + dependencies.clear(); + capWarningLogged.set(false); + periodicWorkCallback = null; + } + + private ScaReachabilityDependencyRegistry() {} + + /** + * Registers a CVE for a dependency when a class from a vulnerable version is loaded. Creates a + * new entry with {@code reached=[]} if not already present. Marks the dependency as pending so + * the next heartbeat reports it (signalling that SCA is monitoring this CVE). + * + *

      Called by {@code ScaReachabilityTransformer} on class load (class-level symbols) and before + * bytecode injection (method-level symbols). + */ + public void registerCve(String artifact, String version, String vulnId) { + String key = depKey(artifact, version); + if (isCapExceeded(key)) return; + DependencyState dep = + dependencies.computeIfAbsent(key, k -> new DependencyState(artifact, version)); + dep.registerCve(vulnId); + } + + /** + * Records the first callsite that triggered a vulnerable method. Only the first hit per CVE is + * stored (RFC: "reporting a single occurrence is sufficient"). Marks the dependency as pending. + * + *

      Called by {@code ScaReachabilitySystem} handler when injected bytecode fires. + */ + public void recordHit( + String artifact, + String version, + String vulnId, + String callsiteClass, + String callsiteSymbol, + int callsiteLine) { + String key = depKey(artifact, version); + if (isCapExceeded(key)) return; + dependencies + .computeIfAbsent(key, k -> new DependencyState(artifact, version)) + .recordHit(vulnId, callsiteClass, callsiteSymbol, callsiteLine); + } + + private boolean isCapExceeded(String key) { + if (!dependencies.containsKey(key) && dependencies.size() >= maxTrackedDependencies) { + if (capWarningLogged.compareAndSet(false, true)) { + log.warn( + "SCA Reachability: dependency tracking cap ({}) reached, further dependencies will not be tracked. Increase DD_APPSEC_SCA_MAX_TRACKED_DEPENDENCIES to raise the limit.", + maxTrackedDependencies); + } + return true; + } + return false; + } + + /** + * Returns the current CVE snapshot for a dependency without clearing the pending flag. Used by + * {@code ScaReachabilityPeriodicAction} when a newly-resolved JAR is not in {@code snapshotByKey} + * (i.e., the CVE was drained in a prior heartbeat but DependencyService resolved the JAR only + * now). Without this peek the emission would carry {@code metadata:[]} and overwrite the CVE + * state already reported. + * + *

      Returns {@code null} if the dependency has no CVE state. + */ + public DependencySnapshot peekSnapshot(String artifact, String version) { + DependencyState dep = dependencies.get(depKey(artifact, version)); + if (dep == null || dep.cves.isEmpty()) { + return null; + } + List cveSnapshots = new ArrayList<>(dep.cves.size()); + for (Map.Entry entry : dep.cves.entrySet()) { + cveSnapshots.add(new CveSnapshot(entry.getKey(), entry.getValue().hitRef.get())); + } + return new DependencySnapshot(artifact, version, Collections.unmodifiableList(cveSnapshots)); + } + + /** + * Returns a snapshot of all dependencies that have pending changes since the last drain, then + * clears the pending flag. Called by {@code ScaReachabilityPeriodicAction} on each heartbeat. + * + *

      Each returned {@link DependencySnapshot} contains ALL CVEs for that dependency (both with + * and without callsite hits), as required by the RFC stateful model. + */ + public List drainPendingDependencies() { + List result = new ArrayList<>(); + for (DependencyState dep : dependencies.values()) { + DependencySnapshot snapshot = dep.drainIfPending(); + if (snapshot != null) { + result.add(snapshot); + } + } + return result; + } + + // --------------------------------------------------------------------------- + // Internal state classes + // --------------------------------------------------------------------------- + + /** Mutable state for one (artifact, version) dependency. Thread-safe. */ + public static final class DependencyState { + public final String artifact; + public final String version; + + /** CVE ID → first callsite hit, or {@code null} if not yet reached. */ + private final ConcurrentHashMap cves = new ConcurrentHashMap<>(); + + private volatile boolean pendingReport = false; + + DependencyState(String artifact, String version) { + this.artifact = artifact; + this.version = version; + } + + void registerCve(String vulnId) { + cves.computeIfAbsent(vulnId, k -> new CveState()); + pendingReport = true; + } + + void recordHit(String vulnId, String callsiteClass, String callsiteSymbol, int callsiteLine) { + CveState state = cves.computeIfAbsent(vulnId, k -> new CveState()); + // compareAndSet guarantees exactly one callsite is stored (first hit wins). + // A plain volatile check-then-assign would allow two threads racing on different + // methods of the same CVE to both see null and both write, violating the invariant. + ScaReachabilityHit newHit = + new ScaReachabilityHit( + vulnId, artifact, version, callsiteClass, callsiteSymbol, callsiteLine); + if (state.hitRef.compareAndSet(null, newHit)) { + pendingReport = true; + } + } + + /** + * Returns a snapshot if pending, then clears the pending flag. Returns null if nothing to + * report. + */ + DependencySnapshot drainIfPending() { + if (!pendingReport) { + return null; + } + pendingReport = false; + List cveSnapshots = new ArrayList<>(cves.size()); + for (Map.Entry entry : cves.entrySet()) { + cveSnapshots.add(new CveSnapshot(entry.getKey(), entry.getValue().hitRef.get())); + } + return new DependencySnapshot(artifact, version, Collections.unmodifiableList(cveSnapshots)); + } + } + + /** Mutable state for one CVE within a dependency. */ + static final class CveState { + /** + * First callsite hit, or {@code null} if not yet reached. AtomicReference ensures compareAndSet + * atomicity so exactly one thread wins the "first hit" race. + */ + final AtomicReference hitRef = new AtomicReference<>(null); + } + + /** Immutable snapshot of a dependency's CVE state at drain time. */ + public static final class DependencySnapshot { + public final String artifact; + public final String version; + + /** All CVEs for this dependency: hit==null means known but not reached yet. */ + public final List cves; + + DependencySnapshot(String artifact, String version, List cves) { + this.artifact = artifact; + this.version = version; + this.cves = cves; + } + } + + /** Snapshot of one CVE: hit is null if not yet reached. */ + public static final class CveSnapshot { + public final String vulnId; + public final ScaReachabilityHit hit; // null = reached:[] + + public CveSnapshot(String vulnId, ScaReachabilityHit hit) { + this.vulnId = vulnId; + this.hit = hit; + } + } +} diff --git a/internal-api/src/main/java/datadog/trace/api/telemetry/ScaReachabilityHit.java b/internal-api/src/main/java/datadog/trace/api/telemetry/ScaReachabilityHit.java new file mode 100644 index 00000000000..f0e1e5f477c --- /dev/null +++ b/internal-api/src/main/java/datadog/trace/api/telemetry/ScaReachabilityHit.java @@ -0,0 +1,66 @@ +package datadog.trace.api.telemetry; + +/** + * A single SCA reachability detection: a vulnerable method from a known artifact was called at + * runtime. Produced by {@code ScaReachabilityTransformer} and consumed by {@code + * ScaReachabilityPeriodicAction} to build the telemetry payload. + */ +public final class ScaReachabilityHit { + + private final String vulnId; + private final String artifact; + private final String version; + // FQN of the APPLICATION class that called the vulnerable method (callsite, dot notation) + private final String className; + // The APPLICATION method that called the vulnerable method (callsite) + private final String symbolName; + // Line number in the application code where the call was made + private final int line; + + public ScaReachabilityHit( + String vulnId, + String artifact, + String version, + String className, + String symbolName, + int line) { + this.vulnId = vulnId; + this.artifact = artifact; + this.version = version; + this.className = className; + this.symbolName = symbolName; + this.line = line; + } + + /** GHSA identifier, e.g. {@code "GHSA-645p-88qh-w398"}. */ + public String vulnId() { + return vulnId; + } + + /** Maven coordinate, e.g. {@code "com.fasterxml.jackson.core:jackson-databind"}. */ + public String artifact() { + return artifact; + } + + public String version() { + return version; + } + + /** + * FQN of the APPLICATION class that called the vulnerable method (callsite, dot notation). This + * is the caller frame, not the vulnerable class itself. + */ + public String className() { + return className; + } + + /** The APPLICATION method that called the vulnerable method (callsite). */ + public String symbolName() { + return symbolName; + } + + /** Line number in the application code where the call was made. */ + public int line() { + return line; + } +} diff --git a/internal-api/src/main/java/datadog/trace/api/telemetry/WafMetricCollector.java b/internal-api/src/main/java/datadog/trace/api/telemetry/WafMetricCollector.java index 032212a7f1a..d4792a5bd69 100644 --- a/internal-api/src/main/java/datadog/trace/api/telemetry/WafMetricCollector.java +++ b/internal-api/src/main/java/datadog/trace/api/telemetry/WafMetricCollector.java @@ -33,10 +33,7 @@ private WafMetricCollector() { private static final BlockingQueue rawMetricsQueue = new ArrayBlockingQueue<>(RAW_QUEUE_SIZE); - private static final AtomicInteger wafInitCounter = new AtomicInteger(); - private static final AtomicInteger wafUpdatesCounter = new AtomicInteger(); - - private static final int WAF_REQUEST_COMBINATIONS = 128; // 2^7 + private static final int WAF_REQUEST_COMBINATIONS = 256; // 2^8 private final AtomicLongArray wafRequestCounter = new AtomicLongArray(WAF_REQUEST_COMBINATIONS); private static final AtomicLongArray wafInputTruncatedCounter = @@ -47,7 +44,7 @@ private WafMetricCollector() { private static final AtomicLongArray raspRuleSkippedCounter = new AtomicLongArray(RuleType.getNumValues()); private static final AtomicLongArray raspRuleMatchCounter = - new AtomicLongArray(RuleType.getNumValues()); + new AtomicLongArray(RuleType.getNumValues() * 2); private static final AtomicLongArray raspTimeoutCounter = new AtomicLongArray(RuleType.getNumValues()); private static final AtomicLongArray raspErrorCodeCounter = @@ -80,14 +77,11 @@ private WafMetricCollector() { public void wafInit(final String wafVersion, final String rulesVersion, final boolean success) { WafMetricCollector.wafVersion = wafVersion; WafMetricCollector.rulesVersion = rulesVersion; - rawMetricsQueue.offer( - new WafInitRawMetric(wafInitCounter.incrementAndGet(), wafVersion, rulesVersion, success)); + rawMetricsQueue.offer(new WafInitRawMetric(1L, wafVersion, rulesVersion, success)); } public void wafUpdates(final String rulesVersion, final boolean success) { - rawMetricsQueue.offer( - new WafUpdatesRawMetric( - wafUpdatesCounter.incrementAndGet(), wafVersion, rulesVersion, success)); + rawMetricsQueue.offer(new WafUpdatesRawMetric(1L, wafVersion, rulesVersion, success)); // Flush request metrics to get the new version. if (rulesVersion != null @@ -105,7 +99,8 @@ public void wafRequest( final boolean wafTimeout, final boolean blockFailure, final boolean rateLimited, - final boolean inputTruncated) { + final boolean inputTruncated, + final boolean requestExcluded) { int index = computeWafRequestIndex( ruleTriggered, @@ -114,7 +109,8 @@ public void wafRequest( wafTimeout, blockFailure, rateLimited, - inputTruncated); + inputTruncated, + requestExcluded); wafRequestCounter.incrementAndGet(index); } @@ -131,7 +127,8 @@ static int computeWafRequestIndex( boolean wafTimeout, boolean blockFailure, boolean rateLimited, - boolean inputTruncated) { + boolean inputTruncated, + boolean requestExcluded) { int index = 0; if (ruleTriggered) index |= 1; if (requestBlocked) index |= 1 << 1; @@ -140,6 +137,7 @@ static int computeWafRequestIndex( if (blockFailure) index |= 1 << 4; if (rateLimited) index |= 1 << 5; if (inputTruncated) index |= 1 << 6; + if (requestExcluded) index |= 1 << 7; return index; } @@ -160,8 +158,8 @@ public void raspRuleSkipped(final RuleType ruleType) { raspRuleSkippedCounter.incrementAndGet(ruleType.ordinal()); } - public void raspRuleMatch(final RuleType ruleType) { - raspRuleMatchCounter.incrementAndGet(ruleType.ordinal()); + public void raspRuleMatch(final RuleType ruleType, final boolean blocked) { + raspRuleMatchCounter.incrementAndGet(ruleType.ordinal() * 2 + (blocked ? 1 : 0)); } public void raspTimeout(final RuleType ruleType) { @@ -239,6 +237,7 @@ public void prepareMetrics() { boolean blockFailure = (i & (1 << 4)) != 0; boolean rateLimited = (i & (1 << 5)) != 0; boolean inputTruncated = (i & (1 << 6)) != 0; + boolean requestExcluded = (i & (1 << 7)) != 0; if (!rawMetricsQueue.offer( new WafRequestsRawMetric( @@ -251,7 +250,8 @@ public void prepareMetrics() { wafTimeout, blockFailure, rateLimited, - inputTruncated))) { + inputTruncated, + requestExcluded))) { return; } } @@ -278,12 +278,20 @@ public void prepareMetrics() { } } - // RASP rule match per rule type + // RASP rule match per rule type: two slots per RuleType: ordinal*2 (non-blocked), + // ordinal*2+1 (blocked) for (RuleType ruleType : RuleType.values()) { - long counter = raspRuleMatchCounter.getAndSet(ruleType.ordinal(), 0); - if (counter > 0) { + long blockedCount = raspRuleMatchCounter.getAndSet(ruleType.ordinal() * 2 + 1, 0); + if (blockedCount > 0) { + if (!rawMetricsQueue.offer( + new RaspRuleMatch(blockedCount, ruleType, WafMetricCollector.wafVersion, true))) { + return; + } + } + long nonBlockedCount = raspRuleMatchCounter.getAndSet(ruleType.ordinal() * 2, 0); + if (nonBlockedCount > 0) { if (!rawMetricsQueue.offer( - new RaspRuleMatch(counter, ruleType, WafMetricCollector.wafVersion))) { + new RaspRuleMatch(nonBlockedCount, ruleType, WafMetricCollector.wafVersion, false))) { return; } } @@ -495,7 +503,8 @@ public WafRequestsRawMetric( final boolean wafTimeout, final boolean blockFailure, final boolean rateLimited, - final boolean inputTruncated) { + final boolean inputTruncated, + final boolean requestExcluded) { super( "waf.requests", counter, @@ -507,7 +516,8 @@ public WafRequestsRawMetric( "waf_timeout:" + wafTimeout, "block_failure:" + blockFailure, "rate_limited:" + rateLimited, - "input_truncated:" + inputTruncated); + "input_truncated:" + inputTruncated, + "request_excluded:" + (requestExcluded ? "full" : "none")); } } @@ -558,7 +568,11 @@ public AfterRequestRaspRuleSkipped(final long counter, final RuleType ruleType) } public static class RaspRuleMatch extends WafMetric { - public RaspRuleMatch(final long counter, final RuleType ruleType, final String wafVersion) { + public RaspRuleMatch( + final long counter, + final RuleType ruleType, + final String wafVersion, + final boolean blocked) { super( "rasp.rule.match", counter, @@ -567,9 +581,12 @@ public RaspRuleMatch(final long counter, final RuleType ruleType, final String w "rule_type:" + ruleType.type, "rule_variant:" + ruleType.variant, "waf_version:" + wafVersion, - "event_rules_version:" + rulesVersion + "event_rules_version:" + rulesVersion, + "block:" + blocked } - : new String[] {"rule_type:" + ruleType.type, "waf_version:" + wafVersion}); + : new String[] { + "rule_type:" + ruleType.type, "waf_version:" + wafVersion, "block:" + blocked + }); } } diff --git a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentPropagation.java b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentPropagation.java index 586b2f08612..46a01b3f70f 100644 --- a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentPropagation.java +++ b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentPropagation.java @@ -10,6 +10,7 @@ import datadog.context.propagation.Concern; import datadog.context.propagation.Propagators; import java.util.function.BiConsumer; +import java.util.function.Function; import javax.annotation.ParametersAreNonnullByDefault; public final class AgentPropagation { @@ -33,11 +34,29 @@ public static AgentSpanContext.Extracted extractContextAndGetSpanContext( final C carrier, final ContextVisitor getter) { Context extracted = Propagators.defaultPropagator().extract(root(), carrier, getter); AgentSpan extractedSpan = fromContext(extracted); - return extractedSpan == null ? null : (AgentSpanContext.Extracted) extractedSpan.context(); + return extractedSpan == null ? null : (AgentSpanContext.Extracted) extractedSpan.spanContext(); } public interface KeyClassifier { boolean accept(String key, String value); + + /** + * Variant of {@link #accept(String, String)} for carriers that store header values in a raw + * form (e.g. {@code byte[]}) and want to defer string conversion until after the key is known + * to be relevant. + * + *

      The default implementation applies {@code transformer} eagerly and delegates to {@link + * #accept(String, String)}, so existing classifiers work without any changes. + * + * @param key the header name + * @param value the raw header value, in whatever form the carrier provides + * @param transformer converts {@code value} to a string; called at most once by the default + * implementation + * @return {@code false} to stop iteration, {@code true} to continue + */ + default boolean accept(String key, T value, Function transformer) { + return accept(key, transformer.apply(value)); + } } public interface ContextVisitor extends CarrierVisitor { diff --git a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentScope.java b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentScope.java index ba94d72c218..639f0be45f3 100644 --- a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentScope.java +++ b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentScope.java @@ -1,6 +1,7 @@ package datadog.trace.bootstrap.instrumentation.api; import datadog.context.Context; +import datadog.context.ContextContinuation; import datadog.context.ContextScope; import datadog.trace.context.TraceScope; import java.io.Closeable; @@ -16,19 +17,12 @@ default Context context() { @Override void close(); - interface Continuation extends TraceScope.Continuation { + @Deprecated + interface Continuation extends TraceScope.Continuation, ContextContinuation { @Override Continuation hold(); @Override AgentScope activate(); - - /** Provide access to the captured span */ - AgentSpan span(); - - /** Provide access to the captured context */ - default Context context() { - return span(); - } } } diff --git a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentSpan.java b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentSpan.java index 99c90b53b30..c1b38140d22 100644 --- a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentSpan.java +++ b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentSpan.java @@ -26,7 +26,16 @@ public interface AgentSpan WithAgentSpan { /** - * Extracts the span from context. + * Extracts the span from the current {@link Context}. + * + * @return the current span if existing, {@code null} otherwise. + */ + static AgentSpan current() { + return Context.current().get(SPAN_KEY); + } + + /** + * Extracts the span from the given {@link Context}. * * @param context the context to extract the span from. * @return the span if existing, {@code null} otherwise. @@ -132,7 +141,7 @@ default boolean isValid() { boolean isSameTrace(AgentSpan otherSpan); - AgentSpanContext context(); + AgentSpanContext spanContext(); String getBaggageItem(String key); @@ -251,7 +260,7 @@ default ContextScope attach() { * * @return a scope to be closed when the combined context is invalid. */ - default ContextScope attachWithCurrent() { + default ContextScope attachWithContext() { return storeInto(Context.current()).attach(); } diff --git a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentSpanContext.java b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentSpanContext.java index 9b993077444..1dba9438168 100644 --- a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentSpanContext.java +++ b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentSpanContext.java @@ -68,7 +68,7 @@ interface Extracted extends AgentSpanContext { * * @return The span links to other extracted contexts found but terminated. */ - List getTerminatedContextLinks(); + List getTerminatedSpanLinks(); String getForwarded(); diff --git a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentTraceCollector.java b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentTraceCollector.java index 93c9baee41d..b018795ffd1 100644 --- a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentTraceCollector.java +++ b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentTraceCollector.java @@ -1,7 +1,9 @@ package datadog.trace.bootstrap.instrumentation.api; +import datadog.context.ContextContinuation; + public interface AgentTraceCollector { - void registerContinuation(AgentScope.Continuation continuation); + void registerContinuation(ContextContinuation continuation); - void removeContinuation(AgentScope.Continuation continuation); + void removeContinuation(ContextContinuation continuation); } diff --git a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentTracer.java b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentTracer.java index edf781eb092..e10ee9e3fe7 100644 --- a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentTracer.java +++ b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/AgentTracer.java @@ -1,5 +1,10 @@ package datadog.trace.bootstrap.instrumentation.api; +import datadog.context.Context; +import datadog.context.ContextContinuation; +import datadog.context.ContextListener; +import datadog.context.ContextManager; +import datadog.context.ContextScope; import datadog.trace.api.ConfigDefaults; import datadog.trace.api.DDTraceId; import datadog.trace.api.EndpointCheckpointer; @@ -87,7 +92,7 @@ public static void activateSpanWithoutScope(final AgentSpan span) { * asynchronous propagation is disabled. */ @Nonnull - public static AgentScope.Continuation captureActiveSpan() { + public static ContextContinuation captureActiveSpan() { return get().captureActiveSpan(); } @@ -100,7 +105,7 @@ public static AgentScope.Continuation captureActiveSpan() { * @return Continuation of the given span. */ @Nonnull - public static AgentScope.Continuation captureSpan(final AgentSpan span) { + public static ContextContinuation captureSpan(final AgentSpan span) { return get().captureSpan(span); } @@ -231,18 +236,6 @@ public static AgentScope noopScope() { return NoopScope.INSTANCE; } - /** - * Returns the noop continuation instance. - * - *

      This instance will always be the same, and can be safely tested using object identity (ie - * {@code ==}). - * - * @return the noop continuation instance. - */ - public static AgentScope.Continuation noopContinuation() { - return NoopContinuation.INSTANCE; - } - public static final TracerAPI NOOP_TRACER = new NoopTracerAPI(); private static volatile TracerAPI provider = NOOP_TRACER; @@ -258,6 +251,9 @@ public static synchronized void registerIfAbsent(final TracerAPI tracer) { } public static synchronized void forceRegister(TracerAPI tracer) { + if (tracer == null) { + throw new IllegalArgumentException("tracer must not be null, use NOOP_TRACER instead"); + } provider = tracer; } @@ -325,9 +321,10 @@ AgentSpan startSpan( void activateSpanWithoutScope(AgentSpan span); @Override + @SuppressWarnings("deprecation") AgentScope.Continuation captureActiveSpan(); - AgentScope.Continuation captureSpan(AgentSpan span); + ContextContinuation captureSpan(AgentSpan span); void checkpointActiveForRollback(); @@ -346,17 +343,6 @@ default AgentSpan blackholeSpan() { return new BlackHoleSpan(active != null ? active.getTraceId() : DDTraceId.ZERO); } - /** Deprecated. Use {@link #buildSpan(String, CharSequence)} instead. */ - @Deprecated - default SpanBuilder buildSpan(CharSequence spanName) { - return buildSpan("datadog", spanName); - } - - @Deprecated - default SpanBuilder singleSpanBuilder(CharSequence spanName) { - return singleSpanBuilder("datadog", spanName); - } - /** * Returns a SpanBuilder that can be used to produce multiple spans. To minimize overhead, use * of {@link #singleSpanBuilder(String, CharSequence)} is preferred when only a single span is @@ -389,7 +375,7 @@ default SpanBuilder singleSpanBuilder(CharSequence spanName) { void notifyExtensionEnd(AgentSpan span, Object result, boolean isError, String lambdaRequestId); - void notifyAppSecEnd(AgentSpan span); + void notifyAppSecEnd(AgentSpan span, Object result); AgentDataStreamsMonitoring getDataStreamsMonitoring(); @@ -410,6 +396,20 @@ default SpanBuilder singleSpanBuilder(CharSequence spanName) { void updatePreferredServiceName(String serviceName, CharSequence source); void addShutdownListener(Runnable listener); + + // these methods are only used for legacy context manager migration + + @Deprecated + Context currentContext(); + + @Deprecated + ContextScope attach(Context context); + + @Deprecated + Context swap(Context context); + + @Deprecated + ContextContinuation capture(Context context); } public interface SpanBuilder { @@ -490,12 +490,13 @@ public AgentScope activateManualSpan(final AgentSpan span) { public void activateSpanWithoutScope(final AgentSpan span) {} @Override + @SuppressWarnings("deprecation") public AgentScope.Continuation captureActiveSpan() { return NoopContinuation.INSTANCE; } @Override - public AgentScope.Continuation captureSpan(final AgentSpan span) { + public ContextContinuation captureSpan(final AgentSpan span) { return NoopContinuation.INSTANCE; } @@ -645,7 +646,7 @@ public void notifyExtensionEnd( AgentSpan span, Object result, boolean isError, String lambdaRequestId) {} @Override - public void notifyAppSecEnd(AgentSpan span) {} + public void notifyAppSecEnd(AgentSpan span, Object result) {} @Override public AgentDataStreamsMonitoring getDataStreamsMonitoring() { @@ -661,16 +662,36 @@ public TraceConfig captureTraceConfig() { public void updatePreferredServiceName(String serviceName, CharSequence preferredServiceName) { // no ops } + + @Override + public Context currentContext() { + return Context.root(); + } + + @Override + public ContextScope attach(Context context) { + return NoopScope.INSTANCE; + } + + @Override + public Context swap(Context context) { + return Context.root(); + } + + @Override + public ContextContinuation capture(Context context) { + return NoopContinuation.INSTANCE; + } } public static class NoopAgentTraceCollector implements AgentTraceCollector { public static final NoopAgentTraceCollector INSTANCE = new NoopAgentTraceCollector(); @Override - public void registerContinuation(final AgentScope.Continuation continuation) {} + public void registerContinuation(final ContextContinuation continuation) {} @Override - public void removeContinuation(final AgentScope.Continuation continuation) {} + public void removeContinuation(final ContextContinuation continuation) {} } /** TraceConfig when there is no tracer; this is not the same as a default config. */ @@ -747,4 +768,52 @@ public List getDataStreamsTransactionExtractors return null; } } + + /** + * Decides whether to install the legacy approach to managing contexts, which requires a tracer. + * + *

      Must be called ahead of instrumentation, before any use of the Context API. + */ + public static void maybeInstallLegacyContextManager() { + installLegacyContextManager(); // install everywhere to begin with + } + + /** + * Always install the legacy approach to managing contexts, which requires a tracer. + * + *

      Must be called ahead of instrumentation, before any use of the Context API. + */ + public static void installLegacyContextManager() { + ContextManager.register(LegacyContextManager.INSTANCE); + } + + /** Shim mapping new Context API to legacy scope manager. */ + static final class LegacyContextManager implements ContextManager { + static final LegacyContextManager INSTANCE = new LegacyContextManager(); + + @Override + public Context current() { + return AgentTracer.get().currentContext(); + } + + @Override + public ContextScope attach(@Nonnull Context context) { + return AgentTracer.get().attach(context); + } + + @Override + public Context swap(@Nonnull Context context) { + return AgentTracer.get().swap(context); + } + + @Override + public ContextContinuation capture(@Nonnull Context context) { + return AgentTracer.get().capture(context); + } + + @Override + public void addListener(@Nonnull ContextListener listener) { + // this method is never used in legacy mode... + } + } } diff --git a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/BlackHoleSpan.java b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/BlackHoleSpan.java index 578dd7b04ae..f5e477d2054 100644 --- a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/BlackHoleSpan.java +++ b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/BlackHoleSpan.java @@ -23,7 +23,7 @@ public DDTraceId getTraceId() { } @Override - public AgentSpanContext context() { + public AgentSpanContext spanContext() { return Context.INSTANCE; } diff --git a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/ExtractedSpan.java b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/ExtractedSpan.java index 8c0013602c4..80d2331ce43 100644 --- a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/ExtractedSpan.java +++ b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/ExtractedSpan.java @@ -134,7 +134,7 @@ public String getBaggageItem(final String key) { } @Override - public AgentSpanContext context() { + public AgentSpanContext spanContext() { return this.spanContext; } diff --git a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/NoopContinuation.java b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/NoopContinuation.java index 616fa7d0619..bc3640608c2 100644 --- a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/NoopContinuation.java +++ b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/NoopContinuation.java @@ -1,23 +1,35 @@ package datadog.trace.bootstrap.instrumentation.api; -final class NoopContinuation implements AgentScope.Continuation { - static final NoopContinuation INSTANCE = new NoopContinuation(); +import datadog.context.Context; +import datadog.context.ContextScope; + +@SuppressWarnings("deprecation") +public final class NoopContinuation implements AgentScope.Continuation { + public static final NoopContinuation INSTANCE = new NoopContinuation(); private NoopContinuation() {} @Override - public AgentScope.Continuation hold() { + public NoopContinuation hold() { return this; } @Override - public AgentScope activate() { + public ContextScope resume() { return NoopScope.INSTANCE; } @Override - public AgentSpan span() { - return NoopSpan.INSTANCE; + public Context context() { + return Context.root(); + } + + @Override + public void release() {} + + @Override + public AgentScope activate() { + return NoopScope.INSTANCE; } @Override diff --git a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/NoopScope.java b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/NoopScope.java index bf879960df5..b1c26cabc5f 100644 --- a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/NoopScope.java +++ b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/NoopScope.java @@ -1,5 +1,7 @@ package datadog.trace.bootstrap.instrumentation.api; +import datadog.trace.context.TraceScope; + final class NoopScope implements AgentScope { static final NoopScope INSTANCE = new NoopScope(); @@ -11,7 +13,8 @@ public AgentSpan span() { } @Override - public Continuation capture() { + @SuppressWarnings("deprecation") + public TraceScope.Continuation capture() { return NoopContinuation.INSTANCE; } diff --git a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/NoopSpan.java b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/NoopSpan.java index 472744fa4c2..a5f1ce0d788 100644 --- a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/NoopSpan.java +++ b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/NoopSpan.java @@ -1,5 +1,6 @@ package datadog.trace.bootstrap.instrumentation.api; +import datadog.context.SelfScopedContext; import datadog.trace.api.DDSpanId; import datadog.trace.api.DDTraceId; import datadog.trace.api.TagMap; @@ -8,7 +9,7 @@ import datadog.trace.api.gateway.RequestContext; import datadog.trace.api.sampling.PrioritySampling; -class NoopSpan extends ImmutableSpan implements AgentSpan { +class NoopSpan extends ImmutableSpan implements AgentSpan, SelfScopedContext { static final NoopSpan INSTANCE = new NoopSpan(); NoopSpan() {} @@ -104,7 +105,7 @@ public boolean isSameTrace(final AgentSpan otherSpan) { } @Override - public AgentSpanContext context() { + public AgentSpanContext spanContext() { return NoopSpanContext.INSTANCE; } diff --git a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/NoopSpanContext.java b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/NoopSpanContext.java index 876c0167f51..43458f54928 100644 --- a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/NoopSpanContext.java +++ b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/NoopSpanContext.java @@ -51,7 +51,7 @@ public boolean isRemote() { } @Override - public List getTerminatedContextLinks() { + public List getTerminatedSpanLinks() { return emptyList(); } diff --git a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/TagContext.java b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/TagContext.java index 6cc277e3b22..078ffeb1625 100644 --- a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/TagContext.java +++ b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/TagContext.java @@ -25,7 +25,7 @@ public class TagContext implements AgentSpanContext.Extracted { private final CharSequence origin; private TagMap tags; - private List terminatedContextLinks; + private List terminatedSpanLinks; private Object requestContextDataAppSec; private Object requestContextDataIast; private Object ciVisibilityContextData; @@ -57,7 +57,7 @@ public TagContext( final DDTraceId traceId) { this.origin = origin; this.tags = tags; - this.terminatedContextLinks = null; + this.terminatedSpanLinks = null; this.httpHeaders = httpHeaders == null ? EMPTY_HTTP_HEADERS : httpHeaders; this.baggage = baggage == null ? Collections.emptyMap() : baggage; this.samplingPriority = samplingPriority; @@ -79,15 +79,15 @@ public final CharSequence getOrigin() { } @Override - public List getTerminatedContextLinks() { - return this.terminatedContextLinks == null ? emptyList() : this.terminatedContextLinks; + public List getTerminatedSpanLinks() { + return this.terminatedSpanLinks == null ? emptyList() : this.terminatedSpanLinks; } - public void addTerminatedContextLink(AgentSpanLink link) { - if (this.terminatedContextLinks == null) { - this.terminatedContextLinks = new ArrayList<>(); + public void addTerminatedSpanLink(AgentSpanLink link) { + if (this.terminatedSpanLinks == null) { + this.terminatedSpanLinks = new ArrayList<>(); } - this.terminatedContextLinks.add(link); + this.terminatedSpanLinks.add(link); } @Override diff --git a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/Tags.java b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/Tags.java index 943fe46fc54..d7bb5e6e934 100644 --- a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/Tags.java +++ b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/Tags.java @@ -26,6 +26,10 @@ public class Tags { public static final String HTTP_FORWARDED_IP = "http.forwarded.ip"; public static final String HTTP_FORWARDED_PORT = "http.forwarded.port"; public static final String HTTP_USER_AGENT = "http.useragent"; + public static final String HTTP_REQUEST_HEADERS_X_DATADOG_ENDPOINT_SCAN = + "http.request.headers.x-datadog-endpoint-scan"; + public static final String HTTP_REQUEST_HEADERS_X_DATADOG_SECURITY_TEST = + "http.request.headers.x-datadog-security-test"; public static final String HTTP_CLIENT_IP = "http.client_ip"; public static final String NETWORK_CLIENT_IP = "network.client.ip"; public static final String HTTP_REQUEST_CONTENT_LENGTH = "http.request_content_length"; @@ -81,6 +85,12 @@ public class Tags { public static final String TEST_BROWSER_NAME = "test.browser.name"; public static final String TEST_BROWSER_VERSION = "test.browser.version"; public static final String TEST_CALLBACK = "test.callback"; + public static final String TEST_ANDROID_API_LEVEL = "test.android.api_level"; + public static final String TEST_ANDROID_RELEASE = "test.android.release"; + public static final String TEST_ANDROID_CODENAME = "test.android.codename"; + public static final String TEST_ANDROID_ROBOLECTRIC_VERSION = "test.android.robolectric.version"; + + public static final String TEST_IS_ANDROID = "test.is_android"; public static final String TEST_SESSION_ID = "test_session_id"; public static final String TEST_MODULE_ID = "test_module_id"; @@ -173,6 +183,9 @@ public class Tags { /** AI Guard force tracer to keep the trace */ public static final String AI_GUARD_KEEP = "ai_guard.keep"; + /** Marks a span as originating from an AI Guard evaluation */ + public static final String AI_GUARD_EVENT = "ai_guard.event"; + public static final String PROPAGATED_TRACE_SOURCE = "_dd.p.ts"; public static final String PROPAGATED_DEBUG = "_dd.p.debug"; diff --git a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/URIDataAdapter.java b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/URIDataAdapter.java index 6536401f620..e2511b6e4be 100644 --- a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/URIDataAdapter.java +++ b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/URIDataAdapter.java @@ -37,7 +37,7 @@ public interface URIDataAdapter { /** * The URI is a valid one or not (looks malformed) * - * @return + * @return {@code true} if the URI is valid, {@code false} if it looks malformed */ boolean isValid(); } diff --git a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/UTF8BytesString.java b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/UTF8BytesString.java index ce60056fd92..9ea332a9a82 100644 --- a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/UTF8BytesString.java +++ b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/UTF8BytesString.java @@ -58,6 +58,13 @@ public static UTF8BytesString create(ByteBuffer utf8BytesBuffer) { private final String string; private byte[] utf8Bytes; + // Lazy hashCode cache. {@link String} already caches its own {@code hashCode} internally, but + // the inter-class call through {@code string.hashCode()} still costs a virtual dispatch + the + // String's own cached-hash field read + branch -- caching here saves all of that on subsequent + // calls. Benign race in the same shape as {@link #utf8Bytes}: two threads computing the same + // hash in parallel both produce the same value, and {@code int} writes are atomic per JLS so a + // reader cannot observe a partial value. + private int cachedHashCode; private UTF8BytesString(String string) { this.string = string; @@ -114,7 +121,12 @@ public boolean equals(Object o) { @Override public int hashCode() { - return this.string.hashCode(); + int h = this.cachedHashCode; + if (h == 0) { + h = this.string.hashCode(); + this.cachedHashCode = h; + } + return h; } @Override diff --git a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/java/lang/ProcessImplInstrumentationHelpers.java b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/java/lang/ProcessImplInstrumentationHelpers.java index e5e2f2ab6f2..1e63487012a 100644 --- a/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/java/lang/ProcessImplInstrumentationHelpers.java +++ b/internal-api/src/main/java/datadog/trace/bootstrap/instrumentation/api/java/lang/ProcessImplInstrumentationHelpers.java @@ -2,17 +2,18 @@ import static datadog.trace.api.gateway.Events.EVENTS; import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.captureActiveSpan; -import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.noopContinuation; import static java.lang.invoke.MethodType.methodType; import datadog.appsec.api.blocking.BlockingException; +import datadog.context.Context; +import datadog.context.ContextContinuation; +import datadog.context.ContextScope; import datadog.trace.api.Config; import datadog.trace.api.gateway.BlockResponseFunction; import datadog.trace.api.gateway.Flow; import datadog.trace.api.gateway.RequestContext; import datadog.trace.api.gateway.RequestContextSlot; import datadog.trace.bootstrap.ActiveSubsystems; -import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; import java.lang.invoke.MethodHandle; @@ -171,7 +172,7 @@ public static void addProcessCompletionHook(Process p, AgentSpan span) { } } - final AgentScope.Continuation continuation = captureActiveSpan(); + final ContextContinuation continuation = captureActiveSpan(); future.whenComplete( (process, thr) -> { if (thr != null) { @@ -182,7 +183,7 @@ public static void addProcessCompletionHook(Process p, AgentSpan span) { finishSpan(continuation, span); }); } else if (EXECUTOR != null) { - final AgentScope.Continuation continuation = captureActiveSpan(); + final ContextContinuation continuation = captureActiveSpan(); EXECUTOR.execute( () -> { try { @@ -308,12 +309,12 @@ public static void shiRaspCheck(@Nonnull final String cmd) { } private static void finishSpan( - final AgentScope.Continuation parentContinuation, final AgentSpan span) { - if (parentContinuation == noopContinuation()) { + final ContextContinuation parentContinuation, final AgentSpan span) { + if (parentContinuation.context() == Context.root()) { span.finish(); return; } - try (final AgentScope scope = parentContinuation.activate()) { + try (final ContextScope scope = parentContinuation.resume()) { span.finish(); } } diff --git a/internal-api/src/main/java/datadog/trace/util/ComparableVersion.java b/internal-api/src/main/java/datadog/trace/util/ComparableVersion.java index 7411667e39f..147607c71f0 100644 --- a/internal-api/src/main/java/datadog/trace/util/ComparableVersion.java +++ b/internal-api/src/main/java/datadog/trace/util/ComparableVersion.java @@ -9,7 +9,6 @@ import java.util.List; import java.util.Locale; import java.util.Properties; -import javax.annotation.Nonnull; // backported from org.apache.maven:maven-artifact:3.9.9 public class ComparableVersion implements Comparable { @@ -126,11 +125,6 @@ public int compareTo(ComparableVersion o) { return this.items.compareTo(o.items); } - /** Checks if the version is in the range {@code [start, end)} */ - public boolean isWithin(@Nonnull ComparableVersion start, @Nonnull ComparableVersion end) { - return compareTo(start) >= 0 && compareTo(end) < 0; - } - public String toString() { return this.value; } diff --git a/internal-api/src/main/java/datadog/trace/util/HashingUtils.java b/internal-api/src/main/java/datadog/trace/util/HashingUtils.java index 1522554836a..d975149f433 100644 --- a/internal-api/src/main/java/datadog/trace/util/HashingUtils.java +++ b/internal-api/src/main/java/datadog/trace/util/HashingUtils.java @@ -79,7 +79,7 @@ public static final int hash(int hash0, int hash1, int hash2, int hash3) { } public static final int hash(Object obj0, Object obj1, Object obj2, Object obj3, Object obj4) { - return hash(hashCode(obj0), hashCode(obj1), hashCode(obj2), hashCode(obj3)); + return hash(hashCode(obj0), hashCode(obj1), hashCode(obj2), hashCode(obj3), hashCode(obj4)); } public static final int hash(int hash0, int hash1, int hash2, int hash3, int hash4) { diff --git a/internal-api/src/main/java/datadog/trace/util/Hashtable.java b/internal-api/src/main/java/datadog/trace/util/Hashtable.java new file mode 100644 index 00000000000..84db05b9f01 --- /dev/null +++ b/internal-api/src/main/java/datadog/trace/util/Hashtable.java @@ -0,0 +1,906 @@ +package datadog.trace.util; + +import java.util.Arrays; +import java.util.Iterator; +import java.util.NoSuchElementException; +import java.util.Objects; +import java.util.function.BiConsumer; +import java.util.function.BiFunction; +import java.util.function.Consumer; +import java.util.function.Function; + +/** + * Light weight simple Hashtable system that can be useful when HashMap would be unnecessarily + * heavy. + * + *

        + * Use cases include... + *
      • primitive keys + *
      • primitive values + *
      • multi-part keys + *
      + * + * Convenience classes are provided for lower key dimensions. + * + *

      For higher key dimensions, client code must implement its own class, but can still use the + * support class to ease the implementation complexity. + * + *

      This outer class is a pure namespace -- it can't be instantiated. The actual table types are + * {@link D1}, {@link D2}, and (for higher-arity callers) {@link Support}-driven custom tables. + */ +public final class Hashtable { + private Hashtable() {} + + /** + * Internal base class for entries. Stores the precomputed 64-bit keyHash and the chain-next + * pointer used to link colliding entries within a single bucket. + * + *

      Subclasses add the actual key field(s) and a {@code matches(...)} method tailored to their + * key arity. See {@link D1.Entry} and {@link D2.Entry}; for higher arities, client code can + * subclass this directly and use {@link Support} to drive the table mechanics. + */ + public abstract static class Entry { + public final long keyHash; + private Entry next = null; + + protected Entry(long keyHash) { + this.keyHash = keyHash; + } + + public final void setNext(TEntry next) { + this.next = next; + } + + @SuppressWarnings("unchecked") + public final TEntry next() { + return (TEntry) this.next; + } + } + + /** + * Single-key open hash table with chaining. + * + *

      The user supplies an {@link D1.Entry} subclass that carries the key and whatever value + * fields they want to mutate in place, then instantiates this class over that entry type. The + * main advantage over {@code HashMap} is that mutating an existing entry's value fields + * requires no allocation: call {@link #get} once and write directly to the returned entry's + * fields. For counter-style workloads this can be several times faster than {@code HashMap} and produces effectively zero GC pressure. + * + *

      Capacity is fixed at construction. The table does not resize, so the caller is responsible + * for choosing a capacity appropriate to the working set. Actual bucket-array length is rounded + * up to the next power of two. + * + *

      Null keys are permitted; they collapse to a single bucket via the sentinel hash {@link + * Long#MIN_VALUE} defined in {@link D1.Entry#hash}. + * + *

      Not thread-safe. Concurrent access (including mixing reads with writes) requires + * external synchronization. + * + * @param the key type + * @param the user's {@link D1.Entry D1.Entry<K>} subclass + */ + public static final class D1> { + /** + * Abstract base for {@link D1} entries. Subclass to add value fields you wish to mutate in + * place after retrieving the entry via {@link D1#get}. + * + *

      The key is captured at construction and stored alongside its precomputed 64-bit hash. + * {@link #matches(Object)} uses {@link Objects#equals} by default; override if a different + * equality semantics is needed (e.g. reference equality for interned keys). + * + * @param the key type + */ + public abstract static class Entry extends Hashtable.Entry { + final K key; + + protected Entry(K key) { + super(hash(key)); + this.key = key; + } + + public boolean matches(Object key) { + return Objects.equals(this.key, key); + } + + /** + * Returns the 64-bit lookup hash for {@code key}. Null keys map to {@link Long#MIN_VALUE} so + * that they don't collide with a real key that hashes to 0 (e.g. {@code + * Integer.hashCode(0)}). The {@code Long.MIN_VALUE} sentinel is safe against any {@code + * int}-valued {@code hashCode()} since those widen to a long in the range {@code + * [Integer.MIN_VALUE, Integer.MAX_VALUE]}; real-key collisions in chains are resolved by + * {@link #matches(Object)}. + */ + public static long hash(Object key) { + return (key == null) ? Long.MIN_VALUE : key.hashCode(); + } + } + + // Package-private so iterator tests in the same package can drive Support.bucketIterator and + // friends directly against the table's bucket array. + final Hashtable.Entry[] buckets; + private int size; + + public D1(int capacity) { + this.buckets = Support.create(capacity); + this.size = 0; + } + + public int size() { + return this.size; + } + + public TEntry get(K key) { + long keyHash = D1.Entry.hash(key); + for (TEntry te = Support.bucket(this.buckets, keyHash); te != null; te = te.next()) { + if (te.keyHash == keyHash && te.matches(key)) { + return te; + } + } + return null; + } + + public TEntry remove(K key) { + long keyHash = D1.Entry.hash(key); + + for (MutatingBucketIterator iter = + Support.mutatingBucketIterator(this.buckets, keyHash); + iter.hasNext(); ) { + TEntry curEntry = iter.next(); + + if (curEntry.matches(key)) { + iter.remove(); + this.size -= 1; + return curEntry; + } + } + + return null; + } + + public void insert(TEntry newEntry) { + Support.insertHeadEntry(this.buckets, newEntry.keyHash, newEntry); + this.size += 1; + } + + public TEntry insertOrReplace(TEntry newEntry) { + for (MutatingBucketIterator iter = + Support.mutatingBucketIterator(this.buckets, newEntry.keyHash); + iter.hasNext(); ) { + TEntry curEntry = iter.next(); + + if (curEntry.matches(newEntry.key)) { + iter.replace(newEntry); + return curEntry; + } + } + + Support.insertHeadEntry(this.buckets, newEntry.keyHash, newEntry); + this.size += 1; + return null; + } + + /** + * Returns the entry for {@code key}, building one via {@code creator} if absent. Computes the + * hash once and reuses it for both the lookup and (on miss) the insert -- avoids the + * double-hash that "{@code get}; if null then {@code insert}" would incur. + * + *

      The {@code creator} is expected to build an entry whose {@code keyHash} equals {@link + * Entry#hash(Object) D1.Entry.hash(key)} -- typically by passing {@code key} to a constructor + * that calls {@code super(key)}. A mismatched hash will leave the new entry inserted at a + * bucket that future {@link #get} calls won't probe. + */ + public TEntry getOrCreate(K key, Function creator) { + long keyHash = D1.Entry.hash(key); + for (TEntry te = Support.bucket(this.buckets, keyHash); te != null; te = te.next()) { + if (te.keyHash == keyHash && te.matches(key)) { + return te; + } + } + TEntry newEntry = creator.apply(key); + Support.insertHeadEntry(this.buckets, newEntry.keyHash, newEntry); + this.size += 1; + return newEntry; + } + + public void clear() { + Support.clear(this.buckets); + this.size = 0; + } + + public void forEach(Consumer consumer) { + Support.forEach(this.buckets, consumer); + } + + /** + * Context-passing forEach. Useful for callers that want to avoid a capturing-lambda allocation + * -- pass a non-capturing {@link BiConsumer} (typically a {@code static final}) plus whatever + * side-band state it needs as {@code context}. + */ + public void forEach(T context, BiConsumer consumer) { + Support.forEach(this.buckets, context, consumer); + } + } + + /** + * Two-key (composite-key) hash table with chaining. + * + *

      The user supplies a {@link D2.Entry} subclass carrying both key parts and any value fields. + * Compared to {@code HashMap} this avoids the per-lookup {@code Pair} (or record) + * allocation: both key parts are passed directly through {@link #get}, {@link #remove}, {@link + * #insert}, and {@link #insertOrReplace}. Combined with in-place value mutation, this makes + * {@code D2} substantially less GC-intensive than the equivalent {@code HashMap} for + * counter-style workloads. + * + *

      Capacity is fixed at construction; the table does not resize. Actual bucket-array length is + * rounded up to the next power of two. + * + *

      Key parts are combined into a 64-bit hash via {@link LongHashingUtils}; see {@link + * D2.Entry#hash(Object, Object)}. + * + *

      Not thread-safe. + * + * @param first key type + * @param second key type + * @param the user's {@link D2.Entry D2.Entry<K1, K2>} subclass + */ + public static final class D2> { + /** + * Abstract base for {@link D2} entries. Subclass to add value fields you wish to mutate in + * place. + * + *

      Both key parts are captured at construction and stored alongside their combined 64-bit + * hash. {@link #matches(Object, Object)} uses {@link Objects#equals} pairwise on the two parts. + * + * @param first key type + * @param second key type + */ + public abstract static class Entry extends Hashtable.Entry { + final K1 key1; + final K2 key2; + + protected Entry(K1 key1, K2 key2) { + super(hash(key1, key2)); + this.key1 = key1; + this.key2 = key2; + } + + public boolean matches(K1 key1, K2 key2) { + return Objects.equals(this.key1, key1) && Objects.equals(this.key2, key2); + } + + /** + * Returns the 64-bit lookup hash combining both key parts via {@link + * LongHashingUtils#hash(Object, Object)}. Null parts contribute {@code 0} (not a sentinel, + * unlike {@link D1.Entry#hash(Object)}): the combined hash can collide with real-key + * combinations whose chained hash equals {@code hash(0, 0) = 0} or similar values. {@link + * #matches(Object, Object)} resolves any such collision. + */ + public static long hash(Object key1, Object key2) { + return LongHashingUtils.hash(key1, key2); + } + } + + // Package-private to match D1.buckets -- available for iterator tests in the same package. + final Hashtable.Entry[] buckets; + private int size; + + public D2(int capacity) { + this.buckets = Support.create(capacity); + this.size = 0; + } + + public int size() { + return this.size; + } + + public TEntry get(K1 key1, K2 key2) { + long keyHash = D2.Entry.hash(key1, key2); + for (TEntry te = Support.bucket(this.buckets, keyHash); te != null; te = te.next()) { + if (te.keyHash == keyHash && te.matches(key1, key2)) { + return te; + } + } + return null; + } + + public TEntry remove(K1 key1, K2 key2) { + long keyHash = D2.Entry.hash(key1, key2); + + for (MutatingBucketIterator iter = + Support.mutatingBucketIterator(this.buckets, keyHash); + iter.hasNext(); ) { + TEntry curEntry = iter.next(); + + if (curEntry.matches(key1, key2)) { + iter.remove(); + this.size -= 1; + return curEntry; + } + } + + return null; + } + + public void insert(TEntry newEntry) { + Support.insertHeadEntry(this.buckets, newEntry.keyHash, newEntry); + this.size += 1; + } + + public TEntry insertOrReplace(TEntry newEntry) { + for (MutatingBucketIterator iter = + Support.mutatingBucketIterator(this.buckets, newEntry.keyHash); + iter.hasNext(); ) { + TEntry curEntry = iter.next(); + + if (curEntry.matches(newEntry.key1, newEntry.key2)) { + iter.replace(newEntry); + return curEntry; + } + } + + Support.insertHeadEntry(this.buckets, newEntry.keyHash, newEntry); + this.size += 1; + return null; + } + + /** + * Two-key analogue of {@link D1#getOrCreate}. Computes the combined hash once and reuses it for + * both lookup and (on miss) insert. The {@code creator} is expected to build an entry whose + * {@code keyHash} equals {@link Entry#hash(Object, Object) D2.Entry.hash(key1, key2)}. + */ + public TEntry getOrCreate( + K1 key1, K2 key2, BiFunction creator) { + long keyHash = D2.Entry.hash(key1, key2); + for (TEntry te = Support.bucket(this.buckets, keyHash); te != null; te = te.next()) { + if (te.keyHash == keyHash && te.matches(key1, key2)) { + return te; + } + } + TEntry newEntry = creator.apply(key1, key2); + Support.insertHeadEntry(this.buckets, newEntry.keyHash, newEntry); + this.size += 1; + return newEntry; + } + + public void clear() { + Support.clear(this.buckets); + this.size = 0; + } + + public void forEach(Consumer consumer) { + Support.forEach(this.buckets, consumer); + } + + /** + * Context-passing forEach. Useful for callers that want to avoid a capturing-lambda allocation + * -- pass a non-capturing {@link BiConsumer} (typically a {@code static final}) plus whatever + * side-band state it needs as {@code context}. + */ + public void forEach(T context, BiConsumer consumer) { + Support.forEach(this.buckets, context, consumer); + } + } + + /** + * Building blocks for hash-table operations. + * + *

      Used by {@link D1} and {@link D2}, and available to callers that want to assemble their own + * higher-arity table (3+ key parts) without re-implementing the bucket-array mechanics. The + * typical recipe: + * + *

        + *
      • Subclass {@link Hashtable.Entry} directly, adding the key fields and a {@code + * matches(...)} method of your chosen arity. + *
      • Allocate a backing array with {@link #create(int)} or {@link #create(int, float)} (the + * latter scales for a target load factor; see {@link #MAX_RATIO}). + *
      • Use {@link #bucketIndex(Object[], long)} for the bucket lookup, {@link + * #bucketIterator(Hashtable.Entry[], long)} for read-only chain walks, and {@link + * #mutatingBucketIterator(Hashtable.Entry[], long)} when you also need {@code remove} / + * {@code replace}. + *
      • Use {@link #insertHeadEntry(Hashtable.Entry[], int, Hashtable.Entry)} to splice a new + * entry as the head of a bucket chain. + *
      • Iterate every entry with {@link #forEach(Hashtable.Entry[], Consumer)} or its + * context-passing sibling. For full-table sweeps with {@code remove}, use {@link + * #mutatingTableIterator(Hashtable.Entry[])}. + *
      • Clear with {@link #clear(Hashtable.Entry[])}. + *
      + * + *

      All bucket arrays produced by {@code create} have a power-of-two length, so {@link + * #bucketIndex(Object[], long)} can use a bit mask. + */ + public static final class Support { + /** + * Allocates a bucket array sized to hold {@code requestedSize} entries. Returned length is + * {@code requestedSize} rounded up to the next power of two (capped at {@link #MAX_BUCKETS}). + */ + public static final Hashtable.Entry[] create(int requestedSize) { + return new Entry[sizeFor(requestedSize)]; + } + + /** + * Variant of {@link #create(int)} that scales the requested working-set size before sizing the + * bucket array. Pair with {@link #MAX_RATIO} to leave headroom over the working set for a + * desired load factor; the canonical call is {@code create(n, MAX_RATIO)}. + * + *

      The scaled size is truncated to {@code int} before going through {@link #sizeFor(int)}. + * Truncation rather than {@code ceil} is intentional: {@code sizeFor} rounds up to the next + * power of two anyway, so the fractional part would only matter when float fuzz pushes the + * result across a power-of-two boundary -- {@code ceil} would then double the array size for no + * reason (e.g. {@code 12 * 4/3 = 16.0...0005f -> ceil 17 -> sizeFor 32}). + */ + public static final Hashtable.Entry[] create(int requestedSize, float scale) { + return new Entry[sizeFor((int) (requestedSize * scale))]; + } + + /** Upper bound on the bucket array length returned by {@link #sizeFor(int)}. */ + static final int MAX_BUCKETS = 1 << 30; + + /** + * Inverse of a 75% load factor. Callers that size their bucket array from a target working-set + * size {@code n} should pass {@code create(n, MAX_RATIO)} to leave ~25% headroom in the array. + */ + public static final float MAX_RATIO = 4.0f / 3.0f; + + /** + * Rounds {@code requestedSize} up to the next power of two, capped at {@link #MAX_BUCKETS}. + * Throws {@link IllegalArgumentException} for negative inputs or inputs above the cap. Returns + * the bucket-array length to allocate. + */ + static final int sizeFor(int requestedSize) { + if (requestedSize < 0) { + throw new IllegalArgumentException("requestedSize must be non-negative: " + requestedSize); + } + if (requestedSize > MAX_BUCKETS) { + throw new IllegalArgumentException( + "requestedSize exceeds maximum bucket count (" + MAX_BUCKETS + "): " + requestedSize); + } + if (requestedSize <= 1) { + return 1; + } + return Integer.highestOneBit(requestedSize - 1) << 1; + } + + public static final void clear(Hashtable.Entry[] buckets) { + Arrays.fill(buckets, null); + } + + public static final BucketIterator bucketIterator( + Hashtable.Entry[] buckets, long keyHash) { + return new BucketIterator(buckets, keyHash); + } + + public static final + MutatingBucketIterator mutatingBucketIterator( + Hashtable.Entry[] buckets, long keyHash) { + return new MutatingBucketIterator(buckets, keyHash); + } + + /** + * Returns a {@link MutatingTableIterator} over every entry in {@code buckets}. Useful for + * sweeps -- eviction, expunge -- that aren't keyed to a specific hash. + */ + public static final + MutatingTableIterator mutatingTableIterator(Hashtable.Entry[] buckets) { + return new MutatingTableIterator(buckets, 0, buckets.length); + } + + /** + * Variant of {@link #mutatingTableIterator(Hashtable.Entry[])} that walks only the half-open + * bucket range {@code [startBucket, endBucket)}. Useful for resumable sweeps -- e.g. cursor- + * based eviction in {@code AggregateTable} -- where one call drives {@code [cursor, length)} + * and a wrap-around call drives {@code [0, cursor)}. The iterator does not wrap around + * within a single instance; callers compose two iterators when wrap-around is desired. An empty + * range ({@code startBucket == endBucket}) produces an immediately exhausted iterator. + * + * @param startBucket inclusive lower bound; must be in {@code [0, buckets.length]}. + * @param endBucket exclusive upper bound; must be in {@code [startBucket, buckets.length]}. + */ + public static final + MutatingTableIterator mutatingTableIterator( + Hashtable.Entry[] buckets, int startBucket, int endBucket) { + return new MutatingTableIterator(buckets, startBucket, endBucket); + } + + public static final int bucketIndex(Object[] buckets, long keyHash) { + return (int) (keyHash & buckets.length - 1); + } + + /** + * Splices {@code entry} in as the new head of the chain at {@code bucketIndex}. Caller is + * responsible for size accounting -- this method only touches the chain pointers. + */ + public static final void insertHeadEntry( + Hashtable.Entry[] buckets, int bucketIndex, Hashtable.Entry entry) { + entry.setNext(buckets[bucketIndex]); + buckets[bucketIndex] = entry; + } + + /** + * Convenience overload of {@link #insertHeadEntry(Hashtable.Entry[], int, Hashtable.Entry)} + * that derives the bucket index from {@code keyHash}. Use this when the caller has the hash but + * not the index; if the index has already been computed for another reason, prefer the + * int-taking overload to avoid the redundant mask. + */ + public static final void insertHeadEntry( + Hashtable.Entry[] buckets, long keyHash, Hashtable.Entry entry) { + insertHeadEntry(buckets, bucketIndex(buckets, keyHash), entry); + } + + /** + * Returns the head entry of the bucket that {@code keyHash} maps to, cast to the caller's + * concrete entry type. The unchecked cast lives here so the chain-walk loop at the call site + * doesn't need to thread a raw {@link Entry} variable through. + */ + @SuppressWarnings("unchecked") + public static final TEntry bucket( + Hashtable.Entry[] buckets, long keyHash) { + return (TEntry) buckets[bucketIndex(buckets, keyHash)]; + } + + /** + * Walks every entry in {@code buckets} and invokes {@code consumer} on it. The unchecked cast + * to {@code TEntry} lives here (mirroring {@link Entry#next()}) so callers don't have to + * sprinkle it across their own forEach loops. + */ + @SuppressWarnings("unchecked") + public static final void forEach( + Hashtable.Entry[] buckets, Consumer consumer) { + for (int i = 0; i < buckets.length; i++) { + for (Hashtable.Entry e = buckets[i]; e != null; e = e.next()) { + consumer.accept((TEntry) e); + } + } + } + + /** + * Context-passing variant of {@link #forEach(Hashtable.Entry[], Consumer)}. Pair a + * non-capturing {@link BiConsumer} (typically a {@code static final}) with side-band state + * passed as {@code context} to avoid a fresh-Consumer allocation each call. + */ + @SuppressWarnings("unchecked") + public static final void forEach( + Hashtable.Entry[] buckets, T context, BiConsumer consumer) { + for (int i = 0; i < buckets.length; i++) { + for (Hashtable.Entry e = buckets[i]; e != null; e = e.next()) { + consumer.accept(context, (TEntry) e); + } + } + } + } + + /** + * Read-only iterator over entries in a single bucket whose {@code keyHash} matches a specific + * search hash. Cheaper than {@link MutatingBucketIterator} because it does not track the + * previous-node pointers required for splicing — use it when you only need to walk the chain. + * + *

      For {@code remove} or {@code replace} operations, use {@link MutatingBucketIterator} + * instead. + * + *

      The chain-walk work to find the next-match entry happens in {@link #next()} (and in the + * constructor for the first match); {@link #hasNext()} is an O(1) field read. + */ + public static final class BucketIterator implements Iterator { + private final long keyHash; + private Hashtable.Entry nextEntry; + + BucketIterator(Hashtable.Entry[] buckets, long keyHash) { + this.keyHash = keyHash; + Hashtable.Entry cur = buckets[Support.bucketIndex(buckets, keyHash)]; + while (cur != null && cur.keyHash != keyHash) { + cur = cur.next(); + } + this.nextEntry = cur; + } + + @Override + public boolean hasNext() { + return this.nextEntry != null; + } + + @Override + @SuppressWarnings("unchecked") + public TEntry next() { + Hashtable.Entry cur = this.nextEntry; + if (cur == null) { + throw new NoSuchElementException("no next!"); + } + + Hashtable.Entry advance = cur.next(); + while (advance != null && advance.keyHash != keyHash) { + advance = advance.next(); + } + this.nextEntry = advance; + + return (TEntry) cur; + } + } + + /** + * Mutating iterator over entries in a single bucket whose {@code keyHash} matches a specific + * search hash. Supports {@link #remove()} and {@link #replace} to splice the chain in place. + * + *

      Carries previous-node pointers for the current entry and the next-match entry so that {@code + * remove} and {@code replace} can fix up the chain in O(1) without re-walking from the bucket + * head. After {@code remove} or {@code replace}, iteration may continue with another {@link + * #next()}. + * + *

      The chain-walk work to find the next-match entry happens in {@link #next()} (and in the + * constructor for the first match); {@link #hasNext()} is an O(1) field read. + */ + public static final class MutatingBucketIterator + implements Iterator { + private final long keyHash; + + private final Hashtable.Entry[] buckets; + + /** The entry prior to the last entry returned by next Used for mutating operations */ + private Hashtable.Entry curPrevEntry; + + /** The entry that was last returned by next */ + private Hashtable.Entry curEntry; + + /** The entry prior to the next entry */ + private Hashtable.Entry nextPrevEntry; + + /** The next entry to be returned by next */ + private Hashtable.Entry nextEntry; + + MutatingBucketIterator(Hashtable.Entry[] buckets, long keyHash) { + this.buckets = buckets; + this.keyHash = keyHash; + + int bucketIndex = Support.bucketIndex(buckets, keyHash); + Hashtable.Entry headEntry = this.buckets[bucketIndex]; + if (headEntry == null) { + this.nextEntry = null; + this.nextPrevEntry = null; + + this.curEntry = null; + this.curPrevEntry = null; + } else { + Hashtable.Entry prev, cur; + for (prev = null, cur = headEntry; cur != null; prev = cur, cur = cur.next()) { + if (cur.keyHash == keyHash) { + break; + } + } + this.nextPrevEntry = prev; + this.nextEntry = cur; + + this.curEntry = null; + this.curPrevEntry = null; + } + } + + @Override + public boolean hasNext() { + return (this.nextEntry != null); + } + + @Override + @SuppressWarnings("unchecked") + public TEntry next() { + Hashtable.Entry curEntry = this.nextEntry; + if (curEntry == null) { + throw new NoSuchElementException("no next!"); + } + + this.curEntry = curEntry; + this.curPrevEntry = this.nextPrevEntry; + + Hashtable.Entry prev, cur; + for (prev = this.nextEntry, cur = this.nextEntry.next(); + cur != null; + prev = cur, cur = prev.next()) { + if (cur.keyHash == keyHash) { + break; + } + } + this.nextPrevEntry = prev; + this.nextEntry = cur; + + return (TEntry) curEntry; + } + + @Override + public void remove() { + Hashtable.Entry oldCurEntry = this.curEntry; + if (oldCurEntry == null) { + throw new IllegalStateException(); + } + + Hashtable.Entry oldNext = oldCurEntry.next(); + this.setPrevNext(oldNext); + // Detach the removed entry from the chain so stale references can't traverse back into + // the live chain and so a now-unreachable tail can be reclaimed by GC. + oldCurEntry.setNext(null); + + // If the next match was directly after oldCurEntry, its predecessor is now + // curPrevEntry (oldCurEntry was just unlinked from the chain). + if (this.nextPrevEntry == oldCurEntry) { + this.nextPrevEntry = this.curPrevEntry; + } + this.curEntry = null; + } + + public void replace(TEntry replacementEntry) { + Hashtable.Entry oldCurEntry = this.curEntry; + if (oldCurEntry == null) { + throw new IllegalStateException(); + } + + Hashtable.Entry oldNext = oldCurEntry.next(); + replacementEntry.setNext(oldNext); + this.setPrevNext(replacementEntry); + // Detach the replaced entry from the chain; the replacement now owns the chain slot. + oldCurEntry.setNext(null); + + // If the next match was directly after oldCurEntry, its predecessor is now + // the replacement entry (which took oldCurEntry's chain slot). + if (this.nextPrevEntry == oldCurEntry) { + this.nextPrevEntry = replacementEntry; + } + this.curEntry = replacementEntry; + } + + void setPrevNext(Hashtable.Entry nextEntry) { + if (this.curPrevEntry == null) { + Hashtable.Entry[] buckets = this.buckets; + buckets[Support.bucketIndex(buckets, this.keyHash)] = nextEntry; + } else { + this.curPrevEntry.setNext(nextEntry); + } + } + } + + /** + * Mutating iterator over every entry in a bucket array, regardless of hash. Supports {@link + * #remove()} to unlink the entry last returned by {@link #next()}. + * + *

      Walks buckets in array order; within a bucket, walks the chain head-to-tail. After {@code + * remove}, iteration may continue with another {@link #next()}. + * + *

      Use this for sweeps -- eviction, expunge, full-table cleanup -- that aren't keyed to a + * specific hash. For per-bucket walks keyed to a search hash, use {@link MutatingBucketIterator}. + */ + public static final class MutatingTableIterator + implements Iterator { + private final Hashtable.Entry[] buckets; + + /** Exclusive upper bound for bucket indices visited by this iterator. */ + private final int endBucket; + + /** + * Index of the bucket holding {@link #nextEntry} (or holding {@link #curEntry} after remove). + */ + private int nextBucketIndex; + + /** + * Predecessor of {@link #nextEntry}, or {@code null} when {@code nextEntry} is the bucket head. + */ + private Hashtable.Entry nextPrevEntry; + + /** Next entry to be returned by {@link #next()}, or {@code null} if iteration is exhausted. */ + private Hashtable.Entry nextEntry; + + /** + * Bucket index that held the entry last returned by {@code next}; {@code -1} after {@code + * remove}. + */ + private int curBucketIndex = -1; + + /** + * Predecessor of the entry last returned by {@code next}, or {@code null} if it was the bucket + * head. + */ + private Hashtable.Entry curPrevEntry; + + /** + * Entry last returned by {@code next}; {@code null} before any call and after {@code remove}. + */ + private Hashtable.Entry curEntry; + + MutatingTableIterator(Hashtable.Entry[] buckets, int startBucket, int endBucket) { + this.buckets = buckets; + if (startBucket < 0 || startBucket > buckets.length) { + throw new IndexOutOfBoundsException( + "startBucket " + startBucket + " out of range [0, " + buckets.length + "]"); + } + if (endBucket < startBucket || endBucket > buckets.length) { + throw new IndexOutOfBoundsException( + "endBucket " + + endBucket + + " out of range [" + + startBucket + + ", " + + buckets.length + + "]"); + } + this.endBucket = endBucket; + seekFromBucket(startBucket); + } + + /** + * Bucket index of the entry last returned by {@link #next()}, or {@code -1} if {@code next} has + * not yet been called or the most recent call was {@link #remove()}. Useful for callers driving + * a cursor — e.g. resumable eviction sweeps that want to remember where the last successful + * removal landed. + */ + public int currentBucket() { + return this.curBucketIndex; + } + + @Override + public boolean hasNext() { + return this.nextEntry != null; + } + + @Override + @SuppressWarnings("unchecked") + public TEntry next() { + Hashtable.Entry e = this.nextEntry; + if (e == null) { + throw new NoSuchElementException("no next!"); + } + + this.curEntry = e; + this.curPrevEntry = this.nextPrevEntry; + this.curBucketIndex = this.nextBucketIndex; + + Hashtable.Entry n = e.next(); + if (n != null) { + this.nextPrevEntry = e; + this.nextEntry = n; + } else { + // walked off the end of this bucket; pick up at the next non-empty bucket + seekFromBucket(this.nextBucketIndex + 1); + } + return (TEntry) e; + } + + @Override + public void remove() { + Hashtable.Entry oldCurEntry = this.curEntry; + if (oldCurEntry == null) { + throw new IllegalStateException(); + } + + Hashtable.Entry oldNext = oldCurEntry.next(); + if (this.curPrevEntry == null) { + this.buckets[this.curBucketIndex] = oldNext; + } else { + this.curPrevEntry.setNext(oldNext); + } + // Detach the removed entry from the chain so stale references can't traverse back into + // the live chain and so a now-unreachable tail can be reclaimed by GC. + oldCurEntry.setNext(null); + + // If the next entry was the immediate chain successor of oldCurEntry, its predecessor is + // now what came before oldCurEntry (oldCurEntry was just unlinked). + if (this.nextPrevEntry == oldCurEntry) { + this.nextPrevEntry = this.curPrevEntry; + } + this.curEntry = null; + } + + /** + * Advance {@code nextBucketIndex} / {@code nextEntry} to the first non-empty bucket {@code >= + * from} within {@code [0, endBucket)}. + */ + private void seekFromBucket(int from) { + Hashtable.Entry[] thisBuckets = this.buckets; + for (int i = from; i < this.endBucket; i++) { + Hashtable.Entry head = thisBuckets[i]; + if (head != null) { + this.nextBucketIndex = i; + this.nextPrevEntry = null; + this.nextEntry = head; + return; + } + } + this.nextEntry = null; + this.nextPrevEntry = null; + } + } +} diff --git a/internal-api/src/main/java/datadog/trace/util/LongHashingUtils.java b/internal-api/src/main/java/datadog/trace/util/LongHashingUtils.java new file mode 100644 index 00000000000..88104baa8d8 --- /dev/null +++ b/internal-api/src/main/java/datadog/trace/util/LongHashingUtils.java @@ -0,0 +1,162 @@ +package datadog.trace.util; + +/** + * This class is intended to be a drop-in replacement for the hashing portions of java.util.Objects. + * This class provides more convenience methods for hashing primitives and includes overrides for + * hash that take many argument lengths to avoid var-args allocation. + */ +public final class LongHashingUtils { + private LongHashingUtils() {} + + public static final long hash(Object obj) { + return obj == null ? Long.MIN_VALUE : obj.hashCode(); + } + + public static final long hash(boolean value) { + return Boolean.hashCode(value); + } + + public static final long hash(char value) { + return Character.hashCode(value); + } + + public static final long hash(byte value) { + return Byte.hashCode(value); + } + + public static final long hash(short value) { + return Short.hashCode(value); + } + + public static final long hash(int value) { + return Integer.hashCode(value); + } + + public static final long hash(long value) { + return value; + } + + public static final long hash(float value) { + return Float.hashCode(value); + } + + public static final long hash(double value) { + return Double.doubleToRawLongBits(value); + } + + public static final long hash(Object obj0, Object obj1) { + return hash(intHash(obj0), intHash(obj1)); + } + + static final long hash(int hash0, int hash1) { + return 31L * hash0 + hash1; + } + + private static final int intHash(Object obj) { + return obj == null ? 0 : obj.hashCode(); + } + + public static final long hash(Object obj0, Object obj1, Object obj2) { + return hash(intHash(obj0), intHash(obj1), intHash(obj2)); + } + + static final long hash(int hash0, int hash1, int hash2) { + // DQH - Micro-optimizing, 31L * 31L will constant fold + // Since there are multiple execution ports for load & store, + // this will make good use of the core. + return 31L * 31L * hash0 + 31L * hash1 + hash2; + } + + public static final long hash(Object obj0, Object obj1, Object obj2, Object obj3) { + return hash(intHash(obj0), intHash(obj1), intHash(obj2), intHash(obj3)); + } + + static final long hash(int hash0, int hash1, int hash2, int hash3) { + // DQH - Micro-optimizing, 31L * 31L will constant fold + // Since there are multiple execution ports for load & store, + // this will make good use of the core. + return 31L * 31L * 31L * hash0 + 31L * 31L * hash1 + 31L * hash2 + hash3; + } + + public static final long hash(Object obj0, Object obj1, Object obj2, Object obj3, Object obj4) { + return hash(intHash(obj0), intHash(obj1), intHash(obj2), intHash(obj3), intHash(obj4)); + } + + static final long hash(int hash0, int hash1, int hash2, int hash3, int hash4) { + // DQH - Micro-optimizing, 31L * 31L will constant fold + // Since there are multiple execution ports for load & store, + // this will make good use of the core. + return 31L * 31L * 31L * 31L * hash0 + + 31L * 31L * 31L * hash1 + + 31L * 31L * hash2 + + 31L * hash3 + + hash4; + } + + @Deprecated + public static final long hash(int[] hashes) { + long result = 0; + for (int hash : hashes) { + result = addToHash(result, hash); + } + return result; + } + + public static final long addToHash(long hash, int value) { + return 31L * hash + value; + } + + public static final long addToHash(long hash, Object obj) { + return addToHash(hash, intHash(obj)); + } + + public static final long addToHash(long hash, boolean value) { + return addToHash(hash, Boolean.hashCode(value)); + } + + public static final long addToHash(long hash, char value) { + return addToHash(hash, Character.hashCode(value)); + } + + public static final long addToHash(long hash, byte value) { + return addToHash(hash, Byte.hashCode(value)); + } + + public static final long addToHash(long hash, short value) { + return addToHash(hash, Short.hashCode(value)); + } + + public static final long addToHash(long hash, long value) { + return addToHash(hash, Long.hashCode(value)); + } + + public static final long addToHash(long hash, float value) { + return addToHash(hash, Float.hashCode(value)); + } + + public static final long addToHash(long hash, double value) { + return addToHash(hash, Double.hashCode(value)); + } + + public static final long hash(Iterable objs) { + long result = 0; + for (Object obj : objs) { + result = addToHash(result, obj); + } + return result; + } + + /** + * Calling this var-arg version can result in large amounts of allocation (see HashingBenchmark) + * Rather than calliing this method, add another override of hash that handles a larger number of + * arguments or use calls to addToHash. + */ + @Deprecated + public static final long hash(Object[] objs) { + long result = 0; + for (Object obj : objs) { + result = addToHash(result, obj); + } + return result; + } +} diff --git a/internal-api/src/main/java/datadog/trace/util/ProcessSupervisor.java b/internal-api/src/main/java/datadog/trace/util/ProcessSupervisor.java index 686c35ce65b..006d921bec9 100644 --- a/internal-api/src/main/java/datadog/trace/util/ProcessSupervisor.java +++ b/internal-api/src/main/java/datadog/trace/util/ProcessSupervisor.java @@ -7,6 +7,7 @@ import static datadog.trace.util.ProcessSupervisor.Health.INTERRUPTED; import static datadog.trace.util.ProcessSupervisor.Health.READY_TO_START; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.bootstrap.instrumentation.api.AgentTracer; import datadog.trace.context.TraceScope; import java.io.Closeable; @@ -146,7 +147,7 @@ public void close() { } } - // Package reachable for testing + @VisibleForTesting Process getCurrentProcess() { return currentProcess; } diff --git a/internal-api/src/main/java/datadog/trace/util/Strings.java b/internal-api/src/main/java/datadog/trace/util/Strings.java index efca9430007..603a7665c04 100644 --- a/internal-api/src/main/java/datadog/trace/util/Strings.java +++ b/internal-api/src/main/java/datadog/trace/util/Strings.java @@ -2,9 +2,13 @@ import static java.nio.charset.StandardCharsets.US_ASCII; +import datadog.trace.bootstrap.instrumentation.api.UTF8BytesString; import java.nio.charset.StandardCharsets; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; +import java.util.Collections; +import java.util.Iterator; +import java.util.NoSuchElementException; import java.util.concurrent.ThreadLocalRandom; import javax.annotation.Nullable; @@ -92,6 +96,18 @@ public static CharSequence truncate(CharSequence input, int limit) { return input.subSequence(0, limit); } + /** + * Truncates a pre-encoded {@link UTF8BytesString}. Returns the same instance when within the + * limit, so callers writing it back out keep the zero-copy fast path; only the rare over-limit + * case re-encodes the truncated value. + */ + public static UTF8BytesString truncate(UTF8BytesString input, int limit) { + if (input == null || input.length() <= limit) { + return input; + } + return UTF8BytesString.create(input.subSequence(0, limit)); + } + /** * Checks that a string is not blank, i.e. contains at least one character that is not a * whitespace @@ -180,4 +196,161 @@ public static String coalesce(@Nullable final String first, @Nullable final Stri return null; } } + + /** Low overhead replaceAll */ + public static final String replaceAll(String input, String needle, String replacement) { + int index = input.indexOf(needle); + if (index == -1) return input; + + int needleLen = needle.length(); + + StringBuilder builder = new StringBuilder(input.length() + 10); + builder.append(input, 0, index); + builder.append(replacement); + + int prevIndex = index; + index = input.indexOf(needle, index + needleLen); + for (; index != -1; prevIndex = index, index = input.indexOf(needle, index + needleLen)) { + builder.append(input, prevIndex + needleLen, index); + builder.append(replacement); + } + builder.append(input, prevIndex + needleLen, input.length()); + + return builder.toString(); + } + + /** + * Provides a SubSequence which a view into the provided String Unlike String.subSequence (which + * is usually just a wrapper around String.substring), this routine doesn't allocate a new String + * or byte[]/char[]. + */ + public static final SubSequence subSequence(String str, int beginIndex) { + return new SubSequence(str, beginIndex, str.length()); + } + + /** + * Provides a SubSequence which a view into the provided String Unlike String.subSequence (which + * is usually just a wrapper around String.substring), this routine doesn't allocate a new + * String or byte[] / char[]. + */ + public static final SubSequence subSequence(String str, int beginIndex, int endIndex) { + return new SubSequence(str, beginIndex, endIndex); + } + + /** + * Provides an Iterable where the sub-sequences are separated by splitChar + * . Unlike other approaches to splitting, this routine doesn't allocate any new + * String or byte[] / char[] + */ + public static final Iterable split(String str, char splitChar) { + if (str.isEmpty()) { + return Collections.emptyList(); + } + + int firstIndex = str.indexOf(splitChar); + if (firstIndex == -1) { + return Collections.singletonList(subSequence(str, 0)); + } + + return new SplitIterable(str, splitChar, firstIndex); + } + + static final class SplitIterable implements Iterable { + private final String str; + private final int len; + private final char splitChar; + private final int firstIndex; + + SplitIterable(String str, char splitChar, int firstIndex) { + this.str = str; + this.len = str.length(); + this.splitChar = splitChar; + this.firstIndex = firstIndex; + } + + @Override + public SplitIterator iterator() { + return new SplitIterator(this.str, this.len, this.splitChar, this.firstIndex); + } + } + + static final class SplitIterator implements Iterator { + private final String str; + private final int len; + private final char splitChar; + + private int curIndex; + private int nextIndex; + + SplitIterator(String str, int len, char splitChar, int firstIndex) { + this.str = str; + this.len = len; + this.splitChar = splitChar; + + this.curIndex = 0; + this.nextIndex = firstIndex == -1 ? len : firstIndex; + } + + @Override + public boolean hasNext() { + return (this.curIndex <= this.len); + } + + @Override + public SubSequence next() { + int curIndex = this.curIndex; + int len = this.len; + + if (curIndex > len) throw new NoSuchElementException(); + + // NOTE: Experimented with returning a single mutable SubSequence + // where the index range is updated each time. In typical usage, + // that was slightly worse -- likely because escape analysis was + // able to eliminate the allocation, but that hasn't been directly + // confirmed. + SubSequence subSeq; + + int nextIndex = this.nextIndex; + if (nextIndex == len - 1) { + // Handles the case where there's a trailing separator, + // curIndex is moved to len to represent the empty string + // after the trailing separator + + // Next call then goes into the special case below + subSeq = new SubSequence(this.str, curIndex, nextIndex); + this.curIndex = len; + this.nextIndex = len; + } else if (curIndex == len) { + // Handles the empty string after the trailing separator + // curIndex is given the terminating value `len + 1` + + // Don't use SubSequence.EMPTY because it wouldn't have + // the correct beginIndex + subSeq = new SubSequence(this.str, len, len); + this.curIndex = len + 1; + } else { + subSeq = new SubSequence(this.str, curIndex, nextIndex); + + // core advancing logic + this.curIndex = nextIndex + 1; + int searchIndex = this.str.indexOf(this.splitChar, nextIndex + 1); + this.nextIndex = (searchIndex == -1) ? len : searchIndex; + } + + return subSeq; + } + } + + /** + * True if {@code needle} occurs fully within {@code s[beginIndex, endIndex)} -- a range-limited, + * allocation-free alternative to {@code s.substring(beginIndex, endIndex).contains(needle)}. + * + *

      {@code indexOf} returns the earliest occurrence at or after {@code beginIndex}; if that one + * overshoots {@code endIndex} there is no earlier full occurrence in range, so the bound check is + * exact. + */ + public static boolean regionContains(String s, int beginIndex, int endIndex, String needle) { + int idx = s.indexOf(needle, beginIndex); + return idx >= 0 && idx + needle.length() <= endIndex; + } } diff --git a/internal-api/src/main/java/datadog/trace/util/SubSequence.java b/internal-api/src/main/java/datadog/trace/util/SubSequence.java new file mode 100644 index 00000000000..abac3ea6a7c --- /dev/null +++ b/internal-api/src/main/java/datadog/trace/util/SubSequence.java @@ -0,0 +1,265 @@ +package datadog.trace.util; + +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; + +/** + * A CharSequence that is a view into a sub-sequence of a String. Unlike + * String.subSequence, this class doesn't allocate an additional String, + * char[], or byte[]. + * + *

      Why that matters: String.substring / subSequence copy the selected + * range into a fresh backing array on every call, so scanning or splitting a string into many + * pieces — parsing headers, tags, or query strings on a hot path — allocates one intermediate + * String per slice. A SubSequence is a zero-copy window over the original + * (an offset + length into the existing backing array), so the same parse allocates nothing per + * slice. Use it for transient, read-only views; materialize a real String only when + * the value must be retained or handed off. + */ +public final class SubSequence implements CharSequence { + public static final SubSequence EMPTY = new SubSequence("", 0, 0); + + /** + * SubSequence from beginIndex to end of str Equivalent to + * str.subSequence(str, startIndex) + */ + public static final SubSequence of(String str, int startIndex) { + return new SubSequence(str, startIndex, str.length()); + } + + /** + * SubSequence from beginIndex inclusive to endIndex exclusive of + * str Equivalent to str.subSequence(str, startIndex, endIndex) + */ + public static final SubSequence of(String str, int startIndex, int endIndex) { + return new SubSequence(str, startIndex, endIndex); + } + + private final String str; + private final int beginIndex; + private final int endIndex; + + private String cachedSubstr = null; + + SubSequence(String str, int startIndex, int endIndex) { + this.str = str; + this.beginIndex = startIndex; + this.endIndex = endIndex; + } + + /** Beginning index of the subseqence in the backing String - can be useful in text processing */ + public int beginIndex() { + return this.beginIndex; + } + + /** Ending index of the subsequence in the backing String - can be useful in text processing */ + public int endIndex() { + return this.endIndex; + } + + @Override + public char charAt(int index) { + return this.str.charAt(this.beginIndex + index); + } + + @Override + public int length() { + return this.endIndex - this.beginIndex; + } + + @Override + public SubSequence subSequence(int start, int end) { + // start/end are offsets in THIS view's coordinates (CharSequence contract), so the absolute + // end is beginIndex + end -- NOT beginIndex + start + end (which overshoots by `start`). + int newBeginIndex = this.beginIndex + start; + int newEndIndex = this.beginIndex + end; + + return new SubSequence(this.str, newBeginIndex, newEndIndex); + } + + /** Appends this SubSequence to the StringBuilder Equivalent to builder.append(this) but faster */ + public void appendTo(StringBuilder builder) { + int beginIndex = this.beginIndex; + int endIndex = this.endIndex; + + // Guards against the special case empty SubSequence at this.str.length + if (beginIndex != endIndex) builder.append(this.str, beginIndex, endIndex); + } + + /** + * The same value as {@code toString().hashCode()} -- the {@link String} hash polynomial over this + * window -- but computed directly over the backing characters so hashing a view does not + * materialize a substring. Stays consistent with {@link #equals}: a view, its content-equal + * {@code String}, and an equal-content view all share this hash. + */ + @Override + public int hashCode() { + int h = 0; + for (int i = this.beginIndex; i < this.endIndex; ++i) { + h = 31 * h + this.str.charAt(i); + } + return h; + } + + /** + * Dispatches on the argument's runtime type: a {@code String} takes the {@link #equals(String)} + * region-compare fast path; any other {@code CharSequence} is compared via {@link + * #contentEquals(CharSequence)}. So {@code this.equals(backingStr.substring(beginIndex, + * endIndex))} is true, and two views with equal content are equal. + */ + // Intentionally asymmetric: a SubSequence equals any String/CharSequence with the same content, + // so subSeq.equals(str) can be true while str.equals(subSeq) is false. This view-equality + // convenience is by design (see class javadoc); accepted despite the equals() symmetry contract. + @Override + @SuppressFBWarnings("EQ_CHECK_FOR_OPERAND_NOT_COMPATIBLE_WITH_THIS") + public boolean equals(Object obj) { + if (obj instanceof String) return this.equals((String) obj); + if (obj instanceof CharSequence) return this.contentEquals((CharSequence) obj); + + return false; + } + + /** + * Equivalent to {@code toString().equals(other)}. A thin alias for {@link + * #contentEquals(String)}, kept for callers working in terms of {@code equals}; prefer {@link + * #contentEquals(String)} directly. + */ + public final boolean equals(String other) { + return this.contentEquals(other); + } + + /** + * Equivalent to {@code toString().contentEquals(that)}: true when {@code that} has the same + * length and characters as this window. The general char-by-char comparison for any {@code + * CharSequence}; prefer {@link #contentEquals(String)} when the argument is known to be a {@code + * String}. + */ + public final boolean contentEquals(CharSequence that) { + if (that == null) return false; + + int len = this.length(); + if (len != that.length()) return false; + + for (int i = 0; i < len; ++i) { + if (this.charAt(i) != that.charAt(i)) return false; + } + return true; + } + + /** + * String-specialized {@link #contentEquals(CharSequence)}: true when {@code other} has the same + * length and characters as this window, via {@link String#regionMatches} (backing-array compare, + * no per-char loop). Prefer this to {@link #equals(Object)} -- it states content-comparison + * intent and is free of the {@code equals} contract's cross-type asymmetry. + */ + public final boolean contentEquals(String other) { + return other != null + && other.length() == this.length() + && this.str.regionMatches(this.beginIndex, other, 0, other.length()); + } + + /** + * Case-insensitive counterpart of {@link #equals(String)}. Like {@link + * String#equalsIgnoreCase(String)}, a {@code null} argument is {@code false} rather than an + * error. + */ + public final boolean equalsIgnoreCase(String other) { + return other != null + && other.length() == this.length() + && this.str.regionMatches(true, this.beginIndex, other, 0, other.length()); + } + + /** + * Equivalent to {@code toString().startsWith(prefix)}. The window guard ({@code prefix.length() + * <= length()}) keeps the delegated read inside {@code [beginIndex, endIndex)}. + */ + public final boolean startsWith(String prefix) { + return prefix.length() <= this.length() && this.str.startsWith(prefix, this.beginIndex); + } + + /** + * Equivalent to {@code length() > 0 && charAt(0) == c}, the single-character {@link + * #startsWith(String)}. + */ + public final boolean startsWith(char c) { + return this.beginIndex < this.endIndex && this.str.charAt(this.beginIndex) == c; + } + + /** + * Equivalent to {@code toString().endsWith(suffix)}. Implemented as a prefix match anchored at + * {@code endIndex - suffix.length()} so the read stays inside this window. + */ + public final boolean endsWith(String suffix) { + int suffixLen = suffix.length(); + return suffixLen <= this.length() && this.str.startsWith(suffix, this.endIndex - suffixLen); + } + + /** + * Equivalent to {@code length() > 0 && charAt(length() - 1) == c}, the single-character {@link + * #endsWith(String)}. + */ + public final boolean endsWith(char c) { + return this.beginIndex < this.endIndex && this.str.charAt(this.endIndex - 1) == c; + } + + /** + * Equivalent to {@code toString().indexOf(needle)}: the offset of the first full occurrence of + * {@code needle} within this window relative to the window start, or {@code -1} if it does not + * occur fully in range. {@link String#indexOf(String, int)} returns the earliest occurrence at or + * after {@code beginIndex}, so a single bound check against {@code endIndex} is exact. + */ + public final int indexOf(String needle) { + int idx = this.str.indexOf(needle, this.beginIndex); + return (idx >= 0 && idx + needle.length() <= this.endIndex) ? idx - this.beginIndex : -1; + } + + /** + * Equivalent to {@code toString().indexOf(c)}: the offset of the first {@code c} within this + * window relative to the window start, or {@code -1} if it does not occur in range. + */ + public final int indexOf(char c) { + int idx = this.str.indexOf(c, this.beginIndex); + return (idx >= 0 && idx < this.endIndex) ? idx - this.beginIndex : -1; + } + + /** + * Equivalent to {@code toString().lastIndexOf(needle)}: the offset of the last full occurrence of + * {@code needle} within this window relative to the window start, or {@code -1} if it does not + * occur fully in range. Searches back from {@code endIndex - needle.length()} -- the latest start + * whose end still fits the window -- so the lower bound is a single check against {@code + * beginIndex}. + */ + public final int lastIndexOf(String needle) { + int idx = this.str.lastIndexOf(needle, this.endIndex - needle.length()); + return (idx >= this.beginIndex) ? idx - this.beginIndex : -1; + } + + /** + * Equivalent to {@code toString().lastIndexOf(c)}: the offset of the last {@code c} within this + * window relative to the window start, or {@code -1} if it does not occur in range. + */ + public final int lastIndexOf(char c) { + int idx = this.str.lastIndexOf(c, this.endIndex - 1); + return (idx >= this.beginIndex) ? idx - this.beginIndex : -1; + } + + /** + * True if this sub-sequence contains {@code needle} -- the zero-copy equivalent of {@code + * toString().contains(needle)}, with no substring materialized. + */ + public final boolean contains(String needle) { + return Strings.regionContains(this.str, this.beginIndex, this.endIndex, needle); + } + + @Override + public String toString() { + String cached = this.cachedSubstr; + if (cached != null) return cached; + + int beginIndex = this.beginIndex; + int endIndex = this.endIndex; + + String substr = (beginIndex == endIndex) ? "" : this.str.substring(beginIndex, endIndex); + this.cachedSubstr = substr; + return substr; + } +} diff --git a/internal-api/src/main/java/datadog/trace/util/TempLocationManager.java b/internal-api/src/main/java/datadog/trace/util/TempLocationManager.java index 7574c9c5edc..bbdcedadfa6 100644 --- a/internal-api/src/main/java/datadog/trace/util/TempLocationManager.java +++ b/internal-api/src/main/java/datadog/trace/util/TempLocationManager.java @@ -2,6 +2,7 @@ import datadog.environment.SystemProperties; import datadog.trace.api.config.ProfilingConfig; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.api.profiling.ProfilerFlareLogger; import datadog.trace.api.time.SystemTimeSource; import datadog.trace.api.time.TimeSource; @@ -18,6 +19,8 @@ import java.nio.file.attribute.BasicFileAttributes; import java.nio.file.attribute.PosixFilePermission; import java.nio.file.attribute.PosixFilePermissions; +import java.nio.file.attribute.UserPrincipal; +import java.util.EnumSet; import java.util.Set; import java.util.concurrent.CountDownLatch; import java.util.concurrent.TimeUnit; @@ -209,10 +212,20 @@ boolean await(long timeout, TimeUnit unit) throws Throwable { } } + private static final Set GROUP_WORLD_BITS = + EnumSet.of( + PosixFilePermission.GROUP_READ, + PosixFilePermission.GROUP_WRITE, + PosixFilePermission.GROUP_EXECUTE, + PosixFilePermission.OTHERS_READ, + PosixFilePermission.OTHERS_WRITE, + PosixFilePermission.OTHERS_EXECUTE); + private final boolean isPosixFs; private final Path baseTempDir; private final Path tempDir; private final long cutoffSeconds; + private UserPrincipal expectedOwner; private final CleanupTask cleanupTask = new CleanupTask(); private final CleanupHook cleanupTestHook; @@ -307,7 +320,7 @@ private TempLocationManager() { createTempDir(tempDir); } - // @VisibleForTesting + @VisibleForTesting static String getBaseTempDirName() { String userName = SystemProperties.get("user.name"); // unlikely, but fall-back to system env based user name @@ -351,6 +364,8 @@ public Path getTempDir(Path subPath, boolean create) { subPath != null && !subPath.toString().isEmpty() ? tempDir.resolve(subPath) : tempDir; if (create && !Files.exists(rslt)) { createTempDir(rslt); + } else if (isPosixFs && Files.exists(rslt)) { + validateOwnedSecureDir(rslt); } return rslt; } @@ -399,7 +414,7 @@ boolean cleanup(long timeout, TimeUnit unit) { return false; } - // accessible for tests + @VisibleForTesting boolean waitForCleanup(long timeout, TimeUnit unit) { try { return cleanupTask.await(timeout, unit); @@ -416,21 +431,84 @@ boolean waitForCleanup(long timeout, TimeUnit unit) { return false; } - // accessible for tests + @VisibleForTesting void createDirStructure() throws IOException { Files.createDirectories(baseTempDir); + if (isPosixFs) { + if (expectedOwner == null) { + expectedOwner = Files.getOwner(baseTempDir); + } + validateOwnedSecureDir(baseTempDir); + } + } + + /** + * Validates that the given directory is owned by the current JVM user and has no group or world + * permission bits set (effective {@code 0700}). Only enforced on POSIX file systems. + * + * @throws IllegalStateException if the directory fails the ownership or permission check + */ + private void validateOwnedSecureDir(Path dir) { + if (!isPosixFs) { + return; + } + try { + Set perms = Files.getPosixFilePermissions(dir); + UserPrincipal owner = Files.getOwner(dir); + boolean hasGroupWorldBits = perms.stream().anyMatch(GROUP_WORLD_BITS::contains); + boolean wrongOwner = expectedOwner != null && !expectedOwner.equals(owner); + if (hasGroupWorldBits || wrongOwner) { + ProfilerFlareLogger.getInstance() + .log( + "Refusing to use temp directory {} owned by {} with perms {}", + dir, + owner, + PosixFilePermissions.toString(perms)); + throw new IllegalStateException("Untrusted temp directory: " + dir); + } + } catch (IllegalStateException e) { + throw e; + } catch (IOException e) { + ProfilerFlareLogger.getInstance() + .log("Failed to validate temp directory ownership/permissions for {}", dir); + throw new IllegalStateException("Untrusted temp directory: " + dir, e); + } } private void createTempDir(Path tempDir) { String msg = "Failed to create temp directory: " + tempDir; try { if (isPosixFs) { + // Validate any already-existing components from baseTempDir down to tempDir + // before creating anything new, to reject attacker-pre-planted directories. + Path current = baseTempDir; + if (Files.exists(current)) { + if (expectedOwner == null) { + expectedOwner = Files.getOwner(current); + } + validateOwnedSecureDir(current); + // Walk the relative path components between baseTempDir and tempDir + Path rel = baseTempDir.relativize(tempDir); + for (int i = 0; i < rel.getNameCount(); i++) { + current = current.resolve(rel.getName(i)); + if (Files.exists(current)) { + validateOwnedSecureDir(current); + } + } + } Files.createDirectories( tempDir, PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rwx------"))); + // Capture owner from a freshly created reference if not yet established + if (expectedOwner == null) { + expectedOwner = Files.getOwner(tempDir); + } + validateOwnedSecureDir(tempDir); } else { Files.createDirectories(tempDir); } + } catch (IllegalStateException e) { + throw e; } catch (IOException e) { // if on a posix fs, let's check the expected permissions // we will find the first offender not having the expected permissions and fail the check diff --git a/internal-api/src/main/java/datadog/trace/util/stacktrace/AbstractStackWalker.java b/internal-api/src/main/java/datadog/trace/util/stacktrace/AbstractStackWalker.java index fc248169641..34a002f47bb 100644 --- a/internal-api/src/main/java/datadog/trace/util/stacktrace/AbstractStackWalker.java +++ b/internal-api/src/main/java/datadog/trace/util/stacktrace/AbstractStackWalker.java @@ -16,7 +16,7 @@ final Stream doFilterStack(Stream stream) abstract T doGetStack(Function, T> consumer); - static boolean isNotDatadogTraceStackElement(final StackTraceElement el) { + public static boolean isNotDatadogTraceStackElement(final StackTraceElement el) { final String clazz = el.getClassName(); return !clazz.startsWith("datadog.trace.") && !clazz.startsWith("com.datadog.iast.") diff --git a/internal-api/src/test/groovy/datadog/trace/api/ConfigTest.groovy b/internal-api/src/test/groovy/datadog/trace/api/ConfigTest.groovy index faa4d04311e..11f100efc42 100644 --- a/internal-api/src/test/groovy/datadog/trace/api/ConfigTest.groovy +++ b/internal-api/src/test/groovy/datadog/trace/api/ConfigTest.groovy @@ -53,6 +53,7 @@ import static datadog.trace.api.config.GeneralConfig.SSI_INJECTION_ENABLED import static datadog.trace.api.config.GeneralConfig.SSI_INJECTION_FORCE import static datadog.trace.api.config.GeneralConfig.TAGS import static datadog.trace.api.config.GeneralConfig.TRACER_METRICS_IGNORED_RESOURCES +import static datadog.trace.api.config.GeneralConfig.TRACE_OTEL_SEMANTICS_ENABLED import static datadog.trace.api.config.GeneralConfig.VERSION import static datadog.trace.api.config.JmxFetchConfig.JMX_FETCH_CHECK_PERIOD import static datadog.trace.api.config.JmxFetchConfig.JMX_FETCH_ENABLED @@ -137,6 +138,7 @@ import static datadog.trace.api.config.OtlpConfig.Protocol.HTTP_JSON import static datadog.trace.api.config.OtlpConfig.Temporality.CUMULATIVE import static datadog.trace.api.config.OtlpConfig.Temporality.DELTA import static datadog.trace.api.config.OtlpConfig.METRICS_OTEL_ENABLED +import static datadog.trace.api.config.OtlpConfig.METRICS_OTEL_EXPORTER import static datadog.trace.api.config.OtlpConfig.METRICS_OTEL_INTERVAL import static datadog.trace.api.config.OtlpConfig.METRICS_OTEL_TIMEOUT import static datadog.trace.api.config.OtlpConfig.OTLP_METRICS_ENDPOINT @@ -148,7 +150,9 @@ import static datadog.trace.api.config.OtlpConfig.OTLP_TRACES_ENDPOINT import static datadog.trace.api.config.OtlpConfig.OTLP_TRACES_HEADERS import static datadog.trace.api.config.OtlpConfig.OTLP_TRACES_PROTOCOL import static datadog.trace.api.config.OtlpConfig.OTLP_TRACES_TIMEOUT +import static datadog.trace.api.config.OtlpConfig.OTEL_TRACES_SPAN_METRICS_ENABLED import static datadog.trace.api.config.OtlpConfig.TRACE_OTEL_ENABLED +import static datadog.trace.api.config.OtlpConfig.TRACE_OTEL_EXPORTER import datadog.trace.config.inversion.ConfigHelper import datadog.trace.api.env.FixedCapturedEnvironment @@ -555,6 +559,10 @@ class ConfigTest extends DDSpecification { config.otlpTracesHeaders == [:] config.otlpTracesProtocol == HTTP_PROTOBUF config.otlpTracesTimeout == 10000 + + !config.otelTracesSpanMetricsEnabled + !config.traceOtelSemanticsEnabled + config.traceStatsInterval == 10000 } def "otel: check syntax for OTLP headers"() { @@ -715,6 +723,36 @@ class ConfigTest extends DDSpecification { config.otlpTracesEndpoint == "http://localhost:4318/v1/traces" } + def "traces span metrics tri-state default: exporter=#exporter metricsEnabled=#metricsEnabled metricsExporter=#metricsExporter override=#override"() { + setup: + System.setProperty(PREFIX + TRACE_OTEL_EXPORTER, exporter) + System.setProperty(PREFIX + METRICS_OTEL_ENABLED, metricsEnabled) + if (metricsExporter != null) { + System.setProperty(PREFIX + METRICS_OTEL_EXPORTER, metricsExporter) + } + if (override != null) { + System.setProperty(PREFIX + OTEL_TRACES_SPAN_METRICS_ENABLED, override) + } + + when: + Config config = new Config() + + then: + // Unset: emit iff OTLP trace export and OTLP metrics export are both on. An explicit + // dd.otel.traces.span.metrics.enabled always wins. + config.otelTracesSpanMetricsEnabled == expected + + where: + exporter | metricsEnabled | metricsExporter | override | expected + "otlp" | "true" | null | null | true // metrics defaults to otlp + "otlp" | "true" | "otlp" | null | true + "otlp" | "true" | "none" | null | false // metrics exporter explicitly disabled + "otlp" | "false" | "otlp" | null | false // metrics feature flag off overrides exporter + "none" | "true" | null | null | false + "none" | "true" | "otlp" | null | false + "none" | "false" | "none" | "true" | true // explicit override wins + "otlp" | "true" | "otlp" | "false" | false // explicit override wins + } def "specify overrides via system properties"() { setup: @@ -831,6 +869,7 @@ class ConfigTest extends DDSpecification { System.setProperty(OTEL_EXPORTER_OTLP_TRACES_PROTOCOL_PROP, "http/protobuf") System.setProperty(OTEL_EXPORTER_OTLP_TRACES_TIMEOUT_PROP, "5002") System.setProperty(OTEL_RESOURCE_ATTRIBUTES_PROP, "service.name=my=app,service.version=1.0.0,deployment.environment=production") + System.setProperty(PREFIX + TRACE_OTEL_SEMANTICS_ENABLED, "true") when: Config config = new Config() @@ -953,6 +992,9 @@ class ConfigTest extends DDSpecification { config.otlpTracesHeaders["traces-config-value"] == "T" config.otlpTracesProtocol == HTTP_PROTOBUF config.otlpTracesTimeout == 5002 + + config.traceOtelSemanticsEnabled + config.otelTracesSpanMetricsEnabled // tri-state default: OTLP trace export + OTel metrics both on } def "specify overrides via env vars"() { diff --git a/internal-api/src/test/groovy/datadog/trace/api/ProductTraceSourceTest.groovy b/internal-api/src/test/groovy/datadog/trace/api/ProductTraceSourceTest.groovy index bc376154217..33ee2ef59bd 100644 --- a/internal-api/src/test/groovy/datadog/trace/api/ProductTraceSourceTest.groovy +++ b/internal-api/src/test/groovy/datadog/trace/api/ProductTraceSourceTest.groovy @@ -28,6 +28,23 @@ class ProductTraceSourceTest extends DDSpecification { value | product | expected ProductTraceSource.ASM | ProductTraceSource.ASM | true ProductTraceSource.DSM | ProductTraceSource.ASM | false + ProductTraceSource.AI_GUARD | ProductTraceSource.AI_GUARD | true + ProductTraceSource.ASM | ProductTraceSource.AI_GUARD | false + } + + void 'test isProductMarked with two products'(){ + when: + final result = ProductTraceSource.isProductMarked(value, productA, productB) + + then: + result == expected + + where: + value | productA | productB | expected + ProductTraceSource.ASM | ProductTraceSource.ASM | ProductTraceSource.AI_GUARD | true + ProductTraceSource.AI_GUARD | ProductTraceSource.ASM | ProductTraceSource.AI_GUARD | true + ProductTraceSource.DSM | ProductTraceSource.ASM | ProductTraceSource.AI_GUARD | false + ProductTraceSource.UNSET | ProductTraceSource.ASM | ProductTraceSource.AI_GUARD | false } void 'test getBitfieldHex'(){ @@ -41,6 +58,7 @@ class ProductTraceSourceTest extends DDSpecification { value | expected ProductTraceSource.UNSET | "00" ProductTraceSource.ASM | "02" + ProductTraceSource.AI_GUARD | "20" } void 'test parseBitfieldHex'(){ @@ -56,5 +74,6 @@ class ProductTraceSourceTest extends DDSpecification { null | ProductTraceSource.UNSET "" | ProductTraceSource.UNSET "02" | ProductTraceSource.ASM + "20" | ProductTraceSource.AI_GUARD } } diff --git a/internal-api/src/test/groovy/datadog/trace/api/WellKnownTagsTest.groovy b/internal-api/src/test/groovy/datadog/trace/api/WellKnownTagsTest.groovy deleted file mode 100644 index 6474142bced..00000000000 --- a/internal-api/src/test/groovy/datadog/trace/api/WellKnownTagsTest.groovy +++ /dev/null @@ -1,19 +0,0 @@ -package datadog.trace.api - -import datadog.trace.test.util.DDSpecification - -class WellKnownTagsTest extends DDSpecification { - - def "well known tags doesn't modify its inputs"() { - given: - WellKnownTags wellKnownTags = - new WellKnownTags("runtimeid", "hostname", "env", "service", "version","language") - expect: - wellKnownTags.getRuntimeId() as String == "runtimeid" - wellKnownTags.getHostname() as String == "hostname" - wellKnownTags.getEnv() as String == "env" - wellKnownTags.getService() as String == "service" - wellKnownTags.getVersion() as String == "version" - wellKnownTags.getLanguage() as String == "language" - } -} diff --git a/internal-api/src/test/groovy/datadog/trace/api/propagation/W3CTraceParentTest.groovy b/internal-api/src/test/groovy/datadog/trace/api/propagation/W3CTraceParentTest.groovy deleted file mode 100644 index 739354dc27f..00000000000 --- a/internal-api/src/test/groovy/datadog/trace/api/propagation/W3CTraceParentTest.groovy +++ /dev/null @@ -1,32 +0,0 @@ -package datadog.trace.api.propagation - -import datadog.trace.api.DDTraceId -import datadog.trace.test.util.DDSpecification - -class W3CTraceParentTest extends DDSpecification { - - def "build produces correct format with isSampled=#isSampled"() { - when: - def result = W3CTraceParent.from(traceId, spanId, isSampled) - - then: - result == expected - - where: - traceId | spanId | isSampled | expected - DDTraceId.from(1) | 2 | true | "00-00000000000000000000000000000001-0000000000000002-01" - DDTraceId.from(1) | 2 | false | "00-00000000000000000000000000000001-0000000000000002-00" - DDTraceId.from(1) | 2 | true | "00-00000000000000000000000000000001-0000000000000002-01" - DDTraceId.fromHex("0af7651916cd43dd8448eb211c80319c") | 0x00f067aa0ba902b7L | true | "00-0af7651916cd43dd8448eb211c80319c-00f067aa0ba902b7-01" - DDTraceId.from(Long.MAX_VALUE) | Long.MAX_VALUE | true | "00-00000000000000007fffffffffffffff-7fffffffffffffff-01" - } - - def "build matches W3C traceparent format"() { - when: - def result = W3CTraceParent.from(DDTraceId.from(123456789L), 987654321L, true) - - then: - // W3C format: version-traceId(32 hex)-spanId(16 hex)-flags(2 hex) - result ==~ /00-[0-9a-f]{32}-[0-9a-f]{16}-(00|01)/ - } -} diff --git a/internal-api/src/test/groovy/datadog/trace/api/telemetry/WafMetricCollectorTest.groovy b/internal-api/src/test/groovy/datadog/trace/api/telemetry/WafMetricCollectorTest.groovy index 251bdb4baef..a05887d6668 100644 --- a/internal-api/src/test/groovy/datadog/trace/api/telemetry/WafMetricCollectorTest.groovy +++ b/internal-api/src/test/groovy/datadog/trace/api/telemetry/WafMetricCollectorTest.groovy @@ -37,7 +37,7 @@ class WafMetricCollectorTest extends DDSpecification { WafMetricCollector.get().wafUpdates('rules.3', false) WafMetricCollector.get().raspRuleEval(RuleType.SQL_INJECTION) WafMetricCollector.get().raspRuleEval(RuleType.SQL_INJECTION) - WafMetricCollector.get().raspRuleMatch(RuleType.SQL_INJECTION) + WafMetricCollector.get().raspRuleMatch(RuleType.SQL_INJECTION, false) WafMetricCollector.get().raspRuleEval(RuleType.SQL_INJECTION) WafMetricCollector.get().raspTimeout(RuleType.SQL_INJECTION) WafMetricCollector.get().raspErrorCode(RuleType.SHELL_INJECTION, DD_WAF_RUN_INTERNAL_ERROR) @@ -67,7 +67,7 @@ class WafMetricCollectorTest extends DDSpecification { def updateMetric2 = (WafMetricCollector.WafUpdatesRawMetric) metrics[2] updateMetric2.type == 'count' - updateMetric2.value == 2 + updateMetric2.value == 1 updateMetric2.namespace == 'appsec' updateMetric2.metricName == 'waf.updates' updateMetric2.tags.toSet() == ['waf_version:waf_ver1', 'event_rules_version:rules.3', 'success:false'].toSet() @@ -85,7 +85,7 @@ class WafMetricCollectorTest extends DDSpecification { raspRuleMatch.value == 1 raspRuleMatch.namespace == 'appsec' raspRuleMatch.metricName == 'rasp.rule.match' - raspRuleMatch.tags.toSet() == ['rule_type:sql_injection', 'waf_version:waf_ver1'].toSet() + raspRuleMatch.tags.toSet() == ['rule_type:sql_injection', 'waf_version:waf_ver1', 'block:false'].toSet() def raspTimeout = (WafMetricCollector.RaspTimeout) metrics[5] raspTimeout.type == 'count' @@ -317,7 +317,7 @@ class WafMetricCollectorTest extends DDSpecification { WafMetricCollector.get().wafInit('waf_ver1', 'rules.1', true) WafMetricCollector.get().raspRuleEval(ruleType) WafMetricCollector.get().raspRuleEval(ruleType) - WafMetricCollector.get().raspRuleMatch(ruleType) + WafMetricCollector.get().raspRuleMatch(ruleType, false) WafMetricCollector.get().raspRuleEval(ruleType) WafMetricCollector.get().raspTimeout(ruleType) WafMetricCollector.get().raspErrorCode(ruleType, DD_WAF_RUN_INTERNAL_ERROR) @@ -349,7 +349,8 @@ class WafMetricCollectorTest extends DDSpecification { 'rule_type:command_injection', 'rule_variant:' + ruleType.variant, 'waf_version:waf_ver1', - 'event_rules_version:rules.1' + 'event_rules_version:rules.1', + 'block:false' ].toSet() def raspTimeout = (WafMetricCollector.RaspTimeout) metrics[3] @@ -431,6 +432,7 @@ class WafMetricCollectorTest extends DDSpecification { void 'test waf request metrics'() { given: def collector = WafMetricCollector.get() + collector.wafInit('waf_ver1', 'rules.1', true) when: collector.wafRequest( @@ -440,7 +442,8 @@ class WafMetricCollectorTest extends DDSpecification { wafTimeout, blockFailure, rateLimited, - inputTruncated + inputTruncated, + requestExcluded ) then: @@ -448,10 +451,12 @@ class WafMetricCollectorTest extends DDSpecification { def metrics = collector.drain() def requestMetrics = metrics.findAll { it.metricName == 'waf.requests' } + requestMetrics.size() == 1 final metric = requestMetrics[0] metric.type == 'count' metric.metricName == 'waf.requests' metric.namespace == 'appsec' + metric.value == 1 metric.tags == [ "waf_version:waf_ver1", "event_rules_version:rules.1", @@ -461,11 +466,21 @@ class WafMetricCollectorTest extends DDSpecification { "waf_timeout:${wafTimeout}", "block_failure:${blockFailure}", "rate_limited:${rateLimited}", - "input_truncated:${inputTruncated}" + "input_truncated:${inputTruncated}", + "request_excluded:${requestExcluded ? 'full' : 'none'}" ] where: - [triggered, blocked, wafError, wafTimeout, blockFailure, rateLimited, inputTruncated] << allBooleanCombinations(7) + [ + triggered, + blocked, + wafError, + wafTimeout, + blockFailure, + rateLimited, + inputTruncated, + requestExcluded + ] << allBooleanCombinations(8) } void 'test waf input truncated metrics'() { @@ -585,6 +600,70 @@ class WafMetricCollectorTest extends DDSpecification { type << [MESSAGES, CONTENT] } + void 'test rasp rule match block tag'() { + given: + final collector = WafMetricCollector.get() + collector.wafInit('waf_ver1', 'rules.1', true) + + when: + collector.raspRuleMatch(ruleType, blocked) + + then: + collector.prepareMetrics() + final metrics = collector.drain() + final matchMetrics = metrics.findAll { it.metricName == 'rasp.rule.match' } + + matchMetrics.size() == 1 + final metric = matchMetrics[0] + metric.type == 'count' + metric.value == 1 + metric.namespace == 'appsec' + final expectedTags = ruleType.variant != null + ? [ + 'rule_type:' + ruleType.type, + 'rule_variant:' + ruleType.variant, + 'waf_version:waf_ver1', + 'event_rules_version:rules.1', + 'block:' + blocked + ].toSet() + : ['rule_type:' + ruleType.type, 'waf_version:waf_ver1', 'block:' + blocked].toSet() + metric.tags.toSet() == expectedTags + + where: + ruleType | blocked + RuleType.SQL_INJECTION | true + RuleType.SQL_INJECTION | false + RuleType.LFI | true + RuleType.LFI | false + RuleType.SSRF_REQUEST | true + RuleType.SSRF_REQUEST | false + RuleType.SSRF_RESPONSE | true + RuleType.SSRF_RESPONSE | false + RuleType.SHELL_INJECTION | true + RuleType.SHELL_INJECTION | false + RuleType.COMMAND_INJECTION | true + RuleType.COMMAND_INJECTION | false + } + + void 'test rasp rule match drains blocked and non-blocked as separate metrics'() { + given: + final collector = WafMetricCollector.get() + collector.wafInit('waf_ver1', 'rules.1', true) + + when: + collector.raspRuleMatch(RuleType.SQL_INJECTION, true) + collector.raspRuleMatch(RuleType.SQL_INJECTION, false) + + then: + collector.prepareMetrics() + final metrics = collector.drain() + final matchMetrics = metrics.findAll { it.metricName == 'rasp.rule.match' } + + matchMetrics.size() == 2 + matchMetrics.find { it.tags.contains('block:true') }?.value == 1 + matchMetrics.find { it.tags.contains('block:false') }?.value == 1 + } + /** * Helper method to generate all combinations of n boolean values. */ diff --git a/internal-api/src/test/groovy/datadog/trace/bootstrap/config/provider/OtelEnvironmentConfigSourceTest.groovy b/internal-api/src/test/groovy/datadog/trace/bootstrap/config/provider/OtelEnvironmentConfigSourceTest.groovy index 537345a2b23..977bba8f6c6 100644 --- a/internal-api/src/test/groovy/datadog/trace/bootstrap/config/provider/OtelEnvironmentConfigSourceTest.groovy +++ b/internal-api/src/test/groovy/datadog/trace/bootstrap/config/provider/OtelEnvironmentConfigSourceTest.groovy @@ -9,6 +9,7 @@ import static datadog.trace.api.config.GeneralConfig.RUNTIME_METRICS_ENABLED import static datadog.trace.api.config.GeneralConfig.SERVICE_NAME import static datadog.trace.api.config.GeneralConfig.TAGS import static datadog.trace.api.config.GeneralConfig.VERSION +import static datadog.trace.api.config.OtlpConfig.OTEL_TRACES_SPAN_METRICS_ENABLED import static datadog.trace.api.config.OtlpConfig.TRACE_OTEL_ENABLED import static datadog.trace.api.config.OtlpConfig.TRACE_OTEL_EXPORTER import static datadog.trace.api.config.TraceInstrumentationConfig.TRACE_ENABLED @@ -258,6 +259,48 @@ class OtelEnvironmentConfigSourceTest extends DDSpecification { source.get(TRACE_OTEL_EXPORTER) == 'otlp' } + def "otel traces span metrics enabled system property is mapped when otel is enabled"() { + setup: + injectSysConfig('dd.trace.otel.enabled', 'true', false) + injectSysConfig('otel.traces.span.metrics.enabled', value, false) + + when: + def source = new OtelEnvironmentConfigSource() + + then: + source.get(OTEL_TRACES_SPAN_METRICS_ENABLED) == value + + where: + value << ['true', 'false'] + } + + def "otel traces span metrics enabled environment variable is mapped when otel is enabled"() { + setup: + injectEnvConfig('DD_TRACE_OTEL_ENABLED', 'true', false) + injectEnvConfig('OTEL_TRACES_SPAN_METRICS_ENABLED', value, false) + + when: + def source = new OtelEnvironmentConfigSource() + + then: + source.get(OTEL_TRACES_SPAN_METRICS_ENABLED) == value + + where: + value << ['true', 'false'] + } + + def "otel traces span metrics enabled is not mapped when otel is disabled"() { + setup: + // Without dd.trace.otel.enabled, setupTraceOtelEnvironment() does not run. + injectSysConfig('otel.traces.span.metrics.enabled', 'true', false) + + when: + def source = new OtelEnvironmentConfigSource() + + then: + source.get(OTEL_TRACES_SPAN_METRICS_ENABLED) == null + } + def "otel traces exporter none still disables tracing"() { setup: injectEnvConfig('DD_TRACE_OTEL_ENABLED', 'true', false) diff --git a/internal-api/src/test/groovy/datadog/trace/bootstrap/instrumentation/api/ExtractedSpanTest.groovy b/internal-api/src/test/groovy/datadog/trace/bootstrap/instrumentation/api/ExtractedSpanTest.groovy index 7cdc25a22d9..81bda406fbc 100644 --- a/internal-api/src/test/groovy/datadog/trace/bootstrap/instrumentation/api/ExtractedSpanTest.groovy +++ b/internal-api/src/test/groovy/datadog/trace/bootstrap/instrumentation/api/ExtractedSpanTest.groovy @@ -16,7 +16,7 @@ class ExtractedSpanTest extends Specification { expect: extractedSpan.getTraceId() == traceId extractedSpan.getSpanId() == context.getSpanId() - extractedSpan.context() == context + extractedSpan.spanContext() == context extractedSpan.getTags() == tags extractedSpan.getTag('tag-1') == 'value-1' extractedSpan.getBaggageItem('baggage-2') == 'value-2' @@ -43,7 +43,7 @@ class ExtractedSpanTest extends Specification { expect: extractedSpan.getTraceId() == context.getTraceId() extractedSpan.getSpanId() == context.getSpanId() - extractedSpan.context() == context + extractedSpan.spanContext() == context extractedSpan.getTags().isEmpty() extractedSpan.getTag('tag-1') == null extractedSpan.getBaggageItem('baggage-2') == null diff --git a/internal-api/src/test/java/datadog/trace/api/ConfigCodeCoverageFlagsTest.java b/internal-api/src/test/java/datadog/trace/api/ConfigCodeCoverageFlagsTest.java new file mode 100644 index 00000000000..0bf89156176 --- /dev/null +++ b/internal-api/src/test/java/datadog/trace/api/ConfigCodeCoverageFlagsTest.java @@ -0,0 +1,98 @@ +package datadog.trace.api; + +import static datadog.trace.api.config.CiVisibilityConfig.CODE_COVERAGE_FLAGS; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.Logger; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.read.ListAppender; +import datadog.trace.test.junit.utils.config.WithConfigExtension; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.slf4j.LoggerFactory; + +@ExtendWith(WithConfigExtension.class) +class ConfigCodeCoverageFlagsTest { + + @Test + void defaultsToNoFlags() { + assertEquals(Collections.emptyList(), Config.get().getCodeCoverageFlags()); + } + + @Test + void removesWhitespaceAndEmptyFlagsWhilePreservingOrderAndDuplicates() { + Config config = configWithFlags(" type:unit-tests, ,jvm-21,, type:unit-tests "); + + assertEquals( + Arrays.asList("type:unit-tests", "jvm-21", "type:unit-tests"), + config.getCodeCoverageFlags()); + } + + @Test + void readsFlagsFromCanonicalEnvironmentVariable() { + WithConfigExtension.injectEnvConfig("DD_CODE_COVERAGE_FLAGS", "type:unit-tests,jvm-21", false); + + assertEquals(Arrays.asList("type:unit-tests", "jvm-21"), Config.get().getCodeCoverageFlags()); + } + + @Test + void producesNoFlagsForEmptyInput() { + assertEquals(Collections.emptyList(), configWithFlags(" , , ").getCodeCoverageFlags()); + } + + @Test + void acceptsExactlyThirtyTwoFlagsAndReturnsImmutableSnapshot() { + List expectedFlags = flags(32); + Config config = configWithFlags(String.join(",", expectedFlags)); + + assertEquals(expectedFlags, config.getCodeCoverageFlags()); + assertThrows( + UnsupportedOperationException.class, () -> config.getCodeCoverageFlags().add("extra")); + } + + @Test + void omitsAllFlagsWhenMoreThanThirtyTwoAreConfigured() { + Logger logger = (Logger) LoggerFactory.getLogger(Config.class); + ListAppender appender = new ListAppender<>(); + appender.start(); + logger.addAppender(appender); + + try { + Config config = configWithFlags(String.join(",", flags(33))); + + assertEquals(Collections.emptyList(), config.getCodeCoverageFlags()); + List overflowWarnings = new ArrayList<>(); + for (ILoggingEvent event : appender.list) { + if (event.getLevel() == Level.WARN + && event.getFormattedMessage().contains("code coverage report flags")) { + overflowWarnings.add(event); + } + } + assertEquals(1, overflowWarnings.size()); + assertTrue(overflowWarnings.get(0).getFormattedMessage().contains("33")); + assertTrue(overflowWarnings.get(0).getFormattedMessage().contains("32")); + } finally { + logger.detachAppender(appender); + } + } + + private static Config configWithFlags(String flags) { + WithConfigExtension.injectSysConfig(CODE_COVERAGE_FLAGS, flags); + return Config.get(); + } + + private static List flags(int count) { + List flags = new ArrayList<>(count); + for (int i = 0; i < count; i++) { + flags.add("flag-" + i); + } + return flags; + } +} diff --git a/internal-api/src/test/java/datadog/trace/api/ConfigSecureRandomTest.java b/internal-api/src/test/java/datadog/trace/api/ConfigSecureRandomTest.java new file mode 100644 index 00000000000..b780a8a581a --- /dev/null +++ b/internal-api/src/test/java/datadog/trace/api/ConfigSecureRandomTest.java @@ -0,0 +1,46 @@ +package datadog.trace.api; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; + +import datadog.trace.test.junit.utils.config.WithConfig; +import datadog.trace.test.junit.utils.config.WithConfigExtension; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; + +@ExtendWith(WithConfigExtension.class) +class ConfigSecureRandomTest { + + @Test + void defaultStrategyIsRandom() { + assertNotEquals("SRandom", Config.get().getIdGenerationStrategy().getClass().getSimpleName()); + } + + @Test + void snapStartEnablesSecureRandom() { + WithConfigExtension.injectEnvConfig("AWS_LAMBDA_INITIALIZATION_TYPE", "snap-start", false); + + assertEquals("SRandom", Config.get().getIdGenerationStrategy().getClass().getSimpleName()); + } + + @Test + void microvmImageArnEnablesSecureRandom() { + WithConfigExtension.injectEnvConfig( + "AWS_LAMBDA_MICROVM_IMAGE_ARN", "arn:aws:lambda:us-east-1::runtime:microvm", false); + + assertEquals("SRandom", Config.get().getIdGenerationStrategy().getClass().getSimpleName()); + } + + @Test + void emptyMicrovmImageArnDoesNotEnableSecureRandom() { + WithConfigExtension.injectEnvConfig("AWS_LAMBDA_MICROVM_IMAGE_ARN", "", false); + + assertNotEquals("SRandom", Config.get().getIdGenerationStrategy().getClass().getSimpleName()); + } + + @Test + @WithConfig(key = "trace.secure-random", value = "true") + void configPropertyEnablesSecureRandom() { + assertEquals("SRandom", Config.get().getIdGenerationStrategy().getClass().getSimpleName()); + } +} diff --git a/internal-api/src/test/java/datadog/trace/api/EntryReadingHelperTest.java b/internal-api/src/test/java/datadog/trace/api/EntryReadingHelperTest.java new file mode 100644 index 00000000000..c47f15e1b3e --- /dev/null +++ b/internal-api/src/test/java/datadog/trace/api/EntryReadingHelperTest.java @@ -0,0 +1,139 @@ +package datadog.trace.api; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.AbstractMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +class EntryReadingHelperTest { + + @Test + void setTagValueExposesIntValue() { + EntryReadingHelper helper = new EntryReadingHelper(); + helper.set("my.tag", 42); + + assertEquals("my.tag", helper.tag()); + assertEquals(42, helper.intValue()); + assertEquals(42L, helper.longValue()); + assertEquals(TagMap.EntryReader.INT, helper.type()); + assertTrue(helper.isNumber()); + assertTrue(helper.isNumericPrimitive()); + assertFalse(helper.isObject()); + assertTrue(helper.is(TagMap.EntryReader.INT)); + } + + @Test + void setTagValueExposesLongValue() { + EntryReadingHelper helper = new EntryReadingHelper(); + helper.set("id", 123456789L); + + assertEquals(123456789L, helper.longValue()); + assertEquals(TagMap.EntryReader.LONG, helper.type()); + assertTrue(helper.isNumber()); + assertTrue(helper.isNumericPrimitive()); + } + + @Test + void setTagValueExposesBooleanValue() { + EntryReadingHelper helper = new EntryReadingHelper(); + helper.set("flag", true); + + assertTrue(helper.booleanValue()); + assertEquals(TagMap.EntryReader.BOOLEAN, helper.type()); + assertFalse(helper.isNumber()); + assertFalse(helper.isObject()); + } + + @Test + void setTagValueExposesFloatValue() { + EntryReadingHelper helper = new EntryReadingHelper(); + helper.set("rate", 1.5f); + + assertEquals(1.5f, helper.floatValue()); + assertEquals(TagMap.EntryReader.FLOAT, helper.type()); + assertTrue(helper.isNumericPrimitive()); + } + + @Test + void setTagValueExposesDoubleValue() { + EntryReadingHelper helper = new EntryReadingHelper(); + helper.set("pi", 3.14); + + assertEquals(3.14, helper.doubleValue()); + assertEquals(TagMap.EntryReader.DOUBLE, helper.type()); + assertTrue(helper.isNumericPrimitive()); + } + + @Test + void setTagValueExposesStringAsObject() { + EntryReadingHelper helper = new EntryReadingHelper(); + helper.set("name", "foo"); + + assertEquals("foo", helper.stringValue()); + assertEquals("foo", helper.objectValue()); + assertEquals(TagMap.EntryReader.OBJECT, helper.type()); + assertTrue(helper.isObject()); + assertFalse(helper.isNumber()); + assertFalse(helper.isNumericPrimitive()); + } + + @Test + void setTagValueCreatesEntry() { + EntryReadingHelper helper = new EntryReadingHelper(); + helper.set("tag", "value"); + + TagMap.Entry entry = helper.entry(); + assertNotNull(entry); + assertEquals("tag", entry.tag()); + assertEquals("value", entry.objectValue()); + } + + @Test + void mapEntryFallsBackToNewEntryWhenSetWithTagValue() { + EntryReadingHelper helper = new EntryReadingHelper(); + helper.set("tag", "value"); + + Map.Entry mapEntry = helper.mapEntry(); + assertEquals("tag", mapEntry.getKey()); + assertEquals("value", mapEntry.getValue()); + } + + @Test + void setMapEntryExposesReadMethods() { + EntryReadingHelper helper = new EntryReadingHelper(); + Map.Entry original = new AbstractMap.SimpleEntry<>("key", "hello"); + helper.set(original); + + assertEquals("key", helper.tag()); + assertEquals("hello", helper.stringValue()); + assertEquals("hello", helper.objectValue()); + assertEquals(TagMap.EntryReader.OBJECT, helper.type()); + assertTrue(helper.isObject()); + assertFalse(helper.isNumber()); + } + + @Test + void mapEntryReturnsSameInstanceWhenSetWithMapEntry() { + EntryReadingHelper helper = new EntryReadingHelper(); + Map.Entry original = new AbstractMap.SimpleEntry<>("key", "value"); + helper.set(original); + + assertSame(original, helper.mapEntry()); + } + + @Test + void setMapEntryCreatesEntry() { + EntryReadingHelper helper = new EntryReadingHelper(); + helper.set(new AbstractMap.SimpleEntry<>("k", 99)); + + TagMap.Entry entry = helper.entry(); + assertNotNull(entry); + assertEquals("k", entry.tag()); + assertEquals(99, entry.objectValue()); + } +} diff --git a/internal-api/src/test/java/datadog/trace/api/FunctionsBase64Test.java b/internal-api/src/test/java/datadog/trace/api/FunctionsBase64Test.java new file mode 100644 index 00000000000..7330e9a5538 --- /dev/null +++ b/internal-api/src/test/java/datadog/trace/api/FunctionsBase64Test.java @@ -0,0 +1,43 @@ +package datadog.trace.api; + +import static datadog.trace.api.Functions.BASE64_DECODE; +import static datadog.trace.api.Functions.UTF8_BYTES_TO_STRING; +import static java.nio.charset.StandardCharsets.UTF_8; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; + +import java.util.Base64; +import org.junit.jupiter.api.Test; + +class FunctionsBase64Test { + + @Test + void utf8BytesToStringConvertsBytes() { + byte[] bytes = "hello".getBytes(UTF_8); + assertEquals("hello", UTF8_BYTES_TO_STRING.apply(bytes)); + } + + @Test + void base64DecodeDecodesValidInput() { + String original = "x-datadog-trace-id"; + byte[] encoded = Base64.getEncoder().encode(original.getBytes(UTF_8)); + assertEquals(original, BASE64_DECODE.apply(encoded)); + } + + @Test + void base64DecodeReturnsNullForInvalidBase64() { + assertNull(BASE64_DECODE.apply("not-valid-base64!@#".getBytes(UTF_8))); + } + + @Test + void base64DecodeReturnsNullForUrlSafeChars() { + // URL-safe Base64 uses '-' and '_' which the standard decoder rejects + assertNull(BASE64_DECODE.apply("abc-def_ghi".getBytes(UTF_8))); + } + + @Test + void base64DecodeIsNotNull() { + assertNotNull(BASE64_DECODE); + } +} diff --git a/internal-api/src/test/java/datadog/trace/api/TagMapBucketGroupTest.java b/internal-api/src/test/java/datadog/trace/api/TagMapBucketGroupTest.java index cecadd446b1..477a5ae58d8 100644 --- a/internal-api/src/test/java/datadog/trace/api/TagMapBucketGroupTest.java +++ b/internal-api/src/test/java/datadog/trace/api/TagMapBucketGroupTest.java @@ -19,8 +19,8 @@ public void newGroup() { int firstHash = firstEntry.hash(); int secondHash = secondEntry.hash(); - OptimizedTagMap.BucketGroup group = - new OptimizedTagMap.BucketGroup( + TagMap.BucketGroup group = + new TagMap.BucketGroup( firstHash, firstEntry, secondHash, secondEntry); @@ -45,8 +45,8 @@ public void _insert() { int firstHash = firstEntry.hash(); int secondHash = secondEntry.hash(); - OptimizedTagMap.BucketGroup group = - new OptimizedTagMap.BucketGroup(firstHash, firstEntry, secondHash, secondEntry); + TagMap.BucketGroup group = + new TagMap.BucketGroup(firstHash, firstEntry, secondHash, secondEntry); TagMap.Entry newEntry = TagMap.Entry.newAnyEntry("baz", "lorem ipsum"); int newHash = newEntry.hash(); @@ -82,8 +82,7 @@ public void _replace() { int origHash = origEntry.hash(); int otherHash = otherEntry.hash(); - OptimizedTagMap.BucketGroup group = - new OptimizedTagMap.BucketGroup(origHash, origEntry, otherHash, otherEntry); + TagMap.BucketGroup group = new TagMap.BucketGroup(origHash, origEntry, otherHash, otherEntry); assertContainsDirectly(origEntry, group); assertContainsDirectly(otherEntry, group); @@ -112,8 +111,8 @@ public void _remove() { int firstHash = firstEntry.hash(); int secondHash = secondEntry.hash(); - OptimizedTagMap.BucketGroup group = - new OptimizedTagMap.BucketGroup( + TagMap.BucketGroup group = + new TagMap.BucketGroup( firstHash, firstEntry, secondHash, secondEntry); @@ -137,9 +136,9 @@ public void _remove() { @Test public void groupChaining() { int startingIndex = 10; - OptimizedTagMap.BucketGroup firstGroup = fullGroup(startingIndex); + TagMap.BucketGroup firstGroup = fullGroup(startingIndex); - for (int offset = 0; offset < OptimizedTagMap.BucketGroup.LEN; ++offset) { + for (int offset = 0; offset < TagMap.BucketGroup.LEN; ++offset) { assertChainContainsTag(tag(startingIndex + offset), firstGroup); } @@ -151,79 +150,78 @@ public void groupChaining() { assertFalse(firstGroup._insert(newHash, newEntry)); assertDoesntContainDirectly(newEntry, firstGroup); - OptimizedTagMap.BucketGroup newHeadGroup = - new OptimizedTagMap.BucketGroup(newHash, newEntry, firstGroup); + TagMap.BucketGroup newHeadGroup = new TagMap.BucketGroup(newHash, newEntry, firstGroup); assertContainsDirectly(newEntry, newHeadGroup); assertSame(firstGroup, newHeadGroup.prev); assertChainContainsTag("new", newHeadGroup); - for (int offset = 0; offset < OptimizedTagMap.BucketGroup.LEN; ++offset) { + for (int offset = 0; offset < TagMap.BucketGroup.LEN; ++offset) { assertChainContainsTag(tag(startingIndex + offset), newHeadGroup); } } @Test public void removeInChain() { - OptimizedTagMap.BucketGroup firstGroup = fullGroup(10); - OptimizedTagMap.BucketGroup headGroup = fullGroup(20, firstGroup); + TagMap.BucketGroup firstGroup = fullGroup(10); + TagMap.BucketGroup headGroup = fullGroup(20, firstGroup); - for (int offset = 0; offset < OptimizedTagMap.BucketGroup.LEN; ++offset) { + for (int offset = 0; offset < TagMap.BucketGroup.LEN; ++offset) { assertChainContainsTag(tag(10, offset), headGroup); assertChainContainsTag(tag(20, offset), headGroup); } - assertEquals(OptimizedTagMap.BucketGroup.LEN * 2, headGroup.sizeInChain()); + assertEquals(TagMap.BucketGroup.LEN * 2, headGroup.sizeInChain()); String firstRemovedTag = tag(10, 1); int firstRemovedHash = TagMap.Entry._hash(firstRemovedTag); - OptimizedTagMap.BucketGroup firstContainingGroup = + TagMap.BucketGroup firstContainingGroup = headGroup.findContainingGroupInChain(firstRemovedHash, firstRemovedTag); assertSame(firstContainingGroup, firstGroup); assertNotNull(firstContainingGroup._remove(firstRemovedHash, firstRemovedTag)); assertChainDoesntContainTag(firstRemovedTag, headGroup); - assertEquals(OptimizedTagMap.BucketGroup.LEN * 2 - 1, headGroup.sizeInChain()); + assertEquals(TagMap.BucketGroup.LEN * 2 - 1, headGroup.sizeInChain()); String secondRemovedTag = tag(20, 2); int secondRemovedHash = TagMap.Entry._hash(secondRemovedTag); - OptimizedTagMap.BucketGroup secondContainingGroup = + TagMap.BucketGroup secondContainingGroup = headGroup.findContainingGroupInChain(secondRemovedHash, secondRemovedTag); assertSame(secondContainingGroup, headGroup); assertNotNull(secondContainingGroup._remove(secondRemovedHash, secondRemovedTag)); assertChainDoesntContainTag(secondRemovedTag, headGroup); - assertEquals(OptimizedTagMap.BucketGroup.LEN * 2 - 2, headGroup.sizeInChain()); + assertEquals(TagMap.BucketGroup.LEN * 2 - 2, headGroup.sizeInChain()); } @Test public void replaceInChain() { - OptimizedTagMap.BucketGroup firstGroup = fullGroup(10); - OptimizedTagMap.BucketGroup headGroup = fullGroup(20, firstGroup); + TagMap.BucketGroup firstGroup = fullGroup(10); + TagMap.BucketGroup headGroup = fullGroup(20, firstGroup); - assertEquals(OptimizedTagMap.BucketGroup.LEN * 2, headGroup.sizeInChain()); + assertEquals(TagMap.BucketGroup.LEN * 2, headGroup.sizeInChain()); TagMap.Entry firstReplacementEntry = TagMap.Entry.newObjectEntry(tag(10, 1), "replaced"); assertNotNull(headGroup.replaceInChain(firstReplacementEntry.hash(), firstReplacementEntry)); - assertEquals(OptimizedTagMap.BucketGroup.LEN * 2, headGroup.sizeInChain()); + assertEquals(TagMap.BucketGroup.LEN * 2, headGroup.sizeInChain()); TagMap.Entry secondReplacementEntry = TagMap.Entry.newObjectEntry(tag(20, 2), "replaced"); assertNotNull(headGroup.replaceInChain(secondReplacementEntry.hash(), secondReplacementEntry)); - assertEquals(OptimizedTagMap.BucketGroup.LEN * 2, headGroup.sizeInChain()); + assertEquals(TagMap.BucketGroup.LEN * 2, headGroup.sizeInChain()); } @Test public void insertInChain() { // set-up a chain with some gaps in it - OptimizedTagMap.BucketGroup firstGroup = fullGroup(10); - OptimizedTagMap.BucketGroup headGroup = fullGroup(20, firstGroup); + TagMap.BucketGroup firstGroup = fullGroup(10); + TagMap.BucketGroup headGroup = fullGroup(20, firstGroup); - assertEquals(OptimizedTagMap.BucketGroup.LEN * 2, headGroup.sizeInChain()); + assertEquals(TagMap.BucketGroup.LEN * 2, headGroup.sizeInChain()); String firstHoleTag = tag(10, 1); int firstHoleHash = TagMap.Entry._hash(firstHoleTag); @@ -233,7 +231,7 @@ public void insertInChain() { int secondHoleHash = TagMap.Entry._hash(secondHoleTag); headGroup._remove(secondHoleHash, secondHoleTag); - assertEquals(OptimizedTagMap.BucketGroup.LEN * 2 - 2, headGroup.sizeInChain()); + assertEquals(TagMap.BucketGroup.LEN * 2 - 2, headGroup.sizeInChain()); String firstNewTag = "new-tag-0"; TagMap.Entry firstNewEntry = TagMap.Entry.newObjectEntry(firstNewTag, "new"); @@ -256,18 +254,18 @@ public void insertInChain() { assertFalse(headGroup.insertInChain(thirdNewHash, thirdNewEntry)); assertChainDoesntContainTag(thirdNewTag, headGroup); - assertEquals(OptimizedTagMap.BucketGroup.LEN * 2, headGroup.sizeInChain()); + assertEquals(TagMap.BucketGroup.LEN * 2, headGroup.sizeInChain()); } @Test public void cloneChain() { - OptimizedTagMap.BucketGroup firstGroup = fullGroup(10); - OptimizedTagMap.BucketGroup secondGroup = fullGroup(20, firstGroup); - OptimizedTagMap.BucketGroup headGroup = fullGroup(30, secondGroup); + TagMap.BucketGroup firstGroup = fullGroup(10); + TagMap.BucketGroup secondGroup = fullGroup(20, firstGroup); + TagMap.BucketGroup headGroup = fullGroup(30, secondGroup); - OptimizedTagMap.BucketGroup clonedHeadGroup = headGroup.cloneChain(); - OptimizedTagMap.BucketGroup clonedSecondGroup = clonedHeadGroup.prev; - OptimizedTagMap.BucketGroup clonedFirstGroup = clonedSecondGroup.prev; + TagMap.BucketGroup clonedHeadGroup = headGroup.cloneChain(); + TagMap.BucketGroup clonedSecondGroup = clonedHeadGroup.prev; + TagMap.BucketGroup clonedFirstGroup = clonedSecondGroup.prev; assertGroupContentsStrictEquals(headGroup, clonedHeadGroup); assertGroupContentsStrictEquals(secondGroup, clonedSecondGroup); @@ -276,11 +274,11 @@ public void cloneChain() { @Test public void removeGroupInChain() { - OptimizedTagMap.BucketGroup tailGroup = fullGroup(10); - OptimizedTagMap.BucketGroup secondGroup = fullGroup(20, tailGroup); - OptimizedTagMap.BucketGroup thirdGroup = fullGroup(30, secondGroup); - OptimizedTagMap.BucketGroup fourthGroup = fullGroup(40, thirdGroup); - OptimizedTagMap.BucketGroup headGroup = fullGroup(50, fourthGroup); + TagMap.BucketGroup tailGroup = fullGroup(10); + TagMap.BucketGroup secondGroup = fullGroup(20, tailGroup); + TagMap.BucketGroup thirdGroup = fullGroup(30, secondGroup); + TagMap.BucketGroup fourthGroup = fullGroup(40, thirdGroup); + TagMap.BucketGroup headGroup = fullGroup(50, fourthGroup); assertChain(headGroup, fourthGroup, thirdGroup, secondGroup, tailGroup); // need to test group removal - at head, middle, and tail of the chain @@ -298,15 +296,14 @@ public void removeGroupInChain() { assertChain(fourthGroup, secondGroup); } - static final OptimizedTagMap.BucketGroup fullGroup(int startingIndex) { + static final TagMap.BucketGroup fullGroup(int startingIndex) { TagMap.Entry firstEntry = TagMap.Entry.newObjectEntry(tag(startingIndex), value(startingIndex)); TagMap.Entry secondEntry = TagMap.Entry.newObjectEntry(tag(startingIndex + 1), value(startingIndex + 1)); - OptimizedTagMap.BucketGroup group = - new OptimizedTagMap.BucketGroup( - firstEntry.hash(), firstEntry, secondEntry.hash(), secondEntry); - for (int offset = 2; offset < OptimizedTagMap.BucketGroup.LEN; ++offset) { + TagMap.BucketGroup group = + new TagMap.BucketGroup(firstEntry.hash(), firstEntry, secondEntry.hash(), secondEntry); + for (int offset = 2; offset < TagMap.BucketGroup.LEN; ++offset) { TagMap.Entry anotherEntry = TagMap.Entry.newObjectEntry(tag(startingIndex + offset), value(startingIndex + offset)); group._insert(anotherEntry.hash(), anotherEntry); @@ -314,9 +311,8 @@ static final OptimizedTagMap.BucketGroup fullGroup(int startingIndex) { return group; } - static final OptimizedTagMap.BucketGroup fullGroup( - int startingIndex, OptimizedTagMap.BucketGroup prev) { - OptimizedTagMap.BucketGroup group = fullGroup(startingIndex); + static final TagMap.BucketGroup fullGroup(int startingIndex, TagMap.BucketGroup prev) { + TagMap.BucketGroup group = fullGroup(startingIndex); group.prev = prev; return group; } @@ -333,7 +329,7 @@ static final String value(int i) { return "value-" + i; } - static void assertContainsDirectly(TagMap.Entry entry, OptimizedTagMap.BucketGroup group) { + static void assertContainsDirectly(TagMap.Entry entry, TagMap.BucketGroup group) { int hash = entry.hash(); String tag = entry.tag(); @@ -343,32 +339,32 @@ static void assertContainsDirectly(TagMap.Entry entry, OptimizedTagMap.BucketGro assertSame(group, group.findContainingGroupInChain(hash, tag)); } - static void assertDoesntContainDirectly(TagMap.Entry entry, OptimizedTagMap.BucketGroup group) { - for (int i = 0; i < OptimizedTagMap.BucketGroup.LEN; ++i) { + static void assertDoesntContainDirectly(TagMap.Entry entry, TagMap.BucketGroup group) { + for (int i = 0; i < TagMap.BucketGroup.LEN; ++i) { assertNotSame(entry, group._entryAt(i)); } } - static void assertChainContainsTag(String tag, OptimizedTagMap.BucketGroup group) { + static void assertChainContainsTag(String tag, TagMap.BucketGroup group) { int hash = TagMap.Entry._hash(tag); assertNotNull(group.findInChain(hash, tag)); } - static void assertChainDoesntContainTag(String tag, OptimizedTagMap.BucketGroup group) { + static void assertChainDoesntContainTag(String tag, TagMap.BucketGroup group) { int hash = TagMap.Entry._hash(tag); assertNull(group.findInChain(hash, tag)); } static void assertGroupContentsStrictEquals( - OptimizedTagMap.BucketGroup expected, OptimizedTagMap.BucketGroup actual) { - for (int i = 0; i < OptimizedTagMap.BucketGroup.LEN; ++i) { + TagMap.BucketGroup expected, TagMap.BucketGroup actual) { + for (int i = 0; i < TagMap.BucketGroup.LEN; ++i) { assertEquals(expected._hashAt(i), actual._hashAt(i)); assertSame(expected._entryAt(i), actual._entryAt(i)); } } - static void assertChain(OptimizedTagMap.BucketGroup... chain) { - OptimizedTagMap.BucketGroup cur; + static void assertChain(TagMap.BucketGroup... chain) { + TagMap.BucketGroup cur; int index; for (cur = chain[0], index = 0; cur != null; cur = cur.prev, ++index) { assertSame(chain[index], cur); diff --git a/internal-api/src/test/java/datadog/trace/api/TagMapFuzzTest.java b/internal-api/src/test/java/datadog/trace/api/TagMapFuzzTest.java index 48254ae9bd1..685dc1d9cdf 100644 --- a/internal-api/src/test/java/datadog/trace/api/TagMapFuzzTest.java +++ b/internal-api/src/test/java/datadog/trace/api/TagMapFuzzTest.java @@ -30,8 +30,8 @@ void testMerge() { TestCase mapACase = generateTest(); TestCase mapBCase = generateTest(); - OptimizedTagMap tagMapA = test(mapACase); - OptimizedTagMap tagMapB = test(mapBCase); + TagMap tagMapA = test(mapACase); + TagMap tagMapB = test(mapBCase); HashMap hashMapA = new HashMap<>(tagMapA); HashMap hashMapB = new HashMap<>(tagMapB); @@ -858,7 +858,7 @@ void priorFailingCase2() { put("key-41", "values--904162962")); Map expected = makeMap(testCase); - OptimizedTagMap actual = makeTagMap(testCase); + TagMap actual = makeTagMap(testCase); MapAction failingAction = remove("key-127"); failingAction.applyToExpectedMap(expected); @@ -889,27 +889,27 @@ public static final Map makeMap(List actions) { return map; } - public static final OptimizedTagMap makeTagMap(TestCase testCase) { + public static final TagMap makeTagMap(TestCase testCase) { return makeTagMap(testCase.actions); } - public static final OptimizedTagMap makeTagMap(MapAction... actions) { + public static final TagMap makeTagMap(MapAction... actions) { return makeTagMap(Arrays.asList(actions)); } - public static final OptimizedTagMap makeTagMap(List actions) { - OptimizedTagMap map = new OptimizedTagMap(); + public static final TagMap makeTagMap(List actions) { + TagMap map = new TagMap(); for (MapAction action : actions) { action.applyToTestMap(map); } return map; } - public static final OptimizedTagMap test(TestCase test) { + public static final TagMap test(TestCase test) { List actions = test.actions(); Map hashMap = new HashMap<>(); - OptimizedTagMap tagMap = new OptimizedTagMap(); + TagMap tagMap = new TagMap(); int actionIndex = 0; try { @@ -1014,7 +1014,7 @@ public static final MapAction getAndRemove(String key) { return new GetAndRemove(key); } - static final void assertMapEquals(Map expected, OptimizedTagMap actual) { + static final void assertMapEquals(Map expected, TagMap actual) { // checks entries in both directions to make sure there's full intersection for (Map.Entry expectedEntry : expected.entrySet()) { @@ -1100,7 +1100,7 @@ static final Map mapOf(String... keysAndValues) { } static final TagMap tagMapOf(String... keysAndValues) { - OptimizedTagMap map = new OptimizedTagMap(); + TagMap map = new TagMap(); for (int i = 0; i < keysAndValues.length; i += 2) { String key = keysAndValues[i]; String value = keysAndValues[i + 1]; diff --git a/internal-api/src/test/java/datadog/trace/api/TagMapLedgerTest.java b/internal-api/src/test/java/datadog/trace/api/TagMapLedgerTest.java index bcf2fb52d6d..ddd7dccf2b4 100644 --- a/internal-api/src/test/java/datadog/trace/api/TagMapLedgerTest.java +++ b/internal-api/src/test/java/datadog/trace/api/TagMapLedgerTest.java @@ -9,8 +9,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.EnumSource; public class TagMapLedgerTest { static final int SIZE = 32; @@ -74,26 +72,6 @@ public void buildMutable() { map.set(key(1000), value(1000)); } - @ParameterizedTest - @EnumSource(TagMapType.class) - public void buildMutable(TagMapType mapType) { - TagMap.Ledger ledger = TagMap.ledger(); - for (int i = 0; i < SIZE; ++i) { - ledger.set(key(i), value(i)); - } - - assertEquals(SIZE, ledger.estimateSize()); - - TagMap map = ledger.build(mapType.factory); - for (int i = 0; i < SIZE; ++i) { - assertEquals(value(i), map.getString(key(i))); - } - assertEquals(SIZE, map.size()); - - // just proving that the map is mutable - map.set(key(1000), value(1000)); - } - @Test public void buildImmutable() { TagMap.Ledger ledger = TagMap.ledger(); @@ -112,25 +90,6 @@ public void buildImmutable() { assertFrozen(map); } - @ParameterizedTest - @EnumSource(TagMapType.class) - public void buildImmutable(TagMapType mapType) { - TagMap.Ledger ledger = TagMap.ledger(); - for (int i = 0; i < SIZE; ++i) { - ledger.set(key(i), value(i)); - } - - assertEquals(SIZE, ledger.estimateSize()); - - TagMap map = ledger.buildImmutable(mapType.factory); - for (int i = 0; i < SIZE; ++i) { - assertEquals(value(i), map.getString(key(i))); - } - assertEquals(SIZE, map.size()); - - assertFrozen(map); - } - @Test public void build_empty() { TagMap.Ledger ledger = TagMap.ledger(); @@ -138,14 +97,6 @@ public void build_empty() { assertNotSame(TagMap.EMPTY, ledger.build()); } - @ParameterizedTest - @EnumSource(TagMapType.class) - public void build_empty(TagMapType mapType) { - TagMap.Ledger ledger = TagMap.ledger(); - assertTrue(ledger.isDefinitelyEmpty()); - assertNotSame(mapType.empty(), ledger.build(mapType.factory)); - } - @Test public void buildImmutable_empty() { TagMap.Ledger ledger = TagMap.ledger(); diff --git a/internal-api/src/test/java/datadog/trace/api/TagMapNullToleranceTest.java b/internal-api/src/test/java/datadog/trace/api/TagMapNullToleranceTest.java new file mode 100644 index 00000000000..b8764472847 --- /dev/null +++ b/internal-api/src/test/java/datadog/trace/api/TagMapNullToleranceTest.java @@ -0,0 +1,66 @@ +package datadog.trace.api; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; + +/** + * Pins the Entry-pathway null-tolerance contract: {@code create(...)} returns null for a null or + * empty value, and the {@code Entry} sinks ({@code set(Entry)} / {@code getAndSet(Entry)}) treat + * null as a no-op -- so a null/empty value flows through as "no tag" without any caller guarding. + */ +class TagMapNullToleranceTest { + + @Test + void createReturnsNullForNullOrEmptyValue() { + // CharSequence overload: null or empty -> null + assertNull(TagMap.Entry.create("k", (CharSequence) null)); + assertNull(TagMap.Entry.create("k", "")); + + // Object overload: null -> null, and an empty String typed as Object -> null (runtime check, + // so the convention holds regardless of the static type at the call site) + assertNull(TagMap.Entry.create("k", (Object) null)); + assertNull(TagMap.Entry.create("k", (Object) "")); + + // Non-empty values still produce an entry, whatever the static type + assertNotNull(TagMap.Entry.create("k", "v")); + assertNotNull(TagMap.Entry.create("k", (Object) "v")); + // Non-CharSequence Object has no notion of "empty" -> always an entry + assertNotNull(TagMap.Entry.create("k", (Object) Integer.valueOf(0))); + } + + @Test + void getAndSetToleratesNullEntry() { + TagMap map = TagMap.create(); + assertNull(map.getAndSet((TagMap.Entry) null), "null entry is a no-op returning null"); + assertEquals(0, map.size(), "no tag added"); + } + + @Test + void setToleratesNullReader() { + TagMap map = TagMap.create(); + map.set((TagMap.EntryReader) null); // must not throw + assertEquals(0, map.size(), "no tag added"); + } + + @Test + void nullOrEmptyFlowsThroughTheEntryPathwayAsNoTag() { + TagMap map = TagMap.create(); + + // The seamless case: create(...) -> set(Entry) with a null/empty value, no caller guard. + map.set(TagMap.Entry.create("empty", "")); + map.set(TagMap.Entry.create("emptyObj", (Object) "")); + map.set(TagMap.Entry.create("nul", (CharSequence) null)); + assertEquals(0, map.size(), "null/empty values leave no tags behind"); + assertFalse(map.containsKey("empty")); + + // A real value still lands. + map.set(TagMap.Entry.create("present", "v")); + assertEquals(1, map.size()); + assertTrue(map.containsKey("present")); + } +} diff --git a/internal-api/src/test/java/datadog/trace/api/TagMapScenario.java b/internal-api/src/test/java/datadog/trace/api/TagMapScenario.java index 20b9b927d1b..1c07b31c563 100644 --- a/internal-api/src/test/java/datadog/trace/api/TagMapScenario.java +++ b/internal-api/src/test/java/datadog/trace/api/TagMapScenario.java @@ -1,18 +1,15 @@ package datadog.trace.api; public enum TagMapScenario { - LEGACY_EMPTY(LegacyTagMapFactory.INSTANCE, 0), - OPTIMIZED_EMPTY(OptimizedTagMapFactory.INSTANCE, 0), - OPTIMIZED_XSMALL(OptimizedTagMapFactory.INSTANCE, 5), - OPTIMIZED_SMALL(OptimizedTagMapFactory.INSTANCE, 10), - OPTIMIZED_MEDIUM(OptimizedTagMapFactory.INSTANCE, 25), - OPTIMIZED_LARGE(OptimizedTagMapFactory.INSTANCE, 125); + OPTIMIZED_EMPTY(0), + OPTIMIZED_XSMALL(5), + OPTIMIZED_SMALL(10), + OPTIMIZED_MEDIUM(25), + OPTIMIZED_LARGE(125); - final TagMapFactory factory; final int size; - TagMapScenario(TagMapFactory factory, int size) { - this.factory = factory; + TagMapScenario(int size) { this.size = size; } @@ -21,7 +18,7 @@ public final int size() { } public final TagMap create() { - TagMap map = factory.create(); + TagMap map = TagMap.create(); for (int i = 0; i < this.size; ++i) { map.put("filler-key-" + i, "filler-value-" + i); } diff --git a/internal-api/src/test/java/datadog/trace/api/TagMapTest.java b/internal-api/src/test/java/datadog/trace/api/TagMapTest.java index 365ccff23d8..da179553f56 100644 --- a/internal-api/src/test/java/datadog/trace/api/TagMapTest.java +++ b/internal-api/src/test/java/datadog/trace/api/TagMapTest.java @@ -15,6 +15,7 @@ import java.util.Map; import java.util.Set; import java.util.concurrent.ThreadLocalRandom; +import java.util.stream.Collectors; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.EnumSource; @@ -79,21 +80,6 @@ public void fromMapImmutable_nonEmptyMap() { assertTrue(tagMap.isFrozen()); } - @ParameterizedTest - @ValueSource(booleans = {false, true}) - public void optimizedFactory(boolean optimized) { - TagMapFactory factory = TagMapFactory.createFactory(optimized); - - TagMap unsizedMap = factory.create(); - assertEquals(optimized, unsizedMap.isOptimized()); - - TagMap sizedMap = factory.create(32); - assertEquals(optimized, sizedMap.isOptimized()); - - TagMap emptyMap = factory.empty(); - assertEquals(optimized, emptyMap.isOptimized()); - } - @ParameterizedTest @EnumSource(TagMapScenario.class) public void map_put(TagMapScenario scenario) { @@ -145,9 +131,8 @@ public void booleanEntry(TagMapScenario scenario) { checkIntegrity(map); } - @ParameterizedTest - @EnumSource(TagMapType.class) - public void numericZeroToBooleanCoercion(TagMapType mapType) { + @Test + public void numericZeroToBooleanCoercion() { TagMap map = TagMap.ledger() .set("int", 0) @@ -158,7 +143,7 @@ public void numericZeroToBooleanCoercion(TagMapType mapType) { .set("floatObj", Float.valueOf(0F)) .set("double", 0D) .set("doubleObj", Double.valueOf(0D)) - .build(mapType.factory); + .build(); assertBoolean(false, map, "int"); assertBoolean(false, map, "intObj"); @@ -172,9 +157,8 @@ public void numericZeroToBooleanCoercion(TagMapType mapType) { checkIntegrity(map); } - @ParameterizedTest - @EnumSource(TagMapType.class) - public void numericNonZeroToBooleanCoercion(TagMapType mapType) { + @Test + public void numericNonZeroToBooleanCoercion() { TagMap map = TagMap.ledger() .set("int", 1) @@ -185,7 +169,7 @@ public void numericNonZeroToBooleanCoercion(TagMapType mapType) { .set("floatObj", Float.valueOf(1F)) .set("double", 1D) .set("doubleObj", Double.valueOf(1D)) - .build(mapType.factory); + .build(); assertBoolean(true, map, "int"); assertBoolean(true, map, "intObj"); @@ -199,15 +183,14 @@ public void numericNonZeroToBooleanCoercion(TagMapType mapType) { checkIntegrity(map); } - @ParameterizedTest - @EnumSource(TagMapType.class) - public void objectToBooleanCoercion(TagMapType mapType) { + @Test + public void objectToBooleanCoercion() { TagMap map = TagMap.ledger() .set("obj", new Object()) .set("trueStr", "true") .set("falseStr", "false") - .build(mapType.factory); + .build(); assertBoolean(true, map, "obj"); assertBoolean(true, map, "trueStr"); @@ -216,10 +199,9 @@ public void objectToBooleanCoercion(TagMapType mapType) { checkIntegrity(map); } - @ParameterizedTest - @EnumSource(TagMapType.class) - public void booleanToNumericCoercion_true(TagMapType mapType) { - TagMap map = TagMap.ledger().set("true", true).build(mapType.factory); + @Test + public void booleanToNumericCoercion_true() { + TagMap map = TagMap.ledger().set("true", true).build(); assertInt(1, map, "true"); assertLong(1L, map, "true"); @@ -229,10 +211,9 @@ public void booleanToNumericCoercion_true(TagMapType mapType) { checkIntegrity(map); } - @ParameterizedTest - @EnumSource(TagMapType.class) - public void booleanToNumericCoercion_false(TagMapType mapType) { - TagMap map = TagMap.ledger().set("false", false).build(mapType.factory); + @Test + public void booleanToNumericCoercion_false() { + TagMap map = TagMap.ledger().set("false", false).build(); assertInt(0, map, "false"); assertLong(0L, map, "false"); @@ -242,10 +223,9 @@ public void booleanToNumericCoercion_false(TagMapType mapType) { checkIntegrity(map); } - @ParameterizedTest - @EnumSource(TagMapType.class) - public void emptyToPrimitiveCoercion(TagMapType mapType) { - TagMap map = mapType.empty(); + @Test + public void emptyToPrimitiveCoercion() { + TagMap map = TagMap.EMPTY; // DQH - assert helpers also check getOrDefault, so they don't work here assertEquals(false, map.getBoolean("dne")); @@ -396,10 +376,9 @@ public void doubleEntry(TagMapScenario scenario) { checkIntegrity(map); } - @ParameterizedTest - @EnumSource(TagMapType.class) - public void empty(TagMapType mapType) { - TagMap empty = mapType.empty(); + @Test + public void empty() { + TagMap empty = TagMap.EMPTY; assertFrozen(empty); assertNull(empty.getEntry("foo")); @@ -409,13 +388,12 @@ public void empty(TagMapType mapType) { checkIntegrity(empty); } - @ParameterizedTest - @EnumSource(TagMapTypePair.class) - public void putAll_empty(TagMapTypePair mapTypePair) { + @Test + public void putAll_empty() { // TagMap.EMPTY breaks the rules and uses a different size bucket array // This test is just to verify that the common use of putAll still works with EMPTY - TagMap newMap = mapTypePair.firstType.create(); - newMap.putAll(mapTypePair.secondType.empty()); + TagMap newMap = TagMap.create(); + newMap.putAll(TagMap.EMPTY); assertSize(0, newMap); assertEmpty(newMap); @@ -541,10 +519,9 @@ public void freeze(TagMapScenario scenario) { checkIntegrity(map); } - @ParameterizedTest - @EnumSource(TagMapType.class) - public void emptyMap(TagMapType mapType) { - TagMap map = mapType.empty(); + @Test + public void emptyMap() { + TagMap map = TagMap.EMPTY; assertSize(0, map); assertEmpty(map); @@ -593,11 +570,10 @@ public void copyMany(TagMapScenario scenario) { checkIntegrity(copy); } - @ParameterizedTest - @EnumSource(TagMapType.class) - public void immutableCopy(TagMapType mapType) { + @Test + public void immutableCopy() { int size = randomSize(); - TagMap orig = createTagMap(mapType, size); + TagMap orig = createTagMap(size); TagMap immutableCopy = orig.immutableCopy(); orig.clear(); // doing this to make sure that copied isn't modified @@ -612,11 +588,10 @@ public void immutableCopy(TagMapType mapType) { checkIntegrity(immutableCopy); } - @ParameterizedTest - @EnumSource(TagMapType.class) - public void replaceALot(TagMapType mapType) { + @Test + public void replaceALot() { int size = randomSize(); - TagMap map = createTagMap(mapType, size); + TagMap map = createTagMap(size); for (int i = 0; i < size; ++i) { int index = ThreadLocalRandom.current().nextInt(size); @@ -628,32 +603,28 @@ public void replaceALot(TagMapType mapType) { checkIntegrity(map); } - @ParameterizedTest - @EnumSource(TagMapTypePair.class) - public void shareEntry(TagMapTypePair mapTypePair) { - TagMap orig = mapTypePair.firstType.create(); + @Test + public void shareEntry() { + TagMap orig = TagMap.create(); orig.set("foo", "bar"); - TagMap dest = mapTypePair.secondType.create(); + TagMap dest = TagMap.create(); dest.set(orig.getEntry("foo")); assertEquals(orig.getEntry("foo"), dest.getEntry("foo")); - if (mapTypePair == TagMapTypePair.BOTH_OPTIMIZED) { - assertSame(orig.getEntry("foo"), dest.getEntry("foo")); - } + assertSame(orig.getEntry("foo"), dest.getEntry("foo")); checkIntegrity(orig); checkIntegrity(dest); } - @ParameterizedTest - @EnumSource(TagMapTypePair.class) - public void putAll_clobberAll(TagMapTypePair mapTypePair) { + @Test + public void putAll_clobberAll() { int size = randomSize(); - TagMap orig = createTagMap(mapTypePair.firstType, size); + TagMap orig = createTagMap(size); assertSize(size, orig); - TagMap dest = mapTypePair.secondType.create(); + TagMap dest = TagMap.create(); for (int i = size - 1; i >= 0; --i) { dest.set(key(i), altValue(i)); } @@ -689,14 +660,13 @@ public void putAll_cloberAll(TagMapScenario scenario) { checkIntegrity(dest); } - @ParameterizedTest - @EnumSource(TagMapTypePair.class) - public void putAll_clobberAndExtras(TagMapTypePair mapTypePair) { + @Test + public void putAll_clobberAndExtras() { int size = randomSize(); - TagMap orig = createTagMap(mapTypePair.firstType, size); + TagMap orig = createTagMap(size); assertSize(size, orig); - TagMap dest = mapTypePair.secondType.create(); + TagMap dest = TagMap.create(); for (int i = size / 2 - 1; i >= 0; --i) { dest.set(key(i), altValue(i)); } @@ -714,11 +684,10 @@ public void putAll_clobberAndExtras(TagMapTypePair mapTypePair) { checkIntegrity(dest); } - @ParameterizedTest - @EnumSource(TagMapType.class) - public void removeMany(TagMapType mapType) { + @Test + public void removeMany() { int size = randomSize(); - TagMap map = createTagMap(mapType, size); + TagMap map = createTagMap(size); for (int i = 0; i < size; ++i) { assertEntry(key(i), value(i), map); @@ -740,11 +709,10 @@ public void removeMany(TagMapType mapType) { checkIntegrity(map); } - @ParameterizedTest - @EnumSource(TagMapType.class) - public void fillMap(TagMapType mapType) { + @Test + public void fillMap() { int size = randomSize(); - TagMap map = mapType.create(); + TagMap map = TagMap.create(); for (int i = 0; i < size; ++i) { map.set(key(i), i); } @@ -760,11 +728,10 @@ public void fillMap(TagMapType mapType) { checkIntegrity(map); } - @ParameterizedTest - @EnumSource(TagMapType.class) - public void fillStringMap(TagMapType mapType) { + @Test + public void fillStringMap() { int size = randomSize(); - TagMap map = mapType.create(); + TagMap map = TagMap.create(); for (int i = 0; i < size; ++i) { map.set(key(i), i); } @@ -780,11 +747,10 @@ public void fillStringMap(TagMapType mapType) { checkIntegrity(map); } - @ParameterizedTest - @EnumSource(TagMapType.class) - public void iterator(TagMapType mapType) { + @Test + public void iterator() { int size = randomSize(); - TagMap map = createTagMap(mapType, size); + TagMap map = createTagMap(size); Set keys = new HashSet<>(); for (TagMap.EntryReader entry : map) { @@ -803,11 +769,10 @@ public void iterator(TagMapType mapType) { checkIntegrity(map); } - @ParameterizedTest - @EnumSource(TagMapType.class) - public void forEachConsumer(TagMapType mapType) { + @Test + public void forEachConsumer() { int size = randomSize(); - TagMap map = createTagMap(mapType, size); + TagMap map = createTagMap(size); Set keys = new HashSet<>(size); map.forEach((entry) -> keys.add(entry.tag())); @@ -823,11 +788,10 @@ public void forEachConsumer(TagMapType mapType) { checkIntegrity(map); } - @ParameterizedTest - @EnumSource(TagMapType.class) - public void forEachBiConsumer(TagMapType mapType) { + @Test + public void forEachBiConsumer() { int size = randomSize(); - TagMap map = createTagMap(mapType, size); + TagMap map = createTagMap(size); Set keys = new HashSet<>(size); map.forEach(keys, (k, entry) -> k.add(entry.tag())); @@ -843,11 +807,10 @@ public void forEachBiConsumer(TagMapType mapType) { checkIntegrity(map); } - @ParameterizedTest - @EnumSource(TagMapType.class) - public void forEachTriConsumer(TagMapType mapType) { + @Test + public void forEachTriConsumer() { int size = randomSize(); - TagMap map = createTagMap(mapType, size); + TagMap map = createTagMap(size); Set keys = new HashSet<>(size); map.forEach(keys, "hi", (k, msg, entry) -> keys.add(entry.tag())); @@ -863,11 +826,10 @@ public void forEachTriConsumer(TagMapType mapType) { checkIntegrity(map); } - @ParameterizedTest - @EnumSource(TagMapType.class) - public void entrySet(TagMapType mapType) { + @Test + public void entrySet() { int size = randomSize(); - TagMap map = createTagMap(mapType, size); + TagMap map = createTagMap(size); Set> actualEntries = map.entrySet(); assertEquals(size, actualEntries.size()); @@ -882,11 +844,10 @@ public void entrySet(TagMapType mapType) { checkIntegrity(map); } - @ParameterizedTest - @EnumSource(TagMapType.class) - public void keySet(TagMapType mapType) { + @Test + public void keySet() { int size = randomSize(); - TagMap map = createTagMap(mapType, size); + TagMap map = createTagMap(size); Set actualKeys = map.keySet(); assertEquals(size, actualKeys.size()); @@ -901,11 +862,10 @@ public void keySet(TagMapType mapType) { checkIntegrity(map); } - @ParameterizedTest - @EnumSource(TagMapType.class) - public void values(TagMapType mapType) { + @Test + public void values() { int size = randomSize(); - TagMap map = createTagMap(mapType, size); + TagMap map = createTagMap(size); Collection actualValues = map.values(); assertEquals(size, actualValues.size()); @@ -920,11 +880,10 @@ public void values(TagMapType mapType) { checkIntegrity(map); } - @ParameterizedTest - @EnumSource(TagMapType.class) - public void _toString(TagMapType mapType) { + @Test + public void _toString() { int size = 4; - TagMap map = createTagMap(mapType, size); + TagMap map = createTagMap(size); String str = map.toString(); @@ -933,10 +892,59 @@ public void _toString(TagMapType mapType) { } } + @Test + public void stream() { + int size = randomSize(); + TagMap map = createTagMap(size); + + Set keys = map.stream().map(TagMap.EntryReader::tag).collect(Collectors.toSet()); + + assertEquals(size, keys.size()); + for (int i = 0; i < size; ++i) { + assertTrue(keys.contains(key(i))); + } + } + + @Test + public void compute() { + TagMap map = TagMap.create(); + map.set("key", "original"); + + map.compute("key", (k, v) -> "updated"); + assertEquals("updated", map.get("key")); + + map.compute("new-key", (k, v) -> "created"); + assertEquals("created", map.get("new-key")); + } + + @Test + public void computeIfAbsent() { + TagMap map = TagMap.create(); + map.set("key", "existing"); + + map.computeIfAbsent("key", k -> "ignored"); + assertEquals("existing", map.get("key")); + + map.computeIfAbsent("new-key", k -> "added"); + assertEquals("added", map.get("new-key")); + } + + @Test + public void computeIfPresent() { + TagMap map = TagMap.create(); + map.set("key", "original"); + + map.computeIfPresent("key", (k, v) -> "updated"); + assertEquals("updated", map.get("key")); + + map.computeIfPresent("missing", (k, v) -> "never"); + assertNull(map.get("missing")); + } + @ParameterizedTest @ValueSource(ints = {0, 5, 25, 125}) public void _toInternalString(int size) { - OptimizedTagMap tagMap = new OptimizedTagMap(); + TagMap tagMap = new TagMap(); fillMap(tagMap, size); String str = tagMap.toInternalString(); @@ -950,12 +958,12 @@ static int randomSize() { return ThreadLocalRandom.current().nextInt(16, MANY_SIZE); } - static TagMap createTagMap(TagMapType mapType) { - return createTagMap(mapType, randomSize()); + static TagMap createTagMap() { + return createTagMap(randomSize()); } - static TagMap createTagMap(TagMapType mapType, int size) { - TagMap map = mapType.create(); + static TagMap createTagMap(int size) { + TagMap map = TagMap.create(); fillMap(map, size); return map; } @@ -1056,9 +1064,7 @@ static final void assertEntry(String key, String value, TagMap map) { } static final void assertSize(int size, TagMap map) { - if (map instanceof OptimizedTagMap) { - assertEquals(size, ((OptimizedTagMap) map).computeSize()); - } + assertEquals(size, map.computeSize()); assertEquals(size, map.size()); assertEquals(size, count(map)); @@ -1086,16 +1092,12 @@ static void assertEmptiness(boolean expectEmpty, TagMap map) { } static void assertNotEmpty(TagMap map) { - if (map instanceof OptimizedTagMap) { - assertFalse(((OptimizedTagMap) map).checkIfEmpty()); - } + assertFalse(map.checkIfEmpty()); assertFalse(map.isEmpty()); } static void assertEmpty(TagMap map) { - if (map instanceof OptimizedTagMap) { - assertTrue(((OptimizedTagMap) map).checkIfEmpty()); - } + assertTrue(map.checkIfEmpty()); assertTrue(map.isEmpty()); } @@ -1120,9 +1122,6 @@ static void assertFrozen(Runnable runnable) { } static void checkIntegrity(TagMap map) { - if (map instanceof OptimizedTagMap) { - OptimizedTagMap optMap = (OptimizedTagMap) map; - optMap.checkIntegrity(); - } + map.checkIntegrity(); } } diff --git a/internal-api/src/test/java/datadog/trace/api/TagMapType.java b/internal-api/src/test/java/datadog/trace/api/TagMapType.java deleted file mode 100644 index 512473d3439..00000000000 --- a/internal-api/src/test/java/datadog/trace/api/TagMapType.java +++ /dev/null @@ -1,20 +0,0 @@ -package datadog.trace.api; - -public enum TagMapType { - OPTIMIZED(OptimizedTagMapFactory.INSTANCE), - LEGACY(LegacyTagMapFactory.INSTANCE); - - final TagMapFactory factory; - - TagMapType(TagMapFactory factory) { - this.factory = factory; - } - - public final TagMap create() { - return factory.create(); - } - - public final TagMap empty() { - return factory.empty(); - } -} diff --git a/internal-api/src/test/java/datadog/trace/api/TagMapTypePair.java b/internal-api/src/test/java/datadog/trace/api/TagMapTypePair.java deleted file mode 100644 index 1b82df3d3a0..00000000000 --- a/internal-api/src/test/java/datadog/trace/api/TagMapTypePair.java +++ /dev/null @@ -1,16 +0,0 @@ -package datadog.trace.api; - -public enum TagMapTypePair { - BOTH_OPTIMIZED(TagMapType.OPTIMIZED, TagMapType.OPTIMIZED), - BOTH_LEGACY(TagMapType.LEGACY, TagMapType.LEGACY), - OPTIMIZED_LEGACY(TagMapType.OPTIMIZED, TagMapType.LEGACY), - LEGACY_OPTIMIZED(TagMapType.LEGACY, TagMapType.OPTIMIZED); - - public final TagMapType firstType; - public final TagMapType secondType; - - TagMapTypePair(TagMapType firstType, TagMapType secondType) { - this.firstType = firstType; - this.secondType = secondType; - } -} diff --git a/internal-api/src/test/java/datadog/trace/api/WellKnownTagsTest.java b/internal-api/src/test/java/datadog/trace/api/WellKnownTagsTest.java new file mode 100644 index 00000000000..f164ab7006d --- /dev/null +++ b/internal-api/src/test/java/datadog/trace/api/WellKnownTagsTest.java @@ -0,0 +1,32 @@ +package datadog.trace.api; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +class WellKnownTagsTest { + + @Test + void wellKnownTagsDoesNotModifyInputs() { + WellKnownTags wellKnownTags = + new WellKnownTags("runtimeid", "hostname", "env", "service", "version", "language"); + + assertEquals("runtimeid", wellKnownTags.getRuntimeId().toString()); + assertEquals("hostname", wellKnownTags.getHostname().toString()); + assertEquals("env", wellKnownTags.getEnv().toString()); + assertEquals("service", wellKnownTags.getService().toString()); + assertEquals("version", wellKnownTags.getVersion().toString()); + assertEquals("language", wellKnownTags.getLanguage().toString()); + } + + @Test + void toStringIncludesAllFields() { + WellKnownTags wellKnownTags = + new WellKnownTags("runtimeid", "hostname", "env", "service", "version", "language"); + + assertEquals( + "WellKnownTags{runtimeId=runtimeid, hostname=hostname, env=env," + + " service=service, version=version, language=language}", + wellKnownTags.toString()); + } +} diff --git a/internal-api/src/test/java/datadog/trace/api/civisibility/execution/ExecutionAggregationTest.java b/internal-api/src/test/java/datadog/trace/api/civisibility/execution/ExecutionAggregationTest.java new file mode 100644 index 00000000000..a97badb0712 --- /dev/null +++ b/internal-api/src/test/java/datadog/trace/api/civisibility/execution/ExecutionAggregationTest.java @@ -0,0 +1,54 @@ +package datadog.trace.api.civisibility.execution; + +import static datadog.trace.api.civisibility.execution.ExecutionAggregation.MIXED; +import static datadog.trace.api.civisibility.execution.ExecutionAggregation.NONE; +import static datadog.trace.api.civisibility.execution.ExecutionAggregation.ONLY_FAILED; +import static datadog.trace.api.civisibility.execution.ExecutionAggregation.ONLY_PASSED; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.Test; + +class ExecutionAggregationTest { + + @Test + void noneAfterFailIsOnlyFailed() { + assertEquals(ONLY_FAILED, NONE.withExecution(TestStatus.fail)); + } + + @Test + void noneAfterPassIsOnlyPassed() { + assertEquals(ONLY_PASSED, NONE.withExecution(TestStatus.pass)); + } + + @Test + void noneAfterSkipIsOnlyPassed() { + assertEquals(ONLY_PASSED, NONE.withExecution(TestStatus.skip)); + } + + @Test + void onlyFailedAfterFailStaysOnlyFailed() { + assertEquals(ONLY_FAILED, ONLY_FAILED.withExecution(TestStatus.fail)); + } + + @Test + void onlyFailedAfterPassIsMixed() { + assertEquals(MIXED, ONLY_FAILED.withExecution(TestStatus.pass)); + } + + @Test + void onlyPassedAfterPassStaysOnlyPassed() { + assertEquals(ONLY_PASSED, ONLY_PASSED.withExecution(TestStatus.pass)); + } + + @Test + void onlyPassedAfterFailIsMixed() { + assertEquals(MIXED, ONLY_PASSED.withExecution(TestStatus.fail)); + } + + @Test + void mixedAfterAnyStatusStaysMixed() { + assertEquals(MIXED, MIXED.withExecution(TestStatus.pass)); + assertEquals(MIXED, MIXED.withExecution(TestStatus.fail)); + assertEquals(MIXED, MIXED.withExecution(TestStatus.skip)); + } +} diff --git a/internal-api/src/test/java/datadog/trace/api/gateway/InferredProxySpanTests.java b/internal-api/src/test/java/datadog/trace/api/gateway/InferredProxySpanTests.java index 69645fa6ffb..309e8616080 100644 --- a/internal-api/src/test/java/datadog/trace/api/gateway/InferredProxySpanTests.java +++ b/internal-api/src/test/java/datadog/trace/api/gateway/InferredProxySpanTests.java @@ -5,14 +5,26 @@ import static datadog.trace.api.gateway.InferredProxySpan.PROXY_SYSTEM; import static datadog.trace.api.gateway.InferredProxySpan.fromContext; import static datadog.trace.api.gateway.InferredProxySpan.fromHeaders; +import static datadog.trace.bootstrap.instrumentation.api.ErrorPriorities.HTTP_SERVER_DECORATOR; +import static datadog.trace.bootstrap.instrumentation.api.Tags.HTTP_REQUEST_HEADERS_X_DATADOG_ENDPOINT_SCAN; +import static datadog.trace.bootstrap.instrumentation.api.Tags.HTTP_REQUEST_HEADERS_X_DATADOG_SECURITY_TEST; +import static datadog.trace.bootstrap.instrumentation.api.Tags.HTTP_USER_AGENT; import static java.util.Collections.emptyMap; +import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.junit.jupiter.params.provider.Arguments.of; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; import datadog.context.Context; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import java.lang.reflect.Field; import java.util.HashMap; import java.util.Map; import java.util.stream.Stream; @@ -229,7 +241,10 @@ void testSupportedProxySystems(String proxySystem, String expectedSpanName) { } static Stream supportedProxySystems() { - return Stream.of(of("aws-apigateway", "aws.apigateway"), of("aws-httpapi", "aws.httpapi")); + return Stream.of( + of("aws-apigateway", "aws.apigateway"), + of("aws-httpapi", "aws.httpapi"), + of("azure-apim", "azure.apim")); } @Test @@ -569,6 +584,40 @@ void testFinishWithAllHeaders() { inferredProxySpan.finish(); } + @Test + @DisplayName("optional API Gateway metadata should exercise ARN tag computation") + void testStartWithOptionalApiGatewayMetadata() { + Map headers = new HashMap<>(); + headers.put(PROXY_START_TIME_MS, "12345"); + headers.put(PROXY_SYSTEM, "aws-apigateway"); + headers.put(InferredProxySpan.PROXY_HTTP_METHOD, "GET"); + headers.put(InferredProxySpan.PROXY_PATH, "/api/users/123"); + headers.put(InferredProxySpan.PROXY_API_ID, "api-id"); + headers.put(InferredProxySpan.PROXY_REGION, "us-east-1"); + headers.put(InferredProxySpan.PROXY_ACCOUNT_ID, "123456789012"); + + InferredProxySpan inferredProxySpan = fromHeaders(headers); + assertNotNull(inferredProxySpan.start(null)); + + inferredProxySpan.finish(); + } + + @Test + @DisplayName("computeArn should support known proxy systems and reject unknown input") + void testComputeArn() { + InferredProxySpan inferredProxySpan = fromHeaders(null); + + assertEquals( + "arn:aws:apigateway:us-east-1::/restapis/api-id", + inferredProxySpan.computeArn("aws-apigateway", "us-east-1", "api-id")); + assertEquals( + "arn:aws:apigateway:us-east-1::/apis/api-id", + inferredProxySpan.computeArn("aws-httpapi", "us-east-1", "api-id")); + assertNull(inferredProxySpan.computeArn("unknown", "us-east-1", "api-id")); + assertNull(inferredProxySpan.computeArn("aws-apigateway", null, "api-id")); + assertNull(inferredProxySpan.computeArn("aws-apigateway", "us-east-1", null)); + } + @Test @DisplayName("Multiple InferredProxySpan instances should finish independently") void testMultipleProxySpansFinishIndependently() { @@ -596,4 +645,82 @@ void testMultipleProxySpansFinishIndependently() { proxySpan1.finish(); proxySpan2.finish(); } + + @Test + @DisplayName( + "finish forwards the Datadog scan/test markers from the service-entry span to the inferred span") + void testFinishForwardsSecurityTestingHeaders() throws Exception { + Map headers = new HashMap<>(); + headers.put(PROXY_START_TIME_MS, "12345"); + headers.put(PROXY_SYSTEM, "aws-apigateway"); + InferredProxySpan inferredProxySpan = fromHeaders(headers); + + // Replace the real (noop) inferred span with a mock we can verify against. Drive through + // the public finish() API so the test stays valid if the internal copy-helper is renamed. + AgentSpan mockInferredSpan = mock(AgentSpan.class); + // Keep this reflected field name in sync with InferredProxySpan.span. + Field spanField = InferredProxySpan.class.getDeclaredField("span"); + spanField.setAccessible(true); + spanField.set(inferredProxySpan, mockInferredSpan); + + AgentSpan serviceEntrySpan = mock(AgentSpan.class); + when(serviceEntrySpan.getTag(HTTP_REQUEST_HEADERS_X_DATADOG_ENDPOINT_SCAN)) + .thenReturn("scan-uuid"); + when(serviceEntrySpan.getTag(HTTP_REQUEST_HEADERS_X_DATADOG_SECURITY_TEST)) + .thenReturn("test-uuid"); + inferredProxySpan.registerServiceEntrySpan(serviceEntrySpan); + + inferredProxySpan.finish(serviceEntrySpan); + + verify(mockInferredSpan).setTag(HTTP_REQUEST_HEADERS_X_DATADOG_ENDPOINT_SCAN, "scan-uuid"); + verify(mockInferredSpan).setTag(HTTP_REQUEST_HEADERS_X_DATADOG_SECURITY_TEST, "test-uuid"); + } + + @Test + @DisplayName("finish should phase child calls and publish after service-entry completion") + void testFinishPhasesChildCallAndPublishesOnServiceEntry() throws Exception { + InferredProxySpan inferredProxySpan = fromHeaders(validHeaders()); + + AgentSpan inferredSpan = mock(AgentSpan.class); + inferredProxySpan.span = inferredSpan; + + AgentSpan childSpan = mock(AgentSpan.class); + when(childSpan.getTag("_dd.appsec.enabled")).thenReturn(Boolean.TRUE); + when(childSpan.getTag("_dd.appsec.json")).thenReturn("{\"triggers\":[]}"); + + AgentSpan serviceEntrySpan = mock(AgentSpan.class); + when(serviceEntrySpan.getHttpStatusCode()).thenReturn((short) 503); + when(serviceEntrySpan.getTag(HTTP_USER_AGENT)).thenReturn("curl/8.0"); + when(serviceEntrySpan.getTag(HTTP_REQUEST_HEADERS_X_DATADOG_ENDPOINT_SCAN)) + .thenReturn("scan-uuid"); + when(serviceEntrySpan.getTag(HTTP_REQUEST_HEADERS_X_DATADOG_SECURITY_TEST)) + .thenReturn("test-uuid"); + + inferredProxySpan.registerServiceEntrySpan(serviceEntrySpan); + + inferredProxySpan.finish(childSpan); + inferredProxySpan.finish(childSpan); + verify(inferredSpan).setMetric("_dd.appsec.enabled", 1); + verify(inferredSpan).setTag("_dd.appsec.json", "{\"triggers\":[]}"); + verify(inferredSpan, times(1)).phasedFinish(); + verify(inferredSpan, never()).finish(); + verify(inferredSpan, never()).publish(); + + inferredProxySpan.finish(serviceEntrySpan); + + verify(inferredSpan).setHttpStatusCode(503); + verify(inferredSpan).setError(true, HTTP_SERVER_DECORATOR); + verify(inferredSpan).setTag(HTTP_USER_AGENT, "curl/8.0"); + verify(inferredSpan).setTag(HTTP_REQUEST_HEADERS_X_DATADOG_ENDPOINT_SCAN, "scan-uuid"); + verify(inferredSpan).setTag(HTTP_REQUEST_HEADERS_X_DATADOG_SECURITY_TEST, "test-uuid"); + verify(inferredSpan).publish(); + verify(inferredSpan, never()).finish(); + } + + private static Map validHeaders() { + Map headers = new HashMap<>(); + headers.put(PROXY_START_TIME_MS, "12345"); + headers.put(PROXY_SYSTEM, "aws-apigateway"); + return headers; + } } diff --git a/internal-api/src/test/java/datadog/trace/api/gateway/InstrumentationGatewayTest.java b/internal-api/src/test/java/datadog/trace/api/gateway/InstrumentationGatewayTest.java index 4767a0051b9..145b3b117f6 100644 --- a/internal-api/src/test/java/datadog/trace/api/gateway/InstrumentationGatewayTest.java +++ b/internal-api/src/test/java/datadog/trace/api/gateway/InstrumentationGatewayTest.java @@ -17,6 +17,7 @@ import datadog.trace.bootstrap.instrumentation.api.AgentTracer; import datadog.trace.bootstrap.instrumentation.api.ClientIpAddressData; import java.util.Collections; +import java.util.Map; import java.util.function.BiConsumer; import java.util.function.BiFunction; import java.util.function.Function; @@ -169,6 +170,26 @@ public void testRequestBlockingAction() { assertEquals("https://www.google.com/", rba.getExtraHeaders().get("Location")); } + @Test + public void blockResponseFunctionDefaultMethodDelegatesRequestBlockingAction() { + TraceSegment segment = TraceSegment.NoOp.INSTANCE; + Flow.Action.RequestBlockingAction action = + new Flow.Action.RequestBlockingAction( + 451, + BlockingContentType.JSON, + Collections.singletonMap("x-blocked", "true"), + "security-response-id"); + + CapturingBlockResponseFunction blockResponseFunction = new CapturingBlockResponseFunction(); + + assertTrue(blockResponseFunction.tryCommitBlockingResponse(segment, action)); + assertSame(segment, blockResponseFunction.segment); + assertEquals(451, blockResponseFunction.statusCode); + assertEquals(BlockingContentType.JSON, blockResponseFunction.templateType); + assertEquals("true", blockResponseFunction.extraHeaders.get("x-blocked")); + assertEquals("security-response-id", blockResponseFunction.securityResponseId); + } + @Test public void testNormalCalls() { // check that we pass through normal calls @@ -564,6 +585,29 @@ public Flow apply(RequestContext requestContext, T t, T t2) { } } + private static final class CapturingBlockResponseFunction implements BlockResponseFunction { + private TraceSegment segment; + private int statusCode; + private BlockingContentType templateType; + private Map extraHeaders; + private String securityResponseId; + + @Override + public boolean tryCommitBlockingResponse( + TraceSegment segment, + int statusCode, + BlockingContentType templateType, + Map extraHeaders, + String securityResponseId) { + this.segment = segment; + this.statusCode = statusCode; + this.templateType = templateType; + this.extraHeaders = extraHeaders; + this.securityResponseId = securityResponseId; + return true; + } + } + private static class Throwback implements Supplier>, BiConsumer, diff --git a/internal-api/src/test/java/datadog/trace/api/llmobs/LLMObsContextTest.java b/internal-api/src/test/java/datadog/trace/api/llmobs/LLMObsContextTest.java new file mode 100644 index 00000000000..8ca9c5e035e --- /dev/null +++ b/internal-api/src/test/java/datadog/trace/api/llmobs/LLMObsContextTest.java @@ -0,0 +1,102 @@ +package datadog.trace.api.llmobs; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.mockito.Mockito.mock; + +import datadog.context.ContextScope; +import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext; +import org.junit.jupiter.api.Test; + +class LLMObsContextTest { + @Test + void rootSpanIdIsUndefined() { + assertEquals("undefined", LLMObsContext.ROOT_SPAN_ID); + } + + @Test + void currentReturnsNullWhenNoContextAttached() { + assertNull(LLMObsContext.current()); + } + + @Test + void currentSessionIdReturnsNullWhenNoContextAttached() { + assertNull(LLMObsContext.currentSessionId()); + } + + @Test + void attachStoresSpanContext() { + AgentSpanContext ctx = mock(AgentSpanContext.class); + try (ContextScope scope = LLMObsContext.attach(ctx)) { + assertEquals(ctx, LLMObsContext.current()); + } + assertNull(LLMObsContext.current()); + } + + @Test + void attachWithoutSessionIdLeavesSessionIdNull() { + AgentSpanContext ctx = mock(AgentSpanContext.class); + try (ContextScope scope = LLMObsContext.attach(ctx)) { + assertNull(LLMObsContext.currentSessionId()); + } + } + + @Test + void attachWithSessionIdStoresBothContextAndSessionId() { + AgentSpanContext ctx = mock(AgentSpanContext.class); + try (ContextScope scope = LLMObsContext.attach(ctx, "session-123")) { + assertEquals(ctx, LLMObsContext.current()); + assertEquals("session-123", LLMObsContext.currentSessionId()); + } + assertNull(LLMObsContext.current()); + assertNull(LLMObsContext.currentSessionId()); + } + + @Test + void attachWithNullSessionIdIgnoresSessionId() { + AgentSpanContext ctx = mock(AgentSpanContext.class); + try (ContextScope scope = LLMObsContext.attach(ctx, null)) { + assertEquals(ctx, LLMObsContext.current()); + assertNull(LLMObsContext.currentSessionId()); + } + } + + @Test + void attachWithEmptySessionIdIgnoresSessionId() { + AgentSpanContext ctx = mock(AgentSpanContext.class); + try (ContextScope scope = LLMObsContext.attach(ctx, "")) { + assertEquals(ctx, LLMObsContext.current()); + assertNull(LLMObsContext.currentSessionId()); + } + } + + @Test + void nestedScopesRestoreParentContextOnClose() { + AgentSpanContext outer = mock(AgentSpanContext.class); + AgentSpanContext inner = mock(AgentSpanContext.class); + try (ContextScope outerScope = LLMObsContext.attach(outer, "outer-session")) { + assertEquals(outer, LLMObsContext.current()); + assertEquals("outer-session", LLMObsContext.currentSessionId()); + try (ContextScope innerScope = LLMObsContext.attach(inner, "inner-session")) { + assertEquals(inner, LLMObsContext.current()); + assertEquals("inner-session", LLMObsContext.currentSessionId()); + } + assertEquals(outer, LLMObsContext.current()); + assertEquals("outer-session", LLMObsContext.currentSessionId()); + } + assertNull(LLMObsContext.current()); + assertNull(LLMObsContext.currentSessionId()); + } + + @Test + void childScopeInheritsParentSessionId() { + AgentSpanContext parent = mock(AgentSpanContext.class); + AgentSpanContext child = mock(AgentSpanContext.class); + try (ContextScope parentScope = LLMObsContext.attach(parent, "inherited-session")) { + try (ContextScope childScope = LLMObsContext.attach(child)) { + assertEquals(child, LLMObsContext.current()); + assertEquals("inherited-session", LLMObsContext.currentSessionId()); + } + } + } +} diff --git a/internal-api/src/test/java/datadog/trace/api/propagation/W3CTraceParentTest.java b/internal-api/src/test/java/datadog/trace/api/propagation/W3CTraceParentTest.java new file mode 100644 index 00000000000..6a600cc9244 --- /dev/null +++ b/internal-api/src/test/java/datadog/trace/api/propagation/W3CTraceParentTest.java @@ -0,0 +1,91 @@ +package datadog.trace.api.propagation; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.params.provider.Arguments.arguments; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import datadog.trace.api.DDTraceId; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.api.AgentSpanContext; +import java.util.stream.Stream; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; + +public class W3CTraceParentTest { + + @ParameterizedTest(name = "{0}") + @MethodSource("buildProducesCorrectFormatArguments") + void buildProducesCorrectFormat( + String scenario, DDTraceId traceId, long spanId, boolean isSampled, String expected) { + assertEquals(expected, W3CTraceParent.from(traceId, spanId, isSampled)); + } + + static Stream buildProducesCorrectFormatArguments() { + return Stream.of( + arguments( + "sampled", + DDTraceId.from(1), + 2L, + true, + "00-00000000000000000000000000000001-0000000000000002-01"), + arguments( + "not sampled", + DDTraceId.from(1), + 2L, + false, + "00-00000000000000000000000000000001-0000000000000002-00"), + arguments( + "W3C example", + DDTraceId.fromHex("0af7651916cd43dd8448eb211c80319c"), + 0x00f067aa0ba902b7L, + true, + "00-0af7651916cd43dd8448eb211c80319c-00f067aa0ba902b7-01"), + arguments( + "Long.MAX_VALUE ids", + DDTraceId.from(Long.MAX_VALUE), + Long.MAX_VALUE, + true, + "00-00000000000000007fffffffffffffff-7fffffffffffffff-01")); + } + + @Test + void buildMatchesW3CTraceparentFormat() { + // W3C format: version-traceId(32 hex)-spanId(16 hex)-flags(2 hex) + String result = W3CTraceParent.from(DDTraceId.from(123456789L), 987654321L, true); + assertTrue(result.matches("00-[0-9a-f]{32}-[0-9a-f]{16}-(00|01)")); + } + + @Test + void buildFromSpanSampled() { + AgentSpan span = mock(AgentSpan.class); + AgentSpanContext context = mock(AgentSpanContext.class); + DDTraceId traceId = DDTraceId.fromHex("0af7651916cd43dd8448eb211c80319c"); + long spanId = 0x00f067aa0ba902b7L; + + when(span.getTraceId()).thenReturn(traceId); + when(span.getSpanId()).thenReturn(spanId); + when(span.spanContext()).thenReturn(context); + when(context.getSamplingPriority()).thenReturn(1); + + assertEquals( + "00-0af7651916cd43dd8448eb211c80319c-00f067aa0ba902b7-01", W3CTraceParent.from(span)); + } + + @Test + void buildFromSpanNotSampled() { + AgentSpan span = mock(AgentSpan.class); + AgentSpanContext context = mock(AgentSpanContext.class); + + when(span.getTraceId()).thenReturn(DDTraceId.from(1)); + when(span.getSpanId()).thenReturn(2L); + when(span.spanContext()).thenReturn(context); + when(context.getSamplingPriority()).thenReturn(0); + + assertEquals( + "00-00000000000000000000000000000001-0000000000000002-00", W3CTraceParent.from(span)); + } +} diff --git a/internal-api/src/test/java/datadog/trace/api/telemetry/ScaReachabilityDependencyRegistryTest.java b/internal-api/src/test/java/datadog/trace/api/telemetry/ScaReachabilityDependencyRegistryTest.java new file mode 100644 index 00000000000..3d022cc9144 --- /dev/null +++ b/internal-api/src/test/java/datadog/trace/api/telemetry/ScaReachabilityDependencyRegistryTest.java @@ -0,0 +1,283 @@ +package datadog.trace.api.telemetry; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.api.Config; +import java.util.List; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class ScaReachabilityDependencyRegistryTest { + + @BeforeEach + void setUp() { + ScaReachabilityDependencyRegistry.INSTANCE.resetForTesting(); + } + + @AfterEach + void tearDown() { + ScaReachabilityDependencyRegistry.INSTANCE.resetForTesting(); + } + + /** + * Regression test for the first-hit-wins thread-safety race. + * + *

      Before the fix (volatile + check-then-set), two threads calling {@code recordHit} for the + * same CVE from different methods could both observe {@code hit == null} simultaneously and both + * write, with the second overwriting the first. The fix uses {@link + * java.util.concurrent.atomic.AtomicReference#compareAndSet} to guarantee exactly one thread + * wins. + * + *

      This test starts N threads simultaneously, each recording a hit for the same CVE but from a + * different callsite. After all threads complete, exactly one callsite must be recorded. + */ + @Test + void recordHit_concurrentCallsForSameCve_exactlyOneCallsiteStored() throws InterruptedException { + int threadCount = 20; + ScaReachabilityDependencyRegistry.INSTANCE.registerCve("com.example:lib", "1.0.0", "GHSA-test"); + + CountDownLatch startLatch = new CountDownLatch(1); + CountDownLatch doneLatch = new CountDownLatch(threadCount); + ExecutorService pool = Executors.newFixedThreadPool(threadCount); + + for (int i = 0; i < threadCount; i++) { + final int idx = i; + pool.submit( + () -> { + try { + startLatch.await(); // wait until all threads are ready + ScaReachabilityDependencyRegistry.INSTANCE.recordHit( + "com.example:lib", + "1.0.0", + "GHSA-test", + "com.myapp.Controller" + idx, + "method" + idx, + idx); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } finally { + doneLatch.countDown(); + } + }); + } + + startLatch.countDown(); // release all threads simultaneously + doneLatch.await(10, TimeUnit.SECONDS); + pool.shutdown(); + + List snapshots = + ScaReachabilityDependencyRegistry.INSTANCE.drainPendingDependencies(); + + assertEquals(1, snapshots.size(), "exactly one dep snapshot"); + ScaReachabilityDependencyRegistry.DependencySnapshot dep = snapshots.get(0); + assertEquals(1, dep.cves.size(), "exactly one CVE"); + + ScaReachabilityDependencyRegistry.CveSnapshot cve = dep.cves.get(0); + assertNotNull(cve.hit, "exactly one hit must have been recorded"); + + // Verify the recorded callsite is one of the N valid options + String recordedClass = cve.hit.className(); + String recordedSymbol = cve.hit.symbolName(); + boolean isValidCallsite = false; + for (int i = 0; i < threadCount; i++) { + if (("com.myapp.Controller" + i).equals(recordedClass) + && ("method" + i).equals(recordedSymbol)) { + isValidCallsite = true; + break; + } + } + assertTrue( + isValidCallsite, "recorded callsite must be one of the " + threadCount + " valid options"); + } + + @Test + void registerCve_addsEntryAndMarksPending() { + ScaReachabilityDependencyRegistry.INSTANCE.registerCve("com.example:lib", "2.0.0", "GHSA-0001"); + + List snapshots = + ScaReachabilityDependencyRegistry.INSTANCE.drainPendingDependencies(); + + assertEquals(1, snapshots.size()); + ScaReachabilityDependencyRegistry.DependencySnapshot dep = snapshots.get(0); + assertEquals("com.example:lib", dep.artifact); + assertEquals("2.0.0", dep.version); + assertEquals(1, dep.cves.size()); + assertEquals("GHSA-0001", dep.cves.get(0).vulnId); + assertNull(dep.cves.get(0).hit, "class-load registration has no callsite yet"); + } + + @Test + void recordHit_snapshotContainsFullHitMetadata() { + ScaReachabilityDependencyRegistry.INSTANCE.recordHit( + "com.example:lib", "2.0.0", "GHSA-0001", "com.myapp.Ctrl", "handle", 42); + + List snapshots = + ScaReachabilityDependencyRegistry.INSTANCE.drainPendingDependencies(); + + assertEquals(1, snapshots.size()); + ScaReachabilityDependencyRegistry.DependencySnapshot dep = snapshots.get(0); + assertEquals("com.example:lib", dep.artifact); + assertEquals("2.0.0", dep.version); + assertEquals(1, dep.cves.size()); + + ScaReachabilityDependencyRegistry.CveSnapshot cve = dep.cves.get(0); + assertEquals("GHSA-0001", cve.vulnId); + assertNotNull(cve.hit); + assertEquals("GHSA-0001", cve.hit.vulnId()); + assertEquals("com.example:lib", cve.hit.artifact()); + assertEquals("2.0.0", cve.hit.version()); + assertEquals("com.myapp.Ctrl", cve.hit.className()); + assertEquals("handle", cve.hit.symbolName()); + assertEquals(42, cve.hit.line()); + } + + @Test + void peekSnapshot_returnsCurrentStateWithoutClearingPendingFlag() { + assertNull(ScaReachabilityDependencyRegistry.INSTANCE.peekSnapshot("missing", "1.0.0")); + + ScaReachabilityDependencyRegistry.INSTANCE.registerCve("com.example:lib", "2.0.0", "GHSA-0001"); + ScaReachabilityDependencyRegistry.INSTANCE.recordHit( + "com.example:lib", "2.0.0", "GHSA-0001", "com.myapp.Ctrl", "handle", 42); + + ScaReachabilityDependencyRegistry.DependencySnapshot peeked = + ScaReachabilityDependencyRegistry.INSTANCE.peekSnapshot("com.example:lib", "2.0.0"); + + assertNotNull(peeked); + assertEquals("com.example:lib", peeked.artifact); + assertEquals("2.0.0", peeked.version); + assertEquals(1, peeked.cves.size()); + assertEquals("GHSA-0001", peeked.cves.get(0).vulnId); + assertNotNull(peeked.cves.get(0).hit); + + List snapshots = + ScaReachabilityDependencyRegistry.INSTANCE.drainPendingDependencies(); + assertEquals(1, snapshots.size(), "peek must not clear pending state"); + } + + @Test + void drainPendingDependencies_secondDrainEmpty_untilNewHit() { + ScaReachabilityDependencyRegistry.INSTANCE.registerCve("com.example:lib", "2.0.0", "GHSA-0001"); + + // First drain returns the pending dep + List first = + ScaReachabilityDependencyRegistry.INSTANCE.drainPendingDependencies(); + assertEquals(1, first.size()); + + // Second drain with no new state change returns empty + List second = + ScaReachabilityDependencyRegistry.INSTANCE.drainPendingDependencies(); + assertTrue(second.isEmpty(), "no pending changes since last drain"); + + // A new hit marks the dep pending again + ScaReachabilityDependencyRegistry.INSTANCE.recordHit( + "com.example:lib", "2.0.0", "GHSA-0001", "com.myapp.Ctrl", "handle", 42); + List third = + ScaReachabilityDependencyRegistry.INSTANCE.drainPendingDependencies(); + assertEquals(1, third.size(), "dep must be pending again after a hit"); + assertNotNull(third.get(0).cves.get(0).hit, "hit callsite must be recorded"); + } + + @Test + void recordHit_firstHitWinsAndDuplicateDoesNotMarkPendingAgain() { + ScaReachabilityDependencyRegistry.INSTANCE.recordHit( + "com.example:lib", "2.0.0", "GHSA-0001", "com.myapp.First", "first", 1); + ScaReachabilityDependencyRegistry.INSTANCE.drainPendingDependencies(); + + ScaReachabilityDependencyRegistry.INSTANCE.recordHit( + "com.example:lib", "2.0.0", "GHSA-0001", "com.myapp.Second", "second", 2); + + assertTrue( + ScaReachabilityDependencyRegistry.INSTANCE.drainPendingDependencies().isEmpty(), + "duplicate hit for the same CVE must not mark the dependency pending"); + + ScaReachabilityDependencyRegistry.DependencySnapshot snapshot = + ScaReachabilityDependencyRegistry.INSTANCE.peekSnapshot("com.example:lib", "2.0.0"); + assertNotNull(snapshot); + assertEquals("com.myapp.First", snapshot.cves.get(0).hit.className()); + assertEquals("first", snapshot.cves.get(0).hit.symbolName()); + } + + @Test + void registerCve_atCap_newKeysRejected() { + int cap = Config.get().getAppSecScaMaxTrackedDependencies(); + + // Fill registry to cap + for (int i = 0; i < cap; i++) { + ScaReachabilityDependencyRegistry.INSTANCE.registerCve("art" + i, "1.0", "GHSA-" + i); + } + + // One more unique key — must be rejected + ScaReachabilityDependencyRegistry.INSTANCE.registerCve("art-over-cap", "1.0", "GHSA-over"); + + List snapshots = + ScaReachabilityDependencyRegistry.INSTANCE.drainPendingDependencies(); + assertEquals(cap, snapshots.size(), "registry must not exceed cap"); + boolean found = snapshots.stream().anyMatch(s -> s.artifact.equals("art-over-cap")); + assertFalse(found, "over-cap dep must be rejected"); + } + + @Test + void registerCve_atCap_existingKeyStillUpdated() { + int cap = Config.get().getAppSecScaMaxTrackedDependencies(); + + // Fill registry to cap + for (int i = 0; i < cap; i++) { + ScaReachabilityDependencyRegistry.INSTANCE.registerCve("art" + i, "1.0", "GHSA-" + i); + } + ScaReachabilityDependencyRegistry.INSTANCE.drainPendingDependencies(); + + // Adding a NEW CVE to an EXISTING key must still succeed (key already present, cap not + // exceeded) + ScaReachabilityDependencyRegistry.INSTANCE.registerCve("art0", "1.0", "GHSA-second-cve"); + + List snapshots = + ScaReachabilityDependencyRegistry.INSTANCE.drainPendingDependencies(); + assertEquals(1, snapshots.size(), "only the updated dep must be pending"); + assertEquals(2, snapshots.get(0).cves.size(), "both CVEs must be present"); + } + + @Test + void recordHit_atCap_newKeysRejectedButExistingKeyStillUpdated() { + int cap = Config.get().getAppSecScaMaxTrackedDependencies(); + + for (int i = 0; i < cap; i++) { + ScaReachabilityDependencyRegistry.INSTANCE.registerCve("art" + i, "1.0", "GHSA-" + i); + } + ScaReachabilityDependencyRegistry.INSTANCE.drainPendingDependencies(); + + ScaReachabilityDependencyRegistry.INSTANCE.recordHit( + "art-over-cap", "1.0", "GHSA-over", "com.myapp.Ctrl", "handle", 42); + assertTrue( + ScaReachabilityDependencyRegistry.INSTANCE.drainPendingDependencies().isEmpty(), + "over-cap hit for a new dependency must be rejected"); + + ScaReachabilityDependencyRegistry.INSTANCE.recordHit( + "art0", "1.0", "GHSA-0", "com.myapp.Ctrl", "handle", 42); + List snapshots = + ScaReachabilityDependencyRegistry.INSTANCE.drainPendingDependencies(); + assertEquals(1, snapshots.size(), "existing dependency can still be updated at cap"); + assertEquals("art0", snapshots.get(0).artifact); + assertNotNull(snapshots.get(0).cves.get(0).hit); + } + + @Test + void resetForTesting_clearsPeriodicWorkCallback() { + ScaReachabilityDependencyRegistry.INSTANCE.setPeriodicWorkCallback(() -> {}); + assertNotNull(ScaReachabilityDependencyRegistry.INSTANCE.getPeriodicWorkCallback()); + + ScaReachabilityDependencyRegistry.INSTANCE.resetForTesting(); + + assertNull( + ScaReachabilityDependencyRegistry.INSTANCE.getPeriodicWorkCallback(), + "resetForTesting must clear periodicWorkCallback"); + } +} diff --git a/internal-api/src/test/java/datadog/trace/bootstrap/instrumentation/api/KeyClassifierTest.java b/internal-api/src/test/java/datadog/trace/bootstrap/instrumentation/api/KeyClassifierTest.java new file mode 100644 index 00000000000..35e085a7892 --- /dev/null +++ b/internal-api/src/test/java/datadog/trace/bootstrap/instrumentation/api/KeyClassifierTest.java @@ -0,0 +1,78 @@ +package datadog.trace.bootstrap.instrumentation.api; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.nio.charset.StandardCharsets; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.concurrent.atomic.AtomicReference; +import org.junit.jupiter.api.Test; + +class KeyClassifierTest { + + static class RecordingClassifier implements AgentPropagation.KeyClassifier { + String lastKey; + String lastValue; + boolean returnValue; + + RecordingClassifier(boolean returnValue) { + this.returnValue = returnValue; + } + + @Override + public boolean accept(String key, String value) { + lastKey = key; + lastValue = value; + return returnValue; + } + } + + @Test + void defaultTransformerMethodAppliesTransformerAndDelegates() { + RecordingClassifier classifier = new RecordingClassifier(true); + + boolean result = + classifier.accept( + "my-key", + "raw".getBytes(StandardCharsets.UTF_8), + bytes -> new String(bytes, StandardCharsets.UTF_8)); + + assertEquals("my-key", classifier.lastKey); + assertEquals("raw", classifier.lastValue); + assertTrue(result); + } + + @Test + void transformerIsCalledExactlyOnce() { + AtomicInteger callCount = new AtomicInteger(0); + AtomicReference transformed = new AtomicReference<>(); + + AgentPropagation.KeyClassifier classifier = + (key, value) -> { + transformed.set(value); + return true; + }; + + classifier.accept( + "key", + "input", + v -> { + callCount.incrementAndGet(); + return v.toUpperCase(); + }); + + assertEquals(1, callCount.get()); + assertEquals("INPUT", transformed.get()); + } + + @Test + void existingAcceptStringStringContractUnchanged() { + RecordingClassifier classifier = new RecordingClassifier(true); + + boolean result = classifier.accept("trace-id", "abc123"); + + assertEquals("trace-id", classifier.lastKey); + assertEquals("abc123", classifier.lastValue); + assertTrue(result); + } +} diff --git a/internal-api/src/test/java/datadog/trace/util/HashingUtilsTest.java b/internal-api/src/test/java/datadog/trace/util/HashingUtilsTest.java index 185d5a4f2e4..1f171852866 100644 --- a/internal-api/src/test/java/datadog/trace/util/HashingUtilsTest.java +++ b/internal-api/src/test/java/datadog/trace/util/HashingUtilsTest.java @@ -99,7 +99,7 @@ public void hash5() { String str3 = "foobar"; String str4 = "hello"; - assertNotEquals(0, HashingUtils.hash(str0, str1, str2, str3)); + assertNotEquals(0, HashingUtils.hash(str0, str1, str2, str3, str4)); String clone0 = clone(str0); String clone1 = clone(str1); @@ -110,6 +110,11 @@ public void hash5() { assertEquals( HashingUtils.hash(str0, str1, str2, str3, str4), HashingUtils.hash(clone0, clone1, clone2, clone3, clone4)); + + // The 5th argument must actually affect the hash (regression for a missing-arg bug). + assertNotEquals( + HashingUtils.hash(str0, str1, str2, str3, str4), + HashingUtils.hash(str0, str1, str2, str3, "different")); } @Test diff --git a/internal-api/src/test/java/datadog/trace/util/HashtableD1Test.java b/internal-api/src/test/java/datadog/trace/util/HashtableD1Test.java new file mode 100644 index 00000000000..11cf93fc1dd --- /dev/null +++ b/internal-api/src/test/java/datadog/trace/util/HashtableD1Test.java @@ -0,0 +1,235 @@ +package datadog.trace.util; + +import static datadog.trace.util.HashtableTestEntries.CollidingKey; +import static datadog.trace.util.HashtableTestEntries.CollidingKeyEntry; +import static datadog.trace.util.HashtableTestEntries.StringIntEntry; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; + +import java.util.HashMap; +import java.util.Map; +import org.junit.jupiter.api.Test; + +class HashtableD1Test { + + @Test + void emptyTableLookupReturnsNull() { + Hashtable.D1 table = new Hashtable.D1<>(8); + assertNull(table.get("missing")); + assertEquals(0, table.size()); + } + + @Test + void insertedEntryIsRetrievable() { + Hashtable.D1 table = new Hashtable.D1<>(8); + StringIntEntry e = new StringIntEntry("foo", 1); + table.insert(e); + assertEquals(1, table.size()); + assertSame(e, table.get("foo")); + } + + @Test + void multipleInsertsRetrievableSeparately() { + Hashtable.D1 table = new Hashtable.D1<>(16); + StringIntEntry a = new StringIntEntry("alpha", 1); + StringIntEntry b = new StringIntEntry("beta", 2); + StringIntEntry c = new StringIntEntry("gamma", 3); + table.insert(a); + table.insert(b); + table.insert(c); + assertEquals(3, table.size()); + assertSame(a, table.get("alpha")); + assertSame(b, table.get("beta")); + assertSame(c, table.get("gamma")); + } + + @Test + void inPlaceMutationVisibleViaSubsequentGet() { + Hashtable.D1 table = new Hashtable.D1<>(8); + table.insert(new StringIntEntry("counter", 0)); + for (int i = 0; i < 10; i++) { + StringIntEntry e = table.get("counter"); + e.value++; + } + assertEquals(10, table.get("counter").value); + } + + @Test + void removeUnlinksEntryAndDecrementsSize() { + Hashtable.D1 table = new Hashtable.D1<>(8); + table.insert(new StringIntEntry("a", 1)); + table.insert(new StringIntEntry("b", 2)); + assertEquals(2, table.size()); + + StringIntEntry removed = table.remove("a"); + assertNotNull(removed); + assertEquals("a", removed.key); + assertEquals(1, table.size()); + assertNull(table.get("a")); + assertNotNull(table.get("b")); + } + + @Test + void removeNonexistentReturnsNullAndDoesNotChangeSize() { + Hashtable.D1 table = new Hashtable.D1<>(8); + table.insert(new StringIntEntry("a", 1)); + assertNull(table.remove("nope")); + assertEquals(1, table.size()); + } + + @Test + void insertOrReplaceReturnsPriorEntryOrNullOnInsert() { + Hashtable.D1 table = new Hashtable.D1<>(8); + StringIntEntry first = new StringIntEntry("k", 1); + assertNull(table.insertOrReplace(first), "fresh insert returns null"); + assertEquals(1, table.size()); + + StringIntEntry second = new StringIntEntry("k", 2); + assertSame(first, table.insertOrReplace(second), "replace returns the prior entry"); + assertEquals(1, table.size()); + assertSame(second, table.get("k"), "new entry visible after replace"); + } + + @Test + void clearEmptiesTheTable() { + Hashtable.D1 table = new Hashtable.D1<>(8); + table.insert(new StringIntEntry("a", 1)); + table.insert(new StringIntEntry("b", 2)); + table.clear(); + assertEquals(0, table.size()); + assertNull(table.get("a")); + // Reinsertion works after clear + table.insert(new StringIntEntry("a", 99)); + assertEquals(99, table.get("a").value); + } + + @Test + void forEachVisitsEveryInsertedEntry() { + Hashtable.D1 table = new Hashtable.D1<>(8); + table.insert(new StringIntEntry("a", 1)); + table.insert(new StringIntEntry("b", 2)); + table.insert(new StringIntEntry("c", 3)); + Map seen = new HashMap<>(); + table.forEach(e -> seen.put(e.key, e.value)); + assertEquals(3, seen.size()); + assertEquals(1, seen.get("a")); + assertEquals(2, seen.get("b")); + assertEquals(3, seen.get("c")); + } + + @Test + void forEachWithContextPassesContextToConsumer() { + Hashtable.D1 table = new Hashtable.D1<>(8); + table.insert(new StringIntEntry("a", 10)); + table.insert(new StringIntEntry("b", 20)); + table.insert(new StringIntEntry("c", 30)); + Map seen = new HashMap<>(); + table.forEach(seen, (ctx, e) -> ctx.put(e.key, e.value)); + assertEquals(3, seen.size()); + assertEquals(10, seen.get("a")); + assertEquals(20, seen.get("b")); + assertEquals(30, seen.get("c")); + } + + @Test + void forEachWithContextOnEmptyTableDoesNothing() { + Hashtable.D1 table = new Hashtable.D1<>(8); + Map seen = new HashMap<>(); + table.forEach(seen, (ctx, e) -> ctx.put(e.key, e.value)); + assertEquals(0, seen.size()); + } + + @Test + void nullKeyIsPermittedAndDistinctFromAbsent() { + Hashtable.D1 table = new Hashtable.D1<>(8); + assertNull(table.get(null)); + StringIntEntry nullKeyed = new StringIntEntry(null, 7); + table.insert(nullKeyed); + assertSame(nullKeyed, table.get(null)); + assertEquals(1, table.size()); + assertSame(nullKeyed, table.remove(null)); + assertEquals(0, table.size()); + } + + @Test + void hashCollisionsResolveByEquality() { + // Force two distinct keys with the same hashCode -- the chain must still distinguish them + // via matches(). + Hashtable.D1 table = new Hashtable.D1<>(4); + CollidingKey k1 = new CollidingKey("first", 17); + CollidingKey k2 = new CollidingKey("second", 17); + CollidingKeyEntry e1 = new CollidingKeyEntry(k1, 100); + CollidingKeyEntry e2 = new CollidingKeyEntry(k2, 200); + table.insert(e1); + table.insert(e2); + assertEquals(2, table.size()); + assertSame(e1, table.get(k1)); + assertSame(e2, table.get(k2)); + } + + @Test + void hashCollisionsThenRemoveLeavesOtherIntact() { + Hashtable.D1 table = new Hashtable.D1<>(4); + CollidingKey k1 = new CollidingKey("first", 17); + CollidingKey k2 = new CollidingKey("second", 17); + CollidingKey k3 = new CollidingKey("third", 17); + table.insert(new CollidingKeyEntry(k1, 1)); + table.insert(new CollidingKeyEntry(k2, 2)); + table.insert(new CollidingKeyEntry(k3, 3)); + table.remove(k2); + assertEquals(2, table.size()); + assertNotNull(table.get(k1)); + assertNull(table.get(k2)); + assertNotNull(table.get(k3)); + } + + @Test + void getOrCreateOnMissBuildsEntryViaCreator() { + Hashtable.D1 table = new Hashtable.D1<>(8); + int[] createCount = {0}; + StringIntEntry created = + table.getOrCreate( + "foo", + k -> { + createCount[0]++; + return new StringIntEntry(k, 42); + }); + assertNotNull(created); + assertEquals("foo", created.key); + assertEquals(42, created.value); + assertEquals(1, table.size()); + assertEquals(1, createCount[0]); + assertSame(created, table.get("foo")); + } + + @Test + void getOrCreateOnHitSkipsCreator() { + Hashtable.D1 table = new Hashtable.D1<>(8); + StringIntEntry seeded = new StringIntEntry("foo", 1); + table.insert(seeded); + int[] createCount = {0}; + StringIntEntry got = + table.getOrCreate( + "foo", + k -> { + createCount[0]++; + return new StringIntEntry(k, 999); + }); + assertSame(seeded, got); + assertEquals(1, table.size()); + assertEquals(0, createCount[0]); + } + + @Test + void getOrCreateNullKeyIsPermitted() { + Hashtable.D1 table = new Hashtable.D1<>(8); + StringIntEntry created = table.getOrCreate(null, k -> new StringIntEntry(k, 7)); + assertNotNull(created); + assertNull(created.key); + assertEquals(7, created.value); + assertSame(created, table.getOrCreate(null, k -> new StringIntEntry(k, 999))); + assertEquals(1, table.size()); + } +} diff --git a/internal-api/src/test/java/datadog/trace/util/HashtableD2Test.java b/internal-api/src/test/java/datadog/trace/util/HashtableD2Test.java new file mode 100644 index 00000000000..50da832395b --- /dev/null +++ b/internal-api/src/test/java/datadog/trace/util/HashtableD2Test.java @@ -0,0 +1,186 @@ +package datadog.trace.util; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.HashSet; +import java.util.Set; +import org.junit.jupiter.api.Test; + +class HashtableD2Test { + + @Test + void pairKeysParticipateInIdentity() { + Hashtable.D2 table = new Hashtable.D2<>(8); + PairEntry ab = new PairEntry("a", 1, 100); + PairEntry ac = new PairEntry("a", 2, 200); + PairEntry bb = new PairEntry("b", 1, 300); + table.insert(ab); + table.insert(ac); + table.insert(bb); + assertEquals(3, table.size()); + assertSame(ab, table.get("a", 1)); + assertSame(ac, table.get("a", 2)); + assertSame(bb, table.get("b", 1)); + assertNull(table.get("a", 3)); + } + + @Test + void removePairUnlinks() { + Hashtable.D2 table = new Hashtable.D2<>(8); + PairEntry ab = new PairEntry("a", 1, 100); + PairEntry ac = new PairEntry("a", 2, 200); + table.insert(ab); + table.insert(ac); + assertSame(ab, table.remove("a", 1)); + assertEquals(1, table.size()); + assertNull(table.get("a", 1)); + assertSame(ac, table.get("a", 2)); + } + + @Test + void insertOrReplaceMatchesOnBothKeys() { + Hashtable.D2 table = new Hashtable.D2<>(8); + PairEntry first = new PairEntry("k", 7, 1); + assertNull(table.insertOrReplace(first)); + PairEntry second = new PairEntry("k", 7, 2); + assertSame(first, table.insertOrReplace(second)); + // Different second-key: should insert new, not replace + PairEntry third = new PairEntry("k", 8, 3); + assertNull(table.insertOrReplace(third)); + assertEquals(2, table.size()); + } + + @Test + void forEachVisitsBothPairs() { + Hashtable.D2 table = new Hashtable.D2<>(8); + table.insert(new PairEntry("a", 1, 100)); + table.insert(new PairEntry("b", 2, 200)); + Set seen = new HashSet<>(); + table.forEach(e -> seen.add(e.key1 + ":" + e.key2)); + assertEquals(2, seen.size()); + assertTrue(seen.contains("a:1")); + assertTrue(seen.contains("b:2")); + } + + @Test + void forEachWithContextPassesContextToConsumer() { + Hashtable.D2 table = new Hashtable.D2<>(8); + table.insert(new PairEntry("a", 1, 100)); + table.insert(new PairEntry("b", 2, 200)); + Set seen = new HashSet<>(); + table.forEach(seen, (ctx, e) -> ctx.add(e.key1 + ":" + e.key2)); + assertEquals(2, seen.size()); + assertTrue(seen.contains("a:1")); + assertTrue(seen.contains("b:2")); + } + + @Test + void getOrCreateOnMissBuildsEntryViaCreator() { + Hashtable.D2 table = new Hashtable.D2<>(8); + int[] createCount = {0}; + PairEntry created = + table.getOrCreate( + "a", + 1, + (k1, k2) -> { + createCount[0]++; + return new PairEntry(k1, k2, 100); + }); + assertNotNull(created); + assertEquals("a", created.key1); + assertEquals(Integer.valueOf(1), created.key2); + assertEquals(100, created.value); + assertEquals(1, table.size()); + assertEquals(1, createCount[0]); + assertSame(created, table.get("a", 1)); + } + + @Test + void getOrCreateOnHitSkipsCreator() { + Hashtable.D2 table = new Hashtable.D2<>(8); + PairEntry seeded = new PairEntry("a", 1, 100); + table.insert(seeded); + int[] createCount = {0}; + PairEntry got = + table.getOrCreate( + "a", + 1, + (k1, k2) -> { + createCount[0]++; + return new PairEntry(k1, k2, 999); + }); + assertSame(seeded, got); + assertEquals(1, table.size()); + assertEquals(0, createCount[0]); + } + + @Test + void entryMatchesTrueWhenBothKeysEqual() { + PairEntry entry = new PairEntry("a", 1, 100); + assertTrue(entry.matches("a", 1)); + } + + @Test + void entryMatchesFalseWhenKey1Differs() { + PairEntry entry = new PairEntry("a", 1, 100); + assertFalse(entry.matches("b", 1)); + } + + @Test + void entryMatchesFalseWhenKey2Differs() { + PairEntry entry = new PairEntry("a", 1, 100); + assertFalse(entry.matches("a", 2)); + } + + @Test + void entryHashIsConsistentForSameKeys() { + long h1 = Hashtable.D2.Entry.hash("x", 42); + long h2 = Hashtable.D2.Entry.hash("x", 42); + assertEquals(h1, h2); + } + + @Test + void entryHashDiffersForDifferentKeys() { + long h1 = Hashtable.D2.Entry.hash("x", 1); + long h2 = Hashtable.D2.Entry.hash("x", 2); + assertFalse(h1 == h2); + } + + @Test + void removeReturnsNullForMissingKey() { + Hashtable.D2 table = new Hashtable.D2<>(8); + table.insert(new PairEntry("a", 1, 100)); + + assertNull(table.remove("a", 2)); + assertNull(table.remove("z", 1)); + assertEquals(1, table.size()); + } + + @Test + void clearEmptiesTable() { + Hashtable.D2 table = new Hashtable.D2<>(8); + table.insert(new PairEntry("a", 1, 100)); + table.insert(new PairEntry("b", 2, 200)); + assertEquals(2, table.size()); + + table.clear(); + + assertEquals(0, table.size()); + assertNull(table.get("a", 1)); + assertNull(table.get("b", 2)); + } + + private static final class PairEntry extends Hashtable.D2.Entry { + int value; + + PairEntry(String key1, Integer key2, int value) { + super(key1, key2); + this.value = value; + } + } +} diff --git a/internal-api/src/test/java/datadog/trace/util/HashtableTest.java b/internal-api/src/test/java/datadog/trace/util/HashtableTest.java new file mode 100644 index 00000000000..953453ca3aa --- /dev/null +++ b/internal-api/src/test/java/datadog/trace/util/HashtableTest.java @@ -0,0 +1,412 @@ +package datadog.trace.util; + +import static datadog.trace.util.HashtableTestEntries.CollidingKey; +import static datadog.trace.util.HashtableTestEntries.CollidingKeyEntry; +import static datadog.trace.util.HashtableTestEntries.StringIntEntry; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.util.Hashtable.BucketIterator; +import datadog.trace.util.Hashtable.MutatingBucketIterator; +import datadog.trace.util.Hashtable.MutatingTableIterator; +import datadog.trace.util.Hashtable.Support; +import java.util.HashSet; +import java.util.NoSuchElementException; +import java.util.Set; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; + +class HashtableTest { + + // ============ Support ============ + + @Nested + class SupportTests { + + @Test + void createRoundsCapacityUpToPowerOfTwo() { + // The Hashtable.D1 / D2 size() reflects entries, but the bucket array length is + // a power of two >= requestedCapacity. We can verify indirectly via bucketIndex masking. + Hashtable.Entry[] buckets = Support.create(5); + // Length must be a power of two >= 5 + int len = buckets.length; + assertTrue(len >= 5); + assertEquals(0, len & (len - 1), "length must be a power of two"); + } + + @Test + void sizeForReturnsAtLeastOne() { + assertEquals(1, Support.sizeFor(0)); + assertEquals(1, Support.sizeFor(1)); + } + + @Test + void sizeForRoundsUpToPowerOfTwo() { + assertEquals(2, Support.sizeFor(2)); + assertEquals(4, Support.sizeFor(3)); + assertEquals(4, Support.sizeFor(4)); + assertEquals(8, Support.sizeFor(5)); + assertEquals(1 << 30, Support.sizeFor(1 << 30)); + } + + @Test + void sizeForRejectsCapacityAboveMax() { + assertThrows(IllegalArgumentException.class, () -> Support.sizeFor((1 << 30) + 1)); + assertThrows(IllegalArgumentException.class, () -> Support.sizeFor(Integer.MAX_VALUE)); + } + + @Test + void sizeForRejectsNegativeCapacity() { + assertThrows(IllegalArgumentException.class, () -> Support.sizeFor(-1)); + assertThrows(IllegalArgumentException.class, () -> Support.sizeFor(Integer.MIN_VALUE)); + } + + @Test + void bucketIndexIsBoundedByArrayLength() { + Hashtable.Entry[] buckets = Support.create(16); + for (long h : new long[] {0L, 1L, -1L, Long.MIN_VALUE, Long.MAX_VALUE, 12345L}) { + int idx = Support.bucketIndex(buckets, h); + assertTrue(idx >= 0 && idx < buckets.length, "bucketIndex out of range for hash " + h); + } + } + + @Test + void clearNullsAllBuckets() { + Hashtable.Entry[] buckets = Support.create(4); + buckets[0] = new StringIntEntry("x", 1); + buckets[1] = new StringIntEntry("y", 2); + Support.clear(buckets); + for (Hashtable.Entry b : buckets) { + assertNull(b); + } + } + + @Test + void maxRatioScalesTargetForLoadFactor() { + // 75% load factor => bucket array sized at requestedSize * 4/3, rounded up to power of 2. + // 12 * (4/3) = 16 entries, rounded up to power-of-2 length = 16. + assertEquals(4.0f / 3.0f, Support.MAX_RATIO); + Hashtable.Entry[] buckets = Support.create(12, Support.MAX_RATIO); + assertEquals(16, buckets.length); + } + + @Test + void createWithScaleRoundsUpToPowerOfTwo() { + // 7 * 1.5 = 10.5 -> (int) 10 -> sizeFor rounds up to next power-of-two = 16 + Hashtable.Entry[] buckets = Support.create(7, 1.5f); + assertEquals(16, buckets.length); + } + + @Test + void insertHeadEntrySplicesAsNewHead() { + Hashtable.Entry[] buckets = Support.create(4); + StringIntEntry a = new StringIntEntry("a", 1); + StringIntEntry b = new StringIntEntry("b", 2); + Support.insertHeadEntry(buckets, 0, a); + assertSame(a, buckets[0]); + assertNull(a.next()); + + Support.insertHeadEntry(buckets, 0, b); + assertSame(b, buckets[0]); + assertSame(a, b.next()); + assertNull(a.next()); + } + } + + // ============ BucketIterator ============ + + @Nested + class BucketIteratorTests { + + @Test + void walksOnlyMatchingHash() { + // Build a bucket array with two entries that share a bucket but have different hashes. + // Use Hashtable.D1 to seed; then call Support.bucketIterator directly with the matching + // hash and verify it only returns the matching entry. + Hashtable.D1 table = new Hashtable.D1<>(4); + CollidingKey k1 = new CollidingKey("first", 17); + CollidingKey k2 = new CollidingKey("second", 17); + CollidingKey k3 = new CollidingKey("third", 17); + table.insert(new CollidingKeyEntry(k1, 1)); + table.insert(new CollidingKeyEntry(k2, 2)); + table.insert(new CollidingKeyEntry(k3, 3)); + // All three share the same hash (17), so a bucket iterator over hash=17 yields all three. + BucketIterator it = Support.bucketIterator(table.buckets, 17L); + int count = 0; + while (it.hasNext()) { + assertNotNull(it.next()); + count++; + } + assertEquals(3, count); + } + + @Test + void exhaustedIteratorThrowsNoSuchElement() { + Hashtable.D1 table = new Hashtable.D1<>(4); + table.insert(new StringIntEntry("only", 1)); + long h = Hashtable.D1.Entry.hash("only"); + BucketIterator it = Support.bucketIterator(table.buckets, h); + it.next(); + assertFalse(it.hasNext()); + assertThrows(NoSuchElementException.class, it::next); + } + } + + // ============ MutatingBucketIterator ============ + + @Nested + class MutatingBucketIteratorTests { + + @Test + void removeFromHeadOfChainUnlinks() { + // Make three entries with the same hash so they chain in one bucket + Hashtable.D1 table = new Hashtable.D1<>(4); + CollidingKey k1 = new CollidingKey("first", 17); + CollidingKey k2 = new CollidingKey("second", 17); + CollidingKey k3 = new CollidingKey("third", 17); + table.insert(new CollidingKeyEntry(k1, 1)); + table.insert(new CollidingKeyEntry(k2, 2)); + table.insert(new CollidingKeyEntry(k3, 3)); + + MutatingBucketIterator it = + Support.mutatingBucketIterator(table.buckets, 17L); + it.next(); // first match (head of chain in insertion-reverse order) + it.remove(); + // Two should remain + int remaining = 0; + while (it.hasNext()) { + it.next(); + remaining++; + } + assertEquals(2, remaining); + // And the table still finds the survivors via get(...) + // (which entry was the head depends on insertion order; we just verify count + that two + // of the three keys are still retrievable.) + int found = 0; + for (CollidingKey k : new CollidingKey[] {k1, k2, k3}) { + if (table.get(k) != null) { + found++; + } + } + assertEquals(2, found); + } + + @Test + void replaceSwapsEntryAndPreservesChain() { + Hashtable.D1 table = new Hashtable.D1<>(4); + CollidingKey k1 = new CollidingKey("first", 17); + CollidingKey k2 = new CollidingKey("second", 17); + CollidingKeyEntry e1 = new CollidingKeyEntry(k1, 1); + CollidingKeyEntry e2 = new CollidingKeyEntry(k2, 2); + table.insert(e1); + table.insert(e2); + + MutatingBucketIterator it = + Support.mutatingBucketIterator(table.buckets, 17L); + CollidingKeyEntry first = it.next(); + CollidingKeyEntry replacement = new CollidingKeyEntry(first.key, 999); + it.replace(replacement); + // Both entries still in the chain + assertNotNull(table.get(k1)); + assertNotNull(table.get(k2)); + // The replaced one now has value 999 + assertEquals(999, table.get(first.key).value); + } + + @Test + void removeWithoutNextThrows() { + Hashtable.D1 table = new Hashtable.D1<>(4); + table.insert(new StringIntEntry("a", 1)); + MutatingBucketIterator it = + Support.mutatingBucketIterator(table.buckets, Hashtable.D1.Entry.hash("a")); + assertThrows(IllegalStateException.class, it::remove); + } + } + + // ============ MutatingTableIterator ============ + + @Nested + class MutatingTableIteratorTests { + + @Test + void walksEveryEntryAcrossBuckets() { + Hashtable.D1 table = new Hashtable.D1<>(16); + table.insert(new StringIntEntry("a", 1)); + table.insert(new StringIntEntry("b", 2)); + table.insert(new StringIntEntry("c", 3)); + + Set seen = new HashSet<>(); + for (MutatingTableIterator it = Support.mutatingTableIterator(table.buckets); + it.hasNext(); ) { + seen.add(it.next().key); + } + assertEquals(3, seen.size()); + assertTrue(seen.contains("a")); + assertTrue(seen.contains("b")); + assertTrue(seen.contains("c")); + } + + @Test + void emptyTableIteratorIsExhausted() { + Hashtable.D1 table = new Hashtable.D1<>(8); + MutatingTableIterator it = Support.mutatingTableIterator(table.buckets); + assertFalse(it.hasNext()); + assertThrows(NoSuchElementException.class, it::next); + } + + @Test + void removeUnlinksBucketHead() { + Hashtable.D1 table = new Hashtable.D1<>(4); + CollidingKey k1 = new CollidingKey("first", 17); + CollidingKey k2 = new CollidingKey("second", 17); + table.insert(new CollidingKeyEntry(k1, 1)); + table.insert(new CollidingKeyEntry(k2, 2)); + + // The head of the chain is whichever was inserted last (insert prepends). + MutatingTableIterator it = Support.mutatingTableIterator(table.buckets); + CollidingKeyEntry head = it.next(); + it.remove(); + + // Survivor still reachable via the table; removed one is not. + CollidingKey survivorKey = head.key.equals(k1) ? k2 : k1; + assertNotNull(table.get(survivorKey)); + assertNull(table.get(head.key)); + } + + @Test + void removeUnlinksMidChainEntry() { + Hashtable.D1 table = new Hashtable.D1<>(4); + CollidingKey k1 = new CollidingKey("first", 17); + CollidingKey k2 = new CollidingKey("second", 17); + CollidingKey k3 = new CollidingKey("third", 17); + table.insert(new CollidingKeyEntry(k1, 1)); + table.insert(new CollidingKeyEntry(k2, 2)); + table.insert(new CollidingKeyEntry(k3, 3)); + + // Walk to the second entry, remove it. + MutatingTableIterator it = Support.mutatingTableIterator(table.buckets); + it.next(); + CollidingKeyEntry victim = it.next(); + it.remove(); + + assertNull(table.get(victim.key)); + // The remaining two keys still resolve. + int remaining = 0; + for (CollidingKey k : new CollidingKey[] {k1, k2, k3}) { + if (table.get(k) != null) { + remaining++; + } + } + assertEquals(2, remaining); + + // Iteration can continue past a remove and yield the third entry. + assertTrue(it.hasNext()); + assertNotNull(it.next()); + assertFalse(it.hasNext()); + } + + @Test + void removeSkipsOverEmptyBuckets() { + // Three distinct keys that land in different buckets (low entry count vs large bucket array + // makes empty buckets between them very likely). Verify the iterator skips empties cleanly + // after a remove. + Hashtable.D1 table = new Hashtable.D1<>(64); + table.insert(new StringIntEntry("alpha", 1)); + table.insert(new StringIntEntry("beta", 2)); + table.insert(new StringIntEntry("gamma", 3)); + + MutatingTableIterator it = Support.mutatingTableIterator(table.buckets); + it.next(); + it.remove(); + int remaining = 0; + while (it.hasNext()) { + it.next(); + remaining++; + } + assertEquals(2, remaining); + } + + @Test + void removeWithoutNextThrows() { + Hashtable.D1 table = new Hashtable.D1<>(4); + table.insert(new StringIntEntry("a", 1)); + MutatingTableIterator it = Support.mutatingTableIterator(table.buckets); + assertThrows(IllegalStateException.class, it::remove); + } + + @Test + void removeTwiceWithoutInterveningNextThrows() { + Hashtable.D1 table = new Hashtable.D1<>(4); + table.insert(new StringIntEntry("a", 1)); + table.insert(new StringIntEntry("b", 2)); + MutatingTableIterator it = Support.mutatingTableIterator(table.buckets); + it.next(); + it.remove(); + assertThrows(IllegalStateException.class, it::remove); + } + + @Test + void halfOpenRangeOmitsBucketsOutsideTheRange() { + // CollidingKey lets us pin entries to specific buckets via controlled hashCode. 16-slot + // table -> bucketIndex = hash & 15. Place entries in buckets 0, 5, and 10; iterate + // [5, 10) -- should see only bucket 5. + Hashtable.D1 table = new Hashtable.D1<>(16); + table.insert(new CollidingKeyEntry(new CollidingKey("b0", 0), 1)); + table.insert(new CollidingKeyEntry(new CollidingKey("b5", 5), 2)); + table.insert(new CollidingKeyEntry(new CollidingKey("b10", 10), 3)); + + Set seen = new HashSet<>(); + for (MutatingTableIterator it = + Support.mutatingTableIterator(table.buckets, 5, 10); + it.hasNext(); ) { + seen.add(it.next().key.label); + } + assertEquals(1, seen.size()); + assertTrue(seen.contains("b5")); + } + + @Test + void emptyHalfOpenRangeIsExhausted() { + // start == end -> immediately-exhausted iterator. Important: this is the wrap-around + // pass [0, cursor) when cursor == 0 in resumable sweeps. + Hashtable.D1 table = new Hashtable.D1<>(8); + table.insert(new StringIntEntry("a", 1)); + MutatingTableIterator it = Support.mutatingTableIterator(table.buckets, 0, 0); + assertFalse(it.hasNext()); + } + + @Test + void rangeBoundsOutOfOrderThrows() { + Hashtable.D1 table = new Hashtable.D1<>(8); + assertThrows( + IndexOutOfBoundsException.class, + () -> Support.mutatingTableIterator(table.buckets, -1, 4)); + assertThrows( + IndexOutOfBoundsException.class, + () -> Support.mutatingTableIterator(table.buckets, 4, 2)); // end < start + assertThrows( + IndexOutOfBoundsException.class, + () -> + Support.mutatingTableIterator( + table.buckets, 0, table.buckets.length + 1)); // end > len + } + + @Test + void currentBucketReportsLandingIndex() { + // Pin one entry to a known bucket and check currentBucket() after next() reports that + // bucket. Before any next() (or after remove()), currentBucket() returns -1. + Hashtable.D1 table = new Hashtable.D1<>(16); + table.insert(new CollidingKeyEntry(new CollidingKey("b3", 3), 1)); + + MutatingTableIterator it = Support.mutatingTableIterator(table.buckets); + assertEquals(-1, it.currentBucket(), "before any next() currentBucket should be -1"); + it.next(); + assertEquals(3, it.currentBucket(), "currentBucket should report the entry's bucket"); + } + } +} diff --git a/internal-api/src/test/java/datadog/trace/util/HashtableTestEntries.java b/internal-api/src/test/java/datadog/trace/util/HashtableTestEntries.java new file mode 100644 index 00000000000..e657028ee8b --- /dev/null +++ b/internal-api/src/test/java/datadog/trace/util/HashtableTestEntries.java @@ -0,0 +1,54 @@ +package datadog.trace.util; + +/** Shared test entry types for {@link HashtableTest}, {@link HashtableD1Test}, and friends. */ +final class HashtableTestEntries { + private HashtableTestEntries() {} + + static final class StringIntEntry extends Hashtable.D1.Entry { + int value; + + StringIntEntry(String key, int value) { + super(key); + this.value = value; + } + } + + /** Key whose hashCode is fully controllable, to force chain collisions deterministically. */ + static final class CollidingKey { + final String label; + final int hash; + + CollidingKey(String label, int hash) { + this.label = label; + this.hash = hash; + } + + @Override + public int hashCode() { + return hash; + } + + @Override + public boolean equals(Object o) { + if (!(o instanceof CollidingKey)) { + return false; + } + CollidingKey that = (CollidingKey) o; + return hash == that.hash && label.equals(that.label); + } + + @Override + public String toString() { + return "CollidingKey(" + label + ", " + hash + ")"; + } + } + + static final class CollidingKeyEntry extends Hashtable.D1.Entry { + int value; + + CollidingKeyEntry(CollidingKey key, int value) { + super(key); + this.value = value; + } + } +} diff --git a/internal-api/src/test/java/datadog/trace/util/LongHashingUtilsTest.java b/internal-api/src/test/java/datadog/trace/util/LongHashingUtilsTest.java new file mode 100644 index 00000000000..795c182df18 --- /dev/null +++ b/internal-api/src/test/java/datadog/trace/util/LongHashingUtilsTest.java @@ -0,0 +1,159 @@ +package datadog.trace.util; + +import static datadog.trace.util.LongHashingUtils.addToHash; +import static datadog.trace.util.LongHashingUtils.hash; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; + +import java.util.Arrays; +import java.util.Objects; +import org.junit.jupiter.api.Test; + +class LongHashingUtilsTest { + + // ----- single-value overloads ----- + + @Test + void hashOfObjectReturnsHashCodeOrSentinelForNull() { + Object o = new Object(); + assertEquals(o.hashCode(), hash(o)); + assertEquals(Long.MIN_VALUE, hash((Object) null)); + } + + @Test + void primitiveOverloadsMatchBoxedHashCodes() { + assertEquals(Boolean.hashCode(true), hash(true)); + assertEquals(Boolean.hashCode(false), hash(false)); + assertEquals(Character.hashCode('x'), hash('x')); + assertEquals(Byte.hashCode((byte) 42), hash((byte) 42)); + assertEquals(Short.hashCode((short) -7), hash((short) -7)); + assertEquals(Integer.hashCode(123456), hash(123456)); + assertEquals(123456L, hash(123456L)); + assertEquals(Float.hashCode(3.14f), hash(3.14f)); + assertEquals(Double.doubleToRawLongBits(2.71828), hash(2.71828)); + } + + // ----- multi-arg Object overloads vs chained addToHash ----- + + @Test + void twoArgHashMatchesChainedAddToHash() { + Object a = "alpha"; + Object b = 42; + assertEquals(addToHash(addToHash(0L, a), b), hash(a, b)); + } + + @Test + void threeArgHashMatchesChainedAddToHash() { + Object a = "alpha"; + Object b = 42; + Object c = true; + assertEquals(addToHash(addToHash(addToHash(0L, a), b), c), hash(a, b, c)); + } + + @Test + void fourArgHashMatchesChainedAddToHash() { + Object a = "alpha"; + Object b = 42; + Object c = true; + Object d = 3.14; + assertEquals(addToHash(addToHash(addToHash(addToHash(0L, a), b), c), d), hash(a, b, c, d)); + } + + @Test + void fiveArgHashMatchesChainedAddToHash() { + Object a = "alpha"; + Object b = 42; + Object c = true; + Object d = 3.14; + Object e = 'q'; + assertEquals( + addToHash(addToHash(addToHash(addToHash(addToHash(0L, a), b), c), d), e), + hash(a, b, c, d, e)); + } + + @Test + void multiArgHashHandlesNullsConsistentlyWithChainedAddToHash() { + assertEquals(addToHash(addToHash(0L, (Object) null), "x"), hash(null, "x")); + assertEquals( + addToHash(addToHash(addToHash(0L, "x"), (Object) null), "y"), hash("x", null, "y")); + } + + @Test + void differentInputsProduceDifferentHashes() { + // Sanity: ordering matters, and distinct values produce distinct results in general. + assertNotEquals(hash("a", "b"), hash("b", "a")); + assertNotEquals(hash("a", "b", "c"), hash("a", "c", "b")); + } + + // ----- addToHash primitive overloads ----- + + @Test + void addToHashPrimitivesMatchObjectVersion() { + long seed = 100L; + assertEquals(addToHash(seed, Boolean.hashCode(true)), addToHash(seed, true)); + assertEquals(addToHash(seed, Character.hashCode('z')), addToHash(seed, 'z')); + assertEquals(addToHash(seed, Byte.hashCode((byte) 9)), addToHash(seed, (byte) 9)); + assertEquals(addToHash(seed, Short.hashCode((short) 5)), addToHash(seed, (short) 5)); + assertEquals(addToHash(seed, Long.hashCode(999_999L)), addToHash(seed, 999_999L)); + assertEquals(addToHash(seed, Float.hashCode(1.5f)), addToHash(seed, 1.5f)); + assertEquals(addToHash(seed, Double.hashCode(2.5d)), addToHash(seed, 2.5d)); + } + + @Test + void addToHashIsLinearAcrossSteps() { + // 31*h + v formula -- verify by accumulating an explicit sequence. + long expected = 0L; + for (int v : new int[] {1, 2, 3, 4, 5}) { + expected = 31L * expected + v; + } + long actual = 0L; + for (int v : new int[] {1, 2, 3, 4, 5}) { + actual = addToHash(actual, v); + } + assertEquals(expected, actual); + } + + // ----- iterable / array versions ----- + + @Test + void hashIterableMatchesChainedAddToHash() { + Iterable values = Arrays.asList("a", 1, true, null); + long expected = 0L; + for (Object o : values) { + expected = addToHash(expected, o); + } + assertEquals(expected, hash(values)); + } + + @Test + @SuppressWarnings("deprecation") + void deprecatedIntArrayHashMatchesChainedAddToHash() { + int[] hashes = new int[] {7, 13, 31, 1024}; + long expected = 0L; + for (int h : hashes) { + expected = addToHash(expected, h); + } + assertEquals(expected, hash(hashes)); + } + + @Test + @SuppressWarnings("deprecation") + void deprecatedObjectArrayHashMatchesChainedAddToHash() { + Object[] objs = new Object[] {"alpha", 7, null, true}; + long expected = 0L; + for (Object o : objs) { + expected = addToHash(expected, o); + } + assertEquals(expected, hash(objs)); + } + + // ----- intHash null behavior is observable via multi-arg overloads ----- + + @Test + void multiArgHashTreatsNullAsZero() { + // hash(Object,Object) feeds intHash(...) which returns 0 for null. + // Verify: hash(null, "x") == 31L*0 + "x".hashCode() + int xHash = Objects.hashCode("x"); + assertEquals(31L * 0 + xHash, hash(null, "x")); + } +} diff --git a/internal-api/src/test/java/datadog/trace/util/StringsRegionContainsTest.java b/internal-api/src/test/java/datadog/trace/util/StringsRegionContainsTest.java new file mode 100644 index 00000000000..115fcd79a31 --- /dev/null +++ b/internal-api/src/test/java/datadog/trace/util/StringsRegionContainsTest.java @@ -0,0 +1,53 @@ +package datadog.trace.util; + +import static datadog.trace.util.Strings.regionContains; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; + +/** Boundary semantics of {@link Strings#regionContains(String, int, int, String)}. */ +class StringsRegionContainsTest { + + // "abXYZcd": a0 b1 X2 Y3 Z4 c5 d6 -> "XYZ" spans [2,5). + private static final String S = "abXYZcd"; + + @Test + void foundFullyInside() { + assertTrue(regionContains(S, 0, S.length(), "XYZ")); + } + + @Test + void notPresent() { + assertFalse(regionContains(S, 0, S.length(), "QQ")); + } + + @Test + void exactFit() { + // idx == 2, idx + len == 5 == endIndex -> included. + assertTrue(regionContains(S, 2, 5, "XYZ")); + } + + @Test + void straddlingEndIndexExcluded() { + // endIndex == 4 cuts off the trailing 'Z' -> not fully inside. + assertFalse(regionContains(S, 2, 4, "XYZ")); + } + + @Test + void occurrenceBeforeBeginIndexExcluded() { + // beginIndex == 3 starts past the needle's first char -> no occurrence at/after beginIndex. + assertFalse(regionContains(S, 3, S.length(), "XYZ")); + } + + @Test + void emptyRegion() { + assertFalse(regionContains(S, 2, 2, "XYZ")); + } + + @Test + void matchesWholeStringContains() { + assertTrue(regionContains("hello", 0, 5, "ll")); + assertFalse(regionContains("hello", 0, 5, "z")); + } +} diff --git a/internal-api/src/test/java/datadog/trace/util/StringsTest2.java b/internal-api/src/test/java/datadog/trace/util/StringsTest2.java new file mode 100644 index 00000000000..c949da41a5d --- /dev/null +++ b/internal-api/src/test/java/datadog/trace/util/StringsTest2.java @@ -0,0 +1,116 @@ +package datadog.trace.util; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.Iterator; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +public class StringsTest2 { + @Test + @DisplayName("replaceAll - single replace") + public void replaceAllNoReplace() { + assertEquals("foobar", Strings.replaceAll("foobar", "dne", "unchanged")); + } + + @Test + @DisplayName("replaceAll - single replace") + public void replaceAllSingleReplace() { + assertEquals("foobaz", Strings.replaceAll("foobar", "bar", "baz")); + } + + @Test + @DisplayName("replaceAll - single replace") + public void replaceAllMultiReplace() { + assertEquals("foo=baz&quux=baz", Strings.replaceAll("foo=bar&quux=bar", "bar", "baz")); + } + + @Test + @DisplayName("split - empty") + public void splitEmpty() { + Iterator iter = Strings.split("", '&').iterator(); + assertFalse(iter.hasNext()); + } + + @Test + @DisplayName("split - no separator") + public void splitNoSeparator() { + Iterator iter = Strings.split("foo=bar", '&').iterator(); + assertContentEquals("foo=bar", iter.next()); + assertFalse(iter.hasNext()); + } + + @Test + @DisplayName("split - with separator") + public void splitWithSeparator() { + Iterator iter = Strings.split("foo=bar&hello=world", '&').iterator(); + assertContentEquals("foo=bar", iter.next()); + assertContentEquals("hello=world", iter.next()); + assertFalse(iter.hasNext()); + } + + @Test + @DisplayName("split - leading separator") + public void splitLeadingSeparator() { + Iterator iter = Strings.split("&foo=bar", '&').iterator(); + assertSubSeq("", 0, 0, iter.next()); // empty string before the separator + assertSubSeq("foo=bar", 1, 8, iter.next()); + assertFalse(iter.hasNext()); + } + + @Test + @DisplayName("split - trailing separator") + public void splitTrailingSeparator() { + Iterator iter = Strings.split("foo=bar&", '&').iterator(); + assertSubSeq("foo=bar", 0, 7, iter.next()); + assertSubSeq("", 8, 8, iter.next()); // empty string after the separator + assertFalse(iter.hasNext()); + } + + @Test + @DisplayName("split - only separator") + public void splitOnlySeparator() { + Iterator iter = Strings.split("&", '&').iterator(); + assertSubSeq("", 0, 0, iter.next()); // empty string before the separator + assertSubSeq("", 1, 1, iter.next()); // empty string after the separator + assertFalse(iter.hasNext()); + } + + @Test + @DisplayName("split - sanity check") + public void splitSanityCheck() { + String testStr = "foo=bar&hello=world&baz=quux&firstName=Jon&lastName=Doe"; + + String[] strSplit = testStr.split("\\&"); + Iterable iterable = Strings.split(testStr, '&'); + + Iterator iter = iterable.iterator(); + for (String expected : strSplit) { + assertTrue(iter.hasNext()); + assertContentEquals(expected, iter.next()); + } + assertFalse(iter.hasNext()); + + // repeat, just to check iterable functionality + Iterator iter2 = iterable.iterator(); + for (String expected : strSplit) { + assertTrue(iter2.hasNext()); + assertContentEquals(expected, iter2.next()); + } + assertFalse(iter2.hasNext()); + } + + static void assertContentEquals(String expectedStr, SubSequence actualSeq) { + assertTrue(actualSeq.equals(expectedStr), "equals String"); + assertEquals(expectedStr, actualSeq.toString(), "toString"); + } + + static void assertSubSeq( + String expected, int expectedBeginIndex, int expectedEndIndex, SubSequence actualSeq) { + assertContentEquals(expected, actualSeq); + assertEquals(expectedBeginIndex, actualSeq.beginIndex(), "beginIndex"); + assertEquals(expectedEndIndex, actualSeq.endIndex(), "endIndex"); + } +} diff --git a/internal-api/src/test/java/datadog/trace/util/SubSequenceTest.java b/internal-api/src/test/java/datadog/trace/util/SubSequenceTest.java new file mode 100644 index 00000000000..ddb03b3b115 --- /dev/null +++ b/internal-api/src/test/java/datadog/trace/util/SubSequenceTest.java @@ -0,0 +1,260 @@ +package datadog.trace.util; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import org.junit.jupiter.api.Test; + +public class SubSequenceTest { + static final String LOREM_IPSUM = + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."; + + @Test + public void empty() { + SubSequence subSeq = SubSequence.EMPTY; + assertEquals("", subSeq.toString()); + assertEquals("".hashCode(), subSeq.hashCode()); + + StringBuilder builder0 = new StringBuilder(); + builder0.append(subSeq); + assertEquals("", builder0.toString()); + + StringBuilder builder1 = new StringBuilder(); + subSeq.appendTo(builder1); + assertEquals("", builder1.toString()); + } + + @Test + public void emptyTail() { + // This is allowed to represent the logical empty string after a match at the end of + // backing string. There is an important distinction from the canonical empty + // SubSequence which wouldn't have the correct beginIndex / endIndex pair. + SubSequence subSeq = new SubSequence("foo", "foo".length(), "foo".length()); + assertEquals("foo".length(), subSeq.beginIndex()); + assertEquals("foo".length(), subSeq.endIndex()); + assertEquals("", subSeq.toString()); + assertEquals("".hashCode(), subSeq.hashCode()); + + StringBuilder builder0 = new StringBuilder(); + builder0.append(subSeq); + assertEquals("", builder0.toString()); + + StringBuilder builder1 = new StringBuilder(); + subSeq.appendTo(builder1); + assertEquals("", builder1.toString()); + } + + @Test + public void subSequence() { + String str = LOREM_IPSUM; + int len = str.length(); + + for (int i = 0; i < str.length(); i += 100) { + int endIndex = Math.min(i + 100, len); + + String subStr = str.substring(i, endIndex); + CharSequence subCharSeq = str.subSequence(i, endIndex); + SubSequence subSeq = SubSequence.of(str, i, endIndex); + SubSequence altSubSeq = Strings.subSequence(str, i, endIndex); + + assertTrue(subSeq.equals(subStr)); + assertEquals(subStr, subSeq.toString()); + assertEquals(subStr.hashCode(), subSeq.hashCode()); + + assertTrue(subSeq.equals(subCharSeq)); + assertEquals(subCharSeq.toString(), subSeq.toString()); + + assertEquals(subSeq, altSubSeq); + + assertSame(subSeq.toString(), subSeq.toString()); + } + } + + @Test + public void subSequenceToEnd() { + String str = LOREM_IPSUM; + int len = str.length(); + + for (int i = 0; i < str.length(); i += 100) { + String subStr = str.substring(i); + SubSequence subSeq = SubSequence.of(str, i); + SubSequence altSubSeq = Strings.subSequence(str, i); + + assertTrue(subSeq.equals(subStr)); + assertEquals(subStr, subSeq.toString()); + assertEquals(subStr.hashCode(), subSeq.hashCode()); + + assertEquals(subSeq, altSubSeq); + + assertSame(subSeq.toString(), subSeq.toString()); + } + } + + @Test + public void appendToBuilder() { + SubSequence subSeq = SubSequence.of(LOREM_IPSUM, 50, 150); + + StringBuilder expectedBuilder = new StringBuilder(); + expectedBuilder.append(LOREM_IPSUM, 50, 150); + + String expectedStr = expectedBuilder.toString(); + + StringBuilder builder0 = new StringBuilder(); + builder0.append(subSeq); + assertEquals(expectedStr, builder0.toString()); + + StringBuilder builder1 = new StringBuilder(); + subSeq.appendTo(builder1); + assertEquals(expectedStr, builder1.toString()); + } + + @Test + public void contains() { + // "/*ddps='svc',dde='x'*/ rest" -- the comment body "ddps='svc',dde='x'" spans [2, 20). + String s = "/*ddps='svc',dde='x'*/ rest"; + SubSequence comment = SubSequence.of(s, 2, 20); + assertTrue(comment.contains("ddps=")); + assertTrue(comment.contains("dde=")); + assertFalse(comment.contains("ddh=")); + + // View-relative: a needle present in the backing string but outside this view is not found. + SubSequence dde = SubSequence.of(s, 13, 20); // "dde='x'" + assertFalse(dde.contains("ddps=")); // ddps= is before this view's range + } + + @Test + public void subSequenceOfView() { + // Instance subSequence(start, end): start/end are in THIS view's coordinates (CharSequence + // contract), regardless of where the view sits in the backing string. + SubSequence view = SubSequence.of("abcdefghij", 2, 8); // "cdefgh" + SubSequence mid = view.subSequence(1, 4); // chars [1, 4) of "cdefgh" -> "def" + assertEquals("def", mid.toString()); + assertEquals(3, mid.beginIndex()); // absolute begin = 2 + 1 + assertEquals(6, mid.endIndex()); // absolute end = 2 + 4 (NOT 2 + 1 + 4) + + // full window and empty are exact + assertEquals("cdefgh", view.subSequence(0, view.length()).toString()); + assertEquals("", view.subSequence(2, 2).toString()); + + // nested: subSequence of a non-zero-start view stays correct (the case the old bug broke worst) + assertEquals("ef", mid.subSequence(1, 3).toString()); // chars [1, 3) of "def" -> "ef" + } + + @Test + public void equalsString() { + // "call" sits at [6, 10) inside the backing string, flanked by other text. + SubSequence call = SubSequence.of("xxxxx call yyyyy", 6, 10); + assertTrue(call.equals("call")); + assertFalse(call.equals("CALL")); // case-sensitive + assertFalse(call.equals("cal")); // shorter + assertFalse(call.equals("calls")); // longer (would overshoot endIndex) + assertFalse(call.equals((Object) null)); + + // equals(Object) routes a String through the region-compare fast path... + assertTrue(call.equals((Object) "call")); + // ...and any other CharSequence (incl. another SubSequence) through contentEquals. + assertTrue(call.equals((Object) new StringBuilder("call"))); + assertTrue(call.equals((Object) SubSequence.of("xxxxx call yyyyy", 6, 10))); + assertFalse(call.equals((Object) Integer.valueOf(4))); + } + + @Test + public void contentEqualsCharSequence() { + SubSequence call = SubSequence.of("xxxxx call yyyyy", 6, 10); // "call" + assertTrue(call.contentEquals("call")); // String is a CharSequence + assertTrue(call.contentEquals(new StringBuilder("call"))); + assertTrue(call.contentEquals(SubSequence.of("a call b", 2, 6))); + assertFalse(call.contentEquals("CALL")); // case-sensitive + assertFalse(call.contentEquals("cal")); // length mismatch + assertFalse(call.contentEquals(null)); + } + + @Test + public void equalsIgnoreCaseString() { + SubSequence call = SubSequence.of("xxxxx CaLl yyyyy", 6, 10); + assertTrue(call.equalsIgnoreCase("call")); + assertTrue(call.equalsIgnoreCase("CALL")); + assertFalse(call.equalsIgnoreCase("cal")); + assertFalse(call.equalsIgnoreCase("calls")); + assertFalse(call.equalsIgnoreCase(null)); // matches String.equalsIgnoreCase(null) + } + + @Test + public void startsWithString() { + SubSequence view = SubSequence.of("xx{call}xx", 2, 8); // "{call}" + assertTrue(view.startsWith("{")); + assertTrue(view.startsWith("{call")); + assertTrue(view.startsWith("{call}")); + assertFalse(view.startsWith("call")); + assertFalse(view.startsWith("{call}x")); // overshoots endIndex even though backing has 'x' + assertTrue(view.startsWith("")); // empty prefix + } + + @Test + public void endsWithString() { + SubSequence view = SubSequence.of("xx{call}xx", 2, 8); // "{call}" + assertTrue(view.endsWith("}")); + assertTrue(view.endsWith("call}")); + assertTrue(view.endsWith("{call}")); + assertFalse(view.endsWith("call")); + assertFalse(view.endsWith("x{call}")); // undershoots beginIndex even though backing has 'x' + assertTrue(view.endsWith("")); // empty suffix + } + + @Test + public void indexOfString() { + SubSequence view = SubSequence.of("aa-bc-bc-aa", 3, 8); // "bc-bc" + assertEquals(0, view.indexOf("bc")); // window-relative offset of the first occurrence + assertEquals(2, view.indexOf("-bc")); // non-zero relative offset + assertEquals(2, view.indexOf("-")); + assertEquals(-1, view.indexOf("aa")); // present in backing string but outside the window + assertEquals(-1, view.indexOf("bc-bc-")); // overshoots endIndex + } + + @Test + public void lastIndexOfString() { + SubSequence view = SubSequence.of("aa-bc-bc-aa", 3, 8); // "bc-bc" + assertEquals(3, view.lastIndexOf("bc")); // last "bc" -> relative 3 + assertEquals(2, view.lastIndexOf("-")); + assertEquals(-1, view.lastIndexOf("aa")); // outside the window on both ends + assertEquals(-1, view.lastIndexOf("bc-bc-")); // overshoots endIndex + } + + @Test + public void startsWithChar() { + SubSequence view = SubSequence.of("xx{call}xx", 2, 8); // "{call}" + assertTrue(view.startsWith('{')); + assertFalse(view.startsWith('c')); // 'c' is at offset 1, not the start + assertFalse(view.startsWith('x')); // backing char before beginIndex, outside the window + assertFalse(SubSequence.EMPTY.startsWith('x')); // empty window + } + + @Test + public void endsWithChar() { + SubSequence view = SubSequence.of("xx{call}xx", 2, 8); // "{call}" + assertTrue(view.endsWith('}')); + assertFalse(view.endsWith('l')); // 'l' is one before the end + assertFalse(view.endsWith('x')); // backing char at endIndex, outside the window + assertFalse(SubSequence.EMPTY.endsWith('x')); // empty window + } + + @Test + public void indexOfChar() { + SubSequence view = SubSequence.of("aa-bc-bc-aa", 3, 8); // "bc-bc" + assertEquals(0, view.indexOf('b')); // window-relative offset of the first occurrence + assertEquals(1, view.indexOf('c')); + assertEquals(2, view.indexOf('-')); + assertEquals(-1, view.indexOf('a')); // present in backing string but outside the window + } + + @Test + public void lastIndexOfChar() { + SubSequence view = SubSequence.of("aa-bc-bc-aa", 3, 8); // "bc-bc" + assertEquals(3, view.lastIndexOf('b')); // last 'b' -> relative 3 + assertEquals(4, view.lastIndexOf('c')); + assertEquals(2, view.lastIndexOf('-')); + assertEquals(-1, view.lastIndexOf('a')); // outside the window on both ends + } +} diff --git a/internal-api/src/test/java/datadog/trace/util/TempLocationManagerSecurityTest.java b/internal-api/src/test/java/datadog/trace/util/TempLocationManagerSecurityTest.java new file mode 100644 index 00000000000..7906ea0e009 --- /dev/null +++ b/internal-api/src/test/java/datadog/trace/util/TempLocationManagerSecurityTest.java @@ -0,0 +1,145 @@ +package datadog.trace.util; + +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assumptions.assumeTrue; + +import datadog.trace.api.config.ProfilingConfig; +import datadog.trace.api.time.SystemTimeSource; +import java.io.IOException; +import java.nio.file.FileSystems; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.attribute.PosixFilePermission; +import java.nio.file.attribute.PosixFilePermissions; +import java.util.Properties; +import java.util.Set; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; + +/** + * Security tests for {@link TempLocationManager} ownership and permission validation. + * + *

      All tests are POSIX-only; skipped automatically on non-POSIX file systems. + */ +public class TempLocationManagerSecurityTest { + + @TempDir Path baseDir; + + @BeforeEach + void requirePosix() { + assumeTrue( + FileSystems.getDefault().supportedFileAttributeViews().contains("posix"), + "Skipping POSIX-only security tests on non-POSIX file system"); + } + + @Test + void freshTempDirIsCreatedWithOwnerOnlyPermissions() throws Exception { + TempLocationManager mgr = instance(baseDir); + Path tempDir = mgr.getTempDir(); + assertNotNull(tempDir); + assertTrue0700(tempDir); + } + + @Test + void preExistingOwnerOwnedSecureDirIsAccepted() throws Exception { + // Create the full per-process tree with 0700 before constructing the manager + Path baseTempSubdir = baseDir.resolve(TempLocationManager.getBaseTempDirName()); + Files.createDirectories( + baseTempSubdir, + PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rwx------"))); + + String pid = PidHelper.getPid(); + Path pidDir = baseTempSubdir.resolve("pid_" + pid); + Files.createDirectories( + pidDir, PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rwx------"))); + + // Manager must not throw and must return the pre-existing dir + TempLocationManager mgr = assertDoesNotThrow(() -> instance(baseDir)); + Path tempDir = mgr.getTempDir(); + assertNotNull(tempDir); + } + + @ParameterizedTest + @ValueSource(strings = {"rwxrwxrwx", "rwxr-xr-x", "rwxrwx---"}) + void preExistingDirWithGroupWorldBitsIsRejected(String perms) throws Exception { + Path baseTempSubdir = baseDir.resolve(TempLocationManager.getBaseTempDirName()); + Files.createDirectories( + baseTempSubdir, + PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString(perms))); + + assertThrows(IllegalStateException.class, () -> instance(baseDir)); + } + + @ParameterizedTest + @ValueSource(strings = {"rwxrwxrwx", "rwxr-xr-x", "rwxrwx---"}) + void preExistingPidDirWithGroupWorldBitsIsRejected(String perms) throws Exception { + // Create baseTempSubdir with secure perms, but the pid subdir with insecure perms + Path baseTempSubdir = baseDir.resolve(TempLocationManager.getBaseTempDirName()); + Files.createDirectories( + baseTempSubdir, + PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rwx------"))); + + String pid = PidHelper.getPid(); + Path pidDir = baseTempSubdir.resolve("pid_" + pid); + Files.createDirectories( + pidDir, PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString(perms))); + + assertThrows(IllegalStateException.class, () -> instance(baseDir)); + } + + @Test + void getTempDirWithExistingSubdirGroupWorldBitsIsRejected() throws Exception { + // First build a clean tree so the manager initialises without error + TempLocationManager mgr = instance(baseDir); + Path tempDir = mgr.getTempDir(); + + // Now plant an insecure subdir + Path subDir = tempDir.resolve("sub"); + Files.createDirectories( + subDir, PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rwxrwxrwx"))); + + // getTempDir(subPath, false) should detect group/world bits and throw + assertThrows( + IllegalStateException.class, () -> mgr.getTempDir(tempDir.relativize(subDir), false)); + } + + @Test + void nonPosixBehaviourIsUnchanged() { + // Guard already applied in @BeforeEach; if we reach here the FS is POSIX. + // The non-POSIX case is covered by the assumeTrue skip above. + // Nothing to assert — the test documents the requirement. + } + + private TempLocationManager instance(Path base) { + Properties props = new Properties(); + props.put(ProfilingConfig.PROFILING_TEMP_DIR, base.toString()); + props.put(ProfilingConfig.PROFILING_UPLOAD_PERIOD, "0"); + return new TempLocationManager( + datadog.trace.bootstrap.config.provider.ConfigProvider.withPropertiesOverride(props), + false, + TempLocationManager.CleanupHook.EMPTY, + SystemTimeSource.INSTANCE); + } + + private static void assertTrue0700(Path dir) throws IOException { + Set perms = Files.getPosixFilePermissions(dir); + for (PosixFilePermission bit : + new PosixFilePermission[] { + PosixFilePermission.GROUP_READ, + PosixFilePermission.GROUP_WRITE, + PosixFilePermission.GROUP_EXECUTE, + PosixFilePermission.OTHERS_READ, + PosixFilePermission.OTHERS_WRITE, + PosixFilePermission.OTHERS_EXECUTE + }) { + if (perms.contains(bit)) { + throw new AssertionError("Expected 0700 but found group/world bit " + bit + " on " + dir); + } + } + } +} diff --git a/internal-api/src/test/java/datadog/trace/util/TempLocationManagerTest.java b/internal-api/src/test/java/datadog/trace/util/TempLocationManagerTest.java index 4876bf29f98..af22b5fe804 100644 --- a/internal-api/src/test/java/datadog/trace/util/TempLocationManagerTest.java +++ b/internal-api/src/test/java/datadog/trace/util/TempLocationManagerTest.java @@ -139,7 +139,9 @@ void testConcurrentCleanup(String section) throws Exception { Path fakeTempDir = baseDir.resolve(TempLocationManager.getBaseTempDirName() + "/pid_fake/scratch"); - Files.createDirectories(fakeTempDir); + Files.createDirectories( + fakeTempDir, + PosixFilePermissions.asFileAttribute(PosixFilePermissions.fromString("rwx------"))); Path fakeTempFile = fakeTempDir.resolve("libxxx.so"); Files.createFile(fakeTempFile); diff --git a/metadata/agent-jar-checks.properties b/metadata/agent-jar-checks.properties new file mode 100644 index 00000000000..fd04d637e35 --- /dev/null +++ b/metadata/agent-jar-checks.properties @@ -0,0 +1,220 @@ +# Agent jar structural invariants — edit intentionally, commit with the change that justified it. + +# Max agent jar size in bytes. Raise only when the size growth is intentional (33 MiB = 34603008). +jar.size.budget = 34603008 + +# Minimum combined class + classdata count in the assembled agent jar. +# Set to ~98% of the actual count at the time of the last intentional change. +# At time of writing: guard 17000 / actual 17279 +classes.minimum.guard = 17000 + +# BEGIN expected.integrations -- Regenerated by: ./gradlew :dd-java-agent:updateAgentJarIntegrationsGoldenFile +expected.integrations = IastInstrumentation,\ + aerospike,\ + akka-http,\ + akka-http2,\ + akka_actor_mailbox,\ + akka_actor_receive,\ + akka_actor_send,\ + akka_concurrent,\ + allocatedirect,\ + amqp,\ + apache-httpclient,\ + armeria-grpc-client,\ + armeria-grpc-server,\ + armeria-jetty,\ + avro,\ + aws-lambda,\ + aws-sdk,\ + axis2,\ + axway-api,\ + azure-functions,\ + caffeine,\ + cassandra,\ + ci-visibility,\ + cics,\ + classloading,\ + commons-fileupload,\ + commons-http-client,\ + confluent-schema-registry,\ + couchbase,\ + cucumber,\ + cxf,\ + datanucleus,\ + defineclass,\ + dropwizard,\ + dynamodb,\ + elasticsearch,\ + emr-aws-sdk,\ + eventbridge,\ + ffm-native-tracing,\ + finatra,\ + freemarker,\ + gax,\ + glassfish,\ + google-http-client,\ + google-pubsub,\ + gradle,\ + graphql-java,\ + grizzly,\ + grizzly-client,\ + grizzly-filterchain,\ + grpc,\ + gson,\ + guava,\ + hazelcast,\ + hazelcast_legacy,\ + hibernate,\ + httpasyncclient,\ + httpasyncclient5,\ + httpclient,\ + httpclient5,\ + httpcore,\ + httpcore-5,\ + httpurlconnection,\ + hystrix,\ + ignite,\ + inputStream,\ + jackson,\ + jackson-core,\ + jacoco,\ + jakarta-jms,\ + jakarta-mail,\ + jakarta-rs,\ + jakarta-websocket,\ + jakarta-ws,\ + java-http-client,\ + java-lang,\ + java-lang-appsec,\ + java-lang-management,\ + java-module,\ + java-net,\ + java_completablefuture,\ + java_concurrent,\ + java_timer,\ + javax-mail,\ + javax-websocket,\ + jax-rs,\ + jax-ws,\ + jboss-logmanager,\ + jdbc,\ + jdbc-datasource,\ + jedis,\ + jersey,\ + jetty,\ + jetty-client,\ + jetty-concurrent,\ + jms,\ + jni,\ + jsp,\ + jwt,\ + kafka,\ + kotlin_coroutine,\ + lettuce,\ + liberty,\ + log4j,\ + logback,\ + maven,\ + micronaut,\ + mmap,\ + mongo,\ + mule,\ + native-image,\ + netty,\ + netty-concurrent,\ + netty-promise,\ + not-not-trace,\ + ognl,\ + okhttp,\ + openai-java,\ + opensearch,\ + opentelemetry-annotations,\ + opentelemetry-beta,\ + opentelemetry-logs,\ + opentelemetry-metrics,\ + opentelemetry.experimental,\ + opentracing,\ + org-json,\ + pekko-http,\ + pekko-http2,\ + pekko_actor_mailbox,\ + pekko_actor_receive,\ + pekko_actor_send,\ + play,\ + play-ws,\ + protobuf,\ + quartz,\ + ratpack,\ + ratpack-request-body,\ + reactive-streams,\ + reactor-core,\ + reactor-netty,\ + rediscala,\ + redisson,\ + renaissance,\ + resilience4j,\ + resilience4j-reactor,\ + resteasy,\ + restlet-http,\ + rmi,\ + rxjava,\ + s3,\ + scala_concurrent,\ + servicetalk,\ + servlet,\ + servlet-filter,\ + servlet-request-body,\ + servlet-service,\ + sfn,\ + shutdown,\ + slick,\ + snakeyaml,\ + sns,\ + socket,\ + sofarpc,\ + spark,\ + spark-executor,\ + spark-exit,\ + spark-launcher,\ + spark-openlineage,\ + sparkjava,\ + spray-http,\ + spring-async,\ + spring-beans,\ + spring-boot,\ + spring-boot-span-origin,\ + spring-cloud-zuul,\ + spring-core,\ + spring-data,\ + spring-jms,\ + spring-messaging,\ + spring-rabbit,\ + spring-scheduling,\ + spring-security,\ + spring-web,\ + spring-web-code-origin,\ + spring-webflux,\ + spring-ws,\ + spymemcached,\ + sqs,\ + sslsocket,\ + synapse3-client,\ + synapse3-server,\ + testng,\ + throwables,\ + thymeleaf,\ + tibco,\ + tinylog,\ + tomcat,\ + trace,\ + twilio-sdk,\ + undertow,\ + urlconnection,\ + valkey,\ + velocity,\ + vertx,\ + wallclock,\ + websphere-jmx,\ + wildfly,\ + zio.experimental +# END expected.integrations diff --git a/metadata/supported-configurations.json b/metadata/supported-configurations.json index 8db93e05399..d6b02fbfa28 100644 --- a/metadata/supported-configurations.json +++ b/metadata/supported-configurations.json @@ -129,6 +129,14 @@ "aliases": [] } ], + "DD_API_SECURITY_DOWNSTREAM_BODY_ANALYSIS_SAMPLE_RATE": [ + { + "version": "A", + "type": "decimal", + "default": "0.5", + "aliases": [] + } + ], "DD_API_SECURITY_DOWNSTREAM_REQUEST_ANALYSIS_SAMPLE_RATE": [ { "version": "A", @@ -233,6 +241,14 @@ "aliases": [] } ], + "DD_APPSEC_AGENTIC_ONBOARDING": [ + { + "version": "A", + "type": "string", + "default": "", + "aliases": [] + } + ], "DD_APPSEC_AUTOMATED_USER_EVENTS_TRACKING": [ { "version": "C", @@ -361,22 +377,6 @@ "aliases": [] } ], - "DD_APPSEC_REPORTING_INBAND": [ - { - "version": "A", - "type": "boolean", - "default": "false", - "aliases": [] - } - ], - "DD_APPSEC_REPORT_TIMEOUT": [ - { - "version": "A", - "type": "int", - "default": "60", - "aliases": [] - } - ], "DD_APPSEC_RULES": [ { "version": "C", @@ -393,6 +393,14 @@ "aliases": [] } ], + "DD_APPSEC_SCA_MAX_TRACKED_DEPENDENCIES": [ + { + "version": "A", + "type": "int", + "default": "1000", + "aliases": [] + } + ], "DD_APPSEC_STACKTRACE_ENABLED": [ { "version": "A", @@ -747,9 +755,9 @@ ], "DD_CIVISIBILITY_JACOCO_PLUGIN_VERSION": [ { - "version": "A", + "version": "B", "type": "string", - "default": "0.8.14", + "default": "0.8.15", "aliases": [] } ], @@ -913,6 +921,14 @@ "aliases": [] } ], + "DD_CODE_COVERAGE_FLAGS": [ + { + "version": "A", + "type": "string", + "default": null, + "aliases": [] + } + ], "DD_CODE_ORIGIN_FOR_SPANS_ENABLED": [ { "version": "B", @@ -971,9 +987,9 @@ ], "DD_CRASHTRACKING_ERRORS_INTAKE_ENABLED": [ { - "version": "A", + "version": "B", "type": "boolean", - "default": "false", + "default": "true", "aliases": [] } ], @@ -1033,6 +1049,14 @@ "aliases": [] } ], + "DD_CUSTOM_PARENT_ID": [ + { + "version": "A", + "type": "string", + "default": null, + "aliases": [] + } + ], "DD_CUSTOM_TRACE_ID": [ { "version": "A", @@ -1217,11 +1241,27 @@ "aliases": ["DD_JMXFETCH_START_DELAY"] } ], - "DD_DYNAMIC_INSTRUMENTATION_CAPTURE_TIMEOUT": [ + "DD_INTERNAL_DYNAMIC_INSTRUMENTATION_TIMEOUT_CHECKER_MODE": [ { "version": "A", + "type": "string", + "default": "WALL", + "aliases": [] + } + ], + "DD_DYNAMIC_INSTRUMENTATION_CAPTURE_TIMEOUT_MS": [ + { + "version": "B", "type": "int", "default": "100", + "aliases": ["DD_DYNAMIC_INSTRUMENTATION_CAPTURE_TIMEOUT"] + } + ], + "DD_DYNAMIC_INSTRUMENTATION_EVALUATION_TIMEOUT_MS": [ + { + "version": "A", + "type": "int", + "default": "50", "aliases": [] } ], @@ -1481,6 +1521,14 @@ "aliases": [] } ], + "DD_EXPERIMENTAL_FLAGGING_PROVIDER_SPAN_ENRICHMENT_ENABLED": [ + { + "version": "A", + "type": "boolean", + "default": "false", + "aliases": [] + } + ], "DD_EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED": [ { "version": "B", @@ -2409,19 +2457,19 @@ "aliases": [] } ], - "DD_OBFUSCATION_QUERY_STRING_REGEXP": [ + "DD_METRICS_OTEL_EXPERIMENTAL_ENABLED": [ { "version": "A", - "type": "string", - "default": null, + "type": "boolean", + "default": "true", "aliases": [] } ], - "DD_OPTIMIZED_MAP_ENABLED": [ + "DD_OBFUSCATION_QUERY_STRING_REGEXP": [ { "version": "A", - "type": "boolean", - "default": "false", + "type": "string", + "default": null, "aliases": [] } ], @@ -3097,6 +3145,14 @@ "aliases": [] } ], + "DD_PROFILING_EXPERIMENTAL_ASYNC_JMETHODID_OPTIM_ENABLED": [ + { + "version": "A", + "type": "boolean", + "default": "false", + "aliases": [] + } + ], "DD_PROFILING_EXPERIMENTAL_ASYNC_SCHEDULING_EVENT": [ { "version": "A", @@ -3121,6 +3177,14 @@ "aliases": [] } ], + "DD_PROFILING_EXPERIMENTAL_DDPROF_JMETHODID_OPTIM_ENABLED": [ + { + "version": "A", + "type": "boolean", + "default": "false", + "aliases": [] + } + ], "DD_PROFILING_EXPERIMENTAL_DDPROF_SCHEDULING_EVENT": [ { "version": "A", @@ -5753,6 +5817,22 @@ "aliases": ["DD_TRACE_INTEGRATION_FREEMARKER_ENABLED", "DD_INTEGRATION_FREEMARKER_ENABLED"] } ], + "DD_TRACE_GAX_1_4_ENABLED": [ + { + "version": "A", + "type": "boolean", + "default": "true", + "aliases": ["DD_TRACE_INTEGRATION_GAX_1_4_ENABLED", "DD_INTEGRATION_GAX_1_4_ENABLED"] + } + ], + "DD_TRACE_GAX_ENABLED": [ + { + "version": "A", + "type": "boolean", + "default": "true", + "aliases": ["DD_TRACE_INTEGRATION_GAX_ENABLED", "DD_INTEGRATION_GAX_ENABLED"] + } + ], "DD_TRACE_GIT_METADATA_ENABLED": [ { "version": "A", @@ -7481,14 +7561,6 @@ "aliases": ["DD_JMXFETCH_WEBSPHERE_ENABLED"] } ], - "DD_TRACE_JMXFETCH_{CHECK_NAME}_ENABLED": [ - { - "version": "B", - "type": "boolean", - "default": "false", - "aliases": ["DD_JMXFETCH_{CHECK_NAME}_ENABLED"] - } - ], "DD_TRACE_JMX_TAGS": [ { "version": "A", @@ -8601,6 +8673,46 @@ "aliases": [] } ], + "DD_TRACE_OTEL_SEMANTICS_ENABLED": [ + { + "version": "A", + "type": "boolean", + "default": "false", + "aliases": [] + } + ], + "DD_OTEL_TRACES_SPAN_METRICS_ENABLED": [ + { + "version": "A", + "type": "boolean", + "default": null, + "aliases": [] + } + ], + "DD_TRACE_ORG_GUARD_ENABLED": [ + { + "version": "A", + "type": "boolean", + "default": "false", + "aliases": [] + } + ], + "DD_TRACE_ORG_GUARD_STRICT": [ + { + "version": "A", + "type": "boolean", + "default": "false", + "aliases": [] + } + ], + "DD_TRACE_ORG_GUARD_TRUSTED_OPMS": [ + { + "version": "A", + "type": "array", + "default": null, + "aliases": [] + } + ], "DD_TRACE_PARTIAL_FLUSH_ENABLED": [ { "version": "B", @@ -9473,6 +9585,14 @@ "aliases": ["DD_TRACE_INTEGRATION_RMI_ENABLED", "DD_INTEGRATION_RMI_ENABLED"] } ], + "DD_TRACE_ROBOLECTRIC_ENABLED": [ + { + "version": "A", + "type": "boolean", + "default": "true", + "aliases": ["DD_TRACE_INTEGRATION_ROBOLECTRIC_ENABLED", "DD_INTEGRATION_ROBOLECTRIC_ENABLED"] + } + ], "DD_TRACE_RMI_SERVER_ANALYTICS_ENABLED": [ { "version": "A", @@ -9537,6 +9657,14 @@ "aliases": ["DD_TRACE_INTEGRATION_RXJAVA_ENABLED", "DD_INTEGRATION_RXJAVA_ENABLED"] } ], + "DD_TRACE_RXJAVA_3_ENABLED": [ + { + "version": "A", + "type": "boolean", + "default": "true", + "aliases": ["DD_TRACE_INTEGRATION_RXJAVA_3_ENABLED", "DD_INTEGRATION_RXJAVA_3_ENABLED"] + } + ], "DD_TRACE_S3_ENABLED": [ { "version": "A", @@ -10585,6 +10713,14 @@ "aliases": ["DD_TRACE_TRACER_METRICS_ENABLED"] } ], + "DD_TRACE_STATS_CARDINALITY_LIMIT": [ + { + "version": "B", + "type": "int", + "default": "2048", + "aliases": ["DD_TRACE_TRACER_METRICS_MAX_AGGREGATES"] + } + ], "DD_TRACE_STATS_COMPUTATION_IGNORE_AGENT_VERSION": [ { "version": "A", @@ -10593,6 +10729,30 @@ "aliases": [] } ], + "DD_TRACE_STATS_RESOURCE_CARDINALITY_LIMIT": [ + { + "version": "A", + "type": "int", + "default": "1024", + "aliases": [] + } + ], + "DD_TRACE_STATS_HTTP_ENDPOINT_CARDINALITY_LIMIT": [ + { + "version": "A", + "type": "int", + "default": "512", + "aliases": [] + } + ], + "DD_TRACE_STATS_PEER_TAGS_CARDINALITY_LIMIT": [ + { + "version": "A", + "type": "int", + "default": "512", + "aliases": [] + } + ], "DD_TRACE_STATUS404DECORATOR_ENABLED": [ { "version": "A", @@ -10907,9 +11067,9 @@ ], "DD_TRACE_TRACER_METRICS_MAX_PENDING": [ { - "version": "A", + "version": "B", "type": "int", - "default": "2048", + "default": "128", "aliases": [] } ], @@ -11481,6 +11641,14 @@ "aliases": [] } ], + "OTEL_INSTRUMENTATION_RUNTIME_TELEMETRY_EMIT_EXPERIMENTAL_METRICS": [ + { + "version": "A", + "type": "boolean", + "default": "true", + "aliases": [] + } + ], "OTEL_JAVAAGENT_CONFIGURATION_FILE": [ { "version": "A", @@ -11561,6 +11729,14 @@ "aliases": [] } ], + "OTEL_TRACES_SPAN_METRICS_ENABLED": [ + { + "version": "A", + "type": "boolean", + "default": null, + "aliases": [] + } + ], "OTEL_TRACES_SAMPLER_ARG": [ { "version": "C", @@ -11784,6 +11960,14 @@ "default": "true", "aliases": ["DD_TRACE_INTEGRATION_JAVA_MODULE_ENABLED", "DD_INTEGRATION_JAVA_MODULE_ENABLED"] } + ], + "DD_DETAILED_INSTRUMENTATION_ERRORS": [ + { + "version": "A", + "type": "boolean", + "default": null, + "aliases": [] + } ] }, "deprecations": {} diff --git a/products/feature-flagging/feature-flagging-agent/build.gradle.kts b/products/feature-flagging/feature-flagging-agent/build.gradle.kts index bdf439bd9e4..a219a48456c 100644 --- a/products/feature-flagging/feature-flagging-agent/build.gradle.kts +++ b/products/feature-flagging/feature-flagging-agent/build.gradle.kts @@ -1,13 +1,15 @@ +import com.github.jengelman.gradle.plugins.shadow.tasks.DependencyFilter import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar +import org.gradle.api.Action import org.gradle.kotlin.dsl.project plugins { `java-library` id("com.gradleup.shadow") + id("dd-trace-java.version-file") } apply(from = "$rootDir/gradle/java.gradle") -apply(from = "$rootDir/gradle/version.gradle") description = "Feature flagging agent system" @@ -16,6 +18,8 @@ dependencies { api(project(":products:feature-flagging:feature-flagging-lib")) api(project(":internal-api")) + testImplementation(libs.bundles.junit5) + testImplementation(libs.bundles.mockito) testImplementation(project(":utils:test-utils")) testRuntimeOnly(project(":dd-trace-core")) } @@ -23,8 +27,7 @@ dependencies { tasks.named("shadowJar") { dependencies { val deps = project.extra["deps"] as Map<*, *> - val excludeShared = deps["excludeShared"] as groovy.lang.Closure<*> - excludeShared.delegate = this - excludeShared.call() + val excludeShared = deps["excludeShared"] as Action + excludeShared.execute(this) } } diff --git a/products/feature-flagging/feature-flagging-agent/gradle.lockfile b/products/feature-flagging/feature-flagging-agent/gradle.lockfile index 1390991608b..cbba7800508 100644 --- a/products/feature-flagging/feature-flagging-agent/gradle.lockfile +++ b/products/feature-flagging/feature-flagging-agent/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :products:feature-flagging:feature-flagging-agent:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -11,21 +12,21 @@ com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,tes com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okio:okio:1.17.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc @@ -35,8 +36,8 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -59,10 +60,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.jctools:jctools-core-jdk11:4.0.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -74,19 +75,23 @@ org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntime org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath -org.mockito:mockito-core:4.4.0=testRuntimeClasspath +org.mockito:mockito-core:4.4.0=testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt org.ow2.asm:asm-commons:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt org.ow2.asm:asm-tree:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt org.ow2.asm:asm:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/products/feature-flagging/feature-flagging-agent/src/main/java/com/datadog/featureflag/FeatureFlaggingSystem.java b/products/feature-flagging/feature-flagging-agent/src/main/java/com/datadog/featureflag/FeatureFlaggingSystem.java index 02689767bad..9761caf3895 100644 --- a/products/feature-flagging/feature-flagging-agent/src/main/java/com/datadog/featureflag/FeatureFlaggingSystem.java +++ b/products/feature-flagging/feature-flagging-agent/src/main/java/com/datadog/featureflag/FeatureFlaggingSystem.java @@ -11,6 +11,7 @@ public class FeatureFlaggingSystem { private static volatile RemoteConfigService CONFIG_SERVICE; private static volatile ExposureWriter EXPOSURE_WRITER; + private static volatile SpanEnrichmentWriter SPAN_ENRICHMENT_WRITER; private FeatureFlaggingSystem() {} @@ -27,10 +28,22 @@ public static void start(final SharedCommunicationObjects sco) { EXPOSURE_WRITER = new ExposureWriterImpl(sco, config); EXPOSURE_WRITER.init(); + // APM span enrichment: agent-side listener for flag-evaluation seam events. Uses the process- + // wide singleton so a subsystem restart reuses the one already-registered trace interceptor + // (which the tracer cannot remove) instead of registering a second, rejected one. Cheap: it + // only accumulates once the provider's gate-on capture hook dispatches events, and registers + // its interceptor lazily on the first such event. + SPAN_ENRICHMENT_WRITER = SpanEnrichmentWriter.getInstance(); + SPAN_ENRICHMENT_WRITER.init(); + LOGGER.debug("Feature Flagging system started"); } public static void stop() { + if (SPAN_ENRICHMENT_WRITER != null) { + SPAN_ENRICHMENT_WRITER.close(); + SPAN_ENRICHMENT_WRITER = null; + } if (EXPOSURE_WRITER != null) { EXPOSURE_WRITER.close(); EXPOSURE_WRITER = null; diff --git a/products/feature-flagging/feature-flagging-agent/src/test/groovy/com/datadog/featureflag/FeatureFlaggingSystemTest.groovy b/products/feature-flagging/feature-flagging-agent/src/test/groovy/com/datadog/featureflag/FeatureFlaggingSystemTest.groovy deleted file mode 100644 index 32510d313d0..00000000000 --- a/products/feature-flagging/feature-flagging-agent/src/test/groovy/com/datadog/featureflag/FeatureFlaggingSystemTest.groovy +++ /dev/null @@ -1,60 +0,0 @@ -package com.datadog.featureflag - -import datadog.communication.ddagent.DDAgentFeaturesDiscovery -import datadog.communication.ddagent.SharedCommunicationObjects -import datadog.remoteconfig.Capabilities -import datadog.remoteconfig.ConfigurationDeserializer -import datadog.remoteconfig.ConfigurationPoller -import datadog.remoteconfig.Product -import datadog.trace.api.Config -import datadog.trace.test.util.DDSpecification -import okhttp3.HttpUrl - -class FeatureFlaggingSystemTest extends DDSpecification { - - void 'test feature flag system initialization'() { - setup: - final poller = Mock(ConfigurationPoller) - final discovery = Stub(DDAgentFeaturesDiscovery) { - discoverIfOutdated() >> {} - supportsEvpProxy() >> { return true } - } - final sco = Stub(SharedCommunicationObjects) { - configurationPoller(_ as Config) >> poller - featuresDiscovery(_ as Config) >> discovery - } - sco.featuresDiscovery = discovery - sco.agentUrl = HttpUrl.get('http://localhost') - - when: - FeatureFlaggingSystem.start(sco) - - then: - 1 * poller.addCapabilities(Capabilities.CAPABILITY_FFE_FLAG_CONFIGURATION_RULES) - 1 * poller.addListener(Product.FFE_FLAGS, _ as ConfigurationDeserializer, _) - 1 * poller.start() - - when: - FeatureFlaggingSystem.stop() - - then: - 1 * poller.removeCapabilities(Capabilities.CAPABILITY_FFE_FLAG_CONFIGURATION_RULES) - 1 * poller.removeListeners(Product.FFE_FLAGS) - 1 * poller.stop() - } - - void 'test that remote config is required'() { - setup: - injectSysConfig('remote_configuration.enabled', 'false') - final sco = Mock(SharedCommunicationObjects) - - when: - FeatureFlaggingSystem.start(sco) - - then: - thrown(IllegalStateException) - - cleanup: - FeatureFlaggingSystem.stop() - } -} diff --git a/products/feature-flagging/feature-flagging-agent/src/test/java/com/datadog/featureflag/FeatureFlaggingSystemTest.java b/products/feature-flagging/feature-flagging-agent/src/test/java/com/datadog/featureflag/FeatureFlaggingSystemTest.java new file mode 100644 index 00000000000..a78e3fb9e49 --- /dev/null +++ b/products/feature-flagging/feature-flagging-agent/src/test/java/com/datadog/featureflag/FeatureFlaggingSystemTest.java @@ -0,0 +1,63 @@ +package com.datadog.featureflag; + +import static datadog.trace.api.config.RemoteConfigConfig.REMOTE_CONFIGURATION_ENABLED; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import datadog.communication.ddagent.DDAgentFeaturesDiscovery; +import datadog.communication.ddagent.SharedCommunicationObjects; +import datadog.remoteconfig.Capabilities; +import datadog.remoteconfig.ConfigurationDeserializer; +import datadog.remoteconfig.ConfigurationPoller; +import datadog.remoteconfig.Product; +import datadog.trace.api.Config; +import datadog.trace.test.junit.utils.config.WithConfig; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import org.junit.jupiter.api.Test; + +class FeatureFlaggingSystemTest { + + @Test + void testFeatureFlagSystemInitialization() { + ConfigurationPoller poller = mock(ConfigurationPoller.class); + DDAgentFeaturesDiscovery discovery = mock(DDAgentFeaturesDiscovery.class); + SharedCommunicationObjects sharedCommunicationObjects = mock(SharedCommunicationObjects.class); + when(discovery.supportsEvpProxy()).thenReturn(true); + when(discovery.getEvpProxyEndpoint()).thenReturn("/evp_proxy/"); + when(sharedCommunicationObjects.configurationPoller(any(Config.class))).thenReturn(poller); + when(sharedCommunicationObjects.featuresDiscovery(any(Config.class))).thenReturn(discovery); + sharedCommunicationObjects.agentUrl = HttpUrl.get("http://localhost"); + sharedCommunicationObjects.agentHttpClient = new OkHttpClient.Builder().build(); + + FeatureFlaggingSystem.start(sharedCommunicationObjects); + + verify(poller).addCapabilities(Capabilities.CAPABILITY_FFE_FLAG_CONFIGURATION_RULES); + verify(poller).addListener(eq(Product.FFE_FLAGS), any(ConfigurationDeserializer.class), any()); + verify(poller).start(); + + FeatureFlaggingSystem.stop(); + + verify(poller).removeCapabilities(Capabilities.CAPABILITY_FFE_FLAG_CONFIGURATION_RULES); + verify(poller).removeListeners(Product.FFE_FLAGS); + verify(poller).stop(); + } + + @Test + @WithConfig(key = REMOTE_CONFIGURATION_ENABLED, value = "false") + void testThatRemoteConfigIsRequired() { + SharedCommunicationObjects sharedCommunicationObjects = mock(SharedCommunicationObjects.class); + + try { + assertThrows( + IllegalStateException.class, + () -> FeatureFlaggingSystem.start(sharedCommunicationObjects)); + } finally { + FeatureFlaggingSystem.stop(); + } + } +} diff --git a/products/feature-flagging/feature-flagging-api/README.md b/products/feature-flagging/feature-flagging-api/README.md index 5d1beece1ca..47733020559 100644 --- a/products/feature-flagging/feature-flagging-api/README.md +++ b/products/feature-flagging/feature-flagging-api/README.md @@ -18,22 +18,27 @@ The OpenFeature SDK (`dev.openfeature:sdk`) is included as a transitive dependen ### Evaluation metrics (optional) -To enable evaluation metrics (`feature_flag.evaluations` counter), add the OpenTelemetry SDK dependencies: +To enable evaluation metrics (`feature_flag.evaluations` counter), enable the Datadog Java agent's +OpenTelemetry metrics pipeline: + +```shell +DD_METRICS_OTEL_ENABLED=true +``` + +The provider records metrics through the OpenTelemetry Metrics API. Add `opentelemetry-api` if your +application does not already use the OpenTelemetry API for custom metrics: ```xml io.opentelemetry - opentelemetry-sdk-metrics - 1.47.0 - - - io.opentelemetry - opentelemetry-exporter-otlp + opentelemetry-api 1.47.0 ``` -Any OpenTelemetry API 1.x version is compatible. If these dependencies are absent, the provider operates normally without metrics. +The OpenTelemetry SDK and OTLP exporter are not required on the application classpath. The Datadog +Java agent collects the API metric and exports it through the same OTLP pipeline as other custom OTel +metrics. ## Usage @@ -52,15 +57,20 @@ boolean enabled = client.getBooleanValue("my-feature", false, ## Evaluation metrics -When the OTel SDK dependencies are on the classpath, the provider records a `feature_flag.evaluations` counter via OTLP HTTP/protobuf. Metrics are exported every 10 seconds to the Datadog Agent's OTLP receiver. +When `DD_METRICS_OTEL_ENABLED=true` and the OpenTelemetry API is on the classpath, the provider +records a `feature_flag.evaluations` counter. The Datadog Java agent exports it to the Datadog +Agent's OTLP receiver using the configured OpenTelemetry metrics export interval. ### Configuration -| Environment variable | Description | Default | -|---|---|---| -| `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` | Signal-specific OTLP endpoint (used as-is) | — | -| `OTEL_EXPORTER_OTLP_ENDPOINT` | Generic OTLP endpoint (`/v1/metrics` appended) | — | -| (none set) | Default endpoint | `http://localhost:4318/v1/metrics` | +Configure the OTLP endpoint and protocol using the standard Datadog Java agent OpenTelemetry metrics +settings. For example, to export metrics over OTLP/gRPC: + +```shell +DD_METRICS_OTEL_ENABLED=true +OTEL_EXPORTER_OTLP_ENDPOINT=http://:4317 +OTEL_EXPORTER_OTLP_PROTOCOL=grpc +``` ### Metric attributes diff --git a/products/feature-flagging/feature-flagging-api/build.gradle.kts b/products/feature-flagging/feature-flagging-api/build.gradle.kts index 1c368d51b51..88531ceaeed 100644 --- a/products/feature-flagging/feature-flagging-api/build.gradle.kts +++ b/products/feature-flagging/feature-flagging-api/build.gradle.kts @@ -44,19 +44,16 @@ dependencies { api("dev.openfeature:sdk:1.20.1") compileOnly(project(":products:feature-flagging:feature-flagging-bootstrap")) + compileOnly(project(":products:feature-flagging:feature-flagging-config")) compileOnly(project(":utils:config-utils")) compileOnly("io.opentelemetry:opentelemetry-api:1.47.0") - compileOnly("io.opentelemetry:opentelemetry-sdk-metrics:1.47.0") - compileOnly("io.opentelemetry:opentelemetry-exporter-otlp:1.47.0") testImplementation(project(":products:feature-flagging:feature-flagging-bootstrap")) + testImplementation(project(":utils:config-utils")) testImplementation("io.opentelemetry:opentelemetry-api:1.47.0") - testImplementation("io.opentelemetry:opentelemetry-sdk-metrics:1.47.0") - testImplementation("io.opentelemetry:opentelemetry-exporter-otlp:1.47.0") testImplementation(libs.bundles.junit5) testImplementation(libs.bundles.mockito) testImplementation(libs.moshi) - testImplementation("io.opentelemetry:opentelemetry-sdk-testing:1.47.0") testImplementation("org.awaitility:awaitility:4.3.0") } @@ -80,3 +77,9 @@ tasks.withType().configureEach { tasks.withType().configureEach { javadocTool = javaToolchains.javadocToolFor(java.toolchain) } + +// The dd-openfeature provider jar is not produced by the CI `build` job, so there is no reference +// artifact to compare against. Disable the release jar comparison gate registered by publish.gradle. +tasks.named("compareToReferenceJar") { + enabled = false +} diff --git a/products/feature-flagging/feature-flagging-api/gradle.lockfile b/products/feature-flagging/feature-flagging-api/gradle.lockfile index 2a4e70c195b..d947d858465 100644 --- a/products/feature-flagging/feature-flagging-api/gradle.lockfile +++ b/products/feature-flagging/feature-flagging-api/gradle.lockfile @@ -1,20 +1,18 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :products:feature-flagging:feature-flagging-api:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs com.squareup.moshi:moshi:1.11.0=testCompileClasspath,testRuntimeClasspath -com.squareup.okhttp3:okhttp:4.12.0=testRuntimeClasspath -com.squareup.okio:okio-jvm:3.6.0=testRuntimeClasspath -com.squareup.okio:okio:1.17.5=testCompileClasspath -com.squareup.okio:okio:3.6.0=testRuntimeClasspath +com.squareup.okio:okio:1.17.5=testCompileClasspath,testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath @@ -22,20 +20,9 @@ dev.openfeature:sdk:1.20.1=compileClasspath,runtimeClasspath,testCompileClasspat io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath io.opentelemetry:opentelemetry-api:1.47.0=compileClasspath,testCompileClasspath,testRuntimeClasspath io.opentelemetry:opentelemetry-context:1.47.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.opentelemetry:opentelemetry-exporter-common:1.47.0=testRuntimeClasspath -io.opentelemetry:opentelemetry-exporter-otlp-common:1.47.0=testRuntimeClasspath -io.opentelemetry:opentelemetry-exporter-otlp:1.47.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.opentelemetry:opentelemetry-exporter-sender-okhttp:1.47.0=testRuntimeClasspath -io.opentelemetry:opentelemetry-sdk-common:1.47.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi:1.47.0=testRuntimeClasspath -io.opentelemetry:opentelemetry-sdk-logs:1.47.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.opentelemetry:opentelemetry-sdk-metrics:1.47.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.opentelemetry:opentelemetry-sdk-testing:1.47.0=testCompileClasspath,testRuntimeClasspath -io.opentelemetry:opentelemetry-sdk-trace:1.47.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -io.opentelemetry:opentelemetry-sdk:1.47.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -59,15 +46,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt -org.jetbrains.kotlin:kotlin-stdlib-common:1.9.10=testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.9.10=testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.9.10=testRuntimeClasspath -org.jetbrains.kotlin:kotlin-stdlib:1.9.10=testRuntimeClasspath -org.jetbrains:annotations:13.0=testRuntimeClasspath +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -82,18 +64,22 @@ org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspat org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:2.0.17=compileClasspath,runtimeClasspath,spotbugs,spotbugsSlf4j,testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j +org.snakeyaml:snakeyaml-engine:2.9=testRuntimeClasspath org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath org.xmlresolver:xmlresolver:5.3.3=spotbugs -empty=annotationProcessor,signatures,spotbugsPlugins,testAnnotationProcessor +empty=annotationProcessor,spotbugsPlugins,testAnnotationProcessor diff --git a/products/feature-flagging/feature-flagging-api/src/main/java/datadog/trace/api/openfeature/DDEvaluator.java b/products/feature-flagging/feature-flagging-api/src/main/java/datadog/trace/api/openfeature/DDEvaluator.java index dcfe62db147..654fb6e8f6c 100644 --- a/products/feature-flagging/feature-flagging-api/src/main/java/datadog/trace/api/openfeature/DDEvaluator.java +++ b/products/feature-flagging/feature-flagging-api/src/main/java/datadog/trace/api/openfeature/DDEvaluator.java @@ -46,6 +46,16 @@ class DDEvaluator implements Evaluator, FeatureFlaggingGateway.ConfigListener { private static final Set> SUPPORTED_RESOLUTION_TYPES = new HashSet<>(asList(String.class, Boolean.class, Integer.class, Double.class, Value.class)); + // Evaluation-metadata keys consumed by the span-enrichment capture hook (see + // SpanEnrichmentHook). Emitted only when the span-enrichment gate is on. + static final String METADATA_SPLIT_SERIAL_ID = "__dd_split_serial_id"; + static final String METADATA_DO_LOG = "__dd_do_log"; + + // Read once: when off, the __dd_* span-enrichment metadata is not attached to evaluations, so an + // enabled provider pays nothing extra unless span enrichment is also enabled. The gate does not + // change at runtime, and this class is loaded lazily (well after startup) so config is ready. + private static final boolean SPAN_ENRICHMENT_ENABLED = SpanEnrichmentGate.isEnabled(); + private final Runnable configCallback; private final AtomicReference configuration = new AtomicReference<>(); private final CountDownLatch initializationLatch = new CountDownLatch(1); @@ -58,7 +68,12 @@ public DDEvaluator(final Runnable configCallback) { public boolean initialize( final long timeout, final TimeUnit unit, final EvaluationContext context) throws Exception { FeatureFlaggingGateway.addConfigListener(this); - return initializationLatch.await(timeout, unit); // await for initialization + return initializationLatch.await(timeout, unit) || hasConfiguration(); + } + + @Override + public boolean hasConfiguration() { + return configuration.get() != null; } @Override @@ -69,8 +84,12 @@ public void shutdown() { @Override public void accept(final ServerConfiguration config) { configuration.set(config); - initializationLatch.countDown(); - configCallback.run(); + if (config != null) { + initializationLatch.countDown(); + configCallback.run(); + } else if (initializationLatch.getCount() == 0) { + configCallback.run(); + } } @Override @@ -383,6 +402,17 @@ private static ProviderEvaluation resolveVariant( .addString("flagKey", flag.key) .addString("variationType", flag.variationType.name()) .addString("allocationKey", allocation.key); + // Surface the UFC split's serial id and the allocation's doLog flag for APM span enrichment — + // only when span enrichment is on, so a provider without enrichment pays nothing extra. + // __dd_split_serial_id is omitted when the split carries no serial id; __dd_do_log is always + // present (when enrichment is on) so the span-enrichment hook can decide whether to record the + // subject. + if (SPAN_ENRICHMENT_ENABLED) { + if (split.serialId != null) { + metadataBuilder.addInteger(METADATA_SPLIT_SERIAL_ID, split.serialId); + } + metadataBuilder.addBoolean(METADATA_DO_LOG, allocation.doLog != null && allocation.doLog); + } final ProviderEvaluation result = ProviderEvaluation.builder() .value(mappedValue) diff --git a/products/feature-flagging/feature-flagging-api/src/main/java/datadog/trace/api/openfeature/Evaluator.java b/products/feature-flagging/feature-flagging-api/src/main/java/datadog/trace/api/openfeature/Evaluator.java index 6ce3bac7b93..f4c9cacffdb 100644 --- a/products/feature-flagging/feature-flagging-api/src/main/java/datadog/trace/api/openfeature/Evaluator.java +++ b/products/feature-flagging/feature-flagging-api/src/main/java/datadog/trace/api/openfeature/Evaluator.java @@ -8,6 +8,8 @@ interface Evaluator { boolean initialize(long timeout, TimeUnit timeUnit, EvaluationContext context) throws Exception; + boolean hasConfiguration(); + void shutdown(); ProviderEvaluation evaluate( diff --git a/products/feature-flagging/feature-flagging-api/src/main/java/datadog/trace/api/openfeature/FlagEvalMetrics.java b/products/feature-flagging/feature-flagging-api/src/main/java/datadog/trace/api/openfeature/FlagEvalMetrics.java index 83ca85af9b0..eba3b7ba4b5 100644 --- a/products/feature-flagging/feature-flagging-api/src/main/java/datadog/trace/api/openfeature/FlagEvalMetrics.java +++ b/products/feature-flagging/feature-flagging-api/src/main/java/datadog/trace/api/openfeature/FlagEvalMetrics.java @@ -1,18 +1,13 @@ package datadog.trace.api.openfeature; -import datadog.trace.config.inversion.ConfigHelper; import dev.openfeature.sdk.ErrorCode; +import io.opentelemetry.api.GlobalOpenTelemetry; import io.opentelemetry.api.common.AttributeKey; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.api.metrics.LongCounter; import io.opentelemetry.api.metrics.Meter; -import io.opentelemetry.exporter.otlp.http.metrics.OtlpHttpMetricExporter; -import io.opentelemetry.sdk.metrics.SdkMeterProvider; -import io.opentelemetry.sdk.metrics.export.AggregationTemporalitySelector; -import io.opentelemetry.sdk.metrics.export.PeriodicMetricReader; import java.io.Closeable; -import java.time.Duration; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -24,13 +19,6 @@ class FlagEvalMetrics implements Closeable { private static final String METRIC_NAME = "feature_flag.evaluations"; private static final String METRIC_UNIT = "{evaluation}"; private static final String METRIC_DESC = "Number of feature flag evaluations"; - private static final Duration EXPORT_INTERVAL = Duration.ofSeconds(10); - - private static final String DEFAULT_ENDPOINT = "http://localhost:4318/v1/metrics"; - // Signal-specific env var (used as-is, must include /v1/metrics path) - private static final String ENDPOINT_ENV = "OTEL_EXPORTER_OTLP_METRICS_ENDPOINT"; - // Generic env var fallback (base URL, /v1/metrics is appended) - private static final String ENDPOINT_GENERIC_ENV = "OTEL_EXPORTER_OTLP_ENDPOINT"; private static final AttributeKey ATTR_FLAG_KEY = AttributeKey.stringKey("feature_flag.key"); @@ -43,36 +31,10 @@ class FlagEvalMetrics implements Closeable { AttributeKey.stringKey("feature_flag.result.allocation_key"); private volatile LongCounter counter; - // Typed as Closeable to avoid loading SdkMeterProvider at class-load time - // when the OTel SDK is absent from the classpath - private volatile Closeable meterProvider; FlagEvalMetrics() { try { - String endpoint = ConfigHelper.env(ENDPOINT_ENV); - if (endpoint == null || endpoint.isEmpty()) { - String base = ConfigHelper.env(ENDPOINT_GENERIC_ENV); - if (base != null && !base.isEmpty()) { - endpoint = base.endsWith("/") ? base + "v1/metrics" : base + "/v1/metrics"; - } else { - endpoint = DEFAULT_ENDPOINT; - } - } - - OtlpHttpMetricExporter exporter = - OtlpHttpMetricExporter.builder() - .setEndpoint(endpoint) - .setAggregationTemporalitySelector(AggregationTemporalitySelector.alwaysCumulative()) - .build(); - - PeriodicMetricReader reader = - PeriodicMetricReader.builder(exporter).setInterval(EXPORT_INTERVAL).build(); - - SdkMeterProvider sdkMeterProvider = - SdkMeterProvider.builder().registerMetricReader(reader).build(); - meterProvider = sdkMeterProvider; - - Meter meter = sdkMeterProvider.meterBuilder(METER_NAME).build(); + Meter meter = GlobalOpenTelemetry.get().getMeterProvider().meterBuilder(METER_NAME).build(); counter = meter .counterBuilder(METRIC_NAME) @@ -80,34 +42,23 @@ class FlagEvalMetrics implements Closeable { .setDescription(METRIC_DESC) .build(); - log.debug("Flag evaluation metrics initialized, exporting to {}", endpoint); + log.debug("Flag evaluation metrics initialized"); } catch (NoClassDefFoundError e) { log.error( - "OpenTelemetry SDK is not on the classpath — evaluation metrics disabled. " - + "Add opentelemetry-sdk-metrics and opentelemetry-exporter-otlp to your dependencies " - + "to enable flag evaluation metrics.", + "OpenTelemetry API is not on the classpath — evaluation metrics disabled. Add" + + " opentelemetry-api to your dependencies and enable DD_METRICS_OTEL_ENABLED to" + + " export flag evaluation metrics through the Datadog Java agent.", e); counter = null; - meterProvider = null; } catch (Exception e) { log.error("Failed to initialize flag evaluation metrics", e); counter = null; - meterProvider = null; } } /** Package-private constructor for testing with a mock counter. */ FlagEvalMetrics(LongCounter counter) { this.counter = counter; - this.meterProvider = null; - } - - /** Package-private constructor for integration testing with an injected SdkMeterProvider. */ - FlagEvalMetrics(SdkMeterProvider sdkMeterProvider) { - meterProvider = sdkMeterProvider; - Meter meter = sdkMeterProvider.meterBuilder(METER_NAME).build(); - counter = - meter.counterBuilder(METRIC_NAME).setUnit(METRIC_UNIT).setDescription(METRIC_DESC).build(); } void record( @@ -144,14 +95,5 @@ public void close() { void shutdown() { counter = null; - Closeable mp = meterProvider; - if (mp != null) { - meterProvider = null; - try { - mp.close(); - } catch (Exception e) { - // Ignore shutdown errors - } - } } } diff --git a/products/feature-flagging/feature-flagging-api/src/main/java/datadog/trace/api/openfeature/Provider.java b/products/feature-flagging/feature-flagging-api/src/main/java/datadog/trace/api/openfeature/Provider.java index f16b6e582a8..38fa735d4e9 100644 --- a/products/feature-flagging/feature-flagging-api/src/main/java/datadog/trace/api/openfeature/Provider.java +++ b/products/feature-flagging/feature-flagging-api/src/main/java/datadog/trace/api/openfeature/Provider.java @@ -3,6 +3,7 @@ import static java.util.concurrent.TimeUnit.SECONDS; import de.thetaphi.forbiddenapis.SuppressForbidden; +import dev.openfeature.sdk.ErrorCode; import dev.openfeature.sdk.EvaluationContext; import dev.openfeature.sdk.EventProvider; import dev.openfeature.sdk.Hook; @@ -15,10 +16,11 @@ import dev.openfeature.sdk.exceptions.OpenFeatureError; import dev.openfeature.sdk.exceptions.ProviderNotReadyError; import java.lang.reflect.Constructor; +import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.concurrent.TimeUnit; -import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicReference; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -27,12 +29,19 @@ public class Provider extends EventProvider implements Metadata { private static final Logger log = LoggerFactory.getLogger(Provider.class); static final String METADATA = "datadog-openfeature-provider"; private static final String EVALUATOR_IMPL = "datadog.trace.api.openfeature.DDEvaluator"; + private static final Options DEFAULT_OPTIONS = new Options().initTimeout(30, SECONDS); private volatile Evaluator evaluator; private final Options options; - private final AtomicBoolean initialized = new AtomicBoolean(false); + private final AtomicReference initializationState = + new AtomicReference<>(InitializationState.NOT_STARTED); private final FlagEvalMetrics flagEvalMetrics; private final FlagEvalHook flagEvalHook; + // Span enrichment: null unless the gate is on, so the feature has no idle overhead when off. + private final SpanEnrichmentHook spanEnrichmentHook; + // Precomputed hook list returned by getProviderHooks() on every evaluation. Immutable and built + // once so gate-off evaluation allocates nothing on this hot path. + private final List providerHooks; public Provider() { this(DEFAULT_OPTIONS, null); @@ -43,6 +52,17 @@ public Provider(final Options options) { } Provider(final Options options, final Evaluator evaluator) { + this(options, evaluator, null); + } + + /** + * @param spanEnrichmentEnabledOverride when non-null, forces the span-enrichment gate (test + * seam); when null, the gate is read via {@link SpanEnrichmentGate}. + */ + Provider( + final Options options, + final Evaluator evaluator, + final Boolean spanEnrichmentEnabledOverride) { this.options = options; this.evaluator = evaluator; FlagEvalMetrics metrics = null; @@ -51,40 +71,134 @@ public Provider(final Options options) { metrics = new FlagEvalMetrics(); hook = new FlagEvalHook(metrics); } catch (LinkageError | Exception e) { - // FlagEvalMetrics logs the detailed error when it can load but OTel SDK init fails. - // This outer catch fires when the class itself can't load (OTel API absent entirely). - log.warn("Evaluation metrics unavailable — OTel classes not on classpath", e); + // This outer catch fires when the metrics helper itself can't load (OTel API absent). + log.warn("Evaluation metrics unavailable — OTel API classes not on classpath", e); } this.flagEvalMetrics = metrics; this.flagEvalHook = hook; + + // Span enrichment is wired ONLY when the gate is on — off means no capture hook and no idle + // per-evaluation overhead. + final boolean spanEnrichmentEnabled = + spanEnrichmentEnabledOverride != null + ? spanEnrichmentEnabledOverride + : SpanEnrichmentGate.isEnabled(); + this.spanEnrichmentHook = spanEnrichmentEnabled ? new SpanEnrichmentHook() : null; + + // Precompute the immutable hook list once so getProviderHooks() (called on every evaluation) + // allocates nothing, including when the gate is off. + final List hooks = new ArrayList<>(2); + if (flagEvalHook != null) { + hooks.add(flagEvalHook); + } + if (spanEnrichmentHook != null) { + hooks.add(spanEnrichmentHook); + } + this.providerHooks = + hooks.isEmpty() ? Collections.emptyList() : Collections.unmodifiableList(hooks); + + // Announce the span-enrichment state at startup (matches the reference implementation). + // "enabled" only when the gate is on (the capture hook was constructed), otherwise "disabled". + if (spanEnrichmentHook != null) { + log.info("{} span enrichment enabled", METADATA); + } else { + log.info("{} span enrichment disabled", METADATA); + } } @Override public void initialize(final EvaluationContext context) throws Exception { + initializationState.set(InitializationState.INITIALIZING); try { evaluator = buildEvaluator(); - final boolean init = evaluator.initialize(options.getTimeout(), options.getUnit(), context); - initialized.set(init); - if (!init) { + if (!evaluator.initialize(options.getTimeout(), options.getUnit(), context)) { + if (markInitialConfigReceivedReady()) { + return; + } + markInitializationError(); + throw new ProviderNotReadyError( + "Provider timed-out while waiting for initial configuration"); + } + if (!evaluator.hasConfiguration() || !markSuccessfulInitializationReady()) { + markInitializationError(); throw new ProviderNotReadyError( "Provider timed-out while waiting for initial configuration"); } } catch (final OpenFeatureError e) { + markInitializationError(); throw e; } catch (final Throwable e) { + markInitializationError(); throw new FatalError("Failed to initialize provider, is the tracer configured?", e); } } - private void onConfigurationChange() { - if (initialized.getAndSet(true)) { - emit( - ProviderEvent.PROVIDER_CONFIGURATION_CHANGED, - ProviderEventDetails.builder().message("New configuration received").build()); - } else { + void onConfigurationChange() { + if (evaluator == null || !evaluator.hasConfiguration()) { + onConfigurationUnavailable(); + return; + } + + final InitializationState state = initializationState.get(); + if (state == InitializationState.INITIALIZING) { + initializationState.compareAndSet( + InitializationState.INITIALIZING, InitializationState.INITIAL_CONFIG_RECEIVED); + return; + } + if (state == InitializationState.INITIAL_CONFIG_RECEIVED) { + return; + } + if (state == InitializationState.ERROR + && initializationState.compareAndSet( + InitializationState.ERROR, InitializationState.READY)) { emit( ProviderEvent.PROVIDER_READY, ProviderEventDetails.builder().message("Provider ready").build()); + return; + } + if (initializationState.get() != InitializationState.READY) { + return; + } + emit( + ProviderEvent.PROVIDER_CONFIGURATION_CHANGED, + ProviderEventDetails.builder().message("New configuration received").build()); + } + + private void onConfigurationUnavailable() { + if (initializationState.compareAndSet( + InitializationState.INITIAL_CONFIG_RECEIVED, InitializationState.ERROR)) { + return; + } + if (!initializationState.compareAndSet(InitializationState.READY, InitializationState.ERROR)) { + return; + } + emit( + ProviderEvent.PROVIDER_ERROR, + ProviderEventDetails.builder() + .message("Configuration unavailable") + .errorCode(ErrorCode.PROVIDER_NOT_READY) + .build()); + } + + private boolean markInitialConfigReceivedReady() { + return initializationState.get() == InitializationState.READY + || initializationState.compareAndSet( + InitializationState.INITIAL_CONFIG_RECEIVED, InitializationState.READY); + } + + private boolean markSuccessfulInitializationReady() { + return markInitialConfigReceivedReady() + || initializationState.compareAndSet( + InitializationState.INITIALIZING, InitializationState.READY); + } + + private void markInitializationError() { + InitializationState state = initializationState.get(); + while (state != InitializationState.READY && state != InitializationState.ERROR) { + if (initializationState.compareAndSet(state, InitializationState.ERROR)) { + return; + } + state = initializationState.get(); } } @@ -99,10 +213,7 @@ private Evaluator buildEvaluator() throws Exception { @Override public List getProviderHooks() { - if (flagEvalHook == null) { - return Collections.emptyList(); - } - return Collections.singletonList(flagEvalHook); + return providerHooks; } @Override @@ -110,11 +221,19 @@ public void shutdown() { if (flagEvalMetrics != null) { flagEvalMetrics.shutdown(); } + // Span enrichment needs no provider-close cleanup here: the capture hook holds no tracer state. + // The agent-side write tier owns the interceptor and per-trace state and is torn down with the + // feature-flagging subsystem, not per provider. if (evaluator != null) { evaluator.shutdown(); } } + // Visible for tests: expose whether span enrichment is wired (gate-on) without leaking the impl. + SpanEnrichmentHook spanEnrichmentHook() { + return spanEnrichmentHook; + } + @Override public Metadata getMetadata() { return this; @@ -155,11 +274,19 @@ public ProviderEvaluation getObjectEvaluation( return evaluator.evaluate(Value.class, key, defaultValue, ctx); } - @SuppressForbidden // Class#forName(String) used to lazy load internal-api dependencies + @SuppressForbidden // Class#forName(String) used to lazy-load the evaluator implementation protected Class loadEvaluatorClass() throws ClassNotFoundException { return Class.forName(EVALUATOR_IMPL); } + private enum InitializationState { + NOT_STARTED, + INITIALIZING, + INITIAL_CONFIG_RECEIVED, + READY, + ERROR + } + public static class Options { private long timeout; diff --git a/products/feature-flagging/feature-flagging-api/src/main/java/datadog/trace/api/openfeature/SpanEnrichmentGate.java b/products/feature-flagging/feature-flagging-api/src/main/java/datadog/trace/api/openfeature/SpanEnrichmentGate.java new file mode 100644 index 00000000000..64739f0ad39 --- /dev/null +++ b/products/feature-flagging/feature-flagging-api/src/main/java/datadog/trace/api/openfeature/SpanEnrichmentGate.java @@ -0,0 +1,25 @@ +package datadog.trace.api.openfeature; + +import datadog.trace.api.featureflag.config.FeatureFlaggingConfig; +import datadog.trace.bootstrap.config.provider.ConfigProvider; + +/** + * Single source for reading the experimental span-enrichment gate, with full {@link ConfigProvider} + * precedence (system property > stable config > env var {@code + * DD_EXPERIMENTAL_FLAGGING_PROVIDER_SPAN_ENRICHMENT_ENABLED}). OFF by default; distinct from the + * provider-enabled gate. Shared so {@link Provider} (per construction) and {@link DDEvaluator} + * (once at class load) read it the same way. + */ +final class SpanEnrichmentGate { + + private SpanEnrichmentGate() {} + + static boolean isEnabled() { + try { + return ConfigProvider.getInstance() + .getBoolean(FeatureFlaggingConfig.EXPERIMENTAL_SPAN_ENRICHMENT_ENABLED, false); + } catch (final Throwable t) { + return false; // never let config reading break construction + } + } +} diff --git a/products/feature-flagging/feature-flagging-api/src/main/java/datadog/trace/api/openfeature/SpanEnrichmentHook.java b/products/feature-flagging/feature-flagging-api/src/main/java/datadog/trace/api/openfeature/SpanEnrichmentHook.java new file mode 100644 index 00000000000..40e998a6546 --- /dev/null +++ b/products/feature-flagging/feature-flagging-api/src/main/java/datadog/trace/api/openfeature/SpanEnrichmentHook.java @@ -0,0 +1,149 @@ +package datadog.trace.api.openfeature; + +import datadog.trace.api.featureflag.FeatureFlaggingGateway; +import datadog.trace.api.featureflag.SpanEnrichmentEvent; +import dev.openfeature.sdk.EvaluationContext; +import dev.openfeature.sdk.FlagEvaluationDetails; +import dev.openfeature.sdk.Hook; +import dev.openfeature.sdk.HookContext; +import dev.openfeature.sdk.ImmutableMetadata; +import dev.openfeature.sdk.Structure; +import dev.openfeature.sdk.Value; +import java.time.Instant; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * OpenFeature {@code finally} hook that captures feature-flag evaluation metadata for APM span + * enrichment. Registered from {@link Provider#getProviderHooks()} only when the gate is on. For + * each relevant evaluation it dispatches a {@link SpanEnrichmentEvent} onto {@link + * FeatureFlaggingGateway}; the agent-side write tier resolves the active local-root span and + * accumulates the per-trace state that is flushed onto the root when the trace completes. + * + *

      Capture branch (frozen Node reference): + * + *

        + *
      • serial id present → dispatch a serial-id event (the write side records the serial id, plus + * the subject when {@code __dd_do_log} AND a targeting key) + *
      • else variant missing (runtime default) → dispatch a runtime-default event with the value + * unwrapped to a native Java type + *
      + * + *

      All work is wrapped in try/catch — enrichment must NEVER break flag evaluation. + */ +class SpanEnrichmentHook implements Hook { + + private static final Logger log = LoggerFactory.getLogger(SpanEnrichmentHook.class); + + // The metadata keys the DDEvaluator attaches for span enrichment (single source of truth there). + static final String METADATA_SERIAL_ID = DDEvaluator.METADATA_SPLIT_SERIAL_ID; + static final String METADATA_DO_LOG = DDEvaluator.METADATA_DO_LOG; + + @Override + public void finallyAfter( + final HookContext ctx, + final FlagEvaluationDetails details, + final Map hints) { + if (details == null) { + return; + } + try { + final ImmutableMetadata metadata = details.getFlagMetadata(); + final Integer serialId = metadata != null ? metadata.getInteger(METADATA_SERIAL_ID) : null; + if (serialId != null) { + final boolean doLog = Boolean.TRUE.equals(metadata.getBoolean(METADATA_DO_LOG)); + FeatureFlaggingGateway.dispatch( + SpanEnrichmentEvent.serialId(serialId, doLog, targetingKey(ctx))); + } else if (details.getVariant() == null) { + // Runtime-default detection = MISSING VARIANT (never a reason enum). Unwrap any OpenFeature + // Value to a native Java type here so the seam carries only JDK types. + FeatureFlaggingGateway.dispatch( + SpanEnrichmentEvent.runtimeDefault( + details.getFlagKey(), unwrapDefaultValue(details.getValue()))); + } + } catch (final Throwable t) { + // Never let span enrichment break flag evaluation; a debug line aids diagnosis if it does. + log.debug("Span-enrichment capture failed for flag {}", details.getFlagKey(), t); + } + } + + private static String targetingKey(final HookContext ctx) { + if (ctx == null) { + return null; + } + final EvaluationContext evaluationContext = ctx.getCtx(); + if (evaluationContext == null) { + return null; + } + final String key = evaluationContext.getTargetingKey(); + return (key == null || key.isEmpty()) ? null : key; + } + + /** + * Unwraps an OpenFeature {@link Value} to a native Java representation so the runtime default can + * cross the (JDK-types-only) seam and be JSON-serialized on the write side exactly like Node's + * {@code JSON.stringify}. Non-{@code Value} inputs (already native) are returned as-is. + */ + static Object unwrapDefaultValue(final Object value) { + return value instanceof Value ? unwrapValue((Value) value) : value; + } + + /** + * Recursively unwraps an OpenFeature {@link Value} into its native Java representation: + * structures become {@code Map}, lists become {@code List}, and scalars + * become their boxed value (or {@code null}). Nested {@link Value}s are unwrapped at every level + * so a structure containing further structures/lists serializes correctly. + */ + private static Object unwrapValue(final Value value) { + if (value == null || value.isNull()) { + return null; + } + if (value.isStructure()) { + final Structure structure = value.asStructure(); + final Map map = new LinkedHashMap<>(); + if (structure != null) { + for (final String key : structure.keySet()) { + map.put(key, unwrapValue(structure.getValue(key))); + } + } + return map; + } + if (value.isList()) { + final List list = value.asList(); + final List out = new ArrayList<>(list == null ? 0 : list.size()); + if (list != null) { + for (final Value element : list) { + out.add(unwrapValue(element)); + } + } + return out; + } + if (value.isBoolean()) { + return value.asBoolean(); + } + if (value.isString()) { + return value.asString(); + } + if (value.isNumber()) { + // Preserve integral vs fractional so the rendered JSON number matches Node. + final Double d = value.asDouble(); + if (d != null && d == Math.rint(d) && !Double.isInfinite(d)) { + final Integer i = value.asInteger(); + if (i != null) { + return i; + } + } + return d; + } + final Instant instant = value.asInstant(); + if (instant != null) { + return instant.toString(); + } + // Unknown shape: fall back to the wrapped object's own representation. + return value.asObject(); + } +} diff --git a/products/feature-flagging/feature-flagging-api/src/test/java/datadog/trace/api/openfeature/DDEvaluatorTest.java b/products/feature-flagging/feature-flagging-api/src/test/java/datadog/trace/api/openfeature/DDEvaluatorTest.java index f13f8d2a2ba..3421fe3454e 100644 --- a/products/feature-flagging/feature-flagging-api/src/test/java/datadog/trace/api/openfeature/DDEvaluatorTest.java +++ b/products/feature-flagging/feature-flagging-api/src/test/java/datadog/trace/api/openfeature/DDEvaluatorTest.java @@ -1,85 +1,68 @@ package datadog.trace.api.openfeature; -import static dev.openfeature.sdk.ErrorCode.FLAG_NOT_FOUND; -import static dev.openfeature.sdk.ErrorCode.TARGETING_KEY_MISSING; -import static dev.openfeature.sdk.Reason.DEFAULT; -import static dev.openfeature.sdk.Reason.DISABLED; import static dev.openfeature.sdk.Reason.ERROR; -import static dev.openfeature.sdk.Reason.SPLIT; -import static dev.openfeature.sdk.Reason.STATIC; -import static dev.openfeature.sdk.Reason.TARGETING_MATCH; import static java.util.Arrays.asList; import static java.util.Collections.emptyList; import static java.util.Collections.emptyMap; import static java.util.Collections.singletonList; +import static java.util.concurrent.TimeUnit.MILLISECONDS; +import static java.util.concurrent.TimeUnit.SECONDS; import static org.hamcrest.CoreMatchers.equalTo; import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.hasEntry; -import static org.hamcrest.Matchers.oneOf; import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import datadog.trace.api.featureflag.FeatureFlaggingGateway; -import datadog.trace.api.featureflag.exposure.ExposureEvent; -import datadog.trace.api.featureflag.ufc.v1.Allocation; -import datadog.trace.api.featureflag.ufc.v1.ConditionConfiguration; -import datadog.trace.api.featureflag.ufc.v1.ConditionOperator; +import com.squareup.moshi.JsonAdapter; +import com.squareup.moshi.JsonDataException; +import com.squareup.moshi.JsonReader; +import com.squareup.moshi.JsonWriter; +import com.squareup.moshi.Moshi; +import com.squareup.moshi.Types; import datadog.trace.api.featureflag.ufc.v1.Flag; -import datadog.trace.api.featureflag.ufc.v1.Rule; import datadog.trace.api.featureflag.ufc.v1.ServerConfiguration; -import datadog.trace.api.featureflag.ufc.v1.Shard; -import datadog.trace.api.featureflag.ufc.v1.ShardRange; -import datadog.trace.api.featureflag.ufc.v1.Split; -import datadog.trace.api.featureflag.ufc.v1.ValueType; -import datadog.trace.api.featureflag.ufc.v1.Variant; -import datadog.trace.api.openfeature.util.TestCase; -import datadog.trace.api.openfeature.util.TestCase.Result; import dev.openfeature.sdk.ErrorCode; import dev.openfeature.sdk.EvaluationContext; import dev.openfeature.sdk.MutableContext; import dev.openfeature.sdk.ProviderEvaluation; import dev.openfeature.sdk.Value; -import java.text.ParseException; -import java.text.SimpleDateFormat; +import java.io.IOException; +import java.lang.reflect.Type; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.time.OffsetDateTime; import java.util.ArrayList; -import java.util.Arrays; import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; -import java.util.TimeZone; -import org.junit.jupiter.api.AfterEach; -import org.junit.jupiter.api.BeforeEach; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.stream.Collectors; +import java.util.stream.Stream; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; -import org.mockito.ArgumentCaptor; -import org.mockito.Captor; -import org.mockito.junit.jupiter.MockitoExtension; -@ExtendWith(MockitoExtension.class) public class DDEvaluatorTest { - @Captor private ArgumentCaptor exposureEventCaptor; - - private FeatureFlaggingGateway.ExposureListener exposureListener; - - @BeforeEach - public void setup() { - exposureListener = mock(FeatureFlaggingGateway.ExposureListener.class); - FeatureFlaggingGateway.addExposureListener(exposureListener); - } - - @AfterEach - public void tearDown() { - FeatureFlaggingGateway.removeExposureListener(exposureListener); - } + private static final String CANONICAL_FIXTURE_PATH = + "dd-smoke-tests/openfeature/src/test/resources/ffe-system-test-data"; + private static final Moshi MOSHI = new Moshi.Builder().add(Date.class, new DateAdapter()).build(); + private static final JsonAdapter CONFIG_ADAPTER = + MOSHI.adapter(ServerConfiguration.class); + private static final Type FIXTURE_LIST_TYPE = + Types.newParameterizedType(List.class, FixtureCase.class); + private static final JsonAdapter> FIXTURE_LIST_ADAPTER = + MOSHI.adapter(FIXTURE_LIST_TYPE); private static Arguments[] valueMappingTestCases() { return new Arguments[] { @@ -148,6 +131,39 @@ public void testEvaluateNoConfig() { assertThat(details.getErrorCode(), equalTo(ErrorCode.PROVIDER_NOT_READY)); } + @Test + public void testInitializeTimesOutWithoutConfig() throws Exception { + final Runnable configCallback = mock(Runnable.class); + final DDEvaluator evaluator = new DDEvaluator(configCallback); + evaluator.accept(null); + try { + assertThat( + evaluator.initialize(10, MILLISECONDS, mock(EvaluationContext.class)), equalTo(false)); + verify(configCallback, times(0)).run(); + } finally { + evaluator.shutdown(); + } + } + + @Test + public void testInitializeWaitsForNonNullConfig() throws Exception { + final DDEvaluator evaluator = new DDEvaluator(mock(Runnable.class)); + final ExecutorService executor = Executors.newSingleThreadExecutor(); + try { + final Future initialized = + executor.submit(() -> evaluator.initialize(1, SECONDS, mock(EvaluationContext.class))); + + evaluator.accept(null); + assertThat(initialized.isDone(), equalTo(false)); + + evaluator.accept(mock(ServerConfiguration.class)); + assertThat(initialized.get(1, SECONDS), equalTo(true)); + } finally { + executor.shutdownNow(); + evaluator.shutdown(); + } + } + @Test public void testEvaluateNoContext() { final DDEvaluator evaluator = new DDEvaluator(mock(Runnable.class)); @@ -175,7 +191,7 @@ public void testNoAllocations() { details = evaluator.evaluate(Integer.class, "empty-allocation", 23, ctx); assertThat(details.getValue(), equalTo(23)); - assertThat(details.getReason(), equalTo(DEFAULT.name())); + assertThat(details.getReason(), equalTo("DEFAULT")); assertThat(details.getErrorCode(), nullValue()); } @@ -211,1111 +227,128 @@ public void testFlattening( } } - private static List> evaluateTestCases() { - return Arrays.asList( - // OF spec 3.1.1: targeting key is optional; static flags must evaluate successfully without - // it - new TestCase<>("default") - .flag("simple-string") - // no .targetingKey() -- null by default - .result(new Result<>("test-value").reason(STATIC.name()).variant("on")), - // Null targeting key on sharded flag must return TARGETING_KEY_MISSING - new TestCase<>("default") - .flag("shard-flag") - // no .targetingKey() -- null - .result(new Result<>("default").reason(ERROR.name()).errorCode(TARGETING_KEY_MISSING)), - // Null targeting key on rule-only flag (matching on non-id attribute) must succeed - new TestCase<>("default") - .flag("country-rule-flag") - // no .targetingKey() -- null - .context("country", "US") - .result(new Result<>("us-value").reason(TARGETING_MATCH.name()).variant("us")), - // OF.7: Empty string is a valid targeting key - evaluation should proceed as normal - new TestCase<>("default") - .flag("simple-string") - .targetingKey("") - .result(new Result<>("test-value").reason(STATIC.name()).variant("on")), - new TestCase<>("default") - .flag("non-existent-flag") - .targetingKey("user-123") - .result(new Result<>("default").reason(ERROR.name()).errorCode(FLAG_NOT_FOUND)), - new TestCase<>("default") - .flag("disabled-flag") - .targetingKey("user-123") - .result(new Result<>("default").reason(DISABLED.name())), - new TestCase<>("default") - .flag("simple-string") - .targetingKey("user-123") - .result(new Result<>("test-value").reason(STATIC.name()).variant("on")), - new TestCase<>(false) - .flag("boolean-flag") - .targetingKey("user-123") - .result(new Result<>(true).reason(STATIC.name()).variant("enabled")), - new TestCase<>(0) - .flag("integer-flag") - .targetingKey("user-123") - .result(new Result<>(42).reason(STATIC.name()).variant("forty-two")), - new TestCase<>("default") - .flag("rule-based-flag") - .targetingKey("user-premium") - .context("email", "john@company.com") - .result(new Result<>("premium").reason(TARGETING_MATCH.name()).variant("premium")), - new TestCase<>("default") - .flag("rule-based-flag") - .targetingKey("user-basic") - .context("email", "john@gmail.com") - .result(new Result<>("basic").reason(STATIC.name()).variant("basic")), - new TestCase<>("default") - .flag("numeric-rule-flag") - .targetingKey("user-vip") - .context("score", 850) - .result(new Result<>("vip").reason(TARGETING_MATCH.name()).variant("vip")), - new TestCase<>("default") - .flag("null-check-flag") - .targetingKey("user-no-beta") - .result(new Result<>("no-beta").reason(TARGETING_MATCH.name()).variant("no-beta")), - new TestCase<>("default") - .flag("region-flag") - .targetingKey("user-regional") - .context("region", "us-east-1") - .result(new Result<>("regional").reason(TARGETING_MATCH.name()).variant("regional")), - new TestCase<>("default") - .flag("time-based-flag") - .targetingKey("user-regional") - .context("region", "us-east-1") - .result(new Result<>("default").reason(DEFAULT.name())), - new TestCase<>("default") - .flag("shard-flag") - .targetingKey("user-shard-test") - .result( - new Result<>("default") - // Result depends on shard calculation - either match or default - .reason(SPLIT.name(), DEFAULT.name())), - // Type mismatch: STRING flag evaluated as Integer - new TestCase<>(0) - .flag("string-number-flag") - .targetingKey("user-123") - .result(new Result<>(0).reason(ERROR.name()).errorCode(ErrorCode.TYPE_MISMATCH)), - // Type mismatch: STRING flag evaluated as Boolean - new TestCase<>(false) - .flag("simple-string") - .targetingKey("user-123") - .result(new Result<>(false).reason(ERROR.name()).errorCode(ErrorCode.TYPE_MISMATCH)), - // Type mismatch: BOOLEAN flag evaluated as String - new TestCase<>("default") - .flag("boolean-flag") - .targetingKey("user-123") - .result( - new Result<>("default").reason(ERROR.name()).errorCode(ErrorCode.TYPE_MISMATCH)), - // Type mismatch: NUMERIC flag evaluated as Integer - new TestCase<>(0) - .flag("double-flag") - .targetingKey("user-123") - .result(new Result<>(0).reason(ERROR.name()).errorCode(ErrorCode.TYPE_MISMATCH)), - // Type mismatch: INTEGER flag evaluated as Double - new TestCase<>(0.0) - .flag("integer-flag") - .targetingKey("user-123") - .result(new Result<>(0.0).reason(ERROR.name()).errorCode(ErrorCode.TYPE_MISMATCH)), - // Variant stores "not-a-number" for an INTEGER flag; Double.parseDouble fails -> - // PARSE_ERROR - new TestCase<>(0) - .flag("integer-string-variant-flag") - .targetingKey("user-123") - .result(new Result<>(0).reason(ERROR.name()).errorCode(ErrorCode.PARSE_ERROR)), - new TestCase<>("default") - .flag("broken-flag") - .targetingKey("user-123") - .result(new Result<>("default").reason(ERROR.name()).errorCode(ErrorCode.GENERAL)), - new TestCase<>("default") - .flag("lt-flag") - .targetingKey("user-123") - .context("score", 750) - .result(new Result<>("low-score").reason(TARGETING_MATCH.name()).variant("low")), - new TestCase<>("default") - .flag("lte-flag") - .targetingKey("user-123") - .context("score", 800) - .result(new Result<>("medium-score").reason(TARGETING_MATCH.name()).variant("medium")), - new TestCase<>("default") - .flag("gt-flag") - .targetingKey("user-123") - .context("score", 950) - .result(new Result<>("high-score").reason(TARGETING_MATCH.name()).variant("high")), - new TestCase<>("default") - .flag("not-matches-flag") - .targetingKey("user-123") - .context("email", "user@yahoo.com") - .result(new Result<>("external").reason(TARGETING_MATCH.name()).variant("external")), - new TestCase<>("default") - .flag("not-one-of-flag") - .targetingKey("user-123") - .context("region", "ap-south-1") - .result(new Result<>("other-region").reason(TARGETING_MATCH.name()).variant("other")), - new TestCase<>("default") - .flag("double-equals-flag") - .targetingKey("user-123") - .context("rate", 3.14159) - .result(new Result<>("pi-value").reason(TARGETING_MATCH.name()).variant("pi")), - new TestCase<>("default") - .flag("nested-attr-flag") - .targetingKey("user-123") - .context("user.profile.level", "premium") - .result(new Result<>("premium-user").reason(TARGETING_MATCH.name()).variant("premium")), - new TestCase<>("default") - .flag("lt-flag") - .targetingKey("user-123") - .context("score", "not-a-number") - .result( - new Result<>("default").reason(ERROR.name()).errorCode(ErrorCode.TYPE_MISMATCH)), - new TestCase<>("default") - .flag("exposure-flag") - .targetingKey("user-123") - .result( - new Result<>("tracked-value") - .reason(STATIC.name()) - .variant("tracked") - .flagMetadata("allocationKey", "exposure-alloc") - .flagMetadata("doLog", true)), - new TestCase<>("default") - .flag("exposure-logging-flag") - .targetingKey("user-exposure") - .context("feature", "premium") - .result( - new Result<>("logged-value") - .reason(TARGETING_MATCH.name()) - .variant("logged") - .flagMetadata("allocationKey", "logged-alloc") - .flagMetadata("doLog", true)), - new TestCase<>("default") - .flag("double-comparison-flag") - .targetingKey("user-123") - .context("score", 3.14159) - .result(new Result<>("exact-match").reason(TARGETING_MATCH.name()).variant("exact")), - new TestCase<>("default") - .flag("numeric-one-of-flag") - .targetingKey("user-123") - .context("score", 3.14159) - .result( - new Result<>("numeric-matched") - .reason(TARGETING_MATCH.name()) - .variant("numeric-match")), - new TestCase<>("default") - .flag("numeric-not-one-of-flag") - .targetingKey("user-123") - .context("score", 42.0) - .result(new Result<>("not-in-set").reason(TARGETING_MATCH.name()).variant("excluded")), - new TestCase<>("default") - .flag("is-null-false-flag") - .targetingKey("user-123") - .context("attr", "value") - .result(new Result<>("not-null").reason(TARGETING_MATCH.name()).variant("not-null")), - new TestCase<>("default") - .flag("is-null-non-boolean-flag") - .targetingKey("user-123") - .result( - new Result<>("null-match").reason(TARGETING_MATCH.name()).variant("null-match")), - new TestCase<>("default") - .flag("null-attribute-flag") - .targetingKey("user-123") - .result(new Result<>("default").reason(DEFAULT.name())), - new TestCase<>("default") - .flag("not-matches-positive-flag") - .targetingKey("user-123") - .context("email", "user@gmail.com") - .result( - new Result<>("external-email").reason(TARGETING_MATCH.name()).variant("external")), - new TestCase<>("default") - .flag("not-one-of-positive-flag") - .targetingKey("user-123") - .context("region", "ap-south-1") - .result(new Result<>("other-region").reason(TARGETING_MATCH.name()).variant("other")), - new TestCase<>("default") - .flag("false-numeric-comparisons-flag") - .targetingKey("user-123") - .context("score", 750) - .result(new Result<>("default").reason(DEFAULT.name())), - new TestCase<>("default") - .flag("empty-splits-flag") - .targetingKey("user-123") - .result(new Result<>("default").reason(DEFAULT.name())), - new TestCase<>("default") - .flag("empty-conditions-flag") - .targetingKey("user-123") - .result(new Result<>("default").reason(DEFAULT.name())), - new TestCase<>("default") - .flag("shard-matching-flag") - .targetingKey("specific-key-that-matches-shard") - .result(new Result<>("shard-matched").reason(SPLIT.name()).variant("matched")), - new TestCase<>("default") - .flag("future-allocation-flag") - .targetingKey("user-123") - .result(new Result<>("default").reason(DEFAULT.name())), - new TestCase<>("default") - .flag("id-attribute-flag") - .targetingKey("user-special-id") - .result(new Result<>("id-resolved").reason(TARGETING_MATCH.name()).variant("id-match")), - new TestCase<>("default") - .flag("non-iterable-condition-flag") - .targetingKey("user-123") - .context("attr", "test-value") - .result(new Result<>("default").reason(DEFAULT.name())), - new TestCase<>("default") - .flag("gt-false-flag") - .targetingKey("user-123") - .context("score", 500) - .result(new Result<>("default").reason(DEFAULT.name())), - new TestCase<>("default") - .flag("lte-false-flag") - .targetingKey("user-123") - .context("score", 600) - .result(new Result<>("default").reason(DEFAULT.name())), - new TestCase<>("default") - .flag("lt-false-flag") - .targetingKey("user-123") - .context("score", 700) - .result(new Result<>("default").reason(DEFAULT.name())), - new TestCase<>("default") - .flag("not-matches-false-flag") - .targetingKey("user-123") - .context("email", "user@company.com") - .result(new Result<>("default").reason(DEFAULT.name())), - new TestCase<>("default") - .flag("not-one-of-false-flag") - .targetingKey("user-123") - .context("region", "us-east-1") - .result(new Result<>("default").reason(DEFAULT.name())), - new TestCase<>("default") - .flag("null-context-values-flag") - .targetingKey("user-123") - .context("nullAttr", (String) null) - .result( - new Result<>("null-handled") - .reason(TARGETING_MATCH.name()) - .variant("null-variant")), - new TestCase<>("default") - .flag("invalid-regex-flag") - .targetingKey("user-123") - .context("email", "user@example.com") - .result(new Result<>("default").reason(ERROR.name()).errorCode(ErrorCode.PARSE_ERROR)), - new TestCase<>("default") - .flag("invalid-regex-not-matches-flag") - .targetingKey("user-123") - .context("email", "user@example.com") - .result(new Result<>("default").reason(ERROR.name()).errorCode(ErrorCode.PARSE_ERROR))); + @Test + public void testCanonicalFixturesArePresent() throws IOException { + assertThat(canonicalTestCases().size(), greaterThan(0)); } - @MethodSource("evaluateTestCases") - @ParameterizedTest - public void testEvaluate(final TestCase testCase) { + @MethodSource("canonicalTestCases") + @ParameterizedTest(name = "{0}") + public void testEvaluateCanonicalFixture(final FixtureCase testCase) throws IOException { final DDEvaluator evaluator = new DDEvaluator(mock(Runnable.class)); - evaluator.accept(createTestConfiguration()); - final ProviderEvaluation details = - evaluator.evaluate(testCase.type, testCase.flag, testCase.defaultValue, testCase.context); - final Result expected = testCase.result; - assertThat(details.getValue(), equalTo(expected.value)); - assertThat(details.getReason(), oneOf(expected.reason)); - assertThat(details.getVariant(), equalTo(expected.variant)); - assertThat(details.getErrorCode(), equalTo(expected.errorCode)); - assertThat(details.getErrorCode(), equalTo(expected.errorCode)); - final String expectedAllocation = (String) expected.flagMetadata.get("allocationKey"); - if (expectedAllocation != null) { - assertThat(details.getFlagMetadata().getString("allocationKey"), equalTo(expectedAllocation)); - } - if (shouldDispatchExposure(expected)) { - verify(exposureListener, times(1)).accept(exposureEventCaptor.capture()); - final ExposureEvent capturedEvent = exposureEventCaptor.getValue(); - assertThat(capturedEvent.flag.key, equalTo(testCase.flag)); - assertThat(capturedEvent.allocation.key, equalTo(expectedAllocation)); - assertThat(capturedEvent.variant.key, equalTo(testCase.result.variant)); - assertThat(capturedEvent.subject.id, equalTo(testCase.context.getTargetingKey())); - for (final Map.Entry entry : testCase.context.asObjectMap().entrySet()) { - assertThat(capturedEvent.subject.attributes, hasEntry(entry.getKey(), entry.getValue())); - } - } else { - verify(exposureListener, times(0)).accept(any(ExposureEvent.class)); - } - } - - private static boolean shouldDispatchExposure(final Result result) { - final Boolean doLog = (Boolean) result.flagMetadata.get("doLog"); - return doLog != null && doLog; - } - - private ServerConfiguration createTestConfiguration() { - final Map flags = new HashMap<>(); - flags.put( - "simple-string", createSimpleFlag("simple-string", ValueType.STRING, "test-value", "on")); - flags.put("boolean-flag", createSimpleFlag("boolean-flag", ValueType.BOOLEAN, true, "enabled")); - flags.put("integer-flag", createSimpleFlag("integer-flag", ValueType.INTEGER, 42, "forty-two")); - flags.put("double-flag", createSimpleFlag("double-flag", ValueType.NUMERIC, 3.14, "pi")); - flags.put( - "string-number-flag", - createSimpleFlag("string-number-flag", ValueType.STRING, "123", "string-num")); - flags.put("disabled-flag", new Flag("disabled-flag", false, ValueType.BOOLEAN, null, null)); - flags.put("rule-based-flag", createRuleBasedFlag()); - flags.put("numeric-rule-flag", createNumericRuleFlag()); - flags.put("null-check-flag", createNullCheckFlag()); - flags.put("region-flag", createOneOfRuleFlag()); - flags.put("time-based-flag", createTimeBasedFlag()); - flags.put("shard-flag", createShardBasedFlag()); - flags.put("broken-flag", createBrokenFlag()); - flags.put("lt-flag", createLessThanFlag()); - flags.put("lte-flag", createLessThanOrEqualFlag()); - flags.put("gt-flag", createGreaterThanFlag()); - flags.put("not-matches-flag", createNotMatchesFlag()); - flags.put("not-one-of-flag", createNotOneOfFlag()); - flags.put("double-equals-flag", createDoubleEqualsFlag()); - flags.put("nested-attr-flag", createNestedAttributeFlag()); - flags.put("exposure-flag", createExposureFlag()); - flags.put("exposure-logging-flag", createExposureLoggingFlag()); - flags.put("double-comparison-flag", createDoubleComparisonFlag()); - flags.put("numeric-one-of-flag", createNumericOneOfFlag()); - flags.put("numeric-not-one-of-flag", createNumericNotOneOfFlag()); - flags.put("is-null-false-flag", createIsNullFalseFlag()); - flags.put("is-null-non-boolean-flag", createIsNullNonBooleanFlag()); - flags.put("null-attribute-flag", createNullAttributeFlag()); - flags.put("not-matches-positive-flag", createNotMatchesPositiveFlag()); - flags.put("not-one-of-positive-flag", createNotOneOfPositiveFlag()); - flags.put("false-numeric-comparisons-flag", createFalseNumericComparisonsFlag()); - flags.put("empty-splits-flag", createEmptySplitsFlag()); - flags.put("empty-conditions-flag", createEmptyConditionsFlag()); - flags.put("shard-matching-flag", createShardMatchingFlag()); - flags.put("future-allocation-flag", createFutureAllocationFlag()); - flags.put("id-attribute-flag", createIdAttributeFlag()); - flags.put("non-iterable-condition-flag", createNonIterableConditionFlag()); - flags.put("gt-false-flag", createGtFalseFlag()); - flags.put("lte-false-flag", createLteFalseFlag()); - flags.put("lt-false-flag", createLtFalseFlag()); - flags.put("not-matches-false-flag", createNotMatchesFalseFlag()); - flags.put("not-one-of-false-flag", createNotOneOfFalseFlag()); - flags.put("null-context-values-flag", createNullContextValuesFlag()); - flags.put("country-rule-flag", createCountryRuleFlag()); - flags.put( - "integer-string-variant-flag", - createSimpleFlag("integer-string-variant-flag", ValueType.INTEGER, "not-a-number", "bad")); - flags.put("invalid-regex-flag", createInvalidRegexFlag()); - flags.put("invalid-regex-not-matches-flag", createInvalidRegexNotMatchesFlag()); - return new ServerConfiguration(null, null, null, flags); - } - - private Flag createSimpleFlag(String key, ValueType type, Object value, String variantKey) { - final Map variants = new HashMap<>(); - variants.put(variantKey, new Variant(variantKey, value)); - final List splits = singletonList(new Split(emptyList(), variantKey, null)); - final List allocations = - singletonList(new Allocation("alloc1", null, null, null, splits, false)); - return new Flag(key, true, type, variants, allocations); - } - - private Flag createRuleBasedFlag() { - final Map variants = new HashMap<>(); - variants.put("premium", new Variant("premium", "premium")); - variants.put("basic", new Variant("basic", "basic")); - - // Rule: email MATCHES @company.com$ -> premium - final List premiumConditions = - singletonList( - new ConditionConfiguration(ConditionOperator.MATCHES, "email", "@company\\.com$")); - final List premiumRules = singletonList(new Rule(premiumConditions)); - final List premiumSplits = singletonList(new Split(emptyList(), "premium", null)); - final Allocation premiumAllocation = - new Allocation("premium-alloc", premiumRules, null, null, premiumSplits, false); - - // Fallback allocation for basic - final List basicSplits = singletonList(new Split(emptyList(), "basic", null)); - final Allocation basicAllocation = - new Allocation("basic-alloc", null, null, null, basicSplits, false); - - final List allocations = asList(premiumAllocation, basicAllocation); - - return new Flag("rule-based-flag", true, ValueType.STRING, variants, allocations); - } - - private Flag createNumericRuleFlag() { - final Map variants = new HashMap<>(); - variants.put("vip", new Variant("vip", "vip")); - variants.put("regular", new Variant("regular", "regular")); - - // Rule: score >= 800 -> vip - final List vipConditions = - singletonList(new ConditionConfiguration(ConditionOperator.GTE, "score", 800)); - final List vipRules = singletonList(new Rule(vipConditions)); - final List vipSplits = singletonList(new Split(emptyList(), "vip", null)); - final Allocation vipAllocation = - new Allocation("vip-alloc", vipRules, null, null, vipSplits, false); - - // Fallback - final List regularSplits = singletonList(new Split(emptyList(), "regular", null)); - final Allocation regularAllocation = - new Allocation("regular-alloc", null, null, null, regularSplits, false); - - return new Flag( - "numeric-rule-flag", - true, - ValueType.STRING, - variants, - asList(vipAllocation, regularAllocation)); - } - - private Flag createNullCheckFlag() { - final Map variants = new HashMap<>(); - variants.put("no-beta", new Variant("no-beta", "no-beta")); - variants.put("has-beta", new Variant("has-beta", "has-beta")); - - // Rule: beta_feature IS_NULL (true) -> no-beta - final List noBetaConditions = - singletonList(new ConditionConfiguration(ConditionOperator.IS_NULL, "beta_feature", true)); - final List noBetaRules = singletonList(new Rule(noBetaConditions)); - final List noBetaSplits = singletonList(new Split(emptyList(), "no-beta", null)); - final Allocation noBetaAllocation = - new Allocation("no-beta-alloc", noBetaRules, null, null, noBetaSplits, false); - - // Fallback - final List hasBetaSplits = singletonList(new Split(emptyList(), "has-beta", null)); - final Allocation hasBetaAllocation = - new Allocation("has-beta-alloc", null, null, null, hasBetaSplits, false); - - return new Flag( - "null-check-flag", - true, - ValueType.STRING, - variants, - asList(noBetaAllocation, hasBetaAllocation)); - } - - private Flag createOneOfRuleFlag() { - final Map variants = new HashMap<>(); - variants.put("regional", new Variant("regional", "regional")); - variants.put("global", new Variant("global", "global")); - - // Rule: region ONE_OF [us-east-1, us-west-2, eu-west-1] -> regional - final List allowedRegions = asList("us-east-1", "us-west-2", "eu-west-1"); - final List regionalConditions = - singletonList( - new ConditionConfiguration(ConditionOperator.ONE_OF, "region", allowedRegions)); - final List regionalRules = singletonList(new Rule(regionalConditions)); - final List regionalSplits = singletonList(new Split(emptyList(), "regional", null)); - final Allocation regionalAllocation = - new Allocation("regional-alloc", regionalRules, null, null, regionalSplits, false); - - // Fallback - final List globalSplits = singletonList(new Split(emptyList(), "global", null)); - final Allocation globalAllocation = - new Allocation("global-alloc", null, null, null, globalSplits, false); - - return new Flag( - "region-flag", - true, - ValueType.STRING, - variants, - asList(regionalAllocation, globalAllocation)); - } - - private Flag createTimeBasedFlag() { - final Map variants = new HashMap<>(); - variants.put("time-limited", new Variant("time-limited", "time-limited")); - - final List splits = singletonList(new Split(emptyList(), "time-limited", null)); - - // Allocation that ended in 2022 (should be inactive) - final List allocations = - singletonList( - new Allocation( - "time-alloc", - null, - parseDate("2022-01-01T00:00:00Z"), - parseDate("2022-12-31T23:59:59Z"), - splits, - false)); - - return new Flag("time-based-flag", true, ValueType.STRING, variants, allocations); - } - - private Flag createShardBasedFlag() { - final Map variants = new HashMap<>(); - variants.put("shard-variant", new Variant("shard-variant", "shard-value")); - - // Create a shard that includes some range - final List ranges = singletonList(new ShardRange(0, 50)); // 0-49 out of 100 - final List shards = singletonList(new Shard("test-salt", ranges, 100)); - - final List splits = singletonList(new Split(shards, "shard-variant", null)); - - final List allocations = - singletonList(new Allocation("shard-alloc", null, null, null, splits, false)); - - return new Flag("shard-flag", true, ValueType.STRING, variants, allocations); - } - - private Flag createBrokenFlag() { - // Create a flag with missing variant - final Map variants = new HashMap<>(); - variants.put("existing", new Variant("existing", "value")); - - final List splits = singletonList(new Split(emptyList(), "missing-variant", null)); - - final List allocations = - singletonList(new Allocation("alloc1", null, null, null, splits, false)); - - return new Flag("broken-flag", true, ValueType.STRING, variants, allocations); - } - - private Flag createComparisonFlag( - String flagKey, - String allocKey, - String variantKey, - String variantValue, - ConditionOperator operator, - String attribute, - Object threshold) { - final Map variants = new HashMap<>(); - variants.put(variantKey, new Variant(variantKey, variantValue)); - - final List conditions = - singletonList(new ConditionConfiguration(operator, attribute, threshold)); - final List rules = singletonList(new Rule(conditions)); - final List splits = singletonList(new Split(emptyList(), variantKey, null)); - final Allocation allocation = new Allocation(allocKey, rules, null, null, splits, false); - - return new Flag(flagKey, true, ValueType.STRING, variants, singletonList(allocation)); - } - - private Flag createLessThanFlag() { - return createComparisonFlag( - "lt-flag", "low-alloc", "low", "low-score", ConditionOperator.LT, "score", 800); - } - - private Flag createLessThanOrEqualFlag() { - return createComparisonFlag( - "lte-flag", "medium-alloc", "medium", "medium-score", ConditionOperator.LTE, "score", 800); - } - - private Flag createGreaterThanFlag() { - return createComparisonFlag( - "gt-flag", "high-alloc", "high", "high-score", ConditionOperator.GT, "score", 900); - } - - private Flag createNotOperatorFlag( - String flagKey, - String allocKey, - String variantKey, - String variantValue, - ConditionOperator operator, - String attribute, - Object value) { - final Map variants = new HashMap<>(); - variants.put(variantKey, new Variant(variantKey, variantValue)); - - final List conditions = - singletonList(new ConditionConfiguration(operator, attribute, value)); - final List rules = singletonList(new Rule(conditions)); - final List splits = singletonList(new Split(emptyList(), variantKey, null)); - final Allocation allocation = new Allocation(allocKey, rules, null, null, splits, false); - - return new Flag(flagKey, true, ValueType.STRING, variants, singletonList(allocation)); - } - - private Flag createNotMatchesFlag() { - return createNotOperatorFlag( - "not-matches-flag", - "external-alloc", - "external", - "external", - ConditionOperator.NOT_MATCHES, - "email", - "@company\\.com$"); - } - - private Flag createNotOneOfFlag() { - final List disallowedRegions = asList("us-east-1", "us-west-2", "eu-west-1"); - return createNotOperatorFlag( - "not-one-of-flag", - "other-alloc", - "other", - "other-region", - ConditionOperator.NOT_ONE_OF, - "region", - disallowedRegions); - } - - private Flag createDoubleEqualsFlag() { - final Map variants = new HashMap<>(); - variants.put("pi", new Variant("pi", "pi-value")); - - // This will test the double comparison in valuesEqual - match exact double value - final List piConditions = - singletonList(new ConditionConfiguration(ConditionOperator.MATCHES, "rate", "3.14159")); - final List piRules = singletonList(new Rule(piConditions)); - final List piSplits = singletonList(new Split(emptyList(), "pi", null)); - final Allocation piAllocation = - new Allocation("pi-alloc", piRules, null, null, piSplits, false); - - return new Flag( - "double-equals-flag", true, ValueType.STRING, variants, singletonList(piAllocation)); - } - - private Flag createNestedAttributeFlag() { - final Map variants = new HashMap<>(); - variants.put("premium", new Variant("premium", "premium-user")); - - // Rule: user.profile.level MATCHES premium -> premium - final List premiumConditions = - singletonList( - new ConditionConfiguration(ConditionOperator.MATCHES, "user.profile.level", "premium")); - final List premiumRules = singletonList(new Rule(premiumConditions)); - final List premiumSplits = singletonList(new Split(emptyList(), "premium", null)); - final Allocation premiumAllocation = - new Allocation("premium-nested-alloc", premiumRules, null, null, premiumSplits, false); - - return new Flag( - "nested-attr-flag", true, ValueType.STRING, variants, singletonList(premiumAllocation)); - } - - private Flag createExposureFlag() { - final Map variants = new HashMap<>(); - variants.put("tracked", new Variant("tracked", "tracked-value")); - - final List splits = singletonList(new Split(emptyList(), "tracked", null)); - // Create allocation with doLog=true to trigger exposure logging - final List allocations = - singletonList(new Allocation("exposure-alloc", null, null, null, splits, true)); - - return new Flag("exposure-flag", true, ValueType.STRING, variants, allocations); - } - - private Flag createDoubleComparisonFlag() { - final Map variants = new HashMap<>(); - variants.put("exact", new Variant("exact", "exact-match")); - - // This flag uses numeric comparison that will trigger the double comparison lambda - final List exactConditions = - singletonList(new ConditionConfiguration(ConditionOperator.LTE, "score", 3.14159)); - final List exactRules = singletonList(new Rule(exactConditions)); - final List exactSplits = singletonList(new Split(emptyList(), "exact", null)); - final Allocation exactAllocation = - new Allocation("exact-alloc", exactRules, null, null, exactSplits, false); - - return new Flag( - "double-comparison-flag", true, ValueType.STRING, variants, singletonList(exactAllocation)); - } + evaluator.accept(loadCanonicalConfiguration()); - private Flag createExposureLoggingFlag() { - final Map variants = new HashMap<>(); - variants.put("logged", new Variant("logged", "logged-value")); - - // Rule: feature MATCHES premium -> logged - final List loggedConditions = - singletonList(new ConditionConfiguration(ConditionOperator.MATCHES, "feature", "premium")); - final List loggedRules = singletonList(new Rule(loggedConditions)); - final List loggedSplits = singletonList(new Split(emptyList(), "logged", null)); - // Create allocation with doLog=true to trigger exposure logging and allocationKey method - final Allocation loggedAllocation = - new Allocation("logged-alloc", loggedRules, null, null, loggedSplits, true); - - return new Flag( - "exposure-logging-flag", true, ValueType.STRING, variants, singletonList(loggedAllocation)); - } - - private Flag createNumericOneOfFlag() { - final Map variants = new HashMap<>(); - variants.put("numeric-match", new Variant("numeric-match", "numeric-matched")); - - // Rule: score ONE_OF [3.14159, 2.71828] -> numeric-match - // This will trigger valuesEqual with numeric comparison via lambda$valuesEqual$4 - final List numericValues = asList(3.14159, 2.71828); - final List numericConditions = - singletonList(new ConditionConfiguration(ConditionOperator.ONE_OF, "score", numericValues)); - final List numericRules = singletonList(new Rule(numericConditions)); - final List numericSplits = singletonList(new Split(emptyList(), "numeric-match", null)); - final Allocation numericAllocation = - new Allocation("numeric-alloc", numericRules, null, null, numericSplits, false); - - return new Flag( - "numeric-one-of-flag", true, ValueType.STRING, variants, singletonList(numericAllocation)); - } - - private Flag createNumericNotOneOfFlag() { - final Map variants = new HashMap<>(); - variants.put("excluded", new Variant("excluded", "not-in-set")); - - // Rule: score NOT_ONE_OF [1.0, 2.0, 3.0] -> excluded - // This will trigger valuesEqual with numeric comparison via lambda$valuesEqual$4 - final List excludedValues = asList(1.0, 2.0, 3.0); - final List excludedConditions = - singletonList( - new ConditionConfiguration(ConditionOperator.NOT_ONE_OF, "score", excludedValues)); - final List excludedRules = singletonList(new Rule(excludedConditions)); - final List excludedSplits = singletonList(new Split(emptyList(), "excluded", null)); - final Allocation excludedAllocation = - new Allocation("excluded-alloc", excludedRules, null, null, excludedSplits, false); - - return new Flag( - "numeric-not-one-of-flag", - true, - ValueType.STRING, - variants, - singletonList(excludedAllocation)); - } - - private Flag createIsNullFalseFlag() { - final Map variants = new HashMap<>(); - variants.put("not-null", new Variant("not-null", "not-null")); - - // Rule: attr IS_NULL false -> not-null (checks if attr is NOT null) - final List notNullConditions = - singletonList(new ConditionConfiguration(ConditionOperator.IS_NULL, "attr", false)); - final List notNullRules = singletonList(new Rule(notNullConditions)); - final List notNullSplits = singletonList(new Split(emptyList(), "not-null", null)); - final Allocation notNullAllocation = - new Allocation("not-null-alloc", notNullRules, null, null, notNullSplits, false); - - return new Flag( - "is-null-false-flag", true, ValueType.STRING, variants, singletonList(notNullAllocation)); - } - - private Flag createIsNullNonBooleanFlag() { - final Map variants = new HashMap<>(); - variants.put("null-match", new Variant("null-match", "null-match")); - - // Rule: missing_attr IS_NULL "string" -> null-match (non-boolean expectedNull value) - final List nullConditions = - singletonList( - new ConditionConfiguration(ConditionOperator.IS_NULL, "missing_attr", "string")); - final List nullRules = singletonList(new Rule(nullConditions)); - final List nullSplits = singletonList(new Split(emptyList(), "null-match", null)); - final Allocation nullAllocation = - new Allocation("null-alloc", nullRules, null, null, nullSplits, false); - - return new Flag( - "is-null-non-boolean-flag", - true, - ValueType.STRING, - variants, - singletonList(nullAllocation)); - } - - private Flag createNullAttributeFlag() { - final Map variants = new HashMap<>(); - variants.put("fallback", new Variant("fallback", "fallback")); - - // Rule: null_attribute MATCHES "test" -> should not match due to null attribute - final List nullAttrConditions = - singletonList(new ConditionConfiguration(ConditionOperator.MATCHES, null, "test")); - final List nullAttrRules = singletonList(new Rule(nullAttrConditions)); - final List nullAttrSplits = singletonList(new Split(emptyList(), "fallback", null)); - final Allocation nullAttrAllocation = - new Allocation("null-attr-alloc", nullAttrRules, null, null, nullAttrSplits, false); - - return new Flag( - "null-attribute-flag", true, ValueType.STRING, variants, singletonList(nullAttrAllocation)); - } - - private Flag createNotMatchesPositiveFlag() { - final Map variants = new HashMap<>(); - variants.put("external", new Variant("external", "external-email")); - - // Rule: email NOT_MATCHES "@company.com" -> external (should match gmail.com) - final List externalConditions = - singletonList( - new ConditionConfiguration(ConditionOperator.NOT_MATCHES, "email", "@company\\.com")); - final List externalRules = singletonList(new Rule(externalConditions)); - final List externalSplits = singletonList(new Split(emptyList(), "external", null)); - final Allocation externalAllocation = - new Allocation("external-alloc", externalRules, null, null, externalSplits, false); - - return new Flag( - "not-matches-positive-flag", - true, - ValueType.STRING, - variants, - singletonList(externalAllocation)); - } - - private Flag createNotOneOfPositiveFlag() { - final Map variants = new HashMap<>(); - variants.put("other", new Variant("other", "other-region")); - - // Rule: region NOT_ONE_OF ["us-east-1", "us-west-2", "eu-west-1"] -> other - final List excludedRegions = asList("us-east-1", "us-west-2", "eu-west-1"); - final List otherConditions = - singletonList( - new ConditionConfiguration(ConditionOperator.NOT_ONE_OF, "region", excludedRegions)); - final List otherRules = singletonList(new Rule(otherConditions)); - final List otherSplits = singletonList(new Split(emptyList(), "other", null)); - final Allocation otherAllocation = - new Allocation("other-alloc", otherRules, null, null, otherSplits, false); - - return new Flag( - "not-one-of-positive-flag", - true, - ValueType.STRING, - variants, - singletonList(otherAllocation)); - } - - private Flag createFalseNumericComparisonsFlag() { - final Map variants = new HashMap<>(); - variants.put("high-score", new Variant("high-score", "high-score")); - - // Rule: score GTE 800 -> high-score (test will provide 750, should fail) - final List highScoreConditions = - singletonList(new ConditionConfiguration(ConditionOperator.GTE, "score", 800)); - final List highScoreRules = singletonList(new Rule(highScoreConditions)); - final List highScoreSplits = singletonList(new Split(emptyList(), "high-score", null)); - final Allocation highScoreAllocation = - new Allocation("high-score-alloc", highScoreRules, null, null, highScoreSplits, false); - - return new Flag( - "false-numeric-comparisons-flag", - true, - ValueType.STRING, - variants, - singletonList(highScoreAllocation)); - } - - private Flag createEmptySplitsFlag() { - final Map variants = new HashMap<>(); - variants.put("default", new Variant("default", "default")); - - // Allocation with null splits - final Allocation allocation = - new Allocation("empty-splits-alloc", null, null, null, null, false); - - return new Flag( - "empty-splits-flag", true, ValueType.STRING, variants, singletonList(allocation)); - } - - private Flag createEmptyConditionsFlag() { - final Map variants = new HashMap<>(); - variants.put("default", new Variant("default", "default")); - - // Rule with empty conditions list - this will be skipped, causing allocation to not match - final Rule emptyConditionsRule = new Rule(emptyList()); - final List splits = singletonList(new Split(emptyList(), "default", null)); - final Allocation allocation = - new Allocation( - "empty-conditions-alloc", - singletonList(emptyConditionsRule), - null, - null, - splits, - false); - - return new Flag( - "empty-conditions-flag", true, ValueType.STRING, variants, singletonList(allocation)); - } - - private Flag createShardMatchingFlag() { - final Map variants = new HashMap<>(); - variants.put("matched", new Variant("matched", "shard-matched")); - - // Create shard that will match the specific targeting key - final List ranges = - singletonList(new ShardRange(0, 100)); // Full range to ensure match - final List shards = singletonList(new Shard("test-salt", ranges, 100)); - final List splits = singletonList(new Split(shards, "matched", null)); - final Allocation allocation = - new Allocation("shard-matching-alloc", null, null, null, splits, false); - - return new Flag( - "shard-matching-flag", true, ValueType.STRING, variants, singletonList(allocation)); - } - - private Flag createFutureAllocationFlag() { - final Map variants = new HashMap<>(); - variants.put("future", new Variant("future", "future-value")); - - final List splits = singletonList(new Split(emptyList(), "future", null)); - - // Allocation that starts in the future (2050) - final Allocation allocation = - new Allocation( - "future-alloc", null, parseDate("2050-01-01T00:00:00Z"), null, splits, false); - - return new Flag( - "future-allocation-flag", true, ValueType.STRING, variants, singletonList(allocation)); - } - - private Flag createIdAttributeFlag() { - final Map variants = new HashMap<>(); - variants.put("id-match", new Variant("id-match", "id-resolved")); - - // Rule that checks for "id" attribute (will use targeting key if not provided) - final List conditions = - singletonList( - new ConditionConfiguration(ConditionOperator.MATCHES, "id", "user-special-id")); - final List rules = singletonList(new Rule(conditions)); - final List splits = singletonList(new Split(emptyList(), "id-match", null)); - final Allocation allocation = new Allocation("id-attr-alloc", rules, null, null, splits, false); - - return new Flag( - "id-attribute-flag", true, ValueType.STRING, variants, singletonList(allocation)); - } - - private Flag createNonIterableConditionFlag() { - final Map variants = new HashMap<>(); - variants.put("no-match", new Variant("no-match", "no-match")); - - // Rule with ONE_OF condition but non-iterable value (String instead of List) - final List conditions = - singletonList(new ConditionConfiguration(ConditionOperator.ONE_OF, "attr", "single-value")); - final List rules = singletonList(new Rule(conditions)); - final List splits = singletonList(new Split(emptyList(), "no-match", null)); - final Allocation allocation = - new Allocation("non-iterable-alloc", rules, null, null, splits, false); - - return new Flag( - "non-iterable-condition-flag", true, ValueType.STRING, variants, singletonList(allocation)); - } - - private Flag createGtFalseFlag() { - return createComparisonFlag( - "gt-false-flag", - "gt-false-alloc", - "high", - "high-value", - ConditionOperator.GT, - "score", - 600); - } - - private Flag createLteFalseFlag() { - return createComparisonFlag( - "lte-false-flag", - "lte-false-alloc", - "low", - "low-value", - ConditionOperator.LTE, - "score", - 500); - } - - private Flag createLtFalseFlag() { - return createComparisonFlag( - "lt-false-flag", - "lt-false-alloc", - "very-low", - "very-low-value", - ConditionOperator.LT, - "score", - 600); - } - - private Flag createNotMatchesFalseFlag() { - final Map variants = new HashMap<>(); - variants.put("internal", new Variant("internal", "internal-email")); - - // Rule: email NOT_MATCHES "@company.com" -> internal (test provides company.com, should fail) - final List conditions = - singletonList( - new ConditionConfiguration(ConditionOperator.NOT_MATCHES, "email", "@company\\.com")); - final List rules = singletonList(new Rule(conditions)); - final List splits = singletonList(new Split(emptyList(), "internal", null)); - final Allocation allocation = - new Allocation("not-matches-false-alloc", rules, null, null, splits, false); + final Class targetType = targetType(testCase.variationType); + final Object defaultValue = mapFixtureValue(targetType, testCase.defaultValue); + final Object expectedValue = mapFixtureValue(targetType, testCase.result.value); + final ProviderEvaluation details = + evaluate(evaluator, targetType, testCase.flag, defaultValue, context(testCase)); - return new Flag( - "not-matches-false-flag", true, ValueType.STRING, variants, singletonList(allocation)); + assertThat(details.getValue(), equalTo(expectedValue)); + assertThat(details.getReason(), equalTo(testCase.result.reason)); + if (testCase.result.variant != null) { + assertThat(details.getVariant(), equalTo(testCase.result.variant)); + } + if (testCase.result.errorCode != null) { + assertThat(details.getErrorCode(), equalTo(ErrorCode.valueOf(testCase.result.errorCode))); + } + if (testCase.result.flagMetadata != null + && testCase.result.flagMetadata.get("allocationKey") != null) { + assertThat( + details.getFlagMetadata().getString("allocationKey"), + equalTo(String.valueOf(testCase.result.flagMetadata.get("allocationKey")))); + } } - private Flag createNotOneOfFalseFlag() { - final Map variants = new HashMap<>(); - variants.put("excluded", new Variant("excluded", "excluded-region")); - - // Rule: region NOT_ONE_OF ["us-east-1", "us-west-2"] -> excluded (test provides us-east-1, - // should fail) - final List excludedRegions = asList("us-east-1", "us-west-2"); - final List conditions = - singletonList( - new ConditionConfiguration(ConditionOperator.NOT_ONE_OF, "region", excludedRegions)); - final List rules = singletonList(new Rule(conditions)); - final List splits = singletonList(new Split(emptyList(), "excluded", null)); - final Allocation allocation = - new Allocation("not-one-of-false-alloc", rules, null, null, splits, false); + @SuppressWarnings({"rawtypes", "unchecked"}) + private static ProviderEvaluation evaluate( + final DDEvaluator evaluator, + final Class targetType, + final String flag, + final Object defaultValue, + final EvaluationContext context) { + return evaluator.evaluate((Class) targetType, flag, defaultValue, context); + } + + private static ServerConfiguration loadCanonicalConfiguration() throws IOException { + return CONFIG_ADAPTER.fromJson(read(fixtureRoot().resolve("ufc-config.json"))); + } + + private static List canonicalTestCases() throws IOException { + final Path evaluationCases = fixtureRoot().resolve("evaluation-cases"); + final List result = new ArrayList<>(); + + try (final Stream paths = Files.list(evaluationCases)) { + final List files = + paths + .filter(path -> path.getFileName().toString().endsWith(".json")) + .sorted((left, right) -> left.getFileName().compareTo(right.getFileName())) + .collect(Collectors.toList()); + for (final Path file : files) { + final List testCases = FIXTURE_LIST_ADAPTER.fromJson(read(file)); + if (testCases == null) { + throw new JsonDataException("Fixture file did not contain an array: " + file); + } + for (int index = 0; index < testCases.size(); index++) { + final FixtureCase testCase = testCases.get(index); + testCase.fileName = file.getFileName().toString(); + testCase.index = index; + result.add(testCase); + } + } + } - return new Flag( - "not-one-of-false-flag", true, ValueType.STRING, variants, singletonList(allocation)); + assertThat(result.size(), greaterThan(0)); + return result; } - private Flag createNullContextValuesFlag() { - final Map variants = new HashMap<>(); - variants.put("null-variant", new Variant("null-variant", "null-handled")); - - // Rule that will handle null context values in flattening - final List conditions = - singletonList(new ConditionConfiguration(ConditionOperator.IS_NULL, "nullAttr", true)); - final List rules = singletonList(new Rule(conditions)); - final List splits = singletonList(new Split(emptyList(), "null-variant", null)); - final Allocation allocation = - new Allocation("null-context-alloc", rules, null, null, splits, false); - - return new Flag( - "null-context-values-flag", true, ValueType.STRING, variants, singletonList(allocation)); + private static Path fixtureRoot() { + Path directory = Paths.get("").toAbsolutePath(); + while (directory != null) { + final Path candidate = directory.resolve(CANONICAL_FIXTURE_PATH); + if (Files.exists(candidate.resolve("ufc-config.json")) + && Files.isDirectory(candidate.resolve("evaluation-cases"))) { + return candidate; + } + directory = directory.getParent(); + } + throw new IllegalStateException("Unable to find canonical FFE fixtures"); } - private Flag createCountryRuleFlag() { - final Map variants = new HashMap<>(); - variants.put("us", new Variant("us", "us-value")); - variants.put("global", new Variant("global", "global-value")); - - // Rule: country ONE_OF ["US"] -> us (no shards, so null targeting key is fine) - final List usCountries = singletonList("US"); - final List usConditions = - singletonList(new ConditionConfiguration(ConditionOperator.ONE_OF, "country", usCountries)); - final List usRules = singletonList(new Rule(usConditions)); - final List usSplits = singletonList(new Split(emptyList(), "us", null)); - final Allocation usAllocation = - new Allocation("us-alloc", usRules, null, null, usSplits, false); - - // Fallback allocation (no rules, no shards) - final List globalSplits = singletonList(new Split(emptyList(), "global", null)); - final Allocation globalAllocation = - new Allocation("global-alloc", null, null, null, globalSplits, false); - - return new Flag( - "country-rule-flag", - true, - ValueType.STRING, - variants, - asList(usAllocation, globalAllocation)); + private static String read(final Path path) throws IOException { + return new String(Files.readAllBytes(path), StandardCharsets.UTF_8); } - private Flag createInvalidRegexFlag() { - final Map variants = new HashMap<>(); - variants.put("matched", new Variant("matched", "matched-value")); - - // Condition with an intentionally invalid regex pattern (unclosed bracket) - final List conditions = - singletonList(new ConditionConfiguration(ConditionOperator.MATCHES, "email", "[invalid")); - final List rules = singletonList(new Rule(conditions)); - final List splits = singletonList(new Split(emptyList(), "matched", null)); - final Allocation allocation = - new Allocation("invalid-regex-alloc", rules, null, null, splits, false); - - return new Flag( - "invalid-regex-flag", true, ValueType.STRING, variants, singletonList(allocation)); + private static EvaluationContext context(final FixtureCase testCase) { + final Map attributes = + testCase.attributes == null ? emptyMap() : testCase.attributes; + final MutableContext context = + new MutableContext(Value.objectToValue(attributes).asStructure().asMap()); + if (testCase.targetingKey != null) { + context.setTargetingKey(testCase.targetingKey); + } + return context; + } + + private static Class targetType(final String variationType) { + switch (variationType) { + case "BOOLEAN": + return Boolean.class; + case "INTEGER": + return Integer.class; + case "NUMERIC": + return Double.class; + case "STRING": + return String.class; + case "JSON": + return Value.class; + default: + throw new IllegalArgumentException("Unsupported variationType: " + variationType); + } } - private Flag createInvalidRegexNotMatchesFlag() { - final Map variants = new HashMap<>(); - variants.put("excluded", new Variant("excluded", "excluded-value")); - - // Condition with an intentionally invalid regex pattern (unclosed bracket) under NOT_MATCHES - final List conditions = - singletonList( - new ConditionConfiguration(ConditionOperator.NOT_MATCHES, "email", "[invalid")); - final List rules = singletonList(new Rule(conditions)); - final List splits = singletonList(new Split(emptyList(), "excluded", null)); - final Allocation allocation = - new Allocation("invalid-regex-not-matches-alloc", rules, null, null, splits, false); - - return new Flag( - "invalid-regex-not-matches-flag", - true, - ValueType.STRING, - variants, - singletonList(allocation)); + private static Object mapFixtureValue(final Class targetType, final Object value) { + return DDEvaluator.mapValue(targetType, value); } private static Map mapOf(final Object... props) { @@ -1329,13 +362,50 @@ private static Map mapOf(final Object... props) { return result; } - private static Date parseDate(String dateString) { - try { - SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"); - formatter.setTimeZone(TimeZone.getTimeZone("UTC")); - return formatter.parse(dateString); - } catch (ParseException e) { - throw new RuntimeException("Failed to parse date: " + dateString, e); + private static final class FixtureCase { + Map attributes = emptyMap(); + Object defaultValue; + String flag; + FixtureResult result; + String targetingKey; + String variationType; + transient String fileName; + transient int index; + + @Override + public String toString() { + return fileName + "[" + index + "] flag=" + flag; + } + } + + private static final class FixtureResult { + Object value; + String reason; + String errorCode; + String variant; + Map flagMetadata = emptyMap(); + } + + private static final class DateAdapter extends JsonAdapter { + @Override + public Date fromJson(final JsonReader reader) throws IOException { + if (reader.peek() == JsonReader.Token.NULL) { + return reader.nextNull(); + } + try { + return Date.from(OffsetDateTime.parse(reader.nextString()).toInstant()); + } catch (final Exception ignored) { + return null; + } + } + + @Override + public void toJson(final JsonWriter writer, final Date value) throws IOException { + if (value == null) { + writer.nullValue(); + return; + } + writer.value(value.toInstant().toString()); } } } diff --git a/products/feature-flagging/feature-flagging-api/src/test/java/datadog/trace/api/openfeature/FlagEvalMetricsTest.java b/products/feature-flagging/feature-flagging-api/src/test/java/datadog/trace/api/openfeature/FlagEvalMetricsTest.java index cec9b2d0eb7..214fadc7274 100644 --- a/products/feature-flagging/feature-flagging-api/src/test/java/datadog/trace/api/openfeature/FlagEvalMetricsTest.java +++ b/products/feature-flagging/feature-flagging-api/src/test/java/datadog/trace/api/openfeature/FlagEvalMetricsTest.java @@ -1,6 +1,5 @@ package datadog.trace.api.openfeature; -import static org.junit.jupiter.api.Assertions.assertEquals; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.verify; @@ -9,12 +8,6 @@ import dev.openfeature.sdk.ErrorCode; import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.metrics.LongCounter; -import io.opentelemetry.sdk.metrics.SdkMeterProvider; -import io.opentelemetry.sdk.metrics.data.AggregationTemporality; -import io.opentelemetry.sdk.metrics.data.LongPointData; -import io.opentelemetry.sdk.metrics.data.MetricData; -import io.opentelemetry.sdk.testing.exporter.InMemoryMetricReader; -import java.util.Collection; import org.junit.jupiter.api.Test; import org.mockito.ArgumentCaptor; @@ -145,32 +138,9 @@ void shutdownClearsCounter() { } @Test - void multipleRecordCallsAccumulateCumulativelyInExportedMetrics() { - // InMemoryMetricReader defaults to cumulative temporality. This validates that N record() - // calls produce a cumulative sum of N, matching the alwaysCumulative() selector configured - // on the production OTLP exporter in FlagEvalMetrics. - InMemoryMetricReader reader = InMemoryMetricReader.create(); - SdkMeterProvider provider = SdkMeterProvider.builder().registerMetricReader(reader).build(); - - try (FlagEvalMetrics metrics = new FlagEvalMetrics(provider)) { - for (int i = 0; i < 5; i++) { - metrics.record("count-flag", "on", "STATIC", null, "default-alloc"); - } - - Collection data = reader.collectAllMetrics(); - MetricData metric = - data.stream() - .filter(m -> m.getName().equals("feature_flag.evaluations")) - .findFirst() - .orElseThrow(() -> new AssertionError("feature_flag.evaluations metric not found")); - - assertEquals( - AggregationTemporality.CUMULATIVE, - metric.getLongSumData().getAggregationTemporality(), - "Exported metric must use CUMULATIVE temporality"); - - LongPointData point = metric.getLongSumData().getPoints().iterator().next(); - assertEquals(5L, point.getValue(), "5 record() calls must produce a cumulative sum of 5"); + void defaultConstructorUsesOpenTelemetryApiOnly() { + try (FlagEvalMetrics metrics = new FlagEvalMetrics()) { + metrics.record("count-flag", "on", "STATIC", null, "default-alloc"); } } diff --git a/products/feature-flagging/feature-flagging-api/src/test/java/datadog/trace/api/openfeature/ProviderTest.java b/products/feature-flagging/feature-flagging-api/src/test/java/datadog/trace/api/openfeature/ProviderTest.java index 87a80f59e20..27d4dd5d2b5 100644 --- a/products/feature-flagging/feature-flagging-api/src/test/java/datadog/trace/api/openfeature/ProviderTest.java +++ b/products/feature-flagging/feature-flagging-api/src/test/java/datadog/trace/api/openfeature/ProviderTest.java @@ -9,7 +9,6 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.anyLong; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.times; @@ -20,6 +19,7 @@ import datadog.trace.api.featureflag.ufc.v1.ServerConfiguration; import datadog.trace.api.openfeature.Provider.Options; import dev.openfeature.sdk.Client; +import dev.openfeature.sdk.ErrorCode; import dev.openfeature.sdk.EvaluationContext; import dev.openfeature.sdk.EventDetails; import dev.openfeature.sdk.Features; @@ -32,9 +32,12 @@ import dev.openfeature.sdk.Value; import dev.openfeature.sdk.exceptions.FatalError; import dev.openfeature.sdk.exceptions.ProviderNotReadyError; +import java.lang.reflect.Field; import java.util.List; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.atomic.AtomicReference; import java.util.function.Consumer; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; @@ -79,46 +82,228 @@ public void testSetProvider() { } @Test - public void testSetProviderAndWait() { + public void testSetProviderAndWait() throws Exception { final OpenFeatureAPI api = OpenFeatureAPI.getInstance(); - executor.submit(() -> api.setProviderAndWait(new Provider())); + final Future provider = executor.submit(() -> api.setProviderAndWait(new Provider())); final Client client = api.getClient(); assertThat(client.getProviderState(), equalTo(ProviderState.NOT_READY)); FeatureFlaggingGateway.dispatch(mock(ServerConfiguration.class)); await().atMost(ofSeconds(1)).until(() -> client.getProviderState() == ProviderState.READY); + provider.get(1, SECONDS); } @Test - public void testSetProviderAndWaitTimeout() { + public void testSetProviderAndWaitTimeoutRecoversWhenConfigurationArrives() { final Consumer readyEvent = mock(Consumer.class); final OpenFeatureAPI api = OpenFeatureAPI.getInstance(); final Client client = api.getClient(); client.on(ProviderEvent.PROVIDER_READY, readyEvent); - // we time out after 10 millis without receiving the initial config assertThrows( ProviderNotReadyError.class, () -> api.setProviderAndWait(new Provider(new Options().initTimeout(10, MILLISECONDS)))); - // ready has not yet been called + assertThat(client.getProviderState(), equalTo(ProviderState.ERROR)); verify(readyEvent, times(0)).accept(any()); - // dispatch an initial configuration FeatureFlaggingGateway.dispatch(mock(ServerConfiguration.class)); - // ready is called after receiving the configuration await() .atMost(ofSeconds(1)) .untilAsserted( () -> { + assertThat(client.getProviderState(), equalTo(ProviderState.READY)); verify(readyEvent, times(1)).accept(eventDetailsCaptor.capture()); - final EventDetails details = eventDetailsCaptor.getValue(); - assertThat(details.getProviderName(), equalTo(METADATA)); + final EventDetails eventDetails = eventDetailsCaptor.getValue(); + assertThat(eventDetails.getProviderName(), equalTo(METADATA)); }); } + @Test + public void testSetProviderAndWaitCompletesWhenConfigurationArrivesAtTimeoutBoundary() + throws Exception { + final Provider[] providerRef = new Provider[1]; + final Evaluator evaluator = + new Evaluator() { + private boolean hasConfiguration; + + @Override + public boolean initialize( + final long timeout, + final java.util.concurrent.TimeUnit timeUnit, + final EvaluationContext context) { + hasConfiguration = true; + providerRef[0].onConfigurationChange(); + return false; + } + + @Override + public boolean hasConfiguration() { + return hasConfiguration; + } + + @Override + public void shutdown() {} + + @Override + public ProviderEvaluation evaluate( + final Class target, + final String key, + final T defaultValue, + final EvaluationContext context) { + return ProviderEvaluation.builder().value(defaultValue).build(); + } + }; + + final OpenFeatureAPI api = OpenFeatureAPI.getInstance(); + providerRef[0] = new Provider(new Options().initTimeout(10, MILLISECONDS), evaluator); + api.setProviderAndWait(providerRef[0]); + + final Client client = api.getClient(); + assertThat(client.getProviderState(), equalTo(ProviderState.READY)); + } + + @Test + public void testSetProviderAndWaitFailsWhenConfigurationIsRemovedBeforeInitializationCompletes() { + final Provider[] providerRef = new Provider[1]; + final Evaluator evaluator = + new Evaluator() { + private boolean hasConfiguration; + + @Override + public boolean initialize( + final long timeout, + final java.util.concurrent.TimeUnit timeUnit, + final EvaluationContext context) { + hasConfiguration = true; + providerRef[0].onConfigurationChange(); + hasConfiguration = false; + providerRef[0].onConfigurationChange(); + return true; + } + + @Override + public boolean hasConfiguration() { + return hasConfiguration; + } + + @Override + public void shutdown() {} + + @Override + public ProviderEvaluation evaluate( + final Class target, + final String key, + final T defaultValue, + final EvaluationContext context) { + return ProviderEvaluation.builder().value(defaultValue).build(); + } + }; + + final OpenFeatureAPI api = OpenFeatureAPI.getInstance(); + providerRef[0] = new Provider(new Options().initTimeout(10, MILLISECONDS), evaluator); + + assertThrows(ProviderNotReadyError.class, () -> api.setProviderAndWait(providerRef[0])); + + final Client client = api.getClient(); + assertThat(client.getProviderState(), equalTo(ProviderState.ERROR)); + } + + @Test + public void testInitializationErrorDoesNotOverwriteRecoveredReadyState() throws Exception { + final Provider[] providerRef = new Provider[1]; + final Evaluator evaluator = + new Evaluator() { + private boolean hasConfiguration; + + @Override + public boolean initialize( + final long timeout, + final java.util.concurrent.TimeUnit timeUnit, + final EvaluationContext context) { + hasConfiguration = true; + providerRef[0].onConfigurationChange(); + hasConfiguration = false; + providerRef[0].onConfigurationChange(); + hasConfiguration = true; + providerRef[0].onConfigurationChange(); + throw new ProviderNotReadyError( + "Provider timed-out while waiting for initial configuration"); + } + + @Override + public boolean hasConfiguration() { + return hasConfiguration; + } + + @Override + public void shutdown() {} + + @Override + public ProviderEvaluation evaluate( + final Class target, + final String key, + final T defaultValue, + final EvaluationContext context) { + return ProviderEvaluation.builder().value(defaultValue).build(); + } + }; + + providerRef[0] = new Provider(new Options().initTimeout(10, MILLISECONDS), evaluator); + + assertThrows(ProviderNotReadyError.class, () -> providerRef[0].initialize(null)); + + assertThat(initializationState(providerRef[0]), equalTo("READY")); + } + + @Test + public void testNullConfigurationAfterReadyTransitionsToErrorAndRecovers() { + final OpenFeatureAPI api = OpenFeatureAPI.getInstance(); + api.setProvider(new Provider()); + final Client client = api.getClient(); + + FeatureFlaggingGateway.dispatch(mock(ServerConfiguration.class)); + await().atMost(ofSeconds(1)).until(() -> client.getProviderState() == ProviderState.READY); + + final Consumer errorEvent = mock(Consumer.class); + final Consumer readyEvent = mock(Consumer.class); + final Consumer configChangedEvent = mock(Consumer.class); + client.on(ProviderEvent.PROVIDER_ERROR, errorEvent); + client.on(ProviderEvent.PROVIDER_CONFIGURATION_CHANGED, configChangedEvent); + + FeatureFlaggingGateway.dispatch((ServerConfiguration) null); + await() + .atMost(ofSeconds(1)) + .untilAsserted( + () -> { + assertThat(client.getProviderState(), equalTo(ProviderState.ERROR)); + verify(errorEvent, times(1)).accept(eventDetailsCaptor.capture()); + final EventDetails eventDetails = eventDetailsCaptor.getValue(); + assertThat(eventDetails.getProviderName(), equalTo(METADATA)); + }); + + final FlagEvaluationDetails evalDetails = client.getStringDetails("missing", "default"); + assertThat(evalDetails.getValue(), equalTo("default")); + assertThat(evalDetails.getErrorCode(), equalTo(ErrorCode.PROVIDER_NOT_READY)); + + client.on(ProviderEvent.PROVIDER_READY, readyEvent); + FeatureFlaggingGateway.dispatch(mock(ServerConfiguration.class)); + await() + .atMost(ofSeconds(1)) + .untilAsserted( + () -> { + assertThat(client.getProviderState(), equalTo(ProviderState.READY)); + verify(readyEvent, times(1)).accept(any()); + }); + + FeatureFlaggingGateway.dispatch(mock(ServerConfiguration.class)); + await() + .atMost(ofSeconds(1)) + .untilAsserted(() -> verify(configChangedEvent, times(1)).accept(any())); + } + @Test public void testFailureToLoadInternalApi() { @SuppressWarnings("unchecked") @@ -152,7 +337,8 @@ public void testGetProviderHooksReturnsFlagEvalHook() { @Test public void testShutdownCleansUpMetrics() throws Exception { Evaluator evaluator = mock(Evaluator.class); - when(evaluator.initialize(anyLong(), any(), any())).thenReturn(true); + when(evaluator.initialize(eq(10L), eq(MILLISECONDS), any())).thenReturn(true); + when(evaluator.hasConfiguration()).thenReturn(true); Provider provider = new Provider(new Options().initTimeout(10, MILLISECONDS), evaluator); provider.initialize(null); provider.shutdown(); @@ -182,7 +368,8 @@ public void testProviderEvaluation( final String flag, final E defaultValue, final EvaluateMethod method) throws Exception { FeatureFlaggingGateway.dispatch(mock(ServerConfiguration.class)); final Evaluator evaluator = mock(Evaluator.class); - when(evaluator.initialize(anyLong(), any(), any())).thenReturn(true); + when(evaluator.initialize(eq(10L), eq(SECONDS), any())).thenReturn(true); + when(evaluator.hasConfiguration()).thenReturn(true); when(evaluator.evaluate(any(), any(), any(), any())) .thenAnswer( invocation -> @@ -200,4 +387,11 @@ public void testProviderEvaluation( verify(evaluator, times(1)) .evaluate(any(), eq(flag), eq(defaultValue), any(EvaluationContext.class)); } + + private static String initializationState(final Provider provider) throws Exception { + final Field stateField = Provider.class.getDeclaredField("initializationState"); + stateField.setAccessible(true); + final AtomicReference state = (AtomicReference) stateField.get(provider); + return state.get().toString(); + } } diff --git a/products/feature-flagging/feature-flagging-api/src/test/java/datadog/trace/api/openfeature/SpanEnrichmentHookTest.java b/products/feature-flagging/feature-flagging-api/src/test/java/datadog/trace/api/openfeature/SpanEnrichmentHookTest.java new file mode 100644 index 00000000000..2ce0931e116 --- /dev/null +++ b/products/feature-flagging/feature-flagging-api/src/test/java/datadog/trace/api/openfeature/SpanEnrichmentHookTest.java @@ -0,0 +1,241 @@ +package datadog.trace.api.openfeature; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.api.featureflag.FeatureFlaggingGateway; +import datadog.trace.api.featureflag.SpanEnrichmentEvent; +import dev.openfeature.sdk.FlagEvaluationDetails; +import dev.openfeature.sdk.FlagValueType; +import dev.openfeature.sdk.Hook; +import dev.openfeature.sdk.HookContext; +import dev.openfeature.sdk.ImmutableContext; +import dev.openfeature.sdk.ImmutableMetadata; +import dev.openfeature.sdk.ImmutableStructure; +import dev.openfeature.sdk.Value; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +/** + * Capture-side unit suite for APM feature-flag span enrichment. The hook dispatches a {@link + * SpanEnrichmentEvent} onto {@link FeatureFlaggingGateway} and the agent-side write tier does the + * accumulation, so these tests assert the dispatched events (not span tags — those are covered in + * {@code feature-flagging-lib}) plus the {@link Provider} gating. + */ +class SpanEnrichmentHookTest { + + private final List captured = new ArrayList<>(); + private final FeatureFlaggingGateway.SpanEnrichmentListener listener = captured::add; + + @BeforeEach + void register() { + FeatureFlaggingGateway.addSpanEnrichmentListener(listener); + } + + @AfterEach + void deregister() { + FeatureFlaggingGateway.removeSpanEnrichmentListener(listener); + } + + // ---- helpers ---- + + private static FlagEvaluationDetails details( + final String flagKey, + final String variant, + final Object value, + final ImmutableMetadata metadata) { + return FlagEvaluationDetails.builder() + .flagKey(flagKey) + .variant(variant) + .value(value) + .flagMetadata(metadata) + .build(); + } + + private static ImmutableMetadata metadata(final Integer serialId, final boolean doLog) { + final ImmutableMetadata.ImmutableMetadataBuilder builder = ImmutableMetadata.builder(); + if (serialId != null) { + builder.addInteger(SpanEnrichmentHook.METADATA_SERIAL_ID, serialId); + } + builder.addBoolean(SpanEnrichmentHook.METADATA_DO_LOG, doLog); + return builder.build(); + } + + private static HookContext ctx(final String flagKey, final String targetingKey) { + return HookContext.from( + flagKey, + FlagValueType.STRING, + null, + null, + targetingKey == null ? new ImmutableContext() : new ImmutableContext(targetingKey), + "default"); + } + + // ---- serial-id branch ---- + + @Test + void serialIdWithDoLogDispatchesSerialAndSubject() { + new SpanEnrichmentHook() + .finallyAfter( + ctx("flag", "user-1"), + details("flag", "on", "v", metadata(42, true)), + Collections.emptyMap()); + + assertEquals(1, captured.size()); + final SpanEnrichmentEvent event = captured.get(0); + assertTrue(event.hasSerialId()); + assertEquals(42, event.serialId()); + assertTrue(event.doLog()); + assertEquals("user-1", event.targetingKey()); + } + + @Test + void serialIdWithoutDoLogStillDispatchesSerialButNotDoLog() { + new SpanEnrichmentHook() + .finallyAfter( + ctx("flag", "user-1"), + details("flag", "on", "v", metadata(7, false)), + Collections.emptyMap()); + + assertEquals(1, captured.size()); + final SpanEnrichmentEvent event = captured.get(0); + assertTrue(event.hasSerialId()); + assertEquals(7, event.serialId()); + assertFalse( + event.doLog(), "doLog=false must be carried through so the write side skips subject"); + } + + @Test + void wrongTypedSerialIdDispatchesNothing() { + // Defensive: a non-integer value under the serial-id key (wrong type) is ignored, not crashed. + final ImmutableMetadata bad = + ImmutableMetadata.builder() + .addString(SpanEnrichmentHook.METADATA_SERIAL_ID, "not-a-number") + .addBoolean(SpanEnrichmentHook.METADATA_DO_LOG, true) + .build(); + new SpanEnrichmentHook() + .finallyAfter( + ctx("flag", "user-1"), details("flag", "on", "v", bad), Collections.emptyMap()); + assertTrue(captured.isEmpty(), "a wrong-typed serial id must never break eval or dispatch"); + } + + // ---- runtime-default branch (missing variant) ---- + + @Test + void missingVariantDispatchesRuntimeDefaultWithNativeMap() { + final Map objectValue = Collections.singletonMap("k", "val"); + new SpanEnrichmentHook() + .finallyAfter( + ctx("obj-flag", "user-1"), + details("obj-flag", null, objectValue, ImmutableMetadata.builder().build()), + Collections.emptyMap()); + + assertEquals(1, captured.size()); + final SpanEnrichmentEvent event = captured.get(0); + assertFalse(event.hasSerialId()); + assertEquals("obj-flag", event.flagKey()); + assertEquals( + objectValue, event.defaultValue(), "a native map default passes through unchanged"); + } + + @Test + void missingVariantUnwrapsOpenFeatureValueStructureToNativeMap() { + final Map inner = new LinkedHashMap<>(); + inner.put("enabled", new Value(true)); + final Value structureDefault = new Value(new ImmutableStructure(inner)); + + new SpanEnrichmentHook() + .finallyAfter( + ctx("struct-flag", "user-1"), + details("struct-flag", null, structureDefault, ImmutableMetadata.builder().build()), + Collections.emptyMap()); + + assertEquals(1, captured.size()); + final Object value = captured.get(0).defaultValue(); + // Crucially a native Map, NOT an OpenFeature Value — the seam carries only JDK types. + final Map asMap = assertInstanceOf(Map.class, value); + assertEquals(Boolean.TRUE, asMap.get("enabled")); + } + + // ---- unwrapDefaultValue (the Value -> native conversion) ---- + + @Test + void unwrapConvertsValueScalarsToNative() { + assertEquals("hello", SpanEnrichmentHook.unwrapDefaultValue(new Value("hello"))); + assertEquals(Boolean.TRUE, SpanEnrichmentHook.unwrapDefaultValue(new Value(true))); + assertEquals(7, SpanEnrichmentHook.unwrapDefaultValue(new Value(7))); + assertNull(SpanEnrichmentHook.unwrapDefaultValue(new Value())); + } + + @Test + void unwrapConvertsValueListToNativeList() { + final Value listDefault = + new Value(Arrays.asList(new Value("a"), new Value(2), new Value(true))); + final Object out = SpanEnrichmentHook.unwrapDefaultValue(listDefault); + assertEquals(Arrays.asList("a", 2, Boolean.TRUE), out); + } + + @Test + void unwrapPassesNativeValuesThrough() { + final Map native0 = Collections.singletonMap("a", "b"); + assertEquals(native0, SpanEnrichmentHook.unwrapDefaultValue(native0)); + assertEquals("plain", SpanEnrichmentHook.unwrapDefaultValue("plain")); + assertNull(SpanEnrichmentHook.unwrapDefaultValue(null)); + } + + // ---- error isolation ---- + + @Test + void nullDetailsDispatchesNothing() { + new SpanEnrichmentHook().finallyAfter(null, null, null); + assertTrue(captured.isEmpty()); + } + + // ---- Provider gating ---- + + @Test + void gateOffConstructsNoHook() { + final Provider provider = new Provider(new Provider.Options(), null, Boolean.FALSE); + assertNull(provider.spanEnrichmentHook(), "gate off => no span-enrichment hook"); + for (final Hook hook : provider.getProviderHooks()) { + assertFalse( + hook instanceof SpanEnrichmentHook, "gate off => SpanEnrichmentHook never registered"); + } + } + + @Test + void gateOnConstructsHookAndRegistersItInProviderHooks() { + final Provider provider = new Provider(new Provider.Options(), null, Boolean.TRUE); + assertTrue(provider.spanEnrichmentHook() != null, "gate on => hook constructed"); + boolean registered = false; + for (final Hook hook : provider.getProviderHooks()) { + if (hook instanceof SpanEnrichmentHook) { + registered = true; + } + } + assertTrue(registered, "gate on => SpanEnrichmentHook registered in getProviderHooks"); + } + + @Test + void getProviderHooksReturnsSameInstanceEachCall() { + final Provider gateOff = new Provider(new Provider.Options(), null, Boolean.FALSE); + assertTrue( + gateOff.getProviderHooks() == gateOff.getProviderHooks(), + "gate off => getProviderHooks allocates nothing (same instance)"); + + final Provider gateOn = new Provider(new Provider.Options(), null, Boolean.TRUE); + assertTrue( + gateOn.getProviderHooks() == gateOn.getProviderHooks(), + "gate on => getProviderHooks allocates nothing (same instance)"); + } +} diff --git a/products/feature-flagging/feature-flagging-api/src/test/java/datadog/trace/api/openfeature/util/TestCase.java b/products/feature-flagging/feature-flagging-api/src/test/java/datadog/trace/api/openfeature/util/TestCase.java deleted file mode 100644 index b19f85bf84e..00000000000 --- a/products/feature-flagging/feature-flagging-api/src/test/java/datadog/trace/api/openfeature/util/TestCase.java +++ /dev/null @@ -1,114 +0,0 @@ -package datadog.trace.api.openfeature.util; - -import dev.openfeature.sdk.ErrorCode; -import dev.openfeature.sdk.MutableContext; -import dev.openfeature.sdk.Structure; -import dev.openfeature.sdk.Value; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class TestCase { - - public Class type; - public String flag; - public E defaultValue; - public final MutableContext context = new MutableContext(); - public Result result; - - @SuppressWarnings("unchecked") - public TestCase(final E defaultValue) { - this.type = (Class) defaultValue.getClass(); - this.defaultValue = defaultValue; - } - - public TestCase flag(String flag) { - this.flag = flag; - return this; - } - - public TestCase targetingKey(final String targetingKey) { - context.setTargetingKey(targetingKey); - return this; - } - - public TestCase context(final String key, final String value) { - context.add(key, value); - return this; - } - - public TestCase context(final String key, final Integer value) { - context.add(key, value); - return this; - } - - public TestCase context(final String key, final Double value) { - context.add(key, value); - return this; - } - - public TestCase context(final String key, final Boolean value) { - context.add(key, value); - return this; - } - - public TestCase context(final String key, final Structure value) { - context.add(key, value); - return this; - } - - public TestCase context(final String key, final List value) { - context.add(key, value); - return this; - } - - public TestCase result(final Result result) { - this.result = result; - return this; - } - - @Override - public String toString() { - return "TestCase{" - + "flag='" - + flag - + '\'' - + ", defaultValue=" - + defaultValue - + ", targetingKey=" - + context.getTargetingKey() - + '}'; - } - - public static class Result { - public E value; - public String variant; - public String[] reason; - public ErrorCode errorCode; - public final Map flagMetadata = new HashMap<>(); - - public Result(final E value) { - this.value = value; - } - - public Result variant(final String variant) { - this.variant = variant; - return this; - } - - public Result errorCode(final ErrorCode errorCode) { - this.errorCode = errorCode; - return this; - } - - public Result reason(final String... reason) { - this.reason = reason; - return this; - } - - public Result flagMetadata(final String name, final Object value) { - flagMetadata.put(name, value); - return this; - } - } -} diff --git a/products/feature-flagging/feature-flagging-bootstrap/build.gradle.kts b/products/feature-flagging/feature-flagging-bootstrap/build.gradle.kts index d3edc149637..d8e945a5565 100644 --- a/products/feature-flagging/feature-flagging-bootstrap/build.gradle.kts +++ b/products/feature-flagging/feature-flagging-bootstrap/build.gradle.kts @@ -1,36 +1,36 @@ plugins { `java-library` + id("dd-trace-java.version-file") } apply(from = "$rootDir/gradle/java.gradle") -apply(from = "$rootDir/gradle/version.gradle") description = "Feature flagging remote common module (bootstrap classloader)" -val excludedClassesCoverage by extra( - listOf( - // Feature lags POJOs - "datadog.trace.api.featureflag.exposure.Allocation", - "datadog.trace.api.featureflag.exposure.ExposureEvent", - "datadog.trace.api.featureflag.exposure.ExposuresRequest", - "datadog.trace.api.featureflag.exposure.Flag", - "datadog.trace.api.featureflag.exposure.Subject", - "datadog.trace.api.featureflag.exposure.Variant", - "datadog.trace.api.featureflag.ufc.v1.Allocation", - "datadog.trace.api.featureflag.ufc.v1.ConditionConfiguration", - "datadog.trace.api.featureflag.ufc.v1.ConditionOperator", - "datadog.trace.api.featureflag.ufc.v1.Environment", - "datadog.trace.api.featureflag.ufc.v1.Flag", - "datadog.trace.api.featureflag.ufc.v1.Rule", - "datadog.trace.api.featureflag.ufc.v1.ServerConfiguration", - "datadog.trace.api.featureflag.ufc.v1.Shard", - "datadog.trace.api.featureflag.ufc.v1.ShardRange", - "datadog.trace.api.featureflag.ufc.v1.Split", - "datadog.trace.api.featureflag.ufc.v1.ValueType", - "datadog.trace.api.featureflag.ufc.v1.Variant", - ) +extra["excludedClassesCoverage"] = listOf( + // Feature lags POJOs + "datadog.trace.api.featureflag.exposure.Allocation", + "datadog.trace.api.featureflag.exposure.ExposureEvent", + "datadog.trace.api.featureflag.exposure.ExposuresRequest", + "datadog.trace.api.featureflag.exposure.Flag", + "datadog.trace.api.featureflag.exposure.Subject", + "datadog.trace.api.featureflag.exposure.Variant", + "datadog.trace.api.featureflag.ufc.v1.Allocation", + "datadog.trace.api.featureflag.ufc.v1.ConditionConfiguration", + "datadog.trace.api.featureflag.ufc.v1.ConditionOperator", + "datadog.trace.api.featureflag.ufc.v1.Environment", + "datadog.trace.api.featureflag.ufc.v1.Flag", + "datadog.trace.api.featureflag.ufc.v1.Rule", + "datadog.trace.api.featureflag.ufc.v1.ServerConfiguration", + "datadog.trace.api.featureflag.ufc.v1.Shard", + "datadog.trace.api.featureflag.ufc.v1.ShardRange", + "datadog.trace.api.featureflag.ufc.v1.Split", + "datadog.trace.api.featureflag.ufc.v1.ValueType", + "datadog.trace.api.featureflag.ufc.v1.Variant", ) dependencies { + testImplementation(libs.bundles.junit5) + testImplementation(libs.bundles.mockito) testImplementation(project(":utils:test-utils")) } diff --git a/products/feature-flagging/feature-flagging-bootstrap/gradle.lockfile b/products/feature-flagging/feature-flagging-bootstrap/gradle.lockfile index 7f4b9c56c0d..2b70d63d57a 100644 --- a/products/feature-flagging/feature-flagging-bootstrap/gradle.lockfile +++ b/products/feature-flagging/feature-flagging-bootstrap/gradle.lockfile @@ -1,10 +1,12 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :products:feature-flagging:feature-flagging-bootstrap:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -17,8 +19,8 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -41,10 +43,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -54,14 +56,18 @@ org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntime org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath -org.mockito:mockito-core:4.4.0=testRuntimeClasspath +org.mockito:mockito-core:4.4.0=testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/products/feature-flagging/feature-flagging-bootstrap/src/main/java/datadog/trace/api/featureflag/FeatureFlaggingGateway.java b/products/feature-flagging/feature-flagging-bootstrap/src/main/java/datadog/trace/api/featureflag/FeatureFlaggingGateway.java index b9d73ffa7ab..2704b4be341 100644 --- a/products/feature-flagging/feature-flagging-bootstrap/src/main/java/datadog/trace/api/featureflag/FeatureFlaggingGateway.java +++ b/products/feature-flagging/feature-flagging-bootstrap/src/main/java/datadog/trace/api/featureflag/FeatureFlaggingGateway.java @@ -13,8 +13,12 @@ public interface ConfigListener extends Consumer {} public interface ExposureListener extends Consumer {} + public interface SpanEnrichmentListener extends Consumer {} + private static final List CONFIG_LISTENERS = new CopyOnWriteArrayList<>(); private static final List EXPOSURE_LISTENERS = new CopyOnWriteArrayList<>(); + private static final List SPAN_ENRICHMENT_LISTENERS = + new CopyOnWriteArrayList<>(); private static final AtomicReference CURRENT_CONFIG = new AtomicReference<>(); @@ -49,4 +53,16 @@ public static void removeExposureListener(final ExposureListener listener) { public static void dispatch(final ExposureEvent event) { EXPOSURE_LISTENERS.forEach(listener -> listener.accept(event)); } + + public static void addSpanEnrichmentListener(final SpanEnrichmentListener listener) { + SPAN_ENRICHMENT_LISTENERS.add(listener); + } + + public static void removeSpanEnrichmentListener(final SpanEnrichmentListener listener) { + SPAN_ENRICHMENT_LISTENERS.remove(listener); + } + + public static void dispatch(final SpanEnrichmentEvent event) { + SPAN_ENRICHMENT_LISTENERS.forEach(listener -> listener.accept(event)); + } } diff --git a/products/feature-flagging/feature-flagging-bootstrap/src/main/java/datadog/trace/api/featureflag/SpanEnrichmentEvent.java b/products/feature-flagging/feature-flagging-bootstrap/src/main/java/datadog/trace/api/featureflag/SpanEnrichmentEvent.java new file mode 100644 index 00000000000..a7518c71743 --- /dev/null +++ b/products/feature-flagging/feature-flagging-bootstrap/src/main/java/datadog/trace/api/featureflag/SpanEnrichmentEvent.java @@ -0,0 +1,82 @@ +package datadog.trace.api.featureflag; + +/** + * Bootstrap-classloader carrier for a single feature-flag evaluation that must be reflected onto + * the local-root APM span (span enrichment). It crosses the app-classloader → agent-classloader + * boundary through {@link FeatureFlaggingGateway}, so it holds only JDK types — never an + * OpenFeature or tracer type — exactly like the sibling exposure/config payloads. + * + *

      The capture side (the published {@code dd-openfeature} provider) decides which of the two + * shapes applies and unwraps any OpenFeature {@code Value} to its native Java form before + * dispatching; the write side (agent-side listener) resolves the active local root and accumulates. + * + *

        + *
      • serial-id ({@link #serialId(int, boolean, String)}) — a UFC split with a serial id, + * plus the {@code doLog} flag and the (optional) targeting key used to record the subject. + *
      • runtime-default ({@link #runtimeDefault(String, Object)}) — a flag that resolved to + * its runtime default (missing variant); carries the flag key and the native default value. + *
      + */ +public final class SpanEnrichmentEvent { + + private final boolean serialIdPresent; + private final int serialId; + private final boolean doLog; + private final String targetingKey; + private final String flagKey; + private final Object defaultValue; + + private SpanEnrichmentEvent( + final boolean serialIdPresent, + final int serialId, + final boolean doLog, + final String targetingKey, + final String flagKey, + final Object defaultValue) { + this.serialIdPresent = serialIdPresent; + this.serialId = serialId; + this.doLog = doLog; + this.targetingKey = targetingKey; + this.flagKey = flagKey; + this.defaultValue = defaultValue; + } + + /** A UFC split evaluation carrying a serial id (and, when {@code doLog}, a subject). */ + public static SpanEnrichmentEvent serialId( + final int serialId, final boolean doLog, final String targetingKey) { + return new SpanEnrichmentEvent(true, serialId, doLog, targetingKey, null, null); + } + + /** + * A runtime-default evaluation (missing variant). {@code value} must already be unwrapped to a + * native Java type (Map/List/scalar/null) by the caller. + */ + public static SpanEnrichmentEvent runtimeDefault(final String flagKey, final Object value) { + return new SpanEnrichmentEvent(false, 0, false, null, flagKey, value); + } + + /** True for the serial-id shape; false for the runtime-default shape. */ + public boolean hasSerialId() { + return serialIdPresent; + } + + public int serialId() { + return serialId; + } + + public boolean doLog() { + return doLog; + } + + public String targetingKey() { + return targetingKey; + } + + public String flagKey() { + return flagKey; + } + + public Object defaultValue() { + return defaultValue; + } +} diff --git a/products/feature-flagging/feature-flagging-bootstrap/src/main/java/datadog/trace/api/featureflag/ufc/v1/Split.java b/products/feature-flagging/feature-flagging-bootstrap/src/main/java/datadog/trace/api/featureflag/ufc/v1/Split.java index 1782032278d..37f6909eeea 100644 --- a/products/feature-flagging/feature-flagging-bootstrap/src/main/java/datadog/trace/api/featureflag/ufc/v1/Split.java +++ b/products/feature-flagging/feature-flagging-bootstrap/src/main/java/datadog/trace/api/featureflag/ufc/v1/Split.java @@ -7,11 +7,19 @@ public class Split { public final List shards; public final String variationKey; public final Map extraLogging; + // Nullable Integer (not primitive int): the serialId is absent in some UFC shapes. Populated by + // Moshi reflective deserialization from the UFC "serialId" JSON field. Surfaced as + // __dd_split_serial_id in eval metadata for APM span enrichment. + public final Integer serialId; public Split( - final List shards, final String variationKey, final Map extraLogging) { + final List shards, + final String variationKey, + final Map extraLogging, + final Integer serialId) { this.shards = shards; this.variationKey = variationKey; this.extraLogging = extraLogging; + this.serialId = serialId; } } diff --git a/products/feature-flagging/feature-flagging-bootstrap/src/test/groovy/datadog/trace/api/featureflag/FeatureFlaggingGatewayTest.groovy b/products/feature-flagging/feature-flagging-bootstrap/src/test/groovy/datadog/trace/api/featureflag/FeatureFlaggingGatewayTest.groovy deleted file mode 100644 index 6dd02e3f96e..00000000000 --- a/products/feature-flagging/feature-flagging-bootstrap/src/test/groovy/datadog/trace/api/featureflag/FeatureFlaggingGatewayTest.groovy +++ /dev/null @@ -1,76 +0,0 @@ -package datadog.trace.api.featureflag - -import datadog.trace.api.featureflag.exposure.ExposureEvent -import datadog.trace.api.featureflag.ufc.v1.ServerConfiguration -import spock.lang.Specification - -class FeatureFlaggingGatewayTest extends Specification { - - void 'test attaching a config listener'() { - given: - def listener = Mock(FeatureFlaggingGateway.ConfigListener) - final first = Stub(ServerConfiguration) - final second = Stub(ServerConfiguration) - - when: - FeatureFlaggingGateway.addConfigListener(listener) - FeatureFlaggingGateway.dispatch(first) - - then: - 1 * listener.accept(first) - 0 * _ - - when: - FeatureFlaggingGateway.dispatch(second) - - then: - 1 * listener.accept(second) - 0 * _ - - - cleanup: - FeatureFlaggingGateway.removeConfigListener(listener) - } - - void 'test attaching a listener after configured'() { - given: - def listener = Mock(FeatureFlaggingGateway.ConfigListener) - final first = Stub(ServerConfiguration) - - when: - FeatureFlaggingGateway.dispatch(first) - FeatureFlaggingGateway.addConfigListener(listener) - - then: - 1 * listener.accept(first) - 0 * _ - - cleanup: - FeatureFlaggingGateway.removeConfigListener(listener) - } - - void 'test attaching an exposure listener'() { - given: - def listener = Mock(FeatureFlaggingGateway.ExposureListener) - final first = Stub(ExposureEvent) - final second = Stub(ExposureEvent) - - when: - FeatureFlaggingGateway.addExposureListener(listener) - FeatureFlaggingGateway.dispatch(first) - - then: - 1 * listener.accept(first) - 0 * _ - - when: - FeatureFlaggingGateway.dispatch(second) - - then: - 1 * listener.accept(second) - 0 * _ - - cleanup: - FeatureFlaggingGateway.removeExposureListener(listener) - } -} diff --git a/products/feature-flagging/feature-flagging-bootstrap/src/test/java/datadog/trace/api/featureflag/FeatureFlaggingGatewayTest.java b/products/feature-flagging/feature-flagging-bootstrap/src/test/java/datadog/trace/api/featureflag/FeatureFlaggingGatewayTest.java new file mode 100644 index 00000000000..3af2ed5add8 --- /dev/null +++ b/products/feature-flagging/feature-flagging-bootstrap/src/test/java/datadog/trace/api/featureflag/FeatureFlaggingGatewayTest.java @@ -0,0 +1,100 @@ +package datadog.trace.api.featureflag; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoMoreInteractions; + +import datadog.trace.api.featureflag.exposure.ExposureEvent; +import datadog.trace.api.featureflag.ufc.v1.ServerConfiguration; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +class FeatureFlaggingGatewayTest { + + private FeatureFlaggingGateway.ConfigListener configListener; + private FeatureFlaggingGateway.ExposureListener exposureListener; + private FeatureFlaggingGateway.SpanEnrichmentListener spanEnrichmentListener; + private ServerConfiguration firstConfiguration; + private ServerConfiguration secondConfiguration; + private ExposureEvent firstExposure; + private ExposureEvent secondExposure; + + @BeforeEach + void setUp() { + configListener = mock(FeatureFlaggingGateway.ConfigListener.class); + exposureListener = mock(FeatureFlaggingGateway.ExposureListener.class); + spanEnrichmentListener = mock(FeatureFlaggingGateway.SpanEnrichmentListener.class); + firstConfiguration = mock(ServerConfiguration.class); + secondConfiguration = mock(ServerConfiguration.class); + firstExposure = mock(ExposureEvent.class); + secondExposure = mock(ExposureEvent.class); + } + + @AfterEach + void tearDown() { + FeatureFlaggingGateway.removeConfigListener(configListener); + FeatureFlaggingGateway.removeExposureListener(exposureListener); + FeatureFlaggingGateway.removeSpanEnrichmentListener(spanEnrichmentListener); + } + + @Test + void testAttachingAConfigListener() { + clearCurrentServerConfiguration(); + + FeatureFlaggingGateway.addConfigListener(configListener); + FeatureFlaggingGateway.dispatch(firstConfiguration); + + verify(configListener).accept(firstConfiguration); + verifyNoMoreInteractions(configListener); + + FeatureFlaggingGateway.dispatch(secondConfiguration); + + verify(configListener).accept(secondConfiguration); + verifyNoMoreInteractions(configListener); + } + + @Test + void testAttachingAListenerAfterConfigured() { + FeatureFlaggingGateway.dispatch(firstConfiguration); + FeatureFlaggingGateway.addConfigListener(configListener); + + verify(configListener).accept(firstConfiguration); + verifyNoMoreInteractions(configListener); + } + + @Test + void testAttachingAnExposureListener() { + FeatureFlaggingGateway.addExposureListener(exposureListener); + FeatureFlaggingGateway.dispatch(firstExposure); + + verify(exposureListener).accept(firstExposure); + verifyNoMoreInteractions(exposureListener); + + FeatureFlaggingGateway.dispatch(secondExposure); + + verify(exposureListener).accept(secondExposure); + verifyNoMoreInteractions(exposureListener); + } + + @Test + void testAttachingASpanEnrichmentListener() { + final SpanEnrichmentEvent firstEvent = SpanEnrichmentEvent.serialId(42, true, "user-1"); + final SpanEnrichmentEvent secondEvent = SpanEnrichmentEvent.runtimeDefault("flag", "value"); + + FeatureFlaggingGateway.addSpanEnrichmentListener(spanEnrichmentListener); + FeatureFlaggingGateway.dispatch(firstEvent); + + verify(spanEnrichmentListener).accept(firstEvent); + verifyNoMoreInteractions(spanEnrichmentListener); + + FeatureFlaggingGateway.dispatch(secondEvent); + + verify(spanEnrichmentListener).accept(secondEvent); + verifyNoMoreInteractions(spanEnrichmentListener); + } + + private static void clearCurrentServerConfiguration() { + FeatureFlaggingGateway.dispatch((ServerConfiguration) null); + } +} diff --git a/products/feature-flagging/feature-flagging-bootstrap/src/test/java/datadog/trace/api/featureflag/SpanEnrichmentEventTest.java b/products/feature-flagging/feature-flagging-bootstrap/src/test/java/datadog/trace/api/featureflag/SpanEnrichmentEventTest.java new file mode 100644 index 00000000000..55e7a8943ac --- /dev/null +++ b/products/feature-flagging/feature-flagging-bootstrap/src/test/java/datadog/trace/api/featureflag/SpanEnrichmentEventTest.java @@ -0,0 +1,56 @@ +package datadog.trace.api.featureflag; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.Collections; +import org.junit.jupiter.api.Test; + +class SpanEnrichmentEventTest { + + @Test + void serialIdEventCarriesItsFields() { + final SpanEnrichmentEvent event = SpanEnrichmentEvent.serialId(42, true, "user-1"); + + assertTrue(event.hasSerialId()); + assertEquals(42, event.serialId()); + assertTrue(event.doLog()); + assertEquals("user-1", event.targetingKey()); + assertNull(event.flagKey()); + assertNull(event.defaultValue()); + } + + @Test + void serialIdEventWithoutDoLogOrTargetingKey() { + final SpanEnrichmentEvent event = SpanEnrichmentEvent.serialId(7, false, null); + + assertTrue(event.hasSerialId()); + assertEquals(7, event.serialId()); + assertFalse(event.doLog()); + assertNull(event.targetingKey()); + } + + @Test + void runtimeDefaultEventCarriesItsFields() { + final Object value = Collections.singletonMap("k", "v"); + final SpanEnrichmentEvent event = SpanEnrichmentEvent.runtimeDefault("flag", value); + + assertFalse(event.hasSerialId()); + assertEquals("flag", event.flagKey()); + assertEquals(value, event.defaultValue()); + assertEquals(0, event.serialId()); + assertFalse(event.doLog()); + assertNull(event.targetingKey()); + } + + @Test + void runtimeDefaultEventAllowsNullValue() { + final SpanEnrichmentEvent event = SpanEnrichmentEvent.runtimeDefault("flag", null); + + assertFalse(event.hasSerialId()); + assertEquals("flag", event.flagKey()); + assertNull(event.defaultValue()); + } +} diff --git a/products/feature-flagging/feature-flagging-config/build.gradle.kts b/products/feature-flagging/feature-flagging-config/build.gradle.kts new file mode 100644 index 00000000000..14109d8dfd9 --- /dev/null +++ b/products/feature-flagging/feature-flagging-config/build.gradle.kts @@ -0,0 +1,12 @@ +plugins { + `java-library` +} + +apply(from = "$rootDir/gradle/java.gradle") + +description = "Feature flagging configuration keys (compile-time constants)" + +extra["excludedClassesCoverage"] = listOf( + // Constants-only holder — no executable logic to cover. + "datadog.trace.api.featureflag.config.FeatureFlaggingConfig", +) diff --git a/products/feature-flagging/feature-flagging-config/gradle.lockfile b/products/feature-flagging/feature-flagging-config/gradle.lockfile new file mode 100644 index 00000000000..6f4961849a0 --- /dev/null +++ b/products/feature-flagging/feature-flagging-config/gradle.lockfile @@ -0,0 +1,78 @@ +# This is a Gradle generated file for dependency locking. +# Manual edits can break the build and are not advised. +# This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :products:feature-flagging:feature-flagging-config:dependencies --write-locks +ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath +com.github.javaparser:javaparser-core:3.25.6=codenarc +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs +com.github.spotbugs:spotbugs:4.9.8=spotbugs +com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs +com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.google.code.gson:gson:2.13.2=spotbugs +com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.thoughtworks.qdox:qdox:1.12.1=codenarc +commons-io:commons-io:2.20.0=spotbugs +de.thetaphi:forbiddenapis:3.10=compileClasspath +io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath +jaxen:jaxen:2.0.0=spotbugs +net.bytebuddy:byte-buddy-agent:1.12.8=testRuntimeClasspath +net.bytebuddy:byte-buddy:1.12.8=testRuntimeClasspath +net.sf.saxon:Saxon-HE:12.9=spotbugs +org.apache.ant:ant-antlr:1.10.14=codenarc +org.apache.ant:ant-junit:1.10.14=codenarc +org.apache.bcel:bcel:6.11.0=spotbugs +org.apache.commons:commons-lang3:3.19.0=spotbugs +org.apache.commons:commons-text:1.14.0=spotbugs +org.apache.logging.log4j:log4j-api:2.25.2=spotbugs +org.apache.logging.log4j:log4j-core:2.25.2=spotbugs +org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath +org.codehaus.groovy:groovy-ant:3.0.23=codenarc +org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc +org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.25=testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-templates:3.0.23=codenarc +org.codehaus.groovy:groovy-xml:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath +org.codenarc:CodeNarc:3.7.0=codenarc +org.dom4j:dom4j:2.2.0=spotbugs +org.gmetrics:GMetrics:2.1.0=codenarc +org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt +org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath +org.junit:junit-bom:5.14.0=spotbugs +org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-core:4.4.0=testRuntimeClasspath +org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath +org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs +org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs +org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath +org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath +org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j +org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j +org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath +org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath +org.xmlresolver:xmlresolver:5.3.3=spotbugs +empty=annotationProcessor,runtimeClasspath,spotbugsPlugins,testAnnotationProcessor diff --git a/products/feature-flagging/feature-flagging-config/src/main/java/datadog/trace/api/featureflag/config/FeatureFlaggingConfig.java b/products/feature-flagging/feature-flagging-config/src/main/java/datadog/trace/api/featureflag/config/FeatureFlaggingConfig.java new file mode 100644 index 00000000000..9d75961e9d4 --- /dev/null +++ b/products/feature-flagging/feature-flagging-config/src/main/java/datadog/trace/api/featureflag/config/FeatureFlaggingConfig.java @@ -0,0 +1,14 @@ +package datadog.trace.api.featureflag.config; + +public class FeatureFlaggingConfig { + + public static final String FLAGGING_PROVIDER_ENABLED = "experimental.flagging.provider.enabled"; + + /** + * Opt-in gate for APM span enrichment with feature-flag evaluation metadata. DISTINCT from {@link + * #FLAGGING_PROVIDER_ENABLED} and OFF by default — enabling the provider does not enable span + * enrichment. + */ + public static final String EXPERIMENTAL_SPAN_ENRICHMENT_ENABLED = + "experimental.flagging.provider.span.enrichment.enabled"; +} diff --git a/products/feature-flagging/feature-flagging-lib/build.gradle.kts b/products/feature-flagging/feature-flagging-lib/build.gradle.kts index 4bb9a77a9a7..9d659d6ed63 100644 --- a/products/feature-flagging/feature-flagging-lib/build.gradle.kts +++ b/products/feature-flagging/feature-flagging-lib/build.gradle.kts @@ -1,18 +1,16 @@ plugins { `java-library` + id("dd-trace-java.version-file") } apply(from = "$rootDir/gradle/java.gradle") -apply(from = "$rootDir/gradle/version.gradle") description = "Feature flagging remote config and exposure handling" -val excludedClassesCoverage by extra( - listOf( - // POJOs - "com.datadog.featureflag.ExposureCache.Key", - "com.datadog.featureflag.ExposureCache.Value" - ) +extra["excludedClassesCoverage"] = listOf( + // POJOs + "com.datadog.featureflag.ExposureCache.Key", + "com.datadog.featureflag.ExposureCache.Value" ) dependencies { @@ -24,7 +22,14 @@ dependencies { api(project(":utils:queue-utils")) compileOnly(project(":dd-trace-core")) // shading does not work with this one + // Span-enrichment write tier: TraceInterceptor / GlobalTracer / AgentTracer / AgentSpan. + compileOnly(project(":internal-api")) + // Platform JSON writer for the ffe_* tag values. + compileOnly(project(":components:json")) + testImplementation(libs.bundles.junit5) + testImplementation(libs.bundles.mockito) + testImplementation(project(":internal-api")) testImplementation(project(":utils:test-utils")) testImplementation(project(":dd-java-agent:testing")) } diff --git a/products/feature-flagging/feature-flagging-lib/gradle.lockfile b/products/feature-flagging/feature-flagging-lib/gradle.lockfile index 5a665397e35..da561bffdff 100644 --- a/products/feature-flagging/feature-flagging-lib/gradle.lockfile +++ b/products/feature-flagging/feature-flagging-lib/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :products:feature-flagging:feature-flagging-lib:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=runtimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,27 +9,31 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.blogspot.mydailyjava:weak-lock-free:0.17=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=runtimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=runtimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=runtimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=runtimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=runtimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=runtimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.google.guava:guava:20.0=testCompileClasspath,testRuntimeClasspath -com.google.re2j:re2j:1.7=testRuntimeClasspath +com.google.errorprone:error_prone_annotations:2.47.0=testCompileClasspath,testRuntimeClasspath +com.google.guava:failureaccess:1.0.3=testCompileClasspath,testRuntimeClasspath +com.google.guava:guava:33.6.0-jre=testCompileClasspath,testRuntimeClasspath +com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava=testCompileClasspath,testRuntimeClasspath +com.google.j2objc:j2objc-annotations:3.1=testCompileClasspath,testRuntimeClasspath +com.google.re2j:re2j:1.8=testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:logging-interceptor:3.12.12=testCompileClasspath,testRuntimeClasspath com.squareup.okhttp3:okhttp:3.12.12=testCompileClasspath,testRuntimeClasspath @@ -39,12 +44,12 @@ commons-io:commons-io:2.11.0=testCompileClasspath,testRuntimeClasspath commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -io.sqreen:libsqreen:17.3.0=testRuntimeClasspath +io.sqreen:libsqreen:17.4.0=testRuntimeClasspath javax.servlet:javax.servlet-api:3.1.0=testCompileClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.13.2=testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.java.dev.jna:jna-platform:5.8.0=testRuntimeClasspath net.java.dev.jna:jna:5.8.0=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs @@ -70,12 +75,13 @@ org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.jctools:jctools-core-jdk11:4.0.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +org.jspecify:jspecify:1.0.0=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -88,20 +94,23 @@ org.junit.platform:junit-platform-suite-api:1.14.1=testRuntimeClasspath org.junit.platform:junit-platform-suite-commons:1.14.1=testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath -org.mockito:mockito-core:4.4.0=testRuntimeClasspath +org.mockito:mockito-core:4.4.0=testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt org.ow2.asm:asm-commons:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt org.ow2.asm:asm-tree:9.7.1=runtimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=runtimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm:9.7.1=runtimeClasspath -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm:9.9.1=testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/ExposureWriterImpl.java b/products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/ExposureWriterImpl.java index 3783ae914f3..eddcd520f27 100644 --- a/products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/ExposureWriterImpl.java +++ b/products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/ExposureWriterImpl.java @@ -16,6 +16,7 @@ import datadog.trace.api.featureflag.exposure.ExposureEvent; import datadog.trace.api.featureflag.exposure.ExposuresRequest; import datadog.trace.api.intake.Intake; +import datadog.trace.api.internal.VisibleForTesting; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -84,6 +85,16 @@ public void accept(final ExposureEvent event) { queue.offer(event); } + @VisibleForTesting + boolean isSerializerThreadAlive() { + return serializerThread.isAlive(); + } + + @VisibleForTesting + int queueSize() { + return queue.size(); + } + private static class ExposureSerializingHandler implements Runnable { private final MessagePassingBlockingQueue queue; private final long ticksRequiredToFlush; diff --git a/products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/RemoteConfigServiceImpl.java b/products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/RemoteConfigServiceImpl.java index cf0c400ccad..ec28f684a96 100644 --- a/products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/RemoteConfigServiceImpl.java +++ b/products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/RemoteConfigServiceImpl.java @@ -1,9 +1,11 @@ package com.datadog.featureflag; import com.squareup.moshi.JsonAdapter; +import com.squareup.moshi.JsonDataException; import com.squareup.moshi.JsonReader; import com.squareup.moshi.JsonWriter; import com.squareup.moshi.Moshi; +import com.squareup.moshi.Types; import datadog.communication.ddagent.SharedCommunicationObjects; import datadog.remoteconfig.Capabilities; import datadog.remoteconfig.ConfigurationChangesTypedListener; @@ -13,11 +15,18 @@ import datadog.remoteconfig.Product; import datadog.trace.api.Config; import datadog.trace.api.featureflag.FeatureFlaggingGateway; +import datadog.trace.api.featureflag.ufc.v1.Flag; import datadog.trace.api.featureflag.ufc.v1.ServerConfiguration; import java.io.ByteArrayInputStream; import java.io.IOException; -import java.time.OffsetDateTime; +import java.lang.annotation.Annotation; +import java.lang.reflect.Type; +import java.time.Instant; +import java.time.format.DateTimeFormatter; import java.util.Date; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; import javax.annotation.Nonnull; import javax.annotation.Nullable; import okio.Okio; @@ -59,11 +68,10 @@ static class UniversalFlagConfigDeserializer static final UniversalFlagConfigDeserializer INSTANCE = new UniversalFlagConfigDeserializer(); + private static final Moshi MOSHI = + new Moshi.Builder().add(Date.class, new DateAdapter()).add(FlagMapAdapter.FACTORY).build(); private static final JsonAdapter V1_ADAPTER = - new Moshi.Builder() - .add(Date.class, new DateAdapter()) - .build() - .adapter(ServerConfiguration.class); + MOSHI.adapter(ServerConfiguration.class); @Override public ServerConfiguration deserialize(final byte[] content) throws IOException { @@ -71,6 +79,63 @@ public ServerConfiguration deserialize(final byte[] content) throws IOException } } + static class FlagMapAdapter extends JsonAdapter> { + + private static final Type FLAGS_TYPE = + Types.newParameterizedType(Map.class, String.class, Flag.class); + + static final Factory FACTORY = + new Factory() { + @Nullable + @Override + public JsonAdapter create( + @Nonnull final Type type, + @Nonnull final Set annotations, + @Nonnull final Moshi moshi) { + if (!annotations.isEmpty() || !Types.equals(type, FLAGS_TYPE)) { + return null; + } + return new FlagMapAdapter(moshi.adapter(Flag.class)); + } + }; + + private final JsonAdapter flagAdapter; + + FlagMapAdapter(final JsonAdapter flagAdapter) { + this.flagAdapter = flagAdapter; + } + + @Nullable + @Override + public Map fromJson(@Nonnull final JsonReader reader) throws IOException { + if (reader.peek() == JsonReader.Token.NULL) { + return reader.nextNull(); + } + final Map flags = new HashMap<>(); + reader.beginObject(); + while (reader.hasNext()) { + final String flagKey = reader.nextName(); + final Object rawFlag = reader.readJsonValue(); + try { + final Flag flag = flagAdapter.fromJsonValue(rawFlag); + if (flag != null) { + flags.put(flagKey, flag); + } + } catch (JsonDataException | IllegalArgumentException ignored) { + // A malformed flag must not prevent other flags in the same config from evaluating. + } + } + reader.endObject(); + return flags; + } + + @Override + public void toJson(@Nonnull final JsonWriter writer, @Nullable final Map value) + throws IOException { + throw new UnsupportedOperationException("Reading only adapter"); + } + } + static class DateAdapter extends JsonAdapter { @Nullable @@ -81,10 +146,8 @@ public Date fromJson(@Nonnull final JsonReader reader) throws IOException { return null; } try { - // Use OffsetDateTime which handles variable precision fractional seconds (0-9 digits) - // and UTC offsets (+01:00, -05:00, Z) - final OffsetDateTime odt = OffsetDateTime.parse(date); - return Date.from(odt.toInstant()); + final Instant instant = DateTimeFormatter.ISO_OFFSET_DATE_TIME.parse(date, Instant::from); + return Date.from(instant); } catch (Exception e) { // ignore wrongly set dates return null; diff --git a/products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/SpanEnrichmentAccumulator.java b/products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/SpanEnrichmentAccumulator.java new file mode 100644 index 00000000000..a14274432b0 --- /dev/null +++ b/products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/SpanEnrichmentAccumulator.java @@ -0,0 +1,257 @@ +package com.datadog.featureflag; + +import datadog.json.JsonWriter; +import java.util.LinkedHashMap; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; + +/** + * Per-local-root-span accumulator for APM feature-flag span enrichment. + * + *

      Holds the serial ids, hashed subjects, and runtime defaults captured during flag evaluation + * for a single local trace fragment. The limits, dedupe semantics, truncation, and output tag + * shapes are FROZEN against the Node reference ({@code dd-trace-js#8343}) — see {@link + * ULeb128Encoder}. + * + *

      Instances are created lazily and held in a {@link SpanEnrichmentStates} store, keyed by the + * local-root span object. The agent-side {@link SpanEnrichmentWriter} writes (from the flag-eval + * seam); the write interceptor ({@link SpanEnrichmentInterceptor}) reads and clears. When the + * span-enrichment gate is off, no seam events are dispatched, so no store and no accumulator are + * ever created and there is no idle per-span overhead. + * + *

      Runtime-default values arrive already unwrapped to native Java types (the capture side unwraps + * any OpenFeature {@code Value} before crossing the seam), so this class has no OpenFeature + * dependency. + * + *

      Output tag shapes: + * + *

        + *
      • {@code ffe_flags_enc} — a bare base64 string (delta-varint of the serial ids) + *
      • {@code ffe_subjects_enc} — a JSON object string {@code {"": "", ...}} + *
      • {@code ffe_runtime_defaults} — a JSON object string {@code {"": "", ...}} + *
      + */ +final class SpanEnrichmentAccumulator { + + static final int MAX_SERIAL_IDS = 200; + static final int MAX_SUBJECTS = 10; + static final int MAX_EXPERIMENTS_PER_SUBJECT = 20; + static final int MAX_DEFAULTS = 5; + static final int MAX_DEFAULT_VALUE_LENGTH = 64; + + static final String TAG_FLAGS_ENC = "ffe_flags_enc"; + static final String TAG_SUBJECTS_ENC = "ffe_subjects_enc"; + static final String TAG_RUNTIME_DEFAULTS = "ffe_runtime_defaults"; + + // dedupe is structural (a Set); sorted for deterministic encoding. + private final TreeSet serialIds = new TreeSet<>(); + // sha256hex(targetingKey) -> serial ids. LinkedHashMap for stable iteration order. + private final Map> subjects = new LinkedHashMap<>(); + // flagKey -> value string (first-wins, truncated to MAX_DEFAULT_VALUE_LENGTH). + private final Map defaults = new LinkedHashMap<>(); + + /** Adds a serial id, dropping silently once {@link #MAX_SERIAL_IDS} is reached. */ + synchronized void addSerialId(final int id) { + if (serialIds.size() >= MAX_SERIAL_IDS && !serialIds.contains(id)) { + return; + } + serialIds.add(id); + } + + /** + * Records that the given targeting key was exposed to the experiment identified by {@code id}. + * The targeting key is SHA-256-hashed before storage. Enforces both the subject cap ({@link + * #MAX_SUBJECTS}) and the per-subject experiment cap ({@link #MAX_EXPERIMENTS_PER_SUBJECT}). + */ + synchronized void addSubject(final String targetingKey, final int id) { + if (targetingKey == null) { + return; + } + final String hashed = ULeb128Encoder.hashTargetingKey(targetingKey); + final TreeSet existing = subjects.get(hashed); + if (existing != null) { + if (existing.size() >= MAX_EXPERIMENTS_PER_SUBJECT && !existing.contains(id)) { + return; + } + existing.add(id); + return; + } + if (subjects.size() >= MAX_SUBJECTS) { + return; + } + final TreeSet ids = new TreeSet<>(); + ids.add(id); + subjects.put(hashed, ids); + } + + /** + * Records a runtime-default value for {@code flagKey} (first-wins). Structured values (Map/List) + * are serialized to JSON (NOT {@code toString()}); the result is truncated to {@link + * #MAX_DEFAULT_VALUE_LENGTH}. + */ + synchronized void addDefault(final String flagKey, final Object value) { + if (flagKey == null) { + return; + } + if (defaults.containsKey(flagKey)) { + return; // first-wins + } + if (defaults.size() >= MAX_DEFAULTS) { + return; + } + String valueStr = stringifyDefault(value); + if (valueStr.length() > MAX_DEFAULT_VALUE_LENGTH) { + valueStr = utf8SafeTruncate(valueStr, MAX_DEFAULT_VALUE_LENGTH); + } + defaults.put(flagKey, valueStr); + } + + /** + * @return true when there is at least one serial id or runtime default to write. Subjects are not + * checked because a subject is never recorded without its serial id. + */ + synchronized boolean hasData() { + return !serialIds.isEmpty() || !defaults.isEmpty(); + } + + /** + * Builds the {@code ffe_*} span tags from the accumulated state. Empty groups are omitted. + * + * @return a map of tag name to tag value (a subset of {@code ffe_flags_enc}, {@code + * ffe_subjects_enc}, {@code ffe_runtime_defaults}) + */ + synchronized Map toSpanTags() { + final Map tags = new LinkedHashMap<>(); + if (!serialIds.isEmpty()) { + final String encoded = ULeb128Encoder.encodeDeltaVarint(serialIds); + if (!encoded.isEmpty()) { + tags.put(TAG_FLAGS_ENC, encoded); + } + } + if (!subjects.isEmpty()) { + final Map encodedSubjects = new LinkedHashMap<>(); + for (final Map.Entry> entry : subjects.entrySet()) { + encodedSubjects.put(entry.getKey(), ULeb128Encoder.encodeDeltaVarint(entry.getValue())); + } + tags.put(TAG_SUBJECTS_ENC, toJsonObject(encodedSubjects)); + } + if (!defaults.isEmpty()) { + tags.put(TAG_RUNTIME_DEFAULTS, toJsonObject(defaults)); + } + return tags; + } + + // ---- helpers (visible for tests) ---- + + /** + * Mirrors the Node {@code (typeof value === 'object' && value !== null) ? JSON.stringify(value) : + * String(value)} rule: structured values (Map/List/array) are JSON-stringified; scalars use their + * string form; {@code null} becomes the bare {@code null}. + * + *

      The value has already been unwrapped to a native Java type by the capture side (any + * OpenFeature {@code Value} is converted to Map/List/scalar before the seam), so no OpenFeature + * type ever reaches here. + */ + static String stringifyDefault(final Object value) { + if (value == null) { + return "null"; + } + if (value instanceof Map || value instanceof Iterable || value.getClass().isArray()) { + return toJsonValue(value); + } + if (value instanceof CharSequence || value instanceof Character) { + return value.toString(); + } + // Numbers / booleans — their string form matches what Node's String(value) emits for these + // scalar cases. + return String.valueOf(value); + } + + /** UTF-8-safe truncation: never split a surrogate pair at the {@code maxChars} boundary. */ + static String utf8SafeTruncate(final String value, final int maxChars) { + if (value.length() <= maxChars) { + return value; + } + int end = maxChars; + if (Character.isHighSurrogate(value.charAt(end - 1))) { + end--; // drop the dangling high surrogate rather than emit a broken pair + } + return value.substring(0, end); + } + + /** + * Serializes a String->String map to a compact JSON object string using the platform {@link + * JsonWriter}. + * + *

      Consumers of these tags parse them as JSON (the backend enricher via Jackson, the parametric + * system-tests via {@code json.loads}), so the writer's escaping (e.g. {@code /} → {@code \/}, + * non-ASCII → {@code \\uXXXX}) is round-trip-equivalent and byte-parity with the JS reference is + * not required. + */ + static String toJsonObject(final Map map) { + try (JsonWriter writer = new JsonWriter()) { + writer.beginObject(); + for (final Map.Entry entry : map.entrySet()) { + writer.name(entry.getKey()).value(entry.getValue()); + } + writer.endObject(); + return writer.toString(); + } + } + + private static String toJsonValue(final Object value) { + try (JsonWriter writer = new JsonWriter()) { + writeJsonValue(writer, value); + return writer.toString(); + } + } + + @SuppressWarnings("unchecked") + private static void writeJsonValue(final JsonWriter writer, final Object value) { + // Callers pass values already unwrapped to native form by the capture side, so no OpenFeature + // Value ever reaches here. + if (value == null) { + writer.nullValue(); + } else if (value instanceof Map) { + writer.beginObject(); + for (final Map.Entry entry : ((Map) value).entrySet()) { + writer.name(String.valueOf(entry.getKey())); + writeJsonValue(writer, entry.getValue()); + } + writer.endObject(); + } else if (value instanceof Iterable) { + writer.beginArray(); + for (final Object element : (Iterable) value) { + writeJsonValue(writer, element); + } + writer.endArray(); + } else if (value instanceof Boolean) { + writer.value((Boolean) value); + } else if (value instanceof Integer + || value instanceof Long + || value instanceof Short + || value instanceof Byte) { + writer.value(((Number) value).longValue()); + } else if (value instanceof Number) { + writer.value(((Number) value).doubleValue()); + } else { + // CharSequence / Character / anything else → string form. + writer.value(value.toString()); + } + } + + // ---- test-only accessors ---- + + synchronized Set serialIdsView() { + return new TreeSet<>(serialIds); + } + + synchronized int subjectCount() { + return subjects.size(); + } + + synchronized int defaultCount() { + return defaults.size(); + } +} diff --git a/products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/SpanEnrichmentInterceptor.java b/products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/SpanEnrichmentInterceptor.java new file mode 100644 index 00000000000..a82e194e248 --- /dev/null +++ b/products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/SpanEnrichmentInterceptor.java @@ -0,0 +1,133 @@ +package com.datadog.featureflag; + +import datadog.trace.api.interceptor.MutableSpan; +import datadog.trace.api.interceptor.TraceInterceptor; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import java.util.Collection; +import java.util.Map; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * {@link TraceInterceptor} that writes the accumulated {@code ffe_*} tags onto the local root span + * when a trace actually completes. This is the WRITE half of the capture-vs-write split — + * the CAPTURE half is the agent-side {@link SpanEnrichmentWriter}, which fills the {@link + * SpanEnrichmentStates} store from flag-evaluation seam events. + * + *

      Single agent-side owner

      + * + *

      Exactly one interceptor is created and owned by the {@link SpanEnrichmentWriter} (agent + * classloader) and registered with the tracer at most once, lazily on the first enrichment event. + * Because the owner lives in the stable agent classloader — not per-provider in an application + * classloader — there is no rebinding, no reconfiguration hazard, and no application-classloader + * pinning. + * + *

      Partial-flush correctness

      + * + *

      {@code dd-trace-core} runs {@code onTraceComplete} on every flush, not only on final + * trace completion: {@code CoreTracer.write(SpanList)} → {@code interceptCompleteTrace(...)} fires + * for both partial flushes ({@code PendingTrace.partialFlush()} → {@code write(true)}) and the + * final write ({@code write(false)}). A partial flush deliberately excludes the + * still-open local root — {@code PendingTrace} holds the root back ({@code rootSpanWritten}) + * and {@code getRootSpan()} returns null on a partial fragment, so {@code CoreTracer.write} does + * not invoke {@code onRootSpanFinished} for it. + * + *

      Therefore this interceptor flushes+removes state only when the local root span is present + * in the flushed collection (i.e. this is the final write for the trace). On a partial flush + * the root is absent, so we return early and keep the accumulator intact, preserving every + * flag evaluated before the flush boundary. Without this guard, the first partial flush would drain + * the accumulator and write tags onto a not-yet-finished root, silently dropping all pre-flush + * enrichment — exactly the long-running-trace data-loss bug. + * + *

      The store is weak-keyed by the local-root span, so a trace that never reaches this interceptor + * is collected with its root and cannot leak unboundedly. + * + *

      All work is wrapped in try/catch — enrichment must NEVER break trace finish. + */ +final class SpanEnrichmentInterceptor implements TraceInterceptor { + + private static final Logger log = LoggerFactory.getLogger(SpanEnrichmentInterceptor.class); + + /** + * Unique priority in the "trace data enrichment" band, after {@code GIT_METADATA} (3) and before + * the custom-sampling band ({@code Integer.MAX_VALUE - 2}). Distinct from every value in {@code + * AbstractTraceInterceptor.Priority} and from the CI Visibility interceptors. + */ + static final int PRIORITY = 4; + + private final SpanEnrichmentStates states; + + SpanEnrichmentInterceptor(final SpanEnrichmentStates states) { + this.states = states; + } + + @Override + public Collection onTraceComplete( + final Collection trace) { + try { + // Fast path: no accumulated state at all → skip the per-flush scan + lock entirely. This is + // the common case for services that never evaluate a flag on a given trace. + if (trace == null || trace.isEmpty() || states.isEmpty()) { + return trace; + } + // Resolve the local root for this fragment, then require that the root is actually PRESENT in + // this collection. A partial flush excludes the still-open root, so its absence means "not + // the final write" — keep the accumulator and bail. + final MutableSpan localRoot = findLocalRootInFragment(trace); + if (!(localRoot instanceof AgentSpan)) { + return trace; // partial flush, or no resolvable in-fragment root: keep state untouched + } + // Key by the local-root span object to match the capture-side keying. + final SpanEnrichmentAccumulator state = states.remove((AgentSpan) localRoot); + if (state == null || !state.hasData()) { + return trace; + } + // toSpanTags() only ever returns present, non-empty values, so write them directly. + for (final Map.Entry tag : state.toSpanTags().entrySet()) { + localRoot.setTag(tag.getKey(), tag.getValue()); + } + } catch (final Throwable t) { + // Never let span enrichment break trace finish; a debug line aids diagnosis if it does. + log.debug("Span-enrichment tag write failed", t); + } + return trace; + } + + /** + * Resolves the local root span for this fragment and returns it ONLY if it is actually present in + * the fragment by reference identity. Returns {@code null} when the root is not in the collection + * (a partial flush excludes the still-open root) or when no root can be safely identified. + * + *

      We never guess: a non-root span is never returned. If the first span reports a non-null + * local root, we accept it only after confirming that exact object is in the fragment; otherwise + * we look for a span that is provably its own local root and present. + */ + private static MutableSpan findLocalRootInFragment( + final Collection trace) { + final MutableSpan first = trace.iterator().next(); + final MutableSpan candidate = first.getLocalRootSpan(); + if (candidate != null) { + // Accept the reported local root only if it is genuinely part of THIS fragment. On a partial + // flush the root is reachable by reference but NOT in the collection → reject (keep state). + for (final MutableSpan span : trace) { + if (span == candidate) { + return candidate; + } + } + return null; // root excluded from this fragment → partial flush, do not flush/remove + } + // Local root unknown for the first span: only accept a span that is provably its own local root + // and present here. Never fall back to an arbitrary span. + for (final MutableSpan span : trace) { + if (span.getLocalRootSpan() == span) { + return span; + } + } + return null; + } + + @Override + public int priority() { + return PRIORITY; + } +} diff --git a/products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/SpanEnrichmentStates.java b/products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/SpanEnrichmentStates.java new file mode 100644 index 00000000000..7231466cd1b --- /dev/null +++ b/products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/SpanEnrichmentStates.java @@ -0,0 +1,69 @@ +package com.datadog.featureflag; + +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import java.util.Map; +import java.util.WeakHashMap; + +/** + * Store of per-trace {@link SpanEnrichmentAccumulator} state, keyed by the local-root span object. + * + *

      Weak keys. The map is a {@link WeakHashMap} keyed by the local-root {@link AgentSpan} + * instance. The accumulator is reachable only while its local-root span is, so a trace that never + * reaches the interceptor (dropped, Noop tracer, never-finishing root) is collected together with + * its root — it cannot leak unboundedly. No cap, FIFO eviction, or cleanup thread is required; + * {@code WeakHashMap} purges stale entries on access. + * + *

      Identity keying. {@code DDSpan} does not override {@code equals}/{@code hashCode}, so + * the map keys by object identity. Keying by the local-root span object (rather than the 128-bit + * trace-id hex string) is inherently unique per trace: two distinct traces have distinct root + * objects and can never share an accumulator. + * + *

      A single store is owned by the agent-side {@link SpanEnrichmentWriter} and shared with its + * {@link SpanEnrichmentInterceptor}. The writer accumulates (from the flag-eval seam); the + * interceptor reads + removes (trace-write thread). + * + *

      Thread-safety: all access is guarded by the intrinsic lock on this instance. The writer writes + * (eval thread) and the interceptor reads+removes (trace-write thread) concurrently, so every + * mutator and accessor synchronizes. Contention is low — operations are O(1) map touches. + */ +final class SpanEnrichmentStates { + + // Weak keys: the accumulator is GC'd with its local-root span, so a trace that never completes + // cannot leak. Identity-keyed by the local-root AgentSpan object. guarded by 'this'. + private final Map states = new WeakHashMap<>(); + + /** Returns the accumulator for {@code root}, creating (and inserting) it if absent. */ + synchronized SpanEnrichmentAccumulator getOrCreate(final AgentSpan root) { + SpanEnrichmentAccumulator existing = states.get(root); + if (existing != null) { + return existing; + } + final SpanEnrichmentAccumulator created = new SpanEnrichmentAccumulator(); + states.put(root, created); + return created; + } + + /** Removes and returns the accumulator for {@code root}, or {@code null} if absent. */ + synchronized SpanEnrichmentAccumulator remove(final AgentSpan root) { + return states.remove(root); + } + + /** Clears all tracked state (cleanup on shutdown). */ + synchronized void clear() { + states.clear(); + } + + synchronized int size() { + return states.size(); + } + + synchronized boolean isEmpty() { + return states.isEmpty(); + } + + // ---- test-only accessor ---- + + synchronized SpanEnrichmentAccumulator peek(final AgentSpan root) { + return states.get(root); + } +} diff --git a/products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/SpanEnrichmentWriter.java b/products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/SpanEnrichmentWriter.java new file mode 100644 index 00000000000..428378b3055 --- /dev/null +++ b/products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/SpanEnrichmentWriter.java @@ -0,0 +1,195 @@ +package com.datadog.featureflag; + +import datadog.trace.api.GlobalTracer; +import datadog.trace.api.featureflag.FeatureFlaggingGateway; +import datadog.trace.api.featureflag.SpanEnrichmentEvent; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import datadog.trace.bootstrap.instrumentation.api.AgentTracer; +import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; +import java.util.concurrent.atomic.AtomicBoolean; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * Agent-side owner of APM feature-flag span enrichment. This is the WRITE tier of the + * capture-vs-write split: it listens on {@link FeatureFlaggingGateway} for {@link + * SpanEnrichmentEvent}s dispatched by the published {@code dd-openfeature} provider during flag + * evaluation, resolves the active local-root span, and accumulates per-trace state that a {@link + * SpanEnrichmentInterceptor} later flushes onto the root when the trace completes. + * + *

      Process-wide singleton (restart-safe). Use {@link #getInstance()} for the agent wiring. + * The tracer keeps trace interceptors for the life of the JVM and offers no removal API, so the + * interceptor — and the weak-keyed state it reads — must outlive any single start/stop of the + * feature-flagging subsystem. A fresh writer per {@code start()} would build a second interceptor + * at the same priority; the tracer would reject it and its state would never be read, silently + * disabling enrichment after a restart. Reusing one instance avoids that: the single interceptor is + * registered exactly once and simply resumes when {@link #init()} re-subscribes the listener. + * + *

      Zero idle overhead when off. When the span-enrichment gate is off the provider adds no + * capture hook, so no seam events are dispatched, this listener never runs, and the interceptor is + * never registered — the tracer's write path is untouched. The interceptor is registered lazily on + * the first enrichment event that has an active span, so a service that enables the feature but + * never evaluates a flag on a traced request still pays nothing. + * + *

      All work is wrapped in try/catch — enrichment must NEVER break flag evaluation. + */ +@SuppressFBWarnings( + value = "SING_SINGLETON_HAS_NONPRIVATE_CONSTRUCTOR", + justification = + "The production path constructs the sole instance through the private no-arg constructor " + + "behind INSTANCE/getInstance(); the package-private constructors are deliberate " + + "test-only seams for injecting the root-span resolver and interceptor registrar. The " + + "singleton itself is required (PR #11658 review) so the single, unremovable trace " + + "interceptor is registered exactly once and survives subsystem start/stop.") +public final class SpanEnrichmentWriter implements FeatureFlaggingGateway.SpanEnrichmentListener { + + private static final Logger log = LoggerFactory.getLogger(SpanEnrichmentWriter.class); + + // The one instance used by the agent. Persisting it across FeatureFlaggingSystem start/stop keeps + // the single registered interceptor (and its state) alive, so a restart never re-registers. + private static final SpanEnrichmentWriter INSTANCE = new SpanEnrichmentWriter(); + + public static SpanEnrichmentWriter getInstance() { + return INSTANCE; + } + + /** + * Resolves the local-root span for the active trace. Injectable so tests need no static mocks. + */ + interface RootSpanResolver { + AgentSpan activeLocalRoot(); + } + + /** + * Registers the interceptor with the tracer, returning {@code true} when accepted. Injectable so + * tests are deterministic without a globally-installed tracer. + */ + interface InterceptorRegistrar { + boolean register(SpanEnrichmentInterceptor interceptor); + } + + private static final RootSpanResolver DEFAULT_RESOLVER = + () -> resolveLocalRoot(AgentTracer.activeSpan()); + + // Visible for tests: the local-root resolution, decoupled from the static AgentTracer so it can + // be exercised without a live tracer. + static AgentSpan resolveLocalRoot(final AgentSpan active) { + if (active == null) { + return null; + } + final AgentSpan localRoot = active.getLocalRootSpan(); + return localRoot != null ? localRoot : active; + } + + private static final InterceptorRegistrar DEFAULT_REGISTRAR = + interceptor -> GlobalTracer.get().addTraceInterceptor(interceptor); + + private final RootSpanResolver rootSpanResolver; + private final InterceptorRegistrar registrar; + private final SpanEnrichmentStates states; + private final SpanEnrichmentInterceptor interceptor; + // Registered with the tracer at most once, lazily on the first enrichment event with an active + // span. Once true it stays true for the life of this instance, so a subsystem restart (which + // reuses the singleton) never attempts a second, doomed registration. + private final AtomicBoolean interceptorRegistered = new AtomicBoolean(false); + + private SpanEnrichmentWriter() { + this(DEFAULT_RESOLVER, DEFAULT_REGISTRAR); + } + + // Visible for tests: an isolated writer (own state + interceptor) whose interceptor registration + // is assumed to succeed, bypassing the shared INSTANCE and any globally-installed tracer. + SpanEnrichmentWriter(final RootSpanResolver rootSpanResolver) { + this(rootSpanResolver, interceptor -> true); + } + + // Visible for tests: also inject the registrar to exercise the not-registered path. + SpanEnrichmentWriter( + final RootSpanResolver rootSpanResolver, final InterceptorRegistrar registrar) { + this.rootSpanResolver = rootSpanResolver; + this.registrar = registrar; + this.states = new SpanEnrichmentStates(); + this.interceptor = new SpanEnrichmentInterceptor(states); + } + + /** Starts listening for enrichment events. Safe to call again after {@link #close()}. */ + public void init() { + FeatureFlaggingGateway.addSpanEnrichmentListener(this); + } + + /** + * Stops listening and drops any residual state. The interceptor stays registered with the tracer + * (it cannot be removed) but goes inert while the state is empty; a later {@link #init()} resumes + * enrichment on the same interceptor. + */ + public void close() { + FeatureFlaggingGateway.removeSpanEnrichmentListener(this); + states.clear(); + } + + @Override + public void accept(final SpanEnrichmentEvent event) { + if (event == null) { + return; + } + try { + final AgentSpan root = rootSpanResolver.activeLocalRoot(); + if (root == null) { + return; // no active span → nothing to enrich (and nothing to register the interceptor for) + } + if (!ensureInterceptorRegistered()) { + // The interceptor isn't registered (e.g. tracer absent), so nothing would ever flush this + // state — skip accumulating. A later event retries registration. + return; + } + final SpanEnrichmentAccumulator state = states.getOrCreate(root); + if (event.hasSerialId()) { + final int serialId = event.serialId(); + state.addSerialId(serialId); + if (event.doLog() && event.targetingKey() != null) { + state.addSubject(event.targetingKey(), serialId); + } + } else if (event.flagKey() != null) { + state.addDefault(event.flagKey(), event.defaultValue()); + } + } catch (final Throwable t) { + // Never let span enrichment break flag evaluation; a debug line aids diagnosis if it does. + log.debug("Span-enrichment accumulation failed", t); + } + } + + /** + * @return true once the interceptor is registered with the tracer. + */ + private boolean ensureInterceptorRegistered() { + if (interceptorRegistered.get()) { + return true; + } + synchronized (this) { + if (interceptorRegistered.get()) { + return true; + } + try { + // register() returns false (without throwing) when the tracer rejects it — e.g. the global + // tracer is still the no-op placeholder. Only latch on success so a later event retries; + // otherwise a transient false would permanently disable enrichment. + if (registrar.register(interceptor)) { + interceptorRegistered.set(true); + } + } catch (final Throwable t) { + // Leave unregistered; a later event retries. + } + return interceptorRegistered.get(); + } + } + + // ---- test-only accessors ---- + + SpanEnrichmentStates states() { + return states; + } + + SpanEnrichmentInterceptor interceptor() { + return interceptor; + } +} diff --git a/products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/ULeb128Encoder.java b/products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/ULeb128Encoder.java new file mode 100644 index 00000000000..7566cf8698d --- /dev/null +++ b/products/feature-flagging/feature-flagging-lib/src/main/java/com/datadog/featureflag/ULeb128Encoder.java @@ -0,0 +1,97 @@ +package com.datadog.featureflag; + +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.util.Base64; +import java.util.Set; +import java.util.SortedSet; +import java.util.TreeSet; + +/** + * ULEB128 delta-varint + base64 codec for APM feature-flag span enrichment. + * + *

      Ported VERBATIM from the frozen Node reference ({@code dd-trace-js#8343}). The tag names, + * encoding, and golden vectors are FROZEN against that contract — backend/Trino decode and the + * parametric system-tests assertions depend on exact parity, so this MUST NOT be re-derived. + * + *

      Algorithm: dedupe (via {@link Set}) → sort ascending → emit the delta from the previous id as + * an unsigned LEB128 varint (7 bits/byte, MSB = continuation) → base64-encode the byte buffer. The + * empty set encodes to the empty string (the caller then omits the tag). + * + *

      Golden vector: {@code {100, 108, 128, 130}} → deltas {@code [100, 8, 20, 2]} → bytes {@code + * [0x64, 0x08, 0x14, 0x02]} → base64 {@code "ZAgUAg=="}. + */ +final class ULeb128Encoder { + + private ULeb128Encoder() {} + + /** + * ULEB128 delta-varint encodes the given serial ids into a bare base64 string. + * + * @param serialIds the serial ids to encode (deduped + sorted ascending internally) + * @return the base64-encoded delta-varint bytes, or the empty string when {@code serialIds} is + * empty or null + */ + static String encodeDeltaVarint(final Set serialIds) { + if (serialIds == null || serialIds.isEmpty()) { + // Empty set encodes to the empty string; the caller omits the tag. + return ""; + } + final SortedSet sorted = + serialIds instanceof SortedSet ? (SortedSet) serialIds : new TreeSet<>(serialIds); + // Worst case: 5 bytes per 32-bit varint. + final byte[] buffer = new byte[sorted.size() * 5]; + int length = 0; + int previous = 0; + for (final Integer id : sorted) { + long delta = + ((long) id) - previous; // long to stay safe; deltas are non-negative (sorted asc) + previous = id; + while (delta > 0x7FL) { + buffer[length++] = (byte) ((delta & 0x7FL) | 0x80L); + delta >>>= 7; + } + buffer[length++] = (byte) (delta & 0x7FL); + } + final byte[] out = new byte[length]; + System.arraycopy(buffer, 0, out, 0, length); + return Base64.getEncoder().encodeToString(out); + } + + /** + * Lower-case hex SHA-256 of the given string. Used to hash subject targeting keys before they are + * emitted (privacy: subject keys are never emitted in clear text). + * + * @param value the value to hash + * @return the lower-case hex SHA-256 digest + */ + static String hashTargetingKey(final String value) { + final MessageDigest digest = SHA_256.get(); + digest.reset(); + final byte[] hash = digest.digest(value.getBytes(StandardCharsets.UTF_8)); + final StringBuilder hex = new StringBuilder(hash.length * 2); + for (final byte b : hash) { + final int v = b & 0xFF; + if (v < 0x10) { + hex.append('0'); + } + hex.append(Integer.toHexString(v)); + } + return hex.toString(); + } + + // Per-thread SHA-256 instance: hashing runs on every doLog=true subject capture, so a + // ThreadLocal avoids a provider lookup + allocation per call on that hot path. digest() resets + // the instance after each hash; we also reset() defensively before use. + private static final ThreadLocal SHA_256 = + ThreadLocal.withInitial( + () -> { + try { + return MessageDigest.getInstance("SHA-256"); + } catch (final NoSuchAlgorithmException e) { + // SHA-256 is mandated by the JLS on every JVM; unreachable in practice. + throw new IllegalStateException("SHA-256 algorithm not available", e); + } + }); +} diff --git a/products/feature-flagging/feature-flagging-lib/src/test/groovy/com/datadog/featureflag/ExposureWriterTests.groovy b/products/feature-flagging/feature-flagging-lib/src/test/groovy/com/datadog/featureflag/ExposureWriterTests.groovy deleted file mode 100644 index 960102b8da2..00000000000 --- a/products/feature-flagging/feature-flagging-lib/src/test/groovy/com/datadog/featureflag/ExposureWriterTests.groovy +++ /dev/null @@ -1,317 +0,0 @@ -package com.datadog.featureflag - -import static datadog.trace.agent.test.server.http.TestHttpServer.httpServer -import static java.util.concurrent.TimeUnit.MILLISECONDS - -import com.squareup.moshi.Moshi -import datadog.communication.ddagent.DDAgentFeaturesDiscovery -import datadog.communication.ddagent.SharedCommunicationObjects -import datadog.trace.agent.test.server.http.TestHttpServer -import datadog.trace.api.Config -import datadog.trace.api.IdGenerationStrategy -import datadog.trace.api.featureflag.FeatureFlaggingGateway -import datadog.trace.api.featureflag.exposure.Allocation -import datadog.trace.api.featureflag.exposure.ExposureEvent -import datadog.trace.api.featureflag.exposure.ExposuresRequest -import datadog.trace.api.featureflag.exposure.Flag -import datadog.trace.api.featureflag.exposure.Subject -import datadog.trace.api.featureflag.exposure.Variant -import datadog.trace.test.util.DDSpecification -import java.util.concurrent.ConcurrentHashMap -import java.util.concurrent.ConcurrentLinkedQueue -import java.util.concurrent.CountDownLatch -import java.util.concurrent.Executors -import okhttp3.HttpUrl -import okhttp3.OkHttpClient -import okio.Okio -import spock.lang.AutoCleanup -import spock.lang.Shared -import spock.util.concurrent.PollingConditions - -class ExposureWriterTests extends DDSpecification { - - @Shared - protected final Queue requests = new ConcurrentLinkedQueue<>() - - @Shared - protected final Set failed = Collections.newSetFromMap(new ConcurrentHashMap()) - - @Shared - @AutoCleanup - protected TestHttpServer server = httpServer { - final adapter = new Moshi.Builder().build().adapter(ExposuresRequest) - handlers { - prefix("/evp_proxy/api/v2/exposures") { - final exposuresRequest = adapter.fromJson(Okio.buffer(Okio.source(new ByteArrayInputStream(request.body)))) - final serviceName = exposuresRequest.context.service - final failForever = serviceName == 'fail-forever' - final fail = serviceName.startsWith('fail') && (failed.add(serviceName) || failForever) - if (fail) { - response.status(500).send('Boom!!!') - } else { - requests.add(exposuresRequest) - response.status(200).send('OK') - } - } - } - } - - @Shared - protected PollingConditions poll = new PollingConditions(timeout: 5) - - @Shared - protected SharedCommunicationObjects sco = Stub(SharedCommunicationObjects) { - featuresDiscovery(_ as Config) >> { - return Mock(DDAgentFeaturesDiscovery) { - supportsEvpProxy() >> true - getEvpProxyEndpoint() >> '/evp_proxy/' - } - } - }.tap { - agentUrl = HttpUrl.get(server.address) - agentHttpClient = new OkHttpClient.Builder().build() - } - - void cleanup() { - requests.clear() - failed.clear() - } - - void 'test exposure event writes'() { - setup: - def config = mockConfig(service, env, version) - def exposures = (1..5).collect { buildExposure() } - def writer = new ExposureWriterImpl(1 << 4, 100, MILLISECONDS, sco, config) - writer.init() - - when: - exposures.each { writer.accept(it) } - - then: - poll.eventually { - assert !requests.empty - requests.each { - assert it.context.service == service ?: 'unknown' - if (env) { - assert it.context.env == env - } - if (version) { - assert it.context.version == version.toString() - } - } - final received = requests*.exposures.flatten() as List - assertExposures(received, exposures) - } - - cleanup: - writer.close() - - where: - service | env | version - null | null | null - 'test-service' | 'test' | '23' - 'test-service' | null | '23' - 'test-service' | 'test' | null - } - - void 'test lru cache'() { - setup: - def config = mockConfig('test-service') - def exposures = (0..5).collect { buildExposure() } - def writer = new ExposureWriterImpl(1 << 4, 100, MILLISECONDS, sco, config) - writer.init() - - when: 'populating the cache' - exposures.each { writer.accept(it) } - - then: 'all events are written' - new PollingConditions(timeout: 1).eventually { - requests*.exposures.flatten().size() == exposures.size() - } - - when: 'publishing duplicate events' - exposures.each { writer.accept(it) } - - then: 'no events are written' - MILLISECONDS.sleep(300) // wait until a flush happens - requests*.exposures.flatten().size() == exposures.size() - - when: 'a new event is generated' - writer.accept(buildExposure()) - - then: 'oldest event is evicted and the new one is submitted' - poll.eventually { - requests*.exposures.flatten().size() == exposures.size() + 1 - } - - cleanup: - writer.close() - } - - void 'test high load scenario'() { - setup: - def config = mockConfig('test-service') - def exposuresPerThread = 100 - def random = new Random() - def threads = Runtime.runtime.availableProcessors() - def executor = Executors.newFixedThreadPool(threads) - def exposures = (1..(threads * exposuresPerThread)).collect { - buildExposure() - } - def latch = new CountDownLatch(1) - def writer = new ExposureWriterImpl(sco, config) - writer.init() - - when: - def futures = exposures.collate(exposuresPerThread).collect { partition -> - executor.submit { - latch.await() - partition.each { - MILLISECONDS.sleep(random.nextInt(2)) - writer.accept(it) - } - return true - } - } - latch.countDown() // start threads - - then: - futures.each { it.get() } // wait for all threads to finish - poll.eventually { - final received = requests*.exposures.flatten() as List - assertExposures(received, exposures) - } - - cleanup: - writer.close() - executor.shutdownNow() - } - - void 'test failures are retried'() { - setup: - def config = mockConfig(serviceName) - def writer = new ExposureWriterImpl(1 << 4, 100, MILLISECONDS, sco, config) - writer.init() - - when: - writer.accept(buildExposure()) - - then: - MILLISECONDS.sleep(500) // wait for a flush to happen - final found = requests.find { it.context.service == serviceName } - if (finallyFail) { - assert found == null: requests - } else { - assert found != null: requests - } - - cleanup: - writer.close() - - where: - serviceName | finallyFail - 'fail-once' | false - 'fail-forever' | true - } - - void 'test writer stops receiving exposures if evp proxy is not available'() { - given: - final sco = Stub(SharedCommunicationObjects) { - featuresDiscovery(_ as Config) >> { - return Mock(DDAgentFeaturesDiscovery) { - supportsEvpProxy() >> false - } - } - } - def writer = new ExposureWriterImpl(sco, Config.get()) - - when: - writer.init() - - then: - poll.eventually { - assert !writer.serializerThread.isAlive() - } - - when: - FeatureFlaggingGateway.dispatch(buildExposure()) - - then: - writer.queue.size() == 0 - - cleanup: - writer.close() - } - - private Config mockConfig(String serviceName, String env = 'test', String version = '0.0.0') { - return Mock(Config) { - getIdGenerationStrategy() >> IdGenerationStrategy.fromName("RANDOM") - getServiceName() >> serviceName - getEnv() >> env - getVersion() >> version - } - } - - private static void assertExposures(final List receivedExposures, final List expectedExposures) { - assert receivedExposures.size() == expectedExposures.size() - final received = new TreeSet(ExposureWriterTests::compare) - received.addAll(expectedExposures) - assert received.containsAll(expectedExposures) - } - - private static int compare(final ExposureEvent a, final ExposureEvent b) { - if (a.is(b)) { - return 0 - } - if (a == null) { - return -1 - } - if (b == null) { - return 1 - } - - def result = a.timestamp <=> b.timestamp - if (result) { - return result - } - - result = (a.flag?.key ?: '') <=> (b.flag?.key ?: '') - if (result) { - return result - } - - result = (a.variant?.key ?: '') <=> (b.variant?.key ?: '') - if (result) { - return result - } - - result = (a.allocation?.key ?: '') <=> (b.allocation?.key ?: '') - if (result) { - return result - } - - result = (a.subject?.id ?: '') <=> (b.subject?.id ?: '') - if (result) { - return result - } - - final aEntry = a.subject?.attributes?.entrySet()?.iterator()?.next() - final bEntry = b.subject?.attributes?.entrySet()?.iterator()?.next() - result = (aEntry?.key ?: '') <=> (bEntry?.key ?: '') - if (result) { - return result - } - return (aEntry?.value?.toString() ?: '') <=> (bEntry?.value?.toString() ?: '') - } - - private static ExposureEvent buildExposure() { - final idx = UUID.randomUUID().toString() - return new ExposureEvent( - System.currentTimeMillis(), - new Allocation("Allocation_$idx"), - new Flag("Flag_$idx"), - new Variant("Variant_$idx"), - new Subject("Subject_$idx", [("key_$idx".toString()): "value_$idx".toString()]) - ) - } -} diff --git a/products/feature-flagging/feature-flagging-lib/src/test/groovy/com/datadog/featureflag/LRUExposureCacheTest.groovy b/products/feature-flagging/feature-flagging-lib/src/test/groovy/com/datadog/featureflag/LRUExposureCacheTest.groovy deleted file mode 100644 index fa8bd14c3bd..00000000000 --- a/products/feature-flagging/feature-flagging-lib/src/test/groovy/com/datadog/featureflag/LRUExposureCacheTest.groovy +++ /dev/null @@ -1,256 +0,0 @@ -package com.datadog.featureflag - -import datadog.trace.api.featureflag.exposure.Allocation -import datadog.trace.api.featureflag.exposure.ExposureEvent -import datadog.trace.api.featureflag.exposure.Flag -import datadog.trace.api.featureflag.exposure.Subject -import datadog.trace.api.featureflag.exposure.Variant -import spock.lang.Specification - -class LRUExposureCacheTest extends Specification { - - void 'test adding elements'() { - given: - final cache = new LRUExposureCache(5) - final event = createEvent('flag', 'subject', 'variant', 'allocation') - - when: - final added = cache.add(event) - - then: - added - cache.size() == 1 - } - - void 'test adding duplicate events returns false'() { - given: - final cache = new LRUExposureCache(5) - final event = createEvent('flag', 'subject', 'variant', 'allocation') - - when: - cache.add(event) - final duplicateAdded = cache.add(event) - - then: - !duplicateAdded - cache.size() == 1 - } - - void 'test adding events with same key but different details updates cache'() { - given: - final cache = new LRUExposureCache(5) - final event1 = createEvent('flag', 'subject', 'variant1', 'allocation1') - final event2 = createEvent('flag', 'subject', 'variant2', 'allocation2') - final key = new ExposureCache.Key(event1) - - when: - final added1 = cache.add(event1) - final added2 = cache.add(event2) - final retrieved = cache.get(key) - - then: - added1 - added2 - cache.size() == 1 - retrieved.variant == 'variant2' - retrieved.allocation == 'allocation2' - } - - void 'test LRU eviction when capacity exceeded'() { - given: - final cache = new LRUExposureCache(2) - final event1 = createEvent('flag1', 'subject1', 'variant1', 'allocation1') - final event2 = createEvent('flag2', 'subject2', 'variant2', 'allocation2') - final event3 = createEvent('flag3', 'subject3', 'variant3', 'allocation3') - final key1 = new ExposureCache.Key(event1) - final key3 = new ExposureCache.Key(event3) - - when: - cache.add(event1) - cache.add(event2) - cache.add(event3) - - then: - cache.size() == 2 - cache.get(key1) == null // event1 should be evicted - cache.get(key3) != null // event3 should be present - cache.get(key3).variant == 'variant3' - cache.get(key3).allocation == 'allocation3' - } - - void 'test single capacity cache'() { - given: - final cache = new LRUExposureCache(1) - final event1 = createEvent('flag1', 'subject1', 'variant1', 'allocation1') - final event2 = createEvent('flag2', 'subject2', 'variant2', 'allocation2') - - when: - cache.add(event1) - cache.add(event2) - - then: - cache.size() == 1 - } - - void 'test zero capacity cache'() { - given: - final cache = new LRUExposureCache(0) - final event = createEvent('flag', 'subject', 'variant', 'allocation') - - when: - final added = cache.add(event) - - then: - added - cache.size() == 0 - } - - void 'test empty cache size'() { - given: - final cache = new LRUExposureCache(5) - - expect: - cache.size() == 0 - } - - void 'test multiple additions with same flag different subjects'() { - given: - final cache = new LRUExposureCache(10) - final events = [] - for (int i = 0; i < 5; i++) { - events << createEvent('flag', "subject${i}", 'variant', 'allocation') - } - - when: - def results = events.collect { cache.add(it) } - - then: - results.every { it == true } - cache.size() == 5 - } - - void 'test multiple additions with same subject different flags'() { - given: - final cache = new LRUExposureCache(10) - final events = [] - for (int i = 0; i < 5; i++) { - events << createEvent("flag${i}", 'subject', 'variant', 'allocation') - } - - when: - def results = events.collect { cache.add(it) } - - then: - results.every { it == true } - cache.size() == 5 - } - - void 'test key equality with null values'() { - given: - final cache = new LRUExposureCache(5) - final event1 = new ExposureEvent( - System.currentTimeMillis(), - new Allocation('allocation'), - new Flag(null), - new Variant('variant'), - new Subject(null, [:]) - ) - final event2 = new ExposureEvent( - System.currentTimeMillis(), - new Allocation('allocation'), - new Flag(null), - new Variant('variant'), - new Subject(null, [:]) - ) - - when: - cache.add(event1) - final duplicateAdded = cache.add(event2) - - then: - !duplicateAdded - cache.size() == 1 - } - - void 'test updating existing key maintains LRU position'() { - given: - final cache = new LRUExposureCache(3) - final event1 = createEvent('flag1', 'subject1', 'variant1', 'allocation1') - final event2 = createEvent('flag2', 'subject2', 'variant2', 'allocation2') - final event3 = createEvent('flag3', 'subject3', 'variant3', 'allocation3') - final event1Updated = createEvent('flag1', 'subject1', 'variant2', 'allocation2') - final event4 = createEvent('flag4', 'subject4', 'variant4', 'allocation4') - final key1 = new ExposureCache.Key(event1) - final key2 = new ExposureCache.Key(event2) - final key4 = new ExposureCache.Key(event4) - - when: - cache.add(event1) - cache.add(event2) - cache.add(event3) - cache.add(event1Updated) // Updates event1, moves to most recent - cache.add(event4) // Should evict event2, not event1 - - then: - cache.size() == 3 - cache.get(key1) != null // event1 should be updated and present - cache.get(key1).variant == 'variant2' // verify it was updated - cache.get(key1).allocation == 'allocation2' - cache.get(key2) == null // event2 should be evicted - cache.get(key4) != null // event4 should be present - cache.get(key4).variant == 'variant4' - } - - void 'test duplicate exposure keeps subject hot in LRU order'() { - given: - final cache = new LRUExposureCache(3) - final event1 = createEvent('flag1', 'subject1', 'variant1', 'allocation1') - final event2 = createEvent('flag2', 'subject2', 'variant2', 'allocation2') - final event3 = createEvent('flag3', 'subject3', 'variant3', 'allocation3') - // same key + same details as event1: will go through the "duplicate" path - final event1Duplicate = createEvent('flag1', 'subject1', 'variant1', 'allocation1') - final event4 = createEvent('flag4', 'subject4', 'variant4', 'allocation4') - - final key1 = new ExposureCache.Key(event1) - final key2 = new ExposureCache.Key(event2) - final key4 = new ExposureCache.Key(event4) - - when: - // Fill cache - def added1 = cache.add(event1) - def added2 = cache.add(event2) - def added3 = cache.add(event3) - - // Duplicate exposure for subject1: should *not* change size, but *should* bump recency - def duplicateAdded = cache.add(event1Duplicate) - - // Now push over capacity: the least recently used *non-hot* entry (event2) should be evicted - def added4 = cache.add(event4) - - then: - added1 - added2 - added3 - !duplicateAdded // dedup correctly - added4 - - cache.size() == 3 - - cache.get(key1) != null // hot subject1 should still be present - cache.get(key2) == null // subject2 should be evicted - cache.get(key4) != null // newest subject4 should be present - - cache.get(key1).variant == 'variant1' - cache.get(key1).allocation == 'allocation1' - } - - private static ExposureEvent createEvent(String flag, String subject, String variant, String allocation) { - return new ExposureEvent( - System.currentTimeMillis(), - new Allocation(allocation), - new Flag(flag), - new Variant(variant), - new Subject(subject, [:]) - ) - } -} diff --git a/products/feature-flagging/feature-flagging-lib/src/test/groovy/com/datadog/featureflag/RemoteConfigServiceTest.groovy b/products/feature-flagging/feature-flagging-lib/src/test/groovy/com/datadog/featureflag/RemoteConfigServiceTest.groovy deleted file mode 100644 index 7ae78dd61fc..00000000000 --- a/products/feature-flagging/feature-flagging-lib/src/test/groovy/com/datadog/featureflag/RemoteConfigServiceTest.groovy +++ /dev/null @@ -1,130 +0,0 @@ -package com.datadog.featureflag - -import com.squareup.moshi.JsonReader -import com.squareup.moshi.JsonWriter -import datadog.communication.ddagent.SharedCommunicationObjects -import datadog.remoteconfig.Capabilities -import datadog.remoteconfig.ConfigurationDeserializer -import datadog.remoteconfig.ConfigurationPoller -import datadog.remoteconfig.PollingRateHinter -import datadog.remoteconfig.Product -import datadog.trace.api.Config -import datadog.trace.api.featureflag.FeatureFlaggingGateway -import datadog.trace.api.featureflag.ufc.v1.ServerConfiguration -import datadog.trace.test.util.DDSpecification - -class RemoteConfigServiceTest extends DDSpecification { - - private FeatureFlaggingGateway.ConfigListener listener - - void setup() { - listener = Mock(FeatureFlaggingGateway.ConfigListener) - } - - void cleanup() { - FeatureFlaggingGateway.removeConfigListener(listener) - } - - void 'test new config received'() { - setup: - def poller = Mock(ConfigurationPoller) - final sco = Stub(SharedCommunicationObjects) { - configurationPoller(_ as Config) >> poller - } - FeatureFlaggingGateway.addConfigListener(listener) - final service = new RemoteConfigServiceImpl(sco, Config.get()) - final config = """ -{ - "createdAt":"2024-04-17T19:40:53.716Z", - "format":"SERVER", - "environment":{ - "name":"Test" - }, - "flags":{ - - } -} -""".bytes - ConfigurationDeserializer deserializer = null - - when: - service.init() - - then: - 1 * poller.addCapabilities(Capabilities.CAPABILITY_FFE_FLAG_CONFIGURATION_RULES) - 1 * poller.addListener(Product.FFE_FLAGS, _ as ConfigurationDeserializer, _) >> { - deserializer = it[1] as ConfigurationDeserializer - } - - when: - service.accept('test', deserializer.deserialize(config), Mock(PollingRateHinter)) - - then: - 1 * listener.accept(_ as ServerConfiguration) - - when: - service.close() - - then: - 1 * poller.removeCapabilities(Capabilities.CAPABILITY_FFE_FLAG_CONFIGURATION_RULES) - 1 * poller.removeListeners(Product.FFE_FLAGS) - - cleanup: - FeatureFlaggingGateway.removeConfigListener(listener) - } - - void 'test date parsing'() { - given: - final reader = Stub(JsonReader) { - nextString() >> string - } - final adapter = new RemoteConfigServiceImpl.DateAdapter() - - when: - final date = adapter.fromJson(reader) - - then: - date == expected - - where: - string | expected - // Valid ISO 8601 formats - no fractional seconds - "2023-01-01T00:00:00Z" | new Date(1672531200000L) // 2023-01-01 00:00:00 UTC - "2023-12-31T23:59:59Z" | new Date(1704067199000L) // 2023-12-31 23:59:59 UTC - "2024-02-29T12:00:00Z" | new Date(1709208000000L) // Leap year date - // 3-digit milliseconds - "2023-01-01T00:00:00.000Z" | new Date(1672531200000L) // With milliseconds - "2023-06-15T14:30:45.123Z" | new Date(1686839445123L) // With milliseconds - // 6-digit microseconds (truncated to milliseconds by Java Date) - "2023-06-15T14:30:45.123456Z" | new Date(1686839445123L) // Microseconds truncated - "2023-06-15T14:30:45.235982Z" | new Date(1686839445235L) // Different microseconds from backend - // 9-digit nanoseconds (truncated to milliseconds by Java Date) - "2023-06-15T14:30:45.123456789Z" | new Date(1686839445123L) // Nanoseconds truncated - // Variable precision fractional seconds - "2023-06-15T14:30:45.1Z" | new Date(1686839445100L) // 1-digit - "2023-06-15T14:30:45.12Z" | new Date(1686839445120L) // 2-digit - // UTC offsets (supported by OffsetDateTime.parse) - "2023-01-01T01:00:00+01:00" | new Date(1672531200000L) // UTC+1 = 2023-01-01 00:00:00 UTC - "2023-01-01T00:00:00-05:00" | new Date(1672549200000L) // UTC-5 = 2023-01-01 05:00:00 UTC - // Non supported formats should return null - "2023-01-01" | null // Date only - "invalid-date" | null - "" | null - "not-a-date" | null - "2023/01/01T00:00:00Z" | null // Wrong separator - - // Null input - null | null - } - - void 'test parsing only adapter'() { - given: - final adapter = new RemoteConfigServiceImpl.DateAdapter() - - when: - adapter.toJson(Stub(JsonWriter), new Date()) - - then: - thrown(UnsupportedOperationException) - } -} diff --git a/products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/ExposureWriterTests.java b/products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/ExposureWriterTests.java new file mode 100644 index 00000000000..75c4b3b653b --- /dev/null +++ b/products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/ExposureWriterTests.java @@ -0,0 +1,408 @@ +package com.datadog.featureflag; + +import static java.util.Collections.singletonMap; +import static java.util.concurrent.TimeUnit.MILLISECONDS; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import com.squareup.moshi.JsonAdapter; +import com.squareup.moshi.Moshi; +import datadog.communication.ddagent.DDAgentFeaturesDiscovery; +import datadog.communication.ddagent.SharedCommunicationObjects; +import datadog.trace.agent.test.server.http.JavaTestHttpServer; +import datadog.trace.agent.test.server.http.JavaTestHttpServer.HandlerApi; +import datadog.trace.api.Config; +import datadog.trace.api.IdGenerationStrategy; +import datadog.trace.api.featureflag.FeatureFlaggingGateway; +import datadog.trace.api.featureflag.exposure.Allocation; +import datadog.trace.api.featureflag.exposure.ExposureEvent; +import datadog.trace.api.featureflag.exposure.ExposuresRequest; +import datadog.trace.api.featureflag.exposure.Flag; +import datadog.trace.api.featureflag.exposure.Subject; +import datadog.trace.api.featureflag.exposure.Variant; +import datadog.trace.test.util.PollingConditions; +import java.io.ByteArrayInputStream; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Queue; +import java.util.Random; +import java.util.Set; +import java.util.TreeSet; +import java.util.UUID; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import okhttp3.HttpUrl; +import okhttp3.OkHttpClient; +import okio.Okio; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; +import org.tabletest.junit.TableTest; + +class ExposureWriterTests { + + private static final String EXPOSURES_ENDPOINT = "/evp_proxy/api/v2/exposures"; + private static final double TIMEOUT_SECONDS = 5; + + private final PollingConditions poll = new PollingConditions(TIMEOUT_SECONDS); + private Queue requests; + private Set failed; + private JavaTestHttpServer server; + private SharedCommunicationObjects sharedCommunicationObjects; + + @BeforeEach + void setUp() { + requests = new ConcurrentLinkedQueue<>(); + failed = Collections.newSetFromMap(new ConcurrentHashMap()); + JsonAdapter adapter = + new Moshi.Builder().build().adapter(ExposuresRequest.class); + server = + JavaTestHttpServer.httpServer( + s -> + s.handlers( + h -> h.prefix(EXPOSURES_ENDPOINT, api -> handleExposureRequest(api, adapter)))); + sharedCommunicationObjects = sharedCommunicationObjects(true); + } + + @AfterEach + void cleanup() { + if (server != null) { + server.close(); + } + } + + private void handleExposureRequest(HandlerApi api, JsonAdapter adapter) + throws Exception { + ExposuresRequest exposuresRequest = + adapter.fromJson( + Okio.buffer(Okio.source(new ByteArrayInputStream(api.getRequest().getBody())))); + String serviceName = exposuresRequest.context.get("service"); + boolean failForever = "fail-forever".equals(serviceName); + boolean fail = serviceName.startsWith("fail") && (failed.add(serviceName) || failForever); + if (fail) { + api.getResponse().status(500).send("Boom!!!"); + } else { + requests.add(exposuresRequest); + api.getResponse().status(200).send("OK"); + } + } + + @TableTest({ + "service | env | version", + " | | ", + "'test-service' | 'test' | '23' ", + "'test-service' | | '23' ", + "'test-service' | 'test' | " + }) + void testExposureEventWrites(String service, String env, String version) throws Exception { + Config config = mockConfig(service, env, version); + List exposures = buildExposures(5); + + try (ExposureWriterImpl writer = + new ExposureWriterImpl(1 << 4, 100, MILLISECONDS, sharedCommunicationObjects, config)) { + writer.init(); + for (ExposureEvent exposure : exposures) { + writer.accept(exposure); + } + + poll.eventually( + () -> { + assertFalse(requests.isEmpty()); + for (ExposuresRequest request : requests) { + assertContext(request.context, service, env, version); + } + assertExposures(allExposures(), exposures); + }); + } + } + + @Test + void testLruCache() throws Exception { + Config config = mockConfig("test-service"); + List exposures = buildExposures(6); + + try (ExposureWriterImpl writer = + new ExposureWriterImpl(1 << 4, 100, MILLISECONDS, sharedCommunicationObjects, config)) { + writer.init(); + // populating the cache + for (ExposureEvent exposure : exposures) { + writer.accept(exposure); + } + + // all events are written + poll.eventually(() -> assertEquals(exposures.size(), allExposures().size())); + + // publishing duplicate events + for (ExposureEvent exposure : exposures) { + writer.accept(exposure); + } + + // no events are written + MILLISECONDS.sleep(300); // wait until a flush happens + assertEquals(exposures.size(), allExposures().size()); + + // a new event is generated + writer.accept(buildExposure()); + + // oldest event is evicted and the new one is submitted + poll.eventually(() -> assertEquals(exposures.size() + 1, allExposures().size())); + } + } + + @Test + void testHighLoadScenario() throws Exception { + Config config = mockConfig("test-service"); + int exposuresPerThread = 100; + Random random = new Random(); + int threads = Runtime.getRuntime().availableProcessors(); + ExecutorService executor = Executors.newFixedThreadPool(threads); + List exposures = buildExposures(threads * exposuresPerThread); + CountDownLatch latch = new CountDownLatch(1); + + try (ExposureWriterImpl writer = new ExposureWriterImpl(sharedCommunicationObjects, config)) { + writer.init(); + List> futures = new ArrayList<>(); + for (int index = 0; index < exposures.size(); index += exposuresPerThread) { + List partition = + exposures.subList(index, Math.min(index + exposuresPerThread, exposures.size())); + futures.add( + executor.submit( + () -> { + latch.await(); + for (ExposureEvent exposure : partition) { + MILLISECONDS.sleep(random.nextInt(2)); + writer.accept(exposure); + } + return true; + })); + } + latch.countDown(); // start threads + + for (Future future : futures) { + assertTrue(future.get()); // wait for all threads to finish + } + poll.eventually(() -> assertExposures(allExposures(), exposures)); + } finally { + executor.shutdownNow(); + } + } + + @ParameterizedTest + @ValueSource(booleans = {false, true}) + void testFailuresAreRetried(boolean finallyFail) throws Exception { + String serviceName = finallyFail ? "fail-forever" : "fail-once"; + Config config = mockConfig(serviceName); + + try (ExposureWriterImpl writer = + new ExposureWriterImpl(1 << 4, 100, MILLISECONDS, sharedCommunicationObjects, config)) { + writer.init(); + writer.accept(buildExposure()); + + MILLISECONDS.sleep(500); // wait for a flush to happen + ExposuresRequest found = findRequest(serviceName); + if (finallyFail) { + assertNull(found, requests.toString()); + } else { + poll.eventually(() -> assertNotNull(findRequest(serviceName), requests.toString())); + } + } + } + + @Test + void testWriterStopsReceivingExposuresIfEvpProxyIsNotAvailable() throws Exception { + SharedCommunicationObjects sharedCommunicationObjects = sharedCommunicationObjects(false); + + try (ExposureWriterImpl writer = + new ExposureWriterImpl(sharedCommunicationObjects, Config.get())) { + writer.init(); + poll.eventually(() -> assertFalse(writer.isSerializerThreadAlive())); + + FeatureFlaggingGateway.dispatch(buildExposure()); + + assertEquals(0, writer.queueSize()); + } + } + + private static Config mockConfig(String serviceName) { + return mockConfig(serviceName, "test", "0.0.0"); + } + + private static Config mockConfig(String serviceName, String env, String version) { + Config config = mock(Config.class); + when(config.getIdGenerationStrategy()).thenReturn(IdGenerationStrategy.fromName("RANDOM")); + when(config.getServiceName()).thenReturn(serviceName); + when(config.getEnv()).thenReturn(env); + when(config.getVersion()).thenReturn(version); + return config; + } + + private SharedCommunicationObjects sharedCommunicationObjects(boolean evpProxyAvailable) { + DDAgentFeaturesDiscovery discovery = mock(DDAgentFeaturesDiscovery.class); + when(discovery.supportsEvpProxy()).thenReturn(evpProxyAvailable); + if (evpProxyAvailable) { + when(discovery.getEvpProxyEndpoint()).thenReturn("/evp_proxy/"); + } + + SharedCommunicationObjects sharedCommunicationObjects = new SharedCommunicationObjects(); + sharedCommunicationObjects.setFeaturesDiscovery(discovery); + sharedCommunicationObjects.agentUrl = HttpUrl.get(server.getAddress()); + sharedCommunicationObjects.agentHttpClient = new OkHttpClient.Builder().build(); + return sharedCommunicationObjects; + } + + private static void assertContext( + Map context, String service, String env, String version) { + assertEquals(service == null ? "unknown" : service, context.get("service")); + assertOptionalContextValue(context, "env", env); + assertOptionalContextValue(context, "version", version); + } + + private static void assertOptionalContextValue( + Map context, String key, String value) { + if (value == null) { + assertFalse(context.containsKey(key)); + } else { + assertEquals(value, context.get(key)); + } + } + + private ExposuresRequest findRequest(String serviceName) { + for (ExposuresRequest request : requests) { + if (serviceName.equals(request.context.get("service"))) { + return request; + } + } + return null; + } + + private List allExposures() { + List exposures = new ArrayList<>(); + for (ExposuresRequest request : requests) { + exposures.addAll(request.exposures); + } + return exposures; + } + + private static void assertExposures( + List receivedExposures, List expectedExposures) { + assertEquals(expectedExposures.size(), receivedExposures.size()); + TreeSet received = new TreeSet<>(ExposureWriterTests::compare); + received.addAll(receivedExposures); + assertTrue(received.containsAll(expectedExposures)); + } + + private static int compare(ExposureEvent first, ExposureEvent second) { + if (first == second) { + return 0; + } + if (first == null) { + return -1; + } + if (second == null) { + return 1; + } + + int result = Long.compare(first.timestamp, second.timestamp); + if (result != 0) { + return result; + } + + result = compareNullableString(first.flag == null ? null : first.flag.key, second.flag); + if (result != 0) { + return result; + } + + result = + compareNullableString(first.variant == null ? null : first.variant.key, second.variant); + if (result != 0) { + return result; + } + + result = + compareNullableString( + first.allocation == null ? null : first.allocation.key, second.allocation); + if (result != 0) { + return result; + } + + result = compareNullableString(first.subject == null ? null : first.subject.id, second.subject); + if (result != 0) { + return result; + } + + Map.Entry firstEntry = firstEntry(first.subject); + Map.Entry secondEntry = firstEntry(second.subject); + result = + compareNullableString( + firstEntry == null ? null : firstEntry.getKey(), + secondEntry == null ? null : secondEntry.getKey()); + if (result != 0) { + return result; + } + return compareNullableString( + firstEntry == null ? null : String.valueOf(firstEntry.getValue()), + secondEntry == null ? null : String.valueOf(secondEntry.getValue())); + } + + private static int compareNullableString(String first, Flag second) { + return compareNullableString(first, second == null ? null : second.key); + } + + private static int compareNullableString(String first, Variant second) { + return compareNullableString(first, second == null ? null : second.key); + } + + private static int compareNullableString(String first, Allocation second) { + return compareNullableString(first, second == null ? null : second.key); + } + + private static int compareNullableString(String first, Subject second) { + return compareNullableString(first, second == null ? null : second.id); + } + + private static int compareNullableString(String first, String second) { + String firstValue = first == null ? "" : first; + String secondValue = second == null ? "" : second; + return firstValue.compareTo(secondValue); + } + + private static Map.Entry firstEntry(Subject subject) { + if (subject == null || subject.attributes == null) { + return null; + } + Iterator> iterator = subject.attributes.entrySet().iterator(); + return iterator.hasNext() ? iterator.next() : null; + } + + private static List buildExposures(int count) { + List exposures = new ArrayList<>(); + for (int index = 0; index < count; index++) { + exposures.add(buildExposure()); + } + return exposures; + } + + private static ExposureEvent buildExposure() { + String id = UUID.randomUUID().toString(); + return new ExposureEvent( + System.currentTimeMillis(), + new Allocation("Allocation_" + id), + new Flag("Flag_" + id), + new Variant("Variant_" + id), + new Subject("Subject_" + id, singletonMap("key_" + id, (Object) ("value_" + id)))); + } +} diff --git a/products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/LRUExposureCacheTest.java b/products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/LRUExposureCacheTest.java new file mode 100644 index 00000000000..43c4c2d40f0 --- /dev/null +++ b/products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/LRUExposureCacheTest.java @@ -0,0 +1,244 @@ +package com.datadog.featureflag; + +import static java.util.Collections.emptyMap; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.api.featureflag.exposure.Allocation; +import datadog.trace.api.featureflag.exposure.ExposureEvent; +import datadog.trace.api.featureflag.exposure.Flag; +import datadog.trace.api.featureflag.exposure.Subject; +import datadog.trace.api.featureflag.exposure.Variant; +import java.util.ArrayList; +import java.util.List; +import org.junit.jupiter.api.Test; + +class LRUExposureCacheTest { + + @Test + void testAddingElements() { + LRUExposureCache cache = new LRUExposureCache(5); + ExposureEvent event = createEvent("flag", "subject", "variant", "allocation"); + + boolean added = cache.add(event); + + assertTrue(added); + assertEquals(1, cache.size()); + } + + @Test + void testAddingDuplicateEventsReturnsFalse() { + LRUExposureCache cache = new LRUExposureCache(5); + ExposureEvent event = createEvent("flag", "subject", "variant", "allocation"); + + cache.add(event); + boolean duplicateAdded = cache.add(event); + + assertFalse(duplicateAdded); + assertEquals(1, cache.size()); + } + + @Test + void testAddingEventsWithSameKeyButDifferentDetailsUpdatesCache() { + LRUExposureCache cache = new LRUExposureCache(5); + ExposureEvent event1 = createEvent("flag", "subject", "variant1", "allocation1"); + ExposureEvent event2 = createEvent("flag", "subject", "variant2", "allocation2"); + ExposureCache.Key key = new ExposureCache.Key(event1); + + boolean added1 = cache.add(event1); + boolean added2 = cache.add(event2); + ExposureCache.Value retrieved = cache.get(key); + + assertTrue(added1); + assertTrue(added2); + assertEquals(1, cache.size()); + assertEquals("variant2", retrieved.variant); + assertEquals("allocation2", retrieved.allocation); + } + + @Test + void testLruEvictionWhenCapacityExceeded() { + LRUExposureCache cache = new LRUExposureCache(2); + ExposureEvent event1 = createEvent("flag1", "subject1", "variant1", "allocation1"); + ExposureEvent event2 = createEvent("flag2", "subject2", "variant2", "allocation2"); + ExposureEvent event3 = createEvent("flag3", "subject3", "variant3", "allocation3"); + ExposureCache.Key key1 = new ExposureCache.Key(event1); + ExposureCache.Key key3 = new ExposureCache.Key(event3); + + cache.add(event1); + cache.add(event2); + cache.add(event3); + + assertEquals(2, cache.size()); + assertNull(cache.get(key1)); // event1 should be evicted + assertNotNull(cache.get(key3)); // event3 should be present + assertEquals("variant3", cache.get(key3).variant); + assertEquals("allocation3", cache.get(key3).allocation); + } + + @Test + void testSingleCapacityCache() { + LRUExposureCache cache = new LRUExposureCache(1); + ExposureEvent event1 = createEvent("flag1", "subject1", "variant1", "allocation1"); + ExposureEvent event2 = createEvent("flag2", "subject2", "variant2", "allocation2"); + + cache.add(event1); + cache.add(event2); + + assertEquals(1, cache.size()); + } + + @Test + void testZeroCapacityCache() { + LRUExposureCache cache = new LRUExposureCache(0); + ExposureEvent event = createEvent("flag", "subject", "variant", "allocation"); + + boolean added = cache.add(event); + + assertTrue(added); + assertEquals(0, cache.size()); + } + + @Test + void testEmptyCacheSize() { + LRUExposureCache cache = new LRUExposureCache(5); + + assertEquals(0, cache.size()); + } + + @Test + void testMultipleAdditionsWithSameFlagDifferentSubjects() { + LRUExposureCache cache = new LRUExposureCache(10); + List events = new ArrayList<>(); + for (int index = 0; index < 5; index++) { + events.add(createEvent("flag", "subject" + index, "variant", "allocation")); + } + + for (ExposureEvent event : events) { + assertTrue(cache.add(event)); + } + + assertEquals(5, cache.size()); + } + + @Test + void testMultipleAdditionsWithSameSubjectDifferentFlags() { + LRUExposureCache cache = new LRUExposureCache(10); + List events = new ArrayList<>(); + for (int index = 0; index < 5; index++) { + events.add(createEvent("flag" + index, "subject", "variant", "allocation")); + } + + for (ExposureEvent event : events) { + assertTrue(cache.add(event)); + } + + assertEquals(5, cache.size()); + } + + @Test + void testKeyEqualityWithNullValues() { + LRUExposureCache cache = new LRUExposureCache(5); + ExposureEvent event1 = + new ExposureEvent( + System.currentTimeMillis(), + new Allocation("allocation"), + new Flag(null), + new Variant("variant"), + new Subject(null, emptyMap())); + ExposureEvent event2 = + new ExposureEvent( + System.currentTimeMillis(), + new Allocation("allocation"), + new Flag(null), + new Variant("variant"), + new Subject(null, emptyMap())); + + cache.add(event1); + boolean duplicateAdded = cache.add(event2); + + assertFalse(duplicateAdded); + assertEquals(1, cache.size()); + } + + @Test + void testUpdatingExistingKeyMaintainsLruPosition() { + LRUExposureCache cache = new LRUExposureCache(3); + ExposureEvent event1 = createEvent("flag1", "subject1", "variant1", "allocation1"); + ExposureEvent event2 = createEvent("flag2", "subject2", "variant2", "allocation2"); + ExposureEvent event3 = createEvent("flag3", "subject3", "variant3", "allocation3"); + ExposureEvent event1Updated = createEvent("flag1", "subject1", "variant2", "allocation2"); + ExposureEvent event4 = createEvent("flag4", "subject4", "variant4", "allocation4"); + ExposureCache.Key key1 = new ExposureCache.Key(event1); + ExposureCache.Key key2 = new ExposureCache.Key(event2); + ExposureCache.Key key4 = new ExposureCache.Key(event4); + + cache.add(event1); + cache.add(event2); + cache.add(event3); + cache.add(event1Updated); // Updates event1, moves to most recent + cache.add(event4); // Should evict event2, not event1 + + assertEquals(3, cache.size()); + assertNotNull(cache.get(key1)); // event1 should be updated and present + assertEquals("variant2", cache.get(key1).variant); // verify it was updated + assertEquals("allocation2", cache.get(key1).allocation); + assertNull(cache.get(key2)); // event2 should be evicted + assertNotNull(cache.get(key4)); // event4 should be present + assertEquals("variant4", cache.get(key4).variant); + } + + @Test + void testDuplicateExposureKeepsSubjectHotInLruOrder() { + LRUExposureCache cache = new LRUExposureCache(3); + ExposureEvent event1 = createEvent("flag1", "subject1", "variant1", "allocation1"); + ExposureEvent event2 = createEvent("flag2", "subject2", "variant2", "allocation2"); + ExposureEvent event3 = createEvent("flag3", "subject3", "variant3", "allocation3"); + // same key + same details as event1: will go through the "duplicate" path + ExposureEvent event1Duplicate = createEvent("flag1", "subject1", "variant1", "allocation1"); + ExposureEvent event4 = createEvent("flag4", "subject4", "variant4", "allocation4"); + + ExposureCache.Key key1 = new ExposureCache.Key(event1); + ExposureCache.Key key2 = new ExposureCache.Key(event2); + ExposureCache.Key key4 = new ExposureCache.Key(event4); + + // Fill cache + boolean added1 = cache.add(event1); + boolean added2 = cache.add(event2); + boolean added3 = cache.add(event3); + + // Duplicate exposure for subject1: should *not* change size, but *should* bump recency + boolean duplicateAdded = cache.add(event1Duplicate); + + // Now push over capacity: the least recently used *non-hot* entry (event2) should be evicted + boolean added4 = cache.add(event4); + + assertTrue(added1); + assertTrue(added2); + assertTrue(added3); + assertFalse(duplicateAdded); // dedup correctly + assertTrue(added4); + + assertEquals(3, cache.size()); + + assertNotNull(cache.get(key1)); // hot subject1 should still be present + assertNull(cache.get(key2)); // subject2 should be evicted + assertNotNull(cache.get(key4)); // newest subject4 should be present + + assertEquals("variant1", cache.get(key1).variant); + assertEquals("allocation1", cache.get(key1).allocation); + } + + private static ExposureEvent createEvent( + String flag, String subject, String variant, String allocation) { + return new ExposureEvent( + System.currentTimeMillis(), + new Allocation(allocation), + new Flag(flag), + new Variant(variant), + new Subject(subject, emptyMap())); + } +} diff --git a/products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/RemoteConfigServiceImplTest.java b/products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/RemoteConfigServiceImplTest.java new file mode 100644 index 00000000000..d4ff05c75b1 --- /dev/null +++ b/products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/RemoteConfigServiceImplTest.java @@ -0,0 +1,325 @@ +package com.datadog.featureflag; + +import static java.nio.charset.StandardCharsets.UTF_8; +import static java.util.Collections.emptyMap; +import static java.util.Collections.emptySet; +import static java.util.Collections.singleton; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import com.squareup.moshi.JsonAdapter; +import com.squareup.moshi.JsonReader; +import com.squareup.moshi.JsonWriter; +import com.squareup.moshi.Moshi; +import com.squareup.moshi.Types; +import datadog.communication.ddagent.SharedCommunicationObjects; +import datadog.remoteconfig.Capabilities; +import datadog.remoteconfig.ConfigurationDeserializer; +import datadog.remoteconfig.ConfigurationPoller; +import datadog.remoteconfig.PollingRateHinter; +import datadog.remoteconfig.Product; +import datadog.trace.api.Config; +import datadog.trace.api.featureflag.FeatureFlaggingGateway; +import datadog.trace.api.featureflag.ufc.v1.Flag; +import datadog.trace.api.featureflag.ufc.v1.ServerConfiguration; +import java.lang.annotation.Annotation; +import java.lang.reflect.Type; +import java.time.Instant; +import java.util.Date; +import java.util.Map; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.ArgumentCaptor; +import org.mockito.Captor; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; +import org.tabletest.junit.TableTest; + +@ExtendWith(MockitoExtension.class) +class RemoteConfigServiceImplTest { + + @Mock private FeatureFlaggingGateway.ConfigListener listener; + @Captor private ArgumentCaptor deserializerCaptor; + + @AfterEach + void cleanup() { + FeatureFlaggingGateway.removeConfigListener(listener); + } + + @Test + void testNewConfigReceived() throws Exception { + final ConfigurationPoller poller = mock(ConfigurationPoller.class); + final SharedCommunicationObjects sco = mock(SharedCommunicationObjects.class); + when(sco.configurationPoller(any(Config.class))).thenReturn(poller); + FeatureFlaggingGateway.addConfigListener(listener); + final RemoteConfigServiceImpl service = new RemoteConfigServiceImpl(sco, Config.get()); + + service.init(); + + verify(poller).addCapabilities(Capabilities.CAPABILITY_FFE_FLAG_CONFIGURATION_RULES); + verify(poller).addListener(eq(Product.FFE_FLAGS), deserializerCaptor.capture(), eq(service)); + + final ServerConfiguration config = deserializer().deserialize(emptyConfig().getBytes(UTF_8)); + service.accept("test", config, mock(PollingRateHinter.class)); + + verify(listener).accept(any(ServerConfiguration.class)); + + service.close(); + + verify(poller).removeCapabilities(Capabilities.CAPABILITY_FFE_FLAG_CONFIGURATION_RULES); + verify(poller).removeListeners(Product.FFE_FLAGS); + } + + @Test + void skipsMalformedFlagAllocationsAndKeepsValidFlag() throws Exception { + final ServerConfiguration config = + deserialize( + "{" + + "\"createdAt\":\"2024-04-17T19:40:53.716Z\"," + + "\"format\":\"SERVER\"," + + "\"environment\":{\"name\":\"Test\"}," + + "\"flags\":{" + + "\"malformed-flag\":{" + + "\"key\":\"malformed-flag\"," + + "\"enabled\":true," + + "\"variationType\":\"STRING\"," + + "\"variations\":{\"on\":{\"key\":\"on\",\"value\":\"on\"}}," + + "\"allocations\":\"this-is-not-a-list\"" + + "}," + + "\"valid-flag\":{" + + "\"key\":\"valid-flag\"," + + "\"enabled\":true," + + "\"variationType\":\"STRING\"," + + "\"variations\":{\"expected\":{\"key\":\"expected\",\"value\":\"expected\"}}," + + "\"allocations\":[{" + + "\"key\":\"default-allocation\"," + + "\"rules\":[]," + + "\"splits\":[{\"variationKey\":\"expected\",\"shards\":[]}]," + + "\"doLog\":true" + + "}]" + + "}" + + "}" + + "}"); + + assertNotNull(config); + assertFalse(config.flags.containsKey("malformed-flag")); + assertTrue(config.flags.containsKey("valid-flag")); + assertEquals("expected", config.flags.get("valid-flag").variations.get("expected").value); + } + + @Test + void ignoresUnknownTopLevelFields() throws Exception { + final ServerConfiguration config = + deserialize( + "{" + + "\"createdAt\":\"2024-04-17T19:40:53.716Z\"," + + "\"format\":\"SERVER\"," + + "\"environment\":{\"name\":\"Test\"}," + + "\"segments\":{\"new-schema-key\":{\"ignored\":true}}," + + "\"flags\":{}" + + "}"); + + assertNotNull(config); + assertEquals("2024-04-17T19:40:53.716Z", config.createdAt); + assertEquals("SERVER", config.format); + assertNotNull(config.environment); + assertEquals("Test", config.environment.name); + assertTrue(config.flags.isEmpty()); + } + + @Test + void skipsUnknownOperatorFlagAndKeepsValidFlag() throws Exception { + final ServerConfiguration config = + deserialize( + "{" + + "\"createdAt\":\"2024-04-17T19:40:53.716Z\"," + + "\"format\":\"SERVER\"," + + "\"environment\":{\"name\":\"Test\"}," + + "\"flags\":{" + + "\"operator-grease-flag\":{" + + "\"key\":\"operator-grease-flag\"," + + "\"enabled\":true," + + "\"variationType\":\"STRING\"," + + "\"variations\":{\"trap\":{\"key\":\"trap\",\"value\":\"trap\"}}," + + "\"allocations\":[{" + + "\"key\":\"grease-allocation\"," + + "\"rules\":[{\"conditions\":[{" + + "\"attribute\":\"country\"," + + "\"operator\":\"not-a-real-operator\"," + + "\"value\":\"anything\"" + + "}]}]," + + "\"splits\":[{\"variationKey\":\"trap\",\"shards\":[]}]," + + "\"doLog\":true" + + "}]" + + "}," + + "\"valid-flag\":{" + + "\"key\":\"valid-flag\"," + + "\"enabled\":true," + + "\"variationType\":\"STRING\"," + + "\"variations\":{\"expected\":{\"key\":\"expected\",\"value\":\"expected\"}}," + + "\"allocations\":[{" + + "\"key\":\"default-allocation\"," + + "\"rules\":[]," + + "\"splits\":[{\"variationKey\":\"expected\",\"shards\":[]}]," + + "\"doLog\":true" + + "}]" + + "}" + + "}" + + "}"); + + assertNotNull(config); + assertFalse(config.flags.containsKey("operator-grease-flag")); + assertTrue(config.flags.containsKey("valid-flag")); + assertEquals("expected", config.flags.get("valid-flag").variations.get("expected").value); + } + + @Test + void flagMapAdapterFactoryOnlyCreatesFlagMapAdapterForFlagMapType() { + final Moshi moshi = moshi(); + final Type flagsType = Types.newParameterizedType(Map.class, String.class, Flag.class); + + final JsonAdapter adapter = + RemoteConfigServiceImpl.FlagMapAdapter.FACTORY.create(flagsType, emptySet(), moshi); + + assertNotNull(adapter); + assertTrue(adapter instanceof RemoteConfigServiceImpl.FlagMapAdapter); + assertNull( + RemoteConfigServiceImpl.FlagMapAdapter.FACTORY.create(String.class, emptySet(), moshi)); + assertNull( + RemoteConfigServiceImpl.FlagMapAdapter.FACTORY.create( + flagsType, singleton(mock(Annotation.class)), moshi)); + } + + @Test + void allowsNullFlagMap() throws Exception { + final ServerConfiguration config = + deserialize( + "{" + + "\"createdAt\":\"2024-04-17T19:40:53.716Z\"," + + "\"format\":\"SERVER\"," + + "\"environment\":{\"name\":\"Test\"}," + + "\"flags\":null" + + "}"); + + assertNotNull(config); + assertNull(config.flags); + } + + @Test + void skipsNullFlagAndKeepsValidFlag() throws Exception { + final ServerConfiguration config = + deserialize( + "{" + + "\"createdAt\":\"2024-04-17T19:40:53.716Z\"," + + "\"format\":\"SERVER\"," + + "\"environment\":{\"name\":\"Test\"}," + + "\"flags\":{" + + "\"null-flag\":null," + + "\"valid-flag\":{" + + "\"key\":\"valid-flag\"," + + "\"enabled\":true," + + "\"variationType\":\"STRING\"," + + "\"variations\":{\"expected\":{\"key\":\"expected\",\"value\":\"expected\"}}," + + "\"allocations\":[{" + + "\"key\":\"default-allocation\"," + + "\"rules\":[]," + + "\"splits\":[{\"variationKey\":\"expected\",\"shards\":[]}]," + + "\"doLog\":true" + + "}]" + + "}" + + "}" + + "}"); + + assertNotNull(config); + assertFalse(config.flags.containsKey("null-flag")); + assertTrue(config.flags.containsKey("valid-flag")); + assertEquals("expected", config.flags.get("valid-flag").variations.get("expected").value); + } + + @Test + void flagMapAdapterIsReadOnly() { + final RemoteConfigServiceImpl.FlagMapAdapter adapter = + new RemoteConfigServiceImpl.FlagMapAdapter(moshi().adapter(Flag.class)); + + assertThrows( + UnsupportedOperationException.class, + () -> adapter.toJson(mock(JsonWriter.class), emptyMap())); + } + + @TableTest({ + "scenario | value | expectedEpochMilli", + "utc second | '2023-01-01T00:00:00Z' | 1672531200000 ", + "utc end of year | '2023-12-31T23:59:59Z' | 1704067199000 ", + "leap day | '2024-02-29T12:00:00Z' | 1709208000000 ", + "millisecond precision | '2023-01-01T00:00:00.000Z' | 1672531200000 ", + "three fractional digits | '2023-06-15T14:30:45.123Z' | 1686839445123 ", + "six fractional digits truncate to millis | '2023-06-15T14:30:45.123456Z' | 1686839445123 ", + "six fractional digits preserve millis | '2023-06-15T14:30:45.235982Z' | 1686839445235 ", + "nine fractional digits truncate to millis | '2023-06-15T14:30:45.123456789Z' | 1686839445123 ", + "one fractional digit | '2023-06-15T14:30:45.1Z' | 1686839445100 ", + "two fractional digits | '2023-06-15T14:30:45.12Z' | 1686839445120 ", + "positive offset | '2023-01-01T01:00:00+01:00' | 1672531200000 ", + "negative offset | '2023-01-01T00:00:00-05:00' | 1672549200000 ", + "date only | '2023-01-01' | ", + "invalid | 'invalid-date' | ", + "empty string | '' | ", + "not a date | 'not-a-date' | ", + "slash date | '2023/01/01T00:00:00Z' | ", + "null | | " + }) + void testDateParsing(final String value, final Long expectedEpochMilli) throws Exception { + final JsonReader reader = mock(JsonReader.class); + when(reader.nextString()).thenReturn(value); + final RemoteConfigServiceImpl.DateAdapter adapter = new RemoteConfigServiceImpl.DateAdapter(); + + final Date parsed = adapter.fromJson(reader); + if (expectedEpochMilli == null) { + assertNull(parsed); + } else { + assertNotNull(parsed); + assertEquals(Instant.ofEpochMilli(expectedEpochMilli), parsed.toInstant()); + } + } + + @Test + void testParsingOnlyAdapter() { + final RemoteConfigServiceImpl.DateAdapter adapter = new RemoteConfigServiceImpl.DateAdapter(); + + assertThrows( + UnsupportedOperationException.class, + () -> adapter.toJson(mock(JsonWriter.class), new Date())); + } + + @SuppressWarnings("unchecked") + private ConfigurationDeserializer deserializer() { + return deserializerCaptor.getValue(); + } + + private static ServerConfiguration deserialize(final String json) throws Exception { + return RemoteConfigServiceImpl.UniversalFlagConfigDeserializer.INSTANCE.deserialize( + json.getBytes(UTF_8)); + } + + private static Moshi moshi() { + return new Moshi.Builder().add(Date.class, new RemoteConfigServiceImpl.DateAdapter()).build(); + } + + private static String emptyConfig() { + return "{" + + "\"createdAt\":\"2024-04-17T19:40:53.716Z\"," + + "\"format\":\"SERVER\"," + + "\"environment\":{\"name\":\"Test\"}," + + "\"flags\":{}" + + "}"; + } +} diff --git a/products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/SpanEnrichmentAccumulatorTest.java b/products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/SpanEnrichmentAccumulatorTest.java new file mode 100644 index 00000000000..ce6df50cfc0 --- /dev/null +++ b/products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/SpanEnrichmentAccumulatorTest.java @@ -0,0 +1,247 @@ +package com.datadog.featureflag; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.Base64; +import java.util.Collections; +import java.util.Map; +import java.util.SortedSet; +import java.util.TreeSet; +import org.junit.jupiter.api.Test; + +/** + * Write-tier codec + accumulator suite. The encoding, limits, and tag shapes are FROZEN against the + * Node reference ({@code dd-trace-js#8343}); the golden vector {@code {100,108,128,130} -> + * "ZAgUAg=="} anchors byte-for-byte cross-SDK parity. + */ +class SpanEnrichmentAccumulatorTest { + + // Test-only decode oracle for the ULEB128 delta-varint codec — the production code only encodes. + private static SortedSet decodeDeltaVarint(final String encoded) { + final SortedSet result = new TreeSet<>(); + if (encoded == null || encoded.isEmpty()) { + return result; + } + final byte[] bytes = Base64.getDecoder().decode(encoded); + int previous = 0; + int index = 0; + while (index < bytes.length) { + long value = 0; + int shift = 0; + while (true) { + final byte b = bytes[index++]; + value |= ((long) (b & 0x7F)) << shift; + if ((b & 0x80) == 0) { + break; + } + shift += 7; + } + previous += (int) value; + result.add(previous); + } + return result; + } + + @Test + void codecGoldenVectorAndRoundTrip() { + final SortedSet ids = new TreeSet<>(); + ids.add(100); + ids.add(108); + ids.add(128); + ids.add(130); + final String encoded = ULeb128Encoder.encodeDeltaVarint(ids); + assertEquals("ZAgUAg==", encoded, "golden vector must match the frozen Node contract"); + assertEquals(ids, decodeDeltaVarint(encoded)); + assertEquals("", ULeb128Encoder.encodeDeltaVarint(Collections.emptySet())); + final SortedSet withDup = new TreeSet<>(ids); + withDup.add(100); + assertEquals( + encoded, ULeb128Encoder.encodeDeltaVarint(withDup), "duplicates do not change bytes"); + } + + @Test + void flagsEncTagFromAccumulatedSerialIds() { + final SpanEnrichmentAccumulator acc = new SpanEnrichmentAccumulator(); + acc.addSerialId(100); + acc.addSerialId(108); + acc.addSerialId(128); + acc.addSerialId(130); + acc.addSerialId(100); // dedupe + assertTrue(acc.hasData()); + assertEquals("ZAgUAg==", acc.toSpanTags().get(SpanEnrichmentAccumulator.TAG_FLAGS_ENC)); + } + + @Test + void max200SerialIdsEnforced() { + final SpanEnrichmentAccumulator acc = new SpanEnrichmentAccumulator(); + for (int i = 0; i < 300; i++) { + acc.addSerialId(i); + } + assertEquals( + SpanEnrichmentAccumulator.MAX_SERIAL_IDS, + acc.serialIdsView().size(), + "serial ids must be capped at 200"); + } + + @Test + void subjectAndPerSubjectExperimentCaps() { + // per-subject experiment cap: 20 max + final SpanEnrichmentAccumulator acc = new SpanEnrichmentAccumulator(); + for (int i = 0; i < 25; i++) { + acc.addSubject("subjectX", i); + } + final SortedSet decoded = + decodeDeltaVarint( + acc.toSpanTags() + .get(SpanEnrichmentAccumulator.TAG_SUBJECTS_ENC) + .replaceAll("^\\{\"[a-f0-9]+\":\"", "") + .replaceAll("\"\\}$", "")); + assertEquals(SpanEnrichmentAccumulator.MAX_EXPERIMENTS_PER_SUBJECT, decoded.size()); + + // subject cap: 10 max distinct subjects + final SpanEnrichmentAccumulator acc2 = new SpanEnrichmentAccumulator(); + for (int i = 0; i < 15; i++) { + acc2.addSubject("subject-" + i, i); + } + assertEquals(SpanEnrichmentAccumulator.MAX_SUBJECTS, acc2.subjectCount()); + } + + @Test + void runtimeDefaultJsonStringifyAndTruncation() { + // native object -> JSON, not toString + assertEquals( + "{\"a\":\"b\"}", + SpanEnrichmentAccumulator.stringifyDefault(Collections.singletonMap("a", "b"))); + // scalar string -> as-is + assertEquals("hello", SpanEnrichmentAccumulator.stringifyDefault("hello")); + // null -> "null" + assertEquals("null", SpanEnrichmentAccumulator.stringifyDefault(null)); + // native list -> JSON array + assertEquals( + "[\"a\",2,true]", + SpanEnrichmentAccumulator.stringifyDefault(java.util.Arrays.asList("a", 2, true))); + + // 64-char truncation + final StringBuilder longValue = new StringBuilder(); + for (int i = 0; i < 100; i++) { + longValue.append('x'); + } + final SpanEnrichmentAccumulator acc = new SpanEnrichmentAccumulator(); + acc.addDefault("flag", longValue.toString()); + final String tag = acc.toSpanTags().get(SpanEnrichmentAccumulator.TAG_RUNTIME_DEFAULTS); + final String expectedValue = + longValue.substring(0, SpanEnrichmentAccumulator.MAX_DEFAULT_VALUE_LENGTH); + assertEquals("{\"flag\":\"" + expectedValue + "\"}", tag); + + // first-wins + acc.addDefault("flag", "second"); + assertEquals(1, acc.defaultCount()); + } + + @Test + void jsonUsesPlatformWriterEscaping() { + // The platform JsonWriter escapes '/' as backslash-slash and non-ASCII as a backslash-u escape. + // That differs from the JS reference bytes but is round-trip-equivalent: all consumers + // JSON-parse these tags (backend Jackson, system-tests json.loads), so byte-parity is not + // required. '/' matters in practice because ffe_subjects_enc values are base64 (may contain + // '/'). + assertEquals( + "{\"h\":\"a\\/b\"}", + SpanEnrichmentAccumulator.toJsonObject(Collections.singletonMap("h", "a/b"))); + assertEquals( + "{\"k\":\"caf\\u00E9\"}", + SpanEnrichmentAccumulator.toJsonObject(Collections.singletonMap("k", "café"))); + // nested structured runtime default goes through the same writer + assertEquals( + "{\"a\":\"x\\/y\"}", + SpanEnrichmentAccumulator.stringifyDefault(Collections.singletonMap("a", "x/y"))); + } + + @Test + void maxDefaultsEnforced() { + final SpanEnrichmentAccumulator acc = new SpanEnrichmentAccumulator(); + for (int i = 0; i < 10; i++) { + acc.addDefault("flag-" + i, "v"); + } + assertEquals(SpanEnrichmentAccumulator.MAX_DEFAULTS, acc.defaultCount()); + } + + @Test + void encoderNullAndNonSortedInput() { + assertEquals("", ULeb128Encoder.encodeDeltaVarint(null), "null → empty string"); + // A non-SortedSet input must still encode identically (it is sorted internally). + final java.util.Set unsorted = + new java.util.HashSet<>(java.util.Arrays.asList(130, 100, 128, 108)); + assertEquals("ZAgUAg==", ULeb128Encoder.encodeDeltaVarint(unsorted)); + } + + @Test + void serialIdDedupeAtCap() { + final SpanEnrichmentAccumulator acc = new SpanEnrichmentAccumulator(); + for (int i = 0; i < SpanEnrichmentAccumulator.MAX_SERIAL_IDS; i++) { + acc.addSerialId(i); + } + acc.addSerialId(0); // already present + at cap → no-op, not dropped as "new" + acc.addSerialId(9999); // new + at cap → dropped + assertEquals(SpanEnrichmentAccumulator.MAX_SERIAL_IDS, acc.serialIdsView().size()); + assertTrue(acc.serialIdsView().contains(0)); + assertFalse(acc.serialIdsView().contains(9999)); + } + + @Test + void subjectNullKeyIgnoredAndPerSubjectDedupeAtCap() { + final SpanEnrichmentAccumulator acc = new SpanEnrichmentAccumulator(); + acc.addSubject(null, 1); // null targeting key → ignored + assertEquals(0, acc.subjectCount()); + for (int i = 0; i < SpanEnrichmentAccumulator.MAX_EXPERIMENTS_PER_SUBJECT; i++) { + acc.addSubject("s", i); + } + acc.addSubject("s", 0); // existing subject, at exp cap, id present → no-op + acc.addSubject("s", 9999); // existing subject, at exp cap, id new → dropped + assertEquals(1, acc.subjectCount()); + } + + @Test + void stringifyDefaultCoversAllNativeShapes() { + // list containing Double, Long, Short, Byte, null, and a nested Map — exercises every + // writeJsonValue branch (Number/double, Integer|Long|Short|Byte/long, null, Map, Iterable). + final Object nested = + java.util.Arrays.asList( + 1.5d, 3L, (short) 7, (byte) 2, null, Collections.singletonMap("k", "v")); + assertEquals( + "[1.5,3,7,2,null,{\"k\":\"v\"}]", SpanEnrichmentAccumulator.stringifyDefault(nested)); + + // Java array routes through isArray → serialized via its (non-JSON) string form, but must not + // throw; assert it produced a quoted string. + final String arr = SpanEnrichmentAccumulator.stringifyDefault(new int[] {1, 2}); + assertTrue(arr.startsWith("\"") && arr.endsWith("\"")); + + // Character scalar (CharSequence/Character branch). + assertEquals("x", SpanEnrichmentAccumulator.stringifyDefault('x')); + } + + @Test + void runtimeDefaultTruncationIsSurrogateSafe() { + // 63 ASCII chars then an astral emoji (a surrogate pair): truncating to 64 would split the + // pair at index 63, so utf8SafeTruncate must drop the dangling high surrogate → 63 chars. + final StringBuilder sb = new StringBuilder(); + for (int i = 0; i < 63; i++) { + sb.append('a'); + } + sb.append("😀"); // 😀 (high + low surrogate) + final SpanEnrichmentAccumulator acc = new SpanEnrichmentAccumulator(); + acc.addDefault("flag", sb.toString()); + final String tag = acc.toSpanTags().get(SpanEnrichmentAccumulator.TAG_RUNTIME_DEFAULTS); + assertEquals("{\"flag\":\"" + sb.substring(0, 63) + "\"}", tag); + } + + @Test + void noDataWhenEmpty() { + final SpanEnrichmentAccumulator acc = new SpanEnrichmentAccumulator(); + assertFalse(acc.hasData()); + final Map tags = acc.toSpanTags(); + assertTrue(tags.isEmpty()); + } +} diff --git a/products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/SpanEnrichmentInterceptorTest.java b/products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/SpanEnrichmentInterceptorTest.java new file mode 100644 index 00000000000..becbf4cd464 --- /dev/null +++ b/products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/SpanEnrichmentInterceptorTest.java @@ -0,0 +1,217 @@ +package com.datadog.featureflag; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import datadog.trace.api.interceptor.MutableSpan; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import org.junit.jupiter.api.Test; + +/** + * Write-tier interceptor suite: partial-flush correctness (the long-running-trace regression), + * identity keying, and the no-state fast path. dd-trace-core runs {@code onTraceComplete} on every + * flush; a partial flush excludes the still-open root, so the interceptor must only flush+remove + * when the local root is present in the fragment. + */ +class SpanEnrichmentInterceptorTest { + + /** A mock local-root span reporting itself as its own local root. */ + private static AgentSpan rootSpan() { + final AgentSpan root = mock(AgentSpan.class); + when(root.getLocalRootSpan()).thenReturn(root); + return root; + } + + /** A mock child span whose local root is {@code root} but which is itself NOT the root. */ + private static AgentSpan childOf(final AgentSpan root) { + final AgentSpan child = mock(AgentSpan.class); + when(child.getLocalRootSpan()).thenReturn(root); + return child; + } + + @Test + void priorityIsUnique() { + assertEquals(4, new SpanEnrichmentInterceptor(new SpanEnrichmentStates()).priority()); + } + + @Test + void emptyOrNoStateIsANoOpFastPath() { + final SpanEnrichmentStates states = new SpanEnrichmentStates(); + final SpanEnrichmentInterceptor interceptor = new SpanEnrichmentInterceptor(states); + // empty trace + assertTrue(interceptor.onTraceComplete(Collections.emptyList()).isEmpty()); + // no accumulated state => fast path, never touches the span + final AgentSpan root = rootSpan(); + interceptor.onTraceComplete(Collections.singletonList(root)); + verify(root, never()).setTag(anyString(), anyString()); + } + + @Test + void finalFlushWithRootPresentWritesTags() { + final SpanEnrichmentStates states = new SpanEnrichmentStates(); + final SpanEnrichmentInterceptor interceptor = new SpanEnrichmentInterceptor(states); + final AgentSpan root = rootSpan(); + states.getOrCreate(root).addSerialId(5); + + interceptor.onTraceComplete(Collections.singletonList(root)); + + verify(root).setTag(SpanEnrichmentAccumulator.TAG_FLAGS_ENC, "BQ=="); // {5} -> 0x05 + assertTrue(states.isEmpty(), "state must be removed on the final flush"); + } + + @Test + void partialFlushExcludingRootPreservesState() { + final SpanEnrichmentStates states = new SpanEnrichmentStates(); + final SpanEnrichmentInterceptor interceptor = new SpanEnrichmentInterceptor(states); + final AgentSpan root = rootSpan(); + states.getOrCreate(root).addSerialId(100); + states.getOrCreate(root).addSerialId(108); + + // PARTIAL flush: a fragment of children only — the open root is NOT in the collection. + final AgentSpan child1 = childOf(root); + final AgentSpan child2 = childOf(root); + interceptor.onTraceComplete(Arrays.asList(child1, child2)); + + verify(child1, never()).setTag(anyString(), anyString()); + verify(child2, never()).setTag(anyString(), anyString()); + verify(root, never()).setTag(anyString(), anyString()); + final SpanEnrichmentAccumulator surviving = states.peek(root); + assertNotNull(surviving, "partial flush must NOT remove the accumulator"); + assertTrue(surviving.serialIdsView().contains(100) && surviving.serialIdsView().contains(108)); + + // more evaluations, then the FINAL flush with the root present + states.getOrCreate(root).addSerialId(128); + states.getOrCreate(root).addSerialId(130); + final AgentSpan lateChild = childOf(root); + interceptor.onTraceComplete(Arrays.asList(lateChild, root)); + + verify(root).setTag(SpanEnrichmentAccumulator.TAG_FLAGS_ENC, "ZAgUAg=="); // {100,108,128,130} + assertTrue(states.isEmpty(), "state removed only on the final flush"); + } + + @Test + void childOnlyFragmentNeverTagsAChildSpan() { + final SpanEnrichmentStates states = new SpanEnrichmentStates(); + final SpanEnrichmentInterceptor interceptor = new SpanEnrichmentInterceptor(states); + final AgentSpan root = rootSpan(); + states.getOrCreate(root).addSerialId(7); + + final AgentSpan child = childOf(root); + interceptor.onTraceComplete(Collections.singletonList(child)); + + verify(child, never()).setTag(anyString(), anyString()); + verify(root, never()).setTag(anyString(), anyString()); + assertNotNull(states.peek(root), "child-only fragment must keep state"); + } + + @Test + void distinctTracesDoNotMerge() { + final SpanEnrichmentStates states = new SpanEnrichmentStates(); + final SpanEnrichmentInterceptor interceptor = new SpanEnrichmentInterceptor(states); + final AgentSpan rootA = rootSpan(); + final AgentSpan rootB = rootSpan(); + states.getOrCreate(rootA).addSerialId(100); + states.getOrCreate(rootB).addSerialId(130); + assertEquals(2, states.size(), "distinct root spans must not share an accumulator"); + + interceptor.onTraceComplete(Collections.singletonList(rootA)); + verify(rootA).setTag(SpanEnrichmentAccumulator.TAG_FLAGS_ENC, "ZA=="); // {100} -> 0x64 + interceptor.onTraceComplete(Collections.singletonList(rootB)); + verify(rootB).setTag(SpanEnrichmentAccumulator.TAG_FLAGS_ENC, "ggE="); // {130} -> 0x82 0x01 + } + + @Test + void neverCompletingTracesAreNotCapped() { + // No cap / eviction: while their local-root spans are reachable, every never-completing trace + // keeps its accumulator. Weak-key reclamation (not a fixed count) bounds memory. + final SpanEnrichmentStates states = new SpanEnrichmentStates(); + final int churn = 20_000; // well beyond the old 4096 cap + final List liveRoots = new ArrayList<>(churn); + for (int i = 0; i < churn; i++) { + final AgentSpan root = rootSpan(); + liveRoots.add(root); + states.getOrCreate(root).addSerialId(i % 1000 + 1); + } + assertEquals(churn, states.size(), "no cap/eviction: every live root keeps its accumulator"); + } + + @Test + void nullTraceIsANoOp() { + final SpanEnrichmentInterceptor interceptor = + new SpanEnrichmentInterceptor(new SpanEnrichmentStates()); + assertNull(interceptor.onTraceComplete(null)); + } + + @Test + void rootPresentButNoAccumulatorEntryWritesNothing() { + // states is non-empty (has rootA) but we flush rootB which has no entry → remove returns null. + final SpanEnrichmentStates states = new SpanEnrichmentStates(); + final SpanEnrichmentInterceptor interceptor = new SpanEnrichmentInterceptor(states); + final AgentSpan rootA = rootSpan(); + states.getOrCreate(rootA).addSerialId(1); + final AgentSpan rootB = rootSpan(); + interceptor.onTraceComplete(Collections.singletonList(rootB)); + verify(rootB, never()).setTag(anyString(), anyString()); + } + + @Test + void emptyAccumulatorWritesNoTags() { + final SpanEnrichmentStates states = new SpanEnrichmentStates(); + final SpanEnrichmentInterceptor interceptor = new SpanEnrichmentInterceptor(states); + final AgentSpan root = rootSpan(); + states.getOrCreate(root); // entry exists but has no data + interceptor.onTraceComplete(Collections.singletonList(root)); + verify(root, never()).setTag(anyString(), anyString()); + assertTrue(states.isEmpty(), "empty accumulator is still removed on the final flush"); + } + + @Test + void fallbackResolvesSelfRootWhenFirstSpanReportsNoLocalRoot() { + // First span reports a null local root; a later span that is its own local root is chosen. + final SpanEnrichmentStates states = new SpanEnrichmentStates(); + final SpanEnrichmentInterceptor interceptor = new SpanEnrichmentInterceptor(states); + final AgentSpan noRootFirst = mock(AgentSpan.class); + when(noRootFirst.getLocalRootSpan()).thenReturn(null); + final AgentSpan root = rootSpan(); + states.getOrCreate(root).addSerialId(5); + interceptor.onTraceComplete(Arrays.asList(noRootFirst, root)); + verify(root).setTag(SpanEnrichmentAccumulator.TAG_FLAGS_ENC, "BQ=="); + } + + @Test + void neverThrowsWhenSetTagFails() { + final SpanEnrichmentStates states = new SpanEnrichmentStates(); + final SpanEnrichmentInterceptor interceptor = new SpanEnrichmentInterceptor(states); + final AgentSpan root = rootSpan(); + when(root.setTag(anyString(), anyString())).thenThrow(new RuntimeException("boom")); + states.getOrCreate(root).addSerialId(5); + // Must swallow the exception — enrichment can never break trace finish. + interceptor.onTraceComplete(Collections.singletonList(root)); + } + + @Test + void keyingSymmetryRootResolvedFromFragmentMatchesCapturedRoot() { + final SpanEnrichmentStates states = new SpanEnrichmentStates(); + final SpanEnrichmentInterceptor interceptor = new SpanEnrichmentInterceptor(states); + final AgentSpan root = rootSpan(); + states.getOrCreate(root).addSerialId(5); + + // The interceptor resolves the root from the fragment (root + a late child); it must be the + // same object so the remove hits the captured accumulator. + final AgentSpan child = childOf(root); + interceptor.onTraceComplete(Arrays.asList(child, root)); + verify(root).setTag(SpanEnrichmentAccumulator.TAG_FLAGS_ENC, "BQ=="); // {5} -> 0x05 + assertTrue(states.isEmpty()); + } +} diff --git a/products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/SpanEnrichmentWriterTest.java b/products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/SpanEnrichmentWriterTest.java new file mode 100644 index 00000000000..419a9fef5b5 --- /dev/null +++ b/products/feature-flagging/feature-flagging-lib/src/test/java/com/datadog/featureflag/SpanEnrichmentWriterTest.java @@ -0,0 +1,205 @@ +package com.datadog.featureflag; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import datadog.trace.api.featureflag.SpanEnrichmentEvent; +import datadog.trace.bootstrap.instrumentation.api.AgentSpan; +import java.util.Collections; +import org.junit.jupiter.api.Test; + +/** + * Write-tier listener suite: the agent-side {@link SpanEnrichmentWriter} translates {@link + * SpanEnrichmentEvent}s from the flag-eval seam into per-local-root accumulator state (resolving + * the active root through an injectable resolver so no static tracer is needed). + */ +class SpanEnrichmentWriterTest { + + private static AgentSpan rootSpan() { + final AgentSpan root = mock(AgentSpan.class); + when(root.getLocalRootSpan()).thenReturn(root); + return root; + } + + private static SpanEnrichmentWriter writerFor(final AgentSpan root) { + return new SpanEnrichmentWriter(() -> root); + } + + @Test + void serialIdWithDoLogAndTargetingKeyRecordsSerialAndSubject() { + final AgentSpan root = rootSpan(); + final SpanEnrichmentWriter writer = writerFor(root); + writer.accept(SpanEnrichmentEvent.serialId(42, true, "user-1")); + + final SpanEnrichmentAccumulator state = writer.states().peek(root); + assertNotNull(state); + assertTrue(state.serialIdsView().contains(42)); + assertEquals(1, state.subjectCount(), "doLog=true + targeting key => subject recorded"); + } + + @Test + void serialIdWithoutDoLogRecordsNoSubject() { + final AgentSpan root = rootSpan(); + final SpanEnrichmentWriter writer = writerFor(root); + writer.accept(SpanEnrichmentEvent.serialId(7, false, "user-1")); + + final SpanEnrichmentAccumulator state = writer.states().peek(root); + assertTrue(state.serialIdsView().contains(7)); + assertEquals(0, state.subjectCount(), "doLog=false must not record a subject"); + } + + @Test + void serialIdWithNullTargetingKeyRecordsNoSubject() { + final AgentSpan root = rootSpan(); + final SpanEnrichmentWriter writer = writerFor(root); + writer.accept(SpanEnrichmentEvent.serialId(9, true, null)); + + final SpanEnrichmentAccumulator state = writer.states().peek(root); + assertTrue(state.serialIdsView().contains(9)); + assertEquals(0, state.subjectCount(), "no targeting key => no subject"); + } + + @Test + void runtimeDefaultRecordsDefault() { + final AgentSpan root = rootSpan(); + final SpanEnrichmentWriter writer = writerFor(root); + writer.accept(SpanEnrichmentEvent.runtimeDefault("flag", Collections.singletonMap("k", "v"))); + + final SpanEnrichmentAccumulator state = writer.states().peek(root); + assertNotNull(state); + assertEquals(1, state.defaultCount()); + } + + @Test + void noActiveSpanAccumulatesNothing() { + final SpanEnrichmentWriter writer = new SpanEnrichmentWriter(() -> null); + writer.accept(SpanEnrichmentEvent.serialId(1, true, "user-1")); + assertTrue(writer.states().isEmpty(), "no active span => no accumulator state"); + } + + @Test + void nullEventIsANoOp() { + final AgentSpan root = rootSpan(); + final SpanEnrichmentWriter writer = writerFor(root); + writer.accept(null); + assertTrue(writer.states().isEmpty()); + } + + @Test + void endToEndAccumulateThenFlush() { + final AgentSpan root = rootSpan(); + final SpanEnrichmentWriter writer = writerFor(root); + writer.accept(SpanEnrichmentEvent.serialId(5, false, null)); + + writer.interceptor().onTraceComplete(Collections.singletonList(root)); + verify(root).setTag(SpanEnrichmentAccumulator.TAG_FLAGS_ENC, "BQ=="); // {5} -> 0x05 + assertTrue(writer.states().isEmpty(), "flush removes the accumulated state"); + } + + @Test + void doesNotAccumulateWhenInterceptorCannotRegister() { + final AgentSpan root = rootSpan(); + // Registrar always rejects → nothing would ever flush the state, so we must not accumulate. + final SpanEnrichmentWriter writer = new SpanEnrichmentWriter(() -> root, interceptor -> false); + writer.accept(SpanEnrichmentEvent.serialId(5, false, null)); + assertTrue( + writer.states().isEmpty(), "no accumulation when the interceptor cannot be registered"); + } + + @Test + void agentSingletonIsStableAcrossRestarts() { + // FeatureFlaggingSystem reuses this one instance across start/stop, so the (unremovable) trace + // interceptor is registered exactly once and never re-registered on restart. + final SpanEnrichmentWriter first = SpanEnrichmentWriter.getInstance(); + final SpanEnrichmentWriter second = SpanEnrichmentWriter.getInstance(); + assertSame(first, second, "agent wiring must reuse one writer across restarts"); + assertSame(first.interceptor(), second.interceptor(), "same interceptor across restarts"); + assertSame(first.states(), second.states(), "same state store across restarts"); + } + + @Test + void resolveLocalRootLogic() { + assertNull(SpanEnrichmentWriter.resolveLocalRoot(null)); + + final AgentSpan root = rootSpan(); // reports itself as its own local root + assertSame(root, SpanEnrichmentWriter.resolveLocalRoot(root)); + + final AgentSpan child = mock(AgentSpan.class); + final AgentSpan childRoot = rootSpan(); + when(child.getLocalRootSpan()).thenReturn(childRoot); + assertSame(childRoot, SpanEnrichmentWriter.resolveLocalRoot(child)); + + final AgentSpan noLocal = mock(AgentSpan.class); + when(noLocal.getLocalRootSpan()).thenReturn(null); + assertSame( + noLocal, SpanEnrichmentWriter.resolveLocalRoot(noLocal), "no local root → active span"); + } + + @Test + void initSubscribesAndCloseClearsState() { + final AgentSpan root = rootSpan(); + final SpanEnrichmentWriter writer = writerFor(root); + writer.init(); + try { + writer.accept(SpanEnrichmentEvent.serialId(5, false, null)); + assertNotNull(writer.states().peek(root)); + } finally { + writer.close(); + } + assertTrue(writer.states().isEmpty(), "close() clears accumulated state"); + } + + @Test + void runtimeDefaultWithNullFlagKeyIsIgnored() { + final AgentSpan root = rootSpan(); + final SpanEnrichmentWriter writer = writerFor(root); + writer.accept(SpanEnrichmentEvent.runtimeDefault(null, "v")); + // No serial id and null flag key → nothing recorded (getOrCreate ran, but no data added). + final SpanEnrichmentAccumulator state = writer.states().peek(root); + assertTrue(state == null || !state.hasData()); + } + + @Test + void acceptSwallowsResolverErrors() { + final SpanEnrichmentWriter writer = + new SpanEnrichmentWriter( + () -> { + throw new RuntimeException("resolver boom"); + }); + // Must not propagate — enrichment can never break flag evaluation. + writer.accept(SpanEnrichmentEvent.serialId(5, false, null)); + assertTrue(writer.states().isEmpty()); + } + + @Test + void registrarErrorIsSwallowedAndNotLatched() { + final AgentSpan root = rootSpan(); + final SpanEnrichmentWriter writer = + new SpanEnrichmentWriter( + () -> root, + interceptor -> { + throw new RuntimeException("register boom"); + }); + // Registration throws → swallowed, not latched, and nothing accumulates (never flushable). + writer.accept(SpanEnrichmentEvent.serialId(5, false, null)); + assertTrue(writer.states().isEmpty()); + } + + @Test + void distinctEventsUnderSameRootShareAccumulator() { + final AgentSpan root = rootSpan(); + final SpanEnrichmentWriter writer = writerFor(root); + writer.accept(SpanEnrichmentEvent.serialId(100, false, null)); + writer.accept(SpanEnrichmentEvent.serialId(108, false, null)); + assertEquals(1, writer.states().size(), "same root => one shared accumulator"); + verify(root, never()).setTag(anyString(), anyString()); + } +} diff --git a/products/metrics/metrics-agent/gradle.lockfile b/products/metrics/metrics-agent/gradle.lockfile index c86a210c798..5c1ed990e09 100644 --- a/products/metrics/metrics-agent/gradle.lockfile +++ b/products/metrics/metrics-agent/gradle.lockfile @@ -1,10 +1,11 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :products:metrics:metrics-agent:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -39,10 +40,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -56,10 +57,13 @@ org.mockito:mockito-core:4.4.0=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/products/metrics/metrics-api/gradle.lockfile b/products/metrics/metrics-api/gradle.lockfile index 62b097024f2..1e71cd4f910 100644 --- a/products/metrics/metrics-api/gradle.lockfile +++ b/products/metrics/metrics-api/gradle.lockfile @@ -1,10 +1,11 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :products:metrics:metrics-api:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -39,10 +40,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -56,10 +57,13 @@ org.mockito:mockito-core:4.4.0=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/products/metrics/metrics-lib/build.gradle.kts b/products/metrics/metrics-lib/build.gradle.kts index 18deab80914..48c86622733 100644 --- a/products/metrics/metrics-lib/build.gradle.kts +++ b/products/metrics/metrics-lib/build.gradle.kts @@ -1,4 +1,6 @@ +import com.github.jengelman.gradle.plugins.shadow.tasks.DependencyFilter import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar +import org.gradle.api.Action plugins { `java-library` @@ -27,26 +29,16 @@ dependencies { tasks.named("shadowJar") { dependencies { val deps = project.extra["deps"] as Map<*, *> - val excludeShared = deps["excludeShared"] as groovy.lang.Closure<*> - excludeShared.delegate = this - excludeShared.call() + val excludeShared = deps["excludeShared"] as Action + excludeShared.execute(this) } } -val minimumBranchCoverage by extra(0.5) -val minimumInstructionCoverage by extra(0.8) -val excludedClassesCoverage by extra( - listOf( - "datadog.communication.monitor.DDAgentStatsDConnection", - "datadog.communication.monitor.DDAgentStatsDConnection.*", - "datadog.communication.monitor.LoggingStatsDClient", - ) +extra["minimumBranchCoverage"] = 0.5 +extra["minimumInstructionCoverage"] = 0.8 +extra["excludedClassesCoverage"] = listOf( + "datadog.metrics.impl.statsd.DDAgentStatsDClientManager", + "datadog.metrics.impl.statsd.DDAgentStatsDConnection", + "datadog.metrics.impl.statsd.DDAgentStatsDConnection.*", + "datadog.metrics.impl.statsd.LoggingStatsDClient", ) -// val excludedClassesBranchCoverage by extra( -// listOf( -// ) -// ) -// val excludedClassesInstructionCoverage by extra( -// listOf( -// ) -// ) diff --git a/products/metrics/metrics-lib/gradle.lockfile b/products/metrics/metrics-lib/gradle.lockfile index 02af9ca9cbf..4b96c2c55f0 100644 --- a/products/metrics/metrics-lib/gradle.lockfile +++ b/products/metrics/metrics-lib/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :products:metrics:metrics-lib:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -15,7 +16,7 @@ com.github.jnr:jnr-ffi:2.1.16=compileClasspath,runtimeClasspath,testCompileClass com.github.jnr:jnr-posix:3.0.61=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.jnr:jnr-unixsocket:0.36=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -29,8 +30,8 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -53,10 +54,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -72,13 +73,16 @@ org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:7.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs org.ow2.asm:asm-commons:7.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs org.ow2.asm:asm-tree:7.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:7.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs org.ow2.asm:asm:7.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/products/metrics/metrics-lib/src/test/java/datadog/metrics/impl/DDSketchHistogramsTest.java b/products/metrics/metrics-lib/src/test/java/datadog/metrics/impl/DDSketchHistogramsTest.java new file mode 100644 index 00000000000..d5e87846495 --- /dev/null +++ b/products/metrics/metrics-lib/src/test/java/datadog/metrics/impl/DDSketchHistogramsTest.java @@ -0,0 +1,91 @@ +package datadog.metrics.impl; + +import static java.util.Arrays.asList; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import datadog.metrics.impl.DDSketchHistograms.ExplicitBoundaries; +import java.util.List; +import org.junit.jupiter.api.Test; + +class DDSketchHistogramsTest { + + // boundaries define 4 bins: + // bin 0: (-inf, 10] + // bin 1: (10, 20] + // bin 2: (20, 30] + // bin 3: (30, +inf) + private static final List BOUNDARIES = asList(10.0, 20.0, 30.0); + + @Test + void indexBelowFirstBoundary() { + ExplicitBoundaries eb = new ExplicitBoundaries(BOUNDARIES); + assertEquals(0, eb.index(5.0)); + } + + @Test + void indexOnBoundary() { + ExplicitBoundaries eb = new ExplicitBoundaries(BOUNDARIES); + assertEquals(0, eb.index(10.0)); + assertEquals(1, eb.index(20.0)); + assertEquals(2, eb.index(30.0)); + } + + @Test + void indexBetweenBoundaries() { + ExplicitBoundaries eb = new ExplicitBoundaries(BOUNDARIES); + assertEquals(1, eb.index(15.0)); + assertEquals(2, eb.index(25.0)); + } + + @Test + void indexAboveLastBoundary() { + ExplicitBoundaries eb = new ExplicitBoundaries(BOUNDARIES); + assertEquals(3, eb.index(35.0)); + } + + @Test + void lowerBoundOfFirstBinIsNegativeInfinity() { + ExplicitBoundaries eb = new ExplicitBoundaries(BOUNDARIES); + assertEquals(Double.NEGATIVE_INFINITY, eb.lowerBound(0)); + } + + @Test + void lowerBoundMapsToPreceeedingBoundary() { + ExplicitBoundaries eb = new ExplicitBoundaries(BOUNDARIES); + assertEquals(10.0, eb.lowerBound(1)); + assertEquals(20.0, eb.lowerBound(2)); + assertEquals(30.0, eb.lowerBound(3)); + } + + @Test + void upperBoundMapsToCorrespondingBoundary() { + ExplicitBoundaries eb = new ExplicitBoundaries(BOUNDARIES); + assertEquals(10.0, eb.upperBound(0)); + assertEquals(20.0, eb.upperBound(1)); + assertEquals(30.0, eb.upperBound(2)); + } + + @Test + void upperBoundOfLastBinIsPositiveInfinity() { + ExplicitBoundaries eb = new ExplicitBoundaries(BOUNDARIES); + assertEquals(Double.POSITIVE_INFINITY, eb.upperBound(3)); + } + + @Test + void extremeIndexableValues() { + ExplicitBoundaries eb = new ExplicitBoundaries(BOUNDARIES); + assertEquals(Double.NEGATIVE_INFINITY, eb.minIndexableValue()); + assertEquals(Double.POSITIVE_INFINITY, eb.maxIndexableValue()); + } + + @Test + void unsupportedOperationsThrow() { + ExplicitBoundaries eb = new ExplicitBoundaries(BOUNDARIES); + assertThrows(UnsupportedOperationException.class, () -> eb.value(0)); + assertThrows(UnsupportedOperationException.class, eb::relativeAccuracy); + assertThrows(UnsupportedOperationException.class, () -> eb.encode(null)); + assertThrows(UnsupportedOperationException.class, eb::serializedSize); + assertThrows(UnsupportedOperationException.class, () -> eb.serialize(null)); + } +} diff --git a/products/metrics/metrics-lib/src/test/java/datadog/metrics/impl/ThreadLocalRecordingTest.java b/products/metrics/metrics-lib/src/test/java/datadog/metrics/impl/ThreadLocalRecordingTest.java new file mode 100644 index 00000000000..f533355eb89 --- /dev/null +++ b/products/metrics/metrics-lib/src/test/java/datadog/metrics/impl/ThreadLocalRecordingTest.java @@ -0,0 +1,86 @@ +package datadog.metrics.impl; + +import static java.util.Arrays.asList; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import datadog.metrics.api.Recording; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.CountDownLatch; +import org.junit.jupiter.api.Test; + +class ThreadLocalRecordingTest { + + @Test + void delegatesPerThread() throws Exception { + Map> callsByThread = new ConcurrentHashMap<>(); + + ThreadLocal sink = + ThreadLocal.withInitial( + () -> { + List calls = new ArrayList<>(); + callsByThread.put(Thread.currentThread(), calls); + return recordCalls(calls); + }); + + Recording recording = new ThreadLocalRecording(sink); + + int threadCount = 4; + CountDownLatch ready = new CountDownLatch(threadCount); + CountDownLatch done = new CountDownLatch(threadCount); + Thread[] threads = new Thread[threadCount]; + + for (int i = 0; i < threadCount; i++) { + threads[i] = + new Thread( + () -> { + ready.countDown(); + try { + ready.await(); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + return; + } + recording.start(); + recording.reset(); + recording.stop(); + recording.flush(); + done.countDown(); + }); + threads[i].start(); + } + done.await(); + + assertEquals(threadCount, callsByThread.size(), "each thread should have its own Recording"); + for (List calls : callsByThread.values()) { + assertEquals(asList("start", "reset", "stop", "flush"), calls); + } + } + + private static Recording recordCalls(List calls) { + return new Recording() { + @Override + public Recording start() { + calls.add("start"); + return this; + } + + @Override + public void reset() { + calls.add("reset"); + } + + @Override + public void stop() { + calls.add("stop"); + } + + @Override + public void flush() { + calls.add("flush"); + } + }; + } +} diff --git a/remote-config/remote-config-api/build.gradle.kts b/remote-config/remote-config-api/build.gradle.kts index 212bbb3ab44..5a5a77442b3 100644 --- a/remote-config/remote-config-api/build.gradle.kts +++ b/remote-config/remote-config-api/build.gradle.kts @@ -1,7 +1,3 @@ apply(from = "$rootDir/gradle/java.gradle") -val excludedClassesBranchCoverage by extra( - listOf( - "datadog.remoteconfig.ConfigurationChangesListener.PollingHinterNoop" - ) -) +extra["excludedClassesBranchCoverage"] = listOf("datadog.remoteconfig.ConfigurationChangesListener.PollingHinterNoop") diff --git a/remote-config/remote-config-api/gradle.lockfile b/remote-config/remote-config-api/gradle.lockfile index e7ab997a313..0fefca98733 100644 --- a/remote-config/remote-config-api/gradle.lockfile +++ b/remote-config/remote-config-api/gradle.lockfile @@ -1,10 +1,11 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :remote-config:remote-config-api:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -39,10 +40,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -56,10 +57,13 @@ org.mockito:mockito-core:4.4.0=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/remote-config/remote-config-core/build.gradle.kts b/remote-config/remote-config-core/build.gradle.kts index c6638c4ca06..f55284f2085 100644 --- a/remote-config/remote-config-core/build.gradle.kts +++ b/remote-config/remote-config-core/build.gradle.kts @@ -4,30 +4,22 @@ plugins { apply(from = "$rootDir/gradle/java.gradle") -val minimumBranchCoverage by extra(0.6) -val minimumInstructionCoverage by extra(0.8) -val excludedClassesCoverage by extra( - listOf( - // not used yet - "datadog.remoteconfig.tuf.RemoteConfigRequest.ClientInfo.AgentInfo", - // only half the adapter interface used - "datadog.remoteconfig.tuf.InstantJsonAdapter", - // idem - "datadog.remoteconfig.tuf.RawJsonAdapter", - "datadog.remoteconfig.ExceptionHelper", - ) +extra["minimumBranchCoverage"] = 0.6 +extra["minimumInstructionCoverage"] = 0.8 +extra["excludedClassesCoverage"] = listOf( + // not used yet + "datadog.remoteconfig.tuf.RemoteConfigRequest.ClientInfo.AgentInfo", + // only half the adapter interface used + "datadog.remoteconfig.tuf.InstantJsonAdapter", + // idem + "datadog.remoteconfig.tuf.RawJsonAdapter", + "datadog.remoteconfig.ExceptionHelper", ) -val excludedClassesBranchCoverage by extra( - listOf( - "datadog.remoteconfig.tuf.FeaturesConfig", - "datadog.remoteconfig.PollerRequestFactory", - ) -) -val excludedClassesInstructionCoverage by extra( - listOf( - "datadog.remoteconfig.ConfigurationChangesListener.PollingHinterNoop", - ) +extra["excludedClassesBranchCoverage"] = listOf( + "datadog.remoteconfig.tuf.FeaturesConfig", + "datadog.remoteconfig.PollerRequestFactory", ) +extra["excludedClassesInstructionCoverage"] = listOf("datadog.remoteconfig.ConfigurationChangesListener.PollingHinterNoop",) dependencies { api(project(":remote-config:remote-config-api")) @@ -41,4 +33,9 @@ dependencies { implementation(project(":utils:logging-utils")) testImplementation(project(":utils:test-utils")) + testImplementation(libs.bundles.junit5) + testImplementation(libs.bundles.mockito) + testImplementation(libs.tabletest) + testImplementation(libs.assertj.core) + testImplementation(libs.json.unit.assertj) } diff --git a/remote-config/remote-config-core/gradle.lockfile b/remote-config/remote-config-core/gradle.lockfile index 00d072534e8..c19ba9457cb 100644 --- a/remote-config/remote-config-core/gradle.lockfile +++ b/remote-config/remote-config-core/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :remote-config:remote-config-core:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath @@ -8,12 +9,13 @@ ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath com.google.code.gson:gson:2.13.2=spotbugs com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.jayway.jsonpath:json-path:2.8.0=testCompileClasspath,testRuntimeClasspath com.squareup.moshi:moshi:1.11.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.squareup.okio:okio:1.17.5=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.thoughtworks.qdox:qdox:1.12.1=codenarc @@ -23,8 +25,13 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath +net.javacrumbs.json-unit:json-unit-assertj:2.40.1=testCompileClasspath,testRuntimeClasspath +net.javacrumbs.json-unit:json-unit-core:2.40.1=testCompileClasspath,testRuntimeClasspath +net.javacrumbs.json-unit:json-unit-json-path:2.40.1=testCompileClasspath,testRuntimeClasspath +net.minidev:accessors-smart:2.4.9=testRuntimeClasspath +net.minidev:json-smart:2.4.10=testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -34,6 +41,7 @@ org.apache.commons:commons-text:1.14.0=spotbugs org.apache.logging.log4j:log4j-api:2.25.2=spotbugs org.apache.logging.log4j:log4j-core:2.25.2=spotbugs org.apiguardian:apiguardian-api:1.1.2=testCompileClasspath +org.assertj:assertj-core:3.27.7=testCompileClasspath,testRuntimeClasspath org.codehaus.groovy:groovy-ant:3.0.23=codenarc org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc @@ -46,11 +54,12 @@ org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc +org.hamcrest:hamcrest-core:2.2=testCompileClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -60,19 +69,25 @@ org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntime org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=testCompileClasspath,testRuntimeClasspath -org.mockito:mockito-core:4.4.0=testRuntimeClasspath +org.mockito:mockito-core:4.4.0=testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.3=testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:slf4j-api:1.7.30=compileClasspath,runtimeClasspath -org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.32=testCompileClasspath +org.slf4j:slf4j-api:1.7.36=testRuntimeClasspath org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j org.snakeyaml:snakeyaml-engine:2.9=runtimeClasspath,testRuntimeClasspath diff --git a/remote-config/remote-config-core/src/main/java/datadog/remoteconfig/DefaultConfigurationPoller.java b/remote-config/remote-config-core/src/main/java/datadog/remoteconfig/DefaultConfigurationPoller.java index 61e5fc88d77..76ef06740b7 100644 --- a/remote-config/remote-config-core/src/main/java/datadog/remoteconfig/DefaultConfigurationPoller.java +++ b/remote-config/remote-config-core/src/main/java/datadog/remoteconfig/DefaultConfigurationPoller.java @@ -27,6 +27,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.InterruptedIOException; +import java.nio.channels.ClosedSelectorException; import java.nio.file.Files; import java.time.Duration; import java.time.Instant; @@ -378,7 +379,14 @@ private void handleAgentResponse(ResponseBody body) { fleetResponse = maybeFleetResp.get(); } catch (Exception e) { // no error can be reported, as we don't have the data client.state.targets_version avail - ratelimitedLogger.warn("Error parsing remote config response", e); + if (e instanceof ClosedSelectorException) { + // expected when the selector is closed mid-poll, e.g. during pod shutdown + ratelimitedLogger.warn( + "Error parsing remote config response, which is expected when the selector is closed mid-poll: {}", + e.getMessage()); + } else { + ratelimitedLogger.warn("Error parsing remote config response", e); + } return; } diff --git a/remote-config/remote-config-core/src/test/groovy/datadog/remoteconfig/DefaultConfigurationPollerSpecification.groovy b/remote-config/remote-config-core/src/test/groovy/datadog/remoteconfig/DefaultConfigurationPollerSpecification.groovy deleted file mode 100644 index ae18bd5f839..00000000000 --- a/remote-config/remote-config-core/src/test/groovy/datadog/remoteconfig/DefaultConfigurationPollerSpecification.groovy +++ /dev/null @@ -1,1694 +0,0 @@ -package datadog.remoteconfig - -import cafe.cryptography.ed25519.Ed25519PrivateKey -import cafe.cryptography.ed25519.Ed25519PublicKey -import cafe.cryptography.ed25519.Ed25519Signature -import datadog.remoteconfig.state.ProductListener -import datadog.trace.api.Config -import datadog.trace.test.util.DDSpecification -import datadog.trace.util.AgentTaskScheduler -import groovy.json.JsonOutput -import groovy.json.JsonSlurper -import okhttp3.Call -import okhttp3.HttpUrl -import okhttp3.MediaType -import okhttp3.OkHttpClient -import okhttp3.Protocol -import okhttp3.Request -import okhttp3.RequestBody -import okhttp3.Response -import okhttp3.ResponseBody -import okio.Buffer - -import java.nio.file.Files -import java.security.MessageDigest -import java.security.SecureRandom -import java.time.Duration -import java.util.concurrent.TimeUnit -import java.util.function.Supplier - -import static datadog.remoteconfig.tuf.RemoteConfigRequest.ClientInfo.ClientState.ConfigState.APPLY_STATE_ERROR - -class DefaultConfigurationPollerSpecification extends DDSpecification { - final static HttpUrl URL = HttpUrl.get('https://example.com/v0.7/config') - private static final Request REQUEST = new Request.Builder() - .url('https://example.com').build() - private static final int DEFAULT_POLL_PERIOD = 5000 - private static final String KEY_ID = 'TEST_KEY_ID' - private static final Ed25519PrivateKey PRIVATE_KEY = Ed25519PrivateKey.generate(new SecureRandom()) - private static final Ed25519PublicKey PUBLIC_KEY = PRIVATE_KEY.derivePublic() - - private Response buildOKResponse(String bodyStr) { - ResponseBody body = ResponseBody.create(MediaType.get('application/json'), bodyStr) - new Response.Builder() - .request(REQUEST).protocol(Protocol.HTTP_1_1).message('OK').body(body).code(200).build() - } - - private final static JsonSlurper SLURPER = new JsonSlurper() - - OkHttpClient okHttpClient = Mock() - AgentTaskScheduler scheduler = Mock() - AgentTaskScheduler.Scheduled scheduled = Mock() - DefaultConfigurationPoller poller - - AgentTaskScheduler.Task task - Request request - Call call = Mock() - Supplier configUrlSupplier = { -> URL.toString() } as Supplier - - void setup() { - injectSysConfig('dd.rc.targets.key.id', KEY_ID) - injectSysConfig('dd.rc.targets.key', new BigInteger(1, PUBLIC_KEY.toByteArray()).toString(16)) - injectSysConfig('dd.service', 'my_service') - injectSysConfig('dd.env', 'my_env') - injectSysConfig('dd.remote_config.integrity_check.enabled', 'true') - poller = new DefaultConfigurationPoller( - Config.get(), - '0.0.0', - '', - '', - { -> configUrlSupplier.get() } as Supplier, - okHttpClient, - scheduler, - ) - } - - private parseBody(RequestBody body) { - Buffer buffer = new Buffer() - body.writeTo(buffer) - byte[] bytes = new byte[buffer.size()] - buffer.read(bytes) - SLURPER.parse(bytes) - } - - void 'issues no request if there are no subscriptions'() { - when: - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 0 * _._ - - when: - poller.addListener(Product.ASM_DD, - {throw new RuntimeException('should not be called') } as ConfigurationDeserializer, - { cfg, hinter -> true } as ConfigurationChangesTypedListener) - poller.removeListeners(Product.ASM_DD) - task.run(poller) - - then: - 0 * _._ - - when: - poller.stop() - - then: - 1 * scheduled.cancel() - } - - void 'issues request if there is a subscription'() { - ConfigurationChangesTypedListener listener = Mock() - - when: - poller.addListener(Product.ASM_DD, - { SLURPER.parse(it) } as ConfigurationDeserializer, - listener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(SAMPLE_RESP_BODY) } - 1 * listener.accept(_, _, _ as PollingRateHinter) - 0 * _._ - - def body = parseBody(request.body()) - with(body) { - cached_target_files == null - with(client) { - with(client_tracer) { - app_version == '' - env == 'my_env' - language == 'java' - runtime_id != '' - service == 'my_service' - tracer_version == '0.0.0' - } - id.size() == 36 - is_tracer == true - products == ['ASM_DD'] - with(state) { - config_states == [] - has_error == false - root_version == 1 - targets_version == 0 - } - } - } - } - - void 'issues no request if the config url supplier returns null'() { - setup: - def deserializer = Mock(ConfigurationDeserializer) - def listener = Mock(ConfigurationChangesTypedListener) - configUrlSupplier = { -> } - - when: - poller.addListener(Product.ASM_DD, deserializer, listener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 0 * _._ - } - - void 'once the supplier provides a url it is not called anymore'() { - setup: - def deserializer = Mock(ConfigurationDeserializer) - def listener = Mock(ConfigurationChangesTypedListener) - configUrlSupplier = Mock(Supplier) - - when: - poller.addListener(Product.ASM_DD, deserializer, listener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - 2.times { task.run(poller) } - - then: - 1 * configUrlSupplier.get() >> URL.toString() - 2 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 2 * call.execute() >> { buildOKResponse(SAMPLE_RESP_BODY) } - 1 * deserializer.deserialize(_) >> true - 1 * listener.accept(_, _, _) - 0 * _._ - } - - void 'handle product listeners per config'() { - def deserializer = Mock(ConfigurationDeserializer) - ConfigurationChangesTypedListener activationListener = Mock(ConfigurationChangesTypedListener) - ConfigurationChangesTypedListener sampleRateListener = Mock(ConfigurationChangesTypedListener) - def respBody = JsonOutput.toJson( - client_configs: [ - 'datadog/2/ASM_FEATURES/asm_features_activation/config', - 'datadog/2/ASM_FEATURES/api_security/sample_rate', - ], - roots: [], - target_files: [ - [ - path: 'datadog/2/ASM_FEATURES/asm_features_activation/config', - raw: Base64.encoder.encodeToString('{"asm":{"enabled":true}}'.getBytes('UTF-8')) - ], - [ - path: 'datadog/2/ASM_FEATURES/api_security/sample_rate', - raw: Base64.encoder.encodeToString('{"api_security": {"request_sample_rate": 0.1}'.getBytes('UTF-8')) - ] - ], - targets: signAndBase64EncodeTargets( - signed: [ - expires: '2022-09-17T12:49:15Z', - spec_version: '1.0.0', - targets: [ - 'datadog/2/ASM_FEATURES/asm_features_activation/config': [ - custom: [ v: 1 ], - hashes: [ sha256: '159658ab85be7207761a4111172b01558394bfc74a1fe1d314f2023f7c656db' ], - length : 24, - ], - 'datadog/2/ASM_FEATURES/api_security/sample_rate': [ - custom: [v:1], - hashes: [ sha256: 'bc898b7eb75d9fd0ddee1c1a556bc3c528dd41382950aa86e48816f792d01494' ], - length : 45, - ] - ], - version: 1 - ] - )) - - def noConfigs = SLURPER.parse(SAMPLE_RESP_BODY.bytes).with { - it['client_configs'] = [] - JsonOutput.toJson(it) - } - - when: - poller.addListener(Product.ASM_FEATURES, 'asm_features_activation', deserializer, activationListener) - poller.addListener(Product.ASM_FEATURES, 'api_security', deserializer, sampleRateListener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(respBody) } - - then: - 2 * deserializer.deserialize(_) >> true - 1 * activationListener.accept('datadog/2/ASM_FEATURES/asm_features_activation/config', _, _) - 1 * sampleRateListener.accept('datadog/2/ASM_FEATURES/api_security/sample_rate', _, _) - 0 * _._ - - //remove all configurations - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(noConfigs) } - 1 * activationListener.accept('datadog/2/ASM_FEATURES/asm_features_activation/config', _, _) - 1 * sampleRateListener.accept('datadog/2/ASM_FEATURES/api_security/sample_rate', _, _) - 0 * _._ - } - - void 'processing happens for all listeners'() { - def deserializer = Mock(ConfigurationDeserializer) - List listeners = (1..5).collect { Mock(ConfigurationChangesTypedListener) } - def respBody = JsonOutput.toJson( - client_configs: [ - 'datadog/2/ASM_FEATURES/asm_features_activation/config', - 'foo/ASM_DD/bar/config', - 'foo/ASM/bar/config', - 'foo/ASM_DATA/bar/config', - 'foo/LIVE_DEBUGGING/bar/config', - ], - roots: [], - target_files: [ - [ - path: 'datadog/2/ASM_FEATURES/asm_features_activation/config', - raw: Base64.encoder.encodeToString('{"asm":{"enabled":true}}'.getBytes('UTF-8')) - ], - [ - path: 'foo/ASM_DD/bar/config', - raw: '' - ], - [ - path: 'foo/ASM/bar/config', - raw: '' - ], - [ - path: 'foo/ASM_DATA/bar/config', - raw: '' - ], - [ - path: 'foo/LIVE_DEBUGGING/bar/config', - raw: '' - ], - ], - targets: signAndBase64EncodeTargets( - signed: [ - expires: '2022-09-17T12:49:15Z', - spec_version: '1.0.0', - targets: [ - 'datadog/2/ASM_FEATURES/asm_features_activation/config': [ - custom: [ v: 1 ], - hashes: [ sha256: '159658ab85be7207761a4111172b01558394bfc74a1fe1d314f2023f7c656db' ], - length : 24, - ], - 'foo/ASM_DD/bar/config': [ - custom: [v:1], - hashes: [ sha256: 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' ], - length : 0, - ], - 'foo/ASM/bar/config': [ - custom: [v:1], - hashes: [ sha256: 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' ], - length : 0, - ], - 'foo/ASM_DATA/bar/config': [ - custom: [v:1], - hashes: [ sha256: 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' ], - length : 0, - ], - 'foo/LIVE_DEBUGGING/bar/config': [ - custom: [v:1], - hashes: [ sha256: 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855' ], - length : 0, - ], - ], - version: 1 - ] - )) - - when: - poller.addListener(Product.ASM_DD, deserializer, listeners[1]) - poller.addListener(Product.ASM, deserializer, listeners[2]) - poller.addListener(Product.ASM_DATA, deserializer, listeners[3]) - poller.addListener(Product.LIVE_DEBUGGING, deserializer, listeners[0]) - poller.addListener(Product.ASM_FEATURES, deserializer, listeners[4]) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(respBody) } - - then: - 1 * deserializer.deserialize(_) >> true - 1 * listeners[0].accept(*_) - 1 * deserializer.deserialize(_) >> true - 1 * listeners[1].accept(*_) - 1 * deserializer.deserialize(_) >> true - 1 * listeners[2].accept(*_) - 1 * deserializer.deserialize(_) >> true - 1 * listeners[3].accept(*_) - 1 * deserializer.deserialize(_) >> true - 1 * listeners[4].accept(*_) - - then: - 0 * _ - } - - void 'reschedules if instructed to do so'() { - when: - poller.addListener(Product.ASM_DD, - { SLURPER.parse(it) } as ConfigurationDeserializer, { cngKey, cfg, hinter -> - hinter.suggestPollingRate(Duration.ofMillis(124)) - hinter.suggestPollingRate(Duration.ofMillis(123)) - hinter.suggestPollingRate(Duration.ofMillis(1230)) // higher is ignored - } as ConfigurationChangesTypedListener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(SAMPLE_RESP_BODY) } - 1 * scheduler.scheduleAtFixedRate(_, poller, 123, 123, TimeUnit.MILLISECONDS) >> scheduled - 1 * scheduled.cancel() - 0 * _._ - } - - void 'sets cached files and config state on second request'() { - when: - poller.addListener(Product.ASM_DD, - { SLURPER.parse(it) } as ConfigurationDeserializer, - { Object[] args -> } as ConfigurationChangesTypedListener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - 2.times { task.run(poller) } - - then: - 2 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 2 * call.execute() >> { buildOKResponse(SAMPLE_RESP_BODY) } - 0 * _._ - - then: - def body = parseBody(request.body()) - with(body) { - cached_target_files.size() == 1 - with(cached_target_files[0]) { - hashes == [ - [ - algorithm: 'sha256', - hash: '6302258236e6051216b950583ec7136d946b463c17cbe64384ba5d566324819' - ] - ] - length == 919 - path == 'employee/ASM_DD/1.recommended.json/config' - } - - client.state.backend_client_state == 'foobar' - - client.state.config_states.size() == 1 - with(client.state.config_states[0]) { - id == '1.recommended.json' - product == 'ASM_DD' - version == 1 - } - } - } - - void 'removes cached file if configuration is pulled'() { - when: - poller.addListener(Product.ASM_DD, - { SLURPER.parse(it) } as ConfigurationDeserializer, - { Object[] args -> } as ConfigurationChangesTypedListener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { call } - 1 * call.execute() >> { buildOKResponse(SAMPLE_RESP_BODY) } - 0 * _._ - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { call } - 1 * call.execute() >> { - SLURPER.parse(SAMPLE_RESP_BODY.bytes).with { - it['client_configs'] = [] - buildOKResponse(JsonOutput.toJson(it)) - } - } - 0 * _._ - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(SAMPLE_RESP_BODY) } - 0 * _._ - - then: - def body = parseBody(request.body()) - with(body) { - cached_target_files == null - } - } - - void 'does not update targets version number if there is an error'() { - when: - poller.addListener(Product.ASM_DD, - { SLURPER.parse(it) } as ConfigurationDeserializer, - { Object[] args -> } as ConfigurationChangesTypedListener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { call } - 1 * call.execute() >> { buildOKResponse(SAMPLE_RESP_BODY) } - 0 * _._ - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { call } - 1 * call.execute() >> { - SLURPER.parse(SAMPLE_RESP_BODY.bytes).with { - it['target_files'] = [] - def targetDecoded = Base64.decoder.decode(it['targets']) - Map target = SLURPER.parse(targetDecoded) - target['signed']['targets'].remove('employee/ASM_DD/1.recommended.json/config') - target['signed']['version'] = 42 - it['targets'] = signAndBase64EncodeTargets(target) - buildOKResponse(JsonOutput.toJson(it)) - } - } - 0 * _._ - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(SAMPLE_RESP_BODY) } - 0 * _._ - - then: - def body = parseBody(request.body()) - with(body) { - cached_target_files == null // previous hash should be cleared too - with(client['state']) { - backend_client_state == 'foobar' - config_states == [] - has_error == true - error == 'Told to apply config for employee/ASM_DD/1.recommended.json/config but no corresponding entry ' + - 'exists in targets.targets_signed.targets' - root_version == 1 - targets_version == 23337393 - } - } - } - - void 'applies configuration only if the hash has changed'() { - ConfigurationChangesTypedListener listener = Mock() - - when: - poller.addListener(Product.ASM_DD, - { SLURPER.parse(it) } as ConfigurationDeserializer, - listener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - 2.times { task.run(poller) } - - then: - 2 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 2 * call.execute() >> { buildOKResponse(SAMPLE_RESP_BODY) } - 1 * listener.accept(_, _, _ as PollingRateHinter) - 0 * _._ - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { - SLURPER.parse(SAMPLE_RESP_BODY.bytes).with { - byte[] fileDecoded = Base64.decoder.decode(it['target_files'][0]['raw']) - byte[] newFile = new byte[fileDecoded.length + 1] - System.arraycopy(fileDecoded, 0, newFile, 0, fileDecoded.length) - newFile[fileDecoded.length] = '\n' - it['target_files'][0]['raw'] = Base64.encoder.encodeToString(newFile) - def targetDecoded = Base64.decoder.decode(it['targets']) - def target = SLURPER.parse(targetDecoded) - target['signed']['targets']['employee/ASM_DD/1.recommended.json/config']['hashes']['sha256'] = - new BigInteger((byte[])MessageDigest.getInstance('SHA-256').digest(newFile)).toString(16) - target['signed']['targets']['employee/ASM_DD/1.recommended.json/config']['length'] += 1 - it['targets'] = signAndBase64EncodeTargets(target) - buildOKResponse(JsonOutput.toJson(it)) - } - } - 1 * listener.accept('employee/ASM_DD/1.recommended.json/config', _, _ as PollingRateHinter) - 0 * _._ - } - - void 'configuration cannot be applied without hashes'() { - ConfigurationChangesTypedListener listener = Mock() - - when: - poller.addListener(Product.ASM_DD, - { SLURPER.parse(it) } as ConfigurationDeserializer, - listener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { - task = it[0] - scheduled - } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { - SLURPER.parse(SAMPLE_RESP_BODY.bytes).with { - def targetDecoded = Base64.decoder.decode(it['targets']) - def target = SLURPER.parse(targetDecoded) - target['signed']['targets']['employee/ASM_DD/1.recommended.json/config']['hashes'].remove('sha256') - it['targets'] = signAndBase64EncodeTargets(target) - buildOKResponse(JsonOutput.toJson(it)) - } - } - 0 * _._ - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(SAMPLE_RESP_BODY) } - 1 * listener.accept('employee/ASM_DD/1.recommended.json/config', _, _) - 0 * _._ - - then: - def body = parseBody(request.body()) - with(body.client.state) { - config_states.size() == 0 - error == 'No sha256 hash present for employee/ASM_DD/1.recommended.json/config' - targets_version == 0 - } - } - - void 'encoded file is not valid base64 data'() { - ConfigurationChangesTypedListener listener = Mock() - - when: - poller.addListener(Product.ASM_DD, - { SLURPER.parse(it) } as ConfigurationDeserializer, - listener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { - SLURPER.parse(SAMPLE_RESP_BODY.bytes).with { - byte[] fileDecoded = Base64.decoder.decode(it['target_files'][0]['raw']) - it['target_files'][0]['raw'] = Base64.encoder.encodeToString(fileDecoded) + '##' - buildOKResponse(JsonOutput.toJson(it)) - } - } - 0 * _._ - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(SAMPLE_RESP_BODY) } - 1 * listener.accept(_, _, _) - 0 * _._ - - then: - def body = parseBody(request.body()) - with(body.client.state) { - error == 'Could not get file contents from remote config, file employee/ASM_DD/1.recommended.json/config' - } - } - - void 'deserializer can return null to indicate no config should be applied'() { - ConfigurationChangesTypedListener listener = Mock() - - when: - poller.addListener(Product.ASM_DD, - { null } as ConfigurationDeserializer, - listener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(SAMPLE_RESP_BODY) } - 0 * _._ - } - - void 'rejects configuration if the hash is wrong'() { - ConfigurationChangesTypedListener listener = Mock() - - when: - poller.addListener(Product.ASM_DD, - { SLURPER.parse(it) } as ConfigurationDeserializer, - listener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { - SLURPER.parse(SAMPLE_RESP_BODY.bytes).with { - def targetDecoded = Base64.decoder.decode(it['targets']) - def target = SLURPER.parse(targetDecoded) - target['signed']['targets']['employee/ASM_DD/1.recommended.json/config']['hashes']['sha256'] = '0' - it['targets'] = signAndBase64EncodeTargets(target) - buildOKResponse(JsonOutput.toJson(it)) - } - } - 0 * _._ - } - - void 'accepts an empty object as a response to indicate no changes'() { - given: - def listener = Mock(ConfigurationChangesTypedListener) - def deserializer = Mock(ConfigurationDeserializer) - - when: - poller.addListener(Product.ASM_DD, deserializer, listener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse('{}') } - 0 * deserializer._ - 0 * listener._ - 0 * _._ - } - - void 'accepts HTTP 204 as a response to indicate no changes'() { - given: - Response resp = new Response.Builder() - .request(REQUEST) - .protocol(Protocol.HTTP_1_1) - .message('No Content') - .body(ResponseBody.create(MediaType.parse("application/json"), "")) - .code(204) - .build() - def listener = Mock(ConfigurationChangesTypedListener) - def deserializer = Mock(ConfigurationDeserializer) - - when: - poller.addListener(Product.ASM_DD, deserializer, listener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> resp - 0 * deserializer._ - 0 * listener._ - 0 * _ - } - - void 'applies and remove called for product listener'() { - ProductListener listener = Mock() - String cfgWithoutAsm = SLURPER.parse(SAMPLE_RESP_BODY.bytes).with { - it['client_configs'] = [] - def targetDecoded = Base64.decoder.decode(it['targets']) - def target = SLURPER.parse(targetDecoded) - target['signed']['targets']['employee/ASM_DD/1.recommended.json/config']['hashes']['sha256'] = 'aec070645fe53ee3b3763059376134f058cc337247c978add178b6ccdfb0019f' - it['targets'] = signAndBase64EncodeTargets(target) - JsonOutput.toJson(it) - } - - when: - poller.addListener(Product.ASM_DD, listener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(SAMPLE_RESP_BODY) } - 1 * listener.accept(_, { it != null }, _) >> false - 1 * listener.commit(_) - 0 * _._ - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(SAMPLE_RESP_BODY) } - // no listnenr.commit() should be called as no changed where detected - 0 * _._ - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(cfgWithoutAsm) } - 1 * listener.remove(_, _) - 1 * listener.commit(_) - 0 * _._ - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(cfgWithoutAsm) } - // no listnenr.commit() should be called as no changed where detected - 0 * _._ - } - - void 'unapplies configurations it has stopped seeing'() { - ConfigurationChangesTypedListener> listener = Mock() - String cfgWithoutAsm = SLURPER.parse(SAMPLE_RESP_BODY.bytes).with { - it['client_configs'] = [] - def targetDecoded = Base64.decoder.decode(it['targets']) - def target = SLURPER.parse(targetDecoded) - target['signed']['targets']['employee/ASM_DD/1.recommended.json/config']['hashes']['sha256'] = 'aec070645fe53ee3b3763059376134f058cc337247c978add178b6ccdfb0019f' - it['targets'] = signAndBase64EncodeTargets(target) - JsonOutput.toJson(it) - } - - when: - poller.addListener(Product.ASM_DD, - { SLURPER.parse(it) } as ConfigurationDeserializer, - listener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(SAMPLE_RESP_BODY) } - 1 * listener.accept(_, { it != null }, _) >> false // should still unapply afterwards even if failed - 0 * _._ - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(cfgWithoutAsm) } - 1 * listener.accept(_, null, _) - 0 * _._ - - // the next time it doesn't unapply it - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(cfgWithoutAsm) } - 0 * _._ - } - - void 'support multiple configurations'() { - ConfigurationChangesTypedListener> listener = Mock() - String multiConfigs = SLURPER.parse(SAMPLE_RESP_BODY.bytes).with { - it['client_configs'] = ['employee/ASM_DD/1.recommended.json/config', 'employee/ASM_DD/2.suggested.json/config'] - JsonOutput.toJson(it) - } - - String noConfigs = SLURPER.parse(SAMPLE_RESP_BODY.bytes).with { - it['client_configs'] = [] - JsonOutput.toJson(it) - } - - when: - poller.addListener(Product.ASM_DD, - { SLURPER.parse(it) } as ConfigurationDeserializer, - listener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - //apply first configuration - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(SAMPLE_RESP_BODY) } - 1 * listener.accept('employee/ASM_DD/1.recommended.json/config', { it != null }, _) >> false // should still unapply afterwards even if failed - 0 * _._ - - // apply second configuration - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(multiConfigs) } - 1 * listener.accept('employee/ASM_DD/2.suggested.json/config', { it != null }, _) - 0 * _._ - - //remove second configuration if it no longer sent - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(SAMPLE_RESP_BODY) } - 1 * listener.accept('employee/ASM_DD/2.suggested.json/config', null, _) >> false // should still unapply afterwards even if failed - 0 * _._ - - //remove all configurations - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(noConfigs) } - 1 * listener.accept('employee/ASM_DD/1.recommended.json/config', null, _) >> false // should still unapply afterwards even if failed - 0 * _._ - } - - void 'exception applying one config should not prevent others from being applied'() { - String newConfigId = '1ba66cc9-146a-3479-9e66-2b63fd580f48' - String newConfigKey = "datadog/2/LIVE_DEBUGGING/${newConfigId}/config" - - when: - poller.addListener(Product.ASM_DD, - { SLURPER.parse(it) } as ConfigurationDeserializer, - { Object[] args -> throw new RuntimeException('throw here') } as ConfigurationChangesTypedListener) - poller.addListener(Product.LIVE_DEBUGGING, - { SLURPER.parse(it) } as ConfigurationDeserializer, - { Object[] args -> } as ConfigurationChangesTypedListener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { - SLURPER.parseText(SAMPLE_RESP_BODY).with { - it['client_configs'] << newConfigKey - def targetDecoded = Base64.decoder.decode(it['targets']) - def target = SLURPER.parse(targetDecoded) - target['signed']['targets'][newConfigKey] = [ - custom: [v: 3], - hashes: [ - sha256: '7a38bf81f383f69433ad6e900d35b3e2385593f76a7b7ab5d4355b8ba41ee24b', - ], - length: '{"foo":"bar"}'.size(), - ] - it['target_files'] << [ - path: newConfigKey, - raw: Base64.encoder.encodeToString('{"foo":"bar"}'.getBytes('UTF-8')) - ] - - it['targets'] = signAndBase64EncodeTargets(target) - buildOKResponse(JsonOutput.toJson(it)) - } - } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(SAMPLE_RESP_BODY) } - 0 * _._ - - then: - def body = parseBody(request.body()) - with(body) { - client.state.config_states.size() == 2 - def first = client.state.config_states[0] - def second = client.state.config_states[1] - def liveDebuggingConfig = first.product == 'LIVE_DEBUGGING'? first : second - def asmConfig = first.product == 'ASM_DD'? first : second - with(liveDebuggingConfig) { - id == newConfigId - product == 'LIVE_DEBUGGING' - version == 3 - apply_error == null - } - with(asmConfig) { - id == '1.recommended.json' - product == 'ASM_DD' - version == 1 - apply_state == APPLY_STATE_ERROR - apply_error == "throw here" - } - } - } - - void 'bad responses'() { - when: - poller.addListener(Product.ASM_DD, - { throw new RuntimeException('should not be called') } as ConfigurationDeserializer, - { } as ConfigurationChangesTypedListener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> resp - 0 * _._ - - where: - resp << [ - // 404 with body - new Response.Builder().request(REQUEST) - .protocol(Protocol.HTTP_1_1) - .message('Not Found').code(404).body( - ResponseBody.create(MediaType.get('text/plain'), 'not found!')).build(), - // 404 without body - new Response.Builder().request(REQUEST) - .protocol(Protocol.HTTP_1_1) - .message('Not Found').code(404).build(), - // success, no body - new Response.Builder().request(REQUEST) - .protocol(Protocol.HTTP_1_1) - .message('Created').code(201).build(), - // not json - new Response.Builder() - .request(REQUEST).protocol(Protocol.HTTP_1_1).message('OK').body(ResponseBody.create(MediaType.get('text/plain'), SAMPLE_RESP_BODY)).code(200).build() - ] - } - - void 'body does not satisfy format'() { - when: - poller.addListener(Product.ASM_DD, - { throw new RuntimeException('should not be called') } as ConfigurationDeserializer, - { } as ConfigurationChangesTypedListener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - // targets is not a string - 1 * call.execute() >> { buildOKResponse(bodyStr) } - 0 * _._ - - where: - bodyStr << [ - '{"targets": []}', - '{"targets": "ZZZZ="}', - """{"targets": "${Base64.encoder.encodeToString('{"signed": "string"}'.getBytes('UTF-8'))}"}""" - ] - } - - void 'reportable errors #errorMsg'() { - when: - poller.addListener(Product.ASM_DD, - { throw new RuntimeException('should not be called') } as ConfigurationDeserializer, - { } as ConfigurationChangesTypedListener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - // targets is not a string - 1 * call.execute() >> { buildOKResponse(bodyStr) } - 0 * _._ - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - // targets is not a string - 1 * call.execute() >> { buildOKResponse(SAMPLE_RESP_BODY) } - 0 * _._ - - def body = parseBody(request.body()) - with(body) { - client.state.config_states == [] - with(client.state) { - has_error == true - error == errorMsg - } - } - - where: - bodyStr | errorMsg - // not a valid key - SLURPER.parse(SAMPLE_RESP_BODY.bytes).with { - it['client_configs'][0] = 'foobar' - JsonOutput.toJson(it) - } | 'Not a valid config key: foobar' - - // no file for the given key - SLURPER.parse(SAMPLE_RESP_BODY.bytes).with { - it['target_files'] = [] - JsonOutput.toJson(it) - } | 'No content for employee/ASM_DD/1.recommended.json/config' - - // two reportable errors - SLURPER.parse(SAMPLE_RESP_BODY.bytes).with { - it['client_configs'] = ['foobar', 'employee/ASM_DD/1.recommended.json/config'] - it['target_files'] = [] - JsonOutput.toJson(it) - } | 'Failed to apply configuration due to 2 errors:\n (1) Not a valid config key: foobar\n (2) No content for employee/ASM_DD/1.recommended.json/config\n' - - // in target_files, but not targets.signed.targets - SLURPER.parse(SAMPLE_RESP_BODY.bytes).with { - def targetDecoded = Base64.decoder.decode(it['targets']) - Map targets = SLURPER.parse(targetDecoded) - targets['signed']['targets'] = [:] - it['targets'] = signAndBase64EncodeTargets(targets) - JsonOutput.toJson(it) - } | 'Path employee/ASM_DD/1.recommended.json/config is in target_files, but not in targets.signed' - - // told to apply config that is not subscribed - SLURPER.parse(SAMPLE_RESP_BODY.bytes).with { - it['client_configs'] = ['datadog/2/LIVE_DEBUGGING/1ba66cc9-146a-3479-9e66-2b63fd580f48/config'] - JsonOutput.toJson(it) - } | 'Told to handle config key datadog/2/LIVE_DEBUGGING/1ba66cc9-146a-3479-9e66-2b63fd580f48/config, but the product LIVE_DEBUGGING is not being handled' - - // Invalid signature - SLURPER.parse(SAMPLE_RESP_BODY.bytes).with { - def targetDecoded = Base64.decoder.decode(it['targets']) - Map targets = SLURPER.parse(targetDecoded) - targets['signatures'][0]['sig'] = '59a6478aba87d171261e6995faaa8e36c95c3e75436c4e82f11ac625220e13b703ce9b912ee0731415121b5a47aa2abdb398a60656b7701b15e606c6327c880e' - it['targets'] = Base64.encoder.encodeToString(JsonOutput.toJson(targets).getBytes('UTF-8')) - JsonOutput.toJson(it) - } | 'Signature verification failed for targets.signed. Key id: TEST_KEY_ID' - - // Structurally invalid signature - SLURPER.parse(SAMPLE_RESP_BODY.bytes).with { - def targetDecoded = Base64.decoder.decode(it['targets']) - Map targets = SLURPER.parse(targetDecoded) - targets['signatures'][0]['sig'] = 'a' * 128 - it['targets'] = Base64.encoder.encodeToString(JsonOutput.toJson(targets).getBytes('UTF-8')) - JsonOutput.toJson(it) - } | 'Error reading signature or canonicalizing targets.signed: Invalid scalar representation' - } - - void 'reports error during deserialization'() { - when: - poller.addListener(Product.ASM_DD, - { throw new RuntimeException('my deserializer error') } as ConfigurationDeserializer, - { } as ConfigurationChangesTypedListener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { - task = it[0] - scheduled - } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> call - 1 * call.execute() >> { buildOKResponse(SAMPLE_RESP_BODY) } - 0 * _._ - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(SAMPLE_RESP_BODY) } - 0 * _._ - - def body = parseBody(request.body()) - with(body) { - with(client.state.config_states.first()) { - apply_state == APPLY_STATE_ERROR - apply_error == 'my deserializer error' - } - } - } - - void 'reports error applying configuration'() { - when: - poller.addListener(Product.ASM_DD, - { true } as ConfigurationDeserializer, - { Object[] args -> throw new RuntimeException('error applying config') } as ConfigurationChangesTypedListener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { - task = it[0] - scheduled - } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> call - 1 * call.execute() >> { buildOKResponse(SAMPLE_RESP_BODY) } - 0 * _._ - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(SAMPLE_RESP_BODY) } - 0 * _._ - - def body = parseBody(request.body()) - with(body) { - with(client.state.config_states.first()) { - apply_state == APPLY_STATE_ERROR - apply_error == 'error applying config' - } - } - } - - void 'the max size is exceeded'() { - ConfigurationDeserializer deserializer = Mock() - when: - poller.addListener(Product.ASM_DD, - deserializer, - { throw new RuntimeException('throw here') } as ConfigurationChangesTypedListener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { - SLURPER.parseText(SAMPLE_RESP_BODY).with { - it['target_files'] << [ - path: 'foo/bar', - raw: 'a' * Config.get().remoteConfigMaxPayloadSizeBytes - ] - buildOKResponse(JsonOutput.toJson(it)) - } - } - 0 * _._ - } - - void 'can listen for changes in a local file'() { - File file = Files.createTempFile(null, '.json').toFile() - def savedConf - - when: - poller.addFileListener(file, - { SLURPER.parse(it) } as ConfigurationDeserializer, - { path, conf, hinter -> savedConf = conf } as ConfigurationChangesTypedListener) - poller.start() - file << '{"foo":"bar"}'.getBytes('UTF-8') - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - savedConf['foo'] == 'bar' - 0 * _._ - - when: - file.delete() - file << '{"foo":"xpto"}'.getBytes('UTF-8') - task.run(poller) - - then: - savedConf['foo'] == 'xpto' - 0 * _._ - - cleanup: - file.delete() - } - - void 'distributes features'() { - ConfigurationChangesTypedListener listener = Mock() - - when: - poller.addListener(Product.ASM_FEATURES, - { SLURPER.parse(it) } as ConfigurationDeserializer, - listener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(FEATURES_RESP_BODY) } - 1 * listener.accept( - _, - { cfg -> cfg['asm']['enabled'] == true }, - _ as PollingRateHinter) - 0 * _._ - } - - void 'distributes features upon subscribing'() { - ConfigurationChangesTypedListener listener = Mock() - - when: - poller.addListener(Product.ASM_FEATURES, - { throw new RuntimeException('should not be called') } as ConfigurationDeserializer, - { Object[] args -> throw new RuntimeException('should not be called') } as ConfigurationChangesTypedListener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - and: - poller.removeListeners(Product.ASM_FEATURES) - - when: - poller.addListener(Product.ASM_FEATURES, - { SLURPER.parse(it) } as ConfigurationDeserializer, - listener) - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(FEATURES_RESP_BODY) } - 1 * listener.accept( - _, - { cfg -> cfg['asm']['enabled'] == true }, - _ as PollingRateHinter) - 0 * _._ - } - - void 'distribute config across multiple listeners for same subscriber'() { - ConfigurationChangesTypedListener listener1 = Mock() - ConfigurationChangesTypedListener listener2 = Mock() - - when: - poller.addListener(Product.ASM_FEATURES, - { SLURPER.parse(it) } as ConfigurationDeserializer, - listener1) - poller.addListener(Product.ASM_FEATURES, - { SLURPER.parse(it) } as ConfigurationDeserializer, - listener2) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(FEATURES_RESP_BODY) } - 1 * listener1.accept( - _, - { cfg -> cfg['asm']['enabled'] == true }, - _ as PollingRateHinter) - 1 * listener2.accept( - _, - { cfg -> cfg['api_security']['request_sample_rate'] == 0.1 }, - _ as PollingRateHinter) - 0 * _._ - } - - void 'error applying features'() { - boolean called - - when: - poller.addListener(Product.ASM_FEATURES, - {true } as ConfigurationDeserializer, - { Object[] args -> called = true; throw new RuntimeException('throws') } as ConfigurationChangesTypedListener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(FEATURES_RESP_BODY) } - 0 * _._ - called == true - // error does not escape - } - - void 'removing feature listeners'() { - ConfigurationChangesTypedListener listener = Mock() - - when: - poller.addListener(Product._UNKNOWN, - { throw new RuntimeException('should not be called') } as ConfigurationDeserializer, - { Object[] args -> throw new RuntimeException('should not be called') } as ConfigurationChangesTypedListener) - poller.addListener(Product.ASM_FEATURES, - {} as ConfigurationDeserializer, - listener) - poller.removeListeners(Product.ASM_FEATURES) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(FEATURES_RESP_BODY) } - 0 * _._ // in particular, listener is not called - - when: - poller.removeListeners(Product._UNKNOWN) - task.run(poller) - - then: - 0 * _._ // not even a request is made - } - - void 'check setting of capabilities negative test'() { - ConfigurationChangesTypedListener listener = Mock() - - when: - poller.addListener(Product._UNKNOWN, - {true } as ConfigurationDeserializer, - listener) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(FEATURES_RESP_BODY) } - 0 * _._ - def body = parseBody(request.body()) - with(body.client) { - capabilities[0] == 0 - } - } - - private static String signAndBase64EncodeTargets(Map targets) { - Map targetsSigned = targets['signed'] - if (targetsSigned) { - byte[] canonicalTargetsSigned = JsonCanonicalizer.canonicalize(targetsSigned) - Ed25519Signature signature = PRIVATE_KEY.expand().sign(canonicalTargetsSigned, PUBLIC_KEY) - String sigBase16 = new BigInteger(1, signature.toByteArray()).toString(16) - targets['signatures'] = [[ - keyid: KEY_ID, - sig : sigBase16, - ]] - } - - Base64.encoder.encodeToString(JsonOutput.toJson(targets).getBytes('UTF-8')) - } - - private static String signAndBase64EncodeTargets(String targetsJson) { - Map targets = SLURPER.parse(targetsJson.getBytes('UTF-8')) - signAndBase64EncodeTargets(targets) - } - - - void 'check setting of capabilities positive test #capabilities'() { - setup: - ConfigurationDeserializer deserializer = { true } as ConfigurationDeserializer - ConfigurationChangesTypedListener listener = { Object[] args -> } as ConfigurationChangesTypedListener - - when: - poller.addListener(Product._UNKNOWN, deserializer, listener) - poller.addCapabilities(capabilities) - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(FEATURES_RESP_BODY) } - 0 * _._ - def body = parseBody(request.body()) - body.client.capabilities as byte[] == encoded - - where: - capabilities | encoded - 0 | [0] as byte[] - 14L | [14] as byte[] - 1 << 8 | [1, 0] as byte[] - 1 << 9 | [2, 0] as byte[] - -9223372036854775807L | [128, 0, 0, 0, 0, 0, 0, 1] as byte[] - } - - private static final String SAMPLE_RESP_BODY = """ -{ - "client_configs" : [ - "employee/ASM_DD/1.recommended.json/config" - ], - "roots" : [], - "target_files" : [ - { - "path" : "employee/ASM_DD/1.recommended.json/config", - "raw" : "${Base64.encoder.encodeToString(SAMPLE_APPSEC_CONFIG.getBytes('UTF-8'))}" - }, - { - "path" : "employee/ASM_DD/2.suggested.json/config", - "raw" : "${Base64.encoder.encodeToString(SAMPLE_APPSEC_CONFIG.getBytes('UTF-8'))}" - } - ], - "targets" : "${signAndBase64EncodeTargets(SAMPLE_TARGETS)}" -} - """ - - private static final String SAMPLE_APPSEC_CONFIG = ''' -{ - "version": "2.2", - "metadata": { - "rules_version": "1.3.1" - }, - "rules": [ - { - "id": "crs-913-110", - "name": "Acunetix", - "tags": { - "type": "security_scanner", - "crs_id": "913110", - "category": "attack_attempt" - }, - "conditions": [ - { - "parameters": { - "inputs": [ - { - "address": "server.request.headers.no_cookies" - } - ], - "list": [ - "acunetix-product" - ] - }, - "operator": "phrase_match" - } - ], - "transformers": [ - "lowercase" - ] - } - ] -} -''' - - private static final String SAMPLE_TARGETS = ''' -{ - "signatures" : [ - { - "keyid" : "5c4ece41241a1bb513f6e3e5df74ab7d5183dfffbd71bfd43127920d880569fd", - "sig" : "766871ed1acc60ef35f9f24262682283a55e79334f5154486176033b67568aed82fe8139a1f78689b96473537f0a2e55c8365d50bff345ea9ac350d57b90390d" - } - ], - "signed" : { - "_type" : "targets", - "custom" : { - "opaque_backend_state" : "foobar" - }, - "expires" : "2022-09-17T12:49:15Z", - "spec_version" : "1.0.0", - "targets" : { - "employee/ASM_DD/1.recommended.json/config" : { - "custom" : { - "v" : 1 - }, - "hashes" : { - "sha256" : "6302258236e6051216b950583ec7136d946b463c17cbe64384ba5d566324819" - }, - "length" : 919 - }, - "employee/ASM_DD/2.suggested.json/config" : { - "custom" : { - "v" : 1 - }, - "hashes" : { - "sha256" : "6302258236e6051216b950583ec7136d946b463c17cbe64384ba5d566324819" - }, - "length" : 919 - }, - "employee/CWS_DD/2.default.policy/config" : { - "custom" : { - "v" : 2 - }, - "hashes" : { - "sha256" : "2f075fcaa9bdfc96bfc30d5a18711fbebf59d2cb3f3b5258d41ebdc1b1a54569" - }, - "length" : 34805 - } - }, - "version" : 23337393 - } -} -''' - - private static final FEATURES_RESP_BODY = JsonOutput.toJson( - client_configs: ['datadog/2/ASM_FEATURES/asm_features_activation/config'], - roots: [], - target_files: [ - [ - path: 'datadog/2/ASM_FEATURES/asm_features_activation/config', - raw: Base64.encoder.encodeToString('{"asm":{"enabled":true},"api_security":{"request_sample_rate":0.1}}'.getBytes('UTF-8')) - ] - ], - targets: signAndBase64EncodeTargets( - signed: [ - expires: '2022-09-17T12:49:15Z', - spec_version: '1.0.0', - targets: [ - 'datadog/2/ASM_FEATURES/asm_features_activation/config': [ - custom: [ - v: 1 - ], - hashes: [ - sha256: 'b01cb68f140fbfb7a2bb0ce39a473aa59c33664aca0c871cf07b8f4e09e3e360' - ], - length : 67, - ] - ], - version: 23337393 - ] - )) -} diff --git a/remote-config/remote-config-core/src/test/groovy/datadog/remoteconfig/JsonCanonicalizerTests.groovy b/remote-config/remote-config-core/src/test/groovy/datadog/remoteconfig/JsonCanonicalizerTests.groovy deleted file mode 100644 index ed8013a20b6..00000000000 --- a/remote-config/remote-config-core/src/test/groovy/datadog/remoteconfig/JsonCanonicalizerTests.groovy +++ /dev/null @@ -1,26 +0,0 @@ -package datadog.remoteconfig - -import spock.lang.Specification - -import java.nio.charset.StandardCharsets - -class JsonCanonicalizerTests extends Specification { - void 'map keys are reordered'() { - expect: - new String(JsonCanonicalizer.canonicalize(b: true, c: null, a: false,), StandardCharsets.UTF_8) == - '{"a":false,"b":true,"c":null}' - } - - void 'utf-8 encoding'() { - def str = '\u0000\u0080\u0800\uDBC0\uDC00' - expect: - new String(JsonCanonicalizer.canonicalize(a: str), StandardCharsets.UTF_8) == - '{"a":"' + str + '"}' - } - - void 'serialize numbers'() { - expect: - new String(JsonCanonicalizer.canonicalize(a: [-4, -4.5, 92233720368547758075G, Long.MAX_VALUE]), StandardCharsets.UTF_8) == - '{"a":[-4,-4,-5,9223372036854775807]}' - } -} diff --git a/remote-config/remote-config-core/src/test/groovy/datadog/remoteconfig/PollerRequestFactoryTest.groovy b/remote-config/remote-config-core/src/test/groovy/datadog/remoteconfig/PollerRequestFactoryTest.groovy deleted file mode 100644 index 128baa0da24..00000000000 --- a/remote-config/remote-config-core/src/test/groovy/datadog/remoteconfig/PollerRequestFactoryTest.groovy +++ /dev/null @@ -1,86 +0,0 @@ -package datadog.remoteconfig - -import com.squareup.moshi.Moshi -import datadog.remoteconfig.tuf.RemoteConfigRequest -import datadog.trace.api.ProcessTags -import datadog.trace.bootstrap.instrumentation.api.Tags -import datadog.trace.test.util.DDSpecification -import datadog.trace.api.Config -import datadog.trace.api.remoteconfig.ServiceNameCollector - -import static datadog.trace.api.config.GeneralConfig.EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED - -class PollerRequestFactoryTest extends DDSpecification { - - static final String TRACER_VERSION = "v1.2.3" - static final String CONTAINER_ID = "456" - static final String ENTITY_ID = "32423" - static final String INVALID_REMOTE_CONFIG_URL = "https://invalid.example.com/" - - void 'remote config request fields been sanitized'() { - given: - System.setProperty("dd.service", "Service Name") - System.setProperty("dd.env", "PROD") - System.setProperty("dd.tags", "version:1.0.0-SNAPSHOT") - System.setProperty("dd.trace.global.tags", Tags.GIT_REPOSITORY_URL+":https://github.com/DataDog/dd-trace-java,"+Tags.GIT_COMMIT_SHA + ":1234") - rebuildConfig() - PollerRequestFactory factory = new PollerRequestFactory(Config.get(), TRACER_VERSION, CONTAINER_ID, ENTITY_ID, INVALID_REMOTE_CONFIG_URL, null) - - when: - RemoteConfigRequest request = factory.buildRemoteConfigRequest( Collections.singletonList("ASM"), null, null, 0, ServiceNameCollector.get()) - - then: - request.client.tracerInfo.serviceName == "service_name" - request.client.tracerInfo.serviceEnv == "prod" - request.client.tracerInfo.serviceVersion == "1.0.0-snapshot" - request.client.tracerInfo.tags.contains("env:PROD") - request.client.tracerInfo.tags.contains(Tags.GIT_REPOSITORY_URL + ":https://github.com/DataDog/dd-trace-java") - request.client.tracerInfo.tags.contains(Tags.GIT_COMMIT_SHA + ":1234") - } - - void 'remote config request extraServices'() { - given: - System.setProperty("dd.service", "Service Name") - System.setProperty("dd.env", "PROD") - System.setProperty("dd.tags", "version:1.0.0-SNAPSHOT") - rebuildConfig() - final extraService = 'fakeExtraService' - ServiceNameCollector extraServicesProvider = new ServiceNameCollector() - extraServicesProvider.addService(extraService) - PollerRequestFactory factory = new PollerRequestFactory(Config.get(), TRACER_VERSION, CONTAINER_ID, ENTITY_ID, INVALID_REMOTE_CONFIG_URL, null) - - when: - RemoteConfigRequest request = factory.buildRemoteConfigRequest( Collections.singletonList("ASM"), null, null, 0, extraServicesProvider) - - then: - request.client.tracerInfo.extraServices.contains(extraService) - } - - void 'remote config provides process tags when enabled = #enabled'() { - setup: - if (!enabled) { - injectSysConfig(EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED, "false") - } - ProcessTags.reset() - PollerRequestFactory factory = new PollerRequestFactory(Config.get(), TRACER_VERSION, CONTAINER_ID, ENTITY_ID, INVALID_REMOTE_CONFIG_URL, null) - - when: - def request = factory.buildRemoteConfigRequest( Collections.singletonList("ASM"), null, null, 0, ServiceNameCollector.get()) - def json = new Moshi.Builder().build().adapter(RemoteConfigRequest).toJson(request) - then: - def epName = request.client.tracerInfo.processTags.find {it =~ "entrypoint.name:.+"} - def workingDir = request.client.tracerInfo.processTags.find {it =~ "entrypoint.workdir:.+"} - - if (enabled) { - assert workingDir != null - assert epName != null - assert json.contains('"process_tags":[') - } else { - assert workingDir == null - assert epName == null - assert !json.contains('"process_tags":[') - } - where: - enabled << [true, false] - } -} diff --git a/remote-config/remote-config-core/src/test/groovy/datadog/remoteconfig/Rcte1TestVectorsSpecification.groovy b/remote-config/remote-config-core/src/test/groovy/datadog/remoteconfig/Rcte1TestVectorsSpecification.groovy deleted file mode 100644 index fa2d914a67d..00000000000 --- a/remote-config/remote-config-core/src/test/groovy/datadog/remoteconfig/Rcte1TestVectorsSpecification.groovy +++ /dev/null @@ -1,146 +0,0 @@ -package datadog.remoteconfig - -import datadog.trace.api.Config -import datadog.trace.test.util.DDSpecification -import datadog.trace.util.AgentTaskScheduler -import groovy.json.JsonSlurper -import okhttp3.Call -import okhttp3.HttpUrl -import okhttp3.MediaType -import okhttp3.OkHttpClient -import okhttp3.Protocol -import okhttp3.Request -import okhttp3.RequestBody -import okhttp3.Response -import okhttp3.ResponseBody -import okio.Buffer - -import java.nio.file.Paths -import java.util.concurrent.TimeUnit - -class Rcte1TestVectorsSpecification extends DDSpecification { - private static final int DEFAULT_POLL_PERIOD = 5000 - private final static JsonSlurper SLURPER = new JsonSlurper() - private static final String KEY_ID = 'ed7672c9a24abda78872ee32ee71c7cb1d5235e8db4ecbf1ca28b9c50eb75d9e' - private static final String PUBLIC_KEY = '7d3102e39abe71044d207550bda239c71380d013ec5a115f79f51622630054e6' - - final static HttpUrl URL = HttpUrl.get('https://example.com/v0.7/config') - OkHttpClient okHttpClient = Mock() - AgentTaskScheduler scheduler = Mock() - AgentTaskScheduler.Scheduled scheduled = Mock() - ConfigurationPoller poller - - AgentTaskScheduler.Task task - Request request - Call call = Mock() - - private static final Request REQUEST = new Request.Builder() - .url('https://example.com').build() - private Response buildOKResponse(String bodyStr) { - ResponseBody body = ResponseBody.create(MediaType.get('application/json'), bodyStr) - new Response.Builder() - .request(REQUEST).protocol(Protocol.HTTP_1_1).message('OK').body(body).code(200).build() - } - - void setup() { - injectSysConfig('dd.rc.targets.key.id', KEY_ID) - injectSysConfig('dd.rc.targets.key', PUBLIC_KEY) - injectSysConfig('remote_config.integrity_check.enabled', 'true') - - poller = new DefaultConfigurationPoller( - Config.get(), - '0.0.0', - 'containerid', - 'entityid', - { -> URL.toString() }, - okHttpClient, - scheduler - ) - } - - private static String getFileContents(String baseFileName) { - new File(Paths.get('.').toAbsolutePath().normalize().toFile(), - "src/test/resources/rcte1/${baseFileName}.json").text - } - - private parseBody(RequestBody body) { - Buffer buffer = new Buffer() - body.writeTo(buffer) - byte[] bytes = new byte[buffer.size()] - buffer.read(bytes) - SLURPER.parse(bytes) - } - - void 'valid file'() { - setup: - Map savedConfig - poller.addListener( - Product.ASM_DD, - { SLURPER.parse(it) } as ConfigurationDeserializer, - { String cfgKey, Map map, PollingRateHinter hinter -> savedConfig = map } as ConfigurationChangesTypedListener - ) - - when: - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(getFileContents('validOneFile')) } - 0 * _._ - savedConfig != null - } - - void 'invalid file #baseFileName'() { - setup: - poller.addListener( - Product.ASM_DD, - { assert false, 'should never be called' } as ConfigurationDeserializer, - { Object[] args -> } as ConfigurationChangesTypedListener - ) - - when: - poller.start() - - then: - 1 * scheduler.scheduleAtFixedRate(_, poller, 0, DEFAULT_POLL_PERIOD, TimeUnit.MILLISECONDS) >> { task = it[0]; scheduled } - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse(getFileContents(baseFileName)) } - 0 * _._ - - when: - task.run(poller) - - then: - 1 * okHttpClient.newCall(_ as Request) >> { request = it[0]; call } - 1 * call.execute() >> { buildOKResponse('validOneFile') } - 0 * _._ - - def body = parseBody(request.body()) - with(body) { - with(client) { - with(state) { - has_error == true - error.contains(message) - } - } - } - - where: - baseFileName | message - 'targetsSignedWithInvalidKey' | "Missing signature for key $KEY_ID" - 'tufTargetsInvalidSignature' | 'Signature verification failed for targets.signed' - 'tufTargetsInvalidTargetFileHash' | 'does not have the expected sha256 hash' - 'tufTargetsMissingTargetFile' | 'is in target_files, but not in targets.signed' - } -} diff --git a/remote-config/remote-config-core/src/test/groovy/datadog/remoteconfig/state/ParsedConfigKeyTests.groovy b/remote-config/remote-config-core/src/test/groovy/datadog/remoteconfig/state/ParsedConfigKeyTests.groovy deleted file mode 100644 index 8bbb8808888..00000000000 --- a/remote-config/remote-config-core/src/test/groovy/datadog/remoteconfig/state/ParsedConfigKeyTests.groovy +++ /dev/null @@ -1,38 +0,0 @@ -package datadog.remoteconfig.state - - -import datadog.remoteconfig.Product -import datadog.remoteconfig.ReportableException -import spock.lang.Specification - -class ParsedConfigKeyTests extends Specification { - void 'parse extract right segments'() { - when: - def parsed = ParsedConfigKey.parse(configKey) - - then: - parsed.getOrg() == org - parsed.getVersion() == version - parsed.getProduct() == product - parsed.getConfigId() == configId - parsed.toString() == configKey - - where: - configKey | org | version | product | configId - - "employee/ASM_DD/1.recommended.json/config" | "employee" | null| Product.ASM_DD | "1.recommended.json" - - "datadog/2/LIVE_DEBUGGING/Snapshot_1ba66cc9-146a-3479-9e66-2b63fd580f48/dog" | "datadog" | 2 | Product.LIVE_DEBUGGING | "Snapshot_1ba66cc9-146a-3479-9e66-2b63fd580f48" - - "datadog/2/NOT_REAL_PRODUCT/123/dogoz" | "datadog" | 2 | Product._UNKNOWN | "123" - } - - void 'wrong format configKey fails'() { - when: - ParsedConfigKey.parse("foo") - - then: - def e = thrown(ReportableException) - e.message == "Not a valid config key: foo" - } -} diff --git a/remote-config/remote-config-core/src/test/groovy/datadog/remoteconfig/state/ProductStateSpecification.groovy b/remote-config/remote-config-core/src/test/groovy/datadog/remoteconfig/state/ProductStateSpecification.groovy deleted file mode 100644 index ab81e3f3c81..00000000000 --- a/remote-config/remote-config-core/src/test/groovy/datadog/remoteconfig/state/ProductStateSpecification.groovy +++ /dev/null @@ -1,301 +0,0 @@ -package datadog.remoteconfig.state - -import datadog.remoteconfig.PollingRateHinter -import datadog.remoteconfig.Product -import datadog.remoteconfig.ReportableException -import datadog.remoteconfig.tuf.RemoteConfigResponse -import spock.lang.Specification - -class ProductStateSpecification extends Specification { - - PollingRateHinter hinter = Mock() - - void 'test apply for non-ASM_DD product applies changes before removes'() { - given: 'a ProductState for ASM_DATA' - def productState = new ProductState(Product.ASM_DATA) - def listener = new OrderRecordingListener() - productState.addProductListener(listener) - - and: 'first apply with config1 to cache it' - def response1 = buildResponse([ - 'org/ASM_DATA/config1/foo': [version: 1, length: 8, hash: 'oldhash1'] - ]) - def key1 = ParsedConfigKey.parse('org/ASM_DATA/config1/foo') - productState.apply(response1, [key1], hinter) - listener.operations.clear() // Clear for the actual test - - and: 'a new response with config1 (changed hash) and config2 (new)' - def response2 = buildResponse([ - 'org/ASM_DATA/config1/foo': [version: 2, length: 8, hash: 'newhash1'], - 'org/ASM_DATA/config2/foo': [version: 1, length: 8, hash: 'hash2'] - ]) - def key2 = ParsedConfigKey.parse('org/ASM_DATA/config2/foo') - - when: 'apply is called' - def changed = productState.apply(response2, [key1, key2], hinter) - - then: 'changes are detected' - changed - - and: 'operations happen in order: apply config1, apply config2, commit (no removes)' - listener.operations == [ - 'accept:org/ASM_DATA/config1/foo', - 'accept:org/ASM_DATA/config2/foo', - 'commit' - ] - } - - void 'test apply for ASM_DD product applies changes after removes'() { - given: 'a ProductState for ASM_DD' - def productState = new ProductState(Product.ASM_DD) - def listener = new OrderRecordingListener() - productState.addProductListener(listener) - - and: 'first apply with config1 and config2 to cache them' - def response1 = buildResponse([ - 'org/ASM_DD/config1/foo': [version: 1, length: 8, hash: 'oldhash1'], - 'org/ASM_DD/config2/foo': [version: 1, length: 8, hash: 'hash2'] - ]) - def key1 = ParsedConfigKey.parse('org/ASM_DD/config1/foo') - def key2 = ParsedConfigKey.parse('org/ASM_DD/config2/foo') - productState.apply(response1, [key1, key2], hinter) - listener.operations.clear() // Clear for the actual test - - and: 'a new response with only config1 (changed hash) - config2 will be removed' - def response2 = buildResponse([ - 'org/ASM_DD/config1/foo': [version: 2, length: 8, hash: 'newhash1'] - ]) - - when: 'apply is called' - def changed = productState.apply(response2, [key1], hinter) - - then: 'changes are detected' - changed - - and: 'operations happen in order: remove config2 FIRST, then apply config1, then commit' - listener.operations == ['remove:org/ASM_DD/config2/foo', 'accept:org/ASM_DD/config1/foo', 'commit'] - } - - void 'test ASM_DD with multiple new configs removes before applies all'() { - given: 'a ProductState for ASM_DD' - def productState = new ProductState(Product.ASM_DD) - def listener = new OrderRecordingListener() - productState.addProductListener(listener) - - and: 'first apply with old configs' - def response1 = buildResponse([ - 'org/ASM_DD/old1/foo': [version: 1, length: 8, hash: 'hash_old1'], - 'org/ASM_DD/old2/foo': [version: 1, length: 8, hash: 'hash_old2'] - ]) - def oldKey1 = ParsedConfigKey.parse('org/ASM_DD/old1/foo') - def oldKey2 = ParsedConfigKey.parse('org/ASM_DD/old2/foo') - productState.apply(response1, [oldKey1, oldKey2], hinter) - listener.operations.clear() // Clear for the actual test - - and: 'a response with completely new configs' - def response2 = buildResponse([ - 'org/ASM_DD/new1/foo': [version: 1, length: 8, hash: 'hash_new1'], - 'org/ASM_DD/new2/foo': [version: 1, length: 8, hash: 'hash_new2'] - ]) - def newKey1 = ParsedConfigKey.parse('org/ASM_DD/new1/foo') - def newKey2 = ParsedConfigKey.parse('org/ASM_DD/new2/foo') - - when: 'apply is called' - def changed = productState.apply(response2, [newKey1, newKey2], hinter) - - then: 'changes are detected' - changed - - and: 'all removes happen before all applies' - listener.operations.size() == 5 // 2 removes + 2 accepts + 1 commit - listener.operations.findAll { it.startsWith('remove:') }.size() == 2 - listener.operations.findAll { it.startsWith('accept:') }.size() == 2 - - and: 'removes come before accepts' - def lastRemoveIdx = listener.operations.findLastIndexOf { it.startsWith('remove:') } - def firstAcceptIdx = listener.operations.findIndexOf { it.startsWith('accept:') } - lastRemoveIdx < firstAcceptIdx - } - - void 'test no changes detected when config hashes match'() { - given: 'a ProductState' - def productState = new ProductState(Product.ASM_DATA) - def listener = new OrderRecordingListener() - productState.addProductListener(listener) - - and: 'first apply with a config' - def response = buildResponse([ - 'org/ASM_DATA/config1/foo': [version: 1, length: 8, hash: 'hash1'] - ]) - def key1 = ParsedConfigKey.parse('org/ASM_DATA/config1/foo') - productState.apply(response, [key1], hinter) - listener.operations.clear() // Clear for the actual test - - when: 'apply is called again with the same hash' - def changed = productState.apply(response, [key1], hinter) - - then: 'no changes are detected' - !changed - - and: 'no listener operations occurred' - listener.operations.isEmpty() - } - - void 'test error handling during apply'() { - given: 'a ProductState' - def productState = new ProductState(Product.ASM_DATA) - def listener = Mock(ProductListener) - productState.addProductListener(listener) - - and: 'a response with a config' - def response = buildResponse([ - 'org/ASM_DATA/config1/foo': [version: 1, length: 8, hash: 'hash1'] - ]) - - and: 'listener throws an exception' - listener.accept(_, _, _) >> { throw new RuntimeException('Listener error') } - - def key1 = ParsedConfigKey.parse('org/ASM_DATA/config1/foo') - - when: 'apply is called' - def changed = productState.apply(response, [key1], hinter) - - then: 'changes are still detected' - changed - - and: 'commit is still called despite the error' - 1 * listener.commit(hinter) - } - - void 'test reportable exception is recorded'() { - given: 'a ProductState' - def productState = new ProductState(Product.ASM_DATA) - def listener = Mock(ProductListener) - productState.addProductListener(listener) - - and: 'a response with a config' - def response = buildResponse([ - 'org/ASM_DATA/config1/foo': [version: 1, length: 8, hash: 'hash1'] - ]) - - and: 'listener throws a ReportableException' - def exception = new ReportableException('Test error') - listener.accept(_, _, _) >> { throw exception } - - def key1 = ParsedConfigKey.parse('org/ASM_DATA/config1/foo') - - when: 'apply is called' - productState.apply(response, [key1], hinter) - - then: 'error is recorded' - productState.hasError() - productState.getErrors().contains(exception) - } - - void 'test configListeners are called in addition to productListeners'() { - given: 'a ProductState' - def productState = new ProductState(Product.ASM_DATA) - def productListener = new OrderRecordingListener() - def configListener = new OrderRecordingListener() - productState.addProductListener(productListener) - productState.addProductListener('config1', configListener) - - and: 'a response with two configs' - def response = buildResponse([ - 'org/ASM_DATA/config1/foo': [version: 1, length: 8, hash: 'hash1'], - 'org/ASM_DATA/config2/foo': [version: 1, length: 8, hash: 'hash2'] - ]) - - def key1 = ParsedConfigKey.parse('org/ASM_DATA/config1/foo') - def key2 = ParsedConfigKey.parse('org/ASM_DATA/config2/foo') - - when: 'apply is called' - productState.apply(response, [key1, key2], hinter) - - then: 'productListener received both configs' - productListener.operations.findAll { it.startsWith('accept:') }.size() == 2 - - and: 'configListener only received config1' - configListener.operations == ['accept:org/ASM_DATA/config1/foo', 'commit'] - } - - void 'test remove operations cleanup cached data'() { - given: 'a ProductState' - def productState = new ProductState(Product.ASM_DATA) - def listener = Mock(ProductListener) - productState.addProductListener(listener) - - and: 'first apply with a config to cache it' - def response1 = buildResponse([ - 'org/ASM_DATA/config1/foo': [version: 1, length: 8, hash: 'hash1'] - ]) - def key1 = ParsedConfigKey.parse('org/ASM_DATA/config1/foo') - productState.apply(response1, [key1], hinter) - - and: 'an empty response (config should be removed)' - def response2 = buildResponse([:]) - - when: 'apply is called' - def changed = productState.apply(response2, [], hinter) - - then: 'changes are detected' - changed - - and: 'listener remove was called' - 1 * listener.remove(key1, hinter) - - and: 'cached data is cleaned up' - productState.getCachedTargetFiles().isEmpty() - productState.getConfigStates().isEmpty() - } - - // Helper methods - - RemoteConfigResponse buildResponse(Map targets) { - def response = Mock(RemoteConfigResponse) - - for (def entry : targets.entrySet()) { - def path = entry.key - def targetData = entry.value - - def target = new RemoteConfigResponse.Targets.ConfigTarget() - def hashString = targetData.hash as String - target.hashes = ['sha256': hashString] - target.length = targetData.length as long - - def custom = new RemoteConfigResponse.Targets.ConfigTarget.ConfigTargetCustom() - custom.version = targetData.version as long - target.custom = custom - - response.getTarget(path) >> target - response.getFileContents(path) >> "content_${targetData.hash}".bytes - } - - // Handle empty targets case - if (targets.isEmpty()) { - response.getTarget(_) >> null - } - - return response - } - - // Test helper class to record operation order - static class OrderRecordingListener implements ProductListener { - List operations = [] - - @Override - void accept(datadog.remoteconfig.state.ConfigKey configKey, byte[] content, PollingRateHinter pollingRateHinter) { - operations << "accept:${configKey.toString()}" - } - - @Override - void remove(datadog.remoteconfig.state.ConfigKey configKey, PollingRateHinter pollingRateHinter) { - operations << "remove:${configKey.toString()}" - } - - @Override - void commit(PollingRateHinter pollingRateHinter) { - operations << 'commit' - } - } -} diff --git a/remote-config/remote-config-core/src/test/java/datadog/remoteconfig/DefaultConfigurationPollerSpecification.java b/remote-config/remote-config-core/src/test/java/datadog/remoteconfig/DefaultConfigurationPollerSpecification.java new file mode 100644 index 00000000000..51922d9cbfa --- /dev/null +++ b/remote-config/remote-config-core/src/test/java/datadog/remoteconfig/DefaultConfigurationPollerSpecification.java @@ -0,0 +1,1488 @@ +package datadog.remoteconfig; + +import static datadog.remoteconfig.tuf.RemoteConfigRequest.ClientInfo.ClientState.ConfigState.APPLY_STATE_ERROR; +import static datadog.trace.test.junit.utils.config.WithConfigExtension.injectSysConfig; +import static java.nio.charset.StandardCharsets.UTF_8; +import static java.util.concurrent.TimeUnit.MILLISECONDS; +import static net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson; +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; +import static org.junit.jupiter.params.provider.Arguments.arguments; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.argThat; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.isNull; +import static org.mockito.ArgumentMatchers.notNull; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.verifyNoInteractions; +import static org.mockito.Mockito.when; + +import cafe.cryptography.ed25519.Ed25519PrivateKey; +import cafe.cryptography.ed25519.Ed25519PublicKey; +import cafe.cryptography.ed25519.Ed25519Signature; +import com.squareup.moshi.Moshi; +import datadog.remoteconfig.state.ProductListener; +import datadog.trace.api.Config; +import datadog.trace.test.junit.utils.config.WithConfig; +import datadog.trace.test.util.DDJavaSpecification; +import datadog.trace.util.AgentTaskScheduler; +import java.io.File; +import java.io.IOException; +import java.math.BigInteger; +import java.nio.file.Files; +import java.security.MessageDigest; +import java.security.SecureRandom; +import java.time.Duration; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Base64; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Predicate; +import java.util.function.Supplier; +import java.util.stream.Stream; +import okhttp3.Call; +import okhttp3.HttpUrl; +import okhttp3.MediaType; +import okhttp3.OkHttpClient; +import okhttp3.Protocol; +import okhttp3.Request; +import okhttp3.Response; +import okhttp3.ResponseBody; +import okio.Buffer; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import org.mockito.stubbing.OngoingStubbing; + +@WithConfig(key = "rc.targets.key.id", value = "TEST_KEY_ID") +@WithConfig(key = "service", value = "my_service") +@WithConfig(key = "env", value = "my_env") +@WithConfig(key = "remote_config.integrity_check.enabled", value = "true") +class DefaultConfigurationPollerSpecification extends DDJavaSpecification { + private static final HttpUrl URL = HttpUrl.get("https://example.com/v0.7/config"); + private static final Request REQUEST = new Request.Builder().url("https://example.com").build(); + private static final int DEFAULT_POLL_PERIOD = 5000; + private static final String KEY_ID = "TEST_KEY_ID"; + private static final Ed25519PrivateKey PRIVATE_KEY = + Ed25519PrivateKey.generate(new SecureRandom()); + private static final Ed25519PublicKey PUBLIC_KEY = PRIVATE_KEY.derivePublic(); + + private static final Moshi MOSHI = new Moshi.Builder().build(); + + private final OkHttpClient okHttpClient = mock(OkHttpClient.class); + private final AgentTaskScheduler scheduler = mock(AgentTaskScheduler.class); + + @SuppressWarnings("unchecked") + private final AgentTaskScheduler.Scheduled scheduled = + mock(AgentTaskScheduler.Scheduled.class); + + private final Call call = mock(Call.class); + + private DefaultConfigurationPoller poller; + private AgentTaskScheduler.Task task; + private Request request; + private Supplier configUrlSupplier = URL::toString; + + private Response buildOKResponse(String bodyStr) { + ResponseBody body = ResponseBody.create(MediaType.get("application/json"), bodyStr); + return new Response.Builder() + .request(REQUEST) + .protocol(Protocol.HTTP_1_1) + .message("OK") + .body(body) + .code(200) + .build(); + } + + @BeforeEach + void setup() { + // value derived from the randomly generated keypair, so it cannot be a @WithConfig literal + injectSysConfig("dd.rc.targets.key", new BigInteger(1, PUBLIC_KEY.toByteArray()).toString(16)); + poller = + new DefaultConfigurationPoller( + Config.get(), "0.0.0", "", "", () -> configUrlSupplier.get(), okHttpClient, scheduler); + } + + // ----- Tests ----- + + @Test + void issuesNoRequestIfThereAreNoSubscriptions() { + start(); + + task.run(poller); + verify(okHttpClient, never()).newCall(any()); + + poller.addListener( + Product.ASM_DD, + deserializerThrowing("should not be called"), + (configKey, config, hinter) -> {}); + poller.removeListeners(Product.ASM_DD); + task.run(poller); + verify(okHttpClient, never()).newCall(any()); + + poller.stop(); + verify(scheduled).cancel(); + } + + @Test + void issuesRequestIfThereIsASubscription() throws IOException { + ConfigurationChangesTypedListener listener = typedListener(); + + poller.addListener(Product.ASM_DD, parseDeserializer(), listener); + start(); + + stubHttp(buildOKResponse(SAMPLE_RESP_BODY)); + task.run(poller); + + verify(listener).accept(any(), any(), any()); + + String json = bodyJson(); + assertThatJson(json).node("cached_target_files").isAbsent(); + assertThatJson(json).node("client.client_tracer.app_version").isEqualTo(""); + assertThatJson(json).node("client.client_tracer.env").isEqualTo("my_env"); + assertThatJson(json).node("client.client_tracer.language").isEqualTo("java"); + assertThatJson(json).node("client.client_tracer.runtime_id").isString().isNotEmpty(); + assertThatJson(json).node("client.client_tracer.service").isEqualTo("my_service"); + assertThatJson(json).node("client.client_tracer.tracer_version").isEqualTo("0.0.0"); + assertThatJson(json).node("client.id").isString().hasSize(36); + assertThatJson(json).node("client.is_tracer").isEqualTo(true); + assertThatJson(json).node("client.products").isArray().containsExactly("ASM_DD"); + assertThatJson(json).node("client.state.config_states").isArray().isEmpty(); + assertThatJson(json).node("client.state.has_error").isEqualTo(false); + assertThatJson(json).node("client.state.root_version").isEqualTo(1); + assertThatJson(json).node("client.state.targets_version").isEqualTo(0); + } + + @Test + void issuesNoRequestIfTheConfigUrlSupplierReturnsNull() { + ConfigurationDeserializer deserializer = deserializerMock(); + ConfigurationChangesTypedListener listener = typedListener(); + configUrlSupplier = () -> null; + + poller.addListener(Product.ASM_DD, deserializer, listener); + start(); + + task.run(poller); + + verify(okHttpClient, never()).newCall(any()); + } + + @Test + @SuppressWarnings("unchecked") + void onceTheSupplierProvidesAUrlItIsNotCalledAnymore() throws IOException { + ConfigurationDeserializer deserializer = deserializerMock(); + ConfigurationChangesTypedListener listener = typedListener(); + configUrlSupplier = mock(Supplier.class); + when(configUrlSupplier.get()).thenReturn(URL.toString()); + + poller.addListener(Product.ASM_DD, deserializer, listener); + start(); + + when(deserializer.deserialize(any())).thenReturn(true); + stubHttp(buildOKResponse(SAMPLE_RESP_BODY), buildOKResponse(SAMPLE_RESP_BODY)); + task.run(poller); + task.run(poller); + + verify(configUrlSupplier, times(1)).get(); + verify(okHttpClient, times(2)).newCall(any()); + verify(deserializer, times(1)).deserialize(any()); + verify(listener, times(1)).accept(any(), any(), any()); + } + + @Test + void handleProductListenersPerConfig() throws IOException { + ConfigurationDeserializer deserializer = deserializerMock(); + ConfigurationChangesTypedListener activationListener = typedListener(); + ConfigurationChangesTypedListener sampleRateListener = typedListener(); + + String activationKey = "datadog/2/ASM_FEATURES/asm_features_activation/config"; + String sampleRateKey = "datadog/2/ASM_FEATURES/api_security/sample_rate"; + + String respBody = + toJson( + map( + "client_configs", list(activationKey, sampleRateKey), + "roots", list(), + "target_files", + list( + map("path", activationKey, "raw", b64("{\"asm\":{\"enabled\":true}}")), + map( + "path", + sampleRateKey, + "raw", + b64("{\"api_security\": {\"request_sample_rate\": 0.1}"))), + "targets", + signAndBase64EncodeTargets( + map( + "signed", + map( + "expires", + "2022-09-17T12:49:15Z", + "spec_version", + "1.0.0", + "targets", + map( + activationKey, + map( + "custom", map("v", 1), + "hashes", + map( + "sha256", + "159658ab85be7207761a4111172b01558394bfc74a1fe1d314f2023f7c656db"), + "length", 24), + sampleRateKey, + map( + "custom", map("v", 1), + "hashes", + map( + "sha256", + "bc898b7eb75d9fd0ddee1c1a556bc3c528dd41382950aa86e48816f792d01494"), + "length", 45)), + "version", + 1))))); + + String noConfigs = withClientConfigs(SAMPLE_RESP_BODY, list()); + + poller.addListener( + Product.ASM_FEATURES, "asm_features_activation", deserializer, activationListener); + poller.addListener(Product.ASM_FEATURES, "api_security", deserializer, sampleRateListener); + start(); + + when(deserializer.deserialize(any())).thenReturn(true); + stubHttp(buildOKResponse(respBody), buildOKResponse(noConfigs)); + + task.run(poller); // apply + task.run(poller); // remove all configurations + + // 2 deserializations on apply; accept called once per run (apply + remove) on each listener + verify(deserializer, times(2)).deserialize(any()); + verify(activationListener, times(2)).accept(eq(activationKey), any(), any()); + verify(sampleRateListener, times(2)).accept(eq(sampleRateKey), any(), any()); + } + + @Test + void processingHappensForAllListeners() throws IOException { + ConfigurationDeserializer deserializer = deserializerMock(); + List> listeners = new ArrayList<>(); + for (int i = 0; i < 5; i++) { + listeners.add(typedListener()); + } + + String respBody = + toJson( + map( + "client_configs", + list( + "datadog/2/ASM_FEATURES/asm_features_activation/config", + "foo/ASM_DD/bar/config", + "foo/ASM/bar/config", + "foo/ASM_DATA/bar/config", + "foo/LIVE_DEBUGGING/bar/config"), + "roots", list(), + "target_files", + list( + map( + "path", + "datadog/2/ASM_FEATURES/asm_features_activation/config", + "raw", + b64("{\"asm\":{\"enabled\":true}}")), + map("path", "foo/ASM_DD/bar/config", "raw", ""), + map("path", "foo/ASM/bar/config", "raw", ""), + map("path", "foo/ASM_DATA/bar/config", "raw", ""), + map("path", "foo/LIVE_DEBUGGING/bar/config", "raw", "")), + "targets", + signAndBase64EncodeTargets( + map( + "signed", + map( + "expires", + "2022-09-17T12:49:15Z", + "spec_version", + "1.0.0", + "targets", + map( + "datadog/2/ASM_FEATURES/asm_features_activation/config", + map( + "custom", map("v", 1), + "hashes", + map( + "sha256", + "159658ab85be7207761a4111172b01558394bfc74a1fe1d314f2023f7c656db"), + "length", 24), + "foo/ASM_DD/bar/config", emptyTarget(), + "foo/ASM/bar/config", emptyTarget(), + "foo/ASM_DATA/bar/config", emptyTarget(), + "foo/LIVE_DEBUGGING/bar/config", emptyTarget()), + "version", + 1))))); + + poller.addListener(Product.ASM_DD, deserializer, listeners.get(1)); + poller.addListener(Product.ASM, deserializer, listeners.get(2)); + poller.addListener(Product.ASM_DATA, deserializer, listeners.get(3)); + poller.addListener(Product.LIVE_DEBUGGING, deserializer, listeners.get(0)); + poller.addListener(Product.ASM_FEATURES, deserializer, listeners.get(4)); + start(); + + when(deserializer.deserialize(any())).thenReturn(true); + stubHttp(buildOKResponse(respBody)); + task.run(poller); + + verify(deserializer, times(5)).deserialize(any()); + for (ConfigurationChangesTypedListener listener : listeners) { + verify(listener).accept(any(), any(), any()); + } + } + + @Test + void reschedulesIfInstructedToDoSo() throws IOException { + poller.addListener( + Product.ASM_DD, + parseDeserializer(), + (configKey, config, hinter) -> { + hinter.suggestPollingRate(Duration.ofMillis(124)); + hinter.suggestPollingRate(Duration.ofMillis(123)); + hinter.suggestPollingRate(Duration.ofMillis(1230)); // higher is ignored + }); + start(); + + when(scheduler.scheduleAtFixedRate(any(), eq(poller), eq(123L), eq(123L), eq(MILLISECONDS))) + .thenAnswer(invocation -> scheduled); + stubHttp(buildOKResponse(SAMPLE_RESP_BODY)); + task.run(poller); + + verify(scheduler).scheduleAtFixedRate(any(), eq(poller), eq(123L), eq(123L), eq(MILLISECONDS)); + verify(scheduled).cancel(); + } + + @Test + void setsCachedFilesAndConfigStateOnSecondRequest() throws IOException { + poller.addListener(Product.ASM_DD, parseDeserializer(), (configKey, config, hinter) -> {}); + start(); + + stubHttp(buildOKResponse(SAMPLE_RESP_BODY), buildOKResponse(SAMPLE_RESP_BODY)); + task.run(poller); + task.run(poller); + + verify(okHttpClient, times(2)).newCall(any()); + + Map body = parseBody(); + List cachedTargetFiles = asList(body.get("cached_target_files")); + assertEquals(1, cachedTargetFiles.size()); + Map cached = asMap(cachedTargetFiles.get(0)); + assertEquals( + list( + map( + "algorithm", + "sha256", + "hash", + "6302258236e6051216b950583ec7136d946b463c17cbe64384ba5d566324819")), + cached.get("hashes")); + assertEquals(919L, asLong(cached.get("length"))); + assertEquals("employee/ASM_DD/1.recommended.json/config", cached.get("path")); + + Map state = clientState(body); + assertEquals("foobar", state.get("backend_client_state")); + List configStates = asList(state.get("config_states")); + assertEquals(1, configStates.size()); + Map configState = asMap(configStates.get(0)); + assertEquals("1.recommended.json", configState.get("id")); + assertEquals("ASM_DD", configState.get("product")); + assertEquals(1L, asLong(configState.get("version"))); + } + + @Test + void removesCachedFileIfConfigurationIsPulled() throws IOException { + poller.addListener(Product.ASM_DD, parseDeserializer(), (configKey, config, hinter) -> {}); + start(); + + String noConfigs = withClientConfigs(SAMPLE_RESP_BODY, list()); + stubHttp( + buildOKResponse(SAMPLE_RESP_BODY), + buildOKResponse(noConfigs), + buildOKResponse(SAMPLE_RESP_BODY)); + task.run(poller); + task.run(poller); + task.run(poller); + + Map body = parseBody(); + assertNull(body.get("cached_target_files")); + } + + @Test + void doesNotUpdateTargetsVersionNumberIfThereIsAnError() throws IOException { + poller.addListener(Product.ASM_DD, parseDeserializer(), (configKey, config, hinter) -> {}); + start(); + + Map errored = parseMap(SAMPLE_RESP_BODY); + errored.put("target_files", list()); + Map targets = decodeTargets(errored.get("targets")); + asMap(asMap(targets.get("signed")).get("targets")) + .remove("employee/ASM_DD/1.recommended.json/config"); + asMap(targets.get("signed")).put("version", 42); + errored.put("targets", signAndBase64EncodeTargets(targets)); + + stubHttp( + buildOKResponse(SAMPLE_RESP_BODY), + buildOKResponse(toJson(errored)), + buildOKResponse(SAMPLE_RESP_BODY)); + task.run(poller); + task.run(poller); + task.run(poller); + + Map body = parseBody(); + assertNull(body.get("cached_target_files")); // previous hash should be cleared too + Map state = clientState(body); + assertEquals("foobar", state.get("backend_client_state")); + assertTrue(asList(state.get("config_states")).isEmpty()); + assertEquals(Boolean.TRUE, state.get("has_error")); + assertEquals( + "Told to apply config for employee/ASM_DD/1.recommended.json/config but no corresponding entry " + + "exists in targets.targets_signed.targets", + state.get("error")); + assertEquals(1L, asLong(state.get("root_version"))); + assertEquals(23337393L, asLong(state.get("targets_version"))); + } + + @Test + void appliesConfigurationOnlyIfTheHashHasChanged() throws IOException { + ConfigurationChangesTypedListener listener = typedListener(); + String configKey = "employee/ASM_DD/1.recommended.json/config"; + + poller.addListener(Product.ASM_DD, parseDeserializer(), listener); + start(); + + Map changed = parseMap(SAMPLE_RESP_BODY); + List targetFiles = asList(changed.get("target_files")); + byte[] fileDecoded = Base64.getDecoder().decode((String) asMap(targetFiles.get(0)).get("raw")); + byte[] newFile = Arrays.copyOf(fileDecoded, fileDecoded.length + 1); + newFile[fileDecoded.length] = '\n'; + asMap(targetFiles.get(0)).put("raw", Base64.getEncoder().encodeToString(newFile)); + Map targets = decodeTargets(changed.get("targets")); + Map targetEntry = + asMap(asMap(asMap(targets.get("signed")).get("targets")).get(configKey)); + asMap(targetEntry.get("hashes")).put("sha256", sha256(newFile).toString(16)); + targetEntry.put("length", asLong(targetEntry.get("length")) + 1); + changed.put("targets", signAndBase64EncodeTargets(targets)); + + stubHttp( + buildOKResponse(SAMPLE_RESP_BODY), + buildOKResponse(SAMPLE_RESP_BODY), + buildOKResponse(toJson(changed))); + task.run(poller); + task.run(poller); + task.run(poller); + + // applied once on the first run (unchanged hash on the second), once again when the hash + // changed + verify(listener, times(2)).accept(eq(configKey), notNull(), any()); + } + + @Test + void configurationCannotBeAppliedWithoutHashes() throws IOException { + ConfigurationChangesTypedListener listener = typedListener(); + String configKey = "employee/ASM_DD/1.recommended.json/config"; + + poller.addListener(Product.ASM_DD, parseDeserializer(), listener); + start(); + + Map noHashes = parseMap(SAMPLE_RESP_BODY); + Map targets = decodeTargets(noHashes.get("targets")); + asMap(asMap(asMap(asMap(targets.get("signed")).get("targets")).get(configKey)).get("hashes")) + .remove("sha256"); + noHashes.put("targets", signAndBase64EncodeTargets(targets)); + + stubHttp(buildOKResponse(toJson(noHashes)), buildOKResponse(SAMPLE_RESP_BODY)); + task.run(poller); + task.run(poller); + + verify(listener).accept(eq(configKey), any(), any()); + + Map state = clientState(parseBody()); + assertEquals(0, asList(state.get("config_states")).size()); + assertEquals("No sha256 hash present for " + configKey, state.get("error")); + assertEquals(0L, asLong(state.get("targets_version"))); + } + + @Test + void encodedFileIsNotValidBase64Data() throws IOException { + ConfigurationChangesTypedListener listener = typedListener(); + + poller.addListener(Product.ASM_DD, parseDeserializer(), listener); + start(); + + Map badBase64 = parseMap(SAMPLE_RESP_BODY); + List targetFiles = asList(badBase64.get("target_files")); + byte[] fileDecoded = Base64.getDecoder().decode((String) asMap(targetFiles.get(0)).get("raw")); + asMap(targetFiles.get(0)).put("raw", Base64.getEncoder().encodeToString(fileDecoded) + "##"); + + stubHttp(buildOKResponse(toJson(badBase64)), buildOKResponse(SAMPLE_RESP_BODY)); + task.run(poller); + task.run(poller); + + verify(listener).accept(any(), any(), any()); + + Map state = clientState(parseBody()); + assertEquals( + "Could not get file contents from remote config, file employee/ASM_DD/1.recommended.json/config", + state.get("error")); + } + + @Test + void deserializerCanReturnNullToIndicateNoConfigShouldBeApplied() throws IOException { + ConfigurationChangesTypedListener listener = typedListener(); + + poller.addListener(Product.ASM_DD, content -> null, listener); + start(); + + stubHttp(buildOKResponse(SAMPLE_RESP_BODY)); + task.run(poller); + + verify(listener, never()).accept(any(), any(), any()); + } + + @Test + void rejectsConfigurationIfTheHashIsWrong() throws IOException { + ConfigurationChangesTypedListener listener = typedListener(); + String configKey = "employee/ASM_DD/1.recommended.json/config"; + + poller.addListener(Product.ASM_DD, parseDeserializer(), listener); + start(); + + Map wrongHash = parseMap(SAMPLE_RESP_BODY); + Map targets = decodeTargets(wrongHash.get("targets")); + asMap(asMap(asMap(asMap(targets.get("signed")).get("targets")).get(configKey)).get("hashes")) + .put("sha256", "0"); + wrongHash.put("targets", signAndBase64EncodeTargets(targets)); + + stubHttp(buildOKResponse(toJson(wrongHash))); + task.run(poller); + + verify(listener, never()).accept(any(), any(), any()); + } + + @Test + void acceptsAnEmptyObjectAsAResponseToIndicateNoChanges() throws IOException { + ConfigurationChangesTypedListener listener = typedListener(); + ConfigurationDeserializer deserializer = deserializerMock(); + + poller.addListener(Product.ASM_DD, deserializer, listener); + start(); + + stubHttp(buildOKResponse("{}")); + task.run(poller); + + verifyNoInteractions(deserializer); + verifyNoInteractions(listener); + } + + @Test + void acceptsHttp204AsAResponseToIndicateNoChanges() throws IOException { + Response resp = + new Response.Builder() + .request(REQUEST) + .protocol(Protocol.HTTP_1_1) + .message("No Content") + .body(ResponseBody.create(MediaType.parse("application/json"), "")) + .code(204) + .build(); + ConfigurationChangesTypedListener listener = typedListener(); + ConfigurationDeserializer deserializer = deserializerMock(); + + poller.addListener(Product.ASM_DD, deserializer, listener); + start(); + + stubHttp(resp); + task.run(poller); + + verifyNoInteractions(deserializer); + verifyNoInteractions(listener); + } + + @Test + void appliesAndRemoveCalledForProductListener() throws IOException { + ProductListener listener = mock(ProductListener.class); + String cfgWithoutAsm = cfgWithoutAsm(); + + poller.addListener(Product.ASM_DD, listener); + start(); + + stubHttp( + buildOKResponse(SAMPLE_RESP_BODY), + buildOKResponse(SAMPLE_RESP_BODY), + buildOKResponse(cfgWithoutAsm), + buildOKResponse(cfgWithoutAsm)); + task.run(poller); // accept + commit + task.run(poller); // no commit, no change + task.run(poller); // remove + commit + task.run(poller); // no commit, no change + + verify(listener, times(1)).accept(any(), notNull(), any()); + verify(listener, times(1)).remove(any(), any()); + verify(listener, times(2)).commit(any()); + } + + @Test + void unappliesConfigurationsItHasStoppedSeeing() throws IOException { + ConfigurationChangesTypedListener listener = typedListener(); + String cfgWithoutAsm = cfgWithoutAsm(); + + poller.addListener(Product.ASM_DD, parseDeserializer(), listener); + start(); + + stubHttp( + buildOKResponse(SAMPLE_RESP_BODY), + buildOKResponse(cfgWithoutAsm), + buildOKResponse(cfgWithoutAsm)); + task.run(poller); // accept with non-null config + task.run(poller); // unapply (accept with null config) + task.run(poller); // nothing more + + verify(listener, times(1)).accept(any(), notNull(), any()); + verify(listener, times(1)).accept(any(), isNull(), any()); + } + + @Test + void supportMultipleConfigurations() throws IOException { + ConfigurationChangesTypedListener listener = typedListener(); + String recommended = "employee/ASM_DD/1.recommended.json/config"; + String suggested = "employee/ASM_DD/2.suggested.json/config"; + String multiConfigs = withClientConfigs(SAMPLE_RESP_BODY, list(recommended, suggested)); + String noConfigs = withClientConfigs(SAMPLE_RESP_BODY, list()); + + poller.addListener(Product.ASM_DD, parseDeserializer(), listener); + start(); + + stubHttp( + buildOKResponse(SAMPLE_RESP_BODY), // apply first configuration + buildOKResponse(multiConfigs), // apply second configuration + buildOKResponse(SAMPLE_RESP_BODY), // remove second configuration + buildOKResponse(noConfigs)); // remove all configurations + task.run(poller); + task.run(poller); + task.run(poller); + task.run(poller); + + verify(listener, times(1)).accept(eq(recommended), notNull(), any()); + verify(listener, times(1)).accept(eq(suggested), notNull(), any()); + verify(listener, times(1)).accept(eq(suggested), isNull(), any()); + verify(listener, times(1)).accept(eq(recommended), isNull(), any()); + } + + @Test + void exceptionApplyingOneConfigShouldNotPreventOthersFromBeingApplied() throws IOException { + String newConfigId = "1ba66cc9-146a-3479-9e66-2b63fd580f48"; + String newConfigKey = "datadog/2/LIVE_DEBUGGING/" + newConfigId + "/config"; + + poller.addListener( + Product.ASM_DD, + parseDeserializer(), + (configKey, config, hinter) -> { + throw new RuntimeException("throw here"); + }); + poller.addListener( + Product.LIVE_DEBUGGING, parseDeserializer(), (configKey, config, hinter) -> {}); + start(); + + Map withExtra = parseMap(SAMPLE_RESP_BODY); + asList(withExtra.get("client_configs")).add(newConfigKey); + Map targets = decodeTargets(withExtra.get("targets")); + asMap(asMap(targets.get("signed")).get("targets")) + .put( + newConfigKey, + map( + "custom", map("v", 3), + "hashes", + map( + "sha256", + "7a38bf81f383f69433ad6e900d35b3e2385593f76a7b7ab5d4355b8ba41ee24b"), + "length", "{\"foo\":\"bar\"}".length())); + asList(withExtra.get("target_files")) + .add(map("path", newConfigKey, "raw", b64("{\"foo\":\"bar\"}"))); + withExtra.put("targets", signAndBase64EncodeTargets(targets)); + + stubHttp(buildOKResponse(toJson(withExtra)), buildOKResponse(SAMPLE_RESP_BODY)); + task.run(poller); + task.run(poller); + + Map body = parseBody(); + List configStates = asList(clientState(body).get("config_states")); + assertEquals(2, configStates.size()); + Map liveDebuggingConfig = findConfigState(configStates, "LIVE_DEBUGGING"); + Map asmConfig = findConfigState(configStates, "ASM_DD"); + assertEquals(newConfigId, liveDebuggingConfig.get("id")); + assertEquals("LIVE_DEBUGGING", liveDebuggingConfig.get("product")); + assertEquals(3L, asLong(liveDebuggingConfig.get("version"))); + assertNull(liveDebuggingConfig.get("apply_error")); + assertEquals("1.recommended.json", asmConfig.get("id")); + assertEquals("ASM_DD", asmConfig.get("product")); + assertEquals(1L, asLong(asmConfig.get("version"))); + assertEquals(APPLY_STATE_ERROR, asInt(asmConfig.get("apply_state"))); + assertEquals("throw here", asmConfig.get("apply_error")); + } + + static Stream badResponsesArguments() { + return Stream.of( + arguments( + "404 with body", + new Response.Builder() + .request(REQUEST) + .protocol(Protocol.HTTP_1_1) + .message("Not Found") + .code(404) + .body(ResponseBody.create(MediaType.get("text/plain"), "not found!")) + .build()), + arguments( + "404 without body", + new Response.Builder() + .request(REQUEST) + .protocol(Protocol.HTTP_1_1) + .message("Not Found") + .code(404) + .build()), + arguments( + "success, no body", + new Response.Builder() + .request(REQUEST) + .protocol(Protocol.HTTP_1_1) + .message("Created") + .code(201) + .build()), + arguments( + "not json", + new Response.Builder() + .request(REQUEST) + .protocol(Protocol.HTTP_1_1) + .message("OK") + .body(ResponseBody.create(MediaType.get("text/plain"), SAMPLE_RESP_BODY)) + .code(200) + .build())); + } + + // autoCloseArguments disabled: a body-less okhttp Response throws on close() + @ParameterizedTest(name = "bad responses: {0}", autoCloseArguments = false) + @MethodSource("badResponsesArguments") + void badResponses(String scenario, Response resp) throws IOException { + ConfigurationChangesTypedListener listener = typedListener(); + + poller.addListener(Product.ASM_DD, deserializerThrowing("should not be called"), listener); + start(); + + stubHttp(resp); + task.run(poller); + + // a single request is made and no configuration is applied + verify(okHttpClient, times(1)).newCall(any()); + verifyNoInteractions(listener); + } + + static Stream bodyDoesNotSatisfyFormatArguments() { + return Stream.of( + arguments("targets not a string", "{\"targets\": []}"), + arguments("targets not base64", "{\"targets\": \"ZZZZ=\"}"), + arguments( + "signed not an object", "{\"targets\": \"" + b64("{\"signed\": \"string\"}") + "\"}")); + } + + @ParameterizedTest(name = "body does not satisfy format: {0}") + @MethodSource("bodyDoesNotSatisfyFormatArguments") + void bodyDoesNotSatisfyFormat(String scenario, String bodyStr) throws IOException { + ConfigurationDeserializer deserializer = deserializerMock(); + ConfigurationChangesTypedListener listener = typedListener(); + + poller.addListener(Product.ASM_DD, deserializer, listener); + start(); + + stubHttp(buildOKResponse(bodyStr)); + task.run(poller); + + verifyNoInteractions(deserializer); + verifyNoInteractions(listener); + } + + static Stream reportableErrorsArguments() { + // not a valid key + Map notValidKey = parseMap(SAMPLE_RESP_BODY); + asList(notValidKey.get("client_configs")).set(0, "foobar"); + + // no file for the given key + Map noFile = parseMap(SAMPLE_RESP_BODY); + noFile.put("target_files", list()); + + // two reportable errors + Map twoErrors = parseMap(SAMPLE_RESP_BODY); + twoErrors.put("client_configs", list("foobar", "employee/ASM_DD/1.recommended.json/config")); + twoErrors.put("target_files", list()); + + // in target_files, but not targets.signed.targets + Map notInTargets = parseMap(SAMPLE_RESP_BODY); + Map targetsNotInTargets = decodeTargets(notInTargets.get("targets")); + asMap(targetsNotInTargets.get("signed")).put("targets", map()); + notInTargets.put("targets", signAndBase64EncodeTargets(targetsNotInTargets)); + + // told to apply config that is not subscribed + Map notSubscribed = parseMap(SAMPLE_RESP_BODY); + notSubscribed.put( + "client_configs", + list("datadog/2/LIVE_DEBUGGING/1ba66cc9-146a-3479-9e66-2b63fd580f48/config")); + + // invalid signature + Map invalidSignature = parseMap(SAMPLE_RESP_BODY); + Map invalidSigTargets = decodeTargets(invalidSignature.get("targets")); + asMap(asList(invalidSigTargets.get("signatures")).get(0)) + .put( + "sig", + "59a6478aba87d171261e6995faaa8e36c95c3e75436c4e82f11ac625220e13b703ce9b912ee0731415121b5a47aa2abdb398a60656b7701b15e606c6327c880e"); + invalidSignature.put( + "targets", Base64.getEncoder().encodeToString(toJson(invalidSigTargets).getBytes(UTF_8))); + + // structurally invalid signature + Map structurallyInvalid = parseMap(SAMPLE_RESP_BODY); + Map structurallyInvalidTargets = + decodeTargets(structurallyInvalid.get("targets")); + asMap(asList(structurallyInvalidTargets.get("signatures")).get(0)).put("sig", repeat("a", 128)); + structurallyInvalid.put( + "targets", + Base64.getEncoder().encodeToString(toJson(structurallyInvalidTargets).getBytes(UTF_8))); + + return Stream.of( + arguments("not a valid key", toJson(notValidKey), "Not a valid config key: foobar"), + arguments( + "no file for key", + toJson(noFile), + "No content for employee/ASM_DD/1.recommended.json/config"), + arguments( + "two reportable errors", + toJson(twoErrors), + "Failed to apply configuration due to 2 errors:\n (1) Not a valid config key: foobar\n" + + " (2) No content for employee/ASM_DD/1.recommended.json/config\n"), + arguments( + "in target_files but not signed", + toJson(notInTargets), + "Path employee/ASM_DD/1.recommended.json/config is in target_files, but not in targets.signed"), + arguments( + "config not subscribed", + toJson(notSubscribed), + "Told to handle config key datadog/2/LIVE_DEBUGGING/1ba66cc9-146a-3479-9e66-2b63fd580f48/config," + + " but the product LIVE_DEBUGGING is not being handled"), + arguments( + "invalid signature", + toJson(invalidSignature), + "Signature verification failed for targets.signed. Key id: TEST_KEY_ID"), + arguments( + "structurally invalid signature", + toJson(structurallyInvalid), + "Error reading signature or canonicalizing targets.signed: Invalid scalar representation")); + } + + @ParameterizedTest(name = "reportable errors: {0}") + @MethodSource("reportableErrorsArguments") + void reportableErrors(String scenario, String bodyStr, String errorMsg) throws IOException { + poller.addListener( + Product.ASM_DD, + deserializerThrowing("should not be called"), + (configKey, config, hinter) -> {}); + start(); + + stubHttp(buildOKResponse(bodyStr), buildOKResponse(SAMPLE_RESP_BODY)); + task.run(poller); + task.run(poller); + + Map state = clientState(parseBody()); + assertTrue(asList(state.get("config_states")).isEmpty()); + assertEquals(Boolean.TRUE, state.get("has_error")); + assertEquals(errorMsg, state.get("error")); + } + + @Test + void reportsErrorDuringDeserialization() throws IOException { + poller.addListener( + Product.ASM_DD, + content -> { + throw new RuntimeException("my deserializer error"); + }, + (configKey, config, hinter) -> {}); + start(); + + stubHttp(buildOKResponse(SAMPLE_RESP_BODY), buildOKResponse(SAMPLE_RESP_BODY)); + task.run(poller); + task.run(poller); + + Map configState = + asMap(asList(clientState(parseBody()).get("config_states")).get(0)); + assertEquals(APPLY_STATE_ERROR, asInt(configState.get("apply_state"))); + assertEquals("my deserializer error", configState.get("apply_error")); + } + + @Test + void reportsErrorApplyingConfiguration() throws IOException { + poller.addListener( + Product.ASM_DD, + content -> true, + (configKey, config, hinter) -> { + throw new RuntimeException("error applying config"); + }); + start(); + + stubHttp(buildOKResponse(SAMPLE_RESP_BODY), buildOKResponse(SAMPLE_RESP_BODY)); + task.run(poller); + task.run(poller); + + Map configState = + asMap(asList(clientState(parseBody()).get("config_states")).get(0)); + assertEquals(APPLY_STATE_ERROR, asInt(configState.get("apply_state"))); + assertEquals("error applying config", configState.get("apply_error")); + } + + @Test + void theMaxSizeIsExceeded() throws IOException { + ConfigurationDeserializer deserializer = deserializerMock(); + + poller.addListener( + Product.ASM_DD, deserializer, (configKey, config, hinter) -> fail("should not be called")); + start(); + + Map oversized = parseMap(SAMPLE_RESP_BODY); + asList(oversized.get("target_files")) + .add( + map( + "path", + "foo/bar", + "raw", + repeat("a", (int) Config.get().getRemoteConfigMaxPayloadSizeBytes()))); + + stubHttp(buildOKResponse(toJson(oversized))); + task.run(poller); + + verifyNoInteractions(deserializer); + } + + @Test + void canListenForChangesInALocalFile() throws IOException { + File file = Files.createTempFile(null, ".json").toFile(); + AtomicReference savedConf = new AtomicReference<>(); + + poller.addFileListener(file, parseDeserializer(), (path, conf, hinter) -> savedConf.set(conf)); + start(); + Files.write(file.toPath(), "{\"foo\":\"bar\"}".getBytes(UTF_8)); + + task.run(poller); + assertEquals("bar", asMap(savedConf.get()).get("foo")); + + file.delete(); + Files.write(file.toPath(), "{\"foo\":\"xpto\"}".getBytes(UTF_8)); + task.run(poller); + assertEquals("xpto", asMap(savedConf.get()).get("foo")); + + file.delete(); + } + + @Test + void distributesFeatures() throws IOException { + ConfigurationChangesTypedListener listener = typedListener(); + + poller.addListener(Product.ASM_FEATURES, parseDeserializer(), listener); + start(); + + stubHttp(buildOKResponse(FEATURES_RESP_BODY)); + task.run(poller); + + verify(listener) + .accept( + any(), + cfgMatches(cfg -> Boolean.TRUE.equals(asMap(cfg.get("asm")).get("enabled"))), + any()); + } + + @Test + void distributesFeaturesUponSubscribing() throws IOException { + ConfigurationChangesTypedListener listener = typedListener(); + + poller.addListener( + Product.ASM_FEATURES, + deserializerThrowing("should not be called"), + (configKey, config, hinter) -> { + throw new RuntimeException("should not be called"); + }); + start(); + + poller.removeListeners(Product.ASM_FEATURES); + + poller.addListener(Product.ASM_FEATURES, parseDeserializer(), listener); + stubHttp(buildOKResponse(FEATURES_RESP_BODY)); + task.run(poller); + + verify(listener) + .accept( + any(), + cfgMatches(cfg -> Boolean.TRUE.equals(asMap(cfg.get("asm")).get("enabled"))), + any()); + } + + @Test + void distributeConfigAcrossMultipleListenersForSameSubscriber() throws IOException { + ConfigurationChangesTypedListener listener1 = typedListener(); + ConfigurationChangesTypedListener listener2 = typedListener(); + + poller.addListener(Product.ASM_FEATURES, parseDeserializer(), listener1); + poller.addListener(Product.ASM_FEATURES, parseDeserializer(), listener2); + start(); + + stubHttp(buildOKResponse(FEATURES_RESP_BODY)); + task.run(poller); + + verify(listener1) + .accept( + any(), + cfgMatches(cfg -> Boolean.TRUE.equals(asMap(cfg.get("asm")).get("enabled"))), + any()); + verify(listener2) + .accept( + any(), + cfgMatches( + cfg -> + Double.valueOf(0.1) + .equals(asMap(cfg.get("api_security")).get("request_sample_rate"))), + any()); + } + + @Test + void errorApplyingFeatures() throws IOException { + AtomicBoolean called = new AtomicBoolean(false); + + poller.addListener( + Product.ASM_FEATURES, + content -> true, + (configKey, config, hinter) -> { + called.set(true); + throw new RuntimeException("throws"); + }); + start(); + + stubHttp(buildOKResponse(FEATURES_RESP_BODY)); + task.run(poller); + + assertTrue(called.get()); + // error does not escape + } + + @Test + void removingFeatureListeners() throws IOException { + ConfigurationChangesTypedListener listener = typedListener(); + + poller.addListener( + Product._UNKNOWN, + deserializerThrowing("should not be called"), + (configKey, config, hinter) -> { + throw new RuntimeException("should not be called"); + }); + poller.addListener(Product.ASM_FEATURES, content -> null, listener); + poller.removeListeners(Product.ASM_FEATURES); + start(); + + stubHttp(buildOKResponse(FEATURES_RESP_BODY)); + task.run(poller); + + verify(listener, never()).accept(any(), any(), any()); // listener is not called + + poller.removeListeners(Product._UNKNOWN); + task.run(poller); + + verify(okHttpClient, times(1)).newCall(any()); // not even a request is made the second time + } + + @Test + void checkSettingOfCapabilitiesNegativeTest() throws IOException { + ConfigurationChangesTypedListener listener = typedListener(); + + poller.addListener(Product._UNKNOWN, content -> true, listener); + start(); + + stubHttp(buildOKResponse(FEATURES_RESP_BODY)); + task.run(poller); + + List capabilities = asList(asMap(parseBody().get("client")).get("capabilities")); + assertEquals(0L, asLong(capabilities.get(0))); + } + + static Stream checkSettingOfCapabilitiesPositiveTestArguments() { + return Stream.of( + arguments("zero", 0L, new byte[] {0}), + arguments("fourteen", 14L, new byte[] {14}), + arguments("1 << 8", 1L << 8, new byte[] {1, 0}), + arguments("1 << 9", 1L << 9, new byte[] {2, 0}), + arguments( + "long min plus one", + -9223372036854775807L, + new byte[] {(byte) 128, 0, 0, 0, 0, 0, 0, 1})); + } + + @ParameterizedTest(name = "check setting of capabilities positive test: {0}") + @MethodSource("checkSettingOfCapabilitiesPositiveTestArguments") + void checkSettingOfCapabilitiesPositiveTest(String scenario, long capabilities, byte[] encoded) + throws IOException { + poller.addListener(Product._UNKNOWN, content -> true, (configKey, config, hinter) -> {}); + poller.addCapabilities(capabilities); + start(); + + stubHttp(buildOKResponse(FEATURES_RESP_BODY)); + task.run(poller); + + List capabilitiesList = asList(asMap(parseBody().get("client")).get("capabilities")); + byte[] actual = new byte[capabilitiesList.size()]; + for (int i = 0; i < actual.length; i++) { + actual[i] = (byte) asLong(capabilitiesList.get(i)); + } + assertArrayEquals(encoded, actual); + } + + // ----- Helper methods ----- + + private void start() { + when(scheduler.scheduleAtFixedRate( + any(), eq(poller), eq(0L), eq((long) DEFAULT_POLL_PERIOD), eq(MILLISECONDS))) + .thenAnswer( + invocation -> { + task = invocation.getArgument(0); + return scheduled; + }); + poller.start(); + assertNotNull(task); + } + + private void stubHttp(Response... responses) throws IOException { + when(okHttpClient.newCall(any(Request.class))) + .thenAnswer( + invocation -> { + request = invocation.getArgument(0); + return call; + }); + OngoingStubbing stubbing = when(call.execute()); + for (Response response : responses) { + stubbing = stubbing.thenReturn(response); + } + } + + private String bodyJson() throws IOException { + Buffer buffer = new Buffer(); + request.body().writeTo(buffer); + return new String(buffer.readByteArray(), UTF_8); + } + + private Map parseBody() throws IOException { + return parseMap(bodyJson()); + } + + private static Map clientState(Map body) { + return asMap(asMap(body.get("client")).get("state")); + } + + private static Map findConfigState(List configStates, String product) { + for (Object configState : configStates) { + Map map = asMap(configState); + if (product.equals(map.get("product"))) { + return map; + } + } + return null; + } + + @SuppressWarnings("unchecked") + private static ConfigurationChangesTypedListener typedListener() { + return mock(ConfigurationChangesTypedListener.class); + } + + @SuppressWarnings("unchecked") + private static ConfigurationDeserializer deserializerMock() { + return mock(ConfigurationDeserializer.class); + } + + private static ConfigurationDeserializer parseDeserializer() { + return content -> parse(new String(content, UTF_8)); + } + + private static ConfigurationDeserializer deserializerThrowing(String message) { + return content -> { + throw new RuntimeException(message); + }; + } + + private static Object cfgMatches(Predicate> predicate) { + return argThat(arg -> arg != null && predicate.test(asMap(arg))); + } + + private static String cfgWithoutAsm() { + Map map = parseMap(SAMPLE_RESP_BODY); + map.put("client_configs", list()); + Map targets = decodeTargets(map.get("targets")); + asMap( + asMap(asMap(targets.get("signed")).get("targets")) + .get("employee/ASM_DD/1.recommended.json/config")) + .put( + "hashes", + map("sha256", "aec070645fe53ee3b3763059376134f058cc337247c978add178b6ccdfb0019f")); + map.put("targets", signAndBase64EncodeTargets(targets)); + return toJson(map); + } + + private static String withClientConfigs(String body, List clientConfigs) { + Map map = parseMap(body); + map.put("client_configs", clientConfigs); + return toJson(map); + } + + private static Map emptyTarget() { + return map( + "custom", + map("v", 1), + "hashes", + map("sha256", "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"), + "length", + 0); + } + + private static String signAndBase64EncodeTargets(Map targets) { + Map targetsSigned = asMap(targets.get("signed")); + if (targetsSigned != null) { + byte[] canonicalTargetsSigned = JsonCanonicalizer.canonicalize(targetsSigned); + Ed25519Signature signature = PRIVATE_KEY.expand().sign(canonicalTargetsSigned, PUBLIC_KEY); + String sigBase16 = new BigInteger(1, signature.toByteArray()).toString(16); + targets.put("signatures", list(map("keyid", KEY_ID, "sig", sigBase16))); + } + return Base64.getEncoder().encodeToString(toJson(targets).getBytes(UTF_8)); + } + + private static Map decodeTargets(Object base64Targets) { + byte[] decoded = Base64.getDecoder().decode((String) base64Targets); + return parseMap(new String(decoded, UTF_8)); + } + + private static BigInteger sha256(byte[] bytes) { + try { + return new BigInteger(MessageDigest.getInstance("SHA-256").digest(bytes)); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + + private static String b64(String value) { + return Base64.getEncoder().encodeToString(value.getBytes(UTF_8)); + } + + private static String repeat(String value, int count) { + StringBuilder builder = new StringBuilder(value.length() * count); + for (int i = 0; i < count; i++) { + builder.append(value); + } + return builder.toString(); + } + + private static long asLong(Object value) { + return ((Number) value).longValue(); + } + + private static int asInt(Object value) { + return ((Number) value).intValue(); + } + + @SuppressWarnings("unchecked") + private static Map asMap(Object value) { + return (Map) value; + } + + @SuppressWarnings("unchecked") + private static List asList(Object value) { + return (List) value; + } + + private static Map map(Object... keyValues) { + Map map = new LinkedHashMap<>(); + for (int i = 0; i < keyValues.length; i += 2) { + map.put((String) keyValues[i], keyValues[i + 1]); + } + return map; + } + + private static List list(Object... items) { + return new ArrayList<>(Arrays.asList(items)); + } + + private static Object parse(String json) { + try { + return MOSHI.adapter(Object.class).fromJson(json); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + + private static Map parseMap(String json) { + return asMap(parse(json)); + } + + private static String toJson(Object value) { + return MOSHI.adapter(Object.class).toJson(value); + } + + private static final String SAMPLE_APPSEC_CONFIG = + "\n" + + "{\n" + + " \"version\": \"2.2\",\n" + + " \"metadata\": {\n" + + " \"rules_version\": \"1.3.1\"\n" + + " },\n" + + " \"rules\": [\n" + + " {\n" + + " \"id\": \"crs-913-110\",\n" + + " \"name\": \"Acunetix\",\n" + + " \"tags\": {\n" + + " \"type\": \"security_scanner\",\n" + + " \"crs_id\": \"913110\",\n" + + " \"category\": \"attack_attempt\"\n" + + " },\n" + + " \"conditions\": [\n" + + " {\n" + + " \"parameters\": {\n" + + " \"inputs\": [\n" + + " {\n" + + " \"address\": \"server.request.headers.no_cookies\"\n" + + " }\n" + + " ],\n" + + " \"list\": [\n" + + " \"acunetix-product\"\n" + + " ]\n" + + " },\n" + + " \"operator\": \"phrase_match\"\n" + + " }\n" + + " ],\n" + + " \"transformers\": [\n" + + " \"lowercase\"\n" + + " ]\n" + + " }\n" + + " ]\n" + + "}\n"; + + private static final String SAMPLE_TARGETS = + "\n" + + "{\n" + + " \"signatures\" : [\n" + + " {\n" + + " \"keyid\" : \"5c4ece41241a1bb513f6e3e5df74ab7d5183dfffbd71bfd43127920d880569fd\",\n" + + " \"sig\" : \"766871ed1acc60ef35f9f24262682283a55e79334f5154486176033b67568aed82fe8139a1f78689b96473537f0a2e55c8365d50bff345ea9ac350d57b90390d\"\n" + + " }\n" + + " ],\n" + + " \"signed\" : {\n" + + " \"_type\" : \"targets\",\n" + + " \"custom\" : {\n" + + " \"opaque_backend_state\" : \"foobar\"\n" + + " },\n" + + " \"expires\" : \"2022-09-17T12:49:15Z\",\n" + + " \"spec_version\" : \"1.0.0\",\n" + + " \"targets\" : {\n" + + " \"employee/ASM_DD/1.recommended.json/config\" : {\n" + + " \"custom\" : {\n" + + " \"v\" : 1\n" + + " },\n" + + " \"hashes\" : {\n" + + " \"sha256\" : \"6302258236e6051216b950583ec7136d946b463c17cbe64384ba5d566324819\"\n" + + " },\n" + + " \"length\" : 919\n" + + " },\n" + + " \"employee/ASM_DD/2.suggested.json/config\" : {\n" + + " \"custom\" : {\n" + + " \"v\" : 1\n" + + " },\n" + + " \"hashes\" : {\n" + + " \"sha256\" : \"6302258236e6051216b950583ec7136d946b463c17cbe64384ba5d566324819\"\n" + + " },\n" + + " \"length\" : 919\n" + + " },\n" + + " \"employee/CWS_DD/2.default.policy/config\" : {\n" + + " \"custom\" : {\n" + + " \"v\" : 2\n" + + " },\n" + + " \"hashes\" : {\n" + + " \"sha256\" : \"2f075fcaa9bdfc96bfc30d5a18711fbebf59d2cb3f3b5258d41ebdc1b1a54569\"\n" + + " },\n" + + " \"length\" : 34805\n" + + " }\n" + + " },\n" + + " \"version\" : 23337393\n" + + " }\n" + + "}\n"; + + private static final String SAMPLE_RESP_BODY = + "{\n" + + " \"client_configs\" : [\n" + + " \"employee/ASM_DD/1.recommended.json/config\"\n" + + " ],\n" + + " \"roots\" : [],\n" + + " \"target_files\" : [\n" + + " {\n" + + " \"path\" : \"employee/ASM_DD/1.recommended.json/config\",\n" + + " \"raw\" : \"" + + b64(SAMPLE_APPSEC_CONFIG) + + "\"\n" + + " },\n" + + " {\n" + + " \"path\" : \"employee/ASM_DD/2.suggested.json/config\",\n" + + " \"raw\" : \"" + + b64(SAMPLE_APPSEC_CONFIG) + + "\"\n" + + " }\n" + + " ],\n" + + " \"targets\" : \"" + + signAndBase64EncodeTargets(SAMPLE_TARGETS) + + "\"\n" + + "}\n"; + + private static final String FEATURES_RESP_BODY = + toJson( + map( + "client_configs", list("datadog/2/ASM_FEATURES/asm_features_activation/config"), + "roots", list(), + "target_files", + list( + map( + "path", + "datadog/2/ASM_FEATURES/asm_features_activation/config", + "raw", + b64( + "{\"asm\":{\"enabled\":true},\"api_security\":{\"request_sample_rate\":0.1}}"))), + "targets", + signAndBase64EncodeTargets( + map( + "signed", + map( + "expires", + "2022-09-17T12:49:15Z", + "spec_version", + "1.0.0", + "targets", + map( + "datadog/2/ASM_FEATURES/asm_features_activation/config", + map( + "custom", map("v", 1), + "hashes", + map( + "sha256", + "b01cb68f140fbfb7a2bb0ce39a473aa59c33664aca0c871cf07b8f4e09e3e360"), + "length", 67)), + "version", + 23337393))))); + + private static String signAndBase64EncodeTargets(String targetsJson) { + return signAndBase64EncodeTargets(parseMap(targetsJson)); + } +} diff --git a/remote-config/remote-config-core/src/test/java/datadog/remoteconfig/JsonCanonicalizerTests.java b/remote-config/remote-config-core/src/test/java/datadog/remoteconfig/JsonCanonicalizerTests.java new file mode 100644 index 00000000000..48bf459b521 Binary files /dev/null and b/remote-config/remote-config-core/src/test/java/datadog/remoteconfig/JsonCanonicalizerTests.java differ diff --git a/remote-config/remote-config-core/src/test/java/datadog/remoteconfig/PollerRequestFactoryTest.java b/remote-config/remote-config-core/src/test/java/datadog/remoteconfig/PollerRequestFactoryTest.java new file mode 100644 index 00000000000..9d5280e4783 --- /dev/null +++ b/remote-config/remote-config-core/src/test/java/datadog/remoteconfig/PollerRequestFactoryTest.java @@ -0,0 +1,123 @@ +package datadog.remoteconfig; + +import static datadog.trace.api.config.GeneralConfig.EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED; +import static datadog.trace.test.junit.utils.config.WithConfigExtension.injectSysConfig; +import static net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import com.squareup.moshi.Moshi; +import datadog.remoteconfig.tuf.RemoteConfigRequest; +import datadog.trace.api.Config; +import datadog.trace.api.ProcessTags; +import datadog.trace.api.remoteconfig.ServiceNameCollector; +import datadog.trace.bootstrap.instrumentation.api.Tags; +import datadog.trace.test.junit.utils.config.WithConfig; +import datadog.trace.test.util.DDJavaSpecification; +import java.util.Collections; +import java.util.List; +import java.util.regex.Pattern; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.ValueSource; + +class PollerRequestFactoryTest extends DDJavaSpecification { + + static final String TRACER_VERSION = "v1.2.3"; + static final String CONTAINER_ID = "456"; + static final String ENTITY_ID = "32423"; + static final String INVALID_REMOTE_CONFIG_URL = "https://invalid.example.com/"; + + @Test + @WithConfig(key = "service", value = "Service Name") + @WithConfig(key = "env", value = "PROD") + @WithConfig(key = "tags", value = "version:1.0.0-SNAPSHOT") + @WithConfig( + key = "trace.global.tags", + value = + Tags.GIT_REPOSITORY_URL + + ":https://github.com/DataDog/dd-trace-java," + + Tags.GIT_COMMIT_SHA + + ":1234") + void remoteConfigRequestFieldsBeenSanitized() { + PollerRequestFactory factory = + new PollerRequestFactory( + Config.get(), TRACER_VERSION, CONTAINER_ID, ENTITY_ID, INVALID_REMOTE_CONFIG_URL, null); + + RemoteConfigRequest request = + factory.buildRemoteConfigRequest( + Collections.singletonList("ASM"), null, null, 0, ServiceNameCollector.get()); + + RemoteConfigRequest.ClientInfo.TracerInfo tracerInfo = request.getClient().getTracerInfo(); + assertEquals("service_name", tracerInfo.getServiceName()); + assertEquals("prod", tracerInfo.getServiceEnv()); + assertEquals("1.0.0-snapshot", tracerInfo.getServiceVersion()); + assertTrue(tracerInfo.getTags().contains("env:PROD")); + assertTrue( + tracerInfo + .getTags() + .contains(Tags.GIT_REPOSITORY_URL + ":https://github.com/DataDog/dd-trace-java")); + assertTrue(tracerInfo.getTags().contains(Tags.GIT_COMMIT_SHA + ":1234")); + } + + @Test + @WithConfig(key = "service", value = "Service Name") + @WithConfig(key = "env", value = "PROD") + @WithConfig(key = "tags", value = "version:1.0.0-SNAPSHOT") + void remoteConfigRequestExtraServices() { + String extraService = "fakeExtraService"; + ServiceNameCollector extraServicesProvider = ServiceNameCollector.get(); + extraServicesProvider.clear(); + extraServicesProvider.addService(extraService); + PollerRequestFactory factory = + new PollerRequestFactory( + Config.get(), TRACER_VERSION, CONTAINER_ID, ENTITY_ID, INVALID_REMOTE_CONFIG_URL, null); + + RemoteConfigRequest request = + factory.buildRemoteConfigRequest( + Collections.singletonList("ASM"), null, null, 0, extraServicesProvider); + + assertTrue(request.getClient().getTracerInfo().getExtraServices().contains(extraService)); + } + + @ParameterizedTest(name = "remote config provides process tags when enabled = {0}") + @ValueSource(booleans = {true, false}) + void remoteConfigProvidesProcessTagsWhenEnabled(boolean enabled) throws Exception { + if (!enabled) { + injectSysConfig(EXPERIMENTAL_PROPAGATE_PROCESS_TAGS_ENABLED, "false"); + } + ProcessTags.reset(Config.get()); + PollerRequestFactory factory = + new PollerRequestFactory( + Config.get(), TRACER_VERSION, CONTAINER_ID, ENTITY_ID, INVALID_REMOTE_CONFIG_URL, null); + + RemoteConfigRequest request = + factory.buildRemoteConfigRequest( + Collections.singletonList("ASM"), null, null, 0, ServiceNameCollector.get()); + String json = new Moshi.Builder().build().adapter(RemoteConfigRequest.class).toJson(request); + + List processTags = request.getClient().getTracerInfo().getProcessTags(); + String entrypointName = findMatching(processTags, "entrypoint.name:.+"); + String workingDir = findMatching(processTags, "entrypoint.workdir:.+"); + + if (enabled) { + assertNotNull(workingDir); + assertNotNull(entrypointName); + assertThatJson(json).node("client.client_tracer.process_tags").isArray().isNotEmpty(); + } else { + assertNull(workingDir); + assertNull(entrypointName); + assertThatJson(json).node("client.client_tracer.process_tags").isAbsent(); + } + } + + private static String findMatching(List tags, String regex) { + if (tags == null) { + return null; + } + Pattern pattern = Pattern.compile(regex); + return tags.stream().filter(tag -> pattern.matcher(tag).find()).findFirst().orElse(null); + } +} diff --git a/remote-config/remote-config-core/src/test/java/datadog/remoteconfig/Rcte1TestVectorsSpecification.java b/remote-config/remote-config-core/src/test/java/datadog/remoteconfig/Rcte1TestVectorsSpecification.java new file mode 100644 index 00000000000..8cd8b03d3ed --- /dev/null +++ b/remote-config/remote-config-core/src/test/java/datadog/remoteconfig/Rcte1TestVectorsSpecification.java @@ -0,0 +1,170 @@ +package datadog.remoteconfig; + +import static net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.fail; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import com.squareup.moshi.Moshi; +import datadog.trace.api.Config; +import datadog.trace.test.junit.utils.config.WithConfig; +import datadog.trace.test.util.DDJavaSpecification; +import datadog.trace.util.AgentTaskScheduler; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicReference; +import java.util.function.Supplier; +import okhttp3.Call; +import okhttp3.HttpUrl; +import okhttp3.MediaType; +import okhttp3.OkHttpClient; +import okhttp3.Protocol; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import okio.Buffer; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.tabletest.junit.TableTest; + +@WithConfig( + key = "rc.targets.key.id", + value = "ed7672c9a24abda78872ee32ee71c7cb1d5235e8db4ecbf1ca28b9c50eb75d9e") +@WithConfig( + key = "rc.targets.key", + value = "7d3102e39abe71044d207550bda239c71380d013ec5a115f79f51622630054e6") +@WithConfig(key = "remote_config.integrity_check.enabled", value = "true") +class Rcte1TestVectorsSpecification extends DDJavaSpecification { + private static final int DEFAULT_POLL_PERIOD = 5000; + + private static final HttpUrl URL = HttpUrl.get("https://example.com/v0.7/config"); + private static final Request REQUEST = new Request.Builder().url("https://example.com").build(); + + private final Moshi moshi = new Moshi.Builder().build(); + + private final OkHttpClient okHttpClient = mock(OkHttpClient.class); + private final AgentTaskScheduler scheduler = mock(AgentTaskScheduler.class); + + @SuppressWarnings("unchecked") + private final AgentTaskScheduler.Scheduled scheduled = + mock(AgentTaskScheduler.Scheduled.class); + + private final Call call = mock(Call.class); + + private ConfigurationPoller poller; + private AgentTaskScheduler.Task task; + private Request request; + + private Response buildOKResponse(String bodyStr) { + ResponseBody body = ResponseBody.create(MediaType.get("application/json"), bodyStr); + return new Response.Builder() + .request(REQUEST) + .protocol(Protocol.HTTP_1_1) + .message("OK") + .body(body) + .code(200) + .build(); + } + + @BeforeEach + void setup() { + Supplier urlSupplier = URL::toString; + poller = + new DefaultConfigurationPoller( + Config.get(), "0.0.0", "containerid", "entityid", urlSupplier, okHttpClient, scheduler); + } + + private static String getFileContents(String baseFileName) throws IOException { + return new String( + Files.readAllBytes(Paths.get("src/test/resources/rcte1/" + baseFileName + ".json")), + StandardCharsets.UTF_8); + } + + private static String bodyToString(RequestBody body) throws IOException { + Buffer buffer = new Buffer(); + body.writeTo(buffer); + return buffer.readUtf8(); + } + + private void stubScheduling() { + when(scheduler.scheduleAtFixedRate( + any(), eq(poller), eq(0L), eq((long) DEFAULT_POLL_PERIOD), eq(TimeUnit.MILLISECONDS))) + .thenAnswer( + invocation -> { + task = invocation.getArgument(0); + return scheduled; + }); + } + + @Test + void validFile() throws IOException { + AtomicReference savedConfig = new AtomicReference<>(); + ConfigurationDeserializer deserializer = + content -> + moshi.adapter(Object.class).fromJson(new String(content, StandardCharsets.UTF_8)); + ConfigurationChangesTypedListener listener = + (configKey, config, hinter) -> savedConfig.set(config); + poller.addListener(Product.ASM_DD, deserializer, listener); + + stubScheduling(); + poller.start(); + assertNotNull(task); + + when(okHttpClient.newCall(any(Request.class))) + .thenAnswer( + invocation -> { + request = invocation.getArgument(0); + return call; + }); + when(call.execute()).thenReturn(buildOKResponse(getFileContents("validOneFile"))); + + task.run(poller); + + assertNotNull(savedConfig.get()); + } + + @TableTest({ + "scenario | baseFileName | message ", + "invalid signing key | targetsSignedWithInvalidKey | 'Missing signature for key ed7672c9a24abda78872ee32ee71c7cb1d5235e8db4ecbf1ca28b9c50eb75d9e'", + "invalid signature | tufTargetsInvalidSignature | 'Signature verification failed for targets.signed' ", + "invalid file hash | tufTargetsInvalidTargetFileHash | 'does not have the expected sha256 hash' ", + "missing target file | tufTargetsMissingTargetFile | 'is in target_files, but not in targets.signed' " + }) + void invalidFile(String baseFileName, String message) throws IOException { + ConfigurationDeserializer deserializer = + content -> { + fail("should never be called"); + return null; + }; + ConfigurationChangesTypedListener listener = (configKey, config, hinter) -> {}; + poller.addListener(Product.ASM_DD, deserializer, listener); + + stubScheduling(); + poller.start(); + assertNotNull(task); + + when(okHttpClient.newCall(any(Request.class))) + .thenAnswer( + invocation -> { + request = invocation.getArgument(0); + return call; + }); + when(call.execute()) + .thenReturn(buildOKResponse(getFileContents(baseFileName))) + .thenReturn(buildOKResponse("validOneFile")); + + task.run(poller); + task.run(poller); + + String bodyJson = bodyToString(request.body()); + assertThatJson(bodyJson).node("client.state.has_error").isEqualTo(true); + assertThatJson(bodyJson).node("client.state.error").asString().contains(message); + } +} diff --git a/remote-config/remote-config-core/src/test/java/datadog/remoteconfig/state/ParsedConfigKeyTests.java b/remote-config/remote-config-core/src/test/java/datadog/remoteconfig/state/ParsedConfigKeyTests.java new file mode 100644 index 00000000000..d0677adcbf2 --- /dev/null +++ b/remote-config/remote-config-core/src/test/java/datadog/remoteconfig/state/ParsedConfigKeyTests.java @@ -0,0 +1,36 @@ +package datadog.remoteconfig.state; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import datadog.remoteconfig.Product; +import datadog.remoteconfig.ReportableException; +import org.junit.jupiter.api.Test; +import org.tabletest.junit.TableTest; + +class ParsedConfigKeyTests { + + @TableTest({ + "scenario | configKey | org | version | product | configId ", + "no version | employee/ASM_DD/1.recommended.json/config | employee | | ASM_DD | 1.recommended.json ", + "live debugging | datadog/2/LIVE_DEBUGGING/Snapshot_1ba66cc9-146a-3479-9e66-2b63fd580f48/dog | datadog | 2 | LIVE_DEBUGGING | Snapshot_1ba66cc9-146a-3479-9e66-2b63fd580f48", + "unknown product | datadog/2/NOT_REAL_PRODUCT/123/dogoz | datadog | 2 | _UNKNOWN | 123 " + }) + void parseExtractsRightSegments( + String configKey, String org, Integer version, Product product, String configId) { + ParsedConfigKey parsed = ParsedConfigKey.parse(configKey); + + assertEquals(org, parsed.getOrg()); + assertEquals(version, parsed.getVersion()); + assertEquals(product, parsed.getProduct()); + assertEquals(configId, parsed.getConfigId()); + assertEquals(configKey, parsed.toString()); + } + + @Test + void wrongFormatConfigKeyFails() { + ReportableException exception = + assertThrows(ReportableException.class, () -> ParsedConfigKey.parse("foo")); + assertEquals("Not a valid config key: foo", exception.getMessage()); + } +} diff --git a/remote-config/remote-config-core/src/test/java/datadog/remoteconfig/state/ProductStateSpecification.java b/remote-config/remote-config-core/src/test/java/datadog/remoteconfig/state/ProductStateSpecification.java new file mode 100644 index 00000000000..360c2d0a99c --- /dev/null +++ b/remote-config/remote-config-core/src/test/java/datadog/remoteconfig/state/ProductStateSpecification.java @@ -0,0 +1,383 @@ +package datadog.remoteconfig.state; + +import static java.nio.charset.StandardCharsets.UTF_8; +import static java.util.Collections.singletonMap; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.doThrow; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import datadog.remoteconfig.PollingRateHinter; +import datadog.remoteconfig.Product; +import datadog.remoteconfig.ReportableException; +import datadog.remoteconfig.tuf.RemoteConfigResponse; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.Test; + +class ProductStateSpecification { + + private final PollingRateHinter hinter = mock(PollingRateHinter.class); + + @Test + void testApplyForNonAsmDdProductAppliesChangesBeforeRemoves() { + // a ProductState for ASM_DATA + ProductState productState = new ProductState(Product.ASM_DATA); + OrderRecordingListener listener = new OrderRecordingListener(); + productState.addProductListener(listener); + + // first apply with config1 to cache it + RemoteConfigResponse response1 = + buildResponse(targets("org/ASM_DATA/config1/foo", new TargetSpec(1, 8, "oldhash1"))); + ParsedConfigKey key1 = ParsedConfigKey.parse("org/ASM_DATA/config1/foo"); + productState.apply(response1, Collections.singletonList(key1), hinter); + listener.operations.clear(); // Clear for the actual test + + // a new response with config1 (changed hash) and config2 (new) + RemoteConfigResponse response2 = + buildResponse( + targets( + "org/ASM_DATA/config1/foo", new TargetSpec(2, 8, "newhash1"), + "org/ASM_DATA/config2/foo", new TargetSpec(1, 8, "hash2"))); + ParsedConfigKey key2 = ParsedConfigKey.parse("org/ASM_DATA/config2/foo"); + + // apply is called + boolean changed = productState.apply(response2, Arrays.asList(key1, key2), hinter); + + // changes are detected + assertTrue(changed); + + // operations happen in order: apply config1, apply config2, commit (no removes) + assertEquals( + Arrays.asList( + "accept:org/ASM_DATA/config1/foo", "accept:org/ASM_DATA/config2/foo", "commit"), + listener.operations); + } + + @Test + void testApplyForAsmDdProductAppliesChangesAfterRemoves() { + // a ProductState for ASM_DD + ProductState productState = new ProductState(Product.ASM_DD); + OrderRecordingListener listener = new OrderRecordingListener(); + productState.addProductListener(listener); + + // first apply with config1 and config2 to cache them + RemoteConfigResponse response1 = + buildResponse( + targets( + "org/ASM_DD/config1/foo", new TargetSpec(1, 8, "oldhash1"), + "org/ASM_DD/config2/foo", new TargetSpec(1, 8, "hash2"))); + ParsedConfigKey key1 = ParsedConfigKey.parse("org/ASM_DD/config1/foo"); + ParsedConfigKey key2 = ParsedConfigKey.parse("org/ASM_DD/config2/foo"); + productState.apply(response1, Arrays.asList(key1, key2), hinter); + listener.operations.clear(); // Clear for the actual test + + // a new response with only config1 (changed hash) - config2 will be removed + RemoteConfigResponse response2 = + buildResponse(targets("org/ASM_DD/config1/foo", new TargetSpec(2, 8, "newhash1"))); + + // apply is called + boolean changed = productState.apply(response2, Collections.singletonList(key1), hinter); + + // changes are detected + assertTrue(changed); + + // operations happen in order: remove config2 FIRST, then apply config1, then commit + assertEquals( + Arrays.asList("remove:org/ASM_DD/config2/foo", "accept:org/ASM_DD/config1/foo", "commit"), + listener.operations); + } + + @Test + void testAsmDdWithMultipleNewConfigsRemovesBeforeAppliesAll() { + // a ProductState for ASM_DD + ProductState productState = new ProductState(Product.ASM_DD); + OrderRecordingListener listener = new OrderRecordingListener(); + productState.addProductListener(listener); + + // first apply with old configs + RemoteConfigResponse response1 = + buildResponse( + targets( + "org/ASM_DD/old1/foo", new TargetSpec(1, 8, "hash_old1"), + "org/ASM_DD/old2/foo", new TargetSpec(1, 8, "hash_old2"))); + ParsedConfigKey oldKey1 = ParsedConfigKey.parse("org/ASM_DD/old1/foo"); + ParsedConfigKey oldKey2 = ParsedConfigKey.parse("org/ASM_DD/old2/foo"); + productState.apply(response1, Arrays.asList(oldKey1, oldKey2), hinter); + listener.operations.clear(); // Clear for the actual test + + // a response with completely new configs + RemoteConfigResponse response2 = + buildResponse( + targets( + "org/ASM_DD/new1/foo", new TargetSpec(1, 8, "hash_new1"), + "org/ASM_DD/new2/foo", new TargetSpec(1, 8, "hash_new2"))); + ParsedConfigKey newKey1 = ParsedConfigKey.parse("org/ASM_DD/new1/foo"); + ParsedConfigKey newKey2 = ParsedConfigKey.parse("org/ASM_DD/new2/foo"); + + // apply is called + boolean changed = productState.apply(response2, Arrays.asList(newKey1, newKey2), hinter); + + // changes are detected + assertTrue(changed); + + // all removes happen before all applies + assertEquals(5, listener.operations.size()); // 2 removes + 2 accepts + 1 commit + assertEquals(2, countStartingWith(listener.operations, "remove:")); + assertEquals(2, countStartingWith(listener.operations, "accept:")); + + // removes come before accepts + int lastRemoveIdx = lastIndexStartingWith(listener.operations, "remove:"); + int firstAcceptIdx = firstIndexStartingWith(listener.operations, "accept:"); + assertTrue(lastRemoveIdx < firstAcceptIdx); + } + + @Test + void testNoChangesDetectedWhenConfigHashesMatch() { + // a ProductState + ProductState productState = new ProductState(Product.ASM_DATA); + OrderRecordingListener listener = new OrderRecordingListener(); + productState.addProductListener(listener); + + // first apply with a config + RemoteConfigResponse response = + buildResponse(targets("org/ASM_DATA/config1/foo", new TargetSpec(1, 8, "hash1"))); + ParsedConfigKey key1 = ParsedConfigKey.parse("org/ASM_DATA/config1/foo"); + productState.apply(response, Collections.singletonList(key1), hinter); + listener.operations.clear(); // Clear for the actual test + + // apply is called again with the same hash + boolean changed = productState.apply(response, Collections.singletonList(key1), hinter); + + // no changes are detected + assertFalse(changed); + + // no listener operations occurred + assertTrue(listener.operations.isEmpty()); + } + + @Test + void testErrorHandlingDuringApply() throws Exception { + // a ProductState + ProductState productState = new ProductState(Product.ASM_DATA); + ProductListener listener = mock(ProductListener.class); + productState.addProductListener(listener); + + // a response with a config + RemoteConfigResponse response = + buildResponse(targets("org/ASM_DATA/config1/foo", new TargetSpec(1, 8, "hash1"))); + + // listener throws an exception + doThrow(new RuntimeException("Listener error")).when(listener).accept(any(), any(), any()); + + ParsedConfigKey key1 = ParsedConfigKey.parse("org/ASM_DATA/config1/foo"); + + // apply is called + boolean changed = productState.apply(response, Collections.singletonList(key1), hinter); + + // changes are still detected + assertTrue(changed); + + // commit is still called despite the error + verify(listener).commit(hinter); + } + + @Test + void testReportableExceptionIsRecorded() throws Exception { + // a ProductState + ProductState productState = new ProductState(Product.ASM_DATA); + ProductListener listener = mock(ProductListener.class); + productState.addProductListener(listener); + + // a response with a config + RemoteConfigResponse response = + buildResponse(targets("org/ASM_DATA/config1/foo", new TargetSpec(1, 8, "hash1"))); + + // listener throws a ReportableException + ReportableException exception = new ReportableException("Test error"); + doThrow(exception).when(listener).accept(any(), any(), any()); + + ParsedConfigKey key1 = ParsedConfigKey.parse("org/ASM_DATA/config1/foo"); + + // apply is called + productState.apply(response, Collections.singletonList(key1), hinter); + + // error is recorded + assertTrue(productState.hasError()); + assertTrue(productState.getErrors().contains(exception)); + } + + @Test + void testConfigListenersAreCalledInAdditionToProductListeners() { + // a ProductState + ProductState productState = new ProductState(Product.ASM_DATA); + OrderRecordingListener productListener = new OrderRecordingListener(); + OrderRecordingListener configListener = new OrderRecordingListener(); + productState.addProductListener(productListener); + productState.addProductListener("config1", configListener); + + // a response with two configs + RemoteConfigResponse response = + buildResponse( + targets( + "org/ASM_DATA/config1/foo", new TargetSpec(1, 8, "hash1"), + "org/ASM_DATA/config2/foo", new TargetSpec(1, 8, "hash2"))); + + ParsedConfigKey key1 = ParsedConfigKey.parse("org/ASM_DATA/config1/foo"); + ParsedConfigKey key2 = ParsedConfigKey.parse("org/ASM_DATA/config2/foo"); + + // apply is called + productState.apply(response, Arrays.asList(key1, key2), hinter); + + // productListener received both configs + assertEquals(2, countStartingWith(productListener.operations, "accept:")); + + // configListener only received config1 + assertEquals( + Arrays.asList("accept:org/ASM_DATA/config1/foo", "commit"), configListener.operations); + } + + @Test + void testRemoveOperationsCleanupCachedData() throws Exception { + // a ProductState + ProductState productState = new ProductState(Product.ASM_DATA); + ProductListener listener = mock(ProductListener.class); + productState.addProductListener(listener); + + // first apply with a config to cache it + RemoteConfigResponse response1 = + buildResponse(targets("org/ASM_DATA/config1/foo", new TargetSpec(1, 8, "hash1"))); + ParsedConfigKey key1 = ParsedConfigKey.parse("org/ASM_DATA/config1/foo"); + productState.apply(response1, Collections.singletonList(key1), hinter); + + // an empty response (config should be removed) + RemoteConfigResponse response2 = buildResponse(Collections.emptyMap()); + + // apply is called + boolean changed = + productState.apply(response2, Collections.emptyList(), hinter); + + // changes are detected + assertTrue(changed); + + // listener remove was called + verify(listener).remove(key1, hinter); + + // cached data is cleaned up + assertTrue(productState.getCachedTargetFiles().isEmpty()); + assertTrue(productState.getConfigStates().isEmpty()); + } + + // Helper methods + + private static Map targets(String path, TargetSpec spec) { + return Collections.singletonMap(path, spec); + } + + private static Map targets( + String path1, TargetSpec spec1, String path2, TargetSpec spec2) { + Map targets = new HashMap<>(); + targets.put(path1, spec1); + targets.put(path2, spec2); + return targets; + } + + private static RemoteConfigResponse buildResponse(Map targets) { + RemoteConfigResponse response = mock(RemoteConfigResponse.class); + + for (Map.Entry entry : targets.entrySet()) { + String path = entry.getKey(); + TargetSpec targetData = entry.getValue(); + + RemoteConfigResponse.Targets.ConfigTarget target = + new RemoteConfigResponse.Targets.ConfigTarget(); + target.hashes = singletonMap("sha256", targetData.hash); + target.length = targetData.length; + + RemoteConfigResponse.Targets.ConfigTarget.ConfigTargetCustom custom = + new RemoteConfigResponse.Targets.ConfigTarget.ConfigTargetCustom(); + custom.version = targetData.version; + target.custom = custom; + + when(response.getTarget(path)).thenReturn(target); + when(response.getFileContents(path)) + .thenReturn(("content_" + targetData.hash).getBytes(UTF_8)); + } + + // Handle empty targets case + if (targets.isEmpty()) { + when(response.getTarget(any())).thenReturn(null); + } + + return response; + } + + private static int countStartingWith(List operations, String prefix) { + int count = 0; + for (String operation : operations) { + if (operation.startsWith(prefix)) { + count++; + } + } + return count; + } + + private static int firstIndexStartingWith(List operations, String prefix) { + for (int index = 0; index < operations.size(); index++) { + if (operations.get(index).startsWith(prefix)) { + return index; + } + } + return -1; + } + + private static int lastIndexStartingWith(List operations, String prefix) { + for (int index = operations.size() - 1; index >= 0; index--) { + if (operations.get(index).startsWith(prefix)) { + return index; + } + } + return -1; + } + + // Light structure describing a target's metadata for the mocked response + private static final class TargetSpec { + final long version; + final long length; + final String hash; + + TargetSpec(long version, long length, String hash) { + this.version = version; + this.length = length; + this.hash = hash; + } + } + + // Test helper class to record operation order + static class OrderRecordingListener implements ProductListener { + final List operations = new ArrayList<>(); + + @Override + public void accept(ConfigKey configKey, byte[] content, PollingRateHinter pollingRateHinter) { + operations.add("accept:" + configKey.toString()); + } + + @Override + public void remove(ConfigKey configKey, PollingRateHinter pollingRateHinter) { + operations.add("remove:" + configKey.toString()); + } + + @Override + public void commit(PollingRateHinter pollingRateHinter) { + operations.add("commit"); + } + } +} diff --git a/repository.datadog.yaml b/repository.datadog.yaml index 453f9f5e1c6..21b1af02a4d 100644 --- a/repository.datadog.yaml +++ b/repository.datadog.yaml @@ -14,3 +14,4 @@ branches: master: allow_skip_checks: true require_reason_for_skip_checks: true + allow_custom_commit_message: true diff --git a/settings-gradle.lockfile b/settings-gradle.lockfile index 709a43f74f8..1aa2035e270 100644 --- a/settings-gradle.lockfile +++ b/settings-gradle.lockfile @@ -1,4 +1,5 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew dependencies --write-locks empty=incomingCatalogForLibs0 diff --git a/settings.gradle.kts b/settings.gradle.kts index bd5aaceffaa..86aa23cc9d4 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -16,11 +16,20 @@ pluginManagement { } gradlePluginPortal() mavenCentral() + // Hosts gradle-tooling-api, a transitive dep of the build-logic:smoke-test plugin used + // to run nested Gradle builds for smoke-test applications pinned to older Gradle versions. + maven { + url = uri("https://repo.gradle.org/gradle/libs-releases") + content { + includeGroup("org.gradle") + } + } } + includeBuild("build-logic") } plugins { - id("com.gradle.develocity") version "4.4.1" + id("com.gradle.develocity") version "4.5.0" id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0" } @@ -103,6 +112,7 @@ include( include( ":communication", + ":components:annotations", ":components:context", ":components:environment", ":components:http:http-api", @@ -151,6 +161,7 @@ include( ":products:feature-flagging:feature-flagging-agent", ":products:feature-flagging:feature-flagging-api", ":products:feature-flagging:feature-flagging-bootstrap", + ":products:feature-flagging:feature-flagging-config", ":products:feature-flagging:feature-flagging-lib" ) @@ -159,7 +170,8 @@ include( ":dd-java-agent:testing", ":utils:config-utils", ":utils:container-utils", - ":utils:junit-utils", + ":utils:test-junit-utils", + ":utils:test-junit-converter-utils", ":utils:filesystem-utils", ":utils:flare-utils", ":utils:logging-utils", @@ -349,6 +361,7 @@ include( ":dd-java-agent:instrumentation:finatra-2.9", ":dd-java-agent:instrumentation:freemarker:freemarker-2.3.24", ":dd-java-agent:instrumentation:freemarker:freemarker-2.3.9", + ":dd-java-agent:instrumentation:gax-1.4", ":dd-java-agent:instrumentation:glassfish-3.0", ":dd-java-agent:instrumentation:google-http-client-1.19", ":dd-java-agent:instrumentation:google-pubsub-1.116", @@ -418,6 +431,8 @@ include( ":dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-8.1.3", ":dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-9.2", ":dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-9.3", + ":dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-9.4", + ":dd-java-agent:instrumentation:jetty:jetty-appsec:jetty-appsec-11.0", ":dd-java-agent:instrumentation:jetty:jetty-client:jetty-client-10.0", ":dd-java-agent:instrumentation:jetty:jetty-client:jetty-client-12.0", ":dd-java-agent:instrumentation:jetty:jetty-client:jetty-client-9.1", @@ -451,7 +466,8 @@ include( ":dd-java-agent:instrumentation:kafka:kafka-connect-0.11", ":dd-java-agent:instrumentation:kafka:kafka-streams-0.11", ":dd-java-agent:instrumentation:kafka:kafka-streams-1.0", - ":dd-java-agent:instrumentation:karate-1.0", + ":dd-java-agent:instrumentation:karate:karate-1.0", + ":dd-java-agent:instrumentation:karate:karate-2.0", ":dd-java-agent:instrumentation:kotlin-coroutines-1.3", ":dd-java-agent:instrumentation:lettuce:lettuce-4.0", ":dd-java-agent:instrumentation:lettuce:lettuce-5.0", @@ -527,6 +543,7 @@ include( ":dd-java-agent:instrumentation:reactor-core-3.1", ":dd-java-agent:instrumentation:reactor-netty-1.0", ":dd-java-agent:instrumentation:rediscala-1.8", + ":dd-java-agent:instrumentation:robolectric-4.13", ":dd-java-agent:instrumentation:redisson:redisson-2.0.0", ":dd-java-agent:instrumentation:redisson:redisson-2.3.0", ":dd-java-agent:instrumentation:redisson:redisson-3.10.3", @@ -546,6 +563,7 @@ include( ":dd-java-agent:instrumentation:rs:jax-rs:jax-rs-client:jax-rs-client-2.0", ":dd-java-agent:instrumentation:rxjava:rxjava-1.0", ":dd-java-agent:instrumentation:rxjava:rxjava-2.0", + ":dd-java-agent:instrumentation:rxjava:rxjava-3.0", ":dd-java-agent:instrumentation:scala:scala-concurrent-2.8", ":dd-java-agent:instrumentation:scala:scala-promise:scala-promise-2.10", ":dd-java-agent:instrumentation:scala:scala-promise:scala-promise-2.13", diff --git a/telemetry/build.gradle.kts b/telemetry/build.gradle.kts index 1b66facc063..c6e72af33ed 100644 --- a/telemetry/build.gradle.kts +++ b/telemetry/build.gradle.kts @@ -5,30 +5,27 @@ plugins { apply(from = "$rootDir/gradle/java.gradle") -val minimumBranchCoverage by extra(0.6) -val minimumInstructionCoverage by extra(0.8) -val excludedClassesCoverage by extra( - listOf( - "datadog.telemetry.TelemetryRunnable.ThreadSleeperImpl", - "datadog.telemetry.HostInfo", - "datadog.telemetry.HostInfo.Os", - "datadog.telemetry.dependency.LocationsCollectingTransformer", - "datadog.telemetry.dependency.JbossVirtualFileHelper", - "datadog.telemetry.RequestBuilder.NumberJsonAdapter", - "datadog.telemetry.RequestBuilderSupplier", - "datadog.telemetry.TelemetrySystem", - "datadog.telemetry.api.*", - "datadog.telemetry.metric.CiVisibilityMetricPeriodicAction" - ) +extra["minimumBranchCoverage"] = 0.6 +extra["minimumInstructionCoverage"] = 0.8 +extra["excludedClassesCoverage"] = listOf( + "datadog.telemetry.TelemetryRunnable.ThreadSleeperImpl", + "datadog.telemetry.HostInfo", + "datadog.telemetry.HostInfo.Os", + "datadog.telemetry.dependency.LocationsCollectingTransformer", + "datadog.telemetry.dependency.JbossVirtualFileHelper", + "datadog.telemetry.RequestBuilder.NumberJsonAdapter", + "datadog.telemetry.RequestBuilderSupplier", + "datadog.telemetry.TelemetrySystem", + "datadog.telemetry.api.*", + "datadog.telemetry.metric.CiVisibilityMetricPeriodicAction", + "datadog.telemetry.metric.OtelSpiMetricPeriodicAction" ) -val excludedClassesBranchCoverage by extra( - listOf( - "datadog.telemetry.PolymorphicAdapterFactory.1", - "datadog.telemetry.HostInfo", - "datadog.telemetry.HostInfo.Os" - ) +extra["excludedClassesBranchCoverage"] = listOf( + "datadog.telemetry.PolymorphicAdapterFactory.1", + "datadog.telemetry.HostInfo", + "datadog.telemetry.HostInfo.Os" ) -val excludedClassesInstructionCoverage by extra(emptyList()) +extra["excludedClassesInstructionCoverage"] = emptyList() dependencies { implementation(libs.slf4j) @@ -49,6 +46,7 @@ dependencies { api(libs.moshi) testImplementation(project(":utils:test-utils")) + testImplementation(libs.bundles.mockito) testImplementation(group = "org.jboss", name = "jboss-vfs", version = "3.2.16.Final") } diff --git a/telemetry/gradle.lockfile b/telemetry/gradle.lockfile index 88aecc3fc24..46464fabf07 100644 --- a/telemetry/gradle.lockfile +++ b/telemetry/gradle.lockfile @@ -1,6 +1,7 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :telemetry:dependencies --write-locks cafe.cryptography:curve25519-elisabeth:0.1.0=jmhRuntimeClasspath,testRuntimeClasspath cafe.cryptography:ed25519-elisabeth:0.1.0=jmhRuntimeClasspath,testRuntimeClasspath ch.qos.logback:logback-classic:1.2.13=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -8,20 +9,20 @@ ch.qos.logback:logback-core:1.2.13=jmhRuntimeClasspath,testCompileClasspath,test com.blogspot.mydailyjava:weak-lock-free:0.17=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -com.datadoghq:dd-instrument-java:0.0.3=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-instrument-java:0.0.4=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq:java-dogstatsd-client:4.4.5=jmhRuntimeClasspath,testRuntimeClasspath com.datadoghq:sketches-java:0.8.3=jmhRuntimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=jmhRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=jmhRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=jmhRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=jmhRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=jmhRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=jmhRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=jmhRuntimeClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=jmhRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=jmhRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=jmhRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=jmhRuntimeClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=jmhRuntimeClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=jmhRuntimeClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,jmhCompileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -36,8 +37,8 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=jmhRuntimeClasspath,testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.jopt-simple:jopt-simple:5.0.4=jmh,jmhCompileClasspath,jmhRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc @@ -62,10 +63,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.jboss.logging:jboss-logging:3.1.4.GA=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.jboss:jboss-vfs:3.2.16.Final=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath @@ -77,7 +78,8 @@ org.junit.platform:junit-platform-engine:1.14.1=jmhRuntimeClasspath,testCompileC org.junit.platform:junit-platform-launcher:1.14.1=jmhRuntimeClasspath,testRuntimeClasspath org.junit:junit-bom:5.14.0=spotbugs org.junit:junit-bom:5.14.1=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath -org.mockito:mockito-core:4.4.0=jmhRuntimeClasspath,testRuntimeClasspath +org.mockito:mockito-core:4.4.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-junit-jupiter:4.4.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.objenesis:objenesis:3.3=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.openjdk.jmh:jmh-core:1.37=jmh,jmhCompileClasspath,jmhRuntimeClasspath org.openjdk.jmh:jmh-generator-asm:1.37=jmh,jmhCompileClasspath,jmhRuntimeClasspath @@ -86,15 +88,17 @@ org.openjdk.jmh:jmh-generator-reflection:1.37=jmh,jmhCompileClasspath,jmhRuntime org.opentest4j:opentest4j:1.3.0=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=jmhRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt org.ow2.asm:asm-commons:9.7.1=jmhRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt org.ow2.asm:asm-tree:9.7.1=jmhRuntimeClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=jmhRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs org.ow2.asm:asm:9.0=jmh -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm:9.9.1=compileClasspath,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.10.1=compileClasspath,jacocoAnt,jmhCompileClasspath,jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=jmhRuntimeClasspath,testCompileClasspath,testRuntimeClasspath diff --git a/telemetry/src/main/java/datadog/telemetry/TelemetryRequestBody.java b/telemetry/src/main/java/datadog/telemetry/TelemetryRequestBody.java index 3c3cf3d35e8..40bd2e46471 100644 --- a/telemetry/src/main/java/datadog/telemetry/TelemetryRequestBody.java +++ b/telemetry/src/main/java/datadog/telemetry/TelemetryRequestBody.java @@ -271,6 +271,19 @@ public void writeDependency(Dependency d) throws IOException { bodyWriter.name("hash").value(d.hash); // optional bodyWriter.name("name").value(d.name); bodyWriter.name("version").value(d.version); // optional + if (d.reachabilityMetadata != null) { + // Write metadata array even when empty: empty list signals "SCA is active for this dep" + // (RFC: all deps get metadata:[] at startup when DD_APPSEC_SCA_ENABLED=true). + // Null means SCA is disabled; empty list means SCA is enabled but no CVEs detected yet. + bodyWriter.name("metadata").beginArray(); + for (String value : d.reachabilityMetadata) { + bodyWriter.beginObject(); + bodyWriter.name("type").value("reachability"); + bodyWriter.name("value").value(value); // stringified JSON per RFC + bodyWriter.endObject(); + } + bodyWriter.endArray(); + } bodyWriter.endObject(); } diff --git a/telemetry/src/main/java/datadog/telemetry/TelemetrySystem.java b/telemetry/src/main/java/datadog/telemetry/TelemetrySystem.java index d49d9c21bcc..de6b2feed19 100644 --- a/telemetry/src/main/java/datadog/telemetry/TelemetrySystem.java +++ b/telemetry/src/main/java/datadog/telemetry/TelemetrySystem.java @@ -19,6 +19,7 @@ import datadog.telemetry.metric.WafMetricPeriodicAction; import datadog.telemetry.products.ProductChangeAction; import datadog.telemetry.rum.RumPeriodicAction; +import datadog.telemetry.sca.ScaReachabilityPeriodicAction; import datadog.trace.api.Config; import datadog.trace.api.InstrumenterConfig; import datadog.trace.api.civisibility.config.BazelMode; @@ -75,7 +76,14 @@ static Thread createTelemetryRunnable( } } if (null != dependencyService) { - actions.add(new DependencyPeriodicAction(dependencyService)); + if (Config.get().isAppSecScaEnabled()) { + // ScaReachabilityPeriodicAction takes over all dep reporting when SCA is enabled: + // it merges DependencyService drains with CVE registry state into one entry per dep. + // DependencyPeriodicAction is skipped to avoid duplicate app-dependencies-loaded entries. + actions.add(new ScaReachabilityPeriodicAction(dependencyService)); + } else { + actions.add(new DependencyPeriodicAction(dependencyService)); + } } if (Config.get().isTelemetryLogCollectionEnabled()) { actions.add(new LogPeriodicAction()); diff --git a/telemetry/src/main/java/datadog/telemetry/dependency/Dependency.java b/telemetry/src/main/java/datadog/telemetry/dependency/Dependency.java index fbf30ae7ffe..7d8b36bf489 100644 --- a/telemetry/src/main/java/datadog/telemetry/dependency/Dependency.java +++ b/telemetry/src/main/java/datadog/telemetry/dependency/Dependency.java @@ -46,11 +46,32 @@ public final class Dependency { public final String source; public final String hash; + /** + * Optional SCA reachability metadata. Each entry is a stringified JSON object conforming to the + * RFC reachability payload: {@code + * {"id":"GHSA-xxx","reached":[{"path":"...","symbol":"","line":1}]}}. Null for regular + * dependencies; non-null only when injected by {@code ScaReachabilityPeriodicAction}. Not + * serialized by the telemetry pipeline unless explicitly written by {@link + * datadog.telemetry.TelemetryRequestBody#writeDependency}. + */ + @Nullable public final List reachabilityMetadata; + public Dependency(String name, String version, String source, @Nullable String hash) { + this(name, version, source, hash, null); + } + + public Dependency( + String name, + String version, + String source, + @Nullable String hash, + @Nullable List reachabilityMetadata) { this.name = name; this.version = version; this.source = source; this.hash = hash; + this.reachabilityMetadata = + reachabilityMetadata != null ? Collections.unmodifiableList(reachabilityMetadata) : null; } @Override diff --git a/telemetry/src/main/java/datadog/telemetry/metric/CiVisibilityMetricPeriodicAction.java b/telemetry/src/main/java/datadog/telemetry/metric/CiVisibilityMetricPeriodicAction.java index 2638f609d83..15d40436a89 100644 --- a/telemetry/src/main/java/datadog/telemetry/metric/CiVisibilityMetricPeriodicAction.java +++ b/telemetry/src/main/java/datadog/telemetry/metric/CiVisibilityMetricPeriodicAction.java @@ -2,10 +2,10 @@ import datadog.trace.api.civisibility.InstrumentationBridge; import datadog.trace.api.telemetry.MetricCollector; -import edu.umd.cs.findbugs.annotations.NonNull; +import javax.annotation.Nonnull; public class CiVisibilityMetricPeriodicAction extends MetricPeriodicAction { - @NonNull + @Nonnull @Override public MetricCollector collector() { return InstrumentationBridge.getMetricCollector(); diff --git a/telemetry/src/main/java/datadog/telemetry/metric/ConfigInversionMetricPeriodicAction.java b/telemetry/src/main/java/datadog/telemetry/metric/ConfigInversionMetricPeriodicAction.java index d1d526fb2e9..d115aa9abeb 100644 --- a/telemetry/src/main/java/datadog/telemetry/metric/ConfigInversionMetricPeriodicAction.java +++ b/telemetry/src/main/java/datadog/telemetry/metric/ConfigInversionMetricPeriodicAction.java @@ -2,11 +2,11 @@ import datadog.trace.api.telemetry.ConfigInversionMetricCollectorImpl; import datadog.trace.api.telemetry.MetricCollector; -import edu.umd.cs.findbugs.annotations.NonNull; +import javax.annotation.Nonnull; public class ConfigInversionMetricPeriodicAction extends MetricPeriodicAction { @Override - @NonNull + @Nonnull public MetricCollector collector() { return ConfigInversionMetricCollectorImpl.getInstance(); } diff --git a/telemetry/src/main/java/datadog/telemetry/metric/CoreMetricsPeriodicAction.java b/telemetry/src/main/java/datadog/telemetry/metric/CoreMetricsPeriodicAction.java index 83ee04c661c..f7475929ba7 100644 --- a/telemetry/src/main/java/datadog/telemetry/metric/CoreMetricsPeriodicAction.java +++ b/telemetry/src/main/java/datadog/telemetry/metric/CoreMetricsPeriodicAction.java @@ -2,10 +2,10 @@ import datadog.trace.api.telemetry.CoreMetricCollector; import datadog.trace.api.telemetry.MetricCollector; -import edu.umd.cs.findbugs.annotations.NonNull; +import javax.annotation.Nonnull; public class CoreMetricsPeriodicAction extends MetricPeriodicAction { - @NonNull + @Nonnull @Override public MetricCollector collector() { return CoreMetricCollector.getInstance(); diff --git a/telemetry/src/main/java/datadog/telemetry/metric/IastMetricPeriodicAction.java b/telemetry/src/main/java/datadog/telemetry/metric/IastMetricPeriodicAction.java index f45889a753c..a4f434f5b82 100644 --- a/telemetry/src/main/java/datadog/telemetry/metric/IastMetricPeriodicAction.java +++ b/telemetry/src/main/java/datadog/telemetry/metric/IastMetricPeriodicAction.java @@ -2,12 +2,12 @@ import datadog.trace.api.iast.telemetry.IastMetricCollector; import datadog.trace.api.telemetry.MetricCollector; -import edu.umd.cs.findbugs.annotations.NonNull; +import javax.annotation.Nonnull; public class IastMetricPeriodicAction extends MetricPeriodicAction { @Override - @NonNull + @Nonnull public MetricCollector collector() { return IastMetricCollector.get(); } diff --git a/telemetry/src/main/java/datadog/telemetry/metric/LLMObsMetricPeriodicAction.java b/telemetry/src/main/java/datadog/telemetry/metric/LLMObsMetricPeriodicAction.java index 7b4e65ff713..91e3cb69eec 100644 --- a/telemetry/src/main/java/datadog/telemetry/metric/LLMObsMetricPeriodicAction.java +++ b/telemetry/src/main/java/datadog/telemetry/metric/LLMObsMetricPeriodicAction.java @@ -2,10 +2,10 @@ import datadog.trace.api.telemetry.LLMObsMetricCollector; import datadog.trace.api.telemetry.MetricCollector; -import edu.umd.cs.findbugs.annotations.NonNull; +import javax.annotation.Nonnull; public class LLMObsMetricPeriodicAction extends MetricPeriodicAction { - @NonNull + @Nonnull @Override public MetricCollector collector() { return LLMObsMetricCollector.get(); diff --git a/telemetry/src/main/java/datadog/telemetry/metric/MetricPeriodicAction.java b/telemetry/src/main/java/datadog/telemetry/metric/MetricPeriodicAction.java index c3088907a00..579eb6c761d 100644 --- a/telemetry/src/main/java/datadog/telemetry/metric/MetricPeriodicAction.java +++ b/telemetry/src/main/java/datadog/telemetry/metric/MetricPeriodicAction.java @@ -5,11 +5,11 @@ import datadog.telemetry.api.DistributionSeries; import datadog.telemetry.api.Metric; import datadog.trace.api.telemetry.MetricCollector; -import edu.umd.cs.findbugs.annotations.NonNull; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Map; +import javax.annotation.Nonnull; public abstract class MetricPeriodicAction implements TelemetryRunnable.TelemetryPeriodicAction { @Override @@ -23,7 +23,7 @@ public final void doIteration(final TelemetryService service) { toDistributionSeries(rawDistributionSeriesPoints).forEach(service::addDistributionSeries); } - @NonNull + @Nonnull public abstract MetricCollector collector(); private Collection toTelemetryMetrics(final Collection metrics) { diff --git a/telemetry/src/main/java/datadog/telemetry/metric/OtelEnvMetricPeriodicAction.java b/telemetry/src/main/java/datadog/telemetry/metric/OtelEnvMetricPeriodicAction.java index 6a9999ff5a3..2729d48ff2d 100644 --- a/telemetry/src/main/java/datadog/telemetry/metric/OtelEnvMetricPeriodicAction.java +++ b/telemetry/src/main/java/datadog/telemetry/metric/OtelEnvMetricPeriodicAction.java @@ -2,11 +2,11 @@ import datadog.trace.api.telemetry.MetricCollector; import datadog.trace.api.telemetry.OtelEnvMetricCollectorImpl; -import edu.umd.cs.findbugs.annotations.NonNull; +import javax.annotation.Nonnull; public class OtelEnvMetricPeriodicAction extends MetricPeriodicAction { @Override - @NonNull + @Nonnull public MetricCollector collector() { return OtelEnvMetricCollectorImpl.getInstance(); } diff --git a/telemetry/src/main/java/datadog/telemetry/metric/OtelSpiMetricPeriodicAction.java b/telemetry/src/main/java/datadog/telemetry/metric/OtelSpiMetricPeriodicAction.java index bbdd9bfc89c..6016f71d195 100644 --- a/telemetry/src/main/java/datadog/telemetry/metric/OtelSpiMetricPeriodicAction.java +++ b/telemetry/src/main/java/datadog/telemetry/metric/OtelSpiMetricPeriodicAction.java @@ -2,11 +2,11 @@ import datadog.trace.api.telemetry.MetricCollector; import datadog.trace.api.telemetry.OtelSpiCollector; -import edu.umd.cs.findbugs.annotations.NonNull; +import javax.annotation.Nonnull; public class OtelSpiMetricPeriodicAction extends MetricPeriodicAction { @Override - @NonNull + @Nonnull public MetricCollector collector() { return OtelSpiCollector.getInstance(); } diff --git a/telemetry/src/main/java/datadog/telemetry/metric/WafMetricPeriodicAction.java b/telemetry/src/main/java/datadog/telemetry/metric/WafMetricPeriodicAction.java index 6f3d10ba794..90dcedc9f97 100644 --- a/telemetry/src/main/java/datadog/telemetry/metric/WafMetricPeriodicAction.java +++ b/telemetry/src/main/java/datadog/telemetry/metric/WafMetricPeriodicAction.java @@ -2,12 +2,12 @@ import datadog.trace.api.telemetry.MetricCollector; import datadog.trace.api.telemetry.WafMetricCollector; -import edu.umd.cs.findbugs.annotations.NonNull; +import javax.annotation.Nonnull; public class WafMetricPeriodicAction extends MetricPeriodicAction { @Override - @NonNull + @Nonnull public MetricCollector collector() { return WafMetricCollector.get(); } diff --git a/telemetry/src/main/java/datadog/telemetry/sca/ScaReachabilityPeriodicAction.java b/telemetry/src/main/java/datadog/telemetry/sca/ScaReachabilityPeriodicAction.java new file mode 100644 index 00000000000..b1dd6b416a9 --- /dev/null +++ b/telemetry/src/main/java/datadog/telemetry/sca/ScaReachabilityPeriodicAction.java @@ -0,0 +1,241 @@ +package datadog.telemetry.sca; + +import datadog.telemetry.TelemetryRunnable; +import datadog.telemetry.TelemetryService; +import datadog.telemetry.dependency.Dependency; +import datadog.telemetry.dependency.DependencyService; +import datadog.trace.api.internal.VisibleForTesting; +import datadog.trace.api.telemetry.ScaReachabilityDependencyRegistry; +import datadog.trace.api.telemetry.ScaReachabilityDependencyRegistry.CveSnapshot; +import datadog.trace.api.telemetry.ScaReachabilityDependencyRegistry.DependencySnapshot; +import datadog.trace.api.telemetry.ScaReachabilityHit; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * Reports SCA Reachability state on each telemetry heartbeat, implementing the RFC stateful model. + * + *

      When SCA is enabled this action replaces {@link + * datadog.telemetry.dependency.DependencyPeriodicAction} as the sole emitter of {@code + * app-dependencies-loaded} events. It merges two sources into a single entry per dependency per + * heartbeat: + * + *

        + *
      1. {@link DependencyService} - newly detected JARs. Emitted with {@code metadata:[]} if no CVE + * state exists yet, or merged with CVE metadata if a state is already pending. Each resolved + * dependency is stored in {@link #knownDeps} for future lookups. + *
      2. {@link ScaReachabilityDependencyRegistry} - CVE state changes (registration and hits). + *
      + * + *

      This ensures one entry per {@code name:version} per heartbeat - no duplicates. + * + *

      The key invariant: whenever any CVE's state changes, ALL CVEs for the same dependency are + * re-reported together so the backend always has a complete picture. + * + *

      Timing invariant

      + * + *

      {@link DependencyService} resolves JARs asynchronously. A CVE may be registered before the + * corresponding JAR has been resolved. In that case, {@link #knownDeps} may not yet have an entry + * for the dep. Unmatched snapshots are emitted immediately without source/hash so CVE data is never + * delayed; when the dep is eventually resolved and stored in {@link #knownDeps}, subsequent CVE + * emissions (e.g., after a method hit) will include source/hash automatically. + * + *

      When the JAR is resolved in a later heartbeat (Step 2) but no CVE is pending (the CVE was + * drained in a prior heartbeat), Step 2 calls {@link + * ScaReachabilityDependencyRegistry#peekSnapshot} to retrieve the current CVE state without marking + * it pending again. This prevents emitting {@code metadata:[]} and overwriting the CVE state the + * backend already received. + */ +public final class ScaReachabilityPeriodicAction + implements TelemetryRunnable.TelemetryPeriodicAction { + + private final DependencyService dependencyService; + + /** + * Persistent across heartbeats: accumulates every dep resolved by {@link DependencyService}. + * Keyed by {@link ScaReachabilityDependencyRegistry#depKey(String, String)}. + * + *

      This cache allows Step 3 to enrich CVE snapshots with {@code source} and {@code hash} even + * when the dep was drained from {@link DependencyService} in an earlier heartbeat than the CVE + * hit. + */ + private final Map knownDeps = new HashMap<>(); + + public ScaReachabilityPeriodicAction(DependencyService dependencyService) { + this.dependencyService = dependencyService; + } + + /** + * Pre-populates {@link #knownDeps} with a dep entry. Used in tests to simulate a dep that was + * resolved by {@link DependencyService} in a prior heartbeat without running a full iteration. + */ + @VisibleForTesting + void addKnownDepForTesting(String name, String version) { + knownDeps.put( + ScaReachabilityDependencyRegistry.depKey(name, version), + new Dependency(name, version, null, null)); + } + + @Override + public void doIteration(TelemetryService telService) { + // Trigger pending retransformations (method-level symbols on already-loaded classes, or + // classes where JAR version resolution failed at load time and needs a retry). + Runnable work = ScaReachabilityDependencyRegistry.INSTANCE.getPeriodicWorkCallback(); + if (work != null) { + work.run(); + } + + // Step 1: drain registry → map keyed by "artifact@version" for O(1) lookup below. + List pending = + ScaReachabilityDependencyRegistry.INSTANCE.drainPendingDependencies(); + Map snapshotByKey = new HashMap<>(pending.size() * 2); + for (DependencySnapshot snapshot : pending) { + snapshotByKey.put( + ScaReachabilityDependencyRegistry.depKey(snapshot.artifact, snapshot.version), snapshot); + } + + // Step 2: drain DependencyService (newly detected JARs this heartbeat). + // Store each dep in knownDeps regardless of whether it has a CVE match — future heartbeats + // with CVE hits will look it up in Step 3. + if (dependencyService != null) { + for (Dependency dep : dependencyService.drainDeterminedDependencies()) { + String key = ScaReachabilityDependencyRegistry.depKey(dep.name, dep.version); + Dependency previous = knownDeps.put(key, dep); + DependencySnapshot snapshot = snapshotByKey.remove(key); + if (snapshot == null && isNewPhysicalCopy(previous, dep)) { + // First detection of this physical JAR: peek CVE state so we can enrich the emission + // instead of overwriting the backend's state with metadata:[]. Skip when the same + // physical copy is re-detected (same source/hash from a different classloader) — + // peekSnapshot would re-emit a stale hit already reported. + snapshot = ScaReachabilityDependencyRegistry.INSTANCE.peekSnapshot(dep.name, dep.version); + } + if (snapshot != null) { + telService.addDependency( + new Dependency(dep.name, dep.version, dep.source, dep.hash, buildMetadata(snapshot))); + } else if (isNewPhysicalCopy(previous, dep)) { + // First detection of this physical copy, no CVE state yet — metadata:[] signals "SCA is + // monitoring this dep". + telService.addDependency( + new Dependency(dep.name, dep.version, dep.source, dep.hash, Collections.emptyList())); + } + // Re-detection of the same physical copy (same source/hash) with no state change: nothing + // to emit. The backend already received this dep. + } + } + + // Step 3: handle CVE state changes for deps not in DependencyService this heartbeat. + // Always emit — never block CVE data. Use knownDeps for source/hash enrichment when the JAR + // was resolved in a prior heartbeat; otherwise emit without source/hash so the backend still + // receives the CVE state (it may correlate by name:version alone, and subsequent emissions + // for the same dep — triggered by method hits — will carry source/hash once knownDeps is + // populated). + for (DependencySnapshot snapshot : snapshotByKey.values()) { + String key = ScaReachabilityDependencyRegistry.depKey(snapshot.artifact, snapshot.version); + Dependency known = knownDeps.get(key); + if (known != null) { + // Dep was resolved in a prior heartbeat — emit enriched with source/hash. + telService.addDependency( + new Dependency( + known.name, known.version, known.source, known.hash, buildMetadata(snapshot))); + } else { + // Dep not yet resolved — emit without source/hash so CVE data is not delayed. + // When the dep is eventually resolved (stored in knownDeps via Step 2), subsequent + // CVE emissions (e.g., after a method hit) will include source/hash automatically. + telService.addDependency( + new Dependency( + snapshot.artifact, snapshot.version, null, null, buildMetadata(snapshot))); + } + } + } + + /** + * Decides whether {@code dep} represents a new physical copy of an artifact that the backend has + * not yet seen, as opposed to a re-detection of a JAR already reported. + * + *

      A "new physical copy" is a distinct file on disk. Two copies share the same {@code + * name@version} key but differ in {@code source} (the path/URI the JAR was loaded from) and/or + * {@code hash} (the content digest). A "re-detection" is the exact same physical file surfacing + * again, carrying an identical {@code source} and {@code hash}. + * + *

      Returns {@code true} when: + * + *

        + *
      • {@code previous == null} — first time we see this {@code name@version} key, or + *
      • {@code dep.source} differs from {@code previous.source}, or + *
      • {@code dep.hash} differs from {@code previous.hash}. + *
      + * + *

      {@link Objects#equals} is used for both comparisons because {@code source} and {@code hash} + * may legitimately be {@code null} (e.g. JARs whose origin or digest could not be resolved), and + * a plain {@code ==}/{@code .equals} would either NPE or misclassify two null values. + * + *

      Case this protects (must emit both): a Tomcat container running two webapps that each ship + * their own physical copy of the same artifact under different {@code WEB-INF/lib} paths. The + * copies have different {@code source}/{@code hash}, so both are reported — matching the behavior + * of the legacy {@link datadog.telemetry.dependency.DependencyPeriodicAction}. + * + *

      Case this suppresses (re-detection, do not re-emit): a Spring Boot fat JAR where {@code + * LaunchedURLClassLoader} reports the same nested JAR from the same URI on multiple heartbeats. + * The {@code source}/{@code hash} are identical, so the dep is emitted only once. + */ + private static boolean isNewPhysicalCopy(Dependency previous, Dependency dep) { + if (previous == null) { + return true; + } + if (!Objects.equals(dep.source, previous.source)) { + return true; + } + return !Objects.equals(dep.hash, previous.hash); + } + + private static List buildMetadata(DependencySnapshot snapshot) { + List metadataValues = new ArrayList<>(snapshot.cves.size()); + for (CveSnapshot cve : snapshot.cves) { + metadataValues.add(buildMetadataValue(cve)); + } + return metadataValues; + } + + /** + * Builds the stringified JSON value for one CVE snapshot, per RFC: + * + *

        + *
      • Not yet reached: {@code {"id":"GHSA-xxx","reached":[]}} + *
      • Reached: {@code + * {"id":"GHSA-xxx","reached":[{"path":"com.foo.Bar","symbol":"...","line":N}]}} + *
      + * + *

      Values are JSON-escaped via {@link #jsonEscape} even though GHSA IDs, JVM class names, and + * method names are structurally guaranteed not to contain {@code "} or {@code \} by the JVM spec. + * The escaping is a safety net against future changes to the value sources. + */ + static String buildMetadataValue(CveSnapshot cve) { + ScaReachabilityHit hit = cve.hit; + if (hit == null) { + // CVE known but no callsite yet - signals "monitoring, not reached" + return "{\"id\":\"" + jsonEscape(cve.vulnId) + "\",\"reached\":[]}"; + } + // CVE has been reached - include the callsite + return "{\"id\":\"" + + jsonEscape(hit.vulnId()) + + "\",\"reached\":[{\"path\":\"" + + jsonEscape(hit.className()) + + "\",\"symbol\":\"" + + jsonEscape(hit.symbolName()) + + "\",\"line\":" + + hit.line() + + "}]}"; + } + + /** Escapes a string for embedding in a JSON string literal. */ + private static String jsonEscape(String value) { + if (value.indexOf('"') == -1 && value.indexOf('\\') == -1) { + return value; // fast path: no escaping needed (the common case) + } + return value.replace("\\", "\\\\").replace("\"", "\\\""); + } +} diff --git a/telemetry/src/test/groovy/datadog/telemetry/dependency/DependencyPeriodActionSpecification.groovy b/telemetry/src/test/groovy/datadog/telemetry/dependency/DependencyPeriodActionSpecification.groovy index 88ac3c65cf1..c74e8bb6cf2 100644 --- a/telemetry/src/test/groovy/datadog/telemetry/dependency/DependencyPeriodActionSpecification.groovy +++ b/telemetry/src/test/groovy/datadog/telemetry/dependency/DependencyPeriodActionSpecification.groovy @@ -17,7 +17,8 @@ class DependencyPeriodActionSpecification extends DDSpecification { 1 * telemetryService.addDependency({ Dependency dep -> dep.name == 'name' && dep.version == '1.2.3' && - dep.hash == 'DEADBEEF' + dep.hash == 'DEADBEEF' && + dep.reachabilityMetadata == null }) 0 * _._ } diff --git a/telemetry/src/test/groovy/datadog/telemetry/metric/MetricPeriodicActionTest.groovy b/telemetry/src/test/groovy/datadog/telemetry/metric/MetricPeriodicActionTest.groovy index 0bc65695f55..649260c38d9 100644 --- a/telemetry/src/test/groovy/datadog/telemetry/metric/MetricPeriodicActionTest.groovy +++ b/telemetry/src/test/groovy/datadog/telemetry/metric/MetricPeriodicActionTest.groovy @@ -5,9 +5,9 @@ import datadog.telemetry.TelemetryService import datadog.telemetry.api.DistributionSeries import datadog.telemetry.api.Metric import datadog.trace.api.telemetry.MetricCollector -import edu.umd.cs.findbugs.annotations.NonNull import groovy.transform.NamedDelegate import groovy.transform.NamedVariant +import javax.annotation.Nonnull import spock.lang.Specification class MetricPeriodicActionTest extends Specification { @@ -159,12 +159,12 @@ class MetricPeriodicActionTest extends Specification { private final MetricCollector collector - DefaultMetricPeriodicAction(@NonNull final MetricCollector collector) { + DefaultMetricPeriodicAction(@Nonnull final MetricCollector collector) { this.collector = collector } @Override - @NonNull + @Nonnull MetricCollector collector() { return collector } diff --git a/telemetry/src/test/groovy/datadog/telemetry/metric/WafMetricPeriodicActionSpecification.groovy b/telemetry/src/test/groovy/datadog/telemetry/metric/WafMetricPeriodicActionSpecification.groovy index 4d5459edcae..9486fc432aa 100644 --- a/telemetry/src/test/groovy/datadog/telemetry/metric/WafMetricPeriodicActionSpecification.groovy +++ b/telemetry/src/test/groovy/datadog/telemetry/metric/WafMetricPeriodicActionSpecification.groovy @@ -34,7 +34,7 @@ class WafMetricPeriodicActionSpecification extends DDSpecification { 1 * telemetryService.addMetric( { Metric metric -> metric.namespace == 'appsec' && metric.metric == 'waf.updates' && - metric.points[0][1] == 2 && + metric.points[0][1] == 1 && metric.tags == ['waf_version:0.0.0', 'event_rules_version:rules_ver_3', 'success:true'] } ) 0 * _._ @@ -43,16 +43,16 @@ class WafMetricPeriodicActionSpecification extends DDSpecification { void 'push waf request metrics and push into the telemetry'() { when: WafMetricCollector.get().wafInit('0.0.0', 'rules_ver_1', true) - WafMetricCollector.get().wafRequest(false, false, false, false, false, false, false) - WafMetricCollector.get().wafRequest(true, false, false, false, false, false, false) - WafMetricCollector.get().wafRequest(false, false, false, false, false, false, false) - WafMetricCollector.get().wafRequest(false, true, false, false, false, false, false) - WafMetricCollector.get().wafRequest(false, false, false, false, false, false, false) - WafMetricCollector.get().wafRequest(false, false, false, true, false, false, false) - WafMetricCollector.get().wafRequest(false, false, true, false, false, false, false) - WafMetricCollector.get().wafRequest(false, false, false, false, false, true, false) - WafMetricCollector.get().wafRequest(false, false, false, false, true, false, false) - WafMetricCollector.get().wafRequest(false, false, false, false, false, false, true) + WafMetricCollector.get().wafRequest(false, false, false, false, false, false, false, false) + WafMetricCollector.get().wafRequest(true, false, false, false, false, false, false, false) + WafMetricCollector.get().wafRequest(false, false, false, false, false, false, false, false) + WafMetricCollector.get().wafRequest(false, true, false, false, false, false, false, false) + WafMetricCollector.get().wafRequest(false, false, false, false, false, false, false, false) + WafMetricCollector.get().wafRequest(false, false, false, true, false, false, false, false) + WafMetricCollector.get().wafRequest(false, false, true, false, false, false, false, false) + WafMetricCollector.get().wafRequest(false, false, false, false, false, true, false, false) + WafMetricCollector.get().wafRequest(false, false, false, false, true, false, false, false) + WafMetricCollector.get().wafRequest(false, false, false, false, false, false, true, false) WafMetricCollector.get().prepareMetrics() periodicAction.doIteration(telemetryService) @@ -75,6 +75,7 @@ class WafMetricPeriodicActionSpecification extends DDSpecification { 'block_failure:false', 'rate_limited:false', 'input_truncated:false', + 'request_excluded:none', ] } ) 1 * telemetryService.addMetric( { Metric metric -> @@ -91,6 +92,7 @@ class WafMetricPeriodicActionSpecification extends DDSpecification { 'block_failure:false', 'rate_limited:false', 'input_truncated:false', + 'request_excluded:none', ] } ) 1 * telemetryService.addMetric( { Metric metric -> @@ -107,6 +109,7 @@ class WafMetricPeriodicActionSpecification extends DDSpecification { 'block_failure:false', 'rate_limited:false', 'input_truncated:false', + 'request_excluded:none', ] } ) 1 * telemetryService.addMetric( { Metric metric -> @@ -123,6 +126,7 @@ class WafMetricPeriodicActionSpecification extends DDSpecification { 'block_failure:false', 'rate_limited:false', 'input_truncated:false', + 'request_excluded:none', ] } ) 1 * telemetryService.addMetric( { Metric metric -> @@ -139,6 +143,7 @@ class WafMetricPeriodicActionSpecification extends DDSpecification { 'block_failure:false', 'rate_limited:false', 'input_truncated:false', + 'request_excluded:none', ] } ) 1 * telemetryService.addMetric( { Metric metric -> @@ -155,6 +160,7 @@ class WafMetricPeriodicActionSpecification extends DDSpecification { 'block_failure:true', 'rate_limited:false', 'input_truncated:false', + 'request_excluded:none', ] } ) 1 * telemetryService.addMetric( { Metric metric -> @@ -171,6 +177,7 @@ class WafMetricPeriodicActionSpecification extends DDSpecification { 'block_failure:false', 'rate_limited:true', 'input_truncated:false', + 'request_excluded:none', ] } ) 1 * telemetryService.addMetric( { Metric metric -> @@ -187,20 +194,21 @@ class WafMetricPeriodicActionSpecification extends DDSpecification { 'block_failure:false', 'rate_limited:false', 'input_truncated:true', + 'request_excluded:none', ] } ) 0 * _._ when: 'waf.updates happens' WafMetricCollector.get().wafUpdates('rules_ver_2', true) - WafMetricCollector.get().wafRequest(false, false, false, false, false, false, false) - WafMetricCollector.get().wafRequest(true, false, false, false, false, false, false) - WafMetricCollector.get().wafRequest(false, true, false, false, false, false, false) - WafMetricCollector.get().wafRequest(false, false, false, true, false, false, false) - WafMetricCollector.get().wafRequest(false, false, true, false, false, false, false) - WafMetricCollector.get().wafRequest(false, false, false, false, false, true, false) - WafMetricCollector.get().wafRequest(false, false, false, false, true, false, false) - WafMetricCollector.get().wafRequest(false, false, false, false, false, false, true) + WafMetricCollector.get().wafRequest(false, false, false, false, false, false, false, false) + WafMetricCollector.get().wafRequest(true, false, false, false, false, false, false, false) + WafMetricCollector.get().wafRequest(false, true, false, false, false, false, false, false) + WafMetricCollector.get().wafRequest(false, false, false, true, false, false, false, false) + WafMetricCollector.get().wafRequest(false, false, true, false, false, false, false, false) + WafMetricCollector.get().wafRequest(false, false, false, false, false, true, false, false) + WafMetricCollector.get().wafRequest(false, false, false, false, true, false, false, false) + WafMetricCollector.get().wafRequest(false, false, false, false, false, false, true, false) WafMetricCollector.get().prepareMetrics() periodicAction.doIteration(telemetryService) @@ -223,6 +231,7 @@ class WafMetricPeriodicActionSpecification extends DDSpecification { 'block_failure:false', 'rate_limited:false', 'input_truncated:false', + 'request_excluded:none', ] } ) 1 * telemetryService.addMetric( { Metric metric -> @@ -239,6 +248,7 @@ class WafMetricPeriodicActionSpecification extends DDSpecification { 'block_failure:false', 'rate_limited:false', 'input_truncated:false', + 'request_excluded:none', ] } ) 1 * telemetryService.addMetric( { Metric metric -> @@ -255,6 +265,7 @@ class WafMetricPeriodicActionSpecification extends DDSpecification { 'block_failure:false', 'rate_limited:false', 'input_truncated:false', + 'request_excluded:none', ] } ) 1 * telemetryService.addMetric( { Metric metric -> @@ -271,6 +282,7 @@ class WafMetricPeriodicActionSpecification extends DDSpecification { 'block_failure:false', 'rate_limited:false', 'input_truncated:false', + 'request_excluded:none', ] } ) 1 * telemetryService.addMetric( { Metric metric -> @@ -287,6 +299,7 @@ class WafMetricPeriodicActionSpecification extends DDSpecification { 'block_failure:false', 'rate_limited:false', 'input_truncated:false', + 'request_excluded:none', ] } ) 1 * telemetryService.addMetric( { Metric metric -> @@ -303,6 +316,7 @@ class WafMetricPeriodicActionSpecification extends DDSpecification { 'block_failure:true', 'rate_limited:false', 'input_truncated:false', + 'request_excluded:none', ] } ) 1 * telemetryService.addMetric( { Metric metric -> @@ -319,6 +333,7 @@ class WafMetricPeriodicActionSpecification extends DDSpecification { 'block_failure:false', 'rate_limited:true', 'input_truncated:false', + 'request_excluded:none', ] } ) 1 * telemetryService.addMetric( { Metric metric -> @@ -335,6 +350,7 @@ class WafMetricPeriodicActionSpecification extends DDSpecification { 'block_failure:false', 'rate_limited:false', 'input_truncated:true', + 'request_excluded:none', ] } ) 0 * _._ diff --git a/telemetry/src/test/java/datadog/telemetry/TelemetryRequestBodyDependencyMetadataTest.java b/telemetry/src/test/java/datadog/telemetry/TelemetryRequestBodyDependencyMetadataTest.java new file mode 100644 index 00000000000..9751aaf68d6 --- /dev/null +++ b/telemetry/src/test/java/datadog/telemetry/TelemetryRequestBodyDependencyMetadataTest.java @@ -0,0 +1,96 @@ +package datadog.telemetry; + +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.telemetry.api.RequestType; +import datadog.telemetry.dependency.Dependency; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Collections; +import okio.Buffer; +import org.junit.jupiter.api.Test; + +/** + * Verifies that {@link TelemetryRequestBody#writeDependency} correctly serializes the optional + * {@code metadata} array introduced for SCA Reachability. + */ +class TelemetryRequestBodyDependencyMetadataTest { + + @Test + void writeDependency_includesMetadataArrayWhenPresent() throws IOException { + String metadataValue = + "{\"id\":\"GHSA-645p-88qh-w398\"," + + "\"reached\":[{\"path\":\"com.fasterxml.jackson.databind.ObjectMapper\"," + + "\"symbol\":\"\",\"line\":1}]}"; + Dependency dep = + new Dependency( + "com.fasterxml.jackson.core:jackson-databind", + "2.8.5", + null, + null, + Collections.singletonList(metadataValue)); + + String json = serializeDependency(dep); + + assertTrue(json.contains("\"metadata\""), "metadata array must be present"); + assertTrue(json.contains("\"type\":\"reachability\""), "type field must be reachability"); + assertTrue(json.contains("\"value\":"), "value field must be present"); + assertTrue(json.contains("GHSA-645p-88qh-w398"), "GHSA ID must appear in value"); + } + + @Test + void writeDependency_includesAllMetadataEntriesForMultipleCves() throws IOException { + Dependency dep = + new Dependency( + "com.example:lib", + "1.0.0", + null, + null, + Arrays.asList( + "{\"id\":\"GHSA-aaa-1111-2222\",\"reached\":[]}", + "{\"id\":\"GHSA-bbb-3333-4444\",\"reached\":[]}")); + + String json = serializeDependency(dep); + + assertTrue(json.contains("GHSA-aaa-1111-2222"), "first CVE must be present"); + assertTrue(json.contains("GHSA-bbb-3333-4444"), "second CVE must be present"); + } + + @Test + void writeDependency_omitsMetadataFieldWhenNull() throws IOException { + Dependency dep = new Dependency("com.example:lib", "1.0.0", null, null); + + String json = serializeDependency(dep); + + assertFalse(json.contains("\"metadata\""), "metadata field must be absent when null"); + } + + @Test + void writeDependency_includesEmptyMetadataArrayWhenListIsEmpty() throws IOException { + // RFC: metadata:[] (non-null, empty) means "SCA is active for this dep but no CVEs detected". + // Must be written so the backend knows SCA is monitoring the dependency. + Dependency dep = + new Dependency("com.example:lib", "1.0.0", null, null, Collections.emptyList()); + + String json = serializeDependency(dep); + + assertTrue(json.contains("\"metadata\":[]"), "metadata:[] must be present when list is empty"); + } + + private static String serializeDependency(Dependency dep) throws IOException { + TelemetryRequestBody req = new TelemetryRequestBody(RequestType.APP_DEPENDENCIES_LOADED); + req.beginRequest(false); + req.beginDependencies(); + req.writeDependency(dep); + req.endDependencies(); + req.endRequest(); + + Buffer buf = new Buffer(); + req.writeTo(buf); + byte[] bytes = new byte[(int) buf.size()]; + buf.read(bytes); + return new String(bytes, StandardCharsets.UTF_8); + } +} diff --git a/telemetry/src/test/java/datadog/telemetry/sca/ScaReachabilityPeriodicActionTest.java b/telemetry/src/test/java/datadog/telemetry/sca/ScaReachabilityPeriodicActionTest.java new file mode 100644 index 00000000000..4037e73286c --- /dev/null +++ b/telemetry/src/test/java/datadog/telemetry/sca/ScaReachabilityPeriodicActionTest.java @@ -0,0 +1,674 @@ +package datadog.telemetry.sca; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentCaptor.forClass; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.reset; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + +import datadog.telemetry.TelemetryService; +import datadog.telemetry.dependency.Dependency; +import datadog.telemetry.dependency.DependencyService; +import datadog.trace.api.telemetry.ScaReachabilityDependencyRegistry; +import datadog.trace.api.telemetry.ScaReachabilityHit; +import java.util.Collections; +import java.util.List; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.mockito.ArgumentCaptor; + +class ScaReachabilityPeriodicActionTest { + + private TelemetryService telService; + private ScaReachabilityPeriodicAction action; + + @BeforeEach + void setUp() { + ScaReachabilityDependencyRegistry.INSTANCE.resetForTesting(); + telService = mock(TelemetryService.class); + DependencyService depService = mock(DependencyService.class); + when(depService.drainDeterminedDependencies()).thenReturn(Collections.emptyList()); + action = new ScaReachabilityPeriodicAction(depService); + // Pre-populate knownDeps with the common test dep so registry-only tests can emit via Step 3. + // This simulates the dep having been resolved by DependencyService in a prior heartbeat. + action.addKnownDepForTesting("com.example:lib", "1.0.0"); + action.addKnownDepForTesting("com.example:lib-a", "1.0.0"); + action.addKnownDepForTesting("com.example:lib-b", "2.0.0"); + action.addKnownDepForTesting("com.other:lib", "2.0.0"); + } + + @Test + void doesNothingWhenNoPendingDependencies() { + action.doIteration(telService); + verify(telService, never()).addDependency(org.mockito.Mockito.any()); + } + + @Test + void reportsRegisteredCveWithEmptyReached() { + // CVE registered but no hit yet → metadata: [{cve-1, reached:[]}] + ScaReachabilityDependencyRegistry.INSTANCE.registerCve("com.example:lib", "1.0.0", "GHSA-xxx"); + + action.doIteration(telService); + + ArgumentCaptor captor = forClass(Dependency.class); + verify(telService, times(1)).addDependency(captor.capture()); + Dependency dep = captor.getValue(); + assertEquals("com.example:lib", dep.name); + assertEquals(1, dep.reachabilityMetadata.size()); + assertTrue( + dep.reachabilityMetadata.get(0).contains("\"reached\":[]"), + "CVE with no hit must have reached:[]"); + assertTrue(dep.reachabilityMetadata.get(0).contains("\"id\":\"GHSA-xxx\"")); + } + + @Test + void reportsRegisteredCveWithCallsiteAfterHit() { + // CVE registered, then hit → metadata: [{cve-1, reached:[callsite]}] + ScaReachabilityDependencyRegistry.INSTANCE.registerCve("com.example:lib", "1.0.0", "GHSA-xxx"); + ScaReachabilityDependencyRegistry.INSTANCE.recordHit( + "com.example:lib", "1.0.0", "GHSA-xxx", "com.myapp.Service", "process", 42); + + action.doIteration(telService); + + ArgumentCaptor captor = forClass(Dependency.class); + verify(telService, times(1)).addDependency(captor.capture()); + String metaValue = captor.getValue().reachabilityMetadata.get(0); + assertTrue(metaValue.contains("\"path\":\"com.myapp.Service\"")); + assertTrue(metaValue.contains("\"symbol\":\"process\"")); + assertTrue(metaValue.contains("\"line\":42")); + assertFalse(metaValue.contains("\"reached\":[]"), "Hit must not produce empty reached"); + } + + @Test + void groupsTwoCvesForSameArtifactIntoOneEntry() { + ScaReachabilityDependencyRegistry.INSTANCE.registerCve( + "com.example:lib", "1.0.0", "GHSA-cve-1"); + ScaReachabilityDependencyRegistry.INSTANCE.registerCve( + "com.example:lib", "1.0.0", "GHSA-cve-2"); + + action.doIteration(telService); + + ArgumentCaptor captor = forClass(Dependency.class); + verify(telService, times(1)).addDependency(captor.capture()); + Dependency dep = captor.getValue(); + assertEquals(2, dep.reachabilityMetadata.size()); + assertTrue(dep.reachabilityMetadata.stream().anyMatch(v -> v.contains("GHSA-cve-1"))); + assertTrue(dep.reachabilityMetadata.stream().anyMatch(v -> v.contains("GHSA-cve-2"))); + } + + @Test + void reportsAllCvesWhenOneIsHit() { + // RFC requirement: when cve-1 is hit, re-report BOTH cve-1 (with callsite) and cve-2 (empty) + ScaReachabilityDependencyRegistry.INSTANCE.registerCve( + "com.example:lib", "1.0.0", "GHSA-cve-1"); + ScaReachabilityDependencyRegistry.INSTANCE.registerCve( + "com.example:lib", "1.0.0", "GHSA-cve-2"); + // First heartbeat: both sent with empty reached + action.doIteration(telService); + + // Now hit cve-1 + ScaReachabilityDependencyRegistry.INSTANCE.recordHit( + "com.example:lib", "1.0.0", "GHSA-cve-1", "com.myapp.Svc", "call", 10); + + // Second heartbeat: BOTH CVEs re-reported — cve-1 with callsite, cve-2 still empty + action.doIteration(telService); + + ArgumentCaptor captor = forClass(Dependency.class); + verify(telService, times(2)).addDependency(captor.capture()); + List reported = captor.getAllValues(); + Dependency secondReport = reported.get(1); + assertEquals(2, secondReport.reachabilityMetadata.size()); + // cve-1 now has a callsite + assertTrue( + secondReport.reachabilityMetadata.stream() + .anyMatch(v -> v.contains("GHSA-cve-1") && v.contains("\"path\""))); + // cve-2 still has empty reached + assertTrue( + secondReport.reachabilityMetadata.stream() + .anyMatch(v -> v.contains("GHSA-cve-2") && v.contains("\"reached\":[]"))); + } + + @Test + void separateEntriesForDifferentArtifacts() { + ScaReachabilityDependencyRegistry.INSTANCE.registerCve("com.example:lib-a", "1.0.0", "GHSA-a"); + ScaReachabilityDependencyRegistry.INSTANCE.registerCve("com.example:lib-b", "2.0.0", "GHSA-b"); + + action.doIteration(telService); + + verify(telService, times(2)).addDependency(org.mockito.Mockito.any()); + } + + @Test + void drainsClearsPendingState() { + ScaReachabilityDependencyRegistry.INSTANCE.registerCve("com.example:lib", "1.0.0", "GHSA-x"); + + action.doIteration(telService); + verify(telService, times(1)).addDependency(org.mockito.Mockito.any()); + + // Second iteration with no new state — nothing to report + TelemetryService telService2 = mock(TelemetryService.class); + action.doIteration(telService2); + verify(telService2, never()).addDependency(org.mockito.Mockito.any()); + } + + /** + * Validates the full RFC heartbeat flow (Heartbeats #2–#6 from the spec): + * + *

        + *
      1. Heartbeat after CVE registration: both CVEs reported with reached:[] + *
      2. Heartbeat with no changes: nothing reported + *
      3. Heartbeat after first CVE hit: both CVEs reported (one with callsite, one empty) + *
      4. Heartbeat with no changes: nothing reported + *
      5. Heartbeat after second CVE hit: both CVEs reported with their respective callsites + *
      + */ + @Test + void rfcFullHeartbeatFlow_twoCveSameDepBothHitSequentially() { + // Phase 1 — CVE registration (Heartbeat #2) + ScaReachabilityDependencyRegistry.INSTANCE.registerCve( + "com.example:lib", "1.0.0", "GHSA-cve-1"); + ScaReachabilityDependencyRegistry.INSTANCE.registerCve( + "com.example:lib", "1.0.0", "GHSA-cve-2"); + + action.doIteration(telService); + + ArgumentCaptor captor1 = ArgumentCaptor.forClass(Dependency.class); + verify(telService, times(1)).addDependency(captor1.capture()); + Dependency hb2 = captor1.getValue(); + assertEquals(2, hb2.reachabilityMetadata.size()); + assertTrue( + hb2.reachabilityMetadata.stream().allMatch(v -> v.contains("\"reached\":[]")), + "Heartbeat #2: both CVEs must have reached:[]"); + + // Phase 2 — No changes (Heartbeat #3) + TelemetryService telService3 = mock(TelemetryService.class); + action.doIteration(telService3); + verify(telService3, never()).addDependency(org.mockito.Mockito.any()); + + // Phase 3 — First CVE hit (Heartbeat #4) + ScaReachabilityDependencyRegistry.INSTANCE.recordHit( + "com.example:lib", "1.0.0", "GHSA-cve-1", "com.myapp.Controller", "handleRequest", 10); + + TelemetryService telService4 = mock(TelemetryService.class); + action.doIteration(telService4); + + ArgumentCaptor captor4 = ArgumentCaptor.forClass(Dependency.class); + verify(telService4, times(1)).addDependency(captor4.capture()); + Dependency hb4 = captor4.getValue(); + assertEquals(2, hb4.reachabilityMetadata.size()); + assertTrue( + hb4.reachabilityMetadata.stream() + .anyMatch(v -> v.contains("GHSA-cve-1") && v.contains("\"path\"")), + "Heartbeat #4: cve-1 must have callsite"); + assertTrue( + hb4.reachabilityMetadata.stream() + .anyMatch(v -> v.contains("GHSA-cve-2") && v.contains("\"reached\":[]")), + "Heartbeat #4: cve-2 must still have reached:[]"); + + // Phase 4 — No changes (Heartbeat #5) + TelemetryService telService5 = mock(TelemetryService.class); + action.doIteration(telService5); + verify(telService5, never()).addDependency(org.mockito.Mockito.any()); + + // Phase 5 — Second CVE hit (Heartbeat #6) + ScaReachabilityDependencyRegistry.INSTANCE.recordHit( + "com.example:lib", "1.0.0", "GHSA-cve-2", "com.myapp.Service", "processData", 44); + + TelemetryService telService6 = mock(TelemetryService.class); + action.doIteration(telService6); + + ArgumentCaptor captor6 = ArgumentCaptor.forClass(Dependency.class); + verify(telService6, times(1)).addDependency(captor6.capture()); + Dependency hb6 = captor6.getValue(); + assertEquals(2, hb6.reachabilityMetadata.size()); + assertTrue( + hb6.reachabilityMetadata.stream() + .anyMatch(v -> v.contains("GHSA-cve-1") && v.contains("\"path\"")), + "Heartbeat #6: cve-1 must retain callsite"); + assertTrue( + hb6.reachabilityMetadata.stream() + .anyMatch(v -> v.contains("GHSA-cve-2") && v.contains("\"path\"")), + "Heartbeat #6: cve-2 must now have callsite"); + } + + @Test + void buildMetadataValue_emptyReachedWhenNoHit() { + ScaReachabilityDependencyRegistry.CveSnapshot cve = + new ScaReachabilityDependencyRegistry.CveSnapshot("GHSA-645p-88qh-w398", null); + + String value = ScaReachabilityPeriodicAction.buildMetadataValue(cve); + + assertEquals( + "{\"id\":\"GHSA-645p-88qh-w398\",\"reached\":[]}", + value, + "CVE with no hit must produce reached:[]"); + } + + @Test + void buildMetadataValue_includesCallsiteWhenHit() { + ScaReachabilityHit hit = + new ScaReachabilityHit( + "GHSA-645p-88qh-w398", + "com.fasterxml.jackson.core:jackson-databind", + "2.8.5", + "com.fasterxml.jackson.databind.ObjectMapper", + "", + 1); + ScaReachabilityDependencyRegistry.CveSnapshot cve = + new ScaReachabilityDependencyRegistry.CveSnapshot("GHSA-645p-88qh-w398", hit); + + String value = ScaReachabilityPeriodicAction.buildMetadataValue(cve); + + assertEquals( + "{\"id\":\"GHSA-645p-88qh-w398\"," + + "\"reached\":[{" + + "\"path\":\"com.fasterxml.jackson.databind.ObjectMapper\"," + + "\"symbol\":\"\"," + + "\"line\":1}]}", + value); + } + + // --------------------------------------------------------------------------- + // Merge logic: DependencyService + ScaReachabilityDependencyRegistry + // --------------------------------------------------------------------------- + + private static ScaReachabilityPeriodicAction actionWithDeps(Dependency... deps) { + DependencyService svc = mock(DependencyService.class); + org.mockito.Mockito.when(svc.drainDeterminedDependencies()) + .thenReturn(java.util.Arrays.asList(deps)); + return new ScaReachabilityPeriodicAction(svc); + } + + @Test + void newDep_noCveState_emitsWithEmptyMetadata() { + // DependencyService returns a new dep; registry has nothing for it. + // Expected: one entry with metadata:[] (SCA-active signal, no CVE data yet). + Dependency incoming = new Dependency("com.example:lib", "1.0.0", "lib-1.0.0.jar", null); + ScaReachabilityPeriodicAction merged = actionWithDeps(incoming); + + merged.doIteration(telService); + + ArgumentCaptor captor = ArgumentCaptor.forClass(Dependency.class); + verify(telService, times(1)).addDependency(captor.capture()); + Dependency emitted = captor.getValue(); + assertEquals("com.example:lib", emitted.name); + assertEquals("1.0.0", emitted.version); + assertNotNull(emitted.reachabilityMetadata, "metadata must not be null when SCA active"); + assertTrue(emitted.reachabilityMetadata.isEmpty(), "metadata must be [] when no CVE state"); + } + + @Test + void newDep_withCveState_emitsMergedSingleEntry() { + // DependencyService returns dep X; registry has a pending CVE state for the same dep. + // Expected: ONE entry with the CVE metadata merged in — no separate dep:[] entry. + ScaReachabilityDependencyRegistry.INSTANCE.registerCve( + "com.example:lib", "1.0.0", "GHSA-test-1234"); + ScaReachabilityDependencyRegistry.INSTANCE.recordHit( + "com.example:lib", "1.0.0", "GHSA-test-1234", "com.myapp.Ctrl", "handle", 10); + + Dependency incoming = new Dependency("com.example:lib", "1.0.0", "lib-1.0.0.jar", "ABCD"); + ScaReachabilityPeriodicAction merged = actionWithDeps(incoming); + + merged.doIteration(telService); + + ArgumentCaptor captor = ArgumentCaptor.forClass(Dependency.class); + verify(telService, times(1)).addDependency(captor.capture()); + Dependency emitted = captor.getValue(); + assertEquals("com.example:lib", emitted.name); + assertEquals("1.0.0", emitted.version); + assertEquals("ABCD", emitted.hash, "source/hash from DependencyService must be preserved"); + assertEquals(1, emitted.reachabilityMetadata.size()); + assertTrue(emitted.reachabilityMetadata.get(0).contains("GHSA-test-1234")); + assertTrue( + emitted.reachabilityMetadata.get(0).contains("\"path\""), + "merged entry must include callsite"); + } + + @Test + void newDepAndUnrelatedCveState_emitsTwoIndependentEntries() { + // DependencyService returns depA; registry has pending state for depB (different dep). + // Expected: two separate entries — one for depA (metadata:[]), one for depB (CVE metadata). + ScaReachabilityDependencyRegistry.INSTANCE.registerCve( + "com.other:lib", "2.0.0", "GHSA-other-5678"); + + Dependency incomingA = new Dependency("com.example:lib", "1.0.0", "lib-1.0.0.jar", null); + ScaReachabilityPeriodicAction merged = actionWithDeps(incomingA); + // Simulate com.other:lib having been resolved by DependencyService in a prior heartbeat + merged.addKnownDepForTesting("com.other:lib", "2.0.0"); + + merged.doIteration(telService); + + ArgumentCaptor captor = ArgumentCaptor.forClass(Dependency.class); + verify(telService, times(2)).addDependency(captor.capture()); + java.util.List emitted = captor.getAllValues(); + + Dependency depA = + emitted.stream() + .filter(d -> "com.example:lib".equals(d.name)) + .findFirst() + .orElseThrow(() -> new AssertionError("dep not found")); + Dependency depB = + emitted.stream() + .filter(d -> "com.other:lib".equals(d.name)) + .findFirst() + .orElseThrow(() -> new AssertionError("dep not found")); + + assertTrue(depA.reachabilityMetadata.isEmpty(), "depA: no CVE state → metadata:[]"); + assertTrue( + depB.reachabilityMetadata.get(0).contains("GHSA-other-5678"), "depB: must carry CVE state"); + } + + // --------------------------------------------------------------------------- + // knownDeps / timing invariant tests + // --------------------------------------------------------------------------- + + /** + * Dep resolved by DependencyService in heartbeat N; CVE fires in heartbeat N+1. The dep is + * already in knownDeps, so Step 3 emits it with source/hash. + */ + @Test + void cveFiresAfterDepResolved_usesKnownDepsForSourceHash() { + DependencyService svc = mock(DependencyService.class); + // Heartbeat 1: DependencyService returns the dep, no CVE yet + when(svc.drainDeterminedDependencies()) + .thenReturn( + Collections.singletonList( + new Dependency("com.example:lib", "1.0.0", "lib.jar", "ABCD"))) + .thenReturn(Collections.emptyList()); // heartbeat 2: nothing new + ScaReachabilityPeriodicAction merged = new ScaReachabilityPeriodicAction(svc); + + // Heartbeat 1: dep detected, no CVE → emits metadata:[] + merged.doIteration(telService); + + // CVE fires between heartbeat 1 and 2 + ScaReachabilityDependencyRegistry.INSTANCE.registerCve("com.example:lib", "1.0.0", "GHSA-late"); + + // Heartbeat 2: DependencyService is empty, but CVE is pending + TelemetryService telService2 = mock(TelemetryService.class); + merged.doIteration(telService2); + + ArgumentCaptor captor = ArgumentCaptor.forClass(Dependency.class); + verify(telService2, times(1)).addDependency(captor.capture()); + Dependency emitted = captor.getValue(); + assertEquals("lib.jar", emitted.source, "source from knownDeps must be preserved"); + assertEquals("ABCD", emitted.hash, "hash from knownDeps must be preserved"); + assertTrue(emitted.reachabilityMetadata.get(0).contains("GHSA-late")); + } + + /** + * CVE fires before DependencyService has resolved the dep (timing race). + * + *

      Step 3 emits immediately without source/hash so CVE data is never delayed (system tests need + * data within seconds). When the dep is later resolved and stored in knownDeps, subsequent CVE + * emissions (e.g., after a method hit) carry source/hash automatically. + */ + @Test + void cveFiresBeforeDepResolved_emitsImmediatelyWithoutSourceHash() { + DependencyService svc = mock(DependencyService.class); + // Heartbeat 1: DependencyService is empty (dep not yet resolved) + when(svc.drainDeterminedDependencies()).thenReturn(Collections.emptyList()); + ScaReachabilityPeriodicAction merged = new ScaReachabilityPeriodicAction(svc); + + // CVE fires before DependencyService resolves the dep + ScaReachabilityDependencyRegistry.INSTANCE.registerCve("com.example:lib", "1.0.0", "GHSA-race"); + ScaReachabilityDependencyRegistry.INSTANCE.recordHit( + "com.example:lib", "1.0.0", "GHSA-race", "com.app.Ctrl", "handle", 10); + + // Heartbeat 1: emits immediately without source/hash — CVE data is not delayed + merged.doIteration(telService); + + ArgumentCaptor captor = ArgumentCaptor.forClass(Dependency.class); + verify(telService, times(1)).addDependency(captor.capture()); + Dependency emitted = captor.getValue(); + assertNull(emitted.source, "source is null when dep not yet in knownDeps"); + assertNull(emitted.hash, "hash is null when dep not yet in knownDeps"); + assertTrue(emitted.reachabilityMetadata.get(0).contains("GHSA-race")); + assertTrue(emitted.reachabilityMetadata.get(0).contains("\"path\""), "must include callsite"); + } + + /** + * Regression test for the Codex P2 race condition: CVE registered in HB1 (dep not yet resolved), + * emitted immediately without source/hash. In HB2 DependencyService resolves the JAR — if we + * naively emit metadata:[] because there is no pending snapshot, the backend overwrites the CVE + * state it already received. The fix uses peekSnapshot so HB2 emits the CVE metadata together + * with the now-known source/hash. + */ + @Test + void cveRegisteredBeforeDepResolved_step2PeeksCveStateInLaterHeartbeat() { + DependencyService svc = mock(DependencyService.class); + + // HB1: CVE registered, dep not yet resolved by DependencyService + when(svc.drainDeterminedDependencies()).thenReturn(Collections.emptyList()); + ScaReachabilityPeriodicAction action = new ScaReachabilityPeriodicAction(svc); + ScaReachabilityDependencyRegistry.INSTANCE.registerCve("com.example:lib", "1.0.0", "GHSA-peek"); + + action.doIteration(telService); + + // HB1 emits once: CVE state without source/hash (dep not yet resolved) + verify(telService, times(1)).addDependency(any(Dependency.class)); + reset(telService); + + // HB2: DependencyService now resolves the JAR; no new CVE activity (pendingReport=false) + Dependency resolved = new Dependency("com.example:lib", "1.0.0", "lib-1.0.0.jar", "CAFEBABE"); + when(svc.drainDeterminedDependencies()).thenReturn(Collections.singletonList(resolved)); + + action.doIteration(telService); + + ArgumentCaptor captor = ArgumentCaptor.forClass(Dependency.class); + verify(telService, times(1)).addDependency(captor.capture()); + Dependency emitted = captor.getValue(); + assertEquals("lib-1.0.0.jar", emitted.source, "HB2 must include resolved source"); + assertEquals("CAFEBABE", emitted.hash, "HB2 must include resolved hash"); + assertFalse( + emitted.reachabilityMetadata.isEmpty(), + "HB2 must not emit metadata:[] — CVE state must be preserved via peekSnapshot"); + assertTrue( + emitted.reachabilityMetadata.get(0).contains("GHSA-peek"), + "HB2 metadata must contain the CVE id"); + } + + /** + * Regression test for the multi-classloader re-detection bug. + * + *

      {@link DependencyService} can report the same JAR on consecutive heartbeats when it + * discovers it from multiple classloaders in the same application. The CVE hit must be emitted + * exactly once — on the heartbeat where the CVE state is pending or first detected via {@code + * peekSnapshot}. Re-detections of the same JAR with no new CVE activity must produce no emission. + * + *

      Without the fix, Step 2 called {@code peekSnapshot} unconditionally when {@code + * snapshotByKey} had no entry, causing the hit to be re-emitted on every subsequent heartbeat + * where {@code DependencyService} reported the JAR again (e.g. from a different classloader). + */ + @Test + void depReDetectedByDependencyService_hitNotReEmittedOnSubsequentDetection() { + DependencyService svc = mock(DependencyService.class); + Dependency dep = new Dependency("com.example:lib", "1.0.0", "lib.jar", "HASH"); + // Same dep returned on both heartbeats (simulates multiple classloaders detecting the same JAR) + when(svc.drainDeterminedDependencies()) + .thenReturn(Collections.singletonList(dep)) // HB1: first detection + .thenReturn(Collections.singletonList(dep)); // HB2: re-detected from another classloader + ScaReachabilityPeriodicAction merged = new ScaReachabilityPeriodicAction(svc); + + ScaReachabilityDependencyRegistry.INSTANCE.registerCve("com.example:lib", "1.0.0", "GHSA-dup"); + ScaReachabilityDependencyRegistry.INSTANCE.recordHit( + "com.example:lib", "1.0.0", "GHSA-dup", "com.app.Ctrl", "handle", 10); + + // HB1: first detection, CVE is pending → emit merged entry with hit + merged.doIteration(telService); + ArgumentCaptor captor1 = ArgumentCaptor.forClass(Dependency.class); + verify(telService, times(1)).addDependency(captor1.capture()); + assertTrue( + captor1.getValue().reachabilityMetadata.get(0).contains("\"path\""), + "HB1 must include the callsite hit"); + reset(telService); + + // HB2: same JAR re-detected, no new CVE activity → must NOT re-emit the hit + merged.doIteration(telService); + verify(telService, never()).addDependency(any()); + } + + /** + * Companion to {@link #depReDetectedByDependencyService_hitNotReEmittedOnSubsequentDetection}: + * verifies that a REAL new CVE state change (hit arriving between heartbeats) is still emitted + * correctly even when DependencyService also reports the dep again on the same heartbeat. + */ + @Test + void depReDetectedWithNewHit_emitsOnceWithNewHit() { + DependencyService svc = mock(DependencyService.class); + Dependency dep = new Dependency("com.example:lib", "1.0.0", "lib.jar", "HASH"); + when(svc.drainDeterminedDependencies()) + .thenReturn(Collections.singletonList(dep)) // HB1 + .thenReturn(Collections.singletonList(dep)); // HB2 + ScaReachabilityPeriodicAction merged = new ScaReachabilityPeriodicAction(svc); + + ScaReachabilityDependencyRegistry.INSTANCE.registerCve("com.example:lib", "1.0.0", "GHSA-new"); + + // HB1: first detection, CVE pending with reached:[] → emitted once + merged.doIteration(telService); + verify(telService, times(1)).addDependency(any()); + reset(telService); + + // Hit recorded between HB1 and HB2 + ScaReachabilityDependencyRegistry.INSTANCE.recordHit( + "com.example:lib", "1.0.0", "GHSA-new", "com.app.Svc", "exec", 7); + + // HB2: re-detection AND new hit pending (snapshotByKey has the entry) → emit once with hit + merged.doIteration(telService); + ArgumentCaptor captor = ArgumentCaptor.forClass(Dependency.class); + verify(telService, times(1)).addDependency(captor.capture()); + assertTrue( + captor.getValue().reachabilityMetadata.get(0).contains("\"path\""), + "HB2 must include the new callsite hit"); + } + + /** + * Dep and CVE arrive simultaneously (same heartbeat) — existing Step 2 merge path. This existing + * behavior must still work after the knownDeps refactor. + */ + @Test + void cveAndDepArriveSameHeartbeat_step2MergeStillWorks() { + ScaReachabilityDependencyRegistry.INSTANCE.registerCve( + "com.example:lib", "1.0.0", "GHSA-simultaneous"); + + Dependency incoming = new Dependency("com.example:lib", "1.0.0", "lib.jar", "HASH"); + ScaReachabilityPeriodicAction merged = actionWithDeps(incoming); + + merged.doIteration(telService); + + ArgumentCaptor captor = ArgumentCaptor.forClass(Dependency.class); + verify(telService, times(1)).addDependency(captor.capture()); + Dependency emitted = captor.getValue(); + assertEquals("lib.jar", emitted.source, "Step 2 merge must preserve source"); + assertTrue(emitted.reachabilityMetadata.get(0).contains("GHSA-simultaneous")); + } + + /** + * Regression test for the registry key mismatch for JARs without pom.properties (PR #11614). + * + *

      For JARs without {@code pom.properties}, {@code DependencyResolver.guessFallbackNoPom} + * produces an artifact-ID-only name (e.g. {@code "junrar"} instead of {@code + * "com.github.junrar:junrar"}). The transformer must register the CVE under the same name so that + * the registry key matches what {@code DependencyService} will report. + * + *

      Without the fix, {@code registerCve} was called with {@code entry.artifact()} = {@code + * "com.github.junrar:junrar"}, while {@code DependencyService} reported {@code dep.name} = {@code + * "junrar"}. The result: two separate telemetry entries for the same physical JAR — one with + * {@code metadata:[]} (from Step 2, carrying source/hash but no CVE) and one with the CVE + * metadata (from Step 3, without source/hash). + * + *

      With the fix, the transformer uses the resolved {@code dep.name} from {@code matchDep} (i.e. + * {@code "junrar"}) for {@code registerCve}, so the registry and {@code DependencyService} keys + * match. Step 2 merges them into a single emission with both the CVE metadata and source/hash. + */ + @Test + void noPomJar_artifactIdOnlyName_cveAndSourceHashMergedIntoSingleEntry() { + // Simulates what ScaReachabilityTransformer.processClass() now does after the fix: + // registerCve with the artifactId-only name that DependencyService will also report. + ScaReachabilityDependencyRegistry.INSTANCE.registerCve("junrar", "7.5.5", "GHSA-hf5p-test"); + + // DependencyService returns the dep with the same artifactId-only name (guessFallbackNoPom). + Dependency incoming = new Dependency("junrar", "7.5.5", "junrar-7.5.5.jar", "CAFEBABE"); + ScaReachabilityPeriodicAction merged = actionWithDeps(incoming); + + merged.doIteration(telService); + + // Must produce exactly ONE emission with BOTH the CVE metadata AND source/hash — not two + // separate entries (one with CVE but no source/hash, one with source/hash but no CVE). + ArgumentCaptor captor = ArgumentCaptor.forClass(Dependency.class); + verify(telService, times(1)).addDependency(captor.capture()); + Dependency emitted = captor.getValue(); + assertEquals( + "junrar", emitted.name, "name must be the artifactId-only name from DependencyService"); + assertEquals("7.5.5", emitted.version); + assertEquals( + "junrar-7.5.5.jar", emitted.source, "source/hash from DependencyService must be preserved"); + assertEquals("CAFEBABE", emitted.hash, "hash from DependencyService must be preserved"); + assertFalse( + emitted.reachabilityMetadata.isEmpty(), + "CVE metadata must NOT be lost — a single merged entry must carry both CVE data and source/hash"); + assertTrue(emitted.reachabilityMetadata.get(0).contains("GHSA-hf5p-test")); + } + + /** + * Same physical copy (identical source/hash) re-detected on a later heartbeat must NOT be + * re-emitted — the backend already received it. Mirrors a Spring Boot {@code + * LaunchedURLClassLoader} reporting the same nested JAR (same URI) again. + */ + @Test + void sameSourceHashReDetected_doesNotReEmit() { + DependencyService svc = mock(DependencyService.class); + Dependency dep = new Dependency("com.example:lib", "1.0", "lib.jar", "AABB"); + when(svc.drainDeterminedDependencies()) + .thenReturn(Collections.singletonList(dep)) // HB1: first detection + .thenReturn(Collections.singletonList(dep)); // HB2: same physical copy re-detected + ScaReachabilityPeriodicAction merged = new ScaReachabilityPeriodicAction(svc); + + // HB1: first detection → emits metadata:[] (SCA monitoring signal) + merged.doIteration(telService); + verify(telService, times(1)).addDependency(any(Dependency.class)); + reset(telService); + + // HB2: same source/hash → backend already knows it → no emission + merged.doIteration(telService); + verify(telService, never()).addDependency(any()); + } + + /** + * Two physical copies of the same {@code name@version} but with different source/hash (e.g. two + * Tomcat webapps each shipping their own copy of the artifact) must BOTH be emitted, matching the + * legacy {@code DependencyPeriodicAction} behavior. + */ + @Test + void differentSourceHashSameKey_emitsBothPhysicalCopies() { + DependencyService svc = mock(DependencyService.class); + Dependency copy1 = new Dependency("com.example:lib", "1.0", "/app1/lib.jar", "AABB"); + Dependency copy2 = new Dependency("com.example:lib", "1.0", "/app2/lib.jar", "CCDD"); + when(svc.drainDeterminedDependencies()) + .thenReturn(Collections.singletonList(copy1)) // HB1: first physical copy + .thenReturn(Collections.singletonList(copy2)); // HB2: distinct physical copy + ScaReachabilityPeriodicAction merged = new ScaReachabilityPeriodicAction(svc); + + // HB1: first copy → emitted + merged.doIteration(telService); + ArgumentCaptor captor1 = ArgumentCaptor.forClass(Dependency.class); + verify(telService, times(1)).addDependency(captor1.capture()); + assertEquals("/app1/lib.jar", captor1.getValue().source); + assertEquals("AABB", captor1.getValue().hash); + reset(telService); + + // HB2: different source/hash → new physical copy → also emitted + merged.doIteration(telService); + ArgumentCaptor captor2 = ArgumentCaptor.forClass(Dependency.class); + verify(telService, times(1)).addDependency(captor2.capture()); + assertEquals("/app2/lib.jar", captor2.getValue().source); + assertEquals("CCDD", captor2.getValue().hash); + } +} diff --git a/test-published-dependencies/agent-logs-on-java-7/build.gradle b/test-published-dependencies/agent-logs-on-java-7/build.gradle deleted file mode 100644 index d88f2185d9d..00000000000 --- a/test-published-dependencies/agent-logs-on-java-7/build.gradle +++ /dev/null @@ -1,50 +0,0 @@ -plugins { - id 'java' - id 'application' -} - -java { - disableAutoTargetJvm() - - toolchain { - languageVersion = JavaLanguageVersion.of(8) - } - - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 -} - -configurations { - agent -} - -dependencies { - agent("com.datadoghq:dd-java-agent:$version") - testImplementation(platform("org.junit:junit-bom:5.9.2")) - testImplementation('org.junit.jupiter:junit-jupiter') -} - -tasks.named("test", Test) { - dependsOn('jar') - useJUnitPlatform() - testLogging { - events 'passed', 'skipped', 'failed' - } - jvmArgs "-Dtest.published.dependencies.agent=${configurations.agent.singleFile}" - jvmArgs "-Dtest.published.dependencies.jar=${tasks.jar.archiveFile.get()}" -} - -tasks.named("jar", Jar) { - manifest { - attributes('Main-Class': 'test.published.dependencies.App') - } -} - -application { - mainClass = 'test.published.dependencies.App' -} - -tasks.named("compileTestJava", JavaCompile) { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 -} diff --git a/test-published-dependencies/agent-logs-on-java-7/build.gradle.kts b/test-published-dependencies/agent-logs-on-java-7/build.gradle.kts new file mode 100644 index 00000000000..b9c449bd398 --- /dev/null +++ b/test-published-dependencies/agent-logs-on-java-7/build.gradle.kts @@ -0,0 +1,80 @@ +import org.gradle.api.file.ConfigurableFileCollection +import org.gradle.api.file.RegularFileProperty +import org.gradle.api.tasks.Classpath +import org.gradle.api.tasks.InputFile +import org.gradle.api.tasks.PathSensitive +import org.gradle.api.tasks.PathSensitivity +import org.gradle.kotlin.dsl.application +import org.gradle.kotlin.dsl.invoke +import org.gradle.kotlin.dsl.java +import org.gradle.process.CommandLineArgumentProvider + +plugins { + java + application +} + +java { + disableAutoTargetJvm() + + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } + + sourceCompatibility = JavaVersion.VERSION_1_7 + targetCompatibility = JavaVersion.VERSION_1_7 +} + +val agent = configurations.register("agent") + +dependencies { + agent("com.datadoghq:dd-java-agent:$version") + testImplementation(platform("org.junit:junit-bom:5.14.1")) + testImplementation("org.junit.jupiter:junit-jupiter") + testRuntimeOnly("org.junit.platform:junit-platform-launcher") +} + +abstract class AgentLogsOnJava7JvmArguments : CommandLineArgumentProvider { + @get:Classpath + abstract val agentClasspath: ConfigurableFileCollection + + @get:InputFile + @get:PathSensitive(PathSensitivity.RELATIVE) + abstract val appJar: RegularFileProperty + + override fun asArguments(): Iterable = listOf( + "-Dtest.published.dependencies.agent=${agentClasspath.singleFile}", + "-Dtest.published.dependencies.jar=${appJar.get().asFile}", + ) +} + +val jarTask = tasks.jar + +tasks.test { + dependsOn(jarTask) + useJUnitPlatform() + testLogging { + events("passed", "skipped", "failed") + } + jvmArgumentProviders.add( + objects.newInstance(AgentLogsOnJava7JvmArguments::class.java).apply { + agentClasspath.from(agent) + appJar.set(jarTask.flatMap { it.archiveFile }) + } + ) +} + +tasks.jar { + manifest { + attributes("Main-Class" to "test.published.dependencies.App") + } +} + +application { + mainClass = "test.published.dependencies.App" +} + +tasks.compileTestJava { + sourceCompatibility = JavaVersion.VERSION_1_8.toString() + targetCompatibility = JavaVersion.VERSION_1_8.toString() +} diff --git a/test-published-dependencies/all-deps-exist/build.gradle b/test-published-dependencies/all-deps-exist/build.gradle deleted file mode 100644 index 22417922a3d..00000000000 --- a/test-published-dependencies/all-deps-exist/build.gradle +++ /dev/null @@ -1,18 +0,0 @@ -plugins { - id 'java' - id 'application' -} - -java { - disableAutoTargetJvm() -} - -dependencies { - implementation "com.datadoghq:dd-java-agent:$version" - implementation "com.datadoghq:dd-trace-api:$version" - implementation "com.datadoghq:dd-trace-ot:$version" -} - -application { - mainClass = 'test.published.dependencies.App' -} diff --git a/test-published-dependencies/all-deps-exist/build.gradle.kts b/test-published-dependencies/all-deps-exist/build.gradle.kts new file mode 100644 index 00000000000..d5f0d58eca5 --- /dev/null +++ b/test-published-dependencies/all-deps-exist/build.gradle.kts @@ -0,0 +1,18 @@ +plugins { + java + application +} + +java { + disableAutoTargetJvm() +} + +dependencies { + implementation("com.datadoghq:dd-java-agent:$version") + implementation("com.datadoghq:dd-trace-api:$version") + implementation("com.datadoghq:dd-trace-ot:$version") +} + +application { + mainClass = "test.published.dependencies.App" +} diff --git a/test-published-dependencies/build.gradle b/test-published-dependencies/build.gradle deleted file mode 100644 index 0552f24244b..00000000000 --- a/test-published-dependencies/build.gradle +++ /dev/null @@ -1,17 +0,0 @@ -plugins { - id 'com.diffplug.spotless' version '8.4.0' -} - -def sharedConfigDirectory = "$rootDir/../gradle" -rootProject.ext.sharedConfigDirectory = sharedConfigDirectory - -def isCI = providers.environmentVariable("CI").isPresent() -def versionFromFile = file("$rootDir/${isCI ? '../workspace' : '..'}/build/main.version").readLines().head() - -allprojects { - group = 'com.datadoghq' - version = versionFromFile - - apply from: "$sharedConfigDirectory/repositories.gradle" - apply from: "$sharedConfigDirectory/spotless.gradle" -} diff --git a/test-published-dependencies/build.gradle.kts b/test-published-dependencies/build.gradle.kts new file mode 100644 index 00000000000..b9e30b36bff --- /dev/null +++ b/test-published-dependencies/build.gradle.kts @@ -0,0 +1,37 @@ +plugins { + id("com.diffplug.spotless") version "8.4.0" +} + +val sharedConfigDirectory = "$rootDir/../gradle" +rootProject.extra["sharedConfigDirectory"] = sharedConfigDirectory + +val isCI = providers.environmentVariable("CI").isPresent +val versionFromFile = file("$rootDir/${if (isCI) "../workspace" else ".."}/build/main.version").readLines().first() + +allprojects { + group = "com.datadoghq" + version = versionFromFile + + apply(from = "$sharedConfigDirectory/repositories.gradle") + apply(plugin = "com.diffplug.spotless") + + // Apply a simple spotless config here. + // Using the dd-trace-java's plugin scripts, adds a step with grecplipse that + // has a concurrency bug surfacing with gradle 9.6 when there's no matching file. + spotless { + kotlinGradle { + target("*.gradle.kts") + ktlint("1.8.0").editorConfigOverride( + mapOf( + // Disable trailing comma rules to minimize diff. + "ktlint_standard_trailing-comma-on-call-site" to "disabled", + "ktlint_standard_trailing-comma-on-declaration-site" to "disabled", + ), + ) + } + java { + target("src/**/*.java") + googleJavaFormat("1.35.0") + } + } +} diff --git a/test-published-dependencies/ot-is-shaded/build.gradle b/test-published-dependencies/ot-is-shaded/build.gradle deleted file mode 100644 index 7dc441997a2..00000000000 --- a/test-published-dependencies/ot-is-shaded/build.gradle +++ /dev/null @@ -1,121 +0,0 @@ -import java.util.regex.Pattern -import java.util.zip.ZipInputStream - -plugins { - id 'java' -} - -configurations { - jarfile -} - -dependencies { - jarfile "com.datadoghq:dd-trace-ot:$version" - implementation gradleApi() -} - -abstract class CheckJarContentsTask extends DefaultTask { - @InputFile - File file - - @Input - String[] expectedPatterns - - @Input - String[] excludedPatterns - - @TaskAction - def check() { - def contents = listJarFileContents(this.file) - def expectedPatterns = buildPatterns(this.expectedPatterns) - def excludedPatterns = buildPatterns(this.excludedPatterns) - checkAllExpectedContentIsPresent(contents, expectedPatterns) - checkUnexpectedContent(contents, expectedPatterns, true) - checkUnexpectedContent(contents, excludedPatterns, false) - } - - static def buildPatterns(String[] patterns) { - return patterns.collect { it -> - Pattern::compile(it) - } - } - - static def listJarFileContents(File jarFile) { - def contents = [] - try (ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(jarFile))) { - def entry = zipInputStream.getNextEntry() - while (entry != null) { - contents << entry.name - entry = zipInputStream.getNextEntry() - } - } - return contents - } - - static def checkAllExpectedContentIsPresent(Collection contents, Collection expectedPatterns) { - for (final def expectedPattern in expectedPatterns) { - def found = false - for (final def file in contents) { - if (expectedPattern.matcher(file).matches()) { - found = true - break - } - } - if (!found) { - throw new RuntimeException('Unable to find content matching ' + expectedPattern.pattern() + ' in jar file.') - } - } - } - - static def checkUnexpectedContent(Collection contents, Collection patterns, boolean isExpected) { - def unexpectedContent = [] - for (final def file in contents) { - def matches = patterns.any( it -> it.matcher(file).matches()) - if (matches != isExpected) { - unexpectedContent << file - } - } - if (!unexpectedContent.isEmpty()) { - throw new RuntimeException('Found unexpected content in JAR file: ' + unexpectedContent.join(', ') + '.') - } - } -} - -def jarFile = configurations.jarfile.filter { - it.name.startsWith('dd-trace-ot') -}.singleFile - -tasks.register('checkJarContents', CheckJarContentsTask) { - file = jarFile - expectedPatterns = [ - '^[^/]*\\.version$', - '^DDSketch.proto$', - '^META-INF/.*$', - '^datadog/.*$', - '^ddtrot/.*$' - ] - excludedPatterns = [ - '^dd-trace-api.version$', - '^datadog/trace/api/Trace.class$', - '^datadog/trace/api/Tracer.class$', - '^datadog/trace/api/config/TracerConfig.class$', - '^datadog/trace/api/interception/TraceInterceptor.class$', - '^datadog/trace/api/internal/InternalApi.class$', - '^datadog/trace/api/sampling/PrioritySampling.class$', - '^datadog/trace/context/TraceScope.class$', - ] -} - -tasks.register('checkJarSize') { - inputs.file(jarFile) - doLast { - // Arbitrary limit to prevent unintentional increases to the dd-trace-ot jar size - // Raise or lower as required - assert jarFile.length() <= 8 * 1024 * 1024 - } -} - -tasks.named('check') { - dependsOn 'checkJarContents' - dependsOn 'checkJarSize' -} diff --git a/test-published-dependencies/ot-is-shaded/build.gradle.kts b/test-published-dependencies/ot-is-shaded/build.gradle.kts new file mode 100644 index 00000000000..20920281b35 --- /dev/null +++ b/test-published-dependencies/ot-is-shaded/build.gradle.kts @@ -0,0 +1,110 @@ +import java.util.regex.Pattern +import java.util.zip.ZipInputStream + +plugins { + java +} + +val jarfile = configurations.register("jarfile") + +dependencies { + jarfile("com.datadoghq:dd-trace-ot:$version") + implementation(gradleApi()) +} + +abstract class CheckJarContentsTask : DefaultTask() { + @get:InputFile + abstract val file: RegularFileProperty + + @get:Input + abstract val expectedPatterns: ListProperty + + @get:Input + abstract val excludedPatterns: ListProperty + + @TaskAction + fun check() { + val contents = listJarFileContents(file.get().asFile) + val expected = buildPatterns(expectedPatterns.get()) + val excluded = buildPatterns(excludedPatterns.get()) + checkAllExpectedContentIsPresent(contents, expected) + checkUnexpectedContent(contents, expected, true) + checkUnexpectedContent(contents, excluded, false) + } + + private fun buildPatterns(patterns: List): List = patterns.map { Pattern.compile(it) } + + private fun listJarFileContents(jarFile: java.io.File): List { + val contents = mutableListOf() + ZipInputStream(jarFile.inputStream()).use { zipInputStream -> + var entry = zipInputStream.nextEntry + while (entry != null) { + contents.add(entry.name) + entry = zipInputStream.nextEntry + } + } + return contents + } + + private fun checkAllExpectedContentIsPresent(contents: Collection, expectedPatterns: Collection) { + for (expectedPattern in expectedPatterns) { + val found = contents.any { expectedPattern.matcher(it).matches() } + if (!found) { + throw RuntimeException("Unable to find content matching ${expectedPattern.pattern()} in jar file.") + } + } + } + + private fun checkUnexpectedContent(contents: Collection, patterns: Collection, isExpected: Boolean) { + val unexpectedContent = contents.filter { file -> + val matches = patterns.any { it.matcher(file).matches() } + matches != isExpected + } + if (unexpectedContent.isNotEmpty()) { + throw RuntimeException("Found unexpected content in JAR file: ${unexpectedContent.joinToString(", ")}.") + } + } +} + +val jarFile = layout.file(jarfile.map { it.filter { file -> file.name.startsWith("dd-trace-ot") }.singleFile }) + +val checkJarContents = tasks.register("checkJarContents") { + file.set(jarFile) + expectedPatterns.set( + listOf( + "^[^/]*\\.version$", + "^DDSketch.proto$", + "^META-INF/.*$", + "^datadog/.*$", + "^ddtrot/.*$", + ) + ) + excludedPatterns.set( + listOf( + "^dd-trace-api.version$", + "^datadog/trace/api/Trace.class$", + "^datadog/trace/api/Tracer.class$", + "^datadog/trace/api/config/TracerConfig.class$", + "^datadog/trace/api/interception/TraceInterceptor.class$", + "^datadog/trace/api/internal/InternalApi.class$", + "^datadog/trace/api/sampling/PrioritySampling.class$", + "^datadog/trace/context/TraceScope.class$", + ) + ) +} + +val checkJarSize = tasks.register("checkJarSize") { + inputs.file(jarFile) + doLast { + val jar = jarFile.get().asFile + // Arbitrary limit to prevent unintentional increases to the dd-trace-ot jar size + // Raise or lower as required + if (jar.length() > 8 * 1024 * 1024) { + throw GradleException("jar size is too big: ${jar.length()} bytes") + } + } +} + +tasks.check { + dependsOn(checkJarContents, checkJarSize) +} diff --git a/test-published-dependencies/ot-pulls-in-api/build.gradle b/test-published-dependencies/ot-pulls-in-api/build.gradle deleted file mode 100644 index 44d12f87bb0..00000000000 --- a/test-published-dependencies/ot-pulls-in-api/build.gradle +++ /dev/null @@ -1,25 +0,0 @@ -plugins { - id 'java' - id 'application' -} - -java { - disableAutoTargetJvm() -} - -dependencies { - implementation "com.datadoghq:dd-trace-ot:$version" - testImplementation(platform("org.junit:junit-bom:5.9.2")) - testImplementation('org.junit.jupiter:junit-jupiter') -} - -tasks.named("test", Test) { - useJUnitPlatform() - testLogging { - events "passed", "skipped", "failed" - } -} - -application { - mainClass = 'test.published.dependencies.App' -} diff --git a/test-published-dependencies/ot-pulls-in-api/build.gradle.kts b/test-published-dependencies/ot-pulls-in-api/build.gradle.kts new file mode 100644 index 00000000000..928535c1de7 --- /dev/null +++ b/test-published-dependencies/ot-pulls-in-api/build.gradle.kts @@ -0,0 +1,26 @@ +plugins { + java + application +} + +java { + disableAutoTargetJvm() +} + +dependencies { + implementation("com.datadoghq:dd-trace-ot:$version") + testImplementation(platform("org.junit:junit-bom:5.14.1")) + testImplementation("org.junit.jupiter:junit-jupiter") + testRuntimeOnly("org.junit.platform:junit-platform-launcher") +} + +tasks.test { + useJUnitPlatform() + testLogging { + events("passed", "skipped", "failed") + } +} + +application { + mainClass = "test.published.dependencies.App" +} diff --git a/test-published-dependencies/settings.gradle b/test-published-dependencies/settings.gradle deleted file mode 100644 index 2e125113095..00000000000 --- a/test-published-dependencies/settings.gradle +++ /dev/null @@ -1,6 +0,0 @@ -rootProject.name = 'test-published-dependencies' - -include ':all-deps-exist' -include ':ot-pulls-in-api' -include ':ot-is-shaded' -include ':agent-logs-on-java-7' diff --git a/test-published-dependencies/settings.gradle.kts b/test-published-dependencies/settings.gradle.kts new file mode 100644 index 00000000000..0e44ffd63fd --- /dev/null +++ b/test-published-dependencies/settings.gradle.kts @@ -0,0 +1,6 @@ +rootProject.name = "test-published-dependencies" + +include(":all-deps-exist") +include(":ot-pulls-in-api") +include(":ot-is-shaded") +include(":agent-logs-on-java-7") diff --git a/tooling/review-milestone-pull-request-titles.sh b/tooling/review-milestone-pull-request-titles.sh new file mode 100755 index 00000000000..b85c3bd3af5 --- /dev/null +++ b/tooling/review-milestone-pull-request-titles.sh @@ -0,0 +1,237 @@ +#!/usr/bin/env bash +set -euo pipefail + +CONVENTIONAL_COMMIT_PREFIX_RE='^(fix|feat|chore|docs|refactor|test|build|ci|perf|style)(\([^)]+\))?:[[:space:]]*' +TAG_PREFIX_RE='^(\[[A-Z][A-Z0-9_/-]*\][[:space:]]*|[A-Z][A-Z0-9_]*[[:space:]]*-[[:space:]]*)+' +MAX_LEN=100 + +check_dependencies() { + local missing=() + for cmd in gh jq claude; do + if ! command -v "$cmd" &> /dev/null; then + missing+=("$cmd") + fi + done + if [ ${#missing[@]} -gt 0 ]; then + echo "❌ Missing required dependencies: ${missing[*]}" >&2 + echo "Please install them and try again." >&2 + exit 1 + fi + if ! gh auth status &> /dev/null; then + echo "❌ gh is not authenticated. Run 'gh auth login'." >&2 + exit 1 + fi +} + +confirmOrAbort() { + read -p "❔ $1 (y/N): " -n 1 -r + echo + if [[ ! $REPLY =~ ^[Yy]$ ]]; then + echo "Aborting." + exit 0 + fi +} + +strip_prefixes() { + local t="$1" + t=$(sed -E "s/$CONVENTIONAL_COMMIT_PREFIX_RE//" <<<"$t") + t=$(sed -E "s/$TAG_PREFIX_RE//" <<<"$t") + echo "$t" +} + +deterministic_suggest() { + local t + t=$(strip_prefixes "$1") + if [ -z "$t" ]; then + echo "$1" + return + fi + local first="${t:0:1}" + local rest="${t:1}" + echo "$(tr '[:lower:]' '[:upper:]' <<<"$first")$rest" +} + +validate_title() { + local t="$1" + local reasons=() + if [[ "$t" =~ $CONVENTIONAL_COMMIT_PREFIX_RE ]]; then + reasons+=("conventional-commit prefix") + fi + if [[ "$t" =~ $TAG_PREFIX_RE ]]; then + reasons+=("bracket/tag prefix") + fi + local stripped + stripped=$(strip_prefixes "$t") + if [[ "$stripped" =~ ^[a-z] ]]; then + reasons+=("does not start with a capital") + fi + if [ "${#t}" -gt "$MAX_LEN" ]; then + reasons+=("too long (${#t} > $MAX_LEN)") + fi + if [ ${#reasons[@]} -gt 0 ]; then + local IFS=", " + echo "${reasons[*]}" + fi +} + +claude_suggest() { + local original="$1" + local prompt + prompt="Rewrite this dd-trace-java PR title to follow our conventions. +Rules: start with a capital infinitive verb (Add, Fix, Update, Refactor, Improve); no conventional-commit prefix (no \"fix:\", \"feat:\", \"chore(ci):\", etc.); no bracket/tag prefix (no \"[CORE]\", \"PROD -\"); keep under ${MAX_LEN} chars; preserve technical specificity. +Examples of good titles: + Add support for virtual thread pinning events in JFR profiler + Fix NPE in Kafka consumer instrumentation under retry + Refactor HttpServerDecorator to share logic with gRPC +Original: ${original} +Output ONLY the rewritten title on a single line, no quotes, no explanation." + claude -p "$prompt" 2>/dev/null | head -1 | sed -E 's/^[[:space:]"'\'']+//; s/[[:space:]"'\'']+$//' +} + +select_milestone() { + local raw + raw=$(gh api "repos/{owner}/{repo}/milestones" \ + --jq '.[] | "\(.number)\t\(.title)\t\(.open_issues)\t\(.closed_issues)"') + if [ -z "$raw" ]; then + echo "ℹ️ No open milestones found." >&2 + exit 0 + fi + local -a milestones + mapfile -t milestones <<<"$raw" + local ms_title + if [ "${#milestones[@]}" -eq 1 ]; then + IFS=$'\t' read -r _ ms_title _ _ <<<"${milestones[0]}" + echo "$ms_title" + return + fi + echo "Open milestones:" >&2 + local i=1 + for m in "${milestones[@]}"; do + IFS=$'\t' read -r num title open closed <<<"$m" + printf " %d) %s (#%s, %s open, %s closed)\n" "$i" "$title" "$num" "$open" "$closed" >&2 + i=$((i+1)) + done + local choice + read -r -p "Select milestone [1-${#milestones[@]}]: " choice + if ! [[ "$choice" =~ ^[0-9]+$ ]] || [ "$choice" -lt 1 ] || [ "$choice" -gt "${#milestones[@]}" ]; then + echo "❌ Invalid selection." >&2 + exit 1 + fi + IFS=$'\t' read -r _ ms_title _ _ <<<"${milestones[$((choice-1))]}" + echo "$ms_title" +} + +main() { + check_dependencies + + local milestone_title + milestone_title=$(select_milestone) + + if [[ "$milestone_title" == *\"* ]]; then + echo "❌ Milestone title contains a double quote, which would break the gh search syntax." >&2 + exit 1 + fi + + confirmOrAbort "Review PR titles in milestone '$milestone_title'?" + + echo "ℹ️ Fetching PRs from milestone '$milestone_title'..." + local prs_json + prs_json=$(gh pr list --search "milestone:\"$milestone_title\"" \ + --state all --limit 500 \ + --json number,title,state,url,labels) + + local prs + prs=$(jq -c '.[] | select(.state == "MERGED" or .state == "OPEN")' <<<"$prs_json") + + if [ -z "$prs" ]; then + echo "ℹ️ No merged or open PRs in milestone '$milestone_title'." + exit 0 + fi + + local total=0 ok=0 fixed=0 skipped=0 no_release_note=0 + while IFS= read -r pr <&3; do + total=$((total+1)) + local num title url state reasons + num=$(jq -r '.number' <<<"$pr") + title=$(jq -r '.title' <<<"$pr") + url=$(jq -r '.url' <<<"$pr") + state=$(jq -r '.state' <<<"$pr") + if jq -e '.labels | any(.name == "tag: no release notes")' <<<"$pr" >/dev/null; then + no_release_note=$((no_release_note+1)) + continue + fi + reasons=$(validate_title "$title") + if [ -z "$reasons" ]; then + ok=$((ok+1)) + continue + fi + + local deterministic_suggestion ai_suggestion labels + deterministic_suggestion=$(deterministic_suggest "$title") + labels=$(jq -r '[.labels[].name] | join(", ")' <<<"$pr") + echo + echo "── PR #$num ($state) — $url" + echo " ❌ $title" + if [ -n "$labels" ]; then + echo " labels: $labels" + fi + printf " issues: \033[1;31m%s\033[0m\n" "$reasons" + + printf " asking Claude..." + ai_suggestion=$(claude_suggest "$title" || true) + printf "\r\033[K" + echo " 1) deterministic: $deterministic_suggestion" + if [ -n "$ai_suggestion" ]; then + echo " 2) claude: $ai_suggestion" + else + echo " 2) claude: (no suggestion)" + fi + echo " 3) custom" + echo " s) skip" + + local choice new + read -r -p " Choose [1/2/3/s]: " choice + case "$choice" in + 1) new="$deterministic_suggestion" ;; + 2) + if [ -z "$ai_suggestion" ]; then + echo " ⚠️ No Claude suggestion available, skipping." + skipped=$((skipped+1)) + continue + fi + new="$ai_suggestion" + ;; + 3) + read -r -p " New title: " new + if [ -z "$new" ]; then + echo " ⚠️ Empty title, skipping." + skipped=$((skipped+1)) + continue + fi + ;; + *) + echo " ⏭ skipping" + skipped=$((skipped+1)) + continue + ;; + esac + + if gh pr edit "$num" --title "$new" >/dev/null; then + echo " ✅ updated to: $new" + fixed=$((fixed+1)) + else + echo " ❌ gh pr edit failed for PR #$num" + skipped=$((skipped+1)) + fi + done 3<<<"$prs" + + echo + echo "── Summary ──" + echo " total: $total" + echo " ✅ ok: $ok" + echo " ✏️ fixed: $fixed" + echo " ⏭️ skipped: $skipped" + echo " 🏷️ no release note: $no_release_note" +} + +main "$@" diff --git a/utils/config-utils/build.gradle.kts b/utils/config-utils/build.gradle.kts index 84f494596d8..30334c87292 100644 --- a/utils/config-utils/build.gradle.kts +++ b/utils/config-utils/build.gradle.kts @@ -6,55 +6,51 @@ plugins { apply(from = "$rootDir/gradle/java.gradle") -val minimumBranchCoverage by extra(0.7) -val minimumInstructionCoverage by extra(0.7) +extra["minimumBranchCoverage"] = 0.7 +extra["minimumInstructionCoverage"] = 0.7 -val excludedClassesCoverage by extra( - listOf( - "datadog.trace.api.ConfigCollector", - "datadog.trace.api.env.CapturedEnvironment", - "datadog.trace.api.env.CapturedEnvironment.ProcessInfo", - // tested in internal-api - "datadog.trace.api.telemetry.OtelEnvMetricCollectorProvider", - "datadog.trace.api.telemetry.ConfigInversionMetricCollectorProvider", - "datadog.trace.bootstrap.config.provider.civisibility.CiEnvironmentVariables", - "datadog.trace.bootstrap.config.provider.CapturedEnvironmentConfigSource", - "datadog.trace.bootstrap.config.provider.ConfigConverter.ValueOfLookup", - // tested in internal-api - "datadog.trace.bootstrap.config.provider.ConfigProvider", - "datadog.trace.bootstrap.config.provider.ConfigProvider.ConfigMergeResolver", - "datadog.trace.bootstrap.config.provider.ConfigProvider.ConfigValueResolver", - "datadog.trace.bootstrap.config.provider.ConfigProvider.Singleton", - "datadog.trace.bootstrap.config.provider.ConfigProvider.Source", - "datadog.trace.bootstrap.config.provider.EnvironmentConfigSource", - "datadog.trace.bootstrap.config.provider.MapConfigSource", - // tested in internal-api - "datadog.trace.bootstrap.config.provider.OtelEnvironmentConfigSource", - "datadog.trace.bootstrap.config.provider.stableconfig.Selector", - // tested in internal-api - "datadog.trace.bootstrap.config.provider.StableConfigParser", - "datadog.trace.bootstrap.config.provider.SystemPropertiesConfigSource" - ) +extra["excludedClassesCoverage"] = listOf( + "datadog.trace.api.ConfigCollector", + "datadog.trace.api.env.CapturedEnvironment", + "datadog.trace.api.env.CapturedEnvironment.ProcessInfo", + // tested in internal-api + "datadog.trace.api.telemetry.OtelEnvMetricCollectorProvider", + "datadog.trace.api.telemetry.ConfigInversionMetricCollectorProvider", + "datadog.trace.bootstrap.config.provider.civisibility.CiEnvironmentVariables", + "datadog.trace.bootstrap.config.provider.CapturedEnvironmentConfigSource", + "datadog.trace.bootstrap.config.provider.ConfigConverter.ValueOfLookup", + // tested in internal-api + "datadog.trace.bootstrap.config.provider.ConfigProvider", + "datadog.trace.bootstrap.config.provider.ConfigProvider.ConfigMergeResolver", + "datadog.trace.bootstrap.config.provider.ConfigProvider.ConfigValueResolver", + "datadog.trace.bootstrap.config.provider.ConfigProvider.Singleton", + "datadog.trace.bootstrap.config.provider.ConfigProvider.Source", + "datadog.trace.bootstrap.config.provider.EnvironmentConfigSource", + "datadog.trace.bootstrap.config.provider.MapConfigSource", + // tested in internal-api + "datadog.trace.bootstrap.config.provider.OtelEnvironmentConfigSource", + "datadog.trace.bootstrap.config.provider.stableconfig.Selector", + // tested in internal-api + "datadog.trace.bootstrap.config.provider.StableConfigParser", + "datadog.trace.bootstrap.config.provider.SystemPropertiesConfigSource", + "datadog.trace.config.inversion.SupportedConfiguration" ) -val excludedClassesBranchCoverage by extra( - listOf( - "datadog.trace.bootstrap.config.provider.AgentArgsInjector", - // Enum - "datadog.trace.config.inversion.ConfigHelper.StrictnessPolicy", - "datadog.trace.util.ConfigStrings" - ) +extra["excludedClassesBranchCoverage"] = listOf( + "datadog.trace.bootstrap.config.provider.AgentArgsInjector", + // Enum + "datadog.trace.config.inversion.ConfigHelper.StrictnessPolicy", + "datadog.trace.util.ConfigStrings" ) -val excludedClassesInstructionCoverage by extra( - listOf( - "datadog.trace.api.telemetry.NoOpConfigInversionMetricCollector", - "datadog.trace.config.inversion.GeneratedSupportedConfigurations", - "datadog.trace.config.inversion.SupportedConfigurationSource" - ) +extra["excludedClassesInstructionCoverage"] = listOf( + "datadog.trace.api.telemetry.NoOpConfigInversionMetricCollector", + "datadog.trace.config.inversion.GeneratedSupportedConfigurations", + "datadog.trace.config.inversion.SupportedConfigurationSource" ) dependencies { + compileOnly(project(":components:annotations")) implementation(project(":components:environment")) implementation(project(":dd-trace-api")) api(project(":utils:filesystem-utils")) diff --git a/utils/config-utils/gradle.lockfile b/utils/config-utils/gradle.lockfile index 81a8113409a..083e162b1ae 100644 --- a/utils/config-utils/gradle.lockfile +++ b/utils/config-utils/gradle.lockfile @@ -1,10 +1,12 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :utils:config-utils:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -21,8 +23,8 @@ de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntime io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs junit:junit:4.12=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -46,10 +48,10 @@ org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest-core:1.3=testCompileClasspath,testRuntimeClasspath org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testFixturesRuntimeClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath @@ -63,10 +65,13 @@ org.mockito:mockito-core:4.4.0=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testFixturesCompileClasspath,testFixturesRuntimeClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/utils/config-utils/src/main/java/datadog/trace/api/env/CapturedEnvironment.java b/utils/config-utils/src/main/java/datadog/trace/api/env/CapturedEnvironment.java index 44e55b6fd18..2db02edd88a 100644 --- a/utils/config-utils/src/main/java/datadog/trace/api/env/CapturedEnvironment.java +++ b/utils/config-utils/src/main/java/datadog/trace/api/env/CapturedEnvironment.java @@ -2,6 +2,7 @@ import datadog.environment.JavaVirtualMachine; import datadog.trace.api.config.GeneralConfig; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.config.inversion.ConfigHelper; import java.io.File; import java.util.HashMap; @@ -24,12 +25,7 @@ public ProcessInfo() { mainClass = JavaVirtualMachine.getMainClass(); } - /** - * Visible for testing - * - * @param mainClass - * @param jarFile - */ + @VisibleForTesting ProcessInfo(String mainClass, File jarFile) { this.mainClass = mainClass; this.jarFile = jarFile; @@ -55,17 +51,13 @@ public ProcessInfo getProcessInfo() { return processInfo; } - // Testing purposes + @VisibleForTesting static void useFixedEnv(final Map props) { INSTANCE.properties.clear(); INSTANCE.properties.putAll(props); } - /** - * For testing purposes. - * - * @param processInfo - */ + @VisibleForTesting static void useFixedProcessInfo(final ProcessInfo processInfo) { INSTANCE.processInfo = processInfo; } diff --git a/utils/config-utils/src/main/java/datadog/trace/bootstrap/config/provider/OtelEnvironmentConfigSource.java b/utils/config-utils/src/main/java/datadog/trace/bootstrap/config/provider/OtelEnvironmentConfigSource.java index 522808170d2..28ef45ff9de 100644 --- a/utils/config-utils/src/main/java/datadog/trace/bootstrap/config/provider/OtelEnvironmentConfigSource.java +++ b/utils/config-utils/src/main/java/datadog/trace/bootstrap/config/provider/OtelEnvironmentConfigSource.java @@ -17,9 +17,11 @@ import static datadog.trace.api.config.OtlpConfig.LOGS_OTEL_TIMEOUT; import static datadog.trace.api.config.OtlpConfig.METRICS_OTEL_CARDINALITY_LIMIT; import static datadog.trace.api.config.OtlpConfig.METRICS_OTEL_ENABLED; +import static datadog.trace.api.config.OtlpConfig.METRICS_OTEL_EXPERIMENTAL_ENABLED; import static datadog.trace.api.config.OtlpConfig.METRICS_OTEL_EXPORTER; import static datadog.trace.api.config.OtlpConfig.METRICS_OTEL_INTERVAL; import static datadog.trace.api.config.OtlpConfig.METRICS_OTEL_TIMEOUT; +import static datadog.trace.api.config.OtlpConfig.OTEL_TRACES_SPAN_METRICS_ENABLED; import static datadog.trace.api.config.OtlpConfig.OTLP_LOGS_COMPRESSION; import static datadog.trace.api.config.OtlpConfig.OTLP_LOGS_ENDPOINT; import static datadog.trace.api.config.OtlpConfig.OTLP_LOGS_HEADERS; @@ -160,6 +162,10 @@ private void setupTraceOtelEnvironment() { capture(REQUEST_HEADER_TAGS, mapHeaderTags("http.request.header.", requestHeaders)); capture(RESPONSE_HEADER_TAGS, mapHeaderTags("http.response.header.", responseHeaders)); capture(TRACE_EXTENSIONS_PATH, extensions); + capture( + OTEL_TRACES_SPAN_METRICS_ENABLED, + getOtelProperty( + "otel.traces.span.metrics.enabled", "dd." + OTEL_TRACES_SPAN_METRICS_ENABLED)); String exporter = getOtelProperty("otel.traces.exporter"); if ("otlp".equalsIgnoreCase(exporter)) { // traces defaults to non-OTLP (i.e. datadog) @@ -195,6 +201,11 @@ private void setupMetricsOtelEnvironment() { METRICS_OTEL_CARDINALITY_LIMIT, getOtelProperty( "otel.java.metrics.cardinality.limit", "dd." + METRICS_OTEL_CARDINALITY_LIMIT)); + capture( + METRICS_OTEL_EXPERIMENTAL_ENABLED, + getOtelProperty( + "otel.instrumentation.runtime-telemetry.emit-experimental-metrics", + "dd." + METRICS_OTEL_EXPERIMENTAL_ENABLED)); String exporter = getOtelProperty("otel.metrics.exporter"); if (exporter == null || "otlp".equalsIgnoreCase(exporter)) { // metrics defaults to OTLP diff --git a/utils/config-utils/src/main/java/datadog/trace/util/ConfigStrings.java b/utils/config-utils/src/main/java/datadog/trace/util/ConfigStrings.java index 137280ad539..2937e19a372 100644 --- a/utils/config-utils/src/main/java/datadog/trace/util/ConfigStrings.java +++ b/utils/config-utils/src/main/java/datadog/trace/util/ConfigStrings.java @@ -1,5 +1,6 @@ package datadog.trace.util; +import java.util.Locale; import javax.annotation.Nonnull; public final class ConfigStrings { @@ -7,11 +8,11 @@ public final class ConfigStrings { private ConfigStrings() {} public static String toEnvVar(String string) { - return string.replace('.', '_').replace('-', '_').toUpperCase(); + return string.replace('.', '_').replace('-', '_').toUpperCase(Locale.ROOT); } public static String toEnvVarLowerCase(String string) { - return string.replace('.', '_').replace('-', '_').toLowerCase(); + return string.replace('.', '_').replace('-', '_').toLowerCase(Locale.ROOT); } /** @@ -26,18 +27,6 @@ public static String propertyNameToEnvironmentVariableName(final String setting) return "DD_" + toEnvVar(setting); } - /** - * Converts the system property name, e.g. 'dd.service.name' into a public environment variable - * name, e.g. `DD_SERVICE_NAME`. - * - * @param setting The system property name, e.g. `dd.service.name` - * @return The public facing environment variable name - */ - @Nonnull - public static String systemPropertyNameToEnvironmentVariableName(final String setting) { - return setting.replace('.', '_').replace('-', '_').toUpperCase(); - } - /** * Converts the property name, e.g. 'service.name' into a public system property name, e.g. * `dd.service.name`. diff --git a/utils/config-utils/src/test/groovy/datadog/trace/api/ConfigSettingTest.groovy b/utils/config-utils/src/test/groovy/datadog/trace/api/ConfigSettingTest.groovy deleted file mode 100644 index 71a58e144d2..00000000000 --- a/utils/config-utils/src/test/groovy/datadog/trace/api/ConfigSettingTest.groovy +++ /dev/null @@ -1,85 +0,0 @@ -package datadog.trace.api - -import spock.lang.Specification - -class ConfigSettingTest extends Specification { - - def "supports equality check"() { - when: - def cs1 = ConfigSetting.of(key1, value1, origin1) - def cs2 = ConfigSetting.of(key2, value2, origin2) - - then: - if (key1 == key2 && value1 == value2 && origin1 == origin2) { - assert cs1.hashCode() == cs2.hashCode() - assert cs1 == cs2 - assert cs2 == cs1 - assert cs1.toString() == cs2.toString() - } else { - assert cs1.hashCode() != cs2.hashCode() - assert cs1 != cs2 - assert cs2 != cs1 - assert cs1.toString() != cs2.toString() - } - - where: - key1 | key2 | value1 | value2 | origin1 | origin2 - "key" | "key" | "value" | "value" | ConfigOrigin.DEFAULT | ConfigOrigin.DEFAULT - "key" | "key2" | "value" | "value" | ConfigOrigin.ENV | ConfigOrigin.ENV - "key" | "key" | "value2" | "value" | ConfigOrigin.JVM_PROP | ConfigOrigin.JVM_PROP - "key" | "key" | "value" | "value" | ConfigOrigin.ENV | ConfigOrigin.DEFAULT - } - - def "filters key values"() { - expect: - ConfigSetting.of(key, value, ConfigOrigin.DEFAULT).stringValue() == filteredValue - - where: - key | value | filteredValue - "DD_API_KEY" | "somevalue" | "" - "dd.api-key" | "somevalue" | "" - "dd.profiling.api-key" | "somevalue" | "" - "dd.profiling.apikey" | "somevalue" | "" - "some.other.key" | "somevalue" | "somevalue" - } - - def "support basic types"() { - expect: - ConfigSetting.of("key", value, ConfigOrigin.DEFAULT).stringValue() == rendered - - where: - value | rendered - null | null - true | "true" - false | "false" - 1 | "1" - 1.0 | "1.0" - 2.33f | "2.33" - "string" | "string" - } - - def "convert Iterable, Map, and BitSet to String"() { - expect: - ConfigSetting.of("key", value, ConfigOrigin.DEFAULT).stringValue() == rendered - - where: - value | rendered - ["1", "2", "3"] | "1,2,3" - [1, 2, 3] | "1,2,3" - [1.0f, 22.23d, 3.1415] | "1.0,22.23,3.1415" - [a: 1, b: 2] | "a:1,b:2" - [a: "1", b: "2"] | "a:1,b:2" - [:] | "" - [] | "" - bitSetIntervals() | "33,200-300,303,400-500" - } - - BitSet bitSetIntervals() { - def bitSetIntervals = new BitSet() - bitSetIntervals.set(33) - bitSetIntervals.set(200, 300) - bitSetIntervals.set(303) - bitSetIntervals.set(400, 500) - return bitSetIntervals - } -} diff --git a/utils/config-utils/src/test/groovy/datadog/trace/api/env/CapturedEnvironmentTest.groovy b/utils/config-utils/src/test/groovy/datadog/trace/api/env/CapturedEnvironmentTest.groovy deleted file mode 100644 index 78c52635898..00000000000 --- a/utils/config-utils/src/test/groovy/datadog/trace/api/env/CapturedEnvironmentTest.groovy +++ /dev/null @@ -1,151 +0,0 @@ -package datadog.trace.api.env - -import static java.io.File.separator - -import datadog.trace.api.config.GeneralConfig -import datadog.trace.test.util.DDSpecification - -class CapturedEnvironmentTest extends DDSpecification { - def "non autodetected service.name with null command"() { - when: - def serviceName = forkAndRunProperties('null') - - then: - serviceName == null - } - - def "non autodetected service.name with empty command"() { - when: - def serviceName = forkAndRunProperties('') - - then: - serviceName == null - } - - def "non autodetected service.name with all blanks command"() { - when: - def serviceName = forkAndRunProperties(' ') - - then: - serviceName == null - } - - def "set service.name by sysprop 'sun.java.command' with class"() { - when: - def serviceName = forkAndRunProperties('org.example.App -Dfoo=bar arg2 arg3') - - then: - serviceName == 'org.example.App' - } - - def "set service.name by sysprop 'sun.java.command' with jar"() { - when: - def serviceName = forkAndRunProperties('foo/bar/example.jar -Dfoo=bar arg2 arg3') - - then: - serviceName == 'example' - } - - def "set service.name with real 'sun.java.command' property"() { - when: - def serviceName = forkAndRunProperties(null) - - then: - serviceName == ServiceNamePrinter.name - } - - def "use Azure site name in Azure"() { - when: - def serviceName = forkAndRunProperties('foo/bar/example.jar -Dfoo=bar arg2 arg3', [ - 'DD_AZURE_APP_SERVICES': '1', - 'WEBSITE_SITE_NAME': 'siteService' - ]) - - then: - serviceName == 'siteService' - } - - def "dont use site name when not in azure"() { - when: - def serviceName = forkAndRunProperties('foo/bar/example.jar -Dfoo=bar arg2 arg3', [ - 'WEBSITE_SITE_NAME': 'siteService' - ]) - - then: - serviceName == 'example' - } - - def "dont use Azure site name when null"() { - when: - def serviceName = forkAndRunProperties('foo/bar/example.jar -Dfoo=bar arg2 arg3', [ - 'DD_AZURE_APP_SERVICES': 'true', - ]) - - then: - serviceName == 'example' - } - - private static String forkAndRunProperties(String arg, Map envVars = [:]) - throws IOException, InterruptedException { - // Build the command to run a new Java process - List command = [] - command += System.getProperty("java.home") + separator + "bin" + separator + "java" - command += '-cp' - command += System.getProperty("java.class.path") - command += ServiceNamePrinter.name - if (arg != null) { - command += arg - } - // Start the process - ProcessBuilder processBuilder = new ProcessBuilder(command) - processBuilder.environment().putAll(envVars) - Process process = processBuilder.start() - // Read and parse output and error streams - String serviceName = '' - try (BufferedReader reader = - new BufferedReader(new InputStreamReader(process.getInputStream()))) { - String line - while ((line = reader.readLine()) != null) { - if (serviceName != '') { - serviceName += '\n' - } - serviceName += line - } - } - if (serviceName == 'null') { - serviceName = null - } - String error = '' - try (BufferedReader reader = - new BufferedReader(new InputStreamReader(process.getErrorStream()))) { - String line - while ((line = reader.readLine()) != null) { - error += line + '\n' - } - } - // Wait for the process to complete - int exitCode = process.waitFor() - // Dumping state on error - if (exitCode != 0) { - println("Error printing service name. Exit code $exitCode with service name: '$serviceName' and error:\n$error") - throw new IllegalStateException('Process should exit without error') - } - return serviceName - } - - static class ServiceNamePrinter { - static void main(String[] args) { - if (args.length > 0) { - def sunJavaCommand = args[0] - if (sunJavaCommand == 'null') { - System.clearProperty('sun.java.command') - } else { - System.setProperty('sun.java.command', sunJavaCommand) - } - } - def capturedEnv = CapturedEnvironment.get() - def props = capturedEnv.properties - println props.get(GeneralConfig.SERVICE_NAME) - } - } -} diff --git a/utils/config-utils/src/test/groovy/datadog/trace/bootstrap/config/provider/AgentArgsInjectorTest.groovy b/utils/config-utils/src/test/groovy/datadog/trace/bootstrap/config/provider/AgentArgsInjectorTest.groovy deleted file mode 100644 index 1833f785eba..00000000000 --- a/utils/config-utils/src/test/groovy/datadog/trace/bootstrap/config/provider/AgentArgsInjectorTest.groovy +++ /dev/null @@ -1,18 +0,0 @@ -package datadog.trace.bootstrap.config.provider - -import datadog.trace.test.util.DDSpecification - -class AgentArgsInjectorTest extends DDSpecification { - - def "injects agent arguments as system properties"() { - given: - def agentArgs = "arg1=value1,arg2=value2" - - when: - AgentArgsInjector.injectAgentArgsConfig(agentArgs) - - then: - System.getProperty("arg1") == "value1" - System.getProperty("arg2") == "value2" - } -} diff --git a/utils/config-utils/src/test/groovy/datadog/trace/bootstrap/config/provider/AgentArgsParserTest.groovy b/utils/config-utils/src/test/groovy/datadog/trace/bootstrap/config/provider/AgentArgsParserTest.groovy deleted file mode 100644 index 83cd29701fd..00000000000 --- a/utils/config-utils/src/test/groovy/datadog/trace/bootstrap/config/provider/AgentArgsParserTest.groovy +++ /dev/null @@ -1,79 +0,0 @@ -package datadog.trace.bootstrap.config.provider - - -import spock.lang.Specification - -class AgentArgsParserTest extends Specification { - - def "parses a single argument"() { - given: - def args = "key1=value1" - - when: - def properties = AgentArgsParser.parseAgentArgs(args) - - then: - properties != null - properties.size() == 1 - properties.get("key1") == "value1" - } - - def "parses multiple arguments"() { - given: - def args = "key1=value1,key2=value2" - - when: - def properties = AgentArgsParser.parseAgentArgs(args) - - then: - properties != null - properties.size() == 2 - properties.get("key2") == "value2" - } - - def "returns null for null string"() { - given: - def args = null - - when: - def properties = AgentArgsParser.parseAgentArgs(args) - - then: - properties == null - } - - def "returns null for empty string"() { - given: - def args = "" - - when: - def properties = AgentArgsParser.parseAgentArgs(args) - - then: - properties == null - } - - def "returns null for malformed string"() { - given: - def args = "key=value,,,==" - - when: - def properties = AgentArgsParser.parseAgentArgs(args) - - then: - properties == null - } - - def "parses argument with spaces"() { - given: - def args = "key=value with spaces" - - when: - def properties = AgentArgsParser.parseAgentArgs(args) - - then: - properties != null - properties.size() == 1 - properties.get("key") == "value with spaces" - } -} diff --git a/utils/config-utils/src/test/groovy/datadog/trace/bootstrap/config/provider/ConfigConverterTest.groovy b/utils/config-utils/src/test/groovy/datadog/trace/bootstrap/config/provider/ConfigConverterTest.groovy deleted file mode 100644 index 0f9e1dd752d..00000000000 --- a/utils/config-utils/src/test/groovy/datadog/trace/bootstrap/config/provider/ConfigConverterTest.groovy +++ /dev/null @@ -1,195 +0,0 @@ -package datadog.trace.bootstrap.config.provider - -import datadog.trace.test.util.DDSpecification - -class ConfigConverterTest extends DDSpecification { - - def "Convert boolean properties"() { - when: - def value = ConfigConverter.valueOf(stringValue, Boolean) - - then: - value == expectedConvertedValue - - where: - stringValue | expectedConvertedValue - "true" | true - "TRUE" | true - "True" | true - "1" | true - "false" | false - null | null - "" | null - "0" | false - } - - def "Convert boolean properties throws exception for invalid values"() { - when: - ConfigConverter.valueOf(invalidValue, Boolean) - - then: - def exception = thrown(ConfigConverter.InvalidBooleanValueException) - exception.message.contains("Invalid boolean value:") - - where: - invalidValue << [ - "42.42", - "tru", - "truee", - "true ", - " true", - " true ", - " true ", - "notABool", - "yes", - "no", - "on", - "off" - ] - } - - def "parse map properly for #mapString"() { - when: - def result = ConfigConverter.parseMap(mapString, "test") - - then: - result == expected - - where: - // spotless:off - mapString | expected - "a:1, a:2, a:3" | [a: "3"] - "a:b,c:d,e:" | [a: "b", c: "d"] - // space separated - "a:1 a:2 a:3" | [a: "3"] - "a:b c:d e:" | [a: "b", c: "d"] - // More different string variants: - "a:a;" | [a: "a;"] - "a:1, a:2, a:3" | [a: "3"] - "a:1 a:2 a:3" | [a: "3"] - "a:b,c:d,e:" | [a: "b", c: "d"] - "a:b c:d e:" | [a: "b", c: "d"] - "key 1!:va|ue_1," | ["key 1!": "va|ue_1"] - "key 1!:va|ue_1 " | ["key 1!": "va|ue_1"] - " key1 :value1 ,\t key2: value2" | [key1: "value1", key2: "value2"] - 'a:b, b:c, c:d, d: e' | ['a': 'b', 'b': 'c', 'c': 'd', 'd': 'e'] - "key1 :value1 \t key2: value2" | [key1: "value1", key2: "value2"] - "dyno:web.1 dynotype:web appname:******" | ["dyno": "web.1", "dynotype": "web", "appname": "******"] - "is:val:id" | [is: "val:id"] - "a:b,is:val:id,x:y" | [a: "b", is: "val:id", x: "y"] - "a:b:c:d" | [a: "b:c:d"] - 'fooa:barb, foob:barc, fooc: bard, food: bare,' | ['fooa': 'barb', 'foob': 'barc', 'fooc': 'bard', 'food': 'bare'] - "a:b=c=d" | [a: "b=c=d"] - // Illegal - "a:" | [:] - "a:b,c,d" | [:] - "a:b,c,d,k:v" | [:] - "" | [:] - "1" | [:] - "a" | [:] - "a,1" | [:] - "!a" | [:] - " " | [:] - ",,,," | [:] - ":,:,:,:," | [:] - ": : : : " | [:] - "::::" | [:] - 'key1:val1 with_space:and_colon, key2:val2' | [:] - // spotless:on - } - - def "parse map for #mapString with separator #separator"() { - when: - def result = ConfigConverter.parseMap(mapString, "test", separator as char) - - then: - result == expected - - where: - // spotless:off - mapString | separator | expected - "a=1, a=2, a=3" | '=' | [a: "3"] - "a=b,c=d,e=" | '=' | [a: "b", c: "d"] - "a;b,c;d,e;" | ';' | [a: "b", c: "d"] - // space separated - "a=1 a=2 a=3" | '=' | [a: "3"] - "a=b c=d e=" | '=' | [a: "b", c: "d"] - // More different string variants - "a=b=c=d" | '=' | [a: "b=c=d"] - 'fooa=barb, foob=barc, fooc= bard, food= bare,' | '=' | ['fooa': 'barb', 'foob': 'barc', 'fooc': 'bard', 'food': 'bare'] - "a=b:c:d" | '=' | [a: "b:c:d"] - // Illegal - "a=" | '=' | [:] - "====" | '=' | [:] - // spotless:on - } - - def "parsing map #mapString with List of arg separators for with key value separator #separator"() { - //testing parsing for DD_TAGS - setup: - def separatorList = [',' as char, ' ' as char] - - when: - def result = ConfigConverter.parseTraceTagsMap(mapString, separator as char, separatorList as List) - - then: - result == expected - - where: - // spotless:off - mapString | separator | expected - "key1:value1,key2:value2" | ':' | [key1: "value1", key2: "value2"] - "key1:value1 key2:value2" | ':' | [key1: "value1", key2: "value2"] - "env:test aKey:aVal bKey:bVal cKey:" | ':' | [env: "test", aKey: "aVal", bKey: "bVal", cKey:""] - "env:test,aKey:aVal,bKey:bVal,cKey:" | ':' | [env: "test", aKey: "aVal", bKey: "bVal", cKey:""] - "env:test,aKey:aVal bKey:bVal cKey:" | ':' | [env: "test", aKey: "aVal bKey:bVal cKey:"] - "env:test bKey :bVal dKey: dVal cKey:" | ':' | [env: "test", bKey: "", dKey: "", dVal: "", cKey: ""] - 'env :test, aKey : aVal bKey:bVal cKey:' | ':' | [env: "test", aKey : "aVal bKey:bVal cKey:"] - "env:keyWithA:Semicolon bKey:bVal cKey" | ':' | [env: "keyWithA:Semicolon", bKey: "bVal", cKey: ""] - "env:keyWith: , , Lots:Of:Semicolons " | ':' | [env: "keyWith:", Lots: "Of:Semicolons"] - "a:b,c,d" | ':' | [a: "b", c: "", d: ""] - "a,1" | ':' | [a: "", "1": ""] - "a:b:c:d" | ':' | [a: "b:c:d"] - //edge cases - "noDelimiters" | ':' | [noDelimiters: ""] - " " | ':' | [:] - ",,,,,,,,,,,," | ':' | [:] - ", , , , , , " | ':' | [:] - // spotless:on - } - - def "test parseMapWithOptionalMappings"() { - when: - def result = ConfigConverter.parseMapWithOptionalMappings(mapString, "test", defaultPrefix, lowercaseKeys) - - then: - result == expected - - where: - mapString | expected | lowercaseKeys | defaultPrefix - "header1:one,header2:two" | [header1: "one", header2: "two"] | false | "" - "header1:one, header2:two" | [header1: "one", header2: "two"] | false | "" - "header1,header2:two" | [header1: "header1", header2: "two"] | false | "" - "Header1:one,header2:two" | [header1: "one", header2: "two"] | true | "" - "\"header1:one,header2:two\"" | ["\"header1": "one", header2: "two\""] | true | "" - "header1" | [header1: "header1"] | true | "" - ",header1:tag" | [header1: "tag"] | true | "" - "header1:tag," | [header1: "tag"] | true | "" - "header:tag:value" | [header: "tag:value"] | true | "" - "" | [:] | true | "" - null | [:] | true | "" - // Test for wildcard header tags - "*" | ["*":"datadog.response.headers."] | true | "datadog.response.headers" - "*:" | [:] | true | "datadog.response.headers" - "*,header1:tag" | ["*":"datadog.response.headers."] | true | "datadog.response.headers" - "header1:tag,*" | ["*":"datadog.response.headers."] | true | "datadog.response.headers" - // logs warning: Illegal key only tag starting with non letter '1header' - "1header,header2:two" | [:] | true | "" - // logs warning: Illegal tag starting with non letter for key 'header' - "header::tag" | [:] | true | "" - // logs warning: Illegal empty key at position 0 - ":tag" | [:] | true | "" - // logs warning: Illegal empty key at position 11 - "header:tag,:tag" | [:] | true | "" - } -} diff --git a/utils/config-utils/src/test/groovy/datadog/trace/bootstrap/config/provider/PropertiesConfigSourceTest.groovy b/utils/config-utils/src/test/groovy/datadog/trace/bootstrap/config/provider/PropertiesConfigSourceTest.groovy deleted file mode 100644 index b8a4a15757c..00000000000 --- a/utils/config-utils/src/test/groovy/datadog/trace/bootstrap/config/provider/PropertiesConfigSourceTest.groovy +++ /dev/null @@ -1,36 +0,0 @@ -package datadog.trace.bootstrap.config.provider - -import datadog.trace.test.util.DDSpecification - -class PropertiesConfigSourceTest extends DDSpecification { - - def "test null"() { - when: - new PropertiesConfigSource(null, true) - - then: - thrown(AssertionError) - } - - def "config pulled from properties"() { - setup: - def props = new Properties(["abc": "def", "dd.abc": "xyz"]) - def source = new PropertiesConfigSource(props, false) - - expect: - source.get("abc") == "def" - source.get("dd.abc") == "xyz" - source.get("missing") == null - } - - def "config pulled from properties with prefix"() { - setup: - def props = new Properties(["abc": "def", "dd.abc": "xyz"]) - def source = new PropertiesConfigSource(props, true) - - expect: - source.get("abc") == "xyz" - source.get("dd.abc") == null - source.get("missing") == null - } -} diff --git a/utils/config-utils/src/test/groovy/datadog/trace/bootstrap/config/provider/StableConfigMappingExceptionTest.groovy b/utils/config-utils/src/test/groovy/datadog/trace/bootstrap/config/provider/StableConfigMappingExceptionTest.groovy deleted file mode 100644 index 2a1af178562..00000000000 --- a/utils/config-utils/src/test/groovy/datadog/trace/bootstrap/config/provider/StableConfigMappingExceptionTest.groovy +++ /dev/null @@ -1,35 +0,0 @@ -package datadog.trace.bootstrap.config.provider - -import datadog.trace.bootstrap.config.provider.stableconfig.StableConfigMappingException -import spock.lang.Specification - -class StableConfigMappingExceptionTest extends Specification { - - def "constructors work as expected"() { - when: - def ex1 = new StableConfigMappingException("msg") - def ex2 = new StableConfigMappingException("msg2") - - then: - ex1.message == "msg" - ex1.cause == null - ex2.message == "msg2" - } - - def "safeToString handles null"() { - expect: - StableConfigMappingException.safeToString(null) == "null" - } - - def "safeToString handles short string"() { - expect: - StableConfigMappingException.safeToString("short string") == "short string" - } - - def "safeToString handles long string"() { - given: - def longStr = "a" * 101 - expect: - StableConfigMappingException.safeToString(longStr) == ("a" * 50) + "...(truncated)..." + ("a" * 51).substring(1) - } -} diff --git a/utils/config-utils/src/test/groovy/datadog/trace/bootstrap/config/provider/StableConfigSourceTest.groovy b/utils/config-utils/src/test/groovy/datadog/trace/bootstrap/config/provider/StableConfigSourceTest.groovy deleted file mode 100644 index 84aeda8ebb0..00000000000 --- a/utils/config-utils/src/test/groovy/datadog/trace/bootstrap/config/provider/StableConfigSourceTest.groovy +++ /dev/null @@ -1,322 +0,0 @@ -package datadog.trace.bootstrap.config.provider - -import datadog.trace.api.ConfigCollector - -import static java.util.Collections.singletonMap - -import datadog.trace.api.ConfigOrigin -import datadog.trace.bootstrap.config.provider.stableconfig.Rule -import datadog.trace.bootstrap.config.provider.stableconfig.Selector -import datadog.trace.bootstrap.config.provider.stableconfig.StableConfig -import datadog.trace.test.util.DDSpecification -import org.snakeyaml.engine.v2.api.Dump -import org.snakeyaml.engine.v2.api.DumpSettings -import ch.qos.logback.classic.Logger -import ch.qos.logback.classic.spi.ILoggingEvent -import ch.qos.logback.core.read.ListAppender -import org.slf4j.LoggerFactory - -import java.nio.file.Files -import java.nio.file.Path -import java.nio.file.StandardOpenOption - -class StableConfigSourceTest extends DDSpecification { - - def "test file doesn't exist"() { - setup: - StableConfigSource config = new StableConfigSource(StableConfigSource.LOCAL_STABLE_CONFIG_PATH, ConfigOrigin.LOCAL_STABLE_CONFIG) - - expect: - config.getKeys().size() == 0 - config.getConfigId() == null - } - - def "test empty file"() { - given: - Path filePath = Files.createTempFile("testFile_", ".yaml") - - when: - StableConfigSource config = new StableConfigSource(filePath.toString(), ConfigOrigin.LOCAL_STABLE_CONFIG) - then: - config.getKeys().size() == 0 - config.getConfigId() == null - - cleanup: - Files.delete(filePath) - } - - def "test file invalid format"() { - // StableConfigSource must handle the exception thrown by StableConfigParser.parse(filePath) gracefully - when: - Path filePath = Files.createTempFile("testFile_", ".yaml") - then: - if (filePath == null) { - throw new AssertionError("Failed to create: " + filePath) - } - - when: - writeFileRaw(filePath, configId, data) - StableConfigSource stableCfg = new StableConfigSource(filePath.toString(), ConfigOrigin.LOCAL_STABLE_CONFIG) - - then: - stableCfg.getConfigId() == null - stableCfg.getKeys().size() == 0 - - cleanup: - Files.delete(filePath) - - where: - configId | data - null | corruptYaml - "12345" | "this is not yaml format!" - } - - def "test null values in YAML"() { - when: - Path filePath = Files.createTempFile("testFile_", ".yaml") - then: - if (filePath == null) { - throw new AssertionError("Failed to create: " + filePath) - } - - when: - // Test the scenario where YAML contains null values for apm_configuration_default and apm_configuration_rules - String yaml = """ -config_id: "12345" -apm_configuration_default: -apm_configuration_rules: -""" - Files.write(filePath, yaml.getBytes()) - StableConfigSource stableCfg = new StableConfigSource(filePath.toString(), ConfigOrigin.LOCAL_STABLE_CONFIG) - - then: - // Should not throw NullPointerException and should handle null values gracefully - stableCfg.getConfigId() == "12345" - stableCfg.getKeys().size() == 0 - Files.delete(filePath) - } - - def "test file valid format"() { - given: - Path filePath = Files.createTempFile("testFile_", ".yaml") - - when: - StableConfig stableConfigYaml = new StableConfig(configId, defaultConfigs) - writeFileYaml(filePath, stableConfigYaml) - StableConfigSource stableCfg = new StableConfigSource(filePath.toString(), ConfigOrigin.LOCAL_STABLE_CONFIG) - - then: - for (key in defaultConfigs.keySet()) { - String keyString = (String) key - keyString = keyString.substring(4) // Cut `DD_` - stableCfg.get(keyString) == defaultConfigs.get(key) - } - // All configs from MatchingRule should be applied - if (ruleConfigs.contains(sampleMatchingRule)) { - for (key in sampleMatchingRule.getConfiguration().keySet()) { - String keyString = (String) key - keyString = keyString.substring(4) // Cut `DD_` - stableCfg.get(keyString) == defaultConfigs.get(key) - } - } - // None of the configs from NonMatchingRule should be applied - if (ruleConfigs.contains(sampleNonMatchingRule)) { - Set cfgKeys = stableCfg.getKeys() - for (key in sampleMatchingRule.getConfiguration().keySet()) { - String keyString = (String) key - keyString = keyString.substring(4) // Cut `DD_` - !cfgKeys.contains(keyString) - } - } - - cleanup: - Files.delete(filePath) - - where: - configId | defaultConfigs | ruleConfigs - "" | [:] | Arrays.asList(new Rule()) - "12345" | ["DD_KEY_ONE": "one", "DD_KEY_TWO": "two"] | Arrays.asList(sampleMatchingRule, sampleNonMatchingRule) - } - - def "test parse invalid logs mapping errors"() { - given: - Logger logbackLogger = (Logger) LoggerFactory.getLogger(StableConfigSource) - def listAppender = new ListAppender() - listAppender.start() - logbackLogger.addAppender(listAppender) - - def tempFile = File.createTempFile("testFile_", ".yaml") - tempFile.text = yaml - - when: - def stableCfg = new StableConfigSource(tempFile.absolutePath, ConfigOrigin.LOCAL_STABLE_CONFIG) - - then: - stableCfg.config == StableConfigSource.StableConfig.EMPTY - def warnLogs = listAppender.list.findAll { it.level.toString() == 'WARN' } - warnLogs.any { it.formattedMessage.contains(expectedLogSubstring) } - - cleanup: - tempFile.delete() - logbackLogger.detachAppender(listAppender) - - where: - yaml | expectedLogSubstring - '''apm_configuration_rules: - - selectors: - - key: "someKey" - matches: ["someValue"] - operator: equals - configuration: - DD_SERVICE: "test" - ''' | "Missing 'origin' in selector" - '''apm_configuration_rules: - - selectors: - - origin: process_arguments - key: "-Dfoo" - matches: ["bar"] - operator: equals - ''' | "Missing 'configuration' in rule" - '''apm_configuration_rules: - - configuration: - DD_SERVICE: "test" - ''' | "Missing 'selectors' in rule" - '''apm_configuration_rules: - - selectors: "not-a-list" - configuration: - DD_SERVICE: "test" - ''' | "'selectors' must be a list, but got: String" - '''apm_configuration_rules: - - selectors: - - "not-a-map" - configuration: - DD_SERVICE: "test" - ''' | "Each selector must be a map, but got: String" - '''apm_configuration_rules: - - selectors: - - origin: process_arguments - key: "-Dfoo" - matches: ["bar"] - operator: equals - configuration: "not-a-map" - ''' | "'configuration' must be a map, but got: String" - '''apm_configuration_rules: - - selectors: - - origin: process_arguments - key: "-Dfoo" - matches: ["bar"] - operator: equals - configuration: 12345 - ''' | "'configuration' must be a map, but got: Integer" - '''apm_configuration_rules: - - "not-a-map" - ''' | "Rule must be a map, but got: String" - '''apm_configuration_rules: - - selectors: - - origin: process_arguments - key: "-Dfoo" - matches: "not-a-list" - operator: equals - configuration: - DD_SERVICE: "test" - ''' | "'matches' must be a list, but got: String" - '''apm_configuration_rules: - - selectors: - - origin: process_arguments - key: "-Dfoo" - matches: ["bar"] - configuration: - DD_SERVICE: "test" - ''' | "Missing 'operator' in selector" - '''apm_configuration_rules: - - selectors: - - origin: process_arguments - key: "-Dfoo" - matches: ["bar"] - operator: 12345 - configuration: - DD_SERVICE: "test" - ''' | "'operator' must be a string, but got: Integer" - '''apm_configuration_rules: - - selectors: - # origin is missing entirely, should trigger NullPointerException - - key: "-Dfoo" - matches: ["bar"] - operator: equals - ''' | "YAML mapping error in stable configuration file" - } - - // Corrupt YAML string variable used for testing, defined outside the 'where' block for readability - static corruptYaml = ''' - abc: 123 - def: - ghi: "jkl" - lmn: 456 - ''' - - // Matching and non-matching Rules used for testing, defined outside the 'where' block for readability - static sampleMatchingRule = new Rule(Arrays.asList(new Selector("origin", "language", Arrays.asList("Java"), null)), singletonMap("DD_KEY_THREE", "three")) - static sampleNonMatchingRule = new Rule(Arrays.asList(new Selector("origin", "language", Arrays.asList("Golang"), null)), singletonMap("DD_KEY_FOUR", "four")) - - def writeFileYaml(Path filePath, StableConfig stableConfigs) { - Map yamlData = new HashMap<>() - - if (stableConfigs.getConfigId() != null && !stableConfigs.getConfigId().isEmpty()) { - yamlData.put("config_id", stableConfigs.getConfigId()) - } - - if (stableConfigs.getApmConfigurationDefault() != null && !stableConfigs.getApmConfigurationDefault().isEmpty()) { - yamlData.put("apm_configuration_default", stableConfigs.getApmConfigurationDefault()) - } - - DumpSettings settings = DumpSettings.builder().build() - Dump dump = new Dump(settings) - String yamlContent = dump.dumpToString(yamlData) - - try (FileWriter writer = new FileWriter(filePath.toFile())) { - writer.write(yamlContent) - } - } - - def "test config id exists in ConfigCollector when using StableConfigSource"() { - given: - Path filePath = Files.createTempFile("testFile_", ".yaml") - String expectedConfigId = "123" - - // Create YAML content with config_id and some configuration - def yamlContent = """ -config_id: ${expectedConfigId} -apm_configuration_default: - DD_SERVICE: test-service - DD_ENV: test-env -""" - Files.write(filePath, yamlContent.getBytes()) - - // Clear any existing collected config - ConfigCollector.get().collect().clear() - - when: - // Create StableConfigSource and ConfigProvider - StableConfigSource stableConfigSource = new StableConfigSource(filePath.toString(), ConfigOrigin.LOCAL_STABLE_CONFIG) - ConfigProvider configProvider = new ConfigProvider(stableConfigSource) - - // Trigger config collection by getting a value - configProvider.getString("SERVICE", "default-service") - - then: - def collectedConfigs = ConfigCollector.get().collect() - def serviceSetting = collectedConfigs.get(ConfigOrigin.LOCAL_STABLE_CONFIG).("SERVICE") - serviceSetting.configId == expectedConfigId - serviceSetting.value == "test-service" - serviceSetting.origin == ConfigOrigin.LOCAL_STABLE_CONFIG - - cleanup: - Files.delete(filePath) - } - - def writeFileRaw(Path filePath, String configId, String data) { - data = configId + "\n" + data - StandardOpenOption[] openOpts = [StandardOpenOption.WRITE] as StandardOpenOption[] - Files.write(filePath, data.getBytes(), openOpts) - } -} diff --git a/utils/config-utils/src/test/java/datadog/trace/api/ConfigSettingTest.java b/utils/config-utils/src/test/java/datadog/trace/api/ConfigSettingTest.java new file mode 100644 index 00000000000..018f108b44f --- /dev/null +++ b/utils/config-utils/src/test/java/datadog/trace/api/ConfigSettingTest.java @@ -0,0 +1,139 @@ +package datadog.trace.api; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; + +import datadog.trace.test.junit.utils.tabletest.ConfigValueConverter; +import org.junit.jupiter.api.extension.ParameterContext; +import org.junit.jupiter.params.converter.ArgumentConversionException; +import org.junit.jupiter.params.converter.ArgumentConverter; +import org.junit.jupiter.params.converter.ConvertWith; +import org.tabletest.junit.TableTest; + +public class ConfigSettingTest { + + @TableTest({ + "scenario | key1 | value1 | origin1 | key2 | value2 | origin2 | expectedEqual", + "equal | key | value | DEFAULT | key | value | DEFAULT | true ", + "different key | key | value | ENV | key2 | value | ENV | false ", + "different value | key | value2 | JVM_PROP | key | value | JVM_PROP | false ", + "different origin | key | value | ENV | key | value | DEFAULT | false " + }) + void supportsEqualityCheck( + String key1, + Object value1, + ConfigOrigin origin1, + String key2, + Object value2, + ConfigOrigin origin2, + boolean expectedEqual) { + ConfigSetting cs1 = ConfigSetting.of(key1, value1, origin1); + ConfigSetting cs2 = ConfigSetting.of(key2, value2, origin2); + + if (expectedEqual) { + assertEquals(cs1.hashCode(), cs2.hashCode()); + assertEquals(cs1, cs2); + assertEquals(cs2, cs1); + assertEquals(cs1.toString(), cs2.toString()); + } else { + assertNotEquals(cs1.hashCode(), cs2.hashCode()); + assertNotEquals(cs1, cs2); + assertNotEquals(cs2, cs1); + assertNotEquals(cs1.toString(), cs2.toString()); + } + } + + @TableTest({ + "scenario | key | value | filteredValue", + "DD_API_KEY | DD_API_KEY | somevalue | ", + "dd.api-key | dd.api-key | somevalue | ", + "dd.profiling.api-key | dd.profiling.api-key | somevalue | ", + "dd.profiling.apikey | dd.profiling.apikey | somevalue | ", + "some.other.key | some.other.key | somevalue | somevalue " + }) + void filtersKeyValues(String key, String value, String filteredValue) { + assertEquals(filteredValue, ConfigSetting.of(key, value, ConfigOrigin.DEFAULT).stringValue()); + } + + @TableTest({ + "scenario | value | rendered", + "null | | ", + "boolean | true | true ", + "boolean | false | false ", + "integer | 1 | 1 ", + "double | 1.0 | 1.0 ", + "float | 2.33f | 2.33 ", + "string | string | string " + }) + void supportBasicTypes(@ConvertWith(BoxedValueConverter.class) Object value, String rendered) { + assertEquals(rendered, ConfigSetting.of("key", value, ConfigOrigin.DEFAULT).stringValue()); + } + + @TableTest({ + "scenario | value | rendered ", + "iterable | [1, 2, 3] | 1,2,3 ", + "decimals | [1.0, 22.23, 3.1415] | 1.0,22.23,3.1415 ", + "map | [a: 1, b: 2] | a:1,b:2 ", + "empty list | [] | '' ", + "empty map | [:] | '' ", + "bitset ranges | bits(33, 200-300, 303, 400-500) | 33,200-300,303,400-500" + }) + void convertIterableMapAndBitSetToString( + @ConvertWith(ConfigValueConverter.class) Object value, String rendered) { + assertEquals(rendered, ConfigSetting.of("key", value, ConfigOrigin.DEFAULT).stringValue()); + } + + /** + * Converts a String cell value to the most specific boxed Java primitive type. Use with + * {@code @ConvertWith(BoxedValueConverter.class)} on {@code Object}-typed parameters when the + * test needs actual typed values (e.g. {@code Float} not {@code String "2.33f"}). + * + *

      Conversion rules: + * + *

        + *
      • blank/null -> null + *
      • {@code "true"}/{@code "false"} -> {@link Boolean} + *
      • ends with {@code "f"} -> {@link Float} + *
      • contains {@code "."} -> {@link Double} + *
      • parseable as integer -> {@link Integer} + *
      • otherwise -> {@link String} + *
      + */ + static class BoxedValueConverter implements ArgumentConverter { + @Override + public Object convert(Object source, ParameterContext context) + throws ArgumentConversionException { + if (source == null) { + return null; + } + + String s = source.toString(); + switch (s) { + case "": + return null; + case "true": + return Boolean.TRUE; + case "false": + return Boolean.FALSE; + } + if (s.endsWith("f")) { + try { + return Float.parseFloat(s.substring(0, s.length() - 1)); + } catch (NumberFormatException ignored) { + } + } + + if (s.contains(".")) { + try { + return Double.parseDouble(s); + } catch (NumberFormatException ignored) { + } + } + try { + return Integer.parseInt(s); + } catch (NumberFormatException ignored) { + } + return s; + } + } +} diff --git a/utils/config-utils/src/test/java/datadog/trace/api/env/CapturedEnvironmentTest.java b/utils/config-utils/src/test/java/datadog/trace/api/env/CapturedEnvironmentTest.java new file mode 100644 index 00000000000..4b0c22204b7 --- /dev/null +++ b/utils/config-utils/src/test/java/datadog/trace/api/env/CapturedEnvironmentTest.java @@ -0,0 +1,104 @@ +package datadog.trace.api.env; + +import static java.io.File.separator; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import datadog.trace.api.config.GeneralConfig; +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import org.tabletest.junit.TableTest; + +public class CapturedEnvironmentTest { + + @TableTest({ + "scenario | sunJavaCommand | envVars | expectedServiceName ", + "null command | null | [:] | ", + "empty command | '' | [:] | ", + "all blanks | ' ' | [:] | ", + "class in command | org.example.App -Dfoo=bar arg2 arg3 | [:] | org.example.App ", + "jar in command | foo/bar/example.jar -Dfoo=bar arg2 arg3 | [:] | example ", + "real sun command | | [:] | datadog.trace.api.env.CapturedEnvironmentTest$ServiceNamePrinter", + "azure site name | foo/bar/example.jar -Dfoo=bar arg2 arg3 | [DD_AZURE_APP_SERVICES: 1, WEBSITE_SITE_NAME: siteService] | siteService ", + "site name no azure | foo/bar/example.jar -Dfoo=bar arg2 arg3 | [WEBSITE_SITE_NAME: siteService] | example ", + "azure flag no site | foo/bar/example.jar -Dfoo=bar arg2 arg3 | [DD_AZURE_APP_SERVICES: true] | example " + }) + void capturesServiceName( + String sunJavaCommand, Map envVars, String expectedServiceName) + throws IOException, InterruptedException { + assertEquals(expectedServiceName, forkAndRunProperties(sunJavaCommand, envVars)); + } + + private static String forkAndRunProperties(String arg, Map envVars) + throws IOException, InterruptedException { + // Build the command to run a new Java process + List command = new ArrayList<>(); + command.add(System.getProperty("java.home") + separator + "bin" + separator + "java"); + command.add("-cp"); + command.add(System.getProperty("java.class.path")); + command.add(ServiceNamePrinter.class.getName()); + if (arg != null) { + command.add(arg); + } + // Start the process + ProcessBuilder processBuilder = new ProcessBuilder(command); + processBuilder.environment().putAll(envVars); + Process process = processBuilder.start(); + // Read and parse output and error streams + String serviceName = ""; + try (BufferedReader reader = + new BufferedReader(new InputStreamReader(process.getInputStream()))) { + String line; + while ((line = reader.readLine()) != null) { + if (!serviceName.isEmpty()) { + serviceName += "\n"; + } + serviceName += line; + } + } + if ("null".equals(serviceName)) { + serviceName = null; + } + String error = ""; + try (BufferedReader reader = + new BufferedReader(new InputStreamReader(process.getErrorStream()))) { + String line; + while ((line = reader.readLine()) != null) { + error += line + "\n"; + } + } + // Wait for the process to complete + int exitCode = process.waitFor(); + // Dumping state on error + if (exitCode != 0) { + System.out.println( + "Error printing service name. Exit code " + + exitCode + + " with service name: '" + + serviceName + + "' and error:\n" + + error); + throw new IllegalStateException("Process should exit without error"); + } + return serviceName; + } + + public static class ServiceNamePrinter { + public static void main(String[] args) { + if (args.length > 0) { + String sunJavaCommand = args[0]; + if ("null".equals(sunJavaCommand)) { + System.clearProperty("sun.java.command"); + } else { + System.setProperty("sun.java.command", sunJavaCommand); + } + } + CapturedEnvironment capturedEnv = CapturedEnvironment.get(); + Map props = capturedEnv.getProperties(); + System.out.println(props.get(GeneralConfig.SERVICE_NAME)); + } + } +} diff --git a/utils/config-utils/src/test/java/datadog/trace/bootstrap/config/provider/AgentArgsInjectorTest.java b/utils/config-utils/src/test/java/datadog/trace/bootstrap/config/provider/AgentArgsInjectorTest.java new file mode 100644 index 00000000000..f70c00fce02 --- /dev/null +++ b/utils/config-utils/src/test/java/datadog/trace/bootstrap/config/provider/AgentArgsInjectorTest.java @@ -0,0 +1,25 @@ +package datadog.trace.bootstrap.config.provider; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; + +public class AgentArgsInjectorTest { + + @AfterEach + void clearInjectedProperties() { + System.clearProperty("arg1"); + System.clearProperty("arg2"); + } + + @Test + void injectsAgentArgumentsAsSystemProperties() { + String agentArgs = "arg1=value1,arg2=value2"; + + AgentArgsInjector.injectAgentArgsConfig(agentArgs); + + assertEquals("value1", System.getProperty("arg1")); + assertEquals("value2", System.getProperty("arg2")); + } +} diff --git a/utils/config-utils/src/test/java/datadog/trace/bootstrap/config/provider/AgentArgsParserTest.java b/utils/config-utils/src/test/java/datadog/trace/bootstrap/config/provider/AgentArgsParserTest.java new file mode 100644 index 00000000000..f89dd8025b5 --- /dev/null +++ b/utils/config-utils/src/test/java/datadog/trace/bootstrap/config/provider/AgentArgsParserTest.java @@ -0,0 +1,35 @@ +package datadog.trace.bootstrap.config.provider; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; + +import java.util.Map; +import org.tabletest.junit.TableTest; + +public class AgentArgsParserTest { + + @TableTest({ + "scenario | args | size | key | expectedValue ", + "single argument | key1=value1 | 1 | key1 | value1 ", + "multiple arguments | key1=value1,key2=value2 | 2 | key2 | value2 ", + "argument with spaces | key=value with spaces | 1 | key | value with spaces" + }) + void parsesArguments(String args, int size, String key, String expectedValue) { + Map properties = AgentArgsParser.parseAgentArgs(args); + + assertNotNull(properties); + assertEquals(size, properties.size()); + assertEquals(expectedValue, properties.get(key)); + } + + @TableTest({ + "scenario | args ", + "null string | ", + "empty string | '' ", + "malformed | key=value,,,==" + }) + void returnsNullForInvalidArguments(String args) { + assertNull(AgentArgsParser.parseAgentArgs(args)); + } +} diff --git a/utils/config-utils/src/test/java/datadog/trace/bootstrap/config/provider/ConfigConverterTest.java b/utils/config-utils/src/test/java/datadog/trace/bootstrap/config/provider/ConfigConverterTest.java new file mode 100644 index 00000000000..863902ece26 --- /dev/null +++ b/utils/config-utils/src/test/java/datadog/trace/bootstrap/config/provider/ConfigConverterTest.java @@ -0,0 +1,165 @@ +package datadog.trace.bootstrap.config.provider; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; +import org.tabletest.junit.TableTest; + +public class ConfigConverterTest { + + @TableTest({ + "scenario | stringValue | expectedConvertedValue", + "true | true | true ", + "TRUE | TRUE | true ", + "True | True | true ", + "1 | 1 | true ", + "false | false | false ", + "null | | ", + "empty string | '' | ", + "0 | 0 | false " + }) + void convertBooleanProperties(String stringValue, Boolean expectedConvertedValue) { + assertEquals(expectedConvertedValue, ConfigConverter.valueOf(stringValue, Boolean.class)); + } + + @TableTest({ + "invalidValue", + "42.42 ", + "tru ", + "truee ", + "'true ' ", + "' true' ", + "' true ' ", + "' true ' ", + "notABool ", + "yes ", + "no ", + "on ", + "off " + }) + void convertBooleanPropertiesThrowsExceptionForInvalidValues(String invalidValue) { + ConfigConverter.InvalidBooleanValueException exception = + assertThrows( + ConfigConverter.InvalidBooleanValueException.class, + () -> ConfigConverter.valueOf(invalidValue, Boolean.class)); + assertTrue(exception.getMessage().contains("Invalid boolean value:")); + } + + @TableTest({ + "mapString | expected ", + "a:1, a:2, a:3 | [a: '3'] ", + "a:b,c:d,e: | [a: b, c: d] ", + "a:1 a:2 a:3 | [a: '3'] ", + "a:b c:d e: | [a: b, c: d] ", + "a:a; | [a: a;] ", + "a:1, a:2, a:3 | [a: '3'] ", + "a:1 a:2 a:3 | [a: '3'] ", + "a:b,c:d,e: | [a: b, c: d] ", + "a:b c:d e: | [a: b, c: d] ", + "'key 1!:va|ue_1,' | [key 1!: 'va|ue_1'] ", + "'key 1!:va|ue_1 ' | [key 1!: 'va|ue_1'] ", + "' key1 :value1 ,\t key2: value2' | [key1: value1, key2: value2] ", + "a:b, b:c, c:d, d: e | [a: b, b: c, c: d, d: e] ", + "key1 :value1 \t key2: value2 | [key1: value1, key2: value2] ", + "dyno:web.1 dynotype:web appname:****** | [dyno: web.1, dynotype: web, appname: ******] ", + "is:val:id | [is: 'val:id'] ", + "a:b,is:val:id,x:y | [a: b, is: 'val:id', x: y] ", + "a:b:c:d | [a: 'b:c:d'] ", + "fooa:barb, foob:barc, fooc: bard, food: bare, | [fooa: barb, foob: barc, fooc: bard, food: bare]", + "a:b=c=d | [a: b=c=d] ", + "a: | [:] ", + "a:b,c,d | [:] ", + "a:b,c,d,k:v | [:] ", + "'' | [:] ", + "1 | [:] ", + "a | [:] ", + "a,1 | [:] ", + "!a | [:] ", + "' ' | [:] ", + ",,,, | [:] ", + ":,:,:,: | [:] ", + "': : : : ' | [:] ", + ":::: | [:] ", + "key1:val1 with_space:and_colon, key2:val2 | [:] " + }) + void parseMapProperly(String mapString, Map expected) { + assertEquals(expected, ConfigConverter.parseMap(mapString, "test")); + } + + @TableTest({ + "mapString | separator | expected ", + "a=1, a=2, a=3 | = | [a: '3'] ", + "a=b,c=d,e= | = | [a: b, c: d] ", + "a;b,c;d,e; | ; | [a: b, c: d] ", + "a=1 a=2 a=3 | = | [a: '3'] ", + "a=b c=d e= | = | [a: b, c: d] ", + "a=b=c=d | = | [a: b=c=d] ", + "fooa=barb, foob=barc, fooc= bard, food= bare, | = | [fooa: barb, foob: barc, fooc: bard, food: bare]", + "a=b:c:d | = | [a: 'b:c:d'] ", + "a= | = | [:] ", + "==== | = | [:] " + }) + void parseMapWithSeparator(String mapString, char separator, Map expected) { + assertEquals(expected, ConfigConverter.parseMap(mapString, "test", separator)); + } + + @TableTest({ + "mapString | separator | expected ", + "key1:value1,key2:value2 | : | [key1: value1, key2: value2] ", + "key1:value1 key2:value2 | : | [key1: value1, key2: value2] ", + "env:test aKey:aVal bKey:bVal cKey: | : | [env: test, aKey: aVal, bKey: bVal, cKey: ''] ", + "env:test,aKey:aVal,bKey:bVal,cKey: | : | [env: test, aKey: aVal, bKey: bVal, cKey: ''] ", + "env:test,aKey:aVal bKey:bVal cKey: | : | [env: test, aKey: 'aVal bKey:bVal cKey:'] ", + "env:test bKey :bVal dKey: dVal cKey: | : | [env: test, bKey: '', dKey: '', dVal: '', cKey: '']", + "env :test, aKey : aVal bKey:bVal cKey: | : | [env: test, aKey: 'aVal bKey:bVal cKey:'] ", + "env:keyWithA:Semicolon bKey:bVal cKey | : | [env: 'keyWithA:Semicolon', bKey: bVal, cKey: ''] ", + "env:keyWith: , , Lots:Of:Semicolons | : | [env: 'keyWith:', Lots: 'Of:Semicolons'] ", + "a:b,c,d | : | [a: b, c: '', d: ''] ", + "a,1 | : | [a: '', 1: ''] ", + "a:b:c:d | : | [a: 'b:c:d'] ", + "noDelimiters | : | [noDelimiters: ''] ", + "' ' | : | [:] ", + ",,,,,,,,,,,, | : | [:] ", + "', , , , , , ' | : | [:] " + }) + void parsingMapWithListOfArgSeparatorsForWithKeyValueSeparator( + String mapString, char separator, Map expected) { + // testing parsing for DD_TAGS + List separatorList = Arrays.asList(',', ' '); + assertEquals(expected, ConfigConverter.parseTraceTagsMap(mapString, separator, separatorList)); + } + + @TableTest({ + "mapString | expected | lowercaseKeys | defaultPrefix ", + "header1:one,header2:two | [header1: one, header2: two] | false | '' ", + "header1:one, header2:two | [header1: one, header2: two] | false | '' ", + "header1,header2:two | [header1: header1, header2: two] | false | '' ", + "Header1:one,header2:two | [header1: one, header2: two] | true | '' ", + "'\"header1:one,header2:two\"' | ['\"header1': one, header2: 'two\"'] | true | '' ", + "header1 | [header1: header1] | true | '' ", + ",header1:tag | [header1: tag] | true | '' ", + "header1:tag, | [header1: tag] | true | '' ", + "header:tag:value | [header: 'tag:value'] | true | '' ", + "'' | [:] | true | '' ", + " | [:] | true | '' ", + "* | [*: 'datadog.response.headers.'] | true | datadog.response.headers", + "*: | [:] | true | datadog.response.headers", + "*,header1:tag | [*: 'datadog.response.headers.'] | true | datadog.response.headers", + "header1:tag,* | [*: 'datadog.response.headers.'] | true | datadog.response.headers", + "1header,header2:two | [:] | true | '' ", + "header::tag | [:] | true | '' ", + ":tag | [:] | true | '' ", + "header:tag,:tag | [:] | true | '' " + }) + void testParseMapWithOptionalMappings( + String mapString, Map expected, boolean lowercaseKeys, String defaultPrefix) { + assertEquals( + expected, + ConfigConverter.parseMapWithOptionalMappings( + mapString, "test", defaultPrefix, lowercaseKeys)); + } +} diff --git a/utils/config-utils/src/test/java/datadog/trace/bootstrap/config/provider/PropertiesConfigSourceTest.java b/utils/config-utils/src/test/java/datadog/trace/bootstrap/config/provider/PropertiesConfigSourceTest.java new file mode 100644 index 00000000000..cbfdc31c3d5 --- /dev/null +++ b/utils/config-utils/src/test/java/datadog/trace/bootstrap/config/provider/PropertiesConfigSourceTest.java @@ -0,0 +1,33 @@ +package datadog.trace.bootstrap.config.provider; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import datadog.trace.test.util.DDJavaSpecification; +import java.util.Properties; +import org.junit.jupiter.api.Test; +import org.tabletest.junit.TableTest; + +public class PropertiesConfigSourceTest extends DDJavaSpecification { + + @Test + void throwsWhenPropertiesAreNull() { + assertThrows(AssertionError.class, () -> new PropertiesConfigSource(null, true)); + } + + @TableTest({ + "scenario | usePrefix | abc | ddAbc | missing", + "no prefix | false | def | xyz | ", + "with prefix | true | xyz | | " + }) + void configPulledFromProperties(boolean usePrefix, String abc, String ddAbc, String missing) { + Properties props = new Properties(); + props.put("abc", "def"); + props.put("dd.abc", "xyz"); + PropertiesConfigSource source = new PropertiesConfigSource(props, usePrefix); + + assertEquals(abc, source.get("abc")); + assertEquals(ddAbc, source.get("dd.abc")); + assertEquals(missing, source.get("missing")); + } +} diff --git a/utils/config-utils/src/test/java/datadog/trace/bootstrap/config/provider/StableConfigMappingExceptionTest.java b/utils/config-utils/src/test/java/datadog/trace/bootstrap/config/provider/StableConfigMappingExceptionTest.java new file mode 100644 index 00000000000..8b2476197f3 --- /dev/null +++ b/utils/config-utils/src/test/java/datadog/trace/bootstrap/config/provider/StableConfigMappingExceptionTest.java @@ -0,0 +1,60 @@ +package datadog.trace.bootstrap.config.provider; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.bootstrap.config.provider.stableconfig.StableConfigMappingException; +import java.util.Arrays; +import org.junit.jupiter.api.Test; + +public class StableConfigMappingExceptionTest { + + @Test + void constructorsWorkAsExpected() { + StableConfigMappingException ex1 = new StableConfigMappingException("msg"); + StableConfigMappingException ex2 = new StableConfigMappingException("msg2"); + + assertEquals("msg", ex1.getMessage()); + assertNull(ex1.getCause()); + assertEquals("msg2", ex2.getMessage()); + } + + @Test + void safeToStringHandlesNull() { + StableConfigMappingException ex = + assertThrows( + StableConfigMappingException.class, + () -> StableConfigMappingException.throwStableConfigMappingException("msg", null)); + assertTrue(ex.getMessage().endsWith(" null")); + } + + @Test + void safeToStringHandlesShortString() { + StableConfigMappingException ex = + assertThrows( + StableConfigMappingException.class, + () -> + StableConfigMappingException.throwStableConfigMappingException( + "msg", "short string")); + assertTrue(ex.getMessage().endsWith(" short string")); + } + + @Test + void safeToStringHandlesLongString() { + char[] chars = new char[101]; + Arrays.fill(chars, 'a'); + String longStr = new String(chars); + + StableConfigMappingException ex = + assertThrows( + StableConfigMappingException.class, + () -> StableConfigMappingException.throwStableConfigMappingException("msg", longStr)); + + char[] halfChars = new char[50]; + Arrays.fill(halfChars, 'a'); + String half = new String(halfChars); + assertTrue(ex.getMessage().endsWith(" " + half + "...(truncated)..." + half)); + } +} diff --git a/utils/config-utils/src/test/java/datadog/trace/bootstrap/config/provider/StableConfigSourceTest.java b/utils/config-utils/src/test/java/datadog/trace/bootstrap/config/provider/StableConfigSourceTest.java new file mode 100644 index 00000000000..8ca3989ba7f --- /dev/null +++ b/utils/config-utils/src/test/java/datadog/trace/bootstrap/config/provider/StableConfigSourceTest.java @@ -0,0 +1,350 @@ +package datadog.trace.bootstrap.config.provider; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.params.provider.Arguments.arguments; + +import ch.qos.logback.classic.Logger; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.read.ListAppender; +import datadog.trace.api.ConfigCollector; +import datadog.trace.api.ConfigOrigin; +import datadog.trace.api.ConfigSetting; +import datadog.trace.test.util.DDJavaSpecification; +import de.thetaphi.forbiddenapis.SuppressForbidden; +import java.io.File; +import java.io.FileWriter; +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; +import java.util.HashMap; +import java.util.Map; +import java.util.stream.Stream; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import org.slf4j.LoggerFactory; +import org.snakeyaml.engine.v2.api.Dump; +import org.snakeyaml.engine.v2.api.DumpSettings; +import org.tabletest.junit.TableTest; + +@SuppressForbidden +public class StableConfigSourceTest extends DDJavaSpecification { + + @Test + void testFileDoesntExist() { + StableConfigSource config = + new StableConfigSource( + StableConfigSource.LOCAL_STABLE_CONFIG_PATH, ConfigOrigin.LOCAL_STABLE_CONFIG); + + assertEquals(0, config.getKeys().size()); + assertNull(config.getConfigId()); + } + + @Test + void testEmptyFile() throws IOException { + Path filePath = Files.createTempFile("testFile_", ".yaml"); + try { + StableConfigSource config = + new StableConfigSource(filePath.toString(), ConfigOrigin.LOCAL_STABLE_CONFIG); + assertEquals(0, config.getKeys().size()); + assertNull(config.getConfigId()); + } finally { + Files.delete(filePath); + } + } + + @TableTest({ + "scenario | configId | data ", + "corrupt yaml | | not_valid_stable_config ", + "invalid format | 12345 | this is not yaml format!" + }) + void testFileInvalidFormat(String configId, String data) throws IOException { + Path filePath = Files.createTempFile("testFile_", ".yaml"); + assertNotNull(filePath, "Failed to create: " + filePath); + try { + writeFileRaw(filePath, configId, data); + StableConfigSource stableCfg = + new StableConfigSource(filePath.toString(), ConfigOrigin.LOCAL_STABLE_CONFIG); + + assertNull(stableCfg.getConfigId()); + assertEquals(0, stableCfg.getKeys().size()); + } finally { + Files.delete(filePath); + } + } + + @Test + void testNullValuesInYaml() throws IOException { + Path filePath = Files.createTempFile("testFile_", ".yaml"); + assertNotNull(filePath, "Failed to create: " + filePath); + try { + // Test the scenario where YAML contains null values for apm_configuration_default and + // apm_configuration_rules + String yaml = "config_id: \"12345\"\napm_configuration_default:\napm_configuration_rules:\n"; + Files.write(filePath, yaml.getBytes()); + + StableConfigSource stableCfg = + new StableConfigSource(filePath.toString(), ConfigOrigin.LOCAL_STABLE_CONFIG); + + // Should not throw NullPointerException and should handle null values gracefully + assertEquals("12345", stableCfg.getConfigId()); + assertEquals(0, stableCfg.getKeys().size()); + } finally { + Files.delete(filePath); + } + } + + @TableTest({ + "configId | defaultConfigs ", + "'' | [:] ", + "12345 | [DD_KEY_ONE: one, DD_KEY_TWO: two]" + }) + void testFileValidFormat(String configId, Map defaultConfigs) throws IOException { + Path filePath = Files.createTempFile("testFile_", ".yaml"); + try { + writeFileYaml(filePath, configId, defaultConfigs); + StableConfigSource stableCfg = + new StableConfigSource(filePath.toString(), ConfigOrigin.LOCAL_STABLE_CONFIG); + + assertEquals(configId.isEmpty() ? null : configId, stableCfg.getConfigId()); + assertEquals(defaultConfigs.keySet(), stableCfg.getKeys()); + defaultConfigs.forEach( + (key, value) -> assertEquals(value, stableCfg.get(key.substring("DD_".length())))); + } finally { + Files.delete(filePath); + } + } + + @ParameterizedTest + @MethodSource("testParseInvalidLogsMappingErrorsArguments") + void testParseInvalidLogsMappingErrors(String yaml, String expectedLogSubstring) + throws IOException { + Logger logbackLogger = (Logger) LoggerFactory.getLogger(StableConfigSource.class); + ListAppender listAppender = new ListAppender<>(); + listAppender.start(); + logbackLogger.addAppender(listAppender); + + File tempFile = File.createTempFile("testFile_", ".yaml"); + try { + Files.write(tempFile.toPath(), yaml.getBytes()); + + StableConfigSource stableCfg = + new StableConfigSource(tempFile.getAbsolutePath(), ConfigOrigin.LOCAL_STABLE_CONFIG); + + assertNull(stableCfg.getConfigId()); + assertEquals(0, stableCfg.getKeys().size()); + boolean hasExpectedLog = + listAppender.list.stream() + .anyMatch( + event -> + "WARN".equals(event.getLevel().toString()) + && event.getFormattedMessage().contains(expectedLogSubstring)); + assertTrue(hasExpectedLog, "Expected WARN log containing: " + expectedLogSubstring); + } finally { + tempFile.delete(); + logbackLogger.detachAppender(listAppender); + } + } + + static Stream testParseInvalidLogsMappingErrorsArguments() { + return Stream.of( + arguments( + "apm_configuration_rules:\n" + + " - selectors:\n" + + " - key: \"someKey\"\n" + + " matches: [\"someValue\"]\n" + + " operator: equals\n" + + " configuration:\n" + + " DD_SERVICE: \"test\"\n", + "Missing 'origin' in selector"), + arguments( + "apm_configuration_rules:\n" + + " - selectors:\n" + + " - origin: process_arguments\n" + + " key: \"-Dfoo\"\n" + + " matches: [\"bar\"]\n" + + " operator: equals\n", + "Missing 'configuration' in rule"), + arguments( + "apm_configuration_rules:\n" + + " - configuration:\n" + + " DD_SERVICE: \"test\"\n", + "Missing 'selectors' in rule"), + arguments( + "apm_configuration_rules:\n" + + " - selectors: \"not-a-list\"\n" + + " configuration:\n" + + " DD_SERVICE: \"test\"\n", + "'selectors' must be a list, but got: String"), + arguments( + "apm_configuration_rules:\n" + + " - selectors:\n" + + " - \"not-a-map\"\n" + + " configuration:\n" + + " DD_SERVICE: \"test\"\n", + "Each selector must be a map, but got: String"), + arguments( + "apm_configuration_rules:\n" + + " - selectors:\n" + + " - origin: process_arguments\n" + + " key: \"-Dfoo\"\n" + + " matches: [\"bar\"]\n" + + " operator: equals\n" + + " configuration: \"not-a-map\"\n", + "'configuration' must be a map, but got: String"), + arguments( + "apm_configuration_rules:\n" + + " - selectors:\n" + + " - origin: process_arguments\n" + + " key: \"-Dfoo\"\n" + + " matches: [\"bar\"]\n" + + " operator: equals\n" + + " configuration: 12345\n", + "'configuration' must be a map, but got: Integer"), + arguments( + "apm_configuration_rules:\n" + " - \"not-a-map\"\n", + "Rule must be a map, but got: String"), + arguments( + "apm_configuration_rules:\n" + + " - selectors:\n" + + " - origin: process_arguments\n" + + " key: \"-Dfoo\"\n" + + " matches: \"not-a-list\"\n" + + " operator: equals\n" + + " configuration:\n" + + " DD_SERVICE: \"test\"\n", + "'matches' must be a list, but got: String"), + arguments( + "apm_configuration_rules:\n" + + " - selectors:\n" + + " - origin: process_arguments\n" + + " key: \"-Dfoo\"\n" + + " matches: [\"bar\"]\n" + + " configuration:\n" + + " DD_SERVICE: \"test\"\n", + "Missing 'operator' in selector"), + arguments( + "apm_configuration_rules:\n" + + " - selectors:\n" + + " - origin: process_arguments\n" + + " key: \"-Dfoo\"\n" + + " matches: [\"bar\"]\n" + + " operator: 12345\n" + + " configuration:\n" + + " DD_SERVICE: \"test\"\n", + "'operator' must be a string, but got: Integer"), + arguments( + "apm_configuration_rules:\n" + + " - selectors:\n" + + " # origin is missing entirely, should trigger NullPointerException\n" + + " - key: \"-Dfoo\"\n" + + " matches: [\"bar\"]\n" + + " operator: equals\n", + "YAML mapping error in stable configuration file")); + } + + @Test + @SuppressForbidden + void testConfigIdExistsInConfigCollectorWhenUsingStableConfigSource() throws Exception { + Path filePath = Files.createTempFile("testFile_", ".yaml"); + String expectedConfigId = "123"; + + // Create YAML content with config_id and some configuration + String yamlContent = + "config_id: " + + expectedConfigId + + "\napm_configuration_default:\n DD_SERVICE: test-service\n DD_ENV: test-env\n"; + Files.write(filePath, yamlContent.getBytes()); + + // Clear any existing collected config + ConfigCollector.get().collect(); + + try { + StableConfigSource stableConfigSource = + new StableConfigSource(filePath.toString(), ConfigOrigin.LOCAL_STABLE_CONFIG); + + // Create ConfigProvider via reflection (constructor is private) + Constructor constructor = + ConfigProvider.class.getDeclaredConstructor(ConfigProvider.Source[].class); + constructor.setAccessible(true); + ConfigProvider configProvider = + constructor.newInstance((Object) new ConfigProvider.Source[] {stableConfigSource}); + + // Trigger config collection by getting a value + configProvider.getString("SERVICE", "default-service"); + + Map> collectedConfigs = + ConfigCollector.get().collect(); + Map localStableConfigs = + collectedConfigs.get(ConfigOrigin.LOCAL_STABLE_CONFIG); + assertNotNull(localStableConfigs, "No configs collected for LOCAL_STABLE_CONFIG origin"); + ConfigSetting serviceSetting = localStableConfigs.get("SERVICE"); + assertNotNull(serviceSetting, "No SERVICE setting collected"); + assertEquals(expectedConfigId, serviceSetting.configId); + assertEquals("test-service", serviceSetting.value); + assertEquals(ConfigOrigin.LOCAL_STABLE_CONFIG, serviceSetting.origin); + } finally { + Files.delete(filePath); + } + } + + @Test + void testStableConfigGetHandlesPresentAndMissingKeys() { + Map configMap = new HashMap<>(); + configMap.put("DD_SERVICE", "test-service"); + configMap.put("DD_PORT", 8126); + + StableConfigSource.StableConfig config = + new StableConfigSource.StableConfig("config-123", configMap); + + // Present String value: hits the non-null branch of the ternary in get() + assertEquals("test-service", config.get("DD_SERVICE")); + // Present non-String value: exercises String.valueOf on a non-null, non-String object + assertEquals("8126", config.get("DD_PORT")); + // Missing key: hits the null branch of the ternary in get() + assertNull(config.get("DD_MISSING")); + + assertEquals("config-123", config.getConfigId()); + assertEquals(configMap.keySet(), config.getKeys()); + } + + @Test + void testStableConfigEmpty() { + StableConfigSource.StableConfig empty = StableConfigSource.StableConfig.EMPTY; + assertNull(empty.get("DD_SERVICE")); + assertNull(empty.getConfigId()); + assertEquals(0, empty.getKeys().size()); + } + + private static void writeFileYaml( + Path filePath, String configId, Map defaultConfigs) throws IOException { + Map yamlData = new HashMap<>(); + + if (configId != null && !configId.isEmpty()) { + yamlData.put("config_id", configId); + } + + if (defaultConfigs != null && !defaultConfigs.isEmpty()) { + yamlData.put("apm_configuration_default", defaultConfigs); + } + + DumpSettings settings = DumpSettings.builder().build(); + Dump dump = new Dump(settings); + String yamlContent = dump.dumpToString(yamlData); + + try (FileWriter writer = new FileWriter(filePath.toFile())) { + writer.write(yamlContent); + } + } + + private static void writeFileRaw(Path filePath, String configId, String data) throws IOException { + String content = configId + "\n" + data; + Files.write(filePath, content.getBytes(), StandardOpenOption.WRITE); + } +} diff --git a/utils/config-utils/src/test/java/datadog/trace/bootstrap/config/provider/stableconfig/RuleTest.java b/utils/config-utils/src/test/java/datadog/trace/bootstrap/config/provider/stableconfig/RuleTest.java new file mode 100644 index 00000000000..d84c653f3d4 --- /dev/null +++ b/utils/config-utils/src/test/java/datadog/trace/bootstrap/config/provider/stableconfig/RuleTest.java @@ -0,0 +1,85 @@ +package datadog.trace.bootstrap.config.provider.stableconfig; + +import static java.util.Arrays.asList; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import org.junit.jupiter.api.Test; + +class RuleTest { + + @Test + void testNoArgConstructorYieldsEmptyState() { + Rule rule = new Rule(); + assertTrue(rule.getSelectors().isEmpty()); + assertTrue(rule.getConfiguration().isEmpty()); + } + + @Test + void testConstructorExposesValuesViaGetters() { + Selector selector = new Selector("process_arguments", "-Dfoo", asList("bar"), "equals"); + Map configuration = new HashMap<>(); + configuration.put("DD_SERVICE", "test"); + + Rule rule = new Rule(asList(selector), configuration); + + assertEquals(1, rule.getSelectors().size()); + assertSame(selector, rule.getSelectors().get(0)); + assertSame(configuration, rule.getConfiguration()); + } + + @Test + void testFromParsesValidRule() { + Map selectorMap = new LinkedHashMap<>(); + selectorMap.put("origin", "process_arguments"); + selectorMap.put("key", "-Dfoo"); + selectorMap.put("matches", asList("bar")); + selectorMap.put("operator", "equals"); + + Map configuration = new LinkedHashMap<>(); + configuration.put("DD_SERVICE", "test"); + + Map ruleMap = new LinkedHashMap<>(); + ruleMap.put("selectors", asList(selectorMap)); + ruleMap.put("configuration", configuration); + + Rule rule = Rule.from(ruleMap); + + List selectors = rule.getSelectors(); + assertEquals(1, selectors.size()); + Selector selector = selectors.get(0); + assertEquals("process_arguments", selector.getOrigin()); + assertEquals("-Dfoo", selector.getKey()); + assertEquals(asList("bar"), selector.getMatches()); + assertEquals("equals", selector.getOperator()); + + assertEquals("test", rule.getConfiguration().get("DD_SERVICE")); + } + + @Test + void testFromSkipsNullSelectorEntries() { + Map selectorMap = new LinkedHashMap<>(); + selectorMap.put("origin", "process_arguments"); + selectorMap.put("key", "-Dfoo"); + selectorMap.put("matches", asList("bar")); + selectorMap.put("operator", "equals"); + + Map configuration = new LinkedHashMap<>(); + configuration.put("DD_SERVICE", "test"); + + Map ruleMap = new LinkedHashMap<>(); + ruleMap.put("selectors", asList(null, selectorMap)); + ruleMap.put("configuration", configuration); + + Rule rule = Rule.from(ruleMap); + + // The null entry is filtered out, leaving only the valid selector. + assertEquals(1, rule.getSelectors().size()); + assertEquals("process_arguments", rule.getSelectors().get(0).getOrigin()); + } +} diff --git a/utils/config-utils/src/test/java/datadog/trace/util/ConfigStringsTest.java b/utils/config-utils/src/test/java/datadog/trace/util/ConfigStringsTest.java new file mode 100644 index 00000000000..c8b5acb8dfd --- /dev/null +++ b/utils/config-utils/src/test/java/datadog/trace/util/ConfigStringsTest.java @@ -0,0 +1,33 @@ +package datadog.trace.util; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; + +import java.util.Locale; +import org.junit.jupiter.api.Test; + +class ConfigStringsTest { + + /** Dotted capital I (U+0130) that a Turkish-locale {@code toUpperCase()} produces from 'i'. */ + private static final char DOTTED_CAPITAL_I = 'İ'; + + @Test + void toEnvVarUppercasesLowerIToAsciiIOnTurkishLocale() { + // Turkish is the locale where a locale-sensitive toUpperCase() maps 'i' -> 'İ' + // Forcing it as the default locale here proves the conversions are + // locale-independent (pinned to Locale.ROOT) rather than relying on the machine's locale. + Locale previousDefault = Locale.getDefault(); + Locale.setDefault(new Locale("tr", "TR")); + try { + String result = ConfigStrings.toEnvVar("dd.profiling.i"); + + // Must be the plain ASCII 'I' (U+0049), not the Turkish dotted 'İ' (U+0130). + assertEquals("DD_PROFILING_I", result); + assertFalse( + result.indexOf(DOTTED_CAPITAL_I) >= 0, + "env var name must not contain the dotted capital I (U+0130)"); + } finally { + Locale.setDefault(previousDefault); + } + } +} diff --git a/utils/container-utils/gradle.lockfile b/utils/container-utils/gradle.lockfile index 73f215e3153..03cbe2f2558 100644 --- a/utils/container-utils/gradle.lockfile +++ b/utils/container-utils/gradle.lockfile @@ -1,10 +1,12 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :utils:container-utils:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -17,8 +19,8 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -41,10 +43,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -58,10 +60,13 @@ org.mockito:mockito-core:4.4.0=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/utils/container-utils/src/test/groovy/datadog/common/container/ContainerInfoTest.groovy b/utils/container-utils/src/test/groovy/datadog/common/container/ContainerInfoTest.groovy deleted file mode 100644 index 1b74763b5b3..00000000000 --- a/utils/container-utils/src/test/groovy/datadog/common/container/ContainerInfoTest.groovy +++ /dev/null @@ -1,365 +0,0 @@ -package datadog.common.container - -import datadog.trace.test.util.DDSpecification - -import java.nio.file.Files -import java.nio.file.Path -import java.nio.file.Paths -import java.text.ParseException - -class ContainerInfoTest extends DDSpecification { - - def "CGroupInfo is parsed from individual lines"() { - when: - ContainerInfo.CGroupInfo cGroupInfo = ContainerInfo.parseLine(line) - - then: - cGroupInfo.getId() == id - cGroupInfo.getPath() == path - cGroupInfo.getControllers() == controllers - cGroupInfo.getContainerId() == containerId - cGroupInfo.podId == podId - - // Examples from container tagging rfc and Qard/container-info - where: - // spotless:off - id | controllers | path | containerId | podId | line - - // Docker examples - 13 | ["name=systemd"] | "/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | "3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | null | "13:name=systemd:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" - 12 | ["pids"] | "/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | "3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | null | "12:pids:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" - 11 | ["hugetlb"] | "/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | "3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | null | "11:hugetlb:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" - 10 | ["net_prio"] | "/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | "3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | null | "10:net_prio:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" - 9 | ["perf_event"] | "/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | "3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | null | "9:perf_event:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" - 8 | ["net_cls"] | "/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | "3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | null | "8:net_cls:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" - 7 | ["freezer"] | "/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | "3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | null | "7:freezer:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" - 6 | ["devices"] | "/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | "3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | null | "6:devices:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" - 5 | ["memory"] | "/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | "3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | null | "5:memory:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" - 4 | ["blkio"] | "/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | "3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | null | "4:blkio:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" - 3 | ["cpuacct"] | "/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | "3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | null | "3:cpuacct:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" - 2 | ["cpu"] | "/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | "3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | null | "2:cpu:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" - 1 | ["cpuset"] | "/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | "3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | null | "1:cpuset:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" - - // Kubernates examples - 11 | ["perf_event"] | "/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" | "3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" | "3d274242-8ee0-11e9-a8a6-1e68d864ef1a" | "11:perf_event:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" - 10 | ["pids"] | "/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" | "3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" | "3d274242-8ee0-11e9-a8a6-1e68d864ef1a" | "10:pids:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" - 9 | ["memory"] | "/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" | "3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" | "3d274242-8ee0-11e9-a8a6-1e68d864ef1a" | "9:memory:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" - 8 | ["cpu", "cpuacct"] | "/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" | "3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" | "3d274242-8ee0-11e9-a8a6-1e68d864ef1a" | "8:cpu,cpuacct:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" - 7 | ["blkio"] | "/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" | "3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" | "3d274242-8ee0-11e9-a8a6-1e68d864ef1a" | "7:blkio:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" - 6 | ["cpuset"] | "/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" | "3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" | "3d274242-8ee0-11e9-a8a6-1e68d864ef1a" | "6:cpuset:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" - 5 | ["devices"] | "/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" | "3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" | "3d274242-8ee0-11e9-a8a6-1e68d864ef1a" | "5:devices:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" - 4 | ["freezer"] | "/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" | "3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" | "3d274242-8ee0-11e9-a8a6-1e68d864ef1a" | "4:freezer:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" - 3 | ["net_cls", "net_prio"] | "/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" | "3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" | "3d274242-8ee0-11e9-a8a6-1e68d864ef1a" | "3:net_cls,net_prio:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" - 2 | ["hugetlb"] | "/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" | "3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" | "3d274242-8ee0-11e9-a8a6-1e68d864ef1a" | "2:hugetlb:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" - 1 | ["name=systemd"] | "/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" | "3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" | "3d274242-8ee0-11e9-a8a6-1e68d864ef1a" | "1:name=systemd:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" - - //ECS examples - 9 | ["perf_event"] | "/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" | "38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" | null | "9:perf_event:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" - 8 | ["memory"] | "/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" | "38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" | null | "8:memory:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" - 7 | ["hugetlb"] | "/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" | "38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" | null | "7:hugetlb:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" - 6 | ["freezer"] | "/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" | "38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" | null | "6:freezer:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" - 5 | ["devices"] | "/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" | "38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" | null | "5:devices:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" - 4 | ["cpuset"] | "/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" | "38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" | null | "4:cpuset:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" - 3 | ["cpuacct"] | "/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" | "38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" | null | "3:cpuacct:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" - 2 | ["cpu"] | "/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" | "38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" | null | "2:cpu:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" - 1 | ["blkio"] | "/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" | "38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" | null | "1:blkio:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" - - //Fargate Examples - 11 | ["hugetlb"] | "/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" | "432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" | null | "11:hugetlb:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" - 10 | ["pids"] | "/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" | "432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" | null | "10:pids:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" - 9 | ["cpuset"] | "/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" | "432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" | null | "9:cpuset:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" - 8 | ["net_cls", "net_prio"] | "/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" | "432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" | null | "8:net_cls,net_prio:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" - 7 | ["cpu", "cpuacct"] | "/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" | "432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" | null | "7:cpu,cpuacct:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" - 6 | ["perf_event"] | "/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" | "432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" | null | "6:perf_event:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" - 5 | ["freezer"] | "/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" | "432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" | null | "5:freezer:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" - 4 | ["devices"] | "/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" | "432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" | null | "4:devices:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" - 3 | ["blkio"] | "/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" | "432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" | null | "3:blkio:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" - 2 | ["memory"] | "/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" | "432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" | null | "2:memory:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" - 1 | ["name=systemd"] | "/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" | "432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" | null | "1:name=systemd:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" - 1 | ["name=systemd"] | "/ecs/34dc0b5e626f2c5c4c5170e34b10e765-1234567890" | "34dc0b5e626f2c5c4c5170e34b10e765-1234567890" | null | "1:name=systemd:/ecs/34dc0b5e626f2c5c4c5170e34b10e765-1234567890" - - // PCF example - 1 | ["freezer"] | "/garden/6f265890-5165-7fab-6b52-18d1" | "6f265890-5165-7fab-6b52-18d1" | null | "1:freezer:/garden/6f265890-5165-7fab-6b52-18d1" - - //Reference impl examples - 1 | ["name=systemd"] | "/system.slice/docker-cde7c2bab394630a42d73dc610b9c57415dced996106665d427f6d0566594411.scope" | "cde7c2bab394630a42d73dc610b9c57415dced996106665d427f6d0566594411" | null | "1:name=systemd:/system.slice/docker-cde7c2bab394630a42d73dc610b9c57415dced996106665d427f6d0566594411.scope" - 1 | ["name=systemd"] | "/docker/051e2ee0bce99116029a13df4a9e943137f19f957f38ac02d6bad96f9b700f76/not_hex" | null | null | "1:name=systemd:/docker/051e2ee0bce99116029a13df4a9e943137f19f957f38ac02d6bad96f9b700f76/not_hex" - 1 | ["name=systemd"] | "/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod90d81341_92de_11e7_8cf2_507b9d4141fa.slice/crio-2227daf62df6694645fee5df53c1f91271546a9560e8600a525690ae252b7f63.scope" | "2227daf62df6694645fee5df53c1f91271546a9560e8600a525690ae252b7f63" | "90d81341_92de_11e7_8cf2_507b9d4141fa" | "1:name=systemd:/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod90d81341_92de_11e7_8cf2_507b9d4141fa.slice/crio-2227daf62df6694645fee5df53c1f91271546a9560e8600a525690ae252b7f63.scope" - // spotless:on - } - - def "Container info parsed from file content"() { - when: - ContainerInfo containerInfo = ContainerInfo.parse(content) - - then: - containerInfo.getContainerId() == containerId - containerInfo.getPodId() == podId - containerInfo.getCGroups().size() == size - - where: - // spotless:off - containerId | podId | size | content - // Docker - "3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860" | null | 13 | """13:name=systemd:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 -12:pids:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 -11:hugetlb:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 -10:net_prio:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 -9:perf_event:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 -8:net_cls:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 -7:freezer:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 -6:devices:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 -5:memory:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 -4:blkio:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 -3:cpuacct:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 -2:cpu:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 -1:cpuset:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860""" - - // Kubernetes - "3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1" | "3d274242-8ee0-11e9-a8a6-1e68d864ef1a" | 11 | """11:perf_event:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 -10:pids:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 -9:memory:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 -8:cpu,cpuacct:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 -7:blkio:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 -6:cpuset:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 -5:devices:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 -4:freezer:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 -3:net_cls,net_prio:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 -2:hugetlb:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 -1:name=systemd:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1""" - "7b8952daecf4c0e44bbcefe1b5c5ebc7b4839d4eefeccefe694709d3809b6199" | "2d3da189_6407_48e3_9ab6_78188d75e609" | 1 | "1:name=systemd:/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod2d3da189_6407_48e3_9ab6_78188d75e609.slice/docker-7b8952daecf4c0e44bbcefe1b5c5ebc7b4839d4eefeccefe694709d3809b6199.scope" - - // ECS - "38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce" | null | 9 | """9:perf_event:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce -8:memory:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce -7:hugetlb:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce -6:freezer:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce -5:devices:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce -4:cpuset:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce -3:cpuacct:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce -2:cpu:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce -1:blkio:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce""" - - // Fargate 1.3- - "432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da" | null | 11 | """11:hugetlb:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da -10:pids:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da -9:cpuset:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da -8:net_cls,net_prio:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da -7:cpu,cpuacct:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da -6:perf_event:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da -5:freezer:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da -4:devices:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da -3:blkio:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da -2:memory:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da -1:name=systemd:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da""" - - // Fargate 1.4+ - "34dc0b5e626f2c5c4c5170e34b10e765-1234567890" | null | 11 | """11:hugetlb:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da -10:pids:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da -9:cpuset:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da -8:net_cls,net_prio:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da -7:cpu,cpuacct:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da -6:perf_event:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da -5:freezer:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da -4:devices:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da -3:blkio:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da -2:memory:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da -1:name=systemd:/ecs/34dc0b5e626f2c5c4c5170e34b10e765-1234567890""" - - // EKS Fargate cgroup with trailing cgroup v2 membership entry (0::...) - "cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc" | "defa568d-ff14-43d9-9a63-9e39ee9b39b4" | 13 | """12:misc:/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393/kubepods/burstable/poddefa568d-ff14-43d9-9a63-9e39ee9b39b4/cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc -11:cpuset:/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393/kubepods/burstable/poddefa568d-ff14-43d9-9a63-9e39ee9b39b4/cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc -10:perf_event:/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393/kubepods/burstable/poddefa568d-ff14-43d9-9a63-9e39ee9b39b4/cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc -9:blkio:/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393/kubepods/burstable/poddefa568d-ff14-43d9-9a63-9e39ee9b39b4/cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc -8:net_cls,net_prio:/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393/kubepods/burstable/poddefa568d-ff14-43d9-9a63-9e39ee9b39b4/cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc -7:memory:/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393/kubepods/burstable/poddefa568d-ff14-43d9-9a63-9e39ee9b39b4/cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc -6:cpu,cpuacct:/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393/kubepods/burstable/poddefa568d-ff14-43d9-9a63-9e39ee9b39b4/cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc -5:pids:/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393/kubepods/burstable/poddefa568d-ff14-43d9-9a63-9e39ee9b39b4/cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc -4:devices:/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393/kubepods/burstable/poddefa568d-ff14-43d9-9a63-9e39ee9b39b4/cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc -3:hugetlb:/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393/kubepods/burstable/poddefa568d-ff14-43d9-9a63-9e39ee9b39b4/cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc -2:freezer:/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393/kubepods/burstable/poddefa568d-ff14-43d9-9a63-9e39ee9b39b4/cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc -1:name=systemd:/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393/kubepods/burstable/poddefa568d-ff14-43d9-9a63-9e39ee9b39b4/cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc -0::/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393""" - - // PCF file - "6f265890-5165-7fab-6b52-18d1" | null | 12 | """12:rdma:/ -11:net_cls,net_prio:/garden/6f265890-5165-7fab-6b52-18d1 -10:freezer:/garden/6f265890-5165-7fab-6b52-18d1 -9:devices:/system.slice/garden.service/garden/6f265890-5165-7fab-6b52-18d1 -8:blkio:/system.slice/garden.service/garden/6f265890-5165-7fab-6b52-18d1 -7:pids:/system.slice/garden.service/garden/6f265890-5165-7fab-6b52-18d1 -6:memory:/system.slice/garden.service/garden/6f265890-5165-7fab-6b52-18d1 -5:cpuset:/garden/6f265890-5165-7fab-6b52-18d1 -4:cpu,cpuacct:/system.slice/garden.service/garden/6f265890-5165-7fab-6b52-18d1 -3:perf_event:/garden/6f265890-5165-7fab-6b52-18d1 -2:hugetlb:/garden/6f265890-5165-7fab-6b52-18d1 -1:name=systemd:/system.slice/garden.service/garden/6f265890-5165-7fab-6b52-18d1""" - - // spotless:on - } - - def "ContainerInfo from empty file is empty"() { - when: - File f = File.createTempFile("container-info-test-", "-empty-file") - f.deleteOnExit() - Path p = Paths.get(f.path) - ContainerInfo containerInfo = ContainerInfo.fromProcFile(p) - - - then: - containerInfo.getContainerId() == null - containerInfo.getPodId() == null - containerInfo.getCGroups().size() == 0 - } - - def "ContainerInfo throws java.text.ParseException when given malformed procfile"() { - when: - File f = File.createTempFile("container-info-test-", "-malformed-file") - f.deleteOnExit() - f.write("This is not valid") - Path p = Paths.get(f.path) - ContainerInfo.fromProcFile(p) - - then: - thrown(ParseException) - } - - def "ContainerInfo tolerates missing container id and pod id in procfile"() { - when: - File f = File.createTempFile("container-info-test-", "-missing-container-id") - f.deleteOnExit() - f.write("1:cpuset:fake-path") - Path p = Paths.get(f.path) - ContainerInfo containerInfo = ContainerInfo.fromProcFile(p) - f.deleteOnExit() - - then: - containerInfo.getContainerId() == null - containerInfo.getPodId() == null - containerInfo.getCGroups().size() == 1 - } - - def "getIno(path) should return the same value as `ls -id path`"() { - when: - File f = File.createTempFile("container-info-test-", "-inode-file") - f.deleteOnExit() - Path path = f.toPath() - - then: - ContainerInfo.readInode(path) == readInode(path) - } - - private long readInode(Path path) { - ProcessBuilder pb = new ProcessBuilder("ls", "-id", path.toString()) - Process ps = pb.start() - BufferedReader reader = new BufferedReader(new InputStreamReader(ps.getInputStream())) - String line = reader.readLine() - reader.close() - ps.waitFor() - Long.parseLong(line.substring(0, line.indexOf(' '))) - } - - def "readEntityID return cid- if containerId is defined"() { - when: - ContainerInfo containerInfo = new ContainerInfo() - containerInfo.setContainerId(cid) - - then: - containerInfo.readEntityID(containerInfo, true, Paths.get("/sys/fs/cgroup")) == "cid-" + cid - - where: - cid | isHostCgroupNamespace - "cid" | true - "containerId" | false - } - - def "readEntityID return null if containerId is not defined and isHostCgroupNamespace"() { - when: - ContainerInfo containerInfo = new ContainerInfo() - containerInfo.setContainerId(cid) - - then: - containerInfo.readEntityID(containerInfo, true, Paths.get("/sys/fs/cgroup")) == null - - where: - cid << [null, ""] - } - - def "readEntityID return id- for '' controller"() { - setup: - File mountPath = File.createTempDir("container-info-test-", "-sys-fs-cgroup") - mountPath.deleteOnExit() - File file = File.createTempFile("container-info-test-", "-inode-file", mountPath) - file.deleteOnExit() - Path path = file.toPath() - Long ino = readInode(path) - - when: - ContainerInfo containerInfo = new ContainerInfo() - ContainerInfo.CGroupInfo cGroupInfo = new ContainerInfo.CGroupInfo() - cGroupInfo.setControllers(controllers) - cGroupInfo.setPath(file.getName()) - List cGroups = Arrays.asList(cGroupInfo) - containerInfo.setcGroups(cGroups) - - then: - containerInfo.readEntityID(containerInfo, false, mountPath.toPath()) == (hasEntityId ? "in-" + ino : null) - - where: - controllers | hasEntityId - Arrays.asList("", "memory") | true - Arrays.asList("memory", "") | true - Arrays.asList("") | true - Arrays.asList("memory") | false - } - - def "readEntityID return id- for 'memory' controller"() { - setup: - File mountPath = File.createTempDir("container-info-test-", "-sys-fs-cgroup") - mountPath.deleteOnExit() - File memoryController = Files.createDirectory(mountPath.toPath().resolve("memory")).toFile() - memoryController.deleteOnExit() - File file = File.createTempFile("container-info-test-", "-inode-file", memoryController) - file.deleteOnExit() - Path path = file.toPath() - Long ino = readInode(path) - - when: - ContainerInfo containerInfo = new ContainerInfo() - ContainerInfo.CGroupInfo cGroupInfo = new ContainerInfo.CGroupInfo() - cGroupInfo.setControllers(controllers) - cGroupInfo.setPath(file.getName()) - List cGroups = Arrays.asList(cGroupInfo) - containerInfo.setcGroups(cGroups) - - then: - containerInfo.readEntityID(containerInfo, false, mountPath.toPath()) == (hasEntityId ? "in-" + ino : null) - - where: - controllers | hasEntityId - Arrays.asList("", "memory") | true - Arrays.asList("memory", "") | true - Arrays.asList("memory") | true - Arrays.asList("") | false - } - - def "readEntityID return id- for a parent when path is /"() { - setup: - File mountPath = File.createTempDir("container-info-test-", "-sys-fs-cgroup") - mountPath.deleteOnExit() - File memoryController = Files.createDirectory(mountPath.toPath().resolve("memory")).toFile() - memoryController.deleteOnExit() - Long ino = readInode(memoryController.toPath()) - - when: - ContainerInfo containerInfo = new ContainerInfo() - ContainerInfo.CGroupInfo cGroupInfo = new ContainerInfo.CGroupInfo() - cGroupInfo.setControllers(Arrays.asList("memory")) - cGroupInfo.setPath("/") - List cGroups = Arrays.asList(cGroupInfo) - containerInfo.setcGroups(cGroups) - - then: - containerInfo.readEntityID(containerInfo, false, mountPath.toPath()) == "in-" + ino - } -} diff --git a/utils/container-utils/src/test/groovy/datadog/common/container/ServerlessInfoTest.groovy b/utils/container-utils/src/test/groovy/datadog/common/container/ServerlessInfoTest.groovy deleted file mode 100644 index 329fc8b2fc4..00000000000 --- a/utils/container-utils/src/test/groovy/datadog/common/container/ServerlessInfoTest.groovy +++ /dev/null @@ -1,47 +0,0 @@ -package datadog.common.container - -import datadog.trace.test.util.DDSpecification - -class ServerlessInfoTest extends DDSpecification { - - def "test serverless detection"() { - given: - environmentVariables.set(ServerlessInfo.AWS_FUNCTION_VARIABLE, functionName) - - when: - def info = new ServerlessInfo() - - then: - info.runningInServerlessEnvironment == serverlessEnv - info.functionName == functionName - - where: - functionName | serverlessEnv - null | false - "" | false - "someName" | true - } - - def "test serverless hasExtension false"() { - when: - def info = new ServerlessInfo() - then: - info.hasExtension() == false - } - - def "test serverless hasExtension false since the extension path is null"() { - when: - def info = new ServerlessInfo(null) - then: - info.hasExtension() == false - } - - def "test serverless hasExtension true"() { - when: - File f = File.createTempFile("fake-", "extension") - f.deleteOnExit() - def info = new ServerlessInfo(f.getAbsolutePath()) - then: - info.hasExtension() == true - } -} diff --git a/utils/container-utils/src/test/java/datadog/common/container/ContainerInfoTest.java b/utils/container-utils/src/test/java/datadog/common/container/ContainerInfoTest.java new file mode 100644 index 00000000000..05819e6ef79 --- /dev/null +++ b/utils/container-utils/src/test/java/datadog/common/container/ContainerInfoTest.java @@ -0,0 +1,372 @@ +package datadog.common.container; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.params.provider.Arguments.arguments; + +import datadog.trace.test.util.DDJavaSpecification; +import de.thetaphi.forbiddenapis.SuppressForbidden; +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.text.ParseException; +import java.util.Arrays; +import java.util.List; +import java.util.stream.Stream; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.Arguments; +import org.junit.jupiter.params.provider.MethodSource; +import org.tabletest.junit.TableTest; + +@SuppressForbidden +public class ContainerInfoTest extends DDJavaSpecification { + + // spotless:off + @TableTest({ + "id | controllers | path | containerId | podId | line", + // Docker examples + "13 | [name=systemd] | /docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | 3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | | 13:name=systemd:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860", + "12 | [pids] | /docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | 3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | | 12:pids:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860", + "11 | [hugetlb] | /docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | 3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | | 11:hugetlb:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860", + "10 | [net_prio] | /docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | 3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | | 10:net_prio:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860", + " 9 | [perf_event] | /docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | 3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | | 9:perf_event:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860", + " 8 | [net_cls] | /docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | 3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | | 8:net_cls:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860", + " 7 | [freezer] | /docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | 3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | | 7:freezer:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860", + " 6 | [devices] | /docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | 3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | | 6:devices:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860", + " 5 | [memory] | /docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | 3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | | 5:memory:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860", + " 4 | [blkio] | /docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | 3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | | 4:blkio:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860", + " 3 | [cpuacct] | /docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | 3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | | 3:cpuacct:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860", + " 2 | [cpu] | /docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | 3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | | 2:cpu:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860", + " 1 | [cpuset] | /docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | 3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860 | | 1:cpuset:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860", + // Kubernetes examples + "11 | [perf_event] | /kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 | 3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 | 3d274242-8ee0-11e9-a8a6-1e68d864ef1a | 11:perf_event:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1", + "10 | [pids] | /kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 | 3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 | 3d274242-8ee0-11e9-a8a6-1e68d864ef1a | 10:pids:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1", + " 9 | [memory] | /kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 | 3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 | 3d274242-8ee0-11e9-a8a6-1e68d864ef1a | 9:memory:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1", + " 8 | [cpu, cpuacct] | /kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 | 3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 | 3d274242-8ee0-11e9-a8a6-1e68d864ef1a | 8:cpu,cpuacct:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1", + " 7 | [blkio] | /kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 | 3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 | 3d274242-8ee0-11e9-a8a6-1e68d864ef1a | 7:blkio:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1", + " 6 | [cpuset] | /kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 | 3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 | 3d274242-8ee0-11e9-a8a6-1e68d864ef1a | 6:cpuset:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1", + " 5 | [devices] | /kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 | 3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 | 3d274242-8ee0-11e9-a8a6-1e68d864ef1a | 5:devices:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1", + " 4 | [freezer] | /kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 | 3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 | 3d274242-8ee0-11e9-a8a6-1e68d864ef1a | 4:freezer:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1", + " 3 | [net_cls, net_prio] | /kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 | 3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 | 3d274242-8ee0-11e9-a8a6-1e68d864ef1a | 3:net_cls,net_prio:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1", + " 2 | [hugetlb] | /kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 | 3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 | 3d274242-8ee0-11e9-a8a6-1e68d864ef1a | 2:hugetlb:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1", + " 1 | [name=systemd] | /kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 | 3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1 | 3d274242-8ee0-11e9-a8a6-1e68d864ef1a | 1:name=systemd:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1", + // ECS examples + " 9 | [perf_event] | /ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce | 38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce | | 9:perf_event:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce", + " 8 | [memory] | /ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce | 38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce | | 8:memory:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce", + " 7 | [hugetlb] | /ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce | 38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce | | 7:hugetlb:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce", + " 6 | [freezer] | /ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce | 38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce | | 6:freezer:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce", + " 5 | [devices] | /ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce | 38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce | | 5:devices:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce", + " 4 | [cpuset] | /ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce | 38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce | | 4:cpuset:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce", + " 3 | [cpuacct] | /ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce | 38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce | | 3:cpuacct:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce", + " 2 | [cpu] | /ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce | 38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce | | 2:cpu:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce", + " 1 | [blkio] | /ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce | 38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce | | 1:blkio:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce", + // Fargate examples + "11 | [hugetlb] | /ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da | 432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da | | 11:hugetlb:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da", + "10 | [pids] | /ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da | 432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da | | 10:pids:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da", + " 9 | [cpuset] | /ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da | 432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da | | 9:cpuset:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da", + " 8 | [net_cls, net_prio] | /ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da | 432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da | | 8:net_cls,net_prio:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da", + " 7 | [cpu, cpuacct] | /ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da | 432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da | | 7:cpu,cpuacct:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da", + " 6 | [perf_event] | /ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da | 432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da | | 6:perf_event:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da", + " 5 | [freezer] | /ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da | 432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da | | 5:freezer:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da", + " 4 | [devices] | /ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da | 432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da | | 4:devices:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da", + " 3 | [blkio] | /ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da | 432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da | | 3:blkio:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da", + " 2 | [memory] | /ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da | 432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da | | 2:memory:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da", + " 1 | [name=systemd] | /ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da | 432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da | | 1:name=systemd:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da", + " 1 | [name=systemd] | /ecs/34dc0b5e626f2c5c4c5170e34b10e765-1234567890 | 34dc0b5e626f2c5c4c5170e34b10e765-1234567890 | | 1:name=systemd:/ecs/34dc0b5e626f2c5c4c5170e34b10e765-1234567890", + // PCF example + " 1 | [freezer] | /garden/6f265890-5165-7fab-6b52-18d1 | 6f265890-5165-7fab-6b52-18d1 | | 1:freezer:/garden/6f265890-5165-7fab-6b52-18d1", + // Reference impl examples + " 1 | [name=systemd] | /system.slice/docker-cde7c2bab394630a42d73dc610b9c57415dced996106665d427f6d0566594411.scope | cde7c2bab394630a42d73dc610b9c57415dced996106665d427f6d0566594411 | | 1:name=systemd:/system.slice/docker-cde7c2bab394630a42d73dc610b9c57415dced996106665d427f6d0566594411.scope", + " 1 | [name=systemd] | /docker/051e2ee0bce99116029a13df4a9e943137f19f957f38ac02d6bad96f9b700f76/not_hex | | | 1:name=systemd:/docker/051e2ee0bce99116029a13df4a9e943137f19f957f38ac02d6bad96f9b700f76/not_hex", + " 1 | [name=systemd] | /kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod90d81341_92de_11e7_8cf2_507b9d4141fa.slice/crio-2227daf62df6694645fee5df53c1f91271546a9560e8600a525690ae252b7f63.scope | 2227daf62df6694645fee5df53c1f91271546a9560e8600a525690ae252b7f63 | 90d81341_92de_11e7_8cf2_507b9d4141fa | 1:name=systemd:/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod90d81341_92de_11e7_8cf2_507b9d4141fa.slice/crio-2227daf62df6694645fee5df53c1f91271546a9560e8600a525690ae252b7f63.scope" + }) + void cGroupInfoIsParsedFromIndividualLines( + int id, List controllers, String path, String containerId, String podId, String line) + throws ParseException { + ContainerInfo.CGroupInfo cGroupInfo = ContainerInfo.parseLine(line); + + assertEquals(id, cGroupInfo.getId()); + assertEquals(path, cGroupInfo.getPath()); + assertEquals(controllers, cGroupInfo.getControllers()); + assertEquals(containerId, cGroupInfo.getContainerId()); + assertEquals(podId, cGroupInfo.getPodId()); + } + // spotless:on + + @ParameterizedTest + @MethodSource("containerInfoParsedFromFileContentArguments") + void containerInfoParsedFromFileContent( + String containerId, String podId, int size, String content) throws Exception { + ContainerInfo containerInfo = ContainerInfo.parse(content); + + assertEquals(containerId, containerInfo.getContainerId()); + assertEquals(podId, containerInfo.getPodId()); + assertEquals(size, containerInfo.getCGroups().size()); + } + + static Stream containerInfoParsedFromFileContentArguments() { + // spotless:off + return Stream.of( + // Docker + arguments("3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860", null, 13, + "13:name=systemd:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860\n" + + "12:pids:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860\n" + + "11:hugetlb:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860\n" + + "10:net_prio:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860\n" + + "9:perf_event:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860\n" + + "8:net_cls:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860\n" + + "7:freezer:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860\n" + + "6:devices:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860\n" + + "5:memory:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860\n" + + "4:blkio:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860\n" + + "3:cpuacct:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860\n" + + "2:cpu:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860\n" + + "1:cpuset:/docker/3726184226f5d3147c25fdeab5b60097e378e8a720503a5e19ecfdf29f869860"), + // Kubernetes + arguments("3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1", "3d274242-8ee0-11e9-a8a6-1e68d864ef1a", 11, + "11:perf_event:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1\n" + + "10:pids:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1\n" + + "9:memory:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1\n" + + "8:cpu,cpuacct:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1\n" + + "7:blkio:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1\n" + + "6:cpuset:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1\n" + + "5:devices:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1\n" + + "4:freezer:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1\n" + + "3:net_cls,net_prio:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1\n" + + "2:hugetlb:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1\n" + + "1:name=systemd:/kubepods/besteffort/pod3d274242-8ee0-11e9-a8a6-1e68d864ef1a/3e74d3fd9db4c9dd921ae05c2502fb984d0cde1b36e581b13f79c639da4518a1"), + arguments("7b8952daecf4c0e44bbcefe1b5c5ebc7b4839d4eefeccefe694709d3809b6199", "2d3da189_6407_48e3_9ab6_78188d75e609", 1, + "1:name=systemd:/kubepods.slice/kubepods-burstable.slice/kubepods-burstable-pod2d3da189_6407_48e3_9ab6_78188d75e609.slice/docker-7b8952daecf4c0e44bbcefe1b5c5ebc7b4839d4eefeccefe694709d3809b6199.scope"), + // ECS + arguments("38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce", null, 9, + "9:perf_event:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce\n" + + "8:memory:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce\n" + + "7:hugetlb:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce\n" + + "6:freezer:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce\n" + + "5:devices:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce\n" + + "4:cpuset:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce\n" + + "3:cpuacct:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce\n" + + "2:cpu:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce\n" + + "1:blkio:/ecs/haissam-ecs-classic/5a0d5ceddf6c44c1928d367a815d890f/38fac3e99302b3622be089dd41e7ccf38aff368a86cc339972075136ee2710ce"), + // Fargate 1.3- + arguments("432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da", null, 11, + "11:hugetlb:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da\n" + + "10:pids:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da\n" + + "9:cpuset:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da\n" + + "8:net_cls,net_prio:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da\n" + + "7:cpu,cpuacct:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da\n" + + "6:perf_event:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da\n" + + "5:freezer:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da\n" + + "4:devices:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da\n" + + "3:blkio:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da\n" + + "2:memory:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da\n" + + "1:name=systemd:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da"), + // Fargate 1.4+ + arguments("34dc0b5e626f2c5c4c5170e34b10e765-1234567890", null, 11, + "11:hugetlb:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da\n" + + "10:pids:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da\n" + + "9:cpuset:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da\n" + + "8:net_cls,net_prio:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da\n" + + "7:cpu,cpuacct:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da\n" + + "6:perf_event:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da\n" + + "5:freezer:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da\n" + + "4:devices:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da\n" + + "3:blkio:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da\n" + + "2:memory:/ecs/55091c13-b8cf-4801-b527-f4601742204d/432624d2150b349fe35ba397284dea788c2bf66b885d14dfc1569b01890ca7da\n" + + "1:name=systemd:/ecs/34dc0b5e626f2c5c4c5170e34b10e765-1234567890"), + // EKS Fargate with trailing cgroup v2 membership entry + arguments("cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc", "defa568d-ff14-43d9-9a63-9e39ee9b39b4", 13, + "12:misc:/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393/kubepods/burstable/poddefa568d-ff14-43d9-9a63-9e39ee9b39b4/cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc\n" + + "11:cpuset:/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393/kubepods/burstable/poddefa568d-ff14-43d9-9a63-9e39ee9b39b4/cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc\n" + + "10:perf_event:/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393/kubepods/burstable/poddefa568d-ff14-43d9-9a63-9e39ee9b39b4/cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc\n" + + "9:blkio:/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393/kubepods/burstable/poddefa568d-ff14-43d9-9a63-9e39ee9b39b4/cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc\n" + + "8:net_cls,net_prio:/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393/kubepods/burstable/poddefa568d-ff14-43d9-9a63-9e39ee9b39b4/cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc\n" + + "7:memory:/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393/kubepods/burstable/poddefa568d-ff14-43d9-9a63-9e39ee9b39b4/cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc\n" + + "6:cpu,cpuacct:/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393/kubepods/burstable/poddefa568d-ff14-43d9-9a63-9e39ee9b39b4/cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc\n" + + "5:pids:/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393/kubepods/burstable/poddefa568d-ff14-43d9-9a63-9e39ee9b39b4/cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc\n" + + "4:devices:/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393/kubepods/burstable/poddefa568d-ff14-43d9-9a63-9e39ee9b39b4/cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc\n" + + "3:hugetlb:/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393/kubepods/burstable/poddefa568d-ff14-43d9-9a63-9e39ee9b39b4/cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc\n" + + "2:freezer:/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393/kubepods/burstable/poddefa568d-ff14-43d9-9a63-9e39ee9b39b4/cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc\n" + + "1:name=systemd:/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393/kubepods/burstable/poddefa568d-ff14-43d9-9a63-9e39ee9b39b4/cf1241bbf80ea91eebdd28bf719057380997ca4b0cea16869393b905fb6d52bc\n" + + "0::/ecs/545b896a072744d186c7fb09a45ec172/545b896a072744d186c7fb09a45ec172-3057940393"), + // PCF + arguments("6f265890-5165-7fab-6b52-18d1", null, 12, + "12:rdma:/\n" + + "11:net_cls,net_prio:/garden/6f265890-5165-7fab-6b52-18d1\n" + + "10:freezer:/garden/6f265890-5165-7fab-6b52-18d1\n" + + "9:devices:/system.slice/garden.service/garden/6f265890-5165-7fab-6b52-18d1\n" + + "8:blkio:/system.slice/garden.service/garden/6f265890-5165-7fab-6b52-18d1\n" + + "7:pids:/system.slice/garden.service/garden/6f265890-5165-7fab-6b52-18d1\n" + + "6:memory:/system.slice/garden.service/garden/6f265890-5165-7fab-6b52-18d1\n" + + "5:cpuset:/garden/6f265890-5165-7fab-6b52-18d1\n" + + "4:cpu,cpuacct:/system.slice/garden.service/garden/6f265890-5165-7fab-6b52-18d1\n" + + "3:perf_event:/garden/6f265890-5165-7fab-6b52-18d1\n" + + "2:hugetlb:/garden/6f265890-5165-7fab-6b52-18d1\n" + + "1:name=systemd:/system.slice/garden.service/garden/6f265890-5165-7fab-6b52-18d1") + ); + // spotless:on + } + + @Test + void containerInfoFromEmptyFileIsEmpty() throws Exception { + File f = File.createTempFile("container-info-test-", "-empty-file"); + f.deleteOnExit(); + Path p = Paths.get(f.getPath()); + + ContainerInfo containerInfo = ContainerInfo.fromProcFile(p); + + assertNull(containerInfo.getContainerId()); + assertNull(containerInfo.getPodId()); + assertEquals(0, containerInfo.getCGroups().size()); + } + + @Test + void containerInfoThrowsParseExceptionWhenGivenMalformedProcfile() throws Exception { + File f = File.createTempFile("container-info-test-", "-malformed-file"); + f.deleteOnExit(); + Files.write(f.toPath(), "This is not valid".getBytes()); + Path p = Paths.get(f.getPath()); + + assertThrows(ParseException.class, () -> ContainerInfo.fromProcFile(p)); + } + + @Test + void containerInfoToleratesMissingContainerIdAndPodIdInProcfile() throws Exception { + File f = File.createTempFile("container-info-test-", "-missing-container-id"); + f.deleteOnExit(); + Files.write(f.toPath(), "1:cpuset:fake-path".getBytes()); + Path p = Paths.get(f.getPath()); + + ContainerInfo containerInfo = ContainerInfo.fromProcFile(p); + + assertNull(containerInfo.getContainerId()); + assertNull(containerInfo.getPodId()); + assertEquals(1, containerInfo.getCGroups().size()); + } + + @Test + void getInoPathShouldReturnSameValueAsLsIdPath() throws Exception { + File f = File.createTempFile("container-info-test-", "-inode-file"); + f.deleteOnExit(); + Path path = f.toPath(); + + assertEquals(readInode(path), ContainerInfo.readInode(path)); + } + + // spotless:off + @TableTest({ + "cid | isHostCgroupNamespace", + "cid | true ", + "containerId | false " + }) + void readEntityIDReturnCidContainerIdIfContainerIdIsDefined( + String cid, boolean isHostCgroupNamespace) { + ContainerInfo containerInfo = new ContainerInfo(); + containerInfo.setContainerId(cid); + + assertEquals("cid-" + cid, + ContainerInfo.readEntityID(containerInfo, true, Paths.get("/sys/fs/cgroup"))); + } + // spotless:on + + @TableTest({"cid", " ", "'' "}) + void readEntityIDReturnNullIfContainerIdIsNotDefinedAndIsHostCgroupNamespace(String cid) { + ContainerInfo containerInfo = new ContainerInfo(); + containerInfo.setContainerId(cid); + + assertNull(ContainerInfo.readEntityID(containerInfo, true, Paths.get("/sys/fs/cgroup"))); + } + + // spotless:off + @TableTest({ + "controllers | hasEntityId", + "['', memory] | true ", + "[memory, ''] | true ", + "[''] | true ", + "[memory] | false " + }) + void readEntityIDReturnIdInoForEmptyController( + List controllers, boolean hasEntityId) throws Exception { + File mountPath = createTempDir(); + File file = File.createTempFile("container-info-test-", "-inode-file", mountPath); + file.deleteOnExit(); + long ino = readInode(file.toPath()); + + ContainerInfo containerInfo = new ContainerInfo(); + ContainerInfo.CGroupInfo cGroupInfo = new ContainerInfo.CGroupInfo(); + cGroupInfo.setControllers(controllers); + cGroupInfo.setPath(file.getName()); + containerInfo.setcGroups(Arrays.asList(cGroupInfo)); + + String expected = hasEntityId ? "in-" + ino : null; + assertEquals(expected, ContainerInfo.readEntityID(containerInfo, false, mountPath.toPath())); + } + + @TableTest({ + "controllers | hasEntityId", + "['', memory] | true ", + "[memory, ''] | true ", + "[memory] | true ", + "[''] | false " + }) + void readEntityIDReturnIdInoForMemoryController( + List controllers, boolean hasEntityId) throws Exception { + File mountPath = createTempDir(); + File memoryController = + Files.createDirectory(mountPath.toPath().resolve("memory")).toFile(); + memoryController.deleteOnExit(); + File file = File.createTempFile("container-info-test-", "-inode-file", memoryController); + file.deleteOnExit(); + long ino = readInode(file.toPath()); + + ContainerInfo containerInfo = new ContainerInfo(); + ContainerInfo.CGroupInfo cGroupInfo = new ContainerInfo.CGroupInfo(); + cGroupInfo.setControllers(controllers); + cGroupInfo.setPath(file.getName()); + containerInfo.setcGroups(Arrays.asList(cGroupInfo)); + + String expected = hasEntityId ? "in-" + ino : null; + assertEquals(expected, ContainerInfo.readEntityID(containerInfo, false, mountPath.toPath())); + } + // spotless:on + + @Test + void readEntityIDReturnIdInoForParentWhenPathIsSlash() throws Exception { + File mountPath = createTempDir(); + File memoryController = Files.createDirectory(mountPath.toPath().resolve("memory")).toFile(); + memoryController.deleteOnExit(); + long ino = readInode(memoryController.toPath()); + + ContainerInfo containerInfo = new ContainerInfo(); + ContainerInfo.CGroupInfo cGroupInfo = new ContainerInfo.CGroupInfo(); + cGroupInfo.setControllers(Arrays.asList("memory")); + cGroupInfo.setPath("/"); + containerInfo.setcGroups(Arrays.asList(cGroupInfo)); + + assertEquals("in-" + ino, ContainerInfo.readEntityID(containerInfo, false, mountPath.toPath())); + } + + private static File createTempDir() throws IOException { + File dir = File.createTempFile("container-info-test-", "-sys-fs-cgroup"); + dir.delete(); + dir.mkdirs(); + dir.deleteOnExit(); + return dir; + } + + private static long readInode(Path path) throws IOException, InterruptedException { + ProcessBuilder pb = new ProcessBuilder("ls", "-id", path.toString()); + Process ps = pb.start(); + try (BufferedReader reader = new BufferedReader(new InputStreamReader(ps.getInputStream()))) { + String line = reader.readLine(); + ps.waitFor(); + return Long.parseLong(line.substring(0, line.indexOf(' '))); + } + } +} diff --git a/utils/container-utils/src/test/java/datadog/common/container/ServerlessInfoTest.java b/utils/container-utils/src/test/java/datadog/common/container/ServerlessInfoTest.java new file mode 100644 index 00000000000..059a69424f5 --- /dev/null +++ b/utils/container-utils/src/test/java/datadog/common/container/ServerlessInfoTest.java @@ -0,0 +1,73 @@ +package datadog.common.container; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import datadog.trace.test.util.ControllableEnvironmentVariables; +import datadog.trace.test.util.DDJavaSpecification; +import java.io.File; +import java.lang.reflect.Constructor; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; +import org.tabletest.junit.TableTest; + +public class ServerlessInfoTest extends DDJavaSpecification { + + // AWS_LAMBDA_FUNCTION_NAME is ServerlessInfo.AWS_FUNCTION_VARIABLE (private constant) + private static final String AWS_FUNCTION_VARIABLE = "AWS_LAMBDA_FUNCTION_NAME"; + + private static final ControllableEnvironmentVariables environmentVariables = + ControllableEnvironmentVariables.setup(); + + @AfterEach + void clearEnvVars() { + environmentVariables.clear(); + } + + @TableTest({ + "functionName | serverlessEnv", + " | false ", + "'' | false ", + "someName | true " + }) + void testServerlessDetection(String functionName, boolean serverlessEnv) { + environmentVariables.set(AWS_FUNCTION_VARIABLE, functionName); + + ServerlessInfo info = new ServerlessInfo(); + + assertEquals(serverlessEnv, info.isRunningInServerlessEnvironment()); + assertEquals(functionName, info.getFunctionName()); + } + + @Test + void testServerlessHasExtensionFalse() { + ServerlessInfo info = new ServerlessInfo(); + + assertFalse(info.hasExtension()); + } + + @Test + void testServerlessHasExtensionFalseSinceExtensionPathIsNull() throws Exception { + // ServerlessInfo(String extensionPath) is private — access via reflection + Constructor constructor = + ServerlessInfo.class.getDeclaredConstructor(String.class); + constructor.setAccessible(true); + ServerlessInfo info = constructor.newInstance((Object) null); + + assertFalse(info.hasExtension()); + } + + @Test + void testServerlessHasExtensionTrue() throws Exception { + File f = File.createTempFile("fake-", "extension"); + f.deleteOnExit(); + + Constructor constructor = + ServerlessInfo.class.getDeclaredConstructor(String.class); + constructor.setAccessible(true); + ServerlessInfo info = constructor.newInstance(f.getAbsolutePath()); + + assertTrue(info.hasExtension()); + } +} diff --git a/utils/filesystem-utils/gradle.lockfile b/utils/filesystem-utils/gradle.lockfile index 7f4b9c56c0d..9bc3b6f1bc0 100644 --- a/utils/filesystem-utils/gradle.lockfile +++ b/utils/filesystem-utils/gradle.lockfile @@ -1,10 +1,12 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :utils:filesystem-utils:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -17,8 +19,8 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -41,10 +43,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -58,10 +60,13 @@ org.mockito:mockito-core:4.4.0=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/utils/flare-utils/gradle.lockfile b/utils/flare-utils/gradle.lockfile index 0b3dfddaabd..ba323fa6416 100644 --- a/utils/flare-utils/gradle.lockfile +++ b/utils/flare-utils/gradle.lockfile @@ -1,13 +1,14 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :utils:flare-utils:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.datadoghq.okhttp3:okhttp:3.12.15=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.datadoghq.okio:okio:1.17.6=compileClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -44,10 +45,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -61,10 +62,13 @@ org.mockito:mockito-core:4.4.0=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/utils/junit-utils/build.gradle.kts b/utils/junit-utils/build.gradle.kts deleted file mode 100644 index f30b2ebca87..00000000000 --- a/utils/junit-utils/build.gradle.kts +++ /dev/null @@ -1,15 +0,0 @@ -plugins { - `java-library` -} - -apply(from = "$rootDir/gradle/java.gradle") - -dependencies { - api(libs.bytebuddy) - api(libs.bytebuddyagent) - api(libs.forbiddenapis) - api(project(":components:environment")) - - compileOnly(libs.junit.jupiter) - compileOnly(libs.tabletest) -} diff --git a/utils/junit-utils/gradle.lockfile b/utils/junit-utils/gradle.lockfile deleted file mode 100644 index d58f542419d..00000000000 --- a/utils/junit-utils/gradle.lockfile +++ /dev/null @@ -1,74 +0,0 @@ -# This is a Gradle generated file for dependency locking. -# Manual edits can break the build and are not advised. -# This file is expected to be part of source control. -ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath -ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath -com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs:4.9.8=spotbugs -com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs -com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath -com.google.code.gson:gson:2.13.2=spotbugs -com.google.errorprone:error_prone_annotations:2.41.0=spotbugs -com.thoughtworks.qdox:qdox:1.12.1=codenarc -commons-io:commons-io:2.20.0=spotbugs -de.thetaphi:forbiddenapis:3.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath -jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.sf.saxon:Saxon-HE:12.9=spotbugs -org.apache.ant:ant-antlr:1.10.14=codenarc -org.apache.ant:ant-junit:1.10.14=codenarc -org.apache.bcel:bcel:6.11.0=spotbugs -org.apache.commons:commons-lang3:3.19.0=spotbugs -org.apache.commons:commons-text:1.14.0=spotbugs -org.apache.logging.log4j:log4j-api:2.25.2=spotbugs -org.apache.logging.log4j:log4j-core:2.25.2=spotbugs -org.apiguardian:apiguardian-api:1.1.2=compileClasspath,testCompileClasspath -org.codehaus.groovy:groovy-ant:3.0.23=codenarc -org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc -org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc -org.codehaus.groovy:groovy-json:3.0.23=codenarc -org.codehaus.groovy:groovy-json:3.0.25=testCompileClasspath,testRuntimeClasspath -org.codehaus.groovy:groovy-templates:3.0.23=codenarc -org.codehaus.groovy:groovy-xml:3.0.23=codenarc -org.codehaus.groovy:groovy:3.0.23=codenarc -org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath -org.codenarc:CodeNarc:3.7.0=codenarc -org.dom4j:dom4j:2.2.0=spotbugs -org.gmetrics:GMetrics:2.1.0=codenarc -org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt -org.junit.jupiter:junit-jupiter-api:5.14.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath -org.junit.jupiter:junit-jupiter-params:5.14.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.jupiter:junit-jupiter:5.14.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-commons:1.14.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath -org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath -org.junit:junit-bom:5.14.0=spotbugs -org.junit:junit-bom:5.14.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.mockito:mockito-core:4.4.0=testRuntimeClasspath -org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath -org.opentest4j:opentest4j:1.3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs -org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath -org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j -org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j -org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath -org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-junit:1.2.1=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.tabletest:tabletest-parser:1.2.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.xmlresolver:xmlresolver:5.3.3=spotbugs -empty=annotationProcessor,spotbugsPlugins,testAnnotationProcessor diff --git a/utils/junit-utils/src/main/java/datadog/trace/junit/utils/config/WithConfigExtension.java b/utils/junit-utils/src/main/java/datadog/trace/junit/utils/config/WithConfigExtension.java deleted file mode 100644 index 82f1b2214b7..00000000000 --- a/utils/junit-utils/src/main/java/datadog/trace/junit/utils/config/WithConfigExtension.java +++ /dev/null @@ -1,401 +0,0 @@ -package datadog.trace.junit.utils.config; - -import static net.bytebuddy.agent.builder.AgentBuilder.RedefinitionStrategy.Listener.ErrorEscalating.FAIL_FAST; -import static net.bytebuddy.agent.builder.AgentBuilder.RedefinitionStrategy.RETRANSFORMATION; -import static net.bytebuddy.description.modifier.FieldManifestation.VOLATILE; -import static net.bytebuddy.description.modifier.Ownership.STATIC; -import static net.bytebuddy.description.modifier.Visibility.PUBLIC; -import static net.bytebuddy.matcher.ElementMatchers.named; -import static net.bytebuddy.matcher.ElementMatchers.namedOneOf; -import static net.bytebuddy.matcher.ElementMatchers.none; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertTrue; - -import datadog.environment.EnvironmentVariables; -import de.thetaphi.forbiddenapis.SuppressForbidden; -import edu.umd.cs.findbugs.annotations.NonNull; -import java.lang.instrument.Instrumentation; -import java.lang.reflect.Constructor; -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import net.bytebuddy.agent.ByteBuddyAgent; -import net.bytebuddy.agent.builder.AgentBuilder; -import net.bytebuddy.dynamic.ClassFileLocator; -import net.bytebuddy.dynamic.Transformer; -import net.bytebuddy.utility.JavaModule; -import org.junit.jupiter.api.extension.AfterAllCallback; -import org.junit.jupiter.api.extension.AfterEachCallback; -import org.junit.jupiter.api.extension.BeforeAllCallback; -import org.junit.jupiter.api.extension.BeforeEachCallback; -import org.junit.jupiter.api.extension.ExtensionContext; -import org.junit.platform.commons.support.AnnotationSupport; - -/** - * JUnit 5 extension that manages DD config injection for tests. Handles: - * - *
        - *
      • Making {@code Config} and {@code InstrumenterConfig} singletons modifiable via ByteBuddy - *
      • Saving/restoring system properties between tests - *
      • Managing test environment variables - *
      • Applying {@link WithConfig} annotations (class and method level, including composed - * annotations) - *
      • Rebuilding config from a clean slate before each test - *
      - * - *

      This extension is auto-registered when using {@link WithConfig} annotations. It can also be - * used explicitly via {@code @ExtendWith(WithConfigExtension.class)}. - */ -@SuppressForbidden -public class WithConfigExtension - implements BeforeAllCallback, BeforeEachCallback, AfterEachCallback, AfterAllCallback { - - static final String INST_CONFIG = "datadog.trace.api.InstrumenterConfig"; - static final String CONFIG = "datadog.trace.api.Config"; - - private static Field instConfigInstanceField; - private static Constructor instConfigConstructor; - private static Field configInstanceField; - private static Constructor configConstructor; - - private static volatile boolean configTransformerInstalled = false; - private static volatile boolean isConfigInstanceModifiable = false; - private static volatile boolean configModificationFailed = false; - - static final TestEnvironmentVariables environmentVariables = TestEnvironmentVariables.setup(); - - private static Properties originalSystemProperties; - - // region JUnit lifecycle callbacks - - @Override - public void beforeAll(ExtensionContext context) { - /* - * Patch config classes to make them modifiable. - */ - // Install config transformer error listener - if (!configTransformerInstalled) { - installConfigTransformer(); - configTransformerInstalled = true; - } - // Make config instance modifiable - makeConfigInstanceModifiable(); - // Verify that config class transformation succeeded - assertFalse(configModificationFailed, "Config class modification failed"); - if (isConfigInstanceModifiable) { - checkConfigTransformation(); - } - /* - * Back up config and apply class-level config values. - */ - if (originalSystemProperties == null) { - saveProperties(); - } - // Apply class-level @WithConfig so config is available before @BeforeAll methods - applyClassLevelConfig(context); - if (isConfigInstanceModifiable) { - rebuildConfig(); - } - } - - @Override - public void beforeEach(ExtensionContext context) { - restoreProperties(); - environmentVariables.clear(); - applyDeclaredConfig(context); - if (isConfigInstanceModifiable) { - rebuildConfig(); - } - } - - @Override - public void afterEach(ExtensionContext context) { - environmentVariables.clear(); - restoreProperties(); - if (isConfigInstanceModifiable) { - rebuildConfig(); - } - } - - @Override - public void afterAll(ExtensionContext context) { - restoreProperties(); - if (isConfigInstanceModifiable) { - rebuildConfig(); - } - } - - private static void applyDeclaredConfig(ExtensionContext context) { - applyClassLevelConfig(context); - applyMethodLevelConfig(context); - } - - private static void applyClassLevelConfig(ExtensionContext context) { - // Walk the entire class hierarchy so annotations on superclasses and apply topmost first, then - // subclass overrides. - Class testClass = context.getRequiredTestClass(); - List> hierarchy = new ArrayList<>(); - for (Class cls = testClass; cls != null; cls = cls.getSuperclass()) { - hierarchy.add(cls); - } - for (int i = hierarchy.size() - 1; i >= 0; i--) { - List classConfigs = - AnnotationSupport.findRepeatableAnnotations(hierarchy.get(i), WithConfig.class); - for (WithConfig cfg : classConfigs) { - applyConfig(cfg); - } - } - } - - private static void applyMethodLevelConfig(ExtensionContext context) { - // Method-level @WithConfig annotations (supports composed/meta-annotations) - context - .getTestMethod() - .ifPresent( - method -> { - List methodConfigs = - AnnotationSupport.findRepeatableAnnotations(method, WithConfig.class); - for (WithConfig cfg : methodConfigs) { - applyConfig(cfg); - } - }); - } - - private static void applyConfig(WithConfig cfg) { - if (cfg.env()) { - setEnvVariable(cfg.key(), cfg.value(), cfg.addPrefix()); - } else { - setSysProperty(cfg.key(), cfg.value(), cfg.addPrefix()); - } - } - - private static void setSysProperty(String name, String value, boolean addPrefix) { - String prefixedName = addPrefix && !name.startsWith("dd.") ? "dd." + name : name; - System.setProperty(prefixedName, value); - } - - private static void setEnvVariable(String name, String value, boolean addPrefix) { - String prefixedName = addPrefix && !name.startsWith("DD_") ? "DD_" + name : name; - environmentVariables.set(prefixedName, value); - } - - // endregion - - // region Public static API for imperative config injection - - public static void injectSysConfig(String name, String value) { - injectSysConfig(name, value, true); - } - - public static void injectSysConfig(String name, String value, boolean addPrefix) { - setSysProperty(name, value, addPrefix); - rebuildConfig(); - } - - public static void removeSysConfig(String name) { - removeSysConfig(name, true); - } - - public static void removeSysConfig(String name, boolean addPrefix) { - String prefixedName = addPrefix && !name.startsWith("dd.") ? "dd." + name : name; - System.clearProperty(prefixedName); - rebuildConfig(); - } - - public static void injectEnvConfig(String name, String value) { - injectEnvConfig(name, value, true); - } - - public static void injectEnvConfig(String name, String value, boolean addPrefix) { - setEnvVariable(name, value, addPrefix); - rebuildConfig(); - } - - public static void removeEnvConfig(String name) { - removeEnvConfig(name, true); - } - - public static void removeEnvConfig(String name, boolean addPrefix) { - String prefixedName = addPrefix && !name.startsWith("DD_") ? "DD_" + name : name; - environmentVariables.removePrefixed(prefixedName); - rebuildConfig(); - } - - // endregion - - // region Config infrastructure setup - - private static void installConfigTransformer() { - try { - Instrumentation instrumentation = ByteBuddyAgent.install(); - new AgentBuilder.Default() - .with(RETRANSFORMATION) - .with(FAIL_FAST) - .with( - new AgentBuilder.LocationStrategy.Simple( - ClassFileLocator.ForClassLoader.ofSystemLoader())) - .ignore(none()) - .type(namedOneOf(INST_CONFIG, CONFIG)) - .transform( - (builder, typeDescription, classLoader, module, pd) -> - builder - .field(named("INSTANCE")) - .transform(Transformer.ForField.withModifiers(PUBLIC, STATIC, VOLATILE))) - .with(new ConfigInstrumentationFailedListener()) - .installOn(instrumentation); - } catch (IllegalStateException e) { - // Ignore. When we have -javaagent:dd-java-agent.jar, this is fine. - } - } - - static void makeConfigInstanceModifiable() { - if (isConfigInstanceModifiable || configModificationFailed) { - return; - } - - try { - Class instConfigClass = Class.forName(INST_CONFIG); - instConfigInstanceField = instConfigClass.getDeclaredField("INSTANCE"); - instConfigConstructor = instConfigClass.getDeclaredConstructor(); - instConfigConstructor.setAccessible(true); - Class configClass = Class.forName(CONFIG); - configInstanceField = configClass.getDeclaredField("INSTANCE"); - configConstructor = configClass.getDeclaredConstructor(); - configConstructor.setAccessible(true); - - isConfigInstanceModifiable = true; - } catch (ClassNotFoundException e) { - if (INST_CONFIG.equals(e.getMessage()) || CONFIG.equals(e.getMessage())) { - System.err.println("Config class not found in this classloader. Not transforming it"); - } else { - configModificationFailed = true; - System.err.println("Config will not be modifiable"); - e.printStackTrace(); - } - } catch (ReflectiveOperationException e) { - configModificationFailed = true; - System.err.println("Config will not be modifiable"); - e.printStackTrace(); - } - } - - private static void rebuildConfig() { - synchronized (WithConfigExtension.class) { - try { - Object newInstConfig = instConfigConstructor.newInstance(); - instConfigInstanceField.set(null, newInstConfig); - Object newConfig = configConstructor.newInstance(); - configInstanceField.set(null, newConfig); - } catch (ReflectiveOperationException e) { - throw new AssertionError("Failed to rebuild config", e); - } - } - } - - // endregion - - // region Property management - - static void saveProperties() { - originalSystemProperties = new Properties(); - originalSystemProperties.putAll(System.getProperties()); - } - - static void restoreProperties() { - if (originalSystemProperties != null) { - Properties copy = new Properties(); - copy.putAll(originalSystemProperties); - System.setProperties(copy); - } - } - - // endregion - - // region Validation - - private static void checkConfigTransformation() { - assertTrue(isConfigInstanceModifiable); - assertNotNull(instConfigConstructor); - checkWritable(instConfigInstanceField); - assertNotNull(configConstructor); - checkWritable(configInstanceField); - } - - private static void checkWritable(Field field) { - assertNotNull(field); - assertTrue(Modifier.isPublic(field.getModifiers())); - assertTrue(Modifier.isStatic(field.getModifiers())); - assertTrue(Modifier.isVolatile(field.getModifiers())); - assertFalse(Modifier.isFinal(field.getModifiers())); - } - - // endregion - - /** Test-only environment variable provider that replaces the real one during tests. */ - public static class TestEnvironmentVariables - extends EnvironmentVariables.EnvironmentVariablesProvider { - private final Map env = new HashMap<>(); - - TestEnvironmentVariables(String... kv) { - for (int i = 0; i + 1 < kv.length; i += 2) { - this.env.put(kv[i], kv[i + 1]); - } - } - - @Override - public String get(@NonNull String name) { - return env.get(name); - } - - @Override - public Map getAll() { - return env; - } - - public void set(String name, String value) { - env.put(name, value); - } - - public void removePrefixed(String prefix) { - env.keySet().removeIf(k -> k.startsWith(prefix)); - } - - public void clear() { - env.clear(); - } - - @SuppressForbidden - static TestEnvironmentVariables setup(String... kv) { - TestEnvironmentVariables provider = new TestEnvironmentVariables(kv); - EnvironmentVariables.provider = provider; - - String propagateVars = System.getenv("TEST_ENV_PROPAGATE_VARS"); - if (propagateVars != null) { - for (String envVar : propagateVars.split(",")) { - provider.env.put(envVar, System.getenv(envVar)); - } - } - - return provider; - } - } - - private static class ConfigInstrumentationFailedListener extends AgentBuilder.Listener.Adapter { - @Override - public void onError( - @NonNull String typeName, - ClassLoader classLoader, - JavaModule module, - boolean loaded, - @NonNull Throwable throwable) { - if (CONFIG.equals(typeName)) { - configModificationFailed = true; - } - } - } -} diff --git a/utils/junit-utils/src/main/java/datadog/trace/junit/utils/tabletest/TableTestTypeConverters.java b/utils/junit-utils/src/main/java/datadog/trace/junit/utils/tabletest/TableTestTypeConverters.java deleted file mode 100644 index 1341f109cbb..00000000000 --- a/utils/junit-utils/src/main/java/datadog/trace/junit/utils/tabletest/TableTestTypeConverters.java +++ /dev/null @@ -1,25 +0,0 @@ -package datadog.trace.junit.utils.tabletest; - -import org.tabletest.junit.TypeConverter; - -/** Shared converters for JUnit 5 TableTest tests that use unparsable constants. */ -public final class TableTestTypeConverters { - - private TableTestTypeConverters() {} - - @TypeConverter - public static long toLong(String value) { - if (value == null) { - throw new IllegalArgumentException("Value cannot be null"); - } - String token = value.trim(); - switch (token) { - case "Long.MAX_VALUE": - return Long.MAX_VALUE; - case "Long.MIN_VALUE": - return Long.MIN_VALUE; - default: - return Long.decode(token); - } - } -} diff --git a/utils/logging-utils/gradle.lockfile b/utils/logging-utils/gradle.lockfile index d021dc28766..4d46ad9f054 100644 --- a/utils/logging-utils/gradle.lockfile +++ b/utils/logging-utils/gradle.lockfile @@ -1,11 +1,12 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :utils:logging-utils:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -16,8 +17,8 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -40,10 +41,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -58,10 +59,13 @@ org.mockito:mockito-junit-jupiter:4.4.0=testCompileClasspath,testRuntimeClasspat org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/utils/logging-utils/src/main/java/datadog/logging/IOLogger.java b/utils/logging-utils/src/main/java/datadog/logging/IOLogger.java index 407f7509454..af21f4a0c57 100644 --- a/utils/logging-utils/src/main/java/datadog/logging/IOLogger.java +++ b/utils/logging-utils/src/main/java/datadog/logging/IOLogger.java @@ -2,6 +2,7 @@ import static datadog.trace.api.telemetry.LogCollector.EXCLUDE_TELEMETRY; +import datadog.trace.api.internal.VisibleForTesting; import java.util.concurrent.TimeUnit; import org.slf4j.Logger; @@ -15,7 +16,7 @@ public IOLogger(final Logger log) { this(log, new RatelimitedLogger(log, 5, TimeUnit.MINUTES)); } - // Visible for testing + @VisibleForTesting IOLogger(final Logger log, final RatelimitedLogger ratelimitedLogger) { this.log = log; this.ratelimitedLogger = ratelimitedLogger; diff --git a/utils/logging-utils/src/main/java/datadog/logging/RatelimitedLogger.java b/utils/logging-utils/src/main/java/datadog/logging/RatelimitedLogger.java index 3e5728b6bb7..b88505c1e59 100644 --- a/utils/logging-utils/src/main/java/datadog/logging/RatelimitedLogger.java +++ b/utils/logging-utils/src/main/java/datadog/logging/RatelimitedLogger.java @@ -1,5 +1,6 @@ package datadog.logging; +import datadog.trace.api.internal.VisibleForTesting; import datadog.trace.api.time.SystemTimeSource; import datadog.trace.api.time.TimeSource; import java.util.Locale; @@ -25,7 +26,7 @@ public RatelimitedLogger(final Logger log, final int delay, final TimeUnit timeU this(log, delay, timeUnit, SystemTimeSource.INSTANCE); } - // Visible for testing + @VisibleForTesting RatelimitedLogger( final Logger log, final int delay, final TimeUnit timeUnit, final TimeSource timeSource) { this.log = log; diff --git a/utils/logging-utils/src/test/java/datadog/logging/RateLimitedLoggerTest.java b/utils/logging-utils/src/test/java/datadog/logging/RateLimitedLoggerTest.java index 0875bff1226..11519ad2d9f 100644 --- a/utils/logging-utils/src/test/java/datadog/logging/RateLimitedLoggerTest.java +++ b/utils/logging-utils/src/test/java/datadog/logging/RateLimitedLoggerTest.java @@ -9,6 +9,7 @@ import static org.mockito.ArgumentMatchers.eq; import static org.mockito.ArgumentMatchers.nullable; import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; @@ -80,6 +81,16 @@ void warningOnce() { (Object[]) any()); } + @Test + void warningDisabled() { + when(this.log.isWarnEnabled()).thenReturn(false); + when(this.log.isDebugEnabled()).thenReturn(false); + RatelimitedLogger rateLimitedLog = new RatelimitedLogger(this.log, 1, MINUTES, this.timeSource); + + assertFalse(rateLimitedLog.warn("test {} {}", "message", EXCEPTION)); + verify(this.log, never()).warn(nullable(Marker.class), any(String.class), (Object[]) any()); + } + @Test void warningOnceNegativeTime() { this.timeSource.set(Long.MIN_VALUE); diff --git a/utils/queue-utils/build.gradle.kts b/utils/queue-utils/build.gradle.kts index 4898ac638d7..8060b9229f5 100644 --- a/utils/queue-utils/build.gradle.kts +++ b/utils/queue-utils/build.gradle.kts @@ -1,3 +1,6 @@ +import org.gradle.api.tasks.javadoc.Javadoc +import org.gradle.jvm.toolchain.JavaLanguageVersion + plugins { `java-library` } @@ -8,3 +11,12 @@ dependencies { api(project(":internal-api")) api(libs.jctools) } + +// jctools-core-jdk11 contains Java 11 class files; JDK 8 javadoc cannot read them. +tasks.named("javadoc") { + javadocTool.set( + javaToolchains.javadocToolFor { + languageVersion.set(JavaLanguageVersion.of(11)) + } + ) +} diff --git a/utils/queue-utils/gradle.lockfile b/utils/queue-utils/gradle.lockfile index 3bb81fed8b9..f0884beeef2 100644 --- a/utils/queue-utils/gradle.lockfile +++ b/utils/queue-utils/gradle.lockfile @@ -1,11 +1,12 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :utils:queue-utils:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -40,10 +41,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.jctools:jctools-core-jdk11:4.0.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.jctools:jctools-core:4.0.6=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -59,10 +60,13 @@ org.mockito:mockito-core:4.4.0=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/utils/socket-utils/gradle.lockfile b/utils/socket-utils/gradle.lockfile index 87c43894cee..0eec268c7f4 100644 --- a/utils/socket-utils/gradle.lockfile +++ b/utils/socket-utils/gradle.lockfile @@ -1,19 +1,20 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :utils:socket-utils:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.datadoghq:dd-javac-plugin-client:0.2.2=runtimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.jnr:jffi:1.3.14=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jffi:1.3.15=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.jnr:jnr-a64asm:1.0.0=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.jnr:jnr-constants:0.10.4=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.jnr:jnr-enxio:0.32.19=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.jnr:jnr-ffi:2.2.18=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.jnr:jnr-posix:3.1.21=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.jnr:jnr-unixsocket:0.38.24=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jnr-enxio:0.32.20=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jnr-ffi:2.2.19=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jnr-posix:3.1.22=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.jnr:jnr-unixsocket:0.38.25=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath com.github.jnr:jnr-x86asm:1.0.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -48,10 +49,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -66,14 +67,17 @@ org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.7.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt org.ow2.asm:asm-commons:9.7.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt org.ow2.asm:asm-tree:9.7.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.7.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt org.ow2.asm:asm:9.7.1=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/utils/test-agent-utils/decoder/build.gradle.kts b/utils/test-agent-utils/decoder/build.gradle.kts index 853fc6516f5..844786b398b 100644 --- a/utils/test-agent-utils/decoder/build.gradle.kts +++ b/utils/test-agent-utils/decoder/build.gradle.kts @@ -4,12 +4,10 @@ plugins { apply(from = "$rootDir/gradle/java.gradle") -val minimumInstructionCoverage by extra(0.8) -val excludedClassesCoverage by extra( - listOf( - "datadog.trace.test.agent.decoder.v04.raw.*", - "datadog.trace.test.agent.decoder.v05.raw.*", - ) +extra["excludedClassesCoverage"] = listOf( + "datadog.trace.test.agent.decoder.v04.raw.*", + "datadog.trace.test.agent.decoder.v05.raw.*", + "datadog.trace.test.agent.decoder.v1.raw.*", ) dependencies { diff --git a/utils/test-agent-utils/decoder/gradle.lockfile b/utils/test-agent-utils/decoder/gradle.lockfile index 9e2c5db3db3..95b25904d6a 100644 --- a/utils/test-agent-utils/decoder/gradle.lockfile +++ b/utils/test-agent-utils/decoder/gradle.lockfile @@ -1,10 +1,12 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :utils:test-agent-utils:decoder:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -17,8 +19,8 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -41,10 +43,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -59,10 +61,13 @@ org.msgpack:msgpack-core:0.8.24=compileClasspath,runtimeClasspath,testCompileCla org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/utils/test-agent-utils/decoder/src/test/java/datadog/trace/test/agent/decoder/DecoderTest.java b/utils/test-agent-utils/decoder/src/test/java/datadog/trace/test/agent/decoder/DecoderTest.java index ddcd4d38f9c..4acea005e87 100644 --- a/utils/test-agent-utils/decoder/src/test/java/datadog/trace/test/agent/decoder/DecoderTest.java +++ b/utils/test-agent-utils/decoder/src/test/java/datadog/trace/test/agent/decoder/DecoderTest.java @@ -4,6 +4,7 @@ import static java.util.Collections.singletonMap; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertIterableEquals; +import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; import java.io.File; @@ -24,6 +25,7 @@ public void decodeV05() throws Throwable { DecodedMessage message = Decoder.decodeV05(buffer); List traces = message.getTraces(); assertEquals(1, traces.size()); + assertNull(traces.get(0).getSamplingPriority()); List spans = traces.get(0).getSpans(); assertEquals(2, spans.size()); List sorted = Decoder.sortByStart(spans); @@ -59,6 +61,7 @@ public void decodeV04() throws Throwable { DecodedMessage message = Decoder.decodeV04(buffer); List traces = message.getTraces(); assertEquals(1, traces.size()); + assertNull(traces.get(0).getSamplingPriority()); List spans = traces.get(0).getSpans(); assertEquals(2, spans.size()); List sorted = Decoder.sortByStart(spans); @@ -96,6 +99,7 @@ public void decodeV1() throws Throwable { DecodedMessage message = Decoder.decodeV1(buffer); List traces = message.getTraces(); assertEquals(1, traces.size()); + assertEquals(1, traces.get(0).getSamplingPriority()); List spans = traces.get(0).getSpans(); assertEquals(2, spans.size()); List sorted = Decoder.sortByStart(spans); diff --git a/utils/test-junit-converter-utils/build.gradle.kts b/utils/test-junit-converter-utils/build.gradle.kts new file mode 100644 index 00000000000..cdcdc3e735c --- /dev/null +++ b/utils/test-junit-converter-utils/build.gradle.kts @@ -0,0 +1,13 @@ +plugins { + `java-library` +} + +apply(from = "$rootDir/gradle/java.gradle") + +dependencies { + implementation(project(":dd-trace-api")) + implementation(project(":internal-api")) + + compileOnly(libs.junit.jupiter) + compileOnly(libs.tabletest) +} diff --git a/utils/test-junit-converter-utils/gradle.lockfile b/utils/test-junit-converter-utils/gradle.lockfile new file mode 100644 index 00000000000..e6322769e9c --- /dev/null +++ b/utils/test-junit-converter-utils/gradle.lockfile @@ -0,0 +1,81 @@ +# This is a Gradle generated file for dependency locking. +# Manual edits can break the build and are not advised. +# This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :utils:test-junit-converter-utils:dependencies --write-locks +ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +com.github.javaparser:javaparser-core:3.25.6=codenarc +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs +com.github.spotbugs:spotbugs:4.9.8=spotbugs +com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs +com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.google.code.gson:gson:2.13.2=spotbugs +com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.thoughtworks.qdox:qdox:1.12.1=codenarc +commons-io:commons-io:2.20.0=spotbugs +de.thetaphi:forbiddenapis:3.10=compileClasspath +io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath +jaxen:jaxen:2.0.0=spotbugs +net.bytebuddy:byte-buddy-agent:1.12.8=testRuntimeClasspath +net.bytebuddy:byte-buddy:1.12.8=testRuntimeClasspath +net.sf.saxon:Saxon-HE:12.9=spotbugs +org.apache.ant:ant-antlr:1.10.14=codenarc +org.apache.ant:ant-junit:1.10.14=codenarc +org.apache.bcel:bcel:6.11.0=spotbugs +org.apache.commons:commons-lang3:3.19.0=spotbugs +org.apache.commons:commons-text:1.14.0=spotbugs +org.apache.logging.log4j:log4j-api:2.25.2=spotbugs +org.apache.logging.log4j:log4j-core:2.25.2=spotbugs +org.apiguardian:apiguardian-api:1.1.2=compileClasspath,testCompileClasspath +org.codehaus.groovy:groovy-ant:3.0.23=codenarc +org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc +org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.25=testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-templates:3.0.23=codenarc +org.codehaus.groovy:groovy-xml:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath +org.codenarc:CodeNarc:3.7.0=codenarc +org.dom4j:dom4j:2.2.0=spotbugs +org.gmetrics:GMetrics:2.1.0=codenarc +org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt +org.junit.jupiter:junit-jupiter-api:5.14.1=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.14.1=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.14.1=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath +org.junit:junit-bom:5.14.0=spotbugs +org.junit:junit-bom:5.14.1=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-core:4.4.0=testRuntimeClasspath +org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath +org.opentest4j:opentest4j:1.3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs +org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs +org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath +org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath +org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.30=compileClasspath,runtimeClasspath +org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j +org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j +org.snakeyaml:snakeyaml-engine:2.9=runtimeClasspath,testRuntimeClasspath +org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath +org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-junit:1.2.1=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-parser:1.2.0=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.xmlresolver:xmlresolver:5.3.3=spotbugs +empty=annotationProcessor,spotbugsPlugins,testAnnotationProcessor diff --git a/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/converter/AbstractClassConstantConvertor.java b/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/converter/AbstractClassConstantConvertor.java new file mode 100644 index 00000000000..122a9d9ad52 --- /dev/null +++ b/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/converter/AbstractClassConstantConvertor.java @@ -0,0 +1,59 @@ +package datadog.trace.test.junit.utils.converter; + +import java.util.Map; +import org.junit.jupiter.api.extension.ParameterContext; +import org.junit.jupiter.params.converter.ArgumentConversionException; +import org.junit.jupiter.params.converter.ArgumentConverter; + +public abstract class AbstractClassConstantConvertor implements ArgumentConverter { + /** + * Returns the class name (simple class name, not fully qualified) of the constants to convert. + * + * @return The simple class name. + */ + protected abstract String className(); + + /** + * Returns the constant mapping between their string representations to their values. + * + * @return The constant mapping between their string representations to their values. + */ + protected abstract Map mapping(); + + @Override + public T convert(Object source, ParameterContext context) { + if (source == null) { + return null; + } + String className = className(); + int length = className.length(); + String s = source.toString(); + if (s.startsWith(className) && s.charAt(length) == '.') { + s = s.substring(length + 1); + } + T mappedValue = mapping().get(s); + if (mappedValue == null && throwsOnUnsupportedValue()) { + throw new ArgumentConversionException( + "Unsupported constant " + source + " from " + className); + } + return mappedValue; + } + + protected boolean throwsOnUnsupportedValue() { + return true; + } + + public abstract static class AbstractStringFallThruConverter + extends AbstractClassConstantConvertor { + @Override + public String convert(Object source, ParameterContext context) { + String convert = super.convert(source, context); + return convert == null ? source.toString() : convert; + } + + @Override + protected boolean throwsOnUnsupportedValue() { + return false; + } + } +} diff --git a/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/converter/ConfigDefaultsConverter.java b/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/converter/ConfigDefaultsConverter.java new file mode 100644 index 00000000000..856b73ebbba --- /dev/null +++ b/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/converter/ConfigDefaultsConverter.java @@ -0,0 +1,29 @@ +package datadog.trace.test.junit.utils.converter; + +import static datadog.trace.api.ConfigDefaults.DEFAULT_SERVICE_NAME; +import static datadog.trace.api.ConfigDefaults.DEFAULT_SERVLET_ROOT_CONTEXT_SERVICE_NAME; + +import datadog.trace.test.junit.utils.converter.AbstractClassConstantConvertor.AbstractStringFallThruConverter; +import java.util.HashMap; +import java.util.Map; + +public class ConfigDefaultsConverter extends AbstractStringFallThruConverter { + private static final Map MAPPING; + + static { + MAPPING = new HashMap<>(); + MAPPING.put("DEFAULT_SERVICE_NAME", DEFAULT_SERVICE_NAME); + MAPPING.put( + "DEFAULT_SERVLET_ROOT_CONTEXT_SERVICE_NAME", DEFAULT_SERVLET_ROOT_CONTEXT_SERVICE_NAME); + } + + @Override + protected String className() { + return "ConfigDefaults"; + } + + @Override + protected Map mapping() { + return MAPPING; + } +} diff --git a/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/converter/DDSpanTypesConverter.java b/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/converter/DDSpanTypesConverter.java new file mode 100644 index 00000000000..24cc9190908 --- /dev/null +++ b/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/converter/DDSpanTypesConverter.java @@ -0,0 +1,87 @@ +package datadog.trace.test.junit.utils.converter; + +import static datadog.trace.api.DDSpanTypes.AEROSPIKE; +import static datadog.trace.api.DDSpanTypes.CACHE; +import static datadog.trace.api.DDSpanTypes.CASSANDRA; +import static datadog.trace.api.DDSpanTypes.COUCHBASE; +import static datadog.trace.api.DDSpanTypes.DATANUCLEUS; +import static datadog.trace.api.DDSpanTypes.ELASTICSEARCH; +import static datadog.trace.api.DDSpanTypes.GRAPHQL; +import static datadog.trace.api.DDSpanTypes.HIBERNATE; +import static datadog.trace.api.DDSpanTypes.HTTP_CLIENT; +import static datadog.trace.api.DDSpanTypes.HTTP_SERVER; +import static datadog.trace.api.DDSpanTypes.LLMOBS; +import static datadog.trace.api.DDSpanTypes.MEMCACHED; +import static datadog.trace.api.DDSpanTypes.MESSAGE_BROKER; +import static datadog.trace.api.DDSpanTypes.MESSAGE_CLIENT; +import static datadog.trace.api.DDSpanTypes.MESSAGE_CONSUMER; +import static datadog.trace.api.DDSpanTypes.MESSAGE_PRODUCER; +import static datadog.trace.api.DDSpanTypes.MONGO; +import static datadog.trace.api.DDSpanTypes.MULE; +import static datadog.trace.api.DDSpanTypes.OPENSEARCH; +import static datadog.trace.api.DDSpanTypes.PROTOBUF; +import static datadog.trace.api.DDSpanTypes.REDIS; +import static datadog.trace.api.DDSpanTypes.RPC; +import static datadog.trace.api.DDSpanTypes.SERVERLESS; +import static datadog.trace.api.DDSpanTypes.SOAP; +import static datadog.trace.api.DDSpanTypes.SQL; +import static datadog.trace.api.DDSpanTypes.TEST; +import static datadog.trace.api.DDSpanTypes.TEST_MODULE_END; +import static datadog.trace.api.DDSpanTypes.TEST_SESSION_END; +import static datadog.trace.api.DDSpanTypes.TEST_SUITE_END; +import static datadog.trace.api.DDSpanTypes.VALKEY; +import static datadog.trace.api.DDSpanTypes.VULNERABILITY; +import static datadog.trace.api.DDSpanTypes.WEBSOCKET; + +import java.util.HashMap; +import java.util.Map; + +public class DDSpanTypesConverter extends AbstractClassConstantConvertor { + private static final Map MAPPING; + + static { + MAPPING = new HashMap<>(); + MAPPING.put("HTTP_CLIENT", HTTP_CLIENT); + MAPPING.put("HTTP_SERVER", HTTP_SERVER); + MAPPING.put("RPC", RPC); + MAPPING.put("CACHE", CACHE); + MAPPING.put("SOAP", SOAP); + MAPPING.put("SQL", SQL); + MAPPING.put("MONGO", MONGO); + MAPPING.put("CASSANDRA", CASSANDRA); + MAPPING.put("COUCHBASE", COUCHBASE); + MAPPING.put("REDIS", REDIS); + MAPPING.put("MEMCACHED", MEMCACHED); + MAPPING.put("ELASTICSEARCH", ELASTICSEARCH); + MAPPING.put("OPENSEARCH", OPENSEARCH); + MAPPING.put("HIBERNATE", HIBERNATE); + MAPPING.put("AEROSPIKE", AEROSPIKE); + MAPPING.put("DATANUCLEUS", DATANUCLEUS); + MAPPING.put("MESSAGE_CLIENT", MESSAGE_CLIENT); + MAPPING.put("MESSAGE_CONSUMER", MESSAGE_CONSUMER); + MAPPING.put("MESSAGE_PRODUCER", MESSAGE_PRODUCER); + MAPPING.put("MESSAGE_BROKER", MESSAGE_BROKER); + MAPPING.put("GRAPHQL", GRAPHQL); + MAPPING.put("TEST", TEST); + MAPPING.put("TEST_SUITE_END", TEST_SUITE_END); + MAPPING.put("TEST_MODULE_END", TEST_MODULE_END); + MAPPING.put("TEST_SESSION_END", TEST_SESSION_END); + MAPPING.put("VULNERABILITY", VULNERABILITY); + MAPPING.put("PROTOBUF", PROTOBUF); + MAPPING.put("MULE", MULE); + MAPPING.put("VALKEY", VALKEY); + MAPPING.put("WEBSOCKET", WEBSOCKET); + MAPPING.put("SERVERLESS", SERVERLESS); + MAPPING.put("LLMOBS", LLMOBS); + } + + @Override + protected String className() { + return "DDSpanTypes"; + } + + @Override + protected Map mapping() { + return MAPPING; + } +} diff --git a/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/converter/PrioritySamplingConverter.java b/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/converter/PrioritySamplingConverter.java new file mode 100644 index 00000000000..958d114048e --- /dev/null +++ b/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/converter/PrioritySamplingConverter.java @@ -0,0 +1,33 @@ +package datadog.trace.test.junit.utils.converter; + +import static datadog.trace.api.sampling.PrioritySampling.SAMPLER_DROP; +import static datadog.trace.api.sampling.PrioritySampling.SAMPLER_KEEP; +import static datadog.trace.api.sampling.PrioritySampling.UNSET; +import static datadog.trace.api.sampling.PrioritySampling.USER_DROP; +import static datadog.trace.api.sampling.PrioritySampling.USER_KEEP; + +import java.util.HashMap; +import java.util.Map; + +public class PrioritySamplingConverter extends AbstractClassConstantConvertor { + private static final Map MAPPING; + + static { + MAPPING = new HashMap<>(); + MAPPING.put("UNSET", UNSET); + MAPPING.put("SAMPLER_KEEP", SAMPLER_KEEP); + MAPPING.put("SAMPLER_DROP", SAMPLER_DROP); + MAPPING.put("USER_DROP", USER_DROP); + MAPPING.put("USER_KEEP", USER_KEEP); + } + + @Override + protected String className() { + return "PrioritySampling"; + } + + @Override + protected Map mapping() { + return MAPPING; + } +} diff --git a/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/converter/ProductTraceSourceConverter.java b/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/converter/ProductTraceSourceConverter.java new file mode 100644 index 00000000000..e41876d964f --- /dev/null +++ b/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/converter/ProductTraceSourceConverter.java @@ -0,0 +1,33 @@ +package datadog.trace.test.junit.utils.converter; + +import static datadog.trace.api.ProductTraceSource.APM; +import static datadog.trace.api.ProductTraceSource.ASM; +import static datadog.trace.api.ProductTraceSource.DBM; +import static datadog.trace.api.ProductTraceSource.DSM; +import static datadog.trace.api.ProductTraceSource.UNSET; + +import java.util.HashMap; +import java.util.Map; + +public class ProductTraceSourceConverter extends AbstractClassConstantConvertor { + private static final Map MAPPING; + + static { + MAPPING = new HashMap<>(); + MAPPING.put("UNSET", UNSET); + MAPPING.put("APM", APM); + MAPPING.put("ASM", ASM); + MAPPING.put("DSM", DSM); + MAPPING.put("DBM", DBM); + } + + @Override + protected String className() { + return "ProductTraceSource"; + } + + @Override + protected Map mapping() { + return MAPPING; + } +} diff --git a/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/converter/SamplingMechanismConverter.java b/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/converter/SamplingMechanismConverter.java new file mode 100644 index 00000000000..044edabead9 --- /dev/null +++ b/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/converter/SamplingMechanismConverter.java @@ -0,0 +1,51 @@ +package datadog.trace.test.junit.utils.converter; + +import static datadog.trace.api.sampling.SamplingMechanism.AGENT_RATE; +import static datadog.trace.api.sampling.SamplingMechanism.AI_GUARD; +import static datadog.trace.api.sampling.SamplingMechanism.APPSEC; +import static datadog.trace.api.sampling.SamplingMechanism.DATA_JOBS; +import static datadog.trace.api.sampling.SamplingMechanism.DEFAULT; +import static datadog.trace.api.sampling.SamplingMechanism.EXTERNAL_OVERRIDE; +import static datadog.trace.api.sampling.SamplingMechanism.LOCAL_USER_RULE; +import static datadog.trace.api.sampling.SamplingMechanism.MANUAL; +import static datadog.trace.api.sampling.SamplingMechanism.REMOTE_ADAPTIVE_RULE; +import static datadog.trace.api.sampling.SamplingMechanism.REMOTE_AUTO_RATE; +import static datadog.trace.api.sampling.SamplingMechanism.REMOTE_USER_RATE; +import static datadog.trace.api.sampling.SamplingMechanism.REMOTE_USER_RULE; +import static datadog.trace.api.sampling.SamplingMechanism.SPAN_SAMPLING_RATE; +import static datadog.trace.api.sampling.SamplingMechanism.UNKNOWN; + +import java.util.HashMap; +import java.util.Map; + +public class SamplingMechanismConverter extends AbstractClassConstantConvertor { + private static final Map MAPPING; + + static { + MAPPING = new HashMap<>(); + MAPPING.put("UNKNOWN", UNKNOWN); + MAPPING.put("DEFAULT", DEFAULT); + MAPPING.put("AGENT_RATE", AGENT_RATE); + MAPPING.put("REMOTE_AUTO_RATE", REMOTE_AUTO_RATE); + MAPPING.put("LOCAL_USER_RULE", LOCAL_USER_RULE); + MAPPING.put("MANUAL", MANUAL); + MAPPING.put("APPSEC", APPSEC); + MAPPING.put("REMOTE_USER_RATE", REMOTE_USER_RATE); + MAPPING.put("SPAN_SAMPLING_RATE", SPAN_SAMPLING_RATE); + MAPPING.put("DATA_JOBS", DATA_JOBS); + MAPPING.put("REMOTE_USER_RULE", REMOTE_USER_RULE); + MAPPING.put("REMOTE_ADAPTIVE_RULE", REMOTE_ADAPTIVE_RULE); + MAPPING.put("AI_GUARD", AI_GUARD); + MAPPING.put("EXTERNAL_OVERRIDE", EXTERNAL_OVERRIDE); + } + + @Override + protected String className() { + return "SamplingMechanism"; + } + + @Override + protected Map mapping() { + return MAPPING; + } +} diff --git a/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/converter/TagsConverter.java b/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/converter/TagsConverter.java new file mode 100644 index 00000000000..ad5ab38402f --- /dev/null +++ b/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/converter/TagsConverter.java @@ -0,0 +1,66 @@ +package datadog.trace.test.junit.utils.converter; + +import static datadog.trace.api.DDTags.MANUAL_DROP; +import static datadog.trace.api.DDTags.MANUAL_KEEP; +import static datadog.trace.api.DDTags.RESOURCE_NAME; +import static datadog.trace.api.DDTags.SERVICE_NAME; +import static datadog.trace.api.DDTags.SPAN_TYPE; +import static datadog.trace.api.DDTags.THREAD_ID; +import static datadog.trace.api.DDTags.THREAD_NAME; +import static datadog.trace.bootstrap.instrumentation.api.Tags.HTTP_METHOD; +import static datadog.trace.bootstrap.instrumentation.api.Tags.HTTP_STATUS; +import static datadog.trace.bootstrap.instrumentation.api.Tags.HTTP_URL; +import static datadog.trace.bootstrap.instrumentation.api.Tags.PEER_SERVICE; +import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_BROKER; +import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_CLIENT; +import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_CONSUMER; +import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_PRODUCER; +import static datadog.trace.bootstrap.instrumentation.api.Tags.SPAN_KIND_SERVER; + +import datadog.trace.test.junit.utils.converter.AbstractClassConstantConvertor.AbstractStringFallThruConverter; +import java.util.HashMap; +import java.util.Map; + +public class TagsConverter extends AbstractStringFallThruConverter { + private static final Map MAPPING; + + static { + MAPPING = new HashMap<>(); + // Tags mapping (class name will be trimmed) + MAPPING.put("SPAN_KIND_SERVER", SPAN_KIND_SERVER); + MAPPING.put("SPAN_KIND_CLIENT", SPAN_KIND_CLIENT); + MAPPING.put("SPAN_KIND_PRODUCER", SPAN_KIND_PRODUCER); + MAPPING.put("SPAN_KIND_CONSUMER", SPAN_KIND_CONSUMER); + MAPPING.put("SPAN_KIND_BROKER", SPAN_KIND_BROKER); + MAPPING.put("PEER_SERVICE", PEER_SERVICE); + MAPPING.put("HTTP_URL", HTTP_URL); + MAPPING.put("HTTP_STATUS", HTTP_STATUS); + MAPPING.put("HTTP_METHOD", HTTP_METHOD); + // DDTags mapping with class name + MAPPING.put("DDTags.SPAN_TYPE", SPAN_TYPE); + MAPPING.put("DDTags.SERVICE_NAME", SERVICE_NAME); + MAPPING.put("DDTags.RESOURCE_NAME", RESOURCE_NAME); + MAPPING.put("DDTags.THREAD_NAME", THREAD_NAME); + MAPPING.put("DDTags.THREAD_ID", THREAD_ID); + MAPPING.put("DDTags.MANUAL_KEEP", MANUAL_KEEP); + MAPPING.put("DDTags.MANUAL_DROP", MANUAL_DROP); + // DDTags mapping with direct field name + MAPPING.put("SPAN_TYPE", SPAN_TYPE); + MAPPING.put("SERVICE_NAME", SERVICE_NAME); + MAPPING.put("RESOURCE_NAME", RESOURCE_NAME); + MAPPING.put("THREAD_NAME", THREAD_NAME); + MAPPING.put("THREAD_ID", THREAD_ID); + MAPPING.put("MANUAL_KEEP", MANUAL_KEEP); + MAPPING.put("MANUAL_DROP", MANUAL_DROP); + } + + @Override + protected String className() { + return "Tags"; + } + + @Override + protected Map mapping() { + return MAPPING; + } +} diff --git a/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/converter/TraceIdConverter.java b/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/converter/TraceIdConverter.java new file mode 100644 index 00000000000..db2ec553dbe --- /dev/null +++ b/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/converter/TraceIdConverter.java @@ -0,0 +1,63 @@ +package datadog.trace.test.junit.utils.converter; + +import static java.math.BigInteger.ONE; + +import datadog.trace.api.DDTraceId; +import java.math.BigInteger; +import org.junit.jupiter.api.extension.ParameterContext; +import org.junit.jupiter.params.converter.ArgumentConversionException; +import org.junit.jupiter.params.converter.ArgumentConverter; + +/** + * Converts symbolic trace/span ID names to their decimal string representation. + * + *

      Supported names: + * + *

        + *
      • {@code MAX} — max unsigned 64-bit value (18446744073709551615 = 2⁶⁴ − 1) + *
      • {@code MAX-1} — max minus one (18446744073709551614 = 2⁶⁴ − 2) + *
      • {@code MAX+1} — first out-of-range value (18446744073709551616 = 2⁶⁴) + *
      + * + *

      All other values are passed through unchanged. + */ +public class TraceIdConverter implements ArgumentConverter { + // 2^64 - 1 + public static final String TRACE_ID_MAX = Long.toUnsignedString(-1L); + // 2^64 - 2 + public static final String TRACE_ID_MAX_MINUS_1 = Long.toUnsignedString(-2L); + // 2^64 (first out-of-range value) + public static final String TRACE_ID_MAX_PLUS_1 = new BigInteger(TRACE_ID_MAX).add(ONE).toString(); + + @Override + public Object convert(Object source, ParameterContext context) + throws ArgumentConversionException { + if (source == null) { + return null; + } + String s = source.toString(); + String traceId; + switch (s) { + case "MAX": + traceId = TRACE_ID_MAX; + break; + case "MAX-1": + traceId = TRACE_ID_MAX_MINUS_1; + break; + case "MAX+1": + traceId = TRACE_ID_MAX_PLUS_1; + break; + default: + traceId = s; + } + + Class parameterType = context.getParameter().getType(); + if (parameterType.isAssignableFrom(DDTraceId.class)) { + return DDTraceId.from(s); + } else if (parameterType.isAssignableFrom(Long.class)) { + return DDTraceId.from(s).toLong(); + } else { + return traceId; + } + } +} diff --git a/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/tabletest/ConfigValueConverter.java b/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/tabletest/ConfigValueConverter.java new file mode 100644 index 00000000000..7ccf1ff9df3 --- /dev/null +++ b/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/tabletest/ConfigValueConverter.java @@ -0,0 +1,58 @@ +package datadog.trace.test.junit.utils.tabletest; + +import java.util.BitSet; +import java.util.regex.Pattern; +import org.junit.jupiter.api.extension.ParameterContext; +import org.junit.jupiter.params.converter.ArgumentConversionException; +import org.junit.jupiter.params.converter.ArgumentConverter; + +/** + * Converts a TableTest cell into the heterogeneous {@code value} accepted by {@code + * ConfigSetting.of}. Use with {@code @ConvertWith(ConfigValueConverter.class)} on an {@code + * Object}-typed parameter that needs to be a list, map, or {@link BitSet}. + * + *

      Lists ({@code [a, b, c]}) and maps ({@code [key: value]}) are parsed natively by TableTest. + * The only case needing a typed value is {@link BitSet}. + * + *

      BitSet syntax: {@code bits(, ...)} where each token is either a single bit ({@code 33}) + * or a half-open interval ({@code 200-300}, i.e. bits 200..299). This mirrors how {@code + * ConfigSetting} renders integer ranges, so the cell literal reads the same as the expected output. + */ +public class ConfigValueConverter implements ArgumentConverter { + + private static final String BITSET_PREFIX = "bits("; + private static final Pattern COMMA = Pattern.compile(","); + + @Override + public Object convert(Object source, ParameterContext context) + throws ArgumentConversionException { + if (source == null) return null; + if (source instanceof String) { + String s = ((String) source).trim(); + if (s.startsWith(BITSET_PREFIX) && s.endsWith(")")) { + return parseBitSet(s.substring(BITSET_PREFIX.length(), s.length() - 1)); + } + } + // Lists and maps are already parsed by TableTest + return source; + } + + private static BitSet parseBitSet(String intervals) { + BitSet bitSet = new BitSet(); + for (String token : COMMA.split(intervals)) { + String trimmed = token.trim(); + if (trimmed.isEmpty()) { + continue; + } + int dash = trimmed.indexOf('-'); + if (dash > 0) { + int start = Integer.parseInt(trimmed.substring(0, dash).trim()); + int end = Integer.parseInt(trimmed.substring(dash + 1).trim()); + bitSet.set(start, end); + } else { + bitSet.set(Integer.parseInt(trimmed)); + } + } + return bitSet; + } +} diff --git a/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/tabletest/TableTestTypeConverters.java b/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/tabletest/TableTestTypeConverters.java new file mode 100644 index 00000000000..781ca972406 --- /dev/null +++ b/utils/test-junit-converter-utils/src/main/java/datadog/trace/test/junit/utils/tabletest/TableTestTypeConverters.java @@ -0,0 +1,74 @@ +package datadog.trace.test.junit.utils.tabletest; + +import org.tabletest.junit.TypeConverter; + +/** Shared converters for JUnit 5 TableTest tests that use unparsable constants. */ +public final class TableTestTypeConverters { + + private TableTestTypeConverters() {} + + @TypeConverter + public static long toLong(String value) { + if (value == null) { + throw new IllegalArgumentException("Value cannot be null"); + } + String token = value.trim(); + switch (token) { + case "Long.MAX_VALUE": + return Long.MAX_VALUE; + case "Long.MIN_VALUE": + return Long.MIN_VALUE; + default: + return Long.decode(token); + } + } + + @TypeConverter + public static int toInt(String value) { + if (value == null) { + throw new IllegalArgumentException("Value cannot be null"); + } + String token = value.trim(); + switch (token) { + case "Integer.MAX_VALUE": + return Integer.MAX_VALUE; + case "Integer.MIN_VALUE": + return Integer.MIN_VALUE; + default: + return Integer.decode(token); + } + } + + @TypeConverter + public static Number toNumber(String value) { + if (value == null) { + throw new IllegalArgumentException("Value cannot be null"); + } + switch (value) { + case "Integer.MAX_VALUE": + return Integer.MAX_VALUE; + case "Integer.MIN_VALUE": + return Integer.MIN_VALUE; + case "Short.MAX_VALUE": + return Short.MAX_VALUE; + case "Short.MIN_VALUE": + return Short.MIN_VALUE; + case "Float.MAX_VALUE": + return Float.MAX_VALUE; + case "Float.MIN_VALUE": + return Float.MIN_VALUE; + case "Double.MAX_VALUE": + return Double.MAX_VALUE; + case "Double.MIN_VALUE": + return Double.MIN_VALUE; + default: + if (value.endsWith("f")) { + return Float.parseFloat(value); + } + if (value.endsWith("d")) { + return Double.parseDouble(value); + } + return Integer.decode(value); + } + } +} diff --git a/utils/test-junit-utils/build.gradle.kts b/utils/test-junit-utils/build.gradle.kts new file mode 100644 index 00000000000..73e8010578e --- /dev/null +++ b/utils/test-junit-utils/build.gradle.kts @@ -0,0 +1,12 @@ +plugins { + `java-library` +} + +apply(from = "$rootDir/gradle/java.gradle") + +dependencies { + api(libs.forbiddenapis) + api(project(":components:environment")) + + compileOnly(libs.junit.jupiter) +} diff --git a/utils/test-junit-utils/gradle.lockfile b/utils/test-junit-utils/gradle.lockfile new file mode 100644 index 00000000000..5df8008b6d1 --- /dev/null +++ b/utils/test-junit-utils/gradle.lockfile @@ -0,0 +1,78 @@ +# This is a Gradle generated file for dependency locking. +# Manual edits can break the build and are not advised. +# This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :utils:test-junit-utils:dependencies --write-locks +ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath +ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath +com.github.javaparser:javaparser-core:3.25.6=codenarc +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs +com.github.spotbugs:spotbugs:4.9.8=spotbugs +com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs +com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.google.code.gson:gson:2.13.2=spotbugs +com.google.errorprone:error_prone_annotations:2.41.0=spotbugs +com.thoughtworks.qdox:qdox:1.12.1=codenarc +commons-io:commons-io:2.20.0=spotbugs +de.thetaphi:forbiddenapis:3.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath +jaxen:jaxen:2.0.0=spotbugs +net.bytebuddy:byte-buddy-agent:1.12.8=testRuntimeClasspath +net.bytebuddy:byte-buddy:1.12.8=testRuntimeClasspath +net.sf.saxon:Saxon-HE:12.9=spotbugs +org.apache.ant:ant-antlr:1.10.14=codenarc +org.apache.ant:ant-junit:1.10.14=codenarc +org.apache.bcel:bcel:6.11.0=spotbugs +org.apache.commons:commons-lang3:3.19.0=spotbugs +org.apache.commons:commons-text:1.14.0=spotbugs +org.apache.logging.log4j:log4j-api:2.25.2=spotbugs +org.apache.logging.log4j:log4j-core:2.25.2=spotbugs +org.apiguardian:apiguardian-api:1.1.2=compileClasspath,testCompileClasspath +org.codehaus.groovy:groovy-ant:3.0.23=codenarc +org.codehaus.groovy:groovy-docgenerator:3.0.23=codenarc +org.codehaus.groovy:groovy-groovydoc:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.23=codenarc +org.codehaus.groovy:groovy-json:3.0.25=testCompileClasspath,testRuntimeClasspath +org.codehaus.groovy:groovy-templates:3.0.23=codenarc +org.codehaus.groovy:groovy-xml:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.23=codenarc +org.codehaus.groovy:groovy:3.0.25=testCompileClasspath,testRuntimeClasspath +org.codenarc:CodeNarc:3.7.0=codenarc +org.dom4j:dom4j:2.2.0=spotbugs +org.gmetrics:GMetrics:2.1.0=codenarc +org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt +org.junit.jupiter:junit-jupiter-api:5.14.1=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath +org.junit.jupiter:junit-jupiter-params:5.14.1=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.jupiter:junit-jupiter:5.14.1=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-commons:1.14.1=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-engine:1.14.1=testCompileClasspath,testRuntimeClasspath +org.junit.platform:junit-platform-launcher:1.14.1=testRuntimeClasspath +org.junit:junit-bom:5.14.0=spotbugs +org.junit:junit-bom:5.14.1=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.mockito:mockito-core:4.4.0=testRuntimeClasspath +org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath +org.opentest4j:opentest4j:1.3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath +org.ow2.asm:asm-analysis:9.9=spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs +org.ow2.asm:asm-util:9.9=spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs +org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath +org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath +org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:1.7.32=testCompileClasspath,testRuntimeClasspath +org.slf4j:slf4j-api:2.0.17=spotbugs,spotbugsSlf4j +org.slf4j:slf4j-simple:2.0.17=spotbugsSlf4j +org.spockframework:spock-bom:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath +org.spockframework:spock-core:2.4-groovy-3.0=testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-junit:1.2.1=testCompileClasspath,testRuntimeClasspath +org.tabletest:tabletest-parser:1.2.0=testCompileClasspath,testRuntimeClasspath +org.xmlresolver:xmlresolver:5.3.3=spotbugs +empty=annotationProcessor,spotbugsPlugins,testAnnotationProcessor diff --git a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/Any.java b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/Any.java similarity index 92% rename from dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/Any.java rename to utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/Any.java index 4c1c981e07e..a7a506f9457 100644 --- a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/Any.java +++ b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/Any.java @@ -1,4 +1,4 @@ -package datadog.trace.agent.test.assertions; +package datadog.trace.test.junit.utils.assertions; import java.util.Optional; diff --git a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/Is.java b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/Is.java similarity index 92% rename from dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/Is.java rename to utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/Is.java index f142ba1b742..f7a3346e64e 100644 --- a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/Is.java +++ b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/Is.java @@ -1,4 +1,4 @@ -package datadog.trace.agent.test.assertions; +package datadog.trace.test.junit.utils.assertions; import java.util.Optional; diff --git a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/IsFalse.java b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/IsFalse.java similarity index 89% rename from dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/IsFalse.java rename to utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/IsFalse.java index 5e1f2f3f8ab..a22a746a69b 100644 --- a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/IsFalse.java +++ b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/IsFalse.java @@ -1,4 +1,4 @@ -package datadog.trace.agent.test.assertions; +package datadog.trace.test.junit.utils.assertions; import java.util.Optional; diff --git a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/IsNonNull.java b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/IsNonNull.java similarity index 90% rename from dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/IsNonNull.java rename to utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/IsNonNull.java index 0e0f37a159e..91246e13b40 100644 --- a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/IsNonNull.java +++ b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/IsNonNull.java @@ -1,4 +1,4 @@ -package datadog.trace.agent.test.assertions; +package datadog.trace.test.junit.utils.assertions; import java.util.Optional; diff --git a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/IsNull.java b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/IsNull.java similarity index 90% rename from dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/IsNull.java rename to utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/IsNull.java index 38cf1b07ba2..5a4a4b32892 100644 --- a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/IsNull.java +++ b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/IsNull.java @@ -1,4 +1,4 @@ -package datadog.trace.agent.test.assertions; +package datadog.trace.test.junit.utils.assertions; import java.util.Optional; diff --git a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/IsTrue.java b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/IsTrue.java similarity index 89% rename from dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/IsTrue.java rename to utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/IsTrue.java index b7529bc697a..e56f0c97d37 100644 --- a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/IsTrue.java +++ b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/IsTrue.java @@ -1,4 +1,4 @@ -package datadog.trace.agent.test.assertions; +package datadog.trace.test.junit.utils.assertions; import java.util.Optional; diff --git a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/Matcher.java b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/Matcher.java similarity index 93% rename from dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/Matcher.java rename to utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/Matcher.java index facbc29f5ba..9395097e35a 100644 --- a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/Matcher.java +++ b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/Matcher.java @@ -1,4 +1,4 @@ -package datadog.trace.agent.test.assertions; +package datadog.trace.test.junit.utils.assertions; import java.util.Optional; import java.util.function.Predicate; diff --git a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/Matchers.java b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/Matchers.java similarity index 84% rename from dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/Matchers.java rename to utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/Matchers.java index 973338bd1f1..8be26fd99ce 100644 --- a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/Matchers.java +++ b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/Matchers.java @@ -1,10 +1,11 @@ -package datadog.trace.agent.test.assertions; +package datadog.trace.test.junit.utils.assertions; import static org.junit.jupiter.api.AssertionFailureBuilder.assertionFailure; import java.util.Optional; import java.util.function.Predicate; import java.util.regex.Pattern; +import javax.annotation.Nullable; /** This class is a utility class to create generic matchers. */ public final class Matchers { @@ -101,7 +102,18 @@ public static Matcher any() { return new Any<>(); } - static void assertValue(Matcher matcher, T value, String message) { + /** + * Asserts that a value matches a given matcher. If the value does not match, an assertion error + * is thrown. + * + * @param matcher The matcher to test the value against, {@code null} if no validation is + * required. + * @param value The value to be tested, {@code null} if no value is available. + * @param message The error message to include in the assertion failure. + * @param The type of the value being tested. + */ + public static void assertValue( + @Nullable Matcher matcher, @Nullable T value, String message) { if (matcher != null && !matcher.test(value)) { Optional expected = matcher.expected(); assertionFailure() diff --git a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/Matches.java b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/Matches.java similarity index 93% rename from dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/Matches.java rename to utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/Matches.java index edc71e446a8..e19dfa7554f 100644 --- a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/Matches.java +++ b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/Matches.java @@ -1,4 +1,4 @@ -package datadog.trace.agent.test.assertions; +package datadog.trace.test.junit.utils.assertions; import java.util.Optional; import java.util.regex.Pattern; diff --git a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/Validates.java b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/Validates.java similarity index 93% rename from dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/Validates.java rename to utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/Validates.java index 234bfde7a63..ffa0773dab5 100644 --- a/dd-java-agent/instrumentation-testing/src/main/java/datadog/trace/agent/test/assertions/Validates.java +++ b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/assertions/Validates.java @@ -1,4 +1,4 @@ -package datadog.trace.agent.test.assertions; +package datadog.trace.test.junit.utils.assertions; import java.util.Optional; import java.util.function.Predicate; diff --git a/utils/junit-utils/src/main/java/datadog/trace/junit/utils/config/WithConfig.java b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/config/WithConfig.java similarity index 82% rename from utils/junit-utils/src/main/java/datadog/trace/junit/utils/config/WithConfig.java rename to utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/config/WithConfig.java index a77045210ca..61dfb4b1d99 100644 --- a/utils/junit-utils/src/main/java/datadog/trace/junit/utils/config/WithConfig.java +++ b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/config/WithConfig.java @@ -1,4 +1,4 @@ -package datadog.trace.junit.utils.config; +package datadog.trace.test.junit.utils.config; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.TYPE; @@ -18,16 +18,16 @@ * *

      Examples: * - *

      {@code
      - * @WithConfig(key = "service", value = "my_service")
      - * @WithConfig(key = "trace.resolver.enabled", value = "false")
      + * 
      + * @WithConfig(key = "service", value = "my_service")
      + * @WithConfig(key = "trace.resolver.enabled", value = "false")
        * class MyTest extends DDJavaSpecification {
        *
      - *   @Test
      - *   @WithConfig(key = "AGENT_HOST", value = "localhost", env = true)
      + *   @Test
      + *   @WithConfig(key = "AGENT_HOST", value = "localhost", env = true)
        *   void testWithEnv() { ... }
        * }
      - * }
      + *
      */ @Retention(RUNTIME) @Target({TYPE, METHOD}) diff --git a/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/config/WithConfigExtension.java b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/config/WithConfigExtension.java new file mode 100644 index 00000000000..0e8857a9f4d --- /dev/null +++ b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/config/WithConfigExtension.java @@ -0,0 +1,305 @@ +package datadog.trace.test.junit.utils.config; + +import datadog.environment.EnvironmentVariables; +import de.thetaphi.forbiddenapis.SuppressForbidden; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import org.junit.jupiter.api.extension.AfterAllCallback; +import org.junit.jupiter.api.extension.AfterEachCallback; +import org.junit.jupiter.api.extension.BeforeAllCallback; +import org.junit.jupiter.api.extension.BeforeEachCallback; +import org.junit.jupiter.api.extension.ExtensionContext; +import org.junit.platform.commons.support.AnnotationSupport; + +/** + * JUnit 5 extension that manages DD config injection for tests. Handles: + * + *
        + *
      • Verifying {@code Config} and {@code InstrumenterConfig} {@code INSTANCE} fields have been + * made modifiable by the load-time agent (see {@code + * dd-trace-java.modifiable-config.gradle.kts} and {@code buildSrc/modifiable-config-agent}) + *
      • Saving/restoring system properties between tests + *
      • Managing test environment variables + *
      • Applying {@link WithConfig} annotations (class and method level, including composed + * annotations) + *
      • Rebuilding config from a clean slate before each test + *
      + * + *

      This extension is auto-registered when using {@link WithConfig} annotations. It can also be + * used explicitly via {@code @ExtendWith(WithConfigExtension.class)}. + */ +@SuppressForbidden +public class WithConfigExtension + implements BeforeAllCallback, BeforeEachCallback, AfterEachCallback, AfterAllCallback { + + static final String INST_CONFIG = "datadog.trace.api.InstrumenterConfig"; + static final String CONFIG = "datadog.trace.api.Config"; + + private static final Field instConfigInstanceField; + private static final Constructor instConfigConstructor; + private static final Field configInstanceField; + private static final Constructor configConstructor; + + static { + ensureConfigInstrumentationHasBeenApplied(); + try { + Class instCfg = Class.forName(INST_CONFIG); + instConfigInstanceField = instCfg.getDeclaredField("INSTANCE"); + instConfigConstructor = instCfg.getDeclaredConstructor(); + instConfigConstructor.setAccessible(true); + Class cfg = Class.forName(CONFIG); + configInstanceField = cfg.getDeclaredField("INSTANCE"); + configConstructor = cfg.getDeclaredConstructor(); + configConstructor.setAccessible(true); + } catch (ReflectiveOperationException e) { + throw new ExceptionInInitializerError(e); + } + } + + static final TestEnvironmentVariables environmentVariables = TestEnvironmentVariables.setup(); + + private static Properties originalSystemProperties; + + // region JUnit lifecycle callbacks + + @Override + public void beforeAll(ExtensionContext context) { + // Back up config and apply class-level config values. + if (originalSystemProperties == null) { + saveProperties(); + } + // Apply class-level @WithConfig so config is available before @BeforeAll methods + applyClassLevelConfig(context); + rebuildConfig(); + } + + @Override + public void beforeEach(ExtensionContext context) { + restoreProperties(); + environmentVariables.clear(); + applyDeclaredConfig(context); + rebuildConfig(); + } + + @Override + public void afterEach(ExtensionContext context) { + environmentVariables.clear(); + restoreProperties(); + rebuildConfig(); + } + + @Override + public void afterAll(ExtensionContext context) { + restoreProperties(); + rebuildConfig(); + } + + private static void applyDeclaredConfig(ExtensionContext context) { + applyClassLevelConfig(context); + applyMethodLevelConfig(context); + } + + private static void applyClassLevelConfig(ExtensionContext context) { + // Walk the entire class hierarchy so annotations on superclasses and apply topmost first, then + // subclass overrides. + Class testClass = context.getRequiredTestClass(); + List> hierarchy = new ArrayList<>(); + for (Class cls = testClass; cls != null; cls = cls.getSuperclass()) { + hierarchy.add(cls); + } + for (int i = hierarchy.size() - 1; i >= 0; i--) { + List classConfigs = + AnnotationSupport.findRepeatableAnnotations(hierarchy.get(i), WithConfig.class); + for (WithConfig cfg : classConfigs) { + applyConfig(cfg); + } + } + } + + private static void applyMethodLevelConfig(ExtensionContext context) { + // Method-level @WithConfig annotations (supports composed/meta-annotations) + context + .getTestMethod() + .ifPresent( + method -> { + List methodConfigs = + AnnotationSupport.findRepeatableAnnotations(method, WithConfig.class); + for (WithConfig cfg : methodConfigs) { + applyConfig(cfg); + } + }); + } + + private static void applyConfig(WithConfig cfg) { + if (cfg.env()) { + setEnvVariable(cfg.key(), cfg.value(), cfg.addPrefix()); + } else { + setSysProperty(cfg.key(), cfg.value(), cfg.addPrefix()); + } + } + + private static void setSysProperty(String name, String value, boolean addPrefix) { + String prefixedName = addPrefix && !name.startsWith("dd.") ? "dd." + name : name; + System.setProperty(prefixedName, value); + } + + private static void setEnvVariable(String name, String value, boolean addPrefix) { + String prefixedName = addPrefix && !name.startsWith("DD_") ? "DD_" + name : name; + environmentVariables.set(prefixedName, value); + } + + // endregion + + // region Public static API for imperative config injection + + public static void injectSysConfig(String name, String value) { + injectSysConfig(name, value, true); + } + + public static void injectSysConfig(String name, String value, boolean addPrefix) { + setSysProperty(name, value, addPrefix); + rebuildConfig(); + } + + public static void removeSysConfig(String name) { + removeSysConfig(name, true); + } + + public static void removeSysConfig(String name, boolean addPrefix) { + String prefixedName = addPrefix && !name.startsWith("dd.") ? "dd." + name : name; + System.clearProperty(prefixedName); + rebuildConfig(); + } + + public static void injectEnvConfig(String name, String value) { + injectEnvConfig(name, value, true); + } + + public static void injectEnvConfig(String name, String value, boolean addPrefix) { + setEnvVariable(name, value, addPrefix); + rebuildConfig(); + } + + public static void removeEnvConfig(String name) { + removeEnvConfig(name, true); + } + + public static void removeEnvConfig(String name, boolean addPrefix) { + String prefixedName = addPrefix && !name.startsWith("DD_") ? "DD_" + name : name; + environmentVariables.removePrefixed(prefixedName); + rebuildConfig(); + } + + // endregion + + // region Config infrastructure setup + + private static void ensureConfigInstrumentationHasBeenApplied() { + if (isWritableInstance(CONFIG) && isWritableInstance(INST_CONFIG)) { + return; + } + throw new IllegalStateException( + "Config/InstrumenterConfig INSTANCE fields are not modifiable. " + + "Need the '-javaagent:modifiable-config-agent.jar' on the test JVM " + + "(the dd-trace-java.configure-tests Gradle convention plugin wires this automatically)."); + } + + private static boolean isWritableInstance(String className) { + try { + int m = Class.forName(className).getDeclaredField("INSTANCE").getModifiers(); + return Modifier.isPublic(m) + && Modifier.isStatic(m) + && Modifier.isVolatile(m) + && !Modifier.isFinal(m); + } catch (ClassNotFoundException | NoSuchFieldException e) { + return false; + } + } + + private static void rebuildConfig() { + synchronized (WithConfigExtension.class) { + try { + Object newInstConfig = instConfigConstructor.newInstance(); + instConfigInstanceField.set(null, newInstConfig); + Object newConfig = configConstructor.newInstance(); + configInstanceField.set(null, newConfig); + } catch (ReflectiveOperationException e) { + throw new AssertionError("Failed to rebuild config", e); + } + } + } + + // endregion + + // region Property management + + static void saveProperties() { + originalSystemProperties = new Properties(); + originalSystemProperties.putAll(System.getProperties()); + } + + static void restoreProperties() { + if (originalSystemProperties != null) { + Properties copy = new Properties(); + copy.putAll(originalSystemProperties); + System.setProperties(copy); + } + } + + // endregion + + /** Test-only environment variable provider that replaces the real one during tests. */ + public static class TestEnvironmentVariables + extends EnvironmentVariables.EnvironmentVariablesProvider { + private final Map env = new HashMap<>(); + + TestEnvironmentVariables(String... kv) { + for (int i = 0; i + 1 < kv.length; i += 2) { + this.env.put(kv[i], kv[i + 1]); + } + } + + @Override + public String get(String name) { + return env.get(name); + } + + @Override + public Map getAll() { + return env; + } + + public void set(String name, String value) { + env.put(name, value); + } + + public void removePrefixed(String prefix) { + env.keySet().removeIf(k -> k.startsWith(prefix)); + } + + public void clear() { + env.clear(); + } + + @SuppressForbidden + static TestEnvironmentVariables setup(String... kv) { + TestEnvironmentVariables provider = new TestEnvironmentVariables(kv); + EnvironmentVariables.provider = provider; + + String propagateVars = System.getenv("TEST_ENV_PROPAGATE_VARS"); + if (propagateVars != null) { + for (String envVar : propagateVars.split(",")) { + provider.env.put(envVar, System.getenv(envVar)); + } + } + + return provider; + } + } +} diff --git a/utils/junit-utils/src/main/java/datadog/trace/junit/utils/config/WithConfigs.java b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/config/WithConfigs.java similarity index 91% rename from utils/junit-utils/src/main/java/datadog/trace/junit/utils/config/WithConfigs.java rename to utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/config/WithConfigs.java index e0343437823..55681b56857 100644 --- a/utils/junit-utils/src/main/java/datadog/trace/junit/utils/config/WithConfigs.java +++ b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/config/WithConfigs.java @@ -1,4 +1,4 @@ -package datadog.trace.junit.utils.config; +package datadog.trace.test.junit.utils.config; import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.ElementType.TYPE; diff --git a/utils/junit-utils/src/main/java/datadog/trace/junit/utils/context/AllowContextTesting.java b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/context/AllowContextTesting.java similarity index 91% rename from utils/junit-utils/src/main/java/datadog/trace/junit/utils/context/AllowContextTesting.java rename to utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/context/AllowContextTesting.java index ba20511d413..e548a0f2c6b 100644 --- a/utils/junit-utils/src/main/java/datadog/trace/junit/utils/context/AllowContextTesting.java +++ b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/context/AllowContextTesting.java @@ -1,4 +1,4 @@ -package datadog.trace.junit.utils.context; +package datadog.trace.test.junit.utils.context; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/utils/junit-utils/src/main/java/datadog/trace/junit/utils/context/AllowContextTestingExtension.java b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/context/AllowContextTestingExtension.java similarity index 95% rename from utils/junit-utils/src/main/java/datadog/trace/junit/utils/context/AllowContextTestingExtension.java rename to utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/context/AllowContextTestingExtension.java index e07149bdc89..a9b9c44861c 100644 --- a/utils/junit-utils/src/main/java/datadog/trace/junit/utils/context/AllowContextTestingExtension.java +++ b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/context/AllowContextTestingExtension.java @@ -1,4 +1,4 @@ -package datadog.trace.junit.utils.context; +package datadog.trace.test.junit.utils.context; import de.thetaphi.forbiddenapis.SuppressForbidden; import org.junit.jupiter.api.extension.BeforeAllCallback; diff --git a/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/context/LegacyContextTestingExtension.java b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/context/LegacyContextTestingExtension.java new file mode 100644 index 00000000000..0b51926c5ce --- /dev/null +++ b/utils/test-junit-utils/src/main/java/datadog/trace/test/junit/utils/context/LegacyContextTestingExtension.java @@ -0,0 +1,20 @@ +package datadog.trace.test.junit.utils.context; + +import de.thetaphi.forbiddenapis.SuppressForbidden; +import org.junit.jupiter.api.extension.BeforeAllCallback; +import org.junit.jupiter.api.extension.ExtensionContext; + +/** JUnit 5 extension that decides whether to register the legacy approach to managing contexts. */ +@SuppressForbidden +public class LegacyContextTestingExtension implements BeforeAllCallback { + @Override + public void beforeAll(ExtensionContext context) { + try { + Class.forName("datadog.trace.bootstrap.instrumentation.api.AgentTracer") + .getMethod("maybeInstallLegacyContextManager") + .invoke(null); + } catch (Throwable ignore) { + // don't block testing if the legacy approach to managing contexts isn't available + } + } +} diff --git a/utils/test-utils/build.gradle.kts b/utils/test-utils/build.gradle.kts index 4481b0cbbba..a7d58365c2a 100644 --- a/utils/test-utils/build.gradle.kts +++ b/utils/test-utils/build.gradle.kts @@ -4,6 +4,27 @@ plugins { apply(from = "$rootDir/gradle/java.gradle") +extra["excludedClassesCoverage"] = listOf( + "datadog.trace.test.logging.*", + "external.util.stacktrace.*", + "datadog.trace.test.util.AnyStackRunner*", + "datadog.trace.test.util.AssertionsUtils", + "datadog.trace.test.util.CircularBuffer", + "datadog.trace.test.util.CleanConfigStateExtension", + "datadog.trace.test.util.DDJavaSpecification", + "datadog.trace.test.util.ForkedTestUtils", + "datadog.trace.test.util.GCUtils", + "datadog.trace.test.util.ThreadUtils*", + "datadog.trace.test.util.ConfigInstrumentationFailedListener", + "datadog.trace.test.util.ConfigTransformSpockExtension*", + "datadog.trace.test.util.ControllableEnvironmentVariables*", + "datadog.trace.test.util.DDSpecification*", + "datadog.trace.test.util.Flaky*", + "datadog.trace.test.util.FlakySpockExtension*", + "datadog.trace.test.util.MultipartRequestParser*", + "datadog.trace.test.util.NonRetryable", +) + dependencies { api(libs.bytebuddy) api(libs.bytebuddyagent) @@ -11,9 +32,11 @@ dependencies { api(project(":components:environment")) api(project(":utils:config-utils")) - api(project(":utils:junit-utils")) + api(project(":utils:test-junit-utils")) + api(project(":utils:test-junit-converter-utils")) api(group = "commons-fileupload", name = "commons-fileupload", version = "1.5") + compileOnly(project(":components:annotations")) compileOnly(libs.junit.jupiter) compileOnly(libs.logback.core) compileOnly(libs.logback.classic) diff --git a/utils/test-utils/gradle.lockfile b/utils/test-utils/gradle.lockfile index ba34f0b708b..d674cf9b1fc 100644 --- a/utils/test-utils/gradle.lockfile +++ b/utils/test-utils/gradle.lockfile @@ -1,10 +1,12 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :utils:test-utils:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=compileClasspath,testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=compileClasspath,testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=runtimeClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -17,8 +19,8 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=compileClasspath,runtimeClasspath,testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -41,10 +43,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=compileClasspath,testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=compileClasspath,testCompileClasspath,testRuntimeClasspath @@ -58,10 +60,13 @@ org.mockito:mockito-core:4.4.0=testRuntimeClasspath org.objenesis:objenesis:3.3=compileClasspath,testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=compileClasspath,testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/utils/test-utils/src/main/groovy/datadog/trace/test/util/StringUtils.groovy b/utils/test-utils/src/main/groovy/datadog/trace/test/util/StringUtils.groovy deleted file mode 100644 index 6b1b4c0c00a..00000000000 --- a/utils/test-utils/src/main/groovy/datadog/trace/test/util/StringUtils.groovy +++ /dev/null @@ -1,25 +0,0 @@ -package datadog.trace.test.util - -class StringUtils { - - static String padHexLower(String hex, int size) { - hex = hex.toLowerCase(Locale.ROOT) - int left = size - hex.length() - if (size > 0) { - return "${'0' * left}${hex}" - } - return hex - } - - static String trimHex(String hex) { - int length = hex.length() - int i = 0 - while (i < length && hex.charAt(i) == '0') { - i++ - } - if (i == length) { - return "0" - } - return hex.substring(i, length) - } -} diff --git a/utils/test-utils/src/main/java/datadog/trace/test/util/DDJavaSpecification.java b/utils/test-utils/src/main/java/datadog/trace/test/util/DDJavaSpecification.java index ed1d508aec3..d4780e89098 100644 --- a/utils/test-utils/src/main/java/datadog/trace/test/util/DDJavaSpecification.java +++ b/utils/test-utils/src/main/java/datadog/trace/test/util/DDJavaSpecification.java @@ -1,7 +1,7 @@ package datadog.trace.test.util; -import datadog.trace.junit.utils.config.WithConfigExtension; -import datadog.trace.junit.utils.context.AllowContextTestingExtension; +import datadog.trace.test.junit.utils.config.WithConfigExtension; +import datadog.trace.test.junit.utils.context.AllowContextTestingExtension; import de.thetaphi.forbiddenapis.SuppressForbidden; import java.util.List; import java.util.Set; diff --git a/utils/test-utils/src/main/java/datadog/trace/test/util/PollingConditions.java b/utils/test-utils/src/main/java/datadog/trace/test/util/PollingConditions.java new file mode 100644 index 00000000000..654bcc758b7 --- /dev/null +++ b/utils/test-utils/src/main/java/datadog/trace/test/util/PollingConditions.java @@ -0,0 +1,141 @@ +package datadog.trace.test.util; + +import datadog.trace.api.internal.VisibleForTesting; +import datadog.trace.test.util.ThreadUtils.ThrowingRunnable; + +/** + * A small Java port of Spock's {@code spock.util.concurrent.PollingConditions}. It repeatedly + * evaluates a block of assertions until they pass or a timeout elapses. + * + *

      The condition block is a {@link ThrowingRunnable}, so it may throw checked exceptions. Any + * {@link Throwable} it throws is treated as "not satisfied yet" and triggers another attempt. + * + *

      Usage: + * + *

      {@code
      + * // timeout defaults to 1 second
      + * new PollingConditions().eventually(() -> assertTrue(done.get()));
      + *
      + * // timeout-only is the common case
      + * new PollingConditions(5).eventually(() -> assertEquals(2, requests.size()));
      + *
      + * // all knobs, chained
      + * new PollingConditions()
      + *     .timeout(15).initialDelay(1).delay(0.5).factor(1)
      + *     .eventually(() -> assertTrue(done.get()));
      + * }
      + */ +public class PollingConditions { + private double timeout = 1; // seconds + private double initialDelay = 0; // seconds + private double delay = 0.1; // seconds + private double factor = 1.0; // delay multiplier between attempts + + public PollingConditions() {} + + /** + * @param timeoutSeconds the timeout in seconds (the most common single setting). + * @throws IllegalArgumentException if {@code timeoutSeconds} is negative. + */ + public PollingConditions(double timeoutSeconds) { + this.timeout = requireNonNegative(timeoutSeconds, "timeout"); + } + + /** + * @param seconds how long to keep retrying before failing. Defaults to {@code 1}. + */ + public PollingConditions timeout(double seconds) { + this.timeout = requireNonNegative(seconds, "timeout"); + return this; + } + + /** + * @param seconds how long to wait before the very first attempt. Defaults to {@code 0}. + */ + public PollingConditions initialDelay(double seconds) { + this.initialDelay = requireNonNegative(seconds, "initialDelay"); + return this; + } + + /** + * @param seconds how long to wait between attempts. Defaults to {@code 0.1}. + */ + public PollingConditions delay(double seconds) { + this.delay = requireNonNegative(seconds, "delay"); + return this; + } + + /** + * @param factor multiplier applied to the delay after each attempt (exponential back-off). + * Defaults to {@code 1.0} (constant delay). + */ + public PollingConditions factor(double factor) { + this.factor = requireNonNegative(factor, "factor"); + return this; + } + + /** Retries {@code conditions} until it passes or the configured {@link #timeout} elapses. */ + public void eventually(ThrowingRunnable conditions) { + within(this.timeout, conditions); + } + + /** + * Retries {@code conditions} until it passes or {@code seconds} elapse, overriding the configured + * {@link #timeout} for this call. + */ + public void within(double seconds, ThrowingRunnable conditions) { + final long timeoutMillis = toMillis(requireNonNegative(seconds, "timeout")); + final long start = System.currentTimeMillis(); + if (this.initialDelay > 0) { + sleep(toMillis(this.initialDelay)); + } + long currDelay = toMillis(this.delay); + int attempts = 0; + long elapsed = 0; + Throwable lastFailure = null; + while (elapsed <= timeoutMillis) { + try { + attempts++; + conditions.run(); + return; + } catch (final Throwable e) { + elapsed = System.currentTimeMillis() - start; + lastFailure = e; + // Never sleep past the deadline. + final long sleepMillis = + Math.min(currDelay, start + timeoutMillis - System.currentTimeMillis()); + if (sleepMillis > 0) { + sleep(sleepMillis); + } + currDelay = (long) (currDelay * factor); + } + } + throw new AssertionError( + String.format( + "Condition not satisfied after %1.2f seconds and %d attempts", + elapsed / 1000d, attempts), + lastFailure); + } + + private static long toMillis(final double seconds) { + return Math.round(seconds * 1000); + } + + private static double requireNonNegative(double value, String name) { + if (value < 0) { + throw new IllegalArgumentException(name + " must be >= 0 but was " + value); + } + return value; + } + + // VisibleForTesting to allow test code to override it and avoid flaky timing-based assertions. + @VisibleForTesting + void sleep(final long millis) { + try { + Thread.sleep(millis); + } catch (final InterruptedException e) { + Thread.currentThread().interrupt(); + throw new AssertionError("Interrupted while waiting for condition", e); + } + } +} diff --git a/utils/test-utils/src/main/java/datadog/trace/test/util/ThreadUtils.java b/utils/test-utils/src/main/java/datadog/trace/test/util/ThreadUtils.java index 1f22d9794f5..8439c2c038a 100644 --- a/utils/test-utils/src/main/java/datadog/trace/test/util/ThreadUtils.java +++ b/utils/test-utils/src/main/java/datadog/trace/test/util/ThreadUtils.java @@ -9,30 +9,53 @@ public class ThreadUtils { + /** A {@link Runnable} whose {@link #run()} may throw a checked exception. */ + @FunctionalInterface + public interface ThrowingRunnable { + void run() throws Throwable; + } + /** - * Utility to easily run a Closure in parallel, i.e. in spock like this: + * Utility to easily run a piece of code in parallel, e.g. in a JUnit test like this: * *
      {@code
      -   * def "some test"() {
      -   *   expect:
      -   *   runConcurrently(10, 100, {
      -   *     def something = ...
      -   *     def other = ...
      -   *     assert something == other
      -   *   })
      -   * }
      +   * runConcurrently(
      +   *     10,
      +   *     100,
      +   *     () -> {
      +   *       Object something = computeSomething();
      +   *       Object other = computeOther();
      +   *       assertEquals(something, other);
      +   *     });
          * }
      * - * Writing a spock extension was investigated, but it is not possible to run an Invocation - * multiple times concurrently since a lot of the spock internal state and mock scoping is not - * thread safe. - * * @param concurrency the number of concurrent invocations * @param totalInvocations the total number of invocations - * @param closure the closure to run - * @return true if everything went well + * @param runnable the code to run + * @return {@code true} if everything went well * @throws Throwable if anything went wrong */ + public static boolean runConcurrently( + final int concurrency, final int totalInvocations, final ThrowingRunnable runnable) + throws Throwable { + return runConcurrently( + concurrency, + totalInvocations, + new Closure(null) { + @Override + public Void call() { + try { + runnable.run(); + } catch (RuntimeException | Error e) { + throw e; + } catch (Throwable t) { + throw new RuntimeException(t); + } + return null; + } + }); + } + public static boolean runConcurrently( final int concurrency, final int totalInvocations, final Closure closure) throws Throwable { diff --git a/utils/test-utils/src/test/java/datadog/trace/test/util/PollingConditionsTest.java b/utils/test-utils/src/test/java/datadog/trace/test/util/PollingConditionsTest.java new file mode 100644 index 00000000000..64ea4c5fe7e --- /dev/null +++ b/utils/test-utils/src/test/java/datadog/trace/test/util/PollingConditionsTest.java @@ -0,0 +1,166 @@ +package datadog.trace.test.util; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.atomic.AtomicInteger; +import org.junit.jupiter.api.Test; + +class PollingConditionsTest { + + @Test + void passesOnFirstAttempt() { + AtomicInteger attempts = new AtomicInteger(); + new PollingConditions().eventually(attempts::incrementAndGet); + assertEquals(1, attempts.get()); + } + + @Test + void succeedsAfterSeveralRetries() { + AtomicInteger attempts = new AtomicInteger(); + new PollingConditions(2) + .delay(0.01) + .eventually( + () -> { + if (attempts.incrementAndGet() < 5) { + fail("not yet"); + } + }); + assertEquals(5, attempts.get()); + } + + @Test + void timesOutWithFormattedMessageAndUnderlyingCause() { + AssertionError error = + assertThrows( + AssertionError.class, + () -> + new PollingConditions(0.1) + .delay(0.01) + .eventually(() -> assertEquals(1, 2, "still wrong"))); + + assertTrue(error.getMessage().startsWith("Condition not satisfied after"), error.getMessage()); + assertTrue(error.getMessage().contains("attempts"), error.getMessage()); + + Throwable cause = error.getCause(); + assertInstanceOf(AssertionError.class, cause); + assertTrue(cause.getMessage().contains("still wrong"), cause.getMessage()); + } + + @Test + void withinOverridesConfiguredTimeout() { + // The instance timeout is huge, but within() must use its own (tiny) timeout and fail fast. + long start = System.currentTimeMillis(); + assertThrows( + AssertionError.class, + () -> new PollingConditions(60).delay(0.01).within(0.1, () -> fail("never"))); + long elapsed = System.currentTimeMillis() - start; + assertTrue( + elapsed < 5_000, "within() should honor its own short timeout, took " + elapsed + "ms"); + } + + @Test + void retriesWhenConditionThrowsCheckedException() { + AtomicInteger attempts = new AtomicInteger(); + new PollingConditions(2) + .delay(0.01) + .eventually( + () -> { + if (attempts.incrementAndGet() < 3) { + throw new IOException("not ready"); + } + }); + assertEquals(3, attempts.get()); + } + + @Test + void factorMultipliesDelayBetweenAttempts() { + // Large timeout so the run ends by success (after 4 attempts), never by the deadline; the + // recording subclass captures the requested delays without actually sleeping, so this is + // deterministic rather than dependent on wall-clock scheduling. + RecordingPollingConditions conditions = new RecordingPollingConditions(100); + conditions.delay(0.02).factor(4); // 20ms base delay, multiplied by 4 after each attempt + + AtomicInteger attempts = new AtomicInteger(); + conditions.eventually( + () -> { + if (attempts.incrementAndGet() < 4) { + fail("not yet"); + } + }); + + assertEquals(4, attempts.get()); + // Three failed attempts -> three delays, each 4x the previous. + assertEquals(Arrays.asList(20L, 80L, 320L), conditions.requestedSleeps); + } + + @Test + void appliesInitialDelayBeforeFirstAttempt() { + AtomicInteger attempts = new AtomicInteger(); + long start = System.currentTimeMillis(); + new PollingConditions() + .timeout(2) + .initialDelay(0.05) + .delay(0.01) + .factor(1) + .eventually(attempts::incrementAndGet); + long elapsed = System.currentTimeMillis() - start; + assertEquals(1, attempts.get()); + assertTrue(elapsed >= 40, "initial delay should have been applied, took " + elapsed + "ms"); + } + + @Test + void interruptedWhileWaitingFailsAndRestoresInterruptFlag() { + // Pre-interrupt so the first inter-attempt sleep throws InterruptedException immediately. + Thread.currentThread().interrupt(); + try { + AssertionError error = + assertThrows( + AssertionError.class, + () -> new PollingConditions(2).delay(0.05).eventually(() -> fail("retry"))); + assertEquals("Interrupted while waiting for condition", error.getMessage()); + assertTrue( + Thread.currentThread().isInterrupted(), "interrupt flag should have been restored"); + } finally { + // Clear the flag so it does not leak into other tests sharing this thread. + Thread.interrupted(); + } + } + + @Test + void rejectsNegativeOrNanConfiguration() { + // Check conditions parameters + assertThrows(IllegalArgumentException.class, () -> new PollingConditions(-1)); + assertThrows(IllegalArgumentException.class, () -> new PollingConditions().timeout(-1)); + assertThrows(IllegalArgumentException.class, () -> new PollingConditions().initialDelay(-1)); + assertThrows(IllegalArgumentException.class, () -> new PollingConditions().factor(-2)); + // Check delay and within + IllegalArgumentException error = + assertThrows(IllegalArgumentException.class, () -> new PollingConditions().delay(-0.5)); + assertTrue(error.getMessage().contains("delay"), error.getMessage()); + assertTrue(error.getMessage().contains("-0.5"), error.getMessage()); + assertThrows( + IllegalArgumentException.class, () -> new PollingConditions().within(-1, () -> {})); + } + + /** Captures the requested delays instead of sleeping, for deterministic back-off assertions. */ + private static final class RecordingPollingConditions extends PollingConditions { + final List requestedSleeps = new ArrayList<>(); + + RecordingPollingConditions(double timeoutSeconds) { + super(timeoutSeconds); + } + + @Override + void sleep(long millis) { + requestedSleeps.add(millis); + } + } +} diff --git a/utils/time-utils/build.gradle.kts b/utils/time-utils/build.gradle.kts index e89a0f94e2c..842cf61170f 100644 --- a/utils/time-utils/build.gradle.kts +++ b/utils/time-utils/build.gradle.kts @@ -4,11 +4,9 @@ plugins { apply(from = "$rootDir/gradle/java.gradle") -val excludedClassesCoverage by extra( - listOf( - "datadog.trace.api.time.ControllableTimeSource:", - "datadog.trace.api.time.SystemTimeSource" - ) +extra["excludedClassesCoverage"] = listOf( + "datadog.trace.api.time.ControllableTimeSource:", + "datadog.trace.api.time.SystemTimeSource" ) dependencies { diff --git a/utils/time-utils/gradle.lockfile b/utils/time-utils/gradle.lockfile index 7f4b9c56c0d..d81e1599842 100644 --- a/utils/time-utils/gradle.lockfile +++ b/utils/time-utils/gradle.lockfile @@ -1,10 +1,12 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :utils:time-utils:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath +com.datadoghq:dd-javac-plugin-client:0.2.2=testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -17,8 +19,8 @@ commons-io:commons-io:2.20.0=spotbugs de.thetaphi:forbiddenapis:3.10=compileClasspath,testCompileClasspath,testRuntimeClasspath io.leangen.geantyref:geantyref:1.3.16=testRuntimeClasspath jaxen:jaxen:2.0.0=spotbugs -net.bytebuddy:byte-buddy-agent:1.18.8=testCompileClasspath,testRuntimeClasspath -net.bytebuddy:byte-buddy:1.18.8=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy-agent:1.18.10=testCompileClasspath,testRuntimeClasspath +net.bytebuddy:byte-buddy:1.18.10=testCompileClasspath,testRuntimeClasspath net.sf.saxon:Saxon-HE:12.9=spotbugs org.apache.ant:ant-antlr:1.10.14=codenarc org.apache.ant:ant-junit:1.10.14=codenarc @@ -41,10 +43,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -58,10 +60,13 @@ org.mockito:mockito-core:4.4.0=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath diff --git a/utils/time-utils/src/test/groovy/datadog/trace/api/time/TimeUtilsTest.groovy b/utils/time-utils/src/test/groovy/datadog/trace/api/time/TimeUtilsTest.groovy deleted file mode 100644 index 0a569b57c93..00000000000 --- a/utils/time-utils/src/test/groovy/datadog/trace/api/time/TimeUtilsTest.groovy +++ /dev/null @@ -1,50 +0,0 @@ -package datadog.trace.api.time - -import datadog.trace.test.util.DDSpecification - -class TimeUtilsTest extends DDSpecification { - - def "test simple delay parsing"() { - when: - long delay = TimeUtils.parseSimpleDelay(delayString) - - then: - delay == expected - - where: - delayString | expected - null | -1 - "" | -1 - "foo" | -1 - "-8" | -1 - "-1" | -1 - "0" | 0 - "1" | 1 - "2" | 2 - "3" | 3 - "0s" | 0 - "1s" | 1 - "2s" | 2 - "3s" | 3 - "0m" | 0 - "1m" | 60 - "2m" | 120 - "3m" | 180 - "0h" | 0 - "1h" | 3600 - "2h" | 7200 - "3h" | 10800 - "0S" | 0 - "1S" | 1 - "2S" | 2 - "3S" | 3 - "0M" | 0 - "1M" | 60 - "2M" | 120 - "3M" | 180 - "0H" | 0 - "1H" | 3600 - "2H" | 7200 - "3H" | 10800 - } -} diff --git a/utils/time-utils/src/test/java/datadog/trace/api/time/TimeUtilsTest.java b/utils/time-utils/src/test/java/datadog/trace/api/time/TimeUtilsTest.java new file mode 100644 index 00000000000..819c7e0c00f --- /dev/null +++ b/utils/time-utils/src/test/java/datadog/trace/api/time/TimeUtilsTest.java @@ -0,0 +1,49 @@ +package datadog.trace.api.time; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +import datadog.trace.test.util.DDJavaSpecification; +import org.tabletest.junit.TableTest; + +public class TimeUtilsTest extends DDJavaSpecification { + + @TableTest({ + "delayString | expected", + " | -1 ", + "'' | -1 ", + "foo | -1 ", + "-8 | -1 ", + "-1 | -1 ", + "0 | 0 ", + "1 | 1 ", + "2 | 2 ", + "3 | 3 ", + "0s | 0 ", + "1s | 1 ", + "2s | 2 ", + "3s | 3 ", + "0m | 0 ", + "1m | 60 ", + "2m | 120 ", + "3m | 180 ", + "0h | 0 ", + "1h | 3600 ", + "2h | 7200 ", + "3h | 10800 ", + "0S | 0 ", + "1S | 1 ", + "2S | 2 ", + "3S | 3 ", + "0M | 0 ", + "1M | 60 ", + "2M | 120 ", + "3M | 180 ", + "0H | 0 ", + "1H | 3600 ", + "2H | 7200 ", + "3H | 10800 " + }) + void testSimpleDelayParsing(String delayString, long expected) { + assertEquals(expected, TimeUtils.parseSimpleDelay(delayString)); + } +} diff --git a/utils/version-utils/build.gradle.kts b/utils/version-utils/build.gradle.kts index 6eb07efff46..ff6517cc687 100644 --- a/utils/version-utils/build.gradle.kts +++ b/utils/version-utils/build.gradle.kts @@ -1,10 +1,9 @@ plugins { `java-library` + id("dd-trace-java.version-file") } apply(from = "$rootDir/gradle/java.gradle") -// We do not publish separate jar, but having version file is useful -apply(from = "$rootDir/gradle/version.gradle") dependencies { implementation(libs.slf4j) diff --git a/utils/version-utils/gradle.lockfile b/utils/version-utils/gradle.lockfile index 62b097024f2..19c5038f00a 100644 --- a/utils/version-utils/gradle.lockfile +++ b/utils/version-utils/gradle.lockfile @@ -1,10 +1,11 @@ # This is a Gradle generated file for dependency locking. # Manual edits can break the build and are not advised. # This file is expected to be part of source control. +# To regenerate this file, run: ./gradlew :utils:version-utils:dependencies --write-locks ch.qos.logback:logback-classic:1.2.13=testCompileClasspath,testRuntimeClasspath ch.qos.logback:logback-core:1.2.13=testCompileClasspath,testRuntimeClasspath com.github.javaparser:javaparser-core:3.25.6=codenarc -com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath +com.github.spotbugs:spotbugs-annotations:4.9.8=compileClasspath,spotbugs com.github.spotbugs:spotbugs:4.9.8=spotbugs com.github.stephenc.jcip:jcip-annotations:1.0-1=spotbugs com.google.code.findbugs:jsr305:3.0.2=compileClasspath,spotbugs,testCompileClasspath,testRuntimeClasspath @@ -39,10 +40,10 @@ org.codenarc:CodeNarc:3.7.0=codenarc org.dom4j:dom4j:2.2.0=spotbugs org.gmetrics:GMetrics:2.1.0=codenarc org.hamcrest:hamcrest:3.0=testCompileClasspath,testRuntimeClasspath -org.jacoco:org.jacoco.agent:0.8.14=jacocoAgent,jacocoAnt -org.jacoco:org.jacoco.ant:0.8.14=jacocoAnt -org.jacoco:org.jacoco.core:0.8.14=jacocoAnt -org.jacoco:org.jacoco.report:0.8.14=jacocoAnt +org.jacoco:org.jacoco.agent:0.8.15=jacocoAgent,jacocoAnt +org.jacoco:org.jacoco.ant:0.8.15=jacocoAnt +org.jacoco:org.jacoco.core:0.8.15=jacocoAnt +org.jacoco:org.jacoco.report:0.8.15=jacocoAnt org.junit.jupiter:junit-jupiter-api:5.14.1=testCompileClasspath,testRuntimeClasspath org.junit.jupiter:junit-jupiter-engine:5.14.1=testRuntimeClasspath org.junit.jupiter:junit-jupiter-params:5.14.1=testCompileClasspath,testRuntimeClasspath @@ -56,10 +57,13 @@ org.mockito:mockito-core:4.4.0=testRuntimeClasspath org.objenesis:objenesis:3.3=testCompileClasspath,testRuntimeClasspath org.opentest4j:opentest4j:1.3.0=testCompileClasspath,testRuntimeClasspath org.ow2.asm:asm-analysis:9.9=spotbugs -org.ow2.asm:asm-commons:9.9=jacocoAnt,spotbugs -org.ow2.asm:asm-tree:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm-commons:9.10.1=jacocoAnt +org.ow2.asm:asm-commons:9.9=spotbugs +org.ow2.asm:asm-tree:9.10.1=jacocoAnt +org.ow2.asm:asm-tree:9.9=spotbugs org.ow2.asm:asm-util:9.9=spotbugs -org.ow2.asm:asm:9.9=jacocoAnt,spotbugs +org.ow2.asm:asm:9.10.1=jacocoAnt +org.ow2.asm:asm:9.9=spotbugs org.slf4j:jcl-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:jul-to-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath org.slf4j:log4j-over-slf4j:1.7.30=testCompileClasspath,testRuntimeClasspath